decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
4 lines • 85.2 kB
JavaScript
import{c as T,m as ne,j as s,I as Rt,b as D,r as q,K as zt,i as At,a_ as Ft,h as Dt,B as Fe}from"./index-ztdGKvBm.js";import{u as it,a as $e,n as at,P as ct,D as dt,c as ut,C as ft}from"./task-key-Bt60Ndov.js";import{s as mt,a as xt,S as pt,r as Ut,u as ht,v as Ot}from"./sortable.esm-CKl9Rez4.js";import{s as Ue}from"./Plus-DWySsEmB.js";import{b as Ht}from"./delete-copy-DdlDdNyl.js";import{t as Mt,N as qt,ac as gt,ad as bt,ae as Gt,a6 as Vt,af as Kt,ag as vt,ah as Jt}from"./category-tree-DGOo1BAt.js";import{e as Qe,b as Wt,a as Qt,C as Yt,c as Xt,f as Zt}from"./command-C3tlrKUq.js";import{a as el,b as tl,P as ll}from"./popover-C4oz5B-L.js";import{G as sl,aF as ol,ar as nl,aa as rl,C as Oe,aj as jt,ak as kt,al as yt,am as il,E as al,e as cl}from"./agent-icon-BYWtutu9.js";import{b as Nt}from"./MessageCircle01-BG1RhOiZ.js";import{s as De}from"./Trash01-BxBhF2b8.js";import{a as He,s as Me,u as qe,E as Ge}from"./usage-stats-B0_Yl-r0.js";import{s as Ve}from"./suggestion-aR93AXr2.js";import{E as Ke,T as ze,R as Ct}from"./editor-classes-DYlqLnQ7.js";import{i as dl}from"./File02-DaYek2y9.js";import{c as ul,i as fl}from"./UserCheck01-k-4bTA2h.js";import{f as ml,d as xl}from"./blog-preview-url-N6iQgPQK.js";import{s as R,F as Je,I as ae,p as be,R as ue,A as fe,j as de}from"./primitives-BbUqWJzg.js";import{r as pl,b as hl,i as gl,p as bl,u as Bt,P as St}from"./product-picker-dialog-Bux2F3Cd.js";import{B as vl}from"./index-DrJBZ2ZV.js";import{i as jl}from"./Zap-CBJ7My90.js";import{T as kl,a as yl,c as Nl}from"./tooltip-Bm0P1gm_.js";import{a as wt}from"./Image01-BcIZ5mtf.js";import{i as Cl}from"./Monitor01-DMFbvudn.js";import{L as ve}from"./label-8UxgpYiA.js";import{s as Ye,F as Bl}from"./use-never-published-BJeGnEQC.js";import{l as Sl,m as wl,Q as Pl,s as _l}from"./save-status-DhQhbNh0.js";import{s as $l}from"./XClose-CmTuu4UN.js";import{t as Il,I as Ll}from"./held-block-view-QD0AvQ2Q.js";import{z as Tl}from"./blocks-tab-states-8lUCpJRf.js";import{S as El}from"./blog-schema-0s-6sCQz.js";function ee(b){const e=T.c(8),{active:t,label:r,onClick:l,children:o}=b,a=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground";let i;e[0]!==a?(i=ne("flex h-7 min-w-7 items-center justify-center px-1.5 text-sm transition-colors cursor-pointer rounded-[var(--studio-control-radius,var(--radius))]",a),e[0]=a,e[1]=i):i=e[1];let m;return e[2]!==t||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==i?(m=s.jsx("button",{type:"button","aria-label":r,"aria-pressed":t,onMouseDown:Rl,onClick:l,className:i,children:o}),e[2]=t,e[3]=o,e[4]=r,e[5]=l,e[6]=i,e[7]=m):m=e[7],m}function Rl(b){return b.preventDefault()}function Xe(){const b=T.c(1);let e;return b[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{"aria-hidden":!0,className:"mx-0.5 h-5 w-px bg-border"}),b[0]=e):e=b[0],e}function zl(b){const e=T.c(17),{draft:t,notice:r,label:l,placeholder:o,onDraftChange:a,onCommit:i,onCancel:m}=b;let f;e[0]!==a?(f=n=>a(n.target.value),e[0]=a,e[1]=f):f=e[1];let u;e[2]!==m||e[3]!==i?(u=n=>{n.key==="Escape"&&m(),n.key==="Enter"&&i()},e[2]=m,e[3]=i,e[4]=u):u=e[4];let p;e[5]!==t||e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==f||e[10]!==u?(p=s.jsx(Rt,{autoFocus:!0,type:"url",value:t,onChange:f,onBlur:i,onKeyDown:u,placeholder:o,spellCheck:!1,"aria-label":l,className:"h-8 w-full text-xs"}),e[5]=t,e[6]=l,e[7]=i,e[8]=o,e[9]=f,e[10]=u,e[11]=p):p=e[11];let g;e[12]!==r?(g=r&&s.jsx("p",{role:"alert",className:"px-1 pb-0.5 pt-1.5 text-xs text-destructive",children:r}),e[12]=r,e[13]=g):g=e[13];let h;return e[14]!==p||e[15]!==g?(h=s.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 w-96 rounded-[var(--studio-surface-radius,var(--radius-md))] bg-popover p-1 shadow-soft",children:[p,g]}),e[14]=p,e[15]=g,e[16]=h):h=e[16],h}function Al(b){const e=T.c(75),{value:t,mobileValue:r,onChange:l,onMobileChange:o,label:a,alt:i,toolbarExtras:m,sandbox:f}=b,u=D(),[p,g]=q.useState(!1),[h,n]=q.useState(!1),[c,d]=q.useState(null),[x,v]=q.useState(null),j=c!==null,[N,k]=q.useState(null),y=Fl,w=y(r),S=p?w:y(t),C=Ye(S),P=!!S&&(N===S||!C),_=Sl(C);let $;e[0]!==p||e[1]!==u?($=u(p?"sectionsEditor.imageField.mobileUrlLabel":"sectionsEditor.imageField.urlLabel"),e[0]=p,e[1]=u,e[2]=$):$=e[2];const B=$;let L;e[3]!==l||e[4]!==p||e[5]!==o?(L=Z=>(p?o:l)(Z||void 0),e[3]=l,e[4]=p,e[5]=o,e[6]=L):L=e[6];const I=L,A=`${p?"mobile":"desktop"}:${S}`,[U,O]=q.useState(A);U!==A&&(O(A),c!==null&&(d(S),v(null)));let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{d(null),v(null)},e[7]=M):M=e[7];const E=M,W=()=>{const Z=c??"",Re=Ye(Z);return!Re&&Z.trim()?(v(u("sectionsEditor.imageField.unsafeUrl")),!1):(Re!==S&&I(Re||void 0),!0)};let K;e[8]!==E||e[9]!==W?(K=()=>{W()&&E()},e[8]=E,e[9]=W,e[10]=K):K=e[10];const Q=K,re=()=>{j?Q():d(S)};let se;e[11]!==W||e[12]!==j?(se=Z=>{j&&!W()||g(Z)},e[11]=W,e[12]=j,e[13]=se):se=e[13];const Y=se,ie=f?.siteSlug,oe=f?.virtualMcpId;let X;e[14]===Symbol.for("react.memo_cache_sentinel")?(X=()=>n(!0),e[14]=X):X=e[14];let H;e[15]!==I||e[16]!==ie||e[17]!==oe?(H={siteSlug:ie,virtualMcpId:oe,onUploaded:I,onNeedsPicker:X},e[15]=I,e[16]=ie,e[17]=oe,e[18]=H):H=e[18];const{isDragging:z,isPending:V,lockedConfigId:F,dropProps:J}=wl(H);let G;e[19]!==a?(G=a&&s.jsx(ve,{className:"text-muted-foreground",children:a}),e[19]=a,e[20]=G):G=e[20];let te;e[21]!==m?(te=m&&s.jsx(Xe,{}),e[21]=m,e[22]=te):te=e[22];const ce=!p;let le;e[23]!==u?(le=u("sectionsEditor.imageField.desktopSlot"),e[23]=u,e[24]=le):le=e[24];let me;e[25]!==Y?(me=()=>Y(!1),e[25]=Y,e[26]=me):me=e[26];let je;e[27]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Cl,{size:14}),e[27]=je):je=e[27];let ke;e[28]!==ce||e[29]!==le||e[30]!==me?(ke=s.jsx(ee,{active:ce,label:le,onClick:me,children:je}),e[28]=ce,e[29]=le,e[30]=me,e[31]=ke):ke=e[31];let ye;e[32]!==u?(ye=u("sectionsEditor.imageField.mobileSlot"),e[32]=u,e[33]=ye):ye=e[33];let Ne;e[34]!==Y?(Ne=()=>Y(!0),e[34]=Y,e[35]=Ne):Ne=e[35];let Ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(ol,{size:14}),e[36]=Ce):Ce=e[36];let Be;e[37]!==re||e[38]!==B||e[39]!==j?(Be=s.jsx(ee,{active:j,label:B,onClick:re,children:Ce}),e[37]=re,e[38]=B,e[39]=j,e[40]=Be):Be=e[40];let Se;e[41]!==E||e[42]!==Q||e[43]!==u||e[44]!==c||e[45]!==B||e[46]!==x?(Se=c!==null&&s.jsx(zl,{draft:c,notice:x,label:B,placeholder:u("sectionsEditor.imageField.urlPlaceholder"),onDraftChange:Z=>{v(null),d(Z)},onCommit:Q,onCancel:E}),e[41]=E,e[42]=Q,e[43]=u,e[44]=c,e[45]=B,e[46]=x,e[47]=Se):Se=e[47];let we;e[48]===Symbol.for("react.memo_cache_sentinel")?(we=()=>n(!0),e[48]=we):we=e[48];let xe;e[49]!==u?(xe=u("sectionsEditor.imageField.replaceImage"),e[49]=u,e[50]=xe):xe=e[50];const Le=!S&&"border border-dashed border-border/60 bg-muted/30 hover:bg-accent",Te=z&&"ring-2 ring-primary/40",Ee=V&&"pointer-events-none opacity-60";let pe;e[51]!==Le||e[52]!==Te||e[53]!==Ee?(pe=ne("relative block w-full cursor-pointer overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-xl))] transition",Le,Te,Ee),e[51]=Le,e[52]=Te,e[53]=Ee,e[54]=pe):pe=e[54];let he;e[55]!==S||e[56]!==i||e[57]!==P||e[58]!==V||e[59]!==p||e[60]!==C||e[61]!==u?(he=C&&!P?s.jsx("img",{src:C,alt:i??"",onError:()=>k(S),className:"block h-auto w-full"}):s.jsxs("span",{className:"flex h-32 w-full flex-col items-center justify-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(wt,{size:20}),u(V?"sectionsEditor.imageField.uploading":P?"sectionsEditor.imageField.previewUnavailable":p?"sectionsEditor.imageField.dropMobileImage":"sectionsEditor.imageField.dropImageOrClickToBrowse")]}),e[55]=S,e[56]=i,e[57]=P,e[58]=V,e[59]=p,e[60]=C,e[61]=u,e[62]=he):he=e[62];let ge;e[63]!==z||e[64]!==u?(ge=z&&s.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:s.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow-soft",children:u("sectionsEditor.imageField.dropToUpload")})}),e[63]=z,e[64]=u,e[65]=ge):ge=e[65];let Pe;e[66]!==xe||e[67]!==pe||e[68]!==he||e[69]!==ge?(Pe=s.jsxs("button",{type:"button",onClick:we,"aria-label":xe,className:pe,children:[he,ge]}),e[66]=xe,e[67]=pe,e[68]=he,e[69]=ge,e[70]=Pe):Pe=e[70];let _e;return e[71]!==F||e[72]!==h||e[73]!==I?(_e=s.jsx(Bl,{open:h,onOpenChange:n,mode:"image",onSelect:I,lockedConfigId:F}),e[71]=F,e[72]=h,e[73]=I,e[74]=_e):_e=e[74],s.jsxs("div",{...J,className:"group/image relative space-y-2",children:[G,s.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-2 z-10 flex justify-center",children:s.jsxs("div",{className:"pointer-events-none relative flex items-center gap-0.5 rounded-md bg-popover p-0.5 opacity-0 shadow-soft transition-opacity group-hover/image:pointer-events-auto group-hover/image:opacity-100 group-focus-within/image:pointer-events-auto group-focus-within/image:opacity-100",children:[m,te,ke,s.jsx(ee,{active:p,label:ye,onClick:Ne,children:s.jsx(sl,{size:14,className:ne(w&&"text-primary")})}),Be,C&&!C.toLowerCase().startsWith("data:")&&s.jsxs(s.Fragment,{children:[s.jsx(Xe,{}),Pl.map(Z=>s.jsx(ee,{active:_===Z,label:Z,onClick:()=>I(_l(C,_===Z?void 0:Z)),children:s.jsx("span",{className:"px-0.5 text-xs capitalize",children:Z})},Z))]}),Se]})}),Pe,_e]})}function Fl(b){return typeof b=="string"?b:""}function Pt(b){const e=T.c(12),{iconName:t,iconUrl:r,alt:l,className:o,size:a}=b,i=a===void 0?16:a;let m;e[0]!==t?(m=rl(t)??nl,e[0]=t,e[1]=m):m=e[1];const f=m;let u;e[2]!==o?(u=ne("flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",o),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==f||e[5]!==l||e[6]!==r||e[7]!==i?(p=r?s.jsx("img",{src:r,alt:l,className:"size-5 object-contain"}):s.jsx(f,{size:i,className:"text-muted-foreground"}),e[4]=f,e[5]=l,e[6]=r,e[7]=i,e[8]=p):p=e[8];let g;return e[9]!==u||e[10]!==p?(g=s.jsx("div",{className:u,children:p}),e[9]=u,e[10]=p,e[11]=g):g=e[11],g}const Ze={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function et(b){const e=T.c(19),{type:t,onInsert:r}=b,l=`${t.title} ${t.resolveType} ${t.description??""}`;let o;e[0]!==r||e[1]!==t.resolveType?(o=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=o):o=e[2];let a;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(a=s.jsx(Pt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=a):a=e[6];let i;e[7]!==t.title?(i=s.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=i):i=e[8];let m;e[9]!==t.description?(m=t.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=m):m=e[10];let f;e[11]!==i||e[12]!==m?(f=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[11]=i,e[12]=m,e[13]=f):f=e[13];let u;return e[14]!==l||e[15]!==o||e[16]!==a||e[17]!==f?(u=s.jsxs(Wt,{value:l,onSelect:o,className:"flex items-center gap-2.5",children:[a,f]}),e[14]=l,e[15]=o,e[16]=a,e[17]=f,e[18]=u):u=e[18],u}function _t(b){const e=T.c(41),{blockTypes:t,onInsert:r,children:l,align:o}=b,a=o===void 0?"start":o,i=D(),[m,f]=q.useState(!1),[u,p]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=I=>{I&&typeof document<"u"&&p(document.querySelector('[data-slot="dialog-content"][data-state="open"]')),f(I)},e[0]=g):g=e[0];const h=g;let n,c;if(e[1]!==t){n=[],c=[];for(const I of t)(I.source==="site"?c:n).push(I);e[1]=t,e[2]=n,e[3]=c}else n=e[2],c=e[3];let d;e[4]!==r?(d=I=>{r(I),f(!1)},e[4]=r,e[5]=d):d=e[5];const x=d,v=n.length>0&&c.length>0;let j;e[6]!==l?(j=s.jsx(el,{asChild:!0,children:l}),e[6]=l,e[7]=j):j=e[7];const N=u??void 0;let k;e[8]!==i?(k=i("sandbox.blockPicker.searchPlaceholder"),e[8]=i,e[9]=k):k=e[9];let y;e[10]!==k?(y=s.jsx(Qt,{placeholder:k}),e[10]=k,e[11]=y):y=e[11];let w;e[12]!==i?(w=i("sandbox.blockPicker.noBlocksFound"),e[12]=i,e[13]=w):w=e[13];let S;e[14]!==w?(S=s.jsx(Yt,{children:w}),e[14]=w,e[15]=S):S=e[15];let C;e[16]!==x||e[17]!==v||e[18]!==c||e[19]!==i?(C=c.length>0&&s.jsx(Qe,{heading:v?i(Ze.site):void 0,children:c.map(I=>s.jsx(et,{type:I,onInsert:x},I.resolveType))}),e[16]=x,e[17]=v,e[18]=c,e[19]=i,e[20]=C):C=e[20];let P;e[21]!==n||e[22]!==x||e[23]!==v||e[24]!==i?(P=n.length>0&&s.jsx(Qe,{heading:v?i(Ze.app):void 0,children:n.map(I=>s.jsx(et,{type:I,onInsert:x},I.resolveType))}),e[21]=n,e[22]=x,e[23]=v,e[24]=i,e[25]=P):P=e[25];let _;e[26]!==C||e[27]!==P||e[28]!==S?(_=s.jsxs(Xt,{className:"min-h-0 flex-1",children:[S,C,P]}),e[26]=C,e[27]=P,e[28]=S,e[29]=_):_=e[29];let $;e[30]!==_||e[31]!==y?($=s.jsxs(Zt,{className:"min-h-0 flex-1",children:[y,_]}),e[30]=_,e[31]=y,e[32]=$):$=e[32];let B;e[33]!==a||e[34]!==$||e[35]!==N?(B=s.jsx(tl,{container:N,className:"flex max-h-(--radix-popover-content-available-height) w-80 flex-col p-0",align:a,children:$}),e[33]=a,e[34]=$,e[35]=N,e[36]=B):B=e[36];let L;return e[37]!==m||e[38]!==B||e[39]!==j?(L=s.jsxs(ll,{open:m,onOpenChange:h,children:[j,B]}),e[37]=m,e[38]=B,e[39]=j,e[40]=L):L=e[40],L}function $t(b){const e=T.c(12),{value:t,onChange:r,placeholder:l,children:o}=b;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{size:13,className:"shrink-0 text-muted-foreground"}),e[0]=a):a=e[0];let i;e[1]!==r?(i=p=>r(p.target.value),e[1]=r,e[2]=i):i=e[2];let m;e[3]!==l||e[4]!==i||e[5]!==t?(m=s.jsxs("div",{className:"flex items-center gap-1.5 rounded border px-2",children:[a,s.jsx("input",{autoFocus:!0,type:"text",value:t,placeholder:l,onChange:i,className:"h-7 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=m):m=e[6];let f;e[7]!==o?(f=s.jsx("div",{className:"max-h-56 overflow-y-auto",children:o}),e[7]=o,e[8]=f):f=e[8];let u;return e[9]!==m||e[10]!==f?(u=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,f]}),e[9]=m,e[10]=f,e[11]=u):u=e[11],u}function It(b){const e=T.c(13),{label:t,sublabel:r,image:l,onPick:o}=b;let a;e[0]!==l?(a=l!==void 0&&s.jsx("img",{src:l,alt:"",className:"h-7 w-7 shrink-0 rounded object-cover"}),e[0]=l,e[1]=a):a=e[1];let i;e[2]!==t?(i=s.jsx("span",{className:"block truncate text-sm",children:t}),e[2]=t,e[3]=i):i=e[3];let m;e[4]!==r?(m=r&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==m?(f=s.jsxs("span",{className:"min-w-0 flex-1",children:[i,m]}),e[6]=i,e[7]=m,e[8]=f):f=e[8];let u;return e[9]!==o||e[10]!==a||e[11]!==f?(u=s.jsxs("button",{type:"button",onMouseDown:Dl,onClick:o,className:"flex w-full items-center gap-2 rounded px-1.5 py-1.5 text-left transition-colors hover:bg-accent",children:[a,f]}),e[9]=o,e[10]=a,e[11]=f,e[12]=u):u=e[12],u}function Dl(b){return b.preventDefault()}function Ul(b){const e=T.c(7),{decofile:t,onPick:r}=b,l=D(),[o,a]=q.useState("");let i;if(e[0]!==t||e[1]!==r||e[2]!==l||e[3]!==o){const m=ml(t),f=o.trim().toLowerCase(),u=qt(t).filter(h=>!f||h.title.toLowerCase().includes(f)||h.slug.toLowerCase().includes(f)).slice(0,30),p=h=>m?xl(m,{category:h.categorySlugs[0]??"",slug:h.slug}):null;let g;e[5]!==l?(g=l("sandbox.linkPicker.searchPosts"),e[5]=l,e[6]=g):g=e[6],i=s.jsx($t,{value:o,onChange:a,placeholder:g,children:u.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noPosts")}):u.map(h=>{const n=p(h);return n?s.jsx(It,{label:h.title||h.slug,sublabel:n,onPick:()=>r(n)},h.key):null})}),e[0]=t,e[1]=r,e[2]=l,e[3]=o,e[4]=i}else i=e[4];return i}function Ol(b){const e=T.c(26),{sandboxRef:t,storeUrl:r,onPick:l}=b,o=D(),[a,i]=q.useState(""),[m,f]=q.useState(""),u=q.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=y=>{i(y),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>f(y.trim()),300)},e[0]=p):p=e[0];const g=p;let h;e[1]!==m||e[2]!==t.branch||e[3]!==t.orgSlug||e[4]!==t.virtualMcpId?(h=zt.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`product-link:${m}`),e[1]=m,e[2]=t.branch,e[3]=t.orgSlug,e[4]=t.virtualMcpId,e[5]=h):h=e[5];let n;e[6]!==m||e[7]!==t?(n=async()=>{const[y]=hl("search",m);if(!y)return[];const w=await gl(t,y);return bl(w).filter(Hl)},e[6]=m,e[7]=t,e[8]=n):n=e[8];let c;e[9]!==h||e[10]!==n?(c={queryKey:h,queryFn:n},e[9]=h,e[10]=n,e[11]=c):c=e[11];const d=At(c);let x;e[12]!==d.data?(x=d.data??[],e[12]=d.data,e[13]=x):x=e[13];const v=x;let j;e[14]!==o?(j=o("sandbox.linkPicker.searchProducts"),e[14]=o,e[15]=j):j=e[15];let N;e[16]!==l||e[17]!==v||e[18]!==d.isFetching||e[19]!==r||e[20]!==o?(N=d.isFetching?s.jsxs("p",{className:"flex items-center justify-center gap-1.5 px-1.5 py-3 text-xs text-muted-foreground",children:[s.jsx(fl,{size:12,className:"animate-spin"}),o("sandbox.linkPicker.searching")]}):v.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:o("sandbox.linkPicker.noProducts")}):v.map(y=>s.jsx(It,{label:y.label,image:y.image??"",onPick:()=>{const w=pl(y.url,r);w&&l(w)}},y.id)),e[16]=l,e[17]=v,e[18]=d.isFetching,e[19]=r,e[20]=o,e[21]=N):N=e[21];let k;return e[22]!==j||e[23]!==N||e[24]!==a?(k=s.jsx($t,{value:a,onChange:g,placeholder:j,children:N}),e[22]=j,e[23]=N,e[24]=a,e[25]=k):k=e[25],k}function Hl(b){return b.url}function We(b){const e=T.c(24),{decofile:t,sandboxRef:r}=b,l=D();let o;e[0]!==t?(o=t?R(Mt(t).merged.storeUrl):"",e[0]=t,e[1]=o):o=e[1];const a=o;let i;if(e[2]!==t||e[3]!==r||e[4]!==a||e[5]!==l){if(i=[],t){let m;e[7]!==l?(m=l("sandbox.linkPicker.tabPost"),e[7]=l,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(dl,{size:12}),e[9]=f):f=e[9];let u;e[10]!==t?(u=g=>s.jsx(Ul,{decofile:t,onPick:g}),e[10]=t,e[11]=u):u=e[11];let p;e[12]!==m||e[13]!==u?(p={id:"post",label:m,icon:f,render:u},e[12]=m,e[13]=u,e[14]=p):p=e[14],i.push(p)}if(r){let m;e[15]!==l?(m=l("sandbox.linkPicker.tabProduct"),e[15]=l,e[16]=m):m=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ul,{size:12}),e[17]=f):f=e[17];let u;e[18]!==r||e[19]!==a?(u=g=>s.jsx(Ol,{sandboxRef:r,storeUrl:a,onPick:g}),e[18]=r,e[19]=a,e[20]=u):u=e[20];let p;e[21]!==m||e[22]!==u?(p={id:"product",label:m,icon:f,render:u},e[21]=m,e[22]=u,e[23]=p):p=e[23],i.push(p)}e[2]=t,e[3]=r,e[4]=a,e[5]=l,e[6]=i}else i=e[6];return i}function Ml({html:b,placeholder:e,onChange:t,decofile:r,sandboxRef:l}){const o=q.useRef(t);o.current=t;const[a,i]=q.useState(!1),m=He({extensions:[Me.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),Ve.configure({placeholder:e??"Write something…"})],content:b||"",editorProps:{attributes:{class:ne("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0",Ke)}},onUpdate:({editor:p})=>{const g=p.getHTML();o.current(g==="<p></p>"?"":g)}}),f=qe({editor:m,selector:({editor:p})=>({isFocused:p?.isFocused??!1,bold:p?.isActive("bold")??!1,italic:p?.isActive("italic")??!1,underline:p?.isActive("underline")??!1,link:p?.isActive("link")??!1})}),u=We({decofile:r,sandboxRef:l});return m?s.jsxs("div",{className:"relative",children:[(f.isFocused||a)&&s.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md bg-popover p-0.5 shadow-soft",children:[s.jsx(ze,{active:f.bold,label:"Bold",onClick:()=>m.chain().focus().toggleBold().run(),children:s.jsx(jt,{size:14})}),s.jsx(ze,{active:f.italic,label:"Italic",onClick:()=>m.chain().focus().toggleItalic().run(),children:s.jsx(kt,{size:14})}),s.jsx(ze,{active:f.underline,label:"Underline",onClick:()=>m.chain().focus().toggleUnderline().run(),children:s.jsx(yt,{size:14})}),s.jsx(Ct,{editor:m,active:f.link,open:a,onOpenChange:i,sources:u})]}),s.jsx(Ge,{editor:m,className:"text-[15px] text-foreground"})]}):null}function ql(b,e){const t=b.length?b.split(`
`):[""],r=e?"ol":"ul",l=t.map(o=>`<li><p>${o}</p></li>`).join("");return`<${r}>${l}</${r}>`}function Gl(b){const e=new DOMParser().parseFromString(b,"text/html").body,t=Array.from(e.querySelectorAll(":scope > ul > li, :scope > ol > li")),r=t.length?t:Array.from(e.children);return r.length===0?[""]:r.map(l=>{const o=l.children.length===1?l.children[0]:null;return(o?.tagName==="P"?o.innerHTML:l.innerHTML).trim()})}const Vl=({editor:b,state:e})=>b.isEditable&&(b.isFocused||!e.selection.empty),Kl={placement:"bottom-start",offset:8};function Lt(b){const e=T.c(11),{editor:t,appendTo:r,sources:l}=b,o=D(),[a,i]=q.useState(!1),[m,f]=q.useState(null),u=r??m;let p;e[0]!==t?(p={editor:t,selector:Jl},e[0]=t,e[1]=p):p=e[1];const g=qe(p);let h;e[2]!==t||e[3]!==a||e[4]!==g||e[5]!==l||e[6]!==o||e[7]!==u?(h=u&&s.jsxs(vl,{editor:t,appendTo:u,shouldShow:Vl,options:Kl,className:"z-50 flex items-center gap-0.5 rounded-md bg-popover p-0.5 shadow-soft",children:[s.jsx(ee,{active:g.bold,label:o("sectionsEditor.richTextField.bold"),onClick:()=>t.chain().focus().toggleBold().run(),children:s.jsx(jt,{size:14})}),s.jsx(ee,{active:g.italic,label:o("sectionsEditor.richTextField.italic"),onClick:()=>t.chain().focus().toggleItalic().run(),children:s.jsx(kt,{size:14})}),s.jsx(ee,{active:g.underline,label:o("sectionsEditor.richTextField.underline"),onClick:()=>t.chain().focus().toggleUnderline().run(),children:s.jsx(yt,{size:14})}),s.jsx(ee,{active:g.strike,label:o("sectionsEditor.richTextField.strikethrough"),onClick:()=>t.chain().focus().toggleStrike().run(),children:s.jsx(il,{size:14})}),s.jsx(Ct,{editor:t,active:g.link,open:a,onOpenChange:i,sources:l})]}),e[2]=t,e[3]=a,e[4]=g,e[5]=l,e[6]=o,e[7]=u,e[8]=h):h=e[8];let n;return e[9]!==h?(n=s.jsx("div",{ref:f,className:"relative z-20",children:h}),e[9]=h,e[10]=n):n=e[10],n}function Jl(b){const{editor:e}=b;return{bold:e.isActive("bold"),italic:e.isActive("italic"),underline:e.isActive("underline"),strike:e.isActive("strike"),link:e.isActive("link")}}const Wl=["1","2","3","4"],Ql={1:"sandbox.plainBlocks.headingLevel1",2:"sandbox.plainBlocks.headingLevel2",3:"sandbox.plainBlocks.headingLevel3",4:"sandbox.plainBlocks.headingLevel4"},tt={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Yl(b){const e=T.c(23),{text:t,level:r,onChange:l}=b,[o,a]=q.useState(!1),i=D(),m=r||"2";let f;e[0]!==o||e[1]!==m||e[2]!==l||e[3]!==i||e[4]!==t?(f=o&&s.jsx(Je,{children:Wl.map(v=>s.jsxs(ee,{active:m===v,label:i(Ql[v]),onClick:()=>l({text:t,level:v}),children:["H",v]},v))}),e[0]=o,e[1]=m,e[2]=l,e[3]=i,e[4]=t,e[5]=f):f=e[5];let u;e[6]!==m||e[7]!==l?(u=v=>l({text:v,level:m}),e[6]=m,e[7]=l,e[8]=u):u=e[8];let p,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=()=>a(!0),g=()=>a(!1),e[9]=p,e[10]=g):(p=e[9],g=e[10]);let h;e[11]!==i?(h=i("sandbox.plainBlocks.headingPlaceholder"),e[11]=i,e[12]=h):h=e[12];const n=tt[m]??tt[2];let c;e[13]!==n?(c=ne("text-foreground",n),e[13]=n,e[14]=c):c=e[14];let d;e[15]!==u||e[16]!==h||e[17]!==c||e[18]!==t?(d=s.jsx(ae,{value:t,onChange:u,onFocus:p,onBlur:g,placeholder:h,className:c}),e[15]=u,e[16]=h,e[17]=c,e[18]=t,e[19]=d):d=e[19];let x;return e[20]!==f||e[21]!==d?(x=s.jsxs("div",{className:"relative",children:[f,d]}),e[20]=f,e[21]=d,e[22]=x):x=e[22],x}function Xl(b){const e=T.c(6),{quote:t,onChange:r}=b,l=D();let o;e[0]!==l?(o=l("sandbox.plainBlocks.quotePlaceholder"),e[0]=l,e[1]=o):o=e[1];let a;return e[2]!==r||e[3]!==t||e[4]!==o?(a=s.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:s.jsx(ae,{value:t,onChange:r,placeholder:o,className:"text-lg italic text-foreground/90"})}),e[2]=r,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function Zl(b){const e=T.c(21),{code:t,language:r,onChange:l}=b,o=D();let a;e[0]!==t||e[1]!==l?(a=h=>l({code:t,language:h.target.value}),e[0]=t,e[1]=l,e[2]=a):a=e[2];let i;e[3]!==o?(i=o("sandbox.plainBlocks.languagePlaceholder"),e[3]=o,e[4]=i):i=e[4];let m;e[5]!==r||e[6]!==a||e[7]!==i?(m=s.jsx("input",{value:r,onChange:a,placeholder:i,className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[5]=r,e[6]=a,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==r||e[10]!==l?(f=h=>l({code:h,language:r}),e[9]=r,e[10]=l,e[11]=f):f=e[11];let u;e[12]!==o?(u=o("sandbox.plainBlocks.codePlaceholder"),e[12]=o,e[13]=u):u=e[13];let p;e[14]!==t||e[15]!==f||e[16]!==u?(p=s.jsx(ae,{value:t,onChange:f,placeholder:u,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=f,e[16]=u,e[17]=p):p=e[17];let g;return e[18]!==m||e[19]!==p?(g=s.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[m,p]}),e[18]=m,e[19]=p,e[20]=g):g=e[20],g}function es({items:b,style:e,onChange:t,decofile:r,sandboxRef:l}){const o=D(),a=We({decofile:r,sandboxRef:l}),i=q.useRef(t);i.current=t;const m=q.useRef(e);m.current=e;const f=He({extensions:[Me.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,gapcursor:!1}),Ve.configure({placeholder:o("sandbox.plainBlocks.listItemPlaceholder")})],content:ql(b,e==="ordered"),editorProps:{attributes:{class:ne("focus:outline-none text-[15px] leading-relaxed","[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-7 [&_ol]:pl-7","[&_ul]:my-0 [&_ol]:my-0 [&_li]:pl-1.5 [&_li]:my-1 [&_p]:my-0","marker:text-muted-foreground marker:tabular-nums",Ke)},handleKeyDown:(p,g)=>g.key==="Tab"},onUpdate:({editor:p})=>{i.current({items:Gl(p.getHTML()).join(`
`),style:p.isActive("orderedList")?"ordered":p.isActive("bulletList")?"unordered":m.current})}}),u=qe({editor:f,selector:({editor:p})=>({isFocused:p?.isFocused??!1,bullet:p?.isActive("bulletList")??!1,ordered:p?.isActive("orderedList")??!1})});return f?s.jsxs("div",{className:"relative",children:[u.isFocused&&s.jsxs(Je,{children:[s.jsx(ee,{active:u.bullet,label:o("sandbox.plainBlocks.bulletedLabel"),onClick:()=>!u.bullet&&f.chain().focus().toggleBulletList().run(),children:"•"}),s.jsx(ee,{active:u.ordered,label:o("sandbox.plainBlocks.numberedLabel"),onClick:()=>!u.ordered&&f.chain().focus().toggleOrderedList().run(),children:"1."})]}),s.jsx(Lt,{editor:f,sources:a}),s.jsx(Ge,{editor:f,className:"text-foreground"})]}):null}function ts(b){const e=b.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=b.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function ls(b){const e=T.c(28),{url:t,caption:r,onChange:l}=b,o=D();let a;e[0]!==t?(a=ts(t),e[0]=t,e[1]=a):a=e[1];const i=a;let m;e[2]!==r||e[3]!==i||e[4]!==o?(m=i?s.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:s.jsx("iframe",{src:i,title:r||o("sandbox.mediaBlocks.video"),sandbox:"allow-scripts allow-same-origin allow-presentation",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):s.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:o("sandbox.mediaBlocks.pasteVideoUrl")}),e[2]=r,e[3]=i,e[4]=o,e[5]=m):m=e[5];let f;e[6]!==r||e[7]!==l?(f=d=>l({url:d.target.value,caption:r}),e[6]=r,e[7]=l,e[8]=f):f=e[8];let u;e[9]!==o?(u=o("sandbox.mediaBlocks.videoUrlPlaceholder"),e[9]=o,e[10]=u):u=e[10];let p;e[11]!==f||e[12]!==u||e[13]!==t?(p=s.jsx("input",{value:t,onChange:f,placeholder:u,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[11]=f,e[12]=u,e[13]=t,e[14]=p):p=e[14];let g;e[15]!==l||e[16]!==t?(g=d=>l({url:t,caption:d}),e[15]=l,e[16]=t,e[17]=g):g=e[17];let h;e[18]!==o?(h=o("sandbox.mediaBlocks.addCaption"),e[18]=o,e[19]=h):h=e[19];let n;e[20]!==r||e[21]!==g||e[22]!==h?(n=s.jsx(ae,{value:r,onChange:g,placeholder:h,className:"text-center text-sm italic text-muted-foreground"}),e[20]=r,e[21]=g,e[22]=h,e[23]=n):n=e[23];let c;return e[24]!==m||e[25]!==p||e[26]!==n?(c=s.jsxs("div",{className:"space-y-2",children:[m,p,n]}),e[24]=m,e[25]=p,e[26]=n,e[27]=c):c=e[27],c}function ss(){const b=T.c(5),e=D();let t;b[0]!==e?(t=e("sandbox.mediaBlocks.divider"),b[0]=e,b[1]=t):t=b[1];let r;b[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"h-px flex-1 bg-border"}),b[2]=r):r=b[2];let l;return b[3]!==t?(l=s.jsx("div",{className:"flex items-center py-3","aria-label":t,children:r}),b[3]=t,b[4]=l):l=b[4],l}function os(b){const e=T.c(22),{text:t,href:r,onChange:l}=b,o=D();let a;e[0]!==r||e[1]!==l?(a=n=>l({text:n.target.value,href:r}),e[0]=r,e[1]=l,e[2]=a):a=e[2];let i;e[3]!==o?(i=o("sandbox.mediaBlocks.buttonLabel"),e[3]=o,e[4]=i):i=e[4];const m=Math.max(t.length||11,8);let f;e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==t?(f=s.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:s.jsx("input",{value:t,onChange:a,placeholder:i,size:m,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[5]=a,e[6]=i,e[7]=m,e[8]=t,e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==t?(u=n=>l({text:t,href:n.target.value}),e[10]=l,e[11]=t,e[12]=u):u=e[12];let p;e[13]!==o?(p=o("sandbox.mediaBlocks.destinationUrlPlaceholder"),e[13]=o,e[14]=p):p=e[14];let g;e[15]!==r||e[16]!==u||e[17]!==p?(g=s.jsx("input",{value:r,onChange:u,placeholder:p,className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=r,e[16]=u,e[17]=p,e[18]=g):g=e[18];let h;return e[19]!==f||e[20]!==g?(h=s.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,g]}),e[19]=f,e[20]=g,e[21]=h):h=e[21],h}const Ae=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function ns(b){const e=T.c(51),{title:t,body:r,variant:l,onChange:o}=b,a=D(),[i,m]=q.useState(!1);let f;e[0]!==l?(f=Ae.find(B=>B.value===l)??Ae[0],e[0]=l,e[1]=f):f=e[1];const u=f;let p,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>m(!0),g=B=>{B.currentTarget.contains(B.relatedTarget)||m(!1)},e[2]=p,e[3]=g):(p=e[2],g=e[3]);let h;e[4]!==r||e[5]!==i||e[6]!==o||e[7]!==t||e[8]!==u.value?(h=i&&s.jsx(Je,{children:Ae.map(B=>s.jsx(ee,{active:u.value===B.value,label:B.value,onClick:()=>o({title:t,body:r,variant:B.value}),children:s.jsx("span",{style:{color:B.color},children:B.icon})},B.value))}),e[4]=r,e[5]=i,e[6]=o,e[7]=t,e[8]=u.value,e[9]=h):h=e[9];const n=`3px solid ${u.color}`,c=`color-mix(in oklch, ${u.color} 8%, transparent)`;let d;e[10]!==n||e[11]!==c?(d={borderLeft:n,backgroundColor:c},e[10]=n,e[11]=c,e[12]=d):d=e[12];let x;e[13]!==u.color?(x={color:u.color},e[13]=u.color,e[14]=x):x=e[14];let v;e[15]!==u.icon?(v=s.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:u.icon}),e[15]=u.icon,e[16]=v):v=e[16];let j;e[17]!==r||e[18]!==o||e[19]!==l?(j=B=>o({title:B.target.value,body:r,variant:l}),e[17]=r,e[18]=o,e[19]=l,e[20]=j):j=e[20];let N;e[21]!==a?(N=a("sandbox.mediaBlocks.calloutTitle"),e[21]=a,e[22]=N):N=e[22];let k;e[23]!==u.color?(k={color:u.color},e[23]=u.color,e[24]=k):k=e[24];let y;e[25]!==j||e[26]!==N||e[27]!==k||e[28]!==t?(y=s.jsx("input",{value:t,onChange:j,placeholder:N,className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:k}),e[25]=j,e[26]=N,e[27]=k,e[28]=t,e[29]=y):y=e[29];let w;e[30]!==y||e[31]!==x||e[32]!==v?(w=s.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:x,children:[v,y]}),e[30]=y,e[31]=x,e[32]=v,e[33]=w):w=e[33];let S;e[34]!==o||e[35]!==t||e[36]!==l?(S=B=>o({title:t,body:B,variant:l}),e[34]=o,e[35]=t,e[36]=l,e[37]=S):S=e[37];let C;e[38]!==a?(C=a("sandbox.mediaBlocks.calloutText"),e[38]=a,e[39]=C):C=e[39];let P;e[40]!==r||e[41]!==S||e[42]!==C?(P=s.jsx(ae,{value:r,onChange:S,placeholder:C,className:"text-[15px] leading-relaxed text-foreground"}),e[40]=r,e[41]=S,e[42]=C,e[43]=P):P=e[43];let _;e[44]!==w||e[45]!==P||e[46]!==d?(_=s.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:d,children:[w,P]}),e[44]=w,e[45]=P,e[46]=d,e[47]=_):_=e[47];let $;return e[48]!==_||e[49]!==h?($=s.jsxs("div",{className:"relative",onFocus:p,onBlur:g,children:[h,_]}),e[48]=_,e[49]=h,e[50]=$):$=e[50],$}function rs(b){const e=T.c(34),{value:t,label:r,description:l,onChange:o}=b,a=D();let i;e[0]!==l||e[1]!==r||e[2]!==o?(i=x=>o({value:x.target.value,label:r,description:l}),e[0]=l,e[1]=r,e[2]=o,e[3]=i):i=e[3];let m;e[4]!==a?(m=a("sandbox.mediaBlocks.statValuePlaceholder"),e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==m||e[8]!==t?(f=s.jsx("input",{value:t,onChange:i,placeholder:m,className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[6]=i,e[7]=m,e[8]=t,e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==o||e[12]!==t?(u=x=>o({value:t,label:x.target.value,description:l}),e[10]=l,e[11]=o,e[12]=t,e[13]=u):u=e[13];let p;e[14]!==a?(p=a("sandbox.mediaBlocks.label"),e[14]=a,e[15]=p):p=e[15];let g;e[16]!==r||e[17]!==u||e[18]!==p?(g=s.jsx("input",{value:r,onChange:u,placeholder:p,className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[16]=r,e[17]=u,e[18]=p,e[19]=g):g=e[19];let h;e[20]!==r||e[21]!==o||e[22]!==t?(h=x=>o({value:t,label:r,description:x}),e[20]=r,e[21]=o,e[22]=t,e[23]=h):h=e[23];let n;e[24]!==a?(n=a("sandbox.mediaBlocks.optionalDescription"),e[24]=a,e[25]=n):n=e[25];let c;e[26]!==l||e[27]!==h||e[28]!==n?(c=s.jsx(ae,{value:l,onChange:h,placeholder:n,className:"max-w-md text-center text-sm text-muted-foreground"}),e[26]=l,e[27]=h,e[28]=n,e[29]=c):c=e[29];let d;return e[30]!==f||e[31]!==g||e[32]!==c?(d=s.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,g,c]}),e[30]=f,e[31]=g,e[32]=c,e[33]=d):d=e[33],d}function is(b){const e=T.c(74),{block:t,onChange:r}=b,l=D();let o;e[0]!==t.size?(o=R(t.size)||"normal",e[0]=t.size,e[1]=o):o=e[1];const a=o,i=t.url,m=t.mobileUrl;let f,u;e[2]!==t||e[3]!==r?(f=E=>r({...t,url:E}),u=E=>r({...t,mobileUrl:E}),e[2]=t,e[3]=r,e[4]=f,e[5]=u):(f=e[4],u=e[5]);let p;e[6]!==t.alt?(p=R(t.alt),e[6]=t.alt,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=["normal","full"],e[8]=g):g=e[8];let h;e[9]!==t||e[10]!==r||e[11]!==a||e[12]!==l?(h=g.map(E=>s.jsx(ee,{active:a===E,label:E,onClick:()=>r({...t,size:E}),children:s.jsx("span",{className:"px-0.5 text-xs",children:l(E==="full"?"sandbox.mediaBlocks.fullWidth":"sandbox.mediaBlocks.normal")})},E)),e[9]=t,e[10]=r,e[11]=a,e[12]=l,e[13]=h):h=e[13];const n=t.highPriority===!0;let c;e[14]!==l?(c=l("sandbox.mediaBlocks.highPriority"),e[14]=l,e[15]=c):c=e[15];let d;e[16]!==t||e[17]!==r?(d=()=>r({...t,highPriority:t.highPriority?void 0:!0}),e[16]=t,e[17]=r,e[18]=d):d=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(jl,{size:14}),e[19]=x):x=e[19];let v;e[20]!==c||e[21]!==d||e[22]!==n?(v=s.jsx(kl,{asChild:!0,children:s.jsx("span",{children:s.jsx(ee,{active:n,label:c,onClick:d,children:x})})}),e[20]=c,e[21]=d,e[22]=n,e[23]=v):v=e[23];let j;e[24]!==l?(j=l("sandbox.mediaBlocks.highPriorityHint"),e[24]=l,e[25]=j):j=e[25];let N;e[26]!==j?(N=s.jsx(yl,{className:"max-w-64",children:j}),e[26]=j,e[27]=N):N=e[27];let k;e[28]!==v||e[29]!==N?(k=s.jsxs(Nl,{children:[v,N]}),e[28]=v,e[29]=N,e[30]=k):k=e[30];let y;e[31]!==k||e[32]!==h?(y=s.jsxs(s.Fragment,{children:[h,k]}),e[31]=k,e[32]=h,e[33]=y):y=e[33];let w;e[34]!==t.mobileUrl||e[35]!==t.url||e[36]!==y||e[37]!==f||e[38]!==u||e[39]!==p?(w=s.jsx(Al,{value:i,mobileValue:m,onChange:f,onMobileChange:u,alt:p,toolbarExtras:y}),e[34]=t.mobileUrl,e[35]=t.url,e[36]=y,e[37]=f,e[38]=u,e[39]=p,e[40]=w):w=e[40];let S;e[41]!==t.caption?(S=R(t.caption),e[41]=t.caption,e[42]=S):S=e[42];let C;e[43]!==t||e[44]!==r?(C=E=>r({...t,caption:E}),e[43]=t,e[44]=r,e[45]=C):C=e[45];let P;e[46]!==l?(P=l("sandbox.mediaBlocks.addCaption"),e[46]=l,e[47]=P):P=e[47];let _;e[48]!==S||e[49]!==C||e[50]!==P?(_=s.jsx(ae,{value:S,onChange:C,placeholder:P,className:"text-center text-sm italic text-muted-foreground"}),e[48]=S,e[49]=C,e[50]=P,e[51]=_):_=e[51];let $;e[52]!==l?($=l("sandbox.mediaBlocks.altLabel"),e[52]=l,e[53]=$):$=e[53];let B;e[54]!==$?(B=s.jsx("span",{className:"shrink-0 font-medium",children:$}),e[54]=$,e[55]=B):B=e[55];let L;e[56]!==t.alt?(L=R(t.alt),e[56]=t.alt,e[57]=L):L=e[57];let I;e[58]!==t||e[59]!==r?(I=E=>r({...t,alt:E}),e[58]=t,e[59]=r,e[60]=I):I=e[60];let A;e[61]!==l?(A=l("sandbox.mediaBlocks.altText"),e[61]=l,e[62]=A):A=e[62];let U;e[63]!==L||e[64]!==I||e[65]!==A?(U=s.jsx(ae,{value:L,onChange:I,placeholder:A,className:"text-xs"}),e[63]=L,e[64]=I,e[65]=A,e[66]=U):U=e[66];let O;e[67]!==B||e[68]!==U?(O=s.jsxs("div",{className:"flex items-baseline gap-1.5 text-xs text-muted-foreground",children:[B,U]}),e[67]=B,e[68]=U,e[69]=O):O=e[69];let M;return e[70]!==w||e[71]!==_||e[72]!==O?(M=s.jsxs("div",{className:"space-y-2",children:[w,_,O]}),e[70]=w,e[71]=_,e[72]=O,e[73]=M):M=e[73],M}function as(b){const e=T.c(21),{cards:t,onChange:r}=b,l=D();let o,a,i,m,f;if(e[0]!==t||e[1]!==r||e[2]!==l){a=be(t);let h;e[8]!==r?(h=c=>r(JSON.stringify(c)),e[8]=r,e[9]=h):h=e[9],o=h;const n=(c,d)=>o(a.map((x,v)=>v===c?{...x,...d}:x));f="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",m=a.slice(0,3).map((c,d)=>s.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(ue,{label:l("sandbox.listBlocks.removeCard"),onClick:()=>o(a.filter((x,v)=>v!==d))})}),s.jsx("input",{value:R(c.icon),onChange:x=>n(d,{icon:x.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),s.jsx("input",{value:R(c.title),onChange:x=>n(d,{title:x.target.value}),placeholder:l("sandbox.listBlocks.cardTitle"),className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ae,{value:R(c.body),onChange:x=>n(d,{body:x}),placeholder:l("sandbox.listBlocks.cardBody"),className:"text-sm text-muted-foreground"})]},d)),e[0]=t,e[1]=r,e[2]=l,e[3]=o,e[4]=a,e[5]=i,e[6]=m,e[7]=f}else o=e[3],a=e[4],i=e[5],m=e[6],f=e[7];let u;e[10]!==i||e[11]!==m?(u=s.jsx("div",{className:i,children:m}),e[10]=i,e[11]=m,e[12]=u):u=e[12];let p;e[13]!==o||e[14]!==a||e[15]!==l?(p=a.length<3&&s.jsx(fe,{label:l("sandbox.listBlocks.addCard"),onClick:()=>o([...a,{title:"",body:""}])}),e[13]=o,e[14]=a,e[15]=l,e[16]=p):p=e[16];let g;return e[17]!==f||e[18]!==u||e[19]!==p?(g=s.jsxs("div",{className:f,children:[u,p]}),e[17]=f,e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function cs(b){const e=T.c(36),{title:t,items:r,onChange:l}=b,o=D();let a,i,m,f,u;if(e[0]!==r||e[1]!==l||e[2]!==o||e[3]!==t){i=be(r);let d;e[9]!==l||e[10]!==t?(d=j=>l({title:t,items:JSON.stringify(j)}),e[9]=l,e[10]=t,e[11]=d):d=e[11],a=d,f="space-y-2";let x;e[12]!==r||e[13]!==l?(x=j=>l({title:j.target.value,items:r}),e[12]=r,e[13]=l,e[14]=x):x=e[14];let v;e[15]!==o?(v=o("sandbox.listBlocks.checklistTitle"),e[15]=o,e[16]=v):v=e[16],e[17]!==x||e[18]!==v||e[19]!==t?(u=s.jsx("input",{value:t,onChange:x,placeholder:v,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[17]=x,e[18]=v,e[19]=t,e[20]=u):u=e[20],m=i.map((j,N)=>s.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[s.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:s.jsx(Ft,{size:15})}),s.jsx(ae,{value:j,onChange:k=>a(i.map((y,w)=>w===N?k:y)),placeholder:o("sandbox.listBlocks.checklistItem"),className:"text-[15px] text-foreground"}),s.jsx(ue,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>a(i.filter((k,y)=>y!==N))})]},N)),e[0]=r,e[1]=l,e[2]=o,e[3]=t,e[4]=a,e[5]=i,e[6]=m,e[7]=f,e[8]=u}else a=e[4],i=e[5],m=e[6],f=e[7],u=e[8];let p;e[21]!==m?(p=s.jsx("ul",{children:m}),e[21]=m,e[22]=p):p=e[22];let g;e[23]!==o?(g=o("sandbox.listBlocks.addItem"),e[23]=o,e[24]=g):g=e[24];let h;e[25]!==a||e[26]!==i?(h=()=>a([...i,""]),e[25]=a,e[26]=i,e[27]=h):h=e[27];let n;e[28]!==g||e[29]!==h?(n=s.jsx(fe,{label:g,onClick:h}),e[28]=g,e[29]=h,e[30]=n):n=e[30];let c;return e[31]!==f||e[32]!==u||e[33]!==p||e[34]!==n?(c=s.jsxs("div",{className:f,children:[u,p,n]}),e[31]=f,e[32]=u,e[33]=p,e[34]=n,e[35]=c):c=e[35],c}function ds(b){const e=T.c(21),{stats:t,onChange:r}=b,l=D();let o,a,i,m,f;if(e[0]!==r||e[1]!==t||e[2]!==l){a=be(t);let h;e[8]!==r?(h=c=>r(JSON.stringify(c)),e[8]=r,e[9]=h):h=e[9],o=h;const n=(c,d)=>o(a.map((x,v)=>v===c?{...x,...d}:x));f="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",m=a.slice(0,3).map((c,d)=>s.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(ue,{label:l("sandbox.listBlocks.removeStat"),onClick:()=>o(a.filter((x,v)=>v!==d))})}),s.jsx("input",{value:R(c.value),onChange:x=>n(d,{value:x.target.value}),placeholder:l("sandbox.listBlocks.statValuePlaceholder"),className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),s.jsx("input",{value:R(c.label),onChange:x=>n(d,{label:x.target.value}),placeholder:l("sandbox.listBlocks.label"),className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},d)),e[0]=r,e[1]=t,e[2]=l,e[3]=o,e[4]=a,e[5]=i,e[6]=m,e[7]=f}else o=e[3],a=e[4],i=e[5],m=e[6],f=e[7];let u;e[10]!==i||e[11]!==m?(u=s.jsx("div",{className:i,children:m}),e[10]=i,e[11]=m,e[12]=u):u=e[12];let p;e[13]!==o||e[14]!==a||e[15]!==l?(p=a.length<3&&s.jsx(fe,{label:l("sandbox.listBlocks.addStat"),onClick:()=>o([...a,{value:"",label:""}])}),e[13]=o,e[14]=a,e[15]=l,e[16]=p):p=e[16];let g;return e[17]!==f||e[18]!==u||e[19]!==p?(g=s.jsxs("div",{className:f,children:[u,p]}),e[17]=f,e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function us(b){const e=T.c(38),{title:t,steps:r,onChange:l}=b,o=D();let a,i,m,f,u,p;if(e[0]!==l||e[1]!==r||e[2]!==o||e[3]!==t){i=be(r);let x;e[10]!==l||e[11]!==t?(x=k=>l({title:t,steps:JSON.stringify(k)}),e[10]=l,e[11]=t,e[12]=x):x=e[12],a=x;const v=(k,y)=>a(i.map((w,S)=>S===k?{...w,...y}:w));u="space-y-2";let j;e[13]!==l||e[14]!==r?(j=k=>l({title:k.target.value,steps:r}),e[13]=l,e[14]=r,e[15]=j):j=e[15];let N;e[16]!==o?(N=o("sandbox.listBlocks.stepsTitle"),e[16]=o,e[17]=N):N=e[17],e[18]!==j||e[19]!==N||e[20]!==t?(p=s.jsx("input",{value:t,onChange:j,placeholder:N,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[18]=j,e[19]=N,e[20]=t,e[21]=p):p=e[21],m="space-y-3",f=i.map((k,y)=>s.jsxs("li",{className:"group/item flex gap-4",children:[s.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:y+1}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[s.jsx("input",{value:R(k.title),onChange:w=>v(y,{title:w.target.value}),placeholder:o("sandbox.listBlocks.stepTitle"),className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ae,{value:R(k.description),onChange:w=>v(y,{description:w}),placeholder:o("sandbox.listBlocks.stepDescription"),className:"text-sm text-muted-foreground"})]}),s.jsx(ue,{label:o("sandbox.listBlocks.removeStep"),onClick:()=>a(i.filter((w,S)=>S!==y))})]},y)),e[0]=l,e[1]=r,e[2]=o,e[3]=t,e[4]=a,e[5]=i,e[6]=m,e[7]=f,e[8]=u,e[9]=p}else a=e[4],i=e[5],m=e[6],f=e[7],u=e[8],p=e[9];let g;e[22]!==m||e[23]!==f?(g=s.jsx("ol",{className:m,children:f}),e[22]=m,e[23]=f,e[24]=g):g=e[24];let h;e[25]!==o?(h=o("sandbox.listBlocks.addStep"),e[25]=o,e[26]=h):h=e[26];let n;e[27]!==a||e[28]!==i?(n=()=>a([...i,{title:"",description:""}]),e[27]=a,e[28]=i,e[29]=n):n=e[29];let c;e[30]!==h||e[31]!==n?(c=s.jsx(fe,{label:h,onClick:n}),e[30]=h,e[31]=n,e[32]=c):c=e[32];let d;return e[33]!==u||e[34]!==p||e[35]!==g||e[36]!==c?(d=s.jsxs("div",{className:u,children:[p,g,c]}),e[33]=u,e[34]=p,e[35]=g,e[36]=c,e[37]=d):d=e[37],d}function lt(b,e){try{const t=JSON.parse(b||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items.map(R):[]}}catch{return{title:e,items:[]}}}function fs(b){const e=T.c(13),{left:t,right:r,onChange:l}=b,o=D();let a;if(e[0]!==t||e[1]!==l||e[2]!==r||e[3]!==o){const i={left:lt(t,o("sandbox.listBlocks.optionA")),right:lt(r,o("sandbox.listBlocks.optionB"))};let m;e[5]!==t||e[6]!==l||e[7]!==r?(m=(h,n)=>l({left:h==="left"?JSON.stringify(n):t,right:h==="right"?JSON.stringify(n):r}),e[5]=t,e[6]=l,e[7]=r,e[8]=m):m=e[8];const f=m;let u;e[9]!==f||e[10]!==o?(u=(h,n,c)=>{const d=n.items??[];return s.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[s.jsx("input",{value:R(n.title),onChange:x=>f(h,{...n,title:x.target.value}),placeholder:o("sandbox.listBlocks.columnTitle"),className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx("ul",{className:"space-y-1.5",children:d.map((x,v)=>s.jsxs("li",{className:"group/item flex items-start gap-2",children:[s.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:c},children:"✓"}),s.jsx(ae,{value:x,onChange:j=>f(h,{...n,items:d.map((N,k)=>k===v?j:N)}),placeholder:o("sandbox.listBlocks.item"),className:"text-sm text-foreground"}),s.jsx(ue,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>f(h,{...n,items:d.filter((j,N)=>N!==v)})})]},v))}),s.jsx(fe,{label:o("sandbox.listBlocks.addItem"),onClick:()=>f(h,{...n,items:[...d,""]})})]})},e[9]=f,e[10]=o,e[11]=u):u=e[11];const p=u;let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=ne("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[12]=g):g=e[12],a=s.jsxs("div",{className:g,children:[p("left",i.left,"oklch(0.65 0.17 150)"),p("right",i.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=r,e[3]=o,e[4]=a}else a=e[4];return a}const ms=["normal","h1","h2","h3"],xs=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function ps(b){const e=b.match(xs);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:b}}function st(b,e){return e?b==="normal"?e:`<${b}>${e}</${b}>`:""}const ot={normal:"sandbox.productBlocks.headingNormal",h1:"sandbox.productBlocks.headingH1",h2:"sandbox.productBlocks.headingH2",h3:"sandbox.productBlocks.headingH3"},hs={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function gs(b){const e=T.c(27),{value:t,onChange:r}=b,l=D();let o,a,i,m,f;e[0]!==r||e[1]!==l||e[2]!==t?({level:o,text:f}=ps(t),m="space-y-1.5",a="flex items-center gap-0.5",i=ms.map(x=>s.jsx(ee,{active:o===x,label:l(ot[x]),onClick:()=>r(st(x,f)),children:l(ot[x])},x)),e[0]=r,e[1]=l,e[2]=t,e[3]=o,e[4]=a,e[5]=i,e[6]=m,e[7]=f):(o=e[3],a=e[4],i=e[5],m=e[6],f=e[7]);let u;e[8]!==a||e[9]!==i?(u=s.jsx("div",{className:a,children:i}),e[8]=a,e[9]=i,e[10]=u):u=e[10];let p;e[11]!==o||e[12]!==r?(p=x=>r(st(o,x.target.value)),e[11]=o,e[12]=r,e[13]=p):p=e[13];let g;e[14]!==l?(g=l("sandbox.productBlocks.shelfTitlePlaceholder"),e[14]=l,e[15]=g):g=e[15];const h=hs[o];let n;e[16]!==h?(n=ne("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",h),e[16]=h,e[17]=n):n=e[17];let c;e[18]!==p||e[19]!==g||e[20]!==n||e[21]!==f?(c=s.jsx("input",{value:f,onChange:p,placeholder:g,className:n}),e[18]=p,e[19]=g,e[20]=n,e[21]=f,e[22]=c):c=e[22];let d;return e[23]!==m||e[24]!==u||e[25]!==c?(d=s.jsxs("div",{className:m,children:[u,c]}),e[23]=m,e[24]=u,e[25]=c,e[26]=d):d=e[26],d}function Tt(b){const e=T.c(4),{label:t,onClick:r}=b;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:13}),e[0]=l):l=e[0];let o;return e[1]!==t||e[2]!==r?(o=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l,t]}),e[1]=t,e[2]=r,e[3]=o):o=e[3],o}function Et(b){const e=T.c(9),{option:t,loading:r,className:l,iconSize:o}=b,a=o===void 0?18:o;let i;e[0]!==l?(i=ne("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let m;e[2]!==a||e[3]!==r||e[4]!==t?(m=t?.image?s.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):r?s.jsx(Dt,{size:"xs"}):s.jsx(wt,{size:a}),e[2]=a,e[3]=r,e[4]=t,e[5]=m):m=e[5];let f;return e[6]!==i||e[7]!==m?(f=s.jsx("span",{className:i,children:m}),e[6]=i,e[7]=m,e[8]=f):f=e[8],f}function bs(b){const e=T.c(50),{id:t,option:r,loading:l,onRemove:o}=b,a=D();let i;e[0]!==t?(i={id:t},e[0]=t,e[1]=i):i=e[1];const{attributes:m,listeners:f,setNodeRef:u,transform:p,transition:g,isDragging:h}=ht(i);let n;e[2]!==p?(n=ft.Transform.toString(p),e[2]=p,e[3]=n):n=e[3];let c;e[4]!==n||e[5]!==g?(c={transform:n,transition:g},e[4]=n,e[5]=g,e[6]=c):c=e[6];const d=h&&"z-10 opacity-60";let x;e[7]!==d?(x=ne("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",d),e[7]=d,e[8]=x):x=e[8];let v;e[9]!==l||e[10]!==r?(v=s.jsx(Et,{option:r,loading:l,className:"h-full w-full"}),e[9]=l,e[10]=r,e[11]=v):v=e[11];let j;e[12]!==a?(j=a("sandbox.productBlocks.dragToReorderLabel"),e[12]=a,e[13]=j):j=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Nt,{size:13}),e[14]=N):N=e[14];let k;e[15]!==m||e[16]!==f||e[17]!==j?(k=s.jsx("button",{type:"button","aria-label":j,...m,...f,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100 rounded-lg",children:N}),e[15]=m,e[16]=f,e[17]=j,e[18]=k):k=e[18];let y;e[19]!==a?(y=a("sandbox.productBlocks.removeProductLabel"),e[19]=a,e[20]=y):y=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx($l,{size:13}),e[21]=w):w=e[21];let S;e[22]!==o||e[23]!==y?(S=s.jsx("button",{type:"button","aria-label":y,onClick:o,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer rounded-lg",children:w}),e[22]=o,e[23]=y,e[24]=S):S=e[24];let C;e[25]!==S||e[26]!==v||e[27]!==k?(C=s.jsxs("div",{className:"relative aspect-square",children:[v,k,S]}),e[25]=S,e[26]=v,e[27]=k,e[28]=C):C=e[28];let P;e[29]!==t||e[30]!==l||e[31]!==r?.label||e[32]!==a?(P=r?.label??(l?a("sandbox.productBlocks.loadingEllipsis"):a("sandbox.productBlocks.productWithId",{id:t})),e[29]=t,e[30]=l,e[31]=r?.label,e[32]=a,e[33]=P):P=e[33];let _;e[34]!==P?(_=s.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:P}),e[34]=P,e[35]=_):_=e[35];let $;e[36]!==t||e[37]!==a?($=a("sandbox.productBlocks.idLabel",{id:t}),e[36]=t,e[37]=a,e[38]=$):$=e[38];let B;e[39]!==$?(B=s.jsx("p",{className:"text-2xs text-muted-foreground",children:$}),e[39]=$,e[40]=B):B=e[40];let L;e[41]!==_||e[42]!==B?(L=s.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[_,B]}),e[41]=_,e[42]=B,e[43]=L):L=e[43];let I;return e[44]!==u||e[45]!==C||e[46]!==L||e[47]!==c||e[48]!==x?(I=s.jsxs("div",{ref:u,style:c,className:x,children:[C,L]}),e[44]=u,e[45]=C,e[46]=L,e[47]=c,e[48]=x,e[49]=I):I=e[49],I}function vs(b){const e=T.c(21),{ids:t,lookup:r,onReorder:l,onRemove:o}=b;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={activationConstraint:{distance:6}},e[0]=a):a=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:mt},e[1]=i):i=e[1];const m=it($e(ct,a),$e(at,i));let f;e[2]!==t||e[3]!==l?(f=c=>{const{active:d,over:x}=c;if(!x||d.id===x.id)return;const v=t.indexOf(String(d.id)),j=t.indexOf(String(x.id));v===-1||j===-1||l(xt(t,v,j))},e[2]=t,e[3]=l,e[4]=f):f=e[4];const u=f;let p;if(e[5]!==t||e[6]!==r||e[7]!==o){let c;e[9]!==r||e[10]!==o?(c=d=>s.jsx(bs,{id:d,option:r.byId.get(d),loading:r.isLoading&&!r.byId.get(d),onRemove:()=>o(d)},d),e[9]=r,e[10]=o,e[11]=c):c=e[11],p=t.map(c),e[5]=t,e[6]=r,e[7]=o,e[8]=p}else p=e[8];let g;e[12]!==p?(g=s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:p}),e[12]=p,e[13]=g):g=e[13];let h;e[14]!==t||e[15]!==g?(h=s.jsx(pt,{items:t,strategy:Ut,children:g}),e[14]=t,e[15]=g,e[16]=h):h=e[16];let n;return e[17]!==u||e[18]!==m||e[19]!==h?(n=s.jsx(dt,{sensors:m,collisionDetection:ut,onDragEnd:u,children:h}),e[17]=u,e[18]=m,e[19]=h,e[20]=n):n=e[20],n}function js(b){const e=T.c(13),{onBrowse:t}=b,r=D();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx(al,{size:16})}),e[0]=l):l=e[0];let o;e[1]!==r?(o=r("sandbox.productBlocks.addProductsButton"),e[1]=r,e[2]=o):o=e[2];let a;e[3]!==o?(a=s.jsx("span",{className:"text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=a):a=e[4];let i;e[5]!==r?(i=r("sandbox.productBlocks.addProductsDescription"),e[5]=r,e[6]=i):i=e[6];let m;e[7]!==i?(m=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[7]=i,e[8]=m):m=e[8];let f;return e[9]!==t||e[10]!==a||e[11]!==m?(f=s.jsxs("button",{type:"button",onClick:t,className:"flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed py-8 text-center transition-colors hover:border-foreground/30 hover:bg-accent cursor-pointer",children:[l,a,m]}),e[9]=t,e[10]=a,e[11]=m,e[12]=f):f=e[12],f}function ks(b){const e=T.c(30),{ids:t,onChange:r}=b,l=D();let o;e[0]!==t||e[1]!==r?(o=(d,x)=>r(t.map((v,j)=>j===d?x:v)),e[0]=t,e[1]=r,e[2]=o):o=e[2];const a=o;let i;e[3]!==l?(i=l("sandbox.productBlocks.vtexProductIds"),e[3]=l,e[4]=i):i=e[4];let m;e[5]!==i?(m=s.jsx(ve,{className:"text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==t.length||e[8]!==l?(f=t.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:l("sandbox.productBlocks.startDevServerDescription")}),e[7]=t.length,e[8]=l,e[9]=f):f=e[9];let u;e[10]!==t||e[11]!==r||e[12]!==a||e[13]!==l?(u=t.map((d,x)=>s.jsxs("li",{className:"group/item flex items-center gap-3",children:[s.jsx("input",{value:d,onChange:v=>a(x,v.target.value),placeholder:l("sandbox.productBlocks.skuIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ue,{label:l("sandbox.productBlocks.removeProductIdButton"),onClick:()=>r(t.filter((v,j)=>j!==x))})]},x)),e[10]=t,e[11]=r,e[12]=a,e[13]=l,e[14]=u):u=e[14];let p;e[15]!==u?(p=s.jsx("ul",{className:"space-y-2",children:u}),e[15]=u,e[16]=p):p=e[16];let g;e[17]!==l?(g=l("sandbox.productBlocks.addProductIdButton"),e[17]=l,e[18]=g):g=e[18];let h;e[19]!==t||e[20]!==r?(h=()=>r([...t,""]),e[19]=t,e[20]=r,e[21]=h):h=e[21];let n;e[22]!==g||e[23]!==h?(n=s.jsx(fe,{label:g,onClick:h}),e[22]=g,e[23]=h,e[24]=n):n=e[24];let c;return e[25]!==m||e[26]!==f||e[27]!==p||e[28]!==n?(c=s.jsxs("div",{className:"space-y-2",children:[m,f,p,n]}),e[25]=m,e[26]=f,e[27]=p,e[28]=n,e[29]=c):c=e[29],c}function ys(b){const e=T.c(32),{block:t,onChange:r,sandboxRef:l}=b,o=D();let a,i;e[0]!==t.products?(a=gt(t.products),i=new Set(a.filter(Boolean)),e[0]=t.products,e[1]=a,e[2]=i):(a=e[1],i=e[2]);let m;e[3]!==i?(m=[...i],e[3]=i,e[4]=m):m=e[4];const f=m,[u,p]=q.useState(!1),g=Bt(l,f);let h;e[5]!==t||e[6]!==r?(h=k=>r({...t,products:bt(t.products,k)}),e[5]=t,e[6]=r,e[7]=h):h=e[7];const n=h;let c;e[8]!==t.title?(c=R(t.title),e[8]=t.title,e[9]=c):c=e[9];let d;e[10]!==t||e[11]!==r?(d=k=>r({...t,title:k}),e[10]=t,e[11]=r,e[12]=d):d=e[12];let x;e[13]!==c||e[14]!==d?(x=s.jsx(gs,{value:c,onChange:d}),e[13]=c,e[14]=d,e[15]=x):x=e[15];let v;e[16]!==f||e[17]!==g||e[18]!==a||e[19]!==l||e[20]!==n||e[21]!==o?(v=l?s.jsxs("div",{className:"space-y-3",children:[f.length>0&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[f.length," ",o(f.length===1?"sandbox.productBlocks.productSingular":"sandbox.productBlocks.productPlural")]}),s.jsx(Tt,{label:o("sandbox.productBlocks.browseProductsButton"),onClick:()=>p(!0)})]}),f.length===0?s.jsx(js,{onBrowse:()=>p(!0)}):s.jsx(vs,{ids:f,lookup:g,onReorder:n,onRemove:k=>n(f.filter(y=>y!==k))})]}):s.jsx(ks,{ids:a,onChange:n}),e[16]=f,e[17]=g,e[18]=a,e[19]=l,e[20]=n,e[21]=o,e[22]=v):v=e[22];let j;e[23]!==f||e[24]!==u||e[25]!==l||e[26]!==n?(j=l&&s.jsx(St,{open:u,onOpenChange:p,sandboxRef:l,selectedIds:f,onChange:n}),e[23]=f,e[24]=u,e[25]=l,e[26]=n,e[27]=j):j=e[27];let N;return e[28]!==x||e[29]!==v||e[30]!==j?(N=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[x,v,j]}),e[28]=x,e[29]=v,e[30]=j,e[31]=N):N=e[31],N}function Ns(b){const e=T.c(27),{id:t,option:r,loading:l,onRemove:o}=b,a=D();let i;e[0]!==l||e[1]!==r?(i=s.jsx(Et,{option:r,loading:l,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=l,e[1]=r,e[2]=i):i=e[2];let m;e[3]!==t||e[4]!==l||e[5]!==r?.label||e[6]!==a?(m=r?.label??(l?a("sandbox.productBlocks.loadingEllipsis"):a("sandbox.productBlocks.productWithId",{id:t})),e[3]=t,e[4]=l,e[5]=r?.label,e[6]=a,e[7]=m):m=e[7];let f;e[8]!==m?(f=s.jsx("p",{className:"truncate text-sm text-foreground",children:m}),e[8]=m,e[9]=f):f=e[9];let u;e[10]!==t||e[11]!==a?(u=a("sandbox.productBlocks.idLabel",{id:t}),e[10]=t,e[11]=a,e[12]=u):u=e[12];let p;e[13]!==u?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[13]=u,e[14]=p):p=e[14];let g;e[15]!==f||e[16]!==p?(g=s.jsxs("div",{className:"min-w-0 flex-1",children:[f,p]}),e[15]=f,e[16]=p,e[17]=g):g=e[17];let h;e[18]!==a?(h=a("sandbox.productBlocks.removeProductButton"),e[18]=a,e[19]=h):h=e[19];let n;e[20]!==o||e[21]!==h?(n=s.jsx(ue,{label:h,onClick:o}),e[20]=o,e[21]=h,e[22]=n):n=e[22];let c;return e[23]!==i||e[24]!==g||e[25]!==n?(c=s.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[i,g,n]}),e[23]=i,e[24]=g,e[25]=n,e[26]=c):c=e[26],c}function Cs(b){const e=T.c(78),{block:t,onChange:r,sandboxRef:l}=b,o=D();let a;e[0]!==t.product?(a=gt(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=a):a=e[1];const i=a,[m,f]=q.useState(!1);let u;e[2]!==i?(u=i?[i]:[],e[2]=i,e[3]=u):u=e[3];const p=Bt(l,u);let g;e[4]!==t||e[5]!==r?(g=K=>r({...t,product:bt(t.product,K)}),e[4]=t,e[5]=r,e[6]=g):g=e[6];const h=g;let n;e[7]!==o?(n=o("sandbox.productBlocks.productCardLabel"),e[7]=o,e[8]=n):n=e[8];let c;e[9]!==n?(c=s.jsx("div",{className:"text-xs font-semibold text-muted-foreground",children:n}),e[9]=n,e[10]=c):c=e[10];let d;e[11]!==o?(d=o("sandbox.productBlocks.ctaLabelField"),e[11]=o,e[12]=d):d=e[12];let x;e[13]!==d?(x=s.jsx(ve,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:d}),e[13]=d,e[14]=x):x=e[14];let v;e[15]!==t.textCta?(v=R(t.textCta),e[15]=t.textCta,e[16]=v):v=e[16];let j;e[17]!==t||e[18]!==r?(j=K=>r({...t,textCta:K.target.value}),e[17]=t,e[18]=r,e[19]=j):j=e[19];let N;e[20]!==o?(N=o("sandbox.productBlocks.ctaLabelPlaceholder"),e[20]=o,e[21]=N):N=e[21];let k;e[22]!==N||e[23]!==v||e[24]!==j?(k=s.jsx("input",{id:"product-card-cta",value:v,onChange:j,placeholder:N,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[22]=N,e[23]=v,e[24]=j,e[25]=k):k=e[25];let y;e[26]!==k||e[27]!==x?(y=s.jsxs("div",{className:"space-y-2",children:[x,k]}),e[26]=k,e[27]=x,e[28]=y):y=e[28];let w;e[29]!==o?(w=o("sandbox.productBlocks.productSlugField"),e[29]=o,e[30]=w):w=e[30];let S;e[31]!==w?(S=s.jsx(ve,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:w}),e[31]=w,e[32]=S):S=e[32];let C;e[33]!==t.productSlug?(C=R(t.productSlug),e[33]=t.productSlug,e[34]=C):C=e[34];let P;e[35]!==t||e[36]!==r?(P=K=>r({...t,productSlug:K.target.value}),e[35]=t,e[36]=r,e[37]=P):P=e[37];let _;e[38]!==o?(_=o("sandbox.productBlocks.productSlugPlaceholder"),e[38]=o,e[39]=_):_=e[39];let $;e[40]!==C||e[41]!==P||e[42]!==_?($=s.jsx("input",{id:"product-card-slug",value:C,onChange:P,placeholder:_,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[40]=C,e[41]=P,e[42]=_,e[43]=$):$=e[43];let B;e[44]!==S||e[45]!==$?(B=s.jsxs("div",{className:"space-y-2",children:[S,$]}),e[44]=S,e[45]=$,e[46]=B):B=e[46];let L;e[47]!==o?(L=o("sandbox.productBlocks.productField"),e[47]=o,e[48]=L):L=e[48];let I;e[49]!==L?(I=s.jsx(ve,{className:"text-xs text-muted-foreground",children:L}),e[49]=L,e[50]=I):I=e[50];let A;e[51]!==i||e[52]!==l||e[53]!==o?(A=l&&i&&s.jsx(Tt,{label:o("sandbox.productBlocks.changeButton"),onClick:()=>f(!0)}),e[51]=i,e[52]=l,e[53]=o,e[54]=A):A=e[54];let U;e[55]!==I||e[56]!==A?(U=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I,A]}),e[55]=I,e[56]=A,e[57]=U):U=e[57];let O;e[58]!==p||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==o?(O=l?i?s.jsx(Ns,{id:i,option:p.byId.get(i),loading:p.isLoading,onRemove:()=>h([])}):s.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s.jsx(Oe,{size:14}),o("sandbox.productBlocks.chooseProductButton")]}):s.jsx("input",{value:i,onChange:K=>h(K.target.value?[K.target.value]:[]),placeholder:o("sandbox.productBlocks.vtexProductIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[58]=p,e[59]=i,e[60]=l,e[61]=h,e[62]=o,e[63]=O):O=e[63];let M;e[64]!==U||e[65]!==O?(M=s.jsxs("div",{className:"space-y-2",children:[U,O]}),e[64]=U,e[65]=O,e[66]=M):M=e[66];let E;e[67]!==m||e[68]!==i||e[69]!==l||e[70]!==h?(E=l&&s.jsx(St,{open:m,onOpenChange:f,sandboxRef:l,selectedIds:i?[i]:[],onChange:h,multiple:!1}),e[67]=m,e[68]=i,e[69]=l,e[70]=h,e[71]=E):E=e[71];let W;return e[72]!==y||e[73]!==B||e[74]!==M||e[75]!==E||e[76]!==c?(W=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[c,y,B,M,E]}),e[72]=y,e[73]=B,e[74]=M,e[75]=E,e[76]=c,e[77]=W):W=e[77],W}const Bs=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/40","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function nt({value:b,onChange:e,placeholder:t,className:r,menuHost:l,sources:o}){const a=q.useRef(e);a.current=e;const i=He({extensions:[Me.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),...t?[Ve.configure({placeholder:t})]:[]],content:b||"",editorProps:{attributes:{class:ne("focus:outline-none",Ke,Bs,r)},handleKeyDown:(m,f)=>f.key==="Enter"},onUpdate:({editor:m})=>a.current(Il(m.getHTML()))});return i?s.jsxs("div",{className:"relative",children:[s.jsx(Lt,{editor:i,appendTo:l??void 0,sources:o}),s.jsx(Ge,{editor:i})]}):null}const Ss=2,ws=2;function Ps(b){return be(b).map(R)}function _s(b){return be(b).map(e=>Array.isArray(e)?e.map(R):[])}function rt(b){return Array.from({length:b},()=>"")}function $s(b,e){return e.reduce((t,r)=>Math.max(t,r.length),b.length)||1}function Is(b){const e=T.c(56),{headers:t,rows:r,onChange:l,decofile:o,sandboxRef:a}=b,i=D();let m;e[0]!==o||e[1]!==a?(m={decofile:o,sandboxRef:a},e[0]=o,e[1]=a,e[2]=m):m=e[2];const f=We(m),[u,p]=q.useState(null);let g,h,n,c,d,x,v,j,N;if(e[3]!==t||e[4]!==f||e[5]!==u||e[6]!==l||e[7]!==r||e[8]!==i){const U=Ps(t),O=_s(r),M=U.length===0&&O.length===0;n=M?Ss:$s(U,O);const E=Array.from({length:n},(H,z)=>U[z]??"");c=M?Array.from({length:ws},()=>rt(n)):O.map(H=>Array.from({length:n},(z,V)=>H[V]??""));const W=`${c.length}x${n}`;let K;e[18]!==l?(K=(H,z)=>l({headers:JSON.stringify(H.some(Ts)?H:[]),rows:JSON.stringify(z)}),e[18]=l,e[19]=K):K=e[19];const Q=K,re=(H,z)=>Q(E.map((V,F)=>F===H?z:V),c),se=(H,z,V)=>Q(E,c.map((F,J)=>J===H?F.map((G,te)=>te===z?V:G):F));h=()=>Q(E,[...c,rt(n)]);const Y=H=>Q(E,c.filter((z,V)=>V!==H));g=()=>Q([...E,""],c.map(Ls));const ie=H=>Q(E.filter((z,V)=>V!==H),c.map(z=>z.filter((V,F)=>F!==H)));N="relative space-y-2",j="overflow-x-auto rounded-lg border",x="w-full border-collapse";let oe;e[20]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx("th",{className:"w-8 border-b"}),e[20]=oe):oe=e[20];const X=s.jsxs("tr",{className:"bg-muted/40",children:[E.map((H,z)=>s.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0 text-left align-top",children:[s.jsx(nt,{value:H,onChange:V=>re(z,V),placeholder:i("sandbox.tableBlock.headerPlaceholder",{n:z+1}),className:"py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide [&_p]:my-0 focus:bg-background",menuHost:u,sources:f}),n>1&&s.jsx("button",{type:"button","aria-label":i("sandbox.tableBlock.removeColumn",{n:z+1}),onClick:()=>ie(z),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer rounded-lg",children:s.jsx(De,{size:12})})]},`${W}-h-${z}`)),oe]});e[21]!==X?(v=s.jsx("thead",{children:X}),e[21]=X,e[22]=v):v=e[22],d=c.map((H,z)=>s.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[H.map((V,F)=>s.jsx("td",{className:"border-r p-0 last:border-r-0 align-top",children:s.jsx(nt,{value:V,onChange:J=>se(z,F,J),placeholder:"—",className:"px-3 py-2 text-sm [&_p]:my-0 focus:bg-muted/30",menuHost:u,sources:f})},`${W}-${z}-${F}`)),s.jsx("td",{className:"w-8 text-center align-middle",children:c.length>1&&s.jsx(Fe,{variant:"ghost-destructive",size:"icon-xs",type:"button","aria-label":i("sandbox.tableBlock.removeRow",{n:z+1}),onClick:()=>Y(z),className:"opacity-0 transition-opacity group-hover/item:opacity-100",children:s.jsx(De,{className:"size-3.25"})})})]},`${W}-${z}`)),e[3]=t,e[4]=f,e[5]=u,e[6]=l,e[7]=r,e[8]=i,e[9]=g,e[10]=h,e[11]=n,e[12]=c,e[13]=d,e[14]=x,e[15]=v,e[16]=j,e[17]=N}else g=e[9],h=e[10],n=e[11],c=e[12],d=e[13],x=e[14],v=e[15],j=e[16],N=e[17];let k;e[23]!==n||e[24]!==c.length||e[25]!==i?(k=c.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:n+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i("sandbox.tableBlock.noRowsYet")})}),e[23]=n,e[24]=c.length,e[25]=i,e[26]=k):k=e[26];let y;e[27]!==d||e[28]!==k?(y=s.jsxs("tbody",{children:[d,k]}),e[27]=d,e[28]=k,e[29]=y):y=e[29];let w;e[30]!==x||e[31]!==v||e[32]!==y?(w=s.jsxs("table",{className:x,children:[v,y]}),e[30]=x,e[31]=v,e[32]=y,e[33]=w):w=e[33];let S;e[34]!==j||e[35]!==w?(S=s.jsx("div",{className:j,children:w}),e[34]=j,e[35]=w,e[36]=S):S=e[36];let C;e[37]!==i?(C=i("sandbox.tableBlock.addRow"),e[37]=i,e[38]=C):C=e[38];let P;e[39]!==h||e[40]!==C?(P=s.jsx(fe,{label:C,onClick:h}),e[39]=h,e[40]=C,e[41]=P):P=e[41];let _;e[42]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ue,{size:13}),e[42]=_):_=e[42];let $;e[43]!==i?($=i("sandbox.tableBlock.addColumn"),e[43]=i,e[44]=$):$=e[44];let B;e[45]!==g||e[46]!==$?(B=s.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[_,$]}),e[45]=g,e[46]=$,e[47]=B):B=e[47];let L;e[48]!==P||e[49]!==B?(L=s.jsxs("div",{className:"flex gap-2",children:[P,B]}),e[48]=P,e[49]=B,e[50]=L):L=e[50];let I;e[51]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{ref:p,className:"absolute z-20"}),e[51]=I):I=e[51];let A;return e[52]!==S||e[53]!==L||e[54]!==N?(A=s.jsxs("div",{className:N,children:[S,L,I]}),e[52]=S,e[53]=L,e[54]=N,e[55]=A):A=e[55],A}function Ls(b){return[...b,""]}function Ts(b){return b.trim()!==""}function Es(b){const e=T.c(50),{block:t,meta:r,onChange:l,decofile:o,sandbox:a,previewBaseUrl:i,onSaveReferencedBlock:m}=b,f=D();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[0]=u):u=e[0];const[p,g]=q.useState(u),h=t.__resolveType??"";let n;e[1]!==r||e[2]!==h?(n=h?Tl(h,r):null,e[1]=r,e[2]=h,e[3]=n):n=e[3];const c=n;if(!c){let B;e[4]!==h||e[5]!==f?(B=f("sandbox.blockRegistry.unknownBlockType",{type:h}),e[4]=h,e[5]=f,e[6]=B):B=e[6];let L;return e[7]!==B?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[7]=B,e[8]=L):L=e[8],L}let d;e[9]!==r||e[10]!==h?(d=Gt(h,r),e[9]=r,e[10]=h,e[11]=d):d=e[11];const x=d;let v;e[12]!==x.iconName||e[13]!==x.iconUrl||e[14]!==x.title?(v=s.jsx(Pt,{iconName:x.iconName,iconUrl:x.iconUrl,alt:x.title,className:"size-7",size:14}),e[12]=x.iconName,e[13]=x.iconUrl,e[14]=x.title,e[15]=v):v=e[15];let j;e[16]!==x.title?(j=s.jsx("span",{className:"truncate text-sm font-medium",children:x.title}),e[16]=x.title,e[17]=j):j=e[17];let N;e[18]!==x.description?(N=x.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:x.description}),e[18]=x.description,e[19]=N):N=e[19];let k;e[20]!==j||e[21]!==N?(k=s.jsxs("div",{className:"flex min-w-0 flex-col",children:[j,N]}),e[20]=j,e[21]=N,e[22]=k):k=e[22];let y;e[23]!==v||e[24]!==k?(y=s.jsxs("div",{className:"flex items-center gap-2.5",children:[v,k]}),e[23]=v,e[24]=k,e[25]=y):y=e[25];let w;e[26]!==f?(w=f("sandbox.blockRegistry.breadcrumbLabel"),e[26]=f,e[27]=w):w=e[27];let S;e[28]!==f?(S=f("sandbox.blockRegistry.backToFields"),e[28]=f,e[29]=S):S=e[29];let C;e[30]!==p||e[31]!==S||e[32]!==w?(C=s.jsx(Ll,{path:p,onNavigate:g,label:w,backTitle:S}),e[30]=p,e[31]=S,e[32]=w,e[33]=C):C=e[33];let P;e[34]!==l?(P=B=>l(B),e[34]=l,e[35]=P):P=e[35];let _;e[36]!==t||e[37]!==p||e[38]!==o||e[39]!==r||e[40]!==m||e[41]!==i||e[42]!==a||e[43]!==c||e[44]!==P?(_=s.jsx(El,{schema:c,value:t,onChange:P,basePath:"",breadcrumbPath:p,onBreadcrumbChange:g,meta:r,decofile:o,sandbox:a,previewBaseUrl:i,onSaveReferencedBlock:m}),e[36]=t,e[37]=p,e[38]=o,e[39]=r,e[40]=m,e[41]=i,e[42]=a,e[43]=c,e[44]=P,e[45]=_):_=e[45];let $;return e[46]!==C||e[47]!==_||e[48]!==y?($=s.jsxs("div",{className:"space-y-3 rounded-lg border bg-background p-3",children:[y,C,_]}),e[46]=C,e[47]=_,e[48]=y,e[49]=$):$=e[49],$}function Rs(b){const e=T.c(188),{block:t,meta:r,onChange:l,decofile:o,sandboxRef:a,previewBaseUrl:i,onSaveReferencedBlock:m}=b,f=D(),u=t.__resolveType??"",p=Vt(u);if(Kt(u,o?vt(o):[]))switch(p){case"Paragraph":{let n;e[0]!==t.html?(n=R(t.html),e[0]=t.html,e[1]=n):n=e[1];let c;e[2]!==f?(c=f("sandbox.blockRegistry.writeSomethingPlaceholder"),e[2]=f,e[3]=c):c=e[3];let d;e[4]!==t||e[5]!==l?(d=v=>l({...t,html:v}),e[4]=t,e[5]=l,e[6]=d):d=e[6];let x;return e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==c||e[11]!==d?(x=s.jsx(Ml,{html:n,placeholder:c,onChange:d,decofile:o,sandboxRef:a}),e[7]=o,e[8]=a,e[9]=n,e[10]=c,e[11]=d,e[12]=x):x=e[12],x}case"Heading":{let n;e[13]!==t.text?(n=R(t.text),e[13]=t.text,e[14]=n):n=e[14];let c;e[15]!==t.level?(c=R(t.level),e[15]=t.level,e[16]=c):c=e[16];let d;e[17]!==t||e[18]!==l?(d=v=>l({...t,...v}),e[17]=t,e[18]=l,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==c||e[22]!==d?(x=s.jsx(Yl,{text:n,level:c,onChange:d}),e[20]=n,e[21]=c,e[22]=d,e[23]=x):x=e[23],x}case"Quote":{let n;e[24]!==t.quote?(n=R(t.quote),e[24]=t.quote,e[25]=n):n=e[25];let c;e[26]!==t||e[27]!==l?(c=x=>l({...t,quote:x}),e[26]=t,e[27]=l,e[28]=c):c=e[28];let d;return e[29]!==n||e[30]!==c?(d=s.jsx(Xl,{quote:n,onChange:c}),e[29]=n,e[30]=c,e[31]=d):d=e[31],d}case"Code":{let n;e[32]!==t.code?(n=R(t.code),e[32]=t.code,e[33]=n):n=e[33];let c;e[34]!==t.language?(c=R(t.language),e[34]=t.language,e[35]=c):c=e[35];let d;e[36]!==t||e[37]!==l?(d=v=>l({...t,...v}),e[36]=t,e[37]=l,e[38]=d):d=e[38];let x;return e[39]!==n||e[40]!==c||e[41]!==d?(x=s.jsx(Zl,{code:n,language:c,onChange:d}),e[39]=n,e[40]=c,e[41]=d,e[42]=x):x=e[42],x}case"List":{let n;e[43]!==t.items?(n=R(t.items),e[43]=t.items,e[44]=n):n=e[44];let c;e[45]!==t.style?(c=R(t.style),e[45]=t.style,e[46]=c):c=e[46];let d;e[47]!==t||e[48]!==l?(d=v=>l({...t,...v}),e[47]=t,e[48]=l,e[49]=d):d=e[49];let x;return e[50]!==o||e[51]!==a||e[52]!==n||e[53]!==c||e[54]!==d?(x=s.jsx(es,{items:n,style:c,onChange:d,decofile:o,sandboxRef:a}),e[50]=o,e[51]=a,e[52]=n,e[53]=c,e[54]=d,e[55]=x):x=e[55],x}case"BlockImage":{let n;return e[56]!==t||e[57]!==l?(n=s.jsx(is,{block:t,onChange:l}),e[56]=t,e[57]=l,e[58]=n):n=e[58],n}case"Video":{let n;e[59]!==t.url?(n=R(t.url),e[59]=t.url,e[60]=n):n=e[60];let c;e[61]!==t.caption?(c=R(t.caption),e[61]=t.caption,e[62]=c):c=e[62];let d;e[63]!==t||e[64]!==l?(d=v=>l({...t,...v}),e[63]=t,e[64]=l,e[65]=d):d=e[65];let x;return e[66]!==n||e[67]!==c||e[68]!==d?(x=s.jsx(ls,{url:n,caption:c,onChange:d}),e[66]=n,e[67]=c,e[68]=d,e[69]=x):x=e[69],x}case"Divider":{let n;return e[70]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ss,{}),e[70]=n):n=e[70],n}case"Cta":{let n;e[71]!==t.text?(n=R(t.text),e[71]=t.text,e[72]=n):n=e[72];let c;e[73]!==t.href?(c=R(t.href),e[73]=t.href,e[74]=c):c=e[74];let d;e[75]!==t||e[76]!==l?(d=v=>l({...t,...v}),e[75]=t,e[76]=l,e[77]=d):d=e[77];let x;return e[78]!==n||e[79]!==c||e[80]!==d?(x=s.jsx(os,{text:n,href:c,onChange:d}),e[78]=n,e[79]=c,e[80]=d,e[81]=x):x=e[81],x}case"Callout":{let n;e[82]!==t.title?(n=R(t.title),e[82]=t.title,e[83]=n):n=e[83];let c;e[84]!==t.body?(c=R(t.body),e[84]=t.body,e[85]=c):c=e[85];let d;e[86]!==t.variant?(d=R(t.variant),e[86]=t.variant,e[87]=d):d=e[87];let x;e[88]!==t||e[89]!==l?(x=j=>l({...t,...j}),e[88]=t,e[89]=l,e[90]=x):x=e[90];let v;return e[91]!==n||e[92]!==c||e[93]!==d||e[94]!==x?(v=s.jsx(ns,{title:n,body:c,variant:d,onChange:x}),e[91]=n,e[92]=c,e[93]=d,e[94]=x,e[95]=v):v=e[95],v}case"Stat":{let n;e[96]!==t.value?(n=R(t.value),e[96]=t.value,e[97]=n):n=e[97];let c;e[98]!==t.label?(c=R(t.label),e[98]=t.label,e[99]=c):c=e[99];let d;e[100]!==t.description?(d=R(t.description),e[100]=t.description,e[101]=d):d=e[101];let x;e[102]!==t||e[103]!==l?(x=j=>l({...t,...j}),e[102]=t,e[103]=l,e[104]=x):x=e[104];let v;return e[105]!==n||e[106]!==c||e[107]!==d||e[108]!==x?(v=s.jsx(rs,{value:n,label:c,description:d,onChange:x}),e[105]=n,e[106]=c,e[107]=d,e[108]=x,e[109]=v):v=e[109],v}case"StatGroup":{let n;e[110]!==t.stats?(n=de(t.stats),e[110]=t.stats,e[111]=n):n=e[111];let c;e[112]!==t||e[113]!==l?(c=x=>l({...t,stats:x}),e[112]=t,e[113]=l,e[114]=c):c=e[114];let d;return e[115]!==n||e[116]!==c?(d=s.jsx(ds,{stats:n,onChange:c}),e[115]=n,e[116]=c,e[117]=d):d=e[117],d}case"CardGroup":{let n;e[118]!==t.cards?(n=de(t.cards),e[118]=t.cards,e[119]=n):n=e[119];let c;e[120]!==t||e[121]!==l?(c=x=>l({...t,cards:x}),e[120]=t,e[121]=l,e[122]=c):c=e[122];let d;return e[123]!==n||e[124]!==c?(d=s.jsx(as,{cards:n,onChange:c}),e[123]=n,e[124]=c,e[125]=d):d=e[125],d}case"Checklist":{let n;e[126]!==t.title?(n=R(t.title),e[126]=t.title,e[127]=n):n=e[127];let c;e[128]!==t.items?(c=de(t.items),e[128]=t.items,e[129]=c):c=e[129];let d;e[130]!==t||e[131]!==l?(d=v=>l({...t,...v}),e[130]=t,e[131]=l,e[132]=d):d=e[132];let x;return e[133]!==n||e[134]!==c||e[135]!==d?(x=s.jsx(cs,{title:n,items:c,onChange:d}),e[133]=n,e[134]=c,e[135]=d,e[136]=x):x=e[136],x}case"Steps":{let n;e[137]!==t.title?(n=R(t.title),e[137]=t.title,e[138]=n):n=e[138];let c;e[139]!==t.steps?(c=de(t.steps),e[139]=t.steps,e[140]=c):c=e[140];let d;e[141]!==t||e[142]!==l?(d=v=>l({...t,...v}),e[141]=t,e[142]=l,e[143]=d):d=e[143];let x;return e[144]!==n||e[145]!==c||e[146]!==d?(x=s.jsx(us,{title:n,steps:c,onChange:d}),e[144]=n,e[145]=c,e[146]=d,e[147]=x):x=e[147],x}case"Comparison":{let n;e[148]!==t.left?(n=de(t.left,{}),e[148]=t.left,e[149]=n):n=e[149];let c;e[150]!==t.right?(c=de(t.right,{}),e[150]=t.right,e[151]=c):c=e[151];let d;e[152]!==t||e[153]!==l?(d=v=>l({...t,...v}),e[152]=t,e[153]=l,e[154]=d):d=e[154];let x;return e[155]!==n||e[156]!==c||e[157]!==d?(x=s.jsx(fs,{left:n,right:c,onChange:d}),e[155]=n,e[156]=c,e[157]=d,e[158]=x):x=e[158],x}case"Table":{let n;e[159]!==t.headers?(n=de(t.headers),e[159]=t.headers,e[160]=n):n=e[160];let c;e[161]!==t.rows?(c=de(t.rows),e[161]=t.rows,e[162]=c):c=e[162];let d;e[163]!==t||e[164]!==l?(d=v=>l({...t,...v}),e[163]=t,e[164]=l,e[165]=d):d=e[165];let x;return e[166]!==o||e[167]!==a||e[168]!==n||e[169]!==c||e[170]!==d?(x=s.jsx(Is,{headers:n,rows:c,onChange:d,decofile:o,sandboxRef:a}),e[166]=o,e[167]=a,e[168]=n,e[169]=c,e[170]=d,e[171]=x):x=e[171],x}case"ProductCard":{let n;return e[172]!==t||e[173]!==l||e[174]!==a?(n=s.jsx(Cs,{block:t,onChange:l,sandboxRef:a}),e[172]=t,e[173]=l,e[174]=a,e[175]=n):n=e[175],n}case"ProductShelf":{let n;return e[176]!==t||e[177]!==l||e[178]!==a?(n=s.jsx(ys,{block:t,onChange:l,sandboxRef:a}),e[176]=t,e[177]=l,e[178]=a,e[179]=n):n=e[179],n}}let h;return e[180]!==t||e[181]!==o||e[182]!==r||e[183]!==l||e[184]!==m||e[185]!==i||e[186]!==a?(h=s.jsx(Es,{block:t,meta:r,onChange:l,decofile:o,sandbox:a,previewBaseUrl:i,onSaveReferencedBlock:m}),e[180]=t,e[181]=o,e[182]=r,e[183]=l,e[184]=m,e[185]=i,e[186]=a,e[187]=h):h=e[187],h}function zs(b){const e=T.c(46),{id:t,block:r,meta:l,onChange:o,onDelete:a,onDuplicate:i,decofile:m,sandboxRef:f,previewBaseUrl:u,onSaveReferencedBlock:p}=b,g=D();let h;e[0]!==t?(h={id:t},e[0]=t,e[1]=h):h=e[1];const{attributes:n,listeners:c,setNodeRef:d,transform:x,transition:v,isDragging:j}=ht(h);let N;e[2]!==x?(N=ft.Transform.toString(x),e[2]=x,e[3]=N):N=e[3];let k;e[4]!==N||e[5]!==v?(k={transform:N,transition:v},e[4]=N,e[5]=v,e[6]=k):k=e[6];const y=j&&"opacity-50";let w;e[7]!==y?(w=ne("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-accent",y),e[7]=y,e[8]=w):w=e[8];let S;e[9]!==g?(S=g("sandbox.blockRow.dragToReorder"),e[9]=g,e[10]=S):S=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Nt,{size:14}),e[11]=C):C=e[11];let P;e[12]!==n||e[13]!==c||e[14]!==S?(P=s.jsx("button",{type:"button","aria-label":S,className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100 rounded-lg",...n,...c,children:C}),e[12]=n,e[13]=c,e[14]=S,e[15]=P):P=e[15];let _;e[16]!==g?(_=g("sandbox.blockRow.duplicateBlock"),e[16]=g,e[17]=_):_=e[17];let $;e[18]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(cl,{className:"size-3.5"}),e[18]=$):$=e[18];let B;e[19]!==i||e[20]!==_?(B=s.jsx(Fe,{variant:"ghost",size:"icon-xs",type:"button","aria-label":_,onClick:i,children:$}),e[19]=i,e[20]=_,e[21]=B):B=e[21];let L;e[22]!==g?(L=g("sandbox.blockRow.deleteBlock"),e[22]=g,e[23]=L):L=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(De,{className:"size-3.5"}),e[24]=I):I=e[24];let A;e[25]!==a||e[26]!==L?(A=s.jsx(Fe,{variant:"ghost-destructive",size:"icon-xs",type:"button","aria-label":L,onClick:a,children:I}),e[25]=a,e[26]=L,e[27]=A):A=e[27];let U;e[28]!==B||e[29]!==A?(U=s.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[B,A]}),e[28]=B,e[29]=A,e[30]=U):U=e[30];let O;e[31]!==r||e[32]!==m||e[33]!==l||e[34]!==o||e[35]!==p||e[36]!==u||e[37]!==f?(O=s.jsx(Rs,{block:r,meta:l,onChange:o,decofile:m,sandboxRef:f,previewBaseUrl:u,onSaveReferencedBlock:p}),e[31]=r,e[32]=m,e[33]=l,e[34]=o,e[35]=p,e[36]=u,e[37]=f,e[38]=O):O=e[38];let M;return e[39]!==d||e[40]!==U||e[41]!==O||e[42]!==k||e[43]!==w||e[44]!==P?(M=s.jsxs("div",{ref:d,style:k,className:w,children:[P,U,O]}),e[39]=d,e[40]=U,e[41]=O,e[42]=k,e[43]=w,e[44]=P,e[45]=M):M=e[45],M}function Ie(){return crypto.randomUUID()}function As(b){return b.map(e=>({id:Ie(),block:e}))}function Fs(b,e){return e.map((t,r)=>{const l=b[r];return{id:l?l.id:Ie(),block:t}})}function ko(b){return Array.isArray(b)?b:[]}function Ds(b){const e=T.c(10),{blockTypes:t,onInsert:r}=b,l=D();let o;e[0]!==l?(o=l("sandbox.blockPicker.insertBlockButton"),e[0]=l,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"absolute inset-x-10 top-1/2 h-px -translate-y-1/2 bg-primary/30"}),e[2]=a):a=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"relative z-10 flex h-5 w-5 items-center justify-center rounded-lg border bg-background text-muted-foreground",children:s.jsx(Ue,{size:12})}),e[3]=i):i=e[3];let m;e[4]!==o?(m=s.jsxs("button",{type:"button","aria-label":o,className:"group/ins relative flex h-2.5 w-full items-center justify-center opacity-0 transition-opacity hover:opacity-100 cursor-pointer",children:[a,i]}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==t||e[7]!==r||e[8]!==m?(f=s.jsx(_t,{blockTypes:t,onInsert:r,align:"center",children:m}),e[6]=t,e[7]=r,e[8]=m,e[9]=f):f=e[9],f}function yo(b){const e=T.c(78),{value:t,onChange:r,meta:l,decofile:o,sandboxRef:a,previewBaseUrl:i,onSaveReferencedBlock:m,emptyMessage:f}=b,u=f===void 0?"No content yet. Add your first block below.":f,p=D(),g=Ht();let h;e[0]!==o||e[1]!==g||e[2]!==l?(h=Jt(l,{hideDefaults:g,customPaths:o?vt(o):[]}),e[0]=o,e[1]=g,e[2]=l,e[3]=h):h=e[3];const n=h;let c;e[4]!==t?(c=()=>As(t),e[4]=t,e[5]=c):c=e[5];const[d,x]=q.useState(c),[v,j]=q.useState(t);t!==v&&(j(t),x(Fs(d,t)));let N;e[6]!==d?(N=d.map(Hs),e[6]=d,e[7]=N):N=e[7];const k=N;let y;e[8]!==d?(y=d.map(Os),e[8]=d,e[9]=y):y=e[9];const w=y;let S;e[10]!==r?(S=F=>{x(F);const J=F.map(Us);j(J),r(J)},e[10]=r,e[11]=S):S=e[11];const C=S;let P;e[12]!==d||e[13]!==C?(P=(F,J)=>{const G=[...d];G.splice(F,0,{id:Ie(),block:{__resolveType:J}}),C(G)},e[12]=d,e[13]=C,e[14]=P):P=e[14];const _=P;let $;e[15]!==d||e[16]!==C?($=(F,J)=>{C(d.map((G,te)=>te===F?{...G,block:J}:G))},e[15]=d,e[16]=C,e[17]=$):$=e[17];const B=$;let L;e[18]!==d||e[19]!==C?(L=F=>{C(d.filter((J,G)=>G!==F))},e[18]=d,e[19]=C,e[20]=L):L=e[20];const I=L;let A;e[21]!==d||e[22]!==C?(A=F=>{const J=d[F];if(!J)return;const G=[...d];G.splice(F+1,0,{id:Ie(),block:structuredClone(J.block)}),C(G)},e[21]=d,e[22]=C,e[23]=A):A=e[23];const U=A;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:6}},e[24]=O):O=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:mt},e[25]=M):M=e[25];const E=it($e(ct,O),$e(at,M));let W;e[26]!==d||e[27]!==C?(W=F=>{const{active:J,over:G}=F;if(!G||J.id===G.id)return;const te=d.findIndex(le=>le.id===String(J.id)),ce=d.findIndex(le=>le.id===String(G.id));te===-1||ce===-1||C(xt(d,te,ce))},e[26]=d,e[27]=C,e[28]=W):W=e[28];const K=W;let Q;if(e[29]!==d||e[30]!==n||e[31]!==o||e[32]!==U||e[33]!==_||e[34]!==l||e[35]!==m||e[36]!==i||e[37]!==I||e[38]!==a||e[39]!==B){let F;e[41]!==n||e[42]!==o||e[43]!==U||e[44]!==_||e[45]!==l||e[46]!==m||e[47]!==i||e[48]!==I||e[49]!==a||e[50]!==B?(F=(J,G)=>{const{id:te,block:ce}=J;return s.jsxs("div",{children:[s.jsx(Ds,{blockTypes:n,onInsert:le=>_(G,le)}),s.jsx(zs,{id:te,block:ce,meta:l,onChange:le=>B(G,le),onDelete:()=>I(G),onDuplicate:()=>U(G),decofile:o,sandboxRef:a,previewBaseUrl:i,onSaveReferencedBlock:m})]},te)},e[41]=n,e[42]=o,e[43]=U,e[44]=_,e[45]=l,e[46]=m,e[47]=i,e[48]=I,e[49]=a,e[50]=B,e[51]=F):F=e[51],Q=d.map(F),e[29]=d,e[30]=n,e[31]=o,e[32]=U,e[33]=_,e[34]=l,e[35]=m,e[36]=i,e[37]=I,e[38]=a,e[39]=B,e[40]=Q}else Q=e[40];let re;e[52]!==k||e[53]!==Q?(re=s.jsx(pt,{items:k,strategy:Ot,children:Q}),e[52]=k,e[53]=Q,e[54]=re):re=e[54];let se;e[55]!==K||e[56]!==E||e[57]!==re?(se=s.jsx(dt,{sensors:E,collisionDetection:ut,onDragEnd:K,children:re}),e[55]=K,e[56]=E,e[57]=re,e[58]=se):se=e[58];let Y;e[59]!==w.length||e[60]!==u?(Y=w.length===0&&s.jsx("p",{className:"px-3 pb-1 pt-2 text-sm text-muted-foreground",children:u}),e[59]=w.length,e[60]=u,e[61]=Y):Y=e[61];let ie;e[62]!==d.length||e[63]!==_?(ie=F=>_(d.length,F),e[62]=d.length,e[63]=_,e[64]=ie):ie=e[64];let oe;e[65]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Ue,{size:16}),e[65]=oe):oe=e[65];let X;e[66]!==p?(X=p("sandbox.blockDocument.addBlock"),e[66]=p,e[67]=X):X=e[67];let H;e[68]!==X?(H=s.jsxs("button",{type:"button",className:"mt-1 flex w-full items-center gap-2 rounded-md py-2 pl-14 pr-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer",children:[oe,X]}),e[68]=X,e[69]=H):H=e[69];let z;e[70]!==n||e[71]!==ie||e[72]!==H?(z=s.jsx(_t,{blockTypes:n,onInsert:ie,children:H}),e[70]=n,e[71]=ie,e[72]=H,e[73]=z):z=e[73];let V;return e[74]!==se||e[75]!==Y||e[76]!==z?(V=s.jsxs("div",{className:"mt-2",children:[se,Y,z]}),e[74]=se,e[75]=Y,e[76]=z,e[77]=V):V=e[77],V}function Us(b){return b.block}function Os(b){return b.block}function Hs(b){return b.id}export{yo as B,zl as I,Al as R,ko as a,We as u};