@chaibuilder/sdk 1.2.64 → 1.2.66

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.
Files changed (139) hide show
  1. package/dist/AddBlocks-Mm5byzEC.js +124 -0
  2. package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
  3. package/dist/CanvasArea-8NXGRRYC.js +137 -0
  4. package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
  5. package/dist/{CodeEditor-37od44Ou.js → CodeEditor-3l-mFvg4.js} +61 -46
  6. package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
  7. package/dist/STRINGS--j49GZJP.js +7 -0
  8. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  9. package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
  10. package/dist/SettingsPanel-Q3xQQm81.js +82 -0
  11. package/dist/{SidePanels-UQj0XTnb.js → SidePanels-JyziIpDA.js} +125 -116
  12. package/dist/SidePanels-d04PONzN.cjs +1 -0
  13. package/dist/{Topbar-1O05wogM.js → Topbar-Xgd6YI66.js} +68 -57
  14. package/dist/Topbar-eIenyfZu.cjs +1 -0
  15. package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
  16. package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-a7TrMuAU.js} +98 -86
  17. package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-6Bj8nQ8n.js} +65 -49
  18. package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
  19. package/dist/{UploadImages-lco2Tea3.js → UploadImages-4PxhlZMB.js} +58 -44
  20. package/dist/UploadImages-uL2R7fju.cjs +1 -0
  21. package/dist/badge-7BVT3zxN.cjs +1 -0
  22. package/dist/badge-pJqQSA13.js +23 -0
  23. package/dist/context-menu-_8TFbFEJ.cjs +1 -0
  24. package/dist/context-menu-sks9vdzC.js +906 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.d.ts +45 -21
  27. package/dist/core.js +93 -79
  28. package/dist/iconBase-vJD0OXxU.cjs +1 -0
  29. package/dist/iconBase-zweRWSz0.js +323 -0
  30. package/dist/index-Dgo2PNEV.js +33210 -0
  31. package/dist/index-jhNzBWrV.cjs +223 -0
  32. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  33. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  34. package/dist/plugin-P0tpo_XZ.cjs +1 -0
  35. package/dist/plugin-_F-KZp1i.cjs +1 -0
  36. package/dist/plugin-f5uJtdXY.js +43 -0
  37. package/dist/plugin-sJ3Hzvpv.js +57 -0
  38. package/dist/render.cjs +3 -1
  39. package/dist/render.d.ts +19 -52
  40. package/dist/render.js +136 -183
  41. package/dist/select-JW3OMYm-.js +75 -0
  42. package/dist/select-fXj5tdMX.cjs +1 -0
  43. package/dist/separator-hT24N-xp.cjs +1 -0
  44. package/dist/separator-sgwOa1FE.js +18 -0
  45. package/dist/style.css +2 -2
  46. package/dist/tailwind.cjs +1 -1
  47. package/dist/tailwind.d.ts +41 -1
  48. package/dist/tailwind.js +16 -8
  49. package/dist/ui.cjs +1 -1
  50. package/dist/ui.d.ts +0 -10
  51. package/dist/ui.js +345 -163
  52. package/dist/web-blocks.cjs +1 -1
  53. package/dist/web-blocks.d.ts +1 -1
  54. package/dist/web-blocks.js +489 -724
  55. package/package.json +15 -45
  56. package/dist/AddBlocks-6dJmFSgk.js +0 -142
  57. package/dist/AddBlocks-doCNVVbk.cjs +0 -1
  58. package/dist/CanvasArea-kB6ky_uL.js +0 -164
  59. package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
  60. package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
  61. package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
  62. package/dist/CurrentPage-bHq9Uusr.js +0 -108
  63. package/dist/Functions-7jnEwJyw.js +0 -15
  64. package/dist/Functions-N3yhPYKY.cjs +0 -1
  65. package/dist/MODIFIERS-fd5XOmum.js +0 -60
  66. package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
  67. package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
  68. package/dist/PagesPanel-wIPAyjJK.js +0 -66
  69. package/dist/ProjectPanel-L-SlDizV.js +0 -87
  70. package/dist/ProjectPanel-YruLal65.cjs +0 -1
  71. package/dist/Settings-WXkCyhAv.js +0 -2380
  72. package/dist/Settings-_5VHcgFC.cjs +0 -1
  73. package/dist/SidePanels-UeIZB3e1.cjs +0 -1
  74. package/dist/StaticCanvas-7C52tXAv.js +0 -749
  75. package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
  76. package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
  77. package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
  78. package/dist/Topbar-gb17oHdJ.cjs +0 -1
  79. package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
  80. package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
  81. package/dist/UploadImages-3h0cRsvr.cjs +0 -1
  82. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  83. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  84. package/dist/add-page-modal-qr7rvJzN.js +0 -106
  85. package/dist/add-page-modal-rOKavDFX.cjs +0 -1
  86. package/dist/atoms-KQpaDRnF.cjs +0 -1
  87. package/dist/atoms-Oomqut88.js +0 -6
  88. package/dist/confirm-alert-P6TAevaP.js +0 -60
  89. package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
  90. package/dist/controls-rRZhz0vu.cjs +0 -1
  91. package/dist/controls-yjgoZzB6.js +0 -199
  92. package/dist/delete-page-modal-55oioI9i.js +0 -85
  93. package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
  94. package/dist/email-blocks.cjs +0 -1
  95. package/dist/email-blocks.d.ts +0 -3
  96. package/dist/email-blocks.js +0 -294
  97. package/dist/email.cjs +0 -1
  98. package/dist/email.d.ts +0 -171
  99. package/dist/email.js +0 -75
  100. package/dist/empty-slot-Lsxjts7Q.js +0 -6
  101. package/dist/empty-slot-Sy930lX6.cjs +0 -1
  102. package/dist/form-4jTocVbZ.cjs +0 -1
  103. package/dist/form-5ke_lZv8.js +0 -125
  104. package/dist/functions--tdNWQDW.js +0 -30
  105. package/dist/functions-EVUeSwX1.cjs +0 -1
  106. package/dist/html-to-json-_01DXd-a.js +0 -192
  107. package/dist/html-to-json-ndxaXRT8.cjs +0 -1
  108. package/dist/index--mLLy7QQ.cjs +0 -1
  109. package/dist/index-6w-6HYBd.cjs +0 -1
  110. package/dist/index-VBXQixVm.js +0 -117
  111. package/dist/index-aeDphKpP.cjs +0 -1
  112. package/dist/index-audsIPBC.cjs +0 -231
  113. package/dist/index-b33n_-zO.js +0 -3141
  114. package/dist/index-e0c8PmRQ.js +0 -205
  115. package/dist/index-fnkMn4Pk.js +0 -2201
  116. package/dist/index-gi1LIOCw.cjs +0 -1
  117. package/dist/index-wRAIA8zZ.js +0 -80248
  118. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  119. package/dist/lib.cjs +0 -3
  120. package/dist/lib.d.ts +0 -80
  121. package/dist/lib.js +0 -1350
  122. package/dist/page-viewer-t44DP65U.js +0 -112
  123. package/dist/page-viewer-wU7T0f48.cjs +0 -1
  124. package/dist/plugin-2hf9pCRy.cjs +0 -1
  125. package/dist/plugin-wDnsBVPp.js +0 -54
  126. package/dist/project-general-setting-87cX9vvO.cjs +0 -1
  127. package/dist/project-general-setting-NEkNjf7V.js +0 -81
  128. package/dist/project-seo-setting-YmspOYsF.js +0 -83
  129. package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
  130. package/dist/server.cjs +0 -1
  131. package/dist/server.d.ts +0 -299
  132. package/dist/server.js +0 -216
  133. package/dist/single-page-detail-27UjWK8L.cjs +0 -1
  134. package/dist/single-page-detail-jHzoDP7B.js +0 -220
  135. package/dist/studio.cjs +0 -1
  136. package/dist/studio.d.ts +0 -176
  137. package/dist/studio.js +0 -55
  138. package/dist/utils-D_vtk3zK.cjs +0 -1
  139. package/dist/utils-VpVqnC9m.js +0 -1075
