@chaibuilder/sdk 1.0.21 → 1.0.23
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.
- package/README.md +30 -103
- package/dist/{AddBlocks-0-e393Fn.js → AddBlocks-Izn_rxXD.js} +5 -4
- package/dist/AddBlocks-RHuwwfe5.cjs +3 -0
- package/dist/{BrandingOptions-HtNCJO9_.cjs → BrandingOptions-Fyo8qs4o.cjs} +1 -1
- package/dist/{BrandingOptions-QqqJ-YRb.js → BrandingOptions-orZyDGiL.js} +1 -1
- package/dist/{CanvasArea-0hMAhzxn.js → CanvasArea-C30uJLef.js} +72 -71
- package/dist/{CanvasArea-pZz5czrV.cjs → CanvasArea-IM2K8bud.cjs} +2 -2
- package/dist/{CurrentPage-UOkxZISs.js → CurrentPage-70sBzc2_.js} +6 -5
- package/dist/CurrentPage-lIithDJy.cjs +1 -0
- package/dist/{Layers-TB-Lriju.js → Layers-W0N2zfnf.js} +7 -6
- package/dist/Layers-YMtavzUG.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-5h3wP4zj.cjs → MarkAsGlobalBlock-EOsABFjY.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-Pa8po8qP.js → MarkAsGlobalBlock-FPCQmRIh.js} +1 -1
- package/dist/{PagesPanel-mAMSbYPt.js → PagesPanel-RbHN6lvQ.js} +6 -5
- package/dist/{PagesPanel-ffrNyFyp.cjs → PagesPanel-i-MQEmm_.cjs} +1 -1
- package/dist/ProjectPanel-0BGx-hP-.cjs +1 -0
- package/dist/{ProjectPanel-XvsYajju.js → ProjectPanel-CzwuyR0N.js} +7 -6
- package/dist/{Settings-8AbHXcDP.js → Settings-lxTrbI-C.js} +330 -320
- package/dist/Settings-mTWkKG82.cjs +1 -0
- package/dist/{SidePanels-LQg3mdC4.js → SidePanels-g4M6oTs-.js} +7 -6
- package/dist/SidePanels-pUOJTYfr.cjs +1 -0
- package/dist/{Topbar-wA6jhMj9.js → Topbar-KqZt4TEY.js} +1 -1
- package/dist/{Topbar-A3WZDrK4.cjs → Topbar-kHffytzr.cjs} +1 -1
- package/dist/{UnsplashImages-mzIO1QeT.js → UnsplashImages-Ua7ksJ8c.js} +1 -1
- package/dist/{UnsplashImages-E8zPMgJf.cjs → UnsplashImages-y7I_7_W7.cjs} +1 -1
- package/dist/{UploadImages-qEuDUEMn.cjs → UploadImages-RzEm0Stb.cjs} +1 -1
- package/dist/{UploadImages-qMeaY4sk.js → UploadImages-YP_J6erG.js} +1 -1
- package/dist/{add-page-modal-oER3yE4F.js → add-page-modal-btGWaXyq.js} +18 -18
- package/dist/add-page-modal-ekFis5D8.cjs +1 -0
- package/dist/{confirm-alert-rDSai_jQ.js → confirm-alert-Py2WqZhJ.js} +1 -1
- package/dist/{confirm-alert-tH8UCCSF.cjs → confirm-alert-mAhT8vln.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -55
- package/dist/{delete-page-modal-ShTRkqkB.cjs → delete-page-modal-QzleoJG2.cjs} +1 -1
- package/dist/{delete-page-modal-QzQdrLYI.js → delete-page-modal-Rq4ThQpu.js} +6 -5
- package/dist/{form-vWeEsG9Y.js → form-Lm3bupAq.js} +1 -1
- package/dist/{form-MlgUSEy_.cjs → form-kAjrBaV-.cjs} +1 -1
- package/dist/{functions-hmbWDcnW.js → functions-JFP-oMsY.js} +28 -27
- package/dist/{functions-eu6BbvqO.cjs → functions-KMQYiBHf.cjs} +2 -2
- package/dist/{index-G55KtqnU.js → index-Vx4ctSV6.js} +10 -20
- package/dist/{index-T5MFAHA0.cjs → index-W5drgyWI.cjs} +1 -1
- package/dist/{index-mLIwGF5W.js → index-WPlT_Q87.js} +3 -3
- package/dist/{index-pCHSFoQO.cjs → index-fvoD_laH.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +3 -9
- package/dist/lib.js +93 -152
- package/dist/page-viewer-AlOCzh1b.cjs +1 -0
- package/dist/{page-viewer-X3IEOrUC.js → page-viewer-_wGsV2_o.js} +29 -28
- package/dist/{project-general-setting-oujmeWOG.js → project-general-setting-B8uuHccU.js} +7 -6
- package/dist/{project-general-setting-HZeYf9A1.cjs → project-general-setting-XnNyOpXO.cjs} +1 -1
- package/dist/{project-seo-setting-3FZQXaTn.cjs → project-seo-setting-QJBATF59.cjs} +1 -1
- package/dist/{project-seo-setting-_X6ckVa4.js → project-seo-setting-Zg2Z-Frr.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{single-page-detail-SxboE7TI.js → single-page-detail-HXpxgQnU.js} +8 -7
- package/dist/single-page-detail-MWh30E_-.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -4
- package/dist/tailwind-config-OxLD7oFU.cjs +1 -0
- package/dist/tailwind-config-d1VL1lzE.js +62 -0
- package/dist/tailwind.cjs +1 -0
- package/dist/tailwind.d.ts +80 -0
- package/dist/tailwind.js +24 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +9 -4
- package/dist/AddBlocks-p68Cz79o.cjs +0 -3
- package/dist/CurrentPage-phMDH1Ub.cjs +0 -1
- package/dist/Layers-NKZXi2LV.cjs +0 -1
- package/dist/ProjectPanel-1ywILLme.cjs +0 -1
- package/dist/Settings-hdmnT_mI.cjs +0 -1
- package/dist/SidePanels-xaNrI3oK.cjs +0 -1
- package/dist/add-page-modal-9deiA1W9.cjs +0 -1
- package/dist/page-viewer-GPNN1H92.cjs +0 -1
- package/dist/single-page-detail-ILshOKys.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-WUGKV8jN.cjs"),w=require("react"),mn=require("@radix-ui/react-toggle"),re=require("class-variance-authority"),c=require("./utils-It2K33fU.cjs"),pn=require("@radix-ui/react-switch"),fn=require("@radix-ui/react-slot"),xn=require("@radix-ui/react-accordion"),O=require("@radix-ui/react-icons"),gn=require("@radix-ui/react-alert-dialog"),bn=require("@radix-ui/react-dialog"),hn=require("@radix-ui/react-label"),vn=require("@radix-ui/react-scroll-area"),yn=require("@radix-ui/react-tabs"),jn=require("@radix-ui/react-tooltip"),wn=require("@radix-ui/react-popover"),Rn=require("@radix-ui/react-menubar"),kn=require("@radix-ui/react-hover-card"),An=require("@radix-ui/react-select"),Nn=require("@radix-ui/react-dropdown-menu"),Sn=require("@radix-ui/react-separator"),Cn=require("@radix-ui/react-toast"),F=require("cmdk"),En=require("@radix-ui/react-context-menu"),vt=require("react-icons-picker"),_n=require("react-dom"),i=require("lodash"),Bn=require("react-quill"),d=require("jotai"),yt=require("flat-to-nested"),fe=require("redux-undo"),$=require("./MODIFIERS-WFzDQfiT.cjs"),Pn=require("@chaibuilder/runtime"),Tn=require("@react-hookz/web");require("react-i18next");function D(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 x=D(w),jt=D(mn),Le=D(pn),ae=D(xn),V=D(gn),_=D(bn),wt=D(hn),oe=D(vn),ie=D(yn),de=D(jn),ge=D(wn),C=D(Rn),ke=D(kn),M=D(An),B=D(Nn),Rt=D(Sn),U=D(Cn),P=D(En);var L={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let In=0;function K(e,t){const s=`atom${++In}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=a=>a(o),o.write=(a,r,l)=>r(o,typeof l=="function"?l(a(o)):l)),t&&(o.write=t),o}const Pe=e=>"init"in e,Te=e=>!!e.write,je=new WeakMap,Mn=(e,t)=>{je.set(e,t),e.catch(()=>{}).finally(()=>je.delete(e))},at=(e,t)=>{const s=je.get(e);s&&(je.delete(e),s(t))},rt=(e,t)=>{e.status="fulfilled",e.value=t},it=(e,t)=>{e.status="rejected",e.reason=t},Dn=e=>typeof(e==null?void 0:e.then)=="function",pe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),lt=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ce=e=>"v"in e&&e.v instanceof Promise,Ln=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,he=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,a,r;(L?"production":void 0)!=="production"&&(o=new Set,a=new Set,r=new Set);const l=m=>e.get(m),p=(m,b)=>{(L?"production":void 0)!=="production"&&Object.freeze(b);const y=e.get(m);if(e.set(m,b),s.has(m)||s.set(m,y),y&&ce(y)){const h="v"in b?b.v instanceof Promise?b.v:Promise.resolve(b.v):Promise.reject(b.e);at(y.v,h)}},f=(m,b,y)=>{const h=new Map;let j=!1;y.forEach((v,k)=>{!v&&k===m&&(v=b),v?(h.set(k,v),b.d.get(k)!==v&&(j=!0)):(L?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(j||b.d.size!==h.size)&&(b.d=h)},u=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,v:b};if(y&&f(m,j,y),h&&pe(h,j)&&h.d===j.d)return h;if(h&&ce(h)&&ce(j)&&Ln(h,j)){if(h.d===j.d)return h;j.v=h.v}return p(m,j),j},g=(m,b,y,h)=>{if(Dn(b)){let j;const v=new Promise((k,T)=>{let N=!1;b.then(E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);rt(v,E),k(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}},E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);it(v,E),T(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}}),j=E=>{N||(N=!0,E.then(S=>rt(v,S),S=>it(v,S)),k(E))}});return v.orig=b,v.status="pending",Mn(v,k=>{k&&j(k),h==null||h()}),u(m,v,y)}return u(m,b,y)},R=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,e:b};return y&&f(m,j,y),h&<(h,j)&&h.d===j.d?h:(p(m,j),j)},A=m=>{const b=l(m);if(b&&(b.d.forEach((N,E)=>{E!==m&&!t.has(E)&&A(E)}),Array.from(b.d).every(([N,E])=>{const S=l(N);return N===m||S===E||S&&!ce(S)&&pe(S,E)})))return b;const y=new Map;let h=!0;const j=N=>{if(N===m){const S=l(N);if(S)return y.set(N,S),he(S);if(Pe(N))return y.set(N,void 0),N.init;throw new Error("no atom init")}const E=A(N);return y.set(N,E),he(E)};let v,k;const T={get signal(){return v||(v=new AbortController),v.signal},get setSelf(){return(L?"production":void 0)!=="production"&&!Te(m)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&Te(m)&&(k=(...N)=>{if((L?"production":void 0)!=="production"&&h&&console.warn("setSelf function cannot be called in sync"),!h)return Q(m,...N)}),k}};try{const N=m.read(j,T);return g(m,N,y,()=>v==null?void 0:v.abort())}catch(N){return R(m,N,y)}finally{h=!1}},I=m=>he(A(m)),z=m=>{let b=t.get(m);return b||(b=Y(m)),b},W=(m,b)=>!b.l.size&&(!b.t.size||b.t.size===1&&b.t.has(m)),X=m=>{const b=t.get(m);b&&W(m,b)&&se(m)},le=m=>{const b=new Map,y=new WeakMap,h=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{T!==v&&(b.set(T,(b.get(T)||new Set).add(v)),y.set(T,(y.get(T)||0)+1),h(T))})};h(m);const j=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{var N;if(T!==v){let E=y.get(T);if(E&&y.set(T,--E),!E){let S=!!((N=b.get(T))!=null&&N.size);if(S){const J=l(T),un=A(T);S=!J||!pe(J,un)}S||b.forEach(J=>J.delete(T))}j(T)}})};j(m)},Z=(m,...b)=>{let y=!0;const h=k=>he(A(k)),j=(k,...T)=>{let N;if(k===m){if(!Pe(k))throw new Error("atom not writable");const E=l(k),S=g(k,T[0]);(!E||!pe(E,S))&&le(k)}else N=Z(k,...T);if(!y){const E=ee();(L?"production":void 0)!=="production"&&a.forEach(S=>S({type:"async-write",flushed:E}))}return N},v=m.write(h,j,...b);return y=!1,v},Q=(m,...b)=>{const y=Z(m,...b),h=ee();return(L?"production":void 0)!=="production"&&a.forEach(j=>j({type:"write",flushed:h})),y},Y=(m,b)=>{const y={t:new Set(b&&[b]),l:new Set};if(t.set(m,y),(L?"production":void 0)!=="production"&&r.add(m),A(m).d.forEach((h,j)=>{const v=t.get(j);v?v.t.add(m):j!==m&&Y(j,m)}),A(m),Te(m)&&m.onMount){const h=m.onMount((...j)=>Q(m,...j));h&&(y.u=h)}return y},se=m=>{var b;const y=(b=t.get(m))==null?void 0:b.u;y&&y(),t.delete(m),(L?"production":void 0)!=="production"&&r.delete(m);const h=l(m);h?(ce(h)&&at(h.v),h.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}})):(L?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},q=(m,b,y)=>{const h=new Set(b.d.keys());y==null||y.forEach((j,v)=>{if(h.has(v)){h.delete(v);return}const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}),h.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&Y(j,m)})},ee=()=>{let m;for((L?"production":void 0)!=="production"&&(m=new Set);s.size;){const b=Array.from(s);s.clear(),b.forEach(([y,h])=>{const j=l(y);if(j){j.d!==(h==null?void 0:h.d)&&q(y,j,h==null?void 0:h.d);const v=t.get(y);v&&!(h&&!ce(h)&&(pe(h,j)||lt(h,j)))&&(v.l.forEach(k=>k()),(L?"production":void 0)!=="production"&&m.add(y))}else(L?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((L?"production":void 0)!=="production")return o.forEach(b=>b("state")),m},te=(m,b)=>{const y=z(m),h=ee(),j=y.l;return j.add(b),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),a.forEach(v=>v({type:"sub",flushed:h}))),()=>{j.delete(b),X(m),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),a.forEach(v=>v({type:"unsub"})))}};return(L?"production":void 0)!=="production"?{get:I,set:Q,sub:te,dev_subscribe_store:(m,b)=>b!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(a.add(m),()=>{a.delete(m)}),dev_get_mounted_atoms:()=>r.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[y,h]of m)Pe(y)&&(g(y,h),le(y));const b=ee();a.forEach(y=>y({type:"restore",flushed:b}))}}:{get:I,set:Q,sub:te}};let Ie;const On=()=>(Ie||(Ie=kt()),Ie);var Vn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zn=w.createContext(void 0),Fe=e=>{const t=w.useContext(zn);return(e==null?void 0:e.store)||t||On()};const $n=e=>typeof(e==null?void 0:e.then)=="function",Fn=w.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 At(e,t){const s=Fe(t),[[o,a,r],l]=w.useReducer(u=>{const g=s.get(e);return Object.is(u[0],g)&&u[1]===s&&u[2]===e?u:[g,s,e]},void 0,()=>[s.get(e),s,e]);let p=o;(a!==s||r!==e)&&(l(),p=s.get(e));const f=t==null?void 0:t.delay;return w.useEffect(()=>{const u=s.sub(e,()=>{if(typeof f=="number"){setTimeout(l,f);return}l()});return l(),u},[s,e,f]),w.useDebugValue(p),$n(p)?Fn(p):p}function Nt(e,t){const s=Fe(t);return w.useCallback((...a)=>{if((Vn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...a)},[s,e])}function qn(e,t){return[At(e,t),Nt(e,t)]}var qe={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const St=Symbol();function Un(e,t){const s=K(e,(o,a,r)=>a(s,t(o(s),r)));return s}const ct=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Gn=new WeakMap,Hn=(e,t,s)=>{const o=ct(()=>new WeakMap,Gn,t);return ct(e,o,s)},Wn={},dt=e=>!!e.write,Yn=e=>typeof e=="function";function Kn(e,t){return Hn(()=>{const s=new WeakMap,o=(l,p)=>{let f=s.get(l);if(f)return f;const u=p&&s.get(p),g=[],R=[];return l.forEach((A,I)=>{const z=t?t(A):I;R[I]=z;const W=u&&u.atomList[u.keyList.indexOf(z)];if(W){g[I]=W;return}const X=Z=>{const Q=Z(a),Y=Z(e),q=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(z);if(q<0||q>=Y.length){const ee=l[o(l).keyList.indexOf(z)];if(ee)return ee;throw new Error("splitAtom: index out of bounds for read")}return Y[q]},le=(Z,Q,Y)=>{const se=Z(a),q=Z(e),te=o(q,se==null?void 0:se.arr).keyList.indexOf(z);if(te<0||te>=q.length)throw new Error("splitAtom: index out of bounds for write");const m=Yn(Y)?Y(q[te]):Y;Q(e,[...q.slice(0,te),m,...q.slice(te+1)])};g[I]=dt(e)?K(X,le):K(X)}),u&&u.keyList.length===R.length&&u.keyList.every((A,I)=>A===R[I])?f=u:f={arr:l,atomList:g,keyList:R},s.set(l,f),f},a=K(l=>{const p=l(a),f=l(e);return o(f,p==null?void 0:p.arr)});(qe?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.init=void 0;const r=dt(e)?K(l=>l(a).atomList,(l,p,f)=>{switch(f.type){case"remove":{const u=l(r).indexOf(f.atom);if(u>=0){const g=l(e);p(e,[...g.slice(0,u),...g.slice(u+1)])}break}case"insert":{const u=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0){const g=l(e);p(e,[...g.slice(0,u),f.value,...g.slice(u)])}break}case"move":{const u=l(r).indexOf(f.atom),g=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0&&g>=0){const R=l(e);u<g?p(e,[...R.slice(0,u),...R.slice(u+1,g),R[u],...R.slice(g)]):p(e,[...R.slice(0,g),R[u],...R.slice(g,u),...R.slice(u+1)])}break}}}):K(l=>l(a).atomList);return r},e,t||Wn)}function Jn(e){const t=Symbol(),s=K(t);(qe?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=K((a,r)=>{const l=a(s);return l!==t?l:e(a,r)},(a,r,l)=>{if(l===St)r(s,t);else if(typeof l=="function"){const p=a(o);r(s,l(p))}else r(s,l)});return o}const Qn=e=>typeof(e==null?void 0:e.then)=="function";function Xn(e){let t,s;const o={getItem:(a,r)=>{var l,p;const f=g=>{if(g=g||"",t!==g){try{s=JSON.parse(g)}catch{return r}t=g}return s},u=(p=(l=e())==null?void 0:l.getItem(a))!=null?p:null;return Qn(u)?u.then(f):f(u)},setItem:(a,r)=>{var l;return(l=e())==null?void 0:l.setItem(a,JSON.stringify(r))},removeItem:a=>{var r;return(r=e())==null?void 0:r.removeItem(a)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(a,r,l)=>{if(!(e()instanceof window.Storage))return()=>{};const p=f=>{if(f.storageArea===e()&&f.key===a){let u;try{u=JSON.parse(f.newValue||"")}catch{u=l}r(u)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const Zn=Xn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=Zn,o){const a=o==null?void 0:o.unstable_getOnInit,r=K(a?s.getItem(e,t):t);return(qe?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=p=>{a||p(s.getItem(e,t));let f;return s.subscribe&&(f=s.subscribe(e,p,t)),f},K(p=>p(r),(p,f,u)=>{const g=typeof u=="function"?u(p(r)):u;return g===St?(f(r,t),s.removeItem(e)):g instanceof Promise?g.then(R=>(f(r,R),s.setItem(e,R))):(f(r,g),s.setItem(e,g))})}const Ae=d.atom(null);Ae.debugLabel="chaiBuilderPropsAtom";const Ct=d.atom({});Ct.debugLabel="chaiExternalDataAtom";const ea=()=>!1,ta=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const sa=new yt({children:"blockNodes"}),Et=(e,t=null)=>i.flatten(e.map(s=>{if(s=t!==null?{...s,parent:t}:s,s.children&&s.children.length){const o=[...s.children];return delete s.children,i.flatten([s,...Et(o,s._id)])}return s}));function _t(e,t,s){const o=i.filter(e,r=>r._parent===t),a=[];for(let r=0;r<o.length;r++){const l=Bt(o[r]);if(Object.keys(l).length>0&&Object.keys(l).forEach(p=>{o[r][p]=`slot:${c.generateUUID()}`}),i.filter(e,{_parent:o[r]._id}).length>0){const p=c.generateUUID();a.push({...o[r],oldId:o[r]._id,_id:p,_parent:s}),a.push(i.flatten(_t(e,o[r]._id,p)))}else a.push({...o[r],oldId:o[r]._id,_id:c.generateUUID(),_parent:s})}return i.flatten(a)}function oa(e){let t=sa.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const Bt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},na=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:c.generateUUID()},s&&(o={...o,_parent:s});const a=[o];i.filter(e,{_parent:t}).length>0&&a.push(i.flatten(_t(e,t,o._id)));const r=i.flatten(a);return i.map(r,l=>{const p=l,f=Bt(p);return Object.keys(f).length>0&&Object.keys(f).forEach(u=>{const g=i.find(r,{oldId:f[u].replace("slot:","")});p[u]=`slot:${g._id}`}),i.omit(p,["global","oldId"])})};const aa=fe((e=[],t)=>{switch(t.type){case"add_new_blocks":case"add_duplicate_blocks":return[...e,...t.payload];case"create_snapshot":return[...e];case"set_blocks":case"set_page_blocks":return[...t.payload];case"update_props":case"update_props_realtime":const{payload:s}=t;return e.map(o=>(s.ids.includes(o._id)&&!i.isEmpty(t.payload.props)&&Object.keys(t.payload.props).forEach(a=>{i.set(o,a,t.payload.props[a])}),o));default:return e}},{debug:!1,ignoreInitialState:!1,limit:30,filter:fe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Ne=Un({past:[],present:[],future:[]},aa);Ne.debugLabel="pageBlocksAtom";const G=d.atom(e=>{var t;return(t=e(Ne))==null?void 0:t.present});G.debugLabel="presentBlocksAtom";const Ue=Kn(G);Ue.debugLabel="pageBlocksAtomsAtom";const Pt=d.atom(e=>oa(e(G)));Pt.debugLabel="pageBlocksTreeAtom";const ra=d.atom("");ra.debugLabel="builderActivePageAtom";const ia=d.atom(-1);ia.debugLabel="destinationDropIndexAtom";const Tt=d.atom(!1);Tt.debugLabel="addBlocksModalAtom";const It=d.atom([]);It.debugLabel="buildingBlocksAtom";const Mt=d.atom(e=>{const t=e(It);return i.filter(t,s=>i.has(s,"blockId"))});Mt.debugLabel="globalBlocksAtom";const H=()=>{const[,e]=d.useAtom(Ne);return e},la=()=>{const e=H(),t=d.useAtomValue(Pt),s=w.useCallback(o=>{const a=Et(o);e({type:"set_page_blocks",payload:a})},[e]);return[t,s]},ca=()=>{const e=H();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},Oe=e=>["Box","Slot","Form","DataProvider","Link","List","ListItem","Row","Column","Table","TableCell"].includes(e),da=e=>!["Slot"].includes(e),ua=e=>!["Slot"].includes(e);function ma(e,t){return e==="Slot"||t==="List"&&e!=="ListItem"||t==="Row"&&e!=="Column"?!1:Oe(t)}const pa=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),a=i.get(s,"data._type","");return o==="Slot"||i.get(t,"id")&&i.get(t,"id")===i.get(s,"id")?!1:i.isEmpty(a)?!0:ma(o,a)},Ge=d.atom([]);Ge.debugLabel="selectedBlockIdsAtom";const He=d.atom(e=>{const t=e(G),s=e(Ge);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});He.debugLabel="selectedBlocksAtom";const We=d.atom(e=>{const t=e(He);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const fa=e=>i.get(e,"parent",null),xa=d.atom(e=>{const t=e(He),s=i.map(t,fa);return i.filter(e(G),o=>i.includes(s,o._id))});xa.debugLabel="selectedBlocksParentsAtom";const Dt=d.atom(()=>!1);Dt.debugLabel="selectedBlockFlexChildAtom";const Lt=d.atom(()=>!1);Lt.debugLabel="selectedBlockGridChildAtom";const Ye=d.atom("");Ye.debugLabel="styleStateAtom";const Ot=ue("styleBreakpoint","xs");Ot.debugLabel="styleBreakpointAtom";const ga=()=>({flexChild:d.useAtomValue(Dt),gridChild:d.useAtomValue(Lt)}),ba=()=>d.useAtomValue(We);const me=()=>{const[e,t]=d.useAtom(Ge),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ve=(e,t="")=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:s}=e,o={};return Object.keys(s).forEach(l=>{const p=s[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;o[f]=Ve(p,t)}),o;case"list":const{itemProperties:a}=e,r={items:{}};return Object.keys(a).forEach(l=>{const p=a[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;r.items[f]=Ve(p,t)}),r;default:return{}}},ze=(e,t="")=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:s,title:o}=e,a={title:o,type:"object",properties:{}};return Object.keys(s).forEach(f=>{const u=s[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;a.properties[g]=ze(u,t)}),a;case"list":const{itemProperties:r,title:l}=e,p={title:l,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(f=>{const u=r[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;p.items.properties[g]=ze(u,t),i.set(p.items,"title",i.get(u,"itemTitle",`${l} item`))}),p;default:return{}}},Vt=e=>{const t={};return Object.keys(e).forEach(s=>{t[s]=va(e[s])}),t},ha=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(a,r)=>{i.has(t,r)&&i.get(t[r],"i18n",!1)&&(o[r]=$.I18N_KEY)}),o})},va=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${$.SLOT_KEY}${c.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?$.I18N_KEY:i.get(s,"default","");case"model":return Vt(e.properties);case"list":return ha(e);default:return""}};const zt=()=>d.useAtomValue(G);function ut(e,t,s,o,a){if(t===null)return[...e,...o];if(s!==null){const f=i.findIndex(e,{_parent:t}),u=(f===-1?0:f)+s;return e.splice(u,0,...o),e}if(!a){const u=i.findIndex(e,{_id:t})+1;return e.splice(u,0,...o),e}let r=i.findIndex(e,{_id:t});const l=i.filter(e,{_parent:t});i.isEmpty(l)||(r=i.findIndex(e,{_id:i.last(l)._id}));const p=r+1;return e.splice(p,0,...o),e}const ya=()=>{const e=H(),t=zt(),[,s]=me(),o=w.useCallback((r,l,p)=>{var g;for(let R=0;R<r.length;R++){const{_id:A}=r[R];r[R]._id=c.generateUUID();const I=i.filter(r,{_parent:A});for(let z=0;z<I.length;z++)I[z]._parent=r[R]._id}let f;l&&(f=i.find(t,{_id:l}),r[0]._parent=l);const u=f?Oe(f._type):!0;return!u&&f&&(r[0]._parent=f._parent),e({type:"set_blocks",payload:ut(t,l||null,p||null,r,u)}),s([(g=i.first(r))==null?void 0:g._id]),i.first(r)},[t,e,s]);return{addCoreBlock:w.useCallback((r,l,p)=>{if(i.has(r,"blocks")){const W=r.blocks;return o(W,l,p)}const f=c.generateUUID(),u=Vt(r.props),g=[];i.forIn(u,(W,X)=>{if(i.startsWith(W,$.SLOT_KEY)){const le=W.replace($.SLOT_KEY,"");g.push({_id:le,_type:"Slot",_parent:f,_name:r.props[X].name,_styles:r.props[X].styles,_emptyStyles:r.props[X].emptyStyles})}});const R={_type:r.type,_id:f,...u};let A;l&&(A=i.find(t,{_id:l}),R._parent=l);const I=A?Oe(A._type):!0;!I&&A&&(R._parent=A._parent);const z=[R,...g];return e({type:"set_blocks",payload:ut(t,l||null,p||null,z,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},mt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},pt=["xs","sm","md","lg","xl","2xl"];function ja(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",a=pt.indexOf(s);for(;a>0;){const r=pt[a-1];if(i.find(e,{mq:r,property:t.property})){o="classes";break}a--}return o}const ft=[];function wa(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),c.constructClassObject),u=>!i.isNull(u)),a=i.filter(i.map(t.split(" "),c.constructClassObject),u=>!i.isNull(u));a=i.filter(a,u=>!i.includes(ft,u.property));const r=[],l=[];i.each(s,u=>{const g=c.constructClassObject(u),R=i.find(o,i.pick(g,["dark","mq","mod","property"]));if(R&&(o=i.filter(o,A=>A.fullCls!==(R==null?void 0:R.fullCls))),r.push(g),g.mq==="xs"&&!g.dark&&g.mod===""&&(a=i.filter(a,A=>A.property!==g.property)),ja(o,g)==="baseClasses"&&!i.includes(ft,g.property)){const A=i.find(a,i.pick(g,["property"]));R&&(a=i.filter(a,I=>I.fullCls!==(A==null?void 0:A.fullCls))),l.push({...g,fullCls:g.cls,mq:"xs"})}});const p=i.map(i.sortBy([...o,...r],u=>mt[u.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...a,...l],u=>mt[u.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const be=d.atom([]);be.debugLabel="selectedStylingBlocksAtom";const Ke=()=>d.useAtom(be),Ra=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},ka=d.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:a})=>{const r=i.filter(e(Ue),p=>s.includes(e(p)._id)),l=i.first(e(be));i.each(r,p=>{const f=e(p),u=i.get(f,l.prop,`${$.STYLES_KEY},`),{baseClasses:g,classes:R}=Ra(u);a({type:"update_props_realtime",payload:{ids:[f._id],props:{[l.prop]:`${$.STYLES_KEY}${wa(R,g,o)}`}}})})}),Aa=()=>{const e=H(),t=d.useSetAtom(ka);return w.useCallback((s,o,a)=>{t({blockIds:s,newClasses:o,dispatch:e}),a&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},xt=()=>{},$t=()=>{const e=Pn.useChaiBlocks(),t=d.useAtomValue(Mt),s=()=>{xt()},o=w.useCallback(()=>xt(),[]);return[e,t,s,o]},Na=d.atom(!1),Ft=()=>{const[e,t]=d.useAtom(Na);return[e,t]},Sa=d.atom($.BRANDING_OPTIONS_DEFAULTS),qt=()=>{const[e,t]=d.useAtom(Sa);return[i.isObject(e)?{...$.BRANDING_OPTIONS_DEFAULTS,...e}:$.BRANDING_OPTIONS_DEFAULTS,t]},Ca=d.atom(null),Ut=()=>({currentPage:d.useAtomValue(Ca)}),Gt=new yt({});function Ea(e){let t=Gt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Je=(e,t)=>i.flatten(e.map(s=>{if(s=t?{...s,parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,i.flatten([s,...Je(o,s._id)])}return s}));function Qe(e,t=!1){for(let s=0;s<e.length;s++){const o=e[s];o.global&&!t?e[s]={type:"GlobalBlock",_parent:i.get(o,"parent",null),blockId:o.blockId,_id:o._id}:o.children&&o.children.length&&Qe(o.children)}}function Ht(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Wt),i.each(s,o=>{t=[...t,..._a(o)]})),t}function _a(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[Gt.convert(Yt(e))];Qe(o,!0);let a=Je(o,e[0]._id);return a=i.set(a,"0.parent",s),t=[...t,a,...Ht(a)],t}function Wt(e){const t=i.find($e,{_id:e._id});if(!t)return[];const s=[t],o=i.filter($e,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Wt))]):i.flatten(s)}const Yt=e=>JSON.parse(JSON.stringify(e));let $e=[];function Ba(e){$e=e;const t=Ea(Yt(e));Qe(t);const s=Je(t,null),o=Ht(s),a={};return i.each(o,r=>i.set(a,i.first(r).blockId,r)),[s,a]}const Xe=()=>{const[e]=qt(),{currentPage:t}=Ut(),s=d.useAtomValue(G);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[a=[],r=[]]=Ba(o);return{currentPage:t,blocks:a,globalBlocks:r}},[e,t,s])},ne=(e,t=void 0)=>{const s=d.useAtomValue(Ae);return i.get(s,e,t)},Kt=d.atom(!1);Kt.debugLabel="readOnlyModeAtom";const Jt=d.atom(!1);Jt.debugLabel="inlineEditingActiveAtom";const Qt=d.atom(!1);Qt.debugLabel="advanceStylingOpenAtom";const Xt=d.atom("online");Xt.debugLabel="networkModeAtom";const Pa=d.atom(!1);Pa.debugLabel="codeEditorOpenAtom";const Zt=d.atom(!1);Zt.debugLabel="editLayerNameAtom";const Ta=d.atom("");Ta.debugLabel="activeLanguageAtom";const Ia=d.atom("");Ia.debugLabel="primaryLanguageAtom";const es=d.atom(null);es.debugLabel="canvasIframeAtom";const ts=d.atom("layers");ts.debugLabel="activePanelAtom";const ss=d.atom(!1);ss.debugLabel="addBlockOffCanvasAtom";const os=d.atom("");os.debugLabel="showPredefinedBlockCategoryAtom";const Se=d.atom({undoCount:0,redoCount:0});Se.debugLabel="historyStatesAtom";const Ze=d.atom([]);Ze.debugLabel="dataProvidersAtom";const ns=()=>d.useAtom(Ze),Ce=d.atom("SAVED");Ce.debugLabel="pageSyncStateAtom";const Ma=()=>{const[e,t]=d.useAtom(Ce),s=ne("onSaveBlocks",async()=>{}),o=ne("onSavePage",async()=>{}),a=ne("onSyncStatusChange",()=>{}),r=Xe(),l=d.useSetAtom(Se),{undoCount:p,redoCount:f}=Ee(),[u]=ns();return{savePage:Tn.useThrottledCallback(async()=>{t("SAVING"),a("SAVING");const R=r();return await o({blocks:R.blocks,providers:u}),setTimeout(()=>{l({undoCount:p,redoCount:f}),t("SAVED"),a("SAVED")},100),!0},[r,t,a,s],5e3),syncState:e,setSyncState:t}},Ee=()=>{const e=d.useAtomValue(Ne),[{undoCount:t,redoCount:s}]=d.useAtom(Se),o=H(),[a]=Ft(),[,r]=me(),[,l]=Ke(),[p,f]=d.useAtom(Ce),u=ne("onSyncStatusChange",()=>{}),g=w.useCallback(()=>{o({type:"create_snapshot"})},[o]);return w.useEffect(()=>{(p==="SAVED"&&t!==(e==null?void 0:e.past.length)||s!==(e==null?void 0:e.future.length))&&(f("UNSAVED"),u("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,u,f,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{a||(o(fe.ActionCreators.undo()),setTimeout(()=>{l([]),r([])},200))},[o,a,r,l]),redo:w.useCallback(()=>{a||(o(fe.ActionCreators.redo()),setTimeout(()=>{l([]),r([])},200))},[a,o,l,r]),clear:()=>{o(fe.ActionCreators.clearHistory())},createSnapshot:g}},as=()=>d.useAtom(Ot),rs=ue("canvasWidth",800),is=d.atom(e=>{const t=e(rs);return c.getBreakpointValue(t).toLowerCase()}),Da=()=>{const[e,t]=d.useAtom(rs),s=d.useAtomValue(is),[o,a]=as();return w.useEffect(()=>{o!=="xs"&&a(s)},[s,o,a]),[e,s,t]},La=ue("canvasZoom",100),Oa=()=>d.useAtom(La),ls=d.atom([]),cs=()=>{const[e,t]=d.useAtom(ls),s=d.useSetAtom(et),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},et=d.atom([]),Va=()=>{const[e,t]=d.useAtom(et),s=d.useSetAtom(ls),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},ds=ue("darkMode",!1),za=()=>{const[e,t]=d.useAtom(ds);return[e,t]},$a=d.atom(!1),Fa=()=>{const[e,t]=d.useAtom($a);return[e,t]},us=()=>{const e=H(),t=d.useAtomValue(G),[,s]=me();return w.useCallback((o,a=null)=>{const r=[];i.each(o,l=>{const f=na(t,l,a===l?null:a);r.push(i.get(f,"0._id","")),e({type:"add_duplicate_blocks",payload:f})}),s(r),e({type:"create_snapshot"})},[t,s,e])},qa=d.atom([]),Ua=()=>{const[e,t]=d.useAtom(qa),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ga=d.atom(""),ms=()=>d.useAtom(Ga),Ha=()=>{const e=d.useAtomValue(G),t=H(),s=Xe(),[,,o]=$t();return w.useCallback(async(a,r)=>{const l=c.generateUUID(16),p=i.map(e,f=>(f._id===a&&(f._globalBlockId=l,f._name=r),f));t({type:"set_page_blocks",payload:p}),o()},[e,t,s,o])},Wa=()=>({}),Ya=()=>{const e=d.useAtomValue(G),t=H();return w.useCallback((s,o)=>{const a=i.map(e,r=>(i.includes(s,i.get(r,"_id"))&&i.set(r,"_parent",o),r));t({type:"set_blocks",payload:a})},[e,t])},Ka=()=>{const e=d.useAtomValue(et),[t,s]=cs(),o=us(),a=Ya();return{canPaste:w.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:w.useCallback(l=>{i.isEmpty(e)?a(t,l):o(e,l),s(()=>[])},[t,e,o,a,s])}},Ja=d.atom(""),Qa=()=>{const e=d.useAtomValue(Ja),t=w.useCallback(()=>{},[]),s=w.useCallback(()=>{},[]),o=w.useCallback(()=>{},[]);return{currentProject:e,createProject:o,deleteProject:t,updateProject:s}},ps=(e,t)=>{const s=[],o=i.filter(e,a=>i.includes(t,a._id)||i.includes(t,a._parent)?(s.push(a._id),!1):!0);return i.isEmpty(s)?o:ps(o,s)},Xa=()=>{const e=H(),t=d.useAtomValue(G),[s,o]=me();return w.useCallback(a=>{var p;const r=((p=i.find(t,{_id:a[0]}))==null?void 0:p._parent)||null,l=ps(t,a);e({type:"set_blocks",payload:l}),o(r?[r]:[])},[t,o,e,s])},Za=d.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:a})=>{const r=i.first(e(be)),l=i.filter(e(Ue),p=>s.includes(e(p)._id));i.each(l,p=>{const f=e(p),u=o;let{classes:g,baseClasses:R}=ta(i.get(f,r.prop,"styles:,"));i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");g=g.replace(I," ").replace(/ +/g," ").trim();const z=i.first(A.split(":"));i.includes(["2xl","xl","lg","md","sm"],z)&&u.push(A.split(":").pop().trim())}),i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");R=R.replace(I," ").replace(/ +/g," ").trim()}),a({type:"update_props_realtime",payload:{ids:[f._id],props:{[r.prop]:`${$.STYLES_KEY}${R},${g}`}}})})}),er=()=>{const e=H(),t=d.useSetAtom(Za);return w.useCallback((s,o)=>{t({blockIds:s,fullClasses:o,dispatch:e}),setTimeout(()=>e({type:"create_snapshot"}))},[e,t])},fs=d.atom(e=>{const t=i.first(e(be)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const a=i.get(s,t.prop,`${$.STYLES_KEY},`).replace($.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(a.trim().split(" "),c.constructClassObject),r=>!i.isNull(r))}),tr=()=>d.useAtomValue(fs),gt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},sr=d.atom(e=>{const t=e(is),s=e(Ye),o=e(ds),a=or(t);let r=i.filter(e(fs),{mod:s});return i.startsWith(s,"_")||(r=i.filter(r,l=>a.includes(l.mq))),r=r.sort((l,p)=>gt[l.mq]-gt[p.mq]),o||(r=i.filter(r,{dark:!1})),r}),or=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},nr=()=>d.useAtomValue(sr),ar=()=>d.useAtom(Ye),xs=d.atom(null,(e,t,{blockIds:s,props:o,dispatch:a})=>{a({type:"update_props_realtime",payload:{ids:s,props:o}})}),rr=()=>{const{createSnapshot:e}=Ee(),t=H(),s=d.useSetAtom(xs);return w.useCallback((o,a)=>{s({blockIds:o,props:a,dispatch:t}),e()},[e,t,s])},ir=()=>{const e=H(),t=d.useSetAtom(xs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},gs={name:"",props:{},modalProps:{},backdropClose:!0},lr=d.atom(gs),cr=()=>{const[e,t]=d.useAtom(lr),s=w.useCallback((a,r={},l={})=>{t({name:a,props:r,modalProps:l})},[t]),o=w.useCallback((...a)=>{i.get(e,"props.onClose",()=>{})(...a),t(gs)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},dr=()=>d.useAtomValue(Kt),ur=d.atom(""),mr=d.atom(null),pr=()=>d.useAtom(ur),fr=()=>d.useAtom(mr),xr=ue("selectedBreakpoints",["XS","MD","XL"]),gr=()=>{const[e,t]=d.useAtom(xr);return[e,t]},br=()=>{const e=d.useSetAtom(Se),{clear:t}=Ee(),[,s]=me(),[,o]=ms(),[,a]=Ke();return()=>{s([]),a([]),o(""),t(),e({undoCount:0,redoCount:0})}},hr=d.atom({en:{}}),vr=()=>{const[e,t]=d.useAtom(hr),s=w.useCallback((o,a,r)=>{i.set(e,`${o}.${a}`,r),t(e)},[e,t]);return[e,s]},yr=(e,t)=>{const[s]=d.useAtom(Ae);return i.get(s,e,t)},jr=d.atom([]),wr=()=>{const[e,t]=w.useState(!1),[s,o]=d.useAtom(jr),a=ne("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await a()),t(!1)))()},[]),{data:s,isLoading:e}},Rr=d.atom("en"),kr=d.atom("en"),Ar=d.atom(["en"]),bs=()=>d.useAtom(Rr),Nr=()=>d.useAtom(kr),Sr=()=>d.useAtom(Ar),Cr=(e,t)=>{const[s]=bs(),o=`${e}${s?`-${s}`:""}`;return{content:i.get(t,o,i.get(t,e,"")),propKey:e}},hs=re.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"}}),vs=x.forwardRef(({className:e,variant:t,size:s,...o},a)=>n.jsxRuntimeExports.jsx(jt.Root,{ref:a,className:c.cn(hs({variant:t,size:s,className:e})),...o}));vs.displayName=jt.Root.displayName;const ys=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Le.Root,{className:c.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:n.jsxRuntimeExports.jsx(Le.Thumb,{className:c.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")})}));ys.displayName=Le.Root.displayName;const _e=re.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"}}),js=x.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...a},r)=>{const l=o?fn.Slot:"button";return n.jsxRuntimeExports.jsx(l,{className:c.cn(_e({variant:t,size:s,className:e})),ref:r,...a})});js.displayName="Button";const Er=ae.Root,ws=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ae.Item,{ref:s,className:c.cn("border-b",e),...t}));ws.displayName="AccordionItem";const Rs=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(ae.Trigger,{ref:o,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Rs.displayName=ae.Trigger.displayName;const ks=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Content,{ref:o,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:n.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));ks.displayName=ae.Content.displayName;const _r=re.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"}}),As=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:c.cn(_r({variant:t}),e),...s}));As.displayName="Alert";const Ns=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h5",{ref:s,className:c.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));Ns.displayName="AlertTitle";const Ss=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("text-sm [&_p]:leading-relaxed",e),...t}));Ss.displayName="AlertDescription";const Cs=re.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"}}),Br=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:c.cn(Cs({variant:t}),e),...s}),Pr=V.Root,Tr=V.Trigger,Es=({className:e,...t})=>n.jsxRuntimeExports.jsx(V.Portal,{className:c.cn(e),...t});Es.displayName=V.Portal.displayName;const _s=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Overlay,{className:c.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}));_s.displayName=V.Overlay.displayName;const Bs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs(Es,{children:[n.jsxRuntimeExports.jsx(_s,{}),n.jsxRuntimeExports.jsx(V.Content,{ref:s,className:c.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})]}));Bs.displayName=V.Content.displayName;const Ps=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ps.displayName="AlertDialogHeader";const Ts=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ts.displayName="AlertDialogFooter";const Is=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Title,{ref:s,className:c.cn("text-lg font-semibold",e),...t}));Is.displayName=V.Title.displayName;const Ms=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ms.displayName=V.Description.displayName;const Ds=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Action,{ref:s,className:c.cn(_e(),e),...t}));Ds.displayName=V.Action.displayName;const Ls=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Cancel,{ref:s,className:c.cn(_e({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ls.displayName=V.Cancel.displayName;const tt=_.Root,Os=_.Trigger,Vs=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});Vs.displayName=_.Portal.displayName;const zs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:c.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}));zs.displayName=_.Overlay.displayName;const Be=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(Vs,{children:[n.jsxRuntimeExports.jsx(zs,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:c.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,n.jsxRuntimeExports.jsxs(_.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:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=_.Content.displayName;const $s=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$s.displayName="DialogHeader";const Fs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fs.displayName="DialogFooter";const qs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));qs.displayName=_.Title.displayName;const Us=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Us.displayName=_.Description.displayName;const Gs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Gs.displayName="Card";const Hs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("flex flex-col space-y-1.5 p-6",e),...t}));Hs.displayName="CardHeader";const Ws=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h3",{ref:s,className:c.cn("font-semibold leading-none tracking-tight",e),...t}));Ws.displayName="CardTitle";const Ys=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("p",{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ys.displayName="CardDescription";const Ks=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("p-6 pt-0",e),...t}));Ks.displayName="CardContent";const Js=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn(" flex items-center p-6 pt-0",e),...t}));Js.displayName="CardFooter";const Qs=x.forwardRef(({className:e,type:t,...s},o)=>n.jsxRuntimeExports.jsx("input",{type:t,className:c.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}));Qs.displayName="Input";const Ir=re.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:c.cn(Ir(),e),...t}));Xs.displayName=wt.Root.displayName;const Zs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("textarea",{className:c.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}));Zs.displayName="Textarea";const eo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(oe.Root,{ref:o,className:c.cn("relative overflow-hidden",e),...s,children:[n.jsxRuntimeExports.jsx(oe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsxRuntimeExports.jsx(st,{}),n.jsxRuntimeExports.jsx(oe.Corner,{})]}));eo.displayName=oe.Root.displayName;const st=x.forwardRef(({className:e,orientation:t="vertical",...s},o)=>n.jsxRuntimeExports.jsx(oe.ScrollAreaScrollbar,{ref:o,orientation:t,className:c.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:n.jsxRuntimeExports.jsx(oe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));st.displayName=oe.ScrollAreaScrollbar.displayName;const to=ie.Root,ot=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.List,{ref:s,className:c.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ot.displayName=ie.List.displayName;const we=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Trigger,{ref:s,className:c.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}));we.displayName=ie.Trigger.displayName;const Re=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Content,{ref:s,className:c.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=ie.Content.displayName;const Mr=de.Portal,Dr=de.Provider,Lr=de.Root,Or=de.Trigger,so=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(de.Content,{ref:o,sideOffset:t,className:c.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}));so.displayName=de.Content.displayName;const Vr=ge.Root,zr=ge.Trigger,oo=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ge.Portal,{children:n.jsxRuntimeExports.jsx(ge.Content,{ref:a,align:t,sideOffset:s,className:c.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})}));oo.displayName=ge.Content.displayName;const $r=C.Menu,Fr=C.Group,qr=C.Portal,Ur=C.Sub,Gr=C.RadioGroup,no=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Root,{ref:s,className:c.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));no.displayName=C.Root.displayName;const ao=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Trigger,{ref:s,className:c.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}));ao.displayName=C.Trigger.displayName;const ro=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));ro.displayName=C.SubTrigger.displayName;const io=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.SubContent,{ref:s,className:c.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}));io.displayName=C.SubContent.displayName;const lo=x.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...a},r)=>n.jsxRuntimeExports.jsx(C.Portal,{children:n.jsxRuntimeExports.jsx(C.Content,{ref:r,align:t,alignOffset:s,sideOffset:o,className:c.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),...a})}));lo.displayName=C.Content.displayName;const co=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Item,{ref:o,className:c.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}));co.displayName=C.Item.displayName;const uo=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));uo.displayName=C.CheckboxItem.displayName;const mo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(C.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));mo.displayName=C.RadioItem.displayName;const po=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));po.displayName=C.Label.displayName;const fo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));fo.displayName=C.Separator.displayName;const xo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});xo.displayname="MenubarShortcut";const Hr=ke.Root,Wr=ke.Trigger,go=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ke.Content,{ref:a,align:t,sideOffset:s,className:c.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}));go.displayName=ke.Content.displayName;const Yr=M.Root,Kr=M.Group,Jr=M.Value,bo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Trigger,{ref:o,className:c.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,n.jsxRuntimeExports.jsx(M.Icon,{asChild:!0,children:n.jsxRuntimeExports.jsx(O.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));bo.displayName=M.Trigger.displayName;const ho=x.forwardRef(({className:e,children:t,position:s="popper",...o},a)=>n.jsxRuntimeExports.jsx(M.Portal,{children:n.jsxRuntimeExports.jsx(M.Content,{ref:a,className:c.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:n.jsxRuntimeExports.jsx(M.Viewport,{className:c.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ho.displayName=M.Content.displayName;const vo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Label,{ref:s,className:c.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));vo.displayName=M.Label.displayName;const yo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Item,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(M.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),n.jsxRuntimeExports.jsx(M.ItemText,{children:t})]}));yo.displayName=M.Item.displayName;const jo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));jo.displayName=M.Separator.displayName;const Qr=_.Root,Xr=_.Trigger,Zr=_.Close,wo=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});wo.displayName=_.Portal.displayName;const Ro=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{className:c.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}));Ro.displayName=_.Overlay.displayName;const ei=re.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"}}),ko=x.forwardRef(({side:e="right",className:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(wo,{children:[n.jsxRuntimeExports.jsx(Ro,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:a,className:c.cn(ei({side:e}),t),...o,children:[s,n.jsxRuntimeExports.jsxs(_.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:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ko.displayName=_.Content.displayName;const Ao=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ao.displayName="SheetHeader";const No=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});No.displayName="SheetFooter";const So=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold text-foreground",e),...t}));So.displayName=_.Title.displayName;const Co=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Co.displayName=_.Description.displayName;const ti=B.Root,si=B.Trigger,oi=B.Group,ni=B.Portal,ai=B.Sub,ri=B.RadioGroup,Eo=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Eo.displayName=B.SubTrigger.displayName;const _o=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.SubContent,{ref:s,className:c.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}));_o.displayName=B.SubContent.displayName;const Bo=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(B.Portal,{children:n.jsxRuntimeExports.jsx(B.Content,{ref:o,sideOffset:t,className:c.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})}));Bo.displayName=B.Content.displayName;const Po=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Item,{ref:o,className:c.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}));Po.displayName=B.Item.displayName;const To=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));To.displayName=B.CheckboxItem.displayName;const Io=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(B.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Io.displayName=B.RadioItem.displayName;const Mo=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Mo.displayName=B.Label.displayName;const Do=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Do.displayName=B.Separator.displayName;const Lo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});Lo.displayName="DropdownMenuShortcut";const Oo=x.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},a)=>n.jsxRuntimeExports.jsx(Rt.Root,{ref:a,decorative:s,orientation:t,className:c.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Oo.displayName=Rt.Root.displayName;const ii=1,li=1e6;let Me=0;function ci(){return Me=(Me+1)%Number.MAX_VALUE,Me.toString()}const De=new Map,bt=e=>{if(De.has(e))return;const t=setTimeout(()=>{De.delete(e),xe({type:"REMOVE_TOAST",toastId:e})},li);De.set(e,t)},Vo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ii)};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?bt(s):e.toasts.forEach(o=>{bt(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)}}},ve=[];let ye={toasts:[]};function xe(e){ye=Vo(ye,e),ve.forEach(t=>{t(ye)})}function zo({...e}){const t=ci(),s=a=>xe({type:"UPDATE_TOAST",toast:{...a,id:t}}),o=()=>xe({type:"DISMISS_TOAST",toastId:t});return xe({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||o()}}}),{id:t,dismiss:o,update:s}}function $o(){const[e,t]=x.useState(ye);return x.useEffect(()=>(ve.push(t),()=>{const s=ve.indexOf(t);s>-1&&ve.splice(s,1)}),[e]),{...e,toast:zo,dismiss:s=>xe({type:"DISMISS_TOAST",toastId:s})}}const di=U.Provider,Fo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Viewport,{ref:s,className:c.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}));Fo.displayName=U.Viewport.displayName;const ui=re.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"}}),qo=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(U.Root,{ref:o,className:c.cn(ui({variant:t}),e),...s}));qo.displayName=U.Root.displayName;const mi=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Action,{ref:s,className:c.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}));mi.displayName=U.Action.displayName;const Uo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Close,{ref:s,className:c.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:n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"})}));Uo.displayName=U.Close.displayName;const Go=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Title,{ref:s,className:c.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Go.displayName=U.Title.displayName;const Ho=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Description,{ref:s,className:c.cn("text-sm opacity-90",e),...t}));Ho.displayName=U.Description.displayName;function pi(){const{toasts:e}=$o();return n.jsxRuntimeExports.jsxs(di,{children:[e.map(({id:t,title:s,description:o,action:a,...r})=>n.jsxRuntimeExports.jsxs(qo,{...r,children:[n.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&n.jsxRuntimeExports.jsx(Go,{children:s}),o&&n.jsxRuntimeExports.jsx(Ho,{children:o})]}),a,n.jsxRuntimeExports.jsx(Uo,{})]},t)),n.jsxRuntimeExports.jsx(Fo,{})]})}const fi=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("animate-pulse rounded-md bg-primary/10",e),...t}),nt=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command,{ref:s,className:c.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=F.Command.displayName;const xi=({children:e,...t})=>n.jsxRuntimeExports.jsx(tt,{...t,children:n.jsxRuntimeExports.jsx(Be,{className:"overflow-hidden p-0",children:n.jsxRuntimeExports.jsx(nt,{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})})}),Wo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsxRuntimeExports.jsx(O.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsxRuntimeExports.jsx(F.Command.Input,{ref:s,className:c.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})]}));Wo.displayName=F.Command.Input.displayName;const Yo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.List,{ref:s,className:c.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Yo.displayName=F.Command.List.displayName;const Ko=x.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(F.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ko.displayName=F.Command.Empty.displayName;const Jo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Group,{ref:s,className:c.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}));Jo.displayName=F.Command.Group.displayName;const Qo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Separator,{ref:s,className:c.cn("-mx-1 h-px bg-border",e),...t}));Qo.displayName=F.Command.Separator.displayName;const Xo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Item,{ref:s,className:c.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}));Xo.displayName=F.Command.Item.displayName;const Zo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Zo.displayName="CommandShortcut";const gi=P.Root,bi=P.Trigger,hi=P.Group,vi=P.Portal,yi=P.Sub,ji=P.RadioGroup,en=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));en.displayName=P.SubTrigger.displayName;const tn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.SubContent,{ref:s,className:c.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}));tn.displayName=P.SubContent.displayName;const sn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Portal,{children:n.jsxRuntimeExports.jsx(P.Content,{ref:s,className:c.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})}));sn.displayName=P.Content.displayName;const on=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Item,{ref:o,className:c.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}));on.displayName=P.Item.displayName;const nn=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));nn.displayName=P.CheckboxItem.displayName;const an=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(P.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));an.displayName=P.RadioItem.displayName;const rn=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));rn.displayName=P.Label.displayName;const ln=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-border",e),...t}));ln.displayName=P.Separator.displayName;const cn=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});cn.displayName="ContextMenuShortcut";const wi=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");_n.render(n.jsxRuntimeExports.jsx(vt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),1e3);const r=new DOMParser().parseFromString(o,"image/svg+xml"),l=r.querySelector("svg");return l&&(l.removeAttribute("width"),l.removeAttribute("height")),new XMLSerializer().serializeToString(r)}catch{return""}},Ri=({value:e,onChange:t,onBlur:s,id:o})=>{const a=r=>{t("<svg />");const l=wi(r);t(l),s(o,l)};return n.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[n.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12 group",children:[n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e==null?void 0:e.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"}),n.jsxRuntimeExports.jsx(vt,{value:e?"BiSolidGrid":null,onChange:a,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"}})]}),n.jsxRuntimeExports.jsx("textarea",{value:e,onChange:r=>t(r.target.value),className:"h-full border w-full rounded-sm 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"})]})},ki=w.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-E8zPMgJf.cjs"))),Ai=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-qEuDUEMn.cjs"))),dn=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=w.useState("upload");return n.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[n.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:n.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),n.jsxRuntimeExports.jsxs(to,{value:s,onValueChange:a=>o(a),className:"flex h-full w-full flex-col py-2",children:[n.jsxRuntimeExports.jsxs(ot,{className:"w-full",children:[n.jsxRuntimeExports.jsx(we,{value:"upload",className:"w-1/2",children:"Upload"}),n.jsxRuntimeExports.jsx(we,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?n.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(ki,{isModalView:e,onSelect:t})})}):n.jsxRuntimeExports.jsx(Re,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(Ai,{isModalView:e,onSelect:t})})})]})]})},Ni=Object.freeze(Object.defineProperty({__proto__:null,default:dn},Symbol.toStringTag,{value:"Module"})),ht=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),a=(...r)=>{t.call(void 0,...r),o(!1)};return n.jsxRuntimeExports.jsxs(tt,{open:s,onOpenChange:r=>o(r),children:[n.jsxRuntimeExports.jsx(Os,{asChild:!0,children:e}),n.jsxRuntimeExports.jsx(Be,{className:"flex h-3/4 max-w-5xl",children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:n.jsxRuntimeExports.jsx(dn,{isModalView:!0,onSelect:a})})})]})},Si=({value:e,onChange:t,id:s,onBlur:o})=>n.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?n.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.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"})}),n.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.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||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),n.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),n.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:a}})=>o(s,a),onChange:a=>t(a.target.value)})]})]}),Ci=({id:e,placeholder:t,value:s,onChange:o,onBlur:a})=>{const r={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},l=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:n.jsxRuntimeExports.jsx(Bn,{id:e,value:s,onBlur:p=>a(e,p),onChange:p=>o(p),modules:r,formats:l,placeholder:t,className:"mt-1 rounded-md"})},Ei=({schema:e,formData:t,onChange:s})=>{const[o,a]=w.useState([]),r=ne("getPages",()=>[]),{type:l="page",href:p="",target:f="self"}=t;return w.useEffect(()=>{(async()=>{const u=await r();a(u||[])})()},[r]),n.jsxRuntimeExports.jsxs("div",{children:[n.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[n.jsxRuntimeExports.jsx("select",{name:"type",defaultValue:"page",value:l,onChange:u=>s({...t,type:u.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(u=>n.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",defaultValue:"",placeholder:"Choose Page",value:p,onChange:u=>s({...t,href:u.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,u=>n.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:u=>s({...t,href:u.target.value}),placeholder:l==="page"||l==="url"?"Enter URL":l==="scroll"?"#ElementID":"Enter detail"}),(l==="page"||l==="url")&&n.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[n.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:f==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:f==="_blank"?"_self":"_blank"})}),n.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.Accordion=Er;exports.AccordionContent=ks;exports.AccordionItem=ws;exports.AccordionTrigger=Rs;exports.Alert=As;exports.AlertDescription=Ss;exports.AlertDialog=Pr;exports.AlertDialogAction=Ds;exports.AlertDialogCancel=Ls;exports.AlertDialogContent=Bs;exports.AlertDialogDescription=Ms;exports.AlertDialogFooter=Ts;exports.AlertDialogHeader=Ps;exports.AlertDialogTitle=Is;exports.AlertDialogTrigger=Tr;exports.AlertTitle=Ns;exports.Badge=Br;exports.Button=js;exports.Card=Gs;exports.CardContent=Ks;exports.CardDescription=Ys;exports.CardFooter=Js;exports.CardHeader=Hs;exports.CardTitle=Ws;exports.Command=nt;exports.CommandDialog=xi;exports.CommandEmpty=Ko;exports.CommandGroup=Jo;exports.CommandInput=Wo;exports.CommandItem=Xo;exports.CommandList=Yo;exports.CommandSeparator=Qo;exports.CommandShortcut=Zo;exports.ContextMenu=gi;exports.ContextMenuCheckboxItem=nn;exports.ContextMenuContent=sn;exports.ContextMenuGroup=hi;exports.ContextMenuItem=on;exports.ContextMenuLabel=rn;exports.ContextMenuPortal=vi;exports.ContextMenuRadioGroup=ji;exports.ContextMenuRadioItem=an;exports.ContextMenuSeparator=ln;exports.ContextMenuShortcut=cn;exports.ContextMenuSub=yi;exports.ContextMenuSubContent=tn;exports.ContextMenuSubTrigger=en;exports.ContextMenuTrigger=bi;exports.Dialog=tt;exports.DialogContent=Be;exports.DialogDescription=Us;exports.DialogFooter=Fs;exports.DialogHeader=$s;exports.DialogTitle=qs;exports.DialogTrigger=Os;exports.DropdownMenu=ti;exports.DropdownMenuCheckboxItem=To;exports.DropdownMenuContent=Bo;exports.DropdownMenuGroup=oi;exports.DropdownMenuItem=Po;exports.DropdownMenuLabel=Mo;exports.DropdownMenuPortal=ni;exports.DropdownMenuRadioGroup=ri;exports.DropdownMenuRadioItem=Io;exports.DropdownMenuSeparator=Do;exports.DropdownMenuShortcut=Lo;exports.DropdownMenuSub=ai;exports.DropdownMenuSubContent=_o;exports.DropdownMenuSubTrigger=Eo;exports.DropdownMenuTrigger=si;exports.HoverCard=Hr;exports.HoverCardContent=go;exports.HoverCardTrigger=Wr;exports.IconPickerField=Ri;exports.ImagePickerField=Si;exports.ImagesPanel=Ni;exports.Input=Qs;exports.Label=Xs;exports.LinkField=Ei;exports.Menubar=no;exports.MenubarCheckboxItem=uo;exports.MenubarContent=lo;exports.MenubarGroup=Fr;exports.MenubarItem=co;exports.MenubarLabel=po;exports.MenubarMenu=$r;exports.MenubarPortal=qr;exports.MenubarRadioGroup=Gr;exports.MenubarRadioItem=mo;exports.MenubarSeparator=fo;exports.MenubarShortcut=xo;exports.MenubarSub=Ur;exports.MenubarSubContent=io;exports.MenubarSubTrigger=ro;exports.MenubarTrigger=ao;exports.Popover=Vr;exports.PopoverContent=oo;exports.PopoverTrigger=zr;exports.RichTextEditorField=Ci;exports.ScrollArea=eo;exports.ScrollBar=st;exports.Select=Yr;exports.SelectContent=ho;exports.SelectGroup=Kr;exports.SelectItem=yo;exports.SelectLabel=vo;exports.SelectSeparator=jo;exports.SelectTrigger=bo;exports.SelectValue=Jr;exports.Separator=Oo;exports.Sheet=Qr;exports.SheetClose=Zr;exports.SheetContent=ko;exports.SheetDescription=Co;exports.SheetFooter=No;exports.SheetHeader=Ao;exports.SheetTitle=So;exports.SheetTrigger=Xr;exports.Skeleton=fi;exports.Switch=ys;exports.Tabs=to;exports.TabsContent=Re;exports.TabsList=ot;exports.TabsTrigger=we;exports.Textarea=Zs;exports.Toaster=pi;exports.Toggle=vs;exports.Tooltip=Lr;exports.TooltipContent=so;exports.TooltipPortal=Mr;exports.TooltipProvider=Dr;exports.TooltipTrigger=Or;exports.activePanelAtom=ts;exports.addBlockOffCanvasAtom=ss;exports.addBlocksModalAtom=Tt;exports.advanceStylingOpenAtom=Qt;exports.atom=K;exports.atomWithDefault=Jn;exports.atomWithStorage=ue;exports.badgeVariants=Cs;exports.buttonVariants=_e;exports.canDeleteBlock=ua;exports.canDropBlock=pa;exports.canDuplicateBlock=da;exports.canvasIframeAtom=es;exports.chaiBuilderPropsAtom=Ae;exports.chaiExternalDataAtom=Ct;exports.createStore=kt;exports.dataProvidersAtom=Ze;exports.editLayerNameAtom=Zt;exports.getBlockJSONFromSchemas=ze;exports.getBlockJSONFromUISchemas=Ve;exports.inlineEditingActiveAtom=Jt;exports.isDevelopment=ea;exports.networkModeAtom=Xt;exports.pageSyncStateAtom=Ce;exports.presentBlocksAtom=G;exports.reducer=Vo;exports.showPredefinedBlockCategoryAtom=os;exports.toast=zo;exports.toggleVariants=hs;exports.useActiveLanguage=bs;exports.useActiveModal=cr;exports.useActivePanel=pr;exports.useAddBlock=ya;exports.useAddBlockParent=fr;exports.useAddClassesToBlocks=Aa;exports.useAllBlocks=zt;exports.useAtom=qn;exports.useAtomValue=At;exports.useBlockContentByLanguage=Cr;exports.useBrandingOptions=qt;exports.useBuilderProp=ne;exports.useBuilderReset=br;exports.useBuildingBlocks=$t;exports.useCanvasHistory=Ee;exports.useCanvasWidth=Da;exports.useCanvasZoom=Oa;exports.useCopyBlockIds=Va;exports.useCurrentPage=Ut;exports.useCutBlockIds=cs;exports.useDarkMode=za;exports.useDeveloperPreviewMode=Fa;exports.useDuplicateBlocks=us;exports.useFeatureSupport=yr;exports.useGetPageData=Xe;exports.useHiddenBlockIds=Ua;exports.useHighlightBlockId=ms;exports.useLanguages=Sr;exports.useMarkAsGlobalBlock=Ha;exports.useMoveBlocks=Wa;exports.usePageDataProviders=ns;exports.usePasteBlocks=Ka;exports.usePreviewMode=Ft;exports.usePrimaryLanguage=Nr;exports.useProject=Qa;exports.useReadOnlyMode=dr;exports.useRemoveBlocks=Xa;exports.useRemoveClassesFromBlocks=er;exports.useSavePage=Ma;exports.useSelectedBlock=ba;exports.useSelectedBlockAllClasses=tr;exports.useSelectedBlockCurrentClasses=nr;exports.useSelectedBlockIds=me;exports.useSelectedBlocksDisplayChild=ga;exports.useSelectedBreakpoints=gr;exports.useSelectedStylingBlocks=Ke;exports.useSetAllBlocks=ca;exports.useSetAtom=Nt;exports.useStore=Fe;exports.useStylingBreakpoint=as;exports.useStylingState=ar;exports.useToast=$o;exports.useTranslations=vr;exports.useTreeData=la;exports.useUILibraryBlocks=wr;exports.useUpdateBlocksProps=rr;exports.useUpdateBlocksPropsRealtime=ir;
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-WUGKV8jN.cjs"),w=require("react"),mn=require("@radix-ui/react-toggle"),re=require("class-variance-authority"),c=require("./utils-It2K33fU.cjs"),pn=require("@radix-ui/react-switch"),fn=require("@radix-ui/react-slot"),xn=require("@radix-ui/react-accordion"),O=require("@radix-ui/react-icons"),gn=require("@radix-ui/react-alert-dialog"),bn=require("@radix-ui/react-dialog"),hn=require("@radix-ui/react-label"),vn=require("@radix-ui/react-scroll-area"),yn=require("@radix-ui/react-tabs"),jn=require("@radix-ui/react-tooltip"),wn=require("@radix-ui/react-popover"),Rn=require("@radix-ui/react-menubar"),kn=require("@radix-ui/react-hover-card"),An=require("@radix-ui/react-select"),Nn=require("@radix-ui/react-dropdown-menu"),Sn=require("@radix-ui/react-separator"),Cn=require("@radix-ui/react-toast"),F=require("cmdk"),En=require("@radix-ui/react-context-menu"),vt=require("react-icons-picker"),_n=require("react-dom"),i=require("lodash"),Bn=require("react-quill"),d=require("jotai"),yt=require("flat-to-nested"),fe=require("redux-undo"),$=require("./MODIFIERS-WFzDQfiT.cjs"),Pn=require("@chaibuilder/runtime"),Tn=require("@react-hookz/web");require("react-i18next");function D(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 x=D(w),jt=D(mn),Le=D(pn),ae=D(xn),V=D(gn),_=D(bn),wt=D(hn),oe=D(vn),ie=D(yn),de=D(jn),ge=D(wn),C=D(Rn),ke=D(kn),M=D(An),B=D(Nn),Rt=D(Sn),U=D(Cn),P=D(En);var L={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let In=0;function K(e,t){const s=`atom${++In}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=a=>a(o),o.write=(a,r,l)=>r(o,typeof l=="function"?l(a(o)):l)),t&&(o.write=t),o}const Pe=e=>"init"in e,Te=e=>!!e.write,je=new WeakMap,Mn=(e,t)=>{je.set(e,t),e.catch(()=>{}).finally(()=>je.delete(e))},at=(e,t)=>{const s=je.get(e);s&&(je.delete(e),s(t))},rt=(e,t)=>{e.status="fulfilled",e.value=t},it=(e,t)=>{e.status="rejected",e.reason=t},Dn=e=>typeof(e==null?void 0:e.then)=="function",pe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),lt=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ce=e=>"v"in e&&e.v instanceof Promise,Ln=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,he=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,a,r;(L?"production":void 0)!=="production"&&(o=new Set,a=new Set,r=new Set);const l=m=>e.get(m),p=(m,b)=>{(L?"production":void 0)!=="production"&&Object.freeze(b);const y=e.get(m);if(e.set(m,b),s.has(m)||s.set(m,y),y&&ce(y)){const h="v"in b?b.v instanceof Promise?b.v:Promise.resolve(b.v):Promise.reject(b.e);at(y.v,h)}},f=(m,b,y)=>{const h=new Map;let j=!1;y.forEach((v,k)=>{!v&&k===m&&(v=b),v?(h.set(k,v),b.d.get(k)!==v&&(j=!0)):(L?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(j||b.d.size!==h.size)&&(b.d=h)},u=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,v:b};if(y&&f(m,j,y),h&&pe(h,j)&&h.d===j.d)return h;if(h&&ce(h)&&ce(j)&&Ln(h,j)){if(h.d===j.d)return h;j.v=h.v}return p(m,j),j},g=(m,b,y,h)=>{if(Dn(b)){let j;const v=new Promise((k,T)=>{let N=!1;b.then(E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);rt(v,E),k(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}},E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);it(v,E),T(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}}),j=E=>{N||(N=!0,E.then(S=>rt(v,S),S=>it(v,S)),k(E))}});return v.orig=b,v.status="pending",Mn(v,k=>{k&&j(k),h==null||h()}),u(m,v,y)}return u(m,b,y)},R=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,e:b};return y&&f(m,j,y),h&<(h,j)&&h.d===j.d?h:(p(m,j),j)},A=m=>{const b=l(m);if(b&&(b.d.forEach((N,E)=>{E!==m&&!t.has(E)&&A(E)}),Array.from(b.d).every(([N,E])=>{const S=l(N);return N===m||S===E||S&&!ce(S)&&pe(S,E)})))return b;const y=new Map;let h=!0;const j=N=>{if(N===m){const S=l(N);if(S)return y.set(N,S),he(S);if(Pe(N))return y.set(N,void 0),N.init;throw new Error("no atom init")}const E=A(N);return y.set(N,E),he(E)};let v,k;const T={get signal(){return v||(v=new AbortController),v.signal},get setSelf(){return(L?"production":void 0)!=="production"&&!Te(m)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&Te(m)&&(k=(...N)=>{if((L?"production":void 0)!=="production"&&h&&console.warn("setSelf function cannot be called in sync"),!h)return Q(m,...N)}),k}};try{const N=m.read(j,T);return g(m,N,y,()=>v==null?void 0:v.abort())}catch(N){return R(m,N,y)}finally{h=!1}},I=m=>he(A(m)),z=m=>{let b=t.get(m);return b||(b=Y(m)),b},W=(m,b)=>!b.l.size&&(!b.t.size||b.t.size===1&&b.t.has(m)),X=m=>{const b=t.get(m);b&&W(m,b)&&se(m)},le=m=>{const b=new Map,y=new WeakMap,h=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{T!==v&&(b.set(T,(b.get(T)||new Set).add(v)),y.set(T,(y.get(T)||0)+1),h(T))})};h(m);const j=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{var N;if(T!==v){let E=y.get(T);if(E&&y.set(T,--E),!E){let S=!!((N=b.get(T))!=null&&N.size);if(S){const J=l(T),un=A(T);S=!J||!pe(J,un)}S||b.forEach(J=>J.delete(T))}j(T)}})};j(m)},Z=(m,...b)=>{let y=!0;const h=k=>he(A(k)),j=(k,...T)=>{let N;if(k===m){if(!Pe(k))throw new Error("atom not writable");const E=l(k),S=g(k,T[0]);(!E||!pe(E,S))&&le(k)}else N=Z(k,...T);if(!y){const E=ee();(L?"production":void 0)!=="production"&&a.forEach(S=>S({type:"async-write",flushed:E}))}return N},v=m.write(h,j,...b);return y=!1,v},Q=(m,...b)=>{const y=Z(m,...b),h=ee();return(L?"production":void 0)!=="production"&&a.forEach(j=>j({type:"write",flushed:h})),y},Y=(m,b)=>{const y={t:new Set(b&&[b]),l:new Set};if(t.set(m,y),(L?"production":void 0)!=="production"&&r.add(m),A(m).d.forEach((h,j)=>{const v=t.get(j);v?v.t.add(m):j!==m&&Y(j,m)}),A(m),Te(m)&&m.onMount){const h=m.onMount((...j)=>Q(m,...j));h&&(y.u=h)}return y},se=m=>{var b;const y=(b=t.get(m))==null?void 0:b.u;y&&y(),t.delete(m),(L?"production":void 0)!=="production"&&r.delete(m);const h=l(m);h?(ce(h)&&at(h.v),h.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}})):(L?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},q=(m,b,y)=>{const h=new Set(b.d.keys());y==null||y.forEach((j,v)=>{if(h.has(v)){h.delete(v);return}const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}),h.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&Y(j,m)})},ee=()=>{let m;for((L?"production":void 0)!=="production"&&(m=new Set);s.size;){const b=Array.from(s);s.clear(),b.forEach(([y,h])=>{const j=l(y);if(j){j.d!==(h==null?void 0:h.d)&&q(y,j,h==null?void 0:h.d);const v=t.get(y);v&&!(h&&!ce(h)&&(pe(h,j)||lt(h,j)))&&(v.l.forEach(k=>k()),(L?"production":void 0)!=="production"&&m.add(y))}else(L?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((L?"production":void 0)!=="production")return o.forEach(b=>b("state")),m},te=(m,b)=>{const y=z(m),h=ee(),j=y.l;return j.add(b),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),a.forEach(v=>v({type:"sub",flushed:h}))),()=>{j.delete(b),X(m),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),a.forEach(v=>v({type:"unsub"})))}};return(L?"production":void 0)!=="production"?{get:I,set:Q,sub:te,dev_subscribe_store:(m,b)=>b!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(a.add(m),()=>{a.delete(m)}),dev_get_mounted_atoms:()=>r.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[y,h]of m)Pe(y)&&(g(y,h),le(y));const b=ee();a.forEach(y=>y({type:"restore",flushed:b}))}}:{get:I,set:Q,sub:te}};let Ie;const On=()=>(Ie||(Ie=kt()),Ie);var Vn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zn=w.createContext(void 0),Fe=e=>{const t=w.useContext(zn);return(e==null?void 0:e.store)||t||On()};const $n=e=>typeof(e==null?void 0:e.then)=="function",Fn=w.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 At(e,t){const s=Fe(t),[[o,a,r],l]=w.useReducer(u=>{const g=s.get(e);return Object.is(u[0],g)&&u[1]===s&&u[2]===e?u:[g,s,e]},void 0,()=>[s.get(e),s,e]);let p=o;(a!==s||r!==e)&&(l(),p=s.get(e));const f=t==null?void 0:t.delay;return w.useEffect(()=>{const u=s.sub(e,()=>{if(typeof f=="number"){setTimeout(l,f);return}l()});return l(),u},[s,e,f]),w.useDebugValue(p),$n(p)?Fn(p):p}function Nt(e,t){const s=Fe(t);return w.useCallback((...a)=>{if((Vn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...a)},[s,e])}function qn(e,t){return[At(e,t),Nt(e,t)]}var qe={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const St=Symbol();function Un(e,t){const s=K(e,(o,a,r)=>a(s,t(o(s),r)));return s}const ct=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Gn=new WeakMap,Hn=(e,t,s)=>{const o=ct(()=>new WeakMap,Gn,t);return ct(e,o,s)},Wn={},dt=e=>!!e.write,Yn=e=>typeof e=="function";function Kn(e,t){return Hn(()=>{const s=new WeakMap,o=(l,p)=>{let f=s.get(l);if(f)return f;const u=p&&s.get(p),g=[],R=[];return l.forEach((A,I)=>{const z=t?t(A):I;R[I]=z;const W=u&&u.atomList[u.keyList.indexOf(z)];if(W){g[I]=W;return}const X=Z=>{const Q=Z(a),Y=Z(e),q=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(z);if(q<0||q>=Y.length){const ee=l[o(l).keyList.indexOf(z)];if(ee)return ee;throw new Error("splitAtom: index out of bounds for read")}return Y[q]},le=(Z,Q,Y)=>{const se=Z(a),q=Z(e),te=o(q,se==null?void 0:se.arr).keyList.indexOf(z);if(te<0||te>=q.length)throw new Error("splitAtom: index out of bounds for write");const m=Yn(Y)?Y(q[te]):Y;Q(e,[...q.slice(0,te),m,...q.slice(te+1)])};g[I]=dt(e)?K(X,le):K(X)}),u&&u.keyList.length===R.length&&u.keyList.every((A,I)=>A===R[I])?f=u:f={arr:l,atomList:g,keyList:R},s.set(l,f),f},a=K(l=>{const p=l(a),f=l(e);return o(f,p==null?void 0:p.arr)});(qe?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.init=void 0;const r=dt(e)?K(l=>l(a).atomList,(l,p,f)=>{switch(f.type){case"remove":{const u=l(r).indexOf(f.atom);if(u>=0){const g=l(e);p(e,[...g.slice(0,u),...g.slice(u+1)])}break}case"insert":{const u=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0){const g=l(e);p(e,[...g.slice(0,u),f.value,...g.slice(u)])}break}case"move":{const u=l(r).indexOf(f.atom),g=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0&&g>=0){const R=l(e);u<g?p(e,[...R.slice(0,u),...R.slice(u+1,g),R[u],...R.slice(g)]):p(e,[...R.slice(0,g),R[u],...R.slice(g,u),...R.slice(u+1)])}break}}}):K(l=>l(a).atomList);return r},e,t||Wn)}function Jn(e){const t=Symbol(),s=K(t);(qe?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=K((a,r)=>{const l=a(s);return l!==t?l:e(a,r)},(a,r,l)=>{if(l===St)r(s,t);else if(typeof l=="function"){const p=a(o);r(s,l(p))}else r(s,l)});return o}const Qn=e=>typeof(e==null?void 0:e.then)=="function";function Xn(e){let t,s;const o={getItem:(a,r)=>{var l,p;const f=g=>{if(g=g||"",t!==g){try{s=JSON.parse(g)}catch{return r}t=g}return s},u=(p=(l=e())==null?void 0:l.getItem(a))!=null?p:null;return Qn(u)?u.then(f):f(u)},setItem:(a,r)=>{var l;return(l=e())==null?void 0:l.setItem(a,JSON.stringify(r))},removeItem:a=>{var r;return(r=e())==null?void 0:r.removeItem(a)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(a,r,l)=>{if(!(e()instanceof window.Storage))return()=>{};const p=f=>{if(f.storageArea===e()&&f.key===a){let u;try{u=JSON.parse(f.newValue||"")}catch{u=l}r(u)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const Zn=Xn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=Zn,o){const a=o==null?void 0:o.unstable_getOnInit,r=K(a?s.getItem(e,t):t);return(qe?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=p=>{a||p(s.getItem(e,t));let f;return s.subscribe&&(f=s.subscribe(e,p,t)),f},K(p=>p(r),(p,f,u)=>{const g=typeof u=="function"?u(p(r)):u;return g===St?(f(r,t),s.removeItem(e)):g instanceof Promise?g.then(R=>(f(r,R),s.setItem(e,R))):(f(r,g),s.setItem(e,g))})}const Ae=d.atom(null);Ae.debugLabel="chaiBuilderPropsAtom";const Ct=d.atom({});Ct.debugLabel="chaiExternalDataAtom";const ea=()=>!1,ta=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const sa=new yt({children:"blockNodes"}),Et=(e,t=null)=>i.flatten(e.map(s=>{if(s=t!==null?{...s,parent:t}:s,s.children&&s.children.length){const o=[...s.children];return delete s.children,i.flatten([s,...Et(o,s._id)])}return s}));function _t(e,t,s){const o=i.filter(e,r=>r._parent===t),a=[];for(let r=0;r<o.length;r++){const l=Bt(o[r]);if(Object.keys(l).length>0&&Object.keys(l).forEach(p=>{o[r][p]=`slot:${c.generateUUID()}`}),i.filter(e,{_parent:o[r]._id}).length>0){const p=c.generateUUID();a.push({...o[r],oldId:o[r]._id,_id:p,_parent:s}),a.push(i.flatten(_t(e,o[r]._id,p)))}else a.push({...o[r],oldId:o[r]._id,_id:c.generateUUID(),_parent:s})}return i.flatten(a)}function oa(e){let t=sa.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const Bt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},na=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:c.generateUUID()},s&&(o={...o,_parent:s});const a=[o];i.filter(e,{_parent:t}).length>0&&a.push(i.flatten(_t(e,t,o._id)));const r=i.flatten(a);return i.map(r,l=>{const p=l,f=Bt(p);return Object.keys(f).length>0&&Object.keys(f).forEach(u=>{const g=i.find(r,{oldId:f[u].replace("slot:","")});p[u]=`slot:${g._id}`}),i.omit(p,["global","oldId"])})};const aa=fe((e=[],t)=>{switch(t.type){case"add_new_blocks":case"add_duplicate_blocks":return[...e,...t.payload];case"create_snapshot":return[...e];case"set_blocks":case"set_page_blocks":return[...t.payload];case"update_props":case"update_props_realtime":const{payload:s}=t;return e.map(o=>(s.ids.includes(o._id)&&!i.isEmpty(t.payload.props)&&Object.keys(t.payload.props).forEach(a=>{i.set(o,a,t.payload.props[a])}),o));default:return e}},{debug:!1,ignoreInitialState:!1,limit:30,filter:fe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Ne=Un({past:[],present:[],future:[]},aa);Ne.debugLabel="pageBlocksAtom";const G=d.atom(e=>{var t;return(t=e(Ne))==null?void 0:t.present});G.debugLabel="presentBlocksAtom";const Ue=Kn(G);Ue.debugLabel="pageBlocksAtomsAtom";const Pt=d.atom(e=>oa(e(G)));Pt.debugLabel="pageBlocksTreeAtom";const ra=d.atom("");ra.debugLabel="builderActivePageAtom";const ia=d.atom(-1);ia.debugLabel="destinationDropIndexAtom";const Tt=d.atom(!1);Tt.debugLabel="addBlocksModalAtom";const It=d.atom([]);It.debugLabel="buildingBlocksAtom";const Mt=d.atom(e=>{const t=e(It);return i.filter(t,s=>i.has(s,"blockId"))});Mt.debugLabel="globalBlocksAtom";const H=()=>{const[,e]=d.useAtom(Ne);return e},la=()=>{const e=H(),t=d.useAtomValue(Pt),s=w.useCallback(o=>{const a=Et(o);e({type:"set_page_blocks",payload:a})},[e]);return[t,s]},ca=()=>{const e=H();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},Oe=e=>["Box","Slot","Form","DataProvider","Link","List","ListItem","Row","Column","Table","TableCell"].includes(e),da=e=>!["Slot"].includes(e),ua=e=>!["Slot"].includes(e);function ma(e,t){return e==="Slot"||t==="List"&&e!=="ListItem"||t==="Row"&&e!=="Column"?!1:Oe(t)}const pa=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),a=i.get(s,"data._type","");return o==="Slot"||i.get(t,"id")&&i.get(t,"id")===i.get(s,"id")?!1:i.isEmpty(a)?!0:ma(o,a)},Ge=d.atom([]);Ge.debugLabel="selectedBlockIdsAtom";const He=d.atom(e=>{const t=e(G),s=e(Ge);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});He.debugLabel="selectedBlocksAtom";const We=d.atom(e=>{const t=e(He);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const fa=e=>i.get(e,"parent",null),xa=d.atom(e=>{const t=e(He),s=i.map(t,fa);return i.filter(e(G),o=>i.includes(s,o._id))});xa.debugLabel="selectedBlocksParentsAtom";const Dt=d.atom(()=>!1);Dt.debugLabel="selectedBlockFlexChildAtom";const Lt=d.atom(()=>!1);Lt.debugLabel="selectedBlockGridChildAtom";const Ye=d.atom("");Ye.debugLabel="styleStateAtom";const Ot=ue("styleBreakpoint","xs");Ot.debugLabel="styleBreakpointAtom";const ga=()=>({flexChild:d.useAtomValue(Dt),gridChild:d.useAtomValue(Lt)}),ba=()=>d.useAtomValue(We);const me=()=>{const[e,t]=d.useAtom(Ge),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ve=(e,t="")=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:s}=e,o={};return Object.keys(s).forEach(l=>{const p=s[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;o[f]=Ve(p,t)}),o;case"list":const{itemProperties:a}=e,r={items:{}};return Object.keys(a).forEach(l=>{const p=a[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;r.items[f]=Ve(p,t)}),r;default:return{}}},ze=(e,t="")=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:s,title:o}=e,a={title:o,type:"object",properties:{}};return Object.keys(s).forEach(f=>{const u=s[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;a.properties[g]=ze(u,t)}),a;case"list":const{itemProperties:r,title:l}=e,p={title:l,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(f=>{const u=r[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;p.items.properties[g]=ze(u,t),i.set(p.items,"title",i.get(u,"itemTitle",`${l} item`))}),p;default:return{}}},Vt=e=>{const t={};return Object.keys(e).forEach(s=>{t[s]=va(e[s])}),t},ha=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(a,r)=>{i.has(t,r)&&i.get(t[r],"i18n",!1)&&(o[r]=$.I18N_KEY)}),o})},va=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${$.SLOT_KEY}${c.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?$.I18N_KEY:i.get(s,"default","");case"model":return Vt(e.properties);case"list":return ha(e);default:return""}};const zt=()=>d.useAtomValue(G);function ut(e,t,s,o,a){if(t===null)return[...e,...o];if(s!==null){const f=i.findIndex(e,{_parent:t}),u=(f===-1?0:f)+s;return e.splice(u,0,...o),e}if(!a){const u=i.findIndex(e,{_id:t})+1;return e.splice(u,0,...o),e}let r=i.findIndex(e,{_id:t});const l=i.filter(e,{_parent:t});i.isEmpty(l)||(r=i.findIndex(e,{_id:i.last(l)._id}));const p=r+1;return e.splice(p,0,...o),e}const ya=()=>{const e=H(),t=zt(),[,s]=me(),o=w.useCallback((r,l,p)=>{var g;for(let R=0;R<r.length;R++){const{_id:A}=r[R];r[R]._id=c.generateUUID();const I=i.filter(r,{_parent:A});for(let z=0;z<I.length;z++)I[z]._parent=r[R]._id}let f;l&&(f=i.find(t,{_id:l}),r[0]._parent=l);const u=f?Oe(f._type):!0;return!u&&f&&(r[0]._parent=f._parent),e({type:"set_blocks",payload:ut(t,l||null,p||null,r,u)}),s([(g=i.first(r))==null?void 0:g._id]),i.first(r)},[t,e,s]);return{addCoreBlock:w.useCallback((r,l,p)=>{if(i.has(r,"blocks")){const W=r.blocks;return o(W,l,p)}const f=c.generateUUID(),u=Vt(r.props),g=[];i.forIn(u,(W,X)=>{if(i.startsWith(W,$.SLOT_KEY)){const le=W.replace($.SLOT_KEY,"");g.push({_id:le,_type:"Slot",_parent:f,_name:r.props[X].name,_styles:r.props[X].styles,_emptyStyles:r.props[X].emptyStyles})}});const R={_type:r.type,_id:f,...u};let A;l&&(A=i.find(t,{_id:l}),R._parent=l);const I=A?Oe(A._type):!0;!I&&A&&(R._parent=A._parent);const z=[R,...g];return e({type:"set_blocks",payload:ut(t,l||null,p||null,z,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},mt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},pt=["xs","sm","md","lg","xl","2xl"];function ja(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",a=pt.indexOf(s);for(;a>0;){const r=pt[a-1];if(i.find(e,{mq:r,property:t.property})){o="classes";break}a--}return o}const ft=[];function wa(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),c.constructClassObject),u=>!i.isNull(u)),a=i.filter(i.map(t.split(" "),c.constructClassObject),u=>!i.isNull(u));a=i.filter(a,u=>!i.includes(ft,u.property));const r=[],l=[];i.each(s,u=>{const g=c.constructClassObject(u),R=i.find(o,i.pick(g,["dark","mq","mod","property"]));if(R&&(o=i.filter(o,A=>A.fullCls!==(R==null?void 0:R.fullCls))),r.push(g),g.mq==="xs"&&!g.dark&&g.mod===""&&(a=i.filter(a,A=>A.property!==g.property)),ja(o,g)==="baseClasses"&&!i.includes(ft,g.property)){const A=i.find(a,i.pick(g,["property"]));R&&(a=i.filter(a,I=>I.fullCls!==(A==null?void 0:A.fullCls))),l.push({...g,fullCls:g.cls,mq:"xs"})}});const p=i.map(i.sortBy([...o,...r],u=>mt[u.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...a,...l],u=>mt[u.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const be=d.atom([]);be.debugLabel="selectedStylingBlocksAtom";const Ke=()=>d.useAtom(be),Ra=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},ka=d.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:a})=>{const r=i.filter(e(Ue),p=>s.includes(e(p)._id)),l=i.first(e(be));i.each(r,p=>{const f=e(p),u=i.get(f,l.prop,`${$.STYLES_KEY},`),{baseClasses:g,classes:R}=Ra(u);a({type:"update_props_realtime",payload:{ids:[f._id],props:{[l.prop]:`${$.STYLES_KEY}${wa(R,g,o)}`}}})})}),Aa=()=>{const e=H(),t=d.useSetAtom(ka);return w.useCallback((s,o,a)=>{t({blockIds:s,newClasses:o,dispatch:e}),a&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},xt=()=>{},$t=()=>{const e=Pn.useChaiBlocks(),t=d.useAtomValue(Mt),s=()=>{xt()},o=w.useCallback(()=>xt(),[]);return[e,t,s,o]},Na=d.atom(!1),Ft=()=>{const[e,t]=d.useAtom(Na);return[e,t]},Sa=d.atom($.BRANDING_OPTIONS_DEFAULTS),qt=()=>{const[e,t]=d.useAtom(Sa);return[i.isObject(e)?{...$.BRANDING_OPTIONS_DEFAULTS,...e}:$.BRANDING_OPTIONS_DEFAULTS,t]},Ca=d.atom(null),Ut=()=>({currentPage:d.useAtomValue(Ca)}),Gt=new yt({});function Ea(e){let t=Gt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Je=(e,t)=>i.flatten(e.map(s=>{if(s=t?{...s,parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,i.flatten([s,...Je(o,s._id)])}return s}));function Qe(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:i.get(o,"parent",null),_id:o._id}:o.children&&o.children.length&&Qe(o.children)}}function Ht(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Wt),i.each(s,o=>{t=[...t,..._a(o)]})),t}function _a(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[Gt.convert(Yt(e))];Qe(o,!0);let a=Je(o,e[0]._id);return a=i.set(a,"0.parent",s),t=[...t,a,...Ht(a)],t}function Wt(e){const t=i.find($e,{_id:e._id});if(!t)return[];const s=[t],o=i.filter($e,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Wt))]):i.flatten(s)}const Yt=e=>JSON.parse(JSON.stringify(e));let $e=[];function Ba(e){$e=e;const t=Ea(Yt(e));Qe(t);const s=Je(t,null),o=Ht(s),a={};return i.each(o,r=>i.set(a,i.first(r).blockId,r)),[s,a]}const Xe=()=>{const[e]=qt(),{currentPage:t}=Ut(),s=d.useAtomValue(G);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[a=[],r=[]]=Ba(o);return{currentPage:t,blocks:a,globalBlocks:r}},[e,t,s])},ne=(e,t=void 0)=>{const s=d.useAtomValue(Ae);return i.get(s,e,t)},Kt=d.atom(!1);Kt.debugLabel="readOnlyModeAtom";const Jt=d.atom(!1);Jt.debugLabel="inlineEditingActiveAtom";const Qt=d.atom(!1);Qt.debugLabel="advanceStylingOpenAtom";const Xt=d.atom("online");Xt.debugLabel="networkModeAtom";const Pa=d.atom(!1);Pa.debugLabel="codeEditorOpenAtom";const Zt=d.atom(!1);Zt.debugLabel="editLayerNameAtom";const Ta=d.atom("");Ta.debugLabel="activeLanguageAtom";const Ia=d.atom("");Ia.debugLabel="primaryLanguageAtom";const es=d.atom(null);es.debugLabel="canvasIframeAtom";const ts=d.atom("layers");ts.debugLabel="activePanelAtom";const ss=d.atom(!1);ss.debugLabel="addBlockOffCanvasAtom";const os=d.atom("");os.debugLabel="showPredefinedBlockCategoryAtom";const Se=d.atom({undoCount:0,redoCount:0});Se.debugLabel="historyStatesAtom";const Ze=d.atom([]);Ze.debugLabel="dataProvidersAtom";const ns=()=>d.useAtom(Ze),Ce=d.atom("SAVED");Ce.debugLabel="pageSyncStateAtom";const Ma=()=>{const[e,t]=d.useAtom(Ce),s=ne("onSaveBlocks",async()=>{}),o=ne("onSavePage",async()=>{}),a=ne("onSyncStatusChange",()=>{}),r=Xe(),l=d.useSetAtom(Se),{undoCount:p,redoCount:f}=Ee(),[u]=ns();return{savePage:Tn.useThrottledCallback(async()=>{t("SAVING"),a("SAVING");const R=r();return await o({blocks:R.blocks,providers:u}),setTimeout(()=>{l({undoCount:p,redoCount:f}),t("SAVED"),a("SAVED")},100),!0},[r,t,a,s],5e3),syncState:e,setSyncState:t}},Ee=()=>{const e=d.useAtomValue(Ne),[{undoCount:t,redoCount:s}]=d.useAtom(Se),o=H(),[a]=Ft(),[,r]=me(),[,l]=Ke(),[p,f]=d.useAtom(Ce),u=ne("onSyncStatusChange",()=>{}),g=w.useCallback(()=>{o({type:"create_snapshot"})},[o]);return w.useEffect(()=>{(p==="SAVED"&&t!==(e==null?void 0:e.past.length)||s!==(e==null?void 0:e.future.length))&&(f("UNSAVED"),u("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,u,f,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{a||(o(fe.ActionCreators.undo()),setTimeout(()=>{l([]),r([])},200))},[o,a,r,l]),redo:w.useCallback(()=>{a||(o(fe.ActionCreators.redo()),setTimeout(()=>{l([]),r([])},200))},[a,o,l,r]),clear:()=>{o(fe.ActionCreators.clearHistory())},createSnapshot:g}},as=()=>d.useAtom(Ot),rs=ue("canvasWidth",800),is=d.atom(e=>{const t=e(rs);return c.getBreakpointValue(t).toLowerCase()}),Da=()=>{const[e,t]=d.useAtom(rs),s=d.useAtomValue(is),[o,a]=as();return w.useEffect(()=>{o!=="xs"&&a(s)},[s,o,a]),[e,s,t]},La=ue("canvasZoom",100),Oa=()=>d.useAtom(La),ls=d.atom([]),cs=()=>{const[e,t]=d.useAtom(ls),s=d.useSetAtom(et),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},et=d.atom([]),Va=()=>{const[e,t]=d.useAtom(et),s=d.useSetAtom(ls),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},ds=ue("darkMode",!1),za=()=>{const[e,t]=d.useAtom(ds);return[e,t]},$a=d.atom(!1),Fa=()=>{const[e,t]=d.useAtom($a);return[e,t]},us=()=>{const e=H(),t=d.useAtomValue(G),[,s]=me();return w.useCallback((o,a=null)=>{const r=[];i.each(o,l=>{const f=na(t,l,a===l?null:a);r.push(i.get(f,"0._id","")),e({type:"add_duplicate_blocks",payload:f})}),s(r),e({type:"create_snapshot"})},[t,s,e])},qa=d.atom([]),Ua=()=>{const[e,t]=d.useAtom(qa),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ga=d.atom(""),ms=()=>d.useAtom(Ga),Ha=()=>{const e=d.useAtomValue(G),t=H(),s=Xe(),[,,o]=$t();return w.useCallback(async(a,r)=>{const l=c.generateUUID(16),p=i.map(e,f=>(f._id===a&&(f._globalBlockId=l,f._name=r),f));t({type:"set_page_blocks",payload:p}),o()},[e,t,s,o])},Wa=()=>({}),Ya=()=>{const e=d.useAtomValue(G),t=H();return w.useCallback((s,o)=>{const a=i.map(e,r=>(i.includes(s,i.get(r,"_id"))&&i.set(r,"_parent",o),r));t({type:"set_blocks",payload:a})},[e,t])},Ka=()=>{const e=d.useAtomValue(et),[t,s]=cs(),o=us(),a=Ya();return{canPaste:w.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:w.useCallback(l=>{i.isEmpty(e)?a(t,l):o(e,l),s(()=>[])},[t,e,o,a,s])}},Ja=d.atom(""),Qa=()=>{const e=d.useAtomValue(Ja),t=w.useCallback(()=>{},[]),s=w.useCallback(()=>{},[]),o=w.useCallback(()=>{},[]);return{currentProject:e,createProject:o,deleteProject:t,updateProject:s}},ps=(e,t)=>{const s=[],o=i.filter(e,a=>i.includes(t,a._id)||i.includes(t,a._parent)?(s.push(a._id),!1):!0);return i.isEmpty(s)?o:ps(o,s)},Xa=()=>{const e=H(),t=d.useAtomValue(G),[s,o]=me();return w.useCallback(a=>{var p;const r=((p=i.find(t,{_id:a[0]}))==null?void 0:p._parent)||null,l=ps(t,a);e({type:"set_blocks",payload:l}),o(r?[r]:[])},[t,o,e,s])},Za=d.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:a})=>{const r=i.first(e(be)),l=i.filter(e(Ue),p=>s.includes(e(p)._id));i.each(l,p=>{const f=e(p),u=o;let{classes:g,baseClasses:R}=ta(i.get(f,r.prop,"styles:,"));i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");g=g.replace(I," ").replace(/ +/g," ").trim();const z=i.first(A.split(":"));i.includes(["2xl","xl","lg","md","sm"],z)&&u.push(A.split(":").pop().trim())}),i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");R=R.replace(I," ").replace(/ +/g," ").trim()}),a({type:"update_props_realtime",payload:{ids:[f._id],props:{[r.prop]:`${$.STYLES_KEY}${R},${g}`}}})})}),er=()=>{const e=H(),t=d.useSetAtom(Za);return w.useCallback((s,o)=>{t({blockIds:s,fullClasses:o,dispatch:e}),setTimeout(()=>e({type:"create_snapshot"}))},[e,t])},fs=d.atom(e=>{const t=i.first(e(be)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const a=i.get(s,t.prop,`${$.STYLES_KEY},`).replace($.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(a.trim().split(" "),c.constructClassObject),r=>!i.isNull(r))}),tr=()=>d.useAtomValue(fs),gt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},sr=d.atom(e=>{const t=e(is),s=e(Ye),o=e(ds),a=or(t);let r=i.filter(e(fs),{mod:s});return i.startsWith(s,"_")||(r=i.filter(r,l=>a.includes(l.mq))),r=r.sort((l,p)=>gt[l.mq]-gt[p.mq]),o||(r=i.filter(r,{dark:!1})),r}),or=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},nr=()=>d.useAtomValue(sr),ar=()=>d.useAtom(Ye),xs=d.atom(null,(e,t,{blockIds:s,props:o,dispatch:a})=>{a({type:"update_props_realtime",payload:{ids:s,props:o}})}),rr=()=>{const{createSnapshot:e}=Ee(),t=H(),s=d.useSetAtom(xs);return w.useCallback((o,a)=>{s({blockIds:o,props:a,dispatch:t}),e()},[e,t,s])},ir=()=>{const e=H(),t=d.useSetAtom(xs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},gs={name:"",props:{},modalProps:{},backdropClose:!0},lr=d.atom(gs),cr=()=>{const[e,t]=d.useAtom(lr),s=w.useCallback((a,r={},l={})=>{t({name:a,props:r,modalProps:l})},[t]),o=w.useCallback((...a)=>{i.get(e,"props.onClose",()=>{})(...a),t(gs)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},dr=()=>d.useAtomValue(Kt),ur=d.atom(""),mr=d.atom(null),pr=()=>d.useAtom(ur),fr=()=>d.useAtom(mr),xr=ue("selectedBreakpoints",["XS","MD","XL"]),gr=()=>{const[e,t]=d.useAtom(xr);return[e,t]},br=()=>{const e=d.useSetAtom(Se),{clear:t}=Ee(),[,s]=me(),[,o]=ms(),[,a]=Ke();return()=>{s([]),a([]),o(""),t(),e({undoCount:0,redoCount:0})}},hr=d.atom({en:{}}),vr=()=>{const[e,t]=d.useAtom(hr),s=w.useCallback((o,a,r)=>{i.set(e,`${o}.${a}`,r),t(e)},[e,t]);return[e,s]},yr=(e,t)=>{const[s]=d.useAtom(Ae);return i.get(s,e,t)},jr=d.atom([]),wr=()=>{const[e,t]=w.useState(!1),[s,o]=d.useAtom(jr),a=ne("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await a()),t(!1)))()},[]),{data:s,isLoading:e}},Rr=d.atom("en"),kr=d.atom("en"),Ar=d.atom(["en"]),bs=()=>d.useAtom(Rr),Nr=()=>d.useAtom(kr),Sr=()=>d.useAtom(Ar),Cr=(e,t)=>{const[s]=bs(),o=`${e}${s?`-${s}`:""}`;return{content:i.get(t,o,i.get(t,e,"")),propKey:e}},hs=re.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"}}),vs=x.forwardRef(({className:e,variant:t,size:s,...o},a)=>n.jsxRuntimeExports.jsx(jt.Root,{ref:a,className:c.cn(hs({variant:t,size:s,className:e})),...o}));vs.displayName=jt.Root.displayName;const ys=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Le.Root,{className:c.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:n.jsxRuntimeExports.jsx(Le.Thumb,{className:c.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")})}));ys.displayName=Le.Root.displayName;const _e=re.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"}}),js=x.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...a},r)=>{const l=o?fn.Slot:"button";return n.jsxRuntimeExports.jsx(l,{className:c.cn(_e({variant:t,size:s,className:e})),ref:r,...a})});js.displayName="Button";const Er=ae.Root,ws=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ae.Item,{ref:s,className:c.cn("border-b",e),...t}));ws.displayName="AccordionItem";const Rs=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(ae.Trigger,{ref:o,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Rs.displayName=ae.Trigger.displayName;const ks=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Content,{ref:o,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:n.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));ks.displayName=ae.Content.displayName;const _r=re.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"}}),As=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:c.cn(_r({variant:t}),e),...s}));As.displayName="Alert";const Ns=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h5",{ref:s,className:c.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));Ns.displayName="AlertTitle";const Ss=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("text-sm [&_p]:leading-relaxed",e),...t}));Ss.displayName="AlertDescription";const Cs=re.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"}}),Br=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:c.cn(Cs({variant:t}),e),...s}),Pr=V.Root,Tr=V.Trigger,Es=({className:e,...t})=>n.jsxRuntimeExports.jsx(V.Portal,{className:c.cn(e),...t});Es.displayName=V.Portal.displayName;const _s=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Overlay,{className:c.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}));_s.displayName=V.Overlay.displayName;const Bs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs(Es,{children:[n.jsxRuntimeExports.jsx(_s,{}),n.jsxRuntimeExports.jsx(V.Content,{ref:s,className:c.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})]}));Bs.displayName=V.Content.displayName;const Ps=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ps.displayName="AlertDialogHeader";const Ts=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ts.displayName="AlertDialogFooter";const Is=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Title,{ref:s,className:c.cn("text-lg font-semibold",e),...t}));Is.displayName=V.Title.displayName;const Ms=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ms.displayName=V.Description.displayName;const Ds=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Action,{ref:s,className:c.cn(_e(),e),...t}));Ds.displayName=V.Action.displayName;const Ls=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Cancel,{ref:s,className:c.cn(_e({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ls.displayName=V.Cancel.displayName;const tt=_.Root,Os=_.Trigger,Vs=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});Vs.displayName=_.Portal.displayName;const zs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:c.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}));zs.displayName=_.Overlay.displayName;const Be=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(Vs,{children:[n.jsxRuntimeExports.jsx(zs,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:c.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,n.jsxRuntimeExports.jsxs(_.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:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=_.Content.displayName;const $s=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$s.displayName="DialogHeader";const Fs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fs.displayName="DialogFooter";const qs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));qs.displayName=_.Title.displayName;const Us=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Us.displayName=_.Description.displayName;const Gs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Gs.displayName="Card";const Hs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("flex flex-col space-y-1.5 p-6",e),...t}));Hs.displayName="CardHeader";const Ws=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h3",{ref:s,className:c.cn("font-semibold leading-none tracking-tight",e),...t}));Ws.displayName="CardTitle";const Ys=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("p",{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ys.displayName="CardDescription";const Ks=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("p-6 pt-0",e),...t}));Ks.displayName="CardContent";const Js=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn(" flex items-center p-6 pt-0",e),...t}));Js.displayName="CardFooter";const Qs=x.forwardRef(({className:e,type:t,...s},o)=>n.jsxRuntimeExports.jsx("input",{type:t,className:c.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}));Qs.displayName="Input";const Ir=re.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:c.cn(Ir(),e),...t}));Xs.displayName=wt.Root.displayName;const Zs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("textarea",{className:c.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}));Zs.displayName="Textarea";const eo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(oe.Root,{ref:o,className:c.cn("relative overflow-hidden",e),...s,children:[n.jsxRuntimeExports.jsx(oe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsxRuntimeExports.jsx(st,{}),n.jsxRuntimeExports.jsx(oe.Corner,{})]}));eo.displayName=oe.Root.displayName;const st=x.forwardRef(({className:e,orientation:t="vertical",...s},o)=>n.jsxRuntimeExports.jsx(oe.ScrollAreaScrollbar,{ref:o,orientation:t,className:c.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:n.jsxRuntimeExports.jsx(oe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));st.displayName=oe.ScrollAreaScrollbar.displayName;const to=ie.Root,ot=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.List,{ref:s,className:c.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ot.displayName=ie.List.displayName;const we=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Trigger,{ref:s,className:c.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}));we.displayName=ie.Trigger.displayName;const Re=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Content,{ref:s,className:c.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=ie.Content.displayName;const Mr=de.Portal,Dr=de.Provider,Lr=de.Root,Or=de.Trigger,so=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(de.Content,{ref:o,sideOffset:t,className:c.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}));so.displayName=de.Content.displayName;const Vr=ge.Root,zr=ge.Trigger,oo=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ge.Portal,{children:n.jsxRuntimeExports.jsx(ge.Content,{ref:a,align:t,sideOffset:s,className:c.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})}));oo.displayName=ge.Content.displayName;const $r=C.Menu,Fr=C.Group,qr=C.Portal,Ur=C.Sub,Gr=C.RadioGroup,no=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Root,{ref:s,className:c.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));no.displayName=C.Root.displayName;const ao=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Trigger,{ref:s,className:c.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}));ao.displayName=C.Trigger.displayName;const ro=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));ro.displayName=C.SubTrigger.displayName;const io=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.SubContent,{ref:s,className:c.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}));io.displayName=C.SubContent.displayName;const lo=x.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...a},r)=>n.jsxRuntimeExports.jsx(C.Portal,{children:n.jsxRuntimeExports.jsx(C.Content,{ref:r,align:t,alignOffset:s,sideOffset:o,className:c.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),...a})}));lo.displayName=C.Content.displayName;const co=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Item,{ref:o,className:c.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}));co.displayName=C.Item.displayName;const uo=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));uo.displayName=C.CheckboxItem.displayName;const mo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(C.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));mo.displayName=C.RadioItem.displayName;const po=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));po.displayName=C.Label.displayName;const fo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));fo.displayName=C.Separator.displayName;const xo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});xo.displayname="MenubarShortcut";const Hr=ke.Root,Wr=ke.Trigger,go=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ke.Content,{ref:a,align:t,sideOffset:s,className:c.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}));go.displayName=ke.Content.displayName;const Yr=M.Root,Kr=M.Group,Jr=M.Value,bo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Trigger,{ref:o,className:c.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,n.jsxRuntimeExports.jsx(M.Icon,{asChild:!0,children:n.jsxRuntimeExports.jsx(O.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));bo.displayName=M.Trigger.displayName;const ho=x.forwardRef(({className:e,children:t,position:s="popper",...o},a)=>n.jsxRuntimeExports.jsx(M.Portal,{children:n.jsxRuntimeExports.jsx(M.Content,{ref:a,className:c.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:n.jsxRuntimeExports.jsx(M.Viewport,{className:c.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ho.displayName=M.Content.displayName;const vo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Label,{ref:s,className:c.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));vo.displayName=M.Label.displayName;const yo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Item,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(M.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),n.jsxRuntimeExports.jsx(M.ItemText,{children:t})]}));yo.displayName=M.Item.displayName;const jo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));jo.displayName=M.Separator.displayName;const Qr=_.Root,Xr=_.Trigger,Zr=_.Close,wo=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});wo.displayName=_.Portal.displayName;const Ro=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{className:c.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}));Ro.displayName=_.Overlay.displayName;const ei=re.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"}}),ko=x.forwardRef(({side:e="right",className:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(wo,{children:[n.jsxRuntimeExports.jsx(Ro,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:a,className:c.cn(ei({side:e}),t),...o,children:[s,n.jsxRuntimeExports.jsxs(_.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:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ko.displayName=_.Content.displayName;const Ao=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ao.displayName="SheetHeader";const No=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});No.displayName="SheetFooter";const So=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold text-foreground",e),...t}));So.displayName=_.Title.displayName;const Co=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Co.displayName=_.Description.displayName;const ti=B.Root,si=B.Trigger,oi=B.Group,ni=B.Portal,ai=B.Sub,ri=B.RadioGroup,Eo=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Eo.displayName=B.SubTrigger.displayName;const _o=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.SubContent,{ref:s,className:c.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}));_o.displayName=B.SubContent.displayName;const Bo=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(B.Portal,{children:n.jsxRuntimeExports.jsx(B.Content,{ref:o,sideOffset:t,className:c.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})}));Bo.displayName=B.Content.displayName;const Po=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Item,{ref:o,className:c.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}));Po.displayName=B.Item.displayName;const To=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));To.displayName=B.CheckboxItem.displayName;const Io=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(B.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Io.displayName=B.RadioItem.displayName;const Mo=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Mo.displayName=B.Label.displayName;const Do=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Do.displayName=B.Separator.displayName;const Lo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});Lo.displayName="DropdownMenuShortcut";const Oo=x.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},a)=>n.jsxRuntimeExports.jsx(Rt.Root,{ref:a,decorative:s,orientation:t,className:c.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Oo.displayName=Rt.Root.displayName;const ii=1,li=1e6;let Me=0;function ci(){return Me=(Me+1)%Number.MAX_VALUE,Me.toString()}const De=new Map,bt=e=>{if(De.has(e))return;const t=setTimeout(()=>{De.delete(e),xe({type:"REMOVE_TOAST",toastId:e})},li);De.set(e,t)},Vo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ii)};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?bt(s):e.toasts.forEach(o=>{bt(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)}}},ve=[];let ye={toasts:[]};function xe(e){ye=Vo(ye,e),ve.forEach(t=>{t(ye)})}function zo({...e}){const t=ci(),s=a=>xe({type:"UPDATE_TOAST",toast:{...a,id:t}}),o=()=>xe({type:"DISMISS_TOAST",toastId:t});return xe({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||o()}}}),{id:t,dismiss:o,update:s}}function $o(){const[e,t]=x.useState(ye);return x.useEffect(()=>(ve.push(t),()=>{const s=ve.indexOf(t);s>-1&&ve.splice(s,1)}),[e]),{...e,toast:zo,dismiss:s=>xe({type:"DISMISS_TOAST",toastId:s})}}const di=U.Provider,Fo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Viewport,{ref:s,className:c.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}));Fo.displayName=U.Viewport.displayName;const ui=re.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"}}),qo=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(U.Root,{ref:o,className:c.cn(ui({variant:t}),e),...s}));qo.displayName=U.Root.displayName;const mi=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Action,{ref:s,className:c.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}));mi.displayName=U.Action.displayName;const Uo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Close,{ref:s,className:c.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:n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"})}));Uo.displayName=U.Close.displayName;const Go=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Title,{ref:s,className:c.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Go.displayName=U.Title.displayName;const Ho=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Description,{ref:s,className:c.cn("text-sm opacity-90",e),...t}));Ho.displayName=U.Description.displayName;function pi(){const{toasts:e}=$o();return n.jsxRuntimeExports.jsxs(di,{children:[e.map(({id:t,title:s,description:o,action:a,...r})=>n.jsxRuntimeExports.jsxs(qo,{...r,children:[n.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&n.jsxRuntimeExports.jsx(Go,{children:s}),o&&n.jsxRuntimeExports.jsx(Ho,{children:o})]}),a,n.jsxRuntimeExports.jsx(Uo,{})]},t)),n.jsxRuntimeExports.jsx(Fo,{})]})}const fi=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("animate-pulse rounded-md bg-primary/10",e),...t}),nt=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command,{ref:s,className:c.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=F.Command.displayName;const xi=({children:e,...t})=>n.jsxRuntimeExports.jsx(tt,{...t,children:n.jsxRuntimeExports.jsx(Be,{className:"overflow-hidden p-0",children:n.jsxRuntimeExports.jsx(nt,{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})})}),Wo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsxRuntimeExports.jsx(O.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsxRuntimeExports.jsx(F.Command.Input,{ref:s,className:c.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})]}));Wo.displayName=F.Command.Input.displayName;const Yo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.List,{ref:s,className:c.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Yo.displayName=F.Command.List.displayName;const Ko=x.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(F.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ko.displayName=F.Command.Empty.displayName;const Jo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Group,{ref:s,className:c.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}));Jo.displayName=F.Command.Group.displayName;const Qo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Separator,{ref:s,className:c.cn("-mx-1 h-px bg-border",e),...t}));Qo.displayName=F.Command.Separator.displayName;const Xo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Item,{ref:s,className:c.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}));Xo.displayName=F.Command.Item.displayName;const Zo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Zo.displayName="CommandShortcut";const gi=P.Root,bi=P.Trigger,hi=P.Group,vi=P.Portal,yi=P.Sub,ji=P.RadioGroup,en=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:a,className:c.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,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));en.displayName=P.SubTrigger.displayName;const tn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.SubContent,{ref:s,className:c.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}));tn.displayName=P.SubContent.displayName;const sn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Portal,{children:n.jsxRuntimeExports.jsx(P.Content,{ref:s,className:c.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})}));sn.displayName=P.Content.displayName;const on=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Item,{ref:o,className:c.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}));on.displayName=P.Item.displayName;const nn=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:a,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));nn.displayName=P.CheckboxItem.displayName;const an=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(P.RadioItem,{ref:o,className:c.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));an.displayName=P.RadioItem.displayName;const rn=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));rn.displayName=P.Label.displayName;const ln=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-border",e),...t}));ln.displayName=P.Separator.displayName;const cn=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});cn.displayName="ContextMenuShortcut";const wi=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");_n.render(n.jsxRuntimeExports.jsx(vt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),1e3);const r=new DOMParser().parseFromString(o,"image/svg+xml"),l=r.querySelector("svg");return l&&(l.removeAttribute("width"),l.removeAttribute("height")),new XMLSerializer().serializeToString(r)}catch{return""}},Ri=({value:e,onChange:t,onBlur:s,id:o})=>{const a=r=>{t("<svg />");const l=wi(r);t(l),s(o,l)};return n.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[n.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12 group",children:[n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e==null?void 0:e.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"}),n.jsxRuntimeExports.jsx(vt,{value:e?"BiSolidGrid":null,onChange:a,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"}})]}),n.jsxRuntimeExports.jsx("textarea",{value:e,onChange:r=>t(r.target.value),className:"h-full border w-full rounded-sm 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"})]})},ki=w.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-y7I_7_W7.cjs"))),Ai=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-RzEm0Stb.cjs"))),dn=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=w.useState("upload");return n.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[n.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:n.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),n.jsxRuntimeExports.jsxs(to,{value:s,onValueChange:a=>o(a),className:"flex h-full w-full flex-col py-2",children:[n.jsxRuntimeExports.jsxs(ot,{className:"w-full",children:[n.jsxRuntimeExports.jsx(we,{value:"upload",className:"w-1/2",children:"Upload"}),n.jsxRuntimeExports.jsx(we,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?n.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(ki,{isModalView:e,onSelect:t})})}):n.jsxRuntimeExports.jsx(Re,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(Ai,{isModalView:e,onSelect:t})})})]})]})},Ni=Object.freeze(Object.defineProperty({__proto__:null,default:dn},Symbol.toStringTag,{value:"Module"})),ht=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),a=(...r)=>{t.call(void 0,...r),o(!1)};return n.jsxRuntimeExports.jsxs(tt,{open:s,onOpenChange:r=>o(r),children:[n.jsxRuntimeExports.jsx(Os,{asChild:!0,children:e}),n.jsxRuntimeExports.jsx(Be,{className:"flex h-3/4 max-w-5xl",children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:n.jsxRuntimeExports.jsx(dn,{isModalView:!0,onSelect:a})})})]})},Si=({value:e,onChange:t,id:s,onBlur:o})=>n.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?n.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.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"})}),n.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.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||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),n.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),n.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:a}})=>o(s,a),onChange:a=>t(a.target.value)})]})]}),Ci=({id:e,placeholder:t,value:s,onChange:o,onBlur:a})=>{const r={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},l=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:n.jsxRuntimeExports.jsx(Bn,{id:e,value:s,onBlur:p=>a(e,p),onChange:p=>o(p),modules:r,formats:l,placeholder:t,className:"mt-1 rounded-md"})},Ei=({schema:e,formData:t,onChange:s})=>{const[o,a]=w.useState([]),r=ne("getPages",()=>[]),{type:l="page",href:p="",target:f="self"}=t;return w.useEffect(()=>{(async()=>{const u=await r();a(u||[])})()},[]),n.jsxRuntimeExports.jsxs("div",{children:[n.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[n.jsxRuntimeExports.jsx("select",{name:"type",value:l,onChange:u=>s({...t,type:u.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(u=>n.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:p,onChange:u=>s({...t,href:u.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,u=>n.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:u=>s({...t,href:u.target.value}),placeholder:l==="page"||l==="url"?"Enter URL":l==="scroll"?"#ElementID":"Enter detail"}),(l==="page"||l==="url")&&n.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[n.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:f==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:f==="_blank"?"_self":"_blank"})}),n.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.Accordion=Er;exports.AccordionContent=ks;exports.AccordionItem=ws;exports.AccordionTrigger=Rs;exports.Alert=As;exports.AlertDescription=Ss;exports.AlertDialog=Pr;exports.AlertDialogAction=Ds;exports.AlertDialogCancel=Ls;exports.AlertDialogContent=Bs;exports.AlertDialogDescription=Ms;exports.AlertDialogFooter=Ts;exports.AlertDialogHeader=Ps;exports.AlertDialogTitle=Is;exports.AlertDialogTrigger=Tr;exports.AlertTitle=Ns;exports.Badge=Br;exports.Button=js;exports.Card=Gs;exports.CardContent=Ks;exports.CardDescription=Ys;exports.CardFooter=Js;exports.CardHeader=Hs;exports.CardTitle=Ws;exports.Command=nt;exports.CommandDialog=xi;exports.CommandEmpty=Ko;exports.CommandGroup=Jo;exports.CommandInput=Wo;exports.CommandItem=Xo;exports.CommandList=Yo;exports.CommandSeparator=Qo;exports.CommandShortcut=Zo;exports.ContextMenu=gi;exports.ContextMenuCheckboxItem=nn;exports.ContextMenuContent=sn;exports.ContextMenuGroup=hi;exports.ContextMenuItem=on;exports.ContextMenuLabel=rn;exports.ContextMenuPortal=vi;exports.ContextMenuRadioGroup=ji;exports.ContextMenuRadioItem=an;exports.ContextMenuSeparator=ln;exports.ContextMenuShortcut=cn;exports.ContextMenuSub=yi;exports.ContextMenuSubContent=tn;exports.ContextMenuSubTrigger=en;exports.ContextMenuTrigger=bi;exports.Dialog=tt;exports.DialogContent=Be;exports.DialogDescription=Us;exports.DialogFooter=Fs;exports.DialogHeader=$s;exports.DialogTitle=qs;exports.DialogTrigger=Os;exports.DropdownMenu=ti;exports.DropdownMenuCheckboxItem=To;exports.DropdownMenuContent=Bo;exports.DropdownMenuGroup=oi;exports.DropdownMenuItem=Po;exports.DropdownMenuLabel=Mo;exports.DropdownMenuPortal=ni;exports.DropdownMenuRadioGroup=ri;exports.DropdownMenuRadioItem=Io;exports.DropdownMenuSeparator=Do;exports.DropdownMenuShortcut=Lo;exports.DropdownMenuSub=ai;exports.DropdownMenuSubContent=_o;exports.DropdownMenuSubTrigger=Eo;exports.DropdownMenuTrigger=si;exports.HoverCard=Hr;exports.HoverCardContent=go;exports.HoverCardTrigger=Wr;exports.IconPickerField=Ri;exports.ImagePickerField=Si;exports.ImagesPanel=Ni;exports.Input=Qs;exports.Label=Xs;exports.LinkField=Ei;exports.Menubar=no;exports.MenubarCheckboxItem=uo;exports.MenubarContent=lo;exports.MenubarGroup=Fr;exports.MenubarItem=co;exports.MenubarLabel=po;exports.MenubarMenu=$r;exports.MenubarPortal=qr;exports.MenubarRadioGroup=Gr;exports.MenubarRadioItem=mo;exports.MenubarSeparator=fo;exports.MenubarShortcut=xo;exports.MenubarSub=Ur;exports.MenubarSubContent=io;exports.MenubarSubTrigger=ro;exports.MenubarTrigger=ao;exports.Popover=Vr;exports.PopoverContent=oo;exports.PopoverTrigger=zr;exports.RichTextEditorField=Ci;exports.ScrollArea=eo;exports.ScrollBar=st;exports.Select=Yr;exports.SelectContent=ho;exports.SelectGroup=Kr;exports.SelectItem=yo;exports.SelectLabel=vo;exports.SelectSeparator=jo;exports.SelectTrigger=bo;exports.SelectValue=Jr;exports.Separator=Oo;exports.Sheet=Qr;exports.SheetClose=Zr;exports.SheetContent=ko;exports.SheetDescription=Co;exports.SheetFooter=No;exports.SheetHeader=Ao;exports.SheetTitle=So;exports.SheetTrigger=Xr;exports.Skeleton=fi;exports.Switch=ys;exports.Tabs=to;exports.TabsContent=Re;exports.TabsList=ot;exports.TabsTrigger=we;exports.Textarea=Zs;exports.Toaster=pi;exports.Toggle=vs;exports.Tooltip=Lr;exports.TooltipContent=so;exports.TooltipPortal=Mr;exports.TooltipProvider=Dr;exports.TooltipTrigger=Or;exports.activePanelAtom=ts;exports.addBlockOffCanvasAtom=ss;exports.addBlocksModalAtom=Tt;exports.advanceStylingOpenAtom=Qt;exports.atom=K;exports.atomWithDefault=Jn;exports.atomWithStorage=ue;exports.badgeVariants=Cs;exports.buttonVariants=_e;exports.canDeleteBlock=ua;exports.canDropBlock=pa;exports.canDuplicateBlock=da;exports.canvasIframeAtom=es;exports.chaiBuilderPropsAtom=Ae;exports.chaiExternalDataAtom=Ct;exports.createStore=kt;exports.dataProvidersAtom=Ze;exports.editLayerNameAtom=Zt;exports.getBlockJSONFromSchemas=ze;exports.getBlockJSONFromUISchemas=Ve;exports.inlineEditingActiveAtom=Jt;exports.isDevelopment=ea;exports.networkModeAtom=Xt;exports.pageSyncStateAtom=Ce;exports.presentBlocksAtom=G;exports.reducer=Vo;exports.showPredefinedBlockCategoryAtom=os;exports.toast=zo;exports.toggleVariants=hs;exports.useActiveLanguage=bs;exports.useActiveModal=cr;exports.useActivePanel=pr;exports.useAddBlock=ya;exports.useAddBlockParent=fr;exports.useAddClassesToBlocks=Aa;exports.useAllBlocks=zt;exports.useAtom=qn;exports.useAtomValue=At;exports.useBlockContentByLanguage=Cr;exports.useBrandingOptions=qt;exports.useBuilderProp=ne;exports.useBuilderReset=br;exports.useBuildingBlocks=$t;exports.useCanvasHistory=Ee;exports.useCanvasWidth=Da;exports.useCanvasZoom=Oa;exports.useCopyBlockIds=Va;exports.useCurrentPage=Ut;exports.useCutBlockIds=cs;exports.useDarkMode=za;exports.useDeveloperPreviewMode=Fa;exports.useDuplicateBlocks=us;exports.useFeatureSupport=yr;exports.useGetPageData=Xe;exports.useHiddenBlockIds=Ua;exports.useHighlightBlockId=ms;exports.useLanguages=Sr;exports.useMarkAsGlobalBlock=Ha;exports.useMoveBlocks=Wa;exports.usePageDataProviders=ns;exports.usePasteBlocks=Ka;exports.usePreviewMode=Ft;exports.usePrimaryLanguage=Nr;exports.useProject=Qa;exports.useReadOnlyMode=dr;exports.useRemoveBlocks=Xa;exports.useRemoveClassesFromBlocks=er;exports.useSavePage=Ma;exports.useSelectedBlock=ba;exports.useSelectedBlockAllClasses=tr;exports.useSelectedBlockCurrentClasses=nr;exports.useSelectedBlockIds=me;exports.useSelectedBlocksDisplayChild=ga;exports.useSelectedBreakpoints=gr;exports.useSelectedStylingBlocks=Ke;exports.useSetAllBlocks=ca;exports.useSetAtom=Nt;exports.useStore=Fe;exports.useStylingBreakpoint=as;exports.useStylingState=ar;exports.useToast=$o;exports.useTranslations=vr;exports.useTreeData=la;exports.useUILibraryBlocks=wr;exports.useUpdateBlocksProps=rr;exports.useUpdateBlocksPropsRealtime=ir;
|
|
@@ -20,7 +20,7 @@ import { initReactI18next as oS } from "react-i18next";
|
|
|
20
20
|
import { j as n1 } from "./jsx-runtime-NV737rRe.js";
|
|
21
21
|
import * as O from "react";
|
|
22
22
|
import p, { useState as g1, useRef as z1, useLayoutEffect as L3, useEffect as L1, useCallback as D1, useDebugValue as i91, useContext as Et, forwardRef as Q, createContext as $t, useReducer as cS, useMemo as fa, cloneElement as Ae, Fragment as hS, Children as br, Component as Ff, isValidElement as sS, createElement as G4, memo as vS, Suspense as Ue, lazy as v0 } from "react";
|
|
23
|
-
import { u as O3, a as h2, c as qf, b as wt, d as Pe, e as s2, f as d0, g as Wf, h as dS, i as J4, B as S3, S as uS, j as Kf, k as gS, l as fS, m as pS, n as zS, o as MS, p as mS, q as HS, r as VS, s as wS, t as bS, v as yS, T as xS, w as LS, x as OS, y as Uf, z as SS, A as CS, C as BS, D as AS, E as PS, F as ES, G as IS, H as kS, I as NS, J as RS, K as TS } from "./index-
|
|
23
|
+
import { u as O3, a as h2, c as qf, b as wt, d as Pe, e as s2, f as d0, g as Wf, h as dS, i as J4, B as S3, S as uS, j as Kf, k as gS, l as fS, m as pS, n as zS, o as MS, p as mS, q as HS, r as VS, s as wS, t as bS, v as yS, T as xS, w as LS, x as OS, y as Uf, z as SS, A as CS, C as BS, D as AS, E as PS, F as ES, G as IS, H as kS, I as NS, J as RS, K as TS } from "./index-Vx4ctSV6.js";
|
|
24
24
|
import { g as Ii, c as j0 } from "./MODIFIERS-MLfpKQY1.js";
|
|
25
25
|
import Zf from "clsx";
|
|
26
26
|
import { flushSync as DS, createPortal as jS } from "react-dom";
|
|
@@ -38593,7 +38593,7 @@ const Ph1 = () => {
|
|
|
38593
38593
|
e((l) => (delete l[n.providerKey], l));
|
|
38594
38594
|
});
|
|
38595
38595
|
}), [r, a, e]), /* @__PURE__ */ n1.jsx(n1.Fragment, { children: t });
|
|
38596
|
-
}, Th1 = v0(() => import("./SidePanels-
|
|
38596
|
+
}, Th1 = v0(() => import("./SidePanels-g4M6oTs-.js")), Dh1 = v0(() => import("./Topbar-KqZt4TEY.js")), jh1 = v0(() => import("./CanvasArea-C30uJLef.js")), Fh1 = v0(() => import("./Settings-lxTrbI-C.js")), qh1 = () => {
|
|
38597
38597
|
const [t] = ki(bS), e = (n) => {
|
|
38598
38598
|
yS() || n.preventDefault();
|
|
38599
38599
|
};
|
|
@@ -40723,7 +40723,7 @@ const js1 = () => {
|
|
|
40723
40723
|
] })
|
|
40724
40724
|
] })
|
|
40725
40725
|
] });
|
|
40726
|
-
}, Us1 = () => /* @__PURE__ */ n1.jsx(Ks1, { children: /* @__PURE__ */ n1.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ n1.jsx(zC, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), Zs1 = v0(() => import("./PagesPanel-
|
|
40726
|
+
}, Us1 = () => /* @__PURE__ */ n1.jsx(Ks1, { children: /* @__PURE__ */ n1.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ n1.jsx(zC, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), Zs1 = v0(() => import("./PagesPanel-RbHN6lvQ.js")), Gs1 = v0(() => import("./ProjectPanel-CzwuyR0N.js")), Js1 = v0(() => import("./CurrentPage-70sBzc2_.js")), Ys1 = () => /* @__PURE__ */ n1.jsx("h2", { children: "Your Logo" }), Qs1 = () => {
|
|
40727
40727
|
const { mutate: t } = Ps1();
|
|
40728
40728
|
return J4("editable", !0) ? /* @__PURE__ */ n1.jsx(S3, { onClick: t, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
40729
40729
|
}, Xs1 = (t) => {
|