PageSourceSearch

https://www.onefillhq.com/assets/PageEditor-Bn3fEVfp.js

js onefillhq.com collected 2026-10-02 01:38:29 UTC 304,183 bytes, 346 lines download raw bytes

1import{w as Io,j as f,r as S,cT as Vt,c5 as qs,cn as Hf,cS as Uf,cR as Vf,cs as ci,cU as Zf}from"./index-1tf5voIN.js";import{c as Gr}from"./_commonjs-dynamic-modules-TDtrdbi3.js";import{S as Yf,j as qf,k as Xf,c as It,a as Kf,s as vn,m as Gf,n as Jf,o as Qf,h as di,v as Fa,q as ep,e as Ba,x as tp,y as np,w as rp,b as sp,d as Jt,A as ip,H as op,f as ap,u as lp,z as cp,B as dp}from"./fb1Render-CHo6mAey.js";var up=kr;kr.flatten=kr;kr.unflatten=fc;function dc(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function uc(e){return e}function kr(e,t){t=t||{};const n=t.delimiter||".",r=t.maxDepth,s=t.transformKey||uc,i={};function o(a,l,d){d=d||1,Object.keys(a).forEach(function(c){const u=a[c],p=t.safe&&Array.isArray(u),g=Object.prototype.toString.call(u),v=dc(u),C=g==="[object Object]"||g==="[object Array]",b=l?l+n+s(c):s(c);if(!p&&!v&&C&&Object.keys(u).length&&(!t.maxDepth||d<r))return o(u,b,d+1);i[b]=u})}return o(e),i}function fc(e,t){t=t||{};const n=t.delimiter||".",r=t.overwrite||!1,s=t.transformKey||uc,i={};if(dc(e)||Object.prototype.toString.call(e)!=="[object Object]")return e;function a(c){const u=Number(c);return isNaN(u)||c.indexOf(".")!==-1||t.object?c:u}function l(c,u,p){return Object.keys(p).reduce(function(g,v){return g[c+n+v]=p[v],g},u)}function d(c){const u=Object.prototype.toString.call(c),p=u==="[object Array]",g=u==="[object Object]";if(c){if(p)return!c.length;if(g)return!Object.keys(c).length}else return!0}return e=Object.keys(e).reduce(function(c,u){const p=Object.prototype.toString.call(e[u]);return!(p==="[object Object]"||p==="[object Array]")||d(e[u])?(c[u]=e[u],c):l(u,c,kr(e[u],t))},{}),Object.keys(e).forEach(function(c){const u=c.split(n).map(s);let p=a(u.shift()),g=a(u[0]),v=i;for(;g!==void 0;){if(p==="__proto__")return;const C=Object.prototype.toString.call(v[p]),b=C==="[object Object]"||C==="[object Array]";if(!r&&!b&&typeof v[p]<"u")return;(r&&!b||!r&&v[p]==null)&&(v[p]=typeof g=="number"&&!t.object?[]:{}),v=v[p],u.length>0&&(p=a(u.shift()),g=a(u[0]))}v[p]=fc(e[c],t)}),i}const fp=Io(up);var pp=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const js=Io(pp);var hp=Object.create,ko=Object.defineProperty,gp=Object.defineProperties,vp=Object.getOwnPropertyDescriptor,mp=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertyNames,Cs=Object.getOwnPropertySymbols,yp=Object.getPrototypeOf,jo=Object.prototype.hasOwnProperty,pc=Object.prototype.propertyIsEnumerable,Wa=(e,t,n)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))jo.call(t,n)&&Wa(e,n,t[n]);if(Cs)for(var n of Cs(t))pc.call(t,n)&&Wa(e,n,t[n]);return e},$=(e,t)=>gp(e,mp(t)),Kt=(e,t)=>{var n={};for(var r in e)jo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cs)for(var r of Cs(e))t.indexOf(r)<0&&pc.call(e,r)&&(n[r]=e[r]);return n},bp=(e,t)=>function(){return e&&(t=(0,e[Eo(e)[0]])(e=0)),t},_p=(e,t)=>function(){return t||(0,e[Eo(e)[0]])((t={exports:{}}).exports,t),t.exports},xp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Eo(t))!jo.call(e,s)&&s!==n&&ko(e,s,{get:()=>t[s],enumerable:!(r=vp(t,s))||r.enumerable});return e},wp=(e,t,n)=>(n=e!=null?hp(yp(e)):{},xp(!e||!e.__esModule?ko(n,"default",{value:e,enumerable:!0}):n,e)),Ce=(e,t,n)=>new Promise((r,s)=>{var i=l=>{try{a(n.next(l))}catch(d){s(d)}},o=l=>{try{a(n.throw(l))}catch(d){s(d)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);a((n=n.apply(e,t)).next())}),M=bp({"../tsup-config/react-import.js"(){}});M();M();M();var Co=(e,t)=>Object.keys(t).reduce((n,r)=>t[r].type==="slot"?P({[r]:[]},n):n,e),Po=e=>!!e&&typeof e.then=="function",Ha=e=>e.reduce((t,n)=>P(P({},t),n),{}),Mi=e=>e.some(Po),Ps=({value:e,fields:t,mappers:n,propKey:r="",propPath:s="",id:i="",config:o,recurseSlots:a=!1})=>{var l,d,c;const u=(l=t[r])==null?void 0:l.type,p=n[u];if(p&&u==="slot"){const g=e||[],v=a?g.map(C=>{var b;const k=o.components[C.type];if(!k)throw new Error(`Could not find component config for ${C.type}`);const _=(b=k.fields)!=null?b:{};return Ps({value:$(P({},C),{props:Co(C.props,_)}),fields:_,mappers:n,id:C.props.id,config:o,recurseSlots:a})}):g;return Mi(v)?Promise.all(v):p({value:v,parentId:i,propName:s,field:t[r],propPath:s})}else if(p&&t[r])return p({value:e,parentId:i,propName:r,field:t[r],propPath:s});if(e&&typeof e=="object")if(Array.isArray(e)){const g=((d=t[r])==null?void 0:d.type)==="array"?t[r].arrayFields:null;if(!g)return e;const v=e.map((C,b)=>Ps({value:C,fields:g,mappers:n,propKey:r,propPath:`${s}[${b}]`,id:i,config:o,recurseSlots:a}));return Mi(v)?Promise.all(v):v}else{if("$$typeof"in e)return e;{const g=((c=t[r])==null?void 0:c.type)==="object"?t[r].objectFields:t;return hc({value:e,fields:g,mappers:n,id:i,getPropPath:v=>`${s}.${v}`,config:o,recurseSlots:a})}}return e},hc=({value:e,fields:t,mappers:n,id:r,getPropPath:s,config:i,recurseSlots:o})=>{const a=Object.entries(e).map(([l,d])=>{const c={value:d,fields:t,mappers:n,propKey:l,propPath:s(l),id:r,config:i,recurseSlots:o},u=Ps(c);return Po(u)?u.then(p=>({[l]:p})):{[l]:u}},{});return Mi(a)?Promise.all(a).then(Ha):Ha(a)};function zr(e,t,n,r=!1){var s,i,o,a,l;const d="type"in e?e.type:"root",c=d==="root"?n.root:(s=n.components)==null?void 0:s[d],u=hc({value:Co((i=e.props)!=null?i:{},(o=c==null?void 0:c.fields)!=null?o:{}),fields:(a=c==null?void 0:c.fields)!=null?a:{},mappers:t,id:e.props&&(l=e.props.id)!=null?l:"root",getPropPath:p=>p,config:n,recurseSlots:r});return Po(u)?u.then(p=>$(P({},e),{props:p})):$(P({},e),{props:u})}
1function gc(e,t,n){var r,s;const i=d=>zr(d,{slot:({value:c,parentId:u,propName:p})=>{var g;const v=c;return(g=n(v,{parentId:u,propName:p}))!=null?g:v}},t,!0);if("props"in e)return i(e);const o=e,a=(r=o.zones)!=null?r:{},l=o.content.map(i);return{root:i(o.root),content:(s=n(l,{parentId:"root",propName:"default-zone"}))!=null?s:l,zones:Object.keys(a).reduce((d,c)=>$(P({},d),{[c]:a[c].map(i)}),{})}}M();M();M();var Ds=[{width:360,height:"auto",icon:"Smartphone",label:"Small"},{width:768,height:"auto",icon:"Tablet",label:"Medium"},{width:1280,height:"auto",icon:"Monitor",label:"Large"}],Ti={data:{content:[],root:{},zones:{}},ui:{leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},itemSelector:null,componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:Ds[0].width,height:Ds[0].height||"auto"},options:[],controlsVisible:!0},field:{focus:null}},indexes:{nodes:{},zones:{}}};M();M();M();M();var Do="root",Li="default-zone",Ve=`${Do}:${Li}`,Sp=e=>e?e&&e.indexOf(":")>-1?e.split(":"):[Ve,e]:[];function Ip(e,t,n,r=[]){Object.entries(t.zones||{}).forEach(([s,i])=>{const[o]=Sp(s);o===e.props.id&&n(r,s,i)})}M();M();var kp=(e,t)=>zr(e,{slot:()=>null},t),{flatten:Ep,unflatten:jp}=fp,Cp=(e,t)=>$(P({},e),{props:Ep(kp(e,t).props)}),Pp=e=>{const t=jp(e.props);return $(P({},e),{props:t})};function st(e,t,n=s=>s,r=s=>s){var s;let i={};const o={},a={},l=(_,x,y,j,I)=>{var D;const[m]=x.split(":"),E=((D=n(y,x,j))!=null?D:y)||[],[h,A]=x.split(":"),T=`${I||m}:${A}`,R=E.map((N,U)=>c(N,[..._,T],U));return o[T]={contentIds:R.map(N=>N.props.id),type:j},[T,R]},d=(_,x,y)=>{Ip(_,e.data,(j,I,D)=>{const[m,E]=l(j,I,D,"dropzone",x);i[m]=E},y)},c=(_,x,y)=>{const j=r(_,x,y);if(!j)return _;const I=j.props.id,D=$(P({},zr(j,{slot:({value:R,parentId:N,propPath:U})=>{const z=R,K=`${N}:${U}`,[V,X]=l(x,K,z,"slot",N);return X}},t).props),{id:I});d(_,I,x);const m=$(P({},_),{props:D}),E=x[x.length-1],[h,A]=E?E.split(":"):[null,""];a[I]={data:m,flatData:Cp(m,t),path:x,parentId:h,zone:A};const T=$(P({},m),{props:P({},m.props)});return D.id==="root"&&(delete T.type,delete T.props.id),T},u=e.data.zones||{},[p,g]=l([],Ve,e.data.content,"root"),v=g,C=Object.keys(i);Object.keys(u||{}).forEach(_=>{const[x]=_.split(":");if(C.includes(_))return;const[y,j]=l([Ve],_,u[_],"dropzone",x);i[_]=j},i);const b=c({type:"root",props:$(P({},(s=e.data.root.props)!=null?s:e.data.root),{id:"root"})},[],-1),k=$(P({},e.data.root),{props:b.props});return $(P({},e),{data:{root:k,content:v,zones:P(P({},e.data.zones),i)},indexes:{nodes:P(P({},e.indexes.nodes),a),zones:P(P({},e.indexes.zones),o)}})}M();M();M();M();M();var Oo=(e,t)=>e?Object.keys(e.props||{}).reduce((n,r)=>{const s=(e==null?void 0:e.props)||{},i=(t==null?void 0:t.props)||{};return $(P({},n),{[r]:!js(i[r],s[r])})},{}):{},Ua={lastChange:{}},vc=(e,t,...n)=>Ce(void 0,[e,t,...n],function*(r,s,i={},o,a,l="replace"){const d="type"in r&&r.type!=="root"?s.components[r.type]:s.root,c=P({},r),u=(d==null?void 0:d.resolveData)&&r.props,p="id"in r.props?r.props.id:"root";if(u){const{item:v=null,resolved:C={}}=Ua.lastChange[p]||{};if(l!=="force"&&r&&js(r,v))return{node:C,didChange:!1};const b=Oo(r,v);o&&o(r);const{props:k,readOnly:_={}}=yield d.resolveData(r,{changed:b,lastData:v,metadata:P(P({},i),d.metadata),trigger:l});c.props=P(P({},r.props),k),Object.keys(_).length&&(c.readOnly=_)}let g=yield zr(c,{slot:v=>Ce(void 0,[v],function*({value:C}){const b=C;return yield Promise.all(b.map(k=>Ce(void 0,null,function*(){return(yield vc(k,s,i,o,a,l)).node})))})},s);return u&&a&&a(c),Ua.lastChange[p]={item:r,resolved:g},{node:g,didChange:!js(r,g)}});M();M();var mc=(e,t)=>{if(t===Ve)return e;const n=$(P({},e),{zones:e.zones?P({},e.zones):{}});return n.zones[t]=n.zones[t]||[],n};M();function yc(e,t,n,r,s){const i=S.useMemo(()=>Object.keys(n).reduce((l,d)=>{const c=d;return $(P({},l),{[c]:u=>{var p=u,{parentId:g}=p,v=Kt(p,["parentId"]);const C=v.propPath.replace(/\[\d+\]/g,"[*]"),b=(r==null?void 0:r[v.propPath])||(r==null?void 0:r[C])||s||!1,k=n[c];return k==null?void 0:k($(P({},v),{isReadOnly:b,componentId:g}))}})},{}),[n,r,s]),o=S.useMemo(()=>zr(t,i,e).props,[e,t,i]);return S.useMemo(()=>P(P({},t.props),o),[t.props,o])}M();var bc=(e,t=e)=>({slot:({value:n,propName:r,field:s,isReadOnly:i}
1)=>{const o=i?t:e;return l=>o($(P({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}))}});M();function Xs(e,t,n,r=n,s,i){return yc(e,t,bc(n,r),s,i)}M();var Ao=e=>f.jsx(_c,P({},e)),Dp=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=Xs(e,t,i=>f.jsx(Ao,$(P({},i),{config:e,metadata:n})));return f.jsx(r.render,$(P({},s),{puck:$(P({},s.puck),{metadata:n||{}})}))},_c=S.forwardRef(function({className:t,style:n,content:r,config:s,metadata:i},o){return f.jsx("div",{className:t,style:n,ref:o,children:r.map(a=>s.components[a.type]?f.jsx(Dp,{config:s,item:a,metadata:i},a.props.id):null)})});let Jr;const Op=new Uint8Array(16);function Ap(){if(!Jr&&(Jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jr(Op)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function Mp(e,t=0){return $e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+"-"+$e[e[t+4]]+$e[e[t+5]]+"-"+$e[e[t+6]]+$e[e[t+7]]+"-"+$e[e[t+8]]+$e[e[t+9]]+"-"+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]}const Tp=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Va={randomUUID:Tp};function Za(e,t,n){if(Va.randomUUID&&!e)return Va.randomUUID();e=e||{};const r=e.random||(e.rng||Ap)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Mp(r)}const Ya=e=>{let t;const n=new Set,r=(d,c)=>{const u=typeof d=="function"?d(t):d;if(!Object.is(u,t)){const p=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(g=>g(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d))},l=t=e(r,s,a);return a},Fr=e=>e?Ya(e):Ya,Lp=e=>e;function Mo(e,t=Lp){const n=Vt.useSyncExternalStore(e.subscribe,Vt.useCallback(()=>t(e.getState()),[e,t]),Vt.useCallback(()=>t(e.getInitialState()),[e,t]));return Vt.useDebugValue(n),n}const qa=e=>{const t=Fr(e),n=r=>Mo(t,r);return Object.assign(n,t),n},xc=e=>e?qa(e):qa,$p=e=>(t,n,r)=>{const s=r.subscribe;return r.subscribe=(o,a,l)=>{let d=o;if(a){const c=(l==null?void 0:l.equalityFn)||Object.is;let u=o(r.getState());d=p=>{const g=o(p);if(!c(u,g)){const v=u;a(u=g,v)}},l!=null&&l.fireImmediately&&a(u,u)}return s(d)},e(t,n,r)},wc=$p;var Rp=Symbol.for("preact-signals");function Ks(){if(At>1)At--;else{var e,t=!1;for(function(){var s=As;for(As=void 0;s!==void 0;){var i=s.S;if(i.v===s.v)for(var o=i.t;o!==void 0;o=o.x)o.i===s.i&&(o.i=i.i);s=s.o}}();_r!==void 0;){var n=_r;for(_r=void 0,Os++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ic(n))try{n.c()}catch(s){t||(e=s,t=!0)}n=r}}if(Os=0,At--,t)throw e}}function ke(e){if(At>0)return e();$i=++Np,At++;try{return e()}finally{Ks()}}var br,ye=void 0;function de(e){var t=ye,n=br;ye=void 0,br=void 0;try{return e()}finally{ye=t,br=n}}var _r=void 0,At=0,Os=0,Np=0,$i=0,As=void 0,Ms=0;function Sc(e){if(ye!==void 0){var t=e.n;if(t===void 0||t.t!==ye)return t={i:0,S:e,p:ye.s,n:void 0,t:ye,e:void 0,x:void 0,r:t},ye.s!==void 0&&(ye.s.n=t),ye.s=t,e.n=t,32&ye.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=ye.s,t.n=void 0,ye.s.n=t,ye.s=t),t}}function Xe(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}Xe.prototype.brand=Rp;Xe.prototype.h=function(){return!0};Xe.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:de(function(){var r;(r=t.W)==null||r.call(t)}))};Xe.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&&de(function(){var s;(s=t.Z)==null||s.call(t)}))}};Xe.prototype.subscribe=function(e){var t=this;return Qe(function(){var n=t.value;de(function(){return e(n)})},{name:"sub"})};Xe.prototype.valueOf=function(){return this.value};Xe.prototype.toString=function(){return this.value+""};Xe.prototype.toJSON=function(){return this.value};Xe.prototype.peek=function(){var e=this;return de(function(){return e.value})};Object.defineProperty(Xe.prototype,"value",{get:function(){var e=Sc(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Os>100)throw new Error("Cycle detected");(function(n){At!==0&&Os===0&&n.l!==$i&&(n.l=$i,As={S:n,v:n.v,i:n.i,o:As})})(this),this.v=e,this.i++,Ms++,At++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ks()}}}});function Br(e,t){return new Xe(e,t)}function Ic(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 kc(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 Ec(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 fn(e,t){Xe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ms-1,this.f=4}fn.prototype=new Xe;fn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ms))return!0;
1if(this.g=Ms,this.f|=1,this.i>0&&!Ic(this))return this.f&=-2,!0;var e=ye;try{kc(this),ye=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 ye=e,Ec(this),this.f&=-2,!0};fn.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)}Xe.prototype.S.call(this,e)};fn.prototype.U=function(e){if(this.t!==void 0&&(Xe.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)}};fn.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(fn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Sc(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Xa(e,t){return new fn(e,t)}function jc(e){var t=e.m;if(e.m=void 0,typeof t=="function"){At++;var n=ye;ye=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,To(e),r}finally{ye=n,Ks()}}}function To(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,jc(e)}function zp(e){if(ye!==this)throw new Error("Out-of-order effect");Ec(this),ye=e,this.f&=-2,8&this.f&&To(this),Ks()}function Rn(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,br&&br.push(this)}Rn.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()}};Rn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,jc(this),kc(this),At++;var e=ye;return ye=this,zp.bind(this,e)};Rn.prototype.N=function(){2&this.f||(this.f|=2,this.u=_r,_r=this)};Rn.prototype.d=function(){this.f|=8,1&this.f||To(this)};Rn.prototype.dispose=function(){this.d()};function Qe(e,t){var n=new Rn(e,t);try{n.c()}catch(s){throw n.d(),s}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Fp=Object.create,Lo=Object.defineProperty,Bp=Object.defineProperties,Wp=Object.getOwnPropertyDescriptor,Hp=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Up=Object.prototype.hasOwnProperty,Vp=Object.prototype.propertyIsEnumerable,Zp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Nn=e=>{throw TypeError(e)},Ri=(e,t,n)=>t in e?Lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yp=(e,t)=>{for(var n in t||(t={}))Up.call(t,n)&&Ri(e,n,t[n]);if(Ka)for(var n of Ka(t))Vp.call(t,n)&&Ri(e,n,t[n]);return e},qp=(e,t)=>Bp(e,Hp(t)),Ga=(e,t)=>Lo(e,"name",{value:t,configurable:!0}),Xp=e=>{var t;return[,,,Fp((t=void 0)!=null?t:null)]},Cc=["class","method","getter","setter","accessor","field","value","get","set"],nr=e=>e!==void 0&&typeof e!="function"?Nn("Function expected"):e,Kp=(e,t,n,r,s)=>({kind:Cc[e],name:t,metadata:r,addInitializer:i=>n._?Nn("Already initialized"):s.push(nr(i||null))}),Pc=(e,t)=>Ri(t,Zp("metadata"),e[3]),Qt=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)t&1?i[s].call(n):r=i[s].call(n,r);return r},zn=(e,t,n,r,s,i)=>{var o,a,l,d,c,u=t&7,p=!!(t&8),g=!!(t&16),v=u>3?e.length+1:u?p?1:2:0,C=Cc[u+5],b=u>3&&(e[v-1]=[]),k=e[v]||(e[v]=[]),_=u&&(!g&&!p&&(s=s.prototype),u<5&&(u>3||!g)&&Wp(u<4?s:{get[n](){return lt(this,i)},set[n](y){return Ht(this,i,y)}},n));u?g&&u<4&&Ga(i,(u>2?"set ":u>1?"get ":"")+n):Ga(s,n);for(var x=r.length-1;x>=0;x--)d=Kp(u,n,l={}
1,e[3],k),u&&(d.static=p,d.private=g,c=d.access={has:g?y=>Gp(s,y):y=>n in y},u^3&&(c.get=g?y=>(u^1?lt:Jp)(y,s,u^4?i:_.get):y=>y[n]),u>2&&(c.set=g?(y,j)=>Ht(y,s,j,u^4?i:_.set):(y,j)=>y[n]=j)),a=(0,r[x])(u?u<4?g?i:_[C]:u>4?void 0:{get:_.get,set:_.set}:s,d),l._=1,u^4||a===void 0?nr(a)&&(u>4?b.unshift(a):u?g?i=a:_[C]=a:s=a):typeof a!="object"||a===null?Nn("Object expected"):(nr(o=a.get)&&(_.get=o),nr(o=a.set)&&(_.set=o),nr(o=a.init)&&b.unshift(o));return u||Pc(e,s),_&&Lo(s,n,_),g?u^4?i:_:s},$o=(e,t,n)=>t.has(e)||Nn("Cannot "+n),Gp=(e,t)=>Object(t)!==t?Nn('Cannot use the "in" operator on this value'):e.has(t),lt=(e,t,n)=>($o(e,t,"read from private field"),n?n.call(e):t.get(e)),rr=(e,t,n)=>t.has(e)?Nn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ht=(e,t,n,r)=>($o(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Jp=(e,t,n)=>($o(e,t,"access private method"),n);function Ts(e,t){if(t){let n;return Xa(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return Xa(e)}function Mt(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)=>!Mt(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(i=>!Mt(e[i],t[i]))}return!1}function ae({get:e},t){return{init(n){return Br(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function Me(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=Ts(e.bind(this)),n.set(this,r)),r.value}}function ui(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,qp(Yp({},s),{enumerable:e}))})}}function Wr(...e){const t=e.map(Qe);return()=>t.forEach(n=>n())}var Dc,Oc,Ac,Mc,Tc,Lc,Ye,Ro,fi,Ni,zi,He,No,pi,$c,Fi,zo,hi,Bi,Wi;Lc=[ae],Tc=[ae],Mc=[ae],Ac=[ui()],Oc=[ui()],Dc=[ui()];var pn=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Qt(Ye,5,this),rr(this,He),rr(this,Ro,Qt(Ye,8,this)),Qt(Ye,11,this),rr(this,No,Qt(Ye,12,this)),Qt(Ye,15,this),rr(this,zo,Qt(Ye,16,this)),Qt(Ye,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return lt(this,He,Bi)}get initial(){return lt(this,He,Ni)}get previous(){return lt(this,He,$c)}set current(e){const t=de(()=>lt(this,He,Bi));e&&t&&this.equals(t,e)||ke(()=>{lt(this,He,Ni)||Ht(this,He,e,zi),Ht(this,He,t,Fi),Ht(this,He,e,Wi)})}reset(e=this.defaultValue){ke(()=>{Ht(this,He,void 0,Fi),Ht(this,He,e,zi),Ht(this,He,e,Wi)})}};Ye=Xp();Ro=new WeakMap;He=new WeakSet;No=new WeakMap;zo=new WeakMap;fi=zn(Ye,20,"#initial",Lc,He,Ro),Ni=fi.get,zi=fi.set;pi=zn(Ye,20,"#previous",Tc,He,No),$c=pi.get,Fi=pi.set;hi=zn(Ye,20,"#current",Mc,He,zo),Bi=hi.get,Wi=hi.set;zn(Ye,2,"current",Ac,pn);zn(Ye,2,"initial",Oc,pn);zn(Ye,2,"previous",Dc,pn);Pc(Ye,pn);function gi(e){return de(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var en,Qp=class{constructor(){rr(this,en,new WeakMap)}get(e,t){var n;return e?(n=lt(this,en).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return lt(this,en).has(e)||lt(this,en).set(e,new Map),(r=lt(this,en).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=lt(this,en).get(e))==null?void 0:t.clear():void 0}};en=new WeakMap;var eh=Object.create,Rc=Object.defineProperty,th=Object.getOwnPropertyDescriptor,Ja=Object.getOwnPropertySymbols,nh=Object.prototype.hasOwnProperty,rh=Object.prototype.propertyIsEnumerable,Nc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Gs=e=>{throw TypeError(e)},Qa=Math.pow,Hi=(e,t,n)=>t in e?Rc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sh=(e,t)=>{for(var n in t||(t={}))nh.call(t,n)&&Hi(e,n,t[n]);if(Ja)for(var n of Ja(t))rh.call(t,n)&&Hi(e,n,t[n]);return e},ih=e=>{var t;return[,,,eh((t=e==null?void 0:e[Nc("metadata")])!=null?t:null)]},zc=["class","method","getter","setter","accessor","field","value","get","set"],Fc=e=>e!==void 0&&typeof e!="function"?Gs("Function expected"):e,oh=(e,t,n,r,s
1)=>({kind:zc[e],name:t,metadata:r,addInitializer:i=>n._?Gs("Already initialized"):s.push(Fc(i||null))}),ah=(e,t)=>Hi(t,Nc("metadata"),e[3]),lh=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)i[s].call(n);return r},Bc=(e,t,n,r,s,i)=>{for(var o,a,l,d,c=t&7,u=!1,p=!1,g=2,v=zc[c+5],C=e[g]||(e[g]=[]),b=(s=s.prototype,th(s,n)),k=r.length-1;k>=0;k--)l=oh(c,n,a={},e[3],C),l.static=u,l.private=p,d=l.access={has:_=>n in _},d.get=_=>_[n],o=(0,r[k])(b[v],l),a._=1,Fc(o)&&(b[v]=o);return b&&Rc(s,n,b),s},Wc=(e,t,n)=>t.has(e)||Gs("Cannot "+n),ch=(e,t,n)=>(Wc(e,t,"read from private field"),t.get(e)),dh=(e,t,n)=>t.has(e)?Gs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),uh=(e,t,n,r)=>(Wc(e,t,"write to private field"),t.set(e,n),n),Ze=class Ui{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Ui(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 Ui(t,n)}},_t=class tn{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:i,height:o,scale:a}=this,l=new tn(s+t,r+n,i,o);return l.scale=sh({},a),l}get boundingRectangle(){const{width:t,height:n,left:r,top:s,right:i,bottom:o}=this;return{width:t,height:n,left:r,top:s,right:i,bottom:o}}get center(){const{left:t,top:n,right:r,bottom:s}=this;return new Ze((t+r)/2,(n+s)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof tn))return!1;const{left:n,top:r,width:s,height:i}=this;return n===t.left&&r===t.top&&s===t.width&&i===t.height}containsPoint(t){const{top:n,left:r,bottom:s,right:i}=this;return n<=t.y&&t.y<=s&&r<=t.x&&t.x<=i}intersectionArea(t){return t instanceof tn?fh(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 tn(n,t,r,s)}static delta(t,n,r={x:"center",y:"center"}){const s=(i,o)=>{const a=r[o],l=o==="x"?i.left:i.top,d=o==="x"?i.width:i.height;return a=="start"?l:a=="end"?l+d:l+d/2};return Ze.delta({x:s(t,"x"),y:s(t,"y")},{x:s(n,"x"),y:s(n,"y")})}static intersectionRatio(t,n){return tn.from(t).intersectionRatio(tn.from(n))}};function fh(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),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,a=i-n;return r<s&&n<i?o*a:0}var Hc,Uc,Vi,hs,Hr,Js=class extends(Vi=pn,Uc=[Me],Hc=[Me],Vi){constructor(t){const n=Ze.from(t);super(n,(r,s)=>Ze.equals(r,s)),lh(Hr,5,this),dh(this,hs,0),this.velocity={x:0,y:0}}get delta(){return Ze.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=Ze.from(t),s={x:r.x-n.x,y:r.y-n.y},i=Date.now(),o=i-ch(this,hs),a=l=>Math.round(l/o*100);ke(()=>{uh(this,hs,i),this.velocity={x:a(s.x),y:a(s.y)},super.current=r})}reset(t=this.defaultValue){super.reset(Ze.from(t)),this.velocity={x:0,y:0}}};Hr=ih(Vi);hs=new WeakMap;Bc(Hr,2,"delta",Uc,Js);Bc(Hr,2,"direction",Hc,Js);ah(Hr,Js);function vi({x:e,y:t},n){const r=Math.abs(e),s=Math.abs(t);return typeof n=="number"?Math.sqrt(Qa(r,2)+Qa(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 Vc=(e=>(e.Horizontal="x",e.Vertical="y",e))(Vc||{}),Zc=Object.values(Vc),ph=Object.create,Fo=Object.defineProperty,hh=Object.defineProperties,gh=Object.getOwnPropertyDescriptor,vh=Object.getOwnPropertyDescriptors,Ls=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,qc=Object.prototype.propertyIsEnumerable,Xc=(e,t)=>
1(t=Symbol[e])?t:Symbol.for("Symbol."+e),Fn=e=>{throw TypeError(e)},Zi=(e,t,n)=>t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kc=(e,t)=>{for(var n in t||(t={}))Yc.call(t,n)&&Zi(e,n,t[n]);if(Ls)for(var n of Ls(t))qc.call(t,n)&&Zi(e,n,t[n]);return e},Gc=(e,t)=>hh(e,vh(t)),el=(e,t)=>Fo(e,"name",{value:t,configurable:!0}),Jc=(e,t)=>{var n={};for(var r in e)Yc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ls)for(var r of Ls(e))t.indexOf(r)<0&&qc.call(e,r)&&(n[r]=e[r]);return n},Bn=e=>{var t;return[,,,ph((t=e==null?void 0:e[Xc("metadata")])!=null?t:null)]},Qc=["class","method","getter","setter","accessor","field","value","get","set"],sr=e=>e!==void 0&&typeof e!="function"?Fn("Function expected"):e,mh=(e,t,n,r,s)=>({kind:Qc[e],name:t,metadata:r,addInitializer:i=>n._?Fn("Already initialized"):s.push(sr(i||null))}),hn=(e,t)=>Zi(t,Xc("metadata"),e[3]),ne=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)t&1?i[s].call(n):r=i[s].call(n,r);return r},le=(e,t,n,r,s,i)=>{var o,a,l,d,c,u=t&7,p=!!(t&8),g=!!(t&16),v=u>3?e.length+1:u?p?1:2:0,C=Qc[u+5],b=u>3&&(e[v-1]=[]),k=e[v]||(e[v]=[]),_=u&&(!g&&!p&&(s=s.prototype),u<5&&(u>3||!g)&&gh(u<4?s:{get[n](){return Ne(this,i)},set[n](y){return gt(this,i,y)}},n));u?g&&u<4&&el(i,(u>2?"set ":u>1?"get ":"")+n):el(s,n);for(var x=r.length-1;x>=0;x--)d=mh(u,n,l={}
1,e[3],k),u&&(d.static=p,d.private=g,c=d.access={has:g?y=>yh(s,y):y=>n in y},u^3&&(c.get=g?y=>(u^1?Ne:bh)(y,s,u^4?i:_.get):y=>y[n]),u>2&&(c.set=g?(y,j)=>gt(y,s,j,u^4?i:_.set):(y,j)=>y[n]=j)),a=(0,r[x])(u?u<4?g?i:_[C]:u>4?void 0:{get:_.get,set:_.set}:s,d),l._=1,u^4||a===void 0?sr(a)&&(u>4?b.unshift(a):u?g?i=a:_[C]=a:s=a):typeof a!="object"||a===null?Fn("Object expected"):(sr(o=a.get)&&(_.get=o),sr(o=a.set)&&(_.set=o),sr(o=a.init)&&b.unshift(o));return u||hn(e,s),_&&Fo(s,n,_),g?u^4?i:_:s},Bo=(e,t,n)=>t.has(e)||Fn("Cannot "+n),yh=(e,t)=>Object(t)!==t?Fn('Cannot use the "in" operator on this value'):e.has(t),Ne=(e,t,n)=>(Bo(e,t,"read from private field"),n?n.call(e):t.get(e)),ge=(e,t,n)=>t.has(e)?Fn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),gt=(e,t,n,r)=>(Bo(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),bh=(e,t,n)=>(Bo(e,t,"access private method"),n);function ed(e,t){return{plugin:e,options:t}}function Wo(e){return t=>ed(e,t)}function Ho(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var td,Er,Uo,gs;td=[ae];var We=class{constructor(e,t){this.manager=e,this.options=t,ge(this,Uo,ne(Er,8,this,!1)),ne(Er,11,this),ge(this,gs,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return de(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=Qe(e.bind(this));return Ne(this,gs).add(t),t}destroy(){Ne(this,gs).forEach(e=>e())}static configure(e){return ed(this,e)}};Er=Bn(null);Uo=new WeakMap;gs=new WeakMap;le(Er,4,"disabled",td,We,Uo);hn(Er,We);var Qs=class extends We{},vs,mi=class{constructor(e){this.manager=e,this.instances=new Map,ge(this,vs,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(Ho).reduceRight((r,s)=>r.some(({plugin:i})=>i===s.plugin)?r:[s,...r],[]),n=t.map(({plugin:r})=>r);for(const r of Ne(this,vs))if(!n.includes(r)){if(r.prototype instanceof Qs)continue;this.unregister(r)}for(const{plugin:r,options:s}of t)this.register(r,s);gt(this,vs,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()}};vs=new WeakMap;function _h(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Qr=[],wn,Sn,xh=class extends We{constructor(e){super(e),ge(this,wn),ge(this,Sn),this.computeCollisions=this.computeCollisions.bind(this),gt(this,Sn,Br(Qr)),this.destroy=Wr(()=>{const t=this.computeCollisions(),n=de(()=>this.manager.dragOperation.position.current);if(t!==Qr){const r=Ne(this,wn);if(gt(this,wn,n),r&&n.x==r.x&&n.y==r.y)return}else gt(this,wn,void 0);Ne(this,Sn).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){de(()=>{e?Ne(this,Sn).value=this.computeCollisions():gt(this,wn,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:s,shape:i,status:o}=r;if(!o.initialized||!i)return Qr;const a=[],l=[];for(const d of e??n.droppables){if(d.disabled||s&&!d.accepts(s))continue;const c=t??d.collisionDetector;if(!c)continue;l.push(d),d.shape;const u=de(()=>c({droppable:d,dragOperation:r}));u&&(d.collisionPriority!=null&&(u.priority=d.collisionPriority),a.push(u))}return l.length===0?Qr:(a.sort(_h),a)}get collisions(){return Ne(this,Sn).value}};wn=new WeakMap;Sn=new WeakMap;var wh=class{constructor(){this.registry=new Map}addEventListener(t,n){const{registry:r}=this,s=new Set(r.get(t));return s.add(n),r.set(t,s),()=>this.removeEventListener(t,n)}removeEventListener(t,n){const{registry:r}=this,s=new Set(r.get(t));s.delete(n),r.set(t,s)}dispatch(t,...n){const{registry:r}=this,s=r.get(t);if(s)for(const i of s)i(...n)}},Sh=class extends wh{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function ms(e,t=!0){let n=!1;return Gc(Kc({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var Ih=class extends Qs{constructor(e){super(e);const t=(r,s)=>r.map(({id:i})=>i).join("")===s.map(({id:i})=>i).join("");let n=[];this.destroy=Wr(()=>{const{dragOperation:r,collisionObserver:s}=e;r.status.initializing&&(n=[],s.enable())},()=>{const{collisionObserver:r,monitor:s}=e,{collisions:i}=r;if(r.isDisabled())return;const o=ms({collisions:i});if(s.dispatch("collision",o),o.defaultPrevented||t(i,n))return;n=i;const[a]=i;de(()=>{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()}))})})}},ct=(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))(ct||{}),Pt=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Pt||{}),nd,rd,sd,id,od,ad,ld,ut,Vo;ld=[ae],ad=[Me],od=[Me],id=[Me],sd=[Me],rd=[Me],nd=[Me];var Tt=class{constructor(){ne(ut,5,this),ge(this,Vo,ne(ut,8,this,"idle")),ne(ut,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}};ut=Bn(null);Vo=new WeakMap;le(ut,4,"value",ld,Tt,Vo);le(ut,2,"current",ad,Tt);le(ut,2,"idle",od,Tt);le(ut,2,"initializing",id,Tt);le(ut,2,"initialized",sd,Tt);le(ut,2,"dragging",rd,Tt);le(ut,2,"dropped",nd,Tt);hn(ut,Tt);var kh=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 de(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=ms({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return de(()=>{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:i}=e;ke(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=s??null,t.position.reset(i)});const o=ms({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",o),o.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>
1{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 de(()=>{var t,n;const{dragOperation:r}=this.manager,{status:s,controller:i}=r;if(!s.dragging||!i||i.signal.aborted)return;const o=ms({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",o),queueMicrotask(()=>{var a,l,d,c,u;if(o.defaultPrevented)return;const p=(u=e.to)!=null?u:{x:r.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:r.position.current.y+((c=(d=e.by)==null?void 0:d.y)!=null?c:0)};r.position.current=p})})}stop(e={}){return de(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:s}=r;if(!s||s.signal.aborted)return;let i;const o=()=>{const l={resume:()=>{},abort:()=>{}};return i=new Promise((d,c)=>{l.resume=d,l.abort=c}),l};s.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const l=de(()=>{var c;return((c=r.source)==null?void 0:c.status)==="dropping"}),d=()=>{r.controller===s&&(r.controller=void 0),r.reset()};if(l){const{source:c}=r,u=Qe(()=>{(c==null?void 0:c.status)==="idle"&&(u(),d())})}else this.manager.renderer.rendering.then(d)})};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:o}),i?i.then(a).catch(()=>r.reset()):a()})}},cd,dd,ud,fd,Je,Zo,Yo,qo,Xo;fd=[ae],ud=[ae],dd=[ae],cd=[ae];var Gt=class{constructor(e,t){ge(this,Zo,ne(Je,8,this)),ne(Je,11,this),ge(this,Yo,ne(Je,12,this)),ne(Je,15,this),ge(this,qo,ne(Je,16,this)),ne(Je,19,this),ge(this,Xo,ne(Je,20,this)),ne(Je,23,this);const{effects:n,id:r,data:s={},disabled:i=!1,register:o=!0}=e;let a=r;this.manager=t,this.id=r,this.data=s,this.disabled=i,this.effects=()=>{var l;return[()=>{const{id:d,manager:c}=this;if(d!==a)return c==null||c.registry.register(this),()=>c==null?void 0:c.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&&o&&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)}};Je=Bn(null);Zo=new WeakMap;Yo=new WeakMap;qo=new WeakMap;Xo=new WeakMap;le(Je,4,"manager",fd,Gt,Zo);le(Je,4,"id",ud,Gt,Yo);le(Je,4,"data",dd,Gt,qo);le(Je,4,"disabled",cd,Gt,Xo);hn(Je,Gt);var tl=class{constructor(){this.map=Br(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 i=new Map(n);i.set(e,t),this.map.value=i;const o=Wr(...t.effects());return this.cleanupFunctions.set(t,o),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}},pd,hd,gd,vd,md,yd,Yi,qe,Ko,Go,Jo,Et=class extends(Yi=Gt,yd=[ae],md=[ae],vd=[ae],gd=[Me],hd=[Me],pd=[Me],Yi){constructor(t,n){var r=t,{modifiers:s,type:i,sensors:o}=r,a=Jc(r,["modifiers","type","sensors"]);super(a,n),ne(qe,5,this),ge(this,Ko,ne(qe,8,this)),ne(qe,11,this),ge(this,Go,ne(qe,12,this)),ne(qe,15,this),ge(this,Jo,ne(qe,16,this,this.isDragSource?"dragging":"idle")),ne(qe,19,this),this.type=i,this.sensors=o,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}};qe=Bn(Yi);Ko=new WeakMap;Go=new WeakMap;Jo=new WeakMap;le(qe,4,"type",yd,Et,Ko);le(qe,4,"modifiers",md,Et,Go);le(qe,4,"status",vd,Et,Jo);le(qe,2,"isDropping",gd,Et);le(qe,2,"isDragging",hd,Et);le(qe,2,"isDragSource",pd,Et);hn(qe,Et);var bd,_d,xd,wd,Sd,Id,qi,Pe,Qo,ea,ta,na,ra,jt=class extends(qi=Gt,Id=[ae],Sd=[ae],wd=[ae],xd=[ae],_d=[ae],bd=[Me],qi){constructor(t,n){var r=t,{accept:s,collisionDetector:i,collisionPriority:o,type:a}=r,l=Jc(r,["accept","collisionDetector","collisionPriority","type"]);super(l,n),ne(Pe,5,this),ge(this,Qo,ne(Pe,8,this)),ne(Pe,11,this),ge(this,ea,ne(Pe,12,this)),ne(Pe,15,this),ge(this,ta,ne(Pe,16,this)),ne(Pe,19,this),ge(this,na,ne(Pe,20,this)),ne(Pe,23,this),ge(this,ra,ne(Pe,24,this)),ne(Pe,27,this),this.accept=s,this.collisionDetector=i,this.collisionPriority=o,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}};Pe=Bn(qi);Qo=new WeakMap;ea=new WeakMap;ta=new WeakMap;na=new WeakMap;ra=new WeakMap;le(Pe,4,"accept",Id,jt,Qo);le(Pe,4,"type",Sd,jt,ea);le(Pe,4,"collisionDetector",wd,jt,ta);le(Pe,4,"collisionPriority",xd,jt,na);le(Pe,4,"shape",_d,jt,ra);le(Pe,2,"isDropTarget",bd,jt);hn(Pe,jt);var An=class extends We{constructor(e,t){super(e,t),this.manager=e,this.options=t}},nl=class extends We{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},Eh=class{constructor(e){this.draggables=new tl,this.droppables=new tl,this.plugins=new mi(e),this.sensors=new mi(e),this.modifiers=new mi(e)}register(e,t){if(e instanceof Et)return this.draggables.register(e.id,e);if(e instanceof jt)return this.droppables.register(e.id,e);if(e.prototype instanceof nl)return this.modifiers.register(e,t);if(e.prototype instanceof An)return this.sensors.register(e,t);if(e.prototype instanceof We)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Gt)return e instanceof Et?this.draggables.unregister(e.id,e):e instanceof jt?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof nl)return this.modifiers.unregister(e);if(e.prototype instanceof An)return this.sensors.unregister(e);if(e.prototype instanceof We)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()}},kd,Ed,jd,Cd,Pd,Dd,Od,Ad,Md,ir,ys,In,Se,sa,ia,oa,aa,la,or;Md=[Me],Ad=[ae],Od=[ae],Dd=[ae],Pd=[ae],Cd=[ae],jd=[Me],Ed=[Me],kd=[Me];var wt=class{constructor(e){ne(Se,5,this),ge(this,ir),ge(this,ys),ge(this,In,new pn(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new Tt,ge(this,sa,ne(Se,8,this,!1)),ne(Se,11,this),ge(this,ia,ne(Se,12,this,null)),ne(Se,15,this),ge(this,oa,ne(Se,16,this,null)),ne(Se,19,this),ge(this,aa,ne(Se,20,this,null)),ne(Se,23,this),ge(this,la,ne(Se,24,this,[])),ne(Se,27,this),this.position=new Js({x:0,y:0}),ge(this,or,{x:0,y:0}),gt(this,ir,e)}get shape(){const{current:e,initial:t,previous:n}=Ne(this,In);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?Ne(this,In).current=e:Ne(this,In).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=Ne(this,ir).registry.draggables.get(t);return n&&gt(this,ys,n),(e=n??Ne(this,ys))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=Ne(this,ir).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(Gc(Kc({},this.snapshot()),{transform:n}));return gt(this,or,n),n}
1snapshot(){return de(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:Ne(this,or),shape:this.shape?gi(this.shape):null,position:gi(this.position),status:gi(this.status),canceled:this.canceled}))}reset(){ke(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,Ne(this,In).reset(),this.position.reset({x:0,y:0}),gt(this,or,{x:0,y:0}),this.modifiers=[]})}};Se=Bn(null);ir=new WeakMap;ys=new WeakMap;In=new WeakMap;sa=new WeakMap;ia=new WeakMap;oa=new WeakMap;aa=new WeakMap;la=new WeakMap;or=new WeakMap;le(Se,2,"shape",Md,wt);le(Se,4,"canceled",Ad,wt,sa);le(Se,4,"activatorEvent",Od,wt,ia);le(Se,4,"sourceIdentifier",Dd,wt,oa);le(Se,4,"targetIdentifier",Pd,wt,aa);le(Se,4,"modifiers",Cd,wt,la);le(Se,2,"source",jd,wt);le(Se,2,"target",Ed,wt);le(Se,2,"transform",kd,wt);hn(Se,wt);var jh={get rendering(){return Promise.resolve()}},Ch=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(c=>c.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};const{plugins:n=[],sensors:r=[],modifiers:s=[],renderer:i=jh}=t??{},o=new Sh(this),a=new Eh(this);this.registry=a,this.monitor=o,this.renderer=i,this.actions=new kh(this),this.dragOperation=new wt(this),this.collisionObserver=new xh(this),this.plugins=[Ih,...n],this.modifiers=s,this.sensors=r;const{destroy:l}=this,d=Wr(()=>{var c,u,p;const g=de(()=>this.dragOperation.modifiers),v=this.modifiers;g!==v&&g.forEach(C=>C.destroy()),this.dragOperation.modifiers=(p=(u=(c=this.dragOperation.source)==null?void 0:c.modifiers)==null?void 0:u.map(C=>{const{plugin:b,options:k}=Ho(C);return new b(this,k)}))!=null?p:v});this.destroy=()=>{d(),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}},Td=e=>{throw TypeError(e)},ca=(e,t,n)=>t.has(e)||Td("Cannot "+n),re=(e,t,n)=>(ca(e,t,"read from private field"),t.get(e)),Ge=(e,t,n)=>t.has(e)?Td("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),nt=(e,t,n,r)=>(ca(e,t,"write to private field"),t.set(e,n),n),Ld=(e,t,n)=>(ca(e,t,"access private method"),n);function ei(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function $d(e,t){const n=e.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:s}=r,o=(ei(s)?s.getKeyframes():[]).filter(t);if(o.length>0)return[o[o.length-1],r]}return null}function ti(e){const{width:t,height:n,top:r,left:s,bottom:i,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:s,bottom:i,right:o}}var Rd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function da(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ua(e){return"nodeType"in e}function Lt(e){var t,n,r;return e?da(e)?e:ua(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 Nd(e){const{Document:t}=Lt(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function un(e){return!e||da(e)?!1:e instanceof Lt(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function zd(e){return e instanceof Lt(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function Ct(e){return e?da(e)?e.document:ua(e)?Nd(e)?e:un(e)||zd(e)?e.ownerDocument:document:document:document}function Ph(e){const{documentElement:t}=Ct(e),n=t.clientWidth,r=t.clientHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function Dh(e,t){if(Oh(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);return n==="visible"&&r==="visible"&&s==="visible"}function Oh(e){return e.tagName==="DETAILS"}function jr(e,t=e.getBoundingClientRect(),n=0){var r;let s=t;const{ownerDocument:i}=e,o=(r=i.defaultView)!=null?r:window;let a=e.parentElement;for(;a&&a!==i.documentElement;){if(!Dh(a)){const p=a.getBoundingClientRect(),g=n*(p.bottom-p.top),v=n*(p.right-p.left),C=n*(p.bottom-p.top),b=n*(p.right-p.left);s={top:Math.max(s.top,p.top-g),right:Math.min(s.right,p.right+v),bottom:Math.min(s.bottom,p.bottom+C),left:Math.max(s.left,p.left-b),width:0,height:0},s.width=s.right-s.left,s.height=s.bottom-s.top}a=a.parentElement}const l=o.innerWidth,d=o.innerHeight,c=n*d,u=n*l;return s={top:Math.max(s.top,0-c),right:Math.min(s.right,l+u),bottom:Math.min(s.bottom,d+c),left:Math.max(s.left,0-u),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 Fd(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ah(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));
1return Array.from(n.querySelectorAll(t)).forEach((i,o)=>{const a=r[o];if(rl(i)&&rl(a)&&(i.type!=="file"&&(i.value=a.value),i.type==="radio"&&i.name&&(i.name=`Cloned__${i.name}`)),sl(i)&&sl(a)&&a.width>0&&a.height>0){const l=i.getContext("2d");l==null||l.drawImage(a,0,0)}}),n}function rl(e){return"value"in e}function sl(e){return e.tagName==="CANVAS"}function Bd(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(Mh(r)){const{contentDocument:s}=r;if(s){const{left:i,top:o}=r.getBoundingClientRect();return Bd(s,{x:t-i,y:n-o})}}return r}function Mh(e){return(e==null?void 0:e.tagName)==="IFRAME"}var Xi=new WeakMap,Wd=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:i,listener:o,options:a}=s,l=[e,s];e.addEventListener(i,o,a),this.entries.add(l),r.push(l)}return function(){for(const[i,{type:o,listener:a,options:l}]of r)i.removeEventListener(o,a,l)}}};function Mn(e){const t=e==null?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function Th(e){const t=new Set;let n=Mn(e);for(;n;)t.add(n),n=Mn(n);return t}function Lh(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function Hd(e,t){const n=()=>performance.now();let r,s;return function(...i){const o=this;s?(r==null||r(),r=Lh(()=>{e.apply(o,i),s=n()},t-(n()-s))):(e.apply(o,i),s=n())}}function $h(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 Rh(e,t=e.getBoundingClientRect()){const{width:n,height:r}=jr(e,t);return n>0&&r>0}var Nh=Rd?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},bs,zh=class extends Nh{constructor(e){super(t=>{if(!re(this,bs)){nt(this,bs,!0);return}e(t,this)}),Ge(this,bs,!1)}};bs=new WeakMap;var il=Array.from({length:100},(e,t)=>t/100),Ud=75,nn,$s,Bt,rn,ar,Re,xr,lr,Rs,Vd,Zd,Yd=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,Ge(this,Rs),this.disconnect=()=>{var i,o,a;nt(this,xr,!0),(i=re(this,Bt))==null||i.disconnect(),(o=re(this,rn))==null||o.disconnect(),re(this,ar).disconnect(),(a=re(this,Re))==null||a.remove()},Ge(this,nn,!0),Ge(this,$s),Ge(this,Bt),Ge(this,rn),Ge(this,ar),Ge(this,Re),Ge(this,xr,!1),Ge(this,lr,Hd(()=>{var i,o,a;const{element:l}=this;if((i=re(this,rn))==null||i.disconnect(),re(this,xr)||!re(this,nn)||!l.isConnected)return;const d=(o=l.ownerDocument)!=null?o:document,{innerHeight:c,innerWidth:u}=(a=d.defaultView)!=null?a:window,p=l.getBoundingClientRect(),g=jr(l,p),{top:v,left:C,bottom:b,right:k}=g,_=-Math.floor(v),x=-Math.floor(C),y=-Math.floor(u-k),j=-Math.floor(c-b),I=`${_}px ${y}px ${j}px ${x}px`;this.boundingClientRect=p,nt(this,rn,new IntersectionObserver(D=>{const[m]=D,{intersectionRect:E}=m;(m.intersectionRatio!==1?m.intersectionRatio:_t.intersectionRatio(E,jr(l)))!==1&&re(this,lr).call(this)},{threshold:il,rootMargin:I,root:d})),re(this,rn).observe(l),Ld(this,Rs,Vd).call(this)},Ud)),this.boundingClientRect=e.getBoundingClientRect(),nt(this,nn,Rh(e,this.boundingClientRect));let r=!0;this.callback=i=>{r&&(r=!1,n.skipInitial)||t(i)};const s=e.ownerDocument;n!=null&&n.debug&&(nt(this,Re,document.createElement("div")),re(this,Re).style.background="rgba(0,0,0,0.15)",re(this,Re).style.position="fixed",re(this,Re).style.pointerEvents="none",s.body.appendChild(re(this,Re))),nt(this,ar,new IntersectionObserver(i=>{var o,a;const l=i[i.length-1],{boundingClientRect:d,isIntersecting:c}=l,{width:u,height:p}=d,g=re(this,nn);nt(this,nn,c),!(!u&&!p)&&(g&&!c?((o=re(this,rn))==null||o.disconnect(),this.callback(null),(a=re(this,Bt))==null||a.disconnect(),nt(this,Bt,void 0),re(this,Re)&&(re(this,Re).style.visibility="hidden")):re(this,lr).call(this),c&&!re(this,Bt)&&(nt(this,Bt,new zh(re(this,lr))),re(this,Bt).observe(e)))},{threshold:il,root:s})),re(this,nn)&&!n.skipInitial&&this.callback(this.boundingClientRect),re(this,ar).observe(e)}};nn=new WeakMap;$s=new WeakMap;Bt=new WeakMap;rn=new WeakMap;ar=new WeakMap;Re=new WeakMap;
1xr=new WeakMap;lr=new WeakMap;Rs=new WeakSet;Vd=function(){re(this,xr)||(Ld(this,Rs,Zd).call(this),!$h(this.boundingClientRect,re(this,$s))&&(this.callback(this.boundingClientRect),nt(this,$s,this.boundingClientRect)))};Zd=function(){if(re(this,Re)){const{top:e,left:t,width:n,height:r}=jr(this.element);re(this,Re).style.overflow="hidden",re(this,Re).style.visibility="visible",re(this,Re).style.top=`${Math.floor(e)}px`,re(this,Re).style.left=`${Math.floor(t)}px`,re(this,Re).style.width=`${Math.floor(n)}px`,re(this,Re).style.height=`${Math.floor(r)}px`}};var es=new WeakMap,ts=new WeakMap;function Fh(e,t){let n=es.get(e);return n||(n={disconnect:new Yd(e,s=>{const i=es.get(e);i&&i.callbacks.forEach(o=>o(s))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),es.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(es.delete(e),n.disconnect())}}function Bh(e,t){const n=new Set;for(const r of e){const s=Fh(r,t);n.add(s)}return()=>n.forEach(r=>r())}function Wh(e,t){var n;const r=e.ownerDocument;if(!ts.has(r)){const o=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(d=>d(l)),{capture:!0,passive:!0,signal:o.signal}),ts.set(r,{disconnect:()=>o.abort(),listeners:a})}const{listeners:s,disconnect:i}=(n=ts.get(r))!=null?n:{};return!s||!i?()=>{}:(s.add(t),()=>{s.delete(t),s.size===0&&(i(),ts.delete(r))})}var cr,dr,_s,Ki,Hh=class{constructor(e,t,n){this.callback=t,Ge(this,cr),Ge(this,dr,!1),Ge(this,_s),Ge(this,Ki,Hd(o=>{if(!re(this,dr)&&o.target&&"contains"in o.target&&typeof o.target.contains=="function"){for(const a of re(this,_s))if(o.target.contains(a)){this.callback(re(this,cr).boundingClientRect);break}}},Ud));const r=Th(e),s=Bh(r,t),i=Wh(e,re(this,Ki));nt(this,_s,r),nt(this,cr,new Yd(e,t,n)),this.disconnect=()=>{re(this,dr)||(nt(this,dr,!0),s(),i(),re(this,cr).disconnect())}}};cr=new WeakMap;dr=new WeakMap;_s=new WeakMap;Ki=new WeakMap;function Gi(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function ur(e){try{Gi(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function ol(e){return!Rd||!e?!1:e===Ct(e).scrollingElement}function qd(e){const t=Lt(e),n=ol(e)?Ph(e):ti(e),r=ol(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}},i=s.current.y<=0,o=s.current.x<=0,a=s.current.y>=s.max.y,l=s.current.x>=s.max.x;return{rect:n,position:s,isTop:i,isLeft:o,isBottom:a,isRight:l}}function Uh(e,t){const{isTop:n,isBottom:r,isLeft:s,isRight:i,position:o}=qd(e),{x:a,y:l}=t??{x:0,y:0},d=!n&&o.current.y+l>0,c=!r&&o.current.y+l<o.max.y,u=!s&&o.current.x+a>0,p=!i&&o.current.x+a<o.max.x;return{top:d,bottom:c,left:u,right:p,x:u||p,y:d||c}}var fa=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))}},Ns=new fa(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),Vh=new fa(e=>setTimeout(e,50)),zs=new Map,Zh=zs.clear.bind(zs);function xt(e,t=!1){if(!t)return al(e);let n=zs.get(e);return n||(n=al(e),zs.set(e,n),Vh.schedule(Zh),n)}function al(e){return Lt(e).getComputedStyle(e)}function Yh(e,t=xt(e,!0)){return t.position==="fixed"||t.position==="sticky"}function qh(e,t=xt(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}var Xh={excludeElement:!0};function Ji(e,t=Xh){const{limit:n,excludeElement:r}=t,s=new Set;function i(o){if(n!=null&&s.size>=n||!o)return s;if(Nd(o)&&o.scrollingElement!=null&&!s.has(o.scrollingElement))return s.add(o.scrollingElement),s;if(!un(o))return zd(o)?i(o.parentElement):s;if(s.has(o))return s;const a=xt(o,!0);if(r&&o===e||qh(o,a)&&s.add(o),Yh(o,a)){const{scrollingElement:l}=o.ownerDocument;return l&&s.add(l),s}return i(o.parentNode)}return e?i(e):s}function Kh(e){const[t]=Ji(e,{limit:1});return t??null}function Tn(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=Mn(e);for(;r;){if(r===t)return n;const s=ti(r),{x:i,y:o}=Gh(r,s);n.x=n.x+s.left,n.y=n.y+s.top,n.scaleX=n.scaleX*i,n.scaleY=n.scaleY*o,r=Mn(r)}return n}function Gh(e,t=ti(e)){const n=Math.round(t.width),r=Math.round(t.height);if(un(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const s=xt(e,!0);return{x:(parseFloat(s.width)||n)/n,y:(parseFloat(s.height)||r)/r}}function Jh(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 Cr(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}}
1function pa(e){var t,n,r,s,i,o,a,l,d;const{scale:c,transform:u,translate:p}=e,g=Jh(c),v=Cr(p),C=Qh(u);if(!C&&!g&&!v)return null;const b={x:(t=g==null?void 0:g.x)!=null?t:1,y:(n=g==null?void 0:g.y)!=null?n:1},k={x:(r=v==null?void 0:v.x)!=null?r:0,y:(s=v==null?void 0:v.y)!=null?s:0},_={x:(i=C==null?void 0:C.x)!=null?i:0,y:(o=C==null?void 0:C.y)!=null?o:0,scaleX:(a=C==null?void 0:C.scaleX)!=null?a:1,scaleY:(l=C==null?void 0:C.scaleY)!=null?l:1};return{x:k.x+_.x,y:k.y+_.y,z:(d=v==null?void 0:v.z)!=null?d:0,scaleX:b.x*_.scaleX,scaleY:b.y*_.scaleY}}function Qh(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 dt=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(dt||{}),eg={x:.2,y:.2},tg={x:10,y:10};function ng(e,t,n,r=25,s=eg,i=tg){const{x:o,y:a}=t,{rect:l,isTop:d,isBottom:c,isLeft:u,isRight:p}=qd(e),g=Tn(e),v=xt(e,!0),C=pa(v),b=C!==null?(C==null?void 0:C.scaleX)<0:!1,k=C!==null?(C==null?void 0:C.scaleY)<0:!1,_=new _t(l.left*g.scaleX+g.x,l.top*g.scaleY+g.y,l.width*g.scaleX,l.height*g.scaleY),x={x:0,y:0},y={x:0,y:0},j={height:_.height*s.y,width:_.width*s.x};return(!d||k&&!c)&&a<=_.top+j.height&&(n==null?void 0:n.y)!==1&&o>=_.left-i.x&&o<=_.right+i.x?(x.y=k?1:-1,y.y=r*Math.abs((_.top+j.height-a)/j.height)):(!c||k&&!d)&&a>=_.bottom-j.height&&(n==null?void 0:n.y)!==-1&&o>=_.left-i.x&&o<=_.right+i.x&&(x.y=k?-1:1,y.y=r*Math.abs((_.bottom-j.height-a)/j.height)),(!p||b&&!u)&&o>=_.right-j.width&&(n==null?void 0:n.x)!==-1&&a>=_.top-i.y&&a<=_.bottom+i.y?(x.x=b?-1:1,y.x=r*Math.abs((_.right-j.width-o)/j.width)):(!u||b&&!p)&&o<=_.left+j.width&&(n==null?void 0:n.x)!==1&&a>=_.top-i.y&&a<=_.bottom+i.y&&(x.x=b?1:-1,y.x=r*Math.abs((_.left+j.width-o)/j.width)),{direction:x,speed:y}}function rg(e){return"scrollIntoViewIfNeeded"in e&&typeof e.scrollIntoViewIfNeeded=="function"}function Xd(e,t=!1){if(rg(e)){e.scrollIntoViewIfNeeded(t);return}if(!un(e))return e.scrollIntoView();var n=Kh(e);if(!un(n))return;const r=xt(n,!0),s=parseInt(r.getPropertyValue("border-top-width")),i=parseInt(r.getPropertyValue("border-left-width")),o=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,d=e.offsetLeft-n.offsetLeft+e.clientWidth-i>n.scrollLeft+n.clientWidth,c=o&&!a;(o||a)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-s+e.clientHeight/2),(l||d)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-i+e.clientWidth/2),(o||a||l||d)&&!t&&e.scrollIntoView(c)}function sg(e,t,n){const{scaleX:r,scaleY:s,x:i,y:o}=t,a=e.left+i+(1-r)*parseFloat(n),l=e.top+o+(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width*r:e.width,c=s?e.height*s:e.height;return{width:d,height:c,top:l,right:a+d,bottom:l+c,left:a}}function ig(e,t,n){const{scaleX:r,scaleY:s,x:i,y:o}=t,a=e.left-i-(1-r)*parseFloat(n),l=e.top-o-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,c=s?e.height/s:e.height;return{width:d,height:c,top:l,right:a+d,bottom:l+c,left:a}}function Kd({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function ll(e,t=xt(e).translate,n=!0){if(n){const r=$d(e,s=>"translate"in s);if(r){const{translate:s=""}=r[0];if(typeof s=="string"){const i=Cr(s);if(i)return i}}}if(t){const r=Cr(t);if(r)return r}return{x:0,y:0,z:0}}var og=new fa(e=>setTimeout(e,0)),wr=new Map,ag=wr.clear.bind(wr);function lg(e){const t=e.ownerDocument;let n=wr.get(t);if(n)return n;n=t.getAnimations(),wr.set(t,n),og.schedule(ag);const r=n.filter(s=>ei(s.effect)&&s.effect.target===e);return wr.set(e,r),n}function cg(e,t){const n=lg(e).filter(r=>{var s,i;if(ei(r.effect)){const{target:o}=r.effect;if((i=o&&((s=t.isValidTarget)==null?void 0:s.call(t,o)))!=null?i:!0)return r.effect.getKeyframes().some(l=>{for(const d of t.properties)if(l[d])return!0})}}).map(r=>{const{effect:s,currentTime:i}=r,o=s==null?void 0:s.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof o=="number"&&typeof i=="number"&&i<o)return r.currentTime=o,()=>{r.currentTime=i}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var pt=class extends _t{constructor(e,t={}){var n,r,s,i;const{frameTransform:o=Tn(e),ignoreTransforms:a,getBoundingClientRect:l=ti}=t,d=cg(e,{properties:["transform","translate","scale","width","height"],isValidTarget:j=>(j!==e||Fd())&&j.contains(e)}),c=l(e);let{top:u,left:p,width:g,height:v}=c,C;const b=xt(e),k=pa(b),_={x:(n=k==null?void 0:k.scaleX)!=null?n:1,y:(r=k==null?void 0:k.scaleY)!=null?r:1},x=dg(e,b);d==null||d(),k&&(C=ig(c,k,b.transformOrigin),(a||x)&&(u=C.top,p=C.left,g=C.width,v=C.height));const y={width:(s=C==null?void 0:C.width)!=null?s:g,height:(i=C==null?void 0:C.height)!=null?i:v};if(x&&!a&&C){const j=sg(C,x,b.transformOrigin);u=j.top,p=j.left,g=j.width,v=j.height,_.x=x.scaleX,_.y=x.scaleY}o&&(a||(p*=o.scaleX,g*=o.scaleX,u*=o.scaleY,v*=o.scaleY),p+=o.x,u
1+=o.y),super(p,u,g,v),this.scale=_,this.intrinsicWidth=y.width,this.intrinsicHeight=y.height}};function dg(e,t){var n;const r=e.getAnimations();let s=null;if(!r.length)return null;for(const i of r){if(i.playState!=="running")continue;const o=ei(i.effect)?i.effect.getKeyframes():[],a=o[o.length-1];if(!a)continue;const{transform:l,translate:d,scale:c}=a;if(l||d||c){const u=pa({transform:typeof l=="string"&&l?l:t.transform,translate:typeof d=="string"&&d?d:t.translate,scale:typeof c=="string"&&c?c:t.scale});u&&(s=s?{x:s.x+u.x,y:s.y+u.y,z:(n=s.z)!=null?n:u.z,scaleX:s.scaleX*u.scaleX,scaleY:s.scaleY*u.scaleY}:u)}}return s}function Sr(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 ug=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(Sr(n))for(const[r,s]of Object.entries(e)){const i=`${t}${r}`;this.initial.has(i)||this.initial.set(i,n.style.getPropertyValue(i)),n.style.setProperty(i,typeof s=="string"?s:`${s}px`)}}remove(e,t=""){const{element:n}=this;if(Sr(n))for(const r of e){const s=`${t}${r}`;n.style.removeProperty(s)}}reset(){const{element:e}=this;if(Sr(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function Wn(e){return e?e instanceof Lt(e).Element||ua(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function Pr(e){if(!e)return!1;const{KeyboardEvent:t}=Lt(e.target);return e instanceof t}function fg(e){if(!e)return!1;const{PointerEvent:t}=Lt(e.target);return e instanceof t}function pg(e){if(!Wn(e))return!1;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||hg(e)}function hg(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var yi={};function Qi(e){const t=yi[e]==null?0:yi[e]+1;return yi[e]=t,`${e}-${t}`}var gg=({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=Ze.distance(t.shape.center,n);return{id:r,value:1/s,type:Pt.PointerIntersection,priority:ct.High}}return null},vg=({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,i=Ze.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/i;return{id:t.id,value:a,type:Pt.ShapeIntersection,priority:ct.Normal}}return null},Gd=e=>{var t;return(t=gg(e))!=null?t:vg(e)},mg=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const i=r?_t.from(r.current.boundingRectangle).corners:void 0,a=_t.from(n.shape.boundingRectangle).corners.reduce((l,d,c)=>{var u;return l+Ze.distance(Ze.from(d),(u=i==null?void 0:i[c])!=null?u:s.current)},0)/4;return{id:n.id,value:1/a,type:Pt.Collision,priority:ct.Normal}},yg=Object.create,ha=Object.defineProperty,bg=Object.defineProperties,_g=Object.getOwnPropertyDescriptor,xg=Object.getOwnPropertyDescriptors,Fs=Object.getOwnPropertySymbols,Jd=Object.prototype.hasOwnProperty,Qd=Object.prototype.propertyIsEnumerable,eu=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Hn=e=>{throw TypeError(e)},eo=(e,t,n)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dr=(e,t)=>{for(var n in t||(t={}))Jd.call(t,n)&&eo(e,n,t[n]);if(Fs)for(var n of Fs(t))Qd.call(t,n)&&eo(e,n,t[n]);return e},ga=(e,t)=>bg(e,xg(t)),cl=(e,t)=>ha(e,"name",{value:t,configurable:!0}),tu=(e,t)=>{var n={};for(var r in e)Jd.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fs)for(var r of Fs(e))t.indexOf(r)<0&&Qd.call(e,r)&&(n[r]=e[r]);return n},Ur=e=>{var t;return[,,,yg((t=e==null?void 0:e[eu("metadata")])!=null?t:null)]},nu=["class","method","getter","setter","accessor","field","value","get","set"],fr=e=>e!==void 0&&typeof e!="function"?Hn("Function expected"):e,wg=(e,t,n,r,s)=>({kind:nu[e],name:t,metadata:r,addInitializer:i=>n._?Hn("Already initialized"):s.push(fr(i||null))}),Un=(e,t)=>eo(t,eu("metadata"),e[3]),Te=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)t&1?i[s].call(n):r=i[s].call(n,r);return r},$t=(e,t,n,r,s,i)=>{var o,a,l,d,c,u=t&7,p=!!(t&8),g=!!(t&16),v=u>3?e.length+1:u?p?1:2:0,C=nu[u+5],b=u>3&&(e[v-1]=[]),k=e[v]||(e[v]=[]),_=u&&(!g&&!p&&(s=s.prototype),u<5&&(u>3||!g)&&_g(u<4?s:{get[n](){return ze(this,i)},set[n](y){return mt(this,i,y)}},n));u?g&&u<4&&cl(i,(u>2?"set ":u>1?"get ":"")+n):cl(s,n);for(var x=r.length-1;x>=0;x--)d=wg(u,n,l={}
1,e[3],k),u&&(d.static=p,d.private=g,c=d.access={has:g?y=>Sg(s,y):y=>n in y},u^3&&(c.get=g?y=>(u^1?ze:to)(y,s,u^4?i:_.get):y=>y[n]),u>2&&(c.set=g?(y,j)=>mt(y,s,j,u^4?i:_.set):(y,j)=>y[n]=j)),a=(0,r[x])(u?u<4?g?i:_[C]:u>4?void 0:{get:_.get,set:_.set}:s,d),l._=1,u^4||a===void 0?fr(a)&&(u>4?b.unshift(a):u?g?i=a:_[C]=a:s=a):typeof a!="object"||a===null?Hn("Object expected"):(fr(o=a.get)&&(_.get=o),fr(o=a.set)&&(_.set=o),fr(o=a.init)&&b.unshift(o));return u||Un(e,s),_&&ha(s,n,_),g?u^4?i:_:s},va=(e,t,n)=>t.has(e)||Hn("Cannot "+n),Sg=(e,t)=>Object(t)!==t?Hn('Cannot use the "in" operator on this value'):e.has(t),ze=(e,t,n)=>(va(e,t,"read from private field"),n?n.call(e):t.get(e)),Fe=(e,t,n)=>t.has(e)?Hn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),mt=(e,t,n,r)=>(va(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),to=(e,t,n)=>(va(e,t,"access private method"),n),dl={role:"button",roleDescription:"draggable"},Ig="dnd-kit-description",kg="dnd-kit-announcement",Eg={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."},jg={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 Cg(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function Pg(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function Dg(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 Og=["dragover","dragmove"],Ag=class extends We{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=Ig,announcement:s=kg}={},announcements:i=jg,screenReaderInstructions:o=Eg,debounce:a=500}=t??{},l=n?`${r}-${n}`:Qi(r),d=n?`${s}-${n}`:Qi(s);let c,u,p,g;const v=(j=g)=>{!p||!j||(p==null?void 0:p.nodeValue)!==j&&(p.nodeValue=j)},C=()=>Ns.schedule(v),b=Mg(C,a),k=Object.entries(i).map(([j,I])=>this.manager.monitor.addEventListener(j,(D,m)=>{const E=p;if(!E)return;const h=I==null?void 0:I(D,m);h&&E.nodeValue!==h&&(g=h,Og.includes(j)?b():(C(),b.cancel()))})),_=()=>{let j=[];c!=null&&c.isConnected||(c=Pg(l,o.draggable),j.push(c)),u!=null&&u.isConnected||(u=Dg(d),p=document.createTextNode(""),u.appendChild(p),j.push(u)),j.length>0&&document.body.append(...j)},x=new Set;function y(){for(const j of x)j()}this.registerEffect(()=>{var j;x.clear();for(const I of this.manager.registry.draggables.value){const D=(j=I.handle)!=null?j:I.element;if(D){(!c||!u)&&x.add(_),(!Cg(D)||Fd())&&!D.hasAttribute("tabindex")&&x.add(()=>D.setAttribute("tabindex","0")),!D.hasAttribute("role")&&D.tagName.toLowerCase()!=="button"&&x.add(()=>D.setAttribute("role",dl.role)),D.hasAttribute("aria-roledescription")||x.add(()=>D.setAttribute("aria-roledescription",dl.roleDescription)),D.hasAttribute("aria-describedby")||x.add(()=>D.setAttribute("aria-describedby",l));for(const E of["aria-pressed","aria-grabbed"]){const h=String(I.isDragging);D.getAttribute(E)!==h&&x.add(()=>D.setAttribute(E,h))}const m=String(I.disabled);D.getAttribute("aria-disabled")!==m&&x.add(()=>D.setAttribute("aria-disabled",m))}}x.size>0&&Ns.schedule(y)}),this.destroy=()=>{super.destroy(),c==null||c.remove(),u==null||u.remove(),k.forEac
1h(j=>j())}}};function Mg(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var Tg=class extends We{constructor(e,t){super(e,t),this.manager=e;const n=Ts(()=>{var r;return Ct((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=Qe(()=>{var r;const{dragOperation:s}=this.manager,{cursor:i="grabbing",nonce:o}=(r=this.options)!=null?r:{};if(s.status.initialized){const a=n.value,l=a.createElement("style");return o&&l.setAttribute("nonce",o),l.textContent=`* { cursor: ${i} !important; }`,a.head.appendChild(l),()=>l.remove()}})}},Vr="data-dnd-",no=`${Vr}dropping`,Ue="--dnd-",kt=`${Vr}dragging`,Bs=`${Vr}placeholder`,Lg=[kt,Bs,"popover","aria-pressed","aria-grabbing"],$g=["view-transition-name"],Rg=`
2  :root [${kt}] {
3    position: fixed !important;
4    pointer-events: none !important;
5    touch-action: none;
6    z-index: calc(infinity);
7    will-change: translate;
8    top: var(${Ue}top, 0px) !important;
9    left: var(${Ue}left, 0px) !important;
10    right: unset !important;
11    bottom: unset !important;
12    width: var(${Ue}width, auto);
13    max-width: var(${Ue}width, auto);
14    height: var(${Ue}height, auto);
15    max-height: var(${Ue}height, auto);
16    transition: var(${Ue}transition) !important;
17  }
18
19  :root [${Bs}] {
20    transition: none;
21  }
22
23  :root [${Bs}='hidden'] {
24    visibility: hidden;
25  }
26
27  [${kt}] * {
28    pointer-events: none !important;
29  }
30
31  [${kt}]:not([${no}]) {
32    translate: var(${Ue}translate) !important;
33  }
34
35  [${kt}][style*='${Ue}scale'] {
36    scale: var(${Ue}scale) !important;
37    transform-origin: var(${Ue}transform-origin) !important;
38  }
39
40  @layer {
41    :where([${kt}][popover]) {
42      overflow: visible;
43      background: unset;
44      border: unset;
45      margin: unset;
46      padding: unset;
47      color: inherit;
48
49      &:is(input, button) {
50        border: revert;
51        background: revert;
52      }
53    }
54  }
55  [${kt}]::backdrop, [${Vr}overlay]:not([${kt}]) {
56    display: none;
57    visibility: hidden;
58  }
59`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Ng(e,t="hidden"){return de(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const s=zg(n,r.registry.droppables),i=[],o=Ah(n),{remove:a}=o;return Fg(s,o,i),Bg(o,t),o.remove=()=>{i.forEach(l=>l()),a.call(o)},o})}function zg(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const s=`${Vr}${Qi("dom-id")}`;r.element.setAttribute(s,""),n.set(r,s)}return n}function Fg(e,t,n){for(const[r,s]of e){if(!r.element)continue;const i=`[${s}]`,o=t.matches(i)?t:t.querySelector(i);if(r.element.removeAttribute(s),!o)continue;const a=r.element;r.proxy=o,o.removeAttribute(s),Xi.set(a,o),n.push(()=>{Xi.delete(a),r.proxy=void 0})}}function Bg(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(Bs,t)}function ul(e,t){return e===t?!0:Mn(e)===Mn(t)}function fl(e){const{target:t}=e;"newState"in e&&e.newState==="closed"&&Wn(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>ur(t))}function pl(e){return e.tagName==="TR"}var Ws=new Map,ru,ro,Or,ma,xs,su,iu,Ar=class extends(ro=We,ru=[ae],ro){constructor(t,n){super(t,n),Fe(this,xs),Fe(this,ma,Te(Or,8,this)),Te(Or,11,this),this.state={initial:{},current:{}},this.registerEffect(to(this,xs,iu)),this.registerEffect(to(this,xs,su))}destroy(){super.destroy();for(const[t,n]of Ws.entries())n.instances.has(this)&&(n.instances.delete(this),n.instances.size===0&&(n.cleanup(),Ws.delete(t)))}};Or=Ur(ro);ma=new WeakMap;xs=new WeakSet;su=function(){var e,t,n;const{state:r,manager:s,options:i}=this,{dragOperation:o}=s,{position:a,source:l,status:d}=o;if(d.idle){r.current={},r.initial={};return}if(!l)return;const{element:c,feedback:u}=l;if(!c||u==="none"||!d.initialized||d.initializing)return;const{initial:p}=r,g=(e=this.overlay)!=null?e:c,v=Tn(g),C=Tn(c),b=!ul(c,g),k=new pt(c,{frameTransform:b?C:null,ignoreTransforms:!b}),_={x:C.scaleX/v.scaleX,y:C.scaleY/v.scaleY};let{width:x,height:y,top:j,left:I}=k;b&&(x=x/_.x,y=y/_.y);let D,m;const E=new ug(g),{transition:h,translate:A,boxSizing:T,paddingBlockStart:R,paddingBlockEnd:N,paddingInlineStart:U,paddingInlineEnd:z,borderInlineStartWidth:K,borderInlineEndWidth:V,borderBlockStartWidth:X,borderBlockEndWidth:G}=xt(c),q=u==="clone",te=T==="content-box",ce=te?parseInt(U)+parseInt(z)+parseInt(K)+parseInt(V):0,Ie=te?parseInt(R)+parseInt(N)+parseInt(X)+parseInt(G):0,se=u!=="move"&&!this.overlay?Ng(l,q?"clone"
59:"hidden"):null,Ee=de(()=>Pr(s.dragOperation.activatorEvent));if(A!=="none"){const oe=Cr(A);oe&&!p.translate&&(p.translate=oe)}if(!p.transformOrigin){const oe=de(()=>a.current);p.transformOrigin={x:(oe.x-I*v.scaleX-v.x)/(x*v.scaleX),y:(oe.y-j*v.scaleY-v.y)/(y*v.scaleY)}}const{transformOrigin:De}=p,Z=j*v.scaleY+v.y,w=I*v.scaleX+v.x;if(!p.coordinates&&(p.coordinates={x:w,y:Z},_.x!==1||_.y!==1)){const{scaleX:oe,scaleY:H}=C,{x:J,y:Q}=De;p.coordinates.x+=(x*oe-x)*J,p.coordinates.y+=(y*H-y)*Q}p.dimensions||(p.dimensions={width:x,height:y}),p.frameTransform||(p.frameTransform=v);const O={x:p.coordinates.x-w,y:p.coordinates.y-Z},L={width:(p.dimensions.width*p.frameTransform.scaleX-x*v.scaleX)*De.x,height:(p.dimensions.height*p.frameTransform.scaleY-y*v.scaleY)*De.y},B={x:O.x/v.scaleX+L.width,y:O.y/v.scaleY+L.height},W={left:I+B.x,top:j+B.y};g.setAttribute(kt,"true");const Y=de(()=>o.transform),ee=(t=p.translate)!=null?t:{x:0,y:0},he=Y.x*v.scaleX+ee.x,_e=Y.y*v.scaleY+ee.y,Oe=`${he}px ${_e}px 0`,Ae=h?`${h}, translate 0ms linear`:"";E.set({width:x-ce,height:y-Ie,top:W.top,left:W.left,translate:Oe,transition:Ae,scale:b?`${_.x} ${_.y}`:"","transform-origin":`${De.x*100}% ${De.y*100}%`},Ue),se&&(c.insertAdjacentElement("afterend",se),i!=null&&i.rootElement&&(typeof i.rootElement=="function"?i.rootElement(l):i.rootElement).appendChild(c)),Gi(g)&&(g.hasAttribute("popover")||g.setAttribute("popover","manual"),ur(g),g.addEventListener("beforetoggle",fl));const je=new ResizeObserver(()=>{if(!se)return;const oe=new pt(se,{frameTransform:v,ignoreTransforms:!0}),H=De??{x:1,y:1},J=(x-oe.width)*H.x+B.x,Q=(y-oe.height)*H.y+B.y;if(E.set({width:oe.width-ce,height:oe.height-Ie,top:j+Q,left:I+J},Ue),D==null||D.takeRecords(),pl(c)&&pl(se)){const ue=Array.from(c.cells),me=Array.from(se.cells);for(const[we,Le]of ue.entries()){const Ke=me[we];Le.style.width=`${Ke.offsetWidth}px`}}o.shape=new pt(g)}),xe=new pt(g);de(()=>o.shape=xe);const ve=Lt(g),ot=oe=>{this.manager.actions.stop({event:oe})};Ee&&ve.addEventListener("resize",ot),de(()=>l.status)==="idle"&&requestAnimationFrame(()=>l.status="dragging"),se&&(je.observe(se),D=new MutationObserver(oe=>{let H=!1;for(const J of oe){if(J.target!==c){H=!0;continue}if(J.type!=="attributes")continue;const Q=J.attributeName;if(Q.startsWith("aria-")||Lg.includes(Q))continue;const ue=c.getAttribute(Q);if(Q==="style"){if(Sr(c)&&Sr(se)){const me=c.style;for(const we of Array.from(se.style))me.getPropertyValue(we)===""&&se.style.removeProperty(we);for(const we of Array.from(me)){if($g.includes(we)||we.startsWith(Ue))continue;const Le=me.getPropertyValue(we);se.style.setProperty(we,Le)}}}else ue!==null?se.setAttribute(Q,ue):se.removeAttribute(Q)}H&&q&&(se.innerHTML=c.innerHTML)}),D.observe(c,{attributes:!0,subtree:!0,childList:!0}),m=new MutationObserver(oe=>{for(const H of oe)if(H.addedNodes.length!==0)for(const J of Array.from(H.addedNodes)){if(J.contains(c)&&c.nextElementSibling!==se){c.insertAdjacentElement("afterend",se),ur(g);return}if(J.contains(se)&&se.previousElementSibling!==c){se.insertAdjacentElement("beforebegin",c),ur(g);return}}}),m.observe(c.ownerDocument.body,{childList:!0,subtree:!0}));const Rt=(n=s.dragOperation.source)==null?void 0:n.id,Kr=()=>{var oe;if(!Ee||Rt==null)return;const H=s.registry.draggables.get(Rt),J=(oe=H==null?void 0:H.handle)!=null?oe:H==null?void 0:H.element;un(J)&&J.focus()},Xn=()=>{D==null||D.disconnect(),m==null||m.disconnect(),je.disconnect(),ve.removeEventListener("resize",ot),Gi(g)&&(g.removeEventListener("beforetoggle",fl),g.removeAttribute("popover")),g.removeAttribute(kt),E.reset(),l.status="idle";const oe=r.current.translate!=null;se&&(oe||se.parentElement!==g.parentElement)&&g.isConnected&&se.replaceWith(g),se==null||se.remove()},ai=Wr(()=>{var oe;const{transform:H,status:J}=o;if(!(!H.x&&!H.y&&!r.current.translate)&&J.dragging){const Q=(oe=p.translate)!=null?oe:{x:0,y:0},ue={x:H.x/v.scaleX+Q.x,y:H.y/v.scaleY+Q.y},me=r.current.translate,we=de(()=>o.modifiers),Le=de(()=>{var tt;return(tt=o.shape)==null?void 0:tt.current}),Ke=Ee?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(E.set({transition:`${h}, translate ${Ke}`,translate:`${ue.x}px ${ue.y}px 0`},Ue),D==null||D.takeRecords(),Le&&Le!==xe&&me&&!we.length){const tt=Ze.delta(ue,me);o.shape=_t.from(Le.boundingRectangle).translate(tt.x*v.scaleX,tt.y*v.scaleY)}else o.shape=new pt(g);r.current.translate=ue}},function(){if(o.status.dropped){this.dispose(),l.status="dropping";let oe=r.current.translate;const H=oe!=null;if(!oe&&c!==g&&(oe={x:0,y:0}),!oe){Xn();return}const J=()=>{var Q,ue;{ur(g);const[,me]=(Q=$d(g,Wf=>"translate"in Wf))!=null?Q:[];me==null||me.pause();const we=se??c,Le={frameTransform:ul(g,we)?null:void 0},Ke=new pt(g,Le),tt=(ue=Cr(xt(g).translate))!=null?ue:oe,St=new pt(we,Le),Kn=_t.delta(Ke,St,l.alignment),li={x:tt.x-Kn.x,y:tt.y-Kn.y},Ff=Math.round(Ke.intrinsicHeight)!==Math.round(St.intrinsicHeight)?{minHeight:[`${Ke.intrinsicHeight}px`,`${St.intrinsicHeight}px`],maxHeight:[`${Ke.intrinsicHeight}px`,`${St.intrinsicHeight}px`]}:{},Bf=Math.round(Ke.intrinsicWidth)!==Math.round(St.intrinsicWidth)?{minWidth:[`${Ke.intrinsicWidth}px`,`${St.intrinsicWidth}px`],maxWidth:[`${Ke.intrinsicWidth}px`,`${St.intrinsicWidth}px`]}:{};E.set({transition:h},Ue),g.setAttribute(no,""),D==null||D.takeRecords(),Kd({element:g,keyframes:ga(Dr(Dr({},Ff),Bf),{translate:[`${tt.x}px ${tt.y}px 0`,`${li.x}px ${li.y}px 0`]}),options:{duration:H||g!==c?250:0,easing:"ease"}}).then(()=>{g.removeAttribute(no),me==null||me.finish(),Xn(),requestAnimationFrame(Kr)})}};s.renderer.rendering.then(J)}});return()=>{Xn(),ai()}};iu=function(){var e,t,n;const{status:r,source:s,target:i}=this.manager.dragOperation,{nonce:o}=(e=this.options)!=null?e:{};if(r.initializing){const a=Ct((t=s==null?void 0:s.element)!=null?t:null),l=Ct((n=i==null?void 0:i.element)!=null?n:null),d=new Set([a,l]);for(const c of d){let u=Ws.get(c);if(!u){const p=document.createElement("style");p.textContent=Rg,o&&p.setAttribute("nonce",o),c.head.prepend(p);const g=new MutationObserver(v=>{for(const C of v)if(C.type==="childList"){const b=Array.from(C.removedNodes
59);b.length>0&&b.includes(p)&&c.head.prepend(p)}});g.observe(c.head,{childList:!0}),u={cleanup:()=>{g.disconnect(),p.remove()},instances:new Set},Ws.set(c,u)}u.instances.add(this)}}};$t(Or,4,"overlay",ru,Ar,ma);Un(Or,Ar);Ar.configure=Wo(Ar);var Wg=Ar,Gn=!0,Hg=!1,ou,au,lu,cu,Zt,ya,ba;cu=(lu=[ae],dt.Forward),au=(ou=[ae],dt.Reverse);var Mr=class{constructor(){Fe(this,ya,Te(Zt,8,this,Gn)),Te(Zt,11,this),Fe(this,ba,Te(Zt,12,this,Gn)),Te(Zt,15,this)}isLocked(e){return e===dt.Idle?!1:e==null?this[dt.Forward]===Gn&&this[dt.Reverse]===Gn:this[e]===Gn}unlock(e){e!==dt.Idle&&(this[e]=Hg)}};Zt=Ur(null);ya=new WeakMap;ba=new WeakMap;$t(Zt,4,cu,lu,Mr,ya);$t(Zt,4,au,ou,Mr,ba);Un(Zt,Mr);var Ug=[dt.Forward,dt.Reverse],hl=class{constructor(){this.x=new Mr,this.y=new Mr}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Vg=class extends We{constructor(e){super(e);const t=Br(new hl);let n=null;this.signal=t,Qe(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new hl;return}const{delta:s}=e.dragOperation.position;if(n){const i={x:gl(s.x,n.x),y:gl(s.y,n.y)},o=t.peek();ke(()=>{for(const a of Zc)for(const l of Ug)i[a]===l&&o[a].unlock(l);t.value=o})}n=s})}get current(){return this.signal.peek()}};function gl(e,t){return Math.sign(e-t)}var du,so,Tr,_a,Wt,io,Zr=class extends(so=Qs,du=[ae],so){constructor(e){super(e),Fe(this,_a,Te(Tr,8,this,!1)),Te(Tr,11,this),Fe(this,Wt),Fe(this,io,()=>{if(!ze(this,Wt))return;const{element:i,by:o}=ze(this,Wt);o.y&&(i.scrollTop+=o.y),o.x&&(i.scrollLeft+=o.x)}),this.scroll=i=>{var o;if(this.disabled)return!1;const a=this.getScrollableElements();if(!a)return mt(this,Wt,void 0),!1;const{position:l}=this.manager.dragOperation,d=l==null?void 0:l.current;if(d){const{by:c}=i??{},u=c?{x:vl(c.x),y:vl(c.y)}:void 0,p=u?void 0:this.scrollIntentTracker.current;if(p!=null&&p.isLocked())return!1;for(const g of a){const v=Uh(g,c);if(v.x||v.y){const{speed:C,direction:b}=ng(g,d,u);if(p)for(const k of Zc)p[k].isLocked(b[k])&&(C[k]=0,b[k]=0);if(b.x||b.y){const{x:k,y:_}=c??b,x=k*C.x,y=_*C.y;if(x||y){const j=(o=ze(this,Wt))==null?void 0:o.by;if(this.autoScrolling&&j&&(j.x&&!x||j.y&&!y))continue;return mt(this,Wt,{element:g,by:{x,y}}),Ns.schedule(ze(this,io)),!0}}}}}return mt(this,Wt,void 0),!1};let t=null,n=null;const r=Ts(()=>{const{position:i,source:o}=e.dragOperation;if(!i)return null;const a=Bd(Ct(o==null?void 0:o.element),i.current);return a&&(t=a),a??t}),s=Ts(()=>{const i=r.value,{documentElement:o}=Ct(i);if(!i||i===o){const{target:a}=e.dragOperation,l=a==null?void 0:a.element;if(l){const d=Ji(l,{excludeElement:!1});return n=d,d}}if(i){const a=Ji(i,{excludeElement:!1});return this.autoScrolling&&n&&a.size<(n==null?void 0:n.size)?n:(n=a,a)}return n=null,null},Mt);this.getScrollableElements=()=>s.value,this.scrollIntentTracker=new Vg(e),this.destroy=e.monitor.addEventListener("dragmove",i=>{this.disabled||i.defaultPrevented||!Pr(e.dragOperation.activatorEvent)||!i.by||this.scroll({by:i.by})&&i.preventDefault()})}};Tr=Ur(so);_a=new WeakMap;Wt=new WeakMap;io=new WeakMap;$t(Tr,4,"autoScrolling",du,Zr,_a);Un(Tr,Zr);function vl(e){return e>0?dt.Forward:e<0?dt.Reverse:dt.Idle}var Zg=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))}},Yg=new Zg(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),qg=10,xa=class extends We{constructor(e,t){super(e);const n=e.registry.plugins.get(Zr);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=Qe(()=>{if(this.disabled)return;const{position:r,status:s}=e.dragOperation;if(s.dragging)if(n.scroll()){n.autoScrolling=!0;const o=setInterval(()=>Yg.schedule(n.scroll),qg);return()=>{clearInterval(o)}}else n.autoScrolling=!1})}},ml={capture:!0,passive:!0},pr,Xg=class extends Qs{constructor(e){super(e),Fe(this,pr),this.handleScroll=()=>{ze(this,pr)==null&&mt(this,pr,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),mt(this,pr,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=Qe(()=>{var n,r,s;if(t.status.dragging){const o=(s=(r=(n=t.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?s:document;return o.addEventListener("scroll",this.handleScroll,ml),()=>{o.removeEventListener("scroll",this.handleScroll,ml)}}})}};pr=new WeakMap;var Kg=class extends We{constructor(e,t){super(e,t),this.manager=e,this.destroy=Qe(()=>{var n;const{dragOperation:r}=this.manager,{nonce:s}=(n=this.options)!=null?n:{};if(r.status.initialized){const i=document.createElement("style");return s&&i.setAttribute("nonce",s),i.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i),bi(),document.addEventListener("selectionchange",bi,{capture:!0}),()=>{document.removeEventListener("selectionchange",bi,{capture:!0}),i.remove()}}})}};function bi(){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}}),kn,Hs=class extends An{constructor(t,n){super(t),this.manager=t,this.options=n,Fe(this,kn,[]),this.listeners=new Wd,this.handleSourceKeyDown=(r,s,i)=>{if(this.disabled||r.defaultPrevented||!Wn(r.target)||s.disabled)return;const{keyboardCodes:o=hr.keyboardCodes,shouldActivate:a=hr.shouldActivate}=i??{};o.start.includes(r.code)&&this.manager.dragOperation.status.idle&&a({event:r,source:s,manager:this.manager})&&this.handleStart(r,s,i)}}bind(t,n=this.options){return Qe(()=>{var s;const i=(s=t.handle)!=null?s:t.element,o=a=>{Pr(a)&&this.handleSourceKeyDown(a,t,n)};if(i)return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}})}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(),Xd(s);const{center:i}=new pt(s);if(this.manager.actions.start({event:t,coordinates:{x:i.x,y:i.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const a=Ct(s),l=[this.listeners.bind(a,[{type:"keydown",listener:d=>this.handleKeyDown(d,n,r),options:{capture:!0}}])];ze(this,kn).push(...l)}handleKeyDown(t,n,r){const{keyboardCodes:s=hr.keyboardCodes}=r??{};if(mn(t,[...s.end,...s.cancel])){t.preventDefault();const i=mn(t,s.cancel);this.handleEnd(t,i);return}mn(t,s.up)?this.handleMove("up",t):mn(t,s.down)&&this.handleMove("down",t),mn(t,s.left)?this.handleMove("left",t):mn(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:i}=this.manager.dragOperation,o=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}),!!i){switch(t){case"up":a={x:0,y:-l.y*o};break;case"down":a={x:0,y:l.y*o};break;case"left":a={x:-l.x*o,y:0}
59;break;case"right":a={x:l.x*o,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(xa);(t==null?void 0:t.disabled)===!1&&(t.disable(),ze(this,kn).push(()=>{t.enable()}))}cleanup(){ze(this,kn).forEach(t=>t()),mt(this,kn,[])}destroy(){this.cleanup(),this.listeners.clear()}};kn=new WeakMap;Hs.configure=Wo(Hs);Hs.defaults=hr;var Gg=Hs;function mn(e,t){return t.includes(e.code)}var uu=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:s}=e;if(!(r==="mouse"&&Wn(s)&&(t.handle===s||(n=t.handle)!=null&&n.contains(s))))return r==="touch"?{delay:{value:250,tolerance:5}}:pg(s)&&!e.defaultPrevented?{delay:{value:200,tolerance:0}}:{delay:{value:200,tolerance:10},distance:{value:5}}}}),En,jn,Us=class extends An{constructor(t,n){super(t),this.manager=t,this.options=n,Fe(this,En,new Set),Fe(this,jn),this.listeners=new Wd,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=uu.activationConstraints}=(r=this.options)!=null?r:{};return typeof s=="function"?s(t,n):s}bind(t,n=this.options){return Qe(()=>{var s;const i=new AbortController,{signal:o}=i,a=d=>{fg(d)&&this.handlePointerDown(d,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 d of l)d&&(ev(d.ownerDocument.defaultView),d.addEventListener("pointerdown",a,{signal:o}));return()=>i.abort()})}handlePointerDown(t,n,r={}){if(this.disabled||!t.isPrimary||t.button!==0||!Wn(t.target)||n.disabled||Jg(t)||!this.manager.dragOperation.status.idle)return;const{target:s}=t,i=un(s)&&s.draggable&&s.getAttribute("draggable")==="true",o=Tn(n.element);this.initialCoordinates={x:t.clientX*o.scaleX+o.x,y:t.clientY*o.scaleY+o.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:u}=a;if(u){const p=setTimeout(()=>this.handleStart(n,t),u.value);mt(this,jn,()=>{clearTimeout(p),mt(this,jn,void 0)})}}const l=Ct(t.target),d=this.listeners.bind(l,[{type:"pointermove",listener:u=>this.handlePointerMove(u,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"dragstart",listener:i?this.handleCancel:ns,options:{capture:!0}}]),c=()=>{var u;d(),(u=ze(this,jn))==null||u.call(this),this.initialCoordinates=void 0};ze(this,En).add(c)}handlePointerMove(t,n){const r={x:t.clientX,y:t.clientY},s=Tn(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,Ns.schedule(this.handleMove);return}if(!this.initialCoordinates)return;const i={x:r.x-this.initialCoordinates.x,y:r.y-this.initialCoordinates.y},o=this.activationConstraints(t,n),{distance:a,delay:l}=o??{};if(a){if(a.tolerance!=null&&vi(i,a.tolerance))return this.handleCancel(t);if(vi(i,a.value))return this.handleStart(n,t)}if(l&&vi(i,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:i}=this;if((r=ze(this,jn))==null||r.call(this),!i||!s.dragOperation.status.idle||n.defaultPrevented)return;if(s.actions.start({coordinates:i,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();const a=Ct(n.target),l=a.body;l.setPointerCapture(n.pointerId);const d=this.listeners.bind(a,[{type:"touchmove",listener:ns,options:{passive:!1}},{type:"click",listener:ns},{type:"contextmenu",listener:ns},{type:"keydown",listener:this.handleKeyDown},{type:"lostpointercapture",listener:c=>{c.target===l&&this.handlePointerUp(c)}}]);ze(this,En).add(d)}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}
59,ze(this,En).forEach(t=>t()),ze(this,En).clear()}destroy(){this.cleanup(),this.listeners.clear()}};En=new WeakMap;jn=new WeakMap;Us.configure=Wo(Us);Us.defaults=uu;var fu=Us;function Jg(e){return"sensor"in e}function ns(e){e.preventDefault()}function Qg(){}var yl=new WeakSet;function ev(e){!e||yl.has(e)||(e.addEventListener("touchmove",Qg,{capture:!1,passive:!1}),yl.add(e))}var cn={modifiers:[],plugins:[Ag,xa,Tg,Wg,Kg],sensors:[fu,Gg]},pu=class extends Ch{constructor(e={}){const{plugins:t=cn.plugins,sensors:n=cn.sensors,modifiers:r=[]}=e;super(ga(Dr({},e),{plugins:[Xg,Zr,...t],sensors:n,modifiers:r}))}},hu,gu,vu,oo,ht,wa,Sa,Ia,Vn=class extends(oo=Et,vu=[ae],gu=[ae],hu=[ae],oo){constructor(e,t){var n=e,{element:r,effects:s=()=>[],handle:i,feedback:o="default"}=n,a=tu(n,["element","effects","handle","feedback"]);super(Dr({effects:()=>[...s(),()=>{var l,d;const{manager:c}=this;if(!c)return;const p=((d=(l=this.sensors)==null?void 0:l.map(Ho))!=null?d:[...c.sensors]).map(g=>{const v=g instanceof An?g:c.registry.register(g.plugin),C=g instanceof An?void 0:g.options;return v.bind(this,C)});return function(){p.forEach(v=>v())}}]},a),t),Fe(this,wa,Te(ht,8,this)),Te(ht,11,this),Fe(this,Sa,Te(ht,12,this)),Te(ht,15,this),Fe(this,Ia,Te(ht,16,this)),Te(ht,19,this),this.element=r,this.handle=i,this.feedback=o}};ht=Ur(oo);wa=new WeakMap;Sa=new WeakMap;Ia=new WeakMap;$t(ht,4,"handle",vu,Vn,wa);$t(ht,4,"element",gu,Vn,Sa);$t(ht,4,"feedback",hu,Vn,Ia);Un(ht,Vn);var mu,yu,ao,Yt,ka,_i,bu,_u,Ir,Ea,ni=class extends(ao=jt,yu=[ae],mu=[ae],ao){constructor(e,t){var n=e,{element:r,effects:s=()=>[]}=n,i=tu(n,["element","effects"]);const{collisionDetector:o=Gd}=i,a=d=>{const{manager:c,element:u}=this;if(!u||d===null){this.shape=void 0;return}if(!c)return;const p=new pt(u),g=de(()=>this.shape);return p&&(g!=null&&g.equals(p))?g:(this.shape=p,p)},l=Br(!1);super(ga(Dr({},i),{collisionDetector:o,effects:()=>[...s(),()=>{const{element:d,manager:c}=this;if(!c)return;const{dragOperation:u}=c,{source:p}=u;l.value=!!(p&&u.status.initialized&&d&&!this.disabled&&this.accepts(p))},()=>{const{element:d}=this;if(l.value&&d){const c=new Hh(d,a);return()=>{c.disconnect(),this.shape=void 0}}},()=>{var d;if((d=this.manager)!=null&&d.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),Fe(this,Ir),Fe(this,ka,Te(Yt,8,this)),Te(Yt,11,this),Fe(this,Ea,Te(Yt,12,this)),Te(Yt,15,this),this.element=r,this.refreshShape=()=>a()}set element(e){mt(this,Ir,e,_u)}get element(){var e;return(e=this.proxy)!=null?e:ze(this,Ir,bu)}};Yt=Ur(ao);ka=new WeakMap;Ir=new WeakSet;Ea=new WeakMap;_i=$t(Yt,20,"#element",yu,Ir,ka),bu=_i.get,_u=_i.set;$t(Yt,4,"proxy",mu,ni,Ea);Un(Yt,ni);function tv(e){return e!=null&&typeof e=="object"&&"current"in e}function Xt(e){var t;if(e!=null)return tv(e)?(t=e.current)!=null?t:void 0:e}var nv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zn=nv?S.useLayoutEffect:S.useEffect;function rv(){const e=S.useState(0)[1];return S.useCallback(()=>{e(t=>t+1)},[e])}function ja(e,t){const n=S.useRef(new Map),r=rv();return Zn(()=>{if(!e){n.current.clear();return}return Qe(()=>{var s;let i=!1,o=!1;for(const a of n.current){const[l]=a,d=de(()=>a[1]),c=e[l];d!==c&&(i=!0,n.current.set(l,c),o=(s=t==null?void 0:t(l,d,c))!=null?s:!1)}i&&(o?qs.flushSync(r):r())})},[e]),S.useMemo(()=>e&&new Proxy(e,{get(s,i){const o=s[i];return n.current.set(i,o),o}}),[e])}function sv(e,t){e()}function yn(e){const t=S.useRef(e);return Zn(()=>{t.current=e},[e]),t}function fe(e,t,n=S.useEffect,r=Object.is){const s=S.useRef(e);n(()=>{const i=s.current;r(e,i)||(s.current=e,t(e,i))},[t,e])}function On(e,t){const n=S.useRef(Xt(e));Zn(()=>{const r=Xt(e);r!==n.current&&(n.current=r,t(r))})}var iv=Object.defineProperty,ov=Object.defineProperties,av=Object.getOwnPropertyDescriptors,Vs=Object.getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,wu=Object.prototype.propertyIsEnumerable,bl=(e,t,n)=>t in e?iv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Su=(e,t)=>{for(var n in t||(t={}))xu.call(t,n)&&bl(e,n,t[n]);if(Vs)for(var n of Vs(t))wu.call(t,n)&&bl(e,n,t[n]);return e},Iu=(e,t)=>ov(e,av(t)),lv=(e,t)=>
59{var n={};for(var r in e)xu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vs)for(var r of Vs(e))t.indexOf(r)<0&&wu.call(e,r)&&(n[r]=e[r]);return n},cv=new pu,ku=S.createContext(cv),dv=S.memo(S.forwardRef(({children:e},t)=>{const[n,r]=S.useState(0),s=S.useRef(null),i=S.useRef(null),o=S.useMemo(()=>({renderer:{get rendering(){var a;return(a=s.current)!=null?a:Promise.resolve()}},trackRendering(a){s.current||(s.current=new Promise(l=>{i.current=l})),S.startTransition(()=>{a(),r(l=>l+1)})}}),[]);return Zn(()=>{var a;(a=i.current)==null||a.call(i),s.current=null},[e,n]),S.useImperativeHandle(t,()=>o),null})),xi=[void 0,Mt];function Eu(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:s,onDragStart:i,onDragMove:o,onDragOver:a,onDragEnd:l}=t,d=lv(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]),c;const u=S.useRef(null),[p,g]=S.useState((c=d.manager)!=null?c:null),{plugins:v,modifiers:C,sensors:b}=d,k=yn(s),_=yn(i),x=yn(a),y=yn(o),j=yn(l),I=yn(r);return S.useEffect(()=>{var D;if(!u.current)throw new Error("Renderer not found");const{renderer:m,trackRendering:E}=u.current,h=(D=d.manager)!=null?D:new pu(d);return h.renderer=m,h.monitor.addEventListener("beforedragstart",A=>{const T=k.current;T&&E(()=>T(A,h))}),h.monitor.addEventListener("dragstart",A=>{var T;return(T=_.current)==null?void 0:T.call(_,A,h)}),h.monitor.addEventListener("dragover",A=>{const T=x.current;T&&E(()=>T(A,h))}),h.monitor.addEventListener("dragmove",A=>{const T=y.current;T&&E(()=>T(A,h))}),h.monitor.addEventListener("dragend",A=>{const T=j.current;T&&E(()=>T(A,h))}),h.monitor.addEventListener("collision",A=>{var T;return(T=I.current)==null?void 0:T.call(I,A,h)}),S.startTransition(()=>g(h)),h.destroy},[d.manager]),fe(v,()=>p&&(p.plugins=v??cn.plugins),...xi),fe(b,()=>p&&(p.sensors=b??cn.sensors),...xi),fe(C,()=>p&&(p.modifiers=C??cn.modifiers),...xi),f.jsxs(ku.Provider,{value:p,children:[f.jsx(dv,{ref:u,children:n}),n]})}function ju(){return S.useContext(ku)}function Ca(e){var t;const n=(t=ju())!=null?t:void 0,[r]=S.useState(()=>e(n));return r.manager!==n&&(r.manager=n),Zn(r.register,[n,r]),r}function uv(e){const{disabled:t,data:n,element:r,handle:s,id:i,modifiers:o,sensors:a}=e,l=Ca(c=>new Vn(Iu(Su({},e),{register:!1,handle:Xt(s),element:Xt(r)}),c)),d=ja(l,fv);return fe(i,()=>l.id=i),On(s,c=>l.handle=c),On(r,c=>l.element=c),fe(n,()=>n&&(l.data=n)),fe(t,()=>l.disabled=t===!0),fe(a,()=>l.sensors=a),fe(o,()=>l.modifiers=o,void 0,Mt),fe(e.feedback,()=>{var c;return l.feedback=(c=e.feedback)!=null?c:"default"}),fe(e.alignment,()=>l.alignment=e.alignment),{draggable:d,get isDragging(){return d.isDragging},get isDropping(){return d.isDropping},get isDragSource(){return d.isDragSource},handleRef:S.useCallback(c=>{l.handle=c??void 0},[l]),ref:S.useCallback(c=>{var u,p;!c&&((u=l.element)!=null&&u.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=c??void 0)},[l])}}function fv(e,t,n){return!!(e==="isDragSource"&&!n&&t)}var pv=Object.create,Cu=Object.defineProperty,hv=Object.getOwnPropertyDescriptor,Pu=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ri=e=>{throw TypeError(e)},gv=(e,t,n)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vv=e=>{var t;return[,,,pv((t=e==null?void 0:e[Pu("metadata")])!=null?t:null)]},Du=["class","method","getter","setter","accessor","field","value","get","set"],Ou=e=>e!==void 0&&typeof e!="function"?ri("Function expected"):e,mv=(e,t,n,r,s)=>({kind:Du[e],name:t,metadata:r,addInitializer:i=>n._?ri("Already initialized"):s.push(Ou(i||null))}),yv=(e,t)=>gv(t,Pu("metadata"),e[3]),bv=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)i[s].call(n);return r},Au=(e,t,n,r,s,i)=>{for(var o,a,l,d,c=t&7,u=!1,p=!1,g=2,v=Du[c+5],C=e[g]||(e[g]=[]),b=(s=s.prototype,hv(s,n)),k=r.length-1;k>=0;k--)l=mv(c,n,a={},e[3],C),l.static=u,l.private=p,d=l.access={has:_=>n in _},d.get=_=>_[n],o=(0,r[k])(b[v],l),a._=1,Ou(o)&&(b[v]=o);return b&&Cu(s,n,b),s},Mu=(e,t,n)=>t.has(e)||ri("Cannot "+n),_v=(e,t,n)=>(Mu(e,t,"read from private field"),t.get(e)),xv=(e,t,n)=>t.has(e)?ri("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wv=(e,t,n,r)=>(Mu(e,t,"write to private field"),t.set(e,n),n),an=class lo{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new lo(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 lo(t,n)}},Tu,Lu,co,ws,Yr,Pa=class extends(co=pn,Lu=[Me],Tu=[Me],co){constructor(e){const t=an.from(e);super(t,(n,r)=>an.equals(n,r)),bv(Yr,5,this),xv(this,ws,0),this.velocity={x:0,y:0}}get delta(){return an.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=an.from(e),r={x:n.x-t.x,y:n.y-t.y}
59,s=Date.now(),i=s-_v(this,ws),o=a=>Math.round(a/i*100);ke(()=>{wv(this,ws,s),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(an.from(e)),this.velocity={x:0,y:0}}};Yr=vv(co);ws=new WeakMap;Au(Yr,2,"delta",Lu,Pa);Au(Yr,2,"direction",Tu,Pa);yv(Yr,Pa);var $u=(e=>(e.Horizontal="x",e.Vertical="y",e))($u||{});Object.values($u);var Sv=({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=an.distance(t.shape.center,n);return{id:r,value:1/s,type:Pt.PointerIntersection,priority:ct.High}}return null},Iv=({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,i=an.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/i;return{id:t.id,value:a,type:Pt.ShapeIntersection,priority:ct.Normal}}return null},kv=e=>{var t;return(t=Sv(e))!=null?t:Iv(e)};function Ru(e){const{collisionDetector:t,data:n,disabled:r,element:s,id:i,accept:o,type:a}=e,l=Ca(c=>new ni(Iu(Su({},e),{register:!1,element:Xt(s)}),c)),d=ja(l);return fe(i,()=>l.id=i),On(s,c=>l.element=c),fe(o,()=>l.accept=o,void 0,Mt),fe(t,()=>l.collisionDetector=t??kv),fe(n,()=>n&&(l.data=n)),fe(r,()=>l.disabled=r===!0),fe(a,()=>l.type=a),{droppable:d,get isDropTarget(){return d.isDropTarget},ref:S.useCallback(c=>{var u,p;!c&&((u=l.element)!=null&&u.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=c??void 0)},[l])}}var Ev=Object.create,Nu=Object.defineProperty,jv=Object.defineProperties,Cv=Object.getOwnPropertyDescriptor,Pv=Object.getOwnPropertyDescriptors,Zs=Object.getOwnPropertySymbols,zu=Object.prototype.hasOwnProperty,Fu=Object.prototype.propertyIsEnumerable,Dv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),qr=e=>{throw TypeError(e)},uo=(e,t,n)=>t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ov=(e,t)=>{for(var n in t||(t={}))zu.call(t,n)&&uo(e,n,t[n]);if(Zs)for(var n of Zs(t))Fu.call(t,n)&&uo(e,n,t[n]);return e},Av=(e,t)=>jv(e,Pv(t)),Mv=(e,t)=>{var n={};for(var r in e)zu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zs)for(var r of Zs(e))t.indexOf(r)<0&&Fu.call(e,r)&&(n[r]=e[r]);return n},Tv=e=>{var t;return[,,,Ev((t=void 0)!=null?t:null)]},Bu=["class","method","getter","setter","accessor","field","value","get","set"],gr=e=>e!==void 0&&typeof e!="function"?qr("Function expected"):e,Lv=(e,t,n,r,s)=>({kind:Bu[e],name:t,metadata:r,addInitializer:i=>n._?qr("Already initialized"):s.push(gr(i||null))}),$v=(e,t)=>uo(t,Dv("metadata"),e[3]),rs=(e,t,n,r)=>{for(var s=0,i=e[t>>1],o=i&&i.length;s<o;s++)t&1?i[s].call(n):r=i[s].call(n,r);return r},Wu=(e,t,n,r,s,i)=>{for(var o,a,l,d,c,u=t&7,p=!1,g=!1,v=e.length+1,C=Bu[u+5],b=e[v-1]=[],k=e[v]||(e[v]=[]),_=(s=s.prototype,Cv({get[n](){return vr(this,i)},set[n](y){return sn(this,i,y)}},n)),x=r.length-1;x>=0;x--)d=Lv(u,n,l={}
59,e[3],k),d.static=p,d.private=g,c=d.access={has:y=>n in y},c.get=y=>y[n],c.set=(y,j)=>y[n]=j,a=(0,r[x])({get:_.get,set:_.set},d),l._=1,a===void 0?gr(a)&&(_[C]=a):typeof a!="object"||a===null?qr("Object expected"):(gr(o=a.get)&&(_.get=o),gr(o=a.set)&&(_.set=o),gr(o=a.init)&&b.unshift(o));return _&&Nu(s,n,_),s},Hu=(e,t,n)=>t.has(e)||qr("Cannot "+n),vr=(e,t,n)=>(Hu(e,t,"read from private field"),t.get(e)),Jn=(e,t,n)=>t.has(e)?qr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sn=(e,t,n,r)=>(Hu(e,t,"write to private field"),t.set(e,n),n);function ln(e){return e instanceof Aa||e instanceof Yu}var ss=10,Rv=class extends We{constructor(e){super(e);const t=Qe(()=>{const{dragOperation:r}=e;if(Pr(r.activatorEvent)&&ln(r.source)&&r.status.initialized){const s=e.registry.plugins.get(Zr);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:i}=s;if(!Pr(r.nativeEvent)||!ln(i.source)||!i.shape)return;const{actions:o,collisionObserver:a,registry:l}=s,{by:d}=r;if(!d)return;const c=Nv(d),{source:u,target:p}=i,{center:g}=i.shape.current,v=[],C=[];ke(()=>{for(const j of l.droppables){const{id:I}=j;if(!j.accepts(u)||I===(p==null?void 0:p.id)&&ln(j)||!j.element)continue;let D=j.shape;const m=new pt(j.element,{getBoundingClientRect:E=>jr(E,void 0,.2)});!m.height||!m.width||(c=="down"&&g.y+ss<m.center.y||c=="up"&&g.y-ss>m.center.y||c=="left"&&g.x-ss>m.center.x||c=="right"&&g.x+ss<m.center.x)&&(v.push(j),j.shape=m,C.push(()=>j.shape=D))}}),r.preventDefault(),a.disable();const b=a.computeCollisions(v,mg);ke(()=>C.forEach(j=>j()));const[k]=b;if(!k)return;const{id:_}=k,{index:x,group:y}=u.sortable;o.setDropTarget(_).then(()=>{const{source:j,target:I,shape:D}=i;if(!j||!ln(j)||!D)return;const{index:m,group:E,target:h}=j.sortable,A=x!==m||y!==E,T=A?h:I==null?void 0:I.element;if(!T)return;Xd(T);const R=new pt(T);if(!R)return;const N=_t.delta(R,_t.from(D.current.boundingRectangle),j.alignment);o.move({by:N}),A?o.setDropTarget(j.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function Nv(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 zv=Object.defineProperty,Fv=Object.defineProperties,Bv=Object.getOwnPropertyDescriptors,_l=Object.getOwnPropertySymbols,Wv=Object.prototype.hasOwnProperty,Hv=Object.prototype.propertyIsEnumerable,xl=(e,t,n)=>t in e?zv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wl=(e,t)=>{for(var n in t||(t={}))Wv.call(t,n)&&xl(e,n,t[n]);if(_l)for(var n of _l(t))Hv.call(t,n)&&xl(e,n,t[n]);return e},Sl=(e,t)=>Fv(e,Bv(t));function Uv(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function Vv(e,t,n){var r,s;const{source:i,target:o,canceled:a}=t.operation;if(!i||!o||a)return"preventDefault"in t&&t.preventDefault(),e;const l=(x,y)=>x===y||typeof x=="object"&&"id"in x&&x.id===y;if(Array.isArray(e)){const x=e.findIndex(j=>l(j,i.id)),y=e.findIndex(j=>l(j,o.id));if(x===-1||y===-1)return e;if(!a&&"index"in i&&typeof i.index=="number"){const j=i.index;if(j!==x)return n(e,x,j)}return n(e,x,y)}const d=Object.entries(e);let c=-1,u,p=-1,g;for(const[x,y]of d)if(c===-1&&(c=y.findIndex(j=>l(j,i.id)),c!==-1&&(u=x)),p===-1&&(p=y.findIndex(j=>l(j,o.id)),p!==-1&&(g=x)),c!==-1&&p!==-1)break;if(!i.manager)return e;const{dragOperation:v}=i.manager,C=(s=(r=v.shape)==null?void 0:r.current.center)!=null?s:v.position.current;if(g==null&&o.id in e){const x=o.shape&&C.y>o.shape.center.y?e[o.id].length:0;g=o.id,p=x}if(u==null||g==null||u===g&&c===p)return"preventDefault"in t&&t.preventDefault(),e;if(u===g)return Sl(wl({},e),{[u]:n(e[u],c,p)});const k=o.shape&&Math.round(C.y)>Math.round(o.shape.center.y)?1:0,_=e[u][c];return Sl(wl({},e),{[u]:[...e[u].slice(0,c),...e[u].slice(c+1)],[g]:[...e[g].slice(0,p+k),_,...e[g].slice(p+k)]})}function Zv(e,t){return Vv(e,t,Uv)}var Il="__default__",Yv=class extends We{constructor(e){super(e);const t=()=>{const r=new Map;for(const s of e.registry.droppables)if(s instanceof Aa){const{sortable:i}=s,{group:o}=i;let a=r.get(o);a||(a=new Set,r.set(o,a)),a.add(i)}for(const[s,i]of r)r.set(s,new Set(is(i)));return r},n=[e.monitor.addEventListener("dragover",(r,s)=>{if(this.disabled)return;const{dragOperation:i}=s,{source:o,target:a}=i;
59if(!ln(o)||!ln(a)||o.sortable===a.sortable)return;const l=t(),d=o.sortable.group===a.sortable.group,c=l.get(o.sortable.group),u=d?c:l.get(a.sortable.group);!c||!u||queueMicrotask(()=>{r.defaultPrevented||s.renderer.rendering.then(()=>{var p,g,v;const C=t();for(const[h,A]of l.entries()){const T=Array.from(A).entries();for(const[R,N]of T)if(N.index!==R||N.group!==h||!((p=C.get(h))!=null&&p.has(N)))return}const b=o.sortable.element,k=a.sortable.element;if(!k||!b||!d&&a.id===o.sortable.group)return;const _=is(c),x=d?_:is(u),y=(g=o.sortable.group)!=null?g:Il,j=(v=a.sortable.group)!=null?v:Il,I={[y]:_,[j]:x},D=Zv(I,r);if(I===D)return;const m=D[j].indexOf(o.sortable),E=D[j].indexOf(a.sortable);s.collisionObserver.disable(),kl(b,m,k,E),ke(()=>{for(const[h,A]of D[y].entries())A.index=h;if(!d)for(const[h,A]of D[j].entries())A.group=a.sortable.group,A.index=h}),s.actions.setDropTarget(o.id).then(()=>s.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(r,s)=>{if(!r.canceled)return;const{dragOperation:i}=s,{source:o}=i;ln(o)&&(o.sortable.initialIndex===o.sortable.index&&o.sortable.initialGroup===o.sortable.group||queueMicrotask(()=>{const a=t(),l=a.get(o.sortable.initialGroup);l&&s.renderer.rendering.then(()=>{for(const[g,v]of a.entries()){const C=Array.from(v).entries();for(const[b,k]of C)if(k.index!==b||k.group!==g)return}const d=is(l),c=o.sortable.element,u=d[o.sortable.initialIndex],p=u==null?void 0:u.element;!u||!p||!c||(kl(c,u.index,p,o.index),ke(()=>{for(const[g,v]of a.entries()){const C=Array.from(v).values();for(const b of C)b.index=b.initialIndex,b.group=b.initialGroup}}))})}))})];this.destroy=()=>{for(const r of n)r()}}};function kl(e,t,n,r){const s=r<t?"afterend":"beforebegin";n.insertAdjacentElement(s,e)}function qv(e,t){return e.index-t.index}function is(e){return Array.from(e).sort(qv)}var Xv=[Rv,Yv],Uu={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},os=new Qp,Vu,Zu,qt,Da,mr,yr,Oa,Cn;Zu=[ae],Vu=[ae];var si=class{constructor(e,t){Jn(this,Da,rs(qt,8,this)),rs(qt,11,this),Jn(this,mr),Jn(this,yr),Jn(this,Oa,rs(qt,12,this)),rs(qt,15,this),Jn(this,Cn),this.register=()=>(ke(()=>{var u,p;(u=this.manager)==null||u.registry.register(this.droppable),(p=this.manager)==null||p.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{ke(()=>{var u,p;(u=this.manager)==null||u.registry.unregister(this.droppable),(p=this.manager)==null||p.registry.unregister(this.draggable)})},this.destroy=()=>{ke(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:s,index:i,sensors:o,type:a,transition:l=Uu,plugins:d=Xv}=n,c=Mv(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Aa(c,t,this),this.draggable=new Yu(Av(Ov({},c),{effects:()=>[()=>{var u,p,g;const v=(u=this.manager)==null?void 0:u.dragOperation.status;v!=null&&v.initializing&&this.id===((g=(p=this.manager)==null?void 0:p.dragOperation.source)==null?void 0:g.id)&&os.clear(this.manager),v!=null&&v.dragging&&os.set(this.manager,this.id,de(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:u,group:p,manager:g}=this,v=vr(this,yr),C=vr(this,mr);(u!==v||p!==C)&&(sn(this,yr,u),sn(this,mr,p),this.animate())},()=>{const{target:u}=this,{feedback:p,isDragSource:g}=this.draggable;p=="move"&&g&&(this.droppable.disabled=!u)},()=>{const{manager:u}=this;for(const p of d)u==null||u.registry.register(p)},...r()],type:a,sensors:o}),t,this),sn(this,Cn,c.element),this.manager=t,this.index=i,sn(this,yr,i),this.group=s,sn(this,mr,s),this.type=a,this.transition=l}get initialIndex(){var e,t;return(t=(e=os.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=os.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){de(()=>{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 i=this.refreshShape();if(!i)return;const o={x:n.boundingRectangle.left-i.boundingRectangle.left,y:n.boundingRectangle.top-i.boundingRectangle.top},{translate:a}=xt(s),l=ll(s,a,!1),d=ll(s,a);(o.x||o.y)&&Kd({element:s,keyframes:{translate:[`${l.x+o.x}px ${l.y+o.y}px ${l.z}`,`${d.x}px ${d.y}px ${d.z}`]},options:t}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})})})}get manager(){return this.draggable.manager}set manager(e){ke(()=>{this.draggable.manager=e,this.droppable.manager=e})}
59set element(e){ke(()=>{const t=vr(this,Cn),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),sn(this,Cn,e)})}get element(){var e,t;const n=vr(this,Cn);if(n)return(t=(e=Xi.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){ke(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){ke(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){ke(()=>{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??Gd}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){ke(()=>{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)}};qt=Tv();Da=new WeakMap;mr=new WeakMap;yr=new WeakMap;Oa=new WeakMap;Cn=new WeakMap;
59Wu(qt,4,"index",Zu,si,Da);Wu(qt,4,"group",Vu,si,Oa);$v(qt,si);var Yu=class extends Vn{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}},Aa=class extends ni{constructor(e,t,n){super(e,t),this.sortable=n}},Kv=Object.defineProperty,Gv=Object.defineProperties,Jv=Object.getOwnPropertyDescriptors,El=Object.getOwnPropertySymbols,Qv=Object.prototype.hasOwnProperty,em=Object.prototype.propertyIsEnumerable,jl=(e,t,n)=>t in e?Kv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wi=(e,t)=>{for(var n in t||(t={}))Qv.call(t,n)&&jl(e,n,t[n]);if(El)for(var n of El(t))em.call(t,n)&&jl(e,n,t[n]);return e},tm=(e,t)=>Gv(e,Jv(t));function qu(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:s,data:i,element:o,handle:a,index:l,group:d,disabled:c,feedback:u,modifiers:p,sensors:g,target:v,type:C}=e,b=wi(wi({},Uu),e.transition),k=Ca(x=>new si(tm(wi({},e),{transition:b,register:!1,handle:Xt(a),element:Xt(o),target:Xt(v),feedback:u}),x)),_=ja(k,nm);return fe(s,()=>k.id=s),Zn(()=>{ke(()=>{k.group=d,k.index=l})},[k,d,l]),fe(C,()=>k.type=C),fe(t,()=>k.accept=t,void 0,Mt),fe(i,()=>i&&(k.data=i)),fe(l,()=>{var x;(x=k.manager)!=null&&x.dragOperation.status.idle&&(b!=null&&b.idle)&&k.refreshShape()},sv),On(a,x=>k.handle=x),On(o,x=>k.element=x),On(v,x=>k.target=x),fe(c,()=>k.disabled=c===!0),fe(g,()=>k.sensors=g),fe(n,()=>k.collisionDetector=n),fe(r,()=>k.collisionPriority=r),fe(u,()=>k.feedback=u??"default"),fe(b,()=>k.transition=b,void 0,Mt),fe(p,()=>k.modifiers=p,void 0,Mt),fe(e.alignment,()=>k.alignment=e.alignment),{sortable:_,get isDragging(){return _.isDragging},get isDropping(){return _.isDropping},get isDragSource(){return _.isDragSource},get isDropTarget(){return _.isDropTarget},handleRef:S.useCallback(x=>{k.handle=x??void 0},[k]),ref:S.useCallback(x=>{var y,j;!x&&((y=k.element)!=null&&y.isConnected)&&!((j=k.manager)!=null&&j.dragOperation.status.idle)||(k.element=x??void 0)},[k]),sourceRef:S.useCallback(x=>{var y,j;!x&&((y=k.source)!=null&&y.isConnected)&&!((j=k.manager)!=null&&j.dragOperation.status.idle)||(k.source=x??void 0)}
59,[k]),targetRef:S.useCallback(x=>{var y,j;!x&&((y=k.target)!=null&&y.isConnected)&&!((j=k.manager)!=null&&j.dragOperation.status.idle)||(k.target=x??void 0)},[k])}}function nm(e,t,n){return!!(e==="isDragSource"&&!n&&t)}const Cl=e=>Symbol.iterator in e,Pl=e=>"entries"in e,Dl=(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,i]of n)if(!r.has(s)||!Object.is(i,r.get(s)))return!1;return!0},rm=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),i=r.next();for(;!s.done&&!i.done;){if(!Object.is(s.value,i.value))return!1;s=n.next(),i=r.next()}return!!s.done&&!!i.done};function sm(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:Cl(e)&&Cl(t)?Pl(e)&&Pl(t)?Dl(e,t):rm(e,t):Dl({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Be(e){const t=Vt.useRef(void 0);return n=>{const r=e(n);return sm(t.current,r)?t.current:t.current=r}}function im(e,t,n){var r=this,s=S.useRef(null),i=S.useRef(0),o=S.useRef(null),a=S.useRef([]),l=S.useRef(),d=S.useRef(),c=S.useRef(e),u=S.useRef(!0);S.useEffect(function(){c.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 g=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,C="maxWait"in n,b=C?Math.max(+n.maxWait||0,t):null;S.useEffect(function(){return u.current=!0,function(){u.current=!1}},[]);var k=S.useMemo(function(){var _=function(m){var E=a.current,h=l.current;return a.current=l.current=null,i.current=m,d.current=c.current.apply(h,E)},x=function(m,E){p&&cancelAnimationFrame(o.current),o.current=p?requestAnimationFrame(m):setTimeout(m,E)},y=function(m){if(!u.current)return!1;var E=m-s.current;return!s.current||E>=t||E<0||C&&m-i.current>=b},j=function(m){return o.current=null,v&&a.current?_(m):(a.current=l.current=null,d.current)},I=function m(){var E=Date.now();if(y(E))return j(E);if(u.current){var h=t-(E-s.current),A=C?Math.min(h,b-(E-i.current)):h;x(m,A)}},D=function(){var m=Date.now(),E=y(m);if(a.current=[].slice.call(arguments),l.current=r,s.current=m,E){if(!o.current&&u.current)return i.current=s.current,x(I,t),g?_(s.current):d.current;if(C)return x(I,t),_(s.current)}return o.current||x(I,t),d.current};return D.cancel=function(){o.current&&(p?cancelAnimationFrame(o.current):clearTimeout(o.current)),i.current=0,a.current=s.current=l.current=o.current=null},D.isPending=function(){return!!o.current},D.flush=function(){return o.current?j(Date.now()):d.current},D},[g,C,t,b,v,p]);return k}var Xu={exports:{}};(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,s,i){function o(d,c){if(!s[d]){if(!r[d]){var u=typeof Gr=="function"&&Gr;if(!c&&u)return u(d,!0);if(a)return a(d,!0);throw new Error("Cannot find module '"+d+"'")}c=s[d]={exports:{}},r[d][0].call(c.exports,function(p){var g=r[d][1][p];return o(g||p)},c,c.exports,n,r,s,i)}return s[d].exports}for(var a=typeof Gr=="function"&&Gr,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(n,r,s){(function(i,o,a,l,d,c,u,p,g){var v=n("crypto");function C(I,D){D=_(I,D);var m;return(m=D.algorithm!=="passthrough"?v.createHash(D.algorithm):new j).write===void 0&&(m.write=m.update,m.end=m.update),y(D,m).dispatch(I),m.update||m.end(""),m.digest?m.digest(D.encoding==="buffer"?void 0:D.encoding):(I=m.read(),D.encoding!=="buffer"?I.toString(D.encoding):I)}(s=r.exports=C).sha1=function(I){return C(I)},s.keys=function(I){return C(I,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},s.MD5=function(I){return C(I,{algorithm:"md5",encoding:"hex"})},s.keysMD5=function(I){return C(I,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var b=v.getHashes?v.getHashes().slice():["sha1","md5"],k=(b.push("passthrough"),["buffer","hex","binary","base64"]);function _(I,D){var m={};if(m.algorithm=(D=D||{}).algorithm||"sha1",m.encoding=D.encoding||"hex",m.excludeValues=!!D.excludeValues,m.algorithm=m.algorithm.toLowerCase(),m.encoding=m.encoding.toLowerCase(),m.ignoreUnknown=D.ignoreUnknown===!0,m.respectType=D.respectType!==!1,m.respectFunctionNames=D.respectFunctionNames!==!1,m.respectFunctionProperties=D.respectFunctionProperties!==!1,m.unorderedArrays=D.unorderedArrays===!0,m.unorderedSets=D.unorderedSets!==!1,m.unorderedObjects=D.unorderedObjects!==!1,m.replacer=D.replacer||void 0,m.excludeKeys=D.excludeKeys||void 0,I===void 0)throw new Error("Object argument required.");for(var E=0;E<b.length;++E)b[E].toLowerCase()===m.algorithm.toLowerCase()&&(m.algorithm=b[E]);if(b.indexOf(m.algorithm)===-1)throw new Error('Algorithm "'+m.algorithm+'"  not supported. supported values: '+b.join(", "));if(k.indexOf(m.encoding)===-1&&m.algorithm!=="passthrough")throw new Error('Encoding "'+m.encoding+'"  not supported. supported values: '+k.join(", "));return m}function x(I){if(typeof I=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(I))!=null}function y(I,D,m){m=m||[];function E(h){return D.update?D.update(h,"utf8"):D.write(h,"utf8")}return{dispatch:function(h){return this["_"+((h=I.replacer?I.replacer(h):h)===null?"null":typeof h)](h)},_object:function(h){var A,T=Object.prototype.toString.call(h),R=/\[object (.*)\]/i.exec(T);if(R=(R=R?R[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=m.indexOf(h)))return this.dispatch("[CIRCULAR:"+T+"]");if(m.push(h),a!==void 0&&a.isBuffer&&a.isBuffer(h))return E("buffer:"),E(h);if(R==="object"||R==="function"||R==="asyncfunction")return T=Object.keys(h),I.unorderedObjects&&(T=T.sort()),I.respectType===!1||x(h)||T.splice(0,0,"prototype","__proto__","constructor"),I.excludeKeys&&(T=T.filter(function(N){return!I.excludeKeys(N)})),E("object:"+T.length+":"),A=this,T.forEach(function(N){A.dispatch(N),E(":"),I.excludeValues||A.dispatch(h[N]),E(",")});if(!this["_"+R]){if(I.ignoreUnknown)return E("["+R+"]");throw new Error('Unknown object type "'+R+'"')}this["_"+R](h)},_array:function(h,N){N=N!==void 0?N:I.unorderedArrays!==!1;var T=this;if(E("array:"+h.length+":"),!N||h.length<=1)return h.forEach(function(U){return T.dispatch(U)});var R=[],N=h.map(function(U){var z=new j,K=m.slice();return y(I,z,K).dispatch(U),R=R.concat(K.slice(m.length)),z.read().toString()});return m=m.concat(R),N.sort(),this._array(N,!1)},_date:function(h){return E("date:"+h.toJSON())},_symbol:function(h){return E("symbol:"+h.toString())},_error:function(h){return E("error:"+h.toString())},_boolean:function(h){return E("bool:"+h.toString())}
vendor: 4,168 bytes, lines 59-62
59,_string:function(h){E("string:"+h.length+":"),E(h.toString())},_function:function(h){E("fn:"),x(h)?this.dispatch("[native]"):this.dispatch(h.toString()),I.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(h.name)),I.respectFunctionProperties&&this._object(h)},_number:function(h){return E("number:"+h.toString())},_xml:function(h){return E("xml:"+h.toString())},_null:function(){return E("Null")},_undefined:function(){return E("Undefined")},_regexp:function(h){return E("regex:"+h.toString())},_uint8array:function(h){return E("uint8array:"),this.dispatch(Array.prototype.slice.call(h))},_uint8clampedarray:function(h){return E("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(h))},_int8array:function(h){return E("int8array:"),this.dispatch(Array.prototype.slice.call(h))},_uint16array:function(h){return E("uint16array:"),this.dispatch(Array.prototype.slice.call(h))},_int16array:function(h){return E("int16array:"),this.dispatch(Array.prototype.slice.call(h))},_uint32array:function(h){return E("uint32array:"),this.dispatch(Array.prototype.slice.call(h))},_int32array:function(h){return E("int32array:"),this.dispatch(Array.prototype.slice.call(h))},_float32array:function(h){return E("float32array:"),this.dispatch(Array.prototype.slice.call(h))},_float64array:function(h){return E("float64array:"),this.dispatch(Array.prototype.slice.call(h))},_arraybuffer:function(h){return E("arraybuffer:"),this.dispatch(new Uint8Array(h))},_url:function(h){return E("url:"+h.toString())},_map:function(h){return E("map:"),h=Array.from(h),this._array(h,I.unorderedSets!==!1)},_set:function(h){return E("set:"),h=Array.from(h),this._array(h,I.unorderedSets!==!1)},_file:function(h){return E("file:"),this.dispatch([h.name,h.size,h.type,h.lastModfied])},_blob:function(){if(I.ignoreUnknown)return E("[blob]");throw Error(`Hashing Blob objects is currently not supported
60(see https://github.com/puleos/object-hash/issues/26)
61Use "options.replacer" or "options.ignoreUnknown"
62`)},_domwindow:function(){return E("domwindow")},_bigint:function(h){return E("bigint:"+h.toString())},_process:function(){return E("process")},_timer:function(){return E("timer")},_pipe:function(){return E("pipe")},_tcp:function(){return E("tcp")},_udp:function(){return E("udp")},_tty:function(){return E("tty")},_statwatcher:function(){return E("statwatcher")},_securecontext:function(){return E("securecontext")},_connection:function(){return E("connection")},_zlib:function(){return E("zlib")},_context:function(){return E("context")},_nodescript:function(){return E("nodescript")},_httpparser:function(){return E("httpparser")},_dataview:function(){return E("dataview")},_signal:function(){return E("signal")},_fsevent:function(){return E("fsevent")},_tlswrap:function(){return E("tlswrap")}}}function j(){return{buf:"",write:function(I){this.buf+=I},end:function(I){this.buf+=I},read:function(){return this.buf}}}s.writeToStream=function(I,D,m){return m===void 0&&(m=D,D={}),y(D=_(I,D),m).dispatch(I)}}).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(i,o,a,l,d,c,u,p,g){(function(v){var C=typeof Uint8Array<"u"?Uint8Array:Array,b=43,k=47,_=48,x=97,y=65,j=45,I=95;function D(m){return m=m.charCodeAt(0),m===b||m===j?62:m===k||m===I?63:m<_?-1:m<_+10?m-_+26+26:m<y+26?m-y:m<x+26?m-x+26:void 0}v.toByteArray=function(m){var E,h;if(0<m.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var A=m.length,A=m.charAt(A-2)==="="?2:m.charAt(A-1)==="="?1:0,T=new C(3*m.length/4-A),R=0<A?m.length-4:m.length,N=0;function U(z){T[N++]=z}for(E=0;E<R;E+=4,0)U((16711680&(h=D(m.charAt(E))<<18|D(m.charAt(E+1))<<12|D(m.charAt(E+2))<<6|D(m.charAt(E+3))))>>16),U((65280&h)>>8),U(255&h);return A==2?U(255&(h=D(m.charAt(E))<<2|D(m.charAt(E+1))>>4)):A==1&&(U((h=D(m.charAt(E))<<10|D(m.charAt(E+1))<<4|D(m.charAt(E+2))>>2)>>8&255),U(255&h)),T},v.fromByteArray=function(m){var E,h,A,T,R=m.length%3,N="";function U(z){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
62+/".charAt(z)}for(E=0,A=m.length-R;E<A;E+=3)h=(m[E]<<16)+(m[E+1]<<8)+m[E+2],N+=U((T=h)>>18&63)+U(T>>12&63)+U(T>>6&63)+U(63&T);switch(R){case 1:N=(N+=U((h=m[m.length-1])>>2))+U(h<<4&63)+"==";break;case 2:N=(N=(N+=U((h=(m[m.length-2]<<8)+m[m.length-1])>>10))+U(h>>4&63))+U(h<<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(i,o,b,l,d,c,u,p,g){var v=n("base64-js"),C=n("ieee754");function b(w,O,L){if(!(this instanceof b))return new b(w,O,L);var B,W,Y,ee,he=typeof w;if(O==="base64"&&he=="string")for(w=(ee=w).trim?ee.trim():ee.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(he=="number")B=V(w);else if(he=="string")B=b.byteLength(w,O);else{if(he!="object")throw new Error("First argument needs to be a number, array or string.");B=V(w.length)}if(b._useTypedArrays?W=b._augment(new Uint8Array(B)):((W=this).length=B,W._isBuffer=!0),b._useTypedArrays&&typeof w.byteLength=="number")W._set(w);else if(X(ee=w)||b.isBuffer(ee)||ee&&typeof ee=="object"&&typeof ee.length=="number")for(Y=0;Y<B;Y++)b.isBuffer(w)?W[Y]=w.readUInt8(Y):W[Y]=w[Y];else if(he=="string")W.write(w,0,O);else if(he=="number"&&!b._useTypedArrays&&!L)for(Y=0;Y<B;Y++)W[Y]=0;return W}function k(w,O,L,B){return b._charsWritten=ce(function(W){for(var Y=[],ee=0;ee<W.length;ee++)Y.push(255&W.charCodeAt(ee));return Y}(O),w,L,B)}function _(w,O,L,B){return b._charsWritten=ce(function(W){for(var Y,ee,he=[],_e=0;_e<W.length;_e++)ee=W.charCodeAt(_e),Y=ee>>8,ee=ee%256,he.push(ee),he.push(Y);return he}(O),w,L,B)}function x(w,O,L){var B="";L=Math.min(w.length,L);for(var W=O;W<L;W++)B+=String.fromCharCode(w[W]);return B}function y(w,O,L,Y){Y||(Z(typeof L=="boolean","missing or invalid endian"),Z(O!=null,"missing offset"),Z(O+1<w.length,"Trying to read beyond buffer length"));var W,Y=w.length;if(!(Y<=O))return L?(W=w[O],O+1<Y&&(W|=w[O+1]<<8)):(W=w[O]<<8,O+1<Y&&(W|=w[O+1])),W}function j(w,O,L,Y){Y||(Z(typeof L=="boolean","missing or invalid endian"),Z(O!=null,"missing offset"),Z(O+3<w.length,"Trying to read beyond buffer length"));var W,Y=w.length;if(!(Y<=O))return L?(O+2<Y&&(W=w[O+2]<<16),O+1<Y&&(W|=w[O+1]<<8),W|=w[O],O+3<Y&&(W+=w[O+3]<<24>>>0)):(O+1<Y&&(W=w[O+1]<<16),O+2<Y&&(W|=w[O+2]<<8),O+3<Y&&(W|=w[O+3]),W+=w[O]<<24>>>0),W}function I(w,O,L,B){if(B||(Z(typeof L=="boolean","missing or invalid endian"),Z(O!=null,"missing offset"),Z(O+1<w.length,"Trying to read beyond buffer length")),!(w.length<=O))return B=y(w,O,L,!0),32768&B?-1*(65535-B+1):B}function D(w,O,L,B){if(B||(Z(typeof L=="boolean","missing or invalid endian"),Z(O!=null,"missing offset"),Z(O+3<w.length,"Trying to read beyond buffer length")),!(w.length<=O))return B=j(w,O,L,!0),2147483648&B?-1*(4294967295-B+1):B}function m(w,O,L,B){return B||(Z(typeof L=="boolean","missing or invalid endian"),Z(O+3<w.length,"Trying to read beyond buffer length")),C.read(w,O,L,23,4)}function E(w,O,L,B){return B||(Z(typeof L=="boolean","missing or invalid endian"),Z(O+7<w.length,"Trying to read beyond buffer length")),C.read(w,O,L,52,8)}function h(w,O,L,B,W){if(W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+1<w.length,"trying to write beyond buffer length"),se(O,65535)),W=w.length,!(W<=L))for(var Y=0,ee=Math.min(W-L,2);Y<ee;Y++)w[L+Y]=(O&255<<8*(B?Y:1-Y))>>>8*(B?Y:1-Y)}function A(w,O,L,B,W){if(W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+3<w.length,"trying to write beyond buffer length"),se(O,4294967295)),W=w.length,!(W<=L))for(var Y=0,ee=Math.min(W-L,4);Y<ee;Y++)w[L+Y]=O>>>8*(B?Y:3-Y)&255}function T(w,O,L,B,W){W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+1<w.length,"Trying to write beyond buffer length"),Ee(O,32767,-32768)),w.length<=L||h(w,0<=O?O:65535+O+1,L,B,W)}function R(w,O,L,B,W){W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+3<w.length,"Trying to write beyond buffer length"),Ee(O,2147483647,-2147483648)),w.length<=L||A(w,0<=O?O:4294967295+O+1,L,B,W)}function N(w,O,L,B,W){W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+3<w.length,"Trying to write beyond buffer length"),De(O,34028234663852886e22,-34028234663852886e22)),w.length<=L||C.write(w,O,L,B,23,4)}function U(w,O,L,B,W){W||(Z(O!=null,"missing value"),Z(typeof B=="boolean","missing or invalid endian"),Z(L!=null,"missing offset"),Z(L+7<w.length,"Trying to write beyond buffer length"),De(O,17976931348623157e292,-17976931348623157e292)),w.length<=L||C.write(w,O,L,B,52,8)}
vendor: 22,193 bytes, lines 62-64
62s.Buffer=b,s.SlowBuffer=b,s.INSPECT_MAX_BYTES=50,b.poolSize=8192,b._useTypedArrays=function(){try{var w=new ArrayBuffer(0),O=new Uint8Array(w);return O.foo=function(){return 42},O.foo()===42&&typeof O.subarray=="function"}catch{return!1}}(),b.isEncoding=function(w){switch(String(w).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}},b.isBuffer=function(w){return!(w==null||!w._isBuffer)},b.byteLength=function(w,O){var L;switch(w+="",O||"utf8"){case"hex":L=w.length/2;break;case"utf8":case"utf-8":L=q(w).length;break;case"ascii":case"binary":case"raw":L=w.length;break;case"base64":L=te(w).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":L=2*w.length;break;default:throw new Error("Unknown encoding")}return L},b.concat=function(w,O){if(Z(X(w),`Usage: Buffer.concat(list, [totalLength])
63list should be an Array.`),w.length===0)return new b(0);if(w.length===1)return w[0];if(typeof O!="number")for(W=O=0;W<w.length;W++)O+=w[W].length;for(var L=new b(O),B=0,W=0;W<w.length;W++){var Y=w[W];Y.copy(L,B),B+=Y.length}return L},b.prototype.write=function(w,O,L,B){isFinite(O)?isFinite(L)||(B=L,L=void 0):(_e=B,B=O,O=L,L=_e),O=Number(O)||0;var W,Y,ee,he,_e=this.length-O;switch((!L||_e<(L=Number(L)))&&(L=_e),B=String(B||"utf8").toLowerCase()){case"hex":W=function(Oe,Ae,je,xe){je=Number(je)||0;var ve=Oe.length-je;(!xe||ve<(xe=Number(xe)))&&(xe=ve),Z((ve=Ae.length)%2==0,"Invalid hex string"),ve/2<xe&&(xe=ve/2);for(var ot=0;ot<xe;ot++){var Rt=parseInt(Ae.substr(2*ot,2),16);Z(!isNaN(Rt),"Invalid hex string"),Oe[je+ot]=Rt}return b._charsWritten=2*ot,ot}(this,w,O,L);break;case"utf8":case"utf-8":Y=this,ee=O,he=L,W=b._charsWritten=ce(q(w),Y,ee,he);break;case"ascii":case"binary":W=k(this,w,O,L);break;case"base64":Y=this,ee=O,he=L,W=b._charsWritten=ce(te(w),Y,ee,he);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":W=_(this,w,O,L);break;default:throw new Error("Unknown encoding")}return W},b.prototype.toString=function(w,O,L){var B,W,Y,ee,he=this;if(w=String(w||"utf8").toLowerCase(),O=Number(O)||0,(L=L!==void 0?Number(L):he.length)===O)return"";switch(w){case"hex":B=function(_e,Oe,Ae){var je=_e.length;(!Oe||Oe<0)&&(Oe=0),(!Ae||Ae<0||je<Ae)&&(Ae=je);for(var xe="",ve=Oe;ve<Ae;ve++)xe+=G(_e[ve]);return xe}(he,O,L);break;case"utf8":case"utf-8":B=function(_e,Oe,Ae){var je="",xe="";Ae=Math.min(_e.length,Ae);for(var ve=Oe;ve<Ae;ve++)_e[ve]<=127?(je+=Ie(xe)+String.fromCharCode(_e[ve]),xe=""):xe+="%"+_e[ve].toString(16);return je+Ie(xe)}(he,O,L);break;case"ascii":case"binary":B=x(he,O,L);break;case"base64":W=he,ee=L,B=(Y=O)===0&&ee===W.length?v.fromByteArray(W):v.fromByteArray(W.slice(Y,ee));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":B=function(_e,Oe,Ae){for(var je=_e.slice(Oe,Ae),xe="",ve=0;ve<je.length;ve+=2)xe+=String.fromCharCode(je[ve]+256*je[ve+1]);return xe}(he,O,L);break;default:throw new Error("Unknown encoding")}return B},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},b.prototype.copy=function(w,O,L,B){if(O=O||0,(B=B||B===0?B:this.length)!==(L=L||0)&&w.length!==0&&this.length!==0){Z(L<=B,"sourceEnd < sourceStart"),Z(0<=O&&O<w.length,"targetStart out of bounds"),Z(0<=L&&L<this.length,"sourceStart out of bounds"),Z(0<=B&&B<=this.length,"sourceEnd out of bounds"),B>this.length&&(B=this.length);var W=(B=w.length-O<B-L?w.length-O+L:B)-L;if(W<100||!b._useTypedArrays)for(var Y=0;Y<W;Y++)w[Y+O]=this[Y+L];else w._set(this.subarray(L,L+W),O)}},b.prototype.slice=function(w,O){var L=this.length;if(w=K(w,L,0),O=K(O,L,L),b._useTypedArrays)return b._augment(this.subarray(w,O));for(var B=O-w,W=new b(B,void 0,!0),Y=0;Y<B;Y++)W[Y]=this[Y+w];return W},b.prototype.get=function(w){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(w)},b.prototype.set=function(w,O){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(w,O)},b.prototype.readUInt8=function(w,O){if(O||(Z(w!=null,"missing offset"),Z(w<this.length,"Trying to read beyond buffer length")),!(w>=this.length))return this[w]},b.prototype.readUInt16LE=function(w,O){return y(this,w,!0,O)},b.prototype.readUInt16BE=function(w,O){return y(this,w,!1,O)},b.prototype.readUInt32LE=function(w,O){return j(this,w,!0,O)},b.prototype.readUInt32BE=function(w,O){return j(this,w,!1,O)},b.prototype.readInt8=function(w,O){if(O||(Z(w!=null,"missing offset"),Z(w<this.length,"Trying to read beyond buffer length")),!(w>=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},b.prototype.readInt16LE=function(w,O){return I(this,w,!0,O)},b.prototype.readInt16BE=function(w,O){return I(this,w,!1,O)},b.prototype.readInt32LE=function(w,O){return D(this,w,!0,O)},b.prototype.readInt32BE=function(w,O){return D(this,w,!1,O)},b.prototype.readFloatLE=function(w,O){return m(this,w,!0,O)},b.prototype.readFloatBE=function(w,O){return m(this,w,!1,O)},b.prototype.readDoubleLE=function(w,O){return E(this,w,!0,O)},b.prototype.readDoubleBE=function(w,O){return E(this,w,!1,O)},b.prototype.writeUInt8=function(w,O,L){L||(Z(w!=null,"missing value"),Z(O!=null,"missing offset"),Z(O<this.length,"trying to write beyond buffer length"),se(w,255)),O>=this.length||(this[O]=w)},b.prototype.writeUInt16LE=function(w,O,L){h(this,w,O,!0,L)},b.prototype.writeUInt16BE=function(w,O,L){h(this,w,O,!1,L)},b.prototype.writeUInt32LE=function(w,O,L){A(this,w,O,!0,L)},b.prototype.writeUInt32BE=function(w,O,L){A(this,w,O,!1,L)},b.prototype.writeInt8=function(w,O,L){L||(Z(w!=null,"missing value"),Z(O!=null,"missing offset"),Z(O<this.length,"Trying to write beyond buffer length"),Ee(w,127,-128)),O>=this.length||(0<=w?this.writeUInt8(w,O,L):this.writeUInt8(255+w+1,O,L))},b.prototype.writeInt16LE=function(w,O,L){T(this,w,O,!0,L)},b.prototype.writeInt16BE=function(w,O,L){T(this,w,O,!1,L)},b.prototype.writeInt32LE=function(w,O,L){R(this,w,O,!0,L)},b.prototype.writeInt32BE=function(w,O,L){R(this,w,O,!1,L)},b.prototype.writeFloatLE=function(w,O,L){N(this,w,O,!0,L)},b.prototype.writeFloatBE=function(w,O,L){N(this,w,O,!1,L)},b.prototype.writeDoubleLE=function(w,O,L){U(this,w,O,!0,L)},b.prototype.writeDoubleBE=function(w,O,L){U(this,w,O,!1,L)},b.prototype.fill=function(w,O,L){if(O=O||0,L=L||this.length,Z(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),Z(O<=L,"end < start"),L!==O&&this.length!==0){Z(0<=O&&O<this.length,"start out of bounds"),Z(0<=L&&L<=this.length,"end out of bounds");for(var B=O;B<L;B++)this[B]=w}},b.prototype.inspect=function(){for(var w=[],O=this.length,L=0;L<O;L++)if(w[L]=G(this[L]),L===s.INSPECT_MAX_BYTES){w[L+1]="...";break}return"<Buffer "+w.join(" ")+">"},b.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(b._useTypedArrays)return new b(this).buffer;for(var w=new Uint8Array(this.length),O=0,L=w.length;O<L;O+=1)w[O]=this[O];return w.buffer};var z=b.prototype;function K(w,O,L){return typeof w!="number"?L:O<=(w=~~w)?O:0<=w||0<=(w+=O)?w:0}function V(w){return(w=~~Math.ceil(+w))<0?0:w}function X(w){return(Array.isArray||function(O){return Object.prototype.toString.call(O)==="[object Array]"})(w)}function G(w){return w<16?"0"+w.toString(16):w.toString(16)}function q(w){for(var O=[],L=0;L<w.length;L++){var B=w.charCodeAt(L);if(B<=127)O.push(w.charCodeAt(L));else for(var W=L,Y=(55296<=B&&B<=57343&&L++,encodeURIComponent(w.slice(W,L+1)).substr(1).split("%")),ee=0;ee<Y.length;ee++)O.push(parseInt(Y[ee],16))}return O}function te(w){return v.toByteArray(w)}function ce(w,O,L,B){for(var W=0;W<B&&!(W+L>=O.length||W>=w.length);W++)O[W+L]=w[W];return W}function Ie(w){try{return decodeURIComponent(w)}catch{return"�"}}function se(w,O){Z(typeof w=="number","cannot write a non-number as a number"),Z(0<=w,"specified a negative value for writing an unsigned value"),Z(w<=O,"value is larger than maximum value for type"),Z(Math.floor(w)===w,"value has a fractional component")}function Ee(w,O,L){Z(typeof w=="number","cannot write a non-number as a number"),Z(w<=O,"value larger than maximum allowed value"),Z(L<=w,"value smaller than minimum allowed value"),Z(Math.floor(w)===w,"value has a fractional component")}function De(w,O,L){Z(typeof w=="number","cannot write a non-number as a number"),Z(w<=O,"value larger than maximum allowed value"),Z(L<=w,"value smaller than minimum allowed value")}function Z(w,O){if(!w)throw new Error(O||"Failed assertion")}b._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=z.get,w.set=z.set,w.write=z.write,w.toString=z.toString,w.toLocaleString=z.toString,w.toJSON=z.toJSON,w.copy=z.copy,w.slice=z.slice,w.readUInt8=z.readUInt8,w.readUInt16LE=z.readUInt16LE,w.readUInt16BE=z.readUInt16BE,w.readUInt32LE=z.readUInt32LE,w.readUInt32BE=z.readUInt32BE,w.readInt8=z.readInt8,w.readInt16LE=z.readInt16LE,w.readInt16BE=z.readInt16BE,w.readInt32LE=z.readInt32LE,w.readInt32BE=z.readInt32BE,w.readFloatLE=z.readFloatLE,w.readFloatBE=z.readFloatBE,w.readDoubleLE=z.readDoubleLE,w.readDoubleBE=z.readDoubleBE,w.writeUInt8=z.writeUInt8,w.writeUInt16LE=z.writeUInt16LE,w.writeUInt16BE=z.writeUInt16BE,w.writeUInt32LE=z.writeUInt32LE,w.writeUInt32BE=z.writeUInt32BE,w.writeInt8=z.writeInt8,w.writeInt16LE=z.writeInt16LE,w.writeInt16BE=z.writeInt16BE,w.writeInt32LE=z.writeInt32LE,w.writeInt32BE=z.writeInt32BE,w.writeFloatLE=z.writeFloatLE,w.writeFloatBE=z.writeFloatBE,w.writeDoubleLE=z.writeDoubleLE,w.writeDoubleBE=z.writeDoubleBE,w.fill=z.fill,w.inspect=z.inspect,w.toArrayBuffer=z.toArrayBuffer,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/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(i,o,v,l,d,c,u,p,g){var v=n("buffer").Buffer,C=4,b=new v(C);b.fill(0),r.exports={hash:function(k,_,x,y){for(var j=_(function(h,A){h.length%C!=0&&(T=h.length+(C-h.length%C),h=v.concat([h,b],T));for(var T,R=[],N=A?h.readInt32BE:h.readInt32LE,U=0;U<h.length;U+=C)R.push(N.call(h,U));return R}(k=v.isBuffer(k)?k:new v(k),y),8*k.length),_=y,I=new v(x),D=_?I.writeInt32BE:I.writeInt32LE,m=0;m<j.length;m++)D.call(I,j[m],4*m,!0);return I}}}).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(i,o,v,l,d,c,u,p,g){var v=n("buffer").Buffer,C=n("./sha"),b=n("./sha256"),k=n("./rng"),_={sha1:C,sha256:b,md5:n("./md5")},x=64,y=new v(x);function j(h,A){var T=_[h=h||"sha1"],R=[];return T||I("algorithm:",h,"is not yet supported"),{update:function(N){return v.isBuffer(N)||(N=new v(N)),R.push(N),N.length,this},digest:function(N){var U=v.concat(R),U=A?function(z,K,V){v.isBuffer(K)||(K=new v(K)),v.isBuffer(V)||(V=new v(V)),K.length>x?K=z(K):K.length<x&&(K=v.concat([K,y],x));for(var X=new v(x),G=new v(x),q=0;q<x;q++)X[q]=54^K[q],G[q]=92^K[q];return V=z(v.concat([X,V])),z(v.concat([G,V]))}(T,A,U):T(U);return R=null,N?U.toString(N):U}}}function I(){var h=[].slice.call(arguments).join(" ");throw new Error([h,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
64`))}y.fill(0),s.createHash=function(h){return j(h)},s.createHmac=j,s.randomBytes=function(h,A){if(!A||!A.call)return new v(k(h));try{A.call(this,void 0,new v(k(h)))}catch(T){A(T)}};var D,m=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],E=function(h){s[h]=function(){I("sorry,",h,"is not implemented yet")}};for(D in m)E(m[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/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(i,o,a,l,d,c,u,p,g){var v=n("./helpers");function C(I,D){I[D>>5]|=128<<D%32,I[14+(D+64>>>9<<4)]=D;for(var m=1732584193,E=-271733879,h=-1732584194,A=271733878,T=0;T<I.length;T+=16){var R=m,N=E,U=h,z=A,m=k(m,E,h,A,I[T+0],7,-680876936),A=k(A,m,E,h,I[T+1],12,-389564586),h=k(h,A,m,E,I[T+2],17,606105819),E=k(E,h,A,m,I[T+3],22,-1044525330);m=k(m,E,h,A,I[T+4],7,-176418897),A=k(A,m,E,h,I[T+5],12,1200080426),h=k(h,A,m,E,I[T+6],17,-1473231341),E=k(E,h,A,m,I[T+7],22,-45705983),m=k(m,E,h,A,I[T+8],7,1770035416),A=k(A,m,E,h,I[T+9],12,-1958414417),h=k(h,A,m,E,I[T+10],17,-42063),E=k(E,h,A,m,I[T+11],22,-1990404162),m=k(m,E,h,A,I[T+12],7,1804603682),A=k(A,m,E,h,I[T+13],12,-40341101),h=k(h,A,m,E,I[T+14],17,-1502002290),m=_(m,E=k(E,h,A,m,I[T+15],22,1236535329),h,A,I[T+1],5,-165796510),A=_(A,m,E,h,I[T+6],9,-1069501632),h=_(h,A,m,E,I[T+11],14,643717713),E=_(E,h,A,m,I[T+0],20,-373897302),m=_(m,E,h,A,I[T+5],5,-701558691),A=_(A,m,E,h,I[T+10],9,38016083),h=_(h,A,m,E,I[T+15],14,-660478335),E=_(E,h,A,m,I[T+4],20,-405537848),m=_(m,E,h,A,I[T+9],5,568446438),A=_(A,m,E,h,I[T+14],9,-1019803690),h=_(h,A,m,E,I[T+3],14,-187363961),E=_(E,h,A,m,I[T+8],20,1163531501),m=_(m,E,h,A,I[T+13],5,-1444681467),A=_(A,m,E,h,I[T+2],9,-51403784),h=_(h,A,m,E,I[T+7],14,1735328473),m=x(m,E=_(E,h,A,m,I[T+12],20,-1926607734),h,A,I[T+5],4,-378558),A=x(A,m,E,h,I[T+8],11,-2022574463),h=x(h,A,m,E,I[T+11],16,1839030562),E=x(E,h,A,m,I[T+14],23,-35309556),m=x(m,E,h,A,I[T+1],4,-1530992060),A=x(A,m,E,h,I[T+4],11,1272893353),h=x(h,A,m,E,I[T+7],16,-155497632),E=x(E,h,A,m,I[T+10],23,-1094730640),m=x(m,E,h,A,I[T+13],4,681279174),A=x(A,m,E,h,I[T+0],11,-358537222),h=x(h,A,m,E,I[T+3],16,-722521979),E=x(E,h,A,m,I[T+6],23,76029189),m=x(m,E,h,A,I[T+9],4,-640364487),A=x(A,m,E,h,I[T+12],11,-421815835),h=x(h,A,m,E,I[T+15],16,530742520),m=y(m,E=x(E,h,A,m,I[T+2],23,-995338651),h,A,I[T+0],6,-198630844),A=y(A,m,E,h,I[T+7],10,1126891415),h=y(h,A,m,E,I[T+14],15,-1416354905),E=y(E,h,A,m,I[T+5],21,-57434055),m=y(m,E,h,A,I[T+12],6,1700485571),A=y(A,m,E,h,I[T+3],10,-1894986606),h=y(h,A,m,E,I[T+10],15,-1051523),E=y(E,h,A,m,I[T+1],21,-2054922799),m=y(m,E,h,A,I[T+8],6,1873313359),A=y(A,m,E,h,I[T+15],10,-30611744),h=y(h,A,m,E,I[T+6],15,-1560198380),E=y(E,h,A,m,I[T+13],21,1309151649),m=y(m,E,h,A,I[T+4],6,-145523070),A=y(A,m,E,h,I[T+11],10,-1120210379),h=y(h,A,m,E,I[T+2],15,718787259),E=y(E,h,A,m,I[T+9],21,-343485551),m=j(m,R),E=j(E,N),h=j(h,U),A=j(A,z)}return Array(m,E,h,A)}function b(I,D,m,E,h,A){return j((D=j(j(D,I),j(E,A)))<<h|D>>>32-h,m)}function k(I,D,m,E,h,A,T){return b(D&m|~D&E,I,D,h,A,T)}function _(I,D,m,E,h,A,T){return b(D&E|m&~E,I,D,h,A,T)}function x(I,D,m,E,h,A,T){return b(D^m^E,I,D,h,A,T)}function y(I,D,m,E,h,A,T){return b(m^(D|~E),I,D,h,A,T)}function j(I,D){var m=(65535&I)+(65535&D);return(I>>16)+(D>>16)+(m>>16)<<16|65535&m}r.exports=function(I){return v.hash(I,C,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(i,o,a,l,d,c,u,p,g){r.exports=function(v){for(var C,b=new Array(v),k=0;k<v;k++)!(3&k)&&(C=4294967296*Math.random()),b[k]=C>>>((3&k)<<3)&255;return b}}).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(i,o,a,l,d,c,u,p,g){var v=n("./helpers");function C(_,x){_[x>>5]|=128<<24-x%32,_[15+(x+64>>9<<4)]=x;for(var y,j,I,D=Array(80),m=1732584193,E=-271733879,h=-1732584194,A=271733878,T=-1009589776,R=0;R<_.length;R+=16){for(var N=m,U=E,z=h,K=A,V=T,X=0;X<80;X++){D[X]=X<16?_[R+X]:k(D[X-3]^D[X-8]^D[X-14]^D[X-16],1);var G=b(b(k(m,5),(G=E,j=h,I=A,(y=X)<20?G&j|~G&I:!(y<40)&&y<60?G&j|G&I|j&I:G^j^I)),b(b(T,D[X]),(y=X)<20?1518500249:y<40?1859775393:y<60?-1894007588:-899497514)),T=A,A=h,h=k(E,30),E=m,m=G}m=b(m,N),E=b(E,U),h=b(h,z),A=b(A,K),T=b(T,V)}return Array(m,E,h,A,T)}function b(_,x){var y=(65535&_)+(65535&x);return(_>>16)+(x>>16)+(y>>16)<<16|65535&y}function k(_,x){return _<<x|_>>>32-x}r.exports=function(_){return v.hash(_,C,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(i,o,a,l,d,c,u,p,g){function v(x,y){var j=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(j>>16)<<16|65535&j}function C(x,y){var j,I=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),D=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),m=new Array(64);x[y>>5]|=128<<24-y%32,x[15+(y+64>>9<<4)]=y;for(var E,h,A=0;A<x.length;A+=16){for(var T=D[0],R=D[1],N=D[2],U=D[3],z=D[4],K=D[5],V=D[6],X=D[7],G=0;G<64;G++)m[G]=G<16?x[G+A]:v(v(v((h=m[G-2],k(h,17)^k(h,19)^_(h,10)),m[G-7]),(h=m[G-15],k(h,7)^k(h,18)^_(h,3))),m[G-16]),j=v(v(v(v(X,k(h=z,6)^k(h,11)^k(h,25)),z&K^~z&V),I[G]),m[G]),E=v(k(E=T,2)^k(E,13)^k(E,22),T&R^T&N^R&N),X=V,V=K,K=z,z=v(U,j),U=N,N=R,R=T,T=v(j,E);D[0]=v(T,D[0]),D[1]=v(R,D[1]),D[2]=v(N,D[2]),D[3]=v(U,D[3]),D[4]=v(z,D[4]),D[5]=v(K,D[5]),D[6]=v(V,D[6]),D[7]=v(X,D[7])}return D}var b=n("./helpers"),k=function(x,y){return x>>>y|x<<32-y},_=function(x,y){return x>>>y};r.exports=function(x){return b.hash(x,C,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(i,o,a,l,d,c,u,p,g){s.read=function(v,C,b,k,A){var x,y,j=8*A-k-1,I=(1<<j)-1,D=I>>1,m=-7,E=b?A-1:0,h=b?-1:1,A=v[C+E];for(E+=h,x=A&(1<<-m)-1,A>>=-m,m+=j;0<m;x=256*x+v[C+E],E+=h,m-=8);for(y=x&(1<<-m)-1,x>>=-m,m+=k;0<m;y=256*y+v[C+E],E+=h,m-=8);if(x===0)x=1-D;else{if(x===I)return y?NaN:1/0*(A?-1:1);y+=Math.pow(2,k),x-=D}return(A?-1:1)*y*Math.pow(2,x-k)},s.write=function(v,C,b,k,_,T){var y,j,I=8*T-_-1,D=(1<<I)-1,m=D>>1,E=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=k?0:T-1,A=k?1:-1,T=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(j=isNaN(C)?1:0,y=D):(y=Math.floor(Math.log(C)/Math.LN2),C*(k=Math.pow(2,-y))<1&&(y--,k*=2),2<=(C+=1<=y+m?E/k:E*Math.pow(2,1-m))*k&&(y++,k/=2),D<=y+m?(j=0,y=D):1<=y+m?(j=(C*k-1)*Math.pow(2,_),y+=m):(j=C*Math.pow(2,m-1)*Math.pow(2,_),y=0));8<=_;v[b+h]=255&j,h+=A,j/=256,_-=8);for(y=y<<_|j,I+=_;0<I;v[b+h]=255&y,h+=A,y/=256,I-=8);v[b+h-A]|=128*T}}).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(i,o,a,l,d,c,u,p,g){var v,C,b;function k(){}(i=r.exports={}).nextTick=(C=typeof window<"u"&&window.setImmediate,b=typeof window<"u"&&window.postMessage&&window.addEventListener,C?function(_){return window.setImmediate(_)}:b?(v=[],window.addEventListener("message",function(_){var x=_.source;x!==window&&x!==null||_.data!=="process-tick"||(_.stopPropagation(),0<v.length&&v.shift()())},!0),function(_){v.push(_),window.postMessage("process-tick","*")}):function(_){setTimeout(_,0)}),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=k,i.addListener=k,i.once=k,i.off=k,i.removeListener=k,i.removeAllListeners=k,i.emit=k,i.binding=function(_){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(_){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)})})(Xu);var om=Xu.exports;const Si=Io(om);var am=_p({"../../node_modules/classnames/index.js"(e,t){M(),function(){var n={}.hasOwnProperty;function r(){for(var o="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(o=i(o,s(l)))}return o}function s(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var l in o)n.call(o,l)&&o[l]&&(a=i(a,l));return a}function i(o,a){return a?o?o+" "+a:o+a:o}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}()}});M();M();M();var lm=wp(am()),cm=(e,t,n={baseClass:""})=>(r={})=>
64{if(typeof r=="string"){const s=r;return t[`${e}-${s}`]&&n.baseClass+t[`${e}-${s}`]||""}else if(typeof r=="object"){const s=r,i={};for(let a in s)i[t[`${e}--${a}`]]=s[a];const o=t[e];return n.baseClass+(0,lm.default)(P({[o]:!!o},i))}else return n.baseClass+t[e]||""},ie=cm;M();var dm={ActionBar:"_ActionBar_rvadt_1","ActionBar-label":"_ActionBar-label_rvadt_18","ActionBar-action":"_ActionBar-action_rvadt_30","ActionBar-group":"_ActionBar-group_rvadt_38"},Lr=ie("ActionBar",dm),vt=({label:e,children:t})=>f.jsxs("div",{className:Lr(),onClick:n=>{n.stopPropagation()},children:[e&&f.jsx(vt.Group,{children:f.jsx("div",{className:Lr("label"),children:e})}),t]}),um=({children:e,label:t,onClick:n})=>f.jsx("button",{type:"button",className:Lr("action"),onClick:n,title:t,children:e}),fm=({children:e})=>f.jsx("div",{className:Lr("group"),children:e}),pm=({label:e})=>f.jsx("div",{className:Lr("label"),children:e});vt.Action=um;vt.Label=pm;vt.Group=fm;M();M();var hm={IconButton:"_IconButton_swpni_1","IconButton--disabled":"_IconButton--disabled_swpni_20","IconButton-title":"_IconButton-title_swpni_33"};M();M();M();M();var Ol=(e,t,n)=>{const r=Array.from(e),[s]=r.splice(t,1);return r.splice(n,0,s),r};M();var gm=(e,t,n)=>{const r=Array.from(e);return r.splice(t,1),r.splice(t,0,n),r};M();M();M();M();var vm=(e,t,n)=>{if(typeof t.state=="object"){const r=P(P({},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."),st(r,n.config))}return P(P({},e),t.state(e))};M();M();var Ln=(e,t,n)=>{const r=Array.from(e||[]);return r.splice(t,0,n),r};M();var it=e=>e?`${e}-${Za()}`:Za();M();var $r=(e,t)=>{const[n]=e.split(":"),r=t.indexes.nodes[n];return((r==null?void 0:r.path)||[]).map(s=>s.split(":")[0])};M();var Ku=(e,t,n=!1)=>{const r=it(e.type);return gc($(P({},e),{props:n?$(P({},e.props),{id:r}):P({},e.props)}),t,s=>s.map(i=>{const o=it(i.type);return $(P({},i),{props:n?$(P({},i.props),{id:o}):P({id:o},i.props)})}))};function Gu(e,t,n){const r=t.id||it(t.componentType),s=Ku({type:t.componentType,props:$(P({},n.config.components[t.componentType].defaultProps||{}),{id:r})},n.config),[i]=t.destinationZone.split(":"),o=$r(t.destinationZone,e);return st(e,n.config,(a,l)=>l===t.destinationZone?Ln(a||[],t.destinationIndex,s):a,(a,l)=>a.props.id===r||a.props.id===i||o.includes(a.props.id)||l.includes(t.destinationZone)?a:null)}M();var mm=(e,t,n)=>{const[r]=t.destinationZone.split(":"),s=$r(t.destinationZone,e),i=e.indexes.zones[t.destinationZone].contentIds[t.destinationIndex];if(i!==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=gc(t.data,n.config,(c,u)=>(a.push(`${u.parentId}:${u.propName}`),c.map(p=>{const g=it(p.type);return $(P({},p),{props:P({id:g},p.props)})}))),d=P({},e);return Object.keys(e.indexes.zones).forEach(c=>{c.split(":")[0]===i&&(a.includes(c)||delete d.indexes.zones[c])}),st(d,n.config,(c,u)=>{const p=[...c];return u===t.destinationZone&&(p[t.destinationIndex]=l),p},(c,u)=>{const p=u.map(g=>g.split(":")[0]);return c.props.id===l.props.id?l:c.props.id===r||s.indexOf(c.props.id)>-1||p.indexOf(l.props.id)>-1?c:null})};M();var ym=(e,t,n)=>st(e,n.config,r=>r,r=>r.props.id==="root"?$(P({},r),{props:P(P({},r.props),t.root.props),readOnly:t.root.readOnly}):r);M();M();function yt(e,t){var n,r;const s=(n=t.indexes.zones)==null?void 0:n[e.zone||Ve];return s?(r=t.indexes.nodes[s.contentIds[e.index]])==null?void 0:r.data:void 0}function bm(e,t,n){const r=yt({index:t.sourceIndex,zone:t.sourceZone},e),s=$r(t.sourceZone,e),i=$(P({},r),{props:$(P({},r.props),{id:it(r.type)})}),o=st(e,n.config,(a,l)=>l===t.sourceZone?Ln(a,t.sourceIndex+1,r):a,(a,l,d)=>{const c=l[l.length-1];if(l.map(g=>g.split(":")[0]).indexOf(i.props.id)>-1)return $(P({},a),{props:$(P({},a.props),{id:it(a.type)})});if(c===t.sourceZone&&d===t.sourceIndex+1)return i;const[p]=t.sourceZone.split(":");return p===a.props.id||s.indexOf(a.props.id)>-1?a:null});return $(P({},o),{ui:$(P({},o.ui),{itemSelector:{index:t.sourceIndex+1,zone:t.sourceZone}})})}M();M();M();var fo=(e,t)=>{const n=Array.from(e);return n.splice(t,1),n}
64,Ju=(e,t,n)=>{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=yt({zone:t.sourceZone,index:t.sourceIndex},e);if(!r)return e;const s=$r(t.sourceZone,e),i=$r(t.destinationZone,e);return st(e,n.config,(o,a)=>a===t.sourceZone&&a===t.destinationZone?Ln(fo(o,t.sourceIndex),t.destinationIndex,r):a===t.sourceZone?fo(o,t.sourceIndex):a===t.destinationZone?Ln(o,t.destinationIndex,r):o,(o,a)=>{const[l]=t.sourceZone.split(":"),[d]=t.destinationZone.split(":"),c=o.props.id;return l===c||d===c||r.props.id===c||s.indexOf(c)>-1||i.indexOf(c)>-1||a.includes(t.destinationZone)?o:null})},_m=(e,t,n)=>Ju(e,{sourceIndex:t.sourceIndex,sourceZone:t.destinationZone,destinationIndex:t.destinationIndex,destinationZone:t.destinationZone},n);M();var xm=(e,t,n)=>{const r=yt({index:t.index,zone:t.zone},e),s=Object.entries(e.indexes.nodes).reduce((o,[a,l])=>l.path.map(c=>c.split(":")[0]).includes(r.props.id)?[...o,a]:o,[r.props.id]),i=st(e,n.config,(o,a)=>a===t.zone?fo(o,t.index):o);return Object.keys(i.data.zones||{}).forEach(o=>{const a=o.split(":")[0];s.includes(a)&&i.data.zones&&delete i.data.zones[o]}),Object.keys(i.indexes.zones).forEach(o=>{const a=o.split(":")[0];s.includes(a)&&delete i.indexes.zones[o]}),s.forEach(o=>{delete i.indexes.nodes[o]}),i};M();var Ss={};function wm(e,t){return Ss[t.zone]?$(P({},e),{data:$(P({},e.data),{zones:$(P({},e.data.zones),{[t.zone]:Ss[t.zone]})}),indexes:$(P({},e.indexes),{zones:$(P({},e.indexes.zones),{[t.zone]:$(P({},e.indexes.zones[t.zone]),{contentIds:Ss[t.zone].map(n=>n.props.id),type:"dropzone"})})})}):$(P({},e),{data:mc(e.data,t.zone)})}function Sm(e,t){const n=P({},e.data.zones||{}),r=P({},e.indexes.zones||{});return n[t.zone]&&(Ss[t.zone]=n[t.zone],delete n[t.zone]),delete r[t.zone],$(P({},e),{data:$(P({},e.data),{zones:n}),indexes:$(P({},e.indexes),{zones:r})})}M();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."),st($(P({},e),{data:P(P({},e.data),t.data)}),n.config)):st($(P({},e),{data:P(P({},e.data),t.data(e.data))}),n.config);M();var km=(e,t)=>typeof t.ui=="object"?$(P({},e),{ui:P(P({},e.ui),t.ui)}):$(P({},e),{ui:P(P({},e.ui),t.ui(e.ui))});M();var Rr=e=>{const{data:t,ui:n}=e;return{data:t,ui:n}};M();function Em(e,t,n){return(r,s)=>{const i=e(r,s),o=!["registerZone","unregisterZone","setData","setUi","set"].includes(s.type);return(typeof s.recordHistory<"u"?s.recordHistory:o)&&t&&t(i),n==null||n(s,Rr(i),Rr(r)),i}}function Al({record:e,onAction:t,appStore:n}){return Em((r,s)=>s.type==="set"?vm(r,s,n):s.type==="insert"?Gu(r,s,n):s.type==="replace"?mm(r,s,n):s.type==="replaceRoot"?ym(r,s,n):s.type==="duplicate"?bm(r,s,n):s.type==="reorder"?_m(r,s,n):s.type==="move"?Ju(r,s,n):s.type==="remove"?xm(r,s,n):s.type==="registerZone"?wm(r,s):s.type==="unregisterZone"?Sm(r,s):s.type==="setData"?Im(r,s,n):s.type==="setUi"?km(r,s):r,e,t)}M();M();var Ml={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"},on=xc()(wc(e=>({held:{},hold:t=>e(n=>n.held[t]?n:{held:$(P({},n.held),{[t]:!0})}),release:t=>e(n=>n.held[t]?{held:$(P({},n.held),{[t]:!1})}:n),reset:(t={})=>e(()=>({held:t})),triggers:{}}))),Qu=e=>{const t=s=>{const i=Ml[s.code];if(i){on.getState().hold(i);const{held:o,triggers:a}=on.getState();Object.values(a).forEach(({combo:l,cb:d})=>{Object.entries(l).every(([u,p])=>p===!!o[u])&&Object.entries(o).every(([u,p])=>p===!!l[u])&&(s.preventDefault(),d())}),i!=="meta"&&i!=="ctrl"&&i!=="shift"&&on.getState().release(i)}},n=s=>{const i=Ml[s.code];i&&(i==="meta"?on.getState().reset():on.getState().release(i))},r=s=>{document.visibilityState==="hidden"&&on.getState().reset()};return e.addEventListener("keydown",t),e.addEventListener("keyup",n),e.addEventListener("visibilitychange",r),()=>{e.removeEventListener("keydown",t),e.removeEventListener("keyup",n),e.removeEventListener("visibilitychange",r)}},jm=()=>{S.useEffect(()=>Qu(document),[])},Ut=(e,t)=>
64{S.useEffect(()=>on.setState(n=>({triggers:$(P({},n.triggers),{[`${Object.keys(e).join("+")}`]:{combo:e,cb:t}})})),[])},Tl=0;function Cm(e,t=300){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var Ll=e=>$(P({},e),{ui:$(P({},e.ui),{field:{focus:null}})}),Pm=(e,t)=>{const n=Cm(r=>{const{histories:s,index:i}=t().history,o={state:r,id:it("history")},a=[...s.slice(0,i+1),o];e({history:$(P({},t().history),{histories:a,index:a.length-1})})},250);return{initialAppState:{},index:Tl,histories:[],hasPast:()=>t().history.index>Tl,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:i}=t();if(s.hasPast()){const o=Ll(((r=s.prevHistory())==null?void 0:r.state)||s.initialAppState);i({type:"set",state:o}),e({history:$(P({},s),{index:s.index-1})})}},forward:()=>{var r;const{history:s,dispatch:i}=t();if(s.hasFuture()){const o=(r=s.nextHistory())==null?void 0:r.state;i({type:"set",state:o?Ll(o):{}}),e({history:$(P({},s),{index:s.index+1})})}},setHistories:r=>{var s;const{dispatch:i,history:o}=t();i({type:"set",state:((s=r[r.length-1])==null?void 0:s.state)||o.initialAppState}),e({history:$(P({},o),{histories:r,index:r.length-1})})},setHistoryIndex:r=>{var s;const{dispatch:i,history:o}=t();i({type:"set",state:((s=o.histories[r])==null?void 0:s.state)||o.initialAppState}),e({history:$(P({},o),{index:r})})},record:n}};function Dm(e,{histories:t,index:n,initialAppState:r}){S.useEffect(()=>e.setState({history:$(P({},e.getState().history),{histories:t,index:n,initialAppState:r})}),[t,n,r]);const s=()=>{e.getState().history.back()},i=()=>{e.getState().history.forward()};Ut({meta:!0,z:!0},s),Ut({meta:!0,shift:!0,z:!0},i),Ut({meta:!0,y:!0},i),Ut({ctrl:!0,z:!0},s),Ut({ctrl:!0,shift:!0,z:!0},i),Ut({ctrl:!0,y:!0},i)}M();var Om=(e,t)=>({nodes:{},registerNode:(n,r)=>{const s=t().nodes,i={id:n,methods:{sync:()=>null,hideOverlay:()=>null,showOverlay:()=>null},element:null},o=s.nodes[n];e({nodes:$(P({},s),{nodes:$(P({},s.nodes),{[n]:$(P(P(P({},i),o),r),{id:n})})})})},unregisterNode:n=>{const r=t().nodes;if(r.nodes[n]){const i=P({},r.nodes);delete i[n],e({nodes:$(P({},r),{nodes:i})})}}});M();M();var $l=(e,t)=>{const n=[];return st(e,t,r=>r,r=>(n.push(r),null)),n},Am=(e,t)=>{const n=(...s)=>Ce(void 0,[...s],function*(i={},o){const{state:a,permissions:l,config:d}=t(),{cache:c,globalPermissions:u}=l,p=(k,_=!1)=>Ce(void 0,null,function*(){var x,y,j;const{config:I,state:D,setComponentLoading:m}=t(),E=k.type==="root"?I.root:I.components[k.type];if(!E)return;const h=P(P({},u),E.permissions);if(E.resolvePermissions){const A=Oo(k,(x=c[k.props.id])==null?void 0:x.lastData);if(Object.values(A).some(T=>T===!0)||_){const T=m(k.props.id,!0,50),R=yield E.resolvePermissions(k,{changed:A,lastPermissions:((y=c[k.props.id])==null?void 0:y.lastPermissions)||null,permissions:h,appState:Rr(D),lastData:((j=c[k.props.id])==null?void 0:j.lastData)||null}),N=t().permissions;e({permissions:$(P({},N),{cache:$(P({},N.cache),{[k.props.id]:{lastData:k,lastPermissions:R}}),resolvedPermissions:$(P({},N.resolvedPermissions),{[k.props.id]:R})})}),T()}}}),g=(k=!1)=>{const{state:_}=t();p({type:"root",props:$(P({},_.data.root.props),{id:"root"})},k)},{item:v,type:C,root:b}=i;v?yield p(v,o):C?$l(a,d).filter(k=>k.type===C).map(k=>Ce(void 0,null,function*(){yield p(k,o)})):b?g(o):$l(a,d).map(k=>Ce(void 0,null,function*(){yield p(k,o)}))});return{cache:{},globalPermissions:{drag:!0,edit:!0,delete:!0,duplicate:!0,insert:!0},resolvedPermissions:{},getPermissions:({item:s,type:i,root:o}={})=>{const{config:a,permissions:l}=t(),{globalPermissions:d,resolvedPermissions:c}=l;if(s){const u=a.components[s.type],p=P(P({},d),u==null?void 0:u.permissions),g=c[s.props.id];return g?P(P({},d),g):p}else if(i){const u=a.components[i];return P(P({},d),u==null?void 0:u.permissions)}else if(o){const u=a.root,p=P(P({},d),u==null?void 0:u.permissions),g=c.root;return g?P(P({},d),g):p}return d},resolvePermissions:n,refreshPermissions:s=>n(s,!0)}},Mm=(e,t)=>{S.useEffect(()=>{const{permissions:n}=e.getState(),{globalPermissions:r}=n;e.setState({permissions:$(P({},n),{globalPermissions:P(P({},r),t)})}),n.resolvePermissions()},[t]),S.useEffect(()=>e.subscribe(n=>n.state.data,()=>{e.getState().permissions.resolvePermissions()}),[]),S.useEffect(()=>e.subscribe(n=>n.config,()=>{e.getState().permissions.resolvePermissions()}),[])};M();var Tm=(e,t)=>
64({fields:{},loading:!1,lastResolvedData:{},id:void 0}),Lm=(e,t)=>{const n=S.useCallback(r=>Ce(void 0,null,function*(){var s,i;const{fields:o,lastResolvedData:a}=e.getState().fields,l=e.getState().state.indexes.nodes,d=l[t||"root"],c=d==null?void 0:d.data,u=d!=null&&d.parentId?l[d.parentId]:null,p=(u==null?void 0:u.data)||null,{getComponentConfig:g,state:v}=e.getState(),C=g(c==null?void 0:c.type);if(!c||!C)return;const b=C.fields||{},k=C.resolveFields;let _=o;if(r&&(e.setState(x=>({fields:$(P({},x.fields),{fields:b,id:t})})),_=b),k){const x=setTimeout(()=>{e.setState(D=>({fields:$(P({},D.fields),{loading:!0})}))},50),y=((s=a.props)==null?void 0:s.id)===t?a:null,j=Oo(c,y),I=yield k(c,{changed:j,fields:b,lastFields:_,lastData:y,appState:Rr(v),parent:p});if(clearTimeout(x),((i=e.getState().selectedItem)==null?void 0:i.props.id)!==t)return;e.setState({fields:{fields:I,loading:!1,lastResolvedData:c,id:t}})}else e.setState(x=>({fields:$(P({},x.fields),{fields:b,id:t})}))}),[t]);S.useEffect(()=>(n(!0),e.subscribe(r=>r.state.indexes.nodes[t||"root"],()=>n())),[t])};M();var $m=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}},Rm={title:{type:"text"}},ef=e=>xc()(wc((t,n)=>{var r,s;return $(P({state:Ti,config:{components:{}},componentState:{},plugins:[],overrides:{},viewports:Ds,zoomConfig:{autoZoom:1,rootHeight:0,zoom:1},status:"LOADING",iframe:{},metadata:{},fieldTransforms:{}},e),{fields:Tm(),history:Pm(t,n),nodes:Om(t,n),permissions:Am(t,n),getComponentConfig:i=>{var o;const{config:a,selectedItem:l}=n(),d=((o=a.root)==null?void 0:o.fields)||Rm;return i&&i!=="root"?a.components[i]:l?a.components[l.type]:$(P({},a.root),{fields:d})},selectedItem:(r=e==null?void 0:e.state)!=null&&r.ui.itemSelector?yt((s=e==null?void 0:e.state)==null?void 0:s.ui.itemSelector,e.state):null,dispatch:i=>t(o=>{var a,l;const{record:d}=n().history,u=Al({record:d,appStore:o})(o.state,i),p=u.ui.itemSelector?yt(u.ui.itemSelector,u):null;return(l=(a=n()).onAction)==null||l.call(a,i,u,n().state),$(P({},o),{state:u,selectedItem:p})}),setZoomConfig:i=>t({zoomConfig:i}),setStatus:i=>t({status:i}),setComponentState:i=>t({componentState:i}),pendingLoadTimeouts:{},setComponentLoading:(i,o=!0,a=0)=>{const{setComponentState:l,pendingLoadTimeouts:d}=n(),c=it(),u=()=>{var v;const{componentState:C}=n();l($(P({},C),{[i]:$(P({},C[i]),{loadingCount:(((v=C[i])==null?void 0:v.loadingCount)||0)+1})}))},p=()=>{var v;const{componentState:C}=n();clearTimeout(g),delete d[c],t({pendingLoadTimeouts:d}),l($(P({},C),{[i]:$(P({},C[i]),{loadingCount:Math.max((((v=C[i])==null?void 0:v.loadingCount)||0)-1,0)})}))},g=setTimeout(()=>{o?u():p(),delete d[c],t({pendingLoadTimeouts:d})},a);return t({pendingLoadTimeouts:$(P({},d),{[i]:g})}),p},unsetComponentLoading:i=>{const{setComponentLoading:o}=n();o(i,!1)},setUi:(i,o)=>t(a=>{const d=Al({record:()=>{},appStore:a})(a.state,{type:"setUi",ui:i,recordHistory:o}),c=d.ui.itemSelector?yt(d.ui.itemSelector,d):null;return $(P({},a),{state:d,selectedItem:c})}),resolveComponentData:(i,o)=>Ce(void 0,null,function*(){const{config:a,metadata:l,setComponentLoading:d,permissions:c}=n(),u={};return yield vc(i,a,l,p=>{const g="id"in p.props?p.props.id:"root";u[g]=d(g,!0,50)},p=>Ce(void 0,null,function*(){const g="id"in p.props?p.props.id:"root";"type"in p?yield c.refreshPermissions({item:p}):yield c.refreshPermissions({root:!0}),u[g]()}),o)}),resolveAndCommitData:()=>Ce(void 0,null,function*(){const{config:i,state:o,dispatch:a,resolveComponentData:l}=n();st(o,i,d=>d,d=>(l(d,"load").then(c=>{const{state:u}=n(),p=u.indexes.nodes[c.node.props.id];if(p&&c.didChange)if(c.node.props.id==="root")a({type:"replaceRoot",root:$m(c.node)});else{const g=`${p.parentId}:${p.zone}`,C=u.indexes.zones[g].contentIds.indexOf(c.node.props.id);a({type:"replace",data:c.node,destinationIndex:C,destinationZone:g})}}),d))})})})),Ma=S.createContext(ef());function F(e){const t=S.useContext(Ma);return Mo(t,e)}function et(){return S.useContext(Ma)}M();M();M();var Nm="Invariant failed";function zm(e,t){throw new Error(Nm)}var as=function(t){var n=t.top,r=t.right,s=t.bottom,i=t.left,o=r-i,a=s-n,l={top:n,right:r,bottom:s,left:i,width:o,height:a,x:i,y:n,center:{x:(r+i)/2,y:(s+n)/2}};return l}
64,Fm=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Rl=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Ii={top:0,right:0,bottom:0,left:0},Bm=function(t){var n=t.borderBox,r=t.margin,s=r===void 0?Ii:r,i=t.border,o=i===void 0?Ii:i,a=t.padding,l=a===void 0?Ii:a,d=as(Fm(n,s)),c=as(Rl(n,o)),u=as(Rl(c,l));return{marginBox:d,borderBox:as(n),paddingBox:c,contentBox:u,margin:s,border:o,padding:l}},at=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var s=Number(n);return isNaN(s)&&zm(),s},Wm=function(t,n){var r={top:at(n.marginTop),right:at(n.marginRight),bottom:at(n.marginBottom),left:at(n.marginLeft)},s={top:at(n.paddingTop),right:at(n.paddingRight),bottom:at(n.paddingBottom),left:at(n.paddingLeft)},i={top:at(n.borderTopWidth),right:at(n.borderRightWidth),bottom:at(n.borderBottomWidth),left:at(n.borderLeftWidth)};return Bm({borderBox:t,margin:r,padding:s,border:i})},tf=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return Wm(n,r)},Hm=(e,t,n)=>{const r=tf(t),{width:s,height:i}=r.contentBox,o=e.height==="auto"?i:e.height;let a=0,l=1;if(e.width>s||o>i){const d=Math.min(s/e.width,1),c=Math.min(i/o,1);n=d,d<c?a=o/n:(a=o,n=c),l=n}else l=1,n=1,a=o;return{autoZoom:l,rootHeight:a,zoom:n}},nf=e=>{const t=et();return r=>{const{state:s,zoomConfig:i,setZoomConfig:o}=t.getState(),{viewports:a}=s.ui,l=(r==null?void 0:r.viewports)||a;e.current&&o(Hm(l==null?void 0:l.current,e.current,i.zoom))}};M();var Um={Loader:"_Loader_nacdm_13","loader-animation":"_loader-animation_nacdm_1"},Vm=ie("Loader",Um),gn=e=>{var t=e,{color:n,size:r=16}=t,s=Kt(t,["color","size"]);return f.jsx("span",P({className:Vm(),style:{width:r,height:r,color:n},"aria-label":"loading"},s))},Nl=ie("IconButton",hm),bt=({children:e,href:t,onClick:n,variant:r="primary",type:s,disabled:i,tabIndex:o,newTab:a,fullWidth:l,title:d})=>{const[c,u]=S.useState(!1),p=t?"a":"button";return f.jsxs(p,{className:Nl({primary:r==="primary",secondary:r==="secondary",disabled:i,fullWidth:l}),onClick:v=>{n&&(u(!0),Promise.resolve(n(v)).then(()=>{u(!1)}))},type:s,disabled:i||c,tabIndex:o,target:a?"_blank":void 0,rel:a?"noreferrer":void 0,href:t,title:d,children:[f.jsx("span",{className:Nl("title"),children:d}),e,c&&f.jsxs(f.Fragment,{children:["  ",f.jsx(gn,{size:14})]})]})};M();M();var Zm={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"};M();var Ym=/^(data-.*)$/,qm=e=>{let t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&Ym.test(n)&&(t[n]=e[n]);return t},ki=ie("Button",Zm),po=e=>{var t=e,{children:n,href:r,onClick:s,variant:i="primary",type:o,disabled:a,tabIndex:l,newTab:d,fullWidth:c,icon:u,size:p="medium",loading:g=!1}=t,v=Kt(t,["children","href","onClick","variant","type","disabled","tabIndex","newTab","fullWidth","icon","size","loading"]);const[C,b]=S.useState(g);S.useEffect(()=>b(g),[g]);const k=r?"a":o?"button":"span",_=qm(v);return f.jsxs(k,$(P({className:ki({primary:i==="primary",secondary:i==="secondary",disabled:a,fullWidth:c,[p]:!0}),onClick:y=>{s&&(b(!0),Promise.resolve(s(y)).then(()=>{b(!1)}))},type:o,disabled:a||C,tabIndex:l,target:d?"_blank":void 0,rel:d?"noreferrer":void 0,href:r},_),{children:[u&&f.jsx("div",{className:ki("icon"),children:u}),n,C&&f.jsx("div",{className:ki("spinner"),children:f.jsx(gn,{size:14})})]}))};M();M();var Yn={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"};M();M();M();var rf={ArrayField:"_ArrayField_14u8o_5","ArrayField--isDraggingFrom":"_ArrayField--isDraggingFrom_14u8o_13","ArrayField-addButton":"_ArrayField-addButton_14u8o_18","ArrayField--hasItems":"_ArrayField--hasItems_14u8o_33","ArrayField-inner":"_ArrayField-inner_14u8o_59",ArrayFieldItem:"_ArrayFieldItem_14u8o_67","ArrayFieldItem--isDragging":"_ArrayFieldItem--isDragging_14u8o_78","ArrayFieldItem--isExpanded":"_ArrayFieldItem--isExpanded_14u8o_82","ArrayFieldItem-summary":"_ArrayFieldItem-summary_14u8o_97","ArrayField--addDisabled":"_ArrayField--addDisabled_14u8o_127","ArrayFieldItem-body":"_ArrayFieldItem-body_14u8o_166","ArrayFieldItem-fieldset":"_ArrayFieldItem-fieldset_14u8o_175","ArrayFieldItem-rhs":"_ArrayFieldItem-rhs_14u8o_183","ArrayFieldItem-actions":"_ArrayFieldItem-actions_14u8o_189"};M();M();M();var Xm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sf=(...e)=>
64e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();M();M();var Km={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"},Gm=S.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:d}=n,c=Kt(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return S.createElement("svg",P($(P({ref:t},Km),{width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:sf("lucide",a)}),c),[...d.map(([u,p])=>S.createElement(u,p)),...Array.isArray(l)?l:[l]])}),pe=(e,t)=>{const n=S.forwardRef((r,s)=>{var i=r,{className:o}=i,a=Kt(i,["className"]);return S.createElement(Gm,P({ref:s,iconNode:t,className:sf(`lucide-${Xm(e)}`,o)},a))});return n.displayName=`${e}`,n};M();var ii=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);M();var Jm=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);M();var of=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);M();var Qm=pe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);M();var af=pe("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"}]]);M();var ey=pe("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);M();var ty=pe("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"}]]);M();var zl=pe("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"}]]);M();var ny=pe("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"}]]);M();var ry=pe("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"}]]);M();var sy=pe("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"}]]);M();var lf=pe("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"}]]);M();var iy=pe("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"}]]);M();var oy=pe("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"}]]);M();var ay=pe("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"}]]);M();var ly=pe("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"}]]);M();var cy=pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);M();var dy=pe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);M();var uy=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);M();var fy=pe("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"}]]);M();var py=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);M();var hy=pe("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"}]]);M();var gy=pe("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);M();var vy=pe("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"}]]);M();var cf=pe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
64],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);M();var Ta=pe("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"}]]);M();var my=pe("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"}]]);M();var yy=pe("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"}]]);M();var by=pe("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"}]]);M();M();M();var _y={DragIcon:"_DragIcon_17p8x_1","DragIcon--disabled":"_DragIcon--disabled_17p8x_8"},xy=ie("DragIcon",_y),df=({isDragDisabled:e})=>f.jsx("div",{className:xy({disabled:e}),children:f.jsx("svg",{viewBox:"0 0 20 20",width:"12",fill:"currentColor",children:f.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"})})});M();M();var Fl={delay:{value:200,tolerance:10}},Bl={delay:{value:200,tolerance:10},distance:{value:5}},uf=({other:e=Bl,mouse:t,touch:n=Fl}={touch:Fl,other:Bl})=>{const[r]=S.useState(()=>[fu.configure({activationConstraints(s,i){var o;const{pointerType:a,target:l}=s;return a==="mouse"&&Wn(l)&&(i.handle===l||(o=i.handle)!=null&&o.contains(l))?t:a==="touch"?n:e}})]);return r};M();M();M();var Pn=(e,t,n,r,s)=>{},Ei="increasing",wy=(e,t)=>{var n;const{dragOperation:r,droppable:s}=e,{shape:i}=s,{position:o}=r,a=(n=r.shape)==null?void 0:n.current;if(!a||!i)return null;const l=i.center,d=Math.sqrt(Math.pow(l.x-t.x,2)+Math.pow(l.y-t.y,2)),c=Math.sqrt(Math.pow(l.x-o.current.x,2)+Math.pow(l.y-o.current.y,2));return Ei=c===d?Ei:c<d?"decreasing":"increasing",Pn(a.center,l,s.id.toString()),Ei==="decreasing"?{id:s.id,value:1,type:Pt.Collision}:null};M();var ff=(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";M();var Sy=(e,t,n,r=0)=>{const s=e.boundingRectangle,i=t.center;if(n==="down"){const a=r*t.boundingRectangle.height;return s.bottom>=i.y+a}else if(n==="up"){const a=r*t.boundingRectangle.height;return s.top<i.y-a}else if(n==="left"){const a=r*t.boundingRectangle.width;return i.x-a>=s.left}const o=r*t.boundingRectangle.width;return s.right-o>=i.x};M();var Wl=10,ft={current:{x:0,y:0},delta:{x:0,y:0},previous:{x:0,y:0},direction:null},Iy=(e,t="dynamic")=>(ft.current=e,ft.delta={x:e.x-ft.previous.x,y:e.y-ft.previous.y},ft.direction=ff(t,ft.delta)||ft.direction,(Math.abs(ft.delta.x)>Wl||Math.abs(ft.delta.y)>Wl)&&(ft.previous=Ze.from(e)),ft);M();var ky=({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=Ze.distance(t.shape.center,n);return{id:r,value:1/s,type:Pt.PointerIntersection,priority:ct.High}}return null},Ey=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const i=r?_t.from(r.current.boundingRectangle).corners:void 0,a=_t.from(n.shape.boundingRectangle).corners.reduce((l,d,c)=>{var u;return l+Ze.distance(Ze.from(d),(u=i==null?void 0:i[c])!=null?u:s.current)},0)/4;return{id:n.id,value:1/a,type:Pt.Collision,priority:ct.Normal}};M();var ho=Fr(()=>({fallbackEnabled:!1})),ji="",pf=(e,t=.05)=>n=>{var r,s,i,o,a;const{dragOperation:l,droppable:d}=n,{position:c}=l,u=(r=l.shape)==null?void 0:r.current,{shape:p}=d;if(!u||!p)return null;const{center:g}=u,{fallbackEnabled:v}=ho.getState(),C=Iy(c.current,e),b={direction:C.direction},{center:k}=p,_=Sy(u,p,C.direction,t);if(((s=l.source)==null?void 0:s.id)===d.id){const j=wy(n,C.previous);if(Pn(g,k,d.id.toString()),j)return $(P({},j),{priority:ct.Highest,data:b})}const x=u.intersectionArea(p),y=x/p.area;if(x&&_){Pn(g,k,d.id.toString());const j={id:d.id,value:y,priority:ct.High,type:Pt.Collision},I=ji===d.id;return ji="",$(P({},j),{id:I?"flush":j.id,data:b})}if(v&&((i=l.source)==null?void 0:i.id)!==d.id){const j=p.boundingRectangle.right>u.boundingRectangle.left&&p.boundingRectangle.left<u.boundingRectangle.right,I=p.boundingRectangle.bottom>u.boundingRectangle.top&&p.boundingRectangle.top<u.boundingRectangle.bottom;if(e==="y"&&j||I){const D=Ey(n);if(D){const m=ff(e,{x:u.center.x-(((o=d.shape)==null?void 0:o.center.x)||0),y:u.center.y-(((a=d.shape)==null?void 0:a.center.y)||0)});return b.direction=m,x?(Pn(g,k,d.id.toString()),ji=d.id,$(P({},D),{priority:ct.Low,data:b})):(Pn(g,k,d.id.toString()),$(P({},D),{priority:ct.Lowest,data:b}))}}}return Pn(g,k,d.id.toString()),null},jy=({children:e,onDragStart:t,onDragEnd:n,onMove:r})=>{const s=uf({mouse:{distance:{value:5}}});return f.jsx(Eu,{sensors:s,onDragStart:i=>{var o,a;return t((a=(o=i.operation.source)==null?void 0:o.id.toString())!=null?a:"")},onDragOver:(i,o)=>{var a;i.preventDefault();const{operation:l}=i,{source:d,target:c}=l;
64if(!d||!c)return;let u=d.data.index,p=c.data.index;const g=(a=o.collisionObserver.collisions[0])==null?void 0:a.data;if(u!==p&&d.id!==c.id){const v=(g==null?void 0:g.direction)==="up"?"before":"after";p>=u&&(p=p-1),v==="after"&&(p=p+1),r({source:u,target:p})}},onDragEnd:()=>{setTimeout(()=>{n()},250)},children:e})},Cy=({id:e,index:t,disabled:n,children:r,type:s="item"})=>{const{ref:i,isDragging:o,isDropping:a,handleRef:l}=qu({id:e,type:s,index:t,disabled:n,data:{index:t},collisionDetector:pf("y")});return r({isDragging:o,isDropping:a,ref:i,handleRef:l})};M();var Ys=S.createContext({}),hf=()=>{const e=S.useContext(Ys);return $(P({},e),{readOnlyFields:e.readOnlyFields||{}})},gf=({children:e,name:t,subName:n,wildcardName:r=t,readOnlyFields:s})=>{const i=`${t}.${n}`,o=`${r}.${n}`,a=S.useMemo(()=>Object.keys(s).reduce((l,d)=>{if(d.indexOf(i)>-1||d.indexOf(o)>-1){const u=new RegExp(`^(${t}|${r}).`.replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\./g,"\\.").replace(/\*/g,"\\*")),p=d.replace(u,"");return $(P({},l),{[p]:s[d]})}return l},{}),[t,n,r,s]);return f.jsx(Ys.Provider,{value:{readOnlyFields:a,localName:n},children:e})},Ci=ie("ArrayField",rf),Nt=ie("ArrayFieldItem",rf),Py=({field:e,onChange:t,value:n,name:r,label:s,labelIcon:i,readOnly:o,id:a,Label:l=d=>f.jsx("div",P({},d))})=>{const d=F(R=>R.state.ui.arrayState[a]),c=F(R=>R.setUi),{readOnlyFields:u,localName:p=r}=hf(),g=n,v=d||{items:Array.from(g||[]).map((R,N)=>({_originalIndex:N,_arrayId:`${a}-${N}`})),openId:""},[C,b]=S.useState({arrayState:v,value:g});S.useEffect(()=>{var R;const N=(R=k.getState().state.ui.arrayState[a])!=null?R:v;b({arrayState:N,value:g})},[g]);const k=et(),_=S.useCallback(R=>{const N=k.getState().state;return{arrayState:$(P({},N.ui.arrayState),{[a]:P(P({},v),R)})}},[v,k]),x=S.useCallback(()=>v.items.reduce((R,N)=>N._originalIndex>R?N._originalIndex:R,-1),[v]),y=S.useCallback(R=>{let N=x();const U=Array.from(R||[]).map((z,K)=>{var V;const X=v.items[K],G={_originalIndex:typeof(X==null?void 0:X._originalIndex)<"u"?X._originalIndex:N+1,_arrayId:((V=v.items[K])==null?void 0:V._arrayId)||`${a}-${N+1}`};return G._originalIndex>N&&(N=G._originalIndex),G});return $(P({},v),{items:U})},[v]);S.useEffect(()=>{v.items.length>0&&c(_(v))},[]);const[j,I]=S.useState(""),D=!!j,E=!F(R=>R.permissions.getPermissions({item:R.selectedItem}).edit),h=S.useRef(g),A=S.useCallback(R=>{if(e.type!=="array"||!e.arrayFields)return;const N=k.getState().config;return Ps({value:R,fields:e.arrayFields,mappers:{slot:({value:U})=>U.map(K=>Ku(K,N,!0))},config:N})},[k,e]);if(e.type!=="array"||!e.arrayFields)return null;const T=e.max!==void 0&&C.arrayState.items.length>=e.max||o;return f.jsx(l,{label:s||r,icon:i||f.jsx(iy,{size:16}),el:"div",readOnly:o,children:f.jsx(jy,{onDragStart:R=>I(R),onDragEnd:()=>{I(""),t(h.current)},onMove:R=>{if(v.items[R.source]._arrayId!==j)return;const N=Ol(C.value,R.source,R.target),U=Ol(v.items,R.source,R.target),z=k.getState().state,K={arrayState:$(P({},z.ui.arrayState),{[a]:$(P({},v),{items:U})})};c(K,!1),b({value:N,arrayState:$(P({},v),{items:U})}),h.current=N},children:f.jsxs("div",{className:Ci({hasItems:Array.isArray(g)&&g.length>0,addDisabled:T}),children:[C.arrayState.items.length>0&&f.jsx("div",{className:Ci("inner"),"data-dnd-container":!0,children:C.arrayState.items.map((R,N)=>{const{_arrayId:U=`${a}-${N}`,_originalIndex:z=N}=R,K=Array.from(C.value||[])[N]||{};return f.jsx(Cy,{id:U,index:N,disabled:o,children:({isDragging:V,ref:X,handleRef:G})=>f.jsxs("div",{ref:X,className:Nt({isExpanded:v.openId===U,isDragging:V,readOnly:o}),children:[f.jsxs("div",{ref:G,onClick:q=>{V||(q.preventDefault(),q.stopPropagation(),v.openId===U?c(_({openId:""})):c(_({openId:U})))},className:Nt("summary"),children:[e.getItemSummary?e.getItemSummary(K,N):`Item #${z}`,f.jsxs("div",{className:Nt("rhs"),children:[!o&&f.jsxs("div",{className:Nt("actions"),children:[f.jsx("div",{className:Nt("action"),children:f.jsx(bt,{type:"button",disabled:!!T,onClick:q=>{q.stopPropagation();const te=[...g||[]],ce=A(te[N]);te.splice(N,0,ce);const Ie=_(y(te));c(Ie,!1),t(te)},title:"Duplicate",children:f.jsx(af,{size:16})})}),f.jsx("div",{className:Nt("action"),children:f.jsx(bt,{type:"button",disabled:e.min!==void 0&&e.min>=C.arrayState.items.length,onClick:q=>{q.stopPropagation();const te=[...g||[]],ce=[...v.items||[]];te.splice(N,1),ce.splice(N,1),c(_({items:ce}),!1),t(te)},title:"Delete",children:f.jsx(cf,{size:16})})})]}),f.jsx("div",{children:f.jsx(df,{})})]})]}),f.jsx("div",{className:Nt("body"),children:v.openId===U&&f.jsx("fieldset",{className:Nt("fieldset"),children:Object.keys(e.arrayFields).map(q=>{const te=e.arrayFields[q],Ie=`${`${r}[${N}]`}.${q}`,se=`${p}[${N}]`,Ee=`${p}[*]`,De=`${se}.${q}`,Z=`${Ee}.${q}`,w=E||(typeof u[Ie]<"u"?u[De]:u[Z]),O=te.label||q;return f.jsx(gf,{name:se,wildcardName:Ee,subName:q,readOnlyFields:u,children:f.jsx(oi,{name:Ie,label:O,id:`${U}_${q}`,readOnly:w,field:$(P({},te),{label:O}),value:K[q],onChange:(L,B)=>{t(gm(g,N,$(P({},K),{[q]:L})),B)}})},Ie)})})})]})},U)})}),!T&&f.jsx("button",{type:"button",className:Ci("addButton"),onClick:()=>{var R;if(D)return;const N=g||[],U=Co(A((R=e.defaultItemProps)!=null?R:{}),e.arrayFields),z=[...N,U],K=y(z);c(_(K),!1),t(z)},children:f.jsx(uy,{size:21})})]})})})};M();var Dy=ie("Input",Yn),Hl=({field:e,onChange:t,readOnly:n,value:r,name:s,label:i,labelIcon:o,Label:a,id:l})=>{const d=r;return f.jsx(a,{label:i||s,icon:o||f.jsxs(f.Fragment,{children:[e.type==="text"&&f.jsx(Ta,{size:16}),e.type==="number"&&f.jsx(ny,{size:16})]}),readOnly:n,children:f.jsx("input",{className:Dy("input"),autoComplete:"off",type:e.type,title:i||s,name:s,value:d!=null&&d.toString?d.toString():"",onCh
64ange:c=>{if(e.type==="number"){const u=Number(c.currentTarget.value);if(typeof e.min<"u"&&u<e.min||typeof e.max<"u"&&u>e.max)return;t(u)}else t(c.currentTarget.value)},readOnly:n,tabIndex:n?-1:void 0,id:l,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})})};M();M();M();var vf={"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":"_E
64xternalInputModal-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"};M();M();var Oy={Modal:"_Modal_ikbaj_1","Modal--isOpen":"_Modal--isOpen_ikbaj_15","Modal-inner":"_Modal-inner_ikbaj_19"},Ul=ie("Modal",Oy),Ay=({children:e,onClose:t,isOpen:n})=>{const[r,s]=S.useState(null);return S.useEffect(()=>{s(document.getElementById("puck-portal-root"))},[]),r?qs.createPortal(f.jsx("div",{className:Ul({isOpen:n}),onClick:t,children:f.jsx("div",{className:Ul("inner"),onClick:i=>i.stopPropagation(),children:e})}),r):f.jsx("div",{})};M();M();var My={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"},Ty=ie("Heading",My),La=({children:e,rank:t,size:n="m"})=>{const r=t?`h${t}`:"span";return f.jsx(r,{className:Ty({[n]:!0}),children:e})};M();var ls=ie("ExternalInput",vf),be=ie("ExternalInputModal",vf),Vl={},Ly=({field:e,onChange:t,value:n=null,name:r,id:s,readOnly:i})=>{const{mapProp:o=h=>h,mapRow:a=h=>h,filterFields:l}=e||{},[d,c]=S.useState([]),[u,p]=S.useState(!1),[g,v]=S.useState(!0),C=!!l,[b,k]=S.useState(e.initialFilters||{}),[_,x]=S.useState(C),y=S.useMemo(()=>d.map(a),[d]),j=S.useMemo(()=>{const h=new Set;for(const A of y)for(const T of Object.keys(A))(typeof A[T]=="string"||typeof A[T]=="number"||S.isValidElement(A[T]))&&h.add(T);return Array.from(h)},[y]),[I,D]=S.useState(e.initialQuery||""),m=S.useCallback((h,A)=>Ce(void 0,null,function*(){v(!0);const T=`${s}-${h}-${JSON.stringify(A)}`,R=Vl[T]||(yield e.fetchList({query:h,filters:A}));R&&(c(R),v(!1),Vl[T]=R)}),[s,e]),E=S.useCallback(h=>e.renderFooter?e.renderFooter(h):f.jsxs("span",{className:be("footer"),children:[h.items.length," result",h.items.length===1?"":"s"]}),[e.renderFooter]);return S.useEffect(()=>{m(I,b)},[]),f.jsxs("div",{className:ls({dataSelected:!!n,modalVisible:u,readOnly:i}),id:s,children:[f.jsxs("div",{className:ls("actions"),children:[f.jsx("button",{type:"button",onClick:()=>p(!0),className:ls("button"),disabled:i,children:n?e.getItemSummary?e.getItemSummary(n):"External item":f.jsxs(f.Fragment,{children:[f.jsx(lf,{size:"16"}),f.jsx("span",{children:e.placeholder})]})}),n&&f.jsx("button",{type:"button",className:ls("detachButton"),onClick:()=>{t(null)},disabled:i,children:f.jsx(oy,{size:16})})]}),f.jsx(Ay,{onClose:()=>p(!1),isOpen:u,children:f.jsxs("form",{className:be({isLoading:g,loaded:!g,hasData:y.length>0,filtersToggled:_}),onSubmit:h=>{h.preventDefault(),m(I,b)},children:[f.jsx("div",{className:be("masthead"),children:e.showSearch?f.jsxs("div",{className:be("searchForm"),children:[f.jsxs("label",{className:be("search"),children:[f.jsx("span",{className:be("searchIconText"),children:"Search"}),f.jsx("div",{className:be("searchIcon"),children:f.jsx(py,{size:"18"})}),f.jsx("input",{className:be("searchInput"),name:"q",type:"search",placeholder:e.placeholder,onChange:h=>{D(h.currentTarget.value)},autoComplete:"off",value:I})]}),f.jsxs("div",{className:be("searchActions"),children:[f.jsx(po,{type:"submit",loading:g,fullWidth:!0,children:"Search"}),C&&f.jsx("div",{className:be("searchActionIcon"),children:f.jsx(bt,{type:"button",title:"Toggle filters",onClick:h=>{h.preventDefault(),h.stopPropagation(),x(!_)},children:f.jsx(hy,{size:20})})})]})]}):f.jsx(La,{rank:"2",size:"xs",children:e.placeholder||"Select data"})}),f.jsxs("div",{className:be("grid"),children:[C&&f.jsx("div",{className:be("filters"),children:C&&Object.keys(l).map(h=>{const A=l[h];return f.jsx("div",{className:be("field"),children:f.jsx(oi,{field:A,name:h,id:`external_field_${h}_filter`,label:A.label||h,value:b[h],onChange:T=>{const R=$(P({},b),{[h]:T});k(R),m(I,R)}})},h)})}),f.jsxs("div",{className:be("tableWrapper"),children:[f.jsxs("table",{className:be("table"),children:[f.jsx("thead",{className:be("thead"),children:f.jsx("tr",{className:be("tr"),children:j.map(h=>f.jsx("th",{className:be("th"),style:{textAlign:"left"},children:h},h))})}),f.jsx("tbody",{className:be("tbody"),children:y.map((h,A)=>f.jsx("tr",{style:{whiteSpace:"nowrap"},className:be("tr"),onClick:()=>{t(o(d[A])),p(!1)},children:j.map(T=>f.jsx("td",{className:be("td"),children:h[T]},T))},A))})]}),f.jsx("div",{className:be("loadingBanner"),children:f.jsx(gn,{size:24})})]})]}),f.jsx("div",{className:be("footerContainer"),children:f.jsx(E,{items:y})})]})})]})},$y=({field:e,onChange:t,value:n,name:r,label:s,labelIcon:i,Label:o,id:a,readOnly:l})=>{var d,c,u;const p=e,g=e;return S.useEffect(()=>{g.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:f.jsx(o,{label:s||r,icon:i||f.jsx(lf,{size:16}),el:"div",children:f.jsx(Ly,{name:r,field:$(P({},p),{placeholder:(d=g.adaptor)!=null&&d.name?`Select from ${g.adaptor.name}`:p.placeholder||"Select data",mapProp:((c=g.adaptor)==null?void 0:c.mapProp)||p.mapProp,mapRow:p.mapRow,fetchList:(u=g.adaptor)!=null&&u.fetchList?()=>Ce(void 0,null,function*(){return yield g.adaptor.fetchList(g.adaptorParams)}):p.fetchList}),onChange:t,value:n,id:a,readOnly:l})})};M();var cs=ie("Input",Yn),Ry=({field:e,onChange:t,readOnly:n,value:r,name:s,id:i,label:o,labelIcon:a,Label:l})=>e.type!=="radio"||!e.options?null:f.jsx(l,{icon:a||f.jsx(Qm,{size:16}),label:o||s,readOnly:n,el:"div",children:f.jsx("div",{className:cs("radioGroupItems"),id:i,children:e.options.map(d=>{var c;return f.jsxs("label",{className:cs("radio"),children:[f.jsx("input",{type:"radio",className:cs("radioInput"),value:JSON.stringify({value:d.value}),name:s,onChange:u=>{t(JSON.parse(u.target.value).value)},disabled:n,checked:r===d.value}),f.jsx("div",{className:cs("radioInner"),children:d.label||((c=d.value)==null?void 0:c.toString())})]},d.label+d.value)})})});M();var Ny=ie("Input",Yn),zy=({field:e,onChange:t,label:n,labelIcon:r,Label:s,value:i,name:o,readOnly:a,id:l})=>e.type!=="select"||!e.options?null:f.jsx(s,{label:n||o,icon:r||f.jsx(ii,{size:16}),readOnly:a,children:f.jsx("select",{id:l,title:n||o,className:Ny("input"),disabled:a,onChange:d=>{t(JSON.parse(d.target.value).value)},value:JSON.stringify({value:i}),children:e.options.map(d=>f.jsx("option",{label:d.label,value:JSON.stringify({value:d.value})},d.label+JSON.stringify(d.value)))})});M();var Fy=ie("Input",Yn),By=({field:e,onChange:t,readOnly:n,value:r,name:s,label:i,labelIcon:o,Label:a,id:l})=>f.jsx(a,{label:i||s,icon:o||f.jsx(Ta,{size:16}),readOnly:n,children:f.jsx("textarea",{id:l,className:Fy("input"),autoComplete:"off",name:s,value:typeof r>"u"?"":r,onChange:d=>t(d.currentTarget.value),readOnly:n,tabIndex:n?-1:void 0,rows:5,placeholder:e.type==="textarea"?e.placeholder:void 0})});M();M();var Wy={ObjectField:"_ObjectField_1ua3y_5","ObjectField-fieldset":"_ObjectField-fieldset_1ua3y_13"},Zl=ie("ObjectField",Wy),Hy=({field:e,onChange:t,value:n,name:r,label:s,labelIcon:i,Label:o,readOnly:a,id:l})=>{const{readOnlyFields:d,localName:c=r}=hf();if(e.type!=="object"||!e.objectFields)return null;const u=n||{};return f.jsx(o,{label:s||r,icon:i||f.jsx(ty,{size:16}),el:"div",readOnly:a,children:f.jsx("div",{className:Zl(),children:f.jsx("fieldset",{className:Zl("fieldset"),children:Object.keys(e.objectFields).map(p=>{const g=e.objectFields[p],v=`${c}.${p}`,C=a||d[v],b=g.label||p;return f.jsx(gf,{name:c||l,subName:p,readOnlyFields:d,children:f.jsx(oi,{name:v,label:v,id:`${l}_${p}`,readOnly:C,field:$(P({},g),{label:b}),value:u[p],onChange:(k,_)=>{t($(P({},u),{[p]:k}),_)}})},v)})})})})};M();var $a=()=>
64{if(typeof Vt.useId<"u")return Vt.useId();const[e]=S.useState(it());return e},Is=ie("Input",Yn),Uy=ie("InputWrapper",Yn),Vy=({children:e,icon:t,label:n,el:r="label",readOnly:s,className:i})=>{const o=r;return f.jsxs(o,{className:i,children:[f.jsxs("div",{className:Is("label"),children:[t?f.jsx("div",{className:Is("labelIcon"),children:t}):f.jsx(f.Fragment,{}),n,s&&f.jsx("div",{className:Is("disabledIcon"),title:"Read-only",children:f.jsx(ay,{size:"12"})})]}),e]})},Zy=({children:e,icon:t,label:n,el:r="label",readOnly:s})=>{const i=F(a=>a.overrides),o=S.useMemo(()=>i.fieldLabel||Vy,[i]);return n?f.jsx(o,{label:n,icon:t,className:Is({readOnly:s}),readOnly:s,el:r,children:e}):f.jsx(f.Fragment,{children:e})},Dt={array:Py,external:$y,object:Hy,select:zy,textarea:By,radio:Ry,text:Hl,number:Hl};function Yy(e){var t;const n=F(y=>y.dispatch),r=F(y=>y.overrides),s=F(y=>{var j;return(j=y.selectedItem)==null?void 0:j.readOnly}),i=S.useContext(Ys),{id:o,Label:a=Zy}=e,l=e.field,d=l.label,c=l.labelIcon,u=$a(),p=o||u,g=S.useMemo(()=>{var y,j,I,D,m,E,h,A;return $(P({},r.fieldTypes),{array:((y=r.fieldTypes)==null?void 0:y.array)||Dt.array,external:((j=r.fieldTypes)==null?void 0:j.external)||Dt.external,object:((I=r.fieldTypes)==null?void 0:I.object)||Dt.object,select:((D=r.fieldTypes)==null?void 0:D.select)||Dt.select,textarea:((m=r.fieldTypes)==null?void 0:m.textarea)||Dt.textarea,radio:((E=r.fieldTypes)==null?void 0:E.radio)||Dt.radio,text:((h=r.fieldTypes)==null?void 0:h.text)||Dt.text,number:((A=r.fieldTypes)==null?void 0:A.number)||Dt.number})},[r]),v=S.useMemo(()=>$(P({},e),{field:l,label:d,labelIcon:c,Label:a,id:p}),[e,l,d,c,a,p]),C=S.useCallback(y=>{v.name&&(y.target.nodeName==="INPUT"||y.target.nodeName==="TEXTAREA")&&(y.stopPropagation(),n({type:"setUi",ui:{field:{focus:v.name}}}))},[v.name]),b=S.useCallback(y=>{"name"in y.target&&n({type:"setUi",ui:{field:{focus:null}}})},[]);let k=S.useMemo(()=>l.type!=="custom"&&l.type!=="slot"?Dt[l.type]:y=>null,[l.type]),_=S.useMemo(()=>{if(l.type==="custom")return l.render?l.render:null;if(l.type!=="slot")return g[l.type]},[l.type,g]);const{visible:x=!0}=e.field;if(!x||l.type==="slot")return null;if(!_)throw new Error(`Field type for ${l.type} did not exist.`);return f.jsx(Ys.Provider,{value:{readOnlyFields:i.readOnlyFields||s||{},localName:(t=i.localName)!=null?t:v.name},children:f.jsx("div",{className:Uy(),onFocus:C,onBlur:b,onClick:y=>{y.stopPropagation()},children:f.jsx(_,$(P({},v),{children:f.jsx(k,P({},v))}))})})}function oi(e){const t=F(l=>l.state.ui.field.focus===e.name),{value:n,onChange:r}=e,[s,i]=S.useState(n),o=S.useCallback((l,d)=>{i(l),r(l,d)},[r]);S.useEffect(()=>{t||i(n)},[n]),S.useEffect(()=>{t||n!==s&&i(n)},[t,n,s]);const a={value:s,onChange:o};return f.jsx(Yy,P(P({},e),a))}M();M();M();M();var qy={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"};M();function Yl(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}M();var qn=S.createContext(null),rt=S.createContext(Fr(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null}))),Xy=({children:e,store:t})=>f.jsx(rt.Provider,{value:t,children:e}),Nr=({children:e,value:t})=>{const n=F(i=>i.dispatch),r=S.useCallback(i=>{n({type:"registerZone",zone:i})},[n]),s=S.useMemo(()=>P({registerZone:r},t),[t]);return f.jsx(f.Fragment,{children:s&&f.jsx(qn.Provider,{value:s,children:e})})};M();function Ky(e){let t=new DOMMatrixReadOnly,n=e.parentElement;for(;n&&n!==document.documentElement;){const r=getComputedStyle(n).transform;r&&r!=="none"&&(t=new DOMMatrixReadOnly(r).multiply(t)),n=n.parentElement}return{scaleX:t.a,scaleY:t.d}}M();function dn(e,t){const n=S.useContext(e);if(!n)throw new Error("useContextStore must be used inside context");return Mo(n,Be(t))}M();var mf=(e,t=[])=>{const n=et();return S.useCallback(()=>{let r=()=>{};const s=o=>
64{o?e(!1):(setTimeout(()=>{e(!0)},0),r&&r())},i=n.getState().state.ui.isDragging;return s(i),i&&(r=n.subscribe(o=>o.state.ui.isDragging,o=>{s(o)})),r},[n,...t])},bn=ie("DraggableComponent",qy),yf=8,Gy=yf*6.5,Jy=-44,ql=yf,Qy=({label:e,children:t,parentAction:n})=>f.jsxs(vt,{children:[f.jsxs(vt.Group,{children:[n,e&&f.jsx(vt.Label,{label:e})]}),f.jsx(vt.Group,{children:t})]}),eb=({children:e})=>f.jsx(f.Fragment,{children:e}),tb=({children:e,depth:t,componentType:n,id:r,index:s,zoneCompound:i,isLoading:o=!1,isSelected:a=!1,debug:l,label:d,autoDragAxis:c,userDragAxis:u,inDroppableZone:p=!0})=>{const g=F(H=>{var J;return((J=H.selectedItem)==null?void 0:J.props.id)===r?H.zoomConfig.zoom:1}),v=F(H=>H.overrides),C=F(H=>H.dispatch),b=F(H=>H.iframe),k=S.useContext(qn),[_,x]=S.useState({}),y=S.useCallback((H,J)=>{var Q;(Q=k==null?void 0:k.registerLocalZone)==null||Q.call(k,H,J),x(ue=>$(P({},ue),{[H]:J}))},[x]),j=S.useCallback(H=>{var J;(J=k==null?void 0:k.unregisterLocalZone)==null||J.call(k,H),x(Q=>{const ue=P({},Q);return delete ue[H],ue})},[x]),I=Object.values(_).filter(Boolean).length>0,D=F(Be(H=>{var J;return(J=H.state.indexes.nodes[r])==null?void 0:J.path})),m=F(Be(H=>{const J=yt({index:s,zone:i},H.state);return H.permissions.getPermissions({item:J})})),E=S.useContext(rt),[h,A]=S.useState(u||c),T=S.useMemo(()=>pf(h),[h]),{ref:R,isDragging:N,sortable:U}=qu({id:r,index:s,group:i,type:"component",data:{areaId:k==null?void 0:k.areaId,zone:i,index:s,componentType:n,containsActiveZone:I,depth:t,path:D||[],inDroppableZone:p},collisionPriority:t,collisionDetector:T,transition:{duration:200,easing:"cubic-bezier(0.2, 0, 0, 1)"},feedback:"clone"});S.useEffect(()=>{const H=E.getState().enabledIndex[i];U.droppable.disabled=!H,U.draggable.disabled=!m.drag;const J=E.subscribe(Q=>{U.droppable.disabled=!Q.enabledIndex[i]});return z.current&&!m.drag?(z.current.setAttribute("data-puck-disabled",""),()=>{var Q;(Q=z.current)==null||Q.removeAttribute("data-puck-disabled"),J()}):J},[m.drag,i]);const z=S.useRef(null),K=S.useCallback(H=>{R(H),H&&(z.current=H)},[R]),[V,X]=S.useState();S.useEffect(()=>{var H,J,Q;X(b.enabled?(H=z.current)==null?void 0:H.ownerDocument.body:(Q=(J=z.current)==null?void 0:J.closest("[data-puck-preview]"))!=null?Q:document.body)},[b.enabled,z.current]);const G=S.useCallback(()=>{var H,J,Q;if(!z.current)return;const ue=z.current.getBoundingClientRect(),me=Yl(z.current),we=b.enabled?null:(H=z.current)==null?void 0:H.closest("[data-puck-preview]"),Le=we==null?void 0:we.getBoundingClientRect(),Ke=we?Yl(we):{x:0,y:0},tt={x:me.x-Ke.x-((J=Le==null?void 0:Le.left)!=null?J:0),y:me.y-Ke.y-((Q=Le==null?void 0:Le.top)!=null?Q:0)},St={height:z.current.offsetHeight,width:z.current.offsetWidth},Kn=Ky(z.current);return{left:`${(ue.left+tt.x)/Kn.scaleX}px`,top:`${(ue.top+tt.y)/Kn.scaleY}px`,height:`${St.height}px`,width:`${St.width}px`}},[z.current]),[q,te]=S.useState(),ce=S.useCallback(()=>{te(G())},[z.current,b]);S.useEffect(()=>{if(z.current){const H=new ResizeObserver(ce);return H.observe(z.current),()=>{H.disconnect()}}},[z.current]);const Ie=F(H=>H.nodes.registerNode),se=S.useCallback(()=>{Oe(!1)},[]),Ee=S.useCallback(()=>{Oe(!0)},[]);S.useEffect(()=>{var H;return Ie(r,{methods:{sync:ce,showOverlay:Ee,hideOverlay:se},element:(H=z.current)!=null?H:null}),()=>{Ie(r,{methods:{sync:()=>null,hideOverlay:()=>null,showOverlay:()=>null},element:null})}},[r,i,s,n,ce]);const De=S.useMemo(()=>v.actionBar||Qy,[v.actionBar]),Z=S.useMemo(()=>v.componentOverlay||eb,[v.componentOverlay]),w=S.useCallback(H=>{H.target.closest("[data-puck-overlay-portal]")||H.stopPropagation(),C({type:"setUi",ui:{itemSelector:{index:s,zone:i}}})},[s,i,r]),O=et(),L=S.useCallback(()=>{const{nodes:H,zones:J}=O.getState().state.indexes,Q=H[r],ue=Q!=null&&Q.parentId?H[Q==null?void 0:Q.parentId]:null;if(!ue||!Q.parentId)return;const me=`${ue.parentId}:${ue.zone}`,we=J[me].contentIds.indexOf(Q.parentId);C({type:"setUi",ui:{itemSelector:{zone:me,index:we}}})},[k,D]),B=S.useCallback(()=>{C({type:"duplicate",sourceIndex:s,sourceZone:i})},[s,i]),W=S.useCallback(()=>{C({type:"remove",index:s,zone:i})},[s,i]),[Y,ee]=S.useState(!1),he=dn(rt,H=>H.hoveringComponent===r);S.useEffect(()=>{if(!z.current)return;const H=z.current,J=ue=>{const me=!!E.getState().draggedItem;ee(me?!!N:!0),ue.stopPropagation()},Q=ue=>{ue.stopPropagation(),ee(!1)};return H.setAttribute("data-puck-component",r),H.setAttribute("data-puck-dnd",r),H.style.position="relative",H.addEventListener("click",w),H.addEventListener("mouseover",J),H.addEventListener("mouseout",Q),()=>{H.removeAttribute("data-puck-component"),H.removeAttribute("data-puck-dnd"),H.removeEventListener("click",w),H.removeEventListener("mouseover",J),H.removeEventListener("mouseout",Q)}},[z.current,w,I,i,r,N,p]);const[_e,Oe]=S.useState(!1),[Ae,je]=S.useState(!0),[xe,ve]=S.useTransition();S.useEffect(()=>{ve(()=>{Y||he||a?(ce(),Oe(!0),Rt(!1)):Oe(!1)})},[Y,he,a,b]);const[ot,Rt]=S.useState(!1),Kr=mf(H=>{H?ve(()=>{ce(),je(!0)}):je(!1)});S.useEffect(()=>{N&&Rt(!0)},[N]),S.useEffect(()=>{if(ot)return Kr()},[ot,Kr]);const Xn=S.useCallback(H=>{if(H&&H.ownerDocument.defaultView){const Q=H.getBoundingClientRect(),me=Q.x<0,Le=Q.y<0;me&&(H.style.transformOrigin="left top",H.style.left="0px"),Le&&(H.style.top="12px",me||(H.style.transformOrigin="right top"))}},[g]);S.useEffect(()=>{if(u){A(u);return}if(z.current){const H=window.getComputedStyle(z.current);if(H.display==="inline"||H.display==="inline-block"){A("x");return}}A(c)},[z,u,c]);const ai=S.useMemo(()=>(k==null?void 0:k.areaId)&&(k==null?void 0:k.areaId)!=="root"&&f.jsx(vt.Action,{onClick:L,label:"Select parent",children:f.jsx(ey,{size:16})}),[k==null?void 0:k.areaId]),oe=S.useMemo(()=>$(P({},k),{areaId:r,zoneCompound:i,index:s,depth:t+1,registerLocalZone:y,unregisterLocalZone:j}),[k,r,i,s,t,y,j]);return f.jsxs(Nr,{value:oe,children:[Ae&&_e&&qs.createPortal(f.jsxs("div",{className:bn({isSelected:a,isDragging:N,hover:Y||he}),style:P({},q),"data-puck-overlay":!0,children:[l,o&&f.jsx("div",{className:bn("loadingOverlay"),children:f.jsx(gn,{})}
64),f.jsx("div",{className:bn("actionsOverlay"),style:{top:Gy/g},children:f.jsx("div",{className:bn("actions"),style:{transform:`scale(${1/g}`,top:Jy/g,right:0,paddingLeft:ql,paddingRight:ql},ref:Xn,children:f.jsxs(De,{parentAction:ai,label:d,children:[m.duplicate&&f.jsx(vt.Action,{onClick:B,label:"Duplicate",children:f.jsx(af,{size:16})}),m.delete&&f.jsx(vt.Action,{onClick:W,label:"Delete",children:f.jsx(cf,{size:16})})]})})}),f.jsx("div",{className:bn("overlayWrapper"),children:f.jsx(Z,{componentId:r,componentType:n,hover:Y,isSelected:a,children:f.jsx("div",{className:bn("overlay")})})})]}),V||document.body),e(K)]})};M();var nb={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"};M();M();var bf={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"};M();M();M();function rb(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function sb(e,t){const n=()=>performance.now();let r,s=0;return function(...i){const o=n(),a=this;o-s>=t?(e.apply(a,i),s=o):(r==null||r(),r=rb(()=>{e.apply(a,i),s=n()},t-(o-s)))}}M();var $n=()=>{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};M();var ib=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}};M();var ob=typeof PointerEvent<"u"?PointerEvent:Event,_f=class extends ob{constructor(e,t){super(e,t),this._originalTarget=null,this.originalTarget=t.originalTarget}set originalTarget(e){this._originalTarget=e}get originalTarget(){return this._originalTarget}},ab=e=>e.sort((t,n)=>{const r=t.data,s=n.data;return r.depth>s.depth?1:s.depth>r.depth?-1:0}),lb=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},ds=6,cb=(e,t)=>{const n=[];let r=e.target.ownerDocument.elementsFromPoint(e.x,e.y);const s=r.find(o=>o.getAttribute("data-puck-preview")),i=r.find(o=>o.getAttribute("data-puck-drawer"));if(i&&(r=[i]),s){const o=$n();o&&(r=o.elementsFromPoint(e.frame.x,e.frame.y))}if(r)for(let o=0;o<r.length;o++){const a=r[o],l=a.getAttribute("data-puck-dropzone"),d=a.getAttribute("data-puck-dnd"),c=a.hasAttribute("data-puck-dnd-void");if((l||d)&&!c){const u=a.getBoundingClientRect(),p={left:u.left+ds,right:u.right-ds,top:u.top+ds,bottom:u.bottom-ds};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 u=t.registry.droppables.get(l);u&&n.push(u)}if(d){const u=t.registry.droppables.get(d);u&&n.push(u)}}return n},db=(e,t)=>
64{var n;const r=cb(e,t);if(r.length>0){const s=ab(r),i=t.dragOperation.source,o=s.findIndex(v=>v.id===(i==null?void 0:i.id)),a=i==null?void 0:i.id;let l=[...s];a&&o>-1&&l.splice(o,1),l=l.filter(v=>{const C=v.data;if(a&&o>-1&&C.path.indexOf(a)>-1)return!1;if(v.type==="dropzone"){const b=v.data;if(!b.isDroppableTarget||b.areaId===a)return!1}else if(v.type==="component"&&!v.data.inDroppableZone)return!1;return!0}),l.reverse();const d=l[0];if(!d)return{zone:null,area:null};const c=d.data,u="containsActiveZone"in c,p=lb(d),g=u&&c.containsActiveZone?l[0].id:(n=l[0])==null?void 0:n.data.areaId;return{zone:p,area:g}}return{zone:Ve,area:Do}},ub=({onChange:e},t)=>class extends We{constructor(r,s){super(r),!(typeof window>"u")&&this.registerEffect(()=>{const o=sb(d=>{const c=d instanceof _f&&d.originalTarget||d.target,u=new ib(c,{x:d.clientX,y:d.clientY});document.elementsFromPoint(u.global.x,u.global.y).some(v=>v.id===t)&&e(db(u,r),r)},50),a=d=>{o(d)};return document.body.addEventListener("pointermove",a,{capture:!0}),()=>{document.body.removeEventListener("pointermove",a,{capture:!0})}})}};M();var fb=(e,t,n,r)=>Ce(void 0,null,function*(){const s=it(e),i={type:"insert",componentType:e,destinationIndex:n,destinationZone:t,id:s},{state:o,dispatch:a,resolveComponentData:l}=r,d=Gu(o,i,r);a($(P({},i),{recordHistory:!0}));const c={index:n,zone:t};a({type:"setUi",ui:{itemSelector:c}});const u=yt(c,d);if(u){const p=yield l(u,"insert");p.didChange&&a({type:"replace",destinationZone:c.zone,destinationIndex:c.index,data:p.node})}});M();function pb(e){function t(n){return n?n.getAttribute("dir")||t(n.parentElement):"ltr"}return e?t(e):"ltr"}var xf=S.createContext({dragListeners:{}});function hb(e,t,n=[]){const{setDragListeners:r}=S.useContext(xf);S.useEffect(()=>{r&&r(s=>$(P({},s),{[e]:[...s[e]||[],t]}))},n)}var gb=100,vb=e=>{const t=S.useRef(null);return S.useCallback(n=>{ho.setState({fallbackEnabled:!1});const r=it();t.current=r,setTimeout(()=>{t.current===r&&(ho.setState({fallbackEnabled:!0}),n.collisionObserver.forceUpdate(!0))},e)},[])},mb=({children:e,disableAutoScroll:t})=>{const n=F(x=>x.dispatch),r=et(),s=$a(),i=S.useRef(null),o=vb(100),[a]=S.useState(()=>Fr(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null}))),l=S.useCallback((x,y)=>{const{zoneDepthIndex:j={},areaDepthIndex:I={}}=a.getState()||{},D=Object.keys(j).length>0,m=Object.keys(I).length>0;let E=!1,h=!1;return(x.zone&&!j[x.zone]||!x.zone&&D)&&(E=!0),(x.area&&!I[x.area]||!x.area&&m)&&(h=!0),{zoneChanged:E,areaChanged:h}},[a]),d=S.useCallback((x,y)=>{const{zoneChanged:j,areaChanged:I}=l(x,s);!j&&!I||(a.setState({zoneDepthIndex:x.zone?{[x.zone]:!0}:{},areaDepthIndex:x.area?{[x.area]:!0}:{}}),o(y),setTimeout(()=>{y.collisionObserver.forceUpdate(!0)},50),i.current=null)},[a]),c=im(d,gb),u=()=>{c.cancel(),i.current=null};S.useEffect(()=>{},[]);const[p]=S.useState(()=>[...t?cn.plugins.filter(x=>x!==xa):cn.plugins,ub({onChange:(x,y)=>{const j=a.getState(),{zoneChanged:I,areaChanged:D}=l(x,s),m=y.dragOperation.status.dragging;if(D||I){let E={},h={};x.zone&&(E={[x.zone]:!0}),x.area&&(h={[x.area]:!0}),a.setState({nextZoneDepthIndex:E,nextAreaDepthIndex:h})}if(x.zone!=="void"&&(j!=null&&j.zoneDepthIndex.void)){d(x,y);return}if(D){if(m){const E=i.current;E&&E.area===x.area&&E.zone===x.zone||(u(),c(x,y),i.current=x)}else u(),d(x,y);return}I&&d(x,y),u()}},s)]),g=uf(),[v,C]=S.useState({}),b=S.useRef(null),k=S.useRef(void 0),_=S.useMemo(()=>({mode:"edit",areaId:"root",depth:0}),[]);return f.jsx("div",{id:s,children:f.jsx(xf.Provider,{value:{dragListeners:v,setDragListeners:C},children:f.jsx(Eu,{plugins:p,sensors:g,onDragEnd:(x,y)=>{var j,I;const D=(j=$n())==null?void 0:j.querySelector("[data-puck-entry]");D==null||D.removeAttribute("data-puck-dragging");const{source:m,target:E}=x.operation;if(!m){a.setState({draggedItem:null});return}const{zone:h,index:A}=m.data,{previewIndex:T={}}=a.getState()||{},R=((I=T[h])==null?void 0:I.props.id)===m.id?T[h]:null,N=()=>{var z,K;if(a.setState({draggedItem:null}),x.canceled||(E==null?void 0:E.type)==="void"){a.setState({previewIndex:{}}),(z=v.dragend)==null||z.forEach(V=>{V(x,y)}),n({type:"setUi",ui:{itemSelector:null,isDragging:!1}});return}R&&(a.setState({previewIndex:{}}),R.type==="insert"?fb(R.componentType,R.zone,R.index,r.getState()):k.current&&n({type:"move",sourceIndex:k.current.index,sourceZone:k.current.zone,destinationIndex:R.index,destinationZone:R.zone,recordHistory:!1})),n({type:"setUi",ui:{itemSelector:{index:A,zone:h},isDragging:!1},recordHistory:!0}
64),(K=v.dragend)==null||K.forEach(V=>{V(x,y)})};let U;U=Qe(()=>{m.status==="idle"&&(N(),U==null||U())})},onDragOver:(x,y)=>{var j,I,D,m;if(x.preventDefault(),!((j=a.getState())==null?void 0:j.draggedItem))return;u();const{source:h,target:A}=x.operation;if(!A||!h||A.type==="void")return;const[T]=h.id.split(":"),[R]=A.id.split(":"),N=h.data;let U=N.zone,z=N.index,K="",V=0;if(A.type==="component"){const G=A.data;K=G.zone,V=G.index;const q=(I=y.collisionObserver.collisions[0])==null?void 0:I.data,te=pb(A.element),ce=(q==null?void 0:q.direction)==="up"||te==="ltr"&&(q==null?void 0:q.direction)==="left"||te==="rtl"&&(q==null?void 0:q.direction)==="right"?"before":"after";V>=z&&U===K&&(V=V-1),ce==="after"&&(V=V+1)}else K=A.id.toString(),V=0;const X=((D=r.getState().state.indexes.nodes[A.id])==null?void 0:D.path)||[];if(!(R===T||X.find(G=>{const[q]=G.split(":");return q===T}))){if(b.current==="new")a.setState({previewIndex:{[K]:{componentType:N.componentType,type:"insert",index:V,zone:K,element:h.element,props:{id:h.id.toString()}}}});else{k.current||(k.current={zone:N.zone,index:N.index});const G=yt(k.current,r.getState().state);G&&a.setState({previewIndex:{[K]:{componentType:N.componentType,type:"move",index:V,zone:K,props:G.props,element:h.element}}})}(m=v.dragover)==null||m.forEach(G=>{G(x,y)})}},onDragStart:(x,y)=>{var j;const{source:I}=x.operation;if(I&&I.type!=="void"){const D=I.data,m=yt({zone:D.zone,index:D.index},r.getState().state);m&&a.setState({previewIndex:{[D.zone]:{componentType:D.componentType,type:"move",index:D.index,zone:D.zone,props:m.props,element:I.element}}})}(j=v.dragstart)==null||j.forEach(D=>{D(x,y)})},onBeforeDragStart:x=>{var y,j,I,D;const m=((y=x.operation.source)==null?void 0:y.type)==="drawer";b.current=m?"new":"existing",k.current=void 0,a.setState({draggedItem:x.operation.source}),((j=r.getState().selectedItem)==null?void 0:j.props.id)!==((I=x.operation.source)==null?void 0:I.id)?n({type:"setUi",ui:{itemSelector:null,isDragging:!0},recordHistory:!1}):n({type:"setUi",ui:{isDragging:!0},recordHistory:!1});const E=(D=$n())==null?void 0:D.querySelector("[data-puck-entry]");E==null||E.setAttribute("data-puck-dragging","true")},children:f.jsx(Xy,{store:a,children:f.jsx(Nr,{value:_,children:e})})})})})},yb=({children:e,disableAutoScroll:t})=>F(r=>r.status)==="LOADING"?e:f.jsx(mb,{disableAutoScroll:t,children:e}),ks=ie("Drawer",bf),_n=ie("DrawerItem",bf),go=({children:e,name:t,label:n,dragRef:r,isDragDisabled:s})=>{const i=S.useMemo(()=>e||(({children:o})=>f.jsx("div",{className:_n("default"),children:o})),[e]);return f.jsx("div",{className:_n({disabled:s}),ref:r,onMouseDown:o=>o.preventDefault(),"data-testid":r?`drawer-item:${t}`:"","data-puck-drawer-item":!0,children:f.jsx(i,{name:t,children:f.jsx("div",{className:_n("draggableWrapper"),children:f.jsxs("div",{className:_n("draggable"),children:[f.jsx("div",{className:_n("name"),children:n??t}),f.jsx("div",{className:_n("icon"),children:f.jsx(df,{})})]})})})})},bb=({children:e,name:t,label:n,id:r,isDragDisabled:s})=>{const{ref:i}=uv({id:r,data:{componentType:t},disabled:s,type:"drawer"});return f.jsxs("div",{className:ks("draggable"),children:[f.jsx("div",{className:ks("draggableBg"),children:f.jsx(go,{name:t,label:n,children:e})}),f.jsx("div",{className:ks("draggableFg"),children:f.jsx(go,{name:t,label:n,dragRef:i,isDragDisabled:s,children:e})})]})},_b=({name:e,children:t,id:n,label:r,index:s,isDragDisabled:i})=>{const o=n||e,[a,l]=S.useState(it(o));return typeof s<"u"&&console.error("Warning: The `index` prop on Drawer.Item is deprecated and no longer required."),hb("dragend",()=>{l(it(o))},[o]),f.jsx("div",{children:f.jsx(bb,{name:e,label:r,id:a,isDragDisabled:i,children:t})},a)},Ra=({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=$a(),{ref:s}=Ru({id:r,type:"void",collisionPriority:0});return f.jsx("div",{className:ks(),ref:s,"data-puck-dnd":r,"data-
64puck-drawer":!0,"data-puck-dnd-void":!0,children:e})};Ra.Item=_b;M();var Xl=(e,t)=>e.getState().state.indexes.zones[t].contentIds.length,xb=({zoneCompound:e,userMinEmptyHeight:t,ref:n})=>{const r=et(),[s,i]=S.useState(0),[o,a]=S.useState(!1),{draggedItem:l,isZone:d}=dn(rt,p=>{var g,v;return{draggedItem:((g=p.draggedItem)==null?void 0:g.data.zone)===e?p.draggedItem:null,isZone:((v=p.draggedItem)==null?void 0:v.data.zone)===e}}),c=S.useRef(0),u=mf(p=>{var g;if(p){const v=Xl(r,e);if(i(0),v||c.current===0){a(!1);return}const C=r.getState().selectedItem,b=r.getState().state.indexes.zones,k=r.getState().nodes;(g=k.nodes[C==null?void 0:C.props.id])==null||g.methods.hideOverlay(),setTimeout(()=>{var _;(((_=b[e])==null?void 0:_.contentIds)||[]).forEach(y=>{const j=k.nodes[y];j==null||j.methods.sync()}),C&&setTimeout(()=>{var y,j;(y=k.nodes[C.props.id])==null||y.methods.sync(),(j=k.nodes[C.props.id])==null||j.methods.showOverlay()},200),a(!1)},100)}},[r,s,e]);return S.useEffect(()=>{if(l&&n.current&&d){const p=n.current.getBoundingClientRect();return c.current=Xl(r,e),i(p.height),a(!0),u()}},[n.current,l,u]),[s||t,o]};M();function wb(e,t){typeof e=="function"?e(t):e&&typeof e=="object"&&"current"in e&&(e.current=t)}function Sb(e,t){e.forEach(n=>{wb(n,t)})}M();M();function Ib(e,t){const n=ju();return S.useCallback((...r)=>Ce(this,null,function*(){return yield n==null?void 0:n.renderer.rendering,e(...r)}),[...t,n])}var kb=(e,t)=>{const n=S.useContext(rt),r=dn(rt,c=>c.previewIndex[t]),s=F(c=>c.state.ui.isDragging),[i,o]=S.useState(e),[a,l]=S.useState(r),d=Ib((c,u,p,g,v)=>{p&&!v||(u?u.type==="insert"?o(Ln(c.filter(C=>C!==u.props.id),u.index,u.props.id)):o(Ln(c.filter(C=>C!==u.props.id),u.index,u.props.id)):o(v?c.filter(C=>C!==g):c),l(u))},[]);return S.useEffect(()=>{var c;const u=n.getState(),p=(c=u.draggedItem)==null?void 0:c.id,g=Object.keys(u.previewIndex||{}).length>0;d(e,r,s,p,g)},[e,r,s]),[i,a]};M();var Eb="dynamic",jb="x",Kl="y",Cb=(e,t)=>{const n=F(o=>o.status),[r,s]=S.useState(t||Kl),i=S.useCallback(()=>{if(e.current){const o=window.getComputedStyle(e.current);o.display==="grid"?s(Eb):o.display==="flex"&&o.flexDirection==="row"?s(jb):s(Kl)}},[e.current]);return S.useEffect(()=>{const o=()=>{i()};return window.addEventListener("viewportchange",o),()=>{window.removeEventListener("viewportchange",o)}},[]),S.useEffect(i,[n,t]),[r,i]};M();var Pb=({componentId:e,zone:t})=>{const n=F(i=>i.config),r=F(i=>i.metadata),s=F(Be(i=>{var o,a;const l=i.state.indexes;return((a=(o=l.zones[`${e}:${t}`])==null?void 0:o.contentIds)!=null?a:[]).map(c=>l.nodes[c].flatData)}));return f.jsx(Ao,{content:s,zone:t,config:n,metadata:r})};M();M();M();var Db=(e,t={})=>{if(!e)return;const{disableDrag:n=!1,disableDragOnFocus:r=!0}=t,s=a=>{a.stopPropagation()};e.addEventListener("mouseover",s,{capture:!0});const i=()=>{setTimeout(()=>{e.addEventListener("pointerdown",s,{capture:!0})},200)},o=()=>{e.removeEventListener("pointerdown",s,{capture:!0})};return r?(e.addEventListener("focus",i,{capture:!0}),e.addEventListener("blur",o,{capture:!0})):n&&e.addEventListener("pointerdown",s,{capture:!0}),e.setAttribute("data-puck-overlay-portal","true"),()=>{e.removeEventListener("mouseover",s,{capture:!0}),r?(e.removeEventListener("focus",i,{capture:!0}),e.removeEventListener("blur",i,{capture:!0})):n&&e.removeEventListener("pointerdown",s,{capture:!0}),e.removeAttribute("data-puck-overlay-portal")}};M();var Ob={InlineTextField:"_InlineTextField_1xph6_1"};M();function Ab(e,t,n){const r=t.split("."),s=P({},e);let i=s;for(let o=0;o<r.length;o++){const[a,l]=r[o].replace("]","").split("["),d=o===r.length-1;if(l!==void 0){Array.isArray(i[a])||(i[a]=[]);const c=Number(l);if(d){i[a][c]=n;continue}i[a][c]===void 0&&(i[a][c]={}),i=i[a][c];continue}if(d){i[a]=n;continue}i[a]===void 0&&(i[a]={}),i=i[a]}return P(P({},e),s)}M();var wf=(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}},Mb=ie("InlineTextField",Ob),Tb=({propPath:e,componentId:t,value:n,isReadOnly:r,opts:s={}})=>{var i;const o=S.useRef(null),a=et(),l=(i=s.disableLineBreaks)!=null?i:!1;S.useEffect(()=>{const g=a.getState(),v=g.state.indexes.nodes[t].data;if(!g.getComponentConfig(v.type))throw new Error(`InlineTextField Error: No config defined for ${v.type}`);if(o.current){n!==o.current.innerText&&o.current.replaceChildren(n);const b=Db(o.current),k=_=>Ce(void 0,null,function*(){var x;const y=a.getState(),j=y.state.indexes.nodes[t],I=`${j.parentId}:${j.zone}`,D=(x=y.state.indexes.zones[I])==null?void 0:x.contentIds.indexOf(t);let m=_.target.innerText;l&&(m=m.replaceAll(/\n/gm,""));const E=Ab(j.data.props,e,m),h=yield y.resolveComponentData($(P({},j.data),{props:E}),"replace");y.dispatch({type:"replace",data:h.node,destinationIndex:D,destinationZone:I})});return o.current.addEventListener("input",k),()=>{var _;(_=o.current)==null||_.removeEventListener("input",k),b==null||b()}}},[a,o.current,n,l]);const[d,c]=S.useState(!1),[u,p]=S.useState(!1);return f.jsx("span",{className:Mb(),ref:o,contentEditable:d||u?"plaintext-only":"false",onClick:g=>{g.preventDefault(),g.stopPropagation()},onClickCapture:g=>{g.preventDefault(),g.stopPropagation();const v=wf(a.getState().state,t);
64a.getState().setUi({itemSelector:v})},onKeyDown:g=>{g.stopPropagation(),(l&&g.key==="Enter"||r)&&g.preventDefault()},onKeyUp:g=>{g.stopPropagation(),g.preventDefault()},onMouseOverCapture:()=>c(!0),onMouseOutCapture:()=>c(!1),onFocus:()=>p(!0),onBlur:()=>p(!1)})},Pi=S.memo(Tb),Lb=()=>({text:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable?f.jsx(Pi,{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?f.jsx(Pi,{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"?f.jsx(Pi,{propPath:r,componentId:t,value:e,isReadOnly:s}):e}),$b=ie("DropZone",nb),vo=e=>f.jsx(Sf,P({},e)),Rb=({zoneCompound:e,componentId:t,index:n,dragAxis:r,collisionAxis:s,inDroppableZone:i})=>{var o,a;const l=F(V=>V.metadata),d=S.useContext(qn),{depth:c=1}=d??{},u=S.useContext(rt),p=F(Be(V=>{var X;return(X=V.state.indexes.nodes[t])==null?void 0:X.flatData.props})),g=F(V=>{var X;return(X=V.state.indexes.nodes[t])==null?void 0:X.data.type}),v=F(Be(V=>{var X;return(X=V.state.indexes.nodes[t])==null?void 0:X.data.readOnly})),C=et(),b=S.useMemo(()=>{if(p)return Pp({type:g,props:p});const V=u.getState().previewIndex[e];return t===(V==null?void 0:V.props.id)?{type:V.componentType,props:V.props,previewType:V.type,element:V.element}:null},[C,t,e,g,p]),k=F(V=>b!=null&&b.type?V.config.components[b.type]:null),_=S.useMemo(()=>({renderDropZone:vo,isEditing:!0,dragRef:null,metadata:P(P({},l),k==null?void 0:k.metadata)}),[l,k==null?void 0:k.metadata]),x=F(V=>V.overrides),y=F(V=>{var X;return((X=V.componentState[t])==null?void 0:X.loadingCount)>0}),j=F(V=>{var X;return((X=V.selectedItem)==null?void 0:X.props.id)===t||!1});let I=(a=(o=k==null?void 0:k.label)!=null?o:b==null?void 0:b.type.toString())!=null?a:"Component";const D=S.useMemo(()=>function(){var X;return b&&"element"in b&&b.element?f.jsx("div",{dangerouslySetInnerHTML:{__html:b.element.outerHTML}}):f.jsx(go,{name:I,children:(X=x.componentItem)!=null?X:x.drawerItem})},[t,I,x]),m=S.useMemo(()=>$(P(P({},k==null?void 0:k.defaultProps),b==null?void 0:b.props),{puck:_,editMode:!0}),[k==null?void 0:k.defaultProps,b==null?void 0:b.props,_]),E=S.useMemo(()=>{var V;return{type:(V=b==null?void 0:b.type)!=null?V:g,props:m}},[b==null?void 0:b.type,g,m]),h=F(V=>V.config),A=F(V=>V.plugins),T=F(V=>V.fieldTransforms),R=S.useMemo(()=>P(P(P(P({},bc(vo,V=>f.jsx(Pb,{componentId:t,zone:V.zone}))),Lb()),A.reduce((V,X)=>P(P({},V),X.fieldTransforms),{})),T),[A,T]),N=yc(h,E,R,v,y);if(!b)return;let U=k?k.render:()=>f.jsxs("div",{style:{padding:48,textAlign:"center"},children:["No configuration for ",b.type]}),z=b.type;const K="previewType"in b?b.previewType==="insert":!1;return K&&(U=D),f.jsx(tb,{id:t,componentType:z,zoneCompound:e,depth:c+1,index:n,isLoading:y,isSelected:j,label:I,autoDragAxis:r,userDragAxis:s,inDroppableZone:i,children:V=>k!=null&&k.inline&&!K?f.jsx(f.Fragment,{children:f.jsx(U,$(P({},N),{puck:$(P({},N.puck),{dragRef:V})}))}):f.jsx("div",{ref:V,children:f.jsx(U,P({},N))})})},Nb=S.memo(Rb),Sf=S.forwardRef(function({zone:t,allow:n,disallow:r,style:s,className:i,minEmptyHeight:o=128,collisionAxis:a},l){const d=S.useContext(qn),c=et(),{areaId:u,depth:p=0,registerLocalZone:g,unregisterLocalZone:v}=d??{},C=F(Be(q=>{var te;return u?(te=q.state.indexes.nodes[u])==null?void 0:te.path:null}));let b=Ve;u&&t!==Ve&&(b=`${u}:${t}`);const k=b===Ve||t===Ve||u==="root",_=dn(rt,q=>q.nextAreaDepthIndex[u||""]),x=F(Be(q=>{var te;return(te=q.state.indexes.zones[b])==null?void 0:te.contentIds})),y=F(Be(q=>{var te;return(te=q.state.indexes.zones[b])==null?void 0:te.type}));S.useEffect(()=>{(!y||y==="dropzone")&&d!=null&&d.registerZone&&(d==null||d.registerZone(b))},[y,c]),S.useEffect(()=>{y==="dropzone"&&b!==Ve&&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")},[y]);const j=S.useMemo(()=>x||[],[x]),I=S.useRef(null),D=S.useCallback(q=>{if(!q)return!0;
64if(r){const te=n||[];if((r||[]).filter(Ie=>te.indexOf(Ie)===-1).indexOf(q)!==-1)return!1}else if(n&&n.indexOf(q)===-1)return!1;return!0},[n,r]),m=dn(rt,q=>{var te;const ce=(te=q.draggedItem)==null?void 0:te.data.componentType;return D(ce)}),E=_||k,h=dn(rt,q=>{var te;let ce=!0;return ce=(te=q.zoneDepthIndex[b])!=null?te:!1,ce&&(ce=m),ce});S.useEffect(()=>(g&&g(b,m||h),()=>{v&&v(b)}),[m,h,b]);const[A,T]=kb(j,b),R=h&&(T?A.length===1:A.length===0),N=S.useContext(rt);S.useEffect(()=>{const{enabledIndex:q}=N.getState();N.setState({enabledIndex:$(P({},q),{[b]:h})})},[h,N,b]);const U={id:b,collisionPriority:h?p:0,disabled:!R,collisionDetector:ky,type:"dropzone",data:{areaId:u,depth:p,isDroppableTarget:m,path:C||[]}},{ref:z}=Ru(U),K=F(q=>(q==null?void 0:q.selectedItem)&&u===(q==null?void 0:q.selectedItem.props.id)),[V]=Cb(I,a),[X,G]=xb({zoneCompound:b,userMinEmptyHeight:o,ref:I});return f.jsx("div",{className:`${$b({isRootZone:k,hoveringOverArea:E,isEnabled:h,isAreaSelected:K,hasChildren:j.length>0,isAnimating:G})}${i?` ${i}`:""}`,ref:q=>{Sb([I,z,l],q)},"data-testid":`dropzone:${b}`,"data-puck-dropzone":b,style:$(P({},s),{"--min-empty-height":`${X}px`,backgroundColor:s==null?void 0:s.backgroundColor}),children:A.map((q,te)=>f.jsx(Nb,{zoneCompound:b,componentId:q,dragAxis:V,index:te,collisionAxis:a,inDroppableZone:m},q))})}),zb=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=Xs(e,t,o=>
64f.jsx(Ao,$(P({},o),{config:e,metadata:n}))),i=S.useMemo(()=>({areaId:s.id,depth:1}),[s]);return f.jsx(Nr,{value:i,children:f.jsx(r.render,$(P({},s),{puck:$(P({},s.puck),{renderDropZone:mo,metadata:P(P({},n),r.metadata)})}))},s.id)},mo=e=>f.jsx(If,P({},e)),If=S.forwardRef(function({className:t,style:n,zone:r},s){const i=S.useContext(qn),{areaId:o="root"}=i||{},{config:a,data:l,metadata:d}=S.useContext(_o);let c=`${o}:${r}`,u=(l==null?void 0:l.content)||[];return S.useEffect(()=>{u||i!=null&&i.registerZone&&(i==null||i.registerZone(c))},[u]),!l||!a?null:(c!==Ve&&(u=mc(l,c).zones[c]),f.jsx("div",{className:t,style:n,ref:s,children:u.map(p=>a.components[p.type]?f.jsx(zb,{config:a,item:p,metadata:d},p.props.id):null)}))}),yo=e=>f.jsx(bo,P({},e)),bo=S.forwardRef(function(t,n){const r=S.useContext(qn);return(r==null?void 0:r.mode)==="edit"?f.jsx(f.Fragment,{children:f.jsx(Sf,$(P({},t),{ref:n}))}):f.jsx(f.Fragment,{children:f.jsx(If,$(P({},t),{ref:n}))})}),_o=Vt.createContext({config:{components:{}},data:{root:{},content:[]},metadata:{}});function Fb({config:e,data:t,metadata:n={}}){var r;const s=$(P({},t),{root:t.root||{},content:t.content||[]}),i="props"in s.root?s.root.props:s.root,o=(i==null?void 0:i.title)||"",a=$(P({},i),{puck:{renderDropZone:yo,isEditing:!1,dragRef:null,metadata:n},title:o,editMode:!1,id:"puck-root"}),l=Xs(e,{type:"root",props:a},c=>f.jsx(_c,$(P({},c),{config:e,metadata:n}))),d=S.useMemo(()=>({mode:"render",depth:0}),[]);return(r=e.root)!=null&&r.render?f.jsx(_o.Provider,{value:{config:e,data:s,metadata:n},children:f.jsx(Nr,{value:d,children:f.jsx(e.root.render,$(P({},l),{children:f.jsx(mo,{zone:Li})}))})}):f.jsx(_o.Provider,{value:{config:e,data:s,metadata:n},children:f.jsx(Nr,{value:d,children:f.jsx(mo,{zone:Li})})})}M();var Gl=e=>{const t={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};return{appState:Rr(e.state),config:e.config,dispatch:e.dispatch,getPermissions:e.permissions.getPermissions,refreshPermissions:e.permissions.refreshPermissions,history:t,selectedItem:e.selectedItem||null,getItemBySelector:r=>yt(r,e.state),getItemById:r=>e.state.indexes.nodes[r].data,getSelectorForId:r=>wf(e.state,r)}},Bb=S.createContext(null),Jl=e=>({state:e.state,config:e.config,dispatch:e.dispatch,permissions:e.permissions,history:e.history,selectedItem:e.selectedItem}),Wb=e=>{const[t]=S.useState(()=>Fr(()=>Gl(Jl(e.getState()))));return S.useEffect(()=>e.subscribe(n=>Jl(n),n=>{t.setState(Gl(n))}),[]),t};M();M();M();var Hb={SidebarSection:"_SidebarSection_8boj8_1","SidebarSection-title":"_SidebarSection-title_8boj8_12","SidebarSection--noBorderTop":"_SidebarSection--noBorderTop_8boj8_20","SidebarSection-content":"_SidebarSection-content_8boj8_24","SidebarSection--noPadding":"_SidebarSection--noPadding_8boj8_28","SidebarSection-breadcrumbLabel":"_SidebarSection-breadcrumbLabel_8boj8_41","SidebarSection-breadcrumbs":"_SidebarSection-breadcrumbs_8boj8_70","SidebarSection-breadcrumb":"_SidebarSection-breadcrumb_8boj8_41","SidebarSection-heading":"_SidebarSection-heading_8boj8_82","SidebarSection-loadingOverlay":"_SidebarSection-loadingOverlay_8boj8_86"};M();var Ub=e=>{const t=F(i=>{var o;return(o=i.selectedItem)==null?void 0:o.props.id}),n=F(i=>i.config),r=F(i=>{var o;return(o=i.state.indexes.nodes[t])==null?void 0:o.path}),s=et();return S.useMemo(()=>{const i=(r==null?void 0:r.map(o=>{var a,l,d;const[c]=o.split(":");if(c==="root")return{label:"Page",selector:null};const u=s.getState().state.indexes.nodes[c],p=u.path[u.path.length-1],v=(((a=s.getState().state.indexes.zones[p])==null?void 0:a.contentIds)||[]).indexOf(c);return{label:u?(d=(l=n.components[u.data.type])==null?void 0:l.label)!=null?d:u.data.type:"Component",selector:u?{index:v,zone:u.path[u.path.length-1]}:null}}))||[];return i.slice(i.length-e)},[r,e])},zt=ie("SidebarSection",Hb),xo=({children:e,title:t,background:n,showBreadcrumbs:r,noBorderTop:s,noPadding:i,isLoading:o})=>{const a=F(d=>d.setUi),l=Ub(1);return f.jsxs("div",{className:zt({noBorderTop:s,noPadding:i}),style:{background:n},children:[f.jsx("div",{className:zt("title"),children:f.jsxs("div",{className:zt("breadcrumbs"),children:[r?l.map((d,c
64)=>f.jsxs("div",{className:zt("breadcrumb"),children:[f.jsx("button",{type:"button",className:zt("breadcrumbLabel"),onClick:()=>a({itemSelector:d.selector}),children:d.label}),f.jsx(Jm,{size:16})]},c)):null,f.jsx("div",{className:zt("heading"),children:f.jsx(La,{rank:"2",size:"xs",children:t})})]})}),f.jsx("div",{className:zt("content"),children:e}),o&&f.jsx("div",{className:zt("loadingOverlay"),children:f.jsx(gn,{size:32})})]})};M();var kf={Puck:"_Puck_1yxlw_19","Puck-portal":"_Puck-portal_1yxlw_31","PuckLayout-inner":"_PuckLayout-inner_1yxlw_38","PuckLayout--mounted":"_PuckLayout--mounted_1yxlw_59","PuckLayout--leftSideBarVisible":"_PuckLayout--leftSideBarVisible_1yxlw_63","PuckLayout--rightSideBarVisible":"_PuckLayout--rightSideBarVisible_1yxlw_69","PuckLayout-mounted":"_PuckLayout-mounted_1yxlw_83",PuckLayout:"_PuckLayout_1yxlw_38"};M();M();var Vb={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"},Es=ie("PuckFields",Vb),Zb=({children:e})=>f.jsx(f.Fragment,{children:e}),Yb=(e,t)=>(n,r)=>Ce(void 0,null,function*(){let s;const{dispatch:i,state:o,selectedItem:a,resolveComponentData:l}=t.getState(),{data:d,ui:c}=o,{itemSelector:u}=c,p=d.root.props||d.root;a?s=a.props:s=p;const g=$(P({},s),{[e]:n});a&&u?i({type:"replace",destinationIndex:u.index,destinationZone:u.zone||Ve,data:(yield l($(P({},a),{props:g}),"replace")).node,ui:r}):d.root.props?i({type:"replaceRoot",root:(yield l($(P({},d.root),{props:g}),"replace")).node,ui:P(P({},c),r),recordHistory:!0}):i({type:"setData",data:{root:g}})}),qb=({fieldName:e})=>{const t=F(d=>d.fields.fields[e]),n=F(d=>((d.selectedItem?d.selectedItem.readOnly:d.state.data.root.readOnly)||{})[e]),r=F(d=>{const c=d.state.data.root.props||d.state.data.root;return d.selectedItem?d.selectedItem.props[e]:c[e]}),s=F(d=>t?d.selectedItem?`${d.selectedItem.props.id}_${t.type}_${e}`:`root_${t.type}_${e}`:null),i=F(Be(d=>{const{selectedItem:c,permissions:u}=d;return c?u.getPermissions({item:c}):u.getPermissions({root:!0})})),o=et(),a=S.useCallback(Yb(e,o),[e]),{visible:l=!0}=t??{};return!t||!s||!l||t.type==="slot"?null:f.jsx("div",{className:Es("field"),children:f.jsx(oi,{field:t,name:e,id:s,readOnly:!i.edit||n,value:r,onChange:a})},s)},Xb=S.memo(qb),Kb=({wrapFields:e=!0})=>{const t=F(c=>c.overrides),n=F(c=>{var u,p;const g=c.selectedItem?(u=c.componentState[c.selectedItem.props.id])==null?void 0:u.loadingCount:(p=c.componentState.root)==null?void 0:p.loadingCount;return(g??0)>0}),r=F(Be(c=>c.state.ui.itemSelector)),s=F(c=>{var u;return(u=c.selectedItem)==null?void 0:u.props.id}),i=et();Lm(i,s);const o=F(c=>c.fields.loading),a=F(Be(c=>c.fields.id===s?Object.keys(c.fields.fields):[])),l=o||n,d=S.useMemo(()=>t.fields||Zb,[t]);return f.jsxs("form",{className:Es({wrapFields:e}),onSubmit:c=>{c.preventDefault()},children:[f.jsx(d,{isLoading:l,itemSelector:r,children:a.map(c=>f.jsx(Xb,{fieldName:c},c))}),l&&f.jsx("div",{className:Es("loadingOverlay"),children:f.jsx("div",{className:Es("loadingOverlayInner"),children:f.jsx(gn,{size:16})})})]})},Ef=S.memo(Kb);M();M();M();M();var Gb={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"},us=ie("ComponentList",Gb),jf=({name:e,label:t})=>{var n;const r=F(i=>i.overrides),s=F(i=>i.permissions.getPermissions({type:e}).insert);return S.useEffect(()=>{r.componentItem&&console.warn("The `componentItem` override has been deprecated and renamed to `drawerItem`")},[r]),f.jsx(Ra.Item,{label:t,name:e,isDragDisabled:!s,children:(n=r.componentItem)!=null?n:r.drawerItem})},Dn=({children:e,title:t,id:n})=>{const r=F(a=>a.config),s=F(a=>a.setUi),i=F(a=>
64a.state.ui.componentList),{expanded:o=!0}=i[n]||{};return f.jsxs("div",{className:us({isExpanded:o}),children:[t&&f.jsxs("button",{type:"button",className:us("title"),onClick:()=>s({componentList:$(P({},i),{[n]:$(P({},i[n]),{expanded:!o})})}),title:o?`Collapse${t?` ${t}`:""}`:`Expand${t?` ${t}`:""}`,children:[f.jsx("div",{children:t}),f.jsx("div",{className:us("titleIcon"),children:o?f.jsx(of,{size:12}):f.jsx(ii,{size:12})})]}),f.jsx("div",{className:us("content"),children:f.jsx(Ra,{children:e||Object.keys(r.components).map(a=>{var l;return f.jsx(jf,{label:(l=r.components[a].label)!=null?l:a,name:a},a)})})})]})};Dn.Item=jf;var Jb=()=>{const[e,t]=S.useState(),n=F(s=>s.config),r=F(s=>s.state.ui.componentList);return S.useEffect(()=>{var s,i,o;if(Object.keys(r).length>0){const a=[];let l;l=Object.entries(r).map(([c,u])=>!u.components||(u.components.forEach(p=>{a.push(p)}),u.visible===!1)?null:f.jsx(Dn,{id:c,title:u.title||c,children:u.components.map((p,g)=>{var v;const C=n.components[p]||{};return f.jsx(Dn.Item,{label:(v=C.label)!=null?v:p,name:p,index:g},p)})},c));const d=Object.keys(n.components).filter(c=>a.indexOf(c)===-1);d.length>0&&!((s=r.other)!=null&&s.components)&&((i=r.other)==null?void 0:i.visible)!==!1&&l.push(f.jsx(Dn,{id:"other",title:((o=r.other)==null?void 0:o.title)||"Other",children:d.map((c,u)=>{var p;const g=n.components[c]||{};return f.jsx(Dn.Item,{name:c,label:(p=g.label)!=null?p:c,index:u},c)})},"other")),t(l)}},[n.categories,n.components,r]),e},Cf=()=>{const e=F(r=>r.overrides),t=Jb(),n=S.useMemo(()=>(e.components&&console.warn("The `components` override has been deprecated and renamed to `drawer`"),e.components||e.drawer||"div"),[e]);return f.jsx(n,{children:t||f.jsx(Dn,{id:"all"})})};M();M();var wo='style, link[rel="stylesheet"]',Qb=e=>{const t=[];return e.querySelectorAll(wo).forEach(n=>{n.tagName==="STYLE"?n.innerHTML.trim()&&t.push(n):t.push(n)}),t},Ql=e=>Array.from(document.styleSheets).find(t=>t.ownerNode.href===e.href),e_=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""},ec=(e,t)=>{const n=e.attributes;(n==null?void 0:n.length)>0&&Array.from(n).forEach(r=>{t.setAttribute(r.name,r.value)})},tc=e=>setTimeout(e,0),t_=({children:e,debug:t=!1,onStylesLoaded:n=()=>null})=>{const{document:r,window:s}=n_();return S.useEffect(()=>{if(!s||!r)return()=>{};let i=[];const o={},a=_=>i.findIndex(x=>x.original===_),l=(_,x=!1)=>Ce(void 0,null,function*(){let y;if(_.nodeName==="LINK"&&x){y=document.createElement("style"),y.type="text/css";let j=Ql(_);j||(yield new Promise(D=>{const m=()=>{D(),_.removeEventListener("load",m)};_.addEventListener("load",m)}),j=Ql(_));const I=e_(j);if(!I){t&&console.warn("Tried to load styles for link element, but couldn't find them. Skipping...");return}y.innerHTML=I,y.setAttribute("data-href",_.getAttribute("href"))}else y=_.cloneNode(!0);return y}),d=_=>Ce(void 0,null,function*(){const x=a(_);if(x>-1){t&&console.log("Tried to add an element that was already mirrored. Updating instead..."),i[x].mirror.innerText=_.innerText;return}const y=yield l(_);if(!y)return;const j=Si(y.outerHTML);if(o[j]){t&&console.log("iframe already contains element that is being mirrored. Skipping...");return}o[j]=!0,r.head.append(y),i.push({original:_,mirror:y}),t&&console.log(`Added style node ${_.outerHTML}`)}),c=_=>{var x,y;const j=a(_);if(j===-1){t&&console.log("Tried to remove an element that did not exist. Skipping...");return}const I=Si(_.outerHTML);(y=(x=i[j])==null?void 0:x.mirror)==null||y.remove(),delete o[I],t&&console.log(`Removed style node ${_.outerHTML}`)},u=new MutationObserver(_=>{_.forEach(x=>{x.type==="childList"&&(x.addedNodes.forEach(y=>{if(y.nodeType===Node.TEXT_NODE||y.nodeType===Node.ELEMENT_NODE){const j=y.nodeType===Node.TEXT_NODE?y.parentElement:y;j&&j.matches(wo)&&tc(()=>d(j))}}),x.removedNodes.forEach(y=>{if(y.nodeType===Node.TEXT_NODE||y.nodeType===Node.ELEMENT_NODE){const j=y.nodeType===Node.TEXT_NODE?y.parentElement:y;j&&j.matches(wo)&&tc(()=>c(j))}}))})}),p=s.parent.document,g=Qb(p),v=[];let C=0;const b=p.getElementsByTagName("html")[0];ec(b,r.documentElement);const k=p.getElementsByTagName("body")[0];return ec(k,r.body),Promise.all(g.map((_,x)=>Ce(void 0,null,function*(){if(_.nodeName==="LINK"){const j=_.href;if(v.indexOf(j)>-1)return;v.push(j)}const y=yield l(_);
64if(y)return i.push({original:_,mirror:y}),y}))).then(_=>{const x=_.filter(y=>typeof y<"u");x.forEach(y=>{y.onload=()=>{C=C+1,C>=i.length&&n()},y.onerror=()=>{console.warn("AutoFrame couldn't load a stylesheet"),C=C+1,C>=i.length&&n()}}),r.head.innerHTML="",r.head.append(...x),u.observe(p.head,{childList:!0,subtree:!0}),x.forEach(y=>{const j=Si(y.outerHTML);o[j]=!0})}),()=>{u.disconnect()}},[]),f.jsx(f.Fragment,{children:e})},Na=S.createContext({}),n_=()=>S.useContext(Na);function Pf(e){var t=e,{children:n,className:r,debug:s,id:i,onReady:o=()=>{},onNotReady:a=()=>{},frameRef:l}=t,d=Kt(t,["children","className","debug","id","onReady","onNotReady","frameRef"]);const[c,u]=S.useState(!1),[p,g]=S.useState({}),[v,C]=S.useState(),[b,k]=S.useState(!1);return S.useEffect(()=>{var _;if(l.current){const x=l.current.contentDocument,y=l.current.contentWindow;g({document:x||void 0,window:y||void 0}),C((_=l.current.contentDocument)==null?void 0:_.getElementById("frame-root")),x&&y&&b?o():a()}},[l,c,b]),f.jsx("iframe",$(P({},d),{className:r,id:i,srcDoc:'<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',ref:l,onLoad:()=>{u(!0)},children:f.jsx(Na.Provider,{value:p,children:c&&v&&f.jsx(t_,{debug:s,onStylesLoaded:()=>k(!0),children:qs.createPortal(n,v)})})}))}Pf.displayName="AutoFrame";var r_=Pf;M();var s_={PuckPreview:"_PuckPreview_z2rgu_1","PuckPreview-frame":"_PuckPreview-frame_z2rgu_6"},Di=ie("PuckPreview",s_),i_=e=>{const t=F(n=>n.status);S.useEffect(()=>{if(e.current&&t==="READY"){const n=e.current,r=o=>{const a=new _f("pointermove",$(P({},o),{bubbles:!0,cancelable:!1,clientX:o.clientX,clientY:o.clientY,originalTarget:o.target}));n.dispatchEvent(a)},s=()=>{var o;i(),(o=n.contentDocument)==null||o.addEventListener("pointermove",r,{capture:!0})},i=()=>{var o;(o=n.contentDocument)==null||o.removeEventListener("pointermove",r)};return s(),()=>{i()}}},[t])},Df=({id:e="puck-preview"})=>{const t=F(v=>v.dispatch),n=F(v=>v.state.data.root),r=F(v=>v.config),s=F(v=>v.setStatus),i=F(v=>v.iframe),o=F(v=>v.overrides),a=F(v=>v.metadata),l=F(v=>v.state.ui.previewMode==="edit"?null:v.state.data),d=S.useCallback(v=>{var C,b;const k=Xs(r,{type:"root",props:v},vo);return(C=r.root)!=null&&C.render?(b=r.root)==null?void 0:b.render(P({id:"puck-root"},k)):f.jsx(f.Fragment,{children:k.children})},[r]),c=S.useMemo(()=>o.iframe,[o]),u=n.props||n,p=S.useRef(null);i_(p);const g=l?f.jsx(Fb,{data:l,config:r,metadata:a}):f.jsx(d,$(P({},u),{puck:{renderDropZone:yo,isEditing:!0,dragRef:null,metadata:a},editMode:!0,children:f.jsx(yo,{zone:Ve})}));return S.useEffect(()=>{i.enabled||s("READY")},[i.enabled]),f.jsx("div",{className:Di(),id:e,"data-puck-preview":!0,onClick:v=>{const C=v.target;!C.hasAttribute("data-puck-component")&&!C.hasAttribute("data-puck-dropzone")&&t({type:"setUi",ui:{itemSelector:null}})},children:i.enabled?f.jsx(r_,{id:"preview-frame",className:Di("frame"),"data-rfd-iframe":!0,onReady:()=>{s("READY")},onNotReady:()=>{s("MOUNTED")},frameRef:p,children:f.jsx(Na.Consumer,{children:({document:v})=>c?f.jsx(c,{document:v,children:g}):g})}):f.jsx("div",{id:"preview-frame",className:Di("frame"),ref:p,"data-puck-entry":!0,children:g})})};M();M();M();var Of={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"};M();var o_=e=>{const t=P({},e.style);e.style.scrollMargin="256px",e&&(e==null||e.scrollIntoView({behavior:"smooth"}),e.style.scrollMargin=t.scrollMargin||"")};M();var a_=(e,t)=>{let n;const r=function(){clearTimeout(n),n=setTimeout(function(){t(),e==null||e.removeEventListener("scroll",r)},50)};e==null||e.addEventListener("scroll",r),setTimeout(()=>{n||t()},50)},fs=ie("LayerTree",Of),Ft=ie("Layer",Of),l_=({index:e,itemId:t,zoneCompound:n})=>{var r;const s=F(_=>
64_.config),i=F(_=>_.state.ui.itemSelector),o=F(_=>_.dispatch),a=S.useCallback(_=>{o({type:"setUi",ui:{itemSelector:_}})},[o]),d=F(_=>{var x;return(x=_.selectedItem)==null?void 0:x.props.id})===t||i&&i.zone===Ve&&!n,c=F(_=>_.state.indexes.nodes[t]),u=F(Be(_=>Object.keys(_.state.indexes.zones).filter(x=>x.split(":")[0]===t))),p=u.length>0,g=S.useContext(rt),v=dn(rt,_=>_.hoveringComponent===t),C=F(_=>{var x,y;const j=_.state.indexes.nodes[(x=_.selectedItem)==null?void 0:x.props.id];return(y=j==null?void 0:j.path.some(I=>{const[D]=I.split(":");return D===t}))!=null?y:!1}),b=s.components[c.data.type],k=(r=b==null?void 0:b.label)!=null?r:c.data.type.toString();return f.jsxs("li",{className:Ft({isSelected:d,isHovering:v,containsZone:p,childIsSelected:C}),children:[f.jsx("div",{className:Ft("inner"),children:f.jsxs("button",{type:"button",className:Ft("clickable"),onClick:()=>{if(d){a(null);return}const _=$n(),x=_==null?void 0:_.querySelector(`[data-puck-component="${t}"]`);if(!x){a({index:e,zone:n});return}o_(x),a_(_,()=>{a({index:e,zone:n})})},onMouseEnter:_=>{_.stopPropagation(),g.setState({hoveringComponent:t})},onMouseLeave:_=>{_.stopPropagation(),g.setState({hoveringComponent:null})},children:[p&&f.jsx("div",{className:Ft("chevron"),title:d?"Collapse":"Expand",children:f.jsx(ii,{size:"12"})}),f.jsxs("div",{className:Ft("title"),children:[f.jsx("div",{className:Ft("icon"),children:c.data.type==="Text"||c.data.type==="Heading"?f.jsx(Ta,{size:"16"}):f.jsx(sy,{size:"16"})}),f.jsx("div",{className:Ft("name"),children:k})]})]})}),p&&u.map(_=>f.jsx("div",{className:Ft("zones"),children:f.jsx(Af,{zoneCompound:_})},_))]})},Af=({label:e,zoneCompound:t})=>{const n=F(s=>{var i,o,a,l;if(e)return e;if(t===Ve)return;const[d,c]=t.split(":"),u=(i=s.state.indexes.nodes[d])==null?void 0:i.data.type,p=u&&u!==Do?s.config.components[u]:s.config.root;return(l=(a=(o=p==null?void 0:p.fields)==null?void 0:o[c])==null?void 0:a.label)!=null?l:c}),r=F(Be(s=>{var i,o;return t?(o=(i=s.state.indexes.zones[t])==null?void 0:i.contentIds)!=null?o:[]:[]}));return f.jsxs(f.Fragment,{children:[n&&f.jsxs("div",{className:fs("zoneTitle"),children:[f.jsx("div",{className:fs("zoneIcon"),children:f.jsx(ry,{size:"16"})}),n]}),f.jsxs("ul",{className:fs(),children:[r.length===0&&f.jsx("div",{className:fs("helper"),children:"No items"}),r.map((s,i)=>f.jsx(l_,{index:i,itemId:s,zoneCompound:t},s))]})]})};M();var c_=(e,t)=>Object.keys(e.indexes.zones).filter(n=>n.split(":")[0]===t),Mf=()=>{const e=F(r=>r.overrides.outline),t=F(Be(r=>c_(r.state,"root"))),n=S.useMemo(()=>e||"div",[e]);return f.jsx(n,{children:t.map(r=>f.jsx(Af,{label:t.length===1?"":r.split(":")[1],zoneCompound:r},r))})};M();M();M();var Tf={ViewportControls:"_ViewportControls_gejzr_1","ViewportControls-divider":"_ViewportControls-divider_gejzr_15","ViewportControls-zoomSelect":"_ViewportControls-zoomSelect_gejzr_21","ViewportButton--isActive":"_ViewportButton--isActive_gejzr_38","ViewportButton-inner":"_ViewportButton-inner_gejzr_38"},nc={Smartphone:f.jsx(gy,{size:16}),Tablet:f.jsx(vy,{size:16}),Monitor:f.jsx(ly,{size:16})},ps=ie("ViewportControls",Tf),rc=ie("ViewportButton",Tf),d_=({children:e,height:t="auto",title:n,width:r,onClick:s})=>{const i=F(l=>l.state.ui.viewports),[o,a]=S.useState(!1);return S.useEffect(()=>{a(r===i.current.width)},[r,i.current.width]),f.jsx("span",{className:rc({isActive:o}),children:f.jsx(bt,{type:"button",title:n,disabled:o,onClick:l=>{l.stopPropagation(),s({width:r,height:t})},children:f.jsx("span",{className:rc("inner"),children:e})})})},sc=[{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}],u_=({autoZoom:e,zoom:t,onViewportChange:n,onZoom:r})=>{var s,i;const o=F(d=>d.viewports),a=sc.find(d=>d.value===e),l=S.useMemo(()=>[...sc,...a?[]:[{value:e,label:`${(e*100).toFixed(0)}% (Auto)`}]].filter(d=>d.value<=e).sort((d,c)=>d.value>c.value?1:-1),[e]);return f.jsxs("div",{className:ps(),children:[o.map((d,c)=>f.jsx(d_,{height:d.height,width:d.width,title:d.label?`Switch to ${d.label} viewport`:"Switch viewport",onClick:n,children:typeof d.icon=="str
64ing"?nc[d.icon]||d.icon:d.icon||nc.Smartphone},c)),f.jsx("div",{className:ps("divider")}),f.jsx(bt,{type:"button",title:"Zoom viewport out",disabled:t<=((s=l[0])==null?void 0:s.value),onClick:d=>{d.stopPropagation(),r(l[Math.max(l.findIndex(c=>c.value===t)-1,0)].value)},children:f.jsx(by,{size:16})}),f.jsx(bt,{type:"button",title:"Zoom viewport in",disabled:t>=((i=l[l.length-1])==null?void 0:i.value),onClick:d=>{d.stopPropagation(),r(l[Math.min(l.findIndex(c=>c.value===t)+1,l.length-1)].value)},children:f.jsx(yy,{size:16})}),f.jsx("div",{className:ps("divider")}),f.jsx("select",{className:ps("zoomSelect"),value:t.toString(),onClick:d=>{d.stopPropagation()},onChange:d=>{r(parseFloat(d.currentTarget.value))},children:l.map(d=>f.jsx("option",{value:d.value,label:d.label},d.label))})]})};M();var f_={PuckCanvas:"_PuckCanvas_18jay_1","PuckCanvas-controls":"_PuckCanvas-controls_18jay_16","PuckCanvas-inner":"_PuckCanvas-inner_18jay_21","PuckCanvas-root":"_PuckCanvas-root_18jay_30","PuckCanvas--ready":"_PuckCanvas--ready_18jay_55","PuckCanvas-loader":"_PuckCanvas-loader_18jay_60","PuckCanvas--showLoader":"_PuckCanvas--showLoader_18jay_70"};M();var Lf=S.createContext(null),p_=({children:e})=>{const t=S.useRef(null),n=S.useMemo(()=>({frameRef:t}),[]);return f.jsx(Lf.Provider,{value:n,children:e})},$f=()=>{const e=S.useContext(Lf);if(e===null)throw new Error("useCanvasFrame must be used within a FrameProvider");return e},Qn=ie("PuckCanvas",f_),Oi=150,h_=()=>{const{frameRef:e}=$f(),t=nf(e),{dispatch:n,overrides:r,setUi:s,zoomConfig:i,setZoomConfig:o,status:a,iframe:l}=F(Be(I=>({dispatch:I.dispatch,overrides:I.overrides,setUi:I.setUi,zoomConfig:I.zoomConfig,setZoomConfig:I.setZoomConfig,status:I.status,iframe:I.iframe}))),{leftSideBarVisible:d,rightSideBarVisible:c,leftSideBarWidth:u,rightSideBarWidth:p,viewports:g}=F(Be(I=>({leftSideBarVisible:I.state.ui.leftSideBarVisible,rightSideBarVisible:I.state.ui.rightSideBarVisible,leftSideBarWidth:I.state.ui.leftSideBarWidth,rightSideBarWidth:I.state.ui.rightSideBarWidth,viewports:I.state.ui.viewports}))),[v,C]=S.useState(!1),b=S.useRef(!1),k=S.useMemo(()=>({children:D})=>f.jsx(f.Fragment,{children:D}),[]),_=S.useMemo(()=>r.preview||k,[r]),x=S.useCallback(()=>{if(e.current){const I=e.current,D=tf(I);return{width:D.contentBox.width,height:D.contentBox.height}}return{width:0,height:0}},[e]);S.useEffect(()=>{t()},[e,d,c,u,p,g]),S.useEffect(()=>{const{height:I}=x();g.current.height==="auto"&&o($(P({},i),{rootHeight:I/i.zoom}))},[i.zoom,x,o]),S.useEffect(()=>{t()},[g.current.width,g]),S.useEffect(()=>{if(!e.current)return;const I=new ResizeObserver(()=>{b.current||t()});return I.observe(e.current),()=>{I.disconnect()}},[e.current]);const[y,j]=S.useState(!1);return S.useEffect(()=>{setTimeout(()=>{j(!0)},500)},[]),f.jsxs("div",{className:Qn({ready:a==="READY"||!l.enabled||!l.waitForStyles,showLoader:y}),onClick:I=>{const D=I.target;!D.hasAttribute("data-puck-component")&&!D.hasAttribute("data-puck-dropzone")&&n({type:"setUi",ui:{itemSelector:null},recordHistory:!0})},children:[g.controlsVisible&&l.enabled&&f.jsx("div",{className:Qn("controls"),children:f.jsx(u_,{autoZoom:i.autoZoom,zoom:i.zoom,onViewportChange:I=>{C(!0),b.current=!0;const D=$(P({},I),{height:I.height||"auto",zoom:i.zoom}),m={viewports:$(P({},g),{current:D})};s(m),t({viewports:$(P({},g),{current:D})})},onZoom:I=>{C(!0),b.current=!0,o($(P({},i),{zoom:I}))}})}),f.jsxs("div",{className:Qn("inner"),ref:e,children:[f.jsx("div",{className:Qn("root"),style:{width:l.enabled?g.current.width:"100%",height:i.rootHeight,transform:l.enabled?`scale(${i.zoom})`:void 0,transition:v?`width ${Oi}ms ease-out, height ${Oi}ms ease-out, transform ${Oi}ms ease-out`:"",overflow:l.enabled?void 0:"auto"},suppressHydrationWarning:!0,id:"puck-canvas-root",onTransitionEnd:()=>{C(!1),b.current=!1},children:f.jsx(_,{children:f.jsx(Df,{})})}),f.jsx("div",{className:Qn("loader"),children:f.jsx(gn,{size:24})})]})]})};M();M();var g_=({overrides:e,plugins:t})=>{const n=P({},e);return t==null||t.forEach(r=>{r.overrides&&Object.keys(r.overrides).forEach(s=>{var i;const o=s;if(!((i=r.overrides)!=null&&i[o]))return;if(o==="fieldTypes"){const d=r.overrides.fieldTypes;
64Object.keys(d).forEach(c=>{n.fieldTypes=n.fieldTypes||{};const u=n.fieldTypes[c],p=g=>d[c]($(P({},g),{children:u?u(g):g.children}));n.fieldTypes[c]=p});return}const a=n[o],l=d=>r.overrides[o]($(P({},d),{children:a?a(d):d.children}));n[o]=l})}),n},v_=({overrides:e,plugins:t})=>S.useMemo(()=>g_({overrides:e,plugins:t}),[t,e]);M();var So=({children:e})=>f.jsx(f.Fragment,{children:e});M();var m_="",y_=(e,t)=>{const[n,r]=S.useState();return S.useEffect(()=>{r(document.createElement("style"))},[]),S.useEffect(()=>{var s;if(!(!n||typeof window>"u")){if(n.innerHTML=e,t){const i=$n();(s=i==null?void 0:i.head)==null||s.appendChild(n)}document.head.appendChild(n)}},[t,n]),n},b_=e=>y_(m_,e);M();var __=()=>{const e=et(),t=S.useCallback(()=>{const n=e.getState().dispatch;n({type:"setUi",ui:r=>({previewMode:r.previewMode==="edit"?"interactive":"edit"})})},[e]);Ut({meta:!0,i:!0},t),Ut({ctrl:!0,i:!0},t)};M();M();M();var x_={MenuBar:"_MenuBar_8pf8c_1","MenuBar--menuOpen":"_MenuBar--menuOpen_8pf8c_14","MenuBar-inner":"_MenuBar-inner_8pf8c_29","MenuBar-history":"_MenuBar-history_8pf8c_45"},Ai=ie("MenuBar",x_);function w_({menuOpen:e=!1,renderHeaderActions:t,setMenuOpen:n}){const r=F(a=>a.history.back),s=F(a=>a.history.forward),i=F(a=>a.history.hasFuture()),o=F(a=>a.history.hasPast());return f.jsx("div",{className:Ai({menuOpen:e}),onClick:a=>{var l;const d=a.target;window.matchMedia("(min-width: 638px)").matches||d.tagName==="A"&&((l=d.getAttribute("href"))!=null&&l.startsWith("#"))&&n(!1)},children:f.jsxs("div",{className:Ai("inner"),children:[f.jsxs("div",{className:Ai("history"),children:[f.jsx(bt,{type:"button",title:"undo",disabled:!o,onClick:r,children:f.jsx(my,{size:21})}),f.jsx(bt,{type:"button",title:"redo",disabled:!i,onClick:s,children:f.jsx(fy,{size:21})})]}),f.jsx(f.Fragment,{children:t&&t()})]})})}M();var S_={PuckHeader:"_PuckHeader_15xnq_1","PuckHeader-inner":"_PuckHeader-inner_15xnq_10","PuckHeader-toggle":"_PuckHeader-toggle_15xnq_20","PuckHeader--rightSideBarVisible":"_PuckHeader--rightSideBarVisible_15xnq_27","PuckHeader-rightSideBarToggle":"_PuckHeader-rightSideBarToggle_15xnq_27","PuckHeader--leftSideBarVisible":"_PuckHeader--leftSideBarVisible_15xnq_28","PuckHeader-leftSideBarToggle":"_PuckHeader-leftSideBarToggle_15xnq_28","PuckHeader-title":"_PuckHeader-title_15xnq_32","PuckHeader-path":"_PuckHeader-path_15xnq_36","PuckHeader-tools":"_PuckHeader-tools_15xnq_43","PuckHeader-menuButton":"_PuckHeader-menuButton_15xnq_49","PuckHeader--menuOpen":"_PuckHeader--menuOpen_15xnq_54"},Ot=ie("PuckHeader",S_),I_=()=>{const{onPublish:e,renderHeader:t,renderHeaderActions:n,headerTitle:r,headerPath:s,iframe:i}=za(),o=F(_=>_.dispatch),a=et(),l=S.useMemo(()=>t?(console.warn("`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"),x=>{var y=x,{actions:j}=y,I=Kt(y,["actions"]);const D=t,m=F(E=>E.state);return f.jsx(D,$(P({},I),{dispatch:o,state:m,children:j}))}):So,[t]),d=S.useMemo(()=>n?(console.warn("`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."),x=>{const y=n,j=F(I=>I.state);return f.jsx(y,$(P({},x),{dispatch:o,state:j}))}):So,[n]),c=F(_=>_.overrides.header||l),u=F(_=>_.overrides.headerActions||d),[p,g]=S.useState(!1),v=F(_=>{var x,y;return(y=((x=_.state.indexes.nodes.root)==null?void 0:x.data).props.title)!=null?y:""}),C=F(_=>_.state.ui.leftSideBarVisible),b=F(_=>_.state.ui.rightSideBarVisible),k=S.useCallback(_=>{const x=window.matchMedia("(min-width: 638px)").matches,y=_==="left"?C:b,j=_==="left"?"rightSideBarVisible":"leftSideBarVisible";o({type:"setUi",ui:P({[`${_}SideBarVisible`]:!y},x?{}:{[j]:!1})})},[o,C,b]);return f.jsx(c,{actions:f.jsx(f.Fragment,{children:f.jsx(u,{children:f.jsx(po,{onClick:()=>{const _=a.getState().state.data;e&&e(_)},icon:f.jsx(zl,{size:"14px"}),children:"Publish"})})}),children:f.jsx("header",{className:Ot({leftSideBarVisible:C,rightSideBarVisible:b}),children:f.jsxs("div",{className:Ot("inner"),children:[f.jsxs("div",{className:Ot("toggle"),children:[f.jsx("div",{className:Ot("leftSideBarToggle"),children:f.jsx(bt,{type:"button",onClick:()=>{k("left")},title:"Toggle left sidebar",children:f.jsx(cy,{focusable:"false"})})}),f.jsx("div",{className:Ot("rightSideBarToggle"),children:f.jsx(bt,{type:"button",onClick:()=>{k("right")},title:"Toggle right sidebar",children:f.jsx(dy,{focusable:"false"})})})]}),f.jsx("div",{className:Ot("title"),children:f.jsxs(La,{rank:"2",size:"xs",children:[r||v||"Page",s&&f.jsxs(f.Fragment,{children:[" ",f.jsx("code",{className:Ot("path"),children:s})]})]})}),f.jsxs("div",{className:Ot("tools"),children:[f.jsx("div",{className:Ot("menuButton"),children:f.jsx(bt,{type:"button",onClick:()=>g(!p),title:"Toggle menu bar",children:p?f.jsx(of,{focusable:"false"}):f.jsx(ii,{focusable:"false"})})}),f.jsx(w_,{dispatch:o,onPublish:e,menuOpen:p,renderHeaderActions:()=>f.jsx(u,{children:f.jsx(po,{onClick:()=>{const _=a.getState().state.data;e&&e(_)},icon:f.jsx(zl,{size:"14px"}),children:"Publish"})}),setMenuOpen:g})]})]})})})},k_=S.memo(I_);M();M();M();var E_={ResizeHandle:"_ResizeHandle_144bf_2","ResizeHandle--left":"_ResizeHandle--left_144bf_16","ResizeHandle--right":"_ResizeHandle--right_144bf_20"},j_=ie("ResizeHandle",E_),C_=({position:e,sidebarRef:t,onResize:n,onResizeEnd:r})=>{const{frameRef:s}=$f(),i=nf(s),o=S.useRef(null),a=S.useRef(!1),l=S.useRef(0),d=S.useRef(0),c=S.useCallback(g=>{if(!a.current)return;const v=g.clientX-l.current,C=e==="left"?d.current+v:d.current-v,b=Math.max(192,C);n(b),g.preventDefault()},[n,e]),u=S.useCallback(()=>{var g;if(!a.current)return;a.current=!1,document.body.style.cursor="",document.body.style.userSelect="";const v=document.getElementById("resize-overlay");v&&document.body.removeChild(v),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u);const C=((g=t.current)==null?void 0:g.getBoundingClientRect().width)||0;r(C),i()},[r]),p=S.useCallback(g=>{var v;a.current=!0,l.current=g.clientX,d.current=((v=t.current)==null?void 0:v.getBoundingClientRect().width)||0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const C=document.createElement("div");C.id="resize-overlay",C.setAttribute("data-resize-overlay",""),document.body.appendChild(C),document.addEventListener("mousemove",c),document.addEventListener("mouseup",u),g.preventDefault()},[e,c,u]);return f.jsx("div",{ref:o,className:j_({[e]:!0}),onMouseDown:p})};M();var P_={Sidebar:"_Sidebar_1xksb_1","Sidebar--left":"_Sidebar--left_1xksb_8","Sidebar--right":"_Sidebar--right_1xksb_14","Sidebar-resizeHandle":"_Sidebar-resizeHandle_1xksb_20"},ic=ie("Sidebar",P_),oc=({position:e,sidebarRef:t,isVisible:n,onResize:r,onResizeEnd:s,children:i})=>n?f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:t,className:ic({[e]:!0}),children:i}),f.jsx("div",{className:`${ic("resizeHandle")}`,children:f.jsx(C_,{position:e,sidebarRef:t,onResize:r,onResizeEnd:s})})]}):null;M();function ac(e,t){const[n,r]=S.useState(null),s=S.useRef(null),i=F(a=>e==="left"?a.state.ui.leftSideBarWidth:a.state.ui.rightSideBarWidth);
64S.useEffect(()=>{if(typeof window<"u"&&!i)try{const a=localStorage.getItem("puck-sidebar-widths");if(a){const d=JSON.parse(a)[e];d&&t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:d}})}}catch(a){console.error(`Failed to load ${e} sidebar width from localStorage`,a)}},[t,e,i]),S.useEffect(()=>{i!==void 0&&r(i)},[i]);const o=S.useCallback(a=>{t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:a}});let l={};try{const d=localStorage.getItem("puck-sidebar-widths");l=d?JSON.parse(d):{}}catch(d){console.error(`Failed to save ${e} sidebar width to localStorage`,d)}finally{localStorage.setItem("puck-sidebar-widths",JSON.stringify($(P({},l),{[e]:a})))}window.dispatchEvent(new CustomEvent("viewportchange",{bubbles:!0,cancelable:!1}))},[t,e]);return{width:n,setWidth:r,sidebarRef:s,handleResizeEnd:o}}var lc=ie("Puck",kf),cc=ie("PuckLayout",kf),D_=()=>{const e=F(t=>{var n,r;return t.selectedItem?(r=(n=t.config.components[t.selectedItem.type])==null?void 0:n.label)!=null?r:t.selectedItem.type.toString():"Page"});return f.jsx(xo,{noPadding:!0,noBorderTop:!0,showBreadcrumbs:!0,title:e,children:f.jsx(Ef,{})})},Rf=S.createContext({});function O_(e){return f.jsx(Rf.Provider,{value:e,children:e.children})}var za=()=>S.useContext(Rf);function A_({children:e}){const{config:t,data:n,ui:r,onChange:s,permissions:i={},plugins:o,overrides:a,viewports:l=Ds,iframe:d,initialHistory:c,metadata:u,onAction:p,fieldTransforms:g}=za(),v=S.useMemo(()=>P({enabled:!0,waitForStyles:!0},d),[d]),[C]=S.useState(()=>{var h,A,T,R,N,U,z,K,V;const X=P(P({},Ti.ui),r);let G={};if(typeof window<"u"){window.matchMedia("(max-width: 638px)").matches&&(G=$(P({},G),{leftSideBarVisible:!1,rightSideBarVisible:!1}));const Ie=window.innerWidth,Ee=Object.entries(l).map(([De,Z])=>({key:De,diff:Math.abs(Ie-Z.width)})).sort((De,Z)=>De.diff>Z.diff?1:-1)[0].key;v.enabled&&(G=$(P({},G),{viewports:$(P({},X.viewports),{current:$(P({},X.viewports.current),{height:((A=(h=r==null?void 0:r.viewports)==null?void 0:h.current)==null?void 0:A.height)||((T=l[Ee])==null?void 0:T.height)||"auto",width:((N=(R=r==null?void 0:r.viewports)==null?void 0:R.current)==null?void 0:N.width)||((U=l[Ee])==null?void 0:U.width)})})}))}Object.keys((n==null?void 0:n.root)||{}).length>0&&!((z=n==null?void 0:n.root)!=null&&z.props)&&console.warn("Warning: Defining props on `root` is deprecated. Please use `root.props`, or republish this page to migrate automatically.");const q=((K=n==null?void 0:n.root)==null?void 0:K.props)||(n==null?void 0:n.root)||{},te=P(P({},(V=t.root)==null?void 0:V.defaultProps),q),ce=$(P({},Ti),{data:$(P({},n),{root:$(P({},n==null?void 0:n.root),{props:te}),content:n.content||[]}),ui:$(P(P({},X),G),{componentList:t.categories?Object.entries(t.categories).reduce((Ie,[se,Ee])=>$(P({},Ie),{[se]:{title:Ee.title,components:Ee.components,expanded:Ee.defaultExpanded,visible:Ee.visible}}),{}):{}})});return st(ce,t)}),{appendData:b=!0}=c||{},[k]=S.useState([...(c==null?void 0:c.histories)||[],...b?[{state:C}]:[]].map(h=>{let A=P(P({},C),h.state);return h.state.indexes||(A=st(A,t)),$(P({},h),{state:A})})),_=(c==null?void 0:c.index)||k.length-1,x=k[_].state,y=v_({overrides:a,plugins:o}),j=S.useMemo(()=>{const A=(o||[]).reduce((T,R)=>P(P({},T),R.fieldTransforms),{});return P(P({},A),g)},[g,o]),I=S.useCallback(h=>({state:h,config:t,plugins:o||[],overrides:y,viewports:l,iframe:v,onAction:p,metadata:u,fieldTransforms:j}),[x,t,o,y,l,v,p,u,j]),[D]=S.useState(()=>ef(I(x)));S.useEffect(()=>{},[D]),S.useEffect(()=>{const h=D.getState().state;D.setState(P({},I(h)))},[t,o,y,l,v,p,u]),Dm(D,{histories:k,index:_,initialAppState:x});const m=S.useRef(null);S.useEffect(()=>{D.subscribe(h=>h.state.data,h=>{if(s){if(js(h,m.current))return;s(h),m.current=h}})},[]),Mm(D,i);const E=Wb(D);return S.useEffect(()=>{const{resolveAndCommitData:h}=D.getState();h()},[]),f.jsx(Ma.Provider,{value:D,children:f.jsx(Bb.Provider,{value:E,children:e})})}function M_({children:e}){const{iframe:t,dnd:n,initialHistory:r}=za(),s=S.useMemo(()=>P({enabled:!0,waitForStyles:!0},t),[t]);b_(s.enabled);const i=F(I=>I.dispatch),o=F(I=>I.state.ui.leftSideBarVisible),a=F(I=>I.state.ui.rightSideBarVisible),{width:l,setWidth:d,sidebarRef:c,handleResizeEnd:u}
64=ac("left",i),{width:p,setWidth:g,sidebarRef:v,handleResizeEnd:C}=ac("right",i);S.useEffect(()=>{window.matchMedia("(min-width: 638px)").matches||i({type:"setUi",ui:{leftSideBarVisible:!1,rightSideBarVisible:!1}});const I=()=>{window.matchMedia("(min-width: 638px)").matches||i({type:"setUi",ui:D=>P(P({},D),D.rightSideBarVisible?{leftSideBarVisible:!1}:{})})};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[]);const b=F(I=>I.overrides),k=S.useMemo(()=>b.puck||So,[b]),[_,x]=S.useState(!1);S.useEffect(()=>{x(!0)},[]);const y=F(I=>I.status==="READY");jm(),S.useEffect(()=>{if(y&&s.enabled){const I=$n();if(I)return Qu(I)}},[y,s.enabled]),__();const j={};return l&&(j["--puck-user-left-side-bar-width"]=`${l}px`),p&&(j["--puck-user-right-side-bar-width"]=`${p}px`),f.jsxs("div",{className:`Puck ${lc()}`,children:[f.jsx(yb,{disableAutoScroll:n==null?void 0:n.disableAutoScroll,children:f.jsx(k,{children:e||f.jsx(p_,{children:f.jsx("div",{className:cc({leftSideBarVisible:o,mounted:_,rightSideBarVisible:a}),children:f.jsxs("div",{className:cc("inner"),style:j,children:[f.jsx(k_,{}),f.jsxs(oc,{position:"left",sidebarRef:c,isVisible:o,onResize:d,onResizeEnd:u,children:[f.jsx(xo,{title:"Components",noBorderTop:!0,children:f.jsx(Cf,{})}),f.jsx(xo,{title:"Outline",children:f.jsx(Mf,{})})]}),f.jsx(h_,{}),f.jsx(oc,{position:"right",sidebarRef:v,isVisible:a,onResize:g,onResizeEnd:C,children:f.jsx(D_,{})})]})})})})}),f.jsx("div",{id:"puck-portal-root",className:lc("portal")})]})}function Xr(e){return f.jsx(O_,$(P({},e),{children:f.jsx(A_,$(P({},e),{children:f.jsx(M_,P({},e))}))}))}Xr.Components=Cf;Xr.Fields=Ef;Xr.Outline=Mf;Xr.Preview=Df;M();M();M();M();M();M();M();M();M();M();M();M();/*! Bundled license information:
65
66classnames/index.js:
67  (*!
68  	Copyright (c) 2018 Jed Watson.
69  	Licensed under the MIT License (MIT), see
70  	http://jedwatson.github.io/classnames
71  *)
72
73lucide-react/dist/esm/shared/src/utils.js:
74  (**
75   * @license lucide-react v0.468.0 - ISC
76   *
77   * This source code is licensed under the ISC license.
78   * See the LICENSE file in the root directory of this source tree.
79   *)
80
81lucide-react/dist/esm/defaultAttributes.js:
82  (**
83   * @license lucide-react v0.468.0 - ISC
84   *
85   * This source code is licensed under the ISC license.
86   * See the LICENSE file in the root directory of this source tree.
87   *)
88
89lucide-react/dist/esm/Icon.js:
90  (**
91   * @license lucide-react v0.468.0 - ISC
92   *
93   * This source code is licensed under the ISC license.
94   * See the LICENSE file in the root directory of this source tree.
95   *)
96
97lucide-react/dist/esm/createLucideIcon.js:
98  (**
99   * @license lucide-react v0.468.0 - ISC
100   *
101   * This source code is licensed under the ISC license.
102   * See the LICENSE file in the root directory of this source tree.
103   *)
104
105lucide-react/dist/esm/icons/chevron-down.js:
106  (**
107   * @license lucide-react v0.468.0 - ISC
108   *
109   * This source code is licensed under the ISC license.
110   * See the LICENSE file in the root directory of this source tree.
111   *)
112
113lucide-react/dist/esm/icons/chevron-right.js:
114  (**
115   * @license lucide-react v0.468.0 - ISC
116   *
117   * This source code is licensed under the ISC license.
118   * See the LICENSE file in the root directory of this source tree.
119   *)
120
121lucide-react/dist/esm/icons/chevron-up.js:
122  (**
123   * @license lucide-react v0.468.0 - ISC
124   *
125   * This source code is licensed under the ISC license.
126   * See the LICENSE file in the root directory of this source tree.
127   *)
128
129lucide-react/dist/esm/icons/circle-check-big.js:
130  (**
131   * @license lucide-react v0.468.0 - ISC
132   *
133   * This source code is licensed under the ISC license.
134   * See the LICENSE file in the root directory of this source tree.
135   *)
136
137lucide-react/dist/esm/icons/copy.js:
138  (**
139   * @license lucide-react v0.468.0 - ISC
140   *
141   * This source code is licensed under the ISC license.
142   * See the LICENSE file in the root directory of this source tree.
143   *)
144
145lucide-react/dist/esm/icons/corner-left-up.js:
146  (**
147   * @license lucide-react v0.468.0 - ISC
148   *
149   * This source code is licensed under the ISC license.
150   * See the LICENSE file in the root directory of this source tree.
151   *)
152
153lucide-react/dist/esm/icons/ellipsis-vertical.js:
154  (**
155   * @license lucide-react v0.468.0 - ISC
156   *
157   * This source code is licensed under the ISC license.
158   * See the LICENSE file in the root directory of this source tree.
159   *)
160
161lucide-react/dist/esm/icons/globe.js:
162  (**
163   * @license lucide-react v0.468.0 - ISC
164   *
165   * This source code is licensed under the ISC license.
166   * See the LICENSE file in the root directory of this source tree.
167   *)
168
169lucide-react/dist/esm/icons/hash.js:
170  (**
171   * @license lucide-react v0.468.0 - ISC
172   *
173   * This source code is licensed under the ISC license.
174   * See the LICENSE file in the root directory of this source tree.
175   *)
176
177lucide-react/dist/esm/icons/layers.js:
178  (**
179   * @license lucide-react v0.468.0 - ISC
180   *
181   * This source code is licensed under the ISC license.
182   * See the LICENSE file in the root directory of this source tree.
183   *)
184
185lucide-react/dist/esm/icons/layout-grid.js:
186  (**
187   * @license lucide-react v0.468.0 - ISC
188   *
189   * This source code is licensed under the ISC license.
190   * See the LICENSE file in the root directory of this source tree.
191   *)
192
193lucide-react/dist/esm/icons/link.js:
194  (**
195   * @license lucide-react v0.468.0 - ISC
196   *
197   * This source code is licensed under the ISC license.
198   * See the LICENSE file in the root directory of this source tree.
199   *)
200
201lucide-react/dist/esm/icons/list.js:
202  (**
203   * @license lucide-react v0.468.0 - ISC
204   *
205   * This source code is licensed under the ISC license.
206   * See the LICENSE file in the root directory of this source tree.
207   *)
208
209lucide-react/dist/esm/icons/lock-open.js:
210  (**
211   * @license lucide-react v0.468.0 - ISC
212   *
213   * This source code is licensed under the ISC license.
214   * See the LICENSE file in the root directory of this source tree.
215   *)
216
217lucide-react/dist/esm/icons/lock.js:
218  (**
219   * @license lucide-react v0.468.0 - ISC
220   *
221   * This source code is licensed under the ISC license.
222   * See the LICENSE file in the root directory of this source tree.
223   *)
224
225lucide-react/dist/esm/icons/monitor.js:
226  (**
227   * @license lucide-react v0.468.0 - ISC
228   *
229   * This source code is licensed under the ISC license.
230   * See the LICENSE file in the root directory of this source tree.
231   *)
232
233lucide-react/dist/esm/icons/panel-left.js:
234  (**
235   * @license lucide-react v0.468.0 - ISC
236   *
237   * This source code is licensed under the ISC license.
238   * See the LICENSE file in the root directory of this source tree.
239   *)
240
241lucide-react/dist/esm/icons/panel-right.js:
242  (**
243   * @license lucide-react v0.468.0 - ISC
244   *
245   * This source code is licensed under the ISC license.
246   * See the LICENSE file in the root directory of this source tree.
247   *)
248
249lucide-react/dist/esm/icons/plus.js:
250  (**
251   * @license lucide-react v0.468.0 - ISC
252   *
253   * This source code is licensed under the ISC license.
254   * See the LICENSE file in the root directory of this source tree.
255   *)
256
257lucide-react/dist/esm/icons/redo-2.js:
258  (**
259   * @license lucide-react v0.468.0 - ISC
260   *
261   * This source code is licensed under the ISC license.
262   * See the LICENSE file in the root directory of this source tree.
263   *)
264
265lucide-react/dist/esm/icons/search.js:
266  (**
267   * @license lucide-react v0.468.0 - ISC
268   *
269   * This source code is licensed under the ISC license.
270   * See the LICENSE file in the root directory of this source tree.
271   *)
272
273lucide-react/dist/esm/icons/sliders-horizontal.js:
274  (**
275   * @license lucide-react v0.468.0 - ISC
276   *
277   * This source code is licensed under the ISC license.
278   * See the LICENSE file in the root directory of this source tree.
279   *)
280
281lucide-react/dist/esm/icons/smartphone.js:
282  (**
283   * @license lucide-react v0.468.0 - ISC
284   *
285   * This source code is licensed under the ISC license.
286   * See the LICENSE file in the root directory of this source tree.
287   *)
288
289lucide-react/dist/esm/icons/tablet.js:
290  (**
291   * @license lucide-react v0.468.0 - ISC
292   *
293   * This source code is licensed under the ISC license.
294   * See the LICENSE file in the root directory of this source tree.
295   *)
296
297lucide-react/dist/esm/icons/trash.js:
298  (**
299   * @license lucide-react v0.468.0 - ISC
300   *
301   * This source code is licensed under the ISC license.
302   * See the LICENSE file in the root directory of this source tree.
303   *)
304
305lucide-react/dist/esm/icons/type.js:
306  (**
307   * @license lucide-react v0.468.0 - ISC
308   *
309   * This source code is licensed under the ISC license.
310   * See the LICENSE file in the root directory of this source tree.
311   *)
312
313lucide-react/dist/esm/icons/undo-2.js:
314  (**
315   * @license lucide-react v0.468.0 - ISC
316   *
317   * This source code is licensed under the ISC license.
318   * See the LICENSE file in the root directory of this source tree.
319   *)
320
321lucide-react/dist/esm/icons/zoom-in.js:
322  (**
323   * @license lucide-react v0.468.0 - ISC
324   *
325   * This source code is licensed under the ISC license.
326   * See the LICENSE file in the root directory of this source tree.
327   *)
328
329lucide-react/dist/esm/icons/zoom-out.js:
330  (**
331   * @license lucide-react v0.468.0 - ISC
332   *
333   * This source code is licensed under the ISC license.
334   * See the LICENSE file in the root directory of this source tree.
335   *)
336
337lucide-react/dist/esm/lucide-react.js:
338  (**
339   * @license lucide-react v0.468.0 - ISC
340   *
341   * This source code is licensed under the ISC license.
342   * See the LICENSE file in the root directory of this source tree.
343   *)
344*/M();const er={padding:16,background:"#f1f5f9",color:"#475569",borderRadius:8,fontFamily:"ui-monospace, monospace",fontSize:12,textAlign:"center"},xn={type:"radio",options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"}]};function T_(e){return{components:{Heading:{label:"Heading",fields:{text:{type:"text"},level:{type:"select",options:[{label:"H1",value:"1"},{label:"H2",value:"2"},{label:"H3",value:"3"}]},align:xn},defaultProps:{text:"Heading",level:"1",align:"left"},render:({text:t,level:n,align:r})=>{const s=dp(n),{fontSize:i,fontWeight:o}=op[s],a={textAlign:Jt(r),margin:"0.4em 0",fontSize:i,fontWeight:o,lineHeight:1.2},l=vn(t,200);return s==="3"?f.jsx("h3",{style:a,children:l}):s==="2"?f.jsx("h2",{style:a,children:l}):f.jsx("h1",{style:a,children:l})}},Text:{label:"Text",fields:{text:{type:"textarea"},size:{type:"select",options:[{label:"Small",value:"sm"},{label:"Normal",value:"md"},{label:"Large",value:"lg"}]}
344,align:xn,bold:{type:"radio",options:[{label:"Normal",value:!1},{label:"Bold",value:!0}]}},defaultProps:{text:"Add your text…",size:"md",align:"left",bold:!1},render:({text:t,size:n,align:r,bold:s})=>f.jsx("p",{style:{whiteSpace:"pre-wrap",textAlign:Jt(r),fontSize:ip(n),fontWeight:s===!0?700:void 0,lineHeight:1.55,margin:"0.5em 0"},children:vn(t,5e3)})},Image:{label:"Image",fields:{url:{type:"text",label:"Image URL (https)"},alt:{type:"text",label:"Alt text"},maxWidth:{type:"number",label:"Max width (px)",min:40,max:1600},radius:{type:"number",label:"Corner radius",min:0,max:48},align:xn},defaultProps:{url:"",alt:"",maxWidth:800,radius:0,align:"center"},render:({url:t,alt:n,maxWidth:r,radius:s,align:i})=>Ba(t)?f.jsx("div",{style:{textAlign:Jt(i)},children:f.jsx("img",{src:t,alt:vn(n,200),style:{maxWidth:It(r,40,1600,800),width:"100%",borderRadius:It(s,0,48,0)}})}):f.jsx("div",{style:{padding:24,background:"#f1f5f9",color:"#64748b",textAlign:"center",borderRadius:8,fontSize:13},children:"Add an https image URL"})},Button:{label:"Button",fields:{label:{type:"text"},href:{type:"text",label:"Link (https or /path)"},variant:{type:"radio",options:[{label:"Solid",value:"primary"},{label:"Outline",value:"outline"},{label:"Link",value:"link"}]},color:{type:"text",label:"Colour (#rrggbb, optional)"},fullWidth:{type:"radio",options:[{label:"Auto width",value:!1},{label:"Full width",value:!0}]},align:xn,newTab:{type:"radio",options:[{label:"Same tab",value:!1},{label:"New tab",value:!0}]}},defaultProps:{label:"Get started",href:"",variant:"primary",color:"",fullWidth:!1,align:"center",newTab:!1},render:({label:t,href:n,variant:r,color:s,fullWidth:i,align:o,newTab:a})=>{const l=sp(n)?n:void 0,d=cp(r),c=di(s)??"#0ea5e9",u=l&&a===!0?{target:"_blank",rel:"noopener noreferrer"}:{};if(d==="link")return f.jsx("div",{style:{textAlign:Jt(o),margin:"0.5em 0"},children:f.jsx("a",{href:l,style:{color:c,textDecoration:"underline",cursor:"pointer"},...u,children:vn(t,80)||"Button"})});const p=d==="primary",g=i===!0,v={display:g?"block":"inline-block",padding:"12px 28px",borderRadius:999,fontWeight:600,textDecoration:"none",cursor:"pointer",background:p?c:"transparent",color:p?"#fff":c,border:`2px solid ${c}`,textAlign:g?"center":void 0};return f.jsx("div",{style:{textAlign:Jt(o),margin:"0.5em 0"},children:f.jsx("a",{href:l,style:v,...u,children:vn(t,80)||"Button"})})}},Section:{label:"Section",fields:{background:{type:"select",options:[{label:"None",value:"none"},{label:"Card",value:"card"},{label:"Accent",value:"accent"},{label:"Image",value:"image"}]},backgroundImageUrl:{type:"text",label:"Background image URL (https)"},paddingY:{type:"number",label:"Vertical padding",min:0,max:160}},defaultProps:{background:"none",backgroundImageUrl:"",paddingY:32},render:({background:t,backgroundImageUrl:n,paddingY:r})=>{const s=t==="image"&&Ba(n);return f.jsx("section",{style:{padding:`${It(r,0,160,32)}px 16px`,backgroundColor:rp(t)||"transparent",...s?{backgroundImage:`url("${np(String(n))}")`,backgroundSize:"cover",backgroundPosition:"center"}:{},borderRadius:tp(t)},children:f.jsx(bo,{zone:"content"})})}},Columns:{label:"Columns",fields:{count:{type:"radio",options:[{label:"2",value:2},{label:"3",value:3}]},gap:{type:"number",label:"Gap (px)",min:0,max:64}},defaultProps:{count:2,gap:24},render:({count:t,gap:n})=>{const r=t===3?3:2;return f.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r}, 1fr)`,gap:It(n,0,64,24)},children:Array.from({length:r},(s,i)=>f.jsx("div",{children:f.jsx(bo,{zone:`col-${i}`})},i))})}},Spacer:{label:"Spacer",fields:{height:{type:"number",label:"Height (px)",min:4,max:200}},defaultProps:{height:32},render:({height:t})=>f.jsx("div",{style:{height:It(t,4,200,32)}})},Code:{label:"Custom code",fields:{html:{type:"textarea",label:"HTML (runs on the live page only)"}},defaultProps:{html:""},render:({html:t})=>{const n=typeof t=="string"?new TextEncoder().encode(t).length:0;return f.jsx("div",{style:{padding:16,background:"#f1f5f9",color:"#475569",borderRadius:8,fontFamily:"ui-monospace, monospace",fontSize:12,textAlign:"center"},children:`Custom code — ${n} bytes — renders on the live page`})}},Divider:{label:"Divider",fields:{color:{type:"text",label:"Colour (#rrggbb)"},thickness:{type:"number",label:"Thickness (px)",min:1,max:8},width:{type:"number",label:"Width (%)",min:10,max:100},spacing:{type:"number",label:"Space above/below (px)",min:0,max:64},align:xn},defaultProps:{color:"#e5e7eb",thickness:1,width:100,spacing:16,align:"center"},render:({color:t,thickness:n,width:r,spacing:s,align:i})=>{const o=Jt(i),a=It(s,0,64,16);return f.jsx("hr",{style:{border:0,borderTop:`${It(n,1,8,1)}px solid ${di(t)??"#e5e7eb"}`,width:`${It(r,10,100,100)}%`,marginTop:a,marginBottom:a,marginLeft:o==="left"?0:"auto",marginRight:o==="right"?0:"auto"}})}},BulletList:{label:"Bullet list",fields:{items:{type:"custom",label:"Items — one per line (1–20)",render:({value:t,onChange:n})=>f.jsx("textarea",{value:(Array.isArray(t)?t:[]).join(`
345`),onChange:r=>n(r.currentTarget.value.split(`
346`)),rows:6,style:{width:"100%",fontFamily:"inherit",fontSize:13,padding:8}})},style:{type:"select",label:"Marker",options:[{label:"Disc",value:"disc"},{label:"Circle",value:"circle"},{label:"Square",value:"square"},{label:"Numbered",value:"number"},{label:"None",value:"none"}]}},defaultProps:{items:["First item"],style:"disc"},render:({items:t,style:n})=>{const r=ep(t),s=lp(n),i=s==="number",o=i?"ol":"ul";return r.length?f.jsx(o,{style:{listStyleType:i?"decimal":s,margin:"0.5em 0",paddingLeft:s==="none"?0:24},children:r.map((a,l)=>f.jsx("li",{children:a},l))}):f.jsx("div",{style:{padding:24,background:"#f1f5f9",color:"#64748b",textAlign:"center",borderRadius:8,fontSize:13},children:"Add at least one list item"})}}
346,RichText:{label:"Rich text",fields:{html:{type:"textarea",label:"HTML (a limited tag set is kept)"}},defaultProps:{html:"<p>Some <strong>rich</strong> text.</p>"},render:({html:t})=>{const n=typeof t=="string"?new TextEncoder().encode(t).length:0;return f.jsx("div",{style:er,children:`Rich text — ${n} bytes — formatted on the live page`})}},Video:{label:"Video",fields:{provider:{type:"radio",options:[{label:"YouTube",value:"youtube"},{label:"Vimeo",value:"vimeo"}]},videoId:{type:"text",label:"Video ID"},aspect:{type:"radio",options:[{label:"16:9",value:"16:9"},{label:"4:3",value:"4:3"},{label:"1:1",value:"1:1"}]},title:{type:"text",label:"Title (for screen readers)"}},defaultProps:{provider:"youtube",videoId:"",aspect:"16:9",title:""},render:({provider:t,videoId:n})=>f.jsx("div",{style:er,children:Fa(t,n)?`Video — ${t==="vimeo"?"Vimeo":"YouTube"} — plays on the live page`:"Add a valid video ID"})},SocialIcons:{label:"Social icons",fields:{links:{type:"array",label:"Links (1–6)",arrayFields:{platform:{type:"select",options:[{label:"Facebook",value:"facebook"},{label:"X",value:"x"},{label:"Instagram",value:"instagram"},{label:"LinkedIn",value:"linkedin"},{label:"YouTube",value:"youtube"},{label:"TikTok",value:"tiktok"}]},url:{type:"text",label:"Profile URL (https)"}},getItemSummary:t=>(t==null?void 0:t.platform)&&Yf[t.platform]||"Link"},size:{type:"number",label:"Icon size (px)",min:16,max:48},color:{type:"text",label:"Colour (#rrggbb)"},align:xn},defaultProps:{links:[{platform:"facebook",url:""}],size:28,color:"#0f172a",align:"center"},render:({links:t,size:n,color:r,align:s})=>{const i=Jf(t),o=Jt(s),a=It(n,16,48,28);return i.length?f.jsx("div",{style:{display:"flex",gap:12,margin:"0.5em 0",justifyContent:o==="center"?"center":o==="right"?"flex-end":"flex-start"},children:i.map((l,d)=>f.jsx("svg",{viewBox:"0 0 24 24",width:a,height:a,fill:di(r)??"#0f172a","aria-hidden":"true",children:f.jsx("path",{d:Qf[l.platform]})},d))}):f.jsx("div",{style:er,children:"Add at least one https profile URL"})}},Countdown:{label:"Countdown",fields:{targetIso:{type:"text",label:"Target date/time (ISO 8601)"},expiredText:{type:"text",label:"Text once expired"}},defaultProps:{targetIso:"",expiredText:"This offer has ended"},render:({targetIso:t,expiredText:n})=>{const r=Kf(t);if(r===null)return f.jsx("div",{style:er,children:"Add a target date (ISO 8601)"});const s=ap(r,Date.now());if(s.expired)return f.jsx("div",{style:{textAlign:"center"},children:vn(n,120)||"This offer has ended"});const i=[["days",s.days,"Days"],["hours",s.hours,"Hours"],["minutes",s.minutes,"Min"],["seconds",s.seconds,"Sec"]];return f.jsx("div",{style:{display:"flex",gap:12,justifyContent:"center",textAlign:"center"},children:i.map(([o,a,l])=>f.jsxs("div",{children:[f.jsx("div",{style:{fontSize:28,fontWeight:700,lineHeight:1.1},children:String(a).padStart(2,"0")}),f.jsx("div",{style:{fontSize:12,opacity:.7},children:Gf(void 0,l)})]},o))})}},ImageSlider:{label:"Image slider",fields:{images:{type:"array",label:"Images (1–10)",arrayFields:{url:{type:"text",label:"Image URL (https)"},alt:{type:"text",label:"Alt text"}},getItemSummary:t=>(t==null?void 0:t.alt)||(t==null?void 0:t.url)||"Image"},aspect:{type:"radio",options:[{label:"16:9",value:"16:9"},{label:"4:3",value:"4:3"},{label:"1:1",value:"1:1"}]},gap:{type:"number",label:"Gap (px)",min:0,max:48}},defaultProps:{images:[{url:"",alt:""}],aspect:"16:9",gap:12},render:({images:t,aspect:n,gap:r})=>{const s=qf(t);return s.length?f.jsx("div",{style:{display:"flex",gap:It(r,0,48,12),overflowX:"auto",scrollSnapType:"x mandatory"},children:s.map((i,o)=>f.jsx("div",{style:{position:"relative",flex:"0 0 100%",scrollSnapAlign:"center",paddingBottom:Xf(n)},children:f.jsx("img",{src:i.url,alt:i.alt,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})},o))}):f.jsx("div",{style:er,children:"Add at least one https image URL"})}},VideoEmbed:{label:"Video",fields:{provider:{type:"radio",options:[{label:"YouTube",value:"youtube"},{label:"Vimeo",value:"vimeo"}]},videoId:{type:"text",label:"Video ID"}},defaultProps:{provider:"youtube",videoId:""},render:({provider:t,videoId:n})=>{const r=Fa(t,n);return r?f.jsx("div",{style:{position:"relative",paddingBottom:"56.25%",height:0},children:f.jsx("iframe",{src:r,title:"Video",style:{position:"absolute",inset:0,width:"100%",height:"100%",border:0,borderRadius:8},allow:"encrypted-media; picture-in-picture",allowFullScreen:!0})}):f.jsx("div",{style:{padding:24,background:"#f1f5f9",color:"#64748b",textAlign:"center",borderRadius:8,fontSize:13},children:"Enter a YouTube or Vimeo video ID"})}},FormEmbed:{label:"Form",fields:{formId:{type:"select",label:"Form",options:[{label:"— pick a form —",value:""},...e.map(t=>({label:t.name,value:t.id}))]}},defaultProps:{formId:""},render:({formId:t})=>{const n=e.find(r=>r.id===t);return f.jsx("div",{style:{padding:24,border:"2px dashed #94a3b8",borderRadius:12,textAlign:"center",color:"#475569",fontSize:14},children:n?`Form: ${n.name}`:"Pick a form to embed"})}}}}}const L_={content:[],root:{props:{}},zones:{}},$_=[{width:390,height:"auto",icon:"Smartphone",label:"Phone"},{width:768,height:"auto",icon:"Tablet",label:"Tablet"},{width:1280,height:"auto",icon:"Monitor",label:"Desktop"}],R_={enabled:!0,waitForStyles:!0},N_={leftSideBarVisible:!0,rightSideBarVisible:!0},tr=()=>{},Nf=S.createContext({statusText:"",busy:!0,hasData:!1,canRestore:!1,revisions:[],onSaveDraft:tr,onPublish:tr,onRestore:tr,onRestoreRevision:tr,onClose:tr}),zf=e=>{const t=new Date(e.createdAt),n=Number.isNaN(t.getTime())?e.createdAt:t.toLocaleStr
346ing(),r=`${e.blocks} block${e.blocks===1?"":"s"}`;return e.label?`${n} — ${e.label} (${r})`:`${n} — ${r} — ${e.createdBy}`};function z_(){const e=S.useContext(Nf);return f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{fontSize:12,color:"#64748b"},"data-testid":"editor-status",children:e.statusText}),f.jsx("button",{type:"button",className:"crm-btn","data-testid":"editor-save-draft",disabled:e.busy||!e.hasData,onClick:e.onSaveDraft,children:"Save draft"}),f.jsx("button",{type:"button",className:"crm-btn is-primary","data-testid":"editor-publish",disabled:e.busy||!e.hasData,onClick:e.onPublish,children:"Save & publish"}),f.jsx("button",{type:"button",className:"crm-btn","data-testid":"editor-restore-published",disabled:e.busy||!e.canRestore,title:e.canRestore?"Replace the draft with the currently published version":"This page has never been published",onClick:e.onRestore,children:"Restore published version"}),f.jsxs("select",{className:"crm-btn","data-testid":"editor-revisions","aria-label":"Restore an earlier draft",disabled:e.busy||e.revisions.length===0,value:"",onChange:t=>{const n=t.target.value;n&&e.onRestoreRevision(n)},children:[f.jsx("option",{value:"",children:e.revisions.length===0?"No earlier drafts":`Earlier drafts (${e.revisions.length})…`}),e.revisions.map(t=>f.jsx("option",{value:t.id,"data-testid":`editor-revision-${t.id}`,children:zf(t)},t.id))]}),f.jsx("button",{type:"button",className:"crm-btn","data-testid":"editor-close",onClick:e.onClose,children:"Close"})]})}const F_={headerActions:()=>f.jsx(z_,{})};function tx(e){const[t,n]=S.useState(null),[r,s]=S.useState(!1),[i,o]=S.useState(!1),[a,l]=S.useState(""),[d,c]=S.useState(!1),[u,p]=S.useState(!1),[g,v]=S.useState(null),[C,b]=S.useState(0),[k,_]=S.useState([]),x=S.useMemo(()=>T_(e.forms),[e.forms]);S.useEffect(()=>{let T=!0;return Hf(e.pageId).then(R=>{if(T){if(!R){s(!0);return}n(R.definitionDraft??L_),v(R.definitionPublished??null)}}),()=>{T=!1}},[e.pageId]);const y=S.useCallback(async()=>{const T=await Uf(e.pageId);T&&_(T)},[e.pageId]);S.useEffect(()=>{y()},[y]);const j=async T=>{o(!0),l("");const R=await ci(e.pageId,{definitionDraft:T});return o(!1),R.ok?(c(!1),l("Draft saved"),y(),e.onSaved()):l(`Save failed: ${R.reason??"unknown"}`),R.ok},I=async()=>{if(!t)return;if(p(!0),l(""),!await j(t)){p(!1);return}const R=await Zf(e.funnelId);p(!1),R.ok?(l("Published"),e.onPublished()):l(R.reason==="nothing_to_publish"?"Nothing to publish — add content to a page first.":`Publish failed: ${R.reason??"unknown"}`)},D=async()=>{if(!g||!window.confirm("Replace the current draft with the published version? Unsaved changes and the saved draft will both be lost."))return;const T=g;o(!0),l("");const R=await ci(e.pageId,{definitionDraft:T});o(!1),R.ok?(n(T),b(N=>N+1),c(!1),l("Draft restored from published version"),e.onSaved()):l(`Restore failed: ${R.reason??"unknown"}`)},m=async T=>{const R=k.find(z=>z.id===T);if(!R||!window.confirm(`Replace the current draft with the version from ${zf(R)}? Unsaved changes and the saved draft will both be lost.`))return;o(!0),l("");const N=await Vf(T);if(!N){o(!1),l("Restore failed: could not load that version");return}const U=await ci(e.pageId,{definitionDraft:N.definition});o(!1),U.ok?(n(N.definition),b(z=>z+1),c(!1),l("Draft restored from an earlier version"),y(),e.onSaved()):l(`Restore failed: ${U.reason??"unknown"}`)},E=()=>{d&&!window.confirm("Discard unsaved changes?")||e.onClose()},A={statusText:u?"Publishing…":i?"Saving…":a||(d?"Unsaved changes":e.isPublished?"This draft is live":"Draft — not published yet"),busy:i||u,hasData:t!==null,canRestore:g!==null,revisions:k,onSaveDraft:()=>{t&&j(t)},onPublish:()=>void I(),onRestore:()=>void D(),onRestoreRevision:T=>void m(T),onClose:E};return f.jsx(Nf.Provider,{value:A,children:f.jsxs("div",{"data-testid":"funnel-page-editor",style:{position:"fixed",inset:0,zIndex:60,background:"#fff",color:"#0f172a"},children:[r&&f.jsx("div",{className:"crm-muted",style:{padding:24},children:"Could not load this page."}),!r&&!t&&f.jsx("div",{className:"crm-muted",style:{padding:24},children:"Loading editor…"}),t&&f.jsx(Xr,{config:x,data:t,headerTitle:`Editing: ${e.pageName}`,viewports:$_,iframe:R_,ui:N_,onChange:T=>{n(T),c(!0)},overrides:F_},`${e.pageId}:${C}`)]})})}export{tx as default,zf as revisionLabel};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.