vue-pure-admin/static/js/vue-flow-core-0_9JjJbq.js

27 lines
157 KiB
JavaScript

var Ir=Object.defineProperty,Tr=Object.defineProperties;var kr=Object.getOwnPropertyDescriptors;var Gt=Object.getOwnPropertySymbols;var xo=Object.prototype.hasOwnProperty,bo=Object.prototype.propertyIsEnumerable;var ft=Math.pow,wo=(e,t,n)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))xo.call(t,n)&&wo(e,n,t[n]);if(Gt)for(var n of Gt(t))bo.call(t,n)&&wo(e,n,t[n]);return e},de=(e,t)=>Tr(e,kr(t));var ht=(e,t)=>{var n={};for(var o in e)xo.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Gt)for(var o of Gt(e))t.indexOf(o)<0&&bo.call(e,o)&&(n[o]=e[o]);return n};var Eo=(e,t,n)=>new Promise((o,i)=>{var r=l=>{try{a(n.next(l))}catch(u){i(u)}},s=l=>{try{a(n.throw(l))}catch(u){i(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,s);a((n=n.apply(e,t)).next())});import{d as xe,b9 as gi,bc as St,eN as vi,n as ve,p as se,k as ye,e as he,M as Xe,s as Ue,u as te,v as yt,P as le,a as we,dx as Pr,g as st,i as Oe,b as at,a4 as pi,F as ze,L as be,T as $r,eO as Dr,m as je,a$ as Ar,o as Or,f as Ye,w as Yn,Z as Nt,r as zr,ba as jt,U as Br,j as Vr,t as Fn,Y as Rr,l as so,x as Ge,y as mi,eP as Hr,K as an,aE as ao,b6 as Lr,eQ as Yr,bd as _t,h as yi,J as me,a1 as en,eR as Fr}from"./index-CVG9UGE1.js";function At(e){return gi()?(jt(e),!0):!1}function Le(e){return typeof e=="function"?e():te(e)}const Gr=typeof window!="undefined"&&typeof document!="undefined",Xr=e=>typeof e!="undefined",Ur=Object.prototype.toString,Zr=e=>Ur.call(e)==="[object Object]",Wr=()=>{};function Kr(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const _i=e=>e();function qr(e=_i){const t=we(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Fr(t),pause:n,resume:o,eventFilter:i}}function So(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Jr(e,t,n={}){const r=n,{eventFilter:o=_i}=r,i=ht(r,["eventFilter"]);return ve(e,Kr(o,t),i)}function gt(e,t,n={}){const c=n,{eventFilter:o}=c,i=ht(c,["eventFilter"]),{eventFilter:r,pause:s,resume:a,isActive:l}=qr(o);return{stop:Jr(e,t,de($({},i),{eventFilter:r})),pause:s,resume:a,isActive:l}}function Qr(e,t={}){if(!ao(e))return Lr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Yr(()=>({get(){return e.value[o]},set(i){var r;if((r=Le(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a=de($({},e.value),{[o]:i});Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Gn(e,t=!1){function n(d,{flush:h="sync",deep:p=!1,timeout:E,throwOnTimeout:_}={}){let S=null;const I=[new Promise(y=>{S=ve(e,N=>{d(N)!==t&&(S==null||S(),y(N))},{flush:h,deep:p,immediate:!0})})];return E!=null&&I.push(So(E,_).then(()=>Le(e)).finally(()=>S==null?void 0:S())),Promise.race(I)}function o(d,h){if(!ao(d))return n(N=>N===d,h);const{flush:p="sync",deep:E=!1,timeout:_,throwOnTimeout:S}=h!=null?h:{};let C=null;const y=[new Promise(N=>{C=ve([e,d],([z,L])=>{t!==(z===L)&&(C==null||C(),N(z))},{flush:p,deep:E,immediate:!0})})];return _!=null&&y.push(So(_,S).then(()=>Le(e)).finally(()=>(C==null||C(),Le(e)))),Promise.race(y)}function i(d){return n(h=>!!h,d)}function r(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(p=>{const E=Array.from(p);return E.includes(d)||E.includes(Le(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let p=-1;return n(()=>(p+=1,p>=d),h)}return Array.isArray(Le(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Gn(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Gn(e,!t)}}}function Xn(e){return Gn(e)}function jr(e){var t;const n=Le(e);return(t=n==null?void 0:n.$el)!=null?t:n}const wi=Gr?window:void 0;function xi(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=wi):[t,n,o,i]=e,!t)return Wr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,h,p)=>(c.addEventListener(d,h,p),()=>c.removeEventListener(d,h,p)),l=ve(()=>[jr(t),Le(i)],([c,d])=>{if(s(),!c)return;const h=Zr(d)?$({},d):d;r.push(...n.flatMap(p=>o.map(E=>a(c,p,E,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return At(u),u}function es(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function No(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=wi,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=es(t);return xi(i,r,c=>{c.repeat&&Le(a)||l(c)&&n(c)},s)}function ts(e){return JSON.parse(JSON.stringify(e))}function kn(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,p=Nt(),E=n||(p==null?void 0:p.emit)||((i=p==null?void 0:p.$emit)==null?void 0:i.bind(p))||((s=(r=p==null?void 0:p.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(p==null?void 0:p.proxy));let _=u;t||(t="modelValue"),_=_||`update:${t.toString()}`;const S=y=>a?typeof a=="function"?a(y):ts(y):y,C=()=>Xr(e[t])?S(e[t]):d,I=y=>{h?h(y)&&E(_,y):E(_,y)};if(l){const y=C(),N=we(y);let z=!1;return ve(()=>e[t],L=>{z||(z=!0,N.value=S(L),Ge(()=>z=!1))}),ve(N,L=>{!z&&(L!==e[t]||c)&&I(L)},{deep:c}),N}else return se({get(){return C()},set(y){I(y)}})}var ns={value:()=>{}};function _n(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new tn(n)}function tn(e){this._=e}function os(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}tn.prototype=_n.prototype={constructor:tn,on:function(e,t){var n=this._,o=os(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=is(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Co(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Co(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new tn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function is(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Co(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=ns,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Un="http://www.w3.org/1999/xhtml";const Mo={svg:"http://www.w3.org/2000/svg",xhtml:Un,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mo.hasOwnProperty(t)?{space:Mo[t],local:e}:e}function rs(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Un&&t.documentElement.namespaceURI===Un?t.createElement(e):t.createElementNS(n,e)}}function ss(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bi(e){var t=wn(e);return(t.local?ss:rs)(t)}function as(){}function lo(e){return e==null?as:function(){return this.querySelector(e)}}function ls(e){typeof e!="function"&&(e=lo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Me(o,this._parents)}function us(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cs(){return[]}function Ei(e){return e==null?cs:function(){return this.querySelectorAll(e)}}function ds(e){return function(){return us(e.apply(this,arguments))}}function fs(e){typeof e=="function"?e=ds(e):e=Ei(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Me(o,i)}function Si(e){return function(){return this.matches(e)}}function Ni(e){return function(t){return t.matches(e)}}var hs=Array.prototype.find;function gs(e){return function(){return hs.call(this.children,e)}}function vs(){return this.firstElementChild}function ps(e){return this.select(e==null?vs:gs(typeof e=="function"?e:Ni(e)))}var ms=Array.prototype.filter;function ys(){return Array.from(this.children)}function _s(e){return function(){return ms.call(this.children,e)}}function ws(e){return this.selectAll(e==null?ys:_s(typeof e=="function"?e:Ni(e)))}function xs(e){typeof e!="function"&&(e=Si(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Me(o,this._parents)}function Ci(e){return new Array(e.length)}function bs(){return new Me(this._enter||this._groups.map(Ci),this._parents)}function ln(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ln.prototype={constructor:ln,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Es(e){return function(){return e}}function Ss(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new ln(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Ns(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),p;for(a=0;a<c;++a)(l=t[a])&&(h[a]=p=s.call(l,l.__data__,a,t)+"",u.has(p)?i[a]=l:u.set(p,l));for(a=0;a<d;++a)p=s.call(e,r[a],a,r)+"",(l=u.get(p))?(o[a]=l,l.__data__=r[a],u.delete(p)):n[a]=new ln(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function Cs(e){return e.__data__}function Ms(e,t){if(!arguments.length)return Array.from(this,Cs);var n=t?Ns:Ss,o=this._parents,i=this._groups;typeof e!="function"&&(e=Es(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,p=Is(e.call(c,c&&c.__data__,u,o)),E=p.length,_=a[u]=new Array(E),S=s[u]=new Array(E),C=l[u]=new Array(h);n(c,d,_,S,C,p,t);for(var I=0,y=0,N,z;I<E;++I)if(N=_[I]){for(I>=y&&(y=I+1);!(z=S[y])&&++y<E;);N._next=z||null}}return s=new Me(s,o),s._enter=a,s._exit=l,s}function Is(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ts(){return new Me(this._exit||this._groups.map(Ci),this._parents)}function ks(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function Ps(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),p,E=0;E<d;++E)(p=u[E]||c[E])&&(h[E]=p);for(;l<i;++l)a[l]=n[l];return new Me(a,this._parents)}function $s(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Ds(e){e||(e=As);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Me(i,this._parents).order()}function As(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Os(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zs(){return Array.from(this)}function Bs(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function Vs(){let e=0;for(const t of this)++e;return e}function Rs(){return!this.node()}function Hs(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Ls(e){return function(){this.removeAttribute(e)}}function Ys(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fs(e,t){return function(){this.setAttribute(e,t)}}function Gs(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Us(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Zs(e,t){var n=wn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Ys:Ls:typeof t=="function"?n.local?Us:Xs:n.local?Gs:Fs)(n,t))}function Mi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ws(e){return function(){this.style.removeProperty(e)}}function Ks(e,t,n){return function(){this.style.setProperty(e,t,n)}}function qs(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Js(e,t,n){return arguments.length>1?this.each((t==null?Ws:typeof t=="function"?qs:Ks)(e,t,n==null?"":n)):wt(this.node(),e)}function wt(e,t){return e.style.getPropertyValue(t)||Mi(e).getComputedStyle(e,null).getPropertyValue(t)}function Qs(e){return function(){delete this[e]}}function js(e,t){return function(){this[e]=t}}function ea(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ta(e,t){return arguments.length>1?this.each((t==null?Qs:typeof t=="function"?ea:js)(e,t)):this.node()[e]}function Ii(e){return e.trim().split(/^|\s+/)}function uo(e){return e.classList||new Ti(e)}function Ti(e){this._node=e,this._names=Ii(e.getAttribute("class")||"")}Ti.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ki(e,t){for(var n=uo(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Pi(e,t){for(var n=uo(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function na(e){return function(){ki(this,e)}}function oa(e){return function(){Pi(this,e)}}function ia(e,t){return function(){(t.apply(this,arguments)?ki:Pi)(this,e)}}function ra(e,t){var n=Ii(e+"");if(arguments.length<2){for(var o=uo(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?ia:t?na:oa)(n,t))}function sa(){this.textContent=""}function aa(e){return function(){this.textContent=e}}function la(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function ua(e){return arguments.length?this.each(e==null?sa:(typeof e=="function"?la:aa)(e)):this.node().textContent}function ca(){this.innerHTML=""}function da(e){return function(){this.innerHTML=e}}function fa(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function ha(e){return arguments.length?this.each(e==null?ca:(typeof e=="function"?fa:da)(e)):this.node().innerHTML}function ga(){this.nextSibling&&this.parentNode.appendChild(this)}function va(){return this.each(ga)}function pa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ma(){return this.each(pa)}function ya(e){var t=typeof e=="function"?e:bi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _a(){return null}function wa(e,t){var n=typeof e=="function"?e:bi(e),o=t==null?_a:typeof t=="function"?t:lo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function xa(){var e=this.parentNode;e&&e.removeChild(this)}function ba(){return this.each(xa)}function Ea(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sa(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Na(e){return this.select(e?Sa:Ea)}function Ca(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ma(e){return function(t){e.call(this,t,this.__data__)}}function Ia(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ta(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function ka(e,t,n){return function(){var o=this.__on,i,r=Ma(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function Pa(e,t,n){var o=Ia(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?ka:Ta,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function $i(e,t,n){var o=Mi(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function $a(e,t){return function(){return $i(this,e,t)}}function Da(e,t){return function(){return $i(this,e,t.apply(this,arguments))}}function Aa(e,t){return this.each((typeof t=="function"?Da:$a)(e,t))}function*Oa(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var Di=[null];function Me(e,t){this._groups=e,this._parents=t}function Lt(){return new Me([[document.documentElement]],Di)}function za(){return this}Me.prototype=Lt.prototype={constructor:Me,select:ls,selectAll:fs,selectChild:ps,selectChildren:ws,filter:xs,data:Ms,enter:bs,exit:Ts,join:ks,merge:Ps,selection:za,order:$s,sort:Ds,call:Os,nodes:zs,node:Bs,size:Vs,empty:Rs,each:Hs,attr:Zs,style:Js,property:ta,classed:ra,text:ua,html:ha,raise:va,lower:ma,append:ya,insert:wa,remove:ba,clone:Na,datum:Ca,on:Pa,dispatch:Aa,[Symbol.iterator]:Oa};function Ie(e){return typeof e=="string"?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],Di)}function Ba(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pe(e,t){if(e=Ba(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Va={passive:!1},Ot={capture:!0,passive:!1};function Pn(e){e.stopImmediatePropagation()}function vt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ai(e){var t=e.document.documentElement,n=Ie(e).on("dragstart.drag",vt,Ot);"onselectstart"in t?n.on("selectstart.drag",vt,Ot):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Oi(e,t){var n=e.document.documentElement,o=Ie(e).on("dragstart.drag",null);t&&(o.on("click.drag",vt,Ot),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Xt=e=>()=>e;function Zn(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Zn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ra(e){return!e.ctrlKey&&!e.button}function Ha(){return this.parentNode}function La(e,t){return t==null?{x:e.x,y:e.y}:t}function Ya(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fa(){var e=Ra,t=Ha,n=La,o=Ya,i={},r=_n("start","drag","end"),s=0,a,l,u,c,d=0;function h(N){N.on("mousedown.drag",p).filter(o).on("touchstart.drag",S).on("touchmove.drag",C,Va).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(N,z){if(!(c||!e.call(this,N,z))){var L=y(this,t.call(this,N,z),N,z,"mouse");L&&(Ie(N.view).on("mousemove.drag",E,Ot).on("mouseup.drag",_,Ot),Ai(N.view),Pn(N),u=!1,a=N.clientX,l=N.clientY,L("start",N))}}function E(N){if(vt(N),!u){var z=N.clientX-a,L=N.clientY-l;u=z*z+L*L>d}i.mouse("drag",N)}function _(N){Ie(N.view).on("mousemove.drag mouseup.drag",null),Oi(N.view,u),vt(N),i.mouse("end",N)}function S(N,z){if(e.call(this,N,z)){var L=N.changedTouches,F=t.call(this,N,z),Y=L.length,j,X;for(j=0;j<Y;++j)(X=y(this,F,N,z,L[j].identifier,L[j]))&&(Pn(N),X("start",N,L[j]))}}function C(N){var z=N.changedTouches,L=z.length,F,Y;for(F=0;F<L;++F)(Y=i[z[F].identifier])&&(vt(N),Y("drag",N,z[F]))}function I(N){var z=N.changedTouches,L=z.length,F,Y;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),F=0;F<L;++F)(Y=i[z[F].identifier])&&(Pn(N),Y("end",N,z[F]))}function y(N,z,L,F,Y,j){var X=r.copy(),D=Pe(j||L,z),b,J,m;if((m=n.call(N,new Zn("beforestart",{sourceEvent:L,target:h,identifier:Y,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:X}),F))!=null)return b=m.x-D[0]||0,J=m.y-D[1]||0,function T(x,P,A){var R=D,O;switch(x){case"start":i[Y]=T,O=s++;break;case"end":delete i[Y],--s;case"drag":D=Pe(A||P,z),O=s;break}X.call(x,N,new Zn(x,{sourceEvent:P,subject:m,target:h,identifier:Y,active:O,x:D[0]+b,y:D[1]+J,dx:D[0]-R[0],dy:D[1]-R[1],dispatch:X}),F)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Xt(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:Xt(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Xt(N),h):n},h.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Xt(!!N),h):o},h.on=function(){var N=r.on.apply(r,arguments);return N===r?h:N},h.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,h):Math.sqrt(d)},h}function co(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Yt(){}var zt=.7,un=1/zt,pt="\\s*([+-]?\\d+)\\s*",Bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ga=/^#([0-9a-f]{3,8})$/,Xa=new RegExp(`^rgb\\(${pt},${pt},${pt}\\)$`),Ua=new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),Za=new RegExp(`^rgba\\(${pt},${pt},${pt},${Bt}\\)$`),Wa=new RegExp(`^rgba\\(${Ae},${Ae},${Ae},${Bt}\\)$`),Ka=new RegExp(`^hsl\\(${Bt},${Ae},${Ae}\\)$`),qa=new RegExp(`^hsla\\(${Bt},${Ae},${Ae},${Bt}\\)$`),Io={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};co(Yt,lt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:To,formatHex:To,formatHex8:Ja,formatHsl:Qa,formatRgb:ko,toString:ko});function To(){return this.rgb().formatHex()}function Ja(){return this.rgb().formatHex8()}function Qa(){return Bi(this).formatHsl()}function ko(){return this.rgb().formatRgb()}function lt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ga.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Po(t):n===3?new Ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ut(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ut(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Xa.exec(e))?new Ce(t[1],t[2],t[3],1):(t=Ua.exec(e))?new Ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Za.exec(e))?Ut(t[1],t[2],t[3],t[4]):(t=Wa.exec(e))?Ut(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ka.exec(e))?Ao(t[1],t[2]/100,t[3]/100,1):(t=qa.exec(e))?Ao(t[1],t[2]/100,t[3]/100,t[4]):Io.hasOwnProperty(e)?Po(Io[e]):e==="transparent"?new Ce(NaN,NaN,NaN,0):null}function Po(e){return new Ce(e>>16&255,e>>8&255,e&255,1)}function Ut(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ce(e,t,n,o)}function ja(e){return e instanceof Yt||(e=lt(e)),e?(e=e.rgb(),new Ce(e.r,e.g,e.b,e.opacity)):new Ce}function Wn(e,t,n,o){return arguments.length===1?ja(e):new Ce(e,t,n,o==null?1:o)}function Ce(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}co(Ce,Wn,zi(Yt,{brighter(e){return e=e==null?un:Math.pow(un,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zt:Math.pow(zt,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),cn(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:$o,formatHex:$o,formatHex8:el,formatRgb:Do,toString:Do}));function $o(){return`#${ot(this.r)}${ot(this.g)}${ot(this.b)}`}function el(){return`#${ot(this.r)}${ot(this.g)}${ot(this.b)}${ot((isNaN(this.opacity)?1:this.opacity)*255)}`}function Do(){const e=cn(this.opacity);return`${e===1?"rgb(":"rgba("}${it(this.r)}, ${it(this.g)}, ${it(this.b)}${e===1?")":`, ${e})`}`}function cn(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 ot(e){return e=it(e),(e<16?"0":"")+e.toString(16)}function Ao(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Te(e,t,n,o)}function Bi(e){if(e instanceof Te)return new Te(e.h,e.s,e.l,e.opacity);if(e instanceof Yt||(e=lt(e)),!e)return new Te;if(e instanceof Te)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Te(s,a,l,e.opacity)}function tl(e,t,n,o){return arguments.length===1?Bi(e):new Te(e,t,n,o==null?1:o)}function Te(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}co(Te,tl,zi(Yt,{brighter(e){return e=e==null?un:Math.pow(un,e),new Te(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zt:Math.pow(zt,e),new Te(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Ce($n(e>=240?e-240:e+120,i,o),$n(e,i,o),$n(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Te(Oo(this.h),Zt(this.s),Zt(this.l),cn(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=cn(this.opacity);return`${e===1?"hsl(":"hsla("}${Oo(this.h)}, ${Zt(this.s)*100}%, ${Zt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oo(e){return e=(e||0)%360,e<0?e+360:e}function Zt(e){return Math.max(0,Math.min(1,e||0))}function $n(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const fo=e=>()=>e;function nl(e,t){return function(n){return e+n*t}}function ol(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function il(e){return(e=+e)==1?Vi:function(t,n){return n-t?ol(t,n,e):fo(isNaN(t)?n:t)}}function Vi(e,t){var n=t-e;return n?nl(e,n):fo(isNaN(e)?t:e)}const dn=(function e(t){var n=il(t);function o(i,r){var s=n((i=Wn(i)).r,(r=Wn(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Vi(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function rl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=e[i]*(1-r)+t[i]*r;return o}}function sl(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function al(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),r=new Array(n),s;for(s=0;s<o;++s)i[s]=Pt(e[s],t[s]);for(;s<n;++s)r[s]=t[s];return function(a){for(s=0;s<o;++s)r[s]=i[s](a);return r}}function ll(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function $e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ul(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Pt(e[i],t[i]):o[i]=t[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Kn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dn=new RegExp(Kn.source,"g");function cl(e){return function(){return e}}function dl(e){return function(t){return e(t)+""}}function Ri(e,t){var n=Kn.lastIndex=Dn.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Kn.exec(e))&&(i=Dn.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:$e(o,i)})),n=Dn.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?dl(l[0].x):cl(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Pt(e,t){var n=typeof t,o;return t==null||n==="boolean"?fo(t):(n==="number"?$e:n==="string"?(o=lt(t))?(t=o,dn):Ri:t instanceof lt?dn:t instanceof Date?ll:sl(t)?rl:Array.isArray(t)?al:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ul:$e)(e,t)}var zo=180/Math.PI,qn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hi(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*zo,skewX:Math.atan(l)*zo,scaleX:s,scaleY:a}}var Wt;function fl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qn:Hi(t.a,t.b,t.c,t.d,t.e,t.f)}function hl(e){return e==null||(Wt||(Wt=document.createElementNS("http://www.w3.org/2000/svg","g")),Wt.setAttribute("transform",e),!(e=Wt.transform.baseVal.consolidate()))?qn:(e=e.matrix,Hi(e.a,e.b,e.c,e.d,e.e,e.f))}function Li(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,p,E){if(u!==d||c!==h){var _=p.push("translate(",null,t,null,n);E.push({i:_-4,x:$e(u,d)},{i:_-2,x:$e(c,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:$e(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:$e(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,p,E){if(u!==d||c!==h){var _=p.push(i(p)+"scale(",null,",",null,")");E.push({i:_-4,x:$e(u,d)},{i:_-2,x:$e(c,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(p){for(var E=-1,_=h.length,S;++E<_;)d[(S=h[E]).i]=S.x(p);return d.join("")}}}var gl=Li(fl,"px, ","px)","deg)"),vl=Li(hl,", ",")",")"),pl=1e-12;function Bo(e){return((e=Math.exp(e))+1/e)/2}function ml(e){return((e=Math.exp(e))-1/e)/2}function yl(e){return((e=Math.exp(2*e))-1)/(e+1)}const nn=(function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],p=c-a,E=d-l,_=p*p+E*E,S,C;if(_<pl)C=Math.log(h/u)/t,S=function(F){return[a+F*p,l+F*E,u*Math.exp(t*F*C)]};else{var I=Math.sqrt(_),y=(h*h-u*u+o*_)/(2*u*n*I),N=(h*h-u*u-o*_)/(2*h*n*I),z=Math.log(Math.sqrt(y*y+1)-y),L=Math.log(Math.sqrt(N*N+1)-N);C=(L-z)/t,S=function(F){var Y=F*C,j=Bo(z),X=u/(n*I)*(j*yl(t*Y+z)-ml(z));return[a+X*p,l+X*E,u*j/Bo(t*Y+z)]}}return S.duration=C*1e3*t/Math.SQRT2,S}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i})(Math.SQRT2,2,4);var xt=0,It=0,Ct=0,Yi=1e3,fn,Tt,hn=0,ut=0,xn=0,Vt=typeof performance=="object"&&performance.now?performance:Date,Fi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ho(){return ut||(Fi(_l),ut=Vt.now()+xn)}function _l(){ut=0}function gn(){this._call=this._time=this._next=null}gn.prototype=Gi.prototype={constructor:gn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ho():+n)+(t==null?0:+t),!this._next&&Tt!==this&&(Tt?Tt._next=this:fn=this,Tt=this),this._call=e,this._time=n,Jn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jn())}};function Gi(e,t,n){var o=new gn;return o.restart(e,t,n),o}function wl(){ho(),++xt;for(var e=fn,t;e;)(t=ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xt}function Vo(){ut=(hn=Vt.now())+xn,xt=It=0;try{wl()}finally{xt=0,bl(),ut=0}}function xl(){var e=Vt.now(),t=e-hn;t>Yi&&(xn-=t,hn=e)}function bl(){for(var e,t=fn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fn=n);Tt=e,Jn(o)}function Jn(e){if(!xt){It&&(It=clearTimeout(It));var t=e-ut;t>24?(e<1/0&&(It=setTimeout(Vo,e-Vt.now()-xn)),Ct&&(Ct=clearInterval(Ct))):(Ct||(hn=Vt.now(),Ct=setInterval(xl,Yi)),xt=1,Fi(Vo))}}function Ro(e,t,n){var o=new gn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var El=_n("start","end","cancel","interrupt"),Sl=[],Xi=0,Ho=1,Qn=2,on=3,Lo=4,jn=5,rn=6;function bn(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Nl(e,n,{name:t,index:o,group:i,on:El,tween:Sl,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Xi})}function go(e,t){var n=ke(e,t);if(n.state>Xi)throw new Error("too late; already scheduled");return n}function Be(e,t){var n=ke(e,t);if(n.state>on)throw new Error("too late; already running");return n}function ke(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nl(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Gi(r,0,n.time);function r(u){n.state=Ho,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,p;if(n.state!==Ho)return l();for(c in o)if(p=o[c],p.name===n.name){if(p.state===on)return Ro(s);p.state===Lo?(p.state=rn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=rn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(Ro(function(){n.state===on&&(n.state=Lo,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Qn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Qn){for(n.state=on,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=jn,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===jn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=rn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function sn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>Qn&&o.state<jn,o.state=rn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Cl(e){return this.each(function(){sn(this,e)})}function Ml(e,t){var n,o;return function(){var i=Be(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Il(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Be(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Tl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=ke(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Ml:Il)(n,e,t))}function vo(e,t,n){var o=e._id;return e.each(function(){var i=Be(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ke(i,o).value[t]}}function Ui(e,t){var n;return(typeof t=="number"?$e:t instanceof lt?dn:(n=lt(t))?(t=n,dn):Ri)(e,t)}function kl(e){return function(){this.removeAttribute(e)}}function Pl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $l(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Dl(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Al(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Ol(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function zl(e,t){var n=wn(e),o=n==="transform"?vl:Ui;return this.attrTween(e,typeof t=="function"?(n.local?Ol:Al)(n,o,vo(this,"attr."+e,t)):t==null?(n.local?Pl:kl)(n):(n.local?Dl:$l)(n,o,t))}function Bl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Rl(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Vl(e,r)),n}return i._value=t,i}function Hl(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Bl(e,r)),n}return i._value=t,i}function Ll(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=wn(e);return this.tween(n,(o.local?Rl:Hl)(o,t))}function Yl(e,t){return function(){go(this,e).delay=+t.apply(this,arguments)}}function Fl(e,t){return t=+t,function(){go(this,e).delay=t}}function Gl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yl:Fl)(t,e)):ke(this.node(),t).delay}function Xl(e,t){return function(){Be(this,e).duration=+t.apply(this,arguments)}}function Ul(e,t){return t=+t,function(){Be(this,e).duration=t}}function Zl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xl:Ul)(t,e)):ke(this.node(),t).duration}function Wl(e,t){if(typeof t!="function")throw new Error;return function(){Be(this,e).ease=t}}function Kl(e){var t=this._id;return arguments.length?this.each(Wl(t,e)):ke(this.node(),t).ease}function ql(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Be(this,e).ease=n}}function Jl(e){if(typeof e!="function")throw new Error;return this.each(ql(this._id,e))}function Ql(e){typeof e!="function"&&(e=Si(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Ze(o,this._parents,this._name,this._id)}function jl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(d[p]=h);for(;a<o;++a)s[a]=t[a];return new Ze(s,this._parents,this._name,this._id)}function eu(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function tu(e,t,n){var o,i,r=eu(t)?go:Be;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function nu(e,t){var n=this._id;return arguments.length<2?ke(this.node(),n).on.on(e):this.each(tu(n,e,t))}function ou(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function iu(){return this.on("end.remove",ou(this._id))}function ru(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lo(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,bn(u[h],t,n,h,u,ke(c,n)));return new Ze(r,this._parents,t,n)}function su(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ei(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),p,E=ke(c,n),_=0,S=h.length;_<S;++_)(p=h[_])&&bn(p,t,n,_,h,E);r.push(h),s.push(c)}return new Ze(r,s,t,n)}var au=Lt.prototype.constructor;function lu(){return new au(this._groups,this._parents)}function uu(e,t){var n,o,i;return function(){var r=wt(this,e),s=(this.style.removeProperty(e),wt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Zi(e){return function(){this.style.removeProperty(e)}}function cu(e,t,n){var o,i=n+"",r;return function(){var s=wt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function du(e,t,n){var o,i,r;return function(){var s=wt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),wt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function fu(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Be(this,e),u=l.on,c=l.value[r]==null?a||(a=Zi(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function hu(e,t,n){var o=(e+="")=="transform"?gl:Ui;return t==null?this.styleTween(e,uu(e,o)).on("end.style."+e,Zi(e)):typeof t=="function"?this.styleTween(e,du(e,o,vo(this,"style."+e,t))).each(fu(this._id,e)):this.styleTween(e,cu(e,o,t),n).on("end.style."+e,null)}function gu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function vu(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&gu(e,s,n)),o}return r._value=t,r}function pu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,vu(e,t,n==null?"":n))}function mu(e){return function(){this.textContent=e}}function yu(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function _u(e){return this.tween("text",typeof e=="function"?yu(vo(this,"text",e)):mu(e==null?"":e+""))}function wu(e){return function(t){this.textContent=e.call(this,t)}}function xu(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wu(i)),t}return o._value=e,o}function bu(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,xu(e))}function Eu(){for(var e=this._name,t=this._id,n=Wi(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=ke(l,t);bn(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ze(o,this._parents,e,n)}function Su(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Be(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Nu=0;function Ze(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Wi(){return++Nu}var He=Lt.prototype;Ze.prototype={constructor:Ze,select:ru,selectAll:su,selectChild:He.selectChild,selectChildren:He.selectChildren,filter:Ql,merge:jl,selection:lu,transition:Eu,call:He.call,nodes:He.nodes,node:He.node,size:He.size,empty:He.empty,each:He.each,on:nu,attr:zl,attrTween:Ll,style:hu,styleTween:pu,text:_u,textTween:bu,remove:iu,tween:Tl,delay:Gl,duration:Zl,ease:Kl,easeVarying:Jl,end:Su,[Symbol.iterator]:He[Symbol.iterator]};function Cu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Mu={time:null,delay:0,duration:250,ease:Cu};function Iu(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Tu(e){var t,n;e instanceof Ze?(t=e._id,e=e._name):(t=Wi(),(n=Mu).time=ho(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&bn(l,e,t,u,s,n||Iu(l,t));return new Ze(o,this._parents,e,t)}Lt.prototype.interrupt=Cl;Lt.prototype.transition=Tu;const Kt=e=>()=>e;function ku(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function Fe(e,t,n){this.k=e,this.x=t,this.y=n}Fe.prototype={constructor:Fe,scale:function(e){return e===1?this:new Fe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fe(this.k,this.x+this.k*e,this.y+this.k*t)},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 bt=new Fe(1,0,0);Fe.prototype;function An(e){e.stopImmediatePropagation()}function Mt(e){e.preventDefault(),e.stopImmediatePropagation()}function Pu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $u(){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 Yo(){return this.__zoom||bt}function Du(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Au(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ou(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function zu(){var e=Pu,t=$u,n=Ou,o=Du,i=Au,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=nn,u=_n("start","zoom","end"),c,d,h,p=500,E=150,_=0,S=10;function C(m){m.property("__zoom",Yo).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",X).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(m,T,x,P){var A=m.selection?m.selection():m;A.property("__zoom",Yo),m!==A?z(m,T,x,P):A.interrupt().each(function(){L(this,arguments).event(P).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},C.scaleBy=function(m,T,x,P){C.scaleTo(m,function(){var A=this.__zoom.k,R=typeof T=="function"?T.apply(this,arguments):T;return A*R},x,P)},C.scaleTo=function(m,T,x,P){C.transform(m,function(){var A=t.apply(this,arguments),R=this.__zoom,O=x==null?N(A):typeof x=="function"?x.apply(this,arguments):x,U=R.invert(O),Q=typeof T=="function"?T.apply(this,arguments):T;return n(y(I(R,Q),O,U),A,s)},x,P)},C.translateBy=function(m,T,x,P){C.transform(m,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof x=="function"?x.apply(this,arguments):x),t.apply(this,arguments),s)},null,P)},C.translateTo=function(m,T,x,P,A){C.transform(m,function(){var R=t.apply(this,arguments),O=this.__zoom,U=P==null?N(R):typeof P=="function"?P.apply(this,arguments):P;return n(bt.translate(U[0],U[1]).scale(O.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof x=="function"?-x.apply(this,arguments):-x),R,s)},P,A)};function I(m,T){return T=Math.max(r[0],Math.min(r[1],T)),T===m.k?m:new Fe(T,m.x,m.y)}function y(m,T,x){var P=T[0]-x[0]*m.k,A=T[1]-x[1]*m.k;return P===m.x&&A===m.y?m:new Fe(m.k,P,A)}function N(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function z(m,T,x,P){m.on("start.zoom",function(){L(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(P).end()}).tween("zoom",function(){var A=this,R=arguments,O=L(A,R).event(P),U=t.apply(A,R),Q=x==null?N(U):typeof x=="function"?x.apply(A,R):x,ie=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),B=A.__zoom,Z=typeof T=="function"?T.apply(A,R):T,W=l(B.invert(Q).concat(ie/B.k),Z.invert(Q).concat(ie/Z.k));return function(re){if(re===1)re=Z;else{var ae=W(re),ue=ie/ae[2];re=new Fe(ue,Q[0]-ae[0]*ue,Q[1]-ae[1]*ue)}O.zoom(null,re)}})}function L(m,T,x){return!x&&m.__zooming||new F(m,T)}function F(m,T){this.that=m,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(m,T),this.taps=0}F.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,T){return this.mouse&&m!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var T=Ie(this.that).datum();u.call(m,this.that,new ku(m,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:u}),T)}};function Y(m,...T){if(!e.apply(this,arguments))return;var x=L(this,T).event(m),P=this.__zoom,A=Math.max(r[0],Math.min(r[1],P.k*Math.pow(2,o.apply(this,arguments)))),R=Pe(m);if(x.wheel)(x.mouse[0][0]!==R[0]||x.mouse[0][1]!==R[1])&&(x.mouse[1]=P.invert(x.mouse[0]=R)),clearTimeout(x.wheel);else{if(P.k===A)return;x.mouse=[R,P.invert(R)],sn(this),x.start()}Mt(m),x.wheel=setTimeout(O,E),x.zoom("mouse",n(y(I(P,A),x.mouse[0],x.mouse[1]),x.extent,s));function O(){x.wheel=null,x.end()}}function j(m,...T){if(h||!e.apply(this,arguments))return;var x=m.currentTarget,P=L(this,T,!0).event(m),A=Ie(m.view).on("mousemove.zoom",Q,!0).on("mouseup.zoom",ie,!0),R=Pe(m,x),O=m.clientX,U=m.clientY;Ai(m.view),An(m),P.mouse=[R,this.__zoom.invert(R)],sn(this),P.start();function Q(B){if(Mt(B),!P.moved){var Z=B.clientX-O,W=B.clientY-U;P.moved=Z*Z+W*W>_}P.event(B).zoom("mouse",n(y(P.that.__zoom,P.mouse[0]=Pe(B,x),P.mouse[1]),P.extent,s))}function ie(B){A.on("mousemove.zoom mouseup.zoom",null),Oi(B.view,P.moved),Mt(B),P.event(B).end()}}function X(m,...T){if(e.apply(this,arguments)){var x=this.__zoom,P=Pe(m.changedTouches?m.changedTouches[0]:m,this),A=x.invert(P),R=x.k*(m.shiftKey?.5:2),O=n(y(I(x,R),P,A),t.apply(this,T),s);Mt(m),a>0?Ie(this).transition().duration(a).call(z,O,P,m):Ie(this).call(C.transform,O,P,m)}}function D(m,...T){if(e.apply(this,arguments)){var x=m.touches,P=x.length,A=L(this,T,m.changedTouches.length===P).event(m),R,O,U,Q;for(An(m),O=0;O<P;++O)U=x[O],Q=Pe(U,this),Q=[Q,this.__zoom.invert(Q),U.identifier],A.touch0?!A.touch1&&A.touch0[2]!==Q[2]&&(A.touch1=Q,A.taps=0):(A.touch0=Q,R=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(A.taps<2&&(d=Q[0],c=setTimeout(function(){c=null},p)),sn(this),A.start())}}function b(m,...T){if(this.__zooming){var x=L(this,T).event(m),P=m.changedTouches,A=P.length,R,O,U,Q;for(Mt(m),R=0;R<A;++R)O=P[R],U=Pe(O,this),x.touch0&&x.touch0[2]===O.identifier?x.touch0[0]=U:x.touch1&&x.touch1[2]===O.identifier&&(x.touch1[0]=U);if(O=x.that.__zoom,x.touch1){var ie=x.touch0[0],B=x.touch0[1],Z=x.touch1[0],W=x.touch1[1],re=(re=Z[0]-ie[0])*re+(re=Z[1]-ie[1])*re,ae=(ae=W[0]-B[0])*ae+(ae=W[1]-B[1])*ae;O=I(O,Math.sqrt(re/ae)),U=[(ie[0]+Z[0])/2,(ie[1]+Z[1])/2],Q=[(B[0]+W[0])/2,(B[1]+W[1])/2]}else if(x.touch0)U=x.touch0[0],Q=x.touch0[1];else return;x.zoom("touch",n(y(O,U,Q),x.extent,s))}}function J(m,...T){if(this.__zooming){var x=L(this,T).event(m),P=m.changedTouches,A=P.length,R,O;for(An(m),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),R=0;R<A;++R)O=P[R],x.touch0&&x.touch0[2]===O.identifier?delete x.touch0:x.touch1&&x.touch1[2]===O.identifier&&delete x.touch1;if(x.touch1&&!x.touch0&&(x.touch0=x.touch1,delete x.touch1),x.touch0)x.touch0[1]=this.__zoom.invert(x.touch0[0]);else if(x.end(),x.taps===2&&(O=Pe(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<S)){var U=Ie(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return C.wheelDelta=function(m){return arguments.length?(o=typeof m=="function"?m:Kt(+m),C):o},C.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Kt(!!m),C):e},C.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:Kt(!!m),C):i},C.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Kt([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),C):t},C.scaleExtent=function(m){return arguments.length?(r[0]=+m[0],r[1]=+m[1],C):[r[0],r[1]]},C.translateExtent=function(m){return arguments.length?(s[0][0]=+m[0][0],s[1][0]=+m[1][0],s[0][1]=+m[0][1],s[1][1]=+m[1][1],C):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},C.constrain=function(m){return arguments.length?(n=m,C):n},C.duration=function(m){return arguments.length?(a=+m,C):a},C.interpolate=function(m){return arguments.length?(l=m,C):l},C.on=function(){var m=u.on.apply(u,arguments);return m===u?C:m},C.clickDistance=function(m){return arguments.length?(_=(m=+m)*m,C):Math.sqrt(_)},C.tapDistance=function(m){return arguments.length?(S=+m,C):S},C}var q=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(q||{}),po=(e=>(e.Partial="partial",e.Full="full",e))(po||{}),tt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(tt||{}),Je=(e=>(e.Strict="strict",e.Loose="loose",e))(Je||{}),eo=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(eo||{}),$t=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))($t||{});const Bu=["INPUT","SELECT","TEXTAREA"],Vu=typeof document!="undefined"?document:null;function to(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return Bu.includes(o==null?void 0:o.nodeName)||i||!!r}function Ru(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Fo(e,t,n,o){const i=t.replace("+",`
`).replace(`
`,`
+`).split(`
`).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function Hu(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Lu(n.code,e);return Array.isArray(e)?e.some(i=>Fo(n[o],i,t,n.type==="keyup")):Fo(n[o],e,t,n.type==="keyup")}}function Lu(e,t){return t.includes(e)?"code":"key"}function Dt(e,t){const n=se(()=>{var u;return(u=le(t==null?void 0:t.target))!=null?u:Vu}),o=an(le(e)===!0);let i=!1;const r=new Set;let s=l(le(e));ve(()=>le(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),xi(["blur","contextmenu"],a),No((...u)=>s(...u),u=>{var C,I;var c,d;const h=(C=le(t==null?void 0:t.actInsideInputWithModifier))!=null?C:!0,p=(I=le(t==null?void 0:t.preventDefault))!=null?I:!1;if(i=Ru(u),(!i||i&&!h)&&to(u))return;const _=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,S=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";!p&&(i||!S)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),No((...u)=>s(...u),u=>{var d;const c=(d=le(t==null?void 0:t.actInsideInputWithModifier))!=null?d:!0;if(o.value){if((!i||i&&!c)&&to(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){i=!1,r.clear(),o.value=le(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?Hu(u,r):u}return o}const Ki="vue-flow__node-desc",qi="vue-flow__edge-desc",Yu="vue-flow__aria-live",Ji=["Enter"," ","Escape"],mt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function vn(e){return de($({},e.computedPosition||{x:0,y:0}),{width:e.dimensions.width||0,height:e.dimensions.height||0})}function pn(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function En(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ct(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Qi(e,t){return{x:ct(e.x,t[0][0],t[1][0]),y:ct(e.y,t[0][1],t[1][1])}}function Go(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Qe(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function rt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Qe(e)}function kt(e){return rt(e)&&"computedPosition"in e}function qt(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Fu(e){return qt(e.width)&&qt(e.height)&&qt(e.x)&&qt(e.y)}function Gu(e,t,n){var i;const o={id:e.id.toString(),type:(i=e.type)!=null?i:"default",dimensions:en({width:0,height:0}),computedPosition:en($({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:Ee(e.data)?e.data:{},events:en(Ee(e.events)?e.events:{})};return Object.assign(t!=null?t:o,e,{id:e.id.toString(),parentNode:n})}function ji(e,t,n){var s,a,l,u,c,d,h;var o,i;const r=$({id:e.id.toString(),type:(a=(s=e.type)!=null?s:t==null?void 0:t.type)!=null?a:"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:(l=e.updatable)!=null?l:n==null?void 0:n.updatable,selectable:(u=e.selectable)!=null?u:n==null?void 0:n.selectable,focusable:(c=e.focusable)!=null?c:n==null?void 0:n.focusable,data:Ee(e.data)?e.data:{},events:en(Ee(e.events)?e.events:{}),label:(d=e.label)!=null?d:"",interactionWidth:(h=e.interactionWidth)!=null?h:n==null?void 0:n.interactionWidth},n!=null?n:{});return Object.assign(t!=null?t:r,e,{id:e.id.toString()})}function er(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function Xu(...e){if(e.length===3){const[r,s,a]=e;return er(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Qe(r)&&r.source===o).map(r=>n.find(s=>rt(s)&&s.id===r.target))}function Uu(...e){if(e.length===3){const[r,s,a]=e;return er(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Qe(r)&&r.target===o).map(r=>n.find(s=>rt(s)&&s.id===r.source))}function tr({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t!=null?t:""}-${n}${o!=null?o:""}`}function Zu(e,t){return t.some(n=>Qe(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function no({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Rt({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?Sn(a,s):a}function Wu(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function nr({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Ku({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function or(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Wu(t,nr($($({},o.computedPosition),o.dimensions)))}return Ku(t)}function ir(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){var a,l,u,c;const r=de($({},Rt(t,n)),{width:t.width/n.zoom,height:t.height/n.zoom}),s=[];for(const d of e){const{dimensions:h,selectable:p=!0,hidden:E=!1}=d,_=(l=(a=h.width)!=null?a:d.width)!=null?l:null,S=(c=(u=h.height)!=null?u:d.height)!=null?c:null;if(i&&!p||E)continue;const C=pn(r,vn(d)),I=_===null||S===null,y=o&&C>0,N=(_!=null?_:0)*(S!=null?S:0);(I||y||C>=N||d.dragging)&&s.push(d)}return s}function rr(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function Xo(e,t,n,o,i,r=.1,s={x:0,y:0}){var _,S;const a=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(a,l),c=ct(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,p=t/2-d*c+((_=s.x)!=null?_:0),E=n/2-h*c+((S=s.y)!=null?S:0);return{x:p,y:E,zoom:c}}function qu(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function sr(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:sr(n,t):!1}function Ht(e,t){return typeof e=="undefined"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Uo(e){const t=e.ctrlKey&&mn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Zo(e,t,n){return e<t?ct(Math.abs(e-t),1,t)/t:e>n?-ct(Math.abs(e-n),1,t)/t:0}function ar(e,t,n=15,o=40){const i=Zo(e.x,o,t.width-o)*n,r=Zo(e.y,o,t.height-o)*n;return[i,r]}function On(e,t){var n,o;if(t){const i=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(i>0||r>0||e.position.x<0||e.position.y<0){let s={};if(typeof t.style=="function"?s=$({},t.style(t)):t.style&&(s=$({},t.style)),s.width=(n=s.width)!=null?n:`${t.dimensions.width}px`,s.height=(o=s.height)!=null?o:`${t.dimensions.height}px`,i>0)if(typeof s.width=="string"){const a=Number(s.width.replace("px",""));s.width=`${a+i}px`}else s.width+=i;if(r>0)if(typeof s.height=="string"){const a=Number(s.height.replace("px",""));s.height=`${a+r}px`}else s.height+=r;if(e.position.x<0){const a=Math.abs(e.position.x);if(t.position.x=t.position.x-a,typeof s.width=="string"){const l=Number(s.width.replace("px",""));s.width=`${l+a}px`}else s.width+=a;e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);if(t.position.y=t.position.y-a,typeof s.height=="string"){const l=Number(s.height.replace("px",""));s.height=`${l+a}px`}else s.height+=a;e.position.y=0}t.dimensions.width=Number(s.width.toString().replace("px","")),t.dimensions.height=Number(s.height.toString().replace("px","")),typeof t.style=="function"?t.style=a=>{const l=t.style;return $($({},l(a)),s)}:t.style=$($({},t.style),s)}}}function Wo(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(kt(s)&&(typeof a.position!="undefined"&&(s.position=a.position),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&kt(l)&&On(s,l)}break;case"dimensions":if(kt(s)&&(typeof a.dimensions!="undefined"&&(s.dimensions=a.dimensions),typeof a.updateStyle!="undefined"&&a.updateStyle&&(s.style=de($({},s.style||{}),{width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`})),typeof a.resizing!="undefined"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&kt(l)&&(!!l.dimensions.width&&!!l.dimensions.height?On(s,l):Ge(()=>{On(s,l)}))}break}return t}function Ke(e,t){return{id:e,type:"select",selected:t}}function Ko(e){return{item:e,type:"add"}}function qo(e){return{id:e,type:"remove"}}function Jo(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function qe(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(Ke(r.id,s)))}return o}const Qo=()=>{};function H(e){const t=new Set;let n=Qo,o=()=>!1;const i=()=>t.size>0||o(),r=h=>{n=h},s=()=>{n=Qo},a=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const p=()=>u(h);return At(p),{off:p}},off:u,trigger:h=>{const p=[n];return i()?p.push(...t):e&&p.push(e),Promise.allSettled(p.map(E=>E(h)))},hasListeners:i,listeners:t,setEmitter:r,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function jo(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Ju(e,t,n,o){var i,r;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!sr(l,e))&&(l.draggable||t&&typeof l.draggable=="undefined")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((i=l.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=l.computedPosition)==null?void 0:r.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:$({},l.dimensions),expandParent:l.expandParent});return Array.from(s.values())}function zn({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function lr(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 Qu(e,t,n){const[o,i,r,s]=typeof e!="string"?lr(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x!="undefined"&&typeof n.computedPosition.y!="undefined"&&typeof n.dimensions.width!="undefined"&&typeof n.dimensions.height!="undefined"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function ju(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=Qu(i,e,o);r&&(i=r)}else t(new Ne(Se.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=lr(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function ec({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function mo(e,t,n,o,i){const r=ec(e.dimensions,ju(e,n,o,i)),s=Qi(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function Et(e,t,n=q.Left,o=!1){var u,c,d;const i=((u=t==null?void 0:t.x)!=null?u:0)+e.computedPosition.x,r=((c=t==null?void 0:t.y)!=null?c:0)+e.computedPosition.y,{width:s,height:a}=t!=null?t:ic(e);if(o)return{x:i+s/2,y:r+a/2};switch((d=t==null?void 0:t.position)!=null?d:n){case q.Top:return{x:i+s/2,y:r};case q.Right:return{x:i+s,y:r+a/2};case q.Bottom:return{x:i+s/2,y:r+a};case q.Left:return{x:i,y:r+a/2}}}function ei(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function tc({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=nr({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function nc(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Se=(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))(Se||{});const ti={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
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
Edge: ${e}
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
Edge: ${e}
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ne extends Error{constructor(t,...n){var o;super((o=ti[t])==null?void 0:o.call(ti,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function yo(e){return"clientX"in e}function oc(e){return"sourceEvent"in e}function De(e,t){var r,s;const n=yo(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((r=t==null?void 0:t.left)!=null?r:0),y:i-((s=t==null?void 0:t.top)!=null?s:0)}}const mn=()=>{var e;return typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ic(e){var o,i,r,s;var t,n;return{width:(i=(o=(t=e.dimensions)==null?void 0:t.width)!=null?o:e.width)!=null?i:0,height:(s=(r=(n=e.dimensions)==null?void 0:n.height)!=null?r:e.height)!=null?s:0}}function Sn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const rc=()=>!0;function Bn(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function sc(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())pn(i,vn(r))>0&&o.push(r);return o}const ac=250;function lc(e,t,n,o){var u,c,d;var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=sc(e,n,t+ac);for(const h of l){const p=[...(u=(i=h.handleBounds)==null?void 0:i.source)!=null?u:[],...(c=(r=h.handleBounds)==null?void 0:r.target)!=null?c:[]];for(const E of p){if(o.nodeId===E.nodeId&&o.type===E.type&&o.id===E.id)continue;const{x:_,y:S}=Et(h,E,E.position,!0),C=Math.sqrt(ft(_-e.x,2)+ft(S-e.y,2));C>t||(C<a?(s=[de($({},E),{x:_,y:S})],a=C):C===a&&s.push(de($({},E),{x:_,y:S})))}}if(!s.length)return null;if(s.length>1){const h=o.type==="source"?"target":"source";return(d=s.find(p=>p.type===h))!=null?d:s[0]}return s[0]}function ni(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=rc},c,d,h,p){const E=r==="target",_=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:S,y:C}=De(e),I=s.elementFromPoint(S,C),y=I!=null&&I.classList.contains(`${a}-flow__handle`)?I:_,N={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const z=ur(void 0,y),L=y.getAttribute("data-nodeid"),F=y.getAttribute("data-handleid"),Y=y.classList.contains("connectable"),j=y.classList.contains("connectableend");if(!L||!z)return N;const X={source:E?L:o,sourceHandle:E?F:i,target:E?o:L,targetHandle:E?i:F};N.connection=X;const b=Y&&j&&(n===Je.Strict?E&&z==="source"||!E&&z==="target":L!==o||F!==i);N.isValid=b&&u(X,{nodes:d,edges:c,sourceNode:h(X.source),targetNode:h(X.target)}),N.toHandle=cr(L,z,F,p,n,!0)}return N}function ur(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function uc(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function cc(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function cr(e,t,n,o,i,r=!1){var h,p,E;var s,a,l;const u=o.get(e);if(!u)return null;const c=i===Je.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...(h=(a=u.handleBounds)==null?void 0:a.source)!=null?h:[],...(p=(l=u.handleBounds)==null?void 0:l.target)!=null?p:[]],d=(E=n?c==null?void 0:c.find(_=>_.id===n):c==null?void 0:c[0])!=null?E:null;return d&&r?$($({},d),Et(u,d,d.position,!0)):d}const oo={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top},dc=["production","prod"];function Ft(e,...t){dr()&&console.warn(`[Vue Flow]: ${e}`,...t)}function dr(){return!dc.includes("production")}function oi(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return $({id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o},En(s))}):null}function io(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Ge(()=>{s.blur()})):n([e])}function Ee(e){return typeof te(e)!="undefined"}function fc(e,t,n,o){var r;if(!e||!e.source||!e.target)return n(new Ne(Se.EDGE_INVALID,(r=e==null?void 0:e.id)!=null?r:"[ID UNKNOWN]")),!1;let i;return Qe(e)?i=e:i=de($({},e),{id:tr(e)}),i=ji(i,void 0,o),Zu(i,t)?!1:i}function hc(e,t,n,o,i){if(!t.source||!t.target)return i(new Ne(Se.EDGE_INVALID,e.id)),!1;if(!n)return i(new Ne(Se.EDGE_NOT_FOUND,e.id)),!1;const a=e,{id:r}=a,s=ht(a,["id"]);return de($({},s),{id:o?tr(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})}function ii(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!rt(s)){n(new Ne(Se.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=Gu(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new Ne(Se.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function ri(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Vn(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;ri("source",l,c,e,i,s),ri("target",l,u,e,r,a)}}function si(e,t,n){if(!n)return;const o=[];for(const i of e.keys())t.has(i)||o.push(e.get(i));o.length&&n(o)}function gc(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function ai(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Rn(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=Qe(u)?u:fc(u,a,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Ne(Se.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Ne(Se.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new Ne(Se.EDGE_INVALID,c.id));continue}const p=o(c.id);l.push(de($({},ji(c,p,r)),{sourceNode:d,targetNode:h}))}return l}const li=Symbol("vueFlow"),fr=Symbol("nodeId"),hr=Symbol("nodeRef"),vc=Symbol("edgeId"),pc=Symbol("edgeRef"),Nn=Symbol("slots");function gr(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:p,multiSelectionActive:E,nodesSelectionActive:_,selectNodesOnDrag:S,removeSelectedElements:C,addSelectedNodes:I,updateNodePositions:y,emits:N}=_e(),{onStart:z,onDrag:L,onStop:F,onClick:Y,el:j,disabled:X,id:D,selectable:b,dragHandle:J}=e,m=an(!1);let T=[],x,P=null,A={x:void 0,y:void 0},R={x:0,y:0},O=null,U=!1,Q=!1,ie=0,B=!1;const Z=_c(),W=({x:oe,y:ce})=>{A={x:oe,y:ce};let g=!1;if(T=T.map(f=>{const v={x:oe-f.distance.x,y:ce-f.distance.y},{computedPosition:w}=mo(f,n.value?Sn(v,o.value):v,N.error,s.value,f.parentNode?p(f.parentNode):void 0);return g=g||f.position.x!==w.x||f.position.y!==w.y,f.position=w,f}),Q=Q||g,!!g&&(y(T,!0,!0),m.value=!0,O)){const[f,v]=zn({id:D,dragItems:T,findNode:p});L({event:O,node:f,nodes:v})}},re=()=>{var g,f;if(!P)return;const[oe,ce]=ar(R,P,c.value);if(oe!==0||ce!==0){const v={x:((g=A.x)!=null?g:0)-oe/l.value.zoom,y:((f=A.y)!=null?f:0)-ce/l.value.zoom};h({x:oe,y:ce})&&W(v)}ie=requestAnimationFrame(re)},ae=(oe,ce)=>{U=!0;const g=p(D);!S.value&&!E.value&&g&&(g.selected||C()),g&&le(b)&&S.value&&io(g,E.value,I,C,_,!1,ce);const f=Z(oe.sourceEvent);if(A=f,T=Ju(r.value,d.value,f,D),T.length){const[v,w]=zn({id:D,dragItems:T,findNode:p});z({event:oe.sourceEvent,node:v,nodes:w})}},ue=(oe,ce)=>{var g;oe.sourceEvent.type==="touchmove"&&oe.sourceEvent.touches.length>1||(Q=!1,a.value===0&&ae(oe,ce),A=Z(oe.sourceEvent),P=((g=t.value)==null?void 0:g.getBoundingClientRect())||null,R=De(oe.sourceEvent,P))},ge=(oe,ce)=>{var f,v;const g=Z(oe.sourceEvent);if(!B&&U&&u.value&&(B=!0,re()),!U){const w=g.xSnapped-((f=A.x)!=null?f:0),k=g.ySnapped-((v=A.y)!=null?v:0);Math.sqrt(w*w+k*k)>a.value&&ae(oe,ce)}(A.x!==g.xSnapped||A.y!==g.ySnapped)&&T.length&&U&&(O=oe.sourceEvent,R=De(oe.sourceEvent,P),W(g))},pe=oe=>{var g,f;let ce=!1;if(!U&&!m.value&&!E.value){const v=oe.sourceEvent,w=Z(v),k=w.xSnapped-((g=A.x)!=null?g:0),V=w.ySnapped-((f=A.y)!=null?f:0),M=Math.sqrt(k*k+V*V);M!==0&&M<=a.value&&(Y==null||Y(v),ce=!0)}if(T.length&&!ce){Q&&(y(T,!1,!1),Q=!1);const[v,w]=zn({id:D,dragItems:T,findNode:p});F({event:oe.sourceEvent,node:v,nodes:w})}T=[],m.value=!1,B=!1,U=!1,A={x:void 0,y:void 0},cancelAnimationFrame(ie)};return ve([()=>le(X),j],([oe,ce],g,f)=>{if(ce){const v=Ie(ce);oe||(x=Fa().on("start",w=>ue(w,ce)).on("drag",w=>ge(w,ce)).on("end",w=>pe(w)).filter(w=>{const k=w.target,V=le(J);return!w.button&&(!i.value||!jo(k,`.${i.value}`,ce)&&(!V||jo(k,V,ce)))}),v.call(x)),f(()=>{v.on(".drag",null),x&&(x.on("start",null),x.on("drag",null),x.on("end",null))})}}),m}function mc(){return{doubleClick:H(),click:H(),mouseEnter:H(),mouseMove:H(),mouseLeave:H(),contextMenu:H(),updateStart:H(),update:H(),updateEnd:H()}}function yc(e,t){const n=mc();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function _c(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=_e();return i=>{var p;var r;const s=(p=(r=o.value)==null?void 0:r.getBoundingClientRect())!=null?p:{left:0,top:0},a=oc(i)?i.sourceEvent:i,{x:l,y:u}=De(a,s),c=Rt({x:l,y:u},e.value),{x:d,y:h}=n.value?Sn(c,t.value):c;return $({xSnapped:d,ySnapped:h},c)}}function Jt(){return!0}function vr({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:E,autoPanSpeed:_,findNode:S,panBy:C,startConnection:I,updateConnection:y,endConnection:N,emits:z,viewport:L,edges:F,nodes:Y,isValidConnection:j,nodeLookup:X}=_e();let D=null,b=!1,J=null;function m(x){var P;const A=le(n)==="target",R=yo(x),O=Go(x.target),U=x.currentTarget;if(U&&(R&&x.button===0||!R)){let Q=function(K){g=De(K,pe),W=lc(Rt(g,L.value,!1,[1,1]),c.value,X.value,w),f||(v(),f=!0);const ee=ni(K,{handle:W,connectionMode:u.value,fromNodeId:le(t),fromHandleId:le(e),fromType:A?"target":"source",isValidConnection:Z,doc:O,lib:"vue",flowId:a,nodeLookup:X.value},F.value,Y.value,S,X.value);J=ee.handleDomNode,D=ee.connection,b=cc(!!W,ee.isValid);const ne=de($({},G),{isValid:b,to:ee.toHandle&&b?no({x:ee.toHandle.x,y:ee.toHandle.y},L.value):g,toHandle:ee.toHandle,toPosition:b&&ee.toHandle?ee.toHandle.position:oo[w.position],toNode:ee.toHandle?X.value.get(ee.toHandle.nodeId):null});if(b&&W&&(G!=null&&G.toHandle)&&ne.toHandle&&G.toHandle.type===ne.toHandle.type&&G.toHandle.nodeId===ne.toHandle.nodeId&&G.toHandle.id===ne.toHandle.id&&G.to.x===ne.to.x&&G.to.y===ne.to.y)return;const fe=W!=null?W:ee.toHandle;if(y(fe&&b?no({x:fe.x,y:fe.y},L.value):g,ee.toHandle,uc(!!fe,b)),G=ne,!W&&!b&&!J)return Bn(ce);D&&D.source!==D.target&&J&&(Bn(ce),ce=J,J.classList.add("connecting","vue-flow__handle-connecting"),J.classList.toggle("valid",!!b),J.classList.toggle("vue-flow__handle-valid",!!b))},ie=function(K){"touches"in K&&K.touches.length>0||((W||J)&&D&&b&&(r?r(K,D):z.connect(D)),z.connectEnd(K),i&&(s==null||s(K)),Bn(ce),cancelAnimationFrame(re),N(K),f=!1,b=!1,D=null,J=null,O.removeEventListener("mousemove",Q),O.removeEventListener("mouseup",ie),O.removeEventListener("touchmove",Q),O.removeEventListener("touchend",ie))};const B=S(le(t));let Z=le(o)||j.value||Jt;!Z&&B&&(Z=(A?B.isValidSourcePos:B.isValidTargetPos)||Jt);let W,re=0;const{x:ae,y:ue}=De(x),ge=ur(le(i),U),pe=(P=l.value)==null?void 0:P.getBoundingClientRect();if(!pe||!ge)return;const oe=cr(le(t),ge,le(e),X.value,u.value);if(!oe)return;let ce,g=De(x,pe),f=!1;const v=()=>{if(!E.value)return;const[K,ee]=ar(g,pe,_.value);C({x:K,y:ee}),re=requestAnimationFrame(v)},w=de($({},oe),{nodeId:le(t),type:ge,position:oe.position}),k=X.value.get(le(t)),M={inProgress:!0,isValid:null,from:Et(k,w,q.Left,!0),fromHandle:w,fromPosition:w.position,fromNode:k,to:g,toHandle:null,toPosition:oo[w.position],toNode:null};I($({nodeId:le(t),id:le(e),type:ge,position:(U==null?void 0:U.getAttribute("data-handlepos"))||q.Top},g),{x:ae-pe.left,y:ue-pe.top}),z.connectStart({event:x,nodeId:le(t),handleId:le(e),handleType:ge});let G=M;O.addEventListener("mousemove",Q),O.addEventListener("mouseup",ie),O.addEventListener("touchmove",Q),O.addEventListener("touchend",ie)}}function T(x){var Z;var P,A;if(!d.value)return;const R=le(n)==="target";if(!h.value){z.clickConnectStart({event:x,nodeId:le(t),handleId:le(e)}),I($({nodeId:le(t),type:le(n),id:le(e),position:q.Top},De(x)),void 0,!0);return}let O=le(o)||j.value||Jt;const U=S(le(t));if(!O&&U&&(O=(R?U.isValidSourcePos:U.isValidTargetPos)||Jt),U&&(typeof U.connectable=="undefined"?p.value:U.connectable)===!1)return;const Q=Go(x.target),ie=ni(x,{handle:$({nodeId:le(t),id:le(e),type:le(n),position:q.Top},De(x)),connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:(Z=h.value.id)!=null?Z:null,fromType:h.value.type,isValidConnection:O,doc:Q,lib:"vue",flowId:a,nodeLookup:X.value},F.value,Y.value,S,X.value),B=((P=ie.connection)==null?void 0:P.source)===((A=ie.connection)==null?void 0:A.target);ie.isValid&&ie.connection&&!B&&z.connect(ie.connection),z.clickConnectEnd(x),N(x,!0)}return{handlePointerDown:m,handleClick:T}}function pr(){return St(fr,"")}function mr(e){var a;const t=(a=e!=null?e:pr())!=null?a:"",n=St(hr,we(null)),{findNode:o,edges:i,emits:r}=_e(),s=o(t);return s||r.error(new Ne(Se.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:se(()=>o(s.parentNode)),connectedEdges:se(()=>rr([s],i.value))}}function wc(){return{doubleClick:H(),click:H(),mouseEnter:H(),mouseMove:H(),mouseLeave:H(),contextMenu:H(),dragStart:H(),drag:H(),dragStop:H()}}function xc(e,t){const n=wc();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function yr(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=_e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,p=l.x*c*h,E=l.y*d*h,_=[];for(const S of e.value)if(S.draggable||s&&typeof S.draggable=="undefined"){const C={x:S.computedPosition.x+p,y:S.computedPosition.y+E},{computedPosition:I}=mo(S,C,a.error,t.value,S.parentNode?o(S.parentNode):void 0);_.push({id:S.id,position:I,from:S.position,distance:{x:l.x,y:l.y},dimensions:S.dimensions})}n(_,!0,!1)}}const Hn=.1,bc=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function We(){return Ft("Viewport not initialized yet."),Promise.resolve(!1)}const Ec={zoomIn:We,zoomOut:We,zoomTo:We,fitView:We,setCenter:We,fitBounds:We,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:We,setTransform:We,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Sc(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?Pt:nn).scaleBy(Ln(e.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{var l;const{x:u,y:c}=Qi({x:-o,y:-i},e.translateExtent),d=bt.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?Pt:nn).transform(Ln(e.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return se(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?Pt:nn).scaleTo(Ln(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x: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:(i={padding:Hn,includeHiddenNodes:!1,duration:0})=>{var h,p,E;var r,s;const a=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!_.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(_.id))&&a.push(_);if(!a.length)return Promise.resolve(!1);const l=or(a),{x:u,y:c,zoom:d}=Xo(l,e.dimensions.width,e.dimensions.height,(h=i.minZoom)!=null?h:e.minZoom,(p=i.maxZoom)!=null?p:e.maxZoom,(E=i.padding)!=null?E:Hn,i.offset);return n(u,c,d,i)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s)},fitBounds:(i,r={padding:Hn})=>{const{x:s,y:a,zoom:l}=Xo(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,l,r)},project:i=>Rt(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return Rt(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return no(a,e.viewport)}return{x:0,y:0}}}:Ec)}function Ln(e,t=0,n=bc,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function Nc(e,t,n){const o=vi(!0);return o.run(()=>{const i=()=>{o.run(()=>{let _,S,C=!!(n.nodes.value.length||n.edges.value.length);_=gt([e.modelValue,()=>{var I,y;return(y=(I=e.modelValue)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setElements(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=gt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([I,y])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(_==null||_.pause(),e.modelValue.value=[...I,...y],Ge(()=>{_==null||_.resume()}))},{immediate:C}),jt(()=>{_==null||_.stop(),S==null||S.stop()})})},r=()=>{o.run(()=>{let _,S,C=!!n.nodes.value.length;_=gt([e.nodes,()=>{var I,y;return(y=(I=e.nodes)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setNodes(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=gt([n.nodes,()=>n.nodes.value.length],([I])=>{var y;(y=e.nodes)!=null&&y.value&&Array.isArray(e.nodes.value)&&(_==null||_.pause(),e.nodes.value=[...I],Ge(()=>{_==null||_.resume()}))},{immediate:C}),jt(()=>{_==null||_.stop(),S==null||S.stop()})})},s=()=>{o.run(()=>{let _,S,C=!!n.edges.value.length;_=gt([e.edges,()=>{var I,y;return(y=(I=e.edges)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setEdges(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=gt([n.edges,()=>n.edges.value.length],([I])=>{var y;(y=e.edges)!=null&&y.value&&Array.isArray(e.edges.value)&&(_==null||_.pause(),e.edges.value=[...I],Ge(()=>{_==null||_.resume()}))},{immediate:C}),jt(()=>{_==null||_.stop(),S==null||S.stop()})})},a=()=>{o.run(()=>{ve(()=>t.maxZoom,()=>{t.maxZoom&&Ee(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ve(()=>t.minZoom,()=>{t.minZoom&&Ee(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ve(()=>t.translateExtent,()=>{t.translateExtent&&Ee(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ve(()=>t.nodeExtent,()=>{t.nodeExtent&&Ee(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{ve(()=>t.applyDefault,()=>{Ee(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const _=S=>Eo(null,null,function*(){let C=S;typeof t.autoConnect=="function"&&(C=yield t.autoConnect(S)),C!==!1&&n.addEdges([C])});ve(()=>t.autoConnect,()=>{Ee(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ve(n.autoConnect,(S,C,I)=>{S?n.onConnect(_):n.hooks.value.connect.off(_),I(()=>{n.hooks.value.connect.off(_)})},{immediate:!0})})},p=()=>{const _=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const S of Object.keys(t)){const C=S;if(!_.includes(C)){const I=be(()=>t[C]),y=n[C];ao(y)&&o.run(()=>{ve(I,N=>{Ee(N)&&(y.value=N)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),d(),h(),p()})()}),()=>o.stop()}function Cc(){return{edgesChange:H(),nodesChange:H(),nodeDoubleClick:H(),nodeClick:H(),nodeMouseEnter:H(),nodeMouseMove:H(),nodeMouseLeave:H(),nodeContextMenu:H(),nodeDragStart:H(),nodeDrag:H(),nodeDragStop:H(),nodesInitialized:H(),miniMapNodeClick:H(),miniMapNodeDoubleClick:H(),miniMapNodeMouseEnter:H(),miniMapNodeMouseMove:H(),miniMapNodeMouseLeave:H(),connect:H(),connectStart:H(),connectEnd:H(),clickConnectStart:H(),clickConnectEnd:H(),paneReady:H(),init:H(),move:H(),moveStart:H(),moveEnd:H(),selectionDragStart:H(),selectionDrag:H(),selectionDragStop:H(),selectionContextMenu:H(),selectionStart:H(),selectionEnd:H(),viewportChangeStart:H(),viewportChange:H(),viewportChangeEnd:H(),paneScroll:H(),paneClick:H(),paneContextMenu:H(),paneMouseEnter:H(),paneMouseMove:H(),paneMouseLeave:H(),edgeContextMenu:H(),edgeMouseEnter:H(),edgeMouseMove:H(),edgeMouseLeave:H(),edgeDoubleClick:H(),edgeClick:H(),edgeUpdateStart:H(),edgeUpdate:H(),edgeUpdateEnd:H(),updateNodeInternals:H(),error:H(e=>Ft(e.message))}}function Mc(e,t){const n=Nt();Rr(()=>{for(const[i,r]of Object.entries(t.value)){const s=a=>{e(i,a)};r.setEmitter(s),At(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),At(r.removeHasEmitListeners)}});function o(i){var r;const s=Ic(i);return!!((r=n==null?void 0:n.vnode.props)==null?void 0:r[s])}}function Ic(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function _r(){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:po.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:$t.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:tt.Bezier,style:{}},connectionMode:Je.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:mn()?"Meta":"Control",zoomActivationKeyCode:mn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Cc(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Tc=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function kc(e,t,n){const o=Sc(e),i=g=>{const f=g!=null?g:[];e.hooks.updateNodeInternals.trigger(f)},r=g=>Uu(g,e.nodes,e.edges),s=g=>Xu(g,e.nodes,e.edges),a=g=>rr(g,e.edges),l=({id:g,type:f,nodeId:v})=>{var V;var w;const k=g?`-${f}-${g}`:`-${f}`;return Array.from((V=(w=e.connectionLookup.get(`${v}${k}`))==null?void 0:w.values())!=null?V:[])},u=g=>{if(g)return t.value.get(g)},c=g=>{if(g)return n.value.get(g)},d=(g,f,v)=>{var M,G;var w,k;const V=[];for(const K of g){const ee={id:K.id,type:"position",dragging:v,from:K.from};if(f&&(ee.position=K.position,K.parentNode)){const ne=u(K.parentNode);ee.position={x:ee.position.x-((M=(w=ne==null?void 0:ne.computedPosition)==null?void 0:w.x)!=null?M:0),y:ee.position.y-((G=(k=ne==null?void 0:ne.computedPosition)==null?void 0:k.y)!=null?G:0)}}V.push(ee)}V!=null&&V.length&&e.hooks.nodesChange.trigger(V)},h=g=>{if(!e.vueFlowRef)return;const f=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!f)return;const v=window.getComputedStyle(f),{m22:w}=new window.DOMMatrixReadOnly(v.transform),k=[];for(const V of g){const M=V,G=u(M.id);if(G){const K=En(M.nodeElement);if(!!(K.width&&K.height&&(G.dimensions.width!==K.width||G.dimensions.height!==K.height||M.forceUpdate))){const ne=M.nodeElement.getBoundingClientRect();G.dimensions=K,G.handleBounds.source=oi("source",M.nodeElement,ne,w,G.id),G.handleBounds.target=oi("target",M.nodeElement,ne,w,G.id),k.push({id:G.id,type:"dimensions",dimensions:K})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),k.length&&e.hooks.nodesChange.trigger(k)},p=(g,f)=>{const v=new Set,w=new Set;for(const M of g)rt(M)?v.add(M.id):Qe(M)&&w.add(M.id);const k=qe(t.value,v,!0),V=qe(n.value,w);if(e.multiSelectionActive){for(const M of v)k.push(Ke(M,f));for(const M of w)V.push(Ke(M,f))}k.length&&e.hooks.nodesChange.trigger(k),V.length&&e.hooks.edgesChange.trigger(V)},E=g=>{if(e.multiSelectionActive){const f=g.map(v=>Ke(v.id,!0));e.hooks.nodesChange.trigger(f);return}e.hooks.nodesChange.trigger(qe(t.value,new Set(g.map(f=>f.id)),!0)),e.hooks.edgesChange.trigger(qe(n.value))},_=g=>{if(e.multiSelectionActive){const f=g.map(v=>Ke(v.id,!0));e.hooks.edgesChange.trigger(f);return}e.hooks.edgesChange.trigger(qe(n.value,new Set(g.map(f=>f.id)))),e.hooks.nodesChange.trigger(qe(t.value,new Set,!0))},S=g=>{p(g,!0)},C=g=>{const v=(g||e.nodes).map(w=>(w.selected=!1,Ke(w.id,!1)));e.hooks.nodesChange.trigger(v)},I=g=>{const v=(g||e.edges).map(w=>(w.selected=!1,Ke(w.id,!1)));e.hooks.edgesChange.trigger(v)},y=g=>{if(!g||!g.length)return p([],!1);const f=g.reduce((v,w)=>{const k=Ke(w.id,!1);return rt(w)?v.nodes.push(k):v.edges.push(k),v},{nodes:[],edges:[]});f.nodes.length&&e.hooks.nodesChange.trigger(f.nodes),f.edges.length&&e.hooks.edgesChange.trigger(f.edges)},N=g=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([g,e.maxZoom]),e.minZoom=g},z=g=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([e.minZoom,g]),e.maxZoom=g},L=g=>{var f;(f=e.d3Zoom)==null||f.translateExtent(g),e.translateExtent=g},F=g=>{e.nodeExtent=g,i()},Y=g=>{var f;(f=e.d3Zoom)==null||f.clickDistance(g)},j=g=>{e.nodesDraggable=g,e.nodesConnectable=g,e.elementsSelectable=g},X=g=>{const f=g instanceof Function?g(e.nodes):g;!e.initialized&&!f.length||(e.nodes=ii(f,u,e.hooks.error.trigger))},D=g=>{const f=g instanceof Function?g(e.edges):g;if(!e.initialized&&!f.length)return;const v=Rn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Vn(e.connectionLookup,n.value,v),e.edges=v},b=g=>{const f=g instanceof Function?g([...e.nodes,...e.edges]):g;!e.initialized&&!f.length||(X(f.filter(rt)),D(f.filter(Qe)))},J=g=>{let f=g instanceof Function?g(e.nodes):g;f=Array.isArray(f)?f:[f];const v=ii(f,u,e.hooks.error.trigger),w=[];for(const k of v)w.push(Ko(k));w.length&&e.hooks.nodesChange.trigger(w)},m=g=>{let f=g instanceof Function?g(e.edges):g;f=Array.isArray(f)?f:[f];const v=Rn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),w=[];for(const k of v)w.push(Ko(k));w.length&&e.hooks.edgesChange.trigger(w)},T=(g,f=!0,v=!1)=>{const w=g instanceof Function?g(e.nodes):g,k=Array.isArray(w)?w:[w],V=[],M=[];function G(ee){const ne=a(ee);for(const fe of ne)(!Ee(fe.deletable)||fe.deletable)&&M.push(Jo(fe.id,fe.source,fe.target,fe.sourceHandle,fe.targetHandle))}function K(ee){const ne=[];for(const fe of e.nodes)fe.parentNode===ee&&ne.push(fe);if(ne.length){for(const fe of ne)V.push(qo(fe.id));f&&G(ne);for(const fe of ne)K(fe.id)}}for(const ee of k){const ne=typeof ee=="string"?u(ee):ee;ne&&(Ee(ne.deletable)&&!ne.deletable||(V.push(qo(ne.id)),f&&G([ne]),v&&K(ne.id)))}M.length&&e.hooks.edgesChange.trigger(M),V.length&&e.hooks.nodesChange.trigger(V)},x=g=>{const f=g instanceof Function?g(e.edges):g,v=Array.isArray(f)?f:[f],w=[];for(const k of v){const V=typeof k=="string"?c(k):k;V&&(Ee(V.deletable)&&!V.deletable||w.push(Jo(typeof k=="string"?k:k.id,V.source,V.target,V.sourceHandle,V.targetHandle)))}e.hooks.edgesChange.trigger(w)},P=(g,f,v=!0)=>{const w=c(g.id);if(!w)return!1;const k=e.edges.indexOf(w),V=hc(g,f,w,v,e.hooks.error.trigger);if(V){const[M]=Rn([V],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((G,K)=>K===k?M:G),Vn(e.connectionLookup,n.value,[M]),M}return!1},A=(g,f,v={replace:!1})=>{const w=c(g);if(!w)return;const k=typeof f=="function"?f(w):f;w.data=v.replace?k:$($({},w.data),k)},R=g=>Wo(g,e.nodes),O=g=>{const f=Wo(g,e.edges);return Vn(e.connectionLookup,n.value,f),f},U=(g,f,v={replace:!1})=>{const w=u(g);if(!w)return;const k=typeof f=="function"?f(w):f;v.replace?e.nodes.splice(e.nodes.indexOf(w),1,k):Object.assign(w,k)},Q=(g,f,v={replace:!1})=>{const w=u(g);if(!w)return;const k=typeof f=="function"?f(w):f;w.data=v.replace?k:$($({},w.data),k)},ie=(g,f,v=!1)=>{v?e.connectionClickStartHandle=g:e.connectionStartHandle=g,e.connectionEndHandle=null,e.connectionStatus=null,f&&(e.connectionPosition=f)},B=(g,f=null,v=null)=>{e.connectionStartHandle&&(e.connectionPosition=g,e.connectionEndHandle=f,e.connectionStatus=v)},Z=(g,f)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,f?e.connectionClickStartHandle=null:e.connectionStartHandle=null},W=g=>{const f=Fu(g),v=f?null:kt(g)?g:u(g.id);return!f&&!v?[null,null,f]:[f?g:vn(v),v,f]},re=(g,f=!0,v=e.nodes)=>{const[w,k,V]=W(g);if(!w)return[];const M=[];for(const G of v||e.nodes){if(!V&&(G.id===k.id||!G.computedPosition))continue;const K=vn(G),ee=pn(K,w);(f&&ee>0||ee>=K.width*K.height||ee>=Number(w.width)*Number(w.height))&&M.push(G)}return M},ae=(g,f,v=!0)=>{const[w]=W(g);if(!w)return!1;const k=pn(w,f);return v&&k>0||k>=Number(w.width)*Number(w.height)},ue=g=>{const{viewport:f,dimensions:v,d3Zoom:w,d3Selection:k,translateExtent:V}=e;if(!w||!k||!g.x&&!g.y)return!1;const M=bt.translate(f.x+g.x,f.y+g.y).scale(f.zoom),G=[[0,0],[v.width,v.height]],K=w.constrain()(M,G,V),ee=e.viewport.x!==K.x||e.viewport.y!==K.y||e.viewport.zoom!==K.k;return w.transform(k,K),ee},ge=g=>{const f=g instanceof Function?g(e):g,v=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ee(f.defaultEdgeOptions)&&(e.defaultEdgeOptions=f.defaultEdgeOptions);const w=f.modelValue||f.nodes||f.edges?[]:void 0;w&&(f.modelValue&&w.push(...f.modelValue),f.nodes&&w.push(...f.nodes),f.edges&&w.push(...f.edges),b(w));const k=()=>{Ee(f.maxZoom)&&z(f.maxZoom),Ee(f.minZoom)&&N(f.minZoom),Ee(f.translateExtent)&&L(f.translateExtent)};for(const V of Object.keys(f)){const M=V,G=f[M];![...Tc,...v].includes(M)&&Ee(G)&&(e[M]=G)}Xn(()=>e.d3Zoom).not.toBeNull().then(k),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:b,setNodes:X,setEdges:D,addNodes:J,addEdges:m,removeNodes:T,removeEdges:x,findNode:u,findEdge:c,updateEdge:P,updateEdgeData:A,updateNode:U,updateNodeData:Q,applyEdgeChanges:O,applyNodeChanges:R,addSelectedElements:S,addSelectedNodes:E,addSelectedEdges:_,setMinZoom:N,setMaxZoom:z,setTranslateExtent:L,setNodeExtent:F,setPaneClickDistance:Y,removeSelectedElements:y,removeSelectedNodes:C,removeSelectedEdges:I,startConnection:ie,updateConnection:B,endConnection:Z,setInteractive:j,setState:ge,getIntersectingNodes:re,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ae,panBy:ue,fitView:g=>o.value.fitView(g),zoomIn:g=>o.value.zoomIn(g),zoomOut:g=>o.value.zoomOut(g),zoomTo:(g,f)=>o.value.zoomTo(g,f),setViewport:(g,f)=>o.value.setViewport(g,f),setTransform:(g,f)=>o.value.setTransform(g,f),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(g,f,v)=>o.value.setCenter(g,f,v),fitBounds:(g,f)=>o.value.fitBounds(g,f),project:g=>o.value.project(g),screenToFlowCoordinate:g=>o.value.screenToFlowCoordinate(g),flowToScreenCoordinate:g=>o.value.flowToScreenCoordinate(g),toObject:()=>{const g=[],f=[];for(const k of e.nodes){const v=k,{computedPosition:V,handleBounds:M,selected:G,dimensions:K,isParent:ee,resizing:ne,dragging:fe,events:Ve}=v,Re=ht(v,["computedPosition","handleBounds","selected","dimensions","isParent","resizing","dragging","events"]);g.push(Re)}for(const k of e.edges){const w=k,{selected:V,sourceNode:M,targetNode:G,events:K}=w,ee=ht(w,["selected","sourceNode","targetNode","events"]);f.push(ee)}return JSON.parse(JSON.stringify({nodes:g,edges:f,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:g=>new Promise(f=>{const{nodes:v,edges:w,position:k,zoom:V,viewport:M}=g;if(v&&X(v),w&&D(w),M!=null&&M.x&&(M!=null&&M.y)||k){const G=(M==null?void 0:M.x)||k[0],K=(M==null?void 0:M.y)||k[1],ee=(M==null?void 0:M.zoom)||V||e.viewport.zoom;return Xn(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:G,y:K,zoom:ee}).then(()=>{f(!0)})})}else f(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{var f,v,w;const g=_r();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const k=bt.translate((f=g.defaultViewport.x)!=null?f:0,(v=g.defaultViewport.y)!=null?v:0).scale(ct((w=g.defaultViewport.zoom)!=null?w:1,g.minZoom,g.maxZoom)),V=e.viewportRef.getBoundingClientRect(),M=[[0,0],[V.width,V.height]],G=e.d3Zoom.constrain()(k,M,g.translateExtent);e.d3Zoom.transform(e.d3Selection,G)}ge(g)},$destroy:()=>{}}}const Pc=["data-id","data-handleid","data-nodeid","data-handlepos"],$c={name:"Handle",compatConfig:{MODE:3}},yn=xe(de($({},$c),{props:{id:{default:null},type:{},position:{default:()=>q.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:t}){const n=Dr(e,["position","connectable","connectableStart","connectableEnd","id"]),o=be(()=>{var D;return(D=n.type)!=null?D:"source"}),i=be(()=>{var D;return(D=n.isValidConnection)!=null?D:null}),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=_e(),{id:p,node:E,nodeEl:_,connectedEdges:S}=mr(),C=we(),I=be(()=>typeof e.connectableStart!="undefined"?e.connectableStart:!0),y=be(()=>typeof e.connectableEnd!="undefined"?e.connectableEnd:!0),N=be(()=>{var D,b,J,m,T,x;return((D=s.value)==null?void 0:D.nodeId)===p&&((b=s.value)==null?void 0:b.id)===e.id&&((J=s.value)==null?void 0:J.type)===o.value||((m=l.value)==null?void 0:m.nodeId)===p&&((T=l.value)==null?void 0:T.id)===e.id&&((x=l.value)==null?void 0:x.type)===o.value}),z=be(()=>{var D,b,J;return((D=a.value)==null?void 0:D.nodeId)===p&&((b=a.value)==null?void 0:b.id)===e.id&&((J=a.value)==null?void 0:J.type)===o.value}),{handlePointerDown:L,handleClick:F}=vr({nodeId:p,handleId:e.id,isValidConnection:i,type:o}),Y=se(()=>typeof e.connectable=="string"&&e.connectable==="single"?!S.value.some(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==p?!1:b?b===e.id:!0}):typeof e.connectable=="number"?S.value.filter(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==p?!1:b?b===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(E,S.value):Ee(e.connectable)?e.connectable:c.value);je(()=>{var R;var D;if(!E.dimensions.width||!E.dimensions.height)return;const b=(D=E.handleBounds[o.value])==null?void 0:D.find(O=>O.id===e.id);if(!u.value||b)return;const J=u.value.querySelector(".vue-flow__transformationpane");if(!_.value||!C.value||!J||!e.id)return;const m=_.value.getBoundingClientRect(),T=C.value.getBoundingClientRect(),x=window.getComputedStyle(J),{m22:P}=new window.DOMMatrixReadOnly(x.transform),A=$({id:e.id,position:e.position,x:(T.left-m.left)/P,y:(T.top-m.top)/P,type:o.value,nodeId:p},En(C.value));E.handleBounds[o.value]=[...(R=E.handleBounds[o.value])!=null?R:[],A]});function j(D){const b=yo(D);Y.value&&I.value&&(b&&D.button===0||!b)&&L(D)}function X(D){!p||!a.value&&!I.value||Y.value&&F(D)}return t({handleClick:F,handlePointerDown:L,onClick:X,onPointerDown:j}),(D,b)=>(he(),ye("div",{ref_key:"handle",ref:C,"data-id":`${te(r)}-${te(p)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":te(p),"data-handlepos":D.position,class:yt(["vue-flow__handle",[`vue-flow__handle-${D.position}`,`vue-flow__handle-${e.id}`,te(d),te(h),o.value,{connectable:Y.value,connecting:z.value,connectablestart:I.value,connectableend:y.value,connectionindicator:Y.value&&(I.value&&!N.value||y.value&&N.value)}]]),onMousedown:j,onTouchstartPassive:j,onClick:X},[Xe(D.$slots,"default",{id:D.id})],42,Pc))}})),Cn=function({sourcePosition:e=q.Bottom,targetPosition:t=q.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){var l;const a=(l=s.label)!=null?l:n;return[me(yn,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?me(a):me(ze,[a]),me(yn,{type:"source",position:e,connectable:o,isValidConnection:r})]};Cn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Cn.inheritAttrs=!1;Cn.compatConfig={MODE:3};const Dc=Cn,Mn=function({targetPosition:e=q.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[me(yn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?me(r):me(ze,[r])]};Mn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Mn.inheritAttrs=!1;Mn.compatConfig={MODE:3};const Ac=Mn,In=function({sourcePosition:e=q.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[typeof r!="string"&&r?me(r):me(ze,[r]),me(yn,{type:"source",position:e,connectable:n,isValidConnection:o})]};In.props=["sourcePosition","label","isValidSourcePos","connectable","data"];In.inheritAttrs=!1;In.compatConfig={MODE:3};const Oc=In,zc=["transform"],Bc=["width","height","x","y","rx","ry"],Vc=["y"],Rc={name:"EdgeText",compatConfig:{MODE:3}},Hc=xe(de($({},Rc),{props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=we({x:0,y:0,width:0,height:0}),n=we(null),o=se(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);je(i),ve([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(he(),ye("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(he(),ye("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Ue(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,Bc)):Oe("",!0),st("text",pi(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Xe(r.$slots,"default",{},()=>[typeof r.label!="string"?(he(),at(Br(r.label),{key:0})):(he(),ye(ze,{key:1},[Vr(Fn(r.label),1)],64))])],16,Vc)],8,zc))}})),Lc=["id","d","marker-end","marker-start"],Yc=["d","stroke-width"],Fc={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Tn=xe(de($({},Fc),{props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=we(null),o=we(null),i=we(null),r=Pr();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(he(),ye(ze,null,[st("path",pi(te(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Lc),s.interactionWidth?(he(),ye("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Yc)):Oe("",!0),s.label&&s.labelX&&s.labelY?(he(),at(Hc,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Oe("",!0)],64))}}));function wr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function xr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Qt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ui({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case q.Left:s=t-Qt(t-o,r),a=n;break;case q.Right:s=t+Qt(o-t,r),a=n;break;case q.Top:s=t,a=n-Qt(n-i,r);break;case q.Bottom:s=t,a=n+Qt(i-n,r);break}return[s,a]}function br(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,curvature:a=.25}=e,[l,u]=ui({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=ui({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,p,E,_]=xr({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,p,E,_]}function ci({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case q.Left:case q.Right:r=.5*(t+o),s=n;break;case q.Top:case q.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function Er(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top}=e,[a,l]=ci({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=ci({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,h,p,E]=xr({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,h,p,E]}const di={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}};function Gc({source:e,sourcePosition:t=q.Bottom,target:n}){return t===q.Left||t===q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function fi(e,t){return Math.sqrt(ft(t.x-e.x,2)+ft(t.y-e.y,2))}function Xc({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:o=q.Top,center:i,offset:r}){var F,Y;const s=di[t],a=di[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=Gc({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let p,E,_;const S={x:0,y:0},C={x:0,y:0},[I,y,N,z]=wr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){E=(F=i.x)!=null?F:I,_=(Y=i.y)!=null?Y:y;const j=[{x:E,y:l.y},{x:E,y:u.y}],X=[{x:l.x,y:_},{x:u.x,y:_}];s[d]===h?p=d==="x"?j:X:p=d==="x"?X:j}else{const j=[{x:l.x,y:u.y}],X=[{x:u.x,y:l.y}];if(d==="x"?p=s.x===h?X:j:p=s.y===h?j:X,t===o){const T=Math.abs(e[d]-n[d]);if(T<=r){const x=Math.min(r-1,r-T);s[d]===h?S[d]=(l[d]>e[d]?-1:1)*x:C[d]=(u[d]>n[d]?-1:1)*x}}if(t!==o){const T=d==="x"?"y":"x",x=s[d]===a[T],P=l[T]>u[T],A=l[T]<u[T];(s[d]===1&&(!x&&P||x&&A)||s[d]!==1&&(!x&&A||x&&P))&&(p=d==="x"?j:X)}const D={x:l.x+S.x,y:l.y+S.y},b={x:u.x+C.x,y:u.y+C.y},J=Math.max(Math.abs(D.x-p[0].x),Math.abs(b.x-p[0].x)),m=Math.max(Math.abs(D.y-p[0].y),Math.abs(b.y-p[0].y));J>=m?(E=(D.x+b.x)/2,_=p[0].y):(E=p[0].x,_=(D.y+b.y)/2)}return[[e,{x:l.x+S.x,y:l.y+S.y},...p,{x:u.x+C.x,y:u.y+C.y},n],E,_,N,z]}function Uc(e,t,n,o){const i=Math.min(fi(e,t)/2,fi(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function ro(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,p,E,_]=Xc({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((C,I,y)=>{let N;return y>0&&y<d.length-1?N=Uc(d[y-1],I,d[y+1],a):N=`${y===0?"M":"L"}${I.x} ${I.y}`,C+=N,C},""),h,p,E,_]}function Zc(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=wr({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const Wc=xe({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Zc(e);return me(Tn,$($({path:n,labelX:o,labelY:i},t),e))}}}),Kc=Wc,qc=xe({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:t}){return()=>{var r,s;const[n,o,i]=ro(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Tn,$($({path:n,labelX:o,labelY:i},t),e))}}}),Sr=qc,Jc=xe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>me(Sr,de($($({},e),t),{borderRadius:0}))}}),Qc=Jc,jc=xe({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:t}){return()=>{var r,s;const[n,o,i]=br(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Tn,$($({path:n,labelX:o,labelY:i},t),e))}}}),ed=jc,td=xe({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=Er(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Tn,$($({path:n,labelX:o,labelY:i},t),e))}}}),nd=td,od={input:Oc,default:Dc,output:Ac},id={default:ed,straight:Kc,step:Qc,smoothstep:Sr,simplebezier:nd};function rd(e,t,n){const o=se(()=>_=>t.value.get(_)),i=se(()=>_=>n.value.get(_)),r=se(()=>{const _=$($({},id),e.edgeTypes),S=Object.keys(_);for(const C of e.edges)C.type&&!S.includes(C.type)&&(_[C.type]=C.type);return _}),s=se(()=>{const _=$($({},od),e.nodeTypes),S=Object.keys(_);for(const C of e.nodes)C.type&&!S.includes(C.type)&&(_[C.type]=C.type);return _}),a=se(()=>e.onlyRenderVisibleElements?ir(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=se(()=>{if(e.onlyRenderVisibleElements){const _=[];for(const S of e.edges){const C=t.value.get(S.source),I=t.value.get(S.target);tc({sourcePos:C.computedPosition||{x:0,y:0},targetPos:I.computedPosition||{x:0,y:0},sourceWidth:C.dimensions.width,sourceHeight:C.dimensions.height,targetWidth:I.dimensions.width,targetHeight:I.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&_.push(S)}return _}return e.edges}),u=se(()=>[...a.value,...l.value]),c=se(()=>{const _=[];for(const S of e.nodes)S.selected&&_.push(S);return _}),d=se(()=>{const _=[];for(const S of e.edges)S.selected&&_.push(S);return _}),h=se(()=>[...c.value,...d.value]),p=se(()=>{const _=[];for(const S of e.nodes)S.dimensions.width&&S.dimensions.height&&S.handleBounds!==void 0&&_.push(S);return _}),E=se(()=>a.value.length>0&&p.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:E}}class nt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var i;var t;const n=(t=Nt())==null?void 0:t.appContext.app,o=(i=n==null?void 0:n.config.globalProperties.$vueFlowStorage)!=null?i:nt.instance;return nt.instance=o!=null?o:new nt,n&&(n.config.globalProperties.$vueFlowStorage=nt.instance),nt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=_r(),i=zr(o),r={};for(const[h,p]of Object.entries(i.hooks)){const E=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[E]=p.on}const s={};for(const[h,p]of Object.entries(i.hooks))s[h]=p.trigger;const a=se(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),l=se(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),u=rd(i,a,l),c=kc(i,a,l);c.setState($($({},i),n));const d=de($($($($({},r),u),c),Qr(i)),{nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.46.4",$destroy:()=>{this.remove(t)}});return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function _e(e){const t=nt.getInstance(),n=gi(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r!=null?r:n==null?void 0:n.vueFlowId;let a;if(n){const l=St(li,null);typeof l!="undefined"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=r!=null?r:t.getId(),u=t.create(l,i);a=u,(n!=null?n:vi(!0)).run(()=>{ve(u.applyDefault,(d,h,p)=>{const E=S=>{u.applyNodeChanges(S)},_=S=>{u.applyEdgeChanges(S)};d?(u.onNodesChange(E),u.onEdgesChange(_)):(u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(_)),p(()=>{u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(_)})},{immediate:!0}),At(()=>{if(a){const d=t.get(a.id);d?d.$destroy():Ft(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(_t(li,a),n.vueFlowId=a.id),o){const l=Nt();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Ne(Se.USEVUEFLOW_OPTIONS))}return a}function sd(e){const{emits:t,dimensions:n}=_e();let o;je(()=>{const i=()=>{var l;var r,s;if(!e.value||!((l=(s=(r=e.value).checkVisibility)==null?void 0:s.call(r))==null||l))return;const a=En(e.value);(a.width===0||a.height===0)&&t.error(new Ne(Se.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),mi(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const ad={name:"UserSelection",compatConfig:{MODE:3}},ld=xe(de($({},ad),{props:{userSelectionRect:{}},setup(e){return(t,n)=>(he(),ye("div",{class:"vue-flow__selection vue-flow__container",style:Ue({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}})),ud=["tabIndex"],cd={name:"NodesSelection",compatConfig:{MODE:3}},dd=xe(de($({},cd),{setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=_e(),a=yr(),l=we(null),u=gr({el:l,onStart(E){t.selectionDragStart(E),t.nodeDragStart(E)},onDrag(E){t.selectionDrag(E),t.nodeDrag(E)},onStop(E){t.selectionDragStop(E),t.nodeDragStop(E)}});je(()=>{var E;r.value||(E=l.value)==null||E.focus({preventScroll:!0})});const c=se(()=>or(o.value)),d=se(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(E){t.selectionContextMenu({event:E,nodes:o.value})}function p(E){r||mt[E.key]&&(E.preventDefault(),a({x:mt[E.key].x,y:mt[E.key].y},E.shiftKey))}return(E,_)=>!te(s)&&c.value.width&&c.value.height?(he(),ye("div",{key:0,class:yt(["vue-flow__nodesselection vue-flow__container",te(i)]),style:Ue({transform:`translate(${te(n).x}px,${te(n).y}px) scale(${te(n).zoom})`})},[st("div",{ref_key:"el",ref:l,class:yt([{dragging:te(u)},"vue-flow__nodesselection-rect"]),style:Ue(d.value),tabIndex:te(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,ud)],6)):Oe("",!0)}}));function fd(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const hd={name:"Pane",compatConfig:{MODE:3}},gd=xe(de($({},hd),{props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:p,selectionMode:E,deleteKeyCode:_,multiSelectionKeyCode:S,multiSelectionActive:C,edgeLookup:I,nodeLookup:y,connectionLookup:N,defaultEdgeOptions:z,connectionStartHandle:L}=_e(),F=we(null),Y=we(new Set),j=we(new Set),X=we(),D=be(()=>l.value&&(e.isSelecting||r.value)),b=be(()=>L.value!==null);let J=!1,m=!1;const T=Dt(_,{actInsideInputWithModifier:!1}),x=Dt(S);ve(T,B=>{B&&(h(d.value),p(c.value),u.value=!1)}),ve(x,B=>{C.value=B});function P(B,Z){return W=>{W.target===Z&&(B==null||B(W))}}function A(B){if(J||b.value){J=!1;return}i.paneClick(B),s(),u.value=!1}function R(B){B.preventDefault(),B.stopPropagation(),i.paneContextMenu(B)}function O(B){i.paneScroll(B)}function U(B){var Z,W,re;if(X.value=(Z=t.value)==null?void 0:Z.getBoundingClientRect(),!l.value||!e.isSelecting||B.button!==0||B.target!==F.value||!X.value)return;(re=(W=B.target)==null?void 0:W.setPointerCapture)==null||re.call(W,B.pointerId);const{x:ae,y:ue}=fd(B,X.value);m=!0,J=!1,s(),a.value={width:0,height:0,startX:ae,startY:ue,x:ae,y:ue},i.selectionStart(B)}function Q(B){var g,f;var Z;if(!X.value||!a.value)return;J=!0;const{x:W,y:re}=De(B,X.value),{startX:ae=0,startY:ue=0}=a.value,ge={startX:ae,startY:ue,x:W<ae?W:ae,y:re<ue?re:ue,width:Math.abs(W-ae),height:Math.abs(re-ue)},pe=Y.value,oe=j.value;Y.value=new Set(ir(n.value,ge,o.value,E.value===po.Partial,!0).map(v=>v.id)),j.value=new Set;const ce=(g=(Z=z.value)==null?void 0:Z.selectable)!=null?g:!0;for(const v of Y.value){const w=N.value.get(v);if(w)for(const{edgeId:k}of w.values()){const V=I.value.get(k);V&&((f=V.selectable)!=null?f:ce)&&j.value.add(k)}}if(!ai(pe,Y.value)){const v=qe(y.value,Y.value,!0);i.nodesChange(v)}if(!ai(oe,j.value)){const v=qe(I.value,j.value);i.edgesChange(v)}a.value=ge,r.value=!0,u.value=!1}function ie(B){var Z;B.button!==0||!m||((Z=B.target)==null||Z.releasePointerCapture(B.pointerId),!r.value&&a.value&&B.target===F.value&&A(B),r.value=!1,a.value=null,u.value=Y.value.size>0,i.selectionEnd(B),e.selectionKeyPressed&&(J=!1),m=!1)}return(B,Z)=>(he(),ye("div",{ref_key:"container",ref:F,class:yt(["vue-flow__pane vue-flow__container",{selection:B.isSelecting}]),onClick:Z[0]||(Z[0]=W=>D.value?void 0:P(A,F.value)(W)),onContextmenu:Z[1]||(Z[1]=W=>P(R,F.value)(W)),onWheelPassive:Z[2]||(Z[2]=W=>P(O,F.value)(W)),onPointerenter:Z[3]||(Z[3]=W=>D.value?void 0:te(i).paneMouseEnter(W)),onPointerdown:Z[4]||(Z[4]=W=>D.value?U(W):te(i).paneMouseMove(W)),onPointermove:Z[5]||(Z[5]=W=>D.value?Q(W):te(i).paneMouseMove(W)),onPointerup:Z[6]||(Z[6]=W=>D.value?ie(W):void 0),onPointerleave:Z[7]||(Z[7]=W=>te(i).paneMouseLeave(W))},[Xe(B.$slots,"default"),te(r)&&te(a)?(he(),at(ld,{key:0,"user-selection-rect":te(a)},null,8,["user-selection-rect"])):Oe("",!0),te(u)&&te(d).length?(he(),at(dd,{key:1})):Oe("",!0)],34))}})),vd={name:"Transform",compatConfig:{MODE:3}},pd=xe(de($({},vd),{setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=se(()=>n.value?!o.value:!1),r=se(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(he(),ye("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ue({transform:r.value,opacity:i.value?0:void 0})},[Xe(s.$slots,"default")],4))}})),md={name:"Viewport",compatConfig:{MODE:3}},yd=xe(de($({},md),{setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:E,preventScrolling:_,noWheelClassName:S,noPanClassName:C,emits:I,connectionStartHandle:y,userSelectionActive:N,paneDragging:z,d3Zoom:L,d3Selection:F,d3ZoomHandler:Y,viewport:j,viewportRef:X,paneClickDistance:D}=_e();sd(X);const b=an(!1),J=an(!1);let m=null,T=!1,x=0,P={x:0,y:0,zoom:0};const A=Dt(a),R=Dt(s),O=Dt(r),U=be(()=>(!R.value||R.value&&s.value===!0)&&(A.value||d.value)),Q=be(()=>A.value||l.value),ie=be(()=>R.value||s.value===!0&&U.value!==!0),B=be(()=>y.value!==null);je(()=>{var w,k,V;if(!X.value){Ft("Viewport element is missing");return}const ue=X.value,ge=ue.getBoundingClientRect(),pe=zu().clickDistance(D.value).scaleExtent([t.value,n.value]).translateExtent(i.value),oe=Ie(ue).call(pe),ce=oe.on("wheel.zoom"),g=bt.translate((w=o.value.x)!=null?w:0,(k=o.value.y)!=null?k:0).scale(ct((V=o.value.zoom)!=null?V:1,t.value,n.value)),f=[[0,0],[ge.width,ge.height]],v=pe.constrain()(g,f,i.value);pe.transform(oe,v),pe.wheelDelta(Uo),L.value=pe,F.value=oe,Y.value=ce,j.value={x:v.x,y:v.y,zoom:v.k},pe.on("start",M=>{var G;if(!M.sourceEvent)return null;x=M.sourceEvent.button,b.value=!0;const K=re(M.transform);((G=M.sourceEvent)==null?void 0:G.type)==="mousedown"&&(z.value=!0),P=K,I.viewportChangeStart(K),I.moveStart({event:M,flowTransform:K})}),pe.on("end",M=>{if(!M.sourceEvent)return null;if(b.value=!1,z.value=!1,Z(U.value,x!=null?x:0)&&!T&&I.paneContextMenu(M.sourceEvent),T=!1,W(P,M.transform)){const G=re(M.transform);P=G,I.viewportChangeEnd(G),I.moveEnd({event:M,flowTransform:G})}}),pe.filter(M=>{var G;const K=O.value||E.value,ee=p.value&&M.ctrlKey,ne=M.button,fe=M.type==="wheel";if(ne===1&&M.type==="mousedown"&&(ae(M,"vue-flow__node")||ae(M,"vue-flow__edge")))return!0;if(!U.value&&!K&&!Q.value&&!h.value&&!p.value||N.value||B.value&&!fe||!h.value&&M.type==="dblclick"||ae(M,S.value)&&fe||ae(M,C.value)&&(!fe||Q.value&&fe&&!O.value)||!p.value&&M.ctrlKey&&fe||!K&&!Q.value&&!ee&&fe)return!1;if(!p&&M.type==="touchstart"&&((G=M.touches)==null?void 0:G.length)>1)return M.preventDefault(),!1;if(!U.value&&(M.type==="mousedown"||M.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&ne===0||Array.isArray(d.value)&&!d.value.includes(ne)&&(M.type==="mousedown"||M.type==="touchstart"))return!1;const Ve=Array.isArray(d.value)&&d.value.includes(ne)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!ne||ne<=1;return(!M.ctrlKey||A.value||fe)&&Ve}),ve([N,U],()=>{N.value&&!b.value?pe.on("zoom",null):N.value||pe.on("zoom",M=>{j.value={x:M.transform.x,y:M.transform.y,zoom:M.transform.k};const G=re(M.transform);T=Z(U.value,x!=null?x:0),I.viewportChange(G),I.move({event:M,flowTransform:G})})},{immediate:!0}),ve([N,Q,u,O,p,_,S],()=>{Q.value&&!O.value&&!N.value?oe.on("wheel.zoom",M=>{if(ae(M,S.value))return!1;const G=O.value||E.value,K=p.value&&M.ctrlKey;if(!(!_.value||Q.value||G||K))return!1;M.preventDefault(),M.stopImmediatePropagation();const ne=oe.property("__zoom").k||1,fe=mn();if(!A.value&&M.ctrlKey&&p.value&&fe){const Nr=Pe(M),Cr=Uo(M),Mr=ne*ft(2,Cr);pe.scaleTo(oe,Mr,Nr,M);return}const Ve=M.deltaMode===1?20:1;let Re=u.value===$t.Vertical?0:M.deltaX*Ve,et=u.value===$t.Horizontal?0:M.deltaY*Ve;!fe&&M.shiftKey&&u.value!==$t.Vertical&&!Re&&et&&(Re=et,et=0),pe.translateBy(oe,-(Re/ne)*c.value,-(et/ne)*c.value);const dt=re(oe.property("__zoom"));m&&clearTimeout(m),J.value?(I.move({event:M,flowTransform:dt}),I.viewportChange(dt),m=setTimeout(()=>{I.moveEnd({event:M,flowTransform:dt}),I.viewportChangeEnd(dt),J.value=!1},150)):(J.value=!0,I.moveStart({event:M,flowTransform:dt}),I.viewportChangeStart(dt))},{passive:!1}):typeof ce!="undefined"&&oe.on("wheel.zoom",function(M,G){const K=!_.value&&M.type==="wheel"&&!M.ctrlKey,ee=O.value||E.value,ne=p.value&&M.ctrlKey;if(!ee&&!l.value&&!ne&&M.type==="wheel"||K||ae(M,S.value))return null;M.preventDefault(),ce.call(this,M,G)},{passive:!1})},{immediate:!0})});function Z(ue,ge){return ge===2&&Array.isArray(ue)&&ue.includes(2)}function W(ue,ge){return ue.x!==ge.x&&!Number.isNaN(ge.x)||ue.y!==ge.y&&!Number.isNaN(ge.y)||ue.zoom!==ge.k&&!Number.isNaN(ge.k)}function re(ue){return{x:ue.x,y:ue.y,zoom:ue.k}}function ae(ue,ge){return ue.target.closest(`.${ge}`)}return(ue,ge)=>(he(),ye("div",{ref_key:"viewportRef",ref:X,class:"vue-flow__viewport vue-flow__container"},[Ye(gd,{"is-selecting":ie.value,"selection-key-pressed":te(R),class:yt({connecting:B.value,dragging:te(z),draggable:te(d)===!0||Array.isArray(te(d))&&te(d).includes(0)})},{default:Yn(()=>[Ye(pd,null,{default:Yn(()=>[Xe(ue.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}})),_d=["id"],wd=["id"],xd=["id"],bd={name:"A11yDescriptions",compatConfig:{MODE:3}},Ed=xe(de($({},bd),{setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(he(),ye(ze,null,[st("div",{id:`${te(Ki)}-${te(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Fn(te(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,_d),st("div",{id:`${te(qi)}-${te(t)}`,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,wd),te(n)?Oe("",!0):(he(),ye("div",{key:0,id:`${te(Yu)}-${te(t)}`,"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%)"}},Fn(te(o)),9,xd))],64))}}));function Sd(){const e=_e();ve(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Nd(e,t,n){return n===q.Left?e-t:n===q.Right?e+t:e}function Cd(e,t,n){return n===q.Top?e-t:n===q.Bottom?e+t:e}const _o=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=q.Top,type:i}){return me("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Nd(t,e,o),cy:Cd(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};_o.props=["radius","centerX","centerY","position","type"];_o.compatConfig={MODE:3};const hi=_o,Md=xe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:E,elementsSelectable:_,edgesUpdatable:S,edgesFocusable:C,hooks:I}=_e(),y=se(()=>c(e.id)),{emit:N,on:z}=yc(y.value,r),L=St(Nn),F=Nt(),Y=we(!1),j=we(!1),X=we(""),D=we(null),b=we("source"),J=we(null),m=be(()=>typeof y.value.selectable=="undefined"?_.value:y.value.selectable),T=be(()=>typeof y.value.updatable=="undefined"?S.value:y.value.updatable),x=be(()=>typeof y.value.focusable=="undefined"?C.value:y.value.focusable);_t(vc,e.id),_t(pc,J);const P=se(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),A=se(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),R=se(()=>{var k;const f=y.value.type||"default",v=L==null?void 0:L[`edge-${f}`];if(v)return v;let w=(k=y.value.template)!=null?k:l.value[f];if(typeof w=="string"&&F){const V=Object.keys(F.appContext.components);V&&V.includes(f)&&(w=yi(f,!1))}return w&&typeof w!="string"?w:(r.error(new Ne(Se.EDGE_TYPE_MISSING,w)),!1)}),{handlePointerDown:O}=vr({nodeId:X,handleId:D,type:b,isValidConnection:h,edgeUpdaterType:b,onEdgeUpdate:ie,onEdgeUpdateEnd:B});return()=>{var et;const f=d(y.value.source),v=d(y.value.target),w="pathOptions"in y.value?y.value.pathOptions:{};if(!f&&!v)return r.error(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!f)return r.error(new Ne(Se.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!v)return r.error(new Ne(Se.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||f.hidden||v.hidden)return null;let k;o.value===Je.Strict?k=f.handleBounds.source:k=[...f.handleBounds.source||[],...f.handleBounds.target||[]];const V=ei(k,y.value.sourceHandle);let M;o.value===Je.Strict?M=v.handleBounds.target:M=[...v.handleBounds.target||[],...v.handleBounds.source||[]];const G=ei(M,y.value.targetHandle),K=(V==null?void 0:V.position)||q.Bottom,ee=(G==null?void 0:G.position)||q.Top,{x:ne,y:fe}=Et(f,V,K),{x:Ve,y:Re}=Et(v,G,ee);return y.value.sourceX=ne,y.value.sourceY=fe,y.value.targetX=Ve,y.value.targetY=Re,me("g",de($({ref:J,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${R.value===!1?"default":y.value.type||"default"}`,a.value,P.value,{updating:Y.value,selected:y.value.selected,animated:y.value.animated,inactive:!m.value&&!I.value.edgeClick.hasListeners()}],tabIndex:x.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:(et=y.value.ariaLabel)!=null?et:`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":x.value?`${qi}-${t}`:void 0,"aria-roledescription":"edge",role:x.value?"group":"img"},y.value.domAttributes),{onClick:W,onContextmenu:re,onDblclick:ae,onMouseenter:ue,onMousemove:ge,onMouseleave:pe,onKeyDown:x.value?g:void 0}),[j.value?null:me(R.value===!1?l.value.default:R.value,$({id:e.id,sourceNode:f,targetNode:v,source:y.value.source,target:y.value.target,type:y.value.type,updatable:T.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:$($({},y.value.events),z),style:A.value,markerStart:`url('#${Ht(y.value.markerStart,t)}')`,markerEnd:`url('#${Ht(y.value.markerEnd,t)}')`,sourcePosition:K,targetPosition:ee,sourceX:ne,sourceY:fe,targetX:Ve,targetY:Re,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth},w)),[T.value==="source"||T.value===!0?[me("g",{onMousedown:oe,onMouseenter:U,onMouseout:Q},me(hi,{position:K,centerX:ne,centerY:fe,radius:i.value,type:"source","data-type":"source"}))]:null,T.value==="target"||T.value===!0?[me("g",{onMousedown:ce,onMouseenter:U,onMouseout:Q},me(hi,{position:ee,centerX:Ve,centerY:Re,radius:i.value,type:"target","data-type":"target"}))]:null]])};function U(){Y.value=!0}function Q(){Y.value=!1}function ie(f,v){N.update({event:f,edge:y.value,connection:v})}function B(f){N.updateEnd({event:f,edge:y.value}),j.value=!1}function Z(f,v){var w;f.button===0&&(j.value=!0,X.value=v?y.value.target:y.value.source,D.value=(w=v?y.value.targetHandle:y.value.sourceHandle)!=null?w:null,b.value=v?"target":"source",N.updateStart({event:f,edge:y.value}),O(f))}function W(f){var v;const w={event:f,edge:y.value};m.value&&(s.value=!1,y.value.selected&&p.value?(u([y.value]),(v=J.value)==null||v.blur()):n([y.value])),N.click(w)}function re(f){N.contextMenu({event:f,edge:y.value})}function ae(f){N.doubleClick({event:f,edge:y.value})}function ue(f){N.mouseEnter({event:f,edge:y.value})}function ge(f){N.mouseMove({event:f,edge:y.value})}function pe(f){N.mouseLeave({event:f,edge:y.value})}function oe(f){Z(f,!0)}function ce(f){Z(f,!1)}function g(f){var v;!E.value&&Ji.includes(f.key)&&m.value&&(f.key==="Escape"?((v=J.value)==null||v.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Id=Md,Td=xe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=_e(),h=(e=St(Nn))==null?void 0:e["connection-line"],p=se(()=>{var I;return d((I=o.value)==null?void 0:I.nodeId)}),E=se(()=>{var y;var I;return(y=d((I=i.value)==null?void 0:I.nodeId))!=null?y:null}),_=se(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),S=se(()=>l.value.markerStart?`url(#${Ht(l.value.markerStart,t)})`:""),C=se(()=>l.value.markerEnd?`url(#${Ht(l.value.markerEnd,t)})`:"");return()=>{var A,R,O,U,Q,ie,B,Z,W;var I,y,N;if(!p.value||!o.value)return null;const z=o.value.id,L=o.value.type,F=p.value.handleBounds;let Y=(A=F==null?void 0:F[L])!=null?A:[];if(n.value===Je.Loose){const re=(R=F==null?void 0:F[L==="source"?"target":"source"])!=null?R:[];Y=[...Y,...re]}if(!Y)return null;const j=(O=z?Y.find(re=>re.id===z):Y[0])!=null?O:null,X=(U=j==null?void 0:j.position)!=null?U:q.Top,{x:D,y:b}=Et(p.value,j,X);let J=null;E.value&&(n.value===Je.Strict?J=((I=E.value.handleBounds[L==="source"?"target":"source"])==null?void 0:I.find(re=>{var ae;return re.id===((ae=i.value)==null?void 0:ae.id)}))||null:J=((y=[...(Q=E.value.handleBounds.source)!=null?Q:[],...(ie=E.value.handleBounds.target)!=null?ie:[]])==null?void 0:y.find(re=>{var ae;return re.id===((ae=i.value)==null?void 0:ae.id)}))||null);const m=(B=(N=i.value)==null?void 0:N.position)!=null?B:X?oo[X]:null;if(!X||!m)return null;const T=(W=(Z=s.value)!=null?Z:l.value.type)!=null?W:tt.Bezier;let x="";const P={sourceX:D,sourceY:b,sourcePosition:X,targetX:_.value.x,targetY:_.value.y,targetPosition:m};return T===tt.Bezier?[x]=br(P):T===tt.Step?[x]=ro(de($({},P),{borderRadius:0})):T===tt.SmoothStep?[x]=ro(P):T===tt.SimpleBezier?[x]=Er(P):x=`M${D},${b} ${_.value.x},${_.value.y}`,me("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},me("g",{class:"vue-flow__connection"},h?me(h,{sourceX:D,sourceY:b,sourcePosition:X,targetX:_.value.x,targetY:_.value.y,targetPosition:m,sourceNode:p.value,sourceHandle:j,targetNode:E.value,targetHandle:J,markerEnd:C.value,markerStart:S.value,connectionStatus:u.value}):me("path",{d:x,class:[l.value.class,u,"vue-flow__connection-path"],style:$($({},a.value),l.value.style),"marker-end":C.value,"marker-start":S.value})))}}}),kd=Td,Pd=["id","markerWidth","markerHeight","markerUnits","orient"],$d={name:"MarkerType",compatConfig:{MODE:3}},Dd=xe(de($({},$d),{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(t,n)=>(he(),ye("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===te(eo).ArrowClosed?(he(),ye("polyline",{key:0,style:Ue({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Oe("",!0),t.type===te(eo).Arrow?(he(),ye("polyline",{key:1,style:Ue({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Oe("",!0)],8,Pd))}})),Ad={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Od={name:"MarkerDefinitions",compatConfig:{MODE:3}},zd=xe(de($({},Od),{setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=se(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Ht(u,t);s.has(c)||(typeof u=="object"?a.push(de($({},u),{id:c,color:u.color||i.value})):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(he(),ye("svg",Ad,[st("defs",null,[(he(!0),ye(ze,null,so(r.value,l=>(he(),at(Dd,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}})),Bd={name:"Edges",compatConfig:{MODE:3}},Vd=xe(de($({},Bd),{setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(he(),ye(ze,null,[Ye(zd),(he(!0),ye(ze,null,so(te(n),s=>(he(),ye("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ue({zIndex:te(nc)(s,te(t),te(o))})},[Ye(te(Id),{id:s.id},null,8,["id"])],4))),128)),Ye(te(kd))],64))}})),Rd=xe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:E,ariaLiveMessage:_,snapToGrid:S,snapGrid:C,nodeDragThreshold:I,nodesDraggable:y,elementsSelectable:N,nodesConnectable:z,nodesFocusable:L,hooks:F}=_e(),Y=we(null);_t(hr,Y),_t(fr,e.id);const j=St(Nn),X=Nt(),D=yr(),{node:b,parentNode:J}=mr(e.id),{emit:m,on:T}=xc(b,s),x=be(()=>typeof b.draggable=="undefined"?y.value:b.draggable),P=be(()=>typeof b.selectable=="undefined"?N.value:b.selectable),A=be(()=>typeof b.connectable=="undefined"?z.value:b.connectable),R=be(()=>typeof b.focusable=="undefined"?L.value:b.focusable),O=se(()=>P.value||x.value||F.value.nodeClick.hasListeners()||F.value.nodeDoubleClick.hasListeners()||F.value.nodeMouseEnter.hasListeners()||F.value.nodeMouseMove.hasListeners()||F.value.nodeMouseLeave.hasListeners()),U=be(()=>!!b.dimensions.width&&!!b.dimensions.height),Q=se(()=>{const v=b.type||"default",w=j==null?void 0:j[`node-${v}`];if(w)return w;let k=b.template||d.value[v];if(typeof k=="string"&&X){const V=Object.keys(X.appContext.components);V&&V.includes(v)&&(k=yi(v,!1))}return k&&typeof k!="string"?k:(s.error(new Ne(Se.NODE_TYPE_MISSING,k)),!1)}),ie=gr({id:e.id,el:Y,disabled:()=>!x.value,selectable:P,dragHandle:()=>b.dragHandle,onStart(v){m.dragStart(v)},onDrag(v){m.drag(v)},onStop(v){m.dragStop(v)},onClick(v){g(v)}}),B=se(()=>b.class instanceof Function?b.class(b):b.class),Z=se(()=>{const v=(b.style instanceof Function?b.style(b):b.style)||{},w=b.width instanceof Function?b.width(b):b.width,k=b.height instanceof Function?b.height(b):b.height;return!v.width&&w&&(v.width=typeof w=="string"?w:`${w}px`),!v.height&&k&&(v.height=typeof k=="string"?k:`${k}px`),v}),W=be(()=>{var v,w;return Number((w=(v=b.zIndex)!=null?v:Z.value.zIndex)!=null?w:0)});return c(v=>{(v.includes(e.id)||!v.length)&&ae()}),je(()=>{ve(()=>b.hidden,(v=!1,w,k)=>{!v&&Y.value&&(e.resizeObserver.observe(Y.value),k(()=>{Y.value&&e.resizeObserver.unobserve(Y.value)}))},{immediate:!0,flush:"post"})}),ve([()=>b.type,()=>b.sourcePosition,()=>b.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])})}),ve([()=>b.position.x,()=>b.position.y,()=>{var v;return(v=J.value)==null?void 0:v.computedPosition.x},()=>{var v;return(v=J.value)==null?void 0:v.computedPosition.y},()=>{var v;return(v=J.value)==null?void 0:v.computedPosition.z},W,()=>b.selected,()=>b.dimensions.height,()=>b.dimensions.width,()=>{var v;return(v=J.value)==null?void 0:v.dimensions.height},()=>{var v;return(v=J.value)==null?void 0:v.dimensions.width}],([v,w,k,V,M,G])=>{const K={x:v,y:w,z:G+(p.value&&b.selected?1e3:0)};typeof k!="undefined"&&typeof V!="undefined"?b.computedPosition=qu({x:k,y:V,z:M},K):b.computedPosition=K},{flush:"post",immediate:!0}),ve([()=>b.extent,h],([v,w],[k,V])=>{(v!==k||w!==V)&&re()}),b.extent==="parent"||typeof b.extent=="object"&&"range"in b.extent&&b.extent.range==="parent"?Xn(()=>U).toBe(!0).then(re):re(),()=>{var v,w;return b.hidden?null:me("div",de($({ref:Y,"data-id":b.id,class:["vue-flow__node",`vue-flow__node-${Q.value===!1?"default":b.type||"default"}`,{[n.value]:x.value,dragging:ie==null?void 0:ie.value,draggable:x.value,selected:b.selected,selectable:P.value,parent:b.isParent},B.value],style:$({visibility:U.value?"visible":"hidden",zIndex:(v=b.computedPosition.z)!=null?v:W.value,transform:`translate(${b.computedPosition.x}px,${b.computedPosition.y}px)`,pointerEvents:O.value?"all":"none"},Z.value),tabIndex:R.value?0:void 0,role:R.value?"group":void 0,"aria-describedby":E.value?void 0:`${Ki}-${t}`,"aria-label":b.ariaLabel,"aria-roledescription":"node"},b.domAttributes),{onMouseenter:ue,onMousemove:ge,onMouseleave:pe,onContextmenu:oe,onClick:g,onDblclick:ce,onKeydown:f}),[me(Q.value===!1?d.value.default:Q.value,{id:b.id,type:b.type,data:b.data,events:$($({},b.events),T),selected:b.selected,resizing:b.resizing,dragging:ie.value,connectable:A.value,position:b.computedPosition,dimensions:b.dimensions,isValidTargetPos:b.isValidTargetPos,isValidSourcePos:b.isValidSourcePos,parent:b.parentNode,parentNodeId:b.parentNode,zIndex:(w=b.computedPosition.z)!=null?w:W.value,targetPosition:b.targetPosition,sourcePosition:b.sourcePosition,label:b.label,dragHandle:b.dragHandle,onUpdateNodeInternals:ae})])};function re(){const v=b.computedPosition,{computedPosition:w,position:k}=mo(b,S.value?Sn(v,C.value):v,s.error,h.value,J.value);(b.computedPosition.x!==w.x||b.computedPosition.y!==w.y)&&(b.computedPosition=$($({},b.computedPosition),w)),(b.position.x!==k.x||b.position.y!==k.y)&&(b.position=k)}function ae(){Y.value&&u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])}function ue(v){ie!=null&&ie.value||m.mouseEnter({event:v,node:b})}function ge(v){ie!=null&&ie.value||m.mouseMove({event:v,node:b})}function pe(v){ie!=null&&ie.value||m.mouseLeave({event:v,node:b})}function oe(v){return m.contextMenu({event:v,node:b})}function ce(v){return m.doubleClick({event:v,node:b})}function g(v){P.value&&(!o.value||!x.value||I.value>0)&&io(b,r.value,l,a,i,!1,Y.value),m.click({event:v,node:b})}function f(v){if(!(to(v)||E.value))if(Ji.includes(v.key)&&P.value){const w=v.key==="Escape";io(b,r.value,l,a,i,w,Y.value)}else x.value&&b.selected&&mt[v.key]&&(v.preventDefault(),_.value=`Moved selected node ${v.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.position.x}, y: ${~~b.position.y}`,D({x:mt[v.key].x,y:mt[v.key].y},v.shiftKey))}}}),Hd=Rd,Ld={height:"0",width:"0"},Yd={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},jd=xe(de($({},Yd),{setup(e){const{viewportRef:t}=_e(),n=be(()=>{var o;return(o=t.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(he(),ye("svg",null,[(he(),ye("foreignObject",Ld,[(he(),at($r,{to:n.value,disabled:!n.value},[Xe(o.$slots,"default")],8,["to","disabled"]))]))]))}}));function Fd(e={includeHiddenNodes:!1}){const{nodes:t}=_e();return se(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Gd={class:"vue-flow__nodes vue-flow__container"},Xd={name:"Nodes",compatConfig:{MODE:3}},Ud=xe(de($({},Xd),{setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=_e(),i=Fd(),r=we();return ve(i,s=>{s&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),je(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Ge(()=>n(a))})}),mi(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(he(),ye("div",Gd,[r.value?(he(!0),ye(ze,{key:0},so(te(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Hr(d,h))return d;const p=(he(),at(te(Hd),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},a,0),128)):Oe("",!0)]))}}));function Zd(){const{emits:e}=_e();je(()=>{if(dr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ne(Se.MISSING_STYLES))}})}const Wd=st("div",{class:"vue-flow__edge-labels"},null,-1),Kd={name:"VueFlow",compatConfig:{MODE:3}},ef=xe(de($({},Kd),{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:t,emit:n}){const o=e,i=Ar(),r=kn(o,"modelValue",n),s=kn(o,"nodes",n),a=kn(o,"edges",n),l=_e(o),u=Nc({modelValue:r,nodes:s,edges:a},o,l);return Mc(n,l.hooks),Sd(),Zd(),_t(Nn,i),Or(u),t(l),(c,d)=>(he(),ye("div",{ref:te(l).vueFlowRef,class:"vue-flow"},[Ye(yd,null,{default:Yn(()=>[Ye(Vd),Wd,Ye(Ud),Xe(c.$slots,"zoom-pane")]),_:3}),Xe(c.$slots,"default"),Ye(Ed)],512))}})),qd={name:"Panel",compatConfig:{MODE:3}},tf=xe(de($({},qd),{props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=_e(),o=se(()=>`${t.position}`.split("-"));return(i,r)=>(he(),ye("div",{class:yt(["vue-flow__panel",o.value]),style:Ue({pointerEvents:te(n)?"none":"all"})},[Xe(i.$slots,"default")],6))}}));function nf(e={}){const{handleType:t,handleId:n,nodeId:o,onConnect:i,onDisconnect:r}=e,{connectionLookup:s}=_e(),a=pr(),l=we(null),u=we(),c=se(()=>{var _;const d=(_=le(o))!=null?_:a,h=le(t),p=le(n);let E="";return h&&(E=p?`-${h}-${p}`:`-${h}`),`${d}${E}`});return ve(()=>s.value.get(c.value),d=>{gc(u.value,d)||(u.value=d)},{immediate:!0}),ve([u,()=>typeof i!="undefined",()=>typeof r!="undefined"],([d=new Map])=>{l.value&&l.value!==d&&(si(l.value,d,r),si(d,l.value,i)),l.value=d},{immediate:!0}),se(()=>u.value?Array.from(u.value.values()):[])}function of(e){const{findNode:t}=_e();return se({get(){const n=le(e);if(!Array.isArray(n)){const i=t(n);return i?{id:i.id,type:i.type,data:i.data}:null}const o=[];for(const i of n){const r=t(i);r&&o.push({id:r.id,type:r.type,data:r.data})}return o},set(){Ft("You are trying to set node data via useNodesData. This is not supported.")}})}export{q as P,tf as _,ef as a,nf as b,yn as c,of as d,Tn as e,jd as f,ro as g,_e as u};