@chaibuilder/pages 0.1.0-beta.67 → 0.1.0-beta.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./STCWXWCR-BT9eaeRC.js";
2
- import { g as d, c as f, a as e } from "./ChaiBuilderPages-Do2YFv1S.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./STCWXWCR-DiT3aTbS.js";
2
+ import { g as d, c as f, a as e } from "./ChaiBuilderPages-RzYKIes9.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./STCWXWCR-Kuh0bioJ.cjs"),t=require("./ChaiBuilderPages-D6R6H_Wy.cjs");var s=c=>{const[r,o]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),l=t.getPreferredColorScheme(),a=t.createMemo(()=>{const n=r.theme_preference||e.THEME_PREFERENCE;return n!=="system"?n:l()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:c,get children(){return t.createComponent(e.PiPProvider,{localStore:r,setLocalStore:o,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.Devtools,{localStore:r,setLocalStore:o})}})}})}})},u=s;exports.default=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./STCWXWCR-CyBCwMgV.cjs"),t=require("./ChaiBuilderPages-CwBBqHU6.cjs");var s=c=>{const[r,o]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),l=t.getPreferredColorScheme(),a=t.createMemo(()=>{const n=r.theme_preference||e.THEME_PREFERENCE;return n!=="system"?n:l()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:c,get children(){return t.createComponent(e.PiPProvider,{localStore:r,setLocalStore:o,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.Devtools,{localStore:r,setLocalStore:o})}})}})}})},u=s;exports.default=u;
@@ -0,0 +1,31 @@
1
+ "use strict";var as=e=>{throw TypeError(e)};var is=(e,t,n)=>t.has(e)||as("Cannot "+n);var O=(e,t,n)=>(is(e,t,"read from private field"),n?n.call(e):t.get(e)),se=(e,t,n)=>t.has(e)?as("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),te=(e,t,n,s)=>(is(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);const j=require("react"),Y=require("@tanstack/react-query"),Ar=require("@chaibuilder/sdk/web-blocks"),Ue=require("@chaibuilder/sdk"),v=require("lodash-es"),$=require("lucide-react"),Es=require("jotai"),Ss=require("@chaibuilder/runtime"),f=require("@chaibuilder/sdk/ui");function _r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const je=_r(j);var _n={exports:{}},wt={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var os;function Pr(){if(os)return wt;os=1;var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,h){var p,g={},b=null,T=null;h!==void 0&&(b=""+h),u.key!==void 0&&(b=""+u.key),u.ref!==void 0&&(T=u.ref);for(p in u)s.call(u,p)&&!i.hasOwnProperty(p)&&(g[p]=u[p]);if(l&&l.defaultProps)for(p in u=l.defaultProps,u)g[p]===void 0&&(g[p]=u[p]);return{$$typeof:t,type:l,key:b,ref:T,props:g,_owner:a.current}}return wt.Fragment=n,wt.jsx=o,wt.jsxs=o,wt}var Ct={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ls;function kr(){return ls||(ls=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),A=Symbol.iterator,_="@@iterator";function w(c){if(c===null||typeof c!="object")return null;var x=A&&c[A]||c[_];return typeof x=="function"?x:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(c){{for(var x=arguments.length,C=new Array(x>1?x-1:0),I=1;I<x;I++)C[I-1]=arguments[I];W("error",c,C)}}function W(c,x,C){{var I=y.ReactDebugCurrentFrame,ee=I.getStackAddendum();ee!==""&&(x+="%s",C=C.concat([ee]));var le=C.map(function(z){return String(z)});le.unshift("Warning: "+x),Function.prototype.apply.call(console[c],console,le)}}var ne=!1,X=!1,we=!1,E=!1,Q=!1,k;k=Symbol.for("react.module.reference");function G(c){return!!(typeof c=="string"||typeof c=="function"||c===s||c===i||Q||c===a||c===h||c===p||E||c===T||ne||X||we||typeof c=="object"&&c!==null&&(c.$$typeof===b||c.$$typeof===g||c.$$typeof===o||c.$$typeof===l||c.$$typeof===u||c.$$typeof===k||c.getModuleId!==void 0))}function H(c,x,C){var I=c.displayName;if(I)return I;var ee=x.displayName||x.name||"";return ee!==""?C+"("+ee+")":C}function be(c){return c.displayName||"Context"}function Ne(c){if(c==null)return null;if(typeof c.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case s:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case p:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case l:var x=c;return be(x)+".Consumer";case o:var C=c;return be(C._context)+".Provider";case u:return H(c,c.render,"ForwardRef");case g:var I=c.displayName||null;return I!==null?I:Ne(c.type)||"Memo";case b:{var ee=c,le=ee._payload,z=ee._init;try{return Ne(z(le))}catch{return null}}}return null}var Le=Object.assign,Ge=0,vt,Ht,Vt,Kt,m,d,N;function L(){}L.__reactDisabledLog=!0;function M(){{if(Ge===0){vt=console.log,Ht=console.info,Vt=console.warn,Kt=console.error,m=console.group,d=console.groupCollapsed,N=console.groupEnd;var c={configurable:!0,enumerable:!0,value:L,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}Ge++}}function B(){{if(Ge--,Ge===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Le({},c,{value:vt}),info:Le({},c,{value:Ht}),warn:Le({},c,{value:Vt}),error:Le({},c,{value:Kt}),group:Le({},c,{value:m}),groupCollapsed:Le({},c,{value:d}),groupEnd:Le({},c,{value:N})})}Ge<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var F=y.ReactCurrentDispatcher,P;function U(c,x,C){{if(P===void 0)try{throw Error()}catch(ee){var I=ee.stack.trim().match(/\n( *(at )?)/);P=I&&I[1]||""}return`
18
+ `+P+c}}var Z=!1,ie;{var oe=typeof WeakMap=="function"?WeakMap:Map;ie=new oe}function ce(c,x){if(!c||Z)return"";{var C=ie.get(c);if(C!==void 0)return C}var I;Z=!0;var ee=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=F.current,F.current=null,M();try{if(x){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Te){I=Te}Reflect.construct(c,[],z)}else{try{z.call()}catch(Te){I=Te}c.call(z.prototype)}}else{try{throw Error()}catch(Te){I=Te}c()}}catch(Te){if(Te&&I&&typeof Te.stack=="string"){for(var V=Te.stack.split(`
19
+ `),Ee=I.stack.split(`
20
+ `),de=V.length-1,fe=Ee.length-1;de>=1&&fe>=0&&V[de]!==Ee[fe];)fe--;for(;de>=1&&fe>=0;de--,fe--)if(V[de]!==Ee[fe]){if(de!==1||fe!==1)do if(de--,fe--,fe<0||V[de]!==Ee[fe]){var ke=`
21
+ `+V[de].replace(" at new "," at ");return c.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",c.displayName)),typeof c=="function"&&ie.set(c,ke),ke}while(de>=1&&fe>=0);break}}}finally{Z=!1,F.current=le,B(),Error.prepareStackTrace=ee}var Xe=c?c.displayName||c.name:"",Ve=Xe?U(Xe):"";return typeof c=="function"&&ie.set(c,Ve),Ve}function he(c,x,C){return ce(c,!1)}function K(c){var x=c.prototype;return!!(x&&x.isReactComponent)}function ge(c,x,C){if(c==null)return"";if(typeof c=="function")return ce(c,K(c));if(typeof c=="string")return U(c);switch(c){case h:return U("Suspense");case p:return U("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case u:return he(c.render);case g:return ge(c.type,x,C);case b:{var I=c,ee=I._payload,le=I._init;try{return ge(le(ee),x,C)}catch{}}}return""}var ve=Object.prototype.hasOwnProperty,Ce={},Ae=y.ReactDebugCurrentFrame;function _e(c){if(c){var x=c._owner,C=ge(c.type,c._source,x?x.type:null);Ae.setExtraStackFrame(C)}else Ae.setExtraStackFrame(null)}function Pe(c,x,C,I,ee){{var le=Function.call.bind(ve);for(var z in c)if(le(c,z)){var V=void 0;try{if(typeof c[z]!="function"){var Ee=Error((I||"React class")+": "+C+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}V=c[z](x,z,I,C,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(de){V=de}V&&!(V instanceof Error)&&(_e(ee),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",I||"React class",C,z,typeof V),_e(null)),V instanceof Error&&!(V.message in Ce)&&(Ce[V.message]=!0,_e(ee),S("Failed %s type: %s",C,V.message),_e(null))}}}var mn=Array.isArray;function xt(c){return mn(c)}function pn(c){{var x=typeof Symbol=="function"&&Symbol.toStringTag,C=x&&c[Symbol.toStringTag]||c.constructor.name||"Object";return C}}function zt(c){try{return Qt(c),!1}catch{return!0}}function Qt(c){return""+c}function bt(c){if(zt(c))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pn(c)),Qt(c)}var $e=y.ReactCurrentOwner,yn={key:!0,ref:!0,__self:!0,__source:!0},Et,St,He;He={};function vn(c){if(ve.call(c,"ref")){var x=Object.getOwnPropertyDescriptor(c,"ref").get;if(x&&x.isReactWarning)return!1}return c.ref!==void 0}function xn(c){if(ve.call(c,"key")){var x=Object.getOwnPropertyDescriptor(c,"key").get;if(x&&x.isReactWarning)return!1}return c.key!==void 0}function hr(c,x){if(typeof c.ref=="string"&&$e.current&&x&&$e.current.stateNode!==x){var C=Ne($e.current.type);He[C]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Ne($e.current.type),c.ref),He[C]=!0)}}function gr(c,x){{var C=function(){Et||(Et=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",x))};C.isReactWarning=!0,Object.defineProperty(c,"key",{get:C,configurable:!0})}}function mr(c,x){{var C=function(){St||(St=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",x))};C.isReactWarning=!0,Object.defineProperty(c,"ref",{get:C,configurable:!0})}}var pr=function(c,x,C,I,ee,le,z){var V={$$typeof:t,type:c,key:x,ref:C,props:z,_owner:le};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ee}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function yr(c,x,C,I,ee){{var le,z={},V=null,Ee=null;C!==void 0&&(bt(C),V=""+C),xn(x)&&(bt(x.key),V=""+x.key),vn(x)&&(Ee=x.ref,hr(x,ee));for(le in x)ve.call(x,le)&&!yn.hasOwnProperty(le)&&(z[le]=x[le]);if(c&&c.defaultProps){var de=c.defaultProps;for(le in de)z[le]===void 0&&(z[le]=de[le])}if(V||Ee){var fe=typeof c=="function"?c.displayName||c.name||"Unknown":c;V&&gr(z,fe),Ee&&mr(z,fe)}return pr(c,V,Ee,ee,I,$e.current,z)}}var bn=y.ReactCurrentOwner,Jn=y.ReactDebugCurrentFrame;function Ye(c){if(c){var x=c._owner,C=ge(c.type,c._source,x?x.type:null);Jn.setExtraStackFrame(C)}else Jn.setExtraStackFrame(null)}var En;En=!1;function Sn(c){return typeof c=="object"&&c!==null&&c.$$typeof===t}function Zn(){{if(bn.current){var c=Ne(bn.current.type);if(c)return`
22
+
23
+ Check the render method of \``+c+"`."}return""}}function vr(c){return""}var es={};function xr(c){{var x=Zn();if(!x){var C=typeof c=="string"?c:c.displayName||c.name;C&&(x=`
24
+
25
+ Check the top-level render call using <`+C+">.")}return x}}function ts(c,x){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var C=xr(x);if(es[C])return;es[C]=!0;var I="";c&&c._owner&&c._owner!==bn.current&&(I=" It was passed a child from "+Ne(c._owner.type)+"."),Ye(c),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',C,I),Ye(null)}}function ns(c,x){{if(typeof c!="object")return;if(xt(c))for(var C=0;C<c.length;C++){var I=c[C];Sn(I)&&ts(I,x)}else if(Sn(c))c._store&&(c._store.validated=!0);else if(c){var ee=w(c);if(typeof ee=="function"&&ee!==c.entries)for(var le=ee.call(c),z;!(z=le.next()).done;)Sn(z.value)&&ts(z.value,x)}}}function br(c){{var x=c.type;if(x==null||typeof x=="string")return;var C;if(typeof x=="function")C=x.propTypes;else if(typeof x=="object"&&(x.$$typeof===u||x.$$typeof===g))C=x.propTypes;else return;if(C){var I=Ne(x);Pe(C,c.props,"prop",I,c)}else if(x.PropTypes!==void 0&&!En){En=!0;var ee=Ne(x);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ee||"Unknown")}typeof x.getDefaultProps=="function"&&!x.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Er(c){{for(var x=Object.keys(c.props),C=0;C<x.length;C++){var I=x[C];if(I!=="children"&&I!=="key"){Ye(c),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",I),Ye(null);break}}c.ref!==null&&(Ye(c),S("Invalid attribute `ref` supplied to `React.Fragment`."),Ye(null))}}var ss={};function rs(c,x,C,I,ee,le){{var z=G(c);if(!z){var V="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ee=vr();Ee?V+=Ee:V+=Zn();var de;c===null?de="null":xt(c)?de="array":c!==void 0&&c.$$typeof===t?(de="<"+(Ne(c.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):de=typeof c,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",de,V)}var fe=yr(c,x,C,ee,le);if(fe==null)return fe;if(z){var ke=x.children;if(ke!==void 0)if(I)if(xt(ke)){for(var Xe=0;Xe<ke.length;Xe++)ns(ke[Xe],c);Object.freeze&&Object.freeze(ke)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ns(ke,c)}if(ve.call(x,"key")){var Ve=Ne(c),Te=Object.keys(x).filter(function(Nr){return Nr!=="key"}),wn=Te.length>0?"{key: someKey, "+Te.join(": ..., ")+": ...}":"{key: someKey}";if(!ss[Ve+wn]){var jr=Te.length>0?"{"+Te.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,wn,Ve,jr,Ve),ss[Ve+wn]=!0}}return c===s?Er(fe):br(fe),fe}}function Sr(c,x,C){return rs(c,x,C,!0)}function wr(c,x,C){return rs(c,x,C,!1)}var Cr=wr,Tr=Sr;Ct.Fragment=s,Ct.jsx=Cr,Ct.jsxs=Tr}()),Ct}process.env.NODE_ENV==="production"?_n.exports=Pr():_n.exports=kr();var r=_n.exports,q={context:void 0,registry:void 0,getContextId(){return cs(this.context.count)},getNextContextId(){return cs(this.context.count++)}};function cs(e){const t=String(e),n=t.length-1;return q.context.id+(n?String.fromCharCode(96+n):"")+t}function Tt(e){q.context=e}var Lr=(e,t)=>e===t,en=Symbol("solid-proxy"),Fn=Symbol("solid-track"),tn={equals:Lr},ws=_s,Re=1,nn=2,Cs={owned:null,cleanups:null,context:null,owner:null},Cn={},J=null,Tn=null,Dr=null,re=null,xe=null,Me=null,cn=0;function Fe(e,t){const n=re,s=J,a=e.length===0,i=t===void 0?s:t,o=a?Cs:{owned:null,cleanups:null,context:i?i.context:null,owner:i},l=a?e:()=>e(()=>ye(()=>dn(o)));J=o,re=null;try{return Oe(l,!0)}finally{re=n,J=s}}function ue(e,t){t=t?Object.assign({},tn,t):tn;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},s=a=>(typeof a=="function"&&(a=a(n.value)),As(n,a));return[Ns.bind(n),s]}function Pn(e,t,n){const s=un(e,t,!0,Re);yt(s)}function qe(e,t,n){const s=un(e,t,!1,Re);yt(s)}function qn(e,t,n){ws=Kr;const s=un(e,t,!1,Re);(!n||!n.render)&&(s.user=!0),Me?Me.push(s):yt(s)}function Se(e,t,n){n=n?Object.assign({},tn,n):tn;const s=un(e,t,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,yt(s),Ns.bind(s)}function Ir(e){return e&&typeof e=="object"&&"then"in e}function Or(e,t,n){let s,a,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(s=!0,a=e,i={}):(s=e,a=t,i={});let o=null,l=Cn,u=null,h=!1,p="initialValue"in i,g=typeof s=="function"&&Se(s);const b=new Set,[T,A]=(i.storage||ue)(i.initialValue),[_,w]=ue(void 0),[y,S]=ue(void 0,{equals:!1}),[W,ne]=ue(p?"ready":"unresolved");if(q.context){u=q.getNextContextId();let k;i.ssrLoadFrom==="initial"?l=i.initialValue:q.load&&(k=q.load(u))&&(l=k)}function X(k,G,H,be){return o===k&&(o=null,be!==void 0&&(p=!0),(k===l||G===l)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(be,{value:G})),l=Cn,we(G,H)),G}function we(k,G){Oe(()=>{G===void 0&&A(()=>k),ne(G!==void 0?"errored":p?"ready":"unresolved"),w(G);for(const H of b.keys())H.decrement();b.clear()},!1)}function E(){const k=$r,G=T(),H=_();if(H!==void 0&&!o)throw H;return re&&!re.user&&k&&Pn(()=>{y(),o&&(k.resolved||b.has(k)||(k.increment(),b.add(k)))}),G}function Q(k=!0){if(k!==!1&&h)return;h=!1;const G=g?g():s;if(G==null||G===!1){X(o,ye(T));return}const H=l!==Cn?l:ye(()=>a(G,{value:T(),refetching:k}));return Ir(H)?(o=H,"value"in H?(H.status==="success"?X(o,H.value,void 0,G):X(o,void 0,kn(H.value),G),H):(h=!0,queueMicrotask(()=>h=!1),Oe(()=>{ne(p?"refreshing":"pending"),S()},!1),H.then(be=>X(H,be,void 0,G),be=>X(H,void 0,kn(be),G)))):(X(o,H,void 0,G),H)}return Object.defineProperties(E,{state:{get:()=>W()},error:{get:()=>_()},loading:{get(){const k=W();return k==="pending"||k==="refreshing"}},latest:{get(){if(!p)return E();const k=_();if(k&&!o)throw k;return T()}}}),g?Pn(()=>Q(!1)):Q(!1),[E,{refetch:Q,mutate:A}]}function Gr(e){return Oe(e,!1)}function ye(e){if(re===null)return e();const t=re;re=null;try{return e()}finally{re=t}}function Mr(e,t,n){const s=Array.isArray(e);let a,i=n&&n.defer;return o=>{let l;if(s){l=Array(e.length);for(let h=0;h<e.length;h++)l[h]=e[h]()}else l=e();if(i)return i=!1,o;const u=ye(()=>t(l,a,o));return a=l,u}}function Ts(e){qn(()=>ye(e))}function mt(e){return J===null||(J.cleanups===null?J.cleanups=[e]:J.cleanups.push(e)),e}function us(){return J}function Ur(e,t){const n=J,s=re;J=e,re=null;try{return Oe(t,!0)}catch(a){Wn(a)}finally{J=n,re=s}}function Rr(e){const t=re,n=J;return Promise.resolve().then(()=>{re=t,J=n;let s;return Oe(e,!1),re=J=null,s?s.done:void 0})}var[Br,oo]=ue(!1);function Fr(){return[Br,Rr]}function qr(e,t){const n=Symbol("context");return{id:n,Provider:zr(n),defaultValue:e}}function Wr(e){let t;return J&&J.context&&(t=J.context[e.id])!==void 0?t:e.defaultValue}function js(e){const t=Se(e),n=Se(()=>Ln(t()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}var $r;function Ns(){if(this.sources&&this.state)if(this.state===Re)yt(this);else{const e=xe;xe=null,Oe(()=>rn(this),!1),xe=e}if(re){const e=this.observers?this.observers.length:0;re.sources?(re.sources.push(this),re.sourceSlots.push(e)):(re.sources=[this],re.sourceSlots=[e]),this.observers?(this.observers.push(re),this.observerSlots.push(re.sources.length-1)):(this.observers=[re],this.observerSlots=[re.sources.length-1])}return this.value}function As(e,t,n){let s=e.value;return(!e.comparator||!e.comparator(s,t))&&(e.value=t,e.observers&&e.observers.length&&Oe(()=>{for(let a=0;a<e.observers.length;a+=1){const i=e.observers[a],o=Tn&&Tn.running;o&&Tn.disposed.has(i),(o?!i.tState:!i.state)&&(i.pure?xe.push(i):Me.push(i),i.observers&&Ps(i)),o||(i.state=Re)}if(xe.length>1e6)throw xe=[],new Error},!1)),t}function yt(e){if(!e.fn)return;dn(e);const t=cn;Hr(e,e.value,t)}function Hr(e,t,n){let s;const a=J,i=re;re=J=e;try{s=e.fn(t)}catch(o){return e.pure&&(e.state=Re,e.owned&&e.owned.forEach(dn),e.owned=null),e.updatedAt=n+1,Wn(o)}finally{re=i,J=a}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?As(e,s):e.value=s,e.updatedAt=n)}function un(e,t,n,s=Re,a){const i={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:J,context:J?J.context:null,pure:n};return J===null||J!==Cs&&(J.owned?J.owned.push(i):J.owned=[i]),i}function sn(e){if(e.state===0)return;if(e.state===nn)return rn(e);if(e.suspense&&ye(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<cn);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Re)yt(e);else if(e.state===nn){const s=xe;xe=null,Oe(()=>rn(e,t[0]),!1),xe=s}}function Oe(e,t){if(xe)return e();let n=!1;t||(xe=[]),Me?n=!0:Me=[],cn++;try{const s=e();return Vr(n),s}catch(s){n||(Me=null),xe=null,Wn(s)}}function Vr(e){if(xe&&(_s(xe),xe=null),e)return;const t=Me;Me=null,t.length&&Oe(()=>ws(t),!1)}function _s(e){for(let t=0;t<e.length;t++)sn(e[t])}function Kr(e){let t,n=0;for(t=0;t<e.length;t++){const s=e[t];s.user?e[n++]=s:sn(s)}if(q.context){if(q.count){q.effects||(q.effects=[]),q.effects.push(...e.slice(0,n));return}else q.effects&&(e=[...q.effects,...e],n+=q.effects.length,delete q.effects);Tt()}for(t=0;t<n;t++)sn(e[t])}function rn(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const s=e.sources[n];if(s.sources){const a=s.state;a===Re?s!==t&&(!s.updatedAt||s.updatedAt<cn)&&sn(s):a===nn&&rn(s,t)}}}function Ps(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=nn,n.pure?xe.push(n):Me.push(n),n.observers&&Ps(n))}}function dn(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),s=e.sourceSlots.pop(),a=n.observers;if(a&&a.length){const i=a.pop(),o=n.observerSlots.pop();s<a.length&&(i.sourceSlots[o]=s,a[s]=i,n.observerSlots[s]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)dn(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function kn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Wn(e,t=J){throw kn(e)}function Ln(e){if(typeof e=="function"&&!e.length)return Ln(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const s=Ln(e[n]);Array.isArray(s)?t.push.apply(t,s):t.push(s)}return t}return e}function zr(e,t){return function(s){let a;return qe(()=>a=ye(()=>(J.context={...J.context,[e]:s.value},js(()=>s.children))),void 0),a}}var Dn=Symbol("fallback");function an(e){for(let t=0;t<e.length;t++)e[t]()}function Qr(e,t,n={}){let s=[],a=[],i=[],o=0,l=t.length>1?[]:null;return mt(()=>an(i)),()=>{let u=e()||[],h=u.length,p,g;return u[Fn],ye(()=>{let T,A,_,w,y,S,W,ne,X;if(h===0)o!==0&&(an(i),i=[],s=[],a=[],o=0,l&&(l=[])),n.fallback&&(s=[Dn],a[0]=Fe(we=>(i[0]=we,n.fallback())),o=1);else if(o===0){for(a=new Array(h),g=0;g<h;g++)s[g]=u[g],a[g]=Fe(b);o=h}else{for(_=new Array(h),w=new Array(h),l&&(y=new Array(h)),S=0,W=Math.min(o,h);S<W&&s[S]===u[S];S++);for(W=o-1,ne=h-1;W>=S&&ne>=S&&s[W]===u[ne];W--,ne--)_[ne]=a[W],w[ne]=i[W],l&&(y[ne]=l[W]);for(T=new Map,A=new Array(ne+1),g=ne;g>=S;g--)X=u[g],p=T.get(X),A[g]=p===void 0?-1:p,T.set(X,g);for(p=S;p<=W;p++)X=s[p],g=T.get(X),g!==void 0&&g!==-1?(_[g]=a[p],w[g]=i[p],l&&(y[g]=l[p]),g=A[g],T.set(X,g)):i[p]();for(g=S;g<h;g++)g in _?(a[g]=_[g],i[g]=w[g],l&&(l[g]=y[g],l[g](g))):a[g]=Fe(b);a=a.slice(0,o=h),s=u.slice(0)}return a});function b(T){if(i[g]=T,l){const[A,_]=ue(g);return l[g]=_,t(u[g],A)}return t(u[g])}}}function Yr(e,t,n={}){let s=[],a=[],i=[],o=[],l=0,u;return mt(()=>an(i)),()=>{const h=e()||[],p=h.length;return h[Fn],ye(()=>{if(p===0)return l!==0&&(an(i),i=[],s=[],a=[],l=0,o=[]),n.fallback&&(s=[Dn],a[0]=Fe(b=>(i[0]=b,n.fallback())),l=1),a;for(s[0]===Dn&&(i[0](),i=[],s=[],a=[],l=0),u=0;u<p;u++)u<s.length&&s[u]!==h[u]?o[u](()=>h[u]):u>=s.length&&(a[u]=Fe(g));for(;u<s.length;u++)i[u]();return l=o.length=i.length=p,s=h.slice(0),a=a.slice(0,l)});function g(b){i[u]=b;const[T,A]=ue(h[u]);return o[u]=A,t(T,u)}}}function $n(e,t){return ye(()=>e(t||{}))}function Yt(){return!0}var In={get(e,t,n){return t===en?n:e.get(t)},has(e,t){return t===en?!0:e.has(t)},set:Yt,deleteProperty:Yt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Yt,deleteProperty:Yt}},ownKeys(e){return e.keys()}};function jn(e){return(e=typeof e=="function"?e():e)?e:{}}function Xr(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Hn(...e){let t=!1;for(let o=0;o<e.length;o++){const l=e[o];t=t||!!l&&en in l,e[o]=typeof l=="function"?(t=!0,Se(l)):l}if(t)return new Proxy({get(o){for(let l=e.length-1;l>=0;l--){const u=jn(e[l])[o];if(u!==void 0)return u}},has(o){for(let l=e.length-1;l>=0;l--)if(o in jn(e[l]))return!0;return!1},keys(){const o=[];for(let l=0;l<e.length;l++)o.push(...Object.keys(jn(e[l])));return[...new Set(o)]}},In);const n={},s=Object.create(null);for(let o=e.length-1;o>=0;o--){const l=e[o];if(!l)continue;const u=Object.getOwnPropertyNames(l);for(let h=u.length-1;h>=0;h--){const p=u[h];if(p==="__proto__"||p==="constructor")continue;const g=Object.getOwnPropertyDescriptor(l,p);if(!s[p])s[p]=g.get?{enumerable:!0,configurable:!0,get:Xr.bind(n[p]=[g.get.bind(l)])}:g.value!==void 0?g:void 0;else{const b=n[p];b&&(g.get?b.push(g.get.bind(l)):g.value!==void 0&&b.push(()=>g.value))}}}const a={},i=Object.keys(s);for(let o=i.length-1;o>=0;o--){const l=i[o],u=s[l];u&&u.get?Object.defineProperty(a,l,u):a[l]=u?u.value:void 0}return a}function ks(e,...t){if(en in e){const a=new Set(t.length>1?t.flat():t[0]),i=t.map(o=>new Proxy({get(l){return o.includes(l)?e[l]:void 0},has(l){return o.includes(l)&&l in e},keys(){return o.filter(l=>l in e)}},In));return i.push(new Proxy({get(o){return a.has(o)?void 0:e[o]},has(o){return a.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!a.has(o))}},In)),i}const n={},s=t.map(()=>({}));for(const a of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,a),o=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let l=!1,u=0;for(const h of t)h.includes(a)&&(l=!0,o?s[u][a]=i.value:Object.defineProperty(s[u],a,i)),++u;l||(o?n[a]=i.value:Object.defineProperty(n,a,i))}return[...s,n]}function Ls(e){let t,n;const s=a=>{const i=q.context;if(i){const[l,u]=ue();q.count||(q.count=0),q.count++,(n||(n=e())).then(h=>{Tt(i),q.count--,u(()=>h.default),Tt()}),t=l}else if(!t){const[l]=Or(()=>(n||(n=e())).then(u=>u.default));t=l}let o;return Se(()=>(o=t())&&ye(()=>{if(!i)return o(a);const l=q.context;Tt(i);const u=o(a);return Tt(l),u}))};return s.preload=()=>n||((n=e()).then(a=>t=()=>a.default),n),s}var Jr=0;function Zr(){return q.context?q.getNextContextId():`cl-${Jr++}`}var Ds=e=>`Stale read from <${e}>.`;function ea(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Se(Qr(()=>e.each,e.children,t||void 0))}function ta(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Se(Yr(()=>e.each,e.children,t||void 0))}function na(e){const t=e.keyed,n=Se(()=>e.when,void 0,{equals:(s,a)=>t?s===a:!s==!a});return Se(()=>{const s=n();if(s){const a=e.children;return typeof a=="function"&&a.length>0?ye(()=>a(t?s:()=>{if(!ye(n))throw Ds("Show");return e.when})):a}return e.fallback},void 0,void 0)}function sa(e){let t=!1;const n=(i,o)=>(t?i[1]===o[1]:!i[1]==!o[1])&&i[2]===o[2],s=js(()=>e.children),a=Se(()=>{let i=s();Array.isArray(i)||(i=[i]);for(let o=0;o<i.length;o++){const l=i[o].when;if(l)return t=!!i[o].keyed,[o,l,i[o]]}return[-1]},void 0,{equals:n});return Se(()=>{const[i,o,l]=a();if(i<0)return e.fallback;const u=l.children;return typeof u=="function"&&u.length>0?ye(()=>u(t?o:()=>{if(ye(a)[0]!==i)throw Ds("Match");return l.when})):u},void 0,void 0)}function ra(e){return e}var aa=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ia=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...aa]),oa=new Set(["innerHTML","textContent","innerText","children"]),la=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ca=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ua(e,t){const n=ca[e];return typeof n=="object"?n[t]?n.$:void 0:n}var da=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),fa=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ha={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ga(e,t,n){let s=n.length,a=t.length,i=s,o=0,l=0,u=t[a-1].nextSibling,h=null;for(;o<a||l<i;){if(t[o]===n[l]){o++,l++;continue}for(;t[a-1]===n[i-1];)a--,i--;if(a===o){const p=i<s?l?n[l-1].nextSibling:n[i-l]:u;for(;l<i;)e.insertBefore(n[l++],p)}else if(i===l)for(;o<a;)(!h||!h.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[i-1]&&n[l]===t[a-1]){const p=t[--a].nextSibling;e.insertBefore(n[l++],t[o++].nextSibling),e.insertBefore(n[--i],p),t[a]=n[i]}else{if(!h){h=new Map;let g=l;for(;g<i;)h.set(n[g],g++)}const p=h.get(t[o]);if(p!=null)if(l<p&&p<i){let g=o,b=1,T;for(;++g<a&&g<i&&!((T=h.get(t[g]))==null||T!==p+b);)b++;if(b>p-l){const A=t[o];for(;l<p;)e.insertBefore(n[l++],A)}else e.replaceChild(n[l++],t[o++])}else o++;else t[o++].remove()}}}var At="_$DX_DELEGATE";function Is(e,t,n,s={}){let a;return Fe(i=>{a=i,t===document?e():ln(t,e(),t.firstChild?null:void 0,n)},s.owner),()=>{a(),t.textContent=""}}function ma(e,t,n){let s;const a=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},i=()=>(s||(s=a())).cloneNode(!0);return i.cloneNode=i,i}function Os(e,t=window.document){const n=t[At]||(t[At]=new Set);for(let s=0,a=e.length;s<a;s++){const i=e[s];n.has(i)||(n.add(i),t.addEventListener(i,Bs))}}function pa(e=window.document){if(e[At]){for(let t of e[At].keys())e.removeEventListener(t,Bs);delete e[At]}}function on(e,t,n){q.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ya(e,t,n,s){q.context&&e.isConnected||(s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s))}function Gs(e,t){q.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function Ms(e,t,n,s){if(s)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const a=n[0];e.addEventListener(t,n[0]=i=>a.call(e,n[1],i))}else e.addEventListener(t,n)}function va(e,t,n={}){const s=Object.keys(t||{}),a=Object.keys(n);let i,o;for(i=0,o=a.length;i<o;i++){const l=a[i];!l||l==="undefined"||t[l]||(ds(e,l,!1),delete n[l])}for(i=0,o=s.length;i<o;i++){const l=s[i],u=!!t[l];!l||l==="undefined"||n[l]===u||!u||(ds(e,l,!0),n[l]=u)}return n}function xa(e,t,n){if(!t)return n?on(e,"style"):t;const s=e.style;if(typeof t=="string")return s.cssText=t;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),t||(t={});let a,i;for(i in n)t[i]==null&&s.removeProperty(i),delete n[i];for(i in t)a=t[i],a!==n[i]&&(s.setProperty(i,a),n[i]=a);return n}function Us(e,t={},n,s){const a={};return s||qe(()=>a.children=Pt(e,t.children,a.children)),qe(()=>typeof t.ref=="function"&&Rs(t.ref,e)),qe(()=>ba(e,t,n,!0,a,!0)),a}function Rs(e,t,n){return ye(()=>e(t,n))}function ln(e,t,n,s){if(n!==void 0&&!s&&(s=[]),typeof t!="function")return Pt(e,t,s,n);qe(a=>Pt(e,t(),a,n),s)}function ba(e,t,n,s,a={},i=!1){t||(t={});for(const o in a)if(!(o in t)){if(o==="children")continue;a[o]=fs(e,o,null,a[o],n,i)}for(const o in t){if(o==="children")continue;const l=t[o];a[o]=fs(e,o,l,a[o],n,i)}}function Ea(e){let t,n;return!q.context||!(t=q.registry.get(n=wa()))?e():(q.completed&&q.completed.add(t),q.registry.delete(n),t)}function Sa(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function ds(e,t,n){const s=t.trim().split(/\s+/);for(let a=0,i=s.length;a<i;a++)e.classList.toggle(s[a],n)}function fs(e,t,n,s,a,i){let o,l,u,h,p;if(t==="style")return xa(e,n,s);if(t==="classList")return va(e,n,s);if(n===s)return s;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);s&&e.removeEventListener(g,s),n&&e.addEventListener(g,n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);s&&e.removeEventListener(g,s,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),b=da.has(g);if(!b&&s){const T=Array.isArray(s)?s[0]:s;e.removeEventListener(g,T)}(b||n)&&(Ms(e,g,n,b),b&&Os([g]))}else if(t.slice(0,5)==="attr:")on(e,t.slice(5),n);else if((p=t.slice(0,5)==="prop:")||(u=oa.has(t))||!a&&((h=ua(t,e.tagName))||(l=ia.has(t)))||(o=e.nodeName.includes("-"))){if(p)t=t.slice(5),l=!0;else if(q.context&&e.isConnected)return n;t==="class"||t==="className"?Gs(e,n):o&&!l&&!u?e[Sa(t)]=n:e[h||t]=n}else{const g=a&&t.indexOf(":")>-1&&ha[t.split(":")[0]];g?ya(e,g,t,n):on(e,la[t]||t,n)}return n}function Bs(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),q.registry&&!q.done&&(q.done=_$HY.done=!0);n;){const s=n[t];if(s&&!n.disabled){const a=n[`${t}Data`];if(a!==void 0?s.call(n,a,e):s.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Pt(e,t,n,s,a){const i=!!q.context&&e.isConnected;if(i){!n&&(n=[...e.childNodes]);let u=[];for(let h=0;h<n.length;h++){const p=n[h];p.nodeType===8&&p.data.slice(0,2)==="!$"?p.remove():u.push(p)}n=u}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,l=s!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(i||o==="number"&&(t=t.toString(),t===n))return n;if(l){let u=n[0];u&&u.nodeType===3?u.data!==t&&(u.data=t):u=document.createTextNode(t),n=Je(e,n,s,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(i)return n;n=Je(e,n,s)}else{if(o==="function")return qe(()=>{let u=t();for(;typeof u=="function";)u=u();n=Pt(e,u,n,s)}),()=>n;if(Array.isArray(t)){const u=[],h=n&&Array.isArray(n);if(On(u,t,n,a))return qe(()=>n=Pt(e,u,n,s,!0)),()=>n;if(i){if(!u.length)return n;if(s===void 0)return[...e.childNodes];let p=u[0],g=[p];for(;(p=p.nextSibling)!==s;)g.push(p);return n=g}if(u.length===0){if(n=Je(e,n,s),l)return n}else h?n.length===0?hs(e,u,s):ga(e,n,u):(n&&Je(e),hs(e,u));n=u}else if(t.nodeType){if(i&&t.parentNode)return n=l?[t]:t;if(Array.isArray(n)){if(l)return n=Je(e,n,s,t);Je(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function On(e,t,n,s){let a=!1;for(let i=0,o=t.length;i<o;i++){let l=t[i],u=n&&n[e.length],h;if(!(l==null||l===!0||l===!1))if((h=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))a=On(e,l,u)||a;else if(h==="function")if(s){for(;typeof l=="function";)l=l();a=On(e,Array.isArray(l)?l:[l],Array.isArray(u)?u:[u])||a}else e.push(l),a=!0;else{const p=String(l);u&&u.nodeType===3&&u.data===p?e.push(u):e.push(document.createTextNode(p))}}return a}function hs(e,t,n=null){for(let s=0,a=t.length;s<a;s++)e.insertBefore(t[s],n)}function Je(e,t,n,s){if(n===void 0)return e.textContent="";const a=s||document.createTextNode("");if(t.length){let i=!1;for(let o=t.length-1;o>=0;o--){const l=t[o];if(a!==l){const u=l.parentNode===e;!i&&!o?u?e.replaceChild(a,l):e.insertBefore(a,n):u&&l.remove()}else i=!0}}else e.insertBefore(a,n);return[a]}function wa(){return q.getNextContextId()}var Ca="http://www.w3.org/2000/svg";function Fs(e,t=!1){return t?document.createElementNS(Ca,e):document.createElement(e)}function Ta(e){const{useShadow:t}=e,n=document.createTextNode(""),s=()=>e.mount||document.body,a=us();let i,o=!!q.context;return qn(()=>{o&&(us().user=o=!1),i||(i=Ur(a,()=>Se(()=>e.children)));const l=s();if(l instanceof HTMLHeadElement){const[u,h]=ue(!1),p=()=>h(!0);Fe(g=>ln(l,()=>u()?g():i(),null)),mt(p)}else{const u=Fs(e.isSVG?"g":"div",e.isSVG),h=t&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),ln(h,i),l.appendChild(u),e.ref&&e.ref(u),mt(()=>l.removeChild(u))}},void 0,{render:!o}),n}function ja(e){const[t,n]=ks(e,["component"]),s=Se(()=>t.component);return Se(()=>{const a=s();switch(typeof a){case"function":return ye(()=>a(n));case"string":const i=fa.has(a),o=q.context?Ea():Fs(a,i);return Us(o,n,i),o}})}var Na=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},qs=class{constructor(e){this.generateIdentifier=e,this.kv=new Na}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},Aa=class extends qs{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function _a(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Pa(e,t){const n=_a(e);if("find"in n)return n.find(t);const s=n;for(let a=0;a<s.length;a++){const i=s[a];if(t(i))return i}}function pt(e,t){Object.entries(e).forEach(([n,s])=>t(s,n))}function Zt(e,t){return e.indexOf(t)!==-1}function gs(e,t){for(let n=0;n<e.length;n++){const s=e[n];if(t(s))return s}}var ka=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Pa(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},La=e=>Object.prototype.toString.call(e).slice(8,-1),Ws=e=>typeof e>"u",Da=e=>e===null,kt=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Gn=e=>kt(e)&&Object.keys(e).length===0,We=e=>Array.isArray(e),Ia=e=>typeof e=="string",Oa=e=>typeof e=="number"&&!isNaN(e),Ga=e=>typeof e=="boolean",Ma=e=>e instanceof RegExp,Lt=e=>e instanceof Map,Dt=e=>e instanceof Set,$s=e=>La(e)==="Symbol",Ua=e=>e instanceof Date&&!isNaN(e.valueOf()),Ra=e=>e instanceof Error,ms=e=>typeof e=="number"&&isNaN(e),Ba=e=>Ga(e)||Da(e)||Ws(e)||Oa(e)||Ia(e)||$s(e),Fa=e=>typeof e=="bigint",qa=e=>e===1/0||e===-1/0,Wa=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),$a=e=>e instanceof URL,Hs=e=>e.replace(/\./g,"\\."),Nn=e=>e.map(String).map(Hs).join("."),_t=e=>{const t=[];let n="";for(let a=0;a<e.length;a++){let i=e.charAt(a);if(i==="\\"&&e.charAt(a+1)==="."){n+=".",a++;continue}if(i==="."){t.push(n),n="";continue}n+=i}const s=n;return t.push(s),t};function De(e,t,n,s){return{isApplicable:e,annotation:t,transform:n,untransform:s}}var Vs=[De(Ws,"undefined",()=>null,()=>{}),De(Fa,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):e),De(Ua,"Date",e=>e.toISOString(),e=>new Date(e)),De(Ra,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(s=>{n[s]=e[s]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(s=>{n[s]=e[s]}),n}),De(Ma,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),De(Dt,"set",e=>[...e.values()],e=>new Set(e)),De(Lt,"map",e=>[...e.entries()],e=>new Map(e)),De(e=>ms(e)||qa(e),"number",e=>ms(e)?"NaN":e>0?"Infinity":"-Infinity",Number),De(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),De($a,"URL",e=>e.toString(),e=>new URL(e))];function fn(e,t,n,s){return{isApplicable:e,annotation:t,transform:n,untransform:s}}var Ks=fn((e,t)=>$s(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const s=n.symbolRegistry.getValue(t[1]);if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),Ha=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),zs=fn(Wa,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Ha[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Qs(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Ys=fn(Qs,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const s={};return n.forEach(a=>{s[a]=e[a]}),s},(e,t,n)=>{const s=n.classRegistry.getValue(t[1]);if(!s)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(s.prototype),e)}),Xs=fn((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const s=n.customTransformerRegistry.findByName(t[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(e)}),Va=[Ys,Ks,Xs,zs],ps=(e,t)=>{const n=gs(Va,a=>a.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const s=gs(Vs,a=>a.isApplicable(e,t));if(s)return{value:s.transform(e,t),type:s.annotation}},Js={};Vs.forEach(e=>{Js[e.annotation]=e});var Ka=(e,t,n)=>{if(We(t))switch(t[0]){case"symbol":return Ks.untransform(e,t,n);case"class":return Ys.untransform(e,t,n);case"custom":return Xs.untransform(e,t,n);case"typed-array":return zs.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const s=Js[t];if(!s)throw new Error("Unknown transformation: "+t);return s.untransform(e,n)}},Ze=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Zs(e){if(Zt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Zt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Zt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var za=(e,t)=>{Zs(t);for(let n=0;n<t.length;n++){const s=t[n];if(Dt(e))e=Ze(e,+s);else if(Lt(e)){const a=+s,i=+t[++n]==0?"key":"value",o=Ze(e,a);switch(i){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[s]}return e},Mn=(e,t,n)=>{if(Zs(t),t.length===0)return n(e);let s=e;for(let i=0;i<t.length-1;i++){const o=t[i];if(We(s)){const l=+o;s=s[l]}else if(kt(s))s=s[o];else if(Dt(s)){const l=+o;s=Ze(s,l)}else if(Lt(s)){if(i===t.length-2)break;const u=+o,h=+t[++i]==0?"key":"value",p=Ze(s,u);switch(h){case"key":s=p;break;case"value":s=s.get(p);break}}}const a=t[t.length-1];if(We(s)?s[+a]=n(s[+a]):kt(s)&&(s[a]=n(s[a])),Dt(s)){const i=Ze(s,+a),o=n(i);i!==o&&(s.delete(i),s.add(o))}if(Lt(s)){const i=+t[t.length-2],o=Ze(s,i);switch(+a==0?"key":"value"){case"key":{const u=n(o);s.set(u,s.get(o)),u!==o&&s.delete(o);break}case"value":{s.set(o,n(s.get(o)));break}}}return e};function Un(e,t,n=[]){if(!e)return;if(!We(e)){pt(e,(i,o)=>Un(i,t,[...n,..._t(o)]));return}const[s,a]=e;a&&pt(a,(i,o)=>{Un(i,t,[...n,..._t(o)])}),t(s,n)}function Qa(e,t,n){return Un(t,(s,a)=>{e=Mn(e,a,i=>Ka(i,s,n))}),e}function Ya(e,t){function n(s,a){const i=za(e,_t(a));s.map(_t).forEach(o=>{e=Mn(e,o,()=>i)})}if(We(t)){const[s,a]=t;s.forEach(i=>{e=Mn(e,_t(i),()=>e)}),a&&pt(a,n)}else pt(t,n);return e}var Xa=(e,t)=>kt(e)||We(e)||Lt(e)||Dt(e)||Qs(e,t);function Ja(e,t,n){const s=n.get(e);s?s.push(t):n.set(e,[t])}function Za(e,t){const n={};let s;return e.forEach(a=>{if(a.length<=1)return;t||(a=a.map(l=>l.map(String)).sort((l,u)=>l.length-u.length));const[i,...o]=a;i.length===0?s=o.map(Nn):n[Nn(i)]=o.map(Nn)}),s?Gn(n)?[s]:[s,n]:Gn(n)?void 0:n}var er=(e,t,n,s,a=[],i=[],o=new Map)=>{const l=Ba(e);if(!l){Ja(e,a,t);const T=o.get(e);if(T)return s?{transformedValue:null}:T}if(!Xa(e,n)){const T=ps(e,n),A=T?{transformedValue:T.value,annotations:[T.type]}:{transformedValue:e};return l||o.set(e,A),A}if(Zt(i,e))return{transformedValue:null};const u=ps(e,n),h=(u==null?void 0:u.value)??e,p=We(h)?[]:{},g={};pt(h,(T,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);const _=er(T,t,n,s,[...a,A],[...i,e],o);p[A]=_.transformedValue,We(_.annotations)?g[A]=_.annotations:kt(_.annotations)&&pt(_.annotations,(w,y)=>{g[Hs(A)+"."+y]=w})});const b=Gn(g)?{transformedValue:p,annotations:u?[u.type]:void 0}:{transformedValue:p,annotations:u?[u.type,g]:g};return l||o.set(e,b),b};function tr(e){return Object.prototype.toString.call(e).slice(8,-1)}function ys(e){return tr(e)==="Array"}function ei(e){if(tr(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function ti(e,t,n,s,a){const i={}.propertyIsEnumerable.call(s,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),a&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Rn(e,t={}){if(ys(e))return e.map(a=>Rn(a,t));if(!ei(e))return e;const n=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e);return[...n,...s].reduce((a,i)=>{if(ys(t.props)&&!t.props.includes(i))return a;const o=e[i],l=Rn(o,t);return ti(a,i,l,e,t.nonenumerable),a},{})}var ae=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Aa,this.symbolRegistry=new qs(t=>t.description??""),this.customTransformerRegistry=new ka,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=er(e,t,this,this.dedupe),s={json:n.transformedValue};n.annotations&&(s.meta={...s.meta,values:n.annotations});const a=Za(t,this.dedupe);return a&&(s.meta={...s.meta,referentialEqualities:a}),s}deserialize(e){const{json:t,meta:n}=e;let s=Rn(t);return n!=null&&n.values&&(s=Qa(s,n.values,this)),n!=null&&n.referentialEqualities&&(s=Ya(s,n.referentialEqualities)),s}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};ae.defaultInstance=new ae;ae.serialize=ae.defaultInstance.serialize.bind(ae.defaultInstance);ae.deserialize=ae.defaultInstance.deserialize.bind(ae.defaultInstance);ae.stringify=ae.defaultInstance.stringify.bind(ae.defaultInstance);ae.parse=ae.defaultInstance.parse.bind(ae.defaultInstance);ae.registerClass=ae.defaultInstance.registerClass.bind(ae.defaultInstance);ae.registerSymbol=ae.defaultInstance.registerSymbol.bind(ae.defaultInstance);ae.registerCustom=ae.defaultInstance.registerCustom.bind(ae.defaultInstance);ae.allowErrorProps=ae.defaultInstance.allowErrorProps.bind(ae.defaultInstance);var nr=ae.serialize,ni=ae.stringify;function si(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function ri(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function ai({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ii({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function oi(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var li=(e,t=!1)=>{const{json:n}=nr(e);return JSON.stringify(n,null,t?2:void 0)},Xt=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,ci=(e,t)=>e.queryHash.localeCompare(t.queryHash),sr=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,ui=(e,t)=>Xt(e)===Xt(t)?sr(e,t):Xt(e)>Xt(t)?1:-1,di={status:ui,"query hash":ci,"last updated":sr},Jt=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,rr=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,fi=(e,t)=>Jt(e)===Jt(t)?rr(e,t):Jt(e)>Jt(t)?1:-1,hi={status:fi,"last updated":rr},gi=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),mi=()=>{const[e,t]=ue("dark");return Ts(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const s=a=>{t(a.matches?"dark":"light")};n.addEventListener("change",s),mt(()=>n.removeEventListener("change",s))}),e},jt=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const s=new Map(e);if(t.length===1)return s.set(t[0],n),s;const[a,...i]=t;return s.set(a,jt(s.get(a),i,n)),s}if(e instanceof Set){const s=jt(Array.from(e),t,n);return new Set(s)}if(Array.isArray(e)){const s=[...e];if(t.length===1)return s[t[0]]=n,s;const[a,...i]=t;return s[a]=jt(s[a],i,n),s}if(e instanceof Object){const s={...e};if(t.length===1)return s[t[0]]=n,s;const[a,...i]=t;return s[a]=jt(s[a],i,n),s}return e},Nt=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[s,...a]=t;return n.set(s,Nt(n.get(s),a)),n}if(e instanceof Set){const n=Nt(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,o)=>o.toString()!==t[0]);const[s,...a]=t;return n[s]=Nt(n[s],a),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[s,...a]=t;return n[s]=Nt(n[s],a),n}return e},ar=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const s=document.createElement("style"),a=document.createTextNode("");s.appendChild(a),s.id="_goober",s.setAttribute("nonce",e),t?t.appendChild(s):document.head.appendChild(s)},et,It,Ot,Gt,Ke,Mt,tt,nt,st,rt,at,it,Ut,xs,pi=(xs=class{constructor(e){se(this,et);se(this,It);se(this,Ot);se(this,Gt);se(this,Ke,!1);se(this,Mt);se(this,tt);se(this,nt);se(this,st);se(this,rt);se(this,at);se(this,it);se(this,Ut);const{client:t,queryFlavor:n,version:s,onlineManager:a,buttonPosition:i,position:o,initialIsOpen:l,errorTypes:u,styleNonce:h,shadowDOMTarget:p}=e;te(this,et,ue(t)),te(this,Ot,n),te(this,Gt,s),te(this,It,a),te(this,Mt,h),te(this,tt,p),te(this,nt,ue(i)),te(this,st,ue(o)),te(this,rt,ue(l)),te(this,at,ue(u))}setButtonPosition(e){O(this,nt)[1](e)}setPosition(e){O(this,st)[1](e)}setInitialIsOpen(e){O(this,rt)[1](e)}setErrorTypes(e){O(this,at)[1](e)}setClient(e){O(this,et)[1](e)}mount(e){if(O(this,Ke))throw new Error("Devtools is already mounted");const t=Is(()=>{const n=this,[s]=O(this,nt),[a]=O(this,st),[i]=O(this,rt),[o]=O(this,at),[l]=O(this,et);let u;return O(this,it)?u=O(this,it):(u=Ls(()=>Promise.resolve().then(()=>require("./BMGNQTAT-P0jBLLzo.cjs"))),te(this,it,u)),ar(O(this,Mt),O(this,tt)),$n(u,Hn({get queryFlavor(){return O(n,Ot)},get version(){return O(n,Gt)},get onlineManager(){return O(n,It)},get shadowDOMTarget(){return O(n,tt)}},{get client(){return l()},get buttonPosition(){return s()},get position(){return a()},get initialIsOpen(){return i()},get errorTypes(){return o()}}))},e);te(this,Ke,!0),te(this,Ut,t)}unmount(){var e;if(!O(this,Ke))throw new Error("Devtools is not mounted");(e=O(this,Ut))==null||e.call(this),te(this,Ke,!1)}},et=new WeakMap,It=new WeakMap,Ot=new WeakMap,Gt=new WeakMap,Ke=new WeakMap,Mt=new WeakMap,tt=new WeakMap,nt=new WeakMap,st=new WeakMap,rt=new WeakMap,at=new WeakMap,it=new WeakMap,Ut=new WeakMap,xs),ot,Rt,Bt,Ft,ze,qt,lt,ct,ut,dt,ft,ht,gt,Wt,bs,yi=(bs=class{constructor(e){se(this,ot);se(this,Rt);se(this,Bt);se(this,Ft);se(this,ze,!1);se(this,qt);se(this,lt);se(this,ct);se(this,ut);se(this,dt);se(this,ft);se(this,ht);se(this,gt);se(this,Wt);const{client:t,queryFlavor:n,version:s,onlineManager:a,buttonPosition:i,position:o,initialIsOpen:l,errorTypes:u,styleNonce:h,shadowDOMTarget:p,onClose:g}=e;te(this,ot,ue(t)),te(this,Bt,n),te(this,Ft,s),te(this,Rt,a),te(this,qt,h),te(this,lt,p),te(this,ct,ue(i)),te(this,ut,ue(o)),te(this,dt,ue(l)),te(this,ft,ue(u)),te(this,ht,ue(g))}setButtonPosition(e){O(this,ct)[1](e)}setPosition(e){O(this,ut)[1](e)}setInitialIsOpen(e){O(this,dt)[1](e)}setErrorTypes(e){O(this,ft)[1](e)}setClient(e){O(this,ot)[1](e)}setOnClose(e){O(this,ht)[1](()=>e)}mount(e){if(O(this,ze))throw new Error("Devtools is already mounted");const t=Is(()=>{const n=this,[s]=O(this,ct),[a]=O(this,ut),[i]=O(this,dt),[o]=O(this,ft),[l]=O(this,ot),[u]=O(this,ht);let h;return O(this,gt)?h=O(this,gt):(h=Ls(()=>Promise.resolve().then(()=>require("./UODQIBEW-Bhfs_yfa.cjs"))),te(this,gt,h)),ar(O(this,qt),O(this,lt)),$n(h,Hn({get queryFlavor(){return O(n,Bt)},get version(){return O(n,Ft)},get onlineManager(){return O(n,Rt)},get shadowDOMTarget(){return O(n,lt)}},{get client(){return l()},get buttonPosition(){return s()},get position(){return a()},get initialIsOpen(){return i()},get errorTypes(){return o()},get onClose(){return u()}}))},e);te(this,ze,!0),te(this,Wt,t)}unmount(){var e;if(!O(this,ze))throw new Error("Devtools is not mounted");(e=O(this,Wt))==null||e.call(this),te(this,ze,!1)}},ot=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,ze=new WeakMap,qt=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,ht=new WeakMap,gt=new WeakMap,Wt=new WeakMap,bs);function vi(e){const t=Y.useQueryClient(e.client),n=je.useRef(null),{buttonPosition:s,position:a,initialIsOpen:i,errorTypes:o,styleNonce:l,shadowDOMTarget:u}=e,[h]=je.useState(new pi({client:t,queryFlavor:"React Query",version:"5",onlineManager:Y.onlineManager,buttonPosition:s,position:a,initialIsOpen:i,errorTypes:o,styleNonce:l,shadowDOMTarget:u}));return je.useEffect(()=>{h.setClient(t)},[t,h]),je.useEffect(()=>{s&&h.setButtonPosition(s)},[s,h]),je.useEffect(()=>{a&&h.setPosition(a)},[a,h]),je.useEffect(()=>{h.setInitialIsOpen(i||!1)},[i,h]),je.useEffect(()=>{h.setErrorTypes(o||[])},[o,h]),je.useEffect(()=>(n.current&&h.mount(n.current),()=>{h.unmount()}),[h]),r.jsx("div",{className:"tsqd-parent-container",ref:n})}function xi(e){const t=Y.useQueryClient(e.client),n=je.useRef(null),{errorTypes:s,styleNonce:a,shadowDOMTarget:i}=e,[o]=je.useState(new yi({client:t,queryFlavor:"React Query",version:"5",onlineManager:Y.onlineManager,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:s,styleNonce:a,shadowDOMTarget:i,onClose:e.onClose}));return je.useEffect(()=>{o.setClient(t)},[t,o]),je.useEffect(()=>{o.setOnClose(e.onClose??(()=>{}))},[e.onClose,o]),je.useEffect(()=>{o.setErrorTypes(s||[])},[s,o]),je.useEffect(()=>(n.current&&o.mount(n.current),()=>{o.unmount()}),[o]),r.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var bi=process.env.NODE_ENV!=="development"?function(){return null}:vi;process.env.NODE_ENV;const Ei=Es.atom({}),ir=()=>Es.useAtom(Ei),$t=(e,t)=>{const[n]=ir();return v.get(n,e,t)},me=()=>$t("apiUrl","/chai/api"),R={ASK_AI:"ASK_AI",GET_PAGE:"GET_PAGE",CREATE_PAGE:"CREATE_PAGE",UPDATE_PAGE:"UPDATE_PAGE",DELETE_PAGE:"DELETE_PAGE",CHANGE_SLUG:"CHANGE_SLUG",TAKE_OFFLINE:"TAKE_OFFLINE",PUBLISH_PAGE:"PUBLISH_PAGE",PUBLISH_CHANGES:"PUBLISH_CHANGES",ADD_NEW_LANGUAGE:"ADD_NEW_LANGUAGE",EDIT_LANGUAGE:"EDIT_LANGUAGE",DELETE_LANGUAGE:"DELETE_LANGUAGE",GET_CHANGES:"GET_CHANGES",GET_SERVER_BLOCK:"GET_SERVER_BLOCK",GET_LANGUAGE_PAGES:"GET_LANGUAGE_PAGES",GET_PROJECT_PAGES:"GET_PROJECT_PAGES",GET_WEBSITE_PAGES:"GET_WEBSITE_PAGES",UPDATE_WEBSITE_SETTINGS:"UPDATE_WEBSITE_SETTINGS",GET_COLLECTIONS:"GET_COLLECTIONS",GET_PAGE_TYPES:"GET_PAGE_TYPES",SEARCH_PAGES:"SEARCH_PAGES",GET_WEBSITE_SETTINGS:"GET_WEBSITE_SETTINGS",AI_CONTEXT:"AI_CONTEXT",GET_WEBSITE_DATA:"GET_WEBSITE_DATA",UPDATE_WEBSITE_DATA:"UPDATE_WEBSITE_DATA"},Vn=()=>{const e=Y.useQueryClient(),{data:t}=Y.useQuery({queryKey:[R.AI_CONTEXT],initialData:"",queryFn:()=>""});return{setAiContext:j.useCallback(s=>{e.setQueryData([R.AI_CONTEXT],s)},[]),aiContext:t}},pe=async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await n.json();if(s!=null&&s.error||n.status===400||!n.ok)throw new Error((s==null?void 0:s.error)||"Something went wrong.");return s},Si=()=>{const e=me(),{aiContext:t}=Vn();return j.useCallback(async(n,s,a,i)=>pe(e,{action:R.ASK_AI,data:{type:n,prompt:s,blocks:a,context:t,lang:i}}),[e,t])},wi=()=>{const e=me();return{getUILibraryBlock:async(a,i)=>{const u=(await(await fetch(a.url+(i.path?"/blocks/"+i.path:"/"+i.uuid+".html"))).text()).replace(/---([\s\S]*?)---/g,"");return Ue.getBlocksFromHTML(`${u}`)},getUILibraryBlocks:async a=>{try{return(await(await fetch(a.url+"/blocks.json")).json()).map(l=>({...l,preview:a.url.replace("chaiblocks","")+l.preview}))}catch(i){return console.error(i),[]}},onSave:async({page:a,blocks:i})=>{try{return await pe(e,{action:"UPDATE_PAGE",data:{id:a,blocks:i}})}catch{return new Error("Failed to save blocks")}}}};function Qe(){const[e,t]=j.useState(new URLSearchParams(window.location.search));return j.useEffect(()=>{const n=()=>{t(new URLSearchParams(window.location.search))};return window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}},[]),[e,t]}const hn=()=>{const e=me();return Y.useQuery({queryKey:[R.GET_WEBSITE_PAGES],staleTime:1e3*60*5,queryFn:async()=>pe(e,{action:R.GET_WEBSITE_PAGES})||[]})},Be=()=>{const[e]=Qe(),t=e.get("page"),{data:n,isFetching:s}=hn();return{data:j.useMemo(()=>v.find(n,{id:t})||{},[n,t]),isFetching:s}},Ci=()=>Y.useQuery({queryKey:["uiLibraries"],initialData:[],queryFn:async()=>[{uuid:"chaiblocks",name:"UI Blocks",url:"https://chaibuilder.com/chaiblocks"}]}),Ti=()=>{const[e]=Qe(),t=e.get("page"),n=me(),{setAiContext:s}=Vn();return Y.useQuery({queryKey:[R.GET_PAGE,t],initialData:[],queryFn:async()=>{const i=(await pe(n,{action:R.GET_PAGE,data:{id:t,draft:!0}})).blocks??[],o=v.find(i,{_type:"@chai/ai-context"});return s(v.get(o,"_value","")||""),i},enabled:!!t})},ji=(e,t)=>t.map(n=>{if(v.has(e,n._type)){const s=Ss.getDefaultBlockProps(n._type);return{...s,...v.pick(n,[...v.keys(s),"_type","_id","_name","_parent","_bindings"]),...v.pickBy(n,(a,i)=>v.endsWith(i,"_attrs"))}}return n}),Ni=e=>{const t=Ss.useRegisteredChaiBlocks();return j.useMemo(()=>{if(!e||v.isEmpty(e))return{blocks:[]};const n=v.filter(e,s=>!v.includes(s==null?void 0:s._type,"@chai/"));return{blocks:ji(t,n)}},[e,t])},Kn=()=>{const e=me();return Y.useQuery({queryKey:[R.GET_WEBSITE_SETTINGS],initialData:{theme:{},fallbackLang:"en",languages:[]},queryFn:async()=>pe(e,{action:R.GET_WEBSITE_SETTINGS,data:{draft:!0}})})},Ai=()=>{const{data:e}=hn(),t=me();return{getGlobalBlocks:async()=>{const n={};for(const s of e??[])v.isEmpty(s==null?void 0:s.slug)&&(n[s.id]={name:v.startCase(s.name??s.slug),description:""});return n},getGlobalBlockBlocks:async n=>n?(await pe(t,{action:"GET_PAGE",data:{id:n,draft:!0}})).blocks:[]}},_i=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.UPDATE_WEBSITE_SETTINGS,data:s}),onSuccess:(s,a)=>{var i;t.invalidateQueries({queryKey:[R.GET_WEBSITE_SETTINGS]}),(i=a==null?void 0:a.settings)!=null&&i.theme||n({title:"Website settings updated successfully."})},onError:s=>{n({variant:"destructive",title:"Failed to update website settings",description:s.message})}})},Pi=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.UPDATE_WEBSITE_DATA,data:s}),onSuccess:()=>{t.invalidateQueries({queryKey:[R.GET_WEBSITE_DATA]}),n({title:"Website data updated successfully."})},onError:s=>{n({variant:"destructive",title:"Failed to update website data",description:s.message})}})},gn=()=>{const e=me();return Y.useQuery({queryKey:[R.GET_PAGE_TYPES],initialData:[],queryFn:async()=>pe(e,{action:R.GET_PAGE_TYPES})})},ki=()=>{const e=me();return Y.useMutation({mutationFn:async({collection:t,query:n})=>{try{return pe(e,{action:R.SEARCH_PAGES,data:{collection:t,query:Array.isArray(n)&&n.length>0?n[0]:n}})||[]}catch(s){return console.error(s),[]}}})},Ie={ab:"Abkhazian",aa:"Afar",af:"Afrikaans",ak:"Akan",sq:"Albanian",am:"Amharic",ar:"Arabic",an:"Aragonese",hy:"Armenian",as:"Assamese",av:"Avaric",ae:"Avestan",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",ba:"Bashkir",eu:"Basque",be:"Belarusian",bn:"Bengali",bh:"Bihari",bi:"Bislama",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",ny:"Chichewa",zh:"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)",cv:"Chuvash",kw:"Cornish",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Maldivian",nl:"Dutch",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",fi:"Finnish",fr:"French",ff:"Fula, Pular",gl:"Galician",gd:"Gaelic (Scottish)",gv:"Manx",ka:"Georgian",de:"German",el:"Greek",kl:"Kalaallisut",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hz:"Herero",hi:"Hindi",ho:"Hiri Motu",hu:"Hungarian",is:"Icelandic",io:"Ido",ig:"Igbo",id:"Indonesian",ia:"Interlingua",ie:"Interlingue",iu:"Inuktitut",ik:"Inupiak",ga:"Irish",it:"Italian",ja:"Japanese",jv:"Javanese",kn:"Kannada",kr:"Kanuri",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ki:"Kikuyu",rw:"Kinyarwanda",rn:"Kirundi",ky:"Kyrgyz",kv:"Komi",kg:"Kongo",ko:"Korean",ku:"Kurdish",kj:"Kwanyama",lo:"Lao",la:"Latin",lv:"Latvian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lu:"Luga-Katanga",lg:"Luganda, Ganda",lb:"Luxembourgish",mk:"Macedonian",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mh:"Marshallese",mo:"Moldavian",mn:"Mongolian",na:"Nauru",nv:"Navajo",ng:"Ndonga",nd:"Northern Ndebele",ne:"Nepali",no:"Norwegian",nb:"Norwegian bokmål",nn:"Norwegian nynorsk",ii:"Sichuan Yi",oc:"Occitan",oj:"Ojibwe",cu:"Old Church Slavonic",or:"Oriya",om:"Oromo",os:"Ossetian",pi:"Pāli",ps:"Pashto, Pushto",fa:"Persian (Farsi)",pl:"Polish",pt:"Portuguese",pa:"Punjabi (Eastern)",qu:"Quechua",rm:"Romansh",ro:"Romanian",ru:"Russian",se:"Sami",sm:"Samoan",sg:"Sango",sa:"Sanskrit",sr:"Serbian",sh:"Serbo-Croatian",st:"Sesotho",tn:"Setswana",sn:"Shona",sd:"Sindhi",si:"Sinhalese",ss:"Swati",sk:"Slovak",sl:"Slovenian",so:"Somali",nr:"Southern Ndebele",es:"Spanish",su:"Sundanese",sw:"Swahili (Kiswahili)",sv:"Swedish",tl:"Tagalog",ty:"Tahitian",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",bo:"Tibetan",ti:"Tigrinya",to:"Tonga",ts:"Tsonga",tr:"Turkish",tk:"Turkmen",tw:"Twi",ug:"Uyghur",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",ve:"Venda",vi:"Vietnamese",vo:"Volapük",wa:"Wallon",cy:"Welsh",wo:"Wolof",fy:"Western Frisian",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",za:"Zhuang, Chuang",zu:"Zulu"},Li={SLUG_ALREADY_USED:"This slug is already in use. Please choose a different one."},D={PREVIEW:"Preview",THEME:"Theme",SAVEDRAFT:"Save draft",SAVING:"Saving",SAVED:"Saved",PUBLISHED:"Published",PUBLISH:"Publish",UNPUBLISH:"Unpublish",WEBSITEDATA:"Website data",OPEN:"Open",EDIT_LANGUAGE:"Edit language",ADD_NEW_LANGUAGE:"Add New language",ENTER_LANGUAGE_DETAILS:"Enter the details for the language",LANGUAGE:"Language",PAGE_NAME:"Page Name",SLUG:"Slug",UPDATE:"Update",UPDATING:"Updating...",ADDING:"Adding...",CHOOSE_LANGUAGE:"Choose language",ALL_AVAILABLE_LANGUAGE_PAGE:"All available language page is created.",TO_UPDATE_SLUG:"To update slug use 'Change slug' action",SLUG_SHOULD_START_WITH:" (Slug should start with /{lang})",CHOOSE_LANGUAGE_TO_ADD_SLUG:"Choose language to add slug",ENTER_PAGE_SLUG:"Enter page slug",ENTER_PAGE_NAME:"Enter page name",DELETE:"Delete",CHANGE_SLUG:"Change slug",PRIMARY:"Primary",SLUG_MUST_START_WITH:"Slug must start with /",EDIT:"Edit",UNPUBLISH_MSG:"Are you sure you want to unpublish",PAGE_ADD_SUCCESS:"New page added successfully.",GLOBAL_BLOCK_ADD_SUCCESS:"New global block added successfully.",SEO_SETTINGS_UPDATE_SUCCESS:"SEO Settings updated successfully.",PAGE_UPDATE_SUCCESS:"Page updated successfully.",GLOBAL_BLOCK_UPDATE_SUCCESS:"Global block updated successfully.",PAGE_DELETE_SUCCESS:"Page deleted successfully.",GLOBAL_BLOCK_DELETE_SUCCESS:"Global block deleted successfully.",PAGE_UNPUBLISH_SUCCESS:"Page unpublished successfully.",GLOBAL_BLOCK_UNPUBLISH_SUCCESS:"Global block unpublished successfully.",PAGE_PUBLISH_SUCCESS:"Page published successfully.",GLOBAL_BLOCK_PUBLISH_SUCCESS:"Global block published successfully.",PAGES_PUBLISH_SUCCESS:"Your changes have been published successfully.",SLUG_CHANGE_SUCCESS:"Slug changed successfully."},or=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.CREATE_PAGE,data:s}),onSuccess:(s,a)=>{a&&(a!=null&&a.primaryPage)?t.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,a==null?void 0:a.primaryPage]}):t.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]}),n({title:a.collection==="global"?D.GLOBAL_BLOCK_ADD_SUCCESS:D.PAGE_ADD_SUCCESS})},onError:(s,a)=>{n({variant:"destructive",title:`Failed to add new ${a.collection==="global"?"global block":"page"}.`,description:v.get(Li,s.message,s.message)})}})},zn=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.UPDATE_PAGE,data:s}),onSuccess:(s,a)=>{a&&(a!=null&&a.primaryPage||a!=null&&a.seo)?t.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,a==null?void 0:a.primaryPage]}):t.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]}),a!=null&&a.seo?n({title:D.SEO_SETTINGS_UPDATE_SUCCESS}):n({title:a.collection==="global"?D.GLOBAL_BLOCK_UPDATE_SUCCESS:D.PAGE_UPDATE_SUCCESS})},onError:(s,a)=>{n({variant:"destructive",title:`Failed to update ${a.collection==="global"?"global block":"page"}.`,description:s.message})}})},Di=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.DELETE_PAGE,data:{id:s==null?void 0:s.id}}),onSuccess:(s,a)=>{a&&(a!=null&&a.primaryPage)?t.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,a==null?void 0:a.primaryPage]}):t.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]}),n({title:a.collection==="global"?D.GLOBAL_BLOCK_DELETE_SUCCESS:D.PAGE_DELETE_SUCCESS})},onError:(s,a)=>{n({variant:"destructive",title:`Failed to delete ${a.collection==="global"?"global block":"page"}.`,description:s.message})}})},Ii=()=>{const e=me(),t=Y.useQueryClient(),{toast:n}=f.useToast();return Y.useMutation({mutationFn:async s=>pe(e,{action:R.TAKE_OFFLINE,data:{id:s==null?void 0:s.id}}),onSuccess:(s,a)=>{a&&(a!=null&&a.primaryPage)?t.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,a==null?void 0:a.primaryPage]}):t.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]}),n({title:a.collection==="global"?D.GLOBAL_BLOCK_UNPUBLISH_SUCCESS:D.PAGE_UNPUBLISH_SUCCESS})},onError:(s,a)=>{n({variant:"destructive",title:`Failed to take offline ${a.collection==="global"?"global block":"page"}.`,description:s.message})}})},lr=()=>{const e=me(),{toast:t}=f.useToast(),n=Y.useQueryClient(),{data:s}=Be();return Y.useMutation({mutationFn:async({ids:a})=>pe(e,{action:R.PUBLISH_CHANGES,data:{ids:a}}),onSuccess:()=>{n.invalidateQueries({queryKey:[R.GET_CHANGES]}),n.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]}),n.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,s==null?void 0:s.id]})},onError:()=>{t({title:"Failed to publish pages.",variant:"destructive"})}})},Oi=()=>{const e=me(),{toast:t}=f.useToast(),n=Y.useQueryClient();return Y.useMutation({mutationFn:async({id:s,slug:a})=>pe(e,{action:R.CHANGE_SLUG,data:{id:s,slug:a}}),onSuccess:(s,{primaryPage:a})=>{t({title:D.SLUG_CHANGE_SUCCESS}),a?n.invalidateQueries({queryKey:[R.GET_LANGUAGE_PAGES,a]}):n.invalidateQueries({queryKey:[R.GET_WEBSITE_PAGES]})},onError:()=>{t({title:"Failed to change slug",variant:"destructive"})}})},Qn=()=>{const e=me(),[t]=Qe(),n=t.get("page");return Y.useQuery({queryKey:[R.GET_LANGUAGE_PAGES,n],initialData:[],queryFn:async()=>{if(!n)return null;const s=await pe(e,{action:R.GET_LANGUAGE_PAGES,data:{id:n}});return v.reverse(v.sortBy(s,"primaryPage"))}})},Gi=()=>{const{selectedLang:e}=Ue.useLanguages(),{data:t,isFetching:n}=Qn();return{data:j.useMemo(()=>v.find(t,{lang:e||""})||{},[t,e]),isFetching:n}},cr=()=>{const{data:e,isFetching:t}=Gi(),n=e==null?void 0:e.seo,[s,a]=j.useState({title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",searchTitle:"",searchDescription:"",jsonLD:"",...n}),i=j.useRef({initial:s,updated:s}),{selectedLang:o,fallbackLang:l,languages:u}=Ue.useLanguages(),h=o.length?o:l,{mutate:p,isPending:g}=zn(),b=g;j.useEffect(()=>{!t&&n&&a({title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",searchTitle:"",searchDescription:"",jsonLD:"",...n})},[t,n]);const T=async()=>{p({id:e==null?void 0:e.id,seo:s}),i.current.initial=s,i.current.updated=s},A=()=>{a({...s,ogTitle:s.title,ogDescription:s.description})},_=()=>{a({...s,searchTitle:s.ogTitle,searchDescription:s.ogDescription})},w=y=>{const S={...s,[y.target.name]:y.target.name==="noIndex"||y.target.name==="noFollow"?y.target.checked:y.target.value};a(S),i.current.updated=S};return r.jsxs("div",{className:"relative pb-40",children:[r.jsxs("div",{className:"text-xs bg-gray-100 p-2 rounded-md text-left",children:["Slug: ",e==null?void 0:e.slug,"  ",u.length>0&&r.jsxs("span",{className:"text-blue-500 font-semibold",children:["(",v.get(Ie,h,h),")"]})]}),r.jsx("form",{className:"space-y-8",children:r.jsxs(f.Accordion,{type:"multiple",defaultValue:["page"],children:[r.jsxs(f.AccordionItem,{value:"page",children:[r.jsx(f.AccordionTrigger,{className:"text-slate-700 font-semibold",children:"SEO"}),r.jsx(f.AccordionContent,{className:"pt-2",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"title",children:"SEO Title"}),r.jsxs(r.Fragment,{children:[r.jsx(f.Input,{type:"text",id:"title",name:"title",value:s.title,onChange:w,disabled:b,placeholder:"Enter SEO title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The title should be between 10 and 60 characters."})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"description",children:"SEO Description"}),r.jsx(f.Textarea,{id:"description",name:"description",value:s.description,onChange:w,disabled:b,placeholder:"Enter SEO description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The description should be between 50 and 160 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"title",children:"Canonical URL"}),r.jsx(f.Input,{type:"text",id:"canonicalUrl",name:"canonicalUrl",value:s.canonicalUrl,onChange:w,disabled:b,placeholder:"Enter Canonical URL"})]}),r.jsxs("div",{className:"",children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsx(f.Input,{type:"checkbox",id:"noIndex",name:"noIndex",checked:s.noIndex,onChange:w,disabled:b,className:"h-4 w-4"}),r.jsx(f.Label,{className:"text-xs pb-1",htmlFor:"noIndex",children:"No Index"})]}),r.jsx("p",{className:"mt-0 text-[10px] font-light text-gray-400 leading-4",children:"Check this if you don't want search engines to index this page."})]}),r.jsxs("div",{className:"",children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsx(f.Input,{type:"checkbox",id:"noFollow",name:"noFollow",checked:s.noFollow,onChange:w,disabled:b,className:"h-4 w-4"}),r.jsx(f.Label,{className:"text-xs pb-1",htmlFor:"noIndex",children:"No Follow"})]}),r.jsx("p",{className:"text-[10px] font-light text-gray-400 leading-4",children:"Check this if you don't want search engines to follow links on this page."})]})]})})]}),r.jsxs(f.AccordionItem,{value:"og",children:[r.jsx(f.AccordionTrigger,{className:"text-slate-700 font-bold",children:"OG"}),r.jsx(f.AccordionContent,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsx(f.Button,{type:"button",variant:"outline",size:"sm",onClick:A,children:"Copy from SEO Settings"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"ogTitle",children:"OG Title"}),r.jsx(f.Input,{type:"text",id:"ogTitle",name:"ogTitle",value:s.ogTitle,onChange:w,disabled:b,placeholder:"Enter OG title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The OG title should be between 10 and 60 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs pb-1",htmlFor:"ogDescription",children:"OG Description"}),r.jsx(f.Textarea,{id:"ogDescription",name:"ogDescription",value:s.ogDescription,onChange:w,disabled:b,placeholder:"Enter OG description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The OG description should be between 50 and 160 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs pb-1",htmlFor:"ogImage",children:"OG Image URL"}),r.jsx(f.Input,{type:"text",id:"ogImage",name:"ogImage",value:s.ogImage,onChange:w,disabled:b,placeholder:"Enter OG image URL"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"Enter a valid URL for the OG image."})]})]})})]}),r.jsxs(f.AccordionItem,{value:"search",children:[r.jsx(f.AccordionTrigger,{className:"text-slate-700 font-bold",children:"SEARCH"}),r.jsx(f.AccordionContent,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsx(f.Button,{type:"button",variant:"outline",size:"sm",onClick:_,children:"Copy from OG Settings"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"searchTitle",children:"Search Title"}),r.jsx(f.Input,{type:"text",id:"searchTitle",name:"searchTitle",value:s.searchTitle,onChange:w,disabled:b,placeholder:"Enter search title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The search title should be between 10 and 60 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{className:"text-xs",htmlFor:"searchDescription",children:"Search Description"}),r.jsx(f.Textarea,{id:"searchDescription",name:"searchDescription",value:s.searchDescription,onChange:w,placeholder:"Enter search description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The search description should be between 50 and 160 characters."})]})]})})]}),r.jsxs(f.AccordionItem,{value:"jsonLD",children:[r.jsx(f.AccordionTrigger,{className:"text-slate-700 font-bold",children:"JSON-LD"}),r.jsx(f.AccordionContent,{children:r.jsx("div",{className:"space-y-4",children:r.jsx("div",{children:r.jsx(f.Textarea,{id:"jsonLD",name:"jsonLD",rows:3,value:s.jsonLD,onChange:w,placeholder:"Enter JSON-LD"})})})})]})]})}),r.jsx("div",{className:"w-full flex items-center justify-end mt-4",children:r.jsx(f.Button,{size:"lg",variant:"default",onClick:T,disabled:v.isEqual(i.current.initial,s)||b,children:g?"Saving...":"Save"})})]})};cr.displayName="SeoPanel";const Mi=({page:e,onClose:t})=>{const[n,s]=j.useState(e.slug||""),{mutate:a,isPending:i}=Oi(),{data:o}=gn(),l=v.find(o,{key:e==null?void 0:e.collection}),u=p=>{if(p.preventDefault(),!(e!=null&&e.primaryPage)&&Object.keys(Ie).some(T=>n===`/${T}`||v.startsWith(n,`/${T}/`))){f.toast({title:"Error",description:"Slugs cannot start with a language code for primary page",variant:"destructive"});return}a({...e,slug:n},{onSuccess:t})},h=(e==null?void 0:e.lang)||"";return r.jsx(f.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(f.DialogContent,{children:[r.jsxs(f.DialogHeader,{children:[r.jsx(f.DialogTitle,{children:"Change Slug"}),r.jsx(f.DialogDescription,{className:"text-xs",children:r.jsxs(f.Alert,{variant:"destructive",className:"mt-2",children:[r.jsx($.AlertCircle,{className:"h-4 w-4"}),"Changing the slug may have impact on your SEO. Please proceed with caution."]})})]}),r.jsxs("form",{onSubmit:u,children:[r.jsxs("div",{className:"space-y-4 py-4 text-sm ",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{children:[r.jsx("span",{children:"Type:"}),r.jsxs("span",{className:"font-medium text-gray-600",children:[" ",(l==null?void 0:l.name)||(e==null?void 0:e.collection)]})]}),r.jsxs("div",{children:[r.jsx("span",{children:"Name:"}),r.jsxs("span",{className:"font-medium text-gray-600",children:[" ",e.name]})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs(f.Label,{htmlFor:"slug",className:"text-right",children:["Slug"," ",r.jsxs("small",{className:"font-light text-gray-500",children:["Slug should start with /",h]})]}),r.jsx(f.Input,{id:"slug",value:n,onChange:p=>{const g=p.target.value;v.startsWith(g,`/${h}`)&&s(g)},className:"col-span-3",required:!0,pattern:"^/.*",title:"Slug must start with /",placeholder:"Enter page slug"})]})]}),r.jsx(f.DialogFooter,{children:r.jsx(f.Button,{type:"submit",disabled:i||!v.startsWith(n,`/${h}`)||v.isEqual(e==null?void 0:e.slug,n),children:i?"Changing...":"Change Slug"})})]})]})})};function ur({page:e,onClose:t}){const[,n]=Qe(),{mutate:s,isPending:a}=Di(),i=()=>{s(e,{onSuccess:()=>{e!=null&&e.primaryPage||(window.history.replaceState(null,"","/"),n(new URLSearchParams({})),window.dispatchEvent(new PopStateEvent("popstate"))),t()}})};return r.jsx(f.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(f.DialogContent,{children:[r.jsxs(f.DialogHeader,{children:[r.jsx(f.DialogTitle,{children:"Confirm Deletion"}),r.jsxs(f.DialogDescription,{className:"py-4 text-slate-500",children:[r.jsxs("div",{children:["Are you sure you want to remove ",r.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",(e==null?void 0:e.collection)==="global"?"global block?":`page? ${e!=null&&e.primaryPage?"":"This will also delete all associated language pages."}`]}),e.lang&&r.jsxs("div",{className:"py-2 text-sm",children:["Language:"," ",r.jsx("span",{className:"font-medium text-gray-500",children:v.get(Ie,e.lang,e.lang)})]})]})]}),r.jsxs(f.DialogFooter,{children:[r.jsx(f.Button,{variant:"outline",onClick:t,children:"Cancel"}),r.jsx(f.Button,{variant:"destructive",disabled:a,onClick:i,children:a?"Deleting...":"Delete"})]})]})})}const Yn=({page:e,onClose:t})=>{const{mutate:n,isPending:s}=Ii(),a=async()=>{n(e,{onSuccess:t})};return r.jsx(f.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(f.DialogContent,{children:[r.jsxs(f.DialogHeader,{children:[r.jsx(f.DialogTitle,{children:"Confirm action"}),r.jsxs(f.DialogDescription,{children:[D.UNPUBLISH_MSG," ",r.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)}),"?"]})]}),r.jsxs(f.DialogFooter,{children:[r.jsx(f.Button,{variant:"outline",onClick:t,children:"Cancel"}),r.jsx(f.Button,{variant:"destructive",disabled:s,onClick:a,children:s?D.UPDATING:D.UNPUBLISH})]})]})})},dr=({langProps:e,onClose:t,languages:n})=>{const{data:s}=Be(),[a,i]=j.useState(e.name||""),[o,l]=j.useState(e.edit?e.lang:""),[u,h]=j.useState(e.edit?e.slug:""),{mutate:p,isPending:g}=or(),{mutate:b,isPending:T}=zn(),A=(e==null?void 0:e.pageType)==="global",_=g||T,w=y=>{y.preventDefault();const S={name:a,lang:o,primaryPage:s==null?void 0:s.id,slug:u,pageType:s==null?void 0:s.pageType};S.pageType=e.pageType,e.edit&&(S.id=e==null?void 0:e.id),e.edit?b(S,{onSuccess:t}):p(S,{onSuccess:t})};return r.jsx(f.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(f.DialogContent,{className:"sm:max-w-[425px] text-slate-600",children:[r.jsxs(f.DialogHeader,{children:[r.jsx(f.DialogTitle,{children:e.edit?D.EDIT_LANGUAGE:D.ADD_NEW_LANGUAGE}),r.jsx(f.DialogDescription,{className:"font-light",children:D.ENTER_LANGUAGE_DETAILS})]}),r.jsxs("form",{onSubmit:w,children:[r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{htmlFor:"lang",className:"text-right",children:D.LANGUAGE}),r.jsxs("select",{value:o,disabled:e.edit||v.isEmpty(n),onChange:y=>{const S=y.target.value;l(S),!A&&h(`/${S}`)},className:"flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",children:[r.jsx("option",{value:"",disabled:!0,selected:!0,children:e.edit?v.get(Ie,e.lang,e.lang):v.isEmpty(n)?D.ALL_AVAILABLE_LANGUAGE_PAGE:D.CHOOSE_LANGUAGE}),v.map(n,y=>r.jsx("option",{value:y,children:v.get(Ie,y,y)},y))]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(f.Label,{htmlFor:"slug",className:"text-right",children:D.PAGE_NAME}),r.jsx(f.Input,{id:"name",value:a,onChange:y=>i(y.target.value),className:"col-span-3",required:!0,placeholder:D.ENTER_PAGE_NAME})]}),!A&&r.jsxs("div",{className:"space-y-1",children:[r.jsxs(f.Label,{htmlFor:"slug",className:"text-right",children:[D.SLUG," ",r.jsx("small",{className:"font-light",children:D.SLUG_SHOULD_START_WITH})]}),r.jsx(f.Input,{id:"slug",value:u,onChange:y=>{const S=y.target.value;v.startsWith(S,`/${o}`)&&h(v.toLower(v.trim(S)))},className:"col-span-3",required:!0,pattern:"^/.*",disabled:v.isEmpty(o),title:D.SLUG_MUST_START_WITH,placeholder:v.isEmpty(o)?D.CHOOSE_LANGUAGE_TO_ADD_SLUG:D.ENTER_PAGE_SLUG})]})]}),r.jsx(f.DialogFooter,{children:r.jsx(f.Button,{type:"submit",disabled:_||!a||!o||!A&&!v.startsWith(u,`/${o}`),children:_?e.edit?D.UPDATING:D.ADDING:e.edit?D.UPDATE:D.ADD_NEW_LANGUAGE})})]})]})})},Ui=()=>{const[e,t]=j.useState(null),{selectedLang:n,fallbackLang:s,setSelectedLang:a}=Ue.useLanguages(),{data:i,isFetching:o}=Qn(),{data:l}=Be(),[u,h]=j.useState(null),[p,g]=j.useState(null),[b,T]=j.useState(null),{data:A}=Kn(),_=v.filter(v.get(A,"languages")||["en"],w=>!v.find(i,{lang:w})&&w!==v.get(A,"fallbackLang"));return r.jsxs("div",{className:"space-y-4 pt-2",children:[r.jsx("ul",{className:"space-y-2 mt-4",children:o?r.jsxs("div",{className:"w-full space-y-3 py-4",children:[r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"})]}):v.map(i,w=>{const y=w.lang,S=w.slug,W=!w.primaryPage,ne=y===n;return r.jsxs(r.Fragment,{children:[r.jsxs("li",{className:`text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${ne?"bg-gray-200":"hover:bg-gray-100"}`,onClick:()=>a(y),children:[r.jsxs("div",{className:" flex-1 gap-x-3",children:[r.jsxs("div",{className:"text-[13px] text-slate-800 flex items-center gap-x-2",children:[r.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${w.online?"bg-green-300":"bg-gray-300"}`}),v.get(Ie,W?s:y,y)]}),r.jsxs("div",{children:[S&&r.jsxs("div",{className:"text-[11px] text-slate-600 font-light",children:["Slug: ",r.jsx("b",{className:"font-medium",children:S})]}),r.jsxs("div",{className:"text-[11px] text-slate-600 font-light",children:["Name:",r.jsxs("b",{className:"font-medium",children:[" ",w.name," "]})]})]})]}),W?r.jsxs("div",{className:"flex items-center text-[11px] text-orange-500 gap-x-1",children:[r.jsx($.StarIcon,{fill:"orange",className:"w-3 h-3"}),r.jsx("b",{children:" Primary"})]}):r.jsx("div",{className:"flex items-center gap-x-3",children:r.jsxs(f.DropdownMenu,{children:[r.jsx(f.DropdownMenuTrigger,{asChild:!0,onClick:X=>X.stopPropagation(),children:r.jsx(f.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:r.jsx($.MoreHorizontal,{className:"h-4 w-4"})})}),r.jsxs(f.DropdownMenuContent,{align:"end",className:"text-sm",children:[r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:X=>{X.stopPropagation(),t({...w,edit:!0})},children:[r.jsx($.PencilIcon,{className:"size-3"}),D.EDIT]}),(w==null?void 0:w.online)&&r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:X=>{X.stopPropagation(),g(w)},children:[r.jsx($.Power,{className:"size-3"}),D.UNPUBLISH]}),r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:X=>{X.stopPropagation(),h(w)},children:[r.jsx($.TrashIcon,{className:"size-3"}),D.DELETE]})]})]})})]},w.id),r.jsx("div",{className:"h-1 w-full border-b"})]})})}),r.jsx("div",{className:"flex justify-center w-full",children:r.jsx(f.Button,{variant:"default",size:"sm",disabled:v.isEmpty(_),onClick:()=>{t({name:l==null?void 0:l.name,pageType:l==null?void 0:l.pageType,lang:"",slug:"",edit:!1})},children:D.ADD_NEW_LANGUAGE})}),e&&r.jsx(dr,{languages:_,langProps:e,onClose:()=>t(null)}),u&&r.jsx(ur,{page:u,onClose:()=>h(null)}),p&&r.jsx(Yn,{page:p,onClose:()=>g(null)}),b&&r.jsx(Mi,{page:b,onClose:()=>T(null)})]})},Ri=()=>{const e=me();return Y.useQuery({queryKey:[R.GET_CHANGES],queryFn:async()=>pe(e,{action:R.GET_CHANGES})})};var Xn={};(function e(t,n,s,a){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;var m=new OffscreenCanvas(1,1),d=m.getContext("2d");d.fillRect(0,0,1,1);var N=m.transferToImageBitmap();try{d.createPattern(N,"no-repeat")}catch{return!1}return!0}();function u(){}function h(m){var d=n.exports.Promise,N=d!==void 0?d:t.Promise;return typeof N=="function"?new N(m):(m(u,u),null)}var p=function(m,d){return{transform:function(N){if(m)return N;if(d.has(N))return d.get(N);var L=new OffscreenCanvas(N.width,N.height),M=L.getContext("2d");return M.drawImage(N,0,0),d.set(N,L),L},clear:function(){d.clear()}}}(l,new Map),g=function(){var m=Math.floor(16.666666666666668),d,N,L={},M=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(d=function(B){var F=Math.random();return L[F]=requestAnimationFrame(function P(U){M===U||M+m-1<U?(M=U,delete L[F],B()):L[F]=requestAnimationFrame(P)}),F},N=function(B){L[B]&&cancelAnimationFrame(L[B])}):(d=function(B){return setTimeout(B,m)},N=function(B){return clearTimeout(B)}),{frame:d,cancel:N}}(),b=function(){var m,d,N={};function L(M){function B(F,P){M.postMessage({options:F||{},callback:P})}M.init=function(P){var U=P.transferControlToOffscreen();M.postMessage({canvas:U},[U])},M.fire=function(P,U,Z){if(d)return B(P,null),d;var ie=Math.random().toString(36).slice(2);return d=h(function(oe){function ce(he){he.data.callback===ie&&(delete N[ie],M.removeEventListener("message",ce),d=null,p.clear(),Z(),oe())}M.addEventListener("message",ce),B(P,ie),N[ie]=ce.bind(null,{data:{callback:ie}})}),d},M.reset=function(){M.postMessage({reset:!0});for(var P in N)N[P](),delete N[P]}}return function(){if(m)return m;if(!s&&i){var M=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
31
+ `);try{m=new Worker(URL.createObjectURL(new Blob([M])))}catch(B){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",B),null}L(m)}return m}}(),T={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function A(m,d){return d?d(m):m}function _(m){return m!=null}function w(m,d,N){return A(m&&_(m[d])?m[d]:T[d],N)}function y(m){return m<0?0:Math.floor(m)}function S(m,d){return Math.floor(Math.random()*(d-m))+m}function W(m){return parseInt(m,16)}function ne(m){return m.map(X)}function X(m){var d=String(m).replace(/[^0-9a-f]/gi,"");return d.length<6&&(d=d[0]+d[0]+d[1]+d[1]+d[2]+d[2]),{r:W(d.substring(0,2)),g:W(d.substring(2,4)),b:W(d.substring(4,6))}}function we(m){var d=w(m,"origin",Object);return d.x=w(d,"x",Number),d.y=w(d,"y",Number),d}function E(m){m.width=document.documentElement.clientWidth,m.height=document.documentElement.clientHeight}function Q(m){var d=m.getBoundingClientRect();m.width=d.width,m.height=d.height}function k(m){var d=document.createElement("canvas");return d.style.position="fixed",d.style.top="0px",d.style.left="0px",d.style.pointerEvents="none",d.style.zIndex=m,d}function G(m,d,N,L,M,B,F,P,U){m.save(),m.translate(d,N),m.rotate(B),m.scale(L,M),m.arc(0,0,1,F,P,U),m.restore()}function H(m){var d=m.angle*(Math.PI/180),N=m.spread*(Math.PI/180);return{x:m.x,y:m.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:m.startVelocity*.5+Math.random()*m.startVelocity,angle2D:-d+(.5*N-Math.random()*N),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:m.color,shape:m.shape,tick:0,totalTicks:m.ticks,decay:m.decay,drift:m.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:m.gravity*3,ovalScalar:.6,scalar:m.scalar,flat:m.flat}}function be(m,d){d.x+=Math.cos(d.angle2D)*d.velocity+d.drift,d.y+=Math.sin(d.angle2D)*d.velocity+d.gravity,d.velocity*=d.decay,d.flat?(d.wobble=0,d.wobbleX=d.x+10*d.scalar,d.wobbleY=d.y+10*d.scalar,d.tiltSin=0,d.tiltCos=0,d.random=1):(d.wobble+=d.wobbleSpeed,d.wobbleX=d.x+10*d.scalar*Math.cos(d.wobble),d.wobbleY=d.y+10*d.scalar*Math.sin(d.wobble),d.tiltAngle+=.1,d.tiltSin=Math.sin(d.tiltAngle),d.tiltCos=Math.cos(d.tiltAngle),d.random=Math.random()+2);var N=d.tick++/d.totalTicks,L=d.x+d.random*d.tiltCos,M=d.y+d.random*d.tiltSin,B=d.wobbleX+d.random*d.tiltCos,F=d.wobbleY+d.random*d.tiltSin;if(m.fillStyle="rgba("+d.color.r+", "+d.color.g+", "+d.color.b+", "+(1-N)+")",m.beginPath(),o&&d.shape.type==="path"&&typeof d.shape.path=="string"&&Array.isArray(d.shape.matrix))m.fill(Ht(d.shape.path,d.shape.matrix,d.x,d.y,Math.abs(B-L)*.1,Math.abs(F-M)*.1,Math.PI/10*d.wobble));else if(d.shape.type==="bitmap"){var P=Math.PI/10*d.wobble,U=Math.abs(B-L)*.1,Z=Math.abs(F-M)*.1,ie=d.shape.bitmap.width*d.scalar,oe=d.shape.bitmap.height*d.scalar,ce=new DOMMatrix([Math.cos(P)*U,Math.sin(P)*U,-Math.sin(P)*Z,Math.cos(P)*Z,d.x,d.y]);ce.multiplySelf(new DOMMatrix(d.shape.matrix));var he=m.createPattern(p.transform(d.shape.bitmap),"no-repeat");he.setTransform(ce),m.globalAlpha=1-N,m.fillStyle=he,m.fillRect(d.x-ie/2,d.y-oe/2,ie,oe),m.globalAlpha=1}else if(d.shape==="circle")m.ellipse?m.ellipse(d.x,d.y,Math.abs(B-L)*d.ovalScalar,Math.abs(F-M)*d.ovalScalar,Math.PI/10*d.wobble,0,2*Math.PI):G(m,d.x,d.y,Math.abs(B-L)*d.ovalScalar,Math.abs(F-M)*d.ovalScalar,Math.PI/10*d.wobble,0,2*Math.PI);else if(d.shape==="star")for(var K=Math.PI/2*3,ge=4*d.scalar,ve=8*d.scalar,Ce=d.x,Ae=d.y,_e=5,Pe=Math.PI/_e;_e--;)Ce=d.x+Math.cos(K)*ve,Ae=d.y+Math.sin(K)*ve,m.lineTo(Ce,Ae),K+=Pe,Ce=d.x+Math.cos(K)*ge,Ae=d.y+Math.sin(K)*ge,m.lineTo(Ce,Ae),K+=Pe;else m.moveTo(Math.floor(d.x),Math.floor(d.y)),m.lineTo(Math.floor(d.wobbleX),Math.floor(M)),m.lineTo(Math.floor(B),Math.floor(F)),m.lineTo(Math.floor(L),Math.floor(d.wobbleY));return m.closePath(),m.fill(),d.tick<d.totalTicks}function Ne(m,d,N,L,M){var B=d.slice(),F=m.getContext("2d"),P,U,Z=h(function(ie){function oe(){P=U=null,F.clearRect(0,0,L.width,L.height),p.clear(),M(),ie()}function ce(){s&&!(L.width===a.width&&L.height===a.height)&&(L.width=m.width=a.width,L.height=m.height=a.height),!L.width&&!L.height&&(N(m),L.width=m.width,L.height=m.height),F.clearRect(0,0,L.width,L.height),B=B.filter(function(he){return be(F,he)}),B.length?P=g.frame(ce):oe()}P=g.frame(ce),U=oe});return{addFettis:function(ie){return B=B.concat(ie),Z},canvas:m,promise:Z,reset:function(){P&&g.cancel(P),U&&U()}}}function Le(m,d){var N=!m,L=!!w(d||{},"resize"),M=!1,B=w(d,"disableForReducedMotion",Boolean),F=i&&!!w(d||{},"useWorker"),P=F?b():null,U=N?E:Q,Z=m&&P?!!m.__confetti_initialized:!1,ie=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,oe;function ce(K,ge,ve){for(var Ce=w(K,"particleCount",y),Ae=w(K,"angle",Number),_e=w(K,"spread",Number),Pe=w(K,"startVelocity",Number),mn=w(K,"decay",Number),xt=w(K,"gravity",Number),pn=w(K,"drift",Number),zt=w(K,"colors",ne),Qt=w(K,"ticks",Number),bt=w(K,"shapes"),$e=w(K,"scalar"),yn=!!w(K,"flat"),Et=we(K),St=Ce,He=[],vn=m.width*Et.x,xn=m.height*Et.y;St--;)He.push(H({x:vn,y:xn,angle:Ae,spread:_e,startVelocity:Pe,color:zt[St%zt.length],shape:bt[S(0,bt.length)],ticks:Qt,decay:mn,gravity:xt,drift:pn,scalar:$e,flat:yn}));return oe?oe.addFettis(He):(oe=Ne(m,He,U,ge,ve),oe.promise)}function he(K){var ge=B||w(K,"disableForReducedMotion",Boolean),ve=w(K,"zIndex",Number);if(ge&&ie)return h(function(Pe){Pe()});N&&oe?m=oe.canvas:N&&!m&&(m=k(ve),document.body.appendChild(m)),L&&!Z&&U(m);var Ce={width:m.width,height:m.height};P&&!Z&&P.init(m),Z=!0,P&&(m.__confetti_initialized=!0);function Ae(){if(P){var Pe={getBoundingClientRect:function(){if(!N)return m.getBoundingClientRect()}};U(Pe),P.postMessage({resize:{width:Pe.width,height:Pe.height}});return}Ce.width=Ce.height=null}function _e(){oe=null,L&&(M=!1,t.removeEventListener("resize",Ae)),N&&m&&(document.body.contains(m)&&document.body.removeChild(m),m=null,Z=!1)}return L&&!M&&(M=!0,t.addEventListener("resize",Ae,!1)),P?P.fire(K,Ce,_e):ce(K,Ce,_e)}return he.reset=function(){P&&P.reset(),oe&&oe.reset()},he}var Ge;function vt(){return Ge||(Ge=Le(null,{useWorker:!0,resize:!0})),Ge}function Ht(m,d,N,L,M,B,F){var P=new Path2D(m),U=new Path2D;U.addPath(P,new DOMMatrix(d));var Z=new Path2D;return Z.addPath(U,new DOMMatrix([Math.cos(F)*M,Math.sin(F)*M,-Math.sin(F)*B,Math.cos(F)*B,N,L])),Z}function Vt(m){if(!o)throw new Error("path confetti are not supported in this browser");var d,N;typeof m=="string"?d=m:(d=m.path,N=m.matrix);var L=new Path2D(d),M=document.createElement("canvas"),B=M.getContext("2d");if(!N){for(var F=1e3,P=F,U=F,Z=0,ie=0,oe,ce,he=0;he<F;he+=2)for(var K=0;K<F;K+=2)B.isPointInPath(L,he,K,"nonzero")&&(P=Math.min(P,he),U=Math.min(U,K),Z=Math.max(Z,he),ie=Math.max(ie,K));oe=Z-P,ce=ie-U;var ge=10,ve=Math.min(ge/oe,ge/ce);N=[ve,0,0,ve,-Math.round(oe/2+P)*ve,-Math.round(ce/2+U)*ve]}return{type:"path",path:d,matrix:N}}function Kt(m){var d,N=1,L="#000000",M='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof m=="string"?d=m:(d=m.text,N="scalar"in m?m.scalar:N,M="fontFamily"in m?m.fontFamily:M,L="color"in m?m.color:L);var B=10*N,F=""+B+"px "+M,P=new OffscreenCanvas(B,B),U=P.getContext("2d");U.font=F;var Z=U.measureText(d),ie=Math.ceil(Z.actualBoundingBoxRight+Z.actualBoundingBoxLeft),oe=Math.ceil(Z.actualBoundingBoxAscent+Z.actualBoundingBoxDescent),ce=2,he=Z.actualBoundingBoxLeft+ce,K=Z.actualBoundingBoxAscent+ce;ie+=ce+ce,oe+=ce+ce,P=new OffscreenCanvas(ie,oe),U=P.getContext("2d"),U.font=F,U.fillStyle=L,U.fillText(d,he,K);var ge=1/N;return{type:"bitmap",bitmap:P.transferToImageBitmap(),matrix:[ge,0,0,ge,-ie*ge/2,-oe*ge/2]}}n.exports=function(){return vt().apply(this,arguments)},n.exports.reset=function(){vt().reset()},n.exports.create=Le,n.exports.shapeFromPath=Vt,n.exports.shapeFromText=Kt})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Xn,!1);const vs=Xn.exports;Xn.exports.create;const Bn=e=>{vs(e==="TOP_RIGHT"?{particleCount:200,angle:225,spread:120,origin:{x:.9,y:0}}:{particleCount:350,spread:120,origin:{y:.6},angle:90})};function Bi({onClose:e=()=>console.log("Cancelled")}){const[t,n]=j.useState([]),{data:s,isFetching:a}=Ri(),{data:i}=gn(),o=j.useMemo(()=>v.filter(s,y=>y.collection!=="global"),[s]),l=j.useMemo(()=>v.filter(s,{collection:"global"}),[s]),u=j.useMemo(()=>v.find(s,{collection:"theme",id:"THEME"}),[s]),{mutate:h,isPending:p}=lr();j.useEffect(()=>{const y=v.map(v.filter(s,{online:!0}),"id");u&&y.push(u==null?void 0:u.id),n(y)},[s,u]);const g=t.length===(s==null?void 0:s.length),b=y=>{n(S=>v.includes(S,y)?v.filter(S,W=>W!==y):v.concat(S,y))},T=()=>{n(g?[]:v.map(s,"id"))},A=()=>{h({ids:v.uniq(t)},{onSuccess:()=>{e(),Bn("CENTER_CENTER")}})},_=y=>{if(y==="global")return"Global Block";if(y==="theme")return"Theme";const S=v.find(i,{key:y});return S?S==null?void 0:S.name:y},w=j.useMemo(()=>{const y=[{label:"Updated Pages & Global Blocks",top:"pt-2"},...v.orderBy(v.filter(o,{online:!0}),"collection"),...v.orderBy(v.filter(l,{online:!0}),"collection")].filter(ne=>ne.collection!=="theme"),S=[{label:"Offline Pages & Global Blocks",top:"pt-6"},...v.orderBy(v.filter(o,{online:!1}),"collection"),...v.orderBy(v.filter(l,{online:!1}),"collection")],W=u?[{label:"Theme",top:"pt-6"},u]:[];return[...y,...W,...S]},[o,l,u]);return r.jsx(f.Dialog,{open:!0,onOpenChange:p?()=>{}:e,children:r.jsxs(f.DialogContent,{className:"max-w-4xl max-h-[80%] flex flex-col",children:[r.jsxs(f.DialogHeader,{children:[r.jsx(f.DialogTitle,{children:"Publish changes"}),r.jsx(f.DialogDescription,{className:"text-xs",children:"Select the pages you want to publish. Click publish when you're done."})]}),r.jsx("div",{className:"relative -mx-4 h-full overflow-y-auto max-h-full no-scrollbar",children:a?r.jsxs("div",{className:"space-y-2 px-1",children:[r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse mt-2"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"})]}):r.jsxs("table",{className:"w-full text-xs text-left rtl:text-right text-gray-500 dark:text-gray-400",children:[r.jsx("thead",{className:"text-gray-700 border-b bg-gray-50 dark:bg-gray-700 dark:text-gray-400",children:r.jsxs("tr",{children:[r.jsxs("th",{scope:"col",className:"px-6 py-3 flex items-center gap-x-2 w-[1 50px]",children:[r.jsx("input",{checked:g,onClick:y=>{y.stopPropagation(),T()},type:"checkbox",className:"rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"}),"Name"]}),r.jsx("th",{scope:"col",className:"px-2 py-3 w-[100px]",children:"Language"}),r.jsx("th",{scope:"col",className:"px-2 py-3 w-[100px]",children:"Type"}),r.jsx("th",{scope:"col",className:"px-4 py-3 w-[150px] text-right",children:"Status"})]})}),r.jsx("tbody",{children:v.map(w,y=>y.label?r.jsx("tr",{children:r.jsxs("td",{colSpan:4,className:`px-6 py-2 text-xs font-medium text-gray-800 relative ${y.top}`,children:[r.jsx("div",{className:"absolute inset-0 left-6 flex items-center",children:r.jsx("div",{className:"w-full order-gray-300"})}),r.jsx("div",{className:"relative flex justify-start",children:r.jsx("span",{className:"bg-gray-50 pr-2",children:y.label})})]})},"separator"):r.jsxs("tr",{className:"hover:bg-gray-50 border-b last:border-b-0",children:[r.jsxs("td",{scope:"row",className:"px-6 py-2 text-gray-900 whitespace-nowrap dark:text-white flex items-center gap-x-1",children:[r.jsx("input",{checked:v.includes(t,y==null?void 0:y.id),onClick:S=>{S.stopPropagation(),b(y==null?void 0:y.id)},type:"checkbox",className:"rounded focus:outline-none focus:ring-0 cursor-pointer"})," ",y.collection==="global"?r.jsx($.GlobeIcon,{className:"h-4 w-4"}):r.jsx($.File,{className:"h-4 w-4"}),y.name,y.slug&&r.jsxs("span",{className:"text-xs text-gray-500",children:["(",y.slug,")"]})]}),r.jsx("td",{className:"px-2",children:y.lang}),r.jsx("td",{className:"px-2",children:_(y==null?void 0:y.collection)}),r.jsx("td",{className:"px-4 text-right",children:v.first(y.changes)||""})]},y==null?void 0:y.id))})]})}),r.jsxs(f.DialogFooter,{className:"mt-10",children:[r.jsx(f.Button,{disabled:p,variant:"outline",onClick:e,children:"Cancel"}),r.jsx(f.Button,{disabled:p||a||v.isEmpty(s),onClick:A,children:p?"Publishing...":"Publish"})]})]})})}const Fi=()=>{const e=me();return Y.useQuery({queryKey:[R.GET_WEBSITE_DATA],staleTime:1e3*60*5,queryFn:async()=>pe(e,{action:R.GET_WEBSITE_DATA,data:{draft:!0}})})};function qi({onClose:e}){const{data:t,isFetching:n}=Fi(),{mutateAsync:s,isPending:a}=Pi(),i=$t("settingComponent",null),o=v.debounce(async l=>(await s({data:l}),!0),300);return i?r.jsx(f.Dialog,{open:!0,onOpenChange:e,children:r.jsxs(f.DialogContent,{className:"w-full",children:[r.jsx(f.DialogHeader,{children:r.jsx(f.DialogTitle,{children:"Website Settings"})}),n?r.jsxs("div",{className:"w-full space-y-3 py-4",children:[r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"})]}):r.jsx("div",{children:j.createElement(i,{data:t||{},onSave:a?()=>{}:o,cancel:a?()=>{}:e})})]})}):null}function fr({children:e,content:t}){return r.jsx(f.TooltipProvider,{children:r.jsxs(f.Tooltip,{children:[r.jsx(f.TooltipTrigger,{asChild:!0,children:e}),r.jsx(f.TooltipContent,{side:"bottom",sideOffset:10,children:r.jsx("p",{children:t})})]})})}const Wi=()=>{const e=$t("getPreviewUrl",async o=>o),[t,n]=j.useState(""),{data:s,isFetching:a}=Be(),i=j.useMemo(()=>s==null?void 0:s.slug,[s==null?void 0:s.slug]);return j.useEffect(()=>{(async()=>{if(i&&typeof e=="function"){const o=await e(i||"");n(o)}else n("")})()},[e,i]),!t||(s==null?void 0:s.collection)==="global"||a?null:r.jsx(r.Fragment,{children:r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:r.jsxs(f.Button,{variant:"ghost",size:"sm",className:"gap-2",children:[r.jsx($.Eye,{className:"w-4 h-4"})," ",D.PREVIEW]})})})},$i=()=>{const[e,t]=Ue.useRightPanel();return r.jsxs(r.Fragment,{children:[r.jsx(fr,{content:D.THEME,children:r.jsx(f.Button,{variant:e==="theme"?"outline":"ghost",size:"icon",className:"gap-2",onClick:()=>t(e==="theme"?"block":"theme"),children:r.jsx($.Palette,{className:"w-4 h-4"})})}),r.jsx("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700"})]})},Hi=()=>{const[e,t]=j.useState(!1),{savePage:n,saveState:s}=Ue.useSavePage();j.useEffect(()=>{const h=p=>{s==="UNSAVED"&&(p.preventDefault(),p.returnValue=!1)};return s==="UNSAVED"&&window.addEventListener("beforeunload",h),()=>{window.removeEventListener("beforeunload",h)}},[s]);const a=j.useCallback(async()=>{t(!0),await n(!1)},[n]);j.useEffect(()=>{s==="SAVED"&&t(!1)},[s]);const i=j.useMemo(()=>{if(s==="SAVED"||s==="UNSAVED")return s;if(s==="SAVING")return e?s:"SAVED"},[e,s]),{buttonIcon:o,buttonClass:l,tooltipContent:u}=j.useMemo(()=>{switch(i){case"UNSAVED":return{tooltipContent:D.SAVEDRAFT,buttonIcon:r.jsx($.Save,{className:"w-4 h-4"}),buttonClass:"flex items-center gap-x-1 leading-tight"};case"SAVING":return{tooltipContent:D.SAVING,buttonIcon:r.jsx($.Loader,{className:"w-4 h-4 animate-spin"}),buttonClass:"flex items-center gap-x-1 leading-tight"};case"SAVED":return{tooltipContent:D.SAVED,buttonIcon:r.jsx($.CheckCircle,{className:"w-4 h-4"}),buttonClass:"text-green-500 flex items-center gap-x-1 leading-tight"}}},[i]);return r.jsxs(f.Button,{size:"sm",variant:"ghost",onClick:a,className:l,children:[o," ",u]})},Vi=()=>{const[e,t]=j.useState(!1),[n,s]=j.useState(!1),[a,i]=j.useState(null),{data:o}=Be(),{mutate:l,isPending:u}=lr(),{buttonText:h,buttonClassName:p,isPublished:g}=j.useMemo(()=>{const b=o&&(o==null?void 0:o.online);return{buttonClassName:b?"hover:bg-green-600 bg-green-500":"",isPublished:b,buttonText:b?D.PUBLISHED:D.PUBLISH}},[o]);return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex",children:[r.jsxs(f.Button,{size:"sm",disabled:u||!(o!=null&&o.id),onClick:()=>l({ids:[o==null?void 0:o.id]},{onSuccess:()=>Bn("TOP_RIGHT")}),className:`relative overflow-hidden transition-all duration-300 ease-in-out text-white flex items-center gap-1 rounded-r-none ${p}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[r.jsx("span",{className:`flex items-center transition-transform duration-300 ease-in-out ${n?"-translate-y-10":""}`,children:g?r.jsx($.Send,{className:"w-4 h-4"}):r.jsx($.Rocket,{className:"w-4 h-4"})}),r.jsx("span",{className:`absolute inset-0 flex items-center left-3 transition-transform duration-300 ease-in-out ${n?"":"translate-y-10"}`,children:g?r.jsx($.Rocket,{className:"w-4 h-4"}):r.jsx($.Send,{className:"w-4 h-4"})}),r.jsx("span",{children:h})]}),r.jsxs(f.DropdownMenu,{children:[r.jsx(f.DropdownMenuTrigger,{asChild:!0,children:r.jsx(f.Button,{size:"sm",disabled:u||!(o!=null&&o.id),className:`px-2 text-white border-l border-white/50 rounded-l-none ${p}`,children:r.jsx($.ChevronDown,{className:"h-4 w-4"})})}),r.jsxs(f.DropdownMenuContent,{align:"end",className:"w-36",children:[!g&&r.jsxs(f.DropdownMenuItem,{disabled:u,className:"text-xs cursor-pointer",onClick:()=>l({ids:[o==null?void 0:o.id]},{onSuccess:()=>Bn("TOP_RIGHT")}),children:[D.PUBLISH," page"]}),r.jsxs(f.DropdownMenuItem,{onClick:()=>t(!0),className:"text-xs cursor-pointer",children:[D.OPEN," publish menu"]}),g&&r.jsxs(f.DropdownMenuItem,{onClick:()=>i(o),className:"text-xs cursor-pointer",children:[D.UNPUBLISH," page"]})]})]})]}),e&&r.jsx(Bi,{onClose:()=>t(!1)}),a&&r.jsx(Yn,{page:a,onClose:()=>i(null)})]})},Ki=()=>{const e=$t("settingComponent",null),[t,n]=j.useState(!1);return e?r.jsxs(r.Fragment,{children:[r.jsx(fr,{content:D.WEBSITEDATA,children:r.jsx(f.Button,{variant:"ghost",size:"icon",className:"gap-2",onClick:()=>n(!0),children:r.jsx($.Settings,{className:"w-4 h-4"})})}),r.jsx("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700"}),t&&r.jsx(qi,{onClose:()=>n(!1)})]}):null},zi=()=>{const{data:e}=Be(),t=e&&(e==null?void 0:e.online);return r.jsxs(f.Button,{onClick:()=>t&&window.open(`${window.location.origin}${e.slug}`,"_blank"),disabled:!t,variant:"ghost",size:"sm",className:"flex items-center gap-1",children:[r.jsx($.ExternalLink,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:D.OPEN})]})};function Qi(){return r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[r.jsx($i,{}),r.jsx(Ki,{}),r.jsx(Wi,{}),r.jsx(Hi,{}),r.jsx(Vi,{}),r.jsx(zi,{})]})}function Yi({addEditPage:e,additionalPageTypes:t=[],close:n}){var we;const s=!!(e!=null&&e.id),{data:a}=hn(),{mutate:i,isPending:o}=or(),{mutate:l,isPending:u}=zn(),[h,p]=j.useState((e==null?void 0:e.pageType)??"page"),[g,b]=j.useState((e==null?void 0:e.parent)??""),[T,A]=j.useState((e==null?void 0:e.name)??""),[_,w]=j.useState((e==null?void 0:e.slug)??""),y=o||u,S=E=>{p(E),b(""),w("")},W=E=>{if(b(E),E&&E!=="none"){const Q=a==null?void 0:a.find(H=>H.id===E),k=(Q==null?void 0:Q.slug)||"",G=_.split("/").pop();w(`${k}${G?`/${G}`:""}`)}else{const Q=_.split("/").pop();w(Q?`/${Q}`:"")}},ne=j.useCallback(E=>{if(g&&g!=="none"){const Q=a==null?void 0:a.find(H=>H.id===g),k=(Q==null?void 0:Q.slug)||"";let G=E;G.startsWith(k)&&(G=G.slice(k.length)),G=G.replace(/^\/+/,"").replace(/\/+$/,""),w(k==="/"?`/${G}`:`${k}/${G}`)}else{const Q=E.startsWith("/")?E:`/${E}`;w(Q)}},[g,a]),X=E=>{if(E.preventDefault(),!T.trim()){f.toast({title:"Error",description:"Name is required",variant:"destructive"});return}if(h==="global"){const H={pageType:"global",name:T,slug:""};if(s){l({id:e==null?void 0:e.id,name:T},{onSuccess:()=>{f.toast({title:"Success",description:"Global Block updated successfully"}),n()}});return}i(H,{onSuccess:()=>{f.toast({title:"Success",description:"Global Block created successfully"}),n()}});return}if(g&&g!=="none"&&!_){f.toast({title:"Error",description:"Slug is required when a parent page is selected",variant:"destructive"});return}if(h!=="page"&&_===""){f.toast({title:"Error",description:"Slug is required for non-home pages",variant:"destructive"});return}if(Object.keys(Ie).some(H=>_===`/${H}`||(_==null?void 0:_.startsWith(`/${H}/`)))){f.toast({title:"Error",description:"Slugs cannot start with a language code for primary page",variant:"destructive"});return}const G={pageType:h,name:T,slug:_===""?"/":_.replace(/\/$/,""),...g&&g!=="none"&&{parent:g}};if(s){l({id:e==null?void 0:e.id,...G},{onSuccess:()=>{f.toast({title:"Success",description:"Page updated successfully"}),n()}});return}i(G,{onSuccess:()=>{f.toast({title:"Success",description:"Page created successfully"}),n()}})};return h==="global"?r.jsxs("form",{onSubmit:X,className:"space-y-4 w-full max-w-md mx-auto",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(f.Label,{htmlFor:"pageType",className:"text-sm",children:"Page Type"}),r.jsx("select",{id:"pageType",value:h,disabled:s,onChange:E=>S(E.target.value),className:`w-full rounded-md border border-gray-300 px-3 py-2 ${s?"cursor-not-allowed text-gray-500":""}`,children:t.map(E=>r.jsx("option",{value:E.key,children:E.name},E.key))}),r.jsx("p",{className:"text-sm text-gray-500",children:(we=t.find(E=>E.key===h))==null?void 0:we.helpText})]}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(f.Label,{htmlFor:"name",className:"text-sm",children:"Name"}),r.jsx(f.Input,{id:"name",value:T,onChange:E=>A(E.target.value),required:!0,"aria-required":"true"})]}),r.jsx(f.Button,{disabled:y,type:"submit",className:"w-full",children:s?y?"Updating...":"Update Global Block":y?"Creating...":"Create Global Block"})]}):r.jsxs("form",{onSubmit:X,className:"space-y-4 w-full max-w-md mx-auto",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(f.Label,{htmlFor:"pageType",className:"text-sm",children:"Page Type"}),r.jsx("select",{id:"pageType",value:h,disabled:s,onChange:E=>S(E.target.value),className:`w-full rounded-md border border-gray-300 px-3 py-2 ${s?"cursor-not-allowed text-gray-500":""}`,children:t.map(E=>r.jsx("option",{value:E.key,children:E.name},E.key))})]}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(f.Label,{htmlFor:"parentPage",className:"text-sm",children:"Parent"}),r.jsxs("select",{id:"parentPage",value:g,onChange:E=>W(E.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2",children:[r.jsx("option",{value:"none",children:"None"}),a==null?void 0:a.filter(E=>E.pageType!=="global"&&E.slug!=="/").map(E=>r.jsxs("option",{value:E.id,children:[E.name," (",E.slug,")"]},E.id))]})]}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(f.Label,{htmlFor:"name",className:"text-sm",children:"Name"}),r.jsx(f.Input,{id:"name",value:T,onChange:E=>A(E.target.value),required:!0,"aria-required":"true"})]}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs(f.Label,{htmlFor:"slug",className:"text-sm",children:["Slug"," "]}),r.jsx(f.Input,{id:"slug",value:_,onChange:E=>ne(E.target.value),placeholder:g&&g!=="none"?"Required - e.g. /your-slug":h==="page"?"Leave empty for home page":"Required - e.g. /your-slug"})]}),r.jsx(f.Button,{disabled:y,type:"submit",className:"w-full",children:s?y?"Updating...":"Update page":y?"Creating...":"Create Page"})]})}const Xi=({addEditPage:e,setAddEditPage:t})=>{const{data:n}=gn(),s=!!(e!=null&&e.id);return r.jsx(f.Dialog,{open:!!e,onOpenChange:()=>t(void 0),children:r.jsxs(f.DialogContent,{className:"sm:max-w-[425px]",children:[r.jsxs(f.DialogHeader,{children:[r.jsxs(f.DialogTitle,{children:[s?"Edit":"Add New"," "]}),r.jsx(f.DialogDescription,{children:s?"Update your page name":"Enter details to create a new page"})]}),r.jsx(Yi,{addEditPage:e,close:()=>t(void 0),additionalPageTypes:n??[]})]})})},An=({parentSlug:e,page:t,active:n,changeActivePage:s,setUnpublishPage:a,setDeletePage:i,setAddEditPage:o})=>r.jsxs("div",{onClick:()=>s(v.get(t,"id")),className:`rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n?"bg-gray-200":"hover:bg-gray-100"}`,children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[t.pageType==="global"?r.jsx($.Globe,{className:"w-4 h-4 text-slate-500 stroke-[1]"}):r.jsx($.File,{className:"w-4 h-4 text-slate-500 stroke-[1]"}),r.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${t.online?"bg-green-300":"bg-gray-300"}`}),r.jsx("span",{className:"leading-none text-slate-800 font-light",children:v.startCase(t.name)??""}),t.pageType!=="global"?r.jsx(f.Badge,{variant:"outline",className:"ml-2 font-bold text-xs rounded-full leading-none text-slate-500",children:v.get(t,"slug").replace(e,"")||"/"}):r.jsx(f.Badge,{variant:"outline",className:"ml-2 font-bold text-xs rounded-full leading-none text-slate-500",children:"Global Block"})]}),r.jsx("div",{className:"flex items-center space-x-4",children:r.jsxs(f.DropdownMenu,{children:[r.jsx(f.DropdownMenuTrigger,{asChild:!0,onClick:l=>l.stopPropagation(),children:r.jsx($.MoreHorizontal,{className:"h-4 w-4 hover:stroke-[3]"})}),r.jsxs(f.DropdownMenuContent,{align:"end",className:"text-sm",children:[r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:l=>{l.stopPropagation(),o({...t,global:t.pageType==="global"})},children:[r.jsx($.Pencil,{className:"size-3"}),"Edit"]}),(t==null?void 0:t.online)&&r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:l=>{l.stopPropagation(),a(t)},children:[r.jsx($.Power,{className:"size-3"}),D.UNPUBLISH]}),r.jsxs(f.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:l=>{l.stopPropagation(),i(t)},children:[r.jsx($.Trash,{className:"size-3"}),D.DELETE]})]})]})})]}),Ji=({close:e})=>{const[,t]=j.useState([]),[n,s]=j.useState(""),[a,i]=j.useState(null),[o,l]=j.useState(null),[u,h]=j.useState(null),{data:p,isFetching:g}=hn(),[b,T]=Qe(),A=b.get("page"),_=j.useCallback(y=>{window.history.pushState({},"",`?page=${y}`),T(new URLSearchParams({page:y})),window.dispatchEvent(new PopStateEvent("popstate")),e()},[e,T]);j.useEffect(()=>{if(A&&!g){const y=v.find(p,{id:A});y&&(y!=null&&y.pageType)?t(S=>[...S,y==null?void 0:y.pageType]):(window.history.replaceState(null,"","/"),T(new URLSearchParams({})),window.dispatchEvent(new PopStateEvent("popstate")))}},[p,A,g,T]);const w=j.useMemo(()=>{const y=v.filter(p,E=>v.isEmpty(n)?!0:v.includes(v.toLower(E==null?void 0:E.name),v.toLower(n))||v.includes(v.toLower(E==null?void 0:E.slug),v.toLower(n))),S=new Map;y.forEach(E=>{S.set(E.id,{...E,children:[]})});const W=[],ne=[];S.forEach(E=>{if(E.parent){const Q=S.get(E.parent);Q?Q.children.push(E):W.push(E)}else ne.push(E)}),W.sort((E,Q)=>E.name.localeCompare(Q.name)),W.forEach(E=>{E.children.sort((Q,k)=>Q.name.localeCompare(k.name))});const X=v.filter(ne,E=>E.pageType==="global"),we=v.filter(ne,E=>E.pageType!=="global").sort((E,Q)=>E.name.localeCompare(Q.name));return v.compact([...we,...X,...W])},[p,n]);return r.jsxs("div",{className:"h-full flex flex-col justify-between",children:[r.jsxs("div",{className:"space-y-6 flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"rounded-md bg-primary p-2 text-primary-foreground",children:r.jsx($.File,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:"text-sm font-semibold",children:"Pages"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Manage your site structure"})]})]}),r.jsxs("div",{className:"relative flex item-center gap-x-4",children:[r.jsx($.Search,{strokeWidth:2.5,className:"absolute left-3 top-2.5 h-4 w-4 text-gray-400"}),r.jsx(f.Input,{placeholder:"Search pages...",className:"pl-9 text-xs font-medium placeholder:text-gray-400 leading-none text-gray-700",value:n,onChange:y=>s(y.target.value)})]}),g?r.jsx("div",{className:"space-y-2",children:v.map([...Array(5).keys()],y=>r.jsx("div",{className:"h-9 w-full rounded bg-gray-200 animate-pulse"},y))}):v.isEmpty(w)?r.jsxs("div",{className:"h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium",children:[r.jsx($.File,{className:"h-6 w-6 stroke-[1]"}),"Empty List!",r.jsx("span",{className:"font-light",children:"Add new page to start"})]}):r.jsx("div",{className:"text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto",children:v.map(w,y=>y.children.length>0?r.jsxs("div",{className:"border-0",children:[r.jsx(An,{changeActivePage:_,setUnpublishPage:l,setDeletePage:i,setAddEditPage:h,active:A===y.id,page:y}),r.jsx("div",{className:"bg-white pl-6 pt-2",children:v.map(v.get(y,"children",[]),S=>{const W=A===v.get(S,"id");return r.jsx(An,{parentSlug:y.slug,changeActivePage:_,setUnpublishPage:l,setDeletePage:i,setAddEditPage:h,active:W,page:S})})})]},y.key):r.jsx(An,{changeActivePage:_,setUnpublishPage:l,setDeletePage:i,setAddEditPage:h,active:A===y.id,page:y}))})]}),r.jsxs(f.Button,{className:"text-sm flex gap-x-2",onClick:()=>{h({slug:"",name:"",collection:"page",pageType:"page"})},children:[r.jsx($.Plus,{className:"w-4 h-4"})," Add New"]}),u&&r.jsx(Xi,{editPage:_,addEditPage:u,setAddEditPage:h}),a&&r.jsx(ur,{page:a,onClose:()=>i(null)}),o&&r.jsx(Yn,{page:o,onClose:()=>l(null)})]})},Zi=()=>{const e=$t("logo",null);return e?r.jsx("div",{className:"w-full max-h-9 overflow-hidden pr-2",children:j.createElement(e,{})}):null},eo=()=>{const[e]=Qe(),t=e.get("page"),{data:n,isFetching:s}=Be(),[a,i]=j.useState(!1),o=!!t&&!v.isEmpty(n),l=!t||!s&&v.isEmpty(n)||a;return r.jsxs(r.Fragment,{children:[r.jsxs(f.Button,{variant:"secondary",className:"flex items-center w-full space-x-2 py-1",onClick:()=>i(!0),children:[r.jsx("div",{children:r.jsx($.Logs,{className:"h-4 w-4"})}),r.jsxs("span",{className:"truncate leading-tight flex items-center max-w-[200px]",children:[r.jsx("span",{className:"text-slate-600 pr-1 font-light",children:"Editing:"}),s?r.jsx($.Loader,{className:"h-4 w-4 animate-spin text-slate-400 ml-2"}):v.startCase(v.get(n,"name"))??""]})]},"template-viewer"),r.jsx(f.Sheet,{open:l,onOpenChange:u=>!u&&o&&i(!1),children:r.jsx(f.SheetContent,{side:"left",className:`!max-w-screen-sm border-border w-full ${o?"":"sheet-hide-close-btn"}`,children:r.jsx(Ji,{close:()=>i(!1)})})})]})},to=()=>{const{fallbackLang:e,languages:t,selectedLang:n,setSelectedLang:s}=Ue.useLanguages(),a=v.isEmpty(n)?e:n,[i,o]=j.useState(null),{data:l}=Be(),{data:u}=Kn(),{data:h,isFetching:p}=Qn(),g=j.useMemo(()=>{const b=v.compact(v.map(v.get(u,"languages"),T=>{const A=v.find(h,{lang:T});return{key:T,value:v.get(Ie,T,T),isLangPageAdded:!!A}})).filter(Boolean);return[{key:e,value:v.get(Ie,e),isLangPageAdded:!0},...b]},[h,u]);return v.isEmpty(t)||p?null:r.jsxs(r.Fragment,{children:[r.jsxs(f.DropdownMenu,{children:[r.jsx(f.DropdownMenuTrigger,{asChild:!0,className:"focus:outline-none",children:r.jsxs(f.Button,{variant:"ghost",size:"sm",className:"gap-2",children:[r.jsx($.Languages,{className:"w-4 h-4"}),v.get(Ie,a,a),r.jsx($.ChevronDown,{className:"w-4 h-4"})]})}),r.jsxs(f.DropdownMenuContent,{className:"border-border space-y-1",children:[v.map(g.filter(b=>b.isLangPageAdded),b=>r.jsxs(f.DropdownMenuItem,{className:Ue.mergeClasses("flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",b.key===a&&"!bg-gray-200 text-gray-700"),onClick:()=>s(b.key),children:[r.jsx("div",{className:"text-slate-600",children:b.value}),b.key===e&&r.jsxs("small",{className:"text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",children:[r.jsx($.Star,{fill:"orange",className:"w-2 h-2"}),"Primary"]})]},b.value)),!v.isEmpty(g.filter(b=>!b.isLangPageAdded))&&r.jsxs(r.Fragment,{children:[r.jsx(f.Separator,{}),r.jsxs(f.Button,{size:"sm",variant:"ghost",onClick:()=>{o({name:l==null?void 0:l.name,collection:l==null?void 0:l.collection,lang:"",slug:"",edit:!1})},className:"hover:bg-slate-300 duration-200 font-normal text-xs hover:text-slate-800",children:[r.jsx($.Plus,{className:"w-3 h-3 mr-1"})," Add Langauge"]})]})]})]}),i&&r.jsx(dr,{languages:t,langProps:i,onClose:()=>o(null)})]})};function no(){return r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[r.jsx(Zi,{}),r.jsx(eo,{}),r.jsx(to,{})]})}Ar.loadWebBlocks();const so=e=>{const t=j.useRef([]),[n]=Qe(),s=n.get("page"),{data:a}=Be(),{data:i}=Ci(),{data:o,isFetching:l}=Ti(),{blocks:u}=Ni(o),{data:h}=Kn(),{data:p}=gn(),{mutateAsync:g}=_i(),b=Si(),{getUILibraryBlock:T,getUILibraryBlocks:A,onSave:_}=wi(),{getGlobalBlocks:w,getGlobalBlockBlocks:y}=Ai(),{aiContext:S,setAiContext:W}=Vn(),{mutateAsync:ne}=ki();t.current=u;const X=j.useMemo(()=>{const k={};return e.mediaManagerComponent&&(k.mediaManagerComponent=e.mediaManagerComponent),k},[e.mediaManagerComponent]),we=j.useMemo(()=>Array.isArray(e==null?void 0:e.uiLibraries)?[...i,...e==null?void 0:e.uiLibraries]:i,[i,e==null?void 0:e.uiLibraries]),E=j.useCallback(async(k,G)=>await ne({collection:k,query:G}),[ne]),Q=j.useMemo(()=>v.cloneDeep(v.get(h,"theme",{}))||{},[h]);return r.jsx(r.Fragment,{children:r.jsx(Ue.ChaiBuilderEditor,{addBlocksDialogTabs:e.addBlocksDialogTabs||[],loading:l,fallbackLang:h.fallbackLang||"en",languages:(h==null?void 0:h.languages)||[],brandingOptions:(h==null?void 0:h.theme)||{},translations:e.translations||{},locale:e.locale||"en",htmlDir:e.htmlDir||"ltr",autoSaveSupport:e.autoSaveSupport||!0,autoSaveInterval:e.autoSaveInterval||25,onError:e.onError||console.error,getGlobalBlockBlocks:y,getGlobalBlocks:w,blocks:u,theme:Q,getUILibraryBlock:T,getUILibraryBlocks:A,uiLibraries:we,collections:p,searchCollectionItems:E,saveAiContextCallback:async k=>{if(!s)return!0;const G=t.current,H={_type:"@chai/ai-context",_value:v.isString(k)?k:""},be=[...G,H];return await _({page:s,blocks:be}),W(k),!0},aiContext:S,askAiCallBack:b,onSave:async({blocks:k,theme:G})=>{if(!s)return!0;t.current=k;const H={_type:"@chai/ai-context",_value:v.isString(S)?S:""},be=[...k,H];return await _({page:s,blocks:be}),t.current=k,v.isEqual(G,Q)||await g({settings:{theme:G}}),!0},topBarComponents:{left:[no],right:[Qi]},sideBarComponents:{top:[...(a==null?void 0:a.collection)!=="global"?[{label:"SEO Setting",component:cr,icon:r.jsx(r.Fragment,{children:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21",fill:"currentColor",width:"21",height:"21",children:[r.jsx("path",{d:"M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249"}),r.jsx("path",{d:"M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z"})]})})}]:[],...v.isEmpty(h==null?void 0:h.languages)?[]:[{label:`Language ${(a==null?void 0:a.collection)==="global"?"":"page"}`,component:Ui,icon:r.jsx($.Languages,{className:"w-5 h-5 stroke-[2]"})}]]},...X})})},ro=new Y.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),ao=e=>{const[,t]=ir();return j.useEffect(()=>{t(v.pick(e,["apiUrl","getPreviewUrl","logo","settingComponent"]))},[e,t]),r.jsxs(Y.QueryClientProvider,{client:ro,children:[r.jsx(so,{...e}),r.jsx(bi,{})]})};exports.$TRACK=Fn;exports.ChaiBuilderForge=ao;exports.Dynamic=ja;exports.For=ea;exports.Index=ta;exports.Match=ra;exports.Portal=Ta;exports.Show=na;exports.Switch=sa;exports.addEventListener=Ms;exports.batch=Gr;exports.className=Gs;exports.clearDelegatedEvents=pa;exports.convertRemToPixels=gi;exports.createComponent=$n;exports.createComputed=Pn;exports.createContext=qr;exports.createEffect=qn;exports.createMemo=Se;exports.createRenderEffect=qe;exports.createRoot=Fe;exports.createSignal=ue;exports.createUniqueId=Zr;exports.delegateEvents=Os;exports.deleteNestedDataByPath=Nt;exports.displayValue=li;exports.getMutationStatusColor=ii;exports.getPreferredColorScheme=mi;exports.getQueryStatusColor=ai;exports.getQueryStatusColorByLabel=oi;exports.getQueryStatusLabel=si;exports.getSidedProp=ri;exports.insert=ln;exports.mergeProps=Hn;exports.mutationSortFns=hi;exports.on=Mr;exports.onCleanup=mt;exports.onMount=Ts;exports.serialize=nr;exports.setAttribute=on;exports.sortFns=di;exports.splitProps=ks;exports.spread=Us;exports.stringify=ni;exports.template=ma;exports.untrack=ye;exports.updateNestedDataByPath=jt;exports.use=Rs;exports.useContext=Wr;exports.useTransition=Fr;