Sindbad~EG File Manager
(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var r in a)t.o(a,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{BaseEditor:()=>ct,DEBUG_MODE:()=>Gt,Editor:()=>Vt,EditorHeaderActionsRegistry:()=>d,EditorHeaderOptionsRegistry:()=>P,getEditorHeaderActions:()=>p,getEditorHeaderOptions:()=>g,registerEditorHeaderAction:()=>u,registerEditorHeaderActionGroup:()=>S,registerEditorHeaderOption:()=>G,registerEditorHeaderOptionGroup:()=>m,useAllFieldErrors:()=>q,useEditor:()=>$,useEditorHeaderActions:()=>h,useEditorHeaderOptions:()=>V,useFieldError:()=>L,useFields:()=>X,useTabErrors:()=>U,useTabHasError:()=>Z,withDataStore:()=>dt,withModal:()=>pt,withQueryParams:()=>Pt});var a={};t.r(a),t.d(a,{historyEditorHeaderAction:()=>w,statusEditorHeaderAction:()=>j});var r={};t.r(r),t.d(r,{deleteBulkAction:()=>D});var o={};t.r(o),t.d(o,{Component:()=>ot,default:()=>it,getCallToActionTypeOptions:()=>rt,name:()=>et,title:()=>at});var i={};t.r(i),t.d(i,{generalTab:()=>o});const s=window.wp.domReady;var n=t.n(s);const l=window.wp.hooks,c=window.popupMaker.registry,d=(0,c.createRegistry)({name:"cta-editor/editor-header-actions",groups:{general:{priority:10}},defaultGroup:"general"}),h=()=>d.useItems(),u=d.register,S=d.registerGroup,p=()=>d.getItems(),P=(0,c.createRegistry)({name:"cta-editor/editor-header-options",groups:{general:{priority:10}}}),V=()=>P.useItems(),G=P.register,m=P.registerGroup,g=()=>P.getItems(),v=window.popupMaker.i18n,f=window.popupMaker.coreData,E=window.wp.components,b=window.wp.data,x=window.ReactJSXRuntime,w={id:"history",priority:99,render:({values:t})=>{const e=(0,b.useSelect)(t=>t(f.callToActionStore).isResolving("updateCallToAction"),[]),{hasUndo:a,hasRedo:r,hasEdits:o}=(0,b.useSelect)(e=>{if(!t.id)return{hasUndo:!1,hasRedo:!1,hasEdits:!1};const a=e(f.callToActionStore);return{hasUndo:a.hasUndo(t.id),hasRedo:a.hasRedo(t.id),hasEdits:a.hasEdits(t.id)}},[t,e]),{undo:i,redo:s}=(0,b.useDispatch)(f.callToActionStore);return(0,x.jsx)(x.Fragment,{children:o&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(E.Button,{disabled:e||!a,variant:"tertiary",icon:"undo","aria-label":(0,v.__)("Undo","popup-maker"),onClick:()=>i(t.id)}),(0,x.jsx)(E.Button,{disabled:e||!r,variant:"tertiary",icon:"redo","aria-label":(0,v.__)("Redo","popup-maker"),onClick:()=>s(t.id)})]})})}};function C(t){var e,a,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(a=C(t[e]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}const T=function(){for(var t,e,a=0,r="",o=arguments.length;a<o;a++)(t=arguments[a])&&(e=C(t))&&(r&&(r+=" "),r+=e);return r},j={id:"status",priority:100,render:({values:t})=>{const e=(0,b.useSelect)(t=>t(f.callToActionStore).isResolving("updateCallToAction"),[]),{updateEditorValues:a}=(0,b.useDispatch)(f.callToActionStore);return(0,x.jsx)("div",{className:T(["call-to-action-enabled-toggle","publish"===t?.status?"enabled":"disabled"]),style:{minWidth:"11.5ch"},children:(0,x.jsx)(E.ToggleControl,{disabled:e,label:"publish"===t?.status?(0,v.__)("Enabled","popup-maker"):(0,v.__)("Disabled","popup-maker"),checked:"publish"===t?.status,onChange:e=>a({id:t.id,status:e?"publish":"draft"}),__nextHasNoMarginBottom:!0})})}},_=window.popupMaker.components,k=window.wp.element,y=((0,k.forwardRef)(({icon:t,size:e=24,...a},r)=>(0,k.cloneElement)(t,{width:e,height:e,...a,ref:r})),window.wp.primitives),A=(y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Circle,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,(0,x.jsx)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,x.jsx)(y.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm3.8 10.7-1.1 1.1-2.7-2.7-2.7 2.7-1.1-1.1 2.7-2.7-2.7-2.7 1.1-1.1 2.7 2.7 2.7-2.7 1.1 1.1-2.7 2.7 2.7 2.7Z"})})),N=(y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,(0,x.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(y.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})),O=(y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.Circle,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.G,y.Path,y.Path,y.SVG,y.G,y.Path,y.Path,y.SVG,y.G,y.Path,y.Path,y.SVG,y.G,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,(0,x.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(y.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})})),M=(y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,(0,x.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(y.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})})),F=(0,x.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(y.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),D=(y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.Path,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.Path,y.SVG,y.Path,y.Path,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,y.SVG,y.Path,{id:"delete",group:"trash",priority:6,render:({values:t,closeModal:e})=>{const[a,r]=(0,k.useState)(!1),o=(0,k.useRef)(a),[i,s]=(0,k.useState)();(0,k.useEffect)(()=>{o.current=a},[a]);const{deleteCallToAction:n}=(0,b.useDispatch)(f.callToActionStore),l=(0,k.useCallback)(()=>{n(t.id,o.current),e()},[n,t.id,e]);return(0,x.jsxs)(x.Fragment,{children:[i&&(0,x.jsxs)(_.ConfirmDialogue,{...i,onClose:()=>{s(void 0)},children:[(0,x.jsx)("p",{children:(0,v.__)("Are you sure you want to delete this call to action?","popup-maker")}),(0,x.jsx)(E.ToggleControl,{label:(0,v.__)("Permanently delete all associated content","popup-maker"),checked:a,onChange:r})]}),(0,x.jsx)(E.Button,{text:(0,v.__)("Delete","popup-maker"),icon:A,isDestructive:!0,onClick:()=>{s({isDestructive:!0,callback:l})}})]})}}),R=window.popupMaker.utils,I=window.wp.url,H=window.popupMaker.useQueryParams;let B=!1;const $=()=>{const{isEditorActive:t,editorId:e}=(0,b.useSelect)(t=>{const e=t(f.callToActionStore);return{editorId:e.getEditorId(),isEditorActive:e.isEditorActive()}},[]),{changeEditorId:a}=(0,b.useDispatch)(f.callToActionStore),[r,o]=(0,H.useQueryParams)({edit:H.NumberParam,add:H.BooleanParam,tab:H.StringParam}),{edit:i,tab:s}=r;return(0,k.useEffect)(()=>{if(B)return;B=!0;const t=i&&i>0?i:void 0;t&&!e&&a(t)},[]),{tab:null===s?void 0:s,setTab:t=>o({tab:t}),setEditorId:(0,k.useCallback)(t=>{a(t),o({edit:t})},[a,o]),clearEditorParams:()=>{a(void 0),o({add:void 0,edit:void 0,tab:void 0})},editorId:e,isEditorActive:t}},X=()=>{const{updateEditorValues:t}=(0,b.useDispatch)(f.callToActionStore),{values:e}=(0,b.useSelect)(t=>{const e=t(f.callToActionStore);return{values:e.getCurrentEditorValues(),isEditorActive:e.isEditorActive()}},[]),a=(0,k.useMemo)(()=>null!=e?e:f.defaultCtaValues,[e]),{settings:r}=a,o=(0,k.useCallback)(e=>{t({...a,settings:{...a.settings,...e}})},[t,a]),i=(t,e)=>{const a=(0,l.applyFilters)("popupMaker.callToActionEditor.fieldIsVisible",void 0,t,r,e);return void 0===a||a},s=(0,k.useMemo)(()=>(0,l.applyFilters)("popupMaker.callToActionEditor.tabFields",{},r,o),[r,o]);return{values:e,fieldIsVisible:i,getTabFields:t=>{var e;return(0,l.applyFilters)(`popupMaker.callToActionEditor.tabFields.${t}`,null!==(e=s[t])&&void 0!==e?e:[],r,o).sort((t,e)=>t.priority-e.priority).filter(e=>i(e.id,t)).map(e=>{const a=(0,l.applyFilters)("popupMaker.callToActionEditor.renderField",e.component,e.id,t);return{...e,component:a}})},updateSettings:o,updateField:(t,e)=>{o({[t]:e})}}},z=window.wp.notices,L=t=>{const e=(0,b.useSelect)(t=>t(f.callToActionStore).getEditorId(),[]),{removeNotice:a}=(0,b.useDispatch)(z.store);return{error:(0,b.useSelect)(a=>{const r=a(z.store).getNotices(f.NOTICE_CONTEXT).find(a=>a.id===`field-error-${e||"new"}-${t}`);return r?.content||null},[e,t]),clearError:(0,k.useCallback)(()=>{void 0!==e&&a(`field-error-${e||"new"}-${t}`,f.NOTICE_CONTEXT)},[e,t,a])}},U=t=>{const e=(0,b.useSelect)(t=>t(f.callToActionStore).getEditorId(),[]),{removeNotice:a}=(0,b.useDispatch)(z.store),{getTabFields:r}=X(),o=(0,b.useSelect)(a=>{const o=a(z.store).getNotices(f.NOTICE_CONTEXT),i=r(t),s=new Set(i.map(t=>t.id));return o.filter(t=>{if(!t.id?.startsWith(`field-error-${e||"new"}-`))return!1;const a=t.id.match(/field-error-(?:\d+|new)-(.+)$/),r=a?.[1];return r&&s.has(r)})},[e,t]),i=o.length>0,s=o.length,n=o.map(t=>t.id);return{hasErrors:i,errorCount:s,clearTabErrors:(0,k.useCallback)(()=>{n.forEach(t=>a(t,f.NOTICE_CONTEXT))},[n,a])}},Z=t=>{const{hasErrors:e}=U(t);return e},q=()=>{const t=(0,b.useSelect)(t=>t(f.callToActionStore).getEditorId(),[]),{removeNotice:e}=(0,b.useDispatch)(z.store),a=(0,b.useSelect)(e=>{const a=e(z.store).getNotices(f.NOTICE_CONTEXT),r={};return a.forEach(e=>{const a=e.id?.match(new RegExp(`^field-error-${t||"new"}-(.+)$`));a&&(r[a[1]]=e.content)}),r},[t]),r=(0,b.useSelect)(e=>{const a=e(z.store).getNotices(f.NOTICE_CONTEXT),r=[];return a.forEach(e=>{const a=e.id?.match(new RegExp(`^field-error-${t||"new"}-(.+)$`));a&&r.push(e.id)}),r},[t]),o=(0,k.useCallback)(()=>{r.forEach(t=>e(t,f.NOTICE_CONTEXT))},[r,e]),i=(0,k.useCallback)(a=>{void 0!==t&&e(`field-error-${t||"new"}-${a}`,f.NOTICE_CONTEXT)},[t,e]);return{errors:a,hasAnyError:Object.keys(a).length>0,clearAllErrors:o,clearFieldError:i}},Q=window.React,W=({fieldId:t,title:e,error:a,className:r,children:o})=>{const i=null!=a&&""!==a;return(0,x.jsx)(E.Panel,{header:e,className:T("components-field-panel","cta-field-wrapper",`cta-field-wrapper--${t}`,{"cta-field-wrapper--has-error":i},r),children:(0,x.jsxs)(E.PanelBody,{opened:!0,children:[o,i&&(0,x.jsx)("div",{className:"cta-field-error",children:a})]})})},J=()=>{const t=(0,b.useSelect)(t=>t(z.store).getNotices(f.NOTICE_CONTEXT),[]);return Gt?0===t.length?(0,x.jsx)("div",{style:{padding:"10px",background:"#f0f0f0",margin:"10px 0",fontSize:"12px",fontFamily:"monospace"},children:(0,x.jsx)("strong",{children:`Debug: No notices found in context "${f.NOTICE_CONTEXT}"`})}):(0,x.jsxs)("div",{style:{padding:"10px",background:"#ffeeee",margin:"10px 0",fontSize:"12px",fontFamily:"monospace",border:"1px solid #cc1818"},children:[(0,x.jsx)("strong",{children:`Debug: Notices in context "${f.NOTICE_CONTEXT}":`}),(0,x.jsx)("ul",{style:{margin:"5px 0 0 20px",padding:0},children:t.map(t=>(0,x.jsxs)("li",{style:{marginBottom:"3px"},children:[(0,x.jsx)("strong",{children:t.id}),": ",t.content," ","(status: ",t.status,")"]},t.id))})]}):null},K=window.popupMaker.fields,Y=({fieldId:t,field:e,value:a,onChange:r})=>{var o;const{error:i,clearError:s}=L(t),n=t=>{i&&s(),r(t)};return(0,x.jsx)(W,{fieldId:t,title:null!==(o=e.label)&&void 0!==o?o:"",error:i,children:"url"===e.type?(0,x.jsx)(_.URLControl,{...e,value:a,onChange:t=>n(t.url)}):(0,x.jsx)(K.Field,{...e,value:a,onChange:n})})},tt=({tabName:t,message:e=(0,v.__)("Please fix the errors below.","popup-maker")})=>{const{hasErrors:a}=U(t),[r,o]=(0,Q.useState)(!1),i=(0,Q.useRef)(null),s=(0,Q.useRef)(!1),n=(0,Q.useRef)(!1),l=(0,b.useSelect)(t=>t(f.callToActionStore).isResolving("updateCallToAction"),[]);return(0,Q.useEffect)(()=>{i.current&&(clearTimeout(i.current),i.current=null);const t=a&&!s.current,e=n.current&&!l;return a&&(t||e)?(o(!0),Gt||(i.current=setTimeout(()=>{o(!1)},3e3))):a||o(!1),s.current=a,n.current=l,()=>{i.current&&clearTimeout(i.current)}},[a,l]),r?(0,x.jsx)(E.Notice,{status:"error",isDismissible:!1,children:e}):null},et="general",at=(0,v.__)("General","popup-maker"),rt=()=>{const{cta_types:t={}}=window.popupMakerCtaEditor||{},e=Object.values(t).map(t=>({value:t.key,label:t.label}));return(0,l.applyFilters)("popupMaker.callToActionEditor.typeOptions",[{value:"",label:(0,v.__)("Select a type","popup-maker")},...e])},ot=({callToAction:t,updateFields:e,updateSettings:a})=>{var r,o,i,s,n;const{getTabFields:l}=X(),{clearAllErrors:c}=q(),{settings:d}=t,h=(null!==(r=t.excerpt)&&void 0!==r?r:"").length/80,u=(0,R.clamp)(h,1,5),S=rt();return(0,x.jsxs)("div",{className:"general-tab",children:[(0,x.jsx)(tt,{tabName:"general"}),(0,x.jsx)(E.TextControl,{label:(0,v.__)("Name","popup-maker"),placeholder:(0,v.__)("Name…","popup-maker"),className:"title-field",value:null!==(o=t.title)&&void 0!==o?o:"",onChange:t=>e({title:t,slug:(0,I.cleanForSlug)(t)}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,x.jsx)(E.TextareaControl,{rows:u,scrolling:u>5?"auto":"no",label:(0,v.__)("Description","popup-maker"),placeholder:(0,v.__)("Add description…","popup-maker"),className:"description-field",value:null!==(i=t.excerpt)&&void 0!==i?i:"",onChange:t=>e({excerpt:t}),__nextHasNoMarginBottom:!0}),(null!==(s=t.title)&&void 0!==s?s:"").length<=0&&(0,x.jsx)(E.Notice,{status:"warning",isDismissible:!1,className:"title-field-notice",children:(0,v.__)("Enter a label for this set.","popup-maker")}),S.length>1&&(0,x.jsx)(E.SelectControl,{label:(0,v.__)("Action Type","popup-maker"),options:S,value:null!==(n=d.type)&&void 0!==n?n:"",onChange:t=>{c(),a({type:t})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),l("general").map(t=>(0,x.jsx)(k.Fragment,{children:t.component},t.id))]})},it=ot,{cta_types:st}=window.popupMakerCtaEditor,nt=()=>{(0,l.addFilter)("popupMaker.callToActionEditor.tabFields","popup-maker",(t,e,a)=>{const r=(o=e.type,null!==(i=Object.values(st).find(t=>t.key===o)?.fields)&&void 0!==i?i:{});var o,i;return 0===Object.keys(r).length?t:Object.entries(r).reduce((t,[r,o])=>(t[r]||(t[r]=[]),t[r]=[...t[r],...Object.entries(o).map(([t,r])=>{var o;return r&&r.type?{...r,id:t,priority:null!==(o=r?.priority)&&void 0!==o?o:0,component:(0,x.jsx)(k.Fragment,{children:!(()=>{if(!r.dependencies)return!1;const t=r.dependencies;return!Object.entries(t).every(([t,a])=>{const r=e[t];return"string"==typeof a?void 0===r?""===a:a===r:"boolean"==typeof a&&(void 0===r?!1===a:a===r)})})()&&(0,x.jsx)(Y,{fieldId:t,field:r,value:e[t],onChange:e=>a({[t]:e})})},t)}:null}).filter(t=>null!==t)],t),{...t})})};let lt=!1;const ct=({afterTabs:t,beforeTabs:e,className:a,...r})=>{var o;const[i,s]=(0,_.useControlledState)(r.tab,"general",r.setTab),[n,c]=(0,_.useControlledState)(r.values,f.defaultCtaValues,null!==(o=r.onChange)&&void 0!==o?o:R.noop),d=(0,k.useMemo)(()=>({callToAction:n,onChange:c,updateFields:t=>{c({...n,...t})},updateSettings:t=>{c({...n,settings:{...n.settings,...t}})},updateSetting:(t,e)=>{c({...n,settings:{...n.settings,[t]:e}})}}),[n,c]),{tabsFilter:h}=r,u=(0,k.useMemo)(()=>{const t=(0,l.applyFilters)("popupMaker.callToActionEditor.tabs",[]);return h?h(t):t},[h]),S=u.length>1;return(0,x.jsxs)("div",{className:T("call-to-action-editor",a),children:[e&&(0,x.jsx)("div",{className:"editor-tabs-before",children:e}),(0,x.jsx)("div",{className:"editor-tabs-container",children:S?(0,x.jsx)(E.TabPanel,{orientation:"vertical",initialTabName:null!=i?i:"general",onSelect:s,tabs:u,className:"editor-tabs",children:({Component:t})=>(0,x.jsx)(t,{...d})}):(0,x.jsx)("div",{className:"editor-tab-content",children:(()=>{const t=(()=>{if(0===u.length)return null;const t=u.find(t=>t.name===i)||u[0];return t?.Component})();return t?(0,x.jsx)(t,{...d}):(0,x.jsx)("div",{className:"no-content-available",children:"No content available"})})()})}),t&&(0,x.jsx)("div",{className:"editor-tabs-after",children:t})]})},dt=t=>function({id:e,defaultValues:a=f.defaultCtaValues,onSave:r,...o}){const[i,s]=(0,k.useState)(!1),n=(0,k.useRef)(!1),l=(0,k.useMemo)(()=>({...f.defaultCtaValues,...a,id:e}),[a,e]),{values:c=l,isEditorActive:d,isSaving:h,savedSuccessfully:u,getEditorValues:S}=(0,b.useSelect)(t=>{const a=t(f.callToActionStore),r=a.getResolutionState("createCallToAction")||a.getResolutionState("updateCallToAction");return{values:a.getEditedCallToAction(e),isEditorActive:a.isEditorActive(),isSaving:a.isResolving("updateCallToAction"),getEditorValues:a.getEditedCallToAction,savedSuccessfully:r?.status===f.DispatchStatus.Success}},[e]),{id:p}=c,{editRecord:P,resetRecordEdits:V,changeEditorId:G}=(0,b.useDispatch)(f.callToActionStore),m=(0,b.useSelect)(t=>t(z.store).getNotices(f.NOTICE_CONTEXT).filter(t=>!t.id?.startsWith("field-error-")),[]),{removeNotice:g}=(0,b.useDispatch)(z.store),{clearAllErrors:w}=q();(0,k.useEffect)(()=>(!d&&e&&G(e),()=>{p&&d&&(w(),G(void 0))}),[e,p,d,G]),(0,k.useEffect)(()=>{if(i){if(u&&!n.current){n.current=!0,s(!1);const t=S(c.id);r?.(t||c)}}else h&&(s(!0),n.current=!1)},[r,i,u,S,c,h]);const C=(0,b.useSelect)(t=>t(f.callToActionStore).hasEdits(p),[p]);if((0,k.useEffect)(()=>{const t=t=>{if(C){if(!window.confirm((0,v.__)("Changes you made may not be saved.","popup-maker")))return t.preventDefault(),!1;V(p)}return!0};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[C,p]),!c)return(0,x.jsx)(x.Fragment,{children:(0,v.__)("Editor requires a valid call to action.","popup-maker")});if(!d)return null;const T=()=>(0,x.jsx)(x.Fragment,{children:m.map(t=>(0,x.jsx)(E.Notice,{status:t.status||"error",className:"call-to-action-editor-error",onDismiss:!1!==t.isDismissible?()=>{g(t.id,f.NOTICE_CONTEXT)}:void 0,children:t.content},t.id))}),j=c;return(0,x.jsx)(t,{...o,values:j,onChange:t=>{P(c.id,t)},beforeTabs:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{}),(0,x.jsx)(T,{}),o.beforeTabs]})})},ht=({values:t,closeModal:e})=>{const a=(0,k.useRef)(void 0),r=h(),o={values:t,closeModal:e},i=({group:t})=>{if(!t||t===a.current)return null;const e=a.current;return a.current=t,e?(0,x.jsx)("span",{children:"|"}):null};return(0,x.jsx)(x.Fragment,{children:(a.current=void 0,(0,x.jsx)(x.Fragment,{children:r.map(({id:t,group:e,render:a})=>(0,x.jsxs)(k.Fragment,{children:[(0,x.jsx)(i,{group:e}),(0,x.jsx)(a,{...o})]},t))}))})},ut=window.lodash,St=({values:t,closeModal:e})=>{const a=(0,k.useRef)(void 0),r=(0,k.useRef)(),o=(0,k.useRef)(null),[i,s]=(0,k.useState)(!1),n=(0,ut.debounce)(()=>{s(!i)},100),l=V(),c={values:t,closeModal:e},d=({group:t})=>{if(!t||t===a.current)return null;const e=a.current;return a.current=t,e?(0,x.jsx)("hr",{}):null};return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(E.Dropdown,{className:"editor-header-options",contentClassName:"editor-header-options__popover",focusOnMount:"firstElement",open:i,popoverProps:{noArrow:!1,placement:"bottom",anchor:{getBoundingClientRect:()=>r.current?.getBoundingClientRect()||new DOMRect},onClose:()=>{n()},onFocusOutside:()=>{n(),o.current=setTimeout(()=>{var t;clearTimeout(null!==(t=o.current)&&void 0!==t?t:void 0),o.current=null},300)}},renderToggle:()=>(0,x.jsx)(E.Button,{className:"popover-toggle",ref:t=>{r.current=t},"aria-label":(0,v.__)("Options","popup-maker"),variant:"link",onClick:()=>{i||o.current||s(!0)},icon:i?F:M,iconSize:20}),renderContent:()=>(a.current=void 0,(0,x.jsx)(E.NavigableMenu,{orientation:"vertical",children:l.map(({id:t,group:e,render:a})=>(0,x.jsxs)(k.Fragment,{children:[(0,x.jsx)(d,{group:e}),(0,x.jsx)(a,{...c})]},t))}))})})},pt=t=>function({closeOnSave:e=!0,showDocumentationLink:a=!0,showActions:r=!0,onClose:o,onRequestClose:i,modalProps:s,...n}){const[l,c]=(0,k.useState)(),d=(0,b.useSelect)(t=>{var e;const a=t(f.callToActionStore);return null!==(e=a.getCurrentEditorValues())&&void 0!==e?e:a.getDefaultValues()},[]),h=(0,b.useSelect)(t=>t(f.callToActionStore).isResolving("updateCallToAction"),[]),{hasEdits:u,getHasEdits:S}=(0,b.useSelect)(t=>{if(!d.id)return{hasEdits:!1,getHasEdits:()=>!1};const e=t(f.callToActionStore);return{hasEdits:e.hasEdits(d.id),getHasEdits:e.hasEdits}},[d,h]),{saveEditorValues:p,resetRecordEdits:P}=(0,b.useDispatch)(f.callToActionStore),{hasAnyError:V}=q(),G=(0,k.useMemo)(()=>s?.title?s.title:d?.id>0?`${(0,v.__)("Edit Call to Action","popup-maker")} #${d.id}${d?.title?` - ${d.title}`:""}`:(0,v.__)("New Call to Action","popup-maker"),[s?.title,d?.id,d?.title]),m=(0,k.useCallback)(()=>{h||(u?c({message:(0,v.__)("Changes you made may not be saved.","popup-maker"),callback:()=>{P(d.id),o?.()},isDestructive:!0}):(P(d.id),o?.()))},[h,o,u]),g=(0,k.useCallback)(async()=>{if(!V)try{await p(),n?.onSave?.(d),!S(d.id)&&e&&m()}catch(t){console.error("Save failed:",t)}},[e,m,S,V]),{id:w}=d;return(0,k.useEffect)(()=>{const t=t=>{if(u){if(!window.confirm((0,v.__)("Changes you made may not be saved.","popup-maker")))return t.preventDefault(),!1;P(w)}return!0};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[u,w]),(0,x.jsxs)(x.Fragment,{children:[l&&(0,x.jsx)(_.ConfirmDialogue,{...l,onClose:()=>c(void 0)}),(0,x.jsxs)(E.Modal,{...s,title:G,className:T("call-to-action-editor-modal",s?.className),onRequestClose:m,shouldCloseOnClickOutside:!0,isDismissible:!1,headerActions:(0,x.jsxs)("div",{className:"editor-header-actions",children:[(0,x.jsx)(ht,{values:d,closeModal:m}),(0,x.jsx)(St,{values:d,closeModal:m}),(0,x.jsx)(E.Button,{className:"close-button",variant:"link",icon:N,"aria-label":(0,v.__)("Close","popup-maker"),onClick:m,style:{color:"currentColor"}})]}),children:[(0,x.jsx)(t,{...n}),r&&(0,x.jsxs)("div",{className:"editor-actions",children:[(0,x.jsx)(E.Button,{text:(0,v.__)("Cancel","popup-maker"),disabled:h,variant:"tertiary",isDestructive:!0,onClick:m,className:"cancel-button"}),(0,x.jsxs)(E.Button,{variant:"primary",disabled:h||!u||V,onClick:t=>{t.preventDefault(),g()},children:[h&&(0,x.jsx)(E.Spinner,{}),"number"==typeof d.id&&d.id>0?(0,v.__)("Save Call to Action","popup-maker"):(0,v.__)("Add Call to Action","popup-maker")]}),a&&(0,x.jsx)(E.Button,{text:(0,v.__)("Documentation","popup-maker"),href:"https://wppopupmaker.com/docs/?utm_campaign=documentation&utm_source=call-to-action-editor&utm_medium=plugin-ui&utm_content=footer-documentation-link",target:"_blank",icon:O,iconSize:20})]})]})]})},Pt=t=>function({onSave:e,onClose:a,...r}){const{tab:o,setTab:i,clearEditorParams:s,editorId:n}=$(),{isEditorActive:l,isSaving:c}=(0,b.useSelect)(t=>{const e=t(f.callToActionStore);return{isEditorActive:e.isEditorActive(),isSaving:e.isResolving("updateCallToAction")}},[]),d=(0,k.useCallback)(t=>{s(),e?.(t)},[e,!0,s]),h=(0,k.useCallback)(()=>{c||(s(),a?.())},[c,s,a]);return l?n?(0,x.jsx)(t,{...r,id:n,tab:o,setTab:i,onSave:d,onClose:h}):(0,x.jsx)(x.Fragment,{children:(0,v.__)("Editor requires a valid id","popup-maker")}):null},Vt=dt(ct),Gt=!1;n()(()=>{lt||((0,l.addFilter)("popupMaker.callToActionEditor.tabs","popup-maker/cta-editor/tabs",t=>[...t,...Object.values(i)]),nt(),Object.values(a).forEach(t=>{u(t)}),Object.values(r).forEach(t=>{G(t)}),lt=!0),(0,l.doAction)("popupMaker.ctaEditor.init")}),(window.popupMaker=window.popupMaker||{}).ctaEditor=e})();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists