vue-pure-admin/static/js/vue-flow-core-B5k0Cyip.js

27 lines
154 KiB
JavaScript

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