@chaibuilder/sdk 1.2.53 → 1.2.56
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/dist/{AddBlocks-kJNH96eQ.js → AddBlocks-HeYXoex4.js} +2 -2
- package/dist/{AddBlocks-7OJEZC2D.cjs → AddBlocks-VHoZezjj.cjs} +1 -1
- package/dist/{CanvasArea-nWHWl6zD.cjs → CanvasArea-137WY3Wx.cjs} +2 -2
- package/dist/{CanvasArea-ZxrQurg_.js → CanvasArea-CqILE5PR.js} +3 -3
- package/dist/{ChaiBuilderEditor-Rqlg194T.cjs → ChaiBuilderEditor-aY8flOgX.cjs} +1 -1
- package/dist/{ChaiBuilderEditor-4xhn_QlL.js → ChaiBuilderEditor-tkzS851D.js} +2 -2
- package/dist/{CodeEditor-C6p5CZfl.cjs → CodeEditor-R2jKe97T.cjs} +1 -1
- package/dist/{CodeEditor-vTWgHJei.js → CodeEditor-kxV5RCpd.js} +1 -1
- package/dist/{CurrentPage-KPr8MnO0.js → CurrentPage-IrFGAb7n.js} +3 -3
- package/dist/{CurrentPage-bfY5xyr7.cjs → CurrentPage-PjrVzHXR.cjs} +1 -1
- package/dist/{ListTree-5s7iNbKT.js → ListTree-0n_G8NJx.js} +1 -1
- package/dist/{ListTree-4J0SUudU.cjs → ListTree-C6oCXZDV.cjs} +1 -1
- package/dist/{PagesPanel-aZBPSLS7.js → PagesPanel-RYBf0Yct.js} +4 -4
- package/dist/{PagesPanel-re4w2009.cjs → PagesPanel-lIC3kYmS.cjs} +1 -1
- package/dist/{ProjectPanel-uo19SCtW.cjs → ProjectPanel-0Siyi5YS.cjs} +1 -1
- package/dist/{ProjectPanel-bWZtA_mw.js → ProjectPanel-Zagx6l3Q.js} +4 -4
- package/dist/Settings-6QRVcl16.cjs +1 -0
- package/dist/{Settings-SK2ONoi0.js → Settings-RLDTFFf8.js} +13 -13
- package/dist/{SidePanels-ezU-hGki.js → SidePanels-ao969pMV.js} +2 -2
- package/dist/{SidePanels-YAKKqxIi.cjs → SidePanels-j1EFsBlK.cjs} +1 -1
- package/dist/{ThemeConfiguration-q5rLYmXB.js → ThemeConfiguration-S7yArRMp.js} +1 -1
- package/dist/{ThemeConfiguration-qUXsJBBZ.cjs → ThemeConfiguration-q1471P7b.cjs} +1 -1
- package/dist/{Topbar-YhJ6xVs-.js → Topbar-B8u0whpc.js} +1 -1
- package/dist/{Topbar-9mJ6dJn-.cjs → Topbar-ogFKKDbx.cjs} +1 -1
- package/dist/{UILibrariesPanel-uNt8spPr.cjs → UILibrariesPanel-cm9CFWxc.cjs} +1 -1
- package/dist/{UILibrariesPanel-N7acP7aA.js → UILibrariesPanel-tcfz2ELp.js} +1 -1
- package/dist/{UnsplashImages-5IlwWgRv.cjs → UnsplashImages-E2L3YDJI.cjs} +1 -1
- package/dist/{UnsplashImages-iY__3dsJ.js → UnsplashImages-wWRifkCp.js} +1 -1
- package/dist/{UploadImages-KHk-jx9-.js → UploadImages-lUvZhW_j.js} +1 -1
- package/dist/{UploadImages-UjtFHUqM.cjs → UploadImages-s-eeaGiS.cjs} +1 -1
- package/dist/{add-page-modal-HmfsbbCH.js → add-page-modal-04b4l2zu.js} +4 -4
- package/dist/{add-page-modal-8GuYgZa-.cjs → add-page-modal-eroF20lO.cjs} +1 -1
- package/dist/{confirm-alert-AoUx_ZEf.js → confirm-alert-FX5030eR.js} +1 -1
- package/dist/{confirm-alert-qdryZAvd.cjs → confirm-alert-XuxEzG-V.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-KCPx8Ako.js → delete-page-modal-1u9CyAIP.js} +3 -3
- package/dist/{delete-page-modal-8qEY88SK.cjs → delete-page-modal-pgh7sdfg.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-LHHE25z8.js → form-HRdEJjVq.js} +1 -1
- package/dist/{form-zHGQEmOp.cjs → form-Z4IRWj0o.cjs} +1 -1
- package/dist/{html-to-json-ofq1N3tB.js → html-to-json-OnIZDDXw.js} +63 -58
- package/dist/html-to-json-rauxDBi6.cjs +1 -0
- package/dist/{index-swYRuZtl.cjs → index-bt7EhwLh.cjs} +1 -1
- package/dist/{index-tGVTszX2.js → index-vfmO3y2d.js} +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-t9AFrRlP.cjs → page-viewer-O960kM2x.cjs} +1 -1
- package/dist/{page-viewer-P5yNaWy1.js → page-viewer-dcb3u4OV.js} +4 -4
- package/dist/{project-general-setting-Qm8odisi.js → project-general-setting--sS34seu.js} +4 -4
- package/dist/{project-general-setting-Ojhf6Nl6.cjs → project-general-setting-lIvNs-Vq.cjs} +1 -1
- package/dist/{project-seo-setting-j8EdSO40.js → project-seo-setting-8tc3I-0M.js} +2 -2
- package/dist/{project-seo-setting-4E1mqV3j.cjs → project-seo-setting-MIlAuqcc.cjs} +1 -1
- package/dist/{single-page-detail-bv-XFGOD.cjs → single-page-detail-0Z_hvd_j.cjs} +1 -1
- package/dist/{single-page-detail-mQfFVaou.js → single-page-detail-tP2pfgBp.js} +5 -5
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-4WtrDzCu.cjs → useCanvasSettings-R0h03UfD.cjs} +1 -1
- package/dist/{useCanvasSettings-Rvn5rRB8.js → useCanvasSettings-rEZHbw3s.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +4 -4
- package/package.json +1 -1
- package/dist/Settings-AcK9rEs3.cjs +0 -1
- package/dist/html-to-json-9uiQ2Dp2.cjs +0 -1
|
@@ -203,4 +203,4 @@ object-assign/index.js:
|
|
|
203
203
|
(c) Sindre Sorhus
|
|
204
204
|
@license MIT
|
|
205
205
|
*)
|
|
206
|
-
*/Z();var cd1=process.env.NODE_ENV!=="production"?ed1:()=>null;function ad1(){return new URLSearchParams(window.location.search).has("dnd")}function rd1(){return new URLSearchParams(window.location.search).has("outline")}const nd1={dnd:ad1(),arborist:rd1()},Ur=i1.atom(null);Ur.debugLabel="chaiBuilderPropsAtom";const eL=i1.atom({});eL.debugLabel="chaiExternalDataAtom";class cL extends h.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?L.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[L.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),L.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const od1=()=>!1,ld1=t=>{const e=t.replace(Y2.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},ha=j.memoize((t,e)=>{if(!t)return!0;const c=G3.getBlockComponent(t);return c&&j.has(c,"canAcceptBlock")?c.canAcceptBlock(e):!1}),Mv1=j.memoize((t,e)=>{const c=G3.getBlockComponent(e);return c&&j.has(c,"canBeNested")?c.canBeNested(t):!0}),id1=j.memoize(t=>{const e=G3.getBlockComponent(t);return e&&j.has(e,"canDuplicate")?e.canDuplicate():!0}),sd1=j.memoize(t=>{const e=G3.getBlockComponent(t);return e&&j.has(e,"canDelete")?e.canDelete():!0});function aL(t,e,c){const a=j.filter(t,n=>n._parent===e),r=[];for(let n=0;n<a.length;n++){const o=nL(a[n]);if(Object.keys(o).length>0&&Object.keys(o).forEach(l=>{a[n][l]=`slot:${W4.generateUUID()}`}),j.filter(t,{_parent:a[n]._id}).length>0){const l=W4.generateUUID();r.push({...a[n],oldId:a[n]._id,_id:l,_parent:c}),r.push(j.flatten(aL(t,a[n]._id,l)))}else r.push({...a[n],oldId:a[n]._id,_id:W4.generateUUID(),_parent:c})}return j.flatten(r)}function rL(t){const e={};t.forEach(a=>{e[a._id]={...a,children:[]}});const c=[];return t.forEach(a=>{if(a._parent){const r=e[a._parent];r&&r.children.push(e[a._id])}else c.push(e[a._id])}),c}const nL=t=>{const e={};return Object.keys(t).forEach(c=>{j.isString(t[c])&&t[c].startsWith("slot")&&(e[c]=t[c].replace("slot:",""))}),e},dd1=(t,e,c=null)=>{let a=j.find(t,{_id:e});a={...a,oldId:a._id,_id:W4.generateUUID()},c&&(a={...a,_parent:c});const r=[a];j.filter(t,{_parent:e}).length>0&&r.push(j.flatten(aL(t,e,a._id)));const n=j.flatten(r);return j.map(n,o=>{const l=o,i=nL(l);return Object.keys(i).length>0&&Object.keys(i).forEach(d=>{const s=j.find(n,{oldId:i[d].replace("slot:","")});l[d]=`slot:${s._id}`}),j.omit(l,["global","oldId"])})};const I4=i1.atom([]);I4.debugLabel="presentBlocksAtom";const oL=i1.atom(t=>{const e=t(I4);return rL([...e])});oL.debugLabel="treeDSBlocks";I4.debugLabel="presentBlocksAtom";const Kr=ee1(I4);Kr.debugLabel="pageBlocksAtomsAtom";const ud1=i1.atom("");ud1.debugLabel="builderActivePageAtom";const hd1=i1.atom(-1);hd1.debugLabel="destinationDropIndexAtom";const lL=i1.atom([]);lL.debugLabel="buildingBlocksAtom";const vd1=i1.atom(t=>{const e=t(lL);return j.filter(e,c=>j.has(c,"blockId"))});vd1.debugLabel="globalBlocksAtom";const Jr=i1.atom([]);Jr.debugLabel="selectedBlockIdsAtom";const Yr=i1.atom(t=>{const e=t(I4),c=t(Jr);return j.map(j.filter(e,({_id:a})=>j.includes(c,a)),a=>({...a}))});Yr.debugLabel="selectedBlocksAtom";const ue=i1.atom(t=>{const e=t(Yr);if(e.length===0)return null;if(e.length===1)return e[0]});ue.debugLabel="selectedBlockAtom";const fd1=t=>j.get(t,"_parent",null),gd1=i1.atom(t=>{const e=t(Yr),c=j.map(e,fd1);return j.filter(t(I4),a=>j.includes(c,a._id))});gd1.debugLabel="selectedBlocksParentsAtom";const iL=i1.atom(()=>!1);iL.debugLabel="selectedBlockFlexChildAtom";const sL=i1.atom(()=>!1);sL.debugLabel="selectedBlockGridChildAtom";const Xr=i1.atom("");Xr.debugLabel="styleStateAtom";const dL=e4("styleBreakpoint","xs");dL.debugLabel="styleBreakpointAtom";const pd1=()=>({flexChild:i1.useAtomValue(iL),gridChild:i1.useAtomValue(sL)}),md1=()=>i1.useAtomValue(ue),zd1=i1.atom(t=>{const e=t(ue),c=t(I4);let a=e;const r=[e];do{const n=c.find(({_id:o})=>o===(a==null?void 0:a._parent));a=n,n&&r.push(n)}while(a!=null&&a._parent);return r}),bd1=()=>i1.useAtomValue(zd1),Md1=()=>{const t=bd1();return h.useMemo(()=>{for(let e=0;e<t.length;e++){const c=G3.getBlockComponent(t[e]._type),a=j.cloneDeep(j.get(c,"blockState",{}));if(!j.isEmpty(a))return{settings:a,block:t[e]}}return{}},[t])};const f3=()=>{const[t,e]=i1.useAtom(Jr),c=h.useCallback(a=>{e(r=>j.includes(r,a)?j.without(r,a):[...r,a])},[e]);return[t,e,c]},va=t=>{switch(t.type){case"singular":return t.uiSchema;case"model":const{properties:e}=t,c={};return Object.keys(e).forEach(n=>{const o=e[n];if(j.includes(["slot","styles"],o.type))return;const l=n;c[l]=va(o)}),c;case"list":const{itemProperties:a}=t,r={items:{}};return Object.keys(a).forEach(n=>{const o=a[n];if(j.includes(["slot","styles"],o.type))return;const l=n;r.items[l]=va(o)}),r;default:return{}}},fa=t=>{switch(t.type){case"singular":return t.schema;case"model":const{properties:e,title:c}=t,a={title:c,type:"object",properties:{}};return Object.keys(e).forEach(l=>{const i=e[l];if(j.includes(["slot","styles"],i.type))return;const d=l;a.properties[d]=fa(i)}),a;case"list":const{itemProperties:r,title:n}=t,o={title:n,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(l=>{const i=r[l];if(j.includes(["slot","styles"],i.type))return;const d=l;o.items.properties[d]=fa(i),j.set(o.items,"title",j.get(i,"itemTitle",`${n} item`))}),o;default:return{}}},uL=t=>{if(!t)return{};const e={};return Object.keys(t).forEach(c=>{e[c]=wd1(t[c])}),e},Cd1=t=>{if(j.isEmpty(t.default))return[];const{itemProperties:e}=t;return j.map(t.default,c=>{const a={...c};return j.forIn(c,(r,n)=>{j.has(e,n)&&j.get(e[n],"i18n",!1)&&(a[n]=Y2.I18N_KEY)}),a})},wd1=t=>{switch(t.type){case"styles":return t.default;case"slot":return`${Y2.SLOT_KEY}${W4.generateUUID()}`;case"singular":const{schema:e}=t;return j.get(e,"default","");case"model":return uL(t.properties);case"list":return Cd1(t);default:return""}};const Vd1=(t,e)=>{const c={};return j.set(c,t,e),c};var Qr={exports:{}},Cv1=Qr.exports;(function(t){(function(){"use strict";function e(a,r,n){return a.splice(r,!n||1+n-r+(!(n<0^r>=0)&&(n<0||-1)*a.length)),a.length}let c=function(){let a=[],r=-1,n=0,o=!1,l;function i(d,s){return!d||typeof d[s]!="function"?this:(o=!0,d[s](),o=!1,this)}return{add:function(d){return o?this:(a.splice(r+1,a.length-r),a.push(d),n&&a.length>n&&e(a,0,-(n+1)),r=a.length-1,l&&l(),this)},setCallback:function(d){l=d},undo:function(){let d=a[r];if(!d)return this;const s=d.groupId;for(;d.groupId===s&&(i(d,"undo"),r-=1,d=a[r],!(!d||!d.groupId)););return l&&l(),this},redo:function(){let d=a[r+1];if(!d)return this;const s=d.groupId;for(;d.groupId===s&&(i(d,"redo"),r+=1,d=a[r+1],!(!d||!d.groupId)););return l&&l(),this},clear:function(){let d=a.length;a=[],r=-1,l&&d>0&&l()},hasUndo:function(){return r!==-1},hasRedo:function(){return r<a.length-1},getCommands:function(d){return d?a.filter(s=>s.groupId===d):a},getIndex:function(){return r},setLimit:function(d){n=d}}};t.exports?t.exports=c:window.UndoManager=c})()})(Qr);var Hd1=Qr.exports;const yd1=H4.getDefaultExportFromCjs(Hd1),xd1=i1.atom(Y2.BRANDING_OPTIONS_DEFAULTS),Ld1=i1.atom(null),he=()=>{const[t,e]=i1.useAtom(xd1);return[j.isObject(t)?{...Y2.BRANDING_OPTIONS_DEFAULTS,...t}:Y2.BRANDING_OPTIONS_DEFAULTS,e]},Id1=()=>i1.useAtom(Ld1),Sd1=i1.atom(null),hL=()=>({currentPage:i1.useAtomValue(Sd1)});function vL(t){return rL(t)}const _r=(t,e)=>j.flatten(t.map(c=>{if(c=e?{...c,_parent:e}:{...c},c.children){const a=[...c.children];return delete c.children,j.flatten([c,..._r(a,c._id)])}return c}));function $r(t,e=!1){for(let c=0;c<t.length;c++){const a=t[c];a.global&&!e?t[c]={type:"GlobalBlock",blockId:a.blockId,_parent:j.get(a,"_parent",null),_id:a._id}:a.children&&a.children.length&&$r(a.children)}}function fL(t){let e=[],c=j.filter(t,{type:"GlobalBlock"});return c.length>0&&(c=j.map(c,gL),j.each(c,a=>{e=[...e,...Ad1(a)]})),e}function Ad1(t){let e=[];const c=j.get(j.first(t),"_parent",null);j.set(j.first(t),"_parent",null);const a=[flatToNestedInstance.convert(pL(t))];$r(a,!0);let r=_r(a,t[0]._id);return r=j.set(r,"0._parent",c),e=[...e,r,...fL(r)],e}function gL(t){const e=j.find(ga,{_id:t._id});if(!e)return[];const c=[e],a=j.filter(ga,{_parent:t._id});return a.length?j.flatten([...c,...j.flatten(j.map(a,gL))]):j.flatten(c)}const pL=t=>JSON.parse(JSON.stringify(t));let ga=[];function Fd1(t){ga=t;const e=vL(pL(t));$r(e);const c=_r(e,null),a=fL(c),r={};return j.each(a,n=>j.set(r,j.first(n).blockId,n)),[c,r]}const mL=()=>{const[t]=he(),{currentPage:e}=hL(),[c]=Q4();return h.useCallback(()=>{const a=j.map(c,n=>j.omit(n,["expanded","order","title","siblings","tempClasses"])),[r=[]]=Fd1(a);return{currentPage:e,blocks:r}},[t,e,c])},M2=(t,e=void 0)=>{const c=i1.useAtomValue(Ur);return j.get(c,t,e)},tn=i1.atom([]);tn.debugLabel="dataProvidersAtom";const en=()=>i1.useAtom(tn),k0=i1.atom("SAVED");k0.debugLabel="builderSaveStateAtom";const zL=()=>{const[t,e]=i1.useAtom(k0),c=M2("onSavePage",async d=>{}),a=M2("onSave",async d=>{}),r=M2("onSaveStateChange",j.noop),n=mL(),[o]=en(),[l]=he();return{savePage:lg.useThrottledCallback(async()=>{e("SAVING"),r("SAVING");const d=n();return await c({blocks:d.blocks,providers:o}),await a({blocks:d.blocks,providers:o,brandingOptions:l,themeConfiguration:l}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},[n,e,l,a,r],3e3),saveState:t,setSaveState:e}},D4=new yd1;D4.setLimit(50);const ve=()=>{const[,t]=i1.useAtom(k0),e=M2("onSaveStateChange",j.noop);return h.useEffect(()=>(D4.setCallback(()=>{t("UNSAVED"),e("UNSAVED")}),()=>{D4.setCallback(j.noop)}),[]),{add:D4.add,undo:D4.undo,redo:D4.redo,hasRedo:D4.hasRedo,hasUndo:D4.hasUndo,clear:D4.clear}},cn=(t,e)=>{const c=[],a=j.filter(t,r=>j.includes(e,r._id)||j.includes(e,r._parent)?(c.push(r._id),!1):!0);return j.isEmpty(c)?a:cn(a,c)},bL=()=>{const[t]=Q4(),[e,c]=f3(),{setNewBlocks:a}=S4();return h.useCallback(r=>{var o;const n=((o=j.find(t,{_id:r[0]}))==null?void 0:o._parent)||null;a(cn(t,r)),setTimeout(()=>c(n?[n]:[]),200)},[t,c,e])};function Bd1(t,e,c,a){let r=t.filter(l=>!l._parent);c&&(r=t.filter(l=>l._parent===c));const n=a!==void 0?a:r.length;let o=t.length;for(let l=0,i=0;l<t.length;l++)if(t[l]._parent===c){if(i===n){o=l;break}i++}return!c&&a!==void 0&&a>=r.length&&(o=t.length),[...t.slice(0,o),...e,...t.slice(o)]}function Ed1(t){let e=[];return t.walk(c=>(delete c.model.children,e.push(c.model),!0)),e}function Qf(t,e){return t.first(c=>c.model._id===e)||null}function Od1(t,e,c,a){const r=Qf(t,e),n=Qf(t,c);if(r&&n){r.drop(),n.children||(n.model.children=[]);try{n.addChildAtIndex(r,a)}catch(o){return console.error("Error adding child to parent:",o),!1}return!0}return!1}function Pd1(t,e,c,a){if(!e)return t;c=c||"root";const n=new AS().parse({_id:"root",children:vL(t)});if(Od1(n,e,c,a)){const o=Ed1(n),l=o.find(i=>i._id===e);return l&&(l._parent=c==="root"?null:c),o.shift(),o}return t}const Gd1=()=>{const[,t]=Q4();return{setNewBlocks:e=>{t(e)},addBlocks:(e,c,a)=>{t(r=>Bd1(r,e,c,a))},removeBlocks:e=>{t(c=>cn(c,e))},moveBlocks:(e,c,a)=>{t(r=>{let n=r;for(let o=0;o<e.length;o++)n=Pd1(n,e[o],c,a);return n})},updateBlocksProps:e=>{t(c=>{const a=e.map(r=>r._id);return c.map(r=>{if(a.includes(r._id)){const n=j.find(e,{_id:r._id});return{...r,...j.omit(n,"_id")}}return r})})}}},Q4=()=>i1.useAtom(I4),S4=()=>{const{add:t}=ve(),[e]=Q4(),{setNewBlocks:c,addBlocks:a,removeBlocks:r,moveBlocks:n,updateBlocksProps:o}=Gd1();return{moveBlocks:(p,g,m)=>{const z=j.map(p,C=>{const w=e.find(A=>A._id===C)._parent||null,I=e.filter(A=>w?A._parent===w:!A._parent).map(A=>A._id).indexOf(C);return{_id:C,oldParent:w,oldPosition:I}}),b=z.find(({_id:C})=>C===p[0]);b&&b.oldParent===g&&b.oldPosition===m||(n(p,g,m),t({undo:()=>j.each(z,({_id:C,oldParent:V,oldPosition:w})=>{n([C],V,w)}),redo:()=>n(p,g,m)}))},addBlocks:(p,g,m)=>{a(p,g,m),t({undo:()=>r(j.map(p,"_id")),redo:()=>a(p,g,m)})},removeBlocks:p=>{var b;const g=(b=j.first(p))==null?void 0:b._parent,z=e.filter(C=>g?C._parent===g:!C._parent).indexOf(j.first(p));r(j.map(p,"_id")),t({undo:()=>a(p,g,z),redo:()=>r(j.map(p,"_id"))})},updateBlocks:(p,g,m)=>{let z=[];if(m)z=j.map(p,b=>({_id:b,...m}));else{const b=j.keys(g);z=j.map(p,C=>{const V=e.find(H=>H._id===C),w={_id:C};return j.each(b,H=>w[H]=V[H]),w})}o(j.map(p,b=>({_id:b,...g}))),t({undo:()=>o(z),redo:()=>o(j.map(p,b=>({_id:b,...g})))})},updateBlocksRuntime:(p,g)=>{o(j.map(p,m=>({_id:m,...g})))},setNewBlocks:p=>{c(p),t({undo:()=>c(e),redo:()=>c(p)})},updateMultipleBlocksProps:p=>{let g=[];g=j.map(p,m=>{const z=j.keys(m),b=e.find(V=>V._id===m._id),C={};return j.each(z,V=>C[V]=b[V]),C}),o(p),t({undo:()=>o(g),redo:()=>o(p)})}}},kd1=()=>{const[t]=Q4(),[,e]=f3(),{addBlocks:c}=S4(),a=h.useCallback((n,o,l)=>{var v;for(let f=0;f<n.length;f++){const{_id:p}=n[f];n[f]._id=W4.generateUUID();const g=j.filter(n,{_parent:p});for(let m=0;m<g.length;m++)g[m]._parent=n[f]._id}const i=j.first(n);let d,s;return o&&(d=j.find(t,{_id:o}),n[0]._parent=o,s=o),!(d?ha(d==null?void 0:d._type,i._type):!0)&&d&&(n[0]._parent=d._parent,s=d._parent),c(n,s,l),e([(v=j.first(n))==null?void 0:v._id]),j.first(n)},[t,e]);return{addCoreBlock:h.useCallback((n,o,l)=>{if(j.has(n,"blocks")){const m=n.blocks;return a(m,o,l)}const i=W4.generateUUID(),d=uL(n.props),s=[];j.forIn(d,(m,z)=>{if(j.startsWith(m,Y2.SLOT_KEY)){const b=m.replace(Y2.SLOT_KEY,"");s.push({_id:b,_type:"Slot",_parent:i,_name:n.props[z].name,_styles:n.props[z].styles,_emptyStyles:n.props[z].emptyStyles})}});const u={_type:n.type,_id:i,...d};let v,f;o&&(v=j.find(t,{_id:o}),u._parent=o,f=o),!ha(v==null?void 0:v._type,u._type)&&v&&(u._parent=v._parent,f=v._parent);const g=[u,...s];return c(g,f,l),e([u._id]),u},[a,t,e]),addPredefinedBlock:a}},_f={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},$f=["xs","sm","md","lg","xl","2xl"];function Rd1(t,e){if(e===null)return"baseClasses";const c=e.mq;if(c==="xs"||e.dark||e.mod!=="")return"classes";let a="baseClasses",r=$f.indexOf(c);for(;r>0;){const n=$f[r-1];if(j.find(t,{mq:n,property:e.property})){a="classes";break}r--}return a}const tg=[];function Nd1(t="",e="",c=[]){t=t.trim().replace(/ +/g,"");let a=j.filter(j.map(t.split(" "),l1.constructClassObject),d=>!j.isNull(d)),r=j.filter(j.map(e.split(" "),l1.constructClassObject),d=>!j.isNull(d));r=j.filter(r,d=>!j.includes(tg,d.property));const n=[],o=[];j.each(c,d=>{const s=l1.constructClassObject(d),u=j.find(a,j.pick(s,["dark","mq","mod","property"]));if(u&&(a=j.filter(a,v=>v.fullCls!==(u==null?void 0:u.fullCls))),n.push(s),s.mq==="xs"&&!s.dark&&s.mod===""&&(r=j.filter(r,v=>v.property!==s.property)),Rd1(a,s)==="baseClasses"&&!j.includes(tg,s.property)){const v=j.find(r,j.pick(s,["property"]));u&&(r=j.filter(r,f=>f.fullCls!==(v==null?void 0:v.fullCls))),o.push({...s,fullCls:s.cls,mq:"xs"})}});const l=j.map(j.sortBy([...a,...n],d=>_f[d.mq]),"fullCls").join(" ");return`${j.map(j.sortBy([...r,...o],d=>_f[d.mq]),"fullCls").join(" ").trim()},${l.trim()}`.trim().replace(/ +/g,"")}const R0=i1.atom([]);R0.debugLabel="selectedStylingBlocksAtom";const ML=()=>i1.useAtom(R0),jd1=t=>{const e=t.replace(Y2.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},Td1=i1.atom(null,(t,e,{blockIds:c,newClasses:a})=>{const r=j.filter(t(Kr),o=>c.includes(t(o)._id)),n=j.first(t(R0));return j.map(r,o=>{const l=t(o),i=j.get(l,n.prop,`${Y2.STYLES_KEY},`),{baseClasses:d,classes:s}=jd1(i);return{ids:[l._id],props:{[n.prop]:`${Y2.STYLES_KEY}${Nd1(s,d,a)}`}}})}),Dd1=()=>{const t=i1.useSetAtom(Td1),{updateBlocks:e,updateBlocksRuntime:c}=S4();return h.useCallback((a,r,n=!1)=>{const o=t({blockIds:a,newClasses:r});if(!n){c(a,o[0].props);return}e(a,o[0].props)},[t])},CL=()=>i1.useAtom(dL),wL=e4("canvasWidth",800),VL=i1.atom(t=>{const e=t(wL);return W4.getBreakpointValue(e).toLowerCase()}),qd1=()=>{const[t,e]=i1.useAtom(wL),c=i1.useAtomValue(VL),[a,r]=CL();return h.useEffect(()=>{a!=="xs"&&r(c)},[c,a,r]),[t,c,e]},Zd1=e4("canvasZoom",100),Wd1=()=>i1.useAtom(Zd1),HL=i1.atom([]),yL=()=>{const[t,e]=i1.useAtom(HL),c=i1.useSetAtom(an),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},an=i1.atom([]),Ud1=()=>{const[t,e]=i1.useAtom(an),c=i1.useSetAtom(HL),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},xL=e4("darkMode",!1),Kd1=()=>{const[t,e]=i1.useAtom(xL);return[t,e]},rn=()=>{const[t]=Q4(),[,e]=f3(),{addBlocks:c}=S4();return h.useCallback((a,r=null)=>{const n=[];j.each(a,o=>{const l=t.find(v=>v._id===o);r||(r=l._parent);const s=j.filter(t,v=>j.isString(r)?v._parent===r:!l._parent).indexOf(l)+1,u=dd1(t,o,r);c(u,r,s),n.push(j.get(u,"0._id",""))}),e(n)},[t,e])},Jd1=i1.atom([]),Yd1=()=>{const[t,e]=i1.useAtom(Jd1),c=h.useCallback(a=>{e(r=>j.includes(r,a)?j.without(r,a):[...r,a])},[e]);return[t,e,c]},Xd1=i1.atom(""),LL=()=>i1.useAtom(Xd1),Qd1=()=>{const t=i1.useAtomValue(I4);return h.useCallback((e,c)=>{const a=j.map(t,r=>(j.includes(e,j.get(r,"_id"))&&j.set(r,"_parent",c),r));console.log("newBlocks",a)},[t])},_d1=()=>{console.warn("usePasteBlocks is not implemented");const t=i1.useAtomValue(an),[e,c]=yL(),a=rn(),r=Qd1();return{canPaste:h.useMemo(()=>e.length>0||t.length>0,[t,e]),pasteBlocks:h.useCallback(o=>{j.isEmpty(t)?r(e,o):a(t,o),c(()=>[])},[e,t,a,r,c])}},$d1=i1.atom(!1),IL=()=>{const[t,e]=i1.useAtom($d1);return[t,e]},tu1=i1.atom(null,(t,e,{blockIds:c,fullClasses:a})=>{const r=j.first(t(R0)),n=j.filter(t(Kr),o=>c.includes(t(o)._id));return j.map(n,o=>{const l=t(o),i=a;let{classes:d,baseClasses:s}=ld1(j.get(l,r.prop,"styles:,"));return j.each(i,u=>{const v=u.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),f=new RegExp(`(^| )${v}($| )`,"g");d=d.replace(f," ").replace(/ +/g," ").trim();const p=j.first(u.split(":"));j.includes(["2xl","xl","lg","md","sm"],p)&&i.push(u.split(":").pop().trim())}),j.each(i,u=>{const v=new RegExp(`(^| )${u.replace("[","\\[").replace("]","\\]")}($| )`,"g");s=s.replace(v," ").replace(/ +/g," ").trim()}),{ids:[l._id],props:{[r.prop]:`${Y2.STYLES_KEY}${s},${d}`}}})}),eu1=()=>{const{updateBlocks:t}=S4(),e=i1.useSetAtom(tu1);return h.useCallback((c,a)=>{const r=e({blockIds:c,fullClasses:a});t(c,r[0].props)},[e])},SL=i1.atom(t=>{const e=j.first(t(R0)),c=t(ue);if(!e||e.blockId!==j.get(c,"_id",null))return[];const r=j.get(c,e.prop,`${Y2.STYLES_KEY},`).replace(Y2.STYLES_KEY,"").split(",").join(" ");return j.filter(j.map(r.trim().split(" "),l1.constructClassObject),n=>!j.isNull(n))}),cu1=()=>i1.useAtomValue(SL),eg={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},au1=i1.atom(t=>{const e=t(VL),c=t(Xr),a=t(xL),r=ru1(e);let n=j.filter(t(SL),{mod:c});return j.startsWith(c,"_")||(n=j.filter(n,o=>r.includes(o.mq))),n=n.sort((o,l)=>eg[o.mq]-eg[l.mq]),a||(n=j.filter(n,{dark:!1})),n}),ru1=t=>{let e=[];switch(t){case"xs":e=["xs"];break;case"sm":e=["xs","sm"];break;case"md":e=["xs","sm","md"];break;case"lg":e=["xs","sm","md","lg"];break;case"xl":e=["xs","sm","md","lg","xl"];break;case"2xl":e=["xs","sm","md","lg","xl","2xl"];break;default:e=["xs"];break}return e},nu1=()=>i1.useAtomValue(au1),ou1=()=>i1.useAtom(Xr),lu1=()=>{const{updateBlocks:t}=S4();return h.useCallback((e,c,a)=>{t(e,c,a)},[t])},iu1=()=>{const{updateMultipleBlocksProps:t}=S4();return h.useCallback(e=>{t(e)},[t])},su1=()=>{const{updateBlocksRuntime:t}=S4();return h.useCallback(async(e,c,a=30)=>{const r=j.keys(j.omit(c,["_id"]));for(const n of r){const o=c[n];if(j.isString(o)){const l=j.chunk(o.split(""),12);let i="";t([e],{[n]:""});for(let d=0;d<l.length;d++)i+=l[d].join(""),t([e],{[n]:i}),await new Promise(s=>setTimeout(s,a))}}},[t])},du1=()=>{const{updateMultipleBlocksProps:t}=S4(),e=su1();return h.useCallback(async c=>{for(const a of c)await e(a._id,a);t(c)},[t])},uu1=()=>{const{updateBlocksRuntime:t}=S4();return h.useCallback((e,c)=>{t(e,c)},[t])},AL={name:"",props:{},modalProps:{},backdropClose:!0},hu1=i1.atom(AL),vu1=()=>{const[t,e]=i1.useAtom(hu1),c=h.useCallback((r,n={},o={})=>{e({name:r,props:n,modalProps:o})},[e]),a=h.useCallback((...r)=>{j.get(t,"props.onClose",()=>{})(...r),e(AL)},[e,t]);return{activeModal:t,openModal:c,closeModal:a}},fu1=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),i1.useAtomValue(I4)),FL=i1.atom(!1);FL.debugLabel="readOnlyModeAtom";const BL=i1.atom("online");BL.debugLabel="networkModeAtom";const EL=i1.atom(!1);EL.debugLabel="editLayerNameAtom";const gu1=i1.atom("");gu1.debugLabel="activeLanguageAtom";const pu1=i1.atom("");pu1.debugLabel="primaryLanguageAtom";const OL=i1.atom(null);OL.debugLabel="canvasIframeAtom";const PL=i1.atom("outline");PL.debugLabel="activePanelAtom";const GL=i1.atom("");GL.debugLabel="showPredefinedBlockCategoryAtom";const kL=i1.atom({undoCount:0,redoCount:0});kL.debugLabel="historyStatesAtom";const RL=i1.atom("");RL.debugLabel="inlineEditingActiveAtom";const NL=i1.atom(!1);NL.debugLabel="draggingFlagAtom";const jL=i1.atom("");jL.debugLabel="draggedBlockIdAtom";const TL=i1.atom(null);TL.debugLabel="treeRefAtom";const DL=i1.atom({});DL.debugLabel="canvasSettingsAtom";const fe=i1.atom(!1);fe.debugLabel="askAiActiveBlockAtom";const mu1=i1.atom(!1);mu1.debugLabel="codeEditorOpenAtom";const zu1=e4("codeEditorHeight",500);zu1.debugLabel="codeEditorHeightAtom";const bu1=()=>i1.useAtomValue(FL),Mu1=i1.atom(""),Cu1=i1.atom(null),wu1=()=>i1.useAtom(Mu1),Vu1=()=>i1.useAtom(Cu1),Hu1=e4("selectedBreakpoints",["XS","MD","XL"]),yu1=()=>{const[t,e]=i1.useAtom(Hu1);return[t,e]},qL=()=>{const t=i1.useSetAtom(kL),{clear:e}=ve(),[,c]=f3(),[,a]=LL(),[,r]=ML(),[,n]=$2(fe);return()=>{c([]),r([]),a(""),e(),n(!1),t({undoCount:0,redoCount:0})}},xu1=()=>({data:M2("uiLibraries",[]),isLoading:!1}),Lu1=()=>{const[t,e]=h.useState(null),c=h.useCallback(async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),e(a),!0}catch(r){return console.warn("Copy failed",r),e(null),!1}},[]);return[t,c]},Iu1=i1.atom(null),Su1=()=>i1.useAtom(Iu1),ZL=k3.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"}}),WL=x.forwardRef(({className:t,variant:e,size:c,...a},r)=>L.jsxRuntimeExports.jsx(sg.Root,{ref:r,className:l1.cn(ZL({variant:e,size:c,className:t})),...a}));WL.displayName=sg.Root.displayName;const UL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Ac.Root,{className:l1.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",t),...e,ref:c,children:L.jsxRuntimeExports.jsx(Ac.Thumb,{className:l1.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")})}));UL.displayName=Ac.Root.displayName;const ge=k3.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"}}),s3=x.forwardRef(({className:t,variant:e,size:c,asChild:a=!1,...r},n)=>{const o=a?ES.Slot:"button";return L.jsxRuntimeExports.jsx(o,{className:l1.cn(ge({variant:e,size:c,className:t})),ref:n,...r})});s3.displayName="Button";const KL=A3.Root,nn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(A3.Item,{ref:c,className:l1.cn("border-b",t),...e}));nn.displayName="AccordionItem";const on=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsx(A3.Header,{className:"flex",children:L.jsxRuntimeExports.jsxs(A3.Trigger,{ref:a,className:l1.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...c,children:[e,c.hideArrow?null:L.jsxRuntimeExports.jsx(l2.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));on.displayName=A3.Trigger.displayName;const ln=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsx(A3.Content,{ref:a,className:l1.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...c,children:L.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:e})}));ln.displayName=A3.Content.displayName;const Au1=k3.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"}}),JL=x.forwardRef(({className:t,variant:e,...c},a)=>L.jsxRuntimeExports.jsx("div",{ref:a,role:"alert",className:l1.cn(Au1({variant:e}),t),...c}));JL.displayName="Alert";const YL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("h5",{ref:c,className:l1.cn("mb-1 font-medium leading-none tracking-tight",t),...e}));YL.displayName="AlertTitle";const XL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("text-sm [&_p]:leading-relaxed",t),...e}));XL.displayName="AlertDescription";const QL=k3.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"}}),Fu1=({className:t,variant:e,...c})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn(QL({variant:e}),t),...c}),_L=N2.Root,$L=N2.Trigger,tI=({className:t,...e})=>L.jsxRuntimeExports.jsx(N2.Portal,{className:l1.cn(t),...e});tI.displayName=N2.Portal.displayName;const eI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Overlay,{className:l1.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",t),...e,ref:c}));eI.displayName=N2.Overlay.displayName;const sn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsxs(tI,{children:[L.jsxRuntimeExports.jsx(eI,{}),L.jsxRuntimeExports.jsx(N2.Content,{ref:c,className:l1.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",t),...e})]}));sn.displayName=N2.Content.displayName;const dn=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});dn.displayName="AlertDialogHeader";const un=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});un.displayName="AlertDialogFooter";const hn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Title,{ref:c,className:l1.cn("text-lg font-semibold",t),...e}));hn.displayName=N2.Title.displayName;const vn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));vn.displayName=N2.Description.displayName;const fn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Action,{ref:c,className:l1.cn(ge(),t),...e}));fn.displayName=N2.Action.displayName;const gn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Cancel,{ref:c,className:l1.cn(ge({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));gn.displayName=N2.Cancel.displayName;const pn=J1.Root,cI=J1.Trigger,aI=({className:t,...e})=>L.jsxRuntimeExports.jsx(J1.Portal,{className:l1.cn(t),...e});aI.displayName=J1.Portal.displayName;const rI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Overlay,{ref:c,className:l1.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",t),...e}));rI.displayName=J1.Overlay.displayName;const pe=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(aI,{children:[L.jsxRuntimeExports.jsx(rI,{}),L.jsxRuntimeExports.jsxs(J1.Content,{ref:a,className:l1.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",t),...c,children:[e,L.jsxRuntimeExports.jsxs(J1.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:[L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=J1.Content.displayName;const nI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});nI.displayName="DialogHeader";const oI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});oI.displayName="DialogFooter";const lI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:l1.cn("text-lg font-semibold leading-none tracking-tight",t),...e}));lI.displayName=J1.Title.displayName;const iI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));iI.displayName=J1.Description.displayName;const sI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("rounded-xl border bg-card text-card-foreground shadow",t),...e}));sI.displayName="Card";const dI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("flex flex-col space-y-1.5 p-6",t),...e}));dI.displayName="CardHeader";const uI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("h3",{ref:c,className:l1.cn("font-semibold leading-none tracking-tight",t),...e}));uI.displayName="CardTitle";const hI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("p",{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));hI.displayName="CardDescription";const vI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("p-6 pt-0",t),...e}));vI.displayName="CardContent";const fI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn(" flex items-center p-6 pt-0",t),...e}));fI.displayName="CardFooter";const gI=x.forwardRef(({className:t,type:e,...c},a)=>L.jsxRuntimeExports.jsx("input",{type:e,className:l1.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",t),ref:a,...c}));gI.displayName="Input";const Bu1=k3.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(dg.Root,{ref:c,className:l1.cn(Bu1(),t),...e}));pI.displayName=dg.Root.displayName;const me=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("textarea",{className:l1.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",t),ref:c,...e}));me.displayName="Textarea";const mI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(U2.Root,{ref:a,className:l1.cn("relative overflow-hidden",t),...c,children:[L.jsxRuntimeExports.jsx(U2.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),L.jsxRuntimeExports.jsx(mn,{}),L.jsxRuntimeExports.jsx(U2.Corner,{})]}));mI.displayName=U2.Root.displayName;const mn=x.forwardRef(({className:t,orientation:e="vertical",...c},a)=>L.jsxRuntimeExports.jsx(U2.ScrollAreaScrollbar,{ref:a,orientation:e,className:l1.cn("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",t),...c,children:L.jsxRuntimeExports.jsx(U2.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mn.displayName=U2.ScrollAreaScrollbar.displayName;const zI=R3.Root,zn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.List,{ref:c,className:l1.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));zn.displayName=R3.List.displayName;const Ht=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.Trigger,{ref:c,className:l1.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",t),...e}));Ht.displayName=R3.Trigger.displayName;const yt=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.Content,{ref:c,className:l1.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));yt.displayName=R3.Content.displayName;const Eu1=H6.Portal,bI=H6.Provider,Ou1=H6.Root,Pu1=H6.Trigger,MI=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>L.jsxRuntimeExports.jsx(H6.Content,{ref:a,sideOffset:e,className:l1.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",t),...c}));MI.displayName=H6.Content.displayName;const Gu1=s0.Root,ku1=s0.Trigger,CI=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>L.jsxRuntimeExports.jsx(s0.Portal,{children:L.jsxRuntimeExports.jsx(s0.Content,{ref:r,align:e,sideOffset:c,className:l1.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",t),...a})}));CI.displayName=s0.Content.displayName;const Ru1=U1.Menu,Nu1=U1.Group,ju1=U1.Portal,Tu1=U1.Sub,Du1=U1.RadioGroup,wI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Root,{ref:c,className:l1.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...e}));wI.displayName=U1.Root.displayName;const VI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Trigger,{ref:c,className:l1.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",t),...e}));VI.displayName=U1.Trigger.displayName;const HI=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(U1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));HI.displayName=U1.SubTrigger.displayName;const yI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.SubContent,{ref:c,className:l1.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",t),...e}));yI.displayName=U1.SubContent.displayName;const xI=x.forwardRef(({className:t,align:e="start",alignOffset:c=-4,sideOffset:a=8,...r},n)=>L.jsxRuntimeExports.jsx(U1.Portal,{children:L.jsxRuntimeExports.jsx(U1.Content,{ref:n,align:e,alignOffset:c,sideOffset:a,className:l1.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",t),...r})}));xI.displayName=U1.Content.displayName;const LI=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(U1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));LI.displayName=U1.Item.displayName;const II=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs(U1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(U1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));II.displayName=U1.CheckboxItem.displayName;const SI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(U1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(U1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));SI.displayName=U1.RadioItem.displayName;const AI=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(U1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));AI.displayName=U1.Label.displayName;const FI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));FI.displayName=U1.Separator.displayName;const BI=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});BI.displayname="MenubarShortcut";const qu1=Lt.Root,Zu1=Lt.Trigger,EI=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>L.jsxRuntimeExports.jsx(Lt.Content,{ref:r,align:e,sideOffset:c,className:l1.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",t),...a}));EI.displayName=Lt.Content.displayName;const Wu1=x2.Root,Uu1=x2.Group,Ku1=x2.Value,OI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(x2.Trigger,{ref:a,className:l1.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",t),...c,children:[e,L.jsxRuntimeExports.jsx(x2.Icon,{asChild:!0,children:L.jsxRuntimeExports.jsx(l2.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));OI.displayName=x2.Trigger.displayName;const PI=x.forwardRef(({className:t,children:e,position:c="popper",...a},r)=>L.jsxRuntimeExports.jsx(x2.Portal,{children:L.jsxRuntimeExports.jsx(x2.Content,{ref:r,className:l1.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",c==="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",t),position:c,...a,children:L.jsxRuntimeExports.jsx(x2.Viewport,{className:l1.cn("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));PI.displayName=x2.Content.displayName;const GI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(x2.Label,{ref:c,className:l1.cn("px-2 py-1.5 text-sm font-semibold",t),...e}));GI.displayName=x2.Label.displayName;const kI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(x2.Item,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(x2.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),L.jsxRuntimeExports.jsx(x2.ItemText,{children:e})]}));kI.displayName=x2.Item.displayName;const RI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(x2.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));RI.displayName=x2.Separator.displayName;const Ju1=J1.Root,Yu1=J1.Trigger,Xu1=J1.Close,NI=({className:t,...e})=>L.jsxRuntimeExports.jsx(J1.Portal,{className:l1.cn(t),...e});NI.displayName=J1.Portal.displayName;const jI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Overlay,{className:l1.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",t),...e,ref:c}));jI.displayName=J1.Overlay.displayName;const Qu1=k3.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"}}),TI=x.forwardRef(({side:t="right",className:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(NI,{children:[L.jsxRuntimeExports.jsx(jI,{}),L.jsxRuntimeExports.jsxs(J1.Content,{ref:r,className:l1.cn(Qu1({side:t}),e),...a,children:[c,L.jsxRuntimeExports.jsxs(J1.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:[L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));TI.displayName=J1.Content.displayName;const DI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});DI.displayName="SheetHeader";const qI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});qI.displayName="SheetFooter";const ZI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:l1.cn("text-lg font-semibold text-foreground",t),...e}));ZI.displayName=J1.Title.displayName;const WI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));WI.displayName=J1.Description.displayName;const UI=_1.Root,KI=_1.Trigger,_u1=_1.Group,$u1=_1.Portal,th1=_1.Sub,eh1=_1.RadioGroup,JI=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(_1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));JI.displayName=_1.SubTrigger.displayName;const YI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(_1.SubContent,{ref:c,className:l1.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",t),...e}));YI.displayName=_1.SubContent.displayName;const bn=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>L.jsxRuntimeExports.jsx(_1.Portal,{children:L.jsxRuntimeExports.jsx(_1.Content,{ref:a,sideOffset:e,className:l1.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",t),...c})}));bn.displayName=_1.Content.displayName;const v6=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(_1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));v6.displayName=_1.Item.displayName;const XI=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs(_1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));XI.displayName=_1.CheckboxItem.displayName;const QI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(_1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));QI.displayName=_1.RadioItem.displayName;const Mn=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(_1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));Mn.displayName=_1.Label.displayName;const Cn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(_1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));Cn.displayName=_1.Separator.displayName;const _I=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest opacity-60",t),...e});_I.displayName="DropdownMenuShortcut";const $I=x.forwardRef(({className:t,orientation:e="horizontal",decorative:c=!0,...a},r)=>L.jsxRuntimeExports.jsx(ug.Root,{ref:r,decorative:c,orientation:e,className:l1.cn("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));$I.displayName=ug.Root.displayName;const ch1=1,ah1=1e6;let Ic=0;function rh1(){return Ic=(Ic+1)%Number.MAX_VALUE,Ic.toString()}const Sc=new Map,cg=t=>{if(Sc.has(t))return;const e=setTimeout(()=>{Sc.delete(t),i0({type:"REMOVE_TOAST",toastId:t})},ah1);Sc.set(t,e)},tS=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,ch1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(c=>c.id===e.toast.id?{...c,...e.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=e;return c?cg(c):t.toasts.forEach(a=>{cg(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===c||c===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(c=>c.id!==e.toastId)}}},D8=[];let q8={toasts:[]};function i0(t){q8=tS(q8,t),D8.forEach(e=>{e(q8)})}function eS({...t}){const e=rh1(),c=r=>i0({type:"UPDATE_TOAST",toast:{...r,id:e}}),a=()=>i0({type:"DISMISS_TOAST",toastId:e});return i0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||a()}}}),{id:e,dismiss:a,update:c}}function wn(){const[t,e]=x.useState(q8);return x.useEffect(()=>(D8.push(e),()=>{const c=D8.indexOf(e);c>-1&&D8.splice(c,1)}),[t]),{...t,toast:eS,dismiss:c=>i0({type:"DISMISS_TOAST",toastId:c})}}const nh1=d4.Provider,cS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Viewport,{ref:c,className:l1.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]",t),...e}));cS.displayName=d4.Viewport.displayName;const oh1=k3.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"}}),aS=x.forwardRef(({className:t,variant:e,...c},a)=>L.jsxRuntimeExports.jsx(d4.Root,{ref:a,className:l1.cn(oh1({variant:e}),t),...c}));aS.displayName=d4.Root.displayName;const lh1=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Action,{ref:c,className:l1.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",t),...e}));lh1.displayName=d4.Action.displayName;const rS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Close,{ref:c,className:l1.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",t),"toast-close":"",...e,children:L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"})}));rS.displayName=d4.Close.displayName;const nS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Title,{ref:c,className:l1.cn("text-sm font-semibold [&+div]:text-xs",t),...e}));nS.displayName=d4.Title.displayName;const oS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Description,{ref:c,className:l1.cn("text-sm opacity-90",t),...e}));oS.displayName=d4.Description.displayName;function lS(){const{toasts:t}=wn();return L.jsxRuntimeExports.jsxs(nh1,{children:[t.map(({id:e,title:c,description:a,action:r,...n})=>L.jsxRuntimeExports.jsxs(aS,{...n,children:[L.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[c&&L.jsxRuntimeExports.jsx(nS,{children:c}),a&&L.jsxRuntimeExports.jsx(oS,{children:a})]}),r,L.jsxRuntimeExports.jsx(rS,{})]},e)),L.jsxRuntimeExports.jsx(cS,{})]})}const Vn=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("animate-pulse rounded-md bg-primary/10",t),...e}),Hn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command,{ref:c,className:l1.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Hn.displayName=Q2.Command.displayName;const ih1=({children:t,...e})=>L.jsxRuntimeExports.jsx(pn,{...e,children:L.jsxRuntimeExports.jsx(pe,{className:"overflow-hidden p-0",children:L.jsxRuntimeExports.jsx(Hn,{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:t})})}),iS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[L.jsxRuntimeExports.jsx(l2.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),L.jsxRuntimeExports.jsx(Q2.Command.Input,{ref:c,className:l1.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",t),...e})]}));iS.displayName=Q2.Command.Input.displayName;const sS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.List,{ref:c,className:l1.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));sS.displayName=Q2.Command.List.displayName;const dS=x.forwardRef((t,e)=>L.jsxRuntimeExports.jsx(Q2.Command.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));dS.displayName=Q2.Command.Empty.displayName;const uS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Group,{ref:c,className:l1.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",t),...e}));uS.displayName=Q2.Command.Group.displayName;const hS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Separator,{ref:c,className:l1.cn("-mx-1 h-px bg-border",t),...e}));hS.displayName=Q2.Command.Separator.displayName;const vS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Item,{ref:c,className:l1.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",t),...e}));vS.displayName=Q2.Command.Item.displayName;const fS=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});fS.displayName="CommandShortcut";const sh1=$1.Root,dh1=$1.Trigger,uh1=$1.Group,hh1=$1.Portal,vh1=$1.Sub,fh1=$1.RadioGroup,gS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs($1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));gS.displayName=$1.SubTrigger.displayName;const pS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.SubContent,{ref:c,className:l1.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",t),...e}));pS.displayName=$1.SubContent.displayName;const mS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.Portal,{children:L.jsxRuntimeExports.jsx($1.Content,{ref:c,className:l1.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",t),...e})}));mS.displayName=$1.Content.displayName;const zS=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx($1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));zS.displayName=$1.Item.displayName;const bS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs($1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx($1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));bS.displayName=$1.CheckboxItem.displayName;const MS=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs($1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx($1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));MS.displayName=$1.RadioItem.displayName;const CS=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx($1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...c}));CS.displayName=$1.Label.displayName;const wS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-border",t),...e}));wS.displayName=$1.Separator.displayName;const VS=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});VS.displayName="ContextMenuShortcut";const gh1=t=>{try{const e=document.getElementById("icon-picker-field"),c=document.createElement("div");pa.render(L.jsxRuntimeExports.jsx(ig.IconPickerItem,{value:t}),c),e.appendChild(c),c.hidden=!0;let a=c.innerHTML;setTimeout(()=>e.removeChild(c),100);const n=new DOMParser().parseFromString(a,"image/svg+xml"),o=n.querySelector("svg");return o&&(o.removeAttribute("width"),o.removeAttribute("height")),new XMLSerializer().serializeToString(n)}catch(e){return console.error(e),""}},ph1=({value:t,onChange:e})=>{const c=a=>{e("<svg />");const r=gh1(a);e(r)};return L.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[L.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[L.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t?t.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),L.jsxRuntimeExports.jsx(ig,{value:t?"BiSolidGrid":null,onChange:c,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"}})]}),L.jsxRuntimeExports.jsx("textarea",{value:t,onChange:a=>e(a.target.value),className:"h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},mh1=h.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-5IlwWgRv.cjs"))),zh1=h.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-UjtFHUqM.cjs"))),HS=({isModalView:t=!1,onSelect:e=()=>{}})=>{const c=M2("uploadMediaCallback"),a=M2("unsplashAccessKey"),r=c===void 0,n=a===void 0,[o,l]=h.useState(n?"upload":r?"unsplash":"upload");return L.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[L.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:L.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:t&&r?"Unsplash images":t?"Select or upload images":"Images"})}),L.jsxRuntimeExports.jsxs(zI,{value:o,onValueChange:i=>l(i),className:"flex h-full w-full flex-col py-2",children:[!(r||n)&&L.jsxRuntimeExports.jsxs(zn,{className:"w-full",children:[L.jsxRuntimeExports.jsx(Ht,{value:"upload",className:"w-full",children:"Upload"}),L.jsxRuntimeExports.jsx(Ht,{value:"unsplash",className:"w-full",children:"Unsplash"})]}),o==="unsplash"?L.jsxRuntimeExports.jsx(yt,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:L.jsxRuntimeExports.jsx(mh1,{isModalView:t,onSelect:e})})}):L.jsxRuntimeExports.jsx(yt,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:L.jsxRuntimeExports.jsx(zh1,{isModalView:t,onSelect:e})})})]})]})},bh1=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),ag=({children:t,onSelect:e})=>{const[c,a]=h.useState(!1),r=(...n)=>{e.call(void 0,...n),a(!1)};return L.jsxRuntimeExports.jsxs(pn,{open:c,onOpenChange:n=>a(n),children:[L.jsxRuntimeExports.jsx(cI,{asChild:!0,children:t}),L.jsxRuntimeExports.jsx(pe,{className:"flex h-3/4 max-w-5xl",children:L.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:L.jsxRuntimeExports.jsx(HS,{isModalView:!0,onSelect:r})})})]})},Mh1=({value:t,onChange:e,id:c,onBlur:a})=>{const r=M2("uploadMediaCallback"),n=M2("unsplashAccessKey"),o=r===void 0,l=n===void 0;return L.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?L.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):L.jsxRuntimeExports.jsx(ag,{onSelect:e,children:L.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"})}),L.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[!(o&&l)&&L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(ag,{onSelect:e,children:L.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:t||!j.isEmpty(t)?"Replace Image":"Choose Image"})}),L.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),L.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:i}})=>a(c,i),onChange:i=>e(i.target.value)})]})]})},Ch1=({id:t,placeholder:e,value:c,onChange:a,onBlur:r})=>{const n={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},o=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:L.jsxRuntimeExports.jsx(JS,{id:t,value:c,onBlur:l=>r(t,l),onChange:l=>a(l),modules:n,formats:o,placeholder:e,className:"mt-1 rounded-md"})},wh1=({schema:t,formData:e,onChange:c})=>{const[a,r]=h.useState([]),n=M2("getPages",()=>[]),{type:o="page",href:l="",target:i="self"}=e;return h.useEffect(()=>{(async()=>{const d=await n();r(d||[])})()},[]),L.jsxRuntimeExports.jsxs("div",{children:[L.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),L.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[L.jsxRuntimeExports.jsx("select",{name:"type",value:o,onChange:d=>c({...e,type:d.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(d=>L.jsxRuntimeExports.jsx("option",{value:d.const,children:d.title},d.const))}),o==="page"?L.jsxRuntimeExports.jsxs("select",{name:"href",value:l,onChange:d=>c({...e,href:d.target.value||"#"}),children:[L.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),j.map(a,d=>L.jsxRuntimeExports.jsx("option",{value:d.slug,children:d.name},d.uuid))]}):L.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:l,onChange:d=>c({...e,href:d.target.value||"#"}),placeholder:o==="page"||o==="url"?"Enter URL":o==="scroll"?"#ElementID":"Enter detail"}),(o==="page"||o==="url")&&L.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[L.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:i==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>c({...e,target:i==="_blank"?"_self":"_blank"})}),L.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Vh1=()=>{const[t,e]=IL(),{t:c}=xt.useTranslation(),a=M2("previewComponent",null);return t?L.jsxRuntimeExports.jsxs("div",{className:W4.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[L.jsxRuntimeExports.jsxs(s3,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>e(!1),children:[L.jsxRuntimeExports.jsx(l2.EyeClosedIcon,{}),L.jsxRuntimeExports.jsx("span",{children:c("Close Preview")})]}),L.jsxRuntimeExports.jsx("div",{children:a?L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx(Vn,{className:"h-96 w-full"}),children:h.createElement(a)}):null})]}):null},Hh1=()=>{const[t,e]=f3(),c=bL(),a=rn(),{undo:r,redo:n}=ve();E6.useHotkeys("esc",()=>e([]),{},[e]),E6.useHotkeys("ctrl+d,command+d",()=>a(t),{preventDefault:!0},[t,a]),E6.useHotkeys("ctrl+z,command+z",()=>r(),{},[r]),E6.useHotkeys("ctrl+y,command+y",()=>n(),{},[n]),E6.useHotkeys("del, backspace",o=>{o.preventDefault(),c(t)},{},[t,c])},yh1=(t,e)=>{const c=[];let a=j.find(t,{_id:e}),r=j.get(a,"_parent","");for(;j.isString(r)&&!j.isEmpty(r);)c.push(a==null?void 0:a._parent),a=j.find(t,{_id:r}),r=a==null?void 0:a._parent;return j.flatten(c)},xh1=i1.atom([]),Lh1=()=>{const[t]=f3(),e=i1.useAtomValue(I4),[,c]=i1.useAtom(xh1);h.useEffect(()=>{let a=[];const r=j.first(t);j.isString(r)&&(a=[r,...yh1(e,r)]),c(a)},[t,e,c])};const yS=()=>i1.useAtom(eL),Ih1=()=>h.useMemo(()=>G3.getChaiDataProviders(),[]),Sh1=({children:t})=>{const[,e]=yS(),[c]=en(),a=Ih1();return h.useEffect(()=>(e({}),j.each(c,r=>{const n=j.find(a,{providerKey:r.providerKey});if(n){const o=(n==null?void 0:n.mockFn)||(n==null?void 0:n.dataFn);o&&o(r.args).then(l=>e(i=>({...i,[r.providerKey]:l})))}}),()=>{j.each(c,r=>{e(n=>(delete n[r.providerKey],n))})}),[a,c,e]),L.jsxRuntimeExports.jsx(L.jsxRuntimeExports.Fragment,{children:t})};function Ah1(t,e,c){c.push(j.find(t,{_id:e}));const a=j.filter(t,{_parent:e});for(const r of a)c.push(...xS(r._id,t));return c}const xS=(t,e)=>{let c=[];return c=j.flattenDeep([...c,...Ah1(e,t,c)]),c},Fh1=i1.atom(!1),yn=()=>{const[t,e]=i1.useAtom(Fh1),[c,a]=h.useState(null),r=M2("askAiCallBack",null),n=du1(),o=iu1(),[l]=Q4();return{askAi:h.useCallback(async(i,d,s,u)=>{if(r){e(!0),a(null);try{const v=i==="content"?j.cloneDeep(xS(d,l)):[j.cloneDeep(l.find(g=>g._id===d))];j.set(v,"0._parent",null);const{blocks:f,error:p}=await r(i,s,v);if(p){a(p);return}i==="styles"?o(f):n(f)}catch(v){a(v)}finally{e(!1),u&&u()}}},[r,e,l,o,n]),loading:t,error:c}};function Bh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"},child:[]}]})(t)}function Eh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"},child:[]}]})(t)}function LS(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"},child:[]}]})(t)}function Oh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(t)}function Ph1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V299.6l-94.7 94.7c-8.2 8.2-14 18.5-16.8 29.7l-15 60.1c-2.3 9.4-1.8 19 1.4 27.8H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"},child:[]}]})(t)}const Gh1=[{name:"Improve writing",icon:Ph1,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Replace placeholder content",icon:Eh1,prompt:"Discard current placeholder content and replace with meaningful relevant content."},{name:"Fix grammar",icon:l2.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:l2.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:l2.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:L3.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:L3.ShuffleIcon,prompt:"Randomize all text elements."}];function kh1({onClick:t}){const{loading:e}=yn();return L.jsxRuntimeExports.jsx("div",{className:e?"pointer-events-none opacity-50":"",children:L.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:Gh1.map(({name:c,icon:a,subMenus:r,prompt:n})=>r?L.jsxRuntimeExports.jsxs(UI,{children:[L.jsxRuntimeExports.jsx(KI,{asChild:!0,children:L.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[L.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{children:c})]},c)}),L.jsxRuntimeExports.jsxs(bn,{children:[L.jsxRuntimeExports.jsx(Mn,{children:"My Account"}),L.jsxRuntimeExports.jsx(Cn,{}),L.jsxRuntimeExports.jsx(v6,{children:"Profile"}),L.jsxRuntimeExports.jsx(v6,{children:"Billing"}),L.jsxRuntimeExports.jsx(v6,{children:"Team"}),L.jsxRuntimeExports.jsx(v6,{children:"Subscription"})]})]}):L.jsxRuntimeExports.jsxs("li",{onClick:()=>t(n),className:"flex cursor-pointer items-center space-x-2 rounded p-1 pl-2 text-sm hover:bg-gray-100",children:[L.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{children:c})]},c))})})}const Rh1=({blockId:t})=>{const{t:e}=xt.useTranslation(),{askAi:c,loading:a,error:r}=yn(),[n,o]=h.useState(""),l=h.useRef(null);h.useEffect(()=>{var d;(d=l.current)==null||d.focus()},[]);const i=()=>{r||o("")};return t?L.jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[L.jsxRuntimeExports.jsxs("h2",{className:"mb-2 text-xs font-semibold leading-none tracking-tight text-gray-500",children:[e("Ask AI")," (GPT-4o mini)"]}),L.jsxRuntimeExports.jsx(me,{ref:l,value:n,onChange:d=>o(d.target.value),placeholder:e("Ask AI to edit content"),className:"w-full border border-gray-400 focus:border-0",rows:3,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c("content",t,n,i))}}),L.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[a?null:L.jsxRuntimeExports.jsx(s3,{disabled:n.trim().length<5||a,onClick:()=>c("content",t,n,i),variant:"default",className:"w-fit",size:"sm",children:a?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Edit with AI")}),a?L.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsxRuntimeExports.jsxs(Vn,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[L.jsxRuntimeExports.jsx(LS,{className:"h-4 w-4 animate-spin text-gray-500"}),L.jsxRuntimeExports.jsx("p",{className:"text-xs",children:e("Generating... Please wait")})]}),L.jsxRuntimeExports.jsx(s3,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:e("Stop")})]}):null]}),L.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r&&L.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:r.message})}),L.jsxRuntimeExports.jsx(kh1,{onClick:d=>c("content",t,d,i)})]}):L.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:L.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[L.jsxRuntimeExports.jsx(L3.SparklesIcon,{className:"mx-auto text-3xl"}),L.jsxRuntimeExports.jsx("h1",{children:e("no_block_selected_for_ask_ai")})]})})},Nh1=({onOpen:t})=>{const{t:e}=xt.useTranslation(),c=M2("aiContext",""),[a,r]=h.useState(c),n=h.useRef(null),o=M2("saveAiContextCallback",j.noop),[l,i]=h.useState(!1),[d,s]=h.useState(null),[u,v]=h.useState(!1),{toast:f}=wn(),p=h.useRef(null);h.useEffect(()=>{c&&r(c)},[c]);const g=async()=>{try{i(!0),s(null),await o(a),f({title:e("AI Context updated"),description:e("You can now ask AI to edit your content"),variant:"default"}),p.current.click()}catch(m){s(m)}finally{i(!1)}};return L.jsxRuntimeExports.jsx(KL,{onValueChange:m=>{t(m!==""),v(m!=="")},type:"single",collapsible:!0,className:"rounded-md border bg-gray-100 px-2",children:L.jsxRuntimeExports.jsxs(nn,{value:"set-context",children:[L.jsxRuntimeExports.jsx(on,{ref:p,hideArrow:!0,className:"py-1 hover:no-underline",children:L.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between",children:[L.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:e("AI Context")}),L.jsxRuntimeExports.jsxs(s3,{variant:"default",size:"sm",children:[L.jsxRuntimeExports.jsx("span",{children:e(u?"Cancel":"Edit")})," ",u?L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}):L.jsxRuntimeExports.jsx(L3.EditIcon,{className:"h-4 w-4"})]})]})}),L.jsxRuntimeExports.jsxs(ln,{children:[L.jsxRuntimeExports.jsx(me,{ref:n,value:a,onChange:m=>r(m.target.value),placeholder:e("Tell about this page. Eg: This page is about ..."),className:"w-full border border-gray-400 bg-background focus:border",rows:10,onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),g())}}),c.trim().length===0?L.jsxRuntimeExports.jsx("p",{className:"mt-2 text-xs text-gray-500",children:e("Eg: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.")}):null,L.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex items-center",children:[L.jsxRuntimeExports.jsx(s3,{disabled:a.trim().length<5,onClick:()=>g(),variant:"default",className:"w-fit",size:"sm",children:l?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Save")}),c.trim().length>0?L.jsxRuntimeExports.jsxs(_L,{children:[L.jsxRuntimeExports.jsx($L,{asChild:!0,children:L.jsxRuntimeExports.jsx(s3,{disabled:c.trim().length===0,variant:"ghost",className:"w-fit",size:"sm",children:l?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Delete")})}),L.jsxRuntimeExports.jsxs(sn,{children:[L.jsxRuntimeExports.jsxs(dn,{children:[L.jsxRuntimeExports.jsx(hn,{children:e("Remove context?")}),L.jsxRuntimeExports.jsx(vn,{})]}),L.jsxRuntimeExports.jsxs(un,{children:[L.jsxRuntimeExports.jsx(gn,{children:e("Cancel")}),L.jsxRuntimeExports.jsx(fn,{onClick:()=>{r(""),g()},children:"Yes, Delete"})]})]})]}):null]}),L.jsxRuntimeExports.jsx("div",{className:"mt-2 max-w-full",children:d&&L.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:d.message})})]})]})})},jh1=()=>{const[t]=f3(),[e,c]=h.useState(!1);return L.jsxRuntimeExports.jsxs("div",{className:"absolute inset-0 z-50 h-full w-full bg-background p-2",children:[L.jsxRuntimeExports.jsx(Nh1,{onOpen:a=>c(a)}),e?null:L.jsxRuntimeExports.jsx(Rh1,{blockId:j.first(t)})]})},Th1=h.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-YAKKqxIi.cjs"))),Dh1=h.lazy(()=>Promise.resolve().then(()=>require("./Topbar-9mJ6dJn-.cjs"))),qh1=h.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-nWHWl6zD.cjs"))),Zh1=h.lazy(()=>Promise.resolve().then(()=>require("./Settings-AcK9rEs3.cjs"))),Wh1=()=>{const{savePage:t}=zL(),e=M2("autoSaveSupport",!0),c=M2("autoSaveInterval",60);lg.useIntervalEffect(()=>{e&&t()},c*1e3)},Uh1=()=>{const[t]=i1.useAtom(k0),[e]=i1.useAtom(fe),c=n=>{od1()||n.preventDefault()};Hh1(),Lh1(),Wh1(),h.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=M2("editable",!0),r=M2("nonEditableComponent",null);return L.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:L.jsxRuntimeExports.jsxs(bI,{children:[L.jsxRuntimeExports.jsxs("div",{onContextMenu:c,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[L.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Dh1,{})})}),L.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:L.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(r)})}),L.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Th1,{})})}),L.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(qh1,{})})}),L.jsxRuntimeExports.jsxs("div",{className:"relative flex h-[100%] w-[280px] min-w-[280px] border-l border-border pb-10",children:[L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Zh1,{})}),e?L.jsxRuntimeExports.jsx(jh1,{}):null]})]})]}),L.jsxRuntimeExports.jsx(Vh1,{})]})})},rg=i1.getDefaultStore(),Kh1=()=>L.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:L.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:L.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[L.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),L.jsxRuntimeExports.jsx("br",{}),L.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),L.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})});let Jh1=!1;const Yh1=t=>{Jh1=t};const Xh1=t=>{const[,e]=Q4(),[,c]=he(),a=qL();return h.useEffect(()=>{rg.set(Ur,j.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),h.useEffect(()=>{rg.set(tn,t.dataProviders||[])},[t.dataProviders]),h.useEffect(()=>{e(G3.syncBlocksWithDefaults(t.blocks||[])),a()},[t.blocks]),h.useEffect(()=>{og.changeLanguage(t.locale||"en")},[t.locale]),h.useEffect(()=>{Yh1(t.showDebugLogs)},[t.showDebugLogs]),h.useEffect(()=>{c(t.brandingOptions)},[t.brandingOptions,c]),L.jsxRuntimeExports.jsx(Uh1,{})},Qh1=t=>{const e=t._flags||{};return L.jsxRuntimeExports.jsxs(cL,{children:[L.jsxRuntimeExports.jsxs(SS.FlagsProvider,{features:{...nd1,...e},children:[L.jsxRuntimeExports.jsx(cd1,{}),L.jsxRuntimeExports.jsx(Kh1,{}),L.jsxRuntimeExports.jsx(Xh1,{...t})]}),L.jsxRuntimeExports.jsx(lS,{})]})};exports.Accordion=KL;exports.AccordionContent=ln;exports.AccordionItem=nn;exports.AccordionTrigger=on;exports.Alert=JL;exports.AlertDescription=XL;exports.AlertDialog=_L;exports.AlertDialogAction=fn;exports.AlertDialogCancel=gn;exports.AlertDialogContent=sn;exports.AlertDialogDescription=vn;exports.AlertDialogFooter=un;exports.AlertDialogHeader=dn;exports.AlertDialogTitle=hn;exports.AlertDialogTrigger=$L;exports.AlertTitle=YL;exports.Badge=Fu1;exports.BlocksExternalDataProvider=Sh1;exports.Button=s3;exports.Card=sI;exports.CardContent=vI;exports.CardDescription=hI;exports.CardFooter=fI;exports.CardHeader=dI;exports.CardTitle=uI;exports.ChaiBuilderEditor=Qh1;exports.Command=Hn;exports.CommandDialog=ih1;exports.CommandEmpty=dS;exports.CommandGroup=uS;exports.CommandInput=iS;exports.CommandItem=vS;exports.CommandList=sS;exports.CommandSeparator=hS;exports.CommandShortcut=fS;exports.ContextMenu=sh1;exports.ContextMenuCheckboxItem=bS;exports.ContextMenuContent=mS;exports.ContextMenuGroup=uh1;exports.ContextMenuItem=zS;exports.ContextMenuLabel=CS;exports.ContextMenuPortal=hh1;exports.ContextMenuRadioGroup=fh1;exports.ContextMenuRadioItem=MS;exports.ContextMenuSeparator=wS;exports.ContextMenuShortcut=VS;exports.ContextMenuSub=vh1;exports.ContextMenuSubContent=pS;exports.ContextMenuSubTrigger=gS;exports.ContextMenuTrigger=dh1;exports.Dialog=pn;exports.DialogContent=pe;exports.DialogDescription=iI;exports.DialogFooter=oI;exports.DialogHeader=nI;exports.DialogTitle=lI;exports.DialogTrigger=cI;exports.DropdownMenu=UI;exports.DropdownMenuCheckboxItem=XI;exports.DropdownMenuContent=bn;exports.DropdownMenuGroup=_u1;exports.DropdownMenuItem=v6;exports.DropdownMenuLabel=Mn;exports.DropdownMenuPortal=$u1;exports.DropdownMenuRadioGroup=eh1;exports.DropdownMenuRadioItem=QI;exports.DropdownMenuSeparator=Cn;exports.DropdownMenuShortcut=_I;exports.DropdownMenuSub=th1;exports.DropdownMenuSubContent=YI;exports.DropdownMenuSubTrigger=JI;exports.DropdownMenuTrigger=KI;exports.ErrorBoundary=cL;exports.FaCircleCheck=Oh1;exports.FaMoon=Bh1;exports.FaSpinner=LS;exports.HoverCard=qu1;exports.HoverCardContent=EI;exports.HoverCardTrigger=Zu1;exports.IconPickerField=ph1;exports.ImagePickerField=Mh1;exports.ImagesPanel=bh1;exports.Input=gI;exports.Label=pI;exports.LinkField=wh1;exports.Menubar=wI;exports.MenubarCheckboxItem=II;exports.MenubarContent=xI;exports.MenubarGroup=Nu1;exports.MenubarItem=LI;exports.MenubarLabel=AI;exports.MenubarMenu=Ru1;exports.MenubarPortal=ju1;exports.MenubarRadioGroup=Du1;exports.MenubarRadioItem=SI;exports.MenubarSeparator=FI;exports.MenubarShortcut=BI;exports.MenubarSub=Tu1;exports.MenubarSubContent=yI;exports.MenubarSubTrigger=HI;exports.MenubarTrigger=VI;exports.Popover=Gu1;exports.PopoverContent=CI;exports.PopoverTrigger=ku1;exports.RichTextEditorField=Ch1;exports.ScrollArea=mI;exports.ScrollBar=mn;exports.Select=Wu1;exports.SelectContent=PI;exports.SelectGroup=Uu1;exports.SelectItem=kI;exports.SelectLabel=GI;exports.SelectSeparator=RI;exports.SelectTrigger=OI;exports.SelectValue=Ku1;exports.Separator=$I;exports.Sheet=Ju1;exports.SheetClose=Xu1;exports.SheetContent=TI;exports.SheetDescription=WI;exports.SheetFooter=qI;exports.SheetHeader=DI;exports.SheetTitle=ZI;exports.SheetTrigger=Yu1;exports.Skeleton=Vn;exports.Switch=UL;exports.Tabs=zI;exports.TabsContent=yt;exports.TabsList=zn;exports.TabsTrigger=Ht;exports.Textarea=me;exports.Toaster=lS;exports.Toggle=WL;exports.Tooltip=Ou1;exports.TooltipContent=MI;exports.TooltipPortal=Eu1;exports.TooltipProvider=bI;exports.TooltipTrigger=Pu1;exports.activePanelAtom=PL;exports.aiAssistantActiveAtom=fe;exports.atomWithStorage=e4;exports.badgeVariants=QL;exports.builderSaveStateAtom=k0;exports.buttonVariants=ge;exports.canAcceptChildBlock=ha;exports.canDeleteBlock=sd1;exports.canDuplicateBlock=id1;exports.canvasIframeAtom=OL;exports.canvasSettingsAtom=DL;exports.convertDotNotationToObject=Vd1;exports.draggedBlockIdAtom=jL;exports.draggingFlagAtom=NL;exports.editLayerNameAtom=EL;exports.getBlockJSONFromSchemas=fa;exports.getBlockJSONFromUISchemas=va;exports.inlineEditingActiveAtom=RL;exports.networkModeAtom=BL;exports.reducer=tS;exports.showPredefinedBlockCategoryAtom=GL;exports.toast=eS;exports.toggleVariants=ZL;exports.treeDSBlocks=oL;exports.treeRefAtom=TL;exports.useActiveModal=vu1;exports.useActivePanel=wu1;exports.useAddBlock=kd1;exports.useAddBlockParent=Vu1;exports.useAddClassesToBlocks=Dd1;exports.useAllBlocks=fu1;exports.useAskAi=yn;exports.useBlocksContainer=Id1;exports.useBlocksStore=Q4;exports.useBlocksStoreUndoableActions=S4;exports.useBrandingOptions=he;exports.useBuilderProp=M2;exports.useBuilderReset=qL;exports.useCanvasWidth=qd1;exports.useCanvasZoom=Wd1;exports.useChaiExternalData=yS;exports.useCodeEditor=Su1;exports.useCopyBlockIds=Ud1;exports.useCopyToClipboard=Lu1;exports.useCurrentPage=hL;exports.useCutBlockIds=yL;exports.useDarkMode=Kd1;exports.useDuplicateBlocks=rn;exports.useGetPageData=mL;exports.useHiddenBlockIds=Yd1;exports.useHighlightBlockId=LL;exports.usePageDataProviders=en;exports.usePasteBlocks=_d1;exports.usePreviewMode=IL;exports.useReadOnlyMode=bu1;exports.useRemoveBlocks=bL;exports.useRemoveClassesFromBlocks=eu1;exports.useSavePage=zL;exports.useSelectedBlock=md1;exports.useSelectedBlockAllClasses=cu1;exports.useSelectedBlockCanvasSetting=Md1;exports.useSelectedBlockCurrentClasses=nu1;exports.useSelectedBlockIds=f3;exports.useSelectedBlocksDisplayChild=pd1;exports.useSelectedBreakpoints=yu1;exports.useSelectedStylingBlocks=ML;exports.useStylingBreakpoint=CL;exports.useStylingState=ou1;exports.useToast=wn;exports.useUILibraryBlocks=xu1;exports.useUndoManager=ve;exports.useUpdateBlocksProps=lu1;exports.useUpdateBlocksPropsRealtime=uu1;
|
|
206
|
+
*/Z();var cd1=process.env.NODE_ENV!=="production"?ed1:()=>null;function ad1(){return new URLSearchParams(window.location.search).has("dnd")}function rd1(){return new URLSearchParams(window.location.search).has("outline")}const nd1={dnd:ad1(),arborist:rd1()},Ur=i1.atom(null);Ur.debugLabel="chaiBuilderPropsAtom";const eL=i1.atom({});eL.debugLabel="chaiExternalDataAtom";class cL extends h.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?L.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[L.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),L.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const od1=()=>!1,ld1=t=>{const e=t.replace(Y2.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},ha=j.memoize((t,e)=>{if(!t)return!0;const c=G3.getBlockComponent(t);return c&&j.has(c,"canAcceptBlock")?c.canAcceptBlock(e):!1}),Mv1=j.memoize((t,e)=>{const c=G3.getBlockComponent(e);return c&&j.has(c,"canBeNested")?c.canBeNested(t):!0}),id1=j.memoize(t=>{const e=G3.getBlockComponent(t);return e&&j.has(e,"canDuplicate")?e.canDuplicate():!0}),sd1=j.memoize(t=>{const e=G3.getBlockComponent(t);return e&&j.has(e,"canDelete")?e.canDelete():!0});function aL(t,e,c){const a=j.filter(t,n=>n._parent===e),r=[];for(let n=0;n<a.length;n++){const o=nL(a[n]);if(Object.keys(o).length>0&&Object.keys(o).forEach(l=>{a[n][l]=`slot:${W4.generateUUID()}`}),j.filter(t,{_parent:a[n]._id}).length>0){const l=W4.generateUUID();r.push({...a[n],oldId:a[n]._id,_id:l,_parent:c}),r.push(j.flatten(aL(t,a[n]._id,l)))}else r.push({...a[n],oldId:a[n]._id,_id:W4.generateUUID(),_parent:c})}return j.flatten(r)}function rL(t){const e={};t.forEach(a=>{e[a._id]={...a,children:[]}});const c=[];return t.forEach(a=>{if(a._parent){const r=e[a._parent];r&&r.children.push(e[a._id])}else c.push(e[a._id])}),c}const nL=t=>{const e={};return Object.keys(t).forEach(c=>{j.isString(t[c])&&t[c].startsWith("slot")&&(e[c]=t[c].replace("slot:",""))}),e},dd1=(t,e,c=null)=>{let a=j.find(t,{_id:e});a={...a,oldId:a._id,_id:W4.generateUUID()},c&&(a={...a,_parent:c});const r=[a];j.filter(t,{_parent:e}).length>0&&r.push(j.flatten(aL(t,e,a._id)));const n=j.flatten(r);return j.map(n,o=>{const l=o,i=nL(l);return Object.keys(i).length>0&&Object.keys(i).forEach(d=>{const s=j.find(n,{oldId:i[d].replace("slot:","")});l[d]=`slot:${s._id}`}),j.omit(l,["global","oldId"])})};const I4=i1.atom([]);I4.debugLabel="presentBlocksAtom";const oL=i1.atom(t=>{const e=t(I4);return rL([...e])});oL.debugLabel="treeDSBlocks";I4.debugLabel="presentBlocksAtom";const Kr=ee1(I4);Kr.debugLabel="pageBlocksAtomsAtom";const ud1=i1.atom("");ud1.debugLabel="builderActivePageAtom";const hd1=i1.atom(-1);hd1.debugLabel="destinationDropIndexAtom";const lL=i1.atom([]);lL.debugLabel="buildingBlocksAtom";const vd1=i1.atom(t=>{const e=t(lL);return j.filter(e,c=>j.has(c,"blockId"))});vd1.debugLabel="globalBlocksAtom";const Jr=i1.atom([]);Jr.debugLabel="selectedBlockIdsAtom";const Yr=i1.atom(t=>{const e=t(I4),c=t(Jr);return j.map(j.filter(e,({_id:a})=>j.includes(c,a)),a=>({...a}))});Yr.debugLabel="selectedBlocksAtom";const ue=i1.atom(t=>{const e=t(Yr);if(e.length===0)return null;if(e.length===1)return e[0]});ue.debugLabel="selectedBlockAtom";const fd1=t=>j.get(t,"_parent",null),gd1=i1.atom(t=>{const e=t(Yr),c=j.map(e,fd1);return j.filter(t(I4),a=>j.includes(c,a._id))});gd1.debugLabel="selectedBlocksParentsAtom";const iL=i1.atom(()=>!1);iL.debugLabel="selectedBlockFlexChildAtom";const sL=i1.atom(()=>!1);sL.debugLabel="selectedBlockGridChildAtom";const Xr=i1.atom("");Xr.debugLabel="styleStateAtom";const dL=e4("styleBreakpoint","xs");dL.debugLabel="styleBreakpointAtom";const pd1=()=>({flexChild:i1.useAtomValue(iL),gridChild:i1.useAtomValue(sL)}),md1=()=>i1.useAtomValue(ue),zd1=i1.atom(t=>{const e=t(ue),c=t(I4);let a=e;const r=[e];do{const n=c.find(({_id:o})=>o===(a==null?void 0:a._parent));a=n,n&&r.push(n)}while(a!=null&&a._parent);return r}),bd1=()=>i1.useAtomValue(zd1),Md1=()=>{const t=bd1();return h.useMemo(()=>{for(let e=0;e<t.length;e++){const c=G3.getBlockComponent(t[e]._type),a=j.cloneDeep(j.get(c,"blockState",{}));if(!j.isEmpty(a))return{settings:a,block:t[e]}}return{}},[t])};const f3=()=>{const[t,e]=i1.useAtom(Jr),c=h.useCallback(a=>{e(r=>j.includes(r,a)?j.without(r,a):[...r,a])},[e]);return[t,e,c]},va=t=>{switch(t.type){case"singular":return t.uiSchema;case"model":const{properties:e}=t,c={};return Object.keys(e).forEach(n=>{const o=e[n];if(j.includes(["slot","styles"],o.type))return;const l=n;c[l]=va(o)}),c;case"list":const{itemProperties:a}=t,r={items:{}};return Object.keys(a).forEach(n=>{const o=a[n];if(j.includes(["slot","styles"],o.type))return;const l=n;r.items[l]=va(o)}),r;default:return{}}},fa=t=>{switch(t.type){case"singular":return t.schema;case"model":const{properties:e,title:c}=t,a={title:c,type:"object",properties:{}};return Object.keys(e).forEach(l=>{const i=e[l];if(j.includes(["slot","styles"],i.type))return;const d=l;a.properties[d]=fa(i)}),a;case"list":const{itemProperties:r,title:n}=t,o={title:n,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(l=>{const i=r[l];if(j.includes(["slot","styles"],i.type))return;const d=l;o.items.properties[d]=fa(i),j.set(o.items,"title",j.get(i,"itemTitle",`${n} item`))}),o;default:return{}}},uL=t=>{if(!t)return{};const e={};return Object.keys(t).forEach(c=>{e[c]=wd1(t[c])}),e},Cd1=t=>{if(j.isEmpty(t.default))return[];const{itemProperties:e}=t;return j.map(t.default,c=>{const a={...c};return j.forIn(c,(r,n)=>{j.has(e,n)&&j.get(e[n],"i18n",!1)&&(a[n]=Y2.I18N_KEY)}),a})},wd1=t=>{switch(t.type){case"styles":return t.default;case"slot":return`${Y2.SLOT_KEY}${W4.generateUUID()}`;case"singular":const{schema:e}=t;return j.get(e,"default","");case"model":return uL(t.properties);case"list":return Cd1(t);default:return""}};const Vd1=(t,e)=>{const c={};return j.set(c,t,e),c};var Qr={exports:{}},Cv1=Qr.exports;(function(t){(function(){"use strict";function e(a,r,n){return a.splice(r,!n||1+n-r+(!(n<0^r>=0)&&(n<0||-1)*a.length)),a.length}let c=function(){let a=[],r=-1,n=0,o=!1,l;function i(d,s){return!d||typeof d[s]!="function"?this:(o=!0,d[s](),o=!1,this)}return{add:function(d){return o?this:(a.splice(r+1,a.length-r),a.push(d),n&&a.length>n&&e(a,0,-(n+1)),r=a.length-1,l&&l(),this)},setCallback:function(d){l=d},undo:function(){let d=a[r];if(!d)return this;const s=d.groupId;for(;d.groupId===s&&(i(d,"undo"),r-=1,d=a[r],!(!d||!d.groupId)););return l&&l(),this},redo:function(){let d=a[r+1];if(!d)return this;const s=d.groupId;for(;d.groupId===s&&(i(d,"redo"),r+=1,d=a[r+1],!(!d||!d.groupId)););return l&&l(),this},clear:function(){let d=a.length;a=[],r=-1,l&&d>0&&l()},hasUndo:function(){return r!==-1},hasRedo:function(){return r<a.length-1},getCommands:function(d){return d?a.filter(s=>s.groupId===d):a},getIndex:function(){return r},setLimit:function(d){n=d}}};t.exports?t.exports=c:window.UndoManager=c})()})(Qr);var Hd1=Qr.exports;const yd1=H4.getDefaultExportFromCjs(Hd1),xd1=i1.atom(Y2.BRANDING_OPTIONS_DEFAULTS),Ld1=i1.atom(null),he=()=>{const[t,e]=i1.useAtom(xd1);return[j.isObject(t)?{...Y2.BRANDING_OPTIONS_DEFAULTS,...t}:Y2.BRANDING_OPTIONS_DEFAULTS,e]},Id1=()=>i1.useAtom(Ld1),Sd1=i1.atom(null),hL=()=>({currentPage:i1.useAtomValue(Sd1)});function vL(t){return rL(t)}const _r=(t,e)=>j.flatten(t.map(c=>{if(c=e?{...c,_parent:e}:{...c},c.children){const a=[...c.children];return delete c.children,j.flatten([c,..._r(a,c._id)])}return c}));function $r(t,e=!1){for(let c=0;c<t.length;c++){const a=t[c];a.global&&!e?t[c]={type:"GlobalBlock",blockId:a.blockId,_parent:j.get(a,"_parent",null),_id:a._id}:a.children&&a.children.length&&$r(a.children)}}function fL(t){let e=[],c=j.filter(t,{type:"GlobalBlock"});return c.length>0&&(c=j.map(c,gL),j.each(c,a=>{e=[...e,...Ad1(a)]})),e}function Ad1(t){let e=[];const c=j.get(j.first(t),"_parent",null);j.set(j.first(t),"_parent",null);const a=[flatToNestedInstance.convert(pL(t))];$r(a,!0);let r=_r(a,t[0]._id);return r=j.set(r,"0._parent",c),e=[...e,r,...fL(r)],e}function gL(t){const e=j.find(ga,{_id:t._id});if(!e)return[];const c=[e],a=j.filter(ga,{_parent:t._id});return a.length?j.flatten([...c,...j.flatten(j.map(a,gL))]):j.flatten(c)}const pL=t=>JSON.parse(JSON.stringify(t));let ga=[];function Fd1(t){ga=t;const e=vL(pL(t));$r(e);const c=_r(e,null),a=fL(c),r={};return j.each(a,n=>j.set(r,j.first(n).blockId,n)),[c,r]}const mL=()=>{const[t]=he(),{currentPage:e}=hL(),[c]=Q4();return h.useCallback(()=>{const a=j.map(c,n=>j.omit(n,["expanded","order","title","siblings","tempClasses"])),[r=[]]=Fd1(a);return{currentPage:e,blocks:r}},[t,e,c])},M2=(t,e=void 0)=>{const c=i1.useAtomValue(Ur);return j.get(c,t,e)},tn=i1.atom([]);tn.debugLabel="dataProvidersAtom";const en=()=>i1.useAtom(tn),k0=i1.atom("SAVED");k0.debugLabel="builderSaveStateAtom";const zL=()=>{const[t,e]=i1.useAtom(k0),c=M2("onSavePage",async d=>{}),a=M2("onSave",async d=>{}),r=M2("onSaveStateChange",j.noop),n=mL(),[o]=en(),[l]=he();return{savePage:lg.useThrottledCallback(async()=>{e("SAVING"),r("SAVING");const d=n();return await c({blocks:d.blocks,providers:o}),await a({blocks:d.blocks,providers:o,brandingOptions:l,themeConfiguration:l}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},[n,e,l,a,r],3e3),saveState:t,setSaveState:e}},D4=new yd1;D4.setLimit(50);const ve=()=>{const[,t]=i1.useAtom(k0),e=M2("onSaveStateChange",j.noop);return h.useEffect(()=>(D4.setCallback(()=>{t("UNSAVED"),e("UNSAVED")}),()=>{D4.setCallback(j.noop)}),[]),{add:D4.add,undo:D4.undo,redo:D4.redo,hasRedo:D4.hasRedo,hasUndo:D4.hasUndo,clear:D4.clear}},cn=(t,e)=>{const c=[],a=j.filter(t,r=>j.includes(e,r._id)||j.includes(e,r._parent)?(c.push(r._id),!1):!0);return j.isEmpty(c)?a:cn(a,c)},bL=()=>{const[t]=Q4(),[e,c]=f3(),{setNewBlocks:a}=S4();return h.useCallback(r=>{var o;const n=((o=j.find(t,{_id:r[0]}))==null?void 0:o._parent)||null;a(cn(t,r)),setTimeout(()=>c(n?[n]:[]),200)},[t,c,e])};function Bd1(t,e,c,a){let r=t.filter(l=>!l._parent);c&&(r=t.filter(l=>l._parent===c));const n=a!==void 0?a:r.length;let o=t.length;for(let l=0,i=0;l<t.length;l++)if(t[l]._parent===c){if(i===n){o=l;break}i++}return!c&&a!==void 0&&a>=r.length&&(o=t.length),[...t.slice(0,o),...e,...t.slice(o)]}function Ed1(t){let e=[];return t.walk(c=>(delete c.model.children,e.push(c.model),!0)),e}function Qf(t,e){return t.first(c=>c.model._id===e)||null}function Od1(t,e,c,a){const r=Qf(t,e),n=Qf(t,c);if(r&&n){r.drop(),n.children||(n.model.children=[]);try{n.addChildAtIndex(r,a)}catch(o){return console.error("Error adding child to parent:",o),!1}return!0}return!1}function Pd1(t,e,c,a){if(!e)return t;c=c||"root";const n=new AS().parse({_id:"root",children:vL(t)});if(Od1(n,e,c,a)){const o=Ed1(n),l=o.find(i=>i._id===e);return l&&(l._parent=c==="root"?null:c),o.shift(),o}return t}const Gd1=()=>{const[,t]=Q4();return{setNewBlocks:e=>{t(e)},addBlocks:(e,c,a)=>{t(r=>Bd1(r,e,c,a))},removeBlocks:e=>{t(c=>cn(c,e))},moveBlocks:(e,c,a)=>{t(r=>{let n=r;for(let o=0;o<e.length;o++)n=Pd1(n,e[o],c,a);return n})},updateBlocksProps:e=>{t(c=>{const a=e.map(r=>r._id);return c.map(r=>{if(a.includes(r._id)){const n=j.find(e,{_id:r._id});return{...r,...j.omit(n,"_id")}}return r})})}}},Q4=()=>i1.useAtom(I4),S4=()=>{const{add:t}=ve(),[e]=Q4(),{setNewBlocks:c,addBlocks:a,removeBlocks:r,moveBlocks:n,updateBlocksProps:o}=Gd1();return{moveBlocks:(p,g,m)=>{const z=j.map(p,C=>{const w=e.find(A=>A._id===C)._parent||null,I=e.filter(A=>w?A._parent===w:!A._parent).map(A=>A._id).indexOf(C);return{_id:C,oldParent:w,oldPosition:I}}),b=z.find(({_id:C})=>C===p[0]);b&&b.oldParent===g&&b.oldPosition===m||(n(p,g,m),t({undo:()=>j.each(z,({_id:C,oldParent:V,oldPosition:w})=>{n([C],V,w)}),redo:()=>n(p,g,m)}))},addBlocks:(p,g,m)=>{a(p,g,m),t({undo:()=>r(j.map(p,"_id")),redo:()=>a(p,g,m)})},removeBlocks:p=>{var b;const g=(b=j.first(p))==null?void 0:b._parent,z=e.filter(C=>g?C._parent===g:!C._parent).indexOf(j.first(p));r(j.map(p,"_id")),t({undo:()=>a(p,g,z),redo:()=>r(j.map(p,"_id"))})},updateBlocks:(p,g,m)=>{let z=[];if(m)z=j.map(p,b=>({_id:b,...m}));else{const b=j.keys(g);z=j.map(p,C=>{const V=e.find(H=>H._id===C),w={_id:C};return j.each(b,H=>w[H]=V[H]),w})}o(j.map(p,b=>({_id:b,...g}))),t({undo:()=>o(z),redo:()=>o(j.map(p,b=>({_id:b,...g})))})},updateBlocksRuntime:(p,g)=>{o(j.map(p,m=>({_id:m,...g})))},setNewBlocks:p=>{c(p),t({undo:()=>c(e),redo:()=>c(p)})},updateMultipleBlocksProps:p=>{let g=[];g=j.map(p,m=>{const z=j.keys(m),b=e.find(V=>V._id===m._id),C={};return j.each(z,V=>C[V]=b[V]),C}),o(p),t({undo:()=>o(g),redo:()=>o(p)})}}},kd1=()=>{const[t]=Q4(),[,e]=f3(),{addBlocks:c}=S4(),a=h.useCallback((n,o,l)=>{var v;for(let f=0;f<n.length;f++){const{_id:p}=n[f];n[f]._id=W4.generateUUID();const g=j.filter(n,{_parent:p});for(let m=0;m<g.length;m++)g[m]._parent=n[f]._id}const i=j.first(n);let d,s;return o&&(d=j.find(t,{_id:o}),n[0]._parent=o,s=o),!(d?ha(d==null?void 0:d._type,i._type):!0)&&d&&(n[0]._parent=d._parent,s=d._parent),c(n,s,l),e([(v=j.first(n))==null?void 0:v._id]),j.first(n)},[t,e]);return{addCoreBlock:h.useCallback((n,o,l)=>{if(j.has(n,"blocks")){const m=n.blocks;return a(m,o,l)}const i=W4.generateUUID(),d=uL(n.props),s=[];j.forIn(d,(m,z)=>{if(j.startsWith(m,Y2.SLOT_KEY)){const b=m.replace(Y2.SLOT_KEY,"");s.push({_id:b,_type:"Slot",_parent:i,_name:n.props[z].name,_styles:n.props[z].styles,_emptyStyles:n.props[z].emptyStyles})}});const u={_type:n.type,_id:i,...d};let v,f;o&&(v=j.find(t,{_id:o}),u._parent=o,f=o),!ha(v==null?void 0:v._type,u._type)&&v&&(u._parent=v._parent,f=v._parent);const g=[u,...s];return c(g,f,l),e([u._id]),u},[a,t,e]),addPredefinedBlock:a}},_f={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},$f=["xs","sm","md","lg","xl","2xl"];function Rd1(t,e){if(e===null)return"baseClasses";const c=e.mq;if(c==="xs"||e.dark||e.mod!=="")return"classes";let a="baseClasses",r=$f.indexOf(c);for(;r>0;){const n=$f[r-1];if(j.find(t,{mq:n,property:e.property})){a="classes";break}r--}return a}const tg=[];function Nd1(t="",e="",c=[]){t=t.trim().replace(/ +/g,"");let a=j.filter(j.map(t.split(" "),l1.constructClassObject),d=>!j.isNull(d)),r=j.filter(j.map(e.split(" "),l1.constructClassObject),d=>!j.isNull(d));r=j.filter(r,d=>!j.includes(tg,d.property));const n=[],o=[];j.each(c,d=>{const s=l1.constructClassObject(d),u=j.find(a,j.pick(s,["dark","mq","mod","property"]));if(u&&(a=j.filter(a,v=>v.fullCls!==(u==null?void 0:u.fullCls))),n.push(s),s.mq==="xs"&&!s.dark&&s.mod===""&&(r=j.filter(r,v=>v.property!==s.property)),Rd1(a,s)==="baseClasses"&&!j.includes(tg,s.property)){const v=j.find(r,j.pick(s,["property"]));u&&(r=j.filter(r,f=>f.fullCls!==(v==null?void 0:v.fullCls))),o.push({...s,fullCls:s.cls,mq:"xs"})}});const l=j.map(j.sortBy([...a,...n],d=>_f[d.mq]),"fullCls").join(" ");return`${j.map(j.sortBy([...r,...o],d=>_f[d.mq]),"fullCls").join(" ").trim()},${l.trim()}`.trim().replace(/ +/g,"")}const R0=i1.atom([]);R0.debugLabel="selectedStylingBlocksAtom";const ML=()=>i1.useAtom(R0),jd1=t=>{const e=t.replace(Y2.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},Td1=i1.atom(null,(t,e,{blockIds:c,newClasses:a})=>{const r=j.filter(t(Kr),o=>c.includes(t(o)._id)),n=j.first(t(R0));return j.map(r,o=>{const l=t(o),i=j.get(l,n.prop,`${Y2.STYLES_KEY},`),{baseClasses:d,classes:s}=jd1(i);return{ids:[l._id],props:{[n.prop]:`${Y2.STYLES_KEY}${Nd1(s,d,a)}`}}})}),Dd1=()=>{const t=i1.useSetAtom(Td1),{updateBlocks:e,updateBlocksRuntime:c}=S4();return h.useCallback((a,r,n=!1)=>{const o=t({blockIds:a,newClasses:r});if(!n){c(a,o[0].props);return}e(a,o[0].props)},[t])},CL=()=>i1.useAtom(dL),wL=e4("canvasWidth",800),VL=i1.atom(t=>{const e=t(wL);return W4.getBreakpointValue(e).toLowerCase()}),qd1=()=>{const[t,e]=i1.useAtom(wL),c=i1.useAtomValue(VL),[a,r]=CL();return h.useEffect(()=>{a!=="xs"&&r(c)},[c,a,r]),[t,c,e]},Zd1=e4("canvasZoom",100),Wd1=()=>i1.useAtom(Zd1),HL=i1.atom([]),yL=()=>{const[t,e]=i1.useAtom(HL),c=i1.useSetAtom(an),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},an=i1.atom([]),Ud1=()=>{const[t,e]=i1.useAtom(an),c=i1.useSetAtom(HL),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},xL=e4("darkMode",!1),Kd1=()=>{const[t,e]=i1.useAtom(xL);return[t,e]},rn=()=>{const[t]=Q4(),[,e]=f3(),{addBlocks:c}=S4();return h.useCallback((a,r=null)=>{const n=[];j.each(a,o=>{const l=t.find(v=>v._id===o);r||(r=l._parent);const s=j.filter(t,v=>j.isString(r)?v._parent===r:!l._parent).indexOf(l)+1,u=dd1(t,o,r);c(u,r,s),n.push(j.get(u,"0._id",""))}),e(n)},[t,e])},Jd1=i1.atom([]),Yd1=()=>{const[t,e]=i1.useAtom(Jd1),c=h.useCallback(a=>{e(r=>j.includes(r,a)?j.without(r,a):[...r,a])},[e]);return[t,e,c]},Xd1=i1.atom(""),LL=()=>i1.useAtom(Xd1),Qd1=()=>{const t=i1.useAtomValue(I4);return h.useCallback((e,c)=>{const a=j.map(t,r=>(j.includes(e,j.get(r,"_id"))&&j.set(r,"_parent",c),r));console.log("newBlocks",a)},[t])},_d1=()=>{console.warn("usePasteBlocks is not implemented");const t=i1.useAtomValue(an),[e,c]=yL(),a=rn(),r=Qd1();return{canPaste:h.useMemo(()=>e.length>0||t.length>0,[t,e]),pasteBlocks:h.useCallback(o=>{j.isEmpty(t)?r(e,o):a(t,o),c(()=>[])},[e,t,a,r,c])}},$d1=i1.atom(!1),IL=()=>{const[t,e]=i1.useAtom($d1);return[t,e]},tu1=i1.atom(null,(t,e,{blockIds:c,fullClasses:a})=>{const r=j.first(t(R0)),n=j.filter(t(Kr),o=>c.includes(t(o)._id));return j.map(n,o=>{const l=t(o),i=a;let{classes:d,baseClasses:s}=ld1(j.get(l,r.prop,"styles:,"));return j.each(i,u=>{const v=u.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),f=new RegExp(`(^| )${v}($| )`,"g");d=d.replace(f," ").replace(/ +/g," ").trim();const p=j.first(u.split(":"));j.includes(["2xl","xl","lg","md","sm"],p)&&i.push(u.split(":").pop().trim())}),j.each(i,u=>{const v=new RegExp(`(^| )${u.replace("[","\\[").replace("]","\\]")}($| )`,"g");s=s.replace(v," ").replace(/ +/g," ").trim()}),{ids:[l._id],props:{[r.prop]:`${Y2.STYLES_KEY}${s},${d}`}}})}),eu1=()=>{const{updateBlocks:t}=S4(),e=i1.useSetAtom(tu1);return h.useCallback((c,a)=>{const r=e({blockIds:c,fullClasses:a});t(c,r[0].props)},[e])},SL=i1.atom(t=>{const e=j.first(t(R0)),c=t(ue);if(!e||e.blockId!==j.get(c,"_id",null))return[];const r=j.get(c,e.prop,`${Y2.STYLES_KEY},`).replace(Y2.STYLES_KEY,"").split(",").join(" ");return j.filter(j.map(r.trim().split(" "),l1.constructClassObject),n=>!j.isNull(n))}),cu1=()=>i1.useAtomValue(SL),eg={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},au1=i1.atom(t=>{const e=t(VL),c=t(Xr),a=t(xL),r=ru1(e);let n=j.filter(t(SL),{mod:c});return j.startsWith(c,"_")||(n=j.filter(n,o=>r.includes(o.mq))),n=n.sort((o,l)=>eg[o.mq]-eg[l.mq]),a||(n=j.filter(n,{dark:!1})),n}),ru1=t=>{let e=[];switch(t){case"xs":e=["xs"];break;case"sm":e=["xs","sm"];break;case"md":e=["xs","sm","md"];break;case"lg":e=["xs","sm","md","lg"];break;case"xl":e=["xs","sm","md","lg","xl"];break;case"2xl":e=["xs","sm","md","lg","xl","2xl"];break;default:e=["xs"];break}return e},nu1=()=>i1.useAtomValue(au1),ou1=()=>i1.useAtom(Xr),lu1=()=>{const{updateBlocks:t}=S4();return h.useCallback((e,c,a)=>{t(e,c,a)},[t])},iu1=()=>{const{updateMultipleBlocksProps:t}=S4();return h.useCallback(e=>{t(e)},[t])},su1=()=>{const{updateBlocksRuntime:t}=S4();return h.useCallback(async(e,c,a=30)=>{const r=j.keys(j.omit(c,["_id"]));for(const n of r){const o=c[n];if(j.isString(o)){const l=j.chunk(o.split(""),12);let i="";t([e],{[n]:""});for(let d=0;d<l.length;d++)i+=l[d].join(""),t([e],{[n]:i}),await new Promise(s=>setTimeout(s,a))}}},[t])},du1=()=>{const{updateMultipleBlocksProps:t}=S4(),e=su1();return h.useCallback(async c=>{for(const a of c)await e(a._id,a);t(c)},[t])},uu1=()=>{const{updateBlocksRuntime:t}=S4();return h.useCallback((e,c)=>{t(e,c)},[t])},AL={name:"",props:{},modalProps:{},backdropClose:!0},hu1=i1.atom(AL),vu1=()=>{const[t,e]=i1.useAtom(hu1),c=h.useCallback((r,n={},o={})=>{e({name:r,props:n,modalProps:o})},[e]),a=h.useCallback((...r)=>{j.get(t,"props.onClose",()=>{})(...r),e(AL)},[e,t]);return{activeModal:t,openModal:c,closeModal:a}},fu1=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),i1.useAtomValue(I4)),FL=i1.atom(!1);FL.debugLabel="readOnlyModeAtom";const BL=i1.atom("online");BL.debugLabel="networkModeAtom";const EL=i1.atom(!1);EL.debugLabel="editLayerNameAtom";const gu1=i1.atom("");gu1.debugLabel="activeLanguageAtom";const pu1=i1.atom("");pu1.debugLabel="primaryLanguageAtom";const OL=i1.atom(null);OL.debugLabel="canvasIframeAtom";const PL=i1.atom("outline");PL.debugLabel="activePanelAtom";const GL=i1.atom("");GL.debugLabel="showPredefinedBlockCategoryAtom";const kL=i1.atom({undoCount:0,redoCount:0});kL.debugLabel="historyStatesAtom";const RL=i1.atom("");RL.debugLabel="inlineEditingActiveAtom";const NL=i1.atom(!1);NL.debugLabel="draggingFlagAtom";const jL=i1.atom("");jL.debugLabel="draggedBlockIdAtom";const TL=i1.atom(null);TL.debugLabel="treeRefAtom";const DL=i1.atom({});DL.debugLabel="canvasSettingsAtom";const fe=i1.atom(!1);fe.debugLabel="askAiActiveBlockAtom";const mu1=i1.atom(!1);mu1.debugLabel="codeEditorOpenAtom";const zu1=e4("codeEditorHeight",500);zu1.debugLabel="codeEditorHeightAtom";const bu1=()=>i1.useAtomValue(FL),Mu1=i1.atom(""),Cu1=i1.atom(null),wu1=()=>i1.useAtom(Mu1),Vu1=()=>i1.useAtom(Cu1),Hu1=e4("selectedBreakpoints",["XS","MD","XL"]),yu1=()=>{const[t,e]=i1.useAtom(Hu1);return[t,e]},qL=()=>{const t=i1.useSetAtom(kL),{clear:e}=ve(),[,c]=f3(),[,a]=LL(),[,r]=ML(),[,n]=$2(fe);return()=>{c([]),r([]),a(""),e(),n(!1),t({undoCount:0,redoCount:0})}},xu1=()=>({data:M2("uiLibraries",[]),isLoading:!1}),Lu1=()=>{const[t,e]=h.useState(null),c=h.useCallback(async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),e(a),!0}catch(r){return console.warn("Copy failed",r),e(null),!1}},[]);return[t,c]},Iu1=i1.atom(null),Su1=()=>i1.useAtom(Iu1),ZL=k3.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"}}),WL=x.forwardRef(({className:t,variant:e,size:c,...a},r)=>L.jsxRuntimeExports.jsx(sg.Root,{ref:r,className:l1.cn(ZL({variant:e,size:c,className:t})),...a}));WL.displayName=sg.Root.displayName;const UL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Ac.Root,{className:l1.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",t),...e,ref:c,children:L.jsxRuntimeExports.jsx(Ac.Thumb,{className:l1.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")})}));UL.displayName=Ac.Root.displayName;const ge=k3.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"}}),s3=x.forwardRef(({className:t,variant:e,size:c,asChild:a=!1,...r},n)=>{const o=a?ES.Slot:"button";return L.jsxRuntimeExports.jsx(o,{className:l1.cn(ge({variant:e,size:c,className:t})),ref:n,...r})});s3.displayName="Button";const KL=A3.Root,nn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(A3.Item,{ref:c,className:l1.cn("border-b",t),...e}));nn.displayName="AccordionItem";const on=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsx(A3.Header,{className:"flex",children:L.jsxRuntimeExports.jsxs(A3.Trigger,{ref:a,className:l1.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...c,children:[e,c.hideArrow?null:L.jsxRuntimeExports.jsx(l2.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));on.displayName=A3.Trigger.displayName;const ln=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsx(A3.Content,{ref:a,className:l1.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...c,children:L.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:e})}));ln.displayName=A3.Content.displayName;const Au1=k3.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"}}),JL=x.forwardRef(({className:t,variant:e,...c},a)=>L.jsxRuntimeExports.jsx("div",{ref:a,role:"alert",className:l1.cn(Au1({variant:e}),t),...c}));JL.displayName="Alert";const YL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("h5",{ref:c,className:l1.cn("mb-1 font-medium leading-none tracking-tight",t),...e}));YL.displayName="AlertTitle";const XL=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("text-sm [&_p]:leading-relaxed",t),...e}));XL.displayName="AlertDescription";const QL=k3.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"}}),Fu1=({className:t,variant:e,...c})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn(QL({variant:e}),t),...c}),_L=N2.Root,$L=N2.Trigger,tI=({className:t,...e})=>L.jsxRuntimeExports.jsx(N2.Portal,{className:l1.cn(t),...e});tI.displayName=N2.Portal.displayName;const eI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Overlay,{className:l1.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",t),...e,ref:c}));eI.displayName=N2.Overlay.displayName;const sn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsxs(tI,{children:[L.jsxRuntimeExports.jsx(eI,{}),L.jsxRuntimeExports.jsx(N2.Content,{ref:c,className:l1.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",t),...e})]}));sn.displayName=N2.Content.displayName;const dn=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});dn.displayName="AlertDialogHeader";const un=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});un.displayName="AlertDialogFooter";const hn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Title,{ref:c,className:l1.cn("text-lg font-semibold",t),...e}));hn.displayName=N2.Title.displayName;const vn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));vn.displayName=N2.Description.displayName;const fn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Action,{ref:c,className:l1.cn(ge(),t),...e}));fn.displayName=N2.Action.displayName;const gn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(N2.Cancel,{ref:c,className:l1.cn(ge({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));gn.displayName=N2.Cancel.displayName;const pn=J1.Root,cI=J1.Trigger,aI=({className:t,...e})=>L.jsxRuntimeExports.jsx(J1.Portal,{className:l1.cn(t),...e});aI.displayName=J1.Portal.displayName;const rI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Overlay,{ref:c,className:l1.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",t),...e}));rI.displayName=J1.Overlay.displayName;const pe=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(aI,{children:[L.jsxRuntimeExports.jsx(rI,{}),L.jsxRuntimeExports.jsxs(J1.Content,{ref:a,className:l1.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",t),...c,children:[e,L.jsxRuntimeExports.jsxs(J1.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:[L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=J1.Content.displayName;const nI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});nI.displayName="DialogHeader";const oI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});oI.displayName="DialogFooter";const lI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:l1.cn("text-lg font-semibold leading-none tracking-tight",t),...e}));lI.displayName=J1.Title.displayName;const iI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));iI.displayName=J1.Description.displayName;const sI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("rounded-xl border bg-card text-card-foreground shadow",t),...e}));sI.displayName="Card";const dI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("flex flex-col space-y-1.5 p-6",t),...e}));dI.displayName="CardHeader";const uI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("h3",{ref:c,className:l1.cn("font-semibold leading-none tracking-tight",t),...e}));uI.displayName="CardTitle";const hI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("p",{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));hI.displayName="CardDescription";const vI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn("p-6 pt-0",t),...e}));vI.displayName="CardContent";const fI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("div",{ref:c,className:l1.cn(" flex items-center p-6 pt-0",t),...e}));fI.displayName="CardFooter";const gI=x.forwardRef(({className:t,type:e,...c},a)=>L.jsxRuntimeExports.jsx("input",{type:e,className:l1.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",t),ref:a,...c}));gI.displayName="Input";const Bu1=k3.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(dg.Root,{ref:c,className:l1.cn(Bu1(),t),...e}));pI.displayName=dg.Root.displayName;const me=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx("textarea",{className:l1.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",t),ref:c,...e}));me.displayName="Textarea";const mI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(U2.Root,{ref:a,className:l1.cn("relative overflow-hidden",t),...c,children:[L.jsxRuntimeExports.jsx(U2.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),L.jsxRuntimeExports.jsx(mn,{}),L.jsxRuntimeExports.jsx(U2.Corner,{})]}));mI.displayName=U2.Root.displayName;const mn=x.forwardRef(({className:t,orientation:e="vertical",...c},a)=>L.jsxRuntimeExports.jsx(U2.ScrollAreaScrollbar,{ref:a,orientation:e,className:l1.cn("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",t),...c,children:L.jsxRuntimeExports.jsx(U2.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mn.displayName=U2.ScrollAreaScrollbar.displayName;const zI=R3.Root,zn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.List,{ref:c,className:l1.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));zn.displayName=R3.List.displayName;const Ht=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.Trigger,{ref:c,className:l1.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",t),...e}));Ht.displayName=R3.Trigger.displayName;const yt=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(R3.Content,{ref:c,className:l1.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));yt.displayName=R3.Content.displayName;const Eu1=H6.Portal,bI=H6.Provider,Ou1=H6.Root,Pu1=H6.Trigger,MI=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>L.jsxRuntimeExports.jsx(H6.Content,{ref:a,sideOffset:e,className:l1.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",t),...c}));MI.displayName=H6.Content.displayName;const Gu1=s0.Root,ku1=s0.Trigger,CI=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>L.jsxRuntimeExports.jsx(s0.Portal,{children:L.jsxRuntimeExports.jsx(s0.Content,{ref:r,align:e,sideOffset:c,className:l1.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",t),...a})}));CI.displayName=s0.Content.displayName;const Ru1=U1.Menu,Nu1=U1.Group,ju1=U1.Portal,Tu1=U1.Sub,Du1=U1.RadioGroup,wI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Root,{ref:c,className:l1.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...e}));wI.displayName=U1.Root.displayName;const VI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Trigger,{ref:c,className:l1.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",t),...e}));VI.displayName=U1.Trigger.displayName;const HI=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(U1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));HI.displayName=U1.SubTrigger.displayName;const yI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.SubContent,{ref:c,className:l1.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",t),...e}));yI.displayName=U1.SubContent.displayName;const xI=x.forwardRef(({className:t,align:e="start",alignOffset:c=-4,sideOffset:a=8,...r},n)=>L.jsxRuntimeExports.jsx(U1.Portal,{children:L.jsxRuntimeExports.jsx(U1.Content,{ref:n,align:e,alignOffset:c,sideOffset:a,className:l1.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",t),...r})}));xI.displayName=U1.Content.displayName;const LI=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(U1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));LI.displayName=U1.Item.displayName;const II=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs(U1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(U1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));II.displayName=U1.CheckboxItem.displayName;const SI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(U1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(U1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));SI.displayName=U1.RadioItem.displayName;const AI=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(U1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));AI.displayName=U1.Label.displayName;const FI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(U1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));FI.displayName=U1.Separator.displayName;const BI=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});BI.displayname="MenubarShortcut";const qu1=Lt.Root,Zu1=Lt.Trigger,EI=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>L.jsxRuntimeExports.jsx(Lt.Content,{ref:r,align:e,sideOffset:c,className:l1.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",t),...a}));EI.displayName=Lt.Content.displayName;const Wu1=x2.Root,Uu1=x2.Group,Ku1=x2.Value,OI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(x2.Trigger,{ref:a,className:l1.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",t),...c,children:[e,L.jsxRuntimeExports.jsx(x2.Icon,{asChild:!0,children:L.jsxRuntimeExports.jsx(l2.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));OI.displayName=x2.Trigger.displayName;const PI=x.forwardRef(({className:t,children:e,position:c="popper",...a},r)=>L.jsxRuntimeExports.jsx(x2.Portal,{children:L.jsxRuntimeExports.jsx(x2.Content,{ref:r,className:l1.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",c==="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",t),position:c,...a,children:L.jsxRuntimeExports.jsx(x2.Viewport,{className:l1.cn("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));PI.displayName=x2.Content.displayName;const GI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(x2.Label,{ref:c,className:l1.cn("px-2 py-1.5 text-sm font-semibold",t),...e}));GI.displayName=x2.Label.displayName;const kI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(x2.Item,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(x2.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),L.jsxRuntimeExports.jsx(x2.ItemText,{children:e})]}));kI.displayName=x2.Item.displayName;const RI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(x2.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));RI.displayName=x2.Separator.displayName;const Ju1=J1.Root,Yu1=J1.Trigger,Xu1=J1.Close,NI=({className:t,...e})=>L.jsxRuntimeExports.jsx(J1.Portal,{className:l1.cn(t),...e});NI.displayName=J1.Portal.displayName;const jI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Overlay,{className:l1.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",t),...e,ref:c}));jI.displayName=J1.Overlay.displayName;const Qu1=k3.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"}}),TI=x.forwardRef(({side:t="right",className:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(NI,{children:[L.jsxRuntimeExports.jsx(jI,{}),L.jsxRuntimeExports.jsxs(J1.Content,{ref:r,className:l1.cn(Qu1({side:t}),e),...a,children:[c,L.jsxRuntimeExports.jsxs(J1.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:[L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));TI.displayName=J1.Content.displayName;const DI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});DI.displayName="SheetHeader";const qI=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});qI.displayName="SheetFooter";const ZI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:l1.cn("text-lg font-semibold text-foreground",t),...e}));ZI.displayName=J1.Title.displayName;const WI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:l1.cn("text-sm text-muted-foreground",t),...e}));WI.displayName=J1.Description.displayName;const UI=_1.Root,KI=_1.Trigger,_u1=_1.Group,$u1=_1.Portal,th1=_1.Sub,eh1=_1.RadioGroup,JI=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs(_1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));JI.displayName=_1.SubTrigger.displayName;const YI=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(_1.SubContent,{ref:c,className:l1.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",t),...e}));YI.displayName=_1.SubContent.displayName;const bn=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>L.jsxRuntimeExports.jsx(_1.Portal,{children:L.jsxRuntimeExports.jsx(_1.Content,{ref:a,sideOffset:e,className:l1.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",t),...c})}));bn.displayName=_1.Content.displayName;const v6=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(_1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));v6.displayName=_1.Item.displayName;const XI=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs(_1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));XI.displayName=_1.CheckboxItem.displayName;const QI=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs(_1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));QI.displayName=_1.RadioItem.displayName;const Mn=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx(_1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));Mn.displayName=_1.Label.displayName;const Cn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(_1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));Cn.displayName=_1.Separator.displayName;const _I=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest opacity-60",t),...e});_I.displayName="DropdownMenuShortcut";const $I=x.forwardRef(({className:t,orientation:e="horizontal",decorative:c=!0,...a},r)=>L.jsxRuntimeExports.jsx(ug.Root,{ref:r,decorative:c,orientation:e,className:l1.cn("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));$I.displayName=ug.Root.displayName;const ch1=1,ah1=1e6;let Ic=0;function rh1(){return Ic=(Ic+1)%Number.MAX_VALUE,Ic.toString()}const Sc=new Map,cg=t=>{if(Sc.has(t))return;const e=setTimeout(()=>{Sc.delete(t),i0({type:"REMOVE_TOAST",toastId:t})},ah1);Sc.set(t,e)},tS=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,ch1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(c=>c.id===e.toast.id?{...c,...e.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=e;return c?cg(c):t.toasts.forEach(a=>{cg(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===c||c===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(c=>c.id!==e.toastId)}}},D8=[];let q8={toasts:[]};function i0(t){q8=tS(q8,t),D8.forEach(e=>{e(q8)})}function eS({...t}){const e=rh1(),c=r=>i0({type:"UPDATE_TOAST",toast:{...r,id:e}}),a=()=>i0({type:"DISMISS_TOAST",toastId:e});return i0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||a()}}}),{id:e,dismiss:a,update:c}}function wn(){const[t,e]=x.useState(q8);return x.useEffect(()=>(D8.push(e),()=>{const c=D8.indexOf(e);c>-1&&D8.splice(c,1)}),[t]),{...t,toast:eS,dismiss:c=>i0({type:"DISMISS_TOAST",toastId:c})}}const nh1=d4.Provider,cS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Viewport,{ref:c,className:l1.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]",t),...e}));cS.displayName=d4.Viewport.displayName;const oh1=k3.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"}}),aS=x.forwardRef(({className:t,variant:e,...c},a)=>L.jsxRuntimeExports.jsx(d4.Root,{ref:a,className:l1.cn(oh1({variant:e}),t),...c}));aS.displayName=d4.Root.displayName;const lh1=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Action,{ref:c,className:l1.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",t),...e}));lh1.displayName=d4.Action.displayName;const rS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Close,{ref:c,className:l1.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",t),"toast-close":"",...e,children:L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"})}));rS.displayName=d4.Close.displayName;const nS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Title,{ref:c,className:l1.cn("text-sm font-semibold [&+div]:text-xs",t),...e}));nS.displayName=d4.Title.displayName;const oS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(d4.Description,{ref:c,className:l1.cn("text-sm opacity-90",t),...e}));oS.displayName=d4.Description.displayName;function lS(){const{toasts:t}=wn();return L.jsxRuntimeExports.jsxs(nh1,{children:[t.map(({id:e,title:c,description:a,action:r,...n})=>L.jsxRuntimeExports.jsxs(aS,{...n,children:[L.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[c&&L.jsxRuntimeExports.jsx(nS,{children:c}),a&&L.jsxRuntimeExports.jsx(oS,{children:a})]}),r,L.jsxRuntimeExports.jsx(rS,{})]},e)),L.jsxRuntimeExports.jsx(cS,{})]})}const Vn=({className:t,...e})=>L.jsxRuntimeExports.jsx("div",{className:l1.cn("animate-pulse rounded-md bg-primary/10",t),...e}),Hn=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command,{ref:c,className:l1.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Hn.displayName=Q2.Command.displayName;const ih1=({children:t,...e})=>L.jsxRuntimeExports.jsx(pn,{...e,children:L.jsxRuntimeExports.jsx(pe,{className:"overflow-hidden p-0",children:L.jsxRuntimeExports.jsx(Hn,{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:t})})}),iS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[L.jsxRuntimeExports.jsx(l2.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),L.jsxRuntimeExports.jsx(Q2.Command.Input,{ref:c,className:l1.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",t),...e})]}));iS.displayName=Q2.Command.Input.displayName;const sS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.List,{ref:c,className:l1.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));sS.displayName=Q2.Command.List.displayName;const dS=x.forwardRef((t,e)=>L.jsxRuntimeExports.jsx(Q2.Command.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));dS.displayName=Q2.Command.Empty.displayName;const uS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Group,{ref:c,className:l1.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",t),...e}));uS.displayName=Q2.Command.Group.displayName;const hS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Separator,{ref:c,className:l1.cn("-mx-1 h-px bg-border",t),...e}));hS.displayName=Q2.Command.Separator.displayName;const vS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx(Q2.Command.Item,{ref:c,className:l1.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",t),...e}));vS.displayName=Q2.Command.Item.displayName;const fS=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});fS.displayName="CommandShortcut";const sh1=$1.Root,dh1=$1.Trigger,uh1=$1.Group,hh1=$1.Portal,vh1=$1.Sub,fh1=$1.RadioGroup,gS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>L.jsxRuntimeExports.jsxs($1.SubTrigger,{ref:r,className:l1.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",e&&"pl-8",t),...a,children:[c,L.jsxRuntimeExports.jsx(l2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));gS.displayName=$1.SubTrigger.displayName;const pS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.SubContent,{ref:c,className:l1.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",t),...e}));pS.displayName=$1.SubContent.displayName;const mS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.Portal,{children:L.jsxRuntimeExports.jsx($1.Content,{ref:c,className:l1.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",t),...e})}));mS.displayName=$1.Content.displayName;const zS=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx($1.Item,{ref:a,className:l1.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",e&&"pl-8",t),...c}));zS.displayName=$1.Item.displayName;const bS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>L.jsxRuntimeExports.jsxs($1.CheckboxItem,{ref:r,className:l1.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",t),checked:c,...a,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx($1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.CheckIcon,{className:"h-4 w-4"})})}),e]}));bS.displayName=$1.CheckboxItem.displayName;const MS=x.forwardRef(({className:t,children:e,...c},a)=>L.jsxRuntimeExports.jsxs($1.RadioItem,{ref:a,className:l1.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",t),...c,children:[L.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:L.jsxRuntimeExports.jsx($1.ItemIndicator,{children:L.jsxRuntimeExports.jsx(l2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));MS.displayName=$1.RadioItem.displayName;const CS=x.forwardRef(({className:t,inset:e,...c},a)=>L.jsxRuntimeExports.jsx($1.Label,{ref:a,className:l1.cn("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...c}));CS.displayName=$1.Label.displayName;const wS=x.forwardRef(({className:t,...e},c)=>L.jsxRuntimeExports.jsx($1.Separator,{ref:c,className:l1.cn("-mx-1 my-1 h-px bg-border",t),...e}));wS.displayName=$1.Separator.displayName;const VS=({className:t,...e})=>L.jsxRuntimeExports.jsx("span",{className:l1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});VS.displayName="ContextMenuShortcut";const gh1=t=>{try{const e=document.getElementById("icon-picker-field"),c=document.createElement("div");pa.render(L.jsxRuntimeExports.jsx(ig.IconPickerItem,{value:t}),c),e.appendChild(c),c.hidden=!0;let a=c.innerHTML;setTimeout(()=>e.removeChild(c),100);const n=new DOMParser().parseFromString(a,"image/svg+xml"),o=n.querySelector("svg");return o&&(o.removeAttribute("width"),o.removeAttribute("height")),new XMLSerializer().serializeToString(n)}catch(e){return console.error(e),""}},ph1=({value:t,onChange:e})=>{const c=a=>{e("<svg />");const r=gh1(a);e(r)};return L.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[L.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[L.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t?t.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),L.jsxRuntimeExports.jsx(ig,{value:t?"BiSolidGrid":null,onChange:c,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"}})]}),L.jsxRuntimeExports.jsx("textarea",{value:t,onChange:a=>e(a.target.value),className:"h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},mh1=h.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-E2L3YDJI.cjs"))),zh1=h.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-s-eeaGiS.cjs"))),HS=({isModalView:t=!1,onSelect:e=()=>{}})=>{const c=M2("uploadMediaCallback"),a=M2("unsplashAccessKey"),r=c===void 0,n=a===void 0,[o,l]=h.useState(n?"upload":r?"unsplash":"upload");return L.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[L.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:L.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:t&&r?"Unsplash images":t?"Select or upload images":"Images"})}),L.jsxRuntimeExports.jsxs(zI,{value:o,onValueChange:i=>l(i),className:"flex h-full w-full flex-col py-2",children:[!(r||n)&&L.jsxRuntimeExports.jsxs(zn,{className:"w-full",children:[L.jsxRuntimeExports.jsx(Ht,{value:"upload",className:"w-full",children:"Upload"}),L.jsxRuntimeExports.jsx(Ht,{value:"unsplash",className:"w-full",children:"Unsplash"})]}),o==="unsplash"?L.jsxRuntimeExports.jsx(yt,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:L.jsxRuntimeExports.jsx(mh1,{isModalView:t,onSelect:e})})}):L.jsxRuntimeExports.jsx(yt,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:L.jsxRuntimeExports.jsx(zh1,{isModalView:t,onSelect:e})})})]})]})},bh1=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),ag=({children:t,onSelect:e})=>{const[c,a]=h.useState(!1),r=(...n)=>{e.call(void 0,...n),a(!1)};return L.jsxRuntimeExports.jsxs(pn,{open:c,onOpenChange:n=>a(n),children:[L.jsxRuntimeExports.jsx(cI,{asChild:!0,children:t}),L.jsxRuntimeExports.jsx(pe,{className:"flex h-3/4 max-w-5xl",children:L.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:L.jsxRuntimeExports.jsx(HS,{isModalView:!0,onSelect:r})})})]})},Mh1=({value:t,onChange:e,id:c,onBlur:a})=>{const r=M2("uploadMediaCallback"),n=M2("unsplashAccessKey"),o=r===void 0,l=n===void 0;return L.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?L.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):L.jsxRuntimeExports.jsx(ag,{onSelect:e,children:L.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"})}),L.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[!(o&&l)&&L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(ag,{onSelect:e,children:L.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:t||!j.isEmpty(t)?"Replace Image":"Choose Image"})}),L.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),L.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:i}})=>a(c,i),onChange:i=>e(i.target.value)})]})]})},Ch1=({id:t,placeholder:e,value:c,onChange:a,onBlur:r})=>{const n={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},o=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:L.jsxRuntimeExports.jsx(JS,{id:t,value:c,onBlur:l=>r(t,l),onChange:l=>a(l),modules:n,formats:o,placeholder:e,className:"mt-1 rounded-md"})},wh1=({schema:t,formData:e,onChange:c})=>{const[a,r]=h.useState([]),n=M2("getPages",()=>[]),{type:o="page",href:l="",target:i="self"}=e;return h.useEffect(()=>{(async()=>{const d=await n();r(d||[])})()},[]),L.jsxRuntimeExports.jsxs("div",{children:[L.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),L.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[L.jsxRuntimeExports.jsx("select",{name:"type",value:o,onChange:d=>c({...e,type:d.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(d=>L.jsxRuntimeExports.jsx("option",{value:d.const,children:d.title},d.const))}),o==="page"?L.jsxRuntimeExports.jsxs("select",{name:"href",value:l,onChange:d=>c({...e,href:d.target.value||"#"}),children:[L.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),j.map(a,d=>L.jsxRuntimeExports.jsx("option",{value:d.slug,children:d.name},d.uuid))]}):L.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:l,onChange:d=>c({...e,href:d.target.value||"#"}),placeholder:o==="page"||o==="url"?"Enter URL":o==="scroll"?"#ElementID":"Enter detail"}),(o==="page"||o==="url")&&L.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[L.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:i==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>c({...e,target:i==="_blank"?"_self":"_blank"})}),L.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Vh1=()=>{const[t,e]=IL(),{t:c}=xt.useTranslation(),a=M2("previewComponent",null);return t?L.jsxRuntimeExports.jsxs("div",{className:W4.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[L.jsxRuntimeExports.jsxs(s3,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>e(!1),children:[L.jsxRuntimeExports.jsx(l2.EyeClosedIcon,{}),L.jsxRuntimeExports.jsx("span",{children:c("Close Preview")})]}),L.jsxRuntimeExports.jsx("div",{children:a?L.jsxRuntimeExports.jsx(h.Suspense,{fallback:L.jsxRuntimeExports.jsx(Vn,{className:"h-96 w-full"}),children:h.createElement(a)}):null})]}):null},Hh1=()=>{const[t,e]=f3(),c=bL(),a=rn(),{undo:r,redo:n}=ve();E6.useHotkeys("esc",()=>e([]),{},[e]),E6.useHotkeys("ctrl+d,command+d",()=>a(t),{preventDefault:!0},[t,a]),E6.useHotkeys("ctrl+z,command+z",()=>r(),{},[r]),E6.useHotkeys("ctrl+y,command+y",()=>n(),{},[n]),E6.useHotkeys("del, backspace",o=>{o.preventDefault(),c(t)},{},[t,c])},yh1=(t,e)=>{const c=[];let a=j.find(t,{_id:e}),r=j.get(a,"_parent","");for(;j.isString(r)&&!j.isEmpty(r);)c.push(a==null?void 0:a._parent),a=j.find(t,{_id:r}),r=a==null?void 0:a._parent;return j.flatten(c)},xh1=i1.atom([]),Lh1=()=>{const[t]=f3(),e=i1.useAtomValue(I4),[,c]=i1.useAtom(xh1);h.useEffect(()=>{let a=[];const r=j.first(t);j.isString(r)&&(a=[r,...yh1(e,r)]),c(a)},[t,e,c])};const yS=()=>i1.useAtom(eL),Ih1=()=>h.useMemo(()=>G3.getChaiDataProviders(),[]),Sh1=({children:t})=>{const[,e]=yS(),[c]=en(),a=Ih1();return h.useEffect(()=>(e({}),j.each(c,r=>{const n=j.find(a,{providerKey:r.providerKey});if(n){const o=(n==null?void 0:n.mockFn)||(n==null?void 0:n.dataFn);o&&o(r.args).then(l=>e(i=>({...i,[r.providerKey]:l})))}}),()=>{j.each(c,r=>{e(n=>(delete n[r.providerKey],n))})}),[a,c,e]),L.jsxRuntimeExports.jsx(L.jsxRuntimeExports.Fragment,{children:t})};function Ah1(t,e,c){c.push(j.find(t,{_id:e}));const a=j.filter(t,{_parent:e});for(const r of a)c.push(...xS(r._id,t));return c}const xS=(t,e)=>{let c=[];return c=j.flattenDeep([...c,...Ah1(e,t,c)]),c},Fh1=i1.atom(!1),yn=()=>{const[t,e]=i1.useAtom(Fh1),[c,a]=h.useState(null),r=M2("askAiCallBack",null),n=du1(),o=iu1(),[l]=Q4();return{askAi:h.useCallback(async(i,d,s,u)=>{if(r){e(!0),a(null);try{const v=i==="content"?j.cloneDeep(xS(d,l)):[j.cloneDeep(l.find(g=>g._id===d))];j.set(v,"0._parent",null);const{blocks:f,error:p}=await r(i,s,v);if(p){a(p);return}i==="styles"?o(f):n(f)}catch(v){a(v)}finally{e(!1),u&&u()}}},[r,e,l,o,n]),loading:t,error:c}};function Bh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"},child:[]}]})(t)}function Eh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"},child:[]}]})(t)}function LS(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"},child:[]}]})(t)}function Oh1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(t)}function Ph1(t){return M0.GenIcon({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V299.6l-94.7 94.7c-8.2 8.2-14 18.5-16.8 29.7l-15 60.1c-2.3 9.4-1.8 19 1.4 27.8H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"},child:[]}]})(t)}const Gh1=[{name:"Improve writing",icon:Ph1,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Replace placeholder content",icon:Eh1,prompt:"Discard current placeholder content and replace with meaningful relevant content."},{name:"Fix grammar",icon:l2.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:l2.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:l2.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:L3.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:L3.ShuffleIcon,prompt:"Randomize all text elements."}];function kh1({onClick:t}){const{loading:e}=yn();return L.jsxRuntimeExports.jsx("div",{className:e?"pointer-events-none opacity-50":"",children:L.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:Gh1.map(({name:c,icon:a,subMenus:r,prompt:n})=>r?L.jsxRuntimeExports.jsxs(UI,{children:[L.jsxRuntimeExports.jsx(KI,{asChild:!0,children:L.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[L.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{children:c})]},c)}),L.jsxRuntimeExports.jsxs(bn,{children:[L.jsxRuntimeExports.jsx(Mn,{children:"My Account"}),L.jsxRuntimeExports.jsx(Cn,{}),L.jsxRuntimeExports.jsx(v6,{children:"Profile"}),L.jsxRuntimeExports.jsx(v6,{children:"Billing"}),L.jsxRuntimeExports.jsx(v6,{children:"Team"}),L.jsxRuntimeExports.jsx(v6,{children:"Subscription"})]})]}):L.jsxRuntimeExports.jsxs("li",{onClick:()=>t(n),className:"flex cursor-pointer items-center space-x-2 rounded p-1 pl-2 text-sm hover:bg-gray-100",children:[L.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),L.jsxRuntimeExports.jsx("span",{children:c})]},c))})})}const Rh1=({blockId:t})=>{const{t:e}=xt.useTranslation(),{askAi:c,loading:a,error:r}=yn(),[n,o]=h.useState(""),l=h.useRef(null);h.useEffect(()=>{var d;(d=l.current)==null||d.focus()},[]);const i=()=>{r||o("")};return t?L.jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[L.jsxRuntimeExports.jsxs("h2",{className:"mb-2 text-xs font-semibold leading-none tracking-tight text-gray-500",children:[e("Ask AI")," (GPT-4o mini)"]}),L.jsxRuntimeExports.jsx(me,{ref:l,value:n,onChange:d=>o(d.target.value),placeholder:e("Ask AI to edit content"),className:"w-full border border-gray-400 focus:border-0",rows:3,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c("content",t,n,i))}}),L.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[a?null:L.jsxRuntimeExports.jsx(s3,{disabled:n.trim().length<5||a,onClick:()=>c("content",t,n,i),variant:"default",className:"w-fit",size:"sm",children:a?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Edit with AI")}),a?L.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsxRuntimeExports.jsxs(Vn,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[L.jsxRuntimeExports.jsx(LS,{className:"h-4 w-4 animate-spin text-gray-500"}),L.jsxRuntimeExports.jsx("p",{className:"text-xs",children:e("Generating... Please wait")})]}),L.jsxRuntimeExports.jsx(s3,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:e("Stop")})]}):null]}),L.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r&&L.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:r.message})}),L.jsxRuntimeExports.jsx(kh1,{onClick:d=>c("content",t,d,i)})]}):L.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:L.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[L.jsxRuntimeExports.jsx(L3.SparklesIcon,{className:"mx-auto text-3xl"}),L.jsxRuntimeExports.jsx("h1",{children:e("no_block_selected_for_ask_ai")})]})})},Nh1=({onOpen:t})=>{const{t:e}=xt.useTranslation(),c=M2("aiContext",""),[a,r]=h.useState(c),n=h.useRef(null),o=M2("saveAiContextCallback",j.noop),[l,i]=h.useState(!1),[d,s]=h.useState(null),[u,v]=h.useState(!1),{toast:f}=wn(),p=h.useRef(null);h.useEffect(()=>{c&&r(c)},[c]);const g=async()=>{try{i(!0),s(null),await o(a),f({title:e("AI Context updated"),description:e("You can now ask AI to edit your content"),variant:"default"}),p.current.click()}catch(m){s(m)}finally{i(!1)}};return L.jsxRuntimeExports.jsx(KL,{onValueChange:m=>{t(m!==""),v(m!=="")},type:"single",collapsible:!0,className:"rounded-md border bg-gray-100 px-2",children:L.jsxRuntimeExports.jsxs(nn,{value:"set-context",children:[L.jsxRuntimeExports.jsx(on,{ref:p,hideArrow:!0,className:"py-1 hover:no-underline",children:L.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between",children:[L.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:e("AI Context")}),L.jsxRuntimeExports.jsxs(s3,{variant:"default",size:"sm",children:[L.jsxRuntimeExports.jsx("span",{children:e(u?"Cancel":"Edit")})," ",u?L.jsxRuntimeExports.jsx(l2.Cross2Icon,{className:"h-4 w-4"}):L.jsxRuntimeExports.jsx(L3.EditIcon,{className:"h-4 w-4"})]})]})}),L.jsxRuntimeExports.jsxs(ln,{children:[L.jsxRuntimeExports.jsx(me,{ref:n,value:a,onChange:m=>r(m.target.value),placeholder:e("Tell about this page. Eg: This page is about ..."),className:"w-full border border-gray-400 bg-background focus:border",rows:10,onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),g())}}),c.trim().length===0?L.jsxRuntimeExports.jsx("p",{className:"mt-2 text-xs text-gray-500",children:e("Eg: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.")}):null,L.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex items-center",children:[L.jsxRuntimeExports.jsx(s3,{disabled:a.trim().length<5,onClick:()=>g(),variant:"default",className:"w-fit",size:"sm",children:l?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Save")}),c.trim().length>0?L.jsxRuntimeExports.jsxs(_L,{children:[L.jsxRuntimeExports.jsx($L,{asChild:!0,children:L.jsxRuntimeExports.jsx(s3,{disabled:c.trim().length===0,variant:"ghost",className:"w-fit",size:"sm",children:l?L.jsxRuntimeExports.jsxs(L.jsxRuntimeExports.Fragment,{children:[L.jsxRuntimeExports.jsx(L3.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Delete")})}),L.jsxRuntimeExports.jsxs(sn,{children:[L.jsxRuntimeExports.jsxs(dn,{children:[L.jsxRuntimeExports.jsx(hn,{children:e("Remove context?")}),L.jsxRuntimeExports.jsx(vn,{})]}),L.jsxRuntimeExports.jsxs(un,{children:[L.jsxRuntimeExports.jsx(gn,{children:e("Cancel")}),L.jsxRuntimeExports.jsx(fn,{onClick:()=>{r(""),g()},children:"Yes, Delete"})]})]})]}):null]}),L.jsxRuntimeExports.jsx("div",{className:"mt-2 max-w-full",children:d&&L.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:d.message})})]})]})})},jh1=()=>{const[t]=f3(),[e,c]=h.useState(!1);return L.jsxRuntimeExports.jsxs("div",{className:"absolute inset-0 z-50 h-full w-full bg-background p-2",children:[L.jsxRuntimeExports.jsx(Nh1,{onOpen:a=>c(a)}),e?null:L.jsxRuntimeExports.jsx(Rh1,{blockId:j.first(t)})]})},Th1=h.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-j1EFsBlK.cjs"))),Dh1=h.lazy(()=>Promise.resolve().then(()=>require("./Topbar-ogFKKDbx.cjs"))),qh1=h.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-137WY3Wx.cjs"))),Zh1=h.lazy(()=>Promise.resolve().then(()=>require("./Settings-6QRVcl16.cjs"))),Wh1=()=>{const{savePage:t}=zL(),e=M2("autoSaveSupport",!0),c=M2("autoSaveInterval",60);lg.useIntervalEffect(()=>{e&&t()},c*1e3)},Uh1=()=>{const[t]=i1.useAtom(k0),[e]=i1.useAtom(fe),c=n=>{od1()||n.preventDefault()};Hh1(),Lh1(),Wh1(),h.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=M2("editable",!0),r=M2("nonEditableComponent",null);return L.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:L.jsxRuntimeExports.jsxs(bI,{children:[L.jsxRuntimeExports.jsxs("div",{onContextMenu:c,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[L.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Dh1,{})})}),L.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:L.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(r)})}),L.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Th1,{})})}),L.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(qh1,{})})}),L.jsxRuntimeExports.jsxs("div",{className:"relative flex h-[100%] w-[280px] min-w-[280px] border-l border-border pb-10",children:[L.jsxRuntimeExports.jsx(h.Suspense,{children:L.jsxRuntimeExports.jsx(Zh1,{})}),e?L.jsxRuntimeExports.jsx(jh1,{}):null]})]})]}),L.jsxRuntimeExports.jsx(Vh1,{})]})})},rg=i1.getDefaultStore(),Kh1=()=>L.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:L.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:L.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[L.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),L.jsxRuntimeExports.jsx("br",{}),L.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),L.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})});let Jh1=!1;const Yh1=t=>{Jh1=t};const Xh1=t=>{const[,e]=Q4(),[,c]=he(),a=qL();return h.useEffect(()=>{rg.set(Ur,j.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),h.useEffect(()=>{rg.set(tn,t.dataProviders||[])},[t.dataProviders]),h.useEffect(()=>{e(G3.syncBlocksWithDefaults(t.blocks||[])),a()},[t.blocks]),h.useEffect(()=>{og.changeLanguage(t.locale||"en")},[t.locale]),h.useEffect(()=>{Yh1(t.showDebugLogs)},[t.showDebugLogs]),h.useEffect(()=>{c(t.brandingOptions)},[t.brandingOptions,c]),L.jsxRuntimeExports.jsx(Uh1,{})},Qh1=t=>{const e=t._flags||{};return L.jsxRuntimeExports.jsxs(cL,{children:[L.jsxRuntimeExports.jsxs(SS.FlagsProvider,{features:{...nd1,...e},children:[L.jsxRuntimeExports.jsx(cd1,{}),L.jsxRuntimeExports.jsx(Kh1,{}),L.jsxRuntimeExports.jsx(Xh1,{...t})]}),L.jsxRuntimeExports.jsx(lS,{})]})};exports.Accordion=KL;exports.AccordionContent=ln;exports.AccordionItem=nn;exports.AccordionTrigger=on;exports.Alert=JL;exports.AlertDescription=XL;exports.AlertDialog=_L;exports.AlertDialogAction=fn;exports.AlertDialogCancel=gn;exports.AlertDialogContent=sn;exports.AlertDialogDescription=vn;exports.AlertDialogFooter=un;exports.AlertDialogHeader=dn;exports.AlertDialogTitle=hn;exports.AlertDialogTrigger=$L;exports.AlertTitle=YL;exports.Badge=Fu1;exports.BlocksExternalDataProvider=Sh1;exports.Button=s3;exports.Card=sI;exports.CardContent=vI;exports.CardDescription=hI;exports.CardFooter=fI;exports.CardHeader=dI;exports.CardTitle=uI;exports.ChaiBuilderEditor=Qh1;exports.Command=Hn;exports.CommandDialog=ih1;exports.CommandEmpty=dS;exports.CommandGroup=uS;exports.CommandInput=iS;exports.CommandItem=vS;exports.CommandList=sS;exports.CommandSeparator=hS;exports.CommandShortcut=fS;exports.ContextMenu=sh1;exports.ContextMenuCheckboxItem=bS;exports.ContextMenuContent=mS;exports.ContextMenuGroup=uh1;exports.ContextMenuItem=zS;exports.ContextMenuLabel=CS;exports.ContextMenuPortal=hh1;exports.ContextMenuRadioGroup=fh1;exports.ContextMenuRadioItem=MS;exports.ContextMenuSeparator=wS;exports.ContextMenuShortcut=VS;exports.ContextMenuSub=vh1;exports.ContextMenuSubContent=pS;exports.ContextMenuSubTrigger=gS;exports.ContextMenuTrigger=dh1;exports.Dialog=pn;exports.DialogContent=pe;exports.DialogDescription=iI;exports.DialogFooter=oI;exports.DialogHeader=nI;exports.DialogTitle=lI;exports.DialogTrigger=cI;exports.DropdownMenu=UI;exports.DropdownMenuCheckboxItem=XI;exports.DropdownMenuContent=bn;exports.DropdownMenuGroup=_u1;exports.DropdownMenuItem=v6;exports.DropdownMenuLabel=Mn;exports.DropdownMenuPortal=$u1;exports.DropdownMenuRadioGroup=eh1;exports.DropdownMenuRadioItem=QI;exports.DropdownMenuSeparator=Cn;exports.DropdownMenuShortcut=_I;exports.DropdownMenuSub=th1;exports.DropdownMenuSubContent=YI;exports.DropdownMenuSubTrigger=JI;exports.DropdownMenuTrigger=KI;exports.ErrorBoundary=cL;exports.FaCircleCheck=Oh1;exports.FaMoon=Bh1;exports.FaSpinner=LS;exports.HoverCard=qu1;exports.HoverCardContent=EI;exports.HoverCardTrigger=Zu1;exports.IconPickerField=ph1;exports.ImagePickerField=Mh1;exports.ImagesPanel=bh1;exports.Input=gI;exports.Label=pI;exports.LinkField=wh1;exports.Menubar=wI;exports.MenubarCheckboxItem=II;exports.MenubarContent=xI;exports.MenubarGroup=Nu1;exports.MenubarItem=LI;exports.MenubarLabel=AI;exports.MenubarMenu=Ru1;exports.MenubarPortal=ju1;exports.MenubarRadioGroup=Du1;exports.MenubarRadioItem=SI;exports.MenubarSeparator=FI;exports.MenubarShortcut=BI;exports.MenubarSub=Tu1;exports.MenubarSubContent=yI;exports.MenubarSubTrigger=HI;exports.MenubarTrigger=VI;exports.Popover=Gu1;exports.PopoverContent=CI;exports.PopoverTrigger=ku1;exports.RichTextEditorField=Ch1;exports.ScrollArea=mI;exports.ScrollBar=mn;exports.Select=Wu1;exports.SelectContent=PI;exports.SelectGroup=Uu1;exports.SelectItem=kI;exports.SelectLabel=GI;exports.SelectSeparator=RI;exports.SelectTrigger=OI;exports.SelectValue=Ku1;exports.Separator=$I;exports.Sheet=Ju1;exports.SheetClose=Xu1;exports.SheetContent=TI;exports.SheetDescription=WI;exports.SheetFooter=qI;exports.SheetHeader=DI;exports.SheetTitle=ZI;exports.SheetTrigger=Yu1;exports.Skeleton=Vn;exports.Switch=UL;exports.Tabs=zI;exports.TabsContent=yt;exports.TabsList=zn;exports.TabsTrigger=Ht;exports.Textarea=me;exports.Toaster=lS;exports.Toggle=WL;exports.Tooltip=Ou1;exports.TooltipContent=MI;exports.TooltipPortal=Eu1;exports.TooltipProvider=bI;exports.TooltipTrigger=Pu1;exports.activePanelAtom=PL;exports.aiAssistantActiveAtom=fe;exports.atomWithStorage=e4;exports.badgeVariants=QL;exports.builderSaveStateAtom=k0;exports.buttonVariants=ge;exports.canAcceptChildBlock=ha;exports.canDeleteBlock=sd1;exports.canDuplicateBlock=id1;exports.canvasIframeAtom=OL;exports.canvasSettingsAtom=DL;exports.convertDotNotationToObject=Vd1;exports.draggedBlockIdAtom=jL;exports.draggingFlagAtom=NL;exports.editLayerNameAtom=EL;exports.getBlockJSONFromSchemas=fa;exports.getBlockJSONFromUISchemas=va;exports.inlineEditingActiveAtom=RL;exports.networkModeAtom=BL;exports.reducer=tS;exports.showPredefinedBlockCategoryAtom=GL;exports.toast=eS;exports.toggleVariants=ZL;exports.treeDSBlocks=oL;exports.treeRefAtom=TL;exports.useActiveModal=vu1;exports.useActivePanel=wu1;exports.useAddBlock=kd1;exports.useAddBlockParent=Vu1;exports.useAddClassesToBlocks=Dd1;exports.useAllBlocks=fu1;exports.useAskAi=yn;exports.useBlocksContainer=Id1;exports.useBlocksStore=Q4;exports.useBlocksStoreUndoableActions=S4;exports.useBrandingOptions=he;exports.useBuilderProp=M2;exports.useBuilderReset=qL;exports.useCanvasWidth=qd1;exports.useCanvasZoom=Wd1;exports.useChaiExternalData=yS;exports.useCodeEditor=Su1;exports.useCopyBlockIds=Ud1;exports.useCopyToClipboard=Lu1;exports.useCurrentPage=hL;exports.useCutBlockIds=yL;exports.useDarkMode=Kd1;exports.useDuplicateBlocks=rn;exports.useGetPageData=mL;exports.useHiddenBlockIds=Yd1;exports.useHighlightBlockId=LL;exports.usePageDataProviders=en;exports.usePasteBlocks=_d1;exports.usePreviewMode=IL;exports.useReadOnlyMode=bu1;exports.useRemoveBlocks=bL;exports.useRemoveClassesFromBlocks=eu1;exports.useSavePage=zL;exports.useSelectedBlock=md1;exports.useSelectedBlockAllClasses=cu1;exports.useSelectedBlockCanvasSetting=Md1;exports.useSelectedBlockCurrentClasses=nu1;exports.useSelectedBlockIds=f3;exports.useSelectedBlocksDisplayChild=pd1;exports.useSelectedBreakpoints=yu1;exports.useSelectedStylingBlocks=ML;exports.useStylingBreakpoint=CL;exports.useStylingState=ou1;exports.useToast=wn;exports.useUILibraryBlocks=xu1;exports.useUndoManager=ve;exports.useUpdateBlocksProps=lu1;exports.useUpdateBlocksPropsRealtime=uu1;
|
|
@@ -42140,7 +42140,7 @@ const Mu1 = (t) => {
|
|
|
42140
42140
|
}
|
|
42141
42141
|
)
|
|
42142
42142
|
] });
|
|
42143
|
-
}, wu1 = m.lazy(() => import("./UnsplashImages-
|
|
42143
|
+
}, wu1 = m.lazy(() => import("./UnsplashImages-wWRifkCp.js")), Cu1 = m.lazy(() => import("./UploadImages-lUvZhW_j.js")), LS = ({
|
|
42144
42144
|
isModalView: t = !1,
|
|
42145
42145
|
onSelect: c = () => {
|
|
42146
42146
|
}
|
|
@@ -42615,7 +42615,7 @@ const Ru1 = ({ blockId: t }) => {
|
|
|
42615
42615
|
/* @__PURE__ */ L.jsx(Nu1, { onOpen: (a) => e(a) }),
|
|
42616
42616
|
c ? null : /* @__PURE__ */ L.jsx(Ru1, { blockId: c4(t) })
|
|
42617
42617
|
] });
|
|
42618
|
-
}, ju1 = _t(() => import("./SidePanels-
|
|
42618
|
+
}, ju1 = _t(() => import("./SidePanels-ao969pMV.js")), Du1 = _t(() => import("./Topbar-B8u0whpc.js")), qu1 = _t(() => import("./CanvasArea-CqILE5PR.js")), Zu1 = _t(() => import("./Settings-RLDTFFf8.js")), Wu1 = () => {
|
|
42619
42619
|
const { savePage: t } = Ys1(), c = B2("autoSaveSupport", !0), e = B2("autoSaveInterval", 60);
|
|
42620
42620
|
$S(() => {
|
|
42621
42621
|
c && t();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),b=require("@monaco-editor/react"),i=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),b=require("@monaco-editor/react"),i=require("./ChaiBuilderEditor-aY8flOgX.cjs"),k=require("react-i18next"),n=require("react"),C=require("@radix-ui/react-icons"),E=require("@react-hookz/web");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");const a=u=>{const s=document.createElement("div");return s.innerHTML=u,s.innerHTML};function R(){const{t:u}=k.useTranslation(),[s,d]=n.useState(!1),[l,x]=n.useState(""),[r,o]=i.useCodeEditor(),[c]=i.useSelectedBlockIds(),q=i.useUpdateBlocksProps(),m=i.useUpdateBlocksPropsRealtime(),p=E.useThrottledCallback(t=>{const h=a(t);m([r.blockId],{[r.blockProp]:h})},[],300),j=n.useCallback(()=>{if(s){const t=a(l);q([r.blockId],{[r.blockProp]:t})}},[s,l]);n.useEffect(()=>{c.includes(r==null?void 0:r.blockId)||(j(),o(null))},[c]);const f=()=>{o(null)};return e.jsxRuntimeExports.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsxRuntimeExports.jsx("button",{onClick:f,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxRuntimeExports.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsxRuntimeExports.jsx("span",{children:u("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:u("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>o(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(C.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(b,{onMount:t=>{t.setValue(r.initialCode)},onChange:t=>{d(!0),x(t),p(t)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=R;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import k from "@monaco-editor/react";
|
|
3
|
-
import { i as C, L as j, Q as v, R as g, B as y } from "./ChaiBuilderEditor-
|
|
3
|
+
import { i as C, L as j, Q as v, R as g, B as y } from "./ChaiBuilderEditor-tkzS851D.js";
|
|
4
4
|
import { useTranslation as N } from "react-i18next";
|
|
5
5
|
import { useState as n, useCallback as T, useEffect as E } from "react";
|
|
6
6
|
import { Cross2Icon as w } from "@radix-ui/react-icons";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-
|
|
2
|
+
import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-tkzS851D.js";
|
|
3
3
|
import { sortBy as b, filter as w, get as C, isEmpty as m, find as n, capitalize as N, map as S } from "lodash-es";
|
|
4
4
|
import { toast as k } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { a as B, u as E, c as T, d as V } from "./index-
|
|
6
|
+
import { a as B, u as E, c as T, d as V } from "./index-vfmO3y2d.js";
|
|
7
7
|
import { BriefcaseIcon as I } from "lucide-react";
|
|
8
8
|
import { useTranslation as L } from "react-i18next";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -46,7 +46,7 @@ import "react-quill";
|
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
47
|
import "./index-VBXQixVm.js";
|
|
48
48
|
import "./core.js";
|
|
49
|
-
import "./html-to-json-
|
|
49
|
+
import "./html-to-json-OnIZDDXw.js";
|
|
50
50
|
import "himalaya";
|
|
51
51
|
const Te = () => {
|
|
52
52
|
const { data: t } = B(), { data: i, isLoading: l } = E(), { saveState: c } = h(), d = T(), { t: u } = L(), [a, o] = V(), s = b(w(i, { type: "STATIC" }), (r) => C(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-aY8flOgX.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-bt7EhwLh.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("./index--mLLy7QQ.cjs");require("./core.cjs");require("./html-to-json-rauxDBi6.cjs");require("himalaya");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
|