UNPKG

@runeya/runeya

Version:

Monitor processes as a stack

1 lines 50.5 kB
import{r as Tt,a as Et,o as F,m as Ge,g as Bt,v as Ze,a1 as St,t as ge,b as Y,n as me,j as Je,s as Ct,f as P,e as wt,Z as V,k as j}from"./index-CXxIspfv.js";import{a as fe,v as Qe}from"./router-CdfdQZKk.js";import{_ as tn}from"./Section-D0z9MjV4.js";import{s as en}from"./index-BF7FF_-U.js";import{_ as pe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import nn from"./Markdown-plhGD_CA.js";import{a as rn,s as ne}from"./index-CVX2mTq9.js";import{s as sn}from"./index-DFxHrn4y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-B--wgkn6.js";import"./index-Bv49zKKl.js";import"./index-OI8gr_S5.js";import"./index-CMj4Y1Yg.js";const on={key:1},an={key:2,class:"actions"},ln={__name:"Leaf",props:{node:{default:{key:""}},service:{type:fe},tree:{default:[]},active:{type:Boolean,default:!1}},emits:["updateDoc"],setup(n,{emit:t}){const e=Tt(!1),r=n,o=t;async function s(){e.value=!1,o("updateDoc",r.node)}return(a,i)=>(F(),Et("div",{class:me(["leaf-root",{active:n.active}]),onClick:i[6]||(i[6]=St(l=>a.$emit("select"),["stop"]))},[e.value?Ge((F(),Et("input",{key:0,"onUpdate:modelValue":i[0]||(i[0]=l=>n.node.label=l),onChange:i[1]||(i[1]=l=>s()),onBlur:i[2]||(i[2]=l=>s()),onClick:i[3]||(i[3]=St(()=>{},["stop"]))},null,544)),[[Ze,n.node.label]]):(F(),Et("div",on,ge(n.node.label),1)),e.value?Bt("",!0):(F(),Et("div",an,[Y("i",{class:"fas fa-edit",onClick:i[4]||(i[4]=St(l=>e.value=!0,["stop"]))}),Y("i",{class:"fas fa-trash",onClick:i[5]||(i[5]=St(l=>a.$emit("deleteDoc",n.node),["stop"]))})]))],2))}},cn=pe(ln,[["__scopeId","data-v-c7cf6c6d"]]);class w{constructor(t){this._canceled=!1,this.data=t}get type(){return this.constructor.type}get cancelable(){return this.constructor.cancelable}cancel(){this._canceled=!0}canceled(){return this._canceled}clone(t){return new this.constructor({...this.data,...t})}}w.type="event";w.cancelable=!1;class M{constructor(t){this.draggable=t}attach(){throw new Error("Not Implemented")}detach(){throw new Error("Not Implemented")}}const $={mouse:0,drag:0,touch:100};class ve{constructor(t=[],e={}){this.containers=[...t],this.options={...e},this.dragging=!1,this.currentContainer=null,this.originalSource=null,this.startEvent=null,this.delay=dn(e.delay)}attach(){return this}detach(){return this}addContainer(...t){this.containers=[...this.containers,...t]}removeContainer(...t){this.containers=this.containers.filter(e=>!t.includes(e))}trigger(t,e){const r=document.createEvent("Event");return r.detail=e,r.initEvent(e.type,!0,!0),t.dispatchEvent(r),this.lastEvent=e,e}}function dn(n){const t={};if(n===void 0)return{...$};if(typeof n=="number"){for(const e in $)Object.prototype.hasOwnProperty.call($,e)&&(t[e]=n);return t}for(const e in $)Object.prototype.hasOwnProperty.call($,e)&&(n[e]===void 0?t[e]=$[e]:t[e]=n[e]);return t}function S(n,t){if(n==null)return null;function e(o){return o==null||t==null?!1:un(t)?Element.prototype.matches.call(o,t):hn(t)?[...t].includes(o):gn(t)?t===o:mn(t)?t(o):!1}let r=n;do{if(r=r.correspondingUseElement||r.correspondingElement||r,e(r))return r;r=(r==null?void 0:r.parentNode)||null}while(r!=null&&r!==document.body&&r!==document);return null}function un(n){return typeof n=="string"}function hn(n){return n instanceof NodeList||n instanceof Array}function gn(n){return n instanceof Node}function mn(n){return typeof n=="function"}function be(n,t,e,r){return Math.sqrt((e-n)**2+(r-t)**2)}class Yt extends w{get originalEvent(){return this.data.originalEvent}get clientX(){return this.data.clientX}get clientY(){return this.data.clientY}get target(){return this.data.target}get container(){return this.data.container}get originalSource(){return this.data.originalSource}get pressure(){return this.data.pressure}}class _t extends Yt{}_t.type="drag:start";class Ht extends Yt{}Ht.type="drag:move";class Wt extends Yt{}Wt.type="drag:stop";class fn extends Yt{}fn.type="drag:pressure";const R=Symbol("onContextMenuWhileDragging"),_=Symbol("onMouseDown"),H=Symbol("onMouseMove"),W=Symbol("onMouseUp"),xt=Symbol("startDrag"),T=Symbol("onDistanceChange");class pn extends ve{constructor(t=[],e={}){super(t,e),this.mouseDownTimeout=null,this.pageX=null,this.pageY=null,this[R]=this[R].bind(this),this[_]=this[_].bind(this),this[H]=this[H].bind(this),this[W]=this[W].bind(this),this[xt]=this[xt].bind(this),this[T]=this[T].bind(this)}attach(){document.addEventListener("mousedown",this[_],!0)}detach(){document.removeEventListener("mousedown",this[_],!0)}[_](t){if(t.button!==0||t.ctrlKey||t.metaKey)return;const e=S(t.target,this.containers);if(!e||this.options.handle&&t.target&&!S(t.target,this.options.handle))return;const r=S(t.target,this.options.draggable);if(!r)return;const{delay:o}=this,{pageX:s,pageY:a}=t;Object.assign(this,{pageX:s,pageY:a}),this.onMouseDownAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=r,document.addEventListener("mouseup",this[W]),document.addEventListener("dragstart",re),document.addEventListener("mousemove",this[T]),this.mouseDownTimeout=window.setTimeout(()=>{this[T]({pageX:this.pageX,pageY:this.pageY})},o.mouse)}[xt](){const t=this.startEvent,e=this.currentContainer,r=this.originalSource,o=new _t({clientX:t.clientX,clientY:t.clientY,target:t.target,container:e,originalSource:r,originalEvent:t});this.trigger(this.currentContainer,o),this.dragging=!o.canceled(),this.dragging&&(document.addEventListener("contextmenu",this[R],!0),document.addEventListener("mousemove",this[H]))}[T](t){const{pageX:e,pageY:r}=t,{distance:o}=this.options,{startEvent:s,delay:a}=this;if(Object.assign(this,{pageX:e,pageY:r}),!this.currentContainer)return;const i=Date.now()-this.onMouseDownAt,l=be(s.pageX,s.pageY,e,r)||0;clearTimeout(this.mouseDownTimeout),i<a.mouse?document.removeEventListener("mousemove",this[T]):l>=o&&(document.removeEventListener("mousemove",this[T]),this[xt]())}[H](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=new Ht({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}[W](t){if(clearTimeout(this.mouseDownTimeout),t.button!==0||(document.removeEventListener("mouseup",this[W]),document.removeEventListener("dragstart",re),document.removeEventListener("mousemove",this[T]),!this.dragging))return;const e=document.elementFromPoint(t.clientX,t.clientY),r=new Wt({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r),document.removeEventListener("contextmenu",this[R],!0),document.removeEventListener("mousemove",this[H]),this.currentContainer=null,this.dragging=!1,this.startEvent=null}[R](t){t.preventDefault()}}function re(n){n.preventDefault()}function N(n){const{touches:t,changedTouches:e}=n;return t&&t[0]||e&&e[0]}const U=Symbol("onTouchStart"),X=Symbol("onTouchEnd"),K=Symbol("onTouchMove"),Dt=Symbol("startDrag"),A=Symbol("onDistanceChange");let At=!1;window.addEventListener("touchmove",n=>{At&&n.preventDefault()},{passive:!1});class vn extends ve{constructor(t=[],e={}){super(t,e),this.currentScrollableParent=null,this.tapTimeout=null,this.touchMoved=!1,this.pageX=null,this.pageY=null,this[U]=this[U].bind(this),this[X]=this[X].bind(this),this[K]=this[K].bind(this),this[Dt]=this[Dt].bind(this),this[A]=this[A].bind(this)}attach(){document.addEventListener("touchstart",this[U])}detach(){document.removeEventListener("touchstart",this[U])}[U](t){const e=S(t.target,this.containers);if(!e||this.options.handle&&t.target&&!S(t.target,this.options.handle))return;const r=S(t.target,this.options.draggable);if(!r)return;const{distance:o=0}=this.options,{delay:s}=this,{pageX:a,pageY:i}=N(t);Object.assign(this,{pageX:a,pageY:i}),this.onTouchStartAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=r,document.addEventListener("touchend",this[X]),document.addEventListener("touchcancel",this[X]),document.addEventListener("touchmove",this[A]),e.addEventListener("contextmenu",se),o&&(At=!0),this.tapTimeout=window.setTimeout(()=>{this[A]({touches:[{pageX:this.pageX,pageY:this.pageY}]})},s.touch)}[Dt](){const t=this.startEvent,e=this.currentContainer,r=N(t),o=this.originalSource,s=new _t({clientX:r.pageX,clientY:r.pageY,target:t.target,container:e,originalSource:o,originalEvent:t});this.trigger(this.currentContainer,s),this.dragging=!s.canceled(),this.dragging&&document.addEventListener("touchmove",this[K]),At=this.dragging}[A](t){const{distance:e}=this.options,{startEvent:r,delay:o}=this,s=N(r),a=N(t),i=Date.now()-this.onTouchStartAt,l=be(s.pageX,s.pageY,a.pageX,a.pageY);Object.assign(this,a),clearTimeout(this.tapTimeout),i<o.touch?document.removeEventListener("touchmove",this[A]):l>=e&&(document.removeEventListener("touchmove",this[A]),this[Dt]())}[K](t){if(!this.dragging)return;const{pageX:e,pageY:r}=N(t),o=document.elementFromPoint(e-window.scrollX,r-window.scrollY),s=new Ht({clientX:e,clientY:r,target:o,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s)}[X](t){if(clearTimeout(this.tapTimeout),At=!1,document.removeEventListener("touchend",this[X]),document.removeEventListener("touchcancel",this[X]),document.removeEventListener("touchmove",this[A]),this.currentContainer&&this.currentContainer.removeEventListener("contextmenu",se),!this.dragging)return;document.removeEventListener("touchmove",this[K]);const{pageX:e,pageY:r}=N(t),o=document.elementFromPoint(e-window.scrollX,r-window.scrollY);t.preventDefault();const s=new Wt({clientX:e,clientY:r,target:o,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s),this.currentContainer=null,this.dragging=!1,this.startEvent=null}}function se(n){n.preventDefault(),n.stopPropagation()}class Ut extends w{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}Ut.type="collidable";class bn extends Ut{get collidingElement(){return this.data.collidingElement}}bn.type="collidable:in";class yn extends Ut{get collidingElement(){return this.data.collidingElement}}yn.type="collidable:out";function ye(n,t){return function(e){Sn(t,"addInitializer"),Ft(e,"An initializer"),n.push(e)}}function kt(n,t){if(!n(t))throw new TypeError("Attempted to access private element on non-instance")}function En(n,t,e,r,o,s,a,i,l,g,p){var c;switch(s){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var d,m,u={kind:c,name:i?"#"+e:e,static:a,private:i,metadata:p},h={v:!1};if(s!==0&&(u.addInitializer=ye(o,h)),i||s!==0&&s!==2)if(s===2)d=function(v){return kt(g,v),r.value};else{var b=s===0||s===1;(b||s===3)&&(d=i?function(v){return kt(g,v),r.get.call(v)}:function(v){return r.get.call(v)}),(b||s===4)&&(m=i?function(v,y){kt(g,v),r.set.call(v,y)}:function(v,y){r.set.call(v,y)})}else d=function(v){return v[e]},s===0&&(m=function(v,y){v[e]=y});var f=i?g.bind():function(v){return e in v};u.access=d&&m?{get:d,set:m,has:f}:d?{get:d,has:f}:{set:m,has:f};try{return n.call(t,l,u)}finally{h.v=!0}}function Sn(n,t){if(n.v)throw new Error("attempted to call "+t+" after decoration was finished")}function Ft(n,t){if(typeof n!="function")throw new TypeError(t+" must be a function")}function Ee(n,t){var e=typeof t;if(n===1){if(e!=="object"||t===null)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");t.get!==void 0&&Ft(t.get,"accessor.get"),t.set!==void 0&&Ft(t.set,"accessor.set"),t.init!==void 0&&Ft(t.init,"accessor.init")}else if(e!=="function"){var r;throw r=n===0?"field":n===5?"class":"method",new TypeError(r+" decorators must return a function or void 0")}}function Cn(n){return function(){return n(this)}}function wn(n){return function(t){n(this,t)}}function xn(n,t,e,r,o,s,a,i,l,g,p){var c,d,m,u,h,b,f=e[0];r||Array.isArray(f)||(f=[f]),i?c=s===0||s===1?{get:Cn(e[3]),set:wn(e[4])}:s===3?{get:e[3]}:s===4?{set:e[3]}:{value:e[3]}:s!==0&&(c=Object.getOwnPropertyDescriptor(t,o)),s===1?m={get:c.get,set:c.set}:s===2?m=c.value:s===3?m=c.get:s===4&&(m=c.set);for(var v=r?2:1,y=f.length-1;y>=0;y-=v){var E;(u=En(f[y],r?f[y-1]:void 0,o,c,l,s,a,i,m,g,p))!==void 0&&(Ee(s,u),s===0?E=u:s===1?(E=u.init,h=u.get||m.get,b=u.set||m.set,m={get:h,set:b}):m=u,E!==void 0&&(d===void 0?d=E:typeof d=="function"?d=[d,E]:d.push(E)))}if(s===0||s===1){if(d===void 0)d=function(D,C){return C};else if(typeof d!="function"){var x=d;d=function(D,C){for(var Nt=C,It=x.length-1;It>=0;It--)Nt=x[It].call(D,Nt);return Nt}}else{var L=d;d=function(D,C){return L.call(D,C)}}n.push(d)}s!==0&&(s===1?(c.get=m.get,c.set=m.set):s===2?c.value=m:s===3?c.get=m:s===4&&(c.set=m),i?s===1?(n.push(function(D,C){return m.get.call(D,C)}),n.push(function(D,C){return m.set.call(D,C)})):s===2?n.push(m):n.push(function(D,C){return m.call(D,C)}):Object.defineProperty(t,o,c))}function Dn(n,t,e,r){for(var o,s,a,i=[],l=new Map,g=new Map,p=0;p<t.length;p++){var c=t[p];if(Array.isArray(c)){var d,m,u=c[1],h=c[2],b=c.length>3,f=16&u,v=!!(8&u),y=e;if(u&=7,v?(d=n,u!==0&&(m=s=s||[]),b&&!a&&(a=function(L){return Mn(L)===n}),y=a):(d=n.prototype,u!==0&&(m=o=o||[])),u!==0&&!b){var E=v?g:l,x=E.get(h)||0;if(x===!0||x===3&&u!==4||x===4&&u!==3)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);E.set(h,!(!x&&u>2)||u)}xn(i,d,c,f,h,u,v,b,m,y,r)}}return oe(i,o),oe(i,s),i}function oe(n,t){t&&n.push(function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e})}function On(n,t,e,r){if(t.length){for(var o=[],s=n,a=n.name,i=1,l=t.length-1;l>=0;l-=i){var g={v:!1};try{var p=t[l].call(e?t[l-1]:void 0,s,{kind:"class",name:a,addInitializer:ye(o,g),metadata:r})}finally{g.v=!0}p!==void 0&&(Ee(5,p),s=p)}return[Se(s,r),function(){for(var c=0;c<o.length;c++)o[c].call(s)}]}}function Se(n,t){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}function Ce(n,t,e,r,o,s){if(arguments.length>=6)var a=s[Symbol.metadata||Symbol.for("Symbol.metadata")];var i=Object.create(a===void 0?null:a),l=Dn(n,t,o,i);return e.length||Se(n,i),{e:l,get c(){return On(n,e,r,i)}}}function Mn(n){if(Object(n)!==n)throw TypeError("right-hand side of 'in' should be an object, got "+(n!==null?typeof n:"null"));return n}function Pt(n,{name:t,addInitializer:e}){e(function(){this[t]=n.bind(this)})}function Ln(n){return requestAnimationFrame(()=>{requestAnimationFrame(n)})}class O extends w{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get mirror(){return this.data.mirror}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}O.type="drag";class Kt extends O{}Kt.type="drag:start";Kt.cancelable=!0;class we extends O{}we.type="drag:move";class $t extends O{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}$t.type="drag:over";$t.cancelable=!0;function Tn(n){return n.type===$t.type}class xe extends O{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}xe.type="drag:out";class De extends O{get overContainer(){return this.data.overContainer}}De.type="drag:over:container";class Oe extends O{get overContainer(){return this.data.overContainer}}Oe.type="drag:out:container";class Me extends O{get pressure(){return this.data.pressure}}Me.type="drag:pressure";class Gt extends O{}Gt.type="drag:stop";Gt.cancelable=!0;class Le extends O{}Le.type="drag:stopped";var Te,Ae;class An extends M{constructor(t){Te(super(t)),this.lastWidth=0,this.lastHeight=0,this.mirror=null}attach(){this.draggable.on("mirror:created",this.onMirrorCreated).on("drag:over",this.onDragOver).on("drag:over:container",this.onDragOver)}detach(){this.draggable.off("mirror:created",this.onMirrorCreated).off("mirror:destroy",this.onMirrorDestroy).off("drag:over",this.onDragOver).off("drag:over:container",this.onDragOver)}getOptions(){return this.draggable.options.resizeMirror||{}}onMirrorCreated({mirror:t}){this.mirror=t}onMirrorDestroy(){this.mirror=null}onDragOver(t){this.resize(t)}resize(t){requestAnimationFrame(()=>{let e=null;const{overContainer:r}=t;if(this.mirror==null||this.mirror.parentNode==null)return;this.mirror.parentNode!==r&&r.appendChild(this.mirror),Tn(t)&&(e=t.over);const o=e||this.draggable.getDraggableElementsForContainer(r)[0];o&&Ln(()=>{const s=o.getBoundingClientRect();this.mirror==null||this.lastHeight===s.height&&this.lastWidth===s.width||(this.mirror.style.width=`${s.width}px`,this.mirror.style.height=`${s.height}px`,this.lastWidth=s.width,this.lastHeight=s.height)})})}}Ae=An;[Te]=Ce(Ae,[[Pt,2,"onMirrorCreated"],[Pt,2,"onMirrorDestroy"],[Pt,2,"onDragOver"]],[],0,void 0,M).e;class Zt extends w{get dragEvent(){return this.data.dragEvent}get snappable(){return this.data.snappable}}Zt.type="snap";class Fe extends Zt{}Fe.type="snap:in";Fe.cancelable=!0;class Pe extends Zt{}Pe.type="snap:out";Pe.cancelable=!0;var Xe,Ye;const Fn={duration:150,easingFunction:"ease-in-out",horizontal:!1};class Pn extends M{constructor(t){Xe(super(t)),this.options={...Fn,...this.getOptions()},this.lastAnimationFrame=null}attach(){this.draggable.on("sortable:sorted",this.onSortableSorted)}detach(){this.draggable.off("sortable:sorted",this.onSortableSorted)}getOptions(){return this.draggable.options.swapAnimation||{}}onSortableSorted({oldIndex:t,newIndex:e,dragEvent:r}){const{source:o,over:s}=r;this.lastAnimationFrame&&cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame(()=>{t>=e?ie(o,s,this.options):ie(s,o,this.options)})}}Ye=Pn;[Xe]=Ce(Ye,[[Pt,2,"onSortableSorted"]],[],0,void 0,M).e;function ie(n,t,{duration:e,easingFunction:r,horizontal:o}){for(const s of[n,t])s.style.pointerEvents="none";if(o){const s=n.offsetWidth;n.style.transform=`translate3d(${s}px, 0, 0)`,t.style.transform=`translate3d(-${s}px, 0, 0)`}else{const s=n.offsetHeight;n.style.transform=`translate3d(0, ${s}px, 0)`,t.style.transform=`translate3d(0, -${s}px, 0)`}requestAnimationFrame(()=>{for(const s of[n,t])s.addEventListener("transitionend",$e),s.style.transition=`transform ${e}ms ${r}`,s.style.transform=""})}function $e(n){n.target==null||!Xn(n.target)||(n.target.style.transition="",n.target.style.pointerEvents="",n.target.removeEventListener("transitionend",$e))}function Xn(n){return"style"in n}const G=Symbol("onSortableSorted"),Z=Symbol("onSortableSort"),Yn={duration:150,easingFunction:"ease-in-out"};class $n extends M{constructor(t){super(t),this.options={...Yn,...this.getOptions()},this.lastAnimationFrame=null,this.lastElements=[],this[G]=this[G].bind(this),this[Z]=this[Z].bind(this)}attach(){this.draggable.on("sortable:sort",this[Z]),this.draggable.on("sortable:sorted",this[G])}detach(){this.draggable.off("sortable:sort",this[Z]),this.draggable.off("sortable:sorted",this[G])}getOptions(){return this.draggable.options.sortAnimation||{}}[Z]({dragEvent:t}){const{sourceContainer:e}=t,r=this.draggable.getDraggableElementsForContainer(e);this.lastElements=Array.from(r).map(o=>({domEl:o,offsetTop:o.offsetTop,offsetLeft:o.offsetLeft}))}[G]({oldIndex:t,newIndex:e}){if(t===e)return;const r=[];let o,s,a;t>e?(o=e,s=t-1,a=1):(o=t+1,s=e,a=-1);for(let i=o;i<=s;i++){const l=this.lastElements[i],g=this.lastElements[i+a];r.push({from:l,to:g})}cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame(()=>{r.forEach(i=>Nn(i,this.options))})}}function Nn({from:n,to:t},{duration:e,easingFunction:r}){const o=n.domEl,s=n.offsetLeft-t.offsetLeft,a=n.offsetTop-t.offsetTop;o.style.pointerEvents="none",o.style.transform=`translate3d(${s}px, ${a}px, 0)`,requestAnimationFrame(()=>{o.addEventListener("transitionend",Ne),o.style.transition=`transform ${e}ms ${r}`,o.style.transform=""})}function Ne(n){n.target.style.transition="",n.target.style.pointerEvents="",n.target.removeEventListener("transitionend",Ne)}const Ot=Symbol("onInitialize"),Mt=Symbol("onDestroy"),ae=Symbol("announceEvent"),zt=Symbol("announceMessage"),In="aria-relevant",kn="aria-atomic",zn="aria-live",Bn="role",qn={expire:7e3};class Vn extends M{constructor(t){super(t),this.options={...qn,...this.getOptions()},this.originalTriggerMethod=this.draggable.trigger,this[Ot]=this[Ot].bind(this),this[Mt]=this[Mt].bind(this)}attach(){this.draggable.on("draggable:initialize",this[Ot])}detach(){this.draggable.off("draggable:destroy",this[Mt])}getOptions(){return this.draggable.options.announcements||{}}[ae](t){const e=this.options[t.type];e&&typeof e=="string"&&this[zt](e),e&&typeof e=="function"&&this[zt](e(t))}[zt](t){jn(t,{expire:this.options.expire})}[Ot](){this.draggable.trigger=t=>{try{this[ae](t)}finally{this.originalTriggerMethod.call(this.draggable,t)}}}[Mt](){this.draggable.trigger=this.originalTriggerMethod}}const qt=Rn();function jn(n,{expire:t}){const e=document.createElement("div");return e.textContent=n,qt.appendChild(e),setTimeout(()=>{qt.removeChild(e)},t)}function Rn(){const n=document.createElement("div");return n.setAttribute("id","draggable-live-region"),n.setAttribute(In,"additions"),n.setAttribute(kn,"true"),n.setAttribute(zn,"assertive"),n.setAttribute(Bn,"log"),n.style.position="fixed",n.style.width="1px",n.style.height="1px",n.style.top="-1px",n.style.overflow="hidden",n}document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(qt)});const J=Symbol("onInitialize"),I=Symbol("onDestroy"),_n={};class Hn extends M{constructor(t){super(t),this.options={..._n,...this.getOptions()},this[J]=this[J].bind(this),this[I]=this[I].bind(this)}attach(){this.draggable.on("draggable:initialize",this[J]).on("draggable:destroy",this[I])}detach(){this.draggable.off("draggable:initialize",this[J]).off("draggable:destroy",this[I]),this[I]()}getOptions(){return this.draggable.options.focusable||{}}getElements(){return[...this.draggable.containers,...this.draggable.getDraggableElements()]}[J](){requestAnimationFrame(()=>{this.getElements().forEach(t=>Wn(t))})}[I](){requestAnimationFrame(()=>{this.getElements().forEach(t=>Un(t))})}}const Vt=[];function Wn(n){!n.getAttribute("tabindex")&&n.tabIndex===-1&&(Vt.push(n),n.tabIndex=0)}function Un(n){const t=Vt.indexOf(n);t!==-1&&(n.tabIndex=-1,Vt.splice(t,1))}class B extends w{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get dragEvent(){return this.data.dragEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}class Ie extends B{}Ie.type="mirror:create";class ke extends B{get mirror(){return this.data.mirror}}ke.type="mirror:created";class ze extends B{get mirror(){return this.data.mirror}}ze.type="mirror:attached";class Jt extends B{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}Jt.type="mirror:move";Jt.cancelable=!0;class Be extends B{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}Be.type="mirror:moved";class Qt extends B{get mirror(){return this.data.mirror}}Qt.type="mirror:destroy";Qt.cancelable=!0;const Q=Symbol("onDragStart"),tt=Symbol("onDragMove"),et=Symbol("onDragStop"),nt=Symbol("onMirrorCreated"),rt=Symbol("onMirrorMove"),st=Symbol("onScroll"),le=Symbol("getAppendableContainer"),Kn={constrainDimensions:!1,xAxis:!0,yAxis:!0,cursorOffsetX:null,cursorOffsetY:null,thresholdX:null,thresholdY:null};class Gn extends M{constructor(t){super(t),this.options={...Kn,...this.getOptions()},this.scrollOffset={x:0,y:0},this.initialScrollOffset={x:window.scrollX,y:window.scrollY},this[Q]=this[Q].bind(this),this[tt]=this[tt].bind(this),this[et]=this[et].bind(this),this[nt]=this[nt].bind(this),this[rt]=this[rt].bind(this),this[st]=this[st].bind(this)}attach(){this.draggable.on("drag:start",this[Q]).on("drag:move",this[tt]).on("drag:stop",this[et]).on("mirror:created",this[nt]).on("mirror:move",this[rt])}detach(){this.draggable.off("drag:start",this[Q]).off("drag:move",this[tt]).off("drag:stop",this[et]).off("mirror:created",this[nt]).off("mirror:move",this[rt])}getOptions(){return this.draggable.options.mirror||{}}[Q](t){if(t.canceled())return;"ontouchstart"in window&&document.addEventListener("scroll",this[st],!0),this.initialScrollOffset={x:window.scrollX,y:window.scrollY};const{source:e,originalSource:r,sourceContainer:o,sensorEvent:s}=t;this.lastMirrorMovedClient={x:s.clientX,y:s.clientY};const a=new Ie({source:e,originalSource:r,sourceContainer:o,sensorEvent:s,dragEvent:t});if(this.draggable.trigger(a),nr(s)||a.canceled())return;const i=this[le](e)||o;this.mirror=e.cloneNode(!0);const l=new ke({source:e,originalSource:r,sourceContainer:o,sensorEvent:s,dragEvent:t,mirror:this.mirror}),g=new ze({source:e,originalSource:r,sourceContainer:o,sensorEvent:s,dragEvent:t,mirror:this.mirror});this.draggable.trigger(l),i.appendChild(this.mirror),this.draggable.trigger(g)}[tt](t){if(!this.mirror||t.canceled())return;const{source:e,originalSource:r,sourceContainer:o,sensorEvent:s}=t;let a=!0,i=!0;if(this.options.thresholdX||this.options.thresholdY){const{x:g,y:p}=this.lastMirrorMovedClient;if(Math.abs(g-s.clientX)<this.options.thresholdX?a=!1:this.lastMirrorMovedClient.x=s.clientX,Math.abs(p-s.clientY)<this.options.thresholdY?i=!1:this.lastMirrorMovedClient.y=s.clientY,!a&&!i)return}const l=new Jt({source:e,originalSource:r,sourceContainer:o,sensorEvent:s,dragEvent:t,mirror:this.mirror,passedThreshX:a,passedThreshY:i});this.draggable.trigger(l)}[et](t){if("ontouchstart"in window&&document.removeEventListener("scroll",this[st],!0),this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},!this.mirror)return;const{source:e,sourceContainer:r,sensorEvent:o}=t,s=new Qt({source:e,mirror:this.mirror,sourceContainer:r,sensorEvent:o,dragEvent:t});this.draggable.trigger(s),s.canceled()||this.mirror.remove()}[st](){this.scrollOffset={x:window.scrollX-this.initialScrollOffset.x,y:window.scrollY-this.initialScrollOffset.y}}[nt]({mirror:t,source:e,sensorEvent:r}){const o=this.draggable.getClassNamesFor("mirror"),s=({mirrorOffset:i,initialX:l,initialY:g,...p})=>(this.mirrorOffset=i,this.initialX=l,this.initialY=g,this.lastMovedX=l,this.lastMovedY=g,{mirrorOffset:i,initialX:l,initialY:g,...p});t.style.display="none";const a={mirror:t,source:e,sensorEvent:r,mirrorClasses:o,scrollOffset:this.scrollOffset,options:this.options,passedThreshX:!0,passedThreshY:!0};return Promise.resolve(a).then(Zn).then(Jn).then(Qn).then(tr).then(ce({initial:!0})).then(er).then(s)}[rt](t){if(t.canceled())return null;const e=({lastMovedX:s,lastMovedY:a,...i})=>(this.lastMovedX=s,this.lastMovedY=a,{lastMovedX:s,lastMovedY:a,...i}),r=s=>{const a=new Be({source:t.source,originalSource:t.originalSource,sourceContainer:t.sourceContainer,sensorEvent:t.sensorEvent,dragEvent:t.dragEvent,mirror:this.mirror,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY});return this.draggable.trigger(a),s},o={mirror:t.mirror,sensorEvent:t.sensorEvent,mirrorOffset:this.mirrorOffset,options:this.options,initialX:this.initialX,initialY:this.initialY,scrollOffset:this.scrollOffset,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY,lastMovedX:this.lastMovedX,lastMovedY:this.lastMovedY};return Promise.resolve(o).then(ce({})).then(e).then(r)}[le](t){const e=this.options.appendTo;return typeof e=="string"?document.querySelector(e):e instanceof HTMLElement?e:typeof e=="function"?e(t):t.parentNode}}function Zn({source:n,...t}){return q(e=>{const r=n.getBoundingClientRect();e({source:n,sourceRect:r,...t})})}function Jn({sensorEvent:n,sourceRect:t,options:e,...r}){return q(o=>{const s=e.cursorOffsetY===null?n.clientY-t.top:e.cursorOffsetY,a=e.cursorOffsetX===null?n.clientX-t.left:e.cursorOffsetX;o({sensorEvent:n,sourceRect:t,mirrorOffset:{top:s,left:a},options:e,...r})})}function Qn({mirror:n,source:t,options:e,...r}){return q(o=>{let s,a;if(e.constrainDimensions){const i=getComputedStyle(t);s=i.getPropertyValue("height"),a=i.getPropertyValue("width")}n.style.display=null,n.style.position="fixed",n.style.pointerEvents="none",n.style.top=0,n.style.left=0,n.style.margin=0,e.constrainDimensions&&(n.style.height=s,n.style.width=a),o({mirror:n,source:t,options:e,...r})})}function tr({mirror:n,mirrorClasses:t,...e}){return q(r=>{n.classList.add(...t),r({mirror:n,mirrorClasses:t,...e})})}function er({mirror:n,...t}){return q(e=>{n.removeAttribute("id"),delete n.id,e({mirror:n,...t})})}function ce({withFrame:n=!1,initial:t=!1}={}){return({mirror:e,sensorEvent:r,mirrorOffset:o,initialY:s,initialX:a,scrollOffset:i,options:l,passedThreshX:g,passedThreshY:p,lastMovedX:c,lastMovedY:d,...m})=>q(u=>{const h={mirror:e,sensorEvent:r,mirrorOffset:o,options:l,...m};if(o){const b=g?Math.round((r.clientX-o.left-i.x)/(l.thresholdX||1))*(l.thresholdX||1):Math.round(c),f=p?Math.round((r.clientY-o.top-i.y)/(l.thresholdY||1))*(l.thresholdY||1):Math.round(d);l.xAxis&&l.yAxis||t?e.style.transform=`translate3d(${b}px, ${f}px, 0)`:l.xAxis&&!l.yAxis?e.style.transform=`translate3d(${b}px, ${s}px, 0)`:l.yAxis&&!l.xAxis&&(e.style.transform=`translate3d(${a}px, ${f}px, 0)`),t&&(h.initialX=b,h.initialY=f),h.lastMovedX=b,h.lastMovedY=f}u(h)},{})}function q(n,{raf:t=!1}={}){return new Promise((e,r)=>{t?requestAnimationFrame(()=>{n(e,r)}):n(e,r)})}function nr(n){return/^drag/.test(n.originalEvent.type)}const ot=Symbol("onDragStart"),it=Symbol("onDragMove"),at=Symbol("onDragStop"),lt=Symbol("scroll"),rr={speed:6,sensitivity:50,scrollableElements:[]};class sr extends M{constructor(t){super(t),this.options={...rr,...this.getOptions()},this.currentMousePosition=null,this.scrollAnimationFrame=null,this.scrollableElement=null,this.findScrollableElementFrame=null,this[ot]=this[ot].bind(this),this[it]=this[it].bind(this),this[at]=this[at].bind(this),this[lt]=this[lt].bind(this)}attach(){this.draggable.on("drag:start",this[ot]).on("drag:move",this[it]).on("drag:stop",this[at])}detach(){this.draggable.off("drag:start",this[ot]).off("drag:move",this[it]).off("drag:stop",this[at])}getOptions(){return this.draggable.options.scrollable||{}}getScrollableElement(t){return this.hasDefinedScrollableElements()?S(t,this.options.scrollableElements)||document.documentElement:ar(t)}hasDefinedScrollableElements(){return this.options.scrollableElements.length!==0}[ot](t){this.findScrollableElementFrame=requestAnimationFrame(()=>{this.scrollableElement=this.getScrollableElement(t.source)})}[it](t){if(this.findScrollableElementFrame=requestAnimationFrame(()=>{this.scrollableElement=this.getScrollableElement(t.sensorEvent.target)}),!this.scrollableElement)return;const e=t.sensorEvent,r={x:0,y:0};"ontouchstart"in window&&(r.y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,r.x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),this.currentMousePosition={clientX:e.clientX-r.x,clientY:e.clientY-r.y},this.scrollAnimationFrame=requestAnimationFrame(this[lt])}[at](){cancelAnimationFrame(this.scrollAnimationFrame),cancelAnimationFrame(this.findScrollableElementFrame),this.scrollableElement=null,this.scrollAnimationFrame=null,this.findScrollableElementFrame=null,this.currentMousePosition=null}[lt](){if(!this.scrollableElement||!this.currentMousePosition)return;cancelAnimationFrame(this.scrollAnimationFrame);const{speed:t,sensitivity:e}=this.options,r=this.scrollableElement.getBoundingClientRect(),o=r.bottom>window.innerHeight,a=r.top<0||o,i=jt(),l=this.scrollableElement,g=this.currentMousePosition.clientX,p=this.currentMousePosition.clientY;if(l!==document.body&&l!==document.documentElement&&!a){const{offsetHeight:c,offsetWidth:d}=l;r.top+c-p<e?l.scrollTop+=t:p-r.top<e&&(l.scrollTop-=t),r.left+d-g<e?l.scrollLeft+=t:g-r.left<e&&(l.scrollLeft-=t)}else{const{innerHeight:c,innerWidth:d}=window;p<e?i.scrollTop-=t:c-p<e&&(i.scrollTop+=t),g<e?i.scrollLeft-=t:d-g<e&&(i.scrollLeft+=t)}this.scrollAnimationFrame=requestAnimationFrame(this[lt])}}function or(n){const t=/(auto|scroll)/,e=getComputedStyle(n,null),r=e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x");return t.test(r)}function ir(n){return getComputedStyle(n).getPropertyValue("position")==="static"}function ar(n){if(!n)return jt();const t=getComputedStyle(n).getPropertyValue("position"),e=t==="absolute",r=S(n,o=>e&&ir(o)?!1:or(o));return t==="fixed"||!r?jt():r}function jt(){return document.scrollingElement||document.documentElement}class lr{constructor(){this.callbacks={}}on(t,...e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(...e),this}off(t,e){if(!this.callbacks[t])return null;const r=this.callbacks[t].slice(0);for(let o=0;o<r.length;o++)e===r[o]&&this.callbacks[t].splice(o,1);return this}trigger(t){if(!this.callbacks[t.type])return null;const e=[...this.callbacks[t.type]],r=[];for(let o=e.length-1;o>=0;o--){const s=e[o];try{s(t)}catch(a){r.push(a)}}return r.length&&console.error(`Draggable caught errors while triggering '${t.type}'`,r),this}}class te extends w{get draggable(){return this.data.draggable}}te.type="draggable";class qe extends te{}qe.type="draggable:initialize";class Ve extends te{}Ve.type="draggable:destroy";const ct=Symbol("onDragStart"),k=Symbol("onDragMove"),dt=Symbol("onDragStop"),ut=Symbol("onDragPressure"),ht=Symbol("dragStop"),cr={"drag:start":n=>`Picked up ${n.source.textContent.trim()||n.source.id||"draggable element"}`,"drag:stop":n=>`Released ${n.source.textContent.trim()||n.source.id||"draggable element"}`},dr={"container:dragging":"draggable-container--is-dragging","source:dragging":"draggable-source--is-dragging","source:placed":"draggable-source--placed","container:placed":"draggable-container--placed","body:dragging":"draggable--is-dragging","draggable:over":"draggable--over","container:over":"draggable-container--over","source:original":"draggable--original",mirror:"draggable-mirror"},ur={draggable:".draggable-source",handle:null,delay:{},distance:0,placedTimeout:800,plugins:[],sensors:[],exclude:{plugins:[],sensors:[]}};class z{constructor(t=[document.body],e={}){if(t instanceof NodeList||t instanceof Array)this.containers=[...t];else if(t instanceof HTMLElement)this.containers=[t];else throw new Error("Draggable containers are expected to be of type `NodeList`, `HTMLElement[]` or `HTMLElement`");this.options={...ur,...e,classes:{...dr,...e.classes||{}},announcements:{...cr,...e.announcements||{}},exclude:{plugins:e.exclude&&e.exclude.plugins||[],sensors:e.exclude&&e.exclude.sensors||[]}},this.emitter=new lr,this.dragging=!1,this.plugins=[],this.sensors=[],this[ct]=this[ct].bind(this),this[k]=this[k].bind(this),this[dt]=this[dt].bind(this),this[ut]=this[ut].bind(this),this[ht]=this[ht].bind(this),document.addEventListener("drag:start",this[ct],!0),document.addEventListener("drag:move",this[k],!0),document.addEventListener("drag:stop",this[dt],!0),document.addEventListener("drag:pressure",this[ut],!0);const r=Object.values(z.Plugins).filter(a=>!this.options.exclude.plugins.includes(a)),o=Object.values(z.Sensors).filter(a=>!this.options.exclude.sensors.includes(a));this.addPlugin(...r,...this.options.plugins),this.addSensor(...o,...this.options.sensors);const s=new qe({draggable:this});this.on("mirror:created",({mirror:a})=>this.mirror=a),this.on("mirror:destroy",()=>this.mirror=null),this.trigger(s)}destroy(){document.removeEventListener("drag:start",this[ct],!0),document.removeEventListener("drag:move",this[k],!0),document.removeEventListener("drag:stop",this[dt],!0),document.removeEventListener("drag:pressure",this[ut],!0);const t=new Ve({draggable:this});this.trigger(t),this.removePlugin(...this.plugins.map(e=>e.constructor)),this.removeSensor(...this.sensors.map(e=>e.constructor))}addPlugin(...t){const e=t.map(r=>new r(this));return e.forEach(r=>r.attach()),this.plugins=[...this.plugins,...e],this}removePlugin(...t){return this.plugins.filter(r=>t.includes(r.constructor)).forEach(r=>r.detach()),this.plugins=this.plugins.filter(r=>!t.includes(r.constructor)),this}addSensor(...t){const e=t.map(r=>new r(this.containers,this.options));return e.forEach(r=>r.attach()),this.sensors=[...this.sensors,...e],this}removeSensor(...t){return this.sensors.filter(r=>t.includes(r.constructor)).forEach(r=>r.detach()),this.sensors=this.sensors.filter(r=>!t.includes(r.constructor)),this}addContainer(...t){return this.containers=[...this.containers,...t],this.sensors.forEach(e=>e.addContainer(...t)),this}removeContainer(...t){return this.containers=this.containers.filter(e=>!t.includes(e)),this.sensors.forEach(e=>e.removeContainer(...t)),this}on(t,...e){return this.emitter.on(t,...e),this}off(t,e){return this.emitter.off(t,e),this}trigger(t){return this.emitter.trigger(t),this}getClassNameFor(t){return this.getClassNamesFor(t)[0]}getClassNamesFor(t){const e=this.options.classes[t];return e instanceof Array?e:typeof e=="string"||e instanceof String?[e]:[]}isDragging(){return!!this.dragging}getDraggableElements(){return this.containers.reduce((t,e)=>[...t,...this.getDraggableElementsForContainer(e)],[])}getDraggableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter(r=>r!==this.originalSource&&r!==this.mirror)}cancel(){this[ht]()}[ct](t){const e=Lt(t),{target:r,container:o,originalSource:s}=e;if(!this.containers.includes(o))return;if(this.options.handle&&r&&!S(r,this.options.handle)){e.cancel();return}this.originalSource=s,this.sourceContainer=o,this.lastPlacedSource&&this.lastPlacedContainer&&(clearTimeout(this.placedTimeoutID),this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed"))),this.source=this.originalSource.cloneNode(!0),this.originalSource.parentNode.insertBefore(this.source,this.originalSource),this.originalSource.style.display="none";const a=new Kt({source:this.source,originalSource:this.originalSource,sourceContainer:o,sensorEvent:e});if(this.trigger(a),this.dragging=!a.canceled(),a.canceled()){this.source.remove(),this.originalSource.style.display=null;return}this.originalSource.classList.add(...this.getClassNamesFor("source:original")),this.source.classList.add(...this.getClassNamesFor("source:dragging")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:dragging")),document.body.classList.add(...this.getClassNamesFor("body:dragging")),de(document.body,"none"),requestAnimationFrame(()=>{const l=Lt(t).clone({target:this.source});this[k]({...t,detail:l})})}[k](t){if(!this.dragging)return;const e=Lt(t),{container:r}=e;let o=e.target;const s=new we({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e});this.trigger(s),s.canceled()&&e.cancel(),o=S(o,this.options.draggable);const a=S(e.target,this.containers),i=e.overContainer||a,l=this.currentOverContainer&&i!==this.currentOverContainer,g=this.currentOver&&o!==this.currentOver,p=i&&this.currentOverContainer!==i,c=a&&o&&this.currentOver!==o;if(g){const d=new xe({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,over:this.currentOver,overContainer:this.currentOverContainer});this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOver=null,this.trigger(d)}if(l){const d=new Oe({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:this.currentOverContainer});this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.currentOverContainer=null,this.trigger(d)}if(p){i.classList.add(...this.getClassNamesFor("container:over"));const d=new De({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:i});this.currentOverContainer=i,this.trigger(d)}if(c){o.classList.add(...this.getClassNamesFor("draggable:over"));const d=new $t({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:i,over:o});this.currentOver=o,this.trigger(d)}}[ht](t){if(!this.dragging)return;this.dragging=!1;const e=new Gt({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(e),e.canceled()||this.source.parentNode.insertBefore(this.originalSource,this.source),this.source.remove(),this.originalSource.style.display="",this.source.classList.remove(...this.getClassNamesFor("source:dragging")),this.originalSource.classList.remove(...this.getClassNamesFor("source:original")),this.originalSource.classList.add(...this.getClassNamesFor("source:placed")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:placed")),this.sourceContainer.classList.remove(...this.getClassNamesFor("container:dragging")),document.body.classList.remove(...this.getClassNamesFor("body:dragging")),de(document.body,""),this.currentOver&&this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOverContainer&&this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.lastPlacedSource=this.originalSource,this.lastPlacedContainer=this.sourceContainer,this.placedTimeoutID=setTimeout(()=>{this.lastPlacedSource&&this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer&&this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed")),this.lastPlacedSource=null,this.lastPlacedContainer=null},this.options.placedTimeout);const r=new Le({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(r),this.source=null,this.originalSource=null,this.currentOverContainer=null,this.currentOver=null,this.sourceContainer=null}[dt](t){this[ht](t)}[ut](t){if(!this.dragging)return;const e=Lt(t),r=this.source||S(e.originalEvent.target,this.options.draggable),o=new Me({sensorEvent:e,source:r,pressure:e.pressure});this.trigger(o)}}z.Plugins={Announcement:Vn,Focusable:Hn,Mirror:Gn,Scrollable:sr};z.Sensors={MouseSensor:pn,TouchSensor:vn};function Lt(n){return n.detail}function de(n,t){n.style.webkitUserSelect=t,n.style.mozUserSelect=t,n.style.msUserSelect=t,n.style.oUserSelect=t,n.style.userSelect=t}class vt extends w{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}vt.type="droppable";class je extends vt{get dropzone(){return this.data.dropzone}}je.type="droppable:start";je.cancelable=!0;class Re extends vt{get dropzone(){return this.data.dropzone}}Re.type="droppable:dropped";Re.cancelable=!0;class _e extends vt{get dropzone(){return this.data.dropzone}}_e.type="droppable:returned";_e.cancelable=!0;class He extends vt{get dropzone(){return this.data.dropzone}}He.type="droppable:stop";He.cancelable=!0;class bt extends w{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}bt.type="swappable";class We extends bt{}We.type="swappable:start";We.cancelable=!0;class Ue extends bt{get over(){return this.data.over}get overContainer(){return this.data.overContainer}}Ue.type="swappable:swap";Ue.cancelable=!0;class hr extends bt{get swappedElement(){return this.data.swappedElement}}hr.type="swappable:swapped";class gr extends bt{}gr.type="swappable:stop";class yt extends w{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}yt.type="sortable";class ee extends yt{get startIndex(){return this.data.startIndex}get startContainer(){return this.data.startContainer}}ee.type="sortable:start";ee.cancelable=!0;class Xt extends yt{get currentIndex(){return this.data.currentIndex}get over(){return this.data.over}get overContainer(){return this.data.dragEvent.overContainer}}Xt.type="sortable:sort";Xt.cancelable=!0;class Rt extends yt{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}Rt.type="sortable:sorted";class Ke extends yt{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}Ke.type="sortable:stop";const gt=Symbol("onDragStart"),mt=Symbol("onDragOverContainer"),ft=Symbol("onDragOver"),pt=Symbol("onDragStop");function mr({dragEvent:n}){const t=n.source.textContent.trim()||n.source.id||"sortable element";if(n.over){const e=n.over.textContent.trim()||n.over.id||"sortable element";return n.source.compareDocumentPosition(n.over)&Node.DOCUMENT_POSITION_FOLLOWING?`Placed ${t} after ${e}`:`Placed ${t} before ${e}`}else return`Placed ${t} into a different container`}const fr={"sortable:sorted":mr};class pr extends z{constructor(t=[],e={}){super(t,{...e,announcements:{...fr,...e.announcements||{}}}),this.startIndex=null,this.startContainer=null,this[gt]=this[gt].bind(this),this[mt]=this[mt].bind(this),this[ft]=this[ft].bind(this),this[pt]=this[pt].bind(this),this.on("drag:start",this[gt]).on("drag:over:container",this[mt]).on("drag:over",this[ft]).on("drag:stop",this[pt])}destroy(){super.destroy(),this.off("drag:start",this[gt]).off("drag:over:container",this[mt]).off("drag:over",this[ft]).off("drag:stop",this[pt])}index(t){return this.getSortableElementsForContainer(t.parentNode).indexOf(t)}getSortableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter(r=>r!==this.originalSource&&r!==this.mirror&&r.parentNode===t)}[gt](t){this.startContainer=t.source.parentNode,this.startIndex=this.index(t.source);const e=new ee({dragEvent:t,startIndex:this.startIndex,startContainer:this.startContainer});this.trigger(e),e.canceled()&&t.cancel()}[mt](t){if(t.canceled())return;const{source:e,over:r,overContainer:o}=t,s=this.index(e),a=new Xt({dragEvent:t,currentIndex:s,source:e,over:r});if(this.trigger(a),a.canceled())return;const i=this.getSortableElementsForContainer(o),l=he({source:e,over:r,overContainer:o,children:i});if(!l)return;const{oldContainer:g,newContainer:p}=l,c=this.index(t.source),d=new Rt({dragEvent:t,oldIndex:s,newIndex:c,oldContainer:g,newContainer:p});this.trigger(d)}[ft](t){if(t.over===t.originalSource||t.over===t.source)return;const{source:e,over:r,overContainer:o}=t,s=this.index(e),a=new Xt({dragEvent:t,currentIndex:s,source:e,over:r});if(this.trigger(a),a.canceled())return;const i=this.getDraggableElementsForContainer(o),l=he({source:e,over:r,overContainer:o,children:i});if(!l)return;const{oldContainer:g,newContainer:p}=l,c=this.index(e),d=new Rt({dragEvent:t,oldIndex:s,newIndex:c,oldContainer:g,newContainer:p});this.trigger(d)}[pt](t){const e=new Ke({dragEvent:t,oldIndex:this.startIndex,newIndex:this.index(t.source),oldContainer:this.startContainer,newContainer:t.source.parentNode});this.trigger(e),this.startIndex=null,this.startContainer=null}}function ue(n){return Array.prototype.indexOf.call(n.parentNode.children,n)}function he({source:n,over:t,overContainer:e,children:r}){const o=!r.length,s=n.parentNode!==e,a=t&&n.parentNode===t.parentNode;return o?vr(n,e):a?br(n,t):s?yr(n,t,e):null}function vr(n,t){const e=n.parentNode;return t.appendChild(n),{oldContainer:e,newContainer:t}}function br(n,t){const e=ue(n),r=ue(t);return e<r?n.parentNode.insertBefore(n,t.nextElementSibling):n.parentNode.insertBefore(n,t),{oldContainer:n.parentNode,newContainer:n.parentNode}}function yr(n,t,e){const r=n.parentNode;return t?t.parentNode.insertBefore(n,t):e.appendChild(n),{oldContainer:r,newContainer:n.parentNode}}const Er=["href"],Sr={__name:"Index",props:{service:{default:null,type:fe}},setup(n){const t=n,e=Tt([]),r=Tt(),o=Tt(0);let s;const a=async({data:{oldIndex:u,newIndex:h}})=>{if(u===h)return;const b=e.value.splice(u,1)[0];e.value.splice(h,0,b);const{data:f}=await j.post("/documentation/tree/sort",e.value);await i()};async function i(){var h;const{data:u}=await j.get("/documentation/tree",{params:{serviceId:(h=t.service)==null?void 0:h.label}});u&&(e.value=(u||[]).sort((b,f)=>b.position-f.position)),r.value||(r.value=e.value[0]),await g(),o.value++}Je(i);let l=!1;async function g(){l||(l=!0,s==null||s.destroy(),setTimeout(()=>{s=new pr(document.querySelectorAll(".p-tree-root-children"),{delay:200,draggable:".p-tree-node-leaf",sortAnimation:{duration:200,easingFunction:"ease-in-out"},plugins:[$n]}),s.on("sortable:stop",a),l=!1},0))}async function p(){var h;const{data:u}=await j.post("/documentation/tree",{key:Qe(),serviceId:((h=t.service)==null?void 0:h.label)||"",label:"New doc...",position:e.value.length});i(),m(e.value.find(b=>b.id===u.id))}async function c(u){const{data:h}=await j.post(`/documentation/tree/${u.id}`,u);i()}async function d(u){const{data:h}=await j.delete(`/documentation/tree/${u.id}`,u);i()}function m(u){r.value=u}return(u,h)=>{var b;return F(),Ct(tn,{class:"configs-root",key:((b=n.service)==null?void 0:b.label)||"global"},{default:P(()=>[h[5]||(h[5]=Y("div",{class:"header"},[Y("h2",null,"Documentation")],-1)),wt(V(rn),{style:{height:"100%"}},{default:P(()=>[wt(V(ne),{size:1,style:{minWidth:"160px"},class:"leftPanel"},{default:P(()=>[e.value.length?(F(),Ct(V(en),{value:e.value,class:"w-full treeLeft",key:o.value},{default:P(f=>{var v,y,E,x;return[Y("div",{class:me(["line",{active:((v=f.node)==null?void 0:v.id)===((y=r.value)==null?void 0:y.id)}])},[(F(),Ct(cn,{key:f.node.id,node:f.node,onSelect:L=>m(f.node),active:((E=f.node)==null?void 0:E.id)===((x=r.value)==null?void 0:x.id),tree:e.value,onUpdateDoc:h[0]||(h[0]=L=>c(L)),onDeleteDoc:h[1]||(h[1]=L=>d(L))},null,8,["node","onSelect","active","tree"]))],2)]}),url:P(f=>[Y("a",{href:f.node.data},ge(f.node.label),9,Er)]),_:1},8,["value"])):Bt("",!0),wt(V(sn),{style:{width:"100%"