@a2simcode/dui 0.0.22 → 0.0.23
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.
- package/LICENSE +53 -0
- package/dist/components-dui/index.d.ts +2 -0
- package/dist/dui.css +1 -2
- package/dist/dui.es.js +12972 -9807
- package/dist/dui.umd.js +5 -5
- package/package.json +6 -6
package/dist/dui.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(Me,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(Me=typeof globalThis<"u"?globalThis:Me||self,s(Me.DuiUI={},Me.Vue))})(this,function(Me,s){Object.defineProperties(Me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var tc=Object.create,kr=Object.defineProperty,nc=Object.getOwnPropertyDescriptor,oc=Object.getOwnPropertyNames,ic=Object.getPrototypeOf,rc=Object.prototype.hasOwnProperty,Pe=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),sc=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=oc(e),r=0,a=i.length,l;r<a;r++)l=i[r],!rc.call(t,l)&&l!==n&&kr(t,l,{get:(d=>e[d]).bind(null,l),enumerable:!(o=nc(e,l))||o.enumerable});return t},bt=(t,e,n)=>(n=t!=null?tc(ic(t)):{},sc(e||!t||!t.__esModule?kr(n,"default",{value:t,enumerable:!0}):n,t)),Mt=(t,e)=>(t.install=n=>{n.component(t.name,t),e&&e.forEach(o=>{n.component(o.name,o)})},t),Ft=(t="")=>{const e=Date.now(),n=Math.floor(Math.random()*1e9);return t===""?String(n)+String(e):t+"_"+n+String(e)},ni=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(ni);const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=ni(t[n]));return e},ac=t=>{if(Array.isArray(t))t.length=0;else if(t&&typeof t=="object")for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&delete t[e]},oi={},lc=(t,e,n)=>{n[t]=n[t]||{};const o=Ft();return n[t][o]=e,o},cc=(t,e,n)=>{const o=[],i=n[t]||{};return Object.keys(i).forEach(r=>{const a=i[r];try{a&&o.push(a(e))}catch(l){console.error(l)}}),o},dc=(t,e,n)=>{if(e){const o=n[t];o&&delete o[e]}else delete n[t]},Nr=(t,e)=>lc(t,e,oi),Se=(t,e)=>cc(t,e,oi),uc=(t,e)=>{dc(t,e,oi)},Dr=(t,e,n,o,i,r)=>{const a=e.id,l=e.level,{getDesignLocals:d,selectComponent:c,getComponent:u,isMyChildComponent:f,addComponent:h,deleteComponent:p,getParentComponents:g,removeComponentFromContainer:m,addComponentToContainer:w,copyComponent:I,activedComponent:y,top:v}=(0,s.inject)("d-drag-design-provide",{}),C=[],$=(0,s.ref)(!1),z=(0,s.ref)(!1),W=(0,s.ref)(!1),j=(0,s.ref)(!1),D=(0,s.ref)(!1),O={id:"",type:""},H=(0,s.ref)(!1),S=(0,s.ref)(!1);let Y="",b=null;const B=U=>{if(Y===U)return b;Y=U;const{top:Z,left:te,width:oe,height:ae}=t.value.getBoundingClientRect();return b=[{x:te,y:Z},{x:te+oe,y:Z},{x:te+oe,y:Z+ae},{x:te,y:Z+ae}],b},_=(U,Z,te)=>{let oe=Z-te[0].y;oe<0&&(oe=-oe);let ae=Z-te[3].y;ae<0&&(ae=-ae);let ee=U-te[0].x;ee<0&&(ee=-ee);let ie=U-te[1].x;return ie<0&&(ie=-ie),{ly:oe>ae?ae:oe,typey:oe>ae?"bottom":"top",lx:ee>ie?ie:ee,lallx:ee+ie}},x=(U,Z,te)=>U>=te[0].x&&U<=te[1].x&&Z>=te[0].y&&Z<=te[3].y,T=()=>{if(i){Se("dragClick",{id:a});return}if(!z.value){if(c(a),l!==0){const U=t.value.getBoundingClientRect(),Z=d();U.top-Z.top<22?j.value=!0:j.value=!1}z.value=!0,Se("dragClick",{id:a})}},P=U=>{const Z=p(U);Z&&(0,s.nextTick)(()=>{Se("dragClick",{id:Z})})},L=()=>{O.id="",O.type="",l===0&&(D.value=!1)},M=()=>{Se("mouseEnterOrLeave",{id:a,type:"enter"})},V=()=>{Se("mouseEnterOrLeave",{id:a,type:"leave"})},F=U=>{Se("dragClick",{id:U})},G={mouseEnterOrLeave:({id:U,type:Z})=>{Z==="enter"?C.push(U):C.length>0&&C.splice(C.length-1,1);const te=C.length;te>0&&a===C[te-1]?$.value=!0:$.value=!1},dragAciveChild:({type:U,id:Z})=>{Z===a?U==="top"?(H.value=!0,S.value=!1):(S.value=!0,H.value=!1):(S.value=!1,H.value=!1)},dragClick({id:U,isAgain:Z}){console.log("dragClick",U,a),U!==a?z.value=!1:(Z&&(z.value=!1),T())}};G[`dragGetChildDistance_${a}`]=({dragX:U,dragY:Z,moveId:te})=>_(U,Z,B(te));const X={isInContainer({x:U,y:Z,id:te,moveId:oe}){if(a===te||f(te,a))return W.value=!1,{isIn:!1,level:l,id:a,groupId:r};const ae=B(oe);if(x(U,Z,ae))return l===0&&(D.value=!0),{isIn:!0,level:l,id:a,groupId:r};if(l===0){const{ly:ee,lx:ie}=_(U,Z,ae);if(ee<20&&ie<20)return D.value=!0,{isIn:!0,level:l,id:a,groupId:r};D.value=!1}return W.value=!1,{isIn:!1,level:l,id:a,groupId:r}},dragActiveContainer:({containerId:U,containerGroupId:Z,dragX:te,dragY:oe,moveId:ae})=>{if(U===a&&Z===r)if(W.value=!0,o&&o.value.length>0){let ee={ly:9999999,lx:0,lallx:0,id:"",typey:""};o?.value.forEach(ie=>{if(r&&ie.groupId!==r)return;const R=Se(`dragGetChildDistance_${ie.id}`,{dragX:te,dragY:oe,moveId:ae})[0];R&&(ee.ly>R.ly||ee.ly===R.ly&&(ee.lx>R.lx||ee.lx===R.lx&&ee.lallx>R.lallx))&&(ee=R,ee.id=ie.id)}),O.id=ee.id,O.type=ee.typey,Se("dragAciveChild",{id:ee.id,type:ee.typey})}else Se("dragAciveChild",{id:""});else W.value=!1},dragAdd:U=>{if(W.value){let Z=o?.value.length||0;O.id!==""&&O.id!==void 0&&(Z=o?.value.findIndex(te=>te.id===O.id)||0,O.type==="bottom"&&(Z+=1)),h(U,a,Z,r),W.value=!1}L()},dragAddByClick:U=>{if(!y.value&&a===v.id||y.value?.id===a||y.value?.containerId===a&&y.value?.dragType!=="container"){const Z=h(U,a,o?.value.length||0,r,!0);Z&&U.config&&Object.keys(U.config).forEach(te=>{Z.config[te]=U.config[te]})}},dragUpdate(U){if(W.value){const Z=u(U);if(Z.level=l+1,O.id!==Z.id){m(Z.containerId,U);let te=o?.value.findIndex(oe=>oe.id===O.id)||0;O.type==="bottom"&&(te+=1),w(Z,a,te,r)}W.value=!1,(0,s.nextTick)(()=>{Se("dragClick",{id:Z.id,isAgain:!0})})}L()}},J={};return(0,s.onMounted)(()=>{(!i||n!=="container")&&Object.keys(G).forEach(U=>{J[U]=Nr(U,G[U])}),n==="container"&&Object.keys(X).forEach(U=>{J[U]=Nr(U,X[U])}),e.isNewAdd&&(0,s.nextTick)(()=>{T(),delete e.isNewAdd})}),(0,s.onUnmounted)(()=>{Object.keys(J).forEach(U=>{uc(U,J[U])})}),{onMouseenter:M,onMouseleave:V,activeComponent:T,handleComponentClick:F,deleteComponentByClick:P,copyComponent:I,getParentComponents:g,isBottomToolBar:j,isHover:$,isSelect:z,isToContainer:W,isMoveingInTopLevel:D,isTopActive:H,isBottomActive:S}},Tr=(t,e)=>{const n={x:0,y:0,clientX:0,clientY:0,dragElement:null,dragElementId:"jcode-darg-move-id",toContainerLevel:-1,toContainerId:"",groupId:"",id:""};let o=!1;const i=(p,g)=>{o!==!0&&(o=!0,setTimeout(()=>{p(),o=!1},g))},r=(0,s.ref)(!1),a=(p,g,m)=>{const w=document.createElement("div");return w.id=n.dragElementId,w.innerText=p,w.className="d-drag-move",w.style.top=`${g}px`,w.style.left=`${m}px`,document.body.appendChild(w),w},l=()=>{document.onmousemove=null,document.onmouseup=null,r.value=!1,Se("dragAciveChild",{id:""})},d=()=>{l(),n.dragElement&&(n.dragElement.remove(),n.dragElement=null,e?Se("dragAdd",t):Se("dragUpdate",t.id))},c=p=>{const{clientY:g,clientX:m}=p;if(!n.dragElement){const w=Math.abs(n.x-m),I=Math.abs(n.y-g);if(w<=1&&I<=1)return;r.value=!0,n.dragElement=a(t.name,g-11,m-32)}n.dragElement.style.top=`${g-11}px`,n.dragElement.style.left=`${m-32}px`,n.clientX=m,n.clientY=g,i(()=>{if(!r.value)return;const w=Se("isInContainer",{x:m,y:g,id:t.id,moveId:n.id});n.toContainerLevel=-1,n.toContainerId="",n.groupId="",w.forEach(({level:I,id:y,isIn:v,groupId:C})=>{v&&n.toContainerLevel<I&&(n.toContainerLevel=I,n.toContainerId=y,n.groupId=C)}),n.toContainerId!==""?Se("dragActiveContainer",{containerId:n.toContainerId,containerGroupId:n.groupId,dragX:m,dragY:g,moveId:n.id}):Se("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{l()},onMousedown:p=>{n.x=p.clientX,n.y=p.clientY,n.id=Ft(),document.onmouseup=d,document.onmousemove=c},onClick:()=>{Se("dragAddByClick",t)},moveActive:r}},fc=t=>(t.install=e=>{e.component(t.name,t)},t),Xn=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),Ir=/^[a-z0-9]+(-[a-z0-9]+)*$/,qn=(t,e,n,o="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;o=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),d=i.pop(),c={provider:i.length>0?i[0]:o,prefix:d,name:l};return e&&!Kn(c)?null:c}const r=i[0],a=r.split("-");if(a.length>1){const l={provider:o,prefix:a.shift(),name:a.join("-")};return e&&!Kn(l)?null:l}if(n&&o===""){const l={provider:o,prefix:"",name:r};return e&&!Kn(l,n)?null:l}return null},Kn=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,Mr=Object.freeze({left:0,top:0,width:16,height:16}),Zn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),fn=Object.freeze({...Mr,...Zn}),ii=Object.freeze({...fn,body:"",hidden:!1});function hc(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const o=((t.rotate||0)+(e.rotate||0))%4;return o&&(n.rotate=o),n}function Br(t,e){const n=hc(t,e);for(const o in ii)o in Zn?o in t&&!(o in n)&&(n[o]=Zn[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function pc(t,e){const n=t.icons,o=t.aliases||Object.create(null),i=Object.create(null);function r(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const l=o[a]&&o[a].parent,d=l&&r(l);d&&(i[a]=[l].concat(d))}return i[a]}return Object.keys(n).concat(Object.keys(o)).forEach(r),i}function gc(t,e,n){const o=t.icons,i=t.aliases||Object.create(null);let r={};function a(l){r=Br(o[l]||i[l],r)}return a(e),n.forEach(a),Br(t,r)}function zr(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(i=>{e(i,null),n.push(i)});const o=pc(t);for(const i in o){const r=o[i];r&&(e(i,gc(t,i,r)),n.push(i))}return n}var mc={provider:"",aliases:{},not_found:{},...Mr};function ri(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Ar(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!ri(t,mc))return null;const n=e.icons;for(const i in n){const r=n[i];if(!i||typeof r.body!="string"||!ri(r,ii))return null}const o=e.aliases||Object.create(null);for(const i in o){const r=o[i],a=r.parent;if(!i||typeof a!="string"||!n[a]&&!o[a]||!ri(r,ii))return null}return e}var Pr=Object.create(null);function vc(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Gt(t,e){const n=Pr[t]||(Pr[t]=Object.create(null));return n[e]||(n[e]=vc(t,e))}function Or(t,e){return Ar(e)?zr(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}function yc(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}var hn=!1;function $r(t){return typeof t=="boolean"&&(hn=t),hn}function Rr(t){const e=typeof t=="string"?qn(t,!0,hn):t;if(e){const n=Gt(e.provider,e.prefix),o=e.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function _c(t,e){const n=qn(t,!0,hn);if(!n)return!1;const o=Gt(n.provider,n.prefix);return e?yc(o,n.name,e):(o.missing.add(n.name),!0)}function wc(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),hn&&!e&&!t.prefix){let o=!1;return Ar(t)&&(t.prefix="",zr(t,(i,r)=>{_c(i,r)&&(o=!0)})),o}const n=t.prefix;return Kn({prefix:n,name:"a"})?!!Or(Gt(e,n),t):!1}function Hr(t){const e=Rr(t);return e&&{...fn,...e}}var Vr=Object.freeze({width:null,height:null}),Lr=Object.freeze({...Vr,...Zn}),bc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Cc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Fr(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(bc);if(o===null||!o.length)return t;const i=[];let r=o.shift(),a=Cc.test(r);for(;;){if(a){const l=parseFloat(r);isNaN(l)?i.push(r):i.push(Math.ceil(l*e*n)/n)}else i.push(r);if(r=o.shift(),r===void 0)return i.join("");a=!a}}function Ec(t,e="defs"){let n="";const o=t.indexOf("<"+e);for(;o>=0;){const i=t.indexOf(">",o),r=t.indexOf("</"+e);if(i===-1||r===-1)break;const a=t.indexOf(">",r);if(a===-1)break;n+=t.slice(i+1,r).trim(),t=t.slice(0,o).trim()+t.slice(a+1)}return{defs:n,content:t}}function xc(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Sc(t,e,n){const o=Ec(t);return xc(o.defs,e+o.content+n)}var kc=t=>t==="unset"||t==="undefined"||t==="none";function Nc(t,e){const n={...fn,...t},o={...Lr,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,o].forEach(m=>{const w=[],I=m.hFlip,y=m.vFlip;let v=m.rotate;I?y?v+=2:(w.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),w.push("scale(-1 1)"),i.top=i.left=0):y&&(w.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),w.push("scale(1 -1)"),i.top=i.left=0);let C;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:C=i.height/2+i.top,w.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:w.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,w.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}v%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),w.length&&(r=Sc(r,'<g transform="'+w.join(" ")+'">',"</g>"))});const a=o.width,l=o.height,d=i.width,c=i.height;let u,f;a===null?(f=l===null?"1em":l==="auto"?c:l,u=Fr(f,d/c)):(u=a==="auto"?d:a,f=l===null?Fr(u,c/d):l==="auto"?c:l);const h={},p=(m,w)=>{kc(w)||(h[m]=w.toString())};p("width",u),p("height",f);const g=[i.left,i.top,d,c];return h.viewBox=g.join(" "),{attributes:h,viewBox:g,body:r}}var Dc=/\sid="(\S+)"/g,Tc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ic=0;function Mc(t,e=Tc){const n=[];let o;for(;o=Dc.exec(t);)n.push(o[1]);if(!n.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(r=>{const a=typeof e=="function"?e(r):e+(Ic++).toString(),l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}var si=Object.create(null);function Bc(t,e){si[t]=e}function ai(t){return si[t]||si[""]}function li(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}for(var ci=Object.create(null),pn=["https://api.simplesvg.com","https://api.unisvg.com"],Jn=[];pn.length>0;)pn.length===1||Math.random()>.5?Jn.push(pn.shift()):Jn.push(pn.pop());ci[""]=li({resources:["https://api.iconify.design"].concat(Jn)});function zc(t,e){const n=li(e);return n===null?!1:(ci[t]=n,!0)}function di(t){return ci[t]}var Ac=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}},Gr=Ac();function Pc(t,e){const n=di(t);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const r=e+".json?icons=";o=n.maxURL-i-n.path.length-r.length}return o}function Oc(t){return t===404}var $c=(t,e,n)=>{const o=[],i=Pc(t,e),r="icons";let a={type:r,provider:t,prefix:e,icons:[]},l=0;return n.forEach((d,c)=>{l+=d.length+1,l>=i&&c>0&&(o.push(a),a={type:r,provider:t,prefix:e,icons:[]},l=d.length),a.icons.push(d)}),o.push(a),o};function Rc(t){if(typeof t=="string"){const e=di(t);if(e)return e.path}return"/"}var Hc=(t,e,n)=>{if(!Gr){n("abort",424);return}let o=Rc(e.provider);switch(e.type){case"icons":{const r=e.prefix,a=e.icons.join(","),l=new URLSearchParams({icons:a});o+=r+".json?"+l.toString();break}case"custom":{const r=e.uri;o+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let i=503;Gr(t+o).then(r=>{const a=r.status;if(a!==200){setTimeout(()=>{n(Oc(a)?"abort":"next",a)});return}return i=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",i)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",i)})},Vc={prepare:$c,send:Hc};function Lc(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((i,r)=>i.provider!==r.provider?i.provider.localeCompare(r.provider):i.prefix!==r.prefix?i.prefix.localeCompare(r.prefix):i.name.localeCompare(r.name));let o={provider:"",prefix:"",name:""};return t.forEach(i=>{if(o.name===i.name&&o.prefix===i.prefix&&o.provider===i.provider)return;o=i;const r=i.provider,a=i.prefix,l=i.name,d=n[r]||(n[r]=Object.create(null)),c=d[a]||(d[a]=Gt(r,a));let u;l in c.icons?u=e.loaded:a===""||c.missing.has(l)?u=e.missing:u=e.pending;const f={provider:r,prefix:a,name:l};u.push(f)}),e}function jr(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(i=>i.id!==e))})}function Fc(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const o=t.provider,i=t.prefix;e.forEach(r=>{const a=r.icons,l=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const c=d.name;if(t.icons[c])a.loaded.push({provider:o,prefix:i,name:c});else if(t.missing.has(c))a.missing.push({provider:o,prefix:i,name:c});else return n=!0,!0;return!1}),a.pending.length!==l&&(n||jr([t],r.id),r.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),r.abort))})}))}var Gc=0;function jc(t,e,n){const o=Gc++,i=jr.bind(null,n,o);if(!e.pending.length)return i;const r={id:o,icons:e,callback:t,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(r)}),i}function Wc(t,e=!0,n=!1){const o=[];return t.forEach(i=>{const r=typeof i=="string"?qn(i,e,n):i;r&&o.push(r)}),o}var Yc={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Uc(t,e,n,o){const i=t.resources.length,r=t.random?Math.floor(Math.random()*i):t.index;let a;if(t.random){let z=t.resources.slice(0);for(a=[];z.length>1;){const W=Math.floor(Math.random()*z.length);a.push(z[W]),z=z.slice(0,W).concat(z.slice(W+1))}a=a.concat(z)}else a=t.resources.slice(r).concat(t.resources.slice(0,r));const l=Date.now();let d="pending",c=0,u,f=null,h=[],p=[];typeof o=="function"&&p.push(o);function g(){f&&(clearTimeout(f),f=null)}function m(){d==="pending"&&(d="aborted"),g(),h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function w(z,W){W&&(p=[]),typeof z=="function"&&p.push(z)}function I(){return{startTime:l,payload:e,status:d,queriesSent:c,queriesPending:h.length,subscribe:w,abort:m}}function y(){d="failed",p.forEach(z=>{z(void 0,u)})}function v(){h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function C(z,W,j){const D=W!=="success";switch(h=h.filter(O=>O!==z),d){case"pending":break;case"failed":if(D||!t.dataAfterTimeout)return;break;default:return}if(W==="abort"){u=j,y();return}if(D){u=j,h.length||(a.length?$():y());return}if(g(),v(),!t.random){const O=t.resources.indexOf(z.resource);O!==-1&&O!==t.index&&(t.index=O)}d="completed",p.forEach(O=>{O(j)})}function $(){if(d!=="pending")return;g();const z=a.shift();if(z===void 0){if(h.length){f=setTimeout(()=>{g(),d==="pending"&&(v(),y())},t.timeout);return}y();return}const W={status:"pending",resource:z,callback:(j,D)=>{C(W,j,D)}};h.push(W),c++,f=setTimeout($,t.rotate),n(z,e,W.callback)}return setTimeout($),I}function Wr(t){const e={...Yc,...t};let n=[];function o(){n=n.filter(a=>a().status==="pending")}function i(a,l,d){const c=Uc(e,a,l,(u,f)=>{o(),d&&d(u,f)});return n.push(c),c}function r(a){return n.find(l=>a(l))||null}return{query:i,find:r,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:o}}function Yr(){}var ui=Object.create(null);function Xc(t){if(!ui[t]){const e=di(t);if(!e)return;ui[t]={config:e,redundancy:Wr(e)}}return ui[t]}function qc(t,e,n){let o,i;if(typeof t=="string"){const r=ai(t);if(!r)return n(void 0,424),Yr;i=r.send;const a=Xc(t);a&&(o=a.redundancy)}else{const r=li(t);if(r){o=Wr(r);const a=ai(t.resources?t.resources[0]:"");a&&(i=a.send)}}return!o||!i?(n(void 0,424),Yr):o.query(e,i,n)().abort}function Ur(){}function Kc(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Fc(t)}))}function Zc(t){const e=[],n=[];return t.forEach(o=>{(o.match(Ir)?e:n).push(o)}),{valid:e,invalid:n}}function gn(t,e,n){function o(){const i=t.pendingIcons;e.forEach(r=>{i&&i.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!Or(t,n).length){o();return}}catch(i){console.error(i)}o(),Kc(t)}function Xr(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function Jc(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:o}=t,i=t.iconsToLoad;if(delete t.iconsToLoad,!i||!i.length)return;const r=t.loadIcon;if(t.loadIcons&&(i.length>1||!r)){Xr(t.loadIcons(i,o,n),c=>{gn(t,i,c)});return}if(r){i.forEach(c=>{Xr(r(c,o,n),u=>{gn(t,[c],u?{prefix:o,icons:{[c]:u}}:null)})});return}const{valid:a,invalid:l}=Zc(i);if(l.length&&gn(t,l,null),!a.length)return;const d=o.match(Ir)?ai(n):null;if(!d){gn(t,a,null);return}d.prepare(n,o,a).forEach(c=>{qc(n,c,u=>{gn(t,c.icons,u)})})}))}var Qc=(t,e)=>{const n=Lc(Wc(t,!0,$r()));if(!n.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(n.loaded,n.missing,n.pending,Ur)}),()=>{l=!1}}const o=Object.create(null),i=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:c}=l;if(c===a&&d===r)return;r=d,a=c,i.push(Gt(d,c));const u=o[d]||(o[d]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:c,name:u}=l,f=Gt(d,c),h=f.pendingIcons||(f.pendingIcons=new Set);h.has(u)||(h.add(u),o[d][c].push(u))}),i.forEach(l=>{const d=o[l.provider][l.prefix];d.length&&Jc(l,d)}),e?jc(e,n,i):Ur};function ed(t,e){const n={...t};for(const o in e){const i=e[o],r=typeof i;o in Vr?(i===null||i&&(r==="string"||r==="number"))&&(n[o]=i):r===typeof n[o]&&(n[o]=o==="rotate"?i%4:i)}return n}var td=/[\s,]+/;function nd(t,e){e.split(td).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function od(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(t);return isNaN(i)?0:o(i)}else if(n!==t){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/i,r%1===0?o(r):0)}}return e}function id(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in e)n+=" "+o+'="'+e[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function rd(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function sd(t){return"data:image/svg+xml,"+rd(t)}function ad(t){return'url("'+sd(t)+'")'}var qr={...Lr,inline:!1},ld={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},cd={display:"inline-block"},fi={backgroundColor:"currentColor"},Kr={backgroundColor:"transparent"},Zr={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Jr={webkitMask:fi,mask:fi,background:Kr};for(const t in Jr){const e=Jr[t];for(const n in Zr)e[t+n]=Zr[n]}var Qn={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Qn[t+"-flip"]=e,Qn[t.slice(0,1)+"-flip"]=e,Qn[t+"Flip"]=e});function Qr(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}var es=(t,e)=>{const n=ed(qr,e),o={...ld},i=e.mode||"svg",r={},a=e.style,l=typeof a=="object"&&!(a instanceof Array)?a:{};for(let m in e){const w=e[m];if(w!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[m]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&nd(n,w);break;case"color":r.color=w;break;case"rotate":typeof w=="string"?n[m]=od(w):typeof w=="number"&&(n[m]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete o["aria-hidden"];break;default:{const I=Qn[m];I?(w===!0||w==="true"||w===1)&&(n[I]=!0):qr[m]===void 0&&(o[m]=w)}}}const d=Nc(t,n),c=d.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),i==="svg"){o.style={...r,...l},Object.assign(o,c);let m=0,w=e.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),o.innerHTML=Mc(d.body,w?()=>w+"ID"+m++:"iconifyVue"),(0,s.h)("svg",o)}const{body:u,width:f,height:h}=t,p=i==="mask"||(i==="bg"?!1:u.indexOf("currentColor")!==-1),g=id(u,{...c,width:f+"",height:h+""});return o.style={...r,"--svg":ad(g),width:Qr(c.width),height:Qr(c.height),...cd,...p?fi:Kr,...l},(0,s.h)("span",o)};if($r(!0),Bc("",Vc),typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!wc(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const i=e[n];if(typeof i!="object"||!i||i.resources===void 0)continue;zc(n,i)||console.error(o)}catch{console.error(o)}}}}var dd={...fn,body:""},ts=(0,s.defineComponent)((t,{emit:e})=>{const n=(0,s.ref)(null);function o(){n.value&&(n.value.abort?.(),n.value=null)}const i=(0,s.ref)(!!t.ssr),r=(0,s.ref)(""),a=(0,s.shallowRef)(null);function l(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=qn(c,!1,!0))===null)return null;let f=Rr(u);if(!f){const g=n.value;return(!g||g.name!==c)&&(f===null?n.value={name:c}:n.value={name:c,abort:Qc([u],d)}),null}o(),r.value!==c&&(r.value=c,(0,s.nextTick)(()=>{e("load",c)}));const h=t.customise;if(h){f=Object.assign({},f);const g=h(f.body,u.name,u.prefix,u.provider);typeof g=="string"&&(f.body=g)}const p=["iconify"];return u.prefix!==""&&p.push("iconify--"+u.prefix),u.provider!==""&&p.push("iconify--"+u.provider),{data:f,classes:p}}function d(){const c=l();c?c.data!==a.value?.data&&(a.value=c):a.value=null}return i.value?d():(0,s.onMounted)(()=>{i.value=!0,d()}),(0,s.watch)(()=>t.icon,d),(0,s.onUnmounted)(o),()=>{const c=a.value;if(!c)return es(dd,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),es({...fn,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),ud=(0,s.defineComponent)({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const e=t,n=(0,s.computed)(()=>{const i=e.icon;if(i.indexOf(":")===-1)return Hr(`jcode:${e.icon}`)==null,`jcode:${e.icon}`;const r=`jcode:${i.split(":")[1]}`;return Hr(r)!=null?r:i}),o=(0,s.computed)(()=>({size:e.size,color:e.color,icon:n.value}));return(i,r)=>t.isDiv?((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({key:0},i.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[(0,s.createVNode)((0,s.unref)(ts),(0,s.mergeProps)(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16)):((0,s.openBlock)(),(0,s.createElementBlock)("span",(0,s.mergeProps)({key:1},i.$attrs,{class:"jicon"}),[(0,s.createVNode)((0,s.unref)(ts),(0,s.mergeProps)(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),mn=ud,fd=["disabled"],hd={key:2},pd=(0,s.defineComponent)({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=h=>{!u.value&&!o.disabled&&(i("click",h),o.href&&window.open(o.href,o.target?o.target:"_self"))},a=(0,s.shallowRef)(null),l=()=>{a.value?.focus()},d=()=>{a.value?.blur()},c=(0,s.computed)(()=>o.notLabel||!o.label),u=(0,s.ref)(!1);(0,s.watch)(()=>o.loading,h=>{if(typeof h=="boolean")u.value=h;else if(Xn(h?.delay))u.value=!1;else{const p=setTimeout(()=>{u.value=!0},h.delay);return()=>clearTimeout(p)}},{immediate:!0});const f=(0,s.computed)(()=>o.label||"");return e({focus:l,blur:d}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("button",{ref_key:"buttonNodeRef",ref:a,type:"button",class:(0,s.normalizeClass)(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":u.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:(0,s.withModifiers)(r,["stop"])},[u.value?((0,s.openBlock)(),(0,s.createBlock)(mn,{key:0,icon:"mdi:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):(0,s.createCommentVNode)("",!0),t.icon?((0,s.openBlock)(),(0,s.createBlock)(mn,{key:1,icon:t.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),t.notLabel?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",hd,(0,s.toDisplayString)(f.value),1)),(0,s.renderSlot)(h.$slots,"iconAfter")],10,fd))}}),gd=pd,jt=fc(gd),md={class:"d-drag-btns-pname"},vd={key:0,class:"d-drag-mask"},yd=(0,s.defineComponent)({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(t){const e=t,n=(0,s.ref)(),{onMouseenter:o,onMouseleave:i,activeComponent:r,handleComponentClick:a,deleteComponentByClick:l,copyComponent:d,getParentComponents:c,isHover:u,isSelect:f,isTopActive:h,isBottomActive:p,isBottomToolBar:g}=Dr(n,e.componentData,"component"),{onContextmenu:m,onMousedown:w,moveActive:I}=Tr(e.componentData,!1);return(y,v)=>{const C=(0,s.resolveComponent)("el-space");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["d-drag-component",{selected:(0,s.unref)(f),hovered:(0,s.unref)(u),isBottomToolBar:(0,s.unref)(g),active:(0,s.unref)(I),isTopActive:(0,s.unref)(h),isBottomActive:(0,s.unref)(p)}])},[v[11]||(v[11]=(0,s.createElementVNode)("div",{class:"d-drag-line"},null,-1)),(0,s.createElementVNode)("div",{class:"d-drag-btns",onMouseenter:v[4]||(v[4]=(...$)=>(0,s.unref)(o)&&(0,s.unref)(o)(...$)),onMouseleave:v[5]||(v[5]=(...$)=>(0,s.unref)(i)&&(0,s.unref)(i)(...$))},[(0,s.createVNode)(C,{size:4},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,s.withModifiers)(()=>{},["stop"])},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"]),(0,s.createElementVNode)("div",md,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(c)(t.componentData.containerId),$=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:$.id},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:$.name,onClick:z=>(0,s.unref)(a)($.id)},null,8,["label","onClick"])]))),128))])]),(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:v[0]||(v[0]=(0,s.withModifiers)($=>(0,s.unref)(d)(t.componentData.id),["stop"]))}),(0,s.createElementVNode)("div",{onContextmenu:v[1]||(v[1]=(0,s.withModifiers)((...$)=>(0,s.unref)(m)&&(0,s.unref)(m)(...$),["stop"])),onMousedown:v[2]||(v[2]=(0,s.withModifiers)((...$)=>(0,s.unref)(w)&&(0,s.unref)(w)(...$),["stop"])),style:{display:"flex"}},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:v[3]||(v[3]=(0,s.withModifiers)($=>(0,s.unref)(l)(t.componentData.id),["stop"]))})]),_:1})],32),(0,s.createElementVNode)("div",{ref_key:"refDrag",ref:n,class:"d-drag-body",onClick:v[6]||(v[6]=(0,s.withModifiers)((...$)=>(0,s.unref)(r)&&(0,s.unref)(r)(...$),["stop"])),onContextmenu:v[7]||(v[7]=(0,s.withModifiers)((...$)=>(0,s.unref)(m)&&(0,s.unref)(m)(...$),["stop"])),onMousedown:v[8]||(v[8]=(0,s.withModifiers)((...$)=>(0,s.unref)(w)&&(0,s.unref)(w)(...$),["stop"])),onMouseenter:v[9]||(v[9]=(...$)=>(0,s.unref)(o)&&(0,s.unref)(o)(...$)),onMouseleave:v[10]||(v[10]=(...$)=>(0,s.unref)(i)&&(0,s.unref)(i)(...$))},[(0,s.renderSlot)(y.$slots,"default"),t.isContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",vd))],544)],2)}}}),hi=yd,_d=(0,s.defineComponent)({name:"DDragTool",__name:"tool",props:{config:{}},setup(t){const{onContextmenu:e,onMousedown:n,onClick:o}=Tr(t.config??{name:"",id:""},!0);return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-drag-tool",onClick:r[0]||(r[0]=(0,s.withModifiers)((...a)=>(0,s.unref)(o)&&(0,s.unref)(o)(...a),["stop"])),onContextmenu:r[1]||(r[1]=(0,s.withModifiers)((...a)=>(0,s.unref)(e)&&(0,s.unref)(e)(...a),["stop"])),onMousedown:r[2]||(r[2]=(0,s.withModifiers)((...a)=>(0,s.unref)(n)&&(0,s.unref)(n)(...a),["stop"]))},[(0,s.renderSlot)(i.$slots,"default")],32))}}),pi=_d,wd={key:0,class:"d-drag-line"},bd={key:1,class:"d-drag-btns"},Cd=(0,s.defineComponent)({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(t){const e=t,n=(0,s.ref)(),o=(0,s.computed)(()=>e.componentData?.children||[]),{onMouseenter:i,onMouseleave:r,activeComponent:a,isHover:l,isSelect:d,isToContainer:c,isMoveingInTopLevel:u,isTopActive:f,isBottomActive:h}=Dr(n,e.componentData,"container",o,e.isComponentContainer,e.groupId),p=(0,s.computed)(()=>!!(o.value.findIndex(g=>g.groupId===e.groupId)===-1&&c.value));return(g,m)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"refDrag",ref:n,class:(0,s.normalizeClass)(["d-drag-container",{selected:(0,s.unref)(d)&&!t.isComponentContainer,hovered:(0,s.unref)(l)&&!t.isComponentContainer,isTopLevel:t.componentData.level===0,active:p.value,isMoveingInTopLevel:(0,s.unref)(u),isTopActive:(0,s.unref)(f),isBottomActive:(0,s.unref)(h)}])},[t.isComponentContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",wd)),t.isComponentContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",bd,[(0,s.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,s.withModifiers)(()=>{},["stop"])},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"])])])),(0,s.createElementVNode)("div",{class:"d-drag-body",onClick:m[0]||(m[0]=(0,s.withModifiers)((...w)=>(0,s.unref)(a)&&(0,s.unref)(a)(...w),["stop"])),onMouseenter:m[1]||(m[1]=(...w)=>(0,s.unref)(i)&&(0,s.unref)(i)(...w)),onMouseleave:m[2]||(m[2]=(...w)=>(0,s.unref)(r)&&(0,s.unref)(r)(...w))},[(0,s.renderSlot)(g.$slots,"default")],32)],2))}}),gi=Cd,Ed=(0,s.defineComponent)({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,s.inject)("dui-design-provide",{});return(n,o)=>{const i=(0,s.resolveComponent)("el-col");return(0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.componentList,r=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:r.id},[r.type!="pkey"?((0,s.openBlock)(),(0,s.createBlock)(i,{key:0,span:r.config.span||24},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(hi,{"is-container":r.dragType!=="component","component-data":r},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):(0,s.createCommentVNode)("",!0)],64))),128)}}}),mi=Ed,xd=(0,s.defineComponent)({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,s.inject)("dui-design-provide",{}),n=o=>{if(o.flexWidth)return{width:o.flexWidth+"%"}};return(o,i)=>((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.componentList,r=>((0,s.openBlock)(),(0,s.createBlock)(hi,{key:r.id,style:(0,s.normalizeStyle)(n(r.config)),"is-container":r.dragType!=="component","component-data":r},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),vi=xd,ns=Mt(hi,[pi,gi,mi,vi]);function vn(t){return(0,s.getCurrentScope)()?((0,s.onScopeDispose)(t),!0):!1}function ut(t){return typeof t=="function"?t():(0,s.unref)(t)}var Sd=typeof window<"u"&&typeof document<"u",kd=t=>typeof t<"u",Nd=Object.prototype.toString,Dd=t=>Nd.call(t)==="[object Object]",Td=()=>{};function Id(t,e){function n(...o){return new Promise((i,r)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(r)})}return n}var os=t=>t();function Md(t=os){const e=(0,s.ref)(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...r)=>{e.value&&t(...r)};return{isActive:(0,s.readonly)(e),pause:n,resume:o,eventFilter:i}}function is(t,e=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(e?()=>i(n):o,t)})}function Bd(t,e,n={}){const{eventFilter:o=os,...i}=n;return(0,s.watch)(t,Id(o,e),i)}function Wt(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:l,isActive:d}=Md(o);return{stop:Bd(t,e,{...i,eventFilter:r}),pause:a,resume:l,isActive:d}}function zd(t,e={}){if(!(0,s.isRef)(t))return(0,s.toRefs)(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=(0,s.customRef)(()=>({get(){return t.value[o]},set(i){var r;if((r=ut(e.replaceRef))==null||r)if(Array.isArray(t.value)){const a=[...t.value];a[o]=i,t.value=a}else{const a={...t.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[o]=i}}));return n}function yi(t,e=!1){function n(f,{flush:h="sync",deep:p=!1,timeout:g,throwOnTimeout:m}={}){let w=null;const I=[new Promise(y=>{w=(0,s.watch)(t,v=>{f(v)!==e&&(w?.(),y(v))},{flush:h,deep:p,immediate:!0})})];return g!=null&&I.push(is(g,m).then(()=>ut(t)).finally(()=>w?.())),Promise.race(I)}function o(f,h){if(!(0,s.isRef)(f))return n(v=>v===f,h);const{flush:p="sync",deep:g=!1,timeout:m,throwOnTimeout:w}=h??{};let I=null;const y=[new Promise(v=>{I=(0,s.watch)([t,f],([C,$])=>{e!==(C===$)&&(I?.(),v(C))},{flush:p,deep:g,immediate:!0})})];return m!=null&&y.push(is(m,w).then(()=>ut(t)).finally(()=>(I?.(),ut(t)))),Promise.race(y)}function i(f){return n(h=>!!h,f)}function r(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function d(f,h){return n(p=>{const g=Array.from(p);return g.includes(f)||g.includes(ut(f))},h)}function c(f){return u(1,f)}function u(f=1,h){let p=-1;return n(()=>(p+=1,p>=f),h)}return Array.isArray(ut(t))?{toMatch:n,toContains:d,changed:c,changedTimes:u,get not(){return yi(t,!e)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:l,toBeUndefined:a,changed:c,changedTimes:u,get not(){return yi(t,!e)}}}function _i(t){return yi(t)}function Ad(t){var e;const n=ut(t);return(e=n?.$el)!=null?e:n}var rs=Sd?window:void 0;function ss(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=rs):[e,n,o,i]=t,!e)return Td;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(u=>u()),r.length=0},l=(u,f,h,p)=>(u.addEventListener(f,h,p),()=>u.removeEventListener(f,h,p)),d=(0,s.watch)(()=>[Ad(e),ut(i)],([u,f])=>{if(a(),!u)return;const h=Dd(f)?{...f}:f;r.push(...n.flatMap(p=>o.map(g=>l(u,p,g,h))))},{immediate:!0,flush:"post"}),c=()=>{d(),a()};return vn(c),c}function Pd(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function as(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=rs,eventName:r="keydown",passive:a=!1,dedupe:l=!1}=o,d=Pd(e);return ss(i,r,u=>{u.repeat&&ut(l)||d(u)&&n(u)},a)}function Od(t){return JSON.parse(JSON.stringify(t))}function wi(t,e,n,o={}){var i,r,a;const{clone:l=!1,passive:d=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:h}=o,p=(0,s.getCurrentInstance)(),g=n||p?.emit||((i=p?.$emit)==null?void 0:i.bind(p))||((a=(r=p?.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p?.proxy));let m=c;e||(e="modelValue"),m=m||`update:${e.toString()}`;const w=v=>l?typeof l=="function"?l(v):Od(v):v,I=()=>kd(t[e])?w(t[e]):f,y=v=>{h?h(v)&&g(m,v):g(m,v)};if(d){const v=(0,s.ref)(I());let C=!1;return(0,s.watch)(()=>t[e],$=>{C||(C=!0,v.value=w($),(0,s.nextTick)(()=>C=!1))}),(0,s.watch)(v,$=>{!C&&($!==t[e]||u)&&y($)},{deep:u}),v}else return(0,s.computed)({get(){return I()},set(v){y(v)}})}var $d={value:()=>{}};function eo(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new to(n)}function to(t){this._=t}function Rd(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}to.prototype=eo.prototype={constructor:to,on:function(t,e){var n=this._,o=Rd(t+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(t=o[r]).type)&&(i=Hd(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++r<a;)if(i=(t=o[r]).type)n[i]=ls(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ls(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new to(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)}};function Hd(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}function ls(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=$d,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var bi="http://www.w3.org/1999/xhtml",cs={svg:"http://www.w3.org/2000/svg",xhtml:bi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function no(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),cs.hasOwnProperty(e)?{space:cs[e],local:t}:t}function Vd(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===bi&&e.documentElement.namespaceURI===bi?e.createElement(t):e.createElementNS(n,t)}}function Ld(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ds(t){var e=no(t);return(e.local?Ld:Vd)(e)}function Fd(){}function Ci(t){return t==null?Fd:function(){return this.querySelector(t)}}function Gd(t){typeof t!="function"&&(t=Ci(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=new Array(a),d,c,u=0;u<a;++u)(d=r[u])&&(c=t.call(d,d.__data__,u,r))&&("__data__"in d&&(c.__data__=d.__data__),l[u]=c);return new Fe(o,this._parents)}function jd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Wd(){return[]}function us(t){return t==null?Wd:function(){return this.querySelectorAll(t)}}function Yd(t){return function(){return jd(t.apply(this,arguments))}}function Ud(t){typeof t=="function"?t=Yd(t):t=us(t);for(var e=this._groups,n=e.length,o=[],i=[],r=0;r<n;++r)for(var a=e[r],l=a.length,d,c=0;c<l;++c)(d=a[c])&&(o.push(t.call(d,d.__data__,c,a)),i.push(d));return new Fe(o,i)}function fs(t){return function(){return this.matches(t)}}function hs(t){return function(e){return e.matches(t)}}var Xd=Array.prototype.find;function qd(t){return function(){return Xd.call(this.children,t)}}function Kd(){return this.firstElementChild}function Zd(t){return this.select(t==null?Kd:qd(typeof t=="function"?t:hs(t)))}var Jd=Array.prototype.filter;function Qd(){return Array.from(this.children)}function eu(t){return function(){return Jd.call(this.children,t)}}function tu(t){return this.selectAll(t==null?Qd:eu(typeof t=="function"?t:hs(t)))}function nu(t){typeof t!="function"&&(t=fs(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],d,c=0;c<a;++c)(d=r[c])&&t.call(d,d.__data__,c,r)&&l.push(d);return new Fe(o,this._parents)}function ps(t){return new Array(t.length)}function ou(){return new Fe(this._enter||this._groups.map(ps),this._parents)}function oo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}oo.prototype={constructor:oo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function iu(t){return function(){return t}}function ru(t,e,n,o,i,r){for(var a=0,l,d=e.length,c=r.length;a<c;++a)(l=e[a])?(l.__data__=r[a],o[a]=l):n[a]=new oo(t,r[a]);for(;a<d;++a)(l=e[a])&&(i[a]=l)}function su(t,e,n,o,i,r,a){var l,d,c=new Map,u=e.length,f=r.length,h=new Array(u),p;for(l=0;l<u;++l)(d=e[l])&&(h[l]=p=a.call(d,d.__data__,l,e)+"",c.has(p)?i[l]=d:c.set(p,d));for(l=0;l<f;++l)p=a.call(t,r[l],l,r)+"",(d=c.get(p))?(o[l]=d,d.__data__=r[l],c.delete(p)):n[l]=new oo(t,r[l]);for(l=0;l<u;++l)(d=e[l])&&c.get(h[l])===d&&(i[l]=d)}function au(t){return t.__data__}function lu(t,e){if(!arguments.length)return Array.from(this,au);var n=e?su:ru,o=this._parents,i=this._groups;typeof t!="function"&&(t=iu(t));for(var r=i.length,a=new Array(r),l=new Array(r),d=new Array(r),c=0;c<r;++c){var u=o[c],f=i[c],h=f.length,p=cu(t.call(u,u&&u.__data__,c,o)),g=p.length,m=l[c]=new Array(g),w=a[c]=new Array(g);n(u,f,m,w,d[c]=new Array(h),p,e);for(var I=0,y=0,v,C;I<g;++I)if(v=m[I]){for(I>=y&&(y=I+1);!(C=w[y])&&++y<g;);v._next=C||null}}return a=new Fe(a,o),a._enter=l,a._exit=d,a}function cu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function du(){return new Fe(this._exit||this._groups.map(ps),this._parents)}function uu(t,e,n){var o=this.enter(),i=this,r=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function fu(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,r=o.length,a=Math.min(i,r),l=new Array(i),d=0;d<a;++d)for(var c=n[d],u=o[d],f=c.length,h=l[d]=new Array(f),p,g=0;g<f;++g)(p=c[g]||u[g])&&(h[g]=p);for(;d<i;++d)l[d]=n[d];return new Fe(l,this._parents)}function hu(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function pu(t){t||(t=gu);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],l=a.length,d=i[r]=new Array(l),c,u=0;u<l;++u)(c=a[u])&&(d[u]=c);d.sort(e)}return new Fe(i,this._parents).order()}function gu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function mu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vu(){return Array.from(this)}function yu(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function _u(){let t=0;for(const e of this)++t;return t}function wu(){return!this.node()}function bu(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],r=0,a=i.length,l;r<a;++r)(l=i[r])&&t.call(l,l.__data__,r,i);return this}function Cu(t){return function(){this.removeAttribute(t)}}function Eu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xu(t,e){return function(){this.setAttribute(t,e)}}function Su(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ku(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Nu(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Du(t,e){var n=no(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?Eu:Cu:typeof e=="function"?n.local?Nu:ku:n.local?Su:xu)(n,e))}function gs(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Tu(t){return function(){this.style.removeProperty(t)}}function Iu(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Mu(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Bu(t,e,n){return arguments.length>1?this.each((e==null?Tu:typeof e=="function"?Mu:Iu)(t,e,n??"")):Yt(this.node(),t)}function Yt(t,e){return t.style.getPropertyValue(e)||gs(t).getComputedStyle(t,null).getPropertyValue(e)}function zu(t){return function(){delete this[t]}}function Au(t,e){return function(){this[t]=e}}function Pu(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ou(t,e){return arguments.length>1?this.each((e==null?zu:typeof e=="function"?Pu:Au)(t,e)):this.node()[t]}function ms(t){return t.trim().split(/^|\s+/)}function Ei(t){return t.classList||new vs(t)}function vs(t){this._node=t,this._names=ms(t.getAttribute("class")||"")}vs.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ys(t,e){for(var n=Ei(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function _s(t,e){for(var n=Ei(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function $u(t){return function(){ys(this,t)}}function Ru(t){return function(){_s(this,t)}}function Hu(t,e){return function(){(e.apply(this,arguments)?ys:_s)(this,t)}}function Vu(t,e){var n=ms(t+"");if(arguments.length<2){for(var o=Ei(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Hu:e?$u:Ru)(n,e))}function Lu(){this.textContent=""}function Fu(t){return function(){this.textContent=t}}function Gu(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ju(t){return arguments.length?this.each(t==null?Lu:(typeof t=="function"?Gu:Fu)(t)):this.node().textContent}function Wu(){this.innerHTML=""}function Yu(t){return function(){this.innerHTML=t}}function Uu(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Xu(t){return arguments.length?this.each(t==null?Wu:(typeof t=="function"?Uu:Yu)(t)):this.node().innerHTML}function qu(){this.nextSibling&&this.parentNode.appendChild(this)}function Ku(){return this.each(qu)}function Zu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ju(){return this.each(Zu)}function Qu(t){var e=typeof t=="function"?t:ds(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function ef(){return null}function tf(t,e){var n=typeof t=="function"?t:ds(t),o=e==null?ef:typeof e=="function"?e:Ci(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function nf(){var t=this.parentNode;t&&t.removeChild(this)}function of(){return this.each(nf)}function rf(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function sf(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function af(t){return this.select(t?sf:rf)}function lf(t){return arguments.length?this.property("__data__",t):this.node().__data__}function cf(t){return function(e){t.call(this,e,this.__data__)}}function df(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function uf(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,r;n<i;++n)r=e[n],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):e[++o]=r;++o?e.length=o:delete this.__on}}}function ff(t,e,n){return function(){var o=this.__on,i,r=cf(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=e;return}}this.addEventListener(t.type,r,n),i={type:t.type,name:t.name,value:e,listener:r,options:n},o?o.push(i):this.__on=[i]}}function hf(t,e,n){var o=df(t+""),i,r=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var d=0,c=l.length,u;d<c;++d)for(i=0,u=l[d];i<r;++i)if((a=o[i]).type===u.type&&a.name===u.name)return u.value}return}for(l=e?ff:uf,i=0;i<r;++i)this.each(l(o[i],e,n));return this}function ws(t,e,n){var o=gs(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function pf(t,e){return function(){return ws(this,t,e)}}function gf(t,e){return function(){return ws(this,t,e.apply(this,arguments))}}function mf(t,e){return this.each((typeof e=="function"?gf:pf)(t,e))}function*vf(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var bs=[null];function Fe(t,e){this._groups=t,this._parents=e}function yn(){return new Fe([[document.documentElement]],bs)}function yf(){return this}Fe.prototype=yn.prototype={constructor:Fe,select:Gd,selectAll:Ud,selectChild:Zd,selectChildren:tu,filter:nu,data:lu,enter:ou,exit:du,join:uu,merge:fu,selection:yf,order:hu,sort:pu,call:mu,nodes:vu,node:yu,size:_u,empty:wu,each:bu,attr:Du,style:Bu,property:Ou,classed:Vu,text:ju,html:Xu,raise:Ku,lower:Ju,append:Qu,insert:tf,remove:of,clone:af,datum:lf,on:hf,dispatch:mf,[Symbol.iterator]:vf};function Ze(t){return typeof t=="string"?new Fe([[document.querySelector(t)]],[document.documentElement]):new Fe([[t]],bs)}function _f(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ot(t,e){if(t=_f(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var wf={passive:!1},_n={capture:!0,passive:!1};function xi(t){t.stopImmediatePropagation()}function Ut(t){t.preventDefault(),t.stopImmediatePropagation()}function Cs(t){var e=t.document.documentElement,n=Ze(t).on("dragstart.drag",Ut,_n);"onselectstart"in e?n.on("selectstart.drag",Ut,_n):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Es(t,e){var n=t.document.documentElement,o=Ze(t).on("dragstart.drag",null);e&&(o.on("click.drag",Ut,_n),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var io=t=>()=>t;function Si(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:r,x:a,y:l,dx:d,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Si.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function bf(t){return!t.ctrlKey&&!t.button}function Cf(){return this.parentNode}function Ef(t,e){return e??{x:t.x,y:t.y}}function xf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sf(){var t=bf,e=Cf,n=Ef,o=xf,i={},r=eo("start","drag","end"),a=0,l,d,c,u,f=0;function h(C){C.on("mousedown.drag",p).filter(o).on("touchstart.drag",w).on("touchmove.drag",I,wf).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(C,$){if(!(u||!t.call(this,C,$))){var z=v(this,e.call(this,C,$),C,$,"mouse");z&&(Ze(C.view).on("mousemove.drag",g,_n).on("mouseup.drag",m,_n),Cs(C.view),xi(C),c=!1,l=C.clientX,d=C.clientY,z("start",C))}}function g(C){if(Ut(C),!c){var $=C.clientX-l,z=C.clientY-d;c=$*$+z*z>f}i.mouse("drag",C)}function m(C){Ze(C.view).on("mousemove.drag mouseup.drag",null),Es(C.view,c),Ut(C),i.mouse("end",C)}function w(C,$){if(t.call(this,C,$)){var z=C.changedTouches,W=e.call(this,C,$),j=z.length,D,O;for(D=0;D<j;++D)(O=v(this,W,C,$,z[D].identifier,z[D]))&&(xi(C),O("start",C,z[D]))}}function I(C){var $=C.changedTouches,z=$.length,W,j;for(W=0;W<z;++W)(j=i[$[W].identifier])&&(Ut(C),j("drag",C,$[W]))}function y(C){var $=C.changedTouches,z=$.length,W,j;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),W=0;W<z;++W)(j=i[$[W].identifier])&&(xi(C),j("end",C,$[W]))}function v(C,$,z,W,j,D){var O=r.copy(),H=ot(D||z,$),S,Y,b;if((b=n.call(C,new Si("beforestart",{sourceEvent:z,target:h,identifier:j,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:O}),W))!=null)return S=b.x-H[0]||0,Y=b.y-H[1]||0,function B(_,x,T){var P=H,L;switch(_){case"start":i[j]=B,L=a++;break;case"end":delete i[j],--a;case"drag":H=ot(T||x,$),L=a;break}O.call(_,C,new Si(_,{sourceEvent:x,subject:b,target:h,identifier:j,active:L,x:H[0]+S,y:H[1]+Y,dx:H[0]-P[0],dy:H[1]-P[1],dispatch:O}),W)}}return h.filter=function(C){return arguments.length?(t=typeof C=="function"?C:io(!!C),h):t},h.container=function(C){return arguments.length?(e=typeof C=="function"?C:io(C),h):e},h.subject=function(C){return arguments.length?(n=typeof C=="function"?C:io(C),h):n},h.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:io(!!C),h):o},h.on=function(){var C=r.on.apply(r,arguments);return C===r?h:C},h.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,h):Math.sqrt(f)},h}function ki(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function xs(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function wn(){}var bn=.7,ro=1/bn,Xt="\\s*([+-]?\\d+)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kf=/^#([0-9a-f]{3,8})$/,Nf=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),Df=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),Tf=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Cn}\\)$`),If=new RegExp(`^rgba\\(${it},${it},${it},${Cn}\\)$`),Mf=new RegExp(`^hsl\\(${Cn},${it},${it}\\)$`),Bf=new RegExp(`^hsla\\(${Cn},${it},${it},${Cn}\\)$`),Ss={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ki(wn,Bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ks,formatHex:ks,formatHex8:zf,formatHsl:Af,formatRgb:Ns,toString:Ns});function ks(){return this.rgb().formatHex()}function zf(){return this.rgb().formatHex8()}function Af(){return Bs(this).formatHsl()}function Ns(){return this.rgb().formatRgb()}function Bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=kf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ds(e):n===3?new Re(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?so(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?so(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Nf.exec(t))?new Re(e[1],e[2],e[3],1):(e=Df.exec(t))?new Re(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Tf.exec(t))?so(e[1],e[2],e[3],e[4]):(e=If.exec(t))?so(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Mf.exec(t))?Ms(e[1],e[2]/100,e[3]/100,1):(e=Bf.exec(t))?Ms(e[1],e[2]/100,e[3]/100,e[4]):Ss.hasOwnProperty(t)?Ds(Ss[t]):t==="transparent"?new Re(NaN,NaN,NaN,0):null}function Ds(t){return new Re(t>>16&255,t>>8&255,t&255,1)}function so(t,e,n,o){return o<=0&&(t=e=n=NaN),new Re(t,e,n,o)}function Pf(t){return t instanceof wn||(t=Bt(t)),t?(t=t.rgb(),new Re(t.r,t.g,t.b,t.opacity)):new Re}function Ni(t,e,n,o){return arguments.length===1?Pf(t):new Re(t,e,n,o??1)}function Re(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}ki(Re,Ni,xs(wn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bn:Math.pow(bn,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Re(zt(this.r),zt(this.g),zt(this.b),ao(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ts,formatHex:Ts,formatHex8:Of,formatRgb:Is,toString:Is}));function Ts(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Of(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function Is(){const t=ao(this.opacity);return`${t===1?"rgb(":"rgba("}${zt(this.r)}, ${zt(this.g)}, ${zt(this.b)}${t===1?")":`, ${t})`}`}function ao(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function At(t){return t=zt(t),(t<16?"0":"")+t.toString(16)}function Ms(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Je(t,e,n,o)}function Bs(t){if(t instanceof Je)return new Je(t.h,t.s,t.l,t.opacity);if(t instanceof wn||(t=Bt(t)),!t)return new Je;if(t instanceof Je)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),r=Math.max(e,n,o),a=NaN,l=r-i,d=(r+i)/2;return l?(e===r?a=(n-o)/l+(n<o)*6:n===r?a=(o-e)/l+2:a=(e-n)/l+4,l/=d<.5?r+i:2-r-i,a*=60):l=d>0&&d<1?0:a,new Je(a,l,d,t.opacity)}function $f(t,e,n,o){return arguments.length===1?Bs(t):new Je(t,e,n,o??1)}function Je(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}ki(Je,$f,xs(wn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new Je(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bn:Math.pow(bn,t),new Je(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,i=2*n-o;return new Re(Di(t>=240?t-240:t+120,i,o),Di(t,i,o),Di(t<120?t+240:t-120,i,o),this.opacity)},clamp(){return new Je(zs(this.h),lo(this.s),lo(this.l),ao(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ao(this.opacity);return`${t===1?"hsl(":"hsla("}${zs(this.h)}, ${lo(this.s)*100}%, ${lo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zs(t){return t=(t||0)%360,t<0?t+360:t}function lo(t){return Math.max(0,Math.min(1,t||0))}function Di(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Ti=t=>()=>t;function Rf(t,e){return function(n){return t+n*e}}function Hf(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Vf(t){return(t=+t)==1?As:function(e,n){return n-e?Hf(e,n,t):Ti(isNaN(e)?n:e)}}function As(t,e){var n=e-t;return n?Rf(t,n):Ti(isNaN(t)?e:t)}var co=(function t(e){var n=Vf(e);function o(i,r){var a=n((i=Ni(i)).r,(r=Ni(r)).r),l=n(i.g,r.g),d=n(i.b,r.b),c=As(i.opacity,r.opacity);return function(u){return i.r=a(u),i.g=l(u),i.b=d(u),i.opacity=c(u),i+""}}return o.gamma=t,o})(1);function Lf(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=t[i]*(1-r)+e[i]*r;return o}}function Ff(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gf(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,i=new Array(o),r=new Array(n),a;for(a=0;a<o;++a)i[a]=En(t[a],e[a]);for(;a<n;++a)r[a]=e[a];return function(l){for(a=0;a<o;++a)r[a]=i[a](l);return r}}function jf(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function rt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Wf(t,e){var n={},o={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=En(t[i],e[i]):o[i]=e[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(Ii.source,"g");function Yf(t){return function(){return t}}function Uf(t){return function(e){return t(e)+""}}function Ps(t,e){var n=Ii.lastIndex=Mi.lastIndex=0,o,i,r,a=-1,l=[],d=[];for(t=t+"",e=e+"";(o=Ii.exec(t))&&(i=Mi.exec(e));)(r=i.index)>n&&(r=e.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,d.push({i:a,x:rt(o,i)})),n=Mi.lastIndex;return n<e.length&&(r=e.slice(n),l[a]?l[a]+=r:l[++a]=r),l.length<2?d[0]?Uf(d[0].x):Yf(e):(e=d.length,function(c){for(var u=0,f;u<e;++u)l[(f=d[u]).i]=f.x(c);return l.join("")})}function En(t,e){var n=typeof e,o;return e==null||n==="boolean"?Ti(e):(n==="number"?rt:n==="string"?(o=Bt(e))?(e=o,co):Ps:e instanceof Bt?co:e instanceof Date?jf:Ff(e)?Lf:Array.isArray(e)?Gf:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Wf:rt)(t,e)}var Os=180/Math.PI,Bi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $s(t,e,n,o,i,r){var a,l,d;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(d=t*n+e*o)&&(n-=t*d,o-=e*d),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,d/=l),t*o<e*n&&(t=-t,e=-e,d=-d,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(e,t)*Os,skewX:Math.atan(d)*Os,scaleX:a,scaleY:l}}var uo;function Xf(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Bi:$s(e.a,e.b,e.c,e.d,e.e,e.f)}function qf(t){return t==null||(uo||(uo=document.createElementNS("http://www.w3.org/2000/svg","g")),uo.setAttribute("transform",t),!(t=uo.transform.baseVal.consolidate()))?Bi:(t=t.matrix,$s(t.a,t.b,t.c,t.d,t.e,t.f))}function Rs(t,e,n,o){function i(c){return c.length?c.pop()+" ":""}function r(c,u,f,h,p,g){if(c!==f||u!==h){var m=p.push("translate(",null,e,null,n);g.push({i:m-4,x:rt(c,f)},{i:m-2,x:rt(u,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(c,u,f,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:rt(c,u)})):u&&f.push(i(f)+"rotate("+u+o)}function l(c,u,f,h){c!==u?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:rt(c,u)}):u&&f.push(i(f)+"skewX("+u+o)}function d(c,u,f,h,p,g){if(c!==f||u!==h){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:rt(c,f)},{i:m-2,x:rt(u,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,u){var f=[],h=[];return c=t(c),u=t(u),r(c.translateX,c.translateY,u.translateX,u.translateY,f,h),a(c.rotate,u.rotate,f,h),l(c.skewX,u.skewX,f,h),d(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,h),c=u=null,function(p){for(var g=-1,m=h.length,w;++g<m;)f[(w=h[g]).i]=w.x(p);return f.join("")}}}var Kf=Rs(Xf,"px, ","px)","deg)"),Zf=Rs(qf,", ",")",")"),Jf=1e-12;function Hs(t){return((t=Math.exp(t))+1/t)/2}function Qf(t){return((t=Math.exp(t))-1/t)/2}function eh(t){return((t=Math.exp(2*t))-1)/(t+1)}var fo=(function t(e,n,o){function i(r,a){var l=r[0],d=r[1],c=r[2],u=a[0],f=a[1],h=a[2],p=u-l,g=f-d,m=p*p+g*g,w,I;if(m<Jf)I=Math.log(h/c)/e,w=function(z){return[l+z*p,d+z*g,c*Math.exp(e*z*I)]};else{var y=Math.sqrt(m),v=(h*h-c*c+o*m)/(2*c*n*y),C=(h*h-c*c-o*m)/(2*h*n*y),$=Math.log(Math.sqrt(v*v+1)-v);I=(Math.log(Math.sqrt(C*C+1)-C)-$)/e,w=function(z){var W=z*I,j=Hs($),D=c/(n*y)*(j*eh(e*W+$)-Qf($));return[l+D*p,d+D*g,c*j/Hs(e*W+$)]}}return w.duration=I*1e3*e/Math.SQRT2,w}return i.rho=function(r){var a=Math.max(.001,+r),l=a*a;return t(a,l,l*l)},i})(Math.SQRT2,2,4),qt=0,xn=0,Sn=0,Vs=1e3,ho,kn,po=0,Pt=0,go=0,Nn=typeof performance=="object"&&performance.now?performance:Date,Ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zi(){return Pt||(Ls(th),Pt=Nn.now()+go)}function th(){Pt=0}function mo(){this._call=this._time=this._next=null}mo.prototype=Fs.prototype={constructor:mo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?zi():+n)+(e==null?0:+e),!this._next&&kn!==this&&(kn?kn._next=this:ho=this,kn=this),this._call=t,this._time=n,Ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ai())}};function Fs(t,e,n){var o=new mo;return o.restart(t,e,n),o}function nh(){zi(),++qt;for(var t=ho,e;t;)(e=Pt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--qt}function Gs(){Pt=(po=Nn.now())+go,qt=xn=0;try{nh()}finally{qt=0,ih(),Pt=0}}function oh(){var t=Nn.now(),e=t-po;e>Vs&&(go-=e,po=t)}function ih(){for(var t,e=ho,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ho=n);kn=t,Ai(o)}function Ai(t){qt||(xn&&(xn=clearTimeout(xn)),t-Pt>24?(t<1/0&&(xn=setTimeout(Gs,t-Nn.now()-go)),Sn&&(Sn=clearInterval(Sn))):(Sn||(po=Nn.now(),Sn=setInterval(oh,Vs)),qt=1,Ls(Gs)))}function js(t,e,n){var o=new mo;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}var rh=eo("start","end","cancel","interrupt"),sh=[],Ws=0,Ys=1,Pi=2,vo=3,Us=4,Oi=5,yo=6;function _o(t,e,n,o,i,r){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;ah(t,n,{name:e,index:o,group:i,on:rh,tween:sh,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ws})}function $i(t,e){var n=Qe(t,e);if(n.state>Ws)throw new Error("too late; already scheduled");return n}function st(t,e){var n=Qe(t,e);if(n.state>vo)throw new Error("too late; already running");return n}function Qe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ah(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=Fs(r,0,n.time);function r(c){n.state=Ys,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,f,h,p;if(n.state!==Ys)return d();for(u in o)if(p=o[u],p.name===n.name){if(p.state===vo)return js(a);p.state===Us?(p.state=yo,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete o[u]):+u<e&&(p.state=yo,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete o[u])}if(js(function(){n.state===vo&&(n.state=Us,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Pi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Pi){for(n.state=vo,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(p=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(d),n.state=Oi,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===Oi&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=yo,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function wo(t,e){var n=t.__transition,o,i,r=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){r=!1;continue}i=o.state>Pi&&o.state<Oi,o.state=yo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}r&&delete t.__transition}}function lh(t){return this.each(function(){wo(this,t)})}function ch(t,e){var n,o;return function(){var i=st(this,t),r=i.tween;if(r!==n){o=n=r;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function dh(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=st(this,t),a=r.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},d=0,c=i.length;d<c;++d)if(i[d].name===e){i[d]=l;break}d===c&&i.push(l)}r.tween=i}}function uh(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Qe(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?ch:dh)(n,t,e))}function Ri(t,e,n){var o=t._id;return t.each(function(){var i=st(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Qe(i,o).value[e]}}function Xs(t,e){var n;return(typeof e=="number"?rt:e instanceof Bt?co:(n=Bt(e))?(e=n,co):Ps)(t,e)}function fh(t){return function(){this.removeAttribute(t)}}function hh(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ph(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function gh(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function mh(t,e,n){var o,i,r;return function(){var a,l=n(this),d;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),d=l+"",a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l)))}}function vh(t,e,n){var o,i,r;return function(){var a,l=n(this),d;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),d=l+"",a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l)))}}function yh(t,e){var n=no(t),o=n==="transform"?Zf:Xs;return this.attrTween(t,typeof e=="function"?(n.local?vh:mh)(n,o,Ri(this,"attr."+t,e)):e==null?(n.local?hh:fh)(n):(n.local?gh:ph)(n,o,e))}function _h(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function wh(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function bh(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&wh(t,r)),n}return i._value=e,i}function Ch(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&_h(t,r)),n}return i._value=e,i}function Eh(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=no(t);return this.tween(n,(o.local?bh:Ch)(o,e))}function xh(t,e){return function(){$i(this,t).delay=+e.apply(this,arguments)}}function Sh(t,e){return e=+e,function(){$i(this,t).delay=e}}function kh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xh:Sh)(e,t)):Qe(this.node(),e).delay}function Nh(t,e){return function(){st(this,t).duration=+e.apply(this,arguments)}}function Dh(t,e){return e=+e,function(){st(this,t).duration=e}}function Th(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Nh:Dh)(e,t)):Qe(this.node(),e).duration}function Ih(t,e){if(typeof e!="function")throw new Error;return function(){st(this,t).ease=e}}function Mh(t){var e=this._id;return arguments.length?this.each(Ih(e,t)):Qe(this.node(),e).ease}function Bh(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,t).ease=n}}function zh(t){if(typeof t!="function")throw new Error;return this.each(Bh(this._id,t))}function Ah(t){typeof t!="function"&&(t=fs(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],d,c=0;c<a;++c)(d=r[c])&&t.call(d,d.__data__,c,r)&&l.push(d);return new ft(o,this._parents,this._name,this._id)}function Ph(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),a=new Array(o),l=0;l<r;++l)for(var d=e[l],c=n[l],u=d.length,f=a[l]=new Array(u),h,p=0;p<u;++p)(h=d[p]||c[p])&&(f[p]=h);for(;l<o;++l)a[l]=e[l];return new ft(a,this._parents,this._name,this._id)}function Oh(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function $h(t,e,n){var o,i,r=Oh(e)?$i:st;return function(){var a=r(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}function Rh(t,e){var n=this._id;return arguments.length<2?Qe(this.node(),n).on.on(t):this.each($h(n,t,e))}function Hh(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Vh(){return this.on("end.remove",Hh(this._id))}function Lh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ci(t));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var l=o[a],d=l.length,c=r[a]=new Array(d),u,f,h=0;h<d;++h)(u=l[h])&&(f=t.call(u,u.__data__,h,l))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f,_o(c[h],e,n,h,c,Qe(u,n)));return new ft(r,this._parents,e,n)}function Fh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=us(t));for(var o=this._groups,i=o.length,r=[],a=[],l=0;l<i;++l)for(var d=o[l],c=d.length,u,f=0;f<c;++f)if(u=d[f]){for(var h=t.call(u,u.__data__,f,d),p,g=Qe(u,n),m=0,w=h.length;m<w;++m)(p=h[m])&&_o(p,e,n,m,h,g);r.push(h),a.push(u)}return new ft(r,a,e,n)}var Gh=yn.prototype.constructor;function jh(){return new Gh(this._groups,this._parents)}function Wh(t,e){var n,o,i;return function(){var r=Yt(this,t),a=(this.style.removeProperty(t),Yt(this,t));return r===a?null:r===n&&a===o?i:i=e(n=r,o=a)}}function qs(t){return function(){this.style.removeProperty(t)}}function Yh(t,e,n){var o,i=n+"",r;return function(){var a=Yt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}function Uh(t,e,n){var o,i,r;return function(){var a=Yt(this,t),l=n(this),d=l+"";return l==null&&(d=l=(this.style.removeProperty(t),Yt(this,t))),a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l))}}function Xh(t,e){var n,o,i,r="style."+e,a="end."+r,l;return function(){var d=st(this,t),c=d.on,u=d.value[r]==null?l||(l=qs(e)):void 0;(c!==n||i!==u)&&(o=(n=c).copy()).on(a,i=u),d.on=o}}function qh(t,e,n){var o=(t+="")=="transform"?Kf:Xs;return e==null?this.styleTween(t,Wh(t,o)).on("end.style."+t,qs(t)):typeof e=="function"?this.styleTween(t,Uh(t,o,Ri(this,"style."+t,e))).each(Xh(this._id,t)):this.styleTween(t,Yh(t,o,e),n).on("end.style."+t,null)}function Kh(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function Zh(t,e,n){var o,i;function r(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&Kh(t,a,n)),o}return r._value=e,r}function Jh(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,Zh(t,e,n??""))}function Qh(t){return function(){this.textContent=t}}function ep(t){return function(){var e=t(this);this.textContent=e??""}}function tp(t){return this.tween("text",typeof t=="function"?ep(Ri(this,"text",t)):Qh(t==null?"":t+""))}function np(t){return function(e){this.textContent=t.call(this,e)}}function op(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&np(i)),e}return o._value=t,o}function ip(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,op(t))}function rp(){for(var t=this._name,e=this._id,n=Ks(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,d,c=0;c<l;++c)if(d=a[c]){var u=Qe(d,e);_o(d,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ft(o,this._parents,t,n)}function sp(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var l={value:a},d={value:function(){--i===0&&r()}};n.each(function(){var c=st(this,o),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(d)),c.on=e}),i===0&&r()})}var ap=0;function ft(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Ks(){return++ap}var ht=yn.prototype;ft.prototype={constructor:ft,select:Lh,selectAll:Fh,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:Ah,merge:Ph,selection:jh,transition:rp,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:Rh,attr:yh,attrTween:Eh,style:qh,styleTween:Jh,text:tp,textTween:ip,remove:Vh,tween:uh,delay:kh,duration:Th,ease:Mh,easeVarying:zh,end:sp,[Symbol.iterator]:ht[Symbol.iterator]};function lp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var cp={time:null,delay:0,duration:250,ease:lp};function dp(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function up(t){var e,n;t instanceof ft?(e=t._id,t=t._name):(e=Ks(),(n=cp).time=zi(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,d,c=0;c<l;++c)(d=a[c])&&_o(d,t,e,c,a,n||dp(d,e));return new ft(o,this._parents,t,e)}yn.prototype.interrupt=lh,yn.prototype.transition=up;var bo=t=>()=>t;function fp(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function pt(t,e,n){this.k=t,this.x=e,this.y=n}pt.prototype={constructor:pt,scale:function(t){return t===1?this:new pt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new pt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kt=new pt(1,0,0);pt.prototype;function Hi(t){t.stopImmediatePropagation()}function Dn(t){t.preventDefault(),t.stopImmediatePropagation()}function hp(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function pp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Zs(){return this.__zoom||Kt}function gp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function mp(){return navigator.maxTouchPoints||"ontouchstart"in this}function vp(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function yp(){var t=hp,e=pp,n=vp,o=gp,i=mp,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,d=fo,c=eo("start","zoom","end"),u,f,h,p=500,g=150,m=0,w=10;function I(b){b.property("__zoom",Zs).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(b,B,_,x){var T=b.selection?b.selection():b;T.property("__zoom",Zs),b!==T?$(b,B,_,x):T.interrupt().each(function(){z(this,arguments).event(x).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},I.scaleBy=function(b,B,_,x){I.scaleTo(b,function(){return this.__zoom.k*(typeof B=="function"?B.apply(this,arguments):B)},_,x)},I.scaleTo=function(b,B,_,x){I.transform(b,function(){var T=e.apply(this,arguments),P=this.__zoom,L=_==null?C(T):typeof _=="function"?_.apply(this,arguments):_,M=P.invert(L),V=typeof B=="function"?B.apply(this,arguments):B;return n(v(y(P,V),L,M),T,a)},_,x)},I.translateBy=function(b,B,_,x){I.transform(b,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof _=="function"?_.apply(this,arguments):_),e.apply(this,arguments),a)},null,x)},I.translateTo=function(b,B,_,x,T){I.transform(b,function(){var P=e.apply(this,arguments),L=this.__zoom,M=x==null?C(P):typeof x=="function"?x.apply(this,arguments):x;return n(Kt.translate(M[0],M[1]).scale(L.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof _=="function"?-_.apply(this,arguments):-_),P,a)},x,T)};function y(b,B){return B=Math.max(r[0],Math.min(r[1],B)),B===b.k?b:new pt(B,b.x,b.y)}function v(b,B,_){var x=B[0]-_[0]*b.k,T=B[1]-_[1]*b.k;return x===b.x&&T===b.y?b:new pt(b.k,x,T)}function C(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function $(b,B,_,x){b.on("start.zoom",function(){z(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(x).end()}).tween("zoom",function(){var T=this,P=arguments,L=z(T,P).event(x),M=e.apply(T,P),V=_==null?C(M):typeof _=="function"?_.apply(T,P):_,F=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),G=T.__zoom,X=typeof B=="function"?B.apply(T,P):B,J=d(G.invert(V).concat(F/G.k),X.invert(V).concat(F/X.k));return function(U){if(U===1)U=X;else{var Z=J(U),te=F/Z[2];U=new pt(te,V[0]-Z[0]*te,V[1]-Z[1]*te)}L.zoom(null,U)}})}function z(b,B,_){return!_&&b.__zooming||new W(b,B)}function W(b,B){this.that=b,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(b,B),this.taps=0}W.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,B){return this.mouse&&b!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var B=Ze(this.that).datum();c.call(b,this.that,new fp(b,{sourceEvent:this.sourceEvent,target:I,type:b,transform:this.that.__zoom,dispatch:c}),B)}};function j(b,...B){if(!t.apply(this,arguments))return;var _=z(this,B).event(b),x=this.__zoom,T=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,o.apply(this,arguments)))),P=ot(b);if(_.wheel)(_.mouse[0][0]!==P[0]||_.mouse[0][1]!==P[1])&&(_.mouse[1]=x.invert(_.mouse[0]=P)),clearTimeout(_.wheel);else{if(x.k===T)return;_.mouse=[P,x.invert(P)],wo(this),_.start()}Dn(b),_.wheel=setTimeout(L,g),_.zoom("mouse",n(v(y(x,T),_.mouse[0],_.mouse[1]),_.extent,a));function L(){_.wheel=null,_.end()}}function D(b,...B){if(h||!t.apply(this,arguments))return;var _=b.currentTarget,x=z(this,B,!0).event(b),T=Ze(b.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",F,!0),P=ot(b,_),L=b.clientX,M=b.clientY;Cs(b.view),Hi(b),x.mouse=[P,this.__zoom.invert(P)],wo(this),x.start();function V(G){if(Dn(G),!x.moved){var X=G.clientX-L,J=G.clientY-M;x.moved=X*X+J*J>m}x.event(G).zoom("mouse",n(v(x.that.__zoom,x.mouse[0]=ot(G,_),x.mouse[1]),x.extent,a))}function F(G){T.on("mousemove.zoom mouseup.zoom",null),Es(G.view,x.moved),Dn(G),x.event(G).end()}}function O(b,...B){if(t.apply(this,arguments)){var _=this.__zoom,x=ot(b.changedTouches?b.changedTouches[0]:b,this),T=_.invert(x),P=_.k*(b.shiftKey?.5:2),L=n(v(y(_,P),x,T),e.apply(this,B),a);Dn(b),l>0?Ze(this).transition().duration(l).call($,L,x,b):Ze(this).call(I.transform,L,x,b)}}function H(b,...B){if(t.apply(this,arguments)){var _=b.touches,x=_.length,T=z(this,B,b.changedTouches.length===x).event(b),P,L,M,V;for(Hi(b),L=0;L<x;++L)M=_[L],V=ot(M,this),V=[V,this.__zoom.invert(V),M.identifier],T.touch0?!T.touch1&&T.touch0[2]!==V[2]&&(T.touch1=V,T.taps=0):(T.touch0=V,P=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),P&&(T.taps<2&&(f=V[0],u=setTimeout(function(){u=null},p)),wo(this),T.start())}}function S(b,...B){if(this.__zooming){var _=z(this,B).event(b),x=b.changedTouches,T=x.length,P,L,M,V;for(Dn(b),P=0;P<T;++P)L=x[P],M=ot(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=M:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=M);if(L=_.that.__zoom,_.touch1){var F=_.touch0[0],G=_.touch0[1],X=_.touch1[0],J=_.touch1[1],U=(U=X[0]-F[0])*U+(U=X[1]-F[1])*U,Z=(Z=J[0]-G[0])*Z+(Z=J[1]-G[1])*Z;L=y(L,Math.sqrt(U/Z)),M=[(F[0]+X[0])/2,(F[1]+X[1])/2],V=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(_.touch0)M=_.touch0[0],V=_.touch0[1];else return;_.zoom("touch",n(v(L,M,V),_.extent,a))}}function Y(b,...B){if(this.__zooming){var _=z(this,B).event(b),x=b.changedTouches,T=x.length,P,L;for(Hi(b),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),P=0;P<T;++P)L=x[P],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=ot(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<w)){var M=Ze(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return I.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:bo(+b),I):o},I.filter=function(b){return arguments.length?(t=typeof b=="function"?b:bo(!!b),I):t},I.touchable=function(b){return arguments.length?(i=typeof b=="function"?b:bo(!!b),I):i},I.extent=function(b){return arguments.length?(e=typeof b=="function"?b:bo([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),I):e},I.scaleExtent=function(b){return arguments.length?(r[0]=+b[0],r[1]=+b[1],I):[r[0],r[1]]},I.translateExtent=function(b){return arguments.length?(a[0][0]=+b[0][0],a[1][0]=+b[1][0],a[0][1]=+b[0][1],a[1][1]=+b[1][1],I):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},I.constrain=function(b){return arguments.length?(n=b,I):n},I.duration=function(b){return arguments.length?(l=+b,I):l},I.interpolate=function(b){return arguments.length?(d=b,I):d},I.on=function(){var b=c.on.apply(c,arguments);return b===c?I:b},I.clickDistance=function(b){return arguments.length?(m=(b=+b)*b,I):Math.sqrt(m)},I.tapDistance=function(b){return arguments.length?(w=+b,I):w},I}var ce=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(ce||{}),Vi=(t=>(t.Partial="partial",t.Full="full",t))(Vi||{}),Ot=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))(Ot||{}),gt=(t=>(t.Strict="strict",t.Loose="loose",t))(gt||{}),mt=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(mt||{}),Tn=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(Tn||{}),Js=(t=>(t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right",t))(Js||{}),_p=["INPUT","SELECT","TEXTAREA"],wp=typeof document<"u"?document:null;function Li(t){var e,n;const o=((n=(e=t.composedPath)==null?void 0:e.call(t))==null?void 0:n[0])||t.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,r=typeof o?.closest=="function"?o.closest(".nokey"):null;return _p.includes(o?.nodeName)||i||!!r}function bp(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function Qs(t,e,n,o){const i=e.replace("+",`
|
|
1
|
+
(function(Ee,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(Ee=typeof globalThis<"u"?globalThis:Ee||self,s(Ee.DuiUI={},Ee.Vue))})(this,(function(Ee,s){"use strict";const Dt=(t,e)=>(t.install=n=>{n.component(t.name,t),e&&e.forEach(o=>{n.component(o.name,o)})},t),Vt=(t="")=>{const e=Date.now(),n=Math.floor(Math.random()*1e9);return t===""?String(n)+String(e):t+"_"+n+String(e)},gi=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(gi);const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=gi(t[n]));return e},Sc=t=>{if(Array.isArray(t))t.length=0;else if(t&&typeof t=="object")for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&delete t[e]},mi={},Nc=(t,e,n)=>{n[t]=n[t]||{};const o=Vt();return n[t][o]=e,o},kc=(t,e,n)=>{const o=[],i=n[t]||{};return Object.keys(i).forEach(r=>{const a=i[r];try{a&&o.push(a(e))}catch(l){console.error(l)}}),o},Dc=(t,e,n)=>{if(e){const o=n[t];o&&delete o[e]}else delete n[t]},Vr=(t,e)=>Nc(t,e,mi),Se=(t,e)=>kc(t,e,mi),Tc=(t,e)=>{Dc(t,e,mi)},Lr=(t,e,n,o,i,r)=>{const a=e.id,l=e.level,{getDesignLocals:u,selectComponent:c,getComponent:d,isMyChildComponent:f,addComponent:h,deleteComponent:p,getParentComponents:y,removeComponentFromContainer:m,addComponentToContainer:b,copyComponent:T,activedComponent:x,top:g}=s.inject("d-drag-design-provide",{}),C=[],A=s.ref(!1),z=s.ref(!1),j=s.ref(!1),Y=s.ref(!1),W=s.ref(!1),D={id:"",type:""},B=s.ref(!1),k=s.ref(!1);let V="",_=null;const M=U=>{if(V===U)return _;V=U;const{top:J,left:te,width:Q,height:le}=t.value.getBoundingClientRect();return _=[{x:te,y:J},{x:te+Q,y:J},{x:te+Q,y:J+le},{x:te,y:J+le}],_},v=(U,J,te)=>{let Q=J-te[0].y;Q<0&&(Q=-Q);let le=J-te[3].y;le<0&&(le=-le);let ee=U-te[0].x;ee<0&&(ee=-ee);let K=U-te[1].x;return K<0&&(K=-K),{ly:Q>le?le:Q,typey:Q>le?"bottom":"top",lx:ee>K?K:ee,lallx:ee+K}},S=(U,J,te)=>U>=te[0].x&&U<=te[1].x&&J>=te[0].y&&J<=te[3].y,I=()=>{if(i){Se("dragClick",{id:a});return}if(!z.value){if(c(a),l!==0){const U=t.value.getBoundingClientRect(),J=u();U.top-J.top<22?Y.value=!0:Y.value=!1}z.value=!0,Se("dragClick",{id:a})}},P=U=>{const J=p(U);J&&s.nextTick(()=>{Se("dragClick",{id:J})})},H=()=>{D.id="",D.type="",l===0&&(W.value=!1)},$=()=>{Se("mouseEnterOrLeave",{id:a,type:"enter"})},O=()=>{Se("mouseEnterOrLeave",{id:a,type:"leave"})},F=U=>{Se("dragClick",{id:U})},G={mouseEnterOrLeave:({id:U,type:J})=>{J==="enter"?C.push(U):C.length>0&&C.splice(C.length-1,1);const te=C.length;te>0&&a===C[te-1]?A.value=!0:A.value=!1},dragAciveChild:({type:U,id:J})=>{J===a?U==="top"?(B.value=!0,k.value=!1):(k.value=!0,B.value=!1):(k.value=!1,B.value=!1)},dragClick({id:U,isAgain:J}){console.log("dragClick",U,a),U!==a?z.value=!1:(J&&(z.value=!1),I())}};G[`dragGetChildDistance_${a}`]=({dragX:U,dragY:J,moveId:te})=>{const Q=M(te);return v(U,J,Q)};const X={isInContainer({x:U,y:J,id:te,moveId:Q}){if(a===te||f(te,a))return j.value=!1,{isIn:!1,level:l,id:a,groupId:r};const le=M(Q);if(S(U,J,le))return l===0&&(W.value=!0),{isIn:!0,level:l,id:a,groupId:r};if(l===0){const{ly:ee,lx:K}=v(U,J,le);if(ee<20&&K<20)return W.value=!0,{isIn:!0,level:l,id:a,groupId:r};W.value=!1}return j.value=!1,{isIn:!1,level:l,id:a,groupId:r}},dragActiveContainer:({containerId:U,containerGroupId:J,dragX:te,dragY:Q,moveId:le})=>{if(U===a&&J===r)if(j.value=!0,o&&o.value.length>0){let ee={ly:9999999,lx:0,lallx:0,id:"",typey:""};o?.value.forEach(K=>{if(r&&K.groupId!==r)return;const E=Se(`dragGetChildDistance_${K.id}`,{dragX:te,dragY:Q,moveId:le})[0];E&&(ee.ly>E.ly||ee.ly===E.ly&&(ee.lx>E.lx||ee.lx===E.lx&&ee.lallx>E.lallx))&&(ee=E,ee.id=K.id)}),D.id=ee.id,D.type=ee.typey,Se("dragAciveChild",{id:ee.id,type:ee.typey})}else Se("dragAciveChild",{id:""});else j.value=!1},dragAdd:U=>{if(j.value){let J=o?.value.length||0;D.id!==""&&D.id!==void 0&&(J=o?.value.findIndex(te=>te.id===D.id)||0,D.type==="bottom"&&(J+=1)),h(U,a,J,r),j.value=!1}H()},dragAddByClick:U=>{if(!x.value&&a===g.id||x.value?.id===a||x.value?.containerId===a&&x.value?.dragType!=="container"){const J=o?.value.length||0,te=h(U,a,J,r,!0);te&&U.config&&Object.keys(U.config).forEach(Q=>{te.config[Q]=U.config[Q]})}},dragUpdate(U){if(j.value){const J=d(U);if(J.level=l+1,D.id!==J.id){m(J.containerId,U);let te=o?.value.findIndex(Q=>Q.id===D.id)||0;D.type==="bottom"&&(te+=1),b(J,a,te,r)}j.value=!1,s.nextTick(()=>{Se("dragClick",{id:J.id,isAgain:!0})})}H()}},Z={};return s.onMounted(()=>{(!i||n!=="container")&&Object.keys(G).forEach(U=>{Z[U]=Vr(U,G[U])}),n==="container"&&Object.keys(X).forEach(U=>{Z[U]=Vr(U,X[U])}),e.isNewAdd&&s.nextTick(()=>{I(),delete e.isNewAdd})}),s.onUnmounted(()=>{Object.keys(Z).forEach(U=>{Tc(U,Z[U])})}),{onMouseenter:$,onMouseleave:O,activeComponent:I,handleComponentClick:F,deleteComponentByClick:P,copyComponent:T,getParentComponents:y,isBottomToolBar:Y,isHover:A,isSelect:z,isToContainer:j,isMoveingInTopLevel:W,isTopActive:B,isBottomActive:k}},Fr=(t,e)=>{const n={x:0,y:0,clientX:0,clientY:0,dragElement:null,dragElementId:"jcode-darg-move-id",toContainerLevel:-1,toContainerId:"",groupId:"",id:""};let o=!1;const i=(p,y)=>{o!==!0&&(o=!0,setTimeout(()=>{p(),o=!1},y))},r=s.ref(!1),a=(p,y,m)=>{const b=document.createElement("div");return b.id=n.dragElementId,b.innerText=p,b.className="d-drag-move",b.style.top=`${y}px`,b.style.left=`${m}px`,document.body.appendChild(b),b},l=()=>{document.onmousemove=null,document.onmouseup=null,r.value=!1,Se("dragAciveChild",{id:""})},u=()=>{l(),n.dragElement&&(n.dragElement.remove(),n.dragElement=null,e?Se("dragAdd",t):Se("dragUpdate",t.id))},c=p=>{const{clientY:y,clientX:m}=p;if(!n.dragElement){const b=Math.abs(n.x-m),T=Math.abs(n.y-y);if(b<=1&&T<=1)return;r.value=!0,n.dragElement=a(t.name,y-11,m-32)}n.dragElement.style.top=`${y-11}px`,n.dragElement.style.left=`${m-32}px`,n.clientX=m,n.clientY=y,i(()=>{if(!r.value)return;const b=Se("isInContainer",{x:m,y,id:t.id,moveId:n.id});n.toContainerLevel=-1,n.toContainerId="",n.groupId="",b.forEach(({level:T,id:x,isIn:g,groupId:C})=>{g&&n.toContainerLevel<T&&(n.toContainerLevel=T,n.toContainerId=x,n.groupId=C)}),n.toContainerId!==""?Se("dragActiveContainer",{containerId:n.toContainerId,containerGroupId:n.groupId,dragX:m,dragY:y,moveId:n.id}):Se("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{l()},onMousedown:p=>{n.x=p.clientX,n.y=p.clientY,n.id=Vt(),document.onmouseup=u,document.onmousemove=c},onClick:()=>{Se("dragAddByClick",t)},moveActive:r}},Ic=t=>(t.install=e=>{e.component(t.name,t)},t),Wn=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),jr=/^[a-z0-9]+(-[a-z0-9]+)*$/,Yn=(t,e,n,o="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;o=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),u=i.pop(),c={provider:i.length>0?i[0]:o,prefix:u,name:l};return e&&!Un(c)?null:c}const r=i[0],a=r.split("-");if(a.length>1){const l={provider:o,prefix:a.shift(),name:a.join("-")};return e&&!Un(l)?null:l}if(n&&o===""){const l={provider:o,prefix:"",name:r};return e&&!Un(l,n)?null:l}return null},Un=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,Gr=Object.freeze({left:0,top:0,width:16,height:16}),Xn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),an=Object.freeze({...Gr,...Xn}),yi=Object.freeze({...an,body:"",hidden:!1});function Mc(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const o=((t.rotate||0)+(e.rotate||0))%4;return o&&(n.rotate=o),n}function Wr(t,e){const n=Mc(t,e);for(const o in yi)o in Xn?o in t&&!(o in n)&&(n[o]=Xn[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function Bc(t,e){const n=t.icons,o=t.aliases||Object.create(null),i=Object.create(null);function r(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const l=o[a]&&o[a].parent,u=l&&r(l);u&&(i[a]=[l].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(o)).forEach(r),i}function $c(t,e,n){const o=t.icons,i=t.aliases||Object.create(null);let r={};function a(l){r=Wr(o[l]||i[l],r)}return a(e),n.forEach(a),Wr(t,r)}function Yr(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(i=>{e(i,null),n.push(i)});const o=Bc(t);for(const i in o){const r=o[i];r&&(e(i,$c(t,i,r)),n.push(i))}return n}const zc={provider:"",aliases:{},not_found:{},...Gr};function vi(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Ur(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!vi(t,zc))return null;const n=e.icons;for(const i in n){const r=n[i];if(!i||typeof r.body!="string"||!vi(r,yi))return null}const o=e.aliases||Object.create(null);for(const i in o){const r=o[i],a=r.parent;if(!i||typeof a!="string"||!n[a]&&!o[a]||!vi(r,yi))return null}return e}const Xr=Object.create(null);function Ac(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Lt(t,e){const n=Xr[t]||(Xr[t]=Object.create(null));return n[e]||(n[e]=Ac(t,e))}function qr(t,e){return Ur(e)?Yr(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}function Pc(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let ln=!1;function Kr(t){return typeof t=="boolean"&&(ln=t),ln}function Zr(t){const e=typeof t=="string"?Yn(t,!0,ln):t;if(e){const n=Lt(e.provider,e.prefix),o=e.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function Oc(t,e){const n=Yn(t,!0,ln);if(!n)return!1;const o=Lt(n.provider,n.prefix);return e?Pc(o,n.name,e):(o.missing.add(n.name),!0)}function Rc(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),ln&&!e&&!t.prefix){let i=!1;return Ur(t)&&(t.prefix="",Yr(t,(r,a)=>{Oc(r,a)&&(i=!0)})),i}const n=t.prefix;if(!Un({prefix:n,name:"a"}))return!1;const o=Lt(e,n);return!!qr(o,t)}function Jr(t){const e=Zr(t);return e&&{...an,...e}}const Qr=Object.freeze({width:null,height:null}),es=Object.freeze({...Qr,...Xn}),Hc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Vc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ts(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(Hc);if(o===null||!o.length)return t;const i=[];let r=o.shift(),a=Vc.test(r);for(;;){if(a){const l=parseFloat(r);isNaN(l)?i.push(r):i.push(Math.ceil(l*e*n)/n)}else i.push(r);if(r=o.shift(),r===void 0)return i.join("");a=!a}}function Lc(t,e="defs"){let n="";const o=t.indexOf("<"+e);for(;o>=0;){const i=t.indexOf(">",o),r=t.indexOf("</"+e);if(i===-1||r===-1)break;const a=t.indexOf(">",r);if(a===-1)break;n+=t.slice(i+1,r).trim(),t=t.slice(0,o).trim()+t.slice(a+1)}return{defs:n,content:t}}function Fc(t,e){return t?"<defs>"+t+"</defs>"+e:e}function jc(t,e,n){const o=Lc(t);return Fc(o.defs,e+o.content+n)}const Gc=t=>t==="unset"||t==="undefined"||t==="none";function Wc(t,e){const n={...an,...t},o={...es,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,o].forEach(m=>{const b=[],T=m.hFlip,x=m.vFlip;let g=m.rotate;T?x?g+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):x&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let C;switch(g<0&&(g-=Math.floor(g/4)*4),g=g%4,g){case 1:C=i.height/2+i.top,b.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,b.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}g%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),b.length&&(r=jc(r,'<g transform="'+b.join(" ")+'">',"</g>"))});const a=o.width,l=o.height,u=i.width,c=i.height;let d,f;a===null?(f=l===null?"1em":l==="auto"?c:l,d=ts(f,u/c)):(d=a==="auto"?u:a,f=l===null?ts(d,c/u):l==="auto"?c:l);const h={},p=(m,b)=>{Gc(b)||(h[m]=b.toString())};p("width",d),p("height",f);const y=[i.left,i.top,u,c];return h.viewBox=y.join(" "),{attributes:h,viewBox:y,body:r}}const Yc=/\sid="(\S+)"/g,Uc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Xc=0;function qc(t,e=Uc){const n=[];let o;for(;o=Yc.exec(t);)n.push(o[1]);if(!n.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(r=>{const a=typeof e=="function"?e(r):e+(Xc++).toString(),l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const bi=Object.create(null);function Kc(t,e){bi[t]=e}function _i(t){return bi[t]||bi[""]}function wi(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const xi=Object.create(null),cn=["https://api.simplesvg.com","https://api.unisvg.com"],qn=[];for(;cn.length>0;)cn.length===1||Math.random()>.5?qn.push(cn.shift()):qn.push(cn.pop());xi[""]=wi({resources:["https://api.iconify.design"].concat(qn)});function Zc(t,e){const n=wi(e);return n===null?!1:(xi[t]=n,!0)}function Ci(t){return xi[t]}let ns=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();function Jc(t,e){const n=Ci(t);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const r=e+".json?icons=";o=n.maxURL-i-n.path.length-r.length}return o}function Qc(t){return t===404}const ed=(t,e,n)=>{const o=[],i=Jc(t,e),r="icons";let a={type:r,provider:t,prefix:e,icons:[]},l=0;return n.forEach((u,c)=>{l+=u.length+1,l>=i&&c>0&&(o.push(a),a={type:r,provider:t,prefix:e,icons:[]},l=u.length),a.icons.push(u)}),o.push(a),o};function td(t){if(typeof t=="string"){const e=Ci(t);if(e)return e.path}return"/"}const nd={prepare:ed,send:(t,e,n)=>{if(!ns){n("abort",424);return}let o=td(e.provider);switch(e.type){case"icons":{const r=e.prefix,l=e.icons.join(","),u=new URLSearchParams({icons:l});o+=r+".json?"+u.toString();break}case"custom":{const r=e.uri;o+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let i=503;ns(t+o).then(r=>{const a=r.status;if(a!==200){setTimeout(()=>{n(Qc(a)?"abort":"next",a)});return}return i=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",i)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",i)})}};function od(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((i,r)=>i.provider!==r.provider?i.provider.localeCompare(r.provider):i.prefix!==r.prefix?i.prefix.localeCompare(r.prefix):i.name.localeCompare(r.name));let o={provider:"",prefix:"",name:""};return t.forEach(i=>{if(o.name===i.name&&o.prefix===i.prefix&&o.provider===i.provider)return;o=i;const r=i.provider,a=i.prefix,l=i.name,u=n[r]||(n[r]=Object.create(null)),c=u[a]||(u[a]=Lt(r,a));let d;l in c.icons?d=e.loaded:a===""||c.missing.has(l)?d=e.missing:d=e.pending;const f={provider:r,prefix:a,name:l};d.push(f)}),e}function os(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(i=>i.id!==e))})}function id(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const o=t.provider,i=t.prefix;e.forEach(r=>{const a=r.icons,l=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const c=u.name;if(t.icons[c])a.loaded.push({provider:o,prefix:i,name:c});else if(t.missing.has(c))a.missing.push({provider:o,prefix:i,name:c});else return n=!0,!0;return!1}),a.pending.length!==l&&(n||os([t],r.id),r.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),r.abort))})}))}let rd=0;function sd(t,e,n){const o=rd++,i=os.bind(null,n,o);if(!e.pending.length)return i;const r={id:o,icons:e,callback:t,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(r)}),i}function ad(t,e=!0,n=!1){const o=[];return t.forEach(i=>{const r=typeof i=="string"?Yn(i,e,n):i;r&&o.push(r)}),o}var ld={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function cd(t,e,n,o){const i=t.resources.length,r=t.random?Math.floor(Math.random()*i):t.index;let a;if(t.random){let z=t.resources.slice(0);for(a=[];z.length>1;){const j=Math.floor(Math.random()*z.length);a.push(z[j]),z=z.slice(0,j).concat(z.slice(j+1))}a=a.concat(z)}else a=t.resources.slice(r).concat(t.resources.slice(0,r));const l=Date.now();let u="pending",c=0,d,f=null,h=[],p=[];typeof o=="function"&&p.push(o);function y(){f&&(clearTimeout(f),f=null)}function m(){u==="pending"&&(u="aborted"),y(),h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function b(z,j){j&&(p=[]),typeof z=="function"&&p.push(z)}function T(){return{startTime:l,payload:e,status:u,queriesSent:c,queriesPending:h.length,subscribe:b,abort:m}}function x(){u="failed",p.forEach(z=>{z(void 0,d)})}function g(){h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function C(z,j,Y){const W=j!=="success";switch(h=h.filter(D=>D!==z),u){case"pending":break;case"failed":if(W||!t.dataAfterTimeout)return;break;default:return}if(j==="abort"){d=Y,x();return}if(W){d=Y,h.length||(a.length?A():x());return}if(y(),g(),!t.random){const D=t.resources.indexOf(z.resource);D!==-1&&D!==t.index&&(t.index=D)}u="completed",p.forEach(D=>{D(Y)})}function A(){if(u!=="pending")return;y();const z=a.shift();if(z===void 0){if(h.length){f=setTimeout(()=>{y(),u==="pending"&&(g(),x())},t.timeout);return}x();return}const j={status:"pending",resource:z,callback:(Y,W)=>{C(j,Y,W)}};h.push(j),c++,f=setTimeout(A,t.rotate),n(z,e,j.callback)}return setTimeout(A),T}function is(t){const e={...ld,...t};let n=[];function o(){n=n.filter(l=>l().status==="pending")}function i(l,u,c){const d=cd(e,l,u,(f,h)=>{o(),c&&c(f,h)});return n.push(d),d}function r(l){return n.find(u=>l(u))||null}return{query:i,find:r,setIndex:l=>{e.index=l},getIndex:()=>e.index,cleanup:o}}function rs(){}const Ei=Object.create(null);function dd(t){if(!Ei[t]){const e=Ci(t);if(!e)return;const n=is(e),o={config:e,redundancy:n};Ei[t]=o}return Ei[t]}function ud(t,e,n){let o,i;if(typeof t=="string"){const r=_i(t);if(!r)return n(void 0,424),rs;i=r.send;const a=dd(t);a&&(o=a.redundancy)}else{const r=wi(t);if(r){o=is(r);const a=t.resources?t.resources[0]:"",l=_i(a);l&&(i=l.send)}}return!o||!i?(n(void 0,424),rs):o.query(e,i,n)().abort}function ss(){}function fd(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,id(t)}))}function hd(t){const e=[],n=[];return t.forEach(o=>{(o.match(jr)?e:n).push(o)}),{valid:e,invalid:n}}function dn(t,e,n){function o(){const i=t.pendingIcons;e.forEach(r=>{i&&i.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!qr(t,n).length){o();return}}catch(i){console.error(i)}o(),fd(t)}function as(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function pd(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:o}=t,i=t.iconsToLoad;if(delete t.iconsToLoad,!i||!i.length)return;const r=t.loadIcon;if(t.loadIcons&&(i.length>1||!r)){as(t.loadIcons(i,o,n),d=>{dn(t,i,d)});return}if(r){i.forEach(d=>{const f=r(d,o,n);as(f,h=>{const p=h?{prefix:o,icons:{[d]:h}}:null;dn(t,[d],p)})});return}const{valid:a,invalid:l}=hd(i);if(l.length&&dn(t,l,null),!a.length)return;const u=o.match(jr)?_i(n):null;if(!u){dn(t,a,null);return}u.prepare(n,o,a).forEach(d=>{ud(n,d,f=>{dn(t,d.icons,f)})})}))}const gd=(t,e)=>{const n=ad(t,!0,Kr()),o=od(n);if(!o.pending.length){let u=!0;return e&&setTimeout(()=>{u&&e(o.loaded,o.missing,o.pending,ss)}),()=>{u=!1}}const i=Object.create(null),r=[];let a,l;return o.pending.forEach(u=>{const{provider:c,prefix:d}=u;if(d===l&&c===a)return;a=c,l=d,r.push(Lt(c,d));const f=i[c]||(i[c]=Object.create(null));f[d]||(f[d]=[])}),o.pending.forEach(u=>{const{provider:c,prefix:d,name:f}=u,h=Lt(c,d),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[c][d].push(f))}),r.forEach(u=>{const c=i[u.provider][u.prefix];c.length&&pd(u,c)}),e?sd(e,o,r):ss};function md(t,e){const n={...t};for(const o in e){const i=e[o],r=typeof i;o in Qr?(i===null||i&&(r==="string"||r==="number"))&&(n[o]=i):r===typeof n[o]&&(n[o]=o==="rotate"?i%4:i)}return n}const yd=/[\s,]+/;function vd(t,e){e.split(yd).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function bd(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(t);return isNaN(i)?0:o(i)}else if(n!==t){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/i,r%1===0?o(r):0)}}return e}function _d(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in e)n+=" "+o+'="'+e[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function wd(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function xd(t){return"data:image/svg+xml,"+wd(t)}function Cd(t){return'url("'+xd(t)+'")'}const ls={...es,inline:!1},Ed={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sd={display:"inline-block"},Si={backgroundColor:"currentColor"},cs={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},us={webkitMask:Si,mask:Si,background:cs};for(const t in us){const e=us[t];for(const n in ds)e[t+n]=ds[n]}const Kn={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Kn[t+"-flip"]=e,Kn[t.slice(0,1)+"-flip"]=e,Kn[t+"Flip"]=e});function fs(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const hs=(t,e)=>{const n=md(ls,e),o={...Ed},i=e.mode||"svg",r={},a=e.style,l=typeof a=="object"&&!(a instanceof Array)?a:{};for(let m in e){const b=e[m];if(b!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[m]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&vd(n,b);break;case"color":r.color=b;break;case"rotate":typeof b=="string"?n[m]=bd(b):typeof b=="number"&&(n[m]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete o["aria-hidden"];break;default:{const T=Kn[m];T?(b===!0||b==="true"||b===1)&&(n[T]=!0):ls[m]===void 0&&(o[m]=b)}}}const u=Wc(t,n),c=u.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),i==="svg"){o.style={...r,...l},Object.assign(o,c);let m=0,b=e.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),o.innerHTML=qc(u.body,b?()=>b+"ID"+m++:"iconifyVue"),s.h("svg",o)}const{body:d,width:f,height:h}=t,p=i==="mask"||(i==="bg"?!1:d.indexOf("currentColor")!==-1),y=_d(d,{...c,width:f+"",height:h+""});return o.style={...r,"--svg":Cd(y),width:fs(c.width),height:fs(c.height),...Sd,...p?Si:cs,...l},s.h("span",o)};if(Kr(!0),Kc("",nd),typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Rc(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const i=e[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Zc(n,i)||console.error(o)}catch{console.error(o)}}}}const Nd={...an,body:""},ps=s.defineComponent((t,{emit:e})=>{const n=s.ref(null);function o(){n.value&&(n.value.abort?.(),n.value=null)}const i=s.ref(!!t.ssr),r=s.ref(""),a=s.shallowRef(null);function l(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let d;if(typeof c!="string"||(d=Yn(c,!1,!0))===null)return null;let f=Zr(d);if(!f){const y=n.value;return(!y||y.name!==c)&&(f===null?n.value={name:c}:n.value={name:c,abort:gd([d],u)}),null}o(),r.value!==c&&(r.value=c,s.nextTick(()=>{e("load",c)}));const h=t.customise;if(h){f=Object.assign({},f);const y=h(f.body,d.name,d.prefix,d.provider);typeof y=="string"&&(f.body=y)}const p=["iconify"];return d.prefix!==""&&p.push("iconify--"+d.prefix),d.provider!==""&&p.push("iconify--"+d.provider),{data:f,classes:p}}function u(){const c=l();c?c.data!==a.value?.data&&(a.value=c):a.value=null}return i.value?u():s.onMounted(()=>{i.value=!0,u()}),s.watch(()=>t.icon,u),s.onUnmounted(o),()=>{const c=a.value;if(!c)return hs(Nd,t);let d=t;return c.classes&&(d={...t,class:c.classes.join(" ")}),hs({...an,...c.data},d)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),un=s.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const e=t,n=s.computed(()=>{const i=e.icon;if(i.indexOf(":")===-1)return Jr(`jcode:${e.icon}`)==null,`jcode:${e.icon}`;const a=`jcode:${i.split(":")[1]}`;return Jr(a)!=null?a:i}),o=s.computed(()=>({size:e.size,color:e.color,icon:n.value}));return(i,r)=>t.isDiv?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0},i.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[s.createVNode(s.unref(ps),s.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16)):(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:1},i.$attrs,{class:"jicon"}),[s.createVNode(s.unref(ps),s.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),kd=["disabled"],Dd={key:2},Ft=Ic(s.defineComponent({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=h=>{!d.value&&!o.disabled&&(i("click",h),o.href&&window.open(o.href,o.target?o.target:"_self"))},a=s.shallowRef(null),l=()=>{a.value?.focus()},u=()=>{a.value?.blur()},c=s.computed(()=>o.notLabel||!o.label),d=s.ref(!1);s.watch(()=>o.loading,h=>{if(typeof h=="boolean")d.value=h;else if(Wn(h?.delay))d.value=!1;else{const p=setTimeout(()=>{d.value=!0},h.delay);return()=>clearTimeout(p)}},{immediate:!0});const f=s.computed(()=>o.label||"");return e({focus:l,blur:u}),(h,p)=>(s.openBlock(),s.createElementBlock("button",{ref_key:"buttonNodeRef",ref:a,type:"button",class:s.normalizeClass(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":d.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:s.withModifiers(r,["stop"])},[d.value?(s.openBlock(),s.createBlock(un,{key:0,icon:"mdi:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):s.createCommentVNode("",!0),t.icon?(s.openBlock(),s.createBlock(un,{key:1,icon:t.icon},null,8,["icon"])):s.createCommentVNode("",!0),t.notLabel?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Dd,s.toDisplayString(f.value),1)),s.renderSlot(h.$slots,"iconAfter")],10,kd))}})),Td={class:"d-drag-btns-pname"},Id={key:0,class:"d-drag-mask"},Ni=s.defineComponent({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(t){const e=t,n=s.ref(),{onMouseenter:o,onMouseleave:i,activeComponent:r,handleComponentClick:a,deleteComponentByClick:l,copyComponent:u,getParentComponents:c,isHover:d,isSelect:f,isTopActive:h,isBottomActive:p,isBottomToolBar:y}=Lr(n,e.componentData,"component"),{onContextmenu:m,onMousedown:b,moveActive:T}=Fr(e.componentData,!1);return(x,g)=>{const C=s.resolveComponent("el-space");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["d-drag-component",{selected:s.unref(f),hovered:s.unref(d),isBottomToolBar:s.unref(y),active:s.unref(T),isTopActive:s.unref(h),isBottomActive:s.unref(p)}])},[g[11]||(g[11]=s.createElementVNode("div",{class:"d-drag-line"},null,-1)),s.createElementVNode("div",{class:"d-drag-btns",onMouseenter:g[4]||(g[4]=(...A)=>s.unref(o)&&s.unref(o)(...A)),onMouseleave:g[5]||(g[5]=(...A)=>s.unref(i)&&s.unref(i)(...A))},[s.createVNode(C,{size:4},{default:s.withCtx(()=>[s.createElementVNode("div",{class:"d-drag-btns-names",onClick:s.withModifiers(()=>{},["stop"])},[s.createVNode(s.unref(Ft),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"]),s.createElementVNode("div",Td,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(c)(t.componentData.containerId),A=>(s.openBlock(),s.createElementBlock("div",{key:A.id},[s.createVNode(s.unref(Ft),{class:"d-drag-btn",type:"primary",size:"small",label:A.name,onClick:z=>s.unref(a)(A.id)},null,8,["label","onClick"])]))),128))])]),s.createVNode(s.unref(Ft),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:g[0]||(g[0]=s.withModifiers(A=>s.unref(u)(t.componentData.id),["stop"]))}),s.createElementVNode("div",{onContextmenu:g[1]||(g[1]=s.withModifiers((...A)=>s.unref(m)&&s.unref(m)(...A),["stop"])),onMousedown:g[2]||(g[2]=s.withModifiers((...A)=>s.unref(b)&&s.unref(b)(...A),["stop"])),style:{display:"flex"}},[s.createVNode(s.unref(Ft),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),s.createVNode(s.unref(Ft),{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:g[3]||(g[3]=s.withModifiers(A=>s.unref(l)(t.componentData.id),["stop"]))})]),_:1})],32),s.createElementVNode("div",{ref_key:"refDrag",ref:n,class:"d-drag-body",onClick:g[6]||(g[6]=s.withModifiers((...A)=>s.unref(r)&&s.unref(r)(...A),["stop"])),onContextmenu:g[7]||(g[7]=s.withModifiers((...A)=>s.unref(m)&&s.unref(m)(...A),["stop"])),onMousedown:g[8]||(g[8]=s.withModifiers((...A)=>s.unref(b)&&s.unref(b)(...A),["stop"])),onMouseenter:g[9]||(g[9]=(...A)=>s.unref(o)&&s.unref(o)(...A)),onMouseleave:g[10]||(g[10]=(...A)=>s.unref(i)&&s.unref(i)(...A))},[s.renderSlot(x.$slots,"default"),t.isContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Id))],544)],2)}}}),ki=s.defineComponent({name:"DDragTool",__name:"tool",props:{config:{}},setup(t){const e=t,{onContextmenu:n,onMousedown:o,onClick:i}=Fr(e.config??{name:"",id:""},!0);return(r,a)=>(s.openBlock(),s.createElementBlock("div",{class:"d-drag-tool",onClick:a[0]||(a[0]=s.withModifiers((...l)=>s.unref(i)&&s.unref(i)(...l),["stop"])),onContextmenu:a[1]||(a[1]=s.withModifiers((...l)=>s.unref(n)&&s.unref(n)(...l),["stop"])),onMousedown:a[2]||(a[2]=s.withModifiers((...l)=>s.unref(o)&&s.unref(o)(...l),["stop"]))},[s.renderSlot(r.$slots,"default")],32))}}),Md={key:0,class:"d-drag-line"},Bd={key:1,class:"d-drag-btns"},Di=s.defineComponent({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(t){const e=t,n=s.ref(),o=s.computed(()=>e.componentData?.children||[]),{onMouseenter:i,onMouseleave:r,activeComponent:a,isHover:l,isSelect:u,isToContainer:c,isMoveingInTopLevel:d,isTopActive:f,isBottomActive:h}=Lr(n,e.componentData,"container",o,e.isComponentContainer,e.groupId),p=s.computed(()=>!!(o.value.findIndex(y=>y.groupId===e.groupId)===-1&&c.value));return(y,m)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"refDrag",ref:n,class:s.normalizeClass(["d-drag-container",{selected:s.unref(u)&&!t.isComponentContainer,hovered:s.unref(l)&&!t.isComponentContainer,isTopLevel:t.componentData.level===0,active:p.value,isMoveingInTopLevel:s.unref(d),isTopActive:s.unref(f),isBottomActive:s.unref(h)}])},[t.isComponentContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Md)),t.isComponentContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Bd,[s.createElementVNode("div",{class:"d-drag-btns-names",onClick:s.withModifiers(()=>{},["stop"])},[s.createVNode(s.unref(Ft),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"])])])),s.createElementVNode("div",{class:"d-drag-body",onClick:m[0]||(m[0]=s.withModifiers((...b)=>s.unref(a)&&s.unref(a)(...b),["stop"])),onMouseenter:m[1]||(m[1]=(...b)=>s.unref(i)&&s.unref(i)(...b)),onMouseleave:m[2]||(m[2]=(...b)=>s.unref(r)&&s.unref(r)(...b))},[s.renderSlot(y.$slots,"default")],32)],2))}}),Ti=s.defineComponent({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=s.inject("dui-design-provide",{});return(n,o)=>{const i=s.resolveComponent("el-col");return s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.componentList,r=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.id},[r.type!="pkey"?(s.openBlock(),s.createBlock(i,{key:0,span:r.config.span||24},{default:s.withCtx(()=>[s.createVNode(Ni,{"is-container":r.dragType!=="component","component-data":r},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):s.createCommentVNode("",!0)],64))),128)}}}),Ii=s.defineComponent({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=s.inject("dui-design-provide",{}),n=o=>{if(o.flexWidth)return{width:o.flexWidth+"%"}};return(o,i)=>(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.componentList,r=>(s.openBlock(),s.createBlock(Ni,{key:r.id,style:s.normalizeStyle(n(r.config)),"is-container":r.dragType!=="component","component-data":r},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),gs=Dt(Ni,[ki,Di,Ti,Ii]);function fn(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function ct(t){return typeof t=="function"?t():s.unref(t)}const $d=typeof window<"u"&&typeof document<"u",zd=t=>typeof t<"u",Ad=Object.prototype.toString,Pd=t=>Ad.call(t)==="[object Object]",Od=()=>{};function Rd(t,e){function n(...o){return new Promise((i,r)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(r)})}return n}const ms=t=>t();function Hd(t=ms){const e=s.ref(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...r)=>{e.value&&t(...r)};return{isActive:s.readonly(e),pause:n,resume:o,eventFilter:i}}function ys(t,e=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(e?()=>i(n):o,t)})}function Vd(t,e,n={}){const{eventFilter:o=ms,...i}=n;return s.watch(t,Rd(o,e),i)}function jt(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:l,isActive:u}=Hd(o);return{stop:Vd(t,e,{...i,eventFilter:r}),pause:a,resume:l,isActive:u}}function Ld(t,e={}){if(!s.isRef(t))return s.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=s.customRef(()=>({get(){return t.value[o]},set(i){var r;if((r=ct(e.replaceRef))!=null?r:!0)if(Array.isArray(t.value)){const l=[...t.value];l[o]=i,t.value=l}else{const l={...t.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(t.value)),t.value=l}else t.value[o]=i}}));return n}function Mi(t,e=!1){function n(f,{flush:h="sync",deep:p=!1,timeout:y,throwOnTimeout:m}={}){let b=null;const x=[new Promise(g=>{b=s.watch(t,C=>{f(C)!==e&&(b?.(),g(C))},{flush:h,deep:p,immediate:!0})})];return y!=null&&x.push(ys(y,m).then(()=>ct(t)).finally(()=>b?.())),Promise.race(x)}function o(f,h){if(!s.isRef(f))return n(C=>C===f,h);const{flush:p="sync",deep:y=!1,timeout:m,throwOnTimeout:b}=h??{};let T=null;const g=[new Promise(C=>{T=s.watch([t,f],([A,z])=>{e!==(A===z)&&(T?.(),C(A))},{flush:p,deep:y,immediate:!0})})];return m!=null&&g.push(ys(m,b).then(()=>ct(t)).finally(()=>(T?.(),ct(t)))),Promise.race(g)}function i(f){return n(h=>!!h,f)}function r(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function u(f,h){return n(p=>{const y=Array.from(p);return y.includes(f)||y.includes(ct(f))},h)}function c(f){return d(1,f)}function d(f=1,h){let p=-1;return n(()=>(p+=1,p>=f),h)}return Array.isArray(ct(t))?{toMatch:n,toContains:u,changed:c,changedTimes:d,get not(){return Mi(t,!e)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:l,toBeUndefined:a,changed:c,changedTimes:d,get not(){return Mi(t,!e)}}}function Bi(t){return Mi(t)}function Fd(t){var e;const n=ct(t);return(e=n?.$el)!=null?e:n}const vs=$d?window:void 0;function bs(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=vs):[e,n,o,i]=t,!e)return Od;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(d=>d()),r.length=0},l=(d,f,h,p)=>(d.addEventListener(f,h,p),()=>d.removeEventListener(f,h,p)),u=s.watch(()=>[Fd(e),ct(i)],([d,f])=>{if(a(),!d)return;const h=Pd(f)?{...f}:f;r.push(...n.flatMap(p=>o.map(y=>l(d,p,y,h))))},{immediate:!0,flush:"post"}),c=()=>{u(),a()};return fn(c),c}function jd(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function _s(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=vs,eventName:r="keydown",passive:a=!1,dedupe:l=!1}=o,u=jd(e);return bs(i,r,d=>{d.repeat&&ct(l)||u(d)&&n(d)},a)}function Gd(t){return JSON.parse(JSON.stringify(t))}function $i(t,e,n,o={}){var i,r,a;const{clone:l=!1,passive:u=!1,eventName:c,deep:d=!1,defaultValue:f,shouldEmit:h}=o,p=s.getCurrentInstance(),y=n||p?.emit||((i=p?.$emit)==null?void 0:i.bind(p))||((a=(r=p?.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p?.proxy));let m=c;e||(e="modelValue"),m=m||`update:${e.toString()}`;const b=g=>l?typeof l=="function"?l(g):Gd(g):g,T=()=>zd(t[e])?b(t[e]):f,x=g=>{h?h(g)&&y(m,g):y(m,g)};if(u){const g=T(),C=s.ref(g);let A=!1;return s.watch(()=>t[e],z=>{A||(A=!0,C.value=b(z),s.nextTick(()=>A=!1))}),s.watch(C,z=>{!A&&(z!==t[e]||d)&&x(z)},{deep:d}),C}else return s.computed({get(){return T()},set(g){x(g)}})}var Wd={value:()=>{}};function Zn(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Jn(n)}function Jn(t){this._=t}function Yd(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Jn.prototype=Zn.prototype={constructor:Jn,on:function(t,e){var n=this._,o=Yd(t+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(t=o[r]).type)&&(i=Ud(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++r<a;)if(i=(t=o[r]).type)n[i]=ws(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ws(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Jn(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)}};function Ud(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}function ws(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=Wd,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var zi="http://www.w3.org/1999/xhtml";const xs={svg:"http://www.w3.org/2000/svg",xhtml:zi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qn(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),xs.hasOwnProperty(e)?{space:xs[e],local:t}:t}function Xd(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===zi&&e.documentElement.namespaceURI===zi?e.createElement(t):e.createElementNS(n,t)}}function qd(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Cs(t){var e=Qn(t);return(e.local?qd:Xd)(e)}function Kd(){}function Ai(t){return t==null?Kd:function(){return this.querySelector(t)}}function Zd(t){typeof t!="function"&&(t=Ai(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=new Array(a),u,c,d=0;d<a;++d)(u=r[d])&&(c=t.call(u,u.__data__,d,r))&&("__data__"in u&&(c.__data__=u.__data__),l[d]=c);return new Fe(o,this._parents)}function Jd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Qd(){return[]}function Es(t){return t==null?Qd:function(){return this.querySelectorAll(t)}}function eu(t){return function(){return Jd(t.apply(this,arguments))}}function tu(t){typeof t=="function"?t=eu(t):t=Es(t);for(var e=this._groups,n=e.length,o=[],i=[],r=0;r<n;++r)for(var a=e[r],l=a.length,u,c=0;c<l;++c)(u=a[c])&&(o.push(t.call(u,u.__data__,c,a)),i.push(u));return new Fe(o,i)}function Ss(t){return function(){return this.matches(t)}}function Ns(t){return function(e){return e.matches(t)}}var nu=Array.prototype.find;function ou(t){return function(){return nu.call(this.children,t)}}function iu(){return this.firstElementChild}function ru(t){return this.select(t==null?iu:ou(typeof t=="function"?t:Ns(t)))}var su=Array.prototype.filter;function au(){return Array.from(this.children)}function lu(t){return function(){return su.call(this.children,t)}}function cu(t){return this.selectAll(t==null?au:lu(typeof t=="function"?t:Ns(t)))}function du(t){typeof t!="function"&&(t=Ss(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],u,c=0;c<a;++c)(u=r[c])&&t.call(u,u.__data__,c,r)&&l.push(u);return new Fe(o,this._parents)}function ks(t){return new Array(t.length)}function uu(){return new Fe(this._enter||this._groups.map(ks),this._parents)}function eo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}eo.prototype={constructor:eo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function fu(t){return function(){return t}}function hu(t,e,n,o,i,r){for(var a=0,l,u=e.length,c=r.length;a<c;++a)(l=e[a])?(l.__data__=r[a],o[a]=l):n[a]=new eo(t,r[a]);for(;a<u;++a)(l=e[a])&&(i[a]=l)}function pu(t,e,n,o,i,r,a){var l,u,c=new Map,d=e.length,f=r.length,h=new Array(d),p;for(l=0;l<d;++l)(u=e[l])&&(h[l]=p=a.call(u,u.__data__,l,e)+"",c.has(p)?i[l]=u:c.set(p,u));for(l=0;l<f;++l)p=a.call(t,r[l],l,r)+"",(u=c.get(p))?(o[l]=u,u.__data__=r[l],c.delete(p)):n[l]=new eo(t,r[l]);for(l=0;l<d;++l)(u=e[l])&&c.get(h[l])===u&&(i[l]=u)}function gu(t){return t.__data__}function mu(t,e){if(!arguments.length)return Array.from(this,gu);var n=e?pu:hu,o=this._parents,i=this._groups;typeof t!="function"&&(t=fu(t));for(var r=i.length,a=new Array(r),l=new Array(r),u=new Array(r),c=0;c<r;++c){var d=o[c],f=i[c],h=f.length,p=yu(t.call(d,d&&d.__data__,c,o)),y=p.length,m=l[c]=new Array(y),b=a[c]=new Array(y),T=u[c]=new Array(h);n(d,f,m,b,T,p,e);for(var x=0,g=0,C,A;x<y;++x)if(C=m[x]){for(x>=g&&(g=x+1);!(A=b[g])&&++g<y;);C._next=A||null}}return a=new Fe(a,o),a._enter=l,a._exit=u,a}function yu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function vu(){return new Fe(this._exit||this._groups.map(ks),this._parents)}function bu(t,e,n){var o=this.enter(),i=this,r=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function _u(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,r=o.length,a=Math.min(i,r),l=new Array(i),u=0;u<a;++u)for(var c=n[u],d=o[u],f=c.length,h=l[u]=new Array(f),p,y=0;y<f;++y)(p=c[y]||d[y])&&(h[y]=p);for(;u<i;++u)l[u]=n[u];return new Fe(l,this._parents)}function wu(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function xu(t){t||(t=Cu);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],l=a.length,u=i[r]=new Array(l),c,d=0;d<l;++d)(c=a[d])&&(u[d]=c);u.sort(e)}return new Fe(i,this._parents).order()}function Cu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Eu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Su(){return Array.from(this)}function Nu(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function ku(){let t=0;for(const e of this)++t;return t}function Du(){return!this.node()}function Tu(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],r=0,a=i.length,l;r<a;++r)(l=i[r])&&t.call(l,l.__data__,r,i);return this}function Iu(t){return function(){this.removeAttribute(t)}}function Mu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bu(t,e){return function(){this.setAttribute(t,e)}}function $u(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function zu(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Au(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Pu(t,e){var n=Qn(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?Mu:Iu:typeof e=="function"?n.local?Au:zu:n.local?$u:Bu)(n,e))}function Ds(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ou(t){return function(){this.style.removeProperty(t)}}function Ru(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Hu(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Vu(t,e,n){return arguments.length>1?this.each((e==null?Ou:typeof e=="function"?Hu:Ru)(t,e,n??"")):Gt(this.node(),t)}function Gt(t,e){return t.style.getPropertyValue(e)||Ds(t).getComputedStyle(t,null).getPropertyValue(e)}function Lu(t){return function(){delete this[t]}}function Fu(t,e){return function(){this[t]=e}}function ju(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Gu(t,e){return arguments.length>1?this.each((e==null?Lu:typeof e=="function"?ju:Fu)(t,e)):this.node()[t]}function Ts(t){return t.trim().split(/^|\s+/)}function Pi(t){return t.classList||new Is(t)}function Is(t){this._node=t,this._names=Ts(t.getAttribute("class")||"")}Is.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ms(t,e){for(var n=Pi(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function Bs(t,e){for(var n=Pi(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function Wu(t){return function(){Ms(this,t)}}function Yu(t){return function(){Bs(this,t)}}function Uu(t,e){return function(){(e.apply(this,arguments)?Ms:Bs)(this,t)}}function Xu(t,e){var n=Ts(t+"");if(arguments.length<2){for(var o=Pi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Uu:e?Wu:Yu)(n,e))}function qu(){this.textContent=""}function Ku(t){return function(){this.textContent=t}}function Zu(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ju(t){return arguments.length?this.each(t==null?qu:(typeof t=="function"?Zu:Ku)(t)):this.node().textContent}function Qu(){this.innerHTML=""}function ef(t){return function(){this.innerHTML=t}}function tf(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function nf(t){return arguments.length?this.each(t==null?Qu:(typeof t=="function"?tf:ef)(t)):this.node().innerHTML}function of(){this.nextSibling&&this.parentNode.appendChild(this)}function rf(){return this.each(of)}function sf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function af(){return this.each(sf)}function lf(t){var e=typeof t=="function"?t:Cs(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function cf(){return null}function df(t,e){var n=typeof t=="function"?t:Cs(t),o=e==null?cf:typeof e=="function"?e:Ai(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function uf(){var t=this.parentNode;t&&t.removeChild(this)}function ff(){return this.each(uf)}function hf(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function pf(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function gf(t){return this.select(t?pf:hf)}function mf(t){return arguments.length?this.property("__data__",t):this.node().__data__}function yf(t){return function(e){t.call(this,e,this.__data__)}}function vf(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function bf(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,r;n<i;++n)r=e[n],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):e[++o]=r;++o?e.length=o:delete this.__on}}}function _f(t,e,n){return function(){var o=this.__on,i,r=yf(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=e;return}}this.addEventListener(t.type,r,n),i={type:t.type,name:t.name,value:e,listener:r,options:n},o?o.push(i):this.__on=[i]}}function wf(t,e,n){var o=vf(t+""),i,r=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,d;u<c;++u)for(i=0,d=l[u];i<r;++i)if((a=o[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=e?_f:bf,i=0;i<r;++i)this.each(l(o[i],e,n));return this}function $s(t,e,n){var o=Ds(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function xf(t,e){return function(){return $s(this,t,e)}}function Cf(t,e){return function(){return $s(this,t,e.apply(this,arguments))}}function Ef(t,e){return this.each((typeof e=="function"?Cf:xf)(t,e))}function*Sf(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var zs=[null];function Fe(t,e){this._groups=t,this._parents=e}function hn(){return new Fe([[document.documentElement]],zs)}function Nf(){return this}Fe.prototype=hn.prototype={constructor:Fe,select:Zd,selectAll:tu,selectChild:ru,selectChildren:cu,filter:du,data:mu,enter:uu,exit:vu,join:bu,merge:_u,selection:Nf,order:wu,sort:xu,call:Eu,nodes:Su,node:Nu,size:ku,empty:Du,each:Tu,attr:Pu,style:Vu,property:Gu,classed:Xu,text:Ju,html:nf,raise:rf,lower:af,append:lf,insert:df,remove:ff,clone:gf,datum:mf,on:wf,dispatch:Ef,[Symbol.iterator]:Sf};function Ke(t){return typeof t=="string"?new Fe([[document.querySelector(t)]],[document.documentElement]):new Fe([[t]],zs)}function kf(t){let e;for(;e=t.sourceEvent;)t=e;return t}function nt(t,e){if(t=kf(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Df={passive:!1},pn={capture:!0,passive:!1};function Oi(t){t.stopImmediatePropagation()}function Wt(t){t.preventDefault(),t.stopImmediatePropagation()}function As(t){var e=t.document.documentElement,n=Ke(t).on("dragstart.drag",Wt,pn);"onselectstart"in e?n.on("selectstart.drag",Wt,pn):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ps(t,e){var n=t.document.documentElement,o=Ke(t).on("dragstart.drag",null);e&&(o.on("click.drag",Wt,pn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const to=t=>()=>t;function Ri(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:r,x:a,y:l,dx:u,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Ri.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Tf(t){return!t.ctrlKey&&!t.button}function If(){return this.parentNode}function Mf(t,e){return e??{x:t.x,y:t.y}}function Bf(){return navigator.maxTouchPoints||"ontouchstart"in this}function $f(){var t=Tf,e=If,n=Mf,o=Bf,i={},r=Zn("start","drag","end"),a=0,l,u,c,d,f=0;function h(C){C.on("mousedown.drag",p).filter(o).on("touchstart.drag",b).on("touchmove.drag",T,Df).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(C,A){if(!(d||!t.call(this,C,A))){var z=g(this,e.call(this,C,A),C,A,"mouse");z&&(Ke(C.view).on("mousemove.drag",y,pn).on("mouseup.drag",m,pn),As(C.view),Oi(C),c=!1,l=C.clientX,u=C.clientY,z("start",C))}}function y(C){if(Wt(C),!c){var A=C.clientX-l,z=C.clientY-u;c=A*A+z*z>f}i.mouse("drag",C)}function m(C){Ke(C.view).on("mousemove.drag mouseup.drag",null),Ps(C.view,c),Wt(C),i.mouse("end",C)}function b(C,A){if(t.call(this,C,A)){var z=C.changedTouches,j=e.call(this,C,A),Y=z.length,W,D;for(W=0;W<Y;++W)(D=g(this,j,C,A,z[W].identifier,z[W]))&&(Oi(C),D("start",C,z[W]))}}function T(C){var A=C.changedTouches,z=A.length,j,Y;for(j=0;j<z;++j)(Y=i[A[j].identifier])&&(Wt(C),Y("drag",C,A[j]))}function x(C){var A=C.changedTouches,z=A.length,j,Y;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),j=0;j<z;++j)(Y=i[A[j].identifier])&&(Oi(C),Y("end",C,A[j]))}function g(C,A,z,j,Y,W){var D=r.copy(),B=nt(W||z,A),k,V,_;if((_=n.call(C,new Ri("beforestart",{sourceEvent:z,target:h,identifier:Y,active:a,x:B[0],y:B[1],dx:0,dy:0,dispatch:D}),j))!=null)return k=_.x-B[0]||0,V=_.y-B[1]||0,function M(v,S,I){var P=B,H;switch(v){case"start":i[Y]=M,H=a++;break;case"end":delete i[Y],--a;case"drag":B=nt(I||S,A),H=a;break}D.call(v,C,new Ri(v,{sourceEvent:S,subject:_,target:h,identifier:Y,active:H,x:B[0]+k,y:B[1]+V,dx:B[0]-P[0],dy:B[1]-P[1],dispatch:D}),j)}}return h.filter=function(C){return arguments.length?(t=typeof C=="function"?C:to(!!C),h):t},h.container=function(C){return arguments.length?(e=typeof C=="function"?C:to(C),h):e},h.subject=function(C){return arguments.length?(n=typeof C=="function"?C:to(C),h):n},h.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:to(!!C),h):o},h.on=function(){var C=r.on.apply(r,arguments);return C===r?h:C},h.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,h):Math.sqrt(f)},h}function Hi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Os(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function gn(){}var mn=.7,no=1/mn,Yt="\\s*([+-]?\\d+)\\s*",yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zf=/^#([0-9a-f]{3,8})$/,Af=new RegExp(`^rgb\\(${Yt},${Yt},${Yt}\\)$`),Pf=new RegExp(`^rgb\\(${ot},${ot},${ot}\\)$`),Of=new RegExp(`^rgba\\(${Yt},${Yt},${Yt},${yn}\\)$`),Rf=new RegExp(`^rgba\\(${ot},${ot},${ot},${yn}\\)$`),Hf=new RegExp(`^hsl\\(${yn},${ot},${ot}\\)$`),Vf=new RegExp(`^hsla\\(${yn},${ot},${ot},${yn}\\)$`),Rs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hi(gn,Tt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Hs,formatHex:Hs,formatHex8:Lf,formatHsl:Ff,formatRgb:Vs,toString:Vs});function Hs(){return this.rgb().formatHex()}function Lf(){return this.rgb().formatHex8()}function Ff(){return Ws(this).formatHsl()}function Vs(){return this.rgb().formatRgb()}function Tt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=zf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ls(e):n===3?new Re(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oo(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oo(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Af.exec(t))?new Re(e[1],e[2],e[3],1):(e=Pf.exec(t))?new Re(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Of.exec(t))?oo(e[1],e[2],e[3],e[4]):(e=Rf.exec(t))?oo(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Hf.exec(t))?Gs(e[1],e[2]/100,e[3]/100,1):(e=Vf.exec(t))?Gs(e[1],e[2]/100,e[3]/100,e[4]):Rs.hasOwnProperty(t)?Ls(Rs[t]):t==="transparent"?new Re(NaN,NaN,NaN,0):null}function Ls(t){return new Re(t>>16&255,t>>8&255,t&255,1)}function oo(t,e,n,o){return o<=0&&(t=e=n=NaN),new Re(t,e,n,o)}function jf(t){return t instanceof gn||(t=Tt(t)),t?(t=t.rgb(),new Re(t.r,t.g,t.b,t.opacity)):new Re}function Vi(t,e,n,o){return arguments.length===1?jf(t):new Re(t,e,n,o??1)}function Re(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Hi(Re,Vi,Os(gn,{brighter(t){return t=t==null?no:Math.pow(no,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?mn:Math.pow(mn,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Re(It(this.r),It(this.g),It(this.b),io(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fs,formatHex:Fs,formatHex8:Gf,formatRgb:js,toString:js}));function Fs(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}`}function Gf(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}${Mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function js(){const t=io(this.opacity);return`${t===1?"rgb(":"rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${t===1?")":`, ${t})`}`}function io(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function It(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mt(t){return t=It(t),(t<16?"0":"")+t.toString(16)}function Gs(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ze(t,e,n,o)}function Ws(t){if(t instanceof Ze)return new Ze(t.h,t.s,t.l,t.opacity);if(t instanceof gn||(t=Tt(t)),!t)return new Ze;if(t instanceof Ze)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),r=Math.max(e,n,o),a=NaN,l=r-i,u=(r+i)/2;return l?(e===r?a=(n-o)/l+(n<o)*6:n===r?a=(o-e)/l+2:a=(e-n)/l+4,l/=u<.5?r+i:2-r-i,a*=60):l=u>0&&u<1?0:a,new Ze(a,l,u,t.opacity)}function Wf(t,e,n,o){return arguments.length===1?Ws(t):new Ze(t,e,n,o??1)}function Ze(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Hi(Ze,Wf,Os(gn,{brighter(t){return t=t==null?no:Math.pow(no,t),new Ze(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?mn:Math.pow(mn,t),new Ze(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,i=2*n-o;return new Re(Li(t>=240?t-240:t+120,i,o),Li(t,i,o),Li(t<120?t+240:t-120,i,o),this.opacity)},clamp(){return new Ze(Ys(this.h),ro(this.s),ro(this.l),io(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=io(this.opacity);return`${t===1?"hsl(":"hsla("}${Ys(this.h)}, ${ro(this.s)*100}%, ${ro(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ys(t){return t=(t||0)%360,t<0?t+360:t}function ro(t){return Math.max(0,Math.min(1,t||0))}function Li(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Fi=t=>()=>t;function Yf(t,e){return function(n){return t+n*e}}function Uf(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Xf(t){return(t=+t)==1?Us:function(e,n){return n-e?Uf(e,n,t):Fi(isNaN(e)?n:e)}}function Us(t,e){var n=e-t;return n?Yf(t,n):Fi(isNaN(t)?e:t)}const so=(function t(e){var n=Xf(e);function o(i,r){var a=n((i=Vi(i)).r,(r=Vi(r)).r),l=n(i.g,r.g),u=n(i.b,r.b),c=Us(i.opacity,r.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=u(d),i.opacity=c(d),i+""}}return o.gamma=t,o})(1);function qf(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=t[i]*(1-r)+e[i]*r;return o}}function Kf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Zf(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,i=new Array(o),r=new Array(n),a;for(a=0;a<o;++a)i[a]=vn(t[a],e[a]);for(;a<n;++a)r[a]=e[a];return function(l){for(a=0;a<o;++a)r[a]=i[a](l);return r}}function Jf(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function it(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Qf(t,e){var n={},o={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=vn(t[i],e[i]):o[i]=e[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gi=new RegExp(ji.source,"g");function eh(t){return function(){return t}}function th(t){return function(e){return t(e)+""}}function Xs(t,e){var n=ji.lastIndex=Gi.lastIndex=0,o,i,r,a=-1,l=[],u=[];for(t=t+"",e=e+"";(o=ji.exec(t))&&(i=Gi.exec(e));)(r=i.index)>n&&(r=e.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,u.push({i:a,x:it(o,i)})),n=Gi.lastIndex;return n<e.length&&(r=e.slice(n),l[a]?l[a]+=r:l[++a]=r),l.length<2?u[0]?th(u[0].x):eh(e):(e=u.length,function(c){for(var d=0,f;d<e;++d)l[(f=u[d]).i]=f.x(c);return l.join("")})}function vn(t,e){var n=typeof e,o;return e==null||n==="boolean"?Fi(e):(n==="number"?it:n==="string"?(o=Tt(e))?(e=o,so):Xs:e instanceof Tt?so:e instanceof Date?Jf:Kf(e)?qf:Array.isArray(e)?Zf:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Qf:it)(t,e)}var qs=180/Math.PI,Wi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ks(t,e,n,o,i,r){var a,l,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,u/=l),t*o<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(e,t)*qs,skewX:Math.atan(u)*qs,scaleX:a,scaleY:l}}var ao;function nh(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Wi:Ks(e.a,e.b,e.c,e.d,e.e,e.f)}function oh(t){return t==null||(ao||(ao=document.createElementNS("http://www.w3.org/2000/svg","g")),ao.setAttribute("transform",t),!(t=ao.transform.baseVal.consolidate()))?Wi:(t=t.matrix,Ks(t.a,t.b,t.c,t.d,t.e,t.f))}function Zs(t,e,n,o){function i(c){return c.length?c.pop()+" ":""}function r(c,d,f,h,p,y){if(c!==f||d!==h){var m=p.push("translate(",null,e,null,n);y.push({i:m-4,x:it(c,f)},{i:m-2,x:it(d,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(c,d,f,h){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:it(c,d)})):d&&f.push(i(f)+"rotate("+d+o)}function l(c,d,f,h){c!==d?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:it(c,d)}):d&&f.push(i(f)+"skewX("+d+o)}function u(c,d,f,h,p,y){if(c!==f||d!==h){var m=p.push(i(p)+"scale(",null,",",null,")");y.push({i:m-4,x:it(c,f)},{i:m-2,x:it(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=t(c),d=t(d),r(c.translateX,c.translateY,d.translateX,d.translateY,f,h),a(c.rotate,d.rotate,f,h),l(c.skewX,d.skewX,f,h),u(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var y=-1,m=h.length,b;++y<m;)f[(b=h[y]).i]=b.x(p);return f.join("")}}}var ih=Zs(nh,"px, ","px)","deg)"),rh=Zs(oh,", ",")",")"),sh=1e-12;function Js(t){return((t=Math.exp(t))+1/t)/2}function ah(t){return((t=Math.exp(t))-1/t)/2}function lh(t){return((t=Math.exp(2*t))-1)/(t+1)}const lo=(function t(e,n,o){function i(r,a){var l=r[0],u=r[1],c=r[2],d=a[0],f=a[1],h=a[2],p=d-l,y=f-u,m=p*p+y*y,b,T;if(m<sh)T=Math.log(h/c)/e,b=function(j){return[l+j*p,u+j*y,c*Math.exp(e*j*T)]};else{var x=Math.sqrt(m),g=(h*h-c*c+o*m)/(2*c*n*x),C=(h*h-c*c-o*m)/(2*h*n*x),A=Math.log(Math.sqrt(g*g+1)-g),z=Math.log(Math.sqrt(C*C+1)-C);T=(z-A)/e,b=function(j){var Y=j*T,W=Js(A),D=c/(n*x)*(W*lh(e*Y+A)-ah(A));return[l+D*p,u+D*y,c*W/Js(e*Y+A)]}}return b.duration=T*1e3*e/Math.SQRT2,b}return i.rho=function(r){var a=Math.max(.001,+r),l=a*a,u=l*l;return t(a,l,u)},i})(Math.SQRT2,2,4);var Ut=0,bn=0,_n=0,Qs=1e3,co,wn,uo=0,Bt=0,fo=0,xn=typeof performance=="object"&&performance.now?performance:Date,ea=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Yi(){return Bt||(ea(ch),Bt=xn.now()+fo)}function ch(){Bt=0}function ho(){this._call=this._time=this._next=null}ho.prototype=ta.prototype={constructor:ho,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Yi():+n)+(e==null?0:+e),!this._next&&wn!==this&&(wn?wn._next=this:co=this,wn=this),this._call=t,this._time=n,Ui()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ui())}};function ta(t,e,n){var o=new ho;return o.restart(t,e,n),o}function dh(){Yi(),++Ut;for(var t=co,e;t;)(e=Bt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ut}function na(){Bt=(uo=xn.now())+fo,Ut=bn=0;try{dh()}finally{Ut=0,fh(),Bt=0}}function uh(){var t=xn.now(),e=t-uo;e>Qs&&(fo-=e,uo=t)}function fh(){for(var t,e=co,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:co=n);wn=t,Ui(o)}function Ui(t){if(!Ut){bn&&(bn=clearTimeout(bn));var e=t-Bt;e>24?(t<1/0&&(bn=setTimeout(na,t-xn.now()-fo)),_n&&(_n=clearInterval(_n))):(_n||(uo=xn.now(),_n=setInterval(uh,Qs)),Ut=1,ea(na))}}function oa(t,e,n){var o=new ho;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}var hh=Zn("start","end","cancel","interrupt"),ph=[],ia=0,ra=1,Xi=2,po=3,sa=4,qi=5,go=6;function mo(t,e,n,o,i,r){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;gh(t,n,{name:e,index:o,group:i,on:hh,tween:ph,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ia})}function Ki(t,e){var n=Je(t,e);if(n.state>ia)throw new Error("too late; already scheduled");return n}function rt(t,e){var n=Je(t,e);if(n.state>po)throw new Error("too late; already running");return n}function Je(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function gh(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=ta(r,0,n.time);function r(c){n.state=ra,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,f,h,p;if(n.state!==ra)return u();for(d in o)if(p=o[d],p.name===n.name){if(p.state===po)return oa(a);p.state===sa?(p.state=go,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete o[d]):+d<e&&(p.state=go,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete o[d])}if(oa(function(){n.state===po&&(n.state=sa,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Xi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Xi){for(n.state=po,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function l(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=qi,1),f=-1,h=i.length;++f<h;)i[f].call(t,d);n.state===qi&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=go,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function yo(t,e){var n=t.__transition,o,i,r=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){r=!1;continue}i=o.state>Xi&&o.state<qi,o.state=go,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}r&&delete t.__transition}}function mh(t){return this.each(function(){yo(this,t)})}function yh(t,e){var n,o;return function(){var i=rt(this,t),r=i.tween;if(r!==n){o=n=r;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function vh(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=rt(this,t),a=r.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===e){i[u]=l;break}u===c&&i.push(l)}r.tween=i}}function bh(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Je(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?yh:vh)(n,t,e))}function Zi(t,e,n){var o=t._id;return t.each(function(){var i=rt(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Je(i,o).value[e]}}function aa(t,e){var n;return(typeof e=="number"?it:e instanceof Tt?so:(n=Tt(e))?(e=n,so):Xs)(t,e)}function _h(t){return function(){this.removeAttribute(t)}}function wh(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xh(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function Ch(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function Eh(t,e,n){var o,i,r;return function(){var a,l=n(this),u;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=l+"",a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l)))}}function Sh(t,e,n){var o,i,r;return function(){var a,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=l+"",a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l)))}}function Nh(t,e){var n=Qn(t),o=n==="transform"?rh:aa;return this.attrTween(t,typeof e=="function"?(n.local?Sh:Eh)(n,o,Zi(this,"attr."+t,e)):e==null?(n.local?wh:_h)(n):(n.local?Ch:xh)(n,o,e))}function kh(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Dh(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Th(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&Dh(t,r)),n}return i._value=e,i}function Ih(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&kh(t,r)),n}return i._value=e,i}function Mh(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=Qn(t);return this.tween(n,(o.local?Th:Ih)(o,e))}function Bh(t,e){return function(){Ki(this,t).delay=+e.apply(this,arguments)}}function $h(t,e){return e=+e,function(){Ki(this,t).delay=e}}function zh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Bh:$h)(e,t)):Je(this.node(),e).delay}function Ah(t,e){return function(){rt(this,t).duration=+e.apply(this,arguments)}}function Ph(t,e){return e=+e,function(){rt(this,t).duration=e}}function Oh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ah:Ph)(e,t)):Je(this.node(),e).duration}function Rh(t,e){if(typeof e!="function")throw new Error;return function(){rt(this,t).ease=e}}function Hh(t){var e=this._id;return arguments.length?this.each(Rh(e,t)):Je(this.node(),e).ease}function Vh(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;rt(this,t).ease=n}}function Lh(t){if(typeof t!="function")throw new Error;return this.each(Vh(this._id,t))}function Fh(t){typeof t!="function"&&(t=Ss(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],u,c=0;c<a;++c)(u=r[c])&&t.call(u,u.__data__,c,r)&&l.push(u);return new dt(o,this._parents,this._name,this._id)}function jh(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),a=new Array(o),l=0;l<r;++l)for(var u=e[l],c=n[l],d=u.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<o;++l)a[l]=e[l];return new dt(a,this._parents,this._name,this._id)}function Gh(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Wh(t,e,n){var o,i,r=Gh(e)?Ki:rt;return function(){var a=r(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}function Yh(t,e){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(t):this.each(Wh(n,t,e))}function Uh(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Xh(){return this.on("end.remove",Uh(this._id))}function qh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ai(t));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var l=o[a],u=l.length,c=r[a]=new Array(u),d,f,h=0;h<u;++h)(d=l[h])&&(f=t.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),c[h]=f,mo(c[h],e,n,h,c,Je(d,n)));return new dt(r,this._parents,e,n)}function Kh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Es(t));for(var o=this._groups,i=o.length,r=[],a=[],l=0;l<i;++l)for(var u=o[l],c=u.length,d,f=0;f<c;++f)if(d=u[f]){for(var h=t.call(d,d.__data__,f,u),p,y=Je(d,n),m=0,b=h.length;m<b;++m)(p=h[m])&&mo(p,e,n,m,h,y);r.push(h),a.push(d)}return new dt(r,a,e,n)}var Zh=hn.prototype.constructor;function Jh(){return new Zh(this._groups,this._parents)}function Qh(t,e){var n,o,i;return function(){var r=Gt(this,t),a=(this.style.removeProperty(t),Gt(this,t));return r===a?null:r===n&&a===o?i:i=e(n=r,o=a)}}function la(t){return function(){this.style.removeProperty(t)}}function ep(t,e,n){var o,i=n+"",r;return function(){var a=Gt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}function tp(t,e,n){var o,i,r;return function(){var a=Gt(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Gt(this,t))),a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l))}}function np(t,e){var n,o,i,r="style."+e,a="end."+r,l;return function(){var u=rt(this,t),c=u.on,d=u.value[r]==null?l||(l=la(e)):void 0;(c!==n||i!==d)&&(o=(n=c).copy()).on(a,i=d),u.on=o}}function op(t,e,n){var o=(t+="")=="transform"?ih:aa;return e==null?this.styleTween(t,Qh(t,o)).on("end.style."+t,la(t)):typeof e=="function"?this.styleTween(t,tp(t,o,Zi(this,"style."+t,e))).each(np(this._id,t)):this.styleTween(t,ep(t,o,e),n).on("end.style."+t,null)}function ip(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function rp(t,e,n){var o,i;function r(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&ip(t,a,n)),o}return r._value=e,r}function sp(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,rp(t,e,n??""))}function ap(t){return function(){this.textContent=t}}function lp(t){return function(){var e=t(this);this.textContent=e??""}}function cp(t){return this.tween("text",typeof t=="function"?lp(Zi(this,"text",t)):ap(t==null?"":t+""))}function dp(t){return function(e){this.textContent=t.call(this,e)}}function up(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&dp(i)),e}return o._value=t,o}function fp(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,up(t))}function hp(){for(var t=this._name,e=this._id,n=ca(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,u,c=0;c<l;++c)if(u=a[c]){var d=Je(u,e);mo(u,t,n,c,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new dt(o,this._parents,t,n)}function pp(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var l={value:a},u={value:function(){--i===0&&r()}};n.each(function(){var c=rt(this,o),d=c.on;d!==t&&(e=(t=d).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),c.on=e}),i===0&&r()})}var gp=0;function dt(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function ca(){return++gp}var ut=hn.prototype;dt.prototype={constructor:dt,select:qh,selectAll:Kh,selectChild:ut.selectChild,selectChildren:ut.selectChildren,filter:Fh,merge:jh,selection:Jh,transition:hp,call:ut.call,nodes:ut.nodes,node:ut.node,size:ut.size,empty:ut.empty,each:ut.each,on:Yh,attr:Nh,attrTween:Mh,style:op,styleTween:sp,text:cp,textTween:fp,remove:Xh,tween:bh,delay:zh,duration:Oh,ease:Hh,easeVarying:Lh,end:pp,[Symbol.iterator]:ut[Symbol.iterator]};function mp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yp={time:null,delay:0,duration:250,ease:mp};function vp(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function bp(t){var e,n;t instanceof dt?(e=t._id,t=t._name):(e=ca(),(n=yp).time=Yi(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,u,c=0;c<l;++c)(u=a[c])&&mo(u,t,e,c,a,n||vp(u,e));return new dt(o,this._parents,t,e)}hn.prototype.interrupt=mh,hn.prototype.transition=bp;const vo=t=>()=>t;function _p(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function ft(t,e,n){this.k=t,this.x=e,this.y=n}ft.prototype={constructor:ft,scale:function(t){return t===1?this:new ft(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ft(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xt=new ft(1,0,0);ft.prototype;function Ji(t){t.stopImmediatePropagation()}function Cn(t){t.preventDefault(),t.stopImmediatePropagation()}function wp(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function xp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function da(){return this.__zoom||Xt}function Cp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ep(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sp(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function Np(){var t=wp,e=xp,n=Sp,o=Cp,i=Ep,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=lo,c=Zn("start","zoom","end"),d,f,h,p=500,y=150,m=0,b=10;function T(_){_.property("__zoom",da).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",B).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(_,M,v,S){var I=_.selection?_.selection():_;I.property("__zoom",da),_!==I?A(_,M,v,S):I.interrupt().each(function(){z(this,arguments).event(S).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},T.scaleBy=function(_,M,v,S){T.scaleTo(_,function(){var I=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return I*P},v,S)},T.scaleTo=function(_,M,v,S){T.transform(_,function(){var I=e.apply(this,arguments),P=this.__zoom,H=v==null?C(I):typeof v=="function"?v.apply(this,arguments):v,$=P.invert(H),O=typeof M=="function"?M.apply(this,arguments):M;return n(g(x(P,O),H,$),I,a)},v,S)},T.translateBy=function(_,M,v,S){T.transform(_,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof v=="function"?v.apply(this,arguments):v),e.apply(this,arguments),a)},null,S)},T.translateTo=function(_,M,v,S,I){T.transform(_,function(){var P=e.apply(this,arguments),H=this.__zoom,$=S==null?C(P):typeof S=="function"?S.apply(this,arguments):S;return n(Xt.translate($[0],$[1]).scale(H.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof v=="function"?-v.apply(this,arguments):-v),P,a)},S,I)};function x(_,M){return M=Math.max(r[0],Math.min(r[1],M)),M===_.k?_:new ft(M,_.x,_.y)}function g(_,M,v){var S=M[0]-v[0]*_.k,I=M[1]-v[1]*_.k;return S===_.x&&I===_.y?_:new ft(_.k,S,I)}function C(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function A(_,M,v,S){_.on("start.zoom",function(){z(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(S).end()}).tween("zoom",function(){var I=this,P=arguments,H=z(I,P).event(S),$=e.apply(I,P),O=v==null?C($):typeof v=="function"?v.apply(I,P):v,F=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),G=I.__zoom,X=typeof M=="function"?M.apply(I,P):M,Z=u(G.invert(O).concat(F/G.k),X.invert(O).concat(F/X.k));return function(U){if(U===1)U=X;else{var J=Z(U),te=F/J[2];U=new ft(te,O[0]-J[0]*te,O[1]-J[1]*te)}H.zoom(null,U)}})}function z(_,M,v){return!v&&_.__zooming||new j(_,M)}function j(_,M){this.that=_,this.args=M,this.active=0,this.sourceEvent=null,this.extent=e.apply(_,M),this.taps=0}j.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,M){return this.mouse&&_!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var M=Ke(this.that).datum();c.call(_,this.that,new _p(_,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:c}),M)}};function Y(_,...M){if(!t.apply(this,arguments))return;var v=z(this,M).event(_),S=this.__zoom,I=Math.max(r[0],Math.min(r[1],S.k*Math.pow(2,o.apply(this,arguments)))),P=nt(_);if(v.wheel)(v.mouse[0][0]!==P[0]||v.mouse[0][1]!==P[1])&&(v.mouse[1]=S.invert(v.mouse[0]=P)),clearTimeout(v.wheel);else{if(S.k===I)return;v.mouse=[P,S.invert(P)],yo(this),v.start()}Cn(_),v.wheel=setTimeout(H,y),v.zoom("mouse",n(g(x(S,I),v.mouse[0],v.mouse[1]),v.extent,a));function H(){v.wheel=null,v.end()}}function W(_,...M){if(h||!t.apply(this,arguments))return;var v=_.currentTarget,S=z(this,M,!0).event(_),I=Ke(_.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",F,!0),P=nt(_,v),H=_.clientX,$=_.clientY;As(_.view),Ji(_),S.mouse=[P,this.__zoom.invert(P)],yo(this),S.start();function O(G){if(Cn(G),!S.moved){var X=G.clientX-H,Z=G.clientY-$;S.moved=X*X+Z*Z>m}S.event(G).zoom("mouse",n(g(S.that.__zoom,S.mouse[0]=nt(G,v),S.mouse[1]),S.extent,a))}function F(G){I.on("mousemove.zoom mouseup.zoom",null),Ps(G.view,S.moved),Cn(G),S.event(G).end()}}function D(_,...M){if(t.apply(this,arguments)){var v=this.__zoom,S=nt(_.changedTouches?_.changedTouches[0]:_,this),I=v.invert(S),P=v.k*(_.shiftKey?.5:2),H=n(g(x(v,P),S,I),e.apply(this,M),a);Cn(_),l>0?Ke(this).transition().duration(l).call(A,H,S,_):Ke(this).call(T.transform,H,S,_)}}function B(_,...M){if(t.apply(this,arguments)){var v=_.touches,S=v.length,I=z(this,M,_.changedTouches.length===S).event(_),P,H,$,O;for(Ji(_),H=0;H<S;++H)$=v[H],O=nt($,this),O=[O,this.__zoom.invert(O),$.identifier],I.touch0?!I.touch1&&I.touch0[2]!==O[2]&&(I.touch1=O,I.taps=0):(I.touch0=O,P=!0,I.taps=1+!!d);d&&(d=clearTimeout(d)),P&&(I.taps<2&&(f=O[0],d=setTimeout(function(){d=null},p)),yo(this),I.start())}}function k(_,...M){if(this.__zooming){var v=z(this,M).event(_),S=_.changedTouches,I=S.length,P,H,$,O;for(Cn(_),P=0;P<I;++P)H=S[P],$=nt(H,this),v.touch0&&v.touch0[2]===H.identifier?v.touch0[0]=$:v.touch1&&v.touch1[2]===H.identifier&&(v.touch1[0]=$);if(H=v.that.__zoom,v.touch1){var F=v.touch0[0],G=v.touch0[1],X=v.touch1[0],Z=v.touch1[1],U=(U=X[0]-F[0])*U+(U=X[1]-F[1])*U,J=(J=Z[0]-G[0])*J+(J=Z[1]-G[1])*J;H=x(H,Math.sqrt(U/J)),$=[(F[0]+X[0])/2,(F[1]+X[1])/2],O=[(G[0]+Z[0])/2,(G[1]+Z[1])/2]}else if(v.touch0)$=v.touch0[0],O=v.touch0[1];else return;v.zoom("touch",n(g(H,$,O),v.extent,a))}}function V(_,...M){if(this.__zooming){var v=z(this,M).event(_),S=_.changedTouches,I=S.length,P,H;for(Ji(_),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),P=0;P<I;++P)H=S[P],v.touch0&&v.touch0[2]===H.identifier?delete v.touch0:v.touch1&&v.touch1[2]===H.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(H=nt(H,this),Math.hypot(f[0]-H[0],f[1]-H[1])<b)){var $=Ke(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return T.wheelDelta=function(_){return arguments.length?(o=typeof _=="function"?_:vo(+_),T):o},T.filter=function(_){return arguments.length?(t=typeof _=="function"?_:vo(!!_),T):t},T.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:vo(!!_),T):i},T.extent=function(_){return arguments.length?(e=typeof _=="function"?_:vo([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),T):e},T.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],T):[r[0],r[1]]},T.translateExtent=function(_){return arguments.length?(a[0][0]=+_[0][0],a[1][0]=+_[1][0],a[0][1]=+_[0][1],a[1][1]=+_[1][1],T):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},T.constrain=function(_){return arguments.length?(n=_,T):n},T.duration=function(_){return arguments.length?(l=+_,T):l},T.interpolate=function(_){return arguments.length?(u=_,T):u},T.on=function(){var _=c.on.apply(c,arguments);return _===c?T:_},T.clickDistance=function(_){return arguments.length?(m=(_=+_)*_,T):Math.sqrt(m)},T.tapDistance=function(_){return arguments.length?(b=+_,T):b},T}var ue=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(ue||{}),Qi=(t=>(t.Partial="partial",t.Full="full",t))(Qi||{}),$t=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))($t||{}),ht=(t=>(t.Strict="strict",t.Loose="loose",t))(ht||{}),pt=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(pt||{}),En=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(En||{}),ua=(t=>(t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right",t))(ua||{});const kp=["INPUT","SELECT","TEXTAREA"],Dp=typeof document<"u"?document:null;function er(t){var e,n;const o=((n=(e=t.composedPath)==null?void 0:e.call(t))==null?void 0:n[0])||t.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,r=typeof o?.closest=="function"?o.closest(".nokey"):null;return kp.includes(o?.nodeName)||i||!!r}function Tp(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function fa(t,e,n,o){const i=e.replace("+",`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|
|
5
5
|
+`).split(`
|
|
6
|
-
`).map(a=>a.trim().toLowerCase());if(i.length===1)return t.toLowerCase()===e.toLowerCase();o||n.add(t.toLowerCase());const r=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(t.toLowerCase()),r}function Cp(t,e){return n=>{if(!n.code&&!n.key)return!1;const o=Ep(n.code,t);return Array.isArray(t)?t.some(i=>Qs(n[o],i,e,n.type==="keyup")):Qs(n[o],t,e,n.type==="keyup")}}function Ep(t,e){return e.includes(t)?"code":"key"}function In(t,e){const n=(0,s.computed)(()=>(0,s.toValue)(e?.target)??wp),o=(0,s.shallowRef)((0,s.toValue)(t)===!0);let i=!1;const r=new Set;let a=d((0,s.toValue)(t));(0,s.watch)(()=>(0,s.toValue)(t),(c,u)=>{typeof u=="boolean"&&typeof c!="boolean"&&l(),a=d(c)},{immediate:!0}),ss(["blur","contextmenu"],l),as((...c)=>a(...c),c=>{var u,f;const h=(0,s.toValue)(e?.actInsideInputWithModifier)??!0,p=(0,s.toValue)(e?.preventDefault)??!1;if(i=bp(c),(!i||i&&!h)&&Li(c))return;const g=((f=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:f[0])||c.target,m=g?.nodeName==="BUTTON"||g?.nodeName==="A";!p&&(i||!m)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),as((...c)=>a(...c),c=>{const u=(0,s.toValue)(e?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!u)&&Li(c))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,r.clear(),o.value=(0,s.toValue)(t)===!0}function d(c){return c===null?(l(),()=>!1):typeof c=="boolean"?(l(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Cp(c,r):c}return o}var ea="vue-flow__node-desc",ta="vue-flow__edge-desc",xp="vue-flow__aria-live",na=["Enter"," ","Escape"],Zt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Co(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function Eo(t,e){const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)}function xo(t){return{width:t.offsetWidth,height:t.offsetHeight}}function $t(t,e=0,n=1){return Math.min(Math.max(t,e),n)}function oa(t,e){return{x:$t(t.x,e[0][0],e[1][0]),y:$t(t.y,e[0][1],e[1][1])}}function ia(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function Ct(t){return t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t}function Rt(t){return t&&typeof t=="object"&&"id"in t&&"position"in t&&!Ct(t)}function Mn(t){return Rt(t)&&"computedPosition"in t}function So(t){return!Number.isNaN(t)&&Number.isFinite(t)}function Sp(t){return So(t.width)&&So(t.height)&&So(t.x)&&So(t.y)}function kp(t,e,n){const o={id:t.id.toString(),type:t.type??"default",dimensions:(0,s.markRaw)({width:0,height:0}),computedPosition:(0,s.markRaw)({z:0,...t.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Ne(t.data)?t.data:{},events:(0,s.markRaw)(Ne(t.events)?t.events:{})};return Object.assign(e??o,t,{id:t.id.toString(),parentNode:n})}function ra(t,e,n){var o,i;const r={id:t.id.toString(),type:t.type??e?.type??"default",source:t.source.toString(),target:t.target.toString(),sourceHandle:(o=t.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=t.targetHandle)==null?void 0:i.toString(),updatable:t.updatable??n?.updatable,selectable:t.selectable??n?.selectable,focusable:t.focusable??n?.focusable,data:Ne(t.data)?t.data:{},events:(0,s.markRaw)(Ne(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(e??r,t,{id:t.id.toString()})}function sa(t,e,n,o){const i=typeof t=="string"?t:t.id,r=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&r.add(l[o]);return e.filter(l=>r.has(l.id))}function Np(...t){if(t.length===3){const[i,r,a]=t;return sa(i,r,a,"target")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Ct(i)&&i.source===o).map(i=>n.find(r=>Rt(r)&&r.id===i.target))}function Dp(...t){if(t.length===3){const[i,r,a]=t;return sa(i,r,a,"source")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Ct(i)&&i.target===o).map(i=>n.find(r=>Rt(r)&&r.id===i.source))}function aa({source:t,sourceHandle:e,target:n,targetHandle:o}){return`vueflow__edge-${t}${e??""}-${n}${o??""}`}function Tp(t,e){return e.some(n=>Ct(n)&&n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle))}function Bn({x:t,y:e},{x:n,y:o,zoom:i}){return{x:t*i+n,y:e*i+o}}function zn({x:t,y:e},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const l={x:(t-n)/i,y:(e-o)/i};return r?No(l,a):l}function Ip(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}}function la({x:t,y:e,width:n,height:o}){return{x:t,y:e,x2:t+n,y2:e+o}}function Mp({x:t,y:e,x2:n,y2:o}){return{x:t,y:e,width:n-t,height:o-e}}function ca(t){let e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<t.length;n++){const o=t[n];e=Ip(e,la({...o.computedPosition,...o.dimensions}))}return Mp(e)}function da(t,e,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...zn(e,n),width:e.width/n.zoom,height:e.height/n.zoom},a=[];for(const l of t){const{dimensions:d,selectable:c=!0,hidden:u=!1}=l,f=d.width??l.width??null,h=d.height??l.height??null;if(i&&!c||u)continue;const p=Eo(r,Co(l)),g=f===null||h===null,m=o&&p>0,w=(f??0)*(h??0);(g||m||p>=w||l.dragging)&&a.push(l)}return a}function ua(t,e){const n=new Set;if(typeof t=="string")n.add(t);else if(t.length>=1)for(const o of t)n.add(o.id);return e.filter(o=>n.has(o.source)||n.has(o.target))}function Jt(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return Pn(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Bp(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Jt(t,n),i=Jt(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){const o=Jt(t.top??t.y??0,n),i=Jt(t.bottom??t.y??0,n),r=Jt(t.left??t.x??0,e),a=Jt(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:r,x:r+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zp(t,e,n,o,i,r){const{x:a,y:l}=Bn(t,{x:e,y:n,zoom:o}),{x:d,y:c}=Bn({x:t.x+t.width,y:t.y+t.height},{x:e,y:n,zoom:o}),u=i-d,f=r-c;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(f)}}function fa(t,e,n,o,i,r=.1){const a=Bp(r,e,n),l=(e-a.x)/t.width,d=(n-a.y)/t.height,c=$t(Math.min(l,d),o,i),u=t.x+t.width/2,f=t.y+t.height/2,h=e/2-u*c,p=n/2-f*c,g=zp(t,h,p,c,e,n),m={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:h-m.left+m.right,y:p-m.top+m.bottom,zoom:c}}function Ap(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function ha(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return n?n.selected?!0:ha(n,e):!1}function An(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`}function pa(t){const e=t.ctrlKey&&ko()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function ga(t,e,n){return t<e?$t(Math.abs(t-e),1,e)/e:t>n?-$t(Math.abs(t-n),1,e)/e:0}function ma(t,e,n=15,o=40){return[ga(t.x,o,e.width-o)*n,ga(t.y,o,e.height-o)*n]}function Fi(t,e){if(e){const n=t.position.x+t.dimensions.width-e.dimensions.width,o=t.position.y+t.dimensions.height-e.dimensions.height;if(n>0||o>0||t.position.x<0||t.position.y<0){let i={};if(typeof e.style=="function"?i={...e.style(e)}:e.style&&(i={...e.style}),i.width=i.width??`${e.dimensions.width}px`,i.height=i.height??`${e.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(t.position.x<0){const r=Math.abs(t.position.x);if(e.position.x=e.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;t.position.x=0}if(t.position.y<0){const r=Math.abs(t.position.y);if(e.position.y=e.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;t.position.y=0}e.dimensions.width=Number(i.width.toString().replace("px","")),e.dimensions.height=Number(i.height.toString().replace("px","")),typeof e.style=="function"?e.style=r=>{const a=e.style;return{...a(r),...i}}:e.style={...e.style,...i}}}}function va(t,e){var n,o;const i=t.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")e.findIndex(l=>l.id===a.item.id)===-1&&e.push(a.item);else if(a.type==="remove"){const l=e.findIndex(d=>d.id===a.id);l!==-1&&e.splice(l,1)}const r=e.map(a=>a.id);for(const a of e)for(const l of t)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(Mn(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const d=e[r.indexOf(a.parentNode)];d&&Mn(d)&&Fi(a,d)}break;case"dimensions":if(Mn(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const d=e[r.indexOf(a.parentNode)];d&&Mn(d)&&(d.dimensions.width&&d.dimensions.height?Fi(a,d):(0,s.nextTick)(()=>{Fi(a,d)}))}break}return e}function Et(t,e){return{id:t,type:"select",selected:e}}function ya(t){return{item:t,type:"add"}}function _a(t){return{id:t,type:"remove"}}function wa(t,e,n,o,i){return{id:t,source:e,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function xt(t,e=new Set,n=!1){const o=[];for(const[i,r]of t){const a=e.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(Et(r.id,a)))}return o}var ba=()=>{};function le(t){const e=new Set;let n=ba,o=()=>!1;const i=()=>e.size>0||o(),r=h=>{n=h},a=()=>{n=ba},l=h=>{o=h},d=()=>{o=()=>!1},c=h=>{e.delete(h)};return{on:h=>{e.add(h);const p=()=>c(h);return vn(p),{off:p}},off:c,trigger:h=>{const p=[n];return i()?p.push(...e):t&&p.push(t),Promise.allSettled(p.map(g=>g(h)))},hasListeners:i,listeners:e,setEmitter:r,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:d}}function Ca(t,e,n){let o=t;do{if(o&&o.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Pp(t,e,n,o){var i,r;const a=new Map;for(const[l,d]of t)(d.selected||d.id===o)&&(!d.parentNode||!ha(d,t))&&(d.draggable||e&&typeof d.draggable>"u")&&t.get(l)&&a.set(l,{id:d.id,position:d.position||{x:0,y:0},distance:{x:n.x-((i=d.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=d.computedPosition)==null?void 0:r.y)||0},from:{x:d.computedPosition.x,y:d.computedPosition.y},extent:d.extent,parentNode:d.parentNode,dimensions:{...d.dimensions},expandParent:d.expandParent});return Array.from(a.values())}function Gi({id:t,dragItems:e,findNode:n}){const o=[];for(const i of e){const r=n(i.id);r&&o.push(r)}return[t?o.find(i=>i.id===t):o[0],o]}function Ea(t){if(Array.isArray(t))switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return[0,0,0,0]}return[t,t,t,t]}function Op(t,e,n){const[o,i,r,a]=typeof t!="string"?Ea(t.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function $p(t,e,n,o){let i=t.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!t.expandParent)if(t.parentNode&&o&&t.dimensions.width&&t.dimensions.height){const r=Op(i,t,o);r&&(i=r)}else e(new Ie(ke.NODE_EXTENT_INVALID,t.id)),i=n;else if(Array.isArray(i)){const r=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[r,a,l,d]=Ea(i.padding),c=o?.computedPosition.x||0,u=o?.computedPosition.y||0;i=[[i.range[0][0]+c+d,i.range[0][1]+u+r],[i.range[1][0]+c-a,i.range[1][1]+u-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Rp({width:t,height:e},n){return[n[0],[n[1][0]-(t||0),n[1][1]-(e||0)]]}function ji(t,e,n,o,i){const r=oa(e,Rp(t.dimensions,$p(t,n,o,i)));return{position:{x:r.x-(i?.computedPosition.x||0),y:r.y-(i?.computedPosition.y||0)},computedPosition:r}}function Qt(t,e,n=ce.Left,o=!1){const i=(e?.x??0)+t.computedPosition.x,r=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??Fp(t);if(o)return{x:i+a/2,y:r+l/2};switch(e?.position??n){case ce.Top:return{x:i+a/2,y:r};case ce.Right:return{x:i+a,y:r+l/2};case ce.Bottom:return{x:i+a/2,y:r+l};case ce.Left:return{x:i,y:r+l/2}}}function xa(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Hp({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:l,viewport:d}){const c={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+i),y2:Math.max(t.y+o,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=la({x:(0-d.x)/d.zoom,y:(0-d.y)/d.zoom,width:a/d.zoom,height:l/d.zoom}),f=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(f*h)>0}function Vp(t,e,n=!1){const o=typeof t.zIndex=="number";let i=o?t.zIndex:0;const r=e(t.source),a=e(t.target);return!r||!a?0:(n&&(i=o?t.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var ke=(t=>(t.MISSING_STYLES="MISSING_STYLES",t.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",t.NODE_INVALID="NODE_INVALID",t.NODE_NOT_FOUND="NODE_NOT_FOUND",t.NODE_MISSING_PARENT="NODE_MISSING_PARENT",t.NODE_TYPE_MISSING="NODE_TYPE_MISSING",t.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",t.EDGE_INVALID="EDGE_INVALID",t.EDGE_NOT_FOUND="EDGE_NOT_FOUND",t.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",t.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",t.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",t.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",t.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",t.EDGE_ORPHANED="EDGE_ORPHANED",t.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",t))(ke||{}),Sa={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:t=>`Node is invalid
|
|
6
|
+
`).map(a=>a.trim().toLowerCase());if(i.length===1)return t.toLowerCase()===e.toLowerCase();o||n.add(t.toLowerCase());const r=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(t.toLowerCase()),r}function Ip(t,e){return n=>{if(!n.code&&!n.key)return!1;const o=Mp(n.code,t);return Array.isArray(t)?t.some(i=>fa(n[o],i,e,n.type==="keyup")):fa(n[o],t,e,n.type==="keyup")}}function Mp(t,e){return e.includes(t)?"code":"key"}function Sn(t,e){const n=s.computed(()=>s.toValue(e?.target)??Dp),o=s.shallowRef(s.toValue(t)===!0);let i=!1;const r=new Set;let a=u(s.toValue(t));s.watch(()=>s.toValue(t),(c,d)=>{typeof d=="boolean"&&typeof c!="boolean"&&l(),a=u(c)},{immediate:!0}),bs(["blur","contextmenu"],l),_s((...c)=>a(...c),c=>{var d,f;const h=s.toValue(e?.actInsideInputWithModifier)??!0,p=s.toValue(e?.preventDefault)??!1;if(i=Tp(c),(!i||i&&!h)&&er(c))return;const m=((f=(d=c.composedPath)==null?void 0:d.call(c))==null?void 0:f[0])||c.target,b=m?.nodeName==="BUTTON"||m?.nodeName==="A";!p&&(i||!b)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),_s((...c)=>a(...c),c=>{const d=s.toValue(e?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!d)&&er(c))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,r.clear(),o.value=s.toValue(t)===!0}function u(c){return c===null?(l(),()=>!1):typeof c=="boolean"?(l(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Ip(c,r):c}return o}const ha="vue-flow__node-desc",pa="vue-flow__edge-desc",Bp="vue-flow__aria-live",ga=["Enter"," ","Escape"],qt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function bo(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function _o(t,e){const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)}function wo(t){return{width:t.offsetWidth,height:t.offsetHeight}}function zt(t,e=0,n=1){return Math.min(Math.max(t,e),n)}function ma(t,e){return{x:zt(t.x,e[0][0],e[1][0]),y:zt(t.y,e[0][1],e[1][1])}}function ya(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function _t(t){return t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t}function At(t){return t&&typeof t=="object"&&"id"in t&&"position"in t&&!_t(t)}function Nn(t){return At(t)&&"computedPosition"in t}function xo(t){return!Number.isNaN(t)&&Number.isFinite(t)}function $p(t){return xo(t.width)&&xo(t.height)&&xo(t.x)&&xo(t.y)}function zp(t,e,n){const o={id:t.id.toString(),type:t.type??"default",dimensions:s.markRaw({width:0,height:0}),computedPosition:s.markRaw({z:0,...t.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:ke(t.data)?t.data:{},events:s.markRaw(ke(t.events)?t.events:{})};return Object.assign(e??o,t,{id:t.id.toString(),parentNode:n})}function va(t,e,n){var o,i;const r={id:t.id.toString(),type:t.type??e?.type??"default",source:t.source.toString(),target:t.target.toString(),sourceHandle:(o=t.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=t.targetHandle)==null?void 0:i.toString(),updatable:t.updatable??n?.updatable,selectable:t.selectable??n?.selectable,focusable:t.focusable??n?.focusable,data:ke(t.data)?t.data:{},events:s.markRaw(ke(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(e??r,t,{id:t.id.toString()})}function ba(t,e,n,o){const i=typeof t=="string"?t:t.id,r=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&r.add(l[o]);return e.filter(l=>r.has(l.id))}function Ap(...t){if(t.length===3){const[r,a,l]=t;return ba(r,a,l,"target")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(r=>_t(r)&&r.source===o).map(r=>n.find(a=>At(a)&&a.id===r.target))}function Pp(...t){if(t.length===3){const[r,a,l]=t;return ba(r,a,l,"source")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(r=>_t(r)&&r.target===o).map(r=>n.find(a=>At(a)&&a.id===r.source))}function _a({source:t,sourceHandle:e,target:n,targetHandle:o}){return`vueflow__edge-${t}${e??""}-${n}${o??""}`}function Op(t,e){return e.some(n=>_t(n)&&n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle))}function kn({x:t,y:e},{x:n,y:o,zoom:i}){return{x:t*i+n,y:e*i+o}}function Dn({x:t,y:e},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const l={x:(t-n)/i,y:(e-o)/i};return r?Eo(l,a):l}function Rp(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}}function wa({x:t,y:e,width:n,height:o}){return{x:t,y:e,x2:t+n,y2:e+o}}function Hp({x:t,y:e,x2:n,y2:o}){return{x:t,y:e,width:n-t,height:o-e}}function xa(t){let e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<t.length;n++){const o=t[n];e=Rp(e,wa({...o.computedPosition,...o.dimensions}))}return Hp(e)}function Ca(t,e,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...Dn(e,n),width:e.width/n.zoom,height:e.height/n.zoom},a=[];for(const l of t){const{dimensions:u,selectable:c=!0,hidden:d=!1}=l,f=u.width??l.width??null,h=u.height??l.height??null;if(i&&!c||d)continue;const p=_o(r,bo(l)),y=f===null||h===null,m=o&&p>0,b=(f??0)*(h??0);(y||m||p>=b||l.dragging)&&a.push(l)}return a}function Ea(t,e){const n=new Set;if(typeof t=="string")n.add(t);else if(t.length>=1)for(const o of t)n.add(o.id);return e.filter(o=>n.has(o.source)||n.has(o.target))}function Kt(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return In(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Vp(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Kt(t,n),i=Kt(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){const o=Kt(t.top??t.y??0,n),i=Kt(t.bottom??t.y??0,n),r=Kt(t.left??t.x??0,e),a=Kt(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:r,x:r+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Lp(t,e,n,o,i,r){const{x:a,y:l}=kn(t,{x:e,y:n,zoom:o}),{x:u,y:c}=kn({x:t.x+t.width,y:t.y+t.height},{x:e,y:n,zoom:o}),d=i-u,f=r-c;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}function Sa(t,e,n,o,i,r=.1){const a=Vp(r,e,n),l=(e-a.x)/t.width,u=(n-a.y)/t.height,c=Math.min(l,u),d=zt(c,o,i),f=t.x+t.width/2,h=t.y+t.height/2,p=e/2-f*d,y=n/2-h*d,m=Lp(t,p,y,d,e,n),b={left:Math.min(m.left-a.left,0),top:Math.min(m.top-a.top,0),right:Math.min(m.right-a.right,0),bottom:Math.min(m.bottom-a.bottom,0)};return{x:p-b.left+b.right,y:y-b.top+b.bottom,zoom:d}}function Fp(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function Na(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return n?n.selected?!0:Na(n,e):!1}function Tn(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`}function ka(t){const e=t.ctrlKey&&Co()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function Da(t,e,n){return t<e?zt(Math.abs(t-e),1,e)/e:t>n?-zt(Math.abs(t-n),1,e)/e:0}function Ta(t,e,n=15,o=40){const i=Da(t.x,o,e.width-o)*n,r=Da(t.y,o,e.height-o)*n;return[i,r]}function tr(t,e){if(e){const n=t.position.x+t.dimensions.width-e.dimensions.width,o=t.position.y+t.dimensions.height-e.dimensions.height;if(n>0||o>0||t.position.x<0||t.position.y<0){let i={};if(typeof e.style=="function"?i={...e.style(e)}:e.style&&(i={...e.style}),i.width=i.width??`${e.dimensions.width}px`,i.height=i.height??`${e.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(t.position.x<0){const r=Math.abs(t.position.x);if(e.position.x=e.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;t.position.x=0}if(t.position.y<0){const r=Math.abs(t.position.y);if(e.position.y=e.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;t.position.y=0}e.dimensions.width=Number(i.width.toString().replace("px","")),e.dimensions.height=Number(i.height.toString().replace("px","")),typeof e.style=="function"?e.style=r=>{const a=e.style;return{...a(r),...i}}:e.style={...e.style,...i}}}}function Ia(t,e){var n,o;const i=t.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")e.findIndex(u=>u.id===a.item.id)===-1&&e.push(a.item);else if(a.type==="remove"){const l=e.findIndex(u=>u.id===a.id);l!==-1&&e.splice(l,1)}const r=e.map(a=>a.id);for(const a of e)for(const l of t)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(Nn(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const u=e[r.indexOf(a.parentNode)];u&&Nn(u)&&tr(a,u)}break;case"dimensions":if(Nn(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const u=e[r.indexOf(a.parentNode)];u&&Nn(u)&&(!!u.dimensions.width&&!!u.dimensions.height?tr(a,u):s.nextTick(()=>{tr(a,u)}))}break}return e}function wt(t,e){return{id:t,type:"select",selected:e}}function Ma(t){return{item:t,type:"add"}}function Ba(t){return{id:t,type:"remove"}}function $a(t,e,n,o,i){return{id:t,source:e,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function xt(t,e=new Set,n=!1){const o=[];for(const[i,r]of t){const a=e.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(wt(r.id,a)))}return o}const za=()=>{};function ae(t){const e=new Set;let n=za,o=()=>!1;const i=()=>e.size>0||o(),r=h=>{n=h},a=()=>{n=za},l=h=>{o=h},u=()=>{o=()=>!1},c=h=>{e.delete(h)};return{on:h=>{e.add(h);const p=()=>c(h);return fn(p),{off:p}},off:c,trigger:h=>{const p=[n];return i()?p.push(...e):t&&p.push(t),Promise.allSettled(p.map(y=>y(h)))},hasListeners:i,listeners:e,setEmitter:r,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:u}}function Aa(t,e,n){let o=t;do{if(o&&o.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function jp(t,e,n,o){var i,r;const a=new Map;for(const[l,u]of t)(u.selected||u.id===o)&&(!u.parentNode||!Na(u,t))&&(u.draggable||e&&typeof u.draggable>"u")&&t.get(l)&&a.set(l,{id:u.id,position:u.position||{x:0,y:0},distance:{x:n.x-((i=u.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=u.computedPosition)==null?void 0:r.y)||0},from:{x:u.computedPosition.x,y:u.computedPosition.y},extent:u.extent,parentNode:u.parentNode,dimensions:{...u.dimensions},expandParent:u.expandParent});return Array.from(a.values())}function nr({id:t,dragItems:e,findNode:n}){const o=[];for(const i of e){const r=n(i.id);r&&o.push(r)}return[t?o.find(i=>i.id===t):o[0],o]}function Pa(t){if(Array.isArray(t))switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return[0,0,0,0]}return[t,t,t,t]}function Gp(t,e,n){const[o,i,r,a]=typeof t!="string"?Pa(t.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function Wp(t,e,n,o){let i=t.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!t.expandParent)if(t.parentNode&&o&&t.dimensions.width&&t.dimensions.height){const r=Gp(i,t,o);r&&(i=r)}else e(new Ie(Ne.NODE_EXTENT_INVALID,t.id)),i=n;else if(Array.isArray(i)){const r=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[r,a,l,u]=Pa(i.padding),c=o?.computedPosition.x||0,d=o?.computedPosition.y||0;i=[[i.range[0][0]+c+u,i.range[0][1]+d+r],[i.range[1][0]+c-a,i.range[1][1]+d-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Yp({width:t,height:e},n){return[n[0],[n[1][0]-(t||0),n[1][1]-(e||0)]]}function or(t,e,n,o,i){const r=Yp(t.dimensions,Wp(t,n,o,i)),a=ma(e,r);return{position:{x:a.x-(i?.computedPosition.x||0),y:a.y-(i?.computedPosition.y||0)},computedPosition:a}}function Zt(t,e,n=ue.Left,o=!1){const i=(e?.x??0)+t.computedPosition.x,r=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??Kp(t);if(o)return{x:i+a/2,y:r+l/2};switch(e?.position??n){case ue.Top:return{x:i+a/2,y:r};case ue.Right:return{x:i+a,y:r+l/2};case ue.Bottom:return{x:i+a/2,y:r+l};case ue.Left:return{x:i,y:r+l/2}}}function Oa(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Up({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:l,viewport:u}){const c={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+i),y2:Math.max(t.y+o,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=wa({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:a/u.zoom,height:l/u.zoom}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*h)>0}function Xp(t,e,n=!1){const o=typeof t.zIndex=="number";let i=o?t.zIndex:0;const r=e(t.source),a=e(t.target);return!r||!a?0:(n&&(i=o?t.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var Ne=(t=>(t.MISSING_STYLES="MISSING_STYLES",t.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",t.NODE_INVALID="NODE_INVALID",t.NODE_NOT_FOUND="NODE_NOT_FOUND",t.NODE_MISSING_PARENT="NODE_MISSING_PARENT",t.NODE_TYPE_MISSING="NODE_TYPE_MISSING",t.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",t.EDGE_INVALID="EDGE_INVALID",t.EDGE_NOT_FOUND="EDGE_NOT_FOUND",t.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",t.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",t.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",t.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",t.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",t.EDGE_ORPHANED="EDGE_ORPHANED",t.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",t))(Ne||{});const Ra={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:t=>`Node is invalid
|
|
7
7
|
Node: ${t}`,NODE_NOT_FOUND:t=>`Node not found
|
|
8
8
|
Node: ${t}`,NODE_MISSING_PARENT:(t,e)=>`Node is missing a parent
|
|
9
9
|
Node: ${t}
|
|
@@ -23,6 +23,6 @@ Edge: ${t}
|
|
|
23
23
|
Source: ${e}
|
|
24
24
|
Target: ${n}`,EDGE_ORPHANED:t=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
25
25
|
Edge: ${t}`,EDGE_NOT_FOUND:t=>`Edge not found
|
|
26
|
-
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"},Ie=class extends Error{constructor(t,...e){var n;super((n=Sa[t])==null?void 0:n.call(Sa,...e)),this.name="VueFlowError",this.code=t,this.args=e}};function Wi(t){return"clientX"in t}function Lp(t){return"sourceEvent"in t}function at(t,e){const n=Wi(t);let o,i;return n?(o=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(o=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(o=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(o=0,i=0),{x:o-(e?.left??0),y:i-(e?.top??0)}}var ko=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Fp(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function No(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}var Gp=()=>!0;function Yi(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function jp(t,e,n){const o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const r of e.values())Eo(i,Co(r))>0&&o.push(r);return o}var Wp=250;function Yp(t,e,n,o){var i,r;let a=[],l=Number.POSITIVE_INFINITY;const d=jp(t,n,e+Wp);for(const c of d){const u=[...((i=c.handleBounds)==null?void 0:i.source)??[],...((r=c.handleBounds)==null?void 0:r.target)??[]];for(const f of u){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:h,y:p}=Qt(c,f,f.position,!0),g=Math.sqrt((h-t.x)**2+(p-t.y)**2);g>e||(g<l?(a=[{...f,x:h,y:p}],l=g):g===l&&a.push({...f,x:h,y:p}))}}if(!a.length)return null;if(a.length>1){const c=o.type==="source"?"target":"source";return a.find(u=>u.type===c)??a[0]}return a[0]}function ka(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:d,isValidConnection:c=Gp},u,f,h,p){const g=r==="target",m=e?a.querySelector(`.${l}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:w,y:I}=at(t),y=a.elementFromPoint(w,I),v=y?.classList.contains(`${l}-flow__handle`)?y:m,C={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const $=Na(void 0,v),z=v.getAttribute("data-nodeid"),W=v.getAttribute("data-handleid"),j=v.classList.contains("connectable"),D=v.classList.contains("connectableend");if(!z||!$)return C;const O={source:g?z:o,sourceHandle:g?W:i,target:g?o:z,targetHandle:g?i:W};C.connection=O,C.isValid=j&&D&&(n===gt.Strict?g&&$==="source"||!g&&$==="target":z!==o||W!==i)&&c(O,{nodes:f,edges:u,sourceNode:h(O.source),targetNode:h(O.target)}),C.toHandle=Da(z,$,W,p,n,!0)}return C}function Na(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function Up(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function Xp(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function Da(t,e,n,o,i,r=!1){var a,l,d;const c=o.get(t);if(!c)return null;const u=i===gt.Strict?(a=c.handleBounds)==null?void 0:a[e]:[...((l=c.handleBounds)==null?void 0:l.source)??[],...((d=c.handleBounds)==null?void 0:d.target)??[]],f=(n?u?.find(h=>h.id===n):u?.[0])??null;return f&&r?{...f,...Qt(c,f,f.position,!0)}:f}var Ui={[ce.Left]:ce.Right,[ce.Right]:ce.Left,[ce.Top]:ce.Bottom,[ce.Bottom]:ce.Top},qp=["production","prod"];function Pn(t,...e){Ta()&&console.warn(`[Vue Flow]: ${t}`,...e)}function Ta(){return!qp.includes(process.env.NODE_ENV||"")}function Ia(t,e,n,o,i){const r=e.querySelectorAll(`.vue-flow__handle.${t}`);return r?.length?Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...xo(a)}}):null}function Xi(t,e,n,o,i,r=!1,a){i.value=!1,t.selected?(r||t.selected&&e)&&(o([t]),(0,s.nextTick)(()=>{a.blur()})):n([t])}function Ne(t){return typeof(0,s.unref)(t)<"u"}function Kp(t,e,n,o){if(!t||!t.source||!t.target)return n(new Ie(ke.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let i;return Ct(t)?i=t:i={...t,id:aa(t)},i=ra(i,void 0,o),Tp(i,e)?!1:i}function Zp(t,e,n,o,i){if(!e.source||!e.target)return i(new Ie(ke.EDGE_INVALID,t.id)),!1;if(!n)return i(new Ie(ke.EDGE_NOT_FOUND,t.id)),!1;const{id:r,...a}=t;return{...a,id:o?aa(e):r,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function Ma(t,e,n){const o={},i=[];for(let r=0;r<t.length;++r){const a=t[r];if(!Rt(a)){n(new Ie(ke.NODE_INVALID,a?.id));continue}const l=kp(a,e(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=l}for(const r of i){const a=e(r.parentNode)||i.find(l=>l.id===r.parentNode);r.parentNode&&!a&&n(new Ie(ke.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Ba(t,e,n,o,i,r){let a=i;const l=o.get(a)||new Map;o.set(a,l.set(n,e)),a=`${i}-${t}`;const d=o.get(a)||new Map;if(o.set(a,d.set(n,e)),r){a=`${i}-${t}-${r}`;const c=o.get(a)||new Map;o.set(a,c.set(n,e))}}function qi(t,e,n){t.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=o,d={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:l},c=`${i}-${a}--${r}-${l}`;Ba("source",d,`${r}-${l}--${i}-${a}`,t,i,a),Ba("target",d,c,t,r,l)}}function za(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Ki(t,e,n,o,i,r,a,l){const d=[];for(const c of t){const u=Ct(c)?c:Kp(c,l,i,r);if(!u)continue;const f=n(u.source),h=n(u.target);if(!f||!h){i(new Ie(ke.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!f){i(new Ie(ke.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!h){i(new Ie(ke.EDGE_TARGET_MISSING,u.id,u.target));continue}if(e&&!e(u,{edges:l,nodes:a,sourceNode:f,targetNode:h})){i(new Ie(ke.EDGE_INVALID,u.id));continue}const p=o(u.id);d.push({...ra(u,p,r),sourceNode:f,targetNode:h})}return d}var Aa=Symbol("vueFlow"),Pa=Symbol("nodeId"),Oa=Symbol("nodeRef"),Jp=Symbol("edgeId"),Qp=Symbol("edgeRef"),Do=Symbol("slots");function $a(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:a,nodeDragThreshold:l,viewport:d,autoPanOnNodeDrag:c,autoPanSpeed:u,nodesDraggable:f,panBy:h,findNode:p,multiSelectionActive:g,nodesSelectionActive:m,selectNodesOnDrag:w,removeSelectedElements:I,addSelectedNodes:y,updateNodePositions:v,emits:C}=be(),{onStart:$,onDrag:z,onStop:W,onClick:j,el:D,disabled:O,id:H,selectable:S,dragHandle:Y}=t,b=(0,s.shallowRef)(!1);let B=[],_,x=null,T={x:void 0,y:void 0},P={x:0,y:0},L=null,M=!1,V=!1,F=0,G=!1;const X=ng(),J=({x:ee,y:ie})=>{T={x:ee,y:ie};let R=!1;if(B=B.map(E=>{const k={x:ee-E.distance.x,y:ie-E.distance.y},{computedPosition:A}=ji(E,n.value?No(k,o.value):k,C.error,a.value,E.parentNode?p(E.parentNode):void 0);return R=R||E.position.x!==A.x||E.position.y!==A.y,E.position=A,E}),V=V||R,!!R&&(v(B,!0,!0),b.value=!0,L)){const[E,k]=Gi({id:H,dragItems:B,findNode:p});z({event:L,node:E,nodes:k})}},U=()=>{if(!x)return;const[ee,ie]=ma(P,x,u.value);if(ee!==0||ie!==0){const R={x:(T.x??0)-ee/d.value.zoom,y:(T.y??0)-ie/d.value.zoom};h({x:ee,y:ie})&&J(R)}F=requestAnimationFrame(U)},Z=(ee,ie)=>{M=!0;const R=p(H);!w.value&&!g.value&&R&&(R.selected||I()),R&&(0,s.toValue)(S)&&w.value&&Xi(R,g.value,y,I,m,!1,ie);const E=X(ee.sourceEvent);if(T=E,B=Pp(r.value,f.value,E,H),B.length){const[k,A]=Gi({id:H,dragItems:B,findNode:p});$({event:ee.sourceEvent,node:k,nodes:A})}},te=(ee,ie)=>{var R;ee.sourceEvent.type==="touchmove"&&ee.sourceEvent.touches.length>1||(V=!1,l.value===0&&Z(ee,ie),T=X(ee.sourceEvent),x=((R=e.value)==null?void 0:R.getBoundingClientRect())||null,P=at(ee.sourceEvent,x))},oe=(ee,ie)=>{const R=X(ee.sourceEvent);if(!G&&M&&c.value&&(G=!0,U()),!M){const E=R.xSnapped-(T.x??0),k=R.ySnapped-(T.y??0);Math.sqrt(E*E+k*k)>l.value&&Z(ee,ie)}(T.x!==R.xSnapped||T.y!==R.ySnapped)&&B.length&&M&&(L=ee.sourceEvent,P=at(ee.sourceEvent,x),J(R))},ae=ee=>{let ie=!1;if(!M&&!b.value&&!g.value){const R=ee.sourceEvent,E=X(R),k=E.xSnapped-(T.x??0),A=E.ySnapped-(T.y??0),N=Math.sqrt(k*k+A*A);N!==0&&N<=l.value&&(j?.(R),ie=!0)}if(B.length&&!ie){V&&(v(B,!1,!1),V=!1);const[R,E]=Gi({id:H,dragItems:B,findNode:p});W({event:ee.sourceEvent,node:R,nodes:E})}B=[],b.value=!1,G=!1,M=!1,T={x:void 0,y:void 0},cancelAnimationFrame(F)};return(0,s.watch)([()=>(0,s.toValue)(O),D],([ee,ie],R,E)=>{if(ie){const k=Ze(ie);ee||(_=Sf().on("start",A=>te(A,ie)).on("drag",A=>oe(A,ie)).on("end",A=>ae(A)).filter(A=>{const N=A.target,Q=(0,s.toValue)(Y);return!A.button&&(!i.value||!Ca(N,`.${i.value}`,ie)&&(!Q||Ca(N,Q,ie)))}),k.call(_)),E(()=>{k.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),b}function eg(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),updateStart:le(),update:le(),updateEnd:le()}}function tg(t,e){const n=eg();return n.doubleClick.on(o=>{var i,r;e.edgeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.edgeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.edgeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.edgeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.edgeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.edgeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;e.edgeUpdateStart(o),(r=(i=t.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;e.edgeUpdate(o),(r=(i=t.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;e.edgeUpdateEnd(o),(r=(i=t.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function ng(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:o}=be();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},{x:l,y:d}=at(Lp(i)?i.sourceEvent:i,a),c=zn({x:l,y:d},t.value),{x:u,y:f}=n.value?No(c,e.value):c;return{xSnapped:u,ySnapped:f,...c}}}function To(){return!0}function Ra({handleId:t,nodeId:e,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:d,connectionMode:c,connectionRadius:u,connectOnClick:f,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:g,autoPanSpeed:m,findNode:w,panBy:I,startConnection:y,updateConnection:v,endConnection:C,emits:$,viewport:z,edges:W,nodes:j,isValidConnection:D,nodeLookup:O}=be();let H=null,S=!1,Y=null;function b(_){var x;const T=(0,s.toValue)(n)==="target",P=Wi(_),L=ia(_.target),M=_.currentTarget;if(M&&(P&&_.button===0||!P)){let V=function(re){R=at(re,ae),J=Yp(zn(R,z.value,!1,[1,1]),u.value,O.value,A),E||(k(),E=!0);const ne=ka(re,{handle:J,connectionMode:c.value,fromNodeId:(0,s.toValue)(e),fromHandleId:(0,s.toValue)(t),fromType:T?"target":"source",isValidConnection:X,doc:L,lib:"vue",flowId:l,nodeLookup:O.value},W.value,j.value,w,O.value);Y=ne.handleDomNode,H=ne.connection,S=Xp(!!J,ne.isValid);const de={...K,isValid:S,to:ne.toHandle&&S?Bn({x:ne.toHandle.x,y:ne.toHandle.y},z.value):R,toHandle:ne.toHandle,toPosition:S&&ne.toHandle?ne.toHandle.position:Ui[A.position],toNode:ne.toHandle?O.value.get(ne.toHandle.nodeId):null};if(S&&J&&K?.toHandle&&de.toHandle&&K.toHandle.type===de.toHandle.type&&K.toHandle.nodeId===de.toHandle.nodeId&&K.toHandle.id===de.toHandle.id&&K.to.x===de.to.x&&K.to.y===de.to.y)return;const ye=J??ne.toHandle;if(v(ye&&S?Bn({x:ye.x,y:ye.y},z.value):R,ye,Up(!!ye,S)),K=de,!J&&!S&&!Y)return Yi(ie);H&&H.source!==H.target&&Y&&(Yi(ie),ie=Y,Y.classList.add("connecting","vue-flow__handle-connecting"),Y.classList.toggle("valid",!!S),Y.classList.toggle("vue-flow__handle-valid",!!S))},F=function(re){"touches"in re&&re.touches.length>0||((J||Y)&&H&&S&&(r?r(re,H):$.connect(H)),$.connectEnd(re),i&&a?.(re),Yi(ie),cancelAnimationFrame(U),C(re),E=!1,S=!1,H=null,Y=null,L.removeEventListener("mousemove",V),L.removeEventListener("mouseup",F),L.removeEventListener("touchmove",V),L.removeEventListener("touchend",F))};const G=w((0,s.toValue)(e));let X=(0,s.toValue)(o)||D.value||To;!X&&G&&(X=(T?G.isValidSourcePos:G.isValidTargetPos)||To);let J,U=0;const{x:Z,y:te}=at(_),oe=Na((0,s.toValue)(i),M),ae=(x=d.value)==null?void 0:x.getBoundingClientRect();if(!ae||!oe)return;const ee=Da((0,s.toValue)(e),oe,(0,s.toValue)(t),O.value,c.value);if(!ee)return;let ie,R=at(_,ae),E=!1;const k=()=>{if(!g.value)return;const[re,ne]=ma(R,ae,m.value);I({x:re,y:ne}),U=requestAnimationFrame(k)},A={...ee,nodeId:(0,s.toValue)(e),type:oe,position:ee.position},N=O.value.get((0,s.toValue)(e)),Q={inProgress:!0,isValid:null,from:Qt(N,A,ce.Left,!0),fromHandle:A,fromPosition:A.position,fromNode:N,to:R,toHandle:null,toPosition:Ui[A.position],toNode:null};y({nodeId:(0,s.toValue)(e),id:(0,s.toValue)(t),type:oe,position:M?.getAttribute("data-handlepos")||ce.Top,...R},{x:Z-ae.left,y:te-ae.top}),$.connectStart({event:_,nodeId:(0,s.toValue)(e),handleId:(0,s.toValue)(t),handleType:oe});let K=Q;L.addEventListener("mousemove",V),L.addEventListener("mouseup",F),L.addEventListener("touchmove",V),L.addEventListener("touchend",F)}}function B(_){var x,T;if(!f.value)return;const P=(0,s.toValue)(n)==="target";if(!h.value){$.clickConnectStart({event:_,nodeId:(0,s.toValue)(e),handleId:(0,s.toValue)(t)}),y({nodeId:(0,s.toValue)(e),type:(0,s.toValue)(n),id:(0,s.toValue)(t),position:ce.Top,...at(_)},void 0,!0);return}let L=(0,s.toValue)(o)||D.value||To;const M=w((0,s.toValue)(e));if(!L&&M&&(L=(P?M.isValidSourcePos:M.isValidTargetPos)||To),M&&(typeof M.connectable>"u"?p.value:M.connectable)===!1)return;const V=ia(_.target),F=ka(_,{handle:{nodeId:(0,s.toValue)(e),id:(0,s.toValue)(t),type:(0,s.toValue)(n),position:ce.Top,...at(_)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:L,doc:V,lib:"vue",flowId:l,nodeLookup:O.value},W.value,j.value,w,O.value),G=((x=F.connection)==null?void 0:x.source)===((T=F.connection)==null?void 0:T.target);F.isValid&&F.connection&&!G&&$.connect(F.connection),$.clickConnectEnd(_),C(_,!0)}return{handlePointerDown:b,handleClick:B}}function og(){return(0,s.inject)(Pa,"")}function Ha(t){const e=t??og()??"",n=(0,s.inject)(Oa,(0,s.ref)(null)),{findNode:o,edges:i,emits:r}=be(),a=o(e);return a||r.error(new Ie(ke.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:a,parentNode:(0,s.computed)(()=>o(a.parentNode)),connectedEdges:(0,s.computed)(()=>ua([a],i.value))}}function ig(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),dragStart:le(),drag:le(),dragStop:le()}}function rg(t,e){const n=ig();return n.doubleClick.on(o=>{var i,r;e.nodeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.nodeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.nodeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.nodeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.nodeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.nodeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;e.nodeDragStart(o),(r=(i=t.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;e.nodeDrag(o),(r=(i=t.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;e.nodeDragStop(o),(r=(i=t.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Va(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:l}=be();return(d,c=!1)=>{const u=r.value?i.value[0]:5,f=r.value?i.value[1]:5,h=c?4:1,p=d.x*u*h,g=d.y*f*h,m=[];for(const w of t.value)if(w.draggable||a&&typeof w.draggable>"u"){const{position:I}=ji(w,{x:w.computedPosition.x+p,y:w.computedPosition.y+g},l.error,e.value,w.parentNode?o(w.parentNode):void 0);m.push({id:w.id,position:I,from:w.position,distance:{x:d.x,y:d.y},dimensions:w.dimensions})}n(m,!0,!1)}}var Io=.1,sg=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function St(){return Pn("Viewport not initialized yet."),Promise.resolve(!1)}var ag={zoomIn:St,zoomOut:St,zoomTo:St,fitView:St,setCenter:St,fitBounds:St,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:St,setTransform:St,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function lg(t){function e(o,i){return new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?En:fo).scaleBy(Zi(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(l=>{var d;const{x:c,y:u}=oa({x:-o,y:-i},t.translateExtent),f=Kt.translate(-c,-u).scale(r);t.d3Selection&&t.d3Zoom?(d=t.d3Zoom)==null||d.interpolate(a?.interpolate==="linear"?En:fo).transform(Zi(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),f):l(!1)})}return(0,s.computed)(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:o=>e(1.2,o),zoomOut:o=>e(1/1.2,o),zoomTo:(o,i)=>new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?En:fo).scaleTo(Zi(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)}),setViewport:(o,i)=>n(o.x,o.y,o.zoom,i),setTransform:(o,i)=>n(o.x,o.y,o.zoom,i),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(o={padding:Io,includeHiddenNodes:!1,duration:0})=>{var i,r;const a=[];for(const u of t.nodes)u.dimensions.width&&u.dimensions.height&&(o?.includeHiddenNodes||!u.hidden)&&(!((i=o.nodes)!=null&&i.length)||(r=o.nodes)!=null&&r.length&&o.nodes.includes(u.id))&&a.push(u);if(!a.length)return Promise.resolve(!1);const{x:l,y:d,zoom:c}=fa(ca(a),t.dimensions.width,t.dimensions.height,o.minZoom??t.minZoom,o.maxZoom??t.maxZoom,o.padding??Io);return n(l,d,c,o)},setCenter:(o,i,r)=>{const a=typeof r?.zoom<"u"?r.zoom:t.maxZoom;return n(t.dimensions.width/2-o*a,t.dimensions.height/2-i*a,a,r)},fitBounds:(o,i={padding:Io})=>{const{x:r,y:a,zoom:l}=fa(o,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,i.padding??Io);return n(r,a,l,i)},project:o=>zn(o,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:r}=t.vueFlowRef.getBoundingClientRect();return zn({x:o.x-i,y:o.y-r},t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:r}=t.vueFlowRef.getBoundingClientRect();return Bn({x:o.x+i,y:o.y+r},t.viewport)}return{x:0,y:0}}}:ag)}function Zi(t,e=0,n=sg,o=()=>{}){const i=typeof e=="number"&&e>0;return i||o(),i?t.transition().duration(e).ease(n).on("end",o):t}function cg(t,e,n){const o=(0,s.effectScope)(!0);return o.run(()=>{const i=()=>{o.run(()=>{let m,w,I=!!(n.nodes.value.length||n.edges.value.length);m=Wt([t.modelValue,()=>{var y,v;return(v=(y=t.modelValue)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setElements(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([y,v])=>{var C;(C=t.modelValue)!=null&&C.value&&Array.isArray(t.modelValue.value)&&(m?.pause(),t.modelValue.value=[...y,...v],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},r=()=>{o.run(()=>{let m,w,I=!!n.nodes.value.length;m=Wt([t.nodes,()=>{var y,v;return(v=(y=t.nodes)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setNodes(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.nodes,()=>n.nodes.value.length],([y])=>{var v;(v=t.nodes)!=null&&v.value&&Array.isArray(t.nodes.value)&&(m?.pause(),t.nodes.value=[...y],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},a=()=>{o.run(()=>{let m,w,I=!!n.edges.value.length;m=Wt([t.edges,()=>{var y,v;return(v=(y=t.edges)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setEdges(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.edges,()=>n.edges.value.length],([y])=>{var v;(v=t.edges)!=null&&v.value&&Array.isArray(t.edges.value)&&(m?.pause(),t.edges.value=[...y],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},l=()=>{o.run(()=>{(0,s.watch)(()=>e.maxZoom,()=>{e.maxZoom&&Ne(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},d=()=>{o.run(()=>{(0,s.watch)(()=>e.minZoom,()=>{e.minZoom&&Ne(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{(0,s.watch)(()=>e.translateExtent,()=>{e.translateExtent&&Ne(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{(0,s.watch)(()=>e.nodeExtent,()=>{e.nodeExtent&&Ne(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{(0,s.watch)(()=>e.applyDefault,()=>{Ne(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const m=async w=>{let I=w;typeof e.autoConnect=="function"&&(I=await e.autoConnect(w)),I!==!1&&n.addEdges([I])};(0,s.watch)(()=>e.autoConnect,()=>{Ne(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),(0,s.watch)(n.autoConnect,(w,I,y)=>{w?n.onConnect(m):n.hooks.value.connect.off(m),y(()=>{n.hooks.value.connect.off(m)})},{immediate:!0})})},p=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const w of Object.keys(e)){const I=w;if(!m.includes(I)){const y=(0,s.toRef)(()=>e[I]),v=n[I];(0,s.isRef)(v)&&o.run(()=>{(0,s.watch)(y,C=>{Ne(C)&&(v.value=C)},{immediate:!0})})}}};i(),r(),a(),d(),l(),c(),u(),f(),h(),p()}),()=>o.stop()}function dg(){return{edgesChange:le(),nodesChange:le(),nodeDoubleClick:le(),nodeClick:le(),nodeMouseEnter:le(),nodeMouseMove:le(),nodeMouseLeave:le(),nodeContextMenu:le(),nodeDragStart:le(),nodeDrag:le(),nodeDragStop:le(),nodesInitialized:le(),miniMapNodeClick:le(),miniMapNodeDoubleClick:le(),miniMapNodeMouseEnter:le(),miniMapNodeMouseMove:le(),miniMapNodeMouseLeave:le(),connect:le(),connectStart:le(),connectEnd:le(),clickConnectStart:le(),clickConnectEnd:le(),paneReady:le(),init:le(),move:le(),moveStart:le(),moveEnd:le(),selectionDragStart:le(),selectionDrag:le(),selectionDragStop:le(),selectionContextMenu:le(),selectionStart:le(),selectionEnd:le(),viewportChangeStart:le(),viewportChange:le(),viewportChangeEnd:le(),paneScroll:le(),paneClick:le(),paneContextMenu:le(),paneMouseEnter:le(),paneMouseMove:le(),paneMouseLeave:le(),edgeContextMenu:le(),edgeMouseEnter:le(),edgeMouseMove:le(),edgeMouseLeave:le(),edgeDoubleClick:le(),edgeClick:le(),edgeUpdateStart:le(),edgeUpdate:le(),edgeUpdateEnd:le(),updateNodeInternals:le(),error:le(t=>Pn(t.message))}}function ug(t,e){const n=(0,s.getCurrentInstance)();(0,s.onBeforeMount)(()=>{for(const[i,r]of Object.entries(e.value)){const a=l=>{t(i,l)};r.setEmitter(a),vn(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),vn(r.removeHasEmitListeners)}});function o(i){var r;const a=fg(i);return!!((r=n?.vnode.props)!=null&&r[a])}}function fg(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(o,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function La(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Vi.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Tn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Ot.Bezier,style:{}},connectionMode:gt.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:NaN,y:NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ko()?"Meta":"Control",zoomActivationKeyCode:ko()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:dg(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}var hg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function pg(t,e,n){const o=lg(t),i=R=>{const E=R??[];t.hooks.updateNodeInternals.trigger(E)},r=R=>Dp(R,t.nodes,t.edges),a=R=>Np(R,t.nodes,t.edges),l=R=>ua(R,t.edges),d=({id:R,type:E,nodeId:k})=>{var A;const N=R?`-${E}-${R}`:`-${E}`;return Array.from(((A=t.connectionLookup.get(`${k}${N}`))==null?void 0:A.values())??[])},c=R=>{if(R)return e.value.get(R)},u=R=>{if(R)return n.value.get(R)},f=(R,E,k)=>{var A,N;const Q=[];for(const K of R){const re={id:K.id,type:"position",dragging:k,from:K.from};if(E&&(re.position=K.position,K.parentNode)){const ne=c(K.parentNode);re.position={x:re.position.x-(((A=ne?.computedPosition)==null?void 0:A.x)??0),y:re.position.y-(((N=ne?.computedPosition)==null?void 0:N.y)??0)}}Q.push(re)}Q?.length&&t.hooks.nodesChange.trigger(Q)},h=R=>{if(!t.vueFlowRef)return;const E=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!E)return;const k=window.getComputedStyle(E),{m22:A}=new window.DOMMatrixReadOnly(k.transform),N=[];for(const Q of R){const K=Q,re=c(K.id);if(re){const ne=xo(K.nodeElement);if(ne.width&&ne.height&&(re.dimensions.width!==ne.width||re.dimensions.height!==ne.height||K.forceUpdate)){const de=K.nodeElement.getBoundingClientRect();re.dimensions=ne,re.handleBounds.source=Ia("source",K.nodeElement,de,A,re.id),re.handleBounds.target=Ia("target",K.nodeElement,de,A,re.id),N.push({id:re.id,type:"dimensions",dimensions:ne})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&o.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),N.length&&t.hooks.nodesChange.trigger(N)},p=(R,E)=>{const k=new Set,A=new Set;for(const K of R)Rt(K)?k.add(K.id):Ct(K)&&A.add(K.id);const N=xt(e.value,k,!0),Q=xt(n.value,A);if(t.multiSelectionActive){for(const K of k)N.push(Et(K,E));for(const K of A)Q.push(Et(K,E))}N.length&&t.hooks.nodesChange.trigger(N),Q.length&&t.hooks.edgesChange.trigger(Q)},g=R=>{if(t.multiSelectionActive){const E=R.map(k=>Et(k.id,!0));t.hooks.nodesChange.trigger(E);return}t.hooks.nodesChange.trigger(xt(e.value,new Set(R.map(E=>E.id)),!0)),t.hooks.edgesChange.trigger(xt(n.value))},m=R=>{if(t.multiSelectionActive){const E=R.map(k=>Et(k.id,!0));t.hooks.edgesChange.trigger(E);return}t.hooks.edgesChange.trigger(xt(n.value,new Set(R.map(E=>E.id)))),t.hooks.nodesChange.trigger(xt(e.value,new Set,!0))},w=R=>{p(R,!0)},I=R=>{const E=(R||t.nodes).map(k=>(k.selected=!1,Et(k.id,!1)));t.hooks.nodesChange.trigger(E)},y=R=>{const E=(R||t.edges).map(k=>(k.selected=!1,Et(k.id,!1)));t.hooks.edgesChange.trigger(E)},v=R=>{if(!R||!R.length)return p([],!1);const E=R.reduce((k,A)=>{const N=Et(A.id,!1);return Rt(A)?k.nodes.push(N):k.edges.push(N),k},{nodes:[],edges:[]});E.nodes.length&&t.hooks.nodesChange.trigger(E.nodes),E.edges.length&&t.hooks.edgesChange.trigger(E.edges)},C=R=>{var E;(E=t.d3Zoom)==null||E.scaleExtent([R,t.maxZoom]),t.minZoom=R},$=R=>{var E;(E=t.d3Zoom)==null||E.scaleExtent([t.minZoom,R]),t.maxZoom=R},z=R=>{var E;(E=t.d3Zoom)==null||E.translateExtent(R),t.translateExtent=R},W=R=>{t.nodeExtent=R,i()},j=R=>{var E;(E=t.d3Zoom)==null||E.clickDistance(R)},D=R=>{t.nodesDraggable=R,t.nodesConnectable=R,t.elementsSelectable=R},O=R=>{const E=R instanceof Function?R(t.nodes):R;!t.initialized&&!E.length||(t.nodes=Ma(E,c,t.hooks.error.trigger))},H=R=>{const E=R instanceof Function?R(t.edges):R;if(!t.initialized&&!E.length)return;const k=Ki(E,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);qi(t.connectionLookup,n.value,k),t.edges=k},S=R=>{const E=R instanceof Function?R([...t.nodes,...t.edges]):R;!t.initialized&&!E.length||(O(E.filter(Rt)),H(E.filter(Ct)))},Y=R=>{let E=R instanceof Function?R(t.nodes):R;E=Array.isArray(E)?E:[E];const k=Ma(E,c,t.hooks.error.trigger),A=[];for(const N of k)A.push(ya(N));A.length&&t.hooks.nodesChange.trigger(A)},b=R=>{let E=R instanceof Function?R(t.edges):R;E=Array.isArray(E)?E:[E];const k=Ki(E,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),A=[];for(const N of k)A.push(ya(N));A.length&&t.hooks.edgesChange.trigger(A)},B=(R,E=!0,k=!1)=>{const A=R instanceof Function?R(t.nodes):R,N=Array.isArray(A)?A:[A],Q=[],K=[];function re(de){const ye=l(de);for(const ve of ye)(!Ne(ve.deletable)||ve.deletable)&&K.push(wa(ve.id,ve.source,ve.target,ve.sourceHandle,ve.targetHandle))}function ne(de){const ye=[];for(const ve of t.nodes)ve.parentNode===de&&ye.push(ve);if(ye.length){for(const ve of ye)Q.push(_a(ve.id));E&&re(ye);for(const ve of ye)ne(ve.id)}}for(const de of N){const ye=typeof de=="string"?c(de):de;ye&&(Ne(ye.deletable)&&!ye.deletable||(Q.push(_a(ye.id)),E&&re([ye]),k&&ne(ye.id)))}K.length&&t.hooks.edgesChange.trigger(K),Q.length&&t.hooks.nodesChange.trigger(Q)},_=R=>{const E=R instanceof Function?R(t.edges):R,k=Array.isArray(E)?E:[E],A=[];for(const N of k){const Q=typeof N=="string"?u(N):N;Q&&(Ne(Q.deletable)&&!Q.deletable||A.push(wa(typeof N=="string"?N:N.id,Q.source,Q.target,Q.sourceHandle,Q.targetHandle)))}t.hooks.edgesChange.trigger(A)},x=(R,E,k=!0)=>{const A=u(R.id);if(!A)return!1;const N=t.edges.indexOf(A),Q=Zp(R,E,A,k,t.hooks.error.trigger);if(Q){const[K]=Ki([Q],t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((re,ne)=>ne===N?K:re),qi(t.connectionLookup,n.value,[K]),K}return!1},T=(R,E,k={replace:!1})=>{const A=u(R);if(!A)return;const N=typeof E=="function"?E(A):E;A.data=k.replace?N:{...A.data,...N}},P=R=>va(R,t.nodes),L=R=>{const E=va(R,t.edges);return qi(t.connectionLookup,n.value,E),E},M=(R,E,k={replace:!1})=>{const A=c(R);if(!A)return;const N=typeof E=="function"?E(A):E;k.replace?t.nodes.splice(t.nodes.indexOf(A),1,N):Object.assign(A,N)},V=(R,E,k={replace:!1})=>{const A=c(R);if(!A)return;const N=typeof E=="function"?E(A):E;A.data=k.replace?N:{...A.data,...N}},F=(R,E,k=!1)=>{k?t.connectionClickStartHandle=R:t.connectionStartHandle=R,t.connectionEndHandle=null,t.connectionStatus=null,E&&(t.connectionPosition=E)},G=(R,E=null,k=null)=>{t.connectionStartHandle&&(t.connectionPosition=R,t.connectionEndHandle=E,t.connectionStatus=k)},X=(R,E)=>{t.connectionPosition={x:NaN,y:NaN},t.connectionEndHandle=null,t.connectionStatus=null,E?t.connectionClickStartHandle=null:t.connectionStartHandle=null},J=R=>{const E=Sp(R),k=E?null:Mn(R)?R:c(R.id);return!E&&!k?[null,null,E]:[E?R:Co(k),k,E]},U=(R,E=!0,k=t.nodes)=>{const[A,N,Q]=J(R);if(!A)return[];const K=[];for(const re of k||t.nodes){if(!Q&&(re.id===N.id||!re.computedPosition))continue;const ne=Co(re),de=Eo(ne,A);(E&&de>0||de>=ne.width*ne.height||de>=Number(A.width)*Number(A.height))&&K.push(re)}return K},Z=(R,E,k=!0)=>{const[A]=J(R);if(!A)return!1;const N=Eo(A,E);return k&&N>0||N>=Number(A.width)*Number(A.height)},te=R=>{const{viewport:E,dimensions:k,d3Zoom:A,d3Selection:N,translateExtent:Q}=t;if(!A||!N||!R.x&&!R.y)return!1;const K=Kt.translate(E.x+R.x,E.y+R.y).scale(E.zoom),re=[[0,0],[k.width,k.height]],ne=A.constrain()(K,re,Q),de=t.viewport.x!==ne.x||t.viewport.y!==ne.y||t.viewport.zoom!==ne.k;return A.transform(N,ne),de},oe=R=>{const E=R instanceof Function?R(t):R,k=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ne(E.defaultEdgeOptions)&&(t.defaultEdgeOptions=E.defaultEdgeOptions);const A=E.modelValue||E.nodes||E.edges?[]:void 0;A&&(E.modelValue&&A.push(...E.modelValue),E.nodes&&A.push(...E.nodes),E.edges&&A.push(...E.edges),S(A));const N=()=>{Ne(E.maxZoom)&&$(E.maxZoom),Ne(E.minZoom)&&C(E.minZoom),Ne(E.translateExtent)&&z(E.translateExtent)};for(const Q of Object.keys(E)){const K=Q,re=E[K];![...hg,...k].includes(K)&&Ne(re)&&(t[K]=re)}_i(()=>t.d3Zoom).not.toBeNull().then(N),t.initialized||(t.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:h,setElements:S,setNodes:O,setEdges:H,addNodes:Y,addEdges:b,removeNodes:B,removeEdges:_,findNode:c,findEdge:u,updateEdge:x,updateEdgeData:T,updateNode:M,updateNodeData:V,applyEdgeChanges:L,applyNodeChanges:P,addSelectedElements:w,addSelectedNodes:g,addSelectedEdges:m,setMinZoom:C,setMaxZoom:$,setTranslateExtent:z,setNodeExtent:W,setPaneClickDistance:j,removeSelectedElements:v,removeSelectedNodes:I,removeSelectedEdges:y,startConnection:F,updateConnection:G,endConnection:X,setInteractive:D,setState:oe,getIntersectingNodes:U,getIncomers:r,getOutgoers:a,getConnectedEdges:l,getHandleConnections:d,isNodeIntersecting:Z,panBy:te,fitView:R=>o.value.fitView(R),zoomIn:R=>o.value.zoomIn(R),zoomOut:R=>o.value.zoomOut(R),zoomTo:(R,E)=>o.value.zoomTo(R,E),setViewport:(R,E)=>o.value.setViewport(R,E),setTransform:(R,E)=>o.value.setTransform(R,E),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(R,E,k)=>o.value.setCenter(R,E,k),fitBounds:(R,E)=>o.value.fitBounds(R,E),project:R=>o.value.project(R),screenToFlowCoordinate:R=>o.value.screenToFlowCoordinate(R),flowToScreenCoordinate:R=>o.value.flowToScreenCoordinate(R),toObject:()=>{const R=[],E=[];for(const k of t.nodes){const{computedPosition:A,handleBounds:N,selected:Q,dimensions:K,isParent:re,resizing:ne,dragging:de,events:ye,...ve}=k;R.push(ve)}for(const k of t.edges){const{selected:A,sourceNode:N,targetNode:Q,events:K,...re}=k;E.push(re)}return JSON.parse(JSON.stringify({nodes:R,edges:E,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:R=>new Promise(E=>{const{nodes:k,edges:A,position:N,zoom:Q,viewport:K}=R;k&&O(k),A&&H(A);const[re,ne]=K?.x&&K?.y?[K.x,K.y]:N??[null,null];if(re&&ne){const de=K?.zoom||Q||t.viewport.zoom;return _i(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:re,y:ne,zoom:de}).then(()=>{E(!0)})})}else E(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const R=La();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const E=Kt.translate(R.defaultViewport.x??0,R.defaultViewport.y??0).scale($t(R.defaultViewport.zoom??1,R.minZoom,R.maxZoom)),k=t.viewportRef.getBoundingClientRect(),A=[[0,0],[k.width,k.height]],N=t.d3Zoom.constrain()(E,A,R.translateExtent);t.d3Zoom.transform(t.d3Selection,N)}oe(R)},$destroy:()=>{}}}var gg=["data-id","data-handleid","data-nodeid","data-handlepos"],en=(0,s.defineComponent)({name:"Handle",compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>ce.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=(0,s.createPropsRestProxy)(t,["position","connectable","connectableStart","connectableEnd","id"]),o=(0,s.toRef)(()=>n.type??"source"),i=(0,s.toRef)(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:d,vueFlowRef:c,nodesConnectable:u,noDragClassName:f,noPanClassName:h}=be(),{id:p,node:g,nodeEl:m,connectedEdges:w}=Ha(),I=(0,s.ref)(),y=(0,s.toRef)(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),v=(0,s.toRef)(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),C=(0,s.toRef)(()=>{var H,S,Y,b,B,_;return((H=a.value)==null?void 0:H.nodeId)===p&&((S=a.value)==null?void 0:S.id)===t.id&&((Y=a.value)==null?void 0:Y.type)===o.value||((b=d.value)==null?void 0:b.nodeId)===p&&((B=d.value)==null?void 0:B.id)===t.id&&((_=d.value)==null?void 0:_.type)===o.value}),$=(0,s.toRef)(()=>{var H,S,Y;return((H=l.value)==null?void 0:H.nodeId)===p&&((S=l.value)==null?void 0:S.id)===t.id&&((Y=l.value)==null?void 0:Y.type)===o.value}),{handlePointerDown:z,handleClick:W}=Ra({nodeId:p,handleId:t.id,isValidConnection:i,type:o}),j=(0,s.computed)(()=>typeof t.connectable=="string"&&t.connectable==="single"?!w.value.some(H=>{const S=H[`${o.value}Handle`];return H[o.value]!==p?!1:S?S===t.id:!0}):typeof t.connectable=="number"?w.value.filter(H=>{const S=H[`${o.value}Handle`];return H[o.value]!==p?!1:S?S===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(g,w.value):Ne(t.connectable)?t.connectable:u.value);(0,s.onMounted)(()=>{var H;if(!g.dimensions.width||!g.dimensions.height)return;const S=(H=g.handleBounds[o.value])==null?void 0:H.find(P=>P.id===t.id);if(!c.value||S)return;const Y=c.value.querySelector(".vue-flow__transformationpane");if(!m.value||!I.value||!Y||!t.id)return;const b=m.value.getBoundingClientRect(),B=I.value.getBoundingClientRect(),_=window.getComputedStyle(Y),{m22:x}=new window.DOMMatrixReadOnly(_.transform),T={id:t.id,position:t.position,x:(B.left-b.left)/x,y:(B.top-b.top)/x,type:o.value,nodeId:p,...xo(I.value)};g.handleBounds[o.value]=[...g.handleBounds[o.value]??[],T]});function D(H){const S=Wi(H);j.value&&y.value&&(S&&H.button===0||!S)&&z(H)}function O(H){!p||!l.value&&!y.value||j.value&&W(H)}return e({handleClick:W,handlePointerDown:z,onClick:O,onPointerDown:D}),(H,S)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"handle",ref:I,"data-id":`${(0,s.unref)(r)}-${(0,s.unref)(p)}-${t.id}-${o.value}`,"data-handleid":t.id,"data-nodeid":(0,s.unref)(p),"data-handlepos":H.position,class:(0,s.normalizeClass)(["vue-flow__handle",[`vue-flow__handle-${H.position}`,`vue-flow__handle-${t.id}`,(0,s.unref)(f),(0,s.unref)(h),o.value,{connectable:j.value,connecting:$.value,connectablestart:y.value,connectableend:v.value,connectionindicator:j.value&&(y.value&&!C.value||v.value&&C.value)}]]),onMousedown:D,onTouchstartPassive:D,onClick:O},[(0,s.renderSlot)(H.$slots,"default",{id:H.id})],42,gg))}}),Mo=function({sourcePosition:t=ce.Bottom,targetPosition:e=ce.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const l=a.label??n;return[(0,s.h)(en,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?(0,s.h)(l):(0,s.h)(s.Fragment,[l]),(0,s.h)(en,{type:"source",position:t,connectable:o,isValidConnection:r})]};Mo.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Mo.inheritAttrs=!1,Mo.compatConfig={MODE:3};var mg=Mo,Bo=function({targetPosition:t=ce.Top,label:e,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??e;return[(0,s.h)(en,{type:"target",position:t,connectable:n,isValidConnection:o}),typeof r!="string"&&r?(0,s.h)(r):(0,s.h)(s.Fragment,[r])]};Bo.props=["targetPosition","label","isValidTargetPos","connectable","data"],Bo.inheritAttrs=!1,Bo.compatConfig={MODE:3};var vg=Bo,zo=function({sourcePosition:t=ce.Bottom,label:e,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??e;return[typeof r!="string"&&r?(0,s.h)(r):(0,s.h)(s.Fragment,[r]),(0,s.h)(en,{type:"source",position:t,connectable:n,isValidConnection:o})]};zo.props=["sourcePosition","label","isValidSourcePos","connectable","data"],zo.inheritAttrs=!1,zo.compatConfig={MODE:3};var yg=zo,_g=["transform"],wg=["width","height","x","y","rx","ry"],bg=["y"],Cg=(0,s.defineComponent)({name:"EdgeText",compatConfig:{MODE:3},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=(0,s.ref)({x:0,y:0,width:0,height:0}),n=(0,s.ref)(null),o=(0,s.computed)(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);(0,s.onMounted)(i),(0,s.watch)([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==e.value.width||r.height!==e.value.height)&&(e.value=r)}return(r,a)=>((0,s.openBlock)(),(0,s.createElementBlock)("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?((0,s.openBlock)(),(0,s.createElementBlock)("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*r.labelBgPadding[0]}px`,height:`${e.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:(0,s.normalizeStyle)(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,wg)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("text",(0,s.mergeProps)(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:r.labelStyle}),[(0,s.renderSlot)(r.$slots,"default",{},()=>[typeof r.label!="string"?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(r.label),{key:0})):((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createTextVNode)((0,s.toDisplayString)(r.label),1)],64))])],16,bg)],8,_g))}}),Eg=["id","d","marker-end","marker-start"],xg=["d","stroke-width"],On=(0,s.defineComponent)({name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=(0,s.ref)(null),o=(0,s.ref)(null),i=(0,s.ref)(null),r=(0,s.useAttrs)();return e({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)("path",(0,s.mergeProps)((0,s.unref)(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,Eg),a.interactionWidth?((0,s.openBlock)(),(0,s.createElementBlock)("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,xg)):(0,s.createCommentVNode)("",!0),a.label&&a.labelX&&a.labelY?((0,s.openBlock)(),(0,s.createBlock)(Cg,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):(0,s.createCommentVNode)("",!0)],64))}});function Fa({sourceX:t,sourceY:e,targetX:n,targetY:o}){const i=Math.abs(n-t)/2,r=n<t?n+i:n-i,a=Math.abs(o-e)/2;return[r,o<e?o+a:o-a,i,a]}function Ga({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const d=t*.125+i*.375+a*.375+n*.125,c=e*.125+r*.375+l*.375+o*.125;return[d,c,Math.abs(d-t),Math.abs(c-e)]}function Ao(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function ja({pos:t,x1:e,y1:n,x2:o,y2:i,c:r}){let a,l;switch(t){case ce.Left:a=e-Ao(e-o,r),l=n;break;case ce.Right:a=e+Ao(o-e,r),l=n;break;case ce.Top:a=e,l=n-Ao(n-i,r);break;case ce.Bottom:a=e,l=n+Ao(i-n,r);break}return[a,l]}function Ji(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top,curvature:l=.25}=t,[d,c]=ja({pos:o,x1:e,y1:n,x2:i,y2:r,c:l}),[u,f]=ja({pos:a,x1:i,y1:r,x2:e,y2:n,c:l}),[h,p,g,m]=Ga({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:d,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${n} C${d},${c} ${u},${f} ${i},${r}`,h,p,g,m]}function Wa({pos:t,x1:e,y1:n,x2:o,y2:i}){let r,a;switch(t){case ce.Left:case ce.Right:r=.5*(e+o),a=n;break;case ce.Top:case ce.Bottom:r=e,a=.5*(n+i);break}return[r,a]}function Ya(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top}=t,[l,d]=Wa({pos:o,x1:e,y1:n,x2:i,y2:r}),[c,u]=Wa({pos:a,x1:i,y1:r,x2:e,y2:n}),[f,h,p,g]=Ga({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:d,targetControlX:c,targetControlY:u});return[`M${e},${n} C${l},${d} ${c},${u} ${i},${r}`,f,h,p,g]}var Ua={[ce.Left]:{x:-1,y:0},[ce.Right]:{x:1,y:0},[ce.Top]:{x:0,y:-1},[ce.Bottom]:{x:0,y:1}};function Sg({source:t,sourcePosition:e=ce.Bottom,target:n}){return e===ce.Left||e===ce.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Xa(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function kg({source:t,sourcePosition:e=ce.Bottom,target:n,targetPosition:o=ce.Top,center:i,offset:r}){const a=Ua[e],l=Ua[o],d={x:t.x+a.x*r,y:t.y+a.y*r},c={x:n.x+l.x*r,y:n.y+l.y*r},u=Sg({source:d,sourcePosition:e,target:c}),f=u.x!==0?"x":"y",h=u[f];let p,g,m;const w={x:0,y:0},I={x:0,y:0},[y,v,C,$]=Fa({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){g=i.x??y,m=i.y??v;const z=[{x:g,y:d.y},{x:g,y:c.y}],W=[{x:d.x,y:m},{x:c.x,y:m}];a[f]===h?p=f==="x"?z:W:p=f==="x"?W:z}else{const z=[{x:d.x,y:c.y}],W=[{x:c.x,y:d.y}];if(f==="x"?p=a.x===h?W:z:p=a.y===h?z:W,e===o){const O=Math.abs(t[f]-n[f]);if(O<=r){const H=Math.min(r-1,r-O);a[f]===h?w[f]=(d[f]>t[f]?-1:1)*H:I[f]=(c[f]>n[f]?-1:1)*H}}if(e!==o){const O=f==="x"?"y":"x",H=a[f]===l[O],S=d[O]>c[O],Y=d[O]<c[O];(a[f]===1&&(!H&&S||H&&Y)||a[f]!==1&&(!H&&Y||H&&S))&&(p=f==="x"?z:W)}const j={x:d.x+w.x,y:d.y+w.y},D={x:c.x+I.x,y:c.y+I.y};Math.max(Math.abs(j.x-p[0].x),Math.abs(D.x-p[0].x))>=Math.max(Math.abs(j.y-p[0].y),Math.abs(D.y-p[0].y))?(g=(j.x+D.x)/2,m=p[0].y):(g=p[0].x,m=(j.y+D.y)/2)}return[[t,{x:d.x+w.x,y:d.y+w.y},...p,{x:c.x+I.x,y:c.y+I.y},n],g,m,C,$]}function Ng(t,e,n,o){const i=Math.min(Xa(t,e)/2,Xa(e,n)/2,o),{x:r,y:a}=e;if(t.x===r&&r===n.x||t.y===a&&a===n.y)return`L${r} ${a}`;if(t.y===a){const d=t.x<n.x?-1:1,c=t.y<n.y?1:-1;return`L ${r+i*d},${a}Q ${r},${a} ${r},${a+i*c}`}const l=t.x<n.x?1:-1;return`L ${r},${a+i*(t.y<n.y?-1:1)}Q ${r},${a} ${r+i*l},${a}`}function Qi(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top,borderRadius:l=5,centerX:d,centerY:c,offset:u=20}=t,[f,h,p,g,m]=kg({source:{x:e,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:d,y:c},offset:u});return[f.reduce((w,I,y)=>{let v;return y>0&&y<f.length-1?v=Ng(f[y-1],I,f[y+1],l):v=`${y===0?"M":"L"}${I.x} ${I.y}`,w+=v,w},""),h,p,g,m]}function Dg(t){const{sourceX:e,sourceY:n,targetX:o,targetY:i}=t,[r,a,l,d]=Fa({sourceX:e,sourceY:n,targetX:o,targetY:i});return[`M ${e},${n}L ${o},${i}`,r,a,l,d]}var Tg=(0,s.defineComponent)({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Dg(t);return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),qa=(0,s.defineComponent)({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Qi({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),Ig=(0,s.defineComponent)({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>(0,s.h)(qa,{...t,...e,borderRadius:0})}}),Mg=(0,s.defineComponent)({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Ji({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),Bg=(0,s.defineComponent)({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Ya({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),zg={input:yg,default:mg,output:vg},Ag={default:Mg,straight:Tg,step:Ig,smoothstep:qa,simplebezier:Bg};function Pg(t,e,n){const o=(0,s.computed)(()=>g=>e.value.get(g)),i=(0,s.computed)(()=>g=>n.value.get(g)),r=(0,s.computed)(()=>{const g={...Ag,...t.edgeTypes},m=Object.keys(g);for(const w of t.edges)w.type&&!m.includes(w.type)&&(g[w.type]=w.type);return g}),a=(0,s.computed)(()=>{const g={...zg,...t.nodeTypes},m=Object.keys(g);for(const w of t.nodes)w.type&&!m.includes(w.type)&&(g[w.type]=w.type);return g}),l=(0,s.computed)(()=>t.onlyRenderVisibleElements?da(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),d=(0,s.computed)(()=>{if(t.onlyRenderVisibleElements){const g=[];for(const m of t.edges){const w=e.value.get(m.source),I=e.value.get(m.target);Hp({sourcePos:w.computedPosition||{x:0,y:0},targetPos:I.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:I.dimensions.width,targetHeight:I.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&g.push(m)}return g}return t.edges}),c=(0,s.computed)(()=>[...l.value,...d.value]),u=(0,s.computed)(()=>{const g=[];for(const m of t.nodes)m.selected&&g.push(m);return g}),f=(0,s.computed)(()=>{const g=[];for(const m of t.edges)m.selected&&g.push(m);return g}),h=(0,s.computed)(()=>[...u.value,...f.value]),p=(0,s.computed)(()=>{const g=[];for(const m of t.nodes)m.dimensions.width&&m.dimensions.height&&m.handleBounds!==void 0&&g.push(m);return g});return{getNode:o,getEdge:i,getElements:c,getEdgeTypes:r,getNodeTypes:a,getEdges:d,getNodes:l,getSelectedElements:h,getSelectedNodes:u,getSelectedEdges:f,getNodesInitialized:p,areNodesInitialized:(0,s.computed)(()=>l.value.length>0&&p.value.length===l.value.length)}}var Og=class dn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=(0,s.getCurrentInstance)())==null?void 0:e.appContext.app;return dn.instance=n?.config.globalProperties.$vueFlowStorage??dn.instance??new dn,n&&(n.config.globalProperties.$vueFlowStorage=dn.instance),dn.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const o=(0,s.reactive)(La()),i={};for(const[f,h]of Object.entries(o.hooks)){const p=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;i[p]=h.on}const r={};for(const[f,h]of Object.entries(o.hooks))r[f]=h.trigger;const a=(0,s.computed)(()=>{const f=new Map;for(const h of o.nodes)f.set(h.id,h);return f}),l=(0,s.computed)(()=>{const f=new Map;for(const h of o.edges)f.set(h.id,h);return f}),d=Pg(o,a,l),c=pg(o,a,l);c.setState({...o,...n});const u={...i,...d,...c,...zd(o),nodeLookup:a,edgeLookup:l,emits:r,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,u),u}getId(){return`vue-flow-${this.currentId++}`}};function be(t){const e=Og.getInstance(),n=(0,s.getCurrentScope)(),o=typeof t=="object",i=o?t:{id:t},r=i.id,a=r??n?.vueFlowId;let l;if(n){const d=(0,s.inject)(Aa,null);typeof d<"u"&&d!==null&&(!a||d.id===a)&&(l=d)}if(l||a&&(l=e.get(a)),!l||a&&l.id!==a){const d=r??e.getId(),c=e.create(d,i);l=c,(n??(0,s.effectScope)(!0)).run(()=>{(0,s.watch)(c.applyDefault,(u,f,h)=>{const p=m=>{c.applyNodeChanges(m)},g=m=>{c.applyEdgeChanges(m)};u?(c.onNodesChange(p),c.onEdgesChange(g)):(c.hooks.value.nodesChange.off(p),c.hooks.value.edgesChange.off(g)),h(()=>{c.hooks.value.nodesChange.off(p),c.hooks.value.edgesChange.off(g)})},{immediate:!0}),vn(()=>{if(l){const u=e.get(l.id);u?u.$destroy():Pn(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&((0,s.provide)(Aa,l),n.vueFlowId=l.id),o){const d=(0,s.getCurrentInstance)();d?.type.name!=="VueFlow"&&l.emits.error(new Ie(ke.USEVUEFLOW_OPTIONS))}return l}function $g(t){const{emits:e,dimensions:n}=be();let o;(0,s.onMounted)(()=>{const i=()=>{var r,a;if(!t.value||!(((a=(r=t.value).checkVisibility)==null?void 0:a.call(r))??!0))return;const l=xo(t.value);(l.width===0||l.height===0)&&e.error(new Ie(ke.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),t.value&&(o=new ResizeObserver(()=>i()),o.observe(t.value)),(0,s.onBeforeUnmount)(()=>{window.removeEventListener("resize",i),o&&t.value&&o.unobserve(t.value)})})}var Rg=(0,s.defineComponent)({name:"UserSelection",compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"vue-flow__selection vue-flow__container",style:(0,s.normalizeStyle)({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Hg=["tabIndex"],Vg=(0,s.defineComponent)({name:"NodesSelection",compatConfig:{MODE:3},setup(t){const{emits:e,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=be(),l=Va(),d=(0,s.ref)(null),c=$a({el:d,onStart(g){e.selectionDragStart(g),e.nodeDragStart(g)},onDrag(g){e.selectionDrag(g),e.nodeDrag(g)},onStop(g){e.selectionDragStop(g),e.nodeDragStop(g)}});(0,s.onMounted)(()=>{var g;r.value||(g=d.value)==null||g.focus({preventScroll:!0})});const u=(0,s.computed)(()=>ca(o.value)),f=(0,s.computed)(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function h(g){e.selectionContextMenu({event:g,nodes:o.value})}function p(g){r.value||Zt[g.key]&&(g.preventDefault(),l({x:Zt[g.key].x,y:Zt[g.key].y},g.shiftKey))}return(g,m)=>!(0,s.unref)(a)&&u.value.width&&u.value.height?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:(0,s.normalizeClass)(["vue-flow__nodesselection vue-flow__container",(0,s.unref)(i)]),style:(0,s.normalizeStyle)({transform:`translate(${(0,s.unref)(n).x}px,${(0,s.unref)(n).y}px) scale(${(0,s.unref)(n).zoom})`})},[(0,s.createElementVNode)("div",{ref_key:"el",ref:d,class:(0,s.normalizeClass)([{dragging:(0,s.unref)(c)},"vue-flow__nodesselection-rect"]),style:(0,s.normalizeStyle)(f.value),tabIndex:(0,s.unref)(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,Hg)],6)):(0,s.createCommentVNode)("",!0)}});function Lg(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}var Fg=(0,s.defineComponent)({name:"Pane",compatConfig:{MODE:3},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:d,nodesSelectionActive:c,getSelectedEdges:u,getSelectedNodes:f,removeNodes:h,removeEdges:p,selectionMode:g,deleteKeyCode:m,multiSelectionKeyCode:w,multiSelectionActive:I,edgeLookup:y,nodeLookup:v,connectionLookup:C,defaultEdgeOptions:$,connectionStartHandle:z,panOnDrag:W}=be(),j=(0,s.shallowRef)(null),D=(0,s.shallowRef)(new Set),O=(0,s.shallowRef)(new Set),H=(0,s.shallowRef)(null),S=(0,s.toRef)(()=>d.value&&(t.isSelecting||r.value)),Y=(0,s.toRef)(()=>z.value!==null);let b=!1,B=!1;const _=In(m,{actInsideInputWithModifier:!1}),x=In(w);(0,s.watch)(_,X=>{X&&(h(f.value),p(u.value),c.value=!1)}),(0,s.watch)(x,X=>{I.value=X});function T(X,J){return U=>{U.target===J&&X?.(U)}}function P(X){if(b||Y.value){b=!1;return}i.paneClick(X),a(),c.value=!1}function L(X){var J;if(Array.isArray(W.value)&&((J=W.value)!=null&&J.includes(2))){X.preventDefault();return}i.paneContextMenu(X)}function M(X){i.paneScroll(X)}function V(X){var J,U,Z;if(H.value=((J=e.value)==null?void 0:J.getBoundingClientRect())??null,!d.value||!t.isSelecting||X.button!==0||X.target!==j.value||!H.value)return;(Z=(U=X.target)==null?void 0:U.setPointerCapture)==null||Z.call(U,X.pointerId);const{x:te,y:oe}=Lg(X,H.value);B=!0,b=!1,a(),l.value={width:0,height:0,startX:te,startY:oe,x:te,y:oe},i.selectionStart(X)}function F(X){var J;if(!H.value||!l.value)return;b=!0;const{x:U,y:Z}=at(X,H.value),{startX:te=0,startY:oe=0}=l.value,ae={startX:te,startY:oe,x:U<te?U:te,y:Z<oe?Z:oe,width:Math.abs(U-te),height:Math.abs(Z-oe)},ee=D.value,ie=O.value;D.value=new Set(da(n.value,ae,o.value,g.value===Vi.Partial,!0).map(E=>E.id)),O.value=new Set;const R=((J=$.value)==null?void 0:J.selectable)??!0;for(const E of D.value){const k=C.value.get(E);if(k)for(const{edgeId:A}of k.values()){const N=y.value.get(A);N&&(N.selectable??R)&&O.value.add(A)}}if(!za(ee,D.value)){const E=xt(v.value,D.value,!0);i.nodesChange(E)}if(!za(ie,O.value)){const E=xt(y.value,O.value);i.edgesChange(E)}l.value=ae,r.value=!0,c.value=!1}function G(X){var J;X.button!==0||!B||((J=X.target)==null||J.releasePointerCapture(X.pointerId),!r.value&&l.value&&X.target===j.value&&P(X),r.value=!1,l.value=null,c.value=D.value.size>0,i.selectionEnd(X),t.selectionKeyPressed&&(b=!1),B=!1)}return(X,J)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"container",ref:j,class:(0,s.normalizeClass)(["vue-flow__pane vue-flow__container",{selection:X.isSelecting}]),onClick:J[0]||(J[0]=U=>S.value?void 0:T(P,j.value)(U)),onContextmenu:J[1]||(J[1]=U=>T(L,j.value)(U)),onWheelPassive:J[2]||(J[2]=U=>T(M,j.value)(U)),onPointerenter:J[3]||(J[3]=U=>S.value?void 0:(0,s.unref)(i).paneMouseEnter(U)),onPointerdown:J[4]||(J[4]=U=>S.value?V(U):(0,s.unref)(i).paneMouseMove(U)),onPointermove:J[5]||(J[5]=U=>S.value?F(U):(0,s.unref)(i).paneMouseMove(U)),onPointerup:J[6]||(J[6]=U=>S.value?G(U):void 0),onPointerleave:J[7]||(J[7]=U=>(0,s.unref)(i).paneMouseLeave(U))},[(0,s.renderSlot)(X.$slots,"default"),(0,s.unref)(r)&&(0,s.unref)(l)?((0,s.openBlock)(),(0,s.createBlock)(Rg,{key:0,"user-selection-rect":(0,s.unref)(l)},null,8,["user-selection-rect"])):(0,s.createCommentVNode)("",!0),(0,s.unref)(c)&&(0,s.unref)(f).length?((0,s.openBlock)(),(0,s.createBlock)(Vg,{key:1})):(0,s.createCommentVNode)("",!0)],34))}}),Gg=(0,s.defineComponent)({name:"Transform",compatConfig:{MODE:3},setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:o}=be(),i=(0,s.computed)(()=>n.value?!o.value:!1),r=(0,s.computed)(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"vue-flow__transformationpane vue-flow__container",style:(0,s.normalizeStyle)({transform:r.value,opacity:i.value?0:void 0})},[(0,s.renderSlot)(a.$slots,"default")],4))}}),jg=(0,s.defineComponent)({name:"Viewport",compatConfig:{MODE:3},setup(t){const{minZoom:e,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:d,panOnScrollMode:c,panOnScrollSpeed:u,panOnDrag:f,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:g,preventScrolling:m,noWheelClassName:w,noPanClassName:I,emits:y,connectionStartHandle:v,userSelectionActive:C,paneDragging:$,d3Zoom:z,d3Selection:W,d3ZoomHandler:j,viewport:D,viewportRef:O,paneClickDistance:H}=be();$g(O);const S=(0,s.shallowRef)(!1),Y=(0,s.shallowRef)(!1);let b=null,B=!1,_=0,x={x:0,y:0,zoom:0};const T=In(l),P=In(a),L=In(r),M=(0,s.toRef)(()=>(!P.value||P.value&&a.value===!0)&&(T.value||f.value)),V=(0,s.toRef)(()=>T.value||d.value),F=(0,s.toRef)(()=>a.value===!0&&M.value!==!0),G=(0,s.toRef)(()=>P.value&&a.value!==!0||C.value||F.value),X=(0,s.toRef)(()=>v.value!==null);(0,s.onMounted)(()=>{if(!O.value){Pn("Viewport element is missing");return}const oe=O.value,ae=oe.getBoundingClientRect(),ee=yp().clickDistance(H.value).scaleExtent([e.value,n.value]).translateExtent(i.value),ie=Ze(oe).call(ee),R=ie.on("wheel.zoom"),E=Kt.translate(o.value.x??0,o.value.y??0).scale($t(o.value.zoom??1,e.value,n.value)),k=[[0,0],[ae.width,ae.height]],A=ee.constrain()(E,k,i.value);ee.transform(ie,A),ee.wheelDelta(pa),z.value=ee,W.value=ie,j.value=R,D.value={x:A.x,y:A.y,zoom:A.k},ee.on("start",N=>{var Q;if(!N.sourceEvent)return null;_=N.sourceEvent.button,S.value=!0;const K=Z(N.transform);((Q=N.sourceEvent)==null?void 0:Q.type)==="mousedown"&&($.value=!0),x=K,y.viewportChangeStart(K),y.moveStart({event:N,flowTransform:K})}),ee.on("end",N=>{if(!N.sourceEvent)return null;if(S.value=!1,$.value=!1,J(M.value,_??0)&&!B&&y.paneContextMenu(N.sourceEvent),B=!1,U(x,N.transform)){const Q=Z(N.transform);x=Q,y.viewportChangeEnd(Q),y.moveEnd({event:N,flowTransform:Q})}}),ee.filter(N=>{var Q;const K=L.value||g.value,re=p.value&&N.ctrlKey,ne=N.button,de=N.type==="wheel";if(ne===1&&N.type==="mousedown"&&(te(N,"vue-flow__node")||te(N,"vue-flow__edge")))return!0;if(!M.value&&!K&&!V.value&&!h.value&&!p.value||C.value||X.value&&!de||!h.value&&N.type==="dblclick"||te(N,w.value)&&de||te(N,I.value)&&(!de||V.value&&de&&!L.value)||!p.value&&N.ctrlKey&&de||!K&&!V.value&&!re&&de)return!1;if(!p&&N.type==="touchstart"&&((Q=N.touches)==null?void 0:Q.length)>1)return N.preventDefault(),!1;if(!M.value&&(N.type==="mousedown"||N.type==="touchstart")||F.value&&Array.isArray(f.value)&&f.value.includes(0)&&ne===0||Array.isArray(f.value)&&!f.value.includes(ne)&&(N.type==="mousedown"||N.type==="touchstart"))return!1;const ye=Array.isArray(f.value)&&f.value.includes(ne)||a.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!ne||ne<=1;return(!N.ctrlKey||T.value||de)&&ye}),(0,s.watch)([C,M],()=>{C.value&&!S.value?ee.on("zoom",null):C.value||ee.on("zoom",N=>{D.value={x:N.transform.x,y:N.transform.y,zoom:N.transform.k};const Q=Z(N.transform);B=J(M.value,_??0),y.viewportChange(Q),y.move({event:N,flowTransform:Q})})},{immediate:!0}),(0,s.watch)([C,V,c,L,p,m,w],()=>{V.value&&!L.value&&!C.value?ie.on("wheel.zoom",N=>{if(te(N,w.value))return!1;const Q=L.value||g.value,K=p.value&&N.ctrlKey;if(!(!m.value||V.value||Q||K))return!1;N.preventDefault(),N.stopImmediatePropagation();const re=ie.property("__zoom").k||1,ne=ko();if(!T.value&&N.ctrlKey&&p.value&&ne){const dt=ot(N),Tt=re*2**pa(N);ee.scaleTo(ie,Tt,dt,N);return}const de=N.deltaMode===1?20:1;let ye=c.value===Tn.Vertical?0:N.deltaX*de,ve=c.value===Tn.Horizontal?0:N.deltaY*de;!ne&&N.shiftKey&&c.value!==Tn.Vertical&&!ye&&ve&&(ye=ve,ve=0),ee.translateBy(ie,-(ye/re)*u.value,-(ve/re)*u.value);const me=Z(ie.property("__zoom"));b&&clearTimeout(b),Y.value?(y.move({event:N,flowTransform:me}),y.viewportChange(me),b=setTimeout(()=>{y.moveEnd({event:N,flowTransform:me}),y.viewportChangeEnd(me),Y.value=!1},150)):(Y.value=!0,y.moveStart({event:N,flowTransform:me}),y.viewportChangeStart(me))},{passive:!1}):typeof R<"u"&&ie.on("wheel.zoom",function(N,Q){const K=!m.value&&N.type==="wheel"&&!N.ctrlKey,re=L.value||g.value,ne=p.value&&N.ctrlKey;if(!re&&!d.value&&!ne&&N.type==="wheel"||K||te(N,w.value))return null;N.preventDefault(),R.call(this,N,Q)},{passive:!1})},{immediate:!0})});function J(oe,ae){return ae===2&&Array.isArray(oe)&&oe.includes(2)}function U(oe,ae){return oe.x!==ae.x&&!Number.isNaN(ae.x)||oe.y!==ae.y&&!Number.isNaN(ae.y)||oe.zoom!==ae.k&&!Number.isNaN(ae.k)}function Z(oe){return{x:oe.x,y:oe.y,zoom:oe.k}}function te(oe,ae){return oe.target.closest(`.${ae}`)}return(oe,ae)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[(0,s.createVNode)(Fg,{"is-selecting":G.value,"selection-key-pressed":(0,s.unref)(P),class:(0,s.normalizeClass)({connecting:X.value,dragging:(0,s.unref)($),draggable:(0,s.unref)(f)===!0||Array.isArray((0,s.unref)(f))&&(0,s.unref)(f).includes(0)})},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(Gg,null,{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(oe.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Wg=["id"],Yg=["id"],Ug=["id"],Xg=(0,s.defineComponent)({name:"A11yDescriptions",compatConfig:{MODE:3},setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:o}=be();return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)("div",{id:`${(0,s.unref)(ea)}-${(0,s.unref)(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+(0,s.toDisplayString)((0,s.unref)(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Wg),(0,s.createElementVNode)("div",{id:`${(0,s.unref)(ta)}-${(0,s.unref)(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Yg),(0,s.unref)(n)?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,id:`${(0,s.unref)(xp)}-${(0,s.unref)(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},(0,s.toDisplayString)((0,s.unref)(o)),9,Ug))],64))}});function qg(){const t=be();(0,s.watch)(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function Kg(t,e,n){return n===ce.Left?t-e:n===ce.Right?t+e:t}function Zg(t,e,n){return n===ce.Top?t-e:n===ce.Bottom?t+e:t}var er=function({radius:t=10,centerX:e=0,centerY:n=0,position:o=ce.Top,type:i}){return(0,s.h)("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Kg(e,t,o),cy:Zg(n,t,o),r:t,stroke:"transparent",fill:"transparent"})};er.props=["radius","centerX","centerY","position","type"],er.compatConfig={MODE:3};var Ka=er,Jg=(0,s.defineComponent)({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:d,removeSelectedEdges:c,findEdge:u,findNode:f,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:g,elementsSelectable:m,edgesUpdatable:w,edgesFocusable:I,hooks:y}=be(),v=(0,s.computed)(()=>u(t.id)),{emit:C,on:$}=tg(v.value,r),z=(0,s.inject)(Do),W=(0,s.getCurrentInstance)(),j=(0,s.ref)(!1),D=(0,s.ref)(!1),O=(0,s.ref)(""),H=(0,s.ref)(null),S=(0,s.ref)("source"),Y=(0,s.ref)(null),b=(0,s.toRef)(()=>typeof v.value.selectable>"u"?m.value:v.value.selectable),B=(0,s.toRef)(()=>typeof v.value.updatable>"u"?w.value:v.value.updatable),_=(0,s.toRef)(()=>typeof v.value.focusable>"u"?I.value:v.value.focusable);(0,s.provide)(Jp,t.id),(0,s.provide)(Qp,Y);const x=(0,s.computed)(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),T=(0,s.computed)(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),P=(0,s.computed)(()=>{const E=v.value.type||"default",k=z?.[`edge-${E}`];if(k)return k;let A=v.value.template??d.value[E];if(typeof A=="string"&&W){const N=Object.keys(W.appContext.components);N&&N.includes(E)&&(A=(0,s.resolveComponent)(E,!1))}return A&&typeof A!="string"?A:(r.error(new Ie(ke.EDGE_TYPE_MISSING,A)),!1)}),{handlePointerDown:L}=Ra({nodeId:O,handleId:H,type:S,isValidConnection:h,edgeUpdaterType:S,onEdgeUpdate:F,onEdgeUpdateEnd:G});return()=>{const E=f(v.value.source),k=f(v.value.target),A="pathOptions"in v.value?v.value.pathOptions:{};if(!E&&!k)return r.error(new Ie(ke.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!E)return r.error(new Ie(ke.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!k)return r.error(new Ie(ke.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||E.hidden||k.hidden)return null;let N;o.value===gt.Strict?N=E.handleBounds.source:N=[...E.handleBounds.source||[],...E.handleBounds.target||[]];const Q=xa(N,v.value.sourceHandle);let K;o.value===gt.Strict?K=k.handleBounds.target:K=[...k.handleBounds.target||[],...k.handleBounds.source||[]];const re=xa(K,v.value.targetHandle),ne=Q?.position||ce.Bottom,de=re?.position||ce.Top,{x:ye,y:ve}=Qt(E,Q,ne),{x:me,y:dt}=Qt(k,re,de);return v.value.sourceX=ye,v.value.sourceY=ve,v.value.targetX=me,v.value.targetY=dt,(0,s.h)("g",{ref:Y,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${P.value===!1?"default":v.value.type||"default"}`,l.value,x.value,{updating:j.value,selected:v.value.selected,animated:v.value.animated,inactive:!b.value&&!y.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":v.value.ariaLabel===null?void 0:v.value.ariaLabel??`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":_.value?`${ta}-${e}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...v.value.domAttributes,onClick:J,onContextmenu:U,onDblclick:Z,onMouseenter:te,onMousemove:oe,onMouseleave:ae,onKeyDown:_.value?R:void 0},[D.value?null:(0,s.h)(P.value===!1?d.value.default:P.value,{id:t.id,sourceNode:E,targetNode:k,source:v.value.source,target:v.value.target,type:v.value.type,updatable:B.value,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...$},style:T.value,markerStart:`url('#${An(v.value.markerStart,e)}')`,markerEnd:`url('#${An(v.value.markerEnd,e)}')`,sourcePosition:ne,targetPosition:de,sourceX:ye,sourceY:ve,targetX:me,targetY:dt,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...A}),[B.value==="source"||B.value===!0?[(0,s.h)("g",{onMousedown:ee,onMouseenter:M,onMouseout:V},(0,s.h)(Ka,{position:ne,centerX:ye,centerY:ve,radius:i.value,type:"source","data-type":"source"}))]:null,B.value==="target"||B.value===!0?[(0,s.h)("g",{onMousedown:ie,onMouseenter:M,onMouseout:V},(0,s.h)(Ka,{position:de,centerX:me,centerY:dt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function M(){j.value=!0}function V(){j.value=!1}function F(E,k){C.update({event:E,edge:v.value,connection:k})}function G(E){C.updateEnd({event:E,edge:v.value}),D.value=!1}function X(E,k){E.button===0&&(D.value=!0,O.value=k?v.value.target:v.value.source,H.value=(k?v.value.targetHandle:v.value.sourceHandle)??null,S.value=k?"target":"source",C.updateStart({event:E,edge:v.value}),L(E))}function J(E){var k;const A={event:E,edge:v.value};b.value&&(a.value=!1,v.value.selected&&p.value?(c([v.value]),(k=Y.value)==null||k.blur()):n([v.value])),C.click(A)}function U(E){C.contextMenu({event:E,edge:v.value})}function Z(E){C.doubleClick({event:E,edge:v.value})}function te(E){C.mouseEnter({event:E,edge:v.value})}function oe(E){C.mouseMove({event:E,edge:v.value})}function ae(E){C.mouseLeave({event:E,edge:v.value})}function ee(E){X(E,!0)}function ie(E){X(E,!1)}function R(E){var k;!g.value&&na.includes(E.key)&&b.value&&(E.key==="Escape"?((k=Y.value)==null||k.blur(),c([u(t.id)])):n([u(t.id)]))}}}),Qg=(0,s.defineComponent)({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:d,connectionStatus:c,viewport:u,findNode:f}=be(),h=(t=(0,s.inject)(Do))==null?void 0:t["connection-line"],p=(0,s.computed)(()=>{var y;return f((y=o.value)==null?void 0:y.nodeId)}),g=(0,s.computed)(()=>{var y;return f((y=i.value)==null?void 0:y.nodeId)??null}),m=(0,s.computed)(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),w=(0,s.computed)(()=>d.value.markerStart?`url(#${An(d.value.markerStart,e)})`:""),I=(0,s.computed)(()=>d.value.markerEnd?`url(#${An(d.value.markerEnd,e)})`:"");return()=>{var y,v,C;if(!p.value||!o.value)return null;const $=o.value.id,z=o.value.type,W=p.value.handleBounds;let j=W?.[z]??[];if(n.value===gt.Loose){const T=W?.[z==="source"?"target":"source"]??[];j=[...j,...T]}if(!j)return null;const D=($?j.find(T=>T.id===$):j[0])??null,O=D?.position??ce.Top,{x:H,y:S}=Qt(p.value,D,O);let Y=null;g.value&&(n.value===gt.Strict?Y=((y=g.value.handleBounds[z==="source"?"target":"source"])==null?void 0:y.find(T=>{var P;return T.id===((P=i.value)==null?void 0:P.id)}))||null:Y=((v=[...g.value.handleBounds.source??[],...g.value.handleBounds.target??[]])==null?void 0:v.find(T=>{var P;return T.id===((P=i.value)==null?void 0:P.id)}))||null);const b=((C=i.value)==null?void 0:C.position)??(O?Ui[O]:null);if(!O||!b)return null;const B=a.value??d.value.type??Ot.Bezier;let _="";const x={sourceX:H,sourceY:S,sourcePosition:O,targetX:m.value.x,targetY:m.value.y,targetPosition:b};return B===Ot.Bezier?[_]=Ji(x):B===Ot.Step?[_]=Qi({...x,borderRadius:0}):B===Ot.SmoothStep?[_]=Qi(x):B===Ot.SimpleBezier?[_]=Ya(x):_=`M${H},${S} ${m.value.x},${m.value.y}`,(0,s.h)("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},(0,s.h)("g",{class:"vue-flow__connection"},h?(0,s.h)(h,{sourceX:H,sourceY:S,sourcePosition:O,targetX:m.value.x,targetY:m.value.y,targetPosition:b,sourceNode:p.value,sourceHandle:D,targetNode:g.value,targetHandle:Y,markerEnd:I.value,markerStart:w.value,connectionStatus:c.value}):(0,s.h)("path",{d:_,class:[d.value.class,c.value,"vue-flow__connection-path"],style:{...l.value,...d.value.style},"marker-end":I.value,"marker-start":w.value})))}}}),em=["id","markerWidth","markerHeight","markerUnits","orient"],tm=(0,s.defineComponent)({name:"MarkerType",compatConfig:{MODE:3},props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===(0,s.unref)(mt).ArrowClosed?((0,s.openBlock)(),(0,s.createElementBlock)("polyline",{key:0,style:(0,s.normalizeStyle)({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):(0,s.createCommentVNode)("",!0),e.type===(0,s.unref)(mt).Arrow?((0,s.openBlock)(),(0,s.createElementBlock)("polyline",{key:1,style:(0,s.normalizeStyle)({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):(0,s.createCommentVNode)("",!0)],8,em))}}),nm={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},om=(0,s.defineComponent)({name:"MarkerDefinitions",compatConfig:{MODE:3},setup(t){const{id:e,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=be(),r=(0,s.computed)(()=>{const a=new Set,l=[],d=c=>{if(c){const u=An(c,e);a.has(u)||(typeof c=="object"?l.push({...c,id:u,color:c.color||i.value}):l.push({id:u,color:i.value,type:c}),a.add(u))}};for(const c of[o.value.markerEnd,o.value.markerStart])d(c);for(const c of n.value)for(const u of[c.markerStart,c.markerEnd])d(u);return l.sort((c,u)=>c.id.localeCompare(u.id))});return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",nm,[(0,s.createElementVNode)("defs",null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(r.value,d=>((0,s.openBlock)(),(0,s.createBlock)(tm,{id:d.id,key:d.id,type:d.type,color:d.color,width:d.width,height:d.height,markerUnits:d.markerUnits,"stroke-width":d.strokeWidth,orient:d.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),im=(0,s.defineComponent)({name:"Edges",compatConfig:{MODE:3},setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:o}=be();return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)(om),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(n),a=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:(0,s.normalizeStyle)({zIndex:(0,s.unref)(Vp)(a,(0,s.unref)(e),(0,s.unref)(o))})},[(0,s.createVNode)((0,s.unref)(Jg),{id:a.id},null,8,["id"])],4))),128)),(0,s.createVNode)((0,s.unref)(Qg))],64))}}),rm=(0,s.defineComponent)({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:l,addSelectedNodes:d,updateNodeDimensions:c,onUpdateNodeInternals:u,getNodeTypes:f,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:g,ariaLiveMessage:m,snapToGrid:w,snapGrid:I,nodeDragThreshold:y,nodesDraggable:v,elementsSelectable:C,nodesConnectable:$,nodesFocusable:z,hooks:W}=be(),j=(0,s.ref)(null);(0,s.provide)(Oa,j),(0,s.provide)(Pa,t.id);const D=(0,s.inject)(Do),O=(0,s.getCurrentInstance)(),H=Va(),{node:S,parentNode:Y}=Ha(t.id),{emit:b,on:B}=rg(S,a),_=(0,s.toRef)(()=>typeof S.draggable>"u"?v.value:S.draggable),x=(0,s.toRef)(()=>typeof S.selectable>"u"?C.value:S.selectable),T=(0,s.toRef)(()=>typeof S.connectable>"u"?$.value:S.connectable),P=(0,s.toRef)(()=>typeof S.focusable>"u"?z.value:S.focusable),L=(0,s.computed)(()=>x.value||_.value||W.value.nodeClick.hasListeners()||W.value.nodeDoubleClick.hasListeners()||W.value.nodeMouseEnter.hasListeners()||W.value.nodeMouseMove.hasListeners()||W.value.nodeMouseLeave.hasListeners()),M=(0,s.toRef)(()=>!!S.dimensions.width&&!!S.dimensions.height),V=(0,s.computed)(()=>{const k=S.type||"default",A=D?.[`node-${k}`];if(A)return A;let N=S.template||f.value[k];if(typeof N=="string"&&O){const Q=Object.keys(O.appContext.components);Q&&Q.includes(k)&&(N=(0,s.resolveComponent)(k,!1))}return N&&typeof N!="string"?N:(a.error(new Ie(ke.NODE_TYPE_MISSING,N)),!1)}),F=$a({id:t.id,el:j,disabled:()=>!_.value,selectable:x,dragHandle:()=>S.dragHandle,onStart(k){b.dragStart(k)},onDrag(k){b.drag(k)},onStop(k){b.dragStop(k)},onClick(k){R(k)}}),G=(0,s.computed)(()=>S.class instanceof Function?S.class(S):S.class),X=(0,s.computed)(()=>{const k=(S.style instanceof Function?S.style(S):S.style)||{},A=S.width instanceof Function?S.width(S):S.width,N=S.height instanceof Function?S.height(S):S.height;return!k.width&&A&&(k.width=typeof A=="string"?A:`${A}px`),!k.height&&N&&(k.height=typeof N=="string"?N:`${N}px`),k}),J=(0,s.toRef)(()=>Number(S.zIndex??X.value.zIndex??0));return u(k=>{(k.includes(t.id)||!k.length)&&Z()}),(0,s.onMounted)(()=>{(0,s.watch)(()=>S.hidden,(k=!1,A,N)=>{!k&&j.value&&(t.resizeObserver.observe(j.value),N(()=>{j.value&&t.resizeObserver.unobserve(j.value)}))},{immediate:!0,flush:"post"})}),(0,s.watch)([()=>S.type,()=>S.sourcePosition,()=>S.targetPosition],()=>{(0,s.nextTick)(()=>{c([{id:t.id,nodeElement:j.value,forceUpdate:!0}])})}),(0,s.watch)([()=>S.position.x,()=>S.position.y,()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.x},()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.y},()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.z},J,()=>S.selected,()=>S.dimensions.height,()=>S.dimensions.width,()=>{var k;return(k=Y.value)==null?void 0:k.dimensions.height},()=>{var k;return(k=Y.value)==null?void 0:k.dimensions.width}],([k,A,N,Q,K,re])=>{const ne={x:k,y:A,z:re+(p.value&&S.selected?1e3:0)};typeof N<"u"&&typeof Q<"u"?S.computedPosition=Ap({x:N,y:Q,z:K},ne):S.computedPosition=ne},{flush:"post",immediate:!0}),(0,s.watch)([()=>S.extent,h],([k,A],[N,Q])=>{(k!==N||A!==Q)&&U()}),S.extent==="parent"||typeof S.extent=="object"&&"range"in S.extent&&S.extent.range==="parent"?_i(()=>M).toBe(!0).then(U):U(),()=>S.hidden?null:(0,s.h)("div",{ref:j,"data-id":S.id,class:["vue-flow__node",`vue-flow__node-${V.value===!1?"default":S.type||"default"}`,{[n.value]:_.value,dragging:F?.value,draggable:_.value,selected:S.selected,selectable:x.value,parent:S.isParent},G.value],style:{visibility:M.value?"visible":"hidden",zIndex:S.computedPosition.z??J.value,transform:`translate(${S.computedPosition.x}px,${S.computedPosition.y}px)`,pointerEvents:L.value?"all":"none",...X.value},tabIndex:P.value?0:void 0,role:P.value?"group":void 0,"aria-describedby":g.value?void 0:`${ea}-${e}`,"aria-label":S.ariaLabel,"aria-roledescription":"node",...S.domAttributes,onMouseenter:te,onMousemove:oe,onMouseleave:ae,onContextmenu:ee,onClick:R,onDblclick:ie,onKeydown:E},[(0,s.h)(V.value===!1?f.value.default:V.value,{id:S.id,type:S.type,data:S.data,events:{...S.events,...B},selected:S.selected,resizing:S.resizing,dragging:F.value,connectable:T.value,position:S.computedPosition,dimensions:S.dimensions,isValidTargetPos:S.isValidTargetPos,isValidSourcePos:S.isValidSourcePos,parent:S.parentNode,parentNodeId:S.parentNode,zIndex:S.computedPosition.z??J.value,targetPosition:S.targetPosition,sourcePosition:S.sourcePosition,label:S.label,dragHandle:S.dragHandle,onUpdateNodeInternals:Z})]);function U(){const k=S.computedPosition,{computedPosition:A,position:N}=ji(S,w.value?No(k,I.value):k,a.error,h.value,Y.value);(S.computedPosition.x!==A.x||S.computedPosition.y!==A.y)&&(S.computedPosition={...S.computedPosition,...A}),(S.position.x!==N.x||S.position.y!==N.y)&&(S.position=N)}function Z(){j.value&&c([{id:t.id,nodeElement:j.value,forceUpdate:!0}])}function te(k){F?.value||b.mouseEnter({event:k,node:S})}function oe(k){F?.value||b.mouseMove({event:k,node:S})}function ae(k){F?.value||b.mouseLeave({event:k,node:S})}function ee(k){return b.contextMenu({event:k,node:S})}function ie(k){return b.doubleClick({event:k,node:S})}function R(k){x.value&&(!o.value||!_.value||y.value>0)&&Xi(S,r.value,d,l,i,!1,j.value),b.click({event:k,node:S})}function E(k){if(!(Li(k)||g.value))if(na.includes(k.key)&&x.value){const A=k.key==="Escape";Xi(S,r.value,d,l,i,A,j.value)}else _.value&&S.selected&&Zt[k.key]&&(k.preventDefault(),m.value=`Moved selected node ${k.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.position.x}, y: ${~~S.position.y}`,H({x:Zt[k.key].x,y:Zt[k.key].y},k.shiftKey))}}}),sm={height:"0",width:"0"},am=(0,s.defineComponent)({name:"EdgeLabelRenderer",compatConfig:{MODE:3},setup(t){const{viewportRef:e}=be(),n=(0,s.toRef)(()=>{var o;return(o=e.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",null,[((0,s.openBlock)(),(0,s.createElementBlock)("foreignObject",sm,[((0,s.openBlock)(),(0,s.createBlock)(s.Teleport,{to:n.value,disabled:!n.value},[(0,s.renderSlot)(o.$slots,"default")],8,["to","disabled"]))]))]))}});function lm(t={includeHiddenNodes:!1}){const{nodes:e}=be();return(0,s.computed)(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}var cm={class:"vue-flow__nodes vue-flow__container"},dm=(0,s.defineComponent)({name:"Nodes",compatConfig:{MODE:3},setup(t){const{getNodes:e,updateNodeDimensions:n,emits:o}=be(),i=lm(),r=(0,s.ref)();return(0,s.watch)(i,a=>{a&&(0,s.nextTick)(()=>{o.nodesInitialized(e.value)})},{immediate:!0}),(0,s.onMounted)(()=>{r.value=new ResizeObserver(a=>{const l=a.map(d=>({id:d.target.getAttribute("data-id"),nodeElement:d.target,forceUpdate:!0}));(0,s.nextTick)(()=>n(l))})}),(0,s.onBeforeUnmount)(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",cm,[r.value?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)((0,s.unref)(e),(d,c,u,f)=>{const h=[d.id];if(f&&f.key===d.id&&(0,s.isMemoSame)(f,h))return f;const p=((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(rm),{id:d.id,key:d.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},l,0),128)):(0,s.createCommentVNode)("",!0)]))}});function um(){const{emits:t}=be();(0,s.onMounted)(()=>{if(Ta()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Ie(ke.MISSING_STYLES))}})}var fm=(0,s.createElementVNode)("div",{class:"vue-flow__edge-labels"},null,-1),hm=(0,s.defineComponent)({name:"VueFlow",compatConfig:{MODE:3},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const o=t,i=(0,s.useSlots)(),r=wi(o,"modelValue",n),a=wi(o,"nodes",n),l=wi(o,"edges",n),d=be(o),c=cg({modelValue:r,nodes:a,edges:l},o,d);return ug(n,d.hooks),qg(),um(),(0,s.provide)(Do,i),(0,s.onUnmounted)(c),e(d),(u,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref:(0,s.unref)(d).vueFlowRef,class:"vue-flow"},[(0,s.createVNode)(jg,null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)(im),fm,(0,s.createVNode)(dm),(0,s.renderSlot)(u.$slots,"zoom-pane")]),_:3}),(0,s.renderSlot)(u.$slots,"default"),(0,s.createVNode)(Xg)],512))}}),pm=(0,s.defineComponent)({name:"Panel",compatConfig:{MODE:3},props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=be(),o=(0,s.computed)(()=>`${e.position}`.split("-"));return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["vue-flow__panel",o.value]),style:(0,s.normalizeStyle)({pointerEvents:(0,s.unref)(n)?"none":"all"})},[(0,s.renderSlot)(i.$slots,"default")],6))}}),vt=(t=>(t.Lines="lines",t.Dots="dots",t))(vt||{}),gm=function({dimensions:t,size:e,color:n}){return(0,s.h)("path",{stroke:n,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},mm=function({radius:t,color:e}){return(0,s.h)("circle",{cx:t,cy:t,r:t,fill:e})};vt.Lines,vt.Dots;var vm={[vt.Dots]:"#81818a",[vt.Lines]:"#eee"},ym=["id","x","y","width","height","patternTransform"],_m={key:2,height:"100",width:"100"},wm=["fill"],bm=["x","y","fill"],Cm=(0,s.defineComponent)({name:"Background",compatConfig:{MODE:3},props:{id:{},variant:{default:()=>vt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(t){const{id:e,viewport:n}=be(),o=(0,s.computed)(()=>{const a=n.value.zoom,[l,d]=Array.isArray(t.gap)?t.gap:[t.gap,t.gap],c=[l*a||1,d*a||1],u=t.size*a,[f,h]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset];return{scaledGap:c,offset:[f*a||1+c[0]/2,h*a||1+c[1]/2],size:u}}),i=(0,s.toRef)(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),r=(0,s.toRef)(()=>t.color||t.patternColor||vm[t.variant||vt.Dots]);return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",{class:"vue-flow__background vue-flow__container",style:(0,s.normalizeStyle)({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[(0,s.renderSlot)(a.$slots,"pattern-container",{id:i.value},()=>[(0,s.createElementVNode)("pattern",{id:i.value,x:(0,s.unref)(n).x%o.value.scaledGap[0],y:(0,s.unref)(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[(0,s.renderSlot)(a.$slots,"pattern",{},()=>[a.variant===(0,s.unref)(vt).Lines?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(gm),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===(0,s.unref)(vt).Dots?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(mm),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):(0,s.createCommentVNode)("",!0),a.bgColor?((0,s.openBlock)(),(0,s.createElementBlock)("svg",_m,[(0,s.createElementVNode)("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,wm)])):(0,s.createCommentVNode)("",!0)])],8,ym)]),(0,s.createElementVNode)("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,bm),(0,s.renderSlot)(a.$slots,"default",{id:i.value})],4))}}),Em={name:"ControlButton",compatConfig:{MODE:3}},xm=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Sm={type:"button",class:"vue-flow__controls-button"};function km(t,e,n,o,i,r){return(0,s.openBlock)(),(0,s.createElementBlock)("button",Sm,[(0,s.renderSlot)(t.$slots,"default")])}var Po=xm(Em,[["render",km]]),Nm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Dm=[(0,s.createElementVNode)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Tm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Nm,Dm)}var Im={render:Tm},Mm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Bm=[(0,s.createElementVNode)("path",{d:"M0 0h32v4.2H0z"},null,-1)];function zm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Mm,Bm)}var Am={render:zm},Pm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Om=[(0,s.createElementVNode)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function $m(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Pm,Om)}var Rm={render:$m},Hm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Vm=[(0,s.createElementVNode)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function Lm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Hm,Vm)}var Fm={render:Lm},Gm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},jm=[(0,s.createElementVNode)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function Wm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Gm,jm)}var Ym={render:Wm},Um=(0,s.defineComponent)({name:"Controls",compatConfig:{MODE:3},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Js.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:a,zoomOut:l,fitView:d,viewport:c,minZoom:u,maxZoom:f}=be(),h=(0,s.toRef)(()=>n.value||o.value||i.value),p=(0,s.toRef)(()=>c.value.zoom<=u.value),g=(0,s.toRef)(()=>c.value.zoom>=f.value);function m(){a(),e("zoomIn")}function w(){l(),e("zoomOut")}function I(){d(t.fitViewParams),e("fitView")}function y(){r(!h.value),e("interactionChange",!h.value)}return(v,C)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(pm),{class:"vue-flow__controls",position:v.position},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"top"),v.showZoom?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[(0,s.renderSlot)(v.$slots,"control-zoom-in",{},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-zoomin",disabled:g.value,onClick:m},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-zoom-in",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Im))))])]),_:3},8,["disabled"])]),(0,s.renderSlot)(v.$slots,"control-zoom-out",{},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:w},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-zoom-out",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Am))))])]),_:3},8,["disabled"])])],64)):(0,s.createCommentVNode)("",!0),v.showFitView?(0,s.renderSlot)(v.$slots,"control-fit-view",{key:1},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-fitview",onClick:I},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-fit-view",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Rm))))])]),_:3})]):(0,s.createCommentVNode)("",!0),v.showInteractive?(0,s.renderSlot)(v.$slots,"control-interactive",{key:2},()=>[v.showInteractive?((0,s.openBlock)(),(0,s.createBlock)(Po,{key:0,class:"vue-flow__controls-interactive",onClick:y},{default:(0,s.withCtx)(()=>[h.value?(0,s.renderSlot)(v.$slots,"icon-unlock",{key:0},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Ym))))]):(0,s.createCommentVNode)("",!0),h.value?(0,s.createCommentVNode)("",!0):(0,s.renderSlot)(v.$slots,"icon-lock",{key:1},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Fm))))])]),_:3})):(0,s.createCommentVNode)("",!0)]):(0,s.createCommentVNode)("",!0),(0,s.renderSlot)(v.$slots,"default")]),_:3},8,["position"]))}}),Xm=["onClick"],qm={class:"d-flow-node-menus-item-name"},Km=(0,s.defineComponent)({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(t,{emit:e}){const n=t,o=e,i=(0,s.inject)("d_flow_design_provide",{}),r=i.getFlowComponents?.()||[],a=l=>{o("addNode",l.type),(0,s.nextTick)(()=>{n.handleId==="line"?i.addNodeByLine?.(l.type,n.fromNodeId||""):i.addNode?.(l.type,n.fromNodeId||"",n.handleId||"")})};return(l,d)=>{const c=(0,s.resolveComponent)("j-icon");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-flow-node-menus",onClick:(0,s.withModifiers)(()=>{},["stop"])},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(r),(u,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:f,class:"d-flow-node-menus-item",onClick:h=>a(u)},[(0,s.createElementVNode)("div",{class:"d-flow-node-menus-item-icon",style:(0,s.normalizeStyle)({backgroundColor:u.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(c,{icon:u.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",qm,(0,s.toDisplayString)(u.name),1)],8,Xm))),128))])}}}),tr=Km,Zm={class:"d-flow-step-name"},Jm={key:0,style:{color:"var(--j-color-text-2)"}},Qm={style:{color:"var(--j-color-text)"}},e0=(0,s.defineComponent)({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(t){const e=t,{onNodeClick:n,onEdgeClick:o,onMoveStart:i,onConnectStart:r,onNodeDragStart:a,removeNodes:l,getEdges:d,getNodes:c,onNodesChange:u}=be(),f=(0,s.inject)("d_flow_design_provide",{}),h=(0,s.computed)(()=>f.getFlowComponentMap?.value?.[e.data.type]||{}),p=()=>{l(e.id),f.onRemoveNode?.(e.id)},g=(0,s.ref)({});u(Y=>{if(e.data.isInit&&Y.findIndex(b=>b.type==="select"&&b.id===e.id&&b.id==="start"&&b.selected)!==-1){const b=c.value.find(B=>B.id==="start");b&&(b.data.isInit=!1),g.value.s1=!0}});const m=(0,s.ref)(!1),w=Y=>{Y.indexOf("t")!==-1&&!I.value||(m.value=!0,g.value[Y]=!0)},I=(0,s.computed)(()=>d.value.findIndex(Y=>Y.target===e.id)===-1),y=(0,s.ref)(!1),v=()=>{y.value=!0},C=(Y,b)=>{if(d.value.find(_=>_.source===b&&_.target===Y))return!0;const B=d.value.filter(_=>_.target===Y);for(let _=0;_<B.length;_++)if(C(B[_].source,b))return!0;return!1},$=Y=>y.value?(y.value=!1,!1):C(Y.source,Y.target)?!1:Y.source!==Y.target&&Y.sourceHandle!==Y.targetHandle&&Y.sourceHandle.indexOf("s")!==-1&&Y.targetHandle.indexOf("t")!==-1,z=()=>{H(),Object.keys(g.value).forEach(Y=>{g.value[Y]=!1})},W=()=>{z()};n(()=>{console.log("onNodeClick"),m.value?m.value=!1:z()}),o(()=>{z()}),i(()=>{z()}),r(()=>{z()}),a(()=>{z()});const j=(0,s.ref)(),D=(0,s.ref)({top:0,left:0,bottom:0,right:0}),O=(0,s.ref)({getBoundingClientRect:()=>D.value}),H=()=>{j.value?.handleClose()},S=Y=>{const{clientX:b,clientY:B}=Y;D.value=DOMRect.fromRect({x:b,y:B}),Y.preventDefault(),j.value?.handleOpen()};return(Y,b)=>{const B=(0,s.resolveComponent)("el-popover"),_=(0,s.resolveComponent)("el-tooltip"),x=(0,s.resolveComponent)("el-dropdown-item"),T=(0,s.resolveComponent)("el-dropdown-menu"),P=(0,s.resolveComponent)("el-dropdown");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-flow-step",onContextmenu:(0,s.withModifiers)(S,["stop"])},[(0,s.createElementVNode)("div",{class:"d-flow-step-icon",style:(0,s.normalizeStyle)({backgroundColor:h.value.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(mn,{icon:h.value.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",Zm,(0,s.toDisplayString)(h.value.name),1),t.data.type!=="start"?((0,s.openBlock)(),(0,s.createBlock)(_,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,s.withCtx)(()=>[I.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",Jm,[...b[4]||(b[4]=[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),(0,s.createTextVNode)("添加节点 ",-1)])])):(0,s.createCommentVNode)("",!0),b[5]||(b[5]=(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,s.createTextVNode)("连接节点 ")],-1))]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(en),{onClick:b[1]||(b[1]=L=>w("t1")),onMousedown:v,id:"t1",class:(0,s.normalizeClass)(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!I.value}]),type:"target",position:(0,s.unref)(ce).Left,"is-valid-connection":$},{default:(0,s.withCtx)(()=>[I.value?((0,s.openBlock)(),(0,s.createBlock)(B,{key:0,visible:g.value.t1,"onUpdate:visible":b[0]||(b[0]=L=>g.value.t1=L),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(mn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"t1","from-node-id":t.id,onAddNode:W},null,8,["from-node-id"])]),_:1},8,["visible"])):(0,s.createCommentVNode)("",!0)]),_:1},8,["class","position"])]),_:1})):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(_,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,s.withCtx)(()=>[...b[6]||(b[6]=[(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),(0,s.createTextVNode)("添加节点 ")],-1),(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,s.createTextVNode)("连接节点 ")],-1)])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(en),{onClick:b[3]||(b[3]=L=>w("s1")),onMousedown:v,id:"s1",class:"d-flow-step-source-handle",type:"source",position:(0,s.unref)(ce).Right,"is-valid-connection":$},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(B,{visible:g.value.s1,"onUpdate:visible":b[2]||(b[2]=L=>g.value.s1=L),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(mn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"s1","from-node-id":t.id,onAddNode:W},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),(0,s.createVNode)(P,{ref_key:"dropdownRef",ref:j,"popper-class":"d-flow-step-dropdown","virtual-ref":O.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:(0,s.withCtx)(()=>[(0,s.createVNode)(T,null,{default:(0,s.withCtx)(()=>[t.data.type!="start"?((0,s.openBlock)(),(0,s.createBlock)(x,{key:0,onClick:p},{default:(0,s.withCtx)(()=>[...b[7]||(b[7]=[(0,s.createTextVNode)("删除",-1)])]),_:1})):(0,s.createCommentVNode)("",!0),h.value.des?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:1,style:(0,s.normalizeStyle)({width:"160px",padding:"4px 16px 0 16px","font-size":"12px","border-top":t.data.type!="start"?"1px solid var(--j-color-border)":void 0,"margin-top":t.data.type!="start"?"4px":void 0})},[b[8]||(b[8]=(0,s.createElementVNode)("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),(0,s.createElementVNode)("div",Qm,(0,s.toDisplayString)(h.value.des),1)],4)):(0,s.createCommentVNode)("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),t0=e0,n0=(0,s.defineComponent)({name:"DEdgeWithButton",__name:"edgeWithButton",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},markerEnd:{},style:{}},setup(t){const e=t,{onEdgeMouseEnter:n,onEdgeMouseLeave:o,onNodeClick:i,onEdgeClick:r,onMoveStart:a,onConnectStart:l,onNodeDragStart:d}=be(),c=(0,s.computed)(()=>Ji(e)),u=(0,s.ref)(!1),f=(0,s.ref)(!1);n(({edge:w})=>{w.id===e.id&&(u.value=!0)}),o(()=>{u.value=!1});const h=(0,s.ref)(!1),p=()=>{h.value=!1,(0,s.nextTick)(()=>{f.value=!1})},g=()=>{f.value=!0,h.value=!0},m=()=>{p()};return i(()=>{p()}),r(()=>{p()}),a(()=>{p()}),l(()=>{p()}),d(()=>{p()}),(w,I)=>{const y=(0,s.resolveComponent)("j-icon"),v=(0,s.resolveComponent)("el-popover");return(0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)((0,s.unref)(On),{id:t.id,style:(0,s.normalizeStyle)(t.style),path:c.value[0],"marker-end":t.markerEnd},null,8,["id","style","path","marker-end"]),(0,s.createVNode)((0,s.unref)(am),null,{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${c.value[1]}px,${c.value[2]}px)`}),class:"nodrag nopan"},[(0,s.createVNode)(v,{visible:h.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:(0,s.withCtx)(()=>[(0,s.withDirectives)((0,s.createElementVNode)("div",{onClick:(0,s.withModifiers)(g,["stop"]),class:"d-flow-edge-button"},[(0,s.createVNode)(y,{icon:"mdi:plus-circle"})],512),[[s.vShow,u.value||f.value]])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"line","from-node-id":t.id,onAddNode:m},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),o0=n0,i0=(0,s.defineComponent)({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(hm),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":(0,s.unref)(gt).Strict,nodes:t.nodes,edges:t.edges},{"edge-button":(0,s.withCtx)(o=>[(0,s.createVNode)(o0,{id:o.id,"source-x":o.sourceX,"source-y":o.sourceY,"target-x":o.targetX,"target-y":o.targetY,"source-position":o.sourcePosition,"target-position":o.targetPosition,"marker-end":o.markerEnd,style:(0,s.normalizeStyle)(o.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":(0,s.withCtx)(o=>[(0,s.createVNode)(t0,(0,s.normalizeProps)((0,s.guardReactiveProps)(o)),null,16)]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(Um),{position:"bottom-left"}),(0,s.createVNode)((0,s.unref)(Cm))]),_:1},8,["connection-mode","nodes","edges"]))}}),r0=i0,s0={class:"d-flow-design"},a0={class:"d-flow-design-canvas"},l0={class:"d-flow-design-right"},c0={class:"d-flow-design-title"},d0={class:"d-flow-design-title-name"},u0={class:"d-flow-design-panel"},f0=(0,s.defineComponent)({name:"DFlowDesign",__name:"flowDesign",props:{components:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["nodeClick","edgeClick","paneClick","connect"],setup(t,{expose:e,emit:n}){const o=t,i=n,{addNodes:r,addEdges:a,removeEdges:l,addSelectedNodes:d,removeSelectedNodes:c,onConnect:u,onNodeClick:f,onPaneClick:h,onEdgeClick:p,getNodes:g,getEdges:m}=be(),w=(0,s.computed)(()=>{const P={};return o.components.forEach(L=>{P[L.type]=L}),P.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},P}),I={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},y=(0,s.ref)([I]),v=(0,s.ref)([]),C=(P,L)=>{if(L.indexOf("t")===-1){const M=m.value.filter(V=>V.source===P.id);if(M.length>0){let V=-1e6,F=0;return M.forEach(G=>{V=Math.max(V,G.targetNode.position.y+G.targetNode.dimensions.height+32),F=G.targetNode.position.x||0}),{x:F,y:V}}return{x:P.position.x+P.dimensions.width+100,y:P.position.y}}return{x:P.position.x-100-P.dimensions.width,y:P.position.y}},$=(P,L,M)=>{const V=g.value.find(G=>G.id===L);if(!V)return;const F={id:Ft(),type:"step",data:{type:P},position:C(V,M)};if(o.flowInit){const G=o.flowInit(F.data.type);G&&Object.keys(G).forEach(X=>{F.data[X]=G[X]})}r(F),M.indexOf("t")===-1?a({id:`${L}-${F.id}`,source:L,target:F.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}):a({id:`${L}-${F.id}`,source:F.id,target:L,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),S(F.id)},z=P=>{const L=g.value.find(M=>M.id===P);L&&(L.position.x+=100+L.dimensions.width,m.value.filter(M=>M.source===P).forEach(M=>{z(M.target)}))},W=(P,L)=>{const M=m.value.find(F=>F.id===L);if(!M)return;const V={id:Ft(),type:"step",data:{type:P},position:{x:M.targetNode.position.x,y:M.targetNode.position.y}};if(o.flowInit){const F=o.flowInit(V.data.type);F&&Object.keys(F).forEach(G=>{V.data[G]=F[G]})}r(V),a({id:`${M.sourceNode.id}-${V.id}`,source:M.sourceNode.id,target:V.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),a({id:`${V.id}-${M.targetNode.id}`,source:V.id,target:M.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),l(L),z(M.target),S(V.id)};u(P=>{console.log("onConnect",P),P.type="button",P.markerEnd=mt.Arrow,a(P),i("connect",P)});const j=()=>o.components||[],D=(0,s.ref)(),O=(0,s.computed)(()=>D.value?w.value[D.value.data.type]:void 0);f(P=>{D.value?.id!==P.node.id&&(D.value=P.node,B()),i("nodeClick",P.node)}),h(()=>{D.value=void 0,i("paneClick")}),p(P=>{D.value=void 0,i("edgeClick",P.edge)});const H=P=>{D.value?.id===P&&(D.value=void 0)},S=P=>{D.value&&c([D.value]),D.value=g.value.find(L=>L.id===P),D.value&&(B(),setTimeout(()=>{D.value&&d([D.value])},100))},Y=(0,s.ref)(),b={};Object.keys(o.flowComponentConfigs).forEach(P=>{const L={type:"j-collapse",config:{defaultValue:[]},children:[]};o.flowComponentConfigs[P].forEach((M,V)=>{const F=`_collapse${V}`;L.config?.defaultValue.push(F),L.children?.push(M)}),b[P]=[L]});const B=()=>{const P=b[D.value?.data.type||""];P&&Y.value?(Y.value.init&&Y.value.init(P,D.value?.data),o.flowComponentConfigInit&&o.flowComponentConfigInit({configRef:Y,inputParams:o.inputParams,components:g.value,configData:D.value?.data})):Y.value&&Y.value.init&&Y.value.init([])},_=(P,L)=>{D.value&&o.flowComponentConfigChange&&o.flowComponentConfigChange(D.value.data.type,{configRef:Y,component:P,configData:D.value.data,...L,isFlowNode:!0})};return(0,s.provide)("d_flow_design_provide",{getFlowComponents:j,addNode:$,addNodeByLine:W,onRemoveNode:H,getFlowComponentMap:w}),e({getData:()=>{const P=[];return g.value.forEach(L=>{P.push({config:L.data,id:L.id,position:L.position,type:L.type})}),m.value.forEach(L=>{P.push({id:L.id,source:L.source,target:L.target,sourceHandle:L.sourceHandle,targetHandle:L.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),P},setData:P=>{if(!P||P.length===0)I.data.isInit=!0,y.value=[I],S(I.id);else{I.data.isInit=!1;const L=[],M=[];P.forEach(V=>{if(V.type==="line")V.type="button",V.markerEnd=mt.Arrow,M.push(V);else{const F={id:V.id,type:V.type,data:V.config,position:V.position};L.push(F)}}),y.value=L,v.value=M}}}),(P,L)=>{const M=(0,s.resolveComponent)("j-icon"),V=(0,s.resolveComponent)("j-form");return(0,s.openBlock)(),(0,s.createElementBlock)("div",s0,[(0,s.createElementVNode)("div",a0,[(0,s.createVNode)(r0,{nodes:y.value,edges:v.value},null,8,["nodes","edges"])]),(0,s.withDirectives)((0,s.createElementVNode)("div",l0,[(0,s.createElementVNode)("div",c0,[(0,s.createElementVNode)("div",{class:"d-flow-design-title-icon",style:(0,s.normalizeStyle)({backgroundColor:O.value?.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(M,{icon:O.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",d0,(0,s.toDisplayString)(O.value?.name||""),1)]),(0,s.createElementVNode)("div",u0,[(0,s.createVNode)(V,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:Y,onChange:_},null,512)])],512),[[s.vShow,D.value&&b[D.value.data.type]]])])}}}),h0=f0,Za=Mt(h0),p0={class:"d-input-flow j-block"},g0=(0,s.defineComponent)({name:"DInputFlow",__name:"inputFlow",props:{modelValue:{},type:{},btnText:{default:"事件"},title:{},size:{default:"default"},width:{default:1200},height:{default:800},beforeClose:{},flowComponents:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=(0,s.ref)(),r=(0,s.computed)({get(){return n.modelValue},set(f){o("update:modelValue",f)}}),a=(0,s.computed)(()=>(n.modelValue?.trim(),n.btnText)),l=f=>{const h=typeof f=="string"?f:void 0;try{i.value?.setData(JSON.parse(h||"[]"))}catch{i.value?.setData([])}},d=async()=>{const f=i.value?.getData();return f?JSON.stringify(f):void 0},c=f=>{if(n.beforeClose){const h=typeof f=="string"?f:void 0;return n.beforeClose(h)}return!0},u=f=>{const h=f.value;o("change",{value:typeof h=="string"?h:void 0})};return(f,h)=>{const p=(0,s.resolveComponent)("d-flow-design"),g=(0,s.resolveComponent)("j-input-button");return(0,s.openBlock)(),(0,s.createBlock)(g,(0,s.mergeProps)(f.$attrs,{type:t.type,"btn-text":a.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":c,ok:d,open:l,"destroy-on-close":"",modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),onChange:u}),{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",p0,[(0,s.createVNode)(p,{ref_key:"flowRef",ref:i,components:t.flowComponents,"flow-init":t.flowInit,"flow-component-config-init":t.flowComponentConfigInit,"flow-component-configs":t.flowComponentConfigs,"flow-component-config-change":t.flowComponentConfigChange,"input-params":t.inputParams},null,8,["components","flow-init","flow-component-config-init","flow-component-configs","flow-component-config-change","input-params"])])]),_:1},16,["type","btn-text","title","size","width","height","modelValue"])}}}),m0=g0,Ja=Mt(m0),q=class Ke{static getElements(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(o&&!isNaN(+e[0])){const r=o.getElementById(e);return r?[r]:[]}let i=n.querySelectorAll(e);if(!i.length&&e[0]!=="."&&e[0]!=="#"&&(i=n.querySelectorAll("."+e),i.length||(i=n.querySelectorAll("#"+e)),!i.length)){const r=n.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(i)}return[e]}static getElement(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(!e.length)return null;if(o&&e[0]==="#")return o.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return n.querySelector(e);if(o&&!isNaN(+e[0]))return o.getElementById(e);let i=n.querySelector(e);return o&&!i&&(i=o.getElementById(e)),i||(i=n.querySelector("."+e)),i}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,n){const o=document.createElement("div");return e.forEach(i=>{i&&o.classList.add(i)}),n?.appendChild(o),o}static shouldSizeToContent(e,n=!1){return e?.grid&&(n?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,n){return!(e.y>=n.y+n.h||e.y+e.h<=n.y||e.x+e.w<=n.x||e.x>=n.x+n.w)}static isTouching(e,n){return Ke.isIntercepted(e,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(e,n){const o=e.x>n.x?e.x:n.x,i=e.x+e.w<n.x+n.w?e.x+e.w:n.x+n.w;if(i<=o)return 0;const r=e.y>n.y?e.y:n.y,a=e.y+e.h<n.y+n.h?e.y+e.h:n.y+n.h;return a<=r?0:(i-o)*(a-r)}static area(e){return e.w*e.h}static sort(e,n=1){return e.sort((i,r)=>{const a=n*((i.y??1e4)-(r.y??1e4));return a===0?n*((i.x??1e4)-(r.x??1e4)):a})}static find(e,n){return n?e.find(o=>o.id===n):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let n,o="px";if(typeof e=="string")if(e==="auto"||e==="")n=0;else{const i=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${e}`);o=i[2]||"px",n=parseFloat(i[1])}else n=e;return{h:n,unit:o}}static defaults(e,...n){return n.forEach(o=>{for(const i in o){if(!o.hasOwnProperty(i))return;e[i]===null||e[i]===void 0?e[i]=o[i]:typeof o[i]=="object"&&typeof e[i]=="object"&&Ke.defaults(e[i],o[i])}}),e}static same(e,n){if(typeof e!="object")return e==n;if(typeof e!=typeof n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(e[o]!==n[o])return!1;return!0}static copyPos(e,n,o=!1){return n.x!==void 0&&(e.x=n.x),n.y!==void 0&&(e.y=n.y),n.w!==void 0&&(e.w=n.w),n.h!==void 0&&(e.h=n.h),o&&(n.minW&&(e.minW=n.minW),n.minH&&(e.minH=n.minH),n.maxW&&(e.maxW=n.maxW),n.maxH&&(e.maxH=n.maxH)),e}static samePos(e,n){return e&&n&&e.x===n.x&&e.y===n.y&&(e.w||1)===(n.w||1)&&(e.h||1)===(n.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,n){if(!(typeof e!="object"||typeof n!="object")&&!(Array.isArray(e)||Array.isArray(n)))for(let o in e){const i=e[o],r=n[o];o[0]==="_"||i===r?delete e[o]:i&&typeof i=="object"&&r!==void 0&&(Ke.removeInternalAndSame(i,r),Object.keys(i).length||delete e[o])}}static removeInternalForSave(e,n=!0){for(let o in e)(o[0]==="_"||e[o]===null||e[o]===void 0)&&delete e[o];delete e.grid,n&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,n){let o=!1;return(...i)=>{o||(o=!0,setTimeout(()=>{e(...i),o=!1},n))}}static removePositioningStyles(e){const n=e.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const n=getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowY)?e:Ke.getScrollElement(e.parentElement)}static updateScrollPosition(e,n,o){const i=Ke.getScrollElement(e);if(!i)return;const r=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,d=r.bottom-Math.min(a.bottom,l),c=r.top-Math.max(a.top,0),u=i.scrollTop;c<0&&o<0?e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=Math.abs(c)>Math.abs(o)?o:c:d>0&&o>0&&(e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=d>o?o:d),n.top+=i.scrollTop-u}static updateScrollResize(e,n,o){const i=Ke.getScrollElement(n),r=i.clientHeight,a=i===Ke.getScrollElement()?0:i.getBoundingClientRect().top,l=e.clientY-a,d=l<o,c=l>r-o;d?i.scrollBy({behavior:"smooth",top:l-o}):c&&i.scrollBy({behavior:"smooth",top:o-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const n=["parentGrid","el","grid","subGrid","engine"],o=Ke.clone(e);for(const i in o)o.hasOwnProperty(i)&&typeof o[i]=="object"&&i.substring(0,2)!=="__"&&!n.find(r=>r===i)&&(o[i]=Ke.cloneDeep(e[i]));return o}static cloneNode(e){const n=e.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(e,n){let o;typeof n=="string"?o=Ke.getElement(n):o=n,o&&o.appendChild(e)}static addElStyles(e,n){if(n instanceof Object)for(const o in n)n.hasOwnProperty(o)&&(Array.isArray(n[o])?n[o].forEach(i=>{e.style[o]=i}):e.style[o]=n[o])}static initEvent(e,n){const o={type:n.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>o[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>o[r]=e[r]),{...o,...i}}static simulateMouseEvent(e,n,o){const i=e,r=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:e.target});(o||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const n=document.createElement("div");Ke.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(n);const o=n.getBoundingClientRect();return e.removeChild(n),n.remove(),{xScale:1/o.width,yScale:1/o.height,xOffset:o.left,yOffset:o.top}}static swap(e,n,o){if(!e)return;const i=e[n];e[n]=e[o],e[o]=i}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}},nr=class un{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,n=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||n.y<=e.y)}_fixCollisions(e,n=e,o,i={}){if(this.sortNodes(-1),o=o||this.collide(e,n),!o)return!1;if(e._moving&&!i.nested&&!this.float&&this.swap(e,o))return!0;let r=n;!this._loading&&this._useEntireRowArea(e,n)&&(r={x:0,w:this.column,y:n.y,h:n.h},o=this.collide(e,r,i.skip));let a=!1;const l={nested:!0,pack:!1};let d=0;for(;o=o||this.collide(e,r,i.skip);){if(d++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(o.locked||this._loading||e._moving&&!e._skipDown&&n.y>e.y&&!this.float&&(!this.collide(o,{...o,y:e.y},e)||!this.collide(o,{...o,y:n.y-o.h},e))){e._skipDown=e._skipDown||n.y>e.y;const u={...n,y:o.y+o.h,...l};c=this._loading&&q.samePos(e,u)?!0:this.moveNode(e,u),(o.locked||this._loading)&&c?q.copyPos(n,e):!o.locked&&c&&i.pack&&(this._packNodes(),n.y=o.y+o.h,q.copyPos(e,n)),a=a||c}else c=this.moveNode(o,{...o,y:n.y+n.h,skip:e,...l});if(!c)return a;o=void 0}return a}collide(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.find(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}collideAll(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.filter(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}directionCollideCoverage(e,n,o){if(!n.rect||!e._rect)return;const i=e._rect,r={...n.rect};r.y>i.y?(r.h+=r.y-i.y,r.y=i.y):r.h+=i.y-r.y,r.x>i.x?(r.w+=r.x-i.x,r.x=i.x):r.w+=i.x-r.x;let a,l=.5;for(let d of o){if(d.locked||!d._rect)break;const c=d._rect;let u=Number.MAX_VALUE,f=Number.MAX_VALUE;i.y<c.y?u=(r.y+r.h-c.y)/c.h:i.y+i.h>c.y+c.h&&(u=(c.y+c.h-r.y)/c.h),i.x<c.x?f=(r.x+r.w-c.x)/c.w:i.x+i.w>c.x+c.w&&(f=(c.x+c.w-r.x)/c.w);const h=Math.min(f,u);h>l&&(l=h,a=d)}return n.collide=a,a}cacheRects(e,n,o,i,r,a){return this.nodes.forEach(l=>l._rect={y:l.y*n+o,x:l.x*e+a,w:l.w*e-a-i,h:l.h*n-o-r}),this}swap(e,n){if(!n||n.locked||!e||e.locked)return!1;function o(){const r=n.x,a=n.y;return n.x=e.x,n.y=e.y,e.h!=n.h?(e.x=r,e.y=n.y+n.h):e.w!=n.w?(e.x=n.x+n.w,e.y=a):(e.x=r,e.y=a),e._dirty=n._dirty=!0,!0}let i;if(e.w===n.w&&e.h===n.h&&(e.x===n.x||e.y===n.y)&&(i=q.isTouching(e,n)))return o();if(i!==!1){if(e.w===n.w&&e.x===n.x&&(i||(i=q.isTouching(e,n)))){if(n.y<e.y){const r=e;e=n,n=r}return o()}if(i!==!1){if(e.h===n.h&&e.y===n.y&&(i||(i=q.isTouching(e,n)))){if(n.x<e.x){const r=e;e=n,n=r}return o()}return!1}}}isAreaEmpty(e,n,o,i){const r={x:e||0,y:n||0,w:o||1,h:i||1};return!this.collide(r)}compact(e="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const o=this.batchMode;o||this.batchUpdate();const i=this._inColumnResize;i||(this._inColumnResize=!0);const r=this.nodes;return this.nodes=[],r.forEach((a,l,d)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=d[l-1])),this.addNode(a,!1,c)}),i||delete this._inColumnResize,o||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=q.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let n=e.y;for(;n>e._orig.y;)--n,this.collide(e,{x:e.x,y:n,w:e.w,h:e.h})||(e._dirty=!0,e.y=n)}):this.nodes.forEach((e,n)=>{if(!e.locked)for(;e.y>0;){const o=n===0?0:e.y-1;if(!(n===0||!this.collide(e,{x:e.x,y:o,w:e.w,h:e.h})))break;e._dirty=e.y!==o,e.y=o}}),this)}prepareNode(e,n){e._id=e._id??un._idSeq++;const o=e.id;if(o){let r=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=o+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const i={x:0,y:0,w:1,h:1};return q.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,q.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,n),e}nodeBoundFix(e,n){const o=e._orig||q.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){const i={...e};i.autoPosition||i.x===void 0?(delete i.x,delete i.y):i.x=Math.min(this.defaultColumn-1,i.x),i.w=Math.min(this.defaultColumn,i.w||1),this.cacheOneLayout(i,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(n?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(n?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),q.samePos(e,o)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(n=>n._dirty&&!q.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const n=(e||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=q.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||q.samePos(e,e._orig)||(q.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,n=this.nodes,o=this.column,i){const r=i?i.y*o+(i.x+i.w):0;let a=!1;for(let l=r;!a;++l){const d=l%o,c=Math.floor(l/o);if(d+e.w>o)continue;const u={x:d,y:c,w:e.w,h:e.h};n.find(f=>q.isIntercepted(u,f))||((e.x!==d||e.y!==c)&&(e._dirty=!0),e.x=d,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,n=!1,o){const i=this.nodes.find(a=>a._id===e._id);if(i)return i;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,o)&&(delete e.autoPosition,r=!0),this.nodes.push(e),n&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,n=!0,o=!1){return this.nodes.find(i=>i._id===e._id)?(o&&this.removedNodes.push(e),n&&(e._removeDOM=!0),this.nodes=this.nodes.filter(i=>i._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(i=>i._removeDOM=!0);const o=this.nodes;return this.removedNodes=n?o:[],this.nodes=[],this._notify(o)}moveNodeCheck(e,n){if(!this.changedPosConstrain(e,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(e,n);let o;const i=new un({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(o={...a},o):{...a})});if(!o)return!1;const r=i.moveNode(o,n)&&i.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!n.resizing&&n.collide){const a=n.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(i.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(d=>d._id===a._id);l&&(q.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const n=new un({column:this.column,float:this.float,nodes:this.nodes.map(i=>({...i}))}),o={...e};return this.cleanupNode(o),delete o.el,delete o._id,delete o.content,delete o.grid,n.addNode(o),n.getRow()<=this.maxRow?(e._willFitPos=q.copyPos({},o),!0):!1}changedPosConstrain(e,n){return n.w=n.w||e.w,n.h=n.h||e.h,e.x!==n.x||e.y!==n.y?!0:(e.maxW&&(n.w=Math.min(n.w,e.maxW)),e.maxH&&(n.h=Math.min(n.h,e.maxH)),e.minW&&(n.w=Math.max(n.w,e.minW)),e.minH&&(n.h=Math.max(n.h,e.minH)),e.w!==n.w||e.h!==n.h)}moveNode(e,n){if(!e||!n)return!1;let o;n.pack===void 0&&!this.batchMode&&(o=n.pack=!0),typeof n.x!="number"&&(n.x=e.x),typeof n.y!="number"&&(n.y=e.y),typeof n.w!="number"&&(n.w=e.w),typeof n.h!="number"&&(n.h=e.h);const i=e.w!==n.w||e.h!==n.h,r=q.copyPos({},e,!0);if(q.copyPos(r,n),this.nodeBoundFix(r,i),q.copyPos(n,r),!n.forceCollide&&q.samePos(e,n))return!1;const a=q.copyPos({},e),l=this.collideAll(e,r,n.skip);let d=!0;if(l.length){const c=e._moving&&!n.nested;let u=c?this.directionCollideCoverage(e,n,l):l[0];if(c&&u&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const f=q.areaIntercept(n.rect,u._rect),h=q.area(n.rect),p=q.area(u._rect);f/(h<p?h:p)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,r,u,n):(d=!1,o&&delete n.pack)}return d&&!q.samePos(e,r)&&(e._dirty=!0,q.copyPos(e,r)),n.pack&&this._packNodes()._notify(),!q.samePos(e,a)}getRow(){return this.nodes.reduce((e,n)=>Math.max(e,n.y+n.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(n=>n._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,n,o){const i=this._layouts?.length||0;let r;i&&(o?o!==this.column&&(r=this._layouts[o]):this.column!==i-1&&(r=this._layouts[i-1]));const a=[];return this.sortNodes(),this.nodes.forEach(l=>{const d=r?.find(u=>u._id===l._id),c={...l,...d||{}};q.removeInternalForSave(c,!e),n&&n(l,c),a.push(c)}),a}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,o)=>{if(!n||o===this.column)return this;if(o<this.column)this._layouts[o]=void 0;else{const i=o/this.column;e.forEach(r=>{if(!r._orig)return;const a=n.find(l=>l._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y,a.y<0&&(a.y=0)),r.x!==r._orig.x&&(a.x=Math.round(r.x*i),a.x<0&&(a.x=0)),r.w!==r._orig.w&&(a.w=Math.round(r.w*i),a.w<1&&(a.w=1)))})}}),this)}columnChanged(e,n,o="moveScale"){if(!this.nodes.length||!n||e===n)return this;const i=o==="compact"||o==="list";i&&this.sortNodes(1),n<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],a=i?this.nodes:q.sort(this.nodes,-1);if(n>e&&this._layouts){const l=this._layouts[n]||[],d=this._layouts.length-1;!l.length&&e!==d&&this._layouts[d]?.length&&(e=d,this._layouts[d].forEach(c=>{const u=a.find(f=>f._id===c._id);u&&(!i&&!c.autoPosition&&(u.x=c.x??u.x,u.y=c.y??u.y),u.w=c.w??u.w,(c.x==null||c.y===void 0)&&(u.autoPosition=!0))})),l.forEach(c=>{const u=a.findIndex(f=>f._id===c._id);if(u!==-1){const f=a[u];if(i){f.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(f.x=c.x??f.x,f.y=c.y??f.y,f.w=c.w??f.w,r.push(f)),a.splice(u,1)}})}if(i)this.compact(o,!1);else{if(a.length)if(typeof o=="function")o(n,e,r,a);else{const l=i||o==="none"?1:n/e,d=o==="move"||o==="moveScale",c=o==="scale"||o==="moveScale";a.forEach(u=>{u.x=n===1?0:d?Math.round(u.x*l):Math.min(u.x,n-1),u.w=n===1||e===1?1:c?Math.round(u.w*l)||1:Math.min(u.w,n),r.push(u)}),a=[]}r=q.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!i),delete this._inColumnResize,this}cacheLayout(e,n,o=!1){const i=[];return e.forEach((r,a)=>{r._id===void 0&&(r._id=(r.id?this.nodes.find(l=>l.id===r.id):void 0)?._id??un._idSeq++),i[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[n]=i,this}cacheOneLayout(e,n){e._id=e._id??un._idSeq++;const o={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete o.x,delete o.y,e.autoPosition&&(o.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const i=this.findCacheLayout(e,n);return i===-1?this._layouts[n].push(o):this._layouts[n][i]=o,this}findCacheLayout(e,n){return this._layouts?.[n]?.findIndex(o=>o._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const o=this.findCacheLayout(e,n);o!==-1&&this._layouts[n].splice(o,1)}}cleanupNode(e){for(const n in e)n[0]==="_"&&n!=="_id"&&delete e[n];return this}};nr._idSeq=0;var Ge={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},fe=class{},et=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),je=class{};function Oo(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t.changedTouches[0],e))}function Qa(t,e){t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t,e)}function $o(t){je.touchHandled||(je.touchHandled=!0,Oo(t,"mousedown"))}function Ro(t){je.touchHandled&&Oo(t,"mousemove")}function Ho(t){if(!je.touchHandled)return;je.pointerLeaveTimeout&&(window.clearTimeout(je.pointerLeaveTimeout),delete je.pointerLeaveTimeout);const e=!!fe.dragElement;Oo(t,"mouseup"),e||Oo(t,"click"),je.touchHandled=!1}function Vo(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function el(t){fe.dragElement&&t.pointerType!=="mouse"&&Qa(t,"mouseenter")}function tl(t){fe.dragElement&&t.pointerType!=="mouse"&&(je.pointerLeaveTimeout=window.setTimeout(()=>{delete je.pointerLeaveTimeout,Qa(t,"mouseleave")},10))}var nl=class Ql{constructor(e,n,o){this.host=e,this.dir=n,this.option=o,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Ql.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),et&&(this.el.addEventListener("touchstart",$o),this.el.addEventListener("pointerdown",Vo)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),et&&(this.el.removeEventListener("touchstart",$o),this.el.removeEventListener("pointerdown",Vo)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),et&&(this.el.addEventListener("touchmove",Ro),this.el.addEventListener("touchend",Ho)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),et&&(this.el.removeEventListener("touchmove",Ro),this.el.removeEventListener("touchend",Ho)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,n){return this.option[e]&&this.option[e](n),this}};nl.prefix="ui-resizable-";var or=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(t,e){this._eventRegister[t]=e}off(t){delete this._eventRegister[t]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(t,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](e)}},ol=class xr extends or{constructor(e,n={}){super(),this.el=e,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const o=this.el.parentElement.getBoundingClientRect(),i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=this.temporalRect||i;return{position:{left:(r.left-o.left)*this.rectScale.x,top:(r.top-o.top)*this.rectScale.y},size:{width:r.width*this.rectScale.x,height:r.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const n=e.handles&&e.handles!==this.option.handles,o=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(i=>this.option[i]=e[i]),n&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),fe.overResizeElement===this&&delete fe.overResizeElement),this}_mouseOver(e){fe.overResizeElement||fe.dragElement||(fe.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){fe.overResizeElement===this&&(delete fe.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new nl(this.el,e,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,e)})),this}_resizeStart(e){this.sizeToContent=q.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=q.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const n=q.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(e,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,n),this._applyChange();const o=q.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(o,this._ui()),this.triggerEvent("resize",o),this}_resizeStop(e){const n=q.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=xr._originStyleProp.map(o=>this.el.style[o]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,n=q.getValuesFromTransformedElement(e);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return xr._originStyleProp.forEach((e,n)=>{this.el.style[e]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,n){const o=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-o.clientX,a=this.sizeToContent?0:e.clientY-o.clientY;let l,d;n.indexOf("e")>-1?i.width+=r:n.indexOf("w")>-1&&(i.width-=r,i.left+=r,l=!0),n.indexOf("s")>-1?i.height+=a:n.indexOf("n")>-1&&(i.height-=a,i.top+=a,d=!0);const c=this._constrainSize(i.width,i.height,l,d);return Math.round(i.width)!==Math.round(c.width)&&(n.indexOf("w")>-1&&(i.left+=i.width-c.width),i.width=c.width),Math.round(i.height)!==Math.round(c.height)&&(n.indexOf("n")>-1&&(i.top+=i.height-c.height),i.height=c.height),i}_constrainSize(e,n,o,i){const r=this.option,a=(o?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,d=(i?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||n;return{width:Math.min(a,Math.max(l,e)),height:Math.min(d,Math.max(c,n))}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const{left:n,top:o}=this.el.parentElement.getBoundingClientRect();e={left:n,top:o,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const o=this.temporalRect[n],i=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(o-e[n])*i+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}};ol._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var v0='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',il=class Sr extends or{constructor(e,n={}){super(),this.el=e,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const o=n?.handle?.substring(1),i=e.gridstackNode;this.dragEls=!o||e.classList.contains(o)?[e]:i?.subGrid?[e.querySelector(n.handle)||e]:Array.from(e.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),et&&(e.addEventListener("touchstart",$o),e.addEventListener("pointerdown",Vo))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),et&&(n.removeEventListener("touchstart",$o),n.removeEventListener("pointerdown",Vo))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this}_mouseDown(e){if(je.touchHandled&&e.isTrusted&&(je.touchHandled=!1),!fe.mouseHandled)return e.button!==0||!this.dragEls.find(n=>n===e.target)&&e.target.closest(v0)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete fe.dragElement,delete fe.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),et&&(e.currentTarget.addEventListener("touchmove",Ro),e.currentTarget.addEventListener("touchend",Ho)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),fe.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const n=q.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(e){const n=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),fe.pauseDrag){const o=Number.isInteger(fe.pauseDrag)?fe.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),o)}else this._callDrag(e);else if(Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>3){this.dragging=!0,fe.dragElement=this;const o=this.el.gridstackNode?.grid;o?fe.dropElement=o.el.ddElement.ddDroppable:delete fe.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=q.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const i=q.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(i,this.ui()),this.triggerEvent("dragstart",i),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),et&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ro,!0),e.currentTarget.removeEventListener("touchend",Ho,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),fe.dropElement?.el===this.el.parentElement&&delete fe.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const n=q.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),fe.dropElement&&fe.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete fe.dragElement,delete fe.dropElement,delete fe.mouseHandled,e.preventDefault()}_keyEvent(e){const n=this.el.gridstackNode,o=n?.grid||fe.dropElement?.el?.gridstack;if(e.key==="Escape")n&&n._origRotate&&(n._orig=n._origRotate,delete n._origRotate),o?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(n&&o&&(e.key==="r"||e.key==="R")){if(!q.canBeRotated(n))return;n._origRotate=n._origRotate||{...n._orig},delete n._moving,o.setAnimation(!1).rotate(n.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),n._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,n.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",q.swap(n._orig,"w","h"),delete n._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=q.cloneNode(this.el)),e.parentElement||q.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=Sr.originStyleProp.map(n=>this.el.style[n]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const n=this.helper.style;return n.pointerEvents="none",n.width=this.dragOffset.width+"px",n.height=this.dragOffset.height+"px",n.willChange="left, top",n.position="fixed",this._dragFollow(e),n.transition="none",setTimeout(()=>{this.helper&&(n.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const e=this.helper,n=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",Sr.originStyleProp.forEach(o=>e.style[o]=this.dragElementOriginStyle[o]||null),setTimeout(()=>e.style.transition=n,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const n={left:0,top:0},o=this.helper.style,i=this.dragOffset;o.left=(e.clientX+i.offsetLeft-n.left)*this.dragTransform.xScale+"px",o.top=(e.clientY+i.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,n,o){let i=0,r=0;o&&(i=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const a=n.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-i,offsetTop:-e.clientY+a.top-r,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const e=this.el.parentElement.getBoundingClientRect(),n=this.helper.getBoundingClientRect();return{position:{top:(n.top-e.top)*this.dragTransform.yScale,left:(n.left-e.left)*this.dragTransform.xScale}}}};il.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var y0=class extends or{constructor(t,e={}){super(),this.el=t,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),et&&(this.el.addEventListener("pointerenter",el),this.el.addEventListener("pointerleave",tl)))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),t||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),et&&(this.el.removeEventListener("pointerenter",el),this.el.removeEventListener("pointerleave",tl)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this._setupAccept(),this}_mouseEnter(t){if(!fe.dragElement||je.touchHandled&&t.isTrusted||!this._canDrop(fe.dragElement.el))return;t.preventDefault(),t.stopPropagation(),fe.dropElement&&fe.dropElement!==this&&fe.dropElement._mouseLeave(t,!0),fe.dropElement=this;const e=q.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(fe.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(t,e=!1){if(!fe.dragElement||fe.dropElement!==this)return;t.preventDefault(),t.stopPropagation();const n=q.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(n,this._ui(fe.dragElement)),this.triggerEvent("dropout",n),fe.dropElement===this&&(delete fe.dropElement,!e)){let o,i=this.el.parentElement;for(;!o&&i;)o=i.ddElement?.ddDroppable,i=i.parentElement;o&&o._mouseEnter(t)}}drop(t){t.preventDefault();const e=q.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(fe.dragElement)),this.triggerEvent("drop",e)}_canDrop(t){return t&&(!this.accept||this.accept(t))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=t=>t.classList.contains(this.option.accept)||t.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(t){return{draggable:t.el,...t.ui()}}},_0=class ec{static init(e){return e.ddElement||(e.ddElement=new ec(e)),e.ddElement}constructor(e){this.el=e}on(e,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,n),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new il(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new ol(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new y0(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},w0=class{resizable(t,e,n,o){return this._getDDElements(t,e).forEach(i=>{if(e==="disable"||e==="enable")i.ddResizable&&i.ddResizable[e]();else if(e==="destroy")i.ddResizable&&i.cleanResizable();else if(e==="option")i.setupResizable({[n]:o});else{const r=i.el.gridstackNode.grid;let a=i.el.getAttribute("gs-resize-handles")||r.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");const l=!r.opts.alwaysShowResizeHandle;i.setupResizable({...r.opts.resizable,handles:a,autoHide:l,start:e.start,stop:e.stop,resize:e.resize})}}),this}draggable(t,e,n,o){return this._getDDElements(t,e).forEach(i=>{if(e==="disable"||e==="enable")i.ddDraggable&&i.ddDraggable[e]();else if(e==="destroy")i.ddDraggable&&i.cleanDraggable();else if(e==="option")i.setupDraggable({[n]:o});else{const r=i.el.gridstackNode.grid;i.setupDraggable({...r.opts.draggable,start:e.start,stop:e.stop,drag:e.drag})}}),this}dragIn(t,e){return this._getDDElements(t).forEach(n=>n.setupDraggable(e)),this}droppable(t,e,n,o){return typeof e.accept=="function"&&!e._accept&&(e._accept=e.accept,e.accept=i=>e._accept(i)),this._getDDElements(t,e).forEach(i=>{e==="disable"||e==="enable"?i.ddDroppable&&i.ddDroppable[e]():e==="destroy"?i.ddDroppable&&i.cleanDroppable():e==="option"?i.setupDroppable({[n]:o}):i.setupDroppable(e)}),this}isDroppable(t){return!!(t?.ddElement?.ddDroppable&&!t.ddElement.ddDroppable.disabled)}isDraggable(t){return!!(t?.ddElement?.ddDraggable&&!t.ddElement.ddDraggable.disabled)}isResizable(t){return!!(t?.ddElement?.ddResizable&&!t.ddElement.ddResizable.disabled)}on(t,e,n){return this._getDDElements(t).forEach(o=>o.on(e,i=>{n(i,fe.dragElement?fe.dragElement.el:i.target,fe.dragElement?fe.dragElement.helper:null)})),this}off(t,e){return this._getDDElements(t).forEach(n=>n.off(e)),this}_getDDElements(t,e){const n=t.gridstack||e!=="destroy"&&e!=="disable",o=q.getElements(t);return o.length?o.map(i=>i.ddElement||(n?_0.init(i):null)).filter(i=>i):[]}},Oe=new w0,tn=class ue{static init(e={},n=".grid-stack"){if(typeof document>"u")return null;const o=ue.getGridElement(n);return o?(o.gridstack||(o.gridstack=new ue(o,q.cloneDeep(e))),o.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
27
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},n=".grid-stack"){const o=[];return typeof document>"u"||(
|
|
28
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(e,n={}){if(!e)return null;let o=e;if(o.gridstack){const i=o.gridstack;return n&&(i.opts={...i.opts,...n}),n.children!==void 0&&i.load(n.children),i}return(!e.classList.contains("grid-stack")||ue.addRemoveCB)&&(ue.addRemoveCB?o=ue.addRemoveCB(e,n,!0,!0):o=q.createDiv(["grid-stack",n.class],e)),ue.init(n,o)}static registerEngine(e){ue.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=q.createDiv([this.opts.placeholderClass,Ge.itemClass,this.opts.itemClass]);const e=q.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,n={}){this.el=e,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=n=n||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const o=q.toNumber(e.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const i=n.columnOpts;if(i){const d=i.breakpoints;!i.columnWidth&&!d?.length?delete n.columnOpts:(i.columnMax=i.columnMax||12,d?.length>1&&d.sort((c,u)=>(u.w||0)-(c.w||0)))}const r={...q.cloneDeep(Ge),column:q.toNumber(e.getAttribute("gs-column"))||Ge.column,minRow:o||q.toNumber(e.getAttribute("gs-min-row"))||Ge.minRow,maxRow:o||q.toNumber(e.getAttribute("gs-max-row"))||Ge.maxRow,staticGrid:q.toBool(e.getAttribute("gs-static"))||Ge.staticGrid,sizeToContent:q.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||Ge.draggable.handle},removableOptions:{accept:n.itemClass||Ge.removableOptions.accept,decline:Ge.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=q.toBool(e.getAttribute("gs-animate"))),n=q.defaults(n,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=e.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const a=this.el.closest("."+Ge.itemClass)?.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==Ge.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const d=n.cellHeight;delete n.cellHeight,this.cellHeight(d)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=et),this._setStaticClass();const l=n.engineClass||ue.engineClass||nr;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:d=>{d.forEach(c=>{const u=c.el;u&&(c._removeDOM?(u&&u.remove(),delete c._removeDOM):this._writePosAttr(u,c))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(d=>this._prepareElement(d)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const d=n.children;delete n.children,d.length&&this.load(d)}this.setAnimation(),n.subGridDynamic&&!fe.pauseDrag&&(fe.pauseDrag=!0),n.draggable?.pause!==void 0&&(fe.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let n,o=e;if(o.grid=this,o.el?n=o.el:ue.addRemoveCB?n=ue.addRemoveCB(this.el,e,!0,!1):n=this.createWidgetDivs(o),!n)return;if(o=n.gridstackNode,o&&n.parentElement===this.el&&this.engine.nodes.find(r=>r._id===o._id))return n;const i=this._readAttr(n);return q.defaults(e,i),this.engine.prepareNode(e),this.el.appendChild(n),this.makeWidget(n,e),n}createWidgetDivs(e){const n=q.createDiv(["grid-stack-item",this.opts.itemClass]),o=q.createDiv(["grid-stack-item-content"],n);return q.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,ue.renderCB(o,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(n))):ue.renderCB(o,e),n}makeSubGrid(e,n,o,i=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;n=q.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...n||r.subGridOpts||{}}),r.subGridOpts=n;let d;n.column==="auto"&&(d=!0,n.column=Math.max(r.w||1,o?.w||1),delete n.columnOpts);let c=r.el.querySelector(".grid-stack-item-content"),u,f;if(i&&(this._removeDD(r.el),f={...r,x:0,y:0},q.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),ue.addRemoveCB?u=ue.addRemoveCB(this.el,f,!0,!1):(u=q.createDiv(["grid-stack-item"]),u.appendChild(c),c=q.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),o){const p=d?n.column:r.w,g=r.h+o.h,m=r.el.style;m.transition="none",this.update(r.el,{w:p,h:g}),setTimeout(()=>m.transition=null)}const h=r.subGrid=ue.addGrid(c,n);return o?._moving&&(h._isTemp=!0),d&&(h._autoColumn=!0),i&&h.makeWidget(u,f),o&&(o._moving?window.setTimeout(()=>q.simulateMouseEvent(o._event,"mouseenter",h.el),0):h.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),h}removeAsSubGrid(e){const n=this.parentGridNode?.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x+=this.parentGridNode.x,o.y+=this.parentGridNode.y,n.makeWidget(o.el,o)}),n.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>q.simulateMouseEvent(e._event,"mouseenter",n.el),0))}save(e=!0,n=!1,o=ue.saveCB,i){const r=this.engine.save(e,o,i);if(r.forEach(a=>{if(e&&a.el&&!a.subGrid&&!o)a.content=a.el.querySelector(".grid-stack-item-content")?.innerHTML,a.content||delete a.content;else if(!e&&!o&&delete a.content,a.subGrid?.el){const l=a.w||a.subGrid.getColumn(),d=a.subGrid.save(e,n,o,l);a.subGridOpts=n?d:{children:d},delete a.subGrid}delete a.el}),n){const a=q.cloneDeep(this.opts);a.marginBottom===a.marginTop&&a.marginRight===a.marginLeft&&a.marginTop===a.marginRight&&(a.margin=a.marginTop,delete a.marginTop,delete a.marginRight,delete a.marginBottom,delete a.marginLeft),a.rtl===(this.el.style.direction==="rtl")&&(a.rtl="auto"),this._isAutoCellHeight&&(a.cellHeight="auto"),this._autoColumn&&(a.column="auto");const l=a._alwaysShowResizeHandle;return delete a._alwaysShowResizeHandle,l!==void 0?a.alwaysShowResizeHandle=l:delete a.alwaysShowResizeHandle,q.removeInternalAndSame(a,Ge),a.children=r,a}return r}load(e,n=ue.addRemoveCB||!0){e=q.cloneDeep(e);const o=this.getColumn();e.forEach(u=>{u.w=u.w||u.minW||1,u.h=u.h||u.minH||1}),e=q.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let i=0;e.forEach(u=>{i=Math.max(i,(u.x||0)+u.w)}),i>this.engine.defaultColumn&&(this.engine.defaultColumn=i),i>o&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(i,o,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,i,!0));const r=ue.addRemoveCB;typeof n=="function"&&(ue.addRemoveCB=n);const a=[];this.batchUpdate();const l=!this.engine.nodes.length,d=l&&this.opts.animate;d&&this.setAnimation(!1),!l&&n&&[...this.engine.nodes].forEach(u=>{u.id&&(q.find(e,u.id)||(ue.addRemoveCB&&ue.addRemoveCB(this.el,u,!1,!1),a.push(u),this.removeWidget(u.el,!0,!1)))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(u=>q.find(e,u.id)?(c.push(u),!1):!0),e.forEach(u=>{const f=q.find(c,u.id);if(f){if(q.shouldSizeToContent(f)&&(u.h=f.h),this.engine.nodeBoundFix(u),(u.autoPosition||u.x===void 0||u.y===void 0)&&(u.w=u.w||f.w,u.h=u.h||f.h,this.engine.findEmptyPosition(u)),this.engine.nodes.push(f),q.samePos(f,u)&&this.engine.nodes.length>1&&(this.moveNode(f,{...u,forceCollide:!0}),q.copyPos(u,f)),this.update(f.el,u),u.subGridOpts?.children){const h=f.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(u.subGridOpts.children)}}else n&&this.addWidget(u)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?ue.addRemoveCB=r:delete ue.addRemoveCB,d&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const n=this.el.querySelector("."+this.opts.itemClass);if(n){const i=q.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/i)}const o=parseInt(this.el.getAttribute("gs-current-row"));return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+o}const n=q.parseHeight(e);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const n=this.getColumn();let o=n;const i=this._widthOrContainer(!0);if(e.columnWidth)o=Math.min(Math.round(i/e.columnWidth)||1,e.columnMax);else{o=e.columnMax;let r=0;for(;r<e.breakpoints.length&&i<=e.breakpoints[r].w;)o=e.breakpoints[r++].c||n}if(o!==n){const r=e.breakpoints?.find(a=>a.c===o);return this.column(o,r?.layout||e.layout),!0}return!1}compact(e="compact",n=!0){return this.engine.compact(e,n),this._triggerChangeEvent(),this}column(e,n="moveScale"){if(!e||e<1||this.opts.column===e)return this;const o=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,e,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,n=!1){const o=this.el.getBoundingClientRect();let i;n?i={top:o.top+document.documentElement.scrollTop,left:o.left}:i={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-i.left,a=e.top-i.top,l=o.width/this.getColumn(),d=o.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(a/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,n,o,i){return this.engine.isAreaEmpty(e,n,o,i)}makeWidget(e,n){const o=ue.getElement(e);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,n);const i=o.gridstackNode;this._updateContainerHeight(),i.subGridOpts&&this.makeSubGrid(o,i.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,o}on(e,n){return e.indexOf(" ")!==-1?(e.split(" ").forEach(o=>this.on(o,n)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=o=>n(o):this._gsEventHandler[e]=o=>{o.detail&&n(o,o.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=n:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(n=>this.off(n)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,n=!0,o=!0){return e?(ue.getElements(e).forEach(i=>{if(i.parentElement&&i.parentElement!==this.el)return;let r=i.gridstackNode;r||(r=this.engine.nodes.find(a=>i===a.el)),r&&(n&&ue.addRemoveCB&&ue.addRemoveCB(this.el,r,!1,!1),delete i.gridstackNode,this._removeDD(i),this.engine.removeNode(r,n,o),n&&i.parentElement&&i.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,n=!0){return this.engine.nodes.forEach(o=>{e&&ue.addRemoveCB&&ue.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(e,n),n&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,n=!0,o=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&o&&i.subGrid.setStatic(e,n,o)}),n&&this._setStaticClass(),this)}updateOptions(e){const n=this.opts;return e===n?this:(e.acceptWidgets!==void 0&&(n.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==n.class&&(n.class&&this.el.classList.remove(n.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(n.minRow=n.maxRow=n.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(n.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(n.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(n.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this)}update(e,n){return ue.getElements(e).forEach(o=>{const i=o?.gridstackNode;if(!i)return;const r={...q.copyPos({},i),...q.cloneDeep(n)};this.engine.nodeBoundFix(r),delete r.autoPosition;const a=["x","y","w","h"];let l;if(a.some(u=>r[u]!==void 0&&r[u]!==i[u])&&(l={},a.forEach(u=>{l[u]=r[u]!==void 0?r[u]:i[u],delete r[u]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const u=o.querySelector(".grid-stack-item-content");u&&u.textContent!==r.content&&(i.content=r.content,ue.renderCB(u,r),i.subGrid?.el&&(u.appendChild(i.subGrid.el),i.subGrid._updateContainerHeight())),delete r.content}let d=!1,c=!1;for(const u in r)u[0]!=="_"&&i[u]!==r[u]&&(i[u]=r[u],d=!0,c=c||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));if(q.sanitizeMinMax(i),l){const u=l.w!==void 0&&l.w!==i.w;this.moveNode(i,l),u&&i.subGrid?i.subGrid.onResize(this.hasAnimationCSS()?i.w:void 0):this.resizeToContentCheck(u,i),delete i._orig}(l||d)&&this._writeAttr(o,i),c&&this.prepareDragDrop(i.el),ue.updateCB&&ue.updateCB(i)}),this}moveNode(e,n){const o=e._updating;o||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,n),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const n=e.gridstackNode;if(!n)return;const o=n.grid;if(!o||e.parentElement!==o.el)return;const i=o.getCellHeight(!0);if(!i)return;let r=n.h?n.h*i:e.clientHeight,a;if(n.resizeToContentParent&&(a=e.querySelector(n.resizeToContentParent)),a||(a=e.querySelector(ue.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,d=n.h?n.h*i-l:a.clientHeight;let c;if(n.subGrid){c=n.subGrid.getRow()*n.subGrid.getCellHeight(!0);const h=n.subGrid.el.getBoundingClientRect(),p=e.getBoundingClientRect();c+=h.top-p.top}else{if(n.subGridOpts?.children?.length)return;{const h=a.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${n.id} '${ue.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=h.getBoundingClientRect().height||d}}if(d===c)return;r+=c-d;let u=Math.ceil(r/i);const f=Number.isInteger(n.sizeToContent)?n.sizeToContent:0;f&&u>f&&(u=f,e.classList.add("size-to-content-max")),n.minH&&u<n.minH?u=n.minH:n.maxH&&u>n.maxH&&(u=n.maxH),u!==n.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(n,{h:u}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){ue.resizeToContentCB?ue.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,n){return ue.getElements(e).forEach(o=>{const i=o.gridstackNode;if(!q.canBeRotated(i))return;const r={w:i.h,h:i.w,minH:i.minW,minW:i.minH,maxH:i.maxW,maxW:i.maxH};if(n){const l=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;r.x=i.x+l-(i.h-(d+1)),r.y=i.y+d-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const a=i._orig;this.update(o,r),i._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const n=q.parseHeight(e);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(n=>{delete n._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,n){const o=n?new CustomEvent(e,{bubbles:!1,detail:n}):new Event(e);let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;return i.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const o=this.opts.cellHeight,i=this.opts.cellHeightUnit;if(!o)return this;if(!e&&!this.opts.minRow){const r=q.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===i){const a=Math.floor(r.h/o);n<a&&(n=a)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[e?"minHeight":"height"]=n*o+i),e&&q.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,n=!1,o){o=o||this._readAttr(e),e.gridstackNode=o,o.el=e,o.grid=this,o=this.engine.addNode(o,n),this._writeAttr(e,o),e.classList.add(Ge.itemClass,this.opts.itemClass);const i=q.shouldSizeToContent(o);return i?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),i&&this.resizeToContentCheck(!1,o),q.lazyLoad(o)||this.prepareDragDrop(o.el),this}_writePosAttr(e,n){return(!n._moving&&!n._resizing||this._placeholder===e)&&(e.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,e.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,e.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,e.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),e.setAttribute("gs-x",String(n.x)),e.setAttribute("gs-y",String(n.y)),n.w>1?e.setAttribute("gs-w",String(n.w)):e.removeAttribute("gs-w"),n.h>1?e.setAttribute("gs-h",String(n.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,n){if(!n)return this;this._writePosAttr(e,n);const o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const i in o)n[i]?e.setAttribute(o[i],String(n[i])):e.removeAttribute(o[i]);return this}_readAttr(e,n=!0){const o={};o.x=q.toNumber(e.getAttribute("gs-x")),o.y=q.toNumber(e.getAttribute("gs-y")),o.w=q.toNumber(e.getAttribute("gs-w")),o.h=q.toNumber(e.getAttribute("gs-h")),o.autoPosition=q.toBool(e.getAttribute("gs-auto-position")),o.noResize=q.toBool(e.getAttribute("gs-no-resize")),o.noMove=q.toBool(e.getAttribute("gs-no-move")),o.locked=q.toBool(e.getAttribute("gs-locked"));const i=e.getAttribute("gs-size-to-content");i&&(i==="true"||i==="false"?o.sizeToContent=q.toBool(i):o.sizeToContent=parseInt(i,10)),o.id=e.getAttribute("gs-id"),o.maxW=q.toNumber(e.getAttribute("gs-max-w")),o.minW=q.toNumber(e.getAttribute("gs-min-w")),o.maxH=q.toNumber(e.getAttribute("gs-max-h")),o.minH=q.toNumber(e.getAttribute("gs-min-h")),n&&(o.w===1&&e.removeAttribute("gs-w"),o.h===1&&e.removeAttribute("gs-h"),o.maxW&&e.removeAttribute("gs-max-w"),o.minW&&e.removeAttribute("gs-min-w"),o.maxH&&e.removeAttribute("gs-max-h"),o.minH&&e.removeAttribute("gs-min-h"));for(const r in o){if(!o.hasOwnProperty(r))return;!o[r]&&o[r]!==0&&r!=="sizeToContent"&&delete o[r]}return o}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,n=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)q.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(o=>q.shouldSizeToContent(o))){const o=[...this.engine.nodes];this.batchUpdate(),o.forEach(i=>{q.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(e=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!e&&n&&!this.resizeObserver?(this._sizeThrottle=q.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return q.getElement(e)}static getElements(e=".grid-stack-item"){return q.getElements(e)}static getGridElement(e){return ue.getElement(e)}static getGridElements(e){return q.getElements(e)}_initMargin(){let e,n=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(e=q.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,n=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(r=>{this.opts[r]===void 0?this.opts[r]=n:(e=q.parseHeight(this.opts[r]),this.opts[r]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const i=this.el.style;return i.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Oe}static setupDragIn(e,n,o,i=document){n?.pause!==void 0&&(fe.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof e=="string"?q.getElements(e,i):e).forEach((r,a)=>{Oe.isDraggable(r)||Oe.dragIn(r,n),o?.[a]&&(r.gridstackNode=o[a])})}movable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noMove:i.noMove=!0,this.prepareDragDrop(i.el))}),this)}resizable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noResize:i.noResize=!0,this.prepareDragDrop(i.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableMove(e,n)}),this)}enableResize(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableResize(e,n)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&ue._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Oe.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Oe.droppable(this.el,"destroy"),this;let e,n;const o=(i,r,a)=>{a=a||r;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const h=a.getBoundingClientRect();a.style.left=h.x+(this.dragTransform.xScale-1)*(i.clientX-h.x)/this.dragTransform.xScale+"px",a.style.top=h.y+(this.dragTransform.yScale-1)*(i.clientY-h.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:d,left:c}=a.getBoundingClientRect();const u=this.el.getBoundingClientRect();c-=u.left,d-=u.top;const f={position:{top:d*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/n)),l.y=Math.max(0,Math.round(d/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Oe.off(r,"drag");return}l._willFitPos&&(q.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,i,f,l,n,e)}else this._dragOrResize(a,i,f,l,n,e)};return Oe.droppable(this.el,{accept:i=>{const r=i.gridstackNode||this._readAttr(i,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(i);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=i.matches(l)}if(a&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(i,r,a)=>{let l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,a),a=a||r,n=this.cellWidth(),e=this.getCellHeight(!0),!l){const u=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(u){try{l=JSON.parse(u)}catch{console.error("Gridstack dropover: Bad JSON format: ",u)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const d=l.w||Math.round(a.offsetWidth/n)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:d,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=d,l.h=c,l._temporaryRemoved=!0),ue._itemRemoving(l.el,!1),Oe.on(r,"drag",o),o(i,r,a),!1}).on(this.el,"dropout",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const d=!!this.placeholder.parentElement,c=r!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode,d&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const u=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,d&&u?.grid&&u.grid!==this){const h=u.grid;h.engine.removeNodeFromLayoutCache(u),h.engine.removedNodes.push(u),h._triggerRemoveEvent()._triggerChangeEvent(),h.parentGridNode&&!h.engine.nodes.length&&h.opts.subGridDynamic&&h.removeAsSubGrid()}if(!l||(d&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Oe.off(r,"drag"),a!==r?(a.remove(),r=a):r.remove(),this._removeDD(r),!d))return!1;const f=l.subGrid?.el?.gridstack;return q.copyPos(l,this._readAttr(this.placeholder)),q.removePositioningStyles(r),c&&(l.content||l.subGridOpts||ue.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...i,type:"dropped"},u&&u.grid?u:void 0,l),!1}),this}static _itemRemoving(e,n){if(!e)return;const o=e?e.gridstackNode:void 0;!o?.grid||e.classList.contains(o.grid.opts.removableOptions.decline)||(n?o._isAboutToRemove=!0:delete o._isAboutToRemove,n?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Oe.isDroppable(e)&&Oe.droppable(e,this.opts.removableOptions).on(e,"dropover",(n,o)=>ue._itemRemoving(o,!0)).on(e,"dropout",(n,o)=>ue._itemRemoving(o,!1)),this):this}prepareDragDrop(e,n=!1){const o=e?.gridstackNode;if(!o)return;const i=o.noMove||this.opts.disableDrag,r=o.noResize||this.opts.disableResize,a=this.opts.staticGrid||i&&r;if((n||a)&&(o._initDD&&(this._removeDD(e),delete o._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!o._initDD){let l,d;const c=(h,p)=>{this.triggerEvent(h,h.target),l=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(e,h,p,o,l,d)},u=(h,p)=>{this._dragOrResize(e,h,p,o,l,d)},f=h=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;const p=o.w!==o._orig.w,g=h.target;if(!(!g.gridstackNode||g.gridstackNode.grid!==this)){if(o.el=g,o._isAboutToRemove){const m=e.gridstackNode.grid;m._gsEventHandler[h.type]&&m._gsEventHandler[h.type](h,g),m.engine.nodes.push(o),m.removeWidget(e,!0,!0)}else q.removePositioningStyles(g),o._temporaryRemoved?(this._writePosAttr(g,o),this.engine.addNode(o)):this._writePosAttr(g,o),this.triggerEvent(h,g);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),h.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(p,o))}};Oe.draggable(e,{start:c,stop:f,drag:u}).resizable(e,{start:c,stop:f,resize:u}),o._initDD=!0}return Oe.draggable(e,i?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,n,o,i,r,a){if(this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=i,i.grid?.el)this.dragTransform=q.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=q.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(i.el=this.placeholder,i._lastUiPosition=o.position,i._prevYPix=o.position.top,i._moving=n.type==="dragstart",i._resizing=n.type==="resizestart",delete i._lastTried,n.type==="dropover"&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const l=this.getColumn()-i.x,d=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-i.y;Oe.resizable(e,"option","minWidth",r*Math.min(i.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(i.minH||1,d)).resizable(e,"option","maxWidth",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,i.x+i.w)).resizable(e,"option","maxHeight",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,d)).resizable(e,"option","maxHeightMoveUp",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,i.y+i.h))}}_dragOrResize(e,n,o,i,r,a){const l={...i._orig};let d,c=this.opts.marginLeft,u=this.opts.marginRight,f=this.opts.marginTop,h=this.opts.marginBottom;const p=Math.round(a*.1),g=Math.round(r*.1);if(c=Math.min(c,g),u=Math.min(u,g),f=Math.min(f,p),h=Math.min(h,p),n.type==="drag"){if(i._temporaryRemoved)return;const w=o.position.top-i._prevYPix;i._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&q.updateScrollPosition(e,o.position,w);const I=o.position.left+(o.position.left>i._lastUiPosition.left?-u:c),y=o.position.top+(o.position.top>i._lastUiPosition.top?-h:f);l.x=Math.round(I/r),l.y=Math.round(y/a);const v=this._extraDragRow;if(this.engine.collide(i,l)){const C=this.getRow();let $=Math.max(0,l.y+i.h-C);this.opts.maxRow&&C+$>this.opts.maxRow&&($=Math.max(0,this.opts.maxRow-C)),this._extraDragRow=$}else this._extraDragRow=0;if(this._extraDragRow!==v&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if(n.type==="resize"){if(l.x<0||(q.updateScrollResize(n,e,a),l.w=Math.round((o.size.width-c)/r),l.h=Math.round((o.size.height-f)/a),i.w===l.w&&i.h===l.h)||i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;const w=o.position.left+c,I=o.position.top+f;l.x=Math.round(w/r),l.y=Math.round(I/a),d=!0}i._event=n,i._lastTried=l;const m={x:o.position.left+c,y:o.position.top+f,w:(o.size?o.size.width:i.w*r)-c-u,h:(o.size?o.size.height:i.h*a)-f-h};if(this.engine.moveNodeCheck(i,{...l,cellWidth:r,cellHeight:a,rect:m,resizing:d})){i._lastUiPosition=o.position,this.engine.cacheRects(r,a,f,u,h,c),delete i._skipDown,d&&i.subGrid&&i.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const w=n.target;i._sidebarOrig||this._writePosAttr(w,i),this.triggerEvent(n,w)}}triggerEvent(e,n){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[e.type]&&o._gsEventHandler[e.type](e,n)}_leave(e,n){n=n||e;const o=n.gridstackNode;if(!o||(n.style.transform=n.style.transformOrigin=null,Oe.off(e,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&n?n:e;const i=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=i,this.opts.removable===!0&&ue._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}};tn.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)},tn.resizeToContentParent=".grid-stack-item-content",tn.Utils=q,tn.Engine=nr,tn.GDRev="12.4.2";var b0={class:"d-layout"},C0=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-locked","gs-no-resize","gs-no-move","gs-min-w","gs-min-h","gs-max-w","gs-max-h"],E0=(0,s.defineComponent)({name:"DLayout",__name:"layout",props:{modelValue:{default:()=>[]},column:{default:24},cellHeight:{default:60},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},float:{type:Boolean,default:!0},removable:{type:Boolean,default:!1},removableOptions:{}},emits:["update:modelValue","added","removed","changed","dragStart","dragStop","resizeStart","resizeStop"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=(0,s.ref)();let a=null;const l=async()=>{r.value&&(await(0,s.nextTick)(),a&&a.destroy(!1),a=tn.init({column:o.column,cellHeight:o.cellHeight,disableDrag:!(o.draggable&&!o.disable),disableResize:!(o.resizable&&!o.disable),animate:o.animate,float:o.float,removable:o.removable,removableOptions:o.removableOptions},r.value),a.on("added",(h,p)=>{const g=p[0];g&&(i("added",d(g)),u())}),a.on("removed",(h,p)=>{const g=p[0];g&&(i("removed",d(g)),u())}),a.on("change",()=>{u(),i("changed",(a?.save()||[]).map(h=>d(h)))}),a.on("dragstart",(h,p)=>{p&&i("dragStart",h,d(p.gridstackNode||p))}),a.on("dragstop",(h,p)=>{p&&i("dragStop",h,d(p.gridstackNode||p))}),a.on("resizestart",(h,p)=>{p&&i("resizeStart",h,d(p.gridstackNode||p))}),a.on("resizestop",(h,p)=>{p&&i("resizeStop",h,d(p.gridstackNode||p))}))},d=h=>({id:h.id||h.el?.getAttribute("gs-id")||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1,locked:h.locked||!1,noResize:h.noResize||!1,noMove:h.noMove||!1,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}),c=async()=>{if(!a||!r.value)return;await(0,s.nextTick)();const h=a.engine.nodes;new Set(h.map(g=>g.id));const p=new Set(o.modelValue.map(g=>g.id));h.forEach(g=>{if(!p.has(g.id||"")){const m=g.el;m&&a&&a.removeWidget(m,!1)}}),o.modelValue.forEach(g=>{const m=h.find(w=>w.id===g.id);if(m)m.el&&a&&a.update(m.el,{x:g.x,y:g.y,w:g.w,h:g.h,locked:g.locked,noResize:g.noResize,noMove:g.noMove,minW:g.minW,minH:g.minH,maxW:g.maxW,maxH:g.maxH});else{if(!r.value||!a)return;const w=r.value.querySelector(`[gs-id="${g.id}"]`);w&&a.makeWidget(w)}})},u=()=>{a&&i("update:modelValue",a.save().map(h=>{const p={id:h.id||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1},g=o.modelValue.find(m=>m.id===p.id);return g&&Object.keys(g).forEach(m=>{["id","x","y","w","h"].includes(m)||(p[m]=g[m])}),p}))},f=(0,s.computed)(()=>o.modelValue);return(0,s.watch)(()=>o.modelValue,async()=>{a&&(await(0,s.nextTick)(),c())},{deep:!0}),(0,s.watch)(()=>[o.column,o.cellHeight,o.draggable,o.resizable,o.disable,o.animate,o.float,o.removable],()=>{l()}),(0,s.onMounted)(()=>{l()}),(0,s.onBeforeUnmount)(()=>{a&&(a.destroy(!1),a=null)}),e({addItem:async h=>{if(a&&r.value){await(0,s.nextTick)();const p=r.value.querySelector(`[gs-id="${h.id}"]`);p&&(a.makeWidget(p),a.update(p,{x:h.x,y:h.y,w:h.w,h:h.h,locked:h.locked,noResize:h.noResize,noMove:h.noMove,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}))}},removeItem:h=>{if(a&&r.value){const p=r.value.querySelector(`[gs-id="${h}"]`);p&&a.removeWidget(p,!1)}},clear:()=>{a&&a.removeAll(!1)},getGrid:()=>a}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",b0,[(0,s.createElementVNode)("div",{ref_key:"gridContainerRef",ref:r},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(f.value,g=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:g.id,"gs-id":g.id,"gs-x":g.x,"gs-y":g.y,"gs-w":g.w,"gs-h":g.h,"gs-locked":g.locked,"gs-no-resize":g.noResize,"gs-no-move":g.noMove,"gs-min-w":g.minW,"gs-min-h":g.minH,"gs-max-w":g.maxW,"gs-max-h":g.maxH,class:"d-layout-item"},[(0,s.renderSlot)(h.$slots,"item",{item:g})],8,C0))),128))],512)]))}}),x0=E0,rl=Mt(x0),Be=(t,e="",n=!1)=>n?`${t}pt`:e?`${t}${e}`:`${t}px`,He=(t,e=0)=>t==null||isNaN(t)?0:Number(Number(t).toFixed(e)),S0=t=>t*3/4,k0=t=>t*4/3,N0=["onMousedown"],D0={key:2,class:"d-draggable__mask"},T0=(0,s.defineComponent)({name:"DDraggable",__name:"draggable",props:{index:{},mask:{type:Boolean,default:!0},scale:{default:1},readonly:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},step:{default:1},zIndex:{default:1},isActiveBgTransparent:{type:Boolean,default:!1},left:{default:0},top:{default:0},width:{},height:{},activeFlag:{type:Boolean,default:!1},isPt:{type:Boolean,default:!1}},emits:["focus","blur","over","out"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=(0,s.ref)(),a=(0,s.ref)(),l=(0,s.ref)(0),d=(0,s.ref)(0),c=(0,s.ref)(0),u=(0,s.ref)(0),f=(0,s.ref)(null),h=(0,s.ref)(!1),p=(0,s.ref)(!1),g=(0,s.ref)(!1),m=(0,s.ref)(!1),w=(0,s.ref)([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),I=(0,s.computed)(()=>o.scale),y=(0,s.computed)(()=>({left:Be(I.value,"",o.isPt)})),v=(0,s.computed)(()=>({left:Be(-I.value,"",o.isPt)})),C=(0,s.computed)(()=>({left:"auto",right:Be(-I.value,"",o.isPt)})),$=(0,s.computed)(()=>({top:Be(-I.value,"",o.isPt)})),z=(0,s.computed)(()=>({top:"auto",bottom:Be(-I.value,"",o.isPt)})),W=(0,s.computed)(()=>{const X=8*I.value;return{width:Be(X,"",o.isPt),height:Be(X,"",o.isPt)}}),j=(0,s.computed)(()=>({fontSize:Be(16*I.value,"",o.isPt)})),D=(0,s.computed)(()=>Object.assign((()=>{if(m.value){const X={zIndex:9999,...y.value};return o.isActiveBgTransparent&&(m.value||p.value)&&!o.readonly&&!o.disabled&&(X.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),X}return{zIndex:o.zIndex}})(),{top:Be(u.value,"",o.isPt),width:Be(l.value,"",o.isPt),height:Be(d.value,"",o.isPt),padding:Be(8*I.value,"",o.isPt),...y.value,left:Be(c.value,"",o.isPt)}));(0,s.watch)(()=>o.width,X=>{l.value=He(H(X))||(f.value?.offsetWidth??0)}),(0,s.watch)(()=>o.height,X=>{d.value=He(H(X))||(f.value?.offsetHeight??0)},{deep:!0}),(0,s.watch)(()=>o.left,X=>{c.value=He(H(X))}),(0,s.watch)(()=>o.top,X=>{u.value=He(H(X))}),(0,s.watch)(l,X=>{r.value&&(r.value.style.width=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.width=Be(X,"",o.isPt)))}),(0,s.watch)(d,X=>{r.value&&(r.value.style.height=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.height=Be(X,"",o.isPt)))}),(0,s.watch)(()=>o.activeFlag,X=>{O(X)});const O=X=>{m.value=X},H=X=>X===void 0?0:o.isPt?k0(X):X,S=()=>{a.value&&a.value.firstChild&&(f.value=a.value.firstChild,l.value=He(H(o.width))||(f.value?.offsetWidth??0),d.value=He(H(o.height))||(f.value?.offsetHeight??0),c.value=He(H(o.left)),u.value=He(H(o.top)),O(o.activeFlag))},Y=X=>{c.value=X},b=X=>{u.value=X},B=X=>{const J=8*I.value/2,U={};return X.split("-").forEach(Z=>{U[Z]=Be(-J,"",o.isPt)}),U},_=X=>{p.value=X},x=X=>o.isPt?S0(X):X,T=()=>{h.value=!0,i("focus",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},P=()=>{h.value=!1,g.value=!1,i("blur",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},L=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,P()}},M=(X,J)=>{if(o.disabled||o.readonly)return;let U,Z,te,oe,ae,ee;g.value=!0,T();let ie=X.clientX,R=X.clientY;document.onmousemove=E=>{h.value=!0,J==="right"?(U=!0,Z=!1):J==="left"?(U=!0,te=!0,ae=!0,Z=!1):J==="top"?(U=!1,Z=!0,oe=!0,ee=!0):J==="bottom"?(U=!1,Z=!0):J==="bottom-right"?(U=!0,Z=!0):J==="bottom-left"?(U=!0,Z=!0,te=!0,ae=!0):J==="top-right"?(U=!0,Z=!0,oe=!0,ee=!0):J==="top-left"&&(U=!0,Z=!0,te=!0,ae=!0,oe=!0,ee=!0);const k=E.clientX-ie,A=E.clientY-R;if(ie=E.clientX,R=E.clientY,U){let N=k*o.step;ae&&(N=-N),te&&(c.value=He(c.value-N)),l.value=He(l.value+N)}if(Z){let N=A*o.step;ee&&(N=-N),oe&&(u.value=He(u.value-N)),d.value=He(d.value+N)}},L()},V=()=>{p.value=!1,i("out",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},F=()=>{o.disabled||o.readonly||(p.value=!0,i("over",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)}))},G=X=>{if(o.disabled||o.readonly)return;m.value=!0,T();let J=X.clientX,U=X.clientY;document.onmousemove=Z=>{const te=Z.clientX-J,oe=Z.clientY-U;J=Z.clientX,U=Z.clientY,c.value=He(c.value+te*o.step),u.value=He(u.value+oe*o.step)},L()};return(0,s.onMounted)(()=>{S()}),e({setActive:O,setLeft:Y,setTop:b,setOverActive:_}),(X,J)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["d-draggable",{"d-draggable--active":(m.value||p.value)&&!t.readonly&&!t.disabled},{"d-draggable--pt":t.isPt&&!t.readonly&&!t.disabled},{"d-draggable--move":h.value},{"d-draggable--click":t.disabled}]),onMousedown:(0,s.withModifiers)(G,["stop"]),onMouseover:(0,s.withModifiers)(F,["stop"]),onMouseout:(0,s.withModifiers)(V,["stop"]),style:(0,s.normalizeStyle)(D.value)},[(0,s.createElementVNode)("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:r},[(m.value||p.value||h.value)&&!t.readonly&&!t.disabled?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...$.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...v.value}),class:"d-draggable__line d-draggable__line--top"},null,4),t.isPt?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...$.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...v.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...z.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...C.value}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...z.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...C.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:(0,s.normalizeStyle)(j.value)},(0,s.toDisplayString)(c.value)+","+(0,s.toDisplayString)(u.value),5))],64)):(0,s.createCommentVNode)("",!0),!t.readonly&&!t.disabled?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(w.value,(U,Z)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:Z},[m.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:(0,s.normalizeClass)(["d-draggable__range",`d-draggable__range--${U.classname}`]),style:(0,s.normalizeStyle)([W.value,B(U.classname)]),onMousedown:(0,s.withModifiers)(te=>M(te,U.classname),["stop"])},null,46,N0)):(0,s.createCommentVNode)("",!0)],64))),128)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",{class:"d-draggable__item",ref_key:"item",ref:a},[(0,s.renderSlot)(X.$slots,"default")],512),!t.disabled&&t.mask?((0,s.openBlock)(),(0,s.createElementBlock)("div",D0)):(0,s.createCommentVNode)("",!0)],512)],38))}}),I0=T0,sl=Mt(I0),M0=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.form;const a={};r.components.forEach(l=>{const d=e[l.type];a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:d?.dragType||"component",componentName:d?.componentName||"",runtimeType:d?.runtimeType,groupId:l.groupId,config:l.config,isInput:d?.isInput!==!1,containerId:l.containerId,level:l.level};d?.dragType==="container"&&(c.children=[]),i[c.id]=c,a[l.containerId].push(c)}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.form||[]}return{formConfig:n,componentList:o,componentDic:i}},al=(t,e)=>{const n={ver:"V3",form:{...t},components:[],db:{}};return ll(e||[],n.components),n},ll=(t,e)=>{t.forEach(n=>{if(n.type==="pkey")return;const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};n.dragType==="container"&&ll(n.children||[],e),e.push(o)})};function B0(t){const{toString:e}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&t instanceof Element?"element":n[e.call(t)]}function ir(t){const e=B0(t);let n;if(e==="array")n=[];else if(e==="object")n={};else return t;if(e==="array")for(let o=0,i=t.length;o<i;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,n.push(ir(t[o]));else e==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,n[o]=ir(t[o])});return n}var z0=Pe(((t,e)=>{(function(n,o){typeof t=="object"&&typeof e<"u"?e.exports=o():typeof define=="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self).dayjs=o()})(t,(function(){"use strict";var n=1e3,o=6e4,i=36e5,r="millisecond",a="second",l="minute",d="hour",c="day",u="week",f="month",h="quarter",p="year",g="date",m="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(b){var B=["th","st","nd","rd"],_=b%100;return"["+b+(B[(_-20)%10]||B[_]||B[0])+"]"}},v=function(b,B,_){var x=String(b);return!x||x.length>=B?b:""+Array(B+1-x.length).join(_)+b},C={s:v,z:function(b){var B=-b.utcOffset(),_=Math.abs(B),x=Math.floor(_/60),T=_%60;return(B<=0?"+":"-")+v(x,2,"0")+":"+v(T,2,"0")},m:function b(B,_){if(B.date()<_.date())return-b(_,B);var x=12*(_.year()-B.year())+(_.month()-B.month()),T=B.clone().add(x,f),P=_-T<0,L=B.clone().add(x+(P?-1:1),f);return+(-(x+(_-T)/(P?T-L:L-T))||0)},a:function(b){return b<0?Math.ceil(b)||0:Math.floor(b)},p:function(b){return{M:f,y:p,w:u,d:c,D:g,h:d,m:l,s:a,ms:r,Q:h}[b]||String(b||"").toLowerCase().replace(/s$/,"")},u:function(b){return b===void 0}},$="en",z={};z[$]=y;var W="$isDayjsObject",j=function(b){return b instanceof S||!(!b||!b[W])},D=function b(B,_,x){var T;if(!B)return $;if(typeof B=="string"){var P=B.toLowerCase();z[P]&&(T=P),_&&(z[P]=_,T=P);var L=B.split("-");if(!T&&L.length>1)return b(L[0])}else{var M=B.name;z[M]=B,T=M}return!x&&T&&($=T),T||!x&&$},O=function(b,B){if(j(b))return b.clone();var _=typeof B=="object"?B:{};return _.date=b,_.args=arguments,new S(_)},H=C;H.l=D,H.i=j,H.w=function(b,B){return O(b,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var S=(function(){function b(_){this.$L=D(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[W]=!0}var B=b.prototype;return B.parse=function(_){this.$d=(function(x){var T=x.date,P=x.utc;if(T===null)return new Date(NaN);if(H.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var L=T.match(w);if(L){var M=L[2]-1||0,V=(L[7]||"0").substring(0,3);return P?new Date(Date.UTC(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,V)):new Date(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,V)}}return new Date(T)})(_),this.init()},B.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},B.$utils=function(){return H},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(_,x){var T=O(_);return this.startOf(x)<=T&&T<=this.endOf(x)},B.isAfter=function(_,x){return O(_)<this.startOf(x)},B.isBefore=function(_,x){return this.endOf(x)<O(_)},B.$g=function(_,x,T){return H.u(_)?this[x]:this.set(T,_)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(_,x){var T=this,P=!!H.u(x)||x,L=H.p(_),M=function(te,oe){var ae=H.w(T.$u?Date.UTC(T.$y,oe,te):new Date(T.$y,oe,te),T);return P?ae:ae.endOf(c)},V=function(te,oe){return H.w(T.toDate()[te].apply(T.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(oe)),T)},F=this.$W,G=this.$M,X=this.$D,J="set"+(this.$u?"UTC":"");switch(L){case p:return P?M(1,0):M(31,11);case f:return P?M(1,G):M(0,G+1);case u:var U=this.$locale().weekStart||0,Z=(F<U?F+7:F)-U;return M(P?X-Z:X+(6-Z),G);case c:case g:return V(J+"Hours",0);case d:return V(J+"Minutes",1);case l:return V(J+"Seconds",2);case a:return V(J+"Milliseconds",3);default:return this.clone()}},B.endOf=function(_){return this.startOf(_,!1)},B.$set=function(_,x){var T,P=H.p(_),L="set"+(this.$u?"UTC":""),M=(T={},T[c]=L+"Date",T[g]=L+"Date",T[f]=L+"Month",T[p]=L+"FullYear",T[d]=L+"Hours",T[l]=L+"Minutes",T[a]=L+"Seconds",T[r]=L+"Milliseconds",T)[P],V=P===c?this.$D+(x-this.$W):x;if(P===f||P===p){var F=this.clone().set(g,1);F.$d[M](V),F.init(),this.$d=F.set(g,Math.min(this.$D,F.daysInMonth())).$d}else M&&this.$d[M](V);return this.init(),this},B.set=function(_,x){return this.clone().$set(_,x)},B.get=function(_){return this[H.p(_)]()},B.add=function(_,x){var T,P=this;_=Number(_);var L=H.p(x),M=function(G){var X=O(P);return H.w(X.date(X.date()+Math.round(G*_)),P)};if(L===f)return this.set(f,this.$M+_);if(L===p)return this.set(p,this.$y+_);if(L===c)return M(1);if(L===u)return M(7);var V=(T={},T[l]=o,T[d]=i,T[a]=n,T)[L]||1,F=this.$d.getTime()+_*V;return H.w(F,this)},B.subtract=function(_,x){return this.add(-1*_,x)},B.format=function(_){var x=this,T=this.$locale();if(!this.isValid())return T.invalidDate||m;var P=_||"YYYY-MM-DDTHH:mm:ssZ",L=H.z(this),M=this.$H,V=this.$m,F=this.$M,G=T.weekdays,X=T.months,J=T.meridiem,U=function(oe,ae,ee,ie){return oe&&(oe[ae]||oe(x,P))||ee[ae].slice(0,ie)},Z=function(oe){return H.s(M%12||12,oe,"0")},te=J||function(oe,ae,ee){var ie=oe<12?"AM":"PM";return ee?ie.toLowerCase():ie};return P.replace(I,(function(oe,ae){return ae||(function(ee){switch(ee){case"YY":return String(x.$y).slice(-2);case"YYYY":return H.s(x.$y,4,"0");case"M":return F+1;case"MM":return H.s(F+1,2,"0");case"MMM":return U(T.monthsShort,F,X,3);case"MMMM":return U(X,F);case"D":return x.$D;case"DD":return H.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return U(T.weekdaysMin,x.$W,G,2);case"ddd":return U(T.weekdaysShort,x.$W,G,3);case"dddd":return G[x.$W];case"H":return String(M);case"HH":return H.s(M,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(M,V,!0);case"A":return te(M,V,!1);case"m":return String(V);case"mm":return H.s(V,2,"0");case"s":return String(x.$s);case"ss":return H.s(x.$s,2,"0");case"SSS":return H.s(x.$ms,3,"0");case"Z":return L}return null})(oe)||L.replace(":","")}))},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(_,x,T){var P,L=this,M=H.p(x),V=O(_),F=(V.utcOffset()-this.utcOffset())*o,G=this-V,X=function(){return H.m(L,V)};switch(M){case p:P=X()/12;break;case f:P=X();break;case h:P=X()/3;break;case u:P=(G-F)/6048e5;break;case c:P=(G-F)/864e5;break;case d:P=G/i;break;case l:P=G/o;break;case a:P=G/n;break;default:P=G}return T?P:H.a(P)},B.daysInMonth=function(){return this.endOf(f).$D},B.$locale=function(){return z[this.$L]},B.locale=function(_,x){if(!_)return this.$L;var T=this.clone(),P=D(_,x,!0);return P&&(T.$L=P),T},B.clone=function(){return H.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},b})(),Y=S.prototype;return O.prototype=Y,[["$ms",r],["$s",a],["$m",l],["$H",d],["$W",c],["$M",f],["$y",p],["$D",g]].forEach((function(b){Y[b[1]]=function(B){return this.$g(B,b[0],b[1])}})),O.extend=function(b,B){return b.$i||(b(B,S,O),b.$i=!0),O},O.locale=D,O.isDayjs=j,O.unix=function(b){return O(1e3*b)},O.en=z[$],O.Ls=z,O.p={},O}))})),wy=bt(z0(),1);function cl(t){const e="j-loading-spin",n=document.querySelector(`.${e}`);if(t){if(!n){document.body.style.overflow="hidden";const o=new DocumentFragment,i=document.createElement("div");i.className=e;const r=document.createElement("span");r.className="j-loading-spin-dot";for(let a=0;a<4;a++){const l=document.createElement("i");r.appendChild(l)}i.appendChild(r),o.appendChild(i),document.body.appendChild(o)}}else n&&n.parentNode&&(document.body.style.overflow="",n.parentNode.removeChild(n))}var by=(()=>{let t=null,e=0;return n=>{n?(e++,t&&clearTimeout(t),cl(!0),t=null):(e=Math.max(0,e-1),e===0&&(t&&clearTimeout(t),t=setTimeout(()=>{cl(!1),t=null},400)))}})(),A0=Pe(((t,e)=>{e.exports={}})),Xe=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o():typeof define=="function"&&define.amd?define([],o):n.CryptoJS=o()})(t,function(){var n=n||(function(o,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof require=="function")try{r=A0()}catch{}var a=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||(function(){function y(){}return function(v){var C;return y.prototype=v,C=new y,y.prototype=null,C}})(),d={},c=d.lib={},u=c.Base=(function(){return{extend:function(y){var v=l(this);return y&&v.mixIn(y),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var v in y)y.hasOwnProperty(v)&&(this[v]=y[v]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=u.extend({init:function(y,v){y=this.words=y||[],v!=i?this.sigBytes=v:this.sigBytes=y.length*4},toString:function(y){return(y||p).stringify(this)},concat:function(y){var v=this.words,C=y.words,$=this.sigBytes,z=y.sigBytes;if(this.clamp(),$%4)for(var W=0;W<z;W++){var j=C[W>>>2]>>>24-W%4*8&255;v[$+W>>>2]|=j<<24-($+W)%4*8}else for(var D=0;D<z;D+=4)v[$+D>>>2]=C[D>>>2];return this.sigBytes+=z,this},clamp:function(){var y=this.words,v=this.sigBytes;y[v>>>2]&=4294967295<<32-v%4*8,y.length=o.ceil(v/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var v=[],C=0;C<y;C+=4)v.push(a());return new f.init(v,y)}}),h=d.enc={},p=h.Hex={stringify:function(y){for(var v=y.words,C=y.sigBytes,$=[],z=0;z<C;z++){var W=v[z>>>2]>>>24-z%4*8&255;$.push((W>>>4).toString(16)),$.push((W&15).toString(16))}return $.join("")},parse:function(y){for(var v=y.length,C=[],$=0;$<v;$+=2)C[$>>>3]|=parseInt(y.substr($,2),16)<<24-$%8*4;return new f.init(C,v/2)}},g=h.Latin1={stringify:function(y){for(var v=y.words,C=y.sigBytes,$=[],z=0;z<C;z++){var W=v[z>>>2]>>>24-z%4*8&255;$.push(String.fromCharCode(W))}return $.join("")},parse:function(y){for(var v=y.length,C=[],$=0;$<v;$++)C[$>>>2]|=(y.charCodeAt($)&255)<<24-$%4*8;return new f.init(C,v)}},m=h.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var v,C=this._data,$=C.words,z=C.sigBytes,W=this.blockSize,j=z/(W*4);y?j=o.ceil(j):j=o.max((j|0)-this._minBufferSize,0);var D=j*W,O=o.min(D*4,z);if(D){for(var H=0;H<D;H+=W)this._doProcessBlock($,H);v=$.splice(0,D),C.sigBytes-=O}return new f.init(v,O)},clone:function(){var y=u.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});c.Hasher=w.extend({cfg:u.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){return y&&this._append(y),this._doFinalize()},blockSize:16,_createHelper:function(y){return function(v,C){return new y.init(C).finalize(v)}},_createHmacHelper:function(y){return function(v,C){return new I.HMAC.init(y,C).finalize(v)}}});var I=d.algo={};return d})(Math);return n})})),dl=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.WordArray,r=o.enc;r.Base64={stringify:function(l){var d=l.words,c=l.sigBytes,u=this._map;l.clamp();for(var f=[],h=0;h<c;h+=3)for(var p=d[h>>>2]>>>24-h%4*8&255,g=d[h+1>>>2]>>>24-(h+1)%4*8&255,m=d[h+2>>>2]>>>24-(h+2)%4*8&255,w=p<<16|g<<8|m,I=0;I<4&&h+I*.75<c;I++)f.push(u.charAt(w>>>6*(3-I)&63));var y=u.charAt(64);if(y)for(;f.length%4;)f.push(y);return f.join("")},parse:function(l){var d=l.length,c=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var f=0;f<c.length;f++)u[c.charCodeAt(f)]=f}var h=c.charAt(64);if(h){var p=l.indexOf(h);p!==-1&&(d=p)}return a(l,d,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(l,d,c){for(var u=[],f=0,h=0;h<d;h++)if(h%4){var p=c[l.charCodeAt(h-1)]<<h%4*2|c[l.charCodeAt(h)]>>>6-h%4*2;u[f>>>2]|=p<<24-f%4*8,f++}return i.create(u,f)}})(),n.enc.Base64})})),ul=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,d=i.algo,c=[];(function(){for(var m=0;m<64;m++)c[m]=o.abs(o.sin(m+1))*4294967296|0})();var u=d.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,w){for(var I=0;I<16;I++){var y=w+I,v=m[y];m[y]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360}var C=this._hash.words,$=m[w+0],z=m[w+1],W=m[w+2],j=m[w+3],D=m[w+4],O=m[w+5],H=m[w+6],S=m[w+7],Y=m[w+8],b=m[w+9],B=m[w+10],_=m[w+11],x=m[w+12],T=m[w+13],P=m[w+14],L=m[w+15],M=C[0],V=C[1],F=C[2],G=C[3];M=f(M,V,F,G,$,7,c[0]),G=f(G,M,V,F,z,12,c[1]),F=f(F,G,M,V,W,17,c[2]),V=f(V,F,G,M,j,22,c[3]),M=f(M,V,F,G,D,7,c[4]),G=f(G,M,V,F,O,12,c[5]),F=f(F,G,M,V,H,17,c[6]),V=f(V,F,G,M,S,22,c[7]),M=f(M,V,F,G,Y,7,c[8]),G=f(G,M,V,F,b,12,c[9]),F=f(F,G,M,V,B,17,c[10]),V=f(V,F,G,M,_,22,c[11]),M=f(M,V,F,G,x,7,c[12]),G=f(G,M,V,F,T,12,c[13]),F=f(F,G,M,V,P,17,c[14]),V=f(V,F,G,M,L,22,c[15]),M=h(M,V,F,G,z,5,c[16]),G=h(G,M,V,F,H,9,c[17]),F=h(F,G,M,V,_,14,c[18]),V=h(V,F,G,M,$,20,c[19]),M=h(M,V,F,G,O,5,c[20]),G=h(G,M,V,F,B,9,c[21]),F=h(F,G,M,V,L,14,c[22]),V=h(V,F,G,M,D,20,c[23]),M=h(M,V,F,G,b,5,c[24]),G=h(G,M,V,F,P,9,c[25]),F=h(F,G,M,V,j,14,c[26]),V=h(V,F,G,M,Y,20,c[27]),M=h(M,V,F,G,T,5,c[28]),G=h(G,M,V,F,W,9,c[29]),F=h(F,G,M,V,S,14,c[30]),V=h(V,F,G,M,x,20,c[31]),M=p(M,V,F,G,O,4,c[32]),G=p(G,M,V,F,Y,11,c[33]),F=p(F,G,M,V,_,16,c[34]),V=p(V,F,G,M,P,23,c[35]),M=p(M,V,F,G,z,4,c[36]),G=p(G,M,V,F,D,11,c[37]),F=p(F,G,M,V,S,16,c[38]),V=p(V,F,G,M,B,23,c[39]),M=p(M,V,F,G,T,4,c[40]),G=p(G,M,V,F,$,11,c[41]),F=p(F,G,M,V,j,16,c[42]),V=p(V,F,G,M,H,23,c[43]),M=p(M,V,F,G,b,4,c[44]),G=p(G,M,V,F,x,11,c[45]),F=p(F,G,M,V,L,16,c[46]),V=p(V,F,G,M,W,23,c[47]),M=g(M,V,F,G,$,6,c[48]),G=g(G,M,V,F,S,10,c[49]),F=g(F,G,M,V,P,15,c[50]),V=g(V,F,G,M,O,21,c[51]),M=g(M,V,F,G,x,6,c[52]),G=g(G,M,V,F,j,10,c[53]),F=g(F,G,M,V,B,15,c[54]),V=g(V,F,G,M,z,21,c[55]),M=g(M,V,F,G,Y,6,c[56]),G=g(G,M,V,F,L,10,c[57]),F=g(F,G,M,V,H,15,c[58]),V=g(V,F,G,M,T,21,c[59]),M=g(M,V,F,G,D,6,c[60]),G=g(G,M,V,F,_,10,c[61]),F=g(F,G,M,V,W,15,c[62]),V=g(V,F,G,M,b,21,c[63]),C[0]=C[0]+M|0,C[1]=C[1]+V|0,C[2]=C[2]+F|0,C[3]=C[3]+G|0},_doFinalize:function(){var m=this._data,w=m.words,I=this._nDataBytes*8,y=m.sigBytes*8;w[y>>>5]|=128<<24-y%32;var v=o.floor(I/4294967296),C=I;w[(y+64>>>9<<4)+15]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,w[(y+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,m.sigBytes=(w.length+1)*4,this._process();for(var $=this._hash,z=$.words,W=0;W<4;W++){var j=z[W];z[W]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360}return $},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,w,I,y,v,C,$){var z=m+(w&I|~w&y)+v+$;return(z<<C|z>>>32-C)+w}function h(m,w,I,y,v,C,$){var z=m+(w&y|I&~y)+v+$;return(z<<C|z>>>32-C)+w}function p(m,w,I,y,v,C,$){var z=m+(w^I^y)+v+$;return(z<<C|z>>>32-C)+w}function g(m,w,I,y,v,C,$){var z=m+(I^(w|~y))+v+$;return(z<<C|z>>>32-C)+w}i.MD5=l._createHelper(u),i.HmacMD5=l._createHmacHelper(u)})(Math),n.MD5})})),P0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=i.Hasher,l=o.algo,d=[],c=l.SHA1=a.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,f){for(var h=this._hash.words,p=h[0],g=h[1],m=h[2],w=h[3],I=h[4],y=0;y<80;y++){if(y<16)d[y]=u[f+y]|0;else{var v=d[y-3]^d[y-8]^d[y-14]^d[y-16];d[y]=v<<1|v>>>31}var C=(p<<5|p>>>27)+I+d[y];y<20?C+=(g&m|~g&w)+1518500249:y<40?C+=(g^m^w)+1859775393:y<60?C+=(g&m|g&w|m&w)-1894007588:C+=(g^m^w)-899497514,I=w,w=m,m=g<<30|g>>>2,g=p,p=C}h[0]=h[0]+p|0,h[1]=h[1]+g|0,h[2]=h[2]+m|0,h[3]=h[3]+w|0,h[4]=h[4]+I|0},_doFinalize:function(){var u=this._data,f=u.words,h=this._nDataBytes*8,p=u.sigBytes*8;return f[p>>>5]|=128<<24-p%32,f[(p+64>>>9<<4)+14]=Math.floor(h/4294967296),f[(p+64>>>9<<4)+15]=h,u.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var u=a.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=a._createHelper(c),o.HmacSHA1=a._createHmacHelper(c)})(),n.SHA1})})),O0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){(function(){var o=n,i=o.lib.Base,r=o.enc.Utf8,a=o.algo;a.HMAC=i.extend({init:function(l,d){l=this._hasher=new l.init,typeof d=="string"&&(d=r.parse(d));var c=l.blockSize,u=c*4;d.sigBytes>u&&(d=l.finalize(d)),d.clamp();for(var f=this._oKey=d.clone(),h=this._iKey=d.clone(),p=f.words,g=h.words,m=0;m<c;m++)p[m]^=1549556828,g[m]^=909522486;f.sigBytes=h.sigBytes=u,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var d=this._hasher,c=d.finalize(l);return d.reset(),d.finalize(this._oKey.clone().concat(c))}})})()})})),fl=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),P0(),O0()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib,r=i.Base,a=i.WordArray,l=o.algo,d=l.MD5,c=l.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:d,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,f){for(var h,p=this.cfg,g=p.hasher.create(),m=a.create(),w=m.words,I=p.keySize,y=p.iterations;w.length<I;){h&&g.update(h),h=g.update(u).finalize(f),g.reset();for(var v=1;v<y;v++)h=g.finalize(h),g.reset();m.concat(h)}return m.sigBytes=I*4,m}});o.EvpKDF=function(u,f,h){return c.create(h).compute(u,f)}})(),n.EvpKDF})})),hl=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),fl()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],o):o(n.CryptoJS)})(t,function(n){n.lib.Cipher||(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,d=r.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var u=c.Base64,f=i.algo.EvpKDF,h=r.Cipher=d.extend({cfg:a.extend(),createEncryptor:function(D,O){return this.create(this._ENC_XFORM_MODE,D,O)},createDecryptor:function(D,O){return this.create(this._DEC_XFORM_MODE,D,O)},init:function(D,O,H){this.cfg=this.cfg.extend(H),this._xformMode=D,this._key=O,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){return D&&this._append(D),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function D(O){return typeof O=="string"?j:$}return function(O){return{encrypt:function(H,S,Y){return D(S).encrypt(O,H,S,Y)},decrypt:function(H,S,Y){return D(S).decrypt(O,H,S,Y)}}}})()});r.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var p=i.mode={},g=r.BlockCipherMode=a.extend({createEncryptor:function(D,O){return this.Encryptor.create(D,O)},createDecryptor:function(D,O){return this.Decryptor.create(D,O)},init:function(D,O){this._cipher=D,this._iv=O}}),m=p.CBC=(function(){var D=g.extend();D.Encryptor=D.extend({processBlock:function(H,S){var Y=this._cipher,b=Y.blockSize;O.call(this,H,S,b),Y.encryptBlock(H,S),this._prevBlock=H.slice(S,S+b)}}),D.Decryptor=D.extend({processBlock:function(H,S){var Y=this._cipher,b=Y.blockSize,B=H.slice(S,S+b);Y.decryptBlock(H,S),O.call(this,H,S,b),this._prevBlock=B}});function O(H,S,Y){var b,B=this._iv;B?(b=B,this._iv=o):b=this._prevBlock;for(var _=0;_<Y;_++)H[S+_]^=b[_]}return D})(),w=i.pad={},I=w.Pkcs7={pad:function(D,O){for(var H=O*4,S=H-D.sigBytes%H,Y=S<<24|S<<16|S<<8|S,b=[],B=0;B<S;B+=4)b.push(Y);var _=l.create(b,S);D.concat(_)},unpad:function(D){var O=D.words[D.sigBytes-1>>>2]&255;D.sigBytes-=O}};r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:I}),reset:function(){var D;h.reset.call(this);var O=this.cfg,H=O.iv,S=O.mode;this._xformMode==this._ENC_XFORM_MODE?D=S.createEncryptor:(D=S.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,H&&H.words):(this._mode=D.call(S,this,H&&H.words),this._mode.__creator=D)},_doProcessBlock:function(D,O){this._mode.processBlock(D,O)},_doFinalize:function(){var D,O=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(O.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),O.unpad(D)),D},blockSize:128/32});var y=r.CipherParams=a.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),v=i.format={},C=v.OpenSSL={stringify:function(D){var O,H=D.ciphertext,S=D.salt;return S?O=l.create([1398893684,1701076831]).concat(S).concat(H):O=H,O.toString(u)},parse:function(D){var O,H=u.parse(D),S=H.words;return S[0]==1398893684&&S[1]==1701076831&&(O=l.create(S.slice(2,4)),S.splice(0,4),H.sigBytes-=16),y.create({ciphertext:H,salt:O})}},$=r.SerializableCipher=a.extend({cfg:a.extend({format:C}),encrypt:function(D,O,H,S){S=this.cfg.extend(S);var Y=D.createEncryptor(H,S),b=Y.finalize(O),B=Y.cfg;return y.create({ciphertext:b,key:H,iv:B.iv,algorithm:D,mode:B.mode,padding:B.padding,blockSize:D.blockSize,formatter:S.format})},decrypt:function(D,O,H,S){return S=this.cfg.extend(S),O=this._parse(O,S.format),D.createDecryptor(H,S).finalize(O.ciphertext)},_parse:function(D,O){return typeof D=="string"?O.parse(D,this):D}}),z=i.kdf={},W=z.OpenSSL={execute:function(D,O,H,S,Y){if(S||(S=l.random(64/8)),Y)var b=f.create({keySize:O+H,hasher:Y}).compute(D,S);else var b=f.create({keySize:O+H}).compute(D,S);var B=l.create(b.words.slice(O),H*4);return b.sigBytes=O*4,y.create({key:b,iv:B,salt:S})}},j=r.PasswordBasedCipher=$.extend({cfg:$.cfg.extend({kdf:W}),encrypt:function(D,O,H,S){S=this.cfg.extend(S);var Y=S.kdf.execute(H,D.keySize,D.ivSize,S.salt,S.hasher);S.iv=Y.iv;var b=$.encrypt.call(this,D,O,Y.key,S);return b.mixIn(Y),b},decrypt:function(D,O,H,S){S=this.cfg.extend(S),O=this._parse(O,S.format);var Y=S.kdf.execute(H,D.keySize,D.ivSize,O.salt,S.hasher);return S.iv=Y.iv,$.decrypt.call(this,D,O,Y.key,S)}})})()})})),$0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),dl(),ul(),fl(),hl()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.BlockCipher,r=o.algo,a=[],l=[],d=[],c=[],u=[],f=[],h=[],p=[],g=[],m=[];(function(){for(var y=[],v=0;v<256;v++)v<128?y[v]=v<<1:y[v]=v<<1^283;for(var C=0,$=0,v=0;v<256;v++){var z=$^$<<1^$<<2^$<<3^$<<4;z=z>>>8^z&255^99,a[C]=z,l[z]=C;var W=y[C],j=y[W],D=y[j],O=y[z]*257^z*16843008;d[C]=O<<24|O>>>8,c[C]=O<<16|O>>>16,u[C]=O<<8|O>>>24,f[C]=O;var O=D*16843009^j*65537^W*257^C*16843008;h[z]=O<<24|O>>>8,p[z]=O<<16|O>>>16,g[z]=O<<8|O>>>24,m[z]=O,C?(C=W^y[y[y[D^W]]],$^=y[y[$]]):C=$=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],I=r.AES=i.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,C=v.words,$=v.sigBytes/4,z=((this._nRounds=$+6)+1)*4,W=this._keySchedule=[],j=0;j<z;j++)j<$?W[j]=C[j]:(y=W[j-1],j%$?$>6&&j%$==4&&(y=a[y>>>24]<<24|a[y>>>16&255]<<16|a[y>>>8&255]<<8|a[y&255]):(y=y<<8|y>>>24,y=a[y>>>24]<<24|a[y>>>16&255]<<16|a[y>>>8&255]<<8|a[y&255],y^=w[j/$|0]<<24),W[j]=W[j-$]^y);for(var D=this._invKeySchedule=[],O=0;O<z;O++){var j=z-O;if(O%4)var y=W[j];else var y=W[j-4];O<4||j<=4?D[O]=y:D[O]=h[a[y>>>24]]^p[a[y>>>16&255]]^g[a[y>>>8&255]]^m[a[y&255]]}}},encryptBlock:function(y,v){this._doCryptBlock(y,v,this._keySchedule,d,c,u,f,a)},decryptBlock:function(y,v){var C=y[v+1];y[v+1]=y[v+3],y[v+3]=C,this._doCryptBlock(y,v,this._invKeySchedule,h,p,g,m,l);var C=y[v+1];y[v+1]=y[v+3],y[v+3]=C},_doCryptBlock:function(y,v,C,$,z,W,j,D){for(var O=this._nRounds,H=y[v]^C[0],S=y[v+1]^C[1],Y=y[v+2]^C[2],b=y[v+3]^C[3],B=4,_=1;_<O;_++){var x=$[H>>>24]^z[S>>>16&255]^W[Y>>>8&255]^j[b&255]^C[B++],T=$[S>>>24]^z[Y>>>16&255]^W[b>>>8&255]^j[H&255]^C[B++],P=$[Y>>>24]^z[b>>>16&255]^W[H>>>8&255]^j[S&255]^C[B++],L=$[b>>>24]^z[H>>>16&255]^W[S>>>8&255]^j[Y&255]^C[B++];H=x,S=T,Y=P,b=L}var x=(D[H>>>24]<<24|D[S>>>16&255]<<16|D[Y>>>8&255]<<8|D[b&255])^C[B++],T=(D[S>>>24]<<24|D[Y>>>16&255]<<16|D[b>>>8&255]<<8|D[H&255])^C[B++],P=(D[Y>>>24]<<24|D[b>>>16&255]<<16|D[H>>>8&255]<<8|D[S&255])^C[B++],L=(D[b>>>24]<<24|D[H>>>16&255]<<16|D[S>>>8&255]<<8|D[Y&255])^C[B++];y[v]=x,y[v+1]=T,y[v+2]=P,y[v+3]=L},keySize:256/32});o.AES=i._createHelper(I)})(),n.AES})})),R0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return n.enc.Utf8})})),H0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),hl()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],o):o(n.CryptoJS)})(t,function(n){return n.pad.Pkcs7})})),V0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,d=i.algo,c=[],u=[];(function(){function p(I){for(var y=o.sqrt(I),v=2;v<=y;v++)if(!(I%v))return!1;return!0}function g(I){return(I-(I|0))*4294967296|0}for(var m=2,w=0;w<64;)p(m)&&(w<8&&(c[w]=g(o.pow(m,1/2))),u[w]=g(o.pow(m,1/3)),w++),m++})();var f=[],h=d.SHA256=l.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(p,g){for(var m=this._hash.words,w=m[0],I=m[1],y=m[2],v=m[3],C=m[4],$=m[5],z=m[6],W=m[7],j=0;j<64;j++){if(j<16)f[j]=p[g+j]|0;else{var D=f[j-15],O=(D<<25|D>>>7)^(D<<14|D>>>18)^D>>>3,H=f[j-2],S=(H<<15|H>>>17)^(H<<13|H>>>19)^H>>>10;f[j]=O+f[j-7]+S+f[j-16]}var Y=C&$^~C&z,b=w&I^w&y^I&y,B=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),_=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),x=W+_+Y+u[j]+f[j],T=B+b;W=z,z=$,$=C,C=v+x|0,v=y,y=I,I=w,w=x+T|0}m[0]=m[0]+w|0,m[1]=m[1]+I|0,m[2]=m[2]+y|0,m[3]=m[3]+v|0,m[4]=m[4]+C|0,m[5]=m[5]+$|0,m[6]=m[6]+z|0,m[7]=m[7]+W|0},_doFinalize:function(){var p=this._data,g=p.words,m=this._nDataBytes*8,w=p.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+64>>>9<<4)+14]=o.floor(m/4294967296),g[(w+64>>>9<<4)+15]=m,p.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});i.SHA256=l._createHelper(h),i.HmacSHA256=l._createHmacHelper(h)})(Math),n.SHA256})})),L0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,d=i.x64={};d.Word=a.extend({init:function(c,u){this.high=c,this.low=u}}),d.WordArray=a.extend({init:function(c,u){c=this.words=c||[],u!=o?this.sigBytes=u:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,u=c.length,f=[],h=0;h<u;h++){var p=c[h];f.push(p.high),f.push(p.low)}return l.create(f,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),u=c.words=this.words.slice(0),f=u.length,h=0;h<f;h++)u[h]=u[h].clone();return c}})})(),n})})),F0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),L0()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.Hasher,r=o.x64,a=r.Word,l=r.WordArray,d=o.algo;function c(){return a.create.apply(a,arguments)}var u=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],f=[];(function(){for(var p=0;p<80;p++)f[p]=c()})();var h=d.SHA512=i.extend({_doReset:function(){this._hash=new l.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(p,g){for(var m=this._hash.words,w=m[0],I=m[1],y=m[2],v=m[3],C=m[4],$=m[5],z=m[6],W=m[7],j=w.high,D=w.low,O=I.high,H=I.low,S=y.high,Y=y.low,b=v.high,B=v.low,_=C.high,x=C.low,T=$.high,P=$.low,L=z.high,M=z.low,V=W.high,F=W.low,G=j,X=D,J=O,U=H,Z=S,te=Y,oe=b,ae=B,ee=_,ie=x,R=T,E=P,k=L,A=M,N=V,Q=F,K=0;K<80;K++){var re,ne,de=f[K];if(K<16)ne=de.high=p[g+K*2]|0,re=de.low=p[g+K*2+1]|0;else{var ye=f[K-15],ve=ye.high,me=ye.low,dt=(ve>>>1|me<<31)^(ve>>>8|me<<24)^ve>>>7,Tt=(me>>>1|ve<<31)^(me>>>8|ve<<24)^(me>>>7|ve<<25),ti=f[K-2],cn=ti.high,Un=ti.low,ly=(cn>>>19|Un<<13)^(cn<<3|Un>>>29)^cn>>>6,jl=(Un>>>19|cn<<13)^(Un<<3|cn>>>29)^(Un>>>6|cn<<26),Wl=f[K-7],cy=Wl.high,dy=Wl.low,Yl=f[K-16],uy=Yl.high,Ul=Yl.low;re=Tt+dy,ne=dt+cy+(re>>>0<Tt>>>0?1:0),re=re+jl,ne=ne+ly+(re>>>0<jl>>>0?1:0),re=re+Ul,ne=ne+uy+(re>>>0<Ul>>>0?1:0),de.high=ne,de.low=re}var fy=ee&R^~ee&k,Xl=ie&E^~ie&A,hy=G&J^G&Z^J&Z,py=X&U^X&te^U&te,gy=(G>>>28|X<<4)^(G<<30|X>>>2)^(G<<25|X>>>7),ql=(X>>>28|G<<4)^(X<<30|G>>>2)^(X<<25|G>>>7),my=(ee>>>14|ie<<18)^(ee>>>18|ie<<14)^(ee<<23|ie>>>9),vy=(ie>>>14|ee<<18)^(ie>>>18|ee<<14)^(ie<<23|ee>>>9),Kl=u[K],yy=Kl.high,Zl=Kl.low,Ue=Q+vy,It=N+my+(Ue>>>0<Q>>>0?1:0),Ue=Ue+Xl,It=It+fy+(Ue>>>0<Xl>>>0?1:0),Ue=Ue+Zl,It=It+yy+(Ue>>>0<Zl>>>0?1:0),Ue=Ue+re,It=It+ne+(Ue>>>0<re>>>0?1:0),Jl=ql+py,_y=gy+hy+(Jl>>>0<ql>>>0?1:0);N=k,Q=A,k=R,A=E,R=ee,E=ie,ie=ae+Ue|0,ee=oe+It+(ie>>>0<ae>>>0?1:0)|0,oe=Z,ae=te,Z=J,te=U,J=G,U=X,X=Ue+Jl|0,G=It+_y+(X>>>0<Ue>>>0?1:0)|0}D=w.low=D+X,w.high=j+G+(D>>>0<X>>>0?1:0),H=I.low=H+U,I.high=O+J+(H>>>0<U>>>0?1:0),Y=y.low=Y+te,y.high=S+Z+(Y>>>0<te>>>0?1:0),B=v.low=B+ae,v.high=b+oe+(B>>>0<ae>>>0?1:0),x=C.low=x+ie,C.high=_+ee+(x>>>0<ie>>>0?1:0),P=$.low=P+E,$.high=T+R+(P>>>0<E>>>0?1:0),M=z.low=M+A,z.high=L+k+(M>>>0<A>>>0?1:0),F=W.low=F+Q,W.high=V+N+(F>>>0<Q>>>0?1:0)},_doFinalize:function(){var p=this._data,g=p.words,m=this._nDataBytes*8,w=p.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+128>>>10<<5)+30]=Math.floor(m/4294967296),g[(w+128>>>10<<5)+31]=m,p.sigBytes=g.length*4,this._process(),this._hash.toX32()},clone:function(){var p=i.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});o.SHA512=i._createHelper(h),o.HmacSHA512=i._createHmacHelper(h)})(),n.SHA512})})),G0=bt($0(),1),j0=bt(R0(),1),Cy=bt(H0(),1),Ey=bt(dl(),1),xy=bt(ul(),1),Sy=bt(V0(),1),ky=bt(F0(),1),{decrypt:Ny,encrypt:Dy}=G0.default,Ty=j0.default.parse;function W0(t,e,n){return(e=q0(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},yt.apply(null,arguments)}function pl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pl(Object(n),!0).forEach(function(o){W0(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Y0(t,e){if(t==null)return{};var n,o,i=U0(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function U0(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;n[o]=t[o]}return n}function X0(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function q0(t){var e=X0(t,"string");return typeof e=="symbol"?e:e+""}function rr(t){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(t)}var K0="1.15.7";function _t(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var wt=_t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),$n=_t(/Edge/i),gl=_t(/firefox/i),Rn=_t(/safari/i)&&!_t(/chrome/i)&&!_t(/android/i),sr=_t(/iP(ad|od|hone)/i),ml=_t(/chrome/i)&&_t(/android/i),vl={capture:!1,passive:!1};function we(t,e,n){t.addEventListener(e,n,!wt&&vl)}function _e(t,e,n){t.removeEventListener(e,n,!wt&&vl)}function Lo(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function yl(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Lo(t,e):Lo(t,e))||o&&t===n)return t;if(t===n)break}while(t=yl(t))}return null}var _l=/\s+/g;function We(t,e,n){t&&e&&(t.classList?t.classList[n?"add":"remove"](e):t.className=((" "+t.className+" ").replace(_l," ").replace(" "+e+" "," ")+(n?" "+e:"")).replace(_l," "))}function he(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function nn(t,e){var n="";if(typeof t=="string")n=t;else do{var o=he(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function wl(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function ct(){var t=document.scrollingElement;return t||document.documentElement}function De(t,e,n,o,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,a,l,d,c,u,f;if(t!==window&&t.parentNode&&t!==ct()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,d=r.bottom,c=r.right,u=r.height,f=r.width):(a=0,l=0,d=window.innerHeight,c=window.innerWidth,u=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!wt))do if(i&&i.getBoundingClientRect&&(he(i,"transform")!=="none"||n&&he(i,"position")!=="static")){var h=i.getBoundingClientRect();a-=h.top+parseInt(he(i,"border-top-width")),l-=h.left+parseInt(he(i,"border-left-width")),d=a+r.height,c=l+r.width;break}while(i=i.parentNode);if(o&&t!==window){var p=nn(i||t),g=p&&p.a,m=p&&p.d;p&&(a/=m,l/=g,f/=g,u/=m,d=a+u,c=l+f)}return{top:a,left:l,bottom:d,right:c,width:f,height:u}}}function bl(t,e,n){for(var o=kt(t,!0),i=De(t)[e];o;){var r=De(o)[n],a=void 0;if(n==="top"||n==="left"?a=i>=r:a=i<=r,!a)return o;if(o===ct())break;o=kt(o,!1)}return!1}function on(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==pe.ghost&&(o||a[r]!==pe.dragged)&&tt(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function ar(t,e){for(var n=t.lastElementChild;n&&(n===pe.ghost||he(n,"display")==="none"||e&&!Lo(n,e));)n=n.previousElementSibling;return n||null}function qe(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==pe.clone&&(!e||Lo(t,e))&&n++;return n}function Cl(t){var e=0,n=0,o=ct();if(t)do{var i=nn(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Z0(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function kt(t,e){if(!t||!t.getBoundingClientRect)return ct();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=he(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 ct();if(o||e)return n;o=!0}}while(n=n.parentNode);return ct()}function J0(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function lr(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Hn;function El(t,e){return function(){if(!Hn){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Hn=setTimeout(function(){Hn=void 0},e)}}}function Q0(){clearTimeout(Hn),Hn=void 0}function xl(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Sl(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function kl(t,e,n){var o={};return Array.from(t.children).forEach(function(i){var r,a,l,d;if(!(!tt(i,e.draggable,t,!1)||i.animated||i===n)){var c=De(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,c.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,c.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,c.right),o.bottom=Math.max((d=o.bottom)!==null&&d!==void 0?d:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Ve="Sortable"+new Date().getTime();function ev(){var t=[],e;return{captureAnimationState:function(){t=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(o){if(!(he(o,"display")==="none"||o===pe.ghost)){t.push({target:o,rect:De(o)});var i=lt({},t[t.length-1].rect);if(o.thisAnimationDuration){var r=nn(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Z0(t,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;t.forEach(function(l){var d=0,c=l.target,u=c.fromRect,f=De(c),h=c.prevFromRect,p=c.prevToRect,g=l.rect,m=nn(c,!0);m&&(f.top-=m.f,f.left-=m.e),c.toRect=f,c.thisAnimationDuration&&lr(h,f)&&!lr(u,f)&&(g.top-f.top)/(g.left-f.left)===(u.top-f.top)/(u.left-f.left)&&(d=nv(g,h,p,i.options)),lr(f,u)||(c.prevFromRect=u,c.prevToRect=f,d||(d=i.options.animation),i.animate(c,g,f,d)),d&&(r=!0,a=Math.max(a,d),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},d),c.thisAnimationDuration=d)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,i,r,a){if(a){he(o,"transition",""),he(o,"transform","");var l=nn(this.el),d=l&&l.a,c=l&&l.d,u=(i.left-r.left)/(d||1),f=(i.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!f,he(o,"transform","translate3d("+u+"px,"+f+"px,0)"),this.forRepaintDummy=tv(o),he(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),he(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){he(o,"transition",""),he(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function tv(t){return t.offsetWidth}function nv(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var rn=[],cr={initializeByDefault:!0},Vn={mount:function(e){for(var n in cr)cr.hasOwnProperty(n)&&!(n in e)&&(e[n]=cr[n]);rn.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),rn.push(e)},pluginEvent:function(e,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";rn.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](lt({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](lt({sortable:n},o)))})},initializePlugins:function(e,n,o,i){rn.forEach(function(l){var d=l.pluginName;if(!(!e.options[d]&&!l.initializeByDefault)){var c=new l(e,n,e.options);c.sortable=e,c.options=e.options,e[d]=c,yt(o,c.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var o={};return rn.forEach(function(i){typeof i.eventProperties=="function"&&yt(o,i.eventProperties.call(n[i.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return rn.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],o))}),i}};function ov(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,d=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,f=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Ve],!!e){var m,w=e.options,I="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!wt&&!$n?m=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(o,!0,!0)),m.to=a||n,m.from=l||n,m.item=i||n,m.clone=r,m.oldIndex=d,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=f,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var y=lt(lt({},g),Vn.getEventProperties(o,e));for(var v in y)m[v]=y[v];n&&n.dispatchEvent(m),w[I]&&w[I].call(e,m)}}var iv=["evt"],Le=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=Y0(o,iv);Vn.pluginEvent.bind(pe)(e,n,lt({dragEl:se,parentEl:xe,ghostEl:ge,rootEl:Ce,nextEl:Ht,lastDownEl:Fo,cloneEl:Ee,cloneHidden:Nt,dragStarted:Fn,putSortable:ze,activeSortable:pe.active,originalEvent:i,oldIndex:sn,oldDraggableIndex:Ln,newIndex:Ye,newDraggableIndex:Dt,hideGhostForTarget:zl,unhideGhostForTarget:Al,cloneNowHidden:function(){Nt=!0},cloneNowShown:function(){Nt=!1},dispatchSortableEvent:function(l){$e({sortable:n,name:l,originalEvent:i})}},r))};function $e(t){ov(lt({putSortable:ze,cloneEl:Ee,targetEl:se,rootEl:Ce,oldIndex:sn,oldDraggableIndex:Ln,newIndex:Ye,newDraggableIndex:Dt},t))}var se,xe,ge,Ce,Ht,Fo,Ee,Nt,sn,Ye,Ln,Dt,Go,ze,an=!1,jo=!1,Wo=[],Vt,nt,dr,ur,Nl,Dl,Fn,ln,Gn,jn=!1,Yo=!1,Uo,Ae,fr=[],hr=!1,Xo=[],qo=typeof document<"u",Ko=sr,Tl=$n||wt?"cssFloat":"float",rv=qo&&!ml&&!sr&&"draggable"in document.createElement("div"),Il=(function(){if(qo){if(wt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),Ml=function(e,n){var o=he(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=on(e,0,n),a=on(e,1,n),l=r&&he(r),d=a&&he(a),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+De(r).width,u=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+De(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(d.clear==="both"||d.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=i&&o[Tl]==="none"||a&&o[Tl]==="none"&&c+u>i)?"vertical":"horizontal"},sv=function(e,n,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,d=o?n.right:n.bottom,c=o?n.width:n.height;return i===l||r===d||i+a/2===l+c/2},av=function(e,n){var o;return Wo.some(function(i){var r=i[Ve].options.emptyInsertThreshold;if(!(!r||ar(i))){var a=De(i),l=e>=a.left-r&&e<=a.right+r,d=n>=a.top-r&&n<=a.bottom+r;if(l&&d)return o=i}}),o},Bl=function(e){function n(r,a){return function(l,d,c,u){var f=l.options.group.name&&d.options.group.name&&l.options.group.name===d.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,d,c,u),a)(l,d,c,u);var h=(a?l:d).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},i=e.group;(!i||rr(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},zl=function(){!Il&&ge&&he(ge,"display","none")},Al=function(){!Il&&ge&&he(ge,"display","")};qo&&!ml&&document.addEventListener("click",function(t){if(jo)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),jo=!1,!1},!0);var Lt=function(e){if(se){e=e.touches?e.touches[0]:e;var n=av(e.clientX,e.clientY);if(n){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ve]._onDragOver(o)}}},lv=function(e){se&&se.parentNode[Ve]._isOutsideThisEl(e.target)};function pe(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=yt({},e),t[Ve]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ml(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.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:pe.supportPointer!==!1&&"PointerEvent"in window&&(!Rn||sr),emptyInsertThreshold:5};Vn.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);Bl(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:rv,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?we(t,"pointerdown",this._onTapStart):(we(t,"mousedown",this._onTapStart),we(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(we(t,"dragover",this),we(t,"dragenter",this)),Wo.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),yt(this,ev())}pe.prototype={constructor:pe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ln=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,se):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,d=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||d,u=i.filter;if(mv(o),!se&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Rn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=tt(d,i.draggable,o,!1),!(d&&d.animated)&&Fo!==d)){if(sn=qe(d),Ln=qe(d,i.draggable),typeof u=="function"){if(u.call(this,e,d,this)){$e({sortable:n,rootEl:c,name:"filter",targetEl:d,toEl:o,fromEl:o}),Le("filter",n,{evt:e}),r&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(f){if(f=tt(c,f.trim(),o,!1),f)return $e({sortable:n,rootEl:f,name:"filter",targetEl:d,fromEl:o,toEl:o}),Le("filter",n,{evt:e}),!0}),u)){r&&e.preventDefault();return}i.handle&&!tt(c,i.handle,o,!1)||this._prepareDragStart(e,l,d)}}},_prepareDragStart:function(e,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,d;if(o&&!se&&o.parentNode===r){var c=De(o);if(Ce=r,se=o,xe=se.parentNode,Ht=se.nextSibling,Fo=o,Go=a.group,pe.dragged=se,Vt={target:se,clientX:(n||e).clientX,clientY:(n||e).clientY},Nl=Vt.clientX-c.left,Dl=Vt.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,se.style["will-change"]="all",d=function(){if(Le("delayEnded",i,{evt:e}),pe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!gl&&i.nativeDraggable&&(se.draggable=!0),i._triggerDragStart(e,n),$e({sortable:i,name:"choose",originalEvent:e}),We(se,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){wl(se,u.trim(),pr)}),we(l,"dragover",Lt),we(l,"mousemove",Lt),we(l,"touchmove",Lt),a.supportPointer?(we(l,"pointerup",i._onDrop),!this.nativeDraggable&&we(l,"pointercancel",i._onDrop)):(we(l,"mouseup",i._onDrop),we(l,"touchend",i._onDrop),we(l,"touchcancel",i._onDrop)),gl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,se.draggable=!0),Le("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!($n||wt))){if(pe.eventCanceled){this._onDrop();return}a.supportPointer?(we(l,"pointerup",i._disableDelayedDrag),we(l,"pointercancel",i._disableDelayedDrag)):(we(l,"mouseup",i._disableDelayedDrag),we(l,"touchend",i._disableDelayedDrag),we(l,"touchcancel",i._disableDelayedDrag)),we(l,"mousemove",i._delayedDragTouchMoveHandler),we(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&we(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(d,a.delay)}else d()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){se&&pr(se),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;_e(e,"mouseup",this._disableDelayedDrag),_e(e,"touchend",this._disableDelayedDrag),_e(e,"touchcancel",this._disableDelayedDrag),_e(e,"pointerup",this._disableDelayedDrag),_e(e,"pointercancel",this._disableDelayedDrag),_e(e,"mousemove",this._delayedDragTouchMoveHandler),_e(e,"touchmove",this._delayedDragTouchMoveHandler),_e(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?we(document,"pointermove",this._onTouchMove):n?we(document,"touchmove",this._onTouchMove):we(document,"mousemove",this._onTouchMove):(we(se,"dragend",this),we(Ce,"dragstart",this._onDragStart));try{document.selection?Jo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(an=!1,Ce&&se){Le("dragStarted",this,{evt:n}),this.nativeDraggable&&we(document,"dragover",lv);var o=this.options;!e&&We(se,o.dragClass,!1),We(se,o.ghostClass,!0),pe.active=this,e&&this._appendGhost(),$e({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(nt){this._lastX=nt.clientX,this._lastY=nt.clientY,zl();for(var e=document.elementFromPoint(nt.clientX,nt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(nt.clientX,nt.clientY),e!==n);)n=e;if(se.parentNode[Ve]._isOutsideThisEl(e),n)do{if(n[Ve]){var o=void 0;if(o=n[Ve]._onDragOver({clientX:nt.clientX,clientY:nt.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=yl(n));Al()}},_onTouchMove:function(e){if(Vt){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=ge&&nn(ge,!0),l=ge&&a&&a.a,d=ge&&a&&a.d,c=Ko&&Ae&&Cl(Ae),u=(r.clientX-Vt.clientX+i.x)/(l||1)+(c?c[0]-fr[0]:0)/(l||1),f=(r.clientY-Vt.clientY+i.y)/(d||1)+(c?c[1]-fr[1]:0)/(d||1);if(!pe.active&&!an){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(ge){a?(a.e+=u-(dr||0),a.f+=f-(ur||0)):a={a:1,b:0,c:0,d:1,e:u,f};var h="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");he(ge,"webkitTransform",h),he(ge,"mozTransform",h),he(ge,"msTransform",h),he(ge,"transform",h),dr=u,ur=f,nt=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ge){var e=this.options.fallbackOnBody?document.body:Ce,n=De(se,!0,Ko,!0,e),o=this.options;if(Ko){for(Ae=e;he(Ae,"position")==="static"&&he(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=ct()),n.top+=Ae.scrollTop,n.left+=Ae.scrollLeft):Ae=ct(),fr=Cl(Ae)}ge=se.cloneNode(!0),We(ge,o.ghostClass,!1),We(ge,o.fallbackClass,!0),We(ge,o.dragClass,!0),he(ge,"transition",""),he(ge,"transform",""),he(ge,"box-sizing","border-box"),he(ge,"margin",0),he(ge,"top",n.top),he(ge,"left",n.left),he(ge,"width",n.width),he(ge,"height",n.height),he(ge,"opacity","0.8"),he(ge,"position",Ko?"absolute":"fixed"),he(ge,"zIndex","100000"),he(ge,"pointerEvents","none"),pe.ghost=ge,e.appendChild(ge),he(ge,"transform-origin",Nl/parseInt(ge.style.width)*100+"% "+Dl/parseInt(ge.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,i=e.dataTransfer,r=o.options;if(Le("dragStart",this,{evt:e}),pe.eventCanceled){this._onDrop();return}Le("setupClone",this),pe.eventCanceled||(Ee=Sl(se),Ee.removeAttribute("id"),Ee.draggable=!1,Ee.style["will-change"]="",this._hideClone(),We(Ee,this.options.chosenClass,!1),pe.clone=Ee),o.cloneId=Jo(function(){Le("clone",o),!pe.eventCanceled&&(o.options.removeCloneOnHide||Ce.insertBefore(Ee,se),o._hideClone(),$e({sortable:o,name:"clone"}))}),!n&&We(se,r.dragClass,!0),n?(jo=!0,o._loopId=setInterval(o._emulateDragOver,50)):(_e(document,"mouseup",o._onDrop),_e(document,"touchend",o._onDrop),_e(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,se)),we(document,"drop",o),he(se,"transform","translateZ(0)")),an=!0,o._dragStartId=Jo(o._dragStarted.bind(o,n,e)),we(document,"selectstart",o),Fn=!0,window.getSelection().removeAllRanges(),Rn&&he(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,i,r,a,l=this.options,d=l.group,c=pe.active,u=Go===d,f=l.sort,h=ze||c,p,g=this,m=!1;if(hr)return;function w(T,P){Le(T,g,lt({evt:e,isOwner:u,axis:p?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:h,target:o,completed:y,onMove:function(M,V){return Zo(Ce,n,se,i,M,De(M),e,V)},changed:v},P))}function I(){w("dragOverAnimationCapture"),g.captureAnimationState(),g!==h&&h.captureAnimationState()}function y(T){return w("dragOverCompleted",{insertion:T}),T&&(u?c._hideClone():c._showClone(g),g!==h&&(We(se,ze?ze.options.ghostClass:c.options.ghostClass,!1),We(se,l.ghostClass,!0)),ze!==g&&g!==pe.active?ze=g:g===pe.active&&ze&&(ze=null),h===g&&(g._ignoreWhileAnimating=o),g.animateAll(function(){w("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===se&&!se.animated||o===n&&!o.animated)&&(ln=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(se.parentNode[Ve]._isOutsideThisEl(e.target),!T&&Lt(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){Ye=qe(se),Dt=qe(se,l.draggable),$e({sortable:g,name:"change",toEl:n,newIndex:Ye,newDraggableIndex:Dt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=tt(o,l.draggable,n,!0),w("dragOver"),pe.eventCanceled)return m;if(se.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||g._ignoreWhileAnimating===o)return y(!1);if(jo=!1,c&&!l.disabled&&(u?f||(a=xe!==Ce):ze===this||(this.lastPutMode=Go.checkPull(this,c,se,e))&&d.checkPut(this,c,se,e))){if(p=this._getDirection(e,o)==="vertical",i=De(se),w("dragOverValid"),pe.eventCanceled)return m;if(a)return xe=Ce,I(),this._hideClone(),w("revert"),pe.eventCanceled||(Ht?Ce.insertBefore(se,Ht):Ce.appendChild(se)),y(!0);var C=ar(n,l.draggable);if(!C||fv(e,p,this)&&!C.animated){if(C===se)return y(!1);if(C&&n===e.target&&(o=C),o&&(r=De(o)),Zo(Ce,n,se,i,o,r,e,!!o)!==!1)return I(),C&&C.nextSibling?n.insertBefore(se,C.nextSibling):n.appendChild(se),xe=n,v(),y(!0)}else if(C&&uv(e,p,this)){var $=on(n,0,l,!0);if($===se)return y(!1);if(o=$,r=De(o),Zo(Ce,n,se,i,o,r,e,!1)!==!1)return I(),n.insertBefore(se,$),xe=n,v(),y(!0)}else if(o.parentNode===n){r=De(o);var z=0,W,j=se.parentNode!==n,D=!sv(se.animated&&se.toRect||i,o.animated&&o.toRect||r,p),O=p?"top":"left",H=bl(o,"top","top")||bl(se,"top","top"),S=H?H.scrollTop:void 0;ln!==o&&(W=r[O],jn=!1,Yo=!D&&l.invertSwap||j),z=hv(e,o,r,p,D?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Yo,ln===o);var Y;if(z!==0){var b=qe(se);do b-=z,Y=xe.children[b];while(Y&&(he(Y,"display")==="none"||Y===ge))}if(z===0||Y===o)return y(!1);ln=o,Gn=z;var B=o.nextElementSibling,_=!1;_=z===1;var x=Zo(Ce,n,se,i,o,r,e,_);if(x!==!1)return(x===1||x===-1)&&(_=x===1),hr=!0,setTimeout(dv,30),I(),_&&!B?n.appendChild(se):o.parentNode.insertBefore(se,_?B:o),H&&xl(H,0,S-H.scrollTop),xe=se.parentNode,W!==void 0&&!Yo&&(Uo=Math.abs(W-De(o)[O])),v(),y(!0)}if(n.contains(se))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){_e(document,"mousemove",this._onTouchMove),_e(document,"touchmove",this._onTouchMove),_e(document,"pointermove",this._onTouchMove),_e(document,"dragover",Lt),_e(document,"mousemove",Lt),_e(document,"touchmove",Lt)},_offUpEvents:function(){var e=this.el.ownerDocument;_e(e,"mouseup",this._onDrop),_e(e,"touchend",this._onDrop),_e(e,"pointerup",this._onDrop),_e(e,"pointercancel",this._onDrop),_e(e,"touchcancel",this._onDrop),_e(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(Ye=qe(se),Dt=qe(se,o.draggable),Le("drop",this,{evt:e}),xe=se&&se.parentNode,Ye=qe(se),Dt=qe(se,o.draggable),pe.eventCanceled){this._nulling();return}an=!1,Yo=!1,jn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),gr(this.cloneId),gr(this._dragStartId),this.nativeDraggable&&(_e(document,"drop",this),_e(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Rn&&he(document.body,"user-select",""),he(se,"transform",""),e&&(Fn&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),ge&&ge.parentNode&&ge.parentNode.removeChild(ge),(Ce===xe||ze&&ze.lastPutMode!=="clone")&&Ee&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),se&&(this.nativeDraggable&&_e(se,"dragend",this),pr(se),se.style["will-change"]="",Fn&&!an&&We(se,ze?ze.options.ghostClass:this.options.ghostClass,!1),We(se,this.options.chosenClass,!1),$e({sortable:this,name:"unchoose",toEl:xe,newIndex:null,newDraggableIndex:null,originalEvent:e}),Ce!==xe?(Ye>=0&&($e({rootEl:xe,name:"add",toEl:xe,fromEl:Ce,originalEvent:e}),$e({sortable:this,name:"remove",toEl:xe,originalEvent:e}),$e({rootEl:xe,name:"sort",toEl:xe,fromEl:Ce,originalEvent:e}),$e({sortable:this,name:"sort",toEl:xe,originalEvent:e})),ze&&ze.save()):Ye!==sn&&Ye>=0&&($e({sortable:this,name:"update",toEl:xe,originalEvent:e}),$e({sortable:this,name:"sort",toEl:xe,originalEvent:e})),pe.active&&((Ye==null||Ye===-1)&&(Ye=sn,Dt=Ln),$e({sortable:this,name:"end",toEl:xe,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Le("nulling",this),Ce=se=xe=ge=Ht=Ee=Fo=Nt=Vt=nt=Fn=Ye=Dt=sn=Ln=ln=Gn=ze=Go=pe.dragged=pe.ghost=pe.clone=pe.active=null;var e=this.el;Xo.forEach(function(n){e.contains(n)&&(n.checked=!0)}),Xo.length=dr=ur=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":se&&(this._onDragOver(e),cv(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],tt(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||gv(n));return e},sort:function(e,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];tt(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return tt(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var i=Vn.modifyOption(this,e,n);typeof i<"u"?o[e]=i:o[e]=n,e==="group"&&Bl(o)},destroy:function(){Le("destroy",this);var e=this.el;e[Ve]=null,_e(e,"mousedown",this._onTapStart),_e(e,"touchstart",this._onTapStart),_e(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(_e(e,"dragover",this),_e(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Wo.splice(Wo.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Nt){if(Le("hideClone",this),pe.eventCanceled)return;he(Ee,"display","none"),this.options.removeCloneOnHide&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),Nt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Nt){if(Le("showClone",this),pe.eventCanceled)return;se.parentNode==Ce&&!this.options.group.revertClone?Ce.insertBefore(Ee,se):Ht?Ce.insertBefore(Ee,Ht):Ce.appendChild(Ee),this.options.group.revertClone&&this.animate(se,Ee),he(Ee,"display",""),Nt=!1}}};function cv(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Zo(t,e,n,o,i,r,a,l){var d,c=t[Ve],u=c.options.onMove,f;return window.CustomEvent&&!wt&&!$n?d=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(d=document.createEvent("Event"),d.initEvent("move",!0,!0)),d.to=e,d.from=t,d.dragged=n,d.draggedRect=o,d.related=i||e,d.relatedRect=r||De(e),d.willInsertAfter=l,d.originalEvent=a,t.dispatchEvent(d),u&&(f=u.call(c,d,a)),f}function pr(t){t.draggable=!1}function dv(){hr=!1}function uv(t,e,n){var o=De(on(n.el,0,n.options,!0)),i=kl(n.el,n.options,ge),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}function fv(t,e,n){var o=De(ar(n.el,n.options.draggable)),i=kl(n.el,n.options,ge),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}function hv(t,e,n,o,i,r,a,l){var d=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,f=o?n.bottom:n.right,h=!1;if(!a){if(l&&Uo<c*i){if(!jn&&(Gn===1?d>u+c*r/2:d<f-c*r/2)&&(jn=!0),jn)h=!0;else if(Gn===1?d<u+Uo:d>f-Uo)return-Gn}else if(d>u+c*(1-i)/2&&d<f-c*(1-i)/2)return pv(e)}return h=h||a,h&&(d<u+c*r/2||d>f-c*r/2)?d>u+c/2?1:-1:0}function pv(t){return qe(se)<qe(t)?1:-1}function gv(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function mv(t){Xo.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&Xo.push(o)}}function Jo(t){return setTimeout(t,0)}function gr(t){return clearTimeout(t)}qo&&we(document,"touchmove",function(t){(pe.active||an)&&t.cancelable&&t.preventDefault()}),pe.utils={on:we,off:_e,css:he,find:wl,is:function(e,n){return!!tt(e,n,e,!1)},extend:J0,throttle:El,closest:tt,toggleClass:We,clone:Sl,index:qe,nextTick:Jo,cancelNextTick:gr,detectDirection:Ml,getChild:on,expando:Ve},pe.get=function(t){return t[Ve]},pe.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(pe.utils=lt(lt({},pe.utils),o.utils)),Vn.mount(o)})},pe.create=function(t,e){return new pe(t,e)},pe.version=K0;var Te=[],Wn,mr,vr=!1,yr,_r,Qo,Yn;function vv(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?we(document,"dragover",this._handleAutoScroll):this.options.supportPointer?we(document,"pointermove",this._handleFallbackAutoScroll):o.touches?we(document,"touchmove",this._handleFallbackAutoScroll):we(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?_e(document,"dragover",this._handleAutoScroll):(_e(document,"pointermove",this._handleFallbackAutoScroll),_e(document,"touchmove",this._handleFallbackAutoScroll),_e(document,"mousemove",this._handleFallbackAutoScroll)),Pl(),ei(),Q0()},nulling:function(){Qo=mr=Wn=vr=Yn=yr=_r=null,Te.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(Qo=n,o||this.options.forceAutoScrollFallback||$n||wt||Rn){wr(n,this.options,l,o);var d=kt(l,!0);vr&&(!Yn||r!==yr||a!==_r)&&(Yn&&Pl(),Yn=setInterval(function(){var c=kt(document.elementFromPoint(r,a),!0);c!==d&&(d=c,ei()),wr(n,i.options,c,o)},10),yr=r,_r=a)}else{if(!this.options.bubbleScroll||kt(l,!0)===ct()){ei();return}wr(n,this.options,kt(l,!1),!1)}}},yt(t,{pluginName:"scroll",initializeByDefault:!0})}function ei(){Te.forEach(function(t){clearInterval(t.pid)}),Te=[]}function Pl(){clearInterval(Yn)}var wr=El(function(t,e,n,o){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,d=ct(),c=!1,u;mr!==n&&(mr=n,ei(),Wn=e.scroll,u=e.scrollFn,Wn===!0&&(Wn=kt(n,!0)));var f=0,h=Wn;do{var p=h,g=De(p),m=g.top,w=g.bottom,I=g.left,y=g.right,v=g.width,C=g.height,$=void 0,z=void 0,W=p.scrollWidth,j=p.scrollHeight,D=he(p),O=p.scrollLeft,H=p.scrollTop;p===d?($=v<W&&(D.overflowX==="auto"||D.overflowX==="scroll"||D.overflowX==="visible"),z=C<j&&(D.overflowY==="auto"||D.overflowY==="scroll"||D.overflowY==="visible")):($=v<W&&(D.overflowX==="auto"||D.overflowX==="scroll"),z=C<j&&(D.overflowY==="auto"||D.overflowY==="scroll"));var S=$&&(Math.abs(y-i)<=a&&O+v<W)-(Math.abs(I-i)<=a&&!!O),Y=z&&(Math.abs(w-r)<=a&&H+C<j)-(Math.abs(m-r)<=a&&!!H);if(!Te[f])for(var b=0;b<=f;b++)Te[b]||(Te[b]={});(Te[f].vx!=S||Te[f].vy!=Y||Te[f].el!==p)&&(Te[f].el=p,Te[f].vx=S,Te[f].vy=Y,clearInterval(Te[f].pid),(S!=0||Y!=0)&&(c=!0,Te[f].pid=setInterval(function(){o&&this.layer===0&&pe.active._onTouchMove(Qo);var B=Te[this.layer].vy?Te[this.layer].vy*l:0,_=Te[this.layer].vx?Te[this.layer].vx*l:0;typeof u=="function"&&u.call(pe.dragged.parentNode[Ve],_,B,t,Qo,Te[this.layer].el)!=="continue"||xl(Te[this.layer].el,_,B)}.bind({layer:f}),24))),f++}while(e.bubbleScroll&&h!==d&&(h=kt(h,!1)));vr=c}},30),Ol=function(e){var n=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,d=e.unhideGhostForTarget;if(n){var c=o||r;l();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(u.clientX,u.clientY);d(),c&&!c.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function br(){}br.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=on(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Ol},yt(br,{pluginName:"revertOnSpill"});function Cr(){}Cr.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:Ol},yt(Cr,{pluginName:"removeOnSpill"}),pe.mount(new vv),pe.mount(Cr,br);var yv=class{events=new Map;on(t,e){this.events.has(t)||this.events.set(t,new Set),this.events.get(t).add(e)}once(t,e){const n=(...o)=>{e(...o),this.off(t,n)};this.on(t,n)}emit(t,...e){const n=this.events.get(t);if(n)for(const o of n)return o(...e)}off(t,e){if(!e){this.events.delete(t);return}const n=this.events.get(t);n&&(n.delete(e),n.size===0&&this.events.delete(t))}clear(){this.events.clear()}},Iy=new yv,$l=(t,e,n,o,i,r,a,l)=>{const d=(0,s.ref)(),c=(0,s.reactive)({}),u=(0,s.computed)(()=>{const _=[];return Object.keys(c).forEach(x=>{const T=c[x];T.dragType==="component"&&T.type!=="pkey"&&_.push(T)}),_}),f=(_=[],x)=>{const T=e?.value?.init;typeof T=="function"&&T(_,x)},h=_=>i?i(_,{componentDic:c,components:u.value,configData:d.value.config}):{},p=(_,x)=>{if(d.value?.id===_)return;const T=c[_]||x;if(T?d.value=T:_===n.id?d.value=n:d.value=null,d.value){const P=r[d.value.type];P?(f(P,d.value.config),h(d.value.type)):f([])}else f([]);x&&Se("dragClick",{id:x.id})},g=()=>t.value.$el.getBoundingClientRect(),m=_=>_===n.id?n:c[_]||{},w=_=>{const x=[];if(_===n.id)x.push({id:_,name:n.name});else{const T=c[_];if(T){x.push({id:_,name:T.name});const P=w(T.containerId);x.push(...P)}}return x},I=(_,x)=>{const T=c[x];if(T===void 0)return!1;const P=T.containerId;return _===P?!0:P===n.id?!1:I(_,P)},y=_=>o?o(_)||{}:{},v=(_,x,T,P)=>{if(l){const L=m(_);return l(T.componentType,{container:L,groupId:x,configData:T},P)}return!1},C=({name:_,type:x,dragType:T,isInput:P,componentName:L,runtimeType:M},V,F,G,X=!1)=>{const J=y(x);if(J.id=Ft(),J.span=24,J.componentType=x,$(V,J.componentType))return;v(V,G,J,!0);const U={id:J.id,name:_,type:x,runtimeType:M,componentName:L||"",dragType:T||"component",containerId:V,isInput:!!P,level:c[V]?c[V].level+1:1,config:J,isNewAdd:!X,groupId:G};return U.dragType==="container"&&(U.children=[]),c[U.id]=U,m(V).children?.splice(F,0,U),U},$=(_,x)=>!!(m(_).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(x)),z=(_,x,T=!1)=>{let P=null;const L=m(_).children,M=L?.findIndex(V=>V.id===x)||0;if(T&&L&&L.length>1){let V=M+1;M>0&&(V=M-1),P=L[V]}return L?.splice(M,1),P?.id},W=(_,x,T,P)=>{const L=m(x).children,M=_.containerId!==x;_.containerId=x,_.groupId=P,L?.splice(T,0,_),v(x,P,_.config,M)&&(Y(),p(_.id))},j=_=>{let x="";const T=m(_);return T&&(T.children&&T.children.length>0&&T.children.forEach(P=>{j(P.id)}),x=z(T.containerId,_,!0)||"",delete c[_]),d.value&&d.value.id===_&&(d.value=null,e.value.init([])),x},D=(_,x=[])=>{const T=m(_);if(T&&T.children&&T.children.length>0){const P=[];T.children.forEach(L=>{L.groupId&&x.includes(L.groupId)&&P.push(L.id)}),P.forEach(L=>{j(L),delete c[L]})}},O=(_,x)=>{const T=m(_);T&&(T.children&&T.children.length>0&&T.children.forEach(P=>{P.groupId===x&&j(P.id)}),delete c[_])},H=_=>{const x=ni(m(_));x.id=Ft(),x.config.id=x.id,c[x.id]=x;const T=m(x.containerId).children,P=T?.findIndex(L=>L.id===_)||0;T?.splice(P+1,0,x)},S=()=>{n.children=[],ac(c),d.value&&(Se("dragClick",{id:""}),d.value=null,e.value.init([]))},Y=()=>{d.value&&(Se("dragClick",{id:""}),d.value=null,e.value.init([]))},b=_=>{const x=d.value,T=m(x.containerId).children,P=T?.findIndex(L=>L.id===x.id)||0;j(x.id),(0,s.nextTick)(()=>{const L=a[_],M=y(_);M.id=x.id,M.span=x.config.span,M.componentType=_,M.table=x.config.table,M.field=x.config.field,x.config.isSubTable&&(M.isSubTable=x.config.isSubTable);const V={id:M.id,name:L.name,type:_,runtimeType:L.runtimeType,componentName:L.componentName||"",dragType:x.dragType,groupId:x.groupId,containerId:x.containerId,isInput:x.isInput,level:x.level,config:M,isNewAdd:!0};c[V.id]=V,T?.splice(P,0,V)})},B=_=>{Se("dragAddByClick",_)};return(0,s.provide)("d-drag-design-provide",{activedComponent:d,getDesignLocals:g,getComponent:m,getParentComponents:w,isMyChildComponent:I,selectComponent:p,addComponent:C,deleteComponent:j,copyComponent:H,removeComponentFromContainer:z,addComponentToContainer:W,top:n,deleteChildren:O,deleteChildrens:D}),{activedComponent:d,clearComponents:S,changeComponent:b,schemaComponentDic:c,clearSelect:Y,addComponent:C,addComponentByTable:B,designComponentList:u}},_v=(0,s.defineComponent)({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(t,{expose:e}){const n=t,o=(0,s.computed)(()=>n.tableList.map(c=>({label:c.comment?`${c.name}(${c.comment})`:c.name,value:c.name}))),i=(0,s.ref)(),r=[{id:"layout",type:"j-layout",config:{top:48,topMove:!1,autoSize:["default"]},children:[{id:"table",type:"j-select",slot:"top",config:{label:"表名选择",loadOptions:()=>o,allowClear:!1}},{id:"fields",type:"j-table",config:{editConfig:{isAddBtn:!1,isRemoveBtn:!1},height:"100%",isMultiple:!0},children:[{id:"name",type:"span",config:{label:"字段名"}},{id:"type",type:"j-select",config:{label:"组件选择",options:n.componentList,width:200}}]}]}],a=(c,u)=>{if(c.id==="table"){const f=n.tableList.find(h=>h.name===u.value);if(f){const h=f.columns.map(p=>({value:p.name,name:p.coment?`${p.name}(${p.coment})`:p.name,type:"input",label:p.coment||p.name,selected:!p.isPrimary}));i.value.setFormData({fields:h})}}};return(0,s.onMounted)(()=>{i.value.init(r)}),e({ok:()=>{const c=i.value.getFormData(!1);return{addList:c.fields.filter(u=>u.selected),table:c.table,containerId:c.containerId,isSubTable:c.isSubTable}},closed:()=>{}}),(c,u)=>{const f=(0,s.resolveComponent)("j-form");return(0,s.openBlock)(),(0,s.createBlock)(f,{ref_key:"formRef",ref:i,"form-config":{labelWidth:"72px"},onChange:a},null,512)}}}),wv=_v,bv={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",COMP_PROVIDE:"jcode_comp_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide",PAGE_PROVIDE:"jcode_page_provide"};function Cv(t,e){return(0,s.inject)(t,e)}function Er(){return Cv(bv.APP_PROVIDE,{t:(t,...e)=>{if(!t)return"";if(typeof t!="string")return t;let n=t||"";return e.length>0&&e.forEach((o,i)=>{n=n.replace(new RegExp(`\\{${i}\\}`,"g"),o)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:t,config:e})=>{if(t==null||t==="")return"";if(e?.dataType==="options"){let n=[t];typeof t=="string"&&t.split&&(n=t.split(","));const o=(e.options||[]).filter(i=>n.includes(i[e.valueKey||"value"])).map(i=>i[e.labelKey||"label"]);return String(o)||t}return t},getObjectList:({value:t,config:e})=>{if(t==null||t==="")return[];if(e?.dataType==="options"){let n=[t];return typeof t=="string"&&t.split&&(n=t.split(",")),(e.options||[]).filter(o=>n.includes(o[e.valueKey||"value"]))||[]}return[]}})})}var Ev=(0,s.defineComponent)({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){const{t:e}=Er();return{labelWidth:(0,s.computed)(()=>t.componentData.config?.notShowLabel?"0px":t.componentData.config?.labelWidth===void 0&&t.globalConfig.labelWidth!==void 0?`${t.globalConfig.labelWidth}px`:t.componentData.config?.labelWidth?`${t.componentData.config?.labelWidth}px`:void 0),inputConfig:(0,s.computed)(()=>{const n={...t.componentData?.config};return t.globalConfig.size===void 0&&(n.size=t.globalConfig.size),n.display=!0,n}),t:e}}}),xv=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n};function Sv(t,e,n,o,i,r){const a=(0,s.resolveComponent)("j-comp"),l=(0,s.resolveComponent)("el-form-item");return t.componentData.isInput?((0,s.openBlock)(),(0,s.createBlock)(l,{key:0,"label-width":t.labelWidth,label:t.t(t.componentData.config?.notShowLabel?"":t.componentData.config?.label||""),rules:t.componentData.config?.required?[{required:!0,message:""}]:[]},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(a,{type:t.componentData?.componentName||t.componentData?.type,config:t.inputConfig,modelValue:t.componentData?.config.defaultValue},null,8,["type","config","modelValue"])]),_:1},8,["label-width","label","rules"])):t.componentData?.children?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.mergeProps)({key:1},t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"])):((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.normalizeProps)((0,s.mergeProps)({key:2},t.componentData?.config)),null,16))}var Rl=xv(Ev,[["render",Sv]]),kv={class:"d-form-design j-block"},Nv={class:"d-form-design-left"},Dv={class:"d-form-design-component-list"},Tv={class:"j-component-tool"},Iv={class:"j-component-tool-name"},Mv={class:"d-form-design-center"},Bv={class:"d-form-design-container"},zv={key:0,class:"d-form-design-empty"},Av={class:"d-form-design-right"},Pv={class:"d-form-design-panel-title"},Ov={style:{margin:"0","font-size":"14px"}},$v={class:"d-form-design-panel"},Rv=(0,s.defineComponent)({name:"DFormDesign",__name:"formDesign",props:{notBindTable:{type:Boolean,default:!1},components:{default:()=>[]},componentConfigs:{default:()=>({})},componentInit:{type:Function,default:void 0},containerAddComponent:{type:Function,default:void 0},componentConfigInit:{type:Function,default:void 0},componentConfigChange:{type:Function,default:void 0},componentConfigValidate:{type:Function,default:void 0},flowComponents:{default:()=>[]},flowInit:{type:Function,default:void 0},flowComponentConfigInit:{type:Function,default:void 0},flowComponentConfigChange:{type:Function,default:void 0},flowComponentConfigs:{default:()=>({})},actions:{}},setup(t,{expose:e}){const n=t,{t:o,warning:i,error:r}=Er(),a=(0,s.reactive)({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),l=(0,s.ref)([]),d=n.components.length;for(let E=0;E<d;E++)l.value.push(E);n.componentInit&&(a.config=n.componentInit("form")||{});const c=(0,s.ref)([]),u=(0,s.computed)(()=>c.value.map(E=>({label:E.comment?`${E.name}(${E.comment})`:E.name,value:E.name}))),f=(0,s.computed)(()=>{if(z.value){const E=$.value.getFormData(!1);if(E.table){const k=c.value.find(A=>A.name===E.table);if(k)return k.columns.map(A=>({value:A.name,label:A.coment?`${A.name}(${A.coment})`:A.name,coment:A.coment}))}}return[]}),h=E=>{c.value=E},p={},g=[];n.components.forEach(({children:E})=>{E.forEach(k=>{p[k.type]=k,k.dragType=k.dragType||"component",k.isInput!==!1&&(k.isInput=!0,g.push({label:k.name,value:k.type}))})});const m=E=>{E.forEach(k=>{k.type==="d-input-flow"&&(k.config=k.config||{},k.config.flowComponents=n.flowComponents,k.config.flowInit=n.flowInit,k.config.flowComponentConfigInit=A=>{n.flowComponentConfigInit&&(A.designComponents=H.value,A.component=z.value,n.flowComponentConfigInit(A))},k.config.flowComponentConfigs=n.flowComponentConfigs,k.config.flowComponentConfigChange=n.flowComponentConfigChange),k.children&&m(k.children)})},w={};Object.keys(n.componentConfigs||{}).forEach(E=>{const{hasBase:k,isInput:A,hasTwoPlaceholder:N,hasPlaceholder:Q,hasSpan:K,hasLabel:re,bindTable:ne,labelTitle:de}=p[E]||{hasBase:!1},ye=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:A,options:g}},{id:"label",type:"j-input",config:{label:de||"标题"},getCompConfig:({formData:me})=>({display:re!==!1&&!me.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(de||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:me})=>({display:re!==!1&&!me.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:me})=>({display:A&&!me.notShowLabel&&!me.isSubTable})},{id:"placeholder",type:"j-input",config:{display:A&&!N&&Q!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!N,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!N,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:me})=>({display:K!==!1&&!me.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:me})=>({display:!!me.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:A&&ne!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>u},getCompConfig:({formData:me})=>({display:(A&&ne!==!1||ne===!0)&&(!me.isSubTable||ne===!0)&&!me.isNotSave&&!n.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>f},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&!n.notBindTable})},{id:"csType",type:"j-select",config:{label:"字段类型",allowClear:!1,options:[{label:"短文本",value:"string"},{label:"长文本",value:"text"},{label:"整数",value:"int"},{label:"小数",value:"decimal"},{label:"时间日期",value:"DateTime"}]},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&n.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&n.notBindTable&&me.csType==="string"})}],ve={type:"j-collapse",config:{defaultValue:[]},children:[]};k!==!1&&(ve.children?.push({config:{label:"基础信息"},children:[...ye]}),ve.config?.defaultValue.push("_collapse0")),ve.children?.push(...n.componentConfigs[E]),m(ve.children||[]),w[E]=[ve]});const I=E=>{const{value:k}=E||{};E.id==="componentType"&&j(k),z.value&&n.componentConfigChange&&(E.id==="field"&&E.data?.coment&&(z.value.config.label=E.data?.coment),n.componentConfigChange(z.value.type,{configRef:$,configData:z.value.config,...E})),E.id==="table"&&z.value&&z.value.type==="gridtable"&&(z.value.children||[]).forEach(A=>{A.isInput&&(A.config.table=k)})},y=(E,k)=>{p[E]?.isInput&&(n.notBindTable&&(k.configData.csType||$.value.setFormData({main:{csType:p[E]?.csType,fieldLen:p[E]?.fieldLen}})),u.value.length===1&&$.value.setFormData({main:{table:u.value[0].value}})),n.componentConfigInit&&n.componentConfigInit(E,{configRef:$,...k,notBindTable:n.notBindTable})},v=(E,k,A)=>{let N=!1;const Q=p[E];return k.container.type==="gridtable"?(!k.configData.isSubTable||A)&&(k.configData.isSubTable=!0,Q.isInput&&(k.configData.table=k.container.config.table,k.configData.field=""),N=!0):k.configData.isSubTable&&(N=!0,k.configData.isSubTable=!1,Q.isInput&&(k.configData.table="")),n.containerAddComponent&&n.containerAddComponent(E,k),N},C=(0,s.ref)(),$=(0,s.ref)(),{activedComponent:z,clearComponents:W,changeComponent:j,schemaComponentDic:D,addComponentByTable:O,designComponentList:H}=$l(C,$,a,n.componentInit,y,w,p,v),S=(0,s.computed)(()=>z.value?`【${z.value.name}】`:"");(0,s.provide)("dui-design-provide",{designItemName:Rl});const Y=()=>{n.componentInit&&(a.config=n.componentInit("form")||{}),W()},b=()=>{let E=0;const k=al(a.config,a.children||[]);if(n.notBindTable){const A={};k.components.forEach(K=>{const{isInput:re,bindTable:ne}=p[K.type]||{hasBase:!1};re&&ne!==!1?K.config.table&&!A.main&&(A.main={name:K.config.table,comment:"主表",type:"main",pKey:"J_Id"}):ne&&(A[K.id]={name:K.config.table||"t"+new Date().getTime()+E,comment:`子表${K.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},K.config.table=A[K.id].name,E++)}),A.main||(A.main={name:"t"+new Date().getTime()+E,comment:"主表",type:"main",pKey:"J_Id"},E++);let N=0;k.components.forEach(K=>{const{isInput:re,bindTable:ne}=p[K.type]||{hasBase:!1};!K.config.isNotSave&&re&&ne!==!1&&(K.config.csType||(K.config.csType=p[K.type]?.csType,K.config.fieldLen=p[K.type]?.fieldLen),K.config.isSubTable?K.config.table=A[K.containerId].name:K.config.table=A.main.name,K.config.field=K.config.field||`f${Math.floor(Date.now()/1e3)}${N}`,N++)});const Q=[];Object.keys(A).forEach(K=>{A[K].type==="chlid"&&(A[K].relationName=A.main.name,A[K].comment+=`,关联主表${A.main.name}`),Q.push(A[K])}),k.db=Q}else{const A={};c.value.forEach(N=>{N.columns.forEach(Q=>{A[`${N.name}_${Q.name}`]=Q.csType})}),k.components.forEach(N=>{N.config.table&&N.config.field&&(N.config.csType=A[`${N.config.table}_${N.config.field}`])})}return n.notBindTable?k.db.forEach(A=>{if(!k.components.find(N=>N.config.table===A.name&&N.config.field==="J_Id")){const N=k.components.find(Q=>Q.config.table===A.name&&Q.config.field);N&&k.components.push({id:A.name+"_J_Id",name:A.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:A.name,field:"J_Id",label:"主键"},containerId:N.containerId,level:N.level})}}):c.value.forEach(A=>{A.columns.forEach(N=>{if(N.isPrimary&&!k.components.find(Q=>Q.config.table===A.name&&Q.config.field===N.name)){const Q=k.components.find(K=>K.config.table===A.name&&K.config.field);Q&&k.components.push({id:A.name+"_"+N.name,name:A.name+"_"+N.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:A.name,field:N.name,label:"主键"+N.name,isIdentity:N.isIdentity},containerId:Q.containerId,level:Q.level})}})}),k},B=E=>{const k=M0(E,p);a.config=k.formConfig,a.children?.push(...k.componentList),Object.keys(k.componentDic).forEach(A=>{D[A]=k.componentDic[A]})},_=()=>T(al(a.config,a.children||[]).components,{},{}),x=E=>{const{isInput:k,bindTable:A}=p[E]||{hasBase:!1};if(!k&&A)return!0},T=(E,k,A)=>{if(!n.notBindTable)for(const N of E){const{isInput:Q,bindTable:K}=p[N.type]||{hasBase:!1};if(!N.config.isNotSave&&N.type!=="pkey"){if(Q&&K!==!1){if(Xn(N.config.table))return r&&r(`请【${N.config.label}】绑定数据表!`),!1;if(!N.config.isSubTable){if(A[N.config.table]&&x(A[N.config.table].type))return r&&r(`【${N.config.label}】和【${A[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(A[N.config.table]=N)}}else if(K){if(Xn(N.config.table))return r&&r(`【${N.config.label}】请绑定数据表!`),!1;if(A[N.config.table])return r&&r(`【${N.config.label}】和【${A[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(A[N.config.table]=N)}}}for(const N of E){if(!n.notBindTable){const{isInput:Q,bindTable:K}=p[N.type]||{hasBase:!1};if(!N.config.isNotSave&&Q&&K!==!1){if(Xn(N.config.field))return r&&r(`请【${N.config.label}】绑定表字段!`),!1;if(k[`${N.config.table}-${N.config.field}`])return r&&r(`【${N.config.label}】和【${k[`${N.config.table}-${N.config.field}`].config.label}】重复绑定【${N.config.field}】字段!`),!1;k[`${N.config.table}-${N.config.field}`]=N}}if(n.componentConfigValidate&&!n.componentConfigValidate(N.type,{configData:N.config,errorTip:r}))return!1}return!0},P=(0,s.ref)(),L=(0,s.ref)(),M=(0,s.reactive)({width:0,height:0,formConfig:{}});let V=0;const F=E=>{if(L.value)V=0,L.value.init(E||[]);else{if(V>600){console.warn("表单组件加载超时");return}V++,setTimeout(()=>{F(E)},100)}},G=()=>{},X=()=>{},J=(0,s.ref)(),U=(0,s.ref)(),Z=()=>{const{addList:E,table:k}=U.value?.ok()||{addList:[]};if(E.length<=0)i&&i("请选择字段!");else{if(z.value?.config.componentType==="gridtable"||z.value?.config.isSubTable)if(z.value.config.table){if(z.value.config.table!==k){i&&i("请设置相同的表和子表!");return}}else{let A=z.value;z.value.config.isSubTable&&(A=D[z.value.containerId]),A.config.table=k,(A.children||[]).forEach(N=>{N.isInput&&(N.config.table=k)}),$.value.setFormData({main:{table:k}})}E.forEach(A=>{const N=ir(p[A.type]);N.config={table:k,field:A.value,label:A.label},O(N)}),J.value.close()}},te=()=>{U.value?.closed()};return e({setTables:E=>{h(E)},getSchema:()=>b(),setSchema:E=>B(E),reset:()=>Y(),validate:()=>_()}),(E,k)=>{const A=(0,s.resolveComponent)("j-icon"),N=(0,s.resolveComponent)("d-drag-tool"),Q=(0,s.resolveComponent)("el-collapse-item"),K=(0,s.resolveComponent)("el-collapse"),re=(0,s.resolveComponent)("d-drag-form-list"),ne=(0,s.resolveComponent)("el-row"),de=(0,s.resolveComponent)("d-drag-container"),ye=(0,s.resolveComponent)("j-form"),ve=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)("div",kv,[(0,s.createElementVNode)("div",Nv,[(0,s.createElementVNode)("div",Dv,[(0,s.createVNode)(K,{modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=me=>l.value=me)},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.components,(me,dt)=>((0,s.openBlock)(),(0,s.createBlock)(Q,{key:dt,title:me.name,name:dt},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(me.children,(Tt,ti)=>((0,s.openBlock)(),(0,s.createBlock)(N,{key:ti,config:Tt},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Tv,[(0,s.createVNode)(A,{class:"j-component-tool-icon",icon:Tt.icon,size:14},null,8,["icon"]),(0,s.createElementVNode)("div",Iv,(0,s.toDisplayString)((0,s.unref)(o)(Tt.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,s.createElementVNode)("div",Mv,[(0,s.createElementVNode)("div",Bv,[(0,s.createVNode)(de,{ref_key:"dragContainer",ref:C,class:"d-form-design-drag-container","is-component-container":!1,"component-data":a},{default:(0,s.withCtx)(()=>[!a.children||a.children.length===0?((0,s.openBlock)(),(0,s.createElementBlock)("div",zv,[...k[1]||(k[1]=[(0,s.createElementVNode)("div",null,"请从左侧拖拽组件到此处",-1)])])):((0,s.openBlock)(),(0,s.createBlock)(ne,{key:1},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(re,{"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),(0,s.withDirectives)((0,s.createElementVNode)("div",Av,[(0,s.createElementVNode)("div",Pv,[(0,s.createElementVNode)("span",Ov,(0,s.toDisplayString)(`${(0,s.unref)(o)("属性配置")}${S.value}`),1)]),(0,s.createElementVNode)("div",$v,[(0,s.createVNode)(ye,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:$,onChange:I},null,512)])],512),[[s.vShow,(0,s.unref)(z)]]),(0,s.createVNode)(ve,{ref_key:"previewFormLayerRef",ref:P,width:M.width,height:M.height,onOk:G,onClosed:X},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(ye,{config:M.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:L,actions:t.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),(0,s.createVNode)(ve,{ref_key:"importFormLayerRef",ref:J,width:800,height:600,"btn-text":"确认",onOk:Z,onClosed:te},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(wv,{"component-list":g,"table-list":c.value,ref_key:"importComponentRef",ref:U},null,8,["table-list"])]),_:1},512)])}}}),Hv=Rv,Hl=Mt(Hv,[Rl]),Vl=(t,e)=>{const n={ver:"V3",indexPage:{...t},components:[]};return Ll(e||[],n.components),n},Ll=(t,e)=>{t.forEach(n=>{const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};n.dragType==="container"&&Ll(n.children||[],e),e.push(o)})},Vv=t=>{const e=Lv(t.components);return{pageConfig:t.indexPage,componentList:e}},Lv=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{}};o.config&&Object.keys(o.config).forEach(r=>{i.config[r]=o.config[r]}),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{n[o]&&(n[o].children=e[o])}),e.indexPage||[]},Fv=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.indexPage;const a={};r.components.forEach(l=>{const d=e[l.type];if(!d)return;a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:d.dragType||"component",componentName:d.componentName||"",runtimeType:d.runtimeType,groupId:l.groupId,config:l.config,isInput:!1,containerId:l.containerId,level:l.level};i[c.id]=c,a[l.containerId].push(c),c.dragType==="container"&&(c.children=[])}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.indexPage||[]}return{pageConfig:n,componentList:o,componentDic:i}},Gv=(0,s.defineComponent)({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.mergeProps)(t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"]))}}),Fl=Gv,jv={class:"d-index-design j-block"},Wv={class:"d-index-design-left"},Yv={class:"j-component-list"},Uv={class:"j-component-tool"},Xv={class:"j-component-tool-name"},qv={class:"d-index-design-center"},Kv={class:"design-toolbar"},Zv={class:"design-container"},Jv={key:0,class:"j-block design-empty"},Qv={class:"d-index-design-right"},ey={class:"d-index-design-panel-title"},ty={style:{margin:"0","font-size":"14px"}},ny={class:"d-index-design-panel"},oy=(0,s.defineComponent)({name:"DIndexDesign",__name:"indexDesign",props:{components:{type:Array,default:()=>[]},componentConfigs:{type:Object,default:()=>({})},componentInit:Function,containerAddComponent:Function,componentConfigInit:Function,componentConfigChange:Function,flowComponents:{type:Array,default:()=>[]},flowInit:Function,flowComponentConfigInit:Function,flowComponentConfigChange:Function,flowComponentConfigs:{type:Object,default:()=>({})}},setup(t,{expose:e}){const{t:n}=Er(),o=t,i=_=>{_.forEach(x=>{x.type==="d-input-flow"&&(x.config=x.config||{},x.config.flowComponents=o.flowComponents,x.config.flowInit=o.flowInit,x.config.flowComponentConfigInit=T=>{o.flowComponentConfigInit&&(T.designComponents=w.value,T.component=p.value,o.flowComponentConfigInit(T))},x.config.flowComponentConfigs=o.flowComponentConfigs,x.config.flowComponentConfigChange=o.flowComponentConfigChange),x.children&&i(x.children)})},r=(0,s.reactive)({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});o.componentInit&&(r.config=o.componentInit("indexPage")||{});const a={},l=[];o.components.forEach(({children:_})=>{_.forEach(x=>{a[x.type]=x,x.dragType=x.dragType||"component",l.push({label:x.name,value:x.type})})});const d={};Object.keys(o.componentConfigs).forEach(_=>{const{hasBase:x}=a[_]||{hasBase:!1},T=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],P={type:"j-collapse",config:{defaultValue:[]},children:[]};x!==!1&&(P.children?.push({config:{label:"基础信息"},children:[...T]}),P.config?.defaultValue.push("_collapse0")),P.children?.push(...o.componentConfigs[_]),i(P.children||[]),d[_]=[P]});const c=_=>{p.value&&o.componentConfigChange&&o.componentConfigChange(p.value.type,{configRef:h,configData:p.value.config,..._})},u=(_,x)=>{o.componentConfigInit&&o.componentConfigInit(_,{configRef:h,...x})},f=(0,s.ref)(),h=(0,s.ref)(),{activedComponent:p,clearComponents:g,schemaComponentDic:m,designComponentList:w}=$l(f,h,r,o.componentInit,u,d,a,o.containerAddComponent),I=(0,s.computed)(()=>p.value?`【${p.value.name}】`:""),y=(0,s.ref)([]),v=o.components.length;for(let _=0;_<v;_++)y.value.push(_);(0,s.provide)("dui-design-provide",{designItemName:Fl});const C=()=>{g()},$=()=>{o.componentInit&&(r.config=o.componentInit("indexPage")||{}),g()},z=()=>(console.log("pValidate"),!0),W=()=>Vl(r.config,r.children||[]),j=_=>{const x=Fv(_,a);r.config=x.pageConfig,r.children?.push(...x.componentList),Object.keys(x.componentDic).forEach(T=>{m[T]=x.componentDic[T]})},D=(0,s.ref)(),O=(0,s.ref)();(0,s.ref)(""),(0,s.reactive)({formConfig:{}});let H=0;const S=_=>{if(O.value)H=0,O.value.init(_);else{if(H>600){console.warn("组件加载超时");return}H++,setTimeout(()=>{S(_)},100)}},Y=()=>{},b=()=>{},B=()=>{const{componentList:_}=Vv(Vl(r.config,r.children||[]));D.value.open("页面预览","full"),(0,s.nextTick)(()=>{S(_)})};return e({reset:$,validate:z,getSchema:W,setSchema:j}),(_,x)=>{const T=(0,s.resolveComponent)("j-icon"),P=(0,s.resolveComponent)("d-drag-tool"),L=(0,s.resolveComponent)("el-collapse-item"),M=(0,s.resolveComponent)("el-collapse"),V=(0,s.resolveComponent)("j-button"),F=(0,s.resolveComponent)("el-tooltip"),G=(0,s.resolveComponent)("el-divider"),X=(0,s.resolveComponent)("el-empty"),J=(0,s.resolveComponent)("d-drag-index-list"),U=(0,s.resolveComponent)("d-drag-container"),Z=(0,s.resolveComponent)("j-form"),te=(0,s.resolveComponent)("j-page"),oe=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)("div",jv,[(0,s.createElementVNode)("div",Wv,[x[1]||(x[1]=(0,s.createElementVNode)("div",{class:"d-index-design-panel-title"},"组件库",-1)),(0,s.createElementVNode)("div",Yv,[(0,s.createVNode)(M,{modelValue:y.value,"onUpdate:modelValue":x[0]||(x[0]=ae=>y.value=ae)},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.components,(ae,ee)=>((0,s.openBlock)(),(0,s.createBlock)(L,{key:ee,title:ae.name,name:ee},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(ae.children,(ie,R)=>((0,s.openBlock)(),(0,s.createBlock)(P,{key:R,config:ie},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Uv,[(0,s.createVNode)(T,{class:"j-component-tool-icon",icon:ie.icon,size:14},null,8,["icon"]),(0,s.createElementVNode)("div",Xv,(0,s.toDisplayString)((0,s.unref)(n)(ie.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,s.createElementVNode)("div",qv,[(0,s.createElementVNode)("div",Kv,[x[2]||(x[2]=(0,s.createElementVNode)("div",null,null,-1)),(0,s.createElementVNode)("div",null,[(0,s.createVNode)(F,{content:(0,s.unref)(n)("清空")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(V,{danger:"",type:"text",onClick:C,icon:"mdi:delete-outline"})]),_:1},8,["content"]),(0,s.createVNode)(G,{direction:"vertical"}),(0,s.createVNode)(F,{content:(0,s.unref)(n)("预览")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(V,{type:"text",onClick:B,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),(0,s.createElementVNode)("div",Zv,[(0,s.createVNode)(U,{ref_key:"dragContainer",ref:f,class:"design-drag-container","is-component-container":!1,"component-data":r},{default:(0,s.withCtx)(()=>[!r.children||r.children.length===0?((0,s.openBlock)(),(0,s.createElementBlock)("div",Jv,[(0,s.createVNode)(X,{description:(0,s.unref)(n)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):((0,s.openBlock)(),(0,s.createBlock)(J,{key:1,"component-list":r.children,"global-config":r.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),(0,s.withDirectives)((0,s.createElementVNode)("div",Qv,[(0,s.createElementVNode)("div",ey,[(0,s.createElementVNode)("span",ty,(0,s.toDisplayString)(`${(0,s.unref)(n)("属性配置")}${I.value}`),1)]),(0,s.createElementVNode)("div",ny,[(0,s.createVNode)(Z,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:h,onChange:c},null,512)])],512),[[s.vShow,(0,s.unref)(p)&&d[(0,s.unref)(p).type]]]),(0,s.createVNode)(oe,{ref_key:"previewLayerRef",ref:D,"has-btns":!1,onOk:Y,onClosed:b},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(te,{ref_key:"previewRef",ref:O},null,512)]),_:1},512)])}}}),iy=oy,Gl=Mt(iy,[Fl]),ry=[ns,pi,gi,mi,vi,Za,Ja,rl,sl,Hl,Gl],sy=t=>{ry.forEach(e=>{t.component(e.name,e)})},ay={install:sy};Me.DDrag=ns,Me.DDraggable=sl,Me.DFlowDesign=Za,Me.DFormDesign=Hl,Me.DIndexDesign=Gl,Me.DInputFlow=Ja,Me.DLayout=rl,Me.default=ay,Me.dragContainer=gi,Me.dragFormList=mi,Me.dragIndexList=vi,Me.dragTool=pi});
|
|
26
|
+
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ie extends Error{constructor(e,...n){var o;super((o=Ra[e])==null?void 0:o.call(Ra,...n)),this.name="VueFlowError",this.code=e,this.args=n}}function ir(t){return"clientX"in t}function qp(t){return"sourceEvent"in t}function st(t,e){const n=ir(t);let o,i;return n?(o=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(o=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(o=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(o=0,i=0),{x:o-(e?.left??0),y:i-(e?.top??0)}}const Co=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Kp(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function Eo(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const Zp=()=>!0;function rr(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Jp(t,e,n){const o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const r of e.values())_o(i,bo(r))>0&&o.push(r);return o}const Qp=250;function eg(t,e,n,o){var i,r;let a=[],l=Number.POSITIVE_INFINITY;const u=Jp(t,n,e+Qp);for(const c of u){const d=[...((i=c.handleBounds)==null?void 0:i.source)??[],...((r=c.handleBounds)==null?void 0:r.target)??[]];for(const f of d){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:h,y:p}=Zt(c,f,f.position,!0),y=Math.sqrt((h-t.x)**2+(p-t.y)**2);y>e||(y<l?(a=[{...f,x:h,y:p}],l=y):y===l&&a.push({...f,x:h,y:p}))}}if(!a.length)return null;if(a.length>1){const c=o.type==="source"?"target":"source";return a.find(d=>d.type===c)??a[0]}return a[0]}function Ha(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:u,isValidConnection:c=Zp},d,f,h,p){const y=r==="target",m=e?a.querySelector(`.${l}-flow__handle[data-id="${u}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:b,y:T}=st(t),x=a.elementFromPoint(b,T),g=x?.classList.contains(`${l}-flow__handle`)?x:m,C={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const A=Va(void 0,g),z=g.getAttribute("data-nodeid"),j=g.getAttribute("data-handleid"),Y=g.classList.contains("connectable"),W=g.classList.contains("connectableend");if(!z||!A)return C;const D={source:y?z:o,sourceHandle:y?j:i,target:y?o:z,targetHandle:y?i:j};C.connection=D;const k=Y&&W&&(n===ht.Strict?y&&A==="source"||!y&&A==="target":z!==o||j!==i);C.isValid=k&&c(D,{nodes:f,edges:d,sourceNode:h(D.source),targetNode:h(D.target)}),C.toHandle=La(z,A,j,p,n,!0)}return C}function Va(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function tg(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function ng(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function La(t,e,n,o,i,r=!1){var a,l,u;const c=o.get(t);if(!c)return null;const d=i===ht.Strict?(a=c.handleBounds)==null?void 0:a[e]:[...((l=c.handleBounds)==null?void 0:l.source)??[],...((u=c.handleBounds)==null?void 0:u.target)??[]],f=(n?d?.find(h=>h.id===n):d?.[0])??null;return f&&r?{...f,...Zt(c,f,f.position,!0)}:f}const sr={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top},og=["production","prod"];function In(t,...e){Fa()&&console.warn(`[Vue Flow]: ${t}`,...e)}function Fa(){return!og.includes(process.env.NODE_ENV||"")}function ja(t,e,n,o,i){const r=e.querySelectorAll(`.vue-flow__handle.${t}`);return r?.length?Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...wo(a)}}):null}function ar(t,e,n,o,i,r=!1,a){i.value=!1,t.selected?(r||t.selected&&e)&&(o([t]),s.nextTick(()=>{a.blur()})):n([t])}function ke(t){return typeof s.unref(t)<"u"}function ig(t,e,n,o){if(!t||!t.source||!t.target)return n(new Ie(Ne.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let i;return _t(t)?i=t:i={...t,id:_a(t)},i=va(i,void 0,o),Op(i,e)?!1:i}function rg(t,e,n,o,i){if(!e.source||!e.target)return i(new Ie(Ne.EDGE_INVALID,t.id)),!1;if(!n)return i(new Ie(Ne.EDGE_NOT_FOUND,t.id)),!1;const{id:r,...a}=t;return{...a,id:o?_a(e):r,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function Ga(t,e,n){const o={},i=[];for(let r=0;r<t.length;++r){const a=t[r];if(!At(a)){n(new Ie(Ne.NODE_INVALID,a?.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const l=zp(a,e(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=l}for(const r of i){const a=e(r.parentNode)||i.find(l=>l.id===r.parentNode);r.parentNode&&!a&&n(new Ie(Ne.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Wa(t,e,n,o,i,r){let a=i;const l=o.get(a)||new Map;o.set(a,l.set(n,e)),a=`${i}-${t}`;const u=o.get(a)||new Map;if(o.set(a,u.set(n,e)),r){a=`${i}-${t}-${r}`;const c=o.get(a)||new Map;o.set(a,c.set(n,e))}}function lr(t,e,n){t.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=o,u={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:l},c=`${i}-${a}--${r}-${l}`,d=`${r}-${l}--${i}-${a}`;Wa("source",u,d,t,i,a),Wa("target",u,c,t,r,l)}}function Ya(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function cr(t,e,n,o,i,r,a,l){const u=[];for(const c of t){const d=_t(c)?c:ig(c,l,i,r);if(!d)continue;const f=n(d.source),h=n(d.target);if(!f||!h){i(new Ie(Ne.EDGE_SOURCE_TARGET_MISSING,d.id,d.source,d.target));continue}if(!f){i(new Ie(Ne.EDGE_SOURCE_MISSING,d.id,d.source));continue}if(!h){i(new Ie(Ne.EDGE_TARGET_MISSING,d.id,d.target));continue}if(e&&!e(d,{edges:l,nodes:a,sourceNode:f,targetNode:h})){i(new Ie(Ne.EDGE_INVALID,d.id));continue}const p=o(d.id);u.push({...va(d,p,r),sourceNode:f,targetNode:h})}return u}const Ua=Symbol("vueFlow"),Xa=Symbol("nodeId"),qa=Symbol("nodeRef"),sg=Symbol("edgeId"),ag=Symbol("edgeRef"),So=Symbol("slots");function Ka(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:a,nodeDragThreshold:l,viewport:u,autoPanOnNodeDrag:c,autoPanSpeed:d,nodesDraggable:f,panBy:h,findNode:p,multiSelectionActive:y,nodesSelectionActive:m,selectNodesOnDrag:b,removeSelectedElements:T,addSelectedNodes:x,updateNodePositions:g,emits:C}=_e(),{onStart:A,onDrag:z,onStop:j,onClick:Y,el:W,disabled:D,id:B,selectable:k,dragHandle:V}=t,_=s.shallowRef(!1);let M=[],v,S=null,I={x:void 0,y:void 0},P={x:0,y:0},H=null,$=!1,O=!1,F=0,G=!1;const X=dg(),Z=({x:ee,y:K})=>{I={x:ee,y:K};let E=!1;if(M=M.map(w=>{const N={x:ee-w.distance.x,y:K-w.distance.y},{computedPosition:L}=or(w,n.value?Eo(N,o.value):N,C.error,a.value,w.parentNode?p(w.parentNode):void 0);return E=E||w.position.x!==L.x||w.position.y!==L.y,w.position=L,w}),O=O||E,!!E&&(g(M,!0,!0),_.value=!0,H)){const[w,N]=nr({id:B,dragItems:M,findNode:p});z({event:H,node:w,nodes:N})}},U=()=>{if(!S)return;const[ee,K]=Ta(P,S,d.value);if(ee!==0||K!==0){const E={x:(I.x??0)-ee/u.value.zoom,y:(I.y??0)-K/u.value.zoom};h({x:ee,y:K})&&Z(E)}F=requestAnimationFrame(U)},J=(ee,K)=>{$=!0;const E=p(B);!b.value&&!y.value&&E&&(E.selected||T()),E&&s.toValue(k)&&b.value&&ar(E,y.value,x,T,m,!1,K);const w=X(ee.sourceEvent);if(I=w,M=jp(r.value,f.value,w,B),M.length){const[N,L]=nr({id:B,dragItems:M,findNode:p});A({event:ee.sourceEvent,node:N,nodes:L})}},te=(ee,K)=>{var E;ee.sourceEvent.type==="touchmove"&&ee.sourceEvent.touches.length>1||(O=!1,l.value===0&&J(ee,K),I=X(ee.sourceEvent),S=((E=e.value)==null?void 0:E.getBoundingClientRect())||null,P=st(ee.sourceEvent,S))},Q=(ee,K)=>{const E=X(ee.sourceEvent);if(!G&&$&&c.value&&(G=!0,U()),!$){const w=E.xSnapped-(I.x??0),N=E.ySnapped-(I.y??0);Math.sqrt(w*w+N*N)>l.value&&J(ee,K)}(I.x!==E.xSnapped||I.y!==E.ySnapped)&&M.length&&$&&(H=ee.sourceEvent,P=st(ee.sourceEvent,S),Z(E))},le=ee=>{let K=!1;if(!$&&!_.value&&!y.value){const E=ee.sourceEvent,w=X(E),N=w.xSnapped-(I.x??0),L=w.ySnapped-(I.y??0),R=Math.sqrt(N*N+L*L);R!==0&&R<=l.value&&(Y?.(E),K=!0)}if(M.length&&!K){O&&(g(M,!1,!1),O=!1);const[E,w]=nr({id:B,dragItems:M,findNode:p});j({event:ee.sourceEvent,node:E,nodes:w})}M=[],_.value=!1,G=!1,$=!1,I={x:void 0,y:void 0},cancelAnimationFrame(F)};return s.watch([()=>s.toValue(D),W],([ee,K],E,w)=>{if(K){const N=Ke(K);ee||(v=$f().on("start",L=>te(L,K)).on("drag",L=>Q(L,K)).on("end",L=>le(L)).filter(L=>{const R=L.target,oe=s.toValue(V);return!L.button&&(!i.value||!Aa(R,`.${i.value}`,K)&&(!oe||Aa(R,oe,K)))}),N.call(v)),w(()=>{N.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),_}function lg(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),updateStart:ae(),update:ae(),updateEnd:ae()}}function cg(t,e){const n=lg();return n.doubleClick.on(o=>{var i,r;e.edgeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.edgeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.edgeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.edgeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.edgeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.edgeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;e.edgeUpdateStart(o),(r=(i=t.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;e.edgeUpdate(o),(r=(i=t.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;e.edgeUpdateEnd(o),(r=(i=t.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function dg(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:o}=_e();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},l=qp(i)?i.sourceEvent:i,{x:u,y:c}=st(l,a),d=Dn({x:u,y:c},t.value),{x:f,y:h}=n.value?Eo(d,e.value):d;return{xSnapped:f,ySnapped:h,...d}}}function No(){return!0}function Za({handleId:t,nodeId:e,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:u,connectionMode:c,connectionRadius:d,connectOnClick:f,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:y,autoPanSpeed:m,findNode:b,panBy:T,startConnection:x,updateConnection:g,endConnection:C,emits:A,viewport:z,edges:j,nodes:Y,isValidConnection:W,nodeLookup:D}=_e();let B=null,k=!1,V=null;function _(v){var S;const I=s.toValue(n)==="target",P=ir(v),H=ya(v.target),$=v.currentTarget;if($&&(P&&v.button===0||!P)){let O=function(re){E=st(re,le),Z=eg(Dn(E,z.value,!1,[1,1]),d.value,D.value,L),w||(N(),w=!0);const de=Ha(re,{handle:Z,connectionMode:c.value,fromNodeId:s.toValue(e),fromHandleId:s.toValue(t),fromType:I?"target":"source",isValidConnection:X,doc:H,lib:"vue",flowId:l,nodeLookup:D.value},j.value,Y.value,b,D.value);V=de.handleDomNode,B=de.connection,k=ng(!!Z,de.isValid);const ce={...se,isValid:k,to:de.toHandle&&k?kn({x:de.toHandle.x,y:de.toHandle.y},z.value):E,toHandle:de.toHandle,toPosition:k&&de.toHandle?de.toHandle.position:sr[L.position],toNode:de.toHandle?D.value.get(de.toHandle.nodeId):null};if(k&&Z&&se?.toHandle&&ce.toHandle&&se.toHandle.type===ce.toHandle.type&&se.toHandle.nodeId===ce.toHandle.nodeId&&se.toHandle.id===ce.toHandle.id&&se.to.x===ce.to.x&&se.to.y===ce.to.y)return;const ve=Z??de.toHandle;if(g(ve&&k?kn({x:ve.x,y:ve.y},z.value):E,ve,tg(!!ve,k)),se=ce,!Z&&!k&&!V)return rr(K);B&&B.source!==B.target&&V&&(rr(K),K=V,V.classList.add("connecting","vue-flow__handle-connecting"),V.classList.toggle("valid",!!k),V.classList.toggle("vue-flow__handle-valid",!!k))},F=function(re){"touches"in re&&re.touches.length>0||((Z||V)&&B&&k&&(r?r(re,B):A.connect(B)),A.connectEnd(re),i&&a?.(re),rr(K),cancelAnimationFrame(U),C(re),w=!1,k=!1,B=null,V=null,H.removeEventListener("mousemove",O),H.removeEventListener("mouseup",F),H.removeEventListener("touchmove",O),H.removeEventListener("touchend",F))};const G=b(s.toValue(e));let X=s.toValue(o)||W.value||No;!X&&G&&(X=(I?G.isValidSourcePos:G.isValidTargetPos)||No);let Z,U=0;const{x:J,y:te}=st(v),Q=Va(s.toValue(i),$),le=(S=u.value)==null?void 0:S.getBoundingClientRect();if(!le||!Q)return;const ee=La(s.toValue(e),Q,s.toValue(t),D.value,c.value);if(!ee)return;let K,E=st(v,le),w=!1;const N=()=>{if(!y.value)return;const[re,de]=Ta(E,le,m.value);T({x:re,y:de}),U=requestAnimationFrame(N)},L={...ee,nodeId:s.toValue(e),type:Q,position:ee.position},R=D.value.get(s.toValue(e)),ne={inProgress:!0,isValid:null,from:Zt(R,L,ue.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:R,to:E,toHandle:null,toPosition:sr[L.position],toNode:null};x({nodeId:s.toValue(e),id:s.toValue(t),type:Q,position:$?.getAttribute("data-handlepos")||ue.Top,...E},{x:J-le.left,y:te-le.top}),A.connectStart({event:v,nodeId:s.toValue(e),handleId:s.toValue(t),handleType:Q});let se=ne;H.addEventListener("mousemove",O),H.addEventListener("mouseup",F),H.addEventListener("touchmove",O),H.addEventListener("touchend",F)}}function M(v){var S,I;if(!f.value)return;const P=s.toValue(n)==="target";if(!h.value){A.clickConnectStart({event:v,nodeId:s.toValue(e),handleId:s.toValue(t)}),x({nodeId:s.toValue(e),type:s.toValue(n),id:s.toValue(t),position:ue.Top,...st(v)},void 0,!0);return}let H=s.toValue(o)||W.value||No;const $=b(s.toValue(e));if(!H&&$&&(H=(P?$.isValidSourcePos:$.isValidTargetPos)||No),$&&(typeof $.connectable>"u"?p.value:$.connectable)===!1)return;const O=ya(v.target),F=Ha(v,{handle:{nodeId:s.toValue(e),id:s.toValue(t),type:s.toValue(n),position:ue.Top,...st(v)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:H,doc:O,lib:"vue",flowId:l,nodeLookup:D.value},j.value,Y.value,b,D.value),G=((S=F.connection)==null?void 0:S.source)===((I=F.connection)==null?void 0:I.target);F.isValid&&F.connection&&!G&&A.connect(F.connection),A.clickConnectEnd(v),C(v,!0)}return{handlePointerDown:_,handleClick:M}}function ug(){return s.inject(Xa,"")}function Ja(t){const e=t??ug()??"",n=s.inject(qa,s.ref(null)),{findNode:o,edges:i,emits:r}=_e(),a=o(e);return a||r.error(new Ie(Ne.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:a,parentNode:s.computed(()=>o(a.parentNode)),connectedEdges:s.computed(()=>Ea([a],i.value))}}function fg(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),dragStart:ae(),drag:ae(),dragStop:ae()}}function hg(t,e){const n=fg();return n.doubleClick.on(o=>{var i,r;e.nodeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.nodeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.nodeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.nodeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.nodeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.nodeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;e.nodeDragStart(o),(r=(i=t.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;e.nodeDrag(o),(r=(i=t.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;e.nodeDragStop(o),(r=(i=t.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Qa(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:l}=_e();return(u,c=!1)=>{const d=r.value?i.value[0]:5,f=r.value?i.value[1]:5,h=c?4:1,p=u.x*d*h,y=u.y*f*h,m=[];for(const b of t.value)if(b.draggable||a&&typeof b.draggable>"u"){const T={x:b.computedPosition.x+p,y:b.computedPosition.y+y},{position:x}=or(b,T,l.error,e.value,b.parentNode?o(b.parentNode):void 0);m.push({id:b.id,position:x,from:b.position,distance:{x:u.x,y:u.y},dimensions:b.dimensions})}n(m,!0,!1)}}const ko=.1,pg=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function Ct(){return In("Viewport not initialized yet."),Promise.resolve(!1)}const gg={zoomIn:Ct,zoomOut:Ct,zoomTo:Ct,fitView:Ct,setCenter:Ct,fitBounds:Ct,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:Ct,setTransform:Ct,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function mg(t){function e(o,i){return new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?vn:lo).scaleBy(dr(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(l=>{var u;const{x:c,y:d}=ma({x:-o,y:-i},t.translateExtent),f=Xt.translate(-c,-d).scale(r);t.d3Selection&&t.d3Zoom?(u=t.d3Zoom)==null||u.interpolate(a?.interpolate==="linear"?vn:lo).transform(dr(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),f):l(!1)})}return s.computed(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:i=>e(1.2,i),zoomOut:i=>e(1/1.2,i),zoomTo:(i,r)=>new Promise(a=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(r?.interpolate==="linear"?vn:lo).scaleTo(dr(t.d3Selection,r?.duration,r?.ease,()=>{a(!0)}),i):a(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(i={padding:ko,includeHiddenNodes:!1,duration:0})=>{var r,a;const l=[];for(const h of t.nodes)h.dimensions.width&&h.dimensions.height&&(i?.includeHiddenNodes||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(h.id))&&l.push(h);if(!l.length)return Promise.resolve(!1);const u=xa(l),{x:c,y:d,zoom:f}=Sa(u,t.dimensions.width,t.dimensions.height,i.minZoom??t.minZoom,i.maxZoom??t.maxZoom,i.padding??ko);return n(c,d,f,i)},setCenter:(i,r,a)=>{const l=typeof a?.zoom<"u"?a.zoom:t.maxZoom,u=t.dimensions.width/2-i*l,c=t.dimensions.height/2-r*l;return n(u,c,l,a)},fitBounds:(i,r={padding:ko})=>{const{x:a,y:l,zoom:u}=Sa(i,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,r.padding??ko);return n(a,l,u,r)},project:i=>Dn(i,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:i=>{if(t.vueFlowRef){const{x:r,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:i.x-r,y:i.y-a};return Dn(l,t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(t.vueFlowRef){const{x:r,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:i.x+r,y:i.y+a};return kn(l,t.viewport)}return{x:0,y:0}}}:gg)}function dr(t,e=0,n=pg,o=()=>{}){const i=typeof e=="number"&&e>0;return i||o(),i?t.transition().duration(e).ease(n).on("end",o):t}function yg(t,e,n){const o=s.effectScope(!0);return o.run(()=>{const i=()=>{o.run(()=>{let m,b,T=!!(n.nodes.value.length||n.edges.value.length);m=jt([t.modelValue,()=>{var x,g;return(g=(x=t.modelValue)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(b?.pause(),n.setElements(x),!b&&!T&&x.length?T=!0:b?.resume())}),b=jt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([x,g])=>{var C;(C=t.modelValue)!=null&&C.value&&Array.isArray(t.modelValue.value)&&(m?.pause(),t.modelValue.value=[...x,...g],s.nextTick(()=>{m?.resume()}))},{immediate:T}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},r=()=>{o.run(()=>{let m,b,T=!!n.nodes.value.length;m=jt([t.nodes,()=>{var x,g;return(g=(x=t.nodes)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(b?.pause(),n.setNodes(x),!b&&!T&&x.length?T=!0:b?.resume())}),b=jt([n.nodes,()=>n.nodes.value.length],([x])=>{var g;(g=t.nodes)!=null&&g.value&&Array.isArray(t.nodes.value)&&(m?.pause(),t.nodes.value=[...x],s.nextTick(()=>{m?.resume()}))},{immediate:T}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},a=()=>{o.run(()=>{let m,b,T=!!n.edges.value.length;m=jt([t.edges,()=>{var x,g;return(g=(x=t.edges)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(b?.pause(),n.setEdges(x),!b&&!T&&x.length?T=!0:b?.resume())}),b=jt([n.edges,()=>n.edges.value.length],([x])=>{var g;(g=t.edges)!=null&&g.value&&Array.isArray(t.edges.value)&&(m?.pause(),t.edges.value=[...x],s.nextTick(()=>{m?.resume()}))},{immediate:T}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},l=()=>{o.run(()=>{s.watch(()=>e.maxZoom,()=>{e.maxZoom&&ke(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},u=()=>{o.run(()=>{s.watch(()=>e.minZoom,()=>{e.minZoom&&ke(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{s.watch(()=>e.translateExtent,()=>{e.translateExtent&&ke(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},d=()=>{o.run(()=>{s.watch(()=>e.nodeExtent,()=>{e.nodeExtent&&ke(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{s.watch(()=>e.applyDefault,()=>{ke(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const m=async b=>{let T=b;typeof e.autoConnect=="function"&&(T=await e.autoConnect(b)),T!==!1&&n.addEdges([T])};s.watch(()=>e.autoConnect,()=>{ke(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),s.watch(n.autoConnect,(b,T,x)=>{b?n.onConnect(m):n.hooks.value.connect.off(m),x(()=>{n.hooks.value.connect.off(m)})},{immediate:!0})})},p=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(e)){const T=b;if(!m.includes(T)){const x=s.toRef(()=>e[T]),g=n[T];s.isRef(g)&&o.run(()=>{s.watch(x,C=>{ke(C)&&(g.value=C)},{immediate:!0})})}}};i(),r(),a(),u(),l(),c(),d(),f(),h(),p()}),()=>o.stop()}function vg(){return{edgesChange:ae(),nodesChange:ae(),nodeDoubleClick:ae(),nodeClick:ae(),nodeMouseEnter:ae(),nodeMouseMove:ae(),nodeMouseLeave:ae(),nodeContextMenu:ae(),nodeDragStart:ae(),nodeDrag:ae(),nodeDragStop:ae(),nodesInitialized:ae(),miniMapNodeClick:ae(),miniMapNodeDoubleClick:ae(),miniMapNodeMouseEnter:ae(),miniMapNodeMouseMove:ae(),miniMapNodeMouseLeave:ae(),connect:ae(),connectStart:ae(),connectEnd:ae(),clickConnectStart:ae(),clickConnectEnd:ae(),paneReady:ae(),init:ae(),move:ae(),moveStart:ae(),moveEnd:ae(),selectionDragStart:ae(),selectionDrag:ae(),selectionDragStop:ae(),selectionContextMenu:ae(),selectionStart:ae(),selectionEnd:ae(),viewportChangeStart:ae(),viewportChange:ae(),viewportChangeEnd:ae(),paneScroll:ae(),paneClick:ae(),paneContextMenu:ae(),paneMouseEnter:ae(),paneMouseMove:ae(),paneMouseLeave:ae(),edgeContextMenu:ae(),edgeMouseEnter:ae(),edgeMouseMove:ae(),edgeMouseLeave:ae(),edgeDoubleClick:ae(),edgeClick:ae(),edgeUpdateStart:ae(),edgeUpdate:ae(),edgeUpdateEnd:ae(),updateNodeInternals:ae(),error:ae(t=>In(t.message))}}function bg(t,e){const n=s.getCurrentInstance();s.onBeforeMount(()=>{for(const[i,r]of Object.entries(e.value)){const a=l=>{t(i,l)};r.setEmitter(a),fn(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),fn(r.removeHasEmitListeners)}});function o(i){var r;const a=_g(i);return!!((r=n?.vnode.props)==null?void 0:r[a])}}function _g(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function el(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Qi.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:En.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:$t.Bezier,style:{}},connectionMode:ht.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:Co()?"Meta":"Control",zoomActivationKeyCode:Co()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:vg(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const wg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function xg(t,e,n){const o=mg(t),i=E=>{const w=E??[];t.hooks.updateNodeInternals.trigger(w)},r=E=>Pp(E,t.nodes,t.edges),a=E=>Ap(E,t.nodes,t.edges),l=E=>Ea(E,t.edges),u=({id:E,type:w,nodeId:N})=>{var L;const R=E?`-${w}-${E}`:`-${w}`;return Array.from(((L=t.connectionLookup.get(`${N}${R}`))==null?void 0:L.values())??[])},c=E=>{if(E)return e.value.get(E)},d=E=>{if(E)return n.value.get(E)},f=(E,w,N)=>{var L,R;const oe=[];for(const ne of E){const se={id:ne.id,type:"position",dragging:N,from:ne.from};if(w&&(se.position=ne.position,ne.parentNode)){const re=c(ne.parentNode);se.position={x:se.position.x-(((L=re?.computedPosition)==null?void 0:L.x)??0),y:se.position.y-(((R=re?.computedPosition)==null?void 0:R.y)??0)}}oe.push(se)}oe?.length&&t.hooks.nodesChange.trigger(oe)},h=E=>{if(!t.vueFlowRef)return;const w=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!w)return;const N=window.getComputedStyle(w),{m22:L}=new window.DOMMatrixReadOnly(N.transform),R=[];for(const oe of E){const ne=oe,se=c(ne.id);if(se){const re=wo(ne.nodeElement);if(!!(re.width&&re.height&&(se.dimensions.width!==re.width||se.dimensions.height!==re.height||ne.forceUpdate))){const ce=ne.nodeElement.getBoundingClientRect();se.dimensions=re,se.handleBounds.source=ja("source",ne.nodeElement,ce,L,se.id),se.handleBounds.target=ja("target",ne.nodeElement,ce,L,se.id),R.push({id:se.id,type:"dimensions",dimensions:re})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&o.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),R.length&&t.hooks.nodesChange.trigger(R)},p=(E,w)=>{const N=new Set,L=new Set;for(const ne of E)At(ne)?N.add(ne.id):_t(ne)&&L.add(ne.id);const R=xt(e.value,N,!0),oe=xt(n.value,L);if(t.multiSelectionActive){for(const ne of N)R.push(wt(ne,w));for(const ne of L)oe.push(wt(ne,w))}R.length&&t.hooks.nodesChange.trigger(R),oe.length&&t.hooks.edgesChange.trigger(oe)},y=E=>{if(t.multiSelectionActive){const w=E.map(N=>wt(N.id,!0));t.hooks.nodesChange.trigger(w);return}t.hooks.nodesChange.trigger(xt(e.value,new Set(E.map(w=>w.id)),!0)),t.hooks.edgesChange.trigger(xt(n.value))},m=E=>{if(t.multiSelectionActive){const w=E.map(N=>wt(N.id,!0));t.hooks.edgesChange.trigger(w);return}t.hooks.edgesChange.trigger(xt(n.value,new Set(E.map(w=>w.id)))),t.hooks.nodesChange.trigger(xt(e.value,new Set,!0))},b=E=>{p(E,!0)},T=E=>{const N=(E||t.nodes).map(L=>(L.selected=!1,wt(L.id,!1)));t.hooks.nodesChange.trigger(N)},x=E=>{const N=(E||t.edges).map(L=>(L.selected=!1,wt(L.id,!1)));t.hooks.edgesChange.trigger(N)},g=E=>{if(!E||!E.length)return p([],!1);const w=E.reduce((N,L)=>{const R=wt(L.id,!1);return At(L)?N.nodes.push(R):N.edges.push(R),N},{nodes:[],edges:[]});w.nodes.length&&t.hooks.nodesChange.trigger(w.nodes),w.edges.length&&t.hooks.edgesChange.trigger(w.edges)},C=E=>{var w;(w=t.d3Zoom)==null||w.scaleExtent([E,t.maxZoom]),t.minZoom=E},A=E=>{var w;(w=t.d3Zoom)==null||w.scaleExtent([t.minZoom,E]),t.maxZoom=E},z=E=>{var w;(w=t.d3Zoom)==null||w.translateExtent(E),t.translateExtent=E},j=E=>{t.nodeExtent=E,i()},Y=E=>{var w;(w=t.d3Zoom)==null||w.clickDistance(E)},W=E=>{t.nodesDraggable=E,t.nodesConnectable=E,t.elementsSelectable=E},D=E=>{const w=E instanceof Function?E(t.nodes):E;!t.initialized&&!w.length||(t.nodes=Ga(w,c,t.hooks.error.trigger))},B=E=>{const w=E instanceof Function?E(t.edges):E;if(!t.initialized&&!w.length)return;const N=cr(w,t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);lr(t.connectionLookup,n.value,N),t.edges=N},k=E=>{const w=E instanceof Function?E([...t.nodes,...t.edges]):E;!t.initialized&&!w.length||(D(w.filter(At)),B(w.filter(_t)))},V=E=>{let w=E instanceof Function?E(t.nodes):E;w=Array.isArray(w)?w:[w];const N=Ga(w,c,t.hooks.error.trigger),L=[];for(const R of N)L.push(Ma(R));L.length&&t.hooks.nodesChange.trigger(L)},_=E=>{let w=E instanceof Function?E(t.edges):E;w=Array.isArray(w)?w:[w];const N=cr(w,t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),L=[];for(const R of N)L.push(Ma(R));L.length&&t.hooks.edgesChange.trigger(L)},M=(E,w=!0,N=!1)=>{const L=E instanceof Function?E(t.nodes):E,R=Array.isArray(L)?L:[L],oe=[],ne=[];function se(de){const ce=l(de);for(const ve of ce)(!ke(ve.deletable)||ve.deletable)&&ne.push($a(ve.id,ve.source,ve.target,ve.sourceHandle,ve.targetHandle))}function re(de){const ce=[];for(const ve of t.nodes)ve.parentNode===de&&ce.push(ve);if(ce.length){for(const ve of ce)oe.push(Ba(ve.id));w&&se(ce);for(const ve of ce)re(ve.id)}}for(const de of R){const ce=typeof de=="string"?c(de):de;ce&&(ke(ce.deletable)&&!ce.deletable||(oe.push(Ba(ce.id)),w&&se([ce]),N&&re(ce.id)))}ne.length&&t.hooks.edgesChange.trigger(ne),oe.length&&t.hooks.nodesChange.trigger(oe)},v=E=>{const w=E instanceof Function?E(t.edges):E,N=Array.isArray(w)?w:[w],L=[];for(const R of N){const oe=typeof R=="string"?d(R):R;oe&&(ke(oe.deletable)&&!oe.deletable||L.push($a(typeof R=="string"?R:R.id,oe.source,oe.target,oe.sourceHandle,oe.targetHandle)))}t.hooks.edgesChange.trigger(L)},S=(E,w,N=!0)=>{const L=d(E.id);if(!L)return!1;const R=t.edges.indexOf(L),oe=rg(E,w,L,N,t.hooks.error.trigger);if(oe){const[ne]=cr([oe],t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((se,re)=>re===R?ne:se),lr(t.connectionLookup,n.value,[ne]),ne}return!1},I=(E,w,N={replace:!1})=>{const L=d(E);if(!L)return;const R=typeof w=="function"?w(L):w;L.data=N.replace?R:{...L.data,...R}},P=E=>Ia(E,t.nodes),H=E=>{const w=Ia(E,t.edges);return lr(t.connectionLookup,n.value,w),w},$=(E,w,N={replace:!1})=>{const L=c(E);if(!L)return;const R=typeof w=="function"?w(L):w;N.replace?t.nodes.splice(t.nodes.indexOf(L),1,R):Object.assign(L,R)},O=(E,w,N={replace:!1})=>{const L=c(E);if(!L)return;const R=typeof w=="function"?w(L):w;L.data=N.replace?R:{...L.data,...R}},F=(E,w,N=!1)=>{N?t.connectionClickStartHandle=E:t.connectionStartHandle=E,t.connectionEndHandle=null,t.connectionStatus=null,w&&(t.connectionPosition=w)},G=(E,w=null,N=null)=>{t.connectionStartHandle&&(t.connectionPosition=E,t.connectionEndHandle=w,t.connectionStatus=N)},X=(E,w)=>{t.connectionPosition={x:Number.NaN,y:Number.NaN},t.connectionEndHandle=null,t.connectionStatus=null,w?t.connectionClickStartHandle=null:t.connectionStartHandle=null},Z=E=>{const w=$p(E),N=w?null:Nn(E)?E:c(E.id);return!w&&!N?[null,null,w]:[w?E:bo(N),N,w]},U=(E,w=!0,N=t.nodes)=>{const[L,R,oe]=Z(E);if(!L)return[];const ne=[];for(const se of N||t.nodes){if(!oe&&(se.id===R.id||!se.computedPosition))continue;const re=bo(se),de=_o(re,L);(w&&de>0||de>=re.width*re.height||de>=Number(L.width)*Number(L.height))&&ne.push(se)}return ne},J=(E,w,N=!0)=>{const[L]=Z(E);if(!L)return!1;const R=_o(L,w);return N&&R>0||R>=Number(L.width)*Number(L.height)},te=E=>{const{viewport:w,dimensions:N,d3Zoom:L,d3Selection:R,translateExtent:oe}=t;if(!L||!R||!E.x&&!E.y)return!1;const ne=Xt.translate(w.x+E.x,w.y+E.y).scale(w.zoom),se=[[0,0],[N.width,N.height]],re=L.constrain()(ne,se,oe),de=t.viewport.x!==re.x||t.viewport.y!==re.y||t.viewport.zoom!==re.k;return L.transform(R,re),de},Q=E=>{const w=E instanceof Function?E(t):E,N=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];ke(w.defaultEdgeOptions)&&(t.defaultEdgeOptions=w.defaultEdgeOptions);const L=w.modelValue||w.nodes||w.edges?[]:void 0;L&&(w.modelValue&&L.push(...w.modelValue),w.nodes&&L.push(...w.nodes),w.edges&&L.push(...w.edges),k(L));const R=()=>{ke(w.maxZoom)&&A(w.maxZoom),ke(w.minZoom)&&C(w.minZoom),ke(w.translateExtent)&&z(w.translateExtent)};for(const oe of Object.keys(w)){const ne=oe,se=w[ne];![...wg,...N].includes(ne)&&ke(se)&&(t[ne]=se)}Bi(()=>t.d3Zoom).not.toBeNull().then(R),t.initialized||(t.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:h,setElements:k,setNodes:D,setEdges:B,addNodes:V,addEdges:_,removeNodes:M,removeEdges:v,findNode:c,findEdge:d,updateEdge:S,updateEdgeData:I,updateNode:$,updateNodeData:O,applyEdgeChanges:H,applyNodeChanges:P,addSelectedElements:b,addSelectedNodes:y,addSelectedEdges:m,setMinZoom:C,setMaxZoom:A,setTranslateExtent:z,setNodeExtent:j,setPaneClickDistance:Y,removeSelectedElements:g,removeSelectedNodes:T,removeSelectedEdges:x,startConnection:F,updateConnection:G,endConnection:X,setInteractive:W,setState:Q,getIntersectingNodes:U,getIncomers:r,getOutgoers:a,getConnectedEdges:l,getHandleConnections:u,isNodeIntersecting:J,panBy:te,fitView:E=>o.value.fitView(E),zoomIn:E=>o.value.zoomIn(E),zoomOut:E=>o.value.zoomOut(E),zoomTo:(E,w)=>o.value.zoomTo(E,w),setViewport:(E,w)=>o.value.setViewport(E,w),setTransform:(E,w)=>o.value.setTransform(E,w),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(E,w,N)=>o.value.setCenter(E,w,N),fitBounds:(E,w)=>o.value.fitBounds(E,w),project:E=>o.value.project(E),screenToFlowCoordinate:E=>o.value.screenToFlowCoordinate(E),flowToScreenCoordinate:E=>o.value.flowToScreenCoordinate(E),toObject:()=>{const E=[],w=[];for(const N of t.nodes){const{computedPosition:L,handleBounds:R,selected:oe,dimensions:ne,isParent:se,resizing:re,dragging:de,events:ce,...ve}=N;E.push(ve)}for(const N of t.edges){const{selected:L,sourceNode:R,targetNode:oe,events:ne,...se}=N;w.push(se)}return JSON.parse(JSON.stringify({nodes:E,edges:w,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:E=>new Promise(w=>{const{nodes:N,edges:L,position:R,zoom:oe,viewport:ne}=E;N&&D(N),L&&B(L);const[se,re]=ne?.x&&ne?.y?[ne.x,ne.y]:R??[null,null];if(se&&re){const de=ne?.zoom||oe||t.viewport.zoom;return Bi(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:se,y:re,zoom:de}).then(()=>{w(!0)})})}else w(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const E=el();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const w=Xt.translate(E.defaultViewport.x??0,E.defaultViewport.y??0).scale(zt(E.defaultViewport.zoom??1,E.minZoom,E.maxZoom)),N=t.viewportRef.getBoundingClientRect(),L=[[0,0],[N.width,N.height]],R=t.d3Zoom.constrain()(w,L,E.translateExtent);t.d3Zoom.transform(t.d3Selection,R)}Q(E)},$destroy:()=>{}}}const Cg=["data-id","data-handleid","data-nodeid","data-handlepos"],Eg={name:"Handle",compatConfig:{MODE:3}},Jt=s.defineComponent({...Eg,props:{id:{default:null},type:{},position:{default:()=>ue.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=s.createPropsRestProxy(t,["position","connectable","connectableStart","connectableEnd","id"]),o=s.toRef(()=>n.type??"source"),i=s.toRef(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:u,vueFlowRef:c,nodesConnectable:d,noDragClassName:f,noPanClassName:h}=_e(),{id:p,node:y,nodeEl:m,connectedEdges:b}=Ja(),T=s.ref(),x=s.toRef(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),g=s.toRef(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),C=s.toRef(()=>{var B,k,V,_,M,v;return((B=a.value)==null?void 0:B.nodeId)===p&&((k=a.value)==null?void 0:k.id)===t.id&&((V=a.value)==null?void 0:V.type)===o.value||((_=u.value)==null?void 0:_.nodeId)===p&&((M=u.value)==null?void 0:M.id)===t.id&&((v=u.value)==null?void 0:v.type)===o.value}),A=s.toRef(()=>{var B,k,V;return((B=l.value)==null?void 0:B.nodeId)===p&&((k=l.value)==null?void 0:k.id)===t.id&&((V=l.value)==null?void 0:V.type)===o.value}),{handlePointerDown:z,handleClick:j}=Za({nodeId:p,handleId:t.id,isValidConnection:i,type:o}),Y=s.computed(()=>typeof t.connectable=="string"&&t.connectable==="single"?!b.value.some(B=>{const k=B[`${o.value}Handle`];return B[o.value]!==p?!1:k?k===t.id:!0}):typeof t.connectable=="number"?b.value.filter(B=>{const k=B[`${o.value}Handle`];return B[o.value]!==p?!1:k?k===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(y,b.value):ke(t.connectable)?t.connectable:d.value);s.onMounted(()=>{var B;if(!y.dimensions.width||!y.dimensions.height)return;const k=(B=y.handleBounds[o.value])==null?void 0:B.find(P=>P.id===t.id);if(!c.value||k)return;const V=c.value.querySelector(".vue-flow__transformationpane");if(!m.value||!T.value||!V||!t.id)return;const _=m.value.getBoundingClientRect(),M=T.value.getBoundingClientRect(),v=window.getComputedStyle(V),{m22:S}=new window.DOMMatrixReadOnly(v.transform),I={id:t.id,position:t.position,x:(M.left-_.left)/S,y:(M.top-_.top)/S,type:o.value,nodeId:p,...wo(T.value)};y.handleBounds[o.value]=[...y.handleBounds[o.value]??[],I]});function W(B){const k=ir(B);Y.value&&x.value&&(k&&B.button===0||!k)&&z(B)}function D(B){!p||!l.value&&!x.value||Y.value&&j(B)}return e({handleClick:j,handlePointerDown:z,onClick:D,onPointerDown:W}),(B,k)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"handle",ref:T,"data-id":`${s.unref(r)}-${s.unref(p)}-${t.id}-${o.value}`,"data-handleid":t.id,"data-nodeid":s.unref(p),"data-handlepos":B.position,class:s.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${B.position}`,`vue-flow__handle-${t.id}`,s.unref(f),s.unref(h),o.value,{connectable:Y.value,connecting:A.value,connectablestart:x.value,connectableend:g.value,connectionindicator:Y.value&&(x.value&&!C.value||g.value&&C.value)}]]),onMousedown:W,onTouchstartPassive:W,onClick:D},[s.renderSlot(B.$slots,"default",{id:B.id})],42,Cg))}}),Do=function({sourcePosition:t=ue.Bottom,targetPosition:e=ue.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const l=a.label??n;return[s.h(Jt,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?s.h(l):s.h(s.Fragment,[l]),s.h(Jt,{type:"source",position:t,connectable:o,isValidConnection:r})]};Do.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Do.inheritAttrs=!1,Do.compatConfig={MODE:3};const Sg=Do,To=function({targetPosition:t=ue.Top,label:e,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??e;return[s.h(Jt,{type:"target",position:t,connectable:n,isValidConnection:o}),typeof r!="string"&&r?s.h(r):s.h(s.Fragment,[r])]};To.props=["targetPosition","label","isValidTargetPos","connectable","data"],To.inheritAttrs=!1,To.compatConfig={MODE:3};const Ng=To,Io=function({sourcePosition:t=ue.Bottom,label:e,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??e;return[typeof r!="string"&&r?s.h(r):s.h(s.Fragment,[r]),s.h(Jt,{type:"source",position:t,connectable:n,isValidConnection:o})]};Io.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Io.inheritAttrs=!1,Io.compatConfig={MODE:3};const kg=Io,Dg=["transform"],Tg=["width","height","x","y","rx","ry"],Ig=["y"],Mg={name:"EdgeText",compatConfig:{MODE:3}},Bg=s.defineComponent({...Mg,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=s.ref({x:0,y:0,width:0,height:0}),n=s.ref(null),o=s.computed(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);s.onMounted(i),s.watch([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==e.value.width||r.height!==e.value.height)&&(e.value=r)}return(r,a)=>(s.openBlock(),s.createElementBlock("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(s.openBlock(),s.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*r.labelBgPadding[0]}px`,height:`${e.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:s.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,Tg)):s.createCommentVNode("",!0),s.createElementVNode("text",s.mergeProps(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:r.labelStyle}),[s.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.label),{key:0})):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(r.label),1)],64))])],16,Ig)],8,Dg))}}),$g=["id","d","marker-end","marker-start"],zg=["d","stroke-width"],Ag={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mn=s.defineComponent({...Ag,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=s.ref(null),o=s.ref(null),i=s.ref(null),r=s.useAttrs();return e({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("path",s.mergeProps(s.unref(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,$g),a.interactionWidth?(s.openBlock(),s.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,zg)):s.createCommentVNode("",!0),a.label&&a.labelX&&a.labelY?(s.openBlock(),s.createBlock(Bg,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):s.createCommentVNode("",!0)],64))}});function tl({sourceX:t,sourceY:e,targetX:n,targetY:o}){const i=Math.abs(n-t)/2,r=n<t?n+i:n-i,a=Math.abs(o-e)/2,l=o<e?o+a:o-a;return[r,l,i,a]}function nl({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const u=t*.125+i*.375+a*.375+n*.125,c=e*.125+r*.375+l*.375+o*.125,d=Math.abs(u-t),f=Math.abs(c-e);return[u,c,d,f]}function Mo(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function ol({pos:t,x1:e,y1:n,x2:o,y2:i,c:r}){let a,l;switch(t){case ue.Left:a=e-Mo(e-o,r),l=n;break;case ue.Right:a=e+Mo(o-e,r),l=n;break;case ue.Top:a=e,l=n-Mo(n-i,r);break;case ue.Bottom:a=e,l=n+Mo(i-n,r);break}return[a,l]}function ur(t){const{sourceX:e,sourceY:n,sourcePosition:o=ue.Bottom,targetX:i,targetY:r,targetPosition:a=ue.Top,curvature:l=.25}=t,[u,c]=ol({pos:o,x1:e,y1:n,x2:i,y2:r,c:l}),[d,f]=ol({pos:a,x1:i,y1:r,x2:e,y2:n,c:l}),[h,p,y,m]=nl({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:u,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${e},${n} C${u},${c} ${d},${f} ${i},${r}`,h,p,y,m]}function il({pos:t,x1:e,y1:n,x2:o,y2:i}){let r,a;switch(t){case ue.Left:case ue.Right:r=.5*(e+o),a=n;break;case ue.Top:case ue.Bottom:r=e,a=.5*(n+i);break}return[r,a]}function rl(t){const{sourceX:e,sourceY:n,sourcePosition:o=ue.Bottom,targetX:i,targetY:r,targetPosition:a=ue.Top}=t,[l,u]=il({pos:o,x1:e,y1:n,x2:i,y2:r}),[c,d]=il({pos:a,x1:i,y1:r,x2:e,y2:n}),[f,h,p,y]=nl({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${n} C${l},${u} ${c},${d} ${i},${r}`,f,h,p,y]}const sl={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}};function Pg({source:t,sourcePosition:e=ue.Bottom,target:n}){return e===ue.Left||e===ue.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function al(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Og({source:t,sourcePosition:e=ue.Bottom,target:n,targetPosition:o=ue.Top,center:i,offset:r}){const a=sl[e],l=sl[o],u={x:t.x+a.x*r,y:t.y+a.y*r},c={x:n.x+l.x*r,y:n.y+l.y*r},d=Pg({source:u,sourcePosition:e,target:c}),f=d.x!==0?"x":"y",h=d[f];let p,y,m;const b={x:0,y:0},T={x:0,y:0},[x,g,C,A]=tl({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){y=i.x??x,m=i.y??g;const j=[{x:y,y:u.y},{x:y,y:c.y}],Y=[{x:u.x,y:m},{x:c.x,y:m}];a[f]===h?p=f==="x"?j:Y:p=f==="x"?Y:j}else{const j=[{x:u.x,y:c.y}],Y=[{x:c.x,y:u.y}];if(f==="x"?p=a.x===h?Y:j:p=a.y===h?j:Y,e===o){const V=Math.abs(t[f]-n[f]);if(V<=r){const _=Math.min(r-1,r-V);a[f]===h?b[f]=(u[f]>t[f]?-1:1)*_:T[f]=(c[f]>n[f]?-1:1)*_}}if(e!==o){const V=f==="x"?"y":"x",_=a[f]===l[V],M=u[V]>c[V],v=u[V]<c[V];(a[f]===1&&(!_&&M||_&&v)||a[f]!==1&&(!_&&v||_&&M))&&(p=f==="x"?j:Y)}const W={x:u.x+b.x,y:u.y+b.y},D={x:c.x+T.x,y:c.y+T.y},B=Math.max(Math.abs(W.x-p[0].x),Math.abs(D.x-p[0].x)),k=Math.max(Math.abs(W.y-p[0].y),Math.abs(D.y-p[0].y));B>=k?(y=(W.x+D.x)/2,m=p[0].y):(y=p[0].x,m=(W.y+D.y)/2)}return[[t,{x:u.x+b.x,y:u.y+b.y},...p,{x:c.x+T.x,y:c.y+T.y},n],y,m,C,A]}function Rg(t,e,n,o){const i=Math.min(al(t,e)/2,al(e,n)/2,o),{x:r,y:a}=e;if(t.x===r&&r===n.x||t.y===a&&a===n.y)return`L${r} ${a}`;if(t.y===a){const c=t.x<n.x?-1:1,d=t.y<n.y?1:-1;return`L ${r+i*c},${a}Q ${r},${a} ${r},${a+i*d}`}const l=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${r},${a+i*u}Q ${r},${a} ${r+i*l},${a}`}function fr(t){const{sourceX:e,sourceY:n,sourcePosition:o=ue.Bottom,targetX:i,targetY:r,targetPosition:a=ue.Top,borderRadius:l=5,centerX:u,centerY:c,offset:d=20}=t,[f,h,p,y,m]=Og({source:{x:e,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:u,y:c},offset:d});return[f.reduce((T,x,g)=>{let C;return g>0&&g<f.length-1?C=Rg(f[g-1],x,f[g+1],l):C=`${g===0?"M":"L"}${x.x} ${x.y}`,T+=C,T},""),h,p,y,m]}function Hg(t){const{sourceX:e,sourceY:n,targetX:o,targetY:i}=t,[r,a,l,u]=tl({sourceX:e,sourceY:n,targetX:o,targetY:i});return[`M ${e},${n}L ${o},${i}`,r,a,l,u]}const Vg=s.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Hg(t);return s.h(Mn,{path:n,labelX:o,labelY:i,...e,...t})}}}),ll=s.defineComponent({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=fr({...t,sourcePosition:t.sourcePosition??ue.Bottom,targetPosition:t.targetPosition??ue.Top});return s.h(Mn,{path:n,labelX:o,labelY:i,...e,...t})}}}),Lg=s.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>s.h(ll,{...t,...e,borderRadius:0})}}),Fg=s.defineComponent({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=ur({...t,sourcePosition:t.sourcePosition??ue.Bottom,targetPosition:t.targetPosition??ue.Top});return s.h(Mn,{path:n,labelX:o,labelY:i,...e,...t})}}}),jg=s.defineComponent({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=rl({...t,sourcePosition:t.sourcePosition??ue.Bottom,targetPosition:t.targetPosition??ue.Top});return s.h(Mn,{path:n,labelX:o,labelY:i,...e,...t})}}}),Gg={input:kg,default:Sg,output:Ng},Wg={default:Fg,straight:Vg,step:Lg,smoothstep:ll,simplebezier:jg};function Yg(t,e,n){const o=s.computed(()=>m=>e.value.get(m)),i=s.computed(()=>m=>n.value.get(m)),r=s.computed(()=>{const m={...Wg,...t.edgeTypes},b=Object.keys(m);for(const T of t.edges)T.type&&!b.includes(T.type)&&(m[T.type]=T.type);return m}),a=s.computed(()=>{const m={...Gg,...t.nodeTypes},b=Object.keys(m);for(const T of t.nodes)T.type&&!b.includes(T.type)&&(m[T.type]=T.type);return m}),l=s.computed(()=>t.onlyRenderVisibleElements?Ca(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),u=s.computed(()=>{if(t.onlyRenderVisibleElements){const m=[];for(const b of t.edges){const T=e.value.get(b.source),x=e.value.get(b.target);Up({sourcePos:T.computedPosition||{x:0,y:0},targetPos:x.computedPosition||{x:0,y:0},sourceWidth:T.dimensions.width,sourceHeight:T.dimensions.height,targetWidth:x.dimensions.width,targetHeight:x.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&m.push(b)}return m}return t.edges}),c=s.computed(()=>[...l.value,...u.value]),d=s.computed(()=>{const m=[];for(const b of t.nodes)b.selected&&m.push(b);return m}),f=s.computed(()=>{const m=[];for(const b of t.edges)b.selected&&m.push(b);return m}),h=s.computed(()=>[...d.value,...f.value]),p=s.computed(()=>{const m=[];for(const b of t.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&m.push(b);return m}),y=s.computed(()=>l.value.length>0&&p.value.length===l.value.length);return{getNode:o,getEdge:i,getElements:c,getEdgeTypes:r,getNodeTypes:a,getEdges:u,getNodes:l,getSelectedElements:h,getSelectedNodes:d,getSelectedEdges:f,getNodesInitialized:p,areNodesInitialized:y}}class Pt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=s.getCurrentInstance())==null?void 0:e.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??Pt.instance;return Pt.instance=o??new Pt,n&&(n.config.globalProperties.$vueFlowStorage=Pt.instance),Pt.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const o=el(),i=s.reactive(o),r={};for(const[h,p]of Object.entries(i.hooks)){const y=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[y]=p.on}const a={};for(const[h,p]of Object.entries(i.hooks))a[h]=p.trigger;const l=s.computed(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),u=s.computed(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),c=Yg(i,l,u),d=xg(i,l,u);d.setState({...i,...n});const f={...r,...c,...d,...Ld(i),nodeLookup:l,edgeLookup:u,emits:a,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,f),f}getId(){return`vue-flow-${this.currentId++}`}}function _e(t){const e=Pt.getInstance(),n=s.getCurrentScope(),o=typeof t=="object",i=o?t:{id:t},r=i.id,a=r??n?.vueFlowId;let l;if(n){const u=s.inject(Ua,null);typeof u<"u"&&u!==null&&(!a||u.id===a)&&(l=u)}if(l||a&&(l=e.get(a)),!l||a&&l.id!==a){const u=r??e.getId(),c=e.create(u,i);l=c,(n??s.effectScope(!0)).run(()=>{s.watch(c.applyDefault,(f,h,p)=>{const y=b=>{c.applyNodeChanges(b)},m=b=>{c.applyEdgeChanges(b)};f?(c.onNodesChange(y),c.onEdgesChange(m)):(c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(m)),p(()=>{c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(m)})},{immediate:!0}),fn(()=>{if(l){const f=e.get(l.id);f?f.$destroy():In(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&(s.provide(Ua,l),n.vueFlowId=l.id),o){const u=s.getCurrentInstance();u?.type.name!=="VueFlow"&&l.emits.error(new Ie(Ne.USEVUEFLOW_OPTIONS))}return l}function Ug(t){const{emits:e,dimensions:n}=_e();let o;s.onMounted(()=>{const i=()=>{var r,a;if(!t.value||!(((a=(r=t.value).checkVisibility)==null?void 0:a.call(r))??!0))return;const l=wo(t.value);(l.width===0||l.height===0)&&e.error(new Ie(Ne.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),t.value&&(o=new ResizeObserver(()=>i()),o.observe(t.value)),s.onBeforeUnmount(()=>{window.removeEventListener("resize",i),o&&t.value&&o.unobserve(t.value)})})}const Xg={name:"UserSelection",compatConfig:{MODE:3}},qg=s.defineComponent({...Xg,props:{userSelectionRect:{}},setup(t){return(e,n)=>(s.openBlock(),s.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:s.normalizeStyle({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Kg=["tabIndex"],Zg={name:"NodesSelection",compatConfig:{MODE:3}},Jg=s.defineComponent({...Zg,setup(t){const{emits:e,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=_e(),l=Qa(),u=s.ref(null),c=Ka({el:u,onStart(y){e.selectionDragStart(y),e.nodeDragStart(y)},onDrag(y){e.selectionDrag(y),e.nodeDrag(y)},onStop(y){e.selectionDragStop(y),e.nodeDragStop(y)}});s.onMounted(()=>{var y;r.value||(y=u.value)==null||y.focus({preventScroll:!0})});const d=s.computed(()=>xa(o.value)),f=s.computed(()=>({width:`${d.value.width}px`,height:`${d.value.height}px`,top:`${d.value.y}px`,left:`${d.value.x}px`}));function h(y){e.selectionContextMenu({event:y,nodes:o.value})}function p(y){r.value||qt[y.key]&&(y.preventDefault(),l({x:qt[y.key].x,y:qt[y.key].y},y.shiftKey))}return(y,m)=>!s.unref(a)&&d.value.width&&d.value.height?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["vue-flow__nodesselection vue-flow__container",s.unref(i)]),style:s.normalizeStyle({transform:`translate(${s.unref(n).x}px,${s.unref(n).y}px) scale(${s.unref(n).zoom})`})},[s.createElementVNode("div",{ref_key:"el",ref:u,class:s.normalizeClass([{dragging:s.unref(c)},"vue-flow__nodesselection-rect"]),style:s.normalizeStyle(f.value),tabIndex:s.unref(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,Kg)],6)):s.createCommentVNode("",!0)}});function Qg(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}const em={name:"Pane",compatConfig:{MODE:3}},tm=s.defineComponent({...em,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:u,nodesSelectionActive:c,getSelectedEdges:d,getSelectedNodes:f,removeNodes:h,removeEdges:p,selectionMode:y,deleteKeyCode:m,multiSelectionKeyCode:b,multiSelectionActive:T,edgeLookup:x,nodeLookup:g,connectionLookup:C,defaultEdgeOptions:A,connectionStartHandle:z,panOnDrag:j}=_e(),Y=s.shallowRef(null),W=s.shallowRef(new Set),D=s.shallowRef(new Set),B=s.shallowRef(null),k=s.toRef(()=>u.value&&(t.isSelecting||r.value)),V=s.toRef(()=>z.value!==null);let _=!1,M=!1;const v=Sn(m,{actInsideInputWithModifier:!1}),S=Sn(b);s.watch(v,X=>{X&&(h(f.value),p(d.value),c.value=!1)}),s.watch(S,X=>{T.value=X});function I(X,Z){return U=>{U.target===Z&&X?.(U)}}function P(X){if(_||V.value){_=!1;return}i.paneClick(X),a(),c.value=!1}function H(X){var Z;if(Array.isArray(j.value)&&((Z=j.value)!=null&&Z.includes(2))){X.preventDefault();return}i.paneContextMenu(X)}function $(X){i.paneScroll(X)}function O(X){var Z,U,J;if(B.value=((Z=e.value)==null?void 0:Z.getBoundingClientRect())??null,!u.value||!t.isSelecting||X.button!==0||X.target!==Y.value||!B.value)return;(J=(U=X.target)==null?void 0:U.setPointerCapture)==null||J.call(U,X.pointerId);const{x:te,y:Q}=Qg(X,B.value);M=!0,_=!1,a(),l.value={width:0,height:0,startX:te,startY:Q,x:te,y:Q},i.selectionStart(X)}function F(X){var Z;if(!B.value||!l.value)return;_=!0;const{x:U,y:J}=st(X,B.value),{startX:te=0,startY:Q=0}=l.value,le={startX:te,startY:Q,x:U<te?U:te,y:J<Q?J:Q,width:Math.abs(U-te),height:Math.abs(J-Q)},ee=W.value,K=D.value;W.value=new Set(Ca(n.value,le,o.value,y.value===Qi.Partial,!0).map(w=>w.id)),D.value=new Set;const E=((Z=A.value)==null?void 0:Z.selectable)??!0;for(const w of W.value){const N=C.value.get(w);if(N)for(const{edgeId:L}of N.values()){const R=x.value.get(L);R&&(R.selectable??E)&&D.value.add(L)}}if(!Ya(ee,W.value)){const w=xt(g.value,W.value,!0);i.nodesChange(w)}if(!Ya(K,D.value)){const w=xt(x.value,D.value);i.edgesChange(w)}l.value=le,r.value=!0,c.value=!1}function G(X){var Z;X.button!==0||!M||((Z=X.target)==null||Z.releasePointerCapture(X.pointerId),!r.value&&l.value&&X.target===Y.value&&P(X),r.value=!1,l.value=null,c.value=W.value.size>0,i.selectionEnd(X),t.selectionKeyPressed&&(_=!1),M=!1)}return(X,Z)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"container",ref:Y,class:s.normalizeClass(["vue-flow__pane vue-flow__container",{selection:X.isSelecting}]),onClick:Z[0]||(Z[0]=U=>k.value?void 0:I(P,Y.value)(U)),onContextmenu:Z[1]||(Z[1]=U=>I(H,Y.value)(U)),onWheelPassive:Z[2]||(Z[2]=U=>I($,Y.value)(U)),onPointerenter:Z[3]||(Z[3]=U=>k.value?void 0:s.unref(i).paneMouseEnter(U)),onPointerdown:Z[4]||(Z[4]=U=>k.value?O(U):s.unref(i).paneMouseMove(U)),onPointermove:Z[5]||(Z[5]=U=>k.value?F(U):s.unref(i).paneMouseMove(U)),onPointerup:Z[6]||(Z[6]=U=>k.value?G(U):void 0),onPointerleave:Z[7]||(Z[7]=U=>s.unref(i).paneMouseLeave(U))},[s.renderSlot(X.$slots,"default"),s.unref(r)&&s.unref(l)?(s.openBlock(),s.createBlock(qg,{key:0,"user-selection-rect":s.unref(l)},null,8,["user-selection-rect"])):s.createCommentVNode("",!0),s.unref(c)&&s.unref(f).length?(s.openBlock(),s.createBlock(Jg,{key:1})):s.createCommentVNode("",!0)],34))}}),nm={name:"Transform",compatConfig:{MODE:3}},om=s.defineComponent({...nm,setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=s.computed(()=>n.value?!o.value:!1),r=s.computed(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>(s.openBlock(),s.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:s.normalizeStyle({transform:r.value,opacity:i.value?0:void 0})},[s.renderSlot(a.$slots,"default")],4))}}),im={name:"Viewport",compatConfig:{MODE:3}},rm=s.defineComponent({...im,setup(t){const{minZoom:e,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:u,panOnScrollMode:c,panOnScrollSpeed:d,panOnDrag:f,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:y,preventScrolling:m,noWheelClassName:b,noPanClassName:T,emits:x,connectionStartHandle:g,userSelectionActive:C,paneDragging:A,d3Zoom:z,d3Selection:j,d3ZoomHandler:Y,viewport:W,viewportRef:D,paneClickDistance:B}=_e();Ug(D);const k=s.shallowRef(!1),V=s.shallowRef(!1);let _=null,M=!1,v=0,S={x:0,y:0,zoom:0};const I=Sn(l),P=Sn(a),H=Sn(r),$=s.toRef(()=>(!P.value||P.value&&a.value===!0)&&(I.value||f.value)),O=s.toRef(()=>I.value||u.value),F=s.toRef(()=>a.value===!0&&$.value!==!0),G=s.toRef(()=>P.value&&a.value!==!0||C.value||F.value),X=s.toRef(()=>g.value!==null);s.onMounted(()=>{if(!D.value){In("Viewport element is missing");return}const Q=D.value,le=Q.getBoundingClientRect(),ee=Np().clickDistance(B.value).scaleExtent([e.value,n.value]).translateExtent(i.value),K=Ke(Q).call(ee),E=K.on("wheel.zoom"),w=Xt.translate(o.value.x??0,o.value.y??0).scale(zt(o.value.zoom??1,e.value,n.value)),N=[[0,0],[le.width,le.height]],L=ee.constrain()(w,N,i.value);ee.transform(K,L),ee.wheelDelta(ka),z.value=ee,j.value=K,Y.value=E,W.value={x:L.x,y:L.y,zoom:L.k},ee.on("start",R=>{var oe;if(!R.sourceEvent)return null;v=R.sourceEvent.button,k.value=!0;const ne=J(R.transform);((oe=R.sourceEvent)==null?void 0:oe.type)==="mousedown"&&(A.value=!0),S=ne,x.viewportChangeStart(ne),x.moveStart({event:R,flowTransform:ne})}),ee.on("end",R=>{if(!R.sourceEvent)return null;if(k.value=!1,A.value=!1,Z($.value,v??0)&&!M&&x.paneContextMenu(R.sourceEvent),M=!1,U(S,R.transform)){const oe=J(R.transform);S=oe,x.viewportChangeEnd(oe),x.moveEnd({event:R,flowTransform:oe})}}),ee.filter(R=>{var oe;const ne=H.value||y.value,se=p.value&&R.ctrlKey,re=R.button,de=R.type==="wheel";if(re===1&&R.type==="mousedown"&&(te(R,"vue-flow__node")||te(R,"vue-flow__edge")))return!0;if(!$.value&&!ne&&!O.value&&!h.value&&!p.value||C.value||X.value&&!de||!h.value&&R.type==="dblclick"||te(R,b.value)&&de||te(R,T.value)&&(!de||O.value&&de&&!H.value)||!p.value&&R.ctrlKey&&de||!ne&&!O.value&&!se&&de)return!1;if(!p&&R.type==="touchstart"&&((oe=R.touches)==null?void 0:oe.length)>1)return R.preventDefault(),!1;if(!$.value&&(R.type==="mousedown"||R.type==="touchstart")||F.value&&Array.isArray(f.value)&&f.value.includes(0)&&re===0||Array.isArray(f.value)&&!f.value.includes(re)&&(R.type==="mousedown"||R.type==="touchstart"))return!1;const ce=Array.isArray(f.value)&&f.value.includes(re)||a.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!re||re<=1;return(!R.ctrlKey||I.value||de)&&ce}),s.watch([C,$],()=>{C.value&&!k.value?ee.on("zoom",null):C.value||ee.on("zoom",R=>{W.value={x:R.transform.x,y:R.transform.y,zoom:R.transform.k};const oe=J(R.transform);M=Z($.value,v??0),x.viewportChange(oe),x.move({event:R,flowTransform:oe})})},{immediate:!0}),s.watch([C,O,c,H,p,m,b],()=>{O.value&&!H.value&&!C.value?K.on("wheel.zoom",R=>{if(te(R,b.value))return!1;const oe=H.value||y.value,ne=p.value&&R.ctrlKey;if(!(!m.value||O.value||oe||ne))return!1;R.preventDefault(),R.stopImmediatePropagation();const re=K.property("__zoom").k||1,de=Co();if(!I.value&&R.ctrlKey&&p.value&&de){const Hr=nt(R),hi=ka(R),pi=re*2**hi;ee.scaleTo(K,pi,Hr,R);return}const ce=R.deltaMode===1?20:1;let ve=c.value===En.Vertical?0:R.deltaX*ce,Me=c.value===En.Horizontal?0:R.deltaY*ce;!de&&R.shiftKey&&c.value!==En.Vertical&&!ve&&Me&&(ve=Me,Me=0),ee.translateBy(K,-(ve/re)*d.value,-(Me/re)*d.value);const $e=J(K.property("__zoom"));_&&clearTimeout(_),V.value?(x.move({event:R,flowTransform:$e}),x.viewportChange($e),_=setTimeout(()=>{x.moveEnd({event:R,flowTransform:$e}),x.viewportChangeEnd($e),V.value=!1},150)):(V.value=!0,x.moveStart({event:R,flowTransform:$e}),x.viewportChangeStart($e))},{passive:!1}):typeof E<"u"&&K.on("wheel.zoom",function(R,oe){const ne=!m.value&&R.type==="wheel"&&!R.ctrlKey,se=H.value||y.value,re=p.value&&R.ctrlKey;if(!se&&!u.value&&!re&&R.type==="wheel"||ne||te(R,b.value))return null;R.preventDefault(),E.call(this,R,oe)},{passive:!1})},{immediate:!0})});function Z(Q,le){return le===2&&Array.isArray(Q)&&Q.includes(2)}function U(Q,le){return Q.x!==le.x&&!Number.isNaN(le.x)||Q.y!==le.y&&!Number.isNaN(le.y)||Q.zoom!==le.k&&!Number.isNaN(le.k)}function J(Q){return{x:Q.x,y:Q.y,zoom:Q.k}}function te(Q,le){return Q.target.closest(`.${le}`)}return(Q,le)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"viewportRef",ref:D,class:"vue-flow__viewport vue-flow__container"},[s.createVNode(tm,{"is-selecting":G.value,"selection-key-pressed":s.unref(P),class:s.normalizeClass({connecting:X.value,dragging:s.unref(A),draggable:s.unref(f)===!0||Array.isArray(s.unref(f))&&s.unref(f).includes(0)})},{default:s.withCtx(()=>[s.createVNode(om,null,{default:s.withCtx(()=>[s.renderSlot(Q.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),sm=["id"],am=["id"],lm=["id"],cm={name:"A11yDescriptions",compatConfig:{MODE:3}},dm=s.defineComponent({...cm,setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{id:`${s.unref(ha)}-${s.unref(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+s.toDisplayString(s.unref(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,sm),s.createElementVNode("div",{id:`${s.unref(pa)}-${s.unref(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,am),s.unref(n)?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:0,id:`${s.unref(Bp)}-${s.unref(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},s.toDisplayString(s.unref(o)),9,lm))],64))}});function um(){const t=_e();s.watch(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function fm(t,e,n){return n===ue.Left?t-e:n===ue.Right?t+e:t}function hm(t,e,n){return n===ue.Top?t-e:n===ue.Bottom?t+e:t}const hr=function({radius:t=10,centerX:e=0,centerY:n=0,position:o=ue.Top,type:i}){return s.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:fm(e,t,o),cy:hm(n,t,o),r:t,stroke:"transparent",fill:"transparent"})};hr.props=["radius","centerX","centerY","position","type"],hr.compatConfig={MODE:3};const cl=hr,pm=s.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:u,removeSelectedEdges:c,findEdge:d,findNode:f,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:y,elementsSelectable:m,edgesUpdatable:b,edgesFocusable:T,hooks:x}=_e(),g=s.computed(()=>d(t.id)),{emit:C,on:A}=cg(g.value,r),z=s.inject(So),j=s.getCurrentInstance(),Y=s.ref(!1),W=s.ref(!1),D=s.ref(""),B=s.ref(null),k=s.ref("source"),V=s.ref(null),_=s.toRef(()=>typeof g.value.selectable>"u"?m.value:g.value.selectable),M=s.toRef(()=>typeof g.value.updatable>"u"?b.value:g.value.updatable),v=s.toRef(()=>typeof g.value.focusable>"u"?T.value:g.value.focusable);s.provide(sg,t.id),s.provide(ag,V);const S=s.computed(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),I=s.computed(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),P=s.computed(()=>{const w=g.value.type||"default",N=z?.[`edge-${w}`];if(N)return N;let L=g.value.template??u.value[w];if(typeof L=="string"&&j){const R=Object.keys(j.appContext.components);R&&R.includes(w)&&(L=s.resolveComponent(w,!1))}return L&&typeof L!="string"?L:(r.error(new Ie(Ne.EDGE_TYPE_MISSING,L)),!1)}),{handlePointerDown:H}=Za({nodeId:D,handleId:B,type:k,isValidConnection:h,edgeUpdaterType:k,onEdgeUpdate:F,onEdgeUpdateEnd:G});return()=>{const w=f(g.value.source),N=f(g.value.target),L="pathOptions"in g.value?g.value.pathOptions:{};if(!w&&!N)return r.error(new Ie(Ne.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!w)return r.error(new Ie(Ne.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!N)return r.error(new Ie(Ne.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||w.hidden||N.hidden)return null;let R;o.value===ht.Strict?R=w.handleBounds.source:R=[...w.handleBounds.source||[],...w.handleBounds.target||[]];const oe=Oa(R,g.value.sourceHandle);let ne;o.value===ht.Strict?ne=N.handleBounds.target:ne=[...N.handleBounds.target||[],...N.handleBounds.source||[]];const se=Oa(ne,g.value.targetHandle),re=oe?.position||ue.Bottom,de=se?.position||ue.Top,{x:ce,y:ve}=Zt(w,oe,re),{x:Me,y:$e}=Zt(N,se,de);return g.value.sourceX=ce,g.value.sourceY=ve,g.value.targetX=Me,g.value.targetY=$e,s.h("g",{ref:V,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${P.value===!1?"default":g.value.type||"default"}`,l.value,S.value,{updating:Y.value,selected:g.value.selected,animated:g.value.animated,inactive:!_.value&&!x.value.edgeClick.hasListeners()}],tabIndex:v.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel??`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":v.value?`${pa}-${e}`:void 0,"aria-roledescription":"edge",role:v.value?"group":"img",...g.value.domAttributes,onClick:Z,onContextmenu:U,onDblclick:J,onMouseenter:te,onMousemove:Q,onMouseleave:le,onKeyDown:v.value?E:void 0},[W.value?null:s.h(P.value===!1?u.value.default:P.value,{id:t.id,sourceNode:w,targetNode:N,source:g.value.source,target:g.value.target,type:g.value.type,updatable:M.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...A},style:I.value,markerStart:`url('#${Tn(g.value.markerStart,e)}')`,markerEnd:`url('#${Tn(g.value.markerEnd,e)}')`,sourcePosition:re,targetPosition:de,sourceX:ce,sourceY:ve,targetX:Me,targetY:$e,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...L}),[M.value==="source"||M.value===!0?[s.h("g",{onMousedown:ee,onMouseenter:$,onMouseout:O},s.h(cl,{position:re,centerX:ce,centerY:ve,radius:i.value,type:"source","data-type":"source"}))]:null,M.value==="target"||M.value===!0?[s.h("g",{onMousedown:K,onMouseenter:$,onMouseout:O},s.h(cl,{position:de,centerX:Me,centerY:$e,radius:i.value,type:"target","data-type":"target"}))]:null]])};function $(){Y.value=!0}function O(){Y.value=!1}function F(w,N){C.update({event:w,edge:g.value,connection:N})}function G(w){C.updateEnd({event:w,edge:g.value}),W.value=!1}function X(w,N){w.button===0&&(W.value=!0,D.value=N?g.value.target:g.value.source,B.value=(N?g.value.targetHandle:g.value.sourceHandle)??null,k.value=N?"target":"source",C.updateStart({event:w,edge:g.value}),H(w))}function Z(w){var N;const L={event:w,edge:g.value};_.value&&(a.value=!1,g.value.selected&&p.value?(c([g.value]),(N=V.value)==null||N.blur()):n([g.value])),C.click(L)}function U(w){C.contextMenu({event:w,edge:g.value})}function J(w){C.doubleClick({event:w,edge:g.value})}function te(w){C.mouseEnter({event:w,edge:g.value})}function Q(w){C.mouseMove({event:w,edge:g.value})}function le(w){C.mouseLeave({event:w,edge:g.value})}function ee(w){X(w,!0)}function K(w){X(w,!1)}function E(w){var N;!y.value&&ga.includes(w.key)&&_.value&&(w.key==="Escape"?((N=V.value)==null||N.blur(),c([d(t.id)])):n([d(t.id)]))}}}),gm=s.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:u,connectionStatus:c,viewport:d,findNode:f}=_e(),h=(t=s.inject(So))==null?void 0:t["connection-line"],p=s.computed(()=>{var x;return f((x=o.value)==null?void 0:x.nodeId)}),y=s.computed(()=>{var x;return f((x=i.value)==null?void 0:x.nodeId)??null}),m=s.computed(()=>({x:(r.value.x-d.value.x)/d.value.zoom,y:(r.value.y-d.value.y)/d.value.zoom})),b=s.computed(()=>u.value.markerStart?`url(#${Tn(u.value.markerStart,e)})`:""),T=s.computed(()=>u.value.markerEnd?`url(#${Tn(u.value.markerEnd,e)})`:"");return()=>{var x,g,C;if(!p.value||!o.value)return null;const A=o.value.id,z=o.value.type,j=p.value.handleBounds;let Y=j?.[z]??[];if(n.value===ht.Loose){const I=j?.[z==="source"?"target":"source"]??[];Y=[...Y,...I]}if(!Y)return null;const W=(A?Y.find(I=>I.id===A):Y[0])??null,D=W?.position??ue.Top,{x:B,y:k}=Zt(p.value,W,D);let V=null;y.value&&(n.value===ht.Strict?V=((x=y.value.handleBounds[z==="source"?"target":"source"])==null?void 0:x.find(I=>{var P;return I.id===((P=i.value)==null?void 0:P.id)}))||null:V=((g=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:g.find(I=>{var P;return I.id===((P=i.value)==null?void 0:P.id)}))||null);const _=((C=i.value)==null?void 0:C.position)??(D?sr[D]:null);if(!D||!_)return null;const M=a.value??u.value.type??$t.Bezier;let v="";const S={sourceX:B,sourceY:k,sourcePosition:D,targetX:m.value.x,targetY:m.value.y,targetPosition:_};return M===$t.Bezier?[v]=ur(S):M===$t.Step?[v]=fr({...S,borderRadius:0}):M===$t.SmoothStep?[v]=fr(S):M===$t.SimpleBezier?[v]=rl(S):v=`M${B},${k} ${m.value.x},${m.value.y}`,s.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},s.h("g",{class:"vue-flow__connection"},h?s.h(h,{sourceX:B,sourceY:k,sourcePosition:D,targetX:m.value.x,targetY:m.value.y,targetPosition:_,sourceNode:p.value,sourceHandle:W,targetNode:y.value,targetHandle:V,markerEnd:T.value,markerStart:b.value,connectionStatus:c.value}):s.h("path",{d:v,class:[u.value.class,c.value,"vue-flow__connection-path"],style:{...l.value,...u.value.style},"marker-end":T.value,"marker-start":b.value})))}}}),mm=["id","markerWidth","markerHeight","markerUnits","orient"],ym={name:"MarkerType",compatConfig:{MODE:3}},vm=s.defineComponent({...ym,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>(s.openBlock(),s.createElementBlock("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===s.unref(pt).ArrowClosed?(s.openBlock(),s.createElementBlock("polyline",{key:0,style:s.normalizeStyle({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):s.createCommentVNode("",!0),e.type===s.unref(pt).Arrow?(s.openBlock(),s.createElementBlock("polyline",{key:1,style:s.normalizeStyle({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):s.createCommentVNode("",!0)],8,mm))}}),bm={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},_m={name:"MarkerDefinitions",compatConfig:{MODE:3}},wm=s.defineComponent({..._m,setup(t){const{id:e,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=s.computed(()=>{const a=new Set,l=[],u=c=>{if(c){const d=Tn(c,e);a.has(d)||(typeof c=="object"?l.push({...c,id:d,color:c.color||i.value}):l.push({id:d,color:i.value,type:c}),a.add(d))}};for(const c of[o.value.markerEnd,o.value.markerStart])u(c);for(const c of n.value)for(const d of[c.markerStart,c.markerEnd])u(d);return l.sort((c,d)=>c.id.localeCompare(d.id))});return(a,l)=>(s.openBlock(),s.createElementBlock("svg",bm,[s.createElementVNode("defs",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.value,u=>(s.openBlock(),s.createBlock(vm,{id:u.id,key:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,"stroke-width":u.strokeWidth,orient:u.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),xm={name:"Edges",compatConfig:{MODE:3}},Cm=s.defineComponent({...xm,setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(wm),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(n),a=>(s.openBlock(),s.createElementBlock("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:s.normalizeStyle({zIndex:s.unref(Xp)(a,s.unref(e),s.unref(o))})},[s.createVNode(s.unref(pm),{id:a.id},null,8,["id"])],4))),128)),s.createVNode(s.unref(gm))],64))}}),Em=s.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:l,addSelectedNodes:u,updateNodeDimensions:c,onUpdateNodeInternals:d,getNodeTypes:f,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:y,ariaLiveMessage:m,snapToGrid:b,snapGrid:T,nodeDragThreshold:x,nodesDraggable:g,elementsSelectable:C,nodesConnectable:A,nodesFocusable:z,hooks:j}=_e(),Y=s.ref(null);s.provide(qa,Y),s.provide(Xa,t.id);const W=s.inject(So),D=s.getCurrentInstance(),B=Qa(),{node:k,parentNode:V}=Ja(t.id),{emit:_,on:M}=hg(k,a),v=s.toRef(()=>typeof k.draggable>"u"?g.value:k.draggable),S=s.toRef(()=>typeof k.selectable>"u"?C.value:k.selectable),I=s.toRef(()=>typeof k.connectable>"u"?A.value:k.connectable),P=s.toRef(()=>typeof k.focusable>"u"?z.value:k.focusable),H=s.computed(()=>S.value||v.value||j.value.nodeClick.hasListeners()||j.value.nodeDoubleClick.hasListeners()||j.value.nodeMouseEnter.hasListeners()||j.value.nodeMouseMove.hasListeners()||j.value.nodeMouseLeave.hasListeners()),$=s.toRef(()=>!!k.dimensions.width&&!!k.dimensions.height),O=s.computed(()=>{const N=k.type||"default",L=W?.[`node-${N}`];if(L)return L;let R=k.template||f.value[N];if(typeof R=="string"&&D){const oe=Object.keys(D.appContext.components);oe&&oe.includes(N)&&(R=s.resolveComponent(N,!1))}return R&&typeof R!="string"?R:(a.error(new Ie(Ne.NODE_TYPE_MISSING,R)),!1)}),F=Ka({id:t.id,el:Y,disabled:()=>!v.value,selectable:S,dragHandle:()=>k.dragHandle,onStart(N){_.dragStart(N)},onDrag(N){_.drag(N)},onStop(N){_.dragStop(N)},onClick(N){E(N)}}),G=s.computed(()=>k.class instanceof Function?k.class(k):k.class),X=s.computed(()=>{const N=(k.style instanceof Function?k.style(k):k.style)||{},L=k.width instanceof Function?k.width(k):k.width,R=k.height instanceof Function?k.height(k):k.height;return!N.width&&L&&(N.width=typeof L=="string"?L:`${L}px`),!N.height&&R&&(N.height=typeof R=="string"?R:`${R}px`),N}),Z=s.toRef(()=>Number(k.zIndex??X.value.zIndex??0));return d(N=>{(N.includes(t.id)||!N.length)&&J()}),s.onMounted(()=>{s.watch(()=>k.hidden,(N=!1,L,R)=>{!N&&Y.value&&(t.resizeObserver.observe(Y.value),R(()=>{Y.value&&t.resizeObserver.unobserve(Y.value)}))},{immediate:!0,flush:"post"})}),s.watch([()=>k.type,()=>k.sourcePosition,()=>k.targetPosition],()=>{s.nextTick(()=>{c([{id:t.id,nodeElement:Y.value,forceUpdate:!0}])})}),s.watch([()=>k.position.x,()=>k.position.y,()=>{var N;return(N=V.value)==null?void 0:N.computedPosition.x},()=>{var N;return(N=V.value)==null?void 0:N.computedPosition.y},()=>{var N;return(N=V.value)==null?void 0:N.computedPosition.z},Z,()=>k.selected,()=>k.dimensions.height,()=>k.dimensions.width,()=>{var N;return(N=V.value)==null?void 0:N.dimensions.height},()=>{var N;return(N=V.value)==null?void 0:N.dimensions.width}],([N,L,R,oe,ne,se])=>{const re={x:N,y:L,z:se+(p.value&&k.selected?1e3:0)};typeof R<"u"&&typeof oe<"u"?k.computedPosition=Fp({x:R,y:oe,z:ne},re):k.computedPosition=re},{flush:"post",immediate:!0}),s.watch([()=>k.extent,h],([N,L],[R,oe])=>{(N!==R||L!==oe)&&U()}),k.extent==="parent"||typeof k.extent=="object"&&"range"in k.extent&&k.extent.range==="parent"?Bi(()=>$).toBe(!0).then(U):U(),()=>k.hidden?null:s.h("div",{ref:Y,"data-id":k.id,class:["vue-flow__node",`vue-flow__node-${O.value===!1?"default":k.type||"default"}`,{[n.value]:v.value,dragging:F?.value,draggable:v.value,selected:k.selected,selectable:S.value,parent:k.isParent},G.value],style:{visibility:$.value?"visible":"hidden",zIndex:k.computedPosition.z??Z.value,transform:`translate(${k.computedPosition.x}px,${k.computedPosition.y}px)`,pointerEvents:H.value?"all":"none",...X.value},tabIndex:P.value?0:void 0,role:P.value?"group":void 0,"aria-describedby":y.value?void 0:`${ha}-${e}`,"aria-label":k.ariaLabel,"aria-roledescription":"node",...k.domAttributes,onMouseenter:te,onMousemove:Q,onMouseleave:le,onContextmenu:ee,onClick:E,onDblclick:K,onKeydown:w},[s.h(O.value===!1?f.value.default:O.value,{id:k.id,type:k.type,data:k.data,events:{...k.events,...M},selected:k.selected,resizing:k.resizing,dragging:F.value,connectable:I.value,position:k.computedPosition,dimensions:k.dimensions,isValidTargetPos:k.isValidTargetPos,isValidSourcePos:k.isValidSourcePos,parent:k.parentNode,parentNodeId:k.parentNode,zIndex:k.computedPosition.z??Z.value,targetPosition:k.targetPosition,sourcePosition:k.sourcePosition,label:k.label,dragHandle:k.dragHandle,onUpdateNodeInternals:J})]);function U(){const N=k.computedPosition,{computedPosition:L,position:R}=or(k,b.value?Eo(N,T.value):N,a.error,h.value,V.value);(k.computedPosition.x!==L.x||k.computedPosition.y!==L.y)&&(k.computedPosition={...k.computedPosition,...L}),(k.position.x!==R.x||k.position.y!==R.y)&&(k.position=R)}function J(){Y.value&&c([{id:t.id,nodeElement:Y.value,forceUpdate:!0}])}function te(N){F?.value||_.mouseEnter({event:N,node:k})}function Q(N){F?.value||_.mouseMove({event:N,node:k})}function le(N){F?.value||_.mouseLeave({event:N,node:k})}function ee(N){return _.contextMenu({event:N,node:k})}function K(N){return _.doubleClick({event:N,node:k})}function E(N){S.value&&(!o.value||!v.value||x.value>0)&&ar(k,r.value,u,l,i,!1,Y.value),_.click({event:N,node:k})}function w(N){if(!(er(N)||y.value))if(ga.includes(N.key)&&S.value){const L=N.key==="Escape";ar(k,r.value,u,l,i,L,Y.value)}else v.value&&k.selected&&qt[N.key]&&(N.preventDefault(),m.value=`Moved selected node ${N.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.position.x}, y: ${~~k.position.y}`,B({x:qt[N.key].x,y:qt[N.key].y},N.shiftKey))}}}),Sm={height:"0",width:"0"},Nm={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},km=s.defineComponent({...Nm,setup(t){const{viewportRef:e}=_e(),n=s.toRef(()=>{var o;return(o=e.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(s.openBlock(),s.createElementBlock("svg",null,[(s.openBlock(),s.createElementBlock("foreignObject",Sm,[(s.openBlock(),s.createBlock(s.Teleport,{to:n.value,disabled:!n.value},[s.renderSlot(o.$slots,"default")],8,["to","disabled"]))]))]))}});function Dm(t={includeHiddenNodes:!1}){const{nodes:e}=_e();return s.computed(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Tm={class:"vue-flow__nodes vue-flow__container"},Im={name:"Nodes",compatConfig:{MODE:3}},Mm=s.defineComponent({...Im,setup(t){const{getNodes:e,updateNodeDimensions:n,emits:o}=_e(),i=Dm(),r=s.ref();return s.watch(i,a=>{a&&s.nextTick(()=>{o.nodesInitialized(e.value)})},{immediate:!0}),s.onMounted(()=>{r.value=new ResizeObserver(a=>{const l=a.map(u=>({id:u.target.getAttribute("data-id"),nodeElement:u.target,forceUpdate:!0}));s.nextTick(()=>n(l))})}),s.onBeforeUnmount(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,l)=>(s.openBlock(),s.createElementBlock("div",Tm,[r.value?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(e),(u,c,d,f)=>{const h=[u.id];if(f&&f.key===u.id&&s.isMemoSame(f,h))return f;const p=(s.openBlock(),s.createBlock(s.unref(Em),{id:u.id,key:u.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},l,0),128)):s.createCommentVNode("",!0)]))}});function Bm(){const{emits:t}=_e();s.onMounted(()=>{if(Fa()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Ie(Ne.MISSING_STYLES))}})}const $m=s.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),zm={name:"VueFlow",compatConfig:{MODE:3}},Am=s.defineComponent({...zm,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const o=t,i=s.useSlots(),r=$i(o,"modelValue",n),a=$i(o,"nodes",n),l=$i(o,"edges",n),u=_e(o),c=yg({modelValue:r,nodes:a,edges:l},o,u);return bg(n,u.hooks),um(),Bm(),s.provide(So,i),s.onUnmounted(c),e(u),(d,f)=>(s.openBlock(),s.createElementBlock("div",{ref:s.unref(u).vueFlowRef,class:"vue-flow"},[s.createVNode(rm,null,{default:s.withCtx(()=>[s.createVNode(Cm),$m,s.createVNode(Mm),s.renderSlot(d.$slots,"zoom-pane")]),_:3}),s.renderSlot(d.$slots,"default"),s.createVNode(dm)],512))}}),Pm={name:"Panel",compatConfig:{MODE:3}},Om=s.defineComponent({...Pm,props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=_e(),o=s.computed(()=>`${e.position}`.split("-"));return(i,r)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["vue-flow__panel",o.value]),style:s.normalizeStyle({pointerEvents:s.unref(n)?"none":"all"})},[s.renderSlot(i.$slots,"default")],6))}});var gt=(t=>(t.Lines="lines",t.Dots="dots",t))(gt||{});const dl=function({dimensions:t,size:e,color:n}){return s.h("path",{stroke:n,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},ul=function({radius:t,color:e}){return s.h("circle",{cx:t,cy:t,r:t,fill:e})};gt.Lines+"",gt.Dots+"";const Rm={[gt.Dots]:"#81818a",[gt.Lines]:"#eee"},Hm=["id","x","y","width","height","patternTransform"],Vm={key:2,height:"100",width:"100"},Lm=["fill"],Fm=["x","y","fill"],jm={name:"Background",compatConfig:{MODE:3}},Gm=s.defineComponent({...jm,props:{id:{},variant:{default:()=>gt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(t){const{id:e,viewport:n}=_e(),o=s.computed(()=>{const a=n.value.zoom,[l,u]=Array.isArray(t.gap)?t.gap:[t.gap,t.gap],c=[l*a||1,u*a||1],d=t.size*a,[f,h]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset],p=[f*a||1+c[0]/2,h*a||1+c[1]/2];return{scaledGap:c,offset:p,size:d}}),i=s.toRef(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),r=s.toRef(()=>t.color||t.patternColor||Rm[t.variant||gt.Dots]);return(a,l)=>(s.openBlock(),s.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:s.normalizeStyle({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[s.renderSlot(a.$slots,"pattern-container",{id:i.value},()=>[s.createElementVNode("pattern",{id:i.value,x:s.unref(n).x%o.value.scaledGap[0],y:s.unref(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[s.renderSlot(a.$slots,"pattern",{},()=>[a.variant===s.unref(gt).Lines?(s.openBlock(),s.createBlock(s.unref(dl),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===s.unref(gt).Dots?(s.openBlock(),s.createBlock(s.unref(ul),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):s.createCommentVNode("",!0),a.bgColor?(s.openBlock(),s.createElementBlock("svg",Vm,[s.createElementVNode("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,Lm)])):s.createCommentVNode("",!0)])],8,Hm)]),s.createElementVNode("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Fm),s.renderSlot(a.$slots,"default",{id:i.value})],4))}}),Wm={name:"ControlButton",compatConfig:{MODE:3}},Ym=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Um={type:"button",class:"vue-flow__controls-button"};function Xm(t,e,n,o,i,r){return s.openBlock(),s.createElementBlock("button",Um,[s.renderSlot(t.$slots,"default")])}const Bo=Ym(Wm,[["render",Xm]]),qm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Km=[s.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Zm(t,e){return s.openBlock(),s.createElementBlock("svg",qm,Km)}const Jm={render:Zm},Qm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ey=[s.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function ty(t,e){return s.openBlock(),s.createElementBlock("svg",Qm,ey)}const ny={render:ty},oy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},iy=[s.createElementVNode("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function ry(t,e){return s.openBlock(),s.createElementBlock("svg",oy,iy)}const sy={render:ry},ay={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ly=[s.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function cy(t,e){return s.openBlock(),s.createElementBlock("svg",ay,ly)}const dy={render:cy},uy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},fy=[s.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function hy(t,e){return s.openBlock(),s.createElementBlock("svg",uy,fy)}const py={render:hy},gy={name:"Controls",compatConfig:{MODE:3}},my=s.defineComponent({...gy,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ua.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:a,zoomOut:l,fitView:u,viewport:c,minZoom:d,maxZoom:f}=_e(),h=s.toRef(()=>n.value||o.value||i.value),p=s.toRef(()=>c.value.zoom<=d.value),y=s.toRef(()=>c.value.zoom>=f.value);function m(){a(),e("zoomIn")}function b(){l(),e("zoomOut")}function T(){u(t.fitViewParams),e("fitView")}function x(){r(!h.value),e("interactionChange",!h.value)}return(g,C)=>(s.openBlock(),s.createBlock(s.unref(Om),{class:"vue-flow__controls",position:g.position},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"top"),g.showZoom?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(g.$slots,"control-zoom-in",{},()=>[s.createVNode(Bo,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:m},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-zoom-in",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Jm))))])]),_:3},8,["disabled"])]),s.renderSlot(g.$slots,"control-zoom-out",{},()=>[s.createVNode(Bo,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:b},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-zoom-out",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(ny))))])]),_:3},8,["disabled"])])],64)):s.createCommentVNode("",!0),g.showFitView?s.renderSlot(g.$slots,"control-fit-view",{key:1},()=>[s.createVNode(Bo,{class:"vue-flow__controls-fitview",onClick:T},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-fit-view",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(sy))))])]),_:3})]):s.createCommentVNode("",!0),g.showInteractive?s.renderSlot(g.$slots,"control-interactive",{key:2},()=>[g.showInteractive?(s.openBlock(),s.createBlock(Bo,{key:0,class:"vue-flow__controls-interactive",onClick:x},{default:s.withCtx(()=>[h.value?s.renderSlot(g.$slots,"icon-unlock",{key:0},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(py))))]):s.createCommentVNode("",!0),h.value?s.createCommentVNode("",!0):s.renderSlot(g.$slots,"icon-lock",{key:1},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(dy))))])]),_:3})):s.createCommentVNode("",!0)]):s.createCommentVNode("",!0),s.renderSlot(g.$slots,"default")]),_:3},8,["position"]))}}),yy=["onClick"],vy={class:"d-flow-node-menus-item-name"},pr=s.defineComponent({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(t,{emit:e}){const n=t,o=e,i=s.inject("d_flow_design_provide",{}),r=i.getFlowComponents?.()||[],a=l=>{o("addNode",l.type),s.nextTick(()=>{n.handleId==="line"?i.addNodeByLine?.(l.type,n.fromNodeId||""):i.addNode?.(l.type,n.fromNodeId||"",n.handleId||"")})};return(l,u)=>{const c=s.resolveComponent("j-icon");return s.openBlock(),s.createElementBlock("div",{class:"d-flow-node-menus",onClick:s.withModifiers(()=>{},["stop"])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r),(d,f)=>(s.openBlock(),s.createElementBlock("div",{key:f,class:"d-flow-node-menus-item",onClick:h=>a(d)},[s.createElementVNode("div",{class:"d-flow-node-menus-item-icon",style:s.normalizeStyle({backgroundColor:d.iconColor||"var(--j-color-primary)"})},[s.createVNode(c,{icon:d.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",vy,s.toDisplayString(d.name),1)],8,yy))),128))])}}}),by={class:"d-flow-step-name"},_y={key:0,style:{color:"var(--j-color-text-2)"}},wy={style:{color:"var(--j-color-text)"}},xy=s.defineComponent({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(t){const e=t,{onNodeClick:n,onEdgeClick:o,onMoveStart:i,onConnectStart:r,onNodeDragStart:a,removeNodes:l,getEdges:u,getNodes:c,onNodesChange:d}=_e(),f=s.inject("d_flow_design_provide",{}),h=s.computed(()=>f.getFlowComponentMap?.value?.[e.data.type]||{}),p=()=>{l(e.id),f.onRemoveNode?.(e.id)},y=s.ref({});d(V=>{if(e.data.isInit&&V.findIndex(_=>_.type==="select"&&_.id===e.id&&_.id==="start"&&_.selected)!==-1){const _=c.value.find(M=>M.id==="start");_&&(_.data.isInit=!1),y.value.s1=!0}});const m=s.ref(!1),b=V=>{V.indexOf("t")!==-1&&!T.value||(m.value=!0,y.value[V]=!0)},T=s.computed(()=>u.value.findIndex(V=>V.target===e.id)===-1),x=s.ref(!1),g=()=>{x.value=!0},C=(V,_)=>{if(u.value.find(S=>S.source===_&&S.target===V))return!0;const v=u.value.filter(S=>S.target===V);for(let S=0;S<v.length;S++)if(C(v[S].source,_))return!0;return!1},A=V=>x.value?(x.value=!1,!1):C(V.source,V.target)?!1:V.source!==V.target&&V.sourceHandle!==V.targetHandle&&V.sourceHandle.indexOf("s")!==-1&&V.targetHandle.indexOf("t")!==-1,z=()=>{B(),Object.keys(y.value).forEach(V=>{y.value[V]=!1})},j=()=>{z()};n(()=>{console.log("onNodeClick"),m.value?m.value=!1:z()}),o(()=>{z()}),i(()=>{z()}),r(()=>{z()}),a(()=>{z()});const Y=s.ref(),W=s.ref({top:0,left:0,bottom:0,right:0}),D=s.ref({getBoundingClientRect:()=>W.value}),B=()=>{Y.value?.handleClose()},k=V=>{const{clientX:_,clientY:M}=V;W.value=DOMRect.fromRect({x:_,y:M}),V.preventDefault(),Y.value?.handleOpen()};return(V,_)=>{const M=s.resolveComponent("el-popover"),v=s.resolveComponent("el-tooltip"),S=s.resolveComponent("el-dropdown-item"),I=s.resolveComponent("el-dropdown-menu"),P=s.resolveComponent("el-dropdown");return s.openBlock(),s.createElementBlock("div",{class:"d-flow-step",onContextmenu:s.withModifiers(k,["stop"])},[s.createElementVNode("div",{class:"d-flow-step-icon",style:s.normalizeStyle({backgroundColor:h.value.iconColor||"var(--j-color-primary)"})},[s.createVNode(un,{icon:h.value.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",by,s.toDisplayString(h.value.name),1),t.data.type!=="start"?(s.openBlock(),s.createBlock(v,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:s.withCtx(()=>[T.value?(s.openBlock(),s.createElementBlock("div",_y,[..._[4]||(_[4]=[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),s.createTextVNode("添加节点 ",-1)])])):s.createCommentVNode("",!0),_[5]||(_[5]=s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),s.createTextVNode("连接节点 ")],-1))]),default:s.withCtx(()=>[s.createVNode(s.unref(Jt),{onClick:_[1]||(_[1]=H=>b("t1")),onMousedown:g,id:"t1",class:s.normalizeClass(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!T.value}]),type:"target",position:s.unref(ue).Left,"is-valid-connection":A},{default:s.withCtx(()=>[T.value?(s.openBlock(),s.createBlock(M,{key:0,visible:y.value.t1,"onUpdate:visible":_[0]||(_[0]=H=>y.value.t1=H),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:s.withCtx(()=>[s.createVNode(un,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:s.withCtx(()=>[s.createVNode(pr,{"handle-id":"t1","from-node-id":t.id,onAddNode:j},null,8,["from-node-id"])]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),_:1},8,["class","position"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(v,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:s.withCtx(()=>[..._[6]||(_[6]=[s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),s.createTextVNode("添加节点 ")],-1),s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),s.createTextVNode("连接节点 ")],-1)])]),default:s.withCtx(()=>[s.createVNode(s.unref(Jt),{onClick:_[3]||(_[3]=H=>b("s1")),onMousedown:g,id:"s1",class:"d-flow-step-source-handle",type:"source",position:s.unref(ue).Right,"is-valid-connection":A},{default:s.withCtx(()=>[s.createVNode(M,{visible:y.value.s1,"onUpdate:visible":_[2]||(_[2]=H=>y.value.s1=H),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:s.withCtx(()=>[s.createVNode(un,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:s.withCtx(()=>[s.createVNode(pr,{"handle-id":"s1","from-node-id":t.id,onAddNode:j},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),s.createVNode(P,{ref_key:"dropdownRef",ref:Y,"popper-class":"d-flow-step-dropdown","virtual-ref":D.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:s.withCtx(()=>[s.createVNode(I,null,{default:s.withCtx(()=>[t.data.type!="start"?(s.openBlock(),s.createBlock(S,{key:0,onClick:p},{default:s.withCtx(()=>[..._[7]||(_[7]=[s.createTextVNode("删除",-1)])]),_:1})):s.createCommentVNode("",!0),h.value.des?(s.openBlock(),s.createElementBlock("div",{key:1,style:s.normalizeStyle({width:"160px",padding:"4px 16px 0 16px","font-size":"12px","border-top":t.data.type!="start"?"1px solid var(--j-color-border)":void 0,"margin-top":t.data.type!="start"?"4px":void 0})},[_[8]||(_[8]=s.createElementVNode("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),s.createElementVNode("div",wy,s.toDisplayString(h.value.des),1)],4)):s.createCommentVNode("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),Cy=s.defineComponent({name:"DEdgeWithButton",__name:"edgeWithButton",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},markerEnd:{},style:{}},setup(t){const e=t,{onEdgeMouseEnter:n,onEdgeMouseLeave:o,onNodeClick:i,onEdgeClick:r,onMoveStart:a,onConnectStart:l,onNodeDragStart:u}=_e(),c=s.computed(()=>ur(e)),d=s.ref(!1),f=s.ref(!1);n(({edge:b})=>{b.id===e.id&&(d.value=!0)}),o(()=>{d.value=!1});const h=s.ref(!1),p=()=>{h.value=!1,s.nextTick(()=>{f.value=!1})},y=()=>{f.value=!0,h.value=!0},m=()=>{p()};return i(()=>{p()}),r(()=>{p()}),a(()=>{p()}),l(()=>{p()}),u(()=>{p()}),(b,T)=>{const x=s.resolveComponent("j-icon"),g=s.resolveComponent("el-popover");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(s.unref(Mn),{id:t.id,style:s.normalizeStyle(t.style),path:c.value[0],"marker-end":t.markerEnd},null,8,["id","style","path","marker-end"]),s.createVNode(s.unref(km),null,{default:s.withCtx(()=>[s.createElementVNode("div",{style:s.normalizeStyle({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${c.value[1]}px,${c.value[2]}px)`}),class:"nodrag nopan"},[s.createVNode(g,{visible:h.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{onClick:s.withModifiers(y,["stop"]),class:"d-flow-edge-button"},[s.createVNode(x,{icon:"mdi:plus-circle"})],512),[[s.vShow,d.value||f.value]])]),default:s.withCtx(()=>[s.createVNode(pr,{"handle-id":"line","from-node-id":t.id,onAddNode:m},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),Ey=s.defineComponent({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(t){return(e,n)=>(s.openBlock(),s.createBlock(s.unref(Am),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":s.unref(ht).Strict,nodes:t.nodes,edges:t.edges},{"edge-button":s.withCtx(o=>[s.createVNode(Cy,{id:o.id,"source-x":o.sourceX,"source-y":o.sourceY,"target-x":o.targetX,"target-y":o.targetY,"source-position":o.sourcePosition,"target-position":o.targetPosition,"marker-end":o.markerEnd,style:s.normalizeStyle(o.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":s.withCtx(o=>[s.createVNode(xy,s.normalizeProps(s.guardReactiveProps(o)),null,16)]),default:s.withCtx(()=>[s.createVNode(s.unref(my),{position:"bottom-left"}),s.createVNode(s.unref(Gm))]),_:1},8,["connection-mode","nodes","edges"]))}}),Sy={class:"d-flow-design"},Ny={class:"d-flow-design-canvas"},ky={class:"d-flow-design-right"},Dy={class:"d-flow-design-title"},Ty={class:"d-flow-design-title-name"},Iy={class:"d-flow-design-panel"},fl=Dt(s.defineComponent({name:"DFlowDesign",__name:"flowDesign",props:{components:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["nodeClick","edgeClick","paneClick","connect"],setup(t,{expose:e,emit:n}){const o=t,i=n,{addNodes:r,addEdges:a,removeEdges:l,addSelectedNodes:u,removeSelectedNodes:c,onConnect:d,onNodeClick:f,onPaneClick:h,onEdgeClick:p,getNodes:y,getEdges:m}=_e(),b=s.computed(()=>{const P={};return o.components.forEach(H=>{P[H.type]=H}),P.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},P}),T={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},x=s.ref([T]),g=s.ref([]),C=(P,H)=>{if(H.indexOf("t")===-1){const $=m.value.filter(O=>O.source===P.id);if($.length>0){let O=-1e6,F=0;return $.forEach(G=>{O=Math.max(O,G.targetNode.position.y+G.targetNode.dimensions.height+32),F=G.targetNode.position.x||0}),{x:F,y:O}}return{x:P.position.x+P.dimensions.width+100,y:P.position.y}}return{x:P.position.x-100-P.dimensions.width,y:P.position.y}},A=(P,H,$)=>{const O=y.value.find(G=>G.id===H);if(!O)return;const F={id:Vt(),type:"step",data:{type:P},position:C(O,$)};if(o.flowInit){const G=o.flowInit(F.data.type);G&&Object.keys(G).forEach(X=>{F.data[X]=G[X]})}r(F),$.indexOf("t")===-1?a({id:`${H}-${F.id}`,source:H,target:F.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:pt.Arrow}):a({id:`${H}-${F.id}`,source:F.id,target:H,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:pt.Arrow}),k(F.id)},z=P=>{const H=y.value.find($=>$.id===P);H&&(H.position.x+=100+H.dimensions.width,m.value.filter(O=>O.source===P).forEach(O=>{z(O.target)}))},j=(P,H)=>{const $=m.value.find(F=>F.id===H);if(!$)return;const O={id:Vt(),type:"step",data:{type:P},position:{x:$.targetNode.position.x,y:$.targetNode.position.y}};if(o.flowInit){const F=o.flowInit(O.data.type);F&&Object.keys(F).forEach(G=>{O.data[G]=F[G]})}r(O),a({id:`${$.sourceNode.id}-${O.id}`,source:$.sourceNode.id,target:O.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:pt.Arrow}),a({id:`${O.id}-${$.targetNode.id}`,source:O.id,target:$.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:pt.Arrow}),l(H),z($.target),k(O.id)};d(P=>{console.log("onConnect",P),P.type="button",P.markerEnd=pt.Arrow,a(P),i("connect",P)});const Y=()=>o.components||[],W=s.ref(),D=s.computed(()=>W.value?b.value[W.value.data.type]:void 0);f(P=>{W.value?.id!==P.node.id&&(W.value=P.node,M()),i("nodeClick",P.node)}),h(()=>{W.value=void 0,i("paneClick")}),p(P=>{W.value=void 0,i("edgeClick",P.edge)});const B=P=>{W.value?.id===P&&(W.value=void 0)},k=P=>{W.value&&c([W.value]),W.value=y.value.find(H=>H.id===P),W.value&&(M(),setTimeout(()=>{W.value&&u([W.value])},100))},V=s.ref(),_={};Object.keys(o.flowComponentConfigs).forEach(P=>{const H={type:"j-collapse",config:{defaultValue:[]},children:[]};o.flowComponentConfigs[P].forEach(($,O)=>{const F=`_collapse${O}`;H.config?.defaultValue.push(F),H.children?.push($)}),_[P]=[H]});const M=()=>{const P=_[W.value?.data.type||""];P&&V.value?(V.value.init&&V.value.init(P,W.value?.data),o.flowComponentConfigInit&&o.flowComponentConfigInit({configRef:V,inputParams:o.inputParams,components:y.value,configData:W.value?.data})):V.value&&V.value.init&&V.value.init([])},v=(P,H)=>{W.value&&o.flowComponentConfigChange&&o.flowComponentConfigChange(W.value.data.type,{configRef:V,component:P,configData:W.value.data,...H,isFlowNode:!0})};return s.provide("d_flow_design_provide",{getFlowComponents:Y,addNode:A,addNodeByLine:j,onRemoveNode:B,getFlowComponentMap:b}),e({getData:()=>{const P=[];return y.value.forEach(H=>{P.push({config:H.data,id:H.id,position:H.position,type:H.type})}),m.value.forEach(H=>{P.push({id:H.id,source:H.source,target:H.target,sourceHandle:H.sourceHandle,targetHandle:H.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),P},setData:P=>{if(!P||P.length===0)T.data.isInit=!0,x.value=[T],k(T.id);else{T.data.isInit=!1;const H=[],$=[];P.forEach(O=>{if(O.type==="line")O.type="button",O.markerEnd=pt.Arrow,$.push(O);else{const F={id:O.id,type:O.type,data:O.config,position:O.position};H.push(F)}}),x.value=H,g.value=$}}}),(P,H)=>{const $=s.resolveComponent("j-icon"),O=s.resolveComponent("j-form");return s.openBlock(),s.createElementBlock("div",Sy,[s.createElementVNode("div",Ny,[s.createVNode(Ey,{nodes:x.value,edges:g.value},null,8,["nodes","edges"])]),s.withDirectives(s.createElementVNode("div",ky,[s.createElementVNode("div",Dy,[s.createElementVNode("div",{class:"d-flow-design-title-icon",style:s.normalizeStyle({backgroundColor:D.value?.iconColor||"var(--j-color-primary)"})},[s.createVNode($,{icon:D.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",Ty,s.toDisplayString(D.value?.name||""),1)]),s.createElementVNode("div",Iy,[s.createVNode(O,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:V,onChange:v},null,512)])],512),[[s.vShow,W.value&&_[W.value.data.type]]])])}}})),My={class:"d-input-flow j-block"},hl=Dt(s.defineComponent({name:"DInputFlow",__name:"inputFlow",props:{modelValue:{},type:{},btnText:{default:"事件"},title:{},size:{default:"default"},width:{default:1200},height:{default:800},beforeClose:{},flowComponents:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=s.ref(),r=s.computed({get(){return n.modelValue},set(f){o("update:modelValue",f)}}),a=s.computed(()=>(n.modelValue?.trim(),n.btnText)),l=f=>{const h=typeof f=="string"?f:void 0;try{i.value?.setData(JSON.parse(h||"[]"))}catch{i.value?.setData([])}},u=async()=>{const f=i.value?.getData();return f?JSON.stringify(f):void 0},c=f=>{if(n.beforeClose){const h=typeof f=="string"?f:void 0;return n.beforeClose(h)}return!0},d=f=>{const h=f.value;o("change",{value:typeof h=="string"?h:void 0})};return(f,h)=>{const p=s.resolveComponent("d-flow-design"),y=s.resolveComponent("j-input-button");return s.openBlock(),s.createBlock(y,s.mergeProps(f.$attrs,{type:t.type,"btn-text":a.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":c,ok:u,open:l,"destroy-on-close":"",modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),onChange:d}),{default:s.withCtx(()=>[s.createElementVNode("div",My,[s.createVNode(p,{ref_key:"flowRef",ref:i,components:t.flowComponents,"flow-init":t.flowInit,"flow-component-config-init":t.flowComponentConfigInit,"flow-component-configs":t.flowComponentConfigs,"flow-component-config-change":t.flowComponentConfigChange,"input-params":t.inputParams},null,8,["components","flow-init","flow-component-config-init","flow-component-configs","flow-component-config-change","input-params"])])]),_:1},16,["type","btn-text","title","size","width","height","modelValue"])}}}));class q{static getElements(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(o&&!isNaN(+e[0])){const r=o.getElementById(e);return r?[r]:[]}let i=n.querySelectorAll(e);if(!i.length&&e[0]!=="."&&e[0]!=="#"&&(i=n.querySelectorAll("."+e),i.length||(i=n.querySelectorAll("#"+e)),!i.length)){const r=n.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(i)}return[e]}static getElement(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(!e.length)return null;if(o&&e[0]==="#")return o.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return n.querySelector(e);if(o&&!isNaN(+e[0]))return o.getElementById(e);let i=n.querySelector(e);return o&&!i&&(i=o.getElementById(e)),i||(i=n.querySelector("."+e)),i}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,n){const o=document.createElement("div");return e.forEach(i=>{i&&o.classList.add(i)}),n?.appendChild(o),o}static shouldSizeToContent(e,n=!1){return e?.grid&&(n?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,n){return!(e.y>=n.y+n.h||e.y+e.h<=n.y||e.x+e.w<=n.x||e.x>=n.x+n.w)}static isTouching(e,n){return q.isIntercepted(e,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(e,n){const o=e.x>n.x?e.x:n.x,i=e.x+e.w<n.x+n.w?e.x+e.w:n.x+n.w;if(i<=o)return 0;const r=e.y>n.y?e.y:n.y,a=e.y+e.h<n.y+n.h?e.y+e.h:n.y+n.h;return a<=r?0:(i-o)*(a-r)}static area(e){return e.w*e.h}static sort(e,n=1){return e.sort((i,r)=>{const a=n*((i.y??1e4)-(r.y??1e4));return a===0?n*((i.x??1e4)-(r.x??1e4)):a})}static find(e,n){return n?e.find(o=>o.id===n):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let n,o="px";if(typeof e=="string")if(e==="auto"||e==="")n=0;else{const i=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${e}`);o=i[2]||"px",n=parseFloat(i[1])}else n=e;return{h:n,unit:o}}static defaults(e,...n){return n.forEach(o=>{for(const i in o){if(!o.hasOwnProperty(i))return;e[i]===null||e[i]===void 0?e[i]=o[i]:typeof o[i]=="object"&&typeof e[i]=="object"&&q.defaults(e[i],o[i])}}),e}static same(e,n){if(typeof e!="object")return e==n;if(typeof e!=typeof n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(e[o]!==n[o])return!1;return!0}static copyPos(e,n,o=!1){return n.x!==void 0&&(e.x=n.x),n.y!==void 0&&(e.y=n.y),n.w!==void 0&&(e.w=n.w),n.h!==void 0&&(e.h=n.h),o&&(n.minW&&(e.minW=n.minW),n.minH&&(e.minH=n.minH),n.maxW&&(e.maxW=n.maxW),n.maxH&&(e.maxH=n.maxH)),e}static samePos(e,n){return e&&n&&e.x===n.x&&e.y===n.y&&(e.w||1)===(n.w||1)&&(e.h||1)===(n.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,n){if(!(typeof e!="object"||typeof n!="object")&&!(Array.isArray(e)||Array.isArray(n)))for(let o in e){const i=e[o],r=n[o];o[0]==="_"||i===r?delete e[o]:i&&typeof i=="object"&&r!==void 0&&(q.removeInternalAndSame(i,r),Object.keys(i).length||delete e[o])}}static removeInternalForSave(e,n=!0){for(let o in e)(o[0]==="_"||e[o]===null||e[o]===void 0)&&delete e[o];delete e.grid,n&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,n){let o=!1;return(...i)=>{o||(o=!0,setTimeout(()=>{e(...i),o=!1},n))}}static removePositioningStyles(e){const n=e.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const n=getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowY)?e:q.getScrollElement(e.parentElement)}static updateScrollPosition(e,n,o){const i=q.getScrollElement(e);if(!i)return;const r=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,u=r.bottom-Math.min(a.bottom,l),c=r.top-Math.max(a.top,0),d=i.scrollTop;c<0&&o<0?e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=Math.abs(c)>Math.abs(o)?o:c:u>0&&o>0&&(e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=u>o?o:u),n.top+=i.scrollTop-d}static updateScrollResize(e,n,o){const i=q.getScrollElement(n),r=i.clientHeight,a=i===q.getScrollElement()?0:i.getBoundingClientRect().top,l=e.clientY-a,u=l<o,c=l>r-o;u?i.scrollBy({behavior:"smooth",top:l-o}):c&&i.scrollBy({behavior:"smooth",top:o-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const n=["parentGrid","el","grid","subGrid","engine"],o=q.clone(e);for(const i in o)o.hasOwnProperty(i)&&typeof o[i]=="object"&&i.substring(0,2)!=="__"&&!n.find(r=>r===i)&&(o[i]=q.cloneDeep(e[i]));return o}static cloneNode(e){const n=e.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(e,n){let o;typeof n=="string"?o=q.getElement(n):o=n,o&&o.appendChild(e)}static addElStyles(e,n){if(n instanceof Object)for(const o in n)n.hasOwnProperty(o)&&(Array.isArray(n[o])?n[o].forEach(i=>{e.style[o]=i}):e.style[o]=n[o])}static initEvent(e,n){const o={type:n.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>o[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>o[r]=e[r]),{...o,...i}}static simulateMouseEvent(e,n,o){const i=e,r=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:e.target});(o||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const n=document.createElement("div");q.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(n);const o=n.getBoundingClientRect();return e.removeChild(n),n.remove(),{xScale:1/o.width,yScale:1/o.height,xOffset:o.left,yOffset:o.top}}static swap(e,n,o){if(!e)return;const i=e[n];e[n]=e[o],e[o]=i}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class mt{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,n=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||n.y<=e.y)}_fixCollisions(e,n=e,o,i={}){if(this.sortNodes(-1),o=o||this.collide(e,n),!o)return!1;if(e._moving&&!i.nested&&!this.float&&this.swap(e,o))return!0;let r=n;!this._loading&&this._useEntireRowArea(e,n)&&(r={x:0,w:this.column,y:n.y,h:n.h},o=this.collide(e,r,i.skip));let a=!1;const l={nested:!0,pack:!1};let u=0;for(;o=o||this.collide(e,r,i.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(o.locked||this._loading||e._moving&&!e._skipDown&&n.y>e.y&&!this.float&&(!this.collide(o,{...o,y:e.y},e)||!this.collide(o,{...o,y:n.y-o.h},e))){e._skipDown=e._skipDown||n.y>e.y;const d={...n,y:o.y+o.h,...l};c=this._loading&&q.samePos(e,d)?!0:this.moveNode(e,d),(o.locked||this._loading)&&c?q.copyPos(n,e):!o.locked&&c&&i.pack&&(this._packNodes(),n.y=o.y+o.h,q.copyPos(e,n)),a=a||c}else c=this.moveNode(o,{...o,y:n.y+n.h,skip:e,...l});if(!c)return a;o=void 0}return a}collide(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.find(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}collideAll(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.filter(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}directionCollideCoverage(e,n,o){if(!n.rect||!e._rect)return;const i=e._rect,r={...n.rect};r.y>i.y?(r.h+=r.y-i.y,r.y=i.y):r.h+=i.y-r.y,r.x>i.x?(r.w+=r.x-i.x,r.x=i.x):r.w+=i.x-r.x;let a,l=.5;for(let u of o){if(u.locked||!u._rect)break;const c=u._rect;let d=Number.MAX_VALUE,f=Number.MAX_VALUE;i.y<c.y?d=(r.y+r.h-c.y)/c.h:i.y+i.h>c.y+c.h&&(d=(c.y+c.h-r.y)/c.h),i.x<c.x?f=(r.x+r.w-c.x)/c.w:i.x+i.w>c.x+c.w&&(f=(c.x+c.w-r.x)/c.w);const h=Math.min(f,d);h>l&&(l=h,a=u)}return n.collide=a,a}cacheRects(e,n,o,i,r,a){return this.nodes.forEach(l=>l._rect={y:l.y*n+o,x:l.x*e+a,w:l.w*e-a-i,h:l.h*n-o-r}),this}swap(e,n){if(!n||n.locked||!e||e.locked)return!1;function o(){const r=n.x,a=n.y;return n.x=e.x,n.y=e.y,e.h!=n.h?(e.x=r,e.y=n.y+n.h):e.w!=n.w?(e.x=n.x+n.w,e.y=a):(e.x=r,e.y=a),e._dirty=n._dirty=!0,!0}let i;if(e.w===n.w&&e.h===n.h&&(e.x===n.x||e.y===n.y)&&(i=q.isTouching(e,n)))return o();if(i!==!1){if(e.w===n.w&&e.x===n.x&&(i||(i=q.isTouching(e,n)))){if(n.y<e.y){const r=e;e=n,n=r}return o()}if(i!==!1){if(e.h===n.h&&e.y===n.y&&(i||(i=q.isTouching(e,n)))){if(n.x<e.x){const r=e;e=n,n=r}return o()}return!1}}}isAreaEmpty(e,n,o,i){const r={x:e||0,y:n||0,w:o||1,h:i||1};return!this.collide(r)}compact(e="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const o=this.batchMode;o||this.batchUpdate();const i=this._inColumnResize;i||(this._inColumnResize=!0);const r=this.nodes;return this.nodes=[],r.forEach((a,l,u)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=u[l-1])),this.addNode(a,!1,c)}),i||delete this._inColumnResize,o||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=q.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let n=e.y;for(;n>e._orig.y;)--n,this.collide(e,{x:e.x,y:n,w:e.w,h:e.h})||(e._dirty=!0,e.y=n)}):this.nodes.forEach((e,n)=>{if(!e.locked)for(;e.y>0;){const o=n===0?0:e.y-1;if(!(n===0||!this.collide(e,{x:e.x,y:o,w:e.w,h:e.h})))break;e._dirty=e.y!==o,e.y=o}}),this)}prepareNode(e,n){e._id=e._id??mt._idSeq++;const o=e.id;if(o){let r=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=o+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const i={x:0,y:0,w:1,h:1};return q.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,q.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,n),e}nodeBoundFix(e,n){const o=e._orig||q.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){const r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(n?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(n?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),q.samePos(e,o)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(n=>n._dirty&&!q.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const n=(e||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=q.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||q.samePos(e,e._orig)||(q.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,n=this.nodes,o=this.column,i){const r=i?i.y*o+(i.x+i.w):0;let a=!1;for(let l=r;!a;++l){const u=l%o,c=Math.floor(l/o);if(u+e.w>o)continue;const d={x:u,y:c,w:e.w,h:e.h};n.find(f=>q.isIntercepted(d,f))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,n=!1,o){const i=this.nodes.find(a=>a._id===e._id);if(i)return i;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,o)&&(delete e.autoPosition,r=!0),this.nodes.push(e),n&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,n=!0,o=!1){return this.nodes.find(i=>i._id===e._id)?(o&&this.removedNodes.push(e),n&&(e._removeDOM=!0),this.nodes=this.nodes.filter(i=>i._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(i=>i._removeDOM=!0);const o=this.nodes;return this.removedNodes=n?o:[],this.nodes=[],this._notify(o)}moveNodeCheck(e,n){if(!this.changedPosConstrain(e,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(e,n);let o;const i=new mt({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(o={...a},o):{...a})});if(!o)return!1;const r=i.moveNode(o,n)&&i.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!n.resizing&&n.collide){const a=n.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(i.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(u=>u._id===a._id);l&&(q.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const n=new mt({column:this.column,float:this.float,nodes:this.nodes.map(i=>({...i}))}),o={...e};return this.cleanupNode(o),delete o.el,delete o._id,delete o.content,delete o.grid,n.addNode(o),n.getRow()<=this.maxRow?(e._willFitPos=q.copyPos({},o),!0):!1}changedPosConstrain(e,n){return n.w=n.w||e.w,n.h=n.h||e.h,e.x!==n.x||e.y!==n.y?!0:(e.maxW&&(n.w=Math.min(n.w,e.maxW)),e.maxH&&(n.h=Math.min(n.h,e.maxH)),e.minW&&(n.w=Math.max(n.w,e.minW)),e.minH&&(n.h=Math.max(n.h,e.minH)),e.w!==n.w||e.h!==n.h)}moveNode(e,n){if(!e||!n)return!1;let o;n.pack===void 0&&!this.batchMode&&(o=n.pack=!0),typeof n.x!="number"&&(n.x=e.x),typeof n.y!="number"&&(n.y=e.y),typeof n.w!="number"&&(n.w=e.w),typeof n.h!="number"&&(n.h=e.h);const i=e.w!==n.w||e.h!==n.h,r=q.copyPos({},e,!0);if(q.copyPos(r,n),this.nodeBoundFix(r,i),q.copyPos(n,r),!n.forceCollide&&q.samePos(e,n))return!1;const a=q.copyPos({},e),l=this.collideAll(e,r,n.skip);let u=!0;if(l.length){const c=e._moving&&!n.nested;let d=c?this.directionCollideCoverage(e,n,l):l[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const f=q.areaIntercept(n.rect,d._rect),h=q.area(n.rect),p=q.area(d._rect);f/(h<p?h:p)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,r,d,n):(u=!1,o&&delete n.pack)}return u&&!q.samePos(e,r)&&(e._dirty=!0,q.copyPos(e,r)),n.pack&&this._packNodes()._notify(),!q.samePos(e,a)}getRow(){return this.nodes.reduce((e,n)=>Math.max(e,n.y+n.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(n=>n._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,n,o){const i=this._layouts?.length||0;let r;i&&(o?o!==this.column&&(r=this._layouts[o]):this.column!==i-1&&(r=this._layouts[i-1]));const a=[];return this.sortNodes(),this.nodes.forEach(l=>{const u=r?.find(d=>d._id===l._id),c={...l,...u||{}};q.removeInternalForSave(c,!e),n&&n(l,c),a.push(c)}),a}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,o)=>{if(!n||o===this.column)return this;if(o<this.column)this._layouts[o]=void 0;else{const i=o/this.column;e.forEach(r=>{if(!r._orig)return;const a=n.find(l=>l._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y,a.y<0&&(a.y=0)),r.x!==r._orig.x&&(a.x=Math.round(r.x*i),a.x<0&&(a.x=0)),r.w!==r._orig.w&&(a.w=Math.round(r.w*i),a.w<1&&(a.w=1)))})}}),this)}columnChanged(e,n,o="moveScale"){if(!this.nodes.length||!n||e===n)return this;const i=o==="compact"||o==="list";i&&this.sortNodes(1),n<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],a=i?this.nodes:q.sort(this.nodes,-1);if(n>e&&this._layouts){const l=this._layouts[n]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{const d=a.find(f=>f._id===c._id);d&&(!i&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{const d=a.findIndex(f=>f._id===c._id);if(d!==-1){const f=a[d];if(i){f.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(f.x=c.x??f.x,f.y=c.y??f.y,f.w=c.w??f.w,r.push(f)),a.splice(d,1)}})}if(i)this.compact(o,!1);else{if(a.length)if(typeof o=="function")o(n,e,r,a);else{const l=i||o==="none"?1:n/e,u=o==="move"||o==="moveScale",c=o==="scale"||o==="moveScale";a.forEach(d=>{d.x=n===1?0:u?Math.round(d.x*l):Math.min(d.x,n-1),d.w=n===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,n),r.push(d)}),a=[]}r=q.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!i),delete this._inColumnResize,this}cacheLayout(e,n,o=!1){const i=[];return e.forEach((r,a)=>{if(r._id===void 0){const l=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=l?._id??mt._idSeq++}i[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[n]=i,this}cacheOneLayout(e,n){e._id=e._id??mt._idSeq++;const o={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete o.x,delete o.y,e.autoPosition&&(o.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const i=this.findCacheLayout(e,n);return i===-1?this._layouts[n].push(o):this._layouts[n][i]=o,this}findCacheLayout(e,n){return this._layouts?.[n]?.findIndex(o=>o._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const o=this.findCacheLayout(e,n);o!==-1&&this._layouts[n].splice(o,1)}}cleanupNode(e){for(const n in e)n[0]==="_"&&n!=="_id"&&delete e[n];return this}}mt._idSeq=0;const je={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class he{}const Qe=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class Ge{}function $o(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t.changedTouches[0],e))}function pl(t,e){t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t,e)}function zo(t){Ge.touchHandled||(Ge.touchHandled=!0,$o(t,"mousedown"))}function Ao(t){Ge.touchHandled&&$o(t,"mousemove")}function Po(t){if(!Ge.touchHandled)return;Ge.pointerLeaveTimeout&&(window.clearTimeout(Ge.pointerLeaveTimeout),delete Ge.pointerLeaveTimeout);const e=!!he.dragElement;$o(t,"mouseup"),e||$o(t,"click"),Ge.touchHandled=!1}function Oo(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function gl(t){he.dragElement&&t.pointerType!=="mouse"&&pl(t,"mouseenter")}function ml(t){he.dragElement&&t.pointerType!=="mouse"&&(Ge.pointerLeaveTimeout=window.setTimeout(()=>{delete Ge.pointerLeaveTimeout,pl(t,"mouseleave")},10))}class Ro{constructor(e,n,o){this.host=e,this.dir=n,this.option=o,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Ro.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Qe&&(this.el.addEventListener("touchstart",zo),this.el.addEventListener("pointerdown",Oo)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Qe&&(this.el.removeEventListener("touchstart",zo),this.el.removeEventListener("pointerdown",Oo)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Qe&&(this.el.addEventListener("touchmove",Ao),this.el.addEventListener("touchend",Po)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Qe&&(this.el.removeEventListener("touchmove",Ao),this.el.removeEventListener("touchend",Po)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,n){return this.option[e]&&this.option[e](n),this}}Ro.prefix="ui-resizable-";class gr{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,n){this._eventRegister[e]=n}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,n){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](n)}}class Bn extends gr{constructor(e,n={}){super(),this.el=e,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const i=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||r;return{position:{left:(a.left-i.left)*this.rectScale.x,top:(a.top-i.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const n=e.handles&&e.handles!==this.option.handles,o=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(i=>this.option[i]=e[i]),n&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),he.overResizeElement===this&&delete he.overResizeElement),this}_mouseOver(e){he.overResizeElement||he.dragElement||(he.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){he.overResizeElement===this&&(delete he.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Ro(this.el,e,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,e)})),this}_resizeStart(e){this.sizeToContent=q.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=q.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const n=q.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(e,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,n),this._applyChange();const o=q.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(o,this._ui()),this.triggerEvent("resize",o),this}_resizeStop(e){const n=q.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Bn._originStyleProp.map(o=>this.el.style[o]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,n=q.getValuesFromTransformedElement(e);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Bn._originStyleProp.forEach((e,n)=>{this.el.style[e]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,n){const o=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-o.clientX,a=this.sizeToContent?0:e.clientY-o.clientY;let l,u;n.indexOf("e")>-1?i.width+=r:n.indexOf("w")>-1&&(i.width-=r,i.left+=r,l=!0),n.indexOf("s")>-1?i.height+=a:n.indexOf("n")>-1&&(i.height-=a,i.top+=a,u=!0);const c=this._constrainSize(i.width,i.height,l,u);return Math.round(i.width)!==Math.round(c.width)&&(n.indexOf("w")>-1&&(i.left+=i.width-c.width),i.width=c.width),Math.round(i.height)!==Math.round(c.height)&&(n.indexOf("n")>-1&&(i.top+=i.height-c.height),i.height=c.height),i}_constrainSize(e,n,o,i){const r=this.option,a=(o?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,u=(i?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||n,d=Math.min(a,Math.max(l,e)),f=Math.min(u,Math.max(c,n));return{width:d,height:f}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const n=this.el.parentElement,{left:o,top:i}=n.getBoundingClientRect();e={left:o,top:i,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const o=this.temporalRect[n],i=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(o-e[n])*i+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}Bn._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const By='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class $n extends gr{constructor(e,n={}){super(),this.el=e,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const o=n?.handle?.substring(1),i=e.gridstackNode;this.dragEls=!o||e.classList.contains(o)?[e]:i?.subGrid?[e.querySelector(n.handle)||e]:Array.from(e.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),Qe&&(e.addEventListener("touchstart",zo),e.addEventListener("pointerdown",Oo))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),Qe&&(n.removeEventListener("touchstart",zo),n.removeEventListener("pointerdown",Oo))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this}_mouseDown(e){if(Ge.touchHandled&&e.isTrusted&&(Ge.touchHandled=!1),!he.mouseHandled)return e.button!==0||!this.dragEls.find(n=>n===e.target)&&e.target.closest(By)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete he.dragElement,delete he.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Qe&&(e.currentTarget.addEventListener("touchmove",Ao),e.currentTarget.addEventListener("touchend",Po)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),he.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const n=q.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(e){const n=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),he.pauseDrag){const o=Number.isInteger(he.pauseDrag)?he.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),o)}else this._callDrag(e);else if(Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>3){this.dragging=!0,he.dragElement=this;const o=this.el.gridstackNode?.grid;o?he.dropElement=o.el.ddElement.ddDroppable:delete he.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=q.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const i=q.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(i,this.ui()),this.triggerEvent("dragstart",i),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Qe&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ao,!0),e.currentTarget.removeEventListener("touchend",Po,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),he.dropElement?.el===this.el.parentElement&&delete he.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const n=q.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),he.dropElement&&he.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete he.dragElement,delete he.dropElement,delete he.mouseHandled,e.preventDefault()}_keyEvent(e){const n=this.el.gridstackNode,o=n?.grid||he.dropElement?.el?.gridstack;if(e.key==="Escape")n&&n._origRotate&&(n._orig=n._origRotate,delete n._origRotate),o?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(n&&o&&(e.key==="r"||e.key==="R")){if(!q.canBeRotated(n))return;n._origRotate=n._origRotate||{...n._orig},delete n._moving,o.setAnimation(!1).rotate(n.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),n._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,n.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",q.swap(n._orig,"w","h"),delete n._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=q.cloneNode(this.el)),e.parentElement||q.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=$n.originStyleProp.map(n=>this.el.style[n]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const n=this.helper.style;return n.pointerEvents="none",n.width=this.dragOffset.width+"px",n.height=this.dragOffset.height+"px",n.willChange="left, top",n.position="fixed",this._dragFollow(e),n.transition="none",setTimeout(()=>{this.helper&&(n.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const n=this.helper,o=this.dragElementOriginStyle.transition||null;n.style.transition=this.dragElementOriginStyle.transition="none",$n.originStyleProp.forEach(i=>n.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>n.style.transition=o,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const n={left:0,top:0},o=this.helper.style,i=this.dragOffset;o.left=(e.clientX+i.offsetLeft-n.left)*this.dragTransform.xScale+"px",o.top=(e.clientY+i.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,n,o){let i=0,r=0;o&&(i=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const a=n.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-i,offsetTop:-e.clientY+a.top-r,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const n=this.el.parentElement.getBoundingClientRect(),o=this.helper.getBoundingClientRect();return{position:{top:(o.top-n.top)*this.dragTransform.yScale,left:(o.left-n.left)*this.dragTransform.xScale}}}}$n.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class $y extends gr{constructor(e,n={}){super(),this.el=e,this.option=n,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Qe&&(this.el.addEventListener("pointerenter",gl),this.el.addEventListener("pointerleave",ml)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Qe&&(this.el.removeEventListener("pointerenter",gl),this.el.removeEventListener("pointerleave",ml)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this._setupAccept(),this}_mouseEnter(e){if(!he.dragElement||Ge.touchHandled&&e.isTrusted||!this._canDrop(he.dragElement.el))return;e.preventDefault(),e.stopPropagation(),he.dropElement&&he.dropElement!==this&&he.dropElement._mouseLeave(e,!0),he.dropElement=this;const n=q.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(n,this._ui(he.dragElement)),this.triggerEvent("dropover",n),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,n=!1){if(!he.dragElement||he.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const o=q.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(o,this._ui(he.dragElement)),this.triggerEvent("dropout",o),he.dropElement===this&&(delete he.dropElement,!n)){let i,r=this.el.parentElement;for(;!i&&r;)i=r.ddElement?.ddDroppable,r=r.parentElement;i&&i._mouseEnter(e)}}drop(e){e.preventDefault();const n=q.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(n,this._ui(he.dragElement)),this.triggerEvent("drop",n)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class mr{static init(e){return e.ddElement||(e.ddElement=new mr(e)),e.ddElement}constructor(e){this.el=e}on(e,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,n),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new $n(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Bn(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new $y(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class zy{resizable(e,n,o,i){return this._getDDElements(e,n).forEach(r=>{if(n==="disable"||n==="enable")r.ddResizable&&r.ddResizable[n]();else if(n==="destroy")r.ddResizable&&r.cleanResizable();else if(n==="option")r.setupResizable({[o]:i});else{const l=r.el.gridstackNode.grid;let u=r.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const c=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:u,autoHide:c,start:n.start,stop:n.stop,resize:n.resize})}}),this}draggable(e,n,o,i){return this._getDDElements(e,n).forEach(r=>{if(n==="disable"||n==="enable")r.ddDraggable&&r.ddDraggable[n]();else if(n==="destroy")r.ddDraggable&&r.cleanDraggable();else if(n==="option")r.setupDraggable({[o]:i});else{const a=r.el.gridstackNode.grid;r.setupDraggable({...a.opts.draggable,start:n.start,stop:n.stop,drag:n.drag})}}),this}dragIn(e,n){return this._getDDElements(e).forEach(o=>o.setupDraggable(n)),this}droppable(e,n,o,i){return typeof n.accept=="function"&&!n._accept&&(n._accept=n.accept,n.accept=r=>n._accept(r)),this._getDDElements(e,n).forEach(r=>{n==="disable"||n==="enable"?r.ddDroppable&&r.ddDroppable[n]():n==="destroy"?r.ddDroppable&&r.cleanDroppable():n==="option"?r.setupDroppable({[o]:i}):r.setupDroppable(n)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,n,o){return this._getDDElements(e).forEach(i=>i.on(n,r=>{o(r,he.dragElement?he.dragElement.el:r.target,he.dragElement?he.dragElement.helper:null)})),this}off(e,n){return this._getDDElements(e).forEach(o=>o.off(n)),this}_getDDElements(e,n){const o=e.gridstack||n!=="destroy"&&n!=="disable",i=q.getElements(e);return i.length?i.map(a=>a.ddElement||(o?mr.init(a):null)).filter(a=>a):[]}}const Pe=new zy;class fe{static init(e={},n=".grid-stack"){if(typeof document>"u")return null;const o=fe.getGridElement(n);return o?(o.gridstack||(o.gridstack=new fe(o,q.cloneDeep(e))),o.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
27
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},n=".grid-stack"){const o=[];return typeof document>"u"||(fe.getGridElements(n).forEach(i=>{i.gridstack||(i.gridstack=new fe(i,q.cloneDeep(e))),o.push(i.gridstack)}),o.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
28
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(e,n={}){if(!e)return null;let o=e;if(o.gridstack){const a=o.gridstack;return n&&(a.opts={...a.opts,...n}),n.children!==void 0&&a.load(n.children),a}return(!e.classList.contains("grid-stack")||fe.addRemoveCB)&&(fe.addRemoveCB?o=fe.addRemoveCB(e,n,!0,!0):o=q.createDiv(["grid-stack",n.class],e)),fe.init(n,o)}static registerEngine(e){fe.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=q.createDiv([this.opts.placeholderClass,je.itemClass,this.opts.itemClass]);const e=q.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,n={}){this.el=e,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=n=n||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const o=q.toNumber(e.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const i=n.columnOpts;if(i){const c=i.breakpoints;!i.columnWidth&&!c?.length?delete n.columnOpts:(i.columnMax=i.columnMax||12,c?.length>1&&c.sort((d,f)=>(f.w||0)-(d.w||0)))}const r={...q.cloneDeep(je),column:q.toNumber(e.getAttribute("gs-column"))||je.column,minRow:o||q.toNumber(e.getAttribute("gs-min-row"))||je.minRow,maxRow:o||q.toNumber(e.getAttribute("gs-max-row"))||je.maxRow,staticGrid:q.toBool(e.getAttribute("gs-static"))||je.staticGrid,sizeToContent:q.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||je.draggable.handle},removableOptions:{accept:n.itemClass||je.removableOptions.accept,decline:je.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=q.toBool(e.getAttribute("gs-animate"))),n=q.defaults(n,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=e.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const l=this.el.closest("."+je.itemClass)?.gridstackNode;if(l&&(l.subGrid=this,this.parentGridNode=l,this.el.classList.add("grid-stack-nested"),l.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==je.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const c=n.cellHeight;delete n.cellHeight,this.cellHeight(c)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=Qe),this._setStaticClass();const u=n.engineClass||fe.engineClass||mt;if(this.engine=new u({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:c=>{c.forEach(d=>{const f=d.el;f&&(d._removeDOM?(f&&f.remove(),delete d._removeDOM):this._writePosAttr(f,d))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const c=n.children;delete n.children,c.length&&this.load(c)}this.setAnimation(),n.subGridDynamic&&!he.pauseDrag&&(he.pauseDrag=!0),n.draggable?.pause!==void 0&&(he.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let n,o=e;if(o.grid=this,o.el?n=o.el:fe.addRemoveCB?n=fe.addRemoveCB(this.el,e,!0,!1):n=this.createWidgetDivs(o),!n)return;if(o=n.gridstackNode,o&&n.parentElement===this.el&&this.engine.nodes.find(r=>r._id===o._id))return n;const i=this._readAttr(n);return q.defaults(e,i),this.engine.prepareNode(e),this.el.appendChild(n),this.makeWidget(n,e),n}createWidgetDivs(e){const n=q.createDiv(["grid-stack-item",this.opts.itemClass]),o=q.createDiv(["grid-stack-item-content"],n);return q.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,fe.renderCB(o,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(n))):fe.renderCB(o,e),n}makeSubGrid(e,n,o,i=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;n=q.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...n||r.subGridOpts||{}}),r.subGridOpts=n;let u;n.column==="auto"&&(u=!0,n.column=Math.max(r.w||1,o?.w||1),delete n.columnOpts);let c=r.el.querySelector(".grid-stack-item-content"),d,f;if(i&&(this._removeDD(r.el),f={...r,x:0,y:0},q.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),fe.addRemoveCB?d=fe.addRemoveCB(this.el,f,!0,!1):(d=q.createDiv(["grid-stack-item"]),d.appendChild(c),c=q.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),o){const p=u?n.column:r.w,y=r.h+o.h,m=r.el.style;m.transition="none",this.update(r.el,{w:p,h:y}),setTimeout(()=>m.transition=null)}const h=r.subGrid=fe.addGrid(c,n);return o?._moving&&(h._isTemp=!0),u&&(h._autoColumn=!0),i&&h.makeWidget(d,f),o&&(o._moving?window.setTimeout(()=>q.simulateMouseEvent(o._event,"mouseenter",h.el),0):h.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),h}removeAsSubGrid(e){const n=this.parentGridNode?.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x+=this.parentGridNode.x,o.y+=this.parentGridNode.y,n.makeWidget(o.el,o)}),n.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>q.simulateMouseEvent(e._event,"mouseenter",n.el),0))}save(e=!0,n=!1,o=fe.saveCB,i){const r=this.engine.save(e,o,i);if(r.forEach(a=>{if(e&&a.el&&!a.subGrid&&!o){const l=a.el.querySelector(".grid-stack-item-content");a.content=l?.innerHTML,a.content||delete a.content}else if(!e&&!o&&delete a.content,a.subGrid?.el){const l=a.w||a.subGrid.getColumn(),u=a.subGrid.save(e,n,o,l);a.subGridOpts=n?u:{children:u},delete a.subGrid}delete a.el}),n){const a=q.cloneDeep(this.opts);a.marginBottom===a.marginTop&&a.marginRight===a.marginLeft&&a.marginTop===a.marginRight&&(a.margin=a.marginTop,delete a.marginTop,delete a.marginRight,delete a.marginBottom,delete a.marginLeft),a.rtl===(this.el.style.direction==="rtl")&&(a.rtl="auto"),this._isAutoCellHeight&&(a.cellHeight="auto"),this._autoColumn&&(a.column="auto");const l=a._alwaysShowResizeHandle;return delete a._alwaysShowResizeHandle,l!==void 0?a.alwaysShowResizeHandle=l:delete a.alwaysShowResizeHandle,q.removeInternalAndSame(a,je),a.children=r,a}return r}load(e,n=fe.addRemoveCB||!0){e=q.cloneDeep(e);const o=this.getColumn();e.forEach(d=>{d.w=d.w||d.minW||1,d.h=d.h||d.minH||1}),e=q.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let i=0;e.forEach(d=>{i=Math.max(i,(d.x||0)+d.w)}),i>this.engine.defaultColumn&&(this.engine.defaultColumn=i),i>o&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(i,o,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,i,!0));const r=fe.addRemoveCB;typeof n=="function"&&(fe.addRemoveCB=n);const a=[];this.batchUpdate();const l=!this.engine.nodes.length,u=l&&this.opts.animate;u&&this.setAnimation(!1),!l&&n&&[...this.engine.nodes].forEach(f=>{if(!f.id)return;q.find(e,f.id)||(fe.addRemoveCB&&fe.addRemoveCB(this.el,f,!1,!1),a.push(f),this.removeWidget(f.el,!0,!1))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(d=>q.find(e,d.id)?(c.push(d),!1):!0),e.forEach(d=>{const f=q.find(c,d.id);if(f){if(q.shouldSizeToContent(f)&&(d.h=f.h),this.engine.nodeBoundFix(d),(d.autoPosition||d.x===void 0||d.y===void 0)&&(d.w=d.w||f.w,d.h=d.h||f.h,this.engine.findEmptyPosition(d)),this.engine.nodes.push(f),q.samePos(f,d)&&this.engine.nodes.length>1&&(this.moveNode(f,{...d,forceCollide:!0}),q.copyPos(d,f)),this.update(f.el,d),d.subGridOpts?.children){const h=f.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(d.subGridOpts.children)}}else n&&this.addWidget(d)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?fe.addRemoveCB=r:delete fe.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const n=this.el.querySelector("."+this.opts.itemClass);if(n){const i=q.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/i)}const o=parseInt(this.el.getAttribute("gs-current-row"));return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+o}const n=q.parseHeight(e);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const n=this.getColumn();let o=n;const i=this._widthOrContainer(!0);if(e.columnWidth)o=Math.min(Math.round(i/e.columnWidth)||1,e.columnMax);else{o=e.columnMax;let r=0;for(;r<e.breakpoints.length&&i<=e.breakpoints[r].w;)o=e.breakpoints[r++].c||n}if(o!==n){const r=e.breakpoints?.find(a=>a.c===o);return this.column(o,r?.layout||e.layout),!0}return!1}compact(e="compact",n=!0){return this.engine.compact(e,n),this._triggerChangeEvent(),this}column(e,n="moveScale"){if(!e||e<1||this.opts.column===e)return this;const o=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,e,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,n=!1){const o=this.el.getBoundingClientRect();let i;n?i={top:o.top+document.documentElement.scrollTop,left:o.left}:i={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-i.left,a=e.top-i.top,l=o.width/this.getColumn(),u=o.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(a/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,n,o,i){return this.engine.isAreaEmpty(e,n,o,i)}makeWidget(e,n){const o=fe.getElement(e);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,n);const i=o.gridstackNode;this._updateContainerHeight(),i.subGridOpts&&this.makeSubGrid(o,i.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,o}on(e,n){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.on(i,n)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=i=>n(i):this._gsEventHandler[e]=i=>{i.detail&&n(i,i.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=n:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(o=>this.off(o)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,n=!0,o=!0){return e?(fe.getElements(e).forEach(i=>{if(i.parentElement&&i.parentElement!==this.el)return;let r=i.gridstackNode;r||(r=this.engine.nodes.find(a=>i===a.el)),r&&(n&&fe.addRemoveCB&&fe.addRemoveCB(this.el,r,!1,!1),delete i.gridstackNode,this._removeDD(i),this.engine.removeNode(r,n,o),n&&i.parentElement&&i.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,n=!0){return this.engine.nodes.forEach(o=>{e&&fe.addRemoveCB&&fe.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(e,n),n&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,n=!0,o=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&o&&i.subGrid.setStatic(e,n,o)}),n&&this._setStaticClass(),this)}updateOptions(e){const n=this.opts;return e===n?this:(e.acceptWidgets!==void 0&&(n.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==n.class&&(n.class&&this.el.classList.remove(n.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(n.minRow=n.maxRow=n.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(n.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(n.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(n.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this)}update(e,n){return fe.getElements(e).forEach(o=>{const i=o?.gridstackNode;if(!i)return;const r={...q.copyPos({},i),...q.cloneDeep(n)};this.engine.nodeBoundFix(r),delete r.autoPosition;const a=["x","y","w","h"];let l;if(a.some(d=>r[d]!==void 0&&r[d]!==i[d])&&(l={},a.forEach(d=>{l[d]=r[d]!==void 0?r[d]:i[d],delete r[d]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const d=o.querySelector(".grid-stack-item-content");d&&d.textContent!==r.content&&(i.content=r.content,fe.renderCB(d,r),i.subGrid?.el&&(d.appendChild(i.subGrid.el),i.subGrid._updateContainerHeight())),delete r.content}let u=!1,c=!1;for(const d in r)d[0]!=="_"&&i[d]!==r[d]&&(i[d]=r[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(q.sanitizeMinMax(i),l){const d=l.w!==void 0&&l.w!==i.w;this.moveNode(i,l),d&&i.subGrid?i.subGrid.onResize(this.hasAnimationCSS()?i.w:void 0):this.resizeToContentCheck(d,i),delete i._orig}(l||u)&&this._writeAttr(o,i),c&&this.prepareDragDrop(i.el),fe.updateCB&&fe.updateCB(i)}),this}moveNode(e,n){const o=e._updating;o||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,n),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const n=e.gridstackNode;if(!n)return;const o=n.grid;if(!o||e.parentElement!==o.el)return;const i=o.getCellHeight(!0);if(!i)return;let r=n.h?n.h*i:e.clientHeight,a;if(n.resizeToContentParent&&(a=e.querySelector(n.resizeToContentParent)),a||(a=e.querySelector(fe.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,u=n.h?n.h*i-l:a.clientHeight;let c;if(n.subGrid){c=n.subGrid.getRow()*n.subGrid.getCellHeight(!0);const h=n.subGrid.el.getBoundingClientRect(),p=e.getBoundingClientRect();c+=h.top-p.top}else{if(n.subGridOpts?.children?.length)return;{const h=a.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${n.id} '${fe.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=h.getBoundingClientRect().height||u}}if(u===c)return;r+=c-u;let d=Math.ceil(r/i);const f=Number.isInteger(n.sizeToContent)?n.sizeToContent:0;f&&d>f&&(d=f,e.classList.add("size-to-content-max")),n.minH&&d<n.minH?d=n.minH:n.maxH&&d>n.maxH&&(d=n.maxH),d!==n.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(n,{h:d}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){fe.resizeToContentCB?fe.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,n){return fe.getElements(e).forEach(o=>{const i=o.gridstackNode;if(!q.canBeRotated(i))return;const r={w:i.h,h:i.w,minH:i.minW,minW:i.minH,maxH:i.maxW,maxW:i.maxH};if(n){const l=n.left>0?Math.floor(n.left/this.cellWidth()):0,u=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;r.x=i.x+l-(i.h-(u+1)),r.y=i.y+u-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const a=i._orig;this.update(o,r),i._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const o=q.parseHeight(e);if(this.opts.marginUnit===o.unit&&this.opts.margin===o.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(n=>{delete n._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,n){const o=n?new CustomEvent(e,{bubbles:!1,detail:n}):new Event(e);let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;return i.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const o=this.opts.cellHeight,i=this.opts.cellHeightUnit;if(!o)return this;if(!e&&!this.opts.minRow){const r=q.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===i){const a=Math.floor(r.h/o);n<a&&(n=a)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[e?"minHeight":"height"]=n*o+i),e&&q.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,n=!1,o){o=o||this._readAttr(e),e.gridstackNode=o,o.el=e,o.grid=this,o=this.engine.addNode(o,n),this._writeAttr(e,o),e.classList.add(je.itemClass,this.opts.itemClass);const i=q.shouldSizeToContent(o);return i?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),i&&this.resizeToContentCheck(!1,o),q.lazyLoad(o)||this.prepareDragDrop(o.el),this}_writePosAttr(e,n){return(!n._moving&&!n._resizing||this._placeholder===e)&&(e.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,e.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,e.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,e.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),e.setAttribute("gs-x",String(n.x)),e.setAttribute("gs-y",String(n.y)),n.w>1?e.setAttribute("gs-w",String(n.w)):e.removeAttribute("gs-w"),n.h>1?e.setAttribute("gs-h",String(n.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,n){if(!n)return this;this._writePosAttr(e,n);const o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const i in o)n[i]?e.setAttribute(o[i],String(n[i])):e.removeAttribute(o[i]);return this}_readAttr(e,n=!0){const o={};o.x=q.toNumber(e.getAttribute("gs-x")),o.y=q.toNumber(e.getAttribute("gs-y")),o.w=q.toNumber(e.getAttribute("gs-w")),o.h=q.toNumber(e.getAttribute("gs-h")),o.autoPosition=q.toBool(e.getAttribute("gs-auto-position")),o.noResize=q.toBool(e.getAttribute("gs-no-resize")),o.noMove=q.toBool(e.getAttribute("gs-no-move")),o.locked=q.toBool(e.getAttribute("gs-locked"));const i=e.getAttribute("gs-size-to-content");i&&(i==="true"||i==="false"?o.sizeToContent=q.toBool(i):o.sizeToContent=parseInt(i,10)),o.id=e.getAttribute("gs-id"),o.maxW=q.toNumber(e.getAttribute("gs-max-w")),o.minW=q.toNumber(e.getAttribute("gs-min-w")),o.maxH=q.toNumber(e.getAttribute("gs-max-h")),o.minH=q.toNumber(e.getAttribute("gs-min-h")),n&&(o.w===1&&e.removeAttribute("gs-w"),o.h===1&&e.removeAttribute("gs-h"),o.maxW&&e.removeAttribute("gs-max-w"),o.minW&&e.removeAttribute("gs-min-w"),o.maxH&&e.removeAttribute("gs-max-h"),o.minH&&e.removeAttribute("gs-min-h"));for(const r in o){if(!o.hasOwnProperty(r))return;!o[r]&&o[r]!==0&&r!=="sizeToContent"&&delete o[r]}return o}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,n=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)q.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(o=>q.shouldSizeToContent(o))){const o=[...this.engine.nodes];this.batchUpdate(),o.forEach(i=>{q.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(e=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!e&&n&&!this.resizeObserver?(this._sizeThrottle=q.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return q.getElement(e)}static getElements(e=".grid-stack-item"){return q.getElements(e)}static getGridElement(e){return fe.getElement(e)}static getGridElements(e){return q.getElements(e)}_initMargin(){let e,n=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(e=q.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,n=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(a=>{this.opts[a]===void 0?this.opts[a]=n:(e=q.parseHeight(this.opts[a]),this.opts[a]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const r=this.el.style;return r.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Pe}static setupDragIn(e,n,o,i=document){n?.pause!==void 0&&(he.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof e=="string"?q.getElements(e,i):e).forEach((a,l)=>{Pe.isDraggable(a)||Pe.dragIn(a,n),o?.[l]&&(a.gridstackNode=o[l])})}movable(e,n){return this.opts.staticGrid?this:(fe.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noMove:i.noMove=!0,this.prepareDragDrop(i.el))}),this)}resizable(e,n){return this.opts.staticGrid?this:(fe.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noResize:i.noResize=!0,this.prepareDragDrop(i.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableMove(e,n)}),this)}enableResize(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableResize(e,n)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&fe._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Pe.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Pe.droppable(this.el,"destroy"),this;let e,n;const o=(i,r,a)=>{a=a||r;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const h=a.getBoundingClientRect();a.style.left=h.x+(this.dragTransform.xScale-1)*(i.clientX-h.x)/this.dragTransform.xScale+"px",a.style.top=h.y+(this.dragTransform.yScale-1)*(i.clientY-h.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:u,left:c}=a.getBoundingClientRect();const d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;const f={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/n)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Pe.off(r,"drag");return}l._willFitPos&&(q.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,i,f,l,n,e)}else this._dragOrResize(a,i,f,l,n,e)};return Pe.droppable(this.el,{accept:i=>{const r=i.gridstackNode||this._readAttr(i,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(i);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=i.matches(l)}if(a&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(i,r,a)=>{let l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,a),a=a||r,n=this.cellWidth(),e=this.getCellHeight(!0),!l){const d=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(d){try{l=JSON.parse(d)}catch{console.error("Gridstack dropover: Bad JSON format: ",d)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const u=l.w||Math.round(a.offsetWidth/n)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:u,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=c,l._temporaryRemoved=!0),fe._itemRemoving(l.el,!1),Pe.on(r,"drag",o),o(i,r,a),!1}).on(this.el,"dropout",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,c=r!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const d=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&d?.grid&&d.grid!==this){const h=d.grid;h.engine.removeNodeFromLayoutCache(d),h.engine.removedNodes.push(d),h._triggerRemoveEvent()._triggerChangeEvent(),h.parentGridNode&&!h.engine.nodes.length&&h.opts.subGridDynamic&&h.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Pe.off(r,"drag"),a!==r?(a.remove(),r=a):r.remove(),this._removeDD(r),!u))return!1;const f=l.subGrid?.el?.gridstack;return q.copyPos(l,this._readAttr(this.placeholder)),q.removePositioningStyles(r),c&&(l.content||l.subGridOpts||fe.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...i,type:"dropped"},d&&d.grid?d:void 0,l),!1}),this}static _itemRemoving(e,n){if(!e)return;const o=e?e.gridstackNode:void 0;!o?.grid||e.classList.contains(o.grid.opts.removableOptions.decline)||(n?o._isAboutToRemove=!0:delete o._isAboutToRemove,n?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Pe.isDroppable(e)&&Pe.droppable(e,this.opts.removableOptions).on(e,"dropover",(n,o)=>fe._itemRemoving(o,!0)).on(e,"dropout",(n,o)=>fe._itemRemoving(o,!1)),this):this}prepareDragDrop(e,n=!1){const o=e?.gridstackNode;if(!o)return;const i=o.noMove||this.opts.disableDrag,r=o.noResize||this.opts.disableResize,a=this.opts.staticGrid||i&&r;if((n||a)&&(o._initDD&&(this._removeDD(e),delete o._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!o._initDD){let l,u;const c=(h,p)=>{this.triggerEvent(h,h.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,h,p,o,l,u)},d=(h,p)=>{this._dragOrResize(e,h,p,o,l,u)},f=h=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;const p=o.w!==o._orig.w,y=h.target;if(!(!y.gridstackNode||y.gridstackNode.grid!==this)){if(o.el=y,o._isAboutToRemove){const m=e.gridstackNode.grid;m._gsEventHandler[h.type]&&m._gsEventHandler[h.type](h,y),m.engine.nodes.push(o),m.removeWidget(e,!0,!0)}else q.removePositioningStyles(y),o._temporaryRemoved?(this._writePosAttr(y,o),this.engine.addNode(o)):this._writePosAttr(y,o),this.triggerEvent(h,y);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),h.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(p,o))}};Pe.draggable(e,{start:c,stop:f,drag:d}).resizable(e,{start:c,stop:f,resize:d}),o._initDD=!0}return Pe.draggable(e,i?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,n,o,i,r,a){if(this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=i,i.grid?.el)this.dragTransform=q.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=q.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(i.el=this.placeholder,i._lastUiPosition=o.position,i._prevYPix=o.position.top,i._moving=n.type==="dragstart",i._resizing=n.type==="resizestart",delete i._lastTried,n.type==="dropover"&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const l=this.getColumn()-i.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-i.y;Pe.resizable(e,"option","minWidth",r*Math.min(i.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(i.minH||1,u)).resizable(e,"option","maxWidth",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,i.x+i.w)).resizable(e,"option","maxHeight",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,i.y+i.h))}}_dragOrResize(e,n,o,i,r,a){const l={...i._orig};let u,c=this.opts.marginLeft,d=this.opts.marginRight,f=this.opts.marginTop,h=this.opts.marginBottom;const p=Math.round(a*.1),y=Math.round(r*.1);if(c=Math.min(c,y),d=Math.min(d,y),f=Math.min(f,p),h=Math.min(h,p),n.type==="drag"){if(i._temporaryRemoved)return;const b=o.position.top-i._prevYPix;i._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&q.updateScrollPosition(e,o.position,b);const T=o.position.left+(o.position.left>i._lastUiPosition.left?-d:c),x=o.position.top+(o.position.top>i._lastUiPosition.top?-h:f);l.x=Math.round(T/r),l.y=Math.round(x/a);const g=this._extraDragRow;if(this.engine.collide(i,l)){const C=this.getRow();let A=Math.max(0,l.y+i.h-C);this.opts.maxRow&&C+A>this.opts.maxRow&&(A=Math.max(0,this.opts.maxRow-C)),this._extraDragRow=A}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if(n.type==="resize"){if(l.x<0||(q.updateScrollResize(n,e,a),l.w=Math.round((o.size.width-c)/r),l.h=Math.round((o.size.height-f)/a),i.w===l.w&&i.h===l.h)||i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;const b=o.position.left+c,T=o.position.top+f;l.x=Math.round(b/r),l.y=Math.round(T/a),u=!0}i._event=n,i._lastTried=l;const m={x:o.position.left+c,y:o.position.top+f,w:(o.size?o.size.width:i.w*r)-c-d,h:(o.size?o.size.height:i.h*a)-f-h};if(this.engine.moveNodeCheck(i,{...l,cellWidth:r,cellHeight:a,rect:m,resizing:u})){i._lastUiPosition=o.position,this.engine.cacheRects(r,a,f,d,h,c),delete i._skipDown,u&&i.subGrid&&i.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const b=n.target;i._sidebarOrig||this._writePosAttr(b,i),this.triggerEvent(n,b)}}triggerEvent(e,n){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[e.type]&&o._gsEventHandler[e.type](e,n)}_leave(e,n){n=n||e;const o=n.gridstackNode;if(!o||(n.style.transform=n.style.transformOrigin=null,Pe.off(e,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&n?n:e;const i=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=i,this.opts.removable===!0&&fe._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}}fe.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)},fe.resizeToContentParent=".grid-stack-item-content",fe.Utils=q,fe.Engine=mt,fe.GDRev="12.4.2";const Ay={class:"d-layout"},Py=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-locked","gs-no-resize","gs-no-move","gs-min-w","gs-min-h","gs-max-w","gs-max-h"],yl=Dt(s.defineComponent({name:"DLayout",__name:"layout",props:{modelValue:{default:()=>[]},column:{default:24},cellHeight:{default:60},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},float:{type:Boolean,default:!0},removable:{type:Boolean,default:!1},removableOptions:{}},emits:["update:modelValue","added","removed","changed","dragStart","dragStop","resizeStart","resizeStop"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=s.ref();let a=null;const l=async()=>{r.value&&(await s.nextTick(),a&&a.destroy(!1),a=fe.init({column:o.column,cellHeight:o.cellHeight,disableDrag:!(o.draggable&&!o.disable),disableResize:!(o.resizable&&!o.disable),animate:o.animate,float:o.float,removable:o.removable,removableOptions:o.removableOptions},r.value),a.on("added",(h,p)=>{const y=p[0];if(y){const m=u(y);i("added",m),d()}}),a.on("removed",(h,p)=>{const y=p[0];if(y){const m=u(y);i("removed",m),d()}}),a.on("change",()=>{d();const p=(a?.save()||[]).map(y=>u(y));i("changed",p)}),a.on("dragstart",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("dragStart",h,m)}}),a.on("dragstop",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("dragStop",h,m)}}),a.on("resizestart",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("resizeStart",h,m)}}),a.on("resizestop",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("resizeStop",h,m)}}))},u=h=>({id:h.id||h.el?.getAttribute("gs-id")||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1,locked:h.locked||!1,noResize:h.noResize||!1,noMove:h.noMove||!1,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}),c=async()=>{if(!a||!r.value)return;await s.nextTick();const h=a.engine.nodes;new Set(h.map(y=>y.id));const p=new Set(o.modelValue.map(y=>y.id));h.forEach(y=>{if(!p.has(y.id||"")){const m=y.el;m&&a&&a.removeWidget(m,!1)}}),o.modelValue.forEach(y=>{const m=h.find(b=>b.id===y.id);if(m)m.el&&a&&a.update(m.el,{x:y.x,y:y.y,w:y.w,h:y.h,locked:y.locked,noResize:y.noResize,noMove:y.noMove,minW:y.minW,minH:y.minH,maxW:y.maxW,maxH:y.maxH});else{if(!r.value||!a)return;const b=r.value.querySelector(`[gs-id="${y.id}"]`);b&&a.makeWidget(b)}})},d=()=>{if(!a)return;const p=a.save().map(y=>{const m={id:y.id||"",x:y.x||0,y:y.y||0,w:y.w||1,h:y.h||1},b=o.modelValue.find(T=>T.id===m.id);return b&&Object.keys(b).forEach(T=>{["id","x","y","w","h"].includes(T)||(m[T]=b[T])}),m});i("update:modelValue",p)},f=s.computed(()=>o.modelValue);return s.watch(()=>o.modelValue,async()=>{a&&(await s.nextTick(),c())},{deep:!0}),s.watch(()=>[o.column,o.cellHeight,o.draggable,o.resizable,o.disable,o.animate,o.float,o.removable],()=>{l()}),s.onMounted(()=>{l()}),s.onBeforeUnmount(()=>{a&&(a.destroy(!1),a=null)}),e({addItem:async h=>{if(a&&r.value){await s.nextTick();const p=r.value.querySelector(`[gs-id="${h.id}"]`);p&&(a.makeWidget(p),a.update(p,{x:h.x,y:h.y,w:h.w,h:h.h,locked:h.locked,noResize:h.noResize,noMove:h.noMove,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}))}},removeItem:h=>{if(a&&r.value){const p=r.value.querySelector(`[gs-id="${h}"]`);p&&a.removeWidget(p,!1)}},clear:()=>{a&&a.removeAll(!1)},getGrid:()=>a}),(h,p)=>(s.openBlock(),s.createElementBlock("div",Ay,[s.createElementVNode("div",{ref_key:"gridContainerRef",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.value,y=>(s.openBlock(),s.createElementBlock("div",{key:y.id,"gs-id":y.id,"gs-x":y.x,"gs-y":y.y,"gs-w":y.w,"gs-h":y.h,"gs-locked":y.locked,"gs-no-resize":y.noResize,"gs-no-move":y.noMove,"gs-min-w":y.minW,"gs-min-h":y.minH,"gs-max-w":y.maxW,"gs-max-h":y.maxH,class:"d-layout-item"},[s.renderSlot(h.$slots,"item",{item:y})],8,Py))),128))],512)]))}})),Be=(t,e="",n=!1)=>n?`${t}pt`:e?`${t}${e}`:`${t}px`,He=(t,e=0)=>t==null||isNaN(t)?0:Number(Number(t).toFixed(e)),Oy=t=>t*3/4,Ry=t=>t*4/3,Hy=["onMousedown"],Vy={key:2,class:"d-draggable__mask"},vl=Dt(s.defineComponent({name:"DDraggable",__name:"draggable",props:{index:{},mask:{type:Boolean,default:!0},scale:{default:1},readonly:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},step:{default:1},zIndex:{default:1},isActiveBgTransparent:{type:Boolean,default:!1},left:{default:0},top:{default:0},width:{},height:{},activeFlag:{type:Boolean,default:!1},isPt:{type:Boolean,default:!1}},emits:["focus","blur","over","out"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=s.ref(),a=s.ref(),l=s.ref(0),u=s.ref(0),c=s.ref(0),d=s.ref(0),f=s.ref(null),h=s.ref(!1),p=s.ref(!1),y=s.ref(!1),m=s.ref(!1),b=s.ref([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),T=s.computed(()=>o.scale),x=s.computed(()=>({left:Be(T.value,"",o.isPt)})),g=s.computed(()=>({left:Be(-T.value,"",o.isPt)})),C=s.computed(()=>({left:"auto",right:Be(-T.value,"",o.isPt)})),A=s.computed(()=>({top:Be(-T.value,"",o.isPt)})),z=s.computed(()=>({top:"auto",bottom:Be(-T.value,"",o.isPt)})),j=s.computed(()=>{const X=8*T.value;return{width:Be(X,"",o.isPt),height:Be(X,"",o.isPt)}}),Y=s.computed(()=>({fontSize:Be(16*T.value,"",o.isPt)})),W=s.computed(()=>Object.assign((()=>{if(m.value){const X={zIndex:9999,...x.value};return o.isActiveBgTransparent&&(m.value||p.value)&&!o.readonly&&!o.disabled&&(X.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),X}return{zIndex:o.zIndex}})(),{top:Be(d.value,"",o.isPt),width:Be(l.value,"",o.isPt),height:Be(u.value,"",o.isPt),padding:Be(8*T.value,"",o.isPt),...x.value,left:Be(c.value,"",o.isPt)}));s.watch(()=>o.width,X=>{l.value=He(B(X))||(f.value?.offsetWidth??0)}),s.watch(()=>o.height,X=>{u.value=He(B(X))||(f.value?.offsetHeight??0)},{deep:!0}),s.watch(()=>o.left,X=>{c.value=He(B(X))}),s.watch(()=>o.top,X=>{d.value=He(B(X))}),s.watch(l,X=>{r.value&&(r.value.style.width=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.width=Be(X,"",o.isPt)))}),s.watch(u,X=>{r.value&&(r.value.style.height=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.height=Be(X,"",o.isPt)))}),s.watch(()=>o.activeFlag,X=>{D(X)});const D=X=>{m.value=X},B=X=>X===void 0?0:o.isPt?Ry(X):X,k=()=>{a.value&&a.value.firstChild&&(f.value=a.value.firstChild,l.value=He(B(o.width))||(f.value?.offsetWidth??0),u.value=He(B(o.height))||(f.value?.offsetHeight??0),c.value=He(B(o.left)),d.value=He(B(o.top)),D(o.activeFlag))},V=X=>{c.value=X},_=X=>{d.value=X},M=X=>{const Z=8*T.value/2,U={};return X.split("-").forEach(te=>{U[te]=Be(-Z,"",o.isPt)}),U},v=X=>{p.value=X},S=X=>o.isPt?Oy(X):X,I=()=>{h.value=!0,i("focus",{index:o.index,width:S(l.value),height:S(u.value),left:S(c.value),top:S(d.value)})},P=()=>{h.value=!1,y.value=!1,i("blur",{index:o.index,width:S(l.value),height:S(u.value),left:S(c.value),top:S(d.value)})},H=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,P()}},$=(X,Z)=>{if(o.disabled||o.readonly)return;let U,J,te,Q,le,ee;y.value=!0,I();let K=X.clientX,E=X.clientY;document.onmousemove=w=>{h.value=!0,Z==="right"?(U=!0,J=!1):Z==="left"?(U=!0,te=!0,le=!0,J=!1):Z==="top"?(U=!1,J=!0,Q=!0,ee=!0):Z==="bottom"?(U=!1,J=!0):Z==="bottom-right"?(U=!0,J=!0):Z==="bottom-left"?(U=!0,J=!0,te=!0,le=!0):Z==="top-right"?(U=!0,J=!0,Q=!0,ee=!0):Z==="top-left"&&(U=!0,J=!0,te=!0,le=!0,Q=!0,ee=!0);const N=w.clientX-K,L=w.clientY-E;if(K=w.clientX,E=w.clientY,U){let R=N*o.step;le&&(R=-R),te&&(c.value=He(c.value-R)),l.value=He(l.value+R)}if(J){let R=L*o.step;ee&&(R=-R),Q&&(d.value=He(d.value-R)),u.value=He(u.value+R)}},H()},O=()=>{p.value=!1,i("out",{index:o.index,width:S(l.value),height:S(u.value),left:S(c.value),top:S(d.value)})},F=()=>{o.disabled||o.readonly||(p.value=!0,i("over",{index:o.index,width:S(l.value),height:S(u.value),left:S(c.value),top:S(d.value)}))},G=X=>{if(o.disabled||o.readonly)return;m.value=!0,I();let Z=X.clientX,U=X.clientY;document.onmousemove=J=>{const te=J.clientX-Z,Q=J.clientY-U;Z=J.clientX,U=J.clientY,c.value=He(c.value+te*o.step),d.value=He(d.value+Q*o.step)},H()};return s.onMounted(()=>{k()}),e({setActive:D,setLeft:V,setTop:_,setOverActive:v}),(X,Z)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["d-draggable",{"d-draggable--active":(m.value||p.value)&&!t.readonly&&!t.disabled},{"d-draggable--pt":t.isPt&&!t.readonly&&!t.disabled},{"d-draggable--move":h.value},{"d-draggable--click":t.disabled}]),onMousedown:s.withModifiers(G,["stop"]),onMouseover:s.withModifiers(F,["stop"]),onMouseout:s.withModifiers(O,["stop"]),style:s.normalizeStyle(W.value)},[s.createElementVNode("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:r},[(m.value||p.value||h.value)&&!t.readonly&&!t.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...A.value}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...g.value}),class:"d-draggable__line d-draggable__line--top"},null,4),t.isPt?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...A.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...g.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...z.value}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...C.value}),class:"d-draggable__line d-draggable__line--top"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...z.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({...x.value,...C.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):(s.openBlock(),s.createElementBlock("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:s.normalizeStyle(Y.value)},s.toDisplayString(c.value)+","+s.toDisplayString(d.value),5))],64)):s.createCommentVNode("",!0),!t.readonly&&!t.disabled?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(b.value,(U,J)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:J},[m.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["d-draggable__range",`d-draggable__range--${U.classname}`]),style:s.normalizeStyle([j.value,M(U.classname)]),onMousedown:s.withModifiers(te=>$(te,U.classname),["stop"])},null,46,Hy)):s.createCommentVNode("",!0)],64))),128)):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"d-draggable__item",ref_key:"item",ref:a},[s.renderSlot(X.$slots,"default")],512),!t.disabled&&t.mask?(s.openBlock(),s.createElementBlock("div",Vy)):s.createCommentVNode("",!0)],512)],38))}})),Ly=t=>{const e=Fy(t.components);return{formConfig:t.form,componentList:e}},bl=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.form;const a={};r.components.forEach(l=>{const u=e[l.type];a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:u?.dragType||"component",componentName:u?.componentName||"",runtimeType:u?.runtimeType,groupId:l.groupId,config:l.config,isInput:u?.isInput!==!1,containerId:l.containerId,level:l.level};u?.dragType==="container"&&(c.children=[]),i[c.id]=c,a[l.containerId].push(c)}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.form||[]}return{formConfig:n,componentList:o,componentDic:i}},yr=(t,e)=>{const n={ver:"V3",form:{...t},components:[],db:{}};return _l(e||[],n.components),n},_l=(t,e)=>{t.forEach(n=>{if(n.type==="pkey")return;const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};if(n.dragType==="container"){const i=n.children||[];_l(i,e)}e.push(o)})},Fy=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{rule:[]}};o.config&&Object.keys(o.config).forEach(r=>{if(r==="required"){o.config.required&&i.config?.rule?.push({required:!0,message:o.config.requiredMsg||"请输入"});return}if(r==="patterns"){o.config.patterns.forEach(a=>{a.reg&&a.msg&&i.config?.rule?.push({pattern:new RegExp(a.reg),message:`请输入${a.msg||""}`})});return}i.config[r]=o.config[r]}),o.type==="pkey"&&(i.config.isPkey=!0),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{const i=n[o];if(i){const r=e[o];if(["j-tabs","j-collapse"].includes(i.type||"")&&i.config?.groups){const a={};r.forEach(u=>{if(u.slot!==void 0&&u.slot!==null){const c=u.slot.toString();a[c]||(a[c]=[]),delete u.slot,a[c].push(u)}});const l=i.config.groups.map(u=>{const c=u._i,d=a[c]||[],f={label:u.label};u.active&&i.type==="j-collapse"&&(f.active=u.active);let h;if(i.type==="j-tabs"&&i.config?.tabKey&&i.config?.options.length>0){const y=i.config.options.find(m=>m.label===u._i);y&&(h=({formData:m})=>({display:y.value.includes(m[i.config?.tabKey||""])?y.display:!y.display}))}const p={config:f,children:d};return h&&(p.getCompConfig=h),p});i.children=l,delete i.config.groups}else i.children=r}}),e.form};function jy(t){const{toString:e}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&t instanceof Element?"element":n[e.call(t)]}function vr(t){const e=jy(t);let n;if(e==="array")n=[];else if(e==="object")n={};else return t;if(e==="array")for(let o=0,i=t.length;o<i;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,n.push(vr(t[o]));else e==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,n[o]=vr(t[o])});return n}var br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Gy(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function o(){var i=!1;try{i=this instanceof o}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:function(){return t[o]}})}),n}var Ho={exports:{}},Wy=Ho.exports,xl;function Yy(){return xl||(xl=1,(function(t,e){(function(n,o){t.exports=o()})(Wy,(function(){var n=1e3,o=6e4,i=36e5,r="millisecond",a="second",l="minute",u="hour",c="day",d="week",f="month",h="quarter",p="year",y="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var M=["th","st","nd","rd"],v=_%100;return"["+_+(M[(v-20)%10]||M[v]||M[0])+"]"}},g=function(_,M,v){var S=String(_);return!S||S.length>=M?_:""+Array(M+1-S.length).join(v)+_},C={s:g,z:function(_){var M=-_.utcOffset(),v=Math.abs(M),S=Math.floor(v/60),I=v%60;return(M<=0?"+":"-")+g(S,2,"0")+":"+g(I,2,"0")},m:function _(M,v){if(M.date()<v.date())return-_(v,M);var S=12*(v.year()-M.year())+(v.month()-M.month()),I=M.clone().add(S,f),P=v-I<0,H=M.clone().add(S+(P?-1:1),f);return+(-(S+(v-I)/(P?I-H:H-I))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:f,y:p,w:d,d:c,D:y,h:u,m:l,s:a,ms:r,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},A="en",z={};z[A]=x;var j="$isDayjsObject",Y=function(_){return _ instanceof k||!(!_||!_[j])},W=function _(M,v,S){var I;if(!M)return A;if(typeof M=="string"){var P=M.toLowerCase();z[P]&&(I=P),v&&(z[P]=v,I=P);var H=M.split("-");if(!I&&H.length>1)return _(H[0])}else{var $=M.name;z[$]=M,I=$}return!S&&I&&(A=I),I||!S&&A},D=function(_,M){if(Y(_))return _.clone();var v=typeof M=="object"?M:{};return v.date=_,v.args=arguments,new k(v)},B=C;B.l=W,B.i=Y,B.w=function(_,M){return D(_,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var k=(function(){function _(v){this.$L=W(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[j]=!0}var M=_.prototype;return M.parse=function(v){this.$d=(function(S){var I=S.date,P=S.utc;if(I===null)return new Date(NaN);if(B.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var H=I.match(b);if(H){var $=H[2]-1||0,O=(H[7]||"0").substring(0,3);return P?new Date(Date.UTC(H[1],$,H[3]||1,H[4]||0,H[5]||0,H[6]||0,O)):new Date(H[1],$,H[3]||1,H[4]||0,H[5]||0,H[6]||0,O)}}return new Date(I)})(v),this.init()},M.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},M.$utils=function(){return B},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(v,S){var I=D(v);return this.startOf(S)<=I&&I<=this.endOf(S)},M.isAfter=function(v,S){return D(v)<this.startOf(S)},M.isBefore=function(v,S){return this.endOf(S)<D(v)},M.$g=function(v,S,I){return B.u(v)?this[S]:this.set(I,v)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(v,S){var I=this,P=!!B.u(S)||S,H=B.p(v),$=function(te,Q){var le=B.w(I.$u?Date.UTC(I.$y,Q,te):new Date(I.$y,Q,te),I);return P?le:le.endOf(c)},O=function(te,Q){return B.w(I.toDate()[te].apply(I.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(Q)),I)},F=this.$W,G=this.$M,X=this.$D,Z="set"+(this.$u?"UTC":"");switch(H){case p:return P?$(1,0):$(31,11);case f:return P?$(1,G):$(0,G+1);case d:var U=this.$locale().weekStart||0,J=(F<U?F+7:F)-U;return $(P?X-J:X+(6-J),G);case c:case y:return O(Z+"Hours",0);case u:return O(Z+"Minutes",1);case l:return O(Z+"Seconds",2);case a:return O(Z+"Milliseconds",3);default:return this.clone()}},M.endOf=function(v){return this.startOf(v,!1)},M.$set=function(v,S){var I,P=B.p(v),H="set"+(this.$u?"UTC":""),$=(I={},I[c]=H+"Date",I[y]=H+"Date",I[f]=H+"Month",I[p]=H+"FullYear",I[u]=H+"Hours",I[l]=H+"Minutes",I[a]=H+"Seconds",I[r]=H+"Milliseconds",I)[P],O=P===c?this.$D+(S-this.$W):S;if(P===f||P===p){var F=this.clone().set(y,1);F.$d[$](O),F.init(),this.$d=F.set(y,Math.min(this.$D,F.daysInMonth())).$d}else $&&this.$d[$](O);return this.init(),this},M.set=function(v,S){return this.clone().$set(v,S)},M.get=function(v){return this[B.p(v)]()},M.add=function(v,S){var I,P=this;v=Number(v);var H=B.p(S),$=function(G){var X=D(P);return B.w(X.date(X.date()+Math.round(G*v)),P)};if(H===f)return this.set(f,this.$M+v);if(H===p)return this.set(p,this.$y+v);if(H===c)return $(1);if(H===d)return $(7);var O=(I={},I[l]=o,I[u]=i,I[a]=n,I)[H]||1,F=this.$d.getTime()+v*O;return B.w(F,this)},M.subtract=function(v,S){return this.add(-1*v,S)},M.format=function(v){var S=this,I=this.$locale();if(!this.isValid())return I.invalidDate||m;var P=v||"YYYY-MM-DDTHH:mm:ssZ",H=B.z(this),$=this.$H,O=this.$m,F=this.$M,G=I.weekdays,X=I.months,Z=I.meridiem,U=function(Q,le,ee,K){return Q&&(Q[le]||Q(S,P))||ee[le].slice(0,K)},J=function(Q){return B.s($%12||12,Q,"0")},te=Z||function(Q,le,ee){var K=Q<12?"AM":"PM";return ee?K.toLowerCase():K};return P.replace(T,(function(Q,le){return le||(function(ee){switch(ee){case"YY":return String(S.$y).slice(-2);case"YYYY":return B.s(S.$y,4,"0");case"M":return F+1;case"MM":return B.s(F+1,2,"0");case"MMM":return U(I.monthsShort,F,X,3);case"MMMM":return U(X,F);case"D":return S.$D;case"DD":return B.s(S.$D,2,"0");case"d":return String(S.$W);case"dd":return U(I.weekdaysMin,S.$W,G,2);case"ddd":return U(I.weekdaysShort,S.$W,G,3);case"dddd":return G[S.$W];case"H":return String($);case"HH":return B.s($,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return te($,O,!0);case"A":return te($,O,!1);case"m":return String(O);case"mm":return B.s(O,2,"0");case"s":return String(S.$s);case"ss":return B.s(S.$s,2,"0");case"SSS":return B.s(S.$ms,3,"0");case"Z":return H}return null})(Q)||H.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(v,S,I){var P,H=this,$=B.p(S),O=D(v),F=(O.utcOffset()-this.utcOffset())*o,G=this-O,X=function(){return B.m(H,O)};switch($){case p:P=X()/12;break;case f:P=X();break;case h:P=X()/3;break;case d:P=(G-F)/6048e5;break;case c:P=(G-F)/864e5;break;case u:P=G/i;break;case l:P=G/o;break;case a:P=G/n;break;default:P=G}return I?P:B.a(P)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return z[this.$L]},M.locale=function(v,S){if(!v)return this.$L;var I=this.clone(),P=W(v,S,!0);return P&&(I.$L=P),I},M.clone=function(){return B.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},_})(),V=k.prototype;return D.prototype=V,[["$ms",r],["$s",a],["$m",l],["$H",u],["$W",c],["$M",f],["$y",p],["$D",y]].forEach((function(_){V[_[1]]=function(M){return this.$g(M,_[0],_[1])}})),D.extend=function(_,M){return _.$i||(_(M,k,D),_.$i=!0),D},D.locale=W,D.isDayjs=Y,D.unix=function(_){return D(1e3*_)},D.en=z[A],D.Ls=z,D.p={},D}))})(Ho)),Ho.exports}Yy();var Vo={exports:{}};function Uy(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Lo={exports:{}};const Xy=Gy(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var qy=Lo.exports,Cl;function Xe(){return Cl||(Cl=1,(function(t,e){(function(n,o){t.exports=o()})(qy,function(){var n=n||(function(o,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof br<"u"&&br.crypto&&(r=br.crypto),!r&&typeof Uy=="function")try{r=Xy}catch{}var a=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||(function(){function x(){}return function(g){var C;return x.prototype=g,C=new x,x.prototype=null,C}})(),u={},c=u.lib={},d=c.Base=(function(){return{extend:function(x){var g=l(this);return x&&g.mixIn(x),(!g.hasOwnProperty("init")||this.init===g.init)&&(g.init=function(){g.$super.init.apply(this,arguments)}),g.init.prototype=g,g.$super=this,g},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var g in x)x.hasOwnProperty(g)&&(this[g]=x[g]);x.hasOwnProperty("toString")&&(this.toString=x.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=d.extend({init:function(x,g){x=this.words=x||[],g!=i?this.sigBytes=g:this.sigBytes=x.length*4},toString:function(x){return(x||p).stringify(this)},concat:function(x){var g=this.words,C=x.words,A=this.sigBytes,z=x.sigBytes;if(this.clamp(),A%4)for(var j=0;j<z;j++){var Y=C[j>>>2]>>>24-j%4*8&255;g[A+j>>>2]|=Y<<24-(A+j)%4*8}else for(var W=0;W<z;W+=4)g[A+W>>>2]=C[W>>>2];return this.sigBytes+=z,this},clamp:function(){var x=this.words,g=this.sigBytes;x[g>>>2]&=4294967295<<32-g%4*8,x.length=o.ceil(g/4)},clone:function(){var x=d.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var g=[],C=0;C<x;C+=4)g.push(a());return new f.init(g,x)}}),h=u.enc={},p=h.Hex={stringify:function(x){for(var g=x.words,C=x.sigBytes,A=[],z=0;z<C;z++){var j=g[z>>>2]>>>24-z%4*8&255;A.push((j>>>4).toString(16)),A.push((j&15).toString(16))}return A.join("")},parse:function(x){for(var g=x.length,C=[],A=0;A<g;A+=2)C[A>>>3]|=parseInt(x.substr(A,2),16)<<24-A%8*4;return new f.init(C,g/2)}},y=h.Latin1={stringify:function(x){for(var g=x.words,C=x.sigBytes,A=[],z=0;z<C;z++){var j=g[z>>>2]>>>24-z%4*8&255;A.push(String.fromCharCode(j))}return A.join("")},parse:function(x){for(var g=x.length,C=[],A=0;A<g;A++)C[A>>>2]|=(x.charCodeAt(A)&255)<<24-A%4*8;return new f.init(C,g)}},m=h.Utf8={stringify:function(x){try{return decodeURIComponent(escape(y.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return y.parse(unescape(encodeURIComponent(x)))}},b=c.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(x){typeof x=="string"&&(x=m.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes},_process:function(x){var g,C=this._data,A=C.words,z=C.sigBytes,j=this.blockSize,Y=j*4,W=z/Y;x?W=o.ceil(W):W=o.max((W|0)-this._minBufferSize,0);var D=W*j,B=o.min(D*4,z);if(D){for(var k=0;k<D;k+=j)this._doProcessBlock(A,k);g=A.splice(0,D),C.sigBytes-=B}return new f.init(g,B)},clone:function(){var x=d.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});c.Hasher=b.extend({cfg:d.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var g=this._doFinalize();return g},blockSize:16,_createHelper:function(x){return function(g,C){return new x.init(C).finalize(g)}},_createHmacHelper:function(x){return function(g,C){return new T.HMAC.init(x,C).finalize(g)}}});var T=u.algo={};return u})(Math);return n})})(Lo)),Lo.exports}var Fo={exports:{}},Ky=Fo.exports,El;function Sl(){return El||(El=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(Ky,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=o.enc;a.Base64={stringify:function(u){var c=u.words,d=u.sigBytes,f=this._map;u.clamp();for(var h=[],p=0;p<d;p+=3)for(var y=c[p>>>2]>>>24-p%4*8&255,m=c[p+1>>>2]>>>24-(p+1)%4*8&255,b=c[p+2>>>2]>>>24-(p+2)%4*8&255,T=y<<16|m<<8|b,x=0;x<4&&p+x*.75<d;x++)h.push(f.charAt(T>>>6*(3-x)&63));var g=f.charAt(64);if(g)for(;h.length%4;)h.push(g);return h.join("")},parse:function(u){var c=u.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h<d.length;h++)f[d.charCodeAt(h)]=h}var p=d.charAt(64);if(p){var y=u.indexOf(p);y!==-1&&(c=y)}return l(u,c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(u,c,d){for(var f=[],h=0,p=0;p<c;p++)if(p%4){var y=d[u.charCodeAt(p-1)]<<p%4*2,m=d[u.charCodeAt(p)]>>>6-p%4*2,b=y|m;f[h>>>2]|=b<<24-h%4*8,h++}return r.create(f,h)}})(),n.enc.Base64})})(Fo)),Fo.exports}var jo={exports:{}},Zy=jo.exports,Nl;function kl(){return Nl||(Nl=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(Zy,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,u=i.algo,c=[];(function(){for(var m=0;m<64;m++)c[m]=o.abs(o.sin(m+1))*4294967296|0})();var d=u.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var T=0;T<16;T++){var x=b+T,g=m[x];m[x]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}var C=this._hash.words,A=m[b+0],z=m[b+1],j=m[b+2],Y=m[b+3],W=m[b+4],D=m[b+5],B=m[b+6],k=m[b+7],V=m[b+8],_=m[b+9],M=m[b+10],v=m[b+11],S=m[b+12],I=m[b+13],P=m[b+14],H=m[b+15],$=C[0],O=C[1],F=C[2],G=C[3];$=f($,O,F,G,A,7,c[0]),G=f(G,$,O,F,z,12,c[1]),F=f(F,G,$,O,j,17,c[2]),O=f(O,F,G,$,Y,22,c[3]),$=f($,O,F,G,W,7,c[4]),G=f(G,$,O,F,D,12,c[5]),F=f(F,G,$,O,B,17,c[6]),O=f(O,F,G,$,k,22,c[7]),$=f($,O,F,G,V,7,c[8]),G=f(G,$,O,F,_,12,c[9]),F=f(F,G,$,O,M,17,c[10]),O=f(O,F,G,$,v,22,c[11]),$=f($,O,F,G,S,7,c[12]),G=f(G,$,O,F,I,12,c[13]),F=f(F,G,$,O,P,17,c[14]),O=f(O,F,G,$,H,22,c[15]),$=h($,O,F,G,z,5,c[16]),G=h(G,$,O,F,B,9,c[17]),F=h(F,G,$,O,v,14,c[18]),O=h(O,F,G,$,A,20,c[19]),$=h($,O,F,G,D,5,c[20]),G=h(G,$,O,F,M,9,c[21]),F=h(F,G,$,O,H,14,c[22]),O=h(O,F,G,$,W,20,c[23]),$=h($,O,F,G,_,5,c[24]),G=h(G,$,O,F,P,9,c[25]),F=h(F,G,$,O,Y,14,c[26]),O=h(O,F,G,$,V,20,c[27]),$=h($,O,F,G,I,5,c[28]),G=h(G,$,O,F,j,9,c[29]),F=h(F,G,$,O,k,14,c[30]),O=h(O,F,G,$,S,20,c[31]),$=p($,O,F,G,D,4,c[32]),G=p(G,$,O,F,V,11,c[33]),F=p(F,G,$,O,v,16,c[34]),O=p(O,F,G,$,P,23,c[35]),$=p($,O,F,G,z,4,c[36]),G=p(G,$,O,F,W,11,c[37]),F=p(F,G,$,O,k,16,c[38]),O=p(O,F,G,$,M,23,c[39]),$=p($,O,F,G,I,4,c[40]),G=p(G,$,O,F,A,11,c[41]),F=p(F,G,$,O,Y,16,c[42]),O=p(O,F,G,$,B,23,c[43]),$=p($,O,F,G,_,4,c[44]),G=p(G,$,O,F,S,11,c[45]),F=p(F,G,$,O,H,16,c[46]),O=p(O,F,G,$,j,23,c[47]),$=y($,O,F,G,A,6,c[48]),G=y(G,$,O,F,k,10,c[49]),F=y(F,G,$,O,P,15,c[50]),O=y(O,F,G,$,D,21,c[51]),$=y($,O,F,G,S,6,c[52]),G=y(G,$,O,F,Y,10,c[53]),F=y(F,G,$,O,M,15,c[54]),O=y(O,F,G,$,z,21,c[55]),$=y($,O,F,G,V,6,c[56]),G=y(G,$,O,F,H,10,c[57]),F=y(F,G,$,O,B,15,c[58]),O=y(O,F,G,$,I,21,c[59]),$=y($,O,F,G,W,6,c[60]),G=y(G,$,O,F,v,10,c[61]),F=y(F,G,$,O,j,15,c[62]),O=y(O,F,G,$,_,21,c[63]),C[0]=C[0]+$|0,C[1]=C[1]+O|0,C[2]=C[2]+F|0,C[3]=C[3]+G|0},_doFinalize:function(){var m=this._data,b=m.words,T=this._nDataBytes*8,x=m.sigBytes*8;b[x>>>5]|=128<<24-x%32;var g=o.floor(T/4294967296),C=T;b[(x+64>>>9<<4)+15]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,b[(x+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var A=this._hash,z=A.words,j=0;j<4;j++){var Y=z[j];z[j]=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360}return A},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,b,T,x,g,C,A){var z=m+(b&T|~b&x)+g+A;return(z<<C|z>>>32-C)+b}function h(m,b,T,x,g,C,A){var z=m+(b&x|T&~x)+g+A;return(z<<C|z>>>32-C)+b}function p(m,b,T,x,g,C,A){var z=m+(b^T^x)+g+A;return(z<<C|z>>>32-C)+b}function y(m,b,T,x,g,C,A){var z=m+(T^(b|~x))+g+A;return(z<<C|z>>>32-C)+b}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)})(Math),n.MD5})})(jo)),jo.exports}var Go={exports:{}},Wo={exports:{}},Jy=Wo.exports,Dl;function Qy(){return Dl||(Dl=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(Jy,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=i.Hasher,l=o.algo,u=[],c=l.SHA1=a.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,f){for(var h=this._hash.words,p=h[0],y=h[1],m=h[2],b=h[3],T=h[4],x=0;x<80;x++){if(x<16)u[x]=d[f+x]|0;else{var g=u[x-3]^u[x-8]^u[x-14]^u[x-16];u[x]=g<<1|g>>>31}var C=(p<<5|p>>>27)+T+u[x];x<20?C+=(y&m|~y&b)+1518500249:x<40?C+=(y^m^b)+1859775393:x<60?C+=(y&m|y&b|m&b)-1894007588:C+=(y^m^b)-899497514,T=b,b=m,m=y<<30|y>>>2,y=p,p=C}h[0]=h[0]+p|0,h[1]=h[1]+y|0,h[2]=h[2]+m|0,h[3]=h[3]+b|0,h[4]=h[4]+T|0},_doFinalize:function(){var d=this._data,f=d.words,h=this._nDataBytes*8,p=d.sigBytes*8;return f[p>>>5]|=128<<24-p%32,f[(p+64>>>9<<4)+14]=Math.floor(h/4294967296),f[(p+64>>>9<<4)+15]=h,d.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var d=a.clone.call(this);return d._hash=this._hash.clone(),d}});o.SHA1=a._createHelper(c),o.HmacSHA1=a._createHmacHelper(c)})(),n.SHA1})})(Wo)),Wo.exports}var Yo={exports:{}},ev=Yo.exports,Tl;function tv(){return Tl||(Tl=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(ev,function(n){(function(){var o=n,i=o.lib,r=i.Base,a=o.enc,l=a.Utf8,u=o.algo;u.HMAC=r.extend({init:function(c,d){c=this._hasher=new c.init,typeof d=="string"&&(d=l.parse(d));var f=c.blockSize,h=f*4;d.sigBytes>h&&(d=c.finalize(d)),d.clamp();for(var p=this._oKey=d.clone(),y=this._iKey=d.clone(),m=p.words,b=y.words,T=0;T<f;T++)m[T]^=1549556828,b[T]^=909522486;p.sigBytes=y.sigBytes=h,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var d=this._hasher,f=d.finalize(c);d.reset();var h=d.finalize(this._oKey.clone().concat(f));return h}})})()})})(Yo)),Yo.exports}var nv=Go.exports,Il;function Ml(){return Il||(Il=1,(function(t,e){(function(n,o,i){t.exports=o(Xe(),Qy(),tv())})(nv,function(n){return(function(){var o=n,i=o.lib,r=i.Base,a=i.WordArray,l=o.algo,u=l.MD5,c=l.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:u,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,f){for(var h,p=this.cfg,y=p.hasher.create(),m=a.create(),b=m.words,T=p.keySize,x=p.iterations;b.length<T;){h&&y.update(h),h=y.update(d).finalize(f),y.reset();for(var g=1;g<x;g++)h=y.finalize(h),y.reset();m.concat(h)}return m.sigBytes=T*4,m}});o.EvpKDF=function(d,f,h){return c.create(h).compute(d,f)}})(),n.EvpKDF})})(Go)),Go.exports}var Uo={exports:{}},ov=Uo.exports,Bl;function $l(){return Bl||(Bl=1,(function(t,e){(function(n,o,i){t.exports=o(Xe(),Ml())})(ov,function(n){n.lib.Cipher||(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,u=r.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var d=c.Base64,f=i.algo,h=f.EvpKDF,p=r.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(D,B){return this.create(this._ENC_XFORM_MODE,D,B)},createDecryptor:function(D,B){return this.create(this._DEC_XFORM_MODE,D,B)},init:function(D,B,k){this.cfg=this.cfg.extend(k),this._xformMode=D,this._key=B,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){D&&this._append(D);var B=this._doFinalize();return B},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function D(B){return typeof B=="string"?W:z}return function(B){return{encrypt:function(k,V,_){return D(V).encrypt(B,k,V,_)},decrypt:function(k,V,_){return D(V).decrypt(B,k,V,_)}}}})()});r.StreamCipher=p.extend({_doFinalize:function(){var D=this._process(!0);return D},blockSize:1});var y=i.mode={},m=r.BlockCipherMode=a.extend({createEncryptor:function(D,B){return this.Encryptor.create(D,B)},createDecryptor:function(D,B){return this.Decryptor.create(D,B)},init:function(D,B){this._cipher=D,this._iv=B}}),b=y.CBC=(function(){var D=m.extend();D.Encryptor=D.extend({processBlock:function(k,V){var _=this._cipher,M=_.blockSize;B.call(this,k,V,M),_.encryptBlock(k,V),this._prevBlock=k.slice(V,V+M)}}),D.Decryptor=D.extend({processBlock:function(k,V){var _=this._cipher,M=_.blockSize,v=k.slice(V,V+M);_.decryptBlock(k,V),B.call(this,k,V,M),this._prevBlock=v}});function B(k,V,_){var M,v=this._iv;v?(M=v,this._iv=o):M=this._prevBlock;for(var S=0;S<_;S++)k[V+S]^=M[S]}return D})(),T=i.pad={},x=T.Pkcs7={pad:function(D,B){for(var k=B*4,V=k-D.sigBytes%k,_=V<<24|V<<16|V<<8|V,M=[],v=0;v<V;v+=4)M.push(_);var S=l.create(M,V);D.concat(S)},unpad:function(D){var B=D.words[D.sigBytes-1>>>2]&255;D.sigBytes-=B}};r.BlockCipher=p.extend({cfg:p.cfg.extend({mode:b,padding:x}),reset:function(){var D;p.reset.call(this);var B=this.cfg,k=B.iv,V=B.mode;this._xformMode==this._ENC_XFORM_MODE?D=V.createEncryptor:(D=V.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,k&&k.words):(this._mode=D.call(V,this,k&&k.words),this._mode.__creator=D)},_doProcessBlock:function(D,B){this._mode.processBlock(D,B)},_doFinalize:function(){var D,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),B.unpad(D)),D},blockSize:128/32});var g=r.CipherParams=a.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),C=i.format={},A=C.OpenSSL={stringify:function(D){var B,k=D.ciphertext,V=D.salt;return V?B=l.create([1398893684,1701076831]).concat(V).concat(k):B=k,B.toString(d)},parse:function(D){var B,k=d.parse(D),V=k.words;return V[0]==1398893684&&V[1]==1701076831&&(B=l.create(V.slice(2,4)),V.splice(0,4),k.sigBytes-=16),g.create({ciphertext:k,salt:B})}},z=r.SerializableCipher=a.extend({cfg:a.extend({format:A}),encrypt:function(D,B,k,V){V=this.cfg.extend(V);var _=D.createEncryptor(k,V),M=_.finalize(B),v=_.cfg;return g.create({ciphertext:M,key:k,iv:v.iv,algorithm:D,mode:v.mode,padding:v.padding,blockSize:D.blockSize,formatter:V.format})},decrypt:function(D,B,k,V){V=this.cfg.extend(V),B=this._parse(B,V.format);var _=D.createDecryptor(k,V).finalize(B.ciphertext);return _},_parse:function(D,B){return typeof D=="string"?B.parse(D,this):D}}),j=i.kdf={},Y=j.OpenSSL={execute:function(D,B,k,V,_){if(V||(V=l.random(64/8)),_)var M=h.create({keySize:B+k,hasher:_}).compute(D,V);else var M=h.create({keySize:B+k}).compute(D,V);var v=l.create(M.words.slice(B),k*4);return M.sigBytes=B*4,g.create({key:M,iv:v,salt:V})}},W=r.PasswordBasedCipher=z.extend({cfg:z.cfg.extend({kdf:Y}),encrypt:function(D,B,k,V){V=this.cfg.extend(V);var _=V.kdf.execute(k,D.keySize,D.ivSize,V.salt,V.hasher);V.iv=_.iv;var M=z.encrypt.call(this,D,B,_.key,V);return M.mixIn(_),M},decrypt:function(D,B,k,V){V=this.cfg.extend(V),B=this._parse(B,V.format);var _=V.kdf.execute(k,D.keySize,D.ivSize,B.salt,V.hasher);V.iv=_.iv;var M=z.decrypt.call(this,D,B,_.key,V);return M}})})()})})(Uo)),Uo.exports}var iv=Vo.exports,zl;function rv(){return zl||(zl=1,(function(t,e){(function(n,o,i){t.exports=o(Xe(),Sl(),kl(),Ml(),$l())})(iv,function(n){return(function(){var o=n,i=o.lib,r=i.BlockCipher,a=o.algo,l=[],u=[],c=[],d=[],f=[],h=[],p=[],y=[],m=[],b=[];(function(){for(var g=[],C=0;C<256;C++)C<128?g[C]=C<<1:g[C]=C<<1^283;for(var A=0,z=0,C=0;C<256;C++){var j=z^z<<1^z<<2^z<<3^z<<4;j=j>>>8^j&255^99,l[A]=j,u[j]=A;var Y=g[A],W=g[Y],D=g[W],B=g[j]*257^j*16843008;c[A]=B<<24|B>>>8,d[A]=B<<16|B>>>16,f[A]=B<<8|B>>>24,h[A]=B;var B=D*16843009^W*65537^Y*257^A*16843008;p[j]=B<<24|B>>>8,y[j]=B<<16|B>>>16,m[j]=B<<8|B>>>24,b[j]=B,A?(A=Y^g[g[g[D^Y]]],z^=g[g[z]]):A=z=1}})();var T=[0,1,2,4,8,16,32,64,128,27,54],x=a.AES=r.extend({_doReset:function(){var g;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,A=C.words,z=C.sigBytes/4,j=this._nRounds=z+6,Y=(j+1)*4,W=this._keySchedule=[],D=0;D<Y;D++)D<z?W[D]=A[D]:(g=W[D-1],D%z?z>6&&D%z==4&&(g=l[g>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[g&255]):(g=g<<8|g>>>24,g=l[g>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[g&255],g^=T[D/z|0]<<24),W[D]=W[D-z]^g);for(var B=this._invKeySchedule=[],k=0;k<Y;k++){var D=Y-k;if(k%4)var g=W[D];else var g=W[D-4];k<4||D<=4?B[k]=g:B[k]=p[l[g>>>24]]^y[l[g>>>16&255]]^m[l[g>>>8&255]]^b[l[g&255]]}}},encryptBlock:function(g,C){this._doCryptBlock(g,C,this._keySchedule,c,d,f,h,l)},decryptBlock:function(g,C){var A=g[C+1];g[C+1]=g[C+3],g[C+3]=A,this._doCryptBlock(g,C,this._invKeySchedule,p,y,m,b,u);var A=g[C+1];g[C+1]=g[C+3],g[C+3]=A},_doCryptBlock:function(g,C,A,z,j,Y,W,D){for(var B=this._nRounds,k=g[C]^A[0],V=g[C+1]^A[1],_=g[C+2]^A[2],M=g[C+3]^A[3],v=4,S=1;S<B;S++){var I=z[k>>>24]^j[V>>>16&255]^Y[_>>>8&255]^W[M&255]^A[v++],P=z[V>>>24]^j[_>>>16&255]^Y[M>>>8&255]^W[k&255]^A[v++],H=z[_>>>24]^j[M>>>16&255]^Y[k>>>8&255]^W[V&255]^A[v++],$=z[M>>>24]^j[k>>>16&255]^Y[V>>>8&255]^W[_&255]^A[v++];k=I,V=P,_=H,M=$}var I=(D[k>>>24]<<24|D[V>>>16&255]<<16|D[_>>>8&255]<<8|D[M&255])^A[v++],P=(D[V>>>24]<<24|D[_>>>16&255]<<16|D[M>>>8&255]<<8|D[k&255])^A[v++],H=(D[_>>>24]<<24|D[M>>>16&255]<<16|D[k>>>8&255]<<8|D[V&255])^A[v++],$=(D[M>>>24]<<24|D[k>>>16&255]<<16|D[V>>>8&255]<<8|D[_&255])^A[v++];g[C]=I,g[C+1]=P,g[C+2]=H,g[C+3]=$},keySize:256/32});o.AES=r._createHelper(x)})(),n.AES})})(Vo)),Vo.exports}var sv=rv();const av=wl(sv);var Xo={exports:{}},lv=Xo.exports,Al;function cv(){return Al||(Al=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(lv,function(n){return n.enc.Utf8})})(Xo)),Xo.exports}var dv=cv();const uv=wl(dv);var qo={exports:{}},fv=qo.exports,Pl;function hv(){return Pl||(Pl=1,(function(t,e){(function(n,o,i){t.exports=o(Xe(),$l())})(fv,function(n){return n.pad.Pkcs7})})(qo)),qo.exports}hv(),Sl(),kl();var Ko={exports:{}},pv=Ko.exports,Ol;function gv(){return Ol||(Ol=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(pv,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,u=i.algo,c=[],d=[];(function(){function p(T){for(var x=o.sqrt(T),g=2;g<=x;g++)if(!(T%g))return!1;return!0}function y(T){return(T-(T|0))*4294967296|0}for(var m=2,b=0;b<64;)p(m)&&(b<8&&(c[b]=y(o.pow(m,1/2))),d[b]=y(o.pow(m,1/3)),b++),m++})();var f=[],h=u.SHA256=l.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(p,y){for(var m=this._hash.words,b=m[0],T=m[1],x=m[2],g=m[3],C=m[4],A=m[5],z=m[6],j=m[7],Y=0;Y<64;Y++){if(Y<16)f[Y]=p[y+Y]|0;else{var W=f[Y-15],D=(W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3,B=f[Y-2],k=(B<<15|B>>>17)^(B<<13|B>>>19)^B>>>10;f[Y]=D+f[Y-7]+k+f[Y-16]}var V=C&A^~C&z,_=b&T^b&x^T&x,M=(b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22),v=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),S=j+v+V+d[Y]+f[Y],I=M+_;j=z,z=A,A=C,C=g+S|0,g=x,x=T,T=b,b=S+I|0}m[0]=m[0]+b|0,m[1]=m[1]+T|0,m[2]=m[2]+x|0,m[3]=m[3]+g|0,m[4]=m[4]+C|0,m[5]=m[5]+A|0,m[6]=m[6]+z|0,m[7]=m[7]+j|0},_doFinalize:function(){var p=this._data,y=p.words,m=this._nDataBytes*8,b=p.sigBytes*8;return y[b>>>5]|=128<<24-b%32,y[(b+64>>>9<<4)+14]=o.floor(m/4294967296),y[(b+64>>>9<<4)+15]=m,p.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});i.SHA256=l._createHelper(h),i.HmacSHA256=l._createHmacHelper(h)})(Math),n.SHA256})})(Ko)),Ko.exports}gv();var Zo={exports:{}},Jo={exports:{}},mv=Jo.exports,Rl;function yv(){return Rl||(Rl=1,(function(t,e){(function(n,o){t.exports=o(Xe())})(mv,function(n){return(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,u=i.x64={};u.Word=a.extend({init:function(c,d){this.high=c,this.low=d}}),u.WordArray=a.extend({init:function(c,d){c=this.words=c||[],d!=o?this.sigBytes=d:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,d=c.length,f=[],h=0;h<d;h++){var p=c[h];f.push(p.high),f.push(p.low)}return l.create(f,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),d=c.words=this.words.slice(0),f=d.length,h=0;h<f;h++)d[h]=d[h].clone();return c}})})(),n})})(Jo)),Jo.exports}var vv=Zo.exports,Hl;function bv(){return Hl||(Hl=1,(function(t,e){(function(n,o,i){t.exports=o(Xe(),yv())})(vv,function(n){return(function(){var o=n,i=o.lib,r=i.Hasher,a=o.x64,l=a.Word,u=a.WordArray,c=o.algo;function d(){return l.create.apply(l,arguments)}var f=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],h=[];(function(){for(var y=0;y<80;y++)h[y]=d()})();var p=c.SHA512=r.extend({_doReset:function(){this._hash=new u.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(y,m){for(var b=this._hash.words,T=b[0],x=b[1],g=b[2],C=b[3],A=b[4],z=b[5],j=b[6],Y=b[7],W=T.high,D=T.low,B=x.high,k=x.low,V=g.high,_=g.low,M=C.high,v=C.low,S=A.high,I=A.low,P=z.high,H=z.low,$=j.high,O=j.low,F=Y.high,G=Y.low,X=W,Z=D,U=B,J=k,te=V,Q=_,le=M,ee=v,K=S,E=I,w=P,N=H,L=$,R=O,oe=F,ne=G,se=0;se<80;se++){var re,de,ce=h[se];if(se<16)de=ce.high=y[m+se*2]|0,re=ce.low=y[m+se*2+1]|0;else{var ve=h[se-15],Me=ve.high,$e=ve.low,Hr=(Me>>>1|$e<<31)^(Me>>>8|$e<<24)^Me>>>7,hi=($e>>>1|Me<<31)^($e>>>8|Me<<24)^($e>>>7|Me<<25),pi=h[se-2],sn=pi.high,Gn=pi.low,T0=(sn>>>19|Gn<<13)^(sn<<3|Gn>>>29)^sn>>>6,mc=(Gn>>>19|sn<<13)^(Gn<<3|sn>>>29)^(Gn>>>6|sn<<26),yc=h[se-7],I0=yc.high,M0=yc.low,vc=h[se-16],B0=vc.high,bc=vc.low;re=hi+M0,de=Hr+I0+(re>>>0<hi>>>0?1:0),re=re+mc,de=de+T0+(re>>>0<mc>>>0?1:0),re=re+bc,de=de+B0+(re>>>0<bc>>>0?1:0),ce.high=de,ce.low=re}var $0=K&w^~K&L,_c=E&N^~E&R,z0=X&U^X&te^U&te,A0=Z&J^Z&Q^J&Q,P0=(X>>>28|Z<<4)^(X<<30|Z>>>2)^(X<<25|Z>>>7),wc=(Z>>>28|X<<4)^(Z<<30|X>>>2)^(Z<<25|X>>>7),O0=(K>>>14|E<<18)^(K>>>18|E<<14)^(K<<23|E>>>9),R0=(E>>>14|K<<18)^(E>>>18|K<<14)^(E<<23|K>>>9),xc=f[se],H0=xc.high,Cc=xc.low,Ue=ne+R0,kt=oe+O0+(Ue>>>0<ne>>>0?1:0),Ue=Ue+_c,kt=kt+$0+(Ue>>>0<_c>>>0?1:0),Ue=Ue+Cc,kt=kt+H0+(Ue>>>0<Cc>>>0?1:0),Ue=Ue+re,kt=kt+de+(Ue>>>0<re>>>0?1:0),Ec=wc+A0,V0=P0+z0+(Ec>>>0<wc>>>0?1:0);oe=L,ne=R,L=w,R=N,w=K,N=E,E=ee+Ue|0,K=le+kt+(E>>>0<ee>>>0?1:0)|0,le=te,ee=Q,te=U,Q=J,U=X,J=Z,Z=Ue+Ec|0,X=kt+V0+(Z>>>0<Ue>>>0?1:0)|0}D=T.low=D+Z,T.high=W+X+(D>>>0<Z>>>0?1:0),k=x.low=k+J,x.high=B+U+(k>>>0<J>>>0?1:0),_=g.low=_+Q,g.high=V+te+(_>>>0<Q>>>0?1:0),v=C.low=v+ee,C.high=M+le+(v>>>0<ee>>>0?1:0),I=A.low=I+E,A.high=S+K+(I>>>0<E>>>0?1:0),H=z.low=H+N,z.high=P+w+(H>>>0<N>>>0?1:0),O=j.low=O+R,j.high=$+L+(O>>>0<R>>>0?1:0),G=Y.low=G+ne,Y.high=F+oe+(G>>>0<ne>>>0?1:0)},_doFinalize:function(){var y=this._data,m=y.words,b=this._nDataBytes*8,T=y.sigBytes*8;m[T>>>5]|=128<<24-T%32,m[(T+128>>>10<<5)+30]=Math.floor(b/4294967296),m[(T+128>>>10<<5)+31]=b,y.sigBytes=m.length*4,this._process();var x=this._hash.toX32();return x},clone:function(){var y=r.clone.call(this);return y._hash=this._hash.clone(),y},blockSize:1024/32});o.SHA512=r._createHelper(p),o.HmacSHA512=r._createHmacHelper(p)})(),n.SHA512})})(Zo)),Zo.exports}bv();const{decrypt:cb,encrypt:db}=av;uv.parse;function _v(t,e,n){return(e=Ev(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},yt.apply(null,arguments)}function Vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(n),!0).forEach(function(o){_v(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function wv(t,e){if(t==null)return{};var n,o,i=xv(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function xv(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;n[o]=t[o]}return n}function Cv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ev(t){var e=Cv(t,"string");return typeof e=="symbol"?e:e+""}function _r(t){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(t)}var Sv="1.15.7";function vt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var bt=vt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),zn=vt(/Edge/i),Ll=vt(/firefox/i),An=vt(/safari/i)&&!vt(/chrome/i)&&!vt(/android/i),wr=vt(/iP(ad|od|hone)/i),Fl=vt(/chrome/i)&&vt(/android/i),jl={capture:!1,passive:!1};function be(t,e,n){t.addEventListener(e,n,!bt&&jl)}function ye(t,e,n){t.removeEventListener(e,n,!bt&&jl)}function Qo(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Gl(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function et(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Qo(t,e):Qo(t,e))||o&&t===n)return t;if(t===n)break}while(t=Gl(t))}return null}var Wl=/\s+/g;function We(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Wl," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Wl," ")}}function pe(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function Qt(t,e){var n="";if(typeof t=="string")n=t;else do{var o=pe(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Yl(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function lt(){var t=document.scrollingElement;return t||document.documentElement}function De(t,e,n,o,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,a,l,u,c,d,f;if(t!==window&&t.parentNode&&t!==lt()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,u=r.bottom,c=r.right,d=r.height,f=r.width):(a=0,l=0,u=window.innerHeight,c=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!bt))do if(i&&i.getBoundingClientRect&&(pe(i,"transform")!=="none"||n&&pe(i,"position")!=="static")){var h=i.getBoundingClientRect();a-=h.top+parseInt(pe(i,"border-top-width")),l-=h.left+parseInt(pe(i,"border-left-width")),u=a+r.height,c=l+r.width;break}while(i=i.parentNode);if(o&&t!==window){var p=Qt(i||t),y=p&&p.a,m=p&&p.d;p&&(a/=m,l/=y,f/=y,d/=m,u=a+d,c=l+f)}return{top:a,left:l,bottom:u,right:c,width:f,height:d}}}function Ul(t,e,n){for(var o=Et(t,!0),i=De(t)[e];o;){var r=De(o)[n],a=void 0;if(a=i>=r,!a)return o;if(o===lt())break;o=Et(o,!1)}return!1}function en(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==ge.ghost&&(o||a[r]!==ge.dragged)&&et(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function xr(t,e){for(var n=t.lastElementChild;n&&(n===ge.ghost||pe(n,"display")==="none"||e&&!Qo(n,e));)n=n.previousElementSibling;return n||null}function qe(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==ge.clone&&(!e||Qo(t,e))&&n++;return n}function Xl(t){var e=0,n=0,o=lt();if(t)do{var i=Qt(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Nv(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function Et(t,e){if(!t||!t.getBoundingClientRect)return lt();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=pe(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 lt();if(o||e)return n;o=!0}}while(n=n.parentNode);return lt()}function kv(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Cr(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Pn;function ql(t,e){return function(){if(!Pn){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Pn=setTimeout(function(){Pn=void 0},e)}}}function Dv(){clearTimeout(Pn),Pn=void 0}function Kl(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Zl(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Jl(t,e,n){var o={};return Array.from(t.children).forEach(function(i){var r,a,l,u;if(!(!et(i,e.draggable,t,!1)||i.animated||i===n)){var c=De(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,c.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,c.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,c.right),o.bottom=Math.max((u=o.bottom)!==null&&u!==void 0?u:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Ve="Sortable"+new Date().getTime();function Tv(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(pe(i,"display")==="none"||i===ge.ghost)){t.push({target:i,rect:De(i)});var r=at({},t[t.length-1].rect);if(i.thisAnimationDuration){var a=Qt(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Nv(t,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;t.forEach(function(l){var u=0,c=l.target,d=c.fromRect,f=De(c),h=c.prevFromRect,p=c.prevToRect,y=l.rect,m=Qt(c,!0);m&&(f.top-=m.f,f.left-=m.e),c.toRect=f,c.thisAnimationDuration&&Cr(h,f)&&!Cr(d,f)&&(y.top-f.top)/(y.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(u=Mv(y,h,p,i.options)),Cr(f,d)||(c.prevFromRect=d,c.prevToRect=f,u||(u=i.options.animation),i.animate(c,y,f,u)),u&&(r=!0,a=Math.max(a,u),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},u),c.thisAnimationDuration=u)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,i,r,a){if(a){pe(o,"transition",""),pe(o,"transform","");var l=Qt(this.el),u=l&&l.a,c=l&&l.d,d=(i.left-r.left)/(u||1),f=(i.top-r.top)/(c||1);o.animatingX=!!d,o.animatingY=!!f,pe(o,"transform","translate3d("+d+"px,"+f+"px,0)"),this.forRepaintDummy=Iv(o),pe(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),pe(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){pe(o,"transition",""),pe(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Iv(t){return t.offsetWidth}function Mv(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var tn=[],Er={initializeByDefault:!0},On={mount:function(e){for(var n in Er)Er.hasOwnProperty(n)&&!(n in e)&&(e[n]=Er[n]);tn.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),tn.push(e)},pluginEvent:function(e,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";tn.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](at({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](at({sortable:n},o)))})},initializePlugins:function(e,n,o,i){tn.forEach(function(l){var u=l.pluginName;if(!(!e.options[u]&&!l.initializeByDefault)){var c=new l(e,n,e.options);c.sortable=e,c.options=e.options,e[u]=c,yt(o,c.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var o={};return tn.forEach(function(i){typeof i.eventProperties=="function"&&yt(o,i.eventProperties.call(n[i.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return tn.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],o))}),i}};function Bv(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,u=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,f=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,y=t.extraEventProperties;if(e=e||n&&n[Ve],!!e){var m,b=e.options,T="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!bt&&!zn?m=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(o,!0,!0)),m.to=a||n,m.from=l||n,m.item=i||n,m.clone=r,m.oldIndex=u,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=f,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var x=at(at({},y),On.getEventProperties(o,e));for(var g in x)m[g]=x[g];n&&n.dispatchEvent(m),b[T]&&b[T].call(e,m)}}var $v=["evt"],Le=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=wv(o,$v);On.pluginEvent.bind(ge)(e,n,at({dragEl:ie,parentEl:Ce,ghostEl:me,rootEl:we,nextEl:Ot,lastDownEl:ei,cloneEl:xe,cloneHidden:St,dragStarted:Hn,putSortable:ze,activeSortable:ge.active,originalEvent:i,oldIndex:nn,oldDraggableIndex:Rn,newIndex:Ye,newDraggableIndex:Nt,hideGhostForTarget:rc,unhideGhostForTarget:sc,cloneNowHidden:function(){St=!0},cloneNowShown:function(){St=!1},dispatchSortableEvent:function(l){Oe({sortable:n,name:l,originalEvent:i})}},r))};function Oe(t){Bv(at({putSortable:ze,cloneEl:xe,targetEl:ie,rootEl:we,oldIndex:nn,oldDraggableIndex:Rn,newIndex:Ye,newDraggableIndex:Nt},t))}var ie,Ce,me,we,Ot,ei,xe,St,nn,Ye,Rn,Nt,ti,ze,on=!1,ni=!1,oi=[],Rt,tt,Sr,Nr,Ql,ec,Hn,rn,Vn,Ln=!1,ii=!1,ri,Ae,kr=[],Dr=!1,si=[],ai=typeof document<"u",li=wr,tc=zn||bt?"cssFloat":"float",zv=ai&&!Fl&&!wr&&"draggable"in document.createElement("div"),nc=(function(){if(ai){if(bt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),oc=function(e,n){var o=pe(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=en(e,0,n),a=en(e,1,n),l=r&&pe(r),u=a&&pe(a),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+De(r).width,d=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+De(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(u.clear==="both"||u.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=i&&o[tc]==="none"||a&&o[tc]==="none"&&c+d>i)?"vertical":"horizontal"},Av=function(e,n,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,u=o?n.right:n.bottom,c=o?n.width:n.height;return i===l||r===u||i+a/2===l+c/2},Pv=function(e,n){var o;return oi.some(function(i){var r=i[Ve].options.emptyInsertThreshold;if(!(!r||xr(i))){var a=De(i),l=e>=a.left-r&&e<=a.right+r,u=n>=a.top-r&&n<=a.bottom+r;if(l&&u)return o=i}}),o},ic=function(e){function n(r,a){return function(l,u,c,d){var f=l.options.group.name&&u.options.group.name&&l.options.group.name===u.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,u,c,d),a)(l,u,c,d);var h=(a?l:u).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},i=e.group;(!i||_r(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},rc=function(){!nc&&me&&pe(me,"display","none")},sc=function(){!nc&&me&&pe(me,"display","")};ai&&!Fl&&document.addEventListener("click",function(t){if(ni)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ni=!1,!1},!0);var Ht=function(e){if(ie){e=e.touches?e.touches[0]:e;var n=Pv(e.clientX,e.clientY);if(n){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ve]._onDragOver(o)}}},Ov=function(e){ie&&ie.parentNode[Ve]._isOutsideThisEl(e.target)};function ge(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=yt({},e),t[Ve]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return oc(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.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:ge.supportPointer!==!1&&"PointerEvent"in window&&(!An||wr),emptyInsertThreshold:5};On.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);ic(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:zv,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?be(t,"pointerdown",this._onTapStart):(be(t,"mousedown",this._onTapStart),be(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(be(t,"dragover",this),be(t,"dragenter",this)),oi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),yt(this,Tv())}ge.prototype={constructor:ge,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(rn=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,ie):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,d=i.filter;if(Wv(o),!ie&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&An&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=et(u,i.draggable,o,!1),!(u&&u.animated)&&ei!==u)){if(nn=qe(u),Rn=qe(u,i.draggable),typeof d=="function"){if(d.call(this,e,u,this)){Oe({sortable:n,rootEl:c,name:"filter",targetEl:u,toEl:o,fromEl:o}),Le("filter",n,{evt:e}),r&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=et(c,f.trim(),o,!1),f)return Oe({sortable:n,rootEl:f,name:"filter",targetEl:u,fromEl:o,toEl:o}),Le("filter",n,{evt:e}),!0}),d)){r&&e.preventDefault();return}i.handle&&!et(c,i.handle,o,!1)||this._prepareDragStart(e,l,u)}}},_prepareDragStart:function(e,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,u;if(o&&!ie&&o.parentNode===r){var c=De(o);if(we=r,ie=o,Ce=ie.parentNode,Ot=ie.nextSibling,ei=o,ti=a.group,ge.dragged=ie,Rt={target:ie,clientX:(n||e).clientX,clientY:(n||e).clientY},Ql=Rt.clientX-c.left,ec=Rt.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,ie.style["will-change"]="all",u=function(){if(Le("delayEnded",i,{evt:e}),ge.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Ll&&i.nativeDraggable&&(ie.draggable=!0),i._triggerDragStart(e,n),Oe({sortable:i,name:"choose",originalEvent:e}),We(ie,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Yl(ie,d.trim(),Tr)}),be(l,"dragover",Ht),be(l,"mousemove",Ht),be(l,"touchmove",Ht),a.supportPointer?(be(l,"pointerup",i._onDrop),!this.nativeDraggable&&be(l,"pointercancel",i._onDrop)):(be(l,"mouseup",i._onDrop),be(l,"touchend",i._onDrop),be(l,"touchcancel",i._onDrop)),Ll&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ie.draggable=!0),Le("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(zn||bt))){if(ge.eventCanceled){this._onDrop();return}a.supportPointer?(be(l,"pointerup",i._disableDelayedDrag),be(l,"pointercancel",i._disableDelayedDrag)):(be(l,"mouseup",i._disableDelayedDrag),be(l,"touchend",i._disableDelayedDrag),be(l,"touchcancel",i._disableDelayedDrag)),be(l,"mousemove",i._delayedDragTouchMoveHandler),be(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&be(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(u,a.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ie&&Tr(ie),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;ye(e,"mouseup",this._disableDelayedDrag),ye(e,"touchend",this._disableDelayedDrag),ye(e,"touchcancel",this._disableDelayedDrag),ye(e,"pointerup",this._disableDelayedDrag),ye(e,"pointercancel",this._disableDelayedDrag),ye(e,"mousemove",this._delayedDragTouchMoveHandler),ye(e,"touchmove",this._delayedDragTouchMoveHandler),ye(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?be(document,"pointermove",this._onTouchMove):n?be(document,"touchmove",this._onTouchMove):be(document,"mousemove",this._onTouchMove):(be(ie,"dragend",this),be(we,"dragstart",this._onDragStart));try{document.selection?di(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(on=!1,we&&ie){Le("dragStarted",this,{evt:n}),this.nativeDraggable&&be(document,"dragover",Ov);var o=this.options;!e&&We(ie,o.dragClass,!1),We(ie,o.ghostClass,!0),ge.active=this,e&&this._appendGhost(),Oe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(tt){this._lastX=tt.clientX,this._lastY=tt.clientY,rc();for(var e=document.elementFromPoint(tt.clientX,tt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(tt.clientX,tt.clientY),e!==n);)n=e;if(ie.parentNode[Ve]._isOutsideThisEl(e),n)do{if(n[Ve]){var o=void 0;if(o=n[Ve]._onDragOver({clientX:tt.clientX,clientY:tt.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=Gl(n));sc()}},_onTouchMove:function(e){if(Rt){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=me&&Qt(me,!0),l=me&&a&&a.a,u=me&&a&&a.d,c=li&&Ae&&Xl(Ae),d=(r.clientX-Rt.clientX+i.x)/(l||1)+(c?c[0]-kr[0]:0)/(l||1),f=(r.clientY-Rt.clientY+i.y)/(u||1)+(c?c[1]-kr[1]:0)/(u||1);if(!ge.active&&!on){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(me){a?(a.e+=d-(Sr||0),a.f+=f-(Nr||0)):a={a:1,b:0,c:0,d:1,e:d,f};var h="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");pe(me,"webkitTransform",h),pe(me,"mozTransform",h),pe(me,"msTransform",h),pe(me,"transform",h),Sr=d,Nr=f,tt=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!me){var e=this.options.fallbackOnBody?document.body:we,n=De(ie,!0,li,!0,e),o=this.options;if(li){for(Ae=e;pe(Ae,"position")==="static"&&pe(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=lt()),n.top+=Ae.scrollTop,n.left+=Ae.scrollLeft):Ae=lt(),kr=Xl(Ae)}me=ie.cloneNode(!0),We(me,o.ghostClass,!1),We(me,o.fallbackClass,!0),We(me,o.dragClass,!0),pe(me,"transition",""),pe(me,"transform",""),pe(me,"box-sizing","border-box"),pe(me,"margin",0),pe(me,"top",n.top),pe(me,"left",n.left),pe(me,"width",n.width),pe(me,"height",n.height),pe(me,"opacity","0.8"),pe(me,"position",li?"absolute":"fixed"),pe(me,"zIndex","100000"),pe(me,"pointerEvents","none"),ge.ghost=me,e.appendChild(me),pe(me,"transform-origin",Ql/parseInt(me.style.width)*100+"% "+ec/parseInt(me.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,i=e.dataTransfer,r=o.options;if(Le("dragStart",this,{evt:e}),ge.eventCanceled){this._onDrop();return}Le("setupClone",this),ge.eventCanceled||(xe=Zl(ie),xe.removeAttribute("id"),xe.draggable=!1,xe.style["will-change"]="",this._hideClone(),We(xe,this.options.chosenClass,!1),ge.clone=xe),o.cloneId=di(function(){Le("clone",o),!ge.eventCanceled&&(o.options.removeCloneOnHide||we.insertBefore(xe,ie),o._hideClone(),Oe({sortable:o,name:"clone"}))}),!n&&We(ie,r.dragClass,!0),n?(ni=!0,o._loopId=setInterval(o._emulateDragOver,50)):(ye(document,"mouseup",o._onDrop),ye(document,"touchend",o._onDrop),ye(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,ie)),be(document,"drop",o),pe(ie,"transform","translateZ(0)")),on=!0,o._dragStartId=di(o._dragStarted.bind(o,n,e)),be(document,"selectstart",o),Hn=!0,window.getSelection().removeAllRanges(),An&&pe(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,i,r,a,l=this.options,u=l.group,c=ge.active,d=ti===u,f=l.sort,h=ze||c,p,y=this,m=!1;if(Dr)return;function b(I,P){Le(I,y,at({evt:e,isOwner:d,axis:p?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:h,target:o,completed:x,onMove:function($,O){return ci(we,n,ie,i,$,De($),e,O)},changed:g},P))}function T(){b("dragOverAnimationCapture"),y.captureAnimationState(),y!==h&&h.captureAnimationState()}function x(I){return b("dragOverCompleted",{insertion:I}),I&&(d?c._hideClone():c._showClone(y),y!==h&&(We(ie,ze?ze.options.ghostClass:c.options.ghostClass,!1),We(ie,l.ghostClass,!0)),ze!==y&&y!==ge.active?ze=y:y===ge.active&&ze&&(ze=null),h===y&&(y._ignoreWhileAnimating=o),y.animateAll(function(){b("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===ie&&!ie.animated||o===n&&!o.animated)&&(rn=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(ie.parentNode[Ve]._isOutsideThisEl(e.target),!I&&Ht(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function g(){Ye=qe(ie),Nt=qe(ie,l.draggable),Oe({sortable:y,name:"change",toEl:n,newIndex:Ye,newDraggableIndex:Nt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=et(o,l.draggable,n,!0),b("dragOver"),ge.eventCanceled)return m;if(ie.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||y._ignoreWhileAnimating===o)return x(!1);if(ni=!1,c&&!l.disabled&&(d?f||(a=Ce!==we):ze===this||(this.lastPutMode=ti.checkPull(this,c,ie,e))&&u.checkPut(this,c,ie,e))){if(p=this._getDirection(e,o)==="vertical",i=De(ie),b("dragOverValid"),ge.eventCanceled)return m;if(a)return Ce=we,T(),this._hideClone(),b("revert"),ge.eventCanceled||(Ot?we.insertBefore(ie,Ot):we.appendChild(ie)),x(!0);var C=xr(n,l.draggable);if(!C||Lv(e,p,this)&&!C.animated){if(C===ie)return x(!1);if(C&&n===e.target&&(o=C),o&&(r=De(o)),ci(we,n,ie,i,o,r,e,!!o)!==!1)return T(),C&&C.nextSibling?n.insertBefore(ie,C.nextSibling):n.appendChild(ie),Ce=n,g(),x(!0)}else if(C&&Vv(e,p,this)){var A=en(n,0,l,!0);if(A===ie)return x(!1);if(o=A,r=De(o),ci(we,n,ie,i,o,r,e,!1)!==!1)return T(),n.insertBefore(ie,A),Ce=n,g(),x(!0)}else if(o.parentNode===n){r=De(o);var z=0,j,Y=ie.parentNode!==n,W=!Av(ie.animated&&ie.toRect||i,o.animated&&o.toRect||r,p),D=p?"top":"left",B=Ul(o,"top","top")||Ul(ie,"top","top"),k=B?B.scrollTop:void 0;rn!==o&&(j=r[D],Ln=!1,ii=!W&&l.invertSwap||Y),z=Fv(e,o,r,p,W?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,ii,rn===o);var V;if(z!==0){var _=qe(ie);do _-=z,V=Ce.children[_];while(V&&(pe(V,"display")==="none"||V===me))}if(z===0||V===o)return x(!1);rn=o,Vn=z;var M=o.nextElementSibling,v=!1;v=z===1;var S=ci(we,n,ie,i,o,r,e,v);if(S!==!1)return(S===1||S===-1)&&(v=S===1),Dr=!0,setTimeout(Hv,30),T(),v&&!M?n.appendChild(ie):o.parentNode.insertBefore(ie,v?M:o),B&&Kl(B,0,k-B.scrollTop),Ce=ie.parentNode,j!==void 0&&!ii&&(ri=Math.abs(j-De(o)[D])),g(),x(!0)}if(n.contains(ie))return x(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ye(document,"mousemove",this._onTouchMove),ye(document,"touchmove",this._onTouchMove),ye(document,"pointermove",this._onTouchMove),ye(document,"dragover",Ht),ye(document,"mousemove",Ht),ye(document,"touchmove",Ht)},_offUpEvents:function(){var e=this.el.ownerDocument;ye(e,"mouseup",this._onDrop),ye(e,"touchend",this._onDrop),ye(e,"pointerup",this._onDrop),ye(e,"pointercancel",this._onDrop),ye(e,"touchcancel",this._onDrop),ye(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(Ye=qe(ie),Nt=qe(ie,o.draggable),Le("drop",this,{evt:e}),Ce=ie&&ie.parentNode,Ye=qe(ie),Nt=qe(ie,o.draggable),ge.eventCanceled){this._nulling();return}on=!1,ii=!1,Ln=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ir(this.cloneId),Ir(this._dragStartId),this.nativeDraggable&&(ye(document,"drop",this),ye(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),An&&pe(document.body,"user-select",""),pe(ie,"transform",""),e&&(Hn&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),me&&me.parentNode&&me.parentNode.removeChild(me),(we===Ce||ze&&ze.lastPutMode!=="clone")&&xe&&xe.parentNode&&xe.parentNode.removeChild(xe),ie&&(this.nativeDraggable&&ye(ie,"dragend",this),Tr(ie),ie.style["will-change"]="",Hn&&!on&&We(ie,ze?ze.options.ghostClass:this.options.ghostClass,!1),We(ie,this.options.chosenClass,!1),Oe({sortable:this,name:"unchoose",toEl:Ce,newIndex:null,newDraggableIndex:null,originalEvent:e}),we!==Ce?(Ye>=0&&(Oe({rootEl:Ce,name:"add",toEl:Ce,fromEl:we,originalEvent:e}),Oe({sortable:this,name:"remove",toEl:Ce,originalEvent:e}),Oe({rootEl:Ce,name:"sort",toEl:Ce,fromEl:we,originalEvent:e}),Oe({sortable:this,name:"sort",toEl:Ce,originalEvent:e})),ze&&ze.save()):Ye!==nn&&Ye>=0&&(Oe({sortable:this,name:"update",toEl:Ce,originalEvent:e}),Oe({sortable:this,name:"sort",toEl:Ce,originalEvent:e})),ge.active&&((Ye==null||Ye===-1)&&(Ye=nn,Nt=Rn),Oe({sortable:this,name:"end",toEl:Ce,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Le("nulling",this),we=ie=Ce=me=Ot=xe=ei=St=Rt=tt=Hn=Ye=Nt=nn=Rn=rn=Vn=ze=ti=ge.dragged=ge.ghost=ge.clone=ge.active=null;var e=this.el;si.forEach(function(n){e.contains(n)&&(n.checked=!0)}),si.length=Sr=Nr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ie&&(this._onDragOver(e),Rv(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],et(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||Gv(n));return e},sort:function(e,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];et(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return et(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var i=On.modifyOption(this,e,n);typeof i<"u"?o[e]=i:o[e]=n,e==="group"&&ic(o)},destroy:function(){Le("destroy",this);var e=this.el;e[Ve]=null,ye(e,"mousedown",this._onTapStart),ye(e,"touchstart",this._onTapStart),ye(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(ye(e,"dragover",this),ye(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),oi.splice(oi.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!St){if(Le("hideClone",this),ge.eventCanceled)return;pe(xe,"display","none"),this.options.removeCloneOnHide&&xe.parentNode&&xe.parentNode.removeChild(xe),St=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(St){if(Le("showClone",this),ge.eventCanceled)return;ie.parentNode==we&&!this.options.group.revertClone?we.insertBefore(xe,ie):Ot?we.insertBefore(xe,Ot):we.appendChild(xe),this.options.group.revertClone&&this.animate(ie,xe),pe(xe,"display",""),St=!1}}};function Rv(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function ci(t,e,n,o,i,r,a,l){var u,c=t[Ve],d=c.options.onMove,f;return window.CustomEvent&&!bt&&!zn?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=n,u.draggedRect=o,u.related=i||e,u.relatedRect=r||De(e),u.willInsertAfter=l,u.originalEvent=a,t.dispatchEvent(u),d&&(f=d.call(c,u,a)),f}function Tr(t){t.draggable=!1}function Hv(){Dr=!1}function Vv(t,e,n){var o=De(en(n.el,0,n.options,!0)),i=Jl(n.el,n.options,me),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Lv(t,e,n){var o=De(xr(n.el,n.options.draggable)),i=Jl(n.el,n.options,me),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}function Fv(t,e,n,o,i,r,a,l){var u=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,f=o?n.bottom:n.right,h=!1;if(!a){if(l&&ri<c*i){if(!Ln&&(Vn===1?u>d+c*r/2:u<f-c*r/2)&&(Ln=!0),Ln)h=!0;else if(Vn===1?u<d+ri:u>f-ri)return-Vn}else if(u>d+c*(1-i)/2&&u<f-c*(1-i)/2)return jv(e)}return h=h||a,h&&(u<d+c*r/2||u>f-c*r/2)?u>d+c/2?1:-1:0}function jv(t){return qe(ie)<qe(t)?1:-1}function Gv(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Wv(t){si.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&si.push(o)}}function di(t){return setTimeout(t,0)}function Ir(t){return clearTimeout(t)}ai&&be(document,"touchmove",function(t){(ge.active||on)&&t.cancelable&&t.preventDefault()}),ge.utils={on:be,off:ye,css:pe,find:Yl,is:function(e,n){return!!et(e,n,e,!1)},extend:kv,throttle:ql,closest:et,toggleClass:We,clone:Zl,index:qe,nextTick:di,cancelNextTick:Ir,detectDirection:oc,getChild:en,expando:Ve},ge.get=function(t){return t[Ve]},ge.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(ge.utils=at(at({},ge.utils),o.utils)),On.mount(o)})},ge.create=function(t,e){return new ge(t,e)},ge.version=Sv;var Te=[],Fn,Mr,Br=!1,$r,zr,ui,jn;function Yv(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?be(document,"dragover",this._handleAutoScroll):this.options.supportPointer?be(document,"pointermove",this._handleFallbackAutoScroll):o.touches?be(document,"touchmove",this._handleFallbackAutoScroll):be(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?ye(document,"dragover",this._handleAutoScroll):(ye(document,"pointermove",this._handleFallbackAutoScroll),ye(document,"touchmove",this._handleFallbackAutoScroll),ye(document,"mousemove",this._handleFallbackAutoScroll)),ac(),fi(),Dv()},nulling:function(){ui=Mr=Fn=Br=jn=$r=zr=null,Te.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(ui=n,o||this.options.forceAutoScrollFallback||zn||bt||An){Ar(n,this.options,l,o);var u=Et(l,!0);Br&&(!jn||r!==$r||a!==zr)&&(jn&&ac(),jn=setInterval(function(){var c=Et(document.elementFromPoint(r,a),!0);c!==u&&(u=c,fi()),Ar(n,i.options,c,o)},10),$r=r,zr=a)}else{if(!this.options.bubbleScroll||Et(l,!0)===lt()){fi();return}Ar(n,this.options,Et(l,!1),!1)}}},yt(t,{pluginName:"scroll",initializeByDefault:!0})}function fi(){Te.forEach(function(t){clearInterval(t.pid)}),Te=[]}function ac(){clearInterval(jn)}var Ar=ql(function(t,e,n,o){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,u=lt(),c=!1,d;Mr!==n&&(Mr=n,fi(),Fn=e.scroll,d=e.scrollFn,Fn===!0&&(Fn=Et(n,!0)));var f=0,h=Fn;do{var p=h,y=De(p),m=y.top,b=y.bottom,T=y.left,x=y.right,g=y.width,C=y.height,A=void 0,z=void 0,j=p.scrollWidth,Y=p.scrollHeight,W=pe(p),D=p.scrollLeft,B=p.scrollTop;p===u?(A=g<j&&(W.overflowX==="auto"||W.overflowX==="scroll"||W.overflowX==="visible"),z=C<Y&&(W.overflowY==="auto"||W.overflowY==="scroll"||W.overflowY==="visible")):(A=g<j&&(W.overflowX==="auto"||W.overflowX==="scroll"),z=C<Y&&(W.overflowY==="auto"||W.overflowY==="scroll"));var k=A&&(Math.abs(x-i)<=a&&D+g<j)-(Math.abs(T-i)<=a&&!!D),V=z&&(Math.abs(b-r)<=a&&B+C<Y)-(Math.abs(m-r)<=a&&!!B);if(!Te[f])for(var _=0;_<=f;_++)Te[_]||(Te[_]={});(Te[f].vx!=k||Te[f].vy!=V||Te[f].el!==p)&&(Te[f].el=p,Te[f].vx=k,Te[f].vy=V,clearInterval(Te[f].pid),(k!=0||V!=0)&&(c=!0,Te[f].pid=setInterval((function(){o&&this.layer===0&&ge.active._onTouchMove(ui);var M=Te[this.layer].vy?Te[this.layer].vy*l:0,v=Te[this.layer].vx?Te[this.layer].vx*l:0;typeof d=="function"&&d.call(ge.dragged.parentNode[Ve],v,M,t,ui,Te[this.layer].el)!=="continue"||Kl(Te[this.layer].el,v,M)}).bind({layer:f}),24))),f++}while(e.bubbleScroll&&h!==u&&(h=Et(h,!1)));Br=c}},30),lc=function(e){var n=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,u=e.unhideGhostForTarget;if(n){var c=o||r;l();var d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(d.clientX,d.clientY);u(),c&&!c.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function Pr(){}Pr.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=en(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:lc},yt(Pr,{pluginName:"revertOnSpill"});function Or(){}Or.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,i=o||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:lc},yt(Or,{pluginName:"removeOnSpill"}),ge.mount(new Yv),ge.mount(Or,Pr);const cc=(t,e,n,o,i,r,a,l)=>{const u=s.ref(),c=s.reactive({}),d=s.computed(()=>{const v=[];return Object.keys(c).forEach(S=>{const I=c[S];I.dragType==="component"&&I.type!=="pkey"&&v.push(I)}),v}),f=(v=[],S)=>{const I=e?.value?.init;typeof I=="function"&&I(v,S)},h=v=>i?i(v,{componentDic:c,components:d.value,configData:u.value.config}):{},p=(v,S)=>{if(u.value?.id===v)return;const I=c[v]||S;if(I?u.value=I:v===n.id?u.value=n:u.value=null,u.value){const P=r[u.value.type];P?(f(P,u.value.config),h(u.value.type)):f([])}else f([]);S&&Se("dragClick",{id:S.id})},y=()=>t.value.$el.getBoundingClientRect(),m=v=>v===n.id?n:c[v]||{},b=v=>{const S=[];if(v===n.id)S.push({id:v,name:n.name});else{const I=c[v];if(I){S.push({id:v,name:I.name});const P=b(I.containerId);S.push(...P)}}return S},T=(v,S)=>{const I=c[S];if(I===void 0)return!1;const P=I.containerId;return v===P?!0:P===n.id?!1:T(v,P)},x=v=>o?o(v)||{}:{},g=(v,S,I,P)=>{if(l){const H=m(v);return l(I.componentType,{container:H,groupId:S,configData:I},P)}return!1},C=({name:v,type:S,dragType:I,isInput:P,componentName:H,runtimeType:$},O,F,G,X=!1)=>{const Z=x(S);if(Z.id=Vt(),Z.span=24,Z.componentType=S,A(O,Z.componentType))return;g(O,G,Z,!0);const U={id:Z.id,name:v,type:S,runtimeType:$,componentName:H||"",dragType:I||"component",containerId:O,isInput:!!P,level:c[O]?c[O].level+1:1,config:Z,isNewAdd:!X,groupId:G};return U.dragType==="container"&&(U.children=[]),c[U.id]=U,m(O).children?.splice(F,0,U),U},A=(v,S)=>!!(m(v).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(S)),z=(v,S,I=!1)=>{let P=null;const H=m(v).children,$=H?.findIndex(O=>O.id===S)||0;if(I&&H&&H.length>1){let O=$+1;$>0&&(O=$-1),P=H[O]}return H?.splice($,1),P?.id},j=(v,S,I,P)=>{const H=m(S).children,$=v.containerId!==S;v.containerId=S,v.groupId=P,H?.splice(I,0,v),g(S,P,v.config,$)&&(V(),p(v.id))},Y=v=>{let S="";const I=m(v);return I&&(I.children&&I.children.length>0&&I.children.forEach(P=>{Y(P.id)}),S=z(I.containerId,v,!0)||"",delete c[v]),u.value&&u.value.id===v&&(u.value=null,e.value.init([])),S},W=(v,S=[])=>{const I=m(v);if(I&&I.children&&I.children.length>0){const P=[];I.children.forEach(H=>{H.groupId&&S.includes(H.groupId)&&P.push(H.id)}),P.forEach(H=>{Y(H),delete c[H]})}},D=(v,S)=>{const I=m(v);I&&(I.children&&I.children.length>0&&I.children.forEach(P=>{P.groupId===S&&Y(P.id)}),delete c[v])},B=v=>{const S=gi(m(v));S.id=Vt(),S.config.id=S.id,c[S.id]=S;const I=m(S.containerId).children,P=I?.findIndex(H=>H.id===v)||0;I?.splice(P+1,0,S)},k=()=>{n.children=[],Sc(c),u.value&&(Se("dragClick",{id:""}),u.value=null,e.value.init([]))},V=()=>{u.value&&(Se("dragClick",{id:""}),u.value=null,e.value.init([]))},_=v=>{const S=u.value,I=m(S.containerId).children,P=I?.findIndex(H=>H.id===S.id)||0;Y(S.id),s.nextTick(()=>{const H=a[v],$=x(v);$.id=S.id,$.span=S.config.span,$.componentType=v,$.table=S.config.table,$.field=S.config.field,S.config.isSubTable&&($.isSubTable=S.config.isSubTable);const O={id:$.id,name:H.name,type:v,runtimeType:H.runtimeType,componentName:H.componentName||"",dragType:S.dragType,groupId:S.groupId,containerId:S.containerId,isInput:S.isInput,level:S.level,config:$,isNewAdd:!0};c[O.id]=O,I?.splice(P,0,O)})},M=v=>{Se("dragAddByClick",v)};return s.provide("d-drag-design-provide",{activedComponent:u,getDesignLocals:y,getComponent:m,getParentComponents:b,isMyChildComponent:T,selectComponent:p,addComponent:C,deleteComponent:Y,copyComponent:B,removeComponentFromContainer:z,addComponentToContainer:j,top:n,deleteChildren:D,deleteChildrens:W}),{activedComponent:u,clearComponents:k,changeComponent:_,schemaComponentDic:c,clearSelect:V,addComponent:C,addComponentByTable:M,designComponentList:d}},Uv=s.defineComponent({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(t,{expose:e}){const n=t,o=s.computed(()=>n.tableList.map(c=>({label:c.comment?`${c.name}(${c.comment})`:c.name,value:c.name}))),i=s.ref(),r=[{id:"layout",type:"j-layout",config:{top:48,topMove:!1,autoSize:["default"]},children:[{id:"table",type:"j-select",slot:"top",config:{label:"表名选择",loadOptions:()=>o,allowClear:!1}},{id:"fields",type:"j-table",config:{editConfig:{isAddBtn:!1,isRemoveBtn:!1},height:"100%",isMultiple:!0},children:[{id:"name",type:"span",config:{label:"字段名"}},{id:"type",type:"j-select",config:{label:"组件选择",options:n.componentList,width:200}}]}]}],a=(c,d)=>{if(c.id==="table"){const f=n.tableList.find(h=>h.name===d.value);if(f){const h=f.columns.map(p=>({value:p.name,name:p.coment?`${p.name}(${p.coment})`:p.name,type:"input",label:p.coment||p.name,selected:!p.isPrimary}));i.value.setFormData({fields:h})}}};return s.onMounted(()=>{i.value.init(r)}),e({ok:()=>{const c=i.value.getFormData(!1);return{addList:c.fields.filter(f=>f.selected),table:c.table,containerId:c.containerId,isSubTable:c.isSubTable}},closed:()=>{}}),(c,d)=>{const f=s.resolveComponent("j-form");return s.openBlock(),s.createBlock(f,{ref_key:"formRef",ref:i,"form-config":{labelWidth:"72px"},onChange:a},null,512)}}}),Xv={APP_PROVIDE:"jcode_app_provide"};function qv(t,e){return s.inject(t,e)}function Rr(){return qv(Xv.APP_PROVIDE,{t:(t,...e)=>{if(!t)return"";if(typeof t!="string")return t;let n=t||"";return e.length>0&&e.forEach((o,i)=>{n=n.replace(new RegExp(`\\{${i}\\}`,"g"),o)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:t,config:e})=>{if(t==null||t==="")return"";if(e?.dataType==="options"){let n=[t];typeof t=="string"&&t.split&&(n=t.split(","));const i=(e.options||[]).filter(r=>n.includes(r[e.valueKey||"value"])).map(r=>r[e.labelKey||"label"]);return String(i)||t}return t},getObjectList:({value:t,config:e})=>{if(t==null||t==="")return[];if(e?.dataType==="options"){let n=[t];return typeof t=="string"&&t.split&&(n=t.split(",")),(e.options||[]).filter(r=>n.includes(r[e.valueKey||"value"]))||[]}return[]}})})}const Kv=s.defineComponent({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){const{t:e}=Rr(),n=s.computed(()=>t.componentData.config?.notShowLabel?"0px":t.componentData.config?.labelWidth===void 0&&t.globalConfig.labelWidth!==void 0?`${t.globalConfig.labelWidth}px`:t.componentData.config?.labelWidth?`${t.componentData.config?.labelWidth}px`:void 0),o=s.computed(()=>{const i={...t.componentData?.config};return t.globalConfig.size===void 0&&(i.size=t.globalConfig.size),i.display=!0,i});return{labelWidth:n,inputConfig:o,t:e}}}),Zv=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n};function Jv(t,e,n,o,i,r){const a=s.resolveComponent("j-comp"),l=s.resolveComponent("el-form-item");return t.componentData.isInput?(s.openBlock(),s.createBlock(l,{key:0,"label-width":t.labelWidth,label:t.t(t.componentData.config?.notShowLabel?"":t.componentData.config?.label||""),rules:t.componentData.config?.required?[{required:!0,message:""}]:[]},{default:s.withCtx(()=>[s.createVNode(a,{type:t.componentData?.componentName||t.componentData?.type,config:t.inputConfig,modelValue:t.componentData?.config.defaultValue},null,8,["type","config","modelValue"])]),_:1},8,["label-width","label","rules"])):t.componentData?.children?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.mergeProps({key:1},t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"])):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.normalizeProps(s.mergeProps({key:2},t.componentData?.config)),null,16))}const dc=Zv(Kv,[["render",Jv]]),Qv={class:"d-form-design j-block"},e0={class:"d-form-design-left"},t0={class:"d-form-design-component-list"},n0={class:"j-component-tool"},o0={class:"j-component-tool-name"},i0={class:"d-form-design-center"},r0={class:"d-form-design-container"},s0={key:0,class:"d-form-design-empty"},a0={class:"d-form-design-right"},l0={class:"d-form-design-panel-title"},c0={style:{margin:"0","font-size":"14px"}},d0={class:"d-form-design-panel"},uc=Dt(s.defineComponent({name:"DFormDesign",__name:"formDesign",props:{notBindTable:{type:Boolean,default:!1},components:{default:()=>[]},componentConfigs:{default:()=>({})},componentInit:{type:Function,default:void 0},containerAddComponent:{type:Function,default:void 0},componentConfigInit:{type:Function,default:void 0},componentConfigChange:{type:Function,default:void 0},componentConfigValidate:{type:Function,default:void 0},flowComponents:{default:()=>[]},flowInit:{type:Function,default:void 0},flowComponentConfigInit:{type:Function,default:void 0},flowComponentConfigChange:{type:Function,default:void 0},flowComponentConfigs:{default:()=>({})},actions:{}},setup(t,{expose:e}){const n=t,{t:o,warning:i,error:r}=Rr(),a=s.reactive({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),l=s.ref([]),u=n.components.length;for(let K=0;K<u;K++)l.value.push(K);n.componentInit&&(a.config=n.componentInit("form")||{});const c=s.ref([]),d=s.computed(()=>c.value.map(K=>({label:K.comment?`${K.name}(${K.comment})`:K.name,value:K.name}))),f=s.computed(()=>{if(z.value){const K=A.value.getFormData(!1);if(K.table){const E=c.value.find(w=>w.name===K.table);if(E)return E.columns.map(w=>({value:w.name,label:w.coment?`${w.name}(${w.coment})`:w.name,coment:w.coment}))}}return[]}),h=K=>{c.value=K},p={},y=[];n.components.forEach(({children:K})=>{K.forEach(E=>{p[E.type]=E,E.dragType=E.dragType||"component",E.isInput!==!1&&(E.isInput=!0,y.push({label:E.name,value:E.type}))})});const m=K=>{K.forEach(E=>{E.type==="d-input-flow"&&(E.config=E.config||{},E.config.flowComponents=n.flowComponents,E.config.flowInit=n.flowInit,E.config.flowComponentConfigInit=w=>{n.flowComponentConfigInit&&(w.designComponents=B.value,w.component=z.value,n.flowComponentConfigInit(w))},E.config.flowComponentConfigs=n.flowComponentConfigs,E.config.flowComponentConfigChange=n.flowComponentConfigChange),E.children&&m(E.children)})},b={};Object.keys(n.componentConfigs||{}).forEach(K=>{const{hasBase:E,isInput:w,hasTwoPlaceholder:N,hasPlaceholder:L,hasSpan:R,hasLabel:oe,bindTable:ne,labelTitle:se}=p[K]||{hasBase:!1},re=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:w,options:y}},{id:"label",type:"j-input",config:{label:se||"标题"},getCompConfig:({formData:ce})=>({display:oe!==!1&&!ce.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(se||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:ce})=>({display:oe!==!1&&!ce.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:ce})=>({display:w&&!ce.notShowLabel&&!ce.isSubTable})},{id:"placeholder",type:"j-input",config:{display:w&&!N&&L!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!N,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!N,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:ce})=>({display:R!==!1&&!ce.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:ce})=>({display:!!ce.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:w&&ne!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>d},getCompConfig:({formData:ce})=>({display:(w&&ne!==!1||ne===!0)&&(!ce.isSubTable||ne===!0)&&!ce.isNotSave&&!n.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>f},getCompConfig:({formData:ce})=>({display:w&&ne!==!1&&!ce.isNotSave&&!n.notBindTable})},{id:"csType",type:"j-select",config:{label:"字段类型",allowClear:!1,options:[{label:"短文本",value:"string"},{label:"长文本",value:"text"},{label:"整数",value:"int"},{label:"小数",value:"decimal"},{label:"时间日期",value:"DateTime"}]},getCompConfig:({formData:ce})=>({display:w&&ne!==!1&&!ce.isNotSave&&n.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:ce})=>({display:w&&ne!==!1&&!ce.isNotSave&&n.notBindTable&&ce.csType==="string"})}],de={type:"j-collapse",config:{defaultValue:[]},children:[]};E!==!1&&(de.children?.push({config:{label:"基础信息"},children:[...re]}),de.config?.defaultValue.push("_collapse0")),de.children?.push(...n.componentConfigs[K]),m(de.children||[]),b[K]=[de]});const T=K=>{const{value:E}=K||{};K.id==="componentType"&&Y(E),z.value&&n.componentConfigChange&&(K.id==="field"&&K.data?.coment&&(z.value.config.label=K.data?.coment),n.componentConfigChange(z.value.type,{configRef:A,configData:z.value.config,...K})),K.id==="table"&&z.value&&z.value.type==="gridtable"&&(z.value.children||[]).forEach(w=>{w.isInput&&(w.config.table=E)})},x=(K,E)=>{p[K]?.isInput&&(n.notBindTable&&(E.configData.csType||A.value.setFormData({main:{csType:p[K]?.csType,fieldLen:p[K]?.fieldLen}})),d.value.length===1&&A.value.setFormData({main:{table:d.value[0].value}})),n.componentConfigInit&&n.componentConfigInit(K,{configRef:A,...E,notBindTable:n.notBindTable})},g=(K,E,w)=>{let N=!1;const L=p[K];return E.container.type==="gridtable"?(!E.configData.isSubTable||w)&&(E.configData.isSubTable=!0,L.isInput&&(E.configData.table=E.container.config.table,E.configData.field=""),N=!0):E.configData.isSubTable&&(N=!0,E.configData.isSubTable=!1,L.isInput&&(E.configData.table="")),n.containerAddComponent&&n.containerAddComponent(K,E),N},C=s.ref(),A=s.ref(),{activedComponent:z,clearComponents:j,changeComponent:Y,schemaComponentDic:W,addComponentByTable:D,designComponentList:B}=cc(C,A,a,n.componentInit,x,b,p,g),k=s.computed(()=>z.value?`【${z.value.name}】`:"");s.provide("dui-design-provide",{designItemName:dc});const V=()=>{n.componentInit&&(a.config=n.componentInit("form")||{}),j()},_=()=>{let K=0;const E=yr(a.config,a.children||[]);if(n.notBindTable){const w={};E.components.forEach(R=>{const{isInput:oe,bindTable:ne}=p[R.type]||{};oe&&ne!==!1?R.config.table&&!w.main&&(w.main={name:R.config.table,comment:"主表",type:"main",pKey:"J_Id"}):ne&&(w[R.id]={name:R.config.table||"t"+new Date().getTime()+K,comment:`子表${R.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},R.config.table=w[R.id].name,K++)}),w.main||(w.main={name:"t"+new Date().getTime()+K,comment:"主表",type:"main",pKey:"J_Id"},K++);let N=0;E.components.forEach(R=>{const{isInput:oe,bindTable:ne}=p[R.type]||{};!R.config.isNotSave&&oe&&ne!==!1&&(R.config.csType||(R.config.csType=p[R.type]?.csType,R.config.fieldLen=p[R.type]?.fieldLen),R.config.isSubTable?R.config.table=w[R.containerId].name:R.config.table=w.main.name,R.config.field=R.config.field||`f${Math.floor(Date.now()/1e3)}${N}`,N++)});const L=[];Object.keys(w).forEach(R=>{w[R].type==="chlid"&&(w[R].relationName=w.main.name,w[R].comment+=`,关联主表${w.main.name}`),L.push(w[R])}),E.db=L}else{const w={};c.value.forEach(N=>{N.columns.forEach(L=>{w[`${N.name}_${L.name}`]=L.csType})}),E.components.forEach(N=>{N.config.table&&N.config.field&&(N.config.csType=w[`${N.config.table}_${N.config.field}`])})}return n.notBindTable?E.db.forEach(w=>{if(!E.components.find(L=>L.config.table===w.name&&L.config.field==="J_Id")){const L=E.components.find(R=>R.config.table===w.name&&R.config.field);L&&E.components.push({id:w.name+"_J_Id",name:w.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:w.name,field:"J_Id",label:"主键"},containerId:L.containerId,level:L.level})}}):c.value.forEach(w=>{w.columns.forEach(N=>{if(N.isPrimary&&!E.components.find(R=>R.config.table===w.name&&R.config.field===N.name)){const R=E.components.find(oe=>oe.config.table===w.name&&oe.config.field);R&&E.components.push({id:w.name+"_"+N.name,name:w.name+"_"+N.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:w.name,field:N.name,label:"主键"+N.name,isIdentity:N.isIdentity},containerId:R.containerId,level:R.level})}})}),E},M=K=>{const E=bl(K,p);a.config=E.formConfig,a.children?.push(...E.componentList),Object.keys(E.componentDic).forEach(w=>{W[w]=E.componentDic[w]})},v=()=>{const K=yr(a.config,a.children||[]),E={},w={};return I(K.components,E,w)},S=K=>{const{isInput:E,bindTable:w}=p[K]||{};if(!E&&w)return!0},I=(K,E,w)=>{if(!n.notBindTable)for(const N of K){const{isInput:L,bindTable:R}=p[N.type]||{};if(!N.config.isNotSave&&N.type!=="pkey"){if(L&&R!==!1){if(Wn(N.config.table))return r&&r(`请【${N.config.label}】绑定数据表!`),!1;if(!N.config.isSubTable){if(w[N.config.table]&&S(w[N.config.table].type))return r&&r(`【${N.config.label}】和【${w[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(w[N.config.table]=N)}}else if(R){if(Wn(N.config.table))return r&&r(`【${N.config.label}】请绑定数据表!`),!1;if(w[N.config.table])return r&&r(`【${N.config.label}】和【${w[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(w[N.config.table]=N)}}}for(const N of K){if(!n.notBindTable){const{isInput:L,bindTable:R}=p[N.type]||{};if(!N.config.isNotSave&&L&&R!==!1){if(Wn(N.config.field))return r&&r(`请【${N.config.label}】绑定表字段!`),!1;if(E[`${N.config.table}-${N.config.field}`])return r&&r(`【${N.config.label}】和【${E[`${N.config.table}-${N.config.field}`].config.label}】重复绑定【${N.config.field}】字段!`),!1;E[`${N.config.table}-${N.config.field}`]=N}}if(n.componentConfigValidate&&!n.componentConfigValidate(N.type,{configData:N.config,errorTip:r}))return!1}return!0},P=s.ref(),H=s.ref(),$=s.reactive({width:0,height:0,formConfig:{}}),O=()=>{},F=()=>{},G=s.ref(),X=s.ref(),Z=()=>{const{addList:K,table:E}=X.value?.ok()||{addList:[]};if(K.length<=0)i&&i("请选择字段!");else{if(z.value?.config.componentType==="gridtable"||z.value?.config.isSubTable)if(z.value.config.table){if(z.value.config.table!==E){i&&i("请设置相同的表和子表!");return}}else{let w=z.value;z.value.config.isSubTable&&(w=W[z.value.containerId]),w.config.table=E,(w.children||[]).forEach(N=>{N.isInput&&(N.config.table=E)}),A.value.setFormData({main:{table:E}})}K.forEach(w=>{const N=vr(p[w.type]);N.config={table:E,field:w.value,label:w.label},D(N)}),G.value.close()}},U=()=>{X.value?.closed()};return e({setTables:K=>{h(K)},getSchema:()=>_(),setSchema:K=>M(K),reset:()=>V(),validate:()=>v()}),(K,E)=>{const w=s.resolveComponent("j-icon"),N=s.resolveComponent("d-drag-tool"),L=s.resolveComponent("el-collapse-item"),R=s.resolveComponent("el-collapse"),oe=s.resolveComponent("d-drag-form-list"),ne=s.resolveComponent("el-row"),se=s.resolveComponent("d-drag-container"),re=s.resolveComponent("j-form"),de=s.resolveComponent("j-layer");return s.openBlock(),s.createElementBlock("div",Qv,[s.createElementVNode("div",e0,[s.createElementVNode("div",t0,[s.createVNode(R,{modelValue:l.value,"onUpdate:modelValue":E[0]||(E[0]=ce=>l.value=ce)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.components,(ce,ve)=>(s.openBlock(),s.createBlock(L,{key:ve,title:ce.name,name:ve},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(ce.children,(Me,$e)=>(s.openBlock(),s.createBlock(N,{key:$e,config:Me},{default:s.withCtx(()=>[s.createElementVNode("div",n0,[s.createVNode(w,{class:"j-component-tool-icon",icon:Me.icon,size:14},null,8,["icon"]),s.createElementVNode("div",o0,s.toDisplayString(s.unref(o)(Me.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),s.createElementVNode("div",i0,[s.createElementVNode("div",r0,[s.createVNode(se,{ref_key:"dragContainer",ref:C,class:"d-form-design-drag-container","is-component-container":!1,"component-data":a},{default:s.withCtx(()=>[!a.children||a.children.length===0?(s.openBlock(),s.createElementBlock("div",s0,[...E[1]||(E[1]=[s.createElementVNode("div",null,"请从左侧拖拽组件到此处",-1)])])):(s.openBlock(),s.createBlock(ne,{key:1},{default:s.withCtx(()=>[s.createVNode(oe,{"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),s.withDirectives(s.createElementVNode("div",a0,[s.createElementVNode("div",l0,[s.createElementVNode("span",c0,s.toDisplayString(`${s.unref(o)("属性配置")}${k.value}`),1)]),s.createElementVNode("div",d0,[s.createVNode(re,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:A,onChange:T},null,512)])],512),[[s.vShow,s.unref(z)]]),s.createVNode(de,{ref_key:"previewFormLayerRef",ref:P,width:$.width,height:$.height,onOk:O,onClosed:F},{default:s.withCtx(()=>[s.createVNode(re,{config:$.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:H,actions:t.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),s.createVNode(de,{ref_key:"importFormLayerRef",ref:G,width:800,height:600,"btn-text":"确认",onOk:Z,onClosed:U},{default:s.withCtx(()=>[s.createVNode(Uv,{"component-list":y,"table-list":c.value,ref_key:"importComponentRef",ref:X},null,8,["table-list"])]),_:1},512)])}}}),[dc]),fc=(t,e)=>{const n={ver:"V3",indexPage:{...t},components:[]};return hc(e||[],n.components),n},hc=(t,e)=>{t.forEach(n=>{const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};if(n.dragType==="container"){const i=n.children||[];hc(i,e)}e.push(o)})},u0=t=>{const e=f0(t.components);return{pageConfig:t.indexPage,componentList:e}},f0=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{}};o.config&&Object.keys(o.config).forEach(r=>{i.config[r]=o.config[r]}),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{n[o]&&(n[o].children=e[o])}),e.indexPage||[]},h0=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.indexPage;const a={};r.components.forEach(l=>{const u=e[l.type];if(!u)return;a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:u.dragType||"component",componentName:u.componentName||"",runtimeType:u.runtimeType,groupId:l.groupId,config:l.config,isInput:!1,containerId:l.containerId,level:l.level};i[c.id]=c,a[l.containerId].push(c),c.dragType==="container"&&(c.children=[])}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.indexPage||[]}return{pageConfig:n,componentList:o,componentDic:i}},pc=s.defineComponent({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){return(e,n)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.mergeProps(t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"]))}}),p0={class:"d-index-design j-block"},g0={class:"d-index-design-left"},m0={class:"j-component-list"},y0={class:"j-component-tool"},v0={class:"j-component-tool-name"},b0={class:"d-index-design-center"},_0={class:"design-toolbar"},w0={class:"design-container"},x0={key:0,class:"j-block design-empty"},C0={class:"d-index-design-right"},E0={class:"d-index-design-panel-title"},S0={style:{margin:"0","font-size":"14px"}},N0={class:"d-index-design-panel"},gc=Dt(s.defineComponent({name:"DIndexDesign",__name:"indexDesign",props:{components:{type:Array,default:()=>[]},componentConfigs:{type:Object,default:()=>({})},componentInit:Function,containerAddComponent:Function,componentConfigInit:Function,componentConfigChange:Function,flowComponents:{type:Array,default:()=>[]},flowInit:Function,flowComponentConfigInit:Function,flowComponentConfigChange:Function,flowComponentConfigs:{type:Object,default:()=>({})}},setup(t,{expose:e}){const{t:n}=Rr(),o=t,i=v=>{v.forEach(S=>{S.type==="d-input-flow"&&(S.config=S.config||{},S.config.flowComponents=o.flowComponents,S.config.flowInit=o.flowInit,S.config.flowComponentConfigInit=I=>{o.flowComponentConfigInit&&(I.designComponents=b.value,I.component=p.value,o.flowComponentConfigInit(I))},S.config.flowComponentConfigs=o.flowComponentConfigs,S.config.flowComponentConfigChange=o.flowComponentConfigChange),S.children&&i(S.children)})},r=s.reactive({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});o.componentInit&&(r.config=o.componentInit("indexPage")||{});const a={},l=[];o.components.forEach(({children:v})=>{v.forEach(S=>{a[S.type]=S,S.dragType=S.dragType||"component",l.push({label:S.name,value:S.type})})});const u={};Object.keys(o.componentConfigs).forEach(v=>{const{hasBase:S}=a[v]||{hasBase:!1},I=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],P={type:"j-collapse",config:{defaultValue:[]},children:[]};S!==!1&&(P.children?.push({config:{label:"基础信息"},children:[...I]}),P.config?.defaultValue.push("_collapse0")),P.children?.push(...o.componentConfigs[v]),i(P.children||[]),u[v]=[P]});const c=v=>{p.value&&o.componentConfigChange&&o.componentConfigChange(p.value.type,{configRef:h,configData:p.value.config,...v})},d=(v,S)=>{o.componentConfigInit&&o.componentConfigInit(v,{configRef:h,...S})},f=s.ref(),h=s.ref(),{activedComponent:p,clearComponents:y,schemaComponentDic:m,designComponentList:b}=cc(f,h,r,o.componentInit,d,u,a,o.containerAddComponent),T=s.computed(()=>p.value?`【${p.value.name}】`:""),x=s.ref([]),g=o.components.length;for(let v=0;v<g;v++)x.value.push(v);s.provide("dui-design-provide",{designItemName:pc});const C=()=>{y()},A=()=>{o.componentInit&&(r.config=o.componentInit("indexPage")||{}),y()},z=()=>(console.log("pValidate"),!0),j=()=>fc(r.config,r.children||[]),Y=v=>{const S=h0(v,a);r.config=S.pageConfig,r.children?.push(...S.componentList),Object.keys(S.componentDic).forEach(I=>{m[I]=S.componentDic[I]})},W=s.ref(),D=s.ref();s.ref(""),s.reactive({formConfig:{}});let B=0;const k=v=>{if(D.value)B=0,D.value.init(v);else{if(B>600){console.warn("组件加载超时");return}B++,setTimeout(()=>{k(v)},100)}},V=()=>{},_=()=>{},M=()=>{const v=fc(r.config,r.children||[]),{componentList:S}=u0(v);W.value.open("页面预览","full"),s.nextTick(()=>{k(S)})};return e({reset:A,validate:z,getSchema:j,setSchema:Y}),(v,S)=>{const I=s.resolveComponent("j-icon"),P=s.resolveComponent("d-drag-tool"),H=s.resolveComponent("el-collapse-item"),$=s.resolveComponent("el-collapse"),O=s.resolveComponent("j-button"),F=s.resolveComponent("el-tooltip"),G=s.resolveComponent("el-divider"),X=s.resolveComponent("el-empty"),Z=s.resolveComponent("d-drag-index-list"),U=s.resolveComponent("d-drag-container"),J=s.resolveComponent("j-form"),te=s.resolveComponent("j-page"),Q=s.resolveComponent("j-layer");return s.openBlock(),s.createElementBlock("div",p0,[s.createElementVNode("div",g0,[S[1]||(S[1]=s.createElementVNode("div",{class:"d-index-design-panel-title"},"组件库",-1)),s.createElementVNode("div",m0,[s.createVNode($,{modelValue:x.value,"onUpdate:modelValue":S[0]||(S[0]=le=>x.value=le)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.components,(le,ee)=>(s.openBlock(),s.createBlock(H,{key:ee,title:le.name,name:ee},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(le.children,(K,E)=>(s.openBlock(),s.createBlock(P,{key:E,config:K},{default:s.withCtx(()=>[s.createElementVNode("div",y0,[s.createVNode(I,{class:"j-component-tool-icon",icon:K.icon,size:14},null,8,["icon"]),s.createElementVNode("div",v0,s.toDisplayString(s.unref(n)(K.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),s.createElementVNode("div",b0,[s.createElementVNode("div",_0,[S[2]||(S[2]=s.createElementVNode("div",null,null,-1)),s.createElementVNode("div",null,[s.createVNode(F,{content:s.unref(n)("清空")},{default:s.withCtx(()=>[s.createVNode(O,{danger:"",type:"text",onClick:C,icon:"mdi:delete-outline"})]),_:1},8,["content"]),s.createVNode(G,{direction:"vertical"}),s.createVNode(F,{content:s.unref(n)("预览")},{default:s.withCtx(()=>[s.createVNode(O,{type:"text",onClick:M,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),s.createElementVNode("div",w0,[s.createVNode(U,{ref_key:"dragContainer",ref:f,class:"design-drag-container","is-component-container":!1,"component-data":r},{default:s.withCtx(()=>[!r.children||r.children.length===0?(s.openBlock(),s.createElementBlock("div",x0,[s.createVNode(X,{description:s.unref(n)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):(s.openBlock(),s.createBlock(Z,{key:1,"component-list":r.children,"global-config":r.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),s.withDirectives(s.createElementVNode("div",C0,[s.createElementVNode("div",E0,[s.createElementVNode("span",S0,s.toDisplayString(`${s.unref(n)("属性配置")}${T.value}`),1)]),s.createElementVNode("div",N0,[s.createVNode(J,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:h,onChange:c},null,512)])],512),[[s.vShow,s.unref(p)&&u[s.unref(p).type]]]),s.createVNode(Q,{ref_key:"previewLayerRef",ref:W,"has-btns":!1,onOk:V,onClosed:_},{default:s.withCtx(()=>[s.createVNode(te,{ref_key:"previewRef",ref:D},null,512)]),_:1},512)])}}}),[pc]),k0=[gs,ki,Di,Ti,Ii,fl,hl,yl,vl,uc,gc],D0={install:t=>{k0.forEach(e=>{t.component(e.name,e)})}};Ee.DDrag=gs,Ee.DDraggable=vl,Ee.DFlowDesign=fl,Ee.DFormDesign=uc,Ee.DIndexDesign=gc,Ee.DInputFlow=hl,Ee.DLayout=yl,Ee.default=D0,Ee.dragContainer=Di,Ee.dragFormList=Ti,Ee.dragIndexList=Ii,Ee.dragTool=ki,Ee.toFormDesignSchema=bl,Ee.toFormSaveSchema=yr,Ee.toFormSchema=Ly,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|