| Server IP : www.new.bangkokfinder.com / Your IP : 104.23.176.10 Web Server : nginx/1.20.1 System : Linux new 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64 User : bangkokfinder ( 1000) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bangkokfinder/www/wp-content/plugins/generateblocks-pro/dist/ |
Upload File : |
(()=>{"use strict";var e={21020:(e,t,s)=>{var r=s(51609),n=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,s){var r,c={},l=null,u=null;for(r in void 0!==s&&(l=""+s),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!o.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}},51609:e=>{e.exports=window.React},74848:(e,t,s)=>{e.exports=s(21020)}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r=s(51609);const n=window.wp.components,i=window.wp.i18n,a=window.wp.element,o=window.wp.primitives,c=(0,a.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(o.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));var l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u="undefined"==typeof window||"Deno"in globalThis;function h(){}function d(e){return"number"==typeof e&&e>=0&&e!==1/0}function p(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return"function"==typeof e?e(t):e}function m(e,t){return"function"==typeof e?e(t):e}function f(e,t){const{type:s="all",exact:r,fetchStatus:n,predicate:i,queryKey:a,stale:o}=e;if(a)if(r){if(t.queryHash!==v(a,t.options))return!1}else if(!w(t.queryKey,a))return!1;if("all"!==s){const e=t.isActive();if("active"===s&&!e)return!1;if("inactive"===s&&e)return!1}return!("boolean"==typeof o&&t.isStale()!==o||n&&n!==t.state.fetchStatus||i&&!i(t))}function g(e,t){const{exact:s,status:r,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(s){if(b(t.options.mutationKey)!==b(i))return!1}else if(!w(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||n&&!n(t))}function v(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,((e,t)=>O(t)?Object.keys(t).sort().reduce(((e,s)=>(e[s]=t[s],e)),{}):t))}function w(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every((s=>w(e[s],t[s])))}function E(e,t){if(e===t)return e;const s=C(e)&&C(t);if(s||O(e)&&O(t)){const r=s?e:Object.keys(e),n=r.length,i=s?t:Object.keys(t),a=i.length,o=s?[]:{};let c=0;for(let n=0;n<a;n++){const a=s?n:i[n];(!s&&r.includes(a)||s)&&void 0===e[a]&&void 0===t[a]?(o[a]=void 0,c++):(o[a]=E(e[a],t[a]),o[a]===e[a]&&void 0!==e[a]&&c++)}return n===a&&c===n?e:o}return t}function _(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!S(e))return!1;const t=e.constructor;if(void 0===t)return!0;const s=t.prototype;return!!S(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?E(e,t):t}function R(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function x(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var P=Symbol();function q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==P?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function M(e,t){return"function"==typeof e?e(...t):!!e}var Q=new class extends l{#e;#t;#s;constructor(){super(),this.#s=e=>{if(!u&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},D=e=>setTimeout(e,0),T=function(){let e=[],t=0,s=e=>{e()},r=e=>{e()},n=D;const i=r=>{t?e.push(r):n((()=>{s(r)}))};return{batch:i=>{let a;t++;try{a=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&n((()=>{r((()=>{t.forEach((e=>{s(e)}))}))}))})()}return a},batchCalls:e=>(...t)=>{i((()=>{e(...t)}))},schedule:i,setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{n=e}}}(),F=new class extends l{#r=!0;#t;#s;constructor(){super(),this.#s=e=>{if(!u&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#r!==e&&(this.#r=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#r}};function I(){let e,t;const s=new Promise(((s,r)=>{e=s,t=r}));function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch((()=>{})),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}function N(e){return Math.min(1e3*2**e,3e4)}function U(e){return"online"!==(e??"online")||F.isOnline()}var A=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function K(e){return e instanceof A}function L(e){let t,s=!1,r=0,n=!1;const i=I(),a=()=>Q.isFocused()&&("always"===e.networkMode||F.isOnline())&&e.canRun(),o=()=>U(e.networkMode)&&e.canRun(),c=s=>{n||(n=!0,e.onSuccess?.(s),t?.(),i.resolve(s))},l=s=>{n||(n=!0,e.onError?.(s),t?.(),i.reject(s))},h=()=>new Promise((s=>{t=e=>{(n||a())&&s(e)},e.onPause?.()})).then((()=>{t=void 0,n||e.onContinue?.()})),d=()=>{if(n)return;let t;const i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(c).catch((t=>{if(n)return;const i=e.retry??(u?0:3),o=e.retryDelay??N,c="function"==typeof o?o(r,t):o,p=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);var y;!s&&p?(r++,e.onFail?.(r,t),(y=c,new Promise((e=>{setTimeout(e,y)}))).then((()=>a()?void 0:h())).then((()=>{s?l(t):d()}))):l(t)}))};return{promise:i,cancel:t=>{n||(l(new A(t)),e.abort?.())},continue:()=>(t?.(),i),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:o,start:()=>(o()?d():h().then(d),i)}}var z=class{#n;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#n=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(u?1/0:3e5))}clearGcTimeout(){this.#n&&(clearTimeout(this.#n),this.#n=void 0)}},B=class extends z{#i;#a;#o;#c;#l;#u;#h;constructor(e){super(),this.#h=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#o=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#i=function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(e,t){const s=k(this.state.data,e,this.options);return this.#d({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#d({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#i)}isActive(){return this.observers.some((e=>!1!==m(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!p(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const s=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,s.signal)})},n={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:()=>{const e=q(this.options,t),s={client:this.#c,queryKey:this.queryKey,meta:this.meta};return r(s),this.#h=!1,this.options.persister?this.options.persister(e,s,this):e(s)}};r(n),this.options.behavior?.onFetch(n,this),this.#a=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===n.fetchOptions?.meta||this.#d({type:"fetch",meta:n.fetchOptions?.meta});const i=e=>{K(e)&&e.silent||this.#d({type:"error",error:e}),K(e)||(this.#o.config.onError?.(e,this),this.#o.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#l=L({initialPromise:t?.initialPromise,fn:n.fetchFn,abort:s.abort.bind(s),onSuccess:e=>{if(void 0!==e){try{this.setData(e)}catch(e){return void i(e)}this.#o.config.onSuccess?.(e,this),this.#o.config.onSettled?.(e,this.state.error,this),this.scheduleGc()}else i(new Error(`${this.queryHash} data is undefined`))},onError:i,onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0}),this.#l.start()}#d(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...j(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return K(s)&&s.revert&&this.#a?{...this.#a,fetchStatus:"idle"}:{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),T.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#o.notify({query:this,type:"updated",action:e})}))}};function j(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var H=class extends l{constructor(e,t){super(),this.options=t,this.#c=e,this.#p=null,this.#y=I(),this.options.experimental_prefetchInRender||this.#y.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#c;#m=void 0;#f=void 0;#g=void 0;#v;#b;#y;#p;#w;#E;#_;#C;#O;#S;#k=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#m.addObserver(this),$(this.#m,this.options)?this.#R():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G(this.#m,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G(this.#m,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#P(),this.#q(),this.#m.removeObserver(this)}setOptions(e){const t=this.options,s=this.#m;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof m(this.options.enabled,this.#m))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#m.setOptions(this.options),t._defaulted&&!_(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#m,observer:this});const r=this.hasListeners();r&&V(this.#m,s,this.options,t)&&this.#R(),this.updateResult(),!r||this.#m===s&&m(this.options.enabled,this.#m)===m(t.enabled,this.#m)&&y(this.options.staleTime,this.#m)===y(t.staleTime,this.#m)||this.#Q();const n=this.#D();!r||this.#m===s&&m(this.options.enabled,this.#m)===m(t.enabled,this.#m)&&n===this.#S||this.#T(n)}getOptimisticResult(e){const t=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(t,e);return r=s,!_(this.getCurrentResult(),r)&&(this.#g=s,this.#b=this.options,this.#v=this.#m.state),s;var r}getCurrentResult(){return this.#g}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),Reflect.get(e,s))})}trackProp(e){this.#k.add(e)}getCurrentQuery(){return this.#m}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#c.defaultQueryOptions(e),s=this.#c.getQueryCache().build(this.#c,t);return s.fetch().then((()=>this.createResult(s,t)))}fetch(e){return this.#R({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#g)))}#R(e){this.#M();let t=this.#m.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#Q(){this.#P();const e=y(this.options.staleTime,this.#m);if(u||this.#g.isStale||!d(e))return;const t=p(this.#g.dataUpdatedAt,e)+1;this.#C=setTimeout((()=>{this.#g.isStale||this.updateResult()}),t)}#D(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#m):this.options.refetchInterval)??!1}#T(e){this.#q(),this.#S=e,!u&&!1!==m(this.options.enabled,this.#m)&&d(this.#S)&&0!==this.#S&&(this.#O=setInterval((()=>{(this.options.refetchIntervalInBackground||Q.isFocused())&&this.#R()}),this.#S))}#x(){this.#Q(),this.#T(this.#D())}#P(){this.#C&&(clearTimeout(this.#C),this.#C=void 0)}#q(){this.#O&&(clearInterval(this.#O),this.#O=void 0)}createResult(e,t){const s=this.#m,r=this.options,n=this.#g,i=this.#v,a=this.#b,o=e!==s?e.state:this.#f,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),i=!n&&$(e,t),a=n&&V(e,s,t,r);(i||a)&&(u={...u,...j(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:y}=u;l=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===y){let e;n?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(e=n.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#_?.state.data,this.#_):t.placeholderData,void 0!==e&&(y="success",l=k(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!m)if(n&&l===i?.data&&t.select===this.#w)l=this.#E;else try{this.#w=t.select,l=t.select(l),l=k(n?.data,l,t),this.#E=l,this.#p=null}catch(e){this.#p=e}this.#p&&(d=this.#p,l=this.#E,p=Date.now(),y="error");const f="fetching"===u.fetchStatus,g="pending"===y,v="error"===y,b=g&&f,w=void 0!==l,E={status:y,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===y,isError:v,isInitialLoading:b,isLoading:b,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>o.dataUpdateCount||u.errorUpdateCount>o.errorUpdateCount,isFetching:f,isRefetching:f&&!g,isLoadingError:v&&!w,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&w,isStale:W(e,t),refetch:this.refetch,promise:this.#y};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===E.status?e.reject(E.error):void 0!==E.data&&e.resolve(E.data)},r=()=>{const e=this.#y=E.promise=I();t(e)},n=this.#y;switch(n.status){case"pending":e.queryHash===s.queryHash&&t(n);break;case"fulfilled":"error"!==E.status&&E.data===n.value||r();break;case"rejected":"error"===E.status&&E.error===n.reason||r()}}return E}updateResult(){const e=this.#g,t=this.createResult(this.#m,this.options);this.#v=this.#m.state,this.#b=this.options,void 0!==this.#v.data&&(this.#_=this.#m),_(t,e)||(this.#g=t,this.#F({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#k.size)return!0;const r=new Set(s??this.#k);return this.options.throwOnError&&r.add("error"),Object.keys(this.#g).some((t=>{const s=t;return this.#g[s]!==e[s]&&r.has(s)}))})()}))}#M(){const e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#m)return;const t=this.#m;this.#m=e,this.#f=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#F(e){T.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#g)})),this.#c.getQueryCache().notify({query:this.#m,type:"observerResultsUpdated"})}))}};function $(e,t){return function(e,t){return!1!==m(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&G(e,t,t.refetchOnMount)}function G(e,t,s){if(!1!==m(t.enabled,e)){const r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&W(e,t)}return!1}function V(e,t,s,r){return(e!==t||!1===m(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&W(e,s)}function W(e,t){return!1!==m(t.enabled,e)&&e.isStaleByTime(y(t.staleTime,e))}var X=s(74848),Y=r.createContext(void 0),Z=e=>{const t=r.useContext(Y);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},J=({client:e,children:t})=>(r.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,X.jsx)(Y.Provider,{value:e,children:t}));var ee=r.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),te=r.createContext(!1),se=(te.Provider,(e,t,s)=>t.fetchOptimistic(e).catch((()=>{s.clearReset()})));function re(e,t){return function(e,t,s){const n=Z(s),i=r.useContext(te),a=r.useContext(ee),o=n.defaultQueryOptions(e);n.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?"isRestoring":"optimistic",(e=>{const t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))})(o),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(o,a),(e=>{r.useEffect((()=>{e.clearReset()}),[e])})(a);const c=!n.getQueryCache().get(o.queryHash),[l]=r.useState((()=>new t(n,o))),d=l.getOptimisticResult(o),p=!i&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback((e=>{const t=p?l.subscribe(T.batchCalls(e)):h;return l.updateResult(),t}),[l,p]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),r.useEffect((()=>{l.setOptions(o)}),[o,l]),((e,t)=>e?.suspense&&t.isPending)(o,d))throw se(o,l,a);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(n&&void 0===e.data||M(s,[e.error,r])))({result:d,errorResetBoundary:a,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if(n.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!u&&((e,t)=>e.isLoading&&e.isFetching&&!t)(d,i)){const e=c?se(o,l,a):n.getQueryCache().get(o.queryHash)?.promise;e?.catch(h).finally((()=>{l.updateResult()}))}return o.notifyOnChangeProps?d:l.trackResult(d)}(e,H,t)}var ne=class extends z{#I;#N;#l;constructor(e){super(),this.mutationId=e.mutationId,this.#N=e.mutationCache,this.#I=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#I.includes(e)||(this.#I.push(e),this.clearGcTimeout(),this.#N.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#I=this.#I.filter((t=>t!==e)),this.scheduleGc(),this.#N.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#I.length||("pending"===this.state.status?this.scheduleGc():this.#N.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#d({type:"continue"})};this.#l=L({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#N.canRun(this)});const s="pending"===this.state.status,r=!this.#l.canStart();try{if(s)t();else{this.#d({type:"pending",variables:e,isPaused:r}),await(this.#N.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#d({type:"pending",context:t,variables:e,isPaused:r})}const n=await this.#l.start();return await(this.#N.config.onSuccess?.(n,e,this.state.context,this)),await(this.options.onSuccess?.(n,e,this.state.context)),await(this.#N.config.onSettled?.(n,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(n,null,e,this.state.context)),this.#d({type:"success",data:n}),n}catch(t){try{throw await(this.#N.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#N.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#d({type:"error",error:t})}}finally{this.#N.runNext(this)}}#d(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),T.batch((()=>{this.#I.forEach((t=>{t.onMutationUpdate(e)})),this.#N.notify({mutation:this,type:"updated",action:e})}))}},ie=class extends l{#c;#g=void 0;#U;#A;constructor(e,t){super(),this.#c=e,this.setOptions(t),this.bindMethods(),this.#K()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#c.defaultMutationOptions(e),_(this.options,t)||this.#c.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#U,observer:this}),t?.mutationKey&&this.options.mutationKey&&b(t.mutationKey)!==b(this.options.mutationKey)?this.reset():"pending"===this.#U?.state.status&&this.#U.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#U?.removeObserver(this)}onMutationUpdate(e){this.#K(),this.#F(e)}getCurrentResult(){return this.#g}reset(){this.#U?.removeObserver(this),this.#U=void 0,this.#K(),this.#F()}mutate(e,t){return this.#A=t,this.#U?.removeObserver(this),this.#U=this.#c.getMutationCache().build(this.#c,this.options),this.#U.addObserver(this),this.#U.execute(e)}#K(){const e=this.#U?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#g={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#F(e){T.batch((()=>{if(this.#A&&this.hasListeners()){const t=this.#g.variables,s=this.#g.context;"success"===e?.type?(this.#A.onSuccess?.(e.data,t,s),this.#A.onSettled?.(e.data,null,t,s)):"error"===e?.type&&(this.#A.onError?.(e.error,t,s),this.#A.onSettled?.(void 0,e.error,t,s))}this.listeners.forEach((e=>{e(this.#g)}))}))}};function ae(e,t){const s=Z(t),[n]=r.useState((()=>new ie(s,e)));r.useEffect((()=>{n.setOptions(e)}),[n,e]);const i=r.useSyncExternalStore(r.useCallback((e=>n.subscribe(T.batchCalls(e))),[n]),(()=>n.getCurrentResult()),(()=>n.getCurrentResult())),a=r.useCallback(((e,t)=>{n.mutate(e,t).catch(h)}),[n]);if(i.error&&M(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}const oe=window.wp.apiFetch;var ce=s.n(oe),le=class extends l{constructor(e={}){super(),this.config=e,this.#L=new Map}#L;build(e,t,s){const r=t.queryKey,n=t.queryHash??v(r,t);let i=this.get(n);return i||(i=new B({client:e,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#L.has(e.queryHash)||(this.#L.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#L.get(e.queryHash);t&&(e.destroy(),t===e&&this.#L.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){T.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#L.get(e)}getAll(){return[...this.#L.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>f(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>f(e,t))):t}notify(e){T.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){T.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){T.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},ue=class extends l{constructor(e={}){super(),this.config=e,this.#z=new Set,this.#B=new Map,this.#j=0}#z;#B;#j;build(e,t,s){const r=new ne({mutationCache:this,mutationId:++this.#j,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#z.add(e);const t=he(e);if("string"==typeof t){const s=this.#B.get(t);s?s.push(e):this.#B.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#z.delete(e)){const t=he(e);if("string"==typeof t){const s=this.#B.get(t);if(s)if(s.length>1){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#B.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=he(e);if("string"==typeof t){const s=this.#B.get(t),r=s?.find((e=>"pending"===e.state.status));return!r||r===e}return!0}runNext(e){const t=he(e);if("string"==typeof t){const s=this.#B.get(t)?.find((t=>t!==e&&t.state.isPaused));return s?.continue()??Promise.resolve()}return Promise.resolve()}clear(){T.batch((()=>{this.#z.forEach((e=>{this.notify({type:"removed",mutation:e})})),this.#z.clear(),this.#B.clear()}))}getAll(){return Array.from(this.#z)}find(e){const t={exact:!0,...e};return this.getAll().find((e=>g(t,e)))}findAll(e={}){return this.getAll().filter((t=>g(e,t)))}notify(e){T.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return T.batch((()=>Promise.all(e.map((e=>e.continue().catch(h))))))}};function he(e){return e.options.scope?.id}function de(e){return{onFetch:(t,s)=>{const r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const l=async()=>{let s=!1;const l=q(t.options,t.fetchOptions),u=async(e,r,n)=>{if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta};var a;a=i,Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(t.signal.aborted?s=!0:t.signal.addEventListener("abort",(()=>{s=!0})),t.signal)});const o=await l(i),{maxPages:c}=t.options,u=n?x:R;return{pages:u(e.pages,o,c),pageParams:u(e.pageParams,r,c)}};if(n&&i.length){const e="backward"===n,t={pages:i,pageParams:a},s=(e?ye:pe)(r,t);o=await u(t,s,e)}else{const t=e??i.length;do{const e=0===c?a[0]??r.initialPageParam:pe(r,o);if(c>0&&null==e)break;o=await u(o,e),c++}while(c<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=l}}}function pe(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function ye(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var me=class{#H;#N;#u;#$;#G;#V;#W;#X;constructor(e={}){this.#H=e.queryCache||new le,this.#N=e.mutationCache||new ue,this.#u=e.defaultOptions||{},this.#$=new Map,this.#G=new Map,this.#V=0}mount(){this.#V++,1===this.#V&&(this.#W=Q.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#H.onFocus())})),this.#X=F.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#H.onOnline())})))}unmount(){this.#V--,0===this.#V&&(this.#W?.(),this.#W=void 0,this.#X?.(),this.#X=void 0)}isFetching(e){return this.#H.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#N.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#H.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#H.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(y(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#H.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),n=this.#H.get(r.queryHash),i=n?.state.data,a=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==a)return this.#H.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(e,t,s){return T.batch((()=>this.#H.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,s)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#H.get(t.queryHash)?.state}removeQueries(e){const t=this.#H;T.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const s=this.#H;return T.batch((()=>(s.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries({type:"active",...e},t))))}cancelQueries(e,t={}){const s={revert:!0,...t},r=T.batch((()=>this.#H.findAll(e).map((e=>e.cancel(s)))));return Promise.all(r).then(h).catch(h)}invalidateQueries(e,t={}){return T.batch((()=>(this.#H.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=T.batch((()=>this.#H.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(h)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(r).then(h)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const s=this.#H.build(this,t);return s.isStaleByTime(y(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(h).catch(h)}fetchInfiniteQuery(e){return e.behavior=de(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(h).catch(h)}ensureInfiniteQueryData(e){return e.behavior=de(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return F.isOnline()?this.#N.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#H}getMutationCache(){return this.#N}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#$.set(b(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#$.values()],s={};return t.forEach((t=>{w(e,t.queryKey)&&Object.assign(s,t.defaultOptions)})),s}setMutationDefaults(e,t){this.#G.set(b(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#G.values()],s={};return t.forEach((t=>{w(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)})),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=v(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===P&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#H.clear(),this.#N.clear()}};let fe=null;function ge(){return fe||(fe=new me({defaultOptions:{queries:{staleTime:3e5,cacheTime:6e5,retry:1,refetchOnWindowFocus:!0}}})),fe}"undefined"!=typeof window&&(window.addEventListener("gb-invalidate-conditions",(()=>{ge().invalidateQueries({queryKey:["conditions"]})})),window.addEventListener("message",(e=>{"gb_invalidate_conditions"===e.data?.type&&ge().invalidateQueries({queryKey:["conditions"]})})),window.addEventListener("gb-overlay-saved-global",(e=>{const t=ge();t.invalidateQueries({queryKey:["overlays"]}),e.detail?.overlayId&&t.invalidateQueries({queryKey:["overlay",e.detail.overlayId]})})));const ve=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),be=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),we=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"})),Ee=(0,a.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(o.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"})),_e=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Ce=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"})),Oe=window.wp.htmlEntities,Se=window.gbp.components;function ke({onSelectKey:e,overlays:t,refreshKey:s,isIframeMode:o=!1,onOverlaySelect:c=null}){const l=function(){const e=ge();return ae({mutationFn:async e=>{const t=await ce()({path:`/wp/v2/gblocks_overlay/${e}`,method:"DELETE",data:{force:!0}});if(!t||!t.deleted)throw console.error("Delete failed - invalid response:",t),new Error("Failed to delete overlay panel");return t},onSuccess:(t,s)=>{e.removeQueries({queryKey:["overlay",s]}),e.invalidateQueries({queryKey:["overlays"]})},onError:e=>{console.error("Delete overlay panel mutation error:",e)}})}(),u=function(){const e=ge();return ae({mutationFn:async({id:e,status:t})=>ce()({path:`/wp/v2/gblocks_overlay/${e}`,method:"POST",data:{status:t}}),onSuccess:t=>{e.invalidateQueries({queryKey:["overlay",t.id]}),e.invalidateQueries({queryKey:["overlays"]})}})}(),h=function(){const e=ge();return ae({mutationFn:async e=>{const t=await ce()({path:`/wp/v2/gblocks_overlay/${e}?context=edit`});return await ce()({path:"/wp/v2/gblocks_overlay",method:"POST",data:{title:t.title.raw+" (Copy)",content:t.content.raw,status:"draft",meta:t.meta,gblocks_overlay_cat:t.gblocks_overlay_cat}})},onSuccess:()=>{e.invalidateQueries({queryKey:["overlays"]})},onError:e=>{console.error("Duplicate overlay panel mutation error:",e)}})}(),[d,p]=(0,a.useState)(null),[y,m]=(0,a.useState)([]),[f,g]=(0,a.useState)({}),{data:v,isLoading:b}=function(e=100,t=1){return re({queryKey:["conditions",{perPage:e,page:t}],queryFn:()=>async function({perPage:e=100,page:t=1}){const s=await ce()({path:`/generateblocks-pro/advanced-conditions/v1/conditions/?page=${t}&per_page=${e}`});if(s.success)return s.response;throw new Error("Failed to fetch conditions")}({perPage:e,page:t}),select:e=>({conditions:e?.conditions||[],total:e?.total||0,pages:e?.pages||1})})}(100,1),w=ge();(0,a.useEffect)((()=>{ce()({path:"/wp/v2/overlay-categories?per_page=100"}).then((e=>{m(e)})).catch((e=>{console.error("Error loading categories:",e)}))}),[s]),(0,a.useEffect)((()=>{if(v?.conditions){const e={};v.conditions.forEach((t=>{let s="";"object"==typeof t.title&&t.title?.rendered?s=t.title.rendered:"string"==typeof t.title&&(s=t.title),e[t.id]=s})),g(e)}}),[v]);const E=(0,a.useMemo)((()=>[{id:"name",header:(0,i.__)("Name","generateblocks-pro"),accessorKey:"title.rendered",cell:e=>{const{admin_edit_url:t,id:s,title:a,status:l}=e.row.original;let u="";"object"==typeof a&&null!==a?"object"==typeof a.rendered&&void 0!==a.rendered?.rendered?u=a.rendered.rendered:void 0!==a.rendered&&(u=a.rendered):"string"==typeof a&&(u=a),u&&""!==u.trim()||(u=(0,i.__)("(Untitled)","generateblocks-pro"));const h="draft"===l;return o&&c?(0,r.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},(0,r.createElement)(n.Button,{variant:"link",onClick:()=>c(s,u),style:{textDecoration:"none",padding:0,minHeight:"auto"}},(0,Oe.decodeEntities)(u)),h&&(0,r.createElement)("span",{style:{color:"#999",fontSize:"0.9em"}},"(",(0,i.__)("draft","generateblocks-pro"),")")):(0,r.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},(0,r.createElement)("a",{href:t},(0,Oe.decodeEntities)(u)),h&&(0,r.createElement)("span",{style:{color:"#999",fontSize:"0.9em"}},"(",(0,i.__)("draft","generateblocks-pro"),")"))}},{id:"type",header:(0,i.__)("Overlay Panel Type","generateblocks-pro"),accessorKey:"overlay_type",cell:e=>{const t=e.getValue()||"standard",s={standard:(0,i.__)("Standard","generateblocks-pro"),anchored:(0,i.__)("Anchored","generateblocks-pro"),"mega-menu":(0,i.__)("Mega Menu","generateblocks-pro")};return(0,r.createElement)("span",{className:"gb-modal-type"},s[t]||t)}},{id:"category",header:(0,i.__)("Category","generateblocks-pro"),accessorKey:"gblocks_overlay_cat",cell:e=>{const t=e.getValue()||[],s=t.length>0?t[0]:null;if(!s)return(0,r.createElement)("span",{className:"gb-condition-category gb-condition-category--uncategorized"},(0,i.__)("Uncategorized","generateblocks-pro"));const n=y.find((e=>e.id===s)),a=n?n.name:"";return a?(0,r.createElement)("span",{className:"gb-condition-category"},a):(0,r.createElement)("span",{className:"gb-condition-category gb-condition-category--uncategorized"},(0,i.__)("Uncategorized","generateblocks-pro"))}},{id:"condition",header:(0,i.__)("Display Condition","generateblocks-pro"),accessorKey:"display_condition",cell:e=>{const t=e.getValue(),s=e.row.original.display_condition_invert;if(!t)return(0,r.createElement)("span",{className:"gb-modal-condition gb-modal-condition--everywhere"},(0,i.__)("Display Everywhere","generateblocks-pro"));if(b)return(0,r.createElement)("span",{className:"gb-modal-condition gb-modal-condition--loading"},(0,r.createElement)(n.Spinner,null));const a=f[t]||(0,i.__)("Unknown Condition","generateblocks-pro"),c=`${window.location.origin}/wp-admin/admin.php?page=generateblocks-conditions&edit=${t}`;if(o){const e=s?`${(0,i.__)("NOT","generateblocks-pro")}: ${a}`:a;return(0,r.createElement)("span",{className:"gb-modal-condition"},e)}return s?(0,r.createElement)("span",{className:"gb-modal-condition"},(0,i.__)("NOT","generateblocks-pro"),": ",(0,r.createElement)("a",{href:c},a)):(0,r.createElement)("span",{className:"gb-modal-condition"},(0,r.createElement)("a",{href:c},a))}},{id:"actions",header:null,cell:e=>{const{id:t,admin_edit_url:s,status:a}=e.row.original;return(0,r.createElement)("div",{className:"gb-cloud-public-keys__actions"},(0,r.createElement)(n.DropdownMenu,{icon:ve,label:(0,i.__)("More options","generateblocks-pro"),popoverProps:{placement:"left"}},(({onClose:l})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.MenuGroup,null,(0,r.createElement)(n.MenuItem,{onClick:()=>{if(o&&c){const{title:s}=e.row.original;let r="";"object"==typeof s&&null!==s?"object"==typeof s.rendered&&void 0!==s.rendered?.rendered?r=s.rendered.rendered:void 0!==s.rendered&&(r=s.rendered):"string"==typeof s&&(r=s),r&&""!==r.trim()||(r=(0,i.__)("(Untitled)","generateblocks-pro")),c(t,r)}else window.location.href=s;l()},icon:be},(0,i.__)("Edit Overlay Panel","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{h.mutateAsync(t).then((e=>{if(w.invalidateQueries({queryKey:["overlays"]}),e?.id){const t=`${window.location.origin}/wp-admin/post.php?post=${e.id}&action=edit`;window.location.href=t}})),l()},icon:we},(0,i.__)("Duplicate","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{const e="publish"===a?"draft":"publish";u.mutateAsync({id:t,status:e}).then((()=>{w.invalidateQueries({queryKey:["overlays"]})})),l()},icon:"publish"===a?Ee:_e},"publish"===a?(0,i.__)("Set as Draft","generateblocks-pro"):(0,i.__)("Publish","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{isDestructive:!0,onClick:()=>{p(t),l()},icon:Ce},(0,i.__)("Delete Overlay Panel","generateblocks-pro")))))))}}]),[e,o,c,y,f,b]);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"gb-dashboard-table-wrapper"},t.length?(0,r.createElement)(Se.Table,{className:"gb-dashboard-table table-view-list",columns:E,data:t,"aria-labelledby":"modals-table-header"}):(0,r.createElement)("div",{className:"gb-modals-empty-state"},(0,r.createElement)("p",null,(0,i.__)("No overlay panels found.","generateblocks-pro")))),!!d&&(0,r.createElement)(n.Modal,{title:(0,i.__)("Confirm","generateblocks-pro"),isDismissible:!1,onRequestClose:()=>null,className:"gb-modal-name-input"},(0,r.createElement)("div",{className:"gb-modal-input-container"},(0,i.__)("This will permanently delete this overlay panel. You cannot undo this action.","generateblocks-pro")),(0,r.createElement)(n.Button,{variant:"primary",onClick:async()=>{try{await l.mutateAsync(d),w.invalidateQueries({queryKey:["overlays"]}),p(null)}catch(e){console.error("Error deleting overlay:",e),p(null)}}},(0,i.__)("OK","generateblocks-pro")),(0,r.createElement)(n.Button,{variant:"tertiary",onClick:()=>p(null)},(0,i.__)("Cancel","generateblocks-pro"))))}const Re=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),xe=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"}));function Pe({category:e,updateCategory:t,saving:s}){const[o,c]=(0,a.useState)(!1),[l,u]=(0,a.useState)((0,Oe.decodeEntities)(e.name)),[h,d]=(0,a.useState)(!1),p=async()=>{d(!0),await t(e.id,l),d(!1),c(!1)},y=()=>{c(!1),u((0,Oe.decodeEntities)(e.name))};return o&&!e.isUncategorized?(0,r.createElement)("div",{className:"gb-edit-taxonomy-form"},(0,r.createElement)(n.TextControl,{value:l,onChange:u,disabled:h||s,onKeyDown:e=>{"Enter"===e.key?p():"Escape"===e.key&&y()},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,r.createElement)("div",{className:"gb-edit-actions"},(0,r.createElement)(n.Button,{variant:"primary",size:"small",onClick:p,disabled:!l.trim()||h||s,isBusy:h||s,__next40pxDefaultSize:!0},(0,i.__)("Save","generateblocks-pro")),(0,r.createElement)(n.Button,{variant:"secondary",size:"small",onClick:y,disabled:h||s,__next40pxDefaultSize:!0},(0,i.__)("Cancel","generateblocks-pro")))):(0,r.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,r.createElement)("strong",{className:e.isUncategorized?"gb-uncategorized-label":""},(0,Oe.decodeEntities)(e.name)),!e.isUncategorized&&(0,r.createElement)(n.Button,{icon:xe,size:"small",onClick:()=>{c(!0),u((0,Oe.decodeEntities)(e.name))},label:(0,i.__)("Edit category name","generateblocks-pro"),style:{visibility:"hidden"},className:"gb-taxonomy-edit-button"}))}function qe({taxonomyConfig:e={slug:"",restBase:"",labels:{singular:"Category",plural:"Categories",uncategorized:"Uncategorized",itemsCount:"items"}},itemsEndpoint:t,itemsTaxonomyField:s,manageEndpoint:o,onNavigateBack:c,onTaxonomyChange:l}){const[u,h]=(0,a.useState)([]),[d,p]=(0,a.useState)(!1),[y,m]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[v,b]=(0,a.useState)(""),{labels:w={},restBase:E}=e;(0,a.useEffect)((()=>{_()}),[]);const _=async()=>{p(!0),g(null);try{const e=[ce()({path:`/wp/v2/${E}`})];t&&e.push(ce()({path:`${t}?per_page=100`}));const r=await Promise.all(e),n=r[0],a=r[1];if(n){let e=[...n];if(a?.success&&s){const t=(a.response?.[Object.keys(a.response)[0]]||[]).filter((e=>!e[s]||0===e[s].length)).length;e=[{id:"uncategorized",name:w.uncategorized||(0,i.__)("Uncategorized","generateblocks-pro"),slug:"",count:t,isUncategorized:!0},...n]}h(e)}}catch(e){g((0,i.__)("Failed to load categories.","generateblocks-pro"))}finally{p(!1)}},C=async()=>{if(v.trim()){m(!0),g(null);try{const e=v.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-");(await ce()({path:o,method:"POST",data:{name:v.trim(),slug:e}})).success&&(await _(),b(""),l&&l())}catch(e){g((0,i.__)("Failed to create category.","generateblocks-pro"))}finally{m(!1)}}},O=async(e,t)=>{if(t.trim()){m(!0),g(null);try{(await ce()({path:`${o}/${e}`,method:"POST",data:{name:t.trim()}})).success&&(await _(),l&&l())}catch(e){g((0,i.__)("Failed to update category.","generateblocks-pro"))}finally{m(!1)}}},S=async e=>{const t=w.singular?.toLowerCase()||"category",s=(0,i.sprintf)(/* translators: %1$s: singular taxonomy label, %2$s: singular taxonomy label */ /* translators: %1$s: singular taxonomy label, %2$s: singular taxonomy label */
(0,i.__)("Are you sure you want to delete this %1$s? Items using this %2$s will become uncategorized.","generateblocks-pro"),t,t);if(confirm(s)){m(!0),g(null);try{(await ce()({path:`${o}/${e}`,method:"DELETE"})).success&&(await _(),l&&l())}catch(e){g((0,i.__)("Failed to delete category.","generateblocks-pro"))}finally{m(!1)}}},k=(0,a.useMemo)((()=>[{id:"name",header:(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("%s Name","generateblocks-pro"),w.singular||"Category"),accessorKey:"name",cell:e=>{const t=e.row.original;return(0,r.createElement)(Pe,{category:t,updateCategory:O,saving:y})}},{id:"items",header:w.itemsCount?w.itemsCount.charAt(0).toUpperCase()+w.itemsCount.slice(1):(0,i.__)("Items","generateblocks-pro"),cell:e=>`${e.row.original.count||0} ${w.itemsCount||"items"}`},{id:"actions",header:(0,i.__)("Actions","generateblocks-pro"),cell:e=>{const t=e.row.original;return t.isUncategorized?(0,r.createElement)("span",{className:"gb-uncategorized-actions"},(0,i.__)("Built-in","generateblocks-pro")):(0,r.createElement)(n.DropdownMenu,{icon:ve,label:(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("%s actions","generateblocks-pro"),w.singular||"Category"),className:"gb-taxonomy-actions",popoverProps:{placement:"left"}},(({onClose:e})=>(0,r.createElement)(n.MenuGroup,null,(0,r.createElement)(n.MenuItem,{icon:Ce,onClick:()=>{S(t.id),e()},isDestructive:!0},(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("Delete %s","generateblocks-pro"),w.singular||"Category")))))}}]),[w,O,S,y]);return(0,r.createElement)("div",{className:"gb-taxonomy-manager"},(0,r.createElement)("div",{className:"gb-taxonomy-manager-header"},(0,r.createElement)("div",{className:"gb-taxonomy-title-section"},(0,r.createElement)("h2",null,(0,i.sprintf)(/* translators: %s: plural taxonomy label */ /* translators: %s: plural taxonomy label */
(0,i.__)("Manage %s","generateblocks-pro"),w.plural||"Categories"))),(0,r.createElement)("div",{className:"gb-taxonomy-header-actions"},(0,r.createElement)(n.Button,{variant:"secondary",onClick:()=>{c()},disabled:y},(0,i.__)("Back","generateblocks-pro")))),(0,r.createElement)("div",{className:"gb-taxonomy-content"},!!f&&(0,r.createElement)(n.Notice,{status:"error",isDismissible:!1,className:"gb-taxonomy-error-notice"},f),(0,r.createElement)("div",{className:"gb-create-taxonomy-section"},(0,r.createElement)("h3",null,(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("Create New %s","generateblocks-pro"),w.singular||"Category")),(0,r.createElement)("div",{className:"gb-create-taxonomy-form"},(0,r.createElement)(n.TextControl,{label:(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("%s Name","generateblocks-pro"),w.singular||"Category"),value:v,onChange:b,placeholder:(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("Enter %s name…","generateblocks-pro"),w.singular?.toLowerCase()||"category"),disabled:y,onKeyDown:e=>{"Enter"===e.key&&C()},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,r.createElement)(n.Button,{variant:"primary",icon:Re,onClick:C,disabled:!v.trim()||y,isBusy:y,__next40pxDefaultSize:!0},(0,i.sprintf)(/* translators: %s: singular taxonomy label */ /* translators: %s: singular taxonomy label */
(0,i.__)("Create %s","generateblocks-pro"),w.singular||"Category")))),(0,r.createElement)("div",{className:"gb-taxonomy-list-section"},(0,r.createElement)("h3",null,(0,i.sprintf)(/* translators: %s: plural taxonomy label */ /* translators: %s: plural taxonomy label */
(0,i.__)("Existing %s","generateblocks-pro"),w.plural||"Categories")),d?(0,r.createElement)("div",{className:"gb-taxonomy-loading"},(0,r.createElement)(n.Spinner,null),(0,r.createElement)("span",null,(0,i.sprintf)(/* translators: %s: plural taxonomy label */ /* translators: %s: plural taxonomy label */
(0,i.__)("Loading %s…","generateblocks-pro"),w.plural?.toLowerCase()||"categories"))):(0,r.createElement)("div",{className:"gb-dashboard-table-wrapper"},0===u.length?(0,r.createElement)("p",{style:{marginTop:"0"}},(0,i.sprintf)(/* translators: %s: plural taxonomy label */ /* translators: %s: plural taxonomy label */
(0,i.__)("No %s created yet.","generateblocks-pro"),w.plural?.toLowerCase()||"categories")):(0,r.createElement)(Se.Table,{className:"gb-dashboard-table table-view-list",columns:k,data:u,"aria-labelledby":"taxonomy-table-header"})))))}const Me={taxonomyConfig:{slug:"gblocks_overlay_cat",restBase:"overlay-categories",labels:{singular:(0,i.__)("Category","generateblocks-pro"),plural:(0,i.__)("Categories","generateblocks-pro"),uncategorized:(0,i.__)("Uncategorized","generateblocks-pro"),itemsCount:"overlay panels"}},itemsEndpoint:"/generateblocks-pro/overlays/v1/overlays",itemsTaxonomyField:"gblocks_overlay_cat",manageEndpoint:"/generateblocks-pro/overlays/v1/manage_category"};function Qe({onNavigateBack:e,onCategoriesChange:t}){return(0,r.createElement)("div",{className:"gb-categories-manager"},(0,r.createElement)(qe,{...Me,onNavigateBack:e,onTaxonomyChange:t}))}function De({currentView:e,views:t={},className:s="",minHeight:n=400,viewOrder:i=[]}){const[o,c]=(0,a.useState)(e),[l,u]=(0,a.useState)(!1),[h,d]=(0,a.useState)(!1),[p,y]=(0,a.useState)("forward");(0,a.useEffect)((()=>{h||d(!0)}),[]),(0,a.useEffect)((()=>{if(h&&o!==e){const t=i.indexOf(e),s=i.indexOf(o);y(-1!==t&&-1!==s?t>s?"forward":"backward":"forward"),u(!0);const r=setTimeout((()=>{u(!1),c(e)}),260);return()=>clearTimeout(r)}}),[e,o,h,i]);const m=["gb-navigator",s,l?"gb-navigator--transitioning":"",l?`gb-navigator--${p}`:""].filter(Boolean).join(" ");return(0,r.createElement)("div",{className:m,style:{minHeight:`${n}px`}},Object.entries(t).map((([t,s])=>{const n=t===e,i=["gb-navigator-view",`gb-navigator-view--${t}`,n?"gb-navigator-view--active":"gb-navigator-view--inactive"].join(" ");return(0,r.createElement)("div",{key:t,className:i,"aria-hidden":!n},(n||l)&&s)})))}function Te({isIframeMode:e=!1,onOverlaySelect:t=null,onCreateOverlay:s=null}){const[o,l]=(0,a.useState)("list"),[u,h]=(0,a.useState)(0),[d,p]=(0,a.useState)((()=>{const e=new URLSearchParams(window.location.search);return parseInt(e.get("overlayPage")||"1",10)})),{data:y,isLoading:m,isError:f}=function({status:e="publish",perPage:t=200,page:s=1,category:r=""}={}){return re({queryKey:["overlays",{status:e,perPage:t,page:s,category:r}],queryFn:async()=>{const n=new URLSearchParams({per_page:t,page:s,_fields:"id,title,trigger_info,status,date,modified,admin_edit_url,gblocks_overlay_cat,overlay_type,display_condition,display_condition_invert",orderby:"date",order:"desc"});"any"===e?n.append("status","publish,draft,pending,private,future"):n.append("status",e),r&&n.append("gblocks_overlay_cat",r);const i=await ce()({path:`/wp/v2/gblocks_overlay?${n.toString()}`,parse:!1});return{overlays:await i.json(),totalPages:parseInt(i.headers.get("X-WP-TotalPages")||"1",10),totalItems:parseInt(i.headers.get("X-WP-Total")||"0",10)}},staleTime:12e4,cacheTime:3e5})}({status:"any",perPage:20,page:d}),g=y?.overlays||[],v=y?.totalPages||1,b=(0,a.useMemo)((()=>g&&g.length>0?g.map((e=>{const t=e.title?.rendered||e.title||"Untitled";return{...e,title:{...e.title,rendered:t}}})):[]),[g]);(0,a.useEffect)((()=>{const e=new URL(window.location);e.searchParams.set("overlayPage",d),window.history.replaceState({},"",e)}),[d]),(0,a.useEffect)((()=>{if(e)return;const t=new URLSearchParams(window.location.search).get("categories");l(t?"categories":"list")}),[e]);const w=t=>{if(e)return;const s=new URL(window.location);"categories"===t?s.searchParams.set("categories","true"):s.searchParams.delete("categories"),window.history.pushState({},"",s)},E=e=>{p(e)};if(m)return(0,r.createElement)("div",{className:"gb-cloud"},(0,r.createElement)(n.Spinner,null));if(f)return(0,r.createElement)("div",{className:"gb-cloud"},(0,r.createElement)("p",null,(0,i.__)("Error loading overlay panels. Please try again.","generateblocks-pro")));const _={list:(0,r.createElement)("div",{className:"gb-dashboard-admin"},(0,r.createElement)("div",{className:"gb-dashboard-admin__header"},(0,r.createElement)("div",{className:"gb-dashboard-admin__header-buttons"},e&&s?(0,r.createElement)("div",{style:{display:"flex"}},(0,r.createElement)(n.Button,{variant:"primary",onClick:()=>{s("new")},style:{borderTopRightRadius:0,borderBottomRightRadius:0}},(0,i.__)("Add New","generateblocks-pro")),(0,r.createElement)(n.DropdownMenu,{icon:c,label:(0,i.__)("Select overlay panel type","generateblocks-pro"),popoverProps:{placement:"bottom-end"},toggleProps:{variant:"primary",style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeft:"1px solid rgba(255,255,255,0.1)"},iconSize:18}},(({onClose:e})=>(0,r.createElement)(n.MenuGroup,null,(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),s("new","standard")}},(0,i.__)("Standard","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),s("new","anchored")}},(0,i.__)("Anchored","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),s("new","mega-menu")}},(0,i.__)("Mega Menu","generateblocks-pro")))))):(0,r.createElement)("div",{style:{display:"flex"}},(0,r.createElement)(n.Button,{variant:"primary",href:gbOverlaysDashboard.newOverlayUrl,style:{borderTopRightRadius:0,borderBottomRightRadius:0}},(0,i.__)("Add New","generateblocks-pro")),(0,r.createElement)(n.DropdownMenu,{icon:c,label:(0,i.__)("Select overlay panel type","generateblocks-pro"),popoverProps:{placement:"bottom-end"},toggleProps:{variant:"primary",style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeft:"1px solid rgba(255,255,255,0.1)"},iconSize:18}},(({onClose:e})=>(0,r.createElement)(n.MenuGroup,null,(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),window.location.href=gbOverlaysDashboard.newOverlayUrl+"&overlay_type=standard"}},(0,i.__)("Standard","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),window.location.href=gbOverlaysDashboard.newOverlayUrl+"&overlay_type=anchored"}},(0,i.__)("Anchored","generateblocks-pro")),(0,r.createElement)(n.MenuItem,{onClick:()=>{e(),window.location.href=gbOverlaysDashboard.newOverlayUrl+"&overlay_type=mega-menu"}},(0,i.__)("Mega Menu","generateblocks-pro"))))))),(0,r.createElement)("div",{className:"gb-dashboard-admin__header-buttons-right"},(0,r.createElement)(n.Button,{variant:"secondary",onClick:()=>{l("categories"),w("categories")}},(0,i.__)("Manage Categories","generateblocks-pro")))),(0,r.createElement)("div",{className:"gb-dashboard-admin__inner"},(0,r.createElement)(ke,{overlays:b,refreshKey:u,isIframeMode:e,onOverlaySelect:t}),v>1&&(0,r.createElement)("div",{className:"gb-dashboard__pagination"},(0,r.createElement)(n.Button,{disabled:1===d,onClick:()=>E(d-1),variant:"secondary"},(0,i.__)("Previous","generateblocks-pro")),(0,r.createElement)("span",null,(0,i.sprintf)(
// translators: %1$s: current page, %2$s: total pages
// translators: %1$s: current page, %2$s: total pages
(0,i.__)("Page %1$s of %2$s","generateblocks-pro"),d,v)),(0,r.createElement)(n.Button,{disabled:d===v,onClick:()=>E(d+1),variant:"secondary"},(0,i.__)("Next","generateblocks-pro"))))),categories:(0,r.createElement)("div",{className:"gb-dashboard-admin"},(0,r.createElement)(Qe,{onNavigateBack:()=>{l("list"),w("list")},onCategoriesChange:()=>{h((e=>e+1))}}))};return(0,r.createElement)(De,{currentView:o,views:_,viewOrder:["list","categories"],className:"gb-modals-dashboard",minHeight:400})}function Fe(e){return(0,r.createElement)(J,{client:ge()},(0,r.createElement)(Te,{...e}))}window.addEventListener("DOMContentLoaded",(()=>{var e,t;e=(0,r.createElement)(Fe,null),t=document.getElementById("gblocks-overlays"),void 0!==a.createRoot?(0,a.createRoot)(t).render(e):(0,a.render)(e,t)}))})();