@a2simcode/dui 0.0.32 → 0.0.34

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/dist/dui.umd.js CHANGED
@@ -1,28 +1,35 @@
1
- (function(me,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@a2simcode/ui")):typeof define=="function"&&define.amd?define(["exports","vue","@a2simcode/ui"],r):(me=typeof globalThis<"u"?globalThis:me||self,r(me.DuiUI={},me.Vue,me.SimCodeUI))})(this,function(me,r,qe){Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Je=(t,e)=>(t.install=n=>{n.component(t.name,t),e&&e.forEach(o=>{n.component(o.name,o)})},t),st=(t="")=>{const e=Date.now(),n=Math.floor(Math.random()*1e9);return t===""?String(n)+String(e):t+"_"+n+String(e)},Dn=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Dn);const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=Dn(t[n]));return e},Xr=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]},Tn={},jr=(t,e,n)=>{n[t]=n[t]||{};const o=st();return n[t][o]=e,o},Zr=(t,e,n)=>{const o=[],i=n[t]||{};return Object.keys(i).forEach(s=>{const a=i[s];try{a&&o.push(a(e))}catch(l){console.error(l)}}),o},Kr=(t,e,n)=>{if(e){const o=n[t];o&&delete o[e]}else delete n[t]},No=(t,e)=>jr(t,e,Tn),ye=(t,e)=>Zr(t,e,Tn),qr=(t,e)=>{Kr(t,e,Tn)},ko=(t,e,n,o,i,s)=>{const a=e.id,l=e.level,{getDesignLocals:d,selectComponent:c,getComponent:u,isMyChildComponent:h,addComponent:f,deleteComponent:g,getParentComponents:p,removeComponentFromContainer:b,addComponentToContainer:S,copyComponent:D,activedComponent:z,top:v}=(0,r.inject)("d-drag-design-provide",{}),M=[],U=(0,r.ref)(!1),$=(0,r.ref)(!1),Q=(0,r.ref)(!1),q=(0,r.ref)(!1),j=(0,r.ref)(!1),K={id:"",type:""},G=(0,r.ref)(!1),k=(0,r.ref)(!1);let Y="",w=null;const V=P=>{if(Y===P)return w;Y=P;const{top:X,left:ne,width:ie,height:le}=t.value.getBoundingClientRect();return w=[{x:ne,y:X},{x:ne+ie,y:X},{x:ne+ie,y:X+le},{x:ne,y:X+le}],w},m=(P,X,ne)=>{let ie=X-ne[0].y;ie<0&&(ie=-ie);let le=X-ne[3].y;le<0&&(le=-le);let ee=P-ne[0].x;ee<0&&(ee=-ee);let re=P-ne[1].x;return re<0&&(re=-re),{ly:ie>le?le:ie,typey:ie>le?"bottom":"top",lx:ee>re?re:ee,lallx:ee+re}},E=(P,X,ne)=>P>=ne[0].x&&P<=ne[1].x&&X>=ne[0].y&&X<=ne[3].y,B=()=>{if(i){ye("dragClick",{id:a});return}if(!$.value){if(c(a),l!==0){const P=t.value.getBoundingClientRect(),X=d();P.top-X.top<22?q.value=!0:q.value=!1}$.value=!0,ye("dragClick",{id:a})}},T=P=>{const X=g(P);X&&(0,r.nextTick)(()=>{ye("dragClick",{id:X})})},A=()=>{K.id="",K.type="",l===0&&(j.value=!1)},H=()=>{ye("mouseEnterOrLeave",{id:a,type:"enter"})},F=()=>{ye("mouseEnterOrLeave",{id:a,type:"leave"})},te=P=>{ye("dragClick",{id:P})},se={mouseEnterOrLeave:({id:P,type:X})=>{X==="enter"?M.push(P):M.length>0&&M.splice(M.length-1,1);const ne=M.length;ne>0&&a===M[ne-1]?U.value=!0:U.value=!1},dragAciveChild:({type:P,id:X})=>{X===a?P==="top"?(G.value=!0,k.value=!1):(k.value=!0,G.value=!1):(k.value=!1,G.value=!1)},dragClick({id:P,isAgain:X}){console.log("dragClick",P,a),P!==a?$.value=!1:(X&&($.value=!1),B())}};se[`dragGetChildDistance_${a}`]=({dragX:P,dragY:X,moveId:ne})=>m(P,X,V(ne));const L={isInContainer({x:P,y:X,id:ne,moveId:ie}){if(a===ne||h(ne,a))return Q.value=!1,{isIn:!1,level:l,id:a,groupId:s};const le=V(ie);if(E(P,X,le))return l===0&&(j.value=!0),{isIn:!0,level:l,id:a,groupId:s};if(l===0){const{ly:ee,lx:re}=m(P,X,le);if(ee<20&&re<20)return j.value=!0,{isIn:!0,level:l,id:a,groupId:s};j.value=!1}return Q.value=!1,{isIn:!1,level:l,id:a,groupId:s}},dragActiveContainer:({containerId:P,containerGroupId:X,dragX:ne,dragY:ie,moveId:le})=>{if(P===a&&X===s)if(Q.value=!0,o&&o.value.length>0){let ee={ly:9999999,lx:0,lallx:0,id:"",typey:""};o?.value.forEach(re=>{if(s&&re.groupId!==s)return;const C=ye(`dragGetChildDistance_${re.id}`,{dragX:ne,dragY:ie,moveId:le})[0];C&&(ee.ly>C.ly||ee.ly===C.ly&&(ee.lx>C.lx||ee.lx===C.lx&&ee.lallx>C.lallx))&&(ee=C,ee.id=re.id)}),K.id=ee.id,K.type=ee.typey,ye("dragAciveChild",{id:ee.id,type:ee.typey})}else ye("dragAciveChild",{id:""});else Q.value=!1},dragAdd:P=>{if(Q.value){let X=o?.value.length||0;K.id!==""&&K.id!==void 0&&(X=o?.value.findIndex(ne=>ne.id===K.id)||0,K.type==="bottom"&&(X+=1)),f(P,a,X,s),Q.value=!1}A()},dragAddByClick:P=>{if(!z.value&&a===v.id||z.value?.id===a||z.value?.containerId===a&&z.value?.dragType!=="container"){const X=f(P,a,o?.value.length||0,s,!0);X&&P.config&&Object.keys(P.config).forEach(ne=>{X.config[ne]=P.config[ne]})}},dragUpdate(P){if(Q.value){const X=u(P);if(X.level=l+1,K.id!==X.id){b(X.containerId,P);let ne=o?.value.findIndex(ie=>ie.id===K.id)||0;K.type==="bottom"&&(ne+=1),S(X,a,ne,s)}Q.value=!1,(0,r.nextTick)(()=>{ye("dragClick",{id:X.id,isAgain:!0})})}A()}},Z={};return(0,r.onMounted)(()=>{(!i||n!=="container")&&Object.keys(se).forEach(P=>{Z[P]=No(P,se[P])}),n==="container"&&Object.keys(L).forEach(P=>{Z[P]=No(P,L[P])}),e.isNewAdd&&(0,r.nextTick)(()=>{B(),delete e.isNewAdd})}),(0,r.onUnmounted)(()=>{Object.keys(Z).forEach(P=>{qr(P,Z[P])})}),{onMouseenter:H,onMouseleave:F,activeComponent:B,handleComponentClick:te,deleteComponentByClick:T,copyComponent:D,getParentComponents:p,isBottomToolBar:q,isHover:U,isSelect:$,isToContainer:Q,isMoveingInTopLevel:j,isTopActive:G,isBottomActive:k}},So=(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=(g,p)=>{o!==!0&&(o=!0,setTimeout(()=>{g(),o=!1},p))},s=(0,r.ref)(!1),a=(g,p,b)=>{const S=document.createElement("div");return S.id=n.dragElementId,S.innerText=g,S.className="d-drag-move",S.style.top=`${p}px`,S.style.left=`${b}px`,document.body.appendChild(S),S},l=()=>{document.onmousemove=null,document.onmouseup=null,s.value=!1,ye("dragAciveChild",{id:""})},d=()=>{l(),n.dragElement&&(n.dragElement.remove(),n.dragElement=null,e?ye("dragAdd",t):ye("dragUpdate",t.id))},c=g=>{const{clientY:p,clientX:b}=g;if(!n.dragElement){const S=Math.abs(n.x-b),D=Math.abs(n.y-p);if(S<=1&&D<=1)return;s.value=!0,n.dragElement=a(t.name,p-11,b-32)}n.dragElement.style.top=`${p-11}px`,n.dragElement.style.left=`${b-32}px`,n.clientX=b,n.clientY=p,i(()=>{if(!s.value)return;const S=ye("isInContainer",{x:b,y:p,id:t.id,moveId:n.id});n.toContainerLevel=-1,n.toContainerId="",n.groupId="",S.forEach(({level:D,id:z,isIn:v,groupId:M})=>{v&&n.toContainerLevel<D&&(n.toContainerLevel=D,n.toContainerId=z,n.groupId=M)}),n.toContainerId!==""?ye("dragActiveContainer",{containerId:n.toContainerId,containerGroupId:n.groupId,dragX:b,dragY:p,moveId:n.id}):ye("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{l()},onMousedown:g=>{n.x=g.clientX,n.y=g.clientY,n.id=st(),document.onmouseup=d,document.onmousemove=c},onClick:()=>{ye("dragAddByClick",t)},moveActive:s}},Jr={class:"d-drag-btns-pname"},Qr={key:0,class:"d-drag-mask"},es=(0,r.defineComponent)({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(t){const e=t,n=(0,r.ref)(),{onMouseenter:o,onMouseleave:i,activeComponent:s,handleComponentClick:a,deleteComponentByClick:l,copyComponent:d,getParentComponents:c,isHover:u,isSelect:h,isTopActive:f,isBottomActive:g,isBottomToolBar:p}=ko(n,e.componentData,"component"),{onContextmenu:b,onMousedown:S,moveActive:D}=So(e.componentData,!1);return(z,v)=>{const M=(0,r.resolveComponent)("j-button"),U=(0,r.resolveComponent)("el-space");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["d-drag-component",{selected:(0,r.unref)(h),hovered:(0,r.unref)(u),isBottomToolBar:(0,r.unref)(p),active:(0,r.unref)(D),isTopActive:(0,r.unref)(f),isBottomActive:(0,r.unref)(g)}])},[v[11]||(v[11]=(0,r.createElementVNode)("div",{class:"d-drag-line"},null,-1)),(0,r.createElementVNode)("div",{class:"d-drag-btns",onMouseenter:v[4]||(v[4]=(...$)=>(0,r.unref)(o)&&(0,r.unref)(o)(...$)),onMouseleave:v[5]||(v[5]=(...$)=>(0,r.unref)(i)&&(0,r.unref)(i)(...$))},[(0,r.createVNode)(U,{size:4},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,r.withModifiers)(()=>{},["stop"])},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"]),(0,r.createElementVNode)("div",Jr,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(c)(t.componentData.containerId),$=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:$.id},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",label:$.name,onClick:Q=>(0,r.unref)(a)($.id)},null,8,["label","onClick"])]))),128))])]),(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:v[0]||(v[0]=(0,r.withModifiers)($=>(0,r.unref)(d)(t.componentData.id),["stop"]))}),(0,r.createElementVNode)("div",{onContextmenu:v[1]||(v[1]=(0,r.withModifiers)((...$)=>(0,r.unref)(b)&&(0,r.unref)(b)(...$),["stop"])),onMousedown:v[2]||(v[2]=(0,r.withModifiers)((...$)=>(0,r.unref)(S)&&(0,r.unref)(S)(...$),["stop"])),style:{display:"flex"}},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),(0,r.createVNode)(M,{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:v[3]||(v[3]=(0,r.withModifiers)($=>(0,r.unref)(l)(t.componentData.id),["stop"]))})]),_:1})],32),(0,r.createElementVNode)("div",{ref_key:"refDrag",ref:n,class:"d-drag-body",onClick:v[6]||(v[6]=(0,r.withModifiers)((...$)=>(0,r.unref)(s)&&(0,r.unref)(s)(...$),["stop"])),onContextmenu:v[7]||(v[7]=(0,r.withModifiers)((...$)=>(0,r.unref)(b)&&(0,r.unref)(b)(...$),["stop"])),onMousedown:v[8]||(v[8]=(0,r.withModifiers)((...$)=>(0,r.unref)(S)&&(0,r.unref)(S)(...$),["stop"])),onMouseenter:v[9]||(v[9]=(...$)=>(0,r.unref)(o)&&(0,r.unref)(o)(...$)),onMouseleave:v[10]||(v[10]=(...$)=>(0,r.unref)(i)&&(0,r.unref)(i)(...$))},[(0,r.renderSlot)(z.$slots,"default"),t.isContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",Qr))],544)],2)}}}),Mn=es,ts=(0,r.defineComponent)({name:"DDragTool",__name:"tool",props:{config:{}},setup(t){const{onContextmenu:e,onMousedown:n,onClick:o}=So(t.config??{name:"",id:""},!0);return(i,s)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-drag-tool",onClick:s[0]||(s[0]=(0,r.withModifiers)((...a)=>(0,r.unref)(o)&&(0,r.unref)(o)(...a),["stop"])),onContextmenu:s[1]||(s[1]=(0,r.withModifiers)((...a)=>(0,r.unref)(e)&&(0,r.unref)(e)(...a),["stop"])),onMousedown:s[2]||(s[2]=(0,r.withModifiers)((...a)=>(0,r.unref)(n)&&(0,r.unref)(n)(...a),["stop"]))},[(0,r.renderSlot)(i.$slots,"default")],32))}}),In=ts,ns={key:0,class:"d-drag-line"},os={key:1,class:"d-drag-btns"},is=(0,r.defineComponent)({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(t){const e=t,n=(0,r.ref)(),o=(0,r.computed)(()=>e.componentData?.children||[]),{onMouseenter:i,onMouseleave:s,activeComponent:a,isHover:l,isSelect:d,isToContainer:c,isMoveingInTopLevel:u,isTopActive:h,isBottomActive:f}=ko(n,e.componentData,"container",o,e.isComponentContainer,e.groupId),g=(0,r.computed)(()=>!!(o.value.findIndex(p=>p.groupId===e.groupId)===-1&&c.value));return(p,b)=>{const S=(0,r.resolveComponent)("j-button");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"refDrag",ref:n,class:(0,r.normalizeClass)(["d-drag-container",{selected:(0,r.unref)(d)&&!t.isComponentContainer,hovered:(0,r.unref)(l)&&!t.isComponentContainer,isTopLevel:t.componentData.level===0,active:g.value,isMoveingInTopLevel:(0,r.unref)(u),isTopActive:(0,r.unref)(h),isBottomActive:(0,r.unref)(f)}])},[t.isComponentContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",ns)),t.isComponentContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",os,[(0,r.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,r.withModifiers)(()=>{},["stop"])},[(0,r.createVNode)(S,{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"])])])),(0,r.createElementVNode)("div",{class:"d-drag-body",onClick:b[0]||(b[0]=(0,r.withModifiers)((...D)=>(0,r.unref)(a)&&(0,r.unref)(a)(...D),["stop"])),onMouseenter:b[1]||(b[1]=(...D)=>(0,r.unref)(i)&&(0,r.unref)(i)(...D)),onMouseleave:b[2]||(b[2]=(...D)=>(0,r.unref)(s)&&(0,r.unref)(s)(...D))},[(0,r.renderSlot)(p.$slots,"default")],32)],2)}}}),Bn=is,rs=(0,r.defineComponent)({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,r.inject)("dui-design-provide",{});return(n,o)=>{const i=(0,r.resolveComponent)("el-col");return(0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.componentList,s=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:s.id},[s.type!="pkey"?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,span:s.config.span||24},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Mn,{"is-container":s.dragType!=="component","component-data":s},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(e)),{"component-data":s,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):(0,r.createCommentVNode)("",!0)],64))),128)}}}),zn=rs,ss=(0,r.defineComponent)({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,r.inject)("dui-design-provide",{}),n=o=>{if(o.flexWidth)return{width:o.flexWidth+"%"}};return(o,i)=>((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.componentList,s=>((0,r.openBlock)(),(0,r.createBlock)(Mn,{key:s.id,style:(0,r.normalizeStyle)(n(s.config)),"is-container":s.dragType!=="component","component-data":s},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(e)),{"component-data":s,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),Rn=ss,Do=Je(Mn,[In,Bn,zn,Rn]);function wt(t){return(0,r.getCurrentScope)()?((0,r.onScopeDispose)(t),!0):!1}function He(t){return typeof t=="function"?t():(0,r.unref)(t)}var as=typeof window<"u"&&typeof document<"u",ls=t=>typeof t<"u",cs=Object.prototype.toString,ds=t=>cs.call(t)==="[object Object]",us=()=>{};function fs(t,e){function n(...o){return new Promise((i,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(s)})}return n}var To=t=>t();function hs(t=To){const e=(0,r.ref)(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...s)=>{e.value&&t(...s)};return{isActive:(0,r.readonly)(e),pause:n,resume:o,eventFilter:i}}function Mo(t,e=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(e?()=>i(n):o,t)})}function gs(t,e,n={}){const{eventFilter:o=To,...i}=n;return(0,r.watch)(t,fs(o,e),i)}function at(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:s,pause:a,resume:l,isActive:d}=hs(o);return{stop:gs(t,e,{...i,eventFilter:s}),pause:a,resume:l,isActive:d}}function ps(t,e={}){if(!(0,r.isRef)(t))return(0,r.toRefs)(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=(0,r.customRef)(()=>({get(){return t.value[o]},set(i){var s;if((s=He(e.replaceRef))==null||s)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 An(t,e=!1){function n(h,{flush:f="sync",deep:g=!1,timeout:p,throwOnTimeout:b}={}){let S=null;const D=[new Promise(z=>{S=(0,r.watch)(t,v=>{h(v)!==e&&(S?.(),z(v))},{flush:f,deep:g,immediate:!0})})];return p!=null&&D.push(Mo(p,b).then(()=>He(t)).finally(()=>S?.())),Promise.race(D)}function o(h,f){if(!(0,r.isRef)(h))return n(v=>v===h,f);const{flush:g="sync",deep:p=!1,timeout:b,throwOnTimeout:S}=f??{};let D=null;const z=[new Promise(v=>{D=(0,r.watch)([t,h],([M,U])=>{e!==(M===U)&&(D?.(),v(M))},{flush:g,deep:p,immediate:!0})})];return b!=null&&z.push(Mo(b,S).then(()=>He(t)).finally(()=>(D?.(),He(t)))),Promise.race(z)}function i(h){return n(f=>!!f,h)}function s(h){return o(null,h)}function a(h){return o(void 0,h)}function l(h){return n(Number.isNaN,h)}function d(h,f){return n(g=>{const p=Array.from(g);return p.includes(h)||p.includes(He(h))},f)}function c(h){return u(1,h)}function u(h=1,f){let g=-1;return n(()=>(g+=1,g>=h),f)}return Array.isArray(He(t))?{toMatch:n,toContains:d,changed:c,changedTimes:u,get not(){return An(t,!e)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:s,toBeNaN:l,toBeUndefined:a,changed:c,changedTimes:u,get not(){return An(t,!e)}}}function $n(t){return An(t)}function ms(t){var e;const n=He(t);return(e=n?.$el)!=null?e:n}var Io=as?window:void 0;function Bo(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=Io):[e,n,o,i]=t,!e)return us;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach(u=>u()),s.length=0},l=(u,h,f,g)=>(u.addEventListener(h,f,g),()=>u.removeEventListener(h,f,g)),d=(0,r.watch)(()=>[ms(e),He(i)],([u,h])=>{if(a(),!u)return;const f=ds(h)?{...h}:h;s.push(...n.flatMap(g=>o.map(p=>l(u,g,p,f))))},{immediate:!0,flush:"post"}),c=()=>{d(),a()};return wt(c),c}function ys(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function zo(...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=Io,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=o,d=ys(e);return Bo(i,s,u=>{u.repeat&&He(l)||d(u)&&n(u)},a)}function vs(t){return JSON.parse(JSON.stringify(t))}function Pn(t,e,n,o={}){var i,s,a;const{clone:l=!1,passive:d=!1,eventName:c,deep:u=!1,defaultValue:h,shouldEmit:f}=o,g=(0,r.getCurrentInstance)(),p=n||g?.emit||((i=g?.$emit)==null?void 0:i.bind(g))||((a=(s=g?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(g?.proxy));let b=c;e||(e="modelValue"),b=b||`update:${e.toString()}`;const S=v=>l?typeof l=="function"?l(v):vs(v):v,D=()=>ls(t[e])?S(t[e]):h,z=v=>{f?f(v)&&p(b,v):p(b,v)};if(d){const v=(0,r.ref)(D());let M=!1;return(0,r.watch)(()=>t[e],U=>{M||(M=!0,v.value=S(U),(0,r.nextTick)(()=>M=!1))}),(0,r.watch)(v,U=>{!M&&(U!==t[e]||u)&&z(U)},{deep:u}),v}else return(0,r.computed)({get(){return D()},set(v){z(v)}})}var _s={value:()=>{}};function Ht(){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 Lt(n)}function Lt(t){this._=t}function ws(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}})}Lt.prototype=Ht.prototype={constructor:Lt,on:function(t,e){var n=this._,o=ws(t+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(t=o[s]).type)&&(i=bs(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=o[s]).type)n[i]=Ro(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Ro(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 Lt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],o=0,i=s.length;o<i;++o)s[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,s=o.length;i<s;++i)o[i].value.apply(e,n)}};function bs(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}function Ro(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=_s,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var On="http://www.w3.org/1999/xhtml",Ao={svg:"http://www.w3.org/2000/svg",xhtml:On,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ft(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ao.hasOwnProperty(e)?{space:Ao[e],local:t}:t}function Cs(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===On&&e.documentElement.namespaceURI===On?e.createElement(t):e.createElementNS(n,t)}}function Es(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $o(t){var e=Ft(t);return(e.local?Es:Cs)(e)}function xs(){}function Vn(t){return t==null?xs:function(){return this.querySelector(t)}}function Ns(t){typeof t!="function"&&(t=Vn(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=new Array(a),d,c,u=0;u<a;++u)(d=s[u])&&(c=t.call(d,d.__data__,u,s))&&("__data__"in d&&(c.__data__=d.__data__),l[u]=c);return new Se(o,this._parents)}function ks(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ss(){return[]}function Po(t){return t==null?Ss:function(){return this.querySelectorAll(t)}}function Ds(t){return function(){return ks(t.apply(this,arguments))}}function Ts(t){typeof t=="function"?t=Ds(t):t=Po(t);for(var e=this._groups,n=e.length,o=[],i=[],s=0;s<n;++s)for(var a=e[s],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 Se(o,i)}function Oo(t){return function(){return this.matches(t)}}function Vo(t){return function(e){return e.matches(t)}}var Ms=Array.prototype.find;function Is(t){return function(){return Ms.call(this.children,t)}}function Bs(){return this.firstElementChild}function zs(t){return this.select(t==null?Bs:Is(typeof t=="function"?t:Vo(t)))}var Rs=Array.prototype.filter;function As(){return Array.from(this.children)}function $s(t){return function(){return Rs.call(this.children,t)}}function Ps(t){return this.selectAll(t==null?As:$s(typeof t=="function"?t:Vo(t)))}function Os(t){typeof t!="function"&&(t=Oo(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],d,c=0;c<a;++c)(d=s[c])&&t.call(d,d.__data__,c,s)&&l.push(d);return new Se(o,this._parents)}function Ho(t){return new Array(t.length)}function Vs(){return new Se(this._enter||this._groups.map(Ho),this._parents)}function Gt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Gt.prototype={constructor:Gt,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 Hs(t){return function(){return t}}function Ls(t,e,n,o,i,s){for(var a=0,l,d=e.length,c=s.length;a<c;++a)(l=e[a])?(l.__data__=s[a],o[a]=l):n[a]=new Gt(t,s[a]);for(;a<d;++a)(l=e[a])&&(i[a]=l)}function Fs(t,e,n,o,i,s,a){var l,d,c=new Map,u=e.length,h=s.length,f=new Array(u),g;for(l=0;l<u;++l)(d=e[l])&&(f[l]=g=a.call(d,d.__data__,l,e)+"",c.has(g)?i[l]=d:c.set(g,d));for(l=0;l<h;++l)g=a.call(t,s[l],l,s)+"",(d=c.get(g))?(o[l]=d,d.__data__=s[l],c.delete(g)):n[l]=new Gt(t,s[l]);for(l=0;l<u;++l)(d=e[l])&&c.get(f[l])===d&&(i[l]=d)}function Gs(t){return t.__data__}function Ws(t,e){if(!arguments.length)return Array.from(this,Gs);var n=e?Fs:Ls,o=this._parents,i=this._groups;typeof t!="function"&&(t=Hs(t));for(var s=i.length,a=new Array(s),l=new Array(s),d=new Array(s),c=0;c<s;++c){var u=o[c],h=i[c],f=h.length,g=Us(t.call(u,u&&u.__data__,c,o)),p=g.length,b=l[c]=new Array(p),S=a[c]=new Array(p);n(u,h,b,S,d[c]=new Array(f),g,e);for(var D=0,z=0,v,M;D<p;++D)if(v=b[D]){for(D>=z&&(z=D+1);!(M=S[z])&&++z<p;);v._next=M||null}}return a=new Se(a,o),a._enter=l,a._exit=d,a}function Us(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ys(){return new Se(this._exit||this._groups.map(Ho),this._parents)}function Xs(t,e,n){var o=this.enter(),i=this,s=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?s.remove():n(s),o&&i?o.merge(i).order():i}function js(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),d=0;d<a;++d)for(var c=n[d],u=o[d],h=c.length,f=l[d]=new Array(h),g,p=0;p<h;++p)(g=c[p]||u[p])&&(f[p]=g);for(;d<i;++d)l[d]=n[d];return new Se(l,this._parents)}function Zs(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Ks(t){t||(t=qs);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,d=i[s]=new Array(l),c,u=0;u<l;++u)(c=a[u])&&(d[u]=c);d.sort(e)}return new Se(i,this._parents).order()}function qs(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Js(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Qs(){return Array.from(this)}function ea(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}function ta(){let t=0;for(const e of this)++t;return t}function na(){return!this.node()}function oa(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&t.call(l,l.__data__,s,i);return this}function ia(t){return function(){this.removeAttribute(t)}}function ra(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sa(t,e){return function(){this.setAttribute(t,e)}}function aa(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function la(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ca(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 da(t,e){var n=Ft(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?ra:ia:typeof e=="function"?n.local?ca:la:n.local?aa:sa)(n,e))}function Lo(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ua(t){return function(){this.style.removeProperty(t)}}function fa(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ha(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function ga(t,e,n){return arguments.length>1?this.each((e==null?ua:typeof e=="function"?ha:fa)(t,e,n??"")):lt(this.node(),t)}function lt(t,e){return t.style.getPropertyValue(e)||Lo(t).getComputedStyle(t,null).getPropertyValue(e)}function pa(t){return function(){delete this[t]}}function ma(t,e){return function(){this[t]=e}}function ya(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function va(t,e){return arguments.length>1?this.each((e==null?pa:typeof e=="function"?ya:ma)(t,e)):this.node()[t]}function Fo(t){return t.trim().split(/^|\s+/)}function Hn(t){return t.classList||new Go(t)}function Go(t){this._node=t,this._names=Fo(t.getAttribute("class")||"")}Go.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 Wo(t,e){for(var n=Hn(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function Uo(t,e){for(var n=Hn(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function _a(t){return function(){Wo(this,t)}}function wa(t){return function(){Uo(this,t)}}function ba(t,e){return function(){(e.apply(this,arguments)?Wo:Uo)(this,t)}}function Ca(t,e){var n=Fo(t+"");if(arguments.length<2){for(var o=Hn(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ba:e?_a:wa)(n,e))}function Ea(){this.textContent=""}function xa(t){return function(){this.textContent=t}}function Na(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ka(t){return arguments.length?this.each(t==null?Ea:(typeof t=="function"?Na:xa)(t)):this.node().textContent}function Sa(){this.innerHTML=""}function Da(t){return function(){this.innerHTML=t}}function Ta(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ma(t){return arguments.length?this.each(t==null?Sa:(typeof t=="function"?Ta:Da)(t)):this.node().innerHTML}function Ia(){this.nextSibling&&this.parentNode.appendChild(this)}function Ba(){return this.each(Ia)}function za(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ra(){return this.each(za)}function Aa(t){var e=typeof t=="function"?t:$o(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function $a(){return null}function Pa(t,e){var n=typeof t=="function"?t:$o(t),o=e==null?$a:typeof e=="function"?e:Vn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Oa(){var t=this.parentNode;t&&t.removeChild(this)}function Va(){return this.each(Oa)}function Ha(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function La(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Fa(t){return this.select(t?La:Ha)}function Ga(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Wa(t){return function(e){t.call(this,e,this.__data__)}}function Ua(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 Ya(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++o]=s;++o?e.length=o:delete this.__on}}}function Xa(t,e,n){return function(){var o=this.__on,i,s=Wa(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=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},o?o.push(i):this.__on=[i]}}function ja(t,e,n){var o=Ua(t+""),i,s=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<s;++i)if((a=o[i]).type===u.type&&a.name===u.name)return u.value}return}for(l=e?Xa:Ya,i=0;i<s;++i)this.each(l(o[i],e,n));return this}function Yo(t,e,n){var o=Lo(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 Za(t,e){return function(){return Yo(this,t,e)}}function Ka(t,e){return function(){return Yo(this,t,e.apply(this,arguments))}}function qa(t,e){return this.each((typeof e=="function"?Ka:Za)(t,e))}function*Ja(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}var Xo=[null];function Se(t,e){this._groups=t,this._parents=e}function bt(){return new Se([[document.documentElement]],Xo)}function Qa(){return this}Se.prototype=bt.prototype={constructor:Se,select:Ns,selectAll:Ts,selectChild:zs,selectChildren:Ps,filter:Os,data:Ws,enter:Vs,exit:Ys,join:Xs,merge:js,selection:Qa,order:Zs,sort:Ks,call:Js,nodes:Qs,node:ea,size:ta,empty:na,each:oa,attr:da,style:ga,property:va,classed:Ca,text:ka,html:Ma,raise:Ba,lower:Ra,append:Aa,insert:Pa,remove:Va,clone:Fa,datum:Ga,on:ja,dispatch:qa,[Symbol.iterator]:Ja};function Ie(t){return typeof t=="string"?new Se([[document.querySelector(t)]],[document.documentElement]):new Se([[t]],Xo)}function el(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Ae(t,e){if(t=el(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 tl={passive:!1},Ct={capture:!0,passive:!1};function Ln(t){t.stopImmediatePropagation()}function ct(t){t.preventDefault(),t.stopImmediatePropagation()}function jo(t){var e=t.document.documentElement,n=Ie(t).on("dragstart.drag",ct,Ct);"onselectstart"in e?n.on("selectstart.drag",ct,Ct):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Zo(t,e){var n=t.document.documentElement,o=Ie(t).on("dragstart.drag",null);e&&(o.on("click.drag",ct,Ct),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 Wt=t=>()=>t;function Fn(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:s,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:s,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}})}Fn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function nl(t){return!t.ctrlKey&&!t.button}function ol(){return this.parentNode}function il(t,e){return e??{x:t.x,y:t.y}}function rl(){return navigator.maxTouchPoints||"ontouchstart"in this}function sl(){var t=nl,e=ol,n=il,o=rl,i={},s=Ht("start","drag","end"),a=0,l,d,c,u,h=0;function f(M){M.on("mousedown.drag",g).filter(o).on("touchstart.drag",S).on("touchmove.drag",D,tl).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(M,U){if(!(u||!t.call(this,M,U))){var $=v(this,e.call(this,M,U),M,U,"mouse");$&&(Ie(M.view).on("mousemove.drag",p,Ct).on("mouseup.drag",b,Ct),jo(M.view),Ln(M),c=!1,l=M.clientX,d=M.clientY,$("start",M))}}function p(M){if(ct(M),!c){var U=M.clientX-l,$=M.clientY-d;c=U*U+$*$>h}i.mouse("drag",M)}function b(M){Ie(M.view).on("mousemove.drag mouseup.drag",null),Zo(M.view,c),ct(M),i.mouse("end",M)}function S(M,U){if(t.call(this,M,U)){var $=M.changedTouches,Q=e.call(this,M,U),q=$.length,j,K;for(j=0;j<q;++j)(K=v(this,Q,M,U,$[j].identifier,$[j]))&&(Ln(M),K("start",M,$[j]))}}function D(M){var U=M.changedTouches,$=U.length,Q,q;for(Q=0;Q<$;++Q)(q=i[U[Q].identifier])&&(ct(M),q("drag",M,U[Q]))}function z(M){var U=M.changedTouches,$=U.length,Q,q;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),Q=0;Q<$;++Q)(q=i[U[Q].identifier])&&(Ln(M),q("end",M,U[Q]))}function v(M,U,$,Q,q,j){var K=s.copy(),G=Ae(j||$,U),k,Y,w;if((w=n.call(M,new Fn("beforestart",{sourceEvent:$,target:f,identifier:q,active:a,x:G[0],y:G[1],dx:0,dy:0,dispatch:K}),Q))!=null)return k=w.x-G[0]||0,Y=w.y-G[1]||0,function V(m,E,B){var T=G,A;switch(m){case"start":i[q]=V,A=a++;break;case"end":delete i[q],--a;case"drag":G=Ae(B||E,U),A=a;break}K.call(m,M,new Fn(m,{sourceEvent:E,subject:w,target:f,identifier:q,active:A,x:G[0]+k,y:G[1]+Y,dx:G[0]-T[0],dy:G[1]-T[1],dispatch:K}),Q)}}return f.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Wt(!!M),f):t},f.container=function(M){return arguments.length?(e=typeof M=="function"?M:Wt(M),f):e},f.subject=function(M){return arguments.length?(n=typeof M=="function"?M:Wt(M),f):n},f.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Wt(!!M),f):o},f.on=function(){var M=s.on.apply(s,arguments);return M===s?f:M},f.clickDistance=function(M){return arguments.length?(h=(M=+M)*M,f):Math.sqrt(h)},f}function Gn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ko(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Et(){}var xt=.7,Ut=1/xt,dt="\\s*([+-]?\\d+)\\s*",Nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",al=/^#([0-9a-f]{3,8})$/,ll=new RegExp(`^rgb\\(${dt},${dt},${dt}\\)$`),cl=new RegExp(`^rgb\\(${$e},${$e},${$e}\\)$`),dl=new RegExp(`^rgba\\(${dt},${dt},${dt},${Nt}\\)$`),ul=new RegExp(`^rgba\\(${$e},${$e},${$e},${Nt}\\)$`),fl=new RegExp(`^hsl\\(${Nt},${$e},${$e}\\)$`),hl=new RegExp(`^hsla\\(${Nt},${$e},${$e},${Nt}\\)$`),qo={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};Gn(Et,Qe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Jo,formatHex:Jo,formatHex8:gl,formatHsl:pl,formatRgb:Qo,toString:Qo});function Jo(){return this.rgb().formatHex()}function gl(){return this.rgb().formatHex8()}function pl(){return ii(this).formatHsl()}function Qo(){return this.rgb().formatRgb()}function Qe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=al.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ei(e):n===3?new xe(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Yt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Yt(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=ll.exec(t))?new xe(e[1],e[2],e[3],1):(e=cl.exec(t))?new xe(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dl.exec(t))?Yt(e[1],e[2],e[3],e[4]):(e=ul.exec(t))?Yt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=fl.exec(t))?oi(e[1],e[2]/100,e[3]/100,1):(e=hl.exec(t))?oi(e[1],e[2]/100,e[3]/100,e[4]):qo.hasOwnProperty(t)?ei(qo[t]):t==="transparent"?new xe(NaN,NaN,NaN,0):null}function ei(t){return new xe(t>>16&255,t>>8&255,t&255,1)}function Yt(t,e,n,o){return o<=0&&(t=e=n=NaN),new xe(t,e,n,o)}function ml(t){return t instanceof Et||(t=Qe(t)),t?(t=t.rgb(),new xe(t.r,t.g,t.b,t.opacity)):new xe}function Wn(t,e,n,o){return arguments.length===1?ml(t):new xe(t,e,n,o??1)}function xe(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Gn(xe,Wn,Ko(Et,{brighter(t){return t=t==null?Ut:Math.pow(Ut,t),new xe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?xt:Math.pow(xt,t),new xe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new xe(et(this.r),et(this.g),et(this.b),Xt(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:ti,formatHex:ti,formatHex8:yl,formatRgb:ni,toString:ni}));function ti(){return`#${tt(this.r)}${tt(this.g)}${tt(this.b)}`}function yl(){return`#${tt(this.r)}${tt(this.g)}${tt(this.b)}${tt((isNaN(this.opacity)?1:this.opacity)*255)}`}function ni(){const t=Xt(this.opacity);return`${t===1?"rgb(":"rgba("}${et(this.r)}, ${et(this.g)}, ${et(this.b)}${t===1?")":`, ${t})`}`}function Xt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function et(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function tt(t){return t=et(t),(t<16?"0":"")+t.toString(16)}function oi(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Be(t,e,n,o)}function ii(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof Et||(t=Qe(t)),!t)return new Be;if(t instanceof Be)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),s=Math.max(e,n,o),a=NaN,l=s-i,d=(s+i)/2;return l?(e===s?a=(n-o)/l+(n<o)*6:n===s?a=(o-e)/l+2:a=(e-n)/l+4,l/=d<.5?s+i:2-s-i,a*=60):l=d>0&&d<1?0:a,new Be(a,l,d,t.opacity)}function vl(t,e,n,o){return arguments.length===1?ii(t):new Be(t,e,n,o??1)}function Be(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Gn(Be,vl,Ko(Et,{brighter(t){return t=t==null?Ut:Math.pow(Ut,t),new Be(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?xt:Math.pow(xt,t),new Be(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 xe(Un(t>=240?t-240:t+120,i,o),Un(t,i,o),Un(t<120?t+240:t-120,i,o),this.opacity)},clamp(){return new Be(ri(this.h),jt(this.s),jt(this.l),Xt(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=Xt(this.opacity);return`${t===1?"hsl(":"hsla("}${ri(this.h)}, ${jt(this.s)*100}%, ${jt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ri(t){return t=(t||0)%360,t<0?t+360:t}function jt(t){return Math.max(0,Math.min(1,t||0))}function Un(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 Yn=t=>()=>t;function _l(t,e){return function(n){return t+n*e}}function wl(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 bl(t){return(t=+t)==1?si:function(e,n){return n-e?wl(e,n,t):Yn(isNaN(e)?n:e)}}function si(t,e){var n=e-t;return n?_l(t,n):Yn(isNaN(t)?e:t)}var Zt=(function t(e){var n=bl(e);function o(i,s){var a=n((i=Wn(i)).r,(s=Wn(s)).r),l=n(i.g,s.g),d=n(i.b,s.b),c=si(i.opacity,s.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 Cl(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),i;return function(s){for(i=0;i<n;++i)o[i]=t[i]*(1-s)+e[i]*s;return o}}function El(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function xl(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,i=new Array(o),s=new Array(n),a;for(a=0;a<o;++a)i[a]=kt(t[a],e[a]);for(;a<n;++a)s[a]=e[a];return function(l){for(a=0;a<o;++a)s[a]=i[a](l);return s}}function Nl(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function Pe(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function kl(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]=kt(t[i],e[i]):o[i]=e[i];return function(s){for(i in n)o[i]=n[i](s);return o}}var Xn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jn=new RegExp(Xn.source,"g");function Sl(t){return function(){return t}}function Dl(t){return function(e){return t(e)+""}}function ai(t,e){var n=Xn.lastIndex=jn.lastIndex=0,o,i,s,a=-1,l=[],d=[];for(t=t+"",e=e+"";(o=Xn.exec(t))&&(i=jn.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,d.push({i:a,x:Pe(o,i)})),n=jn.lastIndex;return n<e.length&&(s=e.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?d[0]?Dl(d[0].x):Sl(e):(e=d.length,function(c){for(var u=0,h;u<e;++u)l[(h=d[u]).i]=h.x(c);return l.join("")})}function kt(t,e){var n=typeof e,o;return e==null||n==="boolean"?Yn(e):(n==="number"?Pe:n==="string"?(o=Qe(e))?(e=o,Zt):ai:e instanceof Qe?Zt:e instanceof Date?Nl:El(e)?Cl:Array.isArray(e)?xl:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?kl:Pe)(t,e)}var li=180/Math.PI,Zn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ci(t,e,n,o,i,s){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:s,rotate:Math.atan2(e,t)*li,skewX:Math.atan(d)*li,scaleX:a,scaleY:l}}var Kt;function Tl(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Zn:ci(e.a,e.b,e.c,e.d,e.e,e.f)}function Ml(t){return t==null||(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",t),!(t=Kt.transform.baseVal.consolidate()))?Zn:(t=t.matrix,ci(t.a,t.b,t.c,t.d,t.e,t.f))}function di(t,e,n,o){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,f,g,p){if(c!==h||u!==f){var b=g.push("translate(",null,e,null,n);p.push({i:b-4,x:Pe(c,h)},{i:b-2,x:Pe(u,f)})}else(h||f)&&g.push("translate("+h+e+f+n)}function a(c,u,h,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:h.push(i(h)+"rotate(",null,o)-2,x:Pe(c,u)})):u&&h.push(i(h)+"rotate("+u+o)}function l(c,u,h,f){c!==u?f.push({i:h.push(i(h)+"skewX(",null,o)-2,x:Pe(c,u)}):u&&h.push(i(h)+"skewX("+u+o)}function d(c,u,h,f,g,p){if(c!==h||u!==f){var b=g.push(i(g)+"scale(",null,",",null,")");p.push({i:b-4,x:Pe(c,h)},{i:b-2,x:Pe(u,f)})}else(h!==1||f!==1)&&g.push(i(g)+"scale("+h+","+f+")")}return function(c,u){var h=[],f=[];return c=t(c),u=t(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,f),a(c.rotate,u.rotate,h,f),l(c.skewX,u.skewX,h,f),d(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,f),c=u=null,function(g){for(var p=-1,b=f.length,S;++p<b;)h[(S=f[p]).i]=S.x(g);return h.join("")}}}var Il=di(Tl,"px, ","px)","deg)"),Bl=di(Ml,", ",")",")"),zl=1e-12;function ui(t){return((t=Math.exp(t))+1/t)/2}function Rl(t){return((t=Math.exp(t))-1/t)/2}function Al(t){return((t=Math.exp(2*t))-1)/(t+1)}var qt=(function t(e,n,o){function i(s,a){var l=s[0],d=s[1],c=s[2],u=a[0],h=a[1],f=a[2],g=u-l,p=h-d,b=g*g+p*p,S,D;if(b<zl)D=Math.log(f/c)/e,S=function($){return[l+$*g,d+$*p,c*Math.exp(e*$*D)]};else{var z=Math.sqrt(b),v=(f*f-c*c+o*b)/(2*c*n*z),M=(f*f-c*c-o*b)/(2*f*n*z),U=Math.log(Math.sqrt(v*v+1)-v);D=(Math.log(Math.sqrt(M*M+1)-M)-U)/e,S=function($){var Q=$*D,q=ui(U),j=c/(n*z)*(q*Al(e*Q+U)-Rl(U));return[l+j*g,d+j*p,c*q/ui(e*Q+U)]}}return S.duration=D*1e3*e/Math.SQRT2,S}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a;return t(a,l,l*l)},i})(Math.SQRT2,2,4),ut=0,St=0,Dt=0,fi=1e3,Jt,Tt,Qt=0,nt=0,en=0,Mt=typeof performance=="object"&&performance.now?performance:Date,hi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Kn(){return nt||(hi($l),nt=Mt.now()+en)}function $l(){nt=0}function tn(){this._call=this._time=this._next=null}tn.prototype=gi.prototype={constructor:tn,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Kn():+n)+(e==null?0:+e),!this._next&&Tt!==this&&(Tt?Tt._next=this:Jt=this,Tt=this),this._call=t,this._time=n,qn()},stop:function(){this._call&&(this._call=null,this._time=1/0,qn())}};function gi(t,e,n){var o=new tn;return o.restart(t,e,n),o}function Pl(){Kn(),++ut;for(var t=Jt,e;t;)(e=nt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ut}function pi(){nt=(Qt=Mt.now())+en,ut=St=0;try{Pl()}finally{ut=0,Vl(),nt=0}}function Ol(){var t=Mt.now(),e=t-Qt;e>fi&&(en-=e,Qt=t)}function Vl(){for(var t,e=Jt,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:Jt=n);Tt=t,qn(o)}function qn(t){ut||(St&&(St=clearTimeout(St)),t-nt>24?(t<1/0&&(St=setTimeout(pi,t-Mt.now()-en)),Dt&&(Dt=clearInterval(Dt))):(Dt||(Qt=Mt.now(),Dt=setInterval(Ol,fi)),ut=1,hi(pi)))}function mi(t,e,n){var o=new tn;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}var Hl=Ht("start","end","cancel","interrupt"),Ll=[],yi=0,vi=1,Jn=2,nn=3,_i=4,Qn=5,on=6;function rn(t,e,n,o,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Fl(t,n,{name:e,index:o,group:i,on:Hl,tween:Ll,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:yi})}function eo(t,e){var n=ze(t,e);if(n.state>yi)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=ze(t,e);if(n.state>nn)throw new Error("too late; already running");return n}function ze(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Fl(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=gi(s,0,n.time);function s(c){n.state=vi,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,f,g;if(n.state!==vi)return d();for(u in o)if(g=o[u],g.name===n.name){if(g.state===nn)return mi(a);g.state===_i?(g.state=on,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete o[u]):+u<e&&(g.state=on,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete o[u])}if(mi(function(){n.state===nn&&(n.state=_i,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Jn,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Jn){for(n.state=nn,i=new Array(f=n.tween.length),u=0,h=-1;u<f;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(d),n.state=Qn,1),h=-1,f=i.length;++h<f;)i[h].call(t,u);n.state===Qn&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=on,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function sn(t,e){var n=t.__transition,o,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){s=!1;continue}i=o.state>Jn&&o.state<Qn,o.state=on,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}s&&delete t.__transition}}function Gl(t){return this.each(function(){sn(this,t)})}function Wl(t,e){var n,o;return function(){var i=Oe(this,t),s=i.tween;if(s!==n){o=n=s;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 Ul(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=Oe(this,t),a=s.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)}s.tween=i}}function Yl(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=ze(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?Wl:Ul)(n,t,e))}function to(t,e,n){var o=t._id;return t.each(function(){var i=Oe(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return ze(i,o).value[e]}}function wi(t,e){var n;return(typeof e=="number"?Pe:e instanceof Qe?Zt:(n=Qe(e))?(e=n,Zt):ai)(t,e)}function Xl(t){return function(){this.removeAttribute(t)}}function jl(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zl(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===o?s:s=e(o=a,n)}}function Kl(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?s:s=e(o=a,n)}}function ql(t,e,n){var o,i,s;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?s:(i=d,s=e(o=a,l)))}}function Jl(t,e,n){var o,i,s;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?s:(i=d,s=e(o=a,l)))}}function Ql(t,e){var n=Ft(t),o=n==="transform"?Bl:wi;return this.attrTween(t,typeof e=="function"?(n.local?Jl:ql)(n,o,to(this,"attr."+t,e)):e==null?(n.local?jl:Xl)(n):(n.local?Kl:Zl)(n,o,e))}function ec(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function tc(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function nc(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&tc(t,s)),n}return i._value=e,i}function oc(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&ec(t,s)),n}return i._value=e,i}function ic(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=Ft(t);return this.tween(n,(o.local?nc:oc)(o,e))}function rc(t,e){return function(){eo(this,t).delay=+e.apply(this,arguments)}}function sc(t,e){return e=+e,function(){eo(this,t).delay=e}}function ac(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?rc:sc)(e,t)):ze(this.node(),e).delay}function lc(t,e){return function(){Oe(this,t).duration=+e.apply(this,arguments)}}function cc(t,e){return e=+e,function(){Oe(this,t).duration=e}}function dc(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?lc:cc)(e,t)):ze(this.node(),e).duration}function uc(t,e){if(typeof e!="function")throw new Error;return function(){Oe(this,t).ease=e}}function fc(t){var e=this._id;return arguments.length?this.each(uc(e,t)):ze(this.node(),e).ease}function hc(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Oe(this,t).ease=n}}function gc(t){if(typeof t!="function")throw new Error;return this.each(hc(this._id,t))}function pc(t){typeof t!="function"&&(t=Oo(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],d,c=0;c<a;++c)(d=s[c])&&t.call(d,d.__data__,c,s)&&l.push(d);return new Le(o,this._parents,this._name,this._id)}function mc(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var d=e[l],c=n[l],u=d.length,h=a[l]=new Array(u),f,g=0;g<u;++g)(f=d[g]||c[g])&&(h[g]=f);for(;l<o;++l)a[l]=e[l];return new Le(a,this._parents,this._name,this._id)}function yc(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 vc(t,e,n){var o,i,s=yc(e)?eo:Oe;return function(){var a=s(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}function _c(t,e){var n=this._id;return arguments.length<2?ze(this.node(),n).on.on(t):this.each(vc(n,t,e))}function wc(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function bc(){return this.on("end.remove",wc(this._id))}function Cc(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Vn(t));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],d=l.length,c=s[a]=new Array(d),u,h,f=0;f<d;++f)(u=l[f])&&(h=t.call(u,u.__data__,f,l))&&("__data__"in u&&(h.__data__=u.__data__),c[f]=h,rn(c[f],e,n,f,c,ze(u,n)));return new Le(s,this._parents,e,n)}function Ec(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Po(t));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var d=o[l],c=d.length,u,h=0;h<c;++h)if(u=d[h]){for(var f=t.call(u,u.__data__,h,d),g,p=ze(u,n),b=0,S=f.length;b<S;++b)(g=f[b])&&rn(g,e,n,b,f,p);s.push(f),a.push(u)}return new Le(s,a,e,n)}var xc=bt.prototype.constructor;function Nc(){return new xc(this._groups,this._parents)}function kc(t,e){var n,o,i;return function(){var s=lt(this,t),a=(this.style.removeProperty(t),lt(this,t));return s===a?null:s===n&&a===o?i:i=e(n=s,o=a)}}function bi(t){return function(){this.style.removeProperty(t)}}function Sc(t,e,n){var o,i=n+"",s;return function(){var a=lt(this,t);return a===i?null:a===o?s:s=e(o=a,n)}}function Dc(t,e,n){var o,i,s;return function(){var a=lt(this,t),l=n(this),d=l+"";return l==null&&(d=l=(this.style.removeProperty(t),lt(this,t))),a===d?null:a===o&&d===i?s:(i=d,s=e(o=a,l))}}function Tc(t,e){var n,o,i,s="style."+e,a="end."+s,l;return function(){var d=Oe(this,t),c=d.on,u=d.value[s]==null?l||(l=bi(e)):void 0;(c!==n||i!==u)&&(o=(n=c).copy()).on(a,i=u),d.on=o}}function Mc(t,e,n){var o=(t+="")=="transform"?Il:wi;return e==null?this.styleTween(t,kc(t,o)).on("end.style."+t,bi(t)):typeof e=="function"?this.styleTween(t,Dc(t,o,to(this,"style."+t,e))).each(Tc(this._id,t)):this.styleTween(t,Sc(t,o,e),n).on("end.style."+t,null)}function Ic(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function Bc(t,e,n){var o,i;function s(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&Ic(t,a,n)),o}return s._value=e,s}function zc(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,Bc(t,e,n??""))}function Rc(t){return function(){this.textContent=t}}function Ac(t){return function(){var e=t(this);this.textContent=e??""}}function $c(t){return this.tween("text",typeof t=="function"?Ac(to(this,"text",t)):Rc(t==null?"":t+""))}function Pc(t){return function(e){this.textContent=t.call(this,e)}}function Oc(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Pc(i)),e}return o._value=t,o}function Vc(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,Oc(t))}function Hc(){for(var t=this._name,e=this._id,n=Ci(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,d,c=0;c<l;++c)if(d=a[c]){var u=ze(d,e);rn(d,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Le(o,this._parents,t,n)}function Lc(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},d={value:function(){--i===0&&s()}};n.each(function(){var c=Oe(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&&s()})}var Fc=0;function Le(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Ci(){return++Fc}var Fe=bt.prototype;Le.prototype={constructor:Le,select:Cc,selectAll:Ec,selectChild:Fe.selectChild,selectChildren:Fe.selectChildren,filter:pc,merge:mc,selection:Nc,transition:Hc,call:Fe.call,nodes:Fe.nodes,node:Fe.node,size:Fe.size,empty:Fe.empty,each:Fe.each,on:_c,attr:Ql,attrTween:ic,style:Mc,styleTween:zc,text:$c,textTween:Vc,remove:bc,tween:Yl,delay:ac,duration:dc,ease:fc,easeVarying:gc,end:Lc,[Symbol.iterator]:Fe[Symbol.iterator]};function Gc(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Wc={time:null,delay:0,duration:250,ease:Gc};function Uc(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 Yc(t){var e,n;t instanceof Le?(e=t._id,t=t._name):(e=Ci(),(n=Wc).time=Kn(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,d,c=0;c<l;++c)(d=a[c])&&rn(d,t,e,c,a,n||Uc(d,e));return new Le(o,this._parents,t,e)}bt.prototype.interrupt=Gl,bt.prototype.transition=Yc;var an=t=>()=>t;function Xc(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 Ge(t,e,n){this.k=t,this.x=e,this.y=n}Ge.prototype={constructor:Ge,scale:function(t){return t===1?this:new Ge(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Ge(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 ft=new Ge(1,0,0);Ge.prototype;function no(t){t.stopImmediatePropagation()}function It(t){t.preventDefault(),t.stopImmediatePropagation()}function jc(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Zc(){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 Ei(){return this.__zoom||ft}function Kc(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function qc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jc(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=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>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function Qc(){var t=jc,e=Zc,n=Jc,o=Kc,i=qc,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,d=qt,c=Ht("start","zoom","end"),u,h,f,g=500,p=150,b=0,S=10;function D(w){w.property("__zoom",Ei).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",K).filter(i).on("touchstart.zoom",G).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(w,V,m,E){var B=w.selection?w.selection():w;B.property("__zoom",Ei),w!==B?U(w,V,m,E):B.interrupt().each(function(){$(this,arguments).event(E).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},D.scaleBy=function(w,V,m,E){D.scaleTo(w,function(){return this.__zoom.k*(typeof V=="function"?V.apply(this,arguments):V)},m,E)},D.scaleTo=function(w,V,m,E){D.transform(w,function(){var B=e.apply(this,arguments),T=this.__zoom,A=m==null?M(B):typeof m=="function"?m.apply(this,arguments):m,H=T.invert(A),F=typeof V=="function"?V.apply(this,arguments):V;return n(v(z(T,F),A,H),B,a)},m,E)},D.translateBy=function(w,V,m,E){D.transform(w,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof m=="function"?m.apply(this,arguments):m),e.apply(this,arguments),a)},null,E)},D.translateTo=function(w,V,m,E,B){D.transform(w,function(){var T=e.apply(this,arguments),A=this.__zoom,H=E==null?M(T):typeof E=="function"?E.apply(this,arguments):E;return n(ft.translate(H[0],H[1]).scale(A.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof m=="function"?-m.apply(this,arguments):-m),T,a)},E,B)};function z(w,V){return V=Math.max(s[0],Math.min(s[1],V)),V===w.k?w:new Ge(V,w.x,w.y)}function v(w,V,m){var E=V[0]-m[0]*w.k,B=V[1]-m[1]*w.k;return E===w.x&&B===w.y?w:new Ge(w.k,E,B)}function M(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function U(w,V,m,E){w.on("start.zoom",function(){$(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(E).end()}).tween("zoom",function(){var B=this,T=arguments,A=$(B,T).event(E),H=e.apply(B,T),F=m==null?M(H):typeof m=="function"?m.apply(B,T):m,te=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),se=B.__zoom,L=typeof V=="function"?V.apply(B,T):V,Z=d(se.invert(F).concat(te/se.k),L.invert(F).concat(te/L.k));return function(P){if(P===1)P=L;else{var X=Z(P),ne=te/X[2];P=new Ge(ne,F[0]-X[0]*ne,F[1]-X[1]*ne)}A.zoom(null,P)}})}function $(w,V,m){return!m&&w.__zooming||new Q(w,V)}function Q(w,V){this.that=w,this.args=V,this.active=0,this.sourceEvent=null,this.extent=e.apply(w,V),this.taps=0}Q.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,V){return this.mouse&&w!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var V=Ie(this.that).datum();c.call(w,this.that,new Xc(w,{sourceEvent:this.sourceEvent,target:D,type:w,transform:this.that.__zoom,dispatch:c}),V)}};function q(w,...V){if(!t.apply(this,arguments))return;var m=$(this,V).event(w),E=this.__zoom,B=Math.max(s[0],Math.min(s[1],E.k*Math.pow(2,o.apply(this,arguments)))),T=Ae(w);if(m.wheel)(m.mouse[0][0]!==T[0]||m.mouse[0][1]!==T[1])&&(m.mouse[1]=E.invert(m.mouse[0]=T)),clearTimeout(m.wheel);else{if(E.k===B)return;m.mouse=[T,E.invert(T)],sn(this),m.start()}It(w),m.wheel=setTimeout(A,p),m.zoom("mouse",n(v(z(E,B),m.mouse[0],m.mouse[1]),m.extent,a));function A(){m.wheel=null,m.end()}}function j(w,...V){if(f||!t.apply(this,arguments))return;var m=w.currentTarget,E=$(this,V,!0).event(w),B=Ie(w.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",te,!0),T=Ae(w,m),A=w.clientX,H=w.clientY;jo(w.view),no(w),E.mouse=[T,this.__zoom.invert(T)],sn(this),E.start();function F(se){if(It(se),!E.moved){var L=se.clientX-A,Z=se.clientY-H;E.moved=L*L+Z*Z>b}E.event(se).zoom("mouse",n(v(E.that.__zoom,E.mouse[0]=Ae(se,m),E.mouse[1]),E.extent,a))}function te(se){B.on("mousemove.zoom mouseup.zoom",null),Zo(se.view,E.moved),It(se),E.event(se).end()}}function K(w,...V){if(t.apply(this,arguments)){var m=this.__zoom,E=Ae(w.changedTouches?w.changedTouches[0]:w,this),B=m.invert(E),T=m.k*(w.shiftKey?.5:2),A=n(v(z(m,T),E,B),e.apply(this,V),a);It(w),l>0?Ie(this).transition().duration(l).call(U,A,E,w):Ie(this).call(D.transform,A,E,w)}}function G(w,...V){if(t.apply(this,arguments)){var m=w.touches,E=m.length,B=$(this,V,w.changedTouches.length===E).event(w),T,A,H,F;for(no(w),A=0;A<E;++A)H=m[A],F=Ae(H,this),F=[F,this.__zoom.invert(F),H.identifier],B.touch0?!B.touch1&&B.touch0[2]!==F[2]&&(B.touch1=F,B.taps=0):(B.touch0=F,T=!0,B.taps=1+!!u);u&&(u=clearTimeout(u)),T&&(B.taps<2&&(h=F[0],u=setTimeout(function(){u=null},g)),sn(this),B.start())}}function k(w,...V){if(this.__zooming){var m=$(this,V).event(w),E=w.changedTouches,B=E.length,T,A,H,F;for(It(w),T=0;T<B;++T)A=E[T],H=Ae(A,this),m.touch0&&m.touch0[2]===A.identifier?m.touch0[0]=H:m.touch1&&m.touch1[2]===A.identifier&&(m.touch1[0]=H);if(A=m.that.__zoom,m.touch1){var te=m.touch0[0],se=m.touch0[1],L=m.touch1[0],Z=m.touch1[1],P=(P=L[0]-te[0])*P+(P=L[1]-te[1])*P,X=(X=Z[0]-se[0])*X+(X=Z[1]-se[1])*X;A=z(A,Math.sqrt(P/X)),H=[(te[0]+L[0])/2,(te[1]+L[1])/2],F=[(se[0]+Z[0])/2,(se[1]+Z[1])/2]}else if(m.touch0)H=m.touch0[0],F=m.touch0[1];else return;m.zoom("touch",n(v(A,H,F),m.extent,a))}}function Y(w,...V){if(this.__zooming){var m=$(this,V).event(w),E=w.changedTouches,B=E.length,T,A;for(no(w),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),T=0;T<B;++T)A=E[T],m.touch0&&m.touch0[2]===A.identifier?delete m.touch0:m.touch1&&m.touch1[2]===A.identifier&&delete m.touch1;if(m.touch1&&!m.touch0&&(m.touch0=m.touch1,delete m.touch1),m.touch0)m.touch0[1]=this.__zoom.invert(m.touch0[0]);else if(m.end(),m.taps===2&&(A=Ae(A,this),Math.hypot(h[0]-A[0],h[1]-A[1])<S)){var H=Ie(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return D.wheelDelta=function(w){return arguments.length?(o=typeof w=="function"?w:an(+w),D):o},D.filter=function(w){return arguments.length?(t=typeof w=="function"?w:an(!!w),D):t},D.touchable=function(w){return arguments.length?(i=typeof w=="function"?w:an(!!w),D):i},D.extent=function(w){return arguments.length?(e=typeof w=="function"?w:an([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),D):e},D.scaleExtent=function(w){return arguments.length?(s[0]=+w[0],s[1]=+w[1],D):[s[0],s[1]]},D.translateExtent=function(w){return arguments.length?(a[0][0]=+w[0][0],a[1][0]=+w[1][0],a[0][1]=+w[0][1],a[1][1]=+w[1][1],D):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},D.constrain=function(w){return arguments.length?(n=w,D):n},D.duration=function(w){return arguments.length?(l=+w,D):l},D.interpolate=function(w){return arguments.length?(d=w,D):d},D.on=function(){var w=c.on.apply(c,arguments);return w===c?D:w},D.clickDistance=function(w){return arguments.length?(b=(w=+w)*w,D):Math.sqrt(b)},D.tapDistance=function(w){return arguments.length?(S=+w,D):S},D}var ae=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(ae||{}),oo=(t=>(t.Partial="partial",t.Full="full",t))(oo||{}),ot=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))(ot||{}),We=(t=>(t.Strict="strict",t.Loose="loose",t))(We||{}),Ue=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(Ue||{}),Bt=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(Bt||{}),xi=(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))(xi||{}),ed=["INPUT","SELECT","TEXTAREA"],td=typeof document<"u"?document:null;function io(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,s=typeof o?.closest=="function"?o.closest(".nokey"):null;return ed.includes(o?.nodeName)||i||!!s}function nd(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function Ni(t,e,n,o){const i=e.replace("+",`
1
+ (function(re,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@a2simcode/ui")):typeof define=="function"&&define.amd?define(["exports","vue","@a2simcode/ui"],r):(re=typeof globalThis<"u"?globalThis:re||self,r(re.DuiUI={},re.Vue,re.SimCodeUI))})(this,function(re,r,Te){Object.defineProperties(re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var mu=Object.create,jn=Object.defineProperty,wu=Object.getOwnPropertyDescriptor,Cu=Object.getOwnPropertyNames,yu=Object.getPrototypeOf,vu=Object.prototype.hasOwnProperty,Qu=(e,A)=>()=>(A||(e((A={exports:{}}).exports,A),e=null),A.exports),Eu=(e,A)=>{let t={};for(var n in e)jn(t,n,{get:e[n],enumerable:!0});return A||jn(t,Symbol.toStringTag,{value:"Module"}),t},Uo=(e,A,t,n)=>{if(A&&typeof A=="object"||typeof A=="function")for(var o=Cu(A),a=0,c=o.length,d;a<c;a++)d=o[a],!vu.call(e,d)&&d!==t&&jn(e,d,{get:(h=>A[h]).bind(null,d),enumerable:!(n=wu(A,d))||n.enumerable});return e},Fu=(e,A,t)=>(Uo(e,A,"default"),t&&Uo(t,A,"default")),rs=(e,A,t)=>(t=e!=null?mu(yu(e)):{},Uo(A||!e||!e.__esModule?jn(t,"default",{value:e,enumerable:!0}):t,e));r=rs(r,1);var ct=(e,A)=>(e.install=t=>{t.component(e.name,e),A&&A.forEach(n=>{t.component(n.name,n)})},e),ut=(e="")=>{const A=Date.now(),t=Math.floor(Math.random()*1e9);return e===""?String(t)+String(A):e+"_"+t+String(A)},gn=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(gn);const A={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=gn(e[t]));return A},Uu=e=>{if(Array.isArray(e))e.length=0;else if(e&&typeof e=="object")for(const A in e)Object.prototype.hasOwnProperty.call(e,A)&&delete e[A]},bo={},bu=(e,A,t)=>{t[e]=t[e]||{};const n=ut();return t[e][n]=A,n},Iu=(e,A,t)=>{const n=[],o=t[e]||{};return Object.keys(o).forEach(a=>{const c=o[a];try{c&&n.push(c(A))}catch(d){console.error(d)}}),n},Hu=(e,A,t)=>{if(A){const n=t[e];n&&delete n[A]}else delete t[e]},os=(e,A)=>bu(e,A,bo),ie=(e,A)=>Iu(e,A,bo),_u=(e,A)=>{Hu(e,A,bo)},is=(e,A,t,n,o,a)=>{const c=A.id,d=A.level,{getDesignLocals:h,selectComponent:g,getComponent:B,isMyChildComponent:w,addComponent:m,deleteComponent:y,getParentComponents:v,removeComponentFromContainer:I,addComponentToContainer:L,copyComponent:k,activedComponent:V,top:F}=(0,r.inject)("d-drag-design-provide",{}),M=[],tA=(0,r.ref)(!1),W=(0,r.ref)(!1),aA=(0,r.ref)(!1),dA=(0,r.ref)(!1),rA=(0,r.ref)(!1),oA={id:"",type:""},AA=(0,r.ref)(!1),O=(0,r.ref)(!1);let lA="",_=null;const Z=Y=>{if(lA===Y)return _;lA=Y;const{top:cA,left:mA,width:yA,height:IA}=e.value.getBoundingClientRect();return _=[{x:mA,y:cA},{x:mA+yA,y:cA},{x:mA+yA,y:cA+IA},{x:mA,y:cA+IA}],_},U=(Y,cA,mA)=>{let yA=cA-mA[0].y;yA<0&&(yA=-yA);let IA=cA-mA[3].y;IA<0&&(IA=-IA);let fA=Y-mA[0].x;fA<0&&(fA=-fA);let vA=Y-mA[1].x;return vA<0&&(vA=-vA),{ly:yA>IA?IA:yA,typey:yA>IA?"bottom":"top",lx:fA>vA?vA:fA,lallx:fA+vA}},x=(Y,cA,mA)=>Y>=mA[0].x&&Y<=mA[1].x&&cA>=mA[0].y&&cA<=mA[3].y,G=()=>{if(o){ie("dragClick",{id:c});return}if(!W.value){if(g(c),d!==0){const Y=e.value.getBoundingClientRect(),cA=h();Y.top-cA.top<22?dA.value=!0:dA.value=!1}W.value=!0,ie("dragClick",{id:c})}},R=Y=>{const cA=y(Y);cA&&(0,r.nextTick)(()=>{ie("dragClick",{id:cA})})},$=()=>{oA.id="",oA.type="",d===0&&(rA.value=!1)},J=()=>{ie("mouseEnterOrLeave",{id:c,type:"enter"})},nA=()=>{ie("mouseEnterOrLeave",{id:c,type:"leave"})},BA=Y=>{ie("dragClick",{id:Y})},UA={mouseEnterOrLeave:({id:Y,type:cA})=>{cA==="enter"?M.push(Y):M.length>0&&M.splice(M.length-1,1);const mA=M.length;mA>0&&c===M[mA-1]?tA.value=!0:tA.value=!1},dragAciveChild:({type:Y,id:cA})=>{cA===c?Y==="top"?(AA.value=!0,O.value=!1):(O.value=!0,AA.value=!1):(O.value=!1,AA.value=!1)},dragClick({id:Y,isAgain:cA}){console.log("dragClick",Y,c),Y!==c?W.value=!1:(cA&&(W.value=!1),G())}};UA[`dragGetChildDistance_${c}`]=({dragX:Y,dragY:cA,moveId:mA})=>U(Y,cA,Z(mA));const eA={isInContainer({x:Y,y:cA,id:mA,moveId:yA}){if(c===mA||w(mA,c))return aA.value=!1,{isIn:!1,level:d,id:c,groupId:a};const IA=Z(yA);if(x(Y,cA,IA))return d===0&&(rA.value=!0),{isIn:!0,level:d,id:c,groupId:a};if(d===0){const{ly:fA,lx:vA}=U(Y,cA,IA);if(fA<20&&vA<20)return rA.value=!0,{isIn:!0,level:d,id:c,groupId:a};rA.value=!1}return aA.value=!1,{isIn:!1,level:d,id:c,groupId:a}},dragActiveContainer:({containerId:Y,containerGroupId:cA,dragX:mA,dragY:yA,moveId:IA})=>{if(Y===c&&cA===a)if(aA.value=!0,n&&n.value.length>0){let fA={ly:9999999,lx:0,lallx:0,id:"",typey:""};n?.value.forEach(vA=>{if(a&&vA.groupId!==a)return;const S=ie(`dragGetChildDistance_${vA.id}`,{dragX:mA,dragY:yA,moveId:IA})[0];S&&(fA.ly>S.ly||fA.ly===S.ly&&(fA.lx>S.lx||fA.lx===S.lx&&fA.lallx>S.lallx))&&(fA=S,fA.id=vA.id)}),oA.id=fA.id,oA.type=fA.typey,ie("dragAciveChild",{id:fA.id,type:fA.typey})}else ie("dragAciveChild",{id:""});else aA.value=!1},dragAdd:Y=>{if(aA.value){let cA=n?.value.length||0;oA.id!==""&&oA.id!==void 0&&(cA=n?.value.findIndex(mA=>mA.id===oA.id)||0,oA.type==="bottom"&&(cA+=1)),m(Y,c,cA,a),aA.value=!1}$()},dragAddByClick:Y=>{if(!V.value&&c===F.id||V.value?.id===c||V.value?.containerId===c&&V.value?.dragType!=="container"){const cA=m(Y,c,n?.value.length||0,a,!0);cA&&Y.config&&Object.keys(Y.config).forEach(mA=>{cA.config[mA]=Y.config[mA]})}},dragUpdate(Y){if(aA.value){const cA=B(Y);if(cA.level=d+1,oA.id!==cA.id){I(cA.containerId,Y);let mA=n?.value.findIndex(yA=>yA.id===oA.id)||0;oA.type==="bottom"&&(mA+=1),L(cA,c,mA,a)}aA.value=!1,(0,r.nextTick)(()=>{ie("dragClick",{id:cA.id,isAgain:!0})})}$()}},uA={};return(0,r.onMounted)(()=>{(!o||t!=="container")&&Object.keys(UA).forEach(Y=>{uA[Y]=os(Y,UA[Y])}),t==="container"&&Object.keys(eA).forEach(Y=>{uA[Y]=os(Y,eA[Y])}),A.isNewAdd&&(0,r.nextTick)(()=>{G(),delete A.isNewAdd})}),(0,r.onUnmounted)(()=>{Object.keys(uA).forEach(Y=>{_u(Y,uA[Y])})}),{onMouseenter:J,onMouseleave:nA,activeComponent:G,handleComponentClick:BA,deleteComponentByClick:R,copyComponent:k,getParentComponents:v,isBottomToolBar:dA,isHover:tA,isSelect:W,isToContainer:aA,isMoveingInTopLevel:rA,isTopActive:AA,isBottomActive:O}},ss=(e,A)=>{const t={x:0,y:0,clientX:0,clientY:0,dragElement:null,dragElementId:"jcode-darg-move-id",toContainerLevel:-1,toContainerId:"",groupId:"",id:""};let n=!1;const o=(y,v)=>{n!==!0&&(n=!0,setTimeout(()=>{y(),n=!1},v))},a=(0,r.ref)(!1),c=(y,v,I)=>{const L=document.createElement("div");return L.id=t.dragElementId,L.innerText=y,L.className="d-drag-move",L.style.top=`${v}px`,L.style.left=`${I}px`,document.body.appendChild(L),L},d=()=>{document.onmousemove=null,document.onmouseup=null,a.value=!1,ie("dragAciveChild",{id:""})},h=()=>{d(),t.dragElement&&(t.dragElement.remove(),t.dragElement=null,A?ie("dragAdd",e):ie("dragUpdate",e.id))},g=y=>{const{clientY:v,clientX:I}=y;if(!t.dragElement){const L=Math.abs(t.x-I),k=Math.abs(t.y-v);if(L<=1&&k<=1)return;a.value=!0,t.dragElement=c(e.name,v-11,I-32)}t.dragElement.style.top=`${v-11}px`,t.dragElement.style.left=`${I-32}px`,t.clientX=I,t.clientY=v,o(()=>{if(!a.value)return;const L=ie("isInContainer",{x:I,y:v,id:e.id,moveId:t.id});t.toContainerLevel=-1,t.toContainerId="",t.groupId="",L.forEach(({level:k,id:V,isIn:F,groupId:M})=>{F&&t.toContainerLevel<k&&(t.toContainerLevel=k,t.toContainerId=V,t.groupId=M)}),t.toContainerId!==""?ie("dragActiveContainer",{containerId:t.toContainerId,containerGroupId:t.groupId,dragX:I,dragY:v,moveId:t.id}):ie("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{d()},onMousedown:y=>{t.x=y.clientX,t.y=y.clientY,t.id=ut(),document.onmouseup=h,document.onmousemove=g},onClick:()=>{ie("dragAddByClick",e)},moveActive:a}},Su={class:"d-drag-btns-pname"},xu={key:0,class:"d-drag-mask"},Du=(0,r.defineComponent)({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(e){const A=e,t=(0,r.ref)(),{onMouseenter:n,onMouseleave:o,activeComponent:a,handleComponentClick:c,deleteComponentByClick:d,copyComponent:h,getParentComponents:g,isHover:B,isSelect:w,isTopActive:m,isBottomActive:y,isBottomToolBar:v}=is(t,A.componentData,"component"),{onContextmenu:I,onMousedown:L,moveActive:k}=ss(A.componentData,!1);return(V,F)=>{const M=(0,r.resolveComponent)("j-button"),tA=(0,r.resolveComponent)("el-space");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["d-drag-component",{selected:(0,r.unref)(w),hovered:(0,r.unref)(B),isBottomToolBar:(0,r.unref)(v),active:(0,r.unref)(k),isTopActive:(0,r.unref)(m),isBottomActive:(0,r.unref)(y)}])},[F[11]||(F[11]=(0,r.createElementVNode)("div",{class:"d-drag-line"},null,-1)),(0,r.createElementVNode)("div",{class:"d-drag-btns",onMouseenter:F[4]||(F[4]=(...W)=>(0,r.unref)(n)&&(0,r.unref)(n)(...W)),onMouseleave:F[5]||(F[5]=(...W)=>(0,r.unref)(o)&&(0,r.unref)(o)(...W))},[(0,r.createVNode)(tA,{size:4},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,r.withModifiers)(()=>{},["stop"])},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",label:e.componentData.name},null,8,["label"]),(0,r.createElementVNode)("div",Su,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(g)(e.componentData.containerId),W=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:W.id},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",label:W.name,onClick:aA=>(0,r.unref)(c)(W.id)},null,8,["label","onClick"])]))),128))])]),(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:F[0]||(F[0]=(0,r.withModifiers)(W=>(0,r.unref)(h)(e.componentData.id),["stop"]))}),(0,r.createElementVNode)("div",{onContextmenu:F[1]||(F[1]=(0,r.withModifiers)((...W)=>(0,r.unref)(I)&&(0,r.unref)(I)(...W),["stop"])),onMousedown:F[2]||(F[2]=(0,r.withModifiers)((...W)=>(0,r.unref)(L)&&(0,r.unref)(L)(...W),["stop"])),style:{display:"flex"}},[(0,r.createVNode)(M,{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),(0,r.createVNode)(M,{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:F[3]||(F[3]=(0,r.withModifiers)(W=>(0,r.unref)(d)(e.componentData.id),["stop"]))})]),_:1})],32),(0,r.createElementVNode)("div",{ref_key:"refDrag",ref:t,class:"d-drag-body",onClick:F[6]||(F[6]=(0,r.withModifiers)((...W)=>(0,r.unref)(a)&&(0,r.unref)(a)(...W),["stop"])),onContextmenu:F[7]||(F[7]=(0,r.withModifiers)((...W)=>(0,r.unref)(I)&&(0,r.unref)(I)(...W),["stop"])),onMousedown:F[8]||(F[8]=(0,r.withModifiers)((...W)=>(0,r.unref)(L)&&(0,r.unref)(L)(...W),["stop"])),onMouseenter:F[9]||(F[9]=(...W)=>(0,r.unref)(n)&&(0,r.unref)(n)(...W)),onMouseleave:F[10]||(F[10]=(...W)=>(0,r.unref)(o)&&(0,r.unref)(o)(...W))},[(0,r.renderSlot)(V.$slots,"default"),e.isContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",xu))],544)],2)}}}),Io=Du,Nu=(0,r.defineComponent)({name:"DDragTool",__name:"tool",props:{config:{}},setup(e){const{onContextmenu:A,onMousedown:t,onClick:n}=ss(e.config??{name:"",id:""},!0);return(o,a)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-drag-tool",onClick:a[0]||(a[0]=(0,r.withModifiers)((...c)=>(0,r.unref)(n)&&(0,r.unref)(n)(...c),["stop"])),onContextmenu:a[1]||(a[1]=(0,r.withModifiers)((...c)=>(0,r.unref)(A)&&(0,r.unref)(A)(...c),["stop"])),onMousedown:a[2]||(a[2]=(0,r.withModifiers)((...c)=>(0,r.unref)(t)&&(0,r.unref)(t)(...c),["stop"]))},[(0,r.renderSlot)(o.$slots,"default")],32))}}),Ho=Nu,Lu={key:0,class:"d-drag-line"},Tu={key:1,class:"d-drag-btns"},ku=(0,r.defineComponent)({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(e){const A=e,t=(0,r.ref)(),n=(0,r.computed)(()=>A.componentData?.children||[]),{onMouseenter:o,onMouseleave:a,activeComponent:c,isHover:d,isSelect:h,isToContainer:g,isMoveingInTopLevel:B,isTopActive:w,isBottomActive:m}=is(t,A.componentData,"container",n,A.isComponentContainer,A.groupId),y=(0,r.computed)(()=>!!(n.value.findIndex(v=>v.groupId===A.groupId)===-1&&g.value));return(v,I)=>{const L=(0,r.resolveComponent)("j-button");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"refDrag",ref:t,class:(0,r.normalizeClass)(["d-drag-container",{selected:(0,r.unref)(h)&&!e.isComponentContainer,hovered:(0,r.unref)(d)&&!e.isComponentContainer,isTopLevel:e.componentData.level===0,active:y.value,isMoveingInTopLevel:(0,r.unref)(B),isTopActive:(0,r.unref)(w),isBottomActive:(0,r.unref)(m)}])},[e.isComponentContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",Lu)),e.isComponentContainer?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",Tu,[(0,r.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,r.withModifiers)(()=>{},["stop"])},[(0,r.createVNode)(L,{class:"d-drag-btn",type:"primary",size:"small",label:e.componentData.name},null,8,["label"])])])),(0,r.createElementVNode)("div",{class:"d-drag-body",onClick:I[0]||(I[0]=(0,r.withModifiers)((...k)=>(0,r.unref)(c)&&(0,r.unref)(c)(...k),["stop"])),onMouseenter:I[1]||(I[1]=(...k)=>(0,r.unref)(o)&&(0,r.unref)(o)(...k)),onMouseleave:I[2]||(I[2]=(...k)=>(0,r.unref)(a)&&(0,r.unref)(a)(...k))},[(0,r.renderSlot)(v.$slots,"default")],32)],2)}}}),_o=ku,Mu=(0,r.defineComponent)({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(e){const{designItemName:A}=(0,r.inject)("dui-design-provide",{});return(t,n)=>{const o=(0,r.resolveComponent)("el-col");return(0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.componentList,a=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:a.id},[a.type!="pkey"?((0,r.openBlock)(),(0,r.createBlock)(o,{key:0,span:a.config.span||24},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Io,{"is-container":a.dragType!=="component","component-data":a},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(A)),{"component-data":a,"global-config":e.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):(0,r.createCommentVNode)("",!0)],64))),128)}}}),So=Mu,Ou=(0,r.defineComponent)({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(e){const{designItemName:A}=(0,r.inject)("dui-design-provide",{}),t=n=>{if(n.flexWidth)return{width:n.flexWidth+"%"}};return(n,o)=>((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.componentList,a=>((0,r.openBlock)(),(0,r.createBlock)(Io,{key:a.id,style:(0,r.normalizeStyle)(t(a.config)),"is-container":a.dragType!=="component","component-data":a},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(A)),{"component-data":a,"global-config":e.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),xo=Ou,as=ct(Io,[Ho,_o,So,xo]);function hn(e){return(0,r.getCurrentScope)()?((0,r.onScopeDispose)(e),!0):!1}function je(e){return typeof e=="function"?e():(0,r.unref)(e)}var Ku=typeof window<"u"&&typeof document<"u",Ru=e=>typeof e<"u",Vu=Object.prototype.toString,Pu=e=>Vu.call(e)==="[object Object]",Gu=()=>{};function zu(e,A){function t(...n){return new Promise((o,a)=>{Promise.resolve(e(()=>A.apply(this,n),{fn:A,thisArg:this,args:n})).then(o).catch(a)})}return t}var ls=e=>e();function $u(e=ls){const A=(0,r.ref)(!0);function t(){A.value=!1}function n(){A.value=!0}const o=(...a)=>{A.value&&e(...a)};return{isActive:(0,r.readonly)(A),pause:t,resume:n,eventFilter:o}}function cs(e,A=!1,t="Timeout"){return new Promise((n,o)=>{setTimeout(A?()=>o(t):n,e)})}function Xu(e,A,t={}){const{eventFilter:n=ls,...o}=t;return(0,r.watch)(e,zu(n,A),o)}function Vt(e,A,t={}){const{eventFilter:n,...o}=t,{eventFilter:a,pause:c,resume:d,isActive:h}=$u(n);return{stop:Xu(e,A,{...o,eventFilter:a}),pause:c,resume:d,isActive:h}}function Wu(e,A={}){if(!(0,r.isRef)(e))return(0,r.toRefs)(e);const t=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const n in e.value)t[n]=(0,r.customRef)(()=>({get(){return e.value[n]},set(o){var a;if((a=je(A.replaceRef))==null||a)if(Array.isArray(e.value)){const c=[...e.value];c[n]=o,e.value=c}else{const c={...e.value,[n]:o};Object.setPrototypeOf(c,Object.getPrototypeOf(e.value)),e.value=c}else e.value[n]=o}}));return t}function Do(e,A=!1){function t(w,{flush:m="sync",deep:y=!1,timeout:v,throwOnTimeout:I}={}){let L=null;const k=[new Promise(V=>{L=(0,r.watch)(e,F=>{w(F)!==A&&(L?.(),V(F))},{flush:m,deep:y,immediate:!0})})];return v!=null&&k.push(cs(v,I).then(()=>je(e)).finally(()=>L?.())),Promise.race(k)}function n(w,m){if(!(0,r.isRef)(w))return t(F=>F===w,m);const{flush:y="sync",deep:v=!1,timeout:I,throwOnTimeout:L}=m??{};let k=null;const V=[new Promise(F=>{k=(0,r.watch)([e,w],([M,tA])=>{A!==(M===tA)&&(k?.(),F(M))},{flush:y,deep:v,immediate:!0})})];return I!=null&&V.push(cs(I,L).then(()=>je(e)).finally(()=>(k?.(),je(e)))),Promise.race(V)}function o(w){return t(m=>!!m,w)}function a(w){return n(null,w)}function c(w){return n(void 0,w)}function d(w){return t(Number.isNaN,w)}function h(w,m){return t(y=>{const v=Array.from(y);return v.includes(w)||v.includes(je(w))},m)}function g(w){return B(1,w)}function B(w=1,m){let y=-1;return t(()=>(y+=1,y>=w),m)}return Array.isArray(je(e))?{toMatch:t,toContains:h,changed:g,changedTimes:B,get not(){return Do(e,!A)}}:{toMatch:t,toBe:n,toBeTruthy:o,toBeNull:a,toBeNaN:d,toBeUndefined:c,changed:g,changedTimes:B,get not(){return Do(e,!A)}}}function No(e){return Do(e)}function Yu(e){var A;const t=je(e);return(A=t?.$el)!=null?A:t}var us=Ku?window:void 0;function ds(...e){let A,t,n,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,n,o]=e,A=us):[A,t,n,o]=e,!A)return Gu;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const a=[],c=()=>{a.forEach(B=>B()),a.length=0},d=(B,w,m,y)=>(B.addEventListener(w,m,y),()=>B.removeEventListener(w,m,y)),h=(0,r.watch)(()=>[Yu(A),je(o)],([B,w])=>{if(c(),!B)return;const m=Pu(w)?{...w}:w;a.push(...t.flatMap(y=>n.map(v=>d(B,y,v,m))))},{immediate:!0,flush:"post"}),g=()=>{h(),c()};return hn(g),g}function Ju(e){return typeof e=="function"?e:typeof e=="string"?A=>A.key===e:Array.isArray(e)?A=>e.includes(A.key):()=>!0}function fs(...e){let A,t,n={};e.length===3?(A=e[0],t=e[1],n=e[2]):e.length===2?typeof e[1]=="object"?(A=!0,t=e[0],n=e[1]):(A=e[0],t=e[1]):(A=!0,t=e[0]);const{target:o=us,eventName:a="keydown",passive:c=!1,dedupe:d=!1}=n,h=Ju(A);return ds(o,a,B=>{B.repeat&&je(d)||h(B)&&t(B)},c)}function Zu(e){return JSON.parse(JSON.stringify(e))}function Lo(e,A,t,n={}){var o,a,c;const{clone:d=!1,passive:h=!1,eventName:g,deep:B=!1,defaultValue:w,shouldEmit:m}=n,y=(0,r.getCurrentInstance)(),v=t||y?.emit||((o=y?.$emit)==null?void 0:o.bind(y))||((c=(a=y?.proxy)==null?void 0:a.$emit)==null?void 0:c.bind(y?.proxy));let I=g;A||(A="modelValue"),I=I||`update:${A.toString()}`;const L=F=>d?typeof d=="function"?d(F):Zu(F):F,k=()=>Ru(e[A])?L(e[A]):w,V=F=>{m?m(F)&&v(I,F):v(I,F)};if(h){const F=(0,r.ref)(k());let M=!1;return(0,r.watch)(()=>e[A],tA=>{M||(M=!0,F.value=L(tA),(0,r.nextTick)(()=>M=!1))}),(0,r.watch)(F,tA=>{!M&&(tA!==e[A]||B)&&V(tA)},{deep:B}),F}else return(0,r.computed)({get(){return k()},set(F){V(F)}})}var ju={value:()=>{}};function qn(){for(var e=0,A=arguments.length,t={},n;e<A;++e){if(!(n=arguments[e]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new Ar(t)}function Ar(e){this._=e}function qu(e,A){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");if(o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),t&&!A.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}Ar.prototype=qn.prototype={constructor:Ar,on:function(e,A){var t=this._,n=qu(e+"",t),o,a=-1,c=n.length;if(arguments.length<2){for(;++a<c;)if((o=(e=n[a]).type)&&(o=Ad(t[o],e.name)))return o;return}if(A!=null&&typeof A!="function")throw new Error("invalid callback: "+A);for(;++a<c;)if(o=(e=n[a]).type)t[o]=gs(t[o],e.name,A);else if(A==null)for(o in t)t[o]=gs(t[o],e.name,null);return this},copy:function(){var e={},A=this._;for(var t in A)e[t]=A[t].slice();return new Ar(e)},call:function(e,A){if((o=arguments.length-2)>0)for(var t=new Array(o),n=0,o,a;n<o;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,o=a.length;n<o;++n)a[n].value.apply(A,t)},apply:function(e,A,t){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],o=0,a=n.length;o<a;++o)n[o].value.apply(A,t)}};function Ad(e,A){for(var t=0,n=e.length,o;t<n;++t)if((o=e[t]).name===A)return o.value}function gs(e,A,t){for(var n=0,o=e.length;n<o;++n)if(e[n].name===A){e[n]=ju,e=e.slice(0,n).concat(e.slice(n+1));break}return t!=null&&e.push({name:A,value:t}),e}var To="http://www.w3.org/1999/xhtml",hs={svg:"http://www.w3.org/2000/svg",xhtml:To,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function er(e){var A=e+="",t=A.indexOf(":");return t>=0&&(A=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),hs.hasOwnProperty(A)?{space:hs[A],local:e}:e}function ed(e){return function(){var A=this.ownerDocument,t=this.namespaceURI;return t===To&&A.documentElement.namespaceURI===To?A.createElement(e):A.createElementNS(t,e)}}function td(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Bs(e){var A=er(e);return(A.local?td:ed)(A)}function nd(){}function ko(e){return e==null?nd:function(){return this.querySelector(e)}}function rd(e){typeof e!="function"&&(e=ko(e));for(var A=this._groups,t=A.length,n=new Array(t),o=0;o<t;++o)for(var a=A[o],c=a.length,d=n[o]=new Array(c),h,g,B=0;B<c;++B)(h=a[B])&&(g=e.call(h,h.__data__,B,a))&&("__data__"in h&&(g.__data__=h.__data__),d[B]=g);return new Ue(n,this._parents)}function od(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function id(){return[]}function ps(e){return e==null?id:function(){return this.querySelectorAll(e)}}function sd(e){return function(){return od(e.apply(this,arguments))}}function ad(e){typeof e=="function"?e=sd(e):e=ps(e);for(var A=this._groups,t=A.length,n=[],o=[],a=0;a<t;++a)for(var c=A[a],d=c.length,h,g=0;g<d;++g)(h=c[g])&&(n.push(e.call(h,h.__data__,g,c)),o.push(h));return new Ue(n,o)}function ms(e){return function(){return this.matches(e)}}function ws(e){return function(A){return A.matches(e)}}var ld=Array.prototype.find;function cd(e){return function(){return ld.call(this.children,e)}}function ud(){return this.firstElementChild}function dd(e){return this.select(e==null?ud:cd(typeof e=="function"?e:ws(e)))}var fd=Array.prototype.filter;function gd(){return Array.from(this.children)}function hd(e){return function(){return fd.call(this.children,e)}}function Bd(e){return this.selectAll(e==null?gd:hd(typeof e=="function"?e:ws(e)))}function pd(e){typeof e!="function"&&(e=ms(e));for(var A=this._groups,t=A.length,n=new Array(t),o=0;o<t;++o)for(var a=A[o],c=a.length,d=n[o]=[],h,g=0;g<c;++g)(h=a[g])&&e.call(h,h.__data__,g,a)&&d.push(h);return new Ue(n,this._parents)}function Cs(e){return new Array(e.length)}function md(){return new Ue(this._enter||this._groups.map(Cs),this._parents)}function tr(e,A){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=A}tr.prototype={constructor:tr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,A){return this._parent.insertBefore(e,A)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function wd(e){return function(){return e}}function Cd(e,A,t,n,o,a){for(var c=0,d,h=A.length,g=a.length;c<g;++c)(d=A[c])?(d.__data__=a[c],n[c]=d):t[c]=new tr(e,a[c]);for(;c<h;++c)(d=A[c])&&(o[c]=d)}function yd(e,A,t,n,o,a,c){var d,h,g=new Map,B=A.length,w=a.length,m=new Array(B),y;for(d=0;d<B;++d)(h=A[d])&&(m[d]=y=c.call(h,h.__data__,d,A)+"",g.has(y)?o[d]=h:g.set(y,h));for(d=0;d<w;++d)y=c.call(e,a[d],d,a)+"",(h=g.get(y))?(n[d]=h,h.__data__=a[d],g.delete(y)):t[d]=new tr(e,a[d]);for(d=0;d<B;++d)(h=A[d])&&g.get(m[d])===h&&(o[d]=h)}function vd(e){return e.__data__}function Qd(e,A){if(!arguments.length)return Array.from(this,vd);var t=A?yd:Cd,n=this._parents,o=this._groups;typeof e!="function"&&(e=wd(e));for(var a=o.length,c=new Array(a),d=new Array(a),h=new Array(a),g=0;g<a;++g){var B=n[g],w=o[g],m=w.length,y=Ed(e.call(B,B&&B.__data__,g,n)),v=y.length,I=d[g]=new Array(v),L=c[g]=new Array(v);t(B,w,I,L,h[g]=new Array(m),y,A);for(var k=0,V=0,F,M;k<v;++k)if(F=I[k]){for(k>=V&&(V=k+1);!(M=L[V])&&++V<v;);F._next=M||null}}return c=new Ue(c,n),c._enter=d,c._exit=h,c}function Ed(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fd(){return new Ue(this._exit||this._groups.map(Cs),this._parents)}function Ud(e,A,t){var n=this.enter(),o=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),A!=null&&(o=A(o),o&&(o=o.selection())),t==null?a.remove():t(a),n&&o?n.merge(o).order():o}function bd(e){for(var A=e.selection?e.selection():e,t=this._groups,n=A._groups,o=t.length,a=n.length,c=Math.min(o,a),d=new Array(o),h=0;h<c;++h)for(var g=t[h],B=n[h],w=g.length,m=d[h]=new Array(w),y,v=0;v<w;++v)(y=g[v]||B[v])&&(m[v]=y);for(;h<o;++h)d[h]=t[h];return new Ue(d,this._parents)}function Id(){for(var e=this._groups,A=-1,t=e.length;++A<t;)for(var n=e[A],o=n.length-1,a=n[o],c;--o>=0;)(c=n[o])&&(a&&c.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(c,a),a=c);return this}function Hd(e){e||(e=_d);function A(w,m){return w&&m?e(w.__data__,m.__data__):!w-!m}for(var t=this._groups,n=t.length,o=new Array(n),a=0;a<n;++a){for(var c=t[a],d=c.length,h=o[a]=new Array(d),g,B=0;B<d;++B)(g=c[B])&&(h[B]=g);h.sort(A)}return new Ue(o,this._parents).order()}function _d(e,A){return e<A?-1:e>A?1:e>=A?0:NaN}function Sd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xd(){return Array.from(this)}function Dd(){for(var e=this._groups,A=0,t=e.length;A<t;++A)for(var n=e[A],o=0,a=n.length;o<a;++o){var c=n[o];if(c)return c}return null}function Nd(){let e=0;for(const A of this)++e;return e}function Ld(){return!this.node()}function Td(e){for(var A=this._groups,t=0,n=A.length;t<n;++t)for(var o=A[t],a=0,c=o.length,d;a<c;++a)(d=o[a])&&e.call(d,d.__data__,a,o);return this}function kd(e){return function(){this.removeAttribute(e)}}function Md(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Od(e,A){return function(){this.setAttribute(e,A)}}function Kd(e,A){return function(){this.setAttributeNS(e.space,e.local,A)}}function Rd(e,A){return function(){var t=A.apply(this,arguments);t==null?this.removeAttribute(e):this.setAttribute(e,t)}}function Vd(e,A){return function(){var t=A.apply(this,arguments);t==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}function Pd(e,A){var t=er(e);if(arguments.length<2){var n=this.node();return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}return this.each((A==null?t.local?Md:kd:typeof A=="function"?t.local?Vd:Rd:t.local?Kd:Od)(t,A))}function ys(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Gd(e){return function(){this.style.removeProperty(e)}}function zd(e,A,t){return function(){this.style.setProperty(e,A,t)}}function $d(e,A,t){return function(){var n=A.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,t)}}function Xd(e,A,t){return arguments.length>1?this.each((A==null?Gd:typeof A=="function"?$d:zd)(e,A,t??"")):Pt(this.node(),e)}function Pt(e,A){return e.style.getPropertyValue(A)||ys(e).getComputedStyle(e,null).getPropertyValue(A)}function Wd(e){return function(){delete this[e]}}function Yd(e,A){return function(){this[e]=A}}function Jd(e,A){return function(){var t=A.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function Zd(e,A){return arguments.length>1?this.each((A==null?Wd:typeof A=="function"?Jd:Yd)(e,A)):this.node()[e]}function vs(e){return e.trim().split(/^|\s+/)}function Mo(e){return e.classList||new Qs(e)}function Qs(e){this._node=e,this._names=vs(e.getAttribute("class")||"")}Qs.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var A=this._names.indexOf(e);A>=0&&(this._names.splice(A,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Es(e,A){for(var t=Mo(e),n=-1,o=A.length;++n<o;)t.add(A[n])}function Fs(e,A){for(var t=Mo(e),n=-1,o=A.length;++n<o;)t.remove(A[n])}function jd(e){return function(){Es(this,e)}}function qd(e){return function(){Fs(this,e)}}function Af(e,A){return function(){(A.apply(this,arguments)?Es:Fs)(this,e)}}function ef(e,A){var t=vs(e+"");if(arguments.length<2){for(var n=Mo(this.node()),o=-1,a=t.length;++o<a;)if(!n.contains(t[o]))return!1;return!0}return this.each((typeof A=="function"?Af:A?jd:qd)(t,A))}function tf(){this.textContent=""}function nf(e){return function(){this.textContent=e}}function rf(e){return function(){var A=e.apply(this,arguments);this.textContent=A??""}}function of(e){return arguments.length?this.each(e==null?tf:(typeof e=="function"?rf:nf)(e)):this.node().textContent}function sf(){this.innerHTML=""}function af(e){return function(){this.innerHTML=e}}function lf(e){return function(){var A=e.apply(this,arguments);this.innerHTML=A??""}}function cf(e){return arguments.length?this.each(e==null?sf:(typeof e=="function"?lf:af)(e)):this.node().innerHTML}function uf(){this.nextSibling&&this.parentNode.appendChild(this)}function df(){return this.each(uf)}function ff(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gf(){return this.each(ff)}function hf(e){var A=typeof e=="function"?e:Bs(e);return this.select(function(){return this.appendChild(A.apply(this,arguments))})}function Bf(){return null}function pf(e,A){var t=typeof e=="function"?e:Bs(e),n=A==null?Bf:typeof A=="function"?A:ko(A);return this.select(function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)})}function mf(){var e=this.parentNode;e&&e.removeChild(this)}function wf(){return this.each(mf)}function Cf(){var e=this.cloneNode(!1),A=this.parentNode;return A?A.insertBefore(e,this.nextSibling):e}function yf(){var e=this.cloneNode(!0),A=this.parentNode;return A?A.insertBefore(e,this.nextSibling):e}function vf(e){return this.select(e?yf:Cf)}function Qf(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ef(e){return function(A){e.call(this,A,this.__data__)}}function Ff(e){return e.trim().split(/^|\s+/).map(function(A){var t="",n=A.indexOf(".");return n>=0&&(t=A.slice(n+1),A=A.slice(0,n)),{type:A,name:t}})}function Uf(e){return function(){var A=this.__on;if(A){for(var t=0,n=-1,o=A.length,a;t<o;++t)a=A[t],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):A[++n]=a;++n?A.length=n:delete this.__on}}}function bf(e,A,t){return function(){var n=this.__on,o,a=Ef(A);if(n){for(var c=0,d=n.length;c<d;++c)if((o=n[c]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=t),o.value=A;return}}this.addEventListener(e.type,a,t),o={type:e.type,name:e.name,value:A,listener:a,options:t},n?n.push(o):this.__on=[o]}}function If(e,A,t){var n=Ff(e+""),o,a=n.length,c;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,g=d.length,B;h<g;++h)for(o=0,B=d[h];o<a;++o)if((c=n[o]).type===B.type&&c.name===B.name)return B.value}return}for(d=A?bf:Uf,o=0;o<a;++o)this.each(d(n[o],A,t));return this}function Us(e,A,t){var n=ys(e),o=n.CustomEvent;typeof o=="function"?o=new o(A,t):(o=n.document.createEvent("Event"),t?(o.initEvent(A,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(A,!1,!1)),e.dispatchEvent(o)}function Hf(e,A){return function(){return Us(this,e,A)}}function _f(e,A){return function(){return Us(this,e,A.apply(this,arguments))}}function Sf(e,A){return this.each((typeof A=="function"?_f:Hf)(e,A))}function*xf(){for(var e=this._groups,A=0,t=e.length;A<t;++A)for(var n=e[A],o=0,a=n.length,c;o<a;++o)(c=n[o])&&(yield c)}var bs=[null];function Ue(e,A){this._groups=e,this._parents=A}function Bn(){return new Ue([[document.documentElement]],bs)}function Df(){return this}Ue.prototype=Bn.prototype={constructor:Ue,select:rd,selectAll:ad,selectChild:dd,selectChildren:Bd,filter:pd,data:Qd,enter:md,exit:Fd,join:Ud,merge:bd,selection:Df,order:Id,sort:Hd,call:Sd,nodes:xd,node:Dd,size:Nd,empty:Ld,each:Td,attr:Pd,style:Xd,property:Zd,classed:ef,text:of,html:cf,raise:df,lower:gf,append:hf,insert:pf,remove:wf,clone:vf,datum:Qf,on:If,dispatch:Sf,[Symbol.iterator]:xf};function ke(e){return typeof e=="string"?new Ue([[document.querySelector(e)]],[document.documentElement]):new Ue([[e]],bs)}function Nf(e){let A;for(;A=e.sourceEvent;)e=A;return e}function Ve(e,A){if(e=Nf(e),A===void 0&&(A=e.currentTarget),A){var t=A.ownerSVGElement||A;if(t.createSVGPoint){var n=t.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(A.getScreenCTM().inverse()),[n.x,n.y]}if(A.getBoundingClientRect){var o=A.getBoundingClientRect();return[e.clientX-o.left-A.clientLeft,e.clientY-o.top-A.clientTop]}}return[e.pageX,e.pageY]}var Lf={passive:!1},pn={capture:!0,passive:!1};function Oo(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function Is(e){var A=e.document.documentElement,t=ke(e).on("dragstart.drag",Gt,pn);"onselectstart"in A?t.on("selectstart.drag",Gt,pn):(A.__noselect=A.style.MozUserSelect,A.style.MozUserSelect="none")}function Hs(e,A){var t=e.document.documentElement,n=ke(e).on("dragstart.drag",null);A&&(n.on("click.drag",Gt,pn),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in t?n.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}var nr=e=>()=>e;function Ko(e,{sourceEvent:A,subject:t,target:n,identifier:o,active:a,x:c,y:d,dx:h,dy:g,dispatch:B}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:A,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:B}})}Ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Tf(e){return!e.ctrlKey&&!e.button}function kf(){return this.parentNode}function Mf(e,A){return A??{x:e.x,y:e.y}}function Of(){return navigator.maxTouchPoints||"ontouchstart"in this}function Kf(){var e=Tf,A=kf,t=Mf,n=Of,o={},a=qn("start","drag","end"),c=0,d,h,g,B,w=0;function m(M){M.on("mousedown.drag",y).filter(n).on("touchstart.drag",L).on("touchmove.drag",k,Lf).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(M,tA){if(!(B||!e.call(this,M,tA))){var W=F(this,A.call(this,M,tA),M,tA,"mouse");W&&(ke(M.view).on("mousemove.drag",v,pn).on("mouseup.drag",I,pn),Is(M.view),Oo(M),g=!1,d=M.clientX,h=M.clientY,W("start",M))}}function v(M){if(Gt(M),!g){var tA=M.clientX-d,W=M.clientY-h;g=tA*tA+W*W>w}o.mouse("drag",M)}function I(M){ke(M.view).on("mousemove.drag mouseup.drag",null),Hs(M.view,g),Gt(M),o.mouse("end",M)}function L(M,tA){if(e.call(this,M,tA)){var W=M.changedTouches,aA=A.call(this,M,tA),dA=W.length,rA,oA;for(rA=0;rA<dA;++rA)(oA=F(this,aA,M,tA,W[rA].identifier,W[rA]))&&(Oo(M),oA("start",M,W[rA]))}}function k(M){var tA=M.changedTouches,W=tA.length,aA,dA;for(aA=0;aA<W;++aA)(dA=o[tA[aA].identifier])&&(Gt(M),dA("drag",M,tA[aA]))}function V(M){var tA=M.changedTouches,W=tA.length,aA,dA;for(B&&clearTimeout(B),B=setTimeout(function(){B=null},500),aA=0;aA<W;++aA)(dA=o[tA[aA].identifier])&&(Oo(M),dA("end",M,tA[aA]))}function F(M,tA,W,aA,dA,rA){var oA=a.copy(),AA=Ve(rA||W,tA),O,lA,_;if((_=t.call(M,new Ko("beforestart",{sourceEvent:W,target:m,identifier:dA,active:c,x:AA[0],y:AA[1],dx:0,dy:0,dispatch:oA}),aA))!=null)return O=_.x-AA[0]||0,lA=_.y-AA[1]||0,function Z(U,x,G){var R=AA,$;switch(U){case"start":o[dA]=Z,$=c++;break;case"end":delete o[dA],--c;case"drag":AA=Ve(G||x,tA),$=c;break}oA.call(U,M,new Ko(U,{sourceEvent:x,subject:_,target:m,identifier:dA,active:$,x:AA[0]+O,y:AA[1]+lA,dx:AA[0]-R[0],dy:AA[1]-R[1],dispatch:oA}),aA)}}return m.filter=function(M){return arguments.length?(e=typeof M=="function"?M:nr(!!M),m):e},m.container=function(M){return arguments.length?(A=typeof M=="function"?M:nr(M),m):A},m.subject=function(M){return arguments.length?(t=typeof M=="function"?M:nr(M),m):t},m.touchable=function(M){return arguments.length?(n=typeof M=="function"?M:nr(!!M),m):n},m.on=function(){var M=a.on.apply(a,arguments);return M===a?m:M},m.clickDistance=function(M){return arguments.length?(w=(M=+M)*M,m):Math.sqrt(w)},m}function Ro(e,A,t){e.prototype=A.prototype=t,t.constructor=e}function _s(e,A){var t=Object.create(e.prototype);for(var n in A)t[n]=A[n];return t}function mn(){}var wn=.7,rr=1/wn,zt="\\s*([+-]?\\d+)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rf=/^#([0-9a-f]{3,8})$/,Vf=new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`),Pf=new RegExp(`^rgb\\(${Pe},${Pe},${Pe}\\)$`),Gf=new RegExp(`^rgba\\(${zt},${zt},${zt},${Cn}\\)$`),zf=new RegExp(`^rgba\\(${Pe},${Pe},${Pe},${Cn}\\)$`),$f=new RegExp(`^hsl\\(${Cn},${Pe},${Pe}\\)$`),Xf=new RegExp(`^hsla\\(${Cn},${Pe},${Pe},${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};Ro(mn,bt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xs,formatHex:xs,formatHex8:Wf,formatHsl:Yf,formatRgb:Ds,toString:Ds});function xs(){return this.rgb().formatHex()}function Wf(){return this.rgb().formatHex8()}function Yf(){return Ms(this).formatHsl()}function Ds(){return this.rgb().formatRgb()}function bt(e){var A,t;return e=(e+"").trim().toLowerCase(),(A=Rf.exec(e))?(t=A[1].length,A=parseInt(A[1],16),t===6?Ns(A):t===3?new Ce(A>>8&15|A>>4&240,A>>4&15|A&240,(A&15)<<4|A&15,1):t===8?or(A>>24&255,A>>16&255,A>>8&255,(A&255)/255):t===4?or(A>>12&15|A>>8&240,A>>8&15|A>>4&240,A>>4&15|A&240,((A&15)<<4|A&15)/255):null):(A=Vf.exec(e))?new Ce(A[1],A[2],A[3],1):(A=Pf.exec(e))?new Ce(A[1]*255/100,A[2]*255/100,A[3]*255/100,1):(A=Gf.exec(e))?or(A[1],A[2],A[3],A[4]):(A=zf.exec(e))?or(A[1]*255/100,A[2]*255/100,A[3]*255/100,A[4]):(A=$f.exec(e))?ks(A[1],A[2]/100,A[3]/100,1):(A=Xf.exec(e))?ks(A[1],A[2]/100,A[3]/100,A[4]):Ss.hasOwnProperty(e)?Ns(Ss[e]):e==="transparent"?new Ce(NaN,NaN,NaN,0):null}function Ns(e){return new Ce(e>>16&255,e>>8&255,e&255,1)}function or(e,A,t,n){return n<=0&&(e=A=t=NaN),new Ce(e,A,t,n)}function Jf(e){return e instanceof mn||(e=bt(e)),e?(e=e.rgb(),new Ce(e.r,e.g,e.b,e.opacity)):new Ce}function Vo(e,A,t,n){return arguments.length===1?Jf(e):new Ce(e,A,t,n??1)}function Ce(e,A,t,n){this.r=+e,this.g=+A,this.b=+t,this.opacity=+n}Ro(Ce,Vo,_s(mn,{brighter(e){return e=e==null?rr:Math.pow(rr,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ce(It(this.r),It(this.g),It(this.b),ir(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:Ls,formatHex:Ls,formatHex8:Zf,formatRgb:Ts,toString:Ts}));function Ls(){return`#${Ht(this.r)}${Ht(this.g)}${Ht(this.b)}`}function Zf(){return`#${Ht(this.r)}${Ht(this.g)}${Ht(this.b)}${Ht((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ts(){const e=ir(this.opacity);return`${e===1?"rgb(":"rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${e===1?")":`, ${e})`}`}function ir(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function It(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ht(e){return e=It(e),(e<16?"0":"")+e.toString(16)}function ks(e,A,t,n){return n<=0?e=A=t=NaN:t<=0||t>=1?e=A=NaN:A<=0&&(e=NaN),new Me(e,A,t,n)}function Ms(e){if(e instanceof Me)return new Me(e.h,e.s,e.l,e.opacity);if(e instanceof mn||(e=bt(e)),!e)return new Me;if(e instanceof Me)return e;e=e.rgb();var A=e.r/255,t=e.g/255,n=e.b/255,o=Math.min(A,t,n),a=Math.max(A,t,n),c=NaN,d=a-o,h=(a+o)/2;return d?(A===a?c=(t-n)/d+(t<n)*6:t===a?c=(n-A)/d+2:c=(A-t)/d+4,d/=h<.5?a+o:2-a-o,c*=60):d=h>0&&h<1?0:c,new Me(c,d,h,e.opacity)}function jf(e,A,t,n){return arguments.length===1?Ms(e):new Me(e,A,t,n??1)}function Me(e,A,t,n){this.h=+e,this.s=+A,this.l=+t,this.opacity=+n}Ro(Me,jf,_s(mn,{brighter(e){return e=e==null?rr:Math.pow(rr,e),new Me(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Me(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,A=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*A,o=2*t-n;return new Ce(Po(e>=240?e-240:e+120,o,n),Po(e,o,n),Po(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Me(Os(this.h),sr(this.s),sr(this.l),ir(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 e=ir(this.opacity);return`${e===1?"hsl(":"hsla("}${Os(this.h)}, ${sr(this.s)*100}%, ${sr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Os(e){return e=(e||0)%360,e<0?e+360:e}function sr(e){return Math.max(0,Math.min(1,e||0))}function Po(e,A,t){return(e<60?A+(t-A)*e/60:e<180?t:e<240?A+(t-A)*(240-e)/60:A)*255}var Go=e=>()=>e;function qf(e,A){return function(t){return e+t*A}}function Ag(e,A,t){return e=Math.pow(e,t),A=Math.pow(A,t)-e,t=1/t,function(n){return Math.pow(e+n*A,t)}}function eg(e){return(e=+e)==1?Ks:function(A,t){return t-A?Ag(A,t,e):Go(isNaN(A)?t:A)}}function Ks(e,A){var t=A-e;return t?qf(e,t):Go(isNaN(e)?A:e)}var ar=(function e(A){var t=eg(A);function n(o,a){var c=t((o=Vo(o)).r,(a=Vo(a)).r),d=t(o.g,a.g),h=t(o.b,a.b),g=Ks(o.opacity,a.opacity);return function(B){return o.r=c(B),o.g=d(B),o.b=h(B),o.opacity=g(B),o+""}}return n.gamma=e,n})(1);function tg(e,A){A||(A=[]);var t=e?Math.min(A.length,e.length):0,n=A.slice(),o;return function(a){for(o=0;o<t;++o)n[o]=e[o]*(1-a)+A[o]*a;return n}}function ng(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rg(e,A){var t=A?A.length:0,n=e?Math.min(t,e.length):0,o=new Array(n),a=new Array(t),c;for(c=0;c<n;++c)o[c]=yn(e[c],A[c]);for(;c<t;++c)a[c]=A[c];return function(d){for(c=0;c<n;++c)a[c]=o[c](d);return a}}function og(e,A){var t=new Date;return e=+e,A=+A,function(n){return t.setTime(e*(1-n)+A*n),t}}function Ge(e,A){return e=+e,A=+A,function(t){return e*(1-t)+A*t}}function ig(e,A){var t={},n={},o;(e===null||typeof e!="object")&&(e={}),(A===null||typeof A!="object")&&(A={});for(o in A)o in e?t[o]=yn(e[o],A[o]):n[o]=A[o];return function(a){for(o in t)n[o]=t[o](a);return n}}var zo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$o=new RegExp(zo.source,"g");function sg(e){return function(){return e}}function ag(e){return function(A){return e(A)+""}}function Rs(e,A){var t=zo.lastIndex=$o.lastIndex=0,n,o,a,c=-1,d=[],h=[];for(e=e+"",A=A+"";(n=zo.exec(e))&&(o=$o.exec(A));)(a=o.index)>t&&(a=A.slice(t,a),d[c]?d[c]+=a:d[++c]=a),(n=n[0])===(o=o[0])?d[c]?d[c]+=o:d[++c]=o:(d[++c]=null,h.push({i:c,x:Ge(n,o)})),t=$o.lastIndex;return t<A.length&&(a=A.slice(t),d[c]?d[c]+=a:d[++c]=a),d.length<2?h[0]?ag(h[0].x):sg(A):(A=h.length,function(g){for(var B=0,w;B<A;++B)d[(w=h[B]).i]=w.x(g);return d.join("")})}function yn(e,A){var t=typeof A,n;return A==null||t==="boolean"?Go(A):(t==="number"?Ge:t==="string"?(n=bt(A))?(A=n,ar):Rs:A instanceof bt?ar:A instanceof Date?og:ng(A)?tg:Array.isArray(A)?rg:typeof A.valueOf!="function"&&typeof A.toString!="function"||isNaN(A)?ig:Ge)(e,A)}var Vs=180/Math.PI,Xo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ps(e,A,t,n,o,a){var c,d,h;return(c=Math.sqrt(e*e+A*A))&&(e/=c,A/=c),(h=e*t+A*n)&&(t-=e*h,n-=A*h),(d=Math.sqrt(t*t+n*n))&&(t/=d,n/=d,h/=d),e*n<A*t&&(e=-e,A=-A,h=-h,c=-c),{translateX:o,translateY:a,rotate:Math.atan2(A,e)*Vs,skewX:Math.atan(h)*Vs,scaleX:c,scaleY:d}}var lr;function lg(e){const A=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return A.isIdentity?Xo:Ps(A.a,A.b,A.c,A.d,A.e,A.f)}function cg(e){return e==null||(lr||(lr=document.createElementNS("http://www.w3.org/2000/svg","g")),lr.setAttribute("transform",e),!(e=lr.transform.baseVal.consolidate()))?Xo:(e=e.matrix,Ps(e.a,e.b,e.c,e.d,e.e,e.f))}function Gs(e,A,t,n){function o(g){return g.length?g.pop()+" ":""}function a(g,B,w,m,y,v){if(g!==w||B!==m){var I=y.push("translate(",null,A,null,t);v.push({i:I-4,x:Ge(g,w)},{i:I-2,x:Ge(B,m)})}else(w||m)&&y.push("translate("+w+A+m+t)}function c(g,B,w,m){g!==B?(g-B>180?B+=360:B-g>180&&(g+=360),m.push({i:w.push(o(w)+"rotate(",null,n)-2,x:Ge(g,B)})):B&&w.push(o(w)+"rotate("+B+n)}function d(g,B,w,m){g!==B?m.push({i:w.push(o(w)+"skewX(",null,n)-2,x:Ge(g,B)}):B&&w.push(o(w)+"skewX("+B+n)}function h(g,B,w,m,y,v){if(g!==w||B!==m){var I=y.push(o(y)+"scale(",null,",",null,")");v.push({i:I-4,x:Ge(g,w)},{i:I-2,x:Ge(B,m)})}else(w!==1||m!==1)&&y.push(o(y)+"scale("+w+","+m+")")}return function(g,B){var w=[],m=[];return g=e(g),B=e(B),a(g.translateX,g.translateY,B.translateX,B.translateY,w,m),c(g.rotate,B.rotate,w,m),d(g.skewX,B.skewX,w,m),h(g.scaleX,g.scaleY,B.scaleX,B.scaleY,w,m),g=B=null,function(y){for(var v=-1,I=m.length,L;++v<I;)w[(L=m[v]).i]=L.x(y);return w.join("")}}}var ug=Gs(lg,"px, ","px)","deg)"),dg=Gs(cg,", ",")",")"),fg=1e-12;function zs(e){return((e=Math.exp(e))+1/e)/2}function gg(e){return((e=Math.exp(e))-1/e)/2}function hg(e){return((e=Math.exp(2*e))-1)/(e+1)}var cr=(function e(A,t,n){function o(a,c){var d=a[0],h=a[1],g=a[2],B=c[0],w=c[1],m=c[2],y=B-d,v=w-h,I=y*y+v*v,L,k;if(I<fg)k=Math.log(m/g)/A,L=function(W){return[d+W*y,h+W*v,g*Math.exp(A*W*k)]};else{var V=Math.sqrt(I),F=(m*m-g*g+n*I)/(2*g*t*V),M=(m*m-g*g-n*I)/(2*m*t*V),tA=Math.log(Math.sqrt(F*F+1)-F);k=(Math.log(Math.sqrt(M*M+1)-M)-tA)/A,L=function(W){var aA=W*k,dA=zs(tA),rA=g/(t*V)*(dA*hg(A*aA+tA)-gg(tA));return[d+rA*y,h+rA*v,g*dA/zs(A*aA+tA)]}}return L.duration=k*1e3*A/Math.SQRT2,L}return o.rho=function(a){var c=Math.max(.001,+a),d=c*c;return e(c,d,d*d)},o})(Math.SQRT2,2,4),$t=0,vn=0,Qn=0,$s=1e3,ur,En,dr=0,_t=0,fr=0,Fn=typeof performance=="object"&&performance.now?performance:Date,Xs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wo(){return _t||(Xs(Bg),_t=Fn.now()+fr)}function Bg(){_t=0}function gr(){this._call=this._time=this._next=null}gr.prototype=Ws.prototype={constructor:gr,restart:function(e,A,t){if(typeof e!="function")throw new TypeError("callback is not a function");t=(t==null?Wo():+t)+(A==null?0:+A),!this._next&&En!==this&&(En?En._next=this:ur=this,En=this),this._call=e,this._time=t,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function Ws(e,A,t){var n=new gr;return n.restart(e,A,t),n}function pg(){Wo(),++$t;for(var e=ur,A;e;)(A=_t-e._time)>=0&&e._call.call(void 0,A),e=e._next;--$t}function Ys(){_t=(dr=Fn.now())+fr,$t=vn=0;try{pg()}finally{$t=0,wg(),_t=0}}function mg(){var e=Fn.now(),A=e-dr;A>$s&&(fr-=A,dr=e)}function wg(){for(var e,A=ur,t,n=1/0;A;)A._call?(n>A._time&&(n=A._time),e=A,A=A._next):(t=A._next,A._next=null,A=e?e._next=t:ur=t);En=e,Yo(n)}function Yo(e){$t||(vn&&(vn=clearTimeout(vn)),e-_t>24?(e<1/0&&(vn=setTimeout(Ys,e-Fn.now()-fr)),Qn&&(Qn=clearInterval(Qn))):(Qn||(dr=Fn.now(),Qn=setInterval(mg,$s)),$t=1,Xs(Ys)))}function Js(e,A,t){var n=new gr;return A=A==null?0:+A,n.restart(o=>{n.stop(),e(o+A)},A,t),n}var Cg=qn("start","end","cancel","interrupt"),yg=[],Zs=0,js=1,Jo=2,hr=3,qs=4,Zo=5,Br=6;function pr(e,A,t,n,o,a){var c=e.__transition;if(!c)e.__transition={};else if(t in c)return;vg(e,t,{name:A,index:n,group:o,on:Cg,tween:yg,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Zs})}function jo(e,A){var t=Oe(e,A);if(t.state>Zs)throw new Error("too late; already scheduled");return t}function ze(e,A){var t=Oe(e,A);if(t.state>hr)throw new Error("too late; already running");return t}function Oe(e,A){var t=e.__transition;if(!t||!(t=t[A]))throw new Error("transition not found");return t}function vg(e,A,t){var n=e.__transition,o;n[A]=t,t.timer=Ws(a,0,t.time);function a(g){t.state=js,t.timer.restart(c,t.delay,t.time),t.delay<=g&&c(g-t.delay)}function c(g){var B,w,m,y;if(t.state!==js)return h();for(B in n)if(y=n[B],y.name===t.name){if(y.state===hr)return Js(c);y.state===qs?(y.state=Br,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete n[B]):+B<A&&(y.state=Br,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete n[B])}if(Js(function(){t.state===hr&&(t.state=qs,t.timer.restart(d,t.delay,t.time),d(g))}),t.state=Jo,t.on.call("start",e,e.__data__,t.index,t.group),t.state===Jo){for(t.state=hr,o=new Array(m=t.tween.length),B=0,w=-1;B<m;++B)(y=t.tween[B].value.call(e,e.__data__,t.index,t.group))&&(o[++w]=y);o.length=w+1}}function d(g){for(var B=g<t.duration?t.ease.call(null,g/t.duration):(t.timer.restart(h),t.state=Zo,1),w=-1,m=o.length;++w<m;)o[w].call(e,B);t.state===Zo&&(t.on.call("end",e,e.__data__,t.index,t.group),h())}function h(){t.state=Br,t.timer.stop(),delete n[A];for(var g in n)return;delete e.__transition}}function mr(e,A){var t=e.__transition,n,o,a=!0,c;if(t){A=A==null?null:A+"";for(c in t){if((n=t[c]).name!==A){a=!1;continue}o=n.state>Jo&&n.state<Zo,n.state=Br,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete t[c]}a&&delete e.__transition}}function Qg(e){return this.each(function(){mr(this,e)})}function Eg(e,A){var t,n;return function(){var o=ze(this,e),a=o.tween;if(a!==t){n=t=a;for(var c=0,d=n.length;c<d;++c)if(n[c].name===A){n=n.slice(),n.splice(c,1);break}}o.tween=n}}function Fg(e,A,t){var n,o;if(typeof t!="function")throw new Error;return function(){var a=ze(this,e),c=a.tween;if(c!==n){o=(n=c).slice();for(var d={name:A,value:t},h=0,g=o.length;h<g;++h)if(o[h].name===A){o[h]=d;break}h===g&&o.push(d)}a.tween=o}}function Ug(e,A){var t=this._id;if(e+="",arguments.length<2){for(var n=Oe(this.node(),t).tween,o=0,a=n.length,c;o<a;++o)if((c=n[o]).name===e)return c.value;return null}return this.each((A==null?Eg:Fg)(t,e,A))}function qo(e,A,t){var n=e._id;return e.each(function(){var o=ze(this,n);(o.value||(o.value={}))[A]=t.apply(this,arguments)}),function(o){return Oe(o,n).value[A]}}function Aa(e,A){var t;return(typeof A=="number"?Ge:A instanceof bt?ar:(t=bt(A))?(A=t,ar):Rs)(e,A)}function bg(e){return function(){this.removeAttribute(e)}}function Ig(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hg(e,A,t){var n,o=t+"",a;return function(){var c=this.getAttribute(e);return c===o?null:c===n?a:a=A(n=c,t)}}function _g(e,A,t){var n,o=t+"",a;return function(){var c=this.getAttributeNS(e.space,e.local);return c===o?null:c===n?a:a=A(n=c,t)}}function Sg(e,A,t){var n,o,a;return function(){var c,d=t(this),h;return d==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=d+"",c===h?null:c===n&&h===o?a:(o=h,a=A(n=c,d)))}}function xg(e,A,t){var n,o,a;return function(){var c,d=t(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=d+"",c===h?null:c===n&&h===o?a:(o=h,a=A(n=c,d)))}}function Dg(e,A){var t=er(e),n=t==="transform"?dg:Aa;return this.attrTween(e,typeof A=="function"?(t.local?xg:Sg)(t,n,qo(this,"attr."+e,A)):A==null?(t.local?Ig:bg)(t):(t.local?_g:Hg)(t,n,A))}function Ng(e,A){return function(t){this.setAttribute(e,A.call(this,t))}}function Lg(e,A){return function(t){this.setAttributeNS(e.space,e.local,A.call(this,t))}}function Tg(e,A){var t,n;function o(){var a=A.apply(this,arguments);return a!==n&&(t=(n=a)&&Lg(e,a)),t}return o._value=A,o}function kg(e,A){var t,n;function o(){var a=A.apply(this,arguments);return a!==n&&(t=(n=a)&&Ng(e,a)),t}return o._value=A,o}function Mg(e,A){var t="attr."+e;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(A==null)return this.tween(t,null);if(typeof A!="function")throw new Error;var n=er(e);return this.tween(t,(n.local?Tg:kg)(n,A))}function Og(e,A){return function(){jo(this,e).delay=+A.apply(this,arguments)}}function Kg(e,A){return A=+A,function(){jo(this,e).delay=A}}function Rg(e){var A=this._id;return arguments.length?this.each((typeof e=="function"?Og:Kg)(A,e)):Oe(this.node(),A).delay}function Vg(e,A){return function(){ze(this,e).duration=+A.apply(this,arguments)}}function Pg(e,A){return A=+A,function(){ze(this,e).duration=A}}function Gg(e){var A=this._id;return arguments.length?this.each((typeof e=="function"?Vg:Pg)(A,e)):Oe(this.node(),A).duration}function zg(e,A){if(typeof A!="function")throw new Error;return function(){ze(this,e).ease=A}}function $g(e){var A=this._id;return arguments.length?this.each(zg(A,e)):Oe(this.node(),A).ease}function Xg(e,A){return function(){var t=A.apply(this,arguments);if(typeof t!="function")throw new Error;ze(this,e).ease=t}}function Wg(e){if(typeof e!="function")throw new Error;return this.each(Xg(this._id,e))}function Yg(e){typeof e!="function"&&(e=ms(e));for(var A=this._groups,t=A.length,n=new Array(t),o=0;o<t;++o)for(var a=A[o],c=a.length,d=n[o]=[],h,g=0;g<c;++g)(h=a[g])&&e.call(h,h.__data__,g,a)&&d.push(h);return new qe(n,this._parents,this._name,this._id)}function Jg(e){if(e._id!==this._id)throw new Error;for(var A=this._groups,t=e._groups,n=A.length,o=t.length,a=Math.min(n,o),c=new Array(n),d=0;d<a;++d)for(var h=A[d],g=t[d],B=h.length,w=c[d]=new Array(B),m,y=0;y<B;++y)(m=h[y]||g[y])&&(w[y]=m);for(;d<n;++d)c[d]=A[d];return new qe(c,this._parents,this._name,this._id)}function Zg(e){return(e+"").trim().split(/^|\s+/).every(function(A){var t=A.indexOf(".");return t>=0&&(A=A.slice(0,t)),!A||A==="start"})}function jg(e,A,t){var n,o,a=Zg(A)?jo:ze;return function(){var c=a(this,e),d=c.on;d!==n&&(o=(n=d).copy()).on(A,t),c.on=o}}function qg(e,A){var t=this._id;return arguments.length<2?Oe(this.node(),t).on.on(e):this.each(jg(t,e,A))}function Ah(e){return function(){var A=this.parentNode;for(var t in this.__transition)if(+t!==e)return;A&&A.removeChild(this)}}function eh(){return this.on("end.remove",Ah(this._id))}function th(e){var A=this._name,t=this._id;typeof e!="function"&&(e=ko(e));for(var n=this._groups,o=n.length,a=new Array(o),c=0;c<o;++c)for(var d=n[c],h=d.length,g=a[c]=new Array(h),B,w,m=0;m<h;++m)(B=d[m])&&(w=e.call(B,B.__data__,m,d))&&("__data__"in B&&(w.__data__=B.__data__),g[m]=w,pr(g[m],A,t,m,g,Oe(B,t)));return new qe(a,this._parents,A,t)}function nh(e){var A=this._name,t=this._id;typeof e!="function"&&(e=ps(e));for(var n=this._groups,o=n.length,a=[],c=[],d=0;d<o;++d)for(var h=n[d],g=h.length,B,w=0;w<g;++w)if(B=h[w]){for(var m=e.call(B,B.__data__,w,h),y,v=Oe(B,t),I=0,L=m.length;I<L;++I)(y=m[I])&&pr(y,A,t,I,m,v);a.push(m),c.push(B)}return new qe(a,c,A,t)}var rh=Bn.prototype.constructor;function oh(){return new rh(this._groups,this._parents)}function ih(e,A){var t,n,o;return function(){var a=Pt(this,e),c=(this.style.removeProperty(e),Pt(this,e));return a===c?null:a===t&&c===n?o:o=A(t=a,n=c)}}function ea(e){return function(){this.style.removeProperty(e)}}function sh(e,A,t){var n,o=t+"",a;return function(){var c=Pt(this,e);return c===o?null:c===n?a:a=A(n=c,t)}}function ah(e,A,t){var n,o,a;return function(){var c=Pt(this,e),d=t(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),Pt(this,e))),c===h?null:c===n&&h===o?a:(o=h,a=A(n=c,d))}}function lh(e,A){var t,n,o,a="style."+A,c="end."+a,d;return function(){var h=ze(this,e),g=h.on,B=h.value[a]==null?d||(d=ea(A)):void 0;(g!==t||o!==B)&&(n=(t=g).copy()).on(c,o=B),h.on=n}}function ch(e,A,t){var n=(e+="")=="transform"?ug:Aa;return A==null?this.styleTween(e,ih(e,n)).on("end.style."+e,ea(e)):typeof A=="function"?this.styleTween(e,ah(e,n,qo(this,"style."+e,A))).each(lh(this._id,e)):this.styleTween(e,sh(e,n,A),t).on("end.style."+e,null)}function uh(e,A,t){return function(n){this.style.setProperty(e,A.call(this,n),t)}}function dh(e,A,t){var n,o;function a(){var c=A.apply(this,arguments);return c!==o&&(n=(o=c)&&uh(e,c,t)),n}return a._value=A,a}function fh(e,A,t){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(A==null)return this.tween(n,null);if(typeof A!="function")throw new Error;return this.tween(n,dh(e,A,t??""))}function gh(e){return function(){this.textContent=e}}function hh(e){return function(){var A=e(this);this.textContent=A??""}}function Bh(e){return this.tween("text",typeof e=="function"?hh(qo(this,"text",e)):gh(e==null?"":e+""))}function ph(e){return function(A){this.textContent=e.call(this,A)}}function mh(e){var A,t;function n(){var o=e.apply(this,arguments);return o!==t&&(A=(t=o)&&ph(o)),A}return n._value=e,n}function wh(e){var A="text";if(arguments.length<1)return(A=this.tween(A))&&A._value;if(e==null)return this.tween(A,null);if(typeof e!="function")throw new Error;return this.tween(A,mh(e))}function Ch(){for(var e=this._name,A=this._id,t=ta(),n=this._groups,o=n.length,a=0;a<o;++a)for(var c=n[a],d=c.length,h,g=0;g<d;++g)if(h=c[g]){var B=Oe(h,A);pr(h,e,t,g,c,{time:B.time+B.delay+B.duration,delay:0,duration:B.duration,ease:B.ease})}return new qe(n,this._parents,e,t)}function yh(){var e,A,t=this,n=t._id,o=t.size();return new Promise(function(a,c){var d={value:c},h={value:function(){--o===0&&a()}};t.each(function(){var g=ze(this,n),B=g.on;B!==e&&(A=(e=B).copy(),A._.cancel.push(d),A._.interrupt.push(d),A._.end.push(h)),g.on=A}),o===0&&a()})}var vh=0;function qe(e,A,t,n){this._groups=e,this._parents=A,this._name=t,this._id=n}function ta(){return++vh}var At=Bn.prototype;qe.prototype={constructor:qe,select:th,selectAll:nh,selectChild:At.selectChild,selectChildren:At.selectChildren,filter:Yg,merge:Jg,selection:oh,transition:Ch,call:At.call,nodes:At.nodes,node:At.node,size:At.size,empty:At.empty,each:At.each,on:qg,attr:Dg,attrTween:Mg,style:ch,styleTween:fh,text:Bh,textTween:wh,remove:eh,tween:Ug,delay:Rg,duration:Gg,ease:$g,easeVarying:Wg,end:yh,[Symbol.iterator]:At[Symbol.iterator]};function Qh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Eh={time:null,delay:0,duration:250,ease:Qh};function Fh(e,A){for(var t;!(t=e.__transition)||!(t=t[A]);)if(!(e=e.parentNode))throw new Error(`transition ${A} not found`);return t}function Uh(e){var A,t;e instanceof qe?(A=e._id,e=e._name):(A=ta(),(t=Eh).time=Wo(),e=e==null?null:e+"");for(var n=this._groups,o=n.length,a=0;a<o;++a)for(var c=n[a],d=c.length,h,g=0;g<d;++g)(h=c[g])&&pr(h,e,A,g,c,t||Fh(h,A));return new qe(n,this._parents,e,A)}Bn.prototype.interrupt=Qg,Bn.prototype.transition=Uh;var wr=e=>()=>e;function bh(e,{sourceEvent:A,target:t,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:A,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function et(e,A,t){this.k=e,this.x=A,this.y=t}et.prototype={constructor:et,scale:function(e){return e===1?this:new et(this.k*e,this.x,this.y)},translate:function(e,A){return e===0&A===0?this:new et(this.k,this.x+this.k*e,this.y+this.k*A)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xt=new et(1,0,0);et.prototype;function Ai(e){e.stopImmediatePropagation()}function Un(e){e.preventDefault(),e.stopImmediatePropagation()}function Ih(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hh(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function na(){return this.__zoom||Xt}function _h(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Sh(){return navigator.maxTouchPoints||"ontouchstart"in this}function xh(e,A,t){var n=e.invertX(A[0][0])-t[0][0],o=e.invertX(A[1][0])-t[1][0],a=e.invertY(A[0][1])-t[0][1],c=e.invertY(A[1][1])-t[1][1];return e.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),c>a?(a+c)/2:Math.min(0,a)||Math.max(0,c))}function Dh(){var e=Ih,A=Hh,t=xh,n=_h,o=Sh,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],d=250,h=cr,g=qn("start","zoom","end"),B,w,m,y=500,v=150,I=0,L=10;function k(_){_.property("__zoom",na).on("wheel.zoom",dA,{passive:!1}).on("mousedown.zoom",rA).on("dblclick.zoom",oA).filter(o).on("touchstart.zoom",AA).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",lA).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(_,Z,U,x){var G=_.selection?_.selection():_;G.property("__zoom",na),_!==G?tA(_,Z,U,x):G.interrupt().each(function(){W(this,arguments).event(x).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},k.scaleBy=function(_,Z,U,x){k.scaleTo(_,function(){return this.__zoom.k*(typeof Z=="function"?Z.apply(this,arguments):Z)},U,x)},k.scaleTo=function(_,Z,U,x){k.transform(_,function(){var G=A.apply(this,arguments),R=this.__zoom,$=U==null?M(G):typeof U=="function"?U.apply(this,arguments):U,J=R.invert($),nA=typeof Z=="function"?Z.apply(this,arguments):Z;return t(F(V(R,nA),$,J),G,c)},U,x)},k.translateBy=function(_,Z,U,x){k.transform(_,function(){return t(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof U=="function"?U.apply(this,arguments):U),A.apply(this,arguments),c)},null,x)},k.translateTo=function(_,Z,U,x,G){k.transform(_,function(){var R=A.apply(this,arguments),$=this.__zoom,J=x==null?M(R):typeof x=="function"?x.apply(this,arguments):x;return t(Xt.translate(J[0],J[1]).scale($.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof U=="function"?-U.apply(this,arguments):-U),R,c)},x,G)};function V(_,Z){return Z=Math.max(a[0],Math.min(a[1],Z)),Z===_.k?_:new et(Z,_.x,_.y)}function F(_,Z,U){var x=Z[0]-U[0]*_.k,G=Z[1]-U[1]*_.k;return x===_.x&&G===_.y?_:new et(_.k,x,G)}function M(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function tA(_,Z,U,x){_.on("start.zoom",function(){W(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){W(this,arguments).event(x).end()}).tween("zoom",function(){var G=this,R=arguments,$=W(G,R).event(x),J=A.apply(G,R),nA=U==null?M(J):typeof U=="function"?U.apply(G,R):U,BA=Math.max(J[1][0]-J[0][0],J[1][1]-J[0][1]),UA=G.__zoom,eA=typeof Z=="function"?Z.apply(G,R):Z,uA=h(UA.invert(nA).concat(BA/UA.k),eA.invert(nA).concat(BA/eA.k));return function(Y){if(Y===1)Y=eA;else{var cA=uA(Y),mA=BA/cA[2];Y=new et(mA,nA[0]-cA[0]*mA,nA[1]-cA[1]*mA)}$.zoom(null,Y)}})}function W(_,Z,U){return!U&&_.__zooming||new aA(_,Z)}function aA(_,Z){this.that=_,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=A.apply(_,Z),this.taps=0}aA.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,Z){return this.mouse&&_!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var Z=ke(this.that).datum();g.call(_,this.that,new bh(_,{sourceEvent:this.sourceEvent,target:k,type:_,transform:this.that.__zoom,dispatch:g}),Z)}};function dA(_,...Z){if(!e.apply(this,arguments))return;var U=W(this,Z).event(_),x=this.__zoom,G=Math.max(a[0],Math.min(a[1],x.k*Math.pow(2,n.apply(this,arguments)))),R=Ve(_);if(U.wheel)(U.mouse[0][0]!==R[0]||U.mouse[0][1]!==R[1])&&(U.mouse[1]=x.invert(U.mouse[0]=R)),clearTimeout(U.wheel);else{if(x.k===G)return;U.mouse=[R,x.invert(R)],mr(this),U.start()}Un(_),U.wheel=setTimeout($,v),U.zoom("mouse",t(F(V(x,G),U.mouse[0],U.mouse[1]),U.extent,c));function $(){U.wheel=null,U.end()}}function rA(_,...Z){if(m||!e.apply(this,arguments))return;var U=_.currentTarget,x=W(this,Z,!0).event(_),G=ke(_.view).on("mousemove.zoom",nA,!0).on("mouseup.zoom",BA,!0),R=Ve(_,U),$=_.clientX,J=_.clientY;Is(_.view),Ai(_),x.mouse=[R,this.__zoom.invert(R)],mr(this),x.start();function nA(UA){if(Un(UA),!x.moved){var eA=UA.clientX-$,uA=UA.clientY-J;x.moved=eA*eA+uA*uA>I}x.event(UA).zoom("mouse",t(F(x.that.__zoom,x.mouse[0]=Ve(UA,U),x.mouse[1]),x.extent,c))}function BA(UA){G.on("mousemove.zoom mouseup.zoom",null),Hs(UA.view,x.moved),Un(UA),x.event(UA).end()}}function oA(_,...Z){if(e.apply(this,arguments)){var U=this.__zoom,x=Ve(_.changedTouches?_.changedTouches[0]:_,this),G=U.invert(x),R=U.k*(_.shiftKey?.5:2),$=t(F(V(U,R),x,G),A.apply(this,Z),c);Un(_),d>0?ke(this).transition().duration(d).call(tA,$,x,_):ke(this).call(k.transform,$,x,_)}}function AA(_,...Z){if(e.apply(this,arguments)){var U=_.touches,x=U.length,G=W(this,Z,_.changedTouches.length===x).event(_),R,$,J,nA;for(Ai(_),$=0;$<x;++$)J=U[$],nA=Ve(J,this),nA=[nA,this.__zoom.invert(nA),J.identifier],G.touch0?!G.touch1&&G.touch0[2]!==nA[2]&&(G.touch1=nA,G.taps=0):(G.touch0=nA,R=!0,G.taps=1+!!B);B&&(B=clearTimeout(B)),R&&(G.taps<2&&(w=nA[0],B=setTimeout(function(){B=null},y)),mr(this),G.start())}}function O(_,...Z){if(this.__zooming){var U=W(this,Z).event(_),x=_.changedTouches,G=x.length,R,$,J,nA;for(Un(_),R=0;R<G;++R)$=x[R],J=Ve($,this),U.touch0&&U.touch0[2]===$.identifier?U.touch0[0]=J:U.touch1&&U.touch1[2]===$.identifier&&(U.touch1[0]=J);if($=U.that.__zoom,U.touch1){var BA=U.touch0[0],UA=U.touch0[1],eA=U.touch1[0],uA=U.touch1[1],Y=(Y=eA[0]-BA[0])*Y+(Y=eA[1]-BA[1])*Y,cA=(cA=uA[0]-UA[0])*cA+(cA=uA[1]-UA[1])*cA;$=V($,Math.sqrt(Y/cA)),J=[(BA[0]+eA[0])/2,(BA[1]+eA[1])/2],nA=[(UA[0]+uA[0])/2,(UA[1]+uA[1])/2]}else if(U.touch0)J=U.touch0[0],nA=U.touch0[1];else return;U.zoom("touch",t(F($,J,nA),U.extent,c))}}function lA(_,...Z){if(this.__zooming){var U=W(this,Z).event(_),x=_.changedTouches,G=x.length,R,$;for(Ai(_),m&&clearTimeout(m),m=setTimeout(function(){m=null},y),R=0;R<G;++R)$=x[R],U.touch0&&U.touch0[2]===$.identifier?delete U.touch0:U.touch1&&U.touch1[2]===$.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&($=Ve($,this),Math.hypot(w[0]-$[0],w[1]-$[1])<L)){var J=ke(this).on("dblclick.zoom");J&&J.apply(this,arguments)}}}return k.wheelDelta=function(_){return arguments.length?(n=typeof _=="function"?_:wr(+_),k):n},k.filter=function(_){return arguments.length?(e=typeof _=="function"?_:wr(!!_),k):e},k.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:wr(!!_),k):o},k.extent=function(_){return arguments.length?(A=typeof _=="function"?_:wr([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),k):A},k.scaleExtent=function(_){return arguments.length?(a[0]=+_[0],a[1]=+_[1],k):[a[0],a[1]]},k.translateExtent=function(_){return arguments.length?(c[0][0]=+_[0][0],c[1][0]=+_[1][0],c[0][1]=+_[0][1],c[1][1]=+_[1][1],k):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},k.constrain=function(_){return arguments.length?(t=_,k):t},k.duration=function(_){return arguments.length?(d=+_,k):d},k.interpolate=function(_){return arguments.length?(h=_,k):h},k.on=function(){var _=g.on.apply(g,arguments);return _===g?k:_},k.clickDistance=function(_){return arguments.length?(I=(_=+_)*_,k):Math.sqrt(I)},k.tapDistance=function(_){return arguments.length?(L=+_,k):L},k}var HA=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(HA||{}),ei=(e=>(e.Partial="partial",e.Full="full",e))(ei||{}),St=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(St||{}),tt=(e=>(e.Strict="strict",e.Loose="loose",e))(tt||{}),nt=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(nt||{}),bn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(bn||{}),ra=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(ra||{}),Nh=["INPUT","SELECT","TEXTAREA"],Lh=typeof document<"u"?document:null;function ti(e){var A,t;const n=((t=(A=e.composedPath)==null?void 0:A.call(e))==null?void 0:t[0])||e.target,o=typeof n?.hasAttribute=="function"?n.hasAttribute("contenteditable"):!1,a=typeof n?.closest=="function"?n.closest(".nokey"):null;return Nh.includes(n?.nodeName)||o||!!a}function Th(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function oa(e,A,t,n){const o=A.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 s=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(t.toLowerCase()),s}function od(t,e){return n=>{if(!n.code&&!n.key)return!1;const o=id(n.code,t);return Array.isArray(t)?t.some(i=>Ni(n[o],i,e,n.type==="keyup")):Ni(n[o],t,e,n.type==="keyup")}}function id(t,e){return e.includes(t)?"code":"key"}function zt(t,e){const n=(0,r.computed)(()=>(0,r.toValue)(e?.target)??td),o=(0,r.shallowRef)((0,r.toValue)(t)===!0);let i=!1;const s=new Set;let a=d((0,r.toValue)(t));(0,r.watch)(()=>(0,r.toValue)(t),(c,u)=>{typeof u=="boolean"&&typeof c!="boolean"&&l(),a=d(c)},{immediate:!0}),Bo(["blur","contextmenu"],l),zo((...c)=>a(...c),c=>{var u,h;const f=(0,r.toValue)(e?.actInsideInputWithModifier)??!0,g=(0,r.toValue)(e?.preventDefault)??!1;if(i=nd(c),(!i||i&&!f)&&io(c))return;const p=((h=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:h[0])||c.target,b=p?.nodeName==="BUTTON"||p?.nodeName==="A";!g&&(i||!b)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),zo((...c)=>a(...c),c=>{const u=(0,r.toValue)(e?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!u)&&io(c))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,s.clear(),o.value=(0,r.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"?od(c,s):c}return o}var ki="vue-flow__node-desc",Si="vue-flow__edge-desc",rd="vue-flow__aria-live",Di=["Enter"," ","Escape"],ht={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function ln(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function cn(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 dn(t){return{width:t.offsetWidth,height:t.offsetHeight}}function it(t,e=0,n=1){return Math.min(Math.max(t,e),n)}function Ti(t,e){return{x:it(t.x,e[0][0],e[1][0]),y:it(t.y,e[0][1],e[1][1])}}function Mi(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function Xe(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&&!Xe(t)}function Rt(t){return rt(t)&&"computedPosition"in t}function un(t){return!Number.isNaN(t)&&Number.isFinite(t)}function sd(t){return un(t.width)&&un(t.height)&&un(t.x)&&un(t.y)}function ad(t,e,n){const o={id:t.id.toString(),type:t.type??"default",dimensions:(0,r.markRaw)({width:0,height:0}),computedPosition:(0,r.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:_e(t.data)?t.data:{},events:(0,r.markRaw)(_e(t.events)?t.events:{})};return Object.assign(e??o,t,{id:t.id.toString(),parentNode:n})}function Ii(t,e,n){var o,i;const s={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:_e(t.data)?t.data:{},events:(0,r.markRaw)(_e(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(e??s,t,{id:t.id.toString()})}function Bi(t,e,n,o){const i=typeof t=="string"?t:t.id,s=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&s.add(l[o]);return e.filter(l=>s.has(l.id))}function ld(...t){if(t.length===3){const[i,s,a]=t;return Bi(i,s,a,"target")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Xe(i)&&i.source===o).map(i=>n.find(s=>rt(s)&&s.id===i.target))}function cd(...t){if(t.length===3){const[i,s,a]=t;return Bi(i,s,a,"source")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Xe(i)&&i.target===o).map(i=>n.find(s=>rt(s)&&s.id===i.source))}function zi({source:t,sourceHandle:e,target:n,targetHandle:o}){return`vueflow__edge-${t}${e??""}-${n}${o??""}`}function dd(t,e){return e.some(n=>Xe(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 At({x:t,y:e},{x:n,y:o,zoom:i}){return{x:t*i+n,y:e*i+o}}function $t({x:t,y:e},{x:n,y:o,zoom:i},s=!1,a=[1,1]){const l={x:(t-n)/i,y:(e-o)/i};return s?hn(l,a):l}function ud(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 Ri({x:t,y:e,width:n,height:o}){return{x:t,y:e,x2:t+n,y2:e+o}}function fd({x:t,y:e,x2:n,y2:o}){return{x:t,y:e,width:n-t,height:o-e}}function Ai(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=ud(e,Ri({...o.computedPosition,...o.dimensions}))}return fd(e)}function $i(t,e,n={x:0,y:0,zoom:1},o=!1,i=!1){const s={...$t(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,h=d.width??l.width??null,f=d.height??l.height??null;if(i&&!c||u)continue;const g=cn(s,ln(l)),p=h===null||f===null,b=o&&g>0,S=(h??0)*(f??0);(p||b||g>=S||l.dragging)&&a.push(l)}return a}function Pi(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 gt(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 Ot(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function hd(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=gt(t,n),i=gt(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){const o=gt(t.top??t.y??0,n),i=gt(t.bottom??t.y??0,n),s=gt(t.left??t.x??0,e),a=gt(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:s,x:s+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gd(t,e,n,o,i,s){const{x:a,y:l}=At(t,{x:e,y:n,zoom:o}),{x:d,y:c}=At({x:t.x+t.width,y:t.y+t.height},{x:e,y:n,zoom:o}),u=i-d,h=s-c;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(h)}}function Oi(t,e,n,o,i,s=.1){const a=hd(s,e,n),l=(e-a.x)/t.width,d=(n-a.y)/t.height,c=it(Math.min(l,d),o,i),u=t.x+t.width/2,h=t.y+t.height/2,f=e/2-u*c,g=n/2-h*c,p=gd(t,f,g,c,e,n),b={left:Math.min(p.left-a.left,0),top:Math.min(p.top-a.top,0),right:Math.min(p.right-a.right,0),bottom:Math.min(p.bottom-a.bottom,0)};return{x:f-b.left+b.right,y:g-b.top+b.bottom,zoom:c}}function pd(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function Vi(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return n?n.selected?!0:Vi(n,e):!1}function Pt(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`}function Hi(t){const e=t.ctrlKey&&fn()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function Li(t,e,n){return t<e?it(Math.abs(t-e),1,e)/e:t>n?-it(Math.abs(t-n),1,e)/e:0}function Fi(t,e,n=15,o=40){return[Li(t.x,o,e.width-o)*n,Li(t.y,o,e.height-o)*n]}function ro(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 s=Number(i.width.replace("px",""));i.width=`${s+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+o}px`}else i.height+=o;if(t.position.x<0){const s=Math.abs(t.position.x);if(e.position.x=e.position.x-s,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+s}px`}else i.width+=s;t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);if(e.position.y=e.position.y-s,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+s}px`}else i.height+=s;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=s=>{const a=e.style;return{...a(s),...i}}:e.style={...e.style,...i}}}}function Gi(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 s=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(Rt(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const d=e[s.indexOf(a.parentNode)];d&&Rt(d)&&ro(a,d)}break;case"dimensions":if(Rt(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[s.indexOf(a.parentNode)];d&&Rt(d)&&(d.dimensions.width&&d.dimensions.height?ro(a,d):(0,r.nextTick)(()=>{ro(a,d)}))}break}return e}function je(t,e){return{id:t,type:"select",selected:e}}function Wi(t){return{item:t,type:"add"}}function Ui(t){return{id:t,type:"remove"}}function Yi(t,e,n,o,i){return{id:t,source:e,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function Ze(t,e=new Set,n=!1){const o=[];for(const[i,s]of t){const a=e.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),o.push(je(s.id,a)))}return o}var Xi=()=>{};function oe(t){const e=new Set;let n=Xi,o=()=>!1;const i=()=>e.size>0||o(),s=f=>{n=f},a=()=>{n=Xi},l=f=>{o=f},d=()=>{o=()=>!1},c=f=>{e.delete(f)};return{on:f=>{e.add(f);const g=()=>c(f);return wt(g),{off:g}},off:c,trigger:f=>{const g=[n];return i()?g.push(...e):t&&g.push(t),Promise.allSettled(g.map(p=>p(f)))},hasListeners:i,listeners:e,setEmitter:s,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:d}}function ji(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 md(t,e,n,o){var i,s;const a=new Map;for(const[l,d]of t)(d.selected||d.id===o)&&(!d.parentNode||!Vi(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-((s=d.computedPosition)==null?void 0:s.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 so({id:t,dragItems:e,findNode:n}){const o=[];for(const i of e){const s=n(i.id);s&&o.push(s)}return[t?o.find(i=>i.id===t):o[0],o]}function Zi(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 yd(t,e,n){const[o,i,s,a]=typeof t!="string"?Zi(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-s]]:!1}function vd(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 s=yd(i,t,o);s&&(i=s)}else e(new we(ve.NODE_EXTENT_INVALID,t.id)),i=n;else if(Array.isArray(i)){const s=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+s,i[0][1]+a],[i[1][0]+s,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[s,a,l,d]=Zi(i.padding),c=o?.computedPosition.x||0,u=o?.computedPosition.y||0;i=[[i.range[0][0]+c+d,i.range[0][1]+u+s],[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 _d({width:t,height:e},n){return[n[0],[n[1][0]-(t||0),n[1][1]-(e||0)]]}function ao(t,e,n,o,i){const s=Ti(e,_d(t.dimensions,vd(t,n,o,i)));return{position:{x:s.x-(i?.computedPosition.x||0),y:s.y-(i?.computedPosition.y||0)},computedPosition:s}}function pt(t,e,n=ae.Left,o=!1){const i=(e?.x??0)+t.computedPosition.x,s=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??Ed(t);if(o)return{x:i+a/2,y:s+l/2};switch(e?.position??n){case ae.Top:return{x:i+a/2,y:s};case ae.Right:return{x:i+a,y:s+l/2};case ae.Bottom:return{x:i+a/2,y:s+l};case ae.Left:return{x:i,y:s+l/2}}}function Ki(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function wd({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:s,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+s)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Ri({x:(0-d.x)/d.zoom,y:(0-d.y)/d.zoom,width:a/d.zoom,height:l/d.zoom}),h=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(h*f)>0}function bd(t,e,n=!1){const o=typeof t.zIndex=="number";let i=o?t.zIndex:0;const s=e(t.source),a=e(t.target);return!s||!a?0:(n&&(i=o?t.zIndex:Math.max(s.computedPosition.z||0,a.computedPosition.z||0)),i)}var ve=(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))(ve||{}),qi={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
- Node: ${t}`,NODE_NOT_FOUND:t=>`Node not found
8
- Node: ${t}`,NODE_MISSING_PARENT:(t,e)=>`Node is missing a parent
9
- Node: ${t}
10
- Parent: ${e}`,NODE_TYPE_MISSING:t=>`Node type is missing
11
- Type: ${t}`,NODE_EXTENT_INVALID:t=>`Only child nodes can use a parent extent
12
- Node: ${t}`,EDGE_INVALID:t=>`An edge needs a source and a target
13
- Edge: ${t}`,EDGE_SOURCE_MISSING:(t,e)=>`Edge source is missing
14
- Edge: ${t}
15
- Source: ${e}`,EDGE_TARGET_MISSING:(t,e)=>`Edge target is missing
16
- Edge: ${t}
17
- Target: ${e}`,EDGE_TYPE_MISSING:t=>`Edge type is missing
18
- Type: ${t}`,EDGE_SOURCE_TARGET_SAME:(t,e,n)=>`Edge source and target are the same
19
- Edge: ${t}
20
- Source: ${e}
21
- Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(t,e,n)=>`Edge source or target is missing
22
- Edge: ${t}
23
- Source: ${e}
24
- Target: ${n}`,EDGE_ORPHANED:t=>`Edge was orphaned (suddenly missing source or target) and has been removed
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"},we=class extends Error{constructor(t,...e){var n;super((n=qi[t])==null?void 0:n.call(qi,...e)),this.name="VueFlowError",this.code=t,this.args=e}};function lo(t){return"clientX"in t}function Cd(t){return"sourceEvent"in t}function Ve(t,e){const n=lo(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 fn=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Ed(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 hn(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}var xd=()=>!0;function co(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Nd(t,e,n){const o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())cn(i,ln(s))>0&&o.push(s);return o}var kd=250;function Sd(t,e,n,o){var i,s;let a=[],l=Number.POSITIVE_INFINITY;const d=Nd(t,n,e+kd);for(const c of d){const u=[...((i=c.handleBounds)==null?void 0:i.source)??[],...((s=c.handleBounds)==null?void 0:s.target)??[]];for(const h of u){if(o.nodeId===h.nodeId&&o.type===h.type&&o.id===h.id)continue;const{x:f,y:g}=pt(c,h,h.position,!0),p=Math.sqrt((f-t.x)**2+(g-t.y)**2);p>e||(p<l?(a=[{...h,x:f,y:g}],l=p):p===l&&a.push({...h,x:f,y:g}))}}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 Ji(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:d,isValidConnection:c=xd},u,h,f,g){const p=s==="target",b=e?a.querySelector(`.${l}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:S,y:D}=Ve(t),z=a.elementFromPoint(S,D),v=z?.classList.contains(`${l}-flow__handle`)?z:b,M={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const U=Qi(void 0,v),$=v.getAttribute("data-nodeid"),Q=v.getAttribute("data-handleid"),q=v.classList.contains("connectable"),j=v.classList.contains("connectableend");if(!$||!U)return M;const K={source:p?$:o,sourceHandle:p?Q:i,target:p?o:$,targetHandle:p?i:Q};M.connection=K,M.isValid=q&&j&&(n===We.Strict?p&&U==="source"||!p&&U==="target":$!==o||Q!==i)&&c(K,{nodes:h,edges:u,sourceNode:f(K.source),targetNode:f(K.target)}),M.toHandle=er($,U,Q,g,n,!0)}return M}function Qi(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function Dd(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function Td(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function er(t,e,n,o,i,s=!1){var a,l,d;const c=o.get(t);if(!c)return null;const u=i===We.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)??[]],h=(n?u?.find(f=>f.id===n):u?.[0])??null;return h&&s?{...h,...pt(c,h,h.position,!0)}:h}var uo={[ae.Left]:ae.Right,[ae.Right]:ae.Left,[ae.Top]:ae.Bottom,[ae.Bottom]:ae.Top},Md=["production","prod"];function Ot(t,...e){tr()&&console.warn(`[Vue Flow]: ${t}`,...e)}function tr(){return!Md.includes(process.env.NODE_ENV||"")}function nr(t,e,n,o,i){const s=e.querySelectorAll(`.vue-flow__handle.${t}`);return s?.length?Array.from(s).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,...dn(a)}}):null}function fo(t,e,n,o,i,s=!1,a){i.value=!1,t.selected?(s||t.selected&&e)&&(o([t]),(0,r.nextTick)(()=>{a.blur()})):n([t])}function _e(t){return typeof(0,r.unref)(t)<"u"}function Id(t,e,n,o){if(!t||!t.source||!t.target)return n(new we(ve.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let i;return Xe(t)?i=t:i={...t,id:zi(t)},i=Ii(i,void 0,o),dd(i,e)?!1:i}function Bd(t,e,n,o,i){if(!e.source||!e.target)return i(new we(ve.EDGE_INVALID,t.id)),!1;if(!n)return i(new we(ve.EDGE_NOT_FOUND,t.id)),!1;const{id:s,...a}=t;return{...a,id:o?zi(e):s,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function or(t,e,n){const o={},i=[];for(let s=0;s<t.length;++s){const a=t[s];if(!rt(a)){n(new we(ve.NODE_INVALID,a?.id));continue}const l=ad(a,e(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[s]=l}for(const s of i){const a=e(s.parentNode)||i.find(l=>l.id===s.parentNode);s.parentNode&&!a&&n(new we(ve.NODE_MISSING_PARENT,s.id,s.parentNode)),(s.parentNode||o[s.id])&&(o[s.id]&&(s.isParent=!0),a&&(a.isParent=!0))}return i}function ir(t,e,n,o,i,s){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)),s){a=`${i}-${t}-${s}`;const c=o.get(a)||new Map;o.set(a,c.set(n,e))}}function ho(t,e,n){t.clear();for(const o of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=o,d={edgeId:o.id,source:i,target:s,sourceHandle:a,targetHandle:l},c=`${i}-${a}--${s}-${l}`;ir("source",d,`${s}-${l}--${i}-${a}`,t,i,a),ir("target",d,c,t,s,l)}}function rr(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function go(t,e,n,o,i,s,a,l){const d=[];for(const c of t){const u=Xe(c)?c:Id(c,l,i,s);if(!u)continue;const h=n(u.source),f=n(u.target);if(!h||!f){i(new we(ve.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!h){i(new we(ve.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!f){i(new we(ve.EDGE_TARGET_MISSING,u.id,u.target));continue}if(e&&!e(u,{edges:l,nodes:a,sourceNode:h,targetNode:f})){i(new we(ve.EDGE_INVALID,u.id));continue}const g=o(u.id);d.push({...Ii(u,g,s),sourceNode:h,targetNode:f})}return d}var sr=Symbol("vueFlow"),ar=Symbol("nodeId"),lr=Symbol("nodeRef"),zd=Symbol("edgeId"),Rd=Symbol("edgeRef"),gn=Symbol("slots");function cr(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:s,nodeExtent:a,nodeDragThreshold:l,viewport:d,autoPanOnNodeDrag:c,autoPanSpeed:u,nodesDraggable:h,panBy:f,findNode:g,multiSelectionActive:p,nodesSelectionActive:b,selectNodesOnDrag:S,removeSelectedElements:D,addSelectedNodes:z,updateNodePositions:v,emits:M}=ge(),{onStart:U,onDrag:$,onStop:Q,onClick:q,el:j,disabled:K,id:G,selectable:k,dragHandle:Y}=t,w=(0,r.shallowRef)(!1);let V=[],m,E=null,B={x:void 0,y:void 0},T={x:0,y:0},A=null,H=!1,F=!1,te=0,se=!1;const L=Pd(),Z=({x:ee,y:re})=>{B={x:ee,y:re};let C=!1;if(V=V.map(_=>{const N={x:ee-_.distance.x,y:re-_.distance.y},{computedPosition:x}=ao(_,n.value?hn(N,o.value):N,M.error,a.value,_.parentNode?g(_.parentNode):void 0);return C=C||_.position.x!==x.x||_.position.y!==x.y,_.position=x,_}),F=F||C,!!C&&(v(V,!0,!0),w.value=!0,A)){const[_,N]=so({id:G,dragItems:V,findNode:g});$({event:A,node:_,nodes:N})}},P=()=>{if(!E)return;const[ee,re]=Fi(T,E,u.value);if(ee!==0||re!==0){const C={x:(B.x??0)-ee/d.value.zoom,y:(B.y??0)-re/d.value.zoom};f({x:ee,y:re})&&Z(C)}te=requestAnimationFrame(P)},X=(ee,re)=>{H=!0;const C=g(G);!S.value&&!p.value&&C&&(C.selected||D()),C&&(0,r.toValue)(k)&&S.value&&fo(C,p.value,z,D,b,!1,re);const _=L(ee.sourceEvent);if(B=_,V=md(s.value,h.value,_,G),V.length){const[N,x]=so({id:G,dragItems:V,findNode:g});U({event:ee.sourceEvent,node:N,nodes:x})}},ne=(ee,re)=>{var C;ee.sourceEvent.type==="touchmove"&&ee.sourceEvent.touches.length>1||(F=!1,l.value===0&&X(ee,re),B=L(ee.sourceEvent),E=((C=e.value)==null?void 0:C.getBoundingClientRect())||null,T=Ve(ee.sourceEvent,E))},ie=(ee,re)=>{const C=L(ee.sourceEvent);if(!se&&H&&c.value&&(se=!0,P()),!H){const _=C.xSnapped-(B.x??0),N=C.ySnapped-(B.y??0);Math.sqrt(_*_+N*N)>l.value&&X(ee,re)}(B.x!==C.xSnapped||B.y!==C.ySnapped)&&V.length&&H&&(A=ee.sourceEvent,T=Ve(ee.sourceEvent,E),Z(C))},le=ee=>{let re=!1;if(!H&&!w.value&&!p.value){const C=ee.sourceEvent,_=L(C),N=_.xSnapped-(B.x??0),x=_.ySnapped-(B.y??0),y=Math.sqrt(N*N+x*x);y!==0&&y<=l.value&&(q?.(C),re=!0)}if(V.length&&!re){F&&(v(V,!1,!1),F=!1);const[C,_]=so({id:G,dragItems:V,findNode:g});Q({event:ee.sourceEvent,node:C,nodes:_})}V=[],w.value=!1,se=!1,H=!1,B={x:void 0,y:void 0},cancelAnimationFrame(te)};return(0,r.watch)([()=>(0,r.toValue)(K),j],([ee,re],C,_)=>{if(re){const N=Ie(re);ee||(m=sl().on("start",x=>ne(x,re)).on("drag",x=>ie(x,re)).on("end",x=>le(x)).filter(x=>{const y=x.target,R=(0,r.toValue)(Y);return!x.button&&(!i.value||!ji(y,`.${i.value}`,re)&&(!R||ji(y,R,re)))}),N.call(m)),_(()=>{N.on(".drag",null),m&&(m.on("start",null),m.on("drag",null),m.on("end",null))})}}),w}function Ad(){return{doubleClick:oe(),click:oe(),mouseEnter:oe(),mouseMove:oe(),mouseLeave:oe(),contextMenu:oe(),updateStart:oe(),update:oe(),updateEnd:oe()}}function $d(t,e){const n=Ad();return n.doubleClick.on(o=>{var i,s;e.edgeDoubleClick(o),(s=(i=t.events)==null?void 0:i.doubleClick)==null||s.call(i,o)}),n.click.on(o=>{var i,s;e.edgeClick(o),(s=(i=t.events)==null?void 0:i.click)==null||s.call(i,o)}),n.mouseEnter.on(o=>{var i,s;e.edgeMouseEnter(o),(s=(i=t.events)==null?void 0:i.mouseEnter)==null||s.call(i,o)}),n.mouseMove.on(o=>{var i,s;e.edgeMouseMove(o),(s=(i=t.events)==null?void 0:i.mouseMove)==null||s.call(i,o)}),n.mouseLeave.on(o=>{var i,s;e.edgeMouseLeave(o),(s=(i=t.events)==null?void 0:i.mouseLeave)==null||s.call(i,o)}),n.contextMenu.on(o=>{var i,s;e.edgeContextMenu(o),(s=(i=t.events)==null?void 0:i.contextMenu)==null||s.call(i,o)}),n.updateStart.on(o=>{var i,s;e.edgeUpdateStart(o),(s=(i=t.events)==null?void 0:i.updateStart)==null||s.call(i,o)}),n.update.on(o=>{var i,s;e.edgeUpdate(o),(s=(i=t.events)==null?void 0:i.update)==null||s.call(i,o)}),n.updateEnd.on(o=>{var i,s;e.edgeUpdateEnd(o),(s=(i=t.events)==null?void 0:i.updateEnd)==null||s.call(i,o)}),Object.entries(n).reduce((o,[i,s])=>(o.emit[i]=s.trigger,o.on[i]=s.on,o),{emit:{},on:{}})}function Pd(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:o}=ge();return i=>{var s;const a=((s=o.value)==null?void 0:s.getBoundingClientRect())??{left:0,top:0},{x:l,y:d}=Ve(Cd(i)?i.sourceEvent:i,a),c=$t({x:l,y:d},t.value),{x:u,y:h}=n.value?hn(c,e.value):c;return{xSnapped:u,ySnapped:h,...c}}}function pn(){return!0}function dr({handleId:t,nodeId:e,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:s,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:d,connectionMode:c,connectionRadius:u,connectOnClick:h,connectionClickStartHandle:f,nodesConnectable:g,autoPanOnConnect:p,autoPanSpeed:b,findNode:S,panBy:D,startConnection:z,updateConnection:v,endConnection:M,emits:U,viewport:$,edges:Q,nodes:q,isValidConnection:j,nodeLookup:K}=ge();let G=null,k=!1,Y=null;function w(m){var E;const B=(0,r.toValue)(n)==="target",T=lo(m),A=Mi(m.target),H=m.currentTarget;if(H&&(T&&m.button===0||!T)){let F=function(J){C=Ve(J,le),Z=Sd($t(C,$.value,!1,[1,1]),u.value,K.value,x),_||(N(),_=!0);const W=Ji(J,{handle:Z,connectionMode:c.value,fromNodeId:(0,r.toValue)(e),fromHandleId:(0,r.toValue)(t),fromType:B?"target":"source",isValidConnection:L,doc:A,lib:"vue",flowId:l,nodeLookup:K.value},Q.value,q.value,S,K.value);Y=W.handleDomNode,G=W.connection,k=Td(!!Z,W.isValid);const ce={...I,isValid:k,to:W.toHandle&&k?At({x:W.toHandle.x,y:W.toHandle.y},$.value):C,toHandle:W.toHandle,toPosition:k&&W.toHandle?W.toHandle.position:uo[x.position],toNode:W.toHandle?K.value.get(W.toHandle.nodeId):null};if(k&&Z&&I?.toHandle&&ce.toHandle&&I.toHandle.type===ce.toHandle.type&&I.toHandle.nodeId===ce.toHandle.nodeId&&I.toHandle.id===ce.toHandle.id&&I.to.x===ce.to.x&&I.to.y===ce.to.y)return;const fe=Z??W.toHandle;if(v(fe&&k?At({x:fe.x,y:fe.y},$.value):C,fe,Dd(!!fe,k)),I=ce,!Z&&!k&&!Y)return co(re);G&&G.source!==G.target&&Y&&(co(re),re=Y,Y.classList.add("connecting","vue-flow__handle-connecting"),Y.classList.toggle("valid",!!k),Y.classList.toggle("vue-flow__handle-valid",!!k))},te=function(J){"touches"in J&&J.touches.length>0||((Z||Y)&&G&&k&&(s?s(J,G):U.connect(G)),U.connectEnd(J),i&&a?.(J),co(re),cancelAnimationFrame(P),M(J),_=!1,k=!1,G=null,Y=null,A.removeEventListener("mousemove",F),A.removeEventListener("mouseup",te),A.removeEventListener("touchmove",F),A.removeEventListener("touchend",te))};const se=S((0,r.toValue)(e));let L=(0,r.toValue)(o)||j.value||pn;!L&&se&&(L=(B?se.isValidSourcePos:se.isValidTargetPos)||pn);let Z,P=0;const{x:X,y:ne}=Ve(m),ie=Qi((0,r.toValue)(i),H),le=(E=d.value)==null?void 0:E.getBoundingClientRect();if(!le||!ie)return;const ee=er((0,r.toValue)(e),ie,(0,r.toValue)(t),K.value,c.value);if(!ee)return;let re,C=Ve(m,le),_=!1;const N=()=>{if(!p.value)return;const[J,W]=Fi(C,le,b.value);D({x:J,y:W}),P=requestAnimationFrame(N)},x={...ee,nodeId:(0,r.toValue)(e),type:ie,position:ee.position},y=K.value.get((0,r.toValue)(e)),R={inProgress:!0,isValid:null,from:pt(y,x,ae.Left,!0),fromHandle:x,fromPosition:x.position,fromNode:y,to:C,toHandle:null,toPosition:uo[x.position],toNode:null};z({nodeId:(0,r.toValue)(e),id:(0,r.toValue)(t),type:ie,position:H?.getAttribute("data-handlepos")||ae.Top,...C},{x:X-le.left,y:ne-le.top}),U.connectStart({event:m,nodeId:(0,r.toValue)(e),handleId:(0,r.toValue)(t),handleType:ie});let I=R;A.addEventListener("mousemove",F),A.addEventListener("mouseup",te),A.addEventListener("touchmove",F),A.addEventListener("touchend",te)}}function V(m){var E,B;if(!h.value)return;const T=(0,r.toValue)(n)==="target";if(!f.value){U.clickConnectStart({event:m,nodeId:(0,r.toValue)(e),handleId:(0,r.toValue)(t)}),z({nodeId:(0,r.toValue)(e),type:(0,r.toValue)(n),id:(0,r.toValue)(t),position:ae.Top,...Ve(m)},void 0,!0);return}let A=(0,r.toValue)(o)||j.value||pn;const H=S((0,r.toValue)(e));if(!A&&H&&(A=(T?H.isValidSourcePos:H.isValidTargetPos)||pn),H&&(typeof H.connectable>"u"?g.value:H.connectable)===!1)return;const F=Mi(m.target),te=Ji(m,{handle:{nodeId:(0,r.toValue)(e),id:(0,r.toValue)(t),type:(0,r.toValue)(n),position:ae.Top,...Ve(m)},connectionMode:c.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:A,doc:F,lib:"vue",flowId:l,nodeLookup:K.value},Q.value,q.value,S,K.value),se=((E=te.connection)==null?void 0:E.source)===((B=te.connection)==null?void 0:B.target);te.isValid&&te.connection&&!se&&U.connect(te.connection),U.clickConnectEnd(m),M(m,!0)}return{handlePointerDown:w,handleClick:V}}function Od(){return(0,r.inject)(ar,"")}function ur(t){const e=t??Od()??"",n=(0,r.inject)(lr,(0,r.ref)(null)),{findNode:o,edges:i,emits:s}=ge(),a=o(e);return a||s.error(new we(ve.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:a,parentNode:(0,r.computed)(()=>o(a.parentNode)),connectedEdges:(0,r.computed)(()=>Pi([a],i.value))}}function Vd(){return{doubleClick:oe(),click:oe(),mouseEnter:oe(),mouseMove:oe(),mouseLeave:oe(),contextMenu:oe(),dragStart:oe(),drag:oe(),dragStop:oe()}}function Hd(t,e){const n=Vd();return n.doubleClick.on(o=>{var i,s;e.nodeDoubleClick(o),(s=(i=t.events)==null?void 0:i.doubleClick)==null||s.call(i,o)}),n.click.on(o=>{var i,s;e.nodeClick(o),(s=(i=t.events)==null?void 0:i.click)==null||s.call(i,o)}),n.mouseEnter.on(o=>{var i,s;e.nodeMouseEnter(o),(s=(i=t.events)==null?void 0:i.mouseEnter)==null||s.call(i,o)}),n.mouseMove.on(o=>{var i,s;e.nodeMouseMove(o),(s=(i=t.events)==null?void 0:i.mouseMove)==null||s.call(i,o)}),n.mouseLeave.on(o=>{var i,s;e.nodeMouseLeave(o),(s=(i=t.events)==null?void 0:i.mouseLeave)==null||s.call(i,o)}),n.contextMenu.on(o=>{var i,s;e.nodeContextMenu(o),(s=(i=t.events)==null?void 0:i.contextMenu)==null||s.call(i,o)}),n.dragStart.on(o=>{var i,s;e.nodeDragStart(o),(s=(i=t.events)==null?void 0:i.dragStart)==null||s.call(i,o)}),n.drag.on(o=>{var i,s;e.nodeDrag(o),(s=(i=t.events)==null?void 0:i.drag)==null||s.call(i,o)}),n.dragStop.on(o=>{var i,s;e.nodeDragStop(o),(s=(i=t.events)==null?void 0:i.dragStop)==null||s.call(i,o)}),Object.entries(n).reduce((o,[i,s])=>(o.emit[i]=s.trigger,o.on[i]=s.on,o),{emit:{},on:{}})}function fr(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:s,nodesDraggable:a,emits:l}=ge();return(d,c=!1)=>{const u=s.value?i.value[0]:5,h=s.value?i.value[1]:5,f=c?4:1,g=d.x*u*f,p=d.y*h*f,b=[];for(const S of t.value)if(S.draggable||a&&typeof S.draggable>"u"){const{position:D}=ao(S,{x:S.computedPosition.x+g,y:S.computedPosition.y+p},l.error,e.value,S.parentNode?o(S.parentNode):void 0);b.push({id:S.id,position:D,from:S.position,distance:{x:d.x,y:d.y},dimensions:S.dimensions})}n(b,!0,!1)}}var mn=.1,Ld=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function Ke(){return Ot("Viewport not initialized yet."),Promise.resolve(!1)}var Fd={zoomIn:Ke,zoomOut:Ke,zoomTo:Ke,fitView:Ke,setCenter:Ke,fitBounds:Ke,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:Ke,setTransform:Ke,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Gd(t){function e(o,i){return new Promise(s=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?kt:qt).scaleBy(po(t.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),o):s(!1)})}function n(o,i,s,a){return new Promise(l=>{var d;const{x:c,y:u}=Ti({x:-o,y:-i},t.translateExtent),h=ft.translate(-c,-u).scale(s);t.d3Selection&&t.d3Zoom?(d=t.d3Zoom)==null||d.interpolate(a?.interpolate==="linear"?kt:qt).transform(po(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),h):l(!1)})}return(0,r.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(s=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?kt:qt).scaleTo(po(t.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),o):s(!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:mn,includeHiddenNodes:!1,duration:0})=>{var i,s;const a=[];for(const u of t.nodes)u.dimensions.width&&u.dimensions.height&&(o?.includeHiddenNodes||!u.hidden)&&(!((i=o.nodes)!=null&&i.length)||(s=o.nodes)!=null&&s.length&&o.nodes.includes(u.id))&&a.push(u);if(!a.length)return Promise.resolve(!1);const{x:l,y:d,zoom:c}=Oi(Ai(a),t.dimensions.width,t.dimensions.height,o.minZoom??t.minZoom,o.maxZoom??t.maxZoom,o.padding??mn);return n(l,d,c,o)},setCenter:(o,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:t.maxZoom;return n(t.dimensions.width/2-o*a,t.dimensions.height/2-i*a,a,s)},fitBounds:(o,i={padding:mn})=>{const{x:s,y:a,zoom:l}=Oi(o,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,i.padding??mn);return n(s,a,l,i)},project:o=>$t(o,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:s}=t.vueFlowRef.getBoundingClientRect();return $t({x:o.x-i,y:o.y-s},t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:s}=t.vueFlowRef.getBoundingClientRect();return At({x:o.x+i,y:o.y+s},t.viewport)}return{x:0,y:0}}}:Fd)}function po(t,e=0,n=Ld,o=()=>{}){const i=typeof e=="number"&&e>0;return i||o(),i?t.transition().duration(e).ease(n).on("end",o):t}function Wd(t,e,n){const o=(0,r.effectScope)(!0);return o.run(()=>{const i=()=>{o.run(()=>{let b,S,D=!!(n.nodes.value.length||n.edges.value.length);b=at([t.modelValue,()=>{var z,v;return(v=(z=t.modelValue)==null?void 0:z.value)==null?void 0:v.length}],([z])=>{z&&Array.isArray(z)&&(S?.pause(),n.setElements(z),!S&&!D&&z.length?D=!0:S?.resume())}),S=at([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([z,v])=>{var M;(M=t.modelValue)!=null&&M.value&&Array.isArray(t.modelValue.value)&&(b?.pause(),t.modelValue.value=[...z,...v],(0,r.nextTick)(()=>{b?.resume()}))},{immediate:D}),(0,r.onScopeDispose)(()=>{b?.stop(),S?.stop()})})},s=()=>{o.run(()=>{let b,S,D=!!n.nodes.value.length;b=at([t.nodes,()=>{var z,v;return(v=(z=t.nodes)==null?void 0:z.value)==null?void 0:v.length}],([z])=>{z&&Array.isArray(z)&&(S?.pause(),n.setNodes(z),!S&&!D&&z.length?D=!0:S?.resume())}),S=at([n.nodes,()=>n.nodes.value.length],([z])=>{var v;(v=t.nodes)!=null&&v.value&&Array.isArray(t.nodes.value)&&(b?.pause(),t.nodes.value=[...z],(0,r.nextTick)(()=>{b?.resume()}))},{immediate:D}),(0,r.onScopeDispose)(()=>{b?.stop(),S?.stop()})})},a=()=>{o.run(()=>{let b,S,D=!!n.edges.value.length;b=at([t.edges,()=>{var z,v;return(v=(z=t.edges)==null?void 0:z.value)==null?void 0:v.length}],([z])=>{z&&Array.isArray(z)&&(S?.pause(),n.setEdges(z),!S&&!D&&z.length?D=!0:S?.resume())}),S=at([n.edges,()=>n.edges.value.length],([z])=>{var v;(v=t.edges)!=null&&v.value&&Array.isArray(t.edges.value)&&(b?.pause(),t.edges.value=[...z],(0,r.nextTick)(()=>{b?.resume()}))},{immediate:D}),(0,r.onScopeDispose)(()=>{b?.stop(),S?.stop()})})},l=()=>{o.run(()=>{(0,r.watch)(()=>e.maxZoom,()=>{e.maxZoom&&_e(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},d=()=>{o.run(()=>{(0,r.watch)(()=>e.minZoom,()=>{e.minZoom&&_e(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{(0,r.watch)(()=>e.translateExtent,()=>{e.translateExtent&&_e(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{(0,r.watch)(()=>e.nodeExtent,()=>{e.nodeExtent&&_e(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},h=()=>{o.run(()=>{(0,r.watch)(()=>e.applyDefault,()=>{_e(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},f=()=>{o.run(()=>{const b=async S=>{let D=S;typeof e.autoConnect=="function"&&(D=await e.autoConnect(S)),D!==!1&&n.addEdges([D])};(0,r.watch)(()=>e.autoConnect,()=>{_e(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),(0,r.watch)(n.autoConnect,(S,D,z)=>{S?n.onConnect(b):n.hooks.value.connect.off(b),z(()=>{n.hooks.value.connect.off(b)})},{immediate:!0})})},g=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const S of Object.keys(e)){const D=S;if(!b.includes(D)){const z=(0,r.toRef)(()=>e[D]),v=n[D];(0,r.isRef)(v)&&o.run(()=>{(0,r.watch)(z,M=>{_e(M)&&(v.value=M)},{immediate:!0})})}}};i(),s(),a(),d(),l(),c(),u(),h(),f(),g()}),()=>o.stop()}function Ud(){return{edgesChange:oe(),nodesChange:oe(),nodeDoubleClick:oe(),nodeClick:oe(),nodeMouseEnter:oe(),nodeMouseMove:oe(),nodeMouseLeave:oe(),nodeContextMenu:oe(),nodeDragStart:oe(),nodeDrag:oe(),nodeDragStop:oe(),nodesInitialized:oe(),miniMapNodeClick:oe(),miniMapNodeDoubleClick:oe(),miniMapNodeMouseEnter:oe(),miniMapNodeMouseMove:oe(),miniMapNodeMouseLeave:oe(),connect:oe(),connectStart:oe(),connectEnd:oe(),clickConnectStart:oe(),clickConnectEnd:oe(),paneReady:oe(),init:oe(),move:oe(),moveStart:oe(),moveEnd:oe(),selectionDragStart:oe(),selectionDrag:oe(),selectionDragStop:oe(),selectionContextMenu:oe(),selectionStart:oe(),selectionEnd:oe(),viewportChangeStart:oe(),viewportChange:oe(),viewportChangeEnd:oe(),paneScroll:oe(),paneClick:oe(),paneContextMenu:oe(),paneMouseEnter:oe(),paneMouseMove:oe(),paneMouseLeave:oe(),edgeContextMenu:oe(),edgeMouseEnter:oe(),edgeMouseMove:oe(),edgeMouseLeave:oe(),edgeDoubleClick:oe(),edgeClick:oe(),edgeUpdateStart:oe(),edgeUpdate:oe(),edgeUpdateEnd:oe(),updateNodeInternals:oe(),error:oe(t=>Ot(t.message))}}function Yd(t,e){const n=(0,r.getCurrentInstance)();(0,r.onBeforeMount)(()=>{for(const[i,s]of Object.entries(e.value)){const a=l=>{t(i,l)};s.setEmitter(a),wt(s.removeEmitter),s.setHasEmitListeners(()=>o(i)),wt(s.removeHasEmitListeners)}});function o(i){var s;const a=Xd(i);return!!((s=n?.vnode.props)!=null&&s[a])}}function Xd(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(o,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function hr(){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:oo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Bt.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:We.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:fn()?"Meta":"Control",zoomActivationKeyCode:fn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Ud(),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 jd=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Zd(t,e,n){const o=Gd(t),i=C=>{const _=C??[];t.hooks.updateNodeInternals.trigger(_)},s=C=>cd(C,t.nodes,t.edges),a=C=>ld(C,t.nodes,t.edges),l=C=>Pi(C,t.edges),d=({id:C,type:_,nodeId:N})=>{var x;const y=C?`-${_}-${C}`:`-${_}`;return Array.from(((x=t.connectionLookup.get(`${N}${y}`))==null?void 0:x.values())??[])},c=C=>{if(C)return e.value.get(C)},u=C=>{if(C)return n.value.get(C)},h=(C,_,N)=>{var x,y;const R=[];for(const I of C){const J={id:I.id,type:"position",dragging:N,from:I.from};if(_&&(J.position=I.position,I.parentNode)){const W=c(I.parentNode);J.position={x:J.position.x-(((x=W?.computedPosition)==null?void 0:x.x)??0),y:J.position.y-(((y=W?.computedPosition)==null?void 0:y.y)??0)}}R.push(J)}R?.length&&t.hooks.nodesChange.trigger(R)},f=C=>{if(!t.vueFlowRef)return;const _=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!_)return;const N=window.getComputedStyle(_),{m22:x}=new window.DOMMatrixReadOnly(N.transform),y=[];for(const R of C){const I=R,J=c(I.id);if(J){const W=dn(I.nodeElement);if(W.width&&W.height&&(J.dimensions.width!==W.width||J.dimensions.height!==W.height||I.forceUpdate)){const ce=I.nodeElement.getBoundingClientRect();J.dimensions=W,J.handleBounds.source=nr("source",I.nodeElement,ce,x,J.id),J.handleBounds.target=nr("target",I.nodeElement,ce,x,J.id),y.push({id:J.id,type:"dimensions",dimensions:W})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&o.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),y.length&&t.hooks.nodesChange.trigger(y)},g=(C,_)=>{const N=new Set,x=new Set;for(const I of C)rt(I)?N.add(I.id):Xe(I)&&x.add(I.id);const y=Ze(e.value,N,!0),R=Ze(n.value,x);if(t.multiSelectionActive){for(const I of N)y.push(je(I,_));for(const I of x)R.push(je(I,_))}y.length&&t.hooks.nodesChange.trigger(y),R.length&&t.hooks.edgesChange.trigger(R)},p=C=>{if(t.multiSelectionActive){const _=C.map(N=>je(N.id,!0));t.hooks.nodesChange.trigger(_);return}t.hooks.nodesChange.trigger(Ze(e.value,new Set(C.map(_=>_.id)),!0)),t.hooks.edgesChange.trigger(Ze(n.value))},b=C=>{if(t.multiSelectionActive){const _=C.map(N=>je(N.id,!0));t.hooks.edgesChange.trigger(_);return}t.hooks.edgesChange.trigger(Ze(n.value,new Set(C.map(_=>_.id)))),t.hooks.nodesChange.trigger(Ze(e.value,new Set,!0))},S=C=>{g(C,!0)},D=C=>{const _=(C||t.nodes).map(N=>(N.selected=!1,je(N.id,!1)));t.hooks.nodesChange.trigger(_)},z=C=>{const _=(C||t.edges).map(N=>(N.selected=!1,je(N.id,!1)));t.hooks.edgesChange.trigger(_)},v=C=>{if(!C||!C.length)return g([],!1);const _=C.reduce((N,x)=>{const y=je(x.id,!1);return rt(x)?N.nodes.push(y):N.edges.push(y),N},{nodes:[],edges:[]});_.nodes.length&&t.hooks.nodesChange.trigger(_.nodes),_.edges.length&&t.hooks.edgesChange.trigger(_.edges)},M=C=>{var _;(_=t.d3Zoom)==null||_.scaleExtent([C,t.maxZoom]),t.minZoom=C},U=C=>{var _;(_=t.d3Zoom)==null||_.scaleExtent([t.minZoom,C]),t.maxZoom=C},$=C=>{var _;(_=t.d3Zoom)==null||_.translateExtent(C),t.translateExtent=C},Q=C=>{t.nodeExtent=C,i()},q=C=>{var _;(_=t.d3Zoom)==null||_.clickDistance(C)},j=C=>{t.nodesDraggable=C,t.nodesConnectable=C,t.elementsSelectable=C},K=C=>{const _=C instanceof Function?C(t.nodes):C;!t.initialized&&!_.length||(t.nodes=or(_,c,t.hooks.error.trigger))},G=C=>{const _=C instanceof Function?C(t.edges):C;if(!t.initialized&&!_.length)return;const N=go(_,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);ho(t.connectionLookup,n.value,N),t.edges=N},k=C=>{const _=C instanceof Function?C([...t.nodes,...t.edges]):C;!t.initialized&&!_.length||(K(_.filter(rt)),G(_.filter(Xe)))},Y=C=>{let _=C instanceof Function?C(t.nodes):C;_=Array.isArray(_)?_:[_];const N=or(_,c,t.hooks.error.trigger),x=[];for(const y of N)x.push(Wi(y));x.length&&t.hooks.nodesChange.trigger(x)},w=C=>{let _=C instanceof Function?C(t.edges):C;_=Array.isArray(_)?_:[_];const N=go(_,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),x=[];for(const y of N)x.push(Wi(y));x.length&&t.hooks.edgesChange.trigger(x)},V=(C,_=!0,N=!1)=>{const x=C instanceof Function?C(t.nodes):C,y=Array.isArray(x)?x:[x],R=[],I=[];function J(ce){const fe=l(ce);for(const he of fe)(!_e(he.deletable)||he.deletable)&&I.push(Yi(he.id,he.source,he.target,he.sourceHandle,he.targetHandle))}function W(ce){const fe=[];for(const he of t.nodes)he.parentNode===ce&&fe.push(he);if(fe.length){for(const he of fe)R.push(Ui(he.id));_&&J(fe);for(const he of fe)W(he.id)}}for(const ce of y){const fe=typeof ce=="string"?c(ce):ce;fe&&(_e(fe.deletable)&&!fe.deletable||(R.push(Ui(fe.id)),_&&J([fe]),N&&W(fe.id)))}I.length&&t.hooks.edgesChange.trigger(I),R.length&&t.hooks.nodesChange.trigger(R)},m=C=>{const _=C instanceof Function?C(t.edges):C,N=Array.isArray(_)?_:[_],x=[];for(const y of N){const R=typeof y=="string"?u(y):y;R&&(_e(R.deletable)&&!R.deletable||x.push(Yi(typeof y=="string"?y:y.id,R.source,R.target,R.sourceHandle,R.targetHandle)))}t.hooks.edgesChange.trigger(x)},E=(C,_,N=!0)=>{const x=u(C.id);if(!x)return!1;const y=t.edges.indexOf(x),R=Bd(C,_,x,N,t.hooks.error.trigger);if(R){const[I]=go([R],t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((J,W)=>W===y?I:J),ho(t.connectionLookup,n.value,[I]),I}return!1},B=(C,_,N={replace:!1})=>{const x=u(C);if(!x)return;const y=typeof _=="function"?_(x):_;x.data=N.replace?y:{...x.data,...y}},T=C=>Gi(C,t.nodes),A=C=>{const _=Gi(C,t.edges);return ho(t.connectionLookup,n.value,_),_},H=(C,_,N={replace:!1})=>{const x=c(C);if(!x)return;const y=typeof _=="function"?_(x):_;N.replace?t.nodes.splice(t.nodes.indexOf(x),1,y):Object.assign(x,y)},F=(C,_,N={replace:!1})=>{const x=c(C);if(!x)return;const y=typeof _=="function"?_(x):_;x.data=N.replace?y:{...x.data,...y}},te=(C,_,N=!1)=>{N?t.connectionClickStartHandle=C:t.connectionStartHandle=C,t.connectionEndHandle=null,t.connectionStatus=null,_&&(t.connectionPosition=_)},se=(C,_=null,N=null)=>{t.connectionStartHandle&&(t.connectionPosition=C,t.connectionEndHandle=_,t.connectionStatus=N)},L=(C,_)=>{t.connectionPosition={x:NaN,y:NaN},t.connectionEndHandle=null,t.connectionStatus=null,_?t.connectionClickStartHandle=null:t.connectionStartHandle=null},Z=C=>{const _=sd(C),N=_?null:Rt(C)?C:c(C.id);return!_&&!N?[null,null,_]:[_?C:ln(N),N,_]},P=(C,_=!0,N=t.nodes)=>{const[x,y,R]=Z(C);if(!x)return[];const I=[];for(const J of N||t.nodes){if(!R&&(J.id===y.id||!J.computedPosition))continue;const W=ln(J),ce=cn(W,x);(_&&ce>0||ce>=W.width*W.height||ce>=Number(x.width)*Number(x.height))&&I.push(J)}return I},X=(C,_,N=!0)=>{const[x]=Z(C);if(!x)return!1;const y=cn(x,_);return N&&y>0||y>=Number(x.width)*Number(x.height)},ne=C=>{const{viewport:_,dimensions:N,d3Zoom:x,d3Selection:y,translateExtent:R}=t;if(!x||!y||!C.x&&!C.y)return!1;const I=ft.translate(_.x+C.x,_.y+C.y).scale(_.zoom),J=[[0,0],[N.width,N.height]],W=x.constrain()(I,J,R),ce=t.viewport.x!==W.x||t.viewport.y!==W.y||t.viewport.zoom!==W.k;return x.transform(y,W),ce},ie=C=>{const _=C instanceof Function?C(t):C,N=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];_e(_.defaultEdgeOptions)&&(t.defaultEdgeOptions=_.defaultEdgeOptions);const x=_.modelValue||_.nodes||_.edges?[]:void 0;x&&(_.modelValue&&x.push(..._.modelValue),_.nodes&&x.push(..._.nodes),_.edges&&x.push(..._.edges),k(x));const y=()=>{_e(_.maxZoom)&&U(_.maxZoom),_e(_.minZoom)&&M(_.minZoom),_e(_.translateExtent)&&$(_.translateExtent)};for(const R of Object.keys(_)){const I=R,J=_[I];![...jd,...N].includes(I)&&_e(J)&&(t[I]=J)}$n(()=>t.d3Zoom).not.toBeNull().then(y),t.initialized||(t.initialized=!0)};return{updateNodePositions:h,updateNodeDimensions:f,setElements:k,setNodes:K,setEdges:G,addNodes:Y,addEdges:w,removeNodes:V,removeEdges:m,findNode:c,findEdge:u,updateEdge:E,updateEdgeData:B,updateNode:H,updateNodeData:F,applyEdgeChanges:A,applyNodeChanges:T,addSelectedElements:S,addSelectedNodes:p,addSelectedEdges:b,setMinZoom:M,setMaxZoom:U,setTranslateExtent:$,setNodeExtent:Q,setPaneClickDistance:q,removeSelectedElements:v,removeSelectedNodes:D,removeSelectedEdges:z,startConnection:te,updateConnection:se,endConnection:L,setInteractive:j,setState:ie,getIntersectingNodes:P,getIncomers:s,getOutgoers:a,getConnectedEdges:l,getHandleConnections:d,isNodeIntersecting:X,panBy:ne,fitView:C=>o.value.fitView(C),zoomIn:C=>o.value.zoomIn(C),zoomOut:C=>o.value.zoomOut(C),zoomTo:(C,_)=>o.value.zoomTo(C,_),setViewport:(C,_)=>o.value.setViewport(C,_),setTransform:(C,_)=>o.value.setTransform(C,_),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(C,_,N)=>o.value.setCenter(C,_,N),fitBounds:(C,_)=>o.value.fitBounds(C,_),project:C=>o.value.project(C),screenToFlowCoordinate:C=>o.value.screenToFlowCoordinate(C),flowToScreenCoordinate:C=>o.value.flowToScreenCoordinate(C),toObject:()=>{const C=[],_=[];for(const N of t.nodes){const{computedPosition:x,handleBounds:y,selected:R,dimensions:I,isParent:J,resizing:W,dragging:ce,events:fe,...he}=N;C.push(he)}for(const N of t.edges){const{selected:x,sourceNode:y,targetNode:R,events:I,...J}=N;_.push(J)}return JSON.parse(JSON.stringify({nodes:C,edges:_,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:C=>new Promise(_=>{const{nodes:N,edges:x,position:y,zoom:R,viewport:I}=C;N&&K(N),x&&G(x);const[J,W]=I?.x&&I?.y?[I.x,I.y]:y??[null,null];if(J&&W){const ce=I?.zoom||R||t.viewport.zoom;return $n(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:J,y:W,zoom:ce}).then(()=>{_(!0)})})}else _(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const C=hr();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const _=ft.translate(C.defaultViewport.x??0,C.defaultViewport.y??0).scale(it(C.defaultViewport.zoom??1,C.minZoom,C.maxZoom)),N=t.viewportRef.getBoundingClientRect(),x=[[0,0],[N.width,N.height]],y=t.d3Zoom.constrain()(_,x,C.translateExtent);t.d3Zoom.transform(t.d3Selection,y)}ie(C)},$destroy:()=>{}}}var Kd=["data-id","data-handleid","data-nodeid","data-handlepos"],mt=(0,r.defineComponent)({name:"Handle",compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>ae.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,r.createPropsRestProxy)(t,["position","connectable","connectableStart","connectableEnd","id"]),o=(0,r.toRef)(()=>n.type??"source"),i=(0,r.toRef)(()=>n.isValidConnection??null),{id:s,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:d,vueFlowRef:c,nodesConnectable:u,noDragClassName:h,noPanClassName:f}=ge(),{id:g,node:p,nodeEl:b,connectedEdges:S}=ur(),D=(0,r.ref)(),z=(0,r.toRef)(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),v=(0,r.toRef)(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),M=(0,r.toRef)(()=>{var G,k,Y,w,V,m;return((G=a.value)==null?void 0:G.nodeId)===g&&((k=a.value)==null?void 0:k.id)===t.id&&((Y=a.value)==null?void 0:Y.type)===o.value||((w=d.value)==null?void 0:w.nodeId)===g&&((V=d.value)==null?void 0:V.id)===t.id&&((m=d.value)==null?void 0:m.type)===o.value}),U=(0,r.toRef)(()=>{var G,k,Y;return((G=l.value)==null?void 0:G.nodeId)===g&&((k=l.value)==null?void 0:k.id)===t.id&&((Y=l.value)==null?void 0:Y.type)===o.value}),{handlePointerDown:$,handleClick:Q}=dr({nodeId:g,handleId:t.id,isValidConnection:i,type:o}),q=(0,r.computed)(()=>typeof t.connectable=="string"&&t.connectable==="single"?!S.value.some(G=>{const k=G[`${o.value}Handle`];return G[o.value]!==g?!1:k?k===t.id:!0}):typeof t.connectable=="number"?S.value.filter(G=>{const k=G[`${o.value}Handle`];return G[o.value]!==g?!1:k?k===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(p,S.value):_e(t.connectable)?t.connectable:u.value);(0,r.onMounted)(()=>{var G;if(!p.dimensions.width||!p.dimensions.height)return;const k=(G=p.handleBounds[o.value])==null?void 0:G.find(T=>T.id===t.id);if(!c.value||k)return;const Y=c.value.querySelector(".vue-flow__transformationpane");if(!b.value||!D.value||!Y||!t.id)return;const w=b.value.getBoundingClientRect(),V=D.value.getBoundingClientRect(),m=window.getComputedStyle(Y),{m22:E}=new window.DOMMatrixReadOnly(m.transform),B={id:t.id,position:t.position,x:(V.left-w.left)/E,y:(V.top-w.top)/E,type:o.value,nodeId:g,...dn(D.value)};p.handleBounds[o.value]=[...p.handleBounds[o.value]??[],B]});function j(G){const k=lo(G);q.value&&z.value&&(k&&G.button===0||!k)&&$(G)}function K(G){!g||!l.value&&!z.value||q.value&&Q(G)}return e({handleClick:Q,handlePointerDown:$,onClick:K,onPointerDown:j}),(G,k)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"handle",ref:D,"data-id":`${(0,r.unref)(s)}-${(0,r.unref)(g)}-${t.id}-${o.value}`,"data-handleid":t.id,"data-nodeid":(0,r.unref)(g),"data-handlepos":G.position,class:(0,r.normalizeClass)(["vue-flow__handle",[`vue-flow__handle-${G.position}`,`vue-flow__handle-${t.id}`,(0,r.unref)(h),(0,r.unref)(f),o.value,{connectable:q.value,connecting:U.value,connectablestart:z.value,connectableend:v.value,connectionindicator:q.value&&(z.value&&!M.value||v.value&&M.value)}]]),onMousedown:j,onTouchstartPassive:j,onClick:K},[(0,r.renderSlot)(G.$slots,"default",{id:G.id})],42,Kd))}}),yn=function({sourcePosition:t=ae.Bottom,targetPosition:e=ae.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:s,data:a}){const l=a.label??n;return[(0,r.h)(mt,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?(0,r.h)(l):(0,r.h)(r.Fragment,[l]),(0,r.h)(mt,{type:"source",position:t,connectable:o,isValidConnection:s})]};yn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],yn.inheritAttrs=!1,yn.compatConfig={MODE:3};var qd=yn,vn=function({targetPosition:t=ae.Top,label:e,connectable:n=!0,isValidTargetPos:o,data:i}){const s=i.label??e;return[(0,r.h)(mt,{type:"target",position:t,connectable:n,isValidConnection:o}),typeof s!="string"&&s?(0,r.h)(s):(0,r.h)(r.Fragment,[s])]};vn.props=["targetPosition","label","isValidTargetPos","connectable","data"],vn.inheritAttrs=!1,vn.compatConfig={MODE:3};var Jd=vn,_n=function({sourcePosition:t=ae.Bottom,label:e,connectable:n=!0,isValidSourcePos:o,data:i}){const s=i.label??e;return[typeof s!="string"&&s?(0,r.h)(s):(0,r.h)(r.Fragment,[s]),(0,r.h)(mt,{type:"source",position:t,connectable:n,isValidConnection:o})]};_n.props=["sourcePosition","label","isValidSourcePos","connectable","data"],_n.inheritAttrs=!1,_n.compatConfig={MODE:3};var Qd=_n,eu=["transform"],tu=["width","height","x","y","rx","ry"],nu=["y"],ou=(0,r.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,r.ref)({x:0,y:0,width:0,height:0}),n=(0,r.ref)(null),o=(0,r.computed)(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);(0,r.onMounted)(i),(0,r.watch)([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const s=n.value.getBBox();(s.width!==e.value.width||s.height!==e.value.height)&&(e.value=s)}return(s,a)=>((0,r.openBlock)(),(0,r.createElementBlock)("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[s.labelShowBg?((0,r.openBlock)(),(0,r.createElementBlock)("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*s.labelBgPadding[0]}px`,height:`${e.value.height+2*s.labelBgPadding[1]}px`,x:-s.labelBgPadding[0],y:-s.labelBgPadding[1],style:(0,r.normalizeStyle)(s.labelBgStyle),rx:s.labelBgBorderRadius,ry:s.labelBgBorderRadius},null,12,tu)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("text",(0,r.mergeProps)(s.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:s.labelStyle}),[(0,r.renderSlot)(s.$slots,"default",{},()=>[typeof s.label!="string"?((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(s.label),{key:0})):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createTextVNode)((0,r.toDisplayString)(s.label),1)],64))])],16,nu)],8,eu))}}),iu=["id","d","marker-end","marker-start"],ru=["d","stroke-width"],Vt=(0,r.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,r.ref)(null),o=(0,r.ref)(null),i=(0,r.ref)(null),s=(0,r.useAttrs)();return e({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("path",(0,r.mergeProps)((0,r.unref)(s),{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,iu),a.interactionWidth?((0,r.openBlock)(),(0,r.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,ru)):(0,r.createCommentVNode)("",!0),a.label&&a.labelX&&a.labelY?((0,r.openBlock)(),(0,r.createBlock)(ou,{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,r.createCommentVNode)("",!0)],64))}});function gr({sourceX:t,sourceY:e,targetX:n,targetY:o}){const i=Math.abs(n-t)/2,s=n<t?n+i:n-i,a=Math.abs(o-e)/2;return[s,o<e?o+a:o-a,i,a]}function pr({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){const d=t*.125+i*.375+a*.375+n*.125,c=e*.125+s*.375+l*.375+o*.125;return[d,c,Math.abs(d-t),Math.abs(c-e)]}function wn(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function mr({pos:t,x1:e,y1:n,x2:o,y2:i,c:s}){let a,l;switch(t){case ae.Left:a=e-wn(e-o,s),l=n;break;case ae.Right:a=e+wn(o-e,s),l=n;break;case ae.Top:a=e,l=n-wn(n-i,s);break;case ae.Bottom:a=e,l=n+wn(i-n,s);break}return[a,l]}function mo(t){const{sourceX:e,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top,curvature:l=.25}=t,[d,c]=mr({pos:o,x1:e,y1:n,x2:i,y2:s,c:l}),[u,h]=mr({pos:a,x1:i,y1:s,x2:e,y2:n,c:l}),[f,g,p,b]=pr({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:d,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${d},${c} ${u},${h} ${i},${s}`,f,g,p,b]}function yr({pos:t,x1:e,y1:n,x2:o,y2:i}){let s,a;switch(t){case ae.Left:case ae.Right:s=.5*(e+o),a=n;break;case ae.Top:case ae.Bottom:s=e,a=.5*(n+i);break}return[s,a]}function vr(t){const{sourceX:e,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top}=t,[l,d]=yr({pos:o,x1:e,y1:n,x2:i,y2:s}),[c,u]=yr({pos:a,x1:i,y1:s,x2:e,y2:n}),[h,f,g,p]=pr({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:l,sourceControlY:d,targetControlX:c,targetControlY:u});return[`M${e},${n} C${l},${d} ${c},${u} ${i},${s}`,h,f,g,p]}var _r={[ae.Left]:{x:-1,y:0},[ae.Right]:{x:1,y:0},[ae.Top]:{x:0,y:-1},[ae.Bottom]:{x:0,y:1}};function su({source:t,sourcePosition:e=ae.Bottom,target:n}){return e===ae.Left||e===ae.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 wr(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function au({source:t,sourcePosition:e=ae.Bottom,target:n,targetPosition:o=ae.Top,center:i,offset:s}){const a=_r[e],l=_r[o],d={x:t.x+a.x*s,y:t.y+a.y*s},c={x:n.x+l.x*s,y:n.y+l.y*s},u=su({source:d,sourcePosition:e,target:c}),h=u.x!==0?"x":"y",f=u[h];let g,p,b;const S={x:0,y:0},D={x:0,y:0},[z,v,M,U]=gr({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[h]*l[h]===-1){p=i.x??z,b=i.y??v;const $=[{x:p,y:d.y},{x:p,y:c.y}],Q=[{x:d.x,y:b},{x:c.x,y:b}];a[h]===f?g=h==="x"?$:Q:g=h==="x"?Q:$}else{const $=[{x:d.x,y:c.y}],Q=[{x:c.x,y:d.y}];if(h==="x"?g=a.x===f?Q:$:g=a.y===f?$:Q,e===o){const K=Math.abs(t[h]-n[h]);if(K<=s){const G=Math.min(s-1,s-K);a[h]===f?S[h]=(d[h]>t[h]?-1:1)*G:D[h]=(c[h]>n[h]?-1:1)*G}}if(e!==o){const K=h==="x"?"y":"x",G=a[h]===l[K],k=d[K]>c[K],Y=d[K]<c[K];(a[h]===1&&(!G&&k||G&&Y)||a[h]!==1&&(!G&&Y||G&&k))&&(g=h==="x"?$:Q)}const q={x:d.x+S.x,y:d.y+S.y},j={x:c.x+D.x,y:c.y+D.y};Math.max(Math.abs(q.x-g[0].x),Math.abs(j.x-g[0].x))>=Math.max(Math.abs(q.y-g[0].y),Math.abs(j.y-g[0].y))?(p=(q.x+j.x)/2,b=g[0].y):(p=g[0].x,b=(q.y+j.y)/2)}return[[t,{x:d.x+S.x,y:d.y+S.y},...g,{x:c.x+D.x,y:c.y+D.y},n],p,b,M,U]}function lu(t,e,n,o){const i=Math.min(wr(t,e)/2,wr(e,n)/2,o),{x:s,y:a}=e;if(t.x===s&&s===n.x||t.y===a&&a===n.y)return`L${s} ${a}`;if(t.y===a){const d=t.x<n.x?-1:1,c=t.y<n.y?1:-1;return`L ${s+i*d},${a}Q ${s},${a} ${s},${a+i*c}`}const l=t.x<n.x?1:-1;return`L ${s},${a+i*(t.y<n.y?-1:1)}Q ${s},${a} ${s+i*l},${a}`}function yo(t){const{sourceX:e,sourceY:n,sourcePosition:o=ae.Bottom,targetX:i,targetY:s,targetPosition:a=ae.Top,borderRadius:l=5,centerX:d,centerY:c,offset:u=20}=t,[h,f,g,p,b]=au({source:{x:e,y:n},sourcePosition:o,target:{x:i,y:s},targetPosition:a,center:{x:d,y:c},offset:u});return[h.reduce((S,D,z)=>{let v;return z>0&&z<h.length-1?v=lu(h[z-1],D,h[z+1],l):v=`${z===0?"M":"L"}${D.x} ${D.y}`,S+=v,S},""),f,g,p,b]}function cu(t){const{sourceX:e,sourceY:n,targetX:o,targetY:i}=t,[s,a,l,d]=gr({sourceX:e,sourceY:n,targetX:o,targetY:i});return[`M ${e},${n}L ${o},${i}`,s,a,l,d]}var du=(0,r.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]=cu(t);return(0,r.h)(Vt,{path:n,labelX:o,labelY:i,...e,...t})}}}),br=(0,r.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]=yo({...t,sourcePosition:t.sourcePosition??ae.Bottom,targetPosition:t.targetPosition??ae.Top});return(0,r.h)(Vt,{path:n,labelX:o,labelY:i,...e,...t})}}}),uu=(0,r.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,r.h)(br,{...t,...e,borderRadius:0})}}),fu=(0,r.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]=mo({...t,sourcePosition:t.sourcePosition??ae.Bottom,targetPosition:t.targetPosition??ae.Top});return(0,r.h)(Vt,{path:n,labelX:o,labelY:i,...e,...t})}}}),hu=(0,r.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]=vr({...t,sourcePosition:t.sourcePosition??ae.Bottom,targetPosition:t.targetPosition??ae.Top});return(0,r.h)(Vt,{path:n,labelX:o,labelY:i,...e,...t})}}}),gu={input:Qd,default:qd,output:Jd},pu={default:fu,straight:du,step:uu,smoothstep:br,simplebezier:hu};function mu(t,e,n){const o=(0,r.computed)(()=>p=>e.value.get(p)),i=(0,r.computed)(()=>p=>n.value.get(p)),s=(0,r.computed)(()=>{const p={...pu,...t.edgeTypes},b=Object.keys(p);for(const S of t.edges)S.type&&!b.includes(S.type)&&(p[S.type]=S.type);return p}),a=(0,r.computed)(()=>{const p={...gu,...t.nodeTypes},b=Object.keys(p);for(const S of t.nodes)S.type&&!b.includes(S.type)&&(p[S.type]=S.type);return p}),l=(0,r.computed)(()=>t.onlyRenderVisibleElements?$i(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),d=(0,r.computed)(()=>{if(t.onlyRenderVisibleElements){const p=[];for(const b of t.edges){const S=e.value.get(b.source),D=e.value.get(b.target);wd({sourcePos:S.computedPosition||{x:0,y:0},targetPos:D.computedPosition||{x:0,y:0},sourceWidth:S.dimensions.width,sourceHeight:S.dimensions.height,targetWidth:D.dimensions.width,targetHeight:D.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&p.push(b)}return p}return t.edges}),c=(0,r.computed)(()=>[...l.value,...d.value]),u=(0,r.computed)(()=>{const p=[];for(const b of t.nodes)b.selected&&p.push(b);return p}),h=(0,r.computed)(()=>{const p=[];for(const b of t.edges)b.selected&&p.push(b);return p}),f=(0,r.computed)(()=>[...u.value,...h.value]),g=(0,r.computed)(()=>{const p=[];for(const b of t.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&p.push(b);return p});return{getNode:o,getEdge:i,getElements:c,getEdgeTypes:s,getNodeTypes:a,getEdges:d,getNodes:l,getSelectedElements:f,getSelectedNodes:u,getSelectedEdges:h,getNodesInitialized:g,areNodesInitialized:(0,r.computed)(()=>l.value.length>0&&g.value.length===l.value.length)}}var yu=class vt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=(0,r.getCurrentInstance)())==null?void 0:e.appContext.app;return vt.instance=n?.config.globalProperties.$vueFlowStorage??vt.instance??new vt,n&&(n.config.globalProperties.$vueFlowStorage=vt.instance),vt.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,r.reactive)(hr()),i={};for(const[h,f]of Object.entries(o.hooks)){const g=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[g]=f.on}const s={};for(const[h,f]of Object.entries(o.hooks))s[h]=f.trigger;const a=(0,r.computed)(()=>{const h=new Map;for(const f of o.nodes)h.set(f.id,f);return h}),l=(0,r.computed)(()=>{const h=new Map;for(const f of o.edges)h.set(f.id,f);return h}),d=mu(o,a,l),c=Zd(o,a,l);c.setState({...o,...n});const u={...i,...d,...c,...ps(o),nodeLookup:a,edgeLookup:l,emits:s,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,u),u}getId(){return`vue-flow-${this.currentId++}`}};function ge(t){const e=yu.getInstance(),n=(0,r.getCurrentScope)(),o=typeof t=="object",i=o?t:{id:t},s=i.id,a=s??n?.vueFlowId;let l;if(n){const d=(0,r.inject)(sr,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=s??e.getId(),c=e.create(d,i);l=c,(n??(0,r.effectScope)(!0)).run(()=>{(0,r.watch)(c.applyDefault,(u,h,f)=>{const g=b=>{c.applyNodeChanges(b)},p=b=>{c.applyEdgeChanges(b)};u?(c.onNodesChange(g),c.onEdgesChange(p)):(c.hooks.value.nodesChange.off(g),c.hooks.value.edgesChange.off(p)),f(()=>{c.hooks.value.nodesChange.off(g),c.hooks.value.edgesChange.off(p)})},{immediate:!0}),wt(()=>{if(l){const u=e.get(l.id);u?u.$destroy():Ot(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&((0,r.provide)(sr,l),n.vueFlowId=l.id),o){const d=(0,r.getCurrentInstance)();d?.type.name!=="VueFlow"&&l.emits.error(new we(ve.USEVUEFLOW_OPTIONS))}return l}function vu(t){const{emits:e,dimensions:n}=ge();let o;(0,r.onMounted)(()=>{const i=()=>{var s,a;if(!t.value||!(((a=(s=t.value).checkVisibility)==null?void 0:a.call(s))??!0))return;const l=dn(t.value);(l.width===0||l.height===0)&&e.error(new we(ve.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,r.onBeforeUnmount)(()=>{window.removeEventListener("resize",i),o&&t.value&&o.unobserve(t.value)})})}var _u=(0,r.defineComponent)({name:"UserSelection",compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(t){return(e,n)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"vue-flow__selection vue-flow__container",style:(0,r.normalizeStyle)({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),wu=["tabIndex"],bu=(0,r.defineComponent)({name:"NodesSelection",compatConfig:{MODE:3},setup(t){const{emits:e,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:s,userSelectionActive:a}=ge(),l=fr(),d=(0,r.ref)(null),c=cr({el:d,onStart(p){e.selectionDragStart(p),e.nodeDragStart(p)},onDrag(p){e.selectionDrag(p),e.nodeDrag(p)},onStop(p){e.selectionDragStop(p),e.nodeDragStop(p)}});(0,r.onMounted)(()=>{var p;s.value||(p=d.value)==null||p.focus({preventScroll:!0})});const u=(0,r.computed)(()=>Ai(o.value)),h=(0,r.computed)(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function f(p){e.selectionContextMenu({event:p,nodes:o.value})}function g(p){s.value||ht[p.key]&&(p.preventDefault(),l({x:ht[p.key].x,y:ht[p.key].y},p.shiftKey))}return(p,b)=>!(0,r.unref)(a)&&u.value.width&&u.value.height?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:(0,r.normalizeClass)(["vue-flow__nodesselection vue-flow__container",(0,r.unref)(i)]),style:(0,r.normalizeStyle)({transform:`translate(${(0,r.unref)(n).x}px,${(0,r.unref)(n).y}px) scale(${(0,r.unref)(n).zoom})`})},[(0,r.createElementVNode)("div",{ref_key:"el",ref:d,class:(0,r.normalizeClass)([{dragging:(0,r.unref)(c)},"vue-flow__nodesselection-rect"]),style:(0,r.normalizeStyle)(h.value),tabIndex:(0,r.unref)(s)?void 0:-1,onContextmenu:f,onKeydown:g},null,46,wu)],6)):(0,r.createCommentVNode)("",!0)}});function Cu(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}var Eu=(0,r.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:s,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:d,nodesSelectionActive:c,getSelectedEdges:u,getSelectedNodes:h,removeNodes:f,removeEdges:g,selectionMode:p,deleteKeyCode:b,multiSelectionKeyCode:S,multiSelectionActive:D,edgeLookup:z,nodeLookup:v,connectionLookup:M,defaultEdgeOptions:U,connectionStartHandle:$,panOnDrag:Q}=ge(),q=(0,r.shallowRef)(null),j=(0,r.shallowRef)(new Set),K=(0,r.shallowRef)(new Set),G=(0,r.shallowRef)(null),k=(0,r.toRef)(()=>d.value&&(t.isSelecting||s.value)),Y=(0,r.toRef)(()=>$.value!==null);let w=!1,V=!1;const m=zt(b,{actInsideInputWithModifier:!1}),E=zt(S);(0,r.watch)(m,L=>{L&&(f(h.value),g(u.value),c.value=!1)}),(0,r.watch)(E,L=>{D.value=L});function B(L,Z){return P=>{P.target===Z&&L?.(P)}}function T(L){if(w||Y.value){w=!1;return}i.paneClick(L),a(),c.value=!1}function A(L){var Z;if(Array.isArray(Q.value)&&((Z=Q.value)!=null&&Z.includes(2))){L.preventDefault();return}i.paneContextMenu(L)}function H(L){i.paneScroll(L)}function F(L){var Z,P,X;if(G.value=((Z=e.value)==null?void 0:Z.getBoundingClientRect())??null,!d.value||!t.isSelecting||L.button!==0||L.target!==q.value||!G.value)return;(X=(P=L.target)==null?void 0:P.setPointerCapture)==null||X.call(P,L.pointerId);const{x:ne,y:ie}=Cu(L,G.value);V=!0,w=!1,a(),l.value={width:0,height:0,startX:ne,startY:ie,x:ne,y:ie},i.selectionStart(L)}function te(L){var Z;if(!G.value||!l.value)return;w=!0;const{x:P,y:X}=Ve(L,G.value),{startX:ne=0,startY:ie=0}=l.value,le={startX:ne,startY:ie,x:P<ne?P:ne,y:X<ie?X:ie,width:Math.abs(P-ne),height:Math.abs(X-ie)},ee=j.value,re=K.value;j.value=new Set($i(n.value,le,o.value,p.value===oo.Partial,!0).map(_=>_.id)),K.value=new Set;const C=((Z=U.value)==null?void 0:Z.selectable)??!0;for(const _ of j.value){const N=M.value.get(_);if(N)for(const{edgeId:x}of N.values()){const y=z.value.get(x);y&&(y.selectable??C)&&K.value.add(x)}}if(!rr(ee,j.value)){const _=Ze(v.value,j.value,!0);i.nodesChange(_)}if(!rr(re,K.value)){const _=Ze(z.value,K.value);i.edgesChange(_)}l.value=le,s.value=!0,c.value=!1}function se(L){var Z;L.button!==0||!V||((Z=L.target)==null||Z.releasePointerCapture(L.pointerId),!s.value&&l.value&&L.target===q.value&&T(L),s.value=!1,l.value=null,c.value=j.value.size>0,i.selectionEnd(L),t.selectionKeyPressed&&(w=!1),V=!1)}return(L,Z)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"container",ref:q,class:(0,r.normalizeClass)(["vue-flow__pane vue-flow__container",{selection:L.isSelecting}]),onClick:Z[0]||(Z[0]=P=>k.value?void 0:B(T,q.value)(P)),onContextmenu:Z[1]||(Z[1]=P=>B(A,q.value)(P)),onWheelPassive:Z[2]||(Z[2]=P=>B(H,q.value)(P)),onPointerenter:Z[3]||(Z[3]=P=>k.value?void 0:(0,r.unref)(i).paneMouseEnter(P)),onPointerdown:Z[4]||(Z[4]=P=>k.value?F(P):(0,r.unref)(i).paneMouseMove(P)),onPointermove:Z[5]||(Z[5]=P=>k.value?te(P):(0,r.unref)(i).paneMouseMove(P)),onPointerup:Z[6]||(Z[6]=P=>k.value?se(P):void 0),onPointerleave:Z[7]||(Z[7]=P=>(0,r.unref)(i).paneMouseLeave(P))},[(0,r.renderSlot)(L.$slots,"default"),(0,r.unref)(s)&&(0,r.unref)(l)?((0,r.openBlock)(),(0,r.createBlock)(_u,{key:0,"user-selection-rect":(0,r.unref)(l)},null,8,["user-selection-rect"])):(0,r.createCommentVNode)("",!0),(0,r.unref)(c)&&(0,r.unref)(h).length?((0,r.openBlock)(),(0,r.createBlock)(bu,{key:1})):(0,r.createCommentVNode)("",!0)],34))}}),xu=(0,r.defineComponent)({name:"Transform",compatConfig:{MODE:3},setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:o}=ge(),i=(0,r.computed)(()=>n.value?!o.value:!1),s=(0,r.computed)(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"vue-flow__transformationpane vue-flow__container",style:(0,r.normalizeStyle)({transform:s.value,opacity:i.value?0:void 0})},[(0,r.renderSlot)(a.$slots,"default")],4))}}),Nu=(0,r.defineComponent)({name:"Viewport",compatConfig:{MODE:3},setup(t){const{minZoom:e,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:s,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:d,panOnScrollMode:c,panOnScrollSpeed:u,panOnDrag:h,zoomOnDoubleClick:f,zoomOnPinch:g,zoomOnScroll:p,preventScrolling:b,noWheelClassName:S,noPanClassName:D,emits:z,connectionStartHandle:v,userSelectionActive:M,paneDragging:U,d3Zoom:$,d3Selection:Q,d3ZoomHandler:q,viewport:j,viewportRef:K,paneClickDistance:G}=ge();vu(K);const k=(0,r.shallowRef)(!1),Y=(0,r.shallowRef)(!1);let w=null,V=!1,m=0,E={x:0,y:0,zoom:0};const B=zt(l),T=zt(a),A=zt(s),H=(0,r.toRef)(()=>(!T.value||T.value&&a.value===!0)&&(B.value||h.value)),F=(0,r.toRef)(()=>B.value||d.value),te=(0,r.toRef)(()=>a.value===!0&&H.value!==!0),se=(0,r.toRef)(()=>T.value&&a.value!==!0||M.value||te.value),L=(0,r.toRef)(()=>v.value!==null);(0,r.onMounted)(()=>{if(!K.value){Ot("Viewport element is missing");return}const ie=K.value,le=ie.getBoundingClientRect(),ee=Qc().clickDistance(G.value).scaleExtent([e.value,n.value]).translateExtent(i.value),re=Ie(ie).call(ee),C=re.on("wheel.zoom"),_=ft.translate(o.value.x??0,o.value.y??0).scale(it(o.value.zoom??1,e.value,n.value)),N=[[0,0],[le.width,le.height]],x=ee.constrain()(_,N,i.value);ee.transform(re,x),ee.wheelDelta(Hi),$.value=ee,Q.value=re,q.value=C,j.value={x:x.x,y:x.y,zoom:x.k},ee.on("start",y=>{var R;if(!y.sourceEvent)return null;m=y.sourceEvent.button,k.value=!0;const I=X(y.transform);((R=y.sourceEvent)==null?void 0:R.type)==="mousedown"&&(U.value=!0),E=I,z.viewportChangeStart(I),z.moveStart({event:y,flowTransform:I})}),ee.on("end",y=>{if(!y.sourceEvent)return null;if(k.value=!1,U.value=!1,Z(H.value,m??0)&&!V&&z.paneContextMenu(y.sourceEvent),V=!1,P(E,y.transform)){const R=X(y.transform);E=R,z.viewportChangeEnd(R),z.moveEnd({event:y,flowTransform:R})}}),ee.filter(y=>{var R;const I=A.value||p.value,J=g.value&&y.ctrlKey,W=y.button,ce=y.type==="wheel";if(W===1&&y.type==="mousedown"&&(ne(y,"vue-flow__node")||ne(y,"vue-flow__edge")))return!0;if(!H.value&&!I&&!F.value&&!f.value&&!g.value||M.value||L.value&&!ce||!f.value&&y.type==="dblclick"||ne(y,S.value)&&ce||ne(y,D.value)&&(!ce||F.value&&ce&&!A.value)||!g.value&&y.ctrlKey&&ce||!I&&!F.value&&!J&&ce)return!1;if(!g&&y.type==="touchstart"&&((R=y.touches)==null?void 0:R.length)>1)return y.preventDefault(),!1;if(!H.value&&(y.type==="mousedown"||y.type==="touchstart")||te.value&&Array.isArray(h.value)&&h.value.includes(0)&&W===0||Array.isArray(h.value)&&!h.value.includes(W)&&(y.type==="mousedown"||y.type==="touchstart"))return!1;const fe=Array.isArray(h.value)&&h.value.includes(W)||a.value===!0&&Array.isArray(h.value)&&!h.value.includes(0)||!W||W<=1;return(!y.ctrlKey||B.value||ce)&&fe}),(0,r.watch)([M,H],()=>{M.value&&!k.value?ee.on("zoom",null):M.value||ee.on("zoom",y=>{j.value={x:y.transform.x,y:y.transform.y,zoom:y.transform.k};const R=X(y.transform);V=Z(H.value,m??0),z.viewportChange(R),z.move({event:y,flowTransform:R})})},{immediate:!0}),(0,r.watch)([M,F,c,A,g,b,S],()=>{F.value&&!A.value&&!M.value?re.on("wheel.zoom",y=>{if(ne(y,S.value))return!1;const R=A.value||p.value,I=g.value&&y.ctrlKey;if(!(!b.value||F.value||R||I))return!1;y.preventDefault(),y.stopImmediatePropagation();const J=re.property("__zoom").k||1,W=fn();if(!B.value&&y.ctrlKey&&g.value&&W){const ke=Ae(y),pe=J*2**Hi(y);ee.scaleTo(re,pe,ke,y);return}const ce=y.deltaMode===1?20:1;let fe=c.value===Bt.Vertical?0:y.deltaX*ce,he=c.value===Bt.Horizontal?0:y.deltaY*ce;!W&&y.shiftKey&&c.value!==Bt.Vertical&&!fe&&he&&(fe=he,he=0),ee.translateBy(re,-(fe/J)*u.value,-(he/J)*u.value);const Ee=X(re.property("__zoom"));w&&clearTimeout(w),Y.value?(z.move({event:y,flowTransform:Ee}),z.viewportChange(Ee),w=setTimeout(()=>{z.moveEnd({event:y,flowTransform:Ee}),z.viewportChangeEnd(Ee),Y.value=!1},150)):(Y.value=!0,z.moveStart({event:y,flowTransform:Ee}),z.viewportChangeStart(Ee))},{passive:!1}):typeof C<"u"&&re.on("wheel.zoom",function(y,R){const I=!b.value&&y.type==="wheel"&&!y.ctrlKey,J=A.value||p.value,W=g.value&&y.ctrlKey;if(!J&&!d.value&&!W&&y.type==="wheel"||I||ne(y,S.value))return null;y.preventDefault(),C.call(this,y,R)},{passive:!1})},{immediate:!0})});function Z(ie,le){return le===2&&Array.isArray(ie)&&ie.includes(2)}function P(ie,le){return ie.x!==le.x&&!Number.isNaN(le.x)||ie.y!==le.y&&!Number.isNaN(le.y)||ie.zoom!==le.k&&!Number.isNaN(le.k)}function X(ie){return{x:ie.x,y:ie.y,zoom:ie.k}}function ne(ie,le){return ie.target.closest(`.${le}`)}return(ie,le)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"viewportRef",ref:K,class:"vue-flow__viewport vue-flow__container"},[(0,r.createVNode)(Eu,{"is-selecting":se.value,"selection-key-pressed":(0,r.unref)(T),class:(0,r.normalizeClass)({connecting:L.value,dragging:(0,r.unref)(U),draggable:(0,r.unref)(h)===!0||Array.isArray((0,r.unref)(h))&&(0,r.unref)(h).includes(0)})},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(xu,null,{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(ie.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),ku=["id"],Su=["id"],Du=["id"],Tu=(0,r.defineComponent)({name:"A11yDescriptions",compatConfig:{MODE:3},setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:o}=ge();return(i,s)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("div",{id:`${(0,r.unref)(ki)}-${(0,r.unref)(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+(0,r.toDisplayString)((0,r.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,ku),(0,r.createElementVNode)("div",{id:`${(0,r.unref)(Si)}-${(0,r.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,Su),(0,r.unref)(n)?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,id:`${(0,r.unref)(rd)}-${(0,r.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,r.toDisplayString)((0,r.unref)(o)),9,Du))],64))}});function Mu(){const t=ge();(0,r.watch)(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function Iu(t,e,n){return n===ae.Left?t-e:n===ae.Right?t+e:t}function Bu(t,e,n){return n===ae.Top?t-e:n===ae.Bottom?t+e:t}var vo=function({radius:t=10,centerX:e=0,centerY:n=0,position:o=ae.Top,type:i}){return(0,r.h)("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Iu(e,t,o),cy:Bu(n,t,o),r:t,stroke:"transparent",fill:"transparent"})};vo.props=["radius","centerX","centerY","position","type"],vo.compatConfig={MODE:3};var Cr=vo,zu=(0,r.defineComponent)({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:s,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:d,removeSelectedEdges:c,findEdge:u,findNode:h,isValidConnection:f,multiSelectionActive:g,disableKeyboardA11y:p,elementsSelectable:b,edgesUpdatable:S,edgesFocusable:D,hooks:z}=ge(),v=(0,r.computed)(()=>u(t.id)),{emit:M,on:U}=$d(v.value,s),$=(0,r.inject)(gn),Q=(0,r.getCurrentInstance)(),q=(0,r.ref)(!1),j=(0,r.ref)(!1),K=(0,r.ref)(""),G=(0,r.ref)(null),k=(0,r.ref)("source"),Y=(0,r.ref)(null),w=(0,r.toRef)(()=>typeof v.value.selectable>"u"?b.value:v.value.selectable),V=(0,r.toRef)(()=>typeof v.value.updatable>"u"?S.value:v.value.updatable),m=(0,r.toRef)(()=>typeof v.value.focusable>"u"?D.value:v.value.focusable);(0,r.provide)(zd,t.id),(0,r.provide)(Rd,Y);const E=(0,r.computed)(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),B=(0,r.computed)(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),T=(0,r.computed)(()=>{const _=v.value.type||"default",N=$?.[`edge-${_}`];if(N)return N;let x=v.value.template??d.value[_];if(typeof x=="string"&&Q){const y=Object.keys(Q.appContext.components);y&&y.includes(_)&&(x=(0,r.resolveComponent)(_,!1))}return x&&typeof x!="string"?x:(s.error(new we(ve.EDGE_TYPE_MISSING,x)),!1)}),{handlePointerDown:A}=dr({nodeId:K,handleId:G,type:k,isValidConnection:f,edgeUpdaterType:k,onEdgeUpdate:te,onEdgeUpdateEnd:se});return()=>{const _=h(v.value.source),N=h(v.value.target),x="pathOptions"in v.value?v.value.pathOptions:{};if(!_&&!N)return s.error(new we(ve.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!_)return s.error(new we(ve.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!N)return s.error(new we(ve.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||_.hidden||N.hidden)return null;let y;o.value===We.Strict?y=_.handleBounds.source:y=[..._.handleBounds.source||[],..._.handleBounds.target||[]];const R=Ki(y,v.value.sourceHandle);let I;o.value===We.Strict?I=N.handleBounds.target:I=[...N.handleBounds.target||[],...N.handleBounds.source||[]];const J=Ki(I,v.value.targetHandle),W=R?.position||ae.Bottom,ce=J?.position||ae.Top,{x:fe,y:he}=pt(_,R,W),{x:Ee,y:ke}=pt(N,J,ce);return v.value.sourceX=fe,v.value.sourceY=he,v.value.targetX=Ee,v.value.targetY=ke,(0,r.h)("g",{ref:Y,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${T.value===!1?"default":v.value.type||"default"}`,l.value,E.value,{updating:q.value,selected:v.value.selected,animated:v.value.animated,inactive:!w.value&&!z.value.edgeClick.hasListeners()}],tabIndex:m.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":m.value?`${Si}-${e}`:void 0,"aria-roledescription":"edge",role:m.value?"group":"img",...v.value.domAttributes,onClick:Z,onContextmenu:P,onDblclick:X,onMouseenter:ne,onMousemove:ie,onMouseleave:le,onKeyDown:m.value?C:void 0},[j.value?null:(0,r.h)(T.value===!1?d.value.default:T.value,{id:t.id,sourceNode:_,targetNode:N,source:v.value.source,target:v.value.target,type:v.value.type,updatable:V.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,...U},style:B.value,markerStart:`url('#${Pt(v.value.markerStart,e)}')`,markerEnd:`url('#${Pt(v.value.markerEnd,e)}')`,sourcePosition:W,targetPosition:ce,sourceX:fe,sourceY:he,targetX:Ee,targetY:ke,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...x}),[V.value==="source"||V.value===!0?[(0,r.h)("g",{onMousedown:ee,onMouseenter:H,onMouseout:F},(0,r.h)(Cr,{position:W,centerX:fe,centerY:he,radius:i.value,type:"source","data-type":"source"}))]:null,V.value==="target"||V.value===!0?[(0,r.h)("g",{onMousedown:re,onMouseenter:H,onMouseout:F},(0,r.h)(Cr,{position:ce,centerX:Ee,centerY:ke,radius:i.value,type:"target","data-type":"target"}))]:null]])};function H(){q.value=!0}function F(){q.value=!1}function te(_,N){M.update({event:_,edge:v.value,connection:N})}function se(_){M.updateEnd({event:_,edge:v.value}),j.value=!1}function L(_,N){_.button===0&&(j.value=!0,K.value=N?v.value.target:v.value.source,G.value=(N?v.value.targetHandle:v.value.sourceHandle)??null,k.value=N?"target":"source",M.updateStart({event:_,edge:v.value}),A(_))}function Z(_){var N;const x={event:_,edge:v.value};w.value&&(a.value=!1,v.value.selected&&g.value?(c([v.value]),(N=Y.value)==null||N.blur()):n([v.value])),M.click(x)}function P(_){M.contextMenu({event:_,edge:v.value})}function X(_){M.doubleClick({event:_,edge:v.value})}function ne(_){M.mouseEnter({event:_,edge:v.value})}function ie(_){M.mouseMove({event:_,edge:v.value})}function le(_){M.mouseLeave({event:_,edge:v.value})}function ee(_){L(_,!0)}function re(_){L(_,!1)}function C(_){var N;!p.value&&Di.includes(_.key)&&w.value&&(_.key==="Escape"?((N=Y.value)==null||N.blur(),c([u(t.id)])):n([u(t.id)]))}}}),Ru=(0,r.defineComponent)({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:s,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:d,connectionStatus:c,viewport:u,findNode:h}=ge(),f=(t=(0,r.inject)(gn))==null?void 0:t["connection-line"],g=(0,r.computed)(()=>{var z;return h((z=o.value)==null?void 0:z.nodeId)}),p=(0,r.computed)(()=>{var z;return h((z=i.value)==null?void 0:z.nodeId)??null}),b=(0,r.computed)(()=>({x:(s.value.x-u.value.x)/u.value.zoom,y:(s.value.y-u.value.y)/u.value.zoom})),S=(0,r.computed)(()=>d.value.markerStart?`url(#${Pt(d.value.markerStart,e)})`:""),D=(0,r.computed)(()=>d.value.markerEnd?`url(#${Pt(d.value.markerEnd,e)})`:"");return()=>{var z,v,M;if(!g.value||!o.value)return null;const U=o.value.id,$=o.value.type,Q=g.value.handleBounds;let q=Q?.[$]??[];if(n.value===We.Loose){const B=Q?.[$==="source"?"target":"source"]??[];q=[...q,...B]}if(!q)return null;const j=(U?q.find(B=>B.id===U):q[0])??null,K=j?.position??ae.Top,{x:G,y:k}=pt(g.value,j,K);let Y=null;p.value&&(n.value===We.Strict?Y=((z=p.value.handleBounds[$==="source"?"target":"source"])==null?void 0:z.find(B=>{var T;return B.id===((T=i.value)==null?void 0:T.id)}))||null:Y=((v=[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]])==null?void 0:v.find(B=>{var T;return B.id===((T=i.value)==null?void 0:T.id)}))||null);const w=((M=i.value)==null?void 0:M.position)??(K?uo[K]:null);if(!K||!w)return null;const V=a.value??d.value.type??ot.Bezier;let m="";const E={sourceX:G,sourceY:k,sourcePosition:K,targetX:b.value.x,targetY:b.value.y,targetPosition:w};return V===ot.Bezier?[m]=mo(E):V===ot.Step?[m]=yo({...E,borderRadius:0}):V===ot.SmoothStep?[m]=yo(E):V===ot.SimpleBezier?[m]=vr(E):m=`M${G},${k} ${b.value.x},${b.value.y}`,(0,r.h)("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},(0,r.h)("g",{class:"vue-flow__connection"},f?(0,r.h)(f,{sourceX:G,sourceY:k,sourcePosition:K,targetX:b.value.x,targetY:b.value.y,targetPosition:w,sourceNode:g.value,sourceHandle:j,targetNode:p.value,targetHandle:Y,markerEnd:D.value,markerStart:S.value,connectionStatus:c.value}):(0,r.h)("path",{d:m,class:[d.value.class,c.value,"vue-flow__connection-path"],style:{...l.value,...d.value.style},"marker-end":D.value,"marker-start":S.value})))}}}),Au=["id","markerWidth","markerHeight","markerUnits","orient"],$u=(0,r.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,r.openBlock)(),(0,r.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,r.unref)(Ue).ArrowClosed?((0,r.openBlock)(),(0,r.createElementBlock)("polyline",{key:0,style:(0,r.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,r.createCommentVNode)("",!0),e.type===(0,r.unref)(Ue).Arrow?((0,r.openBlock)(),(0,r.createElementBlock)("polyline",{key:1,style:(0,r.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,r.createCommentVNode)("",!0)],8,Au))}}),Pu={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Ou=(0,r.defineComponent)({name:"MarkerDefinitions",compatConfig:{MODE:3},setup(t){const{id:e,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=ge(),s=(0,r.computed)(()=>{const a=new Set,l=[],d=c=>{if(c){const u=Pt(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,r.openBlock)(),(0,r.createElementBlock)("svg",Pu,[(0,r.createElementVNode)("defs",null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,d=>((0,r.openBlock)(),(0,r.createBlock)($u,{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))])]))}}),Vu=(0,r.defineComponent)({name:"Edges",compatConfig:{MODE:3},setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:o}=ge();return(i,s)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(Ou),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(n),a=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:(0,r.normalizeStyle)({zIndex:(0,r.unref)(bd)(a,(0,r.unref)(e),(0,r.unref)(o))})},[(0,r.createVNode)((0,r.unref)(zu),{id:a.id},null,8,["id"])],4))),128)),(0,r.createVNode)((0,r.unref)(Ru))],64))}}),Hu=(0,r.defineComponent)({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:s,emits:a,removeSelectedNodes:l,addSelectedNodes:d,updateNodeDimensions:c,onUpdateNodeInternals:u,getNodeTypes:h,nodeExtent:f,elevateNodesOnSelect:g,disableKeyboardA11y:p,ariaLiveMessage:b,snapToGrid:S,snapGrid:D,nodeDragThreshold:z,nodesDraggable:v,elementsSelectable:M,nodesConnectable:U,nodesFocusable:$,hooks:Q}=ge(),q=(0,r.ref)(null);(0,r.provide)(lr,q),(0,r.provide)(ar,t.id);const j=(0,r.inject)(gn),K=(0,r.getCurrentInstance)(),G=fr(),{node:k,parentNode:Y}=ur(t.id),{emit:w,on:V}=Hd(k,a),m=(0,r.toRef)(()=>typeof k.draggable>"u"?v.value:k.draggable),E=(0,r.toRef)(()=>typeof k.selectable>"u"?M.value:k.selectable),B=(0,r.toRef)(()=>typeof k.connectable>"u"?U.value:k.connectable),T=(0,r.toRef)(()=>typeof k.focusable>"u"?$.value:k.focusable),A=(0,r.computed)(()=>E.value||m.value||Q.value.nodeClick.hasListeners()||Q.value.nodeDoubleClick.hasListeners()||Q.value.nodeMouseEnter.hasListeners()||Q.value.nodeMouseMove.hasListeners()||Q.value.nodeMouseLeave.hasListeners()),H=(0,r.toRef)(()=>!!k.dimensions.width&&!!k.dimensions.height),F=(0,r.computed)(()=>{const N=k.type||"default",x=j?.[`node-${N}`];if(x)return x;let y=k.template||h.value[N];if(typeof y=="string"&&K){const R=Object.keys(K.appContext.components);R&&R.includes(N)&&(y=(0,r.resolveComponent)(N,!1))}return y&&typeof y!="string"?y:(a.error(new we(ve.NODE_TYPE_MISSING,y)),!1)}),te=cr({id:t.id,el:q,disabled:()=>!m.value,selectable:E,dragHandle:()=>k.dragHandle,onStart(N){w.dragStart(N)},onDrag(N){w.drag(N)},onStop(N){w.dragStop(N)},onClick(N){C(N)}}),se=(0,r.computed)(()=>k.class instanceof Function?k.class(k):k.class),L=(0,r.computed)(()=>{const N=(k.style instanceof Function?k.style(k):k.style)||{},x=k.width instanceof Function?k.width(k):k.width,y=k.height instanceof Function?k.height(k):k.height;return!N.width&&x&&(N.width=typeof x=="string"?x:`${x}px`),!N.height&&y&&(N.height=typeof y=="string"?y:`${y}px`),N}),Z=(0,r.toRef)(()=>Number(k.zIndex??L.value.zIndex??0));return u(N=>{(N.includes(t.id)||!N.length)&&X()}),(0,r.onMounted)(()=>{(0,r.watch)(()=>k.hidden,(N=!1,x,y)=>{!N&&q.value&&(t.resizeObserver.observe(q.value),y(()=>{q.value&&t.resizeObserver.unobserve(q.value)}))},{immediate:!0,flush:"post"})}),(0,r.watch)([()=>k.type,()=>k.sourcePosition,()=>k.targetPosition],()=>{(0,r.nextTick)(()=>{c([{id:t.id,nodeElement:q.value,forceUpdate:!0}])})}),(0,r.watch)([()=>k.position.x,()=>k.position.y,()=>{var N;return(N=Y.value)==null?void 0:N.computedPosition.x},()=>{var N;return(N=Y.value)==null?void 0:N.computedPosition.y},()=>{var N;return(N=Y.value)==null?void 0:N.computedPosition.z},Z,()=>k.selected,()=>k.dimensions.height,()=>k.dimensions.width,()=>{var N;return(N=Y.value)==null?void 0:N.dimensions.height},()=>{var N;return(N=Y.value)==null?void 0:N.dimensions.width}],([N,x,y,R,I,J])=>{const W={x:N,y:x,z:J+(g.value&&k.selected?1e3:0)};typeof y<"u"&&typeof R<"u"?k.computedPosition=pd({x:y,y:R,z:I},W):k.computedPosition=W},{flush:"post",immediate:!0}),(0,r.watch)([()=>k.extent,f],([N,x],[y,R])=>{(N!==y||x!==R)&&P()}),k.extent==="parent"||typeof k.extent=="object"&&"range"in k.extent&&k.extent.range==="parent"?$n(()=>H).toBe(!0).then(P):P(),()=>k.hidden?null:(0,r.h)("div",{ref:q,"data-id":k.id,class:["vue-flow__node",`vue-flow__node-${F.value===!1?"default":k.type||"default"}`,{[n.value]:m.value,dragging:te?.value,draggable:m.value,selected:k.selected,selectable:E.value,parent:k.isParent},se.value],style:{visibility:H.value?"visible":"hidden",zIndex:k.computedPosition.z??Z.value,transform:`translate(${k.computedPosition.x}px,${k.computedPosition.y}px)`,pointerEvents:A.value?"all":"none",...L.value},tabIndex:T.value?0:void 0,role:T.value?"group":void 0,"aria-describedby":p.value?void 0:`${ki}-${e}`,"aria-label":k.ariaLabel,"aria-roledescription":"node",...k.domAttributes,onMouseenter:ne,onMousemove:ie,onMouseleave:le,onContextmenu:ee,onClick:C,onDblclick:re,onKeydown:_},[(0,r.h)(F.value===!1?h.value.default:F.value,{id:k.id,type:k.type,data:k.data,events:{...k.events,...V},selected:k.selected,resizing:k.resizing,dragging:te.value,connectable:B.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:X})]);function P(){const N=k.computedPosition,{computedPosition:x,position:y}=ao(k,S.value?hn(N,D.value):N,a.error,f.value,Y.value);(k.computedPosition.x!==x.x||k.computedPosition.y!==x.y)&&(k.computedPosition={...k.computedPosition,...x}),(k.position.x!==y.x||k.position.y!==y.y)&&(k.position=y)}function X(){q.value&&c([{id:t.id,nodeElement:q.value,forceUpdate:!0}])}function ne(N){te?.value||w.mouseEnter({event:N,node:k})}function ie(N){te?.value||w.mouseMove({event:N,node:k})}function le(N){te?.value||w.mouseLeave({event:N,node:k})}function ee(N){return w.contextMenu({event:N,node:k})}function re(N){return w.doubleClick({event:N,node:k})}function C(N){E.value&&(!o.value||!m.value||z.value>0)&&fo(k,s.value,d,l,i,!1,q.value),w.click({event:N,node:k})}function _(N){if(!(io(N)||p.value))if(Di.includes(N.key)&&E.value){const x=N.key==="Escape";fo(k,s.value,d,l,i,x,q.value)}else m.value&&k.selected&&ht[N.key]&&(N.preventDefault(),b.value=`Moved selected node ${N.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.position.x}, y: ${~~k.position.y}`,G({x:ht[N.key].x,y:ht[N.key].y},N.shiftKey))}}}),Lu={height:"0",width:"0"},Fu=(0,r.defineComponent)({name:"EdgeLabelRenderer",compatConfig:{MODE:3},setup(t){const{viewportRef:e}=ge(),n=(0,r.toRef)(()=>{var o;return(o=e.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",null,[((0,r.openBlock)(),(0,r.createElementBlock)("foreignObject",Lu,[((0,r.openBlock)(),(0,r.createBlock)(r.Teleport,{to:n.value,disabled:!n.value},[(0,r.renderSlot)(o.$slots,"default")],8,["to","disabled"]))]))]))}});function Gu(t={includeHiddenNodes:!1}){const{nodes:e}=ge();return(0,r.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 Wu={class:"vue-flow__nodes vue-flow__container"},Uu=(0,r.defineComponent)({name:"Nodes",compatConfig:{MODE:3},setup(t){const{getNodes:e,updateNodeDimensions:n,emits:o}=ge(),i=Gu(),s=(0,r.ref)();return(0,r.watch)(i,a=>{a&&(0,r.nextTick)(()=>{o.nodesInitialized(e.value)})},{immediate:!0}),(0,r.onMounted)(()=>{s.value=new ResizeObserver(a=>{const l=a.map(d=>({id:d.target.getAttribute("data-id"),nodeElement:d.target,forceUpdate:!0}));(0,r.nextTick)(()=>n(l))})}),(0,r.onBeforeUnmount)(()=>{var a;return(a=s.value)==null?void 0:a.disconnect()}),(a,l)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",Wu,[s.value?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)((0,r.unref)(e),(d,c,u,h)=>{const f=[d.id];if(h&&h.key===d.id&&(0,r.isMemoSame)(h,f))return h;const g=((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Hu),{id:d.id,key:d.id,"resize-observer":s.value},null,8,["id","resize-observer"]));return g.memo=f,g},l,0),128)):(0,r.createCommentVNode)("",!0)]))}});function Yu(){const{emits:t}=ge();(0,r.onMounted)(()=>{if(tr()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new we(ve.MISSING_STYLES))}})}var Xu=(0,r.createElementVNode)("div",{class:"vue-flow__edge-labels"},null,-1),ju=(0,r.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,r.useSlots)(),s=Pn(o,"modelValue",n),a=Pn(o,"nodes",n),l=Pn(o,"edges",n),d=ge(o),c=Wd({modelValue:s,nodes:a,edges:l},o,d);return Yd(n,d.hooks),Mu(),Yu(),(0,r.provide)(gn,i),(0,r.onUnmounted)(c),e(d),(u,h)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref:(0,r.unref)(d).vueFlowRef,class:"vue-flow"},[(0,r.createVNode)(Nu,null,{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Vu),Xu,(0,r.createVNode)(Uu),(0,r.renderSlot)(u.$slots,"zoom-pane")]),_:3}),(0,r.renderSlot)(u.$slots,"default"),(0,r.createVNode)(Tu)],512))}}),Zu=(0,r.defineComponent)({name:"Panel",compatConfig:{MODE:3},props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=ge(),o=(0,r.computed)(()=>`${e.position}`.split("-"));return(i,s)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["vue-flow__panel",o.value]),style:(0,r.normalizeStyle)({pointerEvents:(0,r.unref)(n)?"none":"all"})},[(0,r.renderSlot)(i.$slots,"default")],6))}}),Ye=(t=>(t.Lines="lines",t.Dots="dots",t))(Ye||{}),Ku=function({dimensions:t,size:e,color:n}){return(0,r.h)("path",{stroke:n,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},qu=function({radius:t,color:e}){return(0,r.h)("circle",{cx:t,cy:t,r:t,fill:e})};Ye.Lines,Ye.Dots;var Ju={[Ye.Dots]:"#81818a",[Ye.Lines]:"#eee"},Qu=["id","x","y","width","height","patternTransform"],ef={key:2,height:"100",width:"100"},tf=["fill"],nf=["x","y","fill"],of=(0,r.defineComponent)({name:"Background",compatConfig:{MODE:3},props:{id:{},variant:{default:()=>Ye.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}=ge(),o=(0,r.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,[h,f]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset];return{scaledGap:c,offset:[h*a||1+c[0]/2,f*a||1+c[1]/2],size:u}}),i=(0,r.toRef)(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),s=(0,r.toRef)(()=>t.color||t.patternColor||Ju[t.variant||Ye.Dots]);return(a,l)=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",{class:"vue-flow__background vue-flow__container",style:(0,r.normalizeStyle)({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[(0,r.renderSlot)(a.$slots,"pattern-container",{id:i.value},()=>[(0,r.createElementVNode)("pattern",{id:i.value,x:(0,r.unref)(n).x%o.value.scaledGap[0],y:(0,r.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,r.renderSlot)(a.$slots,"pattern",{},()=>[a.variant===(0,r.unref)(Ye).Lines?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Ku),{key:0,size:a.lineWidth,color:s.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===(0,r.unref)(Ye).Dots?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(qu),{key:1,color:s.value,radius:o.value.size/2},null,8,["color","radius"])):(0,r.createCommentVNode)("",!0),a.bgColor?((0,r.openBlock)(),(0,r.createElementBlock)("svg",ef,[(0,r.createElementVNode)("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,tf)])):(0,r.createCommentVNode)("",!0)])],8,Qu)]),(0,r.createElementVNode)("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,nf),(0,r.renderSlot)(a.$slots,"default",{id:i.value})],4))}}),rf={name:"ControlButton",compatConfig:{MODE:3}},sf=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},af={type:"button",class:"vue-flow__controls-button"};function lf(t,e,n,o,i,s){return(0,r.openBlock)(),(0,r.createElementBlock)("button",af,[(0,r.renderSlot)(t.$slots,"default")])}var bn=sf(rf,[["render",lf]]),cf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},df=[(0,r.createElementVNode)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function uf(t,e){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",cf,df)}var ff={render:uf},hf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},gf=[(0,r.createElementVNode)("path",{d:"M0 0h32v4.2H0z"},null,-1)];function pf(t,e){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",hf,gf)}var mf={render:pf},yf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},vf=[(0,r.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 _f(t,e){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",yf,vf)}var wf={render:_f},bf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Cf=[(0,r.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 Ef(t,e){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",bf,Cf)}var xf={render:Ef},Nf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},kf=[(0,r.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 Sf(t,e){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",Nf,kf)}var Df={render:Sf},Tf=(0,r.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:()=>xi.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:s,zoomIn:a,zoomOut:l,fitView:d,viewport:c,minZoom:u,maxZoom:h}=ge(),f=(0,r.toRef)(()=>n.value||o.value||i.value),g=(0,r.toRef)(()=>c.value.zoom<=u.value),p=(0,r.toRef)(()=>c.value.zoom>=h.value);function b(){a(),e("zoomIn")}function S(){l(),e("zoomOut")}function D(){d(t.fitViewParams),e("fitView")}function z(){s(!f.value),e("interactionChange",!f.value)}return(v,M)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Zu),{class:"vue-flow__controls",position:v.position},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(v.$slots,"top"),v.showZoom?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.renderSlot)(v.$slots,"control-zoom-in",{},()=>[(0,r.createVNode)(bn,{class:"vue-flow__controls-zoomin",disabled:p.value,onClick:b},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(v.$slots,"icon-zoom-in",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(ff))))])]),_:3},8,["disabled"])]),(0,r.renderSlot)(v.$slots,"control-zoom-out",{},()=>[(0,r.createVNode)(bn,{class:"vue-flow__controls-zoomout",disabled:g.value,onClick:S},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(v.$slots,"icon-zoom-out",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(mf))))])]),_:3},8,["disabled"])])],64)):(0,r.createCommentVNode)("",!0),v.showFitView?(0,r.renderSlot)(v.$slots,"control-fit-view",{key:1},()=>[(0,r.createVNode)(bn,{class:"vue-flow__controls-fitview",onClick:D},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(v.$slots,"icon-fit-view",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(wf))))])]),_:3})]):(0,r.createCommentVNode)("",!0),v.showInteractive?(0,r.renderSlot)(v.$slots,"control-interactive",{key:2},()=>[v.showInteractive?((0,r.openBlock)(),(0,r.createBlock)(bn,{key:0,class:"vue-flow__controls-interactive",onClick:z},{default:(0,r.withCtx)(()=>[f.value?(0,r.renderSlot)(v.$slots,"icon-unlock",{key:0},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(Df))))]):(0,r.createCommentVNode)("",!0),f.value?(0,r.createCommentVNode)("",!0):(0,r.renderSlot)(v.$slots,"icon-lock",{key:1},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(xf))))])]),_:3})):(0,r.createCommentVNode)("",!0)]):(0,r.createCommentVNode)("",!0),(0,r.renderSlot)(v.$slots,"default")]),_:3},8,["position"]))}}),Mf=["onClick"],If={class:"d-flow-node-menus-item-name"},Bf=(0,r.defineComponent)({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(t,{emit:e}){const n=t,o=e,i=(0,r.inject)("d_flow_design_provide",{}),s=i.getFlowComponents?.()||[],a=l=>{o("addNode",l.type),(0,r.nextTick)(()=>{n.handleId==="line"?i.addNodeByLine?.(l.type,n.fromNodeId||""):i.addNode?.(l.type,n.fromNodeId||"",n.handleId||"")})};return(l,d)=>{const c=(0,r.resolveComponent)("j-icon");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-flow-node-menus",onClick:(0,r.withModifiers)(()=>{},["stop"])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(s),(u,h)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:h,class:"d-flow-node-menus-item",onClick:f=>a(u)},[(0,r.createElementVNode)("div",{class:"d-flow-node-menus-item-icon",style:(0,r.normalizeStyle)({backgroundColor:u.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(c,{icon:u.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",If,(0,r.toDisplayString)(u.name),1)],8,Mf))),128))])}}}),_o=Bf,zf={class:"d-flow-step-name"},Rf={key:0,style:{color:"var(--j-color-text-2)"}},Af={style:{color:"var(--j-color-text)"}},$f=(0,r.defineComponent)({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(t){const e=t,{onNodeClick:n,onEdgeClick:o,onMoveStart:i,onConnectStart:s,onNodeDragStart:a,removeNodes:l,getEdges:d,getNodes:c,onNodesChange:u}=ge(),h=(0,r.inject)("d_flow_design_provide",{}),f=(0,r.computed)(()=>h.getFlowComponentMap?.value?.[e.data.type]||{}),g=()=>{l(e.id),h.onRemoveNode?.(e.id)},p=(0,r.ref)({});u(Y=>{if(e.data.isInit&&Y.findIndex(w=>w.type==="select"&&w.id===e.id&&w.id==="start"&&w.selected)!==-1){const w=c.value.find(V=>V.id==="start");w&&(w.data.isInit=!1),p.value.s1=!0}});const b=(0,r.ref)(!1),S=Y=>{Y.indexOf("t")!==-1&&!D.value||(b.value=!0,p.value[Y]=!0)},D=(0,r.computed)(()=>d.value.findIndex(Y=>Y.target===e.id)===-1),z=(0,r.ref)(!1),v=()=>{z.value=!0},M=(Y,w)=>{if(d.value.find(m=>m.source===w&&m.target===Y))return!0;const V=d.value.filter(m=>m.target===Y);for(let m=0;m<V.length;m++)if(M(V[m].source,w))return!0;return!1},U=Y=>z.value?(z.value=!1,!1):M(Y.source,Y.target)?!1:Y.source!==Y.target&&Y.sourceHandle!==Y.targetHandle&&Y.sourceHandle.indexOf("s")!==-1&&Y.targetHandle.indexOf("t")!==-1,$=()=>{G(),Object.keys(p.value).forEach(Y=>{p.value[Y]=!1})},Q=()=>{$()};n(()=>{console.log("onNodeClick"),b.value?b.value=!1:$()}),o(()=>{$()}),i(()=>{$()}),s(()=>{$()}),a(()=>{$()});const q=(0,r.ref)(),j=(0,r.ref)({top:0,left:0,bottom:0,right:0}),K=(0,r.ref)({getBoundingClientRect:()=>j.value}),G=()=>{q.value?.handleClose()},k=Y=>{const{clientX:w,clientY:V}=Y;j.value=DOMRect.fromRect({x:w,y:V}),Y.preventDefault(),q.value?.handleOpen()};return(Y,w)=>{const V=(0,r.resolveComponent)("j-icon"),m=(0,r.resolveComponent)("el-popover"),E=(0,r.resolveComponent)("el-tooltip"),B=(0,r.resolveComponent)("el-dropdown-item"),T=(0,r.resolveComponent)("el-dropdown-menu"),A=(0,r.resolveComponent)("el-dropdown");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-flow-step",onContextmenu:(0,r.withModifiers)(k,["stop"])},[(0,r.createElementVNode)("div",{class:"d-flow-step-icon",style:(0,r.normalizeStyle)({backgroundColor:f.value.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(V,{icon:f.value.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",zf,(0,r.toDisplayString)(f.value.name),1),t.data.type!=="start"?((0,r.openBlock)(),(0,r.createBlock)(E,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,r.withCtx)(()=>[D.value?((0,r.openBlock)(),(0,r.createElementBlock)("div",Rf,[...w[4]||(w[4]=[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),(0,r.createTextVNode)("添加节点 ",-1)])])):(0,r.createCommentVNode)("",!0),w[5]||(w[5]=(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,r.createTextVNode)("连接节点 ")],-1))]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(mt),{onClick:w[1]||(w[1]=H=>S("t1")),onMousedown:v,id:"t1",class:(0,r.normalizeClass)(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!D.value}]),type:"target",position:(0,r.unref)(ae).Left,"is-valid-connection":U},{default:(0,r.withCtx)(()=>[D.value?((0,r.openBlock)(),(0,r.createBlock)(m,{key:0,visible:p.value.t1,"onUpdate:visible":w[0]||(w[0]=H=>p.value.t1=H),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,r.withCtx)(()=>[(0,r.createVNode)(V,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(_o,{"handle-id":"t1","from-node-id":t.id,onAddNode:Q},null,8,["from-node-id"])]),_:1},8,["visible"])):(0,r.createCommentVNode)("",!0)]),_:1},8,["class","position"])]),_:1})):(0,r.createCommentVNode)("",!0),(0,r.createVNode)(E,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,r.withCtx)(()=>[...w[6]||(w[6]=[(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),(0,r.createTextVNode)("添加节点 ")],-1),(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,r.createTextVNode)("连接节点 ")],-1)])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(mt),{onClick:w[3]||(w[3]=H=>S("s1")),onMousedown:v,id:"s1",class:"d-flow-step-source-handle",type:"source",position:(0,r.unref)(ae).Right,"is-valid-connection":U},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(m,{visible:p.value.s1,"onUpdate:visible":w[2]||(w[2]=H=>p.value.s1=H),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,r.withCtx)(()=>[(0,r.createVNode)(V,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(_o,{"handle-id":"s1","from-node-id":t.id,onAddNode:Q},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),(0,r.createVNode)(A,{ref_key:"dropdownRef",ref:q,"popper-class":"d-flow-step-dropdown","virtual-ref":K.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:(0,r.withCtx)(()=>[(0,r.createVNode)(T,null,{default:(0,r.withCtx)(()=>[t.data.type!="start"?((0,r.openBlock)(),(0,r.createBlock)(B,{key:0,onClick:g},{default:(0,r.withCtx)(()=>[...w[7]||(w[7]=[(0,r.createTextVNode)("删除",-1)])]),_:1})):(0,r.createCommentVNode)("",!0),f.value.des?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:1,style:(0,r.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})},[w[8]||(w[8]=(0,r.createElementVNode)("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),(0,r.createElementVNode)("div",Af,(0,r.toDisplayString)(f.value.des),1)],4)):(0,r.createCommentVNode)("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),Pf=$f,Of=(0,r.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:s,onMoveStart:a,onConnectStart:l,onNodeDragStart:d}=ge(),c=(0,r.computed)(()=>mo(e)),u=(0,r.ref)(!1),h=(0,r.ref)(!1);n(({edge:S})=>{S.id===e.id&&(u.value=!0)}),o(()=>{u.value=!1});const f=(0,r.ref)(!1),g=()=>{f.value=!1,(0,r.nextTick)(()=>{h.value=!1})},p=()=>{h.value=!0,f.value=!0},b=()=>{g()};return i(()=>{g()}),s(()=>{g()}),a(()=>{g()}),l(()=>{g()}),d(()=>{g()}),(S,D)=>{const z=(0,r.resolveComponent)("j-icon"),v=(0,r.resolveComponent)("el-popover");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)((0,r.unref)(Vt),{id:t.id,style:(0,r.normalizeStyle)(t.style),path:c.value[0],"marker-end":t.markerEnd},null,8,["id","style","path","marker-end"]),(0,r.createVNode)((0,r.unref)(Fu),null,{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${c.value[1]}px,${c.value[2]}px)`}),class:"nodrag nopan"},[(0,r.createVNode)(v,{visible:f.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:(0,r.withCtx)(()=>[(0,r.withDirectives)((0,r.createElementVNode)("div",{onClick:(0,r.withModifiers)(p,["stop"]),class:"d-flow-edge-button"},[(0,r.createVNode)(z,{icon:"mdi:plus-circle"})],512),[[r.vShow,u.value||h.value]])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(_o,{"handle-id":"line","from-node-id":t.id,onAddNode:b},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),Vf=Of,Hf=(0,r.defineComponent)({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(t){return(e,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(ju),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":(0,r.unref)(We).Strict,nodes:t.nodes,edges:t.edges},{"edge-button":(0,r.withCtx)(o=>[(0,r.createVNode)(Vf,{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,r.normalizeStyle)(o.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":(0,r.withCtx)(o=>[(0,r.createVNode)(Pf,(0,r.normalizeProps)((0,r.guardReactiveProps)(o)),null,16)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(Tf),{position:"bottom-left"}),(0,r.createVNode)((0,r.unref)(of))]),_:1},8,["connection-mode","nodes","edges"]))}}),Lf=Hf,Ff={class:"d-flow-design"},Gf={class:"d-flow-design-canvas"},Wf={class:"d-flow-design-right"},Uf={class:"d-flow-design-title"},Yf={class:"d-flow-design-title-name"},Xf={class:"d-flow-design-panel"},jf=(0,r.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:s,addEdges:a,removeEdges:l,addSelectedNodes:d,removeSelectedNodes:c,onConnect:u,onNodeClick:h,onPaneClick:f,onEdgeClick:g,getNodes:p,getEdges:b}=ge(),S=(0,r.computed)(()=>{const T={};return o.components.forEach(A=>{T[A.type]=A}),T.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},T}),D={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},z=(0,r.ref)([D]),v=(0,r.ref)([]),M=(T,A)=>{if(A.indexOf("t")===-1){const H=b.value.filter(F=>F.source===T.id);if(H.length>0){let F=-1e6,te=0;return H.forEach(se=>{F=Math.max(F,se.targetNode.position.y+se.targetNode.dimensions.height+32),te=se.targetNode.position.x||0}),{x:te,y:F}}return{x:T.position.x+T.dimensions.width+100,y:T.position.y}}return{x:T.position.x-100-T.dimensions.width,y:T.position.y}},U=(T,A,H)=>{const F=p.value.find(se=>se.id===A);if(!F)return;const te={id:st(),type:"step",data:{type:T},position:M(F,H)};if(o.flowInit){const se=o.flowInit(te.data.type);se&&Object.keys(se).forEach(L=>{te.data[L]=se[L]})}s(te),H.indexOf("t")===-1?a({id:`${A}-${te.id}`,source:A,target:te.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:Ue.Arrow}):a({id:`${A}-${te.id}`,source:te.id,target:A,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:Ue.Arrow}),k(te.id)},$=T=>{const A=p.value.find(H=>H.id===T);A&&(A.position.x+=100+A.dimensions.width,b.value.filter(H=>H.source===T).forEach(H=>{$(H.target)}))},Q=(T,A)=>{const H=b.value.find(te=>te.id===A);if(!H)return;const F={id:st(),type:"step",data:{type:T},position:{x:H.targetNode.position.x,y:H.targetNode.position.y}};if(o.flowInit){const te=o.flowInit(F.data.type);te&&Object.keys(te).forEach(se=>{F.data[se]=te[se]})}s(F),a({id:`${H.sourceNode.id}-${F.id}`,source:H.sourceNode.id,target:F.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:Ue.Arrow}),a({id:`${F.id}-${H.targetNode.id}`,source:F.id,target:H.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:Ue.Arrow}),l(A),$(H.target),k(F.id)};u(T=>{console.log("onConnect",T),T.type="button",T.markerEnd=Ue.Arrow,a(T),i("connect",T)});const q=()=>o.components||[],j=(0,r.ref)(),K=(0,r.computed)(()=>j.value?S.value[j.value.data.type]:void 0);h(T=>{j.value?.id!==T.node.id&&(j.value=T.node,V()),i("nodeClick",T.node)}),f(()=>{j.value=void 0,i("paneClick")}),g(T=>{j.value=void 0,i("edgeClick",T.edge)});const G=T=>{j.value?.id===T&&(j.value=void 0)},k=T=>{j.value&&c([j.value]),j.value=p.value.find(A=>A.id===T),j.value&&(V(),setTimeout(()=>{j.value&&d([j.value])},100))},Y=(0,r.ref)(),w={};Object.keys(o.flowComponentConfigs).forEach(T=>{const A={type:"j-collapse",config:{defaultValue:[]},children:[]};o.flowComponentConfigs[T].forEach((H,F)=>{const te=`_collapse${F}`;A.config?.defaultValue.push(te),A.children?.push(H)}),w[T]=[A]});const V=()=>{const T=w[j.value?.data.type||""];T&&Y.value?(Y.value.init&&Y.value.init(T,j.value?.data),o.flowComponentConfigInit&&o.flowComponentConfigInit({configRef:Y,inputParams:o.inputParams,components:p.value,configData:j.value?.data})):Y.value&&Y.value.init&&Y.value.init([])},m=(T,A)=>{j.value&&o.flowComponentConfigChange&&o.flowComponentConfigChange(j.value.data.type,{configRef:Y,component:T,configData:j.value.data,...A,isFlowNode:!0})};return(0,r.provide)("d_flow_design_provide",{getFlowComponents:q,addNode:U,addNodeByLine:Q,onRemoveNode:G,getFlowComponentMap:S}),e({getData:()=>{const T=[];return p.value.forEach(A=>{T.push({config:A.data,id:A.id,position:A.position,type:A.type})}),b.value.forEach(A=>{T.push({id:A.id,source:A.source,target:A.target,sourceHandle:A.sourceHandle,targetHandle:A.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),T},setData:T=>{if(!T||T.length===0)D.data.isInit=!0,z.value=[D],k(D.id);else{D.data.isInit=!1;const A=[],H=[];T.forEach(F=>{if(F.type==="line")F.type="button",F.markerEnd=Ue.Arrow,H.push(F);else{const te={id:F.id,type:F.type,data:F.config,position:F.position};A.push(te)}}),z.value=A,v.value=H}}}),(T,A)=>{const H=(0,r.resolveComponent)("j-icon"),F=(0,r.resolveComponent)("j-form");return(0,r.openBlock)(),(0,r.createElementBlock)("div",Ff,[(0,r.createElementVNode)("div",Gf,[(0,r.createVNode)(Lf,{nodes:z.value,edges:v.value},null,8,["nodes","edges"])]),(0,r.withDirectives)((0,r.createElementVNode)("div",Wf,[(0,r.createElementVNode)("div",Uf,[(0,r.createElementVNode)("div",{class:"d-flow-design-title-icon",style:(0,r.normalizeStyle)({backgroundColor:K.value?.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(H,{icon:K.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",Yf,(0,r.toDisplayString)(K.value?.name||""),1)]),(0,r.createElementVNode)("div",Xf,[(0,r.createVNode)(F,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:Y,onChange:m},null,512)])],512),[[r.vShow,j.value&&w[j.value.data.type]]])])}}}),Zf=jf,Er=Je(Zf),Kf={class:"d-input-flow j-block"},qf=(0,r.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,r.ref)(),s=(0,r.computed)({get(){return n.modelValue},set(h){o("update:modelValue",h)}}),a=(0,r.computed)(()=>(n.modelValue?.trim(),n.btnText)),l=h=>{const f=typeof h=="string"?h:void 0;try{i.value?.setData(JSON.parse(f||"[]"))}catch{i.value?.setData([])}},d=async()=>{const h=i.value?.getData();return h?JSON.stringify(h):void 0},c=h=>{if(n.beforeClose){const f=typeof h=="string"?h:void 0;return n.beforeClose(f)}return!0},u=h=>{const f=h.value;o("change",{value:typeof f=="string"?f:void 0})};return(h,f)=>{const g=(0,r.resolveComponent)("d-flow-design"),p=(0,r.resolveComponent)("j-input-button");return(0,r.openBlock)(),(0,r.createBlock)(p,(0,r.mergeProps)(h.$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:s.value,"onUpdate:modelValue":f[0]||(f[0]=b=>s.value=b),onChange:u}),{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",Kf,[(0,r.createVNode)(g,{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"])}}}),Jf=qf,xr=Je(Jf),O=class Me{static getElements(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(o&&!isNaN(+e[0])){const s=o.getElementById(e);return s?[s]:[]}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 s=n.querySelector(`[gs-id="${e}"]`);return s?[s]:[]}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 Me.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 s=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<=s?0:(i-o)*(a-s)}static area(e){return e.w*e.h}static sort(e,n=1){return e.sort((i,s)=>{const a=n*((i.y??1e4)-(s.y??1e4));return a===0?n*((i.x??1e4)-(s.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"&&Me.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],s=n[o];o[0]==="_"||i===s?delete e[o]:i&&typeof i=="object"&&s!==void 0&&(Me.removeInternalAndSame(i,s),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:Me.getScrollElement(e.parentElement)}static updateScrollPosition(e,n,o){const i=Me.getScrollElement(e);if(!i)return;const s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,d=s.bottom-Math.min(a.bottom,l),c=s.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=Me.getScrollElement(n),s=i.clientHeight,a=i===Me.getScrollElement()?0:i.getBoundingClientRect().top,l=e.clientY-a,d=l<o,c=l>s-o;d?i.scrollBy({behavior:"smooth",top:l-o}):c&&i.scrollBy({behavior:"smooth",top:o-(s-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=Me.clone(e);for(const i in o)o.hasOwnProperty(i)&&typeof o[i]=="object"&&i.substring(0,2)!=="__"&&!n.find(s=>s===i)&&(o[i]=Me.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=Me.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(s=>o[s]=e[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>o[s]=e[s]),{...o,...i}}static simulateMouseEvent(e,n,o){const i=e,s=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(s)}static getValuesFromTransformedElement(e){const n=document.createElement("div");Me.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)}},wo=class _t{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 s=n;!this._loading&&this._useEntireRowArea(e,n)&&(s={x:0,w:this.column,y:n.y,h:n.h},o=this.collide(e,s,i.skip));let a=!1;const l={nested:!0,pack:!1};let d=0;for(;o=o||this.collide(e,s,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&&O.samePos(e,u)?!0:this.moveNode(e,u),(o.locked||this._loading)&&c?O.copyPos(n,e):!o.locked&&c&&i.pack&&(this._packNodes(),n.y=o.y+o.h,O.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,s=o?._id;return this.nodes.find(a=>a._id!==i&&a._id!==s&&O.isIntercepted(a,n))}collideAll(e,n=e,o){const i=e._id,s=o?._id;return this.nodes.filter(a=>a._id!==i&&a._id!==s&&O.isIntercepted(a,n))}directionCollideCoverage(e,n,o){if(!n.rect||!e._rect)return;const i=e._rect,s={...n.rect};s.y>i.y?(s.h+=s.y-i.y,s.y=i.y):s.h+=i.y-s.y,s.x>i.x?(s.w+=s.x-i.x,s.x=i.x):s.w+=i.x-s.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,h=Number.MAX_VALUE;i.y<c.y?u=(s.y+s.h-c.y)/c.h:i.y+i.h>c.y+c.h&&(u=(c.y+c.h-s.y)/c.h),i.x<c.x?h=(s.x+s.w-c.x)/c.w:i.x+i.w>c.x+c.w&&(h=(c.x+c.w-s.x)/c.w);const f=Math.min(h,u);f>l&&(l=f,a=d)}return n.collide=a,a}cacheRects(e,n,o,i,s,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-s}),this}swap(e,n){if(!n||n.locked||!e||e.locked)return!1;function o(){const s=n.x,a=n.y;return n.x=e.x,n.y=e.y,e.h!=n.h?(e.x=s,e.y=n.y+n.h):e.w!=n.w?(e.x=n.x+n.w,e.y=a):(e.x=s,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=O.isTouching(e,n)))return o();if(i!==!1){if(e.w===n.w&&e.x===n.x&&(i||(i=O.isTouching(e,n)))){if(n.y<e.y){const s=e;e=n,n=s}return o()}if(i!==!1){if(e.h===n.h&&e.y===n.y&&(i||(i=O.isTouching(e,n)))){if(n.x<e.x){const s=e;e=n,n=s}return o()}return!1}}}isAreaEmpty(e,n,o,i){const s={x:e||0,y:n||0,w:o||1,h:i||1};return!this.collide(s)}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 s=this.nodes;return this.nodes=[],s.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=O.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??_t._idSeq++;const o=e.id;if(o){let s=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=o+"_"+s++}(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 O.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,O.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||O.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),O.samePos(e,o)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(n=>n._dirty&&!O.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=O.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||O.samePos(e,e._orig)||(O.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,n=this.nodes,o=this.column,i){const s=i?i.y*o+(i.x+i.w):0;let a=!1;for(let l=s;!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(h=>O.isIntercepted(u,h))||((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 s;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,o)&&(delete e.autoPosition,s=!0),this.nodes.push(e),n&&this.addedNodes.push(e),s||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 _t({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(o={...a},o):{...a})});if(!o)return!1;const s=i.moveNode(o,n)&&i.getRow()<=Math.max(this.getRow(),this.maxRow);if(!s&&!n.resizing&&n.collide){const a=n.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return s?(i.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(d=>d._id===a._id);l&&(O.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const n=new _t({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=O.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,s=O.copyPos({},e,!0);if(O.copyPos(s,n),this.nodeBoundFix(s,i),O.copyPos(n,s),!n.forceCollide&&O.samePos(e,n))return!1;const a=O.copyPos({},e),l=this.collideAll(e,s,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 h=O.areaIntercept(n.rect,u._rect),f=O.area(n.rect),g=O.area(u._rect);h/(f<g?f:g)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,s,u,n):(d=!1,o&&delete n.pack)}return d&&!O.samePos(e,s)&&(e._dirty=!0,O.copyPos(e,s)),n.pack&&this._packNodes()._notify(),!O.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 s;i&&(o?o!==this.column&&(s=this._layouts[o]):this.column!==i-1&&(s=this._layouts[i-1]));const a=[];return this.sortNodes(),this.nodes.forEach(l=>{const d=s?.find(u=>u._id===l._id),c={...l,...d||{}};O.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(s=>{if(!s._orig)return;const a=n.find(l=>l._id===s._id);a&&(a.y>=0&&s.y!==s._orig.y&&(a.y+=s.y-s._orig.y,a.y<0&&(a.y=0)),s.x!==s._orig.x&&(a.x=Math.round(s.x*i),a.x<0&&(a.x=0)),s.w!==s._orig.w&&(a.w=Math.round(s.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 s=[],a=i?this.nodes:O.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(h=>h._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(h=>h._id===c._id);if(u!==-1){const h=a[u];if(i){h.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,s),c.autoPosition||(h.x=c.x??h.x,h.y=c.y??h.y,h.w=c.w??h.w,s.push(h)),a.splice(u,1)}})}if(i)this.compact(o,!1);else{if(a.length)if(typeof o=="function")o(n,e,s,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),s.push(u)}),a=[]}s=O.sort(s,-1),this._inColumnResize=!0,this.nodes=[],s.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((s,a)=>{s._id===void 0&&(s._id=(s.id?this.nodes.find(l=>l.id===s.id):void 0)?._id??_t._idSeq++),i[a]={x:s.x,y:s.y,w:s.w,_id:s._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[n]=i,this}cacheOneLayout(e,n){e._id=e._id??_t._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}};wo._idSeq=0;var De={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"},ue=class{},Re=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),Te=class{};function Cn(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),O.simulateMouseEvent(t.changedTouches[0],e))}function Nr(t,e){t.cancelable&&t.preventDefault(),O.simulateMouseEvent(t,e)}function En(t){Te.touchHandled||(Te.touchHandled=!0,Cn(t,"mousedown"))}function xn(t){Te.touchHandled&&Cn(t,"mousemove")}function Nn(t){if(!Te.touchHandled)return;Te.pointerLeaveTimeout&&(window.clearTimeout(Te.pointerLeaveTimeout),delete Te.pointerLeaveTimeout);const e=!!ue.dragElement;Cn(t,"mouseup"),e||Cn(t,"click"),Te.touchHandled=!1}function kn(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function kr(t){ue.dragElement&&t.pointerType!=="mouse"&&Nr(t,"mouseenter")}function Sr(t){ue.dragElement&&t.pointerType!=="mouse"&&(Te.pointerLeaveTimeout=window.setTimeout(()=>{delete Te.pointerLeaveTimeout,Nr(t,"mouseleave")},10))}var Dr=class Ur{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(`${Ur.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Re&&(this.el.addEventListener("touchstart",En),this.el.addEventListener("pointerdown",kn)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Re&&(this.el.removeEventListener("touchstart",En),this.el.removeEventListener("pointerdown",kn)),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),Re&&(this.el.addEventListener("touchmove",xn),this.el.addEventListener("touchend",Nn)),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),Re&&(this.el.removeEventListener("touchmove",xn),this.el.removeEventListener("touchend",Nn)),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}};Dr.prefix="ui-resizable-";var bo=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)}},Tr=class Eo extends bo{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},s=this.temporalRect||i;return{position:{left:(s.left-o.left)*this.rectScale.x,top:(s.top-o.top)*this.rectScale.y},size:{width:s.width*this.rectScale.x,height:s.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),ue.overResizeElement===this&&delete ue.overResizeElement),this}_mouseOver(e){ue.overResizeElement||ue.dragElement||(ue.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){ue.overResizeElement===this&&(delete ue.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Dr(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=O.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=O.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const n=O.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=O.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=O.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=Eo._originStyleProp.map(o=>this.el.style[o]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,n=O.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 Eo._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},s=e.clientX-o.clientX,a=this.sizeToContent?0:e.clientY-o.clientY;let l,d;n.indexOf("e")>-1?i.width+=s:n.indexOf("w")>-1&&(i.width-=s,i.left+=s,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 s=this.option,a=(o?s.maxWidthMoveLeft:s.maxWidth)||Number.MAX_SAFE_INTEGER,l=s.minWidth/this.rectScale.x||e,d=(i?s.maxHeightMoveUp:s.maxHeight)||Number.MAX_SAFE_INTEGER,c=s.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}};Tr._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var Qf='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Mr=class xo extends bo{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),Re&&(e.addEventListener("touchstart",En),e.addEventListener("pointerdown",kn))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),Re&&(n.removeEventListener("touchstart",En),n.removeEventListener("pointerdown",kn))}),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(Te.touchHandled&&e.isTrusted&&(Te.touchHandled=!1),!ue.mouseHandled)return e.button!==0||!this.dragEls.find(n=>n===e.target)&&e.target.closest(Qf)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete ue.dragElement,delete ue.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Re&&(e.currentTarget.addEventListener("touchmove",xn),e.currentTarget.addEventListener("touchend",Nn)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),ue.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const n=O.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),ue.pauseDrag){const o=Number.isInteger(ue.pauseDrag)?ue.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,ue.dragElement=this;const o=this.el.gridstackNode?.grid;o?ue.dropElement=o.el.ddElement.ddDroppable:delete ue.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=O.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const i=O.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),Re&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",xn,!0),e.currentTarget.removeEventListener("touchend",Nn,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),ue.dropElement?.el===this.el.parentElement&&delete ue.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const n=O.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),ue.dropElement&&ue.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete ue.dragElement,delete ue.dropElement,delete ue.mouseHandled,e.preventDefault()}_keyEvent(e){const n=this.el.gridstackNode,o=n?.grid||ue.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(!O.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",O.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=O.cloneNode(this.el)),e.parentElement||O.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=xo.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",xo.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,s=0;o&&(i=this.dragTransform.xOffset,s=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-s,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}}}};Mr.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var eh=class extends bo{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),Re&&(this.el.addEventListener("pointerenter",kr),this.el.addEventListener("pointerleave",Sr)))}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),Re&&(this.el.removeEventListener("pointerenter",kr),this.el.removeEventListener("pointerleave",Sr)))}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(!ue.dragElement||Te.touchHandled&&t.isTrusted||!this._canDrop(ue.dragElement.el))return;t.preventDefault(),t.stopPropagation(),ue.dropElement&&ue.dropElement!==this&&ue.dropElement._mouseLeave(t,!0),ue.dropElement=this;const e=O.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(ue.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(t,e=!1){if(!ue.dragElement||ue.dropElement!==this)return;t.preventDefault(),t.stopPropagation();const n=O.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(n,this._ui(ue.dragElement)),this.triggerEvent("dropout",n),ue.dropElement===this&&(delete ue.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=O.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(ue.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()}}},th=class Yr{static init(e){return e.ddElement||(e.ddElement=new Yr(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 Mr(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 Tr(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 eh(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},nh=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 s=i.el.gridstackNode.grid;let a=i.el.getAttribute("gs-resize-handles")||s.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");const l=!s.opts.alwaysShowResizeHandle;i.setupResizable({...s.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 s=i.el.gridstackNode.grid;i.setupDraggable({...s.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,ue.dragElement?ue.dragElement.el:i.target,ue.dragElement?ue.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=O.getElements(t);return o.length?o.map(i=>i.ddElement||(n?th.init(i):null)).filter(i=>i):[]}},Ce=new nh,yt=class de{static init(e={},n=".grid-stack"){if(typeof document>"u")return null;const o=de.getGridElement(n);return o?(o.gridstack||(o.gridstack=new de(o,O.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"||(de.getGridElements(n).forEach(i=>{i.gridstack||(i.gridstack=new de(i,O.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 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")||de.addRemoveCB)&&(de.addRemoveCB?o=de.addRemoveCB(e,n,!0,!0):o=O.createDiv(["grid-stack",n.class],e)),de.init(n,o)}static registerEngine(e){de.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=O.createDiv([this.opts.placeholderClass,De.itemClass,this.opts.itemClass]);const e=O.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=O.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 s={...O.cloneDeep(De),column:O.toNumber(e.getAttribute("gs-column"))||De.column,minRow:o||O.toNumber(e.getAttribute("gs-min-row"))||De.minRow,maxRow:o||O.toNumber(e.getAttribute("gs-max-row"))||De.maxRow,staticGrid:O.toBool(e.getAttribute("gs-static"))||De.staticGrid,sizeToContent:O.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||De.draggable.handle},removableOptions:{accept:n.itemClass||De.removableOptions.accept,decline:De.removableOptions.decline}};e.getAttribute("gs-animate")&&(s.animate=O.toBool(e.getAttribute("gs-animate"))),n=O.defaults(n,s),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("."+De.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!==De.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=Re),this._setStaticClass();const l=n.engineClass||de.engineClass||wo;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&&!ue.pauseDrag&&(ue.pauseDrag=!0),n.draggable?.pause!==void 0&&(ue.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:de.addRemoveCB?n=de.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(s=>s._id===o._id))return n;const i=this._readAttr(n);return O.defaults(e,i),this.engine.prepareNode(e),this.el.appendChild(n),this.makeWidget(n,e),n}createWidgetDivs(e){const n=O.createDiv(["grid-stack-item",this.opts.itemClass]),o=O.createDiv(["grid-stack-item-content"],n);return O.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,de.renderCB(o,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(n))):de.renderCB(o,e),n}makeSubGrid(e,n,o,i=!0){let s=e.gridstackNode;if(s||(s=this.makeWidget(e).gridstackNode),s.subGrid?.el)return s.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;n=O.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...n||s.subGridOpts||{}}),s.subGridOpts=n;let d;n.column==="auto"&&(d=!0,n.column=Math.max(s.w||1,o?.w||1),delete n.columnOpts);let c=s.el.querySelector(".grid-stack-item-content"),u,h;if(i&&(this._removeDD(s.el),h={...s,x:0,y:0},O.removeInternalForSave(h),delete h.subGridOpts,s.content&&(h.content=s.content,delete s.content),de.addRemoveCB?u=de.addRemoveCB(this.el,h,!0,!1):(u=O.createDiv(["grid-stack-item"]),u.appendChild(c),c=O.createDiv(["grid-stack-item-content"],s.el)),this.prepareDragDrop(s.el)),o){const g=d?n.column:s.w,p=s.h+o.h,b=s.el.style;b.transition="none",this.update(s.el,{w:g,h:p}),setTimeout(()=>b.transition=null)}const f=s.subGrid=de.addGrid(c,n);return o?._moving&&(f._isTemp=!0),d&&(f._autoColumn=!0),i&&f.makeWidget(u,h),o&&(o._moving?window.setTimeout(()=>O.simulateMouseEvent(o._event,"mouseenter",f.el),0):f.makeWidget(s.el,s)),this.resizeToContentCheck(!1,s),f}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(()=>O.simulateMouseEvent(e._event,"mouseenter",n.el),0))}save(e=!0,n=!1,o=de.saveCB,i){const s=this.engine.save(e,o,i);if(s.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=O.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,O.removeInternalAndSame(a,De),a.children=s,a}return s}load(e,n=de.addRemoveCB||!0){e=O.cloneDeep(e);const o=this.getColumn();e.forEach(u=>{u.w=u.w||u.minW||1,u.h=u.h||u.minH||1}),e=O.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 s=de.addRemoveCB;typeof n=="function"&&(de.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&&(O.find(e,u.id)||(de.addRemoveCB&&de.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=>O.find(e,u.id)?(c.push(u),!1):!0),e.forEach(u=>{const h=O.find(c,u.id);if(h){if(O.shouldSizeToContent(h)&&(u.h=h.h),this.engine.nodeBoundFix(u),(u.autoPosition||u.x===void 0||u.y===void 0)&&(u.w=u.w||h.w,u.h=u.h||h.h,this.engine.findEmptyPosition(u)),this.engine.nodes.push(h),O.samePos(h,u)&&this.engine.nodes.length>1&&(this.moveNode(h,{...u,forceCollide:!0}),O.copyPos(u,h)),this.update(h.el,u),u.subGridOpts?.children){const f=h.el.querySelector(".grid-stack");f&&f.gridstack&&f.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,s?de.addRemoveCB=s:delete de.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=O.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=O.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 s=0;for(;s<e.breakpoints.length&&i<=e.breakpoints[s].w;)o=e.breakpoints[s++].c||n}if(o!==n){const s=e.breakpoints?.find(a=>a.c===o);return this.column(o,s?.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 s=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(s/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=de.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 s;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(s=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),s&&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?(de.getElements(e).forEach(i=>{if(i.parentElement&&i.parentElement!==this.el)return;let s=i.gridstackNode;s||(s=this.engine.nodes.find(a=>i===a.el)),s&&(n&&de.addRemoveCB&&de.addRemoveCB(this.el,s,!1,!1),delete i.gridstackNode,this._removeDD(i),this.engine.removeNode(s,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&&de.addRemoveCB&&de.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 de.getElements(e).forEach(o=>{const i=o?.gridstackNode;if(!i)return;const s={...O.copyPos({},i),...O.cloneDeep(n)};this.engine.nodeBoundFix(s),delete s.autoPosition;const a=["x","y","w","h"];let l;if(a.some(u=>s[u]!==void 0&&s[u]!==i[u])&&(l={},a.forEach(u=>{l[u]=s[u]!==void 0?s[u]:i[u],delete s[u]})),!l&&(s.minW||s.minH||s.maxW||s.maxH)&&(l={}),s.content!==void 0){const u=o.querySelector(".grid-stack-item-content");u&&u.textContent!==s.content&&(i.content=s.content,de.renderCB(u,s),i.subGrid?.el&&(u.appendChild(i.subGrid.el),i.subGrid._updateContainerHeight())),delete s.content}let d=!1,c=!1;for(const u in s)u[0]!=="_"&&i[u]!==s[u]&&(i[u]=s[u],d=!0,c=c||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));if(O.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),de.updateCB&&de.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 s=n.h?n.h*i:e.clientHeight,a;if(n.resizeToContentParent&&(a=e.querySelector(n.resizeToContentParent)),a||(a=e.querySelector(de.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 f=n.subGrid.el.getBoundingClientRect(),g=e.getBoundingClientRect();c+=f.top-g.top}else{if(n.subGridOpts?.children?.length)return;{const f=a.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${n.id} '${de.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=f.getBoundingClientRect().height||d}}if(d===c)return;s+=c-d;let u=Math.ceil(s/i);const h=Number.isInteger(n.sizeToContent)?n.sizeToContent:0;h&&u>h&&(u=h,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){de.resizeToContentCB?de.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,n){return de.getElements(e).forEach(o=>{const i=o.gridstackNode;if(!O.canBeRotated(i))return;const s={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;s.x=i.x+l-(i.h-(d+1)),s.y=i.y+d-l}Object.keys(s).forEach(l=>{s[l]===void 0&&delete s[l]});const a=i._orig;this.update(o,s),i._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const n=O.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 s=O.parseHeight(getComputedStyle(this.el).minHeight);if(s.h>0&&s.unit===i){const a=Math.floor(s.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&&O.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(De.itemClass,this.opts.itemClass);const i=O.shouldSizeToContent(o);return i?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),i&&this.resizeToContentCheck(!1,o),O.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=O.toNumber(e.getAttribute("gs-x")),o.y=O.toNumber(e.getAttribute("gs-y")),o.w=O.toNumber(e.getAttribute("gs-w")),o.h=O.toNumber(e.getAttribute("gs-h")),o.autoPosition=O.toBool(e.getAttribute("gs-auto-position")),o.noResize=O.toBool(e.getAttribute("gs-no-resize")),o.noMove=O.toBool(e.getAttribute("gs-no-move")),o.locked=O.toBool(e.getAttribute("gs-locked"));const i=e.getAttribute("gs-size-to-content");i&&(i==="true"||i==="false"?o.sizeToContent=O.toBool(i):o.sizeToContent=parseInt(i,10)),o.id=e.getAttribute("gs-id"),o.maxW=O.toNumber(e.getAttribute("gs-max-w")),o.minW=O.toNumber(e.getAttribute("gs-min-w")),o.maxH=O.toNumber(e.getAttribute("gs-max-h")),o.minH=O.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 s in o){if(!o.hasOwnProperty(s))return;!o[s]&&o[s]!==0&&s!=="sizeToContent"&&delete o[s]}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)O.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(o=>O.shouldSizeToContent(o))){const o=[...this.engine.nodes];this.batchUpdate(),o.forEach(i=>{O.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=O.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 O.getElement(e)}static getElements(e=".grid-stack-item"){return O.getElements(e)}static getGridElement(e){return de.getElement(e)}static getGridElements(e){return O.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=O.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,n=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(s=>{this.opts[s]===void 0?this.opts[s]=n:(e=O.parseHeight(this.opts[s]),this.opts[s]=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 Ce}static setupDragIn(e,n,o,i=document){n?.pause!==void 0&&(ue.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof e=="string"?O.getElements(e,i):e).forEach((s,a)=>{Ce.isDraggable(s)||Ce.dragIn(s,n),o?.[a]&&(s.gridstackNode=o[a])})}movable(e,n){return this.opts.staticGrid?this:(de.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:(de.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&&de._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Ce.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 Ce.droppable(this.el,"destroy"),this;let e,n;const o=(i,s,a)=>{a=a||s;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const f=a.getBoundingClientRect();a.style.left=f.x+(this.dragTransform.xScale-1)*(i.clientX-f.x)/this.dragTransform.xScale+"px",a.style.top=f.y+(this.dragTransform.yScale-1)*(i.clientY-f.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 h={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)){Ce.off(s,"drag");return}l._willFitPos&&(O.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,i,h,l,n,e)}else this._dragOrResize(a,i,h,l,n,e)};return Ce.droppable(this.el,{accept:i=>{const s=i.gridstackNode||this._readAttr(i,!1);if(s?.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&&s&&this.opts.maxRow){const l={w:s.w,h:s.h,minW:s.minW,minH:s.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(i,s,a)=>{let l=a?.gridstackNode||s.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(s,a),a=a||s,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?(s._gridstackNodeOrig||(s._gridstackNodeOrig=l),s.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),de._itemRemoving(l.el,!1),Ce.on(s,"drag",o),o(i,s,a),!1}).on(this.el,"dropout",(i,s,a)=>{const l=a?.gridstackNode||s.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(s,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(i,s,a)=>{const l=a?.gridstackNode||s.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const d=!!this.placeholder.parentElement,c=s!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode,d&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const u=s._gridstackNodeOrig;if(delete s._gridstackNodeOrig,d&&u?.grid&&u.grid!==this){const f=u.grid;f.engine.removeNodeFromLayoutCache(u),f.engine.removedNodes.push(u),f._triggerRemoveEvent()._triggerChangeEvent(),f.parentGridNode&&!f.engine.nodes.length&&f.opts.subGridDynamic&&f.removeAsSubGrid()}if(!l||(d&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Ce.off(s,"drag"),a!==s?(a.remove(),s=a):s.remove(),this._removeDD(s),!d))return!1;const h=l.subGrid?.el?.gridstack;return O.copyPos(l,this._readAttr(this.placeholder)),O.removePositioningStyles(s),c&&(l.content||l.subGridOpts||de.addRemoveCB)?(delete l.el,s=this.addWidget(l)):(this._prepareElement(s,!0,l),this.el.appendChild(s),this.resizeToContentCheck(!1,l),h&&(h.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&&!Ce.isDroppable(e)&&Ce.droppable(e,this.opts.removableOptions).on(e,"dropover",(n,o)=>de._itemRemoving(o,!0)).on(e,"dropout",(n,o)=>de._itemRemoving(o,!1)),this):this}prepareDragDrop(e,n=!1){const o=e?.gridstackNode;if(!o)return;const i=o.noMove||this.opts.disableDrag,s=o.noResize||this.opts.disableResize,a=this.opts.staticGrid||i&&s;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=(f,g)=>{this.triggerEvent(f,f.target),l=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(e,f,g,o,l,d)},u=(f,g)=>{this._dragOrResize(e,f,g,o,l,d)},h=f=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;const g=o.w!==o._orig.w,p=f.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(o.el=p,o._isAboutToRemove){const b=e.gridstackNode.grid;b._gsEventHandler[f.type]&&b._gsEventHandler[f.type](f,p),b.engine.nodes.push(o),b.removeWidget(e,!0,!0)}else O.removePositioningStyles(p),o._temporaryRemoved?(this._writePosAttr(p,o),this.engine.addNode(o)):this._writePosAttr(p,o),this.triggerEvent(f,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),f.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(g,o))}};Ce.draggable(e,{start:c,stop:h,drag:u}).resizable(e,{start:c,stop:h,resize:u}),o._initDD=!0}return Ce.draggable(e,i?"disable":"enable").resizable(e,s?"disable":"enable"),this}_onStartMoving(e,n,o,i,s,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=O.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=O.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(s,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;Ce.resizable(e,"option","minWidth",s*Math.min(i.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(i.minH||1,d)).resizable(e,"option","maxWidth",s*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",s*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,s,a){const l={...i._orig};let d,c=this.opts.marginLeft,u=this.opts.marginRight,h=this.opts.marginTop,f=this.opts.marginBottom;const g=Math.round(a*.1),p=Math.round(s*.1);if(c=Math.min(c,p),u=Math.min(u,p),h=Math.min(h,g),f=Math.min(f,g),n.type==="drag"){if(i._temporaryRemoved)return;const S=o.position.top-i._prevYPix;i._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&O.updateScrollPosition(e,o.position,S);const D=o.position.left+(o.position.left>i._lastUiPosition.left?-u:c),z=o.position.top+(o.position.top>i._lastUiPosition.top?-f:h);l.x=Math.round(D/s),l.y=Math.round(z/a);const v=this._extraDragRow;if(this.engine.collide(i,l)){const M=this.getRow();let U=Math.max(0,l.y+i.h-M);this.opts.maxRow&&M+U>this.opts.maxRow&&(U=Math.max(0,this.opts.maxRow-M)),this._extraDragRow=U}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||(O.updateScrollResize(n,e,a),l.w=Math.round((o.size.width-c)/s),l.h=Math.round((o.size.height-h)/a),i.w===l.w&&i.h===l.h)||i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;const S=o.position.left+c,D=o.position.top+h;l.x=Math.round(S/s),l.y=Math.round(D/a),d=!0}i._event=n,i._lastTried=l;const b={x:o.position.left+c,y:o.position.top+h,w:(o.size?o.size.width:i.w*s)-c-u,h:(o.size?o.size.height:i.h*a)-h-f};if(this.engine.moveNodeCheck(i,{...l,cellWidth:s,cellHeight:a,rect:b,resizing:d})){i._lastUiPosition=o.position,this.engine.cacheRects(s,a,h,u,f,c),delete i._skipDown,d&&i.subGrid&&i.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const S=n.target;i._sidebarOrig||this._writePosAttr(S,i),this.triggerEvent(n,S)}}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,Ce.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&&de._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}};yt.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)},yt.resizeToContentParent=".grid-stack-item-content",yt.Utils=O,yt.Engine=wo,yt.GDRev="12.4.2";var oh={class:"d-layout"},ih=["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"],rh=(0,r.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,s=(0,r.ref)();let a=null;const l=async()=>{s.value&&(await(0,r.nextTick)(),a&&a.destroy(!1),a=yt.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},s.value),a.on("added",(f,g)=>{const p=g[0];p&&(i("added",d(p)),u())}),a.on("removed",(f,g)=>{const p=g[0];p&&(i("removed",d(p)),u())}),a.on("change",()=>{u(),i("changed",(a?.save()||[]).map(f=>d(f)))}),a.on("dragstart",(f,g)=>{g&&i("dragStart",f,d(g.gridstackNode||g))}),a.on("dragstop",(f,g)=>{g&&i("dragStop",f,d(g.gridstackNode||g))}),a.on("resizestart",(f,g)=>{g&&i("resizeStart",f,d(g.gridstackNode||g))}),a.on("resizestop",(f,g)=>{g&&i("resizeStop",f,d(g.gridstackNode||g))}))},d=f=>({id:f.id||f.el?.getAttribute("gs-id")||"",x:f.x||0,y:f.y||0,w:f.w||1,h:f.h||1,locked:f.locked||!1,noResize:f.noResize||!1,noMove:f.noMove||!1,minW:f.minW,minH:f.minH,maxW:f.maxW,maxH:f.maxH}),c=async()=>{if(!a||!s.value)return;await(0,r.nextTick)();const f=a.engine.nodes;new Set(f.map(p=>p.id));const g=new Set(o.modelValue.map(p=>p.id));f.forEach(p=>{if(!g.has(p.id||"")){const b=p.el;b&&a&&a.removeWidget(b,!1)}}),o.modelValue.forEach(p=>{const b=f.find(S=>S.id===p.id);if(b)b.el&&a&&a.update(b.el,{x:p.x,y:p.y,w:p.w,h:p.h,locked:p.locked,noResize:p.noResize,noMove:p.noMove,minW:p.minW,minH:p.minH,maxW:p.maxW,maxH:p.maxH});else{if(!s.value||!a)return;const S=s.value.querySelector(`[gs-id="${p.id}"]`);S&&a.makeWidget(S)}})},u=()=>{a&&i("update:modelValue",a.save().map(f=>{const g={id:f.id||"",x:f.x||0,y:f.y||0,w:f.w||1,h:f.h||1},p=o.modelValue.find(b=>b.id===g.id);return p&&Object.keys(p).forEach(b=>{["id","x","y","w","h"].includes(b)||(g[b]=p[b])}),g}))},h=(0,r.computed)(()=>o.modelValue);return(0,r.watch)(()=>o.modelValue,async()=>{a&&(await(0,r.nextTick)(),c())},{deep:!0}),(0,r.watch)(()=>[o.column,o.cellHeight,o.draggable,o.resizable,o.disable,o.animate,o.float,o.removable],()=>{l()}),(0,r.onMounted)(()=>{l()}),(0,r.onBeforeUnmount)(()=>{a&&(a.destroy(!1),a=null)}),e({addItem:async f=>{if(a&&s.value){await(0,r.nextTick)();const g=s.value.querySelector(`[gs-id="${f.id}"]`);g&&(a.makeWidget(g),a.update(g,{x:f.x,y:f.y,w:f.w,h:f.h,locked:f.locked,noResize:f.noResize,noMove:f.noMove,minW:f.minW,minH:f.minH,maxW:f.maxW,maxH:f.maxH}))}},removeItem:f=>{if(a&&s.value){const g=s.value.querySelector(`[gs-id="${f}"]`);g&&a.removeWidget(g,!1)}},clear:()=>{a&&a.removeAll(!1)},getGrid:()=>a}),(f,g)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",oh,[(0,r.createElementVNode)("div",{ref_key:"gridContainerRef",ref:s},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(h.value,p=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:p.id,"gs-id":p.id,"gs-x":p.x,"gs-y":p.y,"gs-w":p.w,"gs-h":p.h,"gs-locked":p.locked,"gs-no-resize":p.noResize,"gs-no-move":p.noMove,"gs-min-w":p.minW,"gs-min-h":p.minH,"gs-max-w":p.maxW,"gs-max-h":p.maxH,class:"d-layout-item"},[(0,r.renderSlot)(f.$slots,"item",{item:p})],8,ih))),128))],512)]))}}),sh=rh,Ir=Je(sh),be=(t,e="",n=!1)=>n?`${t}pt`:e?`${t}${e}`:`${t}px`,Ne=(t,e=0)=>t==null||isNaN(t)?0:Number(Number(t).toFixed(e)),ah=t=>t*3/4,lh=t=>t*4/3,ch=["onMousedown"],dh={key:2,class:"d-draggable__mask"},uh=(0,r.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,s=(0,r.ref)(),a=(0,r.ref)(),l=(0,r.ref)(0),d=(0,r.ref)(0),c=(0,r.ref)(0),u=(0,r.ref)(0),h=(0,r.ref)(null),f=(0,r.ref)(!1),g=(0,r.ref)(!1),p=(0,r.ref)(!1),b=(0,r.ref)(!1),S=(0,r.ref)([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),D=(0,r.computed)(()=>o.scale),z=(0,r.computed)(()=>({left:be(D.value,"",o.isPt)})),v=(0,r.computed)(()=>({left:be(-D.value,"",o.isPt)})),M=(0,r.computed)(()=>({left:"auto",right:be(-D.value,"",o.isPt)})),U=(0,r.computed)(()=>({top:be(-D.value,"",o.isPt)})),$=(0,r.computed)(()=>({top:"auto",bottom:be(-D.value,"",o.isPt)})),Q=(0,r.computed)(()=>{const L=8*D.value;return{width:be(L,"",o.isPt),height:be(L,"",o.isPt)}}),q=(0,r.computed)(()=>({fontSize:be(16*D.value,"",o.isPt)})),j=(0,r.computed)(()=>Object.assign((()=>{if(b.value){const L={zIndex:9999,...z.value};return o.isActiveBgTransparent&&(b.value||g.value)&&!o.readonly&&!o.disabled&&(L.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),L}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*D.value,"",o.isPt),...z.value,left:be(c.value,"",o.isPt)}));(0,r.watch)(()=>o.width,L=>{l.value=Ne(G(L))||(h.value?.offsetWidth??0)}),(0,r.watch)(()=>o.height,L=>{d.value=Ne(G(L))||(h.value?.offsetHeight??0)},{deep:!0}),(0,r.watch)(()=>o.left,L=>{c.value=Ne(G(L))}),(0,r.watch)(()=>o.top,L=>{u.value=Ne(G(L))}),(0,r.watch)(l,L=>{s.value&&(s.value.style.width=be(L,"",o.isPt),o.resize&&h.value?.style&&(h.value.style.width=be(L,"",o.isPt)))}),(0,r.watch)(d,L=>{s.value&&(s.value.style.height=be(L,"",o.isPt),o.resize&&h.value?.style&&(h.value.style.height=be(L,"",o.isPt)))}),(0,r.watch)(()=>o.activeFlag,L=>{K(L)});const K=L=>{b.value=L},G=L=>L===void 0?0:o.isPt?lh(L):L,k=()=>{a.value&&a.value.firstChild&&(h.value=a.value.firstChild,l.value=Ne(G(o.width))||(h.value?.offsetWidth??0),d.value=Ne(G(o.height))||(h.value?.offsetHeight??0),c.value=Ne(G(o.left)),u.value=Ne(G(o.top)),K(o.activeFlag))},Y=L=>{c.value=L},w=L=>{u.value=L},V=L=>{const Z=8*D.value/2,P={};return L.split("-").forEach(X=>{P[X]=be(-Z,"",o.isPt)}),P},m=L=>{g.value=L},E=L=>o.isPt?ah(L):L,B=()=>{f.value=!0,i("focus",{index:o.index,width:E(l.value),height:E(d.value),left:E(c.value),top:E(u.value)})},T=()=>{f.value=!1,p.value=!1,i("blur",{index:o.index,width:E(l.value),height:E(d.value),left:E(c.value),top:E(u.value)})},A=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,T()}},H=(L,Z)=>{if(o.disabled||o.readonly)return;let P,X,ne,ie,le,ee;p.value=!0,B();let re=L.clientX,C=L.clientY;document.onmousemove=_=>{f.value=!0,Z==="right"?(P=!0,X=!1):Z==="left"?(P=!0,ne=!0,le=!0,X=!1):Z==="top"?(P=!1,X=!0,ie=!0,ee=!0):Z==="bottom"?(P=!1,X=!0):Z==="bottom-right"?(P=!0,X=!0):Z==="bottom-left"?(P=!0,X=!0,ne=!0,le=!0):Z==="top-right"?(P=!0,X=!0,ie=!0,ee=!0):Z==="top-left"&&(P=!0,X=!0,ne=!0,le=!0,ie=!0,ee=!0);const N=_.clientX-re,x=_.clientY-C;if(re=_.clientX,C=_.clientY,P){let y=N*o.step;le&&(y=-y),ne&&(c.value=Ne(c.value-y)),l.value=Ne(l.value+y)}if(X){let y=x*o.step;ee&&(y=-y),ie&&(u.value=Ne(u.value-y)),d.value=Ne(d.value+y)}},A()},F=()=>{g.value=!1,i("out",{index:o.index,width:E(l.value),height:E(d.value),left:E(c.value),top:E(u.value)})},te=()=>{o.disabled||o.readonly||(g.value=!0,i("over",{index:o.index,width:E(l.value),height:E(d.value),left:E(c.value),top:E(u.value)}))},se=L=>{if(o.disabled||o.readonly)return;b.value=!0,B();let Z=L.clientX,P=L.clientY;document.onmousemove=X=>{const ne=X.clientX-Z,ie=X.clientY-P;Z=X.clientX,P=X.clientY,c.value=Ne(c.value+ne*o.step),u.value=Ne(u.value+ie*o.step)},A()};return(0,r.onMounted)(()=>{k()}),e({setActive:K,setLeft:Y,setTop:w,setOverActive:m}),(L,Z)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["d-draggable",{"d-draggable--active":(b.value||g.value)&&!t.readonly&&!t.disabled},{"d-draggable--pt":t.isPt&&!t.readonly&&!t.disabled},{"d-draggable--move":f.value},{"d-draggable--click":t.disabled}]),onMousedown:(0,r.withModifiers)(se,["stop"]),onMouseover:(0,r.withModifiers)(te,["stop"]),onMouseout:(0,r.withModifiers)(F,["stop"]),style:(0,r.normalizeStyle)(j.value)},[(0,r.createElementVNode)("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:s},[(b.value||g.value||f.value)&&!t.readonly&&!t.disabled?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...U.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...v.value}),class:"d-draggable__line d-draggable__line--top"},null,4),t.isPt?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...U.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...v.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...$.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...M.value}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...$.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...z.value,...M.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:(0,r.normalizeStyle)(q.value)},(0,r.toDisplayString)(c.value)+","+(0,r.toDisplayString)(u.value),5))],64)):(0,r.createCommentVNode)("",!0),!t.readonly&&!t.disabled?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(S.value,(P,X)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:X},[b.value?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:(0,r.normalizeClass)(["d-draggable__range",`d-draggable__range--${P.classname}`]),style:(0,r.normalizeStyle)([Q.value,V(P.classname)]),onMousedown:(0,r.withModifiers)(ne=>H(ne,P.classname),["stop"])},null,46,ch)):(0,r.createCommentVNode)("",!0)],64))),128)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",{class:"d-draggable__item",ref_key:"item",ref:a},[(0,r.renderSlot)(L.$slots,"default")],512),!t.disabled&&t.mask?((0,r.openBlock)(),(0,r.createElementBlock)("div",dh)):(0,r.createCommentVNode)("",!0)],512)],38))}}),fh=uh,Br=Je(fh),zr=t=>{const e=hh(t.components);return{formConfig:t.form,componentList:e}},Rr=(t,e)=>{let n={},o=[];const i={},s=t;n=s.form;const a={};return s.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||[],{formConfig:n,componentList:o,componentDic:i}},Sn=(t,e)=>{const n={ver:"j1",form:{...t},components:[],db:{}};return Ar(e||[],n.components),n},Ar=(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"&&Ar(n.children||[],e),e.push(o)})},hh=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(s=>{if(s==="required"){o.config.required&&i.config?.rule?.push({required:!0,message:o.config.requiredMsg||"请输入"});return}if(s==="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[s]=o.config[s]}),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 s=e[o];if(["j-tabs","j-collapse"].includes(i.type||"")&&i.config?.groups){const a={};s.forEach(l=>{if(l.slot!==void 0&&l.slot!==null){const d=l.slot.toString();a[d]||(a[d]=[]),delete l.slot,a[d].push(l)}}),i.children=i.config.groups.map(l=>{const d=a[l._i]||[],c={label:l.label};l.active&&i.type==="j-collapse"&&(c.active=l.active);let u;if(i.type==="j-tabs"&&i.config?.tabKey&&i.config?.options.length>0){const f=i.config.options.find(g=>g.label===l._i);f&&(u=({formData:g})=>({display:f.value.includes(g[i.config?.tabKey||""])?f.display:!f.display}))}const h={config:c,children:d};return u&&(h.getCompConfig=u),h}),delete i.config.groups}else i.children=s}}),e.form},$r=(t,e,n,o,i,s,a,l)=>{const d=(0,r.ref)(),c=(0,r.reactive)({}),u=(0,r.computed)(()=>{const m=[];return Object.keys(c).forEach(E=>{const B=c[E];B.dragType==="component"&&B.type!=="pkey"&&m.push(B)}),m}),h=(m=[],E)=>{const B=e?.value?.init;typeof B=="function"&&B(m,E)},f=m=>i?i(m,{componentDic:c,components:u.value,configData:d.value.config}):{},g=(m,E)=>{if(d.value?.id===m)return;const B=c[m]||E;if(B?d.value=B:m===n.id?d.value=n:d.value=null,d.value){const T=s[d.value.type];T?(h(T,d.value.config),f(d.value.type)):h([])}else h([]);E&&ye("dragClick",{id:E.id})},p=()=>t.value.$el.getBoundingClientRect(),b=m=>m===n.id?n:c[m]||{},S=m=>{const E=[];if(m===n.id)E.push({id:m,name:n.name});else{const B=c[m];if(B){E.push({id:m,name:B.name});const T=S(B.containerId);E.push(...T)}}return E},D=(m,E)=>{const B=c[E];if(B===void 0)return!1;const T=B.containerId;return m===T?!0:T===n.id?!1:D(m,T)},z=m=>o?o(m)||{}:{},v=(m,E,B,T)=>{if(l){const A=b(m);return l(B.componentType,{container:A,groupId:E,configData:B},T)}return!1},M=({name:m,type:E,dragType:B,isInput:T,componentName:A,runtimeType:H},F,te,se,L=!1)=>{const Z=z(E);if(Z.id=st(),Z.span=24,Z.componentType=E,U(F,Z.componentType))return;v(F,se,Z,!0);const P={id:Z.id,name:m,type:E,runtimeType:H,componentName:A||"",dragType:B||"component",containerId:F,isInput:!!T,level:c[F]?c[F].level+1:1,config:Z,isNewAdd:!L,groupId:se};return P.dragType==="container"&&(P.children=[]),c[P.id]=P,b(F).children?.splice(te,0,P),P},U=(m,E)=>!!(b(m).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(E)),$=(m,E,B=!1)=>{let T=null;const A=b(m).children,H=A?.findIndex(F=>F.id===E)||0;if(B&&A&&A.length>1){let F=H+1;H>0&&(F=H-1),T=A[F]}return A?.splice(H,1),T?.id},Q=(m,E,B,T)=>{const A=b(E).children,H=m.containerId!==E;m.containerId=E,m.groupId=T,A?.splice(B,0,m),v(E,T,m.config,H)&&(Y(),g(m.id))},q=m=>{let E="";const B=b(m);return B&&(B.children&&B.children.length>0&&B.children.forEach(T=>{q(T.id)}),E=$(B.containerId,m,!0)||"",delete c[m]),d.value&&d.value.id===m&&(d.value=null,e.value.init([])),E},j=(m,E=[])=>{const B=b(m);if(B&&B.children&&B.children.length>0){const T=[];B.children.forEach(A=>{A.groupId&&E.includes(A.groupId)&&T.push(A.id)}),T.forEach(A=>{q(A),delete c[A]})}},K=(m,E)=>{const B=b(m);B&&(B.children&&B.children.length>0&&B.children.forEach(T=>{T.groupId===E&&q(T.id)}),delete c[m])},G=m=>{const E=Dn(b(m));E.id=st(),E.config.id=E.id,c[E.id]=E;const B=b(E.containerId).children,T=B?.findIndex(A=>A.id===m)||0;B?.splice(T+1,0,E)},k=()=>{n.children=[],Xr(c),d.value&&(ye("dragClick",{id:""}),d.value=null,e.value.init([]))},Y=()=>{d.value&&(ye("dragClick",{id:""}),d.value=null,e.value.init([]))},w=m=>{const E=d.value,B=b(E.containerId).children,T=B?.findIndex(A=>A.id===E.id)||0;q(E.id),(0,r.nextTick)(()=>{const A=a[m],H=z(m);H.id=E.id,H.span=E.config.span,H.componentType=m,H.table=E.config.table,H.field=E.config.field,E.config.isSubTable&&(H.isSubTable=E.config.isSubTable);const F={id:H.id,name:A.name,type:m,runtimeType:A.runtimeType,componentName:A.componentName||"",dragType:E.dragType,groupId:E.groupId,containerId:E.containerId,isInput:E.isInput,level:E.level,config:H,isNewAdd:!0};c[F.id]=F,B?.splice(T,0,F)})},V=m=>{ye("dragAddByClick",m)};return(0,r.provide)("d-drag-design-provide",{activedComponent:d,getDesignLocals:p,getComponent:b,getParentComponents:S,isMyChildComponent:D,selectComponent:g,addComponent:M,deleteComponent:q,copyComponent:G,removeComponentFromContainer:$,addComponentToContainer:Q,top:n,deleteChildren:K,deleteChildrens:j}),{activedComponent:d,clearComponents:k,changeComponent:w,schemaComponentDic:c,clearSelect:Y,addComponent:M,addComponentByTable:V,designComponentList:u}},gh=(0,r.defineComponent)({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(t,{expose:e}){const n=t,o=(0,r.computed)(()=>n.tableList.map(c=>({label:c.comment?`${c.name}(${c.comment})`:c.name,value:c.name}))),i=(0,r.ref)(),s=[{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 h=n.tableList.find(f=>f.name===u.value);if(h){const f=h.columns.map(g=>({value:g.name,name:g.coment?`${g.name}(${g.coment})`:g.name,type:"input",label:g.coment||g.name,selected:!g.isPrimary}));i.value.setFormData({fields:f})}}};return(0,r.onMounted)(()=>{i.value.init(s)}),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 h=(0,r.resolveComponent)("j-form");return(0,r.openBlock)(),(0,r.createBlock)(h,{ref_key:"formRef",ref:i,"form-config":{labelWidth:"72px"},onChange:a},null,512)}}}),ph=gh,mh=(0,r.defineComponent)({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){const{t:e}=(0,qe.useAppInject)();return{labelWidth:(0,r.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,r.computed)(()=>{const n={...t.componentData?.config};return t.globalConfig.size===void 0&&(n.size=t.globalConfig.size),n.display=!0,n}),t:e}}}),yh=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n};function vh(t,e,n,o,i,s){const a=(0,r.resolveComponent)("j-comp"),l=(0,r.resolveComponent)("el-form-item");return t.componentData.isInput?((0,r.openBlock)(),(0,r.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,r.withCtx)(()=>[(0,r.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,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(t.componentData?.componentName),(0,r.mergeProps)({key:1},t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"])):((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(t.componentData?.componentName),(0,r.normalizeProps)((0,r.mergeProps)({key:2},t.componentData?.config)),null,16))}var Pr=yh(mh,[["render",vh]]),_h={class:"d-form-design j-block"},wh={class:"d-form-design-left"},bh={class:"d-form-design-component-list"},Ch={class:"j-component-tool"},Eh={class:"j-component-tool-name"},xh={class:"d-form-design-center"},Nh={class:"d-form-design-container"},kh={key:0,class:"d-form-design-empty"},Sh={class:"d-form-design-right"},Dh={class:"d-form-design-panel-title"},Th={style:{margin:"0","font-size":"14px"}},Mh={class:"d-form-design-panel"},Ih=(0,r.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:s}=(0,qe.useAppInject)(),a=(0,r.reactive)({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),l=(0,r.ref)([]),d=n.components.length;for(let x=0;x<d;x++)l.value.push(x);n.componentInit&&(a.config=n.componentInit("form")||{});const c=(0,r.ref)([]),u=(0,r.computed)(()=>c.value.map(x=>({label:x.comment?`${x.name}(${x.comment})`:x.name,value:x.name}))),h=(0,r.computed)(()=>{if($.value){const x=U.value.getFormData(!1);if(x.table){const y=c.value.find(R=>R.name===x.table);if(y)return y.columns.map(R=>({value:R.name,label:R.coment?`${R.name}(${R.coment})`:R.name,coment:R.coment}))}}return[]}),f=x=>{c.value=x},g={},p=[];n.components.forEach(({children:x})=>{x.forEach(y=>{g[y.type]=y,y.dragType=y.dragType||"component",y.isInput!==!1&&(y.isInput=!0,p.push({label:y.name,value:y.type}))})});const b=x=>{x.forEach(y=>{y.type==="d-input-flow"&&(y.config=y.config||{},y.config.flowComponents=n.flowComponents,y.config.flowInit=n.flowInit,y.config.flowComponentConfigInit=R=>{n.flowComponentConfigInit&&(R.designComponents=G.value,R.component=$.value,n.flowComponentConfigInit(R))},y.config.flowComponentConfigs=n.flowComponentConfigs,y.config.flowComponentConfigChange=n.flowComponentConfigChange),y.children&&b(y.children)})},S={};Object.keys(n.componentConfigs||{}).forEach(x=>{const{hasBase:y,isInput:R,hasTwoPlaceholder:I,hasPlaceholder:J,hasSpan:W,hasLabel:ce,bindTable:fe,labelTitle:he}=g[x]||{hasBase:!1},Ee=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:R,options:p}},{id:"label",type:"j-input",config:{label:he||"标题"},getCompConfig:({formData:pe})=>({display:ce!==!1&&!pe.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(he||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:pe})=>({display:ce!==!1&&!pe.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:pe})=>({display:R&&!pe.notShowLabel&&!pe.isSubTable})},{id:"placeholder",type:"j-input",config:{display:R&&!I&&J!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!I,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!I,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:pe})=>({display:W!==!1&&!pe.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:pe})=>({display:!!pe.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:R&&fe!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>u},getCompConfig:({formData:pe})=>({display:(R&&fe!==!1||fe===!0)&&(!pe.isSubTable||fe===!0)&&!pe.isNotSave&&!n.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>h},getCompConfig:({formData:pe})=>({display:R&&fe!==!1&&!pe.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:pe})=>({display:R&&fe!==!1&&!pe.isNotSave&&n.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:pe})=>({display:R&&fe!==!1&&!pe.isNotSave&&n.notBindTable&&pe.csType==="string"})}],ke={type:"j-collapse",config:{defaultValue:[]},children:[]};y!==!1&&(ke.children?.push({config:{label:"基础信息"},children:[...Ee]}),ke.config?.defaultValue.push("_collapse0")),ke.children?.push(...n.componentConfigs[x]),b(ke.children||[]),S[x]=[ke]});const D=x=>{const{value:y}=x||{};x.id==="componentType"&&q(y),$.value&&n.componentConfigChange&&(x.id==="field"&&x.data?.coment&&($.value.config.label=x.data?.coment),n.componentConfigChange($.value.type,{configRef:U,configData:$.value.config,...x})),x.id==="table"&&$.value&&$.value.type==="gridtable"&&($.value.children||[]).forEach(R=>{R.isInput&&(R.config.table=y)})},z=(x,y)=>{g[x]?.isInput&&(n.notBindTable&&(y.configData.csType||U.value.setFormData({main:{csType:g[x]?.csType,fieldLen:g[x]?.fieldLen}})),u.value.length===1&&U.value.setFormData({main:{table:u.value[0].value}})),n.componentConfigInit&&n.componentConfigInit(x,{configRef:U,...y,notBindTable:n.notBindTable})},v=(x,y,R)=>{let I=!1;const J=g[x];return y.container.type==="gridtable"?(!y.configData.isSubTable||R)&&(y.configData.isSubTable=!0,J.isInput&&(y.configData.table=y.container.config.table,y.configData.field=""),I=!0):y.configData.isSubTable&&(I=!0,y.configData.isSubTable=!1,J.isInput&&(y.configData.table="")),n.containerAddComponent&&n.containerAddComponent(x,y),I},M=(0,r.ref)(),U=(0,r.ref)(),{activedComponent:$,clearComponents:Q,changeComponent:q,schemaComponentDic:j,addComponentByTable:K,designComponentList:G}=$r(M,U,a,n.componentInit,z,S,g,v),k=(0,r.computed)(()=>$.value?`【${$.value.name}】`:"");(0,r.provide)("dui-design-provide",{designItemName:Pr});const Y=()=>{Q()},w=()=>{n.componentInit&&(a.config=n.componentInit("form")||{}),Q()},V=()=>{let x=0;const y=Sn(a.config,a.children||[]);if(n.notBindTable){const R={};y.components.forEach(W=>{const{isInput:ce,bindTable:fe}=g[W.type]||{hasBase:!1};ce&&fe!==!1?W.config.table&&!R.main&&(R.main={name:W.config.table,comment:"主表",type:"main",pKey:"J_Id"}):fe&&(R[W.id]={name:W.config.table||"t"+new Date().getTime()+x,comment:`子表${W.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},W.config.table=R[W.id].name,x++)}),R.main||(R.main={name:"t"+new Date().getTime()+x,comment:"主表",type:"main",pKey:"J_Id"},x++);let I=0;y.components.forEach(W=>{const{isInput:ce,bindTable:fe}=g[W.type]||{hasBase:!1};!W.config.isNotSave&&ce&&fe!==!1&&(W.config.csType||(W.config.csType=g[W.type]?.csType,W.config.fieldLen=g[W.type]?.fieldLen),W.config.isSubTable?W.config.table=R[W.containerId].name:W.config.table=R.main.name,W.config.field=W.config.field||`f${Math.floor(Date.now()/1e3)}${I}`,I++)});const J=[];Object.keys(R).forEach(W=>{R[W].type==="chlid"&&(R[W].relationName=R.main.name,R[W].comment+=`,关联主表${R.main.name}`),J.push(R[W])}),y.db=J}else{const R={};c.value.forEach(I=>{I.columns.forEach(J=>{R[`${I.name}_${J.name}`]=J.csType})}),y.components.forEach(I=>{I.config.table&&I.config.field&&(I.config.csType=R[`${I.config.table}_${I.config.field}`])})}return n.notBindTable?y.db.forEach(R=>{if(!y.components.find(I=>I.config.table===R.name&&I.config.field==="J_Id")){const I=y.components.find(J=>J.config.table===R.name&&J.config.field);I&&y.components.push({id:R.name+"_J_Id",name:R.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:R.name,field:"J_Id",label:"主键"},containerId:I.containerId,level:I.level})}}):c.value.forEach(R=>{R.columns.forEach(I=>{if(I.isPrimary&&!y.components.find(J=>J.config.table===R.name&&J.config.field===I.name)){const J=y.components.find(W=>W.config.table===R.name&&W.config.field);J&&y.components.push({id:R.name+"_"+I.name,name:R.name+"_"+I.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:R.name,field:I.name,label:"主键"+I.name,isIdentity:I.isIdentity},containerId:J.containerId,level:J.level})}})}),y},m=x=>{const y=Rr(x,g);a.config=y.formConfig,a.children?.push(...y.componentList),Object.keys(y.componentDic).forEach(R=>{j[R]=y.componentDic[R]})},E=()=>T(Sn(a.config,a.children||[]).components,{},{}),B=x=>{const{isInput:y,bindTable:R}=g[x]||{hasBase:!1};if(!y&&R)return!0},T=(x,y,R)=>{if(!n.notBindTable)for(const I of x){const{isInput:J,bindTable:W}=g[I.type]||{hasBase:!1};if(!I.config.isNotSave&&I.type!=="pkey"){if(J&&W!==!1){if((0,qe.isNullOrEmpty)(I.config.table))return s&&s(`请【${I.config.label}】绑定数据表!`),!1;if(!I.config.isSubTable){if(R[I.config.table]&&B(R[I.config.table].type))return s&&s(`【${I.config.label}】和【${R[I.config.table].config.label}】重复绑定【${I.config.table}】表!`),!1;I.config.table&&(R[I.config.table]=I)}}else if(W){if((0,qe.isNullOrEmpty)(I.config.table))return s&&s(`【${I.config.label}】请绑定数据表!`),!1;if(R[I.config.table])return s&&s(`【${I.config.label}】和【${R[I.config.table].config.label}】重复绑定【${I.config.table}】表!`),!1;I.config.table&&(R[I.config.table]=I)}}}for(const I of x){if(!n.notBindTable){const{isInput:J,bindTable:W}=g[I.type]||{hasBase:!1};if(!I.config.isNotSave&&J&&W!==!1){if((0,qe.isNullOrEmpty)(I.config.field))return s&&s(`请【${I.config.label}】绑定表字段!`),!1;if(y[`${I.config.table}-${I.config.field}`])return s&&s(`【${I.config.label}】和【${y[`${I.config.table}-${I.config.field}`].config.label}】重复绑定【${I.config.field}】字段!`),!1;y[`${I.config.table}-${I.config.field}`]=I}}if(n.componentConfigValidate&&!n.componentConfigValidate(I.type,{configData:I.config,errorTip:s}))return!1}return!0},A=(0,r.ref)(),H=(0,r.ref)(),F=(0,r.reactive)({width:0,height:0,formConfig:{}});let te=0;const se=x=>{if(H.value)te=0,H.value.init(x||[]);else{if(te>600){console.warn("表单组件加载超时");return}te++,setTimeout(()=>{se(x)},100)}},L=()=>{},Z=()=>{},P=()=>{const x=Sn(a.config,a.children||[]);F.width=x.form.width||800,F.height=x.form.height||600,A.value.open("表单预览",x.form.layerType),(0,r.nextTick)(()=>{const{formConfig:y,componentList:R}=zr(x);F.formConfig=y,se(R)})},X=(0,r.ref)(),ne=(0,r.ref)(),ie=()=>{const{addList:x,table:y}=ne.value?.ok()||{addList:[]};if(x.length<=0)i&&i("请选择字段!");else{if($.value?.config.componentType==="gridtable"||$.value?.config.isSubTable)if($.value.config.table){if($.value.config.table!==y){i&&i("请设置相同的表和子表!");return}}else{let R=$.value;$.value.config.isSubTable&&(R=j[$.value.containerId]),R.config.table=y,(R.children||[]).forEach(I=>{I.isInput&&(I.config.table=y)}),U.value.setFormData({main:{table:y}})}x.forEach(R=>{const I=(0,qe.deepClone)(g[R.type]);I.config={table:y,field:R.value,label:R.label},K(I)}),X.value.close()}},le=()=>{ne.value?.closed()};return e({setTables:x=>{f(x)},getSchema:()=>V(),setSchema:x=>m(x),reset:()=>w(),validate:()=>E(),preview:P,clear:Y}),(x,y)=>{const R=(0,r.resolveComponent)("j-icon"),I=(0,r.resolveComponent)("d-drag-tool"),J=(0,r.resolveComponent)("el-collapse-item"),W=(0,r.resolveComponent)("el-collapse"),ce=(0,r.resolveComponent)("d-drag-form-list"),fe=(0,r.resolveComponent)("el-row"),he=(0,r.resolveComponent)("d-drag-container"),Ee=(0,r.resolveComponent)("j-form"),ke=(0,r.resolveComponent)("j-layer");return(0,r.openBlock)(),(0,r.createElementBlock)("div",_h,[(0,r.createElementVNode)("div",wh,[(0,r.createElementVNode)("div",bh,[(0,r.createVNode)(W,{modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=pe=>l.value=pe)},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.components,(pe,Wr)=>((0,r.openBlock)(),(0,r.createBlock)(J,{key:Wr,title:pe.name,name:Wr},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(pe.children,(Co,tg)=>((0,r.openBlock)(),(0,r.createBlock)(I,{key:tg,config:Co},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",Ch,[(0,r.createVNode)(R,{class:"j-component-tool-icon",icon:Co.icon,size:14},null,8,["icon"]),(0,r.createElementVNode)("div",Eh,(0,r.toDisplayString)((0,r.unref)(o)(Co.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,r.createElementVNode)("div",xh,[(0,r.createElementVNode)("div",Nh,[(0,r.createVNode)(he,{ref_key:"dragContainer",ref:M,class:"d-form-design-drag-container","is-component-container":!1,"component-data":a},{default:(0,r.withCtx)(()=>[!a.children||a.children.length===0?((0,r.openBlock)(),(0,r.createElementBlock)("div",kh,[...y[1]||(y[1]=[(0,r.createElementVNode)("div",null,"请从左侧拖拽组件到此处",-1)])])):((0,r.openBlock)(),(0,r.createBlock)(fe,{key:1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(ce,{"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),(0,r.withDirectives)((0,r.createElementVNode)("div",Sh,[(0,r.createElementVNode)("div",Dh,[(0,r.createElementVNode)("span",Th,(0,r.toDisplayString)(`${(0,r.unref)(o)("属性配置")}${k.value}`),1)]),(0,r.createElementVNode)("div",Mh,[(0,r.createVNode)(Ee,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:U,onChange:D},null,512)])],512),[[r.vShow,(0,r.unref)($)]]),(0,r.createVNode)(ke,{ref_key:"previewFormLayerRef",ref:A,width:F.width,height:F.height,onOk:L,onClosed:Z},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Ee,{config:F.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:H,actions:t.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),(0,r.createVNode)(ke,{ref_key:"importFormLayerRef",ref:X,width:800,height:600,"btn-text":"确认",onOk:ie,onClosed:le},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(ph,{"component-list":p,"table-list":c.value,ref_key:"importComponentRef",ref:ne},null,8,["table-list"])]),_:1},512)])}}}),Bh=Ih,Or=Je(Bh,[Pr]),Vr=(t,e)=>{const n={ver:"V3",indexPage:{...t},components:[]};return Hr(e||[],n.components),n},Hr=(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"&&Hr(n.children||[],e),e.push(o)})},zh=t=>{const e=Rh(t.components);return{pageConfig:t.indexPage,componentList:e}},Rh=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(s=>{i.config[s]=o.config[s]}),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{const i=n[o];if(i){const s=e[o];if(["j-tabs","j-collapse"].includes(i.type||"")&&i.config?.groups){const a={};s.forEach(l=>{if(l.slot!==void 0&&l.slot!==null){const d=l.slot.toString();a[d]||(a[d]=[]),delete l.slot,a[d].push(l)}}),i.children=i.config.groups.map(l=>{const d=a[l._i]||[];return{config:{label:l.label},children:d}}),delete i.config.groups}else i.children=s}}),e.indexPage||[]},Ah=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const s=t;n=s.indexPage;const a={};s.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}},$h=(0,r.defineComponent)({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){return(e,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(t.componentData?.componentName),(0,r.mergeProps)(t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"]))}}),Lr=$h,Ph={class:"d-index-design j-block"},Oh={class:"d-index-design-left"},Vh={class:"j-component-list"},Hh={class:"j-component-tool"},Lh={class:"j-component-tool-name"},Fh={class:"d-index-design-center"},Gh={class:"design-toolbar"},Wh={class:"design-container"},Uh={key:0,class:"j-block design-empty"},Yh={class:"d-index-design-right"},Xh={class:"d-index-design-panel-title"},jh={style:{margin:"0","font-size":"14px"}},Zh={class:"d-index-design-panel"},Kh=(0,r.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:()=>({})},actions:{type:Object,default:()=>({})}},setup(t,{expose:e}){const{t:n}=(0,qe.useAppInject)(),o=t,i=m=>{m.forEach(E=>{E.type==="d-input-flow"&&(E.config=E.config||{},E.config.flowComponents=o.flowComponents,E.config.flowInit=o.flowInit,E.config.flowComponentConfigInit=B=>{o.flowComponentConfigInit&&(B.designComponents=S.value,B.component=g.value,o.flowComponentConfigInit(B))},E.config.flowComponentConfigs=o.flowComponentConfigs,E.config.flowComponentConfigChange=o.flowComponentConfigChange),E.children&&i(E.children)})},s=(0,r.reactive)({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});o.componentInit&&(s.config=o.componentInit("indexPage")||{});const a={},l=[];o.components.forEach(({children:m})=>{m.forEach(E=>{a[E.type]=E,E.dragType=E.dragType||"component",l.push({label:E.name,value:E.type})})});const d={};Object.keys(o.componentConfigs).forEach(m=>{const{hasBase:E}=a[m]||{hasBase:!1},B=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],T={type:"j-collapse",config:{defaultValue:[]},children:[]};E!==!1&&(T.children?.push({config:{label:"基础信息"},children:[...B]}),T.config?.defaultValue.push("_collapse0")),T.children?.push(...o.componentConfigs[m]),i(T.children||[]),d[m]=[T]});const c=m=>{g.value&&o.componentConfigChange&&o.componentConfigChange(g.value.type,{configRef:f,configData:g.value.config,...m})},u=(m,E)=>{o.componentConfigInit&&o.componentConfigInit(m,{configRef:f,...E})},h=(0,r.ref)(),f=(0,r.ref)(),{activedComponent:g,clearComponents:p,schemaComponentDic:b,designComponentList:S}=$r(h,f,s,o.componentInit,u,d,a,o.containerAddComponent),D=(0,r.computed)(()=>g.value?`【${g.value.name}】`:""),z=(0,r.ref)([]),v=o.components.length;for(let m=0;m<v;m++)z.value.push(m);(0,r.provide)("dui-design-provide",{designItemName:Lr});const M=()=>{p()},U=()=>{o.componentInit&&(s.config=o.componentInit("indexPage")||{}),p()},$=()=>(console.log("pValidate"),!0),Q=()=>Vr(s.config,s.children||[]),q=m=>{const E=Ah(m,a);s.config=E.pageConfig,s.children?.push(...E.componentList),Object.keys(E.componentDic).forEach(B=>{b[B]=E.componentDic[B]})},j=(0,r.ref)(),K=(0,r.ref)();(0,r.ref)(""),(0,r.reactive)({formConfig:{}});let G=0;const k=m=>{if(K.value)G=0,K.value.init(m);else{if(G>600){console.warn("组件加载超时");return}G++,setTimeout(()=>{k(m)},100)}},Y=()=>{},w=()=>{},V=()=>{const{componentList:m}=zh(Vr(s.config,s.children||[]));j.value.open("页面预览","full"),(0,r.nextTick)(()=>{k(m)})};return e({reset:U,validate:$,getSchema:Q,setSchema:q}),(m,E)=>{const B=(0,r.resolveComponent)("j-icon"),T=(0,r.resolveComponent)("d-drag-tool"),A=(0,r.resolveComponent)("el-collapse-item"),H=(0,r.resolveComponent)("el-collapse"),F=(0,r.resolveComponent)("j-button"),te=(0,r.resolveComponent)("el-tooltip"),se=(0,r.resolveComponent)("el-divider"),L=(0,r.resolveComponent)("el-empty"),Z=(0,r.resolveComponent)("d-drag-index-list"),P=(0,r.resolveComponent)("d-drag-container"),X=(0,r.resolveComponent)("j-form"),ne=(0,r.resolveComponent)("j-page"),ie=(0,r.resolveComponent)("j-layer");return(0,r.openBlock)(),(0,r.createElementBlock)("div",Ph,[(0,r.createElementVNode)("div",Oh,[E[1]||(E[1]=(0,r.createElementVNode)("div",{class:"d-index-design-panel-title"},"组件库",-1)),(0,r.createElementVNode)("div",Vh,[(0,r.createVNode)(H,{modelValue:z.value,"onUpdate:modelValue":E[0]||(E[0]=le=>z.value=le)},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.components,(le,ee)=>((0,r.openBlock)(),(0,r.createBlock)(A,{key:ee,title:le.name,name:ee},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(le.children,(re,C)=>((0,r.openBlock)(),(0,r.createBlock)(T,{key:C,config:re},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",Hh,[(0,r.createVNode)(B,{class:"j-component-tool-icon",icon:re.icon,size:14},null,8,["icon"]),(0,r.createElementVNode)("div",Lh,(0,r.toDisplayString)((0,r.unref)(n)(re.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,r.createElementVNode)("div",Fh,[(0,r.createElementVNode)("div",Gh,[E[2]||(E[2]=(0,r.createElementVNode)("div",null,null,-1)),(0,r.createElementVNode)("div",null,[(0,r.createVNode)(te,{content:(0,r.unref)(n)("清空")},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(F,{danger:"",type:"text",onClick:M,icon:"mdi:delete-outline"})]),_:1},8,["content"]),(0,r.createVNode)(se,{direction:"vertical"}),(0,r.createVNode)(te,{content:(0,r.unref)(n)("预览")},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(F,{type:"text",onClick:V,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),(0,r.createElementVNode)("div",Wh,[(0,r.createVNode)(P,{ref_key:"dragContainer",ref:h,class:"design-drag-container","is-component-container":!1,"component-data":s},{default:(0,r.withCtx)(()=>[!s.children||s.children.length===0?((0,r.openBlock)(),(0,r.createElementBlock)("div",Uh,[(0,r.createVNode)(L,{description:(0,r.unref)(n)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):((0,r.openBlock)(),(0,r.createBlock)(Z,{key:1,"component-list":s.children,"global-config":s.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),(0,r.withDirectives)((0,r.createElementVNode)("div",Yh,[(0,r.createElementVNode)("div",Xh,[(0,r.createElementVNode)("span",jh,(0,r.toDisplayString)(`${(0,r.unref)(n)("属性配置")}${D.value}`),1)]),(0,r.createElementVNode)("div",Zh,[(0,r.createVNode)(X,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:f,onChange:c},null,512)])],512),[[r.vShow,(0,r.unref)(g)&&d[(0,r.unref)(g).type]]]),(0,r.createVNode)(ie,{ref_key:"previewLayerRef",ref:j,"has-btns":!1,onOk:Y,onClosed:w},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(ne,{ref_key:"previewRef",ref:K,actions:t.actions},null,8,["actions"])]),_:1},512)])}}}),qh=Kh,Fr=Je(qh,[Lr]),Jh=[Do,In,Bn,zn,Rn,Er,xr,Ir,Br,Or,Fr],Gr=new WeakSet,Qh=t=>{Gr.has(t)||(Gr.add(t),Jh.forEach(e=>{const n=e.name;n&&t.component(n,e)}))},eg={install:Qh};me.DDrag=Do,me.DDraggable=Br,me.DFlowDesign=Er,me.DFormDesign=Or,me.DIndexDesign=Fr,me.DInputFlow=xr,me.DLayout=Ir,me.default=eg,me.dragContainer=Bn,me.dragFormList=zn,me.dragIndexList=Rn,me.dragTool=In,me.toFormDesignSchema=Rr,me.toFormSaveSchema=Sn,me.toFormSchema=zr});
6
+ `).map(c=>c.trim().toLowerCase());if(o.length===1)return e.toLowerCase()===A.toLowerCase();n||t.add(e.toLowerCase());const a=o.every((c,d)=>t.has(c)&&Array.from(t.values())[d]===o[d]);return n&&t.delete(e.toLowerCase()),a}function kh(e,A){return t=>{if(!t.code&&!t.key)return!1;const n=Mh(t.code,e);return Array.isArray(e)?e.some(o=>oa(t[n],o,A,t.type==="keyup")):oa(t[n],e,A,t.type==="keyup")}}function Mh(e,A){return A.includes(e)?"code":"key"}function In(e,A){const t=(0,r.computed)(()=>(0,r.toValue)(A?.target)??Lh),n=(0,r.shallowRef)((0,r.toValue)(e)===!0);let o=!1;const a=new Set;let c=h((0,r.toValue)(e));(0,r.watch)(()=>(0,r.toValue)(e),(g,B)=>{typeof B=="boolean"&&typeof g!="boolean"&&d(),c=h(g)},{immediate:!0}),ds(["blur","contextmenu"],d),fs((...g)=>c(...g),g=>{var B,w;const m=(0,r.toValue)(A?.actInsideInputWithModifier)??!0,y=(0,r.toValue)(A?.preventDefault)??!1;if(o=Th(g),(!o||o&&!m)&&ti(g))return;const v=((w=(B=g.composedPath)==null?void 0:B.call(g))==null?void 0:w[0])||g.target,I=v?.nodeName==="BUTTON"||v?.nodeName==="A";!y&&(o||!I)&&g.preventDefault(),n.value=!0},{eventName:"keydown",target:t}),fs((...g)=>c(...g),g=>{const B=(0,r.toValue)(A?.actInsideInputWithModifier)??!0;if(n.value){if((!o||o&&!B)&&ti(g))return;o=!1,n.value=!1}},{eventName:"keyup",target:t});function d(){o=!1,a.clear(),n.value=(0,r.toValue)(e)===!0}function h(g){return g===null?(d(),()=>!1):typeof g=="boolean"?(d(),n.value=g,()=>!1):Array.isArray(g)||typeof g=="string"?kh(g,a):g}return n}var ia="vue-flow__node-desc",sa="vue-flow__edge-desc",Oh="vue-flow__aria-live",aa=["Enter"," ","Escape"],Wt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Cr(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function yr(e,A){const t=Math.max(0,Math.min(e.x+e.width,A.x+A.width)-Math.max(e.x,A.x)),n=Math.max(0,Math.min(e.y+e.height,A.y+A.height)-Math.max(e.y,A.y));return Math.ceil(t*n)}function vr(e){return{width:e.offsetWidth,height:e.offsetHeight}}function xt(e,A=0,t=1){return Math.min(Math.max(e,A),t)}function la(e,A){return{x:xt(e.x,A[0][0],A[1][0]),y:xt(e.y,A[0][1],A[1][1])}}function ca(e){const A=e.getRootNode();return"elementFromPoint"in A?A:window.document}function dt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Dt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!dt(e)}function Hn(e){return Dt(e)&&"computedPosition"in e}function Qr(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Kh(e){return Qr(e.width)&&Qr(e.height)&&Qr(e.x)&&Qr(e.y)}function Rh(e,A,t){const n={id:e.id.toString(),type:e.type??"default",dimensions:(0,r.markRaw)({width:0,height:0}),computedPosition:(0,r.markRaw)({z:0,...e.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:le(e.data)?e.data:{},events:(0,r.markRaw)(le(e.events)?e.events:{})};return Object.assign(A??n,e,{id:e.id.toString(),parentNode:t})}function ua(e,A,t){var n,o;const a={id:e.id.toString(),type:e.type??A?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(n=e.sourceHandle)==null?void 0:n.toString(),targetHandle:(o=e.targetHandle)==null?void 0:o.toString(),updatable:e.updatable??t?.updatable,selectable:e.selectable??t?.selectable,focusable:e.focusable??t?.focusable,data:le(e.data)?e.data:{},events:(0,r.markRaw)(le(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??t?.interactionWidth,...t??{}};return Object.assign(A??a,e,{id:e.id.toString()})}function da(e,A,t,n){const o=typeof e=="string"?e:e.id,a=new Set,c=n==="source"?"target":"source";for(const d of t)d[c]===o&&a.add(d[n]);return A.filter(d=>a.has(d.id))}function Vh(...e){if(e.length===3){const[o,a,c]=e;return da(o,a,c,"target")}const[A,t]=e,n=typeof A=="string"?A:A.id;return t.filter(o=>dt(o)&&o.source===n).map(o=>t.find(a=>Dt(a)&&a.id===o.target))}function Ph(...e){if(e.length===3){const[o,a,c]=e;return da(o,a,c,"source")}const[A,t]=e,n=typeof A=="string"?A:A.id;return t.filter(o=>dt(o)&&o.target===n).map(o=>t.find(a=>Dt(a)&&a.id===o.source))}function fa({source:e,sourceHandle:A,target:t,targetHandle:n}){return`vueflow__edge-${e}${A??""}-${t}${n??""}`}function Gh(e,A){return A.some(t=>dt(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function _n({x:e,y:A},{x:t,y:n,zoom:o}){return{x:e*o+t,y:A*o+n}}function Sn({x:e,y:A},{x:t,y:n,zoom:o},a=!1,c=[1,1]){const d={x:(e-t)/o,y:(A-n)/o};return a?Fr(d,c):d}function zh(e,A){return{x:Math.min(e.x,A.x),y:Math.min(e.y,A.y),x2:Math.max(e.x2,A.x2),y2:Math.max(e.y2,A.y2)}}function ga({x:e,y:A,width:t,height:n}){return{x:e,y:A,x2:e+t,y2:A+n}}function $h({x:e,y:A,x2:t,y2:n}){return{x:e,y:A,width:t-e,height:n-A}}function ha(e){let A={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let t=0;t<e.length;t++){const n=e[t];A=zh(A,ga({...n.computedPosition,...n.dimensions}))}return $h(A)}function Ba(e,A,t={x:0,y:0,zoom:1},n=!1,o=!1){const a={...Sn(A,t),width:A.width/t.zoom,height:A.height/t.zoom},c=[];for(const d of e){const{dimensions:h,selectable:g=!0,hidden:B=!1}=d,w=h.width??d.width??null,m=h.height??d.height??null;if(o&&!g||B)continue;const y=yr(a,Cr(d)),v=w===null||m===null,I=n&&y>0,L=(w??0)*(m??0);(v||I||y>=L||d.dragging)&&c.push(d)}return c}function pa(e,A){const t=new Set;if(typeof e=="string")t.add(e);else if(e.length>=1)for(const n of e)t.add(n.id);return A.filter(n=>t.has(n.source)||t.has(n.target))}function Yt(e,A){if(typeof e=="number")return Math.floor((A-A/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return Math.floor(A*t*.01)}return Dn(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Xh(e,A,t){if(typeof e=="string"||typeof e=="number"){const n=Yt(e,t),o=Yt(e,A);return{top:n,right:o,bottom:n,left:o,x:o*2,y:n*2}}if(typeof e=="object"){const n=Yt(e.top??e.y??0,t),o=Yt(e.bottom??e.y??0,t),a=Yt(e.left??e.x??0,A),c=Yt(e.right??e.x??0,A);return{top:n,right:c,bottom:o,left:a,x:a+c,y:n+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Wh(e,A,t,n,o,a){const{x:c,y:d}=_n(e,{x:A,y:t,zoom:n}),{x:h,y:g}=_n({x:e.x+e.width,y:e.y+e.height},{x:A,y:t,zoom:n}),B=o-h,w=a-g;return{left:Math.floor(c),top:Math.floor(d),right:Math.floor(B),bottom:Math.floor(w)}}function ma(e,A,t,n,o,a=.1){const c=Xh(a,A,t),d=(A-c.x)/e.width,h=(t-c.y)/e.height,g=xt(Math.min(d,h),n,o),B=e.x+e.width/2,w=e.y+e.height/2,m=A/2-B*g,y=t/2-w*g,v=Wh(e,m,y,g,A,t),I={left:Math.min(v.left-c.left,0),top:Math.min(v.top-c.top,0),right:Math.min(v.right-c.right,0),bottom:Math.min(v.bottom-c.bottom,0)};return{x:m-I.left+I.right,y:y-I.top+I.bottom,zoom:g}}function Yh(e,A){return{x:A.x+e.x,y:A.y+e.y,z:(e.z>A.z?e.z:A.z)+1}}function wa(e,A){if(!e.parentNode)return!1;const t=A.get(e.parentNode);return t?t.selected?!0:wa(t,A):!1}function xn(e,A){return typeof e>"u"?"":typeof e=="string"?e:`${A?`${A}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}function Ca(e){const A=e.ctrlKey&&Er()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*A}function ya(e,A,t){return e<A?xt(Math.abs(e-A),1,A)/A:e>t?-xt(Math.abs(e-t),1,A)/A:0}function va(e,A,t=15,n=40){return[ya(e.x,n,A.width-n)*t,ya(e.y,n,A.height-n)*t]}function ni(e,A){if(A){const t=e.position.x+e.dimensions.width-A.dimensions.width,n=e.position.y+e.dimensions.height-A.dimensions.height;if(t>0||n>0||e.position.x<0||e.position.y<0){let o={};if(typeof A.style=="function"?o={...A.style(A)}:A.style&&(o={...A.style}),o.width=o.width??`${A.dimensions.width}px`,o.height=o.height??`${A.dimensions.height}px`,t>0)if(typeof o.width=="string"){const a=Number(o.width.replace("px",""));o.width=`${a+t}px`}else o.width+=t;if(n>0)if(typeof o.height=="string"){const a=Number(o.height.replace("px",""));o.height=`${a+n}px`}else o.height+=n;if(e.position.x<0){const a=Math.abs(e.position.x);if(A.position.x=A.position.x-a,typeof o.width=="string"){const c=Number(o.width.replace("px",""));o.width=`${c+a}px`}else o.width+=a;e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);if(A.position.y=A.position.y-a,typeof o.height=="string"){const c=Number(o.height.replace("px",""));o.height=`${c+a}px`}else o.height+=a;e.position.y=0}A.dimensions.width=Number(o.width.toString().replace("px","")),A.dimensions.height=Number(o.height.toString().replace("px","")),typeof A.style=="function"?A.style=a=>{const c=A.style;return{...c(a),...o}}:A.style={...A.style,...o}}}}function Qa(e,A){var t,n;const o=e.filter(c=>c.type==="add"||c.type==="remove");for(const c of o)if(c.type==="add")A.findIndex(d=>d.id===c.item.id)===-1&&A.push(c.item);else if(c.type==="remove"){const d=A.findIndex(h=>h.id===c.id);d!==-1&&A.splice(d,1)}const a=A.map(c=>c.id);for(const c of A)for(const d of e)if(d.id===c.id)switch(d.type){case"select":c.selected=d.selected;break;case"position":if(Hn(c)&&(typeof d.position<"u"&&(c.position=d.position),typeof d.dragging<"u"&&(c.dragging=d.dragging),c.expandParent&&c.parentNode)){const h=A[a.indexOf(c.parentNode)];h&&Hn(h)&&ni(c,h)}break;case"dimensions":if(Hn(c)&&(typeof d.dimensions<"u"&&(c.dimensions=d.dimensions),typeof d.updateStyle<"u"&&d.updateStyle&&(c.style={...c.style||{},width:`${(t=d.dimensions)==null?void 0:t.width}px`,height:`${(n=d.dimensions)==null?void 0:n.height}px`}),typeof d.resizing<"u"&&(c.resizing=d.resizing),c.expandParent&&c.parentNode)){const h=A[a.indexOf(c.parentNode)];h&&Hn(h)&&(h.dimensions.width&&h.dimensions.height?ni(c,h):(0,r.nextTick)(()=>{ni(c,h)}))}break}return A}function ft(e,A){return{id:e,type:"select",selected:A}}function Ea(e){return{item:e,type:"add"}}function Fa(e){return{id:e,type:"remove"}}function Ua(e,A,t,n,o){return{id:e,source:A,target:t,sourceHandle:n||null,targetHandle:o||null,type:"remove"}}function gt(e,A=new Set,t=!1){const n=[];for(const[o,a]of e){const c=A.has(o);!(a.selected===void 0&&!c)&&a.selected!==c&&(t&&(a.selected=c),n.push(ft(a.id,c)))}return n}var ba=()=>{};function EA(e){const A=new Set;let t=ba,n=()=>!1;const o=()=>A.size>0||n(),a=m=>{t=m},c=()=>{t=ba},d=m=>{n=m},h=()=>{n=()=>!1},g=m=>{A.delete(m)};return{on:m=>{A.add(m);const y=()=>g(m);return hn(y),{off:y}},off:g,trigger:m=>{const y=[t];return o()?y.push(...A):e&&y.push(e),Promise.allSettled(y.map(v=>v(m)))},hasListeners:o,listeners:A,setEmitter:a,removeEmitter:c,setHasEmitListeners:d,removeHasEmitListeners:h}}function Ia(e,A,t){let n=e;do{if(n&&n.matches(A))return!0;if(n===t)return!1;n=n.parentElement}while(n);return!1}function Jh(e,A,t,n){var o,a;const c=new Map;for(const[d,h]of e)(h.selected||h.id===n)&&(!h.parentNode||!wa(h,e))&&(h.draggable||A&&typeof h.draggable>"u")&&e.get(d)&&c.set(d,{id:h.id,position:h.position||{x:0,y:0},distance:{x:t.x-((o=h.computedPosition)==null?void 0:o.x)||0,y:t.y-((a=h.computedPosition)==null?void 0:a.y)||0},from:{x:h.computedPosition.x,y:h.computedPosition.y},extent:h.extent,parentNode:h.parentNode,dimensions:{...h.dimensions},expandParent:h.expandParent});return Array.from(c.values())}function ri({id:e,dragItems:A,findNode:t}){const n=[];for(const o of A){const a=t(o.id);a&&n.push(a)}return[e?n.find(o=>o.id===e):n[0],n]}function Ha(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function Zh(e,A,t){const[n,o,a,c]=typeof e!="string"?Ha(e.padding):[0,0,0,0];return t&&typeof t.computedPosition.x<"u"&&typeof t.computedPosition.y<"u"&&typeof t.dimensions.width<"u"&&typeof t.dimensions.height<"u"?[[t.computedPosition.x+c,t.computedPosition.y+n],[t.computedPosition.x+t.dimensions.width-o,t.computedPosition.y+t.dimensions.height-a]]:!1}function jh(e,A,t,n){let o=e.extent||t;if((o==="parent"||!Array.isArray(o)&&o?.range==="parent")&&!e.expandParent)if(e.parentNode&&n&&e.dimensions.width&&e.dimensions.height){const a=Zh(o,e,n);a&&(o=a)}else A(new de(ae.NODE_EXTENT_INVALID,e.id)),o=t;else if(Array.isArray(o)){const a=n?.computedPosition.x||0,c=n?.computedPosition.y||0;o=[[o[0][0]+a,o[0][1]+c],[o[1][0]+a,o[1][1]+c]]}else if(o!=="parent"&&o?.range&&Array.isArray(o.range)){const[a,c,d,h]=Ha(o.padding),g=n?.computedPosition.x||0,B=n?.computedPosition.y||0;o=[[o.range[0][0]+g+h,o.range[0][1]+B+a],[o.range[1][0]+g-c,o.range[1][1]+B-d]]}return o==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:o}function qh({width:e,height:A},t){return[t[0],[t[1][0]-(e||0),t[1][1]-(A||0)]]}function oi(e,A,t,n,o){const a=la(A,qh(e.dimensions,jh(e,t,n,o)));return{position:{x:a.x-(o?.computedPosition.x||0),y:a.y-(o?.computedPosition.y||0)},computedPosition:a}}function Jt(e,A,t=HA.Left,n=!1){const o=(A?.x??0)+e.computedPosition.x,a=(A?.y??0)+e.computedPosition.y,{width:c,height:d}=A??nB(e);if(n)return{x:o+c/2,y:a+d/2};switch(A?.position??t){case HA.Top:return{x:o+c/2,y:a};case HA.Right:return{x:o+c,y:a+d/2};case HA.Bottom:return{x:o+c/2,y:a+d};case HA.Left:return{x:o,y:a+d/2}}}function _a(e,A){return e&&(A?e.find(t=>t.id===A):e[0])||null}function AB({sourcePos:e,targetPos:A,sourceWidth:t,sourceHeight:n,targetWidth:o,targetHeight:a,width:c,height:d,viewport:h}){const g={x:Math.min(e.x,A.x),y:Math.min(e.y,A.y),x2:Math.max(e.x+t,A.x+o),y2:Math.max(e.y+n,A.y+a)};g.x===g.x2&&(g.x2+=1),g.y===g.y2&&(g.y2+=1);const B=ga({x:(0-h.x)/h.zoom,y:(0-h.y)/h.zoom,width:c/h.zoom,height:d/h.zoom}),w=Math.max(0,Math.min(B.x2,g.x2)-Math.max(B.x,g.x)),m=Math.max(0,Math.min(B.y2,g.y2)-Math.max(B.y,g.y));return Math.ceil(w*m)>0}function eB(e,A,t=!1){const n=typeof e.zIndex=="number";let o=n?e.zIndex:0;const a=A(e.source),c=A(e.target);return!a||!c?0:(t&&(o=n?e.zIndex:Math.max(a.computedPosition.z||0,c.computedPosition.z||0)),o)}var ae=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(ae||{}),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:e=>`Node is invalid
7
+ Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
8
+ Node: ${e}`,NODE_MISSING_PARENT:(e,A)=>`Node is missing a parent
9
+ Node: ${e}
10
+ Parent: ${A}`,NODE_TYPE_MISSING:e=>`Node type is missing
11
+ Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
12
+ Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
13
+ Edge: ${e}`,EDGE_SOURCE_MISSING:(e,A)=>`Edge source is missing
14
+ Edge: ${e}
15
+ Source: ${A}`,EDGE_TARGET_MISSING:(e,A)=>`Edge target is missing
16
+ Edge: ${e}
17
+ Target: ${A}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
18
+ Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,A,t)=>`Edge source and target are the same
19
+ Edge: ${e}
20
+ Source: ${A}
21
+ Target: ${t}`,EDGE_SOURCE_TARGET_MISSING:(e,A,t)=>`Edge source or target is missing
22
+ Edge: ${e}
23
+ Source: ${A}
24
+ Target: ${t}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
25
+ Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
26
+ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"},de=class extends Error{constructor(e,...A){var t;super((t=Sa[e])==null?void 0:t.call(Sa,...A)),this.name="VueFlowError",this.code=e,this.args=A}};function ii(e){return"clientX"in e}function tB(e){return"sourceEvent"in e}function $e(e,A){const t=ii(e);let n,o;return t?(n=e.clientX,o=e.clientY):"touches"in e&&e.touches.length>0?(n=e.touches[0].clientX,o=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(n=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY):(n=0,o=0),{x:n-(A?.left??0),y:o-(A?.top??0)}}var Er=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function nB(e){var A,t;return{width:((A=e.dimensions)==null?void 0:A.width)??e.width??0,height:((t=e.dimensions)==null?void 0:t.height)??e.height??0}}function Fr(e,A=[1,1]){return{x:A[0]*Math.round(e.x/A[0]),y:A[1]*Math.round(e.y/A[1])}}var rB=()=>!0;function si(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function oB(e,A,t){const n=[],o={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const a of A.values())yr(o,Cr(a))>0&&n.push(a);return n}var iB=250;function sB(e,A,t,n){var o,a;let c=[],d=Number.POSITIVE_INFINITY;const h=oB(e,t,A+iB);for(const g of h){const B=[...((o=g.handleBounds)==null?void 0:o.source)??[],...((a=g.handleBounds)==null?void 0:a.target)??[]];for(const w of B){if(n.nodeId===w.nodeId&&n.type===w.type&&n.id===w.id)continue;const{x:m,y}=Jt(g,w,w.position,!0),v=Math.sqrt((m-e.x)**2+(y-e.y)**2);v>A||(v<d?(c=[{...w,x:m,y}],d=v):v===d&&c.push({...w,x:m,y}))}}if(!c.length)return null;if(c.length>1){const g=n.type==="source"?"target":"source";return c.find(B=>B.type===g)??c[0]}return c[0]}function xa(e,{handle:A,connectionMode:t,fromNodeId:n,fromHandleId:o,fromType:a,doc:c,lib:d,flowId:h,isValidConnection:g=rB},B,w,m,y){const v=a==="target",I=A?c.querySelector(`.${d}-flow__handle[data-id="${h}-${A?.nodeId}-${A?.id}-${A?.type}"]`):null,{x:L,y:k}=$e(e),V=c.elementFromPoint(L,k),F=V?.classList.contains(`${d}-flow__handle`)?V:I,M={handleDomNode:F,isValid:!1,connection:null,toHandle:null};if(F){const tA=Da(void 0,F),W=F.getAttribute("data-nodeid"),aA=F.getAttribute("data-handleid"),dA=F.classList.contains("connectable"),rA=F.classList.contains("connectableend");if(!W||!tA)return M;const oA={source:v?W:n,sourceHandle:v?aA:o,target:v?n:W,targetHandle:v?o:aA};M.connection=oA,M.isValid=dA&&rA&&(t===tt.Strict?v&&tA==="source"||!v&&tA==="target":W!==n||aA!==o)&&g(oA,{nodes:w,edges:B,sourceNode:m(oA.source),targetNode:m(oA.target)}),M.toHandle=Na(W,tA,aA,y,t,!0)}return M}function Da(e,A){return e||(A?.classList.contains("target")?"target":A?.classList.contains("source")?"source":null)}function aB(e,A){let t=null;return A?t="valid":e&&!A&&(t="invalid"),t}function lB(e,A){let t=null;return A?t=!0:e&&!A&&(t=!1),t}function Na(e,A,t,n,o,a=!1){var c,d,h;const g=n.get(e);if(!g)return null;const B=o===tt.Strict?(c=g.handleBounds)==null?void 0:c[A]:[...((d=g.handleBounds)==null?void 0:d.source)??[],...((h=g.handleBounds)==null?void 0:h.target)??[]],w=(t?B?.find(m=>m.id===t):B?.[0])??null;return w&&a?{...w,...Jt(g,w,w.position,!0)}:w}var ai={[HA.Left]:HA.Right,[HA.Right]:HA.Left,[HA.Top]:HA.Bottom,[HA.Bottom]:HA.Top},cB=["production","prod"];function Dn(e,...A){La()&&console.warn(`[Vue Flow]: ${e}`,...A)}function La(){return!cB.includes(process.env.NODE_ENV||"")}function Ta(e,A,t,n,o){const a=A.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:o,position:c.getAttribute("data-handlepos"),x:(d.left-t.left)/n,y:(d.top-t.top)/n,...vr(c)}}):null}function li(e,A,t,n,o,a=!1,c){o.value=!1,e.selected?(a||e.selected&&A)&&(n([e]),(0,r.nextTick)(()=>{c.blur()})):t([e])}function le(e){return typeof(0,r.unref)(e)<"u"}function uB(e,A,t,n){if(!e||!e.source||!e.target)return t(new de(ae.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let o;return dt(e)?o=e:o={...e,id:fa(e)},o=ua(o,void 0,n),Gh(o,A)?!1:o}function dB(e,A,t,n,o){if(!A.source||!A.target)return o(new de(ae.EDGE_INVALID,e.id)),!1;if(!t)return o(new de(ae.EDGE_NOT_FOUND,e.id)),!1;const{id:a,...c}=e;return{...c,id:n?fa(A):a,source:A.source,target:A.target,sourceHandle:A.sourceHandle,targetHandle:A.targetHandle}}function ka(e,A,t){const n={},o=[];for(let a=0;a<e.length;++a){const c=e[a];if(!Dt(c)){t(new de(ae.NODE_INVALID,c?.id));continue}const d=Rh(c,A(c.id),c.parentNode);c.parentNode&&(n[c.parentNode]=!0),o[a]=d}for(const a of o){const c=A(a.parentNode)||o.find(d=>d.id===a.parentNode);a.parentNode&&!c&&t(new de(ae.NODE_MISSING_PARENT,a.id,a.parentNode)),(a.parentNode||n[a.id])&&(n[a.id]&&(a.isParent=!0),c&&(c.isParent=!0))}return o}function Ma(e,A,t,n,o,a){let c=o;const d=n.get(c)||new Map;n.set(c,d.set(t,A)),c=`${o}-${e}`;const h=n.get(c)||new Map;if(n.set(c,h.set(t,A)),a){c=`${o}-${e}-${a}`;const g=n.get(c)||new Map;n.set(c,g.set(t,A))}}function ci(e,A,t){e.clear();for(const n of t){const{source:o,target:a,sourceHandle:c=null,targetHandle:d=null}=n,h={edgeId:n.id,source:o,target:a,sourceHandle:c,targetHandle:d},g=`${o}-${c}--${a}-${d}`;Ma("source",h,`${a}-${d}--${o}-${c}`,e,o,c),Ma("target",h,g,e,a,d)}}function Oa(e,A){if(e.size!==A.size)return!1;for(const t of e)if(!A.has(t))return!1;return!0}function ui(e,A,t,n,o,a,c,d){const h=[];for(const g of e){const B=dt(g)?g:uB(g,d,o,a);if(!B)continue;const w=t(B.source),m=t(B.target);if(!w||!m){o(new de(ae.EDGE_SOURCE_TARGET_MISSING,B.id,B.source,B.target));continue}if(!w){o(new de(ae.EDGE_SOURCE_MISSING,B.id,B.source));continue}if(!m){o(new de(ae.EDGE_TARGET_MISSING,B.id,B.target));continue}if(A&&!A(B,{edges:d,nodes:c,sourceNode:w,targetNode:m})){o(new de(ae.EDGE_INVALID,B.id));continue}const y=n(B.id);h.push({...ua(B,y,a),sourceNode:w,targetNode:m})}return h}var Ka=Symbol("vueFlow"),Ra=Symbol("nodeId"),Va=Symbol("nodeRef"),fB=Symbol("edgeId"),gB=Symbol("edgeRef"),Ur=Symbol("slots");function Pa(e){const{vueFlowRef:A,snapToGrid:t,snapGrid:n,noDragClassName:o,nodeLookup:a,nodeExtent:c,nodeDragThreshold:d,viewport:h,autoPanOnNodeDrag:g,autoPanSpeed:B,nodesDraggable:w,panBy:m,findNode:y,multiSelectionActive:v,nodesSelectionActive:I,selectNodesOnDrag:L,removeSelectedElements:k,addSelectedNodes:V,updateNodePositions:F,emits:M}=JA(),{onStart:tA,onDrag:W,onStop:aA,onClick:dA,el:rA,disabled:oA,id:AA,selectable:O,dragHandle:lA}=e,_=(0,r.shallowRef)(!1);let Z=[],U,x=null,G={x:void 0,y:void 0},R={x:0,y:0},$=null,J=!1,nA=!1,BA=0,UA=!1;const eA=pB(),uA=({x:fA,y:vA})=>{G={x:fA,y:vA};let S=!1;if(Z=Z.map(H=>{const T={x:fA-H.distance.x,y:vA-H.distance.y},{computedPosition:D}=oi(H,t.value?Fr(T,n.value):T,M.error,c.value,H.parentNode?y(H.parentNode):void 0);return S=S||H.position.x!==D.x||H.position.y!==D.y,H.position=D,H}),nA=nA||S,!!S&&(F(Z,!0,!0),_.value=!0,$)){const[H,T]=ri({id:AA,dragItems:Z,findNode:y});W({event:$,node:H,nodes:T})}},Y=()=>{if(!x)return;const[fA,vA]=va(R,x,B.value);if(fA!==0||vA!==0){const S={x:(G.x??0)-fA/h.value.zoom,y:(G.y??0)-vA/h.value.zoom};m({x:fA,y:vA})&&uA(S)}BA=requestAnimationFrame(Y)},cA=(fA,vA)=>{J=!0;const S=y(AA);!L.value&&!v.value&&S&&(S.selected||k()),S&&(0,r.toValue)(O)&&L.value&&li(S,v.value,V,k,I,!1,vA);const H=eA(fA.sourceEvent);if(G=H,Z=Jh(a.value,w.value,H,AA),Z.length){const[T,D]=ri({id:AA,dragItems:Z,findNode:y});tA({event:fA.sourceEvent,node:T,nodes:D})}},mA=(fA,vA)=>{var S;fA.sourceEvent.type==="touchmove"&&fA.sourceEvent.touches.length>1||(nA=!1,d.value===0&&cA(fA,vA),G=eA(fA.sourceEvent),x=((S=A.value)==null?void 0:S.getBoundingClientRect())||null,R=$e(fA.sourceEvent,x))},yA=(fA,vA)=>{const S=eA(fA.sourceEvent);if(!UA&&J&&g.value&&(UA=!0,Y()),!J){const H=S.xSnapped-(G.x??0),T=S.ySnapped-(G.y??0);Math.sqrt(H*H+T*T)>d.value&&cA(fA,vA)}(G.x!==S.xSnapped||G.y!==S.ySnapped)&&Z.length&&J&&($=fA.sourceEvent,R=$e(fA.sourceEvent,x),uA(S))},IA=fA=>{let vA=!1;if(!J&&!_.value&&!v.value){const S=fA.sourceEvent,H=eA(S),T=H.xSnapped-(G.x??0),D=H.ySnapped-(G.y??0),b=Math.sqrt(T*T+D*D);b!==0&&b<=d.value&&(dA?.(S),vA=!0)}if(Z.length&&!vA){nA&&(F(Z,!1,!1),nA=!1);const[S,H]=ri({id:AA,dragItems:Z,findNode:y});aA({event:fA.sourceEvent,node:S,nodes:H})}Z=[],_.value=!1,UA=!1,J=!1,G={x:void 0,y:void 0},cancelAnimationFrame(BA)};return(0,r.watch)([()=>(0,r.toValue)(oA),rA],([fA,vA],S,H)=>{if(vA){const T=ke(vA);fA||(U=Kf().on("start",D=>mA(D,vA)).on("drag",D=>yA(D,vA)).on("end",D=>IA(D)).filter(D=>{const b=D.target,z=(0,r.toValue)(lA);return!D.button&&(!o.value||!Ia(b,`.${o.value}`,vA)&&(!z||Ia(b,z,vA)))}),T.call(U)),H(()=>{T.on(".drag",null),U&&(U.on("start",null),U.on("drag",null),U.on("end",null))})}}),_}function hB(){return{doubleClick:EA(),click:EA(),mouseEnter:EA(),mouseMove:EA(),mouseLeave:EA(),contextMenu:EA(),updateStart:EA(),update:EA(),updateEnd:EA()}}function BB(e,A){const t=hB();return t.doubleClick.on(n=>{var o,a;A.edgeDoubleClick(n),(a=(o=e.events)==null?void 0:o.doubleClick)==null||a.call(o,n)}),t.click.on(n=>{var o,a;A.edgeClick(n),(a=(o=e.events)==null?void 0:o.click)==null||a.call(o,n)}),t.mouseEnter.on(n=>{var o,a;A.edgeMouseEnter(n),(a=(o=e.events)==null?void 0:o.mouseEnter)==null||a.call(o,n)}),t.mouseMove.on(n=>{var o,a;A.edgeMouseMove(n),(a=(o=e.events)==null?void 0:o.mouseMove)==null||a.call(o,n)}),t.mouseLeave.on(n=>{var o,a;A.edgeMouseLeave(n),(a=(o=e.events)==null?void 0:o.mouseLeave)==null||a.call(o,n)}),t.contextMenu.on(n=>{var o,a;A.edgeContextMenu(n),(a=(o=e.events)==null?void 0:o.contextMenu)==null||a.call(o,n)}),t.updateStart.on(n=>{var o,a;A.edgeUpdateStart(n),(a=(o=e.events)==null?void 0:o.updateStart)==null||a.call(o,n)}),t.update.on(n=>{var o,a;A.edgeUpdate(n),(a=(o=e.events)==null?void 0:o.update)==null||a.call(o,n)}),t.updateEnd.on(n=>{var o,a;A.edgeUpdateEnd(n),(a=(o=e.events)==null?void 0:o.updateEnd)==null||a.call(o,n)}),Object.entries(t).reduce((n,[o,a])=>(n.emit[o]=a.trigger,n.on[o]=a.on,n),{emit:{},on:{}})}function pB(){const{viewport:e,snapGrid:A,snapToGrid:t,vueFlowRef:n}=JA();return o=>{var a;const c=((a=n.value)==null?void 0:a.getBoundingClientRect())??{left:0,top:0},{x:d,y:h}=$e(tB(o)?o.sourceEvent:o,c),g=Sn({x:d,y:h},e.value),{x:B,y:w}=t.value?Fr(g,A.value):g;return{xSnapped:B,ySnapped:w,...g}}}function br(){return!0}function Ga({handleId:e,nodeId:A,type:t,isValidConnection:n,edgeUpdaterType:o,onEdgeUpdate:a,onEdgeUpdateEnd:c}){const{id:d,vueFlowRef:h,connectionMode:g,connectionRadius:B,connectOnClick:w,connectionClickStartHandle:m,nodesConnectable:y,autoPanOnConnect:v,autoPanSpeed:I,findNode:L,panBy:k,startConnection:V,updateConnection:F,endConnection:M,emits:tA,viewport:W,edges:aA,nodes:dA,isValidConnection:rA,nodeLookup:oA}=JA();let AA=null,O=!1,lA=null;function _(U){var x;const G=(0,r.toValue)(t)==="target",R=ii(U),$=ca(U.target),J=U.currentTarget;if(J&&(R&&U.button===0||!R)){let nA=function(hA){S=$e(hA,IA),uA=sB(Sn(S,W.value,!1,[1,1]),B.value,oA.value,D),H||(T(),H=!0);const iA=xa(hA,{handle:uA,connectionMode:g.value,fromNodeId:(0,r.toValue)(A),fromHandleId:(0,r.toValue)(e),fromType:G?"target":"source",isValidConnection:eA,doc:$,lib:"vue",flowId:d,nodeLookup:oA.value},aA.value,dA.value,L,oA.value);lA=iA.handleDomNode,AA=iA.connection,O=lB(!!uA,iA.isValid);const SA={...P,isValid:O,to:iA.toHandle&&O?_n({x:iA.toHandle.x,y:iA.toHandle.y},W.value):S,toHandle:iA.toHandle,toPosition:O&&iA.toHandle?iA.toHandle.position:ai[D.position],toNode:iA.toHandle?oA.value.get(iA.toHandle.nodeId):null};if(O&&uA&&P?.toHandle&&SA.toHandle&&P.toHandle.type===SA.toHandle.type&&P.toHandle.nodeId===SA.toHandle.nodeId&&P.toHandle.id===SA.toHandle.id&&P.to.x===SA.to.x&&P.to.y===SA.to.y)return;const xA=uA??iA.toHandle;if(F(xA&&O?_n({x:xA.x,y:xA.y},W.value):S,xA,aB(!!xA,O)),P=SA,!uA&&!O&&!lA)return si(vA);AA&&AA.source!==AA.target&&lA&&(si(vA),vA=lA,lA.classList.add("connecting","vue-flow__handle-connecting"),lA.classList.toggle("valid",!!O),lA.classList.toggle("vue-flow__handle-valid",!!O))},BA=function(hA){"touches"in hA&&hA.touches.length>0||((uA||lA)&&AA&&O&&(a?a(hA,AA):tA.connect(AA)),tA.connectEnd(hA),o&&c?.(hA),si(vA),cancelAnimationFrame(Y),M(hA),H=!1,O=!1,AA=null,lA=null,$.removeEventListener("mousemove",nA),$.removeEventListener("mouseup",BA),$.removeEventListener("touchmove",nA),$.removeEventListener("touchend",BA))};const UA=L((0,r.toValue)(A));let eA=(0,r.toValue)(n)||rA.value||br;!eA&&UA&&(eA=(G?UA.isValidSourcePos:UA.isValidTargetPos)||br);let uA,Y=0;const{x:cA,y:mA}=$e(U),yA=Da((0,r.toValue)(o),J),IA=(x=h.value)==null?void 0:x.getBoundingClientRect();if(!IA||!yA)return;const fA=Na((0,r.toValue)(A),yA,(0,r.toValue)(e),oA.value,g.value);if(!fA)return;let vA,S=$e(U,IA),H=!1;const T=()=>{if(!v.value)return;const[hA,iA]=va(S,IA,I.value);k({x:hA,y:iA}),Y=requestAnimationFrame(T)},D={...fA,nodeId:(0,r.toValue)(A),type:yA,position:fA.position},b=oA.value.get((0,r.toValue)(A)),z={inProgress:!0,isValid:null,from:Jt(b,D,HA.Left,!0),fromHandle:D,fromPosition:D.position,fromNode:b,to:S,toHandle:null,toPosition:ai[D.position],toNode:null};V({nodeId:(0,r.toValue)(A),id:(0,r.toValue)(e),type:yA,position:J?.getAttribute("data-handlepos")||HA.Top,...S},{x:cA-IA.left,y:mA-IA.top}),tA.connectStart({event:U,nodeId:(0,r.toValue)(A),handleId:(0,r.toValue)(e),handleType:yA});let P=z;$.addEventListener("mousemove",nA),$.addEventListener("mouseup",BA),$.addEventListener("touchmove",nA),$.addEventListener("touchend",BA)}}function Z(U){var x,G;if(!w.value)return;const R=(0,r.toValue)(t)==="target";if(!m.value){tA.clickConnectStart({event:U,nodeId:(0,r.toValue)(A),handleId:(0,r.toValue)(e)}),V({nodeId:(0,r.toValue)(A),type:(0,r.toValue)(t),id:(0,r.toValue)(e),position:HA.Top,...$e(U)},void 0,!0);return}let $=(0,r.toValue)(n)||rA.value||br;const J=L((0,r.toValue)(A));if(!$&&J&&($=(R?J.isValidSourcePos:J.isValidTargetPos)||br),J&&(typeof J.connectable>"u"?y.value:J.connectable)===!1)return;const nA=ca(U.target),BA=xa(U,{handle:{nodeId:(0,r.toValue)(A),id:(0,r.toValue)(e),type:(0,r.toValue)(t),position:HA.Top,...$e(U)},connectionMode:g.value,fromNodeId:m.value.nodeId,fromHandleId:m.value.id??null,fromType:m.value.type,isValidConnection:$,doc:nA,lib:"vue",flowId:d,nodeLookup:oA.value},aA.value,dA.value,L,oA.value),UA=((x=BA.connection)==null?void 0:x.source)===((G=BA.connection)==null?void 0:G.target);BA.isValid&&BA.connection&&!UA&&tA.connect(BA.connection),tA.clickConnectEnd(U),M(U,!0)}return{handlePointerDown:_,handleClick:Z}}function mB(){return(0,r.inject)(Ra,"")}function za(e){const A=e??mB()??"",t=(0,r.inject)(Va,(0,r.ref)(null)),{findNode:n,edges:o,emits:a}=JA(),c=n(A);return c||a.error(new de(ae.NODE_NOT_FOUND,A)),{id:A,nodeEl:t,node:c,parentNode:(0,r.computed)(()=>n(c.parentNode)),connectedEdges:(0,r.computed)(()=>pa([c],o.value))}}function wB(){return{doubleClick:EA(),click:EA(),mouseEnter:EA(),mouseMove:EA(),mouseLeave:EA(),contextMenu:EA(),dragStart:EA(),drag:EA(),dragStop:EA()}}function CB(e,A){const t=wB();return t.doubleClick.on(n=>{var o,a;A.nodeDoubleClick(n),(a=(o=e.events)==null?void 0:o.doubleClick)==null||a.call(o,n)}),t.click.on(n=>{var o,a;A.nodeClick(n),(a=(o=e.events)==null?void 0:o.click)==null||a.call(o,n)}),t.mouseEnter.on(n=>{var o,a;A.nodeMouseEnter(n),(a=(o=e.events)==null?void 0:o.mouseEnter)==null||a.call(o,n)}),t.mouseMove.on(n=>{var o,a;A.nodeMouseMove(n),(a=(o=e.events)==null?void 0:o.mouseMove)==null||a.call(o,n)}),t.mouseLeave.on(n=>{var o,a;A.nodeMouseLeave(n),(a=(o=e.events)==null?void 0:o.mouseLeave)==null||a.call(o,n)}),t.contextMenu.on(n=>{var o,a;A.nodeContextMenu(n),(a=(o=e.events)==null?void 0:o.contextMenu)==null||a.call(o,n)}),t.dragStart.on(n=>{var o,a;A.nodeDragStart(n),(a=(o=e.events)==null?void 0:o.dragStart)==null||a.call(o,n)}),t.drag.on(n=>{var o,a;A.nodeDrag(n),(a=(o=e.events)==null?void 0:o.drag)==null||a.call(o,n)}),t.dragStop.on(n=>{var o,a;A.nodeDragStop(n),(a=(o=e.events)==null?void 0:o.dragStop)==null||a.call(o,n)}),Object.entries(t).reduce((n,[o,a])=>(n.emit[o]=a.trigger,n.on[o]=a.on,n),{emit:{},on:{}})}function $a(){const{getSelectedNodes:e,nodeExtent:A,updateNodePositions:t,findNode:n,snapGrid:o,snapToGrid:a,nodesDraggable:c,emits:d}=JA();return(h,g=!1)=>{const B=a.value?o.value[0]:5,w=a.value?o.value[1]:5,m=g?4:1,y=h.x*B*m,v=h.y*w*m,I=[];for(const L of e.value)if(L.draggable||c&&typeof L.draggable>"u"){const{position:k}=oi(L,{x:L.computedPosition.x+y,y:L.computedPosition.y+v},d.error,A.value,L.parentNode?n(L.parentNode):void 0);I.push({id:L.id,position:k,from:L.position,distance:{x:h.x,y:h.y},dimensions:L.dimensions})}t(I,!0,!1)}}var Ir=.1,yB=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function ht(){return Dn("Viewport not initialized yet."),Promise.resolve(!1)}var vB={zoomIn:ht,zoomOut:ht,zoomTo:ht,fitView:ht,setCenter:ht,fitBounds:ht,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:ht,setTransform:ht,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function QB(e){function A(n,o){return new Promise(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(o?.interpolate==="linear"?yn:cr).scaleBy(di(e.d3Selection,o?.duration,o?.ease,()=>{a(!0)}),n):a(!1)})}function t(n,o,a,c){return new Promise(d=>{var h;const{x:g,y:B}=la({x:-n,y:-o},e.translateExtent),w=Xt.translate(-g,-B).scale(a);e.d3Selection&&e.d3Zoom?(h=e.d3Zoom)==null||h.interpolate(c?.interpolate==="linear"?yn:cr).transform(di(e.d3Selection,c?.duration,c?.ease,()=>{d(!0)}),w):d(!1)})}return(0,r.computed)(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:n=>A(1.2,n),zoomOut:n=>A(1/1.2,n),zoomTo:(n,o)=>new Promise(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(o?.interpolate==="linear"?yn:cr).scaleTo(di(e.d3Selection,o?.duration,o?.ease,()=>{a(!0)}),n):a(!1)}),setViewport:(n,o)=>t(n.x,n.y,n.zoom,o),setTransform:(n,o)=>t(n.x,n.y,n.zoom,o),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(n={padding:Ir,includeHiddenNodes:!1,duration:0})=>{var o,a;const c=[];for(const B of e.nodes)B.dimensions.width&&B.dimensions.height&&(n?.includeHiddenNodes||!B.hidden)&&(!((o=n.nodes)!=null&&o.length)||(a=n.nodes)!=null&&a.length&&n.nodes.includes(B.id))&&c.push(B);if(!c.length)return Promise.resolve(!1);const{x:d,y:h,zoom:g}=ma(ha(c),e.dimensions.width,e.dimensions.height,n.minZoom??e.minZoom,n.maxZoom??e.maxZoom,n.padding??Ir);return t(d,h,g,n)},setCenter:(n,o,a)=>{const c=typeof a?.zoom<"u"?a.zoom:e.maxZoom;return t(e.dimensions.width/2-n*c,e.dimensions.height/2-o*c,c,a)},fitBounds:(n,o={padding:Ir})=>{const{x:a,y:c,zoom:d}=ma(n,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,o.padding??Ir);return t(a,c,d,o)},project:n=>Sn(n,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:n=>{if(e.vueFlowRef){const{x:o,y:a}=e.vueFlowRef.getBoundingClientRect();return Sn({x:n.x-o,y:n.y-a},e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:n=>{if(e.vueFlowRef){const{x:o,y:a}=e.vueFlowRef.getBoundingClientRect();return _n({x:n.x+o,y:n.y+a},e.viewport)}return{x:0,y:0}}}:vB)}function di(e,A=0,t=yB,n=()=>{}){const o=typeof A=="number"&&A>0;return o||n(),o?e.transition().duration(A).ease(t).on("end",n):e}function EB(e,A,t){const n=(0,r.effectScope)(!0);return n.run(()=>{const o=()=>{n.run(()=>{let I,L,k=!!(t.nodes.value.length||t.edges.value.length);I=Vt([e.modelValue,()=>{var V,F;return(F=(V=e.modelValue)==null?void 0:V.value)==null?void 0:F.length}],([V])=>{V&&Array.isArray(V)&&(L?.pause(),t.setElements(V),!L&&!k&&V.length?k=!0:L?.resume())}),L=Vt([t.nodes,t.edges,()=>t.edges.value.length,()=>t.nodes.value.length],([V,F])=>{var M;(M=e.modelValue)!=null&&M.value&&Array.isArray(e.modelValue.value)&&(I?.pause(),e.modelValue.value=[...V,...F],(0,r.nextTick)(()=>{I?.resume()}))},{immediate:k}),(0,r.onScopeDispose)(()=>{I?.stop(),L?.stop()})})},a=()=>{n.run(()=>{let I,L,k=!!t.nodes.value.length;I=Vt([e.nodes,()=>{var V,F;return(F=(V=e.nodes)==null?void 0:V.value)==null?void 0:F.length}],([V])=>{V&&Array.isArray(V)&&(L?.pause(),t.setNodes(V),!L&&!k&&V.length?k=!0:L?.resume())}),L=Vt([t.nodes,()=>t.nodes.value.length],([V])=>{var F;(F=e.nodes)!=null&&F.value&&Array.isArray(e.nodes.value)&&(I?.pause(),e.nodes.value=[...V],(0,r.nextTick)(()=>{I?.resume()}))},{immediate:k}),(0,r.onScopeDispose)(()=>{I?.stop(),L?.stop()})})},c=()=>{n.run(()=>{let I,L,k=!!t.edges.value.length;I=Vt([e.edges,()=>{var V,F;return(F=(V=e.edges)==null?void 0:V.value)==null?void 0:F.length}],([V])=>{V&&Array.isArray(V)&&(L?.pause(),t.setEdges(V),!L&&!k&&V.length?k=!0:L?.resume())}),L=Vt([t.edges,()=>t.edges.value.length],([V])=>{var F;(F=e.edges)!=null&&F.value&&Array.isArray(e.edges.value)&&(I?.pause(),e.edges.value=[...V],(0,r.nextTick)(()=>{I?.resume()}))},{immediate:k}),(0,r.onScopeDispose)(()=>{I?.stop(),L?.stop()})})},d=()=>{n.run(()=>{(0,r.watch)(()=>A.maxZoom,()=>{A.maxZoom&&le(A.maxZoom)&&t.setMaxZoom(A.maxZoom)},{immediate:!0})})},h=()=>{n.run(()=>{(0,r.watch)(()=>A.minZoom,()=>{A.minZoom&&le(A.minZoom)&&t.setMinZoom(A.minZoom)},{immediate:!0})})},g=()=>{n.run(()=>{(0,r.watch)(()=>A.translateExtent,()=>{A.translateExtent&&le(A.translateExtent)&&t.setTranslateExtent(A.translateExtent)},{immediate:!0})})},B=()=>{n.run(()=>{(0,r.watch)(()=>A.nodeExtent,()=>{A.nodeExtent&&le(A.nodeExtent)&&t.setNodeExtent(A.nodeExtent)},{immediate:!0})})},w=()=>{n.run(()=>{(0,r.watch)(()=>A.applyDefault,()=>{le(A.applyDefault)&&(t.applyDefault.value=A.applyDefault)},{immediate:!0})})},m=()=>{n.run(()=>{const I=async L=>{let k=L;typeof A.autoConnect=="function"&&(k=await A.autoConnect(L)),k!==!1&&t.addEdges([k])};(0,r.watch)(()=>A.autoConnect,()=>{le(A.autoConnect)&&(t.autoConnect.value=A.autoConnect)},{immediate:!0}),(0,r.watch)(t.autoConnect,(L,k,V)=>{L?t.onConnect(I):t.hooks.value.connect.off(I),V(()=>{t.hooks.value.connect.off(I)})},{immediate:!0})})},y=()=>{const I=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const L of Object.keys(A)){const k=L;if(!I.includes(k)){const V=(0,r.toRef)(()=>A[k]),F=t[k];(0,r.isRef)(F)&&n.run(()=>{(0,r.watch)(V,M=>{le(M)&&(F.value=M)},{immediate:!0})})}}};o(),a(),c(),h(),d(),g(),B(),w(),m(),y()}),()=>n.stop()}function FB(){return{edgesChange:EA(),nodesChange:EA(),nodeDoubleClick:EA(),nodeClick:EA(),nodeMouseEnter:EA(),nodeMouseMove:EA(),nodeMouseLeave:EA(),nodeContextMenu:EA(),nodeDragStart:EA(),nodeDrag:EA(),nodeDragStop:EA(),nodesInitialized:EA(),miniMapNodeClick:EA(),miniMapNodeDoubleClick:EA(),miniMapNodeMouseEnter:EA(),miniMapNodeMouseMove:EA(),miniMapNodeMouseLeave:EA(),connect:EA(),connectStart:EA(),connectEnd:EA(),clickConnectStart:EA(),clickConnectEnd:EA(),paneReady:EA(),init:EA(),move:EA(),moveStart:EA(),moveEnd:EA(),selectionDragStart:EA(),selectionDrag:EA(),selectionDragStop:EA(),selectionContextMenu:EA(),selectionStart:EA(),selectionEnd:EA(),viewportChangeStart:EA(),viewportChange:EA(),viewportChangeEnd:EA(),paneScroll:EA(),paneClick:EA(),paneContextMenu:EA(),paneMouseEnter:EA(),paneMouseMove:EA(),paneMouseLeave:EA(),edgeContextMenu:EA(),edgeMouseEnter:EA(),edgeMouseMove:EA(),edgeMouseLeave:EA(),edgeDoubleClick:EA(),edgeClick:EA(),edgeUpdateStart:EA(),edgeUpdate:EA(),edgeUpdateEnd:EA(),updateNodeInternals:EA(),error:EA(e=>Dn(e.message))}}function UB(e,A){const t=(0,r.getCurrentInstance)();(0,r.onBeforeMount)(()=>{for(const[o,a]of Object.entries(A.value)){const c=d=>{e(o,d)};a.setEmitter(c),hn(a.removeEmitter),a.setHasEmitListeners(()=>n(o)),hn(a.removeHasEmitListeners)}});function n(o){var a;const c=bB(o);return!!((a=t?.vnode.props)!=null&&a[c])}}function bB(e){const[A,...t]=e.split(":");return`on${A.replace(/(?:^|-)(\w)/g,(n,o)=>o.toUpperCase())}${t.length?`:${t.join(":")}`:""}`}function Xa(){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:ei.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:bn.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:St.Bezier,style:{}},connectionMode:tt.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:Er()?"Meta":"Control",zoomActivationKeyCode:Er()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:FB(),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 IB=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function HB(e,A,t){const n=QB(e),o=S=>{const H=S??[];e.hooks.updateNodeInternals.trigger(H)},a=S=>Ph(S,e.nodes,e.edges),c=S=>Vh(S,e.nodes,e.edges),d=S=>pa(S,e.edges),h=({id:S,type:H,nodeId:T})=>{var D;const b=S?`-${H}-${S}`:`-${H}`;return Array.from(((D=e.connectionLookup.get(`${T}${b}`))==null?void 0:D.values())??[])},g=S=>{if(S)return A.value.get(S)},B=S=>{if(S)return t.value.get(S)},w=(S,H,T)=>{var D,b;const z=[];for(const P of S){const hA={id:P.id,type:"position",dragging:T,from:P.from};if(H&&(hA.position=P.position,P.parentNode)){const iA=g(P.parentNode);hA.position={x:hA.position.x-(((D=iA?.computedPosition)==null?void 0:D.x)??0),y:hA.position.y-(((b=iA?.computedPosition)==null?void 0:b.y)??0)}}z.push(hA)}z?.length&&e.hooks.nodesChange.trigger(z)},m=S=>{if(!e.vueFlowRef)return;const H=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!H)return;const T=window.getComputedStyle(H),{m22:D}=new window.DOMMatrixReadOnly(T.transform),b=[];for(const z of S){const P=z,hA=g(P.id);if(hA){const iA=vr(P.nodeElement);if(iA.width&&iA.height&&(hA.dimensions.width!==iA.width||hA.dimensions.height!==iA.height||P.forceUpdate)){const SA=P.nodeElement.getBoundingClientRect();hA.dimensions=iA,hA.handleBounds.source=Ta("source",P.nodeElement,SA,D,hA.id),hA.handleBounds.target=Ta("target",P.nodeElement,SA,D,hA.id),b.push({id:hA.id,type:"dimensions",dimensions:iA})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&n.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),b.length&&e.hooks.nodesChange.trigger(b)},y=(S,H)=>{const T=new Set,D=new Set;for(const P of S)Dt(P)?T.add(P.id):dt(P)&&D.add(P.id);const b=gt(A.value,T,!0),z=gt(t.value,D);if(e.multiSelectionActive){for(const P of T)b.push(ft(P,H));for(const P of D)z.push(ft(P,H))}b.length&&e.hooks.nodesChange.trigger(b),z.length&&e.hooks.edgesChange.trigger(z)},v=S=>{if(e.multiSelectionActive){const H=S.map(T=>ft(T.id,!0));e.hooks.nodesChange.trigger(H);return}e.hooks.nodesChange.trigger(gt(A.value,new Set(S.map(H=>H.id)),!0)),e.hooks.edgesChange.trigger(gt(t.value))},I=S=>{if(e.multiSelectionActive){const H=S.map(T=>ft(T.id,!0));e.hooks.edgesChange.trigger(H);return}e.hooks.edgesChange.trigger(gt(t.value,new Set(S.map(H=>H.id)))),e.hooks.nodesChange.trigger(gt(A.value,new Set,!0))},L=S=>{y(S,!0)},k=S=>{const H=(S||e.nodes).map(T=>(T.selected=!1,ft(T.id,!1)));e.hooks.nodesChange.trigger(H)},V=S=>{const H=(S||e.edges).map(T=>(T.selected=!1,ft(T.id,!1)));e.hooks.edgesChange.trigger(H)},F=S=>{if(!S||!S.length)return y([],!1);const H=S.reduce((T,D)=>{const b=ft(D.id,!1);return Dt(D)?T.nodes.push(b):T.edges.push(b),T},{nodes:[],edges:[]});H.nodes.length&&e.hooks.nodesChange.trigger(H.nodes),H.edges.length&&e.hooks.edgesChange.trigger(H.edges)},M=S=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([S,e.maxZoom]),e.minZoom=S},tA=S=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([e.minZoom,S]),e.maxZoom=S},W=S=>{var H;(H=e.d3Zoom)==null||H.translateExtent(S),e.translateExtent=S},aA=S=>{e.nodeExtent=S,o()},dA=S=>{var H;(H=e.d3Zoom)==null||H.clickDistance(S)},rA=S=>{e.nodesDraggable=S,e.nodesConnectable=S,e.elementsSelectable=S},oA=S=>{const H=S instanceof Function?S(e.nodes):S;!e.initialized&&!H.length||(e.nodes=ka(H,g,e.hooks.error.trigger))},AA=S=>{const H=S instanceof Function?S(e.edges):S;if(!e.initialized&&!H.length)return;const T=ui(H,e.isValidConnection,g,B,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);ci(e.connectionLookup,t.value,T),e.edges=T},O=S=>{const H=S instanceof Function?S([...e.nodes,...e.edges]):S;!e.initialized&&!H.length||(oA(H.filter(Dt)),AA(H.filter(dt)))},lA=S=>{let H=S instanceof Function?S(e.nodes):S;H=Array.isArray(H)?H:[H];const T=ka(H,g,e.hooks.error.trigger),D=[];for(const b of T)D.push(Ea(b));D.length&&e.hooks.nodesChange.trigger(D)},_=S=>{let H=S instanceof Function?S(e.edges):S;H=Array.isArray(H)?H:[H];const T=ui(H,e.isValidConnection,g,B,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),D=[];for(const b of T)D.push(Ea(b));D.length&&e.hooks.edgesChange.trigger(D)},Z=(S,H=!0,T=!1)=>{const D=S instanceof Function?S(e.nodes):S,b=Array.isArray(D)?D:[D],z=[],P=[];function hA(SA){const xA=d(SA);for(const VA of xA)(!le(VA.deletable)||VA.deletable)&&P.push(Ua(VA.id,VA.source,VA.target,VA.sourceHandle,VA.targetHandle))}function iA(SA){const xA=[];for(const VA of e.nodes)VA.parentNode===SA&&xA.push(VA);if(xA.length){for(const VA of xA)z.push(Fa(VA.id));H&&hA(xA);for(const VA of xA)iA(VA.id)}}for(const SA of b){const xA=typeof SA=="string"?g(SA):SA;xA&&(le(xA.deletable)&&!xA.deletable||(z.push(Fa(xA.id)),H&&hA([xA]),T&&iA(xA.id)))}P.length&&e.hooks.edgesChange.trigger(P),z.length&&e.hooks.nodesChange.trigger(z)},U=S=>{const H=S instanceof Function?S(e.edges):S,T=Array.isArray(H)?H:[H],D=[];for(const b of T){const z=typeof b=="string"?B(b):b;z&&(le(z.deletable)&&!z.deletable||D.push(Ua(typeof b=="string"?b:b.id,z.source,z.target,z.sourceHandle,z.targetHandle)))}e.hooks.edgesChange.trigger(D)},x=(S,H,T=!0)=>{const D=B(S.id);if(!D)return!1;const b=e.edges.indexOf(D),z=dB(S,H,D,T,e.hooks.error.trigger);if(z){const[P]=ui([z],e.isValidConnection,g,B,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((hA,iA)=>iA===b?P:hA),ci(e.connectionLookup,t.value,[P]),P}return!1},G=(S,H,T={replace:!1})=>{const D=B(S);if(!D)return;const b=typeof H=="function"?H(D):H;D.data=T.replace?b:{...D.data,...b}},R=S=>Qa(S,e.nodes),$=S=>{const H=Qa(S,e.edges);return ci(e.connectionLookup,t.value,H),H},J=(S,H,T={replace:!1})=>{const D=g(S);if(!D)return;const b=typeof H=="function"?H(D):H;T.replace?e.nodes.splice(e.nodes.indexOf(D),1,b):Object.assign(D,b)},nA=(S,H,T={replace:!1})=>{const D=g(S);if(!D)return;const b=typeof H=="function"?H(D):H;D.data=T.replace?b:{...D.data,...b}},BA=(S,H,T=!1)=>{T?e.connectionClickStartHandle=S:e.connectionStartHandle=S,e.connectionEndHandle=null,e.connectionStatus=null,H&&(e.connectionPosition=H)},UA=(S,H=null,T=null)=>{e.connectionStartHandle&&(e.connectionPosition=S,e.connectionEndHandle=H,e.connectionStatus=T)},eA=(S,H)=>{e.connectionPosition={x:NaN,y:NaN},e.connectionEndHandle=null,e.connectionStatus=null,H?e.connectionClickStartHandle=null:e.connectionStartHandle=null},uA=S=>{const H=Kh(S),T=H?null:Hn(S)?S:g(S.id);return!H&&!T?[null,null,H]:[H?S:Cr(T),T,H]},Y=(S,H=!0,T=e.nodes)=>{const[D,b,z]=uA(S);if(!D)return[];const P=[];for(const hA of T||e.nodes){if(!z&&(hA.id===b.id||!hA.computedPosition))continue;const iA=Cr(hA),SA=yr(iA,D);(H&&SA>0||SA>=iA.width*iA.height||SA>=Number(D.width)*Number(D.height))&&P.push(hA)}return P},cA=(S,H,T=!0)=>{const[D]=uA(S);if(!D)return!1;const b=yr(D,H);return T&&b>0||b>=Number(D.width)*Number(D.height)},mA=S=>{const{viewport:H,dimensions:T,d3Zoom:D,d3Selection:b,translateExtent:z}=e;if(!D||!b||!S.x&&!S.y)return!1;const P=Xt.translate(H.x+S.x,H.y+S.y).scale(H.zoom),hA=[[0,0],[T.width,T.height]],iA=D.constrain()(P,hA,z),SA=e.viewport.x!==iA.x||e.viewport.y!==iA.y||e.viewport.zoom!==iA.k;return D.transform(b,iA),SA},yA=S=>{const H=S instanceof Function?S(e):S,T=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];le(H.defaultEdgeOptions)&&(e.defaultEdgeOptions=H.defaultEdgeOptions);const D=H.modelValue||H.nodes||H.edges?[]:void 0;D&&(H.modelValue&&D.push(...H.modelValue),H.nodes&&D.push(...H.nodes),H.edges&&D.push(...H.edges),O(D));const b=()=>{le(H.maxZoom)&&tA(H.maxZoom),le(H.minZoom)&&M(H.minZoom),le(H.translateExtent)&&W(H.translateExtent)};for(const z of Object.keys(H)){const P=z,hA=H[P];![...IB,...T].includes(P)&&le(hA)&&(e[P]=hA)}No(()=>e.d3Zoom).not.toBeNull().then(b),e.initialized||(e.initialized=!0)};return{updateNodePositions:w,updateNodeDimensions:m,setElements:O,setNodes:oA,setEdges:AA,addNodes:lA,addEdges:_,removeNodes:Z,removeEdges:U,findNode:g,findEdge:B,updateEdge:x,updateEdgeData:G,updateNode:J,updateNodeData:nA,applyEdgeChanges:$,applyNodeChanges:R,addSelectedElements:L,addSelectedNodes:v,addSelectedEdges:I,setMinZoom:M,setMaxZoom:tA,setTranslateExtent:W,setNodeExtent:aA,setPaneClickDistance:dA,removeSelectedElements:F,removeSelectedNodes:k,removeSelectedEdges:V,startConnection:BA,updateConnection:UA,endConnection:eA,setInteractive:rA,setState:yA,getIntersectingNodes:Y,getIncomers:a,getOutgoers:c,getConnectedEdges:d,getHandleConnections:h,isNodeIntersecting:cA,panBy:mA,fitView:S=>n.value.fitView(S),zoomIn:S=>n.value.zoomIn(S),zoomOut:S=>n.value.zoomOut(S),zoomTo:(S,H)=>n.value.zoomTo(S,H),setViewport:(S,H)=>n.value.setViewport(S,H),setTransform:(S,H)=>n.value.setTransform(S,H),getViewport:()=>n.value.getViewport(),getTransform:()=>n.value.getTransform(),setCenter:(S,H,T)=>n.value.setCenter(S,H,T),fitBounds:(S,H)=>n.value.fitBounds(S,H),project:S=>n.value.project(S),screenToFlowCoordinate:S=>n.value.screenToFlowCoordinate(S),flowToScreenCoordinate:S=>n.value.flowToScreenCoordinate(S),toObject:()=>{const S=[],H=[];for(const T of e.nodes){const{computedPosition:D,handleBounds:b,selected:z,dimensions:P,isParent:hA,resizing:iA,dragging:SA,events:xA,...VA}=T;S.push(VA)}for(const T of e.edges){const{selected:D,sourceNode:b,targetNode:z,events:P,...hA}=T;H.push(hA)}return JSON.parse(JSON.stringify({nodes:S,edges:H,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:S=>new Promise(H=>{const{nodes:T,edges:D,position:b,zoom:z,viewport:P}=S;T&&oA(T),D&&AA(D);const[hA,iA]=P?.x&&P?.y?[P.x,P.y]:b??[null,null];if(hA&&iA){const SA=P?.zoom||z||e.viewport.zoom;return No(()=>n.value.viewportInitialized).toBe(!0).then(()=>{n.value.setViewport({x:hA,y:iA,zoom:SA}).then(()=>{H(!0)})})}else H(!0)}),updateNodeInternals:o,viewportHelper:n,$reset:()=>{const S=Xa();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const H=Xt.translate(S.defaultViewport.x??0,S.defaultViewport.y??0).scale(xt(S.defaultViewport.zoom??1,S.minZoom,S.maxZoom)),T=e.viewportRef.getBoundingClientRect(),D=[[0,0],[T.width,T.height]],b=e.d3Zoom.constrain()(H,D,S.translateExtent);e.d3Zoom.transform(e.d3Selection,b)}yA(S)},$destroy:()=>{}}}var _B=["data-id","data-handleid","data-nodeid","data-handlepos"],Zt=(0,r.defineComponent)({name:"Handle",compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>HA.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:A}){const t=(0,r.createPropsRestProxy)(e,["position","connectable","connectableStart","connectableEnd","id"]),n=(0,r.toRef)(()=>t.type??"source"),o=(0,r.toRef)(()=>t.isValidConnection??null),{id:a,connectionStartHandle:c,connectionClickStartHandle:d,connectionEndHandle:h,vueFlowRef:g,nodesConnectable:B,noDragClassName:w,noPanClassName:m}=JA(),{id:y,node:v,nodeEl:I,connectedEdges:L}=za(),k=(0,r.ref)(),V=(0,r.toRef)(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),F=(0,r.toRef)(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),M=(0,r.toRef)(()=>{var AA,O,lA,_,Z,U;return((AA=c.value)==null?void 0:AA.nodeId)===y&&((O=c.value)==null?void 0:O.id)===e.id&&((lA=c.value)==null?void 0:lA.type)===n.value||((_=h.value)==null?void 0:_.nodeId)===y&&((Z=h.value)==null?void 0:Z.id)===e.id&&((U=h.value)==null?void 0:U.type)===n.value}),tA=(0,r.toRef)(()=>{var AA,O,lA;return((AA=d.value)==null?void 0:AA.nodeId)===y&&((O=d.value)==null?void 0:O.id)===e.id&&((lA=d.value)==null?void 0:lA.type)===n.value}),{handlePointerDown:W,handleClick:aA}=Ga({nodeId:y,handleId:e.id,isValidConnection:o,type:n}),dA=(0,r.computed)(()=>typeof e.connectable=="string"&&e.connectable==="single"?!L.value.some(AA=>{const O=AA[`${n.value}Handle`];return AA[n.value]!==y?!1:O?O===e.id:!0}):typeof e.connectable=="number"?L.value.filter(AA=>{const O=AA[`${n.value}Handle`];return AA[n.value]!==y?!1:O?O===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(v,L.value):le(e.connectable)?e.connectable:B.value);(0,r.onMounted)(()=>{var AA;if(!v.dimensions.width||!v.dimensions.height)return;const O=(AA=v.handleBounds[n.value])==null?void 0:AA.find(R=>R.id===e.id);if(!g.value||O)return;const lA=g.value.querySelector(".vue-flow__transformationpane");if(!I.value||!k.value||!lA||!e.id)return;const _=I.value.getBoundingClientRect(),Z=k.value.getBoundingClientRect(),U=window.getComputedStyle(lA),{m22:x}=new window.DOMMatrixReadOnly(U.transform),G={id:e.id,position:e.position,x:(Z.left-_.left)/x,y:(Z.top-_.top)/x,type:n.value,nodeId:y,...vr(k.value)};v.handleBounds[n.value]=[...v.handleBounds[n.value]??[],G]});function rA(AA){const O=ii(AA);dA.value&&V.value&&(O&&AA.button===0||!O)&&W(AA)}function oA(AA){!y||!d.value&&!V.value||dA.value&&aA(AA)}return A({handleClick:aA,handlePointerDown:W,onClick:oA,onPointerDown:rA}),(AA,O)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"handle",ref:k,"data-id":`${(0,r.unref)(a)}-${(0,r.unref)(y)}-${e.id}-${n.value}`,"data-handleid":e.id,"data-nodeid":(0,r.unref)(y),"data-handlepos":AA.position,class:(0,r.normalizeClass)(["vue-flow__handle",[`vue-flow__handle-${AA.position}`,`vue-flow__handle-${e.id}`,(0,r.unref)(w),(0,r.unref)(m),n.value,{connectable:dA.value,connecting:tA.value,connectablestart:V.value,connectableend:F.value,connectionindicator:dA.value&&(V.value&&!M.value||F.value&&M.value)}]]),onMousedown:rA,onTouchstartPassive:rA,onClick:oA},[(0,r.renderSlot)(AA.$slots,"default",{id:AA.id})],42,_B))}}),Hr=function({sourcePosition:e=HA.Bottom,targetPosition:A=HA.Top,label:t,connectable:n=!0,isValidTargetPos:o,isValidSourcePos:a,data:c}){const d=c.label??t;return[(0,r.h)(Zt,{type:"target",position:A,connectable:n,isValidConnection:o}),typeof d!="string"&&d?(0,r.h)(d):(0,r.h)(r.Fragment,[d]),(0,r.h)(Zt,{type:"source",position:e,connectable:n,isValidConnection:a})]};Hr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Hr.inheritAttrs=!1,Hr.compatConfig={MODE:3};var SB=Hr,_r=function({targetPosition:e=HA.Top,label:A,connectable:t=!0,isValidTargetPos:n,data:o}){const a=o.label??A;return[(0,r.h)(Zt,{type:"target",position:e,connectable:t,isValidConnection:n}),typeof a!="string"&&a?(0,r.h)(a):(0,r.h)(r.Fragment,[a])]};_r.props=["targetPosition","label","isValidTargetPos","connectable","data"],_r.inheritAttrs=!1,_r.compatConfig={MODE:3};var xB=_r,Sr=function({sourcePosition:e=HA.Bottom,label:A,connectable:t=!0,isValidSourcePos:n,data:o}){const a=o.label??A;return[typeof a!="string"&&a?(0,r.h)(a):(0,r.h)(r.Fragment,[a]),(0,r.h)(Zt,{type:"source",position:e,connectable:t,isValidConnection:n})]};Sr.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Sr.inheritAttrs=!1,Sr.compatConfig={MODE:3};var DB=Sr,NB=["transform"],LB=["width","height","x","y","rx","ry"],TB=["y"],kB=(0,r.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(e){const A=(0,r.ref)({x:0,y:0,width:0,height:0}),t=(0,r.ref)(null),n=(0,r.computed)(()=>`translate(${e.x-A.value.width/2} ${e.y-A.value.height/2})`);(0,r.onMounted)(o),(0,r.watch)([()=>e.x,()=>e.y,t,()=>e.label],o);function o(){if(!t.value)return;const a=t.value.getBBox();(a.width!==A.value.width||a.height!==A.value.height)&&(A.value=a)}return(a,c)=>((0,r.openBlock)(),(0,r.createElementBlock)("g",{transform:n.value,class:"vue-flow__edge-textwrapper"},[a.labelShowBg?((0,r.openBlock)(),(0,r.createElementBlock)("rect",{key:0,class:"vue-flow__edge-textbg",width:`${A.value.width+2*a.labelBgPadding[0]}px`,height:`${A.value.height+2*a.labelBgPadding[1]}px`,x:-a.labelBgPadding[0],y:-a.labelBgPadding[1],style:(0,r.normalizeStyle)(a.labelBgStyle),rx:a.labelBgBorderRadius,ry:a.labelBgBorderRadius},null,12,LB)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("text",(0,r.mergeProps)(a.$attrs,{ref_key:"el",ref:t,class:"vue-flow__edge-text",y:A.value.height/2,dy:"0.3em",style:a.labelStyle}),[(0,r.renderSlot)(a.$slots,"default",{},()=>[typeof a.label!="string"?((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(a.label),{key:0})):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createTextVNode)((0,r.toDisplayString)(a.label),1)],64))])],16,TB)],8,NB))}}),MB=["id","d","marker-end","marker-start"],OB=["d","stroke-width"],Nn=(0,r.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(e,{expose:A}){const t=(0,r.ref)(null),n=(0,r.ref)(null),o=(0,r.ref)(null),a=(0,r.useAttrs)();return A({pathEl:t,interactionEl:n,labelEl:o}),(c,d)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("path",(0,r.mergeProps)((0,r.unref)(a),{id:c.id,ref_key:"pathEl",ref:t,d:c.path,class:"vue-flow__edge-path","marker-end":c.markerEnd,"marker-start":c.markerStart}),null,16,MB),c.interactionWidth?((0,r.openBlock)(),(0,r.createElementBlock)("path",{key:0,ref_key:"interactionEl",ref:n,fill:"none",d:c.path,"stroke-width":c.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,OB)):(0,r.createCommentVNode)("",!0),c.label&&c.labelX&&c.labelY?((0,r.openBlock)(),(0,r.createBlock)(kB,{key:1,ref_key:"labelEl",ref:o,x:c.labelX,y:c.labelY,label:c.label,"label-show-bg":c.labelShowBg,"label-bg-style":c.labelBgStyle,"label-bg-padding":c.labelBgPadding,"label-bg-border-radius":c.labelBgBorderRadius,"label-style":c.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):(0,r.createCommentVNode)("",!0)],64))}});function Wa({sourceX:e,sourceY:A,targetX:t,targetY:n}){const o=Math.abs(t-e)/2,a=t<e?t+o:t-o,c=Math.abs(n-A)/2;return[a,n<A?n+c:n-c,o,c]}function Ya({sourceX:e,sourceY:A,targetX:t,targetY:n,sourceControlX:o,sourceControlY:a,targetControlX:c,targetControlY:d}){const h=e*.125+o*.375+c*.375+t*.125,g=A*.125+a*.375+d*.375+n*.125;return[h,g,Math.abs(h-e),Math.abs(g-A)]}function xr(e,A){return e>=0?.5*e:A*25*Math.sqrt(-e)}function Ja({pos:e,x1:A,y1:t,x2:n,y2:o,c:a}){let c,d;switch(e){case HA.Left:c=A-xr(A-n,a),d=t;break;case HA.Right:c=A+xr(n-A,a),d=t;break;case HA.Top:c=A,d=t-xr(t-o,a);break;case HA.Bottom:c=A,d=t+xr(o-t,a);break}return[c,d]}function fi(e){const{sourceX:A,sourceY:t,sourcePosition:n=HA.Bottom,targetX:o,targetY:a,targetPosition:c=HA.Top,curvature:d=.25}=e,[h,g]=Ja({pos:n,x1:A,y1:t,x2:o,y2:a,c:d}),[B,w]=Ja({pos:c,x1:o,y1:a,x2:A,y2:t,c:d}),[m,y,v,I]=Ya({sourceX:A,sourceY:t,targetX:o,targetY:a,sourceControlX:h,sourceControlY:g,targetControlX:B,targetControlY:w});return[`M${A},${t} C${h},${g} ${B},${w} ${o},${a}`,m,y,v,I]}function Za({pos:e,x1:A,y1:t,x2:n,y2:o}){let a,c;switch(e){case HA.Left:case HA.Right:a=.5*(A+n),c=t;break;case HA.Top:case HA.Bottom:a=A,c=.5*(t+o);break}return[a,c]}function ja(e){const{sourceX:A,sourceY:t,sourcePosition:n=HA.Bottom,targetX:o,targetY:a,targetPosition:c=HA.Top}=e,[d,h]=Za({pos:n,x1:A,y1:t,x2:o,y2:a}),[g,B]=Za({pos:c,x1:o,y1:a,x2:A,y2:t}),[w,m,y,v]=Ya({sourceX:A,sourceY:t,targetX:o,targetY:a,sourceControlX:d,sourceControlY:h,targetControlX:g,targetControlY:B});return[`M${A},${t} C${d},${h} ${g},${B} ${o},${a}`,w,m,y,v]}var qa={[HA.Left]:{x:-1,y:0},[HA.Right]:{x:1,y:0},[HA.Top]:{x:0,y:-1},[HA.Bottom]:{x:0,y:1}};function KB({source:e,sourcePosition:A=HA.Bottom,target:t}){return A===HA.Left||A===HA.Right?e.x<t.x?{x:1,y:0}:{x:-1,y:0}:e.y<t.y?{x:0,y:1}:{x:0,y:-1}}function Al(e,A){return Math.sqrt((A.x-e.x)**2+(A.y-e.y)**2)}function RB({source:e,sourcePosition:A=HA.Bottom,target:t,targetPosition:n=HA.Top,center:o,offset:a}){const c=qa[A],d=qa[n],h={x:e.x+c.x*a,y:e.y+c.y*a},g={x:t.x+d.x*a,y:t.y+d.y*a},B=KB({source:h,sourcePosition:A,target:g}),w=B.x!==0?"x":"y",m=B[w];let y,v,I;const L={x:0,y:0},k={x:0,y:0},[V,F,M,tA]=Wa({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(c[w]*d[w]===-1){v=o.x??V,I=o.y??F;const W=[{x:v,y:h.y},{x:v,y:g.y}],aA=[{x:h.x,y:I},{x:g.x,y:I}];c[w]===m?y=w==="x"?W:aA:y=w==="x"?aA:W}else{const W=[{x:h.x,y:g.y}],aA=[{x:g.x,y:h.y}];if(w==="x"?y=c.x===m?aA:W:y=c.y===m?W:aA,A===n){const oA=Math.abs(e[w]-t[w]);if(oA<=a){const AA=Math.min(a-1,a-oA);c[w]===m?L[w]=(h[w]>e[w]?-1:1)*AA:k[w]=(g[w]>t[w]?-1:1)*AA}}if(A!==n){const oA=w==="x"?"y":"x",AA=c[w]===d[oA],O=h[oA]>g[oA],lA=h[oA]<g[oA];(c[w]===1&&(!AA&&O||AA&&lA)||c[w]!==1&&(!AA&&lA||AA&&O))&&(y=w==="x"?W:aA)}const dA={x:h.x+L.x,y:h.y+L.y},rA={x:g.x+k.x,y:g.y+k.y};Math.max(Math.abs(dA.x-y[0].x),Math.abs(rA.x-y[0].x))>=Math.max(Math.abs(dA.y-y[0].y),Math.abs(rA.y-y[0].y))?(v=(dA.x+rA.x)/2,I=y[0].y):(v=y[0].x,I=(dA.y+rA.y)/2)}return[[e,{x:h.x+L.x,y:h.y+L.y},...y,{x:g.x+k.x,y:g.y+k.y},t],v,I,M,tA]}function VB(e,A,t,n){const o=Math.min(Al(e,A)/2,Al(A,t)/2,n),{x:a,y:c}=A;if(e.x===a&&a===t.x||e.y===c&&c===t.y)return`L${a} ${c}`;if(e.y===c){const h=e.x<t.x?-1:1,g=e.y<t.y?1:-1;return`L ${a+o*h},${c}Q ${a},${c} ${a},${c+o*g}`}const d=e.x<t.x?1:-1;return`L ${a},${c+o*(e.y<t.y?-1:1)}Q ${a},${c} ${a+o*d},${c}`}function gi(e){const{sourceX:A,sourceY:t,sourcePosition:n=HA.Bottom,targetX:o,targetY:a,targetPosition:c=HA.Top,borderRadius:d=5,centerX:h,centerY:g,offset:B=20}=e,[w,m,y,v,I]=RB({source:{x:A,y:t},sourcePosition:n,target:{x:o,y:a},targetPosition:c,center:{x:h,y:g},offset:B});return[w.reduce((L,k,V)=>{let F;return V>0&&V<w.length-1?F=VB(w[V-1],k,w[V+1],d):F=`${V===0?"M":"L"}${k.x} ${k.y}`,L+=F,L},""),m,y,v,I]}function PB(e){const{sourceX:A,sourceY:t,targetX:n,targetY:o}=e,[a,c,d,h]=Wa({sourceX:A,sourceY:t,targetX:n,targetY:o});return[`M ${A},${t}L ${n},${o}`,a,c,d,h]}var GB=(0,r.defineComponent)({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:A}){return()=>{const[t,n,o]=PB(e);return(0,r.h)(Nn,{path:t,labelX:n,labelY:o,...A,...e})}}}),el=(0,r.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(e,{attrs:A}){return()=>{const[t,n,o]=gi({...e,sourcePosition:e.sourcePosition??HA.Bottom,targetPosition:e.targetPosition??HA.Top});return(0,r.h)(Nn,{path:t,labelX:n,labelY:o,...A,...e})}}}),zB=(0,r.defineComponent)({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:A}){return()=>(0,r.h)(el,{...e,...A,borderRadius:0})}}),$B=(0,r.defineComponent)({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:A}){return()=>{const[t,n,o]=fi({...e,sourcePosition:e.sourcePosition??HA.Bottom,targetPosition:e.targetPosition??HA.Top});return(0,r.h)(Nn,{path:t,labelX:n,labelY:o,...A,...e})}}}),XB=(0,r.defineComponent)({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:A}){return()=>{const[t,n,o]=ja({...e,sourcePosition:e.sourcePosition??HA.Bottom,targetPosition:e.targetPosition??HA.Top});return(0,r.h)(Nn,{path:t,labelX:n,labelY:o,...A,...e})}}}),WB={input:DB,default:SB,output:xB},YB={default:$B,straight:GB,step:zB,smoothstep:el,simplebezier:XB};function JB(e,A,t){const n=(0,r.computed)(()=>v=>A.value.get(v)),o=(0,r.computed)(()=>v=>t.value.get(v)),a=(0,r.computed)(()=>{const v={...YB,...e.edgeTypes},I=Object.keys(v);for(const L of e.edges)L.type&&!I.includes(L.type)&&(v[L.type]=L.type);return v}),c=(0,r.computed)(()=>{const v={...WB,...e.nodeTypes},I=Object.keys(v);for(const L of e.nodes)L.type&&!I.includes(L.type)&&(v[L.type]=L.type);return v}),d=(0,r.computed)(()=>e.onlyRenderVisibleElements?Ba(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),h=(0,r.computed)(()=>{if(e.onlyRenderVisibleElements){const v=[];for(const I of e.edges){const L=A.value.get(I.source),k=A.value.get(I.target);AB({sourcePos:L.computedPosition||{x:0,y:0},targetPos:k.computedPosition||{x:0,y:0},sourceWidth:L.dimensions.width,sourceHeight:L.dimensions.height,targetWidth:k.dimensions.width,targetHeight:k.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&v.push(I)}return v}return e.edges}),g=(0,r.computed)(()=>[...d.value,...h.value]),B=(0,r.computed)(()=>{const v=[];for(const I of e.nodes)I.selected&&v.push(I);return v}),w=(0,r.computed)(()=>{const v=[];for(const I of e.edges)I.selected&&v.push(I);return v}),m=(0,r.computed)(()=>[...B.value,...w.value]),y=(0,r.computed)(()=>{const v=[];for(const I of e.nodes)I.dimensions.width&&I.dimensions.height&&I.handleBounds!==void 0&&v.push(I);return v});return{getNode:n,getEdge:o,getElements:g,getEdgeTypes:a,getNodeTypes:c,getEdges:h,getNodes:d,getSelectedElements:m,getSelectedNodes:B,getSelectedEdges:w,getNodesInitialized:y,areNodesInitialized:(0,r.computed)(()=>d.value.length>0&&y.value.length===d.value.length)}}var ZB=class dn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var A;const t=(A=(0,r.getCurrentInstance)())==null?void 0:A.appContext.app;return dn.instance=t?.config.globalProperties.$vueFlowStorage??dn.instance??new dn,t&&(t.config.globalProperties.$vueFlowStorage=dn.instance),dn.instance}set(A,t){return this.flows.set(A,t)}get(A){return this.flows.get(A)}remove(A){return this.flows.delete(A)}create(A,t){const n=(0,r.reactive)(Xa()),o={};for(const[w,m]of Object.entries(n.hooks)){const y=`on${w.charAt(0).toUpperCase()+w.slice(1)}`;o[y]=m.on}const a={};for(const[w,m]of Object.entries(n.hooks))a[w]=m.trigger;const c=(0,r.computed)(()=>{const w=new Map;for(const m of n.nodes)w.set(m.id,m);return w}),d=(0,r.computed)(()=>{const w=new Map;for(const m of n.edges)w.set(m.id,m);return w}),h=JB(n,c,d),g=HB(n,c,d);g.setState({...n,...t});const B={...o,...h,...g,...Wu(n),nodeLookup:c,edgeLookup:d,emits:a,id:A,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(A)}};return this.set(A,B),B}getId(){return`vue-flow-${this.currentId++}`}};function JA(e){const A=ZB.getInstance(),t=(0,r.getCurrentScope)(),n=typeof e=="object",o=n?e:{id:e},a=o.id,c=a??t?.vueFlowId;let d;if(t){const h=(0,r.inject)(Ka,null);typeof h<"u"&&h!==null&&(!c||h.id===c)&&(d=h)}if(d||c&&(d=A.get(c)),!d||c&&d.id!==c){const h=a??A.getId(),g=A.create(h,o);d=g,(t??(0,r.effectScope)(!0)).run(()=>{(0,r.watch)(g.applyDefault,(B,w,m)=>{const y=I=>{g.applyNodeChanges(I)},v=I=>{g.applyEdgeChanges(I)};B?(g.onNodesChange(y),g.onEdgesChange(v)):(g.hooks.value.nodesChange.off(y),g.hooks.value.edgesChange.off(v)),m(()=>{g.hooks.value.nodesChange.off(y),g.hooks.value.edgesChange.off(v)})},{immediate:!0}),hn(()=>{if(d){const B=A.get(d.id);B?B.$destroy():Dn(`No store instance found for id ${d.id} in storage.`)}})})}else n&&d.setState(o);if(t&&((0,r.provide)(Ka,d),t.vueFlowId=d.id),n){const h=(0,r.getCurrentInstance)();h?.type.name!=="VueFlow"&&d.emits.error(new de(ae.USEVUEFLOW_OPTIONS))}return d}function jB(e){const{emits:A,dimensions:t}=JA();let n;(0,r.onMounted)(()=>{const o=()=>{var a,c;if(!e.value||!(((c=(a=e.value).checkVisibility)==null?void 0:c.call(a))??!0))return;const d=vr(e.value);(d.width===0||d.height===0)&&A.error(new de(ae.MISSING_VIEWPORT_DIMENSIONS)),t.value={width:d.width||500,height:d.height||500}};o(),window.addEventListener("resize",o),e.value&&(n=new ResizeObserver(()=>o()),n.observe(e.value)),(0,r.onBeforeUnmount)(()=>{window.removeEventListener("resize",o),n&&e.value&&n.unobserve(e.value)})})}var qB=(0,r.defineComponent)({name:"UserSelection",compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(e){return(A,t)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"vue-flow__selection vue-flow__container",style:(0,r.normalizeStyle)({width:`${A.userSelectionRect.width}px`,height:`${A.userSelectionRect.height}px`,transform:`translate(${A.userSelectionRect.x}px, ${A.userSelectionRect.y}px)`})},null,4))}}),Ap=["tabIndex"],ep=(0,r.defineComponent)({name:"NodesSelection",compatConfig:{MODE:3},setup(e){const{emits:A,viewport:t,getSelectedNodes:n,noPanClassName:o,disableKeyboardA11y:a,userSelectionActive:c}=JA(),d=$a(),h=(0,r.ref)(null),g=Pa({el:h,onStart(v){A.selectionDragStart(v),A.nodeDragStart(v)},onDrag(v){A.selectionDrag(v),A.nodeDrag(v)},onStop(v){A.selectionDragStop(v),A.nodeDragStop(v)}});(0,r.onMounted)(()=>{var v;a.value||(v=h.value)==null||v.focus({preventScroll:!0})});const B=(0,r.computed)(()=>ha(n.value)),w=(0,r.computed)(()=>({width:`${B.value.width}px`,height:`${B.value.height}px`,top:`${B.value.y}px`,left:`${B.value.x}px`}));function m(v){A.selectionContextMenu({event:v,nodes:n.value})}function y(v){a.value||Wt[v.key]&&(v.preventDefault(),d({x:Wt[v.key].x,y:Wt[v.key].y},v.shiftKey))}return(v,I)=>!(0,r.unref)(c)&&B.value.width&&B.value.height?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:(0,r.normalizeClass)(["vue-flow__nodesselection vue-flow__container",(0,r.unref)(o)]),style:(0,r.normalizeStyle)({transform:`translate(${(0,r.unref)(t).x}px,${(0,r.unref)(t).y}px) scale(${(0,r.unref)(t).zoom})`})},[(0,r.createElementVNode)("div",{ref_key:"el",ref:h,class:(0,r.normalizeClass)([{dragging:(0,r.unref)(g)},"vue-flow__nodesselection-rect"]),style:(0,r.normalizeStyle)(w.value),tabIndex:(0,r.unref)(a)?void 0:-1,onContextmenu:m,onKeydown:y},null,46,Ap)],6)):(0,r.createCommentVNode)("",!0)}});function tp(e,A){return{x:e.clientX-A.left,y:e.clientY-A.top}}var np=(0,r.defineComponent)({name:"Pane",compatConfig:{MODE:3},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:A,nodes:t,viewport:n,emits:o,userSelectionActive:a,removeSelectedElements:c,userSelectionRect:d,elementsSelectable:h,nodesSelectionActive:g,getSelectedEdges:B,getSelectedNodes:w,removeNodes:m,removeEdges:y,selectionMode:v,deleteKeyCode:I,multiSelectionKeyCode:L,multiSelectionActive:k,edgeLookup:V,nodeLookup:F,connectionLookup:M,defaultEdgeOptions:tA,connectionStartHandle:W,panOnDrag:aA}=JA(),dA=(0,r.shallowRef)(null),rA=(0,r.shallowRef)(new Set),oA=(0,r.shallowRef)(new Set),AA=(0,r.shallowRef)(null),O=(0,r.toRef)(()=>h.value&&(e.isSelecting||a.value)),lA=(0,r.toRef)(()=>W.value!==null);let _=!1,Z=!1;const U=In(I,{actInsideInputWithModifier:!1}),x=In(L);(0,r.watch)(U,eA=>{eA&&(m(w.value),y(B.value),g.value=!1)}),(0,r.watch)(x,eA=>{k.value=eA});function G(eA,uA){return Y=>{Y.target===uA&&eA?.(Y)}}function R(eA){if(_||lA.value){_=!1;return}o.paneClick(eA),c(),g.value=!1}function $(eA){var uA;if(Array.isArray(aA.value)&&((uA=aA.value)!=null&&uA.includes(2))){eA.preventDefault();return}o.paneContextMenu(eA)}function J(eA){o.paneScroll(eA)}function nA(eA){var uA,Y,cA;if(AA.value=((uA=A.value)==null?void 0:uA.getBoundingClientRect())??null,!h.value||!e.isSelecting||eA.button!==0||eA.target!==dA.value||!AA.value)return;(cA=(Y=eA.target)==null?void 0:Y.setPointerCapture)==null||cA.call(Y,eA.pointerId);const{x:mA,y:yA}=tp(eA,AA.value);Z=!0,_=!1,c(),d.value={width:0,height:0,startX:mA,startY:yA,x:mA,y:yA},o.selectionStart(eA)}function BA(eA){var uA;if(!AA.value||!d.value)return;_=!0;const{x:Y,y:cA}=$e(eA,AA.value),{startX:mA=0,startY:yA=0}=d.value,IA={startX:mA,startY:yA,x:Y<mA?Y:mA,y:cA<yA?cA:yA,width:Math.abs(Y-mA),height:Math.abs(cA-yA)},fA=rA.value,vA=oA.value;rA.value=new Set(Ba(t.value,IA,n.value,v.value===ei.Partial,!0).map(H=>H.id)),oA.value=new Set;const S=((uA=tA.value)==null?void 0:uA.selectable)??!0;for(const H of rA.value){const T=M.value.get(H);if(T)for(const{edgeId:D}of T.values()){const b=V.value.get(D);b&&(b.selectable??S)&&oA.value.add(D)}}if(!Oa(fA,rA.value)){const H=gt(F.value,rA.value,!0);o.nodesChange(H)}if(!Oa(vA,oA.value)){const H=gt(V.value,oA.value);o.edgesChange(H)}d.value=IA,a.value=!0,g.value=!1}function UA(eA){var uA;eA.button!==0||!Z||((uA=eA.target)==null||uA.releasePointerCapture(eA.pointerId),!a.value&&d.value&&eA.target===dA.value&&R(eA),a.value=!1,d.value=null,g.value=rA.value.size>0,o.selectionEnd(eA),e.selectionKeyPressed&&(_=!1),Z=!1)}return(eA,uA)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"container",ref:dA,class:(0,r.normalizeClass)(["vue-flow__pane vue-flow__container",{selection:eA.isSelecting}]),onClick:uA[0]||(uA[0]=Y=>O.value?void 0:G(R,dA.value)(Y)),onContextmenu:uA[1]||(uA[1]=Y=>G($,dA.value)(Y)),onWheelPassive:uA[2]||(uA[2]=Y=>G(J,dA.value)(Y)),onPointerenter:uA[3]||(uA[3]=Y=>O.value?void 0:(0,r.unref)(o).paneMouseEnter(Y)),onPointerdown:uA[4]||(uA[4]=Y=>O.value?nA(Y):(0,r.unref)(o).paneMouseMove(Y)),onPointermove:uA[5]||(uA[5]=Y=>O.value?BA(Y):(0,r.unref)(o).paneMouseMove(Y)),onPointerup:uA[6]||(uA[6]=Y=>O.value?UA(Y):void 0),onPointerleave:uA[7]||(uA[7]=Y=>(0,r.unref)(o).paneMouseLeave(Y))},[(0,r.renderSlot)(eA.$slots,"default"),(0,r.unref)(a)&&(0,r.unref)(d)?((0,r.openBlock)(),(0,r.createBlock)(qB,{key:0,"user-selection-rect":(0,r.unref)(d)},null,8,["user-selection-rect"])):(0,r.createCommentVNode)("",!0),(0,r.unref)(g)&&(0,r.unref)(w).length?((0,r.openBlock)(),(0,r.createBlock)(ep,{key:1})):(0,r.createCommentVNode)("",!0)],34))}}),rp=(0,r.defineComponent)({name:"Transform",compatConfig:{MODE:3},setup(e){const{viewport:A,fitViewOnInit:t,fitViewOnInitDone:n}=JA(),o=(0,r.computed)(()=>t.value?!n.value:!1),a=(0,r.computed)(()=>`translate(${A.value.x}px,${A.value.y}px) scale(${A.value.zoom})`);return(c,d)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"vue-flow__transformationpane vue-flow__container",style:(0,r.normalizeStyle)({transform:a.value,opacity:o.value?0:void 0})},[(0,r.renderSlot)(c.$slots,"default")],4))}}),op=(0,r.defineComponent)({name:"Viewport",compatConfig:{MODE:3},setup(e){const{minZoom:A,maxZoom:t,defaultViewport:n,translateExtent:o,zoomActivationKeyCode:a,selectionKeyCode:c,panActivationKeyCode:d,panOnScroll:h,panOnScrollMode:g,panOnScrollSpeed:B,panOnDrag:w,zoomOnDoubleClick:m,zoomOnPinch:y,zoomOnScroll:v,preventScrolling:I,noWheelClassName:L,noPanClassName:k,emits:V,connectionStartHandle:F,userSelectionActive:M,paneDragging:tA,d3Zoom:W,d3Selection:aA,d3ZoomHandler:dA,viewport:rA,viewportRef:oA,paneClickDistance:AA}=JA();jB(oA);const O=(0,r.shallowRef)(!1),lA=(0,r.shallowRef)(!1);let _=null,Z=!1,U=0,x={x:0,y:0,zoom:0};const G=In(d),R=In(c),$=In(a),J=(0,r.toRef)(()=>(!R.value||R.value&&c.value===!0)&&(G.value||w.value)),nA=(0,r.toRef)(()=>G.value||h.value),BA=(0,r.toRef)(()=>c.value===!0&&J.value!==!0),UA=(0,r.toRef)(()=>R.value&&c.value!==!0||M.value||BA.value),eA=(0,r.toRef)(()=>F.value!==null);(0,r.onMounted)(()=>{if(!oA.value){Dn("Viewport element is missing");return}const yA=oA.value,IA=yA.getBoundingClientRect(),fA=Dh().clickDistance(AA.value).scaleExtent([A.value,t.value]).translateExtent(o.value),vA=ke(yA).call(fA),S=vA.on("wheel.zoom"),H=Xt.translate(n.value.x??0,n.value.y??0).scale(xt(n.value.zoom??1,A.value,t.value)),T=[[0,0],[IA.width,IA.height]],D=fA.constrain()(H,T,o.value);fA.transform(vA,D),fA.wheelDelta(Ca),W.value=fA,aA.value=vA,dA.value=S,rA.value={x:D.x,y:D.y,zoom:D.k},fA.on("start",b=>{var z;if(!b.sourceEvent)return null;U=b.sourceEvent.button,O.value=!0;const P=cA(b.transform);((z=b.sourceEvent)==null?void 0:z.type)==="mousedown"&&(tA.value=!0),x=P,V.viewportChangeStart(P),V.moveStart({event:b,flowTransform:P})}),fA.on("end",b=>{if(!b.sourceEvent)return null;if(O.value=!1,tA.value=!1,uA(J.value,U??0)&&!Z&&V.paneContextMenu(b.sourceEvent),Z=!1,Y(x,b.transform)){const z=cA(b.transform);x=z,V.viewportChangeEnd(z),V.moveEnd({event:b,flowTransform:z})}}),fA.filter(b=>{var z;const P=$.value||v.value,hA=y.value&&b.ctrlKey,iA=b.button,SA=b.type==="wheel";if(iA===1&&b.type==="mousedown"&&(mA(b,"vue-flow__node")||mA(b,"vue-flow__edge")))return!0;if(!J.value&&!P&&!nA.value&&!m.value&&!y.value||M.value||eA.value&&!SA||!m.value&&b.type==="dblclick"||mA(b,L.value)&&SA||mA(b,k.value)&&(!SA||nA.value&&SA&&!$.value)||!y.value&&b.ctrlKey&&SA||!P&&!nA.value&&!hA&&SA)return!1;if(!y&&b.type==="touchstart"&&((z=b.touches)==null?void 0:z.length)>1)return b.preventDefault(),!1;if(!J.value&&(b.type==="mousedown"||b.type==="touchstart")||BA.value&&Array.isArray(w.value)&&w.value.includes(0)&&iA===0||Array.isArray(w.value)&&!w.value.includes(iA)&&(b.type==="mousedown"||b.type==="touchstart"))return!1;const xA=Array.isArray(w.value)&&w.value.includes(iA)||c.value===!0&&Array.isArray(w.value)&&!w.value.includes(0)||!iA||iA<=1;return(!b.ctrlKey||G.value||SA)&&xA}),(0,r.watch)([M,J],()=>{M.value&&!O.value?fA.on("zoom",null):M.value||fA.on("zoom",b=>{rA.value={x:b.transform.x,y:b.transform.y,zoom:b.transform.k};const z=cA(b.transform);Z=uA(J.value,U??0),V.viewportChange(z),V.move({event:b,flowTransform:z})})},{immediate:!0}),(0,r.watch)([M,nA,g,$,y,I,L],()=>{nA.value&&!$.value&&!M.value?vA.on("wheel.zoom",b=>{if(mA(b,L.value))return!1;const z=$.value||v.value,P=y.value&&b.ctrlKey;if(!(!I.value||nA.value||z||P))return!1;b.preventDefault(),b.stopImmediatePropagation();const hA=vA.property("__zoom").k||1,iA=Er();if(!G.value&&b.ctrlKey&&y.value&&iA){const ZA=Ve(b),PA=hA*2**Ca(b);fA.scaleTo(vA,PA,ZA,b);return}const SA=b.deltaMode===1?20:1;let xA=g.value===bn.Vertical?0:b.deltaX*SA,VA=g.value===bn.Horizontal?0:b.deltaY*SA;!iA&&b.shiftKey&&g.value!==bn.Vertical&&!xA&&VA&&(xA=VA,VA=0),fA.translateBy(vA,-(xA/hA)*B.value,-(VA/hA)*B.value);const oe=cA(vA.property("__zoom"));_&&clearTimeout(_),lA.value?(V.move({event:b,flowTransform:oe}),V.viewportChange(oe),_=setTimeout(()=>{V.moveEnd({event:b,flowTransform:oe}),V.viewportChangeEnd(oe),lA.value=!1},150)):(lA.value=!0,V.moveStart({event:b,flowTransform:oe}),V.viewportChangeStart(oe))},{passive:!1}):typeof S<"u"&&vA.on("wheel.zoom",function(b,z){const P=!I.value&&b.type==="wheel"&&!b.ctrlKey,hA=$.value||v.value,iA=y.value&&b.ctrlKey;if(!hA&&!h.value&&!iA&&b.type==="wheel"||P||mA(b,L.value))return null;b.preventDefault(),S.call(this,b,z)},{passive:!1})},{immediate:!0})});function uA(yA,IA){return IA===2&&Array.isArray(yA)&&yA.includes(2)}function Y(yA,IA){return yA.x!==IA.x&&!Number.isNaN(IA.x)||yA.y!==IA.y&&!Number.isNaN(IA.y)||yA.zoom!==IA.k&&!Number.isNaN(IA.k)}function cA(yA){return{x:yA.x,y:yA.y,zoom:yA.k}}function mA(yA,IA){return yA.target.closest(`.${IA}`)}return(yA,IA)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"viewportRef",ref:oA,class:"vue-flow__viewport vue-flow__container"},[(0,r.createVNode)(np,{"is-selecting":UA.value,"selection-key-pressed":(0,r.unref)(R),class:(0,r.normalizeClass)({connecting:eA.value,dragging:(0,r.unref)(tA),draggable:(0,r.unref)(w)===!0||Array.isArray((0,r.unref)(w))&&(0,r.unref)(w).includes(0)})},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(rp,null,{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(yA.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),ip=["id"],sp=["id"],ap=["id"],lp=(0,r.defineComponent)({name:"A11yDescriptions",compatConfig:{MODE:3},setup(e){const{id:A,disableKeyboardA11y:t,ariaLiveMessage:n}=JA();return(o,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("div",{id:`${(0,r.unref)(ia)}-${(0,r.unref)(A)}`,style:{display:"none"}}," Press enter or space to select a node. "+(0,r.toDisplayString)((0,r.unref)(t)?"":"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,ip),(0,r.createElementVNode)("div",{id:`${(0,r.unref)(sa)}-${(0,r.unref)(A)}`,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,sp),(0,r.unref)(t)?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,id:`${(0,r.unref)(Oh)}-${(0,r.unref)(A)}`,"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,r.toDisplayString)((0,r.unref)(n)),9,ap))],64))}});function cp(){const e=JA();(0,r.watch)(()=>e.viewportHelper.value.viewportInitialized,A=>{A&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function up(e,A,t){return t===HA.Left?e-A:t===HA.Right?e+A:e}function dp(e,A,t){return t===HA.Top?e-A:t===HA.Bottom?e+A:e}var hi=function({radius:e=10,centerX:A=0,centerY:t=0,position:n=HA.Top,type:o}){return(0,r.h)("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${o}`,cx:up(A,e,n),cy:dp(t,e,n),r:e,stroke:"transparent",fill:"transparent"})};hi.props=["radius","centerX","centerY","position","type"],hi.compatConfig={MODE:3};var tl=hi,fp=(0,r.defineComponent)({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:A,addSelectedEdges:t,connectionMode:n,edgeUpdaterRadius:o,emits:a,nodesSelectionActive:c,noPanClassName:d,getEdgeTypes:h,removeSelectedEdges:g,findEdge:B,findNode:w,isValidConnection:m,multiSelectionActive:y,disableKeyboardA11y:v,elementsSelectable:I,edgesUpdatable:L,edgesFocusable:k,hooks:V}=JA(),F=(0,r.computed)(()=>B(e.id)),{emit:M,on:tA}=BB(F.value,a),W=(0,r.inject)(Ur),aA=(0,r.getCurrentInstance)(),dA=(0,r.ref)(!1),rA=(0,r.ref)(!1),oA=(0,r.ref)(""),AA=(0,r.ref)(null),O=(0,r.ref)("source"),lA=(0,r.ref)(null),_=(0,r.toRef)(()=>typeof F.value.selectable>"u"?I.value:F.value.selectable),Z=(0,r.toRef)(()=>typeof F.value.updatable>"u"?L.value:F.value.updatable),U=(0,r.toRef)(()=>typeof F.value.focusable>"u"?k.value:F.value.focusable);(0,r.provide)(fB,e.id),(0,r.provide)(gB,lA);const x=(0,r.computed)(()=>F.value.class instanceof Function?F.value.class(F.value):F.value.class),G=(0,r.computed)(()=>F.value.style instanceof Function?F.value.style(F.value):F.value.style),R=(0,r.computed)(()=>{const H=F.value.type||"default",T=W?.[`edge-${H}`];if(T)return T;let D=F.value.template??h.value[H];if(typeof D=="string"&&aA){const b=Object.keys(aA.appContext.components);b&&b.includes(H)&&(D=(0,r.resolveComponent)(H,!1))}return D&&typeof D!="string"?D:(a.error(new de(ae.EDGE_TYPE_MISSING,D)),!1)}),{handlePointerDown:$}=Ga({nodeId:oA,handleId:AA,type:O,isValidConnection:m,edgeUpdaterType:O,onEdgeUpdate:BA,onEdgeUpdateEnd:UA});return()=>{const H=w(F.value.source),T=w(F.value.target),D="pathOptions"in F.value?F.value.pathOptions:{};if(!H&&!T)return a.error(new de(ae.EDGE_SOURCE_TARGET_MISSING,F.value.id,F.value.source,F.value.target)),null;if(!H)return a.error(new de(ae.EDGE_SOURCE_MISSING,F.value.id,F.value.source)),null;if(!T)return a.error(new de(ae.EDGE_TARGET_MISSING,F.value.id,F.value.target)),null;if(!F.value||F.value.hidden||H.hidden||T.hidden)return null;let b;n.value===tt.Strict?b=H.handleBounds.source:b=[...H.handleBounds.source||[],...H.handleBounds.target||[]];const z=_a(b,F.value.sourceHandle);let P;n.value===tt.Strict?P=T.handleBounds.target:P=[...T.handleBounds.target||[],...T.handleBounds.source||[]];const hA=_a(P,F.value.targetHandle),iA=z?.position||HA.Bottom,SA=hA?.position||HA.Top,{x:xA,y:VA}=Jt(H,z,iA),{x:oe,y:ZA}=Jt(T,hA,SA);return F.value.sourceX=xA,F.value.sourceY=VA,F.value.targetX=oe,F.value.targetY=ZA,(0,r.h)("g",{ref:lA,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${R.value===!1?"default":F.value.type||"default"}`,d.value,x.value,{updating:dA.value,selected:F.value.selected,animated:F.value.animated,inactive:!_.value&&!V.value.edgeClick.hasListeners()}],tabIndex:U.value?0:void 0,"aria-label":F.value.ariaLabel===null?void 0:F.value.ariaLabel??`Edge from ${F.value.source} to ${F.value.target}`,"aria-describedby":U.value?`${sa}-${A}`:void 0,"aria-roledescription":"edge",role:U.value?"group":"img",...F.value.domAttributes,onClick:uA,onContextmenu:Y,onDblclick:cA,onMouseenter:mA,onMousemove:yA,onMouseleave:IA,onKeyDown:U.value?S:void 0},[rA.value?null:(0,r.h)(R.value===!1?h.value.default:R.value,{id:e.id,sourceNode:H,targetNode:T,source:F.value.source,target:F.value.target,type:F.value.type,updatable:Z.value,selected:F.value.selected,animated:F.value.animated,label:F.value.label,labelStyle:F.value.labelStyle,labelShowBg:F.value.labelShowBg,labelBgStyle:F.value.labelBgStyle,labelBgPadding:F.value.labelBgPadding,labelBgBorderRadius:F.value.labelBgBorderRadius,data:F.value.data,events:{...F.value.events,...tA},style:G.value,markerStart:`url('#${xn(F.value.markerStart,A)}')`,markerEnd:`url('#${xn(F.value.markerEnd,A)}')`,sourcePosition:iA,targetPosition:SA,sourceX:xA,sourceY:VA,targetX:oe,targetY:ZA,sourceHandleId:F.value.sourceHandle,targetHandleId:F.value.targetHandle,interactionWidth:F.value.interactionWidth,...D}),[Z.value==="source"||Z.value===!0?[(0,r.h)("g",{onMousedown:fA,onMouseenter:J,onMouseout:nA},(0,r.h)(tl,{position:iA,centerX:xA,centerY:VA,radius:o.value,type:"source","data-type":"source"}))]:null,Z.value==="target"||Z.value===!0?[(0,r.h)("g",{onMousedown:vA,onMouseenter:J,onMouseout:nA},(0,r.h)(tl,{position:SA,centerX:oe,centerY:ZA,radius:o.value,type:"target","data-type":"target"}))]:null]])};function J(){dA.value=!0}function nA(){dA.value=!1}function BA(H,T){M.update({event:H,edge:F.value,connection:T})}function UA(H){M.updateEnd({event:H,edge:F.value}),rA.value=!1}function eA(H,T){H.button===0&&(rA.value=!0,oA.value=T?F.value.target:F.value.source,AA.value=(T?F.value.targetHandle:F.value.sourceHandle)??null,O.value=T?"target":"source",M.updateStart({event:H,edge:F.value}),$(H))}function uA(H){var T;const D={event:H,edge:F.value};_.value&&(c.value=!1,F.value.selected&&y.value?(g([F.value]),(T=lA.value)==null||T.blur()):t([F.value])),M.click(D)}function Y(H){M.contextMenu({event:H,edge:F.value})}function cA(H){M.doubleClick({event:H,edge:F.value})}function mA(H){M.mouseEnter({event:H,edge:F.value})}function yA(H){M.mouseMove({event:H,edge:F.value})}function IA(H){M.mouseLeave({event:H,edge:F.value})}function fA(H){eA(H,!0)}function vA(H){eA(H,!1)}function S(H){var T;!v.value&&aa.includes(H.key)&&_.value&&(H.key==="Escape"?((T=lA.value)==null||T.blur(),g([B(e.id)])):t([B(e.id)]))}}}),gp=(0,r.defineComponent)({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:A,connectionMode:t,connectionStartHandle:n,connectionEndHandle:o,connectionPosition:a,connectionLineType:c,connectionLineStyle:d,connectionLineOptions:h,connectionStatus:g,viewport:B,findNode:w}=JA(),m=(e=(0,r.inject)(Ur))==null?void 0:e["connection-line"],y=(0,r.computed)(()=>{var V;return w((V=n.value)==null?void 0:V.nodeId)}),v=(0,r.computed)(()=>{var V;return w((V=o.value)==null?void 0:V.nodeId)??null}),I=(0,r.computed)(()=>({x:(a.value.x-B.value.x)/B.value.zoom,y:(a.value.y-B.value.y)/B.value.zoom})),L=(0,r.computed)(()=>h.value.markerStart?`url(#${xn(h.value.markerStart,A)})`:""),k=(0,r.computed)(()=>h.value.markerEnd?`url(#${xn(h.value.markerEnd,A)})`:"");return()=>{var V,F,M;if(!y.value||!n.value)return null;const tA=n.value.id,W=n.value.type,aA=y.value.handleBounds;let dA=aA?.[W]??[];if(t.value===tt.Loose){const G=aA?.[W==="source"?"target":"source"]??[];dA=[...dA,...G]}if(!dA)return null;const rA=(tA?dA.find(G=>G.id===tA):dA[0])??null,oA=rA?.position??HA.Top,{x:AA,y:O}=Jt(y.value,rA,oA);let lA=null;v.value&&(t.value===tt.Strict?lA=((V=v.value.handleBounds[W==="source"?"target":"source"])==null?void 0:V.find(G=>{var R;return G.id===((R=o.value)==null?void 0:R.id)}))||null:lA=((F=[...v.value.handleBounds.source??[],...v.value.handleBounds.target??[]])==null?void 0:F.find(G=>{var R;return G.id===((R=o.value)==null?void 0:R.id)}))||null);const _=((M=o.value)==null?void 0:M.position)??(oA?ai[oA]:null);if(!oA||!_)return null;const Z=c.value??h.value.type??St.Bezier;let U="";const x={sourceX:AA,sourceY:O,sourcePosition:oA,targetX:I.value.x,targetY:I.value.y,targetPosition:_};return Z===St.Bezier?[U]=fi(x):Z===St.Step?[U]=gi({...x,borderRadius:0}):Z===St.SmoothStep?[U]=gi(x):Z===St.SimpleBezier?[U]=ja(x):U=`M${AA},${O} ${I.value.x},${I.value.y}`,(0,r.h)("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},(0,r.h)("g",{class:"vue-flow__connection"},m?(0,r.h)(m,{sourceX:AA,sourceY:O,sourcePosition:oA,targetX:I.value.x,targetY:I.value.y,targetPosition:_,sourceNode:y.value,sourceHandle:rA,targetNode:v.value,targetHandle:lA,markerEnd:k.value,markerStart:L.value,connectionStatus:g.value}):(0,r.h)("path",{d:U,class:[h.value.class,g.value,"vue-flow__connection-path"],style:{...d.value,...h.value.style},"marker-end":k.value,"marker-start":L.value})))}}}),hp=["id","markerWidth","markerHeight","markerUnits","orient"],Bp=(0,r.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(e){return(A,t)=>((0,r.openBlock)(),(0,r.createElementBlock)("marker",{id:A.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${A.width}`,markerHeight:`${A.height}`,markerUnits:A.markerUnits,orient:A.orient},[A.type===(0,r.unref)(nt).ArrowClosed?((0,r.openBlock)(),(0,r.createElementBlock)("polyline",{key:0,style:(0,r.normalizeStyle)({stroke:A.color,fill:A.color,strokeWidth:A.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):(0,r.createCommentVNode)("",!0),A.type===(0,r.unref)(nt).Arrow?((0,r.openBlock)(),(0,r.createElementBlock)("polyline",{key:1,style:(0,r.normalizeStyle)({stroke:A.color,strokeWidth:A.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):(0,r.createCommentVNode)("",!0)],8,hp))}}),pp={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},mp=(0,r.defineComponent)({name:"MarkerDefinitions",compatConfig:{MODE:3},setup(e){const{id:A,edges:t,connectionLineOptions:n,defaultMarkerColor:o}=JA(),a=(0,r.computed)(()=>{const c=new Set,d=[],h=g=>{if(g){const B=xn(g,A);c.has(B)||(typeof g=="object"?d.push({...g,id:B,color:g.color||o.value}):d.push({id:B,color:o.value,type:g}),c.add(B))}};for(const g of[n.value.markerEnd,n.value.markerStart])h(g);for(const g of t.value)for(const B of[g.markerStart,g.markerEnd])h(B);return d.sort((g,B)=>g.id.localeCompare(B.id))});return(c,d)=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",pp,[(0,r.createElementVNode)("defs",null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.value,h=>((0,r.openBlock)(),(0,r.createBlock)(Bp,{id:h.id,key:h.id,type:h.type,color:h.color,width:h.width,height:h.height,markerUnits:h.markerUnits,"stroke-width":h.strokeWidth,orient:h.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),wp=(0,r.defineComponent)({name:"Edges",compatConfig:{MODE:3},setup(e){const{findNode:A,getEdges:t,elevateEdgesOnSelect:n}=JA();return(o,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(mp),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(t),c=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",{key:c.id,class:"vue-flow__edges vue-flow__container",style:(0,r.normalizeStyle)({zIndex:(0,r.unref)(eB)(c,(0,r.unref)(A),(0,r.unref)(n))})},[(0,r.createVNode)((0,r.unref)(fp),{id:c.id},null,8,["id"])],4))),128)),(0,r.createVNode)((0,r.unref)(gp))],64))}}),Cp=(0,r.defineComponent)({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:A,noPanClassName:t,selectNodesOnDrag:n,nodesSelectionActive:o,multiSelectionActive:a,emits:c,removeSelectedNodes:d,addSelectedNodes:h,updateNodeDimensions:g,onUpdateNodeInternals:B,getNodeTypes:w,nodeExtent:m,elevateNodesOnSelect:y,disableKeyboardA11y:v,ariaLiveMessage:I,snapToGrid:L,snapGrid:k,nodeDragThreshold:V,nodesDraggable:F,elementsSelectable:M,nodesConnectable:tA,nodesFocusable:W,hooks:aA}=JA(),dA=(0,r.ref)(null);(0,r.provide)(Va,dA),(0,r.provide)(Ra,e.id);const rA=(0,r.inject)(Ur),oA=(0,r.getCurrentInstance)(),AA=$a(),{node:O,parentNode:lA}=za(e.id),{emit:_,on:Z}=CB(O,c),U=(0,r.toRef)(()=>typeof O.draggable>"u"?F.value:O.draggable),x=(0,r.toRef)(()=>typeof O.selectable>"u"?M.value:O.selectable),G=(0,r.toRef)(()=>typeof O.connectable>"u"?tA.value:O.connectable),R=(0,r.toRef)(()=>typeof O.focusable>"u"?W.value:O.focusable),$=(0,r.computed)(()=>x.value||U.value||aA.value.nodeClick.hasListeners()||aA.value.nodeDoubleClick.hasListeners()||aA.value.nodeMouseEnter.hasListeners()||aA.value.nodeMouseMove.hasListeners()||aA.value.nodeMouseLeave.hasListeners()),J=(0,r.toRef)(()=>!!O.dimensions.width&&!!O.dimensions.height),nA=(0,r.computed)(()=>{const T=O.type||"default",D=rA?.[`node-${T}`];if(D)return D;let b=O.template||w.value[T];if(typeof b=="string"&&oA){const z=Object.keys(oA.appContext.components);z&&z.includes(T)&&(b=(0,r.resolveComponent)(T,!1))}return b&&typeof b!="string"?b:(c.error(new de(ae.NODE_TYPE_MISSING,b)),!1)}),BA=Pa({id:e.id,el:dA,disabled:()=>!U.value,selectable:x,dragHandle:()=>O.dragHandle,onStart(T){_.dragStart(T)},onDrag(T){_.drag(T)},onStop(T){_.dragStop(T)},onClick(T){S(T)}}),UA=(0,r.computed)(()=>O.class instanceof Function?O.class(O):O.class),eA=(0,r.computed)(()=>{const T=(O.style instanceof Function?O.style(O):O.style)||{},D=O.width instanceof Function?O.width(O):O.width,b=O.height instanceof Function?O.height(O):O.height;return!T.width&&D&&(T.width=typeof D=="string"?D:`${D}px`),!T.height&&b&&(T.height=typeof b=="string"?b:`${b}px`),T}),uA=(0,r.toRef)(()=>Number(O.zIndex??eA.value.zIndex??0));return B(T=>{(T.includes(e.id)||!T.length)&&cA()}),(0,r.onMounted)(()=>{(0,r.watch)(()=>O.hidden,(T=!1,D,b)=>{!T&&dA.value&&(e.resizeObserver.observe(dA.value),b(()=>{dA.value&&e.resizeObserver.unobserve(dA.value)}))},{immediate:!0,flush:"post"})}),(0,r.watch)([()=>O.type,()=>O.sourcePosition,()=>O.targetPosition],()=>{(0,r.nextTick)(()=>{g([{id:e.id,nodeElement:dA.value,forceUpdate:!0}])})}),(0,r.watch)([()=>O.position.x,()=>O.position.y,()=>{var T;return(T=lA.value)==null?void 0:T.computedPosition.x},()=>{var T;return(T=lA.value)==null?void 0:T.computedPosition.y},()=>{var T;return(T=lA.value)==null?void 0:T.computedPosition.z},uA,()=>O.selected,()=>O.dimensions.height,()=>O.dimensions.width,()=>{var T;return(T=lA.value)==null?void 0:T.dimensions.height},()=>{var T;return(T=lA.value)==null?void 0:T.dimensions.width}],([T,D,b,z,P,hA])=>{const iA={x:T,y:D,z:hA+(y.value&&O.selected?1e3:0)};typeof b<"u"&&typeof z<"u"?O.computedPosition=Yh({x:b,y:z,z:P},iA):O.computedPosition=iA},{flush:"post",immediate:!0}),(0,r.watch)([()=>O.extent,m],([T,D],[b,z])=>{(T!==b||D!==z)&&Y()}),O.extent==="parent"||typeof O.extent=="object"&&"range"in O.extent&&O.extent.range==="parent"?No(()=>J).toBe(!0).then(Y):Y(),()=>O.hidden?null:(0,r.h)("div",{ref:dA,"data-id":O.id,class:["vue-flow__node",`vue-flow__node-${nA.value===!1?"default":O.type||"default"}`,{[t.value]:U.value,dragging:BA?.value,draggable:U.value,selected:O.selected,selectable:x.value,parent:O.isParent},UA.value],style:{visibility:J.value?"visible":"hidden",zIndex:O.computedPosition.z??uA.value,transform:`translate(${O.computedPosition.x}px,${O.computedPosition.y}px)`,pointerEvents:$.value?"all":"none",...eA.value},tabIndex:R.value?0:void 0,role:R.value?"group":void 0,"aria-describedby":v.value?void 0:`${ia}-${A}`,"aria-label":O.ariaLabel,"aria-roledescription":"node",...O.domAttributes,onMouseenter:mA,onMousemove:yA,onMouseleave:IA,onContextmenu:fA,onClick:S,onDblclick:vA,onKeydown:H},[(0,r.h)(nA.value===!1?w.value.default:nA.value,{id:O.id,type:O.type,data:O.data,events:{...O.events,...Z},selected:O.selected,resizing:O.resizing,dragging:BA.value,connectable:G.value,position:O.computedPosition,dimensions:O.dimensions,isValidTargetPos:O.isValidTargetPos,isValidSourcePos:O.isValidSourcePos,parent:O.parentNode,parentNodeId:O.parentNode,zIndex:O.computedPosition.z??uA.value,targetPosition:O.targetPosition,sourcePosition:O.sourcePosition,label:O.label,dragHandle:O.dragHandle,onUpdateNodeInternals:cA})]);function Y(){const T=O.computedPosition,{computedPosition:D,position:b}=oi(O,L.value?Fr(T,k.value):T,c.error,m.value,lA.value);(O.computedPosition.x!==D.x||O.computedPosition.y!==D.y)&&(O.computedPosition={...O.computedPosition,...D}),(O.position.x!==b.x||O.position.y!==b.y)&&(O.position=b)}function cA(){dA.value&&g([{id:e.id,nodeElement:dA.value,forceUpdate:!0}])}function mA(T){BA?.value||_.mouseEnter({event:T,node:O})}function yA(T){BA?.value||_.mouseMove({event:T,node:O})}function IA(T){BA?.value||_.mouseLeave({event:T,node:O})}function fA(T){return _.contextMenu({event:T,node:O})}function vA(T){return _.doubleClick({event:T,node:O})}function S(T){x.value&&(!n.value||!U.value||V.value>0)&&li(O,a.value,h,d,o,!1,dA.value),_.click({event:T,node:O})}function H(T){if(!(ti(T)||v.value))if(aa.includes(T.key)&&x.value){const D=T.key==="Escape";li(O,a.value,h,d,o,D,dA.value)}else U.value&&O.selected&&Wt[T.key]&&(T.preventDefault(),I.value=`Moved selected node ${T.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~O.position.x}, y: ${~~O.position.y}`,AA({x:Wt[T.key].x,y:Wt[T.key].y},T.shiftKey))}}}),yp={height:"0",width:"0"},vp=(0,r.defineComponent)({name:"EdgeLabelRenderer",compatConfig:{MODE:3},setup(e){const{viewportRef:A}=JA(),t=(0,r.toRef)(()=>{var n;return(n=A.value)==null?void 0:n.getElementsByClassName("vue-flow__edge-labels")[0]});return(n,o)=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",null,[((0,r.openBlock)(),(0,r.createElementBlock)("foreignObject",yp,[((0,r.openBlock)(),(0,r.createBlock)(r.Teleport,{to:t.value,disabled:!t.value},[(0,r.renderSlot)(n.$slots,"default")],8,["to","disabled"]))]))]))}});function Qp(e={includeHiddenNodes:!1}){const{nodes:A}=JA();return(0,r.computed)(()=>{if(A.value.length===0)return!1;for(const t of A.value)if((e.includeHiddenNodes||!t.hidden)&&(t?.handleBounds===void 0||t.dimensions.width===0||t.dimensions.height===0))return!1;return!0})}var Ep={class:"vue-flow__nodes vue-flow__container"},Fp=(0,r.defineComponent)({name:"Nodes",compatConfig:{MODE:3},setup(e){const{getNodes:A,updateNodeDimensions:t,emits:n}=JA(),o=Qp(),a=(0,r.ref)();return(0,r.watch)(o,c=>{c&&(0,r.nextTick)(()=>{n.nodesInitialized(A.value)})},{immediate:!0}),(0,r.onMounted)(()=>{a.value=new ResizeObserver(c=>{const d=c.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));(0,r.nextTick)(()=>t(d))})}),(0,r.onBeforeUnmount)(()=>{var c;return(c=a.value)==null?void 0:c.disconnect()}),(c,d)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",Ep,[a.value?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)((0,r.unref)(A),(h,g,B,w)=>{const m=[h.id];if(w&&w.key===h.id&&(0,r.isMemoSame)(w,m))return w;const y=((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Cp),{id:h.id,key:h.id,"resize-observer":a.value},null,8,["id","resize-observer"]));return y.memo=m,y},d,0),128)):(0,r.createCommentVNode)("",!0)]))}});function Up(){const{emits:e}=JA();(0,r.onMounted)(()=>{if(La()){const A=document.querySelector(".vue-flow__pane");A&&window.getComputedStyle(A).zIndex!=="1"&&e.error(new de(ae.MISSING_STYLES))}})}var bp=(0,r.createElementVNode)("div",{class:"vue-flow__edge-labels"},null,-1),Ip=(0,r.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(e,{expose:A,emit:t}){const n=e,o=(0,r.useSlots)(),a=Lo(n,"modelValue",t),c=Lo(n,"nodes",t),d=Lo(n,"edges",t),h=JA(n),g=EB({modelValue:a,nodes:c,edges:d},n,h);return UB(t,h.hooks),cp(),Up(),(0,r.provide)(Ur,o),(0,r.onUnmounted)(g),A(h),(B,w)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref:(0,r.unref)(h).vueFlowRef,class:"vue-flow"},[(0,r.createVNode)(op,null,{default:(0,r.withCtx)(()=>[(0,r.createVNode)(wp),bp,(0,r.createVNode)(Fp),(0,r.renderSlot)(B.$slots,"zoom-pane")]),_:3}),(0,r.renderSlot)(B.$slots,"default"),(0,r.createVNode)(lp)],512))}}),Hp=(0,r.defineComponent)({name:"Panel",compatConfig:{MODE:3},props:{position:{}},setup(e){const A=e,{userSelectionActive:t}=JA(),n=(0,r.computed)(()=>`${A.position}`.split("-"));return(o,a)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["vue-flow__panel",n.value]),style:(0,r.normalizeStyle)({pointerEvents:(0,r.unref)(t)?"none":"all"})},[(0,r.renderSlot)(o.$slots,"default")],6))}}),rt=(e=>(e.Lines="lines",e.Dots="dots",e))(rt||{}),_p=function({dimensions:e,size:A,color:t}){return(0,r.h)("path",{stroke:t,"stroke-width":A,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Sp=function({radius:e,color:A}){return(0,r.h)("circle",{cx:e,cy:e,r:e,fill:A})};rt.Lines,rt.Dots;var xp={[rt.Dots]:"#81818a",[rt.Lines]:"#eee"},Dp=["id","x","y","width","height","patternTransform"],Np={key:2,height:"100",width:"100"},Lp=["fill"],Tp=["x","y","fill"],kp=(0,r.defineComponent)({name:"Background",compatConfig:{MODE:3},props:{id:{},variant:{default:()=>rt.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(e){const{id:A,viewport:t}=JA(),n=(0,r.computed)(()=>{const c=t.value.zoom,[d,h]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],g=[d*c||1,h*c||1],B=e.size*c,[w,m]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset];return{scaledGap:g,offset:[w*c||1+g[0]/2,m*c||1+g[1]/2],size:B}}),o=(0,r.toRef)(()=>`pattern-${A}${e.id?`-${e.id}`:""}`),a=(0,r.toRef)(()=>e.color||e.patternColor||xp[e.variant||rt.Dots]);return(c,d)=>((0,r.openBlock)(),(0,r.createElementBlock)("svg",{class:"vue-flow__background vue-flow__container",style:(0,r.normalizeStyle)({height:`${c.height>100?100:c.height}%`,width:`${c.width>100?100:c.width}%`})},[(0,r.renderSlot)(c.$slots,"pattern-container",{id:o.value},()=>[(0,r.createElementVNode)("pattern",{id:o.value,x:(0,r.unref)(t).x%n.value.scaledGap[0],y:(0,r.unref)(t).y%n.value.scaledGap[1],width:n.value.scaledGap[0],height:n.value.scaledGap[1],patternTransform:`translate(-${n.value.offset[0]},-${n.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[(0,r.renderSlot)(c.$slots,"pattern",{},()=>[c.variant===(0,r.unref)(rt).Lines?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(_p),{key:0,size:c.lineWidth,color:a.value,dimensions:n.value.scaledGap},null,8,["size","color","dimensions"])):c.variant===(0,r.unref)(rt).Dots?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Sp),{key:1,color:a.value,radius:n.value.size/2},null,8,["color","radius"])):(0,r.createCommentVNode)("",!0),c.bgColor?((0,r.openBlock)(),(0,r.createElementBlock)("svg",Np,[(0,r.createElementVNode)("rect",{width:"100%",height:"100%",fill:c.bgColor},null,8,Lp)])):(0,r.createCommentVNode)("",!0)])],8,Dp)]),(0,r.createElementVNode)("rect",{x:c.x,y:c.y,width:"100%",height:"100%",fill:`url(#${o.value})`},null,8,Tp),(0,r.renderSlot)(c.$slots,"default",{id:o.value})],4))}}),Mp={name:"ControlButton",compatConfig:{MODE:3}},Op=(e,A)=>{const t=e.__vccOpts||e;for(const[n,o]of A)t[n]=o;return t},Kp={type:"button",class:"vue-flow__controls-button"};function Rp(e,A,t,n,o,a){return(0,r.openBlock)(),(0,r.createElementBlock)("button",Kp,[(0,r.renderSlot)(e.$slots,"default")])}var Dr=Op(Mp,[["render",Rp]]),Vp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Pp=[(0,r.createElementVNode)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Gp(e,A){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",Vp,Pp)}var zp={render:Gp},$p={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Xp=[(0,r.createElementVNode)("path",{d:"M0 0h32v4.2H0z"},null,-1)];function Wp(e,A){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",$p,Xp)}var Yp={render:Wp},Jp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Zp=[(0,r.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 jp(e,A){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",Jp,Zp)}var qp={render:jp},Am={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},em=[(0,r.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 tm(e,A){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",Am,em)}var nm={render:tm},rm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},om=[(0,r.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 im(e,A){return(0,r.openBlock)(),(0,r.createElementBlock)("svg",rm,om)}var sm={render:im},am=(0,r.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:()=>ra.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:A}){const{nodesDraggable:t,nodesConnectable:n,elementsSelectable:o,setInteractive:a,zoomIn:c,zoomOut:d,fitView:h,viewport:g,minZoom:B,maxZoom:w}=JA(),m=(0,r.toRef)(()=>t.value||n.value||o.value),y=(0,r.toRef)(()=>g.value.zoom<=B.value),v=(0,r.toRef)(()=>g.value.zoom>=w.value);function I(){c(),A("zoomIn")}function L(){d(),A("zoomOut")}function k(){h(e.fitViewParams),A("fitView")}function V(){a(!m.value),A("interactionChange",!m.value)}return(F,M)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Hp),{class:"vue-flow__controls",position:F.position},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(F.$slots,"top"),F.showZoom?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.renderSlot)(F.$slots,"control-zoom-in",{},()=>[(0,r.createVNode)(Dr,{class:"vue-flow__controls-zoomin",disabled:v.value,onClick:I},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(F.$slots,"icon-zoom-in",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(zp))))])]),_:3},8,["disabled"])]),(0,r.renderSlot)(F.$slots,"control-zoom-out",{},()=>[(0,r.createVNode)(Dr,{class:"vue-flow__controls-zoomout",disabled:y.value,onClick:L},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(F.$slots,"icon-zoom-out",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(Yp))))])]),_:3},8,["disabled"])])],64)):(0,r.createCommentVNode)("",!0),F.showFitView?(0,r.renderSlot)(F.$slots,"control-fit-view",{key:1},()=>[(0,r.createVNode)(Dr,{class:"vue-flow__controls-fitview",onClick:k},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(F.$slots,"icon-fit-view",{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(qp))))])]),_:3})]):(0,r.createCommentVNode)("",!0),F.showInteractive?(0,r.renderSlot)(F.$slots,"control-interactive",{key:2},()=>[F.showInteractive?((0,r.openBlock)(),(0,r.createBlock)(Dr,{key:0,class:"vue-flow__controls-interactive",onClick:V},{default:(0,r.withCtx)(()=>[m.value?(0,r.renderSlot)(F.$slots,"icon-unlock",{key:0},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(sm))))]):(0,r.createCommentVNode)("",!0),m.value?(0,r.createCommentVNode)("",!0):(0,r.renderSlot)(F.$slots,"icon-lock",{key:1},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(nm))))])]),_:3})):(0,r.createCommentVNode)("",!0)]):(0,r.createCommentVNode)("",!0),(0,r.renderSlot)(F.$slots,"default")]),_:3},8,["position"]))}}),lm=["onClick"],cm={class:"d-flow-node-menus-item-name"},um=(0,r.defineComponent)({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(e,{emit:A}){const t=e,n=A,o=(0,r.inject)("d_flow_design_provide",{}),a=o.getFlowComponents?.()||[],c=d=>{n("addNode",d.type),(0,r.nextTick)(()=>{t.handleId==="line"?o.addNodeByLine?.(d.type,t.fromNodeId||""):o.addNode?.(d.type,t.fromNodeId||"",t.handleId||"")})};return(d,h)=>{const g=(0,r.resolveComponent)("j-icon");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-flow-node-menus",onClick:(0,r.withModifiers)(()=>{},["stop"])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(a),(B,w)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:w,class:"d-flow-node-menus-item",onClick:m=>c(B)},[(0,r.createElementVNode)("div",{class:"d-flow-node-menus-item-icon",style:(0,r.normalizeStyle)({backgroundColor:B.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(g,{icon:B.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",cm,(0,r.toDisplayString)(B.name),1)],8,lm))),128))])}}}),Bi=um,dm={class:"d-flow-step-name"},fm={key:0,style:{color:"var(--j-color-text-2)"}},gm={style:{color:"var(--j-color-text)"}},hm=(0,r.defineComponent)({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(e){const A=e,{onNodeClick:t,onEdgeClick:n,onMoveStart:o,onConnectStart:a,onNodeDragStart:c,removeNodes:d,getEdges:h,getNodes:g,onNodesChange:B}=JA(),w=(0,r.inject)("d_flow_design_provide",{}),m=(0,r.computed)(()=>w.getFlowComponentMap?.value?.[A.data.type]||{}),y=()=>{d(A.id),w.onRemoveNode?.(A.id)},v=(0,r.ref)({});B(lA=>{if(A.data.isInit&&lA.findIndex(_=>_.type==="select"&&_.id===A.id&&_.id==="start"&&_.selected)!==-1){const _=g.value.find(Z=>Z.id==="start");_&&(_.data.isInit=!1),v.value.s1=!0}});const I=(0,r.ref)(!1),L=lA=>{lA.indexOf("t")!==-1&&!k.value||(I.value=!0,v.value[lA]=!0)},k=(0,r.computed)(()=>h.value.findIndex(lA=>lA.target===A.id)===-1),V=(0,r.ref)(!1),F=()=>{V.value=!0},M=(lA,_)=>{if(h.value.find(U=>U.source===_&&U.target===lA))return!0;const Z=h.value.filter(U=>U.target===lA);for(let U=0;U<Z.length;U++)if(M(Z[U].source,_))return!0;return!1},tA=lA=>V.value?(V.value=!1,!1):M(lA.source,lA.target)?!1:lA.source!==lA.target&&lA.sourceHandle!==lA.targetHandle&&lA.sourceHandle.indexOf("s")!==-1&&lA.targetHandle.indexOf("t")!==-1,W=()=>{AA(),Object.keys(v.value).forEach(lA=>{v.value[lA]=!1})},aA=()=>{W()};t(()=>{console.log("onNodeClick"),I.value?I.value=!1:W()}),n(()=>{W()}),o(()=>{W()}),a(()=>{W()}),c(()=>{W()});const dA=(0,r.ref)(),rA=(0,r.ref)({top:0,left:0,bottom:0,right:0}),oA=(0,r.ref)({getBoundingClientRect:()=>rA.value}),AA=()=>{dA.value?.handleClose()},O=lA=>{const{clientX:_,clientY:Z}=lA;rA.value=DOMRect.fromRect({x:_,y:Z}),lA.preventDefault(),dA.value?.handleOpen()};return(lA,_)=>{const Z=(0,r.resolveComponent)("j-icon"),U=(0,r.resolveComponent)("el-popover"),x=(0,r.resolveComponent)("el-tooltip"),G=(0,r.resolveComponent)("el-dropdown-item"),R=(0,r.resolveComponent)("el-dropdown-menu"),$=(0,r.resolveComponent)("el-dropdown");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"d-flow-step",onContextmenu:(0,r.withModifiers)(O,["stop"])},[(0,r.createElementVNode)("div",{class:"d-flow-step-icon",style:(0,r.normalizeStyle)({backgroundColor:m.value.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(Z,{icon:m.value.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",dm,(0,r.toDisplayString)(m.value.name),1),e.data.type!=="start"?((0,r.openBlock)(),(0,r.createBlock)(x,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,r.withCtx)(()=>[k.value?((0,r.openBlock)(),(0,r.createElementBlock)("div",fm,[..._[4]||(_[4]=[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),(0,r.createTextVNode)("添加节点 ",-1)])])):(0,r.createCommentVNode)("",!0),_[5]||(_[5]=(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,r.createTextVNode)("连接节点 ")],-1))]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(Zt),{onClick:_[1]||(_[1]=J=>L("t1")),onMousedown:F,id:"t1",class:(0,r.normalizeClass)(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!k.value}]),type:"target",position:(0,r.unref)(HA).Left,"is-valid-connection":tA},{default:(0,r.withCtx)(()=>[k.value?((0,r.openBlock)(),(0,r.createBlock)(U,{key:0,visible:v.value.t1,"onUpdate:visible":_[0]||(_[0]=J=>v.value.t1=J),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,r.withCtx)(()=>[(0,r.createVNode)(Z,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(Bi,{"handle-id":"t1","from-node-id":e.id,onAddNode:aA},null,8,["from-node-id"])]),_:1},8,["visible"])):(0,r.createCommentVNode)("",!0)]),_:1},8,["class","position"])]),_:1})):(0,r.createCommentVNode)("",!0),(0,r.createVNode)(x,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,r.withCtx)(()=>[..._[6]||(_[6]=[(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),(0,r.createTextVNode)("添加节点 ")],-1),(0,r.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,r.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,r.createTextVNode)("连接节点 ")],-1)])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(Zt),{onClick:_[3]||(_[3]=J=>L("s1")),onMousedown:F,id:"s1",class:"d-flow-step-source-handle",type:"source",position:(0,r.unref)(HA).Right,"is-valid-connection":tA},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(U,{visible:v.value.s1,"onUpdate:visible":_[2]||(_[2]=J=>v.value.s1=J),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,r.withCtx)(()=>[(0,r.createVNode)(Z,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(Bi,{"handle-id":"s1","from-node-id":e.id,onAddNode:aA},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),(0,r.createVNode)($,{ref_key:"dropdownRef",ref:dA,"popper-class":"d-flow-step-dropdown","virtual-ref":oA.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:(0,r.withCtx)(()=>[(0,r.createVNode)(R,null,{default:(0,r.withCtx)(()=>[e.data.type!="start"?((0,r.openBlock)(),(0,r.createBlock)(G,{key:0,onClick:y},{default:(0,r.withCtx)(()=>[..._[7]||(_[7]=[(0,r.createTextVNode)("删除",-1)])]),_:1})):(0,r.createCommentVNode)("",!0),m.value.des?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:1,style:(0,r.normalizeStyle)({width:"160px",padding:"4px 16px 0 16px","font-size":"12px","border-top":e.data.type!="start"?"1px solid var(--j-color-border)":void 0,"margin-top":e.data.type!="start"?"4px":void 0})},[_[8]||(_[8]=(0,r.createElementVNode)("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),(0,r.createElementVNode)("div",gm,(0,r.toDisplayString)(m.value.des),1)],4)):(0,r.createCommentVNode)("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),Bm=hm,pm=(0,r.defineComponent)({name:"DEdgeWithButton",__name:"edgeWithButton",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},markerEnd:{},style:{}},setup(e){const A=e,{onEdgeMouseEnter:t,onEdgeMouseLeave:n,onNodeClick:o,onEdgeClick:a,onMoveStart:c,onConnectStart:d,onNodeDragStart:h}=JA(),g=(0,r.computed)(()=>fi(A)),B=(0,r.ref)(!1),w=(0,r.ref)(!1);t(({edge:L})=>{L.id===A.id&&(B.value=!0)}),n(()=>{B.value=!1});const m=(0,r.ref)(!1),y=()=>{m.value=!1,(0,r.nextTick)(()=>{w.value=!1})},v=()=>{w.value=!0,m.value=!0},I=()=>{y()};return o(()=>{y()}),a(()=>{y()}),c(()=>{y()}),d(()=>{y()}),h(()=>{y()}),(L,k)=>{const V=(0,r.resolveComponent)("j-icon"),F=(0,r.resolveComponent)("el-popover");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)((0,r.unref)(Nn),{id:e.id,style:(0,r.normalizeStyle)(e.style),path:g.value[0],"marker-end":e.markerEnd},null,8,["id","style","path","marker-end"]),(0,r.createVNode)((0,r.unref)(vp),null,{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${g.value[1]}px,${g.value[2]}px)`}),class:"nodrag nopan"},[(0,r.createVNode)(F,{visible:m.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:(0,r.withCtx)(()=>[(0,r.withDirectives)((0,r.createElementVNode)("div",{onClick:(0,r.withModifiers)(v,["stop"]),class:"d-flow-edge-button"},[(0,r.createVNode)(V,{icon:"mdi:plus-circle"})],512),[[r.vShow,B.value||w.value]])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(Bi,{"handle-id":"line","from-node-id":e.id,onAddNode:I},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),mm=pm,wm=(0,r.defineComponent)({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(e){return(A,t)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(Ip),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":(0,r.unref)(tt).Strict,nodes:e.nodes,edges:e.edges},{"edge-button":(0,r.withCtx)(n=>[(0,r.createVNode)(mm,{id:n.id,"source-x":n.sourceX,"source-y":n.sourceY,"target-x":n.targetX,"target-y":n.targetY,"source-position":n.sourcePosition,"target-position":n.targetPosition,"marker-end":n.markerEnd,style:(0,r.normalizeStyle)(n.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":(0,r.withCtx)(n=>[(0,r.createVNode)(Bm,(0,r.normalizeProps)((0,r.guardReactiveProps)(n)),null,16)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(am),{position:"bottom-left"}),(0,r.createVNode)((0,r.unref)(kp))]),_:1},8,["connection-mode","nodes","edges"]))}}),Cm=wm,ym={class:"d-flow-design"},vm={class:"d-flow-design-canvas"},Qm={class:"d-flow-design-right"},Em={class:"d-flow-design-title"},Fm={class:"d-flow-design-title-name"},Um={class:"d-flow-design-panel"},bm=(0,r.defineComponent)({name:"DFlowDesign",__name:"flowDesign",props:{components:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["nodeClick","edgeClick","paneClick","connect"],setup(e,{expose:A,emit:t}){const n=e,o=t,{addNodes:a,addEdges:c,removeEdges:d,addSelectedNodes:h,removeSelectedNodes:g,onConnect:B,onNodeClick:w,onPaneClick:m,onEdgeClick:y,getNodes:v,getEdges:I}=JA(),L=(0,r.computed)(()=>{const R={};return n.components.forEach($=>{R[$.type]=$}),R.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},R}),k={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},V=(0,r.ref)([k]),F=(0,r.ref)([]),M=(R,$)=>{if($.indexOf("t")===-1){const J=I.value.filter(nA=>nA.source===R.id);if(J.length>0){let nA=-1e6,BA=0;return J.forEach(UA=>{nA=Math.max(nA,UA.targetNode.position.y+UA.targetNode.dimensions.height+32),BA=UA.targetNode.position.x||0}),{x:BA,y:nA}}return{x:R.position.x+R.dimensions.width+100,y:R.position.y}}return{x:R.position.x-100-R.dimensions.width,y:R.position.y}},tA=(R,$,J)=>{const nA=v.value.find(UA=>UA.id===$);if(!nA)return;const BA={id:ut(),type:"step",data:{type:R},position:M(nA,J)};if(n.flowInit){const UA=n.flowInit(BA.data.type);UA&&Object.keys(UA).forEach(eA=>{BA.data[eA]=UA[eA]})}a(BA),J.indexOf("t")===-1?c({id:`${$}-${BA.id}`,source:$,target:BA.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:nt.Arrow}):c({id:`${$}-${BA.id}`,source:BA.id,target:$,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:nt.Arrow}),O(BA.id)},W=R=>{const $=v.value.find(J=>J.id===R);$&&($.position.x+=100+$.dimensions.width,I.value.filter(J=>J.source===R).forEach(J=>{W(J.target)}))},aA=(R,$)=>{const J=I.value.find(BA=>BA.id===$);if(!J)return;const nA={id:ut(),type:"step",data:{type:R},position:{x:J.targetNode.position.x,y:J.targetNode.position.y}};if(n.flowInit){const BA=n.flowInit(nA.data.type);BA&&Object.keys(BA).forEach(UA=>{nA.data[UA]=BA[UA]})}a(nA),c({id:`${J.sourceNode.id}-${nA.id}`,source:J.sourceNode.id,target:nA.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:nt.Arrow}),c({id:`${nA.id}-${J.targetNode.id}`,source:nA.id,target:J.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:nt.Arrow}),d($),W(J.target),O(nA.id)};B(R=>{console.log("onConnect",R),R.type="button",R.markerEnd=nt.Arrow,c(R),o("connect",R)});const dA=()=>n.components||[],rA=(0,r.ref)(),oA=(0,r.computed)(()=>rA.value?L.value[rA.value.data.type]:void 0);w(R=>{rA.value?.id!==R.node.id&&(rA.value=R.node,Z()),o("nodeClick",R.node)}),m(()=>{rA.value=void 0,o("paneClick")}),y(R=>{rA.value=void 0,o("edgeClick",R.edge)});const AA=R=>{rA.value?.id===R&&(rA.value=void 0)},O=R=>{rA.value&&g([rA.value]),rA.value=v.value.find($=>$.id===R),rA.value&&(Z(),setTimeout(()=>{rA.value&&h([rA.value])},100))},lA=(0,r.ref)(),_={};Object.keys(n.flowComponentConfigs).forEach(R=>{const $={type:"j-collapse",config:{defaultValue:[]},children:[]};n.flowComponentConfigs[R].forEach((J,nA)=>{const BA=`_collapse${nA}`;$.config?.defaultValue.push(BA),$.children?.push(J)}),_[R]=[$]});const Z=()=>{const R=_[rA.value?.data.type||""];R&&lA.value?(lA.value.init&&lA.value.init(R,rA.value?.data),n.flowComponentConfigInit&&n.flowComponentConfigInit({configRef:lA,inputParams:n.inputParams,components:v.value,configData:rA.value?.data})):lA.value&&lA.value.init&&lA.value.init([])},U=(R,$)=>{rA.value&&n.flowComponentConfigChange&&n.flowComponentConfigChange(rA.value.data.type,{configRef:lA,component:R,configData:rA.value.data,...$,isFlowNode:!0})};return(0,r.provide)("d_flow_design_provide",{getFlowComponents:dA,addNode:tA,addNodeByLine:aA,onRemoveNode:AA,getFlowComponentMap:L}),A({getData:()=>{const R=[];return v.value.forEach($=>{R.push({config:$.data,id:$.id,position:$.position,type:$.type})}),I.value.forEach($=>{R.push({id:$.id,source:$.source,target:$.target,sourceHandle:$.sourceHandle,targetHandle:$.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),R},setData:R=>{if(!R||R.length===0)k.data.isInit=!0,V.value=[k],O(k.id);else{k.data.isInit=!1;const $=[],J=[];R.forEach(nA=>{if(nA.type==="line")nA.type="button",nA.markerEnd=nt.Arrow,J.push(nA);else{const BA={id:nA.id,type:nA.type,data:nA.config,position:nA.position};$.push(BA)}}),V.value=$,F.value=J}}}),(R,$)=>{const J=(0,r.resolveComponent)("j-icon"),nA=(0,r.resolveComponent)("j-form");return(0,r.openBlock)(),(0,r.createElementBlock)("div",ym,[(0,r.createElementVNode)("div",vm,[(0,r.createVNode)(Cm,{nodes:V.value,edges:F.value},null,8,["nodes","edges"])]),(0,r.withDirectives)((0,r.createElementVNode)("div",Qm,[(0,r.createElementVNode)("div",Em,[(0,r.createElementVNode)("div",{class:"d-flow-design-title-icon",style:(0,r.normalizeStyle)({backgroundColor:oA.value?.iconColor||"var(--j-color-primary)"})},[(0,r.createVNode)(J,{icon:oA.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,r.createElementVNode)("div",Fm,(0,r.toDisplayString)(oA.value?.name||""),1)]),(0,r.createElementVNode)("div",Um,[(0,r.createVNode)(nA,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:lA,onChange:U},null,512)])],512),[[r.vShow,rA.value&&_[rA.value.data.type]]])])}}}),Im=bm,nl=ct(Im),Hm={class:"d-input-flow j-block"},_m=(0,r.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(e,{emit:A}){const t=e,n=A,o=(0,r.ref)(),a=(0,r.computed)({get(){return t.modelValue},set(w){n("update:modelValue",w)}}),c=(0,r.computed)(()=>(t.modelValue?.trim(),t.btnText)),d=w=>{const m=typeof w=="string"?w:void 0;try{o.value?.setData(JSON.parse(m||"[]"))}catch{o.value?.setData([])}},h=async()=>{const w=o.value?.getData();return w?JSON.stringify(w):void 0},g=w=>{if(t.beforeClose){const m=typeof w=="string"?w:void 0;return t.beforeClose(m)}return!0},B=w=>{const m=w.value;n("change",{value:typeof m=="string"?m:void 0})};return(w,m)=>{const y=(0,r.resolveComponent)("d-flow-design"),v=(0,r.resolveComponent)("j-input-button");return(0,r.openBlock)(),(0,r.createBlock)(v,(0,r.mergeProps)(w.$attrs,{type:e.type,"btn-text":c.value,title:e.title,size:e.size,width:e.width,height:e.height,"before-close":g,ok:h,open:d,"destroy-on-close":"",modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=I=>a.value=I),onChange:B}),{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",Hm,[(0,r.createVNode)(y,{ref_key:"flowRef",ref:o,components:e.flowComponents,"flow-init":e.flowInit,"flow-component-config-init":e.flowComponentConfigInit,"flow-component-configs":e.flowComponentConfigs,"flow-component-config-change":e.flowComponentConfigChange,"input-params":e.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"])}}}),Sm=_m,rl=ct(Sm),q=class Le{static getElements(A,t=document){if(typeof A=="string"){const n="getElementById"in t?t:void 0;if(n&&!isNaN(+A[0])){const a=n.getElementById(A);return a?[a]:[]}let o=t.querySelectorAll(A);if(!o.length&&A[0]!=="."&&A[0]!=="#"&&(o=t.querySelectorAll("."+A),o.length||(o=t.querySelectorAll("#"+A)),!o.length)){const a=t.querySelector(`[gs-id="${A}"]`);return a?[a]:[]}return Array.from(o)}return[A]}static getElement(A,t=document){if(typeof A=="string"){const n="getElementById"in t?t:void 0;if(!A.length)return null;if(n&&A[0]==="#")return n.getElementById(A.substring(1));if(A[0]==="#"||A[0]==="."||A[0]==="[")return t.querySelector(A);if(n&&!isNaN(+A[0]))return n.getElementById(A);let o=t.querySelector(A);return n&&!o&&(o=n.getElementById(A)),o||(o=t.querySelector("."+A)),o}return A}static lazyLoad(A){return A.lazyLoad||A.grid?.opts?.lazyLoad&&A.lazyLoad!==!1}static createDiv(A,t){const n=document.createElement("div");return A.forEach(o=>{o&&n.classList.add(o)}),t?.appendChild(n),n}static shouldSizeToContent(A,t=!1){return A?.grid&&(t?A.sizeToContent===!0||A.grid.opts.sizeToContent===!0&&A.sizeToContent===void 0:!!A.sizeToContent||A.grid.opts.sizeToContent&&A.sizeToContent!==!1)}static isIntercepted(A,t){return!(A.y>=t.y+t.h||A.y+A.h<=t.y||A.x+A.w<=t.x||A.x>=t.x+t.w)}static isTouching(A,t){return Le.isIntercepted(A,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(A,t){const n=A.x>t.x?A.x:t.x,o=A.x+A.w<t.x+t.w?A.x+A.w:t.x+t.w;if(o<=n)return 0;const a=A.y>t.y?A.y:t.y,c=A.y+A.h<t.y+t.h?A.y+A.h:t.y+t.h;return c<=a?0:(o-n)*(c-a)}static area(A){return A.w*A.h}static sort(A,t=1){return A.sort((o,a)=>{const c=t*((o.y??1e4)-(a.y??1e4));return c===0?t*((o.x??1e4)-(a.x??1e4)):c})}static find(A,t){return t?A.find(n=>n.id===t):void 0}static toBool(A){return typeof A=="boolean"?A:typeof A=="string"?(A=A.toLowerCase(),!(A===""||A==="no"||A==="false"||A==="0")):!!A}static toNumber(A){return A===null||A.length===0?void 0:Number(A)}static parseHeight(A){let t,n="px";if(typeof A=="string")if(A==="auto"||A==="")t=0;else{const o=A.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!o)throw new Error(`Invalid height val = ${A}`);n=o[2]||"px",t=parseFloat(o[1])}else t=A;return{h:t,unit:n}}static defaults(A,...t){return t.forEach(n=>{for(const o in n){if(!n.hasOwnProperty(o))return;A[o]===null||A[o]===void 0?A[o]=n[o]:typeof n[o]=="object"&&typeof A[o]=="object"&&Le.defaults(A[o],n[o])}}),A}static same(A,t){if(typeof A!="object")return A==t;if(typeof A!=typeof t||Object.keys(A).length!==Object.keys(t).length)return!1;for(const n in A)if(A[n]!==t[n])return!1;return!0}static copyPos(A,t,n=!1){return t.x!==void 0&&(A.x=t.x),t.y!==void 0&&(A.y=t.y),t.w!==void 0&&(A.w=t.w),t.h!==void 0&&(A.h=t.h),n&&(t.minW&&(A.minW=t.minW),t.minH&&(A.minH=t.minH),t.maxW&&(A.maxW=t.maxW),t.maxH&&(A.maxH=t.maxH)),A}static samePos(A,t){return A&&t&&A.x===t.x&&A.y===t.y&&(A.w||1)===(t.w||1)&&(A.h||1)===(t.h||1)}static sanitizeMinMax(A){A.minW||delete A.minW,A.minH||delete A.minH,A.maxW||delete A.maxW,A.maxH||delete A.maxH}static removeInternalAndSame(A,t){if(!(typeof A!="object"||typeof t!="object")&&!(Array.isArray(A)||Array.isArray(t)))for(let n in A){const o=A[n],a=t[n];n[0]==="_"||o===a?delete A[n]:o&&typeof o=="object"&&a!==void 0&&(Le.removeInternalAndSame(o,a),Object.keys(o).length||delete A[n])}}static removeInternalForSave(A,t=!0){for(let n in A)(n[0]==="_"||A[n]===null||A[n]===void 0)&&delete A[n];delete A.grid,t&&delete A.el,A.autoPosition||delete A.autoPosition,A.noResize||delete A.noResize,A.noMove||delete A.noMove,A.locked||delete A.locked,(A.w===1||A.w===A.minW)&&delete A.w,(A.h===1||A.h===A.minH)&&delete A.h}static throttle(A,t){let n=!1;return(...o)=>{n||(n=!0,setTimeout(()=>{A(...o),n=!1},t))}}static removePositioningStyles(A){const t=A.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(A){if(!A)return document.scrollingElement||document.documentElement;const t=getComputedStyle(A);return/(auto|scroll)/.test(t.overflow+t.overflowY)?A:Le.getScrollElement(A.parentElement)}static updateScrollPosition(A,t,n){const o=Le.getScrollElement(A);if(!o)return;const a=A.getBoundingClientRect(),c=o.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,h=a.bottom-Math.min(c.bottom,d),g=a.top-Math.max(c.top,0),B=o.scrollTop;g<0&&n<0?A.offsetHeight>c.height?o.scrollTop+=n:o.scrollTop+=Math.abs(g)>Math.abs(n)?n:g:h>0&&n>0&&(A.offsetHeight>c.height?o.scrollTop+=n:o.scrollTop+=h>n?n:h),t.top+=o.scrollTop-B}static updateScrollResize(A,t,n){const o=Le.getScrollElement(t),a=o.clientHeight,c=o===Le.getScrollElement()?0:o.getBoundingClientRect().top,d=A.clientY-c,h=d<n,g=d>a-n;h?o.scrollBy({behavior:"smooth",top:d-n}):g&&o.scrollBy({behavior:"smooth",top:n-(a-d)})}static clone(A){return A==null||typeof A!="object"?A:A instanceof Array?[...A]:{...A}}static cloneDeep(A){const t=["parentGrid","el","grid","subGrid","engine"],n=Le.clone(A);for(const o in n)n.hasOwnProperty(o)&&typeof n[o]=="object"&&o.substring(0,2)!=="__"&&!t.find(a=>a===o)&&(n[o]=Le.cloneDeep(A[o]));return n}static cloneNode(A){const t=A.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(A,t){let n;typeof t=="string"?n=Le.getElement(t):n=t,n&&n.appendChild(A)}static addElStyles(A,t){if(t instanceof Object)for(const n in t)t.hasOwnProperty(n)&&(Array.isArray(t[n])?t[n].forEach(o=>{A.style[n]=o}):A.style[n]=t[n])}static initEvent(A,t){const n={type:t.type},o={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:A.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(a=>n[a]=A[a]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(a=>n[a]=A[a]),{...n,...o}}static simulateMouseEvent(A,t,n){const o=A,a=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:A.screenX,screenY:A.screenY,clientX:A.clientX,clientY:A.clientY,ctrlKey:o.ctrlKey??!1,altKey:o.altKey??!1,shiftKey:o.shiftKey??!1,metaKey:o.metaKey??!1,button:0,relatedTarget:A.target});(n||A.target).dispatchEvent(a)}static getValuesFromTransformedElement(A){const t=document.createElement("div");Le.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),A.appendChild(t);const n=t.getBoundingClientRect();return A.removeChild(t),t.remove(),{xScale:1/n.width,yScale:1/n.height,xOffset:n.left,yOffset:n.top}}static swap(A,t,n){if(!A)return;const o=A[t];A[t]=A[n],A[n]=o}static canBeRotated(A){return!(!A||A.w===A.h||A.locked||A.noResize||A.grid?.opts.disableResize||A.minW&&A.minW===A.maxW||A.minH&&A.minH===A.maxH)}},pi=class fn{constructor(A={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=A.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=A.maxRow,this._float=A.float,this.nodes=A.nodes||[],this.onChange=A.onChange}batchUpdate(A=!0,t=!0){return!!this.batchMode===A?this:(this.batchMode=A,A?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(A,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!A._moving||A._skipDown||t.y<=A.y)}_fixCollisions(A,t=A,n,o={}){if(this.sortNodes(-1),n=n||this.collide(A,t),!n)return!1;if(A._moving&&!o.nested&&!this.float&&this.swap(A,n))return!0;let a=t;!this._loading&&this._useEntireRowArea(A,t)&&(a={x:0,w:this.column,y:t.y,h:t.h},n=this.collide(A,a,o.skip));let c=!1;const d={nested:!0,pack:!1};let h=0;for(;n=n||this.collide(A,a,o.skip);){if(h++>this.nodes.length*2)throw new Error("Infinite collide check");let g;if(n.locked||this._loading||A._moving&&!A._skipDown&&t.y>A.y&&!this.float&&(!this.collide(n,{...n,y:A.y},A)||!this.collide(n,{...n,y:t.y-n.h},A))){A._skipDown=A._skipDown||t.y>A.y;const B={...t,y:n.y+n.h,...d};g=this._loading&&q.samePos(A,B)?!0:this.moveNode(A,B),(n.locked||this._loading)&&g?q.copyPos(t,A):!n.locked&&g&&o.pack&&(this._packNodes(),t.y=n.y+n.h,q.copyPos(A,t)),c=c||g}else g=this.moveNode(n,{...n,y:t.y+t.h,skip:A,...d});if(!g)return c;n=void 0}return c}collide(A,t=A,n){const o=A._id,a=n?._id;return this.nodes.find(c=>c._id!==o&&c._id!==a&&q.isIntercepted(c,t))}collideAll(A,t=A,n){const o=A._id,a=n?._id;return this.nodes.filter(c=>c._id!==o&&c._id!==a&&q.isIntercepted(c,t))}directionCollideCoverage(A,t,n){if(!t.rect||!A._rect)return;const o=A._rect,a={...t.rect};a.y>o.y?(a.h+=a.y-o.y,a.y=o.y):a.h+=o.y-a.y,a.x>o.x?(a.w+=a.x-o.x,a.x=o.x):a.w+=o.x-a.x;let c,d=.5;for(let h of n){if(h.locked||!h._rect)break;const g=h._rect;let B=Number.MAX_VALUE,w=Number.MAX_VALUE;o.y<g.y?B=(a.y+a.h-g.y)/g.h:o.y+o.h>g.y+g.h&&(B=(g.y+g.h-a.y)/g.h),o.x<g.x?w=(a.x+a.w-g.x)/g.w:o.x+o.w>g.x+g.w&&(w=(g.x+g.w-a.x)/g.w);const m=Math.min(w,B);m>d&&(d=m,c=h)}return t.collide=c,c}cacheRects(A,t,n,o,a,c){return this.nodes.forEach(d=>d._rect={y:d.y*t+n,x:d.x*A+c,w:d.w*A-c-o,h:d.h*t-n-a}),this}swap(A,t){if(!t||t.locked||!A||A.locked)return!1;function n(){const a=t.x,c=t.y;return t.x=A.x,t.y=A.y,A.h!=t.h?(A.x=a,A.y=t.y+t.h):A.w!=t.w?(A.x=t.x+t.w,A.y=c):(A.x=a,A.y=c),A._dirty=t._dirty=!0,!0}let o;if(A.w===t.w&&A.h===t.h&&(A.x===t.x||A.y===t.y)&&(o=q.isTouching(A,t)))return n();if(o!==!1){if(A.w===t.w&&A.x===t.x&&(o||(o=q.isTouching(A,t)))){if(t.y<A.y){const a=A;A=t,t=a}return n()}if(o!==!1){if(A.h===t.h&&A.y===t.y&&(o||(o=q.isTouching(A,t)))){if(t.x<A.x){const a=A;A=t,t=a}return n()}return!1}}}isAreaEmpty(A,t,n,o){const a={x:A||0,y:t||0,w:n||1,h:o||1};return!this.collide(a)}compact(A="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const n=this.batchMode;n||this.batchUpdate();const o=this._inColumnResize;o||(this._inColumnResize=!0);const a=this.nodes;return this.nodes=[],a.forEach((c,d,h)=>{let g;c.locked||(c.autoPosition=!0,A==="list"&&d&&(g=h[d-1])),this.addNode(c,!1,g)}),o||delete this._inColumnResize,n||this.batchUpdate(!1),this}set float(A){this._float!==A&&(this._float=A||!1,A||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(A=1){return this.nodes=q.sort(this.nodes,A),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(A=>{if(A._updating||A._orig===void 0||A.y===A._orig.y)return;let t=A.y;for(;t>A._orig.y;)--t,this.collide(A,{x:A.x,y:t,w:A.w,h:A.h})||(A._dirty=!0,A.y=t)}):this.nodes.forEach((A,t)=>{if(!A.locked)for(;A.y>0;){const n=t===0?0:A.y-1;if(!(t===0||!this.collide(A,{x:A.x,y:n,w:A.w,h:A.h})))break;A._dirty=A.y!==n,A.y=n}}),this)}prepareNode(A,t){A._id=A._id??fn._idSeq++;const n=A.id;if(n){let a=1;for(;this.nodes.find(c=>c.id===A.id&&c!==A);)A.id=n+"_"+a++}(A.x===void 0||A.y===void 0||A.x===null||A.y===null)&&(A.autoPosition=!0);const o={x:0,y:0,w:1,h:1};return q.defaults(A,o),A.autoPosition||delete A.autoPosition,A.noResize||delete A.noResize,A.noMove||delete A.noMove,q.sanitizeMinMax(A),typeof A.x=="string"&&(A.x=Number(A.x)),typeof A.y=="string"&&(A.y=Number(A.y)),typeof A.w=="string"&&(A.w=Number(A.w)),typeof A.h=="string"&&(A.h=Number(A.h)),isNaN(A.x)&&(A.x=o.x,A.autoPosition=!0),isNaN(A.y)&&(A.y=o.y,A.autoPosition=!0),isNaN(A.w)&&(A.w=o.w),isNaN(A.h)&&(A.h=o.h),this.nodeBoundFix(A,t),A}nodeBoundFix(A,t){const n=A._orig||q.copyPos({},A);if(A.maxW&&(A.w=Math.min(A.w||1,A.maxW)),A.maxH&&(A.h=Math.min(A.h||1,A.maxH)),A.minW&&(A.w=Math.max(A.w||1,A.minW)),A.minH&&(A.h=Math.max(A.h||1,A.minH)),(A.x||0)+(A.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&A._id!=null&&this.findCacheLayout(A,this.defaultColumn)===-1){const o={...A};o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return A.w>this.column?A.w=this.column:A.w<1&&(A.w=1),this.maxRow&&A.h>this.maxRow?A.h=this.maxRow:A.h<1&&(A.h=1),A.x<0&&(A.x=0),A.y<0&&(A.y=0),A.x+A.w>this.column&&(t?A.w=this.column-A.x:A.x=this.column-A.w),this.maxRow&&A.y+A.h>this.maxRow&&(t?A.h=this.maxRow-A.y:A.y=this.maxRow-A.h),q.samePos(A,n)||(A._dirty=!0),this}getDirtyNodes(A){return A?this.nodes.filter(t=>t._dirty&&!q.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(A){if(this.batchMode||!this.onChange)return this;const t=(A||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(A=>{delete A._dirty,delete A._lastTried}),this)}saveInitial(){return this.nodes.forEach(A=>{A._orig=q.copyPos({},A),delete A._dirty}),this._hasLocked=this.nodes.some(A=>A.locked),this}restoreInitial(){return this.nodes.forEach(A=>{!A._orig||q.samePos(A,A._orig)||(q.copyPos(A,A._orig),A._dirty=!0)}),this._notify(),this}findEmptyPosition(A,t=this.nodes,n=this.column,o){const a=o?o.y*n+(o.x+o.w):0;let c=!1;for(let d=a;!c;++d){const h=d%n,g=Math.floor(d/n);if(h+A.w>n)continue;const B={x:h,y:g,w:A.w,h:A.h};t.find(w=>q.isIntercepted(B,w))||((A.x!==h||A.y!==g)&&(A._dirty=!0),A.x=h,A.y=g,delete A.autoPosition,c=!0)}return c}addNode(A,t=!1,n){const o=this.nodes.find(c=>c._id===A._id);if(o)return o;this._inColumnResize?this.nodeBoundFix(A):this.prepareNode(A),delete A._temporaryRemoved,delete A._removeDOM;let a;return A.autoPosition&&this.findEmptyPosition(A,this.nodes,this.column,n)&&(delete A.autoPosition,a=!0),this.nodes.push(A),t&&this.addedNodes.push(A),a||this._fixCollisions(A),this.batchMode||this._packNodes()._notify(),A}removeNode(A,t=!0,n=!1){return this.nodes.find(o=>o._id===A._id)?(n&&this.removedNodes.push(A),t&&(A._removeDOM=!0),this.nodes=this.nodes.filter(o=>o._id!==A._id),A._isAboutToRemove||this._packNodes(),this._notify([A]),this):this}removeAll(A=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;A&&this.nodes.forEach(o=>o._removeDOM=!0);const n=this.nodes;return this.removedNodes=t?n:[],this.nodes=[],this._notify(n)}moveNodeCheck(A,t){if(!this.changedPosConstrain(A,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(A,t);let n;const o=new fn({column:this.column,float:this.float,nodes:this.nodes.map(c=>c._id===A._id?(n={...c},n):{...c})});if(!n)return!1;const a=o.moveNode(n,t)&&o.getRow()<=Math.max(this.getRow(),this.maxRow);if(!a&&!t.resizing&&t.collide){const c=t.collide.el.gridstackNode;if(this.swap(A,c))return this._notify(),!0}return a?(o.nodes.filter(c=>c._dirty).forEach(c=>{const d=this.nodes.find(h=>h._id===c._id);d&&(q.copyPos(d,c),d._dirty=!0)}),this._notify(),!0):!1}willItFit(A){if(delete A._willFitPos,!this.maxRow)return!0;const t=new fn({column:this.column,float:this.float,nodes:this.nodes.map(o=>({...o}))}),n={...A};return this.cleanupNode(n),delete n.el,delete n._id,delete n.content,delete n.grid,t.addNode(n),t.getRow()<=this.maxRow?(A._willFitPos=q.copyPos({},n),!0):!1}changedPosConstrain(A,t){return t.w=t.w||A.w,t.h=t.h||A.h,A.x!==t.x||A.y!==t.y?!0:(A.maxW&&(t.w=Math.min(t.w,A.maxW)),A.maxH&&(t.h=Math.min(t.h,A.maxH)),A.minW&&(t.w=Math.max(t.w,A.minW)),A.minH&&(t.h=Math.max(t.h,A.minH)),A.w!==t.w||A.h!==t.h)}moveNode(A,t){if(!A||!t)return!1;let n;t.pack===void 0&&!this.batchMode&&(n=t.pack=!0),typeof t.x!="number"&&(t.x=A.x),typeof t.y!="number"&&(t.y=A.y),typeof t.w!="number"&&(t.w=A.w),typeof t.h!="number"&&(t.h=A.h);const o=A.w!==t.w||A.h!==t.h,a=q.copyPos({},A,!0);if(q.copyPos(a,t),this.nodeBoundFix(a,o),q.copyPos(t,a),!t.forceCollide&&q.samePos(A,t))return!1;const c=q.copyPos({},A),d=this.collideAll(A,a,t.skip);let h=!0;if(d.length){const g=A._moving&&!t.nested;let B=g?this.directionCollideCoverage(A,t,d):d[0];if(g&&B&&A.grid?.opts?.subGridDynamic&&!A.grid._isTemp){const w=q.areaIntercept(t.rect,B._rect),m=q.area(t.rect),y=q.area(B._rect);w/(m<y?m:y)>.8&&(B.grid.makeSubGrid(B.el,void 0,A),B=void 0)}B?h=!this._fixCollisions(A,a,B,t):(h=!1,n&&delete t.pack)}return h&&!q.samePos(A,a)&&(A._dirty=!0,q.copyPos(A,a)),t.pack&&this._packNodes()._notify(),!q.samePos(A,c)}getRow(){return this.nodes.reduce((A,t)=>Math.max(A,t.y+t.h),0)}beginUpdate(A){return A._updating||(A._updating=!0,delete A._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const A=this.nodes.find(t=>t._updating);return A&&(delete A._updating,delete A._skipDown),this}save(A=!0,t,n){const o=this._layouts?.length||0;let a;o&&(n?n!==this.column&&(a=this._layouts[n]):this.column!==o-1&&(a=this._layouts[o-1]));const c=[];return this.sortNodes(),this.nodes.forEach(d=>{const h=a?.find(B=>B._id===d._id),g={...d,...h||{}};q.removeInternalForSave(g,!A),t&&t(d,g),c.push(g)}),c}layoutsNodesChange(A){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,n)=>{if(!t||n===this.column)return this;if(n<this.column)this._layouts[n]=void 0;else{const o=n/this.column;A.forEach(a=>{if(!a._orig)return;const c=t.find(d=>d._id===a._id);c&&(c.y>=0&&a.y!==a._orig.y&&(c.y+=a.y-a._orig.y,c.y<0&&(c.y=0)),a.x!==a._orig.x&&(c.x=Math.round(a.x*o),c.x<0&&(c.x=0)),a.w!==a._orig.w&&(c.w=Math.round(a.w*o),c.w<1&&(c.w=1)))})}}),this)}columnChanged(A,t,n="moveScale"){if(!this.nodes.length||!t||A===t)return this;const o=n==="compact"||n==="list";o&&this.sortNodes(1),t<A&&this.cacheLayout(this.nodes,A),this.batchUpdate();let a=[],c=o?this.nodes:q.sort(this.nodes,-1);if(t>A&&this._layouts){const d=this._layouts[t]||[],h=this._layouts.length-1;!d.length&&A!==h&&this._layouts[h]?.length&&(A=h,this._layouts[h].forEach(g=>{const B=c.find(w=>w._id===g._id);B&&(!o&&!g.autoPosition&&(B.x=g.x??B.x,B.y=g.y??B.y),B.w=g.w??B.w,(g.x==null||g.y===void 0)&&(B.autoPosition=!0))})),d.forEach(g=>{const B=c.findIndex(w=>w._id===g._id);if(B!==-1){const w=c[B];if(o){w.w=g.w;return}(g.autoPosition||isNaN(g.x)||isNaN(g.y))&&this.findEmptyPosition(g,a),g.autoPosition||(w.x=g.x??w.x,w.y=g.y??w.y,w.w=g.w??w.w,a.push(w)),c.splice(B,1)}})}if(o)this.compact(n,!1);else{if(c.length)if(typeof n=="function")n(t,A,a,c);else{const d=o||n==="none"?1:t/A,h=n==="move"||n==="moveScale",g=n==="scale"||n==="moveScale";c.forEach(B=>{B.x=t===1?0:h?Math.round(B.x*d):Math.min(B.x,t-1),B.w=t===1||A===1?1:g?Math.round(B.w*d)||1:Math.min(B.w,t),a.push(B)}),c=[]}a=q.sort(a,-1),this._inColumnResize=!0,this.nodes=[],a.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!o),delete this._inColumnResize,this}cacheLayout(A,t,n=!1){const o=[];return A.forEach((a,c)=>{a._id===void 0&&(a._id=(a.id?this.nodes.find(d=>d.id===a.id):void 0)?._id??fn._idSeq++),o[c]={x:a.x,y:a.y,w:a.w,_id:a._id}}),this._layouts=n?[]:this._layouts||[],this._layouts[t]=o,this}cacheOneLayout(A,t){A._id=A._id??fn._idSeq++;const n={x:A.x,y:A.y,w:A.w,_id:A._id};(A.autoPosition||A.x===void 0)&&(delete n.x,delete n.y,A.autoPosition&&(n.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];const o=this.findCacheLayout(A,t);return o===-1?this._layouts[t].push(n):this._layouts[t][o]=n,this}findCacheLayout(A,t){return this._layouts?.[t]?.findIndex(n=>n._id===A._id)??-1}removeNodeFromLayoutCache(A){if(this._layouts)for(let t=0;t<this._layouts.length;t++){const n=this.findCacheLayout(A,t);n!==-1&&this._layouts[t].splice(n,1)}}cleanupNode(A){for(const t in A)t[0]==="_"&&t!=="_id"&&delete A[t];return this}};pi._idSeq=0;var be={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"},LA=class{},Ke=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),Ie=class{};function Nr(e,A){e.touches.length>1||(e.cancelable&&e.preventDefault(),q.simulateMouseEvent(e.changedTouches[0],A))}function ol(e,A){e.cancelable&&e.preventDefault(),q.simulateMouseEvent(e,A)}function Lr(e){Ie.touchHandled||(Ie.touchHandled=!0,Nr(e,"mousedown"))}function Tr(e){Ie.touchHandled&&Nr(e,"mousemove")}function kr(e){if(!Ie.touchHandled)return;Ie.pointerLeaveTimeout&&(window.clearTimeout(Ie.pointerLeaveTimeout),delete Ie.pointerLeaveTimeout);const A=!!LA.dragElement;Nr(e,"mouseup"),A||Nr(e,"click"),Ie.touchHandled=!1}function Mr(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function il(e){LA.dragElement&&e.pointerType!=="mouse"&&ol(e,"mouseenter")}function sl(e){LA.dragElement&&e.pointerType!=="mouse"&&(Ie.pointerLeaveTimeout=window.setTimeout(()=>{delete Ie.pointerLeaveTimeout,ol(e,"mouseleave")},10))}var al=class Bu{constructor(A,t,n){this.host=A,this.dir=t,this.option=n,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(A){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",A)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Bu.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Ke&&(this.el.addEventListener("touchstart",Lr),this.el.addEventListener("pointerdown",Mr)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Ke&&(this.el.removeEventListener("touchstart",Lr),this.el.removeEventListener("pointerdown",Mr)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(A){this.mouseDownEvent=A,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Ke&&(this.el.addEventListener("touchmove",Tr),this.el.addEventListener("touchend",kr)),A.stopPropagation(),A.preventDefault()}_mouseMove(A){const t=this.mouseDownEvent;this.moving?this._triggerEvent("move",A):Math.abs(A.x-t.x)+Math.abs(A.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",A),document.addEventListener("keydown",this._keyEvent)),A.stopPropagation()}_mouseUp(A){this.moving&&(this._triggerEvent("stop",A),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Ke&&(this.el.removeEventListener("touchmove",Tr),this.el.removeEventListener("touchend",kr)),delete this.moving,delete this.mouseDownEvent,A.stopPropagation(),A.preventDefault()}_keyEvent(A){A.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(A,t){return this.option[A]&&this.option[A](t),this}};al.prefix="ui-resizable-";var mi=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,A){this._eventRegister[e]=A}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,A){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](A)}},ll=class ts extends mi{constructor(A,t={}){super(),this.el=A,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const n=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||o;return{position:{left:(a.left-n.left)*this.rectScale.x,top:(a.top-n.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(A,t){super.on(A,t)}off(A){super.off(A)}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(A){const t=A.handles&&A.handles!==this.option.handles,n=A.autoHide&&A.autoHide!==this.option.autoHide;return Object.keys(A).forEach(o=>this.option[o]=A[o]),t&&(this._removeHandlers(),this._setupHandlers()),n&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(A){return A?(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),LA.overResizeElement===this&&delete LA.overResizeElement),this}_mouseOver(A){LA.overResizeElement||LA.dragElement||(LA.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(A){LA.overResizeElement===this&&(delete LA.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(A=>A.trim()).map(A=>new al(this.el,A,{element:this.option.element,start:t=>this._resizeStart(t),stop:t=>this._resizeStop(t),move:t=>this._resizing(t,A)})),this}_resizeStart(A){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=A,this._setupHelper(),this._applyChange();const t=q.initEvent(A,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(A,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(A,t),this._applyChange();const n=q.initEvent(A,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(n,this._ui()),this.triggerEvent("resize",n),this}_resizeStop(A){const t=q.initEvent(A,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=ts._originStyleProp.map(n=>this.el.style[n]),this.parentOriginStylePosition=this.el.parentElement.style.position;const A=this.el.parentElement,t=q.getValuesFromTransformedElement(A);return this.rectScale={x:t.xScale,y:t.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 ts._originStyleProp.forEach((A,t)=>{this.el.style[A]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(A,t){const n=this.startEvent,o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=A.clientX-n.clientX,c=this.sizeToContent?0:A.clientY-n.clientY;let d,h;t.indexOf("e")>-1?o.width+=a:t.indexOf("w")>-1&&(o.width-=a,o.left+=a,d=!0),t.indexOf("s")>-1?o.height+=c:t.indexOf("n")>-1&&(o.height-=c,o.top+=c,h=!0);const g=this._constrainSize(o.width,o.height,d,h);return Math.round(o.width)!==Math.round(g.width)&&(t.indexOf("w")>-1&&(o.left+=o.width-g.width),o.width=g.width),Math.round(o.height)!==Math.round(g.height)&&(t.indexOf("n")>-1&&(o.top+=o.height-g.height),o.height=g.height),o}_constrainSize(A,t,n,o){const a=this.option,c=(n?a.maxWidthMoveLeft:a.maxWidth)||Number.MAX_SAFE_INTEGER,d=a.minWidth/this.rectScale.x||A,h=(o?a.maxHeightMoveUp:a.maxHeight)||Number.MAX_SAFE_INTEGER,g=a.minHeight/this.rectScale.y||t;return{width:Math.min(c,Math.max(d,A)),height:Math.min(h,Math.max(g,t))}}_applyChange(){let A={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const{left:t,top:n}=this.el.parentElement.getBoundingClientRect();A={left:t,top:n,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const n=this.temporalRect[t],o=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(n-A[t])*o+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(A=>A.destroy()),delete this.handlers,this}};ll._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var xm='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',cl=class ns extends mi{constructor(A,t={}){super(),this.el=A,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const n=t?.handle?.substring(1),o=A.gridstackNode;this.dragEls=!n||A.classList.contains(n)?[A]:o?.subGrid?[A.querySelector(t.handle)||A]:Array.from(A.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[A]),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(A,t){super.on(A,t)}off(A){super.off(A)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(A=>{A.addEventListener("mousedown",this._mouseDown),Ke&&(A.addEventListener("touchstart",Lr),A.addEventListener("pointerdown",Mr))}),this.el.classList.remove("ui-draggable-disabled"))}disable(A=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),Ke&&(t.removeEventListener("touchstart",Lr),t.removeEventListener("pointerdown",Mr))}),A||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(A){return Object.keys(A).forEach(t=>this.option[t]=A[t]),this}_mouseDown(A){if(Ie.touchHandled&&A.isTrusted&&(Ie.touchHandled=!1),!LA.mouseHandled)return A.button!==0||!this.dragEls.find(t=>t===A.target)&&A.target.closest(xm)||this.option.cancel&&A.target.closest(this.option.cancel)||(this.mouseDownEvent=A,delete this.dragging,delete LA.dragElement,delete LA.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Ke&&(A.currentTarget.addEventListener("touchmove",Tr),A.currentTarget.addEventListener("touchend",kr)),A.preventDefault(),document.activeElement&&document.activeElement.blur(),LA.mouseHandled=!0),!0}_callDrag(A){if(!this.dragging)return;const t=q.initEvent(A,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(A){const t=this.mouseDownEvent;if(this.lastDrag=A,this.dragging)if(this._dragFollow(A),LA.pauseDrag){const n=Number.isInteger(LA.pauseDrag)?LA.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(A),n)}else this._callDrag(A);else if(Math.abs(A.x-t.x)+Math.abs(A.y-t.y)>3){this.dragging=!0,LA.dragElement=this;const n=this.el.gridstackNode?.grid;n?LA.dropElement=n.el.ddElement.ddDroppable:delete LA.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=q.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(A,this.el,this.helperContainment),this._setupHelperStyle(A);const o=q.initEvent(A,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(A){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Ke&&A.currentTarget&&(A.currentTarget.removeEventListener("touchmove",Tr,!0),A.currentTarget.removeEventListener("touchend",kr,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),LA.dropElement?.el===this.el.parentElement&&delete LA.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const t=q.initEvent(A,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),LA.dropElement&&LA.dropElement.drop(A)}delete this.helper,delete this.mouseDownEvent,delete LA.dragElement,delete LA.dropElement,delete LA.mouseHandled,A.preventDefault()}_keyEvent(A){const t=this.el.gridstackNode,n=t?.grid||LA.dropElement?.el?.gridstack;if(A.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),n?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&n&&(A.key==="r"||A.key==="R")){if(!q.canBeRotated(t))return;t._origRotate=t._origRotate||{...t._orig},delete t._moving,n.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",q.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let A=this.el;return typeof this.option.helper=="function"?A=this.option.helper(this.el):this.option.helper==="clone"&&(A=q.cloneNode(this.el)),A.parentElement||q.appendTo(A,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=ns.originStyleProp.map(t=>this.el.style[t]),A}_setupHelperStyle(A){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(A),t.transition="none",setTimeout(()=>{this.helper&&(t.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 A=this.helper,t=this.dragElementOriginStyle.transition||null;A.style.transition=this.dragElementOriginStyle.transition="none",ns.originStyleProp.forEach(n=>A.style[n]=this.dragElementOriginStyle[n]||null),setTimeout(()=>A.style.transition=t,50)}return delete this.dragElementOriginStyle,this}_dragFollow(A){const t={left:0,top:0},n=this.helper.style,o=this.dragOffset;n.left=(A.clientX+o.offsetLeft-t.left)*this.dragTransform.xScale+"px",n.top=(A.clientY+o.offsetTop-t.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(A,t,n){let o=0,a=0;n&&(o=this.dragTransform.xOffset,a=this.dragTransform.yOffset);const c=t.getBoundingClientRect();return{left:c.left,top:c.top,offsetLeft:-A.clientX+c.left-o,offsetTop:-A.clientY+c.top-a,width:c.width*this.dragTransform.xScale,height:c.height*this.dragTransform.yScale}}ui(){const A=this.el.parentElement.getBoundingClientRect(),t=this.helper.getBoundingClientRect();return{position:{top:(t.top-A.top)*this.dragTransform.yScale,left:(t.left-A.left)*this.dragTransform.xScale}}}};cl.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var Dm=class extends mi{constructor(e,A={}){super(),this.el=e,this.option=A,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,A){super.on(e,A)}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),Ke&&(this.el.addEventListener("pointerenter",il),this.el.addEventListener("pointerleave",sl)))}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),Ke&&(this.el.removeEventListener("pointerenter",il),this.el.removeEventListener("pointerleave",sl)))}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(A=>this.option[A]=e[A]),this._setupAccept(),this}_mouseEnter(e){if(!LA.dragElement||Ie.touchHandled&&e.isTrusted||!this._canDrop(LA.dragElement.el))return;e.preventDefault(),e.stopPropagation(),LA.dropElement&&LA.dropElement!==this&&LA.dropElement._mouseLeave(e,!0),LA.dropElement=this;const A=q.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(A,this._ui(LA.dragElement)),this.triggerEvent("dropover",A),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,A=!1){if(!LA.dragElement||LA.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const t=q.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(LA.dragElement)),this.triggerEvent("dropout",t),LA.dropElement===this&&(delete LA.dropElement,!A)){let n,o=this.el.parentElement;for(;!n&&o;)n=o.ddElement?.ddDroppable,o=o.parentElement;n&&n._mouseEnter(e)}}drop(e){e.preventDefault();const A=q.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(A,this._ui(LA.dragElement)),this.triggerEvent("drop",A)}_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()}}},Nm=class pu{static init(A){return A.ddElement||(A.ddElement=new pu(A)),A.ddElement}constructor(A){this.el=A}on(A,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(A)>-1?this.ddDraggable.on(A,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(A)>-1?this.ddDroppable.on(A,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(A)>-1&&this.ddResizable.on(A,t),this}off(A){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(A)>-1?this.ddDraggable.off(A):this.ddDroppable&&["drop","dropover","dropout"].indexOf(A)>-1?this.ddDroppable.off(A):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(A)>-1&&this.ddResizable.off(A),this}setupDraggable(A){return this.ddDraggable?this.ddDraggable.updateOption(A):this.ddDraggable=new cl(this.el,A),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(A){return this.ddResizable?this.ddResizable.updateOption(A):this.ddResizable=new ll(this.el,A),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(A){return this.ddDroppable?this.ddDroppable.updateOption(A):this.ddDroppable=new Dm(this.el,A),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},Lm=class{resizable(e,A,t,n){return this._getDDElements(e,A).forEach(o=>{if(A==="disable"||A==="enable")o.ddResizable&&o.ddResizable[A]();else if(A==="destroy")o.ddResizable&&o.cleanResizable();else if(A==="option")o.setupResizable({[t]:n});else{const a=o.el.gridstackNode.grid;let c=o.el.getAttribute("gs-resize-handles")||a.opts.resizable.handles||"e,s,se";c==="all"&&(c="n,e,s,w,se,sw,ne,nw");const d=!a.opts.alwaysShowResizeHandle;o.setupResizable({...a.opts.resizable,handles:c,autoHide:d,start:A.start,stop:A.stop,resize:A.resize})}}),this}draggable(e,A,t,n){return this._getDDElements(e,A).forEach(o=>{if(A==="disable"||A==="enable")o.ddDraggable&&o.ddDraggable[A]();else if(A==="destroy")o.ddDraggable&&o.cleanDraggable();else if(A==="option")o.setupDraggable({[t]:n});else{const a=o.el.gridstackNode.grid;o.setupDraggable({...a.opts.draggable,start:A.start,stop:A.stop,drag:A.drag})}}),this}dragIn(e,A){return this._getDDElements(e).forEach(t=>t.setupDraggable(A)),this}droppable(e,A,t,n){return typeof A.accept=="function"&&!A._accept&&(A._accept=A.accept,A.accept=o=>A._accept(o)),this._getDDElements(e,A).forEach(o=>{A==="disable"||A==="enable"?o.ddDroppable&&o.ddDroppable[A]():A==="destroy"?o.ddDroppable&&o.cleanDroppable():A==="option"?o.setupDroppable({[t]:n}):o.setupDroppable(A)}),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,A,t){return this._getDDElements(e).forEach(n=>n.on(A,o=>{t(o,LA.dragElement?LA.dragElement.el:o.target,LA.dragElement?LA.dragElement.helper:null)})),this}off(e,A){return this._getDDElements(e).forEach(t=>t.off(A)),this}_getDDElements(e,A){const t=e.gridstack||A!=="destroy"&&A!=="disable",n=q.getElements(e);return n.length?n.map(o=>o.ddElement||(t?Nm.init(o):null)).filter(o=>o):[]}},we=new Lm,jt=class NA{static init(A={},t=".grid-stack"){if(typeof document>"u")return null;const n=NA.getGridElement(t);return n?(n.gridstack||(n.gridstack=new NA(n,q.cloneDeep(A))),n.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - 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(A={},t=".grid-stack"){const n=[];return typeof document>"u"||(NA.getGridElements(t).forEach(o=>{o.gridstack||(o.gridstack=new NA(o,q.cloneDeep(A))),n.push(o.gridstack)}),n.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
28
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),n}static addGrid(A,t={}){if(!A)return null;let n=A;if(n.gridstack){const o=n.gridstack;return t&&(o.opts={...o.opts,...t}),t.children!==void 0&&o.load(t.children),o}return(!A.classList.contains("grid-stack")||NA.addRemoveCB)&&(NA.addRemoveCB?n=NA.addRemoveCB(A,t,!0,!0):n=q.createDiv(["grid-stack",t.class],A)),NA.init(t,n)}static registerEngine(A){NA.engineClass=A}get placeholder(){if(!this._placeholder){this._placeholder=q.createDiv([this.opts.placeholderClass,be.itemClass,this.opts.itemClass]);const A=q.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(A.textContent=this.opts.placeholderText)}return this._placeholder}constructor(A,t={}){this.el=A,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},A.gridstack=this,this.opts=t=t||{},A.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);const n=q.toNumber(A.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);const o=t.columnOpts;if(o){const h=o.breakpoints;!o.columnWidth&&!h?.length?delete t.columnOpts:(o.columnMax=o.columnMax||12,h?.length>1&&h.sort((g,B)=>(B.w||0)-(g.w||0)))}const a={...q.cloneDeep(be),column:q.toNumber(A.getAttribute("gs-column"))||be.column,minRow:n||q.toNumber(A.getAttribute("gs-min-row"))||be.minRow,maxRow:n||q.toNumber(A.getAttribute("gs-max-row"))||be.maxRow,staticGrid:q.toBool(A.getAttribute("gs-static"))||be.staticGrid,sizeToContent:q.toBool(A.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||be.draggable.handle},removableOptions:{accept:t.itemClass||be.removableOptions.accept,decline:be.removableOptions.decline}};A.getAttribute("gs-animate")&&(a.animate=q.toBool(A.getAttribute("gs-animate"))),t=q.defaults(t,a),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(t),t.rtl==="auto"&&(t.rtl=A.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");const c=this.el.closest("."+be.itemClass)?.gridstackNode;if(c&&(c.subGrid=this,this.parentGridNode=c,this.el.classList.add("grid-stack-nested"),c.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial")this.cellHeight(void 0);else{typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==be.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit);const h=t.cellHeight;delete t.cellHeight,this.cellHeight(h)}t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=Ke),this._setStaticClass();const d=t.engineClass||NA.engineClass||pi;if(this.engine=new d({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:h=>{h.forEach(g=>{const B=g.el;B&&(g._removeDOM?(B&&B.remove(),delete g._removeDOM):this._writePosAttr(B,g))}),this._updateContainerHeight()}}),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(h=>this._prepareElement(h)),delete this.engine._loading,this.batchUpdate(!1)),t.children){const h=t.children;delete t.children,h.length&&this.load(h)}this.setAnimation(),t.subGridDynamic&&!LA.pauseDrag&&(LA.pauseDrag=!0),t.draggable?.pause!==void 0&&(LA.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(A=this.opts){this.el.classList.add("gs-"+A.column),typeof A.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/A.column}%`)}addWidget(A){if(!A)return;if(typeof A=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(A.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(A);let t,n=A;if(n.grid=this,n.el?t=n.el:NA.addRemoveCB?t=NA.addRemoveCB(this.el,A,!0,!1):t=this.createWidgetDivs(n),!t)return;if(n=t.gridstackNode,n&&t.parentElement===this.el&&this.engine.nodes.find(a=>a._id===n._id))return t;const o=this._readAttr(t);return q.defaults(A,o),this.engine.prepareNode(A),this.el.appendChild(t),this.makeWidget(t,A),t}createWidgetDivs(A){const t=q.createDiv(["grid-stack-item",this.opts.itemClass]),n=q.createDiv(["grid-stack-item-content"],t);return q.lazyLoad(A)?A.visibleObservable||(A.visibleObservable=new IntersectionObserver(([o])=>{o.isIntersecting&&(A.visibleObservable?.disconnect(),delete A.visibleObservable,NA.renderCB(n,A),A.grid?.prepareDragDrop(A.el))}),window.setTimeout(()=>A.visibleObservable?.observe(t))):NA.renderCB(n,A),t}makeSubGrid(A,t,n,o=!0){let a=A.gridstackNode;if(a||(a=this.makeWidget(A).gridstackNode),a.subGrid?.el)return a.subGrid;let c,d=this;for(;d&&!c;)c=d.opts?.subGridOpts,d=d.parentGridNode?.grid;t=q.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...c||{},...t||a.subGridOpts||{}}),a.subGridOpts=t;let h;t.column==="auto"&&(h=!0,t.column=Math.max(a.w||1,n?.w||1),delete t.columnOpts);let g=a.el.querySelector(".grid-stack-item-content"),B,w;if(o&&(this._removeDD(a.el),w={...a,x:0,y:0},q.removeInternalForSave(w),delete w.subGridOpts,a.content&&(w.content=a.content,delete a.content),NA.addRemoveCB?B=NA.addRemoveCB(this.el,w,!0,!1):(B=q.createDiv(["grid-stack-item"]),B.appendChild(g),g=q.createDiv(["grid-stack-item-content"],a.el)),this.prepareDragDrop(a.el)),n){const y=h?t.column:a.w,v=a.h+n.h,I=a.el.style;I.transition="none",this.update(a.el,{w:y,h:v}),setTimeout(()=>I.transition=null)}const m=a.subGrid=NA.addGrid(g,t);return n?._moving&&(m._isTemp=!0),h&&(m._autoColumn=!0),o&&m.makeWidget(B,w),n&&(n._moving?window.setTimeout(()=>q.simulateMouseEvent(n._event,"mouseenter",m.el),0):m.makeWidget(a.el,a)),this.resizeToContentCheck(!1,a),m}removeAsSubGrid(A){const t=this.parentGridNode?.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(n=>{n.x+=this.parentGridNode.x,n.y+=this.parentGridNode.y,t.makeWidget(n.el,n)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,A&&window.setTimeout(()=>q.simulateMouseEvent(A._event,"mouseenter",t.el),0))}save(A=!0,t=!1,n=NA.saveCB,o){const a=this.engine.save(A,n,o);if(a.forEach(c=>{if(A&&c.el&&!c.subGrid&&!n)c.content=c.el.querySelector(".grid-stack-item-content")?.innerHTML,c.content||delete c.content;else if(!A&&!n&&delete c.content,c.subGrid?.el){const d=c.w||c.subGrid.getColumn(),h=c.subGrid.save(A,t,n,d);c.subGridOpts=t?h:{children:h},delete c.subGrid}delete c.el}),t){const c=q.cloneDeep(this.opts);c.marginBottom===c.marginTop&&c.marginRight===c.marginLeft&&c.marginTop===c.marginRight&&(c.margin=c.marginTop,delete c.marginTop,delete c.marginRight,delete c.marginBottom,delete c.marginLeft),c.rtl===(this.el.style.direction==="rtl")&&(c.rtl="auto"),this._isAutoCellHeight&&(c.cellHeight="auto"),this._autoColumn&&(c.column="auto");const d=c._alwaysShowResizeHandle;return delete c._alwaysShowResizeHandle,d!==void 0?c.alwaysShowResizeHandle=d:delete c.alwaysShowResizeHandle,q.removeInternalAndSame(c,be),c.children=a,c}return a}load(A,t=NA.addRemoveCB||!0){A=q.cloneDeep(A);const n=this.getColumn();A.forEach(B=>{B.w=B.w||B.minW||1,B.h=B.h||B.minH||1}),A=q.sort(A),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let o=0;A.forEach(B=>{o=Math.max(o,(B.x||0)+B.w)}),o>this.engine.defaultColumn&&(this.engine.defaultColumn=o),o>n&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=A,this.engine.columnChanged(o,n,this.responseLayout),A=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(A,o,!0));const a=NA.addRemoveCB;typeof t=="function"&&(NA.addRemoveCB=t);const c=[];this.batchUpdate();const d=!this.engine.nodes.length,h=d&&this.opts.animate;h&&this.setAnimation(!1),!d&&t&&[...this.engine.nodes].forEach(B=>{B.id&&(q.find(A,B.id)||(NA.addRemoveCB&&NA.addRemoveCB(this.el,B,!1,!1),c.push(B),this.removeWidget(B.el,!0,!1)))}),this.engine._loading=!0;const g=[];return this.engine.nodes=this.engine.nodes.filter(B=>q.find(A,B.id)?(g.push(B),!1):!0),A.forEach(B=>{const w=q.find(g,B.id);if(w){if(q.shouldSizeToContent(w)&&(B.h=w.h),this.engine.nodeBoundFix(B),(B.autoPosition||B.x===void 0||B.y===void 0)&&(B.w=B.w||w.w,B.h=B.h||w.h,this.engine.findEmptyPosition(B)),this.engine.nodes.push(w),q.samePos(w,B)&&this.engine.nodes.length>1&&(this.moveNode(w,{...B,forceCollide:!0}),q.copyPos(B,w)),this.update(w.el,B),B.subGridOpts?.children){const m=w.el.querySelector(".grid-stack");m&&m.gridstack&&m.gridstack.load(B.subGridOpts.children)}}else t&&this.addWidget(B)}),delete this.engine._loading,this.engine.removedNodes=c,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,a?NA.addRemoveCB=a:delete NA.addRemoveCB,h&&this.setAnimation(!0,!0),this}batchUpdate(A=!0){return this.engine.batchUpdate(A),A||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(A=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!A||!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 t=this.el.querySelector("."+this.opts.itemClass);if(t){const o=q.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/o)}const n=parseInt(this.el.getAttribute("gs-current-row"));return n?Math.round(this.el.getBoundingClientRect().height/n):this.opts.cellHeight}cellHeight(A){if(A!==void 0&&this._isAutoCellHeight!==(A==="auto")&&(this._isAutoCellHeight=A==="auto",this._updateResizeEvent()),(A==="initial"||A==="auto")&&(A=void 0),A===void 0){const n=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;A=this.cellWidth()+n}const t=q.parseHeight(A);return this.opts.cellHeightUnit===t.unit&&this.opts.cellHeight===t.h?this:(this.opts.cellHeightUnit=t.unit,this.opts.cellHeight=t.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(A=!1){return A&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const A=this.opts.columnOpts;if(!A||!A.columnWidth&&!A.breakpoints?.length)return!1;const t=this.getColumn();let n=t;const o=this._widthOrContainer(!0);if(A.columnWidth)n=Math.min(Math.round(o/A.columnWidth)||1,A.columnMax);else{n=A.columnMax;let a=0;for(;a<A.breakpoints.length&&o<=A.breakpoints[a].w;)n=A.breakpoints[a++].c||t}if(n!==t){const a=A.breakpoints?.find(c=>c.c===n);return this.column(n,a?.layout||A.layout),!0}return!1}compact(A="compact",t=!0){return this.engine.compact(A,t),this._triggerChangeEvent(),this}column(A,t="moveScale"){if(!A||A<1||this.opts.column===A)return this;const n=this.getColumn();return this.opts.column=A,this.engine?(this.engine.column=A,this.el.classList.remove("gs-"+n),this._updateColumnVar(),this.engine.columnChanged(n,A,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=t,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(A=>A.matches("."+this.opts.itemClass)&&!A.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(A=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),A?this.el.parentNode.removeChild(this.el):(this.removeAll(A),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(A){return this.opts.float!==A&&(this.opts.float=this.engine.float=A,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(A,t=!1){const n=this.el.getBoundingClientRect();let o;t?o={top:n.top+document.documentElement.scrollTop,left:n.left}:o={top:this.el.offsetTop,left:this.el.offsetLeft};const a=A.left-o.left,c=A.top-o.top,d=n.width/this.getColumn(),h=n.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(a/d),y:Math.floor(c/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(A,t,n,o){return this.engine.isAreaEmpty(A,t,n,o)}makeWidget(A,t){const n=NA.getElement(A);if(!n||n.gridstackNode)return n;n.parentElement||this.el.appendChild(n),this._prepareElement(n,!0,t);const o=n.gridstackNode;this._updateContainerHeight(),o.subGridOpts&&this.makeSubGrid(n,o.subGridOpts,void 0,!1);let a;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(a=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),a&&delete this._ignoreLayoutsNodeChange,n}on(A,t){return A.indexOf(" ")!==-1?(A.split(" ").forEach(n=>this.on(n,t)),this):(A==="change"||A==="added"||A==="removed"||A==="enable"||A==="disable"?(A==="enable"||A==="disable"?this._gsEventHandler[A]=n=>t(n):this._gsEventHandler[A]=n=>{n.detail&&t(n,n.detail)},this.el.addEventListener(A,this._gsEventHandler[A])):A==="drag"||A==="dragstart"||A==="dragstop"||A==="resizestart"||A==="resize"||A==="resizestop"||A==="dropped"||A==="resizecontent"?this._gsEventHandler[A]=t:console.error("GridStack.on("+A+") event not supported"),this)}off(A){return A.indexOf(" ")!==-1?(A.split(" ").forEach(t=>this.off(t)),this):((A==="change"||A==="added"||A==="removed"||A==="enable"||A==="disable")&&this._gsEventHandler[A]&&this.el.removeEventListener(A,this._gsEventHandler[A]),delete this._gsEventHandler[A],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(A=>this.off(A)),this}removeWidget(A,t=!0,n=!0){return A?(NA.getElements(A).forEach(o=>{if(o.parentElement&&o.parentElement!==this.el)return;let a=o.gridstackNode;a||(a=this.engine.nodes.find(c=>o===c.el)),a&&(t&&NA.addRemoveCB&&NA.addRemoveCB(this.el,a,!1,!1),delete o.gridstackNode,this._removeDD(o),this.engine.removeNode(a,t,n),t&&o.parentElement&&o.remove())}),n&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(A=!0,t=!0){return this.engine.nodes.forEach(n=>{A&&NA.addRemoveCB&&NA.addRemoveCB(this.el,n,!1,!1),delete n.el.gridstackNode,this.opts.staticGrid||this._removeDD(n.el)}),this.engine.removeAll(A,t),t&&this._triggerRemoveEvent(),this}setAnimation(A=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(A)}):A?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=A,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(A,t=!0,n=!0){return!!this.opts.staticGrid===A?this:(A?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.setStatic(A,t,n)}),t&&this._setStaticClass(),this)}updateOptions(A){const t=this.opts;return A===t?this:(A.acceptWidgets!==void 0&&(t.acceptWidgets=A.acceptWidgets,this._setupAcceptWidget()),A.animate!==void 0&&this.setAnimation(A.animate),A.cellHeight&&this.cellHeight(A.cellHeight),A.class!==void 0&&A.class!==t.class&&(t.class&&this.el.classList.remove(t.class),A.class&&this.el.classList.add(A.class)),A.columnOpts?(this.opts.columnOpts=A.columnOpts,this.checkDynamicColumn()):A.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof A.column=="number"&&this.column(A.column),A.margin!==void 0&&this.margin(A.margin),A.staticGrid!==void 0&&this.setStatic(A.staticGrid),A.disableDrag!==void 0&&!A.staticGrid&&this.enableMove(!A.disableDrag),A.disableResize!==void 0&&!A.staticGrid&&this.enableResize(!A.disableResize),A.float!==void 0&&this.float(A.float),A.row!==void 0?(t.minRow=t.maxRow=t.row=A.row,this._updateContainerHeight()):(A.minRow!==void 0&&(t.minRow=A.minRow,this._updateContainerHeight()),A.maxRow!==void 0&&(t.maxRow=A.maxRow)),A.lazyLoad!==void 0&&(t.lazyLoad=A.lazyLoad),A.children?.length&&this.load(A.children),this)}update(A,t){return NA.getElements(A).forEach(n=>{const o=n?.gridstackNode;if(!o)return;const a={...q.copyPos({},o),...q.cloneDeep(t)};this.engine.nodeBoundFix(a),delete a.autoPosition;const c=["x","y","w","h"];let d;if(c.some(B=>a[B]!==void 0&&a[B]!==o[B])&&(d={},c.forEach(B=>{d[B]=a[B]!==void 0?a[B]:o[B],delete a[B]})),!d&&(a.minW||a.minH||a.maxW||a.maxH)&&(d={}),a.content!==void 0){const B=n.querySelector(".grid-stack-item-content");B&&B.textContent!==a.content&&(o.content=a.content,NA.renderCB(B,a),o.subGrid?.el&&(B.appendChild(o.subGrid.el),o.subGrid._updateContainerHeight())),delete a.content}let h=!1,g=!1;for(const B in a)B[0]!=="_"&&o[B]!==a[B]&&(o[B]=a[B],h=!0,g=g||!this.opts.staticGrid&&(B==="noResize"||B==="noMove"||B==="locked"));if(q.sanitizeMinMax(o),d){const B=d.w!==void 0&&d.w!==o.w;this.moveNode(o,d),B&&o.subGrid?o.subGrid.onResize(this.hasAnimationCSS()?o.w:void 0):this.resizeToContentCheck(B,o),delete o._orig}(d||h)&&this._writeAttr(n,o),g&&this.prepareDragDrop(o.el),NA.updateCB&&NA.updateCB(o)}),this}moveNode(A,t){const n=A._updating;n||this.engine.cleanNodes().beginUpdate(A),this.engine.moveNode(A,t),this._updateContainerHeight(),n||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(A){if(!A||(A.classList.remove("size-to-content-max"),!A.clientHeight))return;const t=A.gridstackNode;if(!t)return;const n=t.grid;if(!n||A.parentElement!==n.el)return;const o=n.getCellHeight(!0);if(!o)return;let a=t.h?t.h*o:A.clientHeight,c;if(t.resizeToContentParent&&(c=A.querySelector(t.resizeToContentParent)),c||(c=A.querySelector(NA.resizeToContentParent)),!c)return;const d=A.clientHeight-c.clientHeight,h=t.h?t.h*o-d:c.clientHeight;let g;if(t.subGrid){g=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);const m=t.subGrid.el.getBoundingClientRect(),y=A.getBoundingClientRect();g+=m.top-y.top}else{if(t.subGridOpts?.children?.length)return;{const m=c.firstElementChild;if(!m){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${NA.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}g=m.getBoundingClientRect().height||h}}if(h===g)return;a+=g-h;let B=Math.ceil(a/o);const w=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;w&&B>w&&(B=w,A.classList.add("size-to-content-max")),t.minH&&B<t.minH?B=t.minH:t.maxH&&B>t.maxH&&(B=t.maxH),B!==t.h&&(n._ignoreLayoutsNodeChange=!0,n.moveNode(t,{h:B}),delete n._ignoreLayoutsNodeChange)}resizeToContentCBCheck(A){NA.resizeToContentCB?NA.resizeToContentCB(A):this.resizeToContent(A)}rotate(A,t){return NA.getElements(A).forEach(n=>{const o=n.gridstackNode;if(!q.canBeRotated(o))return;const a={w:o.h,h:o.w,minH:o.minW,minW:o.minH,maxH:o.maxW,maxW:o.maxH};if(t){const d=t.left>0?Math.floor(t.left/this.cellWidth()):0,h=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;a.x=o.x+d-(o.h-(h+1)),a.y=o.y+h-d}Object.keys(a).forEach(d=>{a[d]===void 0&&delete a[d]});const c=o._orig;this.update(n,a),o._orig=c}),this}margin(A){if(!(typeof A=="string"&&A.split(" ").length>1)){const t=q.parseHeight(A);if(this.opts.marginUnit===t.unit&&this.opts.margin===t.h)return}return this.opts.margin=A,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(A){return this.engine.willItFit(A)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const A=this.engine.getDirtyNodes(!0);return A&&A.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(A),this._triggerEvent("change",A)),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(t=>{delete t._dirty});const A=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",A)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const A=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",A)}return this}_triggerEvent(A,t){const n=t?new CustomEvent(A,{bubbles:!1,detail:t}):new Event(A);let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;return o.el.dispatchEvent(n),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const A=this.parentGridNode;let t=this.getRow()+this._extraDragRow;const n=this.opts.cellHeight,o=this.opts.cellHeightUnit;if(!n)return this;if(!A&&!this.opts.minRow){const a=q.parseHeight(getComputedStyle(this.el).minHeight);if(a.h>0&&a.unit===o){const c=Math.floor(a.h/n);t<c&&(t=c)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[A?"minHeight":"height"]=t*n+o),A&&q.shouldSizeToContent(A)&&A.grid.resizeToContentCBCheck(A.el),this}_prepareElement(A,t=!1,n){n=n||this._readAttr(A),A.gridstackNode=n,n.el=A,n.grid=this,n=this.engine.addNode(n,t),this._writeAttr(A,n),A.classList.add(be.itemClass,this.opts.itemClass);const o=q.shouldSizeToContent(n);return o?A.classList.add("size-to-content"):A.classList.remove("size-to-content"),o&&this.resizeToContentCheck(!1,n),q.lazyLoad(n)||this.prepareDragDrop(n.el),this}_writePosAttr(A,t){return(!t._moving&&!t._resizing||this._placeholder===A)&&(A.style.top=t.y?t.y===1?"var(--gs-cell-height)":`calc(${t.y} * var(--gs-cell-height))`:null,A.style.left=t.x?t.x===1?"var(--gs-column-width)":`calc(${t.x} * var(--gs-column-width))`:null,A.style.width=t.w>1?`calc(${t.w} * var(--gs-column-width))`:null,A.style.height=t.h>1?`calc(${t.h} * var(--gs-cell-height))`:null),A.setAttribute("gs-x",String(t.x)),A.setAttribute("gs-y",String(t.y)),t.w>1?A.setAttribute("gs-w",String(t.w)):A.removeAttribute("gs-w"),t.h>1?A.setAttribute("gs-h",String(t.h)):A.removeAttribute("gs-h"),this}_writeAttr(A,t){if(!t)return this;this._writePosAttr(A,t);const n={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const o in n)t[o]?A.setAttribute(n[o],String(t[o])):A.removeAttribute(n[o]);return this}_readAttr(A,t=!0){const n={};n.x=q.toNumber(A.getAttribute("gs-x")),n.y=q.toNumber(A.getAttribute("gs-y")),n.w=q.toNumber(A.getAttribute("gs-w")),n.h=q.toNumber(A.getAttribute("gs-h")),n.autoPosition=q.toBool(A.getAttribute("gs-auto-position")),n.noResize=q.toBool(A.getAttribute("gs-no-resize")),n.noMove=q.toBool(A.getAttribute("gs-no-move")),n.locked=q.toBool(A.getAttribute("gs-locked"));const o=A.getAttribute("gs-size-to-content");o&&(o==="true"||o==="false"?n.sizeToContent=q.toBool(o):n.sizeToContent=parseInt(o,10)),n.id=A.getAttribute("gs-id"),n.maxW=q.toNumber(A.getAttribute("gs-max-w")),n.minW=q.toNumber(A.getAttribute("gs-min-w")),n.maxH=q.toNumber(A.getAttribute("gs-max-h")),n.minH=q.toNumber(A.getAttribute("gs-min-h")),t&&(n.w===1&&A.removeAttribute("gs-w"),n.h===1&&A.removeAttribute("gs-h"),n.maxW&&A.removeAttribute("gs-max-w"),n.minW&&A.removeAttribute("gs-min-w"),n.maxH&&A.removeAttribute("gs-max-h"),n.minH&&A.removeAttribute("gs-min-h"));for(const a in n){if(!n.hasOwnProperty(a))return;!n[a]&&n[a]!==0&&a!=="sizeToContent"&&delete n[a]}return n}_setStaticClass(){const A=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...A),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...A),this.el.removeAttribute("gs-static")),this}onResize(A=this.el?.clientWidth){if(!A||this.prevWidth===A)return;this.prevWidth=A,this.batchUpdate();let t=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),t=!0):t=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(n=>{n.subGrid&&n.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(t),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(A=!1,t=void 0){if(this.engine){if(A&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)q.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(n=>q.shouldSizeToContent(n))){const n=[...this.engine.nodes];this.batchUpdate(),n.forEach(o=>{q.shouldSizeToContent(o)&&this.resizeToContentCBCheck(o.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(A=!1){const t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(n=>n.sizeToContent));return!A&&t&&!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):(A||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(A=".grid-stack-item"){return q.getElement(A)}static getElements(A=".grid-stack-item"){return q.getElements(A)}static getGridElement(A){return NA.getElement(A)}static getGridElements(A){return q.getElements(A)}_initMargin(){let A,t=0,n=[];typeof this.opts.margin=="string"&&(n=this.opts.margin.split(" ")),n.length===2?(this.opts.marginTop=this.opts.marginBottom=n[0],this.opts.marginLeft=this.opts.marginRight=n[1]):n.length===4?(this.opts.marginTop=n[0],this.opts.marginRight=n[1],this.opts.marginBottom=n[2],this.opts.marginLeft=n[3]):(A=q.parseHeight(this.opts.margin),this.opts.marginUnit=A.unit,t=this.opts.margin=A.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(a=>{this.opts[a]===void 0?this.opts[a]=t:(A=q.parseHeight(this.opts[a]),this.opts[a]=A.h,delete this.opts.margin)}),this.opts.marginUnit=A.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 o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return we}static setupDragIn(A,t,n,o=document){t?.pause!==void 0&&(LA.pauseDrag=t.pause),t={appendTo:"body",helper:"clone",...t||{}},(typeof A=="string"?q.getElements(A,o):A).forEach((a,c)=>{we.isDraggable(a)||we.dragIn(a,t),n?.[c]&&(a.gridstackNode=n[c])})}movable(A,t){return this.opts.staticGrid?this:(NA.getElements(A).forEach(n=>{const o=n.gridstackNode;o&&(t?delete o.noMove:o.noMove=!0,this.prepareDragDrop(o.el))}),this)}resizable(A,t){return this.opts.staticGrid?this:(NA.getElements(A).forEach(n=>{const o=n.gridstackNode;o&&(t?delete o.noResize:o.noResize=!0,this.prepareDragDrop(o.el))}),this)}disable(A=!0){if(!this.opts.staticGrid)return this.enableMove(!1,A),this.enableResize(!1,A),this._triggerEvent("disable"),this}enable(A=!0){if(!this.opts.staticGrid)return this.enableMove(!0,A),this.enableResize(!0,A),this._triggerEvent("enable"),this}enableMove(A,t=!0){return this.opts.staticGrid?this:(A?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&t&&n.subGrid.enableMove(A,t)}),this)}enableResize(A,t=!0){return this.opts.staticGrid?this:(A?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&t&&n.subGrid.enableResize(A,t)}),this)}cancelDrag(){const A=this._placeholder?.gridstackNode;A&&(A._isExternal?(A._isAboutToRemove=!0,this.engine.removeNode(A)):A._isAboutToRemove&&NA._itemRemoving(A.el,!1),this.engine.restoreInitial())}_removeDD(A){return we.draggable(A,"destroy").resizable(A,"destroy"),A.gridstackNode&&delete A.gridstackNode._initDD,delete A.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return we.droppable(this.el,"destroy"),this;let A,t;const n=(o,a,c)=>{c=c||a;const d=c.gridstackNode;if(!d)return;if(!d.grid?.el){c.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const m=c.getBoundingClientRect();c.style.left=m.x+(this.dragTransform.xScale-1)*(o.clientX-m.x)/this.dragTransform.xScale+"px",c.style.top=m.y+(this.dragTransform.yScale-1)*(o.clientY-m.y)/this.dragTransform.yScale+"px",c.style.transformOrigin="0px 0px"}let{top:h,left:g}=c.getBoundingClientRect();const B=this.el.getBoundingClientRect();g-=B.left,h-=B.top;const w={position:{top:h*this.dragTransform.xScale,left:g*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(g/t)),d.y=Math.max(0,Math.round(h/A)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){we.off(a,"drag");return}d._willFitPos&&(q.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(c,o,w,d,t,A)}else this._dragOrResize(c,o,w,d,t,A)};return we.droppable(this.el,{accept:o=>{const a=o.gridstackNode||this._readAttr(o,!1);if(a?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let c=!0;if(typeof this.opts.acceptWidgets=="function")c=this.opts.acceptWidgets(o);else{const d=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;c=o.matches(d)}if(c&&a&&this.opts.maxRow){const d={w:a.w,h:a.h,minW:a.minW,minH:a.minH};c=this.engine.willItFit(d)}return c}}).on(this.el,"dropover",(o,a,c)=>{let d=c?.gridstackNode||a.gridstackNode;if(d?.grid===this&&!d._temporaryRemoved)return!1;if(d?._sidebarOrig&&(d.w=d._sidebarOrig.w,d.h=d._sidebarOrig.h),d?.grid&&d.grid!==this&&!d._temporaryRemoved&&d.grid._leave(a,c),c=c||a,t=this.cellWidth(),A=this.getCellHeight(!0),!d){const B=c.getAttribute("data-gs-widget")||c.getAttribute("gridstacknode");if(B){try{d=JSON.parse(B)}catch{console.error("Gridstack dropover: Bad JSON format: ",B)}c.removeAttribute("data-gs-widget"),c.removeAttribute("gridstacknode")}d||(d=this._readAttr(c)),d._sidebarOrig={w:d.w,h:d.h}}d.grid||(d.el||(d={...d}),d._isExternal=!0,c.gridstackNode=d);const h=d.w||Math.round(c.offsetWidth/t)||1,g=d.h||Math.round(c.offsetHeight/A)||1;return d.grid&&d.grid!==this?(a._gridstackNodeOrig||(a._gridstackNodeOrig=d),a.gridstackNode=d={...d,w:h,h:g,grid:this},delete d.x,delete d.y,this.engine.cleanupNode(d).nodeBoundFix(d),d._initDD=d._isExternal=d._temporaryRemoved=!0):(d.w=h,d.h=g,d._temporaryRemoved=!0),NA._itemRemoving(d.el,!1),we.on(a,"drag",n),n(o,a,c),!1}).on(this.el,"dropout",(o,a,c)=>{const d=c?.gridstackNode||a.gridstackNode;return d&&(!d.grid||d.grid===this)&&(this._leave(a,c),this._isTemp&&this.removeAsSubGrid(d)),!1}).on(this.el,"drop",(o,a,c)=>{const d=c?.gridstackNode||a.gridstackNode;if(d?.grid===this&&!d._isExternal)return!1;const h=!!this.placeholder.parentElement,g=a!==c;this.placeholder.remove(),delete this.placeholder.gridstackNode,h&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const B=a._gridstackNodeOrig;if(delete a._gridstackNodeOrig,h&&B?.grid&&B.grid!==this){const m=B.grid;m.engine.removeNodeFromLayoutCache(B),m.engine.removedNodes.push(B),m._triggerRemoveEvent()._triggerChangeEvent(),m.parentGridNode&&!m.engine.nodes.length&&m.opts.subGridDynamic&&m.removeAsSubGrid()}if(!d||(h&&(this.engine.cleanupNode(d),d.grid=this),delete d.grid?._isTemp,we.off(a,"drag"),c!==a?(c.remove(),a=c):a.remove(),this._removeDD(a),!h))return!1;const w=d.subGrid?.el?.gridstack;return q.copyPos(d,this._readAttr(this.placeholder)),q.removePositioningStyles(a),g&&(d.content||d.subGridOpts||NA.addRemoveCB)?(delete d.el,a=this.addWidget(d)):(this._prepareElement(a,!0,d),this.el.appendChild(a),this.resizeToContentCheck(!1,d),w&&(w.parentGridNode=d),this._updateContainerHeight()),this.engine.addedNodes.push(d),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...o,type:"dropped"},B&&B.grid?B:void 0,d),!1}),this}static _itemRemoving(A,t){if(!A)return;const n=A?A.gridstackNode:void 0;!n?.grid||A.classList.contains(n.grid.opts.removableOptions.decline)||(t?n._isAboutToRemove=!0:delete n._isAboutToRemove,t?A.classList.add("grid-stack-item-removing"):A.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const A=document.querySelector(this.opts.removable);return A?(!this.opts.staticGrid&&!we.isDroppable(A)&&we.droppable(A,this.opts.removableOptions).on(A,"dropover",(t,n)=>NA._itemRemoving(n,!0)).on(A,"dropout",(t,n)=>NA._itemRemoving(n,!1)),this):this}prepareDragDrop(A,t=!1){const n=A?.gridstackNode;if(!n)return;const o=n.noMove||this.opts.disableDrag,a=n.noResize||this.opts.disableResize,c=this.opts.staticGrid||o&&a;if((t||c)&&(n._initDD&&(this._removeDD(A),delete n._initDD),c&&A.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!n._initDD){let d,h;const g=(m,y)=>{this.triggerEvent(m,m.target),d=this.cellWidth(),h=this.getCellHeight(!0),this._onStartMoving(A,m,y,n,d,h)},B=(m,y)=>{this._dragOrResize(A,m,y,n,d,h)},w=m=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete n._moving,delete n._resizing,delete n._event,delete n._lastTried;const y=n.w!==n._orig.w,v=m.target;if(!(!v.gridstackNode||v.gridstackNode.grid!==this)){if(n.el=v,n._isAboutToRemove){const I=A.gridstackNode.grid;I._gsEventHandler[m.type]&&I._gsEventHandler[m.type](m,v),I.engine.nodes.push(n),I.removeWidget(A,!0,!0)}else q.removePositioningStyles(v),n._temporaryRemoved?(this._writePosAttr(v,n),this.engine.addNode(n)):this._writePosAttr(v,n),this.triggerEvent(m,v);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),m.type==="resizestop"&&(Number.isInteger(n.sizeToContent)&&(n.sizeToContent=n.h),this.resizeToContentCheck(y,n))}};we.draggable(A,{start:g,stop:w,drag:B}).resizable(A,{start:g,stop:w,resize:B}),n._initDD=!0}return we.draggable(A,o?"disable":"enable").resizable(A,a?"disable":"enable"),this}_onStartMoving(A,t,n,o,a,c){if(this.engine.cleanNodes().beginUpdate(o),this._writePosAttr(this.placeholder,o),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=o,o.grid?.el)this.dragTransform=q.getValuesFromTransformedElement(A);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const d=this.placeholder.closest(".grid-stack");this.dragTransform=q.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(o.el=this.placeholder,o._lastUiPosition=n.position,o._prevYPix=n.position.top,o._moving=t.type==="dragstart",o._resizing=t.type==="resizestart",delete o._lastTried,t.type==="dropover"&&o._temporaryRemoved&&(this.engine.addNode(o),o._moving=!0),this.engine.cacheRects(a,c,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){const d=this.getColumn()-o.x,h=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-o.y;we.resizable(A,"option","minWidth",a*Math.min(o.minW||1,d)).resizable(A,"option","minHeight",c*Math.min(o.minH||1,h)).resizable(A,"option","maxWidth",a*Math.min(o.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(A,"option","maxWidthMoveLeft",a*Math.min(o.maxW||Number.MAX_SAFE_INTEGER,o.x+o.w)).resizable(A,"option","maxHeight",c*Math.min(o.maxH||Number.MAX_SAFE_INTEGER,h)).resizable(A,"option","maxHeightMoveUp",c*Math.min(o.maxH||Number.MAX_SAFE_INTEGER,o.y+o.h))}}_dragOrResize(A,t,n,o,a,c){const d={...o._orig};let h,g=this.opts.marginLeft,B=this.opts.marginRight,w=this.opts.marginTop,m=this.opts.marginBottom;const y=Math.round(c*.1),v=Math.round(a*.1);if(g=Math.min(g,v),B=Math.min(B,v),w=Math.min(w,y),m=Math.min(m,y),t.type==="drag"){if(o._temporaryRemoved)return;const L=n.position.top-o._prevYPix;o._prevYPix=n.position.top,this.opts.draggable.scroll!==!1&&q.updateScrollPosition(A,n.position,L);const k=n.position.left+(n.position.left>o._lastUiPosition.left?-B:g),V=n.position.top+(n.position.top>o._lastUiPosition.top?-m:w);d.x=Math.round(k/a),d.y=Math.round(V/c);const F=this._extraDragRow;if(this.engine.collide(o,d)){const M=this.getRow();let tA=Math.max(0,d.y+o.h-M);this.opts.maxRow&&M+tA>this.opts.maxRow&&(tA=Math.max(0,this.opts.maxRow-M)),this._extraDragRow=tA}else this._extraDragRow=0;if(this._extraDragRow!==F&&this._updateContainerHeight(),o.x===d.x&&o.y===d.y)return}else if(t.type==="resize"){if(d.x<0||(q.updateScrollResize(t,A,c),d.w=Math.round((n.size.width-g)/a),d.h=Math.round((n.size.height-w)/c),o.w===d.w&&o.h===d.h)||o._lastTried&&o._lastTried.w===d.w&&o._lastTried.h===d.h)return;const L=n.position.left+g,k=n.position.top+w;d.x=Math.round(L/a),d.y=Math.round(k/c),h=!0}o._event=t,o._lastTried=d;const I={x:n.position.left+g,y:n.position.top+w,w:(n.size?n.size.width:o.w*a)-g-B,h:(n.size?n.size.height:o.h*c)-w-m};if(this.engine.moveNodeCheck(o,{...d,cellWidth:a,cellHeight:c,rect:I,resizing:h})){o._lastUiPosition=n.position,this.engine.cacheRects(a,c,w,B,m,g),delete o._skipDown,h&&o.subGrid&&o.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const L=t.target;o._sidebarOrig||this._writePosAttr(L,o),this.triggerEvent(t,L)}}triggerEvent(A,t){let n=this;for(;n.parentGridNode;)n=n.parentGridNode.grid;n._gsEventHandler[A.type]&&n._gsEventHandler[A.type](A,t)}_leave(A,t){t=t||A;const n=t.gridstackNode;if(!n||(t.style.transform=t.style.transformOrigin=null,we.off(A,"drag"),n._temporaryRemoved))return;n._temporaryRemoved=!0,this.engine.removeNode(n),n.el=n._isExternal&&t?t:A;const o=n._sidebarOrig;n._isExternal&&this.engine.cleanupNode(n),n._sidebarOrig=o,this.opts.removable===!0&&NA._itemRemoving(A,!0),A._gridstackNodeOrig?(A.gridstackNode=A._gridstackNodeOrig,delete A._gridstackNodeOrig):n._isExternal&&this.engine.restoreInitial()}};jt.renderCB=(e,A)=>{e&&A?.content&&(e.textContent=A.content)},jt.resizeToContentParent=".grid-stack-item-content",jt.Utils=q,jt.Engine=pi,jt.GDRev="12.4.2";var Tm={class:"d-layout"},km=["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"],Mm=(0,r.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(e,{expose:A,emit:t}){const n=e,o=t,a=(0,r.ref)();let c=null;const d=async()=>{a.value&&(await(0,r.nextTick)(),c&&c.destroy(!1),c=jt.init({column:n.column,cellHeight:n.cellHeight,disableDrag:!(n.draggable&&!n.disable),disableResize:!(n.resizable&&!n.disable),animate:n.animate,float:n.float,removable:n.removable,removableOptions:n.removableOptions},a.value),c.on("added",(m,y)=>{const v=y[0];v&&(o("added",h(v)),B())}),c.on("removed",(m,y)=>{const v=y[0];v&&(o("removed",h(v)),B())}),c.on("change",()=>{B(),o("changed",(c?.save()||[]).map(m=>h(m)))}),c.on("dragstart",(m,y)=>{y&&o("dragStart",m,h(y.gridstackNode||y))}),c.on("dragstop",(m,y)=>{y&&o("dragStop",m,h(y.gridstackNode||y))}),c.on("resizestart",(m,y)=>{y&&o("resizeStart",m,h(y.gridstackNode||y))}),c.on("resizestop",(m,y)=>{y&&o("resizeStop",m,h(y.gridstackNode||y))}))},h=m=>({id:m.id||m.el?.getAttribute("gs-id")||"",x:m.x||0,y:m.y||0,w:m.w||1,h:m.h||1,locked:m.locked||!1,noResize:m.noResize||!1,noMove:m.noMove||!1,minW:m.minW,minH:m.minH,maxW:m.maxW,maxH:m.maxH}),g=async()=>{if(!c||!a.value)return;await(0,r.nextTick)();const m=c.engine.nodes;new Set(m.map(v=>v.id));const y=new Set(n.modelValue.map(v=>v.id));m.forEach(v=>{if(!y.has(v.id||"")){const I=v.el;I&&c&&c.removeWidget(I,!1)}}),n.modelValue.forEach(v=>{const I=m.find(L=>L.id===v.id);if(I)I.el&&c&&c.update(I.el,{x:v.x,y:v.y,w:v.w,h:v.h,locked:v.locked,noResize:v.noResize,noMove:v.noMove,minW:v.minW,minH:v.minH,maxW:v.maxW,maxH:v.maxH});else{if(!a.value||!c)return;const L=a.value.querySelector(`[gs-id="${v.id}"]`);L&&c.makeWidget(L)}})},B=()=>{c&&o("update:modelValue",c.save().map(m=>{const y={id:m.id||"",x:m.x||0,y:m.y||0,w:m.w||1,h:m.h||1},v=n.modelValue.find(I=>I.id===y.id);return v&&Object.keys(v).forEach(I=>{["id","x","y","w","h"].includes(I)||(y[I]=v[I])}),y}))},w=(0,r.computed)(()=>n.modelValue);return(0,r.watch)(()=>n.modelValue,async()=>{c&&(await(0,r.nextTick)(),g())},{deep:!0}),(0,r.watch)(()=>[n.column,n.cellHeight,n.draggable,n.resizable,n.disable,n.animate,n.float,n.removable],()=>{d()}),(0,r.onMounted)(()=>{d()}),(0,r.onBeforeUnmount)(()=>{c&&(c.destroy(!1),c=null)}),A({addItem:async m=>{if(c&&a.value){await(0,r.nextTick)();const y=a.value.querySelector(`[gs-id="${m.id}"]`);y&&(c.makeWidget(y),c.update(y,{x:m.x,y:m.y,w:m.w,h:m.h,locked:m.locked,noResize:m.noResize,noMove:m.noMove,minW:m.minW,minH:m.minH,maxW:m.maxW,maxH:m.maxH}))}},removeItem:m=>{if(c&&a.value){const y=a.value.querySelector(`[gs-id="${m}"]`);y&&c.removeWidget(y,!1)}},clear:()=>{c&&c.removeAll(!1)},getGrid:()=>c}),(m,y)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",Tm,[(0,r.createElementVNode)("div",{ref_key:"gridContainerRef",ref:a},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(w.value,v=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:v.id,"gs-id":v.id,"gs-x":v.x,"gs-y":v.y,"gs-w":v.w,"gs-h":v.h,"gs-locked":v.locked,"gs-no-resize":v.noResize,"gs-no-move":v.noMove,"gs-min-w":v.minW,"gs-min-h":v.minH,"gs-max-w":v.maxW,"gs-max-h":v.maxH,class:"d-layout-item"},[(0,r.renderSlot)(m.$slots,"item",{item:v})],8,km))),128))],512)]))}}),Om=Mm,ul=ct(Om),WA=(e,A="",t=!1)=>t?`${e}pt`:A?`${e}${A}`:`${e}px`,ye=(e,A=0)=>e==null||isNaN(e)?0:Number(Number(e).toFixed(A)),Km=e=>e*3/4,Rm=e=>e*4/3,Vm=["onMousedown"],Pm={key:2,class:"d-draggable__mask"},Gm=(0,r.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(e,{expose:A,emit:t}){const n=e,o=t,a=(0,r.ref)(),c=(0,r.ref)(),d=(0,r.ref)(0),h=(0,r.ref)(0),g=(0,r.ref)(0),B=(0,r.ref)(0),w=(0,r.ref)(null),m=(0,r.ref)(!1),y=(0,r.ref)(!1),v=(0,r.ref)(!1),I=(0,r.ref)(!1),L=(0,r.ref)([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),k=(0,r.computed)(()=>n.scale),V=(0,r.computed)(()=>({left:WA(k.value,"",n.isPt)})),F=(0,r.computed)(()=>({left:WA(-k.value,"",n.isPt)})),M=(0,r.computed)(()=>({left:"auto",right:WA(-k.value,"",n.isPt)})),tA=(0,r.computed)(()=>({top:WA(-k.value,"",n.isPt)})),W=(0,r.computed)(()=>({top:"auto",bottom:WA(-k.value,"",n.isPt)})),aA=(0,r.computed)(()=>{const eA=8*k.value;return{width:WA(eA,"",n.isPt),height:WA(eA,"",n.isPt)}}),dA=(0,r.computed)(()=>({fontSize:WA(16*k.value,"",n.isPt)})),rA=(0,r.computed)(()=>Object.assign((()=>{if(I.value){const eA={zIndex:9999,...V.value};return n.isActiveBgTransparent&&(I.value||y.value)&&!n.readonly&&!n.disabled&&(eA.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),eA}return{zIndex:n.zIndex}})(),{top:WA(B.value,"",n.isPt),width:WA(d.value,"",n.isPt),height:WA(h.value,"",n.isPt),padding:WA(8*k.value,"",n.isPt),...V.value,left:WA(g.value,"",n.isPt)}));(0,r.watch)(()=>n.width,eA=>{d.value=ye(AA(eA))||(w.value?.offsetWidth??0)}),(0,r.watch)(()=>n.height,eA=>{h.value=ye(AA(eA))||(w.value?.offsetHeight??0)},{deep:!0}),(0,r.watch)(()=>n.left,eA=>{g.value=ye(AA(eA))}),(0,r.watch)(()=>n.top,eA=>{B.value=ye(AA(eA))}),(0,r.watch)(d,eA=>{a.value&&(a.value.style.width=WA(eA,"",n.isPt),n.resize&&w.value?.style&&(w.value.style.width=WA(eA,"",n.isPt)))}),(0,r.watch)(h,eA=>{a.value&&(a.value.style.height=WA(eA,"",n.isPt),n.resize&&w.value?.style&&(w.value.style.height=WA(eA,"",n.isPt)))}),(0,r.watch)(()=>n.activeFlag,eA=>{oA(eA)});const oA=eA=>{I.value=eA},AA=eA=>eA===void 0?0:n.isPt?Rm(eA):eA,O=()=>{c.value&&c.value.firstChild&&(w.value=c.value.firstChild,d.value=ye(AA(n.width))||(w.value?.offsetWidth??0),h.value=ye(AA(n.height))||(w.value?.offsetHeight??0),g.value=ye(AA(n.left)),B.value=ye(AA(n.top)),oA(n.activeFlag))},lA=eA=>{g.value=eA},_=eA=>{B.value=eA},Z=eA=>{const uA=8*k.value/2,Y={};return eA.split("-").forEach(cA=>{Y[cA]=WA(-uA,"",n.isPt)}),Y},U=eA=>{y.value=eA},x=eA=>n.isPt?Km(eA):eA,G=()=>{m.value=!0,o("focus",{index:n.index,width:x(d.value),height:x(h.value),left:x(g.value),top:x(B.value)})},R=()=>{m.value=!1,v.value=!1,o("blur",{index:n.index,width:x(d.value),height:x(h.value),left:x(g.value),top:x(B.value)})},$=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,R()}},J=(eA,uA)=>{if(n.disabled||n.readonly)return;let Y,cA,mA,yA,IA,fA;v.value=!0,G();let vA=eA.clientX,S=eA.clientY;document.onmousemove=H=>{m.value=!0,uA==="right"?(Y=!0,cA=!1):uA==="left"?(Y=!0,mA=!0,IA=!0,cA=!1):uA==="top"?(Y=!1,cA=!0,yA=!0,fA=!0):uA==="bottom"?(Y=!1,cA=!0):uA==="bottom-right"?(Y=!0,cA=!0):uA==="bottom-left"?(Y=!0,cA=!0,mA=!0,IA=!0):uA==="top-right"?(Y=!0,cA=!0,yA=!0,fA=!0):uA==="top-left"&&(Y=!0,cA=!0,mA=!0,IA=!0,yA=!0,fA=!0);const T=H.clientX-vA,D=H.clientY-S;if(vA=H.clientX,S=H.clientY,Y){let b=T*n.step;IA&&(b=-b),mA&&(g.value=ye(g.value-b)),d.value=ye(d.value+b)}if(cA){let b=D*n.step;fA&&(b=-b),yA&&(B.value=ye(B.value-b)),h.value=ye(h.value+b)}},$()},nA=()=>{y.value=!1,o("out",{index:n.index,width:x(d.value),height:x(h.value),left:x(g.value),top:x(B.value)})},BA=()=>{n.disabled||n.readonly||(y.value=!0,o("over",{index:n.index,width:x(d.value),height:x(h.value),left:x(g.value),top:x(B.value)}))},UA=eA=>{if(n.disabled||n.readonly)return;I.value=!0,G();let uA=eA.clientX,Y=eA.clientY;document.onmousemove=cA=>{const mA=cA.clientX-uA,yA=cA.clientY-Y;uA=cA.clientX,Y=cA.clientY,g.value=ye(g.value+mA*n.step),B.value=ye(B.value+yA*n.step)},$()};return(0,r.onMounted)(()=>{O()}),A({setActive:oA,setLeft:lA,setTop:_,setOverActive:U}),(eA,uA)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["d-draggable",{"d-draggable--active":(I.value||y.value)&&!e.readonly&&!e.disabled},{"d-draggable--pt":e.isPt&&!e.readonly&&!e.disabled},{"d-draggable--move":m.value},{"d-draggable--click":e.disabled}]),onMousedown:(0,r.withModifiers)(UA,["stop"]),onMouseover:(0,r.withModifiers)(BA,["stop"]),onMouseout:(0,r.withModifiers)(nA,["stop"]),style:(0,r.normalizeStyle)(rA.value)},[(0,r.createElementVNode)("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:a},[(I.value||y.value||m.value)&&!e.readonly&&!e.disabled?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...tA.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...F.value}),class:"d-draggable__line d-draggable__line--top"},null,4),e.isPt?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...tA.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...F.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...W.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...M.value}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...W.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)({...V.value,...M.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:(0,r.normalizeStyle)(dA.value)},(0,r.toDisplayString)(g.value)+","+(0,r.toDisplayString)(B.value),5))],64)):(0,r.createCommentVNode)("",!0),!e.readonly&&!e.disabled?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(L.value,(Y,cA)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:cA},[I.value?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:(0,r.normalizeClass)(["d-draggable__range",`d-draggable__range--${Y.classname}`]),style:(0,r.normalizeStyle)([aA.value,Z(Y.classname)]),onMousedown:(0,r.withModifiers)(mA=>J(mA,Y.classname),["stop"])},null,46,Vm)):(0,r.createCommentVNode)("",!0)],64))),128)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",{class:"d-draggable__item",ref_key:"item",ref:c},[(0,r.renderSlot)(eA.$slots,"default")],512),!e.disabled&&e.mask?((0,r.openBlock)(),(0,r.createElementBlock)("div",Pm)):(0,r.createCommentVNode)("",!0)],512)],38))}}),zm=Gm,dl=ct(zm),fl=e=>{const A=$m(e.components);return{formConfig:e.form,componentList:A}},gl=(e,A)=>{let t={},n=[];const o={},a=e;t=a.form;const c={};return a.components.forEach(d=>{const h=A[d.type];c[d.containerId]=c[d.containerId]||[];const g={id:d.id,name:d.name,type:d.type,dragType:h?.dragType||"component",componentName:h?.componentName||"",runtimeType:h?.runtimeType,groupId:d.groupId,config:d.config,isInput:h?.isInput!==!1,containerId:d.containerId,level:d.level};h?.dragType==="container"&&(g.children=[]),o[g.id]=g,c[d.containerId].push(g)}),Object.keys(c).forEach(d=>{o[d]&&(o[d].children=c[d])}),n=c.form||[],{formConfig:t,componentList:n,componentDic:o}},Or=(e,A)=>{const t={ver:"j1",form:{...e},components:[],db:{}};return hl(A||[],t.components),t},hl=(e,A)=>{e.forEach(t=>{if(t.type==="pkey")return;const n={id:t.id,name:t.name,type:t.type,runtimeType:t.runtimeType||t.componentName||t.type,groupId:t.groupId||"",config:t.config,containerId:t.containerId,level:t.level};t.dragType==="container"&&hl(t.children||[],A),A.push(n)})},$m=e=>{const A={},t={};return e.forEach(n=>{A[n.containerId]=A[n.containerId]||[];const o={id:n.id,type:n.runtimeType,slot:n.groupId,config:{rule:[]}};n.config&&Object.keys(n.config).forEach(a=>{if(a==="required"){n.config.required&&o.config?.rule?.push({required:!0,message:n.config.requiredMsg||"请输入"});return}if(a==="patterns"){n.config.patterns.forEach(c=>{c.reg&&c.msg&&o.config?.rule?.push({pattern:new RegExp(c.reg),message:`请输入${c.msg||""}`})});return}o.config[a]=n.config[a]}),n.type==="pkey"&&(o.config.isPkey=!0),A[n.containerId].push(o),t[n.id]=o}),Object.keys(A).forEach(n=>{const o=t[n];if(o){const a=A[n];if(["j-tabs","j-collapse"].includes(o.type||"")&&o.config?.groups){const c={};a.forEach(d=>{if(d.slot!==void 0&&d.slot!==null){const h=d.slot.toString();c[h]||(c[h]=[]),delete d.slot,c[h].push(d)}}),o.children=o.config.groups.map(d=>{const h=c[d._i]||[],g={label:d.label};d.active&&o.type==="j-collapse"&&(g.active=d.active);let B;if(o.type==="j-tabs"&&o.config?.tabKey&&o.config?.options.length>0){const m=o.config.options.find(y=>y.label===d._i);m&&(B=({formData:y})=>({display:m.value.includes(y[o.config?.tabKey||""])?m.display:!m.display}))}const w={config:g,children:h};return B&&(w.getCompConfig=B),w}),delete o.config.groups}else o.children=a}}),A.form},Bl=(e,A,t,n,o,a,c,d)=>{const h=(0,r.ref)(),g=(0,r.reactive)({}),B=(0,r.computed)(()=>{const U=[];return Object.keys(g).forEach(x=>{const G=g[x];G.dragType==="component"&&G.type!=="pkey"&&U.push(G)}),U}),w=(U=[],x)=>{const G=A?.value?.init;typeof G=="function"&&G(U,x)},m=U=>o?o(U,{componentDic:g,components:B.value,configData:h.value.config}):{},y=(U,x)=>{if(h.value?.id===U)return;const G=g[U]||x;if(G?h.value=G:U===t.id?h.value=t:h.value=null,h.value){const R=a[h.value.type];R?(w(R,h.value.config),m(h.value.type)):w([])}else w([]);x&&ie("dragClick",{id:x.id})},v=()=>e.value.$el.getBoundingClientRect(),I=U=>U===t.id?t:g[U]||{},L=U=>{const x=[];if(U===t.id)x.push({id:U,name:t.name});else{const G=g[U];if(G){x.push({id:U,name:G.name});const R=L(G.containerId);x.push(...R)}}return x},k=(U,x)=>{const G=g[x];if(G===void 0)return!1;const R=G.containerId;return U===R?!0:R===t.id?!1:k(U,R)},V=U=>n?n(U)||{}:{},F=(U,x,G,R)=>{if(d){const $=I(U);return d(G.componentType,{container:$,groupId:x,configData:G},R)}return!1},M=({name:U,type:x,dragType:G,isInput:R,componentName:$,runtimeType:J},nA,BA,UA,eA=!1)=>{const uA=V(x);if(uA.id=ut(),uA.span=24,uA.componentType=x,tA(nA,uA.componentType))return;F(nA,UA,uA,!0);const Y={id:uA.id,name:U,type:x,runtimeType:J,componentName:$||"",dragType:G||"component",containerId:nA,isInput:!!R,level:g[nA]?g[nA].level+1:1,config:uA,isNewAdd:!eA,groupId:UA};return Y.dragType==="container"&&(Y.children=[]),g[Y.id]=Y,I(nA).children?.splice(BA,0,Y),Y},tA=(U,x)=>!!(I(U).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(x)),W=(U,x,G=!1)=>{let R=null;const $=I(U).children,J=$?.findIndex(nA=>nA.id===x)||0;if(G&&$&&$.length>1){let nA=J+1;J>0&&(nA=J-1),R=$[nA]}return $?.splice(J,1),R?.id},aA=(U,x,G,R)=>{const $=I(x).children,J=U.containerId!==x;U.containerId=x,U.groupId=R,$?.splice(G,0,U),F(x,R,U.config,J)&&(lA(),y(U.id))},dA=U=>{let x="";const G=I(U);return G&&(G.children&&G.children.length>0&&G.children.forEach(R=>{dA(R.id)}),x=W(G.containerId,U,!0)||"",delete g[U]),h.value&&h.value.id===U&&(h.value=null,A.value.init([])),x},rA=(U,x=[])=>{const G=I(U);if(G&&G.children&&G.children.length>0){const R=[];G.children.forEach($=>{$.groupId&&x.includes($.groupId)&&R.push($.id)}),R.forEach($=>{dA($),delete g[$]})}},oA=(U,x)=>{const G=I(U);G&&(G.children&&G.children.length>0&&G.children.forEach(R=>{R.groupId===x&&dA(R.id)}),delete g[U])},AA=U=>{const x=gn(I(U));x.id=ut(),x.config.id=x.id,g[x.id]=x;const G=I(x.containerId).children,R=G?.findIndex($=>$.id===U)||0;G?.splice(R+1,0,x)},O=()=>{t.children=[],Uu(g),h.value&&(ie("dragClick",{id:""}),h.value=null,A.value.init([]))},lA=()=>{h.value&&(ie("dragClick",{id:""}),h.value=null,A.value.init([]))},_=U=>{const x=h.value,G=I(x.containerId).children,R=G?.findIndex($=>$.id===x.id)||0;dA(x.id),(0,r.nextTick)(()=>{const $=c[U],J=V(U);J.id=x.id,J.span=x.config.span,J.componentType=U,J.table=x.config.table,J.field=x.config.field,x.config.isSubTable&&(J.isSubTable=x.config.isSubTable);const nA={id:J.id,name:$.name,type:U,runtimeType:$.runtimeType,componentName:$.componentName||"",dragType:x.dragType,groupId:x.groupId,containerId:x.containerId,isInput:x.isInput,level:x.level,config:J,isNewAdd:!0};g[nA.id]=nA,G?.splice(R,0,nA)})},Z=U=>{ie("dragAddByClick",U)};return(0,r.provide)("d-drag-design-provide",{activedComponent:h,getDesignLocals:v,getComponent:I,getParentComponents:L,isMyChildComponent:k,selectComponent:y,addComponent:M,deleteComponent:dA,copyComponent:AA,removeComponentFromContainer:W,addComponentToContainer:aA,top:t,deleteChildren:oA,deleteChildrens:rA}),{activedComponent:h,clearComponents:O,changeComponent:_,schemaComponentDic:g,clearSelect:lA,addComponent:M,addComponentByTable:Z,designComponentList:B}},Xm=(0,r.defineComponent)({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(e,{expose:A}){const t=e,n=(0,r.computed)(()=>t.tableList.map(g=>({label:g.comment?`${g.name}(${g.comment})`:g.name,value:g.name}))),o=(0,r.ref)(),a=[{id:"layout",type:"j-layout",config:{top:48,topMove:!1,autoSize:["default"]},children:[{id:"table",type:"j-select",slot:"top",config:{label:"表名选择",loadOptions:()=>n,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:t.componentList,width:200}}]}]}],c=(g,B)=>{if(g.id==="table"){const w=t.tableList.find(m=>m.name===B.value);if(w){const m=w.columns.map(y=>({value:y.name,name:y.coment?`${y.name}(${y.coment})`:y.name,type:"input",label:y.coment||y.name,selected:!y.isPrimary}));o.value.setFormData({fields:m})}}};return(0,r.onMounted)(()=>{o.value.init(a)}),A({ok:()=>{const g=o.value.getFormData(!1);return{addList:g.fields.filter(B=>B.selected),table:g.table,containerId:g.containerId,isSubTable:g.isSubTable}},closed:()=>{}}),(g,B)=>{const w=(0,r.resolveComponent)("j-form");return(0,r.openBlock)(),(0,r.createBlock)(w,{ref_key:"formRef",ref:o,"form-config":{labelWidth:"72px"},onChange:c},null,512)}}}),Wm=Xm,Ym=(0,r.defineComponent)({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(e){const{t:A}=(0,Te.useAppInject)();return{labelWidth:(0,r.computed)(()=>e.componentData.config?.notShowLabel?"0px":e.componentData.config?.labelWidth===void 0&&e.globalConfig.labelWidth!==void 0?`${e.globalConfig.labelWidth}px`:e.componentData.config?.labelWidth?`${e.componentData.config?.labelWidth}px`:void 0),inputConfig:(0,r.computed)(()=>{const t={...e.componentData?.config};return e.globalConfig.size===void 0&&(t.size=e.globalConfig.size),t.display=!0,t}),t:A}}}),Jm=(e,A)=>{const t=e.__vccOpts||e;for(const[n,o]of A)t[n]=o;return t};function Zm(e,A,t,n,o,a){const c=(0,r.resolveComponent)("j-comp"),d=(0,r.resolveComponent)("el-form-item");return e.componentData.isInput?((0,r.openBlock)(),(0,r.createBlock)(d,{key:0,"label-width":e.labelWidth,label:e.t(e.componentData.config?.notShowLabel?"":e.componentData.config?.label||""),rules:e.componentData.config?.required?[{required:!0,message:""}]:[]},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{type:e.componentData?.componentName||e.componentData?.type,config:e.inputConfig,modelValue:e.componentData?.config.defaultValue},null,8,["type","config","modelValue"])]),_:1},8,["label-width","label","rules"])):e.componentData?.children?((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(e.componentData?.componentName),(0,r.mergeProps)({key:1},e.componentData?.config,{"global-config":e.globalConfig,"component-data":e.componentData}),null,16,["global-config","component-data"])):((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(e.componentData?.componentName),(0,r.normalizeProps)((0,r.mergeProps)({key:2},e.componentData?.config)),null,16))}var pl=Jm(Ym,[["render",Zm]]),jm={class:"d-form-design j-block"},qm={class:"d-form-design-left"},Aw={class:"d-form-design-component-list"},ew={class:"j-component-tool"},tw={class:"j-component-tool-name"},nw={class:"d-form-design-center"},rw={class:"d-form-design-container"},ow={key:0,class:"d-form-design-empty"},iw={class:"d-form-design-right"},sw={class:"d-form-design-panel-title"},aw={style:{margin:"0","font-size":"14px"}},lw={class:"d-form-design-panel"},cw=(0,r.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(e,{expose:A}){const t=e,{t:n,warning:o,error:a}=(0,Te.useAppInject)(),c=(0,r.reactive)({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),d=(0,r.ref)([]),h=t.components.length;for(let D=0;D<h;D++)d.value.push(D);t.componentInit&&(c.config=t.componentInit("form")||{});const g=(0,r.ref)([]),B=(0,r.computed)(()=>g.value.map(D=>({label:D.comment?`${D.name}(${D.comment})`:D.name,value:D.name}))),w=(0,r.computed)(()=>{if(W.value){const D=tA.value.getFormData(!1);if(D.table){const b=g.value.find(z=>z.name===D.table);if(b)return b.columns.map(z=>({value:z.name,label:z.coment?`${z.name}(${z.coment})`:z.name,coment:z.coment}))}}return[]}),m=D=>{g.value=D},y={},v=[];t.components.forEach(({children:D})=>{D.forEach(b=>{y[b.type]=b,b.dragType=b.dragType||"component",b.isInput!==!1&&(b.isInput=!0,v.push({label:b.name,value:b.type}))})});const I=D=>{D.forEach(b=>{b.type==="d-input-flow"&&(b.config=b.config||{},b.config.flowComponents=t.flowComponents,b.config.flowInit=t.flowInit,b.config.flowComponentConfigInit=z=>{t.flowComponentConfigInit&&(z.designComponents=AA.value,z.component=W.value,t.flowComponentConfigInit(z))},b.config.flowComponentConfigs=t.flowComponentConfigs,b.config.flowComponentConfigChange=t.flowComponentConfigChange),b.children&&I(b.children)})},L={};Object.keys(t.componentConfigs||{}).forEach(D=>{const{hasBase:b,isInput:z,hasTwoPlaceholder:P,hasPlaceholder:hA,hasSpan:iA,hasLabel:SA,bindTable:xA,labelTitle:VA}=y[D]||{hasBase:!1},oe=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:z,options:v}},{id:"label",type:"j-input",config:{label:VA||"标题"},getCompConfig:({formData:PA})=>({display:SA!==!1&&!PA.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(VA||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:PA})=>({display:SA!==!1&&!PA.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:PA})=>({display:z&&!PA.notShowLabel&&!PA.isSubTable})},{id:"placeholder",type:"j-input",config:{display:z&&!P&&hA!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!P,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!P,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:PA})=>({display:iA!==!1&&!PA.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:PA})=>({display:!!PA.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:z&&xA!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>B},getCompConfig:({formData:PA})=>({display:(z&&xA!==!1||xA===!0)&&(!PA.isSubTable||xA===!0)&&!PA.isNotSave&&!t.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>w},getCompConfig:({formData:PA})=>({display:z&&xA!==!1&&!PA.isNotSave&&!t.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:PA})=>({display:z&&xA!==!1&&!PA.isNotSave&&t.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:PA})=>({display:z&&xA!==!1&&!PA.isNotSave&&t.notBindTable&&PA.csType==="string"})}],ZA={type:"j-collapse",config:{defaultValue:[]},children:[]};b!==!1&&(ZA.children?.push({config:{label:"基础信息"},children:[...oe]}),ZA.config?.defaultValue.push("_collapse0")),ZA.children?.push(...t.componentConfigs[D]),I(ZA.children||[]),L[D]=[ZA]});const k=D=>{const{value:b}=D||{};D.id==="componentType"&&dA(b),W.value&&t.componentConfigChange&&(D.id==="field"&&D.data?.coment&&(W.value.config.label=D.data?.coment),t.componentConfigChange(W.value.type,{configRef:tA,configData:W.value.config,...D})),D.id==="table"&&W.value&&W.value.type==="gridtable"&&(W.value.children||[]).forEach(z=>{z.isInput&&(z.config.table=b)})},V=(D,b)=>{y[D]?.isInput&&(t.notBindTable&&(b.configData.csType||tA.value.setFormData({main:{csType:y[D]?.csType,fieldLen:y[D]?.fieldLen}})),B.value.length===1&&tA.value.setFormData({main:{table:B.value[0].value}})),t.componentConfigInit&&t.componentConfigInit(D,{configRef:tA,...b,notBindTable:t.notBindTable})},F=(D,b,z)=>{let P=!1;const hA=y[D];return b.container.type==="gridtable"?(!b.configData.isSubTable||z)&&(b.configData.isSubTable=!0,hA.isInput&&(b.configData.table=b.container.config.table,b.configData.field=""),P=!0):b.configData.isSubTable&&(P=!0,b.configData.isSubTable=!1,hA.isInput&&(b.configData.table="")),t.containerAddComponent&&t.containerAddComponent(D,b),P},M=(0,r.ref)(),tA=(0,r.ref)(),{activedComponent:W,clearComponents:aA,changeComponent:dA,schemaComponentDic:rA,addComponentByTable:oA,designComponentList:AA}=Bl(M,tA,c,t.componentInit,V,L,y,F),O=(0,r.computed)(()=>W.value?`【${W.value.name}】`:"");(0,r.provide)("dui-design-provide",{designItemName:pl});const lA=()=>{aA()},_=()=>{t.componentInit&&(c.config=t.componentInit("form")||{}),aA()},Z=()=>{let D=0;const b=Or(c.config,c.children||[]);if(t.notBindTable){const z={};b.components.forEach(iA=>{const{isInput:SA,bindTable:xA}=y[iA.type]||{hasBase:!1};SA&&xA!==!1?iA.config.table&&!z.main&&(z.main={name:iA.config.table,comment:"主表",type:"main",pKey:"J_Id"}):xA&&(z[iA.id]={name:iA.config.table||"t"+new Date().getTime()+D,comment:`子表${iA.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},iA.config.table=z[iA.id].name,D++)}),z.main||(z.main={name:"t"+new Date().getTime()+D,comment:"主表",type:"main",pKey:"J_Id"},D++);let P=0;b.components.forEach(iA=>{const{isInput:SA,bindTable:xA}=y[iA.type]||{hasBase:!1};!iA.config.isNotSave&&SA&&xA!==!1&&(iA.config.csType||(iA.config.csType=y[iA.type]?.csType,iA.config.fieldLen=y[iA.type]?.fieldLen),iA.config.isSubTable?iA.config.table=z[iA.containerId].name:iA.config.table=z.main.name,iA.config.field=iA.config.field||`f${Math.floor(Date.now()/1e3)}${P}`,P++)});const hA=[];Object.keys(z).forEach(iA=>{z[iA].type==="chlid"&&(z[iA].relationName=z.main.name,z[iA].comment+=`,关联主表${z.main.name}`),hA.push(z[iA])}),b.db=hA}else{const z={};g.value.forEach(P=>{P.columns.forEach(hA=>{z[`${P.name}_${hA.name}`]=hA.csType})}),b.components.forEach(P=>{P.config.table&&P.config.field&&(P.config.csType=z[`${P.config.table}_${P.config.field}`])})}return t.notBindTable?b.db.forEach(z=>{if(!b.components.find(P=>P.config.table===z.name&&P.config.field==="J_Id")){const P=b.components.find(hA=>hA.config.table===z.name&&hA.config.field);P&&b.components.push({id:z.name+"_J_Id",name:z.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:z.name,field:"J_Id",label:"主键"},containerId:P.containerId,level:P.level})}}):g.value.forEach(z=>{z.columns.forEach(P=>{if(P.isPrimary&&!b.components.find(hA=>hA.config.table===z.name&&hA.config.field===P.name)){const hA=b.components.find(iA=>iA.config.table===z.name&&iA.config.field);hA&&b.components.push({id:z.name+"_"+P.name,name:z.name+"_"+P.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:z.name,field:P.name,label:"主键"+P.name,isIdentity:P.isIdentity},containerId:hA.containerId,level:hA.level})}})}),b},U=D=>{const b=gl(D,y);c.config=b.formConfig,c.children?.push(...b.componentList),Object.keys(b.componentDic).forEach(z=>{rA[z]=b.componentDic[z]})},x=()=>R(Or(c.config,c.children||[]).components,{},{}),G=D=>{const{isInput:b,bindTable:z}=y[D]||{hasBase:!1};if(!b&&z)return!0},R=(D,b,z)=>{if(!t.notBindTable)for(const P of D){const{isInput:hA,bindTable:iA}=y[P.type]||{hasBase:!1};if(!P.config.isNotSave&&P.type!=="pkey"){if(hA&&iA!==!1){if((0,Te.isNullOrEmpty)(P.config.table))return a&&a(`请【${P.config.label}】绑定数据表!`),!1;if(!P.config.isSubTable){if(z[P.config.table]&&G(z[P.config.table].type))return a&&a(`【${P.config.label}】和【${z[P.config.table].config.label}】重复绑定【${P.config.table}】表!`),!1;P.config.table&&(z[P.config.table]=P)}}else if(iA){if((0,Te.isNullOrEmpty)(P.config.table))return a&&a(`【${P.config.label}】请绑定数据表!`),!1;if(z[P.config.table])return a&&a(`【${P.config.label}】和【${z[P.config.table].config.label}】重复绑定【${P.config.table}】表!`),!1;P.config.table&&(z[P.config.table]=P)}}}for(const P of D){if(!t.notBindTable){const{isInput:hA,bindTable:iA}=y[P.type]||{hasBase:!1};if(!P.config.isNotSave&&hA&&iA!==!1){if((0,Te.isNullOrEmpty)(P.config.field))return a&&a(`请【${P.config.label}】绑定表字段!`),!1;if(b[`${P.config.table}-${P.config.field}`])return a&&a(`【${P.config.label}】和【${b[`${P.config.table}-${P.config.field}`].config.label}】重复绑定【${P.config.field}】字段!`),!1;b[`${P.config.table}-${P.config.field}`]=P}}if(t.componentConfigValidate&&!t.componentConfigValidate(P.type,{configData:P.config,errorTip:a}))return!1}return!0},$=(0,r.ref)(),J=(0,r.ref)(),nA=(0,r.reactive)({width:0,height:0,formConfig:{}});let BA=0;const UA=D=>{if(J.value)BA=0,J.value.init(D||[]);else{if(BA>600){console.warn("表单组件加载超时");return}BA++,setTimeout(()=>{UA(D)},100)}},eA=()=>{},uA=()=>{},Y=()=>{const D=Or(c.config,c.children||[]);nA.width=D.form.width||800,nA.height=D.form.height||600,$.value.open("表单预览",D.form.layerType),(0,r.nextTick)(()=>{const{formConfig:b,componentList:z}=fl(D);nA.formConfig=b,UA(z)})},cA=(0,r.ref)(),mA=(0,r.ref)(),yA=()=>{const{addList:D,table:b}=mA.value?.ok()||{addList:[]};if(D.length<=0)o&&o("请选择字段!");else{if(W.value?.config.componentType==="gridtable"||W.value?.config.isSubTable)if(W.value.config.table){if(W.value.config.table!==b){o&&o("请设置相同的表和子表!");return}}else{let z=W.value;W.value.config.isSubTable&&(z=rA[W.value.containerId]),z.config.table=b,(z.children||[]).forEach(P=>{P.isInput&&(P.config.table=b)}),tA.value.setFormData({main:{table:b}})}D.forEach(z=>{const P=(0,Te.deepClone)(y[z.type]);P.config={table:b,field:z.value,label:z.label},oA(P)}),cA.value.close()}},IA=()=>{mA.value?.closed()};return A({setTables:D=>{m(D)},getSchema:()=>Z(),setSchema:D=>U(D),reset:()=>_(),validate:()=>x(),preview:Y,clear:lA}),(D,b)=>{const z=(0,r.resolveComponent)("j-icon"),P=(0,r.resolveComponent)("d-drag-tool"),hA=(0,r.resolveComponent)("el-collapse-item"),iA=(0,r.resolveComponent)("el-collapse"),SA=(0,r.resolveComponent)("d-drag-form-list"),xA=(0,r.resolveComponent)("el-row"),VA=(0,r.resolveComponent)("d-drag-container"),oe=(0,r.resolveComponent)("j-form"),ZA=(0,r.resolveComponent)("j-layer");return(0,r.openBlock)(),(0,r.createElementBlock)("div",jm,[(0,r.createElementVNode)("div",qm,[(0,r.createElementVNode)("div",Aw,[(0,r.createVNode)(iA,{modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=PA=>d.value=PA)},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.components,(PA,sA)=>((0,r.openBlock)(),(0,r.createBlock)(hA,{key:sA,title:PA.name,name:sA},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(PA.children,(gA,TA)=>((0,r.openBlock)(),(0,r.createBlock)(P,{key:TA,config:gA},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",ew,[(0,r.createVNode)(z,{class:"j-component-tool-icon",icon:gA.icon,size:14},null,8,["icon"]),(0,r.createElementVNode)("div",tw,(0,r.toDisplayString)((0,r.unref)(n)(gA.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,r.createElementVNode)("div",nw,[(0,r.createElementVNode)("div",rw,[(0,r.createVNode)(VA,{ref_key:"dragContainer",ref:M,class:"d-form-design-drag-container","is-component-container":!1,"component-data":c},{default:(0,r.withCtx)(()=>[!c.children||c.children.length===0?((0,r.openBlock)(),(0,r.createElementBlock)("div",ow,[...b[1]||(b[1]=[(0,r.createElementVNode)("div",null,"请从左侧拖拽组件到此处",-1)])])):((0,r.openBlock)(),(0,r.createBlock)(xA,{key:1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(SA,{"component-list":c.children,"global-config":c.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),(0,r.withDirectives)((0,r.createElementVNode)("div",iw,[(0,r.createElementVNode)("div",sw,[(0,r.createElementVNode)("span",aw,(0,r.toDisplayString)(`${(0,r.unref)(n)("属性配置")}${O.value}`),1)]),(0,r.createElementVNode)("div",lw,[(0,r.createVNode)(oe,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:tA,onChange:k},null,512)])],512),[[r.vShow,(0,r.unref)(W)]]),(0,r.createVNode)(ZA,{ref_key:"previewFormLayerRef",ref:$,width:nA.width,height:nA.height,onOk:eA,onClosed:uA},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(oe,{config:nA.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:J,actions:e.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),(0,r.createVNode)(ZA,{ref_key:"importFormLayerRef",ref:cA,width:800,height:600,"btn-text":"确认",onOk:yA,onClosed:IA},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Wm,{"component-list":v,"table-list":g.value,ref_key:"importComponentRef",ref:mA},null,8,["table-list"])]),_:1},512)])}}}),uw=cw,ml=ct(uw,[pl]),wl=(e,A)=>{const t={ver:"V3",indexPage:{...e},components:[]};return Cl(A||[],t.components),t},Cl=(e,A)=>{e.forEach(t=>{const n={id:t.id,name:t.name,type:t.type,runtimeType:t.runtimeType||t.componentName||t.type,groupId:t.groupId||"",config:t.config,containerId:t.containerId,level:t.level};t.dragType==="container"&&Cl(t.children||[],A),A.push(n)})},dw=e=>{const A=fw(e.components);return{pageConfig:e.indexPage,componentList:A}},fw=e=>{const A={},t={};return e.forEach(n=>{A[n.containerId]=A[n.containerId]||[];const o={id:n.id,type:n.runtimeType,slot:n.groupId,config:{}};n.config&&Object.keys(n.config).forEach(a=>{o.config[a]=n.config[a]}),A[n.containerId].push(o),t[n.id]=o}),Object.keys(A).forEach(n=>{const o=t[n];if(o){const a=A[n];if(["j-tabs","j-collapse"].includes(o.type||"")&&o.config?.groups){const c={};a.forEach(d=>{if(d.slot!==void 0&&d.slot!==null){const h=d.slot.toString();c[h]||(c[h]=[]),delete d.slot,c[h].push(d)}}),o.children=o.config.groups.map(d=>{const h=c[d._i]||[];return{config:{label:d.label},children:h}}),delete o.config.groups}else o.children=a}}),A.indexPage||[]},gw=(e,A)=>{let t={},n=[];const o={};if(e.ver==="V3"){const a=e;t=a.indexPage;const c={};a.components.forEach(d=>{const h=A[d.type];if(!h)return;c[d.containerId]=c[d.containerId]||[];const g={id:d.id,name:d.name,type:d.type,dragType:h.dragType||"component",componentName:h.componentName||"",runtimeType:h.runtimeType,groupId:d.groupId,config:d.config,isInput:!1,containerId:d.containerId,level:d.level};o[g.id]=g,c[d.containerId].push(g),g.dragType==="container"&&(g.children=[])}),Object.keys(c).forEach(d=>{o[d]&&(o[d].children=c[d])}),n=c.indexPage||[]}return{pageConfig:t,componentList:n,componentDic:o}},hw=(0,r.defineComponent)({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(e){return(A,t)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(e.componentData?.componentName),(0,r.mergeProps)(e.componentData?.config,{"global-config":e.globalConfig,"component-data":e.componentData}),null,16,["global-config","component-data"]))}}),yl=hw,Bw={class:"d-index-design j-block"},pw={class:"d-index-design-left"},mw={class:"j-component-list"},ww={class:"j-component-tool"},Cw={class:"j-component-tool-name"},yw={class:"d-index-design-center"},vw={class:"design-toolbar"},Qw={class:"design-container"},Ew={key:0,class:"j-block design-empty"},Fw={class:"d-index-design-right"},Uw={class:"d-index-design-panel-title"},bw={style:{margin:"0","font-size":"14px"}},Iw={class:"d-index-design-panel"},Hw=(0,r.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:()=>({})},actions:{type:Object,default:()=>({})}},setup(e,{expose:A}){const{t}=(0,Te.useAppInject)(),n=e,o=U=>{U.forEach(x=>{x.type==="d-input-flow"&&(x.config=x.config||{},x.config.flowComponents=n.flowComponents,x.config.flowInit=n.flowInit,x.config.flowComponentConfigInit=G=>{n.flowComponentConfigInit&&(G.designComponents=L.value,G.component=y.value,n.flowComponentConfigInit(G))},x.config.flowComponentConfigs=n.flowComponentConfigs,x.config.flowComponentConfigChange=n.flowComponentConfigChange),x.children&&o(x.children)})},a=(0,r.reactive)({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});n.componentInit&&(a.config=n.componentInit("indexPage")||{});const c={},d=[];n.components.forEach(({children:U})=>{U.forEach(x=>{c[x.type]=x,x.dragType=x.dragType||"component",d.push({label:x.name,value:x.type})})});const h={};Object.keys(n.componentConfigs).forEach(U=>{const{hasBase:x}=c[U]||{hasBase:!1},G=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],R={type:"j-collapse",config:{defaultValue:[]},children:[]};x!==!1&&(R.children?.push({config:{label:"基础信息"},children:[...G]}),R.config?.defaultValue.push("_collapse0")),R.children?.push(...n.componentConfigs[U]),o(R.children||[]),h[U]=[R]});const g=U=>{y.value&&n.componentConfigChange&&n.componentConfigChange(y.value.type,{configRef:m,configData:y.value.config,...U})},B=(U,x)=>{n.componentConfigInit&&n.componentConfigInit(U,{configRef:m,...x})},w=(0,r.ref)(),m=(0,r.ref)(),{activedComponent:y,clearComponents:v,schemaComponentDic:I,designComponentList:L}=Bl(w,m,a,n.componentInit,B,h,c,n.containerAddComponent),k=(0,r.computed)(()=>y.value?`【${y.value.name}】`:""),V=(0,r.ref)([]),F=n.components.length;for(let U=0;U<F;U++)V.value.push(U);(0,r.provide)("dui-design-provide",{designItemName:yl});const M=()=>{v()},tA=()=>{n.componentInit&&(a.config=n.componentInit("indexPage")||{}),v()},W=()=>(console.log("pValidate"),!0),aA=()=>wl(a.config,a.children||[]),dA=U=>{const x=gw(U,c);a.config=x.pageConfig,a.children?.push(...x.componentList),Object.keys(x.componentDic).forEach(G=>{I[G]=x.componentDic[G]})},rA=(0,r.ref)(),oA=(0,r.ref)();(0,r.ref)(""),(0,r.reactive)({formConfig:{}});let AA=0;const O=U=>{if(oA.value)AA=0,oA.value.init(U);else{if(AA>600){console.warn("组件加载超时");return}AA++,setTimeout(()=>{O(U)},100)}},lA=()=>{},_=()=>{},Z=()=>{const{componentList:U}=dw(wl(a.config,a.children||[]));rA.value.open("页面预览","full"),(0,r.nextTick)(()=>{O(U)})};return A({reset:tA,validate:W,getSchema:aA,setSchema:dA}),(U,x)=>{const G=(0,r.resolveComponent)("j-icon"),R=(0,r.resolveComponent)("d-drag-tool"),$=(0,r.resolveComponent)("el-collapse-item"),J=(0,r.resolveComponent)("el-collapse"),nA=(0,r.resolveComponent)("j-button"),BA=(0,r.resolveComponent)("el-tooltip"),UA=(0,r.resolveComponent)("el-divider"),eA=(0,r.resolveComponent)("el-empty"),uA=(0,r.resolveComponent)("d-drag-index-list"),Y=(0,r.resolveComponent)("d-drag-container"),cA=(0,r.resolveComponent)("j-form"),mA=(0,r.resolveComponent)("j-page"),yA=(0,r.resolveComponent)("j-layer");return(0,r.openBlock)(),(0,r.createElementBlock)("div",Bw,[(0,r.createElementVNode)("div",pw,[x[1]||(x[1]=(0,r.createElementVNode)("div",{class:"d-index-design-panel-title"},"组件库",-1)),(0,r.createElementVNode)("div",mw,[(0,r.createVNode)(J,{modelValue:V.value,"onUpdate:modelValue":x[0]||(x[0]=IA=>V.value=IA)},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.components,(IA,fA)=>((0,r.openBlock)(),(0,r.createBlock)($,{key:fA,title:IA.name,name:fA},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(IA.children,(vA,S)=>((0,r.openBlock)(),(0,r.createBlock)(R,{key:S,config:vA},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",ww,[(0,r.createVNode)(G,{class:"j-component-tool-icon",icon:vA.icon,size:14},null,8,["icon"]),(0,r.createElementVNode)("div",Cw,(0,r.toDisplayString)((0,r.unref)(t)(vA.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,r.createElementVNode)("div",yw,[(0,r.createElementVNode)("div",vw,[x[2]||(x[2]=(0,r.createElementVNode)("div",null,null,-1)),(0,r.createElementVNode)("div",null,[(0,r.createVNode)(BA,{content:(0,r.unref)(t)("清空")},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(nA,{danger:"",type:"text",onClick:M,icon:"mdi:delete-outline"})]),_:1},8,["content"]),(0,r.createVNode)(UA,{direction:"vertical"}),(0,r.createVNode)(BA,{content:(0,r.unref)(t)("预览")},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(nA,{type:"text",onClick:Z,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),(0,r.createElementVNode)("div",Qw,[(0,r.createVNode)(Y,{ref_key:"dragContainer",ref:w,class:"design-drag-container","is-component-container":!1,"component-data":a},{default:(0,r.withCtx)(()=>[!a.children||a.children.length===0?((0,r.openBlock)(),(0,r.createElementBlock)("div",Ew,[(0,r.createVNode)(eA,{description:(0,r.unref)(t)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):((0,r.openBlock)(),(0,r.createBlock)(uA,{key:1,"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),(0,r.withDirectives)((0,r.createElementVNode)("div",Fw,[(0,r.createElementVNode)("div",Uw,[(0,r.createElementVNode)("span",bw,(0,r.toDisplayString)(`${(0,r.unref)(t)("属性配置")}${k.value}`),1)]),(0,r.createElementVNode)("div",Iw,[(0,r.createVNode)(cA,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:m,onChange:g},null,512)])],512),[[r.vShow,(0,r.unref)(y)&&h[(0,r.unref)(y).type]]]),(0,r.createVNode)(yA,{ref_key:"previewLayerRef",ref:rA,"has-btns":!1,onOk:lA,onClosed:_},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(mA,{ref_key:"previewRef",ref:oA,actions:e.actions},null,8,["actions"])]),_:1},512)])}}}),_w=Hw,vl=ct(_w,[yl]),ee=Eu({Vue:()=>r,Vue2:()=>{},del:()=>Dw,install:()=>Sw,isVue2:()=>!1,isVue3:()=>!0,set:()=>xw});Fu(ee,require("vue"));var yE=!1,vE=!0,QE=void 0;function Sw(){}function xw(e,A,t){return Array.isArray(e)?(e.length=Math.max(e.length,A),e.splice(A,1,t),t):(e[A]=t,t)}function Dw(e,A){if(Array.isArray(e)){e.splice(A,1);return}delete e[A]}var Kr=(e,A)=>{const t=e.__vccOpts||e;for(const[n,o]of A)t[n]=o;return t},Nw=(0,ee.defineComponent)({name:"LineRuler",props:{scale:Number,thick:Number,palette:Object,index:Number,start:Number,vertical:Boolean,value:Number,isShowReferLine:Boolean},emits:["onMouseDown","onRelease","onRemove"],setup(e,{emit:A}){const t=(0,ee.ref)(0),n=(0,ee.ref)(!0);(0,ee.onMounted)(()=>{t.value=e.value});const o=B=>{n.value=B>=0},a=(0,ee.computed)(()=>{const B=(t.value-e.start)*e.scale;o(B);const w=B+"px";return e.vertical?{top:w}:{left:w}}),c=(0,ee.computed)(()=>{var B;const w=`1px solid ${(B=e.palette)==null?void 0:B.lineColor}`,m=e.vertical?{borderTop:w}:{borderLeft:w};return{cursor:e.isShowReferLine?e.vertical?"ns-resize":"ew-resize":"none",...m}}),d=(0,ee.computed)(()=>e.vertical?{left:e.thick+"px"}:{top:e.thick+"px"});return{startValue:t,showLine:n,offset:a,borderCursor:c,actionStyle:d,handleDown:B=>{const w=e.vertical?B.clientY:B.clientX,m=t.value;A("onMouseDown");const y=I=>{const L=e.vertical?I.clientY:I.clientX;t.value=Math.round(m+(L-w)/e.scale)},v=()=>{A("onRelease",t.value,e.index),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",v)},handleRemove:()=>{A("onRemove",e.index)}}}}),Lw={class:"value"};function Tw(e,A,t,n,o,a){return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"line",style:(0,r.normalizeStyle)([e.offset,e.borderCursor]),onMousedown:A[1]||(A[1]=(...c)=>e.handleDown&&e.handleDown(...c))},[(0,r.createElementVNode)("div",{class:"action",style:(0,r.normalizeStyle)(e.actionStyle)},[(0,r.createElementVNode)("span",{class:"del",onClick:A[0]||(A[0]=(...c)=>e.handleRemove&&e.handleRemove(...c))},"×"),(0,r.createElementVNode)("span",Lw,(0,r.toDisplayString)(e.startValue),1)],4)],36)),[[r.vShow,e.showLine]])}var kw=Kr(Nw,[["render",Tw],["__scopeId","data-v-074b3d94"]]),Mw=e=>e<=.25?40:e<=.5?20:e<=1?10:e<=2?5:e<=4?2:1,Ql=.83,Ow=(e,A,t,n,o,a)=>{const{scale:c,width:d,height:h,ratio:g,palette:B}=o,{bgColor:w,fontColor:m,shadowColor:y,longfgColor:v,shortfgColor:I}=B;if(e.scale(g,g),e.clearRect(0,0,d,h),e.fillStyle=w,e.fillRect(0,0,d,h),n){const rA=(t-A)*c,oA=n*c;e.fillStyle=y,a?e.fillRect(rA,0,oA,h*3/8):e.fillRect(0,rA,d*3/8,oA)}const L=Mw(c),k=L*c,V=L*10,F=V*c,M=Math.floor(A/L)*L,tA=Math.floor(A/V)*V,W=(M-A)/L*k,aA=(tA-A)/V*F,dA=A+Math.ceil((a?d:h)/c);e.beginPath(),e.fillStyle=m,e.strokeStyle=v;for(let rA=tA,oA=0;rA<dA;rA+=V,oA++){const AA=aA+oA*F+.5;a?e.moveTo(AA,0):e.moveTo(0,AA),e.save(),a?e.translate(AA,h*.4):e.translate(d*.4,AA),a||e.rotate(-Math.PI/2),e.scale(Ql/g,Ql/g),e.fillText(rA.toString(),4*g,7*g),e.restore(),a?e.lineTo(AA,h*9/16):e.lineTo(d*9/16,AA)}e.stroke(),e.closePath(),e.beginPath(),e.strokeStyle=I;for(let rA=M,oA=0;rA<dA;rA+=L,oA++){const AA=W+oA*k+.5;a?e.moveTo(AA,0):e.moveTo(0,AA),rA%V!==0&&(a?e.lineTo(AA,h*1/4):e.lineTo(d*1/4,AA))}e.stroke(),e.closePath(),e.setTransform(1,0,0,1,0,0)},Kw=(0,ee.defineComponent)({name:"CanvasRuler",props:{showIndicator:Boolean,valueNum:Number,scale:Number,ratio:Number,palette:Object,vertical:Boolean,start:Number,width:Number,height:Number,selectStart:Number,selectLength:Number},emits:["onAddLine","update:showIndicator","update:valueNum"],setup(e,{emit:A}){const t=(0,ee.reactive)({canvasContext:null});let n=1;const o=(0,ee.ref)(null);(0,ee.onMounted)(()=>{n=e.ratio||window.devicePixelRatio||1,a(),c(n),d(n)});const a=()=>{t.canvasContext=o.value&&o.value.getContext("2d")},c=g=>{if(o.value){o.value.width=e.width*g,o.value.height=e.height*g;const B=t.canvasContext;B&&(B.font=`${12*g}px -apple-system,
29
+ "Helvetica Neue", ".SFNSText-Regular",
30
+ "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB",
31
+ "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif`,B.lineWidth=1,B.textBaseline="middle")}},d=g=>{const B={scale:e.scale,width:e.width,height:e.height,palette:e.palette,ratio:g};t.canvasContext&&Ow(t.canvasContext,e.start,e.selectStart,e.selectLength,B,!e.vertical)};return(0,ee.watch)(()=>e.start,()=>d(n)),(0,ee.watch)([()=>e.width,()=>e.height],()=>{c(n),d(n)}),{handle:(g,B)=>{const m=((y,v,I)=>Math.round(v+y/I))(e.vertical?g.offsetY:g.offsetX,e.start,e.scale);switch(B){case"click":A("onAddLine",m);break;case"enter":A("update:valueNum",m),A("update:showIndicator",!0);break;default:A("update:valueNum",m);break}},canvas:o}}});function Rw(e,A,t,n,o,a){return(0,r.openBlock)(),(0,r.createElementBlock)("canvas",{ref:"canvas",class:"ruler",onClick:A[0]||(A[0]=c=>e.handle(c,"click")),onMouseenter:A[1]||(A[1]=c=>e.handle(c,"enter")),onMousemove:A[2]||(A[2]=c=>e.handle(c,"move")),onMouseleave:A[3]||(A[3]=c=>e.$emit("update:showIndicator",!1))},null,544)}var Vw=(0,ee.defineComponent)({name:"RulerWrapper",components:{CanvasRuler:Kr(Kw,[["render",Rw]]),RulerLine:kw},props:{scale:Number,ratio:Number,thick:Number,palette:Object,vertical:{type:Boolean,default:!0},width:{type:Number,default:200},height:{type:Number,default:200},start:{type:Number,default:0},lines:{type:Array,default:()=>[]},selectStart:{type:Number},selectLength:{type:Number},isShowReferLine:{type:Boolean}},setup(e){const A=(0,ee.ref)(!1),t=(0,ee.ref)(0),n=(0,ee.computed)(()=>e.vertical?"v-container":"h-container"),o=(0,ee.computed)(()=>{const g={width:`calc(100% - ${e.thick}px)`,height:`${e.thick+1}px`,left:`${e.thick}px`},B={width:`${e.thick&&e.thick+1}px`,height:`calc(100% - ${e.thick}px)`,top:`${e.thick}px`};return e.vertical?B:g}),a=(0,ee.computed)(()=>{var g;const B=(t.value-e.start)*e.scale;let w="top",m="borderLeft";return w=e.vertical?"top":"left",m=e.vertical?"borderBottom":"borderLeft",{[w]:B+"px",[m]:`1px solid ${(g=e.palette)==null?void 0:g.lineColor}`}}),c=g=>{e.lines.push(g)},d=(g,B)=>{const w=g-e.start,m=(e.vertical?e.height:e.width)/e.scale;w<0||w>m?h(B):e.lines[B]=g},h=g=>{e.lines.splice(g,1)};return{showIndicator:A,valueNum:t,rwClassName:n,rwStyle:o,indicatorStyle:a,handleNewLine:c,handleLineRelease:d,handleLineRemove:h}}}),Pw={class:"lines"},Gw={class:"value"};function zw(e,A,t,n,o,a){const c=(0,r.resolveComponent)("CanvasRuler"),d=(0,r.resolveComponent)("RulerLine");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(e.rwClassName),style:(0,r.normalizeStyle)(e.rwStyle)},[(0,r.createVNode)(c,{vertical:e.vertical,scale:e.scale,width:e.width,height:e.height,start:e.start,ratio:e.ratio,"select-start":e.selectStart,"select-length":e.selectLength,palette:e.palette,valueNum:e.valueNum,"onUpdate:valueNum":A[0]||(A[0]=h=>e.valueNum=h),showIndicator:e.showIndicator,"onUpdate:showIndicator":A[1]||(A[1]=h=>e.showIndicator=h),onOnAddLine:e.handleNewLine},null,8,["vertical","scale","width","height","start","ratio","select-start","select-length","palette","valueNum","showIndicator","onOnAddLine"]),(0,r.withDirectives)((0,r.createElementVNode)("div",Pw,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.lines,(h,g)=>((0,r.openBlock)(),(0,r.createBlock)(d,{key:h+g,index:g,value:h>>0,scale:e.scale,start:e.start,thick:e.thick,palette:e.palette,vertical:e.vertical,"is-show-refer-line":e.isShowReferLine,onOnRemove:e.handleLineRemove,onOnRelease:e.handleLineRelease},null,8,["index","value","scale","start","thick","palette","vertical","is-show-refer-line","onOnRemove","onOnRelease"]))),128))],512),[[r.vShow,e.isShowReferLine]]),(0,r.withDirectives)((0,r.createElementVNode)("div",{class:"indicator",style:(0,r.normalizeStyle)(e.indicatorStyle)},[(0,r.createElementVNode)("div",Gw,(0,r.toDisplayString)(e.valueNum),1)],4),[[r.vShow,e.showIndicator]])],6)}var $w=Kr(Vw,[["render",zw],["__scopeId","data-v-5cc064d4"]]),Xw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAopJREFUOE/FlE9IVEEcx7+/N9ouds1Mu0QUSFZYdIgoUqQoKPBQHsKozpXE7jbTO/U8xLJvn6usBHWQ6hBFXupSkQeVbh0KJEPp0sH+eLGTsKs77xcj78m0ax0E8cHjzZv5zef3/c33xxA24KENYGJzoEEQbNNaN4Zh2OQ4znwYhr9c1/39vwrXVDo0NNS0tLR0GYB5D64BmAMwzMyvlFKz1es10Hw+f4mZ7wHYBeA9gNdENFepVOaEEM3M3OI4Thczn41gt6WUgQ3+C+r7/h0AWQD3mXnYqPA8L9nQ0HCemduIaFpKOWoAhUJhT6VSuQXgOjP3K6W8GLwKzeVyp4jonR0QBEErM48w8zFLyayUsjX+z+VyHhHdZebTSqkxM78CHRgYOKS1/ghgVErZY214RkQ7ADyRUj72ff8qgCtmXUrZGcf5vv8CwEUhxOF0Ov1pBRpla5dSdseBhUJhpznH6tIsZb1KqacW+BGArUaUXX63UuplHJTNZjuEEONSyhozfd/n6mQ1RkXZL2itz7mu+80EDA4ONi8vL/8AcM2UbikyR2BU9cSmmTU70YqKIAj2hWFo2uenlHK/BRg3Y2aeNO5GyU8S0ZbFxcUuz/NKEXAGQKPjOCcymcyX1dIi8DSAiWQyeaavr68cbSgCuBknYubnQoj+TCYzUywWE6VS6S2ADsdx2gxw1X3L7SNENMbMnwE8qK+vf5NKpRaMaeVyeW8ikfiaSqW+R7BuZr5BRMe11p2u607U9Gk8kc/ntzPzQwCmExYATDLzVBiGE0KIowAOADDf3QA+aK2VDaxRajto3K+rq+tl5nYAzQBamHmeiOYBTGmtR6ph/1Rqg9c73pz7dD1qN0TpHyNQRCUDJXrAAAAAAElFTkSuQmCC",Ww="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAjtJREFUOE/NlD9oFEEUxn9v9ghC0hpRUogIAUmniGAT/5Q2FrETPSNRJILg7RwimI0ox85eQFCEBGIUO1PYpFM0jSConQoBEZGgGPsgl+w+2eM2bC57SopAFqYZ3v7m+977ZoQt+GQLmGxPaBiGgYiMWWvXBHZUGoZhH3BERPYC+4F+4Keq/urt7b1RLpf/ZEBVHa9Wq0HWyg3QKIoGVPU8cA7wgK/pUtXPQJ8xZk+pVBpuNBqXUoUiEvi+P56fzTpo6+SbwHNg1lo7WzTITGEKXFlZeeB53tVCpa3CK8AFa+1cBgvD8LKIXAQOJkkyICJDeYVBEJS6u7s/qeoLa+1o+l9TqXNuBLhmjDlbqVQ+5ICjInIfOBPH8W9jzGCR5YmJiRNxHM+papgqzqDvgSlr7VTernPuO3An3c9bBt74vv+yrdaKyLDv+/1Sq9UGPc97nY9EVuycU2AQOA7cAm4Dr4D5TvVxHB9rKo2iaEFVp621Ln96FEUngaOqGmSxabVqsh3a2h+x1h5qQjNrae/yE4+iaCwDJkky73neTuBZe129Xk+H+BS4l7ZqLVIZ2BhzuFKpvMsDVXXWGPMxFdAedOfcKeCRqj7MYrUhpz09PfXl5eXrectFWXXODQHpOq2qd/95o/JXr6ura3J1dXU6SZIfwKKIHAD2tVYMPBGRx77vN10UXtO85fTkmZmZHUtLSzUR2QXsBhaAL6r6DXhbrVYXi1yss59GqOgub/bN3Z7v6X/tb9Zmp/q/kN8s+lJb8oEAAAAASUVORK5CYII=",Yw=(0,ee.defineComponent)({name:"SketchRule",components:{RulerWrapper:$w},props:{eyeIcon:{type:String},closeEyeIcon:{type:String},scale:{type:Number,default:1},ratio:{type:Number},thick:{type:Number,default:16},palette:Object,startX:{type:Number},startY:{type:Number,default:0},width:{type:Number,default:200},height:{type:Number,default:200},shadow:{type:Object,default:()=>({x:0,y:0,width:0,height:0})},lines:{type:Object,default:()=>({h:[],v:[]})},isShowReferLine:{type:Boolean,default:!0}},emits:["onCornerClick","handleLine"],setup(e,{emit:A}){let t=(0,ee.ref)(!0);t.value=e.isShowReferLine;const n=(0,ee.computed)(()=>{function c(d,h){return Object.keys(d).forEach(g=>{g&&d.hasOwnProperty(g)&&(typeof h.key=="object"?d[g]=c(d[g],h[g]):h.hasOwnProperty(g)&&(d[g]=h[g]))}),d}return c({bgColor:"rgba(225,225,225, 0)",longfgColor:"#BABBBC",shortfgColor:"#C8CDD0",fontColor:"#7D8694",shadowColor:"#E8E8E8",lineColor:"#EB5648",borderColor:"#DADADC",cornerActiveColor:"rgb(235, 86, 72, 0.6)",menu:{bgColor:"#fff",dividerColor:"#DBDBDB",listItem:{textColor:"#415058",hoverTextColor:"#298DF8",disabledTextColor:"rgba(65, 80, 88, 0.4)",bgColor:"#fff",hoverBgColor:"#F2F2F2"}}},e.palette||{})}),o=(0,ee.computed)(()=>({backgroundImage:t.value?`url(${e.eyeIcon||Xw})`:`url(${e.closeEyeIcon||Ww})`,width:e.thick+"px",height:e.thick+"px",borderRight:`1px solid ${n.value.borderColor}`,borderBottom:`1px solid ${n.value.borderColor}`})),a=c=>{t.value=!t.value,A("handleCornerClick",t.value)};return(0,ee.watch)([()=>e.isShowReferLine],()=>{t.value=e.isShowReferLine}),{showReferLine:t,paletteCpu:n,cornerStyle:o,onCornerClick:a}}}),Jw={id:"mb-ruler",class:"style-ruler mb-ruler"};function Zw(e,A,t,n,o,a){const c=(0,r.resolveComponent)("RulerWrapper");return(0,r.openBlock)(),(0,r.createElementBlock)("div",Jw,[(0,r.createVNode)(c,{vertical:!1,width:e.width,height:e.thick,"is-show-refer-line":e.showReferLine,thick:e.thick,ratio:e.ratio,start:e.startX,lines:e.lines.h,"select-start":e.shadow.x,"select-length":e.shadow.width,scale:e.scale,palette:e.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),(0,r.createVNode)(c,{vertical:!0,width:e.thick,height:e.height,"is-show-refer-line":e.showReferLine,thick:e.thick,ratio:e.ratio,start:e.startY,lines:e.lines.v,"select-start":e.shadow.y,"select-length":e.shadow.height,scale:e.scale,palette:e.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),(0,r.createElementVNode)("a",{class:"corner",style:(0,r.normalizeStyle)(e.cornerStyle),onClick:A[0]||(A[0]=(...d)=>e.onCornerClick&&e.onCornerClick(...d))},null,4)])}var jw=Kr(Yw,[["render",Zw]]),qw=Qu(((e,A)=>{(function(t,n){typeof e=="object"&&typeof A<"u"?A.exports=n():typeof define=="function"&&define.amd?define(n):(t=typeof globalThis<"u"?globalThis:t||self,t.html2canvas=n())})(e,(function(){"use strict";var t=function(s,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,l){u.__proto__=l}||function(u,l){for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f])},t(s,i)};function n(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}var o=function(){return o=Object.assign||function(i){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(i[p]=u[p])}return i},o.apply(this,arguments)};function a(s,i,u,l){function f(p){return p instanceof u?p:new u(function(C){C(p)})}return new(u||(u=Promise))(function(p,C){function Q(K){try{N(l.next(K))}catch(X){C(X)}}function E(K){try{N(l.throw(K))}catch(X){C(X)}}function N(K){K.done?p(K.value):f(K.value).then(Q,E)}N((l=l.apply(s,i||[])).next())})}function c(s,i){var u={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},l,f,p,C;return C={next:Q(0),throw:Q(1),return:Q(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function Q(N){return function(K){return E([N,K])}}function E(N){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,f&&(p=N[0]&2?f.return:N[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,N[1])).done)return p;switch(f=0,p&&(N=[N[0]&2,p.value]),N[0]){case 0:case 1:p=N;break;case 4:return u.label++,{value:N[1],done:!1};case 5:u.label++,f=N[1],N=[0];continue;case 7:N=u.ops.pop(),u.trys.pop();continue;default:if(p=u.trys,!(p=p.length>0&&p[p.length-1])&&(N[0]===6||N[0]===2)){u=0;continue}if(N[0]===3&&(!p||N[1]>p[0]&&N[1]<p[3])){u.label=N[1];break}if(N[0]===6&&u.label<p[1]){u.label=p[1],p=N;break}if(p&&u.label<p[2]){u.label=p[2],u.ops.push(N);break}p[2]&&u.ops.pop(),u.trys.pop();continue}N=i.call(s,u)}catch(K){N=[6,K],f=0}finally{l=p=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}}function d(s,i,u){if(u||arguments.length===2)for(var l=0,f=i.length,p;l<f;l++)(p||!(l in i))&&(p||(p=Array.prototype.slice.call(i,0,l)),p[l]=i[l]);return s.concat(p||i)}for(var h=(function(){function s(i,u,l,f){this.left=i,this.top=u,this.width=l,this.height=f}return s.prototype.add=function(i,u,l,f){return new s(this.left+i,this.top+u,this.width+l,this.height+f)},s.fromClientRect=function(i,u){return new s(u.left+i.windowBounds.left,u.top+i.windowBounds.top,u.width,u.height)},s.fromDOMRectList=function(i,u){var l=Array.from(u).find(function(f){return f.width!==0});return l?new s(l.left+i.windowBounds.left,l.top+i.windowBounds.top,l.width,l.height):s.EMPTY},s.EMPTY=new s(0,0,0,0),s})(),g=function(s,i){return h.fromClientRect(s,i.getBoundingClientRect())},B=function(s){var i=s.body,u=s.documentElement;if(!i||!u)throw new Error("Unable to get document size");return new h(0,0,Math.max(Math.max(i.scrollWidth,u.scrollWidth),Math.max(i.offsetWidth,u.offsetWidth),Math.max(i.clientWidth,u.clientWidth)),Math.max(Math.max(i.scrollHeight,u.scrollHeight),Math.max(i.offsetHeight,u.offsetHeight),Math.max(i.clientHeight,u.clientHeight)))},w=function(s){for(var i=[],u=0,l=s.length;u<l;){var f=s.charCodeAt(u++);if(f>=55296&&f<=56319&&u<l){var p=s.charCodeAt(u++);(p&64512)===56320?i.push(((f&1023)<<10)+(p&1023)+65536):(i.push(f),u--)}else i.push(f)}return i},m=function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(String.fromCodePoint)return String.fromCodePoint.apply(String,s);var u=s.length;if(!u)return"";for(var l=[],f=-1,p="";++f<u;){var C=s[f];C<=65535?l.push(C):(C-=65536,l.push((C>>10)+55296,C%1024+56320)),(f+1===u||l.length>16384)&&(p+=String.fromCharCode.apply(String,l),l.length=0)}return p},y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=typeof Uint8Array>"u"?[]:new Uint8Array(256),I=0;I<y.length;I++)v[y.charCodeAt(I)]=I;for(var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=typeof Uint8Array>"u"?[]:new Uint8Array(256),V=0;V<L.length;V++)k[L.charCodeAt(V)]=V;for(var F=function(s){var i=s.length*.75,u=s.length,l,f=0,p,C,Q,E;s[s.length-1]==="="&&(i--,s[s.length-2]==="="&&i--);var N=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(i):new Array(i),K=Array.isArray(N)?N:new Uint8Array(N);for(l=0;l<u;l+=4)p=k[s.charCodeAt(l)],C=k[s.charCodeAt(l+1)],Q=k[s.charCodeAt(l+2)],E=k[s.charCodeAt(l+3)],K[f++]=p<<2|C>>4,K[f++]=(C&15)<<4|Q>>2,K[f++]=(Q&3)<<6|E&63;return N},M=function(s){for(var i=s.length,u=[],l=0;l<i;l+=2)u.push(s[l+1]<<8|s[l]);return u},tA=function(s){for(var i=s.length,u=[],l=0;l<i;l+=4)u.push(s[l+3]<<24|s[l+2]<<16|s[l+1]<<8|s[l]);return u},W=5,aA=11,dA=2,rA=aA-W,oA=65536>>W,AA=(1<<W)-1,O=oA+(1024>>W)+32,lA=65536>>aA,_=(1<<rA)-1,Z=function(s,i,u){return s.slice?s.slice(i,u):new Uint16Array(Array.prototype.slice.call(s,i,u))},U=function(s,i,u){return s.slice?s.slice(i,u):new Uint32Array(Array.prototype.slice.call(s,i,u))},x=function(s,i){var u=F(s),l=Array.isArray(u)?tA(u):new Uint32Array(u),f=Array.isArray(u)?M(u):new Uint16Array(u),p=24,C=Z(f,p/2,l[4]/2),Q=l[5]===2?Z(f,(p+l[4])/2):U(l,Math.ceil((p+l[4])/4));return new G(l[0],l[1],l[2],l[3],C,Q)},G=(function(){function s(i,u,l,f,p,C){this.initialValue=i,this.errorValue=u,this.highStart=l,this.highValueIndex=f,this.index=p,this.data=C}return s.prototype.get=function(i){var u;if(i>=0){if(i<55296||i>56319&&i<=65535)return u=this.index[i>>W],u=(u<<dA)+(i&AA),this.data[u];if(i<=65535)return u=this.index[oA+(i-55296>>W)],u=(u<<dA)+(i&AA),this.data[u];if(i<this.highStart)return u=O-lA+(i>>aA),u=this.index[u],u+=i>>W&_,u=this.index[u],u=(u<<dA)+(i&AA),this.data[u];if(i<=1114111)return this.data[this.highValueIndex]}return this.errorValue},s})(),R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=typeof Uint8Array>"u"?[]:new Uint8Array(256),J=0;J<R.length;J++)$[R.charCodeAt(J)]=J;var nA="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",BA=50,UA=1,eA=2,uA=3,Y=4,cA=5,mA=7,yA=8,IA=9,fA=10,vA=11,S=12,H=13,T=14,D=15,b=16,z=17,P=18,hA=19,iA=20,SA=21,xA=22,VA=23,oe=24,ZA=25,PA=26,sA=27,gA=28,TA=29,kA=30,Nt=31,qt=32,Bt=33,Ln=34,Tn=35,$A=36,He=37,Xe=38,Rr=39,Vr=40,wi=41,bl=42,H0=43,_0=[9001,65288],Il="!",RA="×",Pr="÷",Ci=x(nA),ot=[kA,$A],yi=[UA,eA,uA,cA],Hl=[fA,yA],_l=[sA,PA],S0=yi.concat(Hl),Sl=[Xe,Rr,Vr,Ln,Tn],x0=[D,H],D0=function(s,i){i===void 0&&(i="strict");var u=[],l=[],f=[];return s.forEach(function(p,C){var Q=Ci.get(p);if(Q>BA?(f.push(!0),Q-=BA):f.push(!1),["normal","auto","loose"].indexOf(i)!==-1&&[8208,8211,12316,12448].indexOf(p)!==-1)return l.push(C),u.push(b);if(Q===Y||Q===vA){if(C===0)return l.push(C),u.push(kA);var E=u[C-1];return S0.indexOf(E)===-1?(l.push(l[C-1]),u.push(E)):(l.push(C),u.push(kA))}if(l.push(C),Q===Nt)return u.push(i==="strict"?SA:He);if(Q===bl||Q===TA)return u.push(kA);if(Q===H0)return p>=131072&&p<=196605||p>=196608&&p<=262141?u.push(He):u.push(kA);u.push(Q)}),[l,u,f]},vi=function(s,i,u,l){var f=l[u];if(Array.isArray(s)?s.indexOf(f)!==-1:s===f)for(var p=u;p<=l.length;){p++;var C=l[p];if(C===i)return!0;if(C!==fA)break}if(f===fA)for(var p=u;p>0;){p--;var Q=l[p];if(Array.isArray(s)?s.indexOf(Q)!==-1:s===Q)for(var E=u;E<=l.length;){E++;var C=l[E];if(C===i)return!0;if(C!==fA)break}if(Q!==fA)break}return!1},xl=function(s,i){for(var u=s;u>=0;){var l=i[u];if(l===fA)u--;else return l}return 0},N0=function(s,i,u,l,f){if(u[l]===0)return RA;var p=l-1;if(Array.isArray(f)&&f[p]===!0)return RA;var C=p-1,Q=p+1,E=i[p],N=C>=0?i[C]:0,K=i[Q];if(E===eA&&K===uA)return RA;if(yi.indexOf(E)!==-1)return Il;if(yi.indexOf(K)!==-1||Hl.indexOf(K)!==-1)return RA;if(xl(p,i)===yA)return Pr;if(Ci.get(s[p])===vA||(E===qt||E===Bt)&&Ci.get(s[Q])===vA||E===mA||K===mA||E===IA||[fA,H,D].indexOf(E)===-1&&K===IA||[z,P,hA,oe,gA].indexOf(K)!==-1||xl(p,i)===xA||vi(VA,xA,p,i)||vi([z,P],SA,p,i)||vi(S,S,p,i))return RA;if(E===fA)return Pr;if(E===VA||K===VA)return RA;if(K===b||E===b)return Pr;if([H,D,SA].indexOf(K)!==-1||E===T||N===$A&&x0.indexOf(E)!==-1||E===gA&&K===$A||K===iA||ot.indexOf(K)!==-1&&E===ZA||ot.indexOf(E)!==-1&&K===ZA||E===sA&&[He,qt,Bt].indexOf(K)!==-1||[He,qt,Bt].indexOf(E)!==-1&&K===PA||ot.indexOf(E)!==-1&&_l.indexOf(K)!==-1||_l.indexOf(E)!==-1&&ot.indexOf(K)!==-1||[sA,PA].indexOf(E)!==-1&&(K===ZA||[xA,D].indexOf(K)!==-1&&i[Q+1]===ZA)||[xA,D].indexOf(E)!==-1&&K===ZA||E===ZA&&[ZA,gA,oe].indexOf(K)!==-1)return RA;if([ZA,gA,oe,z,P].indexOf(K)!==-1)for(var X=p;X>=0;){var j=i[X];if(j===ZA)return RA;if([gA,oe].indexOf(j)!==-1)X--;else break}if([sA,PA].indexOf(K)!==-1)for(var X=[z,P].indexOf(E)!==-1?C:p;X>=0;){var j=i[X];if(j===ZA)return RA;if([gA,oe].indexOf(j)!==-1)X--;else break}if(Xe===E&&[Xe,Rr,Ln,Tn].indexOf(K)!==-1||[Rr,Ln].indexOf(E)!==-1&&[Rr,Vr].indexOf(K)!==-1||[Vr,Tn].indexOf(E)!==-1&&K===Vr||Sl.indexOf(E)!==-1&&[iA,PA].indexOf(K)!==-1||Sl.indexOf(K)!==-1&&E===sA||ot.indexOf(E)!==-1&&ot.indexOf(K)!==-1||E===oe&&ot.indexOf(K)!==-1||ot.concat(ZA).indexOf(E)!==-1&&K===xA&&_0.indexOf(s[Q])===-1||ot.concat(ZA).indexOf(K)!==-1&&E===P)return RA;if(E===wi&&K===wi){for(var CA=u[p],pA=1;CA>0&&(CA--,i[CA]===wi);)pA++;if(pA%2!==0)return RA}return E===qt&&K===Bt?RA:Pr},L0=function(s,i){i||(i={lineBreak:"normal",wordBreak:"normal"});var u=D0(s,i.lineBreak),l=u[0],f=u[1],p=u[2];(i.wordBreak==="break-all"||i.wordBreak==="break-word")&&(f=f.map(function(Q){return[ZA,kA,bl].indexOf(Q)!==-1?He:Q}));var C=i.wordBreak==="keep-all"?p.map(function(Q,E){return Q&&s[E]>=19968&&s[E]<=40959}):void 0;return[l,f,C]},T0=(function(){function s(i,u,l,f){this.codePoints=i,this.required=u===Il,this.start=l,this.end=f}return s.prototype.slice=function(){return m.apply(void 0,this.codePoints.slice(this.start,this.end))},s})(),k0=function(s,i){var u=w(s),l=L0(u,i),f=l[0],p=l[1],C=l[2],Q=u.length,E=0,N=0;return{next:function(){if(N>=Q)return{done:!0,value:null};for(var K=RA;N<Q&&(K=N0(u,p,f,++N,C))===RA;);if(K!==RA||N===Q){var X=new T0(u,K,E,N);return E=N,{value:X,done:!1}}return{done:!0,value:null}}}},M0=1,O0=2,kn=4,Dl=8,Gr=10,Nl=47,Mn=92,K0=9,R0=32,zr=34,On=61,V0=35,P0=36,G0=37,$r=39,Xr=40,Kn=41,z0=95,ve=45,$0=33,X0=60,W0=62,Y0=64,J0=91,Z0=93,j0=61,q0=123,Wr=63,AC=125,Ll=124,eC=126,tC=128,Tl=65533,Qi=42,Lt=43,nC=44,rC=58,oC=59,Rn=46,iC=0,sC=8,aC=11,lC=14,cC=31,uC=127,We=-1,kl=48,Ml=97,Ol=101,dC=102,fC=117,gC=122,Kl=65,Rl=69,Vl=70,hC=85,BC=90,me=function(s){return s>=kl&&s<=57},pC=function(s){return s>=55296&&s<=57343},An=function(s){return me(s)||s>=Kl&&s<=Vl||s>=Ml&&s<=dC},mC=function(s){return s>=Ml&&s<=gC},wC=function(s){return s>=Kl&&s<=BC},CC=function(s){return mC(s)||wC(s)},yC=function(s){return s>=tC},Yr=function(s){return s===Gr||s===K0||s===R0},Jr=function(s){return CC(s)||yC(s)||s===z0},Pl=function(s){return Jr(s)||me(s)||s===ve},vC=function(s){return s>=iC&&s<=sC||s===aC||s>=lC&&s<=cC||s===uC},pt=function(s,i){return s!==Mn?!1:i!==Gr},Zr=function(s,i,u){return s===ve?Jr(i)||pt(i,u):Jr(s)?!0:!!(s===Mn&&pt(s,i))},Ei=function(s,i,u){return s===Lt||s===ve?me(i)?!0:i===Rn&&me(u):me(s===Rn?i:s)},QC=function(s){var i=0,u=1;(s[i]===Lt||s[i]===ve)&&(s[i]===ve&&(u=-1),i++);for(var l=[];me(s[i]);)l.push(s[i++]);var f=l.length?parseInt(m.apply(void 0,l),10):0;s[i]===Rn&&i++;for(var p=[];me(s[i]);)p.push(s[i++]);var C=p.length,Q=C?parseInt(m.apply(void 0,p),10):0;(s[i]===Rl||s[i]===Ol)&&i++;var E=1;(s[i]===Lt||s[i]===ve)&&(s[i]===ve&&(E=-1),i++);for(var N=[];me(s[i]);)N.push(s[i++]);var K=N.length?parseInt(m.apply(void 0,N),10):0;return u*(f+Q*Math.pow(10,-C))*Math.pow(10,E*K)},EC={type:2},FC={type:3},UC={type:4},bC={type:13},IC={type:8},HC={type:21},_C={type:9},SC={type:10},xC={type:11},DC={type:12},NC={type:14},jr={type:23},LC={type:1},TC={type:25},kC={type:24},MC={type:26},OC={type:27},KC={type:28},RC={type:29},VC={type:31},Fi={type:32},Gl=(function(){function s(){this._value=[]}return s.prototype.write=function(i){this._value=this._value.concat(w(i))},s.prototype.read=function(){for(var i=[],u=this.consumeToken();u!==Fi;)i.push(u),u=this.consumeToken();return i},s.prototype.consumeToken=function(){var i=this.consumeCodePoint();switch(i){case zr:return this.consumeStringToken(zr);case V0:var u=this.peekCodePoint(0),l=this.peekCodePoint(1),f=this.peekCodePoint(2);if(Pl(u)||pt(l,f)){var p=Zr(u,l,f)?O0:M0,C=this.consumeName();return{type:5,value:C,flags:p}}break;case P0:if(this.peekCodePoint(0)===On)return this.consumeCodePoint(),bC;break;case $r:return this.consumeStringToken($r);case Xr:return EC;case Kn:return FC;case Qi:if(this.peekCodePoint(0)===On)return this.consumeCodePoint(),NC;break;case Lt:if(Ei(i,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(i),this.consumeNumericToken();break;case nC:return UC;case ve:var Q=i,E=this.peekCodePoint(0),N=this.peekCodePoint(1);if(Ei(Q,E,N))return this.reconsumeCodePoint(i),this.consumeNumericToken();if(Zr(Q,E,N))return this.reconsumeCodePoint(i),this.consumeIdentLikeToken();if(E===ve&&N===W0)return this.consumeCodePoint(),this.consumeCodePoint(),kC;break;case Rn:if(Ei(i,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(i),this.consumeNumericToken();break;case Nl:if(this.peekCodePoint(0)===Qi)for(this.consumeCodePoint();;){var K=this.consumeCodePoint();if(K===Qi&&(K=this.consumeCodePoint(),K===Nl))return this.consumeToken();if(K===We)return this.consumeToken()}break;case rC:return MC;case oC:return OC;case X0:if(this.peekCodePoint(0)===$0&&this.peekCodePoint(1)===ve&&this.peekCodePoint(2)===ve)return this.consumeCodePoint(),this.consumeCodePoint(),TC;break;case Y0:if(Zr(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2))){var C=this.consumeName();return{type:7,value:C}}break;case J0:return KC;case Mn:if(pt(i,this.peekCodePoint(0)))return this.reconsumeCodePoint(i),this.consumeIdentLikeToken();break;case Z0:return RC;case j0:if(this.peekCodePoint(0)===On)return this.consumeCodePoint(),IC;break;case q0:return xC;case AC:return DC;case fC:case hC:var X=this.peekCodePoint(0),j=this.peekCodePoint(1);return X===Lt&&(An(j)||j===Wr)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(i),this.consumeIdentLikeToken();case Ll:if(this.peekCodePoint(0)===On)return this.consumeCodePoint(),_C;if(this.peekCodePoint(0)===Ll)return this.consumeCodePoint(),HC;break;case eC:if(this.peekCodePoint(0)===On)return this.consumeCodePoint(),SC;break;case We:return Fi}return Yr(i)?(this.consumeWhiteSpace(),VC):me(i)?(this.reconsumeCodePoint(i),this.consumeNumericToken()):Jr(i)?(this.reconsumeCodePoint(i),this.consumeIdentLikeToken()):{type:6,value:m(i)}},s.prototype.consumeCodePoint=function(){var i=this._value.shift();return typeof i>"u"?-1:i},s.prototype.reconsumeCodePoint=function(i){this._value.unshift(i)},s.prototype.peekCodePoint=function(i){return i>=this._value.length?-1:this._value[i]},s.prototype.consumeUnicodeRangeToken=function(){for(var i=[],u=this.consumeCodePoint();An(u)&&i.length<6;)i.push(u),u=this.consumeCodePoint();for(var l=!1;u===Wr&&i.length<6;)i.push(u),u=this.consumeCodePoint(),l=!0;if(l){var f=parseInt(m.apply(void 0,i.map(function(E){return E===Wr?kl:E})),16),p=parseInt(m.apply(void 0,i.map(function(E){return E===Wr?Vl:E})),16);return{type:30,start:f,end:p}}var C=parseInt(m.apply(void 0,i),16);if(this.peekCodePoint(0)===ve&&An(this.peekCodePoint(1))){this.consumeCodePoint(),u=this.consumeCodePoint();for(var Q=[];An(u)&&Q.length<6;)Q.push(u),u=this.consumeCodePoint();var p=parseInt(m.apply(void 0,Q),16);return{type:30,start:C,end:p}}else return{type:30,start:C,end:C}},s.prototype.consumeIdentLikeToken=function(){var i=this.consumeName();return i.toLowerCase()==="url"&&this.peekCodePoint(0)===Xr?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Xr?(this.consumeCodePoint(),{type:19,value:i}):{type:20,value:i}},s.prototype.consumeUrlToken=function(){var i=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===We)return{type:22,value:""};var u=this.peekCodePoint(0);if(u===$r||u===zr){var l=this.consumeStringToken(this.consumeCodePoint());return l.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===We||this.peekCodePoint(0)===Kn)?(this.consumeCodePoint(),{type:22,value:l.value}):(this.consumeBadUrlRemnants(),jr)}for(;;){var f=this.consumeCodePoint();if(f===We||f===Kn)return{type:22,value:m.apply(void 0,i)};if(Yr(f))return this.consumeWhiteSpace(),this.peekCodePoint(0)===We||this.peekCodePoint(0)===Kn?(this.consumeCodePoint(),{type:22,value:m.apply(void 0,i)}):(this.consumeBadUrlRemnants(),jr);if(f===zr||f===$r||f===Xr||vC(f))return this.consumeBadUrlRemnants(),jr;if(f===Mn)if(pt(f,this.peekCodePoint(0)))i.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),jr;else i.push(f)}},s.prototype.consumeWhiteSpace=function(){for(;Yr(this.peekCodePoint(0));)this.consumeCodePoint()},s.prototype.consumeBadUrlRemnants=function(){for(;;){var i=this.consumeCodePoint();if(i===Kn||i===We)return;pt(i,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},s.prototype.consumeStringSlice=function(i){for(var u=5e4,l="";i>0;){var f=Math.min(u,i);l+=m.apply(void 0,this._value.splice(0,f)),i-=f}return this._value.shift(),l},s.prototype.consumeStringToken=function(i){var u="",l=0;do{var f=this._value[l];if(f===We||f===void 0||f===i)return u+=this.consumeStringSlice(l),{type:0,value:u};if(f===Gr)return this._value.splice(0,l),LC;if(f===Mn){var p=this._value[l+1];p!==We&&p!==void 0&&(p===Gr?(u+=this.consumeStringSlice(l),l=-1,this._value.shift()):pt(f,p)&&(u+=this.consumeStringSlice(l),u+=m(this.consumeEscapedCodePoint()),l=-1))}l++}while(!0)},s.prototype.consumeNumber=function(){var i=[],u=kn,l=this.peekCodePoint(0);for((l===Lt||l===ve)&&i.push(this.consumeCodePoint());me(this.peekCodePoint(0));)i.push(this.consumeCodePoint());l=this.peekCodePoint(0);var f=this.peekCodePoint(1);if(l===Rn&&me(f))for(i.push(this.consumeCodePoint(),this.consumeCodePoint()),u=Dl;me(this.peekCodePoint(0));)i.push(this.consumeCodePoint());l=this.peekCodePoint(0),f=this.peekCodePoint(1);var p=this.peekCodePoint(2);if((l===Rl||l===Ol)&&((f===Lt||f===ve)&&me(p)||me(f)))for(i.push(this.consumeCodePoint(),this.consumeCodePoint()),u=Dl;me(this.peekCodePoint(0));)i.push(this.consumeCodePoint());return[QC(i),u]},s.prototype.consumeNumericToken=function(){var i=this.consumeNumber(),u=i[0],l=i[1],f=this.peekCodePoint(0);return Zr(f,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:u,flags:l,unit:this.consumeName()}:f===G0?(this.consumeCodePoint(),{type:16,number:u,flags:l}):{type:17,number:u,flags:l}},s.prototype.consumeEscapedCodePoint=function(){var i=this.consumeCodePoint();if(An(i)){for(var u=m(i);An(this.peekCodePoint(0))&&u.length<6;)u+=m(this.consumeCodePoint());Yr(this.peekCodePoint(0))&&this.consumeCodePoint();var l=parseInt(u,16);return l===0||pC(l)||l>1114111?Tl:l}return i===We?Tl:i},s.prototype.consumeName=function(){for(var i="";;){var u=this.consumeCodePoint();if(Pl(u))i+=m(u);else if(pt(u,this.peekCodePoint(0)))i+=m(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(u),i}},s})(),zl=(function(){function s(i){this._tokens=i}return s.create=function(i){var u=new Gl;return u.write(i),new s(u.read())},s.parseValue=function(i){return s.create(i).parseComponentValue()},s.parseValues=function(i){return s.create(i).parseComponentValues()},s.prototype.parseComponentValue=function(){for(var i=this.consumeToken();i.type===31;)i=this.consumeToken();if(i.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(i);var u=this.consumeComponentValue();do i=this.consumeToken();while(i.type===31);if(i.type===32)return u;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},s.prototype.parseComponentValues=function(){for(var i=[];;){var u=this.consumeComponentValue();if(u.type===32)return i;i.push(u),i.push()}},s.prototype.consumeComponentValue=function(){var i=this.consumeToken();switch(i.type){case 11:case 28:case 2:return this.consumeSimpleBlock(i.type);case 19:return this.consumeFunction(i)}return i},s.prototype.consumeSimpleBlock=function(i){for(var u={type:i,values:[]},l=this.consumeToken();;){if(l.type===32||GC(l,i))return u;this.reconsumeToken(l),u.values.push(this.consumeComponentValue()),l=this.consumeToken()}},s.prototype.consumeFunction=function(i){for(var u={name:i.value,values:[],type:18};;){var l=this.consumeToken();if(l.type===32||l.type===3)return u;this.reconsumeToken(l),u.values.push(this.consumeComponentValue())}},s.prototype.consumeToken=function(){var i=this._tokens.shift();return typeof i>"u"?Fi:i},s.prototype.reconsumeToken=function(i){this._tokens.unshift(i)},s})(),Vn=function(s){return s.type===15},en=function(s){return s.type===17},jA=function(s){return s.type===20},PC=function(s){return s.type===0},Ui=function(s,i){return jA(s)&&s.value===i},$l=function(s){return s.type!==31},tn=function(s){return s.type!==31&&s.type!==4},Ye=function(s){var i=[],u=[];return s.forEach(function(l){if(l.type===4){if(u.length===0)throw new Error("Error parsing function args, zero tokens for arg");i.push(u),u=[];return}l.type!==31&&u.push(l)}),u.length&&i.push(u),i},GC=function(s,i){return i===11&&s.type===12||i===28&&s.type===29?!0:i===2&&s.type===3},mt=function(s){return s.type===17||s.type===15},ce=function(s){return s.type===16||mt(s)},Xl=function(s){return s.length>1?[s[0],s[1]]:[s[0]]},he={type:17,number:0,flags:kn},bi={type:16,number:50,flags:kn},wt={type:16,number:100,flags:kn},Pn=function(s,i,u){var l=s[0],f=s[1];return[Ae(l,i),Ae(typeof f<"u"?f:l,u)]},Ae=function(s,i){if(s.type===16)return s.number/100*i;if(Vn(s))switch(s.unit){case"rem":case"em":return 16*s.number;default:return s.number}return s.number},Wl="deg",Yl="grad",Jl="rad",Zl="turn",qr={name:"angle",parse:function(s,i){if(i.type===15)switch(i.unit){case Wl:return Math.PI*i.number/180;case Yl:return Math.PI/200*i.number;case Jl:return i.number;case Zl:return Math.PI*2*i.number}throw new Error("Unsupported angle type")}},jl=function(s){return s.type===15&&(s.unit===Wl||s.unit===Yl||s.unit===Jl||s.unit===Zl)},ql=function(s){switch(s.filter(jA).map(function(i){return i.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[he,he];case"to top":case"bottom":return Se(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[he,wt];case"to right":case"left":return Se(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[wt,wt];case"to bottom":case"top":return Se(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[wt,he];case"to left":case"right":return Se(270)}return 0},Se=function(s){return Math.PI*s/180},Ct={name:"color",parse:function(s,i){if(i.type===18){var u=zC[i.name];if(typeof u>"u")throw new Error('Attempting to parse an unsupported color function "'+i.name+'"');return u(s,i.values)}if(i.type===5){if(i.value.length===3){var l=i.value.substring(0,1),f=i.value.substring(1,2),p=i.value.substring(2,3);return vt(parseInt(l+l,16),parseInt(f+f,16),parseInt(p+p,16),1)}if(i.value.length===4){var l=i.value.substring(0,1),f=i.value.substring(1,2),p=i.value.substring(2,3),C=i.value.substring(3,4);return vt(parseInt(l+l,16),parseInt(f+f,16),parseInt(p+p,16),parseInt(C+C,16)/255)}if(i.value.length===6){var l=i.value.substring(0,2),f=i.value.substring(2,4),p=i.value.substring(4,6);return vt(parseInt(l,16),parseInt(f,16),parseInt(p,16),1)}if(i.value.length===8){var l=i.value.substring(0,2),f=i.value.substring(2,4),p=i.value.substring(4,6),C=i.value.substring(6,8);return vt(parseInt(l,16),parseInt(f,16),parseInt(p,16),parseInt(C,16)/255)}}if(i.type===20){var Q=it[i.value.toUpperCase()];if(typeof Q<"u")return Q}return it.TRANSPARENT}},yt=function(s){return(255&s)===0},ge=function(s){var i=255&s,u=255&s>>8,l=255&s>>16,f=255&s>>24;return i<255?"rgba("+f+","+l+","+u+","+i/255+")":"rgb("+f+","+l+","+u+")"},vt=function(s,i,u,l){return(s<<24|i<<16|u<<8|Math.round(l*255)<<0)>>>0},Ac=function(s,i){if(s.type===17)return s.number;if(s.type===16){var u=i===3?1:255;return i===3?s.number/100*u:Math.round(s.number/100*u)}return 0},ec=function(s,i){var u=i.filter(tn);if(u.length===3){var l=u.map(Ac),f=l[0],p=l[1],C=l[2];return vt(f,p,C,1)}if(u.length===4){var Q=u.map(Ac),f=Q[0],p=Q[1],C=Q[2],E=Q[3];return vt(f,p,C,E)}return 0};function Ii(s,i,u){return u<0&&(u+=1),u>=1&&(u-=1),u<1/6?(i-s)*u*6+s:u<1/2?i:u<2/3?(i-s)*6*(2/3-u)+s:s}var tc=function(s,i){var u=i.filter(tn),l=u[0],f=u[1],p=u[2],C=u[3],Q=(l.type===17?Se(l.number):qr.parse(s,l))/(Math.PI*2),E=ce(f)?f.number/100:0,N=ce(p)?p.number/100:0,K=typeof C<"u"&&ce(C)?Ae(C,1):1;if(E===0)return vt(N*255,N*255,N*255,1);var X=N<=.5?N*(E+1):N+E-N*E,j=N*2-X,CA=Ii(j,X,Q+1/3),pA=Ii(j,X,Q),wA=Ii(j,X,Q-1/3);return vt(CA*255,pA*255,wA*255,K)},zC={hsl:tc,hsla:tc,rgb:ec,rgba:ec},Gn=function(s,i){return Ct.parse(s,zl.create(i).parseComponentValue())},it={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},$C={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(s,i){return i.map(function(u){if(jA(u))switch(u.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},XC={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ao=function(s,i){var u=Ct.parse(s,i[0]),l=i[1];return l&&ce(l)?{color:u,stop:l}:{color:u,stop:null}},nc=function(s,i){var u=s[0],l=s[s.length-1];u.stop===null&&(u.stop=he),l.stop===null&&(l.stop=wt);for(var f=[],p=0,C=0;C<s.length;C++){var Q=s[C].stop;if(Q!==null){var E=Ae(Q,i);E>p?f.push(E):f.push(p),p=E}else f.push(null)}for(var N=null,C=0;C<f.length;C++){var K=f[C];if(K===null)N===null&&(N=C);else if(N!==null){for(var X=C-N,j=(K-f[N-1])/(X+1),CA=1;CA<=X;CA++)f[N+CA-1]=j*CA;N=null}}return s.map(function(pA,wA){return{color:pA.color,stop:Math.max(Math.min(1,f[wA]/i),0)}})},WC=function(s,i,u){var l=i/2,f=u/2,p=Ae(s[0],i)-l,C=f-Ae(s[1],u);return(Math.atan2(C,p)+Math.PI*2)%(Math.PI*2)},YC=function(s,i,u){var l=typeof s=="number"?s:WC(s,i,u),f=Math.abs(i*Math.sin(l))+Math.abs(u*Math.cos(l)),p=i/2,C=u/2,Q=f/2,E=Math.sin(l-Math.PI/2)*Q,N=Math.cos(l-Math.PI/2)*Q;return[f,p-N,p+N,C-E,C+E]},Re=function(s,i){return Math.sqrt(s*s+i*i)},rc=function(s,i,u,l,f){return[[0,0],[0,i],[s,0],[s,i]].reduce(function(p,C){var Q=C[0],E=C[1],N=Re(u-Q,l-E);return(f?N<p.optimumDistance:N>p.optimumDistance)?{optimumCorner:C,optimumDistance:N}:p},{optimumDistance:f?1/0:-1/0,optimumCorner:null}).optimumCorner},JC=function(s,i,u,l,f){var p=0,C=0;switch(s.size){case 0:s.shape===0?p=C=Math.min(Math.abs(i),Math.abs(i-l),Math.abs(u),Math.abs(u-f)):s.shape===1&&(p=Math.min(Math.abs(i),Math.abs(i-l)),C=Math.min(Math.abs(u),Math.abs(u-f)));break;case 2:if(s.shape===0)p=C=Math.min(Re(i,u),Re(i,u-f),Re(i-l,u),Re(i-l,u-f));else if(s.shape===1){var Q=Math.min(Math.abs(u),Math.abs(u-f))/Math.min(Math.abs(i),Math.abs(i-l)),E=rc(l,f,i,u,!0),N=E[0],K=E[1];p=Re(N-i,(K-u)/Q),C=Q*p}break;case 1:s.shape===0?p=C=Math.max(Math.abs(i),Math.abs(i-l),Math.abs(u),Math.abs(u-f)):s.shape===1&&(p=Math.max(Math.abs(i),Math.abs(i-l)),C=Math.max(Math.abs(u),Math.abs(u-f)));break;case 3:if(s.shape===0)p=C=Math.max(Re(i,u),Re(i,u-f),Re(i-l,u),Re(i-l,u-f));else if(s.shape===1){var Q=Math.max(Math.abs(u),Math.abs(u-f))/Math.max(Math.abs(i),Math.abs(i-l)),X=rc(l,f,i,u,!1),N=X[0],K=X[1];p=Re(N-i,(K-u)/Q),C=Q*p}break}return Array.isArray(s.size)&&(p=Ae(s.size[0],l),C=s.size.length===2?Ae(s.size[1],f):p),[p,C]},ZC=function(s,i){var u=Se(180),l=[];return Ye(i).forEach(function(f,p){if(p===0){var C=f[0];if(C.type===20&&C.value==="to"){u=ql(f);return}else if(jl(C)){u=qr.parse(s,C);return}}var Q=Ao(s,f);l.push(Q)}),{angle:u,stops:l,type:1}},eo=function(s,i){var u=Se(180),l=[];return Ye(i).forEach(function(f,p){if(p===0){var C=f[0];if(C.type===20&&["top","left","right","bottom"].indexOf(C.value)!==-1){u=ql(f);return}else if(jl(C)){u=(qr.parse(s,C)+Se(270))%Se(360);return}}var Q=Ao(s,f);l.push(Q)}),{angle:u,stops:l,type:1}},jC=function(s,i){var u=Se(180),l=[],f=1,p=0,C=3,Q=[];return Ye(i).forEach(function(E,N){var K=E[0];if(N===0){if(jA(K)&&K.value==="linear"){f=1;return}else if(jA(K)&&K.value==="radial"){f=2;return}}if(K.type===18){if(K.name==="from"){var X=Ct.parse(s,K.values[0]);l.push({stop:he,color:X})}else if(K.name==="to"){var X=Ct.parse(s,K.values[0]);l.push({stop:wt,color:X})}else if(K.name==="color-stop"){var j=K.values.filter(tn);if(j.length===2){var X=Ct.parse(s,j[1]),CA=j[0];en(CA)&&l.push({stop:{type:16,number:CA.number*100,flags:CA.flags},color:X})}}}}),f===1?{angle:(u+Se(180))%Se(360),stops:l,type:f}:{size:C,shape:p,stops:l,position:Q,type:f}},oc="closest-side",ic="farthest-side",sc="closest-corner",ac="farthest-corner",lc="circle",cc="ellipse",uc="cover",dc="contain",qC=function(s,i){var u=0,l=3,f=[],p=[];return Ye(i).forEach(function(C,Q){var E=!0;if(Q===0){var N=!1;E=C.reduce(function(X,j){if(N)if(jA(j))switch(j.value){case"center":return p.push(bi),X;case"top":case"left":return p.push(he),X;case"right":case"bottom":return p.push(wt),X}else(ce(j)||mt(j))&&p.push(j);else if(jA(j))switch(j.value){case lc:return u=0,!1;case cc:return u=1,!1;case"at":return N=!0,!1;case oc:return l=0,!1;case uc:case ic:return l=1,!1;case dc:case sc:return l=2,!1;case ac:return l=3,!1}else if(mt(j)||ce(j))return Array.isArray(l)||(l=[]),l.push(j),!1;return X},E)}if(E){var K=Ao(s,C);f.push(K)}}),{size:l,shape:u,stops:f,position:p,type:2}},to=function(s,i){var u=0,l=3,f=[],p=[];return Ye(i).forEach(function(C,Q){var E=!0;if(Q===0?E=C.reduce(function(K,X){if(jA(X))switch(X.value){case"center":return p.push(bi),!1;case"top":case"left":return p.push(he),!1;case"right":case"bottom":return p.push(wt),!1}else if(ce(X)||mt(X))return p.push(X),!1;return K},E):Q===1&&(E=C.reduce(function(K,X){if(jA(X))switch(X.value){case lc:return u=0,!1;case cc:return u=1,!1;case dc:case oc:return l=0,!1;case ic:return l=1,!1;case sc:return l=2,!1;case uc:case ac:return l=3,!1}else if(mt(X)||ce(X))return Array.isArray(l)||(l=[]),l.push(X),!1;return K},E)),E){var N=Ao(s,C);f.push(N)}}),{size:l,shape:u,stops:f,position:p,type:2}},Ay=function(s){return s.type===1},ey=function(s){return s.type===2},Hi={name:"image",parse:function(s,i){if(i.type===22){var u={url:i.value,type:0};return s.cache.addImage(i.value),u}if(i.type===18){var l=fc[i.name];if(typeof l>"u")throw new Error('Attempting to parse an unsupported image function "'+i.name+'"');return l(s,i.values)}throw new Error("Unsupported image type "+i.type)}};function ty(s){return!(s.type===20&&s.value==="none")&&(s.type!==18||!!fc[s.name])}var fc={"linear-gradient":ZC,"-moz-linear-gradient":eo,"-ms-linear-gradient":eo,"-o-linear-gradient":eo,"-webkit-linear-gradient":eo,"radial-gradient":qC,"-moz-radial-gradient":to,"-ms-radial-gradient":to,"-o-radial-gradient":to,"-webkit-radial-gradient":to,"-webkit-gradient":jC},ny={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(s,i){if(i.length===0)return[];var u=i[0];return u.type===20&&u.value==="none"?[]:i.filter(function(l){return tn(l)&&ty(l)}).map(function(l){return Hi.parse(s,l)})}},ry={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(s,i){return i.map(function(u){if(jA(u))switch(u.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},oy={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(s,i){return Ye(i).map(function(u){return u.filter(ce)}).map(Xl)}},iy={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(s,i){return Ye(i).map(function(u){return u.filter(jA).map(function(l){return l.value}).join(" ")}).map(sy)}},sy=function(s){switch(s){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},nn;(function(s){s.AUTO="auto",s.CONTAIN="contain",s.COVER="cover"})(nn||(nn={}));var ay={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(s,i){return Ye(i).map(function(u){return u.filter(ly)})}},ly=function(s){return jA(s)||ce(s)},no=function(s){return{name:"border-"+s+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},cy=no("top"),uy=no("right"),dy=no("bottom"),fy=no("left"),ro=function(s){return{name:"border-radius-"+s,initialValue:"0 0",prefix:!1,type:1,parse:function(i,u){return Xl(u.filter(ce))}}},gy=ro("top-left"),hy=ro("top-right"),By=ro("bottom-right"),py=ro("bottom-left"),oo=function(s){return{name:"border-"+s+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(i,u){switch(u){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},my=oo("top"),wy=oo("right"),Cy=oo("bottom"),yy=oo("left"),io=function(s){return{name:"border-"+s+"-width",initialValue:"0",type:0,prefix:!1,parse:function(i,u){return Vn(u)?u.number:0}}},vy=io("top"),Qy=io("right"),Ey=io("bottom"),Fy=io("left"),Uy={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},by={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(s,i){return i==="rtl"?1:0}},Iy={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(s,i){return i.filter(jA).reduce(function(u,l){return u|Hy(l.value)},0)}},Hy=function(s){switch(s){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},_y={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(s,i){switch(i){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Sy={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(s,i){return i.type===20&&i.value==="normal"?0:i.type===17||i.type===15?i.number:0}},so;(function(s){s.NORMAL="normal",s.STRICT="strict"})(so||(so={}));var xy={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(s,i){return i==="strict"?so.STRICT:so.NORMAL}},Dy={name:"line-height",initialValue:"normal",prefix:!1,type:4},gc=function(s,i){return jA(s)&&s.value==="normal"?1.2*i:s.type===17?i*s.number:ce(s)?Ae(s,i):i},Ny={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(s,i){return i.type===20&&i.value==="none"?null:Hi.parse(s,i)}},Ly={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(s,i){return i==="inside"?0:1}},_i={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(s,i){switch(i){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},ao=function(s){return{name:"margin-"+s,initialValue:"0",prefix:!1,type:4}},Ty=ao("top"),ky=ao("right"),My=ao("bottom"),Oy=ao("left"),Ky={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(s,i){return i.filter(jA).map(function(u){switch(u.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Ry={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(s,i){return i==="break-word"?"break-word":"normal"}},lo=function(s){return{name:"padding-"+s,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Vy=lo("top"),Py=lo("right"),Gy=lo("bottom"),zy=lo("left"),$y={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(s,i){switch(i){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Xy={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(s,i){switch(i){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Wy={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(s,i){return i.length===1&&Ui(i[0],"none")?[]:Ye(i).map(function(u){for(var l={color:it.TRANSPARENT,offsetX:he,offsetY:he,blur:he},f=0,p=0;p<u.length;p++){var C=u[p];mt(C)?(f===0?l.offsetX=C:f===1?l.offsetY=C:l.blur=C,f++):l.color=Ct.parse(s,C)}return l})}},Yy={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(s,i){switch(i){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Jy={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(s,i){if(i.type===20&&i.value==="none")return null;if(i.type===18){var u=qy[i.name];if(typeof u>"u")throw new Error('Attempting to parse an unsupported transform function "'+i.name+'"');return u(i.values)}return null}},Zy=function(s){var i=s.filter(function(u){return u.type===17}).map(function(u){return u.number});return i.length===6?i:null},jy=function(s){var i=s.filter(function(E){return E.type===17}).map(function(E){return E.number}),u=i[0],l=i[1];i[2],i[3];var f=i[4],p=i[5];i[6],i[7],i[8],i[9],i[10],i[11];var C=i[12],Q=i[13];return i[14],i[15],i.length===16?[u,l,f,p,C,Q]:null},qy={matrix:Zy,matrix3d:jy},hc={type:16,number:50,flags:kn},Av=[hc,hc],ev={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(s,i){var u=i.filter(ce);return u.length!==2?Av:[u[0],u[1]]}},tv={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(s,i){switch(i){case"hidden":return 1;case"collapse":return 2;default:return 0}}},zn;(function(s){s.NORMAL="normal",s.BREAK_ALL="break-all",s.KEEP_ALL="keep-all"})(zn||(zn={}));for(var nv={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(s,i){switch(i){case"break-all":return zn.BREAK_ALL;case"keep-all":return zn.KEEP_ALL;default:return zn.NORMAL}}},rv={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(s,i){if(i.type===20)return{auto:!0,order:0};if(en(i))return{auto:!1,order:i.number};throw new Error("Invalid z-index number parsed")}},Bc={name:"time",parse:function(s,i){if(i.type===15)switch(i.unit.toLowerCase()){case"s":return 1e3*i.number;case"ms":return i.number}throw new Error("Unsupported time type")}},ov={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(s,i){return en(i)?i.number:1}},iv={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},sv={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(s,i){return i.filter(jA).map(function(u){switch(u.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(u){return u!==0})}},av={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(s,i){var u=[],l=[];return i.forEach(function(f){switch(f.type){case 20:case 0:u.push(f.value);break;case 17:u.push(f.number.toString());break;case 4:l.push(u.join(" ")),u.length=0;break}}),u.length&&l.push(u.join(" ")),l.map(function(f){return f.indexOf(" ")===-1?f:"'"+f+"'"})}},lv={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},cv={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(s,i){return en(i)?i.number:jA(i)&&i.value==="bold"?700:400}},uv={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(s,i){return i.filter(jA).map(function(u){return u.value})}},dv={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(s,i){switch(i){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},fe=function(s,i){return(s&i)!==0},fv={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(s,i){if(i.length===0)return[];var u=i[0];return u.type===20&&u.value==="none"?[]:i}},gv={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(s,i){if(i.length===0)return null;var u=i[0];if(u.type===20&&u.value==="none")return null;for(var l=[],f=i.filter($l),p=0;p<f.length;p++){var C=f[p],Q=f[p+1];if(C.type===20){var E=Q&&en(Q)?Q.number:1;l.push({counter:C.value,increment:E})}}return l}},hv={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(s,i){if(i.length===0)return[];for(var u=[],l=i.filter($l),f=0;f<l.length;f++){var p=l[f],C=l[f+1];if(jA(p)&&p.value!=="none"){var Q=C&&en(C)?C.number:0;u.push({counter:p.value,reset:Q})}}return u}},Bv={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(s,i){return i.filter(Vn).map(function(u){return Bc.parse(s,u)})}},pv={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(s,i){if(i.length===0)return null;var u=i[0];if(u.type===20&&u.value==="none")return null;var l=[],f=i.filter(PC);if(f.length%2!==0)return null;for(var p=0;p<f.length;p+=2){var C=f[p].value,Q=f[p+1].value;l.push({open:C,close:Q})}return l}},pc=function(s,i,u){if(!s)return"";var l=s[Math.min(i,s.length-1)];return l?u?l.open:l.close:""},mv={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(s,i){return i.length===1&&Ui(i[0],"none")?[]:Ye(i).map(function(u){for(var l={color:255,offsetX:he,offsetY:he,blur:he,spread:he,inset:!1},f=0,p=0;p<u.length;p++){var C=u[p];Ui(C,"inset")?l.inset=!0:mt(C)?(f===0?l.offsetX=C:f===1?l.offsetY=C:f===2?l.blur=C:l.spread=C,f++):l.color=Ct.parse(s,C)}return l})}},wv={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(s,i){var u=[0,1,2],l=[];return i.filter(jA).forEach(function(f){switch(f.value){case"stroke":l.push(1);break;case"fill":l.push(0);break;case"markers":l.push(2);break}}),u.forEach(function(f){l.indexOf(f)===-1&&l.push(f)}),l}},Cv={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},yv={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(s,i){return Vn(i)?i.number:0}},vv=(function(){function s(i,u){var l,f;this.animationDuration=bA(i,Bv,u.animationDuration),this.backgroundClip=bA(i,$C,u.backgroundClip),this.backgroundColor=bA(i,XC,u.backgroundColor),this.backgroundImage=bA(i,ny,u.backgroundImage),this.backgroundOrigin=bA(i,ry,u.backgroundOrigin),this.backgroundPosition=bA(i,oy,u.backgroundPosition),this.backgroundRepeat=bA(i,iy,u.backgroundRepeat),this.backgroundSize=bA(i,ay,u.backgroundSize),this.borderTopColor=bA(i,cy,u.borderTopColor),this.borderRightColor=bA(i,uy,u.borderRightColor),this.borderBottomColor=bA(i,dy,u.borderBottomColor),this.borderLeftColor=bA(i,fy,u.borderLeftColor),this.borderTopLeftRadius=bA(i,gy,u.borderTopLeftRadius),this.borderTopRightRadius=bA(i,hy,u.borderTopRightRadius),this.borderBottomRightRadius=bA(i,By,u.borderBottomRightRadius),this.borderBottomLeftRadius=bA(i,py,u.borderBottomLeftRadius),this.borderTopStyle=bA(i,my,u.borderTopStyle),this.borderRightStyle=bA(i,wy,u.borderRightStyle),this.borderBottomStyle=bA(i,Cy,u.borderBottomStyle),this.borderLeftStyle=bA(i,yy,u.borderLeftStyle),this.borderTopWidth=bA(i,vy,u.borderTopWidth),this.borderRightWidth=bA(i,Qy,u.borderRightWidth),this.borderBottomWidth=bA(i,Ey,u.borderBottomWidth),this.borderLeftWidth=bA(i,Fy,u.borderLeftWidth),this.boxShadow=bA(i,mv,u.boxShadow),this.color=bA(i,Uy,u.color),this.direction=bA(i,by,u.direction),this.display=bA(i,Iy,u.display),this.float=bA(i,_y,u.cssFloat),this.fontFamily=bA(i,av,u.fontFamily),this.fontSize=bA(i,lv,u.fontSize),this.fontStyle=bA(i,dv,u.fontStyle),this.fontVariant=bA(i,uv,u.fontVariant),this.fontWeight=bA(i,cv,u.fontWeight),this.letterSpacing=bA(i,Sy,u.letterSpacing),this.lineBreak=bA(i,xy,u.lineBreak),this.lineHeight=bA(i,Dy,u.lineHeight),this.listStyleImage=bA(i,Ny,u.listStyleImage),this.listStylePosition=bA(i,Ly,u.listStylePosition),this.listStyleType=bA(i,_i,u.listStyleType),this.marginTop=bA(i,Ty,u.marginTop),this.marginRight=bA(i,ky,u.marginRight),this.marginBottom=bA(i,My,u.marginBottom),this.marginLeft=bA(i,Oy,u.marginLeft),this.opacity=bA(i,ov,u.opacity);var p=bA(i,Ky,u.overflow);this.overflowX=p[0],this.overflowY=p[p.length>1?1:0],this.overflowWrap=bA(i,Ry,u.overflowWrap),this.paddingTop=bA(i,Vy,u.paddingTop),this.paddingRight=bA(i,Py,u.paddingRight),this.paddingBottom=bA(i,Gy,u.paddingBottom),this.paddingLeft=bA(i,zy,u.paddingLeft),this.paintOrder=bA(i,wv,u.paintOrder),this.position=bA(i,Xy,u.position),this.textAlign=bA(i,$y,u.textAlign),this.textDecorationColor=bA(i,iv,(l=u.textDecorationColor)!==null&&l!==void 0?l:u.color),this.textDecorationLine=bA(i,sv,(f=u.textDecorationLine)!==null&&f!==void 0?f:u.textDecoration),this.textShadow=bA(i,Wy,u.textShadow),this.textTransform=bA(i,Yy,u.textTransform),this.transform=bA(i,Jy,u.transform),this.transformOrigin=bA(i,ev,u.transformOrigin),this.visibility=bA(i,tv,u.visibility),this.webkitTextStrokeColor=bA(i,Cv,u.webkitTextStrokeColor),this.webkitTextStrokeWidth=bA(i,yv,u.webkitTextStrokeWidth),this.wordBreak=bA(i,nv,u.wordBreak),this.zIndex=bA(i,rv,u.zIndex)}return s.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},s.prototype.isTransparent=function(){return yt(this.backgroundColor)},s.prototype.isTransformed=function(){return this.transform!==null},s.prototype.isPositioned=function(){return this.position!==0},s.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},s.prototype.isFloating=function(){return this.float!==0},s.prototype.isInlineLevel=function(){return fe(this.display,4)||fe(this.display,33554432)||fe(this.display,268435456)||fe(this.display,536870912)||fe(this.display,67108864)||fe(this.display,134217728)},s})(),Qv=(function(){function s(i,u){this.content=bA(i,fv,u.content),this.quotes=bA(i,pv,u.quotes)}return s})(),mc=(function(){function s(i,u){this.counterIncrement=bA(i,gv,u.counterIncrement),this.counterReset=bA(i,hv,u.counterReset)}return s})(),bA=function(s,i,u){var l=new Gl,f=u!==null&&typeof u<"u"?u.toString():i.initialValue;l.write(f);var p=new zl(l.read());switch(i.type){case 2:var C=p.parseComponentValue();return i.parse(s,jA(C)?C.value:i.initialValue);case 0:return i.parse(s,p.parseComponentValue());case 1:return i.parse(s,p.parseComponentValues());case 4:return p.parseComponentValue();case 3:switch(i.format){case"angle":return qr.parse(s,p.parseComponentValue());case"color":return Ct.parse(s,p.parseComponentValue());case"image":return Hi.parse(s,p.parseComponentValue());case"length":var Q=p.parseComponentValue();return mt(Q)?Q:he;case"length-percentage":var E=p.parseComponentValue();return ce(E)?E:he;case"time":return Bc.parse(s,p.parseComponentValue())}break}},Ev="data-html2canvas-debug",Fv=function(s){switch(s.getAttribute(Ev)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Si=function(s,i){var u=Fv(s);return u===1||i===u},Je=(function(){function s(i,u){if(this.context=i,this.textNodes=[],this.elements=[],this.flags=0,Si(u,3))debugger;this.styles=new vv(i,window.getComputedStyle(u,null)),zi(u)&&(this.styles.animationDuration.some(function(l){return l>0})&&(u.style.animationDuration="0s"),this.styles.transform!==null&&(u.style.transform="none")),this.bounds=g(this.context,u),Si(u,4)&&(this.flags|=16)}return s})(),Uv="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",wc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$n=typeof Uint8Array>"u"?[]:new Uint8Array(256),co=0;co<wc.length;co++)$n[wc.charCodeAt(co)]=co;for(var bv=function(s){var i=s.length*.75,u=s.length,l,f=0,p,C,Q,E;s[s.length-1]==="="&&(i--,s[s.length-2]==="="&&i--);var N=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(i):new Array(i),K=Array.isArray(N)?N:new Uint8Array(N);for(l=0;l<u;l+=4)p=$n[s.charCodeAt(l)],C=$n[s.charCodeAt(l+1)],Q=$n[s.charCodeAt(l+2)],E=$n[s.charCodeAt(l+3)],K[f++]=p<<2|C>>4,K[f++]=(C&15)<<4|Q>>2,K[f++]=(Q&3)<<6|E&63;return N},Iv=function(s){for(var i=s.length,u=[],l=0;l<i;l+=2)u.push(s[l+1]<<8|s[l]);return u},Hv=function(s){for(var i=s.length,u=[],l=0;l<i;l+=4)u.push(s[l+3]<<24|s[l+2]<<16|s[l+1]<<8|s[l]);return u},Tt=5,xi=11,Di=2,_v=xi-Tt,Cc=65536>>Tt,Ni=(1<<Tt)-1,Sv=Cc+(1024>>Tt)+32,xv=65536>>xi,Dv=(1<<_v)-1,yc=function(s,i,u){return s.slice?s.slice(i,u):new Uint16Array(Array.prototype.slice.call(s,i,u))},Nv=function(s,i,u){return s.slice?s.slice(i,u):new Uint32Array(Array.prototype.slice.call(s,i,u))},Lv=function(s,i){var u=bv(s),l=Array.isArray(u)?Hv(u):new Uint32Array(u),f=Array.isArray(u)?Iv(u):new Uint16Array(u),p=24,C=yc(f,p/2,l[4]/2),Q=l[5]===2?yc(f,(p+l[4])/2):Nv(l,Math.ceil((p+l[4])/4));return new Tv(l[0],l[1],l[2],l[3],C,Q)},Tv=(function(){function s(i,u,l,f,p,C){this.initialValue=i,this.errorValue=u,this.highStart=l,this.highValueIndex=f,this.index=p,this.data=C}return s.prototype.get=function(i){var u;if(i>=0){if(i<55296||i>56319&&i<=65535)return u=this.index[i>>Tt],u=(u<<Di)+(i&Ni),this.data[u];if(i<=65535)return u=this.index[Cc+(i-55296>>Tt)],u=(u<<Di)+(i&Ni),this.data[u];if(i<this.highStart)return u=Sv-xv+(i>>xi),u=this.index[u],u+=i>>Tt&Dv,u=this.index[u],u=(u<<Di)+(i&Ni),this.data[u];if(i<=1114111)return this.data[this.highValueIndex]}return this.errorValue},s})(),vc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kv=typeof Uint8Array>"u"?[]:new Uint8Array(256),uo=0;uo<vc.length;uo++)kv[vc.charCodeAt(uo)]=uo;var Mv=1,Li=2,Ti=3,Qc=4,Ec=5,Ov=7,Fc=8,ki=9,Mi=10,Uc=11,bc=12,Ic=13,Hc=14,Oi=15,Kv=function(s){for(var i=[],u=0,l=s.length;u<l;){var f=s.charCodeAt(u++);if(f>=55296&&f<=56319&&u<l){var p=s.charCodeAt(u++);(p&64512)===56320?i.push(((f&1023)<<10)+(p&1023)+65536):(i.push(f),u--)}else i.push(f)}return i},Rv=function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(String.fromCodePoint)return String.fromCodePoint.apply(String,s);var u=s.length;if(!u)return"";for(var l=[],f=-1,p="";++f<u;){var C=s[f];C<=65535?l.push(C):(C-=65536,l.push((C>>10)+55296,C%1024+56320)),(f+1===u||l.length>16384)&&(p+=String.fromCharCode.apply(String,l),l.length=0)}return p},Vv=Lv(Uv),xe="×",Ki="÷",Pv=function(s){return Vv.get(s)},Gv=function(s,i,u){var l=u-2,f=i[l],p=i[u-1],C=i[u];if(p===Li&&C===Ti)return xe;if(p===Li||p===Ti||p===Qc||C===Li||C===Ti||C===Qc)return Ki;if(p===Fc&&[Fc,ki,Uc,bc].indexOf(C)!==-1||(p===Uc||p===ki)&&(C===ki||C===Mi)||(p===bc||p===Mi)&&C===Mi||C===Ic||C===Ec||C===Ov||p===Mv)return xe;if(p===Ic&&C===Hc){for(;f===Ec;)f=i[--l];if(f===Hc)return xe}if(p===Oi&&C===Oi){for(var Q=0;f===Oi;)Q++,f=i[--l];if(Q%2===0)return xe}return Ki},zv=function(s){var i=Kv(s),u=i.length,l=0,f=0,p=i.map(Pv);return{next:function(){if(l>=u)return{done:!0,value:null};for(var C=xe;l<u&&(C=Gv(i,p,++l))===xe;);if(C!==xe||l===u){var Q=Rv.apply(null,i.slice(f,l));return f=l,{value:Q,done:!1}}return{done:!0,value:null}}}},$v=function(s){for(var i=zv(s),u=[],l;!(l=i.next()).done;)l.value&&u.push(l.value.slice());return u},Xv=function(s){var i=123;if(s.createRange){var u=s.createRange();if(u.getBoundingClientRect){var l=s.createElement("boundtest");l.style.height=i+"px",l.style.display="block",s.body.appendChild(l),u.selectNode(l);var f=u.getBoundingClientRect(),p=Math.round(f.height);if(s.body.removeChild(l),p===i)return!0}}return!1},Wv=function(s){var i=s.createElement("boundtest");i.style.width="50px",i.style.display="block",i.style.fontSize="12px",i.style.letterSpacing="0px",i.style.wordSpacing="0px",s.body.appendChild(i);var u=s.createRange();i.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var l=i.firstChild,f=w(l.data).map(function(E){return m(E)}),p=0,C={},Q=f.every(function(E,N){u.setStart(l,p),u.setEnd(l,p+E.length);var K=u.getBoundingClientRect();p+=E.length;var X=K.x>C.x||K.y>C.y;return C=K,N===0?!0:X});return s.body.removeChild(i),Q},Yv=function(){return typeof new Image().crossOrigin<"u"},Jv=function(){return typeof new XMLHttpRequest().responseType=="string"},Zv=function(s){var i=new Image,u=s.createElement("canvas"),l=u.getContext("2d");if(!l)return!1;i.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{l.drawImage(i,0,0),u.toDataURL()}catch{return!1}return!0},_c=function(s){return s[0]===0&&s[1]===255&&s[2]===0&&s[3]===255},jv=function(s){var i=s.createElement("canvas"),u=100;i.width=u,i.height=u;var l=i.getContext("2d");if(!l)return Promise.reject(!1);l.fillStyle="rgb(0, 255, 0)",l.fillRect(0,0,u,u);var f=new Image,p=i.toDataURL();f.src=p;var C=Ri(u,u,0,0,f);return l.fillStyle="red",l.fillRect(0,0,u,u),Sc(C).then(function(Q){l.drawImage(Q,0,0);var E=l.getImageData(0,0,u,u).data;l.fillStyle="red",l.fillRect(0,0,u,u);var N=s.createElement("div");return N.style.backgroundImage="url("+p+")",N.style.height=u+"px",_c(E)?Sc(Ri(u,u,0,0,N)):Promise.reject(!1)}).then(function(Q){return l.drawImage(Q,0,0),_c(l.getImageData(0,0,u,u).data)}).catch(function(){return!1})},Ri=function(s,i,u,l,f){var p="http://www.w3.org/2000/svg",C=document.createElementNS(p,"svg"),Q=document.createElementNS(p,"foreignObject");return C.setAttributeNS(null,"width",s.toString()),C.setAttributeNS(null,"height",i.toString()),Q.setAttributeNS(null,"width","100%"),Q.setAttributeNS(null,"height","100%"),Q.setAttributeNS(null,"x",u.toString()),Q.setAttributeNS(null,"y",l.toString()),Q.setAttributeNS(null,"externalResourcesRequired","true"),C.appendChild(Q),Q.appendChild(f),C},Sc=function(s){return new Promise(function(i,u){var l=new Image;l.onload=function(){return i(l)},l.onerror=u,l.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(s))})},Be={get SUPPORT_RANGE_BOUNDS(){var s=Xv(document);return Object.defineProperty(Be,"SUPPORT_RANGE_BOUNDS",{value:s}),s},get SUPPORT_WORD_BREAKING(){var s=Be.SUPPORT_RANGE_BOUNDS&&Wv(document);return Object.defineProperty(Be,"SUPPORT_WORD_BREAKING",{value:s}),s},get SUPPORT_SVG_DRAWING(){var s=Zv(document);return Object.defineProperty(Be,"SUPPORT_SVG_DRAWING",{value:s}),s},get SUPPORT_FOREIGNOBJECT_DRAWING(){var s=typeof Array.from=="function"&&typeof window.fetch=="function"?jv(document):Promise.resolve(!1);return Object.defineProperty(Be,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:s}),s},get SUPPORT_CORS_IMAGES(){var s=Yv();return Object.defineProperty(Be,"SUPPORT_CORS_IMAGES",{value:s}),s},get SUPPORT_RESPONSE_TYPE(){var s=Jv();return Object.defineProperty(Be,"SUPPORT_RESPONSE_TYPE",{value:s}),s},get SUPPORT_CORS_XHR(){var s="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Be,"SUPPORT_CORS_XHR",{value:s}),s},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var s=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Be,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:s}),s}},Xn=(function(){function s(i,u){this.text=i,this.bounds=u}return s})(),qv=function(s,i,u,l){var f=tQ(i,u),p=[],C=0;return f.forEach(function(Q){if(u.textDecorationLine.length||Q.trim().length>0)if(Be.SUPPORT_RANGE_BOUNDS){var E=xc(l,C,Q.length).getClientRects();if(E.length>1){var N=Vi(Q),K=0;N.forEach(function(j){p.push(new Xn(j,h.fromDOMRectList(s,xc(l,K+C,j.length).getClientRects()))),K+=j.length})}else p.push(new Xn(Q,h.fromDOMRectList(s,E)))}else{var X=l.splitText(Q.length);p.push(new Xn(Q,AQ(s,l))),l=X}else Be.SUPPORT_RANGE_BOUNDS||(l=l.splitText(Q.length));C+=Q.length}),p},AQ=function(s,i){var u=i.ownerDocument;if(u){var l=u.createElement("html2canvaswrapper");l.appendChild(i.cloneNode(!0));var f=i.parentNode;if(f){f.replaceChild(l,i);var p=g(s,l);return l.firstChild&&f.replaceChild(l.firstChild,l),p}}return h.EMPTY},xc=function(s,i,u){var l=s.ownerDocument;if(!l)throw new Error("Node has no owner document");var f=l.createRange();return f.setStart(s,i),f.setEnd(s,i+u),f},Vi=function(s){if(Be.SUPPORT_NATIVE_TEXT_SEGMENTATION){var i=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(i.segment(s)).map(function(u){return u.segment})}return $v(s)},eQ=function(s,i){if(Be.SUPPORT_NATIVE_TEXT_SEGMENTATION){var u=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(u.segment(s)).map(function(l){return l.segment})}return rQ(s,i)},tQ=function(s,i){return i.letterSpacing!==0?Vi(s):eQ(s,i)},nQ=[32,160,4961,65792,65793,4153,4241],rQ=function(s,i){for(var u=k0(s,{lineBreak:i.lineBreak,wordBreak:i.overflowWrap==="break-word"?"break-word":i.wordBreak}),l=[],f,p=function(){if(f.value){var C=w(f.value.slice()),Q="";C.forEach(function(E){nQ.indexOf(E)===-1?Q+=m(E):(Q.length&&l.push(Q),l.push(m(E)),Q="")}),Q.length&&l.push(Q)}};!(f=u.next()).done;)p();return l},oQ=(function(){function s(i,u,l){this.text=iQ(u.data,l.textTransform),this.textBounds=qv(i,this.text,l,u)}return s})(),iQ=function(s,i){switch(i){case 1:return s.toLowerCase();case 3:return s.replace(sQ,aQ);case 2:return s.toUpperCase();default:return s}},sQ=/(^|\s|:|-|\(|\))([a-z])/g,aQ=function(s,i,u){return s.length>0?i+u.toUpperCase():s},Dc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.src=l.currentSrc||l.src,f.intrinsicWidth=l.naturalWidth,f.intrinsicHeight=l.naturalHeight,f.context.cache.addImage(f.src),f}return i})(Je),Nc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.canvas=l,f.intrinsicWidth=l.width,f.intrinsicHeight=l.height,f}return i})(Je),Lc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this,p=new XMLSerializer,C=g(u,l);return l.setAttribute("width",C.width+"px"),l.setAttribute("height",C.height+"px"),f.svg="data:image/svg+xml,"+encodeURIComponent(p.serializeToString(l)),f.intrinsicWidth=l.width.baseVal.value,f.intrinsicHeight=l.height.baseVal.value,f.context.cache.addImage(f.svg),f}return i})(Je),Tc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.value=l.value,f}return i})(Je),Pi=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.start=l.start,f.reversed=typeof l.reversed=="boolean"&&l.reversed===!0,f}return i})(Je),lQ=[{type:15,flags:0,unit:"px",number:3}],cQ=[{type:16,flags:0,number:50}],uQ=function(s){return s.width>s.height?new h(s.left+(s.width-s.height)/2,s.top,s.height,s.height):s.width<s.height?new h(s.left,s.top+(s.height-s.width)/2,s.width,s.width):s},dQ=function(s){var i=s.type===fQ?new Array(s.value.length+1).join("•"):s.value;return i.length===0?s.placeholder||"":i},fo="checkbox",go="radio",fQ="password",kc=707406591,Gi=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;switch(f.type=l.type.toLowerCase(),f.checked=l.checked,f.value=dQ(l),(f.type===fo||f.type===go)&&(f.styles.backgroundColor=3739148031,f.styles.borderTopColor=f.styles.borderRightColor=f.styles.borderBottomColor=f.styles.borderLeftColor=2779096575,f.styles.borderTopWidth=f.styles.borderRightWidth=f.styles.borderBottomWidth=f.styles.borderLeftWidth=1,f.styles.borderTopStyle=f.styles.borderRightStyle=f.styles.borderBottomStyle=f.styles.borderLeftStyle=1,f.styles.backgroundClip=[0],f.styles.backgroundOrigin=[0],f.bounds=uQ(f.bounds)),f.type){case fo:f.styles.borderTopRightRadius=f.styles.borderTopLeftRadius=f.styles.borderBottomRightRadius=f.styles.borderBottomLeftRadius=lQ;break;case go:f.styles.borderTopRightRadius=f.styles.borderTopLeftRadius=f.styles.borderBottomRightRadius=f.styles.borderBottomLeftRadius=cQ;break}return f}return i})(Je),Mc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this,p=l.options[l.selectedIndex||0];return f.value=p&&p.text||"",f}return i})(Je),Oc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.value=l.value,f}return i})(Je),Kc=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;f.src=l.src,f.width=parseInt(l.width,10)||0,f.height=parseInt(l.height,10)||0,f.backgroundColor=f.styles.backgroundColor;try{if(l.contentWindow&&l.contentWindow.document&&l.contentWindow.document.documentElement){f.tree=Vc(u,l.contentWindow.document.documentElement);var p=l.contentWindow.document.documentElement?Gn(u,getComputedStyle(l.contentWindow.document.documentElement).backgroundColor):it.TRANSPARENT,C=l.contentWindow.document.body?Gn(u,getComputedStyle(l.contentWindow.document.body).backgroundColor):it.TRANSPARENT;f.backgroundColor=yt(p)?yt(C)?f.styles.backgroundColor:C:p}}catch{}return f}return i})(Je),gQ=["OL","UL","MENU"],ho=function(s,i,u,l){for(var f=i.firstChild,p=void 0;f;f=p)if(p=f.nextSibling,Pc(f)&&f.data.trim().length>0)u.textNodes.push(new oQ(s,f,u.styles));else if(rn(f))if(Yc(f)&&f.assignedNodes)f.assignedNodes().forEach(function(Q){return ho(s,Q,u,l)});else{var C=Rc(s,f);C.styles.isVisible()&&(hQ(f,C,l)?C.flags|=4:BQ(C.styles)&&(C.flags|=2),gQ.indexOf(f.tagName)!==-1&&(C.flags|=8),u.elements.push(C),f.slot,f.shadowRoot?ho(s,f.shadowRoot,C,l):!po(f)&&!Gc(f)&&!mo(f)&&ho(s,f,C,l))}},Rc=function(s,i){return Xi(i)?new Dc(s,i):zc(i)?new Nc(s,i):Gc(i)?new Lc(s,i):pQ(i)?new Tc(s,i):mQ(i)?new Pi(s,i):wQ(i)?new Gi(s,i):mo(i)?new Mc(s,i):po(i)?new Oc(s,i):Xc(i)?new Kc(s,i):new Je(s,i)},Vc=function(s,i){var u=Rc(s,i);return u.flags|=4,ho(s,i,u,u),u},hQ=function(s,i,u){return i.styles.isPositionedWithZIndex()||i.styles.opacity<1||i.styles.isTransformed()||$i(s)&&u.styles.isTransparent()},BQ=function(s){return s.isPositioned()||s.isFloating()},Pc=function(s){return s.nodeType===Node.TEXT_NODE},rn=function(s){return s.nodeType===Node.ELEMENT_NODE},zi=function(s){return rn(s)&&typeof s.style<"u"&&!Bo(s)},Bo=function(s){return typeof s.className=="object"},pQ=function(s){return s.tagName==="LI"},mQ=function(s){return s.tagName==="OL"},wQ=function(s){return s.tagName==="INPUT"},CQ=function(s){return s.tagName==="HTML"},Gc=function(s){return s.tagName==="svg"},$i=function(s){return s.tagName==="BODY"},zc=function(s){return s.tagName==="CANVAS"},$c=function(s){return s.tagName==="VIDEO"},Xi=function(s){return s.tagName==="IMG"},Xc=function(s){return s.tagName==="IFRAME"},Wc=function(s){return s.tagName==="STYLE"},yQ=function(s){return s.tagName==="SCRIPT"},po=function(s){return s.tagName==="TEXTAREA"},mo=function(s){return s.tagName==="SELECT"},Yc=function(s){return s.tagName==="SLOT"},Jc=function(s){return s.tagName.indexOf("-")>0},vQ=(function(){function s(){this.counters={}}return s.prototype.getCounterValue=function(i){var u=this.counters[i];return u&&u.length?u[u.length-1]:1},s.prototype.getCounterValues=function(i){var u=this.counters[i];return u||[]},s.prototype.pop=function(i){var u=this;i.forEach(function(l){return u.counters[l].pop()})},s.prototype.parse=function(i){var u=this,l=i.counterIncrement,f=i.counterReset,p=!0;l!==null&&l.forEach(function(Q){var E=u.counters[Q.counter];E&&Q.increment!==0&&(p=!1,E.length||E.push(1),E[Math.max(0,E.length-1)]+=Q.increment)});var C=[];return p&&f.forEach(function(Q){var E=u.counters[Q.counter];C.push(Q.counter),E||(E=u.counters[Q.counter]=[]),E.push(Q.reset)}),C},s})(),Zc={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},jc={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},QQ={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},EQ={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},on=function(s,i,u,l,f,p){return s<i||s>u?Yn(s,f,p.length>0):l.integers.reduce(function(C,Q,E){for(;s>=Q;)s-=Q,C+=l.values[E];return C},"")+p},qc=function(s,i,u,l){var f="";do u||s--,f=l(s)+f,s/=i;while(s*i>=i);return f},se=function(s,i,u,l,f){var p=u-i+1;return(s<0?"-":"")+(qc(Math.abs(s),p,l,function(C){return m(Math.floor(C%p)+i)})+f)},kt=function(s,i,u){u===void 0&&(u=". ");var l=i.length;return qc(Math.abs(s),l,!1,function(f){return i[Math.floor(f%l)]})+u},sn=1,Qt=2,Et=4,Wn=8,st=function(s,i,u,l,f,p){if(s<-9999||s>9999)return Yn(s,4,f.length>0);var C=Math.abs(s),Q=f;if(C===0)return i[0]+Q;for(var E=0;C>0&&E<=4;E++){var N=C%10;N===0&&fe(p,sn)&&Q!==""?Q=i[N]+Q:N>1||N===1&&E===0||N===1&&E===1&&fe(p,Qt)||N===1&&E===1&&fe(p,Et)&&s>100||N===1&&E>1&&fe(p,Wn)?Q=i[N]+(E>0?u[E-1]:"")+Q:N===1&&E>0&&(Q=u[E-1]+Q),C=Math.floor(C/10)}return(s<0?l:"")+Q},Au="十百千萬",eu="拾佰仟萬",tu="マイナス",Wi="마이너스",Yn=function(s,i,u){var l=u?". ":"",f=u?"、":"",p=u?", ":"",C=u?" ":"";switch(i){case 0:return"•"+C;case 1:return"◦"+C;case 2:return"◾"+C;case 5:var Q=se(s,48,57,!0,l);return Q.length<4?"0"+Q:Q;case 4:return kt(s,"〇一二三四五六七八九",f);case 6:return on(s,1,3999,Zc,3,l).toLowerCase();case 7:return on(s,1,3999,Zc,3,l);case 8:return se(s,945,969,!1,l);case 9:return se(s,97,122,!1,l);case 10:return se(s,65,90,!1,l);case 11:return se(s,1632,1641,!0,l);case 12:case 49:return on(s,1,9999,jc,3,l);case 35:return on(s,1,9999,jc,3,l).toLowerCase();case 13:return se(s,2534,2543,!0,l);case 14:case 30:return se(s,6112,6121,!0,l);case 15:return kt(s,"子丑寅卯辰巳午未申酉戌亥",f);case 16:return kt(s,"甲乙丙丁戊己庚辛壬癸",f);case 17:case 48:return st(s,"零一二三四五六七八九",Au,"負",f,Qt|Et|Wn);case 47:return st(s,"零壹貳參肆伍陸柒捌玖",eu,"負",f,sn|Qt|Et|Wn);case 42:return st(s,"零一二三四五六七八九",Au,"负",f,Qt|Et|Wn);case 41:return st(s,"零壹贰叁肆伍陆柒捌玖",eu,"负",f,sn|Qt|Et|Wn);case 26:return st(s,"〇一二三四五六七八九","十百千万",tu,f,0);case 25:return st(s,"零壱弐参四伍六七八九","拾百千万",tu,f,sn|Qt|Et);case 31:return st(s,"영일이삼사오육칠팔구","십백천만",Wi,p,sn|Qt|Et);case 33:return st(s,"零一二三四五六七八九","十百千萬",Wi,p,0);case 32:return st(s,"零壹貳參四五六七八九","拾百千",Wi,p,sn|Qt|Et);case 18:return se(s,2406,2415,!0,l);case 20:return on(s,1,19999,EQ,3,l);case 21:return se(s,2790,2799,!0,l);case 22:return se(s,2662,2671,!0,l);case 22:return on(s,1,10999,QQ,3,l);case 23:return kt(s,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return kt(s,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return se(s,3302,3311,!0,l);case 28:return kt(s,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",f);case 29:return kt(s,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",f);case 34:return se(s,3792,3801,!0,l);case 37:return se(s,6160,6169,!0,l);case 38:return se(s,4160,4169,!0,l);case 39:return se(s,2918,2927,!0,l);case 40:return se(s,1776,1785,!0,l);case 43:return se(s,3046,3055,!0,l);case 44:return se(s,3174,3183,!0,l);case 45:return se(s,3664,3673,!0,l);case 46:return se(s,3872,3881,!0,l);default:return se(s,48,57,!0,l)}},nu="data-html2canvas-ignore",ru=(function(){function s(i,u,l){if(this.context=i,this.options=l,this.scrolledElements=[],this.referenceElement=u,this.counters=new vQ,this.quoteDepth=0,!u.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(u.ownerDocument.documentElement,!1)}return s.prototype.toIFrame=function(i,u){var l=this,f=FQ(i,u);if(!f.contentWindow)return Promise.reject("Unable to find iframe window");var p=i.defaultView.pageXOffset,C=i.defaultView.pageYOffset,Q=f.contentWindow,E=Q.document,N=IQ(f).then(function(){return a(l,void 0,void 0,function(){var K,X;return c(this,function(j){switch(j.label){case 0:return this.scrolledElements.forEach(xQ),Q&&(Q.scrollTo(u.left,u.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(Q.scrollY!==u.top||Q.scrollX!==u.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(Q.scrollX-u.left,Q.scrollY-u.top,0,0))),K=this.options.onclone,X=this.clonedReferenceElement,typeof X>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:E.fonts&&E.fonts.ready?[4,E.fonts.ready]:[3,2];case 1:j.sent(),j.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,bQ(E)]:[3,4];case 3:j.sent(),j.label=4;case 4:return typeof K=="function"?[2,Promise.resolve().then(function(){return K(E,X)}).then(function(){return f})]:[2,f]}})})});return E.open(),E.write(_Q(document.doctype)+"<html></html>"),SQ(this.referenceElement.ownerDocument,p,C),E.replaceChild(E.adoptNode(this.documentElement),E.documentElement),E.close(),N},s.prototype.createElementClone=function(i){if(Si(i,2))debugger;if(zc(i))return this.createCanvasClone(i);if($c(i))return this.createVideoClone(i);if(Wc(i))return this.createStyleClone(i);var u=i.cloneNode(!1);return Xi(u)&&(Xi(i)&&i.currentSrc&&i.currentSrc!==i.src&&(u.src=i.currentSrc,u.srcset=""),u.loading==="lazy"&&(u.loading="eager")),Jc(u)?this.createCustomElementClone(u):u},s.prototype.createCustomElementClone=function(i){var u=document.createElement("html2canvascustomelement");return Yi(i.style,u),u},s.prototype.createStyleClone=function(i){try{var u=i.sheet;if(u&&u.cssRules){var l=[].slice.call(u.cssRules,0).reduce(function(p,C){return C&&typeof C.cssText=="string"?p+C.cssText:p},""),f=i.cloneNode(!1);return f.textContent=l,f}}catch(p){if(this.context.logger.error("Unable to access cssRules property",p),p.name!=="SecurityError")throw p}return i.cloneNode(!1)},s.prototype.createCanvasClone=function(i){var u;if(this.options.inlineImages&&i.ownerDocument){var l=i.ownerDocument.createElement("img");try{return l.src=i.toDataURL(),l}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",i)}}var f=i.cloneNode(!1);try{f.width=i.width,f.height=i.height;var p=i.getContext("2d"),C=f.getContext("2d");if(C)if(!this.options.allowTaint&&p)C.putImageData(p.getImageData(0,0,i.width,i.height),0,0);else{var Q=(u=i.getContext("webgl2"))!==null&&u!==void 0?u:i.getContext("webgl");if(Q){var E=Q.getContextAttributes();E?.preserveDrawingBuffer===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",i)}C.drawImage(i,0,0)}return f}catch{this.context.logger.info("Unable to clone canvas as it is tainted",i)}return f},s.prototype.createVideoClone=function(i){var u=i.ownerDocument.createElement("canvas");u.width=i.offsetWidth,u.height=i.offsetHeight;var l=u.getContext("2d");try{return l&&(l.drawImage(i,0,0,u.width,u.height),this.options.allowTaint||l.getImageData(0,0,u.width,u.height)),u}catch{this.context.logger.info("Unable to clone video as it is tainted",i)}var f=i.ownerDocument.createElement("canvas");return f.width=i.offsetWidth,f.height=i.offsetHeight,f},s.prototype.appendChildNode=function(i,u,l){(!rn(u)||!yQ(u)&&!u.hasAttribute(nu)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(u)))&&(!this.options.copyStyles||!rn(u)||!Wc(u))&&i.appendChild(this.cloneNode(u,l))},s.prototype.cloneChildNodes=function(i,u,l){for(var f=this,p=i.shadowRoot?i.shadowRoot.firstChild:i.firstChild;p;p=p.nextSibling)if(rn(p)&&Yc(p)&&typeof p.assignedNodes=="function"){var C=p.assignedNodes();C.length&&C.forEach(function(Q){return f.appendChildNode(u,Q,l)})}else this.appendChildNode(u,p,l)},s.prototype.cloneNode=function(i,u){if(Pc(i))return document.createTextNode(i.data);if(!i.ownerDocument)return i.cloneNode(!1);var l=i.ownerDocument.defaultView;if(l&&rn(i)&&(zi(i)||Bo(i))){var f=this.createElementClone(i);f.style.transitionProperty="none";var p=l.getComputedStyle(i),C=l.getComputedStyle(i,":before"),Q=l.getComputedStyle(i,":after");this.referenceElement===i&&zi(f)&&(this.clonedReferenceElement=f),$i(f)&&LQ(f);var E=this.counters.parse(new mc(this.context,p)),N=this.resolvePseudoContent(i,f,C,Jn.BEFORE);Jc(i)&&(u=!0),$c(i)||this.cloneChildNodes(i,f,u),N&&f.insertBefore(N,f.firstChild);var K=this.resolvePseudoContent(i,f,Q,Jn.AFTER);return K&&f.appendChild(K),this.counters.pop(E),(p&&(this.options.copyStyles||Bo(i))&&!Xc(i)||u)&&Yi(p,f),(i.scrollTop!==0||i.scrollLeft!==0)&&this.scrolledElements.push([f,i.scrollLeft,i.scrollTop]),(po(i)||mo(i))&&(po(f)||mo(f))&&(f.value=i.value),f}return i.cloneNode(!1)},s.prototype.resolvePseudoContent=function(i,u,l,f){var p=this;if(l){var C=l.content,Q=u.ownerDocument;if(!(!Q||!C||C==="none"||C==="-moz-alt-content"||l.display==="none")){this.counters.parse(new mc(this.context,l));var E=new Qv(this.context,l),N=Q.createElement("html2canvaspseudoelement");Yi(l,N),E.content.forEach(function(X){if(X.type===0)N.appendChild(Q.createTextNode(X.value));else if(X.type===22){var j=Q.createElement("img");j.src=X.value,j.style.opacity="1",N.appendChild(j)}else if(X.type===18){if(X.name==="attr"){var CA=X.values.filter(jA);CA.length&&N.appendChild(Q.createTextNode(i.getAttribute(CA[0].value)||""))}else if(X.name==="counter"){var pA=X.values.filter(tn),wA=pA[0],KA=pA[1];if(wA&&jA(wA)){var DA=p.counters.getCounterValue(wA.value),_A=KA&&jA(KA)?_i.parse(p.context,KA.value):3;N.appendChild(Q.createTextNode(Yn(DA,_A,!1)))}}else if(X.name==="counters"){var te=X.values.filter(tn),wA=te[0],XA=te[1],KA=te[2];if(wA&&jA(wA)){var MA=p.counters.getCounterValues(wA.value),FA=KA&&jA(KA)?_i.parse(p.context,KA.value):3,GA=XA&&XA.type===0?XA.value:"",zA=MA.map(function(Qe){return Yn(Qe,FA,!1)}).join(GA);N.appendChild(Q.createTextNode(zA))}}}else if(X.type===20)switch(X.value){case"open-quote":N.appendChild(Q.createTextNode(pc(E.quotes,p.quoteDepth++,!0)));break;case"close-quote":N.appendChild(Q.createTextNode(pc(E.quotes,--p.quoteDepth,!1)));break;default:N.appendChild(Q.createTextNode(X.value))}}),N.className=Ji+" "+Zi;var K=f===Jn.BEFORE?" "+Ji:" "+Zi;return Bo(u)?u.className.baseValue+=K:u.className+=K,N}}},s.destroy=function(i){return i.parentNode?(i.parentNode.removeChild(i),!0):!1},s})(),Jn;(function(s){s[s.BEFORE=0]="BEFORE",s[s.AFTER=1]="AFTER"})(Jn||(Jn={}));var FQ=function(s,i){var u=s.createElement("iframe");return u.className="html2canvas-container",u.style.visibility="hidden",u.style.position="fixed",u.style.left="-10000px",u.style.top="0px",u.style.border="0",u.width=i.width.toString(),u.height=i.height.toString(),u.scrolling="no",u.setAttribute(nu,"true"),s.body.appendChild(u),u},UQ=function(s){return new Promise(function(i){if(s.complete){i();return}if(!s.src){i();return}s.onload=i,s.onerror=i})},bQ=function(s){return Promise.all([].slice.call(s.images,0).map(UQ))},IQ=function(s){return new Promise(function(i,u){var l=s.contentWindow;if(!l)return u("No window assigned for iframe");var f=l.document;l.onload=s.onload=function(){l.onload=s.onload=null;var p=setInterval(function(){f.body.childNodes.length>0&&f.readyState==="complete"&&(clearInterval(p),i(s))},50)}})},HQ=["all","d","content"],Yi=function(s,i){for(var u=s.length-1;u>=0;u--){var l=s.item(u);HQ.indexOf(l)===-1&&i.style.setProperty(l,s.getPropertyValue(l))}return i},_Q=function(s){var i="";return s&&(i+="<!DOCTYPE ",s.name&&(i+=s.name),s.internalSubset&&(i+=s.internalSubset),s.publicId&&(i+='"'+s.publicId+'"'),s.systemId&&(i+='"'+s.systemId+'"'),i+=">"),i},SQ=function(s,i,u){s&&s.defaultView&&(i!==s.defaultView.pageXOffset||u!==s.defaultView.pageYOffset)&&s.defaultView.scrollTo(i,u)},xQ=function(s){var i=s[0],u=s[1],l=s[2];i.scrollLeft=u,i.scrollTop=l},DQ=":before",NQ=":after",Ji="___html2canvas___pseudoelement_before",Zi="___html2canvas___pseudoelement_after",ou=`{
32
+ content: "" !important;
33
+ display: none !important;
34
+ }`,LQ=function(s){TQ(s,"."+Ji+DQ+ou+`
35
+ .`+Zi+NQ+ou)},TQ=function(s,i){var u=s.ownerDocument;if(u){var l=u.createElement("style");l.textContent=i,s.appendChild(l)}},iu=(function(){function s(){}return s.getOrigin=function(i){var u=s._link;return u?(u.href=i,u.href=u.href,u.protocol+u.hostname+u.port):"about:blank"},s.isSameOrigin=function(i){return s.getOrigin(i)===s._origin},s.setContext=function(i){s._link=i.document.createElement("a"),s._origin=s.getOrigin(i.location.href)},s._origin="about:blank",s})(),kQ=(function(){function s(i,u){this.context=i,this._options=u,this._cache={}}return s.prototype.addImage=function(i){var u=Promise.resolve();return this.has(i)||(qi(i)||RQ(i))&&(this._cache[i]=this.loadImage(i)).catch(function(){}),u},s.prototype.match=function(i){return this._cache[i]},s.prototype.loadImage=function(i){return a(this,void 0,void 0,function(){var u,l,f,p,C=this;return c(this,function(Q){switch(Q.label){case 0:return u=iu.isSameOrigin(i),l=!ji(i)&&this._options.useCORS===!0&&Be.SUPPORT_CORS_IMAGES&&!u,f=!ji(i)&&!u&&!qi(i)&&typeof this._options.proxy=="string"&&Be.SUPPORT_CORS_XHR&&!l,!u&&this._options.allowTaint===!1&&!ji(i)&&!qi(i)&&!f&&!l?[2]:(p=i,f?[4,this.proxy(p)]:[3,2]);case 1:p=Q.sent(),Q.label=2;case 2:return this.context.logger.debug("Added image "+i.substring(0,256)),[4,new Promise(function(E,N){var K=new Image;K.onload=function(){return E(K)},K.onerror=N,(VQ(p)||l)&&(K.crossOrigin="anonymous"),K.src=p,K.complete===!0&&setTimeout(function(){return E(K)},500),C._options.imageTimeout>0&&setTimeout(function(){return N("Timed out ("+C._options.imageTimeout+"ms) loading image")},C._options.imageTimeout)})];case 3:return[2,Q.sent()]}})})},s.prototype.has=function(i){return typeof this._cache[i]<"u"},s.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},s.prototype.proxy=function(i){var u=this,l=this._options.proxy;if(!l)throw new Error("No proxy defined");var f=i.substring(0,256);return new Promise(function(p,C){var Q=Be.SUPPORT_RESPONSE_TYPE?"blob":"text",E=new XMLHttpRequest;E.onload=function(){if(E.status===200)if(Q==="text")p(E.response);else{var X=new FileReader;X.addEventListener("load",function(){return p(X.result)},!1),X.addEventListener("error",function(j){return C(j)},!1),X.readAsDataURL(E.response)}else C("Failed to proxy resource "+f+" with status code "+E.status)},E.onerror=C;var N=l.indexOf("?")>-1?"&":"?";if(E.open("GET",""+l+N+"url="+encodeURIComponent(i)+"&responseType="+Q),Q!=="text"&&E instanceof XMLHttpRequest&&(E.responseType=Q),u._options.imageTimeout){var K=u._options.imageTimeout;E.timeout=K,E.ontimeout=function(){return C("Timed out ("+K+"ms) proxying "+f)}}E.send()})},s})(),MQ=/^data:image\/svg\+xml/i,OQ=/^data:image\/.*;base64,/i,KQ=/^data:image\/.*/i,RQ=function(s){return Be.SUPPORT_SVG_DRAWING||!PQ(s)},ji=function(s){return KQ.test(s)},VQ=function(s){return OQ.test(s)},qi=function(s){return s.substr(0,4)==="blob"},PQ=function(s){return s.substr(-3).toLowerCase()==="svg"||MQ.test(s)},QA=(function(){function s(i,u){this.type=0,this.x=i,this.y=u}return s.prototype.add=function(i,u){return new s(this.x+i,this.y+u)},s})(),an=function(s,i,u){return new QA(s.x+(i.x-s.x)*u,s.y+(i.y-s.y)*u)},wo=(function(){function s(i,u,l,f){this.type=1,this.start=i,this.startControl=u,this.endControl=l,this.end=f}return s.prototype.subdivide=function(i,u){var l=an(this.start,this.startControl,i),f=an(this.startControl,this.endControl,i),p=an(this.endControl,this.end,i),C=an(l,f,i),Q=an(f,p,i),E=an(C,Q,i);return u?new s(this.start,l,C,E):new s(E,Q,p,this.end)},s.prototype.add=function(i,u){return new s(this.start.add(i,u),this.startControl.add(i,u),this.endControl.add(i,u),this.end.add(i,u))},s.prototype.reverse=function(){return new s(this.end,this.endControl,this.startControl,this.start)},s})(),De=function(s){return s.type===1},GQ=(function(){function s(i){var u=i.styles,l=i.bounds,f=Pn(u.borderTopLeftRadius,l.width,l.height),p=f[0],C=f[1],Q=Pn(u.borderTopRightRadius,l.width,l.height),E=Q[0],N=Q[1],K=Pn(u.borderBottomRightRadius,l.width,l.height),X=K[0],j=K[1],CA=Pn(u.borderBottomLeftRadius,l.width,l.height),pA=CA[0],wA=CA[1],KA=[];KA.push((p+E)/l.width),KA.push((pA+X)/l.width),KA.push((C+wA)/l.height),KA.push((N+j)/l.height);var DA=Math.max.apply(Math,KA);DA>1&&(p/=DA,C/=DA,E/=DA,N/=DA,X/=DA,j/=DA,pA/=DA,wA/=DA);var _A=l.width-E,te=l.height-j,XA=l.width-X,MA=l.height-wA,FA=u.borderTopWidth,GA=u.borderRightWidth,zA=u.borderBottomWidth,OA=u.borderLeftWidth,ue=Ae(u.paddingTop,i.bounds.width),Qe=Ae(u.paddingRight,i.bounds.width),_e=Ae(u.paddingBottom,i.bounds.width),qA=Ae(u.paddingLeft,i.bounds.width);this.topLeftBorderDoubleOuterBox=p>0||C>0?ne(l.left+OA/3,l.top+FA/3,p-OA/3,C-FA/3,YA.TOP_LEFT):new QA(l.left+OA/3,l.top+FA/3),this.topRightBorderDoubleOuterBox=p>0||C>0?ne(l.left+_A,l.top+FA/3,E-GA/3,N-FA/3,YA.TOP_RIGHT):new QA(l.left+l.width-GA/3,l.top+FA/3),this.bottomRightBorderDoubleOuterBox=X>0||j>0?ne(l.left+XA,l.top+te,X-GA/3,j-zA/3,YA.BOTTOM_RIGHT):new QA(l.left+l.width-GA/3,l.top+l.height-zA/3),this.bottomLeftBorderDoubleOuterBox=pA>0||wA>0?ne(l.left+OA/3,l.top+MA,pA-OA/3,wA-zA/3,YA.BOTTOM_LEFT):new QA(l.left+OA/3,l.top+l.height-zA/3),this.topLeftBorderDoubleInnerBox=p>0||C>0?ne(l.left+OA*2/3,l.top+FA*2/3,p-OA*2/3,C-FA*2/3,YA.TOP_LEFT):new QA(l.left+OA*2/3,l.top+FA*2/3),this.topRightBorderDoubleInnerBox=p>0||C>0?ne(l.left+_A,l.top+FA*2/3,E-GA*2/3,N-FA*2/3,YA.TOP_RIGHT):new QA(l.left+l.width-GA*2/3,l.top+FA*2/3),this.bottomRightBorderDoubleInnerBox=X>0||j>0?ne(l.left+XA,l.top+te,X-GA*2/3,j-zA*2/3,YA.BOTTOM_RIGHT):new QA(l.left+l.width-GA*2/3,l.top+l.height-zA*2/3),this.bottomLeftBorderDoubleInnerBox=pA>0||wA>0?ne(l.left+OA*2/3,l.top+MA,pA-OA*2/3,wA-zA*2/3,YA.BOTTOM_LEFT):new QA(l.left+OA*2/3,l.top+l.height-zA*2/3),this.topLeftBorderStroke=p>0||C>0?ne(l.left+OA/2,l.top+FA/2,p-OA/2,C-FA/2,YA.TOP_LEFT):new QA(l.left+OA/2,l.top+FA/2),this.topRightBorderStroke=p>0||C>0?ne(l.left+_A,l.top+FA/2,E-GA/2,N-FA/2,YA.TOP_RIGHT):new QA(l.left+l.width-GA/2,l.top+FA/2),this.bottomRightBorderStroke=X>0||j>0?ne(l.left+XA,l.top+te,X-GA/2,j-zA/2,YA.BOTTOM_RIGHT):new QA(l.left+l.width-GA/2,l.top+l.height-zA/2),this.bottomLeftBorderStroke=pA>0||wA>0?ne(l.left+OA/2,l.top+MA,pA-OA/2,wA-zA/2,YA.BOTTOM_LEFT):new QA(l.left+OA/2,l.top+l.height-zA/2),this.topLeftBorderBox=p>0||C>0?ne(l.left,l.top,p,C,YA.TOP_LEFT):new QA(l.left,l.top),this.topRightBorderBox=E>0||N>0?ne(l.left+_A,l.top,E,N,YA.TOP_RIGHT):new QA(l.left+l.width,l.top),this.bottomRightBorderBox=X>0||j>0?ne(l.left+XA,l.top+te,X,j,YA.BOTTOM_RIGHT):new QA(l.left+l.width,l.top+l.height),this.bottomLeftBorderBox=pA>0||wA>0?ne(l.left,l.top+MA,pA,wA,YA.BOTTOM_LEFT):new QA(l.left,l.top+l.height),this.topLeftPaddingBox=p>0||C>0?ne(l.left+OA,l.top+FA,Math.max(0,p-OA),Math.max(0,C-FA),YA.TOP_LEFT):new QA(l.left+OA,l.top+FA),this.topRightPaddingBox=E>0||N>0?ne(l.left+Math.min(_A,l.width-GA),l.top+FA,_A>l.width+GA?0:Math.max(0,E-GA),Math.max(0,N-FA),YA.TOP_RIGHT):new QA(l.left+l.width-GA,l.top+FA),this.bottomRightPaddingBox=X>0||j>0?ne(l.left+Math.min(XA,l.width-OA),l.top+Math.min(te,l.height-zA),Math.max(0,X-GA),Math.max(0,j-zA),YA.BOTTOM_RIGHT):new QA(l.left+l.width-GA,l.top+l.height-zA),this.bottomLeftPaddingBox=pA>0||wA>0?ne(l.left+OA,l.top+Math.min(MA,l.height-zA),Math.max(0,pA-OA),Math.max(0,wA-zA),YA.BOTTOM_LEFT):new QA(l.left+OA,l.top+l.height-zA),this.topLeftContentBox=p>0||C>0?ne(l.left+OA+qA,l.top+FA+ue,Math.max(0,p-(OA+qA)),Math.max(0,C-(FA+ue)),YA.TOP_LEFT):new QA(l.left+OA+qA,l.top+FA+ue),this.topRightContentBox=E>0||N>0?ne(l.left+Math.min(_A,l.width+OA+qA),l.top+FA+ue,_A>l.width+OA+qA?0:E-OA+qA,N-(FA+ue),YA.TOP_RIGHT):new QA(l.left+l.width-(GA+Qe),l.top+FA+ue),this.bottomRightContentBox=X>0||j>0?ne(l.left+Math.min(XA,l.width-(OA+qA)),l.top+Math.min(te,l.height+FA+ue),Math.max(0,X-(GA+Qe)),j-(zA+_e),YA.BOTTOM_RIGHT):new QA(l.left+l.width-(GA+Qe),l.top+l.height-(zA+_e)),this.bottomLeftContentBox=pA>0||wA>0?ne(l.left+OA+qA,l.top+MA,Math.max(0,pA-(OA+qA)),wA-(zA+_e),YA.BOTTOM_LEFT):new QA(l.left+OA+qA,l.top+l.height-(zA+_e))}return s})(),YA;(function(s){s[s.TOP_LEFT=0]="TOP_LEFT",s[s.TOP_RIGHT=1]="TOP_RIGHT",s[s.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",s[s.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(YA||(YA={}));var ne=function(s,i,u,l,f){var p=4*((Math.sqrt(2)-1)/3),C=u*p,Q=l*p,E=s+u,N=i+l;switch(f){case YA.TOP_LEFT:return new wo(new QA(s,N),new QA(s,N-Q),new QA(E-C,i),new QA(E,i));case YA.TOP_RIGHT:return new wo(new QA(s,i),new QA(s+C,i),new QA(E,N-Q),new QA(E,N));case YA.BOTTOM_RIGHT:return new wo(new QA(E,i),new QA(E,i+Q),new QA(s+C,N),new QA(s,N));case YA.BOTTOM_LEFT:default:return new wo(new QA(E,N),new QA(E-C,N),new QA(s,i+Q),new QA(s,i))}},Co=function(s){return[s.topLeftBorderBox,s.topRightBorderBox,s.bottomRightBorderBox,s.bottomLeftBorderBox]},zQ=function(s){return[s.topLeftContentBox,s.topRightContentBox,s.bottomRightContentBox,s.bottomLeftContentBox]},yo=function(s){return[s.topLeftPaddingBox,s.topRightPaddingBox,s.bottomRightPaddingBox,s.bottomLeftPaddingBox]},$Q=(function(){function s(i,u,l){this.offsetX=i,this.offsetY=u,this.matrix=l,this.type=0,this.target=6}return s})(),vo=(function(){function s(i,u){this.path=i,this.target=u,this.type=1}return s})(),XQ=(function(){function s(i){this.opacity=i,this.type=2,this.target=6}return s})(),WQ=function(s){return s.type===0},su=function(s){return s.type===1},YQ=function(s){return s.type===2},au=function(s,i){return s.length===i.length?s.some(function(u,l){return u===i[l]}):!1},JQ=function(s,i,u,l,f){return s.map(function(p,C){switch(C){case 0:return p.add(i,u);case 1:return p.add(i+l,u);case 2:return p.add(i+l,u+f);case 3:return p.add(i,u+f)}return p})},lu=(function(){function s(i){this.element=i,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return s})(),cu=(function(){function s(i,u){if(this.container=i,this.parent=u,this.effects=[],this.curves=new GQ(this.container),this.container.styles.opacity<1&&this.effects.push(new XQ(this.container.styles.opacity)),this.container.styles.transform!==null){var l=this.container.bounds.left+this.container.styles.transformOrigin[0].number,f=this.container.bounds.top+this.container.styles.transformOrigin[1].number,p=this.container.styles.transform;this.effects.push(new $Q(l,f,p))}if(this.container.styles.overflowX!==0){var C=Co(this.curves),Q=yo(this.curves);au(C,Q)?this.effects.push(new vo(C,6)):(this.effects.push(new vo(C,2)),this.effects.push(new vo(Q,4)))}}return s.prototype.getEffects=function(i){for(var u=[2,3].indexOf(this.container.styles.position)===-1,l=this.parent,f=this.effects.slice(0);l;){var p=l.effects.filter(function(E){return!su(E)});if(u||l.container.styles.position!==0||!l.parent){if(f.unshift.apply(f,p),u=[2,3].indexOf(l.container.styles.position)===-1,l.container.styles.overflowX!==0){var C=Co(l.curves),Q=yo(l.curves);au(C,Q)||f.unshift(new vo(Q,6))}}else f.unshift.apply(f,p);l=l.parent}return f.filter(function(E){return fe(E.target,i)})},s})(),As=function(s,i,u,l){s.container.elements.forEach(function(f){var p=fe(f.flags,4),C=fe(f.flags,2),Q=new cu(f,s);fe(f.styles.display,2048)&&l.push(Q);var E=fe(f.flags,8)?[]:l;if(p||C){var N=p||f.styles.isPositioned()?u:i,K=new lu(Q);if(f.styles.isPositioned()||f.styles.opacity<1||f.styles.isTransformed()){var X=f.styles.zIndex.order;if(X<0){var j=0;N.negativeZIndex.some(function(pA,wA){return X>pA.element.container.styles.zIndex.order?(j=wA,!1):j>0}),N.negativeZIndex.splice(j,0,K)}else if(X>0){var CA=0;N.positiveZIndex.some(function(pA,wA){return X>=pA.element.container.styles.zIndex.order?(CA=wA+1,!1):CA>0}),N.positiveZIndex.splice(CA,0,K)}else N.zeroOrAutoZIndexOrTransformedOrOpacity.push(K)}else f.styles.isFloating()?N.nonPositionedFloats.push(K):N.nonPositionedInlineLevel.push(K);As(Q,K,p?K:u,E)}else f.styles.isInlineLevel()?i.inlineLevel.push(Q):i.nonInlineLevel.push(Q),As(Q,i,u,E);fe(f.flags,8)&&uu(f,E)})},uu=function(s,i){for(var u=s instanceof Pi?s.start:1,l=s instanceof Pi?s.reversed:!1,f=0;f<i.length;f++){var p=i[f];p.container instanceof Tc&&typeof p.container.value=="number"&&p.container.value!==0&&(u=p.container.value),p.listValue=Yn(u,p.container.styles.listStyleType,!0),u+=l?-1:1}},ZQ=function(s){var i=new cu(s,null),u=new lu(i),l=[];return As(i,u,u,l),uu(i.container,l),u},du=function(s,i){switch(i){case 0:return Ne(s.topLeftBorderBox,s.topLeftPaddingBox,s.topRightBorderBox,s.topRightPaddingBox);case 1:return Ne(s.topRightBorderBox,s.topRightPaddingBox,s.bottomRightBorderBox,s.bottomRightPaddingBox);case 2:return Ne(s.bottomRightBorderBox,s.bottomRightPaddingBox,s.bottomLeftBorderBox,s.bottomLeftPaddingBox);default:return Ne(s.bottomLeftBorderBox,s.bottomLeftPaddingBox,s.topLeftBorderBox,s.topLeftPaddingBox)}},jQ=function(s,i){switch(i){case 0:return Ne(s.topLeftBorderBox,s.topLeftBorderDoubleOuterBox,s.topRightBorderBox,s.topRightBorderDoubleOuterBox);case 1:return Ne(s.topRightBorderBox,s.topRightBorderDoubleOuterBox,s.bottomRightBorderBox,s.bottomRightBorderDoubleOuterBox);case 2:return Ne(s.bottomRightBorderBox,s.bottomRightBorderDoubleOuterBox,s.bottomLeftBorderBox,s.bottomLeftBorderDoubleOuterBox);default:return Ne(s.bottomLeftBorderBox,s.bottomLeftBorderDoubleOuterBox,s.topLeftBorderBox,s.topLeftBorderDoubleOuterBox)}},qQ=function(s,i){switch(i){case 0:return Ne(s.topLeftBorderDoubleInnerBox,s.topLeftPaddingBox,s.topRightBorderDoubleInnerBox,s.topRightPaddingBox);case 1:return Ne(s.topRightBorderDoubleInnerBox,s.topRightPaddingBox,s.bottomRightBorderDoubleInnerBox,s.bottomRightPaddingBox);case 2:return Ne(s.bottomRightBorderDoubleInnerBox,s.bottomRightPaddingBox,s.bottomLeftBorderDoubleInnerBox,s.bottomLeftPaddingBox);default:return Ne(s.bottomLeftBorderDoubleInnerBox,s.bottomLeftPaddingBox,s.topLeftBorderDoubleInnerBox,s.topLeftPaddingBox)}},AE=function(s,i){switch(i){case 0:return Qo(s.topLeftBorderStroke,s.topRightBorderStroke);case 1:return Qo(s.topRightBorderStroke,s.bottomRightBorderStroke);case 2:return Qo(s.bottomRightBorderStroke,s.bottomLeftBorderStroke);default:return Qo(s.bottomLeftBorderStroke,s.topLeftBorderStroke)}},Qo=function(s,i){var u=[];return De(s)?u.push(s.subdivide(.5,!1)):u.push(s),De(i)?u.push(i.subdivide(.5,!0)):u.push(i),u},Ne=function(s,i,u,l){var f=[];return De(s)?f.push(s.subdivide(.5,!1)):f.push(s),De(u)?f.push(u.subdivide(.5,!0)):f.push(u),De(l)?f.push(l.subdivide(.5,!0).reverse()):f.push(l),De(i)?f.push(i.subdivide(.5,!1).reverse()):f.push(i),f},fu=function(s){var i=s.bounds,u=s.styles;return i.add(u.borderLeftWidth,u.borderTopWidth,-(u.borderRightWidth+u.borderLeftWidth),-(u.borderTopWidth+u.borderBottomWidth))},Eo=function(s){var i=s.styles,u=s.bounds,l=Ae(i.paddingLeft,u.width),f=Ae(i.paddingRight,u.width),p=Ae(i.paddingTop,u.width),C=Ae(i.paddingBottom,u.width);return u.add(l+i.borderLeftWidth,p+i.borderTopWidth,-(i.borderRightWidth+i.borderLeftWidth+l+f),-(i.borderTopWidth+i.borderBottomWidth+p+C))},eE=function(s,i){return s===0?i.bounds:s===2?Eo(i):fu(i)},tE=function(s,i){return s===0?i.bounds:s===2?Eo(i):fu(i)},es=function(s,i,u){var l=eE(cn(s.styles.backgroundOrigin,i),s),f=tE(cn(s.styles.backgroundClip,i),s),p=nE(cn(s.styles.backgroundSize,i),u,l),C=p[0],Q=p[1],E=Pn(cn(s.styles.backgroundPosition,i),l.width-C,l.height-Q);return[rE(cn(s.styles.backgroundRepeat,i),E,p,l,f),Math.round(l.left+E[0]),Math.round(l.top+E[1]),C,Q]},ln=function(s){return jA(s)&&s.value===nn.AUTO},Fo=function(s){return typeof s=="number"},nE=function(s,i,u){var l=i[0],f=i[1],p=i[2],C=s[0],Q=s[1];if(!C)return[0,0];if(ce(C)&&Q&&ce(Q))return[Ae(C,u.width),Ae(Q,u.height)];var E=Fo(p);if(jA(C)&&(C.value===nn.CONTAIN||C.value===nn.COVER))return Fo(p)?u.width/u.height<p!=(C.value===nn.COVER)?[u.width,u.width/p]:[u.height*p,u.height]:[u.width,u.height];var N=Fo(l),K=Fo(f),X=N||K;if(ln(C)&&(!Q||ln(Q)))return N&&K?[l,f]:!E&&!X?[u.width,u.height]:X&&E?[N?l:f*p,K?f:l/p]:[N?l:u.width,K?f:u.height];if(E){var j=0,CA=0;return ce(C)?j=Ae(C,u.width):ce(Q)&&(CA=Ae(Q,u.height)),ln(C)?j=CA*p:(!Q||ln(Q))&&(CA=j/p),[j,CA]}var pA=null,wA=null;if(ce(C)?pA=Ae(C,u.width):Q&&ce(Q)&&(wA=Ae(Q,u.height)),pA!==null&&(!Q||ln(Q))&&(wA=N&&K?pA/l*f:u.height),wA!==null&&ln(C)&&(pA=N&&K?wA/f*l:u.width),pA!==null&&wA!==null)return[pA,wA];throw new Error("Unable to calculate background-size for element")},cn=function(s,i){var u=s[i];return typeof u>"u"?s[0]:u},rE=function(s,i,u,l,f){var p=i[0],C=i[1],Q=u[0],E=u[1];switch(s){case 2:return[new QA(Math.round(l.left),Math.round(l.top+C)),new QA(Math.round(l.left+l.width),Math.round(l.top+C)),new QA(Math.round(l.left+l.width),Math.round(E+l.top+C)),new QA(Math.round(l.left),Math.round(E+l.top+C))];case 3:return[new QA(Math.round(l.left+p),Math.round(l.top)),new QA(Math.round(l.left+p+Q),Math.round(l.top)),new QA(Math.round(l.left+p+Q),Math.round(l.height+l.top)),new QA(Math.round(l.left+p),Math.round(l.height+l.top))];case 1:return[new QA(Math.round(l.left+p),Math.round(l.top+C)),new QA(Math.round(l.left+p+Q),Math.round(l.top+C)),new QA(Math.round(l.left+p+Q),Math.round(l.top+C+E)),new QA(Math.round(l.left+p),Math.round(l.top+C+E))];default:return[new QA(Math.round(f.left),Math.round(f.top)),new QA(Math.round(f.left+f.width),Math.round(f.top)),new QA(Math.round(f.left+f.width),Math.round(f.height+f.top)),new QA(Math.round(f.left),Math.round(f.height+f.top))]}},oE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",gu="Hidden Text",iE=(function(){function s(i){this._data={},this._document=i}return s.prototype.parseMetrics=function(i,u){var l=this._document.createElement("div"),f=this._document.createElement("img"),p=this._document.createElement("span"),C=this._document.body;l.style.visibility="hidden",l.style.fontFamily=i,l.style.fontSize=u,l.style.margin="0",l.style.padding="0",l.style.whiteSpace="nowrap",C.appendChild(l),f.src=oE,f.width=1,f.height=1,f.style.margin="0",f.style.padding="0",f.style.verticalAlign="baseline",p.style.fontFamily=i,p.style.fontSize=u,p.style.margin="0",p.style.padding="0",p.appendChild(this._document.createTextNode(gu)),l.appendChild(p),l.appendChild(f);var Q=f.offsetTop-p.offsetTop+2;l.removeChild(p),l.appendChild(this._document.createTextNode(gu)),l.style.lineHeight="normal",f.style.verticalAlign="super";var E=f.offsetTop-l.offsetTop+2;return C.removeChild(l),{baseline:Q,middle:E}},s.prototype.getMetrics=function(i,u){var l=i+" "+u;return typeof this._data[l]>"u"&&(this._data[l]=this.parseMetrics(i,u)),this._data[l]},s})(),hu=(function(){function s(i,u){this.context=i,this.options=u}return s})(),sE=1e4,aE=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f._activeEffects=[],f.canvas=l.canvas?l.canvas:document.createElement("canvas"),f.ctx=f.canvas.getContext("2d"),l.canvas||(f.canvas.width=Math.floor(l.width*l.scale),f.canvas.height=Math.floor(l.height*l.scale),f.canvas.style.width=l.width+"px",f.canvas.style.height=l.height+"px"),f.fontMetrics=new iE(document),f.ctx.scale(f.options.scale,f.options.scale),f.ctx.translate(-l.x,-l.y),f.ctx.textBaseline="bottom",f._activeEffects=[],f.context.logger.debug("Canvas renderer initialized ("+l.width+"x"+l.height+") with scale "+l.scale),f}return i.prototype.applyEffects=function(u){for(var l=this;this._activeEffects.length;)this.popEffect();u.forEach(function(f){return l.applyEffect(f)})},i.prototype.applyEffect=function(u){this.ctx.save(),YQ(u)&&(this.ctx.globalAlpha=u.opacity),WQ(u)&&(this.ctx.translate(u.offsetX,u.offsetY),this.ctx.transform(u.matrix[0],u.matrix[1],u.matrix[2],u.matrix[3],u.matrix[4],u.matrix[5]),this.ctx.translate(-u.offsetX,-u.offsetY)),su(u)&&(this.path(u.path),this.ctx.clip()),this._activeEffects.push(u)},i.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},i.prototype.renderStack=function(u){return a(this,void 0,void 0,function(){var l;return c(this,function(f){switch(f.label){case 0:return l=u.element.container.styles,l.isVisible()?[4,this.renderStackContent(u)]:[3,2];case 1:f.sent(),f.label=2;case 2:return[2]}})})},i.prototype.renderNode=function(u){return a(this,void 0,void 0,function(){return c(this,function(l){switch(l.label){case 0:if(fe(u.container.flags,16))debugger;return u.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(u)]:[3,3];case 1:return l.sent(),[4,this.renderNodeContent(u)];case 2:l.sent(),l.label=3;case 3:return[2]}})})},i.prototype.renderTextWithLetterSpacing=function(u,l,f){var p=this;l===0?this.ctx.fillText(u.text,u.bounds.left,u.bounds.top+f):Vi(u.text).reduce(function(C,Q){return p.ctx.fillText(Q,C,u.bounds.top+f),C+p.ctx.measureText(Q).width},u.bounds.left)},i.prototype.createFontStyle=function(u){var l=u.fontVariant.filter(function(C){return C==="normal"||C==="small-caps"}).join(""),f=fE(u.fontFamily).join(", "),p=Vn(u.fontSize)?""+u.fontSize.number+u.fontSize.unit:u.fontSize.number+"px";return[[u.fontStyle,l,u.fontWeight,p,f].join(" "),f,p]},i.prototype.renderTextNode=function(u,l){return a(this,void 0,void 0,function(){var f,p,C,Q,E,N,K,X,j=this;return c(this,function(CA){return f=this.createFontStyle(l),p=f[0],C=f[1],Q=f[2],this.ctx.font=p,this.ctx.direction=l.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",E=this.fontMetrics.getMetrics(C,Q),N=E.baseline,K=E.middle,X=l.paintOrder,u.textBounds.forEach(function(pA){X.forEach(function(wA){switch(wA){case 0:j.ctx.fillStyle=ge(l.color),j.renderTextWithLetterSpacing(pA,l.letterSpacing,N);var KA=l.textShadow;KA.length&&pA.text.trim().length&&(KA.slice(0).reverse().forEach(function(DA){j.ctx.shadowColor=ge(DA.color),j.ctx.shadowOffsetX=DA.offsetX.number*j.options.scale,j.ctx.shadowOffsetY=DA.offsetY.number*j.options.scale,j.ctx.shadowBlur=DA.blur.number,j.renderTextWithLetterSpacing(pA,l.letterSpacing,N)}),j.ctx.shadowColor="",j.ctx.shadowOffsetX=0,j.ctx.shadowOffsetY=0,j.ctx.shadowBlur=0),l.textDecorationLine.length&&(j.ctx.fillStyle=ge(l.textDecorationColor||l.color),l.textDecorationLine.forEach(function(DA){switch(DA){case 1:j.ctx.fillRect(pA.bounds.left,Math.round(pA.bounds.top+N),pA.bounds.width,1);break;case 2:j.ctx.fillRect(pA.bounds.left,Math.round(pA.bounds.top),pA.bounds.width,1);break;case 3:j.ctx.fillRect(pA.bounds.left,Math.ceil(pA.bounds.top+K),pA.bounds.width,1);break}}));break;case 1:l.webkitTextStrokeWidth&&pA.text.trim().length&&(j.ctx.strokeStyle=ge(l.webkitTextStrokeColor),j.ctx.lineWidth=l.webkitTextStrokeWidth,j.ctx.lineJoin=window.chrome?"miter":"round",j.ctx.strokeText(pA.text,pA.bounds.left,pA.bounds.top+N)),j.ctx.strokeStyle="",j.ctx.lineWidth=0,j.ctx.lineJoin="miter";break}})}),[2]})})},i.prototype.renderReplacedElement=function(u,l,f){if(f&&u.intrinsicWidth>0&&u.intrinsicHeight>0){var p=Eo(u),C=yo(l);this.path(C),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(f,0,0,u.intrinsicWidth,u.intrinsicHeight,p.left,p.top,p.width,p.height),this.ctx.restore()}},i.prototype.renderNodeContent=function(u){return a(this,void 0,void 0,function(){var l,f,p,C,Q,E,_A,_A,N,K,X,j,XA,CA,pA,MA,wA,KA,DA,_A,te,XA,MA;return c(this,function(FA){switch(FA.label){case 0:this.applyEffects(u.getEffects(4)),l=u.container,f=u.curves,p=l.styles,C=0,Q=l.textNodes,FA.label=1;case 1:return C<Q.length?(E=Q[C],[4,this.renderTextNode(E,p)]):[3,4];case 2:FA.sent(),FA.label=3;case 3:return C++,[3,1];case 4:if(!(l instanceof Dc))return[3,8];FA.label=5;case 5:return FA.trys.push([5,7,,8]),[4,this.context.cache.match(l.src)];case 6:return _A=FA.sent(),this.renderReplacedElement(l,f,_A),[3,8];case 7:return FA.sent(),this.context.logger.error("Error loading image "+l.src),[3,8];case 8:if(l instanceof Nc&&this.renderReplacedElement(l,f,l.canvas),!(l instanceof Lc))return[3,12];FA.label=9;case 9:return FA.trys.push([9,11,,12]),[4,this.context.cache.match(l.svg)];case 10:return _A=FA.sent(),this.renderReplacedElement(l,f,_A),[3,12];case 11:return FA.sent(),this.context.logger.error("Error loading svg "+l.svg.substring(0,255)),[3,12];case 12:return l instanceof Kc&&l.tree?(N=new i(this.context,{scale:this.options.scale,backgroundColor:l.backgroundColor,x:0,y:0,width:l.width,height:l.height}),[4,N.render(l.tree)]):[3,14];case 13:K=FA.sent(),l.width&&l.height&&this.ctx.drawImage(K,0,0,l.width,l.height,l.bounds.left,l.bounds.top,l.bounds.width,l.bounds.height),FA.label=14;case 14:if(l instanceof Gi&&(X=Math.min(l.bounds.width,l.bounds.height),l.type===fo?l.checked&&(this.ctx.save(),this.path([new QA(l.bounds.left+X*.39363,l.bounds.top+X*.79),new QA(l.bounds.left+X*.16,l.bounds.top+X*.5549),new QA(l.bounds.left+X*.27347,l.bounds.top+X*.44071),new QA(l.bounds.left+X*.39694,l.bounds.top+X*.5649),new QA(l.bounds.left+X*.72983,l.bounds.top+X*.23),new QA(l.bounds.left+X*.84,l.bounds.top+X*.34085),new QA(l.bounds.left+X*.39363,l.bounds.top+X*.79)]),this.ctx.fillStyle=ge(kc),this.ctx.fill(),this.ctx.restore()):l.type===go&&l.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(l.bounds.left+X/2,l.bounds.top+X/2,X/4,0,Math.PI*2,!0),this.ctx.fillStyle=ge(kc),this.ctx.fill(),this.ctx.restore())),lE(l)&&l.value.length){switch(j=this.createFontStyle(p),XA=j[0],CA=j[1],pA=this.fontMetrics.getMetrics(XA,CA).baseline,this.ctx.font=XA,this.ctx.fillStyle=ge(p.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=uE(l.styles.textAlign),MA=Eo(l),wA=0,l.styles.textAlign){case 1:wA+=MA.width/2;break;case 2:wA+=MA.width;break}KA=MA.add(wA,0,0,-MA.height/2+1),this.ctx.save(),this.path([new QA(MA.left,MA.top),new QA(MA.left+MA.width,MA.top),new QA(MA.left+MA.width,MA.top+MA.height),new QA(MA.left,MA.top+MA.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Xn(l.value,KA),p.letterSpacing,pA),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!fe(l.styles.display,2048))return[3,20];if(l.styles.listStyleImage===null)return[3,19];if(DA=l.styles.listStyleImage,DA.type!==0)return[3,18];_A=void 0,te=DA.url,FA.label=15;case 15:return FA.trys.push([15,17,,18]),[4,this.context.cache.match(te)];case 16:return _A=FA.sent(),this.ctx.drawImage(_A,l.bounds.left-(_A.width+10),l.bounds.top),[3,18];case 17:return FA.sent(),this.context.logger.error("Error loading list-style-image "+te),[3,18];case 18:return[3,20];case 19:u.listValue&&l.styles.listStyleType!==-1&&(XA=this.createFontStyle(p)[0],this.ctx.font=XA,this.ctx.fillStyle=ge(p.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",MA=new h(l.bounds.left,l.bounds.top+Ae(l.styles.paddingTop,l.bounds.width),l.bounds.width,gc(p.lineHeight,p.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Xn(u.listValue,MA),p.letterSpacing,gc(p.lineHeight,p.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),FA.label=20;case 20:return[2]}})})},i.prototype.renderStackContent=function(u){return a(this,void 0,void 0,function(){var l,f,DA,p,C,DA,Q,E,DA,N,K,DA,X,j,DA,CA,pA,DA,wA,KA,DA;return c(this,function(_A){switch(_A.label){case 0:if(fe(u.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(u.element)];case 1:_A.sent(),l=0,f=u.negativeZIndex,_A.label=2;case 2:return l<f.length?(DA=f[l],[4,this.renderStack(DA)]):[3,5];case 3:_A.sent(),_A.label=4;case 4:return l++,[3,2];case 5:return[4,this.renderNodeContent(u.element)];case 6:_A.sent(),p=0,C=u.nonInlineLevel,_A.label=7;case 7:return p<C.length?(DA=C[p],[4,this.renderNode(DA)]):[3,10];case 8:_A.sent(),_A.label=9;case 9:return p++,[3,7];case 10:Q=0,E=u.nonPositionedFloats,_A.label=11;case 11:return Q<E.length?(DA=E[Q],[4,this.renderStack(DA)]):[3,14];case 12:_A.sent(),_A.label=13;case 13:return Q++,[3,11];case 14:N=0,K=u.nonPositionedInlineLevel,_A.label=15;case 15:return N<K.length?(DA=K[N],[4,this.renderStack(DA)]):[3,18];case 16:_A.sent(),_A.label=17;case 17:return N++,[3,15];case 18:X=0,j=u.inlineLevel,_A.label=19;case 19:return X<j.length?(DA=j[X],[4,this.renderNode(DA)]):[3,22];case 20:_A.sent(),_A.label=21;case 21:return X++,[3,19];case 22:CA=0,pA=u.zeroOrAutoZIndexOrTransformedOrOpacity,_A.label=23;case 23:return CA<pA.length?(DA=pA[CA],[4,this.renderStack(DA)]):[3,26];case 24:_A.sent(),_A.label=25;case 25:return CA++,[3,23];case 26:wA=0,KA=u.positiveZIndex,_A.label=27;case 27:return wA<KA.length?(DA=KA[wA],[4,this.renderStack(DA)]):[3,30];case 28:_A.sent(),_A.label=29;case 29:return wA++,[3,27];case 30:return[2]}})})},i.prototype.mask=function(u){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(u.slice(0).reverse()),this.ctx.closePath()},i.prototype.path=function(u){this.ctx.beginPath(),this.formatPath(u),this.ctx.closePath()},i.prototype.formatPath=function(u){var l=this;u.forEach(function(f,p){var C=De(f)?f.start:f;p===0?l.ctx.moveTo(C.x,C.y):l.ctx.lineTo(C.x,C.y),De(f)&&l.ctx.bezierCurveTo(f.startControl.x,f.startControl.y,f.endControl.x,f.endControl.y,f.end.x,f.end.y)})},i.prototype.renderRepeat=function(u,l,f,p){this.path(u),this.ctx.fillStyle=l,this.ctx.translate(f,p),this.ctx.fill(),this.ctx.translate(-f,-p)},i.prototype.resizeImage=function(u,l,f){var p;if(u.width===l&&u.height===f)return u;var C=((p=this.canvas.ownerDocument)!==null&&p!==void 0?p:document).createElement("canvas");return C.width=Math.max(1,l),C.height=Math.max(1,f),C.getContext("2d").drawImage(u,0,0,u.width,u.height,0,0,l,f),C},i.prototype.renderBackgroundImage=function(u){return a(this,void 0,void 0,function(){var l,f,p,C,Q,E;return c(this,function(N){switch(N.label){case 0:l=u.styles.backgroundImage.length-1,f=function(K){var X,j,CA,ue,Ee,Fe,qA,pe,zA,pA,ue,Ee,Fe,qA,pe,wA,KA,DA,_A,te,XA,MA,FA,GA,zA,OA,ue,Qe,_e,qA,pe,Ft,Ee,Fe,Mt,Ze,Ut,Ot,Kt,at,Rt,lt;return c(this,function(un){switch(un.label){case 0:if(K.type!==0)return[3,5];X=void 0,j=K.url,un.label=1;case 1:return un.trys.push([1,3,,4]),[4,p.context.cache.match(j)];case 2:return X=un.sent(),[3,4];case 3:return un.sent(),p.context.logger.error("Error loading background-image "+j),[3,4];case 4:return X&&(CA=es(u,l,[X.width,X.height,X.width/X.height]),ue=CA[0],Ee=CA[1],Fe=CA[2],qA=CA[3],pe=CA[4],zA=p.ctx.createPattern(p.resizeImage(X,qA,pe),"repeat"),p.renderRepeat(ue,zA,Ee,Fe)),[3,6];case 5:Ay(K)?(pA=es(u,l,[null,null,null]),ue=pA[0],Ee=pA[1],Fe=pA[2],qA=pA[3],pe=pA[4],wA=YC(K.angle,qA,pe),KA=wA[0],DA=wA[1],_A=wA[2],te=wA[3],XA=wA[4],MA=document.createElement("canvas"),MA.width=qA,MA.height=pe,FA=MA.getContext("2d"),GA=FA.createLinearGradient(DA,te,_A,XA),nc(K.stops,KA).forEach(function(Zn){return GA.addColorStop(Zn.stop,ge(Zn.color))}),FA.fillStyle=GA,FA.fillRect(0,0,qA,pe),qA>0&&pe>0&&(zA=p.ctx.createPattern(MA,"repeat"),p.renderRepeat(ue,zA,Ee,Fe))):ey(K)&&(OA=es(u,l,[null,null,null]),ue=OA[0],Qe=OA[1],_e=OA[2],qA=OA[3],pe=OA[4],Ft=K.position.length===0?[bi]:K.position,Ee=Ae(Ft[0],qA),Fe=Ae(Ft[Ft.length-1],pe),Mt=JC(K,Ee,Fe,qA,pe),Ze=Mt[0],Ut=Mt[1],Ze>0&&Ut>0&&(Ot=p.ctx.createRadialGradient(Qe+Ee,_e+Fe,0,Qe+Ee,_e+Fe,Ze),nc(K.stops,Ze*2).forEach(function(Zn){return Ot.addColorStop(Zn.stop,ge(Zn.color))}),p.path(ue),p.ctx.fillStyle=Ot,Ze!==Ut?(Kt=u.bounds.left+.5*u.bounds.width,at=u.bounds.top+.5*u.bounds.height,Rt=Ut/Ze,lt=1/Rt,p.ctx.save(),p.ctx.translate(Kt,at),p.ctx.transform(1,0,0,Rt,0,0),p.ctx.translate(-Kt,-at),p.ctx.fillRect(Qe,lt*(_e-at)+at,qA,pe*lt),p.ctx.restore()):p.ctx.fill())),un.label=6;case 6:return l--,[2]}})},p=this,C=0,Q=u.styles.backgroundImage.slice(0).reverse(),N.label=1;case 1:return C<Q.length?(E=Q[C],[5,f(E)]):[3,4];case 2:N.sent(),N.label=3;case 3:return C++,[3,1];case 4:return[2]}})})},i.prototype.renderSolidBorder=function(u,l,f){return a(this,void 0,void 0,function(){return c(this,function(p){return this.path(du(f,l)),this.ctx.fillStyle=ge(u),this.ctx.fill(),[2]})})},i.prototype.renderDoubleBorder=function(u,l,f,p){return a(this,void 0,void 0,function(){var C,Q;return c(this,function(E){switch(E.label){case 0:return l<3?[4,this.renderSolidBorder(u,f,p)]:[3,2];case 1:return E.sent(),[2];case 2:return C=jQ(p,f),this.path(C),this.ctx.fillStyle=ge(u),this.ctx.fill(),Q=qQ(p,f),this.path(Q),this.ctx.fill(),[2]}})})},i.prototype.renderNodeBackgroundAndBorders=function(u){return a(this,void 0,void 0,function(){var l,f,p,C,Q,E,N,K,X=this;return c(this,function(j){switch(j.label){case 0:return this.applyEffects(u.getEffects(2)),l=u.container.styles,f=!yt(l.backgroundColor)||l.backgroundImage.length,p=[{style:l.borderTopStyle,color:l.borderTopColor,width:l.borderTopWidth},{style:l.borderRightStyle,color:l.borderRightColor,width:l.borderRightWidth},{style:l.borderBottomStyle,color:l.borderBottomColor,width:l.borderBottomWidth},{style:l.borderLeftStyle,color:l.borderLeftColor,width:l.borderLeftWidth}],C=cE(cn(l.backgroundClip,0),u.curves),f||l.boxShadow.length?(this.ctx.save(),this.path(C),this.ctx.clip(),yt(l.backgroundColor)||(this.ctx.fillStyle=ge(l.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(u.container)]):[3,2];case 1:j.sent(),this.ctx.restore(),l.boxShadow.slice(0).reverse().forEach(function(CA){X.ctx.save();var pA=Co(u.curves),wA=CA.inset?0:sE,KA=JQ(pA,-wA+(CA.inset?1:-1)*CA.spread.number,(CA.inset?1:-1)*CA.spread.number,CA.spread.number*(CA.inset?-2:2),CA.spread.number*(CA.inset?-2:2));CA.inset?(X.path(pA),X.ctx.clip(),X.mask(KA)):(X.mask(pA),X.ctx.clip(),X.path(KA)),X.ctx.shadowOffsetX=CA.offsetX.number+wA,X.ctx.shadowOffsetY=CA.offsetY.number,X.ctx.shadowColor=ge(CA.color),X.ctx.shadowBlur=CA.blur.number,X.ctx.fillStyle=CA.inset?ge(CA.color):"rgba(0,0,0,1)",X.ctx.fill(),X.ctx.restore()}),j.label=2;case 2:Q=0,E=0,N=p,j.label=3;case 3:return E<N.length?(K=N[E],K.style!==0&&!yt(K.color)&&K.width>0?K.style!==2?[3,5]:[4,this.renderDashedDottedBorder(K.color,K.width,Q,u.curves,2)]:[3,11]):[3,13];case 4:return j.sent(),[3,11];case 5:return K.style!==3?[3,7]:[4,this.renderDashedDottedBorder(K.color,K.width,Q,u.curves,3)];case 6:return j.sent(),[3,11];case 7:return K.style!==4?[3,9]:[4,this.renderDoubleBorder(K.color,K.width,Q,u.curves)];case 8:return j.sent(),[3,11];case 9:return[4,this.renderSolidBorder(K.color,Q,u.curves)];case 10:j.sent(),j.label=11;case 11:Q++,j.label=12;case 12:return E++,[3,3];case 13:return[2]}})})},i.prototype.renderDashedDottedBorder=function(u,l,f,p,C){return a(this,void 0,void 0,function(){var Q,E,N,K,X,j,CA,pA,wA,KA,DA,_A,te,XA,MA,FA,MA,FA;return c(this,function(GA){return this.ctx.save(),Q=AE(p,f),E=du(p,f),C===2&&(this.path(E),this.ctx.clip()),De(E[0])?(N=E[0].start.x,K=E[0].start.y):(N=E[0].x,K=E[0].y),De(E[1])?(X=E[1].end.x,j=E[1].end.y):(X=E[1].x,j=E[1].y),f===0||f===2?CA=Math.abs(N-X):CA=Math.abs(K-j),this.ctx.beginPath(),C===3?this.formatPath(Q):this.formatPath(E.slice(0,2)),pA=l<3?l*3:l*2,wA=l<3?l*2:l,C===3&&(pA=l,wA=l),KA=!0,CA<=pA*2?KA=!1:CA<=pA*2+wA?(DA=CA/(2*pA+wA),pA*=DA,wA*=DA):(_A=Math.floor((CA+wA)/(pA+wA)),te=(CA-_A*pA)/(_A-1),XA=(CA-(_A+1)*pA)/_A,wA=XA<=0||Math.abs(wA-te)<Math.abs(wA-XA)?te:XA),KA&&(C===3?this.ctx.setLineDash([0,pA+wA]):this.ctx.setLineDash([pA,wA])),C===3?(this.ctx.lineCap="round",this.ctx.lineWidth=l):this.ctx.lineWidth=l*2+1.1,this.ctx.strokeStyle=ge(u),this.ctx.stroke(),this.ctx.setLineDash([]),C===2&&(De(E[0])&&(MA=E[3],FA=E[0],this.ctx.beginPath(),this.formatPath([new QA(MA.end.x,MA.end.y),new QA(FA.start.x,FA.start.y)]),this.ctx.stroke()),De(E[1])&&(MA=E[1],FA=E[2],this.ctx.beginPath(),this.formatPath([new QA(MA.end.x,MA.end.y),new QA(FA.start.x,FA.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},i.prototype.render=function(u){return a(this,void 0,void 0,function(){var l;return c(this,function(f){switch(f.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ge(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),l=ZQ(u),[4,this.renderStack(l)];case 1:return f.sent(),this.applyEffects([]),[2,this.canvas]}})})},i})(hu),lE=function(s){return s instanceof Oc||s instanceof Mc?!0:s instanceof Gi&&s.type!==go&&s.type!==fo},cE=function(s,i){switch(s){case 0:return Co(i);case 2:return zQ(i);default:return yo(i)}},uE=function(s){switch(s){case 1:return"center";case 2:return"right";default:return"left"}},dE=["-apple-system","system-ui"],fE=function(s){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?s.filter(function(i){return dE.indexOf(i)===-1}):s},gE=(function(s){n(i,s);function i(u,l){var f=s.call(this,u,l)||this;return f.canvas=l.canvas?l.canvas:document.createElement("canvas"),f.ctx=f.canvas.getContext("2d"),f.options=l,f.canvas.width=Math.floor(l.width*l.scale),f.canvas.height=Math.floor(l.height*l.scale),f.canvas.style.width=l.width+"px",f.canvas.style.height=l.height+"px",f.ctx.scale(f.options.scale,f.options.scale),f.ctx.translate(-l.x,-l.y),f.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+l.width+"x"+l.height+" at "+l.x+","+l.y+") with scale "+l.scale),f}return i.prototype.render=function(u){return a(this,void 0,void 0,function(){var l,f;return c(this,function(p){switch(p.label){case 0:return l=Ri(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,u),[4,hE(l)];case 1:return f=p.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ge(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(f,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},i})(hu),hE=function(s){return new Promise(function(i,u){var l=new Image;l.onload=function(){i(l)},l.onerror=u,l.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(s))})},BE=(function(){function s(i){var u=i.id,l=i.enabled;this.id=u,this.enabled=l,this.start=Date.now()}return s.prototype.debug=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,d([this.id,this.getTime()+"ms"],i)):this.info.apply(this,i))},s.prototype.getTime=function(){return Date.now()-this.start},s.prototype.info=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,d([this.id,this.getTime()+"ms"],i))},s.prototype.warn=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,d([this.id,this.getTime()+"ms"],i)):this.info.apply(this,i))},s.prototype.error=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,d([this.id,this.getTime()+"ms"],i)):this.info.apply(this,i))},s.instances={},s})(),pE=(function(){function s(i,u){var l;this.windowBounds=u,this.instanceName="#"+s.instanceCount++,this.logger=new BE({id:this.instanceName,enabled:i.logging}),this.cache=(l=i.cache)!==null&&l!==void 0?l:new kQ(this,i)}return s.instanceCount=1,s})(),mE=function(s,i){return i===void 0&&(i={}),wE(s,i)};typeof window<"u"&&iu.setContext(window);var wE=function(s,i){return a(void 0,void 0,void 0,function(){var u,l,f,p,C,Q,E,N,K,X,j,CA,pA,wA,KA,DA,_A,te,XA,MA,GA,FA,GA,zA,OA,ue,Qe,_e,qA,pe,Ft,Ee,Fe,Mt,Ze,Ut,Ot,Kt,at,Rt;return c(this,function(lt){switch(lt.label){case 0:if(!s||typeof s!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(u=s.ownerDocument,!u)throw new Error("Element is not attached to a Document");if(l=u.defaultView,!l)throw new Error("Document is not attached to a Window");return f={allowTaint:(zA=i.allowTaint)!==null&&zA!==void 0?zA:!1,imageTimeout:(OA=i.imageTimeout)!==null&&OA!==void 0?OA:15e3,proxy:i.proxy,useCORS:(ue=i.useCORS)!==null&&ue!==void 0?ue:!1},p=o({logging:(Qe=i.logging)!==null&&Qe!==void 0?Qe:!0,cache:i.cache},f),C={windowWidth:(_e=i.windowWidth)!==null&&_e!==void 0?_e:l.innerWidth,windowHeight:(qA=i.windowHeight)!==null&&qA!==void 0?qA:l.innerHeight,scrollX:(pe=i.scrollX)!==null&&pe!==void 0?pe:l.pageXOffset,scrollY:(Ft=i.scrollY)!==null&&Ft!==void 0?Ft:l.pageYOffset},Q=new h(C.scrollX,C.scrollY,C.windowWidth,C.windowHeight),E=new pE(p,Q),N=(Ee=i.foreignObjectRendering)!==null&&Ee!==void 0?Ee:!1,K={allowTaint:(Fe=i.allowTaint)!==null&&Fe!==void 0?Fe:!1,onclone:i.onclone,ignoreElements:i.ignoreElements,inlineImages:N,copyStyles:N},E.logger.debug("Starting document clone with size "+Q.width+"x"+Q.height+" scrolled to "+-Q.left+","+-Q.top),X=new ru(E,s,K),j=X.clonedReferenceElement,j?[4,X.toIFrame(u,Q)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return CA=lt.sent(),pA=$i(j)||CQ(j)?B(j.ownerDocument):g(E,j),wA=pA.width,KA=pA.height,DA=pA.left,_A=pA.top,te=CE(E,j,i.backgroundColor),XA={canvas:i.canvas,backgroundColor:te,scale:(Ze=(Mt=i.scale)!==null&&Mt!==void 0?Mt:l.devicePixelRatio)!==null&&Ze!==void 0?Ze:1,x:((Ut=i.x)!==null&&Ut!==void 0?Ut:0)+DA,y:((Ot=i.y)!==null&&Ot!==void 0?Ot:0)+_A,width:(Kt=i.width)!==null&&Kt!==void 0?Kt:Math.ceil(wA),height:(at=i.height)!==null&&at!==void 0?at:Math.ceil(KA)},N?(E.logger.debug("Document cloned, using foreign object rendering"),GA=new gE(E,XA),[4,GA.render(j)]):[3,3];case 2:return MA=lt.sent(),[3,5];case 3:return E.logger.debug("Document cloned, element located at "+DA+","+_A+" with size "+wA+"x"+KA+" using computed rendering"),E.logger.debug("Starting DOM parsing"),FA=Vc(E,j),te===FA.styles.backgroundColor&&(FA.styles.backgroundColor=it.TRANSPARENT),E.logger.debug("Starting renderer for element at "+XA.x+","+XA.y+" with size "+XA.width+"x"+XA.height),GA=new aE(E,XA),[4,GA.render(FA)];case 4:MA=lt.sent(),lt.label=5;case 5:return(!((Rt=i.removeContainer)!==null&&Rt!==void 0)||Rt)&&(ru.destroy(CA)||E.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),E.logger.debug("Finished rendering"),[2,MA]}})})},CE=function(s,i,u){var l=i.ownerDocument,f=l.documentElement?Gn(s,getComputedStyle(l.documentElement).backgroundColor):it.TRANSPARENT,p=l.body?Gn(s,getComputedStyle(l.body).backgroundColor):it.TRANSPARENT,C=typeof u=="string"?Gn(s,u):u===null?it.TRANSPARENT:4294967295;return i===l.documentElement?yt(f)?yt(p)?C:p:f:C};return mE}))})),A0=rs(qw(),1),e0=(0,r.defineComponent)({name:"DBiDesignContainer",__name:"biDesignContainer",props:{layout:{type:Array,default:()=>[]},indexPage:{type:Object,default:()=>({})},activedComponent:{type:Object,default:()=>({})},scale:{type:Number,default:1}},emits:["select","move"],setup(e,{emit:A}){const t=e,n=A,{apiUrl:o,token:a}=(0,Te.useAppInject)(),c=(0,r.computed)(()=>{const B={transform:`scale(${t.scale}, ${t.scale})`,transformOrigin:"left top",position:"relative",width:WA(t.indexPage.config.w||1920),height:WA(t.indexPage.config.h||1080),backgroundColor:t.indexPage.config.backgroundColor||"var(--color-bg-container)"};return t.indexPage.config.backgroundImage&&(B.background=`url(${o}/system/annexesfile/${t.indexPage.config.backgroundImage}?token=${a?.value}) 0% 0% / 100% 100% ${t.indexPage.config.backgroundColor||"var(--color-bg-container)"}`),B}),d=B=>{n("select",B)},h=B=>{n("move",B)},g=B=>{B?.target?.getAttribute("id")==="j-bi-design-container"&&n("select",t.indexPage)};return(B,w)=>{const m=(0,r.resolveComponent)("d-draggable");return(0,r.openBlock)(),(0,r.createElementBlock)("div",{onClick:(0,r.withModifiers)(g,["stop"]),id:"j-bi-design-container",style:(0,r.normalizeStyle)(c.value)},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.layout,(y,v)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:y.id},[y.display?((0,r.openBlock)(),(0,r.createBlock)(m,{key:0,id:y.id,left:y.config.x,top:y.config.y,width:y.config.w,height:y.config.h,scale:1/e.scale,step:1/e.scale,"active-flag":y.id==e.activedComponent.id,readonly:y.lock,"data-id":y.id,onFocus:I=>d(y),onBlur:h,"z-index":e.layout.length-v,"is-active-bg-transparent":!0},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(y.componentName),(0,r.mergeProps)({style:{width:(0,r.unref)(WA)(y.config.w),height:(0,r.unref)(WA)(y.config.h)}},{ref_for:!0},y.config,{"is-design":!0}),null,16,["style"]))]),_:2},1032,["id","left","top","width","height","scale","step","active-flag","readonly","data-id","onFocus","z-index"])):(0,r.createCommentVNode)("",!0)],64))),128))],4)}}}),El=e0,t0={class:"j-bi-design"},n0={class:"j-bi-design-left"},r0={style:{padding:"0 4px"}},o0=["onClick"],i0={class:"j-bi-design-left2"},s0={key:0,class:"j-block",style:{"padding-top":"28px"}},a0={class:"search-input-wraper"},l0=["onClick","data-id"],c0={class:"j-bi-design-layer-item-img"},u0=["src"],d0={class:"j-bi-design-layer-item-btns"},f0=["onClick"],g0=["onClick"],h0=["onClick"],B0=["onDragend"],p0={class:"component-item2-text"},m0=["src"],w0={class:"j-bi-design-right"},C0={class:"j-bi-design-title"},y0={class:"j-bi-design-panel"},v0=(0,r.defineComponent)({name:"DBiDesign",__name:"biDesign",props:{components:{type:Array,default:()=>[]},componentConfigs:{type:Object,default:()=>({})},componentInit:Function,componentConfigInit:Function,componentConfigChange:Function,imgUrlPrefix:{type:String,default:"/"},scale:{type:Number,default:-1}},emits:["update:scale"],setup(e,{expose:A,emit:t}){const{t:n}=(0,Te.useAppInject)(),o=e,a=t,c=(0,r.ref)({name:"页面",id:"indexPage",type:"indexPage",layerId:"0",config:{},display:!0,lock:!1,componentName:""});o.componentInit&&(c.value.config=o.componentInit("indexPage")||{},c.value.config.id="indexPage");const d=(0,r.computed)(()=>{const sA={};return o.components.forEach(gA=>{gA.children.forEach(TA=>{sA[TA.type]=TA})}),sA}),h=(0,r.ref)(0),g=(0,r.ref)(),B=(0,r.ref)([]),w=(0,r.ref)(!1),m=(0,r.ref)(0),y=(0,r.ref)(0),v=(0,r.ref)(""),I=(0,r.computed)(()=>v.value===""?{}:B.value.find(sA=>sA.id===v.value)),L=()=>{w.value=!1,v.value=""},k=sA=>{sA.target.className.indexOf("j-bi-design-contentmenu__btn")===-1&&L(),window.removeEventListener("mousedown",k)},V=sA=>{let{target:gA}=sA,TA=!1;gA.className.indexOf&&gA.className.indexOf("d-draggable__mask")>-1?(gA=gA.parentNode.parentNode,TA=!0):gA.className.indexOf&&gA.className.indexOf("j-bi-design-layer-item")>-1?TA=!0:gA.parentNode.className.indexOf&&gA.parentNode.className.indexOf("j-bi-design-layer-item")>-1?(gA=gA.parentNode,TA=!0):gA.parentNode.parentNode.className.indexOf("j-bi-design-layer-item")>-1&&(gA=gA.parentNode.parentNode,TA=!0),TA&&(sA.preventDefault(),sA.stopPropagation(),m.value=sA.clientX,y.value=sA.clientY-8,y.value+260>document.body.clientHeight&&(y.value=document.body.clientHeight-260),v.value=gA.getAttribute("data-id"),w.value=!0,window.addEventListener("mousedown",k))},F=(0,r.ref)(""),M=(0,r.computed)(()=>F.value?B.value.filter(sA=>sA.config.label.indexOf(F.value)>-1):B.value),tA=sA=>{sA.display=!sA.display,L()},W=sA=>{sA.lock=!sA.lock,L(),sA.lock&&sA.id===g.value?.id&&iA(c.value)},aA=(sA,gA)=>{if(!gA||B.value.length<1){L();return}const TA=B.value.findIndex(kA=>kA.id===gA.id);switch(sA){case"up":if(TA===-1||TA===0)break;B.value=dA(B.value,TA,TA-1);break;case"down":if(TA===-1||TA===B.value.length-1)break;B.value=dA(B.value,TA,TA+1);break;case"top":if(TA!==-1){const[kA]=B.value.splice(TA,1);B.value.unshift(kA)}break;case"bottom":if(TA!==-1){const[kA]=B.value.splice(TA,1);B.value.push(kA)}break}L()},dA=(sA,gA,TA)=>{const kA=sA[gA];return sA[gA]=sA[TA],sA[TA]=kA,sA},rA=(0,r.ref)(),oA=(0,r.ref)(20),AA=(0,r.ref)(document.body.clientWidth),O=(0,r.ref)(document.body.clientHeight),lA=(0,r.ref)(0),_=(0,r.ref)(0),Z=(0,r.ref)({bgColor:"rgba(225,225,225, 0)",longfgColor:"rgba(0, 0, 0, 0.45)",shortfgColor:"rgba(0, 0, 0, 0.45)",fontColor:"rgba(0, 0, 0, 0.65)",shadowColor:"rgba(225,225,225, 0)",lineColor:"var(--color-primary)",borderColor:"#d9d9d9",cornerActiveColor:"var(--color-primary)"}),U=(0,r.computed)(()=>({x:0,y:0,width:AA.value,height:O.value})),x=(0,r.ref)({h:[],v:[]}),G=(0,r.ref)(),R=(0,r.ref)(),$=(0,r.ref)(!1),J=(0,r.ref)({}),nA=(0,r.ref)(100),BA=(0,r.computed)({set(sA){nA.value=sA,a("update:scale",sA)},get(){let{scale:sA}=o;return sA===-1&&(sA=nA.value),sA/100}}),UA=(0,r.computed)(()=>(c.value.config.h||1080)*2),eA=(0,r.computed)(()=>(c.value.config.w||1920)*2),uA=()=>{rA.value&&(AA.value=rA.value.offsetWidth-oA.value,O.value=rA.value.offsetHeight-oA.value,G.value.scrollLeft=eA.value/2-oA.value,G.value.scrollTop=UA.value/2-oA.value,Y())},Y=()=>{const sA=c.value.config.w||1920;AA.value<sA&&(BA.value=AA.value*100/sA)},cA=()=>{document.onkeydown=sA=>{if(sA.target?.nodeName==="TEXTAREA"||sA.target?.nodeName==="INPUT")return;const gA=sA.keyCode||sA.which;gA===32&&(sA.preventDefault(),J.value.space=!0),gA===17&&(sA.preventDefault(),J.value.ctrl=!0)},document.onkeyup=()=>{J.value={}}},mA=sA=>{J.value.space&&($.value=!0,window.stardragEvent=sA,window.startSlideX=G.value.scrollLeft,window.startSlideY=G.value.scrollTop,document.onmousemove=gA=>{if($.value){const TA=gA.clientX-window.stardragEvent.clientX,kA=gA.clientY-window.stardragEvent.clientY;G.value.scrollLeft=window.startSlideX-TA,G.value.scrollTop=window.startSlideY-kA}},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,$.value=!1})},yA=()=>{const sA=G.value.getBoundingClientRect(),gA=R.value.getBoundingClientRect(),TA=BA.value,kA=(sA.left+oA.value-gA.left)/TA,Nt=(sA.top+oA.value-gA.top)/TA;lA.value=kA>>0,_.value=Nt>>0},IA=sA=>{if(sA.preventDefault(),sA.ctrlKey||sA.metaKey){const gA=BA.value;BA.value=parseFloat(Math.max(.2,gA-sA.deltaY/500).toFixed(2))*100,gA!==BA.value&&(0,r.nextTick)(()=>{yA()})}},fA=(0,r.ref)(),vA=(0,r.computed)(()=>g.value?`【${g.value.name}】`:""),S={};Object.keys(o.componentConfigs).forEach(sA=>{const gA=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],TA=[{id:"w",type:"j-number",config:{label:"宽度",min:0}},{id:"h",type:"j-number",config:{label:"高度",min:0}},{id:"x",type:"j-number",config:{label:"x轴",min:0}},{id:"y",type:"j-number",config:{label:"y轴",min:0}}],kA={type:"j-collapse",config:{defaultValue:[]},children:[]};sA!=="indexPage"&&kA.children?.push({config:{label:"基础信息"},children:[...gA]}),kA.children?.push(...o.componentConfigs[sA]),sA!=="indexPage"?(kA.children?.push({config:{label:"大小定位"},children:[...TA]}),kA.config?.defaultValue.push("_collapse0","_collapse1")):kA.children&&kA.children.length>0&&kA.config?.defaultValue.push("_collapse0"),S[sA]=[kA]});const H=()=>{if(g.value){const sA=S[g.value.type];sA?fA.value.init(sA,g.value.config):fA.value.init([]),o.componentConfigInit&&o.componentConfigInit(g.value.type,{configRef:fA,components:B.value,configData:g.value.config})}else fA.value.init([])},T=(sA,gA)=>{g.value&&o.componentConfigChange&&(g.value.id==="indexPage"&&(sA.id==="w"||sA.id==="h")&&(0,r.nextTick)(()=>{uA()}),o.componentConfigChange(g.value.type,{configRef:fA,component:sA,configData:g.value.config,...gA}))},D=sA=>o.componentInit?o.componentInit(sA)||{}:{},b=(sA,gA,TA)=>{const kA={name:sA.name,id:ut(),type:sA.type,layerId:"0",config:D(sA.type),display:!0,lock:!1,componentName:sA.componentName};kA.config.id=kA.id,kA.config.label=sA.name,kA.config.h=sA.h||100,kA.config.w=sA.w||100,kA.config.x=gA,kA.config.y=TA,B.value.unshift(kA),g.value=kA,H()},z=(sA,gA)=>{const TA=document.getElementById("j-bi-design-container").getBoundingClientRect(),kA=sA.clientX-TA.left,Nt=sA.clientY-TA.top;b(gA,kA/BA.value-gA.w/2,Nt/BA.value-gA.h/2)},P=sA=>{B.value=B.value.filter(gA=>gA.id!==sA),g.value.id===sA&&(g.value=c.value,H()),L()},hA=sA=>{const gA=gn(sA),TA=ut();gA.id=TA,gA.config.id=TA,B.value.push(gA),g.value=gA,H(),L()},iA=sA=>{g.value?.id!==sA.id&&(g.value=sA,H())},SA=({left:sA,top:gA,width:TA,height:kA})=>{g.value&&(g.value.config.x=sA,g.value.config.y=gA,g.value.config.w=TA,g.value.config.h=kA,fA.value.setFormData({main:{x:sA,y:gA,w:TA,h:kA}}))},xA=new ResizeObserver(uA);return(0,r.onMounted)(()=>{xA.observe(rA.value),cA(),iA(c.value)}),A({clearData:()=>{B.value=[],iA(c.value)},setData:sA=>{sA.components?.forEach(gA=>{gA.componentName=d.value[gA.type].componentName}),B.value=sA.components||[],c.value=sA.page||c.value,iA(c.value)},getData:()=>({ver:"1.0.0",components:gn(B.value),page:c.value}),getImg:()=>new Promise(sA=>{(0,A0.default)(R.value,{useCORS:!0,backgroundColor:null,allowTaint:!0}).then(gA=>{if(gA.width!==0&&gA.height!==0){sA(gA.toDataURL("image/png"));return}sA("")})})}),(sA,gA)=>{const TA=(0,r.resolveComponent)("el-divider"),kA=(0,r.resolveComponent)("j-icon"),Nt=(0,r.resolveComponent)("el-button"),qt=(0,r.resolveComponent)("el-input"),Bt=(0,r.resolveComponent)("el-text"),Ln=(0,r.resolveComponent)("el-space"),Tn=(0,r.resolveComponent)("j-form");return(0,r.openBlock)(),(0,r.createElementBlock)("div",t0,[w.value?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:"j-bi-design-contentmenu",style:(0,r.normalizeStyle)({left:m.value+"px",top:y.value+"px"})},[(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[0]||(gA[0]=$A=>hA(I.value))},(0,r.toDisplayString)((0,r.unref)(n)("复制")),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[1]||(gA[1]=$A=>tA(I.value))},(0,r.toDisplayString)(I.value&&I.value.display?"隐藏":"显示"),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[2]||(gA[2]=$A=>W(I.value))},(0,r.toDisplayString)(I.value&&I.value.lock?"解锁":"锁定"),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[3]||(gA[3]=$A=>aA("top",I.value))},(0,r.toDisplayString)((0,r.unref)(n)("置顶图层")),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[4]||(gA[4]=$A=>aA("bottom",I.value))},(0,r.toDisplayString)((0,r.unref)(n)("置底图层")),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[5]||(gA[5]=$A=>aA("up",I.value))},(0,r.toDisplayString)((0,r.unref)(n)("上移一层")),1),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",onClick:gA[6]||(gA[6]=$A=>aA("down",I.value))},(0,r.toDisplayString)((0,r.unref)(n)("下移一层")),1),(0,r.createVNode)(TA,{style:{margin:"4px 0"}}),(0,r.createElementVNode)("div",{class:"item j-bi-design-contentmenu__btn",style:{color:"var(--color-error)"},onClick:gA[7]||(gA[7]=$A=>P(I.value?.id))},(0,r.toDisplayString)((0,r.unref)(n)("删除")),1)],4)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",n0,[(0,r.createElementVNode)("div",{onClick:gA[8]||(gA[8]=(0,r.withModifiers)($A=>h.value=-1,["stop"])),class:(0,r.normalizeClass)(["component-item",{active:h.value==-1}])},[(0,r.createVNode)(kA,{size:24,icon:"mdi:bookmark-box-multiple-outline"}),(0,r.createElementVNode)("span",null,(0,r.toDisplayString)((0,r.unref)(n)("图层")),1)],2),(0,r.createElementVNode)("div",r0,[(0,r.createVNode)(TA)]),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.components,($A,He)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:He,onClick:(0,r.withModifiers)(Xe=>h.value=He,["stop"]),class:(0,r.normalizeClass)(["component-item",{active:h.value==He}])},[(0,r.createVNode)(kA,{size:24,icon:$A.icon},null,8,["icon"]),(0,r.createElementVNode)("span",null,(0,r.toDisplayString)((0,r.unref)(n)($A.name)),1)],10,o0))),128))]),(0,r.createElementVNode)("div",i0,[h.value==-1?((0,r.openBlock)(),(0,r.createElementBlock)("div",s0,[(0,r.createElementVNode)("div",a0,[(0,r.createVNode)(qt,{modelValue:F.value,"onUpdate:modelValue":gA[9]||(gA[9]=$A=>F.value=$A),class:"search-input",placeholder:"搜索图层"},{append:(0,r.withCtx)(()=>[(0,r.createVNode)(Nt,null,{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(kA,{icon:"ep:search"})]),_:1})]),_:1},8,["modelValue"])]),(0,r.createElementVNode)("div",{class:"j-block",style:{"padding-top":"8px",overflow:"auto"},onContextmenu:(0,r.withModifiers)(V,["prevent"])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(M.value,($A,He)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:He},[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["j-bi-design-layer-item",{active:g.value.id==$A.id}]),onClick:(0,r.withModifiers)(Xe=>iA($A),["stop"]),"data-id":$A.id},[(0,r.createElementVNode)("div",c0,[(0,r.createElementVNode)("img",{style:{height:"100%"},src:`${e.imgUrlPrefix}${d.value[$A.type].img}`},null,8,u0)]),(0,r.createVNode)(Bt,{ellipsis:""},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)((0,r.unref)(n)($A.config.label)),1)]),_:2},1024),(0,r.createElementVNode)("div",d0,[(0,r.createVNode)(Ln,{size:2},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["j-bi-design-layer-item-btn",{active:!$A.display}]),onClick:(0,r.withModifiers)(Xe=>tA($A),["stop"])},[(0,r.createVNode)(kA,{icon:"mdi:eye-off-outline"})],10,f0),(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["j-bi-design-layer-item-btn",{active:$A.lock}]),onClick:(0,r.withModifiers)(Xe=>W($A),["stop"])},[(0,r.createVNode)(kA,{icon:"mdi:lock-outline"})],10,g0)]),_:2},1024)])],10,l0)]))),128))],32)])):e.components[h.value]?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.components[h.value].children,($A,He)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:He,onClick:Xe=>b($A,0,0)},[(0,r.createElementVNode)("div",{class:"component-item2",onDragend:Xe=>z(Xe,$A),draggable:"true"},[(0,r.createElementVNode)("div",p0,[(0,r.createVNode)(Bt,{ellipsis:""},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)((0,r.unref)(n)($A.name)),1)]),_:2},1024)]),(0,r.createElementVNode)("img",{class:"component-item2-img",src:`${e.imgUrlPrefix}${$A.img}`},null,8,m0)],40,B0)],8,h0))),128)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",{class:"j-bi-design-mid",ref_key:"contentRef",ref:rA},[((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(jw),{key:BA.value,thick:oA.value,scale:BA.value,width:AA.value,height:O.value,"start-x":lA.value,"start-y":_.value,palette:Z.value,shadow:U.value,"hor-line-arr":x.value.h,"ver-line-arr":x.value.v},null,8,["thick","scale","width","height","start-x","start-y","palette","shadow","hor-line-arr","ver-line-arr"])),(0,r.createElementVNode)("div",{ref_key:"screensRef",ref:G,class:"j-bi-design-main",style:(0,r.normalizeStyle)({cursor:$.value?"pointer":""}),onMousedown:(0,r.withModifiers)(mA,["stop"]),onWheel:IA,onScroll:yA},[(0,r.createElementVNode)("div",{class:"screen-container",style:(0,r.normalizeStyle)({height:UA.value+"px",width:eA.value+"px"}),onClick:gA[10]||(gA[10]=(0,r.withModifiers)($A=>iA(c.value),["stop"]))},[(0,r.createElementVNode)("div",{ref_key:"canvasRef",ref:R,class:"canvas",onContextmenu:(0,r.withModifiers)(V,["prevent"])},[(0,r.createVNode)(El,{layout:B.value,"index-page":c.value,"actived-component":g.value,scale:BA.value,onSelect:iA,onMove:SA},null,8,["layout","index-page","actived-component","scale"])],544)],4)],36)],512),(0,r.createElementVNode)("div",w0,[(0,r.createElementVNode)("div",C0,[(0,r.createVNode)(Bt,{ellipsis:"",style:{margin:"0","font-size":"14px"}},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(`${(0,r.unref)(n)("属性配置")}${vA.value} `),1)]),_:1})]),(0,r.createElementVNode)("div",y0,[(0,r.createVNode)(Tn,{config:{labelPosition:"top",size:"small"},style:{padding:"0"},ref_key:"configRef",ref:fA,onChange:T},null,512)])])])}}}),Q0=v0,E0=(0,r.defineComponent)({name:"DBiViewer",__name:"biViewer",props:{layout:{type:Array,default:()=>[]},indexPage:{type:Object,default:()=>({})}},setup(e){const A=e,{apiUrl:t,token:n,httpGet:o,httpPost:a}=(0,Te.useAppInject)(),c=(0,r.computed)(()=>A.layout),d=(0,r.ref)(),h=(0,r.ref)(1),g=(0,r.ref)(1),B=()=>{d.value&&w(d.value.offsetWidth,d.value.offsetHeight)},w=(F,M)=>{const tA=A.indexPage.config?.w||1920,W=A.indexPage.config?.h||1080,aA=A.indexPage.config?.screenFit||"1";aA==="1"?(g.value=F/tA,h.value=g.value):aA==="2"?(h.value=M/W,g.value=h.value):aA==="3"&&(g.value=F/tA,h.value=M/W)},m=(0,r.computed)(()=>{const F={transform:`scale(${g.value}, ${h.value})`,transformOrigin:"left top",position:"relative",overflow:"hidden",width:WA(A.indexPage.config?.w||1920),height:WA(A.indexPage.config?.h||1080),backgroundColor:A.indexPage.config?.backgroundColor||"var(--color-bg-container)"};return A.indexPage.config?.backgroundImage&&(F.background=`url(${t}/system/annexesfile/${A.indexPage.config?.backgroundImage}?token=${n?.value}) 0% 0% / 100% 100% ${A.indexPage.config?.backgroundColor||"var(--color-bg-container)"}`),F}),y=(0,r.computed)(()=>({width:WA((A.indexPage.config?.w||1920)*g.value),height:WA((A.indexPage.config?.h||1080)*h.value)})),v={},I=(F,M)=>{F&&(v[M]=F)},L=new ResizeObserver(B);(0,r.onMounted)(()=>{L.observe(d.value)});const k=(F,M)=>{V(M,{params:F})},V=async(F,M)=>{if(F&&F.trim()){F=`async (jcode) => {${F}}`;const{res:tA,msg:W,fn:aA}=(0,Te.getFunction)(F)}};return(0,r.provide)("jcode_bi_viewer",{executeEvent:V}),(F,M)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{class:"j-block",style:(0,r.normalizeStyle)({"overflow-y":!e.indexPage.config?.screenFit||e.indexPage.config?.screenFit=="1"?"auto":"hidden","overflow-x":e.indexPage.config?.screenFit=="2"?"auto":"hidden"}),ref_key:"biViewer",ref:d},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)(y.value)},[(0,r.createElementVNode)("div",{style:(0,r.normalizeStyle)(m.value)},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(c.value,(tA,W)=>(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(tA.componentName),(0,r.mergeProps)({key:tA.id,ref_for:!0,ref:aA=>I(aA,tA.id),style:{position:"absolute",width:(0,r.unref)(WA)(tA.config.w),height:(0,r.unref)(WA)(tA.config.h),top:(0,r.unref)(WA)(tA.config.y),left:(0,r.unref)(WA)(tA.config.x),zIndex:e.layout.length-W}},{ref_for:!0},tA.config,{onClick:aA=>k(aA,tA.config.clickevent)}),null,16,["style","onClick"])),[[r.vShow,tA.display!==!1]])),128))],4)],4)],4))}}),F0=E0,Fl=ct(Q0,[El,F0]),U0=[as,Ho,_o,So,xo,nl,rl,ul,dl,ml,vl,Fl],Ul=new WeakSet,b0=e=>{Ul.has(e)||(Ul.add(e),U0.forEach(A=>{const t=A.name;t&&e.component(t,A)}))},I0={install:b0};re.DBiDesign=Fl,re.DDrag=as,re.DDraggable=dl,re.DFlowDesign=nl,re.DFormDesign=ml,re.DIndexDesign=vl,re.DInputFlow=rl,re.DLayout=ul,re.default=I0,re.dragContainer=_o,re.dragFormList=So,re.dragIndexList=xo,re.dragTool=Ho,re.toFormDesignSchema=gl,re.toFormSaveSchema=Or,re.toFormSchema=fl});