@brightsideoy/kama 0.1.0-alpha.183 → 0.1.0-alpha.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
2
2
  `)}function x(e){if(P(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=I(r)?S(r):x(r);if(i)for(let e in i)t[e]=i[e]}return t}if(I(e)||_e(e))return e}function S(e){let t={};return e.replace(Ze,``).split(Ye).forEach(e=>{if(e){let n=e.split(Xe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function C(e){if(!e)return``;if(I(e))return e;let t=``;for(let n in e){let r=e[n];if(I(r)||typeof r==`number`){let e=n.startsWith(`--`)?n:Ae(n);t+=`${e}:${r};`}}return t}function w(e){let t=``;if(I(e))t=e;else if(P(e))for(let n=0;n<e.length;n++){let r=w(e[n]);r&&(t+=r+` `)}else if(_e(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function T(e){if(!e)return null;let{class:t,style:n}=e;return t&&!I(t)&&(e.class=w(t)),n&&(e.style=x(n)),e}function E(e){return!!e||e===``}function D(e){if(ut.hasOwnProperty(e))return ut[e];let t=lt.test(e);return t&&console.error(`unsafe attribute name: ${e}`),ut[e]=!t}function O(e){if(e==null)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`}function k(e){let t=``+e,n=ht.exec(t);if(!n)return t;let r=``,i,a,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 39:i=`&#39;`;break;case 60:i=`&lt;`;break;case 62:i=`&gt;`;break;default:continue}o!==a&&(r+=t.slice(o,a)),o=a+1,r+=i}return o===a?r:r+t.slice(o,a)}function ee(e){let t;do t=e,e=e.replace(gt,``);while(e!==t);return e}function A(e,t){return e.replace(_t,e=>t?e===`"`?`\\\\\\"`:`\\\\${e}`:`\\${e}`)}function te(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ne(e[r],t[r]);return n}function ne(e,t){if(e===t)return!0;let n=me(e),r=me(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ge(e),r=ge(t),n||r)return e===t;if(n=P(e),r=P(t),n||r)return n&&r?te(e,t):!1;if(n=_e(e),r=_e(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!ne(e[n],t[n]))return!1}}return String(e)===String(t)}function re(e,t){return e.findIndex(e=>ne(e,t))}function ie(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,ae,oe,se,ce,le,M,ue,de,N,P,fe,pe,me,he,F,I,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,L,yt,bt,xt=o((()=>{j={},ae=[],oe=()=>{},se=()=>!1,ce=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),le=e=>e.startsWith(`onUpdate:`),M=Object.assign,ue=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},de=Object.prototype.hasOwnProperty,N=(e,t)=>de.call(e,t),P=Array.isArray,fe=e=>be(e)===`[object Map]`,pe=e=>be(e)===`[object Set]`,me=e=>be(e)===`[object Date]`,he=e=>be(e)===`[object RegExp]`,F=e=>typeof e==`function`,I=e=>typeof e==`string`,ge=e=>typeof e==`symbol`,_e=e=>typeof e==`object`&&!!e,ve=e=>(_e(e)||F(e))&&F(e.then)&&F(e.catch),ye=Object.prototype.toString,be=e=>ye.call(e),xe=e=>be(e).slice(8,-1),Se=e=>be(e)===`[object Object]`,Ce=e=>I(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,we=_(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Te=_(`bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo`),Ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},De=/-\w/g,Oe=Ee(e=>e.replace(De,e=>e.slice(1).toUpperCase())),ke=/\B([A-Z])/g,Ae=Ee(e=>e.replace(ke,`-$1`).toLowerCase()),je=Ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),Me=Ee(e=>e?`on${je(e)}`:``),Ne=(e,t)=>!Object.is(e,t),Pe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Fe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ie=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Le=e=>{let t=I(e)?Number(e):NaN;return isNaN(t)?e:t},ze=()=>Re||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},Be=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/,Ve={TEXT:1,1:`TEXT`,CLASS:2,2:`CLASS`,STYLE:4,4:`STYLE`,PROPS:8,8:`PROPS`,FULL_PROPS:16,16:`FULL_PROPS`,NEED_HYDRATION:32,32:`NEED_HYDRATION`,STABLE_FRAGMENT:64,64:`STABLE_FRAGMENT`,KEYED_FRAGMENT:128,128:`KEYED_FRAGMENT`,UNKEYED_FRAGMENT:256,256:`UNKEYED_FRAGMENT`,NEED_PATCH:512,512:`NEED_PATCH`,DYNAMIC_SLOTS:1024,1024:`DYNAMIC_SLOTS`,DEV_ROOT_FRAGMENT:2048,2048:`DEV_ROOT_FRAGMENT`,CACHED:-1,"-1":`CACHED`,BAIL:-2,"-2":`BAIL`},He={1:`TEXT`,2:`CLASS`,4:`STYLE`,8:`PROPS`,16:`FULL_PROPS`,32:`NEED_HYDRATION`,64:`STABLE_FRAGMENT`,128:`KEYED_FRAGMENT`,256:`UNKEYED_FRAGMENT`,512:`NEED_PATCH`,1024:`DYNAMIC_SLOTS`,2048:`DEV_ROOT_FRAGMENT`,[-1]:`CACHED`,[-2]:`BAIL`},Ue={ELEMENT:1,1:`ELEMENT`,FUNCTIONAL_COMPONENT:2,2:`FUNCTIONAL_COMPONENT`,STATEFUL_COMPONENT:4,4:`STATEFUL_COMPONENT`,TEXT_CHILDREN:8,8:`TEXT_CHILDREN`,ARRAY_CHILDREN:16,16:`ARRAY_CHILDREN`,SLOTS_CHILDREN:32,32:`SLOTS_CHILDREN`,TELEPORT:64,64:`TELEPORT`,SUSPENSE:128,128:`SUSPENSE`,COMPONENT_SHOULD_KEEP_ALIVE:256,256:`COMPONENT_SHOULD_KEEP_ALIVE`,COMPONENT_KEPT_ALIVE:512,512:`COMPONENT_KEPT_ALIVE`,COMPONENT:6,6:`COMPONENT`},We={STABLE:1,1:`STABLE`,DYNAMIC:2,2:`DYNAMIC`,FORWARDED:3,3:`FORWARDED`},Ge={1:`STABLE`,2:`DYNAMIC`,3:`FORWARDED`},Ke=_(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`),qe=Ke,Je=2,Ye=/;(?![^(]*\))/g,Xe=/:([^]+)/,Ze=/\/\*[^]*?\*\//g,Qe=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,$e=`svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view`,et=`annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics`,tt=`area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr`,nt=_(Qe),rt=_($e),it=_(et),at=_(tt),ot=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,st=_(ot),ct=_(ot+`,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`),lt=/[>/="'\u0009\u000a\u000c\u0020]/,ut={},dt={acceptCharset:`accept-charset`,className:`class`,htmlFor:`for`,httpEquiv:`http-equiv`},ft=_(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`),pt=_(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`),mt=_(`accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`),ht=/["'&<>]/,gt=/^(?:-?>)+|<!--|-->|--!>|<!-$/g,_t=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,vt=e=>!!(e&&e.__v_isRef===!0),L=e=>I(e)?e:e==null?``:P(e)||_e(e)&&(e.toString===ye||!F(e.toString))?vt(e)?L(e.value):JSON.stringify(e,yt,2):String(e),yt=(e,t)=>vt(t)?yt(e,t.value):fe(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[bt(t,r)+` =>`]=n,e),{})}:pe(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>bt(e))}:ge(t)?bt(t):_e(t)&&!P(t)&&!Se(t)?String(t):t,bt=(e,t=``)=>ge(e)?`Symbol(${e.description??t})`:e}));function St(e){return new jn(e)}function Ct(){return An}function wt(e,t=!1){An&&An.cleanups.push(e)}function Tt(e,t=!1){if(e.flags|=8,t){e.next=Ln,Ln=e;return}e.next=In,In=e}function Et(){Fn++}function Dt(){if(--Fn>0)return;if(Ln){let e=Ln;for(Ln=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;In;){let t=In;for(In=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ot(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function kt(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Mt(r),Nt(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function At(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(jt(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function jt(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Bn)||(e.globalVersion=Bn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!At(e))))return;e.flags|=2;let t=e.dep,n=Mn,r=Rn;Mn=e,Rn=!0;try{Ot(e);let n=e.fn(e._value);(t.version===0||Ne(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Mn=n,Rn=r,kt(e),e.flags&=-3}}function Mt(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Mt(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Nt(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Pt(e,t){e.effect instanceof Pn&&(e=e.effect.fn);let n=new Pn(e);t&&M(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function Ft(e){e.effect.stop()}function It(){zn.push(Rn),Rn=!1}function Lt(){let e=zn.pop();Rn=e===void 0||e}function Rt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Mn;Mn=void 0;try{t()}finally{Mn=e}}}function zt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)zt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function Bt(e,t,n){if(Rn&&Mn){let t=Un.get(e);t||Un.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Hn),r.map=t,r.key=n),r.track()}}function Vt(e,t,n,r,i,a){let o=Un.get(e);if(!o){Bn++;return}let s=e=>{e&&e.trigger()};if(Et(),t===`clear`)o.forEach(s);else{let i=P(e),a=i&&Ce(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Kn||!ge(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Kn)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Wn)),fe(e)&&s(o.get(Gn)));break;case`delete`:i||(s(o.get(Wn)),fe(e)&&s(o.get(Gn)));break;case`set`:fe(e)&&s(o.get(Wn))}}Dt()}function Ht(e,t){let n=Un.get(e);return n&&n.get(t)}function Ut(e){let t=pn(e);return t===e?t:(Bt(t,`iterate`,Kn),dn(e)?t:t.map(mr))}function Wt(e){return Bt(e=pn(e),`iterate`,Kn),e}function Gt(e,t){return un(e)?hr(ln(e)?mr(t):t):mr(t)}function Kt(e,t,n){let r=Wt(e),i=r[t]();return r!==e&&!dn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}function qt(e,t,n,r,i,a){let o=Wt(e),s=o!==e&&!dn(e),c=o[t];if(c!==Jn[t]){let t=c.apply(e,a);return s?mr(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Gt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Jt(e,t,n,r){let i=Wt(e),a=i!==e&&!dn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Gt(e,t)),n.call(this,t,Gt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Gt(e,c):c}function Yt(e,t,n){let r=pn(e);Bt(r,`iterate`,Kn);let i=r[t](...n);return(i===-1||i===!1)&&fn(n[0])?(n[0]=pn(n[0]),r[t](...n)):i}function Xt(e,t,n=[]){It(),Et();let r=pn(e)[t].apply(e,n);return Dt(),Lt(),r}function Zt(e){ge(e)||(e=String(e));let t=pn(this);return Bt(t,`has`,e),t.hasOwnProperty(e)}function Qt(e,t,n){return function(...r){let i=this.__v_raw,a=pn(i),o=fe(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?ir:t?hr:mr;return!t&&Bt(a,`iterate`,c?Gn:Wn),M(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function $t(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function en(e,t){let n={get(n){let r=this.__v_raw,i=pn(r),a=pn(n);e||(Ne(n,a)&&Bt(i,`get`,n),Bt(i,`get`,a));let{has:o}=ar(i),s=t?ir:e?hr:mr;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Bt(pn(t),`iterate`,Wn),t.size},has(t){let n=this.__v_raw,r=pn(n),i=pn(t);return e||(Ne(t,i)&&Bt(r,`has`,t),Bt(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=pn(a),s=t?ir:e?hr:mr;return!e&&Bt(o,`iterate`,Wn),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return M(n,e?{add:$t(`add`),set:$t(`set`),delete:$t(`delete`),clear:$t(`clear`)}:{add(e){let n=pn(this),r=ar(n),i=pn(e),a=!t&&!dn(e)&&!un(e)?i:e;return r.has.call(n,a)||Ne(e,a)&&r.has.call(n,e)||Ne(i,a)&&r.has.call(n,i)||(n.add(a),Vt(n,`add`,a,a)),this},set(e,n){!t&&!dn(n)&&!un(n)&&(n=pn(n));let r=pn(this),{has:i,get:a}=ar(r),o=i.call(r,e);o||=(e=pn(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Ne(n,s)&&Vt(r,`set`,e,n,s):Vt(r,`add`,e,n),this},delete(e){let t=pn(this),{has:n,get:r}=ar(t),i=n.call(t,e);i||=(e=pn(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Vt(t,`delete`,e,void 0,a),o},clear(){let e=pn(this),t=e.size!==0,n=e.clear();return t&&Vt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Qt(r,e,t)}),n}function tn(e,t){let n=en(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(N(n,r)&&r in t?n:t,r,i)}function nn(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function rn(e){return un(e)?e:cn(e,!1,er,or,ur)}function an(e){return cn(e,!1,nr,sr,dr)}function on(e){return cn(e,!0,tr,cr,fr)}function sn(e){return cn(e,!0,rr,lr,pr)}function cn(e,t,n,r,i){if(!_e(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=nn(xe(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function fn(e){return e?!!e.__v_raw:!1}function pn(e){let t=e&&e.__v_raw;return t?pn(t):e}function mn(e){return!N(e,`__v_skip`)&&Object.isExtensible(e)&&Fe(e,`__v_skip`,!0),e}function hn(e){return e?e.__v_isRef===!0:!1}function R(e){return _n(e,!1)}function gn(e){return _n(e,!0)}function _n(e,t){return hn(e)?e:new gr(e,t)}function vn(e){e.dep&&e.dep.trigger()}function z(e){return hn(e)?e.value:e}function yn(e){return F(e)?e():z(e)}function bn(e){return ln(e)?e:new Proxy(e,_r)}function xn(e){return new vr(e)}function Sn(e){let t=P(e)?Array(e.length):{};for(let n in e)t[n]=wn(e,n);return t}function Cn(e,t,n){return hn(e)?e:F(e)?new br(e):_e(e)&&arguments.length>1?wn(e,t,n):R(e)}function wn(e,t,n){return new yr(e,t,n)}function Tn(e,t,n=!1){let r,i;return F(e)?r=e:(r=e.get,i=e.set),new xr(r,i,n)}function En(){return Er}function Dn(e,t=!1,n=Er){if(n){let t=Tr.get(n);t||Tr.set(n,t=[]),t.push(e)}}function On(e,t,n=j){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:dn(e)||i===!1||i===0?kn(e,1):kn(e),u,d,f,p,m=!1,h=!1;if(hn(e)?(d=()=>e.value,m=dn(e)):ln(e)?(d=()=>l(e),m=!0):P(e)?(h=!0,m=e.some(e=>ln(e)||dn(e)),d=()=>e.map(e=>{if(hn(e))return e.value;if(ln(e))return l(e);if(F(e))return c?c(e,2):e()})):d=F(e)?t?c?()=>c(e,2):e:()=>{if(f){It();try{f()}finally{Lt()}}let t=Er;Er=u;try{return c?c(e,3,[p]):e(p)}finally{Er=t}}:oe,t&&i){let e=d,t=i===!0?1/0:i;d=()=>kn(e(),t)}let g=Ct(),_=()=>{u.stop(),g&&g.active&&ue(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return _(),n}}let v=h?Array(e.length).fill(wr):wr,y=e=>{if(!(!(u.flags&1)||!u.dirty&&!e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Ne(e,v[t])):Ne(n,v))){f&&f();let e=Er;Er=u;try{let e=[n,v===wr?void 0:h&&v[0]===wr?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{Er=e}}}else u.run()}};return s&&s(y),u=new Pn(d),u.scheduler=o?()=>o(y,!1):y,p=e=>Dn(e,!1,u),f=u.onStop=()=>{let e=Tr.get(u);if(e){if(c)c(e,4);else for(let t of e)t();Tr.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function kn(e,t=1/0,n){if(t<=0||!_e(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,hn(e))kn(e.value,t,n);else if(P(e))for(let r=0;r<e.length;r++)kn(e[r],t,n);else if(pe(e)||fe(e))e.forEach(e=>{kn(e,t,n)});else if(Se(e)){for(let r in e)kn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&kn(e[r],t,n)}return e}var An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr=o((()=>{xt(),jn=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&An&&(An.active?(this.parent=An,this.index=(An.scopes||(An.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=An;try{return An=this,e()}finally{An=t}}}on(){++this._on===1&&(this.prevScope=An,An=this)}off(){if(this._on>0&&--this._on===0){if(An===this)An=this.prevScope;else{let e=An;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}},Nn=new WeakSet,Pn=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,An&&(An.active?An.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Nn.has(this)&&(Nn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Tt(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Rt(this),Ot(this);let e=Mn,t=Rn;Mn=this,Rn=!0;try{return this.fn()}finally{kt(this),Mn=e,Rn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Mt(e);this.deps=this.depsTail=void 0,Rt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Nn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){At(this)&&this.run()}get dirty(){return At(this)}},Fn=0,Rn=!0,zn=[],Bn=0,Vn=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Hn=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Mn||!Rn||Mn===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Mn)t=this.activeLink=new Vn(Mn,this),Mn.deps?(t.prevDep=Mn.depsTail,Mn.depsTail.nextDep=t,Mn.depsTail=t):Mn.deps=Mn.depsTail=t,zt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Mn.depsTail,t.nextDep=void 0,Mn.depsTail.nextDep=t,Mn.depsTail=t,Mn.deps===t&&(Mn.deps=e)}return t}trigger(e){this.version++,Bn++,this.notify(e)}notify(e){Et();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Dt()}}},Un=new WeakMap,Wn=Symbol(``),Gn=Symbol(``),Kn=Symbol(``),qn={__proto__:null,[Symbol.iterator](){return Kt(this,Symbol.iterator,e=>Gt(this,e))},concat(...e){return Ut(this).concat(...e.map(e=>P(e)?Ut(e):e))},entries(){return Kt(this,`entries`,e=>(e[1]=Gt(this,e[1]),e))},every(e,t){return qt(this,`every`,e,t,void 0,arguments)},filter(e,t){return qt(this,`filter`,e,t,e=>e.map(e=>Gt(this,e)),arguments)},find(e,t){return qt(this,`find`,e,t,e=>Gt(this,e),arguments)},findIndex(e,t){return qt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return qt(this,`findLast`,e,t,e=>Gt(this,e),arguments)},findLastIndex(e,t){return qt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return qt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Yt(this,`includes`,e)},indexOf(...e){return Yt(this,`indexOf`,e)},join(e){return Ut(this).join(e)},lastIndexOf(...e){return Yt(this,`lastIndexOf`,e)},map(e,t){return qt(this,`map`,e,t,void 0,arguments)},pop(){return Xt(this,`pop`)},push(...e){return Xt(this,`push`,e)},reduce(e,...t){return Jt(this,`reduce`,e,t)},reduceRight(e,...t){return Jt(this,`reduceRight`,e,t)},shift(){return Xt(this,`shift`)},some(e,t){return qt(this,`some`,e,t,void 0,arguments)},splice(...e){return Xt(this,`splice`,e)},toReversed(){return Ut(this).toReversed()},toSorted(e){return Ut(this).toSorted(e)},toSpliced(...e){return Ut(this).toSpliced(...e)},unshift(...e){return Xt(this,`unshift`,e)},values(){return Kt(this,`values`,e=>Gt(this,e))}},Jn=Array.prototype,Yn=_(`__proto__,__v_isRef,__isVue`),Xn=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(ge)),Zn=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?pr:fr:i?dr:ur).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=P(e);if(!r){let e;if(a&&(e=qn[t]))return e;if(t===`hasOwnProperty`)return Zt}let o=Reflect.get(e,t,hn(e)?e:n);if((ge(t)?Xn.has(t):Yn(t))||(r||Bt(e,`get`,t),i))return o;if(hn(o)){let e=a&&Ce(t)?o:o.value;return r&&_e(e)?on(e):e}return _e(o)?r?on(o):rn(o):o}},Qn=class extends Zn{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=P(e)&&Ce(t);if(!this._isShallow){let e=un(i);if(!dn(n)&&!un(n)&&(i=pn(i),n=pn(n)),!a&&hn(i)&&!hn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:N(e,t),s=Reflect.set(e,t,n,hn(e)?e:r);return e===pn(r)&&s&&(o?Ne(n,i)&&Vt(e,`set`,t,n,i):Vt(e,`add`,t,n)),s}deleteProperty(e,t){let n=N(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Vt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!ge(t)||!Xn.has(t))&&Bt(e,`has`,t),n}ownKeys(e){return Bt(e,`iterate`,P(e)?`length`:Wn),Reflect.ownKeys(e)}},$n=class extends Zn{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},er=new Qn,tr=new $n,nr=new Qn(!0),rr=new $n(!0),ir=e=>e,ar=e=>Reflect.getPrototypeOf(e),or={get:tn(!1,!1)},sr={get:tn(!1,!0)},cr={get:tn(!0,!1)},lr={get:tn(!0,!0)},ur=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,mr=e=>_e(e)?rn(e):e,hr=e=>_e(e)?on(e):e,gr=class{constructor(e,t){this.dep=new Hn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:pn(e),this._value=t?e:mr(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||dn(e)||un(e);e=n?e:pn(e),Ne(e,t)&&(this._rawValue=e,this._value=n?e:mr(e),this.dep.trigger())}},_r={get:(e,t,n)=>t===`__v_raw`?e:z(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return hn(i)&&!hn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},vr=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new Hn,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}},yr=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=ge(t)?t:String(t),this._raw=pn(e);let r=!0,i=e;if(!P(e)||ge(this._key)||!Ce(this._key))do r=!fn(i)||dn(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=z(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&hn(this._raw[this._key])){let t=this._object[this._key];if(hn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return Ht(this._raw,this._key)}},br=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}},xr=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Hn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Bn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Mn!==this)return Tt(this,!0),!0}get value(){let e=this.dep.track();return jt(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},Sr={GET:`get`,HAS:`has`,ITERATE:`iterate`},Cr={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},wr={},Tr=new WeakMap,Er=void 0}));function Or(e){Go.push(e)}function kr(){Go.pop()}function Ar(e,t){}function jr(e,t,n,r){try{return r?e(...r):e()}catch(e){Nr(e,t,n)}}function Mr(e,t,n,r){if(F(e)){let i=jr(e,t,n,r);return i&&ve(i)&&i.catch(e=>{Nr(e,t,n)}),i}if(P(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Mr(e[a],t,n,r));return i}}function Nr(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||j;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){It(),jr(a,null,10,[e,i,o]),Lt();return}}Pr(e,n,i,r,o)}function Pr(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function Fr(e){let t=es||$o;return e?t.then(this?e.bind(this):e):t}function Ir(e){let t=Yo+1,n=Jo.length;for(;t<n;){let r=t+n>>>1,i=Jo[r],a=ts(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Lr(e){if(!(e.flags&1)){let t=ts(e),n=Jo[Jo.length-1];!n||!(e.flags&2)&&t>=ts(n)?Jo.push(e):Jo.splice(Ir(t),0,e),e.flags|=1,Rr()}}function Rr(){es||=$o.then(Hr)}function zr(e){if(!P(e))Zo&&e.id===-1?Zo.splice(Qo+1,0,e):e.flags&1||(Xo.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Xo.push(e[t]);Rr()}function Br(e,t,n=Yo+1){for(;n<Jo.length;n++){let t=Jo[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Jo.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function Vr(e){if(Xo.length){let e=[...new Set(Xo)].sort((e,t)=>ts(e)-ts(t));if(Xo.length=0,Zo){for(let t=0;t<e.length;t++)Zo.push(e[t]);return}for(Zo=e,Qo=0;Qo<Zo.length;Qo++){let e=Zo[Qo];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Zo=null,Qo=0}}function Hr(e){try{for(Yo=0;Yo<Jo.length;Yo++){let e=Jo[Yo];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),jr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Yo<Jo.length;Yo++){let e=Jo[Yo];e&&(e.flags&=-2)}Yo=-1,Jo.length=0,Vr(e),es=null,(Jo.length||Xo.length)&&Hr(e)}}function Ur(e,t){ns=e,ns?(ns.enabled=!0,rs.forEach(({event:e,args:t})=>ns.emit(e,...t)),rs=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Ur(e,t)}),setTimeout(()=>{ns||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,rs=[])},3e3)):rs=[]}function Wr(e){let t=is;return is=e,as=e&&e.type.__scopeId||null,t}function Gr(e){as=e}function Kr(){as=null}function qr(e,t=is,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&go(-1);let i=Wr(t),a=Lc.length,o;try{o=e(...n)}finally{for(let e=Lc.length;e>a;e--)ho();Wr(i),r._d&&go(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Jr(e,t){if(is===null)return e;let n=Ro(is),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=j]=t[e];i&&(F(i)&&(i={mounted:i,updated:i}),i.deep&&kn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Yr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(It(),Mr(c,n,8,[e.el,s,e,t]),Lt())}}function Xr(e,t){if(Wc){let n=Wc.provides,r=Wc.parent&&Wc.parent.provides;r===n&&(n=Wc.provides=Object.create(r)),n[e]=t}}function Zr(e,t,n=!1){let r=Gc();if(r||pc){let i=pc?pc._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&F(t)?t.call(r&&r.proxy):t}}function Qr(){return!!(Gc()||pc)}function $r(e,t){return ri(e,null,t)}function ei(e,t){return ri(e,null,{flush:`post`})}function ti(e,t){return ri(e,null,{flush:`sync`})}function ni(e,t,n){return ri(e,t,n)}function ri(e,t,n=j){let{immediate:r,deep:i,flush:a,once:o}=n,s=M({},n),c=t&&r||!t&&a!==`post`,l;if(Xc){if(a===`sync`){let e=ls();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=oe,e.resume=oe,e.pause=oe,e}}let u=Wc;s.call=(e,t,n)=>Mr(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{Ac(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():Lr(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=On(e,t,s);return Xc&&(l?l.push(f):c&&f()),f}function ii(e,t,n){let r=this.proxy,i=I(e)?e.includes(`.`)?ai(r,e):()=>r[e]:e.bind(r,r),a;F(t)?a=t:(a=t.handler,n=t);let o=Jc(this),s=ri(i,a.bind(r),n);return o(),s}function ai(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function oi(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!us.has(e)&&(!d||ps(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function si(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=_s(t.props,c),h=ps(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||li(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||li(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),ci(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}function ci(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function li(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[ds]=o,e&&(r(a,e,i),r(o,e,i)),o}function ui(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Js(()=>{e.isMounted=!0}),Zs(()=>{e.isUnmounting=!0}),e}function di(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Fc){t=n;break}}return t}function fi(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function pi(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=fi(n,e),S=(e,t)=>{e&&Mr(e,r,9,t)},C=(e,t)=>{let n=t[1];S(e,t),P(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=g||c;else return}t[bs]&&t[bs](!0);let i=x[b];i&&yo(e,i)&&i.el[bs]&&i.el[bs](),S(r,[t])},enter(t){if(x[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=_||l,i=v||u,o=y||d;else return}let s=!1;t[xs]=e=>{s||(s=!0,S(e?o:i,[t]),w.delayedLeave&&w.delayedLeave(),t[xs]=void 0)};let c=t[xs].bind(null,!1);r?C(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[xs]&&t[xs](!0),n.isUnmounting)return r();S(f,[t]);let a=!1;t[bs]=n=>{a||(a=!0,r(),S(n?h:m,[t]),t[bs]=void 0,x[i]===e&&delete x[i])};let o=t[bs].bind(null,!1);x[i]=e,p?C(p,[t,o]):o()},clone(e){let a=pi(e,t,n,r,i);return i&&i(a),a}};return w}function mi(e){if(Ws(e))return e=Co(e),e.children=null,e}function hi(e){if(!Ws(e))return fs(e.type)&&e.children?di(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&F(n.default))return n.default()}}function gi(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;gi(fs(n.type)&&hi(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _i(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===K?(o.patchFlag&128&&i++,r=r.concat(_i(o.children,t,s))):(t||o.type!==Fc)&&r.push(s==null?o:Co(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function vi(e,t){return F(e)?M({name:e.name},t,{setup:e}):e}function yi(){let e=Gc();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function bi(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function xi(e){let t=Gc(),n=gn(null);if(t){let r=t.refs===j?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function Si(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Ci(e,t,n,r,i=!1){if(P(e)){e.forEach((e,a)=>Ci(e,t&&(P(t)?t[a]:t),n,r,i));return}if(Us(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ci(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ro(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===j?s.refs={}:s.refs,d=s.setupState,f=pn(d),p=d===j?se:e=>!Si(u,e)&&N(f,e),m=(e,t)=>!(t&&Si(u,t));if(l!=null&&l!==c){if(wi(t),I(l))u[l]=null,p(l)&&(d[l]=null);else if(hn(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(F(c))jr(c,s,12,[o,u]);else{let t=I(c),r=hn(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)P(n)&&ue(n,a);else if(P(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Ds.delete(e)};t.id=-1,Ds.set(e,t),Ac(t,n)}else wi(e),s()}}}function wi(e){let t=Ds.get(e);t&&(t.flags|=8,Ds.delete(e))}function Ti(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,u=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),Vr(),t._vnode=e;return}d(t.firstChild,e,null,null,null),Vr(),t._vnode=e},d=(n,r,s,l,u,y=!1)=>{y||=!!r.dynamicChildren;let b=Ns(n)&&n.data===`[`,x=()=>h(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(y=!1,r.dynamicChildren=null);let D=null;switch(S){case Pc:E===3?(n.data!==r.children&&(ks(),n.data=r.children),D=a(n)):r.children===``?(c(r.el=i(``),o(n),n),D=n):D=x();break;case Fc:v(n)?(D=a(n),_(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case Ic:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){D=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=D.nodeType===1?D.outerHTML:D.data),t===r.staticCount-1&&(r.anchor=D),D=a(D);return b?a(D):D}x();break;case K:D=b?m(n,r,s,l,u,y):x();break;default:if(w&1)D=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!v(n)?x():f(n,r,s,l,u,y);else if(w&6){r.slotScopeIds=u;let e=o(n);if(D=b?g(n):Ns(n)&&n.data===`teleport start`?g(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,Ms(e),y),Us(r)&&!r.type.__asyncResolved){let t;b?(t=q(K),t.anchor=D?D.previousSibling:e.lastChild):t=n.nodeType===3?W(``):q(`div`),t.el=n,r.component.subTree=t}}else w&64?D=E===8?r.type.hydrate(n,r,s,l,u,y,e,p):x():w&128&&(D=r.type.hydrate(n,r,s,l,Ms(o(n)),u,y,e,d))}return C!=null&&Ci(C,null,l,r),D},f=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:u,patchFlag:d,shapeFlag:f,dirs:m,transition:h}=t,g=c===`input`||c===`option`,y=!!l;if(g||y||d!==-1){m&&Yr(t,null,n,`created`);let c=!1;if(v(e)){c=Qa(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),h.beforeEnter(r)}_(r,e,n),t.el=e=r}if(f&16&&!(u&&(u.innerHTML||u.textContent))){let r=p(e.firstChild,t,e,n,i,a,o);for(r&&!Di(e,1)&&ks();r;){let e=r;r=r.nextSibling,s(e)}}else if(f&8){let n=t.children;n[0]===`
3
3
  `&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
4
4
  `)&&(Di(e,0)||ks(),e.textContent=t.children)}if(u){if(g||y||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)if(g&&(a.endsWith(`value`)||a===`indeterminate`)||ce(a)&&!we(a)||a[0]===`.`||t&&!we(a)||l&&l.includes(a)){if(Ei(e,a,u[a]))continue;r(e,a,null,u[a],i,n)}}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&ln(u.style))for(let e in u.style)u.style[e]}let b;(b=u&&u.onVnodeBeforeMount)&&ko(b,n,t),m&&Yr(t,null,n,`beforeMount`),((b=u&&u.onVnodeMounted)||m||c)&&fo(()=>{b&&ko(b,n,t),c&&h.enter(e),m&&Yr(t,null,n,`mounted`)},i)}return e.nextSibling},p=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let f=t.children,p=f.length,m=!1;for(let t=0;t<p;t++){let h=u?f[t]:f[t]=To(f[t]),g=h.type===Pc;e?(g&&!u&&t+1<p&&To(f[t+1]).type===Pc&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=d(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,Di(r,1)||ks()),n(null,h,r,null,o,s,Ms(r),l))}return e},m=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=p(a(e),t,d,n,r,i,s);return f&&Ns(f)&&f.data===`]`?a(t.anchor=f):(ks(),c(t.anchor=l(`]`),d,f),f)},h=(e,t,r,i,c,l)=>{if(ki(e,t)||ks(),t.el=null,l){let t=g(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,Ms(d),c),r&&(r.vnode.el=t.el,Ba(r,t.el)),u},g=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&Ns(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},_=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},v=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[u,d]}function Ei(e,t,n){return Ps.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}function Di(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Fs);)e=e.parentElement;return Oi(e&&e.getAttribute(Fs),t)}function Oi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Is[t])}}function ki(e,t){return Di(e.parentElement,1)||Ai(e)||ji(t)}function Ai(e){return e.nodeType===1&&Oi(e.getAttribute(Fs),1)}function ji({props:e}){let t=e&&e[Fs];return typeof t==`string`&&Oi(t,1)}function Mi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}function Ni(e,t){if(Ns(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ns(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}function Pi(e){F(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return vi({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ni(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Wc;if(bi(e),u)return()=>Fi(u,e);let t=t=>{l=null,Nr(t,e,13,!r)};if(s&&e.suspense||Xc)return p().then(t=>()=>Fi(t,e)).catch(e=>(t(e),()=>r?q(r,{error:e}):null));let a=R(!1),c=R(),d=R(!!i),f,m;return Qs(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ws(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Fi(u,e);if(c.value&&r)return q(r,{error:c.value});if(n&&!d.value)return Fi(n,e)}}})}function Fi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=q(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}function Ii(e,t){return P(e)?e.some(e=>Ii(e,t)):I(e)?e.split(`,`).includes(t):he(e)?(e.lastIndex=0,e.test(t)):!1}function Li(e,t){zi(e,`a`,t)}function Ri(e,t){zi(e,`da`,t)}function zi(e,t,n=Wc){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Ui(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ws(e.parent.vnode)&&Bi(r,t,n,e),e=e.parent}}function Bi(e,t,n,r){let i=Ui(t,e,r,!0);Qs(()=>{ue(r[t],i)},n)}function Vi(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Hi(e){return e.shapeFlag&128?e.ssContent:e}function Ui(e,t,n=Wc,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{It();let i=Jc(n),a=Mr(t,n,e,r);return i(),Lt(),a};return r?i.unshift(a):i.push(a),a}}function Wi(e,t=Wc){Ui(`ec`,e,t)}function Gi(e,t){return Ji(nc,e,!0,t)||e}function Ki(e){return I(e)?Ji(nc,e,!1)||e:e||ic}function qi(e){return Ji(rc,e)}function Ji(e,t,n=!0,r=!1){let i=is||Wc;if(i){let n=i.type;if(e===nc){let e=zo(n,!1);if(e&&(e===t||e===Oe(t)||e===je(Oe(t))))return n}let a=Yi(i[e]||n[e],t)||Yi(i.appContext[e],t);return!a&&r?n:a}}function Yi(e,t){return e&&(e[t]||e[Oe(t)]||e[je(Oe(t))])}function Xi(e,t,n,r){let i,a=n&&n[r],o=P(e);if(o||I(e)){let n=o&&ln(e),r=!1,s=!1;n&&(r=!dn(e),s=un(e),e=Wt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?hr(mr(e[n])):mr(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(_e(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Zi(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(P(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Qi(e,t,n,r,i,a){if(n??={},is.ce||is.parent&&Us(is.parent)&&is.parent.ce){let e=a!=null&&n.key==null?M({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),B(),H(K,null,[q(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=Lc.length;B();let c;try{let i=o&&$i(o(n)),s=n.key||a||i&&i.key;c=H(K,{key:(s&&!ge(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Lc.length;e>s;e--)ho();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function $i(e){return e.some(e=>!vo(e)||!(e.type===Fc||e.type===K&&!$i(e.children)))?e:null}function ea(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:Me(r)]=e[r];return n}function ta(){return null}function na(){return null}function ra(e){}function ia(e){}function aa(){return null}function oa(){}function sa(e,t){return null}function ca(){return ua(`useSlots`).slots}function la(){return ua(`useAttrs`).attrs}function ua(e){let t=Gc();return t.setupContext||=Lo(t)}function da(e){return P(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function fa(e,t){let n=da(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?P(r)||F(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function pa(e,t){return!e||!t?e||t:P(e)&&P(t)?e.concat(t):M({},da(e),da(t))}function ma(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function ha(e){let t=Gc(),n=Xc,r=e();Yc(),n&&qc(!1);let i=()=>{Jc(t),n&&qc(!0)},a=()=>{Gc()!==t&&t.scope.off(),Yc(),n&&qc(!1)};return ve(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}function ga(e){let t=ba(e),n=e.proxy,r=e.ctx;uc=!1,t.beforeCreate&&va(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:x,renderTracked:S,renderTriggered:C,errorCaptured:w,serverPrefetch:T,expose:E,inheritAttrs:D,components:O,directives:k,filters:ee}=t;if(l&&_a(l,r,null),o)for(let e in o){let t=o[e];F(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);_e(t)&&(e.data=rn(t))}if(uc=!0,a)for(let e in a){let t=a[e],i=F(t)?t.bind(n,n):F(t.get)?t.get.bind(n,n):oe,o=!F(t)&&F(t.set)?t.set.bind(n):oe,s=J({get:i,set:o});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(s)for(let e in s)ya(s[e],r,n,e);if(c){let e=F(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Xr(t,e[t])})}u&&va(u,e,`c`);function A(e,t){P(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(A(qs,d),A(Js,f),A(Ys,p),A(Xs,m),A(Li,h),A(Ri,g),A(Wi,w),A(tc,S),A(ec,C),A(Zs,v),A(Qs,b),A($s,T),P(E)){if(E.length){let t=e.exposed||={};E.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}x&&e.render===oe&&(e.render=x),D!=null&&(e.inheritAttrs=D),O&&(e.components=O),k&&(e.directives=k),T&&bi(e)}function _a(e,t,n=oe){P(e)&&(e=wa(e));for(let n in e){let r=e[n],i;i=_e(r)?`default`in r?Zr(r.from||n,r.default,!0):Zr(r.from||n):Zr(r),hn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function va(e,t,n){Mr(P(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ya(e,t,n,r){let i=r.includes(`.`)?ai(n,r):()=>n[r];if(I(e)){let n=t[e];F(n)&&ni(i,n)}else if(F(e))ni(i,e.bind(n));else if(_e(e)){if(P(e))e.forEach(e=>ya(e,t,n,r));else{let r=F(e.handler)?e.handler.bind(n):t[e.handler];F(r)&&ni(i,r,e)}}}function ba(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>xa(c,e,o,!0)),xa(c,t,o)),_e(t)&&a.set(t,c),c}function xa(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&xa(e,a,n,!0),i&&i.forEach(t=>xa(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=dc[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}function Sa(e,t){return t?e?function(){return M(F(e)?e.call(this,this):e,F(t)?t.call(this,this):t)}:t:e}function Ca(e,t){return Ea(wa(e),wa(t))}function wa(e){if(P(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ta(e,t){return e?[...new Set([].concat(e,t))]:t}function Ea(e,t){return e?M(Object.create(null),e,t):t}function Da(e,t){return e?P(e)&&P(t)?[...new Set([...e,...t])]:M(Object.create(null),da(e),da(t??{})):t}function Oa(e,t){if(!e)return t;if(!t)return e;let n=M(Object.create(null),e);for(let r in t)n[r]=Ta(e[r],t[r]);return n}function ka(){return{app:null,config:{isNativeTag:se,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}function Aa(e,t){return function(n,r=null){F(n)||(n=M({},n)),r!=null&&!_e(r)&&(r=null);let i=ka(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:fc++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:tl,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&F(e.install)?(a.add(e),e.install(c,...t)):F(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||q(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,Ro(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Mr(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=pc;pc=c;try{return e()}finally{pc=t}}};return c}}function ja(e,t,n=j){let r=Gc(),i=Oe(t),a=Ae(t),o=mc(e,i),s=xn((o,s)=>{let c,l=j,u;return ti(()=>{let t=e[i];Ne(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Ne(o,c)&&!(l!==j&&Ne(e,l)))return;let d=r.vnode.props,f=!!(d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d));f||(c=e,s()),r.emit(`update:${t}`,o),Ne(e,l)&&(Ne(e,o)&&!Ne(o,u)||f&&l!==j&&!Ne(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||j:s,done:!1}:{done:!0}}}},s}function Ma(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||j,i=n,a=t.startsWith(`update:`),o=a&&mc(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>I(e)?e.trim():e)),o.number&&(i=n.map(Ie)));let s,c=r[s=Me(t)]||r[s=Me(Oe(t))];!c&&a&&(c=r[s=Me(Ae(t))]),c&&Mr(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Mr(l,e,6,i)}}function Na(e,t,n=!1){let r=n?hc:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!F(e)){let r=e=>{let n=Na(e,t,!0);n&&(s=!0,M(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(_e(e)&&r.set(e,null),null):(P(a)?a.forEach(e=>o[e]=null):M(o,a),_e(e)&&r.set(e,o),o)}function Pa(e,t){return!e||!ce(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),N(e,t[0].toLowerCase()+t.slice(1))||N(e,Ae(t))||N(e,t))}function Fa(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=Wr(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=To(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=To(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:gc(s)}}catch(t){Lc.length=0,Nr(t,e,1),_=q(Fc)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(le)&&(v=_c(v,a)),y=Co(y,v,!1,!0))}return n.dirs&&(y=Co(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&gi(fs(y.type)&&hi(y)||y,n.transition),_=y,Wr(g),_}function Ia(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(vo(r)){if(r.type!==Fc||r.children===`v-if`){if(n)return;n=r}}else return}return n}function La(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ra(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(za(o,r,n)&&!Pa(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ra(r,o,l):!!o;return!1}function Ra(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(za(t,e,a)&&!Pa(n,a))return!0}return!1}function za(e,t,n){let r=e[n],i=t[n];return n===`style`&&_e(r)&&_e(i)?!ne(r,i):r!==i}function Ba({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}function Va(e,t,n,r=!1){let i={},a=yc();e.propsDefaults=Object.create(null),Ua(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:an(i):e.type.props?i:a,e.attrs=a}function Ha(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=pn(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Pa(e.emitsOptions,o))continue;let u=t[o];if(c){if(N(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Oe(o);i[t]=Wa(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Ua(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!N(t,a)&&((r=Ae(a))===a||!N(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Wa(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!N(t,e))&&(delete a[e],l=!0)}l&&Vt(e.attrs,`set`,``)}function Ua(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(we(c))continue;let l=t[c],u;i&&N(i,u=Oe(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Pa(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=pn(n),r=s||j;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Wa(i,t,s,r[s],e,!N(r,s))}}return o}function Wa(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=N(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&F(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Jc(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===Ae(n))&&(r=!0))}return r}function Ga(e,t,n=!1){let r=n?xc:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!F(e)){let r=e=>{c=!0;let[n,r]=Ga(e,t,!0);M(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return _e(e)&&r.set(e,ae),ae;if(P(a))for(let e=0;e<a.length;e++){let t=Oe(a[e]);Ka(t)&&(o[t]=j)}else if(a)for(let e in a){let t=Oe(e);if(Ka(t)){let n=a[e],r=o[t]=P(n)||F(n)?{type:n}:M({},n),i=r.type,c=!1,l=!0;if(P(i))for(let e=0;e<i.length;++e){let t=i[e],n=F(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=F(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||N(r,`default`))&&s.push(t)}}let l=[o,s];return _e(e)&&r.set(e,l),l}function Ka(e){return e[0]!==`$`&&!we(e)}function qa(e){return Ya(e)}function Ja(e){return Ya(e,Ti)}function Ya(e,t){let n=ze();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=oe,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!yo(e,t)&&(r=P(e),le(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Pc:g(e,t,n,r);break;case Fc:_(e,t,n,r);break;case Ic:e??v(t,n,r,o);break;case K:O(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?k(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,me)}u!=null&&i?Ci(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Ci(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,Xa(e,c),l,d),_&&Yr(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!we(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ko(p,i,e)}_&&Yr(e,null,i,`beforeMount`);let v=Qa(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&Ac(()=>{try{p&&ko(p,i,e),v&&g.enter(f),_&&Yr(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||jc(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Eo(e[l]):To(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||j,m=t.props||j,h;if(n&&Za(n,!1),(h=m.onVnodeBeforeUpdate)&&ko(h,n,t,e),f&&Yr(t,e,n,`beforeUpdate`),n&&Za(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,Xa(t,i),o):s||re(e,t,c,null,n,r,Xa(t,i),o,!1),l>0){if(l&16)D(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&D(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&Ac(()=>{h&&ko(h,n,t,e),f&&Yr(t,e,n,`updated`)},r)},E=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===K||!yo(c,l)||c.shapeFlag&198)?d(c.el):n;h(c,l,u,null,r,i,a,o,!0)}},D=(e,t,n,r,i)=>{if(t!==n){if(t!==j)for(let o in t)!we(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(we(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},O=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&$a(e,t,!0)):re(e,t,n,f,a,o,c,l,u)},k=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ee(t,n,r,i,a,o,c):A(e,t,c)},ee=(e,t,n,r,i,a,o)=>{let s=e.component=Ao(e,r,i);if(Ws(e)&&(s.ctx.renderer=me),Mo(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,te,o),!e.el){let r=s.subTree=q(Fc);_(null,r,t,n),e.placeholder=r.el}}else te(s,e,t,n,i,a,o)},A=(e,t,n)=>{let r=t.component=e.component;if(La(e,t,n)){if(r.asyncDep&&!r.asyncResolved){ne(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},te=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=to(e);if(n){t&&(t.el=c.el,ne(e,t,o)),n.asyncDep.then(()=>{Ac(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;Za(e,!1),t?(t.el=c.el,ne(e,t,o)):t=c,n&&Pe(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ko(f,s,t,c),Za(e,!0);let p=Fa(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el),P(m),e,i,a),t.el=p.el,u===null&&Ba(e,p.el),r&&Ac(r,i),(f=t.props&&t.props.onVnodeUpdated)&&Ac(()=>ko(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Us(t);if(Za(e,!1),l&&Pe(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ko(o,d,t),Za(e,!0),s&&F){let t=()=>{e.subTree=Fa(e),F(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Fa(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&Ac(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Ac(()=>ko(o,d,e),i)}(t.shapeFlag&256||d&&Us(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Ac(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Pn(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Lr(u),Za(e,!0),l()},ne=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Ha(e,t.props,r,n),kc(e,t.children,n),It(),Br(e),Lt()},re=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){se(l,f,n,r,i,a,o,s,c);return}if(p&256){ie(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&N(l,i,a),f!==l&&u(n,f)):d&16?m&16?se(l,f,n,r,i,a,o,s,c):N(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},ie=(e,t,n,r,i,a,o,s,c)=>{e||=ae,t||=ae;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;f<d;f++){let r=t[f]=c?Eo(t[f]):To(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?N(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},se=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Eo(t[l]):To(t[l]);if(yo(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Eo(t[f]):To(t[f]);if(yo(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?Eo(t[l]):To(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)le(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?Eo(t[l]):To(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){le(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&yo(r,t[_])){u=_;break}u===void 0?le(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?eo(S):ae;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||ro(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?ce(d,n,p,2):_--)}}},ce=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ce(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,me);return}if(c===K){r(s,t,n);for(let e=0;e<u.length;e++)ce(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Ic){y(e,t,n);return}if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[bs]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Ac(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[bs];s._isLeaving&&s[bs](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},le=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(It(),Ci(s,null,n,e,!0),Lt()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Us(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ko(_,t,e),u&6)de(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Yr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,me,r):l&&!l.hasOnce&&(a!==K||d>0&&d&64)?N(l,t,n,!1,!0):(a===K&&d&384||!i&&u&16)&&N(c,t,n),r&&M(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Ac(()=>{_&&ko(_,t,e),h&&Yr(e,null,t,`unmounted`),v&&(e.el=null)},n)},M=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===K){ue(n,r);return}if(t===Ic){b(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},ue=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},de=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;no(c),no(l),r&&Pe(r),i.stop(),a&&(a.flags|=8,le(o,e,t,n)),s&&Ac(s,t),Ac(()=>{e.isUnmounted=!0},t)},N=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)le(e[o],t,n,r,i)},P=e=>{if(e.shapeFlag&6)return P(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[ds];return n?f(n):t},fe=!1,pe=(e,t,n)=>{let r;e==null?t._vnode&&(le(t._vnode,null,null,!0),r=t._vnode.component):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,fe||=(fe=!0,Br(r),Vr(),!1)},me={p:h,um:le,m:ce,r:M,mt:ee,mc:w,pc:re,pbc:E,n:P,o:e},he,F;return t&&([he,F]=t(me)),{render:pe,hydrate:he,createApp:Aa(pe,he)}}function Xa({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Za({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function $a(e,t,n=!1){let r=e.children,i=t.children;if(P(r)&&P(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Eo(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&$a(t,a)),a.type===Pc&&(a.patchFlag===-1&&(a=i[e]=Eo(a)),a.el=t.el),a.type===Fc&&!a.el&&(a.el=t.el)}}function eo(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function to(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:to(t)}function no(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ro(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?ro(t.subTree):null}function io(e,t){let n=e.props&&e.props[t];F(n)&&n()}function ao(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=so(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(io(e,`onPending`),io(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),po(f,e.ssFallback)):f.resolve(!1,!0)}function oo(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,yo(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),po(d,p)))):(d.pendingId=Mc++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),po(d,p))):m&&yo(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&yo(m,f))c(m,f,n,r,i,d,a,o,s),po(d,f);else if(io(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Mc++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function so(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=mo(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?Le(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Mc++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),zr(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&Ac(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,po(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e<c.length;e++)y.effects.push(c[e]);S=!0;break}y=y.parent}!S&&!g&&zr(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),io(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;io(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),po(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Nr(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;Yc(),e.asyncResolved=!0;let{vnode:s}=e;Po(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),Ba(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function co(e,t,n,r,i,a,o,s,c){let l=t.suspense=so(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function lo(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=uo(r?n.default:n),e.ssFallback=r?uo(n.fallback):q(Fc)}function uo(e){let t;if(F(e)){let n=zc&&e._c;n&&(e._d=!1,B()),e=e(),n&&(e._d=!0,t=Rc,ho())}return P(e)&&(e=Ia(e)),e=To(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function fo(e,t){t&&t.pendingBranch?P(e)?t.effects.push(...e):t.effects.push(e):zr(e)}function po(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,Ba(r,i))}function mo(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}function B(e=!1){Lc.push(Rc=e?null:[])}function ho(){Lc.pop(),Rc=Lc[Lc.length-1]||null}function go(e,t=!1){zc+=e,e<0&&Rc&&t&&(Rc.hasOnce=!0)}function _o(e){return e.dynamicChildren=zc>0?Rc||ae:null,ho(),zc>0&&Rc&&Rc.push(e),e}function V(e,t,n,r,i,a){return _o(U(e,t,n,r,i,a,!0))}function H(e,t,n,r,i){return _o(q(e,t,n,r,i,!0))}function vo(e){return e?e.__v_isVNode===!0:!1}function yo(e,t){return e.type===t.type&&e.key===t.key}function bo(e){}function U(e,t=null,n=null,r=0,i=null,a=e===K?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Bc(t),ref:t&&Vc(t),scopeId:as,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:is};return s?(Do(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=I(n)?8:16),zc>0&&!o&&Rc&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Rc.push(c),c}function xo(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===ic)&&(e=Fc),vo(e)){let r=Co(e,t,!0);return n&&Do(r,n),zc>0&&!a&&Rc&&(r.shapeFlag&6?Rc[Rc.indexOf(e)]=r:Rc.push(r)),r.patchFlag=-2,r}if(Bo(e)&&(e=e.__vccOpts),t){t=So(t);let{class:e,style:n}=t;e&&!I(e)&&(t.class=w(e)),_e(n)&&(fn(n)&&!P(n)&&(n=M({},n)),t.style=x(n))}let o=I(e)?1:jc(e)?128:fs(e)?64:_e(e)?4:F(e)?2:0;return U(e,t,n,r,i,o,a,!0)}function So(e){return e?fn(e)||bc(e)?M({},e):e:null}function Co(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Oo(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Bc(l),ref:t&&t.ref?n&&a?P(a)?a.concat(Vc(t)):[a,Vc(t)]:Vc(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==K?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Co(e.ssContent),ssFallback:e.ssFallback&&Co(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&gi(u,c.clone(u)),u}function W(e=` `,t=0){return q(Pc,null,e,t)}function wo(e,t){let n=q(Ic,null,e);return n.staticCount=t,n}function G(e=``,t=!1){return t?(B(),H(Fc,null,e)):q(Fc,null,e)}function To(e){return e==null||typeof e==`boolean`?q(Fc):P(e)?q(K,null,e.slice()):vo(e)?Eo(e):q(Pc,null,String(e))}function Eo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Co(e)}function Do(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(P(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Do(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!bc(t)?t._ctx=is:r===3&&is&&(is.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(F(t)){if(r&65){Do(e,{default:t});return}t={default:t,_ctx:is},n=32}else t=String(t),r&64?(n=16,t=[W(t)]):n=8;e.children=t,e.shapeFlag|=n}function Oo(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=w([t.class,r.class]));else if(e===`style`)t.style=x([t.style,r.style]);else if(ce(e)){let n=t[e],i=r[e];i&&n!==i&&!(P(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!le(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ko(e,t,n,r=null){Mr(e,t,7,[n,r])}function Ao(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Hc,a={uid:Uc++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new jn(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ga(r,i),emitsOptions:Na(r,i),emit:null,emitted:null,propsDefaults:j,inheritAttrs:r.inheritAttrs,ctx:j,data:j,props:j,attrs:j,slots:j,refs:j,setupState:j,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Ma.bind(null,a),e.ce&&e.ce(a),a}function jo(e){return e.vnode.shapeFlag&4}function Mo(e,t=!1,n=!1){t&&qc(t);let{props:r,children:i}=e.vnode,a=jo(e);Va(e,r,a,t),Oc(e,i,n||t);let o=a?No(e,t):void 0;return t&&qc(!1),o}function No(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,cc);let{setup:r}=n;if(r){It();let n=e.setupContext=r.length>1?Lo(e):null,i=Jc(e),a=jr(r,e,0,[e.props,n]),o=ve(a);if(Lt(),i(),(o||e.sp)&&!Us(e)&&bi(e),o){if(a.then(Yc,Yc),t)return a.then(n=>{qc(!0);try{Po(e,n,t)}finally{qc(!1)}}).catch(t=>{Nr(t,e,0)});e.asyncDep=a}else Po(e,a,t)}else Io(e,t)}function Po(e,t,n){F(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_e(t)&&(e.setupState=bn(t)),Io(e,n)}function Fo(e){Zc=e,Qc=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,lc))}}function Io(e,t,n){let r=e.type;if(!e.render){if(!t&&Zc&&!r.render){let t=r.template||ba(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=M(M({isCustomElement:n,delimiters:a},i),o);r.render=Zc(t,s)}}e.render=r.render||oe,Qc&&Qc(e)}{let t=Jc(e);It();try{ga(e)}finally{Lt(),t()}}}function Lo(e){return{attrs:new Proxy(e.attrs,el),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ro(e){return e.exposed?e.exposeProxy||=new Proxy(bn(mn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in oc)return oc[n](e)},has(e,t){return t in e||t in oc}}):e.proxy}function zo(e,t=!0){return F(e)?e.displayName||e.name:e.name||t&&e.__name}function Bo(e){return F(e)&&`__vccOpts`in e}function Vo(e,t,n){try{go(-1);let r=arguments.length;return r===2?_e(t)&&!P(t)?vo(t)?q(e,null,[t]):q(e,t):q(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&vo(n)&&(n=[n]),q(e,t,n))}finally{go(1)}}function Ho(){}function Uo(e,t,n,r){let i=n[r];if(i&&Wo(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function Wo(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(Ne(n[e],t[e]))return!1;return zc>0&&Rc&&Rc.push(e),!0}var Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,K,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,q,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,J,tl,nl,rl,il,al,ol,sl=o((()=>{Dr(),xt(),Go=[],Ko={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},qo={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`},Jo=[],Yo=-1,Xo=[],Zo=null,Qo=0,$o=Promise.resolve(),es=null,ts=e=>e.id==null?e.flags&2?-1:1/0:e.id,rs=[],is=null,as=null,ss=e=>qr,cs=Symbol.for(`v-scx`),ls=()=>Zr(cs),us=new WeakMap,ds=Symbol(`_vte`),fs=e=>e.__isTeleport,ps=e=>e&&(e.disabled||e.disabled===``),ms=e=>e&&(e.defer||e.defer===``),hs=e=>typeof SVGElement<`u`&&e instanceof SVGElement,gs=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,_s=(e,t)=>{let n=e&&e.to;return I(n)?t?t(n):null:n},vs={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=ps(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=ps(e.props),r=e.target=_s(e.props,m),a=li(r,e,h,p);r&&(o!==`svg`&&hs(r)?o=`svg`:o!==`mathml`&&gs(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),ci(e,!1)))},S=e=>{let t=()=>{if(us.get(e)===t){if(us.delete(e),ps(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),ci(e,!0)}x(e)}};us.set(e,t),Ac(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),ms(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),ci(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=us.get(e);if(u){u.flags|=8,us.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=ps(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||hs(p)?o=`svg`:(o===`mathml`||gs(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),$a(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):oi(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=_s(t.props,m);e&&(t.target=e,oi(t,e,null,l,0))}else g&&oi(t,p,h,l,1);ci(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=ps(f),m=a||!p,h=us.get(e);if(h&&(h.flags|=8,us.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:oi,hydrate:si},ys=vs,bs=Symbol(`_leaveCb`),xs=Symbol(`_enterCb`),Ss=[Function,Array],Cs={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ss,onEnter:Ss,onAfterEnter:Ss,onEnterCancelled:Ss,onBeforeLeave:Ss,onLeave:Ss,onAfterLeave:Ss,onLeaveCancelled:Ss,onBeforeAppear:Ss,onAppear:Ss,onAfterAppear:Ss,onAppearCancelled:Ss},ws=e=>{let t=e.subTree;return t.component?ws(t.component):t},Ts={name:`BaseTransition`,props:Cs,setup(e,{slots:t}){let n=Gc(),r=ui();return()=>{let i=t.default&&_i(t.default(),!0),a=i&&i.length?di(i):n.subTree?G():void 0;if(!a)return;let o=pn(e),{mode:s}=o;if(r.isLeaving)return mi(a);let c=hi(a);if(!c)return mi(a);let l=pi(c,o,r,n,e=>l=e);c.type!==Fc&&gi(c,l);let u=n.subTree&&hi(n.subTree);if(u&&u.type!==Fc&&!yo(u,c)&&ws(n).type!==Fc){let e=pi(u,o,r,n);if(gi(u,e),s===`out-in`&&c.type!==Fc)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},mi(a);s===`in-out`&&c.type!==Fc?e.delayLeave=(e,t,n)=>{let i=fi(r,u);i[String(u.key)]=u,e[bs]=()=>{t(),e[bs]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}},Es=Ts,Ds=new WeakMap,Os=!1,ks=()=>{Os||=(console.error(`Hydration completed but contains mismatches.`),!0)},As=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,js=e=>e.namespaceURI.includes(`MathML`),Ms=e=>{if(e.nodeType===1){if(As(e))return`svg`;if(js(e))return`mathml`}},Ns=e=>e.nodeType===8,Ps=new Set([`src`,`srcset`,`href`,`poster`]),Fs=`data-allow-mismatch`,Is={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`},Ls=ze().requestIdleCallback||(e=>setTimeout(e,1)),Rs=ze().cancelIdleCallback||(e=>clearTimeout(e)),zs=(e=1e4)=>t=>{let n=Ls(t,{timeout:e});return()=>Rs(n)},Bs=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Mi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Vs=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Hs=(e=[])=>(t,n)=>{I(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a},Us=e=>!!e.type.__asyncLoader,Ws=e=>e.type.__isKeepAlive,Gs={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Gc(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),Ac(()=>{a.isDeactivated=!1,a.a&&Pe(a.a);let t=e.props&&e.props.onVnodeMounted;t&&ko(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;no(t.m),no(t.a),l(e,f,null,1,s),Ac(()=>{t.da&&Pe(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&ko(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Vi(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=zo(Us(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!yo(t,o))?p(t):o&&Vi(o),i.delete(e),a.delete(e)}ni(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Ii(e,t)),t&&m(e=>!Ii(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(jc(n.subTree.type)?Ac(()=>{i.set(g,Hi(n.subTree))},n.subTree.suspense):i.set(g,Hi(n.subTree)))};return Js(_),Xs(_),Zs(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Hi(t);if(e.type===i.type&&e.key===i.key){Vi(i);let e=i.component.da;e&&Ac(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!vo(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Hi(r);if(s.type===Fc)return o=null,s;let c=s.type,l=zo(Us(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Ii(u,l))||d&&l&&Ii(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Co(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&gi(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,jc(r.type)?r:s}}},Ks=e=>(t,n=Wc)=>{(!Xc||e===`sp`)&&Ui(e,(...e)=>t(...e),n)},qs=Ks(`bm`),Js=Ks(`m`),Ys=Ks(`bu`),Xs=Ks(`u`),Zs=Ks(`bum`),Qs=Ks(`um`),$s=Ks(`sp`),ec=Ks(`rtg`),tc=Ks(`rtc`),nc=`components`,rc=`directives`,ic=Symbol.for(`v-ndc`),ac=e=>e?jo(e)?Ro(e):ac(e.parent):null,oc=M(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ac(e.parent),$root:e=>ac(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ba(e),$forceUpdate:e=>e.f||=()=>{Lr(e.update)},$nextTick:e=>e.n||=Fr.bind(e.proxy),$watch:e=>ii.bind(e)}),sc=(e,t)=>e!==j&&!e.__isScriptSetup&&N(e,t),cc={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(sc(r,t))return o[t]=1,r[t];else if(i!==j&&N(i,t))return o[t]=2,i[t];else if(N(a,t))return o[t]=3,a[t];else if(n!==j&&N(n,t))return o[t]=4,n[t];else uc&&(o[t]=0)}let l=oc[t],u,d;if(l)return t===`$attrs`&&Bt(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==j&&N(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,N(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return sc(i,t)?(i[t]=n,!0):r!==j&&N(r,t)?(r[t]=n,!0):N(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==j&&s[0]!==`$`&&N(e,s)||sc(t,s)||N(a,s)||N(r,s)||N(oc,s)||N(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?N(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},lc=M({},cc,{get(e,t){if(t!==Symbol.unscopables)return cc.get(e,t,e)},has(e,t){return t[0]!==`_`&&!Ke(t)}}),uc=!0,dc={data:Sa,props:Da,emits:Da,methods:Ea,computed:Ea,beforeCreate:Ta,created:Ta,beforeMount:Ta,mounted:Ta,beforeUpdate:Ta,updated:Ta,beforeDestroy:Ta,beforeUnmount:Ta,destroyed:Ta,unmounted:Ta,activated:Ta,deactivated:Ta,errorCaptured:Ta,serverPrefetch:Ta,components:Ea,directives:Ea,watch:Oa,provide:Sa,inject:Ca},fc=0,pc=null,mc=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Oe(t)}Modifiers`]||e[`${Ae(t)}Modifiers`],hc=new WeakMap,gc=e=>{let t;for(let n in e)(n===`class`||n===`style`||ce(n))&&((t||={})[n]=e[n]);return t},_c=(e,t)=>{let n={};for(let r in e)(!le(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},vc={},yc=()=>Object.create(vc),bc=e=>Object.getPrototypeOf(e)===vc,xc=new WeakMap,Sc=e=>e===`_`||e===`_ctx`||e===`$stable`,Cc=e=>P(e)?e.map(To):[To(e)],wc=(e,t,n)=>{if(t._n)return t;let r=qr((...e)=>Cc(t(...e)),n);return r._c=!1,r},Tc=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Sc(n))continue;let i=e[n];if(F(i))t[n]=wc(n,i,r);else if(i!=null){let e=Cc(i);t[n]=()=>e}}},Ec=(e,t)=>{let n=Cc(t);e.slots.default=()=>n},Dc=(e,t,n)=>{for(let r in t)(n||!Sc(r))&&(e[r]=t[r])},Oc=(e,t,n)=>{let r=e.slots=yc();if(e.vnode.shapeFlag&32){let e=t._;e?(Dc(r,t,n),n&&Fe(r,`_`,e,!0)):Tc(t,r)}else t&&Ec(e,t)},kc=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=j;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Dc(i,t,n):(a=!t.$stable,Tc(t,i)),o=t}else t&&(Ec(e,t),o={default:1});if(a)for(let e in i)!Sc(e)&&o[e]==null&&delete i[e]},Ac=fo,jc=e=>e.__isSuspense,Mc=0,Nc={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)ao(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}oo(e,t,n,r,i,o,s,c,l)}},hydrate:co,normalize:lo},K=Symbol.for(`v-fgt`),Pc=Symbol.for(`v-txt`),Fc=Symbol.for(`v-cmt`),Ic=Symbol.for(`v-stc`),Lc=[],Rc=null,zc=1,Bc=({key:e})=>e??null,Vc=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:I(e)||hn(e)||F(e)?{i:is,r:e,k:t,f:!!n}:e),q=xo,Hc=ka(),Uc=0,Wc=null,Gc=()=>Wc||is;{let e=ze(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Kc=t(`__VUE_INSTANCE_SETTERS__`,e=>Wc=e),qc=t(`__VUE_SSR_SETTERS__`,e=>Xc=e)}Jc=e=>{let t=Wc;return Kc(e),e.scope.on(),()=>{e.scope.off(),Kc(t)}},Yc=()=>{Wc&&Wc.scope.off(),Kc(null)},Xc=!1,$c=()=>!Zc,el={get(e,t){return Bt(e,`get`,``),e[t]}},J=(e,t)=>Tn(e,t,Xc),tl=`3.5.41`,nl=oe,rl=qo,il=ns,al=Ur,ol={createComponentInstance:Ao,setupComponent:Mo,renderComponentRoot:Fa,setCurrentRenderingInstance:Wr,isVNode:vo,normalizeVNode:To,getComponentPublicInstance:Ro,ensureValidVNode:$i,pushWarningContext:Or,popWarningContext:kr}})),cl=c({BaseTransition:()=>Es,BaseTransitionPropsValidators:()=>Cs,Comment:()=>Fc,DeprecationTypes:()=>null,EffectScope:()=>jn,ErrorCodes:()=>Ko,ErrorTypeStrings:()=>rl,Fragment:()=>K,KeepAlive:()=>Gs,ReactiveEffect:()=>Pn,Static:()=>Ic,Suspense:()=>Nc,Teleport:()=>ys,Text:()=>Pc,TrackOpTypes:()=>Sr,Transition:()=>Su,TransitionGroup:()=>Qu,TriggerOpTypes:()=>Cr,VueElement:()=>Ku,assertNumber:()=>Ar,callWithAsyncErrorHandling:()=>Mr,callWithErrorHandling:()=>jr,camelize:()=>Oe,capitalize:()=>je,cloneVNode:()=>Co,compatUtils:()=>null,computed:()=>J,createApp:()=>_d,createBlock:()=>H,createCommentVNode:()=>G,createElementBlock:()=>V,createElementVNode:()=>U,createHydrationRenderer:()=>Ja,createPropsRestProxy:()=>ma,createRenderer:()=>qa,createSSRApp:()=>vd,createSlots:()=>Zi,createStaticVNode:()=>wo,createTextVNode:()=>W,createVNode:()=>q,customRef:()=>xn,defineAsyncComponent:()=>Pi,defineComponent:()=>vi,defineCustomElement:()=>zl,defineEmits:()=>na,defineExpose:()=>ra,defineModel:()=>oa,defineOptions:()=>ia,defineProps:()=>ta,defineSSRCustomElement:()=>Wu,defineSlots:()=>aa,devtools:()=>il,effect:()=>Pt,effectScope:()=>St,getCurrentInstance:()=>Gc,getCurrentScope:()=>Ct,getCurrentWatcher:()=>En,getTransitionRawChildren:()=>_i,guardReactiveProps:()=>So,h:()=>Vo,handleError:()=>Nr,hasInjectionContext:()=>Qr,hydrate:()=>gd,hydrateOnIdle:()=>zs,hydrateOnInteraction:()=>Hs,hydrateOnMediaQuery:()=>Vs,hydrateOnVisible:()=>Bs,initCustomFormatter:()=>Ho,initDirectivesForSSR:()=>bd,inject:()=>Zr,isMemoSame:()=>Wo,isProxy:()=>fn,isReactive:()=>ln,isReadonly:()=>un,isRef:()=>hn,isRuntimeOnly:()=>$c,isShallow:()=>dn,isVNode:()=>vo,markRaw:()=>mn,mergeDefaults:()=>fa,mergeModels:()=>pa,mergeProps:()=>Oo,nextTick:()=>Fr,nodeOps:()=>hu,normalizeClass:()=>w,normalizeProps:()=>T,normalizeStyle:()=>x,onActivated:()=>Li,onBeforeMount:()=>qs,onBeforeUnmount:()=>Zs,onBeforeUpdate:()=>Ys,onDeactivated:()=>Ri,onErrorCaptured:()=>Wi,onMounted:()=>Js,onRenderTracked:()=>tc,onRenderTriggered:()=>ec,onScopeDispose:()=>wt,onServerPrefetch:()=>$s,onUnmounted:()=>Qs,onUpdated:()=>Xs,onWatcherCleanup:()=>Dn,openBlock:()=>B,patchProp:()=>Hu,popScopeId:()=>Kr,provide:()=>Xr,proxyRefs:()=>bn,pushScopeId:()=>Gr,queuePostFlushCb:()=>zr,reactive:()=>rn,readonly:()=>on,ref:()=>R,registerRuntimeCompiler:()=>Fo,render:()=>hd,renderList:()=>Xi,renderSlot:()=>Qi,resolveComponent:()=>Gi,resolveDirective:()=>qi,resolveDynamicComponent:()=>Ki,resolveFilter:()=>null,resolveTransitionHooks:()=>pi,setBlockTracking:()=>go,setDevtoolsHook:()=>al,setTransitionHooks:()=>gi,shallowReactive:()=>an,shallowReadonly:()=>sn,shallowRef:()=>gn,ssrContextKey:()=>cs,ssrUtils:()=>ol,stop:()=>Ft,toDisplayString:()=>L,toHandlerKey:()=>Me,toHandlers:()=>ea,toRaw:()=>pn,toRef:()=>Cn,toRefs:()=>Sn,toValue:()=>yn,transformVNodeArgs:()=>bo,triggerRef:()=>vn,unref:()=>z,useAttrs:()=>la,useCssModule:()=>Hl,useCssVars:()=>Cl,useHost:()=>Bl,useId:()=>yi,useModel:()=>ja,useSSRContext:()=>ls,useShadowRoot:()=>Vl,useSlots:()=>ca,useTemplateRef:()=>xi,useTransitionState:()=>ui,vModelCheckbox:()=>rd,vModelDynamic:()=>od,vModelRadio:()=>id,vModelSelect:()=>ad,vModelText:()=>nd,vShow:()=>Ou,version:()=>tl,warn:()=>nl,watch:()=>ni,watchEffect:()=>$r,watchPostEffect:()=>ei,watchSyncEffect:()=>ti,withAsyncContext:()=>ha,withCtx:()=>qr,withDefaults:()=>sa,withDirectives:()=>Jr,withKeys:()=>dd,withMemo:()=>Uo,withModifiers:()=>ld,withScopeId:()=>ss});function ll(e){let t={};for(let n in e)n in yu||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=ul(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=_,onAppear:C=v,onAppearCancelled:w=y}=t,T=(e,t,n,r)=>{e._enterCancelled=r,pl(e,t?u:s),pl(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,pl(e,d),pl(e,p),pl(e,f),t&&t()},D=e=>(t,n)=>{let i=e?C:v,o=()=>T(t,e,n);Cu(i,[t,o]),ml(()=>{pl(t,e?c:a),fl(t,e?u:s),wu(i)||hl(t,r,h,o)})};return M(t,{onBeforeEnter(e){Cu(_,[e]),fl(e,a),fl(e,o)},onBeforeAppear(e){Cu(S,[e]),fl(e,c),fl(e,l)},onEnter:D(!1),onAppear:D(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);fl(e,d),e._enterCancelled?(fl(e,f),yl(e)):(yl(e),fl(e,f)),ml(()=>{e._isLeaving&&(pl(e,d),fl(e,p),wu(b)||hl(e,r,g,n))}),Cu(b,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),Cu(y,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),Cu(w,[e])},onLeaveCancelled(e){E(e),Cu(x,[e])}})}function ul(e){if(e==null)return null;if(_e(e))return[dl(e.enter),dl(e.leave)];{let t=dl(e);return[t,t]}}function dl(e){return Le(e)}function fl(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[vu]||(e[vu]=new Set)).add(t)}function pl(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[vu];n&&(n.delete(t),n.size||(e[vu]=void 0))}function ml(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}function hl(e,t,n,r){let i=e._endId=++Tu,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=gl(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function gl(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${gu}Delay`),a=r(`${gu}Duration`),o=_l(i,a),s=r(`${_u}Delay`),c=r(`${_u}Duration`),l=_l(s,c),u=null,d=0,f=0;t===gu?o>0&&(u=gu,d=o,f=a.length):t===_u?l>0&&(u=_u,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?gu:_u:null,f=u?u===gu?a.length:c.length:0);let p=u===gu&&/\b(?:transform|all)(?:,|$)/.test(r(`${gu}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function _l(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>vl(t)+vl(e[n])))}function vl(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function yl(e){return(e?e.ownerDocument:document).body.offsetHeight}function bl(e,t,n){let r=e[vu];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function xl(e,t){e.style.display=t?e[Eu]:`none`,e[Du]=!t}function Sl(){Ou.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}function Cl(e){let t=Gc();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Tl(e,n))},r=()=>{let r=e(t.proxy);t.ce?Tl(t.ce,r):wl(t.subTree,r),n(r)};Ys(()=>{zr(r)}),Js(()=>{ni(r,oe,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),Qs(()=>e.disconnect())})}function wl(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{wl(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Tl(e.el,t);else if(e.type===K)e.children.forEach(e=>wl(e,t));else if(e.type===Ic){let{el:n,anchor:r}=e;for(;n&&(Tl(n,t),n!==r);)n=n.nextSibling}}function Tl(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=ie(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[ku]=r}}function El(e,t,n){let r=e.style,i=I(n),a=!1;if(n&&!i){if(t){if(I(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Dl(r,t,``)}else for(let e in t)n[e]??Dl(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Dl(r,i,``):kl(e,i,!I(t)&&t?t[i]:void 0,o)||Dl(r,i,o)}}else if(i){if(t!==n){let e=r[ku];e&&(n+=`;`+e),r.cssText=n,a=Au.test(n)}}else t&&e.removeAttribute(`style`);Eu in e&&(e[Eu]=a?r.display:``,e[Du]&&(r.display=`none`))}function Dl(e,t,n){if(P(n))n.forEach(n=>Dl(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Ol(e,t);ju.test(n)?e.setProperty(Ae(r),n.replace(ju,``),`important`):e[r]=n}}function Ol(e,t){let n=Nu[t];if(n)return n;let r=Oe(t);if(r!==`filter`&&r in e)return Nu[t]=r;r=je(r);for(let n=0;n<Mu.length;n++){let i=Mu[n]+r;if(i in e)return Nu[t]=i}return t}function kl(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&I(r)&&n===r}function Al(e,t,n,r,i,a=st(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Pu,t.slice(6,t.length)):e.setAttributeNS(Pu,t,n):n==null||a&&!E(n)?e.removeAttribute(t):e.setAttribute(t,a?``:ge(n)?String(n):n)}function jl(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?uu(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=E(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ml(e,t,n,r){e.addEventListener(t,n,r)}function Nl(e,t,n,r){e.removeEventListener(t,n,r)}function Pl(e,t,n,r,i=null){let a=e[Fu]||(e[Fu]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Fl(t);r?Ml(e,n,a[t]=Il(r,i),s):o&&(Nl(e,n,o,s),a[t]=void 0)}}function Fl(e){let t,n;for(;(n=e.match(Iu))&&!Lu.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Ae(e.slice(2)),t]}function Il(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(P(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Mr(e,t,5,a)}}else Mr(r,t,5,[e])};return n.value=e,n.attached=Bu(),n}function Ll(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Vu(t)&&F(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Vu(t)&&I(n)?!1:t in e}function Rl(e,t){let n=e._def.props;if(!n)return!1;let r=Oe(t);return Array.isArray(n)?n.some(e=>Oe(e)===r):Object.keys(n).some(e=>Oe(e)===r)}function zl(e,t,n){let r=vi(e,t);Se(r)&&(r=M({},r,t));class i extends Ku{constructor(e){super(r,e,n)}}return i.def=r,i}function Bl(e){let t=Gc();return t&&t.ce||null}function Vl(){let e=Bl();return e&&e.shadowRoot}function Hl(e=`$style`){{let t=Gc();if(!t)return j;let n=t.type.__cssModules;return n&&n[e]||j}}function Ul(e){let t=e.el;t[Yu]&&t[Yu](),t[Xu]&&t[Xu]()}function Wl(e){Ju.set(e,Kl(e.el))}function Gl(e){let t=qu.get(e),n=Ju.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el,n=t.style,a=t.getBoundingClientRect(),o=1,s=1;return t.offsetWidth&&(o=a.width/t.offsetWidth),t.offsetHeight&&(s=a.height/t.offsetHeight),(!Number.isFinite(o)||o===0)&&(o=1),(!Number.isFinite(s)||s===0)&&(s=1),Math.abs(o-1)<.01&&(o=1),Math.abs(s-1)<.01&&(s=1),n.transform=n.webkitTransform=`translate(${r/o}px,${i/s}px)`,n.transitionDuration=`0s`,e}}function Kl(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function ql(e,t,n){let r=e.cloneNode(),i=e[vu];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=gl(r);return a.removeChild(r),o}function Jl(e){e.target.composing=!0}function Yl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}function Xl(e,t,n){return t&&(e=e.trim()),n&&(e=Ie(e)),e}function Zl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(P(t))i=re(t,r.props.value)>-1;else if(pe(t))i=t.has(r.props.value);else{if(t===n)return;i=ne(t,eu(e,!0))}e.checked!==i&&(e.checked=i)}function Ql(e,t){let n=e.multiple,r=P(t);if(!(n&&!r&&!pe(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=$l(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):re(t,o)>-1}else a.selected=t.has(o)}else if(ne($l(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $l(e){return`_value`in e?e._value:e.value}function eu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}function tu(e,t){switch(e){case`SELECT`:return ad;case`TEXTAREA`:return nd;default:switch(t){case`checkbox`:return rd;case`radio`:return id;default:return nd}}}function nu(e,t,n,r,i){let a=tu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ru(){nd.getSSRProps=({value:e})=>({value:e}),id.getSSRProps=({value:e},t)=>{if(t.props&&ne(t.props.value,e))return{checked:!0}},rd.getSSRProps=({value:e},t)=>{if(P(e)){if(t.props&&re(e,t.props.value)>-1)return{checked:!0}}else if(pe(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},od.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=tu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}function iu(){return pd||=qa(fd)}function au(){return pd=md?pd:Ja(fd),md=!0,pd}function ou(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function su(e){return I(e)?document.querySelector(e):e}var cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd=o((()=>{if(sl(),sl(),xt(),cu=void 0,lu=typeof window<`u`&&window.trustedTypes,lu)try{cu=lu.createPolicy(`vue`,{createHTML:e=>e})}catch{}uu=cu?e=>cu.createHTML(e):e=>e,du=`http://www.w3.org/2000/svg`,fu=`http://www.w3.org/1998/Math/MathML`,pu=typeof document<`u`?document:null,mu=pu&&pu.createElement(`template`),hu={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?pu.createElementNS(du,e):t===`mathml`?pu.createElementNS(fu,e):n?pu.createElement(e,{is:n}):pu.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>pu.createTextNode(e),createComment:e=>pu.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>pu.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{mu.innerHTML=uu(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=mu.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},gu=`transition`,_u=`animation`,vu=Symbol(`_vtc`),yu={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bu=M({},Cs,yu),xu=e=>(e.displayName=`Transition`,e.props=bu,e),Su=xu((e,{slots:t})=>Vo(Es,ll(e),t)),Cu=(e,t=[])=>{P(e)?e.forEach(e=>e(...t)):e&&e(...t)},wu=e=>e?P(e)?e.some(e=>e.length>1):e.length>1:!1,Tu=0,Eu=Symbol(`_vod`),Du=Symbol(`_vsh`),Ou={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Eu]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):xl(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),xl(e,!0),r.enter(e)):r.leave(e,()=>{xl(e,!1)}):xl(e,t))},beforeUnmount(e,{value:t}){xl(e,t)}},ku=Symbol(``),Au=/(?:^|;)\s*display\s*:/,ju=/\s*!important$/,Mu=[`Webkit`,`Moz`,`ms`],Nu={},Pu=`http://www.w3.org/1999/xlink`,Fu=Symbol(`_vei`),Iu=/(Once|Passive|Capture)$/,Lu=/^on:?(?:Once|Passive|Capture)$/,Ru=0,zu=Promise.resolve(),Bu=()=>Ru||=(zu.then(()=>Ru=0),Date.now()),Vu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Hu=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?bl(e,r,o):t===`style`?El(e,n,r):ce(t)?le(t)||Pl(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Ll(e,t,r,o))?(jl(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Al(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Rl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!I(r)))?jl(e,Oe(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Al(e,t,r,o))},Uu={},Wu=((e,t)=>zl(e,t,vd)),Gu=typeof HTMLElement<`u`?HTMLElement:class{},Ku=class e extends Gu{constructor(e,t={},n=_d){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==_d?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(M({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,Fr(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!P(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Le(this._props[e])),(i||=Object.create(null))[Oe(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)N(this,e)||Object.defineProperty(this,e,{get:()=>z(t[e])})}_resolveProps(e){let{props:t}=e,n=P(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(Oe))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):Uu,r=Oe(e);t&&this._numberProps&&this._numberProps[r]&&(n=Le(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===Uu?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(Ae(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(Ae(e),t+``):t||this.removeAttribute(Ae(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),hd(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=q(this._def,M(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,Se(t[0])?M({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),Ae(e)!==e&&t(Ae(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){let e=this._slots={},t;for(;t=this.firstChild;){let n=t.nodeType===1&&t.getAttribute(`slot`)||`default`;(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){let e=this._getSlots(),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let r=e[n],i=r.getAttribute(`name`)||`default`,a=this._slots[i],o=r.parentNode;if(a)for(let e of a){if(t&&e.nodeType===1){let n=t+`-s`,r=document.createTreeWalker(e,1);e.setAttribute(n,``);let i;for(;i=r.nextNode();)i.setAttribute(n,``)}o.insertBefore(e,r)}else for(;r.firstChild;)o.insertBefore(r.firstChild,r);o.removeChild(r)}}_getSlots(){let e=[this];this._teleportTargets&&e.push(...this._teleportTargets);let t=new Set;for(let n of e){let e=n.querySelectorAll(`slot`);for(let n=0;n<e.length;n++)t.add(e[n])}return Array.from(t)}_injectChildStyle(e,t){this._applyStyles(e.styles,e,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(e){}},qu=new WeakMap,Ju=new WeakMap,Yu=Symbol(`_moveCb`),Xu=Symbol(`_enterCb`),Zu=e=>(delete e.props.mode,e),Qu=Zu({name:`TransitionGroup`,props:M({},bu,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Gc(),r=ui(),i,a;return Xs(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!ql(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Ul),i.forEach(Wl);let r=i.filter(Gl);yl(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;fl(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[Yu]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[Yu]=null,pl(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=pn(e),s=ll(o),c=o.tag||K;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[Du]&&(i.push(t),gi(t,pi(t,s,r,n)),qu.set(t,Kl(t.el)))}a=t.default?_i(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&gi(t,pi(t,s,r,n))}return q(c,null,a)}}}),$u=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return P(t)?e=>Pe(t,e):t},ed=Symbol(`_assign`),td=Symbol(`_initialValue`),nd={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[td]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[td]=e.defaultValue.replace(/\r\n?/g,`
5
- `))),e[ed]=$u(i);let a=r||i.props&&i.props.type===`number`;Ml(e,t?`change`:`input`,t=>{t.target.composing||e[ed](Xl(e.value,n,a))}),(n||a)&&Ml(e,`change`,()=>{e.value=Xl(e.value,n,a)}),t||(Ml(e,`compositionstart`,Jl),Ml(e,`compositionend`,Yl),Ml(e,`change`,Yl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[td];delete e[td],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[ed](Xl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[ed]=$u(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?Ie(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},rd={deep:!0,created(e,t,n){e[ed]=$u(n),Ml(e,`change`,()=>{let t=e._modelValue,n=$l(e),r=e.checked,i=e[ed];if(P(t)){let e=re(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(pe(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(eu(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[ed]=$u(n),Zl(e,t,n)}},id={created(e,{value:t},n){e.checked=ne(t,n.props.value),e[ed]=$u(n),Ml(e,`change`,()=>{e[ed]($l(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[ed]=$u(r),t!==n&&(e.checked=ne(t,r.props.value))}},ad={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Ml(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Ie($l(e)):$l(e));e[ed](e.multiple?pe(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Fr(()=>{e._assigning=!1})}),e[ed]=$u(r)},mounted(e,{value:t}){Ql(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ed]=$u(n)},updated(e,{value:t}){e._assigning||Ql(e,t)}},od={created(e,t,n){nu(e,t,n,null,`created`)},mounted(e,t,n){nu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){nu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){nu(e,t,n,r,`updated`)}},sd=[`ctrl`,`shift`,`alt`,`meta`],cd={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>sd.some(n=>e[`${n}Key`]&&!t.includes(n))},ld=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=cd[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ud={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},dd=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=Ae(n.key);if(t.some(e=>e===r||ud[e]===r))return e(n)}))},fd=M({patchProp:Hu},hu),md=!1,hd=((...e)=>{iu().render(...e)}),gd=((...e)=>{au().hydrate(...e)}),_d=((...e)=>{let t=iu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=su(e);if(!r)return;let i=t._component;!F(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,ou(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),vd=((...e)=>{let t=au().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=su(e);if(t)return n(t,!0,ou(t))},t}),yd=!1,bd=()=>{yd||(yd=!0,ru(),Sl())}}));xd();function Sd(e){return e?{nodes:e.nodes||{},trees:e.trees||{},blocks:e.blocks||{},nodeLayouts:e.nodeLayouts||{},blockLayouts:e.blockLayouts||{},channels:e.channels||{}}:{nodes:{},trees:{},blocks:{},nodeLayouts:{},blockLayouts:{},channels:{}}}function Cd(e){return Sd(e).nodes}function wd(e){return Sd(e).trees}function Td(e){return Sd(e).blocks}function Ed(e){return Sd(e).nodeLayouts}function Dd(e){return Sd(e).blockLayouts}function Od(e){return Sd(e).channels}var kd=R(!1),Ad=R(`Unsaved Changes`),jd=R(`You have unsaved changes. Are you sure you want to discard them?`),Md=R(`Discard Changes`),Nd=R(`Keep Editing`),Pd;function Fd(){return{isOpen:kd,title:Ad,message:jd,confirmLabel:Md,cancelLabel:Nd,confirmDiscard:(e,t,n,r)=>(e&&(jd.value=e),t&&(Ad.value=t),Md.value=n||`Discard Changes`,Nd.value=r||`Keep Editing`,kd.value=!0,new Promise(e=>{Pd=e})),handleConfirm:()=>{kd.value=!1,Pd&&Pd(!0)},handleCancel:()=>{kd.value=!1,Pd&&Pd(!1)}}}var Id=`kama_cms_offline_queue`,Ld=new Map,Rd=new Map,zd=R({hasConflict:!1,nodeId:null,serverData:null});function Bd(){let{isPendingOfflineSave:e,isDocumentUnverified:t}=sp(),n=()=>{if(typeof window>`u`)return{};try{let e=localStorage.getItem(Id);return e?JSON.parse(e):{}}catch(e){return console.warn(`⚠️ Failed to parse offline queue from LocalStorage:`,e),{}}},r=(t,r)=>{if(!(typeof window>`u`))try{let i=n();i[String(t)]={data:JSON.parse(JSON.stringify(r)),timestamp:Date.now()},localStorage.setItem(Id,JSON.stringify(i)),e.value=!0}catch(e){console.error(`❌ Failed to persist offline draft to storage:`,e)}},i=e=>n()[String(e)]||null,a=t=>{if(!(typeof window>`u`))try{let r=n();delete r[String(t)],localStorage.setItem(Id,JSON.stringify(r));let i=Object.keys(r);e.value=i.length>0}catch(e){console.warn(`⚠️ Failed to clear offline draft from storage:`,e)}},o=e=>{t.value=e},s=async t=>{let r=n(),i=Object.keys(r);if(i.length===0){e.value=!1;return}e.value=!0;for(let e of i)try{await t(e)&&a(e)}catch(t){console.error(`❌ Auto-sync failed for node ${e}:`,t)}let o=Object.keys(n());e.value=o.length>0},c=e=>Ld.get(String(e)),l=(e,t)=>{Ld.set(String(e),{node:JSON.parse(JSON.stringify(t.node)),blocks:JSON.parse(JSON.stringify(t.blocks)),regionMeta:JSON.parse(JSON.stringify(t.regionMeta))}),String(zd.value.nodeId)===String(e)&&h()},u=e=>{Ld.delete(String(e)),a(e)},d=()=>{Ld.clear(),Rd.clear()},f=e=>Rd.get(e),p=(e,t)=>{Rd.set(e,JSON.parse(JSON.stringify(t)))},m=e=>{Rd.clear();let t=String(e);for(let[e]of Ld.entries())e!==t&&Ld.delete(e)},h=()=>{zd.value={hasConflict:!1,nodeId:null,serverData:null}};return{conflictState:zd,getCachedDocument:c,saveToCache:l,clearCache:u,clearEntireCache:d,invalidateAfterSave:m,clearConflict:h,evaluateServerResponse:(e,t,n)=>{let r=c(e);if(i(e))return zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`};if(!r)return n?(zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`}):{action:`update_silently`};let a=new Date(r.node.updatedAt||0).getTime();return new Date(t.node.updatedAt||0).getTime()>a&&n?(zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`}):{action:`update_silently`}},resolveWithServer:e=>{if(!zd.value.serverData||!zd.value.nodeId)return;let t=zd.value.serverData,n=zd.value.nodeId;a(n),l(String(n),t),e(t),h()},resolveWithLocal:()=>{h()},getCachedInheritedRegion:f,setCachedInheritedRegion:p,persistOfflineDraft:r,getPersistedOfflineDraft:i,clearPersistedOfflineDraft:a,processOfflineQueue:s,markUnverified:o}}var Vd={"Content-Type":`application/json`},Hd={async getNode(e){return fetch(`/api/cms/nodes.json?id=${e}`)},async getInheritedRegion(e,t,n,r){let i=r?`&channelId=${r}`:``;return fetch(`/api/v1/node/${encodeURIComponent(e)}?treeId=${t}&lang=${n}&preview=true${i}`)},async saveNode(e){return fetch(`/api/cms/nodes.json`,{method:`POST`,headers:Vd,body:JSON.stringify({node:e})})},async createInTree(e){return fetch(`/api/cms/tree.json`,{method:`POST`,headers:Vd,body:JSON.stringify(e)})},async publishNode(e){return fetch(`/api/cms/nodes/publish`,{method:`POST`,headers:Vd,body:JSON.stringify({id:e})})},async deleteNode(e){return fetch(`/api/cms/nodes.json?id=${e}`,{method:`DELETE`})},async restoreNode(e){return fetch(`/api/cms/nodes/restore`,{method:`POST`,headers:Vd,body:JSON.stringify({id:e})})},async purgeNode(e){return fetch(`/api/cms/nodes/purge?id=${e}`,{method:`DELETE`})},async toggleVisibility(e,t){return fetch(`/api/cms/nodes.json`,{method:`POST`,headers:Vd,body:JSON.stringify({node:{id:e,isHidden:t}})})},async getNodeRevisions(e){return fetch(`/api/cms/nodes/${e}/revisions`)},async getSnapshot(e,t){return fetch(`/api/cms/nodes/${e}/revisions/${t}`)},async restoreSnapshot(e,t){return fetch(`/api/cms/nodes/${e}/revisions/${t}/restore`,{method:`POST`,headers:Vd})}},Ud=R(typeof navigator<`u`&&!navigator.onLine),Wd=R(Ud.value?`offline`:`online`),Gd=R(!1),Kd=R(!1),qd=R(null),Jd=R(!1),Yd=R(!1),Xd=R(null),Zd=R(null);typeof window<`u`&&(window.addEventListener(`online`,()=>{Ud.value=!1,Wd.value=`online`;let e=Bd();e.processOfflineQueue(async t=>{try{let n=e.getPersistedOfflineDraft(t);if(!n)return!0;let r=n.data,i=[];Object.entries(r.blocks||{}).forEach(([e,t])=>{r.regionMeta?.[e]?.isInherited||t.forEach((t,n)=>{i.push({instanceId:String(t.instanceId||t.id),componentId:t.componentId||t.elementType||`text-block`,elementType:t.componentId||t.elementType||`text-block`,region:e,sortOrder:n,data:t.data||{}})})});let a={id:typeof t==`number`?t:Number(t)||null,...r.node,blocks:i};return delete a.isNew,delete a._draftParentId,delete a._isTreeDraft,delete a.trees,(await Hd.saveNode(a)).ok}catch{return!1}})}),window.addEventListener(`offline`,()=>{Ud.value=!0,Wd.value=`offline`}));var Qd=R({type:`dashboard`}),$d=R(`none`),ef=R(`content`),tf=R(!1),nf=R([]),rf=R(null),af=R(``),of=R(null),sf=R([]),cf=R(null),lf=R(``),uf=R([]),df=R([]),ff=R(`all`),pf=R(``),mf=R(`updatedAt`),hf=R(`DESC`),gf=R(null),_f=R({}),vf=R(null),yf=R(null),bf=R({}),xf=R({}),Sf=R({}),Cf=R({}),wf=R({}),Tf=R(!1),Ef=R(!1),Df=R(!1),Of=()=>({id:``,title:``,slug:``,nodeType:`node`,channelId:``,language:null,isHidden:!1,status:`draft`,publishedAt:null,children:[],disabledRegions:{}}),kf=R(Of()),Af=R({}),jf=R({}),Mf=R(null),Nf=R({}),Pf=R(``),Ff=R(``),If=R(``),Lf=R({total:0,byType:[]}),Rf=R(!1),zf=()=>{Rf.value=!1},Bf=J(()=>Qd.value.type===`dashboard`?`none`:Qd.value.type),Vf=J(()=>Qd.value.type===`node`&&Qd.value.id||null),Hf=J(()=>Gd.value),Uf=J(()=>Xd.value!==null),Wf=(e,t)=>{if(!e)return{};let n={};for(let[t,r]of Object.entries(e))t!==`isHidden`&&t!==`hidden`&&t!==`is_hidden`&&t!==`channels`&&t!==`trees`&&t!==`hasUnpublishedChanges`&&t!==`status`&&(n[t]=r&&typeof r==`object`&&typeof r.id==`string`&&r.id.startsWith(`ast_`)?r.id:r);let r=e.nodeType||e.contentType,i=r?t[r]:null;if(i?.fields)for(let[e,t]of Object.entries(i.fields))t?.liveSync===!0&&delete n[e];return n},Gf=J(()=>{if(Df.value||Uf.value||!Pf.value)return!1;let e=JSON.stringify({node:Wf(kf.value,xf.value),blocks:Af.value}),t=JSON.parse(Pf.value||`{}`);return e!==JSON.stringify({node:Wf(t.node||{},xf.value),blocks:t.blocks||{}})}),Kf=J(()=>!Ff.value||!rf.value?!1:JSON.stringify(rf.value)!==Ff.value),qf=J(()=>!If.value||!cf.value?!1:JSON.stringify(cf.value)!==If.value),Jf=J(()=>Uf.value||!kf.value?.id?!1:kf.value.hasUnpublishedChanges===!0||kf.value.status===`draft`||Gf.value),Yf=async()=>{let{confirmDiscard:e}=Fd(),t=kf.value?.isNew===!0&&String(kf.value?.id||``).startsWith(`draft-`),n=!!(kf.value?.title||``).trim(),r=Object.values(Af.value||{}).some(e=>e.length>0),i=n||r,a=Gf.value&&(!t||i);return Bf.value===`node`&&(a||Kd.value)?await e(`You have unsaved changes on the active document. Are you sure you want to discard them?`,`Discard Document Changes?`,`Discard Changes`,`Keep Editing`):!0},Xf=async(e,t=!1)=>{!t&&Xd.value===null&&!await Yf()||(Qd.value=e,Xd.value=null,Zd.value=null,e.type===`channel`||e.type===`tree`?ef.value=`settings`:e.type===`node`&&(ef.value=`content`),e.type!==`node`&&(kf.value=Of(),Pf.value=``,Af.value={}),e.type!==`channel`&&(rf.value=null,Ff.value=``),e.type!==`tree`&&(cf.value=null,If.value=``))},Zf=async(e,t=!1)=>{e===`none`?($d.value=`none`,await Xf({type:`dashboard`},t)):((e===`tree`||e===`channel`)&&($d.value=e),await Xf({type:e},t))},Qf=(e=!1)=>Zf(`none`,e),$f=(e,t=`vault`,n=!1)=>{$d.value=t,Xf({type:`node`,id:e},n)},ep=(e,t=!1)=>{$d.value=`channel`,Xf({type:`channel`,id:e},t)},tp=(e,t=!1)=>{$d.value=`tree`,Xf({type:`tree`,id:e},t)},np=(e=!1)=>{$d.value=`none`,Xf({type:`publisher`},e)},rp=()=>{kf.value=Of(),Af.value={},jf.value={},Mf.value=null,Nf.value={},Pf.value=``,Df.value=!1,Gd.value=!1,Xd.value=null,Zd.value=null},ip=(e,t,n)=>{if(!e&&!n)return;let r=t=>e&&String(t.id)===String(e)||n&&t.treeNodeId&&String(t.treeNodeId)===String(n);kf.value&&r(kf.value)&&Object.assign(kf.value,t);let i=e=>{if(Array.isArray(e))for(let n=0;n<e.length;n++)r(e[n])&&Object.assign(e[n],t),e[n].children&&e[n].children.length>0&&i(e[n].children)};if(i(uf.value),Array.isArray(df.value))for(let e=0;e<df.value.length;e++)r(df.value[e])&&Object.assign(df.value[e],t)},ap=e=>{e.nodes&&(xf.value=e.nodes),e.trees&&(bf.value=e.trees),e.channels&&(_f.value=e.channels),(e.blocks||e.elements)&&(Sf.value=e.blocks||e.elements),Cf.value=e.nodeLayouts&&Object.keys(e.nodeLayouts).length>0?e.nodeLayouts:Ed(),wf.value=e.blockLayouts&&Object.keys(e.blockLayouts).length>0?e.blockLayouts:Dd(),e.channelTemplate!==void 0&&(gf.value=e.channelTemplate),e.userTemplate!==void 0&&(vf.value=e.userTemplate),e.treeTemplate!==void 0&&(yf.value=e.treeTemplate),Ef.value=!0},op=async(e=`/api/cms/schemas.json`)=>{if(!Tf.value){Tf.value=!0;try{let t=await fetch(e,{headers:{Accept:`application/json`}});if(!t.ok)throw Error(`Failed to load schemas`);ap(await t.json())}catch(e){console.warn(`⚠️ API failed to load schemas, using local fallbacks`,e),xf.value=Cd(),bf.value=wd(),_f.value=Od(),Sf.value=Td(),Cf.value=Ed(),wf.value=Dd(),Ef.value=!0}finally{Tf.value=!1}}};function sp(){return{isOffline:Ud,connectionStatus:Wd,isDocumentUnverified:Gd,isPendingOfflineSave:Kd,isReadOnlyMode:Hf,isSnapshotMode:Uf,isSaving:Jd,isAutoSavePending:Yd,blockClipboard:qd,activeSnapshotVersion:Xd,draftBackup:Zd,activeView:Qd,activeViewMode:Bf,activeContentId:Vf,workspaceContext:$d,setViewMode:Zf,navigateTo:Xf,goToDashboard:Qf,openNode:$f,openChannel:ep,openTree:tp,openPublisher:np,activeTab:ef,shouldFocusTitle:tf,allChannels:nf,activeChannelSettings:rf,selectedChannelId:af,selectedLanguage:of,availableTrees:sf,activeTreeSettings:cf,selectedTreeId:lf,nodeTree:uf,vaultNodes:df,currentVaultType:ff,currentVaultSearch:pf,currentVaultSort:mf,currentVaultOrder:hf,channelTemplateSchema:gf,channelSchemas:_f,userTemplateSchema:vf,treeTemplateSchema:yf,treeSchemas:bf,nodeSchemas:xf,blockSchemas:Sf,nodeLayoutSchemas:Cf,blockLayoutSchemas:wf,isSchemasLoading:Tf,isSchemasLoaded:Ef,setSchemas:ap,fetchSchemas:op,isDocumentLoading:Df,activeNode:kf,resetActiveNode:rp,isNodeDirty:Gf,isChannelDirty:Kf,isTreeDirty:qf,hasUnpublishedChanges:Jf,nodeSnapshot:Pf,channelSnapshot:Ff,siteSnapshot:Ff,treeSnapshot:If,updateNodeInState:ip,blocks:Af,regionMeta:jf,selectedBlock:Mf,validationErrors:Nf,vaultStats:Lf,hasLoadedStats:Rf,invalidateStats:zf,confirmDiscardUnsaved:Yf}}var cp=e=>e==null||typeof e==`string`&&e.trim()===``,lp={required:(e,t,n)=>(t===!0||String(t).toLowerCase()===`true`)&&cp(e)?n.rules?.customMessage||`${n.label||`This field`} is required.`:``,min:(e,t,n)=>cp(e)||typeof t!=`number`?``:typeof e==`number`&&e<t?n.rules?.customMessage||`${n.label||`Field`} must be at least ${t}.`:typeof e==`string`&&e.length<t?n.rules?.customMessage||`${n.label||`Field`} must be at least ${t} characters.`:``,max:(e,t,n)=>cp(e)||typeof t!=`number`?``:typeof e==`number`&&e>t?n.rules?.customMessage||`${n.label||`Field`} cannot exceed ${t}.`:typeof e==`string`&&e.length>t?n.rules?.customMessage||`${n.label||`Field`} cannot exceed ${t} characters.`:``,email:(e,t,n)=>t!==!0&&String(t).toLowerCase()!==`true`||cp(e)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))?``:n.rules?.customMessage||`Please enter a valid email address.`,pattern:(e,t,n)=>{if(cp(e)||!t||typeof t!=`string`)return``;try{if(!new RegExp(t).test(String(e)))return n.rules?.customMessage||`${n.label||`Field`} format is invalid.`}catch{console.warn(`[Validators] Invalid pattern for ${n.label||`field`}:`,t)}return``},unique:async(e,t,n,r)=>(t!==!0&&String(t).toLowerCase()!==`true`||cp(e),``),uniqueSibling:async(e,t,n,r)=>(t!==!0&&String(t).toLowerCase()!==`true`||cp(e),``)};function up(e,t){lp[e]=t}function dp(){let e=Object.assign({"../../definitions/validators/iban.ts":f,"../../definitions/validators/magic-word.ts":m});for(let t in e){let n=e[t];if(!n)continue;let r=t.split(`/`).pop()?.replace(/\.ts$/,``)||``;for(let[e,t]of Object.entries(n))typeof t==`function`&&up(e==="default"?r:e,t)}}dp();function fp(e,t,n){if(!n||typeof n!=`object`)return``;let r=n.rules||{},i={fieldKey:e};if((n.required===!0||String(n.required).toLowerCase()===`true`||r.required===!0||String(r.required).toLowerCase()===`true`)&&cp(t))return r.customMessage||`${n.label||e} is required.`;for(let[e,a]of Object.entries(r)){if(e===`customMessage`||e===`uniqueMessage`||e===`unique`||e===`uniqueSibling`||e===`required`)continue;let r=lp[e];if(r){let e=r(t,a,n,i);if(typeof e==`string`&&e!==``)return e}}return``}async function pp(e,t,n,r){if(!n||typeof n!=`object`)return``;let i=fp(e,t,n);if(i)return i;let a={...n.rules};n.unique!==void 0&&a.unique===void 0&&(a.unique=n.unique);let o={fieldKey:e,entityType:r?.entityType,excludeId:r?.excludeId,formData:r?.formData};for(let[e,r]of Object.entries(a)){if(e===`customMessage`||e===`uniqueMessage`)continue;let i=lp[e];if(i){let e=await i(t,r,n,o);if(e)return e}}return``}function mp(e){for(let t in e){let n=e[t];if(n)for(let[e,t]of Object.entries(n))typeof t==`function`&&up(e,t)}}function hp(){let{validationErrors:e}=sp(),t=(e,t)=>{if(e)return t in e?e[t]:t.split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)};return{validateAgainstSchema:async(n,r,i)=>{let a={};if(!n||!r)return e.value=a,!0;let o={...r.fields||{}};if(r.tabs&&typeof r.tabs==`object`&&Object.values(r.tabs).forEach(e=>{e?.fields&&(Array.isArray(e.fields)?e.fields.forEach(e=>{typeof e==`object`&&e&&Object.entries(e).forEach(([e,t])=>{o[e]={...o[e]||{},...t}})}):typeof e.fields==`object`&&Object.entries(e.fields).forEach(([e,t])=>{o[e]={...o[e]||{},...t}}))}),Object.keys(o).length===0)return e.value=a,!0;let s=n.id,c=typeof s==`number`||s&&!String(s).startsWith(`draft-`)?String(s):``;for(let[e,r]of Object.entries(o)){if(!r||typeof r!=`object`)continue;let o=await pp(e,t(n,e),r,{entityType:i,excludeId:c,formData:n});o&&(a[e]=o)}return e.value=a,Object.keys(a).length===0}}}var gp=null,_p=null;function vp(){let{allChannels:e,selectedChannelId:t,availableTrees:n,channelSchemas:r,treeSchemas:i}=sp(),a=async()=>{gp?.abort(),gp=new AbortController;try{let[n,i]=await Promise.all([fetch(`/api/cms/schemas.json`,{signal:gp.signal}),fetch(`/api/cms/channels.json`,{signal:gp.signal})]);if(n.ok){let e=await n.json();e.channelSchemas&&(r.value=e.channelSchemas)}if(i.ok){let n=await i.json();e.value=n.channels||[],!t.value&&n.channels?.length>0&&(t.value=String(n.channels[0].id))}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;console.error(`[CMS Sync] Failed to fetch channels:`,e)}},o=async()=>{_p?.abort(),_p=new AbortController;try{let[e,t]=await Promise.all([fetch(`/api/cms/schemas.json`,{signal:_p.signal}),fetch(`/api/cms/trees.json`,{signal:_p.signal})]);if(e.ok){let t=await e.json();t.treeSchemas&&(i.value=t.treeSchemas)}if(t.ok){let e=await t.json();n.value=Array.isArray(e)?e:[]}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;console.error(`[CMS Sync] Failed to load trees:`,e)}};return{fetchChannels:a,fetchTrees:o,syncSystemMetadata:async()=>{await Promise.all([a(),o()])}}}function yp(e){return e===!0||e===1||String(e)===`true`||String(e)===`1`}function bp(e){if(!e)return{isDraft:!1,isUnpublishedDraft:!1,isHidden:!1,isScheduled:!1,isCurrentlyVisible:!1,hasUnpublishedChanges:!1,statusBadge:`active`,badgeLabel:`Unknown`};let t=!!(e.isNew||!e.id||String(e.id).startsWith(`draft-`)),n=!t&&e.status===`draft`&&!e.publishedAt,r=yp(e.isHidden)||yp(e.disabled),i=!t&&!n&&yp(e.hasUnpublishedChanges),a=e.startShowingAt?new Date(e.startShowingAt).getTime():null,o=e.stopShowingAt?new Date(e.stopShowingAt).getTime():null,s=!!(a||o),c=Date.now(),l=!0,u=`valid`;a&&c<a?(l=!1,u=`pending`):o&&c>o&&(l=!1,u=`expired`);let d=!t&&!n&&!r&&l,f=`active`,p=`Visible`;return t?(f=`draft`,p=`Unsaved`):n?(f=`unpublished_draft`,p=`Draft`):i?(f=`unpublished_changes`,p=`Unpublished Changes`):r?(f=`hidden`,p=`Hidden`):u===`pending`?(f=`scheduled_pending`,p=`Scheduled`):u===`expired`&&(f=`scheduled_expired`,p=`Expired`),{isDraft:t,isUnpublishedDraft:n,isHidden:r,isScheduled:s,isCurrentlyVisible:d,hasUnpublishedChanges:i,statusBadge:f,badgeLabel:p}}function xp(e,t){let n=e.value||{};return Object.keys(n).length===0&&(n=t(),e.value=n),n}function Sp(e,t){if(t&&e[t])return t;let n=Object.keys(e||{});return n.length===1?n[0]:``}function Cp(e,t){let n={...t?.fields||{},...e?.fields||{}};return e?.tabs&&typeof e.tabs==`object`&&Object.values(e.tabs).forEach(e=>{e?.fields&&typeof e.fields==`object`&&(n={...n,...e.fields})}),n}function wp(e){return Object.values(e||{}).map(e=>({value:e.id,label:e.label||e.id}))}function Tp(e,t=!1){let n=t?`label`:`title`;if(!e)return[{key:n,config:{type:`text`,label:`Page Title`}}];let r=Cp(e),i=[];if(e.titleTemplate){let t=[...e.titleTemplate.matchAll(/{([^}]+)}/g)];for(let e of t){let t=e[1].trim();if(!i.some(e=>e.key===t)){let e=r[t]||{type:`text`,label:t};i.push({key:t,config:{...e}})}}if(i.length>0)return i}return r[n]?[{key:n,config:{...r[n]}}]:[{key:n,config:{type:`text`,label:e.label||`Page Title`}}]}function Ep(e,t){if(!t)return`Untitled ${e?.label||`Node`}`;if(Cp(e).title&&t.title&&String(t.title).trim()!==``)return String(t.title).trim();if(e?.titleTemplate){let n=e.titleTemplate.replace(/{([^}]+)}/g,(e,n)=>{let r=t[n.trim()];return r==null?``:String(r)});if(n=n.replace(/\s+/g,` `).replace(/^[\s,\-]+|[\s,\-]+$/g,``).trim(),n)return n}return t.title&&String(t.title).trim()!==``?String(t.title).trim():`Untitled ${e?.label||`Node`}`}var Dp=(e,t)=>{if(!e)return{};let n={},r=e.nodeType||e.contentType,i=r?t[r]:null,a=new Set([`id`,`title`,`slug`,`nodeType`,`channelId`,`language`]);i&&(i.fields&&Object.entries(i.fields).forEach(([e,t])=>{t?.liveSync!==!0&&a.add(e)}),i.tabs&&Object.values(i.tabs).forEach(e=>{e.fields&&Object.entries(e.fields).forEach(([e,t])=>{t?.liveSync!==!0&&a.add(e)})}));let o=Object.keys(e).filter(e=>a.has(e)).sort();for(let t of o){let r=e[t];n[t]=r&&typeof r==`object`&&typeof r.id==`string`&&r.id.startsWith(`ast_`)?r.id:r}return n};function Op(){let e=sp(),{confirmDiscard:t}=Fd(),n=J(()=>{if(e.isDocumentLoading.value||e.isSnapshotMode.value||!e.nodeSnapshot.value)return!1;let t=JSON.parse(e.nodeSnapshot.value||`{}`),n=t.node||{};return e.activeNode.value.id===n.id&&JSON.stringify({node:Dp(e.activeNode.value,e.nodeSchemas.value),blocks:e.blocks.value})!==JSON.stringify({node:Dp(n,e.nodeSchemas.value),blocks:t.blocks||{}})}),r=J(()=>e.isSnapshotMode.value||!e.treeSnapshot.value||!e.activeTreeSettings.value?!1:JSON.stringify(e.activeTreeSettings.value)!==e.treeSnapshot.value),i=J(()=>e.isSnapshotMode.value||!e.channelSnapshot.value||!e.activeChannelSettings.value?!1:JSON.stringify(e.activeChannelSettings.value)!==e.channelSnapshot.value),a=J(()=>e.isSnapshotMode.value?!1:e.activeViewMode.value===`node`?n.value:e.activeViewMode.value===`tree`?r.value:e.activeViewMode.value===`channel`&&i.value);return{isNodeDirty:n,isTreeDirty:r,isChannelDirty:i,isGlobalDirty:a,confirmNavigation:async()=>!a.value||await t(`You have unsaved changes. If you leave, your changes will be lost.`,`Discard unsaved changes?`,`Discard Changes`,`Cancel`)}}var kp=0,Ap=0,jp=R({});function Mp(){let{allChannels:e,selectedChannelId:t,selectedLanguage:n,availableTrees:r,activeTreeSettings:i,selectedTreeId:a,nodeTree:o,vaultNodes:s,treeTemplateSchema:c,treeSchemas:l,activeNode:u,blocks:d,regionMeta:f,selectedBlock:p,validationErrors:m,nodeSnapshot:h,treeSnapshot:g,activeTab:_,shouldFocusTitle:v,setViewMode:y,currentVaultType:b,currentVaultSearch:x,currentVaultSort:S,currentVaultOrder:C}=sp(),{validateAgainstSchema:w}=hp(),{fetchTrees:T,fetchChannels:E,syncSystemMetadata:D}=vp(),{confirmNavigation:O}=Op(),k=R(!1),ee=R(!0),A=R(0),te=()=>xp(l,wd),ne=()=>{g.value=JSON.stringify(i.value||{})},re=J(()=>{if(!t.value||t.value===`all`)return r.value.map(e=>({id:e.id,key:e.key,label:e.label||e.key||`Tree ${e.id}`}));let n=e.value.find(e=>String(e.id)===String(t.value));return!n||!Array.isArray(n.trees)?[]:n.trees.map(e=>{let t=typeof e==`object`?e.treeId||e.id:e;if(!t)return null;let n=r.value.find(e=>String(e.id)===String(t)||e.key===t);return n?{id:n.id,key:n.key,label:n.label||n.key||`Tree ${n.id}`}:null}).filter(Boolean)}),ie=(e,t,n=null)=>{for(let r of e){if(String(r.id)===String(t))return n;if(r.children&&r.children.length>0){let e=ie(r.children,t,r);if(e)return e}}return null},j=(e,t)=>{if(!e||!Array.isArray(e))return!1;for(let n of e){if(String(n.id)===String(t.id))return n.disabledRegions={...t.disabledRegions||{}},t.channels&&(n.channels=t.channels),t.title!==void 0&&(n.title=t.title),t.slug!==void 0&&(n.slug=t.slug),t.isHidden!==void 0&&(n.isHidden=yp(t.isHidden)),t.status!==void 0&&(n.status=t.status),t.isDraft!==void 0&&(n.isDraft=yp(t.isDraft)),t.draftDataJson!==void 0&&(n.draftDataJson=t.draftDataJson),t.dataJson!==void 0&&(n.dataJson=t.dataJson),!0;if(n.children&&n.children.length>0&&j(n.children,t))return!0}return!1},ae=J(()=>u.value?.id?!!ie(o.value,u.value.id):!1),oe=e=>jp.value[e]||[],se=async e=>{if(e)try{let r=t.value&&t.value!==`all`?`&channelId=${t.value}`:``,i=await fetch(`/api/cms/tree.json?treeId=${e}&lang=${n.value}&preview=true${r}`);if(i.ok){let t=await i.json(),n=Array.isArray(t)?t:t.tree||[],r=new Set,s=[];for(let e of n){if(e.deletedAt&&String(e.deletedAt).trim()!==``)continue;let t=String(e.id);r.has(t)||(r.add(t),s.push({...e,isHidden:yp(e.isHidden),isDraft:e.isDraft===void 0?void 0:yp(e.isDraft)}))}jp.value[e]=s,String(e)===String(a.value)&&(o.value=s)}}catch(t){console.error(`[CMS] Failed to fetch nodes for tree ${e}:`,t)}},ce=async()=>{if(!a.value){o.value=[];return}++kp,await se(a.value)},le=async(e,r)=>{jp.value[e]=r,String(e)===String(a.value)&&(o.value=r);try{let i={treeId:e,language:n.value,tree:r};t.value&&t.value!==`all`&&(i.channelId=t.value);let a=await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(`[Tree Save] HTTP ${a.status}: ${e.error||`Unknown error`}`)}}catch(t){throw console.error(`[Tree Sync] Failed to save node order for tree ${e}:`,t),t}},M=async()=>{a.value&&await le(a.value,jp.value[a.value]||o.value)},ue=async e=>{let n=!1,r=``,i=``;typeof e==`string`?(b.value=e,n=!0):e&&typeof e==`object`&&(n=e.reset??!1,e.type!==void 0&&(b.value=e.type),e.search!==void 0&&(x.value=e.search),e.sort!==void 0&&(S.value=e.sort),e.order!==void 0&&(C.value=e.order),e.ensureItemId&&(r=e.ensureItemId),e.assetId&&(i=e.assetId));let a=Array.isArray(b.value)&&b.value.length>0?b.value.join(`,`):b.value||`all`,o=x.value||``;if(!n&&k.value||!n&&!ee.value)return;let c=++Ap;n&&(A.value=0,ee.value=!0,s.value=[]),k.value=!0;try{let e=new URLSearchParams({limit:`50`,offset:String(A.value),sort:S.value,order:C.value});a&&a!==`all`&&e.append(`type`,a),o.trim()&&e.append(`q`,o.trim()),t.value&&t.value!==`all`&&e.append(`channelId`,t.value),r&&e.append(`ensureItemId`,r),i&&e.append(`assetId`,i);let l=await fetch(`/api/cms/nodes.json?${e.toString()}`);if(c!==Ap)return;if(!l.ok)throw Error(`Failed to fetch vault nodes (${l.status})`);let u=await l.json(),d=(Array.isArray(u)?u:u.items||[]).map(e=>({...e,isHidden:yp(e.isHidden)}));ee.value=!Array.isArray(u)&&!!u.hasMore,s.value=n?d:[...s.value,...d],A.value+=d.length}catch(e){c===Ap&&console.error(`[CMS] Failed to fetch vault nodes:`,e)}finally{c===Ap&&(k.value=!1)}},de=async n=>{if(!t.value||t.value===`all`)return;let i=e.value.findIndex(e=>String(e.id)===String(t.value));if(i>-1){let t=e.value[i],o=Array.isArray(t.trees)?[...t.trees]:[],s=r.value.find(e=>String(e.id)===String(n)||e.key===n),c=s?s.id:n,l=s?s.key:String(n);o.some(e=>String(typeof e==`object`?e.treeId||e.id:e)===String(c)||(typeof e==`object`?e.treeId||e.id:e)===l)||(o.push({treeId:c,key:l}),(await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,trees:o})})).ok&&await E()),a.value=String(c),await ce()}},N=async n=>{if(!t.value||t.value===`all`)return;let r=e.value.findIndex(e=>String(e.id)===String(t.value));if(r>-1){let t={...e.value[r]};Array.isArray(t.trees)&&(t.trees=t.trees.filter(e=>String(typeof e==`object`?e.treeId||e.id:e)!==String(n)),await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),await E());let i=re.value;a.value=i.length>0?String(i[0].id):``,await ce()}},P=async(n,r)=>{if(!t.value||t.value===`all`)return;let i=e.value.findIndex(e=>String(e.id)===String(t.value));if(i>-1){let t={...e.value[i]},a=Array.isArray(t.trees)?[...t.trees]:[];if(n<0||n>=a.length||r<0||r>=a.length)return;let[o]=a.splice(n,1);a.splice(r,0,o),t.trees=a,e.value[i]=t;try{await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}catch(e){console.error(`Failed to reorder channel trees:`,e)}}},fe=async()=>{i.value=null,g.value=``,await y(`none`,!0)};return{currentChannelTrees:re,hasParentNode:ae,isLoading:k,hasMore:ee,treeNodesMap:jp,getNodesForTree:oe,fetchNodeTreeForId:se,saveTreeOrderForId:le,reorderChannelTrees:P,fetchTrees:T,fetchNodeTree:ce,fetchVaultNodes:ue,linkTreeToChannel:de,unlinkTreeFromChannel:N,handleAddNewTree:async()=>{if(!await O())return!1;let e=te(),n=Sp(e),r={id:`draft-${Date.now()}`,isNew:!0,key:``,label:``,treeType:n,channels:t.value&&t.value!==`all`?[Number(t.value)||t.value]:[]};if(n&&e[n]){let t=Cp(e[n],c.value);for(let[e,n]of Object.entries(t))r[e]===void 0&&(r[e]=n?.default??``)}return i.value=r,ne(),m.value={},await y(`tree`,!0),!0},cancelNewTree:fe,saveTreeSettings:async()=>{if(!i.value)return!1;m.value={};let e=te(),n=!i.value.id||String(i.value.id).startsWith(`draft-`),r=i.value.treeType||Object.keys(e)[0]||`navigation`,o=e[r]||{};if(!await w(i.value,{fields:Cp(o,c.value)},`tree`))return!1;try{let e=i.value.id,o={...JSON.parse(JSON.stringify(i.value)),id:n?null:typeof e==`number`?e:Number(e)||null,treeType:r};delete o.isNew;let s=await fetch(`/api/cms/trees.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(s.ok){let e=(await s.json()).id;return i.value.id=e,i.value.treeType=r,delete i.value.isNew,await D(),ne(),n&&t.value&&t.value!==`all`?await de(e):(a.value=String(e),await ce()),await y(`tree`,!0),!0}{let e=await s.json().catch(()=>({}));return s.status===409&&e.field&&(m.value={[e.field]:e.error||`This key is already in use.`}),!1}}catch(e){return console.error(`[CMS] Error saving tree settings:`,e),!1}},deleteTree:async t=>{let n=t||i.value?.id;if(n){if(String(n).startsWith(`draft-`)){await fe();return}try{let t=await fetch(`/api/cms/trees.json?id=${n}`,{method:`DELETE`});if(t.ok){i.value=null,e.value.forEach(e=>{Array.isArray(e.trees)&&(e.trees=e.trees.filter(e=>{let t=typeof e==`object`?e.treeId||e.id:e;return String(t)!==String(n)}))}),await D();let t=re.value;if(t.length>0){let e=String(t[0].id);a.value=e,await ce()}else a.value=``,o.value=[],await y(`none`,!0)}else{let e=await t.json().catch(()=>({}));alert(`Failed to delete tree. ${e.error||`Check server console.`}`)}}catch{alert(`Network error: Could not reach server to delete the tree.`)}}},saveTreeOrder:M,attachVaultNodeToTree:async(e,r=null)=>{if(!a.value)return alert(`Please select a Navigation Tree before attaching content.`);try{let i={action:`attach`,contentId:e,treeId:a.value,language:n.value,parentId:r?r.id:null};t.value&&t.value!==`all`&&(i.channelId=t.value),(await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)})).ok&&(await ce(),await ue({reset:!0,ensureItemId:String(e)}))}catch(e){console.error(`[CMS] Failed to attach vault node to tree:`,e)}},detachTreeNode:async e=>{try{(await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`detach`,contentId:e,treeId:a.value})})).ok&&await ce()}catch(e){console.error(`[CMS] Failed to detach tree node:`,e)}},findParentNodeInTree:ie,updateNodeInTree:j,handleTreeChange:async e=>{if(e?.added?.element?._isNew){if(!await y(`node`))return;let n=e.added.element;delete n._isNew,d.value={},f.value={},p.value=null;let r=yp(n.isHidden),i={...n,parentId:null,isHidden:r,status:`draft`,blocks:[]};t.value&&t.value!==`all`&&(i.channels=[t.value]);let a=await fetch(`/api/cms/nodes.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});if(a.ok){let e=await a.json();n.id=e.id,n.treeNodeId=e.id}u.value={...n,isHidden:r,status:`draft`,isNew:!1,disabledRegions:{}},_.value=`content`,v.value=!0,h.value=JSON.stringify({node:u.value,blocks:d.value})}await M()},openTreeSettings:async e=>{if(!await O())return!1;let n=r.value.find(t=>String(t.id)===String(e)||t.key===e),o=n?.treeType||n?.type||Object.keys(l.value||{})[0]||`navigation`;return i.value=n?{...n,treeType:o,channels:Array.isArray(n.channels)?[...n.channels]:[]}:{id:null,key:String(e),label:String(e),treeType:o,channels:t.value&&t.value!==`all`?[Number(t.value)||t.value]:[]},a.value=String(n?n.id:e),ne(),m.value={},await y(`tree`,!0),!0},checkUnsavedChanges:O,updateTreeSnapshot:ne}}function Np(e){if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)e[t].isNew||String(e[t].id).startsWith(`draft-`)?e.splice(t,1):e[t].children&&e[t].children.length>0&&Np(e[t].children)}function Pp(){let e=sp(),t=Mp(),{confirmNavigation:n}=Op(),r=()=>null,i=async()=>{if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let t=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,i={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:t,channels:t?[t]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:null,_isTreeDraft:!0,disabledRegions:{}};e.nodeTree.value.push(i),e.activeNode.value=i,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!0,Jp(e)},a=async t=>{if(!t)return;let n=t.dataJson||t,r=t.id;if(r&&!String(r).startsWith(`draft-`))try{let e=await Hd.getNode(r);if(e.ok){let t=await e.json();t&&t.node&&(n=t.node)}}catch{console.warn(`Failed to fetch full parent data for draft inheritance`)}if(n&&typeof n==`object`){let t=JSON.parse(JSON.stringify(n));t.subpageLayoutId&&t.subpageLayoutId!==`inherit`&&(e.activeNode.value.resolvedLayoutId=t.subpageLayoutId);let r=new Set([`id`,`treeNodeId`,`contentId`,`parentId`,`_draftParentId`,`title`,`slug`,`children`,`isNew`,`nodeType`,`status`,`disabledRegions`,`layoutId`,`subpageLayoutId`,`createdAt`,`updatedAt`,`publishedAt`,`createdById`,`updatedById`,`trees`,`channels`,`language`]);Object.entries(t).forEach(([t,n])=>{!r.has(t)&&n!=null&&(e.activeNode.value[t]===void 0||e.activeNode.value[t]===``)&&(e.activeNode.value[t]=n)})}try{let{resolveInheritedRegion:r}=Yp(),i=String(e.selectedChannelId.value||``),a=n.subpageLayoutId;(!a||a===`inherit`)&&(a=n.resolvedLayoutId||n.layoutId);let o=a?e.nodeLayoutSchemas.value[a]:null,s=[];if(o?.regions)for(let[e,t]of Object.entries(o.regions)){let n=t.inherit||t.inherited;(n===`parent`||n===!0||String(n).toLowerCase()===`true`)&&s.push(e)}for(let n of s){let a=await r(t,n,i,``);a&&a.blocks&&a.blocks.length>0&&(e.blocks.value[n]=JSON.parse(JSON.stringify(a.blocks)),e.regionMeta.value[n]={isInherited:!0,inheritedFromId:String(a.inheritedFromId),inheritedFromTitle:a.inheritedFromTitle})}}catch(e){console.warn(`[Draft Hierarchy] Failed to resolve inherited region:`,e)}};return{handleAddRootNode:i,handleAddChild:async t=>{if(String(t.id).startsWith(`draft-`)){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`Please save this parent page before adding sub-pages to it.`}}));return}if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let i=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,o=t.id,s={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:i,channels:i?[i]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:o,_isTreeDraft:!0,disabledRegions:{}};t.children||=[],t.children.push(s),e.activeNode.value=s,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!0,await a(t),Jp(e)},handleAddSibling:async i=>{if(String(i.id).startsWith(`draft-`)){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`Please save this new page before adding sibling pages next to it.`}}));return}if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let o=i.id||``,s=t.findParentNodeInTree(e.nodeTree.value,o),c=s?s.children:e.nodeTree.value,l=c?c.findIndex(e=>e===i||String(e.id)===String(o)):-1,u=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,d={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:u,channels:u?[u]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:s?s.id:null,_isTreeDraft:!0,disabledRegions:{}};c&&l!==-1?c.splice(l+1,0,d):c&&c.push(d),e.activeNode.value=d,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!1,s&&await a(s),Jp(e)}}}var Fp=null,Ip=null;function Lp(e){if(!e||typeof e!=`object`)return{};try{return JSON.parse(JSON.stringify(e))}catch{return{}}}function Rp(e,t,n,r,i,a){let o=sp(),s=Mp(),c=Bd(),{confirmNavigation:l,isGlobalDirty:u}=Op(),d=(e,t)=>{typeof window<`u`&&(window.dispatchEvent(new CustomEvent(`cms-node-updated`,{detail:{nodeId:e,action:t}})),t.startsWith(`asset-`)&&window.dispatchEvent(new CustomEvent(`cms-assets-updated`)))};ni(()=>o.activeNode.value?.nodeType,(e,t)=>{if(o.activeNode.value?.isNew&&e&&e!==t&&!Object.values(o.blocks.value||{}).some(e=>e.length>0)){let t=o.nodeSchemas.value[e];t&&Hp(o.activeNode.value,t),Jp(o)}});let f=async e=>{if(!await l())return!1;let t=r.value,n=Object.keys(t),i=e;if(i===void 0){let e=o.currentVaultType.value;if(typeof e==`string`&&e!==`all`&&n.includes(e))i=e;else if(Array.isArray(e)){let t=e.filter(e=>n.includes(e));t.length===1&&(i=t[0])}}let s=i?t[i]||o.nodeSchemas.value[i]:null,c=o.selectedChannelId.value&&o.selectedChannelId.value!==`all`?Number(o.selectedChannelId.value)||o.selectedChannelId.value:``,u={id:`draft-${Date.now()}`,isNew:!0,title:``,slug:``,nodeType:i||``,layoutId:`inherit`,channelId:c,language:o.selectedLanguage.value||null,status:`draft`,channels:c?[c]:[],disabledRegions:{},_isTreeDraft:!1};s&&Hp(u,s),o.activeNode.value=u,o.blocks.value={},o.regionMeta.value={},o.selectedBlock.value=null,Jp(o),o.validationErrors.value={};let d=a.value.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`settings`;return o.activeTab.value=d,o.setViewMode(`node`),o.shouldFocusTitle.value=!0,!0},p=async e=>await f(e),m=async()=>{o.activeNode.value.isNew=!1;let e=t=>{for(let n=t.length-1;n>=0;n--)t[n].isNew||String(t[n].id).startsWith(`draft-`)?t.splice(n,1):t[n].children&&e(t[n].children)};e(o.nodeTree.value),o.selectedBlock.value=null,o.resetActiveNode(),o.nodeTree.value.length>0?await t(o.nodeTree.value[0]):o.setViewMode(`none`,!0)},h=async()=>{if(o.isDocumentUnverified.value||o.isDocumentLoading.value)return;if(o.isOffline.value){c.persistOfflineDraft(o.activeNode.value.id,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),Jp(o);return}let e=o.nodeSchemas.value[o.activeNode.value.nodeType],t=Ep(e,o.activeNode.value),n=o.activeNode.value.slug?String(o.activeNode.value.slug).trim():``;n||=(t.trim()||`draft-page`).toLowerCase().replace(/[^a-z0-9\s-]/g,``).replace(/[\s-]+/g,`-`).replace(/^-+|-+$/g,``)||`draft-page-${Date.now()}`;let r=!!o.activeNode.value._isTreeDraft,i=o.activeNode.value.id||o.activeContentId.value,a=typeof i==`number`?i:Number(i)||null,l=o.activeNode.value.isNew||r||String(i||``).startsWith(`draft-`);if(!l&&!u.value&&!o.isPendingOfflineSave.value)return;let f={...o.activeNode.value};f.slug=n,f.title=t;let p=o.activeNode.value.status===`published`||o.activeNode.value.publishedAt?`published`:`draft`;f.status=p,delete f.id,delete f.isNew,delete f._draftParentId,delete f._isTreeDraft,delete f.children,delete f.treeNodeId;let m=yp(o.activeNode.value.isHidden);f.isHidden=m;let g=o.selectedChannelId.value&&o.selectedChannelId.value!==`all`?Number(o.selectedChannelId.value)||o.selectedChannelId.value:null,_=Up(o.activeNode.value.channels).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e);o.activeNode.value.channels===void 0&&g&&(_=[g]),f.channels=_,f.channelId=_.length>0?_[0]:``;let v=[];Object.entries(o.blocks.value||{}).forEach(([e,t])=>{o.regionMeta.value[e]?.isInherited||Array.isArray(t)&&t.forEach((t,n)=>{v.push({instanceId:String(t.instanceId||t.id||`block-${Date.now()}`),componentId:String(t.componentId||t.elementType||`text`),elementType:String(t.componentId||t.elementType||`text`),region:String(e||`content`),sortOrder:n,data:Lp(t.data)})})});try{let e=null,i;if(i=l&&r?await Hd.createInTree({action:`create`,title:f.title,slug:n,nodeType:o.activeNode.value.nodeType,treeId:o.selectedTreeId.value,parentId:o.activeNode.value._draftParentId||null,channels:_,channelId:_.length>0?_[0]:null,isHidden:m,nodeData:{...f,status:p,blocks:v}}):l?await Hd.saveNode({id:null,...f,status:p,blocks:v}):await Hd.saveNode({id:a,...f,status:p,blocks:v}),i.ok){let u=await i.json();e=u.id||u.nodeId||a;let f=o.activeNode.value.id;o.activeNode.value.id=String(e),o.activeNode.value.slug=n,o.activeNode.value.title=t,o.activeNode.value.treeNodeId=String(e);let h=u.hasUnpublishedChanges===!0;if(o.activeNode.value.isNew=!1,o.activeNode.value.status=p,o.activeNode.value.hasUnpublishedChanges=h,o.activeNode.value.channels=_,delete o.activeNode.value._isTreeDraft,delete o.activeNode.value._draftParentId,o.nodeTree.value&&e){let i=r=>{for(let a=0;a<r.length;a++){if(r[a]===o.activeNode.value||String(r[a].id)===String(f)||String(r[a].id).startsWith(`draft-`))return r[a].id=String(e),r[a].treeNodeId=String(e),r[a].title=t,r[a].slug=n,r[a].isNew=!1,delete r[a]._isTreeDraft,delete r[a]._draftParentId,!0;if(r[a].children&&i(r[a].children))return!0}return!1};i(o.nodeTree.value),l&&r&&s.saveTreeOrder()}o.updateNodeInState(e,{title:t,slug:n,status:p,hasUnpublishedChanges:h,isHidden:m},String(e)),Jp(o),c.clearPersistedOfflineDraft(e),c.invalidateAfterSave(e),c.saveToCache(e,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),o.invalidateStats(),d(e,l?`create`:`update`)}else{let e=await i.json().catch(()=>({}));if(i.status===409&&(e.field===`slug`||e.error?.toLowerCase().includes(`slug`)||e.error?.toLowerCase().includes(`exists`))){let e=Math.random().toString(36).substring(2,6),t=`${n}-${e}`;return o.activeNode.value.slug=t,typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`The URL slug "${n}" was already in use. It has been auto-appended to "${t}".`}})),o.validationErrors.value.slug&&delete o.validationErrors.value.slug,await h()}i.status===409&&e.field&&(o.validationErrors.value={...o.validationErrors.value,[e.field]:e.error||`This value is already in use.`})}}catch(e){console.error(`Network error auto-saving node draft:`,e),c.persistOfflineDraft(a||o.activeNode.value.id,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),Jp(o)}},g=async()=>{o.isSaving.value=!0,o.isAutoSavePending.value=!1,Fp&&=(clearTimeout(Fp),null);try{Ip=h(),await Ip}finally{Ip=null,o.isSaving.value=!1}};return ni([()=>o.activeNode.value,()=>o.blocks.value],()=>{if(!o.activeNode.value?.id||o.isDocumentLoading.value||o.activeNode.value.isNew&&!o.activeNode.value.nodeType)return;let e=Ep(o.nodeSchemas.value[o.activeNode.value.nodeType],o.activeNode.value);if(o.activeNode.value.isNew&&e.startsWith(`Untitled`)){o.isAutoSavePending.value=!1;return}o.isAutoSavePending.value=!0,Fp&&clearTimeout(Fp),Fp=setTimeout(()=>{g()},1e3)},{deep:!0}),{handleAddNewNode:f,createVaultNode:p,cancelNewNode:m,saveNewNode:async()=>await h(),saveNode:g,publishNode:async()=>{if(o.isDocumentUnverified.value||!await e())return!1;Fp||o.isAutoSavePending.value||u.value?await g():Ip&&await Ip;let t=o.activeNode.value.id||o.activeContentId.value,n=typeof t==`number`?t:Number(t)||null;if(!n)return!1;o.isSaving.value=!0;try{let e=await Hd.publishNode(n);if(e.ok){let t=await e.json();return o.activeNode.value.status=`published`,o.activeNode.value.publishedAt=t.publishedAt,o.activeNode.value.hasUnpublishedChanges=!1,o.updateNodeInState(n,{status:`published`,publishedAt:t.publishedAt,hasUnpublishedChanges:!1},String(n)),Jp(o),c.invalidateAfterSave(n),c.saveToCache(n,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),o.invalidateStats(),o.activeNode.value.treeNodeId&&await s.saveTreeOrder(),await s.fetchNodeTree(),await s.fetchVaultNodes({reset:!0,ensureItemId:String(n)}),d(n,`publish`),!0}}finally{o.isSaving.value=!1}return!1},deleteNode:async e=>{let t=e||o.activeNode.value?.id||o.activeContentId.value;if(!t||String(t).startsWith(`draft-`))return m(),!0;try{if((await Hd.deleteNode(t)).ok)return c.invalidateAfterSave(t),o.invalidateStats(),o.nodeTree.value&&o.nodeTree.value.length>0&&await s.fetchNodeTree(),await s.fetchVaultNodes({reset:!0}),String(o.activeNode.value?.id)===String(t)&&m(),d(t,`delete`),!0}catch(e){console.error(`[CMS] Failed to delete node:`,e)}return!1},restoreNode:async e=>{if(!e)return!1;try{if((await Hd.restoreNode(e)).ok)return o.invalidateStats(),await s.fetchVaultNodes({reset:!0}),d(e,`restore`),!0}catch(e){console.error(`[CMS] Failed to restore node:`,e)}return!1},purgeNode:async e=>{if(!e)return!1;try{if((await Hd.purgeNode(e)).ok)return o.invalidateStats(),await s.fetchVaultNodes({reset:!0}),d(e,`purge`),!0}catch(e){console.error(`[CMS] Failed to purge node:`,e)}return!1},toggleNodeVisibility:async e=>{if(!e||!e.id||String(e.id).startsWith(`draft-`))return!1;let t=!yp(e.isHidden);try{if((await Hd.toggleVisibility(e.id,t)).ok)return e.isHidden=t,o.updateNodeInState(e.id,{isHidden:t},e.id),String(o.activeNode.value?.id)===String(e.id)?(Jp(o),c.saveToCache(e.id,{node:JSON.parse(JSON.stringify(o.activeNode.value)),blocks:JSON.parse(JSON.stringify(o.blocks.value)),regionMeta:JSON.parse(JSON.stringify(o.regionMeta.value))})):c.invalidateAfterSave(e.id),d(e.id,`update`),!0}catch(e){console.error(`[CMS] Failed to toggle node visibility:`,e)}return!1},restoreSnapshot:async e=>{let n=o.activeNode.value?.id;if(!n||String(n).startsWith(`draft-`))return!1;o.isSaving.value=!0;try{if((await Hd.restoreSnapshot(n,e)).ok)return o.activeSnapshotVersion.value=null,o.draftBackup.value=null,c.clearCache(n),await t({id:n,nodeType:o.activeNode.value.nodeType,treeNodeId:o.activeNode.value.treeNodeId}),o.activeNode.value.status=`draft`,o.activeNode.value.hasUnpublishedChanges=!0,o.updateNodeInState(n,{...o.activeNode.value,status:`draft`,hasUnpublishedChanges:!0,title:o.activeNode.value.title,isHidden:yp(o.activeNode.value.isHidden)},o.activeNode.value.treeNodeId),Jp(o),o.invalidateStats(),await s.fetchNodeTree(),d(n,`restore-snapshot`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`success`,message:`Version ${e} restored successfully.`}})),!0}catch(e){console.error(`[CMS] Failed to restore snapshot:`,e)}finally{o.isSaving.value=!1}return!1}}}var zp=0;function Bp(e){return e&&{...e,isHidden:yp(e.isHidden)}}function Vp(e,t=!1){if(!e)return``;let n=new Date,r=String(e).toLowerCase().trim(),i=e=>{let n=e=>e.toString().padStart(2,`0`),r=`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())}`;return t?r:`${r}T${n(e.getHours())}:${n(e.getMinutes())}`};if(r===`now`||r===`today`)return i(n);let a=r.match(/^([+-])\s*(\d+)\s*(minute|hour|day|week|month|year)s?$/);if(a){let e=a[1]===`+`?1:-1,t=parseInt(a[2],10)*e,r=a[3],o=new Date(n);return r===`minute`?o.setMinutes(o.getMinutes()+t):r===`hour`?o.setHours(o.getHours()+t):r===`day`?o.setDate(o.getDate()+t):r===`week`?o.setDate(o.getDate()+t*7):r===`month`?o.setMonth(o.getMonth()+t):r===`year`&&o.setFullYear(o.getFullYear()+t),i(o)}return String(e)}function Hp(e,t){let n=e=>e==null||e===``,r=t=>{t&&Object.entries(t).forEach(([t,r])=>{r?.default!==void 0&&n(e[t])&&(e[t]=r.type===`datetime`||r.type===`date`?Vp(r.default,r.type===`date`):r.default)})};r(t?.fields),t?.tabs&&Object.values(t.tabs).forEach(e=>r(e?.fields))}function Up(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>typeof e==`object`&&e?e.id||e.channelId:e).filter(Boolean);if(typeof e==`string`)try{let t=JSON.parse(e);return Array.isArray(t)?Up(t):[e]}catch{return[e]}return[e]}function Wp(e,t){if(!e)return!1;if(!t||e===t.defaultLayout)return!0;let n=null,r=e=>{e&&(Array.isArray(e)?e.forEach(e=>{e.layoutId&&(n=e.layoutId)}):e.layoutId&&(n=e.layoutId))};if(r(t.fields),!n&&t.tabs&&Object.values(t.tabs).forEach(e=>r(e.fields)),!n)return!1;let i=n.allowedLayouts;return i?typeof i==`string`?i===e:!Array.isArray(i)||i.length===0||i.includes(e):!0}function Gp(e,t,n,r){let i=e?.layoutId,a=e?.nodeType?t.nodeSchemas.value[e.nodeType]:null;if((!i||i===`inherit`)&&!e?.resolvedLayoutId&&n&&r){let t=r.findParentNodeInTree(n.nodeTree.value,e?._draftParentId||e?.parentId||``);for(;t;){if(t.subpageLayoutId&&t.subpageLayoutId!==`inherit`){Wp(t.subpageLayoutId,a)&&(i=t.subpageLayoutId);break}if(t.layoutId&&t.layoutId!==`inherit`){Wp(t.layoutId,a)&&(i=t.layoutId);break}if(t.resolvedLayoutId){Wp(t.resolvedLayoutId,a)&&(i=t.resolvedLayoutId);break}t=r.findParentNodeInTree(n.nodeTree.value,t.parentId||``)}}!i||i===`inherit`?(i=e?.resolvedLayoutId,i&&!Wp(i,a)&&(i=null),i||=a?.defaultLayout):Wp(i,a)||(i=a?.defaultLayout);let o=i?t.nodeLayoutSchemas.value[i]:null;return o?.regions&&Object.keys(o.regions).length>0?o.regions:{content:{label:`Content`}}}var Kp=e=>e===`parent`||e===!0||String(e).toLowerCase()===`true`;function qp(e,t){let n=e.activeNode.value,r=n?.nodeType?e.nodeSchemas.value[n.nodeType]:null,i=n?.layoutId;(!i||i===`inherit`)&&(i=n?.resolvedLayoutId||r?.defaultLayout);let a=i?e.nodeLayoutSchemas.value[i]:null,o=a?.regions&&Object.keys(a.regions).length>0?a.regions:{content:{label:`Content`}},s=new Set(Object.keys(o)),c=t=>{Array.isArray(t)&&t.forEach(t=>{let n=t.componentId||t.elementType,r=e.blockLayoutSchemas.value[n];r?.regions&&Object.keys(r.regions).forEach(n=>{let r=`${t.instanceId||t.id}_${n}`;s.add(r),e.blocks.value[r]&&c(e.blocks.value[r])})})};return t&&Array.isArray(t)&&t.forEach(t=>{let n=t.componentId||t.elementType,r=e.blockLayoutSchemas.value[n];r?.regions&&Object.keys(r.regions).forEach(e=>{let n=`${t.instanceId||t.id}_${e}`;s.add(n)})}),Object.keys(o).forEach(t=>c(e.blocks.value[t]||[])),s}function Jp(e){if(!e.activeNode.value)return;qp(e).forEach(t=>{e.blocks.value[t]||(e.blocks.value[t]=[])}),e.activeNode.value.disabledRegions||(e.activeNode.value.disabledRegions={}),e.activeNode.value.channels||(e.activeNode.value.channels=[]);let t=Wf(JSON.parse(JSON.stringify(e.activeNode.value)),e.nodeSchemas.value),n=JSON.parse(JSON.stringify(e.blocks.value));e.nodeSnapshot.value=JSON.stringify({node:t,blocks:n})}function Yp(){let e=sp(),t=Mp(),n=Bd(),r=Pp(),{confirmNavigation:i}=Op(),a=()=>Jp(e),o=J(()=>e.nodeSchemas.value[e.activeNode.value?.nodeType]||null),s=J(()=>Gp(e.activeNode.value,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t)),c=J(()=>{let t=[],n=e.activeNode.value,r=e.nodeSchemas.value[n?.nodeType];if(r){if(r.hasCanvas===!0&&t.push({key:`content`,label:`Content`}),r.tabs&&typeof r.tabs==`object`)for(let[e,n]of Object.entries(r.tabs)){let r=typeof n==`string`?n:n?.label||e;t.push({key:e,label:r})}t.filter(e=>e.key!==`content`).length===0&&t.push({key:`settings`,label:r.label||`Settings`}),t.push({key:`connections`,label:`Connections`})}return t}),l=J(()=>{let t={};for(let[n,r]of Object.entries(e.nodeSchemas.value||{})){let e=r.inTree;(e===!0||String(e)===`true`||e===1)&&(t[n]=r)}return t}),u=J(()=>Object.keys(l.value).map(e=>({value:e,label:l.value[e].label||e}))),d=J(()=>{let t={};for(let[n,r]of Object.entries(e.nodeSchemas.value||{}))r.inVault!==!1&&String(r.inVault)!==`false`&&(t[n]=r);return t}),f=J(()=>Object.keys(d.value).map(e=>({value:e,label:d.value[e].label||e}))),p=J(()=>e.workspaceContext.value===`tree`),m=t=>{if(!e.activeNode.value?.nodeType)return t===`settings`||t===`content`||t===`node`?{nodeType:{label:`Select Node Type`,type:`select`,options:p.value?u.value:f.value,rules:{required:!0}}}:{};let n=o.value;if(!n)return{};let r=t;t===`node`&&!n.tabs?.node&&n.tabs?.settings&&(r=`settings`);let i=n.tabs?.[r]?.fields||n.fields||{},a=JSON.parse(JSON.stringify(i));return a.nodeType&&(a.nodeType.type=`select`,a.nodeType.options=p.value?u.value:f.value),a},h=J(()=>Object.keys(e.validationErrors.value).length===0),g=e=>{},_=async()=>{e.validationErrors.value={};let t=!0,n=``,r=o.value;if(!r)return!1;let i={...r.fields||{}};r.tabs&&Object.values(r.tabs).forEach(e=>{Object.assign(i,e.fields||{})});let a=e.activeNode.value?.id,s=typeof a==`number`||a&&!String(a).startsWith(`draft-`)?String(a):``,l=e.activeNode.value?.treeId||e.selectedTreeId.value||e.activeTreeSettings.value?.id,u=e.activeNode.value?._draftParentId??e.activeNode.value?.parentId??null,d={...e.activeNode.value,treeId:l,parentId:u};for(let[a,o]of Object.entries(i)){let i=e.activeNode.value[a],c=await pp(a,i,o,{entityType:`node`,excludeId:e.activeNode.value?.treeNodeId||s,formData:d});if(c&&(e.validationErrors.value[a]=c,t=!1,!n)){for(let[e,t]of Object.entries(r.tabs||{}))if(t.fields?.[a]){n=e;break}}}if(!t){let t=n||c.value.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`content`;return e.activeTab.value!==t&&(e.activeTab.value=t),e.shouldFocusTitle.value=!0,!1}return!0},v=(e,t)=>{let n={},r=t.filter(e=>typeof e==`object`&&!!e),i=new Set(r.map(e=>String(e.blockId||e.instanceId||e.id))),a=!0;for(;a;){a=!1;for(let[t,r]of Object.entries(e))if(!(n[t]||!r||!Array.isArray(r))){for(let e of i)if(e&&(t.startsWith(`${e}_`)||t.startsWith(`${e}-`))){n[t]=r,r.forEach(e=>{e&&i.add(String(e.blockId||e.instanceId||e.id))}),a=!0;break}}}return n},y=async(r,i,a,o)=>{if(!r||r.isNew||String(r.id||``).startsWith(`draft-`))return{blocks:[]};let s=r;for(;s;){let r=s.disabledRegions?.[i],a=n.getCachedDocument(s.id),o=a?.blocks?.[i]?.length>0&&!a?.regionMeta?.[i]?.isInherited;if(r||o)break;let c=t.findParentNodeInTree(e.nodeTree.value,s.id||s.treeNodeId||``);if(!c)break;s=c}let c=String(s?.slug||``).trim().toLowerCase();if(!c||c===`page-title`||c===`untitled`)return{blocks:[]};let l=String(a);(l===`all`||l===`undefined`||l===`null`)&&(l=``);let u=o&&o!==`undefined`&&o!==`null`?String(o):``;u||=e.activeTreeSettings.value?.defaultLanguage||e.activeChannelSettings.value?.defaultLanguage||``;let d=`${c}_${i}_${e.selectedTreeId.value}_${l}_${u}`,f=n.getCachedInheritedRegion(d);if(f)return f;let p=n.getCachedDocument(s.id);if(p&&p.blocks[i]?.length>0){let e={blocks:p.blocks[i],subRegions:v(p.blocks,p.blocks[i]),inheritedFromId:String(s.id),inheritedFromTitle:s.title||s.slug};return n.setCachedInheritedRegion(d,e),e}try{let t=await Hd.getInheritedRegion(c,e.selectedTreeId.value,u,l);if(t.ok){let e=await t.json(),r=e.content?.[i]||[];if(r.length>0){let t={blocks:r,subRegions:v(e.content,r),inheritedFromId:String(s.id),inheritedFromTitle:s.title||s.slug};return n.setCachedInheritedRegion(d,t),t}}}catch(e){console.warn(`⚠️ Failed to fetch inherited region:`,e)}return{blocks:[]}},b=async r=>{if(String(e.activeNode.value?.id)===String(r.id)&&!e.activeNode.value?.isNew||e.activeNode.value?.isNew&&String(e.activeNode.value.id||``).startsWith(`draft-`)||!await i())return;e.selectedBlock.value=null,e.nodeSnapshot.value=``,e.selectedTreeId.value&&(e.nodeTree.value=t.getNodesForTree(e.selectedTreeId.value)),e.isDocumentLoading.value=!0,n.clearConflict(),n.markUnverified(!1);let a=++zp,o=String(r.id),s=n.getCachedDocument(o),l=n.getPersistedOfflineDraft(r.id);Np(e.nodeTree.value),e.validationErrors.value={};let u=e.nodeSchemas.value[r.nodeType]||Object.values(e.nodeSchemas.value)[0],d=t.findParentNodeInTree(e.nodeTree.value,r.id||r.treeNodeId||``),f=Up(r.channels||r.channelId).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e),p=String(f[0]||e.selectedChannelId.value||``),m=r.language||e.activeTreeSettings.value?.defaultLanguage||e.selectedLanguage.value||``;if(l){e.setViewMode(`node`),e.activeNode.value=JSON.parse(JSON.stringify(l.data.node)),e.blocks.value=JSON.parse(JSON.stringify(l.data.blocks)),e.regionMeta.value=JSON.parse(JSON.stringify(l.data.regionMeta)),Jp(e),e.isDocumentLoading.value=!1,e.isPendingOfflineSave.value=!0;return}if(s){e.setViewMode(`node`),e.activeNode.value=JSON.parse(JSON.stringify(s.node)),e.blocks.value=JSON.parse(JSON.stringify(s.blocks)),e.regionMeta.value=JSON.parse(JSON.stringify(s.regionMeta)),Jp(e),e.isDocumentLoading.value=!1;return}try{let i=await Hd.getNode(r.id);if(a!==zp)return;if(i.ok){let o=await i.json(),s=o.node||r,l=s.disabledRegions||{},h=s.channels||s.channelId||f,g={...Bp(s),id:s.id||r.id,treeNodeId:s.treeNodeId||r.treeNodeId,isNew:!1,disabledRegions:l,channels:Up(h).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e),trees:s.trees||[]};Hp(g,u);let _=Gp(g,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t),v={};for(let e of Object.keys(_))Kp(_[e].inherit)&&d&&(v[e]=y(d,e,p,m));let b={};for(let[e,t]of Object.entries(v))b[e]=await t;if(a!==zp)return;let x={},S={},C=new Set(Object.keys(_));if(Array.isArray(o.blocks)&&o.blocks.forEach(e=>C.add(e.region||`content`)),C.forEach(e=>{x[e]=[]}),Array.isArray(o.blocks)){let t=new Set;[...o.blocks].sort((e,t)=>{let n=String(e.region||``).includes(`_`),r=String(t.region||``).includes(`_`);return n&&!r?1:!n&&r?-1:0}).forEach(n=>{let r=n.instanceId||n.id;if(t.has(r))return;t.add(r);let i=n.region||`content`;x[i]||(x[i]=[]);let a=e.blockSchemas.value[n.componentId||n.elementType],o=typeof n.data==`string`?JSON.parse(n.data):n.data||{};a?.fields&&Object.entries(a.fields).forEach(([e,t])=>{(o[e]===void 0||o[e]===null)&&(o[e]=t.default===void 0?``:t.default)}),x[i].push({instanceId:String(r),blockId:String(n.blockId||n.instanceId||n.id),componentId:String(n.componentId||n.elementType||`text`),region:i,data:{...o}})})}for(let e of Object.keys(_)){let t=x[e]&&x[e].length>0,n=l[e];if(Kp(_[e].inherit)&&!t&&!n&&d){let t=b[e];if(t&&t.blocks&&t.blocks.length>0){if(x[e]=t.blocks,S[e]={isInherited:!0,inheritedFromId:t.inheritedFromId,inheritedFromTitle:t.inheritedFromTitle},t.subRegions)for(let[n,r]of Object.entries(t.subRegions))n!==e&&Array.isArray(r)&&r.length>0&&(x[n]=r,S[n]={isInherited:!0,inheritedFromId:t.inheritedFromId,inheritedFromTitle:t.inheritedFromTitle})}else S[e]={isInherited:!1}}else S[e]={isInherited:!1}}let w={};Object.keys(x).forEach(e=>{S[e]?.isInherited?w[e]=[]:w[e]=x[e]});let T={node:g,blocks:w,regionMeta:S},{isNodeDirty:E}=Op();if(n.evaluateServerResponse(r.id,T,E.value).action===`update_silently`){e.setViewMode(`node`),e.activeNode.value=g,e.blocks.value=x,e.regionMeta.value=S;let i=c.value;if(!i.some(e=>e.key===`content`)&&e.activeTab.value===`content`&&(e.activeTab.value=i.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`settings`),g.trees&&g.trees.length>0){let n=String(g.trees[0].treeId);e.selectedTreeId.value!==n&&(e.selectedTreeId.value=n,e.nodeTree.value=t.getNodesForTree(n))}await Fr(),Jp(e),n.saveToCache(r.id,{node:g,blocks:x,regionMeta:S})}n.markUnverified(!1)}else n.markUnverified(!0)}catch(e){console.error(`⚠️ Network error fetching node content:`,e),n.markUnverified(!0)}finally{e.isDocumentLoading.value=!1}},x=async t=>{let n=e=>{for(let r of e){if(String(r.id)===String(t))return r;if(r.children){let e=n(r.children);if(e)return e}}return null},r=n(e.nodeTree.value);r?await b(r):await b({id:String(t),title:`Loading...`,slug:``,nodeType:`node`,channelId:``,language:``})};ni([()=>e.activeNode.value?.id,()=>e.activeNode.value?.nodeType,()=>e.activeNode.value?.layoutId,()=>e.activeNode.value?.resolvedLayoutId],([n])=>{if(!e.isDocumentLoading.value&&n&&e.activeNode.value?.nodeType){let r=Gp(e.activeNode.value,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t),i=t.findParentNodeInTree(e.nodeTree.value,e.activeNode.value._draftParentId||e.activeNode.value.parentId||``),a=String(e.selectedChannelId.value||``),o=String(e.activeNode.value?.language||e.activeTreeSettings.value?.defaultLanguage||e.selectedLanguage.value||``),s={...e.regionMeta.value},c=!1;for(let t of Object.keys(r)){let l=r[t].inherit,u=e.activeNode.value.disabledRegions?.[t],d=e.blocks.value[t]&&e.blocks.value[t].length>0,f=!s[t],p=!f&&!s[t].isInherited&&Kp(l)&&!u&&!d;(f||p)&&(Kp(l)&&i&&!u&&!d?(s[t]={isInherited:!0},c=!0,y(i,t,a,o).then(r=>{e.activeNode.value?.id===n&&(r&&r.blocks&&r.blocks.length>0?(e.blocks.value[t]=r.blocks,e.regionMeta.value[t]={isInherited:!0,inheritedFromId:r.inheritedFromId,inheritedFromTitle:r.inheritedFromTitle}):e.regionMeta.value[t]={isInherited:!1})})):f&&(s[t]={isInherited:!1},c=!0))}c&&(e.regionMeta.value=s)}},{immediate:!0,deep:!1});let S=Rp(_,b,l,d,p,c);return{applySchemaDefaults:Hp,currentNodeSchema:o,currentLayoutRegions:s,availableNodeTabs:c,treeEligibleNodeSchemas:l,treeEligibleNodeTypes:u,vaultEligibleNodeSchemas:d,vaultEligibleNodeTypes:f,isTreeContext:p,isFormValid:h,getFieldsForTab:m,setFormValidator:g,validateActiveNode:_,loadNodeContent:b,navigateToNodeById:x,resolveInheritedRegion:y,handleAddRootNode:r.handleAddRootNode,handleAddChild:r.handleAddChild,handleAddSibling:r.handleAddSibling,handleAddNewNode:S.handleAddNewNode,createVaultNode:S.createVaultNode,cancelNewNode:S.cancelNewNode,saveNewNode:S.saveNewNode,saveNode:S.saveNode,publishNode:S.publishNode,deleteNode:S.deleteNode,restoreNode:S.restoreNode,purgeNode:S.purgeNode,toggleNodeVisibility:S.toggleNodeVisibility,restoreSnapshot:S.restoreSnapshot,updateNodeSnapshot:a}}function Xp(){let{allChannels:e,activeChannelSettings:t,selectedChannelId:n,selectedLanguage:r,channelSnapshot:i,channelTemplateSchema:a,channelSchemas:o,validationErrors:s,setViewMode:c}=sp(),{validateAgainstSchema:l}=hp(),{fetchChannels:u,syncSystemMetadata:d}=vp(),{confirmNavigation:f}=Op(),p=()=>xp(o,Od),m=J(()=>wp(p())),h=()=>{i.value=JSON.stringify(t.value||{})},g=async()=>{if(!t.value)return!1;s.value={};let r=p(),i=t.value.channelType||t.value.type||Object.keys(r)[0]||`website`,o=Cp(r[i]||a.value,a.value);if(!await l(t.value,{fields:o},`channel`))return!1;try{let r=t.value.id,a=t.value.isNew||String(r||``).startsWith(`draft-`)?null:typeof r==`number`?r:Number(r)||null,o={...JSON.parse(JSON.stringify(t.value)),id:a,channelType:i};delete o.isNew;let l=await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(l.ok){let r=await l.json();t.value.id=r.id,delete t.value.isNew,await d(),n.value=String(r.id);let a=e.value.find(e=>String(e.id)===String(r.id));return a&&(t.value={...a,channelType:a.channelType||a.type||i,trees:Array.isArray(a.trees)?[...a.trees]:[]}),h(),await c(`channel`,!0),!0}{let e=await l.json().catch(()=>({}));return l.status===409&&e.field?s.value={[e.field]:e.error||`This key is already in use.`}:alert(e.error||`Failed to save channel settings.`),!1}}catch(e){return console.error(`[CMS] Error saving channel:`,e),!1}},_=async()=>{t.value=null,i.value=``,await c(`none`,!0)},v=async e=>{let r=e||t.value?.id;if(r){if(String(r).startsWith(`draft-`)){await _();return}try{let e=await fetch(`/api/cms/channels.json?id=${r}`,{method:`DELETE`});if(e.ok)t.value=null,i.value=``,await d(),n.value=`all`,await c(`none`,!0);else{let t=await e.json().catch(()=>({}));alert(`Failed to delete channel. ${t.error||`Check server console.`}`)}}catch{alert(`Network error: Could not reach server to delete the channel.`)}}},y=async()=>{if(!await f())return!1;let r=n.value;(!r||r===`all`)&&e.value.length>0&&(r=String(e.value[0].id),n.value=r);let i=e.value.find(e=>String(e.id)===String(r));if(i){let e=p(),n=Object.keys(e)[0]||`website`,r=i.channelType||i.type||n,a=JSON.parse(JSON.stringify(i));a.channelType=r,a.trees=Array.isArray(i.trees)?[...i.trees]:[];let o=e[r];if(o){let e={};Hp(e,o),Object.keys(e).forEach(t=>{(a[t]===void 0||a[t]===null)&&(a[t]=e[t])})}t.value=a,h(),s.value={},await c(`channel`,!0)}return!0},b=async e=>{if(!await f())return!1;let n=p(),r=Sp(n,e),i=r?n[r]:null,a={id:`draft-${Date.now()}`,isNew:!0,key:``,label:``,channelType:r,domain:`localhost`,baseUrl:`http://localhost:3000`,defaultLanguage:`en`,trees:[]};return i&&Hp(a,i),t.value=a,h(),s.value={},await c(`channel`,!0),!0};return{allChannels:e,activeChannelSettings:t,selectedChannelId:n,selectedLanguage:r,channelTypeOptions:m,fetchChannels:u,saveChannelSettings:g,cancelNewChannel:_,deleteChannel:v,openCurrentChannelSettings:y,handleAddNewChannel:b,onChannelSelectChange:async e=>{let r=e.target,i=String(t.value?.id||`all`);r.value===`__add_new__`?await b()||Fr(()=>{n.value=i}):await y()||Fr(()=>{n.value=i})},updateChannelSnapshot:h}}var Zp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Qp=e=>e===``,$p=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),em=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),tm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),nm=e=>{let t=tm(e);return t.charAt(0).toUpperCase()+t.slice(1)},rm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},im=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o=rm.width,color:s=rm.stroke,...c},{slots:l})=>Vo(`svg`,{...rm,...c,width:o,height:o,stroke:s,"stroke-width":Qp(n)||Qp(r)||n===!0||r===!0?Number(i||a||rm[`stroke-width`])*24/Number(o):i||a||rm[`stroke-width`],class:$p(`lucide`,c.class,...e?[`lucide-${em(nm(e))}-icon`,`lucide-${em(e)}`]:[`lucide-icon`]),...!l.default&&!Zp(c)&&{"aria-hidden":`true`}},[...t.map(e=>Vo(...e)),...l.default?[l.default()]:[]]),Y=(e,t)=>(n,{slots:r,attrs:i})=>Vo(im,{...i,...n,iconNode:t,name:e},r),am=Y(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),om=Y(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),sm=Y(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),cm=Y(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),lm=Y(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),um=Y(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),dm=Y(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),fm=Y(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),pm=Y(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),mm=Y(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),hm=Y(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]]),gm=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_m=Y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),vm=Y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ym=Y(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),bm=Y(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),xm=Y(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Sm=Y(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Cm=Y(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),wm=Y(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Tm=Y(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Em=Y(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`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`}]]),Dm=Y(`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`}]]),Om=Y(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),km=Y(`crop`,[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]),Am=Y(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),jm=Y(`ellipsis-vertical`,[[`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`}]]),Mm=Y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Nm=Y(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pm=Y(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Fm=Y(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Im=Y(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Lm=Y(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Rm=Y(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),zm=Y(`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`}]]),Bm=Y(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Vm=Y(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Hm=Y(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Um=Y(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Wm=Y(`heading-4`,[[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 10v3a1 1 0 0 0 1 1h3`,key:`tj5zdr`}],[`path`,{d:`M21 10v8`,key:`1kdml4`}],[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}]]),Gm=Y(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Km=Y(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),qm=Y(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Jm=Y(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Ym=Y(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Xm=Y(`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`}]]),Zm=Y(`layout-grid`,[[`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`}]]),Qm=Y(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),$m=Y(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),eh=Y(`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`}]]),th=Y(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),nh=Y(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rh=Y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ih=Y(`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`}]]),ah=Y(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),oh=Y(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),sh=Y(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ch=Y(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),lh=Y(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),uh=Y(`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`}]]),dh=Y(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),fh=Y(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),ph=Y(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),mh=Y(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),hh=Y(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),gh=Y(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_h=Y(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),vh=Y(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),yh=Y(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),bh=Y(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),xh=Y(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Sh=Y(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Ch=Y(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),wh=Y(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Th=Y(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Eh=Y(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Dh=Y(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Oh=Y(`subscript`,[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]),kh=Y(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Ah=Y(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),jh=Y(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Mh=Y(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),Nh=Y(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ph=Y(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Fh=Y(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ih=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Lh={class:`logo-area`},Rh=[`title`,`aria-label`],zh={class:`toggle-icon-wrapper`},Bh={class:`version-link`,href:`https://kama.t3cloud.eu`,target:`_blank`,rel:`noreferrer`},Vh={key:0,class:`center-status-area`},Hh={class:`user-area`},Uh={class:`icon-bubble`},Wh={key:0,class:`publish-count-badge`},Gh={class:`icon-bubble`},Kh=[`title`],qh={class:`icon-bubble`},Jh=vi({__name:`GlobalTopBar`,props:{isSidebarOpen:{type:Boolean},isMobile:{type:Boolean}},emits:[`toggle-sidebar`],setup(e,{emit:t}){let n=e,r=t,{activeView:i,goToDashboard:a,isOffline:o,isReadOnlyMode:s,isPendingOfflineSave:c,activeNode:l,hasUnpublishedChanges:u,vaultStats:d,openPublisher:f}=sp(),p=R({firstName:`Admin`,lastName:`User`,email:`admin@kama-cms.com`}),m=J(()=>p.value.firstName||p.value.lastName?`${p.value.firstName} ${p.value.lastName}`.trim():p.value.email.split(`@`)[0]),h=()=>{i.value={type:`help`}},g=()=>{i.value={type:`user`}},_=J(()=>{let e=new Map;if((d.value?.pendingNodes||[]).forEach(t=>{if(t.deletedAt)return;let n=String(l.value?.id)===String(t.id),r=bp(t),i=n&&u.value||r.hasUnpublishedChanges;(r.isDraft||r.isUnpublishedDraft||i)&&e.set(String(t.id),!0)}),l.value&&l.value.id&&!l.value.deletedAt){let t=bp(l.value),n=u.value||t.hasUnpublishedChanges;(t.isDraft||t.isUnpublishedDraft||n)&&e.set(String(l.value.id),!0)}return e.size}),v=async()=>{try{let e=await fetch(`/api/cms/stats`);if(e.ok){let t=await e.json();d.value=t}}catch(e){console.warn(`[TopBar] Failed to refresh pending stats:`,e)}},y=()=>{v()},b=J(()=>s.value?{text:`Unverified Document (Read-Only)`,icon:jh,class:`status-danger`}:o.value?{text:`Working Offline — Saving locally`,icon:Fh,class:`status-warning`}:c.value?{text:`Reconnected — Syncing offline queue...`,icon:vh,class:`status-info`,spin:!0}:null);return Js(()=>{window.addEventListener(`cms-node-updated`,y),d.value?.pendingNodes||v()}),Qs(()=>{window.removeEventListener(`cms-node-updated`,y)}),(e,t)=>(B(),V(`header`,{class:w([`global-top-bar`,{"has-status-bg":b.value}])},[U(`div`,Lh,[n.isMobile?(B(),V(`button`,{key:0,type:`button`,class:w([`sidebar-toggle-chip mobile-only-btn`,{"is-active":n.isSidebarOpen}]),title:n.isSidebarOpen?`Close sidebar`:`Open sidebar`,"aria-label":n.isSidebarOpen?`Close sidebar`:`Open sidebar`,onClick:t[0]||=e=>r(`toggle-sidebar`)},[U(`div`,zh,[U(`div`,{class:w([`hamburger-icon`,{"is-open":n.isSidebarOpen}])},[...t[3]||=[U(`span`,{class:`bar bar-top`},null,-1),U(`span`,{class:`bar bar-bottom`},null,-1)]],2)])],10,Rh)):G(``,!0),U(`button`,{class:`logo`,title:`Go to Dashboard`,onClick:t[1]||=e=>z(a)(!1)},[...t[4]||=[wo(`<svg id="b" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 117.14 27.38" data-v-7cc7ae14><g id="c" data-v-7cc7ae14><path d="M22.48,22.51c1.94,2.9,2.37,3.49,3.49,4.87h-8.56c-.46-1.05-1.42-2.8-2.27-4.18l-5.1-8.16-3.32,3.32v4.15c0,2.04.07,3.13.26,4.87H0c.2-1.68.26-2.9.26-4.87V4.87C.26,2.86.2,1.58,0,0h6.98c-.2,1.71-.26,2.8-.26,4.87v5.83l6.55-7.01c1.28-1.35,2.14-2.47,2.86-3.69h8.89c-.59.59-.82.86-1.28,1.32l-2.3,2.3-6.88,7.21,7.93,11.68Z" data-v-7cc7ae14></path><path d="M46.97,27.38c-.26-1.58-.46-2.44-.79-3.55l-.89-2.8h-9.38l-.89,2.8c-.43,1.32-.66,2.34-.82,3.55h-7.7c.49-.99.79-1.78,1.58-4.02l7.11-19.81c.59-1.61.89-2.6,1.05-3.55h8.59c.23.95.46,1.81,1.12,3.55l7.14,19.81c.63,1.74,1.15,3.09,1.58,4.02h-7.7ZM40.55,5.63l-3.06,9.87h6.19l-3.13-9.87Z" data-v-7cc7ae14></path><path d="M68.92,27.38c-.16-1.15-.53-2.37-1.42-4.87l-3.03-8.75c-.03-.16-1.02-3.23-1.12-3.49q-.36-1.18-.53-1.65c.2,2.07.33,4.77.33,6.52v7.14c0,2.27.07,3.72.26,5.1h-6.48c.2-1.48.26-2.86.26-5.1V5.13c0-1.97-.1-3.72-.26-5.13h8.69c.23,1.42.49,2.47,1.25,4.64l4.94,14.19,4.9-14.19c.76-2.21,1.02-3.26,1.22-4.64h8.72c-.2,1.58-.26,2.93-.26,5.13v17.15c0,2.5.07,3.78.26,5.1h-6.48c.2-1.51.26-2.77.26-5.1v-7.18c0-.79.1-3.26.16-4.28q.1-1.74.13-2.24c-.72,2.57-1.05,3.75-1.48,4.94l-3.19,9.02c-.82,2.34-1.25,3.79-1.42,4.84h-5.73Z" data-v-7cc7ae14></path><path d="M109.44,27.38c-.26-1.58-.46-2.44-.79-3.55l-.89-2.8h-9.38l-.89,2.8c-.43,1.32-.66,2.34-.82,3.55h-7.7c.49-.99.79-1.78,1.58-4.02l7.11-19.81c.59-1.61.89-2.6,1.05-3.55h8.59c.23.95.46,1.81,1.12,3.55l7.14,19.81c.63,1.74,1.15,3.09,1.58,4.02h-7.7ZM103.02,5.63l-3.06,9.87h6.19l-3.13-9.87Z" data-v-7cc7ae14></path></g></svg>`,1)]]),U(`a`,Bh,` v`+L(z(`0.1.0-alpha.183`)),1)]),q(Su,{name:`fade`},{default:qr(()=>[b.value?(B(),V(`div`,Vh,[U(`div`,{class:w([`status-badge`,b.value.class])},[(B(),H(Ki(b.value.icon),{size:13,class:w({"animate-spin":b.value.spin})},null,8,[`class`])),U(`span`,null,L(b.value.text),1)],2)])):G(``,!0)]),_:1}),U(`div`,Hh,[U(`button`,{class:w([`topbar-icon-btn publish-btn`,{"has-pending":_.value>0,"is-active-view":z(i).type===`publisher`}]),title:`Open Publishing Center`,onClick:t[2]||=e=>z(f)(!1)},[U(`div`,Uh,[q(z(Sh),{size:14,class:`btn-icon`}),_.value>0?(B(),V(`span`,Wh,L(_.value),1)):G(``,!0)])],2),U(`button`,{class:w([`topbar-icon-btn help-btn`,{"is-active-view":z(i).type===`help`}]),title:`Open Help & Architecture Guide`,onClick:h},[U(`div`,Gh,[q(z(fm),{size:15,class:`btn-icon`})])],2),U(`button`,{class:w([`topbar-icon-btn user-btn`,{"is-active-view":z(i).type===`user`}]),title:m.value,onClick:g},[U(`div`,qh,[q(z(Ph),{size:15,class:`btn-icon`})])],10,Kh)])],2))}}),Yh=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Xh=Yh(Jh,[[`__scopeId`,`data-v-7cc7ae14`]]);function Zh(e,t){let n=typeof window<`u`,r=t;if(n){let t=localStorage.getItem(e);if(t!==null)try{r=JSON.parse(t)}catch{r=t}}let i=R(r);return ni(i,t=>{n&&localStorage.setItem(e,JSON.stringify(t))},{deep:!0}),i}var Qh={key:0,class:`menu-divider`},$h=[`onClick`],eg=[`title`,`onClick`],tg=vi({__name:`NodeContextMenu`,props:{show:{type:Boolean},items:{},x:{},y:{},anchorRect:{},minWidth:{}},emits:[`select`,`action`,`close`],setup(e,{emit:t}){let n=e,r=t,i=R(null),a=R({top:0,left:0,transformOrigin:`top left`});ni(()=>[n.show,n.x,n.y,n.anchorRect],async()=>{if(!n.show)return;await Fr();let e=i.value,t=e?e.offsetWidth:190,r=e?e.offsetHeight:150,o=window.innerWidth,s=window.innerHeight,c=0,l=0,u,d=`top`,f=`left`;if(n.anchorRect){let e=n.anchorRect;u=`${e.width}px`,l=e.left,l+t>o-8&&(l=Math.max(8,e.right-t),f=`right`),e.bottom+6+r>s-8?(c=e.top-r-6,d=`bottom`):(c=e.bottom+6,d=`top`)}else l=n.x||0,c=n.y||0,l+t>o-8&&(l=Math.max(8,l-t),f=`right`),c+r>s-8&&(c=Math.max(8,c-r),d=`bottom`);a.value={top:Math.max(8,c),left:Math.max(8,l),width:u,transformOrigin:`${d} ${f}`}},{immediate:!0});let o=J(()=>({top:`${a.value.top}px`,left:`${a.value.left}px`,width:a.value.width||`auto`,minWidth:n.minWidth||`190px`,transformOrigin:a.value.transformOrigin})),s=e=>{if(!n.show)return;let t=e.target;if(!(i.value&&i.value.contains(t))){if(n.anchorRect){let{left:t,right:r,top:i,bottom:a}=n.anchorRect;if(e.clientX>=t&&e.clientX<=r&&e.clientY>=i&&e.clientY<=a)return}r(`close`)}};return ni(()=>n.show,e=>{e?setTimeout(()=>{document.addEventListener(`click`,s,!1)},0):document.removeEventListener(`click`,s,!1)},{immediate:!0}),Qs(()=>{document.removeEventListener(`click`,s,!1)}),(t,n)=>(B(),H(ys,{to:`body`},[e.show?(B(),V(`div`,{key:0,ref_key:`menuRef`,ref:i,class:`node-context-menu`,style:x(o.value),onClick:n[0]||=ld(()=>{},[`stop`])},[(B(!0),V(K,null,Xi(e.items,(e,t)=>(B(),V(K,{key:e.key||t},[e.divider?(B(),V(`div`,Qh)):(B(),V(`div`,{key:1,class:w([`menu-item-wrapper`,{"is-active":e.isActive}])},[U(`button`,{class:`menu-item`,onClick:t=>r(`select`,e.key)},[e.icon?(B(),H(Ki(e.icon),{key:0,size:15,class:`menu-icon`})):G(``,!0),U(`span`,null,L(e.label),1)],8,$h),e.hasAction?(B(),V(`button`,{key:0,class:`action-btn`,title:e.actionTitle,onClick:ld(t=>r(`action`,e.key),[`stop`])},[(B(),H(Ki(e.actionIcon),{size:14}))],8,eg)):G(``,!0)],2))],64))),128))],4)):G(``,!0)]))}}),ng={class:`channel-selector-row`},rg={class:`trigger-label`},ig=Yh(vi({__name:`ChannelOperations`,setup(e){let{allChannels:t,selectedChannelId:n,activeChannelSettings:r,activeViewMode:i,setViewMode:a,resetActiveNode:o}=sp(),{openCurrentChannelSettings:s,handleAddNewChannel:c,openChannelSettings:l}=Xp(),{confirmNavigation:u}=Op(),d=Zh(`kama_selected_channel`,`all`);Js(()=>{d.value&&(n.value=d.value)});let f=J(()=>i.value===`channel`),p=J(()=>{if(f.value&&r.value?.id){let e=String(r.value.id);if(e.startsWith(`draft-`)||r.value.isNew)return e}return n.value?String(n.value):`all`}),m=J(()=>{let e=[{key:`all`,label:`All Channels`,isActive:p.value===`all`}];if(Array.isArray(t.value)&&t.value.forEach(t=>{t&&t.id!==void 0&&e.push({key:String(t.id),label:t.label||t.key||`Channel ${t.id}`,isActive:p.value===String(t.id),hasAction:!0,actionIcon:Ch,actionTitle:`Channel Settings`})}),f.value&&r.value?.id){let t=String(r.value.id);(t.startsWith(`draft-`)||r.value.isNew)&&(e.some(e=>String(e.key)===t)||e.push({key:t,label:r.value.label||`New Channel...`,isActive:!0}))}return e.push({key:`divider-1`,divider:!0}),e.push({key:`__add_new__`,label:`Add Channel...`,icon:gh}),e}),h=J(()=>{let e=m.value.find(e=>String(e.key)===p.value);return e?e.label:`Select Channel`}),g=R(!1),_=R(null),v=R(null),y=()=>{if(g.value){g.value=!1;return}_.value&&(v.value=_.value.getBoundingClientRect()),g.value=!0},b=async e=>{if(g.value=!1,e===`__add_new__`){if(!await u())return;await c();return}let t=String(e);if(f.value){if(!await u())return;n.value=t,d.value=t,t===`all`?(a(`none`),o()):await s()}else n.value=t,d.value=t},x=async e=>{g.value=!1,await u()&&(n.value=String(e),d.value=String(e),typeof l==`function`?await l(e):await s())};return(e,t)=>(B(),V(`div`,ng,[U(`button`,{ref_key:`triggerRef`,ref:_,class:w([`channel-trigger-btn`,{"is-open":g.value}]),onClick:ld(y,[`stop`])},[q(z(zm),{size:15,class:`trigger-icon`}),U(`span`,rg,L(h.value),1),q(z(_m),{size:15,class:`trigger-chevron`})],2),q(tg,{show:g.value,items:m.value,"anchor-rect":v.value,onSelect:b,onAction:x,onClose:t[0]||=e=>g.value=!1},null,8,[`show`,`items`,`anchor-rect`])]))}}),[[`__scopeId`,`data-v-1633f33b`]]);function ag(e){Object.getOwnPropertySymbols(e).forEach(t=>{Py[t]=e[t]})}function og(e,t=``){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:zy}}function sg(e,t,n,r,i,a,o,s=!1,c=!1,l=!1,u=zy){return e&&(s?(e.helper(ey),e.helper(Tg(e.inSSR,l))):e.helper(wg(e.inSSR,l)),o&&e.helper(fy)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:a,directives:o,isBlock:s,disableTracking:c,isComponent:l,loc:u}}function cg(e,t=zy){return{type:17,loc:t,elements:e}}function lg(e,t=zy){return{type:15,loc:t,properties:e}}function ug(e,t){return{type:16,loc:zy,key:I(e)?dg(e,!0):e,value:t}}function dg(e,t=!1,n=zy,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function fg(e,t){return{type:5,loc:t,content:I(e)?dg(e,!1,t):e}}function pg(e,t=zy){return{type:8,loc:t,children:e}}function mg(e,t=[],n=zy){return{type:14,loc:n,callee:e,arguments:t}}function hg(e,t=void 0,n=!1,r=!1,i=zy){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function gg(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:zy}}function _g(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:zy}}function vg(e){return{type:21,body:e,loc:zy}}function yg(e){return{type:22,elements:e,loc:zy}}function bg(e,t,n){return{type:23,test:e,consequent:t,alternate:n,loc:zy}}function xg(e,t){return{type:24,left:e,right:t,loc:zy}}function Sg(e){return{type:25,expressions:e,loc:zy}}function Cg(e){return{type:26,returns:e,loc:zy}}function wg(e,t){return e||t?ry:iy}function Tg(e,t){return e||t?ty:ny}function Eg(e,{helper:t,removeHelper:n,inSSR:r}){e.isBlock||(e.isBlock=!0,n(wg(r,e.isComponent)),t(ey),t(Tg(r,e.isComponent)))}function Dg(e){return e>=97&&e<=122||e>=65&&e<=90}function Og(e){return e===32||e===10||e===9||e===12||e===13}function kg(e){return e===47||e===62||Og(e)}function Ag(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function jg(e,{compatConfig:t}){let n=t&&t[e];return e===`MODE`?n||3:n}function Mg(e,t){let n=jg(`MODE`,t),r=jg(e,t);return n===3?r===!0:r!==!1}function Ng(e,t,n,...r){return Mg(e,t)}function Pg(e,t,n,...r){if(jg(e,t)===`suppress-warning`)return;let{message:i,link:a}=Gy[e],o=`(deprecation ${e}) ${typeof i==`function`?i(...r):i}${a?`
5
+ `))),e[ed]=$u(i);let a=r||i.props&&i.props.type===`number`;Ml(e,t?`change`:`input`,t=>{t.target.composing||e[ed](Xl(e.value,n,a))}),(n||a)&&Ml(e,`change`,()=>{e.value=Xl(e.value,n,a)}),t||(Ml(e,`compositionstart`,Jl),Ml(e,`compositionend`,Yl),Ml(e,`change`,Yl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[td];delete e[td],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[ed](Xl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[ed]=$u(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?Ie(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},rd={deep:!0,created(e,t,n){e[ed]=$u(n),Ml(e,`change`,()=>{let t=e._modelValue,n=$l(e),r=e.checked,i=e[ed];if(P(t)){let e=re(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(pe(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(eu(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[ed]=$u(n),Zl(e,t,n)}},id={created(e,{value:t},n){e.checked=ne(t,n.props.value),e[ed]=$u(n),Ml(e,`change`,()=>{e[ed]($l(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[ed]=$u(r),t!==n&&(e.checked=ne(t,r.props.value))}},ad={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Ml(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Ie($l(e)):$l(e));e[ed](e.multiple?pe(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Fr(()=>{e._assigning=!1})}),e[ed]=$u(r)},mounted(e,{value:t}){Ql(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ed]=$u(n)},updated(e,{value:t}){e._assigning||Ql(e,t)}},od={created(e,t,n){nu(e,t,n,null,`created`)},mounted(e,t,n){nu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){nu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){nu(e,t,n,r,`updated`)}},sd=[`ctrl`,`shift`,`alt`,`meta`],cd={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>sd.some(n=>e[`${n}Key`]&&!t.includes(n))},ld=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=cd[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ud={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},dd=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=Ae(n.key);if(t.some(e=>e===r||ud[e]===r))return e(n)}))},fd=M({patchProp:Hu},hu),md=!1,hd=((...e)=>{iu().render(...e)}),gd=((...e)=>{au().hydrate(...e)}),_d=((...e)=>{let t=iu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=su(e);if(!r)return;let i=t._component;!F(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,ou(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),vd=((...e)=>{let t=au().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=su(e);if(t)return n(t,!0,ou(t))},t}),yd=!1,bd=()=>{yd||(yd=!0,ru(),Sl())}}));xd();function Sd(e){return e?{nodes:e.nodes||{},trees:e.trees||{},blocks:e.blocks||{},nodeLayouts:e.nodeLayouts||{},blockLayouts:e.blockLayouts||{},channels:e.channels||{}}:{nodes:{},trees:{},blocks:{},nodeLayouts:{},blockLayouts:{},channels:{}}}function Cd(e){return Sd(e).nodes}function wd(e){return Sd(e).trees}function Td(e){return Sd(e).blocks}function Ed(e){return Sd(e).nodeLayouts}function Dd(e){return Sd(e).blockLayouts}function Od(e){return Sd(e).channels}var kd=R(!1),Ad=R(`Unsaved Changes`),jd=R(`You have unsaved changes. Are you sure you want to discard them?`),Md=R(`Discard Changes`),Nd=R(`Keep Editing`),Pd;function Fd(){return{isOpen:kd,title:Ad,message:jd,confirmLabel:Md,cancelLabel:Nd,confirmDiscard:(e,t,n,r)=>(e&&(jd.value=e),t&&(Ad.value=t),Md.value=n||`Discard Changes`,Nd.value=r||`Keep Editing`,kd.value=!0,new Promise(e=>{Pd=e})),handleConfirm:()=>{kd.value=!1,Pd&&Pd(!0)},handleCancel:()=>{kd.value=!1,Pd&&Pd(!1)}}}var Id=`kama_cms_offline_queue`,Ld=new Map,Rd=new Map,zd=R({hasConflict:!1,nodeId:null,serverData:null});function Bd(){let{isPendingOfflineSave:e,isDocumentUnverified:t}=sp(),n=()=>{if(typeof window>`u`)return{};try{let e=localStorage.getItem(Id);return e?JSON.parse(e):{}}catch(e){return console.warn(`⚠️ Failed to parse offline queue from LocalStorage:`,e),{}}},r=(t,r)=>{if(!(typeof window>`u`))try{let i=n();i[String(t)]={data:JSON.parse(JSON.stringify(r)),timestamp:Date.now()},localStorage.setItem(Id,JSON.stringify(i)),e.value=!0}catch(e){console.error(`❌ Failed to persist offline draft to storage:`,e)}},i=e=>n()[String(e)]||null,a=t=>{if(!(typeof window>`u`))try{let r=n();delete r[String(t)],localStorage.setItem(Id,JSON.stringify(r));let i=Object.keys(r);e.value=i.length>0}catch(e){console.warn(`⚠️ Failed to clear offline draft from storage:`,e)}},o=e=>{t.value=e},s=async t=>{let r=n(),i=Object.keys(r);if(i.length===0){e.value=!1;return}e.value=!0;for(let e of i)try{await t(e)&&a(e)}catch(t){console.error(`❌ Auto-sync failed for node ${e}:`,t)}let o=Object.keys(n());e.value=o.length>0},c=e=>Ld.get(String(e)),l=(e,t)=>{Ld.set(String(e),{node:JSON.parse(JSON.stringify(t.node)),blocks:JSON.parse(JSON.stringify(t.blocks)),regionMeta:JSON.parse(JSON.stringify(t.regionMeta))}),String(zd.value.nodeId)===String(e)&&h()},u=e=>{Ld.delete(String(e)),a(e)},d=()=>{Ld.clear(),Rd.clear()},f=e=>Rd.get(e),p=(e,t)=>{Rd.set(e,JSON.parse(JSON.stringify(t)))},m=e=>{Rd.clear();let t=String(e);for(let[e]of Ld.entries())e!==t&&Ld.delete(e)},h=()=>{zd.value={hasConflict:!1,nodeId:null,serverData:null}};return{conflictState:zd,getCachedDocument:c,saveToCache:l,clearCache:u,clearEntireCache:d,invalidateAfterSave:m,clearConflict:h,evaluateServerResponse:(e,t,n)=>{let r=c(e);if(i(e))return zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`};if(!r)return n?(zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`}):{action:`update_silently`};let a=new Date(r.node.updatedAt||0).getTime();return new Date(t.node.updatedAt||0).getTime()>a&&n?(zd.value={hasConflict:!0,nodeId:e,serverData:t},{action:`show_conflict_warning`}):{action:`update_silently`}},resolveWithServer:e=>{if(!zd.value.serverData||!zd.value.nodeId)return;let t=zd.value.serverData,n=zd.value.nodeId;a(n),l(String(n),t),e(t),h()},resolveWithLocal:()=>{h()},getCachedInheritedRegion:f,setCachedInheritedRegion:p,persistOfflineDraft:r,getPersistedOfflineDraft:i,clearPersistedOfflineDraft:a,processOfflineQueue:s,markUnverified:o}}var Vd={"Content-Type":`application/json`},Hd={async getNode(e){return fetch(`/api/cms/nodes.json?id=${e}`)},async getInheritedRegion(e,t,n,r){let i=r?`&channelId=${r}`:``;return fetch(`/api/v1/node/${encodeURIComponent(e)}?treeId=${t}&lang=${n}&preview=true${i}`)},async saveNode(e){return fetch(`/api/cms/nodes.json`,{method:`POST`,headers:Vd,body:JSON.stringify({node:e})})},async createInTree(e){return fetch(`/api/cms/tree.json`,{method:`POST`,headers:Vd,body:JSON.stringify(e)})},async publishNode(e){return fetch(`/api/cms/nodes/publish`,{method:`POST`,headers:Vd,body:JSON.stringify({id:e})})},async deleteNode(e){return fetch(`/api/cms/nodes.json?id=${e}`,{method:`DELETE`})},async restoreNode(e){return fetch(`/api/cms/nodes/restore`,{method:`POST`,headers:Vd,body:JSON.stringify({id:e})})},async purgeNode(e){return fetch(`/api/cms/nodes/purge?id=${e}`,{method:`DELETE`})},async toggleVisibility(e,t){return fetch(`/api/cms/nodes.json`,{method:`POST`,headers:Vd,body:JSON.stringify({node:{id:e,isHidden:t}})})},async getNodeRevisions(e){return fetch(`/api/cms/nodes/${e}/revisions`)},async getSnapshot(e,t){return fetch(`/api/cms/nodes/${e}/revisions/${t}`)},async restoreSnapshot(e,t){return fetch(`/api/cms/nodes/${e}/revisions/${t}/restore`,{method:`POST`,headers:Vd})}},Ud=R(typeof navigator<`u`&&!navigator.onLine),Wd=R(Ud.value?`offline`:`online`),Gd=R(!1),Kd=R(!1),qd=R(null),Jd=R(!1),Yd=R(!1),Xd=R(null),Zd=R(null);typeof window<`u`&&(window.addEventListener(`online`,()=>{Ud.value=!1,Wd.value=`online`;let e=Bd();e.processOfflineQueue(async t=>{try{let n=e.getPersistedOfflineDraft(t);if(!n)return!0;let r=n.data,i=[];Object.entries(r.blocks||{}).forEach(([e,t])=>{r.regionMeta?.[e]?.isInherited||t.forEach((t,n)=>{i.push({instanceId:String(t.instanceId||t.id),componentId:t.componentId||t.elementType||`text-block`,elementType:t.componentId||t.elementType||`text-block`,region:e,sortOrder:n,data:t.data||{}})})});let a={id:typeof t==`number`?t:Number(t)||null,...r.node,blocks:i};return delete a.isNew,delete a._draftParentId,delete a._isTreeDraft,delete a.trees,(await Hd.saveNode(a)).ok}catch{return!1}})}),window.addEventListener(`offline`,()=>{Ud.value=!0,Wd.value=`offline`}));var Qd=R({type:`dashboard`}),$d=R(`none`),ef=R(`content`),tf=R(!1),nf=R([]),rf=R(null),af=R(``),of=R(null),sf=R([]),cf=R(null),lf=R(``),uf=R([]),df=R([]),ff=R(`all`),pf=R(``),mf=R(`updatedAt`),hf=R(`DESC`),gf=R(null),_f=R({}),vf=R(null),yf=R(null),bf=R({}),xf=R({}),Sf=R({}),Cf=R({}),wf=R({}),Tf=R(!1),Ef=R(!1),Df=R(!1),Of=()=>({id:``,title:``,slug:``,nodeType:`node`,channelId:``,language:null,isHidden:!1,status:`draft`,publishedAt:null,children:[],disabledRegions:{}}),kf=R(Of()),Af=R({}),jf=R({}),Mf=R(null),Nf=R({}),Pf=R(``),Ff=R(``),If=R(``),Lf=R({total:0,byType:[]}),Rf=R(!1),zf=()=>{Rf.value=!1},Bf=J(()=>Qd.value.type===`dashboard`?`none`:Qd.value.type),Vf=J(()=>Qd.value.type===`node`&&Qd.value.id||null),Hf=J(()=>Gd.value),Uf=J(()=>Xd.value!==null),Wf=(e,t)=>{if(!e)return{};let n={};for(let[t,r]of Object.entries(e))t!==`isHidden`&&t!==`hidden`&&t!==`is_hidden`&&t!==`channels`&&t!==`trees`&&t!==`hasUnpublishedChanges`&&t!==`status`&&(n[t]=r&&typeof r==`object`&&typeof r.id==`string`&&r.id.startsWith(`ast_`)?r.id:r);let r=e.nodeType||e.contentType,i=r?t[r]:null;if(i?.fields)for(let[e,t]of Object.entries(i.fields))t?.liveSync===!0&&delete n[e];return n},Gf=J(()=>{if(Df.value||Uf.value||!Pf.value)return!1;let e=JSON.stringify({node:Wf(kf.value,xf.value),blocks:Af.value}),t=JSON.parse(Pf.value||`{}`);return e!==JSON.stringify({node:Wf(t.node||{},xf.value),blocks:t.blocks||{}})}),Kf=J(()=>!Ff.value||!rf.value?!1:JSON.stringify(rf.value)!==Ff.value),qf=J(()=>!If.value||!cf.value?!1:JSON.stringify(cf.value)!==If.value),Jf=J(()=>Uf.value||!kf.value?.id?!1:kf.value.hasUnpublishedChanges===!0||kf.value.status===`draft`||Gf.value),Yf=async()=>{let{confirmDiscard:e}=Fd(),t=kf.value?.isNew===!0&&String(kf.value?.id||``).startsWith(`draft-`),n=!!(kf.value?.title||``).trim(),r=Object.values(Af.value||{}).some(e=>e.length>0),i=n||r,a=Gf.value&&(!t||i);return Bf.value===`node`&&(a||Kd.value)?await e(`You have unsaved changes on the active document. Are you sure you want to discard them?`,`Discard Document Changes?`,`Discard Changes`,`Keep Editing`):!0},Xf=async(e,t=!1)=>{!t&&Xd.value===null&&!await Yf()||(Qd.value=e,Xd.value=null,Zd.value=null,e.type===`channel`||e.type===`tree`?ef.value=`settings`:e.type===`node`&&(ef.value=`content`),e.type!==`node`&&e.type!==`asset`&&(kf.value=Of(),Pf.value=``,Af.value={}),e.type!==`channel`&&(rf.value=null,Ff.value=``),e.type!==`tree`&&(cf.value=null,If.value=``))},Zf=async(e,t=!1)=>{e===`none`?($d.value=`none`,await Xf({type:`dashboard`},t)):((e===`tree`||e===`channel`)&&($d.value=e),await Xf({type:e},t))},Qf=(e=!1)=>Zf(`none`,e),$f=(e,t=`vault`,n=!1)=>{$d.value=t,Xf({type:`node`,id:e},n)},ep=(e,t=!1)=>{$d.value=`channel`,Xf({type:`channel`,id:e},t)},tp=(e,t=!1)=>{$d.value=`tree`,Xf({type:`tree`,id:e},t)},np=(e=!1)=>{$d.value=`none`,Xf({type:`publisher`},e)},rp=()=>{kf.value=Of(),Af.value={},jf.value={},Mf.value=null,Nf.value={},Pf.value=``,Df.value=!1,Gd.value=!1,Xd.value=null,Zd.value=null},ip=(e,t,n)=>{if(!e&&!n)return;let r=t=>e&&String(t.id)===String(e)||n&&t.treeNodeId&&String(t.treeNodeId)===String(n);kf.value&&r(kf.value)&&Object.assign(kf.value,t);let i=e=>{if(Array.isArray(e))for(let n=0;n<e.length;n++)r(e[n])&&Object.assign(e[n],t),e[n].children&&e[n].children.length>0&&i(e[n].children)};if(i(uf.value),Array.isArray(df.value))for(let e=0;e<df.value.length;e++)r(df.value[e])&&Object.assign(df.value[e],t)},ap=e=>{e.nodes&&(xf.value=e.nodes),e.trees&&(bf.value=e.trees),e.channels&&(_f.value=e.channels),(e.blocks||e.elements)&&(Sf.value=e.blocks||e.elements),Cf.value=e.nodeLayouts&&Object.keys(e.nodeLayouts).length>0?e.nodeLayouts:Ed(),wf.value=e.blockLayouts&&Object.keys(e.blockLayouts).length>0?e.blockLayouts:Dd(),e.channelTemplate!==void 0&&(gf.value=e.channelTemplate),e.userTemplate!==void 0&&(vf.value=e.userTemplate),e.treeTemplate!==void 0&&(yf.value=e.treeTemplate),Ef.value=!0},op=async(e=`/api/cms/schemas.json`)=>{if(!Tf.value){Tf.value=!0;try{let t=await fetch(e,{headers:{Accept:`application/json`}});if(!t.ok)throw Error(`Failed to load schemas`);ap(await t.json())}catch(e){console.warn(`⚠️ API failed to load schemas, using local fallbacks`,e),xf.value=Cd(),bf.value=wd(),_f.value=Od(),Sf.value=Td(),Cf.value=Ed(),wf.value=Dd(),Ef.value=!0}finally{Tf.value=!1}}};function sp(){return{isOffline:Ud,connectionStatus:Wd,isDocumentUnverified:Gd,isPendingOfflineSave:Kd,isReadOnlyMode:Hf,isSnapshotMode:Uf,isSaving:Jd,isAutoSavePending:Yd,blockClipboard:qd,activeSnapshotVersion:Xd,draftBackup:Zd,activeView:Qd,activeViewMode:Bf,activeContentId:Vf,workspaceContext:$d,setViewMode:Zf,navigateTo:Xf,goToDashboard:Qf,openNode:$f,openChannel:ep,openTree:tp,openPublisher:np,activeTab:ef,shouldFocusTitle:tf,allChannels:nf,activeChannelSettings:rf,selectedChannelId:af,selectedLanguage:of,availableTrees:sf,activeTreeSettings:cf,selectedTreeId:lf,nodeTree:uf,vaultNodes:df,currentVaultType:ff,currentVaultSearch:pf,currentVaultSort:mf,currentVaultOrder:hf,channelTemplateSchema:gf,channelSchemas:_f,userTemplateSchema:vf,treeTemplateSchema:yf,treeSchemas:bf,nodeSchemas:xf,blockSchemas:Sf,nodeLayoutSchemas:Cf,blockLayoutSchemas:wf,isSchemasLoading:Tf,isSchemasLoaded:Ef,setSchemas:ap,fetchSchemas:op,isDocumentLoading:Df,activeNode:kf,resetActiveNode:rp,isNodeDirty:Gf,isChannelDirty:Kf,isTreeDirty:qf,hasUnpublishedChanges:Jf,nodeSnapshot:Pf,channelSnapshot:Ff,siteSnapshot:Ff,treeSnapshot:If,updateNodeInState:ip,blocks:Af,regionMeta:jf,selectedBlock:Mf,validationErrors:Nf,vaultStats:Lf,hasLoadedStats:Rf,invalidateStats:zf,confirmDiscardUnsaved:Yf}}var cp=e=>e==null||typeof e==`string`&&e.trim()===``,lp={required:(e,t,n)=>(t===!0||String(t).toLowerCase()===`true`)&&cp(e)?n.rules?.customMessage||`${n.label||`This field`} is required.`:``,min:(e,t,n)=>cp(e)||typeof t!=`number`?``:typeof e==`number`&&e<t?n.rules?.customMessage||`${n.label||`Field`} must be at least ${t}.`:typeof e==`string`&&e.length<t?n.rules?.customMessage||`${n.label||`Field`} must be at least ${t} characters.`:``,max:(e,t,n)=>cp(e)||typeof t!=`number`?``:typeof e==`number`&&e>t?n.rules?.customMessage||`${n.label||`Field`} cannot exceed ${t}.`:typeof e==`string`&&e.length>t?n.rules?.customMessage||`${n.label||`Field`} cannot exceed ${t} characters.`:``,email:(e,t,n)=>t!==!0&&String(t).toLowerCase()!==`true`||cp(e)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))?``:n.rules?.customMessage||`Please enter a valid email address.`,pattern:(e,t,n)=>{if(cp(e)||!t||typeof t!=`string`)return``;try{if(!new RegExp(t).test(String(e)))return n.rules?.customMessage||`${n.label||`Field`} format is invalid.`}catch{console.warn(`[Validators] Invalid pattern for ${n.label||`field`}:`,t)}return``},unique:async(e,t,n,r)=>(t!==!0&&String(t).toLowerCase()!==`true`||cp(e),``),uniqueSibling:async(e,t,n,r)=>(t!==!0&&String(t).toLowerCase()!==`true`||cp(e),``)};function up(e,t){lp[e]=t}function dp(){let e=Object.assign({"../../definitions/validators/iban.ts":f,"../../definitions/validators/magic-word.ts":m});for(let t in e){let n=e[t];if(!n)continue;let r=t.split(`/`).pop()?.replace(/\.ts$/,``)||``;for(let[e,t]of Object.entries(n))typeof t==`function`&&up(e==="default"?r:e,t)}}dp();function fp(e,t,n){if(!n||typeof n!=`object`)return``;let r=n.rules||{},i={fieldKey:e};if((n.required===!0||String(n.required).toLowerCase()===`true`||r.required===!0||String(r.required).toLowerCase()===`true`)&&cp(t))return r.customMessage||`${n.label||e} is required.`;for(let[e,a]of Object.entries(r)){if(e===`customMessage`||e===`uniqueMessage`||e===`unique`||e===`uniqueSibling`||e===`required`)continue;let r=lp[e];if(r){let e=r(t,a,n,i);if(typeof e==`string`&&e!==``)return e}}return``}async function pp(e,t,n,r){if(!n||typeof n!=`object`)return``;let i=fp(e,t,n);if(i)return i;let a={...n.rules};n.unique!==void 0&&a.unique===void 0&&(a.unique=n.unique);let o={fieldKey:e,entityType:r?.entityType,excludeId:r?.excludeId,formData:r?.formData};for(let[e,r]of Object.entries(a)){if(e===`customMessage`||e===`uniqueMessage`)continue;let i=lp[e];if(i){let e=await i(t,r,n,o);if(e)return e}}return``}function mp(e){for(let t in e){let n=e[t];if(n)for(let[e,t]of Object.entries(n))typeof t==`function`&&up(e,t)}}function hp(){let{validationErrors:e}=sp(),t=(e,t)=>{if(e)return t in e?e[t]:t.split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)};return{validateAgainstSchema:async(n,r,i)=>{let a={};if(!n||!r)return e.value=a,!0;let o={...r.fields||{}};if(r.tabs&&typeof r.tabs==`object`&&Object.values(r.tabs).forEach(e=>{e?.fields&&(Array.isArray(e.fields)?e.fields.forEach(e=>{typeof e==`object`&&e&&Object.entries(e).forEach(([e,t])=>{o[e]={...o[e]||{},...t}})}):typeof e.fields==`object`&&Object.entries(e.fields).forEach(([e,t])=>{o[e]={...o[e]||{},...t}}))}),Object.keys(o).length===0)return e.value=a,!0;let s=n.id,c=typeof s==`number`||s&&!String(s).startsWith(`draft-`)?String(s):``;for(let[e,r]of Object.entries(o)){if(!r||typeof r!=`object`)continue;let o=await pp(e,t(n,e),r,{entityType:i,excludeId:c,formData:n});o&&(a[e]=o)}return e.value=a,Object.keys(a).length===0}}}var gp=null,_p=null;function vp(){let{allChannels:e,selectedChannelId:t,availableTrees:n,channelSchemas:r,treeSchemas:i}=sp(),a=async()=>{gp?.abort(),gp=new AbortController;try{let[n,i]=await Promise.all([fetch(`/api/cms/schemas.json`,{signal:gp.signal}),fetch(`/api/cms/channels.json`,{signal:gp.signal})]);if(n.ok){let e=await n.json();e.channelSchemas&&(r.value=e.channelSchemas)}if(i.ok){let n=await i.json();e.value=n.channels||[],!t.value&&n.channels?.length>0&&(t.value=String(n.channels[0].id))}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;console.error(`[CMS Sync] Failed to fetch channels:`,e)}},o=async()=>{_p?.abort(),_p=new AbortController;try{let[e,t]=await Promise.all([fetch(`/api/cms/schemas.json`,{signal:_p.signal}),fetch(`/api/cms/trees.json`,{signal:_p.signal})]);if(e.ok){let t=await e.json();t.treeSchemas&&(i.value=t.treeSchemas)}if(t.ok){let e=await t.json();n.value=Array.isArray(e)?e:[]}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;console.error(`[CMS Sync] Failed to load trees:`,e)}};return{fetchChannels:a,fetchTrees:o,syncSystemMetadata:async()=>{await Promise.all([a(),o()])}}}function yp(e){return e===!0||e===1||String(e)===`true`||String(e)===`1`}function bp(e){if(!e)return{isDraft:!1,isUnpublishedDraft:!1,isHidden:!1,isScheduled:!1,isCurrentlyVisible:!1,hasUnpublishedChanges:!1,statusBadge:`active`,badgeLabel:`Unknown`};let t=!!(e.isNew||!e.id||String(e.id).startsWith(`draft-`)),n=!t&&e.status===`draft`&&!e.publishedAt,r=yp(e.isHidden)||yp(e.disabled),i=!t&&!n&&yp(e.hasUnpublishedChanges),a=e.startShowingAt?new Date(e.startShowingAt).getTime():null,o=e.stopShowingAt?new Date(e.stopShowingAt).getTime():null,s=!!(a||o),c=Date.now(),l=!0,u=`valid`;a&&c<a?(l=!1,u=`pending`):o&&c>o&&(l=!1,u=`expired`);let d=!t&&!n&&!r&&l,f=`active`,p=`Visible`;return t?(f=`draft`,p=`Unsaved`):n?(f=`unpublished_draft`,p=`Draft`):i?(f=`unpublished_changes`,p=`Unpublished Changes`):r?(f=`hidden`,p=`Hidden`):u===`pending`?(f=`scheduled_pending`,p=`Scheduled`):u===`expired`&&(f=`scheduled_expired`,p=`Expired`),{isDraft:t,isUnpublishedDraft:n,isHidden:r,isScheduled:s,isCurrentlyVisible:d,hasUnpublishedChanges:i,statusBadge:f,badgeLabel:p}}function xp(e,t){let n=e.value||{};return Object.keys(n).length===0&&(n=t(),e.value=n),n}function Sp(e,t){if(t&&e[t])return t;let n=Object.keys(e||{});return n.length===1?n[0]:``}function Cp(e,t){let n={...t?.fields||{},...e?.fields||{}};return e?.tabs&&typeof e.tabs==`object`&&Object.values(e.tabs).forEach(e=>{e?.fields&&typeof e.fields==`object`&&(n={...n,...e.fields})}),n}function wp(e){return Object.values(e||{}).map(e=>({value:e.id,label:e.label||e.id}))}function Tp(e,t=!1){let n=t?`label`:`title`;if(!e)return[{key:n,config:{type:`text`,label:`Page Title`}}];let r=Cp(e),i=[];if(e.titleTemplate){let t=[...e.titleTemplate.matchAll(/{([^}]+)}/g)];for(let e of t){let t=e[1].trim();if(!i.some(e=>e.key===t)){let e=r[t]||{type:`text`,label:t};i.push({key:t,config:{...e}})}}if(i.length>0)return i}return r[n]?[{key:n,config:{...r[n]}}]:[{key:n,config:{type:`text`,label:e.label||`Page Title`}}]}function Ep(e,t){if(!t)return`Untitled ${e?.label||`Node`}`;if(Cp(e).title&&t.title&&String(t.title).trim()!==``)return String(t.title).trim();if(e?.titleTemplate){let n=e.titleTemplate.replace(/{([^}]+)}/g,(e,n)=>{let r=t[n.trim()];return r==null?``:String(r)});if(n=n.replace(/\s+/g,` `).replace(/^[\s,\-]+|[\s,\-]+$/g,``).trim(),n)return n}return t.title&&String(t.title).trim()!==``?String(t.title).trim():`Untitled ${e?.label||`Node`}`}var Dp=(e,t)=>{if(!e)return{};let n={},r=e.nodeType||e.contentType,i=r?t[r]:null,a=new Set([`id`,`title`,`slug`,`nodeType`,`channelId`,`language`]);i&&(i.fields&&Object.entries(i.fields).forEach(([e,t])=>{t?.liveSync!==!0&&a.add(e)}),i.tabs&&Object.values(i.tabs).forEach(e=>{e.fields&&Object.entries(e.fields).forEach(([e,t])=>{t?.liveSync!==!0&&a.add(e)})}));let o=Object.keys(e).filter(e=>a.has(e)).sort();for(let t of o){let r=e[t];n[t]=r&&typeof r==`object`&&typeof r.id==`string`&&r.id.startsWith(`ast_`)?r.id:r}return n};function Op(){let e=sp(),{confirmDiscard:t}=Fd(),n=J(()=>{if(e.isDocumentLoading.value||e.isSnapshotMode.value||!e.nodeSnapshot.value)return!1;let t=JSON.parse(e.nodeSnapshot.value||`{}`),n=t.node||{};return e.activeNode.value.id===n.id&&JSON.stringify({node:Dp(e.activeNode.value,e.nodeSchemas.value),blocks:e.blocks.value})!==JSON.stringify({node:Dp(n,e.nodeSchemas.value),blocks:t.blocks||{}})}),r=J(()=>e.isSnapshotMode.value||!e.treeSnapshot.value||!e.activeTreeSettings.value?!1:JSON.stringify(e.activeTreeSettings.value)!==e.treeSnapshot.value),i=J(()=>e.isSnapshotMode.value||!e.channelSnapshot.value||!e.activeChannelSettings.value?!1:JSON.stringify(e.activeChannelSettings.value)!==e.channelSnapshot.value),a=J(()=>e.isSnapshotMode.value?!1:e.activeViewMode.value===`node`?n.value:e.activeViewMode.value===`tree`?r.value:e.activeViewMode.value===`channel`&&i.value);return{isNodeDirty:n,isTreeDirty:r,isChannelDirty:i,isGlobalDirty:a,confirmNavigation:async()=>!a.value||await t(`You have unsaved changes. If you leave, your changes will be lost.`,`Discard unsaved changes?`,`Discard Changes`,`Cancel`)}}var kp=0,Ap=0,jp=R({});function Mp(){let{allChannels:e,selectedChannelId:t,selectedLanguage:n,availableTrees:r,activeTreeSettings:i,selectedTreeId:a,nodeTree:o,vaultNodes:s,treeTemplateSchema:c,treeSchemas:l,activeNode:u,blocks:d,regionMeta:f,selectedBlock:p,validationErrors:m,nodeSnapshot:h,treeSnapshot:g,activeTab:_,shouldFocusTitle:v,setViewMode:y,currentVaultType:b,currentVaultSearch:x,currentVaultSort:S,currentVaultOrder:C}=sp(),{validateAgainstSchema:w}=hp(),{fetchTrees:T,fetchChannels:E,syncSystemMetadata:D}=vp(),{confirmNavigation:O}=Op(),k=R(!1),ee=R(!0),A=R(0),te=()=>xp(l,wd),ne=()=>{g.value=JSON.stringify(i.value||{})},re=J(()=>{if(!t.value||t.value===`all`)return r.value.map(e=>({id:e.id,key:e.key,label:e.label||e.key||`Tree ${e.id}`}));let n=e.value.find(e=>String(e.id)===String(t.value));return!n||!Array.isArray(n.trees)?[]:n.trees.map(e=>{let t=typeof e==`object`?e.treeId||e.id:e;if(!t)return null;let n=r.value.find(e=>String(e.id)===String(t)||e.key===t);return n?{id:n.id,key:n.key,label:n.label||n.key||`Tree ${n.id}`}:null}).filter(Boolean)}),ie=(e,t,n=null)=>{for(let r of e){if(String(r.id)===String(t))return n;if(r.children&&r.children.length>0){let e=ie(r.children,t,r);if(e)return e}}return null},j=(e,t)=>{if(!e||!Array.isArray(e))return!1;for(let n of e){if(String(n.id)===String(t.id))return n.disabledRegions={...t.disabledRegions||{}},t.channels&&(n.channels=t.channels),t.title!==void 0&&(n.title=t.title),t.slug!==void 0&&(n.slug=t.slug),t.isHidden!==void 0&&(n.isHidden=yp(t.isHidden)),t.status!==void 0&&(n.status=t.status),t.isDraft!==void 0&&(n.isDraft=yp(t.isDraft)),t.draftDataJson!==void 0&&(n.draftDataJson=t.draftDataJson),t.dataJson!==void 0&&(n.dataJson=t.dataJson),!0;if(n.children&&n.children.length>0&&j(n.children,t))return!0}return!1},ae=J(()=>u.value?.id?!!ie(o.value,u.value.id):!1),oe=e=>jp.value[e]||[],se=async e=>{if(e)try{let r=t.value&&t.value!==`all`?`&channelId=${t.value}`:``,i=await fetch(`/api/cms/tree.json?treeId=${e}&lang=${n.value}&preview=true${r}`);if(i.ok){let t=await i.json(),n=Array.isArray(t)?t:t.tree||[],r=new Set,s=[];for(let e of n){if(e.deletedAt&&String(e.deletedAt).trim()!==``)continue;let t=String(e.id);r.has(t)||(r.add(t),s.push({...e,isHidden:yp(e.isHidden),isDraft:e.isDraft===void 0?void 0:yp(e.isDraft)}))}jp.value[e]=s,String(e)===String(a.value)&&(o.value=s)}}catch(t){console.error(`[CMS] Failed to fetch nodes for tree ${e}:`,t)}},ce=async()=>{if(!a.value){o.value=[];return}++kp,await se(a.value)},le=async(e,r)=>{jp.value[e]=r,String(e)===String(a.value)&&(o.value=r);try{let i={treeId:e,language:n.value,tree:r};t.value&&t.value!==`all`&&(i.channelId=t.value);let a=await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(`[Tree Save] HTTP ${a.status}: ${e.error||`Unknown error`}`)}}catch(t){throw console.error(`[Tree Sync] Failed to save node order for tree ${e}:`,t),t}},M=async()=>{a.value&&await le(a.value,jp.value[a.value]||o.value)},ue=async e=>{let n=!1,r=``,i=``;typeof e==`string`?(b.value=e,n=!0):e&&typeof e==`object`&&(n=e.reset??!1,e.type!==void 0&&(b.value=e.type),e.search!==void 0&&(x.value=e.search),e.sort!==void 0&&(S.value=e.sort),e.order!==void 0&&(C.value=e.order),e.ensureItemId&&(r=e.ensureItemId),e.assetId&&(i=e.assetId));let a=Array.isArray(b.value)&&b.value.length>0?b.value.join(`,`):b.value||`all`,o=x.value||``;if(!n&&k.value||!n&&!ee.value)return;let c=++Ap;n&&(A.value=0,ee.value=!0,s.value=[]),k.value=!0;try{let e=new URLSearchParams({limit:`50`,offset:String(A.value),sort:S.value,order:C.value});a&&a!==`all`&&e.append(`type`,a),o.trim()&&e.append(`q`,o.trim()),t.value&&t.value!==`all`&&e.append(`channelId`,t.value),r&&e.append(`ensureItemId`,r),i&&e.append(`assetId`,i);let l=await fetch(`/api/cms/nodes.json?${e.toString()}`);if(c!==Ap)return;if(!l.ok)throw Error(`Failed to fetch vault nodes (${l.status})`);let u=await l.json(),d=(Array.isArray(u)?u:u.items||[]).map(e=>({...e,isHidden:yp(e.isHidden)}));ee.value=!Array.isArray(u)&&!!u.hasMore,s.value=n?d:[...s.value,...d],A.value+=d.length}catch(e){c===Ap&&console.error(`[CMS] Failed to fetch vault nodes:`,e)}finally{c===Ap&&(k.value=!1)}},de=async n=>{if(!t.value||t.value===`all`)return;let i=e.value.findIndex(e=>String(e.id)===String(t.value));if(i>-1){let t=e.value[i],o=Array.isArray(t.trees)?[...t.trees]:[],s=r.value.find(e=>String(e.id)===String(n)||e.key===n),c=s?s.id:n,l=s?s.key:String(n);o.some(e=>String(typeof e==`object`?e.treeId||e.id:e)===String(c)||(typeof e==`object`?e.treeId||e.id:e)===l)||(o.push({treeId:c,key:l}),(await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,trees:o})})).ok&&await E()),a.value=String(c),await ce()}},N=async n=>{if(!t.value||t.value===`all`)return;let r=e.value.findIndex(e=>String(e.id)===String(t.value));if(r>-1){let t={...e.value[r]};Array.isArray(t.trees)&&(t.trees=t.trees.filter(e=>String(typeof e==`object`?e.treeId||e.id:e)!==String(n)),await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),await E());let i=re.value;a.value=i.length>0?String(i[0].id):``,await ce()}},P=async(n,r)=>{if(!t.value||t.value===`all`)return;let i=e.value.findIndex(e=>String(e.id)===String(t.value));if(i>-1){let t={...e.value[i]},a=Array.isArray(t.trees)?[...t.trees]:[];if(n<0||n>=a.length||r<0||r>=a.length)return;let[o]=a.splice(n,1);a.splice(r,0,o),t.trees=a,e.value[i]=t;try{await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}catch(e){console.error(`Failed to reorder channel trees:`,e)}}},fe=async()=>{i.value=null,g.value=``,await y(`none`,!0)};return{currentChannelTrees:re,hasParentNode:ae,isLoading:k,hasMore:ee,treeNodesMap:jp,getNodesForTree:oe,fetchNodeTreeForId:se,saveTreeOrderForId:le,reorderChannelTrees:P,fetchTrees:T,fetchNodeTree:ce,fetchVaultNodes:ue,linkTreeToChannel:de,unlinkTreeFromChannel:N,handleAddNewTree:async()=>{if(!await O())return!1;let e=te(),n=Sp(e),r={id:`draft-${Date.now()}`,isNew:!0,key:``,label:``,treeType:n,channels:t.value&&t.value!==`all`?[Number(t.value)||t.value]:[]};if(n&&e[n]){let t=Cp(e[n],c.value);for(let[e,n]of Object.entries(t))r[e]===void 0&&(r[e]=n?.default??``)}return i.value=r,ne(),m.value={},await y(`tree`,!0),!0},cancelNewTree:fe,saveTreeSettings:async()=>{if(!i.value)return!1;m.value={};let e=te(),n=!i.value.id||String(i.value.id).startsWith(`draft-`),r=i.value.treeType||Object.keys(e)[0]||`navigation`,o=e[r]||{};if(!await w(i.value,{fields:Cp(o,c.value)},`tree`))return!1;try{let e=i.value.id,o={...JSON.parse(JSON.stringify(i.value)),id:n?null:typeof e==`number`?e:Number(e)||null,treeType:r};delete o.isNew;let s=await fetch(`/api/cms/trees.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(s.ok){let e=(await s.json()).id;return i.value.id=e,i.value.treeType=r,delete i.value.isNew,await D(),ne(),n&&t.value&&t.value!==`all`?await de(e):(a.value=String(e),await ce()),await y(`tree`,!0),!0}{let e=await s.json().catch(()=>({}));return s.status===409&&e.field&&(m.value={[e.field]:e.error||`This key is already in use.`}),!1}}catch(e){return console.error(`[CMS] Error saving tree settings:`,e),!1}},deleteTree:async t=>{let n=t||i.value?.id;if(n){if(String(n).startsWith(`draft-`)){await fe();return}try{let t=await fetch(`/api/cms/trees.json?id=${n}`,{method:`DELETE`});if(t.ok){i.value=null,e.value.forEach(e=>{Array.isArray(e.trees)&&(e.trees=e.trees.filter(e=>{let t=typeof e==`object`?e.treeId||e.id:e;return String(t)!==String(n)}))}),await D();let t=re.value;if(t.length>0){let e=String(t[0].id);a.value=e,await ce()}else a.value=``,o.value=[],await y(`none`,!0)}else{let e=await t.json().catch(()=>({}));alert(`Failed to delete tree. ${e.error||`Check server console.`}`)}}catch{alert(`Network error: Could not reach server to delete the tree.`)}}},saveTreeOrder:M,attachVaultNodeToTree:async(e,r=null)=>{if(!a.value)return alert(`Please select a Navigation Tree before attaching content.`);try{let i={action:`attach`,contentId:e,treeId:a.value,language:n.value,parentId:r?r.id:null};t.value&&t.value!==`all`&&(i.channelId=t.value),(await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)})).ok&&(await ce(),await ue({reset:!0,ensureItemId:String(e)}))}catch(e){console.error(`[CMS] Failed to attach vault node to tree:`,e)}},detachTreeNode:async e=>{try{(await fetch(`/api/cms/tree.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`detach`,contentId:e,treeId:a.value})})).ok&&await ce()}catch(e){console.error(`[CMS] Failed to detach tree node:`,e)}},findParentNodeInTree:ie,updateNodeInTree:j,handleTreeChange:async e=>{if(e?.added?.element?._isNew){if(!await y(`node`))return;let n=e.added.element;delete n._isNew,d.value={},f.value={},p.value=null;let r=yp(n.isHidden),i={...n,parentId:null,isHidden:r,status:`draft`,blocks:[]};t.value&&t.value!==`all`&&(i.channels=[t.value]);let a=await fetch(`/api/cms/nodes.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});if(a.ok){let e=await a.json();n.id=e.id,n.treeNodeId=e.id}u.value={...n,isHidden:r,status:`draft`,isNew:!1,disabledRegions:{}},_.value=`content`,v.value=!0,h.value=JSON.stringify({node:u.value,blocks:d.value})}await M()},openTreeSettings:async e=>{if(!await O())return!1;let n=r.value.find(t=>String(t.id)===String(e)||t.key===e),o=n?.treeType||n?.type||Object.keys(l.value||{})[0]||`navigation`;return i.value=n?{...n,treeType:o,channels:Array.isArray(n.channels)?[...n.channels]:[]}:{id:null,key:String(e),label:String(e),treeType:o,channels:t.value&&t.value!==`all`?[Number(t.value)||t.value]:[]},a.value=String(n?n.id:e),ne(),m.value={},await y(`tree`,!0),!0},checkUnsavedChanges:O,updateTreeSnapshot:ne}}function Np(e){if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)e[t].isNew||String(e[t].id).startsWith(`draft-`)?e.splice(t,1):e[t].children&&e[t].children.length>0&&Np(e[t].children)}function Pp(){let e=sp(),t=Mp(),{confirmNavigation:n}=Op(),r=()=>null,i=async()=>{if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let t=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,i={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:t,channels:t?[t]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:null,_isTreeDraft:!0,disabledRegions:{}};e.nodeTree.value.push(i),e.activeNode.value=i,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!0,Jp(e)},a=async t=>{if(!t)return;let n=t.dataJson||t,r=t.id;if(r&&!String(r).startsWith(`draft-`))try{let e=await Hd.getNode(r);if(e.ok){let t=await e.json();t&&t.node&&(n=t.node)}}catch{console.warn(`Failed to fetch full parent data for draft inheritance`)}if(n&&typeof n==`object`){let t=JSON.parse(JSON.stringify(n));t.subpageLayoutId&&t.subpageLayoutId!==`inherit`&&(e.activeNode.value.resolvedLayoutId=t.subpageLayoutId);let r=new Set([`id`,`treeNodeId`,`contentId`,`parentId`,`_draftParentId`,`title`,`slug`,`children`,`isNew`,`nodeType`,`status`,`disabledRegions`,`layoutId`,`subpageLayoutId`,`createdAt`,`updatedAt`,`publishedAt`,`createdById`,`updatedById`,`trees`,`channels`,`language`]);Object.entries(t).forEach(([t,n])=>{!r.has(t)&&n!=null&&(e.activeNode.value[t]===void 0||e.activeNode.value[t]===``)&&(e.activeNode.value[t]=n)})}try{let{resolveInheritedRegion:r}=Yp(),i=String(e.selectedChannelId.value||``),a=n.subpageLayoutId;(!a||a===`inherit`)&&(a=n.resolvedLayoutId||n.layoutId);let o=a?e.nodeLayoutSchemas.value[a]:null,s=[];if(o?.regions)for(let[e,t]of Object.entries(o.regions)){let n=t.inherit||t.inherited;(n===`parent`||n===!0||String(n).toLowerCase()===`true`)&&s.push(e)}for(let n of s){let a=await r(t,n,i,``);a&&a.blocks&&a.blocks.length>0&&(e.blocks.value[n]=JSON.parse(JSON.stringify(a.blocks)),e.regionMeta.value[n]={isInherited:!0,inheritedFromId:String(a.inheritedFromId),inheritedFromTitle:a.inheritedFromTitle})}}catch(e){console.warn(`[Draft Hierarchy] Failed to resolve inherited region:`,e)}};return{handleAddRootNode:i,handleAddChild:async t=>{if(String(t.id).startsWith(`draft-`)){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`Please save this parent page before adding sub-pages to it.`}}));return}if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let i=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,o=t.id,s={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:i,channels:i?[i]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:o,_isTreeDraft:!0,disabledRegions:{}};t.children||=[],t.children.push(s),e.activeNode.value=s,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!0,await a(t),Jp(e)},handleAddSibling:async i=>{if(String(i.id).startsWith(`draft-`)){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`Please save this new page before adding sibling pages next to it.`}}));return}if(!await n())return;Np(e.nodeTree.value),e.selectedBlock.value=null,e.setViewMode(`node`),e.validationErrors.value={};let o=i.id||``,s=t.findParentNodeInTree(e.nodeTree.value,o),c=s?s.children:e.nodeTree.value,l=c?c.findIndex(e=>e===i||String(e.id)===String(o)):-1,u=e.selectedChannelId.value&&e.selectedChannelId.value!==`all`?Number(e.selectedChannelId.value)||e.selectedChannelId.value:``,d={id:`draft-${Date.now()}`,title:``,slug:``,nodeType:``,layoutId:`inherit`,channelId:u,channels:u?[u]:[],language:r(),status:`draft`,children:[],isNew:!0,_draftParentId:s?s.id:null,_isTreeDraft:!0,disabledRegions:{}};c&&l!==-1?c.splice(l+1,0,d):c&&c.push(d),e.activeNode.value=d,e.blocks.value={},e.regionMeta.value={},e.activeTab.value=`settings`,e.shouldFocusTitle.value=!1,s&&await a(s),Jp(e)}}}var Fp=null,Ip=null;function Lp(e){if(!e||typeof e!=`object`)return{};try{return JSON.parse(JSON.stringify(e))}catch{return{}}}function Rp(e,t,n,r,i,a){let o=sp(),s=Mp(),c=Bd(),{confirmNavigation:l,isGlobalDirty:u}=Op(),d=(e,t)=>{typeof window<`u`&&(window.dispatchEvent(new CustomEvent(`cms-node-updated`,{detail:{nodeId:e,action:t}})),t.startsWith(`asset-`)&&window.dispatchEvent(new CustomEvent(`cms-assets-updated`)))};ni(()=>o.activeNode.value?.nodeType,(e,t)=>{if(o.activeNode.value?.isNew&&e&&e!==t&&!Object.values(o.blocks.value||{}).some(e=>e.length>0)){let t=o.nodeSchemas.value[e];t&&Hp(o.activeNode.value,t),Jp(o)}});let f=async e=>{if(!await l())return!1;let t=r.value,n=Object.keys(t),i=e;if(i===void 0){let e=o.currentVaultType.value;if(typeof e==`string`&&e!==`all`&&n.includes(e))i=e;else if(Array.isArray(e)){let t=e.filter(e=>n.includes(e));t.length===1&&(i=t[0])}}let s=i?t[i]||o.nodeSchemas.value[i]:null,c=o.selectedChannelId.value&&o.selectedChannelId.value!==`all`?Number(o.selectedChannelId.value)||o.selectedChannelId.value:``,u={id:`draft-${Date.now()}`,isNew:!0,title:``,slug:``,nodeType:i||``,layoutId:`inherit`,channelId:c,language:o.selectedLanguage.value||null,status:`draft`,channels:c?[c]:[],disabledRegions:{},_isTreeDraft:!1};s&&Hp(u,s),o.activeNode.value=u,o.blocks.value={},o.regionMeta.value={},o.selectedBlock.value=null,Jp(o),o.validationErrors.value={};let d=a.value.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`settings`;return o.activeTab.value=d,o.setViewMode(`node`),o.shouldFocusTitle.value=!0,!0},p=async e=>await f(e),m=async()=>{o.activeNode.value.isNew=!1;let e=t=>{for(let n=t.length-1;n>=0;n--)t[n].isNew||String(t[n].id).startsWith(`draft-`)?t.splice(n,1):t[n].children&&e(t[n].children)};e(o.nodeTree.value),o.selectedBlock.value=null,o.resetActiveNode(),o.nodeTree.value.length>0?await t(o.nodeTree.value[0]):o.setViewMode(`none`,!0)},h=async()=>{if(o.isDocumentUnverified.value||o.isDocumentLoading.value)return;if(o.isOffline.value){c.persistOfflineDraft(o.activeNode.value.id,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),Jp(o);return}let e=o.nodeSchemas.value[o.activeNode.value.nodeType],t=Ep(e,o.activeNode.value),n=o.activeNode.value.slug?String(o.activeNode.value.slug).trim():``;n||=(t.trim()||`draft-page`).toLowerCase().replace(/[^a-z0-9\s-]/g,``).replace(/[\s-]+/g,`-`).replace(/^-+|-+$/g,``)||`draft-page-${Date.now()}`;let r=!!o.activeNode.value._isTreeDraft,i=o.activeNode.value.id||o.activeContentId.value,a=typeof i==`number`?i:Number(i)||null,l=o.activeNode.value.isNew||r||String(i||``).startsWith(`draft-`);if(!l&&!u.value&&!o.isPendingOfflineSave.value)return;let f={...o.activeNode.value};f.slug=n,f.title=t;let p=o.activeNode.value.status===`published`||o.activeNode.value.publishedAt?`published`:`draft`;f.status=p,delete f.id,delete f.isNew,delete f._draftParentId,delete f._isTreeDraft,delete f.children,delete f.treeNodeId;let m=yp(o.activeNode.value.isHidden);f.isHidden=m;let g=o.selectedChannelId.value&&o.selectedChannelId.value!==`all`?Number(o.selectedChannelId.value)||o.selectedChannelId.value:null,_=Up(o.activeNode.value.channels).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e);o.activeNode.value.channels===void 0&&g&&(_=[g]),f.channels=_,f.channelId=_.length>0?_[0]:``;let v=[];Object.entries(o.blocks.value||{}).forEach(([e,t])=>{o.regionMeta.value[e]?.isInherited||Array.isArray(t)&&t.forEach((t,n)=>{v.push({instanceId:String(t.instanceId||t.id||`block-${Date.now()}`),componentId:String(t.componentId||t.elementType||`text`),elementType:String(t.componentId||t.elementType||`text`),region:String(e||`content`),sortOrder:n,data:Lp(t.data)})})});try{let e=null,i;if(i=l&&r?await Hd.createInTree({action:`create`,title:f.title,slug:n,nodeType:o.activeNode.value.nodeType,treeId:o.selectedTreeId.value,parentId:o.activeNode.value._draftParentId||null,channels:_,channelId:_.length>0?_[0]:null,isHidden:m,nodeData:{...f,status:p,blocks:v}}):l?await Hd.saveNode({id:null,...f,status:p,blocks:v}):await Hd.saveNode({id:a,...f,status:p,blocks:v}),i.ok){let u=await i.json();e=u.id||u.nodeId||a;let f=o.activeNode.value.id;o.activeNode.value.id=String(e),o.activeNode.value.slug=n,o.activeNode.value.title=t,o.activeNode.value.treeNodeId=String(e);let h=u.hasUnpublishedChanges===!0;if(o.activeNode.value.isNew=!1,o.activeNode.value.status=p,o.activeNode.value.hasUnpublishedChanges=h,o.activeNode.value.channels=_,delete o.activeNode.value._isTreeDraft,delete o.activeNode.value._draftParentId,o.nodeTree.value&&e){let i=r=>{for(let a=0;a<r.length;a++){if(r[a]===o.activeNode.value||String(r[a].id)===String(f)||String(r[a].id).startsWith(`draft-`))return r[a].id=String(e),r[a].treeNodeId=String(e),r[a].title=t,r[a].slug=n,r[a].isNew=!1,delete r[a]._isTreeDraft,delete r[a]._draftParentId,!0;if(r[a].children&&i(r[a].children))return!0}return!1};i(o.nodeTree.value),l&&r&&s.saveTreeOrder()}o.updateNodeInState(e,{title:t,slug:n,status:p,hasUnpublishedChanges:h,isHidden:m},String(e)),Jp(o),c.clearPersistedOfflineDraft(e),c.invalidateAfterSave(e),c.saveToCache(e,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),o.invalidateStats(),d(e,l?`create`:`update`)}else{let e=await i.json().catch(()=>({}));if(i.status===409&&(e.field===`slug`||e.error?.toLowerCase().includes(`slug`)||e.error?.toLowerCase().includes(`exists`))){let e=Math.random().toString(36).substring(2,6),t=`${n}-${e}`;return o.activeNode.value.slug=t,typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`warning`,message:`The URL slug "${n}" was already in use. It has been auto-appended to "${t}".`}})),o.validationErrors.value.slug&&delete o.validationErrors.value.slug,await h()}i.status===409&&e.field&&(o.validationErrors.value={...o.validationErrors.value,[e.field]:e.error||`This value is already in use.`})}}catch(e){console.error(`Network error auto-saving node draft:`,e),c.persistOfflineDraft(a||o.activeNode.value.id,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),Jp(o)}},g=async()=>{o.isSaving.value=!0,o.isAutoSavePending.value=!1,Fp&&=(clearTimeout(Fp),null);try{Ip=h(),await Ip}finally{Ip=null,o.isSaving.value=!1}};return ni([()=>o.activeNode.value,()=>o.blocks.value],()=>{if(!o.activeNode.value?.id||o.isDocumentLoading.value||o.activeNode.value.isNew&&!o.activeNode.value.nodeType)return;let e=Ep(o.nodeSchemas.value[o.activeNode.value.nodeType],o.activeNode.value);if(o.activeNode.value.isNew&&e.startsWith(`Untitled`)){o.isAutoSavePending.value=!1;return}o.isAutoSavePending.value=!0,Fp&&clearTimeout(Fp),Fp=setTimeout(()=>{g()},1e3)},{deep:!0}),{handleAddNewNode:f,createVaultNode:p,cancelNewNode:m,saveNewNode:async()=>await h(),saveNode:g,publishNode:async()=>{if(o.isDocumentUnverified.value||!await e())return!1;Fp||o.isAutoSavePending.value||u.value?await g():Ip&&await Ip;let t=o.activeNode.value.id||o.activeContentId.value,n=typeof t==`number`?t:Number(t)||null;if(!n)return!1;o.isSaving.value=!0;try{let e=await Hd.publishNode(n);if(e.ok){let t=await e.json();return o.activeNode.value.status=`published`,o.activeNode.value.publishedAt=t.publishedAt,o.activeNode.value.hasUnpublishedChanges=!1,o.updateNodeInState(n,{status:`published`,publishedAt:t.publishedAt,hasUnpublishedChanges:!1},String(n)),Jp(o),c.invalidateAfterSave(n),c.saveToCache(n,{node:o.activeNode.value,blocks:o.blocks.value,regionMeta:o.regionMeta.value}),o.invalidateStats(),o.activeNode.value.treeNodeId&&await s.saveTreeOrder(),await s.fetchNodeTree(),await s.fetchVaultNodes({reset:!0,ensureItemId:String(n)}),d(n,`publish`),!0}}finally{o.isSaving.value=!1}return!1},deleteNode:async e=>{let t=e||o.activeNode.value?.id||o.activeContentId.value;if(!t||String(t).startsWith(`draft-`))return m(),!0;try{if((await Hd.deleteNode(t)).ok)return c.invalidateAfterSave(t),o.invalidateStats(),o.nodeTree.value&&o.nodeTree.value.length>0&&await s.fetchNodeTree(),await s.fetchVaultNodes({reset:!0}),String(o.activeNode.value?.id)===String(t)&&m(),d(t,`delete`),!0}catch(e){console.error(`[CMS] Failed to delete node:`,e)}return!1},restoreNode:async e=>{if(!e)return!1;try{if((await Hd.restoreNode(e)).ok)return o.invalidateStats(),await s.fetchVaultNodes({reset:!0}),d(e,`restore`),!0}catch(e){console.error(`[CMS] Failed to restore node:`,e)}return!1},purgeNode:async e=>{if(!e)return!1;try{if((await Hd.purgeNode(e)).ok)return o.invalidateStats(),await s.fetchVaultNodes({reset:!0}),d(e,`purge`),!0}catch(e){console.error(`[CMS] Failed to purge node:`,e)}return!1},toggleNodeVisibility:async e=>{if(!e||!e.id||String(e.id).startsWith(`draft-`))return!1;let t=!yp(e.isHidden);try{if((await Hd.toggleVisibility(e.id,t)).ok)return e.isHidden=t,o.updateNodeInState(e.id,{isHidden:t},e.id),String(o.activeNode.value?.id)===String(e.id)?(Jp(o),c.saveToCache(e.id,{node:JSON.parse(JSON.stringify(o.activeNode.value)),blocks:JSON.parse(JSON.stringify(o.blocks.value)),regionMeta:JSON.parse(JSON.stringify(o.regionMeta.value))})):c.invalidateAfterSave(e.id),d(e.id,`update`),!0}catch(e){console.error(`[CMS] Failed to toggle node visibility:`,e)}return!1},restoreSnapshot:async e=>{let n=o.activeNode.value?.id;if(!n||String(n).startsWith(`draft-`))return!1;o.isSaving.value=!0;try{if((await Hd.restoreSnapshot(n,e)).ok)return o.activeSnapshotVersion.value=null,o.draftBackup.value=null,c.clearCache(n),await t({id:n,nodeType:o.activeNode.value.nodeType,treeNodeId:o.activeNode.value.treeNodeId}),o.activeNode.value.status=`draft`,o.activeNode.value.hasUnpublishedChanges=!0,o.updateNodeInState(n,{...o.activeNode.value,status:`draft`,hasUnpublishedChanges:!0,title:o.activeNode.value.title,isHidden:yp(o.activeNode.value.isHidden)},o.activeNode.value.treeNodeId),Jp(o),o.invalidateStats(),await s.fetchNodeTree(),d(n,`restore-snapshot`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`success`,message:`Version ${e} restored successfully.`}})),!0}catch(e){console.error(`[CMS] Failed to restore snapshot:`,e)}finally{o.isSaving.value=!1}return!1}}}var zp=0;function Bp(e){return e&&{...e,isHidden:yp(e.isHidden)}}function Vp(e,t=!1){if(!e)return``;let n=new Date,r=String(e).toLowerCase().trim(),i=e=>{let n=e=>e.toString().padStart(2,`0`),r=`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())}`;return t?r:`${r}T${n(e.getHours())}:${n(e.getMinutes())}`};if(r===`now`||r===`today`)return i(n);let a=r.match(/^([+-])\s*(\d+)\s*(minute|hour|day|week|month|year)s?$/);if(a){let e=a[1]===`+`?1:-1,t=parseInt(a[2],10)*e,r=a[3],o=new Date(n);return r===`minute`?o.setMinutes(o.getMinutes()+t):r===`hour`?o.setHours(o.getHours()+t):r===`day`?o.setDate(o.getDate()+t):r===`week`?o.setDate(o.getDate()+t*7):r===`month`?o.setMonth(o.getMonth()+t):r===`year`&&o.setFullYear(o.getFullYear()+t),i(o)}return String(e)}function Hp(e,t){let n=e=>e==null||e===``,r=t=>{t&&Object.entries(t).forEach(([t,r])=>{r?.default!==void 0&&n(e[t])&&(e[t]=r.type===`datetime`||r.type===`date`?Vp(r.default,r.type===`date`):r.default)})};r(t?.fields),t?.tabs&&Object.values(t.tabs).forEach(e=>r(e?.fields))}function Up(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>typeof e==`object`&&e?e.id||e.channelId:e).filter(Boolean);if(typeof e==`string`)try{let t=JSON.parse(e);return Array.isArray(t)?Up(t):[e]}catch{return[e]}return[e]}function Wp(e,t){if(!e)return!1;if(!t||e===t.defaultLayout)return!0;let n=null,r=e=>{e&&(Array.isArray(e)?e.forEach(e=>{e.layoutId&&(n=e.layoutId)}):e.layoutId&&(n=e.layoutId))};if(r(t.fields),!n&&t.tabs&&Object.values(t.tabs).forEach(e=>r(e.fields)),!n)return!1;let i=n.allowedLayouts;return i?typeof i==`string`?i===e:!Array.isArray(i)||i.length===0||i.includes(e):!0}function Gp(e,t,n,r){let i=e?.layoutId,a=e?.nodeType?t.nodeSchemas.value[e.nodeType]:null;if((!i||i===`inherit`)&&!e?.resolvedLayoutId&&n&&r){let t=r.findParentNodeInTree(n.nodeTree.value,e?._draftParentId||e?.parentId||``);for(;t;){if(t.subpageLayoutId&&t.subpageLayoutId!==`inherit`){Wp(t.subpageLayoutId,a)&&(i=t.subpageLayoutId);break}if(t.layoutId&&t.layoutId!==`inherit`){Wp(t.layoutId,a)&&(i=t.layoutId);break}if(t.resolvedLayoutId){Wp(t.resolvedLayoutId,a)&&(i=t.resolvedLayoutId);break}t=r.findParentNodeInTree(n.nodeTree.value,t.parentId||``)}}!i||i===`inherit`?(i=e?.resolvedLayoutId,i&&!Wp(i,a)&&(i=null),i||=a?.defaultLayout):Wp(i,a)||(i=a?.defaultLayout);let o=i?t.nodeLayoutSchemas.value[i]:null;return o?.regions&&Object.keys(o.regions).length>0?o.regions:{content:{label:`Content`}}}var Kp=e=>e===`parent`||e===!0||String(e).toLowerCase()===`true`;function qp(e,t){let n=e.activeNode.value,r=n?.nodeType?e.nodeSchemas.value[n.nodeType]:null,i=n?.layoutId;(!i||i===`inherit`)&&(i=n?.resolvedLayoutId||r?.defaultLayout);let a=i?e.nodeLayoutSchemas.value[i]:null,o=a?.regions&&Object.keys(a.regions).length>0?a.regions:{content:{label:`Content`}},s=new Set(Object.keys(o)),c=t=>{Array.isArray(t)&&t.forEach(t=>{let n=t.componentId||t.elementType,r=e.blockLayoutSchemas.value[n];r?.regions&&Object.keys(r.regions).forEach(n=>{let r=`${t.instanceId||t.id}_${n}`;s.add(r),e.blocks.value[r]&&c(e.blocks.value[r])})})};return t&&Array.isArray(t)&&t.forEach(t=>{let n=t.componentId||t.elementType,r=e.blockLayoutSchemas.value[n];r?.regions&&Object.keys(r.regions).forEach(e=>{let n=`${t.instanceId||t.id}_${e}`;s.add(n)})}),Object.keys(o).forEach(t=>c(e.blocks.value[t]||[])),s}function Jp(e){if(!e.activeNode.value)return;qp(e).forEach(t=>{e.blocks.value[t]||(e.blocks.value[t]=[])}),e.activeNode.value.disabledRegions||(e.activeNode.value.disabledRegions={}),e.activeNode.value.channels||(e.activeNode.value.channels=[]);let t=Wf(JSON.parse(JSON.stringify(e.activeNode.value)),e.nodeSchemas.value),n=JSON.parse(JSON.stringify(e.blocks.value));e.nodeSnapshot.value=JSON.stringify({node:t,blocks:n})}function Yp(){let e=sp(),t=Mp(),n=Bd(),r=Pp(),{confirmNavigation:i}=Op(),a=()=>Jp(e),o=J(()=>e.nodeSchemas.value[e.activeNode.value?.nodeType]||null),s=J(()=>Gp(e.activeNode.value,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t)),c=J(()=>{let t=[],n=e.activeNode.value,r=e.nodeSchemas.value[n?.nodeType];if(r){if(r.hasCanvas===!0&&t.push({key:`content`,label:`Content`}),r.tabs&&typeof r.tabs==`object`)for(let[e,n]of Object.entries(r.tabs)){let r=typeof n==`string`?n:n?.label||e;t.push({key:e,label:r})}t.filter(e=>e.key!==`content`).length===0&&t.push({key:`settings`,label:r.label||`Settings`}),t.push({key:`connections`,label:`Connections`})}return t}),l=J(()=>{let t={};for(let[n,r]of Object.entries(e.nodeSchemas.value||{})){let e=r.inTree;(e===!0||String(e)===`true`||e===1)&&(t[n]=r)}return t}),u=J(()=>Object.keys(l.value).map(e=>({value:e,label:l.value[e].label||e}))),d=J(()=>{let t={};for(let[n,r]of Object.entries(e.nodeSchemas.value||{}))r.inVault!==!1&&String(r.inVault)!==`false`&&(t[n]=r);return t}),f=J(()=>Object.keys(d.value).map(e=>({value:e,label:d.value[e].label||e}))),p=J(()=>e.workspaceContext.value===`tree`),m=t=>{if(!e.activeNode.value?.nodeType)return t===`settings`||t===`content`||t===`node`?{nodeType:{label:`Select Node Type`,type:`select`,options:p.value?u.value:f.value,rules:{required:!0}}}:{};let n=o.value;if(!n)return{};let r=t;t===`node`&&!n.tabs?.node&&n.tabs?.settings&&(r=`settings`);let i=n.tabs?.[r]?.fields||n.fields||{},a=JSON.parse(JSON.stringify(i));return a.nodeType&&(a.nodeType.type=`select`,a.nodeType.options=p.value?u.value:f.value),a},h=J(()=>Object.keys(e.validationErrors.value).length===0),g=e=>{},_=async()=>{e.validationErrors.value={};let t=!0,n=``,r=o.value;if(!r)return!1;let i={...r.fields||{}};r.tabs&&Object.values(r.tabs).forEach(e=>{Object.assign(i,e.fields||{})});let a=e.activeNode.value?.id,s=typeof a==`number`||a&&!String(a).startsWith(`draft-`)?String(a):``,l=e.activeNode.value?.treeId||e.selectedTreeId.value||e.activeTreeSettings.value?.id,u=e.activeNode.value?._draftParentId??e.activeNode.value?.parentId??null,d={...e.activeNode.value,treeId:l,parentId:u};for(let[a,o]of Object.entries(i)){let i=e.activeNode.value[a],c=await pp(a,i,o,{entityType:`node`,excludeId:e.activeNode.value?.treeNodeId||s,formData:d});if(c&&(e.validationErrors.value[a]=c,t=!1,!n)){for(let[e,t]of Object.entries(r.tabs||{}))if(t.fields?.[a]){n=e;break}}}if(!t){let t=n||c.value.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`content`;return e.activeTab.value!==t&&(e.activeTab.value=t),e.shouldFocusTitle.value=!0,!1}return!0},v=(e,t)=>{let n={},r=t.filter(e=>typeof e==`object`&&!!e),i=new Set(r.map(e=>String(e.blockId||e.instanceId||e.id))),a=!0;for(;a;){a=!1;for(let[t,r]of Object.entries(e))if(!(n[t]||!r||!Array.isArray(r))){for(let e of i)if(e&&(t.startsWith(`${e}_`)||t.startsWith(`${e}-`))){n[t]=r,r.forEach(e=>{e&&i.add(String(e.blockId||e.instanceId||e.id))}),a=!0;break}}}return n},y=async(r,i,a,o)=>{if(!r||r.isNew||String(r.id||``).startsWith(`draft-`))return{blocks:[]};let s=r;for(;s;){let r=s.disabledRegions?.[i],a=n.getCachedDocument(s.id),o=a?.blocks?.[i]?.length>0&&!a?.regionMeta?.[i]?.isInherited;if(r||o)break;let c=t.findParentNodeInTree(e.nodeTree.value,s.id||s.treeNodeId||``);if(!c)break;s=c}let c=String(s?.slug||``).trim().toLowerCase();if(!c||c===`page-title`||c===`untitled`)return{blocks:[]};let l=String(a);(l===`all`||l===`undefined`||l===`null`)&&(l=``);let u=o&&o!==`undefined`&&o!==`null`?String(o):``;u||=e.activeTreeSettings.value?.defaultLanguage||e.activeChannelSettings.value?.defaultLanguage||``;let d=`${c}_${i}_${e.selectedTreeId.value}_${l}_${u}`,f=n.getCachedInheritedRegion(d);if(f)return f;let p=n.getCachedDocument(s.id);if(p&&p.blocks[i]?.length>0){let e={blocks:p.blocks[i],subRegions:v(p.blocks,p.blocks[i]),inheritedFromId:String(s.id),inheritedFromTitle:s.title||s.slug};return n.setCachedInheritedRegion(d,e),e}try{let t=await Hd.getInheritedRegion(c,e.selectedTreeId.value,u,l);if(t.ok){let e=await t.json(),r=e.content?.[i]||[];if(r.length>0){let t={blocks:r,subRegions:v(e.content,r),inheritedFromId:String(s.id),inheritedFromTitle:s.title||s.slug};return n.setCachedInheritedRegion(d,t),t}}}catch(e){console.warn(`⚠️ Failed to fetch inherited region:`,e)}return{blocks:[]}},b=async r=>{if(String(e.activeNode.value?.id)===String(r.id)&&!e.activeNode.value?.isNew||e.activeNode.value?.isNew&&String(e.activeNode.value.id||``).startsWith(`draft-`)||!await i())return;e.selectedBlock.value=null,e.nodeSnapshot.value=``,e.selectedTreeId.value&&(e.nodeTree.value=t.getNodesForTree(e.selectedTreeId.value)),e.isDocumentLoading.value=!0,n.clearConflict(),n.markUnverified(!1);let a=++zp,o=String(r.id),s=n.getCachedDocument(o),l=n.getPersistedOfflineDraft(r.id);Np(e.nodeTree.value),e.validationErrors.value={};let u=e.nodeSchemas.value[r.nodeType]||Object.values(e.nodeSchemas.value)[0],d=t.findParentNodeInTree(e.nodeTree.value,r.id||r.treeNodeId||``),f=Up(r.channels||r.channelId).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e),p=String(f[0]||e.selectedChannelId.value||``),m=r.language||e.activeTreeSettings.value?.defaultLanguage||e.selectedLanguage.value||``;if(l){e.setViewMode(`node`),e.activeNode.value=JSON.parse(JSON.stringify(l.data.node)),e.blocks.value=JSON.parse(JSON.stringify(l.data.blocks)),e.regionMeta.value=JSON.parse(JSON.stringify(l.data.regionMeta)),Jp(e),e.isDocumentLoading.value=!1,e.isPendingOfflineSave.value=!0;return}if(s){e.setViewMode(`node`),e.activeNode.value=JSON.parse(JSON.stringify(s.node)),e.blocks.value=JSON.parse(JSON.stringify(s.blocks)),e.regionMeta.value=JSON.parse(JSON.stringify(s.regionMeta)),Jp(e),e.isDocumentLoading.value=!1;return}try{let i=await Hd.getNode(r.id);if(a!==zp)return;if(i.ok){let o=await i.json(),s=o.node||r,l=s.disabledRegions||{},h=s.channels||s.channelId||f,g={...Bp(s),id:s.id||r.id,treeNodeId:s.treeNodeId||r.treeNodeId,isNew:!1,disabledRegions:l,channels:Up(h).map(e=>typeof e==`string`&&!isNaN(Number(e))?Number(e):e),trees:s.trees||[]};Hp(g,u);let _=Gp(g,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t),v={};for(let e of Object.keys(_))Kp(_[e].inherit)&&d&&(v[e]=y(d,e,p,m));let b={};for(let[e,t]of Object.entries(v))b[e]=await t;if(a!==zp)return;let x={},S={},C=new Set(Object.keys(_));if(Array.isArray(o.blocks)&&o.blocks.forEach(e=>C.add(e.region||`content`)),C.forEach(e=>{x[e]=[]}),Array.isArray(o.blocks)){let t=new Set;[...o.blocks].sort((e,t)=>{let n=String(e.region||``).includes(`_`),r=String(t.region||``).includes(`_`);return n&&!r?1:!n&&r?-1:0}).forEach(n=>{let r=n.instanceId||n.id;if(t.has(r))return;t.add(r);let i=n.region||`content`;x[i]||(x[i]=[]);let a=e.blockSchemas.value[n.componentId||n.elementType],o=typeof n.data==`string`?JSON.parse(n.data):n.data||{};a?.fields&&Object.entries(a.fields).forEach(([e,t])=>{(o[e]===void 0||o[e]===null)&&(o[e]=t.default===void 0?``:t.default)}),x[i].push({instanceId:String(r),blockId:String(n.blockId||n.instanceId||n.id),componentId:String(n.componentId||n.elementType||`text`),region:i,data:{...o}})})}for(let e of Object.keys(_)){let t=x[e]&&x[e].length>0,n=l[e];if(Kp(_[e].inherit)&&!t&&!n&&d){let t=b[e];if(t&&t.blocks&&t.blocks.length>0){if(x[e]=t.blocks,S[e]={isInherited:!0,inheritedFromId:t.inheritedFromId,inheritedFromTitle:t.inheritedFromTitle},t.subRegions)for(let[n,r]of Object.entries(t.subRegions))n!==e&&Array.isArray(r)&&r.length>0&&(x[n]=r,S[n]={isInherited:!0,inheritedFromId:t.inheritedFromId,inheritedFromTitle:t.inheritedFromTitle})}else S[e]={isInherited:!1}}else S[e]={isInherited:!1}}let w={};Object.keys(x).forEach(e=>{S[e]?.isInherited?w[e]=[]:w[e]=x[e]});let T={node:g,blocks:w,regionMeta:S},{isNodeDirty:E}=Op();if(n.evaluateServerResponse(r.id,T,E.value).action===`update_silently`){e.setViewMode(`node`),e.activeNode.value=g,e.blocks.value=x,e.regionMeta.value=S;let i=c.value;if(!i.some(e=>e.key===`content`)&&e.activeTab.value===`content`&&(e.activeTab.value=i.find(e=>e.key!==`content`&&e.key!==`connections`)?.key||`settings`),g.trees&&g.trees.length>0){let n=String(g.trees[0].treeId);e.selectedTreeId.value!==n&&(e.selectedTreeId.value=n,e.nodeTree.value=t.getNodesForTree(n))}await Fr(),Jp(e),n.saveToCache(r.id,{node:g,blocks:x,regionMeta:S})}n.markUnverified(!1)}else n.markUnverified(!0)}catch(e){console.error(`⚠️ Network error fetching node content:`,e),n.markUnverified(!0)}finally{e.isDocumentLoading.value=!1}},x=async t=>{let n=e=>{for(let r of e){if(String(r.id)===String(t))return r;if(r.children){let e=n(r.children);if(e)return e}}return null},r=n(e.nodeTree.value);r?await b(r):await b({id:String(t),title:`Loading...`,slug:``,nodeType:`node`,channelId:``,language:``})};ni([()=>e.activeNode.value?.id,()=>e.activeNode.value?.nodeType,()=>e.activeNode.value?.layoutId,()=>e.activeNode.value?.resolvedLayoutId],([n])=>{if(!e.isDocumentLoading.value&&n&&e.activeNode.value?.nodeType){let r=Gp(e.activeNode.value,{nodeSchemas:e.nodeSchemas,nodeLayoutSchemas:e.nodeLayoutSchemas},e,t),i=t.findParentNodeInTree(e.nodeTree.value,e.activeNode.value._draftParentId||e.activeNode.value.parentId||``),a=String(e.selectedChannelId.value||``),o=String(e.activeNode.value?.language||e.activeTreeSettings.value?.defaultLanguage||e.selectedLanguage.value||``),s={...e.regionMeta.value},c=!1;for(let t of Object.keys(r)){let l=r[t].inherit,u=e.activeNode.value.disabledRegions?.[t],d=e.blocks.value[t]&&e.blocks.value[t].length>0,f=!s[t],p=!f&&!s[t].isInherited&&Kp(l)&&!u&&!d;(f||p)&&(Kp(l)&&i&&!u&&!d?(s[t]={isInherited:!0},c=!0,y(i,t,a,o).then(r=>{e.activeNode.value?.id===n&&(r&&r.blocks&&r.blocks.length>0?(e.blocks.value[t]=r.blocks,e.regionMeta.value[t]={isInherited:!0,inheritedFromId:r.inheritedFromId,inheritedFromTitle:r.inheritedFromTitle}):e.regionMeta.value[t]={isInherited:!1})})):f&&(s[t]={isInherited:!1},c=!0))}c&&(e.regionMeta.value=s)}},{immediate:!0,deep:!1});let S=Rp(_,b,l,d,p,c);return{applySchemaDefaults:Hp,currentNodeSchema:o,currentLayoutRegions:s,availableNodeTabs:c,treeEligibleNodeSchemas:l,treeEligibleNodeTypes:u,vaultEligibleNodeSchemas:d,vaultEligibleNodeTypes:f,isTreeContext:p,isFormValid:h,getFieldsForTab:m,setFormValidator:g,validateActiveNode:_,loadNodeContent:b,navigateToNodeById:x,resolveInheritedRegion:y,handleAddRootNode:r.handleAddRootNode,handleAddChild:r.handleAddChild,handleAddSibling:r.handleAddSibling,handleAddNewNode:S.handleAddNewNode,createVaultNode:S.createVaultNode,cancelNewNode:S.cancelNewNode,saveNewNode:S.saveNewNode,saveNode:S.saveNode,publishNode:S.publishNode,deleteNode:S.deleteNode,restoreNode:S.restoreNode,purgeNode:S.purgeNode,toggleNodeVisibility:S.toggleNodeVisibility,restoreSnapshot:S.restoreSnapshot,updateNodeSnapshot:a}}function Xp(){let{allChannels:e,activeChannelSettings:t,selectedChannelId:n,selectedLanguage:r,channelSnapshot:i,channelTemplateSchema:a,channelSchemas:o,validationErrors:s,setViewMode:c}=sp(),{validateAgainstSchema:l}=hp(),{fetchChannels:u,syncSystemMetadata:d}=vp(),{confirmNavigation:f}=Op(),p=()=>xp(o,Od),m=J(()=>wp(p())),h=()=>{i.value=JSON.stringify(t.value||{})},g=async()=>{if(!t.value)return!1;s.value={};let r=p(),i=t.value.channelType||t.value.type||Object.keys(r)[0]||`website`,o=Cp(r[i]||a.value,a.value);if(!await l(t.value,{fields:o},`channel`))return!1;try{let r=t.value.id,a=t.value.isNew||String(r||``).startsWith(`draft-`)?null:typeof r==`number`?r:Number(r)||null,o={...JSON.parse(JSON.stringify(t.value)),id:a,channelType:i};delete o.isNew;let l=await fetch(`/api/cms/channels.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(l.ok){let r=await l.json();t.value.id=r.id,delete t.value.isNew,await d(),n.value=String(r.id);let a=e.value.find(e=>String(e.id)===String(r.id));return a&&(t.value={...a,channelType:a.channelType||a.type||i,trees:Array.isArray(a.trees)?[...a.trees]:[]}),h(),await c(`channel`,!0),!0}{let e=await l.json().catch(()=>({}));return l.status===409&&e.field?s.value={[e.field]:e.error||`This key is already in use.`}:alert(e.error||`Failed to save channel settings.`),!1}}catch(e){return console.error(`[CMS] Error saving channel:`,e),!1}},_=async()=>{t.value=null,i.value=``,await c(`none`,!0)},v=async e=>{let r=e||t.value?.id;if(r){if(String(r).startsWith(`draft-`)){await _();return}try{let e=await fetch(`/api/cms/channels.json?id=${r}`,{method:`DELETE`});if(e.ok)t.value=null,i.value=``,await d(),n.value=`all`,await c(`none`,!0);else{let t=await e.json().catch(()=>({}));alert(`Failed to delete channel. ${t.error||`Check server console.`}`)}}catch{alert(`Network error: Could not reach server to delete the channel.`)}}},y=async()=>{if(!await f())return!1;let r=n.value;(!r||r===`all`)&&e.value.length>0&&(r=String(e.value[0].id),n.value=r);let i=e.value.find(e=>String(e.id)===String(r));if(i){let e=p(),n=Object.keys(e)[0]||`website`,r=i.channelType||i.type||n,a=JSON.parse(JSON.stringify(i));a.channelType=r,a.trees=Array.isArray(i.trees)?[...i.trees]:[];let o=e[r];if(o){let e={};Hp(e,o),Object.keys(e).forEach(t=>{(a[t]===void 0||a[t]===null)&&(a[t]=e[t])})}t.value=a,h(),s.value={},await c(`channel`,!0)}return!0},b=async e=>{if(!await f())return!1;let n=p(),r=Sp(n,e),i=r?n[r]:null,a={id:`draft-${Date.now()}`,isNew:!0,key:``,label:``,channelType:r,domain:`localhost`,baseUrl:`http://localhost:3000`,defaultLanguage:`en`,trees:[]};return i&&Hp(a,i),t.value=a,h(),s.value={},await c(`channel`,!0),!0};return{allChannels:e,activeChannelSettings:t,selectedChannelId:n,selectedLanguage:r,channelTypeOptions:m,fetchChannels:u,saveChannelSettings:g,cancelNewChannel:_,deleteChannel:v,openCurrentChannelSettings:y,handleAddNewChannel:b,onChannelSelectChange:async e=>{let r=e.target,i=String(t.value?.id||`all`);r.value===`__add_new__`?await b()||Fr(()=>{n.value=i}):await y()||Fr(()=>{n.value=i})},updateChannelSnapshot:h}}var Zp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Qp=e=>e===``,$p=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),em=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),tm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),nm=e=>{let t=tm(e);return t.charAt(0).toUpperCase()+t.slice(1)},rm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},im=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o=rm.width,color:s=rm.stroke,...c},{slots:l})=>Vo(`svg`,{...rm,...c,width:o,height:o,stroke:s,"stroke-width":Qp(n)||Qp(r)||n===!0||r===!0?Number(i||a||rm[`stroke-width`])*24/Number(o):i||a||rm[`stroke-width`],class:$p(`lucide`,c.class,...e?[`lucide-${em(nm(e))}-icon`,`lucide-${em(e)}`]:[`lucide-icon`]),...!l.default&&!Zp(c)&&{"aria-hidden":`true`}},[...t.map(e=>Vo(...e)),...l.default?[l.default()]:[]]),Y=(e,t)=>(n,{slots:r,attrs:i})=>Vo(im,{...i,...n,iconNode:t,name:e},r),am=Y(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),om=Y(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),sm=Y(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),cm=Y(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),lm=Y(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),um=Y(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),dm=Y(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),fm=Y(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),pm=Y(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),mm=Y(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),hm=Y(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]]),gm=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_m=Y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),vm=Y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ym=Y(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),bm=Y(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),xm=Y(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Sm=Y(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Cm=Y(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),wm=Y(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Tm=Y(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Em=Y(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`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`}]]),Dm=Y(`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`}]]),Om=Y(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),km=Y(`crop`,[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]),Am=Y(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),jm=Y(`ellipsis-vertical`,[[`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`}]]),Mm=Y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Nm=Y(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pm=Y(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Fm=Y(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Im=Y(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Lm=Y(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Rm=Y(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),zm=Y(`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`}]]),Bm=Y(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Vm=Y(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Hm=Y(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Um=Y(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Wm=Y(`heading-4`,[[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 10v3a1 1 0 0 0 1 1h3`,key:`tj5zdr`}],[`path`,{d:`M21 10v8`,key:`1kdml4`}],[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}]]),Gm=Y(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Km=Y(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),qm=Y(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Jm=Y(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Ym=Y(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Xm=Y(`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`}]]),Zm=Y(`layout-grid`,[[`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`}]]),Qm=Y(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),$m=Y(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),eh=Y(`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`}]]),th=Y(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),nh=Y(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rh=Y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ih=Y(`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`}]]),ah=Y(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),oh=Y(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),sh=Y(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ch=Y(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),lh=Y(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),uh=Y(`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`}]]),dh=Y(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),fh=Y(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),ph=Y(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),mh=Y(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),hh=Y(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),gh=Y(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_h=Y(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),vh=Y(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),yh=Y(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),bh=Y(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),xh=Y(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Sh=Y(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Ch=Y(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),wh=Y(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Th=Y(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Eh=Y(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Dh=Y(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Oh=Y(`subscript`,[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]),kh=Y(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Ah=Y(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),jh=Y(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Mh=Y(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),Nh=Y(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ph=Y(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Fh=Y(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ih=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Lh={class:`logo-area`},Rh=[`title`,`aria-label`],zh={class:`toggle-icon-wrapper`},Bh={class:`version-link`,href:`https://kama.t3cloud.eu`,target:`_blank`,rel:`noreferrer`},Vh={key:0,class:`center-status-area`},Hh={class:`user-area`},Uh={class:`icon-bubble`},Wh={key:0,class:`publish-count-badge`},Gh={class:`icon-bubble`},Kh=[`title`],qh={class:`icon-bubble`},Jh=vi({__name:`GlobalTopBar`,props:{isSidebarOpen:{type:Boolean},isMobile:{type:Boolean}},emits:[`toggle-sidebar`],setup(e,{emit:t}){let n=e,r=t,{activeView:i,goToDashboard:a,isOffline:o,isReadOnlyMode:s,isPendingOfflineSave:c,activeNode:l,hasUnpublishedChanges:u,vaultStats:d,openPublisher:f}=sp(),p=R({firstName:`Admin`,lastName:`User`,email:`admin@kama-cms.com`}),m=J(()=>p.value.firstName||p.value.lastName?`${p.value.firstName} ${p.value.lastName}`.trim():p.value.email.split(`@`)[0]),h=()=>{i.value={type:`help`}},g=()=>{i.value={type:`user`}},_=J(()=>{let e=new Map;if((d.value?.pendingNodes||[]).forEach(t=>{if(t.deletedAt)return;let n=String(l.value?.id)===String(t.id),r=bp(t),i=n&&u.value||r.hasUnpublishedChanges;(r.isDraft||r.isUnpublishedDraft||i)&&e.set(String(t.id),!0)}),l.value&&l.value.id&&!l.value.deletedAt){let t=bp(l.value),n=u.value||t.hasUnpublishedChanges;(t.isDraft||t.isUnpublishedDraft||n)&&e.set(String(l.value.id),!0)}return e.size}),v=async()=>{try{let e=await fetch(`/api/cms/stats`);if(e.ok){let t=await e.json();d.value=t}}catch(e){console.warn(`[TopBar] Failed to refresh pending stats:`,e)}},y=()=>{v()},b=J(()=>s.value?{text:`Unverified Document (Read-Only)`,icon:jh,class:`status-danger`}:o.value?{text:`Working Offline — Saving locally`,icon:Fh,class:`status-warning`}:c.value?{text:`Reconnected — Syncing offline queue...`,icon:vh,class:`status-info`,spin:!0}:null);return Js(()=>{window.addEventListener(`cms-node-updated`,y),d.value?.pendingNodes||v()}),Qs(()=>{window.removeEventListener(`cms-node-updated`,y)}),(e,t)=>(B(),V(`header`,{class:w([`global-top-bar`,{"has-status-bg":b.value}])},[U(`div`,Lh,[n.isMobile?(B(),V(`button`,{key:0,type:`button`,class:w([`sidebar-toggle-chip mobile-only-btn`,{"is-active":n.isSidebarOpen}]),title:n.isSidebarOpen?`Close sidebar`:`Open sidebar`,"aria-label":n.isSidebarOpen?`Close sidebar`:`Open sidebar`,onClick:t[0]||=e=>r(`toggle-sidebar`)},[U(`div`,zh,[U(`div`,{class:w([`hamburger-icon`,{"is-open":n.isSidebarOpen}])},[...t[3]||=[U(`span`,{class:`bar bar-top`},null,-1),U(`span`,{class:`bar bar-bottom`},null,-1)]],2)])],10,Rh)):G(``,!0),U(`button`,{class:`logo`,title:`Go to Dashboard`,onClick:t[1]||=e=>z(a)(!1)},[...t[4]||=[wo(`<svg id="b" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 117.14 27.38" data-v-7cc7ae14><g id="c" data-v-7cc7ae14><path d="M22.48,22.51c1.94,2.9,2.37,3.49,3.49,4.87h-8.56c-.46-1.05-1.42-2.8-2.27-4.18l-5.1-8.16-3.32,3.32v4.15c0,2.04.07,3.13.26,4.87H0c.2-1.68.26-2.9.26-4.87V4.87C.26,2.86.2,1.58,0,0h6.98c-.2,1.71-.26,2.8-.26,4.87v5.83l6.55-7.01c1.28-1.35,2.14-2.47,2.86-3.69h8.89c-.59.59-.82.86-1.28,1.32l-2.3,2.3-6.88,7.21,7.93,11.68Z" data-v-7cc7ae14></path><path d="M46.97,27.38c-.26-1.58-.46-2.44-.79-3.55l-.89-2.8h-9.38l-.89,2.8c-.43,1.32-.66,2.34-.82,3.55h-7.7c.49-.99.79-1.78,1.58-4.02l7.11-19.81c.59-1.61.89-2.6,1.05-3.55h8.59c.23.95.46,1.81,1.12,3.55l7.14,19.81c.63,1.74,1.15,3.09,1.58,4.02h-7.7ZM40.55,5.63l-3.06,9.87h6.19l-3.13-9.87Z" data-v-7cc7ae14></path><path d="M68.92,27.38c-.16-1.15-.53-2.37-1.42-4.87l-3.03-8.75c-.03-.16-1.02-3.23-1.12-3.49q-.36-1.18-.53-1.65c.2,2.07.33,4.77.33,6.52v7.14c0,2.27.07,3.72.26,5.1h-6.48c.2-1.48.26-2.86.26-5.1V5.13c0-1.97-.1-3.72-.26-5.13h8.69c.23,1.42.49,2.47,1.25,4.64l4.94,14.19,4.9-14.19c.76-2.21,1.02-3.26,1.22-4.64h8.72c-.2,1.58-.26,2.93-.26,5.13v17.15c0,2.5.07,3.78.26,5.1h-6.48c.2-1.51.26-2.77.26-5.1v-7.18c0-.79.1-3.26.16-4.28q.1-1.74.13-2.24c-.72,2.57-1.05,3.75-1.48,4.94l-3.19,9.02c-.82,2.34-1.25,3.79-1.42,4.84h-5.73Z" data-v-7cc7ae14></path><path d="M109.44,27.38c-.26-1.58-.46-2.44-.79-3.55l-.89-2.8h-9.38l-.89,2.8c-.43,1.32-.66,2.34-.82,3.55h-7.7c.49-.99.79-1.78,1.58-4.02l7.11-19.81c.59-1.61.89-2.6,1.05-3.55h8.59c.23.95.46,1.81,1.12,3.55l7.14,19.81c.63,1.74,1.15,3.09,1.58,4.02h-7.7ZM103.02,5.63l-3.06,9.87h6.19l-3.13-9.87Z" data-v-7cc7ae14></path></g></svg>`,1)]]),U(`a`,Bh,` v`+L(z(`0.1.0-alpha.185`)),1)]),q(Su,{name:`fade`},{default:qr(()=>[b.value?(B(),V(`div`,Vh,[U(`div`,{class:w([`status-badge`,b.value.class])},[(B(),H(Ki(b.value.icon),{size:13,class:w({"animate-spin":b.value.spin})},null,8,[`class`])),U(`span`,null,L(b.value.text),1)],2)])):G(``,!0)]),_:1}),U(`div`,Hh,[U(`button`,{class:w([`topbar-icon-btn publish-btn`,{"has-pending":_.value>0,"is-active-view":z(i).type===`publisher`}]),title:`Open Publishing Center`,onClick:t[2]||=e=>z(f)(!1)},[U(`div`,Uh,[q(z(Sh),{size:14,class:`btn-icon`}),_.value>0?(B(),V(`span`,Wh,L(_.value),1)):G(``,!0)])],2),U(`button`,{class:w([`topbar-icon-btn help-btn`,{"is-active-view":z(i).type===`help`}]),title:`Open Help & Architecture Guide`,onClick:h},[U(`div`,Gh,[q(z(fm),{size:15,class:`btn-icon`})])],2),U(`button`,{class:w([`topbar-icon-btn user-btn`,{"is-active-view":z(i).type===`user`}]),title:m.value,onClick:g},[U(`div`,qh,[q(z(Ph),{size:15,class:`btn-icon`})])],10,Kh)])],2))}}),Yh=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Xh=Yh(Jh,[[`__scopeId`,`data-v-7cc7ae14`]]);function Zh(e,t){let n=typeof window<`u`,r=t;if(n){let t=localStorage.getItem(e);if(t!==null)try{r=JSON.parse(t)}catch{r=t}}let i=R(r);return ni(i,t=>{n&&localStorage.setItem(e,JSON.stringify(t))},{deep:!0}),i}var Qh={key:0,class:`menu-divider`},$h=[`onClick`],eg=[`title`,`onClick`],tg=vi({__name:`NodeContextMenu`,props:{show:{type:Boolean},items:{},x:{},y:{},anchorRect:{},minWidth:{}},emits:[`select`,`action`,`close`],setup(e,{emit:t}){let n=e,r=t,i=R(null),a=R({top:0,left:0,transformOrigin:`top left`});ni(()=>[n.show,n.x,n.y,n.anchorRect],async()=>{if(!n.show)return;await Fr();let e=i.value,t=e?e.offsetWidth:190,r=e?e.offsetHeight:150,o=window.innerWidth,s=window.innerHeight,c=0,l=0,u,d=`top`,f=`left`;if(n.anchorRect){let e=n.anchorRect;u=`${e.width}px`,l=e.left,l+t>o-8&&(l=Math.max(8,e.right-t),f=`right`),e.bottom+6+r>s-8?(c=e.top-r-6,d=`bottom`):(c=e.bottom+6,d=`top`)}else l=n.x||0,c=n.y||0,l+t>o-8&&(l=Math.max(8,l-t),f=`right`),c+r>s-8&&(c=Math.max(8,c-r),d=`bottom`);a.value={top:Math.max(8,c),left:Math.max(8,l),width:u,transformOrigin:`${d} ${f}`}},{immediate:!0});let o=J(()=>({top:`${a.value.top}px`,left:`${a.value.left}px`,width:a.value.width||`auto`,minWidth:n.minWidth||`190px`,transformOrigin:a.value.transformOrigin})),s=e=>{if(!n.show)return;let t=e.target;if(!(i.value&&i.value.contains(t))){if(n.anchorRect){let{left:t,right:r,top:i,bottom:a}=n.anchorRect;if(e.clientX>=t&&e.clientX<=r&&e.clientY>=i&&e.clientY<=a)return}r(`close`)}};return ni(()=>n.show,e=>{e?setTimeout(()=>{document.addEventListener(`click`,s,!1)},0):document.removeEventListener(`click`,s,!1)},{immediate:!0}),Qs(()=>{document.removeEventListener(`click`,s,!1)}),(t,n)=>(B(),H(ys,{to:`body`},[e.show?(B(),V(`div`,{key:0,ref_key:`menuRef`,ref:i,class:`node-context-menu`,style:x(o.value),onClick:n[0]||=ld(()=>{},[`stop`])},[(B(!0),V(K,null,Xi(e.items,(e,t)=>(B(),V(K,{key:e.key||t},[e.divider?(B(),V(`div`,Qh)):(B(),V(`div`,{key:1,class:w([`menu-item-wrapper`,{"is-active":e.isActive}])},[U(`button`,{class:`menu-item`,onClick:t=>r(`select`,e.key)},[e.icon?(B(),H(Ki(e.icon),{key:0,size:15,class:`menu-icon`})):G(``,!0),U(`span`,null,L(e.label),1)],8,$h),e.hasAction?(B(),V(`button`,{key:0,class:`action-btn`,title:e.actionTitle,onClick:ld(t=>r(`action`,e.key),[`stop`])},[(B(),H(Ki(e.actionIcon),{size:14}))],8,eg)):G(``,!0)],2))],64))),128))],4)):G(``,!0)]))}}),ng={class:`channel-selector-row`},rg={class:`trigger-label`},ig=Yh(vi({__name:`ChannelOperations`,setup(e){let{allChannels:t,selectedChannelId:n,activeChannelSettings:r,activeViewMode:i,setViewMode:a,resetActiveNode:o}=sp(),{openCurrentChannelSettings:s,handleAddNewChannel:c,openChannelSettings:l}=Xp(),{confirmNavigation:u}=Op(),d=Zh(`kama_selected_channel`,`all`);Js(()=>{d.value&&(n.value=d.value)});let f=J(()=>i.value===`channel`),p=J(()=>{if(f.value&&r.value?.id){let e=String(r.value.id);if(e.startsWith(`draft-`)||r.value.isNew)return e}return n.value?String(n.value):`all`}),m=J(()=>{let e=[{key:`all`,label:`All Channels`,isActive:p.value===`all`}];if(Array.isArray(t.value)&&t.value.forEach(t=>{t&&t.id!==void 0&&e.push({key:String(t.id),label:t.label||t.key||`Channel ${t.id}`,isActive:p.value===String(t.id),hasAction:!0,actionIcon:Ch,actionTitle:`Channel Settings`})}),f.value&&r.value?.id){let t=String(r.value.id);(t.startsWith(`draft-`)||r.value.isNew)&&(e.some(e=>String(e.key)===t)||e.push({key:t,label:r.value.label||`New Channel...`,isActive:!0}))}return e.push({key:`divider-1`,divider:!0}),e.push({key:`__add_new__`,label:`Add Channel...`,icon:gh}),e}),h=J(()=>{let e=m.value.find(e=>String(e.key)===p.value);return e?e.label:`Select Channel`}),g=R(!1),_=R(null),v=R(null),y=()=>{if(g.value){g.value=!1;return}_.value&&(v.value=_.value.getBoundingClientRect()),g.value=!0},b=async e=>{if(g.value=!1,e===`__add_new__`){if(!await u())return;await c();return}let t=String(e);if(f.value){if(!await u())return;n.value=t,d.value=t,t===`all`?(a(`none`),o()):await s()}else n.value=t,d.value=t},x=async e=>{g.value=!1,await u()&&(n.value=String(e),d.value=String(e),typeof l==`function`?await l(e):await s())};return(e,t)=>(B(),V(`div`,ng,[U(`button`,{ref_key:`triggerRef`,ref:_,class:w([`channel-trigger-btn`,{"is-open":g.value}]),onClick:ld(y,[`stop`])},[q(z(zm),{size:15,class:`trigger-icon`}),U(`span`,rg,L(h.value),1),q(z(_m),{size:15,class:`trigger-chevron`})],2),q(tg,{show:g.value,items:m.value,"anchor-rect":v.value,onSelect:b,onAction:x,onClose:t[0]||=e=>g.value=!1},null,8,[`show`,`items`,`anchor-rect`])]))}}),[[`__scopeId`,`data-v-1633f33b`]]);function ag(e){Object.getOwnPropertySymbols(e).forEach(t=>{Py[t]=e[t]})}function og(e,t=``){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:zy}}function sg(e,t,n,r,i,a,o,s=!1,c=!1,l=!1,u=zy){return e&&(s?(e.helper(ey),e.helper(Tg(e.inSSR,l))):e.helper(wg(e.inSSR,l)),o&&e.helper(fy)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:a,directives:o,isBlock:s,disableTracking:c,isComponent:l,loc:u}}function cg(e,t=zy){return{type:17,loc:t,elements:e}}function lg(e,t=zy){return{type:15,loc:t,properties:e}}function ug(e,t){return{type:16,loc:zy,key:I(e)?dg(e,!0):e,value:t}}function dg(e,t=!1,n=zy,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function fg(e,t){return{type:5,loc:t,content:I(e)?dg(e,!1,t):e}}function pg(e,t=zy){return{type:8,loc:t,children:e}}function mg(e,t=[],n=zy){return{type:14,loc:n,callee:e,arguments:t}}function hg(e,t=void 0,n=!1,r=!1,i=zy){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function gg(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:zy}}function _g(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:zy}}function vg(e){return{type:21,body:e,loc:zy}}function yg(e){return{type:22,elements:e,loc:zy}}function bg(e,t,n){return{type:23,test:e,consequent:t,alternate:n,loc:zy}}function xg(e,t){return{type:24,left:e,right:t,loc:zy}}function Sg(e){return{type:25,expressions:e,loc:zy}}function Cg(e){return{type:26,returns:e,loc:zy}}function wg(e,t){return e||t?ry:iy}function Tg(e,t){return e||t?ty:ny}function Eg(e,{helper:t,removeHelper:n,inSSR:r}){e.isBlock||(e.isBlock=!0,n(wg(r,e.isComponent)),t(ey),t(Tg(r,e.isComponent)))}function Dg(e){return e>=97&&e<=122||e>=65&&e<=90}function Og(e){return e===32||e===10||e===9||e===12||e===13}function kg(e){return e===47||e===62||Og(e)}function Ag(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function jg(e,{compatConfig:t}){let n=t&&t[e];return e===`MODE`?n||3:n}function Mg(e,t){let n=jg(`MODE`,t),r=jg(e,t);return n===3?r===!0:r!==!1}function Ng(e,t,n,...r){return Mg(e,t)}function Pg(e,t,n,...r){if(jg(e,t)===`suppress-warning`)return;let{message:i,link:a}=Gy[e],o=`(deprecation ${e}) ${typeof i==`function`?i(...r):i}${a?`
6
6
  Details: ${a}`:``}`,s=SyntaxError(o);s.code=e,n&&(s.loc=n),t.onWarn(s)}function Fg(e){throw e}function Ig(e){}function Lg(e,t,n,r){let i=`https://vuejs.org/error-reference/#compiler-${e}`,a=SyntaxError(String(i));return a.code=e,a.loc=t,a}function Rg(e,t,n=!1,r=[],i=Object.create(null)){}function zg(e,t,n){return!1}function Bg(e,t){if(e&&(e.type===`ObjectProperty`||e.type===`ArrayPattern`)){let e=t.length;for(;e--;){let n=t[e];if(n.type===`AssignmentExpression`)return!0;if(n.type!==`ObjectProperty`&&!n.type.endsWith(`Pattern`))break}}return!1}function Vg(e){let t=e.length;for(;t--;){let n=e[t];if(n.type===`NewExpression`)return!0;if(n.type!==`MemberExpression`)break}return!1}function Hg(e,t){for(let n of e.params)for(let e of qg(n))t(e)}function Ug(e,t){let n=e.type===`SwitchCase`?e.consequent:e.body;for(let e of n)if(e.type===`VariableDeclaration`){if(e.declare)continue;for(let n of e.declarations)for(let e of qg(n.id))t(e)}else if(e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`){if(e.declare||!e.id)continue;t(e.id)}else Wg(e)?Gg(e,!0,t):e.type===`SwitchStatement`&&Kg(e,!0,t)}function Wg(e){return e.type===`ForOfStatement`||e.type===`ForInStatement`||e.type===`ForStatement`}function Gg(e,t,n){let r=e.type===`ForStatement`?e.init:e.left;if(r&&r.type===`VariableDeclaration`&&(r.kind===`var`?t:!t))for(let e of r.declarations)for(let t of qg(e.id))n(t)}function Kg(e,t,n){for(let r of e.cases){for(let e of r.consequent)if(e.type===`VariableDeclaration`&&(e.kind===`var`?t:!t))for(let t of e.declarations)for(let e of qg(t.id))n(e);Ug(r,n)}}function qg(e,t=[]){switch(e.type){case`Identifier`:t.push(e);break;case`MemberExpression`:let n=e;for(;n.type===`MemberExpression`;)n=n.object;t.push(n);break;case`ObjectPattern`:for(let n of e.properties)n.type===`RestElement`?qg(n.argument,t):qg(n.value,t);break;case`ArrayPattern`:e.elements.forEach(e=>{e&&qg(e,t)});break;case`RestElement`:qg(e.argument,t);break;case`AssignmentPattern`:qg(e.left,t)}return t}function Jg(e){return Zy.includes(e.type)?Jg(e.expression):e}function Yg(e){switch(e){case`Teleport`:case`teleport`:return Xv;case`Suspense`:case`suspense`:return Zv;case`KeepAlive`:case`keep-alive`:return Qv;case`BaseTransition`:case`base-transition`:return $v}}function Xg(e,t,n=t.length){return Zg({offset:e.offset,line:e.line,column:e.column},t,n)}function Zg(e,t,n=t.length){let r=0,i=-1;for(let e=0;e<n;e++)t.charCodeAt(e)===10&&(r++,i=e);return e.offset+=n,e.line+=r,e.column=i===-1?e.column+n:n-i,e}function Qg(e,t){if(!e)throw Error(t||`unexpected compiler condition`)}function $g(e,t,n=!1){for(let r=0;r<e.props.length;r++){let i=e.props[r];if(i.type===7&&(n||i.exp)&&(I(t)?i.name===t:t.test(i.name)))return i}}function e_(e,t,n=!1,r=!1){for(let i=0;i<e.props.length;i++){let a=e.props[i];if(a.type===6){if(n)continue;if(a.name===t&&(a.value||r))return a}else if(a.name===`bind`&&(a.exp||r)&&t_(a.arg,t))return a}}function t_(e,t){return!!(e&&Qy(e)&&e.content===t)}function n_(e){return e.props.some(e=>e.type===7&&e.name===`bind`&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function r_(e){return e.type===5||e.type===2}function i_(e){return e.type===7&&e.name===`pre`}function a_(e){return e.type===7&&e.name===`slot`}function o_(e){return e.type===1&&e.tagType===3}function s_(e){return e.type===1&&e.tagType===2}function c_(e,t=[]){if(e&&!I(e)&&e.type===14){let n=e.callee;if(!I(n)&&fb.has(n))return c_(e.arguments[0],t.concat(e))}return[e,t]}function l_(e,t,n){if(e.type!==13&&u_(e,t))return;let r,i=e.type===13?e.props:e.arguments[2],a=[],o;if(i&&!I(i)&&i.type===14){let e=c_(i);i=e[0],a=e[1],o=a[a.length-1]}if(i==null||I(i))r=lg([t]);else if(i.type===14){let e=i.arguments[0];!I(e)&&e.type===15?d_(t,e)||e.properties.unshift(t):i.callee===Sy?r=mg(n.helper(_y),[lg([t]),i]):i.arguments.unshift(lg([t])),!r&&(r=i)}else i.type===15?(d_(t,i)||i.properties.unshift(t),r=i):(r=mg(n.helper(_y),[lg([t]),i]),o&&o.callee===xy&&(o=a[a.length-2]));e.type===13?o?o.arguments[0]=r:e.props=r:o?o.arguments[0]=r:e.arguments[2]=r}function u_(e,t){var n,r,i;if(t.key.type!==4||t.key.content!==`key`)return!1;let a=e.arguments[2];if(a&&!I(a)){let[e]=c_(a);if(e&&!I(e)&&e.type===15&&d_(t,e))return!0}return(n=e.arguments)[2]||(n[2]=`{}`),(r=e.arguments)[3]||(r[3]=`undefined`),(i=e.arguments)[4]||(i[4]=`undefined`),e.arguments[5]=t.value,!0}function d_(e,t){let n=!1;if(e.key.type===4){let r=e.key.content;n=t.properties.some(e=>e.key.type===4&&e.key.content===r)}return n}function f_(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>t===`-`?`_`:e.charCodeAt(n).toString())}`}function p_(e,t){if(!e||Object.keys(t).length===0)return!1;switch(e.type){case 1:for(let n=0;n<e.props.length;n++){let r=e.props[n];if(r.type===7&&(p_(r.arg,t)||p_(r.exp,t)))return!0}return e.children.some(e=>p_(e,t));case 11:return p_(e.source,t)?!0:e.children.some(e=>p_(e,t));case 9:return e.branches.some(e=>p_(e,t));case 10:return p_(e.condition,t)?!0:e.children.some(e=>p_(e,t));case 4:return!e.isStatic&&eb(e.content)&&!!t[e.content];case 8:return e.children.some(e=>_e(e)&&p_(e,t));case 5:case 12:return p_(e.content,t);case 2:case 3:case 20:return!1;default:return!1}}function m_(e){return e.type===14&&e.callee===My?e.arguments[1].returns:e}function h_(e){for(let t=0;t<e.length;t++)if(!Og(e.charCodeAt(t)))return!1;return!0}function g_(e){return e.type===2&&h_(e.content)||e.type===12&&g_(e.content)}function __(e){return e.type===3||g_(e)}function v_(e){let t=e.loc,n=e.content,r=n.match(pb);if(!r)return;let[,i,a]=r,o=(e,n,r=!1)=>{let i=t.start.offset+n;return I_(e,!1,M_(i,i+e.length),0,+!!r)},s={source:o(a.trim(),n.indexOf(a,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1},c=i.trim().replace(kb,``).trim(),l=i.indexOf(c),u=c.match(Ob);if(u){c=c.replace(Ob,``).trim();let e=u[1].trim(),t;if(e&&(t=n.indexOf(e,l+c.length),s.key=o(e,t,!0)),u[2]){let r=u[2].trim();r&&(s.index=o(r,n.indexOf(r,s.key?t+e.length:l+c.length),!0))}}return c&&(s.value=o(c,l,!0)),s}function y_(e,t){return _b.slice(e,t)}function b_(e){Db.inSFCRoot&&(vb.innerLoc=M_(e+1,e+1)),j_(vb);let{tag:t,ns:n}=vb;n===0&&hb.isPreTag(t)&&Cb++,hb.isVoidTag(t)?S_(vb,e):(Eb.unshift(vb),(n===1||n===2)&&(Db.inXML=!0)),vb=null}function x_(e,t,n){{let t=Eb[0]&&Eb[0].tag;t!==`script`&&t!==`style`&&e.includes(`&`)&&(e=hb.decodeEntities(e,!1))}let r=Eb[0]||gb,i=r.children[r.children.length-1];i&&i.type===2?(i.content+=e,P_(i.loc,n)):r.children.push({type:2,content:e,loc:M_(t,n)})}function S_(e,t,n=!1){n?P_(e.loc,w_(t,60)):P_(e.loc,C_(t,62)+1),Db.inSFCRoot&&(e.children.length?e.innerLoc.end=M({},e.children[e.children.length-1].loc.end):e.innerLoc.end=M({},e.innerLoc.start),e.innerLoc.source=y_(e.innerLoc.start.offset,e.innerLoc.end.offset));let{tag:r,ns:i,children:a}=e;if(wb||(r===`slot`?e.tagType=2:T_(e)?e.tagType=3:E_(e)&&(e.tagType=1)),Db.inRCDATA||(e.children=O_(a)),i===0&&hb.isIgnoreNewlineTag(r)){let e=a[0];e&&e.type===2&&(e.content=e.content.replace(/^\r?\n/,``))}i===0&&hb.isPreTag(r)&&Cb--,Tb===e&&(wb=Db.inVPre=!1,Tb=null),Db.inXML&&(Eb[0]?Eb[0].ns:hb.ns)===0&&(Db.inXML=!1);{let t=e.props;if(!Db.inSFCRoot&&Mg(`COMPILER_NATIVE_TEMPLATE`,hb)&&e.tag===`template`&&!T_(e)){let t=Eb[0]||gb,n=t.children.indexOf(e);t.children.splice(n,1,...e.children)}let n=t.find(e=>e.type===6&&e.name===`inline-template`);n&&Ng(`COMPILER_INLINE_TEMPLATE`,hb,n.loc)&&e.children.length&&(n.value={type:2,content:y_(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function C_(e,t){let n=e;for(;_b.charCodeAt(n)!==t&&n<_b.length-1;)n++;return n}function w_(e,t){let n=e;for(;_b.charCodeAt(n)!==t&&n>=0;)n--;return n}function T_({tag:e,props:t}){if(e===`template`){for(let e=0;e<t.length;e++)if(t[e].type===7&&Ab.has(t[e].name))return!0}return!1}function E_({tag:e,props:t}){if(hb.isCustomElement(e))return!1;if(e===`component`||D_(e.charCodeAt(0))||Yg(e)||hb.isBuiltInComponent&&hb.isBuiltInComponent(e)||hb.isNativeTag&&!hb.isNativeTag(e))return!0;for(let e=0;e<t.length;e++){let n=t[e];if(n.type===6){if(n.name===`is`&&n.value&&(n.value.content.startsWith(`vue:`)||Ng(`COMPILER_IS_ON_ELEMENT`,hb,n.loc)))return!0}else if(n.name===`bind`&&t_(n.arg,`is`)&&Ng(`COMPILER_IS_ON_ELEMENT`,hb,n.loc))return!0}return!1}function D_(e){return e>64&&e<91}function O_(e){let t=hb.whitespace!==`preserve`,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.type===2){if(Cb)i.content=i.content.replace(jb,`
7
7
  `);else if(h_(i.content)){let a=e[r-1]&&e[r-1].type,o=e[r+1]&&e[r+1].type;!a||!o||t&&(a===3&&(o===3||o===1)||a===1&&(o===3||o===1&&k_(i.content)))?(n=!0,e[r]=null):i.content=` `}else t&&(i.content=A_(i.content))}}return n?e.filter(Boolean):e}function k_(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n===10||n===13)return!0}return!1}function A_(e){let t=``,n=!1;for(let r=0;r<e.length;r++)Og(e.charCodeAt(r))?n||=(t+=` `,!0):(t+=e[r],n=!1);return t}function j_(e){(Eb[0]||gb).children.push(e)}function M_(e,t){return{start:Db.getPos(e),end:t==null?t:Db.getPos(t),source:t==null?t:y_(e,t)}}function N_(e){return M_(e.start.offset,e.end.offset)}function P_(e,t){e.end=Db.getPos(t),e.source=y_(e.start.offset,t)}function F_(e){let t={type:6,name:e.rawName,nameLoc:M_(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){let n=e.exp.loc;n.end.offset<e.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:e.exp.content,loc:n}}return t}function I_(e,t=!1,n,r=0,i=0){return dg(e,t,n,r)}function L_(e,t,n){hb.onError(Lg(e,M_(t,t),void 0,n))}function R_(){Db.reset(),vb=null,yb=null,bb=``,xb=-1,Sb=-1,Eb.length=0}function z_(e,t){if(R_(),_b=e,hb=M({},mb),t){let e;for(e in t)t[e]!=null&&(hb[e]=t[e])}Db.mode=hb.parseMode===`html`?1:hb.parseMode===`sfc`?2:0,Db.inXML=hb.ns===1||hb.ns===2;let n=t&&t.delimiters;n&&(Db.delimiterOpen=Ag(n[0]),Db.delimiterClose=Ag(n[1]));let r=gb=og([],e);return Db.parse(_b),r.loc=M_(0,e.length),r.children=O_(r.children),gb=null,r}function B_(e,t){H_(e,void 0,t,!!V_(e))}function V_(e){let t=e.children.filter(e=>e.type!==3);return t.length===1&&t[0].type===1&&!s_(t[0])?t[0]:null}function H_(e,t,n,r=!1,i=!1){let{children:a}=e,o=[];for(let t=0;t<a.length;t++){let s=a[t];if(s.type===1&&s.tagType===0){let e=r?0:U_(s,n);if(e>0){if(e>=2){s.codegenNode.patchFlag=-1,o.push(s);continue}}else{let e=s.codegenNode;if(e.type===13){let t=e.patchFlag;if((t===void 0||t===512||t===1)&&G_(s,n)>=2){let t=K_(s);t&&(e.props=n.hoist(t))}e.dynamicProps&&=n.hoist(e.dynamicProps)}}}else if(s.type===12&&(r?0:U_(s,n))>=2){s.codegenNode.type===14&&s.codegenNode.arguments.length>0&&s.codegenNode.arguments.push(`-1`),o.push(s);continue}if(s.type===1){let t=s.tagType===1;t&&n.scopes.vSlot++,H_(s,e,n,!1,i),t&&n.scopes.vSlot--}else if(s.type===11)H_(s,e,n,s.children.length===1,!0);else if(s.type===9)for(let t=0;t<s.branches.length;t++)H_(s.branches[t],e,n,s.branches[t].children.length===1,i)}let s=!1;if(o.length===a.length&&e.type===1){if(e.tagType===0&&e.codegenNode&&e.codegenNode.type===13&&P(e.codegenNode.children))e.codegenNode.children=c(cg(e.codegenNode.children)),s=!0;else if(e.tagType===1&&e.codegenNode&&e.codegenNode.type===13&&e.codegenNode.children&&!P(e.codegenNode.children)&&e.codegenNode.children.type===15){let t=l(e.codegenNode,`default`);t&&(t.returns=c(cg(t.returns)),s=!0)}else if(e.tagType===3&&t&&t.type===1&&t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!P(t.codegenNode.children)&&t.codegenNode.children.type===15){let n=$g(e,`slot`,!0),r=n&&n.arg&&l(t.codegenNode,n.arg);r&&(r.returns=c(cg(r.returns)),s=!0)}}if(!s)for(let e of o)e.codegenNode=n.cache(e.codegenNode);function c(e){let t=n.cache(e);return t.needArraySpread=!0,t}function l(e,t){if(e.children&&!P(e.children)&&e.children.type===15){let n=e.children.properties.find(e=>e.key===t||e.key.content===t);return n&&n.value}}o.length&&n.transformHoist&&n.transformHoist(a,n,e)}function U_(e,t){let{constantCache:n}=t;switch(e.type){case 1:if(e.tagType!==0)return 0;let r=n.get(e);if(r!==void 0)return r;let i=e.codegenNode;if(i.type!==13||i.isBlock&&e.tag!==`svg`&&e.tag!==`foreignObject`&&e.tag!==`math`)return 0;if(i.patchFlag===void 0){let r=3,a=G_(e,t);if(a===0)return n.set(e,0),0;a<r&&(r=a);for(let i=0;i<e.children.length;i++){let a=U_(e.children[i],t);if(a===0)return n.set(e,0),0;a<r&&(r=a)}if(r>1)for(let i=0;i<e.props.length;i++){let a=e.props[i];if(a.type===7&&a.name===`bind`&&a.exp){let i=U_(a.exp,t);if(i===0)return n.set(e,0),0;i<r&&(r=i)}}if(i.isBlock){for(let t=0;t<e.props.length;t++)if(e.props[t].type===7)return n.set(e,0),0;t.removeHelper(ey),t.removeHelper(Tg(t.inSSR,i.isComponent)),i.isBlock=!1,t.helper(wg(t.inSSR,i.isComponent))}return n.set(e,r),r}return n.set(e,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return U_(e.content,t);case 4:return e.constType;case 8:let a=3;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(I(r)||ge(r))continue;let i=U_(r,t);if(i===0)return 0;i<a&&(a=i)}return a;case 20:return 2;default:return 0}}function W_(e,t){if(e.type===14&&!I(e.callee)&&Mb.has(e.callee)){let n=e.arguments[0];if(n.type===4)return U_(n,t);if(n.type===14)return W_(n,t)}return 0}function G_(e,t){let n=3,r=K_(e);if(r&&r.type===15){let{properties:e}=r;for(let r=0;r<e.length;r++){let{key:i,value:a}=e[r],o=U_(i,t);if(o===0)return o;o<n&&(n=o);let s;if(s=a.type===4?U_(a,t):a.type===14?W_(a,t):0,s===0)return s;s<n&&(n=s)}}return n}function K_(e){let t=e.codegenNode;if(t.type===13)return t.props}function q_(e,{filename:t=``,prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:i=!1,cacheHandlers:a=!1,nodeTransforms:o=[],directiveTransforms:s={},transformHoist:c=null,isBuiltInComponent:l=oe,isCustomElement:u=oe,expressionPlugins:d=[],scopeId:f=null,slotted:p=!0,ssr:m=!1,inSSR:h=!1,ssrCssVars:g=``,bindingMetadata:_=j,inline:v=!1,isTS:y=!1,onError:b=Fg,onWarn:x=Ig,compatConfig:S}){let C=t.replace(/\?.*$/,``).match(/([^/\\]+)\.\w+$/),w={filename:t,selfName:C&&je(Oe(C[1])),prefixIdentifiers:n,hoistStatic:r,hmr:i,cacheHandlers:a,nodeTransforms:o,directiveTransforms:s,transformHoist:c,isBuiltInComponent:l,isCustomElement:u,expressionPlugins:d,scopeId:f,slotted:p,ssr:m,inSSR:h,ssrCssVars:g,bindingMetadata:_,inline:v,isTS:y,onError:b,onWarn:x,compatConfig:S,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,vForMemoKeyedNodes:new WeakSet,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=w.helpers.get(e)||0;return w.helpers.set(e,t+1),e},removeHelper(e){let t=w.helpers.get(e);if(t){let n=t-1;n?w.helpers.set(e,n):w.helpers.delete(e)}},helperString(e){return`_${Py[w.helper(e)]}`},replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){let t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;!e||e===w.currentNode?(w.currentNode=null,w.onNodeRemoved()):w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:oe,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){I(e)&&(e=dg(e)),w.hoists.push(e);let t=dg(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let r=_g(w.cached.length,e,t,n);return w.cached.push(r),r}};return w.filters=new Set,w}function J_(e,t){let n=q_(e,t);Z_(e,n),t.hoistStatic&&B_(e,n),t.ssr||Y_(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function Y_(e,t){let{helper:n}=t,{children:r}=e;if(r.length===1){let n=V_(e);if(n&&n.codegenNode){let r=n.codegenNode;r.type===13&&Eg(r,t),e.codegenNode=r}else e.codegenNode=r[0]}else r.length>1&&(e.codegenNode=sg(t,n(Yv),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}function X_(e,t){let n=0,r=()=>{n--};for(;n<e.children.length;n++){let i=e.children[n];I(i)||(t.grandParent=t.parent,t.parent=e,t.childIndex=n,t.onNodeRemoved=r,Z_(i,t))}}function Z_(e,t){t.currentNode=e;let{nodeTransforms:n}=t,r=[];for(let i=0;i<n.length;i++){let a=n[i](e,t);if(a&&(P(a)?r.push(...a):r.push(a)),t.currentNode)e=t.currentNode;else return}switch(e.type){case 3:t.ssr||t.helper(ay);break;case 5:t.ssr||t.helper(gy);break;case 9:for(let n=0;n<e.branches.length;n++)Z_(e.branches[n],t);break;case 10:case 11:case 1:case 0:X_(e,t)}t.currentNode=e;let i=r.length;for(;i--;)r[i]()}function Q_(e,t){let n=I(e)?t=>t===e:t=>e.test(t);return(e,r)=>{if(e.type===1){let{props:i}=e;if(e.tagType===3&&i.some(a_))return;let a=[];for(let o=0;o<i.length;o++){let s=i[o];if(s.type===7&&n(s.name)){i.splice(o,1),o--;let n=t(e,s,r);n&&a.push(n)}}return a}}}function $_(e,{mode:t=`function`,prefixIdentifiers:n=t===`module`,sourceMap:r=!1,filename:i=`template.vue.html`,scopeId:a=null,optimizeImports:o=!1,runtimeGlobalName:s=`Vue`,runtimeModuleName:c=`vue`,ssrRuntimeModuleName:l=`vue/server-renderer`,ssr:u=!1,isTS:d=!1,inSSR:f=!1}){let p={mode:t,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:a,optimizeImports:o,runtimeGlobalName:s,runtimeModuleName:c,ssrRuntimeModuleName:l,ssr:u,isTS:d,inSSR:f,source:e.source,code:``,column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(e){return`_${Py[e]}`},push(e,t=-2,n){p.code+=e},indent(){m(++p.indentLevel)},deindent(e=!1){e?--p.indentLevel:m(--p.indentLevel)},newline(){m(p.indentLevel)}};function m(e){p.push(`
8
8
  `+` `.repeat(e),0)}return p}function ev(e,t={}){let n=$_(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:r,push:i,prefixIdentifiers:a,indent:o,deindent:s,newline:c,scopeId:l,ssr:u}=n,d=Array.from(e.helpers),f=d.length>0,p=!a&&r!==`module`;if(tv(e,n),i(`function ${u?`ssrRender`:`render`}(${(u?[`_ctx`,`_push`,`_parent`,`_attrs`]:[`_ctx`,`_cache`]).join(`, `)}) {`),o(),p&&(i(`with (_ctx) {`),o(),f&&(i(`const { ${d.map(Pb).join(`, `)} } = _Vue
@@ -14,7 +14,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14
14
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iS(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}function aS(e,t,n){e.addEventListener(t,n,!sC&&pC)}function oS(e,t,n){e.removeEventListener(t,n,!sC&&pC)}function sS(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cS(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function lS(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&sS(e,t):sS(e,t))||r&&e===n)return e;if(e===n)break}while(e=cS(e))}return null}function uS(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(mC,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(mC,` `))}function dS(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function fS(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=dS(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function pS(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function mS(){return document.scrollingElement||document.documentElement}function hS(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==mS()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!sC))do if(i&&i.getBoundingClientRect&&(dS(i,`transform`)!==`none`||n&&dS(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(dS(i,`border-top-width`)),s-=f.left+parseInt(dS(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=fS(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function gS(e,t,n){for(var r=SS(e,!0),i=hS(e)[t];r;){var a=hS(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===mS())break;r=SS(r,!1)}return!1}function _S(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==IS.ghost&&(r||o[a]!==IS.dragged)&&lS(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function vS(e,t){for(var n=e.lastElementChild;n&&(n===IS.ghost||dS(n,`display`)===`none`||t&&!sS(n,t));)n=n.previousElementSibling;return n||null}function yS(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==IS.clone&&(!t||sS(e,t))&&n++;return n}function bS(e){var t=0,n=0,r=mS();if(e)do{var i=fS(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function xS(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function SS(e,t){if(!e||!e.getBoundingClientRect)return mS();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=dS(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return mS();if(r||t)return n;r=!0}}while(n=n.parentNode);return mS()}function CS(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function wS(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function TS(e,t){return function(){if(!hC){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),hC=setTimeout(function(){hC=void 0},t)}}}function ES(){clearTimeout(hC),hC=void 0}function DS(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function OS(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function kS(e,t){dS(e,`position`,`absolute`),dS(e,`top`,t.top),dS(e,`left`,t.left),dS(e,`width`,t.width),dS(e,`height`,t.height)}function AS(e){dS(e,`position`,``),dS(e,`top`,``),dS(e,`left`,``),dS(e,`width`,``),dS(e,`height`,``)}function jS(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(dS(t,`display`)!==`none`&&t!==IS.ghost){e.push({target:t,rect:hS(t)});var n=Kx({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=fS(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(xS(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=hS(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=fS(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&wS(c,s)&&!wS(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=NS(u,c,l,r.options)),wS(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){dS(e,`transition`,``),dS(e,`transform`,``);var i=fS(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,dS(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=MS(e),dS(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),dS(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){dS(e,`transition`,``),dS(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function MS(e){return e.offsetWidth}function NS(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}function PS(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[gC],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!sC&&!cC?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=Kx(Kx({},m),yC.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}function FS(e){PS(Kx({putSortable:PC,cloneEl:DC,targetEl:X,rootEl:wC,oldIndex:kC,oldDraggableIndex:jC,newIndex:AC,newDraggableIndex:MC},e))}function IS(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Yx({},t),e[gC]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return aw(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:IS.supportPointer!==!1&&`PointerEvent`in window&&!uC,emptyInsertThreshold:5};for(var r in yC.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in cw(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&rw,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?aS(e,`pointerdown`,this._onTapStart):(aS(e,`mousedown`,this._onTapStart),aS(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(aS(e,`dragover`,this),aS(e,`dragenter`,this)),LC.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Yx(this,jS())}function LS(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function RS(e,t,n,r,i,a,o,s){var c,l=e[gC],u=l.options.onMove,d;return window.CustomEvent&&!sC&&!cC?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||hS(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function zS(e){e.draggable=!1}function BS(){QC=!1}function VS(e,t,n){var r=hS(_S(n.el,0,n.options,!0)),i=10;return t?e.clientX<r.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-i||e.clientY<r.bottom&&e.clientX<r.left}function HS(e,t,n){var r=hS(vS(n.el,n.options.draggable)),i=10;return t?e.clientX>r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function US(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&YC<l*i){if(!qC&&(KC===1?c>u+l*a/2:c<d-l*a/2)&&(qC=!0),qC)f=!0;else if(KC===1?c<u+YC:c>d-YC)return-KC}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return WS(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function WS(e){return yS(X)<yS(e)?1:-1}function GS(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function KS(e){$C.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&$C.push(r)}}function qS(e){return setTimeout(e,0)}function JS(e){return clearTimeout(e)}function YS(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?aS(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?aS(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?aS(document,`touchmove`,this._handleFallbackAutoScroll):aS(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?oS(document,`dragover`,this._handleAutoScroll):(oS(document,`pointermove`,this._handleFallbackAutoScroll),oS(document,`touchmove`,this._handleFallbackAutoScroll),oS(document,`mousemove`,this._handleFallbackAutoScroll)),ZS(),XS(),ES()},nulling:function(){yw=hw=mw=gw=bw=_w=vw=null,pw.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(yw=e,t||this.options.forceAutoScrollFallback||cC||sC||uC){xw(e,this.options,a,t);var o=SS(a,!0);gw&&(!bw||r!==_w||i!==vw)&&(bw&&ZS(),bw=setInterval(function(){var a=SS(document.elementFromPoint(r,i),!0);a!==o&&(o=a,XS()),xw(e,n.options,a,t)},10),_w=r,vw=i)}else{if(!this.options.bubbleScroll||SS(a,!0)===mS()){XS();return}xw(e,this.options,SS(a,!1),!1)}}},Yx(e,{pluginName:`scroll`,initializeByDefault:!0})}function XS(){pw.forEach(function(e){clearInterval(e.pid)}),pw=[]}function ZS(){clearInterval(bw)}function QS(){}function $S(){}function eC(){function e(){this.defaults={swapClass:`sortable-swap-highlight`}}return e.prototype={dragStart:function(e){Cw=e.dragEl},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,i=e.activeSortable,a=e.changed,o=e.cancel;if(i.options.swap){var s=this.sortable.el,c=this.options;if(n&&n!==s){var l=Cw;r(n)===!1?Cw=null:(uS(n,c.swapClass,!0),Cw=n),l&&l!==Cw&&uS(l,c.swapClass,!1)}a(),t(!0),o()}},drop:function(e){var t=e.activeSortable,n=e.putSortable,r=e.dragEl,i=n||this.sortable,a=this.options;Cw&&uS(Cw,a.swapClass,!1),Cw&&(a.swap||n&&n.options.swap)&&r!==Cw&&(i.captureAnimationState(),i!==t&&t.captureAnimationState(),tC(r,Cw),i.animateAll(),i!==t&&t.animateAll())},nulling:function(){Cw=null}},Yx(e,{pluginName:`swap`,eventProperties:function(){return{swapItem:Cw}}})}function tC(e,t){var n=e.parentNode,r=t.parentNode,i,a;!n||!r||n.isEqualNode(t)||r.isEqualNode(e)||(i=yS(e),a=yS(t),n.isEqualNode(r)&&i<a&&a++,n.insertBefore(t,n.children[i]),r.insertBefore(e,r.children[a]))}function nC(){function e(e){for(var t in this)t.charAt(0)===`_`&&typeof this[t]==`function`&&(this[t]=this[t].bind(this));e.options.supportPointer?aS(document,`pointerup`,this._deselectMultiDrag):(aS(document,`mouseup`,this._deselectMultiDrag),aS(document,`touchend`,this._deselectMultiDrag)),aS(document,`keydown`,this._checkKeyDown),aS(document,`keyup`,this._checkKeyUp),this.defaults={selectedClass:`sortable-selected`,multiDragKey:null,setData:function(t,n){var r=``;ww.length&&Dw===e?ww.forEach(function(e,t){r+=(t?`, `:``)+e.textContent}):r=n.textContent,t.setData(`Text`,r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){jw=e.dragEl},delayEnded:function(){this.isMultiDrag=~ww.indexOf(jw)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<ww.length;r++)Tw.push(OS(ww[r])),Tw[r].sortableIndex=ww[r].sortableIndex,Tw[r].draggable=!1,Tw[r].style[`will-change`]=``,uS(Tw[r],this.options.selectedClass,!1),ww[r]===jw&&uS(Tw[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,i=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ww.length&&Dw===t&&(iC(!0,n),r(`clone`),i()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(iC(!1,n),Tw.forEach(function(e){dS(e,`display`,``)}),t(),Nw=!1,r())},hideClone:function(e){var t=this;e.sortable;var n=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(Tw.forEach(function(e){dS(e,`display`,`none`),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),Nw=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&Dw&&Dw.multiDrag._deselectMultiDrag(),ww.forEach(function(e){e.sortableIndex=yS(e)}),ww=ww.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),Aw=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){ww.forEach(function(e){e!==jw&&dS(e,`position`,`absolute`)});var r=hS(jw,!1,!0,!0);ww.forEach(function(e){e!==jw&&kS(e,r)}),kw=!0,Ow=!0}n.animateAll(function(){kw=!1,Ow=!1,t.options.animation&&ww.forEach(function(e){AS(e)}),t.options.sort&&aC()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;kw&&~ww.indexOf(t)&&(n(!1),r())},revert:function(e){var t=e.fromSortable,n=e.rootEl,r=e.sortable,i=e.dragRect;ww.length>1&&(ww.forEach(function(e){r.addAnimationState({target:e,rect:kw?hS(e):i}),AS(e),e.fromRect=i,t.removeAnimationState(e)}),kw=!1,rC(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,i=e.activeSortable,a=e.parentEl,o=e.putSortable,s=this.options;if(r){if(n&&i._hideClone(),Ow=!1,s.animation&&ww.length>1&&(kw||!n&&!i.options.sort&&!o)){var c=hS(jw,!1,!0,!0);ww.forEach(function(e){e!==jw&&(kS(e,c),a.appendChild(e))}),kw=!0}if(!n){if(kw||aC(),ww.length>1){var l=Nw;i._showClone(t),i.options.animation&&!Nw&&l&&Tw.forEach(function(e){i.addAnimationState({target:e,rect:Mw}),e.fromRect=Mw,e.thisAnimationDuration=null})}else i._showClone(t)}}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(ww.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){Mw=Yx({},t);var i=fS(jw,!0);Mw.top-=i.f,Mw.left-=i.e}},dragOverAnimationComplete:function(){kw&&(kw=!1,aC())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,i=e.sortable,a=e.dispatchSortableEvent,o=e.oldIndex,s=e.putSortable,c=s||this.sortable;if(t){var l=this.options,u=r.children;if(!Aw){if(l.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),uS(jw,l.selectedClass,!~ww.indexOf(jw)),~ww.indexOf(jw))ww.splice(ww.indexOf(jw),1),Ew=null,PS({sortable:i,rootEl:n,name:`deselect`,targetEl:jw,originalEvt:t});else{if(ww.push(jw),PS({sortable:i,rootEl:n,name:`select`,targetEl:jw,originalEvt:t}),t.shiftKey&&Ew&&i.el.contains(Ew)){var d=yS(Ew),f=yS(jw);if(~d&&~f&&d!==f){var p,m;for(f>d?(m=d,p=f):(m=f,p=d+1);m<p;m++)~ww.indexOf(u[m])||(uS(u[m],l.selectedClass,!0),ww.push(u[m]),PS({sortable:i,rootEl:n,name:`select`,targetEl:u[m],originalEvt:t}))}}else Ew=jw;Dw=c}}if(Aw&&this.isMultiDrag){if(kw=!1,(r[gC].options.sort||r!==n)&&ww.length>1){var h=hS(jw),g=yS(jw,`:not(.`+this.options.selectedClass+`)`);if(!Ow&&l.animation&&(jw.thisAnimationDuration=null),c.captureAnimationState(),!Ow&&(l.animation&&(jw.fromRect=h,ww.forEach(function(e){if(e.thisAnimationDuration=null,e!==jw){var t=kw?hS(e):h;e.fromRect=t,c.addAnimationState({target:e,rect:t})}})),aC(),ww.forEach(function(e){u[g]?r.insertBefore(e,u[g]):r.appendChild(e),g++}),o===yS(jw))){var _=!1;ww.forEach(function(e){if(e.sortableIndex!==yS(e)){_=!0;return}}),_&&a(`update`)}ww.forEach(function(e){AS(e)}),c.animateAll()}Dw=c}(n===r||s&&s.lastPutMode!==`clone`)&&Tw.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=Aw=!1,Tw.length=0},destroyGlobal:function(){this._deselectMultiDrag(),oS(document,`pointerup`,this._deselectMultiDrag),oS(document,`mouseup`,this._deselectMultiDrag),oS(document,`touchend`,this._deselectMultiDrag),oS(document,`keydown`,this._checkKeyDown),oS(document,`keyup`,this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(Aw!==void 0&&Aw)&&Dw===this.sortable&&!(e&&lS(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;ww.length;){var t=ww[0];uS(t,this.options.selectedClass,!1),ww.shift(),PS({sortable:this.sortable,rootEl:this.sortable.el,name:`deselect`,targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},Yx(e,{pluginName:`multiDrag`,utils:{select:function(e){var t=e.parentNode[gC];!t||!t.options.multiDrag||~ww.indexOf(e)||(Dw&&Dw!==t&&(Dw.multiDrag._deselectMultiDrag(),Dw=t),uS(e,t.options.selectedClass,!0),ww.push(e))},deselect:function(e){var t=e.parentNode[gC],n=ww.indexOf(e);!t||!t.options.multiDrag||!~n||(uS(e,t.options.selectedClass,!1),ww.splice(n,1))}},eventProperties:function(){var e=this,t=[],n=[];return ww.forEach(function(r){t.push({multiDragElement:r,index:r.sortableIndex});var i=kw&&r!==jw?-1:kw?yS(r,`:not(.`+e.options.selectedClass+`)`):yS(r);n.push({multiDragElement:r,index:i})}),{items:Qx(ww),clones:[].concat(Tw),oldIndicies:t,newIndicies:n}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e===`ctrl`?e=`Control`:e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function rC(e,t){ww.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function iC(e,t){Tw.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function aC(){ww.forEach(function(e){e!==jw&&e.parentNode&&e.parentNode.removeChild(e)})}var oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,X,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw=o((()=>{oC=`1.14.0`,sC=iS(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cC=iS(/Edge/i),lC=iS(/firefox/i),uC=iS(/safari/i)&&!iS(/chrome/i)&&!iS(/android/i),dC=iS(/iP(ad|od|hone)/i),fC=iS(/chrome/i)&&iS(/android/i),pC={capture:!1,passive:!1},mC=/\s+/g,gC=`Sortable`+new Date().getTime(),_C=[],vC={initializeByDefault:!0},yC={mount:function(e){for(var t in vC)vC.hasOwnProperty(t)&&!(t in e)&&(e[t]=vC[t]);_C.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),_C.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;_C.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](Kx({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](Kx({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in _C.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,Yx(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return _C.forEach(function(r){typeof r.eventProperties==`function`&&Yx(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return _C.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}},bC=[`evt`],xC=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=Zx(n,bC);yC.pluginEvent.bind(IS)(e,t,Kx({dragEl:X,parentEl:SC,ghostEl:CC,rootEl:wC,nextEl:TC,lastDownEl:EC,cloneEl:DC,cloneHidden:OC,dragStarted:WC,putSortable:PC,activeSortable:IS.active,originalEvent:r,oldIndex:kC,oldDraggableIndex:jC,newIndex:AC,newDraggableIndex:MC,hideGhostForTarget:lw,unhideGhostForTarget:uw,cloneNowHidden:function(){OC=!0},cloneNowShown:function(){OC=!1},dispatchSortableEvent:function(e){FS({sortable:t,name:e,originalEvent:r})}},i))},FC=!1,IC=!1,LC=[],qC=!1,JC=!1,ZC=[],QC=!1,$C=[],ew=typeof document<`u`,tw=dC,nw=cC||sC?`cssFloat`:`float`,rw=ew&&!fC&&!dC&&`draggable`in document.createElement(`div`),iw=function(){if(ew){if(sC)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),aw=function(e,t){var n=dS(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=_S(e,0,t),a=_S(e,1,t),o=i&&dS(i),s=a&&dS(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+hS(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+hS(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[nw]===`none`||a&&n[nw]===`none`&&c+l>r)?`vertical`:`horizontal`},ow=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},sw=function(e,t){var n;return LC.some(function(r){var i=r[gC].options.emptyInsertThreshold;if(!(!i||vS(r))){var a=hS(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},cw=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||qx(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},lw=function(){!iw&&CC&&dS(CC,`display`,`none`)},uw=function(){!iw&&CC&&dS(CC,`display`,``)},ew&&document.addEventListener(`click`,function(e){if(IC)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),IC=!1,!1},!0),dw=function(e){if(X){e=e.touches?e.touches[0]:e;var t=sw(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[gC]._onDragOver(n)}}},fw=function(e){X&&X.parentNode[gC]._isOutsideThisEl(e.target)},IS.prototype={constructor:IS,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(GC=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,X):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(KS(n),!X&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&uC&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=lS(s,r.draggable,n,!1),!(s&&s.animated)&&EC!==s)){if(kC=yS(s),jC=yS(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){FS({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),xC(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=lS(c,r.trim(),n,!1),r)return FS({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),xC(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!lS(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!X&&n.parentNode===i){var c=hS(n);if(wC=i,X=n,SC=X.parentNode,TC=X.nextSibling,EC=n,NC=a.group,IS.dragged=X,RC={target:X,clientX:(t||e).clientX,clientY:(t||e).clientY},HC=RC.clientX-c.left,UC=RC.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,X.style[`will-change`]=`all`,s=function(){if(xC(`delayEnded`,r,{evt:e}),IS.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!lC&&r.nativeDraggable&&(X.draggable=!0),r._triggerDragStart(e,t),FS({sortable:r,name:`choose`,originalEvent:e}),uS(X,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){pS(X,e.trim(),zS)}),aS(o,`dragover`,dw),aS(o,`mousemove`,dw),aS(o,`touchmove`,dw),aS(o,`mouseup`,r._onDrop),aS(o,`touchend`,r._onDrop),aS(o,`touchcancel`,r._onDrop),lC&&this.nativeDraggable&&(this.options.touchStartThreshold=4,X.draggable=!0),xC(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(cC||sC))){if(IS.eventCanceled){this._onDrop();return}aS(o,`mouseup`,r._disableDelayedDrag),aS(o,`touchend`,r._disableDelayedDrag),aS(o,`touchcancel`,r._disableDelayedDrag),aS(o,`mousemove`,r._delayedDragTouchMoveHandler),aS(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&aS(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){X&&zS(X),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;oS(e,`mouseup`,this._disableDelayedDrag),oS(e,`touchend`,this._disableDelayedDrag),oS(e,`touchcancel`,this._disableDelayedDrag),oS(e,`mousemove`,this._delayedDragTouchMoveHandler),oS(e,`touchmove`,this._delayedDragTouchMoveHandler),oS(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?aS(document,`pointermove`,this._onTouchMove):t?aS(document,`touchmove`,this._onTouchMove):aS(document,`mousemove`,this._onTouchMove):(aS(X,`dragend`,this),aS(wC,`dragstart`,this._onDragStart));try{document.selection?qS(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(FC=!1,wC&&X){xC(`dragStarted`,this,{evt:t}),this.nativeDraggable&&aS(document,`dragover`,fw);var n=this.options;!e&&uS(X,n.dragClass,!1),uS(X,n.ghostClass,!0),IS.active=this,e&&this._appendGhost(),FS({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(zC){this._lastX=zC.clientX,this._lastY=zC.clientY,lw();for(var e=document.elementFromPoint(zC.clientX,zC.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(zC.clientX,zC.clientY),e!==t);)t=e;if(X.parentNode[gC]._isOutsideThisEl(e),t)do{if(t[gC]){var n=void 0;if(n=t[gC]._onDragOver({clientX:zC.clientX,clientY:zC.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);uw()}},_onTouchMove:function(e){if(RC){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=CC&&fS(CC,!0),o=CC&&a&&a.a,s=CC&&a&&a.d,c=tw&&XC&&bS(XC),l=(i.clientX-RC.clientX+r.x)/(o||1)+(c?c[0]-ZC[0]:0)/(o||1),u=(i.clientY-RC.clientY+r.y)/(s||1)+(c?c[1]-ZC[1]:0)/(s||1);if(!IS.active&&!FC){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(CC){a?(a.e+=l-(BC||0),a.f+=u-(VC||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;dS(CC,`webkitTransform`,d),dS(CC,`mozTransform`,d),dS(CC,`msTransform`,d),dS(CC,`transform`,d),BC=l,VC=u,zC=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!CC){var e=this.options.fallbackOnBody?document.body:wC,t=hS(X,!0,tw,!0,e),n=this.options;if(tw){for(XC=e;dS(XC,`position`)===`static`&&dS(XC,`transform`)===`none`&&XC!==document;)XC=XC.parentNode;XC!==document.body&&XC!==document.documentElement?(XC===document&&(XC=mS()),t.top+=XC.scrollTop,t.left+=XC.scrollLeft):XC=mS(),ZC=bS(XC)}CC=X.cloneNode(!0),uS(CC,n.ghostClass,!1),uS(CC,n.fallbackClass,!0),uS(CC,n.dragClass,!0),dS(CC,`transition`,``),dS(CC,`transform`,``),dS(CC,`box-sizing`,`border-box`),dS(CC,`margin`,0),dS(CC,`top`,t.top),dS(CC,`left`,t.left),dS(CC,`width`,t.width),dS(CC,`height`,t.height),dS(CC,`opacity`,`0.8`),dS(CC,`position`,tw?`absolute`:`fixed`),dS(CC,`zIndex`,`100000`),dS(CC,`pointerEvents`,`none`),IS.ghost=CC,e.appendChild(CC),dS(CC,`transform-origin`,HC/parseInt(CC.style.width)*100+`% `+UC/parseInt(CC.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(xC(`dragStart`,this,{evt:e}),IS.eventCanceled){this._onDrop();return}xC(`setupClone`,this),IS.eventCanceled||(DC=OS(X),DC.draggable=!1,DC.style[`will-change`]=``,this._hideClone(),uS(DC,this.options.chosenClass,!1),IS.clone=DC),n.cloneId=qS(function(){xC(`clone`,n),!IS.eventCanceled&&(n.options.removeCloneOnHide||wC.insertBefore(DC,X),n._hideClone(),FS({sortable:n,name:`clone`}))}),!t&&uS(X,i.dragClass,!0),t?(IC=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oS(document,`mouseup`,n._onDrop),oS(document,`touchend`,n._onDrop),oS(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,X)),aS(document,`drop`,n),dS(X,`transform`,`translateZ(0)`)),FC=!0,n._dragStartId=qS(n._dragStarted.bind(n,t,e)),aS(document,`selectstart`,n),WC=!0,uC&&dS(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=IS.active,l=NC===s,u=o.sort,d=PC||c,f,p=this,m=!1;if(QC)return;function h(o,s){xC(o,p,Kx({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return RS(wC,t,X,r,n,hS(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(uS(X,PC?PC.options.ghostClass:c.options.ghostClass,!1),uS(X,o.ghostClass,!0)),PC!==p&&p!==IS.active?PC=p:p===IS.active&&PC&&(PC=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===X&&!X.animated||n===t&&!n.animated)&&(GC=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(X.parentNode[gC]._isOutsideThisEl(e.target),!r&&dw(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){AC=yS(X),MC=yS(X,o.draggable),FS({sortable:p,name:`change`,toEl:t,newIndex:AC,newDraggableIndex:MC,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=lS(n,o.draggable,t,!0),h(`dragOver`),IS.eventCanceled)return m;if(X.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(IC=!1,c&&!o.disabled&&(l?u||(a=SC!==wC):PC===this||(this.lastPutMode=NC.checkPull(this,c,X,e))&&s.checkPut(this,c,X,e))){if(f=this._getDirection(e,n)===`vertical`,r=hS(X),h(`dragOverValid`),IS.eventCanceled)return m;if(a)return SC=wC,g(),this._hideClone(),h(`revert`),IS.eventCanceled||(TC?wC.insertBefore(X,TC):wC.appendChild(X)),_(!0);var y=vS(t,o.draggable);if(!y||HS(e,f,this)&&!y.animated){if(y===X)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=hS(n)),RS(wC,t,X,r,n,i,e,!!n)!==!1)return g(),t.appendChild(X),SC=t,v(),_(!0)}else if(y&&VS(e,f,this)){var b=_S(t,0,o,!0);if(b===X)return _(!1);if(n=b,i=hS(n),RS(wC,t,X,r,n,i,e,!1)!==!1)return g(),t.insertBefore(X,b),SC=t,v(),_(!0)}else if(n.parentNode===t){i=hS(n);var x=0,S,C=X.parentNode!==t,w=!ow(X.animated&&X.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,E=gS(n,`top`,`top`)||gS(X,`top`,`top`),D=E?E.scrollTop:void 0;GC!==n&&(S=i[T],qC=!1,JC=!w&&o.invertSwap||C),x=US(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,JC,GC===n);var O;if(x!==0){var k=yS(X);do k-=x,O=SC.children[k];while(O&&(dS(O,`display`)===`none`||O===CC))}if(x===0||O===n)return _(!1);GC=n,KC=x;var ee=n.nextElementSibling,A=!1;A=x===1;var te=RS(wC,t,X,r,n,i,e,A);if(te!==!1)return(te===1||te===-1)&&(A=te===1),QC=!0,setTimeout(BS,30),g(),A&&!ee?t.appendChild(X):n.parentNode.insertBefore(X,A?ee:n),E&&DS(E,0,D-E.scrollTop),SC=X.parentNode,S!==void 0&&!JC&&(YC=Math.abs(S-hS(n)[T])),v(),_(!0)}if(t.contains(X))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){oS(document,`mousemove`,this._onTouchMove),oS(document,`touchmove`,this._onTouchMove),oS(document,`pointermove`,this._onTouchMove),oS(document,`dragover`,dw),oS(document,`mousemove`,dw),oS(document,`touchmove`,dw)},_offUpEvents:function(){var e=this.el.ownerDocument;oS(e,`mouseup`,this._onDrop),oS(e,`touchend`,this._onDrop),oS(e,`pointerup`,this._onDrop),oS(e,`touchcancel`,this._onDrop),oS(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(AC=yS(X),MC=yS(X,n.draggable),xC(`drop`,this,{evt:e}),SC=X&&X.parentNode,AC=yS(X),MC=yS(X,n.draggable),IS.eventCanceled){this._nulling();return}FC=!1,JC=!1,qC=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),JS(this.cloneId),JS(this._dragStartId),this.nativeDraggable&&(oS(document,`drop`,this),oS(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),uC&&dS(document.body,`user-select`,``),dS(X,`transform`,``),e&&(WC&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),CC&&CC.parentNode&&CC.parentNode.removeChild(CC),(wC===SC||PC&&PC.lastPutMode!==`clone`)&&DC&&DC.parentNode&&DC.parentNode.removeChild(DC),X&&(this.nativeDraggable&&oS(X,`dragend`,this),zS(X),X.style[`will-change`]=``,WC&&!FC&&uS(X,PC?PC.options.ghostClass:this.options.ghostClass,!1),uS(X,this.options.chosenClass,!1),FS({sortable:this,name:`unchoose`,toEl:SC,newIndex:null,newDraggableIndex:null,originalEvent:e}),wC===SC?AC!==kC&&AC>=0&&(FS({sortable:this,name:`update`,toEl:SC,originalEvent:e}),FS({sortable:this,name:`sort`,toEl:SC,originalEvent:e})):(AC>=0&&(FS({rootEl:SC,name:`add`,toEl:SC,fromEl:wC,originalEvent:e}),FS({sortable:this,name:`remove`,toEl:SC,originalEvent:e}),FS({rootEl:SC,name:`sort`,toEl:SC,fromEl:wC,originalEvent:e}),FS({sortable:this,name:`sort`,toEl:SC,originalEvent:e})),PC&&PC.save()),IS.active&&((AC==null||AC===-1)&&(AC=kC,MC=jC),FS({sortable:this,name:`end`,toEl:SC,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){xC(`nulling`,this),wC=X=SC=CC=TC=DC=EC=OC=RC=zC=WC=AC=MC=kC=jC=GC=KC=PC=NC=IS.dragged=IS.ghost=IS.clone=IS.active=null,$C.forEach(function(e){e.checked=!0}),$C.length=BC=VC=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:X&&(this._onDragOver(e),LS(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],lS(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||GS(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];lS(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return lS(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=yC.modifyOption(this,e,t);n[e]=r===void 0?t:r,e===`group`&&cw(n)},destroy:function(){xC(`destroy`,this);var e=this.el;e[gC]=null,oS(e,`mousedown`,this._onTapStart),oS(e,`touchstart`,this._onTapStart),oS(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(oS(e,`dragover`,this),oS(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),LC.splice(LC.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!OC){if(xC(`hideClone`,this),IS.eventCanceled)return;dS(DC,`display`,`none`),this.options.removeCloneOnHide&&DC.parentNode&&DC.parentNode.removeChild(DC),OC=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(OC){if(xC(`showClone`,this),IS.eventCanceled)return;X.parentNode==wC&&!this.options.group.revertClone?wC.insertBefore(DC,X):TC?wC.insertBefore(DC,TC):wC.appendChild(DC),this.options.group.revertClone&&this.animate(X,DC),dS(DC,`display`,``),OC=!1}}},ew&&aS(document,`touchmove`,function(e){(IS.active||FC)&&e.cancelable&&e.preventDefault()}),IS.utils={on:aS,off:oS,css:dS,find:pS,is:function(e,t){return!!lS(e,t,e,!1)},extend:CS,throttle:TS,closest:lS,toggleClass:uS,clone:OS,index:yS,nextTick:qS,cancelNextTick:JS,detectDirection:aw,getChild:_S},IS.get=function(e){return e[gC]},IS.mount=function(){var e=[...arguments];e[0].constructor===Array&&(e=e[0]),e.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(IS.utils=Kx(Kx({},IS.utils),e.utils)),yC.mount(e)})},IS.create=function(e,t){return new IS(e,t)},IS.version=oC,pw=[],gw=!1,xw=TS(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=mS(),l=!1,u;hw!==n&&(hw=n,XS(),mw=t.scroll,u=t.scrollFn,mw===!0&&(mw=SS(n,!0)));var d=0,f=mw;do{var p=f,m=hS(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=dS(p),E=p.scrollLeft,D=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var O=x&&(Math.abs(v-i)<=o&&E+y<C)-(Math.abs(_-i)<=o&&!!E),k=S&&(Math.abs(g-a)<=o&&D+b<w)-(Math.abs(h-a)<=o&&!!D);if(!pw[d])for(var ee=0;ee<=d;ee++)pw[ee]||(pw[ee]={});(pw[d].vx!=O||pw[d].vy!=k||pw[d].el!==p)&&(pw[d].el=p,pw[d].vx=O,pw[d].vy=k,clearInterval(pw[d].pid),(O!=0||k!=0)&&(l=!0,pw[d].pid=setInterval(function(){r&&this.layer===0&&IS.active._onTouchMove(yw);var t=pw[this.layer].vy?pw[this.layer].vy*s:0,n=pw[this.layer].vx?pw[this.layer].vx*s:0;(typeof u!=`function`||u.call(IS.dragged.parentNode[gC],n,t,e,yw,pw[this.layer].el)===`continue`)&&DS(pw[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=SS(f,!1)));gw=l}},30),Sw=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}},QS.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=_S(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Sw},Yx(QS,{pluginName:`revertOnSpill`}),$S.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Sw},Yx($S,{pluginName:`removeOnSpill`}),ww=[],Tw=[],Ow=!1,kw=!1,Aw=!1,IS.mount(new YS),IS.mount($S,QS)})),Fw=u(s(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(Ux(),(Pw(),d(Wx))):typeof define==`function`&&define.amd?define([,`sortablejs`],r):typeof e==`object`?e.vuedraggable=r(Ux(),(Pw(),d(Wx))):n.vuedraggable=r(n.Vue,n.Sortable)})(typeof self<`u`?self:e,function(e,t){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(t&1&&(e=n(e)),t&8||t&4&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),t&2&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=`fb15`)})({"00ee":(function(e,t,n){var r=n(`b622`)(`toStringTag`),i={};i[r]=`z`,e.exports=String(i)===`[object z]`}),"0366":(function(e,t,n){var r=n(`1c0b`);e.exports=function(e,t,n){if(r(e),t===void 0)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}}),"057f":(function(e,t,n){var r=n(`fc6a`),i=n(`241c`).f,a={}.toString,o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch{return o.slice()}};e.exports.f=function(e){return o&&a.call(e)==`[object Window]`?s(e):i(r(e))}}),"06cf":(function(e,t,n){var r=n(`83ab`),i=n(`d1e7`),a=n(`5c6c`),o=n(`fc6a`),s=n(`c04e`),c=n(`5135`),l=n(`0cfb`),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=o(e),t=s(t,!0),l)try{return u(e,t)}catch{}if(c(e,t))return a(!i.f.call(e,t),e[t])}}),"0cfb":(function(e,t,n){var r=n(`83ab`),i=n(`d039`),a=n(`cc12`);e.exports=!r&&!i(function(){return Object.defineProperty(a(`div`),"a",{get:function(){return 7}}).a!=7})}),"13d5":(function(e,t,n){var r=n(`23e7`),i=n(`d58f`).left,a=n(`a640`),o=n(`ae40`),s=a(`reduce`),c=o(`reduce`,{1:0});r({target:`Array`,proto:!0,forced:!s||!c},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})}),"14c3":(function(e,t,n){var r=n(`c6b6`),i=n(`9263`);e.exports=function(e,t){var n=e.exec;if(typeof n==`function`){var a=n.call(e,t);if(typeof a!=`object`)throw TypeError(`RegExp exec method returned something other than an Object or null`);return a}if(r(e)!==`RegExp`)throw TypeError(`RegExp#exec called on incompatible receiver`);return i.call(e,t)}}),"159b":(function(e,t,n){var r=n(`da84`),i=n(`fdbc`),a=n(`17c2`),o=n(`9112`);for(var s in i){var c=r[s],l=c&&c.prototype;if(l&&l.forEach!==a)try{o(l,`forEach`,a)}catch{l.forEach=a}}}),"17c2":(function(e,t,n){var r=n(`b727`).forEach,i=n(`a640`),a=n(`ae40`),o=i(`forEach`),s=a(`forEach`);e.exports=!o||!s?function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}:[].forEach}),"1be4":(function(e,t,n){e.exports=n(`d066`)(`document`,`documentElement`)}),"1c0b":(function(e,t){e.exports=function(e){if(typeof e!=`function`)throw TypeError(String(e)+` is not a function`);return e}}),"1c7e":(function(e,t,n){var r=n(`b622`)(`iterator`),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,function(){throw 2})}catch{}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch{}return n}}),"1d80":(function(e,t){e.exports=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e}}),"1dde":(function(e,t,n){var r=n(`d039`),i=n(`b622`),a=n(`2d00`),o=i(`species`);e.exports=function(e){return a>=51||!r(function(){var t=[],n=t.constructor={};return n[o]=function(){return{foo:1}},t[e](Boolean).foo!==1})}}),"23cb":(function(e,t,n){var r=n(`a691`),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}}),"23e7":(function(e,t,n){var r=n(`da84`),i=n(`06cf`).f,a=n(`9112`),o=n(`6eeb`),s=n(`ce4e`),c=n(`e893`),l=n(`94ca`);e.exports=function(e,t){var n=e.target,u=e.global,d=e.stat,f,p=u?r:d?r[n]||s(n,{}):(r[n]||{}).prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.noTargetGet?(_=i(p,m),h=_&&_.value):h=p[m],f=l(u?m:n+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;c(g,h)}(e.sham||h&&h.sham)&&a(g,`sham`,!0),o(p,m,g,e)}}}),"241c":(function(e,t,n){var r=n(`ca84`),i=n(`7839`).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}}),"25f0":(function(e,t,n){var r=n(`6eeb`),i=n(`825a`),a=n(`d039`),o=n(`ad6d`),s=`toString`,c=RegExp.prototype,l=c[s],u=a(function(){return l.call({source:`a`,flags:`b`})!=`/a/b`}),d=l.name!=s;(u||d)&&r(RegExp.prototype,s,function(){var e=i(this),t=String(e.source),n=e.flags,r=String(n===void 0&&e instanceof RegExp&&!(`flags`in c)?o.call(e):n);return`/`+t+`/`+r},{unsafe:!0})}),"2ca0":(function(e,t,n){var r=n(`23e7`),i=n(`06cf`).f,a=n(`50c4`),o=n(`5a34`),s=n(`1d80`),c=n(`ab13`),l=n(`c430`),u=``.startsWith,d=Math.min,f=c(`startsWith`);r({target:`String`,proto:!0,forced:!(!l&&!f&&function(){var e=i(String.prototype,`startsWith`);return e&&!e.writable}())&&!f},{startsWith:function(e){var t=String(s(this));o(e);var n=a(d(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return u?u.call(t,r,n):t.slice(n,n+r.length)===r}})}),"2d00":(function(e,t,n){var r=n(`da84`),i=n(`342f`),a=r.process,o=a&&a.versions,s=o&&o.v8,c,l;s?(c=s.split(`.`),l=c[0]+c[1]):i&&(c=i.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=i.match(/Chrome\/(\d+)/),c&&(l=c[1]))),e.exports=l&&+l}),"342f":(function(e,t,n){e.exports=n(`d066`)(`navigator`,`userAgent`)||``}),"35a1":(function(e,t,n){var r=n(`f5df`),i=n(`3f8c`),a=n(`b622`)(`iterator`);e.exports=function(e){if(e!=null)return e[a]||e[`@@iterator`]||i[r(e)]}}),"37e8":(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`),a=n(`825a`),o=n(`df75`);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n=o(t),r=n.length,s=0,c;r>s;)i.f(e,c=n[s++],t[c]);return e}}),"3bbe":(function(e,t,n){var r=n(`861d`);e.exports=function(e){if(!r(e)&&e!==null)throw TypeError(`Can't set `+String(e)+` as a prototype`);return e}}),"3ca3":(function(e,t,n){var r=n(`6547`).charAt,i=n(`69f3`),a=n(`7dd0`),o=`String Iterator`,s=i.set,c=i.getterFor(o);a(String,`String`,function(e){s(this,{type:o,string:String(e),index:0})},function(){var e=c(this),t=e.string,n=e.index,i;return n>=t.length?{value:void 0,done:!0}:(i=r(t,n),e.index+=i.length,{value:i,done:!1})})}),"3f8c":(function(e,t){e.exports={}}),4160:(function(e,t,n){var r=n(`23e7`),i=n(`17c2`);r({target:`Array`,proto:!0,forced:[].forEach!=i},{forEach:i})}),"428f":(function(e,t,n){e.exports=n(`da84`)}),"44ad":(function(e,t,n){var r=n(`d039`),i=n(`c6b6`),a=``.split;e.exports=r(function(){return!Object(`z`).propertyIsEnumerable(0)})?function(e){return i(e)==`String`?a.call(e,``):Object(e)}:Object}),"44d2":(function(e,t,n){var r=n(`b622`),i=n(`7c73`),a=n(`9bf2`),o=r(`unscopables`),s=Array.prototype;s[o]??a.f(s,o,{configurable:!0,value:i(null)}),e.exports=function(e){s[o][e]=!0}}),"44e7":(function(e,t,n){var r=n(`861d`),i=n(`c6b6`),a=n(`b622`)(`match`);e.exports=function(e){var t;return r(e)&&((t=e[a])===void 0?i(e)==`RegExp`:!!t)}}),4930:(function(e,t,n){var r=n(`d039`);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!String(Symbol())})}),"4d64":(function(e,t,n){var r=n(`fc6a`),i=n(`50c4`),a=n(`23cb`),o=function(e){return function(t,n,o){var s=r(t),c=i(s.length),l=a(o,c),u;if(e&&n!=n){for(;c>l;)if(u=s[l++],u!=u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}}),"4de4":(function(e,t,n){var r=n(`23e7`),i=n(`b727`).filter,a=n(`1dde`),o=n(`ae40`),s=a(`filter`),c=o(`filter`);r({target:`Array`,proto:!0,forced:!s||!c},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})}),"4df4":(function(e,t,n){var r=n(`0366`),i=n(`7b0b`),a=n(`9bdd`),o=n(`e95a`),s=n(`50c4`),c=n(`8418`),l=n(`35a1`);e.exports=function(e){var t=i(e),n=typeof this==`function`?this:Array,u=arguments.length,d=u>1?arguments[1]:void 0,f=d!==void 0,p=l(t),m=0,h,g,_,v,y,b;if(f&&(d=r(d,u>2?arguments[2]:void 0,2)),p!=null&&!(n==Array&&o(p)))for(v=p.call(t),y=v.next,g=new n;!(_=y.call(v)).done;m++)b=f?a(v,d,[_.value,m],!0):_.value,c(g,m,b);else for(h=s(t.length),g=new n(h);h>m;m++)b=f?d(t[m],m):t[m],c(g,m,b);return g.length=m,g}}),"4fad":(function(e,t,n){var r=n(`23e7`),i=n(`6f53`).entries;r({target:`Object`,stat:!0},{entries:function(e){return i(e)}})}),"50c4":(function(e,t,n){var r=n(`a691`),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}}),5135:(function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}}),5319:(function(e,t,n){var r=n(`d784`),i=n(`825a`),a=n(`7b0b`),o=n(`50c4`),s=n(`a691`),c=n(`1d80`),l=n(`8aa5`),u=n(`14c3`),d=Math.max,f=Math.min,p=Math.floor,m=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g,g=function(e){return e===void 0?e:String(e)};r(`replace`,2,function(e,t,n,r){var _=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,v=r.REPLACE_KEEPS_$0,y=_?`$`:`$0`;return[function(n,r){var i=c(this),a=n?.[e];return a===void 0?t.call(String(i),n,r):a.call(n,i,r)},function(e,r){if(!_&&v||typeof r==`string`&&r.indexOf(y)===-1){var a=n(t,e,this,r);if(a.done)return a.value}var c=i(e),p=String(this),m=typeof r==`function`;m||(r=String(r));var h=c.global;if(h){var x=c.unicode;c.lastIndex=0}for(var S=[];;){var C=u(c,p);if(C===null||(S.push(C),!h))break;String(C[0])===``&&(c.lastIndex=l(p,o(c.lastIndex),x))}for(var w=``,T=0,E=0;E<S.length;E++){C=S[E];for(var D=String(C[0]),O=d(f(s(C.index),p.length),0),k=[],ee=1;ee<C.length;ee++)k.push(g(C[ee]));var A=C.groups;if(m){var te=[D].concat(k,O,p);A!==void 0&&te.push(A);var ne=String(r.apply(void 0,te))}else ne=b(D,p,O,k,A,r);O>=T&&(w+=p.slice(T,O)+ne,T=O+D.length)}return w+p.slice(T)}];function b(e,n,r,i,o,s){var c=r+e.length,l=i.length,u=h;return o!==void 0&&(o=a(o),u=m),t.call(s,u,function(t,a){var s;switch(a.charAt(0)){case`$`:return`$`;case`&`:return e;case"`":return n.slice(0,r);case`'`:return n.slice(c);case`<`:s=o[a.slice(1,-1)];break;default:var u=+a;if(u===0)return t;if(u>l){var d=p(u/10);return d===0?t:d<=l?i[d-1]===void 0?a.charAt(1):i[d-1]+a.charAt(1):t}s=i[u-1]}return s===void 0?``:s})}})}),5692:(function(e,t,n){var r=n(`c430`),i=n(`c6cd`);(e.exports=function(e,t){return i[e]||(i[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.6.5`,mode:r?`pure`:`global`,copyright:`© 2020 Denis Pushkarev (zloirock.ru)`})}),"56ef":(function(e,t,n){var r=n(`d066`),i=n(`241c`),a=n(`7418`),o=n(`825a`);e.exports=r(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}}),"5a34":(function(e,t,n){var r=n(`44e7`);e.exports=function(e){if(r(e))throw TypeError(`The method doesn't accept regular expressions`);return e}}),"5c6c":(function(e,t){e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}}),"5db7":(function(e,t,n){var r=n(`23e7`),i=n(`a2bf`),a=n(`7b0b`),o=n(`50c4`),s=n(`1c0b`),c=n(`65f0`);r({target:`Array`,proto:!0},{flatMap:function(e){var t=a(this),n=o(t.length),r;return s(e),r=c(t,0),r.length=i(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}})}),6547:(function(e,t,n){var r=n(`a691`),i=n(`1d80`),a=function(e){return function(t,n){var a=String(i(t)),o=r(n),s=a.length,c,l;return o<0||o>=s?e?``:void 0:(c=a.charCodeAt(o),c<55296||c>56319||o+1===s||(l=a.charCodeAt(o+1))<56320||l>57343?e?a.charAt(o):c:e?a.slice(o,o+2):(c-55296<<10)+(l-56320)+65536)}};e.exports={codeAt:a(!1),charAt:a(!0)}}),"65f0":(function(e,t,n){var r=n(`861d`),i=n(`e8b5`),a=n(`b622`)(`species`);e.exports=function(e,t){var n;return i(e)&&(n=e.constructor,typeof n==`function`&&(n===Array||i(n.prototype))?n=void 0:r(n)&&(n=n[a],n===null&&(n=void 0))),new(n===void 0?Array:n)(t===0?0:t)}}),"69f3":(function(e,t,n){var r=n(`7f9a`),i=n(`da84`),a=n(`861d`),o=n(`9112`),s=n(`5135`),c=n(`f772`),l=n(`d012`),u=i.WeakMap,d,f,p,m=function(e){return p(e)?f(e):d(e,{})},h=function(e){return function(t){var n;if(!a(t)||(n=f(t)).type!==e)throw TypeError(`Incompatible receiver, `+e+` required`);return n}};if(r){var g=new u,_=g.get,v=g.has,y=g.set;d=function(e,t){return y.call(g,e,t),t},f=function(e){return _.call(g,e)||{}},p=function(e){return v.call(g,e)}}else{var b=c(`state`);l[b]=!0,d=function(e,t){return o(e,b,t),t},f=function(e){return s(e,b)?e[b]:{}},p=function(e){return s(e,b)}}e.exports={set:d,get:f,has:p,enforce:m,getterFor:h}}),"6eeb":(function(e,t,n){var r=n(`da84`),i=n(`9112`),a=n(`5135`),o=n(`ce4e`),s=n(`8925`),c=n(`69f3`),l=c.get,u=c.enforce,d=String(String).split(`String`);(e.exports=function(e,t,n,s){var c=s?!!s.unsafe:!1,l=s?!!s.enumerable:!1,f=s?!!s.noTargetGet:!1;if(typeof n==`function`&&(typeof t==`string`&&!a(n,`name`)&&i(n,`name`,t),u(n).source=d.join(typeof t==`string`?t:``)),e===r){l?e[t]=n:o(t,n);return}c?!f&&e[t]&&(l=!0):delete e[t],l?e[t]=n:i(e,t,n)})(Function.prototype,`toString`,function(){return typeof this==`function`&&l(this).source||s(this)})}),"6f53":(function(e,t,n){var r=n(`83ab`),i=n(`df75`),a=n(`fc6a`),o=n(`d1e7`).f,s=function(e){return function(t){for(var n=a(t),s=i(n),c=s.length,l=0,u=[],d;c>l;)d=s[l++],(!r||o.call(n,d))&&u.push(e?[d,n[d]]:n[d]);return u}};e.exports={entries:s(!0),values:s(!1)}}),"73d9":(function(e,t,n){n(`44d2`)(`flatMap`)}),7418:(function(e,t){t.f=Object.getOwnPropertySymbols}),"746f":(function(e,t,n){var r=n(`428f`),i=n(`5135`),a=n(`e538`),o=n(`9bf2`).f;e.exports=function(e){var t=r.Symbol||={};i(t,e)||o(t,e,{value:a.f(e)})}}),7839:(function(e,t){e.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]}),"7b0b":(function(e,t,n){var r=n(`1d80`);e.exports=function(e){return Object(r(e))}}),"7c73":(function(e,t,n){var r=n(`825a`),i=n(`37e8`),a=n(`7839`),o=n(`d012`),s=n(`1be4`),c=n(`cc12`),l=n(`f772`),u=`>`,d=`<`,f=`prototype`,p=`script`,m=l(`IE_PROTO`),h=function(){},g=function(e){return d+p+u+e+d+`/`+p+u},_=function(e){e.write(g(``)),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e=c(`iframe`),t=`java`+p+`:`,n;return e.style.display=`none`,s.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(g(`document.F=Object`)),n.close(),n.F},y,b=function(){try{y=document.domain&&new ActiveXObject(`htmlfile`)}catch{}b=y?_(y):v();for(var e=a.length;e--;)delete b[f][a[e]];return b()};o[m]=!0,e.exports=Object.create||function(e,t){var n;return e===null?n=b():(h[f]=r(e),n=new h,h[f]=null,n[m]=e),t===void 0?n:i(n,t)}}),"7dd0":(function(e,t,n){var r=n(`23e7`),i=n(`9ed3`),a=n(`e163`),o=n(`d2bb`),s=n(`d44e`),c=n(`9112`),l=n(`6eeb`),u=n(`b622`),d=n(`c430`),f=n(`3f8c`),p=n(`ae93`),m=p.IteratorPrototype,h=p.BUGGY_SAFARI_ITERATORS,g=u(`iterator`),_=`keys`,v=`values`,y=`entries`,b=function(){return this};e.exports=function(e,t,n,u,p,x,S){i(n,t,u);var C=function(e){if(e===p&&O)return O;if(!h&&e in E)return E[e];switch(e){case _:return function(){return new n(this,e)};case v:return function(){return new n(this,e)};case y:return function(){return new n(this,e)}}return function(){return new n(this)}},w=t+` Iterator`,T=!1,E=e.prototype,D=E[g]||E[`@@iterator`]||p&&E[p],O=!h&&D||C(p),k=t==`Array`&&E.entries||D,ee,A,te;if(k&&(ee=a(k.call(new e)),m!==Object.prototype&&ee.next&&(!d&&a(ee)!==m&&(o?o(ee,m):typeof ee[g]!=`function`&&c(ee,g,b)),s(ee,w,!0,!0),d&&(f[w]=b))),p==v&&D&&D.name!==v&&(T=!0,O=function(){return D.call(this)}),(!d||S)&&E[g]!==O&&c(E,g,O),f[t]=O,p){if(A={values:C(v),keys:x?O:C(_),entries:C(y)},S)for(te in A)(h||T||!(te in E))&&l(E,te,A[te]);else r({target:t,proto:!0,forced:h||T},A)}return A}}),"7f9a":(function(e,t,n){var r=n(`da84`),i=n(`8925`),a=r.WeakMap;e.exports=typeof a==`function`&&/native code/.test(i(a))}),"825a":(function(e,t,n){var r=n(`861d`);e.exports=function(e){if(!r(e))throw TypeError(String(e)+` is not an object`);return e}}),"83ab":(function(e,t,n){e.exports=!n(`d039`)(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),8418:(function(e,t,n){var r=n(`c04e`),i=n(`9bf2`),a=n(`5c6c`);e.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}}),"861d":(function(e,t){e.exports=function(e){return typeof e==`object`?e!==null:typeof e==`function`}}),8875:(function(e,t,n){var r,i,a;(function(n,o){i=[],r=o,a=typeof r==`function`?r.apply(t,i):r,a!==void 0&&(e.exports=a)})(typeof self<`u`?self:this,function(){function e(){var t=Object.getOwnPropertyDescriptor(document,`currentScript`);if(!t&&`currentScript`in document&&document.currentScript||t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw Error()}catch(e){var n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e.stack)||/@([^@]*):(\d+):(\d+)\s*$/gi.exec(e.stack),r=n&&n[1]||!1,i=n&&n[2]||!1,a=document.location.href.replace(document.location.hash,``),o,s,c,l=document.getElementsByTagName(`script`);r===a&&(o=document.documentElement.outerHTML,s=RegExp(`(?:[^\\n]+?\\n){0,`+(i-2)+`}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*`,`i`),c=o.replace(s,`$1`).trim());for(var u=0;u<l.length;u++)if(l[u].readyState===`interactive`||l[u].src===r||r===a&&l[u].innerHTML&&l[u].innerHTML.trim()===c)return l[u];return null}}return e})}),8925:(function(e,t,n){var r=n(`c6cd`),i=Function.toString;typeof r.inspectSource!=`function`&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource}),"8aa5":(function(e,t,n){var r=n(`6547`).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}}),"8bbf":(function(t,n){t.exports=e}),"90e3":(function(e,t){var n=0,r=Math.random();e.exports=function(e){return`Symbol(`+String(e===void 0?``:e)+`)_`+(++n+r).toString(36)}}),9112:(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`),a=n(`5c6c`);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}}),9263:(function(e,t,n){var r=n(`ad6d`),i=n(`9f7f`),a=RegExp.prototype.exec,o=String.prototype.replace,s=a,c=(function(){var e=/a/,t=/b*/g;return a.call(e,`a`),a.call(t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),l=i.UNSUPPORTED_Y||i.BROKEN_CARET,u=/()??/.exec(``)[1]!==void 0;(c||u||l)&&(s=function(e){var t=this,n,i,s,d,f=l&&t.sticky,p=r.call(t),m=t.source,h=0,g=e;return f&&(p=p.replace(`y`,``),p.indexOf(`g`)===-1&&(p+=`g`),g=String(e).slice(t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&e[t.lastIndex-1]!==`
15
15
  `)&&(m=`(?: `+m+`)`,g=` `+g,h++),i=RegExp(`^(?:`+m+`)`,p)),u&&(i=RegExp(`^`+m+`$(?!\\s)`,p)),c&&(n=t.lastIndex),s=a.call(f?i:t,g),f?s?(s.input=s.input.slice(h),s[0]=s[0].slice(h),s.index=t.lastIndex,t.lastIndex+=s[0].length):t.lastIndex=0:c&&s&&(t.lastIndex=t.global?s.index+s[0].length:n),u&&s&&s.length>1&&o.call(s[0],i,function(){for(d=1;d<arguments.length-2;d++)arguments[d]===void 0&&(s[d]=void 0)}),s}),e.exports=s}),"94ca":(function(e,t,n){var r=n(`d039`),i=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==l?!0:n==c?!1:typeof t==`function`?r(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;e.exports=a}),"99af":(function(e,t,n){var r=n(`23e7`),i=n(`d039`),a=n(`e8b5`),o=n(`861d`),s=n(`7b0b`),c=n(`50c4`),l=n(`8418`),u=n(`65f0`),d=n(`1dde`),f=n(`b622`),p=n(`2d00`),m=f(`isConcatSpreadable`),h=9007199254740991,g=`Maximum allowed index exceeded`,_=p>=51||!i(function(){var e=[];return e[m]=!1,e.concat()[0]!==e}),v=d(`concat`),y=function(e){if(!o(e))return!1;var t=e[m];return t===void 0?a(e):!!t};r({target:`Array`,proto:!0,forced:!_||!v},{concat:function(e){var t=s(this),n=u(t,0),r=0,i,a,o,d,f;for(i=-1,o=arguments.length;i<o;i++)if(f=i===-1?t:arguments[i],y(f)){if(d=c(f.length),r+d>h)throw TypeError(g);for(a=0;a<d;a++,r++)a in f&&l(n,r,f[a])}else{if(r>=h)throw TypeError(g);l(n,r++,f)}return n.length=r,n}})}),"9bdd":(function(e,t,n){var r=n(`825a`);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw a!==void 0&&r(a.call(e)),t}}}),"9bf2":(function(e,t,n){var r=n(`83ab`),i=n(`0cfb`),a=n(`825a`),o=n(`c04e`),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),i)try{return s(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e}}),"9ed3":(function(e,t,n){var r=n(`ae93`).IteratorPrototype,i=n(`7c73`),a=n(`5c6c`),o=n(`d44e`),s=n(`3f8c`),c=function(){return this};e.exports=function(e,t,n){var l=t+` Iterator`;return e.prototype=i(r,{next:a(1,n)}),o(e,l,!1,!0),s[l]=c,e}}),"9f7f":(function(e,t,n){var r=n(`d039`);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r(function(){var e=i(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!=null}),t.BROKEN_CARET=r(function(){var e=i(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!=null})}),a2bf:(function(e,t,n){var r=n(`e8b5`),i=n(`50c4`),a=n(`0366`),o=function(e,t,n,s,c,l,u,d){for(var f=c,p=0,m=u?a(u,d,3):!1,h;p<s;){if(p in n){if(h=m?m(n[p],p,t):n[p],l>0&&r(h))f=o(e,t,h,i(h.length),f,l-1)-1;else{if(f>=9007199254740991)throw TypeError(`Exceed the acceptable array length`);e[f]=h}f++}p++}return f};e.exports=o}),a352:(function(e,n){e.exports=t}),a434:(function(e,t,n){var r=n(`23e7`),i=n(`23cb`),a=n(`a691`),o=n(`50c4`),s=n(`7b0b`),c=n(`65f0`),l=n(`8418`),u=n(`1dde`),d=n(`ae40`),f=u(`splice`),p=d(`splice`,{ACCESSORS:!0,0:0,1:2}),m=Math.max,h=Math.min,g=9007199254740991,_=`Maximum allowed length exceeded`;r({target:`Array`,proto:!0,forced:!f||!p},{splice:function(e,t){var n=s(this),r=o(n.length),u=i(e,r),d=arguments.length,f,p,v,y,b,x;if(d===0?f=p=0:d===1?(f=0,p=r-u):(f=d-2,p=h(m(a(t),0),r-u)),r+f-p>g)throw TypeError(_);for(v=c(n,p),y=0;y<p;y++)b=u+y,b in n&&l(v,y,n[b]);if(v.length=p,f<p){for(y=u;y<r-p;y++)b=y+p,x=y+f,b in n?n[x]=n[b]:delete n[x];for(y=r;y>r-p+f;y--)delete n[y-1]}else if(f>p)for(y=r-p;y>u;y--)b=y+p-1,x=y+f-1,b in n?n[x]=n[b]:delete n[x];for(y=0;y<f;y++)n[y+u]=arguments[y+2];return n.length=r-p+f,v}})}),a4d3:(function(e,t,n){var r=n(`23e7`),i=n(`da84`),a=n(`d066`),o=n(`c430`),s=n(`83ab`),c=n(`4930`),l=n(`fdbf`),u=n(`d039`),d=n(`5135`),f=n(`e8b5`),p=n(`861d`),m=n(`825a`),h=n(`7b0b`),g=n(`fc6a`),_=n(`c04e`),v=n(`5c6c`),y=n(`7c73`),b=n(`df75`),x=n(`241c`),S=n(`057f`),C=n(`7418`),w=n(`06cf`),T=n(`9bf2`),E=n(`d1e7`),D=n(`9112`),O=n(`6eeb`),k=n(`5692`),ee=n(`f772`),A=n(`d012`),te=n(`90e3`),ne=n(`b622`),re=n(`e538`),ie=n(`746f`),j=n(`d44e`),ae=n(`69f3`),oe=n(`b727`).forEach,se=ee(`hidden`),ce=`Symbol`,le=`prototype`,M=ne(`toPrimitive`),ue=ae.set,de=ae.getterFor(ce),N=Object[le],P=i.Symbol,fe=a(`JSON`,`stringify`),pe=w.f,me=T.f,he=S.f,F=E.f,I=k(`symbols`),ge=k(`op-symbols`),_e=k(`string-to-symbol-registry`),ve=k(`symbol-to-string-registry`),ye=k(`wks`),be=i.QObject,xe=!be||!be[le]||!be[le].findChild,Se=s&&u(function(){return y(me({},`a`,{get:function(){return me(this,`a`,{value:7}).a}})).a!=7})?function(e,t,n){var r=pe(N,t);r&&delete N[t],me(e,t,n),r&&e!==N&&me(N,t,r)}:me,Ce=function(e,t){var n=I[e]=y(P[le]);return ue(n,{type:ce,tag:e,description:t}),s||(n.description=t),n},we=l?function(e){return typeof e==`symbol`}:function(e){return Object(e)instanceof P},Te=function(e,t,n){e===N&&Te(ge,t,n),m(e);var r=_(t,!0);return m(n),d(I,r)?(n.enumerable?(d(e,se)&&e[se][r]&&(e[se][r]=!1),n=y(n,{enumerable:v(0,!1)})):(d(e,se)||me(e,se,v(1,{})),e[se][r]=!0),Se(e,r,n)):me(e,r,n)},Ee=function(e,t){m(e);var n=g(t);return oe(b(n).concat(je(n)),function(t){(!s||Oe.call(n,t))&&Te(e,t,n[t])}),e},De=function(e,t){return t===void 0?y(e):Ee(y(e),t)},Oe=function(e){var t=_(e,!0),n=F.call(this,t);return this===N&&d(I,t)&&!d(ge,t)?!1:n||!d(this,t)||!d(I,t)||d(this,se)&&this[se][t]?n:!0},ke=function(e,t){var n=g(e),r=_(t,!0);if(!(n===N&&d(I,r)&&!d(ge,r))){var i=pe(n,r);return i&&d(I,r)&&!(d(n,se)&&n[se][r])&&(i.enumerable=!0),i}},Ae=function(e){var t=he(g(e)),n=[];return oe(t,function(e){!d(I,e)&&!d(A,e)&&n.push(e)}),n},je=function(e){var t=e===N,n=he(t?ge:g(e)),r=[];return oe(n,function(e){d(I,e)&&(!t||d(N,e))&&r.push(I[e])}),r};c||(P=function(){if(this instanceof P)throw TypeError(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:String(arguments[0]),t=te(e),n=function(e){this===N&&n.call(ge,e),d(this,se)&&d(this[se],t)&&(this[se][t]=!1),Se(this,t,v(1,e))};return s&&xe&&Se(N,t,{configurable:!0,set:n}),Ce(t,e)},O(P[le],`toString`,function(){return de(this).tag}),O(P,`withoutSetter`,function(e){return Ce(te(e),e)}),E.f=Oe,T.f=Te,w.f=ke,x.f=S.f=Ae,C.f=je,re.f=function(e){return Ce(ne(e),e)},s&&(me(P[le],`description`,{configurable:!0,get:function(){return de(this).description}}),o||O(N,`propertyIsEnumerable`,Oe,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:P}),oe(b(ye),function(e){ie(e)}),r({target:ce,stat:!0,forced:!c},{for:function(e){var t=String(e);if(d(_e,t))return _e[t];var n=P(t);return _e[t]=n,ve[n]=t,n},keyFor:function(e){if(!we(e))throw TypeError(e+` is not a symbol`);if(d(ve,e))return ve[e]},useSetter:function(){xe=!0},useSimple:function(){xe=!1}}),r({target:`Object`,stat:!0,forced:!c,sham:!s},{create:De,defineProperty:Te,defineProperties:Ee,getOwnPropertyDescriptor:ke}),r({target:`Object`,stat:!0,forced:!c},{getOwnPropertyNames:Ae,getOwnPropertySymbols:je}),r({target:`Object`,stat:!0,forced:u(function(){C.f(1)})},{getOwnPropertySymbols:function(e){return C.f(h(e))}}),fe&&r({target:`JSON`,stat:!0,forced:!c||u(function(){var e=P();return fe([e])!=`[null]`||fe({a:e})!=`{}`||fe(Object(e))!=`{}`})},{stringify:function(e,t,n){for(var r=[e],i=1,a;arguments.length>i;)r.push(arguments[i++]);if(a=t,!(!p(t)&&e===void 0||we(e)))return f(t)||(t=function(e,t){if(typeof a==`function`&&(t=a.call(this,e,t)),!we(t))return t}),r[1]=t,fe.apply(null,r)}}),P[le][M]||D(P[le],M,P[le].valueOf),j(P,ce),A[se]=!0}),a630:(function(e,t,n){var r=n(`23e7`),i=n(`4df4`);r({target:`Array`,stat:!0,forced:!n(`1c7e`)(function(e){Array.from(e)})},{from:i})}),a640:(function(e,t,n){var r=n(`d039`);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}}),a691:(function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}}),ab13:(function(e,t,n){var r=n(`b622`)(`match`);e.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[r]=!1,`/./`[e](t)}catch{}}return!1}}),ac1f:(function(e,t,n){var r=n(`23e7`),i=n(`9263`);r({target:`RegExp`,proto:!0,forced:/./.exec!==i},{exec:i})}),ad6d:(function(e,t,n){var r=n(`825a`);e.exports=function(){var e=r(this),t=``;return e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.sticky&&(t+=`y`),t}}),ae40:(function(e,t,n){var r=n(`83ab`),i=n(`d039`),a=n(`5135`),o=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(a(s,e))return s[e];t||={};var n=[][e],l=a(t,`ACCESSORS`)?t.ACCESSORS:!1,u=a(t,0)?t[0]:c,d=a(t,1)?t[1]:void 0;return s[e]=!!n&&!i(function(){if(l&&!r)return!0;var e={length:-1};l?o(e,1,{enumerable:!0,get:c}):e[1]=1,n.call(e,u,d)})}}),ae93:(function(e,t,n){var r=n(`e163`),i=n(`9112`),a=n(`5135`),o=n(`b622`),s=n(`c430`),c=o(`iterator`),l=!1,u=function(){return this},d,f,p;[].keys&&(p=[].keys(),`next`in p?(f=r(r(p)),f!==Object.prototype&&(d=f)):l=!0),d??={},!s&&!a(d,c)&&i(d,c,u),e.exports={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:l}}),b041:(function(e,t,n){var r=n(`00ee`),i=n(`f5df`);e.exports=r?{}.toString:function(){return`[object `+i(this)+`]`}}),b0c0:(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`).f,a=Function.prototype,o=a.toString,s=/^\s*function ([^ (]*)/,c=`name`;r&&!(c in a)&&i(a,c,{configurable:!0,get:function(){try{return o.call(this).match(s)[1]}catch{return``}}})}),b622:(function(e,t,n){var r=n(`da84`),i=n(`5692`),a=n(`5135`),o=n(`90e3`),s=n(`4930`),c=n(`fdbf`),l=i(`wks`),u=r.Symbol,d=c?u:u&&u.withoutSetter||o;e.exports=function(e){return a(l,e)||(l[e]=s&&a(u,e)?u[e]:d(`Symbol.`+e)),l[e]}}),b64b:(function(e,t,n){var r=n(`23e7`),i=n(`7b0b`),a=n(`df75`);r({target:`Object`,stat:!0,forced:n(`d039`)(function(){a(1)})},{keys:function(e){return a(i(e))}})}),b727:(function(e,t,n){var r=n(`0366`),i=n(`44ad`),a=n(`7b0b`),o=n(`50c4`),s=n(`65f0`),c=[].push,l=function(e){var t=e==1,n=e==2,l=e==3,u=e==4,d=e==6,f=e==5||d;return function(p,m,h,g){for(var _=a(p),v=i(_),y=r(m,h,3),b=o(v.length),x=0,S=g||s,C=t?S(p,b):n?S(p,0):void 0,w,T;b>x;x++)if((f||x in v)&&(w=v[x],T=y(w,x,_),e)){if(t)C[x]=T;else if(T)switch(e){case 3:return!0;case 5:return w;case 6:return x;case 2:c.call(C,w)}else if(u)return!1}return d?-1:l||u?u:C}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}}),c04e:(function(e,t,n){var r=n(`861d`);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)}}),c430:(function(e,t){e.exports=!1}),c6b6:(function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}}),c6cd:(function(e,t,n){var r=n(`da84`),i=n(`ce4e`),a=`__core-js_shared__`;e.exports=r[a]||i(a,{})}),c740:(function(e,t,n){var r=n(`23e7`),i=n(`b727`).findIndex,a=n(`44d2`),o=n(`ae40`),s=`findIndex`,c=!0,l=o(s);s in[]&&[,][s](function(){c=!1}),r({target:`Array`,proto:!0,forced:c||!l},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(s)}),c8ba:(function(e,t){var n=(function(){return this})();try{n||=Function(`return this`)()}catch{typeof window==`object`&&(n=window)}e.exports=n}),c975:(function(e,t,n){var r=n(`23e7`),i=n(`4d64`).indexOf,a=n(`a640`),o=n(`ae40`),s=[].indexOf,c=!!s&&1/[1].indexOf(1,-0)<0,l=a(`indexOf`),u=o(`indexOf`,{ACCESSORS:!0,1:0});r({target:`Array`,proto:!0,forced:c||!l||!u},{indexOf:function(e){return c?s.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})}),ca84:(function(e,t,n){var r=n(`5135`),i=n(`fc6a`),a=n(`4d64`).indexOf,o=n(`d012`);e.exports=function(e,t){var n=i(e),s=0,c=[],l;for(l in n)!r(o,l)&&r(n,l)&&c.push(l);for(;t.length>s;)r(n,l=t[s++])&&(~a(c,l)||c.push(l));return c}}),caad:(function(e,t,n){var r=n(`23e7`),i=n(`4d64`).includes,a=n(`44d2`);r({target:`Array`,proto:!0,forced:!n(`ae40`)(`indexOf`,{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(`includes`)}),cc12:(function(e,t,n){var r=n(`da84`),i=n(`861d`),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}}),ce4e:(function(e,t,n){var r=n(`da84`),i=n(`9112`);e.exports=function(e,t){try{i(r,e,t)}catch{r[e]=t}return t}}),d012:(function(e,t){e.exports={}}),d039:(function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}}),d066:(function(e,t,n){var r=n(`428f`),i=n(`da84`),a=function(e){return typeof e==`function`?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}}),d1e7:(function(e,t,n){var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor;t.f=i&&!r.call({1:2},1)?function(e){var t=i(this,e);return!!t&&t.enumerable}:r}),d28b:(function(e,t,n){n(`746f`)(`iterator`)}),d2bb:(function(e,t,n){var r=n(`825a`),i=n(`3bbe`);e.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,`__proto__`).set,n.call(t,[]),e=t instanceof Array}catch{}return function(t,a){return r(t),i(a),e?n.call(t,a):t.__proto__=a,t}}():void 0)}),d3b7:(function(e,t,n){var r=n(`00ee`),i=n(`6eeb`),a=n(`b041`);r||i(Object.prototype,`toString`,a,{unsafe:!0})}),d44e:(function(e,t,n){var r=n(`9bf2`).f,i=n(`5135`),a=n(`b622`)(`toStringTag`);e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}}),d58f:(function(e,t,n){var r=n(`1c0b`),i=n(`7b0b`),a=n(`44ad`),o=n(`50c4`),s=function(e){return function(t,n,s,c){r(n);var l=i(t),u=a(l),d=o(l.length),f=e?d-1:0,p=e?-1:1;if(s<2)for(;;){if(f in u){c=u[f],f+=p;break}if(f+=p,e?f<0:d<=f)throw TypeError(`Reduce of empty array with no initial value`)}for(;e?f>=0:d>f;f+=p)f in u&&(c=n(c,u[f],f,l));return c}};e.exports={left:s(!1),right:s(!0)}}),d784:(function(e,t,n){n(`ac1f`);var r=n(`6eeb`),i=n(`d039`),a=n(`b622`),o=n(`9263`),s=n(`9112`),c=a(`species`),l=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$<a>`)!==`7`}),u=(function(){return`a`.replace(/./,`$0`)===`$0`})(),d=a(`replace`),f=(function(){return/./[d]?/./[d](`a`,`$0`)===``:!1})(),p=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n=`ab`.split(e);return n.length!==2||n[0]!==`a`||n[1]!==`b`});e.exports=function(e,t,n,d){var m=a(e),h=!i(function(){var t={};return t[m]=function(){return 7},``[e](t)!=7}),g=h&&!i(function(){var t=!1,n=/a/;return e===`split`&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags=``,n[m]=/./[m]),n.exec=function(){return t=!0,null},n[m](``),!t});if(!h||!g||e===`replace`&&!(l&&u&&!f)||e===`split`&&!p){var _=/./[m],v=n(m,``[e],function(e,t,n,r,i){return t.exec===o?h&&!i?{done:!0,value:_.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}},{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),y=v[0],b=v[1];r(String.prototype,e,y),r(RegExp.prototype,m,t==2?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}d&&s(RegExp.prototype[m],`sham`,!0)}}),d81d:(function(e,t,n){var r=n(`23e7`),i=n(`b727`).map,a=n(`1dde`),o=n(`ae40`),s=a(`map`),c=o(`map`);r({target:`Array`,proto:!0,forced:!s||!c},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})}),da84:(function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof t==`object`&&t)||Function(`return this`)()}).call(this,n(`c8ba`))}),dbb4:(function(e,t,n){var r=n(`23e7`),i=n(`83ab`),a=n(`56ef`),o=n(`fc6a`),s=n(`06cf`),c=n(`8418`);r({target:`Object`,stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t=o(e),n=s.f,r=a(t),i={},l=0,u,d;r.length>l;)d=n(t,u=r[l++]),d!==void 0&&c(i,u,d);return i}})}),dbf1:(function(e,t,n){(function(e){n.d(t,`a`,function(){return i});function r(){return typeof window<`u`?window.console:e.console}var i=r()}).call(this,n(`c8ba`))}),ddb0:(function(e,t,n){var r=n(`da84`),i=n(`fdbc`),a=n(`e260`),o=n(`9112`),s=n(`b622`),c=s(`iterator`),l=s(`toStringTag`),u=a.values;for(var d in i){var f=r[d],p=f&&f.prototype;if(p){if(p[c]!==u)try{o(p,c,u)}catch{p[c]=u}if(p[l]||o(p,l,d),i[d]){for(var m in a)if(p[m]!==a[m])try{o(p,m,a[m])}catch{p[m]=a[m]}}}}}),df75:(function(e,t,n){var r=n(`ca84`),i=n(`7839`);e.exports=Object.keys||function(e){return r(e,i)}}),e01a:(function(e,t,n){var r=n(`23e7`),i=n(`83ab`),a=n(`da84`),o=n(`5135`),s=n(`861d`),c=n(`9bf2`).f,l=n(`e893`),u=a.Symbol;if(i&&typeof u==`function`&&(!(`description`in u.prototype)||u().description!==void 0)){var d={},f=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),t=this instanceof f?new u(e):e===void 0?u():u(e);return e===``&&(d[t]=!0),t};l(f,u);var p=f.prototype=u.prototype;p.constructor=f;var m=p.toString,h=String(u(`test`))==`Symbol(test)`,g=/^Symbol\((.*)\)[^)]+$/;c(p,`description`,{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=m.call(e);if(o(d,e))return``;var n=h?t.slice(7,-1):t.replace(g,`$1`);return n===``?void 0:n}}),r({global:!0,forced:!0},{Symbol:f})}}),e163:(function(e,t,n){var r=n(`5135`),i=n(`7b0b`),a=n(`f772`),o=n(`e177`),s=a(`IE_PROTO`),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:typeof e.constructor==`function`&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}}),e177:(function(e,t,n){e.exports=!n(`d039`)(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),e260:(function(e,t,n){var r=n(`fc6a`),i=n(`44d2`),a=n(`3f8c`),o=n(`69f3`),s=n(`7dd0`),c=`Array Iterator`,l=o.set,u=o.getterFor(c);e.exports=s(Array,`Array`,function(e,t){l(this,{type:c,target:r(e),index:0,kind:t})},function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):n==`keys`?{value:r,done:!1}:n==`values`?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},`values`),a.Arguments=a.Array,i(`keys`),i(`values`),i(`entries`)}),e439:(function(e,t,n){var r=n(`23e7`),i=n(`d039`),a=n(`fc6a`),o=n(`06cf`).f,s=n(`83ab`),c=i(function(){o(1)});r({target:`Object`,stat:!0,forced:!s||c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})}),e538:(function(e,t,n){t.f=n(`b622`)}),e893:(function(e,t,n){var r=n(`5135`),i=n(`56ef`),a=n(`06cf`),o=n(`9bf2`);e.exports=function(e,t){for(var n=i(t),s=o.f,c=a.f,l=0;l<n.length;l++){var u=n[l];r(e,u)||s(e,u,c(t,u))}}}),e8b5:(function(e,t,n){var r=n(`c6b6`);e.exports=Array.isArray||function(e){return r(e)==`Array`}}),e95a:(function(e,t,n){var r=n(`b622`),i=n(`3f8c`),a=r(`iterator`),o=Array.prototype;e.exports=function(e){return e!==void 0&&(i.Array===e||o[a]===e)}}),f5df:(function(e,t,n){var r=n(`00ee`),i=n(`c6b6`),a=n(`b622`)(`toStringTag`),o=i(function(){return arguments}())==`Arguments`,s=function(e,t){try{return e[t]}catch{}};e.exports=r?i:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=s(t=Object(e),a))==`string`?n:o?i(t):(r=i(t))==`Object`&&typeof t.callee==`function`?`Arguments`:r}}),f772:(function(e,t,n){var r=n(`5692`),i=n(`90e3`),a=r(`keys`);e.exports=function(e){return a[e]||(a[e]=i(e))}}),fb15:(function(e,t,n){if(n.r(t),typeof window<`u`){var r=window.document.currentScript,i=n(`8875`);r=i(),`currentScript`in document||Object.defineProperty(document,"currentScript",{get:i});var a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}n(`99af`),n(`4de4`),n(`4160`),n(`c975`),n(`d81d`),n(`a434`),n(`159b`),n(`a4d3`),n(`e439`),n(`dbb4`),n(`b64b`);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?s(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){if(Array.isArray(e))return e}n(`e01a`),n(`d28b`),n(`e260`),n(`d3b7`),n(`3ca3`),n(`ddb0`);function u(e,t){if(!(typeof Symbol>`u`||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}n(`a630`),n(`fb6a`),n(`b0c0`),n(`25f0`);function d(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if(typeof e==`string`)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}}function p(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
16
16
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(e,t){return l(e)||u(e,t)||f(e,t)||p()}function h(e){if(Array.isArray(e))return d(e)}function g(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function _(){throw TypeError(`Invalid attempt to spread non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(e){return h(e)||g(e)||f(e)||_()}var y=n(`a352`),b=n.n(y);function x(e){e.parentElement!==null&&e.parentElement.removeChild(e)}function S(e,t,n){var r=n===0?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}var C=n(`dbf1`);n(`13d5`),n(`4fad`),n(`ac1f`),n(`5319`);function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var T=/-(\w)/g,E=w(function(e){return e.replace(T,function(e,t){return t.toUpperCase()})});n(`5db7`),n(`73d9`);var D=[`Start`,`Add`,`Remove`,`Update`,`End`],O=[`Choose`,`Unchoose`,`Sort`,`Filter`,`Clone`],k=[`Move`],ee=[k,D,O].flatMap(function(e){return e}).map(function(e){return`on${e}`}),A={manage:k,manageAndEmit:D,emit:O};function te(e){return ee.indexOf(e)!==-1}n(`caad`),n(`2ca0`);var ne=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.math.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function re(e){return ne.includes(e)}function ie(e){return[`transition-group`,`TransitionGroup`].includes(e)}function j(e){return[`id`,`class`,`role`,`style`].includes(e)||e.startsWith(`data-`)||e.startsWith(`aria-`)||e.startsWith(`on`)}function ae(e){return e.reduce(function(e,t){var n=m(t,2),r=n[0];return e[r]=n[1],e},{})}function oe(e){var t=e.$attrs,n=e.componentData,r=n===void 0?{}:n;return c(c({},ae(Object.entries(t).filter(function(e){var t=m(e,2),n=t[0];return t[1],j(n)}))),r)}function se(e){var t=e.$attrs,n=e.callBackBuilder,r=ae(ce(t));Object.entries(n).forEach(function(e){var t=m(e,2),n=t[0],i=t[1];A[n].forEach(function(e){r[`on${e}`]=i(e)})});var i=`[data-draggable]${r.draggable||``}`;return c(c({},r),{},{draggable:i})}function ce(e){return Object.entries(e).filter(function(e){var t=m(e,2),n=t[0];return t[1],!j(n)}).map(function(e){var t=m(e,2),n=t[0],r=t[1];return[E(n),r]}).filter(function(e){var t=m(e,2),n=t[0];return t[1],!te(n)})}n(`c740`);function le(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ue(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}var de=function(e){return e.el},N=function(e,t){return e.__draggable_context=t},P=function(e){return e.__draggable_context},fe=function(){function e(t){var n=t.nodes,r=n.header,i=n.default,a=n.footer,o=t.root,s=t.realList;le(this,e),this.defaultNodes=i,this.children=[].concat(v(r),v(i),v(a)),this.externalComponent=o.externalComponent,this.rootTransition=o.transition,this.tag=o.tag,this.realList=s}return ue(e,[{key:`render`,value:function(e,t){var n=this.tag,r=this.children;return e(n,t,this._isRootComponent?{default:function(){return r}}:r)}},{key:`updated`,value:function(){var e=this.defaultNodes,t=this.realList;e.forEach(function(e,n){N(de(e),{element:t[n],index:n})})}},{key:`getUnderlyingVm`,value:function(e){return P(e)}},{key:`getVmIndexFromDomIndex`,value:function(e,t){var n=this.defaultNodes,r=n.length,i=t.children,a=i.item(e);if(a===null)return r;var o=P(a);if(o)return o.index;if(r===0)return 0;var s=de(n[0]);return e<v(i).findIndex(function(e){return e===s})?0:r}},{key:`_isRootComponent`,get:function(){return this.externalComponent||this.rootTransition}}]),e}(),pe=n(`8bbf`);function me(e,t){var n=e[t];return n?n():[]}function he(e){var t=e.$slots,n=e.realList,r=e.getKey,i=n||[],a=m([`header`,`footer`].map(function(e){return me(t,e)}),2),o=a[0],s=a[1],l=t.item;if(!l)throw Error(`draggable element must have an item slot`);var u=i.flatMap(function(e,t){return l({element:e,index:t}).map(function(t){return t.key=r(e),t.props=c(c({},t.props||{}),{},{"data-draggable":!0}),t})});if(u.length!==i.length)throw Error(`Item slot must have only one child`);return{header:o,footer:s,default:u}}function F(e){var t=ie(e),n=!re(e)&&!t;return{transition:t,externalComponent:n,tag:n?(0,pe.resolveComponent)(e):t?pe.TransitionGroup:e}}function I(e){var t=e.$slots,n=e.tag,r=e.realList,i=e.getKey;return new fe({nodes:he({$slots:t,realList:r,getKey:i}),root:F(n),realList:r})}function ge(e,t){var n=this;(0,pe.nextTick)(function(){return n.$emit(e.toLowerCase(),t)})}function _e(e){var t=this;return function(n,r){if(t.realList!==null)return t[`onDrag${e}`](n,r)}}function ve(e){var t=this,n=_e.call(this,e);return function(r,i){n.call(t,r,i),ge.call(t,e,r)}}var ye=null,be={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(e){return e}},tag:{type:String,default:`div`},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},xe=[`update:modelValue`,`change`].concat(v([].concat(v(A.manageAndEmit),v(A.emit)).map(function(e){return e.toLowerCase()})));t.default=(0,pe.defineComponent)({name:`draggable`,inheritAttrs:!1,props:be,emits:xe,data:function(){return{error:!1}},render:function(){try{this.error=!1;var e=this.$slots,t=this.$attrs,n=this.tag,r=this.componentData,i=this.realList,a=this.getKey,o=I({$slots:e,tag:n,realList:i,getKey:a});this.componentStructure=o;var s=oe({$attrs:t,componentData:r});return o.render(pe.h,s)}catch(e){return this.error=!0,(0,pe.h)(`pre`,{style:{color:`red`}},e.stack)}},created:function(){this.list!==null&&this.modelValue!==null&&C.a.error(`modelValue and list props are mutually exclusive! Please set one or another.`)},mounted:function(){var e=this;if(!this.error){var t=this.$attrs,n=this.$el;this.componentStructure.updated();var r=se({$attrs:t,callBackBuilder:{manageAndEmit:function(t){return ve.call(e,t)},emit:function(t){return ge.bind(e,t)},manage:function(t){return _e.call(e,t)}}}),i=n.nodeType===1?n:n.parentElement;this._sortable=new b.a(i,r),this.targetDomElement=i,i.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList:function(){return this.list||this.modelValue},getKey:function(){var e=this.itemKey;return typeof e==`function`?e:function(t){return t[e]}}},watch:{$attrs:{handler:function(e){var t=this._sortable;t&&ce(e).forEach(function(e){var n=m(e,2),r=n[0],i=n[1];t.option(r,i)})},deep:!0}},methods:{getUnderlyingVm:function(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent:function(e){return e.__draggable_component__},emitChanges:function(e){var t=this;(0,pe.nextTick)(function(){return t.$emit(`change`,e)})},alterList:function(e){if(this.list){e(this.list);return}var t=v(this.modelValue);e(t),this.$emit(`update:modelValue`,t)},spliceList:function(){var e=arguments;this.alterList(function(t){return t.splice.apply(t,v(e))})},updatePosition:function(e,t){this.alterList(function(n){return n.splice(t,0,n.splice(e,1)[0])})},getRelatedContextFromMoveEvent:function(e){var t=e.to,n=e.related,r=this.getUnderlyingPotencialDraggableComponent(t);if(!r)return{component:r};var i=r.realList,a={list:i,component:r};return t!==n&&i?c(c({},r.getUnderlyingVm(n)||{}),a):a},getVmIndexFromDomIndex:function(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),ye=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(t!==void 0){x(e.item);var n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);var r={element:t,newIndex:n};this.emitChanges({added:r})}},onDragRemove:function(e){if(S(this.$el,e.item,e.oldIndex),e.pullMode===`clone`){x(e.clone);return}var t=this.context,n=t.index,r=t.element;this.spliceList(n,1);var i={element:r,oldIndex:n};this.emitChanges({removed:i})},onDragUpdate:function(e){x(e.item),S(e.from,e.item,e.oldIndex);var t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);var r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex:function(e,t){if(!e.element)return 0;var n=v(t.to.children).filter(function(e){return e.style.display!==`none`}),r=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(r);return n.indexOf(ye)!==-1||!t.willInsertAfter?i:i+1},onDragMove:function(e,t){var n=this.move,r=this.realList;if(!n||!r)return!0;var i=this.getRelatedContextFromMoveEvent(e),a=this.computeFutureIndex(i,e),o=c(c({},this.context),{},{futureIndex:a});return n(c(c({},e),{},{relatedContext:i,draggedContext:o}),t)},onDragEnd:function(){ye=null}}})}),fb6a:(function(e,t,n){var r=n(`23e7`),i=n(`861d`),a=n(`e8b5`),o=n(`23cb`),s=n(`50c4`),c=n(`fc6a`),l=n(`8418`),u=n(`b622`),d=n(`1dde`),f=n(`ae40`),p=d(`slice`),m=f(`slice`,{ACCESSORS:!0,0:0,1:2}),h=u(`species`),g=[].slice,_=Math.max;r({target:`Array`,proto:!0,forced:!p||!m},{slice:function(e,t){var n=c(this),r=s(n.length),u=o(e,r),d=o(t===void 0?r:t,r),f,p,m;if(a(n)&&(f=n.constructor,typeof f==`function`&&(f===Array||a(f.prototype))?f=void 0:i(f)&&(f=f[h],f===null&&(f=void 0)),f===Array||f===void 0))return g.call(n,u,d);for(p=new(f===void 0?Array:f)(_(d-u,0)),m=0;u<d;u++,m++)u in n&&l(p,m,n[u]);return p.length=m,p}})}),fc6a:(function(e,t,n){var r=n(`44ad`),i=n(`1d80`);e.exports=function(e){return r(i(e))}}),fdbc:(function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),fdbf:(function(e,t,n){e.exports=n(`4930`)&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})}).default})}))(),1),Iw={key:0,class:`badges-container`},Lw={key:0,class:`overlay-badge badge-disabled`,title:`Page is disabled`},Rw=[`title`],zw={key:1,class:`overlay-badge badge-unpublished`,title:`Has draft changes`},Bw=Yh(vi({__name:`NodeStatusBadges`,props:{evaluated:{}},setup(e){return(t,n)=>e.evaluated.isDraft?G(``,!0):(B(),V(`div`,Iw,[e.evaluated.isHidden?(B(),V(`div`,Lw,[q(z(lm),{size:10,"stroke-width":`2.5`})])):(B(),V(K,{key:1},[e.evaluated.isScheduled?(B(),V(`div`,{key:0,class:`overlay-badge badge-scheduled`,title:`Status: ${e.evaluated.badgeLabel}`},[q(z(Cm),{size:10,"stroke-width":`2.5`})],8,Rw)):G(``,!0),e.evaluated.hasUnpublishedChanges||e.evaluated.isUnpublishedDraft?(B(),V(`div`,zw,[q(z(mh),{size:10,"stroke-width":`2.5`})])):G(``,!0)],64))]))}}),[[`__scopeId`,`data-v-7b0de368`]]),Vw={class:`tree-item-wrapper`},Hw={key:1,class:`toggle-placeholder`},Uw=[`title`],Ww=[`title`],Gw={key:0,class:`nested-tree`},Kw=Yh(vi({__name:`NodeTreeItem`,props:{node:{},activeId:{},treeId:{}},emits:[`select-node`,`add-child`,`add-sibling`,`delete-node`,`tree-change`],setup(e,{emit:t}){let n=e,r=t,i=sp(),{detachTreeNode:a}=Mp(),{treeEligibleNodeTypes:o,toggleNodeVisibility:s,deleteNode:c}=Yp(),{confirmDiscard:l}=Fd(),u=R(!0),d=()=>{u.value=!u.value},f=J(()=>{let e=i.nodeSchemas.value[n.node.nodeType],t=Ep(e,{...n.node,...n.node.dataJson||{}});return t.startsWith(`Untitled`)&&m.value.isDraft?t+`...`:t}),p=J(()=>{let e=i.activeNode.value;if(!e||!e.id)return!1;let t=String(e.id).trim();if(!t)return!1;let r=n.node.id?String(n.node.id).trim():``,a=n.node.contentId?String(n.node.contentId).trim():``,o=n.node.treeNodeId?String(n.node.treeNodeId).trim():``,s=e.treeNodeId?String(e.treeNodeId).trim():``;return!!(r&&t===r||a&&t===a||s&&(r&&s===r||o&&s===o))}),m=J(()=>bp(n.node)),h=J(()=>{let e=n.node.nodeType||`page`,t=i.nodeSchemas.value[e];return t?.label?t.label:e.charAt(0).toUpperCase()+e.slice(1)}),g=()=>{window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),r(`select-node`,n.node)},_=R(!1),v=R(null),y=R(null),b=()=>{_.value=!1,y.value=null},x=e=>{if(m.value.isDraft){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`info`,message:`Save this page first to unlock menu options.`}}));return}if(e.preventDefault(),e.stopPropagation(),_.value){b();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),v.value&&(y.value=v.value.getBoundingClientRect()),_.value=!0},S=()=>{_.value&&b()};Js(()=>{window.addEventListener(`cms-close-tree-menus`,S)}),Zs(()=>{window.removeEventListener(`cms-close-tree-menus`,S)});let C=async e=>{if(b(),window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`toggle-hide`)await s(n.node);else if(e===`add-child`){if(!o.value||o.value.length===0)return alert(`No tree-eligible node types available.`);u.value=!0,r(`add-child`,n.node)}else if(e===`add-sibling`){if(!o.value||o.value.length===0)return alert(`No tree-eligible node types available.`);r(`add-sibling`,n.node)}else if(e===`unlink`){if(confirm(`Remove "${f.value}" from this tree? (It will remain in the Vault)`)){let e=n.node.treeNodeId||n.node.id;await a(e)}}else e===`delete`?await l(`Are you sure you want to delete "${f.value}"?`,`Delete Node?`,`Delete`,`Cancel`)&&await c(n.node.id||n.node.treeNodeId):e===`show-assets`&&(sessionStorage.setItem(`cms-media-node-filter`,n.node.id),window.dispatchEvent(new CustomEvent(`cms-filter-media-by-node`,{detail:n.node.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`media`})))},T=J(()=>{let e=m.value.isHidden,t=h.value,r=[{key:`toggle-hide`,label:e?`Enable ${t}`:`Disable ${t}`,icon:e?xm:lm}];return n.node.assetCount&&n.node.assetCount>0&&(r.push({key:`div-assets`,divider:!0}),r.push({key:`show-assets`,label:`View Assets (${n.node.assetCount})`,icon:Km})),r.push({key:`div-1`,divider:!0},{key:`add-child`,label:`Add Inside`,icon:Om},{key:`add-sibling`,label:`Add After`,icon:gh},{key:`div-2`,divider:!0},{key:`unlink`,label:`Unlink from Tree`,icon:Nh},{key:`delete`,label:`Delete`,icon:Ah}),r}),E=e=>{n.node.children&&(n.node.children=n.node.children.map(e=>{let t=String(e.id||``),n=t.startsWith(`v0.`)||t.includes(`alpha`)?e.contentId||e.treeNodeId||t:e.id;return{...e,id:n}})),r(`tree-change`,e)};return(t,r)=>{let i=Gi(`NodeTreeItem`,!0);return B(),V(`div`,Vw,[U(`div`,{class:w([`tree-node`,{"is-active":p.value,"is-draft":m.value.isDraft}]),onClick:g,onContextmenu:ld(x,[`prevent`])},[e.node.children&&e.node.children.length>0?(B(),V(`button`,{key:0,class:`toggle-btn`,onClick:ld(d,[`stop`])},[u.value?(B(),H(z(_m),{key:0,size:12})):(B(),H(z(vm),{key:1,size:12}))])):(B(),V(`span`,Hw)),U(`div`,{class:w([`icon-wrapper`,{"drag-handle-tree":!m.value.isDraft}]),title:`Type: ${e.node.nodeType||`node`} ${m.value.isDraft?``:`(Drag to reorder)`}`},[q(z(Im),{size:14,class:`node-icon`}),q(Bw,{evaluated:m.value},null,8,[`evaluated`])],10,Uw),U(`span`,{class:`node-title`,title:f.value},L(f.value),9,Ww),m.value.isDraft?G(``,!0):(B(),V(`div`,{key:2,class:w([`node-actions`,{"menu-open":_.value}])},[U(`button`,{ref_key:`anchorBtnRef`,ref:v,class:`action-btn`,title:`Options`,onClick:ld(x,[`stop`])},[q(z(jm),{size:14})],512)],2))],34),q(tg,{show:_.value,"anchor-rect":y.value,items:T.value,onSelect:C,onClose:b},null,8,[`show`,`anchor-rect`,`items`]),u.value?(B(),V(`div`,Gw,[e.node.children?(B(),H(z(Fw.default),{key:0,modelValue:e.node.children,"onUpdate:modelValue":r[4]||=t=>e.node.children=t,"item-key":`id`,group:`node-tree-${n.treeId}`,handle:`.drag-handle-tree`,class:`tree-drag-area`,onChange:E},{item:qr(({element:a})=>[q(i,{node:a,"active-id":e.activeId,"tree-id":n.treeId,onSelectNode:r[0]||=e=>t.$emit(`select-node`,e),onAddChild:r[1]||=e=>t.$emit(`add-child`,e),onAddSibling:r[2]||=e=>t.$emit(`add-sibling`,e),onDeleteNode:r[3]||=e=>t.$emit(`delete-node`,e),onTreeChange:E},null,8,[`node`,`active-id`,`tree-id`])]),_:1},8,[`modelValue`,`group`])):G(``,!0)])):G(``,!0)])}}}),[[`__scopeId`,`data-v-3abbdd86`]]),qw={class:`node-tree-container`},Jw={key:0,class:`tree-loading`},Yw={key:2,class:`empty-tree-state`},Xw=Yh(vi({__name:`NodeTree`,props:{treeId:{}},setup(e){let t=e,{activeNode:n,selectedTreeId:r,selectedChannelId:i,workspaceContext:a}=sp(),{saveTreeOrderForId:o,getNodesForTree:s,fetchNodeTreeForId:c}=Mp(),{loadNodeContent:l,handleAddRootNode:u,handleAddChild:d,handleAddSibling:f,deleteNode:p}=Yp(),m=R(!1),h=J(()=>String(n.value?.id||``)),g=J({get(){return s(t.treeId)},set(e){o(t.treeId,e)}}),_=async e=>{r.value=t.treeId,a.value=`tree`,await l(e)},v=async()=>{r.value=t.treeId,a.value=`tree`,await u()},y=async e=>{r.value=t.treeId,a.value=`tree`,await d(e)},b=async e=>{r.value=t.treeId,a.value=`tree`,await f(e)},x=async e=>{r.value=t.treeId;let n=e.treeNodeId||e.id;n&&await p(n)},S=async()=>{await o(t.treeId,g.value)};return Js(async()=>{t.treeId&&(m.value=!0,await c(t.treeId),m.value=!1)}),ni(i,async()=>{t.treeId&&(m.value=!0,await c(t.treeId),m.value=!1)}),(e,n)=>(B(),V(`div`,qw,[m.value?(B(),V(`div`,Jw,[q(z(nh),{size:14,class:`spin`}),n[1]||=U(`span`,null,`Loading nodes...`,-1)])):g.value&&g.value.length>0?(B(),H(z(Fw.default),{key:1,modelValue:g.value,"onUpdate:modelValue":n[0]||=e=>g.value=e,"item-key":`id`,group:`node-tree-${t.treeId}`,handle:`.drag-handle-tree`,class:`tree-drag-root`,onChange:S},{item:qr(({element:e})=>[q(Kw,{node:e,"active-id":h.value,"tree-id":t.treeId,onSelectNode:_,onAddChild:y,onAddSibling:b,onDeleteNode:x,onTreeChange:S},null,8,[`node`,`active-id`,`tree-id`])]),_:1},8,[`modelValue`,`group`])):(B(),V(`div`,Yw,[n[3]||=U(`p`,null,`No nodes in this navigation tree.`,-1),U(`button`,{class:`primary-btn`,onClick:v},[q(z(gh),{size:13}),n[2]||=W(` Add Node `,-1)])]))]))}}),[[`__scopeId`,`data-v-0bd39070`]]),Zw={class:`tree-pane`},Qw={key:0,class:`tree-stack`},$w=[`onClick`,`onContextmenu`],eT=[`onClick`],tT={class:`tree-badges`},nT={key:0,class:`status-badge draft`,title:`Draft changes pending`},rT={key:1,class:`status-badge hidden`,title:`Tree is Hidden`},iT={key:2,class:`status-badge scheduled`,title:`Scheduled to publish`},aT={key:3,class:`status-badge expired`,title:`Publishing window expired`},oT=[`onClick`],sT={class:`tree-nodes-wrap`},cT={key:1,class:`empty-trees-state`},lT=Yh(vi({__name:`TreeOperations`,setup(e){let t=(e,t)=>vi({props:[`size`,`class`],setup(n){return()=>Vo(`div`,{class:n.class,style:`display:inline-flex; align-items:center;`},[Vo(e,{size:13}),Vo(t,{size:11,style:`margin-left: -2px;`})])}}),n=t(fh,ym),r=t(fh,_m),{selectedTreeId:i,activeViewMode:a,setViewMode:o,activeNode:s,activeTreeSettings:c}=sp(),{fetchNodeTree:l,currentChannelTrees:u,fetchTrees:d,openTreeSettings:f,handleAddNewTree:p,checkUnsavedChanges:m,reorderChannelTrees:h}=Mp(),{confirmDiscard:g}=Fd(),_=Zh(`kama_selected_tree`,``),v=Zh(`kama_collapsed_trees`,{}),y=e=>{let t=String(e);v.value={...v.value,[t]:!v.value[t]}},b=e=>!!v.value[String(e)],x=R(null),S=e=>{let t=new Date,n=!!e.isHidden,r=e.status===`draft`||e.isDraft===!0||!!e.draftDataJson,i={};if(e.dataJson)try{i=typeof e.dataJson==`string`?JSON.parse(e.dataJson):e.dataJson}catch{}let a=i.startShowingAt?new Date(i.startShowingAt):null,o=i.stopShowingAt?new Date(i.stopShowingAt):null;return{isHidden:n,isDraft:r,isScheduled:a&&a>t,isExpired:o&&o<t}},C=R(!1),T=R(void 0),E=R(void 0),D=R(null),O=R(null),k=R(-1),ee=()=>{C.value=!1,D.value=null,T.value=void 0,E.value=void 0,O.value=null,k.value=-1,document.removeEventListener(`click`,ee)},A=(e,t,n)=>{e.preventDefault(),e.stopPropagation(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),O.value=t,k.value=n;let r=e.currentTarget;r&&typeof r.getBoundingClientRect==`function`?(D.value=r.getBoundingClientRect(),T.value=void 0,E.value=void 0):(D.value=null,T.value=e.clientX,E.value=e.clientY+4),C.value=!0,setTimeout(()=>document.addEventListener(`click`,ee),0)},te=J(()=>{if(!O.value)return[];let e=O.value,t=!!e.isHidden,i=[],a=x.value;if(a){if(a.tree.id===e.id)i.push({key:`cancel-transfer`,label:`Cancel Transfer`,icon:Ih}),i.push({key:`div-transfer`,divider:!0});else{let e=a.tree.label||a.tree.key||`Tree ${a.tree.id}`,t=e.length>15?e.substring(0,15)+`...`:e;i.push({key:`place-before`,label:`Move '${t}' Before`,icon:n}),i.push({key:`place-after`,label:`Move '${t}' After`,icon:r}),i.push({key:`div-transfer`,divider:!0})}}return i.push({key:`settings`,label:`Tree Settings`,icon:Ch}),i.push({key:`toggle-hide`,label:t?`Show Tree`:`Hide Tree`,icon:t?Pm:Nm}),a||i.push({key:`move`,label:`Move Order`,icon:fh}),i.push({key:`create-new`,label:`Add New Tree`,icon:gh}),i.push({key:`div-1`,label:``,divider:!0}),i.push({key:`delete`,label:`Delete Tree`,icon:Ah}),i}),ne=async e=>{let t=O.value,n=k.value;if(ee(),e===`cancel-transfer`){x.value=null;return}if(e===`place-before`||e===`place-after`){if(!x.value)return;let t=x.value.index,r=n;e===`place-after`&&(r+=1),t<r&&--r,await h(t,r),x.value=null;return}if(e===`move`){x.value={index:n,tree:t};return}if(!(!t&&e!==`create-new`)){if(e===`settings`)await ie(t.id);else if(e===`create-new`)await j();else if(e===`toggle-hide`)try{await fetch(`/api/cms/trees.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,isHidden:!t.isHidden})}),await d()}catch(e){console.error(`Failed to toggle tree visibility:`,e)}else if(e===`delete`&&await g(`Are you sure you want to delete the tree "${t.label||t.key}"?`,`Delete Tree?`,`Delete`,`Cancel`))try{await fetch(`/api/cms/trees.json?id=${t.id}`,{method:`DELETE`}),await d()}catch(e){console.error(`Failed to delete tree:`,e)}}},re=async e=>{(i.value!==String(e)||a.value!==`tree`)&&(i.value=String(e),_.value=String(e),await f(String(e))&&await l())},ie=async e=>{i.value=String(e),_.value=String(e),await f(String(e))&&await l()},j=async()=>{await m()&&await p()};return ni(()=>u.value,async e=>{if(e.length>0){let t=_.value&&e.some(e=>String(e.id)===_.value||String(e.key)===_.value)?_.value:String(e[0].id);i.value!==t&&(i.value=t,_.value=t,await l())}else i.value=``,_.value=``,a.value!==`channel`&&a.value!==`tree`&&(o(`none`),s.value={id:``,title:``,slug:``,nodeType:`node`,channelId:``,language:null,isHidden:!1,children:[],disabledRegions:{}})},{deep:!0,immediate:!0}),Js(async()=>{await d();let e=_.value&&u.value.some(e=>String(e.id)===_.value)?_.value:u.value[0]?.id;e&&(i.value=String(e),_.value=String(e),await l())}),Qs(()=>{document.removeEventListener(`click`,ee)}),(e,t)=>(B(),V(`div`,Zw,[z(u).length>0?(B(),V(`div`,Qw,[(B(!0),V(K,null,Xi(z(u),(e,n)=>(B(),V(`div`,{key:e.id,class:w([`tree-block`,{"is-selected":String(z(i))===String(e.id)&&z(a)===`tree`,"is-transfer-source":x.value?.tree.id===e.id}])},[U(`div`,{class:`tree-label-row`,onClick:t=>re(e.id),onContextmenu:ld(t=>A(t,e,n),[`prevent`])},[U(`button`,{class:`toggle-btn`,onClick:ld(t=>y(e.id),[`stop`])},[b(e.id)?(B(),H(z(vm),{key:0,size:13})):(B(),H(z(_m),{key:1,size:13}))],8,eT),U(`span`,{class:w([`tree-title`,{"is-hidden-text":e.isHidden}])},L(e.label||e.key||`Tree ${e.id}`),3),U(`div`,tT,[S(e).isDraft?(B(),V(`span`,nT,[q(z(Fm),{size:10}),t[1]||=U(`span`,null,`Draft`,-1)])):G(``,!0),S(e).isHidden?(B(),V(`span`,rT,[q(z(Nm),{size:10}),t[2]||=U(`span`,null,`Hidden`,-1)])):G(``,!0),S(e).isScheduled?(B(),V(`span`,iT,[q(z(Cm),{size:10}),t[3]||=U(`span`,null,`Scheduled`,-1)])):S(e).isExpired?(B(),V(`span`,aT,[q(z(mm),{size:10}),t[4]||=U(`span`,null,`Expired`,-1)])):G(``,!0)]),U(`div`,{class:w([`action-buttons`,{"menu-open":C.value||x.value?.tree.id===e.id}])},[x.value?.tree.id===e.id?(B(),V(`button`,{key:0,class:`icon-btn cancel-transfer-btn`,title:`Cancel Transfer`,onClick:t[0]||=ld(e=>x.value=null,[`stop`])},[q(z(fh),{size:13,class:`default-icon`}),q(z(Ih),{size:13,class:`hover-icon`})])):G(``,!0),U(`button`,{class:`icon-btn menu-btn`,title:`Tree Options`,onClick:ld(t=>A(t,e,n),[`stop`])},[q(z(jm),{size:13})],8,oT)],2)],40,$w),Jr(U(`div`,sT,[q(Xw,{"tree-id":String(e.id)},null,8,[`tree-id`])],512),[[Ou,!b(e.id)]])],2))),128))])):(B(),V(`div`,cT,[t[6]||=U(`p`,null,`No navigation trees found.`,-1),U(`button`,{class:`create-first-btn`,onClick:j},[q(z(gh),{size:13}),t[5]||=W(` Add Tree `,-1)])])),q(tg,{show:C.value&&!!O.value,"anchor-rect":D.value,x:T.value,y:E.value,items:te.value,onSelect:ne,onClose:ee},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])]))}}),[[`__scopeId`,`data-v-33bb18de`]]),uT=[`id`],dT=vi({__name:`CmsListItem`,props:{selected:{type:Boolean},draft:{type:Boolean},media:{type:Boolean},variant:{},id:{}},setup(e){return(t,n)=>(B(),V(`div`,{id:e.id,class:w([`cms-list-item`,[e.variant===`media`||e.media?`media-list-item`:e.variant===`vault`?`vault-item`:`tree-item`,{active:e.selected,"is-draft":e.draft}]])},[Qi(t.$slots,`icon`),Qi(t.$slots,`default`),Qi(t.$slots,`actions`)],10,uT))}}),fT={class:`vault-pane`},pT={class:`fixed-vault-controls`},mT={class:`search-bar`},hT={key:0,class:`filter-bar`},gT=[`onClick`],_T={class:`pane-header`},vT={class:`sort-wrapper`},yT=[`title`],bT={class:`sort-label`},xT={key:0,class:`vault-list`},ST={class:`icon-wrapper`},CT={class:`item-details`},wT={key:0,class:`type-label`},TT=[`title`],ET={class:`meta-row`},DT=[`title`],OT={key:1,class:`tree-tag-icon`,title:`Belongs to a tree`},kT=[`title`],AT={class:`count-text`},jT=[`onClick`],MT={key:1,class:`empty-vault-state`},NT={key:0,class:`loading-text`},PT={key:1,class:`end-text`},FT=Yh(vi({__name:`VaultOperations`,setup(e){let{vaultNodes:t,nodeSchemas:n,activeNode:r,selectedChannelId:i,selectedTreeId:a,hasUnpublishedChanges:o,openNode:s,workspaceContext:c}=sp(),{loadNodeContent:l,handleAddNewNode:u,toggleNodeVisibility:d,deleteNode:f,vaultEligibleNodeSchemas:p}=Yp(),{fetchVaultNodes:m,attachVaultNodeToTree:h,detachTreeNode:g,isLoading:_,hasMore:v}=Mp(),{confirmDiscard:y}=Fd(),b=R(null),x=R([]),S=R(`updatedAt`),C=R(!0),T=R(``),E=R(``),D=R(null),O=null,k=null,ee=R(!1),A=e=>{let t=e.contentType||e.nodeType||`page`,r=n.value[t],i=Ep(r,{...e,...e.dataJson||{}});return i.startsWith(`Untitled`)&&F(e).isDraft?i+`...`:i},te=R(!1),ne=R(null),re=R(null),ie=()=>{if(te.value){te.value=!1;return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),ne.value&&(re.value=ne.value.getBoundingClientRect()),te.value=!0},j=e=>{S.value=String(e),te.value=!1},ae=R(null),oe=R(!1),se=R(void 0),ce=R(void 0),le=R(null),M=R(null),ue=()=>{oe.value=!1,ae.value=null,M.value=null,le.value=null,se.value=void 0,ce.value=void 0},de=(e,t)=>{if(bp(t).isDraft)return;if(e.preventDefault(),e.stopPropagation(),oe.value&&ae.value===String(t.id)){ue();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),M.value=t,ae.value=String(t.id);let n=e.currentTarget;n&&(le.value=n.getBoundingClientRect()),se.value=void 0,ce.value=void 0,oe.value=!0},N=(e,t)=>{bp(t).isDraft||(e.preventDefault(),e.stopPropagation(),oe.value&&ae.value===String(t.id)&&ue(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),M.value=t,ae.value=String(t.id),le.value=null,se.value=e.clientX,ce.value=e.clientY,oe.value=!0)},P=()=>{oe.value&&ue(),te.value&&=!1},fe=async e=>{let t=M.value;if(ue(),t){if(window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`toggle-hide`)await d(t);else if(e===`create-same-type`){let e=t.contentType||t.nodeType||``;c.value=`vault`,u(e)}else if(e===`attach-tree`)await h(t.id);else if(e===`unlink-tree`){if(confirm(`Remove "${A(t)}" from the navigation tree? (It will remain in the Vault)`)){let e=t.treeNodeId||t.trees?.[0]?.id||t.id;await g(e),await m({reset:!0,assetId:E.value})}}else e===`delete`?await y(`Are you sure you want to delete "${A(t)}"?`,`Delete Node?`,`Delete`,`Cancel`)&&await f(t.id):e===`show-assets`&&(sessionStorage.setItem(`cms-media-node-filter`,t.id),window.dispatchEvent(new CustomEvent(`cms-filter-media-by-node`,{detail:t.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`media`})))}},pe=e=>{if(!e)return`Item`;let t=e.contentType||e.nodeType||`page`,r=n.value[t];return r?.label?r.label:t.charAt(0).toUpperCase()+t.slice(1)},me=e=>{if(!e)return!1;let t=e.contentType||e.nodeType;if(!t)return!1;let r=n.value[t];return r?r.inTree===!0:!1},he=J(()=>{if(!M.value)return[];let e=M.value,t=F(e).isHidden,n=pe(e),r=me(e),i=[{key:`toggle-hide`,label:t?`Enable ${n}`:`Disable ${n}`,icon:t?xm:lm},{key:`div-1`,label:``,divider:!0},{key:`create-same-type`,label:`Add New ${n}`,icon:Em}];return e.assetCount&&e.assetCount>0&&(i.push({key:`div-assets`,label:``,divider:!0}),i.push({key:`show-assets`,label:`View Assets (${e.assetCount})`,icon:Km})),a.value&&(ge(e)?(i.push({key:`div-2`,label:``,divider:!0}),i.push({key:`unlink-tree`,label:`Unlink from Tree`,icon:Nh})):r&&(i.push({key:`div-2`,label:``,divider:!0}),i.push({key:`attach-tree`,label:`Attach to Active Tree`,icon:Rm}))),i.push({key:`div-3`,label:``,divider:!0},{key:`delete`,label:`Delete`,icon:Ah}),i});J(()=>C.value?am:cm),ni([S,C,i],()=>{b.value&&(b.value.scrollTop=0),m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`,assetId:E.value})}),ni(()=>r.value?.id,async e=>{if(ee.value){ee.value=!1;return}if(e&&b.value){await Fr();let t=document.getElementById(`vault-item-${e}`),n=b.value;if(t&&n){let e=t.offsetTop,r=e+t.offsetHeight,i=n.scrollTop,a=i+n.clientHeight;if(e<i||r>a){let r=e-n.clientHeight/2+t.offsetHeight/2;n.scrollTo({top:Math.max(0,r),behavior:`smooth`})}}}});let F=e=>{let t=bp(e);return String(r.value?.id)===String(e.id)?{...t,hasUnpublishedChanges:o.value||t.hasUnpublishedChanges}:t},I=J(()=>x.value.length!==1),ge=e=>e?!!(Array.isArray(e.treeNames)&&e.treeNames.length>0||Array.isArray(e.trees)&&e.trees.length>0):!1,_e=J(()=>Object.keys(n.value).filter(e=>n.value[e].inVault!==!1).map(e=>({key:e,label:n.value[e].label||e,inTree:n.value[e].inTree===!0}))),ve=J(()=>{let e=p.value||{},t=x.value;return t.length===0?Object.keys(e):t.filter(t=>e[t])}),ye=J(()=>{let e=[{id:`updatedAt`,label:`Last Updated`},{id:`createdAt`,label:`Created Date`},{id:`title`,label:`Title`}];if(x.value.length===1){let t=x.value[0],r=n.value[t];if(r){let t=t=>{t&&(Array.isArray(t)?t.forEach(t=>{typeof t==`object`&&t&&!t.fieldSet&&Object.entries(t).forEach(([t,n])=>{e.find(e=>e.id===t)||e.push({id:t,label:n.label||t})})}):Object.entries(t).forEach(([t,n])=>{t!==`fieldSet`&&!e.find(e=>e.id===t)&&e.push({id:t,label:n.label||t})}))};t(r.fields),r.tabs&&Object.values(r.tabs).forEach(e=>t(e.fields))}}return e}),be=J(()=>ye.value.map(e=>({key:e.id,label:e.label,isActive:S.value===e.id}))),xe=J(()=>t.value),Se=e=>{let t=S.value;if(t===`title`)return null;let n=e[t];if(n==null||n===``)return null;if(t===`createdAt`||t===`updatedAt`)try{let e=new Date(n);if(!isNaN(e.getTime()))return e.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}catch{}return String(n)},Ce=J(()=>{let e=ye.value.find(e=>String(e.id)===String(S.value));return e?e.label:S.value}),we=e=>{E.value=e.detail,T.value=``,x.value=[],b.value&&(b.value.scrollTop=0),m({reset:!0,assetId:E.value,type:`all`,search:``,sort:S.value,order:C.value?`DESC`:`ASC`})},Te=()=>{E.value=``},Ee=e=>{if(Te(),b.value&&(b.value.scrollTop=0),e===`all`)x.value=[];else{let t=x.value.indexOf(e);t>-1?x.value.splice(t,1):x.value.push(e)}m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},De=()=>{Te(),k&&clearTimeout(k),k=setTimeout(()=>{b.value&&(b.value.scrollTop=0),m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},300)},Oe=e=>{ee.value=!0,c.value=`vault`,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),l({id:e.id,title:A(e),slug:e.slug,nodeType:e.contentType||e.nodeType,channelId:e.channelId||``,language:e.language||null,children:[]})},ke=()=>{c.value=`vault`,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),ve.value.length===1?u(ve.value[0]):u(``)},Ae=()=>{m({reset:!0,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})};return Js(()=>{window.addEventListener(`cms-close-tree-menus`,P),window.addEventListener(`cms-filter-vault-by-asset`,we),window.addEventListener(`cms-node-updated`,Ae);let e=sessionStorage.getItem(`cms-vault-asset-filter`);e&&(E.value=e,sessionStorage.removeItem(`cms-vault-asset-filter`)),m({reset:!0,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`}),O=new IntersectionObserver(e=>{e[0].isIntersecting&&v.value&&!_.value&&m({reset:!1,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},{root:b.value,rootMargin:`120px`,threshold:.1}),D.value&&O.observe(D.value)}),Qs(()=>{window.removeEventListener(`cms-close-tree-menus`,P),window.removeEventListener(`cms-filter-vault-by-asset`,we),window.removeEventListener(`cms-node-updated`,Ae),O&&O.disconnect(),k&&clearTimeout(k)}),(e,t)=>(B(),V(`div`,fT,[U(`div`,pT,[U(`div`,mT,[q(z(xh),{size:13,class:`search-icon`}),Jr(U(`input`,{"onUpdate:modelValue":t[0]||=e=>T.value=e,type:`text`,placeholder:`Search vault items...`,class:`search-input`,onInput:De},null,544),[[nd,T.value]])]),_e.value.length>1?(B(),V(`div`,hT,[U(`button`,{class:w([`filter-pill`,{active:x.value.length===0&&!E.value}]),onClick:t[1]||=e=>Ee(`all`)},` All `,2),(B(!0),V(K,null,Xi(_e.value,e=>(B(),V(`button`,{key:e.key,class:w([`filter-pill`,{active:x.value.includes(e.key)}]),onClick:t=>Ee(e.key)},L(e.label),11,gT))),128))])):G(``,!0),U(`div`,_T,[U(`div`,vT,[U(`button`,{class:`pane-icon-btn`,onClick:t[2]||=e=>C.value=!C.value,title:C.value?`Sort Descending`:`Sort Ascending`},[C.value?(B(),H(z(am),{key:0,size:13})):(B(),H(z(cm),{key:1,size:13}))],8,yT),U(`div`,{class:`sort-dropdown-wrapper`,ref_key:`sortMenuTriggerRef`,ref:ne},[U(`button`,{class:`sort-trigger-btn`,title:`Change Sort Order`,onClick:ie},[U(`span`,bT,L(Ce.value),1),q(z(_m),{size:13,class:`sort-chevron`})]),q(tg,{show:te.value,items:be.value,"anchor-rect":re.value,"min-width":`160px`,onSelect:j,onClose:t[3]||=e=>te.value=!1},null,8,[`show`,`items`,`anchor-rect`])],512)]),U(`button`,{class:`pane-icon-btn add-content-btn`,title:`Create New Content`,onClick:ke},[q(z(gh),{size:14})])])]),E.value?(B(),V(`div`,{key:0,class:`asset-filter-banner`,title:`Clear filter`,onClick:t[4]||=e=>{Te(),z(m)({reset:!0})}},` Showing nodes using selected asset ✕ `)):G(``,!0),U(`div`,{ref_key:`vaultScrollArea`,ref:b,class:`vault-scroll-area`},[xe.value.length>0?(B(),V(`div`,xT,[(B(!0),V(K,null,Xi(xe.value,e=>(B(),H(dT,{key:e.id,id:`vault-item-${e.id}`,variant:`vault`,selected:String(z(r)?.id)===String(e.id),draft:F(e).isDraft,onClick:t=>Oe(e),onContextmenu:ld(t=>N(t,e),[`prevent`])},{default:qr(()=>[U(`div`,ST,[q(z(Im),{size:14,class:`item-icon`}),q(Bw,{evaluated:F(e)},null,8,[`evaluated`])]),U(`div`,CT,[I.value?(B(),V(`span`,wT,L(e.contentType||e.nodeType||`node`),1)):G(``,!0),U(`span`,{class:`item-title`,title:A(e)},L(A(e)),9,TT),U(`div`,ET,[Se(e)?(B(),V(`span`,{key:0,class:`sort-field-tag`,title:`${Ce.value}: ${Se(e)}`},L(Se(e)),9,DT)):G(``,!0),ge(e)?(B(),V(`span`,OT,[q(z(Rm),{size:11})])):G(``,!0),e.assetCount&&e.assetCount>0?(B(),V(`span`,{key:2,class:`asset-tag-icon`,title:`Has ${e.assetCount} linked asset(s)`},[q(z(Km),{size:11}),U(`span`,AT,L(e.assetCount),1)],8,kT)):G(``,!0)])]),F(e).isDraft?G(``,!0):(B(),V(`div`,{key:0,class:w([`node-actions`,{"menu-open":ae.value===String(e.id)}])},[U(`button`,{class:`action-btn`,title:`Options`,onClick:ld(t=>de(t,e),[`stop`])},[q(z(jm),{size:14})],8,jT)],2))]),_:2},1032,[`id`,`selected`,`draft`,`onClick`,`onContextmenu`]))),128))])):z(_)?G(``,!0):(B(),V(`div`,MT,[U(`p`,null,L(E.value?`No items use this asset.`:x.value.length===0?`No content items in vault.`:`No items matching selected types.`),1),E.value?G(``,!0):(B(),V(`button`,{key:0,class:`primary-btn`,onClick:ke},[q(z(gh),{size:13}),t[5]||=W(` Add Content `,-1)]))])),U(`div`,{ref_key:`scrollSentinel`,ref:D,class:`scroll-sentinel`},[z(_)?(B(),V(`span`,NT,`Loading items...`)):!z(v)&&xe.value.length>0?(B(),V(`span`,PT,`All items loaded`)):G(``,!0)],512)],512),q(tg,{show:oe.value&&!!M.value,"anchor-rect":le.value,x:se.value,y:ce.value,items:he.value,onSelect:fe,onClose:ue},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])]))}}),[[`__scopeId`,`data-v-f0afc47d`]]);function IT(e,t){if(!e)return``;if(!e.includes(`/media/`))return e;try{let n=new URL(e,window.location.origin);return t.w&&n.searchParams.set(`w`,String(t.w)),t.h&&n.searchParams.set(`h`,String(t.h)),n.searchParams.set(`q`,String(t.q||75)),n.searchParams.set(`f`,String(t.f||`auto`)),n.pathname+n.search}catch{return e}}var LT={class:`cms-image-preview`},RT=[`src`,`alt`],zT={key:1,class:`loading-overlay`},BT=Yh(vi({__name:`CmsImagePreview`,props:{url:{},alt:{default:`Image preview`},width:{default:800},quality:{default:85},isProcessing:{type:Boolean,default:!1}},setup(e){let t=e,n=R(!1),r=R(null),i=J(()=>{if(!t.url)return!1;let e=t.url.toLowerCase();return e.endsWith(`.svg`)||e.includes(`image/svg+xml`)||e.includes(`.svg?`)});ni(()=>t.url,(e,t)=>{e&&e!==t&&(n.value=!0,r.value=null)});let a=()=>{n.value=!1},o=()=>{if(r.value!==t.url&&s.value!==t.url){r.value=t.url,n.value=!0;return}n.value=!1},s=J(()=>t.url?i.value||r.value===t.url?t.url:IT(t.url,{w:t.width,q:t.quality}):``);return(t,r)=>(B(),V(`div`,LT,[s.value?(B(),V(`img`,{key:0,src:s.value,alt:e.alt,class:w([`preview-img`,{"is-blurring":e.isProcessing||n.value,"is-svg":i.value}]),onLoad:a,onError:o},null,42,RT)):G(``,!0),e.isProcessing||n.value?(B(),V(`div`,zT,[q(z(nh),{size:16,class:`spinner`})])):G(``,!0)]))}}),[[`__scopeId`,`data-v-2d18a75f`]]),VT=[`disabled`],HT=Yh(vi({__name:`CmsButton`,props:{variant:{},size:{},disabled:{type:Boolean}},setup(e){return(t,n)=>(B(),V(`button`,{class:w([`cms-btn`,`btn-${e.variant||`primary`}`,e.size===`sm`?`btn-sm`:`btn-md`]),disabled:e.disabled},[Qi(t.$slots,`default`,{},void 0,!0)],10,VT))}}),[[`__scopeId`,`data-v-371ae993`]]),UT={key:0,class:`collision-overlay`},WT={class:`collision-card`},GT={class:`collision-header`},KT={class:`collision-body`},qT={key:0,class:`collision-warning`},JT={class:`collision-actions`},YT={key:1,class:`drag-overlay`},XT={class:`fixed-media-controls`},ZT={class:`search-bar`},QT={class:`filter-bar`},$T={class:`pane-header`},eE={class:`sort-wrapper`},tE=[`title`],nE={class:`sort-label`},rE={key:0,class:`uploading-banner`},iE={key:1,class:`media-list`},aE={key:0,class:`thumb-wrapper`},oE={key:1,class:`doc-wrapper`},sE={class:`item-details`},cE=[`title`],lE={class:`meta-row`},uE=[`title`],dE={class:`count-text`},fE=[`title`],pE={class:`count-text`},mE={key:2,class:`meta-size`},hE=[`onClick`],gE={key:0,class:`empty-sub`},_E={key:0,class:`loading-text`},vE={key:1,class:`end-text`},yE=Yh(vi({__name:`MediaOperations`,setup(e){let{confirmDiscard:t}=Fd(),{setViewMode:n,selectedChannelId:r}=sp(),i=R([]),a=R(!1),o=R(!1),s=R(!1),c=R(0),l=R(!1),u=R(1),d=R(``),f=R(`all`),p=R(`createdAt`),m=R(!0),h=R(null),g=R(``),_=R(null),v=R(null),y=R(null),b=null,x=null,S=R(null),C=R(null),T=R(!1),E=[{id:`createdAt`,label:`Upload Date`},{id:`updatedAt`,label:`Last Modified`},{id:`filename`,label:`Filename`},{id:`mimeType`,label:`Type`}],D=R(!1),O=R(null),k=R(null),ee=()=>{if(D.value){D.value=!1;return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),O.value&&(k.value=O.value.getBoundingClientRect()),D.value=!0},A=e=>{p.value=String(e),D.value=!1,_.value&&(_.value.scrollTop=0),_e(!0)},te=J(()=>E.map(e=>({key:e.id,label:e.label,isActive:p.value===e.id}))),ne=J(()=>{let e=E.find(e=>String(e.id)===String(p.value));return e?e.label:p.value}),re=R(!1),ie=R(void 0),j=R(void 0),ae=R(null),oe=R(null),se=()=>{re.value=!1,oe.value=null,ae.value=null,ie.value=void 0,j.value=void 0},ce=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),re.value&&oe.value?.id===t.id){se();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),oe.value=t,h.value=t.id;let n=e.currentTarget;n&&(ae.value=n.getBoundingClientRect()),ie.value=void 0,j.value=void 0,re.value=!0},le=(e,t)=>{e.preventDefault(),e.stopPropagation(),re.value&&oe.value?.id===t.id&&se(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),oe.value=t,h.value=t.id,ae.value=null,ie.value=e.clientX,j.value=e.clientY,re.value=!0},M=()=>{re.value&&se(),D.value&&=!1},ue=J(()=>{let e=[{key:`copy-url`,label:`Copy Public URL`,icon:Dm},{key:`open-tab`,label:`Open in New Tab`,icon:Mm}],t=oe.value;return t&&t.usageCount&&t.usageCount>0&&(e.push({key:`div-nodes`,label:``,divider:!0}),e.push({key:`show-nodes`,label:`Connected Nodes (${t.usageCount})`,icon:eh})),e.push({key:`div-1`,label:``,divider:!0},{key:`delete`,label:`Delete Asset`,icon:Ah}),e}),de=async e=>{let n=oe.value;se(),n&&(window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`copy-url`?n.url&&await navigator.clipboard.writeText(n.url):e===`open-tab`?n.url&&window.open(n.url,`_blank`):e===`delete`?await t(`Are you sure you want to delete "${n.filename||`this asset`}"? This will move it to the trash bin.`,`Delete Asset?`,`Delete`,`Cancel`)&&await ve(n.id):e===`show-nodes`&&(sessionStorage.setItem(`cms-vault-asset-filter`,n.id),window.dispatchEvent(new CustomEvent(`cms-filter-vault-by-asset`,{detail:n.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`vault`}))))},N=e=>{let t=e?.size??e?.bytes??e?.fileSize??e?.sizeBytes;if(t==null||isNaN(Number(t))||Number(t)<=0)return``;let n=Number(t);return n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`},P=(e,t)=>{e.dataTransfer&&(e.dataTransfer.setData(`application/cms-asset`,JSON.stringify(t)),e.dataTransfer.setData(`text/plain`,t.url),e.dataTransfer.effectAllowed=`copy`)},fe=()=>{y.value?.click()},pe=e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),c.value++,s.value=!0)},me=e=>{e.preventDefault(),e.stopPropagation(),c.value--,c.value<=0&&(c.value=0,s.value=!1)},he=e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),s.value=!0)},F=async e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),c.value=0,s.value=!1,e.dataTransfer?.files&&e.dataTransfer.files.length>0&&await ge(Array.from(e.dataTransfer.files)))},I=async e=>{let t=e.target;t.files&&t.files.length>0&&await ge(Array.from(t.files)),y.value&&(y.value.value=``)},ge=async e=>{if(e.length!==0){o.value=!0;for(let t of e)try{let e=`new`,n=null,r=await fetch(`/api/admin/assets?search=${encodeURIComponent(t.name)}&limit=1`);if(r.ok){let i=(await r.json()).find(e=>e.filename===t.name);if(i){if(S.value={file:t,existingAsset:i},T.value=!0,e=await new Promise(e=>{C.value=e}),T.value=!1,S.value=null,e===`skip`)continue;e===`replace`&&(n=i.id)}}let a=new FormData;a.append(`file`,t,t.name),n&&a.append(`replaceAssetId`,n);let o=await fetch(`/api/admin/assets/upload`,{method:`POST`,body:a});if(o.ok){let e=await o.json();if(n){let r=i.value.findIndex(e=>e.id===n);r!==-1&&(i.value[r].url=`${e.url}?_t=${Date.now()}`,i.value[r].size=e.size||e.bytes||e.sizeBytes||t.size)}else i.value.unshift({id:e.id,filename:e.filename||t.name,mimeType:e.mimeType||t.type,size:e.size||e.bytes||e.sizeBytes||t.size,url:e.url,usageCount:0});window.dispatchEvent(new CustomEvent(`cms-assets-updated`))}}catch(e){console.error(`Failed to upload file from media pane:`,e)}o.value=!1}},_e=async(e=!1)=>{if(!a.value){a.value=!0,e&&(u.value=1,i.value=[]);try{let t=new URLSearchParams({page:String(u.value),limit:`24`,search:d.value,type:f.value,sort:p.value,order:m.value?`DESC`:`ASC`});r.value&&r.value!==`all`&&t.append(`channelId`,String(r.value)),g.value&&t.append(`nodeId`,g.value);let n=await fetch(`/api/admin/assets?${t.toString()}`);if(n.ok){let t=await n.json(),r=(Array.isArray(t)?t:t.items||t.assets||t.data||[]).map(e=>({...e,url:e.url||e.cdnUrl||`/media/${e.storageKeyPrivate||``}`,usageCount:e.usageCount||0,variantCount:e.variantCount||0,size:e.size??e.bytes??e.fileSize??e.sizeBytes??0,title:e.title||``,alt:e.alt||``}));i.value=e?r:[...i.value,...r],l.value=r.length>=24,u.value++}}catch(e){console.error(`Failed to load assets:`,e)}finally{a.value=!1}}},ve=async e=>{try{(await fetch(`/api/admin/assets/${e}`,{method:`DELETE`})).ok&&(i.value=i.value.filter(t=>t.id!==e),window.dispatchEvent(new CustomEvent(`cms-assets-updated`)))}catch(e){console.error(`Failed to delete asset:`,e)}},ye=()=>{Te(),x&&clearTimeout(x),x=setTimeout(()=>{_.value&&(_.value.scrollTop=0),_e(!0)},300)},be=()=>{m.value=!m.value,_.value&&(_.value.scrollTop=0),_e(!0)},xe=e=>{Te(),f.value=e,_.value&&(_.value.scrollTop=0),_e(!0)},Se=(e,t)=>e?e.startsWith(`image/`):/\.(jpg|jpeg|png|webp|gif|svg)$/i.test(t||``),Ce=async e=>{h.value=e.id,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),sp().activeView.value={type:`asset`,id:e.id}},we=e=>{g.value=e.detail,d.value=``,f.value=`all`,_.value&&(_.value.scrollTop=0),_e(!0)},Te=()=>{g.value=``},Ee=()=>{_e(!0)};return ni(r,()=>{_.value&&(_.value.scrollTop=0),_e(!0)}),Js(()=>{window.addEventListener(`cms-close-tree-menus`,M),window.addEventListener(`cms-filter-media-by-node`,we),window.addEventListener(`cms-assets-updated`,Ee),window.addEventListener(`cms-node-updated`,Ee);let e=sessionStorage.getItem(`cms-media-node-filter`);e&&(g.value=e,sessionStorage.removeItem(`cms-media-node-filter`)),_e(!0),b=new IntersectionObserver(e=>{e[0].isIntersecting&&l.value&&!a.value&&_e(!1)},{root:_.value,rootMargin:`100px`,threshold:.1}),v.value&&b.observe(v.value)}),Qs(()=>{window.removeEventListener(`cms-close-tree-menus`,M),window.removeEventListener(`cms-filter-media-by-node`,we),window.removeEventListener(`cms-assets-updated`,Ee),window.removeEventListener(`cms-node-updated`,Ee),b&&b.disconnect(),x&&clearTimeout(x)}),(e,t)=>(B(),V(`div`,{class:w([`media-pane`,{"is-dragging":s.value}]),onDragenter:ld(pe,[`prevent`]),onDragleave:ld(me,[`prevent`]),onDragover:ld(he,[`prevent`]),onDrop:ld(F,[`prevent`])},[T.value?(B(),V(`div`,UT,[U(`div`,WT,[U(`div`,GT,[q(z(jh),{size:20,class:`text-warning`}),t[10]||=U(`h3`,null,`File Already Exists`,-1)]),U(`div`,KT,[U(`p`,null,[t[11]||=W(`A file named `,-1),U(`strong`,null,L(S.value?.file.name),1),t[12]||=W(` is already in the media library.`,-1)]),S.value?.existingAsset?.usageCount>0||S.value?.existingAsset?.variantCount>0?(B(),V(`p`,qT,[t[16]||=W(` This image is `,-1),S.value.existingAsset.usageCount>0?(B(),V(K,{key:0},[t[13]||=W(` used on `,-1),U(`strong`,null,L(S.value.existingAsset.usageCount),1),t[14]||=W(` page(s) `,-1)],64)):G(``,!0),S.value.existingAsset.usageCount>0&&S.value.existingAsset.variantCount>0?(B(),V(K,{key:1},[W(` and has `)],64)):G(``,!0),S.value.existingAsset.variantCount>0?(B(),V(K,{key:2},[U(`strong`,null,L(S.value.existingAsset.variantCount),1),t[15]||=W(` crop variant(s) `,-1)],64)):G(``,!0),t[17]||=W(`. `,-1)])):G(``,!0)]),U(`div`,JT,[q(HT,{variant:`secondary`,onClick:t[0]||=e=>C.value?.(`skip`)},{default:qr(()=>[...t[18]||=[W(`Skip File`,-1)]]),_:1}),q(HT,{variant:`secondary`,onClick:t[1]||=e=>C.value?.(`new`)},{default:qr(()=>[...t[19]||=[W(`Upload as New (Keep Both)`,-1)]]),_:1}),q(HT,{variant:`primary`,onClick:t[2]||=e=>C.value?.(`replace`)},{default:qr(()=>[...t[20]||=[W(`Replace Master & Update Crops`,-1)]]),_:1})])])])):G(``,!0),U(`input`,{ref_key:`fileInputRef`,ref:y,type:`file`,multiple:``,class:`hidden-file-input`,onChange:I},null,544),s.value?(B(),V(`div`,YT,[q(z(wm),{size:32,class:`drop-icon`}),t[21]||=U(`span`,null,`Drop files to upload`,-1)])):G(``,!0),U(`div`,XT,[U(`div`,ZT,[q(z(xh),{size:13,class:`search-icon`}),Jr(U(`input`,{"onUpdate:modelValue":t[3]||=e=>d.value=e,type:`text`,placeholder:`Filter media library...`,class:`search-input`,onInput:ye},null,544),[[nd,d.value]])]),U(`div`,QT,[U(`button`,{class:w([`filter-pill`,{active:f.value===`all`&&!g.value}]),onClick:t[4]||=e=>xe(`all`)},` All `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`image`}]),onClick:t[5]||=e=>xe(`image`)},` Images `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`document`}]),onClick:t[6]||=e=>xe(`document`)},` Docs `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`video`}]),onClick:t[7]||=e=>xe(`video`)},` Media `,2)]),U(`div`,$T,[U(`div`,eE,[U(`button`,{class:`pane-icon-btn`,title:m.value?`Sort Descending`:`Sort Ascending`,onClick:be},[m.value?(B(),H(z(am),{key:0,size:13})):(B(),H(z(cm),{key:1,size:13}))],8,tE),U(`div`,{class:`sort-dropdown-wrapper`,ref_key:`sortMenuTriggerRef`,ref:O},[U(`button`,{class:`sort-trigger-btn`,title:`Change Sort Order`,onClick:ee},[U(`span`,nE,L(ne.value),1),q(z(_m),{size:13,class:`sort-chevron`})]),q(tg,{show:D.value,items:te.value,"anchor-rect":k.value,"min-width":`160px`,onSelect:A,onClose:t[8]||=e=>D.value=!1},null,8,[`show`,`items`,`anchor-rect`])],512)]),U(`button`,{class:`pane-icon-btn add-content-btn`,title:`Upload Media`,onClick:fe},[q(z(gh),{size:14})])])]),g.value?(B(),V(`div`,{key:2,class:`node-filter-banner`,title:`Clear filter`,onClick:t[9]||=e=>{Te(),_e(!0)}},` Showing assets used by selected node ✕ `)):G(``,!0),U(`div`,{ref_key:`scrollContainer`,ref:_,class:`media-scroll-area`},[o.value?(B(),V(`div`,rE,[q(z(nh),{size:14,class:`spin`}),t[22]||=U(`span`,null,`Uploading files...`,-1)])):G(``,!0),i.value.length>0?(B(),V(`div`,iE,[(B(!0),V(K,null,Xi(i.value,e=>(B(),H(dT,{key:e.id,variant:`media`,selected:h.value===e.id,draggable:`true`,onDragstart:t=>P(t,e),onClick:t=>Ce(e),onContextmenu:ld(t=>le(t,e),[`prevent`])},{default:qr(()=>[Se(e.mimeType,e.filename)?(B(),V(`div`,aE,[q(BT,{url:e.url,alt:e.alt||e.filename,width:120,quality:75},null,8,[`url`,`alt`])])):(B(),V(`div`,oE,[q(z(Im),{size:18,class:`doc-icon`})])),U(`div`,sE,[U(`span`,{class:`file-name`,title:e.filename},L(e.filename||`Asset`),9,cE),U(`div`,lE,[e.usageCount>0?(B(),V(`span`,{key:0,class:`node-tag-icon`,title:`Used in ${e.usageCount} node(s)`},[q(z(eh),{size:12}),U(`span`,dE,L(e.usageCount),1)],8,uE)):G(``,!0),e.variantCount>0?(B(),V(`span`,{key:1,class:`node-tag-icon variant-tag`,title:`Has ${e.variantCount} crop variant(s)`},[q(z(km),{size:12}),U(`span`,pE,L(e.variantCount),1)],8,fE)):G(``,!0),N(e)?(B(),V(`span`,mE,L(N(e)),1)):G(``,!0)])]),U(`div`,{class:w([`item-actions`,{"menu-open":re.value&&oe.value?.id===e.id}])},[U(`button`,{class:`more-btn`,title:`Asset Options`,onClick:ld(t=>ce(t,e),[`stop`])},[q(z(jm),{size:14})],8,hE)],2)]),_:2},1032,[`selected`,`onDragstart`,`onClick`,`onContextmenu`]))),128))])):!a.value&&!o.value?(B(),V(`div`,{key:2,class:`empty-media-state`,onClick:fe},[q(z(wm),{size:24,class:`empty-icon`}),U(`p`,null,L(g.value?`No assets used by this node.`:`No media files found.`),1),g.value?G(``,!0):(B(),V(`span`,gE,`Drop images or click to upload`))])):G(``,!0),U(`div`,{ref_key:`scrollSentinel`,ref:v,class:`scroll-sentinel`},[a.value&&u.value>1?(B(),V(`span`,_E,[q(z(nh),{size:12,class:`spin`}),t[23]||=W(` Loading assets... `,-1)])):!l.value&&i.value.length>0?(B(),V(`span`,vE,`All media loaded`)):G(``,!0)],512)],512),q(tg,{show:re.value&&!!oe.value,"anchor-rect":ae.value,x:ie.value,y:j.value,items:ue.value,onSelect:de,onClose:se},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])],34))}}),[[`__scopeId`,`data-v-aeb1381b`]]),bE={class:`panel-tree`},xE={class:`segmented-control`},SE={class:`pane-wrapper`},CE={class:`sidebar-footer`},wE=Yh(vi({__name:`SidebarLeft`,setup(e){let{setViewMode:t,activeViewMode:n}=sp(),r=Zh(`kama_sidebar_tab`,`tree`),i=async()=>{await t(`trash`)},a=e=>{let t=e.detail;(t===`tree`||t===`vault`||t===`media`)&&(r.value=t)};return Js(()=>{window.addEventListener(`cms-switch-sidebar-tab`,a)}),Qs(()=>{window.removeEventListener(`cms-switch-sidebar-tab`,a)}),(e,t)=>(B(),V(`aside`,bE,[q(ig),U(`div`,xE,[U(`button`,{class:w([`tab-btn`,{active:z(r)===`tree`}]),onClick:t[0]||=e=>r.value=`tree`},[q(z(Rm),{size:13,class:`tab-icon`}),t[3]||=U(`span`,null,`Tree`,-1)],2),U(`button`,{class:w([`tab-btn`,{active:z(r)===`vault`}]),onClick:t[1]||=e=>r.value=`vault`},[q(z(Am),{size:13,class:`tab-icon`}),t[4]||=U(`span`,null,`Vault`,-1)],2),U(`button`,{class:w([`tab-btn`,{active:z(r)===`media`}]),onClick:t[2]||=e=>r.value=`media`},[q(z(Km),{size:13,class:`tab-icon`}),t[5]||=U(`span`,null,`Media`,-1)],2)]),U(`div`,SE,[z(r)===`tree`?(B(),H(lT,{key:0})):z(r)===`vault`?(B(),H(FT,{key:1})):z(r)===`media`?(B(),H(yE,{key:2})):G(``,!0)]),U(`div`,CE,[U(`button`,{class:w([`trash-btn`,{"is-active":z(n)===`trash`}]),onClick:i},[q(z(Ah),{size:14,class:`trash-icon`}),t[6]||=U(`span`,null,`Trash Bin`,-1)],2)])]))}}),[[`__scopeId`,`data-v-aa44c59c`]]),TE=gn(null),EE=R(null);function DE(){return{activeEditor:TE,activeToolbar:EE,setActiveEditor:(e,t)=>{TE.value=e,EE.value=t},clearActiveEditor:e=>{e&&TE.value!==e||(TE.value=null,EE.value=null)},splitActiveBlock:()=>{TE.value&&typeof TE.value.cmsSplitBlock==`function`&&TE.value.cmsSplitBlock()}}}function OE(e){this.content=e}OE.prototype={constructor:OE,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new OE(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new OE(n)},addToStart:function(e,t){return new OE([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new OE(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new OE(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=OE.from(e),e.size?new OE(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=OE.from(e),e.size?new OE(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=OE.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},OE.from=function(e){if(e instanceof OE)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new OE(t)};function kE(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ME(e.charCodeAt(r-1))&&jE(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=kE(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function AE(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ME(e.charCodeAt(i-1))&&jE(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=AE(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function jE(e){return e>=56320&&e<57344}function ME(e){return e>=55296&&e<56320}var Z=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return kE(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return AE(this,e,t,n)}findIndex(e){if(e==0)return PE(0,e);if(e==this.size)return PE(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?PE(t+1,i):PE(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Z.empty=new Z([],0);var NE={index:0,offset:0};function PE(e,t){return NE.index=e,NE.offset=t,NE}function FE(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!FE(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!FE(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var IE=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&FE(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};IE.none=[];var LE=class extends Error{},Q=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zE(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(RE(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Z.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Q.empty=new Q(Z.empty,0,0);function RE(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(RE(a.content,t-i-1,n-i-1)))}function zE(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=zE(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function BE(e,t,n){if(n.openStart>e.depth)throw new LE(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new LE(`Inconsistent open depths`);return VE(e,t,n,0)}function VE(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=VE(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return KE(a,JE(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return KE(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=YE(n,e);return KE(a,qE(e,i,o,t,r))}}function HE(e,t){if(!t.type.compatibleContent(e.type))throw new LE(`Cannot join `+t.type.name+` onto `+e.type.name)}function UE(e,t,n){let r=e.node(n);return HE(r,t.node(n)),r}function WE(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function GE(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(WE(e.nodeAfter,r),a++));for(let e=a;e<o;e++)WE(i.child(e),r);t&&t.depth==n&&t.textOffset&&WE(t.nodeBefore,r)}function KE(e,t){if(!e.type.validContent(t))throw new LE(`Invalid content for node `+e.type.name);return e.copy(t)}function qE(e,t,n,r,i){let a=e.depth>i&&UE(e,t,i+1),o=r.depth>i&&UE(n,r,i+1),s=[];return GE(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(HE(a,o),WE(KE(a,qE(e,t,n,r,i+1)),s)):(a&&WE(KE(a,JE(e,t,i+1)),s),GE(t,n,i,s),o&&WE(KE(o,JE(n,r,i+1)),s)),GE(r,null,i,s),new Z(s)}function JE(e,t,n){let r=[];return GE(null,e,n,r),e.depth>n&&WE(KE(UE(e,t,n+1),JE(e,t,n+1)),r),GE(t,null,n,r),new Z(r)}function YE(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Z.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var XE=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return IE.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new eD(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=$E.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else $E.set(t,r=new ZE);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%QE,i}},ZE=class{constructor(){this.elts=[],this.i=0}},QE=12,$E=new WeakMap,eD=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},tD=Object.create(null),nD=class e{constructor(e,t,n,r=IE.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&FE(this.attrs,t||e.defaultAttrs||tD)&&IE.sameSet(this.marks,n||IE.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Q.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Q(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return BE(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return XE.resolveCached(this,e)}resolveNoCache(e){return XE.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),iD(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Z.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=IE.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!IE.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Z.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};nD.prototype.text=void 0;var rD=class e extends nD{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iD(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function iD(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var aD=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new oD(t,n);if(r.next==null)return e.empty;let i=sD(r);r.next&&r.err(`Unexpected trailing text`);let a=_D(mD(i));return vD(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Z.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(e){return h(e)||g(e)||f(e)||_()}var y=n(`a352`),b=n.n(y);function x(e){e.parentElement!==null&&e.parentElement.removeChild(e)}function S(e,t,n){var r=n===0?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}var C=n(`dbf1`);n(`13d5`),n(`4fad`),n(`ac1f`),n(`5319`);function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var T=/-(\w)/g,E=w(function(e){return e.replace(T,function(e,t){return t.toUpperCase()})});n(`5db7`),n(`73d9`);var D=[`Start`,`Add`,`Remove`,`Update`,`End`],O=[`Choose`,`Unchoose`,`Sort`,`Filter`,`Clone`],k=[`Move`],ee=[k,D,O].flatMap(function(e){return e}).map(function(e){return`on${e}`}),A={manage:k,manageAndEmit:D,emit:O};function te(e){return ee.indexOf(e)!==-1}n(`caad`),n(`2ca0`);var ne=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.math.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function re(e){return ne.includes(e)}function ie(e){return[`transition-group`,`TransitionGroup`].includes(e)}function j(e){return[`id`,`class`,`role`,`style`].includes(e)||e.startsWith(`data-`)||e.startsWith(`aria-`)||e.startsWith(`on`)}function ae(e){return e.reduce(function(e,t){var n=m(t,2),r=n[0];return e[r]=n[1],e},{})}function oe(e){var t=e.$attrs,n=e.componentData,r=n===void 0?{}:n;return c(c({},ae(Object.entries(t).filter(function(e){var t=m(e,2),n=t[0];return t[1],j(n)}))),r)}function se(e){var t=e.$attrs,n=e.callBackBuilder,r=ae(ce(t));Object.entries(n).forEach(function(e){var t=m(e,2),n=t[0],i=t[1];A[n].forEach(function(e){r[`on${e}`]=i(e)})});var i=`[data-draggable]${r.draggable||``}`;return c(c({},r),{},{draggable:i})}function ce(e){return Object.entries(e).filter(function(e){var t=m(e,2),n=t[0];return t[1],!j(n)}).map(function(e){var t=m(e,2),n=t[0],r=t[1];return[E(n),r]}).filter(function(e){var t=m(e,2),n=t[0];return t[1],!te(n)})}n(`c740`);function le(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ue(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}var de=function(e){return e.el},N=function(e,t){return e.__draggable_context=t},P=function(e){return e.__draggable_context},fe=function(){function e(t){var n=t.nodes,r=n.header,i=n.default,a=n.footer,o=t.root,s=t.realList;le(this,e),this.defaultNodes=i,this.children=[].concat(v(r),v(i),v(a)),this.externalComponent=o.externalComponent,this.rootTransition=o.transition,this.tag=o.tag,this.realList=s}return ue(e,[{key:`render`,value:function(e,t){var n=this.tag,r=this.children;return e(n,t,this._isRootComponent?{default:function(){return r}}:r)}},{key:`updated`,value:function(){var e=this.defaultNodes,t=this.realList;e.forEach(function(e,n){N(de(e),{element:t[n],index:n})})}},{key:`getUnderlyingVm`,value:function(e){return P(e)}},{key:`getVmIndexFromDomIndex`,value:function(e,t){var n=this.defaultNodes,r=n.length,i=t.children,a=i.item(e);if(a===null)return r;var o=P(a);if(o)return o.index;if(r===0)return 0;var s=de(n[0]);return e<v(i).findIndex(function(e){return e===s})?0:r}},{key:`_isRootComponent`,get:function(){return this.externalComponent||this.rootTransition}}]),e}(),pe=n(`8bbf`);function me(e,t){var n=e[t];return n?n():[]}function he(e){var t=e.$slots,n=e.realList,r=e.getKey,i=n||[],a=m([`header`,`footer`].map(function(e){return me(t,e)}),2),o=a[0],s=a[1],l=t.item;if(!l)throw Error(`draggable element must have an item slot`);var u=i.flatMap(function(e,t){return l({element:e,index:t}).map(function(t){return t.key=r(e),t.props=c(c({},t.props||{}),{},{"data-draggable":!0}),t})});if(u.length!==i.length)throw Error(`Item slot must have only one child`);return{header:o,footer:s,default:u}}function F(e){var t=ie(e),n=!re(e)&&!t;return{transition:t,externalComponent:n,tag:n?(0,pe.resolveComponent)(e):t?pe.TransitionGroup:e}}function I(e){var t=e.$slots,n=e.tag,r=e.realList,i=e.getKey;return new fe({nodes:he({$slots:t,realList:r,getKey:i}),root:F(n),realList:r})}function ge(e,t){var n=this;(0,pe.nextTick)(function(){return n.$emit(e.toLowerCase(),t)})}function _e(e){var t=this;return function(n,r){if(t.realList!==null)return t[`onDrag${e}`](n,r)}}function ve(e){var t=this,n=_e.call(this,e);return function(r,i){n.call(t,r,i),ge.call(t,e,r)}}var ye=null,be={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(e){return e}},tag:{type:String,default:`div`},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},xe=[`update:modelValue`,`change`].concat(v([].concat(v(A.manageAndEmit),v(A.emit)).map(function(e){return e.toLowerCase()})));t.default=(0,pe.defineComponent)({name:`draggable`,inheritAttrs:!1,props:be,emits:xe,data:function(){return{error:!1}},render:function(){try{this.error=!1;var e=this.$slots,t=this.$attrs,n=this.tag,r=this.componentData,i=this.realList,a=this.getKey,o=I({$slots:e,tag:n,realList:i,getKey:a});this.componentStructure=o;var s=oe({$attrs:t,componentData:r});return o.render(pe.h,s)}catch(e){return this.error=!0,(0,pe.h)(`pre`,{style:{color:`red`}},e.stack)}},created:function(){this.list!==null&&this.modelValue!==null&&C.a.error(`modelValue and list props are mutually exclusive! Please set one or another.`)},mounted:function(){var e=this;if(!this.error){var t=this.$attrs,n=this.$el;this.componentStructure.updated();var r=se({$attrs:t,callBackBuilder:{manageAndEmit:function(t){return ve.call(e,t)},emit:function(t){return ge.bind(e,t)},manage:function(t){return _e.call(e,t)}}}),i=n.nodeType===1?n:n.parentElement;this._sortable=new b.a(i,r),this.targetDomElement=i,i.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList:function(){return this.list||this.modelValue},getKey:function(){var e=this.itemKey;return typeof e==`function`?e:function(t){return t[e]}}},watch:{$attrs:{handler:function(e){var t=this._sortable;t&&ce(e).forEach(function(e){var n=m(e,2),r=n[0],i=n[1];t.option(r,i)})},deep:!0}},methods:{getUnderlyingVm:function(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent:function(e){return e.__draggable_component__},emitChanges:function(e){var t=this;(0,pe.nextTick)(function(){return t.$emit(`change`,e)})},alterList:function(e){if(this.list){e(this.list);return}var t=v(this.modelValue);e(t),this.$emit(`update:modelValue`,t)},spliceList:function(){var e=arguments;this.alterList(function(t){return t.splice.apply(t,v(e))})},updatePosition:function(e,t){this.alterList(function(n){return n.splice(t,0,n.splice(e,1)[0])})},getRelatedContextFromMoveEvent:function(e){var t=e.to,n=e.related,r=this.getUnderlyingPotencialDraggableComponent(t);if(!r)return{component:r};var i=r.realList,a={list:i,component:r};return t!==n&&i?c(c({},r.getUnderlyingVm(n)||{}),a):a},getVmIndexFromDomIndex:function(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),ye=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(t!==void 0){x(e.item);var n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);var r={element:t,newIndex:n};this.emitChanges({added:r})}},onDragRemove:function(e){if(S(this.$el,e.item,e.oldIndex),e.pullMode===`clone`){x(e.clone);return}var t=this.context,n=t.index,r=t.element;this.spliceList(n,1);var i={element:r,oldIndex:n};this.emitChanges({removed:i})},onDragUpdate:function(e){x(e.item),S(e.from,e.item,e.oldIndex);var t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);var r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex:function(e,t){if(!e.element)return 0;var n=v(t.to.children).filter(function(e){return e.style.display!==`none`}),r=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(r);return n.indexOf(ye)!==-1||!t.willInsertAfter?i:i+1},onDragMove:function(e,t){var n=this.move,r=this.realList;if(!n||!r)return!0;var i=this.getRelatedContextFromMoveEvent(e),a=this.computeFutureIndex(i,e),o=c(c({},this.context),{},{futureIndex:a});return n(c(c({},e),{},{relatedContext:i,draggedContext:o}),t)},onDragEnd:function(){ye=null}}})}),fb6a:(function(e,t,n){var r=n(`23e7`),i=n(`861d`),a=n(`e8b5`),o=n(`23cb`),s=n(`50c4`),c=n(`fc6a`),l=n(`8418`),u=n(`b622`),d=n(`1dde`),f=n(`ae40`),p=d(`slice`),m=f(`slice`,{ACCESSORS:!0,0:0,1:2}),h=u(`species`),g=[].slice,_=Math.max;r({target:`Array`,proto:!0,forced:!p||!m},{slice:function(e,t){var n=c(this),r=s(n.length),u=o(e,r),d=o(t===void 0?r:t,r),f,p,m;if(a(n)&&(f=n.constructor,typeof f==`function`&&(f===Array||a(f.prototype))?f=void 0:i(f)&&(f=f[h],f===null&&(f=void 0)),f===Array||f===void 0))return g.call(n,u,d);for(p=new(f===void 0?Array:f)(_(d-u,0)),m=0;u<d;u++,m++)u in n&&l(p,m,n[u]);return p.length=m,p}})}),fc6a:(function(e,t,n){var r=n(`44ad`),i=n(`1d80`);e.exports=function(e){return r(i(e))}}),fdbc:(function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),fdbf:(function(e,t,n){e.exports=n(`4930`)&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})}).default})}))(),1),Iw={key:0,class:`badges-container`},Lw={key:0,class:`overlay-badge badge-disabled`,title:`Page is disabled`},Rw=[`title`],zw={key:1,class:`overlay-badge badge-unpublished`,title:`Has draft changes`},Bw=Yh(vi({__name:`NodeStatusBadges`,props:{evaluated:{}},setup(e){return(t,n)=>e.evaluated.isDraft?G(``,!0):(B(),V(`div`,Iw,[e.evaluated.isHidden?(B(),V(`div`,Lw,[q(z(lm),{size:10,"stroke-width":`2.5`})])):(B(),V(K,{key:1},[e.evaluated.isScheduled?(B(),V(`div`,{key:0,class:`overlay-badge badge-scheduled`,title:`Status: ${e.evaluated.badgeLabel}`},[q(z(Cm),{size:10,"stroke-width":`2.5`})],8,Rw)):G(``,!0),e.evaluated.hasUnpublishedChanges||e.evaluated.isUnpublishedDraft?(B(),V(`div`,zw,[q(z(mh),{size:10,"stroke-width":`2.5`})])):G(``,!0)],64))]))}}),[[`__scopeId`,`data-v-7b0de368`]]),Vw={class:`tree-item-wrapper`},Hw={key:1,class:`toggle-placeholder`},Uw=[`title`],Ww=[`title`],Gw={key:0,class:`nested-tree`},Kw=Yh(vi({__name:`NodeTreeItem`,props:{node:{},activeId:{},treeId:{}},emits:[`select-node`,`add-child`,`add-sibling`,`delete-node`,`tree-change`],setup(e,{emit:t}){let n=e,r=t,i=sp(),{detachTreeNode:a}=Mp(),{treeEligibleNodeTypes:o,toggleNodeVisibility:s,deleteNode:c}=Yp(),{confirmDiscard:l}=Fd(),u=R(!0),d=()=>{u.value=!u.value},f=J(()=>{let e=i.nodeSchemas.value[n.node.nodeType],t=Ep(e,{...n.node,...n.node.dataJson||{}});return t.startsWith(`Untitled`)&&m.value.isDraft?t+`...`:t}),p=J(()=>{let e=i.activeNode.value;if(!e||!e.id)return!1;let t=String(e.id).trim();if(!t)return!1;let r=n.node.id?String(n.node.id).trim():``,a=n.node.contentId?String(n.node.contentId).trim():``,o=n.node.treeNodeId?String(n.node.treeNodeId).trim():``,s=e.treeNodeId?String(e.treeNodeId).trim():``;return!!(r&&t===r||a&&t===a||s&&(r&&s===r||o&&s===o))}),m=J(()=>bp(n.node)),h=J(()=>{let e=n.node.nodeType||`page`,t=i.nodeSchemas.value[e];return t?.label?t.label:e.charAt(0).toUpperCase()+e.slice(1)}),g=()=>{window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),r(`select-node`,n.node)},_=R(!1),v=R(null),y=R(null),b=()=>{_.value=!1,y.value=null},x=e=>{if(m.value.isDraft){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-toast`,{detail:{type:`info`,message:`Save this page first to unlock menu options.`}}));return}if(e.preventDefault(),e.stopPropagation(),_.value){b();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),v.value&&(y.value=v.value.getBoundingClientRect()),_.value=!0},S=()=>{_.value&&b()};Js(()=>{window.addEventListener(`cms-close-tree-menus`,S)}),Zs(()=>{window.removeEventListener(`cms-close-tree-menus`,S)});let C=async e=>{if(b(),window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`toggle-hide`)await s(n.node);else if(e===`add-child`){if(!o.value||o.value.length===0)return alert(`No tree-eligible node types available.`);u.value=!0,r(`add-child`,n.node)}else if(e===`add-sibling`){if(!o.value||o.value.length===0)return alert(`No tree-eligible node types available.`);r(`add-sibling`,n.node)}else if(e===`unlink`){if(confirm(`Remove "${f.value}" from this tree? (It will remain in the Vault)`)){let e=n.node.treeNodeId||n.node.id;await a(e)}}else e===`delete`?await l(`Are you sure you want to delete "${f.value}"?`,`Delete Node?`,`Delete`,`Cancel`)&&await c(n.node.id||n.node.treeNodeId):e===`show-assets`&&(sessionStorage.setItem(`cms-media-node-filter`,n.node.id),window.dispatchEvent(new CustomEvent(`cms-filter-media-by-node`,{detail:n.node.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`media`})))},T=J(()=>{let e=m.value.isHidden,t=h.value,r=[{key:`toggle-hide`,label:e?`Enable ${t}`:`Disable ${t}`,icon:e?xm:lm}];return n.node.assetCount&&n.node.assetCount>0&&(r.push({key:`div-assets`,divider:!0}),r.push({key:`show-assets`,label:`View Assets (${n.node.assetCount})`,icon:Km})),r.push({key:`div-1`,divider:!0},{key:`add-child`,label:`Add Inside`,icon:Om},{key:`add-sibling`,label:`Add After`,icon:gh},{key:`div-2`,divider:!0},{key:`unlink`,label:`Unlink from Tree`,icon:Nh},{key:`delete`,label:`Delete`,icon:Ah}),r}),E=e=>{n.node.children&&(n.node.children=n.node.children.map(e=>{let t=String(e.id||``),n=t.startsWith(`v0.`)||t.includes(`alpha`)?e.contentId||e.treeNodeId||t:e.id;return{...e,id:n}})),r(`tree-change`,e)};return(t,r)=>{let i=Gi(`NodeTreeItem`,!0);return B(),V(`div`,Vw,[U(`div`,{class:w([`tree-node`,{"is-active":p.value,"is-draft":m.value.isDraft}]),onClick:g,onContextmenu:ld(x,[`prevent`])},[e.node.children&&e.node.children.length>0?(B(),V(`button`,{key:0,class:`toggle-btn`,onClick:ld(d,[`stop`])},[u.value?(B(),H(z(_m),{key:0,size:12})):(B(),H(z(vm),{key:1,size:12}))])):(B(),V(`span`,Hw)),U(`div`,{class:w([`icon-wrapper`,{"drag-handle-tree":!m.value.isDraft}]),title:`Type: ${e.node.nodeType||`node`} ${m.value.isDraft?``:`(Drag to reorder)`}`},[q(z(Im),{size:14,class:`node-icon`}),q(Bw,{evaluated:m.value},null,8,[`evaluated`])],10,Uw),U(`span`,{class:`node-title`,title:f.value},L(f.value),9,Ww),m.value.isDraft?G(``,!0):(B(),V(`div`,{key:2,class:w([`node-actions`,{"menu-open":_.value}])},[U(`button`,{ref_key:`anchorBtnRef`,ref:v,class:`action-btn`,title:`Options`,onClick:ld(x,[`stop`])},[q(z(jm),{size:14})],512)],2))],34),q(tg,{show:_.value,"anchor-rect":y.value,items:T.value,onSelect:C,onClose:b},null,8,[`show`,`anchor-rect`,`items`]),u.value?(B(),V(`div`,Gw,[e.node.children?(B(),H(z(Fw.default),{key:0,modelValue:e.node.children,"onUpdate:modelValue":r[4]||=t=>e.node.children=t,"item-key":`id`,group:`node-tree-${n.treeId}`,handle:`.drag-handle-tree`,class:`tree-drag-area`,onChange:E},{item:qr(({element:a})=>[q(i,{node:a,"active-id":e.activeId,"tree-id":n.treeId,onSelectNode:r[0]||=e=>t.$emit(`select-node`,e),onAddChild:r[1]||=e=>t.$emit(`add-child`,e),onAddSibling:r[2]||=e=>t.$emit(`add-sibling`,e),onDeleteNode:r[3]||=e=>t.$emit(`delete-node`,e),onTreeChange:E},null,8,[`node`,`active-id`,`tree-id`])]),_:1},8,[`modelValue`,`group`])):G(``,!0)])):G(``,!0)])}}}),[[`__scopeId`,`data-v-3abbdd86`]]),qw={class:`node-tree-container`},Jw={key:0,class:`tree-loading`},Yw={key:2,class:`empty-tree-state`},Xw=Yh(vi({__name:`NodeTree`,props:{treeId:{}},setup(e){let t=e,{activeNode:n,selectedTreeId:r,selectedChannelId:i,workspaceContext:a}=sp(),{saveTreeOrderForId:o,getNodesForTree:s,fetchNodeTreeForId:c}=Mp(),{loadNodeContent:l,handleAddRootNode:u,handleAddChild:d,handleAddSibling:f,deleteNode:p}=Yp(),m=R(!1),h=J(()=>String(n.value?.id||``)),g=J({get(){return s(t.treeId)},set(e){o(t.treeId,e)}}),_=async e=>{r.value=t.treeId,a.value=`tree`,await l(e)},v=async()=>{r.value=t.treeId,a.value=`tree`,await u()},y=async e=>{r.value=t.treeId,a.value=`tree`,await d(e)},b=async e=>{r.value=t.treeId,a.value=`tree`,await f(e)},x=async e=>{r.value=t.treeId;let n=e.treeNodeId||e.id;n&&await p(n)},S=async()=>{await o(t.treeId,g.value)};return Js(async()=>{t.treeId&&(m.value=!0,await c(t.treeId),m.value=!1)}),ni(i,async()=>{t.treeId&&(m.value=!0,await c(t.treeId),m.value=!1)}),(e,n)=>(B(),V(`div`,qw,[m.value?(B(),V(`div`,Jw,[q(z(nh),{size:14,class:`spin`}),n[1]||=U(`span`,null,`Loading nodes...`,-1)])):g.value&&g.value.length>0?(B(),H(z(Fw.default),{key:1,modelValue:g.value,"onUpdate:modelValue":n[0]||=e=>g.value=e,"item-key":`id`,group:`node-tree-${t.treeId}`,handle:`.drag-handle-tree`,class:`tree-drag-root`,onChange:S},{item:qr(({element:e})=>[q(Kw,{node:e,"active-id":h.value,"tree-id":t.treeId,onSelectNode:_,onAddChild:y,onAddSibling:b,onDeleteNode:x,onTreeChange:S},null,8,[`node`,`active-id`,`tree-id`])]),_:1},8,[`modelValue`,`group`])):(B(),V(`div`,Yw,[n[3]||=U(`p`,null,`No nodes in this navigation tree.`,-1),U(`button`,{class:`primary-btn`,onClick:v},[q(z(gh),{size:13}),n[2]||=W(` Add Node `,-1)])]))]))}}),[[`__scopeId`,`data-v-0bd39070`]]),Zw={class:`tree-pane`},Qw={key:0,class:`tree-stack`},$w=[`onClick`,`onContextmenu`],eT=[`onClick`],tT={class:`tree-badges`},nT={key:0,class:`status-badge draft`,title:`Draft changes pending`},rT={key:1,class:`status-badge hidden`,title:`Tree is Hidden`},iT={key:2,class:`status-badge scheduled`,title:`Scheduled to publish`},aT={key:3,class:`status-badge expired`,title:`Publishing window expired`},oT=[`onClick`],sT={class:`tree-nodes-wrap`},cT={key:1,class:`empty-trees-state`},lT=Yh(vi({__name:`TreeOperations`,setup(e){let t=(e,t)=>vi({props:[`size`,`class`],setup(n){return()=>Vo(`div`,{class:n.class,style:`display:inline-flex; align-items:center;`},[Vo(e,{size:13}),Vo(t,{size:11,style:`margin-left: -2px;`})])}}),n=t(fh,ym),r=t(fh,_m),{selectedTreeId:i,activeViewMode:a,setViewMode:o,activeNode:s,activeTreeSettings:c}=sp(),{fetchNodeTree:l,currentChannelTrees:u,fetchTrees:d,openTreeSettings:f,handleAddNewTree:p,checkUnsavedChanges:m,reorderChannelTrees:h}=Mp(),{confirmDiscard:g}=Fd(),_=Zh(`kama_selected_tree`,``),v=Zh(`kama_collapsed_trees`,{}),y=e=>{let t=String(e);v.value={...v.value,[t]:!v.value[t]}},b=e=>!!v.value[String(e)],x=R(null),S=e=>{let t=new Date,n=!!e.isHidden,r=e.status===`draft`||e.isDraft===!0||!!e.draftDataJson,i={};if(e.dataJson)try{i=typeof e.dataJson==`string`?JSON.parse(e.dataJson):e.dataJson}catch{}let a=i.startShowingAt?new Date(i.startShowingAt):null,o=i.stopShowingAt?new Date(i.stopShowingAt):null;return{isHidden:n,isDraft:r,isScheduled:a&&a>t,isExpired:o&&o<t}},C=R(!1),T=R(void 0),E=R(void 0),D=R(null),O=R(null),k=R(-1),ee=()=>{C.value=!1,D.value=null,T.value=void 0,E.value=void 0,O.value=null,k.value=-1,document.removeEventListener(`click`,ee)},A=(e,t,n)=>{e.preventDefault(),e.stopPropagation(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),O.value=t,k.value=n;let r=e.currentTarget;r&&typeof r.getBoundingClientRect==`function`?(D.value=r.getBoundingClientRect(),T.value=void 0,E.value=void 0):(D.value=null,T.value=e.clientX,E.value=e.clientY+4),C.value=!0,setTimeout(()=>document.addEventListener(`click`,ee),0)},te=J(()=>{if(!O.value)return[];let e=O.value,t=!!e.isHidden,i=[],a=x.value;if(a){if(a.tree.id===e.id)i.push({key:`cancel-transfer`,label:`Cancel Transfer`,icon:Ih}),i.push({key:`div-transfer`,divider:!0});else{let e=a.tree.label||a.tree.key||`Tree ${a.tree.id}`,t=e.length>15?e.substring(0,15)+`...`:e;i.push({key:`place-before`,label:`Move '${t}' Before`,icon:n}),i.push({key:`place-after`,label:`Move '${t}' After`,icon:r}),i.push({key:`div-transfer`,divider:!0})}}return i.push({key:`settings`,label:`Tree Settings`,icon:Ch}),i.push({key:`toggle-hide`,label:t?`Show Tree`:`Hide Tree`,icon:t?Pm:Nm}),a||i.push({key:`move`,label:`Move Order`,icon:fh}),i.push({key:`create-new`,label:`Add New Tree`,icon:gh}),i.push({key:`div-1`,label:``,divider:!0}),i.push({key:`delete`,label:`Delete Tree`,icon:Ah}),i}),ne=async e=>{let t=O.value,n=k.value;if(ee(),e===`cancel-transfer`){x.value=null;return}if(e===`place-before`||e===`place-after`){if(!x.value)return;let t=x.value.index,r=n;e===`place-after`&&(r+=1),t<r&&--r,await h(t,r),x.value=null;return}if(e===`move`){x.value={index:n,tree:t};return}if(!(!t&&e!==`create-new`)){if(e===`settings`)await ie(t.id);else if(e===`create-new`)await j();else if(e===`toggle-hide`)try{await fetch(`/api/cms/trees.json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,isHidden:!t.isHidden})}),await d()}catch(e){console.error(`Failed to toggle tree visibility:`,e)}else if(e===`delete`&&await g(`Are you sure you want to delete the tree "${t.label||t.key}"?`,`Delete Tree?`,`Delete`,`Cancel`))try{await fetch(`/api/cms/trees.json?id=${t.id}`,{method:`DELETE`}),await d()}catch(e){console.error(`Failed to delete tree:`,e)}}},re=async e=>{(i.value!==String(e)||a.value!==`tree`)&&(i.value=String(e),_.value=String(e),await f(String(e))&&await l())},ie=async e=>{i.value=String(e),_.value=String(e),await f(String(e))&&await l()},j=async()=>{await m()&&await p()};return ni(()=>u.value,async e=>{if(e.length>0){let t=_.value&&e.some(e=>String(e.id)===_.value||String(e.key)===_.value)?_.value:String(e[0].id);i.value!==t&&(i.value=t,_.value=t,await l())}else i.value=``,_.value=``,a.value!==`channel`&&a.value!==`tree`&&(o(`none`),s.value={id:``,title:``,slug:``,nodeType:`node`,channelId:``,language:null,isHidden:!1,children:[],disabledRegions:{}})},{deep:!0,immediate:!0}),Js(async()=>{await d();let e=_.value&&u.value.some(e=>String(e.id)===_.value)?_.value:u.value[0]?.id;e&&(i.value=String(e),_.value=String(e),await l())}),Qs(()=>{document.removeEventListener(`click`,ee)}),(e,t)=>(B(),V(`div`,Zw,[z(u).length>0?(B(),V(`div`,Qw,[(B(!0),V(K,null,Xi(z(u),(e,n)=>(B(),V(`div`,{key:e.id,class:w([`tree-block`,{"is-selected":String(z(i))===String(e.id)&&z(a)===`tree`,"is-transfer-source":x.value?.tree.id===e.id}])},[U(`div`,{class:`tree-label-row`,onClick:t=>re(e.id),onContextmenu:ld(t=>A(t,e,n),[`prevent`])},[U(`button`,{class:`toggle-btn`,onClick:ld(t=>y(e.id),[`stop`])},[b(e.id)?(B(),H(z(vm),{key:0,size:13})):(B(),H(z(_m),{key:1,size:13}))],8,eT),U(`span`,{class:w([`tree-title`,{"is-hidden-text":e.isHidden}])},L(e.label||e.key||`Tree ${e.id}`),3),U(`div`,tT,[S(e).isDraft?(B(),V(`span`,nT,[q(z(Fm),{size:10}),t[1]||=U(`span`,null,`Draft`,-1)])):G(``,!0),S(e).isHidden?(B(),V(`span`,rT,[q(z(Nm),{size:10}),t[2]||=U(`span`,null,`Hidden`,-1)])):G(``,!0),S(e).isScheduled?(B(),V(`span`,iT,[q(z(Cm),{size:10}),t[3]||=U(`span`,null,`Scheduled`,-1)])):S(e).isExpired?(B(),V(`span`,aT,[q(z(mm),{size:10}),t[4]||=U(`span`,null,`Expired`,-1)])):G(``,!0)]),U(`div`,{class:w([`action-buttons`,{"menu-open":C.value||x.value?.tree.id===e.id}])},[x.value?.tree.id===e.id?(B(),V(`button`,{key:0,class:`icon-btn cancel-transfer-btn`,title:`Cancel Transfer`,onClick:t[0]||=ld(e=>x.value=null,[`stop`])},[q(z(fh),{size:13,class:`default-icon`}),q(z(Ih),{size:13,class:`hover-icon`})])):G(``,!0),U(`button`,{class:`icon-btn menu-btn`,title:`Tree Options`,onClick:ld(t=>A(t,e,n),[`stop`])},[q(z(jm),{size:13})],8,oT)],2)],40,$w),Jr(U(`div`,sT,[q(Xw,{"tree-id":String(e.id)},null,8,[`tree-id`])],512),[[Ou,!b(e.id)]])],2))),128))])):(B(),V(`div`,cT,[t[6]||=U(`p`,null,`No navigation trees found.`,-1),U(`button`,{class:`create-first-btn`,onClick:j},[q(z(gh),{size:13}),t[5]||=W(` Add Tree `,-1)])])),q(tg,{show:C.value&&!!O.value,"anchor-rect":D.value,x:T.value,y:E.value,items:te.value,onSelect:ne,onClose:ee},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])]))}}),[[`__scopeId`,`data-v-33bb18de`]]),uT=[`id`],dT=vi({__name:`CmsListItem`,props:{selected:{type:Boolean},draft:{type:Boolean},media:{type:Boolean},variant:{},id:{}},setup(e){return(t,n)=>(B(),V(`div`,{id:e.id,class:w([`cms-list-item`,[e.variant===`media`||e.media?`media-list-item`:e.variant===`vault`?`vault-item`:`tree-item`,{active:e.selected,"is-draft":e.draft}]])},[Qi(t.$slots,`icon`),Qi(t.$slots,`default`),Qi(t.$slots,`actions`)],10,uT))}}),fT={class:`vault-pane`},pT={class:`fixed-vault-controls`},mT={class:`search-bar`},hT={key:0,class:`filter-bar`},gT=[`onClick`],_T={class:`pane-header`},vT={class:`sort-wrapper`},yT=[`title`],bT={class:`sort-label`},xT={key:0,class:`vault-list`},ST={class:`icon-wrapper`},CT={class:`item-details`},wT={key:0,class:`type-label`},TT=[`title`],ET={class:`meta-row`},DT=[`title`],OT={key:1,class:`tree-tag-icon`,title:`Belongs to a tree`},kT=[`title`],AT={class:`count-text`},jT=[`onClick`],MT={key:1,class:`empty-vault-state`},NT={key:0,class:`loading-text`},PT={key:1,class:`end-text`},FT=Yh(vi({__name:`VaultOperations`,setup(e){let{vaultNodes:t,nodeSchemas:n,activeNode:r,selectedChannelId:i,selectedTreeId:a,hasUnpublishedChanges:o,openNode:s,workspaceContext:c}=sp(),{loadNodeContent:l,handleAddNewNode:u,toggleNodeVisibility:d,deleteNode:f,vaultEligibleNodeSchemas:p}=Yp(),{fetchVaultNodes:m,attachVaultNodeToTree:h,detachTreeNode:g,isLoading:_,hasMore:v}=Mp(),{confirmDiscard:y}=Fd(),b=R(null),x=R([]),S=R(`updatedAt`),C=R(!0),T=R(``),E=R(``),D=R(null),O=null,k=null,ee=R(!1),A=e=>{let t=e.contentType||e.nodeType||`page`,r=n.value[t],i=Ep(r,{...e,...e.dataJson||{}});return i.startsWith(`Untitled`)&&F(e).isDraft?i+`...`:i},te=R(!1),ne=R(null),re=R(null),ie=()=>{if(te.value){te.value=!1;return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),ne.value&&(re.value=ne.value.getBoundingClientRect()),te.value=!0},j=e=>{S.value=String(e),te.value=!1},ae=R(null),oe=R(!1),se=R(void 0),ce=R(void 0),le=R(null),M=R(null),ue=()=>{oe.value=!1,ae.value=null,M.value=null,le.value=null,se.value=void 0,ce.value=void 0},de=(e,t)=>{if(bp(t).isDraft)return;if(e.preventDefault(),e.stopPropagation(),oe.value&&ae.value===String(t.id)){ue();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),M.value=t,ae.value=String(t.id);let n=e.currentTarget;n&&(le.value=n.getBoundingClientRect()),se.value=void 0,ce.value=void 0,oe.value=!0},N=(e,t)=>{bp(t).isDraft||(e.preventDefault(),e.stopPropagation(),oe.value&&ae.value===String(t.id)&&ue(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),M.value=t,ae.value=String(t.id),le.value=null,se.value=e.clientX,ce.value=e.clientY,oe.value=!0)},P=()=>{oe.value&&ue(),te.value&&=!1},fe=async e=>{let t=M.value;if(ue(),t){if(window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`toggle-hide`)await d(t);else if(e===`create-same-type`){let e=t.contentType||t.nodeType||``;c.value=`vault`,u(e)}else if(e===`attach-tree`)await h(t.id);else if(e===`unlink-tree`){if(confirm(`Remove "${A(t)}" from the navigation tree? (It will remain in the Vault)`)){let e=t.treeNodeId||t.trees?.[0]?.id||t.id;await g(e),await m({reset:!0,assetId:E.value})}}else e===`delete`?await y(`Are you sure you want to delete "${A(t)}"?`,`Delete Node?`,`Delete`,`Cancel`)&&await f(t.id):e===`show-assets`&&(sessionStorage.setItem(`cms-media-node-filter`,t.id),window.dispatchEvent(new CustomEvent(`cms-filter-media-by-node`,{detail:t.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`media`})))}},pe=e=>{if(!e)return`Item`;let t=e.contentType||e.nodeType||`page`,r=n.value[t];return r?.label?r.label:t.charAt(0).toUpperCase()+t.slice(1)},me=e=>{if(!e)return!1;let t=e.contentType||e.nodeType;if(!t)return!1;let r=n.value[t];return r?r.inTree===!0:!1},he=J(()=>{if(!M.value)return[];let e=M.value,t=F(e).isHidden,n=pe(e),r=me(e),i=[{key:`toggle-hide`,label:t?`Enable ${n}`:`Disable ${n}`,icon:t?xm:lm},{key:`div-1`,label:``,divider:!0},{key:`create-same-type`,label:`Add New ${n}`,icon:Em}];return e.assetCount&&e.assetCount>0&&(i.push({key:`div-assets`,label:``,divider:!0}),i.push({key:`show-assets`,label:`View Assets (${e.assetCount})`,icon:Km})),a.value&&(ge(e)?(i.push({key:`div-2`,label:``,divider:!0}),i.push({key:`unlink-tree`,label:`Unlink from Tree`,icon:Nh})):r&&(i.push({key:`div-2`,label:``,divider:!0}),i.push({key:`attach-tree`,label:`Attach to Active Tree`,icon:Rm}))),i.push({key:`div-3`,label:``,divider:!0},{key:`delete`,label:`Delete`,icon:Ah}),i});J(()=>C.value?am:cm),ni([S,C,i],()=>{b.value&&(b.value.scrollTop=0),m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`,assetId:E.value})}),ni(()=>r.value?.id,async e=>{if(ee.value){ee.value=!1;return}if(e&&b.value){await Fr();let t=document.getElementById(`vault-item-${e}`),n=b.value;if(t&&n){let e=t.offsetTop,r=e+t.offsetHeight,i=n.scrollTop,a=i+n.clientHeight;if(e<i||r>a){let r=e-n.clientHeight/2+t.offsetHeight/2;n.scrollTo({top:Math.max(0,r),behavior:`smooth`})}}}});let F=e=>{let t=bp(e);return String(r.value?.id)===String(e.id)?{...t,hasUnpublishedChanges:o.value||t.hasUnpublishedChanges}:t},I=J(()=>x.value.length!==1),ge=e=>e?!!(Array.isArray(e.treeNames)&&e.treeNames.length>0||Array.isArray(e.trees)&&e.trees.length>0):!1,_e=J(()=>Object.keys(n.value).filter(e=>n.value[e].inVault!==!1).map(e=>({key:e,label:n.value[e].label||e,inTree:n.value[e].inTree===!0}))),ve=J(()=>{let e=p.value||{},t=x.value;return t.length===0?Object.keys(e):t.filter(t=>e[t])}),ye=J(()=>{let e=[{id:`updatedAt`,label:`Last Updated`},{id:`createdAt`,label:`Created Date`},{id:`title`,label:`Title`}];if(x.value.length===1){let t=x.value[0],r=n.value[t];if(r){let t=t=>{t&&(Array.isArray(t)?t.forEach(t=>{typeof t==`object`&&t&&!t.fieldSet&&Object.entries(t).forEach(([t,n])=>{e.find(e=>e.id===t)||e.push({id:t,label:n.label||t})})}):Object.entries(t).forEach(([t,n])=>{t!==`fieldSet`&&!e.find(e=>e.id===t)&&e.push({id:t,label:n.label||t})}))};t(r.fields),r.tabs&&Object.values(r.tabs).forEach(e=>t(e.fields))}}return e}),be=J(()=>ye.value.map(e=>({key:e.id,label:e.label,isActive:S.value===e.id}))),xe=J(()=>t.value),Se=e=>{let t=S.value;if(t===`title`)return null;let n=e[t];if(n==null||n===``)return null;if(t===`createdAt`||t===`updatedAt`)try{let e=new Date(n);if(!isNaN(e.getTime()))return e.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}catch{}return String(n)},Ce=J(()=>{let e=ye.value.find(e=>String(e.id)===String(S.value));return e?e.label:S.value}),we=e=>{E.value=e.detail,T.value=``,x.value=[],b.value&&(b.value.scrollTop=0),m({reset:!0,assetId:E.value,type:`all`,search:``,sort:S.value,order:C.value?`DESC`:`ASC`})},Te=()=>{E.value=``},Ee=e=>{if(Te(),b.value&&(b.value.scrollTop=0),e===`all`)x.value=[];else{let t=x.value.indexOf(e);t>-1?x.value.splice(t,1):x.value.push(e)}m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},De=()=>{Te(),k&&clearTimeout(k),k=setTimeout(()=>{b.value&&(b.value.scrollTop=0),m({reset:!0,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},300)},Oe=e=>{ee.value=!0,c.value=`vault`,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),l({id:e.id,title:A(e),slug:e.slug,nodeType:e.contentType||e.nodeType,channelId:e.channelId||``,language:e.language||null,children:[]})},ke=()=>{c.value=`vault`,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),ve.value.length===1?u(ve.value[0]):u(``)},Ae=()=>{m({reset:!0,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})};return Js(()=>{window.addEventListener(`cms-close-tree-menus`,P),window.addEventListener(`cms-filter-vault-by-asset`,we),window.addEventListener(`cms-node-updated`,Ae);let e=sessionStorage.getItem(`cms-vault-asset-filter`);e&&(E.value=e,sessionStorage.removeItem(`cms-vault-asset-filter`)),m({reset:!0,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`}),O=new IntersectionObserver(e=>{e[0].isIntersecting&&v.value&&!_.value&&m({reset:!1,assetId:E.value,type:x.value.length>0?x.value.join(`,`):`all`,search:T.value,sort:S.value,order:C.value?`DESC`:`ASC`})},{root:b.value,rootMargin:`120px`,threshold:.1}),D.value&&O.observe(D.value)}),Qs(()=>{window.removeEventListener(`cms-close-tree-menus`,P),window.removeEventListener(`cms-filter-vault-by-asset`,we),window.removeEventListener(`cms-node-updated`,Ae),O&&O.disconnect(),k&&clearTimeout(k)}),(e,t)=>(B(),V(`div`,fT,[U(`div`,pT,[U(`div`,mT,[q(z(xh),{size:13,class:`search-icon`}),Jr(U(`input`,{"onUpdate:modelValue":t[0]||=e=>T.value=e,type:`text`,placeholder:`Search vault items...`,class:`search-input`,onInput:De},null,544),[[nd,T.value]])]),_e.value.length>1?(B(),V(`div`,hT,[U(`button`,{class:w([`filter-pill`,{active:x.value.length===0&&!E.value}]),onClick:t[1]||=e=>Ee(`all`)},` All `,2),(B(!0),V(K,null,Xi(_e.value,e=>(B(),V(`button`,{key:e.key,class:w([`filter-pill`,{active:x.value.includes(e.key)}]),onClick:t=>Ee(e.key)},L(e.label),11,gT))),128))])):G(``,!0),U(`div`,_T,[U(`div`,vT,[U(`button`,{class:`pane-icon-btn`,onClick:t[2]||=e=>C.value=!C.value,title:C.value?`Sort Descending`:`Sort Ascending`},[C.value?(B(),H(z(am),{key:0,size:13})):(B(),H(z(cm),{key:1,size:13}))],8,yT),U(`div`,{class:`sort-dropdown-wrapper`,ref_key:`sortMenuTriggerRef`,ref:ne},[U(`button`,{class:`sort-trigger-btn`,title:`Change Sort Order`,onClick:ie},[U(`span`,bT,L(Ce.value),1),q(z(_m),{size:13,class:`sort-chevron`})]),q(tg,{show:te.value,items:be.value,"anchor-rect":re.value,"min-width":`160px`,onSelect:j,onClose:t[3]||=e=>te.value=!1},null,8,[`show`,`items`,`anchor-rect`])],512)]),U(`button`,{class:`pane-icon-btn add-content-btn`,title:`Create New Content`,onClick:ke},[q(z(gh),{size:14})])])]),E.value?(B(),V(`div`,{key:0,class:`asset-filter-banner`,title:`Clear filter`,onClick:t[4]||=e=>{Te(),z(m)({reset:!0})}},` Showing nodes using selected asset ✕ `)):G(``,!0),U(`div`,{ref_key:`vaultScrollArea`,ref:b,class:`vault-scroll-area`},[xe.value.length>0?(B(),V(`div`,xT,[(B(!0),V(K,null,Xi(xe.value,e=>(B(),H(dT,{key:e.id,id:`vault-item-${e.id}`,variant:`vault`,selected:String(z(r)?.id)===String(e.id),draft:F(e).isDraft,onClick:t=>Oe(e),onContextmenu:ld(t=>N(t,e),[`prevent`])},{default:qr(()=>[U(`div`,ST,[q(z(Im),{size:14,class:`item-icon`}),q(Bw,{evaluated:F(e)},null,8,[`evaluated`])]),U(`div`,CT,[I.value?(B(),V(`span`,wT,L(e.contentType||e.nodeType||`node`),1)):G(``,!0),U(`span`,{class:`item-title`,title:A(e)},L(A(e)),9,TT),U(`div`,ET,[Se(e)?(B(),V(`span`,{key:0,class:`sort-field-tag`,title:`${Ce.value}: ${Se(e)}`},L(Se(e)),9,DT)):G(``,!0),ge(e)?(B(),V(`span`,OT,[q(z(Rm),{size:11})])):G(``,!0),e.assetCount&&e.assetCount>0?(B(),V(`span`,{key:2,class:`asset-tag-icon`,title:`Has ${e.assetCount} linked asset(s)`},[q(z(Km),{size:11}),U(`span`,AT,L(e.assetCount),1)],8,kT)):G(``,!0)])]),F(e).isDraft?G(``,!0):(B(),V(`div`,{key:0,class:w([`node-actions`,{"menu-open":ae.value===String(e.id)}])},[U(`button`,{class:`action-btn`,title:`Options`,onClick:ld(t=>de(t,e),[`stop`])},[q(z(jm),{size:14})],8,jT)],2))]),_:2},1032,[`id`,`selected`,`draft`,`onClick`,`onContextmenu`]))),128))])):z(_)?G(``,!0):(B(),V(`div`,MT,[U(`p`,null,L(E.value?`No items use this asset.`:x.value.length===0?`No content items in vault.`:`No items matching selected types.`),1),E.value?G(``,!0):(B(),V(`button`,{key:0,class:`primary-btn`,onClick:ke},[q(z(gh),{size:13}),t[5]||=W(` Add Content `,-1)]))])),U(`div`,{ref_key:`scrollSentinel`,ref:D,class:`scroll-sentinel`},[z(_)?(B(),V(`span`,NT,`Loading items...`)):!z(v)&&xe.value.length>0?(B(),V(`span`,PT,`All items loaded`)):G(``,!0)],512)],512),q(tg,{show:oe.value&&!!M.value,"anchor-rect":le.value,x:se.value,y:ce.value,items:he.value,onSelect:fe,onClose:ue},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])]))}}),[[`__scopeId`,`data-v-f0afc47d`]]);function IT(e,t){if(!e)return``;if(!e.includes(`/media/`))return e;try{let n=new URL(e,window.location.origin);return t.w&&n.searchParams.set(`w`,String(t.w)),t.h&&n.searchParams.set(`h`,String(t.h)),n.searchParams.set(`q`,String(t.q||75)),n.searchParams.set(`f`,String(t.f||`auto`)),n.pathname+n.search}catch{return e}}var LT={class:`cms-image-preview`},RT=[`src`,`alt`],zT={key:1,class:`loading-overlay`},BT=Yh(vi({__name:`CmsImagePreview`,props:{url:{},alt:{default:`Image preview`},width:{default:800},quality:{default:85},isProcessing:{type:Boolean,default:!1}},setup(e){let t=e,n=R(!1),r=R(null),i=J(()=>{if(!t.url)return!1;let e=t.url.toLowerCase();return e.endsWith(`.svg`)||e.includes(`image/svg+xml`)||e.includes(`.svg?`)});ni(()=>t.url,(e,t)=>{e&&e!==t&&(n.value=!0,r.value=null)});let a=()=>{n.value=!1},o=()=>{if(r.value!==t.url&&s.value!==t.url){r.value=t.url,n.value=!0;return}n.value=!1},s=J(()=>t.url?i.value||r.value===t.url?t.url:IT(t.url,{w:t.width,q:t.quality}):``);return(t,r)=>(B(),V(`div`,LT,[s.value?(B(),V(`img`,{key:0,src:s.value,alt:e.alt,class:w([`preview-img`,{"is-blurring":e.isProcessing||n.value,"is-svg":i.value}]),onLoad:a,onError:o},null,42,RT)):G(``,!0),e.isProcessing||n.value?(B(),V(`div`,zT,[q(z(nh),{size:16,class:`spinner`})])):G(``,!0)]))}}),[[`__scopeId`,`data-v-2d18a75f`]]),VT=[`disabled`],HT=Yh(vi({__name:`CmsButton`,props:{variant:{},size:{},disabled:{type:Boolean}},setup(e){return(t,n)=>(B(),V(`button`,{class:w([`cms-btn`,`btn-${e.variant||`primary`}`,e.size===`sm`?`btn-sm`:`btn-md`]),disabled:e.disabled},[Qi(t.$slots,`default`,{},void 0,!0)],10,VT))}}),[[`__scopeId`,`data-v-371ae993`]]),UT={key:0,class:`collision-overlay`},WT={class:`collision-card`},GT={class:`collision-header`},KT={class:`collision-body`},qT={key:0,class:`collision-warning`},JT={class:`collision-actions`},YT={key:1,class:`drag-overlay`},XT={class:`fixed-media-controls`},ZT={class:`search-bar`},QT={class:`filter-bar`},$T={class:`pane-header`},eE={class:`sort-wrapper`},tE=[`title`],nE={class:`sort-label`},rE={key:0,class:`uploading-banner`},iE={key:1,class:`media-list`},aE={key:0,class:`thumb-wrapper`},oE={key:1,class:`doc-wrapper`},sE={class:`item-details`},cE=[`title`],lE={class:`meta-row`},uE=[`title`],dE={class:`count-text`},fE=[`title`],pE={class:`count-text`},mE={key:2,class:`meta-size`},hE=[`onClick`],gE={key:0,class:`empty-sub`},_E={key:0,class:`loading-text`},vE={key:1,class:`end-text`},yE=Yh(vi({__name:`MediaOperations`,setup(e){let{confirmDiscard:t}=Fd(),{setViewMode:n,selectedChannelId:r}=sp(),i=R([]),a=R(!1),o=R(!1),s=R(!1),c=R(0),l=R(!1),u=R(1),d=R(``),f=R(`all`),p=R(`createdAt`),m=R(!0),h=R(null),g=R(``),_=R(null),v=R(null),y=R(null),b=null,x=null,S=R(null),C=R(null),T=R(!1),E=[{id:`createdAt`,label:`Upload Date`},{id:`updatedAt`,label:`Last Modified`},{id:`filename`,label:`Filename`},{id:`mimeType`,label:`Type`}],D=R(!1),O=R(null),k=R(null),ee=()=>{if(D.value){D.value=!1;return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),O.value&&(k.value=O.value.getBoundingClientRect()),D.value=!0},A=e=>{p.value=String(e),D.value=!1,_.value&&(_.value.scrollTop=0),_e(!0)},te=J(()=>E.map(e=>({key:e.id,label:e.label,isActive:p.value===e.id}))),ne=J(()=>{let e=E.find(e=>String(e.id)===String(p.value));return e?e.label:p.value}),re=R(!1),ie=R(void 0),j=R(void 0),ae=R(null),oe=R(null),se=()=>{re.value=!1,oe.value=null,ae.value=null,ie.value=void 0,j.value=void 0},ce=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),re.value&&oe.value?.id===t.id){se();return}window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),oe.value=t,h.value=t.id;let n=e.currentTarget;n&&(ae.value=n.getBoundingClientRect()),ie.value=void 0,j.value=void 0,re.value=!0},le=(e,t)=>{e.preventDefault(),e.stopPropagation(),re.value&&oe.value?.id===t.id&&se(),window.dispatchEvent(new CustomEvent(`cms-close-tree-menus`)),oe.value=t,h.value=t.id,ae.value=null,ie.value=e.clientX,j.value=e.clientY,re.value=!0},M=()=>{re.value&&se(),D.value&&=!1},ue=J(()=>{let e=[{key:`copy-url`,label:`Copy Public URL`,icon:Dm},{key:`open-tab`,label:`Open in New Tab`,icon:Mm}],t=oe.value;return t&&t.usageCount&&t.usageCount>0&&(e.push({key:`div-nodes`,label:``,divider:!0}),e.push({key:`show-nodes`,label:`Connected Nodes (${t.usageCount})`,icon:eh})),e.push({key:`div-1`,label:``,divider:!0},{key:`delete`,label:`Delete Asset`,icon:Ah}),e}),de=async e=>{let n=oe.value;se(),n&&(window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),e===`copy-url`?n.url&&await navigator.clipboard.writeText(n.url):e===`open-tab`?n.url&&window.open(n.url,`_blank`):e===`delete`?await t(`Are you sure you want to delete "${n.filename||`this asset`}"? This will move it to the trash bin.`,`Delete Asset?`,`Delete`,`Cancel`)&&await ve(n.id):e===`show-nodes`&&(sessionStorage.setItem(`cms-vault-asset-filter`,n.id),window.dispatchEvent(new CustomEvent(`cms-filter-vault-by-asset`,{detail:n.id})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`vault`}))))},N=e=>{let t=e?.size??e?.bytes??e?.fileSize??e?.sizeBytes;if(t==null||isNaN(Number(t))||Number(t)<=0)return``;let n=Number(t);return n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`},P=(e,t)=>{e.dataTransfer&&(e.dataTransfer.setData(`application/cms-asset`,JSON.stringify(t)),e.dataTransfer.setData(`text/plain`,t.url),e.dataTransfer.effectAllowed=`copy`)},fe=()=>{y.value?.click()},pe=e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),c.value++,s.value=!0)},me=e=>{e.preventDefault(),e.stopPropagation(),c.value--,c.value<=0&&(c.value=0,s.value=!1)},he=e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),s.value=!0)},F=async e=>{e.dataTransfer?.types.includes(`application/cms-asset`)||(e.preventDefault(),e.stopPropagation(),c.value=0,s.value=!1,e.dataTransfer?.files&&e.dataTransfer.files.length>0&&await ge(Array.from(e.dataTransfer.files)))},I=async e=>{let t=e.target;t.files&&t.files.length>0&&await ge(Array.from(t.files)),y.value&&(y.value.value=``)},ge=async e=>{if(e.length!==0){o.value=!0;for(let t of e)try{let e=`new`,n=null,r=await fetch(`/api/admin/assets?search=${encodeURIComponent(t.name)}&limit=1`);if(r.ok){let i=(await r.json()).find(e=>e.filename===t.name);if(i){if(S.value={file:t,existingAsset:i},T.value=!0,e=await new Promise(e=>{C.value=e}),T.value=!1,S.value=null,e===`skip`)continue;e===`replace`&&(n=i.id)}}let a=new FormData;a.append(`file`,t,t.name),n&&a.append(`replaceAssetId`,n);let o=await fetch(`/api/admin/assets/upload`,{method:`POST`,body:a});if(o.ok){let e=await o.json();if(n){let r=i.value.findIndex(e=>e.id===n);r!==-1&&(i.value[r].url=`${e.url}?_t=${Date.now()}`,i.value[r].size=e.size||e.bytes||e.sizeBytes||t.size)}else i.value.unshift({id:e.id,filename:e.filename||t.name,mimeType:e.mimeType||t.type,size:e.size||e.bytes||e.sizeBytes||t.size,url:e.url,usageCount:0});window.dispatchEvent(new CustomEvent(`cms-assets-updated`))}}catch(e){console.error(`Failed to upload file from media pane:`,e)}o.value=!1}},_e=async(e=!1)=>{if(!a.value){a.value=!0,e&&(u.value=1,i.value=[]);try{let t=new URLSearchParams({page:String(u.value),limit:`24`,search:d.value,type:f.value,sort:p.value,order:m.value?`DESC`:`ASC`});r.value&&r.value!==`all`&&t.append(`channelId`,String(r.value)),g.value&&t.append(`nodeId`,g.value);let n=await fetch(`/api/admin/assets?${t.toString()}`);if(n.ok){let t=await n.json(),r=(Array.isArray(t)?t:t.items||t.assets||t.data||[]).map(e=>({...e,url:e.url||e.cdnUrl||`/media/${e.storageKeyPrivate||``}`,usageCount:e.usageCount||0,variantCount:e.variantCount||0,size:e.size??e.bytes??e.fileSize??e.sizeBytes??0,title:e.title||``,alt:e.alt||``}));i.value=e?r:[...i.value,...r],l.value=r.length>=24,u.value++}}catch(e){console.error(`Failed to load assets:`,e)}finally{a.value=!1}}},ve=async e=>{try{(await fetch(`/api/admin/assets/${e}`,{method:`DELETE`})).ok&&(i.value=i.value.filter(t=>t.id!==e),window.dispatchEvent(new CustomEvent(`cms-assets-updated`)))}catch(e){console.error(`Failed to delete asset:`,e)}},ye=()=>{Te(),x&&clearTimeout(x),x=setTimeout(()=>{_.value&&(_.value.scrollTop=0),_e(!0)},300)},be=()=>{m.value=!m.value,_.value&&(_.value.scrollTop=0),_e(!0)},xe=e=>{Te(),f.value=e,_.value&&(_.value.scrollTop=0),_e(!0)},Se=(e,t)=>e?e.startsWith(`image/`):/\.(jpg|jpeg|png|webp|gif|svg)$/i.test(t||``),Ce=async e=>{h.value=e.id,window.dispatchEvent(new CustomEvent(`cms-close-mobile-drawer`)),sp().activeView.value={type:`asset`,id:e.id}},we=e=>{g.value=e.detail,d.value=``,f.value=`all`,_.value&&(_.value.scrollTop=0),_e(!0)},Te=()=>{g.value=``},Ee=()=>{_e(!0)};return ni(r,()=>{_.value&&(_.value.scrollTop=0),_e(!0)}),Js(()=>{window.addEventListener(`cms-close-tree-menus`,M),window.addEventListener(`cms-filter-media-by-node`,we),window.addEventListener(`cms-assets-updated`,Ee),window.addEventListener(`cms-node-updated`,Ee);let e=sessionStorage.getItem(`cms-media-node-filter`);e&&(g.value=e,sessionStorage.removeItem(`cms-media-node-filter`)),_e(!0),b=new IntersectionObserver(e=>{e[0].isIntersecting&&l.value&&!a.value&&_e(!1)},{root:_.value,rootMargin:`100px`,threshold:.1}),v.value&&b.observe(v.value)}),Qs(()=>{window.removeEventListener(`cms-close-tree-menus`,M),window.removeEventListener(`cms-filter-media-by-node`,we),window.removeEventListener(`cms-assets-updated`,Ee),window.removeEventListener(`cms-node-updated`,Ee),b&&b.disconnect(),x&&clearTimeout(x)}),(e,t)=>(B(),V(`div`,{class:w([`media-pane`,{"is-dragging":s.value}]),onDragenter:ld(pe,[`prevent`]),onDragleave:ld(me,[`prevent`]),onDragover:ld(he,[`prevent`]),onDrop:ld(F,[`prevent`])},[T.value?(B(),V(`div`,UT,[U(`div`,WT,[U(`div`,GT,[q(z(jh),{size:20,class:`text-warning`}),t[10]||=U(`h3`,null,`File Already Exists`,-1)]),U(`div`,KT,[U(`p`,null,[t[11]||=W(`A file named `,-1),U(`strong`,null,L(S.value?.file.name),1),t[12]||=W(` is already in the media library.`,-1)]),S.value?.existingAsset?.usageCount>0||S.value?.existingAsset?.variantCount>0?(B(),V(`p`,qT,[t[16]||=W(` This image is `,-1),S.value.existingAsset.usageCount>0?(B(),V(K,{key:0},[t[13]||=W(` used on `,-1),U(`strong`,null,L(S.value.existingAsset.usageCount),1),t[14]||=W(` page(s) `,-1)],64)):G(``,!0),S.value.existingAsset.usageCount>0&&S.value.existingAsset.variantCount>0?(B(),V(K,{key:1},[W(` and has `)],64)):G(``,!0),S.value.existingAsset.variantCount>0?(B(),V(K,{key:2},[U(`strong`,null,L(S.value.existingAsset.variantCount),1),t[15]||=W(` crop variant(s) `,-1)],64)):G(``,!0),t[17]||=W(`. `,-1)])):G(``,!0)]),U(`div`,JT,[q(HT,{variant:`secondary`,onClick:t[0]||=e=>C.value?.(`skip`)},{default:qr(()=>[...t[18]||=[W(`Skip File`,-1)]]),_:1}),q(HT,{variant:`secondary`,onClick:t[1]||=e=>C.value?.(`new`)},{default:qr(()=>[...t[19]||=[W(`Upload as New (Keep Both)`,-1)]]),_:1}),q(HT,{variant:`primary`,onClick:t[2]||=e=>C.value?.(`replace`)},{default:qr(()=>[...t[20]||=[W(`Replace Master & Update Crops`,-1)]]),_:1})])])])):G(``,!0),U(`input`,{ref_key:`fileInputRef`,ref:y,type:`file`,multiple:``,class:`hidden-file-input`,onChange:I},null,544),s.value?(B(),V(`div`,YT,[q(z(wm),{size:32,class:`drop-icon`}),t[21]||=U(`span`,null,`Drop files to upload`,-1)])):G(``,!0),U(`div`,XT,[U(`div`,ZT,[q(z(xh),{size:13,class:`search-icon`}),Jr(U(`input`,{"onUpdate:modelValue":t[3]||=e=>d.value=e,type:`text`,placeholder:`Filter media library...`,class:`search-input`,onInput:ye},null,544),[[nd,d.value]])]),U(`div`,QT,[U(`button`,{class:w([`filter-pill`,{active:f.value===`all`&&!g.value}]),onClick:t[4]||=e=>xe(`all`)},` All `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`image`}]),onClick:t[5]||=e=>xe(`image`)},` Images `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`document`}]),onClick:t[6]||=e=>xe(`document`)},` Docs `,2),U(`button`,{class:w([`filter-pill`,{active:f.value===`video`}]),onClick:t[7]||=e=>xe(`video`)},` Media `,2)]),U(`div`,$T,[U(`div`,eE,[U(`button`,{class:`pane-icon-btn`,title:m.value?`Sort Descending`:`Sort Ascending`,onClick:be},[m.value?(B(),H(z(am),{key:0,size:13})):(B(),H(z(cm),{key:1,size:13}))],8,tE),U(`div`,{class:`sort-dropdown-wrapper`,ref_key:`sortMenuTriggerRef`,ref:O},[U(`button`,{class:`sort-trigger-btn`,title:`Change Sort Order`,onClick:ee},[U(`span`,nE,L(ne.value),1),q(z(_m),{size:13,class:`sort-chevron`})]),q(tg,{show:D.value,items:te.value,"anchor-rect":k.value,"min-width":`160px`,onSelect:A,onClose:t[8]||=e=>D.value=!1},null,8,[`show`,`items`,`anchor-rect`])],512)]),U(`button`,{class:`pane-icon-btn add-content-btn`,title:`Upload Media`,onClick:fe},[q(z(gh),{size:14})])])]),g.value?(B(),V(`div`,{key:2,class:`node-filter-banner`,title:`Clear filter`,onClick:t[9]||=e=>{Te(),_e(!0)}},` Showing assets used by selected node ✕ `)):G(``,!0),U(`div`,{ref_key:`scrollContainer`,ref:_,class:`media-scroll-area`},[o.value?(B(),V(`div`,rE,[q(z(nh),{size:14,class:`spin`}),t[22]||=U(`span`,null,`Uploading files...`,-1)])):G(``,!0),i.value.length>0?(B(),V(`div`,iE,[(B(!0),V(K,null,Xi(i.value,e=>(B(),H(dT,{key:e.id,variant:`media`,selected:h.value===e.id,draggable:`true`,onDragstart:t=>P(t,e),onClick:t=>Ce(e),onContextmenu:ld(t=>le(t,e),[`prevent`])},{default:qr(()=>[Se(e.mimeType,e.filename)?(B(),V(`div`,aE,[q(BT,{url:e.url,alt:e.alt||e.filename,width:120,quality:75},null,8,[`url`,`alt`])])):(B(),V(`div`,oE,[q(z(Im),{size:18,class:`doc-icon`})])),U(`div`,sE,[U(`span`,{class:`file-name`,title:e.filename},L(e.filename||`Asset`),9,cE),U(`div`,lE,[e.usageCount>0?(B(),V(`span`,{key:0,class:`node-tag-icon`,title:`Used in ${e.usageCount} node(s)`},[q(z(eh),{size:12}),U(`span`,dE,L(e.usageCount),1)],8,uE)):G(``,!0),e.variantCount>0?(B(),V(`span`,{key:1,class:`node-tag-icon variant-tag`,title:`Has ${e.variantCount} crop variant(s)`},[q(z(km),{size:12}),U(`span`,pE,L(e.variantCount),1)],8,fE)):G(``,!0),N(e)?(B(),V(`span`,mE,L(N(e)),1)):G(``,!0)])]),U(`div`,{class:w([`item-actions`,{"menu-open":re.value&&oe.value?.id===e.id}])},[U(`button`,{class:`more-btn`,title:`Asset Options`,onClick:ld(t=>ce(t,e),[`stop`])},[q(z(jm),{size:14})],8,hE)],2)]),_:2},1032,[`selected`,`onDragstart`,`onClick`,`onContextmenu`]))),128))])):!a.value&&!o.value?(B(),V(`div`,{key:2,class:`empty-media-state`,onClick:fe},[q(z(wm),{size:24,class:`empty-icon`}),U(`p`,null,L(g.value?`No assets used by this node.`:`No media files found.`),1),g.value?G(``,!0):(B(),V(`span`,gE,`Drop images or click to upload`))])):G(``,!0),U(`div`,{ref_key:`scrollSentinel`,ref:v,class:`scroll-sentinel`},[a.value&&u.value>1?(B(),V(`span`,_E,[q(z(nh),{size:12,class:`spin`}),t[23]||=W(` Loading assets... `,-1)])):!l.value&&i.value.length>0?(B(),V(`span`,vE,`All media loaded`)):G(``,!0)],512)],512),q(tg,{show:re.value&&!!oe.value,"anchor-rect":ae.value,x:ie.value,y:j.value,items:ue.value,onSelect:de,onClose:se},null,8,[`show`,`anchor-rect`,`x`,`y`,`items`])],34))}}),[[`__scopeId`,`data-v-aeb1381b`]]),bE={class:`panel-tree`},xE={class:`segmented-control`},SE={class:`pane-wrapper`},CE={class:`sidebar-footer`},wE=Yh(vi({__name:`SidebarLeft`,setup(e){let{setViewMode:t,activeViewMode:n,activeView:r,activeNode:i}=sp(),a=Zh(`kama_sidebar_tab`,`tree`),o=async()=>{await t(`trash`)},s=e=>{a.value=e,(e===`tree`||e===`vault`)&&r.value.type===`asset`&&(i.value?.id&&!String(i.value.id).startsWith(`draft-`)?r.value={type:`node`,id:String(i.value.id)}:t(`none`))},c=e=>{let t=e.detail;(t===`tree`||t===`vault`||t===`media`)&&s(t)};return Js(()=>{window.addEventListener(`cms-switch-sidebar-tab`,c)}),Qs(()=>{window.removeEventListener(`cms-switch-sidebar-tab`,c)}),(e,t)=>(B(),V(`aside`,bE,[q(ig),U(`div`,xE,[U(`button`,{class:w([`tab-btn`,{active:z(a)===`tree`}]),onClick:t[0]||=e=>s(`tree`)},[q(z(Rm),{size:13,class:`tab-icon`}),t[3]||=U(`span`,null,`Tree`,-1)],2),U(`button`,{class:w([`tab-btn`,{active:z(a)===`vault`}]),onClick:t[1]||=e=>s(`vault`)},[q(z(Am),{size:13,class:`tab-icon`}),t[4]||=U(`span`,null,`Vault`,-1)],2),U(`button`,{class:w([`tab-btn`,{active:z(a)===`media`}]),onClick:t[2]||=e=>s(`media`)},[q(z(Km),{size:13,class:`tab-icon`}),t[5]||=U(`span`,null,`Media`,-1)],2)]),U(`div`,SE,[z(a)===`tree`?(B(),H(lT,{key:0})):z(a)===`vault`?(B(),H(FT,{key:1})):z(a)===`media`?(B(),H(yE,{key:2})):G(``,!0)]),U(`div`,CE,[U(`button`,{class:w([`trash-btn`,{"is-active":z(n)===`trash`}]),onClick:o},[q(z(Ah),{size:14,class:`trash-icon`}),t[6]||=U(`span`,null,`Trash Bin`,-1)],2)])]))}}),[[`__scopeId`,`data-v-996950af`]]),TE=gn(null),EE=R(null);function DE(){return{activeEditor:TE,activeToolbar:EE,setActiveEditor:(e,t)=>{TE.value=e,EE.value=t},clearActiveEditor:e=>{e&&TE.value!==e||(TE.value=null,EE.value=null)},splitActiveBlock:()=>{TE.value&&typeof TE.value.cmsSplitBlock==`function`&&TE.value.cmsSplitBlock()}}}function OE(e){this.content=e}OE.prototype={constructor:OE,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new OE(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new OE(n)},addToStart:function(e,t){return new OE([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new OE(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new OE(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=OE.from(e),e.size?new OE(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=OE.from(e),e.size?new OE(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=OE.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},OE.from=function(e){if(e instanceof OE)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new OE(t)};function kE(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ME(e.charCodeAt(r-1))&&jE(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=kE(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function AE(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ME(e.charCodeAt(i-1))&&jE(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=AE(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function jE(e){return e>=56320&&e<57344}function ME(e){return e>=55296&&e<56320}var Z=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return kE(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return AE(this,e,t,n)}findIndex(e){if(e==0)return PE(0,e);if(e==this.size)return PE(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?PE(t+1,i):PE(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Z.empty=new Z([],0);var NE={index:0,offset:0};function PE(e,t){return NE.index=e,NE.offset=t,NE}function FE(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!FE(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!FE(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var IE=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&FE(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};IE.none=[];var LE=class extends Error{},Q=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zE(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(RE(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Z.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Q.empty=new Q(Z.empty,0,0);function RE(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(RE(a.content,t-i-1,n-i-1)))}function zE(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=zE(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function BE(e,t,n){if(n.openStart>e.depth)throw new LE(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new LE(`Inconsistent open depths`);return VE(e,t,n,0)}function VE(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=VE(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return KE(a,JE(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return KE(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=YE(n,e);return KE(a,qE(e,i,o,t,r))}}function HE(e,t){if(!t.type.compatibleContent(e.type))throw new LE(`Cannot join `+t.type.name+` onto `+e.type.name)}function UE(e,t,n){let r=e.node(n);return HE(r,t.node(n)),r}function WE(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function GE(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(WE(e.nodeAfter,r),a++));for(let e=a;e<o;e++)WE(i.child(e),r);t&&t.depth==n&&t.textOffset&&WE(t.nodeBefore,r)}function KE(e,t){if(!e.type.validContent(t))throw new LE(`Invalid content for node `+e.type.name);return e.copy(t)}function qE(e,t,n,r,i){let a=e.depth>i&&UE(e,t,i+1),o=r.depth>i&&UE(n,r,i+1),s=[];return GE(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(HE(a,o),WE(KE(a,qE(e,t,n,r,i+1)),s)):(a&&WE(KE(a,JE(e,t,i+1)),s),GE(t,n,i,s),o&&WE(KE(o,JE(n,r,i+1)),s)),GE(r,null,i,s),new Z(s)}function JE(e,t,n){let r=[];return GE(null,e,n,r),e.depth>n&&WE(KE(UE(e,t,n+1),JE(e,t,n+1)),r),GE(t,null,n,r),new Z(r)}function YE(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Z.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var XE=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return IE.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new eD(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=$E.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else $E.set(t,r=new ZE);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%QE,i}},ZE=class{constructor(){this.elts=[],this.i=0}},QE=12,$E=new WeakMap,eD=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},tD=Object.create(null),nD=class e{constructor(e,t,n,r=IE.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&FE(this.attrs,t||e.defaultAttrs||tD)&&IE.sameSet(this.marks,n||IE.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Q.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Q(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return BE(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return XE.resolveCached(this,e)}resolveNoCache(e){return XE.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),iD(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Z.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=IE.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!IE.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Z.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};nD.prototype.text=void 0;var rD=class e extends nD{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iD(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function iD(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var aD=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new oD(t,n);if(r.next==null)return e.empty;let i=sD(r);r.next&&r.err(`Unexpected trailing text`);let a=_D(mD(i));return vD(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Z.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
18
18
  `)}};aD.empty=new aD(!0);var oD=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function sD(e){let t=[];do t.push(cD(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function cD(e){let t=[];do t.push(lD(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function lD(e){let t=pD(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=dD(e,t);else break;return t}function uD(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function dD(e,t){let n=uD(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:uD(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function fD(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function pD(e){if(e.eat(`(`)){let t=sD(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=fD(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function mD(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function hD(e,t){return t-e}function gD(e,t){let n=[];return r(t),n.sort(hD);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function _D(e){let t=Object.create(null);return n(gD(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);gD(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new aD(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(hD);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function vD(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function yD(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function bD(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function xD(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function SD(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new TD(e,r,t[r]);return n}var CD=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=SD(e,n.attrs),this.defaultAttrs=yD(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==aD.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:bD(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new nD(this,this.computeAttrs(e),Z.from(t),IE.setFrom(n))}createChecked(e=null,t,n){return t=Z.from(t),this.checkContent(t),new nD(this,this.computeAttrs(e),t,IE.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Z.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Z.empty,!0);return i?new nD(this,e,t.append(i),IE.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){xD(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:IE.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function wD(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var TD=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?wD(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ED=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=SD(e,r.attrs),this.excluded=null;let i=yD(this.attrs);this.instance=i?new IE(this,i):null}create(e=null){return!e&&this.instance?this.instance:new IE(this,bD(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){xD(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},DD=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=OE.from(e.nodes),t.marks=OE.from(e.marks||{}),this.nodes=CD.compile(this.spec.nodes,this),this.marks=ED.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=aD.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?OD(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:OD(this,n.split(` `))}this.nodeFromJSON=e=>nD.fromJSON(this,e),this.markFromJSON=e=>IE.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof CD))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new rD(n,n.defaultAttrs,e,IE.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function OD(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function kD(e){return e.tag!=null}function AD(e){return e.style!=null}var jD=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(kD(e))this.tags.push(e);else if(AD(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new BD(this,t,!1);return n.addAll(e,IE.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new BD(this,t,!0);return n.addAll(e,IE.none,t.from,t.to),Q.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(HD(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=UD(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=UD(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},MD={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ND={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},PD={ol:!0,ul:!0},FD=1,ID=2,LD=4;function RD(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?FD:0)|(t===`full`?ID:0)}var zD=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=IE.none,this.match=i||(a&LD?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Z.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&FD)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=Z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Z.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!MD.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},BD=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=RD(null,t.preserveWhitespace,0)|(n?LD:0);i=r?new zD(r.type,r.attrs,IE.none,!0,t.topMatch||r.type.contentMatch,a):n?new zD(null,null,IE.none,!0,null,a):new zD(e.schema.topNodeType,null,IE.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&ID?`full`:this.localPreserveWS||(r.options&FD)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
19
19
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;PD.hasOwnProperty(a)&&this.parser.normalizeLists&&VD(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ND.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(MD.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
20
20
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=IE.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):WD(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=RD(e,i,a.options);a.options&LD&&a.content.length==0&&(o|=LD);let s=IE.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):WD(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new zD(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=FD);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function VD(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&PD.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function HD(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function UD(e){let t={};for(let n in e)t[n]=e[n];return t}function WD(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var GD=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=qD(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return qD(t).createTextNode(e.text);let{dom:n,contentDOM:r}=ZD(qD(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ZD(qD(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:ZD(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=KD(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return KD(e.marks)}};function KD(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function qD(e){return e.document||window.document}var JD=new WeakMap;function YD(e){let t=JD.get(e);return t===void 0&&JD.set(e,t=XD(e)),t}function XD(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function ZD(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=YD(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=ZD(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var QD=65535,$D=2**16;function eO(e,t){return e+t*$D}function tO(e){return e&QD}function nO(e){return(e-(e&QD))/$D}var rO=1,iO=2,aO=4,oO=8,sO=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&oO)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&aO)>0}},cO=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=tO(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+nO(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:eO(o/3,e-s),f=e==s?iO:e==u?rO:aO;return(t<0?e!=s:e!=u)&&(f|=oO),new sO(a,f,d)}r+=l-c}return n?e+r:new sO(e+r,0,null)}touches(e,t){let n=0,r=tO(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};cO.empty=new cO([]);var lO=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new sO(e,r,null)}},uO=Object.create(null),dO=class{getMap(){return cO.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=uO[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in uO)throw RangeError(`Duplicate use of step JSON ID `+e);return uO[e]=t,t.prototype.jsonID=e,t}},fO=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof LE)return e.fail(t.message);throw t}}};function pO(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(pO(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Z.fromArray(r)}var mO=class e extends dO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Q(pO(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return fO.fromReplace(e,this.from,this.to,i)}invert(){return new hO(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};dO.jsonID(`addMark`,mO);var hO=class e extends dO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Q(pO(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return fO.fromReplace(e,this.from,this.to,n)}invert(){return new mO(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};dO.jsonID(`removeMark`,hO);var gO=class e extends dO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return fO.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return fO.fromReplace(e,this.pos,this.pos+1,new Q(Z.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new _O(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};dO.jsonID(`addNodeMark`,gO);var _O=class e extends dO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return fO.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return fO.fromReplace(e,this.pos,this.pos+1,new Q(Z.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new gO(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};dO.jsonID(`removeNodeMark`,_O);var vO=class e extends dO{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&bO(e,this.from,this.to)?fO.fail(`Structure replace would overwrite content`):fO.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cO([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Q.empty:new Q(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Q.empty:new Q(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,Q.fromJSON(t,n.slice),!!n.structure)}};vO.MAP_BIAS=1,dO.jsonID(`replace`,vO);var yO=class e extends dO{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(bO(e,this.from,this.gapFrom)||bO(e,this.gapTo,this.to)))return fO.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return fO.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?fO.fromReplace(e,this.from,this.to,n):fO.fail(`Content does not fit in gap`)}getMap(){return new cO([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(t,n.slice),n.insert,!!n.structure)}};dO.jsonID(`replaceAround`,yO);function bO(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function xO(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new hO(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new mO(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function SO(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof ED){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new hO(t.from,t.to,t.style)))}function CO(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new vO(s,l,Q.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new hO(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new Q(Z.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new vO(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(Z.empty,!0);e.replace(s,s,new Q(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function wO(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function TO(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!wO(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function EO(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=Z.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=Z.from(r.node(e).copy(u)),d++):c--;let f=Z.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=Z.from(i.node(e).copy(f)),p++):l++;e.step(new yO(c,l,o,s,new Q(u.append(f),d,p),u.size-d,!0))}function DO(e,t,n=null,r=e){let i=kO(e,t),a=i&&AO(r,t);return a?i.map(OO).concat({type:t,attrs:n}).concat(a.map(OO)):null}function OO(e){return{type:e,attrs:null}}function kO(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function AO(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function jO(e,t,n){let r=Z.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=Z.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new yO(i,a,i,a,new Q(r,0,0),n.length,!0))}function MO(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&FO(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&PO(e,t,n,a),CO(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new yO(c,l,c+1,l-1,new Q(Z.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&NO(e,t,n,a),!1}})}function NO(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function PO(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`