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