Current File : /home/kelaby89/abl.academy/wp-content/plugins/thim-elementor-kit/build/admin.js
(()=>{"use strict";var e={63:(e,t,n)=>{var o=n(609),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useState,a=o.useEffect,l=o.useLayoutEffect,s=o.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=i({inst:{value:n,getSnapshot:t}}),r=o[0].inst,u=o[1];return l((function(){r.value=n,r.getSnapshot=t,c(r)&&u({inst:r})}),[e,n,t]),a((function(){return c(r)&&u({inst:r}),e((function(){c(r)&&u({inst:r})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:u},888:(e,t,n)=>{e.exports=n(63)},609:e=>{e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=window.wp.element,r=window.wp.i18n,i=window.wp.components,a=window.wp.apiFetch;var l=n.n(a),s=n(609),c=n(888);const u=new WeakMap,d={},m={},p=()=>{},h=p(),f=Object,g=e=>e===h,y=e=>"function"==typeof e,E=(e,t)=>({...e,...t}),v="undefined",_=typeof window!=v,w=typeof document!=v,k=(e,t)=>{const n=u.get(e);return[()=>e.get(t)||d,o=>{if(!g(t)){const r=e.get(t);t in m||(m[t]=r),n[5](t,E(r,o),r||d)}},n[6],()=>!g(t)&&t in m?m[t]:e.get(t)||d]},S=new WeakMap;let b=0;const C=e=>{const t=typeof e,n=e&&e.constructor,o=n==Date;let r,i;if(f(e)!==e||o||n==RegExp)r=o?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(r=S.get(e),r)return r;if(r=++b+"~",S.set(e,r),n==Array){for(r="@",i=0;i<e.length;i++)r+=C(e[i])+",";S.set(e,r)}if(n==f){r="#";const t=f.keys(e).sort();for(;!g(i=t.pop());)g(e[i])||(r+=i+":"+C(e[i])+",");S.set(e,r)}}return r};let x=!0;const[O,L]=_&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[p,p],T={isOnline:()=>x,isVisible:()=>{const e=w&&document.visibilityState;return g(e)||"hidden"!==e}},P={initFocus:e=>(w&&document.addEventListener("visibilitychange",e),O("focus",e),()=>{w&&document.removeEventListener("visibilitychange",e),L("focus",e)}),initReconnect:e=>{const t=()=>{x=!0,e()},n=()=>{x=!1};return O("online",t),O("offline",n),()=>{L("online",t),L("offline",n)}}},R=!s.useId,D=!_||"Deno"in window,M=D?s.useEffect:s.useLayoutEffect,F="undefined"!=typeof navigator&&navigator.connection,I=!D&&F&&(["slow-2g","2g"].includes(F.effectiveType)||F.saveData),N=e=>{if(y(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?C(e):"",t]};let V=0;const B=()=>++V;async function W(...e){const[t,n,o,r]=e,i=E({populateCache:!0,throwOnError:!0},"boolean"==typeof r?{revalidate:r}:r||{});let a=i.populateCache;const l=i.rollbackOnError;let s=i.optimisticData;const c=!1!==i.revalidate,d=i.throwOnError;if(y(n)){const e=n,o=[],r=t.keys();for(let n=r.next();!n.done;n=r.next()){const r=n.value;!r.startsWith("$inf$")&&e(t.get(r)._k)&&o.push(r)}return Promise.all(o.map(m))}return m(n);async function m(n){const[r]=N(n);if(!r)return;const[i,m]=k(t,r),[p,f,E]=u.get(t),v=p[r],_=()=>c&&(delete E[r],v&&v[0])?v[0](2).then((()=>i().data)):i().data;if(e.length<3)return _();let w,S=o;const b=B();f[r]=[b,0];const C=!g(s),x=i(),O=x.data,L=x._c,T=g(L)?O:L;if(C&&(s=y(s)?s(T):s,m({data:s,_c:T})),y(S))try{S=S(T)}catch(e){w=e}if(S&&y(S.then)){if(S=await S.catch((e=>{w=e})),b!==f[r][0]){if(w)throw w;return S}w&&C&&(e=>"function"==typeof l?l(e):!1!==l)(w)&&(a=!0,S=T,m({data:S,_c:h}))}a&&(w||(y(a)&&(S=a(S,T)),m({data:S,_c:h}))),f[r][1]=B();const P=await _();if(m({_c:h}),!w)return a?P:S;if(d)throw w}}const q=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},A=(e,t)=>{if(!u.has(e)){const n=E(P,t),o={},r=W.bind(h,e);let i=p;const a={},l=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},s=(t,n,o)=>{e.set(t,n);const r=a[t];if(r)for(const e of r)e(n,o)},c=()=>{if(!u.has(e)&&(u.set(e,[o,{},{},{},r,s,l]),!D)){const t=n.initFocus(setTimeout.bind(h,q.bind(h,o,0))),r=n.initReconnect(setTimeout.bind(h,q.bind(h,o,1)));i=()=>{t&&t(),r&&r(),u.delete(e)}}};return c(),[e,r,c,i]}return[e,u.get(e)[4]]},[j,K]=A(new Map),U=E({onLoadingSlow:p,onSuccess:p,onError:p,onErrorRetry:(e,__,t,n,o)=>{const r=t.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*t.errorRetryInterval;!g(r)&&i>r||setTimeout(n,a,o)},onDiscarded:p,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:I?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:I?5e3:3e3,compare:(e,t)=>C(e)==C(t),isPaused:()=>!1,cache:j,mutate:K,fallback:{}},T),z=(e,t)=>{const n=E(e,t);if(t){const{use:o,fallback:r}=e,{use:i,fallback:a}=t;o&&i&&(n.use=o.concat(i)),r&&a&&(n.fallback=E(r,a))}return n},$=(0,s.createContext)({}),H=_&&window.__SWR_DEVTOOLS_USE__,J=H?window.__SWR_DEVTOOLS_USE__:[],Q=J.concat((e=>(t,n,o)=>e(t,n&&((...e)=>{const o=N(t)[0],[,,,r]=u.get(j),i=r[o];return i?(delete r[o],i):n(...e)}),o)));H&&(window.__SWR_DEVTOOLS_REACT__=s);const G={dedupe:!0};f.defineProperty((e=>{const{value:t}=e,n=(0,s.useContext)($),o=y(t),r=(0,s.useMemo)((()=>o?t(n):t),[o,n,t]),i=(0,s.useMemo)((()=>o?r:z(n,r)),[o,n,r]),a=r&&r.provider,[l]=(0,s.useState)((()=>a?A(a(i.cache||j),r):h));return l&&(i.cache=l[0],i.mutate=l[1]),M((()=>{if(l)return l[2]&&l[2](),l[3]}),[]),(0,s.createElement)($.Provider,E(e,{value:i}))}),"defaultValue",{value:U});var X,Y=(X=(e,t,n)=>{const{cache:o,compare:r,suspense:i,fallbackData:a,revalidateOnMount:l,revalidateIfStale:d,refreshInterval:m,refreshWhenHidden:p,refreshWhenOffline:f,keepPreviousData:w}=n,[S,b,C]=u.get(o),[x,O]=N(e),L=(0,s.useRef)(!1),T=(0,s.useRef)(!1),P=(0,s.useRef)(x),F=(0,s.useRef)(t),I=(0,s.useRef)(n),V=()=>I.current,q=()=>V().isVisible()&&V().isOnline(),[A,j,K,U]=k(o,x),z=(0,s.useRef)({}).current,$=g(a)?n.fallback[x]:a,H=(e,t)=>{let n=!0;for(const o in z){const i=o;"data"===i?r(t[i],e[i])||g(e[i])&&r(t[i],oe)||(n=!1):t[i]!==e[i]&&(n=!1)}return n},J=(0,s.useMemo)((()=>{const e=!!x&&!!t&&(g(l)?!V().isPaused()&&!i&&(!!g(d)||d):l),n=t=>{const n=E(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let o=n(A());const r=n(U());return[()=>{const e=n(A());return H(e,o)?o:o=e},()=>r]}),[o,x]),Q=(0,c.useSyncExternalStore)((0,s.useCallback)((e=>K(x,((t,n)=>{H(n,t)||e()}))),[o,x]),J[0],J[1]),X=!L.current,Y=S[x]&&S[x].length>0,Z=Q.data,ee=g(Z)?$:Z,te=Q.error,ne=(0,s.useRef)(ee),oe=w?g(Z)?ne.current:Z:ee,re=!(Y&&!g(te))&&(X&&!g(l)?l:!V().isPaused()&&(i?!g(ee)&&d:g(ee)||d)),ie=!!(x&&t&&X&&re),ae=g(Q.isValidating)?ie:Q.isValidating,le=g(Q.isLoading)?ie:Q.isLoading,se=(0,s.useCallback)((async e=>{const t=F.current;if(!x||!t||T.current||V().isPaused())return!1;let o,i,a=!0;const l=e||{},s=!C[x]||!l.dedupe,c=()=>R?!T.current&&x===P.current&&L.current:x===P.current,u={isValidating:!1,isLoading:!1},d=()=>{j(u)},m=()=>{const e=C[x];e&&e[1]===i&&delete C[x]},p={isValidating:!0};g(A().data)&&(p.isLoading=!0);try{if(s&&(j(p),n.loadingTimeout&&g(A().data)&&setTimeout((()=>{a&&c()&&V().onLoadingSlow(x,n)}),n.loadingTimeout),C[x]=[t(O),B()]),[o,i]=C[x],o=await o,s&&setTimeout(m,n.dedupingInterval),!C[x]||C[x][1]!==i)return s&&c()&&V().onDiscarded(x),!1;u.error=h;const e=b[x];if(!g(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return d(),s&&c()&&V().onDiscarded(x),!1;const l=A().data;u.data=r(l,o)?l:o,s&&c()&&V().onSuccess(o,x,n)}catch(e){m();const t=V(),{shouldRetryOnError:n}=t;t.isPaused()||(u.error=e,s&&c()&&(t.onError(e,x,t),(!0===n||y(n)&&n(e))&&q()&&t.onErrorRetry(e,x,t,(e=>{const t=S[x];t&&t[0]&&t[0](3,e)}),{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0}),[x,o]),ce=(0,s.useCallback)(((...e)=>W(o,P.current,...e)),[]);if(M((()=>{F.current=t,I.current=n,g(Z)||(ne.current=Z)})),M((()=>{if(!x)return;const e=se.bind(h,G);let t=0;const n=((e,t,n)=>{const o=t[e]||(t[e]=[]);return o.push(n),()=>{const e=o.indexOf(n);e>=0&&(o[e]=o[o.length-1],o.pop())}})(x,S,((n,o={})=>{if(0==n){const n=Date.now();V().revalidateOnFocus&&n>t&&q()&&(t=n+V().focusThrottleInterval,e())}else if(1==n)V().revalidateOnReconnect&&q()&&e();else{if(2==n)return se();if(3==n)return se(o)}}));return T.current=!1,P.current=x,L.current=!0,j({_k:O}),re&&(g(ee)||D?e():(o=e,_&&typeof window.requestAnimationFrame!=v?window.requestAnimationFrame(o):setTimeout(o,1))),()=>{T.current=!0,n()};var o}),[x]),M((()=>{let e;function t(){const t=y(m)?m(ee):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){A().error||!p&&!V().isVisible()||!f&&!V().isOnline()?t():se(G).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[m,p,f,x]),(0,s.useDebugValue)(oe),i&&g(ee)&&x){if(!R&&D)throw new Error("Fallback data is required when using suspense in SSR.");throw F.current=t,I.current=n,T.current=!1,g(te)?se(G):te}return{mutate:ce,get data(){return z.data=!0,oe},get error(){return z.error=!0,te},get isValidating(){return z.isValidating=!0,ae},get isLoading(){return z.isLoading=!0,le}}},function(...e){const t=E(U,(0,s.useContext)($)),[n,o,r]=(e=>y(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),i=z(t,r);let a=X;const{use:l}=i,c=(l||[]).concat(Q);for(let e=c.length;e--;)a=c[e](a);return a(n,o||i.fetcher||null,i)});const Z=window.lodash,ee=window.wp.url;function te(e){let{value:t,onChange:n,type:a}=e;const[s,c]=(0,o.useState)(""),[u,d]=(0,o.useState)(""),{data:m,error:p,isLoading:h}=Y((0,ee.addQueryArgs)("/thim-ekit/select-query-conditions",{search:u,type:a}),(e=>l()({path:e}))),f=(0,o.useCallback)((0,Z.debounce)((e=>d(e)),600),[]);return(0,o.createElement)("div",{style:{flex:1}},(0,o.createElement)(i.Dropdown,{style:{width:"100%"},placement:"bottom center",renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,o.createElement)("button",{type:"button",className:"components-button is-secondary",style:{minWidth:160,width:"100%",maxWidth:280,height:36,justifyContent:"space-between",color:"rgb(30, 30, 30)"},onClick:r},(0,o.createElement)("span",{style:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},m&&m.find((e=>e.id===t))?.title||"Select"),(0,o.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",role:"img","aria-hidden":"true",focusable:"false"},(0,o.createElement)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})))},renderContent:e=>{let{onToggle:t}=e;return(0,o.createElement)(o.Fragment,null,p?(0,o.createElement)("p",null,(0,r.__)("Error")):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(i.TextControl,{value:s,style:{minWidth:200},onChange:e=>{c(e),f(e)}}),h&&(0,o.createElement)(i.Spinner,null),m&&m.length>0&&m.map((e=>(0,o.createElement)(i.MenuItem,{key:e.id,onClick:()=>{n(e.id),t()}},e.title)))))}}))}function ne(e){let{conditions:t,setConditions:n,type:a}=e;const l=new URL(location.href),s=a||l.searchParams.get("thim_elementor_type"),c=(e,o,r)=>{const i=[...t];i[e][o]=r,n(i)};return(0,o.createElement)("div",null,t.map(((e,a)=>(0,o.createElement)("div",{key:a,style:{display:"flex",gap:10,paddingBottom:5}},(0,o.createElement)("div",{style:{flex:1}},(0,o.createElement)(i.SelectControl,{style:{height:36},value:e.comparison,options:[{label:(0,r.__)("Include","thim-elementor-kit-pro"),value:"include"},{label:(0,r.__)("Exclude","thim-elementor-kit-pro"),value:"exclude"}],onChange:e=>c(a,"comparison",e)})),(0,o.createElement)("div",{style:{flex:1}},(0,o.createElement)(i.SelectControl,{style:{height:36},value:e.type,options:thimEKit?.list_conditions?.[s],onChange:e=>c(a,"type",e)})),thimEKit?.list_conditions?.[s].find((t=>t.value===e.type))?.is_query&&(0,o.createElement)(te,{type:e.type,value:e.query,onChange:e=>c(a,"query",e)}),(0,o.createElement)(i.Button,{variant:"secondary",style:{height:36},label:"Remove",showTooltip:!0,onClick:()=>(e=>{const o=[...t];o.splice(e,1),n(o)})(a)},(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",style:{width:20,height:20}},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})))))),(0,o.createElement)(i.Button,{variant:"primary",onClick:()=>n([...t,{comparison:"include",type:"all",query:null}])},(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",style:{width:18,height:18}},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})),(0,r.__)("Add condition","thim-elementor-kit-pro")))}const oe="undefined"!=typeof thimEKit?thimEKit.types:[];function re(e){let{open:t,setOpen:n}=e;const[a,s]=(0,o.useState)(""),[c,u]=(0,o.useState)(""),[d,m]=(0,o.useState)([]),[p,h]=(0,o.useState)([]),[f,g]=(0,o.useState)({id:0,isPro:!1}),[y,E]=(0,o.useState)(!1),[v,_]=(0,o.useState)("post"),[w,k]=(0,o.useState)(!1),[S,b]=(0,o.useState)({status:"",message:""}),{data:C,error:x,isLoading:O}=Y("/thim-ekit/get-layout-libraries",(e=>l()({path:e})));return(0,o.useEffect)((()=>{if(C){const e=[],t=[];C?.free?.[a]&&(Object.entries(C.free[a]).forEach((t=>{let[n,o]=t;o?.loop_type&&o?.loop_type!==v||e.push({...o,id:parseFloat(n),isPro:!1})})),e.sort(((e,t)=>e.priority-t.priority))),C?.theme?.[a]&&(Object.entries(C.theme[a]).forEach((e=>{let[n,o]=e;o?.loop_type&&o?.loop_type!==v||t.push({...o,id:parseFloat(n),isPro:!0})})),t.sort(((e,t)=>e.priority-t.priority))),h([...e,...t])}}),[C,a,v]),(0,o.useEffect)((()=>{!function(){const e=new URL(location.href).searchParams.get("thim_elementor_type");e&&s(e)}()}),[]),(0,o.createElement)(i.SlotFillProvider,null,(0,o.createElement)(i.Modal,{className:"thim-ekit__modal",focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:(0,r.__)("Add new template","thim-elementor-kit"),onRequestClose:()=>n(!1)},(0,o.createElement)(o.Fragment,null,(0,o.createElement)("form",{onSubmit:e=>{e.preventDefault(),async function(){k(!0);try{const e=await l()({path:"thim-ekit/create-template",method:"POST",data:{name:c,type:a,sticky:y,conditions:d,layout:f,loopType:v}});b({status:e.status,message:e.message||""}),k(!1),e?.data?.redirect&&(window.location.href=e.data.redirect)}catch(e){b({status:"error",message:e.message||""}),k(!1)}}()}},(0,o.createElement)(i.SelectControl,{label:(0,r.__)("Select the type","thim-elementor-kit"),value:a,onChange:e=>{s(e),g({id:0,isPro:!1})},options:oe}),(0,o.createElement)(i.TextControl,{label:(0,r.__)("Template name","thim-elementor-kit"),placeholder:(0,r.__)("Enter template name…","thim-elementor-kit"),value:c,onChange:e=>u(e)}),"header"===a&&(0,o.createElement)(i.CheckboxControl,{label:(0,r.__)("Enable sticky","thim-elementor-kit"),checked:y,onChange:E}),"loop_item"===a&&thimEKit?.loop_item?.post_type&&(0,o.createElement)(i.SelectControl,{label:(0,r.__)("Select post type","thim-elementor-kit"),value:v,onChange:e=>{_(e),g({id:0,isPro:!1})},options:thimEKit?.loop_item?.post_type||[]}),thimEKit?.list_conditions?.[a]&&(0,o.createElement)(i.BaseControl,{id:"thim-elementor-kit-pro-conditions",label:(0,r.__)("Conditions","thim-elementor-kit")},(0,o.createElement)(ne,{conditions:d,setConditions:m,type:a})),a&&(0,o.createElement)(o.Fragment,null,O?(0,o.createElement)(i.Spinner,null):(0,o.createElement)(o.Fragment,null,!x&&p.length>0&&(0,o.createElement)(i.BaseControl,{id:"thim-elementor-kit-layouts",label:(0,r.__)("Select Layouts","thim-elementor-kit")},(0,o.createElement)("div",{className:"thim-elementor-kit-layouts"},p.map((e=>(0,o.createElement)("div",{key:e.id,className:"thim-elementor-kit-layouts__item "+(e.id===f.id?"thim-elementor-kit-layouts__item--active":""),onClick:()=>g({id:e.id!==f.id?e.id:0,isPro:e.isPro}),onKeyDown:()=>g({id:e.id!==f.id?e.id:0,isPro:e.isPro}),"aria-hidden":"true"},(0,o.createElement)("img",{src:e.thumbnail,alt:e?.title||""}),e.isPro&&(0,o.createElement)("span",{className:"thim-elementor-kit-layouts__item__pro"},(0,r.__)("Pro","thim-elementor-kit")),e.title&&(0,o.createElement)("span",{className:"thim-elementor-kit-layouts__item__label"},e.title)))))))),(0,o.createElement)("div",{style:{display:"flex",gap:10,margin:"20px 0 0 0",borderTop:"1px solid #eee",paddingTop:20}},(0,o.createElement)(i.Button,{variant:"primary",type:"submit",icon:w?(0,o.createElement)(i.Spinner,null):""},(0,r.__)("Create template","thim-elementor-kit")))),S.status&&(0,o.createElement)(i.Notice,{status:S.status,isDismissible:!1},(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:S?.message||(0,r.__)("No data available","thim-elementor-kit")}})))),(0,o.createElement)(i.Popover.Slot,null))}function ie(e){let{open:t,setOpen:n,postID:a}=e;const[s,c]=(0,o.useState)(""),[u,d]=(0,o.useState)(""),[m,p]=(0,o.useState)([]);return(0,o.useEffect)((()=>{t&&async function(){c("fetch");const e=await l()({path:`/thim-ekit/get-conditions?postID=${a}`});e&&p(e),c("")}()}),[]),(0,o.createElement)(i.SlotFillProvider,null,(0,o.createElement)(i.Modal,{className:"thim-edit-module__modal",focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:(0,r.__)("Edit template","thim-elementor-kit-pro"),onRequestClose:()=>n(!1)},"fetch"===s?(0,o.createElement)("div",{style:{textAlign:"center",padding:20}},(0,o.createElement)(i.Spinner,{style:{height:"20px",width:"20px"}})):(0,o.createElement)("div",{className:"thim-edit-module__modal__content",style:{paddingTop:5}},(0,o.createElement)(ne,{conditions:m,setConditions:p}),(0,o.createElement)("div",{style:{display:"flex",gap:10,margin:"20px 0 0 0",borderTop:"1px solid #eee",paddingTop:20}},(0,o.createElement)(i.Button,{variant:"primary",onClick:async()=>{try{c("save");const e=await l()({path:"/thim-ekit/save-conditions",method:"POST",data:{conditions:m,postID:a}});if(!e?.success)throw new Error(e?.message||(0,r.__)("Something went wrong!","thim-elementor-kit"));n(!1)}catch(e){d(e.message)}finally{c("")}},disabled:""!==s},"save"===s&&(0,o.createElement)(i.Spinner,{style:{margin:"0 5px 0 0"}}),(0,r.__)("Save","thim-elementor-kit-pro")),(0,o.createElement)(i.Button,{variant:"secondary",text:"Close",onClick:()=>n(!1)})),u&&(0,o.createElement)("div",{style:{margin:"10px -15px 0"}},(0,o.createElement)(i.Notice,{status:"error",isDismissible:!1},u)))),(0,o.createElement)(i.Popover.Slot,null))}oe.unshift({value:"",label:(0,r.__)("Default","thim-elementor-kit")}),(e=>{const t=N(e)[0],[,,,n]=u.get(j);if(n[t])return n[t];const o=(r=e,l()({path:r}));var r;n[t]=o})("/thim-ekit/get-layout-libraries"),(0,o.render)((0,o.createElement)((function(){const[e,t]=(0,o.useState)(!1),[n,a]=(0,o.useState)(0),[l,s]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const e=document.querySelector(".page-title-action"),n=document.querySelector(".wp-heading-inline");function o(){-1!==location.hash.indexOf("edit_condition_")&&(a(location.hash.replace("#edit_condition_","")),s(!0),location.hash=""),"#add_new"===location.hash&&(t(!0),location.hash="")}return e&&e.remove(),n&&n.remove(),o(),window.addEventListener("hashchange",(()=>{o()}),!1),()=>{window.removeEventListener("hashchange",(()=>{o()}),!1)}}),[]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"thim-ekit"},(0,o.createElement)("div",{className:"thim-ekit__inner"},(0,o.createElement)("h1",{className:"thim-ekit__heading"},(0,r.__)("Thim Elementor Templates","thim-elementor-kit")),(0,o.createElement)(i.Button,{variant:"primary",onClick:()=>t(!e)},(0,r.__)("Add new","thim-elementor-kit"))),(0,o.createElement)("div",null,(0,o.createElement)("a",{href:"https://thimpress.com/contact-us/",className:"thim-ekit__contact"},(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})),(0,r.__)("Contact us","thim-elementor-kit")))),e&&(0,o.createElement)(re,{open:e,setOpen:t}),l&&(0,o.createElement)(ie,{open:l,setOpen:s,postID:n}))}),null),document.getElementById("thim-elementor-header"))})();