@avocadostudio-ai/cli 0.1.0

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.
@@ -0,0 +1,231 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loaded-MIY725CK-C7ZoKWol.js","assets/index-D4SeD5gd.js","assets/index-BVru-J_w.js","assets/index-Wz7Aw5V1.css","assets/index-oh4S_G9Y.js","assets/loaded-F37CNCVG-Bav6-7kM.js","assets/loaded-H325ZSK5-DhwWhSPx.js","assets/full-N67EAB2Q-Dtb7CnaF.js","assets/Render-CU35UAWV-BC5ynnCM.js","assets/chunk-2CNEFIQP-Q9gAzMw1.js","assets/Editor-EPSED64A-1h0xO9QI.js"])))=>i.map(i=>d[i]);
2
+ import{c as wa,r as h,u as Eg,j as c,R as Cg,a as jg,b as Fu,P as Bu,d as Zr,A as Hu,e as Vu,f as Pg,g as Wu,h as Ag,i as Og,k as Mg,l as Dg,m as Tg,F as Rg,D as Lg,C as Ng,n as zg,o as uo,p as Uu,q as To,s as qu,t as Sa,_ as hn,v as ms,w as cr,x as $g,y as Fg,S as Bg,z as Hg,U as Vg,B as Wg,E as Ug,G as qg,H as Zg,I as Yg,J as Gg,V as Kg,K as Ul,L as Xg,M as Jg,N as Qg,O as ql,Q as ev,T as tv,W as nv,X as rv,Y as sv,Z as ov,$ as Ut,a0 as iv,a1 as av}from"./index-BVru-J_w.js";/**
3
+ * @license lucide-react v0.575.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const lv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cv=wa("arrow-left",lv);/**
8
+ * @license lucide-react v0.575.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */const uv=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],dv=wa("bot-message-square",uv);/**
13
+ * @license lucide-react v0.575.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const fv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],pv=wa("history",fv);var Ro="Popover",[Zu]=Mg(Ro,[Wu]),ys=Wu(),[hv,gn]=Zu(Ro),Yu=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,a=ys(t),l=h.useRef(null),[u,d]=h.useState(!1),[f,p]=Eg({prop:r,defaultProp:s??!1,onChange:o,caller:Ro});return c.jsx(Cg,{...a,children:c.jsx(hv,{scope:t,contentId:jg(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>d(!0),[]),onCustomAnchorRemove:h.useCallback(()=>d(!1),[]),modal:i,children:n})})};Yu.displayName=Ro;var Gu="PopoverAnchor",gv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=gn(Gu,n),o=ys(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=s;return h.useEffect(()=>(i(),()=>a()),[i,a]),c.jsx(Hu,{...o,...r,ref:t})});gv.displayName=Gu;var Ku="PopoverTrigger",Xu=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=gn(Ku,n),o=ys(n),i=Fu(t,s.triggerRef),a=c.jsx(Bu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":nd(s.open),...r,ref:i,onClick:Zr(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:c.jsx(Hu,{asChild:!0,...o,children:a})});Xu.displayName=Ku;var ka="PopoverPortal",[vv,mv]=Zu(ka,{forceMount:void 0}),Ju=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=gn(ka,t);return c.jsx(vv,{scope:t,forceMount:n,children:c.jsx(Vu,{present:n||o.open,children:c.jsx(Pg,{asChild:!0,container:s,children:r})})})};Ju.displayName=ka;var nr="PopoverContent",Qu=h.forwardRef((e,t)=>{const n=mv(nr,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=gn(nr,e.__scopePopover);return c.jsx(Vu,{present:r||o.open,children:o.modal?c.jsx(bv,{...s,ref:t}):c.jsx(_v,{...s,ref:t})})});Qu.displayName=nr;var yv=Dg("PopoverContent.RemoveScroll"),bv=h.forwardRef((e,t)=>{const n=gn(nr,e.__scopePopover),r=h.useRef(null),s=Fu(t,r),o=h.useRef(!1);return h.useEffect(()=>{const i=r.current;if(i)return Ag(i)},[]),c.jsx(Og,{as:yv,allowPinchZoom:!0,children:c.jsx(ed,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zr(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Zr(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Zr(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),_v=h.forwardRef((e,t)=>{const n=gn(nr,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return c.jsx(ed,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),ed=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=gn(nr,n),v=ys(n);return Tg(),c.jsx(Rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:c.jsx(Lg,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:c.jsx(Ng,{"data-state":nd(p.open),role:"dialog",id:p.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),td="PopoverClose",xv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=gn(td,n);return c.jsx(Bu.button,{type:"button",...r,ref:t,onClick:Zr(e.onClick,()=>s.onOpenChange(!1))})});xv.displayName=td;var wv="PopoverArrow",Sv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ys(n);return c.jsx(zg,{...s,...r,ref:t})});Sv.displayName=wv;function nd(e){return e?"open":"closed"}const Zl=e=>Symbol.iterator in e,Yl=e=>"entries"in e,Gl=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[s,o]of n)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},kv=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=n.next(),o=r.next()}return!!s.done&&!!o.done};function Iv(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Zl(e)&&Zl(t)?Yl(e)&&Yl(t)?Gl(e,t):kv(e,t):Gl({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ge(e){const t=uo.useRef(void 0);return n=>{const r=e(n);return Iv(t.current,r)?t.current:t.current=r}}var Ev=Object.create,Ia=Object.defineProperty,Cv=Object.defineProperties,jv=Object.getOwnPropertyDescriptor,Pv=Object.getOwnPropertyDescriptors,Ea=Object.getOwnPropertyNames,fo=Object.getOwnPropertySymbols,Av=Object.getPrototypeOf,Ca=Object.prototype.hasOwnProperty,rd=Object.prototype.propertyIsEnumerable,Kl=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t)=>{for(var n in t||(t={}))Ca.call(t,n)&&Kl(e,n,t[n]);if(fo)for(var n of fo(t))rd.call(t,n)&&Kl(e,n,t[n]);return e},z=(e,t)=>Cv(e,Pv(t)),Kt=(e,t)=>{var n={};for(var r in e)Ca.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fo)for(var r of fo(e))t.indexOf(r)<0&&rd.call(e,r)&&(n[r]=e[r]);return n},Ov=(e,t)=>function(){return e&&(t=(0,e[Ea(e)[0]])(e=0)),t},Mv=(e,t)=>function(){return t||(0,e[Ea(e)[0]])((t={exports:{}}).exports,t),t.exports},Dv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ea(t))!Ca.call(e,s)&&s!==n&&Ia(e,s,{get:()=>t[s],enumerable:!(r=jv(t,s))||r.enumerable});return e},Tv=(e,t,n)=>(n=e!=null?Ev(Av(e)):{},Dv(!e||!e.__esModule?Ia(n,"default",{value:e,enumerable:!0}):n,e)),Ee=(e,t,n)=>new Promise((r,s)=>{var o=l=>{try{a(n.next(l))}catch(u){s(u)}},i=l=>{try{a(n.throw(l))}catch(u){s(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,i);a((n=n.apply(e,t)).next())}),P=Ov({"../tsup-config/react-import.js"(){}});P();var sd={RichTextEditor:"_RichTextEditor_z25h4_1","RichTextEditor--editor":"_RichTextEditor--editor_z25h4_50","RichTextEditor--disabled":"_RichTextEditor--disabled_z25h4_107","RichTextEditor--isActive":"_RichTextEditor--isActive_z25h4_111","RichTextEditor-menu":"_RichTextEditor-menu_z25h4_117"},Qo,Xl;function Rv(){if(Xl)return Qo;Xl=1,Qo=n,n.flatten=n,n.unflatten=r;function e(s){return s&&s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function t(s){return s}function n(s,o){o=o||{};const i=o.delimiter||".",a=o.maxDepth,l=o.transformKey||t,u={};function d(f,p,v){v=v||1,Object.keys(f).forEach(function(g){const m=f[g],w=o.safe&&Array.isArray(m),S=Object.prototype.toString.call(m),k=e(m),y=S==="[object Object]"||S==="[object Array]",b=p?p+i+l(g):l(g);if(!w&&!k&&y&&Object.keys(m).length&&(!o.maxDepth||v<a))return d(m,b,v+1);u[b]=m})}return d(s),u}function r(s,o){o=o||{};const i=o.delimiter||".",a=o.overwrite||!1,l=o.transformKey||t,u={};if(e(s)||Object.prototype.toString.call(s)!=="[object Object]")return s;function f(g){const m=Number(g);return isNaN(m)||g.indexOf(".")!==-1||o.object?g:m}function p(g,m,w){return Object.keys(w).reduce(function(S,k){return S[g+i+k]=w[k],S},m)}function v(g){const m=Object.prototype.toString.call(g),w=m==="[object Array]",S=m==="[object Object]";if(g){if(w)return!g.length;if(S)return!Object.keys(g).length}else return!0}return s=Object.keys(s).reduce(function(g,m){const w=Object.prototype.toString.call(s[m]);return!(w==="[object Object]"||w==="[object Array]")||v(s[m])?(g[m]=s[m],g):p(m,g,n(s[m],o))},{}),Object.keys(s).forEach(function(g){const m=g.split(i).map(l);let w=f(m.shift()),S=f(m[0]),k=u;for(;S!==void 0;){if(w==="__proto__")return;const y=Object.prototype.toString.call(k[w]),b=y==="[object Object]"||y==="[object Array]";if(!a&&!b&&typeof k[w]<"u")return;(a&&!b||!a&&k[w]==null)&&(k[w]=typeof S=="number"&&!o.object?[]:{}),k=k[w],m.length>0&&(w=f(m.shift()),S=f(m[0]))}k[w]=r(s[g],o)}),u}return Qo}var Lv=Rv();const Nv=Uu(Lv);let Ms;const zv=new Uint8Array(16);function $v(){if(!Ms&&(Ms=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ms))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ms(zv)}const We=[];for(let e=0;e<256;++e)We.push((e+256).toString(16).slice(1));function Fv(e,t=0){return We[e[t+0]]+We[e[t+1]]+We[e[t+2]]+We[e[t+3]]+"-"+We[e[t+4]]+We[e[t+5]]+"-"+We[e[t+6]]+We[e[t+7]]+"-"+We[e[t+8]]+We[e[t+9]]+"-"+We[e[t+10]]+We[e[t+11]]+We[e[t+12]]+We[e[t+13]]+We[e[t+14]]+We[e[t+15]]}const Bv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jl={randomUUID:Bv};function Ql(e,t,n){if(Jl.randomUUID&&!e)return Jl.randomUUID();e=e||{};const r=e.random||(e.rng||$v)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fv(r)}P();P();P();var ja=(e,t)=>Object.keys(t).reduce((n,r)=>t[r].type==="slot"?A({[r]:[]},n):n,e),Pa=e=>!!e&&typeof e.then=="function",ec=e=>e.reduce((t,n)=>A(A({},t),n),{}),ji=e=>e.some(Pa),po=({value:e,fields:t,mappers:n,propKey:r="",propPath:s="",id:o="",config:i,recurseSlots:a=!1})=>{var l,u,d;const f=(l=t[r])==null?void 0:l.type,p=n[f];if(p&&f==="slot"){const v=e||[],g=a?v.map(m=>{var w;const S=i.components[m.type];if(!S)throw new Error(`Could not find component config for ${m.type}`);const k=(w=S.fields)!=null?w:{};return po({value:z(A({},m),{props:ja(m.props,k)}),fields:k,mappers:n,id:m.props.id,config:i,recurseSlots:a})}):v;return ji(g)?Promise.all(g):p({value:g,parentId:o,propName:s,field:t[r],propPath:s})}else if(p&&t[r])return p({value:e,parentId:o,propName:r,field:t[r],propPath:s});if(e&&typeof e=="object")if(Array.isArray(e)){const v=((u=t[r])==null?void 0:u.type)==="array"?t[r].arrayFields:null;if(!v)return e;const g=e.map((m,w)=>po({value:m,fields:v,mappers:n,propKey:r,propPath:`${s}[${w}]`,id:o,config:i,recurseSlots:a}));return ji(g)?Promise.all(g):g}else{if("$$typeof"in e)return e;{const v=((d=t[r])==null?void 0:d.type)==="object"?t[r].objectFields:t;return od({value:e,fields:v,mappers:n,id:o,getPropPath:g=>`${s}.${g}`,config:i,recurseSlots:a})}}return e},od=({value:e,fields:t,mappers:n,id:r,getPropPath:s,config:o,recurseSlots:i})=>{const a=Object.entries(e).map(([l,u])=>{const d={value:u,fields:t,mappers:n,propKey:l,propPath:s(l),id:r,config:o,recurseSlots:i},f=po(d);return Pa(f)?f.then(p=>({[l]:p})):{[l]:f}},{});return ji(a)?Promise.all(a).then(ec):ec(a)};function ur(e,t,n,r=!1,s=!0){var o,i,a,l,u;const d="type"in e?e.type:"root",f=d==="root"?n.root:(o=n.components)==null?void 0:o[d],p=od({value:s?ja((i=e.props)!=null?i:{},(a=f==null?void 0:f.fields)!=null?a:{}):e.props,fields:(l=f==null?void 0:f.fields)!=null?l:{},mappers:t,id:e.props&&(u=e.props.id)!=null?u:"root",getPropPath:v=>v,config:n,recurseSlots:r});return Pa(p)?p.then(v=>z(A({},e),{props:v})):z(A({},e),{props:p})}function id(e,t,n){var r,s;const o=u=>ur(u,{slot:({value:d,parentId:f,propName:p})=>{var v;const g=d;return(v=n(g,{parentId:f,propName:p}))!=null?v:g}},t,!0);if("props"in e)return o(e);const i=e,a=(r=i.zones)!=null?r:{},l=i.content.map(o);return{root:o(i.root),content:(s=n(l,{parentId:"root",propName:"default-zone"}))!=null?s:l,zones:Object.keys(a).reduce((u,d)=>z(A({},u),{[d]:a[d].map(o)}),{})}}P();var es="root",Pi="default-zone",Ye=`${es}:${Pi}`;P();P();var Hv=(e,t)=>ur(e,{slot:()=>null},t),{flatten:Vv,unflatten:Wv}=Nv,Uv=e=>e!=null&&Object.prototype.toString.call(e)==="[object Object]",ad="__puck_[]",ld="__puck_{}";function qv(e={}){const t={};for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=e[n];Array.isArray(r)&&r.length===0?t[n]=ad:Uv(r)&&Object.keys(r).length===0?t[n]=ld:t[n]=r}return t}function Zv(e={}){const t={};for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=e[n];r===ad?t[n]=[]:r===ld?t[n]={}:t[n]=r}return t}var Yv=(e,t)=>z(A({},e),{props:qv(Vv(Hv(e,t).props))}),Gv=e=>{const t=Wv(Zv(e.props));return z(A({},e),{props:t})};P();var bs=e=>"type"in e?e:z(A({},e),{props:z(A({},e.props),{id:"root"}),type:"root"});P();P();P();var Kv=e=>e?e&&e.indexOf(":")>-1?e.split(":"):[Ye,e]:[];function Xv(e,t,n,r=[]){Object.entries(t.zones||{}).forEach(([s,o])=>{const[i]=Kv(s);i===e.props.id&&n(r,s,o)})}function ht(e,t,n=s=>s,r=s=>s){var s;let o={};const i={},a={},l=(y,b,C,j,O)=>{var _;const[I]=b.split(":"),x=((_=n(C,b,j))!=null?_:C)||[],[M,D]=b.split(":"),L=`${O||I}:${D}`,N=x.map((B,H)=>d(B,[...y,L],H));return i[L]={contentIds:N.map(B=>B.props.id),type:j},[L,N]},u=(y,b,C)=>{Xv(y,e.data,(j,O,_)=>{const[I,x]=l(j,O,_,"dropzone",b);o[I]=x},C)},d=(y,b,C)=>{const j=r(y,b,C);if(!j)return y;const O=j.props.id,_=z(A({},ur(j,{slot:({value:N,parentId:B,propPath:H})=>{const G=N,$=`${B}:${H}`,[Z,F]=l(b,$,G,"slot",B);return F}},t).props),{id:O});u(y,O,b);const I=z(A({},j),{props:_}),x=b[b.length-1],[M,D]=x?x.split(":"):[null,""];a[O]={data:I,flatData:Yv(I,t),path:b,parentId:M,zone:D};const L=z(A({},I),{props:A({},I.props)});return _.id==="root"&&(delete L.type,delete L.props.id),L},f=e.data.zones||{},[p,v]=l([],Ye,e.data.content,"root"),g=v,m=Object.keys(o);Object.keys(f||{}).forEach(y=>{const[b]=y.split(":");if(m.includes(y))return;const[C,j]=l([Ye],y,f[y],"dropzone",b);o[y]=j},o);let w=bs({props:A({},(s=e.data.root.props)!=null?s:e.data.root)});e.data.root.readOnly&&(w.readOnly=e.data.root.readOnly);const S=d(w,[],-1),k=A(A({},e.data.root),S);return z(A({},e),{data:{root:k,content:g,zones:A(A({},e.data.zones),o)},indexes:{nodes:A(A({},e.indexes.nodes),a),zones:A(A({},e.indexes.zones),i)}})}P();var it=e=>e?`${e}-${Ql()}`:Ql();P();var cd=(e,t)=>{if(t===Ye)return e;const n=z(A({},e),{zones:e.zones?A({},e.zones):{}});return n.zones[t]=n.zones[t]||[],n};P();P();var Jv=(e,t,n)=>{if(typeof t.state=="object"){const r=A(A({},e),t.state);return t.state.indexes?r:(console.warn("`set` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."),ht(r,n.config))}return A(A({},e),t.state(e))};P();P();var rr=(e,t,n)=>{const r=Array.from(e||[]);return r.splice(t,0,n),r};P();var ts=(e,t)=>{const[n]=e.split(":"),r=t.indexes.nodes[n];return((r==null?void 0:r.path)||[]).map(s=>s.split(":")[0])};P();var Aa=(e,t,n=!1)=>{const r=it(e.type);return id(z(A({},e),{props:n?z(A({},e.props),{id:r}):A({},e.props)}),t,s=>s.map(o=>{const i=it(o.type);return z(A({},o),{props:n?z(A({},o.props),{id:i}):A({id:i},o.props)})}))};function ud(e,t,n){const r=t.id||it(t.componentType),s=Aa({type:t.componentType,props:z(A({},n.config.components[t.componentType].defaultProps||{}),{id:r})},n.config),[o]=t.destinationZone.split(":"),i=ts(t.destinationZone,e);return ht(e,n.config,(a,l)=>l===t.destinationZone?rr(a||[],t.destinationIndex,s):a,(a,l)=>a.props.id===r||a.props.id===o||i.includes(a.props.id)||l.includes(t.destinationZone)?a:null)}P();var Qv=(e,t,n)=>{const[r]=t.destinationZone.split(":"),s=ts(t.destinationZone,e),o=e.indexes.zones[t.destinationZone].contentIds[t.destinationIndex];if(o!==t.data.props.id)throw new Error(`Can't change the id during a replace action. Please us "remove" and "insert" to define a new node.`);const a=[],l=id(t.data,n.config,(d,f)=>(a.push(`${f.parentId}:${f.propName}`),d.map(p=>{const v=it(p.type);return z(A({},p),{props:A({id:v},p.props)})}))),u=z(A({},e),{ui:A(A({},e.ui),t.ui)});return Object.keys(e.indexes.zones).forEach(d=>{d.split(":")[0]===o&&(a.includes(d)||delete u.indexes.zones[d])}),ht(u,n.config,(d,f)=>{const p=[...d];return f===t.destinationZone&&(p[t.destinationIndex]=l),p},(d,f)=>{const p=f.map(v=>v.split(":")[0]);return d.props.id===l.props.id?l:d.props.id===r||s.indexOf(d.props.id)>-1||p.indexOf(l.props.id)>-1?d:null})};P();var em=(e,t,n)=>ht(e,n.config,r=>r,r=>r.props.id==="root"?z(A({},r),{props:A(A({},r.props),t.root.props),readOnly:t.root.readOnly}):r);P();P();function xt(e,t){var n,r;const s=(n=t.indexes.zones)==null?void 0:n[e.zone||Ye];return s?(r=t.indexes.nodes[s.contentIds[e.index]])==null?void 0:r.data:void 0}function tm(e,t,n){const r=xt({index:t.sourceIndex,zone:t.sourceZone},e),s=ts(t.sourceZone,e),o=z(A({},r),{props:z(A({},r.props),{id:it(r.type)})}),i=ht(e,n.config,(a,l)=>l===t.sourceZone?rr(a,t.sourceIndex+1,r):a,(a,l,u)=>{const d=l[l.length-1];if(l.map(v=>v.split(":")[0]).indexOf(o.props.id)>-1)return z(A({},a),{props:z(A({},a.props),{id:it(a.type)})});if(d===t.sourceZone&&u===t.sourceIndex+1)return o;const[p]=t.sourceZone.split(":");return p===a.props.id||s.indexOf(a.props.id)>-1?a:null});return z(A({},i),{ui:z(A({},i.ui),{itemSelector:{index:t.sourceIndex+1,zone:t.sourceZone}})})}P();P();P();var Ai=(e,t)=>{const n=Array.from(e);return n.splice(t,1),n},dd=(e,t,n)=>{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=xt({zone:t.sourceZone,index:t.sourceIndex},e);if(!r)return e;const s=ts(t.sourceZone,e),o=ts(t.destinationZone,e);return ht(e,n.config,(i,a)=>a===t.sourceZone&&a===t.destinationZone?rr(Ai(i,t.sourceIndex),t.destinationIndex,r):a===t.sourceZone?Ai(i,t.sourceIndex):a===t.destinationZone?rr(i,t.destinationIndex,r):i,(i,a)=>{const[l]=t.sourceZone.split(":"),[u]=t.destinationZone.split(":"),d=i.props.id;return l===d||u===d||r.props.id===d||s.indexOf(d)>-1||o.indexOf(d)>-1||a.includes(t.destinationZone)?i:null})},nm=(e,t,n)=>dd(e,{sourceIndex:t.sourceIndex,sourceZone:t.destinationZone,destinationIndex:t.destinationIndex,destinationZone:t.destinationZone},n);P();var rm=(e,t,n)=>{const r=xt({index:t.index,zone:t.zone},e),s=Object.entries(e.indexes.nodes).reduce((i,[a,l])=>l.path.map(d=>d.split(":")[0]).includes(r.props.id)?[...i,a]:i,[r.props.id]),o=ht(e,n.config,(i,a)=>a===t.zone?Ai(i,t.index):i);return Object.keys(o.data.zones||{}).forEach(i=>{const a=i.split(":")[0];s.includes(a)&&o.data.zones&&delete o.data.zones[i]}),Object.keys(o.indexes.zones).forEach(i=>{const a=i.split(":")[0];s.includes(a)&&delete o.indexes.zones[i]}),s.forEach(i=>{delete o.indexes.nodes[i]}),o};P();var Xs={};function sm(e,t){return Xs[t.zone]?z(A({},e),{data:z(A({},e.data),{zones:z(A({},e.data.zones),{[t.zone]:Xs[t.zone]})}),indexes:z(A({},e.indexes),{zones:z(A({},e.indexes.zones),{[t.zone]:z(A({},e.indexes.zones[t.zone]),{contentIds:Xs[t.zone].map(n=>n.props.id),type:"dropzone"})})})}):z(A({},e),{data:cd(e.data,t.zone)})}function om(e,t){const n=A({},e.data.zones||{}),r=A({},e.indexes.zones||{});return n[t.zone]&&(Xs[t.zone]=n[t.zone],delete n[t.zone]),delete r[t.zone],z(A({},e),{data:z(A({},e.data),{zones:n}),indexes:z(A({},e.indexes),{zones:r})})}P();var im=(e,t,n)=>typeof t.data=="object"?(console.warn("`setData` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."),ht(z(A({},e),{data:A(A({},e.data),t.data)}),n.config)):ht(z(A({},e),{data:A(A({},e.data),t.data(e.data))}),n.config);P();var am=(e,t)=>typeof t.ui=="object"?z(A({},e),{ui:A(A({},e.ui),t.ui)}):z(A({},e),{ui:A(A({},e.ui),t.ui(e.ui))});P();var ns=e=>{const{data:t,ui:n}=e;return{data:t,ui:n}};P();function lm(e,t,n){return(r,s)=>{const o=e(r,s),i=!["registerZone","unregisterZone","setData","setUi","set"].includes(s.type);return(typeof s.recordHistory<"u"?s.recordHistory:i)&&t&&t(o),n==null||n(s,ns(o),ns(r)),o}}function tc({record:e,onAction:t,appStore:n}){return lm((r,s)=>s.type==="set"?Jv(r,s,n):s.type==="insert"?ud(r,s,n):s.type==="replace"?Qv(r,s,n):s.type==="replaceRoot"?em(r,s,n):s.type==="duplicate"?tm(r,s,n):s.type==="reorder"?nm(r,s,n):s.type==="move"?dd(r,s,n):s.type==="remove"?rm(r,s,n):s.type==="registerZone"?sm(r,s):s.type==="unregisterZone"?om(r,s):s.type==="setData"?im(r,s,n):s.type==="setUi"?am(r,s):r,e,t)}var cm=Object.getOwnPropertyNames,um=Object.getOwnPropertySymbols,dm=Object.prototype.hasOwnProperty;function nc(e,t){return function(r,s,o){return e(r,s,o)&&t(r,s,o)}}function Ds(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var o=s.cache,i=o.get(n),a=o.get(r);if(i&&a)return i===r&&a===n;o.set(n,r),o.set(r,n);var l=e(n,r,s);return o.delete(n),o.delete(r),l}}function rc(e){return cm(e).concat(um(e))}var fm=Object.hasOwn||(function(e,t){return dm.call(e,t)});function An(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var pm="__v",hm="__o",gm="_owner",sc=Object.getOwnPropertyDescriptor,oc=Object.keys;function vm(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function mm(e,t){return An(e.getTime(),t.getTime())}function ym(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bm(e,t){return e===t}function ic(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),o=e.entries(),i,a,l=0;(i=o.next())&&!i.done;){for(var u=t.entries(),d=!1,f=0;(a=u.next())&&!a.done;){if(s[f]){f++;continue}var p=i.value,v=a.value;if(n.equals(p[0],v[0],l,f,e,t,n)&&n.equals(p[1],v[1],p[0],v[0],e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1;l++}return!0}var _m=An;function xm(e,t,n){var r=oc(e),s=r.length;if(oc(t).length!==s)return!1;for(;s-- >0;)if(!fd(e,t,n,r[s]))return!1;return!0}function Ir(e,t,n){var r=rc(e),s=r.length;if(rc(t).length!==s)return!1;for(var o,i,a;s-- >0;)if(o=r[s],!fd(e,t,n,o)||(i=sc(e,o),a=sc(t,o),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function wm(e,t){return An(e.valueOf(),t.valueOf())}function Sm(e,t){return e.source===t.source&&e.flags===t.flags}function ac(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),o=e.values(),i,a;(i=o.next())&&!i.done;){for(var l=t.values(),u=!1,d=0;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(i.value,a.value,i.value,a.value,e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function km(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Im(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function fd(e,t,n,r){return(r===gm||r===hm||r===pm)&&(e.$$typeof||t.$$typeof)?!0:fm(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Em="[object Arguments]",Cm="[object Boolean]",jm="[object Date]",Pm="[object Error]",Am="[object Map]",Om="[object Number]",Mm="[object Object]",Dm="[object RegExp]",Tm="[object Set]",Rm="[object String]",Lm="[object URL]",Nm=Array.isArray,lc=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,cc=Object.assign,zm=Object.prototype.toString.call.bind(Object.prototype.toString);function $m(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,o=e.areMapsEqual,i=e.areNumbersEqual,a=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,p=e.areUrlsEqual;return function(g,m,w){if(g===m)return!0;if(g==null||m==null)return!1;var S=typeof g;if(S!==typeof m)return!1;if(S!=="object")return S==="number"?i(g,m,w):S==="function"?s(g,m,w):!1;var k=g.constructor;if(k!==m.constructor)return!1;if(k===Object)return a(g,m,w);if(Nm(g))return t(g,m,w);if(lc!=null&&lc(g))return f(g,m,w);if(k===Date)return n(g,m,w);if(k===RegExp)return u(g,m,w);if(k===Map)return o(g,m,w);if(k===Set)return d(g,m,w);var y=zm(g);return y===jm?n(g,m,w):y===Dm?u(g,m,w):y===Am?o(g,m,w):y===Tm?d(g,m,w):y===Mm?typeof g.then!="function"&&typeof m.then!="function"&&a(g,m,w):y===Lm?p(g,m,w):y===Pm?r(g,m,w):y===Em?a(g,m,w):y===Cm||y===Om||y===Rm?l(g,m,w):!1}}function Fm(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?Ir:vm,areDatesEqual:mm,areErrorsEqual:ym,areFunctionsEqual:bm,areMapsEqual:r?nc(ic,Ir):ic,areNumbersEqual:_m,areObjectsEqual:r?Ir:xm,arePrimitiveWrappersEqual:wm,areRegExpsEqual:Sm,areSetsEqual:r?nc(ac,Ir):ac,areTypedArraysEqual:r?Ir:km,areUrlsEqual:Im};if(n&&(s=cc({},s,n(s))),t){var o=Ds(s.areArraysEqual),i=Ds(s.areMapsEqual),a=Ds(s.areObjectsEqual),l=Ds(s.areSetsEqual);s=cc({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:a,areSetsEqual:l})}return s}function Bm(e){return function(t,n,r,s,o,i,a){return e(t,n,a)}}function Hm(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,o=e.strict;if(r)return function(l,u){var d=r(),f=d.cache,p=f===void 0?t?new WeakMap:void 0:f,v=d.meta;return n(l,u,{cache:p,equals:s,meta:v,strict:o})};if(t)return function(l,u){return n(l,u,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(l,u){return n(l,u,i)}}var rs=vn();vn({strict:!0});vn({circular:!0});vn({circular:!0,strict:!0});vn({createInternalComparator:function(){return An}});vn({strict:!0,createInternalComparator:function(){return An}});vn({circular:!0,createInternalComparator:function(){return An}});vn({circular:!0,createInternalComparator:function(){return An},strict:!0});function vn(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,o=e.strict,i=o===void 0?!1:o,a=Fm(e),l=$m(a),u=r?r(l):Bm(l);return Hm({circular:n,comparator:l,createState:s,equals:u,strict:i})}P();var ss=[{width:360,height:"auto",icon:"Smartphone",label:"Small"},{width:768,height:"auto",icon:"Tablet",label:"Medium"},{width:1280,height:"auto",icon:"Monitor",label:"Large"},{width:"100%",height:"auto",icon:"FullWidth",label:"Full-width"}];P();P();var Oa=(e,t)=>e?Object.keys(e.props||{}).reduce((n,r)=>{const s=(e==null?void 0:e.props)||{},o=(t==null?void 0:t.props)||{};return z(A({},n),{[r]:!rs(o[r],s[r])})},{}):{},uc={lastChange:{}},pd=(e,t,...n)=>Ee(null,[e,t,...n],function*(r,s,o={},i,a,l="replace",u=null){const d="type"in r&&r.type!=="root"?s.components[r.type]:s.root,f=A({},r),p=(d==null?void 0:d.resolveData)&&r.props,v="id"in r.props?r.props.id:"root";if(p){const{item:w=null,resolved:S={},parentId:k=null}=uc.lastChange[v]||{},b=!(k===null)&&(u==null?void 0:u.props.id)!==k,C=r&&!rs(r,w);if(l==="move"&&!b||l!=="move"&&l!=="force"&&!C)return{node:S,didChange:!1};const O=Oa(r,w);i&&i(r);const{props:_,readOnly:I={}}=yield d.resolveData(r,{changed:O,lastData:w,metadata:A(A({},o),d.metadata),trigger:l,parent:u});f.props=A(A({},r.props),_),Object.keys(I).length&&(f.readOnly=I)}const g=bs(f);let m=yield ur(f,{slot:w=>Ee(null,[w],function*({value:S}){const k=S;return yield Promise.all(k.map(y=>Ee(null,null,function*(){return(yield pd(y,s,o,i,a,l,g)).node})))})},s);return p&&a&&a(f),uc.lastChange[v]={item:r,resolved:m,parentId:u==null?void 0:u.props.id},{node:m,didChange:!rs(r,m)}});P();var Oi={data:{content:[],root:{},zones:{}},ui:{leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},itemSelector:null,componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:ss[0].width,height:ss[0].height||"auto"},options:[],controlsVisible:!0},field:{focus:null},plugin:{current:null}},indexes:{nodes:{},zones:{}}},Vm=Mv({"../../node_modules/classnames/index.js"(e,t){P(),(function(){var n={}.hasOwnProperty;function r(){for(var i="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(i=o(i,s(l)))}return i}function s(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return r.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var l in i)n.call(i,l)&&i[l]&&(a=o(a,l));return a}function o(i,a){return a?i?i+" "+a:i+a:i}typeof t<"u"&&t.exports?(r.default=r,t.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()}});P();var Wm=Tv(Vm()),Um=(e,t,n={baseClass:""})=>(r={})=>{if(typeof r=="string"){const s=r;return t[`${e}-${s}`]&&n.baseClass+t[`${e}-${s}`]||""}else if(typeof r=="object"){const s=r,o={};for(let a in s)o[t[`${e}--${a}`]]=s[a];const i=t[e];return n.baseClass+(0,Wm.default)(A({[i]:!!i},o))}else return n.baseClass+t[e]||""},ne=Um;/*! Bundled license information:
18
+
19
+ classnames/index.js:
20
+ (*!
21
+ Copyright (c) 2018 Jed Watson.
22
+ Licensed under the MIT License (MIT), see
23
+ http://jedwatson.github.io/classnames
24
+ *)
25
+ */P();P();P();var qm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hd=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();P();P();var Zm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},Ym=h.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:a="",children:l,iconNode:u}=n,d=Kt(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return h.createElement("svg",A(z(A({ref:t},Zm),{width:s,height:s,stroke:r,strokeWidth:i?Number(o)*24/Number(s):o,className:hd("lucide",a)}),d),[...u.map(([f,p])=>h.createElement(f,p)),...Array.isArray(l)?l:[l]])}),ee=(e,t)=>{const n=h.forwardRef((r,s)=>{var o=r,{className:i}=o,a=Kt(o,["className"]);return h.createElement(Ym,A({ref:s,iconNode:t,className:hd(`lucide-${qm(e)}`,i)},a))});return n.displayName=`${e}`,n},Ma=ee("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var Gm=ee("Heading",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]);P();var Lo=ee("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);P();P();var gd=ee("AlignCenter",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var vd=ee("AlignJustify",[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]]);P();var md=ee("AlignRight",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var Km=ee("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);P();var sr=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);P();var Xm=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);P();var yd=ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);P();var Jm=ee("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);P();var Qm=ee("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);P();var bd=ee("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);P();var ey=ee("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);P();var ty=ee("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);P();var ny=ee("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);P();var dc=ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);P();var ry=ee("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);P();var sy=ee("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);P();var oy=ee("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);P();var iy=ee("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);P();var ay=ee("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);P();var ly=ee("Heading4",[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]]);P();var cy=ee("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);P();var uy=ee("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);P();var dy=ee("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);P();var _d=ee("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);P();var fy=ee("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);P();var xd=ee("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);P();var wd=ee("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);P();var py=ee("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);P();var hy=ee("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);P();var gy=ee("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);P();var vy=ee("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);P();var my=ee("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);P();var Sd=ee("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);P();var yy=ee("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);P();var by=ee("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);P();var _y=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);P();var xy=ee("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);P();var wy=ee("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);P();var Sy=ee("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);P();var ky=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);P();var Iy=ee("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);P();var Ey=ee("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);P();var Cy=ee("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);P();var jy=ee("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);P();var Py=ee("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);P();var Ay=ee("ToyBrick",[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]]);P();var kd=ee("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);P();var No=ee("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);P();var Oy=ee("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);P();var My=ee("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);P();var Dy=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);P();var Ty=ee("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);P();var Ry=ee("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);P();P();P();var fc={ControlLeft:"ctrl",ControlRight:"ctrl",MetaLeft:"meta",MetaRight:"meta",ShiftLeft:"shift",ShiftRight:"shift",KeyA:"a",KeyB:"b",KeyC:"c",KeyD:"d",KeyE:"e",KeyF:"f",KeyG:"g",KeyH:"h",KeyI:"i",KeyJ:"j",KeyK:"k",KeyL:"l",KeyM:"m",KeyN:"n",KeyO:"o",KeyP:"p",KeyQ:"q",KeyR:"r",KeyS:"s",KeyT:"t",KeyU:"u",KeyV:"v",KeyW:"w",KeyX:"x",KeyY:"y",KeyZ:"z",Delete:"delete",Backspace:"backspace",AltRight:"altRight"},Lt=qu()(Sa(e=>({held:{},hold:t=>e(n=>n.held[t]?n:{held:z(A({},n.held),{[t]:!0})}),release:t=>e(n=>n.held[t]?{held:z(A({},n.held),{[t]:!1})}:n),reset:(t={})=>e(()=>({held:t})),triggers:{}}))),Id=e=>{const t=o=>{if(o.getModifierState("AltGraph")){Lt.getState().hold("altRight");return}const i=fc[o.code];if(i){Lt.getState().hold(i);const{held:a,triggers:l}=Lt.getState();Object.values(l).forEach(({combo:u,cb:d})=>{Object.entries(u).every(([p,v])=>v===!!a[p])&&Object.entries(a).every(([p,v])=>v===!!u[p])&&d(o)!==!1&&o.preventDefault()}),i!=="meta"&&i!=="ctrl"&&i!=="shift"&&Lt.getState().release(i)}},n=o=>{if(!o.getModifierState("AltGraph")&&o.code==="ControlRight"){Lt.getState().release("altRight");return}const i=fc[o.code];i&&(i==="meta"?Lt.getState().reset():Lt.getState().release(i))},r=o=>{document.visibilityState==="hidden"&&Lt.getState().reset()},s=()=>{Lt.getState().reset()};return window.addEventListener("blur",s),e.addEventListener("keydown",t),e.addEventListener("keyup",n),e.addEventListener("visibilitychange",r),()=>{e.removeEventListener("keydown",t),e.removeEventListener("keyup",n),e.removeEventListener("visibilitychange",r),window.removeEventListener("blur",s)}},Ly=()=>{h.useEffect(()=>Id(document),[])},zt=(e,t)=>{h.useEffect(()=>Lt.setState(n=>({triggers:z(A({},n.triggers),{[`${Object.keys(e).join("+")}`]:{combo:e,cb:t}})})),[])},pc=0;function Ny(e,t=300){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var hc=e=>z(A({},e),{ui:z(A({},e.ui),{field:z(A({},e.ui.field),{focus:null})})}),zy=(e,t)=>{const n=Ny(r=>{const{histories:s,index:o}=t().history,i={state:r,id:it("history")},a=[...s.slice(0,o+1),i];e({history:z(A({},t().history),{histories:a,index:a.length-1})})},250);return{initialAppState:{},index:pc,histories:[],hasPast:()=>t().history.index>pc,hasFuture:()=>t().history.index<t().history.histories.length-1,prevHistory:()=>{const{history:r}=t();return r.hasPast()?r.histories[r.index-1]:null},nextHistory:()=>{const r=t().history;return r.hasFuture()?r.histories[r.index+1]:null},currentHistory:()=>t().history.histories[t().history.index],back:()=>{var r;const{history:s,dispatch:o}=t();if(s.hasPast()){const i=hc(((r=s.prevHistory())==null?void 0:r.state)||s.initialAppState);o({type:"set",state:i}),e({history:z(A({},s),{index:s.index-1})})}},forward:()=>{var r;const{history:s,dispatch:o}=t();if(s.hasFuture()){const i=(r=s.nextHistory())==null?void 0:r.state;o({type:"set",state:i?hc(i):{}}),e({history:z(A({},s),{index:s.index+1})})}},setHistories:r=>{var s;const{dispatch:o,history:i}=t();o({type:"set",state:((s=r[r.length-1])==null?void 0:s.state)||i.initialAppState}),e({history:z(A({},i),{histories:r,index:r.length-1})})},setHistoryIndex:r=>{var s;const{dispatch:o,history:i}=t();o({type:"set",state:((s=i.histories[r])==null?void 0:s.state)||i.initialAppState}),e({history:z(A({},i),{index:r})})},record:n}};function $y(e,{histories:t,index:n,initialAppState:r}){h.useEffect(()=>e.setState({history:z(A({},e.getState().history),{histories:t,index:n,initialAppState:r})}),[t,n,r]);const s=()=>{e.getState().history.back()},o=()=>{e.getState().history.forward()};zt({altRight:!1,meta:!0,z:!0},s),zt({altRight:!1,meta:!0,shift:!0,z:!0},o),zt({altRight:!1,meta:!0,y:!0},o),zt({altRight:!1,ctrl:!0,z:!0},s),zt({altRight:!1,ctrl:!0,shift:!0,z:!0},o),zt({altRight:!1,ctrl:!0,y:!0},o)}P();var Fy=(e,t)=>{const n=new Map;return{registerNode:(r,s)=>{n.set(r,s)},unregisterNode:r=>{n.delete(r)},syncNode:r=>{var s;r&&((s=n.get(r))==null||s.sync())},syncNodes:r=>{r.forEach(s=>{var o;s&&((o=n.get(s))==null||o.sync())})},setOverlayVisible:(r,s)=>{if(!r)return;const o=n.get(r);if(o){if(s){o.showOverlay();return}o.hideOverlay()}}}};P();P();var gc=(e,t)=>{const n=[];return ht(e,t,r=>r,r=>(n.push(r),r)),n},By=(e,t)=>{const n=(...s)=>Ee(null,[...s],function*(o={},i){const{state:a,permissions:l,config:u}=t(),{cache:d,globalPermissions:f}=l,p=(S,k=!1)=>Ee(null,null,function*(){var y,b;const{config:C,state:j,setComponentLoading:O}=t(),_=d[S.props.id],I=j.indexes.nodes,x=(y=I[S.props.id])==null?void 0:y.parentId,M=x?I[x]:null,D=(b=M==null?void 0:M.data)!=null?b:null,L=S.type==="root"?C.root:C.components[S.type];if(!L)return;const N=A(A({},f),L.permissions);if(L.resolvePermissions){const B=Oa(S,_==null?void 0:_.lastData),H=Object.values(B).some($=>$===!0),G=(_==null?void 0:_.lastParentId)!==x;if(H||G||k){const $=O(S.props.id,!0,50),Z=yield L.resolvePermissions(S,{changed:B,lastPermissions:(_==null?void 0:_.lastPermissions)||null,permissions:N,appState:ns(j),lastData:(_==null?void 0:_.lastData)||null,parent:D}),F=t().permissions;e({permissions:z(A({},F),{cache:z(A({},F.cache),{[S.props.id]:{lastParentId:x,lastData:S,lastPermissions:Z}}),resolvedPermissions:z(A({},F.resolvedPermissions),{[S.props.id]:Z})})}),$()}}}),v=(S=!1)=>{const{state:k}=t();p({type:"root",props:z(A({},k.data.root.props),{id:"root"})},S)},{item:g,type:m,root:w}=o;g?yield p(g,i):m?gc(a,u).filter(S=>S.type===m).map(S=>Ee(null,null,function*(){yield p(S,i)})):w?v(i):gc(a,u).map(S=>Ee(null,null,function*(){yield p(S,i)}))});return{cache:{},globalPermissions:{drag:!0,edit:!0,delete:!0,duplicate:!0,insert:!0},resolvedPermissions:{},getPermissions:({item:s,type:o,root:i}={})=>{const{config:a,permissions:l}=t(),{globalPermissions:u,resolvedPermissions:d}=l;if(s){const f=a.components[s.type],p=A(A({},u),f==null?void 0:f.permissions),v=d[s.props.id];return v?A(A({},u),v):p}else if(o){const f=a.components[o];return A(A({},u),f==null?void 0:f.permissions)}else if(i){const f=a.root,p=A(A({},u),f==null?void 0:f.permissions),v=d.root;return v?A(A({},u),v):p}return u},resolvePermissions:n,refreshPermissions:s=>n(s,!0)}},Hy=(e,t)=>{h.useEffect(()=>{const{permissions:n}=e.getState(),{globalPermissions:r}=n;e.setState({permissions:z(A({},n),{globalPermissions:A(A({},r),t)})}),n.resolvePermissions()},[t]),h.useEffect(()=>e.subscribe(n=>n.state.data,()=>{e.getState().permissions.resolvePermissions()}),[]),h.useEffect(()=>e.subscribe(n=>n.config,()=>{e.getState().permissions.resolvePermissions()}),[])};P();var Vy=(e,t)=>({fields:{},loading:!1,lastResolvedData:{},id:void 0}),Wy=(e,t)=>{const n=h.useCallback(r=>Ee(null,null,function*(){var s,o;const{fields:i,lastResolvedData:a}=e.getState().fields,l=e.getState().metadata,u=e.getState().state.indexes.nodes,d=u[t||"root"],f=d==null?void 0:d.data,p=d!=null&&d.parentId?u[d.parentId]:null,v=(p==null?void 0:p.data)||null,{getComponentConfig:g,state:m}=e.getState(),w=g(f==null?void 0:f.type);if(!f||!w)return;const S=w.fields||{},k=w.resolveFields;let y=i;if(r&&(e.setState(b=>({fields:z(A({},b.fields),{fields:S,id:t})})),y=S),k){const b=setTimeout(()=>{e.setState(_=>({fields:z(A({},_.fields),{loading:!0})}))},50),C=((s=a.props)==null?void 0:s.id)===t?a:null,j=Oa(f,C),O=yield k(f,{changed:j,fields:S,lastFields:y,metadata:A(A({},l),w.metadata),lastData:C,appState:ns(m),parent:v});if(clearTimeout(b),((o=e.getState().selectedItem)==null?void 0:o.props.id)!==t)return;e.setState({fields:{fields:O,loading:!1,lastResolvedData:f,id:t}})}else e.setState(b=>({fields:z(A({},b.fields),{fields:S,id:t})}))}),[t]);h.useEffect(()=>(n(!0),e.subscribe(r=>r.state.indexes.nodes[t||"root"],()=>n())),[t])};P();var Uy=e=>{if("type"in e&&e.type!=="root")throw new Error("Converting non-root item to root.");const{readOnly:t}=e;if(e.props){if("id"in e.props){const n=e.props,{id:r}=n;return{props:Kt(n,["id"]),readOnly:t}}return{props:e.props,readOnly:t}}return{props:{},readOnly:t}},qy={title:{type:"text"}},Ed=e=>qu()(Sa((t,n)=>{var r,s;return z(A({instanceId:it(),state:Oi,config:{components:{}},componentState:{},plugins:[],overrides:{},viewports:ss,zoomConfig:{autoZoom:1,rootHeight:0,zoom:1},status:"LOADING",iframe:{},_experimentalFullScreenCanvas:!1,_experimentalVirtualization:!1,metadata:{},fieldTransforms:{}},e),{fields:Vy(),history:zy(t,n),nodes:Fy(),permissions:By(t,n),getCurrentData:()=>{var o;const i=n();return(o=i.selectedItem)!=null?o:i.state.data.root},getComponentConfig:o=>{var i;const{config:a,selectedItem:l}=n(),u=((i=a.root)==null?void 0:i.fields)||qy;return o&&o!=="root"?a.components[o]:l?a.components[l.type]:z(A({},a.root),{fields:u})},selectedItem:(r=e==null?void 0:e.state)!=null&&r.ui.itemSelector?xt((s=e==null?void 0:e.state)==null?void 0:s.ui.itemSelector,e.state):null,dispatch:o=>t(i=>{var a,l;const{record:u}=n().history,f=tc({record:u,appStore:i})(i.state,o),p=f.ui.itemSelector?xt(f.ui.itemSelector,f):null;return(l=(a=n()).onAction)==null||l.call(a,o,f,n().state),z(A({},i),{state:f,selectedItem:p})}),setZoomConfig:o=>t({zoomConfig:o}),setStatus:o=>t({status:o}),setComponentState:o=>t({componentState:o}),pendingLoadTimeouts:{},setComponentLoading:(o,i=!0,a=0)=>{const{setComponentState:l,pendingLoadTimeouts:u}=n(),d=it(),f=()=>{var g;const{componentState:m}=n();l(z(A({},m),{[o]:z(A({},m[o]),{loadingCount:(((g=m[o])==null?void 0:g.loadingCount)||0)+1})}))},p=()=>{var g;const{componentState:m}=n();clearTimeout(v),delete u[d],t({pendingLoadTimeouts:u}),l(z(A({},m),{[o]:z(A({},m[o]),{loadingCount:Math.max((((g=m[o])==null?void 0:g.loadingCount)||0)-1,0)})}))},v=setTimeout(()=>{i?f():p(),delete u[d],t({pendingLoadTimeouts:u})},a);return t({pendingLoadTimeouts:z(A({},u),{[o]:v})}),p},unsetComponentLoading:o=>{const{setComponentLoading:i}=n();i(o,!1)},setUi:(o,i)=>t(a=>{const u=tc({record:()=>{},appStore:a})(a.state,{type:"setUi",ui:o,recordHistory:i}),d=u.ui.itemSelector?xt(u.ui.itemSelector,u):null;return z(A({},a),{state:u,selectedItem:d})}),resolveComponentData:(o,i)=>Ee(null,null,function*(){var a,l;const{config:u,metadata:d,setComponentLoading:f,permissions:p,state:v}=n(),g="id"in o.props?o.props.id:"root",m=(a=v.indexes.nodes[g])==null?void 0:a.parentId,w=m?v.indexes.nodes[m]:null,S=(l=w==null?void 0:w.data)!=null?l:null,k={};return yield pd(o,u,d,y=>{const b="id"in y.props?y.props.id:"root";k[b]=f(b,!0,50)},y=>Ee(null,null,function*(){const b="id"in y.props?y.props.id:"root";"type"in y?yield p.refreshPermissions({item:y}):yield p.refreshPermissions({root:!0}),k[b]()}),i,S)}),resolveAndCommitData:()=>Ee(null,null,function*(){const{config:o,state:i,dispatch:a,resolveComponentData:l}=n();ht(i,o,u=>u,(u,d)=>(d.length>1||l(u,"load").then(f=>{const{state:p}=n(),v=p.indexes.nodes[f.node.props.id];if(v&&f.didChange)if(f.node.props.id==="root")a({type:"replaceRoot",root:Uy(f.node)});else{const g=`${v.parentId}:${v.zone}`,w=p.indexes.zones[g].contentIds.indexOf(f.node.props.id);a({type:"replace",data:f.node,destinationIndex:w,destinationZone:g})}}),u))})})})),Da=h.createContext(Ed());function V(e){const t=h.useContext(Da);return To(t,e)}function Ae(){return h.useContext(Da)}P();var Cd=h.createContext({}),Ne=()=>h.useContext(Cd);P();P();P();var jd={Select:"_Select_xjbef_1","Select-button":"_Select-button_xjbef_6","Select--hasOptions":"_Select--hasOptions_xjbef_19","Select--disabled":"_Select--disabled_xjbef_23","Select-buttonIcon":"_Select-buttonIcon_xjbef_27","Select--standalone":"_Select--standalone_xjbef_33","Select--actionBar":"_Select--actionBar_xjbef_38","Select--hasValue":"_Select--hasValue_xjbef_44","Select-items":"_Select-items_xjbef_61",SelectItem:"_SelectItem_xjbef_72","SelectItem--isSelected":"_SelectItem--isSelected_xjbef_87","SelectItem-icon":"_SelectItem-icon_xjbef_93"};P();P();P();var vc=(e,t,n)=>{const r=Array.from(e),[s]=r.splice(t,1);return r.splice(n,0,s),r};P();var Zy=(e,t,n)=>{const r=Array.from(e);return r.splice(t,1),r.splice(t,0,n),r};P();P();P();P();var Yy="Invariant failed";function Gy(e,t){throw new Error(Yy)}var Ts=function(t){var n=t.top,r=t.right,s=t.bottom,o=t.left,i=r-o,a=s-n,l={top:n,right:r,bottom:s,left:o,width:i,height:a,x:o,y:n,center:{x:(r+o)/2,y:(s+n)/2}};return l},Ky=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},mc=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},ei={top:0,right:0,bottom:0,left:0},Xy=function(t){var n=t.borderBox,r=t.margin,s=r===void 0?ei:r,o=t.border,i=o===void 0?ei:o,a=t.padding,l=a===void 0?ei:a,u=Ts(Ky(n,s)),d=Ts(mc(n,i)),f=Ts(mc(d,l));return{marginBox:u,borderBox:Ts(n),paddingBox:d,contentBox:f,margin:s,border:i,padding:l}},mt=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var s=Number(n);return isNaN(s)&&Gy(),s},Jy=function(t,n){var r={top:mt(n.marginTop),right:mt(n.marginRight),bottom:mt(n.marginBottom),left:mt(n.marginLeft)},s={top:mt(n.paddingTop),right:mt(n.paddingRight),bottom:mt(n.paddingBottom),left:mt(n.paddingLeft)},o={top:mt(n.borderTopWidth),right:mt(n.borderRightWidth),bottom:mt(n.borderBottomWidth),left:mt(n.borderLeftWidth)};return Xy({borderBox:t,margin:r,padding:s,border:o})},Pd=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Jy(n,r)},Qy=(e,t,n)=>{const r=Pd(t),{width:s,height:o}=r.contentBox,i=e.height==="auto"?o:e.height;let a=0,l=1;if(typeof e.width=="number"&&(e.width>s||i>o)){const u=Math.min(s/e.width,1),d=Math.min(o/i,1);n=u,u<d?a=i/n:(a=i,n=d),l=n}else l=1,n=1,a=i;return{autoZoom:l,rootHeight:a,zoom:n}},Ad=e=>{const t=Ae();return r=>{const{state:s,zoomConfig:o,setZoomConfig:i}=t.getState(),{viewports:a}=s.ui,l=(r==null?void 0:r.viewports)||a;e.current&&i(Qy(l==null?void 0:l.current,e.current,o.zoom))}},$n=ne("Select",jd),Od=ne("SelectItem",jd),eb=({children:e,isSelected:t,onClick:n})=>c.jsx("button",{className:Od({isSelected:t}),onClick:n,children:e}),tb=({children:e,options:t,onChange:n,value:r,defaultValue:s,mode:o,disabled:i=!1})=>{const[a,l]=h.useState(!1),u=t.length>0,d=i||!u;return c.jsx("div",{className:$n({hasValue:r!==s,hasOptions:u,actionBar:o==="actionBar",standalone:o==="standalone",disabled:d}),children:c.jsxs(Yu,{open:a,onOpenChange:l,children:[u?c.jsx(Xu,{asChild:!0,children:c.jsxs("button",{className:$n("button"),children:[c.jsx("span",{className:$n("buttonIcon"),children:e}),c.jsx(sr,{size:12})]})}):c.jsx("div",{children:c.jsxs("div",{className:$n("button"),children:[c.jsx("span",{className:$n("buttonIcon"),children:e}),c.jsx(sr,{size:12})]})}),t.length>0&&c.jsx(Ju,{children:c.jsx(Qu,{align:"start",children:c.jsx("ul",{className:$n("items"),"data-puck-rte-menu":!0,children:t.map(f=>{const p=f.icon;return c.jsx("li",{children:c.jsxs(eb,{isSelected:r===f.value,onClick:()=>{n(f.value),l(!1)},children:[p&&c.jsx("div",{className:Od("icon"),children:c.jsx(p,{size:16})}),f.label]})},f.value)})})})})]})})};function Ta({renderDefaultIcon:e,onChange:t,options:n,value:r,defaultValue:s}){var o,i;const{inline:a,readOnly:l}=Ne(),u=h.useMemo(()=>n.reduce((f,p)=>z(A({},f),{[p.value]:p}),{}),[n]),d=(i=r&&((o=u[r])==null?void 0:o.icon))!=null?i:e;return c.jsx(tb,{options:n,onChange:t,value:r,defaultValue:s,mode:a?"actionBar":"standalone",disabled:l,children:c.jsx(d,{})})}/*! Bundled license information:
26
+
27
+ lucide-react/dist/esm/shared/src/utils.js:
28
+ lucide-react/dist/esm/defaultAttributes.js:
29
+ lucide-react/dist/esm/Icon.js:
30
+ lucide-react/dist/esm/createLucideIcon.js:
31
+ lucide-react/dist/esm/icons/align-left.js:
32
+ lucide-react/dist/esm/icons/heading.js:
33
+ lucide-react/dist/esm/icons/list.js:
34
+ lucide-react/dist/esm/icons/align-center.js:
35
+ lucide-react/dist/esm/icons/align-justify.js:
36
+ lucide-react/dist/esm/icons/align-right.js:
37
+ lucide-react/dist/esm/icons/bold.js:
38
+ lucide-react/dist/esm/icons/chevron-down.js:
39
+ lucide-react/dist/esm/icons/chevron-right.js:
40
+ lucide-react/dist/esm/icons/chevron-up.js:
41
+ lucide-react/dist/esm/icons/circle-check-big.js:
42
+ lucide-react/dist/esm/icons/code.js:
43
+ lucide-react/dist/esm/icons/copy.js:
44
+ lucide-react/dist/esm/icons/corner-left-up.js:
45
+ lucide-react/dist/esm/icons/ellipsis-vertical.js:
46
+ lucide-react/dist/esm/icons/expand.js:
47
+ lucide-react/dist/esm/icons/globe.js:
48
+ lucide-react/dist/esm/icons/hammer.js:
49
+ lucide-react/dist/esm/icons/hash.js:
50
+ lucide-react/dist/esm/icons/heading-1.js:
51
+ lucide-react/dist/esm/icons/heading-2.js:
52
+ lucide-react/dist/esm/icons/heading-3.js:
53
+ lucide-react/dist/esm/icons/heading-4.js:
54
+ lucide-react/dist/esm/icons/heading-5.js:
55
+ lucide-react/dist/esm/icons/heading-6.js:
56
+ lucide-react/dist/esm/icons/italic.js:
57
+ lucide-react/dist/esm/icons/layers.js:
58
+ lucide-react/dist/esm/icons/layout-grid.js:
59
+ lucide-react/dist/esm/icons/link.js:
60
+ lucide-react/dist/esm/icons/list-ordered.js:
61
+ lucide-react/dist/esm/icons/lock-open.js:
62
+ lucide-react/dist/esm/icons/lock.js:
63
+ lucide-react/dist/esm/icons/maximize-2.js:
64
+ lucide-react/dist/esm/icons/minimize-2.js:
65
+ lucide-react/dist/esm/icons/minus.js:
66
+ lucide-react/dist/esm/icons/monitor.js:
67
+ lucide-react/dist/esm/icons/panel-left.js:
68
+ lucide-react/dist/esm/icons/panel-right.js:
69
+ lucide-react/dist/esm/icons/plus.js:
70
+ lucide-react/dist/esm/icons/quote.js:
71
+ lucide-react/dist/esm/icons/rectangle-ellipsis.js:
72
+ lucide-react/dist/esm/icons/redo-2.js:
73
+ lucide-react/dist/esm/icons/search.js:
74
+ lucide-react/dist/esm/icons/sliders-horizontal.js:
75
+ lucide-react/dist/esm/icons/smartphone.js:
76
+ lucide-react/dist/esm/icons/square-code.js:
77
+ lucide-react/dist/esm/icons/strikethrough.js:
78
+ lucide-react/dist/esm/icons/tablet.js:
79
+ lucide-react/dist/esm/icons/toy-brick.js:
80
+ lucide-react/dist/esm/icons/trash.js:
81
+ lucide-react/dist/esm/icons/type.js:
82
+ lucide-react/dist/esm/icons/underline.js:
83
+ lucide-react/dist/esm/icons/undo-2.js:
84
+ lucide-react/dist/esm/icons/x.js:
85
+ lucide-react/dist/esm/icons/zoom-in.js:
86
+ lucide-react/dist/esm/icons/zoom-out.js:
87
+ lucide-react/dist/esm/lucide-react.js:
88
+ (**
89
+ * @license lucide-react v0.468.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ *)
94
+ */P();var yc={left:{label:"Left",icon:Ma},center:{label:"Center",icon:gd},right:{label:"Right",icon:md},justify:{label:"Justify",icon:vd}},nb=e=>{var t;let n=[];return(e==null?void 0:e.textAlign)!==!1&&((t=e==null?void 0:e.textAlign)!=null&&t.alignments?(e!=null&&e.textAlign.alignments.includes("left")&&n.push("left"),e!=null&&e.textAlign.alignments.includes("center")&&n.push("center"),e!=null&&e.textAlign.alignments.includes("right")&&n.push("right"),e!=null&&e.textAlign.alignments.includes("justify")&&n.push("justify")):n=["left","center","right","justify"]),h.useMemo(()=>n.map(r=>({value:r,label:yc[r].label,icon:yc[r].icon})),[n])};P();var bc={h1:{label:"Heading 1",icon:oy},h2:{label:"Heading 2",icon:iy},h3:{label:"Heading 3",icon:ay},h4:{label:"Heading 4",icon:ly},h5:{label:"Heading 5",icon:cy},h6:{label:"Heading 6",icon:uy}},rb=e=>{var t;let n=[];return(e==null?void 0:e.heading)!==!1&&((t=e==null?void 0:e.heading)!=null&&t.levels?(e!=null&&e.heading.levels.includes(1)&&n.push("h1"),e!=null&&e.heading.levels.includes(2)&&n.push("h2"),e!=null&&e.heading.levels.includes(3)&&n.push("h3"),e!=null&&e.heading.levels.includes(4)&&n.push("h4"),e!=null&&e.heading.levels.includes(5)&&n.push("h5"),e!=null&&e.heading.levels.includes(6)&&n.push("h6")):n=["h1","h2","h3","h4","h5","h6"]),h.useMemo(()=>n.map(r=>({value:r,label:bc[r].label,icon:bc[r].icon})),[n])};P();var _c={ul:{label:"Bullet list",icon:Lo},ol:{label:"Numbered list",icon:wd}},sb=e=>{let t=[];return(e==null?void 0:e.listItem)!==!1&&(t=["ul","ol"]),h.useMemo(()=>t.map(n=>({value:n,label:_c[n].label,icon:_c[n].icon})),[t])};P();P();var Md={ActionBar:"_ActionBar_1nmyk_1","ActionBar-label":"_ActionBar-label_1nmyk_18",ActionBarAction:"_ActionBarAction_1nmyk_30","ActionBar-group":"_ActionBar-group_1nmyk_38","ActionBarAction--disabled":"_ActionBarAction--disabled_1nmyk_71","ActionBarAction--active":"_ActionBarAction--active_1nmyk_93","ActionBar-separator":"_ActionBar-separator_1nmyk_102"},os=ne("ActionBar",Md),ob=ne("ActionBarAction",Md),pt=({label:e,children:t})=>c.jsxs("div",{className:os(),onClick:n=>{n.stopPropagation()},children:[e&&c.jsx(pt.Group,{children:c.jsx("div",{className:os("label"),children:e})}),t]}),Dd=({children:e,label:t,onClick:n,active:r=!1,disabled:s})=>c.jsx("button",{type:"button",className:ob({active:r,disabled:s}),onClick:n,title:t,tabIndex:0,disabled:s,children:e}),ib=({children:e})=>c.jsx("div",{className:os("group"),children:e}),ab=({label:e})=>c.jsx("div",{className:os("label"),children:e}),lb=()=>c.jsx("div",{className:os("separator")});pt.Action=Dd;pt.Label=ab;pt.Group=ib;pt.Separator=lb;P();P();var cb={IconButton:"_IconButton_ffob9_1","IconButton--active":"_IconButton--active_ffob9_14","IconButton--disabled":"_IconButton--disabled_ffob9_24","IconButton-title":"_IconButton-title_ffob9_37"};P();P();var ub={Loader:"_Loader_nacdm_13","loader-animation":"_loader-animation_nacdm_1"},db=ne("Loader",ub),On=e=>{var t=e,{color:n,size:r=16}=t,s=Kt(t,["color","size"]);return c.jsx("span",A({className:db(),style:{width:r,height:r,color:n},"aria-label":"loading"},s))},xc=ne("IconButton",cb),jt=({active:e=!1,children:t,href:n,onClick:r,type:s,disabled:o,tabIndex:i,newTab:a,fullWidth:l,title:u,suppressHydrationWarning:d})=>{const[f,p]=h.useState(!1),v=n?"a":"button";return c.jsxs(v,{className:xc({active:e,disabled:o,fullWidth:l}),onClick:m=>{r&&(p(!0),Promise.resolve(r(m)).then(()=>{p(!1)}))},type:s,disabled:o||f,tabIndex:i,target:a?"_blank":void 0,rel:a?"noreferrer":void 0,href:n,title:u,suppressHydrationWarning:d,children:[c.jsx("span",{className:xc("title"),children:u}),t,f&&c.jsxs(c.Fragment,{children:["  ",c.jsx(On,{size:14})]})]})};P();P();var fb={RichTextMenu:"_RichTextMenu_k97eh_1","RichTextMenu--form":"_RichTextMenu--form_k97eh_7","RichTextMenu-group":"_RichTextMenu-group_k97eh_17","RichTextMenu--inline":"_RichTextMenu--inline_k97eh_35"};P();P();P();P();P();var pb={Control:"_Control_1aveu_1","Control--inline":"_Control--inline_1aveu_6"},wc=ne("Control",pb);function at({icon:e,disabled:t,active:n,onClick:r,title:s}){const{inline:o}=Ne();return o?c.jsx("span",{className:wc({inline:!0}),children:c.jsx(Dd,{onClick:r,disabled:t,active:n,label:s,children:e})}):c.jsx("span",{className:wc(),children:c.jsx(jt,{onClick:r,disabled:t,active:n,title:s,children:e})})}function hb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Ma,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("left").run()},disabled:!(t!=null&&t.canAlignLeft),active:t==null?void 0:t.isAlignLeft,title:"Align left"})}P();function gb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(gd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("center").run()},disabled:!(t!=null&&t.canAlignCenter),active:t==null?void 0:t.isAlignCenter,title:"Align center"})}P();function vb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(md,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("right").run()},disabled:!(t!=null&&t.canAlignRight),active:t==null?void 0:t.isAlignRight,title:"Align right"})}P();function mb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(vd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("justify").run()},disabled:!(t!=null&&t.canAlignJustify),active:t==null?void 0:t.isAlignJustify,title:"Justify"})}P();P();function yb(){const e=Ne(),t=nb(e.options);return c.jsx(Ta,{options:t,onChange:()=>{},value:"left",defaultValue:"left",renderDefaultIcon:Ma})}var bb=h.lazy(()=>hn(()=>import("./loaded-MIY725CK-C7ZoKWol.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.AlignSelectLoaded}))),Td=()=>c.jsx(h.Suspense,{fallback:c.jsx(yb,{}),children:c.jsx(bb,{})});P();function Mi(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Km,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBold().run()},disabled:!(t!=null&&t.canBold),active:t==null?void 0:t.isBold,title:"Bold"})}P();function Di(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(dy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleItalic().run()},disabled:!(t!=null&&t.canItalic),active:t==null?void 0:t.isItalic,title:"Italic"})}P();function Ti(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Oy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleUnderline().run()},disabled:!(t!=null&&t.canUnderline),active:t==null?void 0:t.isUnderline,title:"Underline"})}P();function _b(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(jy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleStrike().run()},disabled:!(t!=null&&t.canStrike),active:t==null?void 0:t.isStrike,title:"Strikethrough"})}P();function xb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Qm,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleCode().run()},disabled:!(t!=null&&t.canInlineCode),active:t==null?void 0:t.isInlineCode,title:"Inline code"})}P();function wb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Lo,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBulletList().run()},disabled:!(t!=null&&t.canBulletList),active:t==null?void 0:t.isBulletList,title:"Bullet list"})}P();function Sb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(wd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleOrderedList().run()},disabled:!(t!=null&&t.canOrderedList),active:t==null?void 0:t.isOrderedList,title:"Ordered list"})}P();function kb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(Cy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleCodeBlock().run()},disabled:!(t!=null&&t.canCodeBlock),active:t==null?void 0:t.isCodeBlock,title:"Code block"})}P();function Ib(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(xy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBlockquote().run()},disabled:!(t!=null&&t.canBlockquote),active:t==null?void 0:t.isBlockquote,title:"Blockquote"})}P();function Eb(){const{editor:e,editorState:t}=Ne();return c.jsx(at,{icon:c.jsx(my,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setHorizontalRule().run()},disabled:!(t!=null&&t.canHorizontalRule),title:"Horizontal rule"})}P();P();function Cb(){const e=Ne(),t=rb(e.options);return c.jsx(Ta,{options:t,onChange:()=>{},value:"p",defaultValue:"p",renderDefaultIcon:Gm})}var jb=h.lazy(()=>hn(()=>import("./loaded-F37CNCVG-Bav6-7kM.js"),__vite__mapDeps([5,1,2,3,4])).then(e=>({default:e.HeadingSelectLoaded}))),Rd=()=>c.jsx(h.Suspense,{fallback:c.jsx(Cb,{}),children:c.jsx(jb,{})});P();P();function Pb(){const e=Ne(),t=sb(e.options);return c.jsx(Ta,{options:t,onChange:()=>{},value:"p",defaultValue:"p",renderDefaultIcon:Lo})}var Ab=h.lazy(()=>hn(()=>import("./loaded-H325ZSK5-DhwWhSPx.js"),__vite__mapDeps([6,1,2,3,4])).then(e=>({default:e.ListSelectLoaded}))),Ld=()=>c.jsx(h.Suspense,{fallback:c.jsx(Pb,{}),children:c.jsx(Ab,{})}),Nd=ne("RichTextMenu",fb),Sc=({children:e})=>c.jsx(ze,{children:e}),ze=({children:e})=>{const{inline:t}=Ne();return c.jsx("div",{className:Nd({inline:t,form:!t}),"data-puck-rte-menu":!0,children:e})},Pr=({children:e})=>c.jsx("div",{className:Nd("group"),children:e});ze.Group=Pr;ze.Control=at;ze.AlignCenter=gb;ze.AlignJustify=mb;ze.AlignLeft=hb;ze.AlignRight=vb;ze.AlignSelect=Td;ze.Blockquote=Ib;ze.Bold=Mi;ze.BulletList=wb;ze.CodeBlock=kb;ze.HeadingSelect=Rd;ze.HorizontalRule=Eb;ze.InlineCode=xb;ze.Italic=Di;ze.ListSelect=Ld;ze.OrderedList=Sb;ze.Strikethrough=_b;ze.Underline=Ti;var zd=({editor:e=null,editorState:t=null,field:n,readOnly:r,inline:s})=>{const{renderMenu:o,renderInlineMenu:i}=n,a=h.useMemo(()=>i||Sc,[i]),l=h.useMemo(()=>o||Sc,[o]);return c.jsx(Cd.Provider,{value:{editor:e,editorState:t,inline:s,options:n.options,readOnly:r},children:s?c.jsx(a,{editor:e,editorState:t,readOnly:r,children:c.jsxs(Pr,{children:[c.jsx(Mi,{}),c.jsx(Di,{}),c.jsx(Ti,{})]})}):c.jsxs(l,{editor:e,editorState:t,readOnly:r,children:[c.jsxs(Pr,{children:[c.jsx(Rd,{}),c.jsx(Ld,{})]}),c.jsxs(Pr,{children:[c.jsx(Mi,{}),c.jsx(Di,{}),c.jsx(Ti,{})]}),c.jsx(Pr,{children:c.jsx(Td,{})})]})})};P();var kc=ne("RichTextEditor",sd),$d=h.memo(({children:e,menu:t,readOnly:n=!1,field:r,inline:s=!1,editor:o,id:i})=>{const{initialHeight:a}=r,l=V(p=>{var v;return((v=p.currentRichText)==null?void 0:v.id)===i&&s===p.currentRichText.inline}),u=Ae(),d=h.useCallback(p=>{var v,g;(p.metaKey||p.ctrlKey)&&p.key.toLowerCase()==="i"&&(p.stopPropagation(),p.preventDefault(),(g=o==null?void 0:(v=o.commands).toggleItalic)==null||g.call(v)),p.key.toLowerCase()==="backspace"&&p.stopPropagation()},[o]),f=h.useCallback(p=>{var v,g;const m=!!((g=(v=p.relatedTarget)==null?void 0:v.closest)!=null&&g.call(v,"[data-puck-rte-menu]"));p.relatedTarget&&!m?u.setState({currentRichText:null}):p.stopPropagation()},[u]);return c.jsxs("div",{className:kc({editor:!s,inline:s,isActive:l,disabled:n}),style:s?{}:{height:a??192,overflowY:"auto"},onKeyDownCapture:d,onBlur:f,children:[!s&&c.jsx("div",{className:kc("menu"),children:t}),e]})});$d.displayName="EditorInner";P();var Ob=h.lazy(()=>hn(()=>import("./full-N67EAB2Q-Dtb7CnaF.js"),__vite__mapDeps([7,1,2,3,4])).then(e=>({default:e.LoadedRichTextMenuFull}))),Mb=e=>c.jsx(h.Suspense,{fallback:c.jsx(zd,A({},e)),children:c.jsx(Ob,A({},e))});P();P();P();P();P();P();var Fd=(e,t=e)=>({slot:({value:n,propName:r,field:s,isReadOnly:o})=>{const i=o?t:e;return l=>i(z(A({allow:(s==null?void 0:s.type)==="slot"?s.allow:[],disallow:(s==null?void 0:s.type)==="slot"?s.disallow:[]},l),{zone:r,content:n}))}});P();P();P();function Bd(e,t,n){return Object.keys(e).reduce((r,s)=>{const o=s;return z(A({},r),{[o]:i=>{var a=i,{parentId:l}=a,u=Kt(a,["parentId"]);const d=u.propPath.replace(/\[\d+\]/g,"[*]"),f=(t==null?void 0:t[u.propPath])||(t==null?void 0:t[d])||n||!1,p=e[o];return p==null?void 0:p(z(A({},u),{isReadOnly:f,componentId:l}))}})},{})}function Db(e,t,n,r,s){const o=h.useMemo(()=>Bd(n,r,s),[n,r,s]),i=h.useMemo(()=>ur(t,o,e).props,[e,t,o]);return h.useMemo(()=>A(A({},t.props),i),[t.props,i])}function zo(e,t,n,r=n,s,o){return Db(e,t,Fd(n,r),s,o)}P();P();var Tb=ne("RichTextEditor",sd);function Hd({content:e}){return c.jsx("div",{className:Tb(),children:c.jsx("div",{className:"rich-text",dangerouslySetInnerHTML:{__html:e}})})}P();var Ri=(e,t,n)=>{if(!e)return null;if(t.length===0)return n(e);const[r,...s]=t;return Array.isArray(e)?e.map(o=>Ri(o,t,n)):z(A({},e),{[r]:Ri(e[r],s,n)})};function $o(e,t){const n=(o,i=[])=>{if(!o)return[];const a=[];for(const[l,u]of Object.entries(o)){const d=[...i,l];u.type==="richtext"&&a.push({path:d,field:u}),u.type==="array"&&"arrayFields"in u&&a.push(...n(u.arrayFields,d)),u.type==="object"&&"objectFields"in u&&a.push(...n(u.objectFields,d))}return a},r=h.useMemo(()=>n(e),[e]);return h.useMemo(()=>{if(!(r!=null&&r.length))return{};const o=h.lazy(()=>hn(()=>import("./Render-CU35UAWV-BC5ynnCM.js"),__vite__mapDeps([8,9,4,2,3])).then(a=>({default:a.RichTextRender})));let i=A({},t);for(const{path:a,field:l}of r)i=Ri(i,a,u=>c.jsx(h.Suspense,{fallback:c.jsx(Hd,{content:u}),children:c.jsx(o,{content:u,field:l})},it()));return i},[r,t,e])}P();var Ra=e=>c.jsx(Vd,A({},e)),Rb=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=zo(e,t,i=>c.jsx(Ra,z(A({},i),{config:e,metadata:n}))),o=$o(r.fields,s);return c.jsx(r.render,z(A(A({},s),o),{puck:z(A({},s.puck),{metadata:n||{}})}))},Vd=h.forwardRef(function({className:t,style:n,content:r,config:s,metadata:o,as:i},a){const l=i??"div";return c.jsx(l,{className:t,style:n,ref:a,children:r.map(u=>s.components[u.type]?c.jsx(Rb,{config:s,item:u,metadata:o},u.props.id):null)})}),Lb=Symbol.for("preact-signals");function Fo(){if(Zt>1)Zt--;else{var e,t=!1;for((function(){var s=go;for(go=void 0;s!==void 0;)s.S.v===s.v&&(s.S.i=s.i),s=s.o})();Yr!==void 0;){var n=Yr;for(Yr=void 0,ho++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ud(n))try{n.c()}catch(s){t||(e=s,t=!0)}n=r}}if(ho=0,Zt--,t)throw e}}function Te(e){if(Zt>0)return e();Li=++Nb,Zt++;try{return e()}finally{Fo()}}var ge=void 0;function xe(e){var t=ge;ge=void 0;try{return e()}finally{ge=t}}var Yr=void 0,Zt=0,ho=0,Nb=0,Li=0,go=void 0,vo=0;function Wd(e){if(ge!==void 0){var t=e.n;if(t===void 0||t.t!==ge)return t={i:0,S:e,p:ge.s,n:void 0,t:ge,e:void 0,x:void 0,r:t},ge.s!==void 0&&(ge.s.n=t),ge.s=t,e.n=t,32&ge.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ge.s,t.n=void 0,ge.s.n=t,ge.s=t),t}}function lt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}lt.prototype.brand=Lb;lt.prototype.h=function(){return!0};lt.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:xe(function(){var r;(r=t.W)==null||r.call(t)}))};lt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&xe(function(){var s;(s=t.Z)==null||s.call(t)}))}};lt.prototype.subscribe=function(e){var t=this;return dt(function(){var n=t.value,r=ge;ge=void 0;try{e(n)}finally{ge=r}},{name:"sub"})};lt.prototype.valueOf=function(){return this.value};lt.prototype.toString=function(){return this.value+""};lt.prototype.toJSON=function(){return this.value};lt.prototype.peek=function(){var e=ge;ge=void 0;try{return this.value}finally{ge=e}};Object.defineProperty(lt.prototype,"value",{get:function(){var e=Wd(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ho>100)throw new Error("Cycle detected");(function(n){Zt!==0&&ho===0&&n.l!==Li&&(n.l=Li,go={S:n,v:n.v,i:n.i,o:go})})(this),this.v=e,this.i++,vo++,Zt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Fo()}}}});function _s(e,t){return new lt(e,t)}function Ud(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function qd(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Zd(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Mn(e,t){lt.call(this,void 0),this.x=e,this.s=void 0,this.g=vo-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}Mn.prototype=new lt;Mn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vo))return!0;if(this.g=vo,this.f|=1,this.i>0&&!Ud(this))return this.f&=-2,!0;var e=ge;try{qd(this),ge=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ge=e,Zd(this),this.f&=-2,!0};Mn.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}lt.prototype.S.call(this,e)};Mn.prototype.U=function(e){if(this.t!==void 0&&(lt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Mn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Mn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Wd(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ic(e,t){return new Mn(e,t)}function Yd(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Zt++;var n=ge;ge=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,La(e),r}finally{ge=n,Fo()}}}function La(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Yd(e)}function zb(e){if(ge!==this)throw new Error("Out-of-order effect");Zd(this),ge=e,this.f&=-2,8&this.f&&La(this),Fo()}function dr(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}dr.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};dr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Yd(this),qd(this),Zt++;var e=ge;return ge=this,zb.bind(this,e)};dr.prototype.N=function(){2&this.f||(this.f|=2,this.u=Yr,Yr=this)};dr.prototype.d=function(){this.f|=8,1&this.f||La(this)};dr.prototype.dispose=function(){this.d()};function dt(e,t){var n=new dr(e,t);try{n.c()}catch(s){throw n.d(),s}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var $b=Object.create,Na=Object.defineProperty,Fb=Object.defineProperties,Bb=Object.getOwnPropertyDescriptor,Hb=Object.getOwnPropertyDescriptors,Ec=Object.getOwnPropertySymbols,Vb=Object.prototype.hasOwnProperty,Wb=Object.prototype.propertyIsEnumerable,Ub=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),fr=e=>{throw TypeError(e)},Ni=(e,t,n)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qb=(e,t)=>{for(var n in t||(t={}))Vb.call(t,n)&&Ni(e,n,t[n]);if(Ec)for(var n of Ec(t))Wb.call(t,n)&&Ni(e,n,t[n]);return e},Zb=(e,t)=>Fb(e,Hb(t)),Cc=(e,t)=>Na(e,"name",{value:t,configurable:!0}),Yb=e=>{var t;return[,,,$b((t=void 0)!=null?t:null)]},Gd=["class","method","getter","setter","accessor","field","value","get","set"],Ar=e=>e!==void 0&&typeof e!="function"?fr("Function expected"):e,Gb=(e,t,n,r,s)=>({kind:Gd[e],name:t,metadata:r,addInitializer:o=>n._?fr("Already initialized"):s.push(Ar(o||null))}),Kd=(e,t)=>Ni(t,Ub("metadata"),e[3]),yn=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},pr=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=Gd[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&Bb(f<4?s:{get[n](){return yt(this,o)},set[n](b){return ln(this,o,b)}},n));f?v&&f<4&&Cc(o,(f>2?"set ":f>1?"get ":"")+n):Cc(s,n);for(var y=r.length-1;y>=0;y--)u=Gb(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>Kb(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?yt:Xb)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,C)=>ln(b,s,C,f^4?o:k.set):(b,C)=>b[n]=C)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Ar(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?fr("Object expected"):(Ar(i=a.get)&&(k.get=i),Ar(i=a.set)&&(k.set=i),Ar(i=a.init)&&w.unshift(i));return f||Kd(e,s),k&&Na(s,n,k),v?f^4?o:k:s},za=(e,t,n)=>t.has(e)||fr("Cannot "+n),Kb=(e,t)=>Object(t)!==t?fr('Cannot use the "in" operator on this value'):e.has(t),yt=(e,t,n)=>(za(e,t,"read from private field"),n?n.call(e):t.get(e)),Or=(e,t,n)=>t.has(e)?fr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ln=(e,t,n,r)=>(za(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Xb=(e,t,n)=>(za(e,t,"access private method"),n);function mo(e,t){if(t){let n;return Ic(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return Ic(e)}function Yt(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((r,s)=>!Yt(r,t[s]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:!n.some(o=>!Yt(e[o],t[o]))}return!1}function fe({get:e},t){return{init(n){return _s(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function He(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=mo(e.bind(this)),n.set(this,r)),r.value}}function ti(e=!0){return function(t,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),s=Object.getOwnPropertyDescriptor(r,n.name);s&&Object.defineProperty(r,n.name,Zb(qb({},s),{enumerable:e}))})}}function xs(...e){const t=e.map(dt);return()=>t.forEach(n=>n())}var Xd,Jd,Qd,ef,tf,nf,st,$a,ni,zi,$i,Qe,Fa,ri,rf,Fi,Ba,si,Bi,Hi;nf=[fe],tf=[fe],ef=[fe],Qd=[ti()],Jd=[ti()],Xd=[ti()];var Dn=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,yn(st,5,this),Or(this,Qe),Or(this,$a,yn(st,8,this)),yn(st,11,this),Or(this,Fa,yn(st,12,this)),yn(st,15,this),Or(this,Ba,yn(st,16,this)),yn(st,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return yt(this,Qe,Bi)}get initial(){return yt(this,Qe,zi)}get previous(){return yt(this,Qe,rf)}set current(e){const t=xe(()=>yt(this,Qe,Bi));e&&t&&this.equals(t,e)||Te(()=>{yt(this,Qe,zi)||ln(this,Qe,e,$i),ln(this,Qe,t,Fi),ln(this,Qe,e,Hi)})}reset(e=this.defaultValue){Te(()=>{ln(this,Qe,void 0,Fi),ln(this,Qe,e,$i),ln(this,Qe,e,Hi)})}};st=Yb();$a=new WeakMap;Qe=new WeakSet;Fa=new WeakMap;Ba=new WeakMap;ni=pr(st,20,"#initial",nf,Qe,$a),zi=ni.get,$i=ni.set;ri=pr(st,20,"#previous",tf,Qe,Fa),rf=ri.get,Fi=ri.set;si=pr(st,20,"#current",ef,Qe,Ba),Bi=si.get,Hi=si.set;pr(st,2,"current",Qd,Dn);pr(st,2,"initial",Jd,Dn);pr(st,2,"previous",Xd,Dn);Kd(st,Dn);function oi(e){return xe(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var bn,Jb=class{constructor(){Or(this,bn,new WeakMap)}get(e,t){var n;return e?(n=yt(this,bn).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return yt(this,bn).has(e)||yt(this,bn).set(e,new Map),(r=yt(this,bn).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=yt(this,bn).get(e))==null?void 0:t.clear():void 0}};bn=new WeakMap;var Qb=Object.create,sf=Object.defineProperty,e_=Object.getOwnPropertyDescriptor,jc=Object.getOwnPropertySymbols,t_=Object.prototype.hasOwnProperty,n_=Object.prototype.propertyIsEnumerable,of=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Bo=e=>{throw TypeError(e)},Pc=Math.pow,Vi=(e,t,n)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r_=(e,t)=>{for(var n in t||(t={}))t_.call(t,n)&&Vi(e,n,t[n]);if(jc)for(var n of jc(t))n_.call(t,n)&&Vi(e,n,t[n]);return e},s_=e=>{var t;return[,,,Qb((t=e==null?void 0:e[of("metadata")])!=null?t:null)]},af=["class","method","getter","setter","accessor","field","value","get","set"],lf=e=>e!==void 0&&typeof e!="function"?Bo("Function expected"):e,o_=(e,t,n,r,s)=>({kind:af[e],name:t,metadata:r,addInitializer:o=>n._?Bo("Already initialized"):s.push(lf(o||null))}),i_=(e,t)=>Vi(t,of("metadata"),e[3]),a_=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)o[s].call(n);return r},cf=(e,t,n,r,s,o)=>{for(var i,a,l,u,d=t&7,f=!1,p=!1,v=2,g=af[d+5],m=e[v]||(e[v]=[]),w=(s=s.prototype,e_(s,n)),S=r.length-1;S>=0;S--)l=o_(d,n,a={},e[3],m),l.static=f,l.private=p,u=l.access={has:k=>n in k},u.get=k=>k[n],i=(0,r[S])(w[g],l),a._=1,lf(i)&&(w[g]=i);return w&&sf(s,n,w),s},uf=(e,t,n)=>t.has(e)||Bo("Cannot "+n),l_=(e,t,n)=>(uf(e,t,"read from private field"),t.get(e)),c_=(e,t,n)=>t.has(e)?Bo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),u_=(e,t,n,r)=>(uf(e,t,"write to private field"),t.set(e,n),n),tt=class Wi{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Wi(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new Wi(t,n)}},At=class _n{constructor(t,n,r,s){this.left=t,this.top=n,this.width=r,this.height=s,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:s,width:o,height:i,scale:a}=this,l=new _n(s+t,r+n,o,i);return l.scale=r_({},a),l}get boundingRectangle(){const{width:t,height:n,left:r,top:s,right:o,bottom:i}=this;return{width:t,height:n,left:r,top:s,right:o,bottom:i}}get center(){const{left:t,top:n,right:r,bottom:s}=this;return new tt((t+r)/2,(n+s)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof _n))return!1;const{left:n,top:r,width:s,height:o}=this;return n===t.left&&r===t.top&&s===t.width&&o===t.height}containsPoint(t){const{top:n,left:r,bottom:s,right:o}=this;return n<=t.y&&t.y<=s&&r<=t.x&&t.x<=o}intersectionArea(t){return t instanceof _n?d_(this,t):0}intersectionRatio(t){const{area:n}=this,r=this.intersectionArea(t);return r/(t.area+n-r)}get bottom(){const{top:t,height:n}=this;return t+n}get right(){const{left:t,width:n}=this;return t+n}get aspectRatio(){const{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:s}){return new _n(n,t,r,s)}static delta(t,n,r={x:"center",y:"center"}){const s=(o,i)=>{const a=r[i],l=i==="x"?o.left:o.top,u=i==="x"?o.width:o.height;return a=="start"?l:a=="end"?l+u:l+u/2};return tt.delta({x:s(t,"x"),y:s(t,"y")},{x:s(n,"x"),y:s(n,"y")})}static intersectionRatio(t,n){return _n.from(t).intersectionRatio(_n.from(n))}};function d_(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=s-r,a=o-n;return r<s&&n<o?i*a:0}var df,ff,Ui,Js,ws,Ho=class extends(Ui=Dn,ff=[He],df=[He],Ui){constructor(t){const n=tt.from(t);super(n,(r,s)=>tt.equals(r,s)),a_(ws,5,this),c_(this,Js,0),this.velocity={x:0,y:0}}get delta(){return tt.delta(this.current,this.initial)}get direction(){const{current:t,previous:n}=this;if(!n)return null;const r={x:t.x-n.x,y:t.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:n}=this,r=tt.from(t),s={x:r.x-n.x,y:r.y-n.y},o=Date.now(),i=o-l_(this,Js),a=l=>Math.round(l/i*100);Te(()=>{u_(this,Js,o),this.velocity={x:a(s.x),y:a(s.y)},super.current=r})}reset(t=this.defaultValue){super.reset(tt.from(t)),this.velocity={x:0,y:0}}};ws=s_(Ui);Js=new WeakMap;cf(ws,2,"delta",ff,Ho);cf(ws,2,"direction",df,Ho);i_(ws,Ho);function ii({x:e,y:t},n){const r=Math.abs(e),s=Math.abs(t);return typeof n=="number"?Math.sqrt(Pc(r,2)+Pc(s,2))>n:"x"in n&&"y"in n?r>n.x&&s>n.y:"x"in n?r>n.x:"y"in n?s>n.y:!1}var pf=(e=>(e.Horizontal="x",e.Vertical="y",e))(pf||{}),hf=Object.values(pf),f_=Object.create,Ha=Object.defineProperty,p_=Object.defineProperties,h_=Object.getOwnPropertyDescriptor,g_=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertySymbols,gf=Object.prototype.hasOwnProperty,vf=Object.prototype.propertyIsEnumerable,mf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),hr=e=>{throw TypeError(e)},qi=(e,t,n)=>t in e?Ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yf=(e,t)=>{for(var n in t||(t={}))gf.call(t,n)&&qi(e,n,t[n]);if(yo)for(var n of yo(t))vf.call(t,n)&&qi(e,n,t[n]);return e},bf=(e,t)=>p_(e,g_(t)),Ac=(e,t)=>Ha(e,"name",{value:t,configurable:!0}),_f=(e,t)=>{var n={};for(var r in e)gf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yo)for(var r of yo(e))t.indexOf(r)<0&&vf.call(e,r)&&(n[r]=e[r]);return n},gr=e=>{var t;return[,,,f_((t=e==null?void 0:e[mf("metadata")])!=null?t:null)]},xf=["class","method","getter","setter","accessor","field","value","get","set"],Mr=e=>e!==void 0&&typeof e!="function"?hr("Function expected"):e,v_=(e,t,n,r,s)=>({kind:xf[e],name:t,metadata:r,addInitializer:o=>n._?hr("Already initialized"):s.push(Mr(o||null))}),Tn=(e,t)=>qi(t,mf("metadata"),e[3]),ie=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},pe=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=xf[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&h_(f<4?s:{get[n](){return qe(this,o)},set[n](b){return Ct(this,o,b)}},n));f?v&&f<4&&Ac(o,(f>2?"set ":f>1?"get ":"")+n):Ac(s,n);for(var y=r.length-1;y>=0;y--)u=v_(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>m_(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?qe:y_)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,C)=>Ct(b,s,C,f^4?o:k.set):(b,C)=>b[n]=C)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Mr(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?hr("Object expected"):(Mr(i=a.get)&&(k.get=i),Mr(i=a.set)&&(k.set=i),Mr(i=a.init)&&w.unshift(i));return f||Tn(e,s),k&&Ha(s,n,k),v?f^4?o:k:s},Va=(e,t,n)=>t.has(e)||hr("Cannot "+n),m_=(e,t)=>Object(t)!==t?hr('Cannot use the "in" operator on this value'):e.has(t),qe=(e,t,n)=>(Va(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ct=(e,t,n,r)=>(Va(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),y_=(e,t,n)=>(Va(e,t,"access private method"),n);function wf(e,t){return{plugin:e,options:t}}function Wa(e){return t=>wf(e,t)}function Ua(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var Sf,is,qa,Qs;Sf=[fe];var Xe=class{constructor(e,t){this.manager=e,this.options=t,Se(this,qa,ie(is,8,this,!1)),ie(is,11,this),Se(this,Qs,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return xe(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=dt(e.bind(this));return qe(this,Qs).add(t),t}destroy(){qe(this,Qs).forEach(e=>e())}static configure(e){return wf(this,e)}};is=gr(null);qa=new WeakMap;Qs=new WeakMap;pe(is,4,"disabled",Sf,Xe,qa);Tn(is,Xe);var Vo=class extends Xe{},eo,ai=class{constructor(e){this.manager=e,this.instances=new Map,Se(this,eo,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(Ua).reduceRight((r,s)=>r.some(({plugin:o})=>o===s.plugin)?r:[s,...r],[]),n=t.map(({plugin:r})=>r);for(const r of qe(this,eo))if(!n.includes(r)){if(r.prototype instanceof Vo)continue;this.unregister(r)}for(const{plugin:r,options:s}of t)this.register(r,s);Ct(this,eo,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};eo=new WeakMap;function b_(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Rs=[],qn,Zn,__=class extends Xe{constructor(e){super(e),Se(this,qn),Se(this,Zn),this.computeCollisions=this.computeCollisions.bind(this),Ct(this,Zn,_s(Rs)),this.destroy=xs(()=>{const t=this.computeCollisions(),n=xe(()=>this.manager.dragOperation.position.current);if(t!==Rs){const r=qe(this,qn);if(Ct(this,qn,n),r&&n.x==r.x&&n.y==r.y)return}else Ct(this,qn,void 0);qe(this,Zn).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){xe(()=>{e?qe(this,Zn).value=this.computeCollisions():Ct(this,qn,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:s,shape:o,status:i}=r;if(!i.initialized||!o)return Rs;const a=[],l=[];for(const u of e??n.droppables){if(u.disabled||s&&!u.accepts(s))continue;const d=t??u.collisionDetector;if(!d)continue;l.push(u),u.shape;const f=xe(()=>d({droppable:u,dragOperation:r}));f&&(u.collisionPriority!=null&&(f.priority=u.collisionPriority),a.push(f))}return l.length===0?Rs:(a.sort(b_),a)}get collisions(){return qe(this,Zn).value}};qn=new WeakMap;Zn=new WeakMap;var x_=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const s of r)s(...t)}},w_=class extends x_{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function to(e,t=!0){let n=!1;return bf(yf({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var S_=class extends Vo{constructor(e){super(e);const t=(r,s)=>r.map(({id:o})=>o).join("")===s.map(({id:o})=>o).join("");let n=[];this.destroy=xs(()=>{const{dragOperation:r,collisionObserver:s}=e;r.status.initializing&&(n=[],s.enable())},()=>{const{collisionObserver:r,monitor:s}=e,{collisions:o}=r;if(r.isDisabled())return;const i=to({collisions:o});if(s.dispatch("collision",i),i.defaultPrevented||t(o,n))return;n=o;const[a]=o;xe(()=>{var l;(a==null?void 0:a.id)!==((l=e.dragOperation.target)==null?void 0:l.id)&&(r.disable(),e.actions.setDropTarget(a==null?void 0:a.id).then(()=>{r.enable()}))})})}},bt=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(bt||{}),Ht=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Ht||{}),kf,If,Ef,Cf,jf,Pf,Af,wt,Za;Af=[fe],Pf=[He],jf=[He],Cf=[He],Ef=[He],If=[He],kf=[He];var Xt=class{constructor(){ie(wt,5,this),Se(this,Za,ie(wt,8,this,"idle")),ie(wt,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};wt=gr(null);Za=new WeakMap;pe(wt,4,"value",Af,Xt,Za);pe(wt,2,"current",Pf,Xt);pe(wt,2,"idle",jf,Xt);pe(wt,2,"initializing",Cf,Xt);pe(wt,2,"initialized",Ef,Xt);pe(wt,2,"dragging",If,Xt);pe(wt,2,"dropped",kf,Xt);Tn(wt,Xt);var k_=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return xe(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=to({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return xe(()=>{const{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:s,coordinates:o}=e;Te(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=s??null,t.position.reset(o)});const i=to({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:a}=t;a.current==="initializing"&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:s,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return xe(()=>{var t,n;const{dragOperation:r}=this.manager,{status:s,controller:o}=r;if(!s.dragging||!o||o.signal.aborted)return;const i=to({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",i),queueMicrotask(()=>{var a,l,u,d,f;if(i.defaultPrevented)return;const p=(f=e.to)!=null?f:{x:r.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:r.position.current.y+((d=(u=e.by)==null?void 0:u.y)!=null?d:0)};r.position.current=p})})}stop(e={}){return xe(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:s}=r;if(!s||s.signal.aborted)return;let o;const i=()=>{const l={resume:()=>{},abort:()=>{}};return o=new Promise((u,d)=>{l.resume=u,l.abort=d}),l};s.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const l=xe(()=>{var d;return((d=r.source)==null?void 0:d.status)==="dropping"}),u=()=>{r.controller===s&&(r.controller=void 0),r.reset()};if(l){const{source:d}=r,f=dt(()=>{(d==null?void 0:d.status)==="idle"&&(f(),u())})}else this.manager.renderer.rendering.then(u)})};r.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:i}),o?o.then(a).catch(()=>r.reset()):a()})}},Of,Mf,Df,Tf,ut,Ya,Ga,Ka,Xa;Tf=[fe],Df=[fe],Mf=[fe],Of=[fe];var mn=class{constructor(e,t){Se(this,Ya,ie(ut,8,this)),ie(ut,11,this),Se(this,Ga,ie(ut,12,this)),ie(ut,15,this),Se(this,Ka,ie(ut,16,this)),ie(ut,19,this),Se(this,Xa,ie(ut,20,this)),ie(ut,23,this);const{effects:n,id:r,data:s={},disabled:o=!1,register:i=!0}=e;let a=r;this.manager=t,this.id=r,this.data=s,this.disabled=o,this.effects=()=>{var l;return[()=>{const{id:u,manager:d}=this;if(u!==a)return d==null||d.registry.register(this),()=>d==null?void 0:d.registry.unregister(this)},...(l=n==null?void 0:n())!=null?l:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&i&&queueMicrotask(this.register)}register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};ut=gr(null);Ya=new WeakMap;Ga=new WeakMap;Ka=new WeakMap;Xa=new WeakMap;pe(ut,4,"manager",Tf,mn,Ya);pe(ut,4,"id",Df,mn,Ga);pe(ut,4,"data",Mf,mn,Ka);pe(ut,4,"disabled",Of,mn,Xa);Tn(ut,mn);var Oc=class{constructor(){this.map=_s(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),s=()=>this.unregister(e,t);if(r===t)return s;if(r){const a=this.cleanupFunctions.get(r);a==null||a(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const i=xs(...t.effects());return this.cleanupFunctions.set(t,i),s},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);r==null||r(),this.cleanupFunctions.delete(t);const s=new Map(n);s.delete(e),this.map.value=s}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t==null||t(),e.destroy()}this.map.value=new Map}},Rf,Lf,Nf,zf,$f,Ff,Zi,ot,Ja,Qa,el,$t=class extends(Zi=mn,Ff=[fe],$f=[fe],zf=[fe],Nf=[He],Lf=[He],Rf=[He],Zi){constructor(t,n){var r=t,{modifiers:s,type:o,sensors:i}=r,a=_f(r,["modifiers","type","sensors"]);super(a,n),ie(ot,5,this),Se(this,Ja,ie(ot,8,this)),ie(ot,11,this),Se(this,Qa,ie(ot,12,this)),ie(ot,15,this),Se(this,el,ie(ot,16,this,this.isDragSource?"dragging":"idle")),ie(ot,19,this),this.type=o,this.sensors=i,this.modifiers=s,this.alignment=a.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)===this.id}};ot=gr(Zi);Ja=new WeakMap;Qa=new WeakMap;el=new WeakMap;pe(ot,4,"type",Ff,$t,Ja);pe(ot,4,"modifiers",$f,$t,Qa);pe(ot,4,"status",zf,$t,el);pe(ot,2,"isDropping",Nf,$t);pe(ot,2,"isDragging",Lf,$t);pe(ot,2,"isDragSource",Rf,$t);Tn(ot,$t);var Bf,Hf,Vf,Wf,Uf,qf,Yi,Fe,tl,nl,rl,sl,ol,Ft=class extends(Yi=mn,qf=[fe],Uf=[fe],Wf=[fe],Vf=[fe],Hf=[fe],Bf=[He],Yi){constructor(t,n){var r=t,{accept:s,collisionDetector:o,collisionPriority:i,type:a}=r,l=_f(r,["accept","collisionDetector","collisionPriority","type"]);super(l,n),ie(Fe,5,this),Se(this,tl,ie(Fe,8,this)),ie(Fe,11,this),Se(this,nl,ie(Fe,12,this)),ie(Fe,15,this),Se(this,rl,ie(Fe,16,this)),ie(Fe,19,this),Se(this,sl,ie(Fe,20,this)),ie(Fe,23,this),Se(this,ol,ie(Fe,24,this)),ie(Fe,27,this),this.accept=s,this.collisionDetector=o,this.collisionPriority=i,this.type=a}accepts(t){const{accept:n}=this;return n?typeof n=="function"?n(t):t.type?Array.isArray(n)?n.includes(t.type):t.type===n:!1:!0}get isDropTarget(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:n.id)===this.id}};Fe=gr(Yi);tl=new WeakMap;nl=new WeakMap;rl=new WeakMap;sl=new WeakMap;ol=new WeakMap;pe(Fe,4,"accept",qf,Ft,tl);pe(Fe,4,"type",Uf,Ft,nl);pe(Fe,4,"collisionDetector",Wf,Ft,rl);pe(Fe,4,"collisionPriority",Vf,Ft,sl);pe(Fe,4,"shape",Hf,Ft,ol);pe(Fe,2,"isDropTarget",Bf,Ft);Tn(Fe,Ft);var or=class extends Xe{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Mc=class extends Xe{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},I_=class{constructor(e){this.draggables=new Oc,this.droppables=new Oc,this.plugins=new ai(e),this.sensors=new ai(e),this.modifiers=new ai(e)}register(e,t){if(e instanceof $t)return this.draggables.register(e.id,e);if(e instanceof Ft)return this.droppables.register(e.id,e);if(e.prototype instanceof Mc)return this.modifiers.register(e,t);if(e.prototype instanceof or)return this.sensors.register(e,t);if(e.prototype instanceof Xe)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof mn)return e instanceof $t?this.draggables.unregister(e.id,e):e instanceof Ft?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Mc)return this.modifiers.unregister(e);if(e.prototype instanceof or)return this.sensors.unregister(e);if(e.prototype instanceof Xe)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},Zf,Yf,Gf,Kf,Xf,Jf,Qf,ep,tp,Dr,no,Yn,Pe,il,al,ll,cl,ul,Tr;tp=[He],ep=[fe],Qf=[fe],Jf=[fe],Xf=[fe],Kf=[fe],Gf=[He],Yf=[He],Zf=[He];var Mt=class{constructor(e){ie(Pe,5,this),Se(this,Dr),Se(this,no),Se(this,Yn,new Dn(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new Xt,Se(this,il,ie(Pe,8,this,!1)),ie(Pe,11,this),Se(this,al,ie(Pe,12,this,null)),ie(Pe,15,this),Se(this,ll,ie(Pe,16,this,null)),ie(Pe,19,this),Se(this,cl,ie(Pe,20,this,null)),ie(Pe,23,this),Se(this,ul,ie(Pe,24,this,[])),ie(Pe,27,this),this.position=new Ho({x:0,y:0}),Se(this,Tr,{x:0,y:0}),Ct(this,Dr,e)}get shape(){const{current:e,initial:t,previous:n}=qe(this,Yn);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?qe(this,Yn).current=e:qe(this,Yn).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=qe(this,Dr).registry.draggables.get(t);return n&&Ct(this,no,n),(e=n??qe(this,no))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=qe(this,Dr).registry.droppables.get(t))!=null?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const r of this.modifiers)n=r.apply(bf(yf({},this.snapshot()),{transform:n}));return Ct(this,Tr,n),n}snapshot(){return xe(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:qe(this,Tr),shape:this.shape?oi(this.shape):null,position:oi(this.position),status:oi(this.status),canceled:this.canceled}))}reset(){Te(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,qe(this,Yn).reset(),this.position.reset({x:0,y:0}),Ct(this,Tr,{x:0,y:0}),this.modifiers=[]})}};Pe=gr(null);Dr=new WeakMap;no=new WeakMap;Yn=new WeakMap;il=new WeakMap;al=new WeakMap;ll=new WeakMap;cl=new WeakMap;ul=new WeakMap;Tr=new WeakMap;pe(Pe,2,"shape",tp,Mt);pe(Pe,4,"canceled",ep,Mt,il);pe(Pe,4,"activatorEvent",Qf,Mt,al);pe(Pe,4,"sourceIdentifier",Jf,Mt,ll);pe(Pe,4,"targetIdentifier",Xf,Mt,cl);pe(Pe,4,"modifiers",Kf,Mt,ul);pe(Pe,2,"source",Gf,Mt);pe(Pe,2,"target",Yf,Mt);pe(Pe,2,"transform",Zf,Mt);Tn(Pe,Mt);var E_={get rendering(){return Promise.resolve()}},C_=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(d=>d.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};const{plugins:n=[],sensors:r=[],modifiers:s=[],renderer:o=E_}=t??{},i=new w_(this),a=new I_(this);this.registry=a,this.monitor=i,this.renderer=o,this.actions=new k_(this),this.dragOperation=new Mt(this),this.collisionObserver=new __(this),this.plugins=[S_,...n],this.modifiers=s,this.sensors=r;const{destroy:l}=this,u=xs(()=>{var d,f,p;const v=xe(()=>this.dragOperation.modifiers),g=this.modifiers;v!==g&&v.forEach(m=>m.destroy()),this.dragOperation.modifiers=(p=(f=(d=this.dragOperation.source)==null?void 0:d.modifiers)==null?void 0:f.map(m=>{const{plugin:w,options:S}=Ua(m);return new w(this,S)}))!=null?p:g});this.destroy=()=>{u(),l()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}},np=e=>{throw TypeError(e)},dl=(e,t,n)=>t.has(e)||np("Cannot "+n),ce=(e,t,n)=>(dl(e,t,"read from private field"),t.get(e)),ct=(e,t,n)=>t.has(e)?np("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ft=(e,t,n,r)=>(dl(e,t,"write to private field"),t.set(e,n),n),rp=(e,t,n)=>(dl(e,t,"access private method"),n);function Wo(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function sp(e,t){const n=e.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:s}=r,i=(Wo(s)?s.getKeyframes():[]).filter(t);if(i.length>0)return[i[i.length-1],r]}return null}function Uo(e){const{width:t,height:n,top:r,left:s,bottom:o,right:i}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:s,bottom:o,right:i}}var op=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pl(e){return"nodeType"in e}function Jt(e){var t,n,r;return e?fl(e)?e:pl(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function ip(e){const{Document:t}=Jt(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function Pn(e){return!e||fl(e)?!1:e instanceof Jt(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function ap(e){return e instanceof Jt(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function Bt(e){return e?fl(e)?e.document:pl(e)?ip(e)?e:Pn(e)||ap(e)?e.ownerDocument:document:document:document}function j_(e){const{documentElement:t}=Bt(e),n=t.clientWidth,r=t.clientHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function P_(e,t){if(A_(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);return n==="visible"&&r==="visible"&&s==="visible"}function A_(e){return e.tagName==="DETAILS"}function as(e,t=e.getBoundingClientRect(),n=0){var r;let s=t;const{ownerDocument:o}=e,i=(r=o.defaultView)!=null?r:window;let a=e.parentElement;for(;a&&a!==o.documentElement;){if(!P_(a)){const p=a.getBoundingClientRect(),v=n*(p.bottom-p.top),g=n*(p.right-p.left),m=n*(p.bottom-p.top),w=n*(p.right-p.left);s={top:Math.max(s.top,p.top-v),right:Math.min(s.right,p.right+g),bottom:Math.min(s.bottom,p.bottom+m),left:Math.max(s.left,p.left-w),width:0,height:0},s.width=s.right-s.left,s.height=s.bottom-s.top}a=a.parentElement}const l=i.innerWidth,u=i.innerHeight,d=n*u,f=n*l;return s={top:Math.max(s.top,0-d),right:Math.min(s.right,l+f),bottom:Math.min(s.bottom,u+d),left:Math.max(s.left,0-f),width:0,height:0},s.width=s.right-s.left,s.height=s.bottom-s.top,s.width<0&&(s.width=0),s.height<0&&(s.height=0),s}function lp(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function O_(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((o,i)=>{const a=r[i];if(Dc(o)&&Dc(a)&&(o.type!=="file"&&(o.value=a.value),o.type==="radio"&&o.name&&(o.name=`Cloned__${o.name}`)),Tc(o)&&Tc(a)&&a.width>0&&a.height>0){const l=o.getContext("2d");l==null||l.drawImage(a,0,0)}}),n}function Dc(e){return"value"in e}function Tc(e){return e.tagName==="CANVAS"}function cp(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(M_(r)){const{contentDocument:s}=r;if(s){const{left:o,top:i}=r.getBoundingClientRect();return cp(s,{x:t-o,y:n-i})}}return r}function M_(e){return(e==null?void 0:e.tagName)==="IFRAME"}var Gi=new WeakMap,up=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:s}]=e;t.removeEventListener(n,r,s)}this.entries.clear()}}bind(e,t){const n=Array.isArray(t)?t:[t],r=[];for(const s of n){const{type:o,listener:i,options:a}=s,l=[e,s];e.addEventListener(o,i,a),this.entries.add(l),r.push(l)}return function(){for(const[o,{type:i,listener:a,options:l}]of r)o.removeEventListener(i,a,l)}}};function ir(e){const t=e==null?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function D_(e){const t=new Set;let n=ir(e);for(;n;)t.add(n),n=ir(n);return t}function T_(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function dp(e,t){const n=()=>performance.now();let r,s;return function(...o){const i=this;s?(r==null||r(),r=T_(()=>{e.apply(i,o),s=n()},t-(n()-s))):(e.apply(i,o),s=n())}}function R_(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function L_(e,t=e.getBoundingClientRect()){const{width:n,height:r}=as(e,t);return n>0&&r>0}var N_=op?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},ro,z_=class extends N_{constructor(e){super(t=>{if(!ce(this,ro)){ft(this,ro,!0);return}e(t,this)}),ct(this,ro,!1)}};ro=new WeakMap;var Rc=Array.from({length:100},(e,t)=>t/100),fp=75,xn,bo,on,wn,Rr,Ue,Gr,Lr,_o,pp,hp,gp=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,ct(this,_o),this.disconnect=()=>{var o,i,a;ft(this,Gr,!0),(o=ce(this,on))==null||o.disconnect(),(i=ce(this,wn))==null||i.disconnect(),ce(this,Rr).disconnect(),(a=ce(this,Ue))==null||a.remove()},ct(this,xn,!0),ct(this,bo),ct(this,on),ct(this,wn),ct(this,Rr),ct(this,Ue),ct(this,Gr,!1),ct(this,Lr,dp(()=>{var o,i,a;const{element:l}=this;if((o=ce(this,wn))==null||o.disconnect(),ce(this,Gr)||!ce(this,xn)||!l.isConnected)return;const u=(i=l.ownerDocument)!=null?i:document,{innerHeight:d,innerWidth:f}=(a=u.defaultView)!=null?a:window,p=l.getBoundingClientRect(),v=as(l,p),{top:g,left:m,bottom:w,right:S}=v,k=-Math.floor(g),y=-Math.floor(m),b=-Math.floor(f-S),C=-Math.floor(d-w),j=`${k}px ${b}px ${C}px ${y}px`;this.boundingClientRect=p,ft(this,wn,new IntersectionObserver(O=>{const[_]=O,{intersectionRect:I}=_;(_.intersectionRatio!==1?_.intersectionRatio:At.intersectionRatio(I,as(l)))!==1&&ce(this,Lr).call(this)},{threshold:Rc,rootMargin:j,root:u})),ce(this,wn).observe(l),rp(this,_o,pp).call(this)},fp)),this.boundingClientRect=e.getBoundingClientRect(),ft(this,xn,L_(e,this.boundingClientRect));let r=!0;this.callback=o=>{r&&(r=!1,n.skipInitial)||t(o)};const s=e.ownerDocument;n!=null&&n.debug&&(ft(this,Ue,document.createElement("div")),ce(this,Ue).style.background="rgba(0,0,0,0.15)",ce(this,Ue).style.position="fixed",ce(this,Ue).style.pointerEvents="none",s.body.appendChild(ce(this,Ue))),ft(this,Rr,new IntersectionObserver(o=>{var i,a;const l=o[o.length-1],{boundingClientRect:u,isIntersecting:d}=l,{width:f,height:p}=u,v=ce(this,xn);ft(this,xn,d),!(!f&&!p)&&(v&&!d?((i=ce(this,wn))==null||i.disconnect(),this.callback(null),(a=ce(this,on))==null||a.disconnect(),ft(this,on,void 0),ce(this,Ue)&&(ce(this,Ue).style.visibility="hidden")):ce(this,Lr).call(this),d&&!ce(this,on)&&(ft(this,on,new z_(ce(this,Lr))),ce(this,on).observe(e)))},{threshold:Rc,root:s})),ce(this,xn)&&!n.skipInitial&&this.callback(this.boundingClientRect),ce(this,Rr).observe(e)}};xn=new WeakMap;bo=new WeakMap;on=new WeakMap;wn=new WeakMap;Rr=new WeakMap;Ue=new WeakMap;Gr=new WeakMap;Lr=new WeakMap;_o=new WeakSet;pp=function(){ce(this,Gr)||(rp(this,_o,hp).call(this),!R_(this.boundingClientRect,ce(this,bo))&&(this.callback(this.boundingClientRect),ft(this,bo,this.boundingClientRect)))};hp=function(){if(ce(this,Ue)){const{top:e,left:t,width:n,height:r}=as(this.element);ce(this,Ue).style.overflow="hidden",ce(this,Ue).style.visibility="visible",ce(this,Ue).style.top=`${Math.floor(e)}px`,ce(this,Ue).style.left=`${Math.floor(t)}px`,ce(this,Ue).style.width=`${Math.floor(n)}px`,ce(this,Ue).style.height=`${Math.floor(r)}px`}};var Ls=new WeakMap,Ns=new WeakMap;function $_(e,t){let n=Ls.get(e);return n||(n={disconnect:new gp(e,s=>{const o=Ls.get(e);o&&o.callbacks.forEach(i=>i(s))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),Ls.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(Ls.delete(e),n.disconnect())}}function F_(e,t){const n=new Set;for(const r of e){const s=$_(r,t);n.add(s)}return()=>n.forEach(r=>r())}function B_(e,t){var n;const r=e.ownerDocument;if(!Ns.has(r)){const i=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(u=>u(l)),{capture:!0,passive:!0,signal:i.signal}),Ns.set(r,{disconnect:()=>i.abort(),listeners:a})}const{listeners:s,disconnect:o}=(n=Ns.get(r))!=null?n:{};return!s||!o?()=>{}:(s.add(t),()=>{s.delete(t),s.size===0&&(o(),Ns.delete(r))})}var Nr,zr,so,Ki,H_=class{constructor(e,t,n){this.callback=t,ct(this,Nr),ct(this,zr,!1),ct(this,so),ct(this,Ki,dp(i=>{if(!ce(this,zr)&&i.target&&"contains"in i.target&&typeof i.target.contains=="function"){for(const a of ce(this,so))if(i.target.contains(a)){this.callback(ce(this,Nr).boundingClientRect);break}}},fp));const r=D_(e),s=F_(r,t),o=B_(e,ce(this,Ki));ft(this,so,r),ft(this,Nr,new gp(e,t,n)),this.disconnect=()=>{ce(this,zr)||(ft(this,zr,!0),s(),o(),ce(this,Nr).disconnect())}}};Nr=new WeakMap;zr=new WeakMap;so=new WeakMap;Ki=new WeakMap;function Xi(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function $r(e){try{Xi(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function Lc(e){return!op||!e?!1:e===Bt(e).scrollingElement}function vp(e){const t=Jt(e),n=Lc(e)?j_(e):Uo(e),r=Lc(e)?{height:t.innerHeight,width:t.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-r.width,y:e.scrollHeight-r.height}},o=s.current.y<=0,i=s.current.x<=0,a=s.current.y>=s.max.y,l=s.current.x>=s.max.x;return{rect:n,position:s,isTop:o,isLeft:i,isBottom:a,isRight:l}}function V_(e,t){const{isTop:n,isBottom:r,isLeft:s,isRight:o,position:i}=vp(e),{x:a,y:l}=t??{x:0,y:0},u=!n&&i.current.y+l>0,d=!r&&i.current.y+l<i.max.y,f=!s&&i.current.x+a>0,p=!o&&i.current.x+a<i.max.x;return{top:u,bottom:d,left:f,right:p,x:f||p,y:u||d}}var hl=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const s of n)s();for(const s of r)s()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},xo=new hl(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),W_=new hl(e=>setTimeout(e,50)),wo=new Map,U_=wo.clear.bind(wo);function Ot(e,t=!1){if(!t)return Nc(e);let n=wo.get(e);return n||(n=Nc(e),wo.set(e,n),W_.schedule(U_),n)}function Nc(e){return Jt(e).getComputedStyle(e)}function q_(e,t=Ot(e,!0)){return t.position==="fixed"||t.position==="sticky"}function Z_(e,t=Ot(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?n.test(o):!1})}var Y_={excludeElement:!0};function Ji(e,t=Y_){const{limit:n,excludeElement:r}=t,s=new Set;function o(i){if(n!=null&&s.size>=n||!i)return s;if(ip(i)&&i.scrollingElement!=null&&!s.has(i.scrollingElement))return s.add(i.scrollingElement),s;if(!Pn(i))return ap(i)?o(i.parentElement):s;if(s.has(i))return s;const a=Ot(i,!0);if(r&&i===e||Z_(i,a)&&s.add(i),q_(i,a)){const{scrollingElement:l}=i.ownerDocument;return l&&s.add(l),s}return o(i.parentNode)}return e?o(e):s}function G_(e){const[t]=Ji(e,{limit:1});return t??null}function ar(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=ir(e);for(;r;){if(r===t)return n;const s=Uo(r),{x:o,y:i}=K_(r,s);n.x=n.x+s.left,n.y=n.y+s.top,n.scaleX=n.scaleX*o,n.scaleY=n.scaleY*i,r=ir(r)}return n}function K_(e,t=Uo(e)){const n=Math.round(t.width),r=Math.round(t.height);if(Pn(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const s=Ot(e,!0);return{x:(parseFloat(s.width)||n)/n,y:(parseFloat(s.height)||r)/r}}function X_(e){if(e==="none")return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function ls(e){if(e==="none")return null;const[t,n,r="0"]=e.split(" "),s={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(s.x)&&isNaN(s.y)?null:{x:isNaN(s.x)?0:s.x,y:isNaN(s.y)?0:s.y,z:isNaN(s.z)?0:s.z}}function gl(e){var t,n,r,s,o,i,a,l,u;const{scale:d,transform:f,translate:p}=e,v=X_(d),g=ls(p),m=J_(f);if(!m&&!v&&!g)return null;const w={x:(t=v==null?void 0:v.x)!=null?t:1,y:(n=v==null?void 0:v.y)!=null?n:1},S={x:(r=g==null?void 0:g.x)!=null?r:0,y:(s=g==null?void 0:g.y)!=null?s:0},k={x:(o=m==null?void 0:m.x)!=null?o:0,y:(i=m==null?void 0:m.y)!=null?i:0,scaleX:(a=m==null?void 0:m.scaleX)!=null?a:1,scaleY:(l=m==null?void 0:m.scaleY)!=null?l:1};return{x:S.x+k.x,y:S.y+k.y,z:(u=g==null?void 0:g.z)!=null?u:0,scaleX:w.x*k.scaleX,scaleY:w.y*k.scaleY}}function J_(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var _t=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(_t||{}),Q_={x:.2,y:.2},ex={x:10,y:10};function tx(e,t,n,r=25,s=Q_,o=ex){const{x:i,y:a}=t,{rect:l,isTop:u,isBottom:d,isLeft:f,isRight:p}=vp(e),v=ar(e),g=Ot(e,!0),m=gl(g),w=m!==null?(m==null?void 0:m.scaleX)<0:!1,S=m!==null?(m==null?void 0:m.scaleY)<0:!1,k=new At(l.left*v.scaleX+v.x,l.top*v.scaleY+v.y,l.width*v.scaleX,l.height*v.scaleY),y={x:0,y:0},b={x:0,y:0},C={height:k.height*s.y,width:k.width*s.x};return(!u||S&&!d)&&a<=k.top+C.height&&(n==null?void 0:n.y)!==1&&i>=k.left-o.x&&i<=k.right+o.x?(y.y=S?1:-1,b.y=r*Math.abs((k.top+C.height-a)/C.height)):(!d||S&&!u)&&a>=k.bottom-C.height&&(n==null?void 0:n.y)!==-1&&i>=k.left-o.x&&i<=k.right+o.x&&(y.y=S?-1:1,b.y=r*Math.abs((k.bottom-C.height-a)/C.height)),(!p||w&&!f)&&i>=k.right-C.width&&(n==null?void 0:n.x)!==-1&&a>=k.top-o.y&&a<=k.bottom+o.y?(y.x=w?-1:1,b.x=r*Math.abs((k.right-C.width-i)/C.width)):(!f||w&&!p)&&i<=k.left+C.width&&(n==null?void 0:n.x)!==1&&a>=k.top-o.y&&a<=k.bottom+o.y&&(y.x=w?1:-1,b.x=r*Math.abs((k.left+C.width-i)/C.width)),{direction:y,speed:b}}function nx(e){return"scrollIntoViewIfNeeded"in e&&typeof e.scrollIntoViewIfNeeded=="function"}function mp(e,t=!1){if(nx(e)){e.scrollIntoViewIfNeeded(t);return}if(!Pn(e))return e.scrollIntoView();var n=G_(e);if(!Pn(n))return;const r=Ot(n,!0),s=parseInt(r.getPropertyValue("border-top-width")),o=parseInt(r.getPropertyValue("border-left-width")),i=e.offsetTop-n.offsetTop<n.scrollTop,a=e.offsetTop-n.offsetTop+e.clientHeight-s>n.scrollTop+n.clientHeight,l=e.offsetLeft-n.offsetLeft<n.scrollLeft,u=e.offsetLeft-n.offsetLeft+e.clientWidth-o>n.scrollLeft+n.clientWidth,d=i&&!a;(i||a)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-s+e.clientHeight/2),(l||u)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-o+e.clientWidth/2),(i||a||l||u)&&!t&&e.scrollIntoView(d)}function rx(e,t,n){const{scaleX:r,scaleY:s,x:o,y:i}=t,a=e.left+o+(1-r)*parseFloat(n),l=e.top+i+(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width*r:e.width,d=s?e.height*s:e.height;return{width:u,height:d,top:l,right:a+u,bottom:l+d,left:a}}function sx(e,t,n){const{scaleX:r,scaleY:s,x:o,y:i}=t,a=e.left-o-(1-r)*parseFloat(n),l=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width/r:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:l,right:a+u,bottom:l+d,left:a}}function yp({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function zc(e,t=Ot(e).translate,n=!0){if(n){const r=sp(e,s=>"translate"in s);if(r){const{translate:s=""}=r[0];if(typeof s=="string"){const o=ls(s);if(o)return o}}}if(t){const r=ls(t);if(r)return r}return{x:0,y:0,z:0}}var ox=new hl(e=>setTimeout(e,0)),Kr=new Map,ix=Kr.clear.bind(Kr);function ax(e){const t=e.ownerDocument;let n=Kr.get(t);if(n)return n;n=t.getAnimations(),Kr.set(t,n),ox.schedule(ix);const r=n.filter(s=>Wo(s.effect)&&s.effect.target===e);return Kr.set(e,r),n}function lx(e,t){const n=ax(e).filter(r=>{var s,o;if(Wo(r.effect)){const{target:i}=r.effect;if((o=i&&((s=t.isValidTarget)==null?void 0:s.call(t,i)))!=null?o:!0)return r.effect.getKeyframes().some(l=>{for(const u of t.properties)if(l[u])return!0})}}).map(r=>{const{effect:s,currentTime:o}=r,i=s==null?void 0:s.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof i=="number"&&typeof o=="number"&&o<i)return r.currentTime=i,()=>{r.currentTime=o}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var It=class extends At{constructor(e,t={}){var n,r,s,o;const{frameTransform:i=ar(e),ignoreTransforms:a,getBoundingClientRect:l=Uo}=t,u=lx(e,{properties:["transform","translate","scale","width","height"],isValidTarget:C=>(C!==e||lp())&&C.contains(e)}),d=l(e);let{top:f,left:p,width:v,height:g}=d,m;const w=Ot(e),S=gl(w),k={x:(n=S==null?void 0:S.scaleX)!=null?n:1,y:(r=S==null?void 0:S.scaleY)!=null?r:1},y=cx(e,w);u==null||u(),S&&(m=sx(d,S,w.transformOrigin),(a||y)&&(f=m.top,p=m.left,v=m.width,g=m.height));const b={width:(s=m==null?void 0:m.width)!=null?s:v,height:(o=m==null?void 0:m.height)!=null?o:g};if(y&&!a&&m){const C=rx(m,y,w.transformOrigin);f=C.top,p=C.left,v=C.width,g=C.height,k.x=y.scaleX,k.y=y.scaleY}i&&(a||(p*=i.scaleX,v*=i.scaleX,f*=i.scaleY,g*=i.scaleY),p+=i.x,f+=i.y),super(p,f,v,g),this.scale=k,this.intrinsicWidth=b.width,this.intrinsicHeight=b.height}};function cx(e,t){var n;const r=e.getAnimations();let s=null;if(!r.length)return null;for(const o of r){if(o.playState!=="running")continue;const i=Wo(o.effect)?o.effect.getKeyframes():[],a=i[i.length-1];if(!a)continue;const{transform:l,translate:u,scale:d}=a;if(l||u||d){const f=gl({transform:typeof l=="string"&&l?l:t.transform,translate:typeof u=="string"&&u?u:t.translate,scale:typeof d=="string"&&d?d:t.scale});f&&(s=s?{x:s.x+f.x,y:s.y+f.y,z:(n=s.z)!=null?n:f.z,scaleX:s.scaleX*f.scaleX,scaleY:s.scaleY*f.scaleY}:f)}}return s}function Xr(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var ux=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(Xr(n))for(const[r,s]of Object.entries(e)){const o=`${t}${r}`;this.initial.has(o)||this.initial.set(o,n.style.getPropertyValue(o)),n.style.setProperty(o,typeof s=="string"?s:`${s}px`)}}remove(e,t=""){const{element:n}=this;if(Xr(n))for(const r of e){const s=`${t}${r}`;n.style.removeProperty(s)}}reset(){const{element:e}=this;if(Xr(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function vr(e){return e?e instanceof Jt(e).Element||pl(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function cs(e){if(!e)return!1;const{KeyboardEvent:t}=Jt(e.target);return e instanceof t}function dx(e){if(!e)return!1;const{PointerEvent:t}=Jt(e.target);return e instanceof t}function fx(e){if(!vr(e))return!1;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||px(e)}function px(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var li={};function Qi(e){const t=li[e]==null?0:li[e]+1;return li[e]=t,`${e}-${t}`}var hx=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=tt.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},gx=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:s}=e,o=tt.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Ht.ShapeIntersection,priority:bt.Normal}}return null},bp=e=>{var t;return(t=hx(e))!=null?t:gx(e)},vx=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const o=r?At.from(r.current.boundingRectangle).corners:void 0,a=At.from(n.shape.boundingRectangle).corners.reduce((l,u,d)=>{var f;return l+tt.distance(tt.from(u),(f=o==null?void 0:o[d])!=null?f:s.current)},0)/4;return{id:n.id,value:1/a,type:Ht.Collision,priority:bt.Normal}},mx=Object.create,vl=Object.defineProperty,yx=Object.defineProperties,bx=Object.getOwnPropertyDescriptor,_x=Object.getOwnPropertyDescriptors,So=Object.getOwnPropertySymbols,_p=Object.prototype.hasOwnProperty,xp=Object.prototype.propertyIsEnumerable,wp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),mr=e=>{throw TypeError(e)},ea=(e,t,n)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,us=(e,t)=>{for(var n in t||(t={}))_p.call(t,n)&&ea(e,n,t[n]);if(So)for(var n of So(t))xp.call(t,n)&&ea(e,n,t[n]);return e},ml=(e,t)=>yx(e,_x(t)),$c=(e,t)=>vl(e,"name",{value:t,configurable:!0}),Sp=(e,t)=>{var n={};for(var r in e)_p.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&So)for(var r of So(e))t.indexOf(r)<0&&xp.call(e,r)&&(n[r]=e[r]);return n},Ss=e=>{var t;return[,,,mx((t=e==null?void 0:e[wp("metadata")])!=null?t:null)]},kp=["class","method","getter","setter","accessor","field","value","get","set"],Fr=e=>e!==void 0&&typeof e!="function"?mr("Function expected"):e,xx=(e,t,n,r,s)=>({kind:kp[e],name:t,metadata:r,addInitializer:o=>n._?mr("Already initialized"):s.push(Fr(o||null))}),yr=(e,t)=>ea(t,wp("metadata"),e[3]),Ve=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},Qt=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=kp[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&bx(f<4?s:{get[n](){return Ze(this,o)},set[n](b){return Pt(this,o,b)}},n));f?v&&f<4&&$c(o,(f>2?"set ":f>1?"get ":"")+n):$c(s,n);for(var y=r.length-1;y>=0;y--)u=xx(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>wx(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?Ze:ta)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,C)=>Pt(b,s,C,f^4?o:k.set):(b,C)=>b[n]=C)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Fr(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?mr("Object expected"):(Fr(i=a.get)&&(k.get=i),Fr(i=a.set)&&(k.set=i),Fr(i=a.init)&&w.unshift(i));return f||yr(e,s),k&&vl(s,n,k),v?f^4?o:k:s},yl=(e,t,n)=>t.has(e)||mr("Cannot "+n),wx=(e,t)=>Object(t)!==t?mr('Cannot use the "in" operator on this value'):e.has(t),Ze=(e,t,n)=>(yl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?mr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pt=(e,t,n,r)=>(yl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ta=(e,t,n)=>(yl(e,t,"access private method"),n),Fc={role:"button",roleDescription:"draggable"},Sx="dnd-kit-description",kx="dnd-kit-announcement",Ix={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},Ex={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===(t==null?void 0:t.id)))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function Cx(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function jx(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function Px(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var Ax=["dragover","dragmove"],Ox=class extends Xe{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=Sx,announcement:s=kx}={},announcements:o=Ex,screenReaderInstructions:i=Ix,debounce:a=500}=t??{},l=n?`${r}-${n}`:Qi(r),u=n?`${s}-${n}`:Qi(s);let d,f,p,v;const g=(C=v)=>{!p||!C||(p==null?void 0:p.nodeValue)!==C&&(p.nodeValue=C)},m=()=>xo.schedule(g),w=Mx(m,a),S=Object.entries(o).map(([C,j])=>this.manager.monitor.addEventListener(C,(O,_)=>{const I=p;if(!I)return;const x=j==null?void 0:j(O,_);x&&I.nodeValue!==x&&(v=x,Ax.includes(C)?w():(m(),w.cancel()))})),k=()=>{let C=[];d!=null&&d.isConnected||(d=jx(l,i.draggable),C.push(d)),f!=null&&f.isConnected||(f=Px(u),p=document.createTextNode(""),f.appendChild(p),C.push(f)),C.length>0&&document.body.append(...C)},y=new Set;function b(){for(const C of y)C()}this.registerEffect(()=>{var C;y.clear();for(const j of this.manager.registry.draggables.value){const O=(C=j.handle)!=null?C:j.element;if(O){(!d||!f)&&y.add(k),(!Cx(O)||lp())&&!O.hasAttribute("tabindex")&&y.add(()=>O.setAttribute("tabindex","0")),!O.hasAttribute("role")&&O.tagName.toLowerCase()!=="button"&&y.add(()=>O.setAttribute("role",Fc.role)),O.hasAttribute("aria-roledescription")||y.add(()=>O.setAttribute("aria-roledescription",Fc.roleDescription)),O.hasAttribute("aria-describedby")||y.add(()=>O.setAttribute("aria-describedby",l));for(const I of["aria-pressed","aria-grabbed"]){const x=String(j.isDragging);O.getAttribute(I)!==x&&y.add(()=>O.setAttribute(I,x))}const _=String(j.disabled);O.getAttribute("aria-disabled")!==_&&y.add(()=>O.setAttribute("aria-disabled",_))}}y.size>0&&xo.schedule(b)}),this.destroy=()=>{super.destroy(),d==null||d.remove(),f==null||f.remove(),S.forEach(C=>C())}}};function Mx(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var Dx=class extends Xe{constructor(e,t){super(e,t),this.manager=e;const n=mo(()=>{var r;return Bt((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=dt(()=>{var r;const{dragOperation:s}=this.manager,{cursor:o="grabbing",nonce:i}=(r=this.options)!=null?r:{};if(s.status.initialized){const a=n.value,l=a.createElement("style");return i&&l.setAttribute("nonce",i),l.textContent=`* { cursor: ${o} !important; }`,a.head.appendChild(l),()=>l.remove()}})}},ks="data-dnd-",na=`${ks}dropping`,et="--dnd-",Nt=`${ks}dragging`,ko=`${ks}placeholder`,Tx=[Nt,ko,"popover","aria-pressed","aria-grabbing"],Rx=["view-transition-name"],Lx=`
95
+ :root [${Nt}] {
96
+ position: fixed !important;
97
+ pointer-events: none !important;
98
+ touch-action: none;
99
+ z-index: calc(infinity);
100
+ will-change: translate;
101
+ top: var(${et}top, 0px) !important;
102
+ left: var(${et}left, 0px) !important;
103
+ right: unset !important;
104
+ bottom: unset !important;
105
+ width: var(${et}width, auto);
106
+ max-width: var(${et}width, auto);
107
+ height: var(${et}height, auto);
108
+ max-height: var(${et}height, auto);
109
+ transition: var(${et}transition) !important;
110
+ }
111
+
112
+ :root [${ko}] {
113
+ transition: none;
114
+ }
115
+
116
+ :root [${ko}='hidden'] {
117
+ visibility: hidden;
118
+ }
119
+
120
+ [${Nt}] * {
121
+ pointer-events: none !important;
122
+ }
123
+
124
+ [${Nt}]:not([${na}]) {
125
+ translate: var(${et}translate) !important;
126
+ }
127
+
128
+ [${Nt}][style*='${et}scale'] {
129
+ scale: var(${et}scale) !important;
130
+ transform-origin: var(${et}transform-origin) !important;
131
+ }
132
+
133
+ @layer {
134
+ :where([${Nt}][popover]) {
135
+ overflow: visible;
136
+ background: unset;
137
+ border: unset;
138
+ margin: unset;
139
+ padding: unset;
140
+ color: inherit;
141
+
142
+ &:is(input, button) {
143
+ border: revert;
144
+ background: revert;
145
+ }
146
+ }
147
+ }
148
+ [${Nt}]::backdrop, [${ks}overlay]:not([${Nt}]) {
149
+ display: none;
150
+ visibility: hidden;
151
+ }
152
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Nx(e,t="hidden"){return xe(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const s=zx(n,r.registry.droppables),o=[],i=O_(n),{remove:a}=i;return $x(s,i,o),Fx(i,t),i.remove=()=>{o.forEach(l=>l()),a.call(i)},i})}function zx(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const s=`${ks}${Qi("dom-id")}`;r.element.setAttribute(s,""),n.set(r,s)}return n}function $x(e,t,n){for(const[r,s]of e){if(!r.element)continue;const o=`[${s}]`,i=t.matches(o)?t:t.querySelector(o);if(r.element.removeAttribute(s),!i)continue;const a=r.element;r.proxy=i,i.removeAttribute(s),Gi.set(a,i),n.push(()=>{Gi.delete(a),r.proxy=void 0})}}function Fx(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(ko,t)}function Bc(e,t){return e===t?!0:ir(e)===ir(t)}function Hc(e){const{target:t}=e;"newState"in e&&e.newState==="closed"&&vr(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>$r(t))}function Vc(e){return e.tagName==="TR"}var Io=new Map,Ip,ra,ds,bl,oo,Ep,Cp,fs=class extends(ra=Xe,Ip=[fe],ra){constructor(t,n){super(t,n),Ke(this,oo),Ke(this,bl,Ve(ds,8,this)),Ve(ds,11,this),this.state={initial:{},current:{}},this.registerEffect(ta(this,oo,Cp)),this.registerEffect(ta(this,oo,Ep))}destroy(){super.destroy();for(const[t,n]of Io.entries())n.instances.has(this)&&(n.instances.delete(this),n.instances.size===0&&(n.cleanup(),Io.delete(t)))}};ds=Ss(ra);bl=new WeakMap;oo=new WeakSet;Ep=function(){var e,t,n;const{state:r,manager:s,options:o}=this,{dragOperation:i}=s,{position:a,source:l,status:u}=i;if(u.idle){r.current={},r.initial={};return}if(!l)return;const{element:d,feedback:f}=l;if(!d||f==="none"||!u.initialized||u.initializing)return;const{initial:p}=r,v=(e=this.overlay)!=null?e:d,g=ar(v),m=ar(d),w=!Bc(d,v),S=new It(d,{frameTransform:w?m:null,ignoreTransforms:!w}),k={x:m.scaleX/g.scaleX,y:m.scaleY/g.scaleY};let{width:y,height:b,top:C,left:j}=S;w&&(y=y/k.x,b=b/k.y);let O,_;const I=new ux(v),{transition:x,translate:M,boxSizing:D,paddingBlockStart:L,paddingBlockEnd:N,paddingInlineStart:B,paddingInlineEnd:H,borderInlineStartWidth:G,borderInlineEndWidth:$,borderBlockStartWidth:Z,borderBlockEndWidth:F}=Ot(d),X=f==="clone",Q=D==="content-box",de=Q?parseInt(B)+parseInt(H)+parseInt(G)+parseInt($):0,ve=Q?parseInt(L)+parseInt(N)+parseInt(Z)+parseInt(F):0,re=f!=="move"&&!this.overlay?Nx(l,X?"clone":"hidden"):null,Je=xe(()=>cs(s.dragOperation.activatorEvent));if(M!=="none"){const ae=ls(M);ae&&!p.translate&&(p.translate=ae)}if(!p.transformOrigin){const ae=xe(()=>a.current);p.transformOrigin={x:(ae.x-j*g.scaleX-g.x)/(y*g.scaleX),y:(ae.y-C*g.scaleY-g.y)/(b*g.scaleY)}}const{transformOrigin:te}=p,W=C*g.scaleY+g.y,E=j*g.scaleX+g.x;if(!p.coordinates&&(p.coordinates={x:E,y:W},k.x!==1||k.y!==1)){const{scaleX:ae,scaleY:_e}=m,{x:Re,y:De}=te;p.coordinates.x+=(y*ae-y)*Re,p.coordinates.y+=(b*_e-b)*De}p.dimensions||(p.dimensions={width:y,height:b}),p.frameTransform||(p.frameTransform=g);const T={x:p.coordinates.x-E,y:p.coordinates.y-W},R={width:(p.dimensions.width*p.frameTransform.scaleX-y*g.scaleX)*te.x,height:(p.dimensions.height*p.frameTransform.scaleY-b*g.scaleY)*te.y},U={x:T.x/g.scaleX+R.width,y:T.y/g.scaleY+R.height},q={left:j+U.x,top:C+U.y};v.setAttribute(Nt,"true");const K=xe(()=>i.transform),oe=(t=p.translate)!=null?t:{x:0,y:0},me=K.x*g.scaleX+oe.x,ke=K.y*g.scaleY+oe.y,we=`${me}px ${ke}px 0`,Oe=x?`${x}, translate 0ms linear`:"";I.set({width:y-de,height:b-ve,top:q.top,left:q.left,translate:we,transition:Oe,scale:w?`${k.x} ${k.y}`:"","transform-origin":`${te.x*100}% ${te.y*100}%`},et),re&&(d.insertAdjacentElement("afterend",re),o!=null&&o.rootElement&&(typeof o.rootElement=="function"?o.rootElement(l):o.rootElement).appendChild(d)),Xi(v)&&(v.hasAttribute("popover")||v.setAttribute("popover","manual"),$r(v),v.addEventListener("beforetoggle",Hc));const Me=new ResizeObserver(()=>{if(!re)return;const ae=new It(re,{frameTransform:g,ignoreTransforms:!0}),_e=te??{x:1,y:1},Re=(y-ae.width)*_e.x+U.x,De=(b-ae.height)*_e.y+U.y;if(I.set({width:ae.width-de,height:ae.height-ve,top:C+De,left:j+Re},et),O==null||O.takeRecords(),Vc(d)&&Vc(re)){const Be=Array.from(d.cells),J=Array.from(re.cells);for(const[se,he]of Be.entries()){const Le=J[se];he.style.width=`${Le.offsetWidth}px`}}i.shape=new It(v)}),Ie=new It(v);xe(()=>i.shape=Ie);const ye=Jt(v),$e=ae=>{this.manager.actions.stop({event:ae})};Je&&ye.addEventListener("resize",$e),xe(()=>l.status)==="idle"&&requestAnimationFrame(()=>l.status="dragging"),re&&(Me.observe(re),O=new MutationObserver(ae=>{let _e=!1;for(const Re of ae){if(Re.target!==d){_e=!0;continue}if(Re.type!=="attributes")continue;const De=Re.attributeName;if(De.startsWith("aria-")||Tx.includes(De))continue;const Be=d.getAttribute(De);if(De==="style"){if(Xr(d)&&Xr(re)){const J=d.style;for(const se of Array.from(re.style))J.getPropertyValue(se)===""&&re.style.removeProperty(se);for(const se of Array.from(J)){if(Rx.includes(se)||se.startsWith(et))continue;const he=J.getPropertyValue(se);re.style.setProperty(se,he)}}}else Be!==null?re.setAttribute(De,Be):re.removeAttribute(De)}_e&&X&&(re.innerHTML=d.innerHTML)}),O.observe(d,{attributes:!0,subtree:!0,childList:!0}),_=new MutationObserver(ae=>{for(const _e of ae)if(_e.addedNodes.length!==0)for(const Re of Array.from(_e.addedNodes)){if(Re.contains(d)&&d.nextElementSibling!==re){d.insertAdjacentElement("afterend",re),$r(v);return}if(Re.contains(re)&&re.previousElementSibling!==d){re.insertAdjacentElement("beforebegin",d),$r(v);return}}}),_.observe(d.ownerDocument.body,{childList:!0,subtree:!0}));const gt=(n=s.dragOperation.source)==null?void 0:n.id,en=()=>{var ae;if(!Je||gt==null)return;const _e=s.registry.draggables.get(gt),Re=(ae=_e==null?void 0:_e.handle)!=null?ae:_e==null?void 0:_e.element;Pn(Re)&&Re.focus()},tn=()=>{O==null||O.disconnect(),_==null||_.disconnect(),Me.disconnect(),ye.removeEventListener("resize",$e),Xi(v)&&(v.removeEventListener("beforetoggle",Hc),v.removeAttribute("popover")),v.removeAttribute(Nt),I.reset(),l.status="idle";const ae=r.current.translate!=null;re&&(ae||re.parentElement!==v.parentElement)&&v.isConnected&&re.replaceWith(v),re==null||re.remove()},Vt=xs(()=>{var ae;const{transform:_e,status:Re}=i;if(!(!_e.x&&!_e.y&&!r.current.translate)&&Re.dragging){const De=(ae=p.translate)!=null?ae:{x:0,y:0},Be={x:_e.x/g.scaleX+De.x,y:_e.y/g.scaleY+De.y},J=r.current.translate,se=xe(()=>i.modifiers),he=xe(()=>{var vt;return(vt=i.shape)==null?void 0:vt.current}),Le=Je?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(I.set({transition:`${x}, translate ${Le}`,translate:`${Be.x}px ${Be.y}px 0`},et),O==null||O.takeRecords(),he&&he!==Ie&&J&&!se.length){const vt=tt.delta(Be,J);i.shape=At.from(he.boundingRectangle).translate(vt.x*g.scaleX,vt.y*g.scaleY)}else i.shape=new It(v);r.current.translate=Be}},function(){if(i.status.dropped){this.dispose(),l.status="dropping";let ae=r.current.translate;const _e=ae!=null;if(!ae&&d!==v&&(ae={x:0,y:0}),!ae){tn();return}const Re=()=>{var De,Be;{$r(v);const[,J]=(De=sp(v,Ce=>"translate"in Ce))!=null?De:[];J==null||J.pause();const se=re??d,he={frameTransform:Bc(v,se)?null:void 0},Le=new It(v,he),vt=(Be=ls(Ot(v).translate))!=null?Be:ae,St=new It(se,he),Os=At.delta(Le,St,l.alignment),Y={x:vt.x-Os.x,y:vt.y-Os.y},le=Math.round(Le.intrinsicHeight)!==Math.round(St.intrinsicHeight)?{minHeight:[`${Le.intrinsicHeight}px`,`${St.intrinsicHeight}px`],maxHeight:[`${Le.intrinsicHeight}px`,`${St.intrinsicHeight}px`]}:{},ue=Math.round(Le.intrinsicWidth)!==Math.round(St.intrinsicWidth)?{minWidth:[`${Le.intrinsicWidth}px`,`${St.intrinsicWidth}px`],maxWidth:[`${Le.intrinsicWidth}px`,`${St.intrinsicWidth}px`]}:{};I.set({transition:x},et),v.setAttribute(na,""),O==null||O.takeRecords(),yp({element:v,keyframes:ml(us(us({},le),ue),{translate:[`${vt.x}px ${vt.y}px 0`,`${Y.x}px ${Y.y}px 0`]}),options:{duration:_e||v!==d?250:0,easing:"ease"}}).then(()=>{v.removeAttribute(na),J==null||J.finish(),tn(),requestAnimationFrame(en)})}};s.renderer.rendering.then(Re)}});return()=>{tn(),Vt()}};Cp=function(){var e,t,n;const{status:r,source:s,target:o}=this.manager.dragOperation,{nonce:i}=(e=this.options)!=null?e:{};if(r.initializing){const a=Bt((t=s==null?void 0:s.element)!=null?t:null),l=Bt((n=o==null?void 0:o.element)!=null?n:null),u=new Set([a,l]);for(const d of u){let f=Io.get(d);if(!f){const p=document.createElement("style");p.textContent=Lx,i&&p.setAttribute("nonce",i),d.head.prepend(p);const v=new MutationObserver(g=>{for(const m of g)if(m.type==="childList"){const w=Array.from(m.removedNodes);w.length>0&&w.includes(p)&&d.head.prepend(p)}});v.observe(d.head,{childList:!0}),f={cleanup:()=>{v.disconnect(),p.remove()},instances:new Set},Io.set(d,f)}f.instances.add(this)}}};Qt(ds,4,"overlay",Ip,fs,bl);yr(ds,fs);fs.configure=Wa(fs);var Bx=fs,Er=!0,Hx=!1,jp,Pp,Ap,Op,un,_l,xl;Op=(Ap=[fe],_t.Forward),Pp=(jp=[fe],_t.Reverse);var ps=class{constructor(){Ke(this,_l,Ve(un,8,this,Er)),Ve(un,11,this),Ke(this,xl,Ve(un,12,this,Er)),Ve(un,15,this)}isLocked(e){return e===_t.Idle?!1:e==null?this[_t.Forward]===Er&&this[_t.Reverse]===Er:this[e]===Er}unlock(e){e!==_t.Idle&&(this[e]=Hx)}};un=Ss(null);_l=new WeakMap;xl=new WeakMap;Qt(un,4,Op,Ap,ps,_l);Qt(un,4,Pp,jp,ps,xl);yr(un,ps);var Vx=[_t.Forward,_t.Reverse],Wc=class{constructor(){this.x=new ps,this.y=new ps}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Wx=class extends Xe{constructor(e){super(e);const t=_s(new Wc);let n=null;this.signal=t,dt(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new Wc;return}const{delta:s}=e.dragOperation.position;if(n){const o={x:Uc(s.x,n.x),y:Uc(s.y,n.y)},i=t.peek();Te(()=>{for(const a of hf)for(const l of Vx)o[a]===l&&i[a].unlock(l);t.value=i})}n=s})}get current(){return this.signal.peek()}};function Uc(e,t){return Math.sign(e-t)}var Mp,sa,hs,wl,an,oa,Is=class extends(sa=Vo,Mp=[fe],sa){constructor(e){super(e),Ke(this,wl,Ve(hs,8,this,!1)),Ve(hs,11,this),Ke(this,an),Ke(this,oa,()=>{if(!Ze(this,an))return;const{element:o,by:i}=Ze(this,an);i.y&&(o.scrollTop+=i.y),i.x&&(o.scrollLeft+=i.x)}),this.scroll=o=>{var i;if(this.disabled)return!1;const a=this.getScrollableElements();if(!a)return Pt(this,an,void 0),!1;const{position:l}=this.manager.dragOperation,u=l==null?void 0:l.current;if(u){const{by:d}=o??{},f=d?{x:qc(d.x),y:qc(d.y)}:void 0,p=f?void 0:this.scrollIntentTracker.current;if(p!=null&&p.isLocked())return!1;for(const v of a){const g=V_(v,d);if(g.x||g.y){const{speed:m,direction:w}=tx(v,u,f);if(p)for(const S of hf)p[S].isLocked(w[S])&&(m[S]=0,w[S]=0);if(w.x||w.y){const{x:S,y:k}=d??w,y=S*m.x,b=k*m.y;if(y||b){const C=(i=Ze(this,an))==null?void 0:i.by;if(this.autoScrolling&&C&&(C.x&&!y||C.y&&!b))continue;return Pt(this,an,{element:v,by:{x:y,y:b}}),xo.schedule(Ze(this,oa)),!0}}}}}return Pt(this,an,void 0),!1};let t=null,n=null;const r=mo(()=>{const{position:o,source:i}=e.dragOperation;if(!o)return null;const a=cp(Bt(i==null?void 0:i.element),o.current);return a&&(t=a),a??t}),s=mo(()=>{const o=r.value,{documentElement:i}=Bt(o);if(!o||o===i){const{target:a}=e.dragOperation,l=a==null?void 0:a.element;if(l){const u=Ji(l,{excludeElement:!1});return n=u,u}}if(o){const a=Ji(o,{excludeElement:!1});return this.autoScrolling&&n&&a.size<(n==null?void 0:n.size)?n:(n=a,a)}return n=null,null},Yt);this.getScrollableElements=()=>s.value,this.scrollIntentTracker=new Wx(e),this.destroy=e.monitor.addEventListener("dragmove",o=>{this.disabled||o.defaultPrevented||!cs(e.dragOperation.activatorEvent)||!o.by||this.scroll({by:o.by})&&o.preventDefault()})}};hs=Ss(sa);wl=new WeakMap;an=new WeakMap;oa=new WeakMap;Qt(hs,4,"autoScrolling",Mp,Is,wl);yr(hs,Is);function qc(e){return e>0?_t.Forward:e<0?_t.Reverse:_t.Idle}var Ux=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of t)r();for(const r of n)r()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},qx=new Ux(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),Zx=10,Sl=class extends Xe{constructor(e,t){super(e);const n=e.registry.plugins.get(Is);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=dt(()=>{if(this.disabled)return;const{position:r,status:s}=e.dragOperation;if(s.dragging)if(n.scroll()){n.autoScrolling=!0;const i=setInterval(()=>qx.schedule(n.scroll),Zx);return()=>{clearInterval(i)}}else n.autoScrolling=!1})}},Zc={capture:!0,passive:!0},Br,Yx=class extends Vo{constructor(e){super(e),Ke(this,Br),this.handleScroll=()=>{Ze(this,Br)==null&&Pt(this,Br,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Pt(this,Br,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=dt(()=>{var n,r,s;if(t.status.dragging){const i=(s=(r=(n=t.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?s:document;return i.addEventListener("scroll",this.handleScroll,Zc),()=>{i.removeEventListener("scroll",this.handleScroll,Zc)}}})}};Br=new WeakMap;var Gx=class extends Xe{constructor(e,t){super(e,t),this.manager=e,this.destroy=dt(()=>{var n;const{dragOperation:r}=this.manager,{nonce:s}=(n=this.options)!=null?n:{};if(r.status.initialized){const o=document.createElement("style");return s&&o.setAttribute("nonce",s),o.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(o),ci(),document.addEventListener("selectionchange",ci,{capture:!0}),()=>{document.removeEventListener("selectionchange",ci,{capture:!0}),o.remove()}}})}};function ci(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var Hr=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},shouldActivate(e){var t;const{event:n,source:r}=e,s=(t=r.handle)!=null?t:r.element;return n.target===s}}),Gn,Eo=class extends or{constructor(t,n){super(t),this.manager=t,this.options=n,Ke(this,Gn,[]),this.listeners=new up,this.handleSourceKeyDown=(r,s,o)=>{if(this.disabled||r.defaultPrevented||!vr(r.target)||s.disabled)return;const{keyboardCodes:i=Hr.keyboardCodes,shouldActivate:a=Hr.shouldActivate}=o??{};i.start.includes(r.code)&&this.manager.dragOperation.status.idle&&a({event:r,source:s,manager:this.manager})&&this.handleStart(r,s,o)}}bind(t,n=this.options){return dt(()=>{var s;const o=(s=t.handle)!=null?s:t.element,i=a=>{cs(a)&&this.handleSourceKeyDown(a,t,n)};if(o)return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}})}handleStart(t,n,r){const{element:s}=n;if(!s)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),mp(s);const{center:o}=new It(s);if(this.manager.actions.start({event:t,coordinates:{x:o.x,y:o.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const a=Bt(s),l=[this.listeners.bind(a,[{type:"keydown",listener:u=>this.handleKeyDown(u,n,r),options:{capture:!0}}])];Ze(this,Gn).push(...l)}handleKeyDown(t,n,r){const{keyboardCodes:s=Hr.keyboardCodes}=r??{};if(Fn(t,[...s.end,...s.cancel])){t.preventDefault();const o=Fn(t,s.cancel);this.handleEnd(t,o);return}Fn(t,s.up)?this.handleMove("up",t):Fn(t,s.down)&&this.handleMove("down",t),Fn(t,s.left)?this.handleMove("left",t):Fn(t,s.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var r,s;const{shape:o}=this.manager.dragOperation,i=n.shiftKey?5:1;let a={x:0,y:0},l=(s=(r=this.options)==null?void 0:r.offset)!=null?s:Hr.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!o){switch(t){case"up":a={x:0,y:-l.y*i};break;case"down":a={x:0,y:l.y*i};break;case"left":a={x:-l.x*i,y:0};break;case"right":a={x:l.x*i,y:0};break}(a.x||a.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:a}))}}sideEffects(){const t=this.manager.registry.plugins.get(Sl);(t==null?void 0:t.disabled)===!1&&(t.disable(),Ze(this,Gn).push(()=>{t.enable()}))}cleanup(){Ze(this,Gn).forEach(t=>t()),Pt(this,Gn,[])}destroy(){this.cleanup(),this.listeners.clear()}};Gn=new WeakMap;Eo.configure=Wa(Eo);Eo.defaults=Hr;var Kx=Eo;function Fn(e,t){return t.includes(e.code)}var Dp=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:s}=e;if(!(r==="mouse"&&vr(s)&&(t.handle===s||(n=t.handle)!=null&&n.contains(s))))return r==="touch"?{delay:{value:250,tolerance:5}}:fx(s)&&!e.defaultPrevented?{delay:{value:200,tolerance:0}}:{delay:{value:200,tolerance:10},distance:{value:5}}}}),Kn,Xn,Co=class extends or{constructor(t,n){super(t),this.manager=t,this.options=n,Ke(this,Kn,new Set),Ke(this,Xn),this.listeners=new up,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:s}=this.latest;!r||!s||this.manager.actions.move({event:r,to:s})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n){var r;const{activationConstraints:s=Dp.activationConstraints}=(r=this.options)!=null?r:{};return typeof s=="function"?s(t,n):s}bind(t,n=this.options){return dt(()=>{var s;const o=new AbortController,{signal:i}=o,a=u=>{dx(u)&&this.handlePointerDown(u,t,n)};let l=[(s=t.handle)!=null?s:t.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(const u of l)u&&(Qx(u.ownerDocument.defaultView),u.addEventListener("pointerdown",a,{signal:i}));return()=>o.abort()})}handlePointerDown(t,n,r={}){if(this.disabled||!t.isPrimary||t.button!==0||!vr(t.target)||n.disabled||Xx(t)||!this.manager.dragOperation.status.idle)return;const{target:s}=t,o=Pn(s)&&s.draggable&&s.getAttribute("draggable")==="true",i=ar(n.element);this.initialCoordinates={x:t.clientX*i.scaleX+i.x,y:t.clientY*i.scaleY+i.y};const a=this.activationConstraints(t,n);if(t.sensor=this,!(a!=null&&a.delay)&&!(a!=null&&a.distance))this.handleStart(n,t);else{const{delay:f}=a;if(f){const p=setTimeout(()=>this.handleStart(n,t),f.value);Pt(this,Xn,()=>{clearTimeout(p),Pt(this,Xn,void 0)})}}const l=Bt(t.target),u=this.listeners.bind(l,[{type:"pointermove",listener:f=>this.handlePointerMove(f,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"dragstart",listener:o?this.handleCancel:zs,options:{capture:!0}}]),d=()=>{var f;u(),(f=Ze(this,Xn))==null||f.call(this),this.initialCoordinates=void 0};Ze(this,Kn).add(d)}handlePointerMove(t,n){const r={x:t.clientX,y:t.clientY},s=ar(n.element);if(r.x=r.x*s.scaleX+s.x,r.y=r.y*s.scaleY+s.y,this.manager.dragOperation.status.dragging){t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=r,xo.schedule(this.handleMove);return}if(!this.initialCoordinates)return;const o={x:r.x-this.initialCoordinates.x,y:r.y-this.initialCoordinates.y},i=this.activationConstraints(t,n),{distance:a,delay:l}=i??{};if(a){if(a.tolerance!=null&&ii(o,a.tolerance))return this.handleCancel(t);if(ii(o,a.value))return this.handleStart(n,t)}if(l&&ii(o,l.tolerance))return this.handleCancel(t)}handlePointerUp(t){const{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:t,canceled:r})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){var r;const{manager:s,initialCoordinates:o}=this;if((r=Ze(this,Xn))==null||r.call(this),!o||!s.dragOperation.status.idle||n.defaultPrevented)return;if(s.actions.start({coordinates:o,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();const a=Bt(n.target),l=a.body;l.setPointerCapture(n.pointerId);const u=this.listeners.bind(a,[{type:"touchmove",listener:zs,options:{passive:!1}},{type:"click",listener:zs},{type:"contextmenu",listener:zs},{type:"keydown",listener:this.handleKeyDown},{type:"lostpointercapture",listener:d=>{d.target===l&&this.handlePointerUp(d)}}]);Ze(this,Kn).add(u)}handleCancel(t){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Ze(this,Kn).forEach(t=>t()),Ze(this,Kn).clear()}destroy(){this.cleanup(),this.listeners.clear()}};Kn=new WeakMap;Xn=new WeakMap;Co.configure=Wa(Co);Co.defaults=Dp;var Tp=Co;function Xx(e){return"sensor"in e}function zs(e){e.preventDefault()}function Jx(){}var Yc=new WeakSet;function Qx(e){!e||Yc.has(e)||(e.addEventListener("touchmove",Jx,{capture:!1,passive:!1}),Yc.add(e))}var Cn={modifiers:[],plugins:[Ox,Sl,Dx,Bx,Gx],sensors:[Tp,Kx]},Rp=class extends C_{constructor(e={}){const{plugins:t=Cn.plugins,sensors:n=Cn.sensors,modifiers:r=[]}=e;super(ml(us({},e),{plugins:[Yx,Is,...t],sensors:n,modifiers:r}))}},Lp,Np,zp,ia,Et,kl,Il,El,br=class extends(ia=$t,zp=[fe],Np=[fe],Lp=[fe],ia){constructor(e,t){var n=e,{element:r,effects:s=()=>[],handle:o,feedback:i="default"}=n,a=Sp(n,["element","effects","handle","feedback"]);super(us({effects:()=>[...s(),()=>{var l,u;const{manager:d}=this;if(!d)return;const p=((u=(l=this.sensors)==null?void 0:l.map(Ua))!=null?u:[...d.sensors]).map(v=>{const g=v instanceof or?v:d.registry.register(v.plugin),m=v instanceof or?void 0:v.options;return g.bind(this,m)});return function(){p.forEach(g=>g())}}]},a),t),Ke(this,kl,Ve(Et,8,this)),Ve(Et,11,this),Ke(this,Il,Ve(Et,12,this)),Ve(Et,15,this),Ke(this,El,Ve(Et,16,this)),Ve(Et,19,this),this.element=r,this.handle=o,this.feedback=i}};Et=Ss(ia);kl=new WeakMap;Il=new WeakMap;El=new WeakMap;Qt(Et,4,"handle",zp,br,kl);Qt(Et,4,"element",Np,br,Il);Qt(Et,4,"feedback",Lp,br,El);yr(Et,br);var $p,Fp,aa,dn,Cl,ui,Bp,Hp,Jr,jl,qo=class extends(aa=Ft,Fp=[fe],$p=[fe],aa){constructor(e,t){var n=e,{element:r,effects:s=()=>[]}=n,o=Sp(n,["element","effects"]);const{collisionDetector:i=bp}=o,a=u=>{const{manager:d,element:f}=this;if(!f||u===null){this.shape=void 0;return}if(!d)return;const p=new It(f),v=xe(()=>this.shape);return p&&(v!=null&&v.equals(p))?v:(this.shape=p,p)},l=_s(!1);super(ml(us({},o),{collisionDetector:i,effects:()=>[...s(),()=>{const{element:u,manager:d}=this;if(!d)return;const{dragOperation:f}=d,{source:p}=f;l.value=!!(p&&f.status.initialized&&u&&!this.disabled&&this.accepts(p))},()=>{const{element:u}=this;if(l.value&&u){const d=new H_(u,a);return()=>{d.disconnect(),this.shape=void 0}}},()=>{var u;if((u=this.manager)!=null&&u.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),Ke(this,Jr),Ke(this,Cl,Ve(dn,8,this)),Ve(dn,11,this),Ke(this,jl,Ve(dn,12,this)),Ve(dn,15,this),this.element=r,this.refreshShape=()=>a()}set element(e){Pt(this,Jr,e,Hp)}get element(){var e;return(e=this.proxy)!=null?e:Ze(this,Jr,Bp)}};dn=Ss(aa);Cl=new WeakMap;Jr=new WeakSet;jl=new WeakMap;ui=Qt(dn,20,"#element",Fp,Jr,Cl),Bp=ui.get,Hp=ui.set;Qt(dn,4,"proxy",$p,qo,jl);yr(dn,qo);function e0(e){return e!=null&&typeof e=="object"&&"current"in e}function pn(e){var t;if(e!=null)return e0(e)?(t=e.current)!=null?t:void 0:e}var t0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_r=t0?h.useLayoutEffect:h.useEffect;function n0(){const e=h.useState(0)[1];return h.useCallback(()=>{e(t=>t+1)},[e])}function Pl(e,t){const n=h.useRef(new Map),r=n0();return _r(()=>{if(!e){n.current.clear();return}return dt(()=>{var s;let o=!1,i=!1;for(const a of n.current){const[l]=a,u=xe(()=>a[1]),d=e[l];u!==d&&(o=!0,n.current.set(l,d),i=(s=t==null?void 0:t(l,u,d))!=null?s:!1)}o&&(i?ms.flushSync(r):r())})},[e]),h.useMemo(()=>e&&new Proxy(e,{get(s,o){const i=s[o];return n.current.set(o,i),i}}),[e])}function r0(e,t){e()}function Bn(e){const t=h.useRef(e);return _r(()=>{t.current=e},[e]),t}function be(e,t,n=h.useEffect,r=Object.is){const s=h.useRef(e);n(()=>{const o=s.current;r(e,o)||(s.current=e,t(e,o))},[t,e])}function tr(e,t){const n=h.useRef(pn(e));_r(()=>{const r=pn(e);r!==n.current&&(n.current=r,t(r))})}var s0=Object.defineProperty,o0=Object.defineProperties,i0=Object.getOwnPropertyDescriptors,jo=Object.getOwnPropertySymbols,Vp=Object.prototype.hasOwnProperty,Wp=Object.prototype.propertyIsEnumerable,Gc=(e,t,n)=>t in e?s0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Up=(e,t)=>{for(var n in t||(t={}))Vp.call(t,n)&&Gc(e,n,t[n]);if(jo)for(var n of jo(t))Wp.call(t,n)&&Gc(e,n,t[n]);return e},qp=(e,t)=>o0(e,i0(t)),a0=(e,t)=>{var n={};for(var r in e)Vp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jo)for(var r of jo(e))t.indexOf(r)<0&&Wp.call(e,r)&&(n[r]=e[r]);return n},l0=new Rp,Zp=h.createContext(l0),c0=h.memo(h.forwardRef(({children:e},t)=>{const[n,r]=h.useState(0),s=h.useRef(null),o=h.useRef(null),i=h.useMemo(()=>({renderer:{get rendering(){var a;return(a=s.current)!=null?a:Promise.resolve()}},trackRendering(a){s.current||(s.current=new Promise(l=>{o.current=l})),h.startTransition(()=>{a(),r(l=>l+1)})}}),[]);return _r(()=>{var a;(a=o.current)==null||a.call(o),s.current=null},[e,n]),h.useImperativeHandle(t,()=>i),null})),di=[void 0,Yt];function Yp(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:s,onDragStart:o,onDragMove:i,onDragOver:a,onDragEnd:l}=t,u=a0(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]),d;const f=h.useRef(null),[p,v]=h.useState((d=u.manager)!=null?d:null),{plugins:g,modifiers:m,sensors:w}=u,S=Bn(s),k=Bn(o),y=Bn(a),b=Bn(i),C=Bn(l),j=Bn(r);return h.useEffect(()=>{var O;if(!f.current)throw new Error("Renderer not found");const{renderer:_,trackRendering:I}=f.current,x=(O=u.manager)!=null?O:new Rp(u);return x.renderer=_,x.monitor.addEventListener("beforedragstart",M=>{const D=S.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragstart",M=>{var D;return(D=k.current)==null?void 0:D.call(k,M,x)}),x.monitor.addEventListener("dragover",M=>{const D=y.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragmove",M=>{const D=b.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragend",M=>{const D=C.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("collision",M=>{var D;return(D=j.current)==null?void 0:D.call(j,M,x)}),h.startTransition(()=>v(x)),x.destroy},[u.manager]),be(g,()=>p&&(p.plugins=g??Cn.plugins),...di),be(w,()=>p&&(p.sensors=w??Cn.sensors),...di),be(m,()=>p&&(p.modifiers=m??Cn.modifiers),...di),c.jsxs(Zp.Provider,{value:p,children:[c.jsx(c0,{ref:f,children:n}),n]})}function Gp(){return h.useContext(Zp)}function Al(e){var t;const n=(t=Gp())!=null?t:void 0,[r]=h.useState(()=>e(n));return r.manager!==n&&(r.manager=n),_r(r.register,[n,r]),r}function u0(e){const{disabled:t,data:n,element:r,handle:s,id:o,modifiers:i,sensors:a}=e,l=Al(d=>new br(qp(Up({},e),{register:!1,handle:pn(s),element:pn(r)}),d)),u=Pl(l,d0);return be(o,()=>l.id=o),tr(s,d=>l.handle=d),tr(r,d=>l.element=d),be(n,()=>n&&(l.data=n)),be(t,()=>l.disabled=t===!0),be(a,()=>l.sensors=a),be(i,()=>l.modifiers=i,void 0,Yt),be(e.feedback,()=>{var d;return l.feedback=(d=e.feedback)!=null?d:"default"}),be(e.alignment,()=>l.alignment=e.alignment),{draggable:u,get isDragging(){return u.isDragging},get isDropping(){return u.isDropping},get isDragSource(){return u.isDragSource},handleRef:h.useCallback(d=>{l.handle=d??void 0},[l]),ref:h.useCallback(d=>{var f,p;!d&&((f=l.element)!=null&&f.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=d??void 0)},[l])}}function d0(e,t,n){return!!(e==="isDragSource"&&!n&&t)}var f0=Object.create,Kp=Object.defineProperty,p0=Object.getOwnPropertyDescriptor,Xp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Zo=e=>{throw TypeError(e)},h0=(e,t,n)=>t in e?Kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g0=e=>{var t;return[,,,f0((t=e==null?void 0:e[Xp("metadata")])!=null?t:null)]},Jp=["class","method","getter","setter","accessor","field","value","get","set"],Qp=e=>e!==void 0&&typeof e!="function"?Zo("Function expected"):e,v0=(e,t,n,r,s)=>({kind:Jp[e],name:t,metadata:r,addInitializer:o=>n._?Zo("Already initialized"):s.push(Qp(o||null))}),m0=(e,t)=>h0(t,Xp("metadata"),e[3]),y0=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)o[s].call(n);return r},eh=(e,t,n,r,s,o)=>{for(var i,a,l,u,d=t&7,f=!1,p=!1,v=2,g=Jp[d+5],m=e[v]||(e[v]=[]),w=(s=s.prototype,p0(s,n)),S=r.length-1;S>=0;S--)l=v0(d,n,a={},e[3],m),l.static=f,l.private=p,u=l.access={has:k=>n in k},u.get=k=>k[n],i=(0,r[S])(w[g],l),a._=1,Qp(i)&&(w[g]=i);return w&&Kp(s,n,w),s},th=(e,t,n)=>t.has(e)||Zo("Cannot "+n),b0=(e,t,n)=>(th(e,t,"read from private field"),t.get(e)),_0=(e,t,n)=>t.has(e)?Zo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),x0=(e,t,n,r)=>(th(e,t,"write to private field"),t.set(e,n),n),kn=class la{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new la(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new la(t,n)}},nh,rh,ca,io,Es,Ol=class extends(ca=Dn,rh=[He],nh=[He],ca){constructor(e){const t=kn.from(e);super(t,(n,r)=>kn.equals(n,r)),y0(Es,5,this),_0(this,io,0),this.velocity={x:0,y:0}}get delta(){return kn.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:t}=this,n=kn.from(e),r={x:n.x-t.x,y:n.y-t.y},s=Date.now(),o=s-b0(this,io),i=a=>Math.round(a/o*100);Te(()=>{x0(this,io,s),this.velocity={x:i(r.x),y:i(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(kn.from(e)),this.velocity={x:0,y:0}}};Es=g0(ca);io=new WeakMap;eh(Es,2,"delta",rh,Ol);eh(Es,2,"direction",nh,Ol);m0(Es,Ol);var sh=(e=>(e.Horizontal="x",e.Vertical="y",e))(sh||{});Object.values(sh);var w0=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=kn.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},S0=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:s}=e,o=kn.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Ht.ShapeIntersection,priority:bt.Normal}}return null},k0=e=>{var t;return(t=w0(e))!=null?t:S0(e)};function oh(e){const{collisionDetector:t,data:n,disabled:r,element:s,id:o,accept:i,type:a}=e,l=Al(d=>new qo(qp(Up({},e),{register:!1,element:pn(s)}),d)),u=Pl(l);return be(o,()=>l.id=o),tr(s,d=>l.element=d),be(i,()=>l.accept=i,void 0,Yt),be(t,()=>l.collisionDetector=t??k0),be(n,()=>n&&(l.data=n)),be(r,()=>l.disabled=r===!0),be(a,()=>l.type=a),{droppable:u,get isDropTarget(){return u.isDropTarget},ref:h.useCallback(d=>{var f,p;!d&&((f=l.element)!=null&&f.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=d??void 0)},[l])}}var I0=Object.create,ih=Object.defineProperty,E0=Object.defineProperties,C0=Object.getOwnPropertyDescriptor,j0=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,lh=Object.prototype.propertyIsEnumerable,P0=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Cs=e=>{throw TypeError(e)},ua=(e,t,n)=>t in e?ih(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A0=(e,t)=>{for(var n in t||(t={}))ah.call(t,n)&&ua(e,n,t[n]);if(Po)for(var n of Po(t))lh.call(t,n)&&ua(e,n,t[n]);return e},O0=(e,t)=>E0(e,j0(t)),M0=(e,t)=>{var n={};for(var r in e)ah.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Po)for(var r of Po(e))t.indexOf(r)<0&&lh.call(e,r)&&(n[r]=e[r]);return n},D0=e=>{var t;return[,,,I0((t=void 0)!=null?t:null)]},ch=["class","method","getter","setter","accessor","field","value","get","set"],Vr=e=>e!==void 0&&typeof e!="function"?Cs("Function expected"):e,T0=(e,t,n,r,s)=>({kind:ch[e],name:t,metadata:r,addInitializer:o=>n._?Cs("Already initialized"):s.push(Vr(o||null))}),R0=(e,t)=>ua(t,P0("metadata"),e[3]),$s=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},uh=(e,t,n,r,s,o)=>{for(var i,a,l,u,d,f=t&7,p=!1,v=!1,g=e.length+1,m=ch[f+5],w=e[g-1]=[],S=e[g]||(e[g]=[]),k=(s=s.prototype,C0({get[n](){return Wr(this,o)},set[n](b){return Sn(this,o,b)}},n)),y=r.length-1;y>=0;y--)u=T0(f,n,l={},e[3],S),u.static=p,u.private=v,d=u.access={has:b=>n in b},d.get=b=>b[n],d.set=(b,C)=>b[n]=C,a=(0,r[y])({get:k.get,set:k.set},u),l._=1,a===void 0?Vr(a)&&(k[m]=a):typeof a!="object"||a===null?Cs("Object expected"):(Vr(i=a.get)&&(k.get=i),Vr(i=a.set)&&(k.set=i),Vr(i=a.init)&&w.unshift(i));return k&&ih(s,n,k),s},dh=(e,t,n)=>t.has(e)||Cs("Cannot "+n),Wr=(e,t,n)=>(dh(e,t,"read from private field"),t.get(e)),Cr=(e,t,n)=>t.has(e)?Cs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Sn=(e,t,n,r)=>(dh(e,t,"write to private field"),t.set(e,n),n);function In(e){return e instanceof Tl||e instanceof gh}var Fs=10,L0=class extends Xe{constructor(e){super(e);const t=dt(()=>{const{dragOperation:r}=e;if(cs(r.activatorEvent)&&In(r.source)&&r.status.initialized){const s=e.registry.plugins.get(Is);if(s)return s.disable(),()=>s.enable()}}),n=e.monitor.addEventListener("dragmove",(r,s)=>{queueMicrotask(()=>{if(this.disabled||r.defaultPrevented||!r.nativeEvent)return;const{dragOperation:o}=s;if(!cs(r.nativeEvent)||!In(o.source)||!o.shape)return;const{actions:i,collisionObserver:a,registry:l}=s,{by:u}=r;if(!u)return;const d=N0(u),{source:f,target:p}=o,{center:v}=o.shape.current,g=[],m=[];Te(()=>{for(const C of l.droppables){const{id:j}=C;if(!C.accepts(f)||j===(p==null?void 0:p.id)&&In(C)||!C.element)continue;let O=C.shape;const _=new It(C.element,{getBoundingClientRect:I=>as(I,void 0,.2)});!_.height||!_.width||(d=="down"&&v.y+Fs<_.center.y||d=="up"&&v.y-Fs>_.center.y||d=="left"&&v.x-Fs>_.center.x||d=="right"&&v.x+Fs<_.center.x)&&(g.push(C),C.shape=_,m.push(()=>C.shape=O))}}),r.preventDefault(),a.disable();const w=a.computeCollisions(g,vx);Te(()=>m.forEach(C=>C()));const[S]=w;if(!S)return;const{id:k}=S,{index:y,group:b}=f.sortable;i.setDropTarget(k).then(()=>{const{source:C,target:j,shape:O}=o;if(!C||!In(C)||!O)return;const{index:_,group:I,target:x}=C.sortable,M=y!==_||b!==I,D=M?x:j==null?void 0:j.element;if(!D)return;mp(D);const L=new It(D);if(!L)return;const N=At.delta(L,At.from(O.current.boundingRectangle),C.alignment);i.move({by:N}),M?i.setDropTarget(C.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function N0(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var z0=Object.defineProperty,$0=Object.defineProperties,F0=Object.getOwnPropertyDescriptors,Kc=Object.getOwnPropertySymbols,B0=Object.prototype.hasOwnProperty,H0=Object.prototype.propertyIsEnumerable,Xc=(e,t,n)=>t in e?z0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jc=(e,t)=>{for(var n in t||(t={}))B0.call(t,n)&&Xc(e,n,t[n]);if(Kc)for(var n of Kc(t))H0.call(t,n)&&Xc(e,n,t[n]);return e},Qc=(e,t)=>$0(e,F0(t));function V0(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function W0(e,t,n){var r,s;const{source:o,target:i,canceled:a}=t.operation;if(!o||!i||a)return"preventDefault"in t&&t.preventDefault(),e;const l=(y,b)=>y===b||typeof y=="object"&&"id"in y&&y.id===b;if(Array.isArray(e)){const y=e.findIndex(C=>l(C,o.id)),b=e.findIndex(C=>l(C,i.id));if(y===-1||b===-1)return e;if(!a&&"index"in o&&typeof o.index=="number"){const C=o.index;if(C!==y)return n(e,y,C)}return n(e,y,b)}const u=Object.entries(e);let d=-1,f,p=-1,v;for(const[y,b]of u)if(d===-1&&(d=b.findIndex(C=>l(C,o.id)),d!==-1&&(f=y)),p===-1&&(p=b.findIndex(C=>l(C,i.id)),p!==-1&&(v=y)),d!==-1&&p!==-1)break;if(!o.manager)return e;const{dragOperation:g}=o.manager,m=(s=(r=g.shape)==null?void 0:r.current.center)!=null?s:g.position.current;if(v==null&&i.id in e){const y=i.shape&&m.y>i.shape.center.y?e[i.id].length:0;v=i.id,p=y}if(f==null||v==null||f===v&&d===p)return"preventDefault"in t&&t.preventDefault(),e;if(f===v)return Qc(Jc({},e),{[f]:n(e[f],d,p)});const S=i.shape&&Math.round(m.y)>Math.round(i.shape.center.y)?1:0,k=e[f][d];return Qc(Jc({},e),{[f]:[...e[f].slice(0,d),...e[f].slice(d+1)],[v]:[...e[v].slice(0,p+S),k,...e[v].slice(p+S)]})}function U0(e,t){return W0(e,t,V0)}var eu="__default__",q0=class extends Xe{constructor(e){super(e);const t=()=>{const r=new Map;for(const s of e.registry.droppables)if(s instanceof Tl){const{sortable:o}=s,{group:i}=o;let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(o)}for(const[s,o]of r)r.set(s,new Set(Bs(o)));return r},n=[e.monitor.addEventListener("dragover",(r,s)=>{if(this.disabled)return;const{dragOperation:o}=s,{source:i,target:a}=o;if(!In(i)||!In(a)||i.sortable===a.sortable)return;const l=t(),u=i.sortable.group===a.sortable.group,d=l.get(i.sortable.group),f=u?d:l.get(a.sortable.group);!d||!f||queueMicrotask(()=>{r.defaultPrevented||s.renderer.rendering.then(()=>{var p,v,g;const m=t();for(const[x,M]of l.entries()){const D=Array.from(M).entries();for(const[L,N]of D)if(N.index!==L||N.group!==x||!((p=m.get(x))!=null&&p.has(N)))return}const w=i.sortable.element,S=a.sortable.element;if(!S||!w||!u&&a.id===i.sortable.group)return;const k=Bs(d),y=u?k:Bs(f),b=(v=i.sortable.group)!=null?v:eu,C=(g=a.sortable.group)!=null?g:eu,j={[b]:k,[C]:y},O=U0(j,r);if(j===O)return;const _=O[C].indexOf(i.sortable),I=O[C].indexOf(a.sortable);s.collisionObserver.disable(),tu(w,_,S,I),Te(()=>{for(const[x,M]of O[b].entries())M.index=x;if(!u)for(const[x,M]of O[C].entries())M.group=a.sortable.group,M.index=x}),s.actions.setDropTarget(i.id).then(()=>s.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(r,s)=>{if(!r.canceled)return;const{dragOperation:o}=s,{source:i}=o;In(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{const a=t(),l=a.get(i.sortable.initialGroup);l&&s.renderer.rendering.then(()=>{for(const[v,g]of a.entries()){const m=Array.from(g).entries();for(const[w,S]of m)if(S.index!==w||S.group!==v)return}const u=Bs(l),d=i.sortable.element,f=u[i.sortable.initialIndex],p=f==null?void 0:f.element;!f||!p||!d||(tu(d,f.index,p,i.index),Te(()=>{for(const[v,g]of a.entries()){const m=Array.from(g).values();for(const w of m)w.index=w.initialIndex,w.group=w.initialGroup}}))})}))})];this.destroy=()=>{for(const r of n)r()}}};function tu(e,t,n,r){const s=r<t?"afterend":"beforebegin";n.insertAdjacentElement(s,e)}function Z0(e,t){return e.index-t.index}function Bs(e){return Array.from(e).sort(Z0)}var Y0=[L0,q0],fh={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Hs=new Jb,ph,hh,fn,Ml,Ur,qr,Dl,Jn;hh=[fe],ph=[fe];var Yo=class{constructor(e,t){Cr(this,Ml,$s(fn,8,this)),$s(fn,11,this),Cr(this,Ur),Cr(this,qr),Cr(this,Dl,$s(fn,12,this)),$s(fn,15,this),Cr(this,Jn),this.register=()=>(Te(()=>{var f,p;(f=this.manager)==null||f.registry.register(this.droppable),(p=this.manager)==null||p.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{Te(()=>{var f,p;(f=this.manager)==null||f.registry.unregister(this.droppable),(p=this.manager)==null||p.registry.unregister(this.draggable)})},this.destroy=()=>{Te(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:s,index:o,sensors:i,type:a,transition:l=fh,plugins:u=Y0}=n,d=M0(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Tl(d,t,this),this.draggable=new gh(O0(A0({},d),{effects:()=>[()=>{var f,p,v;const g=(f=this.manager)==null?void 0:f.dragOperation.status;g!=null&&g.initializing&&this.id===((v=(p=this.manager)==null?void 0:p.dragOperation.source)==null?void 0:v.id)&&Hs.clear(this.manager),g!=null&&g.dragging&&Hs.set(this.manager,this.id,xe(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:f,group:p,manager:v}=this,g=Wr(this,qr),m=Wr(this,Ur);(f!==g||p!==m)&&(Sn(this,qr,f),Sn(this,Ur,p),this.animate())},()=>{const{target:f}=this,{feedback:p,isDragSource:v}=this.draggable;p=="move"&&v&&(this.droppable.disabled=!f)},()=>{const{manager:f}=this;for(const p of u)f==null||f.registry.register(p)},...r()],type:a,sensors:i}),t,this),Sn(this,Jn,d.element),this.manager=t,this.index=o,Sn(this,qr,o),this.group=s,Sn(this,Ur,s),this.type=a,this.transition=l}get initialIndex(){var e,t;return(t=(e=Hs.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=Hs.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){xe(()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;!n||!t||r&&!t.idle||e.renderer.rendering.then(()=>{const{element:s}=this;if(!s)return;const o=this.refreshShape();if(!o)return;const i={x:n.boundingRectangle.left-o.boundingRectangle.left,y:n.boundingRectangle.top-o.boundingRectangle.top},{translate:a}=Ot(s),l=zc(s,a,!1),u=zc(s,a);(i.x||i.y)&&yp({element:s,keyframes:{translate:[`${l.x+i.x}px ${l.y+i.y}px ${l.z}`,`${u.x}px ${u.y}px ${u.z}`]},options:t}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})})})}get manager(){return this.draggable.manager}set manager(e){Te(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){Te(()=>{const t=Wr(this,Jn),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),Sn(this,Jn,e)})}get element(){var e,t;const n=Wr(this,Jn);if(n)return(t=(e=Gi.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){Te(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){Te(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){Te(()=>{this.droppable.id=e,this.draggable.id=e})}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??bp}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Te(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};fn=D0();Ml=new WeakMap;Ur=new WeakMap;qr=new WeakMap;Dl=new WeakMap;Jn=new WeakMap;uh(fn,4,"index",hh,Yo,Ml);uh(fn,4,"group",ph,Yo,Dl);R0(fn,Yo);var gh=class extends br{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}},Tl=class extends qo{constructor(e,t,n){super(e,t),this.sortable=n}},G0=Object.defineProperty,K0=Object.defineProperties,X0=Object.getOwnPropertyDescriptors,nu=Object.getOwnPropertySymbols,J0=Object.prototype.hasOwnProperty,Q0=Object.prototype.propertyIsEnumerable,ru=(e,t,n)=>t in e?G0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fi=(e,t)=>{for(var n in t||(t={}))J0.call(t,n)&&ru(e,n,t[n]);if(nu)for(var n of nu(t))Q0.call(t,n)&&ru(e,n,t[n]);return e},e1=(e,t)=>K0(e,X0(t));function vh(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:s,data:o,element:i,handle:a,index:l,group:u,disabled:d,feedback:f,modifiers:p,sensors:v,target:g,type:m}=e,w=fi(fi({},fh),e.transition),S=Al(y=>new Yo(e1(fi({},e),{transition:w,register:!1,handle:pn(a),element:pn(i),target:pn(g),feedback:f}),y)),k=Pl(S,t1);return be(s,()=>S.id=s),_r(()=>{Te(()=>{S.group=u,S.index=l})},[S,u,l]),be(m,()=>S.type=m),be(t,()=>S.accept=t,void 0,Yt),be(o,()=>o&&(S.data=o)),be(l,()=>{var y;(y=S.manager)!=null&&y.dragOperation.status.idle&&(w!=null&&w.idle)&&S.refreshShape()},r0),tr(a,y=>S.handle=y),tr(i,y=>S.element=y),tr(g,y=>S.target=y),be(d,()=>S.disabled=d===!0),be(v,()=>S.sensors=v),be(n,()=>S.collisionDetector=n),be(r,()=>S.collisionPriority=r),be(f,()=>S.feedback=f??"default"),be(w,()=>S.transition=w,void 0,Yt),be(p,()=>S.modifiers=p,void 0,Yt),be(e.alignment,()=>S.alignment=e.alignment),{sortable:k,get isDragging(){return k.isDragging},get isDropping(){return k.isDropping},get isDragSource(){return k.isDragSource},get isDropTarget(){return k.isDropTarget},handleRef:h.useCallback(y=>{S.handle=y??void 0},[S]),ref:h.useCallback(y=>{var b,C;!y&&((b=S.element)!=null&&b.isConnected)&&!((C=S.manager)!=null&&C.dragOperation.status.idle)||(S.element=y??void 0)},[S]),sourceRef:h.useCallback(y=>{var b,C;!y&&((b=S.source)!=null&&b.isConnected)&&!((C=S.manager)!=null&&C.dragOperation.status.idle)||(S.source=y??void 0)},[S]),targetRef:h.useCallback(y=>{var b,C;!y&&((b=S.target)!=null&&b.isConnected)&&!((C=S.manager)!=null&&C.dragOperation.status.idle)||(S.target=y??void 0)},[S])}}function t1(e,t,n){return!!(e==="isDragSource"&&!n&&t)}function mh(e,t,n){var r=this,s=h.useRef(null),o=h.useRef(0),i=h.useRef(null),a=h.useRef([]),l=h.useRef(),u=h.useRef(),d=h.useRef(e),f=h.useRef(!0);h.useEffect(function(){d.current=e},[e]);var p=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,g=!("trailing"in n)||!!n.trailing,m="maxWait"in n,w=m?Math.max(+n.maxWait||0,t):null;h.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var S=h.useMemo(function(){var k=function(_){var I=a.current,x=l.current;return a.current=l.current=null,o.current=_,u.current=d.current.apply(x,I)},y=function(_,I){p&&cancelAnimationFrame(i.current),i.current=p?requestAnimationFrame(_):setTimeout(_,I)},b=function(_){if(!f.current)return!1;var I=_-s.current;return!s.current||I>=t||I<0||m&&_-o.current>=w},C=function(_){return i.current=null,g&&a.current?k(_):(a.current=l.current=null,u.current)},j=function _(){var I=Date.now();if(b(I))return C(I);if(f.current){var x=t-(I-s.current),M=m?Math.min(x,w-(I-o.current)):x;y(_,M)}},O=function(){var _=Date.now(),I=b(_);if(a.current=[].slice.call(arguments),l.current=r,s.current=_,I){if(!i.current&&f.current)return o.current=s.current,y(j,t),v?k(s.current):u.current;if(m)return y(j,t),k(s.current)}return i.current||y(j,t),u.current};return O.cancel=function(){i.current&&(p?cancelAnimationFrame(i.current):clearTimeout(i.current)),o.current=0,a.current=s.current=l.current=i.current=null},O.isPending=function(){return!!i.current},O.flush=function(){return i.current?C(Date.now()):u.current},O},[v,m,t,w,g,p]);return S}function n1(e,t){return e===t}function su(e){return typeof e=="function"?function(){return e}:e}function gk(e,t,n){var r,s,o=n&&n.equalityFn||n1,i=(r=h.useState(su(e)),s=r[1],[r[0],h.useCallback(function(f){return s(su(f))},[])]),a=i[0],l=i[1],u=mh(h.useCallback(function(f){return l(f)},[l]),t,n),d=h.useRef(e);return o(d.current,e)||(u(e),d.current=e),[a,u]}function Hn(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){var a,l,u;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,m)=>r[m]!==g)))return s;r=f;let v;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(v=Date.now()),s=t(...f),n.key&&((u=n.debug)!=null&&u.call(n))){const g=Math.round((Date.now()-d)*100)/100,m=Math.round((Date.now()-v)*100)/100,w=m/16,S=(k,y)=>{for(k=String(k);k.length<y;)k=" "+k;return k};console.info(`%c⏱ ${S(m,5)} /${S(g,5)} ms`,`
153
+ font-size: .6rem;
154
+ font-weight: bold;
155
+ color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1,s}return i.updateDeps=a=>{r=a},i}function ou(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const r1=(e,t)=>Math.abs(e-t)<1.01,yh=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},iu=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},s1=e=>e,bh=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},_h=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(s(iu(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(iu(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},gs={passive:!0},o1=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,gs),()=>{n.removeEventListener("resize",r)}},Ao=typeof window>"u"?!0:"onscrollend"in window,xh=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&Ao?()=>{}:yh(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:p}=e.options;s=f?n.scrollLeft*(p&&-1||1):n.scrollTop,o(),t(s,d)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,gs);const u=e.options.useScrollendEvent&&Ao;return u&&n.addEventListener("scrollend",l,gs),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},i1=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&Ao?()=>{}:yh(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{s=n[e.options.horizontal?"scrollX":"scrollY"],o(),t(s,d)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,gs);const u=e.options.useScrollendEvent&&Ao;return u&&n.addEventListener("scrollend",l,gs),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},a1=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},l1=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;const i=e+t;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})},wh=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;const i=e+t;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class c1{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const a=o.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:s1,rangeExtractor:bh,onChange:()=>{},measureElement:a1,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Hn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Hn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,s,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Hn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let p=0;p<u;p++){const v=d[p];v&&(f[v.lane]=p)}for(let p=u;p<n;p++){const v=o(p),g=this.laneAssignments.get(p);let m,w;if(g!==void 0&&this.options.lanes>1){m=g;const b=f[m],C=b!==void 0?d[b]:void 0;w=C?C.end+this.options.gap:r+s}else{const b=this.options.lanes===1?d[p-1]:this.getFurthestMeasurement(d,p);w=b?b.end+this.options.gap:r+s,m=b?b.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,m)}const S=l.get(v),k=typeof S=="number"?S:this.options.estimateSize(p),y=w+k;d[p]={index:p,start:w,size:k,end:y,key:v,lane:m},f[m]=p}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>this.range=n.length>0&&r>0?u1({measurements:n,outerSize:r,scrollOffset:s,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Hn(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),a=Math.min(this.options.count-1,s+o);return n>=i&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s;const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,a=r-i;a!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.getVirtualItems=Hn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const a=n[o],l=r[a];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return ou(r[Sh(0,r.length-1,s=>ou(r[s]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,a]=o,l=this.now();this.scrollState={index:n,align:a,behavior:s,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&r1(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Sh=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<r)e=s+1;else if(o>r)t=s-1;else return s}return e>0?e-1:0};function u1({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=Sh(0,s,o,n),a=i;if(r===1)for(;a<s&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<s&&l.some(d=>d<n+t);){const d=e[a];l[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;i>=0&&u.some(d=>d>=n);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const au=typeof document<"u"?h.useLayoutEffect:h.useEffect;function d1({useFlushSync:e=!0,...t}){const n=h.useReducer(()=>({}),{})[1],r={...t,onChange:(o,i)=>{var a;e&&i?ms.flushSync(n):n(),(a=t.onChange)==null||a.call(t,o,i)}},[s]=h.useState(()=>new c1(r));return s.setOptions(r),au(()=>s._didMount(),[]),au(()=>s._willUpdate()),s}function kh(e){return d1({observeElementRect:_h,observeElementOffset:xh,scrollToFn:wh,...e})}function Vs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pi={exports:{}},lu;function f1(){return lu||(lu=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,s,o){function i(u,d){if(!s[u]){if(!r[u]){var f=typeof Vs=="function"&&Vs;if(!d&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}d=s[u]={exports:{}},r[u][0].call(d.exports,function(p){var v=r[u][1][p];return i(v||p)},d,d.exports,n,r,s,o)}return s[u].exports}for(var a=typeof Vs=="function"&&Vs,l=0;l<o.length;l++)i(o[l]);return i})({1:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("crypto");function m(j,O){O=k(j,O);var _;return(_=O.algorithm!=="passthrough"?g.createHash(O.algorithm):new C).write===void 0&&(_.write=_.update,_.end=_.update),b(O,_).dispatch(j),_.update||_.end(""),_.digest?_.digest(O.encoding==="buffer"?void 0:O.encoding):(j=_.read(),O.encoding!=="buffer"?j.toString(O.encoding):j)}(s=r.exports=m).sha1=function(j){return m(j)},s.keys=function(j){return m(j,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},s.MD5=function(j){return m(j,{algorithm:"md5",encoding:"hex"})},s.keysMD5=function(j){return m(j,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var w=g.getHashes?g.getHashes().slice():["sha1","md5"],S=(w.push("passthrough"),["buffer","hex","binary","base64"]);function k(j,O){var _={};if(_.algorithm=(O=O||{}).algorithm||"sha1",_.encoding=O.encoding||"hex",_.excludeValues=!!O.excludeValues,_.algorithm=_.algorithm.toLowerCase(),_.encoding=_.encoding.toLowerCase(),_.ignoreUnknown=O.ignoreUnknown===!0,_.respectType=O.respectType!==!1,_.respectFunctionNames=O.respectFunctionNames!==!1,_.respectFunctionProperties=O.respectFunctionProperties!==!1,_.unorderedArrays=O.unorderedArrays===!0,_.unorderedSets=O.unorderedSets!==!1,_.unorderedObjects=O.unorderedObjects!==!1,_.replacer=O.replacer||void 0,_.excludeKeys=O.excludeKeys||void 0,j===void 0)throw new Error("Object argument required.");for(var I=0;I<w.length;++I)w[I].toLowerCase()===_.algorithm.toLowerCase()&&(_.algorithm=w[I]);if(w.indexOf(_.algorithm)===-1)throw new Error('Algorithm "'+_.algorithm+'" not supported. supported values: '+w.join(", "));if(S.indexOf(_.encoding)===-1&&_.algorithm!=="passthrough")throw new Error('Encoding "'+_.encoding+'" not supported. supported values: '+S.join(", "));return _}function y(j){if(typeof j=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(j))!=null}function b(j,O,_){_=_||[];function I(x){return O.update?O.update(x,"utf8"):O.write(x,"utf8")}return{dispatch:function(x){return this["_"+((x=j.replacer?j.replacer(x):x)===null?"null":typeof x)](x)},_object:function(x){var M,D=Object.prototype.toString.call(x),L=/\[object (.*)\]/i.exec(D);if(L=(L=L?L[1]:"unknown:["+D+"]").toLowerCase(),0<=(D=_.indexOf(x)))return this.dispatch("[CIRCULAR:"+D+"]");if(_.push(x),a!==void 0&&a.isBuffer&&a.isBuffer(x))return I("buffer:"),I(x);if(L==="object"||L==="function"||L==="asyncfunction")return D=Object.keys(x),j.unorderedObjects&&(D=D.sort()),j.respectType===!1||y(x)||D.splice(0,0,"prototype","__proto__","constructor"),j.excludeKeys&&(D=D.filter(function(N){return!j.excludeKeys(N)})),I("object:"+D.length+":"),M=this,D.forEach(function(N){M.dispatch(N),I(":"),j.excludeValues||M.dispatch(x[N]),I(",")});if(!this["_"+L]){if(j.ignoreUnknown)return I("["+L+"]");throw new Error('Unknown object type "'+L+'"')}this["_"+L](x)},_array:function(x,N){N=N!==void 0?N:j.unorderedArrays!==!1;var D=this;if(I("array:"+x.length+":"),!N||x.length<=1)return x.forEach(function(B){return D.dispatch(B)});var L=[],N=x.map(function(B){var H=new C,G=_.slice();return b(j,H,G).dispatch(B),L=L.concat(G.slice(_.length)),H.read().toString()});return _=_.concat(L),N.sort(),this._array(N,!1)},_date:function(x){return I("date:"+x.toJSON())},_symbol:function(x){return I("symbol:"+x.toString())},_error:function(x){return I("error:"+x.toString())},_boolean:function(x){return I("bool:"+x.toString())},_string:function(x){I("string:"+x.length+":"),I(x.toString())},_function:function(x){I("fn:"),y(x)?this.dispatch("[native]"):this.dispatch(x.toString()),j.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(x.name)),j.respectFunctionProperties&&this._object(x)},_number:function(x){return I("number:"+x.toString())},_xml:function(x){return I("xml:"+x.toString())},_null:function(){return I("Null")},_undefined:function(){return I("Undefined")},_regexp:function(x){return I("regex:"+x.toString())},_uint8array:function(x){return I("uint8array:"),this.dispatch(Array.prototype.slice.call(x))},_uint8clampedarray:function(x){return I("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(x))},_int8array:function(x){return I("int8array:"),this.dispatch(Array.prototype.slice.call(x))},_uint16array:function(x){return I("uint16array:"),this.dispatch(Array.prototype.slice.call(x))},_int16array:function(x){return I("int16array:"),this.dispatch(Array.prototype.slice.call(x))},_uint32array:function(x){return I("uint32array:"),this.dispatch(Array.prototype.slice.call(x))},_int32array:function(x){return I("int32array:"),this.dispatch(Array.prototype.slice.call(x))},_float32array:function(x){return I("float32array:"),this.dispatch(Array.prototype.slice.call(x))},_float64array:function(x){return I("float64array:"),this.dispatch(Array.prototype.slice.call(x))},_arraybuffer:function(x){return I("arraybuffer:"),this.dispatch(new Uint8Array(x))},_url:function(x){return I("url:"+x.toString())},_map:function(x){return I("map:"),x=Array.from(x),this._array(x,j.unorderedSets!==!1)},_set:function(x){return I("set:"),x=Array.from(x),this._array(x,j.unorderedSets!==!1)},_file:function(x){return I("file:"),this.dispatch([x.name,x.size,x.type,x.lastModfied])},_blob:function(){if(j.ignoreUnknown)return I("[blob]");throw Error(`Hashing Blob objects is currently not supported
156
+ (see https://github.com/puleos/object-hash/issues/26)
157
+ Use "options.replacer" or "options.ignoreUnknown"
158
+ `)},_domwindow:function(){return I("domwindow")},_bigint:function(x){return I("bigint:"+x.toString())},_process:function(){return I("process")},_timer:function(){return I("timer")},_pipe:function(){return I("pipe")},_tcp:function(){return I("tcp")},_udp:function(){return I("udp")},_tty:function(){return I("tty")},_statwatcher:function(){return I("statwatcher")},_securecontext:function(){return I("securecontext")},_connection:function(){return I("connection")},_zlib:function(){return I("zlib")},_context:function(){return I("context")},_nodescript:function(){return I("nodescript")},_httpparser:function(){return I("httpparser")},_dataview:function(){return I("dataview")},_signal:function(){return I("signal")},_fsevent:function(){return I("fsevent")},_tlswrap:function(){return I("tlswrap")}}}function C(){return{buf:"",write:function(j){this.buf+=j},end:function(j){this.buf+=j},read:function(){return this.buf}}}s.writeToStream=function(j,O,_){return _===void 0&&(_=O,O={}),b(O=k(j,O),_).dispatch(j)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){(function(g){var m=typeof Uint8Array<"u"?Uint8Array:Array,w=43,S=47,k=48,y=97,b=65,C=45,j=95;function O(_){return _=_.charCodeAt(0),_===w||_===C?62:_===S||_===j?63:_<k?-1:_<k+10?_-k+26+26:_<b+26?_-b:_<y+26?_-y+26:void 0}g.toByteArray=function(_){var I,x;if(0<_.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var M=_.length,M=_.charAt(M-2)==="="?2:_.charAt(M-1)==="="?1:0,D=new m(3*_.length/4-M),L=0<M?_.length-4:_.length,N=0;function B(H){D[N++]=H}for(I=0;I<L;I+=4,0)B((16711680&(x=O(_.charAt(I))<<18|O(_.charAt(I+1))<<12|O(_.charAt(I+2))<<6|O(_.charAt(I+3))))>>16),B((65280&x)>>8),B(255&x);return M==2?B(255&(x=O(_.charAt(I))<<2|O(_.charAt(I+1))>>4)):M==1&&(B((x=O(_.charAt(I))<<10|O(_.charAt(I+1))<<4|O(_.charAt(I+2))>>2)>>8&255),B(255&x)),D},g.fromByteArray=function(_){var I,x,M,D,L=_.length%3,N="";function B(H){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(H)}for(I=0,M=_.length-L;I<M;I+=3)x=(_[I]<<16)+(_[I+1]<<8)+_[I+2],N+=B((D=x)>>18&63)+B(D>>12&63)+B(D>>6&63)+B(63&D);switch(L){case 1:N=(N+=B((x=_[_.length-1])>>2))+B(x<<4&63)+"==";break;case 2:N=(N=(N+=B((x=(_[_.length-2]<<8)+_[_.length-1])>>10))+B(x>>4&63))+B(x<<2&63)+"="}return N}})(s===void 0?this.base64js={}:s)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,s){(function(o,i,w,l,u,d,f,p,v){var g=n("base64-js"),m=n("ieee754");function w(E,T,R){if(!(this instanceof w))return new w(E,T,R);var U,q,K,oe,me=typeof E;if(T==="base64"&&me=="string")for(E=(oe=E).trim?oe.trim():oe.replace(/^\s+|\s+$/g,"");E.length%4!=0;)E+="=";if(me=="number")U=$(E);else if(me=="string")U=w.byteLength(E,T);else{if(me!="object")throw new Error("First argument needs to be a number, array or string.");U=$(E.length)}if(w._useTypedArrays?q=w._augment(new Uint8Array(U)):((q=this).length=U,q._isBuffer=!0),w._useTypedArrays&&typeof E.byteLength=="number")q._set(E);else if(Z(oe=E)||w.isBuffer(oe)||oe&&typeof oe=="object"&&typeof oe.length=="number")for(K=0;K<U;K++)w.isBuffer(E)?q[K]=E.readUInt8(K):q[K]=E[K];else if(me=="string")q.write(E,0,T);else if(me=="number"&&!w._useTypedArrays&&!R)for(K=0;K<U;K++)q[K]=0;return q}function S(E,T,R,U){return w._charsWritten=de((function(q){for(var K=[],oe=0;oe<q.length;oe++)K.push(255&q.charCodeAt(oe));return K})(T),E,R,U)}function k(E,T,R,U){return w._charsWritten=de((function(q){for(var K,oe,me=[],ke=0;ke<q.length;ke++)oe=q.charCodeAt(ke),K=oe>>8,oe=oe%256,me.push(oe),me.push(K);return me})(T),E,R,U)}function y(E,T,R){var U="";R=Math.min(E.length,R);for(var q=T;q<R;q++)U+=String.fromCharCode(E[q]);return U}function b(E,T,R,K){K||(W(typeof R=="boolean","missing or invalid endian"),W(T!=null,"missing offset"),W(T+1<E.length,"Trying to read beyond buffer length"));var q,K=E.length;if(!(K<=T))return R?(q=E[T],T+1<K&&(q|=E[T+1]<<8)):(q=E[T]<<8,T+1<K&&(q|=E[T+1])),q}function C(E,T,R,K){K||(W(typeof R=="boolean","missing or invalid endian"),W(T!=null,"missing offset"),W(T+3<E.length,"Trying to read beyond buffer length"));var q,K=E.length;if(!(K<=T))return R?(T+2<K&&(q=E[T+2]<<16),T+1<K&&(q|=E[T+1]<<8),q|=E[T],T+3<K&&(q+=E[T+3]<<24>>>0)):(T+1<K&&(q=E[T+1]<<16),T+2<K&&(q|=E[T+2]<<8),T+3<K&&(q|=E[T+3]),q+=E[T]<<24>>>0),q}function j(E,T,R,U){if(U||(W(typeof R=="boolean","missing or invalid endian"),W(T!=null,"missing offset"),W(T+1<E.length,"Trying to read beyond buffer length")),!(E.length<=T))return U=b(E,T,R,!0),32768&U?-1*(65535-U+1):U}function O(E,T,R,U){if(U||(W(typeof R=="boolean","missing or invalid endian"),W(T!=null,"missing offset"),W(T+3<E.length,"Trying to read beyond buffer length")),!(E.length<=T))return U=C(E,T,R,!0),2147483648&U?-1*(4294967295-U+1):U}function _(E,T,R,U){return U||(W(typeof R=="boolean","missing or invalid endian"),W(T+3<E.length,"Trying to read beyond buffer length")),m.read(E,T,R,23,4)}function I(E,T,R,U){return U||(W(typeof R=="boolean","missing or invalid endian"),W(T+7<E.length,"Trying to read beyond buffer length")),m.read(E,T,R,52,8)}function x(E,T,R,U,q){if(q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+1<E.length,"trying to write beyond buffer length"),re(T,65535)),q=E.length,!(q<=R))for(var K=0,oe=Math.min(q-R,2);K<oe;K++)E[R+K]=(T&255<<8*(U?K:1-K))>>>8*(U?K:1-K)}function M(E,T,R,U,q){if(q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+3<E.length,"trying to write beyond buffer length"),re(T,4294967295)),q=E.length,!(q<=R))for(var K=0,oe=Math.min(q-R,4);K<oe;K++)E[R+K]=T>>>8*(U?K:3-K)&255}function D(E,T,R,U,q){q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+1<E.length,"Trying to write beyond buffer length"),Je(T,32767,-32768)),E.length<=R||x(E,0<=T?T:65535+T+1,R,U,q)}function L(E,T,R,U,q){q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+3<E.length,"Trying to write beyond buffer length"),Je(T,2147483647,-2147483648)),E.length<=R||M(E,0<=T?T:4294967295+T+1,R,U,q)}function N(E,T,R,U,q){q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+3<E.length,"Trying to write beyond buffer length"),te(T,34028234663852886e22,-34028234663852886e22)),E.length<=R||m.write(E,T,R,U,23,4)}function B(E,T,R,U,q){q||(W(T!=null,"missing value"),W(typeof U=="boolean","missing or invalid endian"),W(R!=null,"missing offset"),W(R+7<E.length,"Trying to write beyond buffer length"),te(T,17976931348623157e292,-17976931348623157e292)),E.length<=R||m.write(E,T,R,U,52,8)}s.Buffer=w,s.SlowBuffer=w,s.INSPECT_MAX_BYTES=50,w.poolSize=8192,w._useTypedArrays=(function(){try{var E=new ArrayBuffer(0),T=new Uint8Array(E);return T.foo=function(){return 42},T.foo()===42&&typeof T.subarray=="function"}catch{return!1}})(),w.isEncoding=function(E){switch(String(E).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.isBuffer=function(E){return!(E==null||!E._isBuffer)},w.byteLength=function(E,T){var R;switch(E+="",T||"utf8"){case"hex":R=E.length/2;break;case"utf8":case"utf-8":R=X(E).length;break;case"ascii":case"binary":case"raw":R=E.length;break;case"base64":R=Q(E).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":R=2*E.length;break;default:throw new Error("Unknown encoding")}return R},w.concat=function(E,T){if(W(Z(E),`Usage: Buffer.concat(list, [totalLength])
159
+ list should be an Array.`),E.length===0)return new w(0);if(E.length===1)return E[0];if(typeof T!="number")for(q=T=0;q<E.length;q++)T+=E[q].length;for(var R=new w(T),U=0,q=0;q<E.length;q++){var K=E[q];K.copy(R,U),U+=K.length}return R},w.prototype.write=function(E,T,R,U){isFinite(T)?isFinite(R)||(U=R,R=void 0):(ke=U,U=T,T=R,R=ke),T=Number(T)||0;var q,K,oe,me,ke=this.length-T;switch((!R||ke<(R=Number(R)))&&(R=ke),U=String(U||"utf8").toLowerCase()){case"hex":q=(function(we,Oe,Me,Ie){Me=Number(Me)||0;var ye=we.length-Me;(!Ie||ye<(Ie=Number(Ie)))&&(Ie=ye),W((ye=Oe.length)%2==0,"Invalid hex string"),ye/2<Ie&&(Ie=ye/2);for(var $e=0;$e<Ie;$e++){var gt=parseInt(Oe.substr(2*$e,2),16);W(!isNaN(gt),"Invalid hex string"),we[Me+$e]=gt}return w._charsWritten=2*$e,$e})(this,E,T,R);break;case"utf8":case"utf-8":K=this,oe=T,me=R,q=w._charsWritten=de(X(E),K,oe,me);break;case"ascii":case"binary":q=S(this,E,T,R);break;case"base64":K=this,oe=T,me=R,q=w._charsWritten=de(Q(E),K,oe,me);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":q=k(this,E,T,R);break;default:throw new Error("Unknown encoding")}return q},w.prototype.toString=function(E,T,R){var U,q,K,oe,me=this;if(E=String(E||"utf8").toLowerCase(),T=Number(T)||0,(R=R!==void 0?Number(R):me.length)===T)return"";switch(E){case"hex":U=(function(ke,we,Oe){var Me=ke.length;(!we||we<0)&&(we=0),(!Oe||Oe<0||Me<Oe)&&(Oe=Me);for(var Ie="",ye=we;ye<Oe;ye++)Ie+=F(ke[ye]);return Ie})(me,T,R);break;case"utf8":case"utf-8":U=(function(ke,we,Oe){var Me="",Ie="";Oe=Math.min(ke.length,Oe);for(var ye=we;ye<Oe;ye++)ke[ye]<=127?(Me+=ve(Ie)+String.fromCharCode(ke[ye]),Ie=""):Ie+="%"+ke[ye].toString(16);return Me+ve(Ie)})(me,T,R);break;case"ascii":case"binary":U=y(me,T,R);break;case"base64":q=me,oe=R,U=(K=T)===0&&oe===q.length?g.fromByteArray(q):g.fromByteArray(q.slice(K,oe));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":U=(function(ke,we,Oe){for(var Me=ke.slice(we,Oe),Ie="",ye=0;ye<Me.length;ye+=2)Ie+=String.fromCharCode(Me[ye]+256*Me[ye+1]);return Ie})(me,T,R);break;default:throw new Error("Unknown encoding")}return U},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},w.prototype.copy=function(E,T,R,U){if(T=T||0,(U=U||U===0?U:this.length)!==(R=R||0)&&E.length!==0&&this.length!==0){W(R<=U,"sourceEnd < sourceStart"),W(0<=T&&T<E.length,"targetStart out of bounds"),W(0<=R&&R<this.length,"sourceStart out of bounds"),W(0<=U&&U<=this.length,"sourceEnd out of bounds"),U>this.length&&(U=this.length);var q=(U=E.length-T<U-R?E.length-T+R:U)-R;if(q<100||!w._useTypedArrays)for(var K=0;K<q;K++)E[K+T]=this[K+R];else E._set(this.subarray(R,R+q),T)}},w.prototype.slice=function(E,T){var R=this.length;if(E=G(E,R,0),T=G(T,R,R),w._useTypedArrays)return w._augment(this.subarray(E,T));for(var U=T-E,q=new w(U,void 0,!0),K=0;K<U;K++)q[K]=this[K+E];return q},w.prototype.get=function(E){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(E)},w.prototype.set=function(E,T){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(E,T)},w.prototype.readUInt8=function(E,T){if(T||(W(E!=null,"missing offset"),W(E<this.length,"Trying to read beyond buffer length")),!(E>=this.length))return this[E]},w.prototype.readUInt16LE=function(E,T){return b(this,E,!0,T)},w.prototype.readUInt16BE=function(E,T){return b(this,E,!1,T)},w.prototype.readUInt32LE=function(E,T){return C(this,E,!0,T)},w.prototype.readUInt32BE=function(E,T){return C(this,E,!1,T)},w.prototype.readInt8=function(E,T){if(T||(W(E!=null,"missing offset"),W(E<this.length,"Trying to read beyond buffer length")),!(E>=this.length))return 128&this[E]?-1*(255-this[E]+1):this[E]},w.prototype.readInt16LE=function(E,T){return j(this,E,!0,T)},w.prototype.readInt16BE=function(E,T){return j(this,E,!1,T)},w.prototype.readInt32LE=function(E,T){return O(this,E,!0,T)},w.prototype.readInt32BE=function(E,T){return O(this,E,!1,T)},w.prototype.readFloatLE=function(E,T){return _(this,E,!0,T)},w.prototype.readFloatBE=function(E,T){return _(this,E,!1,T)},w.prototype.readDoubleLE=function(E,T){return I(this,E,!0,T)},w.prototype.readDoubleBE=function(E,T){return I(this,E,!1,T)},w.prototype.writeUInt8=function(E,T,R){R||(W(E!=null,"missing value"),W(T!=null,"missing offset"),W(T<this.length,"trying to write beyond buffer length"),re(E,255)),T>=this.length||(this[T]=E)},w.prototype.writeUInt16LE=function(E,T,R){x(this,E,T,!0,R)},w.prototype.writeUInt16BE=function(E,T,R){x(this,E,T,!1,R)},w.prototype.writeUInt32LE=function(E,T,R){M(this,E,T,!0,R)},w.prototype.writeUInt32BE=function(E,T,R){M(this,E,T,!1,R)},w.prototype.writeInt8=function(E,T,R){R||(W(E!=null,"missing value"),W(T!=null,"missing offset"),W(T<this.length,"Trying to write beyond buffer length"),Je(E,127,-128)),T>=this.length||(0<=E?this.writeUInt8(E,T,R):this.writeUInt8(255+E+1,T,R))},w.prototype.writeInt16LE=function(E,T,R){D(this,E,T,!0,R)},w.prototype.writeInt16BE=function(E,T,R){D(this,E,T,!1,R)},w.prototype.writeInt32LE=function(E,T,R){L(this,E,T,!0,R)},w.prototype.writeInt32BE=function(E,T,R){L(this,E,T,!1,R)},w.prototype.writeFloatLE=function(E,T,R){N(this,E,T,!0,R)},w.prototype.writeFloatBE=function(E,T,R){N(this,E,T,!1,R)},w.prototype.writeDoubleLE=function(E,T,R){B(this,E,T,!0,R)},w.prototype.writeDoubleBE=function(E,T,R){B(this,E,T,!1,R)},w.prototype.fill=function(E,T,R){if(T=T||0,R=R||this.length,W(typeof(E=typeof(E=E||0)=="string"?E.charCodeAt(0):E)=="number"&&!isNaN(E),"value is not a number"),W(T<=R,"end < start"),R!==T&&this.length!==0){W(0<=T&&T<this.length,"start out of bounds"),W(0<=R&&R<=this.length,"end out of bounds");for(var U=T;U<R;U++)this[U]=E}},w.prototype.inspect=function(){for(var E=[],T=this.length,R=0;R<T;R++)if(E[R]=F(this[R]),R===s.INSPECT_MAX_BYTES){E[R+1]="...";break}return"<Buffer "+E.join(" ")+">"},w.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(w._useTypedArrays)return new w(this).buffer;for(var E=new Uint8Array(this.length),T=0,R=E.length;T<R;T+=1)E[T]=this[T];return E.buffer};var H=w.prototype;function G(E,T,R){return typeof E!="number"?R:T<=(E=~~E)?T:0<=E||0<=(E+=T)?E:0}function $(E){return(E=~~Math.ceil(+E))<0?0:E}function Z(E){return(Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"})(E)}function F(E){return E<16?"0"+E.toString(16):E.toString(16)}function X(E){for(var T=[],R=0;R<E.length;R++){var U=E.charCodeAt(R);if(U<=127)T.push(E.charCodeAt(R));else for(var q=R,K=(55296<=U&&U<=57343&&R++,encodeURIComponent(E.slice(q,R+1)).substr(1).split("%")),oe=0;oe<K.length;oe++)T.push(parseInt(K[oe],16))}return T}function Q(E){return g.toByteArray(E)}function de(E,T,R,U){for(var q=0;q<U&&!(q+R>=T.length||q>=E.length);q++)T[q+R]=E[q];return q}function ve(E){try{return decodeURIComponent(E)}catch{return"�"}}function re(E,T){W(typeof E=="number","cannot write a non-number as a number"),W(0<=E,"specified a negative value for writing an unsigned value"),W(E<=T,"value is larger than maximum value for type"),W(Math.floor(E)===E,"value has a fractional component")}function Je(E,T,R){W(typeof E=="number","cannot write a non-number as a number"),W(E<=T,"value larger than maximum allowed value"),W(R<=E,"value smaller than minimum allowed value"),W(Math.floor(E)===E,"value has a fractional component")}function te(E,T,R){W(typeof E=="number","cannot write a non-number as a number"),W(E<=T,"value larger than maximum allowed value"),W(R<=E,"value smaller than minimum allowed value")}function W(E,T){if(!E)throw new Error(T||"Failed assertion")}w._augment=function(E){return E._isBuffer=!0,E._get=E.get,E._set=E.set,E.get=H.get,E.set=H.set,E.write=H.write,E.toString=H.toString,E.toLocaleString=H.toString,E.toJSON=H.toJSON,E.copy=H.copy,E.slice=H.slice,E.readUInt8=H.readUInt8,E.readUInt16LE=H.readUInt16LE,E.readUInt16BE=H.readUInt16BE,E.readUInt32LE=H.readUInt32LE,E.readUInt32BE=H.readUInt32BE,E.readInt8=H.readInt8,E.readInt16LE=H.readInt16LE,E.readInt16BE=H.readInt16BE,E.readInt32LE=H.readInt32LE,E.readInt32BE=H.readInt32BE,E.readFloatLE=H.readFloatLE,E.readFloatBE=H.readFloatBE,E.readDoubleLE=H.readDoubleLE,E.readDoubleBE=H.readDoubleBE,E.writeUInt8=H.writeUInt8,E.writeUInt16LE=H.writeUInt16LE,E.writeUInt16BE=H.writeUInt16BE,E.writeUInt32LE=H.writeUInt32LE,E.writeUInt32BE=H.writeUInt32BE,E.writeInt8=H.writeInt8,E.writeInt16LE=H.writeInt16LE,E.writeInt16BE=H.writeInt16BE,E.writeInt32LE=H.writeInt32LE,E.writeInt32BE=H.writeInt32BE,E.writeFloatLE=H.writeFloatLE,E.writeFloatBE=H.writeFloatBE,E.writeDoubleLE=H.writeDoubleLE,E.writeDoubleBE=H.writeDoubleBE,E.fill=H.fill,E.inspect=H.inspect,E.toArrayBuffer=H.toArrayBuffer,E}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,s){(function(o,i,g,l,u,d,f,p,v){var g=n("buffer").Buffer,m=4,w=new g(m);w.fill(0),r.exports={hash:function(S,k,y,b){for(var C=k((function(x,M){x.length%m!=0&&(D=x.length+(m-x.length%m),x=g.concat([x,w],D));for(var D,L=[],N=M?x.readInt32BE:x.readInt32LE,B=0;B<x.length;B+=m)L.push(N.call(x,B));return L})(S=g.isBuffer(S)?S:new g(S),b),8*S.length),k=b,j=new g(y),O=k?j.writeInt32BE:j.writeInt32LE,_=0;_<C.length;_++)O.call(j,C[_],4*_,!0);return j}}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(n,r,s){(function(o,i,g,l,u,d,f,p,v){var g=n("buffer").Buffer,m=n("./sha"),w=n("./sha256"),S=n("./rng"),k={sha1:m,sha256:w,md5:n("./md5")},y=64,b=new g(y);function C(x,M){var D=k[x=x||"sha1"],L=[];return D||j("algorithm:",x,"is not yet supported"),{update:function(N){return g.isBuffer(N)||(N=new g(N)),L.push(N),N.length,this},digest:function(N){var B=g.concat(L),B=M?(function(H,G,$){g.isBuffer(G)||(G=new g(G)),g.isBuffer($)||($=new g($)),G.length>y?G=H(G):G.length<y&&(G=g.concat([G,b],y));for(var Z=new g(y),F=new g(y),X=0;X<y;X++)Z[X]=54^G[X],F[X]=92^G[X];return $=H(g.concat([Z,$])),H(g.concat([F,$]))})(D,M,B):D(B);return L=null,N?B.toString(N):B}}}function j(){var x=[].slice.call(arguments).join(" ");throw new Error([x,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
160
+ `))}b.fill(0),s.createHash=function(x){return C(x)},s.createHmac=C,s.randomBytes=function(x,M){if(!M||!M.call)return new g(S(x));try{M.call(this,void 0,new g(S(x)))}catch(D){M(D)}};var O,_=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],I=function(x){s[x]=function(){j("sorry,",x,"is not implemented yet")}};for(O in _)I(_[O])}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("./helpers");function m(j,O){j[O>>5]|=128<<O%32,j[14+(O+64>>>9<<4)]=O;for(var _=1732584193,I=-271733879,x=-1732584194,M=271733878,D=0;D<j.length;D+=16){var L=_,N=I,B=x,H=M,_=S(_,I,x,M,j[D+0],7,-680876936),M=S(M,_,I,x,j[D+1],12,-389564586),x=S(x,M,_,I,j[D+2],17,606105819),I=S(I,x,M,_,j[D+3],22,-1044525330);_=S(_,I,x,M,j[D+4],7,-176418897),M=S(M,_,I,x,j[D+5],12,1200080426),x=S(x,M,_,I,j[D+6],17,-1473231341),I=S(I,x,M,_,j[D+7],22,-45705983),_=S(_,I,x,M,j[D+8],7,1770035416),M=S(M,_,I,x,j[D+9],12,-1958414417),x=S(x,M,_,I,j[D+10],17,-42063),I=S(I,x,M,_,j[D+11],22,-1990404162),_=S(_,I,x,M,j[D+12],7,1804603682),M=S(M,_,I,x,j[D+13],12,-40341101),x=S(x,M,_,I,j[D+14],17,-1502002290),_=k(_,I=S(I,x,M,_,j[D+15],22,1236535329),x,M,j[D+1],5,-165796510),M=k(M,_,I,x,j[D+6],9,-1069501632),x=k(x,M,_,I,j[D+11],14,643717713),I=k(I,x,M,_,j[D+0],20,-373897302),_=k(_,I,x,M,j[D+5],5,-701558691),M=k(M,_,I,x,j[D+10],9,38016083),x=k(x,M,_,I,j[D+15],14,-660478335),I=k(I,x,M,_,j[D+4],20,-405537848),_=k(_,I,x,M,j[D+9],5,568446438),M=k(M,_,I,x,j[D+14],9,-1019803690),x=k(x,M,_,I,j[D+3],14,-187363961),I=k(I,x,M,_,j[D+8],20,1163531501),_=k(_,I,x,M,j[D+13],5,-1444681467),M=k(M,_,I,x,j[D+2],9,-51403784),x=k(x,M,_,I,j[D+7],14,1735328473),_=y(_,I=k(I,x,M,_,j[D+12],20,-1926607734),x,M,j[D+5],4,-378558),M=y(M,_,I,x,j[D+8],11,-2022574463),x=y(x,M,_,I,j[D+11],16,1839030562),I=y(I,x,M,_,j[D+14],23,-35309556),_=y(_,I,x,M,j[D+1],4,-1530992060),M=y(M,_,I,x,j[D+4],11,1272893353),x=y(x,M,_,I,j[D+7],16,-155497632),I=y(I,x,M,_,j[D+10],23,-1094730640),_=y(_,I,x,M,j[D+13],4,681279174),M=y(M,_,I,x,j[D+0],11,-358537222),x=y(x,M,_,I,j[D+3],16,-722521979),I=y(I,x,M,_,j[D+6],23,76029189),_=y(_,I,x,M,j[D+9],4,-640364487),M=y(M,_,I,x,j[D+12],11,-421815835),x=y(x,M,_,I,j[D+15],16,530742520),_=b(_,I=y(I,x,M,_,j[D+2],23,-995338651),x,M,j[D+0],6,-198630844),M=b(M,_,I,x,j[D+7],10,1126891415),x=b(x,M,_,I,j[D+14],15,-1416354905),I=b(I,x,M,_,j[D+5],21,-57434055),_=b(_,I,x,M,j[D+12],6,1700485571),M=b(M,_,I,x,j[D+3],10,-1894986606),x=b(x,M,_,I,j[D+10],15,-1051523),I=b(I,x,M,_,j[D+1],21,-2054922799),_=b(_,I,x,M,j[D+8],6,1873313359),M=b(M,_,I,x,j[D+15],10,-30611744),x=b(x,M,_,I,j[D+6],15,-1560198380),I=b(I,x,M,_,j[D+13],21,1309151649),_=b(_,I,x,M,j[D+4],6,-145523070),M=b(M,_,I,x,j[D+11],10,-1120210379),x=b(x,M,_,I,j[D+2],15,718787259),I=b(I,x,M,_,j[D+9],21,-343485551),_=C(_,L),I=C(I,N),x=C(x,B),M=C(M,H)}return Array(_,I,x,M)}function w(j,O,_,I,x,M){return C((O=C(C(O,j),C(I,M)))<<x|O>>>32-x,_)}function S(j,O,_,I,x,M,D){return w(O&_|~O&I,j,O,x,M,D)}function k(j,O,_,I,x,M,D){return w(O&I|_&~I,j,O,x,M,D)}function y(j,O,_,I,x,M,D){return w(O^_^I,j,O,x,M,D)}function b(j,O,_,I,x,M,D){return w(_^(O|~I),j,O,x,M,D)}function C(j,O){var _=(65535&j)+(65535&O);return(j>>16)+(O>>16)+(_>>16)<<16|65535&_}r.exports=function(j){return g.hash(j,m,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){r.exports=function(g){for(var m,w=new Array(g),S=0;S<g;S++)(3&S)==0&&(m=4294967296*Math.random()),w[S]=m>>>((3&S)<<3)&255;return w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("./helpers");function m(k,y){k[y>>5]|=128<<24-y%32,k[15+(y+64>>9<<4)]=y;for(var b,C,j,O=Array(80),_=1732584193,I=-271733879,x=-1732584194,M=271733878,D=-1009589776,L=0;L<k.length;L+=16){for(var N=_,B=I,H=x,G=M,$=D,Z=0;Z<80;Z++){O[Z]=Z<16?k[L+Z]:S(O[Z-3]^O[Z-8]^O[Z-14]^O[Z-16],1);var F=w(w(S(_,5),(F=I,C=x,j=M,(b=Z)<20?F&C|~F&j:!(b<40)&&b<60?F&C|F&j|C&j:F^C^j)),w(w(D,O[Z]),(b=Z)<20?1518500249:b<40?1859775393:b<60?-1894007588:-899497514)),D=M,M=x,x=S(I,30),I=_,_=F}_=w(_,N),I=w(I,B),x=w(x,H),M=w(M,G),D=w(D,$)}return Array(_,I,x,M,D)}function w(k,y){var b=(65535&k)+(65535&y);return(k>>16)+(y>>16)+(b>>16)<<16|65535&b}function S(k,y){return k<<y|k>>>32-y}r.exports=function(k){return g.hash(k,m,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){function g(y,b){var C=(65535&y)+(65535&b);return(y>>16)+(b>>16)+(C>>16)<<16|65535&C}function m(y,b){var C,j=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),O=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),_=new Array(64);y[b>>5]|=128<<24-b%32,y[15+(b+64>>9<<4)]=b;for(var I,x,M=0;M<y.length;M+=16){for(var D=O[0],L=O[1],N=O[2],B=O[3],H=O[4],G=O[5],$=O[6],Z=O[7],F=0;F<64;F++)_[F]=F<16?y[F+M]:g(g(g((x=_[F-2],S(x,17)^S(x,19)^k(x,10)),_[F-7]),(x=_[F-15],S(x,7)^S(x,18)^k(x,3))),_[F-16]),C=g(g(g(g(Z,S(x=H,6)^S(x,11)^S(x,25)),H&G^~H&$),j[F]),_[F]),I=g(S(I=D,2)^S(I,13)^S(I,22),D&L^D&N^L&N),Z=$,$=G,G=H,H=g(B,C),B=N,N=L,L=D,D=g(C,I);O[0]=g(D,O[0]),O[1]=g(L,O[1]),O[2]=g(N,O[2]),O[3]=g(B,O[3]),O[4]=g(H,O[4]),O[5]=g(G,O[5]),O[6]=g($,O[6]),O[7]=g(Z,O[7])}return O}var w=n("./helpers"),S=function(y,b){return y>>>b|y<<32-b},k=function(y,b){return y>>>b};r.exports=function(y){return w.hash(y,m,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){s.read=function(g,m,w,S,M){var y,b,C=8*M-S-1,j=(1<<C)-1,O=j>>1,_=-7,I=w?M-1:0,x=w?-1:1,M=g[m+I];for(I+=x,y=M&(1<<-_)-1,M>>=-_,_+=C;0<_;y=256*y+g[m+I],I+=x,_-=8);for(b=y&(1<<-_)-1,y>>=-_,_+=S;0<_;b=256*b+g[m+I],I+=x,_-=8);if(y===0)y=1-O;else{if(y===j)return b?NaN:1/0*(M?-1:1);b+=Math.pow(2,S),y-=O}return(M?-1:1)*b*Math.pow(2,y-S)},s.write=function(g,m,w,S,k,D){var b,C,j=8*D-k-1,O=(1<<j)-1,_=O>>1,I=k===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=S?0:D-1,M=S?1:-1,D=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===1/0?(C=isNaN(m)?1:0,b=O):(b=Math.floor(Math.log(m)/Math.LN2),m*(S=Math.pow(2,-b))<1&&(b--,S*=2),2<=(m+=1<=b+_?I/S:I*Math.pow(2,1-_))*S&&(b++,S/=2),O<=b+_?(C=0,b=O):1<=b+_?(C=(m*S-1)*Math.pow(2,k),b+=_):(C=m*Math.pow(2,_-1)*Math.pow(2,k),b=0));8<=k;g[w+x]=255&C,x+=M,C/=256,k-=8);for(b=b<<k|C,j+=k;0<j;g[w+x]=255&b,x+=M,b/=256,j-=8);g[w+x-M]|=128*D}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g,m,w;function S(){}(o=r.exports={}).nextTick=(m=typeof window<"u"&&window.setImmediate,w=typeof window<"u"&&window.postMessage&&window.addEventListener,m?function(k){return window.setImmediate(k)}:w?(g=[],window.addEventListener("message",function(k){var y=k.source;y!==window&&y!==null||k.data!=="process-tick"||(k.stopPropagation(),0<g.length&&g.shift()())},!0),function(k){g.push(k),window.postMessage("process-tick","*")}):function(k){setTimeout(k,0)}),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=S,o.addListener=S,o.once=S,o.off=S,o.removeListener=S,o.removeAllListeners=S,o.emit=S,o.binding=function(k){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(k){throw new Error("process.chdir is not supported")}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})})(pi)),pi.exports}var p1=f1();const hi=Uu(p1);P();P();function Rl(e,t,n){const r=t.split("."),s=A({},e);let o=s;for(let i=0;i<r.length;i++){const[a,l]=r[i].replace("]","").split("["),u=i===r.length-1;if(l!==void 0){Array.isArray(o[a])||(o[a]=[]);const d=Number(l);if(u){o[a][d]=n;continue}o[a][d]===void 0&&(o[a][d]={}),o=o[a][d];continue}if(u){o[a]=n;continue}o[a]===void 0&&(o[a]={}),o=o[a]}return A(A({},e),s)}P();P();var h1={Button:"_Button_10byl_1","Button--medium":"_Button--medium_10byl_29","Button--large":"_Button--large_10byl_37","Button-icon":"_Button-icon_10byl_44","Button--primary":"_Button--primary_10byl_48","Button--secondary":"_Button--secondary_10byl_67","Button--flush":"_Button--flush_10byl_84","Button--disabled":"_Button--disabled_10byl_88","Button--fullWidth":"_Button--fullWidth_10byl_95","Button-spinner":"_Button-spinner_10byl_100"};P();var g1=/^(data-.*)$/,v1=e=>{let t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&g1.test(n)&&(t[n]=e[n]);return t},gi=ne("Button",h1),da=e=>{var t=e,{children:n,href:r,onClick:s,variant:o="primary",type:i,disabled:a,tabIndex:l,newTab:u,fullWidth:d,icon:f,size:p="medium",loading:v=!1}=t,g=Kt(t,["children","href","onClick","variant","type","disabled","tabIndex","newTab","fullWidth","icon","size","loading"]);const[m,w]=h.useState(v);h.useEffect(()=>w(v),[v]);const S=r?"a":i?"button":"span",k=v1(g);return c.jsxs(S,z(A({className:gi({primary:o==="primary",secondary:o==="secondary",disabled:a,fullWidth:d,[p]:!0}),onClick:b=>{s&&(w(!0),Promise.resolve(s(b)).then(()=>{w(!1)}))},type:i,disabled:a||m,tabIndex:l,target:u?"_blank":void 0,rel:u?"noreferrer":void 0,href:r},k),{children:[f&&c.jsx("div",{className:gi("icon"),children:f}),n,m&&c.jsx("div",{className:gi("spinner"),children:c.jsx(On,{size:14})})]}))};P();P();var Rn={InputWrapper:"_InputWrapper_bsxfo_1","Input-label":"_Input-label_bsxfo_5","Input-labelIcon":"_Input-labelIcon_bsxfo_14","Input-disabledIcon":"_Input-disabledIcon_bsxfo_21","Input-input":"_Input-input_bsxfo_26",Input:"_Input_bsxfo_1","Input--readOnly":"_Input--readOnly_bsxfo_82","Input-radioGroupItems":"_Input-radioGroupItems_bsxfo_93","Input-radio":"_Input-radio_bsxfo_93","Input-radioInner":"_Input-radioInner_bsxfo_110","Input-radioInput":"_Input-radioInput_bsxfo_155"},ao=ne("Input",Rn),Ih=({children:e,icon:t,label:n,el:r="label",readOnly:s,className:o})=>{const i=r;return c.jsxs(i,{className:o,children:[c.jsxs("div",{className:ao("label"),children:[t?c.jsx("div",{className:ao("labelIcon"),children:t}):c.jsx(c.Fragment,{}),n,s&&c.jsx("div",{className:ao("disabledIcon"),title:"Read-only",children:c.jsx(hy,{size:"12"})})]}),e]})},m1=({children:e,icon:t,label:n,el:r="label",readOnly:s})=>{const o=V(a=>a.overrides),i=h.useMemo(()=>o.fieldLabel||Ih,[o]);return n?c.jsx(i,{label:n,icon:t,className:ao({readOnly:s}),readOnly:s,el:r,children:e}):c.jsx(c.Fragment,{children:e})};P();P();P();P();var Eh={ArrayField:"_ArrayField_1vaho_5","ArrayField--isDraggingFrom":"_ArrayField--isDraggingFrom_1vaho_13","ArrayField-addButton":"_ArrayField-addButton_1vaho_18","ArrayField--hasItems":"_ArrayField--hasItems_1vaho_33","ArrayField-inner":"_ArrayField-inner_1vaho_59",ArrayFieldItem:"_ArrayFieldItem_1vaho_67","ArrayFieldItem--isDragging":"_ArrayFieldItem--isDragging_1vaho_78","ArrayFieldItem--isExpanded":"_ArrayFieldItem--isExpanded_1vaho_82","ArrayFieldItem-summary":"_ArrayFieldItem-summary_1vaho_97","ArrayFieldItem--noFields":"_ArrayFieldItem--noFields_1vaho_122","ArrayField--addDisabled":"_ArrayField--addDisabled_1vaho_131","ArrayFieldItem-body":"_ArrayFieldItem-body_1vaho_170","ArrayFieldItem-fieldset":"_ArrayFieldItem-fieldset_1vaho_179","ArrayFieldItem-rhs":"_ArrayFieldItem-rhs_1vaho_187","ArrayFieldItem-actions":"_ArrayFieldItem-actions_1vaho_193"};P();P();function Gt(e,t){const n=h.useContext(e);if(!n)throw new Error("useContextStore must be used inside context");return To(n,Ge(t))}function y1(e){return({children:n,value:r})=>{const[s]=h.useState(()=>cr(()=>r));return c.jsx(e.Provider,{value:s,children:n})}}function b1(e){const t=h.createContext(cr(Sa(()=>e)));return{ctx:t,Provider:y1(t)}}var js=b1({}),Ll=()=>h.useContext(js.ctx);function Go(e){const t=h.useContext(js.ctx);if(!t)throw new Error("useContextStore must be used inside context");return To(t,Ge(e))}P();P();var _1={DragIcon:"_DragIcon_17p8x_1","DragIcon--disabled":"_DragIcon--disabled_17p8x_8"},x1=ne("DragIcon",_1),Ch=({isDragDisabled:e})=>c.jsx("div",{className:x1({disabled:e}),children:c.jsx("svg",{viewBox:"0 0 20 20",width:"12",fill:"currentColor",children:c.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})})});P();P();var cu={delay:{value:200,tolerance:10}},uu={delay:{value:200,tolerance:10},distance:{value:5}},jh=({other:e=uu,mouse:t,touch:n=cu}={touch:cu,other:uu})=>{const[r]=h.useState(()=>[Tp.configure({activationConstraints(s,o){var i;const{pointerType:a,target:l}=s;return a==="mouse"&&vr(l)&&(o.handle===l||(i=o.handle)!=null&&i.contains(l))?t:a==="touch"?n:e}})]);return r};P();P();P();var Qn=(e,t,n,r,s)=>{},vi="increasing",w1=(e,t)=>{var n;const{dragOperation:r,droppable:s}=e,{shape:o}=s,{position:i}=r,a=(n=r.shape)==null?void 0:n.current;if(!a||!o)return null;const l=o.center,u=Math.sqrt(Math.pow(l.x-t.x,2)+Math.pow(l.y-t.y,2)),d=Math.sqrt(Math.pow(l.x-i.current.x,2)+Math.pow(l.y-i.current.y,2));return vi=d===u?vi:d<u?"decreasing":"increasing",Qn(a.center,l,s.id.toString()),vi==="decreasing"?{id:s.id,value:1,type:Ht.Collision}:null};P();var Ph=(e,t)=>e==="dynamic"?Math.abs(t.y)>Math.abs(t.x)?t.y===0?null:t.y>0?"down":"up":t.x===0?null:t.x>0?"right":"left":e==="x"?t.x===0?null:t.x>0?"right":"left":t.y===0?null:t.y>0?"down":"up";P();var S1=(e,t,n,r=0)=>{const s=e.boundingRectangle,o=t.center;if(n==="down"){const a=r*t.boundingRectangle.height;return s.bottom>=o.y+a}else if(n==="up"){const a=r*t.boundingRectangle.height;return s.top<o.y-a}else if(n==="left"){const a=r*t.boundingRectangle.width;return o.x-a>=s.left}const i=r*t.boundingRectangle.width;return s.right-i>=o.x};P();var du=10,kt={current:{x:0,y:0},delta:{x:0,y:0},previous:{x:0,y:0},direction:null},k1=(e,t="dynamic")=>(kt.current=e,kt.delta={x:e.x-kt.previous.x,y:e.y-kt.previous.y},kt.direction=Ph(t,kt.delta)||kt.direction,(Math.abs(kt.delta.x)>du||Math.abs(kt.delta.y)>du)&&(kt.previous=tt.from(e)),kt);P();var I1=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=tt.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},E1=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const o=r?At.from(r.current.boundingRectangle).corners:void 0,a=At.from(n.shape.boundingRectangle).corners.reduce((l,u,d)=>{var f;return l+tt.distance(tt.from(u),(f=o==null?void 0:o[d])!=null?f:s.current)},0)/4;return{id:n.id,value:1/a,type:Ht.Collision,priority:bt.Normal}};P();var fa=cr(()=>({fallbackEnabled:!1})),mi="",Ah=(e,t=.05)=>(n=>{var r,s,o,i,a;const{dragOperation:l,droppable:u}=n,{position:d}=l,f=(r=l.shape)==null?void 0:r.current,{shape:p}=u;if(!f||!p)return null;const{center:v}=f,{fallbackEnabled:g}=fa.getState(),m=k1(d.current,e),w={direction:m.direction},{center:S}=p,k=S1(f,p,m.direction,t);if(((s=l.source)==null?void 0:s.id)===u.id){const C=w1(n,m.previous);if(Qn(v,S,u.id.toString()),C)return z(A({},C),{priority:bt.Highest,data:w})}const y=f.intersectionArea(p),b=y/p.area;if(y&&k){Qn(v,S,u.id.toString());const C={id:u.id,value:b,priority:bt.High,type:Ht.Collision},j=mi===u.id;return mi="",z(A({},C),{id:j?"flush":C.id,data:w})}if(g&&((o=l.source)==null?void 0:o.id)!==u.id){const C=p.boundingRectangle.right>f.boundingRectangle.left&&p.boundingRectangle.left<f.boundingRectangle.right,j=p.boundingRectangle.bottom>f.boundingRectangle.top&&p.boundingRectangle.top<f.boundingRectangle.bottom;if(e==="y"&&C||j){const O=E1(n);if(O){const _=Ph(e,{x:f.center.x-(((i=u.shape)==null?void 0:i.center.x)||0),y:f.center.y-(((a=u.shape)==null?void 0:a.center.y)||0)});return w.direction=_,y?(Qn(v,S,u.id.toString()),mi=u.id,z(A({},O),{priority:bt.Low,data:w})):(Qn(v,S,u.id.toString()),z(A({},O),{priority:bt.Lowest,data:w}))}}}return Qn(v,S,u.id.toString()),null}),C1=({children:e,onDragStart:t,onDragEnd:n,onMove:r})=>{const s=jh({mouse:{distance:{value:5}}});return c.jsx(Yp,{sensors:s,onDragStart:o=>{var i,a;return t((a=(i=o.operation.source)==null?void 0:i.id.toString())!=null?a:"")},onDragOver:(o,i)=>{var a;o.preventDefault();const{operation:l}=o,{source:u,target:d}=l;if(!u||!d)return;let f=u.data.index,p=d.data.index;const v=(a=i.collisionObserver.collisions[0])==null?void 0:a.data;if(f!==p&&u.id!==d.id){const g=(v==null?void 0:v.direction)==="up"?"before":"after";p>=f&&(p=p-1),g==="after"&&(p=p+1),r({source:f,target:p})}},onDragEnd:()=>{setTimeout(()=>{n()},250)},children:e})},j1=({id:e,index:t,disabled:n,children:r,type:s="item"})=>{const{ref:o,isDragging:i,isDropping:a,handleRef:l}=vh({id:e,type:s,index:t,disabled:n,data:{index:t},collisionDetector:Ah("y")});return r({isDragging:i,isDropping:a,ref:o,handleRef:l})};P();var Oo=h.createContext({}),Nl=()=>{const e=h.useContext(Oo);return z(A({},e),{readOnlyFields:e.readOnlyFields||{}})},P1=({children:e,name:t,subName:n,wildcardName:r=t,readOnlyFields:s})=>{const o=`${t}.${n}`,i=`${r}.${n}`,a=h.useMemo(()=>Object.keys(s).reduce((l,u)=>{if(u.indexOf(o)>-1||u.indexOf(i)>-1){const f=new RegExp(`^(${t}|${r}).`.replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\./g,"\\.").replace(/\*/g,"\\*")),p=u.replace(f,"");return z(A({},l),{[p]:s[u]})}return l},{}),[t,n,r,s]);return c.jsx(Oo.Provider,{value:{readOnlyFields:a,localName:n},children:e})};P();var Ps=(e,t)=>t.split(".").reduce((r,s)=>{if(!r)return;const[o,i]=s.replace("]","").split("["),a=r[o];return i&&a?a[parseInt(i)]:a},e);P();var A1=({field:e,id:t,index:n,name:r,subName:s,localName:o,onChange:i,forceReadOnly:a})=>{const l=typeof n<"u"?`${r}[${n}]`:r,u=r?`${l}.${s}`:s,d=typeof n<"u"?`${o}[${n}]`:o??s,f=typeof n<"u"?`${o}[*]`:o,p=`${d}.${s}`,v=`${f}.${s}`,{readOnlyFields:g}=Nl(),m=a||(typeof g[u]<"u"?g[p]:g[v]),w=e.label||s;return c.jsx(P1,{name:d,wildcardName:f,subName:s,readOnlyFields:g,children:c.jsx(Rh,{name:u,label:w,id:t,readOnly:m,field:z(A({},e),{label:w}),onChange:(S,k)=>{i(S,k,s)}})})},Oh=h.memo(A1),yi=ne("ArrayField",Eh),cn=ne("ArrayFieldItem",Eh),O1=({index:e,originalIndex:t,field:n,name:r})=>{const s=Go(i=>{const a=`${[r]}[${e}]`;return Ps(i,a)});return h.useMemo(()=>s&&n.getItemSummary?n.getItemSummary(s,e):`Item #${t}`,[s,n,t,e])},M1=h.memo(O1),D1=({id:e,arrayId:t,index:n,dragIndex:r,originalIndex:s,field:o,onChange:i,onToggleExpand:a,readOnly:l,actions:u,name:d,localName:f})=>{const p=V(m=>{var w;return((w=m.state.ui.arrayState[t])==null?void 0:w.openId)===e}),v=V(m=>m.permissions.getPermissions({item:m.selectedItem}).edit),g=h.useMemo(()=>o.arrayFields?Object.values(o.arrayFields).some(m=>m.type!=="slot"&&m.visible!==!1):!1,[o.arrayFields]);return c.jsx(j1,{id:e,index:r,disabled:l,children:({isDragging:m,ref:w,handleRef:S})=>c.jsxs("div",{ref:w,className:cn({isExpanded:p&&g,isDragging:m,noFields:!g}),children:[c.jsxs("div",{ref:S,onClick:k=>{m||(k.preventDefault(),k.stopPropagation(),g&&a(e,p))},className:cn("summary"),children:[c.jsx(M1,{index:n,originalIndex:s,field:o,name:d}),c.jsxs("div",{className:cn("rhs"),children:[!l&&c.jsx("div",{className:cn("actions"),children:u}),c.jsx("div",{children:c.jsx(Ch,{})})]})]}),c.jsx("div",{className:cn("body"),children:p&&g&&c.jsx("fieldset",{className:cn("fieldset"),children:Object.keys(o.arrayFields).map(k=>{const y=o.arrayFields[k];return c.jsx(Oh,{id:`${e}_${k}`,name:d,index:n,subName:k,localName:f,field:y,onChange:i,forceReadOnly:!v},`${e}_${k}_${n}`)})})})]})})},T1=h.memo(D1),R1=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,readOnly:i,Label:a=l=>c.jsx("div",A({},l))})=>{const l=V(L=>L.setUi),u=Ae(),d=Ll(),{localName:f=r}=Nl(),p=()=>{var L;return(L=Ps(d.getState(),r))!=null?L:[]},v=h.useCallback(()=>{var L;const{state:N}=u.getState(),B=N.ui.arrayState[n];if((L=B==null?void 0:B.items)!=null&&L.length)return B;const H=p();return{items:Array.from(H||[]).map((G,$)=>({_originalIndex:$,_currentIndex:$,_arrayId:`${n}-${$}`})),openId:""}},[u,n,p,r]),g=Go(()=>p().length),m=h.useMemo(v,[v]),w=V(L=>{const N=L.state.ui.arrayState[n];return N??m}),S=Ae(),k=h.useCallback(L=>{const N=S.getState().state;return{arrayState:z(A({},N.ui.arrayState),{[n]:A(A({},v()),L)})}},[S]),y=h.useCallback(()=>v().items.reduce((L,N)=>N._originalIndex>L?N._originalIndex:L,-1),[]),b=h.useCallback(L=>{let N=y();const B=v(),H=Array.from(L||[]).map((G,$)=>{var Z,F,X;const Q=B.items[$],de={_originalIndex:(Z=Q==null?void 0:Q._originalIndex)!=null?Z:N+1,_currentIndex:(F=Q==null?void 0:Q._currentIndex)!=null?F:$,_arrayId:((X=B.items[$])==null?void 0:X._arrayId)||`${n}-${N+1}`};return de._originalIndex>N&&(N=de._originalIndex),de});return z(A({},B),{items:H})},[]),[C,j]=h.useState(""),O=!!C,_=h.useRef([]);h.useEffect(()=>{_.current=p()},[]);const I=h.useCallback(L=>{if(e.type!=="array"||!e.arrayFields)return;const N=S.getState().config;return po({value:L,fields:e.arrayFields,mappers:{slot:({value:B})=>B.map(G=>Aa(G,N,!0))},config:N})},[S,e]),x=h.useCallback(()=>{const L=v(),N=L.items.map((G,$)=>z(A({},G),{_currentIndex:$})),B=S.getState().state,H={arrayState:z(A({},B.ui.arrayState),{[n]:z(A({},L),{items:N})})};l(H,!1)},[]),M=h.useCallback(L=>{const N=b(L);l(k(N),!1),t(L)},[b,l,k,t]);if(h.useEffect(()=>{const L=b(p());l(k(L),!1)},[g]),e.type!=="array"||!e.arrayFields)return null;const D=e.max!==void 0&&(w==null?void 0:w.items.length)>=e.max||i;return c.jsx(a,{label:s||r,icon:o||c.jsx(Lo,{size:16}),el:"div",readOnly:i,children:c.jsx(C1,{onDragStart:L=>{_.current=p(),j(L),x()},onDragEnd:()=>{j(""),t(_.current);const L=d.getState();d.setState(Rl(L,r,_.current)),x()},onMove:L=>{const N=v();if(N.items[L.source]._arrayId!==C)return;const B=vc(_.current,L.source,L.target),H=vc(N.items,L.source,L.target),G=S.getState().state,$={arrayState:z(A({},G.ui.arrayState),{[n]:z(A({},N),{items:H})})};l($,!1),_.current=B},children:c.jsxs("div",{className:yi({hasItems:g>0,addDisabled:D}),children:[w.items.length>0&&c.jsx("div",{className:yi("inner"),"data-dnd-container":!0,children:w.items.map((L,N)=>{const{_arrayId:B=`${n}-${N}`,_originalIndex:H=N,_currentIndex:G=N}=L;return c.jsx(T1,{index:G,dragIndex:N,originalIndex:H,arrayId:n,id:B,readOnly:i,field:e,name:r,localName:f,onChange:($,Z,F)=>{const X=p(),Q=Array.from(X||[])[N]||{};t(Zy(X,N,z(A({},Q),{[F]:$})),Z)},onToggleExpand:($,Z)=>{l(k(Z?{openId:""}:{openId:$}))},actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:cn("action"),children:c.jsx(jt,{type:"button",disabled:!!D,onClick:$=>{$.stopPropagation();const F=[...p()||[]],X=I(F[N]);F.splice(N,0,X),M(F)},title:"Duplicate",children:c.jsx(bd,{size:16})})}),c.jsx("div",{className:cn("action"),children:c.jsx(jt,{type:"button",disabled:e.min!==void 0&&e.min>=w.items.length,onClick:$=>{$.stopPropagation();const F=[...p()||[]];F.splice(N,1),M(F)},title:"Delete",children:c.jsx(kd,{size:16})})})]})},B)})}),!D&&c.jsx("button",{type:"button",className:yi("addButton"),onClick:()=>{var L;if(O)return;const B=p()||[],H=typeof e.defaultItemProps=="function"?e.defaultItemProps(B.length):(L=e.defaultItemProps)!=null?L:{},G=ja(I(H),e.arrayFields),$=[...B,G];M($)},children:c.jsx(_y,{size:21})})]})})})};P();P();P();var As=e=>Go(t=>Ps(t,e));P();var L1=e=>V(t=>t.state.ui.field.focus===e),Mh=(e,t)=>{const n=As(e),r=L1(e),[s,o]=h.useState(n==null?void 0:n.toString()),i=h.useCallback(a=>{o(a),t(a)},[t]);return h.useEffect(()=>{r||o(n)},[r,n]),[s??"",i]},N1=ne("Input",Rn),fu=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const[l,u]=Mh(s,t);return c.jsx(a,{label:o||s,icon:i||c.jsxs(c.Fragment,{children:[e.type==="text"&&c.jsx(No,{size:16}),e.type==="number"&&c.jsx(sy,{size:16})]}),readOnly:n,children:c.jsx("input",{className:N1("input"),autoComplete:"off",type:e.type,title:o||s,name:s,value:l,onChange:d=>{if(e.type==="number"){const f=Number(d.currentTarget.value);if(typeof e.min<"u"&&f<e.min||typeof e.max<"u"&&f>e.max)return;u(f)}else u(d.currentTarget.value)},readOnly:n,tabIndex:n?-1:void 0,id:r,min:e.type==="number"?e.min:void 0,max:e.type==="number"?e.max:void 0,placeholder:e.type==="text"||e.type==="number"?e.placeholder:void 0,step:e.type==="number"?e.step:void 0})})};P();P();P();var Dh={"ExternalInput-actions":"_ExternalInput-actions_91ls0_1","ExternalInput-button":"_ExternalInput-button_91ls0_5","ExternalInput--dataSelected":"_ExternalInput--dataSelected_91ls0_24","ExternalInput--readOnly":"_ExternalInput--readOnly_91ls0_31","ExternalInput-detachButton":"_ExternalInput-detachButton_91ls0_35",ExternalInput:"_ExternalInput_91ls0_1",ExternalInputModal:"_ExternalInputModal_91ls0_79","ExternalInputModal-grid":"_ExternalInputModal-grid_91ls0_89","ExternalInputModal--filtersToggled":"_ExternalInputModal--filtersToggled_91ls0_100","ExternalInputModal-filters":"_ExternalInputModal-filters_91ls0_105","ExternalInputModal-masthead":"_ExternalInputModal-masthead_91ls0_124","ExternalInputModal-tableWrapper":"_ExternalInputModal-tableWrapper_91ls0_133","ExternalInputModal-table":"_ExternalInputModal-table_91ls0_133","ExternalInputModal-thead":"_ExternalInputModal-thead_91ls0_149","ExternalInputModal-th":"_ExternalInputModal-th_91ls0_149","ExternalInputModal-td":"_ExternalInputModal-td_91ls0_164","ExternalInputModal-tr":"_ExternalInputModal-tr_91ls0_169","ExternalInputModal-tbody":"_ExternalInputModal-tbody_91ls0_176","ExternalInputModal--hasData":"_ExternalInputModal--hasData_91ls0_202","ExternalInputModal-loadingBanner":"_ExternalInputModal-loadingBanner_91ls0_206","ExternalInputModal--isLoading":"_ExternalInputModal--isLoading_91ls0_223","ExternalInputModal-searchForm":"_ExternalInputModal-searchForm_91ls0_227","ExternalInputModal-search":"_ExternalInputModal-search_91ls0_227","ExternalInputModal-searchIcon":"_ExternalInputModal-searchIcon_91ls0_264","ExternalInputModal-searchIconText":"_ExternalInputModal-searchIconText_91ls0_289","ExternalInputModal-searchInput":"_ExternalInputModal-searchInput_91ls0_299","ExternalInputModal-searchActions":"_ExternalInputModal-searchActions_91ls0_313","ExternalInputModal-searchActionIcon":"_ExternalInputModal-searchActionIcon_91ls0_326","ExternalInputModal-footerContainer":"_ExternalInputModal-footerContainer_91ls0_330","ExternalInputModal-footer":"_ExternalInputModal-footer_91ls0_330","ExternalInputModal-field":"_ExternalInputModal-field_91ls0_343"};P();P();var z1={Modal:"_Modal_ikbaj_1","Modal--isOpen":"_Modal--isOpen_ikbaj_15","Modal-inner":"_Modal-inner_ikbaj_19"},pu=ne("Modal",z1),$1=({children:e,onClose:t,isOpen:n})=>{const[r,s]=h.useState(null);return h.useEffect(()=>{s(document.getElementById("puck-portal-root"))},[]),r?ms.createPortal(c.jsx("div",{className:pu({isOpen:n}),onClick:t,children:c.jsx("div",{className:pu("inner"),onClick:o=>o.stopPropagation(),children:e})}),r):c.jsx("div",{})};P();P();var F1={Heading:"_Heading_qxrry_1","Heading--xxxxl":"_Heading--xxxxl_qxrry_12","Heading--xxxl":"_Heading--xxxl_qxrry_18","Heading--xxl":"_Heading--xxl_qxrry_22","Heading--xl":"_Heading--xl_qxrry_26","Heading--l":"_Heading--l_qxrry_30","Heading--m":"_Heading--m_qxrry_34","Heading--s":"_Heading--s_qxrry_38","Heading--xs":"_Heading--xs_qxrry_42"},B1=ne("Heading",F1),zl=({children:e,rank:t,size:n="m"})=>{const r=t?`h${t}`:"span";return c.jsx(r,{className:B1({[n]:!0}),children:e})};P();var Ws=ne("ExternalInput",Dh),je=ne("ExternalInputModal",Dh),bi={},H1=({field:e,onChange:t,value:n=null,name:r,id:s,readOnly:o})=>{var i;const{mapProp:a=D=>D,mapRow:l=D=>D,filterFields:u}=e||{},{enabled:d}=(i=e.cache)!=null?i:{enabled:!0},[f,p]=h.useState([]),[v,g]=h.useState(!1),[m,w]=h.useState(!0),S=!!u,[k,y]=h.useState(e.initialFilters||{}),[b,C]=h.useState(S),j=h.useMemo(()=>f.map(l),[f]),O=h.useMemo(()=>{const D=new Set;for(const L of j)for(const N of Object.keys(L))(typeof L[N]=="string"||typeof L[N]=="number"||h.isValidElement(L[N]))&&D.add(N);return Array.from(D)},[j]),[_,I]=h.useState(e.initialQuery||""),x=h.useCallback((D,L)=>Ee(null,null,function*(){w(!0);const N=`${s}-${D}-${JSON.stringify(L)}`;let B;d&&bi[N]?B=bi[N]:B=yield e.fetchList({query:D,filters:L}),B&&(p(B),w(!1),d&&(bi[N]=B))}),[s,e]),M=h.useCallback(D=>e.renderFooter?e.renderFooter(D):c.jsxs("span",{className:je("footer"),children:[D.items.length," result",D.items.length===1?"":"s"]}),[e.renderFooter]);return h.useEffect(()=>{x(_,k)},[]),c.jsxs("div",{className:Ws({dataSelected:!!n,modalVisible:v,readOnly:o}),id:s,children:[c.jsxs("div",{className:Ws("actions"),children:[c.jsx("button",{type:"button",onClick:()=>g(!0),className:Ws("button"),disabled:o,children:n?e.getItemSummary?e.getItemSummary(n):"External item":c.jsxs(c.Fragment,{children:[c.jsx(xd,{size:"16"}),c.jsx("span",{children:e.placeholder})]})}),n&&c.jsx("button",{type:"button",className:Ws("detachButton"),onClick:()=>{t(null)},disabled:o,children:c.jsx(py,{size:16})})]}),c.jsx($1,{onClose:()=>g(!1),isOpen:v,children:c.jsxs("form",{className:je({isLoading:m,loaded:!m,hasData:j.length>0,filtersToggled:b}),onSubmit:D=>{D.preventDefault(),D.stopPropagation(),x(_,k)},children:[c.jsx("div",{className:je("masthead"),children:e.showSearch?c.jsxs("div",{className:je("searchForm"),children:[c.jsxs("label",{className:je("search"),children:[c.jsx("span",{className:je("searchIconText"),children:"Search"}),c.jsx("div",{className:je("searchIcon"),children:c.jsx(ky,{size:"18"})}),c.jsx("input",{className:je("searchInput"),name:"q",type:"search",placeholder:e.placeholder,onChange:D=>{I(D.currentTarget.value)},autoComplete:"off",value:_})]}),c.jsxs("div",{className:je("searchActions"),children:[c.jsx(da,{type:"submit",loading:m,fullWidth:!0,children:"Search"}),S&&c.jsx("div",{className:je("searchActionIcon"),children:c.jsx(jt,{type:"button",title:"Toggle filters",onClick:D=>{D.preventDefault(),D.stopPropagation(),C(!b)},children:c.jsx(Iy,{size:20})})})]})]}):c.jsx(zl,{rank:"2",size:"xs",children:e.placeholder||"Select data"})}),c.jsxs("div",{className:je("grid"),children:[S&&c.jsx("div",{className:je("filters"),children:S&&Object.keys(u).map(D=>{const L=u[D];return c.jsx("div",{className:je("field"),children:c.jsx(Ih,{label:L.label||D,children:c.jsx(nw,{field:L,id:`external_field_${D}_filter`,value:k[D],onChange:N=>{y(B=>{const H=z(A({},B),{[D]:N});return x(_,H),H})}})})},D)})}),c.jsxs("div",{className:je("tableWrapper"),children:[c.jsxs("table",{className:je("table"),children:[c.jsx("thead",{className:je("thead"),children:c.jsx("tr",{className:je("tr"),children:O.map(D=>c.jsx("th",{className:je("th"),style:{textAlign:"left"},children:D},D))})}),c.jsx("tbody",{className:je("tbody"),children:j.map((D,L)=>c.jsx("tr",{style:{whiteSpace:"nowrap"},className:je("tr"),onClick:()=>{t(a(f[L])),g(!1)},children:O.map(N=>c.jsx("td",{className:je("td"),children:D[N]},N))},L))})]}),c.jsx("div",{className:je("loadingBanner"),children:c.jsx(On,{size:24})})]})]}),c.jsx("div",{className:je("footerContainer"),children:c.jsx(M,{items:j})})]})})]})},V1=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,Label:i,readOnly:a})=>{var l,u,d;const f=As(r),p=e,v=e;return h.useEffect(()=>{v.adaptor&&console.error("Warning: The `adaptor` API is deprecated. Please use updated APIs on the `external` field instead. This will be a breaking change in a future release.")},[]),e.type!=="external"?null:c.jsx(i,{label:s||r,icon:o||c.jsx(xd,{size:16}),el:"div",children:c.jsx(H1,{name:r,field:z(A({},p),{placeholder:(l=v.adaptor)!=null&&l.name?`Select from ${v.adaptor.name}`:p.placeholder||"Select data",mapProp:((u=v.adaptor)==null?void 0:u.mapProp)||p.mapProp,mapRow:p.mapRow,fetchList:(d=v.adaptor)!=null&&d.fetchList?()=>Ee(null,null,function*(){return yield v.adaptor.fetchList(v.adaptorParams)}):p.fetchList}),onChange:t,value:f,id:n,readOnly:a})})};P();var Us=ne("Input",Rn),W1=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const l=As(s);return e.type!=="radio"||!e.options?null:c.jsx(a,{icon:i||c.jsx(Jm,{size:16}),label:o||s,readOnly:n,el:"div",children:c.jsx("div",{className:Us("radioGroupItems"),id:r,children:e.options.map(u=>{var d;return c.jsxs("label",{className:Us("radio"),children:[c.jsx("input",{type:"radio",className:Us("radioInput"),value:JSON.stringify({value:u.value}),name:s,onChange:f=>{t(JSON.parse(f.target.value).value)},disabled:n,checked:l===u.value}),c.jsx("div",{className:Us("radioInner"),children:u.label||((d=u.value)==null?void 0:d.toString())})]},u.label+u.value)})})})};P();var U1=ne("Input",Rn),q1=({field:e,onChange:t,label:n,labelIcon:r,Label:s,id:o,name:i=o,readOnly:a})=>{const l=As(i);return e.type!=="select"||!e.options?null:c.jsx(s,{label:n||i,icon:r||c.jsx(sr,{size:16}),readOnly:a,children:c.jsx("select",{id:o,title:n||i,className:U1("input"),disabled:a,onChange:u=>{t(JSON.parse(u.target.value).value)},value:JSON.stringify({value:l}),children:e.options.map(u=>c.jsx("option",{label:u.label,value:JSON.stringify({value:u.value})},u.label+JSON.stringify(u.value)))})})};P();var Z1=ne("Input",Rn),Y1=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const[l,u]=Mh(s,t);return c.jsx(a,{label:o||s,icon:i||c.jsx(No,{size:16}),readOnly:n,children:c.jsx("textarea",{id:r,className:Z1("input"),autoComplete:"off",name:s,value:typeof l>"u"?"":l,onChange:d=>u(d.currentTarget.value),readOnly:n,tabIndex:n?-1:void 0,rows:5,placeholder:e.type==="textarea"?e.placeholder:void 0})})};P();P();var $l=h.memo(e=>{var t;return c.jsx($d,z(A({},e),{editor:null,menu:c.jsx(zd,{field:e.field,editor:null,editorState:null,readOnly:(t=e.readOnly)!=null?t:!1}),children:c.jsx("div",{className:"rich-text",dangerouslySetInnerHTML:{__html:e.content},contentEditable:!0})}))});$l.displayName="EditorFallback";var G1=h.lazy(()=>hn(()=>import("./Editor-EPSED64A-1h0xO9QI.js"),__vite__mapDeps([10,9,4,2,3,1])).then(e=>({default:e.Editor}))),K1=({onChange:e,readOnly:t=!1,id:n,name:r=n,label:s,labelIcon:o,Label:i,field:a})=>{const l=As(r),u={onChange:e,content:l,readOnly:t,field:a,id:n,name:r};return c.jsx(c.Fragment,{children:c.jsx(i,{label:s||r,icon:o||c.jsx(No,{size:16}),readOnly:t,el:"div",children:c.jsx(h.Suspense,{fallback:c.jsx($l,A({},u)),children:c.jsx(G1,A({},u))})})})};P();P();var X1={ObjectField:"_ObjectField_1ua3y_5","ObjectField-fieldset":"_ObjectField-fieldset_1ua3y_13"},hu=ne("ObjectField",X1),J1=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,Label:i,readOnly:a})=>{const{localName:l=r}=Nl(),u=Ll(),d=V(p=>p.permissions.getPermissions({item:p.selectedItem}).edit),f=()=>{var p;return(p=Ps(u.getState(),r))!=null?p:{}};return e.type!=="object"||!e.objectFields?null:c.jsx(i,{label:s||r,icon:o||c.jsx(ty,{size:16}),el:"div",readOnly:a,children:c.jsx("div",{className:hu(),children:c.jsx("fieldset",{className:hu("fieldset"),children:Object.keys(e.objectFields).map(p=>{const v=e.objectFields[p],g=`${l}.${p}`;return c.jsx(Oh,{id:`${n}_${p}`,name:r,subName:p,localName:l,field:v,forceReadOnly:!d,onChange:(m,w,S)=>{const k=f();k[S]!==m&&t(z(A({},k),{[S]:m}),w)}},g)})})})})};P();var Ko=()=>{if(typeof uo.useId<"u")return uo.useId();const[e]=h.useState(it());return e},Q1=ne("Input",Rn),ew=ne("InputWrapper",Rn),Rt={array:R1,external:V1,object:J1,select:q1,textarea:Y1,radio:W1,text:fu,number:fu,richtext:K1};function Th(e){var t;const n=V(j=>j.dispatch),r=V(j=>j.overrides),s=V(Ge(j=>{var O;return(O=j.selectedItem)==null?void 0:O.readOnly})),o=h.useContext(Oo),{id:i,Label:a=m1}=e,l=e.field,u=l.label,d=l.labelIcon,f=Ko(),p=i||f,v=h.useMemo(()=>{var j,O,_,I,x,M,D,L,N,B;return z(A({},r.fieldTypes),{custom:(j=r.fieldTypes)==null?void 0:j.custom,array:((O=r.fieldTypes)==null?void 0:O.array)||Rt.array,external:((_=r.fieldTypes)==null?void 0:_.external)||Rt.external,object:((I=r.fieldTypes)==null?void 0:I.object)||Rt.object,select:((x=r.fieldTypes)==null?void 0:x.select)||Rt.select,textarea:((M=r.fieldTypes)==null?void 0:M.textarea)||Rt.textarea,radio:((D=r.fieldTypes)==null?void 0:D.radio)||Rt.radio,text:((L=r.fieldTypes)==null?void 0:L.text)||Rt.text,number:((N=r.fieldTypes)==null?void 0:N.number)||Rt.number,richtext:((B=r.fieldTypes)==null?void 0:B.richtext)||Rt.richtext})},[r]),g=Go(j=>{var O,_;if(l.type==="custom"||(O=r.fieldTypes)!=null&&O[l.type])return Ps(j,(_=e.name)!=null?_:p)}),m=h.useMemo(()=>z(A({},e),{field:l,label:u,labelIcon:d,Label:a,id:p,value:g}),[e,l,u,d,a,p,g]),w=h.useCallback(j=>{m.name&&(j.target.nodeName==="INPUT"||j.target.nodeName==="TEXTAREA")&&(j.stopPropagation(),n({type:"setUi",ui:{field:{focus:m.name}}}))},[m.name]),S=h.useCallback(j=>{"name"in j.target&&n({type:"setUi",ui:{field:{focus:null}}})},[]);let k=h.useMemo(()=>l.type!=="custom"&&l.type!=="slot"?Rt[l.type]:j=>null,[l.type]);const y=l.type==="custom"?l.key:void 0;let b=h.useMemo(()=>{if(l.type==="custom"&&!v[l.type])return l.render?l.render:null;if(l.type!=="slot")return v[l.type]},[l.type,y,v]);const{visible:C=!0}=e.field;if(!C||l.type==="slot")return null;if(!b)throw new Error(`Field type for ${l.type} did not exist.`);return c.jsx(Oo.Provider,{value:{readOnlyFields:o.readOnlyFields||s||{},localName:(t=o.localName)!=null?t:m.name},children:c.jsx("div",{className:ew(),onFocus:w,onBlur:S,onClick:j=>{j.stopPropagation()},children:c.jsx(b,z(A({},m),{children:c.jsx(k,A({},m))}))})})}function Rh(e){return c.jsx(Th,A({},e))}function tw(e){var t=e,{value:n}=t,r=Kt(t,["value"]);const s=h.useMemo(()=>l=>c.jsx("div",z(A({},l),{className:Q1({readOnly:r.readOnly})})),[r.readOnly]),o=Ll(),i=h.useCallback(a=>{r.id&&(o.setState({[r.id]:a}),r.onChange(a))},[o,r.onChange,r.id]);return h.useEffect(()=>{r.id&&o.setState({[r.id]:n})},[r.id,n,o]),c.jsx(Th,z(A({},r),{onChange:i,Label:s}))}function nw(e){const t=Ko();return e.field.type==="slot"?null:c.jsx(js.Provider,{value:{[t]:e.value},children:c.jsx(tw,z(A({},e),{id:t}))})}P();P();P();P();var rw={DraggableComponent:"_DraggableComponent_1vaqy_1","DraggableComponent-overlayWrapper":"_DraggableComponent-overlayWrapper_1vaqy_12","DraggableComponent-overlay":"_DraggableComponent-overlay_1vaqy_12","DraggableComponent-loadingOverlay":"_DraggableComponent-loadingOverlay_1vaqy_34","DraggableComponent--hover":"_DraggableComponent--hover_1vaqy_50","DraggableComponent--isSelected":"_DraggableComponent--isSelected_1vaqy_57","DraggableComponent-actionsOverlay":"_DraggableComponent-actionsOverlay_1vaqy_71","DraggableComponent-actions":"_DraggableComponent-actions_1vaqy_71"};P();function gu(e){let t={x:0,y:0},n=e;for(;n&&n!==document.documentElement;){const r=n.parentElement;r&&(t.x+=r.scrollLeft,t.y+=r.scrollTop),n=r}return t}P();var xr=h.createContext(null),nt=h.createContext(cr(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null,registerRootVirtualizer:()=>{},unregisterRootVirtualizer:()=>{},scrollToComponent:()=>!1}))),sw=({children:e,store:t})=>c.jsx(nt.Provider,{value:t,children:e}),vs=({children:e,value:t})=>{const n=V(o=>o.dispatch),r=h.useCallback(o=>{n({type:"registerZone",zone:o})},[n]),s=h.useMemo(()=>A({registerZone:r},t),[t]);return c.jsx(c.Fragment,{children:s&&c.jsx(xr.Provider,{value:s,children:e})})};P();var Lh=(e,t=[])=>{const n=Ae();return h.useCallback(()=>{let r=()=>{};const s=i=>{i?e(!1):(setTimeout(()=>{e(!0)},0),r&&r())},o=n.getState().state.ui.isDragging;return s(o),o&&(r=n.subscribe(i=>i.state.ui.isDragging,i=>{s(i)})),r},[n,...t])};P();function ow(e,t){typeof e=="function"?e(t):e&&typeof e=="object"&&"current"in e&&(e.current=t)}function pa(e,t){e.forEach(n=>{ow(n,t)})}var Vn=ne("DraggableComponent",rw),iw=100,Nh=8,aw=Nh*6.5,lw=-44,vu=Nh,cw=({label:e,children:t,parentAction:n})=>c.jsxs(pt,{children:[c.jsxs(pt.Group,{children:[n,e&&c.jsx(pt.Label,{label:e})]}),c.jsx(pt.Group,{children:t})]}),uw=({children:e})=>c.jsx(c.Fragment,{children:e}),dw=({children:e,depth:t,componentType:n,id:r,index:s,zoneCompound:o,isLoading:i=!1,isSelected:a=!1,debug:l,label:u,autoDragAxis:d,userDragAxis:f,inDroppableZone:p=!0,itemRef:v})=>{const g=V(Y=>{var le;return((le=Y.selectedItem)==null?void 0:le.props.id)===r?Y.zoomConfig.zoom:1}),m=V(Y=>Y._experimentalFullScreenCanvas),w=V(Y=>Y.overrides),S=V(Y=>Y.dispatch),k=V(Y=>Y.iframe),y=h.useRef(0),b=h.useContext(xr),[C,j]=h.useState({}),O=h.useCallback((Y,le)=>{var ue;(ue=b==null?void 0:b.registerLocalZone)==null||ue.call(b,Y,le),j(Ce=>z(A({},Ce),{[Y]:le}))},[j]),_=h.useCallback(Y=>{var le;(le=b==null?void 0:b.unregisterLocalZone)==null||le.call(b,Y),j(ue=>{const Ce=A({},ue);return delete Ce[Y],Ce})},[j]),I=Object.values(C).filter(Boolean).length>0,x=V(Ge(Y=>{var le;return(le=Y.state.indexes.nodes[r])==null?void 0:le.path})),M=V(Ge(Y=>{const le=xt({index:s,zone:o},Y.state);return Y.permissions.getPermissions({item:le})})),D=h.useContext(nt),[L,N]=h.useState(f||d),B=h.useMemo(()=>Ah(L),[L]),{ref:H,isDragging:G,sortable:$}=vh({id:r,index:s,group:o,type:"component",data:{areaId:b==null?void 0:b.areaId,zone:o,index:s,componentType:n,containsActiveZone:I,depth:t,path:x||[],inDroppableZone:p},collisionPriority:t,collisionDetector:B,transition:{duration:200,easing:"cubic-bezier(0.2, 0, 0, 1)"},feedback:"clone"});h.useEffect(()=>{const Y=D.getState().enabledIndex[o];$.droppable.disabled=!Y,$.draggable.disabled=!M.drag;const le=D.subscribe(ue=>{$.droppable.disabled=!ue.enabledIndex[o]});return F.current&&!M.drag?(F.current.setAttribute("data-puck-disabled",""),()=>{var ue;(ue=F.current)==null||ue.removeAttribute("data-puck-disabled"),le()}):le},[M.drag,o]);const[,Z]=h.useState(0),F=h.useRef(null),X=h.useCallback(Y=>{H(Y),F.current!==Y&&(F.current=Y,Z(le=>le+1),v&&pa([v],Y))},[v,H]),[Q,de]=h.useState();h.useEffect(()=>{var Y,le,ue;de(k.enabled?(Y=F.current)==null?void 0:Y.ownerDocument.body:(ue=(le=F.current)==null?void 0:le.closest("[data-puck-preview]"))!=null?ue:document.body)},[k.enabled]);const ve=h.useCallback(()=>{var Y,le;if(!F.current)return;const ue=F.current,Ce=ue.getBoundingClientRect(),rt=k.enabled?null:ue.closest("[data-puck-preview]"),Tt=(()=>{let zn=ue;for(;zn&&zn!==document.documentElement;){if(getComputedStyle(zn).position==="fixed")return!0;zn=zn.parentElement}return!1})(),Wt=rt==null?void 0:rt.getBoundingClientRect(),Sr=rt?gu(rt):{x:0,y:0},kr=Tt?{x:0,y:0}:gu(ue),nn=Tt?{x:0,y:0}:{x:kr.x-Sr.x-((Y=Wt==null?void 0:Wt.left)!=null?Y:0),y:kr.y-Sr.y-((le=Wt==null?void 0:Wt.top)!=null?le:0)};return{left:`${Ce.left+nn.x}px`,top:`${Ce.top+nn.y}px`,height:`${Ce.height}px`,width:`${Ce.width}px`,position:Tt?"fixed":void 0}},[k.enabled]),[re,Je]=h.useState(),te=h.useRef(null),W=h.useRef(null),E=h.useCallback(()=>{Je(ve()),v&&pa([v],F.current)},[ve,v]),T=h.useCallback(()=>{W.current==null&&(W.current=requestAnimationFrame(()=>{W.current=null,E()}))},[E]);h.useEffect(()=>()=>{W.current!=null&&(cancelAnimationFrame(W.current),W.current=null)},[]),h.useEffect(()=>{if(F.current){const Y=new ResizeObserver(()=>{T()});return Y.observe(F.current),()=>{Y.disconnect()}}},[T,v]);const R=V(Y=>Y.nodes.registerNode),U=V(Y=>Y.nodes.unregisterNode),q=h.useCallback(()=>{Vt(!1)},[]),K=h.useCallback(()=>{Vt(!0)},[]),oe=h.useRef({sync:()=>null,hideOverlay:()=>null,showOverlay:()=>null});h.useLayoutEffect(()=>{oe.current.sync=E,oe.current.hideOverlay=q,oe.current.showOverlay=K},[q,K,E]),h.useEffect(()=>(R(r,oe.current),()=>{U(r)}),[r,R,U]);const me=h.useMemo(()=>w.actionBar||cw,[w.actionBar]),ke=h.useMemo(()=>w.componentOverlay||uw,[w.componentOverlay]),we=h.useCallback(Y=>{Y.target.closest("[data-puck-overlay-portal]")||Y.stopPropagation(),S(m?{type:"setUi",ui:{itemSelector:a?null:{index:s,zone:o}}}:{type:"setUi",ui:{itemSelector:{index:s,zone:o}}})},[s,o,r,a,m]),Oe=Ae(),Me=h.useCallback(()=>{const{nodes:Y,zones:le}=Oe.getState().state.indexes,ue=Y[r],Ce=ue!=null&&ue.parentId?Y[ue==null?void 0:ue.parentId]:null;if(!Ce||!ue.parentId)return;const rt=`${Ce.parentId}:${Ce.zone}`,Tt=le[rt].contentIds.indexOf(ue.parentId);S({type:"setUi",ui:{itemSelector:{zone:rt,index:Tt}}})},[b,x]),Ie=h.useCallback(()=>{S({type:"duplicate",sourceIndex:s,sourceZone:o})},[s,o]),ye=h.useCallback(()=>{S({type:"remove",index:s,zone:o})},[s,o]),[$e,gt]=h.useState(!1),en=Gt(nt,Y=>Y.hoveringComponent===r);h.useEffect(()=>{if(!F.current)return;const Y=F.current,le=Ce=>{const rt=!!D.getState().draggedItem;gt(rt?!!G:!0),Ce.stopPropagation()},ue=Ce=>{Ce.stopPropagation(),gt(!1)};return Y.setAttribute("data-puck-component",r),Y.setAttribute("data-puck-dnd",r),Y.style.position="relative",Y.addEventListener("click",we),Y.addEventListener("mouseover",le),Y.addEventListener("mouseout",ue),()=>{Y.removeAttribute("data-puck-component"),Y.removeAttribute("data-puck-dnd"),Y.removeEventListener("click",we),Y.removeEventListener("mouseover",le),Y.removeEventListener("mouseout",ue)}},[F.current,we,I,o,r,G,p]);const[tn,Vt]=h.useState(!1),[ae,_e]=h.useState(!0),[Re,De]=h.useTransition();h.useEffect(()=>{De(()=>{$e||en||a?(T(),Vt(!0),J(!1)):Vt(!1)})},[$e,en,a,k]);const[Be,J]=h.useState(!1),se=Lh(Y=>{Y?De(()=>{E(),_e(!0)}):_e(!1)});h.useEffect(()=>{G&&J(!0)},[G]),h.useEffect(()=>{if(Be)return se()},[Be,se]),h.useEffect(()=>{if(!ae||!(a||G))return;const Y=F.current;if(!Y)return;const le=Y.ownerDocument,ue=le.defaultView;if(!ue)return;y.current=0,T();const Ce=()=>T(),rt=()=>T();le.addEventListener("scroll",Ce,!0),ue.addEventListener("resize",rt);let Tt=0;const Wt=Sr=>{if(Sr-y.current>=iw){y.current=Sr;const kr=F.current;if(kr){const nn=kr.getBoundingClientRect(),Nn=te.current;(!Nn||Math.abs(nn.x-Nn.x)>.5||Math.abs(nn.y-Nn.y)>.5||Math.abs(nn.width-Nn.width)>.5||Math.abs(nn.height-Nn.height)>.5)&&(te.current=nn,T())}}Tt=requestAnimationFrame(Wt)};return Tt=requestAnimationFrame(Wt),()=>{le.removeEventListener("scroll",Ce,!0),ue.removeEventListener("resize",rt),cancelAnimationFrame(Tt)}},[ae,a,G,T]);const he=h.useCallback(Y=>{if(Y&&Y.ownerDocument.defaultView){const ue=Y.getBoundingClientRect(),rt=ue.x<0,Wt=ue.y<0;rt&&(Y.style.transformOrigin="left top",Y.style.left="0px"),Wt&&(Y.style.top="12px",rt||(Y.style.transformOrigin="right top"))}},[g]);h.useEffect(()=>{if(f){N(f);return}if(F.current){const Y=window.getComputedStyle(F.current);if(Y.display==="inline"||Y.display==="inline-block"){N("x");return}}N(d)},[F,f,d]);const Le=h.useMemo(()=>(b==null?void 0:b.areaId)&&(b==null?void 0:b.areaId)!=="root"&&c.jsx(pt.Action,{onClick:Me,label:"Select parent",children:c.jsx(ey,{size:16})}),[b==null?void 0:b.areaId]),vt=h.useMemo(()=>z(A({},b),{areaId:r,zoneCompound:o,index:s,depth:t+1,registerLocalZone:O,unregisterLocalZone:_}),[b,r,o,s,t,O,_]),St=V(Y=>{var le;return((le=Y.currentRichText)==null?void 0:le.inlineComponentId)===r?Y.currentRichText:null}),Os=M.duplicate||M.delete;return c.jsxs(vs,{value:vt,children:[ae&&tn&&ms.createPortal(c.jsxs("div",{className:Vn({isSelected:a,isDragging:G,hover:$e||en}),style:A({},re),"data-puck-overlay":!0,children:[l,i&&c.jsx("div",{className:Vn("loadingOverlay"),children:c.jsx(On,{})}),c.jsx("div",{className:Vn("actionsOverlay"),style:{top:aw/g},children:c.jsx("div",{className:Vn("actions"),style:{transform:`scale(${1/g}`,top:lw/g,right:0,paddingLeft:vu,paddingRight:vu},ref:he,children:c.jsxs(me,{parentAction:Le,label:u,children:[St&&c.jsxs(c.Fragment,{children:[c.jsx(Mb,{editor:St.editor,field:St.field,inline:!0,readOnly:!1}),Os&&c.jsx(pt.Separator,{})]}),M.duplicate&&c.jsx(pt.Action,{onClick:Ie,label:"Duplicate",children:c.jsx(bd,{size:16})}),M.delete&&c.jsx(pt.Action,{onClick:ye,label:"Delete",children:c.jsx(kd,{size:16})})]})})}),c.jsx("div",{className:Vn("overlayWrapper"),children:c.jsx(ke,{componentId:r,componentType:n,hover:$e,isSelected:a,children:c.jsx("div",{className:Vn("overlay")})})})]}),Q||document.body),e(X)]})};P();var fw={DropZone:"_DropZone_1i2sv_1","DropZone--hasChildren":"_DropZone--hasChildren_1i2sv_11","DropZone--isAreaSelected":"_DropZone--isAreaSelected_1i2sv_24","DropZone--hoveringOverArea":"_DropZone--hoveringOverArea_1i2sv_25","DropZone--isRootZone":"_DropZone--isRootZone_1i2sv_25","DropZone--isDestination":"_DropZone--isDestination_1i2sv_35","DropZone-item":"_DropZone-item_1i2sv_47","DropZone-hitbox":"_DropZone-hitbox_1i2sv_51","DropZone--isEnabled":"_DropZone--isEnabled_1i2sv_59","DropZone--isAnimating":"_DropZone--isAnimating_1i2sv_68"};P();P();var zh={Drawer:"_Drawer_pl7z0_1","Drawer-draggable":"_Drawer-draggable_pl7z0_8","Drawer-draggableBg":"_Drawer-draggableBg_pl7z0_12","DrawerItem-draggable":"_DrawerItem-draggable_pl7z0_22","DrawerItem--disabled":"_DrawerItem--disabled_pl7z0_35",DrawerItem:"_DrawerItem_pl7z0_22","Drawer--isDraggingFrom":"_Drawer--isDraggingFrom_pl7z0_45","DrawerItem-name":"_DrawerItem-name_pl7z0_63"};P();P();P();function pw(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function hw(e,t){const n=()=>performance.now();let r,s=0;return function(...o){const i=n(),a=this;i-s>=t?(e.apply(a,o),s=i):(r==null||r(),r=pw(()=>{e.apply(a,o),s=n()},t-(i-s)))}}P();var jn=()=>{if(typeof window>"u")return;let e=document.querySelector("#preview-frame");return(e==null?void 0:e.tagName)==="IFRAME"?e.contentDocument||document:(e==null?void 0:e.ownerDocument)||document};P();var gw=class{constructor(e,t){this.scaleFactor=1,this.frameEl=null,this.frameRect=null;var n;this.target=e,this.original=t,this.frameEl=document.querySelector("iframe#preview-frame"),this.frameEl&&(this.frameRect=this.frameEl.getBoundingClientRect(),this.scaleFactor=this.frameRect.width/(((n=this.frameEl.contentWindow)==null?void 0:n.innerWidth)||1))}get x(){return this.original.x}get y(){return this.original.y}get global(){return document!==this.target.ownerDocument&&this.frameRect?{x:this.x*this.scaleFactor+this.frameRect.left,y:this.y*this.scaleFactor+this.frameRect.top}:this.original}get frame(){return document===this.target.ownerDocument&&this.frameRect?{x:(this.x-this.frameRect.left)/this.scaleFactor,y:(this.y-this.frameRect.top)/this.scaleFactor}:this.original}};P();var vw=typeof PointerEvent<"u"?PointerEvent:Event,$h=class extends vw{constructor(e,t){super(e,t),this._originalTarget=null,this.originalTarget=t.originalTarget}set originalTarget(e){this._originalTarget=e}get originalTarget(){return this._originalTarget}},mw=e=>e.sort((t,n)=>{const r=t.data,s=n.data;return r.depth>s.depth?1:s.depth>r.depth?-1:0}),yw=e=>{let t=e==null?void 0:e.id;if(!e)return null;if(e.type==="component"){const n=e.data;n.containsActiveZone?t=null:t=n.zone}else if(e.type==="void")return"void";return t},qs=6,bw=(e,t)=>{const n=[];let r=e.target.ownerDocument.elementsFromPoint(e.x,e.y);const s=r.find(i=>i.getAttribute("data-puck-preview")),o=r.find(i=>i.getAttribute("data-puck-drawer"));if(o&&(r=[o]),s){const i=jn();i&&(r=i.elementsFromPoint(e.frame.x,e.frame.y))}if(r)for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-puck-dropzone"),u=a.getAttribute("data-puck-dnd"),d=a.hasAttribute("data-puck-dnd-void");if((l||u)&&!d){const f=a.getBoundingClientRect(),p={left:f.left+qs,right:f.right-qs,top:f.top+qs,bottom:f.bottom-qs};if(e.frame.x<p.left||e.frame.x>p.right||e.frame.y>p.bottom||e.frame.y<p.top)continue}if(l){const f=t.registry.droppables.get(l);f&&n.push(f)}if(u){const f=t.registry.droppables.get(u);f&&n.push(f)}}return n},_w=(e,t)=>{var n;const r=bw(e,t);if(r.length>0){const s=mw(r),o=t.dragOperation.source,i=s.findIndex(g=>g.id===(o==null?void 0:o.id)),a=o==null?void 0:o.id;let l=[...s];a&&i>-1&&l.splice(i,1),l=l.filter(g=>{const m=g.data;if(a&&i>-1&&m.path.indexOf(a)>-1)return!1;if(g.type==="dropzone"){const w=g.data;if(!w.isDroppableTarget||w.areaId===a)return!1}else if(g.type==="component"&&!g.data.inDroppableZone)return!1;return!0}),l.reverse();const u=l[0];if(!u)return{zone:null,area:null};const d=u.data,f="containsActiveZone"in d,p=yw(u),v=f&&d.containsActiveZone?l[0].id:(n=l[0])==null?void 0:n.data.areaId;return{zone:p,area:v}}return{zone:Ye,area:es}},xw=({onChange:e},t)=>class extends Xe{constructor(r,s){super(r),!(typeof window>"u")&&this.registerEffect(()=>{const i=hw(u=>{const d=u instanceof $h&&u.originalTarget||u.target,f=new gw(d,{x:u.clientX,y:u.clientY});document.elementsFromPoint(f.global.x,f.global.y).some(g=>g.id===t)&&e(_w(f,r),r)},50),a=u=>{i(u)};return document.body.addEventListener("pointermove",a,{capture:!0}),()=>{document.body.removeEventListener("pointermove",a,{capture:!0})}})}};P();P();var Ln=(e,t)=>{const n=e.indexes.nodes[t];if(!n)return;const r=`${n.parentId}:${n.zone}`,s=e.indexes.zones[r].contentIds.indexOf(t);return{zone:r,index:s}},ww=(e,t,n,r)=>Ee(null,null,function*(){const{getState:s}=r,o=it(e),i={type:"insert",componentType:e,destinationIndex:n,destinationZone:t,id:o},a=s().state,l=ud(a,i,s()),u=s().dispatch;u(z(A({},i),{recordHistory:!0}));const d={index:n,zone:t};u({type:"setUi",ui:{itemSelector:d}});const f=xt(d,l);if(!f)return;const p=s().resolveComponentData,v=yield p(f,"insert");if(!v.didChange)return;const g=Ln(s().state,o);g&&u({type:"replace",destinationZone:g.zone,destinationIndex:g.index,data:v.node})});P();var Sw=(e,t,n,r)=>Ee(null,null,function*(){var s,o,i,a;const l=r.getState().dispatch;l({type:"move",sourceIndex:t.index,sourceZone:(s=t.zone)!=null?s:Ye,destinationIndex:n.index,destinationZone:(o=n.zone)!=null?o:Ye,recordHistory:!1});const u=(i=r.getState().state.indexes.nodes[e])==null?void 0:i.data;if(!u)return;const d=r.getState().resolveComponentData,f=yield d(u,"move"),p=Ln(r.getState().state,u.props.id);p&&f.didChange&&l({type:"replace",data:f.node,destinationIndex:p.index,destinationZone:(a=p.zone)!=null?a:Ye})});P();function kw(e){function t(n){return n?n.getAttribute("dir")||t(n.parentElement):"ltr"}return e?t(e):"ltr"}var Fh=h.createContext({dragListeners:{}});function Iw(e,t,n=[]){const{setDragListeners:r}=h.useContext(Fh);h.useEffect(()=>{r&&r(s=>z(A({},s),{[e]:[...s[e]||[],t]}))},n)}var Ew=100,Cw=e=>{const t=h.useRef(null);return h.useCallback(n=>{fa.setState({fallbackEnabled:!1});const r=it();t.current=r,setTimeout(()=>{t.current===r&&(fa.setState({fallbackEnabled:!0}),n.collisionObserver.forceUpdate(!0))},e)},[])},jw=({children:e,disableAutoScroll:t})=>{const n=V(y=>y.dispatch),r=V(y=>y.instanceId),s=Ae(),o=h.useRef(null),i=Cw(100),[a]=h.useState(()=>{const y=new Map;return cr(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null,registerRootVirtualizer:(b,C)=>{y.set(b,C)},unregisterRootVirtualizer:b=>{y.delete(b)},scrollToComponent:b=>{const C=Array.from(y.values());if(C.length>0)for(const j of C){const O=j.resolveIndex(b);O<0||j.virtualizer.scrollToIndex(O,{behavior:"auto",align:"auto"})}else{const j=jn(),O=j==null?void 0:j.querySelector(`[data-puck-component="${b}"]`);O==null||O.scrollIntoView({behavior:"smooth"})}}}))}),l=h.useCallback(y=>{const{zoneDepthIndex:b={},areaDepthIndex:C={}}=a.getState()||{},j=Object.keys(b).length>0,O=Object.keys(C).length>0;let _=!1,I=!1;return(y.zone&&!b[y.zone]||!y.zone&&j)&&(_=!0),(y.area&&!C[y.area]||!y.area&&O)&&(I=!0),{zoneChanged:_,areaChanged:I}},[a]),u=h.useCallback((y,b)=>{const{zoneChanged:C,areaChanged:j}=l(y);!C&&!j||(a.setState({zoneDepthIndex:y.zone?{[y.zone]:!0}:{},areaDepthIndex:y.area?{[y.area]:!0}:{}}),i(b),setTimeout(()=>{b.collisionObserver.forceUpdate(!0)},50),o.current=null)},[a]),d=mh(u,Ew),f=()=>{d.cancel(),o.current=null};h.useEffect(()=>{},[]);const[p]=h.useState(()=>[...t?Cn.plugins.filter(y=>y!==Sl):Cn.plugins,xw({onChange:(y,b)=>{const C=a.getState(),{zoneChanged:j,areaChanged:O}=l(y),_=b.dragOperation.status.dragging;if(O||j){let I={},x={};y.zone&&(I={[y.zone]:!0}),y.area&&(x={[y.area]:!0}),a.setState({nextZoneDepthIndex:I,nextAreaDepthIndex:x})}if(y.zone!=="void"&&(C!=null&&C.zoneDepthIndex.void)){u(y,b);return}if(O){if(_){const I=o.current;I&&I.area===y.area&&I.zone===y.zone||(f(),d(y,b),o.current=y)}else f(),u(y,b);return}j&&u(y,b),f()}},r)]),v=jh(),[g,m]=h.useState({}),w=h.useRef(null),S=h.useRef(void 0),k=h.useMemo(()=>({mode:"edit",areaId:"root",depth:0}),[]);return c.jsx(Fh.Provider,{value:{dragListeners:g,setDragListeners:m},children:c.jsx(Yp,{plugins:p,sensors:v,onDragEnd:(y,b)=>{var C,j;const O=(C=jn())==null?void 0:C.querySelector("[data-puck-entry]");O==null||O.removeAttribute("data-puck-dragging");const{source:_,target:I}=y.operation;if(!_){a.setState({draggedItem:null});return}const{zone:x,index:M}=_.data,{previewIndex:D={}}=a.getState()||{},L=((j=D[x])==null?void 0:j.props.id)===_.id?D[x]:null,N=()=>{var H,G;if(a.setState({draggedItem:null}),y.canceled||(I==null?void 0:I.type)==="void"){a.setState({previewIndex:{}}),(H=g.dragend)==null||H.forEach($=>{$(y,b)}),n({type:"setUi",ui:{itemSelector:null,isDragging:!1}});return}L&&(a.setState({previewIndex:{}}),L.type==="insert"?ww(L.componentType,L.zone,L.index,s):S.current&&Sw(L.props.id,S.current,L,s)),n({type:"setUi",ui:{itemSelector:{index:M,zone:x},isDragging:!1},recordHistory:!1}),(G=g.dragend)==null||G.forEach($=>{$(y,b)})};let B;B=dt(()=>{_.status==="idle"&&(N(),B==null||B())})},onDragOver:(y,b)=>{var C,j,O,_;if(y.preventDefault(),!((C=a.getState())==null?void 0:C.draggedItem))return;f();const{source:x,target:M}=y.operation;if(!M||!x||M.type==="void")return;const[D]=x.id.split(":"),[L]=M.id.split(":"),N=x.data;let B=N.zone,H=N.index,G="",$=0;if(M.type==="component"){const F=M.data;G=F.zone,$=F.index;const X=(j=b.collisionObserver.collisions[0])==null?void 0:j.data,Q=kw(M.element),de=(X==null?void 0:X.direction)==="up"||Q==="ltr"&&(X==null?void 0:X.direction)==="left"||Q==="rtl"&&(X==null?void 0:X.direction)==="right"?"before":"after";$>=H&&B===G&&($=$-1),de==="after"&&($=$+1)}else G=M.id.toString(),$=0;const Z=((O=s.getState().state.indexes.nodes[M.id])==null?void 0:O.path)||[];if(!(L===D||Z.find(F=>{const[X]=F.split(":");return X===D}))){if(w.current==="new")a.setState({previewIndex:{[G]:{componentType:N.componentType,type:"insert",index:$,zone:G,element:x.element,props:{id:x.id.toString()}}}});else{S.current||(S.current={zone:N.zone,index:N.index});const F=xt(S.current,s.getState().state);F&&a.setState({previewIndex:{[G]:{componentType:N.componentType,type:"move",index:$,zone:G,props:F.props,element:x.element}}})}(_=g.dragover)==null||_.forEach(F=>{F(y,b)})}},onDragStart:(y,b)=>{var C;const{source:j}=y.operation;if(j&&j.type!=="void"){const O=j.data,_=xt({zone:O.zone,index:O.index},s.getState().state);_&&a.setState({previewIndex:{[O.zone]:{componentType:O.componentType,type:"move",index:O.index,zone:O.zone,props:_.props,element:j.element}}})}(C=g.dragstart)==null||C.forEach(O=>{O(y,b)})},onBeforeDragStart:y=>{var b,C,j,O;const _=((b=y.operation.source)==null?void 0:b.type)==="drawer";w.current=_?"new":"existing",S.current=void 0,a.setState({draggedItem:y.operation.source}),((C=s.getState().selectedItem)==null?void 0:C.props.id)!==((j=y.operation.source)==null?void 0:j.id)?n({type:"setUi",ui:{itemSelector:null,isDragging:!0},recordHistory:!1}):n({type:"setUi",ui:{isDragging:!0},recordHistory:!1});const I=(O=jn())==null?void 0:O.querySelector("[data-puck-entry]");I==null||I.setAttribute("data-puck-dragging","true")},children:c.jsx(sw,{store:a,children:c.jsx(vs,{value:k,children:e})})})})},Pw=({children:e,disableAutoScroll:t})=>V(r=>r.status)==="LOADING"?e:c.jsx(jw,{disableAutoScroll:t,children:e}),lo=ne("Drawer",zh),Wn=ne("DrawerItem",zh),ha=({children:e,name:t,label:n,dragRef:r,isDragDisabled:s})=>{const o=h.useMemo(()=>e||(({children:i})=>c.jsx("div",{className:Wn("default"),children:i})),[e]);return c.jsx("div",{className:Wn({disabled:s}),ref:r,onMouseDown:i=>i.preventDefault(),"data-testid":r?`drawer-item:${t}`:"","data-puck-drawer-item":!0,children:c.jsx(o,{name:t,children:c.jsx("div",{className:Wn("draggableWrapper"),children:c.jsxs("div",{className:Wn("draggable"),children:[c.jsx("div",{className:Wn("name"),children:n??t}),c.jsx("div",{className:Wn("icon"),children:c.jsx(Ch,{})})]})})})})},Aw=({children:e,name:t,label:n,id:r,isDragDisabled:s})=>{const{ref:o}=u0({id:r,data:{componentType:t},disabled:s,type:"drawer"});return c.jsxs("div",{className:lo("draggable"),children:[c.jsx("div",{className:lo("draggableBg"),children:c.jsx(ha,{name:t,label:n,children:e})}),c.jsx("div",{className:lo("draggableFg"),children:c.jsx(ha,{name:t,label:n,dragRef:o,isDragDisabled:s,children:e})})]})},Ow=({name:e,children:t,id:n,label:r,index:s,isDragDisabled:o})=>{const i=n||e,[a,l]=h.useState(it(i));return typeof s<"u"&&console.error("Warning: The `index` prop on Drawer.Item is deprecated and no longer required."),Iw("dragend",()=>{l(it(i))},[i]),c.jsx("div",{children:c.jsx(Aw,{name:e,label:r,id:a,isDragDisabled:o,children:t})},a)},Fl=({children:e,droppableId:t,direction:n})=>{t&&console.error("Warning: The `droppableId` prop on Drawer is deprecated and no longer required."),n&&console.error("Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging.");const r=Ko(),{ref:s}=oh({id:r,type:"void",collisionPriority:0});return c.jsx("div",{className:lo(),ref:s,"data-puck-dnd":r,"data-puck-drawer":!0,"data-puck-dnd-void":!0,children:e})};Fl.Item=Ow;P();var mu=(e,t)=>e.getState().state.indexes.zones[t].contentIds.length,Mw=({zoneCompound:e,userMinEmptyHeight:t,ref:n})=>{const r=Ae(),[s,o]=h.useState(0),[i,a]=h.useState(!1),{draggedItem:l,isZone:u}=Gt(nt,v=>{var g,m;return{draggedItem:((g=v.draggedItem)==null?void 0:g.data.zone)===e?v.draggedItem:null,isZone:((m=v.draggedItem)==null?void 0:m.data.zone)===e}}),d=h.useRef(0),f=Lh(v=>{if(v){const g=mu(r,e);if(o(0),g||d.current===0){a(!1);return}const m=r.getState().selectedItem,w=r.getState().state.indexes.zones,S=r.getState().nodes;S.setOverlayVisible(m==null?void 0:m.props.id,!1),setTimeout(()=>{var k;const y=((k=w[e])==null?void 0:k.contentIds)||[];S.syncNodes(y),m&&setTimeout(()=>{S.syncNode(m.props.id),S.setOverlayVisible(m.props.id,!0)},200),a(!1)},100)}},[r,s,e]);h.useEffect(()=>{if(l&&n.current&&u){const v=n.current.getBoundingClientRect();return d.current=mu(r,e),o(v.height),a(!0),f()}},[n.current,l,f]);const p=isNaN(Number(t))?t:`${t}px`;return[s?`${s}px`:p,i]};P();P();function Dw(e,t){const n=Gp();return h.useCallback((...r)=>Ee(null,null,function*(){return yield n==null?void 0:n.renderer.rendering,e(...r)}),[...t,n])}var Tw=(e,t)=>{const n=h.useContext(nt),r=Gt(nt,d=>d.previewIndex[t]),s=V(d=>d.state.ui.isDragging),[o,i]=h.useState(e),[a,l]=h.useState(r),u=Dw((d,f,p,v,g)=>{p&&!g||(f?f.type==="insert"?i(rr(d.filter(m=>m!==f.props.id),f.index,f.props.id)):i(rr(d.filter(m=>m!==f.props.id),f.index,f.props.id)):i(g?d.filter(m=>m!==v):d),l(f))},[]);return h.useEffect(()=>{var d;const f=n.getState(),p=(d=f.draggedItem)==null?void 0:d.id,v=Object.keys(f.previewIndex||{}).length>0;u(e,r,s,p,v)},[e,r,s]),[o,a]};P();var Rw="dynamic",Lw="x",yu="y",Nw=(e,t)=>{const n=V(i=>i.status),[r,s]=h.useState(t||yu),o=h.useCallback(()=>{if(e.current){const i=window.getComputedStyle(e.current);i.display==="grid"?s(Rw):i.display==="flex"&&i.flexDirection==="row"?s(Lw):s(yu)}},[e.current]);return h.useEffect(()=>{const i=()=>{o()};return window.addEventListener("viewportchange",i),()=>{window.removeEventListener("viewportchange",i)}},[]),h.useEffect(o,[n,t]),[r,o]};P();var zw=({componentId:e,zone:t})=>{const n=V(o=>o.config),r=V(o=>o.metadata),s=V(Ge(o=>{var i,a;const l=o.state.indexes;return((a=(i=l.zones[`${e}:${t}`])==null?void 0:i.contentIds)!=null?a:[]).map(d=>l.nodes[d].flatData)}));return c.jsx(Ra,{content:s,zone:t,config:n,metadata:r})};P();function $w(e,t,n,r,s){const o=h.useRef(null),i=h.useRef(t.props),a=h.useMemo(()=>Bd(n,r,s),[n,r,s]),l=h.useMemo(()=>{var d,f,p;const v={},g=t.type==="root"?e.root:(d=e.components)==null?void 0:d[t.type];let m=!1;for(const S in t.props){const k=(p=(f=g==null?void 0:g.fields)==null?void 0:f[S])==null?void 0:p.type;(!o.current||t.props[S]!==o.current[S])&&(v[S]=t.props[S],k==="slot"&&(m=!0))}v.id=t.props.id,o.current=t.props;const w=ur(z(A({},t),{props:v}),a,e,!1,m).props;return i.current=A(A({},i.current),w),i.current},[e,t,a]);return h.useMemo(()=>A(A({},t.props),l),[t.props,l])}P();P();P();var Bh=(e,t={})=>{if(!e)return;const{disableDrag:n=!1,disableDragOnFocus:r=!0}=t,s=a=>{a.stopPropagation()};e.addEventListener("mouseover",s,{capture:!0});const o=()=>{setTimeout(()=>{e.addEventListener("pointerdown",s,{capture:!0})},200)},i=()=>{e.removeEventListener("pointerdown",s,{capture:!0})};return n?e.addEventListener("pointerdown",s,{capture:!0}):r&&(e.addEventListener("focus",o,{capture:!0}),e.addEventListener("blur",i,{capture:!0})),e.setAttribute("data-puck-overlay-portal","true"),()=>{e.removeEventListener("mouseover",s,{capture:!0}),n?e.removeEventListener("pointerdown",s,{capture:!0}):r&&(e.removeEventListener("focus",o,{capture:!0}),e.removeEventListener("blur",i,{capture:!0})),e.removeAttribute("data-puck-overlay-portal")}};P();var Fw={InlineTextField:"_InlineTextField_104qp_1"},Bw=ne("InlineTextField",Fw),Hw=({propPath:e,componentId:t,value:n,isReadOnly:r,opts:s={}})=>{var o;const i=h.useRef(null),a=Ae(),l=(o=s.disableLineBreaks)!=null?o:!1;h.useEffect(()=>{const v=a.getState(),g=v.state.indexes.nodes[t].data;if(!v.getComponentConfig(g.type))throw new Error(`InlineTextField Error: No config defined for ${g.type}`);if(i.current){n!==i.current.innerText&&i.current.replaceChildren(n);const w=Bh(i.current),S=k=>Ee(null,null,function*(){var y;const b=a.getState(),C=b.state.indexes.nodes[t],j=`${C.parentId}:${C.zone}`,O=(y=b.state.indexes.zones[j])==null?void 0:y.contentIds.indexOf(t);let _=k.target.innerText;l&&(_=_.replaceAll(/\n/gm,""));const I=Rl(C.data.props,e,_),x=yield b.resolveComponentData(z(A({},C.data),{props:I}),"replace");b.dispatch({type:"replace",data:x.node,destinationIndex:O,destinationZone:j})});return i.current.addEventListener("input",S),()=>{var k;(k=i.current)==null||k.removeEventListener("input",S),w==null||w()}}},[a,i.current,n,l]);const[u,d]=h.useState(!1),[f,p]=h.useState(!1);return c.jsx("span",{className:Bw(),ref:i,contentEditable:u||f?"plaintext-only":"false",onClick:v=>{v.preventDefault(),v.stopPropagation()},onClickCapture:v=>{v.preventDefault(),v.stopPropagation();const g=Ln(a.getState().state,t);a.getState().setUi({itemSelector:g})},onKeyDown:v=>{v.stopPropagation(),(l&&v.key==="Enter"||r)&&v.preventDefault()},onKeyUp:v=>{v.stopPropagation(),v.preventDefault()},onMouseOverCapture:()=>d(!0),onMouseOutCapture:()=>d(!1),onFocus:()=>p(!0),onBlur:()=>p(!1)})},_i=h.memo(Hw),Vw=()=>({text:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable?c.jsx(_i,{propPath:r,componentId:t,value:e,opts:{disableLineBreaks:!0},isReadOnly:s}):e,textarea:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable?c.jsx(_i,{propPath:r,componentId:t,value:e,isReadOnly:s}):e,custom:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable&&typeof e=="string"?c.jsx(_i,{propPath:r,componentId:t,value:e,isReadOnly:s}):e});P();var Ww=h.lazy(()=>hn(()=>import("./Editor-EPSED64A-1h0xO9QI.js"),__vite__mapDeps([10,9,4,2,3,1])).then(e=>({default:e.Editor}))),Hh=h.lazy(()=>hn(()=>import("./Render-CU35UAWV-BC5ynnCM.js"),__vite__mapDeps([8,9,4,2,3])).then(e=>({default:e.RichTextRender}))),Vh=h.memo(({value:e,componentId:t,propPath:n,field:r,id:s})=>{const o=h.useRef(null),i=Ae(),a=p=>{p.preventDefault(),p.stopPropagation()},l=p=>{p.preventDefault(),p.stopPropagation();const v=Ln(i.getState().state,t);i.getState().setUi({itemSelector:v})};h.useEffect(()=>{if(!o.current)return;const p=Bh(o.current,{disableDragOnFocus:!0});return()=>p==null?void 0:p()},[o.current]);const u=h.useCallback((p,v)=>Ee(null,null,function*(){var g;const m=i.getState(),w=m.state.indexes.nodes[t],S=`${w.parentId}:${w.zone}`,k=(g=m.state.indexes.zones[S])==null?void 0:g.contentIds.indexOf(t),y=Rl(w.data.props,n,p),b=yield m.resolveComponentData(z(A({},w.data),{props:y}),"replace");m.dispatch({type:"replace",data:b.node,destinationIndex:k,destinationZone:S,ui:v})}),[i,t,n]),d=h.useCallback(p=>{i.setState({currentRichText:{inlineComponentId:t,inline:!0,field:r,editor:p,id:s}})},[r,t]);if(!r.contentEditable)return c.jsx(h.Suspense,{fallback:c.jsx(Hd,{content:e}),children:c.jsx(Hh,{content:e,field:r})});const f={content:e,onChange:u,field:r,inline:!0,onFocus:d,id:s,name:n};return c.jsx("div",{ref:o,onClick:a,onClickCapture:l,children:c.jsx(h.Suspense,{fallback:c.jsx($l,A({},f)),children:c.jsx(Ww,A({},f))})})});Vh.displayName="InlineEditorWrapper";var Uw=()=>({richtext:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>{const{contentEditable:o=!0,tiptap:i}=n;if(o===!1||s)return c.jsx(Hh,{content:e,field:n});const a=`${t}_${n.type}_${r}`;return c.jsx(Vh,{value:e,componentId:t,propPath:r,field:n,id:a},a)}});P();P();function qw(e,t,n=[]){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;const r=new Set(n),s=Object.keys(e).filter(i=>!r.has(i)),o=Object.keys(t).filter(i=>!r.has(i));if(s.length!==o.length)return!1;for(let i=0;i<s.length;i++){const a=s[i];if(!Object.prototype.hasOwnProperty.call(t,a))return!1;const l=e[a],u=t[a];if(!Object.is(l,u))return!1}return!0}var Zw=({Component:e,componentProps:t})=>c.jsx(e,A({},t)),bu=h.memo(Zw,(e,t)=>{let n=!0;return"puck"in e.componentProps&&"puck"in t.componentProps&&(n=rs(e.componentProps.puck,t.componentProps.puck)),e.Component===t.Component&&qw(e.componentProps,t.componentProps,["puck"])&&n});P();var Yw=5,Wh=320,Uh=new Map,Gw=e=>{var t;return(t=Uh.get(e))!=null?t:Wh},Kw=(e,t)=>{t<=0||Uh.set(e,t)},Xw=({contentIds:e,zoneCompound:t,renderItem:n})=>{const r=V(y=>{var b,C;return(C=(b=y.selectedItem)==null?void 0:b.props.id)!=null?C:null}),s=jn(),o=h.useContext(nt),i=Gt(nt,y=>{var b;const C=(b=y.draggedItem)==null?void 0:b.id;return C?String(C):null}),a=Gt(nt,y=>{var b,C;if((b=y.draggedItem)!=null&&b.id){const j=Object.keys((C=y.previewIndex)!=null?C:{})[0];return j==null?void 0:j.split(":")[0]}return null}),l=s==null?void 0:s.defaultView,u=h.useRef(new Map),d=Ae(),f=h.useCallback(y=>{var b,C,j,O;if(!y||y==="root")return-1;const _=e.indexOf(y);if(_>-1)return _;const I=(j=(C=(b=d.getState().state.indexes.nodes)==null?void 0:b[y])==null?void 0:C.path)!=null?j:[];for(let x=I.length-1;x>=0;x-=1){const M=(O=I[x])==null?void 0:O.split(":")[0];if(!M||M==="root")continue;const D=e.indexOf(M);if(D>-1)return D}return-1},[d,e]),p=h.useMemo(()=>{const y=new Set;return[r,i,a].forEach(b=>{const C=f(b);C>-1&&y.add(C)}),Array.from(y).sort((b,C)=>b-C)},[a,i,f,r]),v=h.useCallback(y=>{const b=bh(y);return p.forEach(C=>{b.includes(C)||b.push(C)}),b.sort((C,j)=>C-j),b},[p]),g=kh({count:e.length,getItemKey:y=>e[y],estimateSize:y=>Gw(e[y]),getScrollElement:()=>l??null,overscan:Yw,observeElementRect:(y,b)=>l?o1(y,b):_h(y,b),observeElementOffset:(y,b)=>l?i1(y,b):xh(y,b),scrollToFn:(y,b,C)=>l?l1(y,b,C):wh(y,b,C),rangeExtractor:v,initialOffset:()=>l?l.scrollY:0});h.useEffect(()=>(o.getState().registerRootVirtualizer(t,{resolveIndex:y=>f(y),virtualizer:g}),()=>{o.getState().unregisterRootVirtualizer(t)}),[f,g,t,o]);const m=h.useCallback(y=>{const b=u.current.get(y);if(b)return b;const C=j=>{if(!j)return;const O=Math.ceil(j.getBoundingClientRect().height)||Wh;typeof O=="number"&&O>0&&Kw(y,O)};return u.current.set(y,C),C},[]);h.useEffect(()=>{const y=new Set(e);Array.from(u.current.keys()).forEach(b=>{y.has(b)||u.current.delete(b)})},[e]);const w=g.getVirtualItems(),S=g.getTotalSize(),k=h.useMemo(()=>{const y=[];let b=0,C=-1;w.forEach(O=>{if(!O)return;const _=e[O.index],I=Math.max(O.start-b,0);I>0&&y.push(c.jsx("div",{style:{height:`${I}px`}},`gap:${C}:${O.index}`)),y.push(n({componentId:_,index:O.index,measureRef:m(_)})),b=O.end,C=O.index});const j=Math.max(S-b,0);return j>0&&y.push(c.jsx("div",{style:{height:`${j}px`}},`gap:${C}:end`)),y},[S,w,m]);return c.jsx(c.Fragment,{children:k})},Jw=ne("DropZone",fw),Qw=({element:e,label:t,override:n})=>e?c.jsx("div",{dangerouslySetInnerHTML:{__html:e.outerHTML}}):c.jsx(ha,{name:t,children:n}),ga=e=>c.jsx(qh,A({},e)),eS=({zoneCompound:e,componentId:t,index:n,dragAxis:r,collisionAxis:s,inDroppableZone:o,itemRef:i})=>{var a,l;const u=V($=>$.metadata),d=h.useContext(xr),{depth:f=1}=d??{},p=h.useContext(nt),v=V(Ge($=>{var Z;return(Z=$.state.indexes.nodes[t])==null?void 0:Z.flatData.props})),g=V($=>{var Z;return(Z=$.state.indexes.nodes[t])==null?void 0:Z.data.type}),m=V(Ge($=>{var Z;return(Z=$.state.indexes.nodes[t])==null?void 0:Z.data.readOnly})),w=Ae(),S=h.useMemo(()=>{if(v)return Gv({type:g,props:v});const $=p.getState().previewIndex[e];return t===($==null?void 0:$.props.id)?{type:$.componentType,props:$.props,previewType:$.type,element:$.element}:null},[w,t,e,g,v]),k=V($=>S!=null&&S.type?$.config.components[S.type]:null),y=h.useMemo(()=>({renderDropZone:ga,isEditing:!0,dragRef:null,metadata:A(A({},u),k==null?void 0:k.metadata)}),[u,k==null?void 0:k.metadata]),b=V($=>$.overrides),C=V($=>{var Z;return((Z=$.componentState[t])==null?void 0:Z.loadingCount)>0}),j=V($=>{var Z;return((Z=$.selectedItem)==null?void 0:Z.props.id)===t||!1});let O=(l=(a=k==null?void 0:k.label)!=null?a:S==null?void 0:S.type.toString())!=null?l:"Component";const _=h.useMemo(()=>z(A(A({},k==null?void 0:k.defaultProps),S==null?void 0:S.props),{puck:y,editMode:!0}),[k==null?void 0:k.defaultProps,S==null?void 0:S.props,y]),I=h.useMemo(()=>{var $;return{type:($=S==null?void 0:S.type)!=null?$:g,props:_}},[S==null?void 0:S.type,g,_]),x=V($=>$.config),M=V($=>$.plugins),D=V($=>$.fieldTransforms),L=h.useMemo(()=>A(A(A(A(A({},Fd(ga,$=>c.jsx(zw,{componentId:t,zone:$.zone}))),Vw()),Uw()),M.reduce(($,Z)=>A(A({},$),Z.fieldTransforms),{})),D),[M,D]),N=$w(x,I,L,m,C);if(!S)return;const B=k?k.render:()=>c.jsxs("div",{style:{padding:48,textAlign:"center"},children:["No configuration for ",S.type]});let H=S.type;const G="previewType"in S?S.previewType==="insert":!1;return c.jsx(dw,{id:t,componentType:H,zoneCompound:e,depth:f+1,index:n,isLoading:C,isSelected:j,label:O,autoDragAxis:r,userDragAxis:s,inDroppableZone:o,itemRef:i,children:$=>{var Z;return k!=null&&k.inline&&!G?c.jsx(bu,{Component:B,componentProps:z(A({},N),{puck:z(A({},N.puck),{dragRef:$})})}):c.jsx("div",{ref:$,children:G?c.jsx(Qw,{label:O,override:(Z=b.componentItem)!=null?Z:b.drawerItem,element:"element"in S&&S.element?S.element:void 0}):c.jsx(bu,{Component:B,componentProps:N})})}})},_u=h.memo(eS),qh=h.forwardRef(function({zone:t,allow:n,disallow:r,style:s,className:o,minEmptyHeight:i="128px",collisionAxis:a,as:l},u){const d=h.useContext(xr),f=Ae(),{areaId:p,depth:v=0,registerLocalZone:g,unregisterLocalZone:m}=d??{},w=V(Ge(te=>{var W;return p?(W=te.state.indexes.nodes[p])==null?void 0:W.path:null}));let S=Ye;p&&t!==Ye&&(S=`${p}:${t}`);const k=S===Ye||t===Ye||p==="root",y=Gt(nt,te=>te.nextAreaDepthIndex[p||""]),b=V(Ge(te=>{var W;return(W=te.state.indexes.zones[S])==null?void 0:W.contentIds})),C=V(Ge(te=>{var W;return(W=te.state.indexes.zones[S])==null?void 0:W.type}));h.useEffect(()=>{(!C||C==="dropzone")&&d!=null&&d.registerZone&&(d==null||d.registerZone(S))},[C,f]),h.useEffect(()=>{C==="dropzone"&&S!==Ye&&console.warn("DropZones have been deprecated in favor of slot fields and will be removed in a future version of Puck. Please see the migration guide: https://www.puckeditor.com/docs/guides/migrations/dropzones-to-slots")},[C]);const j=h.useMemo(()=>b||[],[b]),O=h.useRef(null),_=h.useCallback(te=>{if(!te)return!0;if(r){const W=n||[];if((r||[]).filter(T=>W.indexOf(T)===-1).indexOf(te)!==-1)return!1}else if(n&&n.indexOf(te)===-1)return!1;return!0},[n,r]),I=Gt(nt,te=>{var W;const E=(W=te.draggedItem)==null?void 0:W.data.componentType;return _(E)}),x=y||k,M=Gt(nt,te=>{var W;let E=!0;return E=(W=te.zoneDepthIndex[S])!=null?W:!1,E&&(E=I),E});h.useEffect(()=>(g&&g(S,I||M),()=>{m&&m(S)}),[I,M,S]);const[D,L]=Tw(j,S),N=M&&(L?D.length===1:D.length===0),B=h.useContext(nt);h.useEffect(()=>{const{enabledIndex:te}=B.getState();B.setState({enabledIndex:z(A({},te),{[S]:M})})},[M,B,S]);const H={id:S,collisionPriority:M?v:0,disabled:!N,collisionDetector:I1,type:"dropzone",data:{areaId:p,depth:v,isDroppableTarget:I,path:w||[]}},{ref:G}=oh(H),$=V(te=>(te==null?void 0:te.selectedItem)&&p===(te==null?void 0:te.selectedItem.props.id)),[Z]=Nw(O,a),[F,X]=Mw({zoneCompound:S,userMinEmptyHeight:i,ref:O}),Q=h.useCallback(te=>{pa([O,G,u],te)},[G]),de=V(te=>te._experimentalVirtualization),ve=l??"div",Je=de&&((p??es)===es&&v===0);return c.jsx(ve,{className:`${Jw({isRootZone:k,hoveringOverArea:x,isEnabled:M,isAreaSelected:$,hasChildren:j.length>0,isAnimating:X})}${o?` ${o}`:""}`,ref:Q,"data-testid":`dropzone:${S}`,"data-puck-dropzone":S,style:z(A({},s),{"--min-empty-height":F,backgroundColor:s==null?void 0:s.backgroundColor}),children:Je?c.jsx(Xw,{contentIds:D,zoneCompound:S,renderItem:te=>c.jsx(_u,{zoneCompound:S,componentId:te.componentId,dragAxis:Z,index:te.index,collisionAxis:a,inDroppableZone:I,itemRef:te.measureRef},te.componentId)}):D.map((te,W)=>c.jsx(_u,{zoneCompound:S,componentId:te,dragAxis:Z,index:W,collisionAxis:a,inDroppableZone:I},te))})}),tS=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=zo(e,t,a=>c.jsx(Ra,z(A({},a),{config:e,metadata:n}))),o=h.useMemo(()=>({areaId:s.id,depth:1}),[s]),i=$o(r.fields,s);return c.jsx(vs,{value:o,children:c.jsx(r.render,z(A(A({},s),i),{puck:z(A({},s.puck),{renderDropZone:va,metadata:A(A({},n),r.metadata)})}))},s.id)},va=e=>c.jsx(Zh,A({},e)),Zh=h.forwardRef(function({className:t,style:n,zone:r,as:s},o){const i=h.useContext(xr),{areaId:a="root"}=i||{},{config:l,data:u,metadata:d}=h.useContext(ya);let f=`${a}:${r}`,p=(u==null?void 0:u.content)||[];h.useEffect(()=>{p||i!=null&&i.registerZone&&(i==null||i.registerZone(f))},[p]);const v=s??"div";return!u||!l?null:(f!==Ye&&(p=cd(u,f).zones[f]),c.jsx(v,{className:t,style:n,ref:o,children:p.map(g=>l.components[g.type]?c.jsx(tS,{config:l,item:g,metadata:d},g.props.id):null)}))}),ma=e=>c.jsx(nS,A({},e)),nS=h.forwardRef(function(t,n){const r=h.useContext(xr);return(r==null?void 0:r.mode)==="edit"?c.jsx(c.Fragment,{children:c.jsx(qh,z(A({},t),{ref:n}))}):c.jsx(c.Fragment,{children:c.jsx(Zh,z(A({},t),{ref:n}))})}),ya=uo.createContext({config:{components:{}},data:{root:{},content:[]},metadata:{}});function rS({config:e,data:t,metadata:n={}}){var r,s;const o=z(A({},t),{root:t.root||{},content:t.content||[]}),i="props"in o.root?o.root.props:o.root,a=(i==null?void 0:i.title)||"",l=z(A({},i),{puck:{renderDropZone:ma,isEditing:!1,dragRef:null,metadata:n},title:a,editMode:!1,id:"puck-root"}),u=zo(e,{type:"root",props:l},p=>c.jsx(Vd,z(A({},p),{config:e,metadata:n}))),d=$o((r=e.root)==null?void 0:r.fields,l),f=h.useMemo(()=>({mode:"render",depth:0}),[]);return(s=e.root)!=null&&s.render?c.jsx(ya.Provider,{value:{config:e,data:o,metadata:n},children:c.jsx(vs,{value:f,children:c.jsx(e.root.render,z(A(A({},u),d),{children:c.jsx(va,{zone:Pi})}))})}):c.jsx(ya.Provider,{value:{config:e,data:o,metadata:n},children:c.jsx(vs,{value:f,children:c.jsx(va,{zone:Pi})})})}P();P();P();function Yh(e,t,n="force"){return Ee(this,null,function*(){const r=yield t().resolveComponentData(e,n);if(!r.didChange)return;const s=Ln(t().state,r.node.props.id);if(!s){console.warn(`Warning: Could not find component with id "${e.props.id}" to resolve its data. Component may have been removed or the id is invalid.`);return}t().dispatch({type:"replace",data:bs(r.node),destinationIndex:s.index,destinationZone:s.zone})})}function sS(e,t,n){return Ee(this,null,function*(){const r=t().state.indexes.nodes[e];if(!r){console.warn(`Warning: Could not find component with id "${e}" to resolve its data. Component may have been removed or the id is invalid.`);return}yield Yh(r.data,t,n)})}P();function oS(e,t,n){return Ee(this,null,function*(){const r=xt(e,t().state);if(!r){console.warn(`Warning: Could not find component for selector "${JSON.stringify(e)}" to resolve its data. Component may have been removed or the selector is invalid.`);return}const s=bs(r);yield Yh(s,t,n)})}var xu=(e,t)=>{const n={back:e.history.back,forward:e.history.forward,setHistories:e.history.setHistories,setHistoryIndex:e.history.setHistoryIndex,hasPast:e.history.hasPast(),hasFuture:e.history.hasFuture(),histories:e.history.histories,index:e.history.index},r={appState:ns(e.state),config:e.config,dispatch:e.dispatch,getPermissions:e.permissions.getPermissions,refreshPermissions:e.permissions.refreshPermissions,resolveDataById:(s,o)=>sS(s,t,o),resolveDataBySelector:(s,o)=>oS(s,t,o),history:n,selectedItem:e.selectedItem||null,getItemBySelector:s=>xt(s,e.state),getItemById:s=>e.state.indexes.nodes[s].data,getSelectorForId:s=>Ln(e.state,s),getParentById:s=>{const i=e.state.indexes.nodes[s].parentId;if(i===null)return;const a=e.state.indexes.nodes[i];if(a)return a.data}};return r.__private={appState:e.state},r},Bl=h.createContext(null),wu=e=>({state:e.state,config:e.config,dispatch:e.dispatch,permissions:e.permissions,history:e.history,selectedItem:e.selectedItem}),iS=e=>{const[t]=h.useState(()=>cr(()=>xu(wu(e.getState()),e.getState)));return h.useEffect(()=>e.subscribe(n=>wu(n),n=>{t.setState(xu(n,e.getState))}),[]),t};function aS(){return function(t){const n=h.useContext(Bl);if(!n)throw new Error("usePuck must be used inside <Puck>.");return To(n,t??(s=>s))}}function Gh(){const e=h.useContext(Bl);if(!e)throw new Error("usePuckGet must be used inside <Puck>.");return e.getState}P();P();P();P();P();var lS={ComponentList:"_ComponentList_1rrlt_1","ComponentList--isExpanded":"_ComponentList--isExpanded_1rrlt_5","ComponentList-content":"_ComponentList-content_1rrlt_9","ComponentList-title":"_ComponentList-title_1rrlt_17","ComponentList-titleIcon":"_ComponentList-titleIcon_1rrlt_53"},Zs=ne("ComponentList",lS),Kh=({name:e,label:t})=>{var n;const r=V(o=>o.overrides),s=V(o=>o.permissions.getPermissions({type:e}).insert);return h.useEffect(()=>{r.componentItem&&console.warn("The `componentItem` override has been deprecated and renamed to `drawerItem`")},[r]),c.jsx(Fl.Item,{label:t,name:e,isDragDisabled:!s,children:(n=r.componentItem)!=null?n:r.drawerItem})},er=({children:e,title:t,id:n})=>{const r=V(a=>a.config),s=V(a=>a.setUi),o=V(a=>a.state.ui.componentList),{expanded:i=!0}=o[n]||{};return c.jsxs("div",{className:Zs({isExpanded:i}),children:[t&&c.jsxs("button",{type:"button",className:Zs("title"),onClick:()=>s({componentList:z(A({},o),{[n]:z(A({},o[n]),{expanded:!i})})}),title:i?`Collapse${t?` ${t}`:""}`:`Expand${t?` ${t}`:""}`,children:[c.jsx("div",{children:t}),c.jsx("div",{className:Zs("titleIcon"),children:i?c.jsx(yd,{size:12}):c.jsx(sr,{size:12})})]}),c.jsx("div",{className:Zs("content"),children:c.jsx(Fl,{children:e||Object.keys(r.components).map(a=>{var l;return c.jsx(Kh,{label:(l=r.components[a].label)!=null?l:a,name:a},a)})})})]})};er.Item=Kh;var cS=()=>{const[e,t]=h.useState(),n=V(s=>s.config),r=V(s=>s.state.ui.componentList);return h.useEffect(()=>{var s,o,i;if(Object.keys(r).length>0){const a=[];let l;l=Object.entries(r).map(([d,f])=>!f.components||(f.components.forEach(p=>{a.push(p)}),f.visible===!1)?null:c.jsx(er,{id:d,title:f.title||d,children:f.components.map((p,v)=>{var g;const m=n.components[p]||{};return c.jsx(er.Item,{label:(g=m.label)!=null?g:p,name:p,index:v},p)})},d));const u=Object.keys(n.components).filter(d=>a.indexOf(d)===-1);u.length>0&&!((s=r.other)!=null&&s.components)&&((o=r.other)==null?void 0:o.visible)!==!1&&l.push(c.jsx(er,{id:"other",title:((i=r.other)==null?void 0:i.title)||"Other",children:u.map((d,f)=>{var p;const v=n.components[d]||{};return c.jsx(er.Item,{name:d,label:(p=v.label)!=null?p:d,index:f},d)})},"other")),t(l)}},[n.categories,n.components,r]),e},Xh=()=>{const e=V(r=>r.overrides),t=cS(),n=h.useMemo(()=>(e.components&&console.warn("The `components` override has been deprecated and renamed to `drawer`"),e.components||e.drawer||"div"),[e]);return c.jsx(n,{children:t||c.jsx(er,{id:"all"})})};P();var uS={BlocksPlugin:"_BlocksPlugin_1ey1i_1"},dS=ne("BlocksPlugin",uS),Jh=()=>({name:"blocks",label:"Blocks",render:()=>c.jsx("div",{className:dS(),children:c.jsx(Xh,{})}),icon:c.jsx(ry,{})});P();P();P();P();var Qh={LayerTree:"_LayerTree_7rx04_1","LayerTree-zoneTitle":"_LayerTree-zoneTitle_7rx04_11","LayerTree-helper":"_LayerTree-helper_7rx04_17",Layer:"_Layer_7rx04_1","Layer-inner":"_Layer-inner_7rx04_29","Layer--containsZone":"_Layer--containsZone_7rx04_35","Layer-clickable":"_Layer-clickable_7rx04_39","Layer--isSelected":"_Layer--isSelected_7rx04_61","Layer-chevron":"_Layer-chevron_7rx04_77","Layer--childIsSelected":"_Layer--childIsSelected_7rx04_78","Layer-zones":"_Layer-zones_7rx04_82","Layer-title":"_Layer-title_7rx04_96","Layer-name":"_Layer-name_7rx04_105","Layer-icon":"_Layer-icon_7rx04_111","Layer-zoneIcon":"_Layer-zoneIcon_7rx04_116"},lr=ne("LayerTree",Qh),rn=ne("Layer",Qh),eg=32,fS=8,pS=25,tg=new Map,hS=e=>Object.keys(e).reduce((t,n)=>{const[r]=n.split(":");return t[r]=[...t[r]||[],n],t},{}),gS=(e,t,n,r)=>{var s,o,i,a;if(r!==void 0)return r;const[l,u]=e.split(":");if(!u)return;const d=(s=t[l])==null?void 0:s.data.type,f=d&&d!==es?n.components[d]:n.root;return(a=(i=(o=f==null?void 0:f.fields)==null?void 0:o[u])==null?void 0:i.label)!=null?a:u},vS=({config:e,itemId:t,index:n,nodes:r,zoneCompound:s,zones:o,zonesByParent:i})=>{var a,l,u;const d=r[t],f=((a=d==null?void 0:d.data.type)==null?void 0:a.toString())||"Component",p=(u=(l=e.components[f])==null?void 0:l.label)!=null?u:f;return{childZones:(i[t]||[]).map(g=>ng({config:e,nodes:r,zoneCompound:g,zones:o,zonesByParent:i})),componentType:f,index:n,itemId:t,label:p,zoneCompound:s}},ng=({config:e,label:t,nodes:n,zoneCompound:r,zones:s,zonesByParent:o=hS(s)})=>{var i,a;return{items:((a=(i=s[r])==null?void 0:i.contentIds)!=null?a:[]).map((u,d)=>vS({config:e,itemId:u,index:d,nodes:n,zoneCompound:r,zones:s,zonesByParent:o})),label:gS(r,n,e,t),zoneCompound:r}},mS=e=>{var t;return(t=tg.get(e))!=null?t:eg},yS=(e,t)=>{t<=0||tg.set(e,t)},bS=e=>{var t;let n=(t=e==null?void 0:e.parentElement)!=null?t:null;for(;n;){const{overflow:r,overflowY:s}=getComputedStyle(n);if([r,s].some(o=>/auto|scroll/.test(o)))return n;n=n.parentElement}return null},rg=h.forwardRef(function({childIsSelected:t,dataIndex:n,depth:r,isSelected:s,node:o,selectedId:i,selectedPathIds:a},l){const u=V(m=>m.dispatch),d=h.useContext(nt),f=Gt(nt,m=>m.hoveringComponent===o.itemId),p=o.childZones.length>0,v=h.useCallback(m=>{u({type:"setUi",ui:{itemSelector:m}})},[u]),g=s||t;return c.jsxs("li",{ref:l,className:rn({childIsSelected:t,containsZone:p,isHovering:f,isSelected:s}),"data-index":n,"data-puck-layer-tree-id":o.itemId,children:[c.jsx("div",{className:rn("inner"),children:c.jsxs("button",{type:"button",className:rn("clickable"),onClick:()=>{if(s){v(null);return}v({index:o.index,zone:o.zoneCompound}),d.getState().scrollToComponent(o.itemId)},onMouseEnter:m=>{m.stopPropagation(),d.setState({hoveringComponent:o.itemId})},onMouseLeave:m=>{m.stopPropagation(),d.setState({hoveringComponent:null})},children:[p&&c.jsx("div",{className:rn("chevron"),title:s?"Collapse":"Expand",children:c.jsx(sr,{size:"12"})}),c.jsxs("div",{className:rn("title"),children:[c.jsx("div",{className:rn("icon"),children:o.componentType==="Text"||o.componentType==="Heading"?c.jsx(No,{size:"16"}):c.jsx(fy,{size:"16"})}),c.jsx("div",{className:rn("name"),children:o.label})]})]})}),p&&g&&o.childZones.map(m=>c.jsx("div",{className:rn("zones"),children:c.jsx(sg,{depth:r+1,selectedId:i,selectedPathIds:a,tree:m})},m.zoneCompound))]})}),sg=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>{const s=e===0&&r.items.length>=pS;return c.jsxs(c.Fragment,{children:[r.label&&c.jsxs("div",{className:lr("zoneTitle"),children:[c.jsx("div",{className:lr("zoneIcon"),children:c.jsx(_d,{size:"16"})}),r.label]}),s?c.jsx(xS,{depth:e,selectedId:t,selectedPathIds:n,tree:r}):c.jsx(_S,{depth:e,selectedId:t,selectedPathIds:n,tree:r})]})},_S=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>c.jsxs("ul",{className:lr(),children:[r.items.length===0&&c.jsx("div",{className:lr("helper"),children:"No items"}),r.items.map(s=>c.jsx(rg,{childIsSelected:n.has(s.itemId),depth:e,isSelected:t===s.itemId,node:s,selectedId:t,selectedPathIds:n},s.itemId))]}),xS=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>{const s=h.useRef(null),o=kh({count:r.items.length,estimateSize:p=>mS(r.items[p].itemId),getItemKey:p=>r.items[p].itemId,getScrollElement:()=>bS(s.current),overscan:fS,measureElement:p=>{const v=Math.ceil(p.getBoundingClientRect().height),g=p.dataset.puckLayerTreeId;return g&&yS(g,v),v||eg}}),i=o.getVirtualItems(),a=o.getTotalSize(),l=[];let u=0,d=-1;i.forEach(p=>{const v=r.items[p.index],g=Math.max(p.start-u,0);g>0&&l.push(c.jsx("li",{"aria-hidden":"true",style:{height:`${g}px`}},`gap:${r.zoneCompound}:${d}:${p.index}`)),l.push(c.jsx(rg,{childIsSelected:n.has(v.itemId),dataIndex:p.index,depth:e,isSelected:t===v.itemId,node:v,ref:o.measureElement,selectedId:t,selectedPathIds:n},v.itemId)),u=p.end,d=p.index});const f=Math.max(a-u,0);return f>0&&l.push(c.jsx("li",{"aria-hidden":"true",style:{height:`${f}px`}},`gap:${r.zoneCompound}:${d}:end`)),c.jsxs("ul",{className:lr(),ref:s,children:[r.items.length===0&&c.jsx("div",{className:lr("helper"),children:"No items"}),l]})},wS=({selectedId:e,selectedPathIds:t,trees:n})=>c.jsx(c.Fragment,{children:n.map(r=>c.jsx(sg,{depth:0,selectedId:e,selectedPathIds:t,tree:r},r.zoneCompound))});P();var SS=(e,t)=>Object.keys(e.indexes.zones).filter(n=>n.split(":")[0]===t),og=()=>{const e=V(u=>u.overrides.outline),t=V(u=>u.config),n=V(u=>u.state.indexes.nodes),r=V(u=>u.state.indexes.zones),s=V(u=>{var d;return((d=u.selectedItem)==null?void 0:d.props.id)||null}),o=V(Ge(u=>SS(u.state,"root"))),i=h.useMemo(()=>{var u;const d=s?(u=n[s])==null?void 0:u.path:null;return new Set((d==null?void 0:d.map(f=>f.split(":")[0]).filter(Boolean))||[])},[n,s]),a=h.useMemo(()=>o.map(u=>ng({config:t,label:o.length===1?"":u.split(":")[1],nodes:n,zoneCompound:u,zones:r})),[t,n,o,r]),l=h.useMemo(()=>e||"div",[e]);return c.jsx(l,{children:c.jsx(wS,{selectedId:s,selectedPathIds:i,trees:a})})};P();var kS={OutlinePlugin:"_OutlinePlugin_q92j6_1"},IS=ne("OutlinePlugin",kS),ig=()=>({name:"outline",label:"Outline",render:()=>c.jsx("div",{className:IS(),children:c.jsx(og,{})}),icon:c.jsx(_d,{})});P();P();P();var ES={Breadcrumbs:"_Breadcrumbs_1c9yh_1","Breadcrumbs-breadcrumbLabel":"_Breadcrumbs-breadcrumbLabel_1c9yh_7","Breadcrumbs-breadcrumb":"_Breadcrumbs-breadcrumb_1c9yh_7"};P();var CS=e=>{const t=V(o=>{var i;return(i=o.selectedItem)==null?void 0:i.props.id}),n=V(o=>o.config),r=V(o=>{var i;return(i=o.state.indexes.nodes[t])==null?void 0:i.path}),s=Ae();return h.useMemo(()=>{const o=(r==null?void 0:r.map(i=>{var a,l,u,d;const[f]=i.split(":");if(f==="root")return{label:((a=n==null?void 0:n.root)==null?void 0:a.label)||"Page",selector:null};const p=s.getState().state.indexes.nodes[f],v=p.path[p.path.length-1],m=(((l=s.getState().state.indexes.zones[v])==null?void 0:l.contentIds)||[]).indexOf(f);return{label:p?(d=(u=n.components[p.data.type])==null?void 0:u.label)!=null?d:p.data.type:"Component",selector:p?{index:m,zone:p.path[p.path.length-1]}:null}}))||[];return e?o.slice(o.length-e):o},[r,e])},xi=ne("Breadcrumbs",ES),ag=({children:e,numParents:t=1})=>{const n=V(s=>s.setUi),r=CS(t);return c.jsxs("div",{className:xi(),children:[r.map((s,o)=>c.jsxs("div",{className:xi("breadcrumb"),children:[c.jsx("button",{type:"button",className:xi("breadcrumbLabel"),onClick:()=>n({itemSelector:s.selector}),children:s.label}),c.jsx(Xm,{size:16})]},o)),e]})};P();P();var jS={PuckFields:"_PuckFields_10bh7_1","PuckFields--isLoading":"_PuckFields--isLoading_10bh7_6","PuckFields-loadingOverlay":"_PuckFields-loadingOverlay_10bh7_10","PuckFields-loadingOverlayInner":"_PuckFields-loadingOverlayInner_10bh7_25","PuckFields-field":"_PuckFields-field_10bh7_32","PuckFields--wrapFields":"_PuckFields--wrapFields_10bh7_36"},co=ne("PuckFields",jS),PS=({children:e})=>c.jsx(c.Fragment,{children:e}),AS=(e,t)=>(n,r)=>Ee(null,null,function*(){const{dispatch:s,state:o,selectedItem:i,resolveComponentData:a}=t.getState(),{data:l,ui:u}=o,{itemSelector:d}=u,f=l.root.props||l.root,p=i?i.props:f,v=z(A({},p),{[e]:n});if(i&&d){const g=yield a(z(A({},i),{props:v}),"replace"),m=Ln(t.getState().state,i.props.id);if(!m)return;s({type:"replace",destinationIndex:m.index,destinationZone:m.zone||Ye,data:g.node,ui:r});return}if(l.root.props){s({type:"replaceRoot",root:(yield a(z(A({},l.root),{props:v}),"replace")).node,ui:A(A({},u),r),recordHistory:!0});return}s({type:"setData",data:{root:v}})}),OS=({fieldName:e})=>{const t=V(u=>u.fields.fields[e]),n=V(u=>((u.selectedItem?u.selectedItem.readOnly:u.state.data.root.readOnly)||{})[e]),r=V(u=>t?u.selectedItem?`${u.selectedItem.props.id}_${t.type}_${e}`:`root_${t.type}_${e}`:null),s=V(Ge(u=>{const{selectedItem:d,permissions:f}=u;return d?f.getPermissions({item:d}):f.getPermissions({root:!0})})),o=Ae(),i=h.useCallback(AS(e,o),[e]),{visible:a=!0}=t??{},l=h.useContext(js.ctx);return h.useEffect(()=>o.subscribe(u=>{var d;return(d=u.getCurrentData().props)==null?void 0:d[e]},u=>{l.setState({[e]:u})}),[o,l]),!t||!r||!a||t.type==="slot"?null:c.jsx("div",{className:co("field"),children:c.jsx(Rh,{field:t,name:e,id:r,readOnly:!s.edit||n,onChange:i})},r)},MS=({fieldName:e})=>{const t=Ae(),n=h.useMemo(()=>{var r;const s=(r=t.getState().getCurrentData().props)==null?void 0:r[e];return{[e]:s}},[]);return c.jsx(js.Provider,{value:n,children:c.jsx(OS,{fieldName:e})})},DS=h.memo(MS),TS=({wrapFields:e=!0})=>{const t=V(d=>d.overrides),n=V(d=>{var f,p;const v=d.selectedItem?(f=d.componentState[d.selectedItem.props.id])==null?void 0:f.loadingCount:(p=d.componentState.root)==null?void 0:p.loadingCount;return(v??0)>0}),r=V(Ge(d=>d.state.ui.itemSelector)),s=V(d=>{var f;return(f=d.selectedItem)==null?void 0:f.props.id}),o=Ae();Wy(o,s);const i=V(d=>d.fields.loading),a=V(Ge(d=>d.fields.id===s?Object.keys(d.fields.fields):[])),l=i||n,u=h.useMemo(()=>t.fields||PS,[t]);return c.jsxs("form",{className:co({wrapFields:e}),onSubmit:d=>{d.preventDefault()},children:[c.jsx(u,{isLoading:l,itemSelector:r,children:a.map(d=>c.jsx(DS,{fieldName:d},d))}),l&&c.jsx("div",{className:co("loadingOverlay"),children:c.jsx("div",{className:co("loadingOverlayInner"),children:c.jsx(On,{size:16})})})]})},Hl=h.memo(TS);P();var RS={FieldsPlugin:"_FieldsPlugin_nd930_1","FieldsPlugin-header":"_FieldsPlugin-header_nd930_7"},Su=ne("FieldsPlugin",RS),LS=()=>V(t=>{var n,r;const s=t.selectedItem;return s?(r=(n=t.config.components[s.type])==null?void 0:n.label)!=null?r:s.type:"Page"}),lg=({desktopSideBar:e="right"}={})=>({name:"fields",label:"Fields",render:()=>c.jsxs("div",{className:Su(),children:[c.jsx("div",{className:Su("header"),children:c.jsx(ag,{numParents:2,children:c.jsx(LS,{})})}),c.jsx(Hl,{})]}),icon:c.jsx(wy,{}),mobileOnly:e==="right"});P();P();P();var ba='style, link[rel="stylesheet"]',NS=e=>{const t=[];return e.querySelectorAll(ba).forEach(n=>{n.tagName==="STYLE"?n.innerHTML.trim()&&t.push(n):t.push(n)}),t},ku=e=>Array.from(document.styleSheets).find(t=>t.ownerNode.href===e.href),zS=e=>{if(e)try{return Array.from(e.cssRules).map(t=>t.cssText).join("")}catch{console.warn("Access to stylesheet %s is denied. Ignoring…",e.href)}return""},Iu=(e,t)=>{const n=e.attributes;(n==null?void 0:n.length)>0&&Array.from(n).forEach(r=>{t.setAttribute(r.name,r.value)})},Eu=e=>setTimeout(e,0),$S=({children:e,debug:t=!1,onStylesLoaded:n=()=>null})=>{const{document:r,window:s}=FS();return h.useEffect(()=>{if(!s||!r)return()=>{};let o=[];const i={},a=k=>o.findIndex(y=>y.original===k),l=(k,y=!1)=>Ee(null,null,function*(){let b;if(k.nodeName==="LINK"&&y){b=document.createElement("style"),b.type="text/css";let C=ku(k);C||(yield new Promise(O=>{const _=()=>{O(),k.removeEventListener("load",_)};k.addEventListener("load",_)}),C=ku(k));const j=zS(C);if(!j){t&&console.warn("Tried to load styles for link element, but couldn't find them. Skipping...");return}b.innerHTML=j,b.setAttribute("data-href",k.getAttribute("href"))}else b=k.cloneNode(!0);return b}),u=k=>Ee(null,null,function*(){const y=a(k);if(y>-1){t&&console.log("Tried to add an element that was already mirrored. Updating instead..."),o[y].mirror.innerText=k.innerText;return}const b=yield l(k);if(!b)return;const C=hi(b.outerHTML);if(i[C]){t&&console.log("iframe already contains element that is being mirrored. Skipping...");return}i[C]=!0,r.head.append(b),o.push({original:k,mirror:b}),t&&console.log(`Added style node ${k.outerHTML}`)}),d=k=>{var y,b;const C=a(k);if(C===-1){t&&console.log("Tried to remove an element that did not exist. Skipping...");return}const j=hi(k.outerHTML);(b=(y=o[C])==null?void 0:y.mirror)==null||b.remove(),delete i[j],t&&console.log(`Removed style node ${k.outerHTML}`)},f=new MutationObserver(k=>{k.forEach(y=>{y.type==="childList"&&(y.addedNodes.forEach(b=>{if(b.nodeType===Node.TEXT_NODE||b.nodeType===Node.ELEMENT_NODE){const C=b.nodeType===Node.TEXT_NODE?b.parentElement:b;C&&C.matches(ba)&&Eu(()=>u(C))}}),y.removedNodes.forEach(b=>{if(b.nodeType===Node.TEXT_NODE||b.nodeType===Node.ELEMENT_NODE){const C=b.nodeType===Node.TEXT_NODE?b.parentElement:b;C&&C.matches(ba)&&Eu(()=>d(C))}}))})}),p=s.parent.document,v=NS(p),g=[];let m=0;const w=p.getElementsByTagName("html")[0];Iu(w,r.documentElement);const S=p.getElementsByTagName("body")[0];return Iu(S,r.body),Promise.all(v.map((k,y)=>Ee(null,null,function*(){if(k.nodeName==="LINK"){const C=k.href;if(g.indexOf(C)>-1)return;g.push(C)}const b=yield l(k);if(b)return o.push({original:k,mirror:b}),b}))).then(k=>{const y=k.filter(b=>typeof b<"u");y.forEach(b=>{b.onload=()=>{m=m+1,m>=y.length&&n()},b.onerror=()=>{console.warn("AutoFrame couldn't load a stylesheet"),m=m+1,m>=y.length&&n()}}),r.head.innerHTML="",r.head.append(...y),y.forEach(b=>{b.nodeName==="STYLE"&&(m=m+1)}),m>=y.length&&n(),f.observe(p.head,{childList:!0,subtree:!0}),y.forEach(b=>{const C=hi(b.outerHTML);i[C]=!0})}),()=>{f.disconnect()}},[]),c.jsx(c.Fragment,{children:e})},Vl=h.createContext({}),FS=()=>h.useContext(Vl);function cg(e){var t=e,{children:n,className:r,debug:s,id:o,onReady:i=()=>{},onNotReady:a=()=>{},frameRef:l}=t,u=Kt(t,["children","className","debug","id","onReady","onNotReady","frameRef"]);const[d,f]=h.useState(!1),[p,v]=h.useState({}),[g,m]=h.useState(),[w,S]=h.useState(!1);return h.useEffect(()=>{var k;if(l.current){const y=l.current.contentDocument,b=l.current.contentWindow;v({document:y||void 0,window:b||void 0}),m((k=l.current.contentDocument)==null?void 0:k.getElementById("frame-root")),y&&b&&w?i():a()}},[l,d,w]),c.jsx("iframe",z(A({},u),{className:r,id:o,srcDoc:'<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',ref:l,onLoad:()=>{f(!0)},children:c.jsx(Vl.Provider,{value:p,children:d&&g&&c.jsx($S,{debug:s,onStylesLoaded:()=>S(!0),children:ms.createPortal(n,g)})})}))}cg.displayName="AutoFrame";var BS=cg;P();var HS={PuckPreview:"_PuckPreview_z2rgu_1","PuckPreview-frame":"_PuckPreview-frame_z2rgu_6"},wi=ne("PuckPreview",HS),VS=e=>{const t=V(n=>n.status);h.useEffect(()=>{if(e.current&&t==="READY"){const n=e.current,r=i=>{const a=new $h("pointermove",z(A({},i),{bubbles:!0,cancelable:!1,clientX:i.clientX,clientY:i.clientY,originalTarget:i.target}));n.dispatchEvent(a)},s=()=>{var i;o(),(i=n.contentDocument)==null||i.addEventListener("pointermove",r,{capture:!0})},o=()=>{var i;(i=n.contentDocument)==null||i.removeEventListener("pointermove",r)};return s(),()=>{o()}}},[t])},ug=({id:e="puck-preview"})=>{const t=V(g=>g.dispatch),n=V(g=>g.state.data.root),r=V(g=>g.config),s=V(g=>g.setStatus),o=V(g=>g.iframe),i=V(g=>g.overrides),a=V(g=>g.metadata),l=V(g=>g.state.ui.previewMode==="edit"?null:g.state.data),u=h.useCallback(g=>{var m,w,S,k;const y=zo(r,{type:"root",props:g},ga),b=$o((w=(m=r.root)==null?void 0:m.fields)!=null?w:{},g);return(S=r.root)!=null&&S.render?(k=r.root)==null?void 0:k.render(A(A({id:"puck-root"},y),b)):c.jsx(c.Fragment,{children:y.children})},[r]),d=h.useMemo(()=>i.iframe,[i]),f=n.props||n,p=h.useRef(null);VS(p);const v=l?c.jsx(rS,{data:l,config:r,metadata:a}):c.jsx(u,z(A({},f),{puck:{renderDropZone:ma,isEditing:!0,dragRef:null,metadata:a},editMode:!0,children:c.jsx(ma,{zone:Ye})}));return h.useEffect(()=>{o.enabled||s("READY")},[o.enabled]),c.jsx("div",{className:wi(),id:e,"data-puck-preview":!0,onClick:g=>{const m=g.target;!m.hasAttribute("data-puck-component")&&!m.hasAttribute("data-puck-dropzone")&&t({type:"setUi",ui:{itemSelector:null}})},children:o.enabled?c.jsx(BS,{id:"preview-frame",className:wi("frame"),"data-rfd-iframe":!0,onReady:()=>{s("READY")},onNotReady:()=>{s("MOUNTED")},frameRef:p,children:c.jsx(Vl.Consumer,{children:({document:g})=>d?c.jsx(d,{document:g,children:v}):v})}):c.jsx("div",{id:"preview-frame",className:wi("frame"),ref:p,"data-puck-entry":!0,children:v})})};P();P();var WS=({overrides:e,plugins:t})=>{const n=A({},e);return t==null||t.forEach(r=>{r.overrides&&Object.keys(r.overrides).forEach(s=>{var o;const i=s;if(!((o=r.overrides)!=null&&o[i]))return;if(i==="fieldTypes"){const u=r.overrides.fieldTypes;Object.keys(u).forEach(d=>{n.fieldTypes=n.fieldTypes||{};const f=n.fieldTypes[d],p=v=>u[d](z(A({},v),{children:f?f(v):v.children}));n.fieldTypes[d]=p});return}const a=n[i],l=u=>r.overrides[i](z(A({},u),{children:a?a(u):u.children}));n[i]=l})}),n},US=({overrides:e,plugins:t})=>h.useMemo(()=>WS({overrides:e,plugins:t}),[t,e]);P();P();var Wl={Puck:"_Puck_1dd16_19","Puck-portal":"_Puck-portal_1dd16_31",PuckLayout:"_PuckLayout_1dd16_36","PuckLayout-inner":"_PuckLayout-inner_1dd16_40","Puck--hidePlugins":"_Puck--hidePlugins_1dd16_72","PuckLayout--mounted":"_PuckLayout--mounted_1dd16_77","PuckLayout--mobilePanelHeightToggle":"_PuckLayout--mobilePanelHeightToggle_1dd16_81","PuckLayout--leftSideBarVisible":"_PuckLayout--leftSideBarVisible_1dd16_81","PuckLayout--isExpanded":"_PuckLayout--isExpanded_1dd16_87","PuckLayout--mobilePanelHeightMinContent":"_PuckLayout--mobilePanelHeightMinContent_1dd16_105","PuckLayout--rightSideBarVisible":"_PuckLayout--rightSideBarVisible_1dd16_132","PuckLayout-mounted":"_PuckLayout-mounted_1dd16_151","PuckLayout-nav":"_PuckLayout-nav_1dd16_192","PuckLayout-header":"_PuckLayout-header_1dd16_208",PuckPluginTab:"_PuckPluginTab_1dd16_222","PuckPluginTab--visible":"_PuckPluginTab--visible_1dd16_228","PuckPluginTab-body":"_PuckPluginTab-body_1dd16_233"};P();var qS="",ZS=(e,t)=>{const[n,r]=h.useState();return h.useEffect(()=>{r(document.createElement("style"))},[]),h.useEffect(()=>{var s;if(!(!n||typeof window>"u")){if(n.innerHTML=e,t){const o=jn();(s=o==null?void 0:o.head)==null||s.appendChild(n)}document.head.appendChild(n)}},[t,n]),n},YS=e=>ZS(qS,e);P();var _a=({children:e})=>c.jsx(c.Fragment,{children:e});P();var GS=()=>{const e=Ae(),t=h.useCallback(()=>{const n=e.getState().dispatch;n({type:"setUi",ui:r=>({previewMode:r.previewMode==="edit"?"interactive":"edit"})})},[e]);zt({meta:!0,i:!0},t),zt({ctrl:!0,i:!0},t)};P();P();P();var KS={MenuBar:"_MenuBar_8pf8c_1","MenuBar--menuOpen":"_MenuBar--menuOpen_8pf8c_14","MenuBar-inner":"_MenuBar-inner_8pf8c_29","MenuBar-history":"_MenuBar-history_8pf8c_45"},Si=ne("MenuBar",KS);function XS({menuOpen:e=!1,renderHeaderActions:t,setMenuOpen:n}){const r=V(a=>a.history.back),s=V(a=>a.history.forward),o=V(a=>a.history.hasFuture()),i=V(a=>a.history.hasPast());return c.jsx("div",{className:Si({menuOpen:e}),onClick:a=>{var l;const u=a.target;window.matchMedia("(min-width: 638px)").matches||u.tagName==="A"&&((l=u.getAttribute("href"))!=null&&l.startsWith("#"))&&n(!1)},children:c.jsxs("div",{className:Si("inner"),children:[c.jsxs("div",{className:Si("history"),children:[c.jsx(jt,{type:"button",title:"undo",disabled:!i,onClick:r,children:c.jsx(My,{size:21})}),c.jsx(jt,{type:"button",title:"redo",disabled:!o,onClick:s,children:c.jsx(Sy,{size:21})})]}),c.jsx(c.Fragment,{children:t&&t()})]})})}P();var JS={PuckHeader:"_PuckHeader_63pti_1","PuckHeader--hidePlugins":"_PuckHeader--hidePlugins_63pti_15","PuckHeader-inner":"_PuckHeader-inner_63pti_20","PuckHeader-toggle":"_PuckHeader-toggle_63pti_40","PuckHeader--rightSideBarVisible":"_PuckHeader--rightSideBarVisible_63pti_47","PuckHeader-rightSideBarToggle":"_PuckHeader-rightSideBarToggle_63pti_47","PuckHeader--leftSideBarVisible":"_PuckHeader--leftSideBarVisible_63pti_48","PuckHeader-leftSideBarToggle":"_PuckHeader-leftSideBarToggle_63pti_48","PuckHeader-title":"_PuckHeader-title_63pti_64","PuckHeader-path":"_PuckHeader-path_63pti_68","PuckHeader-tools":"_PuckHeader-tools_63pti_75","PuckHeader-menuButton":"_PuckHeader-menuButton_63pti_81","PuckHeader--menuOpen":"_PuckHeader--menuOpen_63pti_86"},qt=ne("PuckHeader",JS),QS=({hidePlugins:e})=>{const{onPublish:t,renderHeader:n,renderHeaderActions:r,headerTitle:s,headerPath:o,iframe:i}=Xo(),a=V(y=>y.dispatch),l=Ae(),u=h.useMemo(()=>n?(console.warn("`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"),b=>{var C=b,{actions:j}=C,O=Kt(C,["actions"]);const _=n,I=V(x=>x.state);return c.jsx(_,z(A({},O),{dispatch:a,state:I,children:j}))}):_a,[n]),d=h.useMemo(()=>r?(console.warn("`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."),b=>{const C=r,j=V(O=>O.state);return c.jsx(C,z(A({},b),{dispatch:a,state:j}))}):_a,[r]),f=V(y=>y.overrides.header||u),p=V(y=>y.overrides.headerActions||d),[v,g]=h.useState(!1),m=V(y=>{var b,C;return(C=((b=y.state.indexes.nodes.root)==null?void 0:b.data).props.title)!=null?C:""}),w=V(y=>y.state.ui.leftSideBarVisible),S=V(y=>y.state.ui.rightSideBarVisible),k=h.useCallback(y=>{const b=window.matchMedia("(min-width: 638px)").matches,C=y==="left"?w:S,j=y==="left"?"rightSideBarVisible":"leftSideBarVisible";a({type:"setUi",ui:A({[`${y}SideBarVisible`]:!C},b?{}:{[j]:!1})})},[a,w,S]);return c.jsx(f,{actions:c.jsx(c.Fragment,{children:c.jsx(p,{children:c.jsx(da,{onClick:()=>{const y=l.getState().state.data;t&&t(y)},icon:c.jsx(dc,{size:"14px"}),children:"Publish"})})}),children:c.jsx("header",{className:qt({leftSideBarVisible:w,rightSideBarVisible:S,hidePlugins:e}),children:c.jsxs("div",{className:qt("inner"),children:[c.jsxs("div",{className:qt("toggle"),children:[c.jsx("div",{className:qt("leftSideBarToggle"),children:c.jsx(jt,{type:"button",onClick:()=>{k("left")},title:"Toggle left sidebar",children:c.jsx(yy,{focusable:"false"})})}),c.jsx("div",{className:qt("rightSideBarToggle"),children:c.jsx(jt,{type:"button",onClick:()=>{k("right")},title:"Toggle right sidebar",children:c.jsx(by,{focusable:"false"})})})]}),c.jsx("div",{className:qt("title"),children:c.jsxs(zl,{rank:"2",size:"xs",children:[s||m||"Page",o&&c.jsxs(c.Fragment,{children:[" ",c.jsx("code",{className:qt("path"),children:o})]})]})}),c.jsxs("div",{className:qt("tools"),children:[c.jsx("div",{className:qt("menuButton"),children:c.jsx(jt,{type:"button",onClick:()=>g(!v),title:"Toggle menu bar",children:v?c.jsx(yd,{focusable:"false"}):c.jsx(sr,{focusable:"false"})})}),c.jsx(XS,{dispatch:a,onPublish:t,menuOpen:v,renderHeaderActions:()=>c.jsx(p,{children:c.jsx(da,{onClick:()=>{const y=l.getState().state.data;t&&t(y)},icon:c.jsx(dc,{size:"14px"}),children:"Publish"})}),setMenuOpen:g})]})]})})})},e2=h.memo(QS);P();P();var t2={SidebarSection:"_SidebarSection_5otpt_1","SidebarSection-title":"_SidebarSection-title_5otpt_12","SidebarSection--noBorderTop":"_SidebarSection--noBorderTop_5otpt_20","SidebarSection-content":"_SidebarSection-content_5otpt_24","SidebarSection-breadcrumbLabel":"_SidebarSection-breadcrumbLabel_5otpt_33","SidebarSection-breadcrumbs":"_SidebarSection-breadcrumbs_5otpt_62","SidebarSection-breadcrumb":"_SidebarSection-breadcrumb_5otpt_33","SidebarSection-heading":"_SidebarSection-heading_5otpt_74","SidebarSection-loadingOverlay":"_SidebarSection-loadingOverlay_5otpt_78"},Un=ne("SidebarSection",t2),n2=({children:e,title:t,background:n,showBreadcrumbs:r,noBorderTop:s,isLoading:o})=>c.jsxs("div",{className:Un({noBorderTop:s}),style:{background:n},children:[c.jsx("div",{className:Un("title"),children:c.jsxs("div",{className:Un("breadcrumbs"),children:[r&&c.jsx(ag,{}),c.jsx("div",{className:Un("heading"),children:c.jsx(zl,{rank:"2",size:"xs",children:t})})]})}),c.jsx("div",{className:Un("content"),children:e}),o&&c.jsx("div",{className:Un("loadingOverlay"),children:c.jsx(On,{size:32})})]});P();P();P();var dg={ViewportControls:"_ViewportControls_e3unb_1","ViewportControls--fullScreen":"_ViewportControls--fullScreen_e3unb_5","ViewportControls-toggleButton":"_ViewportControls-toggleButton_e3unb_14","ViewportControls--isExpanded":"_ViewportControls--isExpanded_e3unb_38","ViewportControls-actions":"_ViewportControls-actions_e3unb_42","ViewportControls-actionsInner":"_ViewportControls-actionsInner_e3unb_46","ViewportControls-divider":"_ViewportControls-divider_e3unb_75","ViewportControls-zoomSelect":"_ViewportControls-zoomSelect_e3unb_81","ViewportControls-zoom":"_ViewportControls-zoom_e3unb_81","ViewportButton-inner":"_ViewportButton-inner_e3unb_111","ViewportButton--isActive":"_ViewportButton--isActive_e3unb_119"},Cu={Smartphone:c.jsx(Ey,{size:16}),Tablet:c.jsx(Py,{size:16}),Monitor:c.jsx(Sd,{size:16}),FullWidth:c.jsx(ny,{size:16})},sn=ne("ViewportControls",dg),ju=ne("ViewportButton",dg),ki=({children:e,title:t,onClick:n,isActive:r,disabled:s})=>c.jsx("span",{className:ju({isActive:r}),suppressHydrationWarning:!0,children:c.jsx(jt,{type:"button",title:t,disabled:s||r,onClick:n,suppressHydrationWarning:!0,children:c.jsx("span",{className:ju("inner"),children:e})})}),Pu=[{label:"25%",value:.25},{label:"50%",value:.5},{label:"75%",value:.75},{label:"100%",value:1},{label:"125%",value:1.25},{label:"150%",value:1.5},{label:"200%",value:2}],r2=({autoZoom:e,zoom:t,onViewportChange:n,onZoom:r,fullScreen:s})=>{var o,i;const a=V(m=>m.viewports),l=V(m=>m.state.ui.viewports),u=Pu.find(m=>m.value===e),d=h.useMemo(()=>[...Pu,...u?[]:[{value:e,label:`${(e*100).toFixed(0)}% (Auto)`}]].filter(m=>m.value<=e).sort((m,w)=>m.value>w.value?1:-1),[e]),[f,p]=h.useState(l.current.width);h.useEffect(()=>{p(l.current.width)},[l.current]);const[v,g]=h.useState(!1);return c.jsxs("div",{className:sn({isExpanded:v,fullScreen:s}),suppressHydrationWarning:!0,children:[c.jsx("div",{className:sn("actions"),children:c.jsxs("div",{className:sn("actionsInner"),children:[a.map((m,w)=>c.jsx(ki,{title:m.label?`Switch to ${m.label} viewport`:"Switch viewport",onClick:()=>{p(m.width),n(m)},isActive:f===m.width,children:typeof m.icon=="string"?Cu[m.icon]||m.icon:m.icon||Cu.Smartphone},w)),c.jsx("div",{className:sn("divider")}),c.jsx(ki,{title:"Zoom viewport out",disabled:t<=((o=d[0])==null?void 0:o.value),onClick:m=>{m.stopPropagation(),r(d[Math.max(d.findIndex(w=>w.value===t)-1,0)].value)},children:c.jsx(Ry,{size:16})}),c.jsx(ki,{title:"Zoom viewport in",disabled:t>=((i=d[d.length-1])==null?void 0:i.value),onClick:m=>{m.stopPropagation(),r(d[Math.min(d.findIndex(w=>w.value===t)+1,d.length-1)].value)},children:c.jsx(Ty,{size:16})}),c.jsxs("div",{className:sn("zoom"),children:[c.jsx("div",{className:sn("divider")}),c.jsx("select",{className:sn("zoomSelect"),value:t.toString(),onClick:m=>{m.stopPropagation()},onChange:m=>{r(parseFloat(m.currentTarget.value))},children:d.map(m=>c.jsx("option",{value:m.value,label:m.label},m.label))})]})]})}),c.jsx("button",{className:sn("toggleButton"),title:"Toggle viewport menu",onClick:()=>g(m=>!m),children:v?c.jsx(Dy,{size:16}):c.jsx(Sd,{size:16})})]})};P();var s2={PuckCanvas:"_PuckCanvas_t6s9b_1","PuckCanvas-controls":"_PuckCanvas-controls_t6s9b_17","PuckCanvas--fullScreen":"_PuckCanvas--fullScreen_t6s9b_22","PuckCanvas-inner":"_PuckCanvas-inner_t6s9b_33","PuckCanvas-root":"_PuckCanvas-root_t6s9b_42","PuckCanvas--ready":"_PuckCanvas--ready_t6s9b_67","PuckCanvas-loader":"_PuckCanvas-loader_t6s9b_72","PuckCanvas--showLoader":"_PuckCanvas--showLoader_t6s9b_82"};P();var fg=h.createContext(null),o2=({children:e})=>{const t=h.useRef(null),n=h.useMemo(()=>({frameRef:t}),[]);return c.jsx(fg.Provider,{value:n,children:e})},pg=()=>{const e=h.useContext(fg);if(e===null)throw new Error("useCanvasFrame must be used within a FrameProvider");return e},jr=ne("PuckCanvas",s2),Ii=150,i2=()=>{var e;const{frameRef:t}=pg(),n=Ad(t),{viewports:r=ss,ui:s}=Xo(),{dispatch:o,overrides:i,setUi:a,zoomConfig:l,setZoomConfig:u,status:d,iframe:f,_experimentalFullScreenCanvas:p}=V(Ge(M=>({dispatch:M.dispatch,overrides:M.overrides,setUi:M.setUi,zoomConfig:M.zoomConfig,setZoomConfig:M.setZoomConfig,status:M.status,iframe:M.iframe,_experimentalFullScreenCanvas:M._experimentalFullScreenCanvas}))),{leftSideBarVisible:v,rightSideBarVisible:g,leftSideBarWidth:m,rightSideBarWidth:w,viewports:S}=V(Ge(M=>({leftSideBarVisible:M.state.ui.leftSideBarVisible,rightSideBarVisible:M.state.ui.rightSideBarVisible,leftSideBarWidth:M.state.ui.leftSideBarWidth,rightSideBarWidth:M.state.ui.rightSideBarWidth,viewports:M.state.ui.viewports}))),[k,y]=h.useState(!1),b=h.useRef(!1),C=h.useMemo(()=>({children:D})=>c.jsx(c.Fragment,{children:D}),[]),j=h.useMemo(()=>i.preview||C,[i]),O=h.useCallback(()=>{if(t.current){const M=t.current,D=Pd(M);return{width:D.contentBox.width,height:D.contentBox.height}}return{width:0,height:0}},[t]);h.useEffect(()=>{n()},[t,v,g,m,w,S]),h.useEffect(()=>{const{height:M}=O();S.current.height==="auto"&&u(z(A({},l),{rootHeight:M/l.zoom}))},[l.zoom,O,u]),h.useEffect(()=>{n()},[S.current.width,S]),h.useEffect(()=>{if(!t.current)return;const M=new ResizeObserver(()=>{b.current||n()});return M.observe(t.current),()=>{M.disconnect()}},[t.current]);const[_,I]=h.useState(!1);h.useEffect(()=>{setTimeout(()=>{I(!0)},500)},[]);const x=Ae();return h.useEffect(()=>{var M,D;if(typeof window>"u"||(M=s==null?void 0:s.viewports)!=null&&M.current)return;const L=window.innerWidth,N=(D=t.current)==null?void 0:D.getBoundingClientRect().width;if(!L||!N||r.length===0)return;const B=Object.values(r).find(Z=>Z.width==="100%"),H=!!B;let $=Object.entries(r).filter(([Z,F])=>F.width!=="100%").map(([Z,F])=>({key:Z,diff:Math.abs(L-(typeof F.width=="string"?L:F.width)),value:F})).sort((Z,F)=>Z.diff>F.diff?1:-1)[0].value;if($.width<N&&H&&($=B),f.enabled){const Z=x.getState(),F={state:z(A({},Z.state),{ui:z(A({},Z.state.ui),{viewports:z(A({},Z.state.ui.viewports),{current:z(A({},Z.state.ui.viewports.current),{height:($==null?void 0:$.height)||"auto",width:$==null?void 0:$.width})})})})};let X=Z.history;Z.history.histories.length===1&&(X=z(A({},X),{histories:[F]})),x.setState(z(A({},F),{history:X}))}},[r,t.current,f,x,(e=s==null?void 0:s.viewports)==null?void 0:e.current]),c.jsxs("div",{className:jr({ready:d==="READY"||!f.enabled||!f.waitForStyles,showLoader:_,fullScreen:p}),onClick:M=>{const D=M.target;!D.hasAttribute("data-puck-component")&&!D.hasAttribute("data-puck-dropzone")&&o({type:"setUi",ui:{itemSelector:null},recordHistory:!1})},children:[S.controlsVisible&&f.enabled&&c.jsx("div",{className:jr("controls"),children:c.jsx(r2,{fullScreen:p,autoZoom:l.autoZoom,zoom:l.zoom,onViewportChange:M=>{y(!0),b.current=!0;const D=z(A({},M),{height:M.height||"auto",zoom:l.zoom}),L={viewports:z(A({},S),{current:D})};a(L),n({viewports:z(A({},S),{current:D})})},onZoom:M=>{y(!0),b.current=!0,u(z(A({},l),{zoom:M}))}})}),c.jsxs("div",{className:jr("inner"),ref:t,children:[c.jsx("div",{className:jr("root"),style:{width:f.enabled?S.current.width:"100%",height:l.rootHeight,transform:f.enabled?`scale(${l.zoom})`:void 0,transition:k?`width ${Ii}ms ease-out, height ${Ii}ms ease-out, transform ${Ii}ms ease-out`:"",overflow:f.enabled?void 0:"auto"},suppressHydrationWarning:!0,id:"puck-canvas-root",onTransitionEnd:()=>{y(!1),b.current=!1},children:c.jsx(j,{children:c.jsx(ug,{})})}),c.jsx("div",{className:jr("loader"),children:c.jsx(On,{size:24})})]})]})};P();function Au(e,t){const[n,r]=h.useState(null),s=h.useRef(null),o=V(a=>e==="left"?a.state.ui.leftSideBarWidth:a.state.ui.rightSideBarWidth);h.useEffect(()=>{if(typeof window<"u"&&!o)try{const a=localStorage.getItem("puck-sidebar-widths");if(a){const u=JSON.parse(a)[e];u&&t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:u}})}}catch(a){console.error(`Failed to load ${e} sidebar width from localStorage`,a)}},[t,e,o]),h.useEffect(()=>{o!==void 0&&r(o)},[o]);const i=h.useCallback(a=>{t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:a}});let l={};try{const u=localStorage.getItem("puck-sidebar-widths");l=u?JSON.parse(u):{}}catch(u){console.error(`Failed to save ${e} sidebar width to localStorage`,u)}finally{localStorage.setItem("puck-sidebar-widths",JSON.stringify(z(A({},l),{[e]:a})))}window.dispatchEvent(new CustomEvent("viewportchange",{bubbles:!0,cancelable:!1}))},[t,e]);return{width:n,setWidth:r,sidebarRef:s,handleResizeEnd:i}}P();P();P();var a2={ResizeHandle:"_ResizeHandle_144bf_2","ResizeHandle--left":"_ResizeHandle--left_144bf_16","ResizeHandle--right":"_ResizeHandle--right_144bf_20"},l2=ne("ResizeHandle",a2),c2=({position:e,sidebarRef:t,onResize:n,onResizeEnd:r})=>{const{frameRef:s}=pg(),o=Ad(s),i=h.useRef(null),a=h.useRef(!1),l=h.useRef(0),u=h.useRef(0),d=h.useCallback(v=>{if(!a.current)return;const g=v.clientX-l.current,m=e==="left"?u.current+g:u.current-g,w=Math.max(192,m);n(w),v.preventDefault()},[n,e]),f=h.useCallback(()=>{var v;if(!a.current)return;a.current=!1,document.body.style.cursor="",document.body.style.userSelect="";const g=document.getElementById("resize-overlay");g&&document.body.removeChild(g),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",f);const m=((v=t.current)==null?void 0:v.getBoundingClientRect().width)||0;r(m),o()},[r]),p=h.useCallback(v=>{var g;a.current=!0,l.current=v.clientX,u.current=((g=t.current)==null?void 0:g.getBoundingClientRect().width)||0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const m=document.createElement("div");m.id="resize-overlay",m.setAttribute("data-resize-overlay",""),document.body.appendChild(m),document.addEventListener("mousemove",d),document.addEventListener("mouseup",f),v.preventDefault()},[e,d,f]);return c.jsx("div",{ref:i,className:l2({[e]:!0}),onMouseDown:p})};P();var u2={Sidebar:"_Sidebar_o396p_1","Sidebar--isVisible":"_Sidebar--isVisible_o396p_9","Sidebar--left":"_Sidebar--left_o396p_13","Sidebar--right":"_Sidebar--right_o396p_25","Sidebar-resizeHandle":"_Sidebar-resizeHandle_o396p_37"},Ou=ne("Sidebar",u2),Mu=({position:e,sidebarRef:t,isVisible:n,onResize:r,onResizeEnd:s,children:o})=>c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:t,className:Ou({[e]:!0,isVisible:n}),children:o}),c.jsx("div",{className:`${Ou("resizeHandle")}`,children:c.jsx(c2,{position:e,sidebarRef:t,onResize:r,onResizeEnd:s})})]});P();var d2=e=>{let t=e;for(;t&&t!==document.body;){const n=window.getComputedStyle(t);if(n.display==="none"||n.visibility==="hidden"||n.opacity==="0"||t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden"))return!1;t=t.parentElement}return!0},f2=e=>{var t;if(e!=null&&e.defaultPrevented)return!0;const n=((t=e==null?void 0:e.composedPath)==null?void 0:t.call(e)[0])||(e==null?void 0:e.target)||document.activeElement;if(n instanceof HTMLElement){const s=n.tagName.toLowerCase();if(s==="input"||s==="textarea"||s==="select"||n.isContentEditable)return!0;const o=n.getAttribute("role");if(o==="textbox"||o==="combobox"||o==="searchbox"||o==="listbox"||o==="grid")return!0}const r=document.querySelector('dialog[open], [aria-modal="true"], [role="dialog"], [role="alertdialog"]');return!!(r&&d2(r))},p2=()=>{const e=Ae(),t=h.useCallback(n=>{var r;if(f2(n))return!1;const{state:s,dispatch:o,permissions:i,selectedItem:a}=e.getState(),l=(r=s.ui)==null?void 0:r.itemSelector;return!(l!=null&&l.zone)||!a||!i.getPermissions({item:a}).delete||o({type:"remove",index:l.index,zone:l.zone}),!0},[e]);zt({delete:!0},t),zt({backspace:!0},t)};P();P();var hg={Nav:"_Nav_1tvxq_1","Nav-list":"_Nav-list_1tvxq_5","Nav-mobileActions":"_Nav-mobileActions_1tvxq_23","NavItem-link":"_NavItem-link_1tvxq_38",NavItem:"_NavItem_1tvxq_38","NavItem-linkIcon":"_NavItem-linkIcon_1tvxq_89","NavItem--active":"_NavItem--active_1tvxq_94","NavItem--mobileOnly":"_NavItem--mobileOnly_1tvxq_121","NavItem--desktopOnly":"_NavItem--desktopOnly_1tvxq_126"},Ei=ne("Nav",hg),Ys=ne("NavItem",hg),h2=({label:e,icon:t,onClick:n,isActive:r,mobileOnly:s,desktopOnly:o})=>c.jsx("li",{className:Ys({active:r,mobileOnly:s,desktopOnly:o}),children:n&&c.jsxs("div",{className:Ys("link"),onClick:n,children:[t&&c.jsx("span",{className:Ys("linkIcon"),children:t}),c.jsx("span",{className:Ys("linkLabel"),children:e})]})}),g2=({items:e,mobileActions:t})=>c.jsxs("nav",{className:Ei(),children:[c.jsx("ul",{className:Ei("list"),children:Object.entries(e).map(([n,r])=>c.jsx(h2,A({},r),n))}),t&&c.jsx("div",{className:Ei("mobileActions"),children:t})]}),Du=ne("Puck",Wl),Gs=ne("PuckLayout",Wl),Tu=ne("PuckPluginTab",Wl),v2=()=>{const e=V(t=>{var n,r,s;return t.selectedItem?(r=(n=t.config.components[t.selectedItem.type])==null?void 0:n.label)!=null?r:t.selectedItem.type.toString():((s=t.config.root)==null?void 0:s.label)||"Page"});return c.jsx(n2,{noBorderTop:!0,showBreadcrumbs:!0,title:e,children:c.jsx(Hl,{})})},m2=({children:e,visible:t,mobileOnly:n})=>c.jsx("div",{className:Tu({visible:t,mobileOnly:n}),children:c.jsx("div",{className:Tu("body"),children:e})}),gg=({children:e})=>{const{iframe:t,dnd:n,initialHistory:r,plugins:s,height:o}=Xo(),i=h.useMemo(()=>A({enabled:!0,waitForStyles:!0},t),[t]);YS(i.enabled);const a=V($=>$.dispatch),l=V($=>$.state.ui.leftSideBarVisible),u=V($=>$.state.ui.rightSideBarVisible),d=V($=>$.instanceId),{width:f,setWidth:p,sidebarRef:v,handleResizeEnd:g}=Au("left",a),{width:m,setWidth:w,sidebarRef:S,handleResizeEnd:k}=Au("right",a);h.useEffect(()=>{window.matchMedia("(min-width: 638px)").matches||a({type:"setUi",ui:{leftSideBarVisible:!1,rightSideBarVisible:!1}});const $=()=>{window.matchMedia("(min-width: 638px)").matches||a({type:"setUi",ui:Z=>A(A({},Z),Z.rightSideBarVisible?{leftSideBarVisible:!1}:{})})};return window.addEventListener("resize",$),()=>{window.removeEventListener("resize",$)}},[]);const y=V($=>$.overrides),b=h.useMemo(()=>y.puck||_a,[y]),[C,j]=h.useState(!1);h.useEffect(()=>{j(!0)},[]);const O=V($=>$.status==="READY");Ly(),h.useEffect(()=>{if(O&&i.enabled){const $=jn();if($)return Id($)}},[O,i.enabled]),GS(),p2();const _={};f&&(_["--puck-user-left-side-bar-width"]=`${f}px`),m&&(_["--puck-user-right-side-bar-width"]=`${m}px`);const I=V($=>$.setUi),x=V($=>{var Z;return(Z=$.state.ui.plugin)==null?void 0:Z.current}),M=Ae(),[D,L]=h.useState("toggle"),N=h.useMemo(()=>!!(s!=null&&s.find($=>$.name==="legacy-side-bar")),[s]),B=h.useMemo(()=>{const $={},Z=[Jh(),ig()],F=Q=>Q.name==="legacy-side-bar"?-1:0,X=[...Z,...s??[]].sort((Q,de)=>F(Q)-F(de));return s!=null&&s.some(Q=>Q.name==="fields")||X.push(lg()),X==null||X.forEach(Q=>{var de,ve;Q.name&&Q.render&&($[Q.name]&&delete $[Q.name],$[Q.name]={label:(de=Q.label)!=null?de:Q.name,icon:(ve=Q.icon)!=null?ve:c.jsx(Ay,{}),onClick:()=>{var re;L((re=Q.mobilePanelHeight)!=null?re:"toggle"),Q.name===x?I(l?{leftSideBarVisible:!1}:{leftSideBarVisible:!0}):Q.name&&I({plugin:{current:Q.name},leftSideBarVisible:!0})},isActive:l&&x===Q.name,render:Q.render,mobileOnly:N||Q.mobileOnly,desktopOnly:Q.name==="legacy-side-bar"||Q.desktopOnly})}),$},[s,x,M,l]);h.useEffect(()=>{if(!x){const $=Object.keys(B);I({plugin:{current:$[0]}})}},[B,x]);const H=B.fields&&B.fields.mobileOnly===!1,G=V($=>{var Z;return(Z=$.state.ui.mobilePanelExpanded)!=null?Z:!1});return c.jsxs("div",{className:`Puck ${Du({hidePlugins:N})}`,id:d,style:{height:o},children:[c.jsx(Pw,{disableAutoScroll:n==null?void 0:n.disableAutoScroll,children:c.jsx(b,{children:e||c.jsx(o2,{children:c.jsx("div",{className:Gs({leftSideBarVisible:l,mounted:C,rightSideBarVisible:!H&&u,isExpanded:G,mobilePanelHeightToggle:D==="toggle",mobilePanelHeightMinContent:D==="min-content"}),style:{height:o},children:c.jsxs("div",{className:Gs("inner"),style:_,children:[c.jsx("div",{className:Gs("header"),children:c.jsx(e2,{hidePlugins:N})}),c.jsx("div",{className:Gs("nav"),children:c.jsx(g2,{items:B,mobileActions:l&&D==="toggle"&&c.jsx(jt,{type:"button",title:"maximize",onClick:()=>{I({mobilePanelExpanded:!G})},children:G?c.jsx(vy,{size:21}):c.jsx(gy,{size:21})})})}),c.jsx(Mu,{position:"left",sidebarRef:v,isVisible:l,onResize:p,onResizeEnd:g,children:Object.entries(B).map(([$,{mobileOnly:Z,render:F,label:X}])=>c.jsx(m2,{visible:x===$,mobileOnly:Z,children:c.jsx(F,{})},$))}),c.jsx(i2,{}),!H&&c.jsx(Mu,{position:"right",sidebarRef:S,isVisible:u,onResize:w,onResizeEnd:k,children:c.jsx(v2,{})})]})})})})}),c.jsx("div",{id:"puck-portal-root",className:Du("portal")})]})},vg=h.createContext({});function y2(e){return c.jsx(vg.Provider,{value:e,children:e.children})}var Xo=()=>h.useContext(vg);function b2({children:e}){const{config:t,data:n,ui:r,onChange:s,permissions:o={},plugins:i,overrides:a,viewports:l=ss,iframe:u,initialHistory:d,metadata:f,onAction:p,fieldTransforms:v,_experimentalFullScreenCanvas:g,_experimentalVirtualization:m}=Xo(),w=h.useMemo(()=>A({enabled:!0,waitForStyles:!0},u),[u]),[S]=h.useState(()=>{var L,N,B;const H=A(A({},Oi.ui),r);let G={};Object.keys((n==null?void 0:n.root)||{}).length>0&&!((L=n==null?void 0:n.root)!=null&&L.props)&&console.warn("Warning: Defining props on `root` is deprecated. Please use `root.props`, or republish this page to migrate automatically.");const $=((N=n==null?void 0:n.root)==null?void 0:N.props)||(n==null?void 0:n.root)||{},Z=A(A({},(B=t.root)==null?void 0:B.defaultProps),$),F=Aa(bs(z(A({},n==null?void 0:n.root),{props:Z})),t),X=z(A({},Oi),{data:z(A({},n),{root:z(A({},n==null?void 0:n.root),{props:F.props}),content:n.content||[]}),ui:z(A(A({},H),G),{componentList:t.categories?Object.entries(t.categories).reduce((Q,[de,ve])=>z(A({},Q),{[de]:{title:ve.title,components:ve.components,expanded:ve.defaultExpanded,visible:ve.visible}}),{}):{}})});return ht(X,t)}),{appendData:k=!0}=d||{},[y]=h.useState([...(d==null?void 0:d.histories)||[],...k?[{state:S}]:[]].map(L=>{let N=A(A({},S),L.state);return L.state.indexes||(N=ht(N,t)),z(A({},L),{state:N})})),b=h.useMemo(()=>(d==null?void 0:d.index)!==void 0&&(d==null?void 0:d.index)>=0&&(d==null?void 0:d.index)<y.length?d==null?void 0:d.index:y.length-1,[]),C=y[b].state,j=US({overrides:a,plugins:i}),O=h.useMemo(()=>{const N=(i||[]).reduce((B,H)=>A(A({},B),H.fieldTransforms),{});return A(A({},N),v)},[v,i]),_=Ko(),I=h.useCallback(L=>({instanceId:_,state:L,config:t,plugins:i||[],overrides:j,viewports:l,iframe:w,_experimentalFullScreenCanvas:!!g,_experimentalVirtualization:!!m,onAction:p,metadata:f,fieldTransforms:O}),[_,C,t,i,j,l,w,g,m,p,f,O]),[x]=h.useState(()=>Ed(I(C)));h.useEffect(()=>{},[x]),h.useEffect(()=>{const L=x.getState().state;x.setState(A({},I(L)))},[I]),$y(x,{histories:y,index:b,initialAppState:C});const M=h.useRef(null);h.useEffect(()=>x.subscribe(L=>L.state.data,L=>{if(s){if(rs(L,M.current))return;s(L),M.current=L}}),[s]),Hy(x,o);const D=iS(x);return h.useEffect(()=>{const{resolveAndCommitData:L}=x.getState();setTimeout(()=>{L()},0)},[]),c.jsx(Da.Provider,{value:x,children:c.jsx(Bl.Provider,{value:D,children:e})})}function wr(e){return c.jsx(y2,z(A({},e),{children:c.jsx(b2,z(A({},e),{children:c.jsx(gg,{children:e.children})}))}))}wr.Components=Xh;wr.Fields=Hl;wr.Layout=gg;wr.Outline=og;wr.Preview=ug;P();P();P();P();P();P();P();P();P();P();P();P();P();P();const _2="dev",mg="/",x2=`
161
+ html, body {
162
+ margin: 0 !important;
163
+ padding: 0 !important;
164
+ height: 100% !important;
165
+ min-height: 100% !important;
166
+ overflow: hidden !important;
167
+ }
168
+ #frame-root,
169
+ [data-puck-entry],
170
+ body > div:first-child {
171
+ height: 100% !important;
172
+ min-height: 100% !important;
173
+ overflow-y: auto !important;
174
+ overflow-x: hidden !important;
175
+ overscroll-behavior: contain !important;
176
+ -webkit-overflow-scrolling: touch !important;
177
+ }
178
+ /* Default theme — blocks CSS uses these variables but the editor doesn't define them.
179
+ In the real site, globals.css provides these. In Puck's iframe, we inject defaults. */
180
+ :root {
181
+ --bg-0: #ffffff;
182
+ --bg-100: #f8f9fa;
183
+ --bg-1: #ffffff;
184
+ --section-bg: var(--bg-100);
185
+ --text-100: #1a1a2e;
186
+ --text-200: #4a4a6a;
187
+ --text-300: #52525b;
188
+ --heading: #1a1a2e;
189
+ --body: #333355;
190
+ --body-secondary: #6b7280;
191
+ --caption: #64748b;
192
+ --brand: #24613b;
193
+ --brand-hover: #1b4d2e;
194
+ --brand-subtle: #d4edda;
195
+ --brand-fg: #ffffff;
196
+ --surface: #ffffff;
197
+ --surface-border: #e5e7eb;
198
+ --border: #e5e7eb;
199
+ --card-bg: #f8fafc;
200
+ --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
201
+ --hero-bg: var(--bg-0);
202
+ --cta-bg: var(--bg-100);
203
+ --placeholder-img: #e2e8f0;
204
+ --footer-bg: #1a1a2e;
205
+ --footer-text: #cbd5e1;
206
+ --footer-heading: #f1f5f9;
207
+ --footer-link: #94a3b8;
208
+ --footer-link-hover: #e2e8f0;
209
+ --footer-border: #2d2d4a;
210
+ --font-body: system-ui, -apple-system, sans-serif;
211
+ --font-heading: system-ui, -apple-system, sans-serif;
212
+ --radius-btn: 6px;
213
+ --radius-card: 8px;
214
+ --radius-feature: 8px;
215
+ }
216
+ `;function w2(e){return e?e.replace(/\r\n?/g,`
217
+ `).split(/\n\s*\n+/).map(t=>t.trim()).filter(Boolean).map(t=>{const n=/^(#{1,6})\s+(.+)$/.exec(t);if(n){const a=n[1].length;return`<h${a}>${Ks(n[2].trim())}</h${a}>`}const r=t.split(`
218
+ `).map(a=>a.trim()).filter(Boolean),s=a=>typeof a=="string"&&a.length>0,o=r.map(a=>{var l;return(l=/^\s*[-*+•]\s+(.+)$/.exec(a))==null?void 0:l[1]}).filter(s);if(o.length===r.length&&o.length>0)return`<ul>${o.map(a=>`<li>${Ks(a)}</li>`).join("")}</ul>`;const i=r.map(a=>{var l;return(l=/^\s*\d+[.)]\s+(.+)$/.exec(a))==null?void 0:l[1]}).filter(s);return i.length===r.length&&i.length>0?`<ol>${i.map(a=>`<li>${Ks(a)}</li>`).join("")}</ol>`:`<p>${Ks(t.replace(/\n/g," "))}</p>`}).join(""):""}function Ks(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2">$1</a>')}function S2(e){return e?e.replace(/<h([1-6])[^>]*>(.*?)<\/h\1>/gi,(t,n,r)=>`${"#".repeat(Number(n))} ${Ci(r)}
219
+
220
+ `).replace(/<ul[^>]*>(.*?)<\/ul>/gis,(t,n)=>[...n.matchAll(/<li[^>]*>(.*?)<\/li>/gis)].map(s=>`- ${Ci(s[1])}`).join(`
221
+ `)+`
222
+
223
+ `).replace(/<ol[^>]*>(.*?)<\/ol>/gis,(t,n)=>[...n.matchAll(/<li[^>]*>(.*?)<\/li>/gis)].map((s,o)=>`${o+1}. ${Ci(s[1])}`).join(`
224
+ `)+`
225
+
226
+ `).replace(/<p[^>]*>(.*?)<\/p>/gis,(t,n)=>`${yg(n)}
227
+
228
+ `).replace(/<br\s*\/?>/gi,`
229
+ `).replace(/\n{3,}/g,`
230
+
231
+ `).trim():""}function Ci(e){return yg(e).replace(/<[^>]+>/g,"")}function yg(e){return e.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**").replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**").replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*").replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi,"[$2]($1)")}function Ru(e,t){var n;return e.kind==="number"?{type:"number",label:e.label}:e.kind==="enum"?{type:"select",label:e.label,options:e.options??[]}:e.kind==="headingLevel"?{type:"select",label:e.label,options:["h1","h2","h3","h4","h5","h6"]}:e.kind==="richtext"?{type:"richtext",label:e.label,contentEditable:!1}:e.kind==="image"?((n=t==null?void 0:t.mapImageField)==null?void 0:n.call(t,e))??{type:"text",label:e.label}:{type:"text",label:e.label}}function k2(e,t,n){var i,a,l,u;const r=$g(e.propsSchema),s={},o=new Set;for(const[d,f]of Object.entries(r.fields)){const v=(t==null?void 0:t.fields[d])??f;s[d]=Ru(v,n),v.kind==="richtext"&&o.add(d)}for(const[d,f]of Object.entries(r.listFields)){const p={};for(const[v,g]of Object.entries(f.itemFields)){const m=(a=(i=t==null?void 0:t.listFields)==null?void 0:i[d])==null?void 0:a.itemFields[v];p[v]=Ru(m??g,n)}s[d]={type:"array",label:((u=(l=t==null?void 0:t.listFields)==null?void 0:l[d])==null?void 0:u.label)??f.label??d,arrayFields:p,getItemSummary:(v,g)=>{const m=typeof v.title=="string"?v.title.trim():"";return m.length>0?m:`Item ${g+1}`}}}return{fields:s,richtextKeys:o}}const bg=new Map;function I2(e,t){t.size>0&&bg.set(e,t)}function _g(e,t,n){const r=bg.get(e);if(!r)return t;const s={...t};for(const o of r)typeof s[o]=="string"&&(s[o]=n(s[o]));return s}function E2(e,t){return _g(e,t,S2)}function xg(e){const t=e.blocks.map(n=>({type:n.type,props:{id:n.id,..._g(n.type,n.props,w2),_blockId:n.id}}));return{root:{},content:t}}function Mo(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function En(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function wg(e){const t="Block",n=En(e);return n&&n.replace(/[^A-Za-z0-9_-]+/g,"")||t}function C2(e){const t=Math.random().toString(36).slice(2,8);return`b_${e.toLowerCase()}_${Date.now().toString(36)}_${t}`}function j2(e,t){const{id:n,_blockId:r,...s}=e;return E2(t,s)}function Do(e){return e==null?String(e):typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Do).join(",")}]`:`{${Object.entries(e).sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>`${JSON.stringify(n)}:${Do(r)}`).join(",")}}`}function Lu(e){return e.content.map(t=>{const n=Mo(t),r=Mo(n.props),s=En(r.id)??En(r._blockId),o=wg(n.type);return s?{id:s,type:o,props:j2(r,o)}:null}).filter(t=>!!t)}function Nu(e){let t=!1;const n=e.content.map(r=>{const s=Mo(r),o=r&&typeof r=="object"?r:{},i=wg(s.type),a=Mo(s.props),l=En(a.id)??En(a._blockId);if(l&&En(a.id)&&En(a._blockId))return r;t=!0;const u=l??C2(i),d={...a,id:u,_blockId:u};return{...o,type:i,props:d}});return t?{...e,content:n}:e}function P2(e,t,n){const r=Lu(t),s=Lu(n),o=new Map(r.map(p=>[p.id,p])),i=new Map(s.map(p=>[p.id,p])),a=new Set;for(const[p,v]of o){const g=i.get(p);g&&g.type!==v.type&&a.add(p)}const l=[];for(const p of r)(!i.has(p.id)||a.has(p.id))&&l.push({op:"remove_block",pageSlug:e,blockId:p.id});for(let p=0;p<s.length;p+=1){const v=s[p];if(o.has(v.id)&&!a.has(v.id))continue;const g=p>0?s[p-1]:void 0,m={id:v.id,type:v.type,props:v.props};g!=null&&g.id?l.push({op:"add_block",pageSlug:e,afterBlockId:g.id,block:m}):l.push({op:"add_block",pageSlug:e,block:m})}for(const p of s){if(a.has(p.id))continue;const v=o.get(p.id);v&&Do(v.props)!==Do(p.props)&&l.push({op:"update_props",pageSlug:e,blockId:p.id,patch:p.props})}const u=r.filter(p=>i.has(p.id)&&!a.has(p.id)).map(p=>p.id),d=s.filter(p=>o.has(p.id)&&!a.has(p.id)).map(p=>p.id),f=[...u];for(let p=0;p<d.length;p+=1){const v=d[p],g=f.indexOf(v);if(g<0||g===p)continue;const m=p>0?d[p-1]:void 0;m?l.push({op:"move_block",pageSlug:e,blockId:v,afterBlockId:m}):l.push({op:"move_block",pageSlug:e,blockId:v}),f.splice(g,1),f.splice(p,0,v)}return l}function A2(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))}function O2(e){return e?e.replace(/\[(\d+)\]/g,".$1").split(".").map(n=>n.trim()).filter(Boolean).map(n=>/^\d+$/.test(n)?Number(n):n):[]}function M2(e,t,n){const r=O2(t);if(r.length===0)return!1;let s=e;for(let a=0;a<r.length-1;a+=1){const l=r[a],u=r[a+1];if(typeof l=="number"){if(!Array.isArray(s))return!1;const p=s;(p[l]===void 0||p[l]===null||typeof p[l]!="object")&&(p[l]=typeof u=="number"?[]:{}),s=p[l];continue}if(!s||typeof s!="object")return!1;const d=s,f=d[l];(f==null||typeof f!="object")&&(d[l]=typeof u=="number"?[]:{}),s=d[l]}const o=r[r.length-1];if(typeof o=="number"){if(!Array.isArray(s))return!1;const a=s;return Object.is(a[o],n)?!1:(a[o]=n,!0)}if(!s||typeof s!="object")return!1;const i=s;return Object.is(i[o],n)?!1:(i[o]=n,!0)}function D2(e,t){return e.content.findIndex(n=>{const r=n.props;if(!r||typeof r!="object")return!1;const s=r;return s.id===t||s._blockId===t})}function T2(e,t,n){const r=D2(e,t);if(r<0)return e;const s=e.content[r];if(!s.props||typeof s.props!="object")return e;const o=A2(s.props);let i=!1;for(const[l,u]of Object.entries(n)){if(!l)continue;M2(o,l,u)&&(i=!0)}if(!i)return e;const a=[...e.content];return a[r]={...s,props:o},{...e,content:a}}let xa=null;function R2(e){xa=e}function Dt(){if(!xa)throw new Error("Puck host API is not configured");return xa}function L2(e){return e?/^(https?:\/\/|data:|blob:)/i.test(e)?e:e.startsWith("/")?`${Dt().siteOrigin}${e}`:e:""}function N2({value:e,readOnly:t,onChoose:n,onClear:r}){const s=e.trim().length>0,o=s?L2(e):"";return c.jsxs("div",{className:"puck-poc-image-field",children:[c.jsx("div",{className:"puck-poc-image-field__preview",children:s?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:o,alt:""}),c.jsx("span",{children:e})]}):c.jsx("span",{className:"puck-poc-image-field__placeholder",children:"No image selected"})}),c.jsxs("div",{className:"puck-poc-image-field__actions",children:[c.jsx("button",{type:"button",onClick:n,disabled:t,children:s?"Replace image":"Choose image"}),s?c.jsx("button",{type:"button",onClick:r,disabled:t,children:"Remove"}):null]})]})}function z2(e,t){const n=Hg();return{components:Object.fromEntries(e.blocks.map(s=>{const{fields:o,richtextKeys:i}=k2(s,n[s.type],{mapImageField:a=>({type:"custom",label:a.label,render:({value:l,onChange:u,readOnly:d})=>c.jsx(N2,{value:typeof l=="string"?l:"",readOnly:!!d,onChoose:()=>{d||t==null||t({currentUrl:typeof l=="string"?l:void 0,onSelect:f=>u(f)})},onClear:()=>{d||u("")}})})});return I2(s.type,i),[s.type,{fields:o,defaultProps:s.defaultProps,permissions:{drag:!0,delete:!0,duplicate:!0,edit:!0,insert:!0},render:a=>{const l=typeof a._blockId=="string"&&a._blockId.trim().length>0?a._blockId:`puck-${s.type}`,{_blockId:u,id:d,...f}=a;return Fg(s.type)?c.jsx(Bg,{block:{id:l,type:s.type,props:f}}):c.jsxs("section",{style:{padding:"16px",border:"1px dashed #9ca3af",borderRadius:8},children:[c.jsx("strong",{children:s.type}),c.jsx("p",{style:{margin:"8px 0 0",fontSize:13},children:"No renderer is registered for this block in the editor runtime."})]})}}]}))}}const Sg=h.createContext(null);function $2({value:e,children:t}){return c.jsx(Sg.Provider,{value:e,children:t})}function F2(){return h.useContext(Sg)}function Qr(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function zu(e){if(!e||typeof e!="object")return;const t=e;return Qr(t.id)??Qr(t._blockId)}function $u(e){var l,u;if(!((l=e==null?void 0:e.appState)!=null&&l.ui)||!((u=e.appState)!=null&&u.data))return;const t=e.selectedItem,n={activeBlockId:zu(t==null?void 0:t.props),activeBlockType:Qr(t==null?void 0:t.type)},r=e.appState.ui.itemSelector,s=(()=>{var p;if(!r)return;const d=r.zone?(p=e.appState.data.zones)==null?void 0:p[r.zone]:e.appState.data.content,f=d==null?void 0:d[r.index];if(f)return{activeBlockId:zu(f.props),activeBlockType:Qr(f.type)}})(),o=n.activeBlockId??(s==null?void 0:s.activeBlockId),i=n.activeBlockType??(s==null?void 0:s.activeBlockType),a=Qr(e.appState.ui.field.focus);if(!(!o&&!i&&!a))return{activeBlockId:o,activeBlockType:i,activeEditablePath:a}}const B2=aS();function H2(){const e=F2();return e?c.jsx(V2,{...e}):null}function V2({session:e,siteId:t,isBusy:n,error:r,chatEntries:s,streamStatus:o,streamingText:i,streamSteps:a,streamingChanges:l,undoInFlightEntryId:u,onSendPrompt:d,onCancelPrompt:f,onClickSuggestion:p,onUndo:v,onSelectionChange:g}){const m=Dt(),w=m.useMediaInput(),S=m.ChatComposerCore,[k,y]=h.useState(""),b=h.useRef(null),C=h.useRef(!0),j=h.useRef(!1),O=Gh(),_=B2(F=>JSON.stringify($u(F)??null)),I=h.useMemo(()=>{try{return JSON.parse(_)??void 0}catch{return}},[_]),x=h.useMemo(()=>Array.isArray(s)?s.filter(F=>!!(F&&typeof F=="object")):[],[s]),[M,D]=h.useState([]);h.useEffect(()=>{if(typeof window>"u")return;const F=`editor-chat-log-v1:${e}:${t}`;let X=null;const Q=()=>{try{const re=window.localStorage.getItem(F);if(re===X)return;if(X=re,!re){D([]);return}const Je=JSON.parse(re);if(!Array.isArray(Je)){D([]);return}D(Je.filter(te=>!!(te&&typeof te=="object")))}catch{D([])}},de=re=>{re.key&&re.key!==F||Q()};Q(),window.addEventListener("storage",de);const ve=window.setInterval(Q,700);return()=>{window.removeEventListener("storage",de),window.clearInterval(ve)}},[e,t]);const L=x.length>0?x:M,N=L.some(F=>F.role==="user"),B=L.length>0||!!i||!!o,H=h.useMemo(()=>a.filter(F=>F.done),[a]),G=h.useCallback(()=>{const F=b.current;F&&(F.scrollTop=F.scrollHeight)},[]),$=h.useCallback(()=>{const F=b.current;if(!F)return;const X=F.scrollHeight-F.scrollTop-F.clientHeight;C.current=X<64},[]),Z=h.useCallback(F=>{const X=(F??k).trim();if(!X)return;const Q=$u(O());g(Q),y(""),C.current=!0,G(),d(X)},[k,O,g,d,G]);return h.useEffect(()=>{g(I)},[I==null?void 0:I.activeBlockId,I==null?void 0:I.activeBlockType,I==null?void 0:I.activeEditablePath,g]),h.useEffect(()=>{if(!B||!!j.current&&!C.current)return;const X=window.requestAnimationFrame(()=>{G(),j.current=!0});return()=>{window.cancelAnimationFrame(X)}},[B,L.length,i,o,a.length,l.length,G]),c.jsxs("div",{className:"puck-poc-chat puck-poc-chat--plugin",children:[c.jsx("div",{className:"puck-poc-chat__header",children:c.jsx("h1",{children:"AI Page Builder"})}),c.jsxs("div",{className:"puck-poc-chat__surface",children:[c.jsxs("div",{ref:b,className:"puck-poc-chat__thread-core",onScroll:$,children:[L.length===0&&!i&&!o?c.jsx("article",{className:"chat-thread-empty",children:"Start chatting to see responses here."}):null,L.map(F=>{const X=typeof F.text=="string"&&F.text.trim().length>0?F.text:"…",Q=F.role==="user"?"user":"assistant",de=Array.isArray(F.suggestions)?F.suggestions.filter(ve=>typeof ve=="string"&&ve.trim().length>0):[];return c.jsxs("article",{className:`puck-poc-msg puck-poc-msg--${Q}`,children:[c.jsx("div",{className:"puck-poc-msg__main",children:(()=>{if(F.role!=="assistant")return X;try{return m.renderFinalMarkdown(X)}catch{return X}})()}),de.length>0?c.jsx("div",{className:"msg-suggestions",children:de.map((ve,re)=>c.jsx("button",{type:"button",className:"msg-suggestion",onClick:()=>void p(ve),disabled:n,children:ve},`${F.id}-${re}`))}):null,F.canUndo||F.wasUndone?c.jsx("div",{className:"msg-undo-row",children:c.jsx("button",{type:"button",className:"msg-undo-btn",onClick:()=>void v(F.id),disabled:!F.canUndo||n||u!==null,children:F.wasUndone?"Undone":"Undo"})}):null]},F.id)}),i?c.jsxs("article",{className:"puck-poc-msg puck-poc-msg--assistant",children:[H.length>0?c.jsx("ul",{className:"stream-steps stream-steps-in-bubble",children:H.map((F,X)=>c.jsx("li",{className:"stream-step is-done",children:F.label},X))}):null,c.jsx("div",{className:"puck-poc-msg__main",children:m.renderSimpleMarkdown(i)}),l.length>0?c.jsxs("ul",{className:"msg-list",children:[l.slice(0,8).map((F,X)=>c.jsx("li",{children:F},X)),l.length>8?c.jsxs("li",{className:"msg-list-overflow",children:["and ",l.length-8," more…"]}):null]}):null]}):o?c.jsxs("article",{className:"puck-poc-msg puck-poc-msg--assistant",children:[H.length>0?c.jsx("ul",{className:"stream-steps stream-steps-in-bubble",children:H.map((F,X)=>c.jsx("li",{className:"stream-step is-done",children:F.label},X))}):null,c.jsx("div",{className:"puck-poc-msg__main",children:o})]}):null]}),c.jsx(S,{message:k,isLoading:n,hasUserEntry:N,onMessageChange:y,onSubmit:Z,onTranscribeAudio:w.transcribeAudio,onInterpretImage:w.interpretPastedImage,onUploadImage:w.uploadPastedImage,onCancel:f,onAutoHeightChange:()=>{},className:"composer puck-poc-chat__composer-core"})]}),r?c.jsx("p",{className:"puck-poc-chat__error",children:r}):null]})}function W2({dispatchRef:e}){const t=Gh();return h.useEffect(()=>(e.current=n=>t().dispatch(n),()=>{e.current=null}),[e,t]),null}function U2({document:e,children:t}){return h.useEffect(()=>{if(!e)return;const n=()=>{const s=e.documentElement,o=e.body,i=e.getElementById("frame-root")??e.querySelector("[data-puck-entry]");s.style.setProperty("margin","0","important"),s.style.setProperty("padding","0","important"),s.style.setProperty("height","100%","important"),s.style.setProperty("min-height","100%","important"),s.style.setProperty("overflow","hidden","important"),o&&(o.style.setProperty("margin","0","important"),o.style.setProperty("padding","0","important"),o.style.setProperty("height","100%","important"),o.style.setProperty("min-height","100%","important"),o.style.setProperty("overflow","hidden","important")),i&&(i.style.setProperty("height","100%","important"),i.style.setProperty("min-height","100%","important"),i.style.setProperty("overflow-y","auto","important"),i.style.setProperty("overflow-x","hidden","important"),i.style.setProperty("overscroll-behavior","contain","important"),i.style.setProperty("-webkit-overflow-scrolling","touch","important"))};n();const r=new MutationObserver(()=>n());return r.observe(e.documentElement,{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:x2}),t]})}function q2(){const e=Dt();if(typeof window>"u")return e.LEGACY_AVOCADO_SITE_ID;const t=e.sanitizeSiteId(new URLSearchParams(window.location.search).get("siteId")??"");return t||e.sanitizeSiteId(e.resolveEditorSiteId())||e.LEGACY_AVOCADO_SITE_ID}async function Jo(e,t){const n=await fetch(e,t);if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(`${n.status} ${n.statusText}${r?`: ${r}`:""}`)}return await n.json()}async function Z2(e){const t=Dt(),n=await Jo(`${t.siteOrigin}/api/editor/pages?siteId=${encodeURIComponent(e)}`);return Array.isArray(n.pages)?n.pages:[]}async function Y2(e,t,n){const r=Dt();await fetch(`${r.orchestrator}/draft/bootstrap`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,overwrite:!1,...n.length>0?{pages:n}:{}})}).catch(()=>{})}function G2(){const e=Dt();return Jo(`${e.siteOrigin}/api/editor/blocks`)}async function kg(e,t){const n=Dt(),r=await Jo(`${n.orchestrator}/draft/slugs?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}`);return Array.isArray(r.slugs)&&r.slugs.length>0?r.slugs:["/"]}function Ig(e,t,n){const r=Dt();return Jo(`${r.orchestrator}/draft/pages?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}&slug=${encodeURIComponent(n)}`)}async function K2(e,t,n){const r=Dt();if(n.length===0)return!0;const s=await fetch(`${r.orchestrator}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,ops:n})}),o=await s.json().catch(()=>({}));return s.ok&&(o==null?void 0:o.status)==="applied"}async function X2(){const e=Dt(),t=[`${e.orchestrator}/status/planner`];e.orchestrator.includes("localhost")&&t.push(`${e.orchestrator.replace("localhost","127.0.0.1")}/status/planner`);for(const n of t)try{const r=await fetch(n);if(!r.ok)continue;const s=await r.json();return s.features?s.features:null}catch{}return null}function J2({session:e,siteId:t,slug:n,setSlug:r}){const[s,o]=h.useState(null),[i,a]=h.useState(null),[l,u]=h.useState(0),[d,f]=h.useState([mg]),[p,v]=h.useState(!1),[g,m]=h.useState(!1),[w,S]=h.useState(null),k=h.useRef(0),y=h.useCallback(async()=>{let _=[];try{_=await Z2(t)}catch{}await Y2(e,t,_)},[e,t]),b=h.useRef(n);b.current=n;const C=h.useCallback(async()=>{const[_,I]=await Promise.all([G2(),kg(e,t)]);o(_),f(I),I.includes(b.current)||r(I[0])},[e,t,r]),j=h.useCallback(async _=>{const I=++k.current,x=await Ig(e,t,_);I===k.current&&(a(xg(x)),u(M=>M+1))},[e,t]),O=h.useRef(!1);return h.useEffect(()=>{let _=!1;return(async()=>{S(null),m(!0);try{if(await y(),_||(await C(),_))return;await j(b.current),O.current=!0}catch(x){if(_)return;S(x instanceof Error?x.message:"Failed to load Puck prototype")}finally{_||m(!1)}})(),()=>{_=!0}},[y,C,j]),h.useEffect(()=>{O.current&&(S(null),j(n).catch(()=>{}))},[j,n]),{manifest:s,puckData:i,setPuckData:a,remotePuckVersion:l,availableSlugs:d,setAvailableSlugs:f,isLoadingSlugs:p,setIsLoadingSlugs:v,isBusy:g,error:w}}function Q2(){const[e,t]=h.useState({});return h.useEffect(()=>{let n=!0;return(async()=>{const s=await X2();!n||!s||t(o=>o.googleDrive===s.googleDrive&&o.unsplash===s.unsplash&&o.imageGenerate===s.imageGenerate&&o.imageGenerateChat===s.imageGenerateChat?o:s)})(),()=>{n=!1}},[]),e}function ek({session:e,siteId:t,slugRef:n,setSlug:r,setAvailableSlugs:s,puckDispatchRef:o,setPuckData:i,onRemoteData:a}){const l=h.useCallback(async f=>{const p=await Ig(e,t,f),v=xg(p);o.current&&o.current({type:"setData",data:v}),i(v),a==null||a(v)},[e,t,o,i,a]),u=h.useCallback((f,p)=>{if(f==="liveDraft"){const g=typeof p.blockId=="string"?p.blockId:"",m=p.fields;if(!g||!m||typeof m!="object"||Array.isArray(m))return;i(w=>{if(!w)return w;const S=T2(w,g,m);return S!==w&&o.current&&o.current({type:"setData",data:S}),S});return}if(f!=="draftUpdated")return;const v=typeof p.navigateTo=="string"&&p.navigateTo.length>0?p.navigateTo:n.current;v!==n.current&&(r(v),s(g=>g.includes(v)?g:[...g,v])),kg(e,t).then(s).catch(()=>{}),l(v).catch(()=>{})},[e,t,i,o,n,r,s,l]),d=h.useCallback((f,p,v,g)=>{l(n.current).catch(()=>{})},[n,l]);return{postToSite:u,postPatchToSite:d,syncDraftPage:l}}const tk=600;function nk({host:e}){var Be;R2(e);const t=Dt(),[n]=h.useState(_2),[r]=h.useState(()=>q2()),[s,o]=h.useState(mg),[i]=h.useState(()=>t.resolveDefaultModelKey()),[a]=h.useState(()=>t.resolveDefaultProvider()),[l]=h.useState(!0),[u,d]=h.useState(void 0),[f,p]=h.useState(void 0),[v,g]=h.useState(void 0),[m,w]=h.useState(null),S=h.useRef(null),k=h.useRef(void 0),y=h.useRef(void 0),b=h.useRef(void 0),C=h.useRef(s);C.current=s;const j=h.useRef(null),O=h.useRef(null),_=h.useRef(null),I=h.useRef(null),x=h.useRef(!1),M=t.agentModeEnabled??!1,D=h.useMemo(()=>{const se=t.loadSiteListFromStorage(r).find(Le=>Le.id===r),he=r===t.LEGACY_AVOCADO_SITE_ID?t.LEGACY_AVOCADO_SITE_NAME:t.siteNameFromId(r)||(se==null?void 0:se.name)||"Site";return se?{...se,name:he}:{id:r,name:he,purpose:"",hosting:"",vercelProjectId:"",vercelTeamId:"",vercelProductionUrl:"",vercelDeployHookUrl:"",tone:"",constraints:[]}},[r,t]);h.useEffect(()=>{typeof document>"u"||(document.body.classList.remove("panel-resizing"),document.body.style.userSelect="")},[]),h.useEffect(()=>{t.setGlobalSlug(s)},[s,t]);const L=h.useCallback(J=>{w(J)},[]),{manifest:N,puckData:B,setPuckData:H,remotePuckVersion:G,availableSlugs:$,setAvailableSlugs:Z,isLoadingSlugs:F,setIsLoadingSlugs:X,isBusy:Q,error:de}=J2({session:n,siteId:r,slug:s,setSlug:o}),ve=Q2(),re=h.useCallback(J=>{j.current=J,O.current=J},[]),{postToSite:Je,postPatchToSite:te,syncDraftPage:W}=ek({session:n,siteId:r,slugRef:C,setSlug:o,setAvailableSlugs:Z,puckDispatchRef:S,setPuckData:H,onRemoteData:re}),E=h.useMemo(()=>N?z2(N,L):null,[N,L]),T=h.useCallback(J=>{if(!N)return null;const se=N.blocks.find(he=>he.type===J);return!(se!=null&&se.defaultProps)||typeof se.defaultProps!="object"?null:se.defaultProps},[N]),R=t.useChatEngine({session:n,siteId:r,activeSiteConfig:D,slug:s,setSlug:o,modelKey:i,provider:a,useStreaming:l,activeBlockIdRef:k,activeBlockTypeRef:y,activeEditablePathRef:b,setActiveBlockId:d,setActiveBlockType:p,setActiveEditablePath:g,postToSite:Je,postPatchToSite:te,setAvailableSlugs:Z,setIsLoadingSlugs:X,routeOptions:$,componentManifest:N,allowStructuralEdits:!0,getBlockDefaultProps:T,agentModeEnabled:M}),U=t.usePublish(n,r,R.isLoading),q=h.useCallback(J=>{const se=J==null?void 0:J.activeBlockId,he=J==null?void 0:J.activeBlockType,Le=J==null?void 0:J.activeEditablePath;k.current!==se&&(k.current=se,d(se)),y.current!==he&&(y.current=he,p(he)),b.current!==Le&&(b.current=Le,g(Le)),t.setGlobalSelection(J)},[t]),K=h.useCallback(async J=>{await R.submitChat(J)},[R]),oe=h.useCallback(()=>{R.cancelChat()},[R]),me=h.useCallback(async J=>{await R.submitChat(J)},[R]),ke=h.useCallback(async J=>{await R.applyUndoHistory(J)},[R]),we=h.useCallback(async()=>{if(x.current)return;const J=_.current;if(!J)return;const se=O.current;if(_.current=null,!se){O.current=J;return}const he=P2(C.current,se,J);if(he.length===0){O.current=J;return}x.current=!0;try{await K2(n,r,he)?O.current=J:W(C.current).catch(()=>{})}catch{W(C.current).catch(()=>{})}finally{x.current=!1,_.current&&we()}},[n,r,W]),Oe=h.useCallback(J=>{_.current=J,!(typeof window>"u")&&(I.current!==null&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>{I.current=null,we()},tk))},[we]),Me=h.useCallback(J=>{!O.current&&B&&(O.current=B);const se=Nu(J);j.current=se,H(se),Oe(se)},[B,Oe,H]),Ie=h.useCallback(async J=>{!O.current&&B&&(O.current=B);const se=Nu(J);j.current=se,H(se),_.current=se,typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),await U.publishSite()},[we,B,H,U]),ye=h.useCallback(async J=>{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),J==="undo"?await R.applyGlobalUndo():await R.applyGlobalRedo()},[we,R]);h.useEffect(()=>{j.current=B??null},[B]),h.useEffect(()=>{j.current&&(O.current=j.current)},[G,s]),h.useEffect(()=>()=>{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]);const $e=Q||R.isLoading||F,gt=h.useMemo(()=>({iframe:U2,headerActions:({children:J})=>{var se;return c.jsxs(c.Fragment,{children:[c.jsx(W2,{dispatchRef:S}),c.jsxs("a",{href:"/sites",className:"puck-poc-header-btn puck-poc-header-back",title:"Back to sites","aria-label":"Back to sites",children:[c.jsx(cv,{size:16}),c.jsx("span",{children:"Sites"})]}),c.jsx("label",{className:"puck-poc-header-page-select",title:"Select page",children:c.jsx("select",{value:s,onChange:he=>o(he.target.value),disabled:$e,children:$.map(he=>c.jsx("option",{value:he,children:t.slugLabel(he)},he))})}),c.jsx("button",{type:"button",className:"puck-poc-header-btn",disabled:!R.canUndoServer||$e,onClick:()=>void ye("undo"),title:"Undo (Ctrl+Z)","aria-label":"Undo",children:c.jsx(Vg,{size:16})}),c.jsx("button",{type:"button",className:"puck-poc-header-btn",disabled:!R.canRedoServer||$e,onClick:()=>void ye("redo"),title:"Redo (Ctrl+Y)","aria-label":"Redo",children:c.jsx(Wg,{size:16})}),(se=U.publishStatus)!=null&&se.inspectUrl?c.jsx("a",{className:"puck-publish-link",href:U.publishStatus.inspectUrl,target:"_blank",rel:"noreferrer",children:"View deploy"}):null,J]})}}),[$,$e,s,U.publishStatus,R.canUndoServer,R.canRedoServer,ye]),en=h.useMemo(()=>({name:"ai-site-editor-chat",label:"AI",icon:c.jsx(dv,{size:24}),render:()=>c.jsx(H2,{})}),[]),[tn,Vt]=h.useState(!1),ae=h.useCallback(async J=>{Vt(!0);try{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),await t.restoreToVersion(n,r,C.current,J)&&await W(C.current)}finally{Vt(!1)}},[we,t,n,r,W]),_e=h.useMemo(()=>({name:"ai-site-editor-history",label:"History",icon:c.jsx(pv,{size:24}),render:()=>c.jsx(t.VersionHistoryPanel,{session:n,siteId:r,slug:s,visible:!0,onRestore:ae,isRestoring:tn})}),[t,n,r,s,ae,tn]),Re=h.useMemo(()=>[en,_e,Jh(),ig(),lg({desktopSideBar:"right"})],[en,_e]),De=h.useMemo(()=>({session:n,siteId:r,isBusy:Q||R.isLoading,error:de,chatEntries:R.chatLog,streamStatus:R.streamStatus,streamingText:R.streamingText,streamSteps:R.streamSteps,streamingChanges:R.streamingChanges,undoInFlightEntryId:R.undoInFlightEntryId,onSendPrompt:K,onCancelPrompt:oe,onClickSuggestion:me,onUndo:ke,onSelectionChange:q}),[n,r,Q,de,R.chatLog,R.isLoading,R.streamStatus,R.streamingText,R.streamSteps,R.streamingChanges,R.undoInFlightEntryId,K,oe,me,ke,q]);return!E||!B?c.jsx("div",{className:"puck-poc-loading",children:"Loading…"}):c.jsxs(c.Fragment,{children:[c.jsx($2,{value:De,children:c.jsx("div",{className:"puck-poc-root",children:c.jsx(wr,{config:E,data:B,onChange:Me,onPublish:Ie,iframe:{enabled:!1},viewports:[{width:390,height:844,icon:"Smartphone",label:"Mobile"},{width:768,height:960,icon:"Tablet",label:"Tablet"},{width:"100%",height:900,icon:"Monitor",label:"Full width"}],overrides:gt,plugins:Re},`${s}-${G}`)})}),c.jsx(t.ImagePickerModal,{open:!!m,features:{...ve,googleDrive:!!(ve.googleDrive||(Be=D==null?void 0:D.gdriveFolderId)!=null&&Be.trim())},currentUrl:m==null?void 0:m.currentUrl,gdriveFolderId:D==null?void 0:D.gdriveFolderId,cmsMedia:D==null?void 0:D.cmsMedia,siteOrigin:t.siteOrigin,onClose:()=>w(null),onSelect:J=>{m==null||m.onSelect(J),w(null)}})]})}const rk={LEGACY_AVOCADO_SITE_ID:ov,LEGACY_AVOCADO_SITE_NAME:sv,loadSiteListFromStorage:rv,resolveDefaultModelKey:nv,resolveDefaultProvider:tv,siteNameFromId:ev,siteOrigin:ql,slugLabel:Qg,resolveEditorSiteId:Jg,sanitizeSiteId:Xg,orchestrator:Ul,usePublish:(e,t,n)=>{const r=Ut(s=>s.pushAssistantFromResult);return av(e,t,n,r,ql)},useChatEngine:e=>{const t=iv(e),n=Ut(l=>l.chatLog),r=Ut(l=>l.isLoading),s=Ut(l=>l.streamStatus),o=Ut(l=>l.streamingText),i=Ut(l=>l.streamSteps),a=Ut(l=>l.streamingChanges);return{...t,chatLog:n,isLoading:r,streamStatus:s,streamingText:o,streamSteps:i,streamingChanges:a}},VersionHistoryPanel:Kg,restoreToVersion:async(e,t,n,r)=>{try{return(await(await fetch(`${Ul}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,slug:n,targetVersion:r})})).json()).status==="applied"}catch{return!1}},ImagePickerModal:Gg,ChatComposerCore:Yg,useMediaInput:Zg,renderFinalMarkdown:qg,renderSimpleMarkdown:Ug,setGlobalSelection:e=>{const t=Ut.getState();t.setActiveBlock(e==null?void 0:e.activeBlockId,e==null?void 0:e.activeBlockType),t.setActiveEditablePath(e==null?void 0:e.activeEditablePath)},setGlobalSlug:e=>{Ut.getState().setSlug(e)},agentModeEnabled:!1};function sk(){return c.jsx(nk,{host:rk})}const mk=Object.freeze(Object.defineProperty({__proto__:null,PuckPrototypeRoute:sk},Symbol.toStringTag,{value:"Module"}));export{Ma as A,$d as E,Gm as H,Mb as L,mk as P,Ta as S,z as _,V as a,A as b,zd as c,Ne as d,nb as e,rb as f,ne as g,sb as h,P as i,Lo as j,gk as o,sd as s,Ae as u};