@@ -1 +0,0 @@
1
- "use strict";var H2=(h,t,c)=>{if(!t.has(h))throw TypeError("Cannot "+c)};var n=(h,t,c)=>(H2(h,t,"read from private field"),c?c.call(h):t.get(h)),e=(h,t,c)=>{if(t.has(h))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(h):t.set(h,c)},v=(h,t,c,a)=>(H2(h,t,"write to private field"),a?a.call(h,c):t.set(h,c),c);var i2=(h,t,c,a)=>({set _(l){v(h,t,l,c)},get _(){return n(h,t,a)}}),M=(h,t,c)=>(H2(h,t,"access private method"),c);const d=require("./jsx-runtime-Z_BpKhVy.cjs"),T=require("react"),s0=require("./index-audsIPBC.cjs"),r2=require("@radix-ui/react-icons"),q=require("./index-aeDphKpP.cjs"),h1=require("sonner"),p0=require("react-i18next"),c1=require("lodash-es"),V0=require("./html-to-json-ndxaXRT8.cjs"),S2=require("lucide-react"),t0=require("./index--mLLy7QQ.cjs");function f0(h){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const c in h)if(c!=="default"){const a=Object.getOwnPropertyDescriptor(h,c);Object.defineProperty(t,c,a.get?a:{enumerable:!0,get:()=>h[c]})}}return t.default=h,Object.freeze(t)}const A=f0(T);var W1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(h){return this.listeners.add(h),this.onSubscribe(),()=>{this.listeners.delete(h),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N1=typeof window>"u"||"Deno"in window;function _(){}function m0(h,t){return typeof h=="function"?h(t):h}function s2(h){return typeof h=="number"&&h>=0&&h!==1/0}function h0(h,t){return Math.max(h+(t||0)-Date.now(),0)}function R2(h,t){const{type:c="all",exact:a,fetchStatus:l,predicate:i,queryKey:r,stale:z}=h;if(r){if(a){if(t.queryHash!==A2(r,t.options))return!1}else if(!Q1(t.queryKey,r))return!1}if(c!=="all"){const s=t.isActive();if(c==="active"&&!s||c==="inactive"&&s)return!1}return!(typeof z=="boolean"&&t.isStale()!==z||typeof l<"u"&&l!==t.state.fetchStatus||i&&!i(t))}function F2(h,t){const{exact:c,status:a,predicate:l,mutationKey:i}=h;if(i){if(!t.options.mutationKey)return!1;if(c){if(U1(t.options.mutationKey)!==U1(i))return!1}else if(!Q1(t.options.mutationKey,i))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function A2(h,t){return((t==null?void 0:t.queryKeyHashFn)||U1)(h)}function U1(h){return JSON.stringify(h,(t,c)=>p2(c)?Object.keys(c).sort().reduce((a,l)=>(a[l]=c[l],a),{}):c)}function Q1(h,t){return h===t?!0:typeof h!=typeof t?!1:h&&t&&typeof h=="object"&&typeof t=="object"?!Object.keys(t).some(c=>!Q1(h[c],t[c])):!1}function c0(h,t){if(h===t)return h;const c=k2(h)&&k2(t);if(c||p2(h)&&p2(t)){const a=c?h.length:Object.keys(h).length,l=c?t:Object.keys(t),i=l.length,r=c?[]:{};let z=0;for(let s=0;s<i;s++){const p=c?s:l[s];r[p]=c0(h[p],t[p]),r[p]===h[p]&&z++}return a===i&&z===a?h:r}return t}function e2(h,t){if(h&&!t||t&&!h)return!1;for(const c in h)if(h[c]!==t[c])return!1;return!0}function k2(h){return Array.isArray(h)&&h.length===Object.keys(h).length}function p2(h){if(!D2(h))return!1;const t=h.constructor;if(typeof t>"u")return!0;const c=t.prototype;return!(!D2(c)||!c.hasOwnProperty("isPrototypeOf"))}function D2(h){return Object.prototype.toString.call(h)==="[object Object]"}function a0(h){return new Promise(t=>{setTimeout(t,h)})}function E2(h){a0(0).then(h)}function V2(h,t,c){return typeof c.structuralSharing=="function"?c.structuralSharing(h,t):c.structuralSharing!==!1?c0(h,t):t}function x0(h,t,c=0){const a=[...h,t];return c&&a.length>c?a.slice(1):a}function L0(h,t,c=0){const a=[t,...h];return c&&a.length>c?a.slice(0,-1):a}var u1,v1,B1,U2,w0=(U2=class extends W1{constructor(){super();e(this,u1,void 0);e(this,v1,void 0);e(this,B1,void 0);v(this,B1,t=>{if(!N1&&window.addEventListener){const c=()=>t();return window.addEventListener("visibilitychange",c,!1),()=>{window.removeEventListener("visibilitychange",c)}}})}onSubscribe(){n(this,v1)||this.setEventListener(n(this,B1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,v1))==null||t.call(this),v(this,v1,void 0))}setEventListener(t){var c;v(this,B1,t),(c=n(this,v1))==null||c.call(this),v(this,v1,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){n(this,u1)!==t&&(v(this,u1,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof n(this,u1)=="boolean"?n(this,u1):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},u1=new WeakMap,v1=new WeakMap,B1=new WeakMap,U2),o2=new w0,I1,d1,G1,Q2,B0=(Q2=class extends W1{constructor(){super();e(this,I1,!0);e(this,d1,void 0);e(this,G1,void 0);v(this,G1,t=>{if(!N1&&window.addEventListener){const c=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",c,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",a)}}})}onSubscribe(){n(this,d1)||this.setEventListener(n(this,G1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,d1))==null||t.call(this),v(this,d1,void 0))}setEventListener(t){var c;v(this,G1,t),(c=n(this,d1))==null||c.call(this),v(this,d1,t(this.setOnline.bind(this)))}setOnline(t){n(this,I1)!==t&&(v(this,I1,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return n(this,I1)}},I1=new WeakMap,d1=new WeakMap,G1=new WeakMap,Q2),z2=new B0;function I0(h){return Math.min(1e3*2**h,3e4)}function M2(h){return(h??"online")==="online"?z2.isOnline():!0}var n0=class{constructor(h){this.revert=h==null?void 0:h.revert,this.silent=h==null?void 0:h.silent}};function u2(h){return h instanceof n0}function l0(h){let t=!1,c=0,a=!1,l,i,r;const z=new Promise((g,u)=>{i=g,r=u}),s=g=>{var u;a||(H(new n0(g)),(u=h.abort)==null||u.call(h))},p=()=>{t=!0},o=()=>{t=!1},L=()=>!o2.isFocused()||h.networkMode!=="always"&&!z2.isOnline(),b=g=>{var u;a||(a=!0,(u=h.onSuccess)==null||u.call(h,g),l==null||l(),i(g))},H=g=>{var u;a||(a=!0,(u=h.onError)==null||u.call(h,g),l==null||l(),r(g))},V=()=>new Promise(g=>{var u;l=G=>{const f=a||!L();return f&&g(G),f},(u=h.onPause)==null||u.call(h)}).then(()=>{var g;l=void 0,a||(g=h.onContinue)==null||g.call(h)}),B=()=>{if(a)return;let g;try{g=h.fn()}catch(u){g=Promise.reject(u)}Promise.resolve(g).then(b).catch(u=>{var F;if(a)return;const G=h.retry??(N1?0:3),f=h.retryDelay??I0,m=typeof f=="function"?f(c,u):f,y=G===!0||typeof G=="number"&&c<G||typeof G=="function"&&G(c,u);if(t||!y){H(u);return}c++,(F=h.onFail)==null||F.call(h,c,u),a0(m).then(()=>{if(L())return V()}).then(()=>{t?H(u):B()})})};return M2(h.networkMode)?B():V().then(B),{promise:z,cancel:s,continue:()=>(l==null?void 0:l())?z:Promise.resolve(),cancelRetry:p,continueRetry:o}}function G0(){let h=[],t=0,c=o=>{o()},a=o=>{o()};const l=o=>{let L;t++;try{L=o()}finally{t--,t||z()}return L},i=o=>{t?h.push(o):E2(()=>{c(o)})},r=o=>(...L)=>{i(()=>{o(...L)})},z=()=>{const o=h;h=[],o.length&&E2(()=>{a(()=>{o.forEach(L=>{c(L)})})})};return{batch:l,batchCalls:r,schedule:i,setNotifyFunction:o=>{c=o},setBatchNotifyFunction:o=>{a=o}}}var O=G0(),s1,K2,i0=(K2=class{constructor(){e(this,s1,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),s2(this.gcTime)&&v(this,s1,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(h){this.gcTime=Math.max(this.gcTime||0,h??(N1?1/0:5*60*1e3))}clearGcTimeout(){n(this,s1)&&(clearTimeout(n(this,s1)),v(this,s1,void 0))}},s1=new WeakMap,K2),C1,O1,j,r1,U,S,K1,p1,S1,v2,$,n1,q2,C0=(q2=class extends i0{constructor(t){super();e(this,S1);e(this,$);e(this,C1,void 0);e(this,O1,void 0);e(this,j,void 0);e(this,r1,void 0);e(this,U,void 0);e(this,S,void 0);e(this,K1,void 0);e(this,p1,void 0);v(this,p1,!1),v(this,K1,t.defaultOptions),M(this,S1,v2).call(this,t.options),v(this,S,[]),v(this,j,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,v(this,C1,t.state||O0(this.options)),this.state=n(this,C1),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!n(this,S).length&&this.state.fetchStatus==="idle"&&n(this,j).remove(this)}setData(t,c){const a=V2(this.state.data,t,this.options);return M(this,$,n1).call(this,{data:a,type:"success",dataUpdatedAt:c==null?void 0:c.updatedAt,manual:c==null?void 0:c.manual}),a}setState(t,c){M(this,$,n1).call(this,{type:"setState",state:t,setStateOptions:c})}cancel(t){var a;const c=n(this,r1);return(a=n(this,U))==null||a.cancel(t),c?c.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(n(this,C1))}isActive(){return n(this,S).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||n(this,S).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!h0(this.state.dataUpdatedAt,t)}onFocus(){var c;const t=n(this,S).find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,U))==null||c.continue()}onOnline(){var c;const t=n(this,S).find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,U))==null||c.continue()}addObserver(t){n(this,S).includes(t)||(n(this,S).push(t),this.clearGcTimeout(),n(this,j).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){n(this,S).includes(t)&&(v(this,S,n(this,S).filter(c=>c!==t)),n(this,S).length||(n(this,U)&&(n(this,p1)?n(this,U).cancel({revert:!0}):n(this,U).cancelRetry()),this.scheduleGc()),n(this,j).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return n(this,S).length}invalidate(){this.state.isInvalidated||M(this,$,n1).call(this,{type:"invalidate"})}fetch(t,c){var p,o,L,b;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(c!=null&&c.cancelRefetch))this.cancel({silent:!0});else if(n(this,r1))return(p=n(this,U))==null||p.continueRetry(),n(this,r1)}if(t&&M(this,S1,v2).call(this,t),!this.options.queryFn){const H=n(this,S).find(V=>V.options.queryFn);H&&M(this,S1,v2).call(this,H.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const a=new AbortController,l={queryKey:this.queryKey,meta:this.meta},i=H=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>(v(this,p1,!0),a.signal)})};i(l);const r=()=>this.options.queryFn?(v(this,p1,!1),this.options.persister?this.options.persister(this.options.queryFn,l,this):this.options.queryFn(l)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),z={fetchOptions:c,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(z),(o=this.options.behavior)==null||o.onFetch(z,this),v(this,O1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((L=z.fetchOptions)==null?void 0:L.meta))&&M(this,$,n1).call(this,{type:"fetch",meta:(b=z.fetchOptions)==null?void 0:b.meta});const s=H=>{var V,B,g,u;u2(H)&&H.silent||M(this,$,n1).call(this,{type:"error",error:H}),u2(H)||((B=(V=n(this,j).config).onError)==null||B.call(V,H,this),(u=(g=n(this,j).config).onSettled)==null||u.call(g,this.state.data,H,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return v(this,U,l0({fn:z.fetchFn,abort:a.abort.bind(a),onSuccess:H=>{var V,B,g,u;if(typeof H>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),s(new Error(`${this.queryHash} data is undefined`));return}this.setData(H),(B=(V=n(this,j).config).onSuccess)==null||B.call(V,H,this),(u=(g=n(this,j).config).onSettled)==null||u.call(g,H,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(H,V)=>{M(this,$,n1).call(this,{type:"failed",failureCount:H,error:V})},onPause:()=>{M(this,$,n1).call(this,{type:"pause"})},onContinue:()=>{M(this,$,n1).call(this,{type:"continue"})},retry:z.options.retry,retryDelay:z.options.retryDelay,networkMode:z.options.networkMode})),v(this,r1,n(this,U).promise),n(this,r1)}},C1=new WeakMap,O1=new WeakMap,j=new WeakMap,r1=new WeakMap,U=new WeakMap,S=new WeakMap,K1=new WeakMap,p1=new WeakMap,S1=new WeakSet,v2=function(t){this.options={...n(this,K1),...t},this.updateGcTime(this.options.gcTime)},$=new WeakSet,n1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:M2(this.options.networkMode)?"fetching":"paused",...!a.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...a,data:t.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return u2(l)&&l.revert&&n(this,O1)?{...n(this,O1),fetchStatus:"idle"}:{...a,error:l,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=c(this.state),O.batch(()=>{n(this,S).forEach(a=>{a.onQueryUpdate()}),n(this,j).notify({query:this,type:"updated",action:t})})},q2);function O0(h){const t=typeof h.initialData=="function"?h.initialData():h.initialData,c=typeof t<"u",a=c?typeof h.initialDataUpdatedAt=="function"?h.initialDataUpdatedAt():h.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:c?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:c?"success":"pending",fetchStatus:"idle"}}var Z,_2,S0=(_2=class extends W1{constructor(t={}){super();e(this,Z,void 0);this.config=t,v(this,Z,new Map)}build(t,c,a){const l=c.queryKey,i=c.queryHash??A2(l,c);let r=this.get(i);return r||(r=new C0({cache:this,queryKey:l,queryHash:i,options:t.defaultQueryOptions(c),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(r)),r}add(t){n(this,Z).has(t.queryHash)||(n(this,Z).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const c=n(this,Z).get(t.queryHash);c&&(t.destroy(),c===t&&n(this,Z).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){O.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return n(this,Z).get(t)}getAll(){return[...n(this,Z).values()]}find(t){const c={exact:!0,...t};return this.getAll().find(a=>R2(c,a))}findAll(t={}){const c=this.getAll();return Object.keys(t).length>0?c.filter(a=>R2(t,a)):c}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}onFocus(){O.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Z=new WeakMap,_2),Y,q1,E,A1,X,i1,$2,A0=($2=class extends i0{constructor(t){super();e(this,X);e(this,Y,void 0);e(this,q1,void 0);e(this,E,void 0);e(this,A1,void 0);this.mutationId=t.mutationId,v(this,q1,t.defaultOptions),v(this,E,t.mutationCache),v(this,Y,[]),this.state=t.state||v0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...n(this,q1),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){n(this,Y).includes(t)||(n(this,Y).push(t),this.clearGcTimeout(),n(this,E).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){v(this,Y,n(this,Y).filter(c=>c!==t)),this.scheduleGc(),n(this,E).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){n(this,Y).length||(this.state.status==="pending"?this.scheduleGc():n(this,E).remove(this))}continue(){var t;return((t=n(this,A1))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,i,r,z,s,p,o,L,b,H,V,B,g,u,G,f,m,y,F,I;const c=()=>(v(this,A1,l0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,a1)=>{M(this,X,i1).call(this,{type:"failed",failureCount:w,error:a1})},onPause:()=>{M(this,X,i1).call(this,{type:"pause"})},onContinue:()=>{M(this,X,i1).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),n(this,A1).promise),a=this.state.status==="pending";try{if(!a){M(this,X,i1).call(this,{type:"pending",variables:t}),await((i=(l=n(this,E).config).onMutate)==null?void 0:i.call(l,t,this));const a1=await((z=(r=this.options).onMutate)==null?void 0:z.call(r,t));a1!==this.state.context&&M(this,X,i1).call(this,{type:"pending",context:a1,variables:t})}const w=await c();return await((p=(s=n(this,E).config).onSuccess)==null?void 0:p.call(s,w,t,this.state.context,this)),await((L=(o=this.options).onSuccess)==null?void 0:L.call(o,w,t,this.state.context)),await((H=(b=n(this,E).config).onSettled)==null?void 0:H.call(b,w,null,this.state.variables,this.state.context,this)),await((B=(V=this.options).onSettled)==null?void 0:B.call(V,w,null,t,this.state.context)),M(this,X,i1).call(this,{type:"success",data:w}),w}catch(w){try{throw await((u=(g=n(this,E).config).onError)==null?void 0:u.call(g,w,t,this.state.context,this)),await((f=(G=this.options).onError)==null?void 0:f.call(G,w,t,this.state.context)),await((y=(m=n(this,E).config).onSettled)==null?void 0:y.call(m,void 0,w,this.state.variables,this.state.context,this)),await((I=(F=this.options).onSettled)==null?void 0:I.call(F,void 0,w,t,this.state.context)),w}finally{M(this,X,i1).call(this,{type:"error",error:w})}}}},Y=new WeakMap,q1=new WeakMap,E=new WeakMap,A1=new WeakMap,X=new WeakSet,i1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!M2(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=c(this.state),O.batch(()=>{n(this,Y).forEach(a=>{a.onMutationUpdate(t)}),n(this,E).notify({mutation:this,type:"updated",action:t})})},$2);function v0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Q,_1,V1,J2,y0=(J2=class extends W1{constructor(t={}){super();e(this,Q,void 0);e(this,_1,void 0);e(this,V1,void 0);this.config=t,v(this,Q,[]),v(this,_1,0)}build(t,c,a){const l=new A0({mutationCache:this,mutationId:++i2(this,_1)._,options:t.defaultMutationOptions(c),state:a});return this.add(l),l}add(t){n(this,Q).push(t),this.notify({type:"added",mutation:t})}remove(t){v(this,Q,n(this,Q).filter(c=>c!==t)),this.notify({type:"removed",mutation:t})}clear(){O.batch(()=>{n(this,Q).forEach(t=>{this.remove(t)})})}getAll(){return n(this,Q)}find(t){const c={exact:!0,...t};return n(this,Q).find(a=>F2(c,a))}findAll(t={}){return n(this,Q).filter(c=>F2(t,c))}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}resumePausedMutations(){return v(this,V1,(n(this,V1)??Promise.resolve()).then(()=>{const t=n(this,Q).filter(c=>c.state.isPaused);return O.batch(()=>t.reduce((c,a)=>c.then(()=>a.continue().catch(_)),Promise.resolve()))}).then(()=>{v(this,V1,void 0)})),n(this,V1)}},Q=new WeakMap,_1=new WeakMap,V1=new WeakMap,J2);function b0(h){return{onFetch:(t,c)=>{const a=async()=>{var V,B,g,u,G;const l=t.options,i=(g=(B=(V=t.fetchOptions)==null?void 0:V.meta)==null?void 0:B.fetchMore)==null?void 0:g.direction,r=((u=t.state.data)==null?void 0:u.pages)||[],z=((G=t.state.data)==null?void 0:G.pageParams)||[],s={pages:[],pageParams:[]};let p=!1;const o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},L=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),b=async(f,m,y)=>{if(p)return Promise.reject();if(m==null&&f.pages.length)return Promise.resolve(f);const F={queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};o(F);const I=await L(F),{maxPages:w}=t.options,a1=y?L0:x0;return{pages:a1(f.pages,I,w),pageParams:a1(f.pageParams,m,w)}};let H;if(i&&r.length){const f=i==="backward",m=f?P0:T2,y={pages:r,pageParams:z},F=m(l,y);H=await b(y,F,f)}else{H=await b(s,z[0]??l.initialPageParam);const f=h??r.length;for(let m=1;m<f;m++){const y=T2(l,H);H=await b(H,y)}}return H};t.options.persister?t.fetchFn=()=>{var l,i;return(i=(l=t.options).persister)==null?void 0:i.call(l,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},c)}:t.fetchFn=a}}}function T2(h,{pages:t,pageParams:c}){const a=t.length-1;return h.getNextPageParam(t[a],t,c[a],c)}function P0(h,{pages:t,pageParams:c}){var a;return(a=h.getPreviousPageParam)==null?void 0:a.call(h,t[0],t,c[0],c)}var C,e1,o1,y1,b1,z1,P1,R1,Z2,R0=(Z2=class{constructor(h={}){e(this,C,void 0);e(this,e1,void 0);e(this,o1,void 0);e(this,y1,void 0);e(this,b1,void 0);e(this,z1,void 0);e(this,P1,void 0);e(this,R1,void 0);v(this,C,h.queryCache||new S0),v(this,e1,h.mutationCache||new y0),v(this,o1,h.defaultOptions||{}),v(this,y1,new Map),v(this,b1,new Map),v(this,z1,0)}mount(){i2(this,z1)._++,n(this,z1)===1&&(v(this,P1,o2.subscribe(()=>{o2.isFocused()&&(this.resumePausedMutations(),n(this,C).onFocus())})),v(this,R1,z2.subscribe(()=>{z2.isOnline()&&(this.resumePausedMutations(),n(this,C).onOnline())})))}unmount(){var h,t;i2(this,z1)._--,n(this,z1)===0&&((h=n(this,P1))==null||h.call(this),v(this,P1,void 0),(t=n(this,R1))==null||t.call(this),v(this,R1,void 0))}isFetching(h){return n(this,C).findAll({...h,fetchStatus:"fetching"}).length}isMutating(h){return n(this,e1).findAll({...h,status:"pending"}).length}getQueryData(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state.data}ensureQueryData(h){const t=this.getQueryData(h.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(h)}getQueriesData(h){return this.getQueryCache().findAll(h).map(({queryKey:t,state:c})=>{const a=c.data;return[t,a]})}setQueryData(h,t,c){const a=n(this,C).find({queryKey:h}),l=a==null?void 0:a.state.data,i=m0(t,l);if(typeof i>"u")return;const r=this.defaultQueryOptions({queryKey:h});return n(this,C).build(this,r).setData(i,{...c,manual:!0})}setQueriesData(h,t,c){return O.batch(()=>this.getQueryCache().findAll(h).map(({queryKey:a})=>[a,this.setQueryData(a,t,c)]))}getQueryState(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state}removeQueries(h){const t=n(this,C);O.batch(()=>{t.findAll(h).forEach(c=>{t.remove(c)})})}resetQueries(h,t){const c=n(this,C),a={type:"active",...h};return O.batch(()=>(c.findAll(h).forEach(l=>{l.reset()}),this.refetchQueries(a,t)))}cancelQueries(h={},t={}){const c={revert:!0,...t},a=O.batch(()=>n(this,C).findAll(h).map(l=>l.cancel(c)));return Promise.all(a).then(_).catch(_)}invalidateQueries(h={},t={}){return O.batch(()=>{if(n(this,C).findAll(h).forEach(a=>{a.invalidate()}),h.refetchType==="none")return Promise.resolve();const c={...h,type:h.refetchType??h.type??"active"};return this.refetchQueries(c,t)})}refetchQueries(h={},t){const c={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},a=O.batch(()=>n(this,C).findAll(h).filter(l=>!l.isDisabled()).map(l=>{let i=l.fetch(void 0,c);return c.throwOnError||(i=i.catch(_)),l.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(_)}fetchQuery(h){const t=this.defaultQueryOptions(h);typeof t.retry>"u"&&(t.retry=!1);const c=n(this,C).build(this,t);return c.isStaleByTime(t.staleTime)?c.fetch(t):Promise.resolve(c.state.data)}prefetchQuery(h){return this.fetchQuery(h).then(_).catch(_)}fetchInfiniteQuery(h){return h.behavior=b0(h.pages),this.fetchQuery(h)}prefetchInfiniteQuery(h){return this.fetchInfiniteQuery(h).then(_).catch(_)}resumePausedMutations(){return n(this,e1).resumePausedMutations()}getQueryCache(){return n(this,C)}getMutationCache(){return n(this,e1)}getDefaultOptions(){return n(this,o1)}setDefaultOptions(h){v(this,o1,h)}setQueryDefaults(h,t){n(this,y1).set(U1(h),{queryKey:h,defaultOptions:t})}getQueryDefaults(h){const t=[...n(this,y1).values()];let c={};return t.forEach(a=>{Q1(h,a.queryKey)&&(c={...c,...a.defaultOptions})}),c}setMutationDefaults(h,t){n(this,b1).set(U1(h),{mutationKey:h,defaultOptions:t})}getMutationDefaults(h){const t=[...n(this,b1).values()];let c={};return t.forEach(a=>{Q1(h,a.mutationKey)&&(c={...c,...a.defaultOptions})}),c}defaultQueryOptions(h){if(h!=null&&h._defaulted)return h;const t={...n(this,o1).queries,...(h==null?void 0:h.queryKey)&&this.getQueryDefaults(h.queryKey),...h,_defaulted:!0};return t.queryHash||(t.queryHash=A2(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(h){return h!=null&&h._defaulted?h:{...n(this,o1).mutations,...(h==null?void 0:h.mutationKey)&&this.getMutationDefaults(h.mutationKey),...h,_defaulted:!0}}clear(){n(this,C).clear(),n(this,e1).clear()}},C=new WeakMap,e1=new WeakMap,o1=new WeakMap,y1=new WeakMap,b1=new WeakMap,z1=new WeakMap,P1=new WeakMap,R1=new WeakMap,Z2),D,x,F1,P,f1,k1,t1,$1,D1,E1,m1,x1,g1,L1,w1,j1,J1,f2,Z1,m2,Y1,x2,X1,L2,t2,w2,h2,B2,c2,I2,g2,d0,Y2,F0=(Y2=class extends W1{constructor(t,c){super();e(this,w1);e(this,J1);e(this,Z1);e(this,Y1);e(this,X1);e(this,t2);e(this,h2);e(this,c2);e(this,g2);e(this,D,void 0);e(this,x,void 0);e(this,F1,void 0);e(this,P,void 0);e(this,f1,void 0);e(this,k1,void 0);e(this,t1,void 0);e(this,$1,void 0);e(this,D1,void 0);e(this,E1,void 0);e(this,m1,void 0);e(this,x1,void 0);e(this,g1,void 0);e(this,L1,void 0);v(this,x,void 0),v(this,F1,void 0),v(this,P,void 0),v(this,L1,new Set),v(this,D,t),this.options=c,v(this,t1,null),this.bindMethods(),this.setOptions(c)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(n(this,x).addObserver(this),N2(n(this,x),this.options)?M(this,w1,j1).call(this):this.updateResult(),M(this,X1,L2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G2(n(this,x),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G2(n(this,x),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,M(this,t2,w2).call(this),M(this,h2,B2).call(this),n(this,x).removeObserver(this)}setOptions(t,c){const a=this.options,l=n(this,x);if(this.options=n(this,D).defaultQueryOptions(t),e2(a,this.options)||n(this,D).getQueryCache().notify({type:"observerOptionsUpdated",query:n(this,x),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),M(this,c2,I2).call(this);const i=this.hasListeners();i&&W2(n(this,x),l,this.options,a)&&M(this,w1,j1).call(this),this.updateResult(c),i&&(n(this,x)!==l||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&M(this,J1,f2).call(this);const r=M(this,Z1,m2).call(this);i&&(n(this,x)!==l||this.options.enabled!==a.enabled||r!==n(this,g1))&&M(this,Y1,x2).call(this,r)}getOptimisticResult(t){const c=n(this,D).getQueryCache().build(n(this,D),t),a=this.createResult(c,t);return D0(this,a)&&(v(this,P,a),v(this,k1,this.options),v(this,f1,n(this,x).state)),a}getCurrentResult(){return n(this,P)}trackResult(t){const c={};return Object.keys(t).forEach(a=>{Object.defineProperty(c,a,{configurable:!1,enumerable:!0,get:()=>(n(this,L1).add(a),t[a])})}),c}getCurrentQuery(){return n(this,x)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const c=n(this,D).defaultQueryOptions(t),a=n(this,D).getQueryCache().build(n(this,D),c);return a.isFetchingOptimistic=!0,a.fetch().then(()=>this.createResult(a,c))}fetch(t){return M(this,w1,j1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),n(this,P)))}createResult(t,c){var F;const a=n(this,x),l=this.options,i=n(this,P),r=n(this,f1),z=n(this,k1),p=t!==a?t.state:n(this,F1),{state:o}=t;let{error:L,errorUpdatedAt:b,fetchStatus:H,status:V}=o,B=!1,g;if(c._optimisticResults){const I=this.hasListeners(),w=!I&&N2(t,c),a1=I&&W2(t,a,c,l);(w||a1)&&(H=M2(t.options.networkMode)?"fetching":"paused",o.dataUpdatedAt||(V="pending")),c._optimisticResults==="isRestoring"&&(H="idle")}if(c.select&&typeof o.data<"u")if(i&&o.data===(r==null?void 0:r.data)&&c.select===n(this,$1))g=n(this,D1);else try{v(this,$1,c.select),g=c.select(o.data),g=V2(i==null?void 0:i.data,g,c),v(this,D1,g),v(this,t1,null)}catch(I){v(this,t1,I)}else g=o.data;if(typeof c.placeholderData<"u"&&typeof g>"u"&&V==="pending"){let I;if(i!=null&&i.isPlaceholderData&&c.placeholderData===(z==null?void 0:z.placeholderData))I=i.data;else if(I=typeof c.placeholderData=="function"?c.placeholderData((F=n(this,E1))==null?void 0:F.state.data,n(this,E1)):c.placeholderData,c.select&&typeof I<"u")try{I=c.select(I),v(this,t1,null)}catch(w){v(this,t1,w)}typeof I<"u"&&(V="success",g=V2(i==null?void 0:i.data,I,c),B=!0)}n(this,t1)&&(L=n(this,t1),g=n(this,D1),b=Date.now(),V="error");const u=H==="fetching",G=V==="pending",f=V==="error",m=G&&u;return{status:V,fetchStatus:H,isPending:G,isSuccess:V==="success",isError:f,isInitialLoading:m,isLoading:m,data:g,dataUpdatedAt:o.dataUpdatedAt,error:L,errorUpdatedAt:b,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>p.dataUpdateCount||o.errorUpdateCount>p.errorUpdateCount,isFetching:u,isRefetching:u&&!G,isLoadingError:f&&o.dataUpdatedAt===0,isPaused:H==="paused",isPlaceholderData:B,isRefetchError:f&&o.dataUpdatedAt!==0,isStale:y2(t,c),refetch:this.refetch}}updateResult(t){const c=n(this,P),a=this.createResult(n(this,x),this.options);if(v(this,f1,n(this,x).state),v(this,k1,this.options),n(this,f1).data!==void 0&&v(this,E1,n(this,x)),e2(a,c))return;v(this,P,a);const l={},i=()=>{if(!c)return!0;const{notifyOnChangeProps:r}=this.options,z=typeof r=="function"?r():r;if(z==="all"||!z&&!n(this,L1).size)return!0;const s=new Set(z??n(this,L1));return this.options.throwOnError&&s.add("error"),Object.keys(n(this,P)).some(p=>{const o=p;return n(this,P)[o]!==c[o]&&s.has(o)})};(t==null?void 0:t.listeners)!==!1&&i()&&(l.listeners=!0),M(this,g2,d0).call(this,{...l,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&M(this,X1,L2).call(this)}},D=new WeakMap,x=new WeakMap,F1=new WeakMap,P=new WeakMap,f1=new WeakMap,k1=new WeakMap,t1=new WeakMap,$1=new WeakMap,D1=new WeakMap,E1=new WeakMap,m1=new WeakMap,x1=new WeakMap,g1=new WeakMap,L1=new WeakMap,w1=new WeakSet,j1=function(t){M(this,c2,I2).call(this);let c=n(this,x).fetch(this.options,t);return t!=null&&t.throwOnError||(c=c.catch(_)),c},J1=new WeakSet,f2=function(){if(M(this,t2,w2).call(this),N1||n(this,P).isStale||!s2(this.options.staleTime))return;const c=h0(n(this,P).dataUpdatedAt,this.options.staleTime)+1;v(this,m1,setTimeout(()=>{n(this,P).isStale||this.updateResult()},c))},Z1=new WeakSet,m2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(n(this,x)):this.options.refetchInterval)??!1},Y1=new WeakSet,x2=function(t){M(this,h2,B2).call(this),v(this,g1,t),!(N1||this.options.enabled===!1||!s2(n(this,g1))||n(this,g1)===0)&&v(this,x1,setInterval(()=>{(this.options.refetchIntervalInBackground||o2.isFocused())&&M(this,w1,j1).call(this)},n(this,g1)))},X1=new WeakSet,L2=function(){M(this,J1,f2).call(this),M(this,Y1,x2).call(this,M(this,Z1,m2).call(this))},t2=new WeakSet,w2=function(){n(this,m1)&&(clearTimeout(n(this,m1)),v(this,m1,void 0))},h2=new WeakSet,B2=function(){n(this,x1)&&(clearInterval(n(this,x1)),v(this,x1,void 0))},c2=new WeakSet,I2=function(){const t=n(this,D).getQueryCache().build(n(this,D),this.options);if(t===n(this,x))return;const c=n(this,x);v(this,x,t),v(this,F1,t.state),this.hasListeners()&&(c==null||c.removeObserver(this),t.addObserver(this))},g2=new WeakSet,d0=function(t){O.batch(()=>{t.listeners&&this.listeners.forEach(c=>{c(n(this,P))}),n(this,D).getQueryCache().notify({query:n(this,x),type:"observerResultsUpdated"})})},Y2);function k0(h,t){return t.enabled!==!1&&!h.state.dataUpdatedAt&&!(h.state.status==="error"&&t.retryOnMount===!1)}function N2(h,t){return k0(h,t)||h.state.dataUpdatedAt>0&&G2(h,t,t.refetchOnMount)}function G2(h,t,c){if(t.enabled!==!1){const a=typeof c=="function"?c(h):c;return a==="always"||a!==!1&&y2(h,t)}return!1}function W2(h,t,c,a){return c.enabled!==!1&&(h!==t||a.enabled===!1)&&(!c.suspense||h.state.status!=="error")&&y2(h,c)}function y2(h,t){return h.isStaleByTime(t.staleTime)}function D0(h,t){return!e2(h.getCurrentResult(),t)}var M1,k,K,l1,T1,d2,a2,C2,X2,E0=(X2=class extends W1{constructor(t,c){super();e(this,T1);e(this,a2);e(this,M1,void 0);e(this,k,void 0);e(this,K,void 0);e(this,l1,void 0);v(this,k,void 0),v(this,M1,t),this.setOptions(c),this.bindMethods(),M(this,T1,d2).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var a;const c=this.options;this.options=n(this,M1).defaultMutationOptions(t),e2(c,this.options)||n(this,M1).getMutationCache().notify({type:"observerOptionsUpdated",mutation:n(this,K),observer:this}),(a=n(this,K))==null||a.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=n(this,K))==null||t.removeObserver(this)}onMutationUpdate(t){M(this,T1,d2).call(this),M(this,a2,C2).call(this,t)}getCurrentResult(){return n(this,k)}reset(){v(this,K,void 0),M(this,T1,d2).call(this),M(this,a2,C2).call(this)}mutate(t,c){var a;return v(this,l1,c),(a=n(this,K))==null||a.removeObserver(this),v(this,K,n(this,M1).getMutationCache().build(n(this,M1),this.options)),n(this,K).addObserver(this),n(this,K).execute(t)}},M1=new WeakMap,k=new WeakMap,K=new WeakMap,l1=new WeakMap,T1=new WeakSet,d2=function(){var c;const t=((c=n(this,K))==null?void 0:c.state)??v0();v(this,k,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},a2=new WeakSet,C2=function(t){O.batch(()=>{var c,a,l,i,r,z,s,p;n(this,l1)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((a=(c=n(this,l1)).onSuccess)==null||a.call(c,t.data,n(this,k).variables,n(this,k).context),(i=(l=n(this,l1)).onSettled)==null||i.call(l,t.data,null,n(this,k).variables,n(this,k).context)):(t==null?void 0:t.type)==="error"&&((z=(r=n(this,l1)).onError)==null||z.call(r,t.error,n(this,k).variables,n(this,k).context),(p=(s=n(this,l1)).onSettled)==null||p.call(s,void 0,t.error,n(this,k).variables,n(this,k).context))),this.listeners.forEach(o=>{o(n(this,k))})})},X2);var r0=A.createContext(void 0),N=h=>{const t=A.useContext(r0);if(h)return h;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},T0=({client:h,children:t})=>(A.useEffect(()=>(h.mount(),()=>{h.unmount()}),[h]),A.createElement(r0.Provider,{value:h},t)),e0=A.createContext(!1),N0=()=>A.useContext(e0),C4=e0.Provider;function W0(){let h=!1;return{clearReset:()=>{h=!1},reset:()=>{h=!0},isReset:()=>h}}var j0=A.createContext(W0()),U0=()=>A.useContext(j0);function o0(h,t){return typeof h=="function"?h(...t):!!h}var Q0=(h,t)=>{(h.suspense||h.throwOnError)&&(t.isReset()||(h.retryOnMount=!1))},K0=h=>{A.useEffect(()=>{h.clearReset()},[h])},q0=({result:h,errorResetBoundary:t,throwOnError:c,query:a})=>h.isError&&!t.isReset()&&!h.isFetching&&o0(c,[h.error,a]);var _0=h=>{h.suspense&&typeof h.staleTime!="number"&&(h.staleTime=1e3)};var $0=(h,t)=>(h==null?void 0:h.suspense)&&t.isPending,J0=(h,t,c)=>t.fetchOptimistic(h).catch(()=>{c.clearReset()});function Z0(h,t,c){if(process.env.NODE_ENV!=="production"&&(typeof h!="object"||Array.isArray(h)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const a=N(c),l=N0(),i=U0(),r=a.defaultQueryOptions(h);r._optimisticResults=l?"isRestoring":"optimistic",_0(r),Q0(r,i),K0(i);const[z]=A.useState(()=>new t(a,r)),s=z.getOptimisticResult(r);if(A.useSyncExternalStore(A.useCallback(p=>{const o=l?()=>{}:z.subscribe(O.batchCalls(p));return z.updateResult(),o},[z,l]),()=>z.getCurrentResult(),()=>z.getCurrentResult()),A.useEffect(()=>{z.setOptions(r,{listeners:!1})},[r,z]),$0(r,s))throw J0(r,z,i);if(q0({result:s,errorResetBoundary:i,throwOnError:r.throwOnError,query:z.getCurrentQuery()}))throw s.error;return r.notifyOnChangeProps?s:z.trackResult(s)}function n2(h,t){return Z0(h,F0,t)}function J(h,t){const c=N(t),[a]=A.useState(()=>new E0(c,h));A.useEffect(()=>{a.setOptions(h)},[a,h]);const l=A.useSyncExternalStore(A.useCallback(r=>a.subscribe(O.batchCalls(r)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),i=A.useCallback((r,z)=>{a.mutate(r,z).catch(Y0)},[a]);if(l.error&&o0(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:i,mutateAsync:l.mutate}}function Y0(){}function R(){return N().getQueryData(["apiBaseUrl"])||"/api/chaibuilder"}const H1=()=>{const{data:h,refetch:t}=n2({queryKey:["currentPage"],queryFn:()=>localStorage.getItem("currentPage")||""});return[h,c=>{c&&(localStorage.setItem("currentPage",c||""),t())}]};let j2="";const l2=()=>(j2=localStorage.getItem("__chai_at"),j2);function X0(h){const t={method:"GET",headers:{"x-chai-access-token":l2()}};return fetch(h,t)}function t4(h,t){const c={method:"POST",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function h4(h,t){const c={method:"PUT",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function c4(h,t){const c={method:"DELETE",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}const W={get:X0,post:t4,put:h4,delete:c4},b2=()=>{const[h,t]=H1(),c=R();return n2({queryKey:["project"],queryFn:async()=>{const{data:a}=await W.get(`${c}/project`).then(l=>l.json());if(!h&&a){const l=localStorage.getItem("currentPage");t(l||(a==null?void 0:a.homepage))}return a}})},P2=()=>{const h=R();return n2({queryKey:["pages"],queryFn:async()=>{const{data:t}=await W.get(`${h}/pages`).then(c=>c.json());return t||[]}})},z0=()=>{const[h]=H1(),t=R();return n2({queryKey:["page_data",h],queryFn:async()=>{const{data:c}=await W.get(`${t}/page?uuid=${h}`).then(a=>a.json());return c},enabled:!!h,staleTime:3e3})},O2=()=>d.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-gray-200",children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full w-full justify-center items-center",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex flex-row gap-2",children:[d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]"})]}),d.jsxRuntimeExports.jsx("div",{className:"text-gray-700 font-thin",children:"Loading Builder..."})]})}),g0=(h="Project updated successfully.")=>{const t=N(),c=R();return J({mutationFn:async a=>await W.put(`${c}/project`,a).then(l=>l.json()),onSuccess:()=>{t.invalidateQueries({queryKey:["project"]}),h1.toast.success(h)}})},M0=()=>{const[h]=["SAVED"],[t,c]=H1(),a=q.useBuilderReset(),{t:l}=p0.useTranslation();return i=>h!=="SAVED"?(h1.toast.error(l("You have unsaved changes. Please save before changing the page.")),!1):t===i.uuid?!1:(a(),setTimeout(()=>c(i.uuid),100),!0)},a4=()=>{const h=N(),t=M0(),c=R();return J({mutationFn:async a=>W.post(`${c}/pages`,a).then(l=>l.json()),onSuccess:a=>{h.invalidateQueries({queryKey:["pages"]}),t({uuid:a.uuid,slug:a.slug}),h1.toast.success("Page added successfully.")}})},H0=()=>{const h=R(),[t]=H1(),c=N();return J({mutationFn:async a=>W.put(`${h}/page`,a).then(l=>l.json()),onSuccess:async a=>{var l;if(a.result==="error"&&((l=a.error)==null?void 0:l.code)=="PAGE_LOCKED"){c.invalidateQueries({queryKey:["page_data",t]});return}h1.toast.success("Page saved successfully.")}})},n4=()=>{const h=R(),{data:t}=P2(),[c]=H1(),{data:a}=b2(),l=N();return J({mutationFn:async()=>{const i=t.find(r=>r.uuid===c).slug;return await W.post(`${h}/publish`,{slug:i,uuid:c,isHomepage:(a==null?void 0:a.homepage)===c}).then(r=>r.json())},onSuccess:async i=>{var r;if(i.result==="error"&&((r=i.error)==null?void 0:r.code)=="PAGE_LOCKED"){l.invalidateQueries({queryKey:["page_data",c]});return}h1.toast.success("Page published successfully.",{position:"bottom-right",duration:2e3})}})},l4=()=>{const h=N(),t=R();return J({mutationFn:async c=>W.delete(`${t}/page`,c).then(a=>a.json()),onSuccess:()=>{h1.toast.success("Page deleted successfully."),h.invalidateQueries({queryKey:["pages"]})}})},i4=()=>{const h=N(),t=R();return J({mutationFn:async c=>W.post(`${t}/take-control`,{uuid:c}).then(a=>a.json()),onSuccess:(c,a)=>{h.invalidateQueries({queryKey:["page_data",a]})}})},v4=()=>{const h=R();return J({mutationFn:async()=>{const{data:t}=await W.get(`${h}/library`).then(c=>c.json());return c1.sortBy(c1.filter(t,c=>!c1.has(c,"hidden")),"group")}})},d4=()=>{const h=R();return J({mutationFn:async t=>{if(!t||!t.uuid)return[];try{const{data:c}=await W.get(`${h}/block?uuid=${t.uuid}&format=${t.format}`).then(async a=>t.format==="html"?V0.getBlocksFromHTML(await a.text()):await a.json());return c1.set(c,"0._name",c1.capitalize(t.group)),c||[]}catch{return[]}}})},r4=()=>{const h=R();return J({mutationFn:async t=>{const c=new FormData;c.append("file",t);const{data:a}=await fetch(`${h}/upload`,{method:"POST",headers:{"x-chai-access-token":l2()},body:c}).then(l=>l.json());return a}})};function u0(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(h)}function e4(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"},child:[]}]})(h)}const o4=()=>{const{mutate:h,isPending:t}=i4(),[c]=H1(),{data:a}=z0(),l=c1.get(a,"lockedBy.name",""),i=c1.get(a,"lockedBy.email","");return d.jsxRuntimeExports.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl",children:[d.jsxRuntimeExports.jsxs("h2",{className:"text-2xl font-bold",children:["Page is ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"locked"})]}),d.jsxRuntimeExports.jsxs("div",{className:"text-gray-500 dark:text-gray-400 font-light",children:["This page is currently being edited by ",d.jsxRuntimeExports.jsx("br",{}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md",children:[d.jsxRuntimeExports.jsx(e4,{className:"w-4 h-4 text-gray-500"})," ",l]}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md lowercase",children:[d.jsxRuntimeExports.jsx(u0,{className:"w-4 h-4 text-gray-500"})," ",i]})]}),d.jsxRuntimeExports.jsxs("div",{className:"pt-4",children:["If you take control, ",l," will be ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"restricted"})," from making additional edits."]})]}),d.jsxRuntimeExports.jsx(q.Button,{disabled:t,onClick:()=>h(c),className:`w-36 ${t?"bg-transparent shadow-none hover:bg-transparent":""}`,children:t?d.jsxRuntimeExports.jsx(S2.Loader,{className:"text-sm animate-spin text-gray-500"}):"Take Over"})]})},z4=()=>{const h=R(),t=N();return J({mutationFn:async c=>{const a=await fetch(`${h}/login`,{method:"POST",body:JSON.stringify(c)});if(a.ok)return await a.json();throw a.status===401?new Error("Invalid login credentials"):new Error("Invalid")},onSuccess:c=>{const{data:a}=c;if(!a.accessToken){h1.toast.error("Something went wrong. Please try again.",{position:"top-center"});return}localStorage.setItem("__chai_at",a.accessToken),localStorage.setItem("__chai_ur",JSON.stringify(c1.omit(a,["accessToken"]))),t.invalidateQueries({queryKey:["verify"]}),h1.toast.success("Logged in successfully.")},onError:()=>{h1.toast.error("Invalid login credentials. Please try again.",{position:"top-center"})}})},g4=()=>{const h=R();return n2({queryKey:["verify"],queryFn:async()=>{const t=await W.get(`${h}/verify`);return t.ok?(await t.json()).result==="success"?{valid:!0}:(localStorage.removeItem("__chai_at"),{valid:!1}):(localStorage.removeItem("__chai_at"),{valid:!0})}})},M4=()=>{const h=R(),t=N();return J({mutationFn:async()=>{const{result:c}=await W.post(`${h}/logout`).then(a=>a.json());if(c==="success")return localStorage.clear(),t.invalidateQueries({queryKey:["verify"]}),{logout:!0};throw new Error("Invalid session")}})},H4=({children:h})=>{const t=M4();return d.jsxRuntimeExports.jsxs(q.AlertDialog,{children:[d.jsxRuntimeExports.jsx(q.AlertDialogTrigger,{asChild:!0,children:h}),d.jsxRuntimeExports.jsxs(q.AlertDialogContent,{children:[d.jsxRuntimeExports.jsxs(q.AlertDialogHeader,{children:[d.jsxRuntimeExports.jsxs(q.AlertDialogTitle,{children:["Are you sure, you want to ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"Sign Out"}),"?"]}),d.jsxRuntimeExports.jsx(q.AlertDialogDescription,{children:"Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information"})]}),d.jsxRuntimeExports.jsxs(q.AlertDialogFooter,{children:[d.jsxRuntimeExports.jsx(q.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),d.jsxRuntimeExports.jsxs("button",{disabled:t.isPending,onClick:()=>t.mutate(),className:"rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",children:[t.isPending&&d.jsxRuntimeExports.jsx(S2.Loader2,{className:"animate-spin w-5 h-5"}),"Sign Out"]})]})]})]})},u4=()=>d.jsxRuntimeExports.jsx(H4,{children:d.jsxRuntimeExports.jsx("button",{className:"border-gray-200 rounded-md p-2 mb-2 border",children:d.jsxRuntimeExports.jsx(S2.LogOutIcon,{className:"w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300"})})}),s4=T.lazy(()=>Promise.resolve().then(()=>require("./PagesPanel-SMHrEmCb.cjs"))),p4=T.lazy(()=>Promise.resolve().then(()=>require("./ProjectPanel-YruLal65.cjs"))),V4=T.lazy(()=>Promise.resolve().then(()=>require("./CurrentPage-Ekl5Cwbv.cjs"))),f4=()=>d.jsxRuntimeExports.jsx("h2",{children:"Your Logo"}),m4=()=>{const{mutate:h}=n4();return q.useBuilderProp("editable",!0)?d.jsxRuntimeExports.jsx(q.Button,{onClick:h,className:"bg-blue-600 text-white",children:"Publish"}):null},x4=h=>{var f;const{data:t,isLoading:c}=b2(),{data:a,isLoading:l}=P2(),{data:i}=z0(),{mutate:r}=g0(),{mutate:z}=H0(),[s]=H1(),p=r4(),o=v4(),L=d4(),b=R(),H=T.useCallback(async m=>await p.mutateAsync(m),[p]),V=T.useCallback(async()=>await o.mutateAsync(),[o]),B=T.useCallback(async m=>await L.mutateAsync(m),[L]),g=async(m=20,y=0)=>{const F=`limit=${m}&offset=${y}`,I=await fetch(`${b}/assets?${F}`).then(w=>w.json());return I.result==="success"?I.data:[]},{logo:u=f4}=h;if(c||!t)return d.jsxRuntimeExports.jsx(O2,{});if(l||!a)return d.jsxRuntimeExports.jsx(O2,{});const G={...h,editable:i!=null&&i.lockedBy?i==null?void 0:i.lockedBy.self:!0,nonEditableComponent:o4,blocks:(i==null?void 0:i.blocks)||[],brandingOptions:t.brandingOptions,darkMode:h.darkMode||!1,dataProviders:(i==null?void 0:i.providers)||[],onSavePage:async({blocks:m,providers:y})=>(await z({blocks:m,providers:y,uuid:s}),!0),onSaveBrandingOptions:async m=>(await r({brandingOptions:m}),!0),topBarComponents:{left:[u],center:[V4],right:[m4]},sideBarComponents:{top:[{icon:r2.FileTextIcon,name:"pages",panel:s4},{icon:r2.GearIcon,name:"settings",panel:p4},...((f=h.sideBarComponents)==null?void 0:f.top)||[]],bottom:[u4]},uploadMediaCallback:H,fetchMediaCallback:g,getUILibraryBlocks:V,getExternalPredefinedBlock:B,getPages:()=>a};return d.jsxRuntimeExports.jsx(s0.ChaiBuilderEditor,{...G})},L4=({logo:h})=>{const[t,c]=T.useState(!1),[a,l]=T.useState(""),[i,r]=T.useState(""),{mutate:z,isPending:s}=z4(),p=o=>{o.preventDefault(),z({email:a,password:i})};return d.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]",children:d.jsxRuntimeExports.jsx("div",{className:"overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300",children:d.jsxRuntimeExports.jsxs("div",{className:"p-12",children:[d.jsxRuntimeExports.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[d.jsxRuntimeExports.jsx(T.Suspense,{children:h?T.createElement(h):""}),d.jsxRuntimeExports.jsx("p",{className:"max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin",children:"Enter your login credential to continue"})]}),d.jsxRuntimeExports.jsx("div",{className:"mt-8",children:d.jsxRuntimeExports.jsxs("form",{method:"POST",onSubmit:p,className:"space-y-5",children:[d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx(u0,{})}),d.jsxRuntimeExports.jsx("input",{value:a,onChange:o=>l(o.target.value),type:"email",id:"email",placeholder:"Enter email",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"})})}),d.jsxRuntimeExports.jsx("input",{value:i,onChange:o=>r(o.target.value),type:t?"text":"password",id:"pwd",placeholder:"Enter password",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"}),d.jsxRuntimeExports.jsx("button",{type:"button",className:"absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",onClick:()=>c(!t),children:t?d.jsxRuntimeExports.jsx(r2.EyeClosedIcon,{}):d.jsxRuntimeExports.jsx(r2.EyeOpenIcon,{})})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsx("button",{disabled:s||c1.size(a)<2||c1.size(i)<2,type:"submit",className:"inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",children:s?"Signing in...":"Login"})})]})}),d.jsxRuntimeExports.jsx("div",{className:"mt-4 flex items-center justify-end gap-x-2 text-sm",children:d.jsxRuntimeExports.jsx("a",{href:"https://apps.chaibuilder.com/settings",target:"_blank",className:"text-gray-500 hover:text-blue-400",children:"Forget your password?"})})]})})})},w4=h=>{const{data:t,isLoading:c}=g4(),a=N();return T.useEffect(()=>{a.setQueryData(["apiBaseUrl"],h.apiBaseUrl||"/api/chaibuilder")},[h.apiBaseUrl,a]),c?d.jsxRuntimeExports.jsx(O2,{}):t!=null&&t.valid?d.jsxRuntimeExports.jsx(x4,{...h}):d.jsxRuntimeExports.jsx(L4,{logo:h.logo})},B4=new R0,I4=h=>d.jsxRuntimeExports.jsxs(T0,{client:B4,children:[d.jsxRuntimeExports.jsx(h1.Toaster,{richColors:!0}),d.jsxRuntimeExports.jsx(w4,{...h})]});exports.ChaiBuilderStudio=I4;exports.useAddPage=a4;exports.useChangePage=M0;exports.useCurrentPage=H1;exports.useDeletePage=l4;exports.usePages=P2;exports.useProject=b2;exports.useQueryClient=N;exports.useUpdatePage=H0;exports.useUpdateProject=g0;
@@ -1,117 +0,0 @@
1
- import s from "react";
2
- var u = {
3
- color: void 0,
4
- size: void 0,
5
- className: void 0,
6
- style: void 0,
7
- attr: void 0
8
- }, p = s.createContext && /* @__PURE__ */ s.createContext(u), d = ["attr", "size", "title"];
9
- function f(e, t) {
10
- if (e == null)
11
- return {};
12
- var i = I(e, t), n, o;
13
- if (Object.getOwnPropertySymbols) {
14
- var r = Object.getOwnPropertySymbols(e);
15
- for (o = 0; o < r.length; o++)
16
- n = r[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
17
- }
18
- return i;
19
- }
20
- function I(e, t) {
21
- if (e == null)
22
- return {};
23
- var i = {};
24
- for (var n in e)
25
- if (Object.prototype.hasOwnProperty.call(e, n)) {
26
- if (t.indexOf(n) >= 0)
27
- continue;
28
- i[n] = e[n];
29
- }
30
- return i;
31
- }
32
- function l() {
33
- return l = Object.assign ? Object.assign.bind() : function(e) {
34
- for (var t = 1; t < arguments.length; t++) {
35
- var i = arguments[t];
36
- for (var n in i)
37
- Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]);
38
- }
39
- return e;
40
- }, l.apply(this, arguments);
41
- }
42
- function h(e, t) {
43
- var i = Object.keys(e);
44
- if (Object.getOwnPropertySymbols) {
45
- var n = Object.getOwnPropertySymbols(e);
46
- t && (n = n.filter(function(o) {
47
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
48
- })), i.push.apply(i, n);
49
- }
50
- return i;
51
- }
52
- function a(e) {
53
- for (var t = 1; t < arguments.length; t++) {
54
- var i = arguments[t] != null ? arguments[t] : {};
55
- t % 2 ? h(Object(i), !0).forEach(function(n) {
56
- U(e, n, i[n]);
57
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : h(Object(i)).forEach(function(n) {
58
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(i, n));
59
- });
60
- }
61
- return e;
62
- }
63
- function U(e, t, i) {
64
- return t = j(t), t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
65
- }
66
- function j(e) {
67
- var t = v(e, "string");
68
- return typeof t == "symbol" ? t : t + "";
69
- }
70
- function v(e, t) {
71
- if (typeof e != "object" || !e)
72
- return e;
73
- var i = e[Symbol.toPrimitive];
74
- if (i !== void 0) {
75
- var n = i.call(e, t || "default");
76
- if (typeof n != "object")
77
- return n;
78
- throw new TypeError("@@toPrimitive must return a primitive value.");
79
- }
80
- return (t === "string" ? String : Number)(e);
81
- }
82
- function b(e) {
83
- return e && e.map((t, i) => /* @__PURE__ */ s.createElement(t.tag, a({
84
- key: i
85
- }, t.attr), b(t.child)));
86
- }
87
- function C(e) {
88
- return (t) => /* @__PURE__ */ s.createElement(y, l({
89
- attr: a({}, e.attr)
90
- }, t), b(e.child));
91
- }
92
- function y(e) {
93
- var t = (i) => {
94
- var {
95
- attr: n,
96
- size: o,
97
- title: r
98
- } = e, g = f(e, d), m = o || i.size || "1em", c;
99
- return i.className && (c = i.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ s.createElement("svg", l({
100
- stroke: "currentColor",
101
- fill: "currentColor",
102
- strokeWidth: "0"
103
- }, i.attr, n, g, {
104
- className: c,
105
- style: a(a({
106
- color: e.color || i.color
107
- }, i.style), e.style),
108
- height: m,
109
- width: m,
110
- xmlns: "http://www.w3.org/2000/svg"
111
- }), r && /* @__PURE__ */ s.createElement("title", null, r), e.children);
112
- };
113
- return p !== void 0 ? /* @__PURE__ */ s.createElement(p.Consumer, null, (i) => t(i)) : t(u);
114
- }
115
- export {
116
- C as G
117
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("./jsx-runtime-Z_BpKhVy.cjs"),C=require("react"),cn=require("@radix-ui/react-toggle"),ce=require("class-variance-authority"),u=require("./utils-D_vtk3zK.cjs"),dn=require("@radix-ui/react-switch"),un=require("@radix-ui/react-slot"),mn=require("@radix-ui/react-accordion"),Y=require("@radix-ui/react-icons"),pn=require("@radix-ui/react-alert-dialog"),fn=require("@radix-ui/react-dialog"),xn=require("@radix-ui/react-label"),gn=require("@radix-ui/react-scroll-area"),hn=require("@radix-ui/react-tabs"),bn=require("@radix-ui/react-tooltip"),vn=require("@radix-ui/react-popover"),yn=require("@radix-ui/react-menubar"),jn=require("@radix-ui/react-hover-card"),wn=require("@radix-ui/react-select"),kn=require("@radix-ui/react-dropdown-menu"),Cn=require("@radix-ui/react-separator"),Rn=require("@radix-ui/react-toast"),J=require("cmdk"),Sn=require("@radix-ui/react-context-menu"),jt=require("react-icons-picker"),En=require("react-dom"),l=require("lodash-es"),An=require("react-quill"),ae=require("./Functions-N3yhPYKY.cjs"),Se=require("@chaibuilder/runtime"),p=require("jotai"),X=require("./MODIFIERS-mVmfEGgo.cjs"),Nn=require("./_commonjsHelpers-wDK0ZLPo.cjs"),_n=require("@react-hookz/web"),Bn=require("tree-model");require("react-i18next");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const f=H(C),wt=H(cn),Le=H(dn),le=H(mn),W=H(pn),M=H(fn),kt=H(xn),ie=H(gn),de=H(hn),fe=H(bn),he=H(vn),B=H(yn),Ee=H(jn),q=H(wn),D=H(kn),Ct=H(Cn),Z=H(Rn),L=H(Sn);var $={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Pn=0;function ne(e,t){const s=`atom${++Pn}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=n=>n(o),o.write=(n,a,i)=>a(o,typeof i=="function"?i(n(o)):i)),t&&(o.write=t),o}const Pe=e=>"init"in e,Te=e=>!!e.write,ke=new WeakMap,Tn=(e,t)=>{ke.set(e,t),e.catch(()=>{}).finally(()=>ke.delete(e))},lt=(e,t)=>{const s=ke.get(e);s&&(ke.delete(e),s(t))},ct=(e,t)=>{e.status="fulfilled",e.value=t},dt=(e,t)=>{e.status="rejected",e.reason=t},Mn=e=>typeof(e==null?void 0:e.then)=="function",xe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ut=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),pe=e=>"v"in e&&e.v instanceof Promise,In=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,ye=e=>{if("e"in e)throw e.e;return e.v},Rt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,n,a;($?"production":void 0)!=="production"&&(o=new Set,n=new Set,a=new Set);const i=m=>e.get(m),d=(m,h)=>{($?"production":void 0)!=="production"&&Object.freeze(h);const y=e.get(m);if(e.set(m,h),s.has(m)||s.set(m,y),y&&pe(y)){const b="v"in h?h.v instanceof Promise?h.v:Promise.resolve(h.v):Promise.reject(h.e);lt(y.v,b)}},x=(m,h,y)=>{const b=new Map;let j=!1;y.forEach((v,S)=>{!v&&S===m&&(v=h),v?(b.set(S,v),h.d.get(S)!==v&&(j=!0)):($?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(j||h.d.size!==b.size)&&(h.d=b)},c=(m,h,y)=>{const b=i(m),j={d:(b==null?void 0:b.d)||new Map,v:h};if(y&&x(m,j,y),b&&xe(b,j)&&b.d===j.d)return b;if(b&&pe(b)&&pe(j)&&In(b,j)){if(b.d===j.d)return b;j.v=b.v}return d(m,j),j},g=(m,h,y,b)=>{if(Mn(h)){let j;const v=new Promise((S,z)=>{let A=!1;h.then(T=>{if(!A){A=!0;const N=i(m),oe=c(m,v,y);ct(v,T),S(T),(N==null?void 0:N.d)!==oe.d&&U(m,oe,N==null?void 0:N.d)}},T=>{if(!A){A=!0;const N=i(m),oe=c(m,v,y);dt(v,T),z(T),(N==null?void 0:N.d)!==oe.d&&U(m,oe,N==null?void 0:N.d)}}),j=T=>{A||(A=!0,T.then(N=>ct(v,N),N=>dt(v,N)),S(T))}});return v.orig=h,v.status="pending",Tn(v,S=>{S&&j(S),b==null||b()}),c(m,v,y)}return c(m,h,y)},w=(m,h,y)=>{const b=i(m),j={d:(b==null?void 0:b.d)||new Map,e:h};return y&&x(m,j,y),b&&ut(b,j)&&b.d===j.d?b:(d(m,j),j)},R=m=>{const h=i(m);if(h&&(h.d.forEach((A,T)=>{T!==m&&!t.has(T)&&R(T)}),Array.from(h.d).every(([A,T])=>{const N=i(A);return A===m||N===T||N&&!pe(N)&&xe(N,T)})))return h;const y=new Map;let b=!0;const j=A=>{if(A===m){const N=i(A);if(N)return y.set(A,N),ye(N);if(Pe(A))return y.set(A,void 0),A.init;throw new Error("no atom init")}const T=R(A);return y.set(A,T),ye(T)};let v,S;const z={get signal(){return v||(v=new AbortController),v.signal},get setSelf(){return($?"production":void 0)!=="production"&&!Te(m)&&console.warn("setSelf function cannot be used with read-only atom"),!S&&Te(m)&&(S=(...A)=>{if(($?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return I(m,...A)}),S}};try{const A=m.read(j,z);return g(m,A,y,()=>v==null?void 0:v.abort())}catch(A){return w(m,A,y)}finally{b=!1}},O=m=>ye(R(m)),k=m=>{let h=t.get(m);return h||(h=V(m)),h},E=(m,h)=>!h.l.size&&(!h.t.size||h.t.size===1&&h.t.has(m)),_=m=>{const h=t.get(m);h&&E(m,h)&&G(m)},F=m=>{const h=new Map,y=new WeakMap,b=v=>{const S=t.get(v);S==null||S.t.forEach(z=>{z!==v&&(h.set(z,(h.get(z)||new Set).add(v)),y.set(z,(y.get(z)||0)+1),b(z))})};b(m);const j=v=>{const S=t.get(v);S==null||S.t.forEach(z=>{var A;if(z!==v){let T=y.get(z);if(T&&y.set(z,--T),!T){let N=!!((A=h.get(z))!=null&&A.size);if(N){const oe=i(z),ln=R(z);N=!oe||!xe(oe,ln)}N||h.forEach(oe=>oe.delete(z))}j(z)}})};j(m)},P=(m,...h)=>{let y=!0;const b=S=>ye(R(S)),j=(S,...z)=>{let A;if(S===m){if(!Pe(S))throw new Error("atom not writable");const T=i(S),N=g(S,z[0]);(!T||!xe(T,N))&&F(S)}else A=P(S,...z);if(!y){const T=se();($?"production":void 0)!=="production"&&n.forEach(N=>N({type:"async-write",flushed:T}))}return A},v=m.write(b,j,...h);return y=!1,v},I=(m,...h)=>{const y=P(m,...h),b=se();return($?"production":void 0)!=="production"&&n.forEach(j=>j({type:"write",flushed:b})),y},V=(m,h)=>{const y={t:new Set(h&&[h]),l:new Set};if(t.set(m,y),($?"production":void 0)!=="production"&&a.add(m),R(m).d.forEach((b,j)=>{const v=t.get(j);v?v.t.add(m):j!==m&&V(j,m)}),R(m),Te(m)&&m.onMount){const b=m.onMount((...j)=>I(m,...j));b&&(y.u=b)}return y},G=m=>{var h;const y=(h=t.get(m))==null?void 0:h.u;y&&y(),t.delete(m),($?"production":void 0)!=="production"&&a.delete(m);const b=i(m);b?(pe(b)&&lt(b.v),b.d.forEach((j,v)=>{if(v!==m){const S=t.get(v);S&&(S.t.delete(m),E(v,S)&&G(v))}})):($?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},U=(m,h,y)=>{const b=new Set(h.d.keys());y==null||y.forEach((j,v)=>{if(b.has(v)){b.delete(v);return}const S=t.get(v);S&&(S.t.delete(m),E(v,S)&&G(v))}),b.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&V(j,m)})},se=()=>{let m;for(($?"production":void 0)!=="production"&&(m=new Set);s.size;){const h=Array.from(s);s.clear(),h.forEach(([y,b])=>{const j=i(y);if(j){j.d!==(b==null?void 0:b.d)&&U(y,j,b==null?void 0:b.d);const v=t.get(y);v&&!(b&&!pe(b)&&(xe(b,j)||ut(b,j)))&&(v.l.forEach(S=>S()),($?"production":void 0)!=="production"&&m.add(y))}else($?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if(($?"production":void 0)!=="production")return o.forEach(h=>h("state")),m},K=(m,h)=>{const y=k(m),b=se(),j=y.l;return j.add(h),($?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),n.forEach(v=>v({type:"sub",flushed:b}))),()=>{j.delete(h),_(m),($?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),n.forEach(v=>v({type:"unsub"})))}};return($?"production":void 0)!=="production"?{get:O,set:I,sub:K,dev_subscribe_store:(m,h)=>h!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(n.add(m),()=>{n.delete(m)}),dev_get_mounted_atoms:()=>a.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[y,b]of m)Pe(y)&&(g(y,b),F(y));const h=se();n.forEach(y=>y({type:"restore",flushed:h}))}}:{get:O,set:I,sub:K}};let Me;const Dn=()=>(Me||(Me=Rt()),Me);var Ue={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const St=Symbol();const mt=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Ln=new WeakMap,On=(e,t,s)=>{const o=mt(()=>new WeakMap,Ln,t);return mt(e,o,s)},zn={},pt=e=>!!e.write,Vn=e=>typeof e=="function";function Fn(e,t){return On(()=>{const s=new WeakMap,o=(i,d)=>{let x=s.get(i);if(x)return x;const c=d&&s.get(d),g=[],w=[];return i.forEach((R,O)=>{const k=t?t(R):O;w[O]=k;const E=c&&c.atomList[c.keyList.indexOf(k)];if(E){g[O]=E;return}const _=P=>{const I=P(n),V=P(e),U=o(V,I==null?void 0:I.arr).keyList.indexOf(k);if(U<0||U>=V.length){const se=i[o(i).keyList.indexOf(k)];if(se)return se;throw new Error("splitAtom: index out of bounds for read")}return V[U]},F=(P,I,V)=>{const G=P(n),U=P(e),K=o(U,G==null?void 0:G.arr).keyList.indexOf(k);if(K<0||K>=U.length)throw new Error("splitAtom: index out of bounds for write");const m=Vn(V)?V(U[K]):V;I(e,[...U.slice(0,K),m,...U.slice(K+1)])};g[O]=pt(e)?ne(_,F):ne(_)}),c&&c.keyList.length===w.length&&c.keyList.every((R,O)=>R===w[O])?x=c:x={arr:i,atomList:g,keyList:w},s.set(i,x),x},n=ne(i=>{const d=i(n),x=i(e);return o(x,d==null?void 0:d.arr)});(Ue?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const a=pt(e)?ne(i=>i(n).atomList,(i,d,x)=>{switch(x.type){case"remove":{const c=i(a).indexOf(x.atom);if(c>=0){const g=i(e);d(e,[...g.slice(0,c),...g.slice(c+1)])}break}case"insert":{const c=x.before?i(a).indexOf(x.before):i(a).length;if(c>=0){const g=i(e);d(e,[...g.slice(0,c),x.value,...g.slice(c)])}break}case"move":{const c=i(a).indexOf(x.atom),g=x.before?i(a).indexOf(x.before):i(a).length;if(c>=0&&g>=0){const w=i(e);c<g?d(e,[...w.slice(0,c),...w.slice(c+1,g),w[c],...w.slice(g)]):d(e,[...w.slice(0,g),w[c],...w.slice(g,c),...w.slice(c+1)])}break}}}):ne(i=>i(n).atomList);return a},e,t||zn)}function Un(e){const t=Symbol(),s=ne(t);(Ue?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=ne((n,a)=>{const i=n(s);return i!==t?i:e(n,a)},(n,a,i)=>{if(i===St)a(s,t);else if(typeof i=="function"){const d=n(o);a(s,i(d))}else a(s,i)});return o}const qn=e=>typeof(e==null?void 0:e.then)=="function";function Hn(e){let t,s;const o={getItem:(n,a)=>{var i,d;const x=g=>{if(g=g||"",t!==g){try{s=JSON.parse(g)}catch{return a}t=g}return s},c=(d=(i=e())==null?void 0:i.getItem(n))!=null?d:null;return qn(c)?c.then(x):x(c)},setItem:(n,a)=>{var i;return(i=e())==null?void 0:i.setItem(n,JSON.stringify(a))},removeItem:n=>{var a;return(a=e())==null?void 0:a.removeItem(n)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(n,a,i)=>{if(!(e()instanceof window.Storage))return()=>{};const d=x=>{if(x.storageArea===e()&&x.key===n){let c;try{c=JSON.parse(x.newValue||"")}catch{c=i}a(c)}};return window.addEventListener("storage",d),()=>{window.removeEventListener("storage",d)}}),o}const $n=Hn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=$n,o){const n=o==null?void 0:o.unstable_getOnInit,a=ne(n?s.getItem(e,t):t);return(Ue?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.onMount=d=>{n||d(s.getItem(e,t));let x;return s.subscribe&&(x=s.subscribe(e,d,t)),x},ne(d=>d(a),(d,x,c)=>{const g=typeof c=="function"?c(d(a)):c;return g===St?(x(a,t),s.removeItem(e)):g instanceof Promise?g.then(w=>(x(a,w),s.setItem(e,w))):(x(a,g),s.setItem(e,g))})}var Gn={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Yn=C.createContext(void 0),qe=e=>{const t=C.useContext(Yn);return(e==null?void 0:e.store)||t||Dn()};const Wn=e=>typeof(e==null?void 0:e.then)=="function",Kn=C.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Et(e,t){const s=qe(t),[[o,n,a],i]=C.useReducer(c=>{const g=s.get(e);return Object.is(c[0],g)&&c[1]===s&&c[2]===e?c:[g,s,e]},void 0,()=>[s.get(e),s,e]);let d=o;(n!==s||a!==e)&&(i(),d=s.get(e));const x=t==null?void 0:t.delay;return C.useEffect(()=>{const c=s.sub(e,()=>{if(typeof x=="number"){setTimeout(i,x);return}i()});return i(),c},[s,e,x]),C.useDebugValue(d),Wn(d)?Kn(d):d}function At(e,t){const s=qe(t);return C.useCallback((...n)=>{if((Gn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...n)},[s,e])}function Nt(e,t){return[Et(e,t),At(e,t)]}function _t(e,t,s){const o=l.filter(e,a=>a._parent===t),n=[];for(let a=0;a<o.length;a++){const i=Pt(o[a]);if(Object.keys(i).length>0&&Object.keys(i).forEach(d=>{o[a][d]=`slot:${ae.generateUUID()}`}),l.filter(e,{_parent:o[a]._id}).length>0){const d=ae.generateUUID();n.push({...o[a],oldId:o[a]._id,_id:d,_parent:s}),n.push(l.flatten(_t(e,o[a]._id,d)))}else n.push({...o[a],oldId:o[a]._id,_id:ae.generateUUID(),_parent:s})}return l.flatten(n)}function Bt(e){const t={};e.forEach(o=>{t[o._id]={...o,children:[]}});const s=[];return e.forEach(o=>{if(o._parent){const n=t[o._parent];n&&n.children.push(t[o._id])}else s.push(t[o._id])}),s}const Pt=e=>{const t={};return Object.keys(e).forEach(s=>{l.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},Xn=(e,t,s=null)=>{let o=l.find(e,{_id:t});o={...o,oldId:o._id,_id:ae.generateUUID()},s&&(o={...o,_parent:s});const n=[o];l.filter(e,{_parent:t}).length>0&&n.push(l.flatten(_t(e,t,o._id)));const a=l.flatten(n);return l.map(a,i=>{const d=i,x=Pt(d);return Object.keys(x).length>0&&Object.keys(x).forEach(c=>{const g=l.find(a,{oldId:x[c].replace("slot:","")});d[c]=`slot:${g._id}`}),l.omit(d,["global","oldId"])})};const ee=p.atom([]);ee.debugLabel="presentBlocksAtom";const Tt=p.atom(e=>{const t=e(ee);return Bt([...t])});Tt.debugLabel="treeDSBlocks";ee.debugLabel="presentBlocksAtom";const He=Fn(ee);He.debugLabel="pageBlocksAtomsAtom";const Jn=p.atom("");Jn.debugLabel="builderActivePageAtom";const Zn=p.atom(-1);Zn.debugLabel="destinationDropIndexAtom";const Mt=p.atom([]);Mt.debugLabel="buildingBlocksAtom";const Qn=p.atom(e=>{const t=e(Mt);return l.filter(t,s=>l.has(s,"blockId"))});Qn.debugLabel="globalBlocksAtom";const Oe=l.memoize((e,t)=>{if(!e)return!0;const s=Se.getBlockComponent(e);return s&&l.has(s,"canAcceptBlock")?s.canAcceptBlock(t):!1}),ki=l.memoize((e,t)=>{const s=Se.getBlockComponent(t);return s&&l.has(s,"canBeNested")?s.canBeNested(e):!0}),er=l.memoize(e=>{const t=Se.getBlockComponent(e);return t&&l.has(t,"canDuplicate")?t.canDuplicate():!0}),tr=l.memoize(e=>{const t=Se.getBlockComponent(e);return t&&l.has(t,"canDelete")?t.canDelete():!0});const $e=p.atom([]);$e.debugLabel="selectedBlockIdsAtom";const Ge=p.atom(e=>{const t=e(ee),s=e($e);return l.map(l.filter(t,({_id:o})=>l.includes(s,o)),o=>({...o}))});Ge.debugLabel="selectedBlocksAtom";const Ae=p.atom(e=>{const t=e(Ge);if(t.length===0)return null;if(t.length===1)return t[0]});Ae.debugLabel="selectedBlockAtom";const sr=e=>l.get(e,"_parent",null),or=p.atom(e=>{const t=e(Ge),s=l.map(t,sr);return l.filter(e(ee),o=>l.includes(s,o._id))});or.debugLabel="selectedBlocksParentsAtom";const It=p.atom(()=>!1);It.debugLabel="selectedBlockFlexChildAtom";const Dt=p.atom(()=>!1);Dt.debugLabel="selectedBlockGridChildAtom";const Ye=p.atom("");Ye.debugLabel="styleStateAtom";const Lt=ue("styleBreakpoint","xs");Lt.debugLabel="styleBreakpointAtom";const nr=()=>({flexChild:p.useAtomValue(It),gridChild:p.useAtomValue(Dt)}),rr=()=>p.useAtomValue(Ae),Ci=p.atom(e=>{const t=e(Ae),s=e(ee);let o=t;const n=[t];do{const a=s.find(({_id:i})=>i===(o==null?void 0:o._parent));o=a,a&&n.push(a)}while(o!=null&&o._parent);return n});const be=()=>{const[e,t]=p.useAtom($e),s=C.useCallback(o=>{t(n=>l.includes(n,o)?l.without(n,o):[...n,o])},[t]);return[e,t,s]},ze=e=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:t}=e,s={};return Object.keys(t).forEach(a=>{const i=t[a];if(l.includes(["slot","styles"],i.type))return;const d=a;s[d]=ze(i)}),s;case"list":const{itemProperties:o}=e,n={items:{}};return Object.keys(o).forEach(a=>{const i=o[a];if(l.includes(["slot","styles"],i.type))return;const d=a;n.items[d]=ze(i)}),n;default:return{}}},Ve=e=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:t,title:s}=e,o={title:s,type:"object",properties:{}};return Object.keys(t).forEach(d=>{const x=t[d];if(l.includes(["slot","styles"],x.type))return;const c=d;o.properties[c]=Ve(x)}),o;case"list":const{itemProperties:n,title:a}=e,i={title:a,type:"array",items:{type:"object",properties:{}}};return Object.keys(n).forEach(d=>{const x=n[d];if(l.includes(["slot","styles"],x.type))return;const c=d;i.items.properties[c]=Ve(x),l.set(i.items,"title",l.get(x,"itemTitle",`${a} item`))}),i;default:return{}}},Ot=e=>{if(!e)return{};const t={};return Object.keys(e).forEach(s=>{t[s]=ir(e[s])}),t},ar=e=>{if(l.isEmpty(e.default))return[];const{itemProperties:t}=e;return l.map(e.default,s=>{const o={...s};return l.forIn(s,(n,a)=>{l.has(t,a)&&l.get(t[a],"i18n",!1)&&(o[a]=X.I18N_KEY)}),o})},ir=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${X.SLOT_KEY}${ae.generateUUID()}`;case"singular":const{schema:t}=e;return l.get(t,"default","");case"model":return Ot(e.properties);case"list":return ar(e);default:return""}};const lr=(e,t)=>{const s={};return l.set(s,e,t),s};var We={exports:{}},Ri=We.exports;(function(e){(function(){"use strict";function t(o,n,a){return o.splice(n,!a||1+a-n+(!(a<0^n>=0)&&(a<0||-1)*o.length)),o.length}let s=function(){let o=[],n=-1,a=0,i=!1,d;function x(c,g){return!c||typeof c[g]!="function"?this:(i=!0,c[g](),i=!1,this)}return{add:function(c){return i?this:(o.splice(n+1,o.length-n),o.push(c),a&&o.length>a&&t(o,0,-(a+1)),n=o.length-1,d&&d(),this)},setCallback:function(c){d=c},undo:function(){let c=o[n];if(!c)return this;const g=c.groupId;for(;c.groupId===g&&(x(c,"undo"),n-=1,c=o[n],!(!c||!c.groupId)););return d&&d(),this},redo:function(){let c=o[n+1];if(!c)return this;const g=c.groupId;for(;c.groupId===g&&(x(c,"redo"),n+=1,c=o[n+1],!(!c||!c.groupId)););return d&&d(),this},clear:function(){let c=o.length;o=[],n=-1,d&&c>0&&d()},hasUndo:function(){return n!==-1},hasRedo:function(){return n<o.length-1},getCommands:function(c){return c?o.filter(g=>g.groupId===c):o},getIndex:function(){return n},setLimit:function(c){a=c}}};e.exports?e.exports=s:window.UndoManager=s})()})(We);var cr=We.exports;const dr=Nn.getDefaultExportFromCjs(cr),ur=p.atom(X.BRANDING_OPTIONS_DEFAULTS),mr=p.atom(null),Ke=()=>{const[e,t]=p.useAtom(ur);return[l.isObject(e)?{...X.BRANDING_OPTIONS_DEFAULTS,...e}:X.BRANDING_OPTIONS_DEFAULTS,t]},pr=()=>p.useAtom(mr),fr=p.atom(null),zt=()=>({currentPage:p.useAtomValue(fr)});function Vt(e){return Bt(e)}const Xe=(e,t)=>l.flatten(e.map(s=>{if(s=t?{...s,_parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,l.flatten([s,...Xe(o,s._id)])}return s}));function Je(e,t=!1){for(let s=0;s<e.length;s++){const o=e[s];o.global&&!t?e[s]={type:"GlobalBlock",blockId:o.blockId,_parent:l.get(o,"_parent",null),_id:o._id}:o.children&&o.children.length&&Je(o.children)}}function Ft(e){let t=[],s=l.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=l.map(s,Ut),l.each(s,o=>{t=[...t,...xr(o)]})),t}function xr(e){let t=[];const s=l.get(l.first(e),"_parent",null);l.set(l.first(e),"_parent",null);const o=[flatToNestedInstance.convert(qt(e))];Je(o,!0);let n=Xe(o,e[0]._id);return n=l.set(n,"0._parent",s),t=[...t,n,...Ft(n)],t}function Ut(e){const t=l.find(Fe,{_id:e._id});if(!t)return[];const s=[t],o=l.filter(Fe,{_parent:e._id});return o.length?l.flatten([...s,...l.flatten(l.map(o,Ut))]):l.flatten(s)}const qt=e=>JSON.parse(JSON.stringify(e));let Fe=[];function gr(e){Fe=e;const t=Vt(qt(e));Je(t);const s=Xe(t,null),o=Ft(s),n={};return l.each(o,a=>l.set(n,l.first(a).blockId,a)),[s,n]}const Ht=()=>{const[e]=Ke(),{currentPage:t}=zt(),[s]=me();return C.useCallback(()=>{const o=l.map(s,a=>l.omit(a,["expanded","order","title","siblings","tempClasses"])),[n=[]]=gr(o);return{currentPage:t,blocks:n}},[e,t,s])},Ze=p.atom(null);Ze.debugLabel="chaiBuilderPropsAtom";const $t=p.atom({});$t.debugLabel="chaiExternalDataAtom";const Q=(e,t=void 0)=>{const s=p.useAtomValue(Ze);return l.get(s,e,t)},Qe=p.atom([]);Qe.debugLabel="dataProvidersAtom";const Gt=()=>p.useAtom(Qe),Ne=p.atom("SAVED");Ne.debugLabel="builderSaveStateAtom";const hr=()=>{const[e,t]=p.useAtom(Ne),s=Q("onSavePage",async c=>{}),o=Q("onSave",async c=>{}),n=Q("onSaveStateChange",l.noop),a=Ht(),[i]=Gt(),[d]=Ke();return{savePage:_n.useThrottledCallback(async()=>{t("SAVING"),n("SAVING");const c=a();return await s({blocks:c.blocks,providers:i}),await o({blocks:c.blocks,providers:i,brandingOptions:d,themeConfiguration:d}),setTimeout(()=>{t("SAVED"),n("SAVED")},100),!0},[a,t,d,o,n],3e3),saveState:e,setSaveState:t}},re=new dr;re.setLimit(50);const et=()=>{const[,e]=p.useAtom(Ne),t=Q("onSaveStateChange",l.noop);return C.useEffect(()=>(re.setCallback(()=>{e("UNSAVED"),t("UNSAVED")}),()=>{re.setCallback(l.noop)}),[]),{add:re.add,undo:re.undo,redo:re.redo,hasRedo:re.hasRedo,hasUndo:re.hasUndo,clear:re.clear}},tt=(e,t)=>{const s=[],o=l.filter(e,n=>l.includes(t,n._id)||l.includes(t,n._parent)?(s.push(n._id),!1):!0);return l.isEmpty(s)?o:tt(o,s)},br=()=>{const[e]=me(),[t,s]=be(),{setNewBlocks:o}=te();return C.useCallback(n=>{var i;const a=((i=l.find(e,{_id:n[0]}))==null?void 0:i._parent)||null;o(tt(e,n)),setTimeout(()=>s(a?[a]:[]),200)},[e,s,t])};function vr(e,t,s,o){let n=e.filter(d=>!d._parent);s&&(n=e.filter(d=>d._parent===s));const a=o!==void 0?o:n.length;let i=e.length;for(let d=0,x=0;d<e.length;d++)if(e[d]._parent===s){if(x===a){i=d;break}x++}return!s&&o!==void 0&&o>=n.length&&(i=e.length),[...e.slice(0,i),...t,...e.slice(i)]}function yr(e){let t=[];return e.walk(s=>(delete s.model.children,t.push(s.model),!0)),t}function ft(e,t){return e.first(s=>s.model._id===t)||null}function jr(e,t,s,o){const n=ft(e,t),a=ft(e,s);if(n&&a){n.drop(),a.children||(a.model.children=[]);try{a.addChildAtIndex(n,o)}catch(i){return console.error("Error adding child to parent:",i),!1}return!0}return!1}function wr(e,t,s,o){if(!t)return e;s=s||"root";const a=new Bn().parse({_id:"root",children:Vt(e)});if(jr(a,t,s,o)){const i=yr(a),d=i.find(x=>x._id===t);return d&&(d._parent=s==="root"?null:s),i.shift(),i}return e}const kr=()=>{const[,e]=me();return{setNewBlocks:t=>{e(t)},addBlocks:(t,s,o)=>{e(n=>vr(n,t,s,o))},removeBlocks:t=>{e(s=>tt(s,t))},moveBlocks:(t,s,o)=>{e(n=>{let a=n;for(let i=0;i<t.length;i++)a=wr(a,t[i],s,o);return a})},updateBlocksProps:t=>{e(s=>{const o=t.map(n=>n._id);return s.map(n=>{if(o.includes(n._id)){const a=l.find(t,{_id:n._id});return{...n,...l.omit(a,"_id")}}return n})})}}},me=()=>p.useAtom(ee),te=()=>{const{add:e}=et(),[t]=me(),{setNewBlocks:s,addBlocks:o,removeBlocks:n,moveBlocks:a,updateBlocksProps:i}=kr();return{moveBlocks:(k,E,_)=>{const F=l.map(k,I=>{const G=t.find(K=>K._id===I)._parent||null,se=t.filter(K=>G?K._parent===G:!K._parent).map(K=>K._id).indexOf(I);return{_id:I,oldParent:G,oldPosition:se}}),P=F.find(({_id:I})=>I===k[0]);P&&P.oldParent===E&&P.oldPosition===_||(a(k,E,_),e({undo:()=>l.each(F,({_id:I,oldParent:V,oldPosition:G})=>{a([I],V,G)}),redo:()=>a(k,E,_)}))},addBlocks:(k,E,_)=>{o(k,E,_),e({undo:()=>n(l.map(k,"_id")),redo:()=>o(k,E,_)})},removeBlocks:k=>{var P;const E=(P=l.first(k))==null?void 0:P._parent,F=t.filter(I=>E?I._parent===E:!I._parent).indexOf(l.first(k));n(l.map(k,"_id")),e({undo:()=>o(k,E,F),redo:()=>n(l.map(k,"_id"))})},updateBlocks:(k,E,_)=>{let F=[];if(_)F=l.map(k,P=>({_id:P,..._}));else{const P=l.keys(E);F=l.map(k,I=>{const V=t.find(U=>U._id===I),G={_id:I};return l.each(P,U=>G[U]=V[U]),G})}i(l.map(k,P=>({_id:P,...E}))),e({undo:()=>i(F),redo:()=>i(l.map(k,P=>({_id:P,...E})))})},updateBlocksRuntime:(k,E)=>{i(l.map(k,_=>({_id:_,...E})))},setNewBlocks:k=>{s(k),e({undo:()=>s(t),redo:()=>s(k)})},updateMultipleBlocksProps:k=>{let E=[];E=l.map(k,_=>{const F=l.keys(_),P=t.find(V=>V._id===_._id),I={};return l.each(F,V=>I[V]=P[V]),I}),i(k),e({undo:()=>i(E),redo:()=>i(k)})}}},Cr=()=>{const[e]=me(),[,t]=be(),{addBlocks:s}=te(),o=C.useCallback((a,i,d)=>{var R;for(let O=0;O<a.length;O++){const{_id:k}=a[O];a[O]._id=ae.generateUUID();const E=l.filter(a,{_parent:k});for(let _=0;_<E.length;_++)E[_]._parent=a[O]._id}const x=l.first(a);let c,g;return i&&(c=l.find(e,{_id:i}),a[0]._parent=i,g=i),!(c?Oe(c==null?void 0:c._type,x._type):!0)&&c&&(a[0]._parent=c._parent,g=c._parent),s(a,g,d),t([(R=l.first(a))==null?void 0:R._id]),l.first(a)},[e,t]);return{addCoreBlock:C.useCallback((a,i,d)=>{if(l.has(a,"blocks")){const _=a.blocks;return o(_,i,d)}const x=ae.generateUUID(),c=Ot(a.props),g=[];l.forIn(c,(_,F)=>{if(l.startsWith(_,X.SLOT_KEY)){const P=_.replace(X.SLOT_KEY,"");g.push({_id:P,_type:"Slot",_parent:x,_name:a.props[F].name,_styles:a.props[F].styles,_emptyStyles:a.props[F].emptyStyles})}});const w={_type:a.type,_id:x,...c};let R,O;i&&(R=l.find(e,{_id:i}),w._parent=i,O=i),!Oe(R==null?void 0:R._type,w._type)&&R&&(w._parent=R._parent,O=R._parent);const E=[w,...g];return s(E,O,d),t([w._id]),w},[o,e,t]),addPredefinedBlock:o}},xt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},gt=["xs","sm","md","lg","xl","2xl"];function Rr(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",n=gt.indexOf(s);for(;n>0;){const a=gt[n-1];if(l.find(e,{mq:a,property:t.property})){o="classes";break}n--}return o}const ht=[];function Sr(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=l.filter(l.map(e.split(" "),u.constructClassObject),c=>!l.isNull(c)),n=l.filter(l.map(t.split(" "),u.constructClassObject),c=>!l.isNull(c));n=l.filter(n,c=>!l.includes(ht,c.property));const a=[],i=[];l.each(s,c=>{const g=u.constructClassObject(c),w=l.find(o,l.pick(g,["dark","mq","mod","property"]));if(w&&(o=l.filter(o,R=>R.fullCls!==(w==null?void 0:w.fullCls))),a.push(g),g.mq==="xs"&&!g.dark&&g.mod===""&&(n=l.filter(n,R=>R.property!==g.property)),Rr(o,g)==="baseClasses"&&!l.includes(ht,g.property)){const R=l.find(n,l.pick(g,["property"]));w&&(n=l.filter(n,O=>O.fullCls!==(R==null?void 0:R.fullCls))),i.push({...g,fullCls:g.cls,mq:"xs"})}});const d=l.map(l.sortBy([...o,...a],c=>xt[c.mq]),"fullCls").join(" ");return`${l.map(l.sortBy([...n,...i],c=>xt[c.mq]),"fullCls").join(" ").trim()},${d.trim()}`.trim().replace(/ +/g,"")}const ve=p.atom([]);ve.debugLabel="selectedStylingBlocksAtom";const Yt=()=>p.useAtom(ve),Er=e=>{const t=e.replace(X.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Ar=p.atom(null,(e,t,{blockIds:s,newClasses:o})=>{const n=l.filter(e(He),i=>s.includes(e(i)._id)),a=l.first(e(ve));return l.map(n,i=>{const d=e(i),x=l.get(d,a.prop,`${X.STYLES_KEY},`),{baseClasses:c,classes:g}=Er(x);return{ids:[d._id],props:{[a.prop]:`${X.STYLES_KEY}${Sr(g,c,o)}`}}})}),Nr=()=>{const e=p.useSetAtom(Ar),{updateBlocks:t,updateBlocksRuntime:s}=te();return C.useCallback((o,n,a=!1)=>{const i=e({blockIds:o,newClasses:n});if(!a){s(o,i[0].props);return}t(o,i[0].props)},[e])},Wt=()=>p.useAtom(Lt),Kt=ue("canvasWidth",800),Xt=p.atom(e=>{const t=e(Kt);return ae.getBreakpointValue(t).toLowerCase()}),_r=()=>{const[e,t]=p.useAtom(Kt),s=p.useAtomValue(Xt),[o,n]=Wt();return C.useEffect(()=>{o!=="xs"&&n(s)},[s,o,n]),[e,s,t]},Br=ue("canvasZoom",100),Pr=()=>p.useAtom(Br),Jt=p.atom([]),Zt=()=>{const[e,t]=p.useAtom(Jt),s=p.useSetAtom(st),o=C.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},st=p.atom([]),Tr=()=>{const[e,t]=p.useAtom(st),s=p.useSetAtom(Jt),o=C.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},Qt=ue("darkMode",!1),Mr=()=>{const[e,t]=p.useAtom(Qt);return[e,t]},es=()=>{const[e]=me(),[,t]=be(),{addBlocks:s}=te();return C.useCallback((o,n=null)=>{const a=[];l.each(o,i=>{const d=e.find(R=>R._id===i);n||(n=d._parent);const g=l.filter(e,R=>l.isString(n)?R._parent===n:!d._parent).indexOf(d)+1,w=Xn(e,i,n);s(w,n,g),a.push(l.get(w,"0._id",""))}),t(a)},[e,t])},Ir=p.atom([]),Dr=()=>{const[e,t]=p.useAtom(Ir),s=C.useCallback(o=>{t(n=>l.includes(n,o)?l.without(n,o):[...n,o])},[t]);return[e,t,s]},Lr=p.atom(""),ts=()=>p.useAtom(Lr),Or=()=>{const e=p.useAtomValue(ee);return C.useCallback((t,s)=>{const o=l.map(e,n=>(l.includes(t,l.get(n,"_id"))&&l.set(n,"_parent",s),n));console.log("newBlocks",o)},[e])},zr=()=>{console.warn("usePasteBlocks is not implemented");const e=p.useAtomValue(st),[t,s]=Zt(),o=es(),n=Or();return{canPaste:C.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:C.useCallback(i=>{l.isEmpty(e)?n(t,i):o(e,i),s(()=>[])},[t,e,o,n,s])}},Vr=p.atom(!1),Fr=()=>{const[e,t]=p.useAtom(Vr);return[e,t]},Ur=()=>!1,qr=e=>{const t=e.replace(X.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Hr=p.atom(null,(e,t,{blockIds:s,fullClasses:o})=>{const n=l.first(e(ve)),a=l.filter(e(He),i=>s.includes(e(i)._id));return l.map(a,i=>{const d=e(i),x=o;let{classes:c,baseClasses:g}=qr(l.get(d,n.prop,"styles:,"));return l.each(x,w=>{const R=w.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),O=new RegExp(`(^| )${R}($| )`,"g");c=c.replace(O," ").replace(/ +/g," ").trim();const k=l.first(w.split(":"));l.includes(["2xl","xl","lg","md","sm"],k)&&x.push(w.split(":").pop().trim())}),l.each(x,w=>{const R=new RegExp(`(^| )${w.replace("[","\\[").replace("]","\\]")}($| )`,"g");g=g.replace(R," ").replace(/ +/g," ").trim()}),{ids:[d._id],props:{[n.prop]:`${X.STYLES_KEY}${g},${c}`}}})}),$r=()=>{const{updateBlocks:e}=te(),t=p.useSetAtom(Hr);return C.useCallback((s,o)=>{const n=t({blockIds:s,fullClasses:o});e(s,n[0].props)},[t])},ss=p.atom(e=>{const t=l.first(e(ve)),s=e(Ae);if(!t||t.blockId!==l.get(s,"_id",null))return[];const n=l.get(s,t.prop,`${X.STYLES_KEY},`).replace(X.STYLES_KEY,"").split(",").join(" ");return l.filter(l.map(n.trim().split(" "),u.constructClassObject),a=>!l.isNull(a))}),Gr=()=>p.useAtomValue(ss),bt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},Yr=p.atom(e=>{const t=e(Xt),s=e(Ye),o=e(Qt),n=Wr(t);let a=l.filter(e(ss),{mod:s});return l.startsWith(s,"_")||(a=l.filter(a,i=>n.includes(i.mq))),a=a.sort((i,d)=>bt[i.mq]-bt[d.mq]),o||(a=l.filter(a,{dark:!1})),a}),Wr=e=>{let t=[];switch(e){case"xs":t=["xs"];break;case"sm":t=["xs","sm"];break;case"md":t=["xs","sm","md"];break;case"lg":t=["xs","sm","md","lg"];break;case"xl":t=["xs","sm","md","lg","xl"];break;case"2xl":t=["xs","sm","md","lg","xl","2xl"];break;default:t=["xs"];break}return t},Kr=()=>p.useAtomValue(Yr),Xr=()=>p.useAtom(Ye),Jr=()=>{const{updateBlocks:e}=te();return C.useCallback((t,s,o)=>{e(t,s,o)},[e])},Zr=()=>{const{updateMultipleBlocksProps:e}=te();return C.useCallback(t=>{e(t)},[e])},Qr=()=>{const{updateBlocksRuntime:e}=te();return C.useCallback(async(t,s,o=30)=>{const n=l.keys(l.omit(s,["_id"]));for(const a of n){const i=s[a];if(l.isString(i)){const d=l.chunk(i.split(""),12);let x="";e([t],{[a]:""});for(let c=0;c<d.length;c++)x+=d[c].join(""),e([t],{[a]:x}),await new Promise(g=>setTimeout(g,o))}}},[e])},ea=()=>{const{updateMultipleBlocksProps:e}=te(),t=Qr();return C.useCallback(async s=>{for(const o of s)await t(o._id,o);e(s)},[e])},ta=()=>{const{updateBlocksRuntime:e}=te();return C.useCallback((t,s)=>{e(t,s)},[e])},os={name:"",props:{},modalProps:{},backdropClose:!0},sa=p.atom(os),oa=()=>{const[e,t]=p.useAtom(sa),s=C.useCallback((n,a={},i={})=>{t({name:n,props:a,modalProps:i})},[t]),o=C.useCallback((...n)=>{l.get(e,"props.onClose",()=>{})(...n),t(os)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},na=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),p.useAtomValue(ee)),ns=p.atom(!1);ns.debugLabel="readOnlyModeAtom";const rs=p.atom("online");rs.debugLabel="networkModeAtom";const ra=p.atom(!1);ra.debugLabel="editLayerNameAtom";const aa=p.atom("");aa.debugLabel="activeLanguageAtom";const ia=p.atom("");ia.debugLabel="primaryLanguageAtom";const as=p.atom(null);as.debugLabel="canvasIframeAtom";const is=p.atom("outline");is.debugLabel="activePanelAtom";const ls=p.atom("");ls.debugLabel="showPredefinedBlockCategoryAtom";const cs=p.atom({undoCount:0,redoCount:0});cs.debugLabel="historyStatesAtom";const ds=p.atom("");ds.debugLabel="inlineEditingActiveAtom";const us=p.atom(!1);us.debugLabel="draggingFlagAtom";const ms=p.atom(null);ms.debugLabel="treeRefAtom";const ps=p.atom({});ps.debugLabel="canvasSettingsAtom";const ot=p.atom(!1);ot.debugLabel="askAiActiveBlockAtom";const la=p.atom(!1);la.debugLabel="codeEditorOpenAtom";const ca=ue("codeEditorHeight",500);ca.debugLabel="codeEditorHeightAtom";const fs=p.atom([]);fs.debugLabel="xShowBlocksAtom";const da=()=>p.useAtomValue(ns),ua=p.atom(""),ma=p.atom(null),pa=()=>p.useAtom(ua),fa=()=>p.useAtom(ma),xa=ue("selectedBreakpoints",["XS","MD","XL"]),ga=()=>{const[e,t]=p.useAtom(xa);return[e,t]},ha=()=>{const e=p.useSetAtom(cs),{clear:t}=et(),[,s]=be(),[,o]=ts(),[,n]=Yt(),[,a]=Nt(ot);return()=>{s([]),n([]),o(""),t(),a(!1),e({undoCount:0,redoCount:0})}},ba=()=>({data:Q("uiLibraries",[]),isLoading:!1}),va=()=>{const[e,t]=C.useState(null),s=C.useCallback(async o=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(o),t(o),!0}catch(n){return console.warn("Copy failed",n),t(null),!1}},[]);return[e,s]},ya=p.atom(null),ja=()=>p.useAtom(ya),xs=ce.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),gs=f.forwardRef(({className:e,variant:t,size:s,...o},n)=>r.jsxRuntimeExports.jsx(wt.Root,{ref:n,className:u.cn(xs({variant:t,size:s,className:e})),...o}));gs.displayName=wt.Root.displayName;const hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Le.Root,{className:u.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:s,children:r.jsxRuntimeExports.jsx(Le.Thumb,{className:u.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));hs.displayName=Le.Root.displayName;const _e=ce.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),bs=f.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...n},a)=>{const i=o?un.Slot:"button";return r.jsxRuntimeExports.jsx(i,{className:u.cn(_e({variant:t,size:s,className:e})),ref:a,...n})});bs.displayName="Button";const wa=le.Root,vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(le.Item,{ref:s,className:u.cn("border-b",e),...t}));vs.displayName="AccordionItem";const ys=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(le.Header,{className:"flex",children:r.jsxRuntimeExports.jsxs(le.Trigger,{ref:o,className:u.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...s,children:[t,s.hideArrow?null:r.jsxRuntimeExports.jsx(Y.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));ys.displayName=le.Trigger.displayName;const js=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(le.Content,{ref:o,className:u.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:r.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));js.displayName=le.Content.displayName;const ka=ce.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ws=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:u.cn(ka({variant:t}),e),...s}));ws.displayName="Alert";const ks=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h5",{ref:s,className:u.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));ks.displayName="AlertTitle";const Cs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("text-sm [&_p]:leading-relaxed",e),...t}));Cs.displayName="AlertDescription";const Rs=ce.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Ca=({className:e,variant:t,...s})=>r.jsxRuntimeExports.jsx("div",{className:u.cn(Rs({variant:t}),e),...s}),Ra=W.Root,Sa=W.Trigger,Ss=({className:e,...t})=>r.jsxRuntimeExports.jsx(W.Portal,{className:u.cn(e),...t});Ss.displayName=W.Portal.displayName;const Es=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(W.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));Es.displayName=W.Overlay.displayName;const As=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs(Ss,{children:[r.jsxRuntimeExports.jsx(Es,{}),r.jsxRuntimeExports.jsx(W.Content,{ref:s,className:u.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));As.displayName=W.Content.displayName;const Ns=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ns.displayName="AlertDialogHeader";const _s=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_s.displayName="AlertDialogFooter";const Bs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(W.Title,{ref:s,className:u.cn("text-lg font-semibold",e),...t}));Bs.displayName=W.Title.displayName;const Ps=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(W.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));Ps.displayName=W.Description.displayName;const Ts=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(W.Action,{ref:s,className:u.cn(_e(),e),...t}));Ts.displayName=W.Action.displayName;const Ms=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(W.Cancel,{ref:s,className:u.cn(_e({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ms.displayName=W.Cancel.displayName;const nt=M.Root,Is=M.Trigger,Ds=({className:e,...t})=>r.jsxRuntimeExports.jsx(M.Portal,{className:u.cn(e),...t});Ds.displayName=M.Portal.displayName;const Ls=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Overlay,{ref:s,className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ls.displayName=M.Overlay.displayName;const Be=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(Ds,{children:[r.jsxRuntimeExports.jsx(Ls,{}),r.jsxRuntimeExports.jsxs(M.Content,{ref:o,className:u.cn("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...s,children:[t,r.jsxRuntimeExports.jsxs(M.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsxRuntimeExports.jsx(Y.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=M.Content.displayName;const Os=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Os.displayName="DialogHeader";const zs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zs.displayName="DialogFooter";const Vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Title,{ref:s,className:u.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));Vs.displayName=M.Title.displayName;const Fs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));Fs.displayName=M.Description.displayName;const Us=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Us.displayName="Card";const qs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("flex flex-col space-y-1.5 p-6",e),...t}));qs.displayName="CardHeader";const Hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h3",{ref:s,className:u.cn("font-semibold leading-none tracking-tight",e),...t}));Hs.displayName="CardTitle";const $s=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("p",{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));$s.displayName="CardDescription";const Gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("p-6 pt-0",e),...t}));Gs.displayName="CardContent";const Ys=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn(" flex items-center p-6 pt-0",e),...t}));Ys.displayName="CardFooter";const Ws=f.forwardRef(({className:e,type:t,...s},o)=>r.jsxRuntimeExports.jsx("input",{type:t,className:u.cn("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",e),ref:o,...s,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));Ws.displayName="Input";const Ea=ce.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ks=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(kt.Root,{ref:s,className:u.cn(Ea(),e),...t}));Ks.displayName=kt.Root.displayName;const Xs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("textarea",{className:u.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...t,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));Xs.displayName="Textarea";const Js=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(ie.Root,{ref:o,className:u.cn("relative overflow-hidden",e),...s,children:[r.jsxRuntimeExports.jsx(ie.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsxRuntimeExports.jsx(rt,{}),r.jsxRuntimeExports.jsx(ie.Corner,{})]}));Js.displayName=ie.Root.displayName;const rt=f.forwardRef(({className:e,orientation:t="vertical",...s},o)=>r.jsxRuntimeExports.jsx(ie.ScrollAreaScrollbar,{ref:o,orientation:t,className:u.cn("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...s,children:r.jsxRuntimeExports.jsx(ie.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));rt.displayName=ie.ScrollAreaScrollbar.displayName;const Zs=de.Root,at=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(de.List,{ref:s,className:u.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));at.displayName=de.List.displayName;const Ce=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(de.Trigger,{ref:s,className:u.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ce.displayName=de.Trigger.displayName;const Re=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(de.Content,{ref:s,className:u.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Re.displayName=de.Content.displayName;const Aa=fe.Portal,Na=fe.Provider,_a=fe.Root,Ba=fe.Trigger,Qs=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(fe.Content,{ref:o,sideOffset:t,className:u.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));Qs.displayName=fe.Content.displayName;const Pa=he.Root,Ta=he.Trigger,eo=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(he.Portal,{children:r.jsxRuntimeExports.jsx(he.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));eo.displayName=he.Content.displayName;const Ma=B.Menu,Ia=B.Group,Da=B.Portal,La=B.Sub,Oa=B.RadioGroup,to=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Root,{ref:s,className:u.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));to.displayName=B.Root.displayName;const so=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Trigger,{ref:s,className:u.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));so.displayName=B.Trigger.displayName;const oo=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(Y.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));oo.displayName=B.SubTrigger.displayName;const no=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));no.displayName=B.SubContent.displayName;const ro=f.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...n},a)=>r.jsxRuntimeExports.jsx(B.Portal,{children:r.jsxRuntimeExports.jsx(B.Content,{ref:a,align:t,alignOffset:s,sideOffset:o,className:u.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ro.displayName=B.Content.displayName;const ao=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(B.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));ao.displayName=B.Item.displayName;const io=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(B.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.CheckIcon,{className:"h-4 w-4"})})}),t]}));io.displayName=B.CheckboxItem.displayName;const lo=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(B.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(B.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));lo.displayName=B.RadioItem.displayName;const co=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(B.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));co.displayName=B.Label.displayName;const uo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));uo.displayName=B.Separator.displayName;const mo=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});mo.displayname="MenubarShortcut";const za=Ee.Root,Va=Ee.Trigger,po=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(Ee.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));po.displayName=Ee.Content.displayName;const Fa=q.Root,Ua=q.Group,qa=q.Value,fo=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(q.Trigger,{ref:o,className:u.cn("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,r.jsxRuntimeExports.jsx(q.Icon,{asChild:!0,children:r.jsxRuntimeExports.jsx(Y.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));fo.displayName=q.Trigger.displayName;const xo=f.forwardRef(({className:e,children:t,position:s="popper",...o},n)=>r.jsxRuntimeExports.jsx(q.Portal,{children:r.jsxRuntimeExports.jsx(q.Content,{ref:n,className:u.cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...o,children:r.jsxRuntimeExports.jsx(q.Viewport,{className:u.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));xo.displayName=q.Content.displayName;const go=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(q.Label,{ref:s,className:u.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));go.displayName=q.Label.displayName;const ho=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(q.Item,{ref:o,className:u.cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(q.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.CheckIcon,{className:"h-4 w-4"})})}),r.jsxRuntimeExports.jsx(q.ItemText,{children:t})]}));ho.displayName=q.Item.displayName;const bo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(q.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));bo.displayName=q.Separator.displayName;const Ha=M.Root,$a=M.Trigger,Ga=M.Close,vo=({className:e,...t})=>r.jsxRuntimeExports.jsx(M.Portal,{className:u.cn(e),...t});vo.displayName=M.Portal.displayName;const yo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));yo.displayName=M.Overlay.displayName;const Ya=ce.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jo=f.forwardRef(({side:e="right",className:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(vo,{children:[r.jsxRuntimeExports.jsx(yo,{}),r.jsxRuntimeExports.jsxs(M.Content,{ref:n,className:u.cn(Ya({side:e}),t),...o,children:[s,r.jsxRuntimeExports.jsxs(M.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[r.jsxRuntimeExports.jsx(Y.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jo.displayName=M.Content.displayName;const wo=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});wo.displayName="SheetHeader";const ko=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ko.displayName="SheetFooter";const Co=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Title,{ref:s,className:u.cn("text-lg font-semibold text-foreground",e),...t}));Co.displayName=M.Title.displayName;const Ro=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(M.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));Ro.displayName=M.Description.displayName;const Wa=D.Root,Ka=D.Trigger,Xa=D.Group,Ja=D.Portal,Za=D.Sub,Qa=D.RadioGroup,So=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(D.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(Y.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));So.displayName=D.SubTrigger.displayName;const Eo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(D.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Eo.displayName=D.SubContent.displayName;const Ao=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(D.Portal,{children:r.jsxRuntimeExports.jsx(D.Content,{ref:o,sideOffset:t,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Ao.displayName=D.Content.displayName;const No=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(D.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));No.displayName=D.Item.displayName;const _o=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(D.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(D.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.CheckIcon,{className:"h-4 w-4"})})}),t]}));_o.displayName=D.CheckboxItem.displayName;const Bo=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(D.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(D.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Bo.displayName=D.RadioItem.displayName;const Po=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(D.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Po.displayName=D.Label.displayName;const To=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(D.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));To.displayName=D.Separator.displayName;const Mo=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});Mo.displayName="DropdownMenuShortcut";const Io=f.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},n)=>r.jsxRuntimeExports.jsx(Ct.Root,{ref:n,decorative:s,orientation:t,className:u.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Io.displayName=Ct.Root.displayName;const ei=1,ti=1e6;let Ie=0;function si(){return Ie=(Ie+1)%Number.MAX_VALUE,Ie.toString()}const De=new Map,vt=e=>{if(De.has(e))return;const t=setTimeout(()=>{De.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},ti);De.set(e,t)},Do=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ei)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?vt(s):e.toasts.forEach(o=>{vt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},je=[];let we={toasts:[]};function ge(e){we=Do(we,e),je.forEach(t=>{t(we)})}function Lo({...e}){const t=si(),s=n=>ge({type:"UPDATE_TOAST",toast:{...n,id:t}}),o=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||o()}}}),{id:t,dismiss:o,update:s}}function Oo(){const[e,t]=f.useState(we);return f.useEffect(()=>(je.push(t),()=>{const s=je.indexOf(t);s>-1&&je.splice(s,1)}),[e]),{...e,toast:Lo,dismiss:s=>ge({type:"DISMISS_TOAST",toastId:s})}}const oi=Z.Provider,zo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Z.Viewport,{ref:s,className:u.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));zo.displayName=Z.Viewport.displayName;const ni=ce.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Vo=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx(Z.Root,{ref:o,className:u.cn(ni({variant:t}),e),...s}));Vo.displayName=Z.Root.displayName;const ri=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Z.Action,{ref:s,className:u.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));ri.displayName=Z.Action.displayName;const Fo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Z.Close,{ref:s,className:u.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsxRuntimeExports.jsx(Y.Cross2Icon,{className:"h-4 w-4"})}));Fo.displayName=Z.Close.displayName;const Uo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Z.Title,{ref:s,className:u.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Uo.displayName=Z.Title.displayName;const qo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(Z.Description,{ref:s,className:u.cn("text-sm opacity-90",e),...t}));qo.displayName=Z.Description.displayName;function ai(){const{toasts:e}=Oo();return r.jsxRuntimeExports.jsxs(oi,{children:[e.map(({id:t,title:s,description:o,action:n,...a})=>r.jsxRuntimeExports.jsxs(Vo,{...a,children:[r.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&r.jsxRuntimeExports.jsx(Uo,{children:s}),o&&r.jsxRuntimeExports.jsx(qo,{children:o})]}),n,r.jsxRuntimeExports.jsx(Fo,{})]},t)),r.jsxRuntimeExports.jsx(zo,{})]})}const ii=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("animate-pulse rounded-md bg-primary/10",e),...t}),it=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(J.Command,{ref:s,className:u.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));it.displayName=J.Command.displayName;const li=({children:e,...t})=>r.jsxRuntimeExports.jsx(nt,{...t,children:r.jsxRuntimeExports.jsx(Be,{className:"overflow-hidden p-0",children:r.jsxRuntimeExports.jsx(it,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ho=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsxRuntimeExports.jsx(Y.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsxRuntimeExports.jsx(J.Command.Input,{ref:s,className:u.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ho.displayName=J.Command.Input.displayName;const $o=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(J.Command.List,{ref:s,className:u.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));$o.displayName=J.Command.List.displayName;const Go=f.forwardRef((e,t)=>r.jsxRuntimeExports.jsx(J.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Go.displayName=J.Command.Empty.displayName;const Yo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(J.Command.Group,{ref:s,className:u.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Yo.displayName=J.Command.Group.displayName;const Wo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(J.Command.Separator,{ref:s,className:u.cn("-mx-1 h-px bg-border",e),...t}));Wo.displayName=J.Command.Separator.displayName;const Ko=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(J.Command.Item,{ref:s,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Ko.displayName=J.Command.Item.displayName;const Xo=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Xo.displayName="CommandShortcut";const ci=L.Root,di=L.Trigger,ui=L.Group,mi=L.Portal,pi=L.Sub,fi=L.RadioGroup,Jo=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(L.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(Y.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Jo.displayName=L.SubTrigger.displayName;const Zo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(L.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Zo.displayName=L.SubContent.displayName;const Qo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(L.Portal,{children:r.jsxRuntimeExports.jsx(L.Content,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));Qo.displayName=L.Content.displayName;const en=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(L.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));en.displayName=L.Item.displayName;const tn=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(L.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(L.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.CheckIcon,{className:"h-4 w-4"})})}),t]}));tn.displayName=L.CheckboxItem.displayName;const sn=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(L.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(L.ItemIndicator,{children:r.jsxRuntimeExports.jsx(Y.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));sn.displayName=L.RadioItem.displayName;const on=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(L.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));on.displayName=L.Label.displayName;const nn=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(L.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-border",e),...t}));nn.displayName=L.Separator.displayName;const rn=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});rn.displayName="ContextMenuShortcut";const xi=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");En.render(r.jsxRuntimeExports.jsx(jt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),100);const a=new DOMParser().parseFromString(o,"image/svg+xml"),i=a.querySelector("svg");return i&&(i.removeAttribute("width"),i.removeAttribute("height")),new XMLSerializer().serializeToString(a)}catch(t){return console.error(t),""}},gi=({value:e,onChange:t})=>{const s=o=>{t("<svg />");const n=xi(o);t(n)};return r.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[r.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e?e.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),r.jsxRuntimeExports.jsx(jt,{value:e?"BiSolidGrid":null,onChange:s,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),r.jsxRuntimeExports.jsx("textarea",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",value:e,onChange:o=>t(o.target.value),className:"h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},hi=C.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-6UjgojvF.cjs"))),bi=C.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-3h0cRsvr.cjs"))),an=({isModalView:e=!1,onSelect:t=()=>{}})=>{const s=Q("uploadMediaCallback"),o=Q("unsplashAccessKey"),n=s===void 0,a=o===void 0,[i,d]=C.useState(a?"upload":n?"unsplash":"upload");return r.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[r.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e&&n?"Unsplash images":e?"Select or upload images":"Images"})}),r.jsxRuntimeExports.jsxs(Zs,{value:i,onValueChange:x=>d(x),className:"flex h-full w-full flex-col py-2",children:[!(n||a)&&r.jsxRuntimeExports.jsxs(at,{className:"w-full",children:[r.jsxRuntimeExports.jsx(Ce,{value:"upload",className:"w-full",children:"Upload"}),r.jsxRuntimeExports.jsx(Ce,{value:"unsplash",className:"w-full",children:"Unsplash"})]}),i==="unsplash"?r.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(C.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(hi,{isModalView:e,onSelect:t})})}):r.jsxRuntimeExports.jsx(Re,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(C.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(bi,{isModalView:e,onSelect:t})})})]})]})},vi=Object.freeze(Object.defineProperty({__proto__:null,default:an},Symbol.toStringTag,{value:"Module"})),yt=({children:e,onSelect:t})=>{const[s,o]=C.useState(!1),n=(...a)=>{t.call(void 0,...a),o(!1)};return r.jsxRuntimeExports.jsxs(nt,{open:s,onOpenChange:a=>o(a),children:[r.jsxRuntimeExports.jsx(Is,{asChild:!0,children:e}),r.jsxRuntimeExports.jsx(Be,{className:"flex h-3/4 max-w-5xl",children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:r.jsxRuntimeExports.jsx(an,{isModalView:!0,onSelect:n})})})]})},yi=({value:e,onChange:t,id:s,onBlur:o})=>{const n=Q("uploadMediaCallback"),a=Q("unsplashAccessKey"),i=n===void 0,d=a===void 0;return r.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?r.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):r.jsxRuntimeExports.jsx(yt,{onSelect:t,children:r.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[!(i&&d)&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(yt,{onSelect:t,children:r.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:e||!l.isEmpty(e)?"Replace Image":"Choose Image"})}),r.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),r.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:x}})=>o(s,x),onChange:x=>t(x.target.value)})]})]})},ji=({id:e,placeholder:t,value:s,onChange:o,onBlur:n})=>{const a={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},i=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:r.jsxRuntimeExports.jsx(An,{id:e,value:s,onBlur:d=>n(e,d),onChange:d=>o(d),modules:a,formats:i,placeholder:t,className:"mt-1 rounded-md"})},wi=({schema:e,formData:t,onChange:s})=>{const[o,n]=C.useState([]),a=Q("getPages",()=>[]),{type:i="page",href:d="",target:x="self"}=t;return C.useEffect(()=>{(async()=>{const c=await a();n(c||[])})()},[]),r.jsxRuntimeExports.jsxs("div",{children:[r.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[r.jsxRuntimeExports.jsx("select",{name:"type",value:i,onChange:c=>s({...t,type:c.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(c=>r.jsxRuntimeExports.jsx("option",{value:c.const,children:c.title},c.const))}),i==="page"?r.jsxRuntimeExports.jsxs("select",{name:"href",value:d,onChange:c=>s({...t,href:c.target.value||"#"}),children:[r.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),l.map(o,c=>r.jsxRuntimeExports.jsx("option",{value:c.slug,children:c.name},c.uuid))]}):r.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",name:"href",type:"text",value:d,onChange:c=>s({...t,href:c.target.value||"#"}),placeholder:i==="page"||i==="url"?"Enter URL":i==="scroll"?"#ElementID":"Enter detail"}),(i==="page"||i==="url")&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"checkbox",defaultChecked:x==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:x==="_blank"?"_self":"_blank"})}),r.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.Accordion=wa;exports.AccordionContent=js;exports.AccordionItem=vs;exports.AccordionTrigger=ys;exports.Alert=ws;exports.AlertDescription=Cs;exports.AlertDialog=Ra;exports.AlertDialogAction=Ts;exports.AlertDialogCancel=Ms;exports.AlertDialogContent=As;exports.AlertDialogDescription=Ps;exports.AlertDialogFooter=_s;exports.AlertDialogHeader=Ns;exports.AlertDialogTitle=Bs;exports.AlertDialogTrigger=Sa;exports.AlertTitle=ks;exports.Badge=Ca;exports.Button=bs;exports.Card=Us;exports.CardContent=Gs;exports.CardDescription=$s;exports.CardFooter=Ys;exports.CardHeader=qs;exports.CardTitle=Hs;exports.Command=it;exports.CommandDialog=li;exports.CommandEmpty=Go;exports.CommandGroup=Yo;exports.CommandInput=Ho;exports.CommandItem=Ko;exports.CommandList=$o;exports.CommandSeparator=Wo;exports.CommandShortcut=Xo;exports.ContextMenu=ci;exports.ContextMenuCheckboxItem=tn;exports.ContextMenuContent=Qo;exports.ContextMenuGroup=ui;exports.ContextMenuItem=en;exports.ContextMenuLabel=on;exports.ContextMenuPortal=mi;exports.ContextMenuRadioGroup=fi;exports.ContextMenuRadioItem=sn;exports.ContextMenuSeparator=nn;exports.ContextMenuShortcut=rn;exports.ContextMenuSub=pi;exports.ContextMenuSubContent=Zo;exports.ContextMenuSubTrigger=Jo;exports.ContextMenuTrigger=di;exports.Dialog=nt;exports.DialogContent=Be;exports.DialogDescription=Fs;exports.DialogFooter=zs;exports.DialogHeader=Os;exports.DialogTitle=Vs;exports.DialogTrigger=Is;exports.DropdownMenu=Wa;exports.DropdownMenuCheckboxItem=_o;exports.DropdownMenuContent=Ao;exports.DropdownMenuGroup=Xa;exports.DropdownMenuItem=No;exports.DropdownMenuLabel=Po;exports.DropdownMenuPortal=Ja;exports.DropdownMenuRadioGroup=Qa;exports.DropdownMenuRadioItem=Bo;exports.DropdownMenuSeparator=To;exports.DropdownMenuShortcut=Mo;exports.DropdownMenuSub=Za;exports.DropdownMenuSubContent=Eo;exports.DropdownMenuSubTrigger=So;exports.DropdownMenuTrigger=Ka;exports.HoverCard=za;exports.HoverCardContent=po;exports.HoverCardTrigger=Va;exports.IconPickerField=gi;exports.ImagePickerField=yi;exports.ImagesPanel=vi;exports.Input=Ws;exports.Label=Ks;exports.LinkField=wi;exports.Menubar=to;exports.MenubarCheckboxItem=io;exports.MenubarContent=ro;exports.MenubarGroup=Ia;exports.MenubarItem=ao;exports.MenubarLabel=co;exports.MenubarMenu=Ma;exports.MenubarPortal=Da;exports.MenubarRadioGroup=Oa;exports.MenubarRadioItem=lo;exports.MenubarSeparator=uo;exports.MenubarShortcut=mo;exports.MenubarSub=La;exports.MenubarSubContent=no;exports.MenubarSubTrigger=oo;exports.MenubarTrigger=so;exports.Popover=Pa;exports.PopoverContent=eo;exports.PopoverTrigger=Ta;exports.RichTextEditorField=ji;exports.ScrollArea=Js;exports.ScrollBar=rt;exports.Select=Fa;exports.SelectContent=xo;exports.SelectGroup=Ua;exports.SelectItem=ho;exports.SelectLabel=go;exports.SelectSeparator=bo;exports.SelectTrigger=fo;exports.SelectValue=qa;exports.Separator=Io;exports.Sheet=Ha;exports.SheetClose=Ga;exports.SheetContent=jo;exports.SheetDescription=Ro;exports.SheetFooter=ko;exports.SheetHeader=wo;exports.SheetTitle=Co;exports.SheetTrigger=$a;exports.Skeleton=ii;exports.Switch=hs;exports.Tabs=Zs;exports.TabsContent=Re;exports.TabsList=at;exports.TabsTrigger=Ce;exports.Textarea=Xs;exports.Toaster=ai;exports.Toggle=gs;exports.Tooltip=_a;exports.TooltipContent=Qs;exports.TooltipPortal=Aa;exports.TooltipProvider=Na;exports.TooltipTrigger=Ba;exports.activePanelAtom=is;exports.aiAssistantActiveAtom=ot;exports.atom=ne;exports.atomWithDefault=Un;exports.atomWithStorage=ue;exports.badgeVariants=Rs;exports.builderSaveStateAtom=Ne;exports.buttonVariants=_e;exports.canAcceptChildBlock=Oe;exports.canDeleteBlock=tr;exports.canDuplicateBlock=er;exports.canvasIframeAtom=as;exports.canvasSettingsAtom=ps;exports.chaiBuilderPropsAtom=Ze;exports.chaiExternalDataAtom=$t;exports.convertDotNotationToObject=lr;exports.createStore=Rt;exports.dataProvidersAtom=Qe;exports.draggingFlagAtom=us;exports.getBlockJSONFromSchemas=Ve;exports.getBlockJSONFromUISchemas=ze;exports.inlineEditingActiveAtom=ds;exports.isDevelopment=Ur;exports.networkModeAtom=rs;exports.presentBlocksAtom=ee;exports.reducer=Do;exports.showPredefinedBlockCategoryAtom=ls;exports.toast=Lo;exports.toggleVariants=xs;exports.treeDSBlocks=Tt;exports.treeRefAtom=ms;exports.useActiveModal=oa;exports.useActivePanel=pa;exports.useAddBlock=Cr;exports.useAddBlockParent=fa;exports.useAddClassesToBlocks=Nr;exports.useAllBlocks=na;exports.useAtom=Nt;exports.useAtomValue=Et;exports.useBlocksContainer=pr;exports.useBlocksStore=me;exports.useBlocksStoreUndoableActions=te;exports.useBrandingOptions=Ke;exports.useBuilderProp=Q;exports.useBuilderReset=ha;exports.useCanvasWidth=_r;exports.useCanvasZoom=Pr;exports.useCodeEditor=ja;exports.useCopyBlockIds=Tr;exports.useCopyToClipboard=va;exports.useCurrentPage=zt;exports.useCutBlockIds=Zt;exports.useDarkMode=Mr;exports.useDuplicateBlocks=es;exports.useGetPageData=Ht;exports.useHiddenBlockIds=Dr;exports.useHighlightBlockId=ts;exports.usePageDataProviders=Gt;exports.usePasteBlocks=zr;exports.usePreviewMode=Fr;exports.useReadOnlyMode=da;exports.useRemoveBlocks=br;exports.useRemoveClassesFromBlocks=$r;exports.useSavePage=hr;exports.useSelectedBlock=rr;exports.useSelectedBlockAllClasses=Gr;exports.useSelectedBlockCurrentClasses=Kr;exports.useSelectedBlockIds=be;exports.useSelectedBlocksDisplayChild=nr;exports.useSelectedBreakpoints=ga;exports.useSelectedStylingBlocks=Yt;exports.useSetAtom=At;exports.useStore=qe;exports.useStreamMultipleBlocksProps=ea;exports.useStylingBreakpoint=Wt;exports.useStylingState=Xr;exports.useToast=Oo;exports.useUILibraryBlocks=ba;exports.useUndoManager=et;exports.useUpdateBlocksProps=Jr;exports.useUpdateBlocksPropsRealtime=ta;exports.useUpdateMultipleBlocksProps=Zr;exports.xShowBlocksAtom=fs;