import{Q as gi}from"./QBtnGroup-DcVg-Yz6.js";import{h as be,i as ge,j as ae,N as Ze,ag as lo,V as Pr,W as uo,X as ee,a0 as ve,a7 as Pe,a2 as ze,a1 as vt,$ as J,aa as vi,bL as Tr,bM as Dr,a8 as xe,Y as we,bN as pi,w as ye,bO as Ne,bu as pt,bP as re,a5 as mt,F as jt,r as Ar,bQ as Or,bf as Tt,Z as oe,bR as co,bn as zr,bS as $r,M as Xe,aw as zt,o as mi,bT as yi,a9 as Se,ac as De,B as _i,bU as Hr,bV as wi,bW as un,bX as pe,bY as It,k as _e,bk as bi,bZ as Br,b_ as Rr,bw as Vr,af as ke,aZ as Lr,aj as zn,ai as Fr,u as Yr,b$ as Gr,bv as Xr,aV as Ur,aX as Zr,bl as qr,a6 as Le,b0 as Wr,aE as bt,ad as xt,ae as Oe,a_ as Et}from"./index-DwGLxGjT.js";import{Q as Fe}from"./QTooltip-B8tq7qab.js";import{a as ut,Q as Ye}from"./QItemLabel-SzBpO1a3.js";import{Q as Kr}from"./QResizeObserver-B4briiRj.js";import{Q as jr}from"./format-IikoQWFd.js";import{d as Qr,l as Jr,Q as ea}from"./finetune-C3t8r8Sf.js";import{u as ta}from"./embedding-D2nQac4V.js";import{u as na}from"./search-DoI2iPjp.js";import{i as Eo,H as oa,I as ia,J as ra,e as aa,D as sa}from"./orderBy-Bz06_3V9.js";function la(e,t,n,o){if(!Eo(e))return e;t=oa(t,e);for(var i=-1,r=t.length,a=r-1,s=e;s!=null&&++i<r;){var l=ia(t[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var c=s[l];u=void 0,u===void 0&&(u=Eo(c)?c:ra(t[i+1])?[]:{})}aa(s,l,u),s=s[l]}return e}function ua(e,t,n){return e==null?e:la(e,t,n)}const ca=be({__name:"InfiniteCarousel",props:{images:{},size:{},speed:{default:50}},setup(e,{expose:t}){t(),Pr(l=>({"0c677b1e":n.size.width,f8766978:n.images.length,"25ed11dc":n.size.height}));const n=e,o=ge(null);let i=null;const r=ae(()=>[...n.images,...n.images]),a=l=>{if(!o.value)return;const u=parseFloat(n.size.width)*n.images.length,f=-(l*n.speed/1e3%u);o.value.style.transform=`translateX(${f}px)`,i=requestAnimationFrame(a)};Ze(()=>{i=requestAnimationFrame(a)}),lo(()=>{i!==null&&cancelAnimationFrame(i)});const s={props:n,slideTrack:o,get animationId(){return i},set animationId(l){i=l},displayImages:r,animate:a};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}}),da={class:"slider items-center justify-center"},fa={class:"slide-track q-gutter-x-xl",ref:"slideTrack"};function ha(e,t,n,o,i,r){return ee(),ve("div",da,[Pe("div",fa,[(ee(!0),ve(ze,null,vt(o.displayImages,(a,s)=>(ee(),ve("div",{class:"slide",key:s},[J(gi,{src:typeof a=="string"?a:a.src,fit:"contain",height:o.props.size.height,width:o.props.size.width,alt:"",loading:"lazy"},null,8,["src","height","width"])]))),128))],512)])}const ga=uo(ca,[["render",ha],["__scopeId","data-v-1c55375c"],["__file","InfiniteCarousel.vue"]]),va=be({__name:"LogoWall",props:{showAll:Boolean,sefoOnly:Boolean},setup(e,{expose:t}){t();const{t:n}=vi({useScope:"global"}),o=e;function i(s){for(let l=s.length-1;l>0;l--){const u=Math.floor(Math.random()*(l+1));[s[l],s[u]]=[s[u],s[l]]}return s}const r=ae(()=>{const s=o.sefoOnly?Tr:Dr;return i(s)}),a={t:n,props:o,shuffle:i,shuffledLogos:r,InfiniteCarousel:ga};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}}),pa={key:0,class:"row justify-center q-gutter-xl"},ma={key:1,class:"row items-center justify-center"},ya={class:"text-r-h5 col-auto q-my-xl"};function _a(e,t,n,o,i,r){return n.showAll?(ee(),ve("div",pa,[(ee(!0),ve(ze,null,vt(o.shuffledLogos,(a,s)=>(ee(),we(gi,{key:s,src:a,fit:"contain",loading:"lazy",height:"100px",width:"100px"},null,8,["src"]))),128))])):(ee(),ve("div",ma,[Pe("div",ya,xe(o.t("landing_page.our_customer")),1),J(o.InfiniteCarousel,{class:"col-auto",images:o.shuffledLogos,size:{width:"120px",height:"40px"}},null,8,["images"])]))}const Of=uo(va,[["render",_a],["__file","LogoWall.vue"]]);function En(e){return wi()?(un(e),!0):!1}function Qe(e){return typeof e=="function"?e():re(e)}const wa=typeof window!="undefined"&&typeof document!="undefined",ba=e=>typeof e!="undefined",xa=Object.prototype.toString,Ea=e=>xa.call(e)==="[object Object]",Sa=()=>{};function Na(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 xi=e=>e();function ka(e=xi){const t=ge(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Br(t),pause:n,resume:o,eventFilter:i}}function So(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Ia(e,t,n={}){const{eventFilter:o=xi,...i}=n;return ye(e,Na(o,t),i)}function St(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:s,isActive:l}=ka(o);return{stop:Ia(e,t,{...i,eventFilter:r}),pause:a,resume:s,isActive:l}}function Ma(e,t={}){if(!co(e))return zr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=$r(()=>({get(){return e.value[o]},set(i){var r;if((r=Qe(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const s=[...e.value];s[o]=i,e.value=s}else{const s={...e.value,[o]:i};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[o]=i}}));return n}function Un(e,t=!1){function n(f,{flush:v="sync",deep:p=!1,timeout:S,throwOnTimeout:y}={}){let w=null;const g=[new Promise(I=>{w=ye(e,N=>{f(N)!==t&&(w==null||w(),I(N))},{flush:v,deep:p,immediate:!0})})];return S!=null&&g.push(So(S,y).then(()=>Qe(e)).finally(()=>w==null?void 0:w())),Promise.race(g)}function o(f,v){if(!co(f))return n(N=>N===f,v);const{flush:p="sync",deep:S=!1,timeout:y,throwOnTimeout:w}=v!=null?v:{};let b=null;const I=[new Promise(N=>{b=ye([e,f],([L,G])=>{t!==(L===G)&&(b==null||b(),N(L))},{flush:p,deep:S,immediate:!0})})];return y!=null&&I.push(So(y,w).then(()=>Qe(e)).finally(()=>(b==null||b(),Qe(e)))),Promise.race(I)}function i(f){return n(v=>!!v,f)}function r(f){return o(null,f)}function a(f){return o(void 0,f)}function s(f){return n(Number.isNaN,f)}function l(f,v){return n(p=>{const S=Array.from(p);return S.includes(f)||S.includes(Qe(f))},v)}function u(f){return c(1,f)}function c(f=1,v){let p=-1;return n(()=>(p+=1,p>=f),v)}return Array.isArray(Qe(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Un(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:s,toBeUndefined:a,changed:u,changedTimes:c,get not(){return Un(e,!t)}}}function Zn(e){return Un(e)}function Ca(e){var t;const n=Qe(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Ei=wa?window:void 0;function Si(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Ei):[t,n,o,i]=e,!t)return Sa;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(c=>c()),r.length=0},s=(c,f,v,p)=>(c.addEventListener(f,v,p),()=>c.removeEventListener(f,v,p)),l=ye(()=>[Ca(t),Qe(i)],([c,f])=>{if(a(),!c)return;const v=Ea(f)?{...f}:f;r.push(...n.flatMap(p=>o.map(S=>s(c,p,S,v))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return En(u),u}function Pa(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function No(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Ei,eventName:r="keydown",passive:a=!1,dedupe:s=!1}=o,l=Pa(t);return Si(i,r,c=>{c.repeat&&Qe(s)||l(c)&&n(c)},a)}function Ta(e){return JSON.parse(JSON.stringify(e))}function $n(e,t,n,o={}){var i,r,a;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:v}=o,p=jt(),S=n||(p==null?void 0:p.emit)||((i=p==null?void 0:p.$emit)==null?void 0:i.bind(p))||((a=(r=p==null?void 0:p.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p==null?void 0:p.proxy));let y=u;t||(t="modelValue"),y=y||`update:${t.toString()}`;const w=I=>s?typeof s=="function"?s(I):Ta(I):I,b=()=>ba(e[t])?w(e[t]):f,g=I=>{v?v(I)&&S(y,I):S(y,I)};if(l){const I=b(),N=ge(I);let L=!1;return ye(()=>e[t],G=>{L||(L=!0,N.value=w(G),Xe(()=>L=!1))}),ye(N,G=>{!L&&(G!==e[t]||c)&&g(G)},{deep:c}),N}else return ae({get(){return b()},set(I){g(I)}})}var Da={value:()=>{}};function Sn(){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 cn(n)}function cn(e){this._=e}function Aa(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}})}cn.prototype=Sn.prototype={constructor:cn,on:function(e,t){var n=this._,o=Aa(e+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(e=o[r]).type)&&(i=Oa(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=o[r]).type)n[i]=ko(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ko(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 cn(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 Oa(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function ko(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Da,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var qn="http://www.w3.org/1999/xhtml";const Io={svg:"http://www.w3.org/2000/svg",xhtml:qn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Io.hasOwnProperty(t)?{space:Io[t],local:e}:e}function za(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qn&&t.documentElement.namespaceURI===qn?t.createElement(e):t.createElementNS(n,e)}}function $a(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ni(e){var t=Nn(e);return(t.local?$a:za)(t)}function Ha(){}function fo(e){return e==null?Ha:function(){return this.querySelector(e)}}function Ba(e){typeof e!="function"&&(e=fo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=new Array(a),l,u,c=0;c<a;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Ae(o,this._parents)}function Ra(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Va(){return[]}function ki(e){return e==null?Va:function(){return this.querySelectorAll(e)}}function La(e){return function(){return Ra(e.apply(this,arguments))}}function Fa(e){typeof e=="function"?e=La(e):e=ki(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var a=t[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(o.push(e.call(l,l.__data__,u,a)),i.push(l));return new Ae(o,i)}function Ii(e){return function(){return this.matches(e)}}function Mi(e){return function(t){return t.matches(e)}}var Ya=Array.prototype.find;function Ga(e){return function(){return Ya.call(this.children,e)}}function Xa(){return this.firstElementChild}function Ua(e){return this.select(e==null?Xa:Ga(typeof e=="function"?e:Mi(e)))}var Za=Array.prototype.filter;function qa(){return Array.from(this.children)}function Wa(e){return function(){return Za.call(this.children,e)}}function Ka(e){return this.selectAll(e==null?qa:Wa(typeof e=="function"?e:Mi(e)))}function ja(e){typeof e!="function"&&(e=Ii(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new Ae(o,this._parents)}function Ci(e){return new Array(e.length)}function Qa(){return new Ae(this._enter||this._groups.map(Ci),this._parents)}function gn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gn.prototype={constructor:gn,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 Ja(e){return function(){return e}}function es(e,t,n,o,i,r){for(var a=0,s,l=t.length,u=r.length;a<u;++a)(s=t[a])?(s.__data__=r[a],o[a]=s):n[a]=new gn(e,r[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function ts(e,t,n,o,i,r,a){var s,l,u=new Map,c=t.length,f=r.length,v=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(v[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<f;++s)p=a.call(e,r[s],s,r)+"",(l=u.get(p))?(o[s]=l,l.__data__=r[s],u.delete(p)):n[s]=new gn(e,r[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(v[s])===l&&(i[s]=l)}function ns(e){return e.__data__}function os(e,t){if(!arguments.length)return Array.from(this,ns);var n=t?ts:es,o=this._parents,i=this._groups;typeof e!="function"&&(e=Ja(e));for(var r=i.length,a=new Array(r),s=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],f=i[u],v=f.length,p=is(e.call(c,c&&c.__data__,u,o)),S=p.length,y=s[u]=new Array(S),w=a[u]=new Array(S),b=l[u]=new Array(v);n(c,f,y,w,b,p,t);for(var g=0,I=0,N,L;g<S;++g)if(N=y[g]){for(g>=I&&(I=g+1);!(L=w[I])&&++I<S;);N._next=L||null}}return a=new Ae(a,o),a._enter=s,a._exit=l,a}function is(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rs(){return new Ae(this._exit||this._groups.map(Ci),this._parents)}function as(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function ss(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,a=Math.min(i,r),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=o[l],f=u.length,v=s[l]=new Array(f),p,S=0;S<f;++S)(p=u[S]||c[S])&&(v[S]=p);for(;l<i;++l)s[l]=n[l];return new Ae(s,this._parents)}function ls(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function us(e){e||(e=cs);function t(f,v){return f&&v?e(f.__data__,v.__data__):!f-!v}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],s=a.length,l=i[r]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Ae(i,this._parents).order()}function cs(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ds(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fs(){return Array.from(this)}function hs(){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 a=o[i];if(a)return a}return null}function gs(){let e=0;for(const t of this)++e;return e}function vs(){return!this.node()}function ps(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,a=i.length,s;r<a;++r)(s=i[r])&&e.call(s,s.__data__,r,i);return this}function ms(e){return function(){this.removeAttribute(e)}}function ys(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _s(e,t){return function(){this.setAttribute(e,t)}}function ws(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xs(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 Es(e,t){var n=Nn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?ys:ms:typeof t=="function"?n.local?xs:bs:n.local?ws:_s)(n,t))}function Pi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ss(e){return function(){this.style.removeProperty(e)}}function Ns(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ks(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Is(e,t,n){return arguments.length>1?this.each((t==null?Ss:typeof t=="function"?ks:Ns)(e,t,n==null?"":n)):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||Pi(e).getComputedStyle(e,null).getPropertyValue(t)}function Ms(e){return function(){delete this[e]}}function Cs(e,t){return function(){this[e]=t}}function Ps(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"?Ps:Cs)(e,t)):this.node()[e]}function Ti(e){return e.trim().split(/^|\s+/)}function ho(e){return e.classList||new Di(e)}function Di(e){this._node=e,this._names=Ti(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 Ai(e,t){for(var n=ho(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Oi(e,t){for(var n=ho(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Ds(e){return function(){Ai(this,e)}}function As(e){return function(){Oi(this,e)}}function Os(e,t){return function(){(t.apply(this,arguments)?Ai:Oi)(this,e)}}function zs(e,t){var n=Ti(e+"");if(arguments.length<2){for(var o=ho(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Os:t?Ds:As)(n,t))}function $s(){this.textContent=""}function Hs(e){return function(){this.textContent=e}}function Bs(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function Rs(e){return arguments.length?this.each(e==null?$s:(typeof e=="function"?Bs:Hs)(e)):this.node().textContent}function Vs(){this.innerHTML=""}function Ls(e){return function(){this.innerHTML=e}}function Fs(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function Ys(e){return arguments.length?this.each(e==null?Vs:(typeof e=="function"?Fs:Ls)(e)):this.node().innerHTML}function Gs(){this.nextSibling&&this.parentNode.appendChild(this)}function Xs(){return this.each(Gs)}function Us(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zs(){return this.each(Us)}function qs(e){var t=typeof e=="function"?e:Ni(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ws(){return null}function Ks(e,t){var n=typeof e=="function"?e:Ni(e),o=t==null?Ws:typeof t=="function"?t:fo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function js(){var e=this.parentNode;e&&e.removeChild(this)}function Qs(){return this.each(js)}function Js(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function el(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tl(e){return this.select(e?el:Js)}function nl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ol(e){return function(t){e.call(this,t,this.__data__)}}function il(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 rl(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 al(e,t,n){return function(){var o=this.__on,i,r=ol(t);if(o){for(var a=0,s=o.length;a<s;++a)if((i=o[a]).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 sl(e,t,n){var o=il(e+""),i,r=o.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<r;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?al:rl,i=0;i<r;++i)this.each(s(o[i],t,n));return this}function zi(e,t,n){var o=Pi(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 ll(e,t){return function(){return zi(this,e,t)}}function ul(e,t){return function(){return zi(this,e,t.apply(this,arguments))}}function cl(e,t){return this.each((typeof t=="function"?ul:ll)(e,t))}function*dl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var $i=[null];function Ae(e,t){this._groups=e,this._parents=t}function Qt(){return new Ae([[document.documentElement]],$i)}function fl(){return this}Ae.prototype=Qt.prototype={constructor:Ae,select:Ba,selectAll:Fa,selectChild:Ua,selectChildren:Ka,filter:ja,data:os,enter:Qa,exit:rs,join:as,merge:ss,selection:fl,order:ls,sort:us,call:ds,nodes:fs,node:hs,size:gs,empty:vs,each:ps,attr:Es,style:Is,property:Ts,classed:zs,text:Rs,html:Ys,raise:Xs,lower:Zs,append:qs,insert:Ks,remove:Qs,clone:tl,datum:nl,on:sl,dispatch:cl,[Symbol.iterator]:dl};function He(e){return typeof e=="string"?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],$i)}function hl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ge(e,t){if(e=hl(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 gl={passive:!1},Gt={capture:!0,passive:!1};function Hn(e){e.stopImmediatePropagation()}function Mt(e){e.preventDefault(),e.stopImmediatePropagation()}function Hi(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Mt,Gt);"onselectstart"in t?n.on("selectstart.drag",Mt,Gt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Bi(e,t){var n=e.document.documentElement,o=He(e).on("dragstart.drag",null);t&&(o.on("click.drag",Mt,Gt),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 en=e=>()=>e;function Wn(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:a,y:s,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:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Wn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vl(e){return!e.ctrlKey&&!e.button}function pl(){return this.parentNode}function ml(e,t){return t==null?{x:e.x,y:e.y}:t}function yl(){return navigator.maxTouchPoints||"ontouchstart"in this}function _l(){var e=vl,t=pl,n=ml,o=yl,i={},r=Sn("start","drag","end"),a=0,s,l,u,c,f=0;function v(N){N.on("mousedown.drag",p).filter(o).on("touchstart.drag",w).on("touchmove.drag",b,gl).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(N,L){if(!(c||!e.call(this,N,L))){var G=I(this,t.call(this,N,L),N,L,"mouse");G&&(He(N.view).on("mousemove.drag",S,Gt).on("mouseup.drag",y,Gt),Hi(N.view),Hn(N),u=!1,s=N.clientX,l=N.clientY,G("start",N))}}function S(N){if(Mt(N),!u){var L=N.clientX-s,G=N.clientY-l;u=L*L+G*G>f}i.mouse("drag",N)}function y(N){He(N.view).on("mousemove.drag mouseup.drag",null),Bi(N.view,u),Mt(N),i.mouse("end",N)}function w(N,L){if(e.call(this,N,L)){var G=N.changedTouches,V=t.call(this,N,L),q=G.length,K,O;for(K=0;K<q;++K)(O=I(this,V,N,L,G[K].identifier,G[K]))&&(Hn(N),O("start",N,G[K]))}}function b(N){var L=N.changedTouches,G=L.length,V,q;for(V=0;V<G;++V)(q=i[L[V].identifier])&&(Mt(N),q("drag",N,L[V]))}function g(N){var L=N.changedTouches,G=L.length,V,q;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),V=0;V<G;++V)(q=i[L[V].identifier])&&(Hn(N),q("end",N,L[V]))}function I(N,L,G,V,q,K){var O=r.copy(),m=Ge(K||G,L),j,le,_;if((_=n.call(N,new Wn("beforestart",{sourceEvent:G,target:v,identifier:q,active:a,x:m[0],y:m[1],dx:0,dy:0,dispatch:O}),V))!=null)return j=_.x-m[0]||0,le=_.y-m[1]||0,function M(E,T,z){var H=m,Y;switch(E){case"start":i[q]=M,Y=a++;break;case"end":delete i[q],--a;case"drag":m=Ge(z||T,L),Y=a;break}O.call(E,N,new Wn(E,{sourceEvent:T,subject:_,target:v,identifier:q,active:Y,x:m[0]+j,y:m[1]+le,dx:m[0]-H[0],dy:m[1]-H[1],dispatch:O}),V)}}return v.filter=function(N){return arguments.length?(e=typeof N=="function"?N:en(!!N),v):e},v.container=function(N){return arguments.length?(t=typeof N=="function"?N:en(N),v):t},v.subject=function(N){return arguments.length?(n=typeof N=="function"?N:en(N),v):n},v.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:en(!!N),v):o},v.on=function(){var N=r.on.apply(r,arguments);return N===r?v:N},v.clickDistance=function(N){return arguments.length?(f=(N=+N)*N,v):Math.sqrt(f)},v}function go(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ri(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Jt(){}var Xt=.7,vn=1/Xt,Ct="\\s*([+-]?\\d+)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ue="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wl=/^#([0-9a-f]{3,8})$/,bl=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),xl=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),El=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Ut}\\)$`),Sl=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${Ut}\\)$`),Nl=new RegExp(`^hsl\\(${Ut},${Ue},${Ue}\\)$`),kl=new RegExp(`^hsla\\(${Ut},${Ue},${Ue},${Ut}\\)$`),Mo={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};go(Jt,Zt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Co,formatHex:Co,formatHex8:Il,formatHsl:Ml,formatRgb:Po,toString:Po});function Co(){return this.rgb().formatHex()}function Il(){return this.rgb().formatHex8()}function Ml(){return Vi(this).formatHsl()}function Po(){return this.rgb().formatRgb()}function Zt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?To(t):n===3?new Te(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tn(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=bl.exec(e))?new Te(t[1],t[2],t[3],1):(t=xl.exec(e))?new Te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=El.exec(e))?tn(t[1],t[2],t[3],t[4]):(t=Sl.exec(e))?tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Nl.exec(e))?Oo(t[1],t[2]/100,t[3]/100,1):(t=kl.exec(e))?Oo(t[1],t[2]/100,t[3]/100,t[4]):Mo.hasOwnProperty(e)?To(Mo[e]):e==="transparent"?new Te(NaN,NaN,NaN,0):null}function To(e){return new Te(e>>16&255,e>>8&255,e&255,1)}function tn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Te(e,t,n,o)}function Cl(e){return e instanceof Jt||(e=Zt(e)),e?(e=e.rgb(),new Te(e.r,e.g,e.b,e.opacity)):new Te}function Kn(e,t,n,o){return arguments.length===1?Cl(e):new Te(e,t,n,o==null?1:o)}function Te(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}go(Te,Kn,Ri(Jt,{brighter(e){return e=e==null?vn:Math.pow(vn,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xt:Math.pow(Xt,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Te(ht(this.r),ht(this.g),ht(this.b),pn(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:Do,formatHex:Do,formatHex8:Pl,formatRgb:Ao,toString:Ao}));function Do(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}`}function Pl(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}${ft((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){const e=pn(this.opacity);return`${e===1?"rgb(":"rgba("}${ht(this.r)}, ${ht(this.g)}, ${ht(this.b)}${e===1?")":`, ${e})`}`}function pn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ht(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ft(e){return e=ht(e),(e<16?"0":"")+e.toString(16)}function Oo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Be(e,t,n,o)}function Vi(e){if(e instanceof Be)return new Be(e.h,e.s,e.l,e.opacity);if(e instanceof Jt||(e=Zt(e)),!e)return new Be;if(e instanceof Be)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),a=NaN,s=r-i,l=(r+i)/2;return s?(t===r?a=(n-o)/s+(n<o)*6:n===r?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Be(a,s,l,e.opacity)}function Tl(e,t,n,o){return arguments.length===1?Vi(e):new Be(e,t,n,o==null?1:o)}function Be(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}go(Be,Tl,Ri(Jt,{brighter(e){return e=e==null?vn:Math.pow(vn,e),new Be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xt:Math.pow(Xt,e),new Be(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 Te(Bn(e>=240?e-240:e+120,i,o),Bn(e,i,o),Bn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Be(zo(this.h),nn(this.s),nn(this.l),pn(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=pn(this.opacity);return`${e===1?"hsl(":"hsla("}${zo(this.h)}, ${nn(this.s)*100}%, ${nn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zo(e){return e=(e||0)%360,e<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function Bn(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 Li=e=>()=>e;function Dl(e,t){return function(n){return e+n*t}}function Al(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 Ol(e){return(e=+e)==1?Fi:function(t,n){return n-t?Al(t,n,e):Li(isNaN(t)?n:t)}}function Fi(e,t){var n=t-e;return n?Dl(e,n):Li(isNaN(e)?t:e)}const $o=function e(t){var n=Ol(t);function o(i,r){var a=n((i=Kn(i)).r,(r=Kn(r)).r),s=n(i.g,r.g),l=n(i.b,r.b),u=Fi(i.opacity,r.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function it(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var jn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rn=new RegExp(jn.source,"g");function zl(e){return function(){return e}}function $l(e){return function(t){return e(t)+""}}function Hl(e,t){var n=jn.lastIndex=Rn.lastIndex=0,o,i,r,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=jn.exec(e))&&(i=Rn.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(o=o[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:it(o,i)})),n=Rn.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?$l(l[0].x):zl(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}var Ho=180/Math.PI,Qn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yi(e,t,n,o,i,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*Ho,skewX:Math.atan(l)*Ho,scaleX:a,scaleY:s}}var on;function Bl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qn:Yi(t.a,t.b,t.c,t.d,t.e,t.f)}function Rl(e){return e==null||(on||(on=document.createElementNS("http://www.w3.org/2000/svg","g")),on.setAttribute("transform",e),!(e=on.transform.baseVal.consolidate()))?Qn:(e=e.matrix,Yi(e.a,e.b,e.c,e.d,e.e,e.f))}function Gi(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,f,v,p,S){if(u!==f||c!==v){var y=p.push("translate(",null,t,null,n);S.push({i:y-4,x:it(u,f)},{i:y-2,x:it(c,v)})}else(f||v)&&p.push("translate("+f+t+v+n)}function a(u,c,f,v){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),v.push({i:f.push(i(f)+"rotate(",null,o)-2,x:it(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function s(u,c,f,v){u!==c?v.push({i:f.push(i(f)+"skewX(",null,o)-2,x:it(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function l(u,c,f,v,p,S){if(u!==f||c!==v){var y=p.push(i(p)+"scale(",null,",",null,")");S.push({i:y-4,x:it(u,f)},{i:y-2,x:it(c,v)})}else(f!==1||v!==1)&&p.push(i(p)+"scale("+f+","+v+")")}return function(u,c){var f=[],v=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,f,v),a(u.rotate,c.rotate,f,v),s(u.skewX,c.skewX,f,v),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,v),u=c=null,function(p){for(var S=-1,y=v.length,w;++S<y;)f[(w=v[S]).i]=w.x(p);return f.join("")}}}var Vl=Gi(Bl,"px, ","px)","deg)"),Ll=Gi(Rl,", ",")",")"),Fl=1e-12;function Bo(e){return((e=Math.exp(e))+1/e)/2}function Yl(e){return((e=Math.exp(e))-1/e)/2}function Gl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Xl=function e(t,n,o){function i(r,a){var s=r[0],l=r[1],u=r[2],c=a[0],f=a[1],v=a[2],p=c-s,S=f-l,y=p*p+S*S,w,b;if(y<Fl)b=Math.log(v/u)/t,w=function(V){return[s+V*p,l+V*S,u*Math.exp(t*V*b)]};else{var g=Math.sqrt(y),I=(v*v-u*u+o*y)/(2*u*n*g),N=(v*v-u*u-o*y)/(2*v*n*g),L=Math.log(Math.sqrt(I*I+1)-I),G=Math.log(Math.sqrt(N*N+1)-N);b=(G-L)/t,w=function(V){var q=V*b,K=Bo(L),O=u/(n*g)*(K*Gl(t*q+L)-Yl(L));return[s+O*p,l+O*S,u*K/Bo(t*q+L)]}}return w.duration=b*1e3*t/Math.SQRT2,w}return i.rho=function(r){var a=Math.max(.001,+r),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var At=0,Rt=0,$t=0,Xi=1e3,mn,Vt,yn=0,yt=0,kn=0,qt=typeof performance=="object"&&performance.now?performance:Date,Ui=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vo(){return yt||(Ui(Ul),yt=qt.now()+kn)}function Ul(){yt=0}function _n(){this._call=this._time=this._next=null}_n.prototype=Zi.prototype={constructor:_n,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?vo():+n)+(t==null?0:+t),!this._next&&Vt!==this&&(Vt?Vt._next=this:mn=this,Vt=this),this._call=e,this._time=n,Jn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jn())}};function Zi(e,t,n){var o=new _n;return o.restart(e,t,n),o}function Zl(){vo(),++At;for(var e=mn,t;e;)(t=yt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--At}function Ro(){yt=(yn=qt.now())+kn,At=Rt=0;try{Zl()}finally{At=0,Wl(),yt=0}}function ql(){var e=qt.now(),t=e-yn;t>Xi&&(kn-=t,yn=e)}function Wl(){for(var e,t=mn,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:mn=n);Vt=e,Jn(o)}function Jn(e){if(!At){Rt&&(Rt=clearTimeout(Rt));var t=e-yt;t>24?(e<1/0&&(Rt=setTimeout(Ro,e-qt.now()-kn)),$t&&($t=clearInterval($t))):($t||(yn=qt.now(),$t=setInterval(ql,Xi)),At=1,Ui(Ro))}}function Vo(e,t,n){var o=new _n;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Kl=Sn("start","end","cancel","interrupt"),jl=[],qi=0,Lo=1,eo=2,dn=3,Fo=4,to=5,fn=6;function In(e,t,n,o,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Ql(e,n,{name:t,index:o,group:i,on:Kl,tween:jl,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:qi})}function po(e,t){var n=Re(e,t);if(n.state>qi)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Re(e,t);if(n.state>dn)throw new Error("too late; already running");return n}function Re(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ql(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Zi(r,0,n.time);function r(u){n.state=Lo,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,v,p;if(n.state!==Lo)return l();for(c in o)if(p=o[c],p.name===n.name){if(p.state===dn)return Vo(a);p.state===Fo?(p.state=fn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=fn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(Vo(function(){n.state===dn&&(n.state=Fo,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===eo){for(n.state=dn,i=new Array(v=n.tween.length),c=0,f=-1;c<v;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=to,1),f=-1,v=i.length;++f<v;)i[f].call(e,c);n.state===to&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=fn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function hn(e,t){var n=e.__transition,o,i,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){r=!1;continue}i=o.state>eo&&o.state<to,o.state=fn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}r&&delete e.__transition}}function Jl(e){return this.each(function(){hn(this,e)})}function eu(e,t){var n,o;return function(){var i=qe(this,e),r=i.tween;if(r!==n){o=n=r;for(var a=0,s=o.length;a<s;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function tu(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=qe(this,e),a=r.tween;if(a!==o){i=(o=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}r.tween=i}}function nu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Re(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?eu:tu)(n,e,t))}function mo(e,t,n){var o=e._id;return e.each(function(){var i=qe(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Re(i,o).value[t]}}function Wi(e,t){var n;return(typeof t=="number"?it:t instanceof Zt?$o:(n=Zt(t))?(t=n,$o):Hl)(e,t)}function ou(e){return function(){this.removeAttribute(e)}}function iu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ru(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function au(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function su(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function lu(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function uu(e,t){var n=Nn(e),o=n==="transform"?Ll:Wi;return this.attrTween(e,typeof t=="function"?(n.local?lu:su)(n,o,mo(this,"attr."+e,t)):t==null?(n.local?iu:ou)(n):(n.local?au:ru)(n,o,t))}function cu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function du(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function fu(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&du(e,r)),n}return i._value=t,i}function hu(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&cu(e,r)),n}return i._value=t,i}function gu(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=Nn(e);return this.tween(n,(o.local?fu:hu)(o,t))}function vu(e,t){return function(){po(this,e).delay=+t.apply(this,arguments)}}function pu(e,t){return t=+t,function(){po(this,e).delay=t}}function mu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vu:pu)(t,e)):Re(this.node(),t).delay}function yu(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function _u(e,t){return t=+t,function(){qe(this,e).duration=t}}function wu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yu:_u)(t,e)):Re(this.node(),t).duration}function bu(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function xu(e){var t=this._id;return arguments.length?this.each(bu(t,e)):Re(this.node(),t).ease}function Eu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function Su(e){if(typeof e!="function")throw new Error;return this.each(Eu(this._id,e))}function Nu(e){typeof e!="function"&&(e=Ii(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new et(o,this._parents,this._name,this._id)}function ku(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),a=new Array(o),s=0;s<r;++s)for(var l=t[s],u=n[s],c=l.length,f=a[s]=new Array(c),v,p=0;p<c;++p)(v=l[p]||u[p])&&(f[p]=v);for(;s<o;++s)a[s]=t[s];return new et(a,this._parents,this._name,this._id)}function Iu(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 Mu(e,t,n){var o,i,r=Iu(t)?po:qe;return function(){var a=r(this,e),s=a.on;s!==o&&(i=(o=s).copy()).on(t,n),a.on=i}}function Cu(e,t){var n=this._id;return arguments.length<2?Re(this.node(),n).on.on(e):this.each(Mu(n,e,t))}function Pu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Tu(){return this.on("end.remove",Pu(this._id))}function Du(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fo(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,u=r[a]=new Array(l),c,f,v=0;v<l;++v)(c=s[v])&&(f=e.call(c,c.__data__,v,s))&&("__data__"in c&&(f.__data__=c.__data__),u[v]=f,In(u[v],t,n,v,u,Re(c,n)));return new et(r,this._parents,t,n)}function Au(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ki(e));for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var v=e.call(c,c.__data__,f,l),p,S=Re(c,n),y=0,w=v.length;y<w;++y)(p=v[y])&&In(p,t,n,y,v,S);r.push(v),a.push(c)}return new et(r,a,t,n)}var Ou=Qt.prototype.constructor;function zu(){return new Ou(this._groups,this._parents)}function $u(e,t){var n,o,i;return function(){var r=Dt(this,e),a=(this.style.removeProperty(e),Dt(this,e));return r===a?null:r===n&&a===o?i:i=t(n=r,o=a)}}function Ki(e){return function(){this.style.removeProperty(e)}}function Hu(e,t,n){var o,i=n+"",r;return function(){var a=Dt(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}function Bu(e,t,n){var o,i,r;return function(){var a=Dt(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Dt(this,e))),a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s))}}function Ru(e,t){var n,o,i,r="style."+t,a="end."+r,s;return function(){var l=qe(this,e),u=l.on,c=l.value[r]==null?s||(s=Ki(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),l.on=o}}function Vu(e,t,n){var o=(e+="")=="transform"?Vl:Wi;return t==null?this.styleTween(e,$u(e,o)).on("end.style."+e,Ki(e)):typeof t=="function"?this.styleTween(e,Bu(e,o,mo(this,"style."+e,t))).each(Ru(this._id,e)):this.styleTween(e,Hu(e,o,t),n).on("end.style."+e,null)}function Lu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Fu(e,t,n){var o,i;function r(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&Lu(e,a,n)),o}return r._value=t,r}function Yu(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,Fu(e,t,n==null?"":n))}function Gu(e){return function(){this.textContent=e}}function Xu(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function Uu(e){return this.tween("text",typeof e=="function"?Xu(mo(this,"text",e)):Gu(e==null?"":e+""))}function Zu(e){return function(t){this.textContent=e.call(this,t)}}function qu(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Zu(i)),t}return o._value=e,o}function Wu(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,qu(e))}function Ku(){for(var e=this._name,t=this._id,n=ji(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Re(l,t);In(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new et(o,this._parents,e,n)}function ju(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--i===0&&r()}};n.each(function(){var u=qe(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&r()})}var Qu=0;function et(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ji(){return++Qu}var We=Qt.prototype;et.prototype={constructor:et,select:Du,selectAll:Au,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:Nu,merge:ku,selection:zu,transition:Ku,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:Cu,attr:uu,attrTween:gu,style:Vu,styleTween:Yu,text:Uu,textTween:Wu,remove:Tu,tween:nu,delay:mu,duration:wu,ease:xu,easeVarying:Su,end:ju,[Symbol.iterator]:We[Symbol.iterator]};function Ju(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ec={time:null,delay:0,duration:250,ease:Ju};function tc(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 nc(e){var t,n;e instanceof et?(t=e._id,e=e._name):(t=ji(),(n=ec).time=vo(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&In(l,e,t,u,a,n||tc(l,t));return new et(o,this._parents,e,t)}Qt.prototype.interrupt=Jl;Qt.prototype.transition=nc;const rn=e=>()=>e;function oc(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 Je(e,t,n){this.k=e,this.x=t,this.y=n}Je.prototype={constructor:Je,scale:function(e){return e===1?this:new Je(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Je(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 Ot=new Je(1,0,0);Je.prototype;function Vn(e){e.stopImmediatePropagation()}function Ht(e){e.preventDefault(),e.stopImmediatePropagation()}function ic(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Yo(){return this.__zoom||Ot}function ac(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sc(){return navigator.maxTouchPoints||"ontouchstart"in this}function lc(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],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function uc(){var e=ic,t=rc,n=lc,o=ac,i=sc,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Xl,u=Sn("start","zoom","end"),c,f,v,p=500,S=150,y=0,w=10;function b(_){_.property("__zoom",Yo).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",K).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",m).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(_,M,E,T){var z=_.selection?_.selection():_;z.property("__zoom",Yo),_!==z?L(_,M,E,T):z.interrupt().each(function(){G(this,arguments).event(T).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},b.scaleBy=function(_,M,E,T){b.scaleTo(_,function(){var z=this.__zoom.k,H=typeof M=="function"?M.apply(this,arguments):M;return z*H},E,T)},b.scaleTo=function(_,M,E,T){b.transform(_,function(){var z=t.apply(this,arguments),H=this.__zoom,Y=E==null?N(z):typeof E=="function"?E.apply(this,arguments):E,F=H.invert(Y),ie=typeof M=="function"?M.apply(this,arguments):M;return n(I(g(H,ie),Y,F),z,a)},E,T)},b.translateBy=function(_,M,E,T){b.transform(_,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),a)},null,T)},b.translateTo=function(_,M,E,T,z){b.transform(_,function(){var H=t.apply(this,arguments),Y=this.__zoom,F=T==null?N(H):typeof T=="function"?T.apply(this,arguments):T;return n(Ot.translate(F[0],F[1]).scale(Y.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof E=="function"?-E.apply(this,arguments):-E),H,a)},T,z)};function g(_,M){return M=Math.max(r[0],Math.min(r[1],M)),M===_.k?_:new Je(M,_.x,_.y)}function I(_,M,E){var T=M[0]-E[0]*_.k,z=M[1]-E[1]*_.k;return T===_.x&&z===_.y?_:new Je(_.k,T,z)}function N(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function L(_,M,E,T){_.on("start.zoom",function(){G(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){G(this,arguments).event(T).end()}).tween("zoom",function(){var z=this,H=arguments,Y=G(z,H).event(T),F=t.apply(z,H),ie=E==null?N(F):typeof E=="function"?E.apply(z,H):E,Z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),R=z.__zoom,Q=typeof M=="function"?M.apply(z,H):M,de=l(R.invert(ie).concat(Z/R.k),Q.invert(ie).concat(Z/Q.k));return function(ue){if(ue===1)ue=Q;else{var he=de(ue),D=Z/he[2];ue=new Je(D,ie[0]-he[0]*D,ie[1]-he[1]*D)}Y.zoom(null,ue)}})}function G(_,M,E){return!E&&_.__zooming||new V(_,M)}function V(_,M){this.that=_,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,M),this.taps=0}V.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,M){return this.mouse&&_!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var M=He(this.that).datum();u.call(_,this.that,new oc(_,{sourceEvent:this.sourceEvent,target:b,type:_,transform:this.that.__zoom,dispatch:u}),M)}};function q(_,...M){if(!e.apply(this,arguments))return;var E=G(this,M).event(_),T=this.__zoom,z=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),H=Ge(_);if(E.wheel)(E.mouse[0][0]!==H[0]||E.mouse[0][1]!==H[1])&&(E.mouse[1]=T.invert(E.mouse[0]=H)),clearTimeout(E.wheel);else{if(T.k===z)return;E.mouse=[H,T.invert(H)],hn(this),E.start()}Ht(_),E.wheel=setTimeout(Y,S),E.zoom("mouse",n(I(g(T,z),E.mouse[0],E.mouse[1]),E.extent,a));function Y(){E.wheel=null,E.end()}}function K(_,...M){if(v||!e.apply(this,arguments))return;var E=_.currentTarget,T=G(this,M,!0).event(_),z=He(_.view).on("mousemove.zoom",ie,!0).on("mouseup.zoom",Z,!0),H=Ge(_,E),Y=_.clientX,F=_.clientY;Hi(_.view),Vn(_),T.mouse=[H,this.__zoom.invert(H)],hn(this),T.start();function ie(R){if(Ht(R),!T.moved){var Q=R.clientX-Y,de=R.clientY-F;T.moved=Q*Q+de*de>y}T.event(R).zoom("mouse",n(I(T.that.__zoom,T.mouse[0]=Ge(R,E),T.mouse[1]),T.extent,a))}function Z(R){z.on("mousemove.zoom mouseup.zoom",null),Bi(R.view,T.moved),Ht(R),T.event(R).end()}}function O(_,...M){if(e.apply(this,arguments)){var E=this.__zoom,T=Ge(_.changedTouches?_.changedTouches[0]:_,this),z=E.invert(T),H=E.k*(_.shiftKey?.5:2),Y=n(I(g(E,H),T,z),t.apply(this,M),a);Ht(_),s>0?He(this).transition().duration(s).call(L,Y,T,_):He(this).call(b.transform,Y,T,_)}}function m(_,...M){if(e.apply(this,arguments)){var E=_.touches,T=E.length,z=G(this,M,_.changedTouches.length===T).event(_),H,Y,F,ie;for(Vn(_),Y=0;Y<T;++Y)F=E[Y],ie=Ge(F,this),ie=[ie,this.__zoom.invert(ie),F.identifier],z.touch0?!z.touch1&&z.touch0[2]!==ie[2]&&(z.touch1=ie,z.taps=0):(z.touch0=ie,H=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),H&&(z.taps<2&&(f=ie[0],c=setTimeout(function(){c=null},p)),hn(this),z.start())}}function j(_,...M){if(this.__zooming){var E=G(this,M).event(_),T=_.changedTouches,z=T.length,H,Y,F,ie;for(Ht(_),H=0;H<z;++H)Y=T[H],F=Ge(Y,this),E.touch0&&E.touch0[2]===Y.identifier?E.touch0[0]=F:E.touch1&&E.touch1[2]===Y.identifier&&(E.touch1[0]=F);if(Y=E.that.__zoom,E.touch1){var Z=E.touch0[0],R=E.touch0[1],Q=E.touch1[0],de=E.touch1[1],ue=(ue=Q[0]-Z[0])*ue+(ue=Q[1]-Z[1])*ue,he=(he=de[0]-R[0])*he+(he=de[1]-R[1])*he;Y=g(Y,Math.sqrt(ue/he)),F=[(Z[0]+Q[0])/2,(Z[1]+Q[1])/2],ie=[(R[0]+de[0])/2,(R[1]+de[1])/2]}else if(E.touch0)F=E.touch0[0],ie=E.touch0[1];else return;E.zoom("touch",n(I(Y,F,ie),E.extent,a))}}function le(_,...M){if(this.__zooming){var E=G(this,M).event(_),T=_.changedTouches,z=T.length,H,Y;for(Vn(_),v&&clearTimeout(v),v=setTimeout(function(){v=null},p),H=0;H<z;++H)Y=T[H],E.touch0&&E.touch0[2]===Y.identifier?delete E.touch0:E.touch1&&E.touch1[2]===Y.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&&(Y=Ge(Y,this),Math.hypot(f[0]-Y[0],f[1]-Y[1])<w)){var F=He(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return b.wheelDelta=function(_){return arguments.length?(o=typeof _=="function"?_:rn(+_),b):o},b.filter=function(_){return arguments.length?(e=typeof _=="function"?_:rn(!!_),b):e},b.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:rn(!!_),b):i},b.extent=function(_){return arguments.length?(t=typeof _=="function"?_:rn([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),b):t},b.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],b):[r[0],r[1]]},b.translateExtent=function(_){return arguments.length?(a[0][0]=+_[0][0],a[1][0]=+_[1][0],a[0][1]=+_[0][1],a[1][1]=+_[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(_){return arguments.length?(n=_,b):n},b.duration=function(_){return arguments.length?(s=+_,b):s},b.interpolate=function(_){return arguments.length?(l=_,b):l},b.on=function(){var _=u.on.apply(u,arguments);return _===u?b:_},b.clickDistance=function(_){return arguments.length?(y=(_=+_)*_,b):Math.sqrt(y)},b.tapDistance=function(_){return arguments.length?(w=+_,b):w},b}var te=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(te||{}),yo=(e=>(e.Partial="partial",e.Full="full",e))(yo||{}),ct=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(ct||{}),_t=(e=>(e.Strict="strict",e.Loose="loose",e))(_t||{}),no=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(no||{}),Ft=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Ft||{});function oo(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 cc(e){return e.ctrlKey||e.metaKey||e.shiftKey}function Go(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,a)=>n.has(r)&&Array.from(n.values())[a]===i[a]))}function dc(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=fc(n.code,e);return Array.isArray(e)?e.some(i=>Go(n[o],i,t,n.type==="keyup")):Go(n[o],e,t,n.type==="keyup")}}function fc(e,t){return typeof t=="string"?e===t?"code":"key":t.includes(e)?"code":"key"}function Yt(e,t){const n=Ne(()=>{var c;return(c=pe(t==null?void 0:t.actInsideInputWithModifier))!=null?c:!1}),o=Ne(()=>{var c;return(c=pe(t==null?void 0:t.target))!=null?c:window}),i=ge(pe(e)===!0);let r=!1;const a=new Set;let s=u(pe(e));ye(()=>pe(e),(c,f)=>{typeof f=="boolean"&&typeof c!="boolean"&&l(),s=u(c)},{immediate:!0}),Ze(()=>{Si(window,["blur","contextmenu"],l)}),No((...c)=>s(...c),c=>{r=cc(c),!((!r||r&&!n.value)&&oo(c))&&(c.preventDefault(),i.value=!0)},{eventName:"keydown",target:o}),No((...c)=>s(...c),c=>{if(i.value){if((!r||r&&!n.value)&&oo(c))return;l()}},{eventName:"keyup",target:o});function l(){r=!1,a.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"?dc(c,a):c}return i}const Qi="vue-flow__node-desc",Ji="vue-flow__edge-desc",hc="vue-flow__aria-live",er=["Enter"," ","Escape"],Pt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function io(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ro(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Mn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function wt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function tr(e,t){return{x:wt(e.x,t[0][0],t[1][0]),y:wt(e.y,t[0][1],t[1][1])}}function Xo(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function st(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function gt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!st(e)}function Lt(e){return gt(e)&&"computedPosition"in e}function an(e){return!Number.isNaN(e)&&Number.isFinite(e)}function gc(e){return an(e.width)&&an(e.height)&&an(e.x)&&an(e.y)}function vc(e,t,n){var i;const o={id:e.id.toString(),type:(i=e.type)!=null?i:"default",dimensions:It({width:0,height:0}),computedPosition:It({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:Ie(e.data)?e.data:{},events:It(Ie(e.events)?e.events:{})};return Object.assign(t!=null?t:o,e,{id:e.id.toString(),parentNode:n})}function nr(e,t,n){var a,s,l,u,c,f,v;var o,i;const r={id:e.id.toString(),type:(s=(a=e.type)!=null?a:t==null?void 0:t.type)!=null?s:"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:(l=e.updatable)!=null?l:n==null?void 0:n.updatable,selectable:(u=e.selectable)!=null?u:n==null?void 0:n.selectable,focusable:(c=e.focusable)!=null?c:n==null?void 0:n.focusable,data:Ie(e.data)?e.data:{},events:It(Ie(e.events)?e.events:{}),label:(f=e.label)!=null?f:"",interactionWidth:(v=e.interactionWidth)!=null?v:n==null?void 0:n.interactionWidth,...n!=null?n:{}};return Object.assign(t!=null?t:r,e,{id:e.id.toString()})}function or(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,a=o==="source"?"target":"source";for(const s of n)s[a]===i&&r.add(s[o]);return t.filter(s=>r.has(s.id))}function pc(...e){if(e.length===3){const[r,a,s]=e;return or(r,a,s,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>st(r)&&r.source===o).map(r=>n.find(a=>gt(a)&&a.id===r.target))}function mc(...e){if(e.length===3){const[r,a,s]=e;return or(r,a,s,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>st(r)&&r.target===o).map(r=>n.find(a=>gt(a)&&a.id===r.source))}function ir({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t!=null?t:""}-${n}${o!=null?o:""}`}function yc(e,t){return t.some(n=>st(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 rr({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function wn({x:e,y:t},{x:n,y:o,zoom:i},r=!1,[a,s]=[1,1]){const l={x:(e-n)/i,y:(t-o)/i};return r?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l}function _c(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 ar({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function wc({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function sr(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=_c(t,ar({...o.computedPosition,...o.dimensions}))}return wc(t)}function lr(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){var s,l,u,c;const r={...wn(t,n),width:t.width/n.zoom,height:t.height/n.zoom},a=[];for(const f of e){const{dimensions:v,selectable:p=!0,hidden:S=!1}=f,y=(l=(s=v.width)!=null?s:f.width)!=null?l:null,w=(c=(u=v.height)!=null?u:f.height)!=null?c:null;if(i&&!p||S)continue;const b=ro(r,io(f)),g=y===null||w===null,I=o&&b>0,N=(y!=null?y:0)*(w!=null?w:0);(g||I||b>=N||f.dragging)&&a.push(f)}return a}function ur(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 Uo(e,t,n,o,i,r=.1,a={x:0,y:0}){var y,w;const s=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(s,l),c=wt(u,o,i),f=e.x+e.width/2,v=e.y+e.height/2,p=t/2-f*c+((y=a.x)!=null?y:0),S=n/2-v*c+((w=a.y)!=null?w:0);return{x:p,y:S,zoom:c}}function bc(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function cr(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:cr(n,t):!1}function Wt(e,t){return typeof e=="undefined"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Zo(e,t,n){return e<t?wt(Math.abs(e-t),1,t)/t:e>n?-wt(Math.abs(e-n),1,t)/t:0}function dr(e,t,n=15,o=40){const i=Zo(e.x,o,t.width-o)*n,r=Zo(e.y,o,t.height-o)*n;return[i,r]}function Ln(e,t){var n,o;if(t){const i=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(i>0||r>0||e.position.x<0||e.position.y<0){let a={};if(typeof t.style=="function"?a={...t.style(t)}:t.style&&(a={...t.style}),a.width=(n=a.width)!=null?n:`${t.dimensions.width}px`,a.height=(o=a.height)!=null?o:`${t.dimensions.height}px`,i>0)if(typeof a.width=="string"){const s=Number(a.width.replace("px",""));a.width=`${s+i}px`}else a.width+=i;if(r>0)if(typeof a.height=="string"){const s=Number(a.height.replace("px",""));a.height=`${s+r}px`}else a.height+=r;if(e.position.x<0){const s=Math.abs(e.position.x);if(t.position.x=t.position.x-s,typeof a.width=="string"){const l=Number(a.width.replace("px",""));a.width=`${l+s}px`}else a.width+=s;e.position.x=0}if(e.position.y<0){const s=Math.abs(e.position.y);if(t.position.y=t.position.y-s,typeof a.height=="string"){const l=Number(a.height.replace("px",""));a.height=`${l+s}px`}else a.height+=s;e.position.y=0}t.dimensions.width=Number(a.width.toString().replace("px","")),t.dimensions.height=Number(a.height.toString().replace("px","")),typeof t.style=="function"?t.style=s=>{const l=t.style;return{...l(s),...a}}:t.style={...t.style,...a}}}}function qo(e,t){var n,o;const i=e.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")t.findIndex(l=>l.id===a.item.id)===-1&&t.push(a.item);else if(a.type==="remove"){const s=t.findIndex(l=>l.id===a.id);s!==-1&&t.splice(s,1)}const r=t.map(a=>a.id);for(const a of t)for(const s of e)if(s.id===a.id)switch(s.type){case"select":a.selected=s.selected;break;case"position":if(Lt(a)&&(typeof s.position!="undefined"&&(a.position=s.position),typeof s.dragging!="undefined"&&(a.dragging=s.dragging),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&Lt(l)&&Ln(a,l)}break;case"dimensions":if(Lt(a)&&(typeof s.dimensions!="undefined"&&(a.dimensions=s.dimensions),typeof s.updateStyle!="undefined"&&s.updateStyle&&(a.style={...a.style||{},width:`${(n=s.dimensions)==null?void 0:n.width}px`,height:`${(o=s.dimensions)==null?void 0:o.height}px`}),typeof s.resizing!="undefined"&&(a.resizing=s.resizing),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&Lt(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Ln(a,l):Xe(()=>{Ln(a,l)}))}break}return t}function ot(e,t){return{id:e,type:"select",selected:t}}function Wo(e){return{item:e,type:"add"}}function Ko(e){return{id:e,type:"remove"}}function jo(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function rt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const a=t.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(ot(r.id,a)))}return o}function U(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=s=>{t.delete(s)};return{on:s=>{e&&n&&t.delete(e),t.add(s);const l=()=>{i(s),e&&n&&t.add(e)};return En(l),{off:l}},off:i,trigger:s=>Promise.all(Array.from(t).map(l=>l(s))),hasListeners:o,fns:t}}function Qo(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 xc(e,t,n,o,i){var r,a;const s=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!cr(l,o))&&(l.draggable||t&&typeof l.draggable=="undefined")&&s.push(It({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-((a=l.computedPosition)==null?void 0:a.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return s}function Fn({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 fr(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 Ec(e,t,n){const[o,i,r,a]=typeof e!="string"?fr(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x!="undefined"&&typeof n.computedPosition.y!="undefined"&&typeof n.dimensions.width!="undefined"&&typeof n.dimensions.height!="undefined"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function Sc(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=Ec(i,e,o);r&&(i=r)}else t(new Ce(Me.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,a=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,a,s,l]=fr(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-a,i.range[1][1]+c-s]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Nc({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function _o(e,t,n,o,i){const r=Nc(e.dimensions,Sc(e,n,o,i)),a=tr(t,r);return{position:{x:a.x-((i==null?void 0:i.computedPosition.x)||0),y:a.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:a}}function bn(e,t,n=te.Left){var l,u,c;const o=((l=t==null?void 0:t.x)!=null?l:0)+e.computedPosition.x,i=((u=t==null?void 0:t.y)!=null?u:0)+e.computedPosition.y,{width:r,height:a}=t!=null?t:Mc(e);switch((c=t==null?void 0:t.position)!=null?c:n){case te.Top:return{x:o+r/2,y:i};case te.Right:return{x:o+r,y:i+a/2};case te.Bottom:return{x:o+r/2,y:i+a};case te.Left:return{x:o,y:i+a/2}}}function Jo(e=[],t){return e.length&&(t?e.find(n=>n.id===t):e[0])||null}function kc({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:s,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=ar({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:a/l.zoom,height:s/l.zoom}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),v=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*v)>0}function Ic(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),a=t(e.target);return!r||!a?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var Me=(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))(Me||{});const ei={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 Ce extends Error{constructor(t,...n){var o;super((o=ei[t])==null?void 0:o.call(ei,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function wo(e){return"clientX"in e}function at(e,t){var s,l;var n,o;const i=wo(e),r=i?e.clientX:(n=e.touches)==null?void 0:n[0].clientX,a=i?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((s=t==null?void 0:t.left)!=null?s:0),y:a-((l=t==null?void 0:t.top)!=null?l:0)}}const xn=()=>{var e;return typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Mc(e){var o,i,r,a;var t,n;return{width:(i=(o=(t=e.dimensions)==null?void 0:t.width)!=null?o:e.width)!=null?i:0,height:(a=(r=(n=e.dimensions)==null?void 0:n.height)!=null?r:e.height)!=null?a:0}}function hr(){return{handleDomNode:null,isValid:!1,connection:{source:"",target:"",sourceHandle:null,targetHandle:null},endHandle:null}}function Yn(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function ti(e,t,n,o){const i=[];for(const r of t[n]||[])if(`${e.id}-${r.id}-${n}`!==o){const{x:a,y:s}=bn(e,r);i.push({id:r.id||null,type:n,nodeId:e.id,x:a,y:s})}return i}function Cc(e,t,n,o,i,r){const{x:a,y:s}=at(e),u=t.elementsFromPoint(a,s).find(S=>S.classList.contains("vue-flow__handle"));if(u){const S=u.getAttribute("data-nodeid");if(S){const y=bo(void 0,u),w=u.getAttribute("data-handleid"),b=r({nodeId:S,id:w,type:y});if(b){const g=i.find(I=>I.nodeId===S&&I.type===y&&I.id===w);return{handle:{id:w,type:y,nodeId:S,x:(g==null?void 0:g.x)||n.x,y:(g==null?void 0:g.y)||n.y},validHandleResult:b}}}}let c=[],f=Number.POSITIVE_INFINITY;for(const S of i){const y=Math.sqrt((S.x-n.x)**2+(S.y-n.y)**2);if(y<=o){const w=r(S);y<=f&&(y<f?c=[{handle:S,validHandleResult:w}]:y===f&&c.push({handle:S,validHandleResult:w}),f=y)}}if(!c.length)return{handle:null,validHandleResult:hr()};if(c.length===1)return c[0];const v=c.some(({validHandleResult:S})=>S.isValid),p=c.some(({handle:S})=>S.type==="target");return c.find(({handle:S,validHandleResult:y})=>p?S.type==="target":v?y.isValid:!0)||c[0]}function ni(e,t,n,o,i,r,a,s,l,u,c){const f=r==="target",v=s.querySelector(`.vue-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:p,y:S}=at(e),y=s.elementFromPoint(p,S),w=y!=null&&y.classList.contains("vue-flow__handle")?y:v,b=hr();if(w){b.handleDomNode=w;const g=bo(void 0,w),I=w.getAttribute("data-nodeid"),N=w.getAttribute("data-handleid"),L=w.classList.contains("connectable"),G=w.classList.contains("connectableend"),V={source:f?I:o,sourceHandle:f?N:i,target:f?o:I,targetHandle:f?i:N};b.connection=V,L&&G&&(n===_t.Strict?f&&g==="source"||!f&&g==="target":I!==o||N!==i)&&(b.isValid=a(V,{edges:l,nodes:u,sourceNode:c(V.source),targetNode:c(V.target)}),b.endHandle={nodeId:I,handleId:N,type:g,position:b.isValid?w.getAttribute("data-handlepos"):null})}return b}function Pc({nodes:e,nodeId:t,handleId:n,handleType:o}){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{handleBounds:s}=a;let l=[],u=[];s&&(l=ti(a,s,"source",`${t}-${n}-${o}`),u=ti(a,s,"target",`${t}-${n}-${o}`)),i.push(...l,...u)}return i}function bo(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Tc(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}const Dc=["production","prod"];function Cn(e,...t){gr()&&console.warn(`[Vue Flow]: ${e}`,...t)}function gr(){return!Dc.includes("production")}function oi(e,t,n,o){const i=t.querySelectorAll(`.vue-flow__handle${e}`);return Array.from(i).map(a=>{const s=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(s.left-n.left)/o,y:(s.top-n.top)/o,...Mn(a)}})}function ao(e,t,n,o,i,r=!1,a){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Xe(()=>{a.blur()})):n([e])}function Ie(e){return typeof re(e)!="undefined"}function Ac(e,t,n,o){var r;if(!e||!e.source||!e.target)return n(new Ce(Me.EDGE_INVALID,(r=e==null?void 0:e.id)!=null?r:"[ID UNKNOWN]")),!1;let i;return st(e)?i=e:i={...e,id:ir(e)},i=nr(i,void 0,o),yc(i,t)?!1:i}function Oc(e,t,n,o,i,r){if(!t.source||!t.target)return r(new Ce(Me.EDGE_INVALID,e.id)),!1;const a=o(e.id);if(!a)return r(new Ce(Me.EDGE_NOT_FOUND,e.id)),!1;const{id:s,...l}=e,u={...l,id:i?ir(t):s,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.splice(n.indexOf(a),1,u),u}function ii(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const a=e[r];if(!gt(a)){n(new Ce(Me.NODE_INVALID,a==null?void 0:a.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=vc(a,t(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=s}for(const r of i){const a=t(r.parentNode)||i.find(s=>s.id===r.parentNode);r.parentNode&&!a&&n(new Ce(Me.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function ri(e,t){e.clear();for(const n of t){const{id:o,source:i,target:r,sourceHandle:a=null,targetHandle:s=null}=n,l=`${i}-source-${a}`,u=`${r}-target-${s}`,c=e.get(l)||new Map,f=e.get(u)||new Map,v=It({edgeId:o,source:i,target:r,sourceHandle:a,targetHandle:s});e.set(l,c.set(`${r}-${s}`,v)),e.set(u,f.set(`${i}-${a}`,v))}}function ai(e,t,n,o,i,r,a,s){const l=[];for(const u of e){const c=st(u)?u:Ac(u,s,i,r);if(!c)continue;const f=n(c.source),v=n(c.target);if(!f||!v){i(new Ce(Me.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!f){i(new Ce(Me.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!v){i(new Ce(Me.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:s,nodes:a,sourceNode:f,targetNode:v})){i(new Ce(Me.EDGE_INVALID,c.id));continue}const p=o(c.id);l.push({...nr(c,p,r),sourceNode:f,targetNode:v})}return l}const si=Symbol("vueFlow"),vr=Symbol("nodeId"),pr=Symbol("nodeRef"),zc=Symbol("edgeId"),$c=Symbol("edgeRef"),Pn=Symbol("slots");function mr(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:a,nodeDragThreshold:s,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:f,panBy:v,findNode:p,multiSelectionActive:S,nodesSelectionActive:y,selectNodesOnDrag:w,removeSelectedElements:b,addSelectedNodes:g,updateNodePositions:I,emits:N}=Ee(),{onStart:L,onDrag:G,onStop:V,onClick:q,el:K,disabled:O,id:m,selectable:j,dragHandle:le}=e,_=ge(!1);let M=[],E,T=null,z={x:void 0,y:void 0},H={x:0,y:0},Y=null,F=!1,ie=0,Z=!1;const R=Rc(),Q=({x:P,y:$})=>{z={x:P,y:$};let A=!1;if(M=M.map(d=>{const h={x:P-d.distance.x,y:$-d.distance.y};n.value&&(h.x=o.value[0]*Math.round(h.x/o.value[0]),h.y=o.value[1]*Math.round(h.y/o.value[1]));const{computedPosition:x}=_o(d,h,N.error,a.value,d.parentNode?p(d.parentNode):void 0);return A=A||d.position.x!==x.x||d.position.y!==x.y,d.position=x,d}),!!A&&(I(M,!0,!0),_.value=!0,Y)){const[d,h]=Fn({id:m,dragItems:M,findNode:p});G({event:Y,node:d,nodes:h})}},de=()=>{var A,d;if(!T)return;const[P,$]=dr(H,T,c.value);if(P!==0||$!==0){const h={x:((A=z.x)!=null?A:0)-P/l.value.zoom,y:((d=z.y)!=null?d:0)-$/l.value.zoom};v({x:P,y:$})&&Q(h)}ie=requestAnimationFrame(de)},ue=(P,$)=>{F=!0;const A=p(m);!w.value&&!S.value&&A&&(A.selected||b()),A&&pe(j)&&w.value&&ao(A,S.value,g,b,y,!1,$);const d=R(P);if(z=d,M=xc(r.value,f.value,d,p,m),M.length){const[h,x]=Fn({id:m,dragItems:M,findNode:p});L({event:P.sourceEvent,node:h,nodes:x})}},he=(P,$)=>{var A;P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||(s.value===0&&ue(P,$),z=R(P),T=((A=t.value)==null?void 0:A.getBoundingClientRect())||null,H=at(P.sourceEvent,T))},D=(P,$)=>{var d,h;const A=R(P);if(!Z&&F&&u.value&&(Z=!0,de()),!F){const x=A.xSnapped-((d=z.x)!=null?d:0),C=A.ySnapped-((h=z.y)!=null?h:0);Math.sqrt(x*x+C*C)>s.value&&ue(P,$)}(z.x!==A.xSnapped||z.y!==A.ySnapped)&&M.length&&F&&(Y=P.sourceEvent,H=at(P.sourceEvent,T),Q(A))},X=P=>{if(!_.value&&!S.value&&(q==null||q(P.sourceEvent)),_.value=!1,Z=!1,F=!1,z={x:void 0,y:void 0},cancelAnimationFrame(ie),M.length){I(M,!1,!1);const[$,A]=Fn({id:m,dragItems:M,findNode:p});V({event:P.sourceEvent,node:$,nodes:A})}};return ye([()=>pe(O),K],([P,$],A,d)=>{if($){const h=He($);P||(E=_l().on("start",x=>he(x,$)).on("drag",x=>D(x,$)).on("end",x=>X(x)).filter(x=>{const C=x.target,B=pe(le);return!x.button&&(!i.value||!Qo(C,`.${i.value}`,$)&&(!B||Qo(C,B,$)))}),h.call(E)),d(()=>{h.on(".drag",null),E&&(E.on("start",null),E.on("drag",null),E.on("end",null))})}}),_}function Hc(){return{doubleClick:U(),click:U(),mouseEnter:U(),mouseMove:U(),mouseLeave:U(),contextMenu:U(),updateStart:U(),update:U(),updateEnd:U()}}function Bc(e,t){const n=Hc();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 Rc(){const{viewport:e,snapGrid:t,snapToGrid:n}=Ee();return({sourceEvent:o})=>{const i=o.touches?o.touches[0].clientX:o.clientX,r=o.touches?o.touches[0].clientY:o.clientY,a={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(a.x/t.value[0]):a.x,ySnapped:n.value?t.value[1]*Math.round(a.y/t.value[1]):a.y,...a}}}function sn(){return!0}function yr({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{vueFlowRef:s,connectionMode:l,connectionRadius:u,connectOnClick:c,connectionClickStartHandle:f,nodesConnectable:v,autoPanOnConnect:p,autoPanSpeed:S,findNode:y,panBy:w,startConnection:b,updateConnection:g,endConnection:I,emits:N,viewport:L,edges:G,nodes:V,isValidConnection:q}=Ee();let K=null,O=!1,m=null,j=null;function le(M){var E;const T=pe(n)==="target",z=wo(M),H=Xo(M.target);if(z&&M.button===0||!z){let Y=function(x){$=at(x,X);const{handle:C,validHandleResult:B}=Cc(x,H,wn($,L.value,!1,[1,1]),u.value,d,ne=>ni(x,ne,l.value,pe(t),pe(e),T?"target":"source",Z,H,G.value,V.value,y));if(R=C,A||(h(),A=!0),K=B.connection,O=B.isValid,m=B.handleDomNode,!(O&&R&&(j!=null&&j.endHandle)&&B.endHandle&&j.endHandle.type===B.endHandle.type&&j.endHandle.nodeId===B.endHandle.nodeId&&j.endHandle.handleId===B.endHandle.handleId)){if(g(R&&O?rr({x:R.x,y:R.y},L.value):$,B.endHandle,Tc(!!R,O)),j=B,!R&&!O&&!m)return Yn(P);K&&K.source!==K.target&&m&&(Yn(P),P=m,m.classList.add("connecting","vue-flow__handle-connecting"),m.classList.toggle("valid",O),m.classList.toggle("vue-flow__handle-valid",O))}},F=function(x){(R||m)&&K&&O&&(r?r(x,K):N.connect(K)),N.connectEnd(x),i&&(a==null||a(x)),Yn(P),cancelAnimationFrame(Q),I(x),A=!1,O=!1,K=null,m=null,H.removeEventListener("mousemove",Y),H.removeEventListener("mouseup",F),H.removeEventListener("touchmove",Y),H.removeEventListener("touchend",F)};const ie=y(pe(t));let Z=pe(o)||q.value||sn;!Z&&ie&&(Z=(T?ie.isValidSourcePos:ie.isValidTargetPos)||sn);let R,Q=0;const{x:de,y:ue}=at(M),he=H==null?void 0:H.elementFromPoint(de,ue),D=bo(pe(i),he),X=(E=s.value)==null?void 0:E.getBoundingClientRect();if(!X||!D)return;let P,$=at(M,X),A=!1;const d=Pc({nodes:V.value,nodeId:pe(t),handleId:pe(e),handleType:D}),h=()=>{if(!p.value)return;const[x,C]=dr($,X,S.value);w({x,y:C}),Q=requestAnimationFrame(h)};b({nodeId:pe(t),handleId:pe(e),type:D,position:(he==null?void 0:he.getAttribute("data-handlepos"))||te.Top},{x:de-X.left,y:ue-X.top}),N.connectStart({event:M,nodeId:pe(t),handleId:pe(e),handleType:D}),H.addEventListener("mousemove",Y),H.addEventListener("mouseup",F),H.addEventListener("touchmove",Y),H.addEventListener("touchend",F)}}function _(M){if(!c.value)return;const E=pe(n)==="target";if(!f.value)N.clickConnectStart({event:M,nodeId:pe(t),handleId:pe(e)}),b({nodeId:pe(t),type:pe(n),handleId:pe(e)},void 0,!0);else{let T=pe(o)||q.value||sn;const z=y(pe(t));if(!T&&z&&(T=(E?z.isValidSourcePos:z.isValidTargetPos)||sn),z&&(typeof z.connectable=="undefined"?v.value:z.connectable)===!1)return;const H=Xo(M.target),{connection:Y,isValid:F}=ni(M,{nodeId:pe(t),id:pe(e),type:pe(n)},l.value,f.value.nodeId,f.value.handleId||null,f.value.type,T,H,G.value,V.value,y),ie=Y.source===Y.target;F&&!ie&&N.connect(Y),N.clickConnectEnd(M),I(M,!0)}}return{handlePointerDown:le,handleClick:_}}function Vc(){return zt(vr,"")}function _r(e){var s;const t=(s=e!=null?e:Vc())!=null?s:"",n=zt(pr,ge(null)),{findNode:o,edges:i,emits:r}=Ee(),a=o(t);return a||r.error(new Ce(Me.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:a,parentNode:ae(()=>o(a.parentNode)),connectedEdges:ae(()=>ur([a],i.value))}}function Lc(){return{doubleClick:U(),click:U(),mouseEnter:U(),mouseMove:U(),mouseLeave:U(),contextMenu:U(),dragStart:U(),drag:U(),dragStop:U()}}function Fc(e,t){const n=Lc();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 wr(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:s}=Ee();return(l,u=!1)=>{const c=r.value?i.value[0]:5,f=r.value?i.value[1]:5,v=u?4:1,p=l.x*c*v,S=l.y*f*v,y=[];for(const w of e.value)if(w.draggable||a&&typeof w.draggable=="undefined"){const b={x:w.computedPosition.x+p,y:w.computedPosition.y+S},{computedPosition:g}=_o(w,b,s.error,t.value,w.parentNode?o(w.parentNode):void 0);y.push({id:w.id,position:g,from:w.position,distance:{x:l.x,y:l.y},dimensions:w.dimensions})}n(y,!0,!1)}}const Gn=.1;function nt(){return Cn("Viewport not initialized yet."),Promise.resolve(!1)}const Yc={zoomIn:nt,zoomOut:nt,zoomTo:nt,fitView:nt,setCenter:nt,fitBounds:nt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:nt,setTransform:nt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Gc(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(Xn(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(s=>{const{x:l,y:u}=tr({x:-o,y:-i},e.translateExtent),c=Ot.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(Xn(e.d3Selection,a,()=>{s(!0)}),c):s(!1)})}return ae(()=>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(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(Xn(e.d3Selection,r==null?void 0:r.duration,()=>{a(!0)}),i):a(!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:Gn,includeHiddenNodes:!1,duration:0})=>{var v,p,S;var r,a;const s=[];for(const y of e.nodes)y.dimensions.width&&y.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!y.hidden)&&(!((r=i.nodes)!=null&&r.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(y.id))&&s.push(y);if(!s.length)return Promise.resolve(!1);const l=sr(s),{x:u,y:c,zoom:f}=Uo(l,e.dimensions.width,e.dimensions.height,(v=i.minZoom)!=null?v:e.minZoom,(p=i.maxZoom)!=null?p:e.maxZoom,(S=i.padding)!=null?S:Gn,i.offset);return n(u,c,f,i==null?void 0:i.duration)},setCenter:(i,r,a)=>{const s=typeof(a==null?void 0:a.zoom)!="undefined"?a.zoom:e.maxZoom,l=e.dimensions.width/2-i*s,u=e.dimensions.height/2-r*s;return n(l,u,s,a==null?void 0:a.duration)},fitBounds:(i,r={padding:Gn})=>{const{x:a,y:s,zoom:l}=Uo(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(a,s,l,r==null?void 0:r.duration)},project:i=>wn(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x-r,y:i.y-a};return wn(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x+r,y:i.y+a};return rr(s,e.viewport)}return{x:0,y:0}}}:Yc)}function Xn(e,t=0,n){return e.transition().duration(t).on("end",n)}function Xc(e,t,n){const o=pi(!0);return o.run(()=>{const i=()=>{o.run(()=>{let y,w,b=!!(n.nodes.value.length||n.edges.value.length);y=St([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)&&(w==null||w.pause(),n.setElements(g),!w&&!b&&g.length?b=!0:w==null||w.resume())}),w=St([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)&&(y==null||y.pause(),e.modelValue.value=[...g,...I],Xe(()=>{y==null||y.resume()}))},{immediate:b}),un(()=>{y==null||y.stop(),w==null||w.stop()})})},r=()=>{o.run(()=>{let y,w,b=!!n.nodes.value.length;y=St([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)&&(w==null||w.pause(),n.setNodes(g),!w&&!b&&g.length?b=!0:w==null||w.resume())}),w=St([n.nodes,()=>n.nodes.value.length],([g])=>{var I;(I=e.nodes)!=null&&I.value&&Array.isArray(e.nodes.value)&&(y==null||y.pause(),e.nodes.value=[...g],Xe(()=>{y==null||y.resume()}))},{immediate:b}),un(()=>{y==null||y.stop(),w==null||w.stop()})})},a=()=>{o.run(()=>{let y,w,b=!!n.edges.value.length;y=St([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)&&(w==null||w.pause(),n.setEdges(g),!w&&!b&&g.length?b=!0:w==null||w.resume())}),w=St([n.edges,()=>n.edges.value.length],([g])=>{var I;(I=e.edges)!=null&&I.value&&Array.isArray(e.edges.value)&&(y==null||y.pause(),e.edges.value=[...g],Xe(()=>{y==null||y.resume()}))},{immediate:b}),un(()=>{y==null||y.stop(),w==null||w.stop()})})},s=()=>{o.run(()=>{ye(()=>t.maxZoom,()=>{t.maxZoom&&Ie(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ye(()=>t.minZoom,()=>{t.minZoom&&Ie(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ye(()=>t.translateExtent,()=>{t.translateExtent&&Ie(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ye(()=>t.nodeExtent,()=>{t.nodeExtent&&Ie(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{ye(()=>t.applyDefault,()=>{Ie(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},v=()=>{o.run(()=>{const y=async w=>{let b=w;typeof t.autoConnect=="function"&&(b=await t.autoConnect(w)),b!==!1&&n.addEdges([b])};ye(()=>t.autoConnect,()=>{Ie(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ye(n.autoConnect,(w,b,g)=>{w?n.onConnect(y):n.hooks.value.connect.off(y),g(()=>{n.hooks.value.connect.off(y)})},{immediate:!0})})},p=()=>{const y=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const w of Object.keys(t)){const b=w;if(!y.includes(b)){const g=Ne(()=>t[b]),I=n[b];co(I)&&o.run(()=>{ye(g,N=>{Ie(N)&&(I.value=N)},{immediate:!0})})}}};(()=>{i(),r(),a(),l(),s(),u(),c(),f(),v(),p()})()}),()=>o.stop()}function Uc(){return{edgesChange:U(),nodesChange:U(),nodeDoubleClick:U(),nodeClick:U(),nodeMouseEnter:U(),nodeMouseMove:U(),nodeMouseLeave:U(),nodeContextMenu:U(),nodeDragStart:U(),nodeDrag:U(),nodeDragStop:U(),nodesInitialized:U(),miniMapNodeClick:U(),miniMapNodeDoubleClick:U(),miniMapNodeMouseEnter:U(),miniMapNodeMouseMove:U(),miniMapNodeMouseLeave:U(),connect:U(),connectStart:U(),connectEnd:U(),clickConnectStart:U(),clickConnectEnd:U(),paneReady:U(),init:U(),move:U(),moveStart:U(),moveEnd:U(),selectionDragStart:U(),selectionDrag:U(),selectionDragStop:U(),selectionContextMenu:U(),selectionStart:U(),selectionEnd:U(),viewportChangeStart:U(),viewportChange:U(),viewportChangeEnd:U(),paneScroll:U(),paneClick:U(),paneContextMenu:U(),paneMouseEnter:U(),paneMouseMove:U(),paneMouseLeave:U(),edgeContextMenu:U(),edgeMouseEnter:U(),edgeMouseMove:U(),edgeMouseLeave:U(),edgeDoubleClick:U(),edgeClick:U(),edgeUpdateStart:U(),edgeUpdate:U(),edgeUpdateEnd:U(),updateNodeInternals:U(),error:U(e=>Cn(e.message))}}function Zc(e,t){mi(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),En(()=>{o.off(i)})}})}function br(){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:yo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Ft.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:ct.Bezier,style:{}},connectionMode:_t.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:xn()?"Meta":"Control",zoomActivationKeyCode:xn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Uc(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const qc=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Wc(e,t,n){const o=Gc(e),i=d=>{const h=d!=null?d:[];e.hooks.updateNodeInternals.trigger(h)},r=d=>mc(d,e.nodes,e.edges),a=d=>pc(d,e.nodes,e.edges),s=d=>ur(d,e.edges),l=({id:d,type:h,nodeId:x})=>{var B;var C;return Array.from((B=(C=e.connectionLookup.get(`${x}-${h}-${d!=null?d:null}`))==null?void 0:C.values())!=null?B:[])},u=d=>{if(d)return t.value.get(d)},c=d=>{if(d)return n.value.get(d)},f=(d,h,x)=>{var k,W;var C,B;const ne=[];for(const se of d){const fe={id:se.id,type:"position",dragging:x,from:se.from};if(h&&(fe.position=se.position,se.parentNode)){const ce=u(se.parentNode);fe.position={x:fe.position.x-((k=(C=ce==null?void 0:ce.computedPosition)==null?void 0:C.x)!=null?k:0),y:fe.position.y-((W=(B=ce==null?void 0:ce.computedPosition)==null?void 0:B.y)!=null?W:0)}}ne.push(fe)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},v=d=>{if(!e.vueFlowRef)return;const h=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!h)return;const x=window.getComputedStyle(h),{m22:C}=new window.DOMMatrixReadOnly(x.transform),B=[];for(let ne=0;ne<d.length;++ne){const k=d[ne],W=u(k.id);if(W){const se=Mn(k.nodeElement);if(!!(se.width&&se.height&&(W.dimensions.width!==se.width||W.dimensions.height!==se.height||k.forceUpdate))){const ce=k.nodeElement.getBoundingClientRect();W.dimensions=se,W.handleBounds.source=oi(".source",k.nodeElement,ce,C),W.handleBounds.target=oi(".target",k.nodeElement,ce,C),B.push({id:W.id,type:"dimensions",dimensions:se})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),B.length&&e.hooks.nodesChange.trigger(B)},p=(d,h)=>{const x=new Set,C=new Set;for(const k of d)gt(k)?x.add(k.id):st(k)&&C.add(k.id);const B=rt(t.value,x,!0),ne=rt(n.value,C);if(e.multiSelectionActive){for(const k of x)B.push(ot(k,h));for(const k of C)ne.push(ot(k,h))}B.length&&e.hooks.nodesChange.trigger(B),ne.length&&e.hooks.edgesChange.trigger(ne)},S=d=>{if(e.multiSelectionActive){const h=d.map(x=>ot(x.id,!0));e.hooks.nodesChange.trigger(h);return}e.hooks.nodesChange.trigger(rt(t.value,new Set(d.map(h=>h.id)),!0)),e.hooks.edgesChange.trigger(rt(n.value))},y=d=>{if(e.multiSelectionActive){const h=d.map(x=>ot(x.id,!0));e.hooks.edgesChange.trigger(h);return}e.hooks.edgesChange.trigger(rt(n.value,new Set(d.map(h=>h.id)))),e.hooks.nodesChange.trigger(rt(t.value,new Set,!0))},w=d=>{p(d,!0)},b=d=>{const x=(d||e.nodes).map(C=>(C.selected=!1,ot(C.id,!1)));e.hooks.nodesChange.trigger(x)},g=d=>{const x=(d||e.edges).map(C=>(C.selected=!1,ot(C.id,!1)));e.hooks.edgesChange.trigger(x)},I=d=>{if(!d||!d.length)return p([],!1);const h=d.reduce((x,C)=>{const B=ot(C.id,!1);return gt(C)?x.nodes.push(B):x.edges.push(B),x},{nodes:[],edges:[]});h.nodes.length&&e.hooks.nodesChange.trigger(h.nodes),h.edges.length&&e.hooks.edgesChange.trigger(h.edges)},N=d=>{var h;(h=e.d3Zoom)==null||h.scaleExtent([d,e.maxZoom]),e.minZoom=d},L=d=>{var h;(h=e.d3Zoom)==null||h.scaleExtent([e.minZoom,d]),e.maxZoom=d},G=d=>{var h;(h=e.d3Zoom)==null||h.translateExtent(d),e.translateExtent=d},V=d=>{e.nodeExtent=d,i()},q=d=>{var h;(h=e.d3Zoom)==null||h.clickDistance(d)},K=d=>{e.nodesDraggable=d,e.nodesConnectable=d,e.elementsSelectable=d},O=d=>{const h=d instanceof Function?d(e.nodes):d;!e.initialized&&!h.length||(e.nodes=ii(h,u,e.hooks.error.trigger))},m=d=>{const h=d instanceof Function?d(e.edges):d;if(!e.initialized&&!h.length)return;const x=ai(h,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);ri(e.connectionLookup,x),e.edges=x},j=d=>{const h=d instanceof Function?d([...e.nodes,...e.edges]):d;!e.initialized&&!h.length||(O(h.filter(gt)),m(h.filter(st)))},le=d=>{let h=d instanceof Function?d(e.nodes):d;h=Array.isArray(h)?h:[h];const x=ii(h,u,e.hooks.error.trigger),C=[];for(const B of x)C.push(Wo(B));C.length&&e.hooks.nodesChange.trigger(C)},_=d=>{let h=d instanceof Function?d(e.edges):d;h=Array.isArray(h)?h:[h];const x=ai(h,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),C=[];for(const B of x)C.push(Wo(B));C.length&&e.hooks.edgesChange.trigger(C)},M=(d,h=!0,x=!1)=>{const C=d instanceof Function?d(e.nodes):d,B=Array.isArray(C)?C:[C],ne=[],k=[];function W(fe){const ce=s(fe);for(const me of ce)(!Ie(me.deletable)||me.deletable)&&k.push(jo(me.id,me.source,me.target,me.sourceHandle,me.targetHandle))}function se(fe){const ce=[];for(const me of e.nodes)me.parentNode===fe&&ce.push(me);if(ce.length){for(const me of ce)ne.push(Ko(me.id));h&&W(ce);for(const me of ce)se(me.id)}}for(const fe of B){const ce=typeof fe=="string"?u(fe):fe;ce&&(Ie(ce.deletable)&&!ce.deletable||(ne.push(Ko(ce.id)),h&&W([ce]),x&&se(ce.id)))}k.length&&e.hooks.edgesChange.trigger(k),ne.length&&e.hooks.nodesChange.trigger(ne)},E=d=>{const h=d instanceof Function?d(e.edges):d,x=Array.isArray(h)?h:[h],C=[];for(const B of x){const ne=typeof B=="string"?c(B):B;ne&&(Ie(ne.deletable)&&!ne.deletable||C.push(jo(typeof B=="string"?B:B.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(C)},T=(d,h,x=!0)=>Oc(d,h,e.edges,c,x,e.hooks.error.trigger),z=(d,h,x={replace:!1})=>{const C=c(d);if(!C)return;const B=typeof h=="function"?h(C):h;C.data=x.replace?B:{...C.data,...B}},H=d=>qo(d,e.nodes),Y=d=>{const h=qo(d,e.edges);return ri(e.connectionLookup,h),h},F=(d,h,x={replace:!1})=>{const C=u(d);if(!C)return;const B=typeof h=="function"?h(C):h;x.replace?e.nodes.splice(e.nodes.indexOf(C),1,B):Object.assign(C,B)},ie=(d,h,x={replace:!1})=>{const C=u(d);if(!C)return;const B=typeof h=="function"?h(C):h;C.data=x.replace?B:{...C.data,...B}},Z=(d,h,x=!1)=>{x?e.connectionClickStartHandle=d:e.connectionStartHandle=d,e.connectionEndHandle=null,e.connectionStatus=null,h&&(e.connectionPosition=h)},R=(d,h=null,x=null)=>{e.connectionStartHandle&&(e.connectionPosition=d,e.connectionEndHandle=h,e.connectionStatus=x)},Q=(d,h)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,h?e.connectionClickStartHandle=null:e.connectionStartHandle=null},de=d=>{const h=gc(d),x=h?null:Lt(d)?d:u(d.id);return!h&&!x?[null,null,h]:[h?d:io(x),x,h]},ue=(d,h=!0,x=e.nodes)=>{const[C,B,ne]=de(d);if(!C)return[];const k=[];for(const W of x||e.nodes){if(!ne&&(W.id===B.id||!W.computedPosition))continue;const se=io(W),fe=ro(se,C);(h&&fe>0||fe>=Number(C.width)*Number(C.height))&&k.push(W)}return k},he=(d,h,x=!0)=>{const[C]=de(d);if(!C)return!1;const B=ro(C,h);return x&&B>0||B>=Number(C.width)*Number(C.height)},D=d=>{const{viewport:h,dimensions:x,d3Zoom:C,d3Selection:B,translateExtent:ne}=e;if(!C||!B||!d.x&&!d.y)return!1;const k=Ot.translate(h.x+d.x,h.y+d.y).scale(h.zoom),W=[[0,0],[x.width,x.height]],se=C.constrain()(k,W,ne),fe=e.viewport.x!==se.x||e.viewport.y!==se.y||e.viewport.zoom!==se.k;return C.transform(B,se),fe},X=d=>{const h=d instanceof Function?d(e):d,x=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ie(h.defaultEdgeOptions)&&(e.defaultEdgeOptions=h.defaultEdgeOptions);const C=h.modelValue||h.nodes||h.edges?[]:void 0;C&&(h.modelValue&&C.push(...h.modelValue),h.nodes&&C.push(...h.nodes),h.edges&&C.push(...h.edges),j(C));const B=()=>{Ie(h.maxZoom)&&L(h.maxZoom),Ie(h.minZoom)&&N(h.minZoom),Ie(h.translateExtent)&&G(h.translateExtent)};for(const ne of Object.keys(h)){const k=ne,W=h[k];![...qc,...x].includes(k)&&Ie(W)&&(e[k]=W)}Zn(()=>e.d3Zoom).not.toBeNull().then(B),e.initialized||(e.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:v,setElements:j,setNodes:O,setEdges:m,addNodes:le,addEdges:_,removeNodes:M,removeEdges:E,findNode:u,findEdge:c,updateEdge:T,updateEdgeData:z,updateNode:F,updateNodeData:ie,applyEdgeChanges:Y,applyNodeChanges:H,addSelectedElements:w,addSelectedNodes:S,addSelectedEdges:y,setMinZoom:N,setMaxZoom:L,setTranslateExtent:G,setNodeExtent:V,setPaneClickDistance:q,removeSelectedElements:I,removeSelectedNodes:b,removeSelectedEdges:g,startConnection:Z,updateConnection:R,endConnection:Q,setInteractive:K,setState:X,getIntersectingNodes:ue,getIncomers:r,getOutgoers:a,getConnectedEdges:s,getHandleConnections:l,isNodeIntersecting:he,panBy:D,fitView:d=>o.value.fitView(d),zoomIn:d=>o.value.zoomIn(d),zoomOut:d=>o.value.zoomOut(d),zoomTo:(d,h)=>o.value.zoomTo(d,h),setViewport:(d,h)=>o.value.setViewport(d,h),setTransform:(d,h)=>o.value.setTransform(d,h),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(d,h,x)=>o.value.setCenter(d,h,x),fitBounds:(d,h)=>o.value.fitBounds(d,h),project:d=>o.value.project(d),screenToFlowCoordinate:d=>o.value.screenToFlowCoordinate(d),flowToScreenCoordinate:d=>o.value.flowToScreenCoordinate(d),toObject:()=>{const d=[],h=[];for(const x of e.nodes){const{computedPosition:C,handleBounds:B,selected:ne,dimensions:k,isParent:W,resizing:se,dragging:fe,events:ce,...me}=x;d.push(me)}for(const x of e.edges){const{selected:C,sourceNode:B,targetNode:ne,events:k,...W}=x;h.push(W)}return JSON.parse(JSON.stringify({nodes:d,edges:h,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:d=>new Promise(h=>{const{nodes:x,edges:C,position:B,zoom:ne,viewport:k}=d;if(x&&O(x),C&&m(C),k!=null&&k.x&&(k!=null&&k.y)||B){const W=(k==null?void 0:k.x)||B[0],se=(k==null?void 0:k.y)||B[1],fe=(k==null?void 0:k.zoom)||ne||e.viewport.zoom;return Zn(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:W,y:se,zoom:fe}).then(()=>{h(!0)})})}else h(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{var h,x,C;const d=br();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const B=Ot.translate((h=d.defaultViewport.x)!=null?h:0,(x=d.defaultViewport.y)!=null?x:0).scale(wt((C=d.defaultViewport.zoom)!=null?C:1,d.minZoom,d.maxZoom)),ne=e.viewportRef.getBoundingClientRect(),k=[[0,0],[ne.width,ne.height]],W=e.d3Zoom.constrain()(B,k,d.translateExtent);e.d3Zoom.transform(e.d3Selection,W)}X(d)},$destroy:()=>{}}}const Kc=["data-id","data-handleid","data-nodeid","data-handlepos"],jc={name:"Handle",compatConfig:{MODE:3}},Kt=be({...jc,props:{id:{default:null},type:{},position:{default:()=>te.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=yi(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ne(()=>{var O;return(O=n.type)!=null?O:"source"}),i=Ne(()=>{var O;return(O=n.isValidConnection)!=null?O:null}),{connectionStartHandle:r,connectionClickStartHandle:a,connectionEndHandle:s,vueFlowRef:l,nodesConnectable:u,noDragClassName:c,noPanClassName:f}=Ee(),{id:v,node:p,nodeEl:S,connectedEdges:y}=_r(),w=ge(),b=Ne(()=>typeof e.connectableStart!="undefined"?e.connectableStart:!0),g=Ne(()=>typeof e.connectableEnd!="undefined"?e.connectableEnd:!0),I=Ne(()=>{var O,m,j,le,_,M;return((O=r.value)==null?void 0:O.nodeId)===v&&((m=r.value)==null?void 0:m.handleId)===e.id&&((j=r.value)==null?void 0:j.type)===o.value||((le=s.value)==null?void 0:le.nodeId)===v&&((_=s.value)==null?void 0:_.handleId)===e.id&&((M=s.value)==null?void 0:M.type)===o.value}),N=Ne(()=>{var O,m,j;return((O=a.value)==null?void 0:O.nodeId)===v&&((m=a.value)==null?void 0:m.handleId)===e.id&&((j=a.value)==null?void 0:j.type)===o.value}),{handlePointerDown:L,handleClick:G}=yr({nodeId:v,handleId:e.id,isValidConnection:i,type:o}),V=ae(()=>typeof e.connectable=="string"&&e.connectable==="single"?!y.value.some(O=>{const m=O[`${o.value}Handle`];return O[o.value]!==v?!1:m?m===e.id:!0}):typeof e.connectable=="number"?y.value.filter(O=>{const m=O[`${o.value}Handle`];return O[o.value]!==v?!1:m?m===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(p,y.value):Ie(e.connectable)?e.connectable:u.value);Ze(()=>{var z;var O;if(!p.dimensions.width||!p.dimensions.height)return;const m=(O=p.handleBounds[o.value])==null?void 0:O.find(H=>H.id===e.id);if(!l.value||m)return;const j=l.value.querySelector(".vue-flow__transformationpane");if(!S.value||!w.value||!j||!e.id)return;const le=S.value.getBoundingClientRect(),_=w.value.getBoundingClientRect(),M=window.getComputedStyle(j),{m22:E}=new window.DOMMatrixReadOnly(M.transform),T={id:e.id,position:e.position,x:(_.left-le.left)/E,y:(_.top-le.top)/E,...Mn(w.value)};p.handleBounds[o.value]=[...(z=p.handleBounds[o.value])!=null?z:[],T]}),lo(()=>{const O=p.handleBounds[o.value];O&&(p.handleBounds[o.value]=O.filter(m=>m.id!==e.id))});function q(O){const m=wo(O);V.value&&b.value&&(m&&O.button===0||!m)&&L(O)}function K(O){!v||!a.value&&!b.value||V.value&&G(O)}return t({handleClick:G,handlePointerDown:L,onClick:K,onPointerDown:q}),(O,m)=>(ee(),ve("div",{ref_key:"handle",ref:w,"data-id":`${re(v)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":re(v),"data-handlepos":O.position,class:mt(["vue-flow__handle",[`vue-flow__handle-${O.position}`,`vue-flow__handle-${e.id}`,re(c),re(f),o.value,{connectable:V.value,connecting:N.value,connectablestart:b.value,connectableend:g.value,connectionindicator:V.value&&(b.value&&!I.value||g.value&&I.value)}]]),onMousedown:q,onTouchstartPassive:q,onClick:K},[pt(O.$slots,"default",{id:O.id})],42,Kc))}}),Tn=function({sourcePosition:e=te.Bottom,targetPosition:t=te.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const s=a.label||n;return[_e(Kt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof s!="string"&&s?_e(s):_e("div",{innerHTML:s}),_e(Kt,{type:"source",position:e,connectable:o,isValidConnection:r})]};Tn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Tn.inheritAttrs=!1;Tn.compatConfig={MODE:3};const Qc=Tn,Dn=function({targetPosition:e=te.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[_e(Kt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?_e(r):_e("div",{innerHTML:r})]};Dn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Dn.inheritAttrs=!1;Dn.compatConfig={MODE:3};const Jc=Dn,An=function({sourcePosition:e=te.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?_e(r):_e("div",{innerHTML:r}),_e(Kt,{type:"source",position:e,connectable:n,isValidConnection:o})]};An.props=["sourcePosition","label","isValidSourcePos","connectable","data"];An.inheritAttrs=!1;An.compatConfig={MODE:3};const ed=An,td=["transform"],nd=["width","height","x","y","rx","ry"],od=["y"],id={name:"EdgeText",compatConfig:{MODE:3}},rd=be({...id,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ge({x:0,y:0,width:0,height:0}),n=ge(null),o=ae(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Ze(i),ye([()=>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,a)=>(ee(),ve("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(ee(),ve("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:De(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,nd)):Se("",!0),Pe("text",Lr(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[pt(r.$slots,"default",{},()=>[typeof r.label!="string"?(ee(),we(Vr(r.label),{key:0})):(ee(),ve(ze,{key:1},[ke(xe(r.label),1)],64))])],16,od)],8,td))}}),ad=["id","d","marker-end","marker-start"],sd=["d","stroke-width"],ld={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},On=be({...ld,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=yi(e,["interactionWidth","labelShowBg"]),o=ge(null),i=ge(null),r=ge(null),a=Rr();return t({pathEl:o,interactionEl:i,labelEl:r}),(s,l)=>(ee(),ve(ze,null,[Pe("path",{id:s.id,ref_key:"pathEl",ref:o,d:s.path,style:De(n.style),class:mt(["vue-flow__edge-path",re(a).class]),"marker-end":s.markerEnd,"marker-start":s.markerStart},null,14,ad),s.interactionWidth?(ee(),ve("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,sd)):Se("",!0),s.label&&s.labelX&&s.labelY?(ee(),we(rd,{key:1,ref_key:"labelEl",ref:r,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Se("",!0)],64))}});function xr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,a=Math.abs(o-t)/2,s=o<t?o+a:o-a;return[r,s,i,a]}function Er({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+r*.375+s*.375+o*.125,c=Math.abs(l-e),f=Math.abs(u-t);return[l,u,c,f]}function ln(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function li({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let a,s;switch(e){case te.Left:a=t-ln(t-o,r),s=n;break;case te.Right:a=t+ln(o-t,r),s=n;break;case te.Top:a=t,s=n-ln(n-i,r);break;case te.Bottom:a=t,s=n+ln(i-n,r);break}return[a,s]}function Sr(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top,curvature:s=.25}=e,[l,u]=li({pos:o,x1:t,y1:n,x2:i,y2:r,c:s}),[c,f]=li({pos:a,x1:i,y1:r,x2:t,y2:n,c:s}),[v,p,S,y]=Er({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}`,v,p,S,y]}function ui({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,a;switch(e){case te.Left:case te.Right:r=.5*(t+o),a=n;break;case te.Top:case te.Bottom:r=t,a=.5*(n+i);break}return[r,a]}function Nr(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top}=e,[s,l]=ui({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=ui({pos:a,x1:i,y1:r,x2:t,y2:n}),[f,v,p,S]=Er({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${s},${l} ${u},${c} ${i},${r}`,f,v,p,S]}const ci={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}};function ud({source:e,sourcePosition:t=te.Bottom,target:n}){return t===te.Left||t===te.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 di(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function cd({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:o=te.Top,center:i,offset:r}){var V,q;const a=ci[t],s=ci[o],l={x:e.x+a.x*r,y:e.y+a.y*r},u={x:n.x+s.x*r,y:n.y+s.y*r},c=ud({source:l,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",v=c[f];let p,S,y;const w={x:0,y:0},b={x:0,y:0},[g,I,N,L]=xr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*s[f]===-1){S=(V=i.x)!=null?V:g,y=(q=i.y)!=null?q:I;const K=[{x:S,y:l.y},{x:S,y:u.y}],O=[{x:l.x,y},{x:u.x,y}];a[f]===v?p=f==="x"?K:O:p=f==="x"?O:K}else{const K=[{x:l.x,y:u.y}],O=[{x:u.x,y:l.y}];if(f==="x"?p=a.x===v?O:K:p=a.y===v?K:O,t===o){const M=Math.abs(e[f]-n[f]);if(M<=r){const E=Math.min(r-1,r-M);a[f]===v?w[f]=(l[f]>e[f]?-1:1)*E:b[f]=(u[f]>n[f]?-1:1)*E}}if(t!==o){const M=f==="x"?"y":"x",E=a[f]===s[M],T=l[M]>u[M],z=l[M]<u[M];(a[f]===1&&(!E&&T||E&&z)||a[f]!==1&&(!E&&z||E&&T))&&(p=f==="x"?K:O)}const m={x:l.x+w.x,y:l.y+w.y},j={x:u.x+b.x,y:u.y+b.y},le=Math.max(Math.abs(m.x-p[0].x),Math.abs(j.x-p[0].x)),_=Math.max(Math.abs(m.y-p[0].y),Math.abs(j.y-p[0].y));le>=_?(S=(m.x+j.x)/2,y=p[0].y):(S=p[0].x,y=(m.y+j.y)/2)}return[[e,{x:l.x+w.x,y:l.y+w.y},...p,{x:u.x+b.x,y:u.y+b.y},n],S,y,N,L]}function dd(e,t,n,o){const i=Math.min(di(e,t)/2,di(t,n)/2,o),{x:r,y:a}=t;if(e.x===r&&r===n.x||e.y===a&&a===n.y)return`L${r} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${a}Q ${r},${a} ${r},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${a+i*l}Q ${r},${a} ${r+i*s},${a}`}function so(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top,borderRadius:s=5,centerX:l,centerY:u,offset:c=20}=e,[f,v,p,S,y]=cd({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:l,y:u},offset:c});return[f.reduce((b,g,I)=>{let N;return I>0&&I<f.length-1?N=dd(f[I-1],g,f[I+1],s):N=`${I===0?"M":"L"}${g.x} ${g.y}`,b+=N,b},""),v,p,S,y]}function fd(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,a,s,l]=xr({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,a,s,l]}const hd=be({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]=fd(e);return _e(On,{path:n,labelX:o,labelY:i,...t,...e})}}}),gd=hd,vd=be({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,a;const[n,o,i]=so({...e,sourcePosition:(r=e.sourcePosition)!=null?r:te.Bottom,targetPosition:(a=e.targetPosition)!=null?a:te.Top});return _e(On,{path:n,labelX:o,labelY:i,...t,...e})}}}),kr=vd,pd=be({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>_e(kr,{...e,...t,borderRadius:0})}}),md=pd,yd=be({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,a;const[n,o,i]=Sr({...e,sourcePosition:(r=e.sourcePosition)!=null?r:te.Bottom,targetPosition:(a=e.targetPosition)!=null?a:te.Top});return _e(On,{path:n,labelX:o,labelY:i,...t,...e})}}}),_d=yd,wd=be({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,a;const[n,o,i]=Nr({...e,sourcePosition:(r=e.sourcePosition)!=null?r:te.Bottom,targetPosition:(a=e.targetPosition)!=null?a:te.Top});return _e(On,{path:n,labelX:o,labelY:i,...t,...e})}}}),bd=wd,xd={input:ed,default:Qc,output:Jc},Ed={default:_d,straight:gd,step:md,smoothstep:kr,simplebezier:bd};function Sd(e,t,n){const o=ae(()=>y=>t.value.get(y)),i=ae(()=>y=>n.value.get(y)),r=ae(()=>{const y={...Ed,...e.edgeTypes},w=Object.keys(y);for(const b of e.edges)b.type&&!w.includes(b.type)&&(y[b.type]=b.type);return y}),a=ae(()=>{const y={...xd,...e.nodeTypes},w=Object.keys(y);for(const b of e.nodes)b.type&&!w.includes(b.type)&&(y[b.type]=b.type);return y}),s=ae(()=>e.onlyRenderVisibleElements?lr(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=ae(()=>{if(e.onlyRenderVisibleElements){const y=[];for(const w of e.edges){const b=t.value.get(w.source),g=t.value.get(w.target);kc({sourcePos:b.computedPosition||{x:0,y:0},targetPos:g.computedPosition||{x:0,y:0},sourceWidth:b.dimensions.width,sourceHeight:b.dimensions.height,targetWidth:g.dimensions.width,targetHeight:g.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&y.push(w)}return y}return e.edges}),u=ae(()=>[...s.value,...l.value]),c=ae(()=>{const y=[];for(const w of e.nodes)w.selected&&y.push(w);return y}),f=ae(()=>{const y=[];for(const w of e.edges)w.selected&&y.push(w);return y}),v=ae(()=>[...c.value,...f.value]),p=ae(()=>{const y=[];for(const w of e.nodes)w.dimensions.width&&w.dimensions.height&&w.handleBounds!==void 0&&y.push(w);return y}),S=ae(()=>s.value.length>0&&p.value.length===s.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:a,getEdges:l,getNodes:s,getSelectedElements:v,getSelectedNodes:c,getSelectedEdges:f,getNodesInitialized:p,areNodesInitialized:S}}class dt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var i;var t;const n=(t=jt())==null?void 0:t.appContext.app,o=(i=n==null?void 0:n.config.globalProperties.$vueFlowStorage)!=null?i:dt.instance;return dt.instance=o!=null?o:new dt,n&&(n.config.globalProperties.$vueFlowStorage=dt.instance),dt.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=br(),i=Ar(o),r={};for(const[v,p]of Object.entries(i.hooks)){const S=`on${v.charAt(0).toUpperCase()+v.slice(1)}`;r[S]=p.on}const a={};for(const[v,p]of Object.entries(i.hooks))a[v]=p.trigger;const s=ae(()=>{const v=new Map;for(const p of i.nodes)v.set(p.id,p);return v}),l=ae(()=>{const v=new Map;for(const p of i.edges)v.set(p.id,p);return v}),u=Sd(i,s,l),c=Wc(i,s,l);c.setState({...i,...n});const f={...r,...u,...c,...Ma(i),nodeLookup:s,edgeLookup:l,emits:a,id:t,vueFlowVersion:"1.41.1",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function Ee(e){const t=dt.getInstance(),n=wi(),o=typeof e=="object",i=o?e:{id:e},r=i.id,a=r!=null?r:n==null?void 0:n.vueFlowId;let s;if(n){const l=zt(si,null);typeof l!="undefined"&&l!==null&&(!a||l.id===a)&&(s=l)}if(s||a&&(s=t.get(a)),!s||a&&s.id!==a){const l=r!=null?r:t.getId(),u=t.create(l,i);s=u,(n!=null?n:pi(!0)).run(()=>{ye(u.applyDefault,(f,v,p)=>{const S=w=>{u.applyNodeChanges(w)},y=w=>{u.applyEdgeChanges(w)};f?(u.onNodesChange(S),u.onEdgesChange(y)):(u.hooks.value.nodesChange.off(S),u.hooks.value.edgesChange.off(y)),p(()=>{u.hooks.value.nodesChange.off(S),u.hooks.value.edgesChange.off(y)})},{immediate:!0}),En(()=>{if(s){const f=t.get(s.id);f?f.$destroy():Cn(`No store instance found for id ${s.id} in storage.`)}})})}else o&&s.setState(i);if(n&&(Tt(si,s),n.vueFlowId=s.id),o){const l=jt();(l==null?void 0:l.type.name)!=="VueFlow"&&s.emits.error(new Ce(Me.USEVUEFLOW_OPTIONS))}return s}function Nd(e){const{emits:t,dimensions:n}=Ee();let o;Ze(()=>{const i=e.value,r=()=>{if(!i)return;const a=Mn(i);(a.width===0||a.height===0)&&t.error(new Ce(Me.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),_i(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const kd={name:"UserSelection",compatConfig:{MODE:3}},Id=be({...kd,props:{userSelectionRect:{}},setup(e){return(t,n)=>(ee(),ve("div",{class:"vue-flow__selection vue-flow__container",style:De({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),Md=["tabIndex"],Cd={name:"NodesSelection",compatConfig:{MODE:3}},Pd=be({...Cd,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=Ee(),s=wr(),l=ge(null),u=mr({el:l,onStart(S){t.selectionDragStart(S)},onDrag(S){t.selectionDrag(S)},onStop(S){t.selectionDragStop(S)}});Ze(()=>{var S;r.value||(S=l.value)==null||S.focus({preventScroll:!0})});const c=ae(()=>sr(o.value)),f=ae(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function v(S){t.selectionContextMenu({event:S,nodes:o.value})}function p(S){r||Pt[S.key]&&s({x:Pt[S.key].x,y:Pt[S.key].y},S.shiftKey)}return(S,y)=>!re(a)&&c.value.width&&c.value.height?(ee(),ve("div",{key:0,class:mt(["vue-flow__nodesselection vue-flow__container",re(i)]),style:De({transform:`translate(${re(n).x}px,${re(n).y}px) scale(${re(n).zoom})`})},[Pe("div",{ref_key:"el",ref:l,class:mt([{dragging:re(u)},"vue-flow__nodesselection-rect"]),style:De(f.value),tabIndex:re(r)?void 0:-1,onContextmenu:v,onKeydown:p},null,46,Md)],6)):Se("",!0)}});function Td(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Dd={name:"Pane",compatConfig:{MODE:3}},Ad=be({...Dd,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,panOnDrag:s,userSelectionRect:l,elementsSelectable:u,nodesSelectionActive:c,getSelectedEdges:f,getSelectedNodes:v,removeNodes:p,removeEdges:S,selectionMode:y,deleteKeyCode:w,multiSelectionKeyCode:b,multiSelectionActive:g,edgeLookup:I,nodeLookup:N}=Ee(),L=ge(null),G=ge(0),V=ge(0),q=ge(),K=ge(new Map),O=Ne(()=>u.value&&(e.isSelecting||r.value));let m=!1,j=!1;const le=Yt(w,{actInsideInputWithModifier:!1}),_=Yt(b);ye(le,Z=>{Z&&(p(v.value),S(f.value),c.value=!1)}),ye(_,Z=>{g.value=Z});function M(Z,R){return Q=>{Q.target===R&&(Z==null||Z(Q))}}function E(){r.value=!1,l.value=null,G.value=0,V.value=0}function T(Z){if(m){m=!1;return}i.paneClick(Z),a(),c.value=!1}function z(Z){var R;if(Array.isArray(s.value)&&((R=s.value)!=null&&R.includes(2))){Z.preventDefault();return}i.paneContextMenu(Z)}function H(Z){i.paneScroll(Z)}function Y(Z){var R,Q,de,ue,he;if(q.value=(R=t.value)==null?void 0:R.getBoundingClientRect(),!u.value||!e.isSelecting||Z.button!==0||Z.target!==L.value||!q.value)return;(de=(Q=Z.target)==null?void 0:Q.setPointerCapture)==null||de.call(Q,Z.pointerId);const{x:D,y:X}=Td(Z,q.value);j=!0,m=!1,K.value=new Map;for(const[P,$]of I.value)K.value.set($.source,((ue=K.value.get($.source))==null?void 0:ue.add(P))||new Set([P])),K.value.set($.target,((he=K.value.get($.target))==null?void 0:he.add(P))||new Set([P]));a(),l.value={width:0,height:0,startX:D,startY:X,x:D,y:X},i.selectionStart(Z)}function F(Z){if(!q.value||!l.value)return;m=!0;const{x:R,y:Q}=at(Z,q.value),{startX:de=0,startY:ue=0}=l.value,he={startX:de,startY:ue,x:R<de?R:de,y:Q<ue?Q:ue,width:Math.abs(R-de),height:Math.abs(Q-ue)},D=lr(n.value,he,o.value,y.value===yo.Partial,!0),X=new Set,P=new Set;for(const $ of D){P.add($.id);const A=K.value.get($.id);if(A)for(const d of A)X.add(d)}if(G.value!==P.size){G.value=P.size;const $=rt(N.value,P,!0);i.nodesChange($)}if(V.value!==X.size){V.value=X.size;const $=rt(I.value,X);i.edgesChange($)}l.value=he,r.value=!0,c.value=!1}function ie(Z){var R;Z.button!==0||!j||((R=Z.target)==null||R.releasePointerCapture(Z.pointerId),!r.value&&l.value&&Z.target===L.value&&T(Z),G.value>0&&(c.value=!0),E(),i.selectionEnd(Z),e.selectionKeyPressed&&(m=!1),j=!1)}return(Z,R)=>(ee(),ve("div",{ref_key:"container",ref:L,class:mt(["vue-flow__pane vue-flow__container",{selection:Z.isSelecting}]),onClick:R[0]||(R[0]=Q=>O.value?void 0:M(T,L.value)(Q)),onContextmenu:R[1]||(R[1]=Q=>M(z,L.value)(Q)),onWheelPassive:R[2]||(R[2]=Q=>M(H,L.value)(Q)),onPointerenter:R[3]||(R[3]=Q=>O.value?void 0:re(i).paneMouseEnter(Q)),onPointerdown:R[4]||(R[4]=Q=>O.value?Y(Q):re(i).paneMouseMove(Q)),onPointermove:R[5]||(R[5]=Q=>O.value?F(Q):re(i).paneMouseMove(Q)),onPointerup:R[6]||(R[6]=Q=>O.value?ie(Q):void 0),onPointerleave:R[7]||(R[7]=Q=>re(i).paneMouseLeave(Q))},[pt(Z.$slots,"default"),re(r)&&re(l)?(ee(),we(Id,{key:0,"user-selection-rect":re(l)},null,8,["user-selection-rect"])):Se("",!0),re(c)&&re(v).length?(ee(),we(Pd,{key:1})):Se("",!0)],34))}}),Od={name:"Transform",compatConfig:{MODE:3}},zd=be({...Od,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Ee(),i=ae(()=>n.value?!o.value:!1),r=ae(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(a,s)=>(ee(),ve("div",{class:"vue-flow__transformationpane vue-flow__container",style:De({transform:r.value,opacity:i.value?0:void 0})},[pt(a.$slots,"default")],4))}}),$d={name:"Viewport",compatConfig:{MODE:3}},Hd=be({...$d,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:s,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:f,zoomOnDoubleClick:v,zoomOnPinch:p,zoomOnScroll:S,preventScrolling:y,noWheelClassName:w,noPanClassName:b,emits:g,connectionStartHandle:I,userSelectionActive:N,paneDragging:L,d3Zoom:G,d3Selection:V,d3ZoomHandler:q,viewport:K,viewportRef:O,paneClickDistance:m}=Ee();Nd(O);const j=ge(!1),le=ge(!1);let _=null,M=!1,E=0,T={x:0,y:0,zoom:0};const z=Yt(s),H=Yt(a),Y=Yt(r),F=Ne(()=>!H.value&&(z.value||f.value)),ie=Ne(()=>z.value||l.value),Z=Ne(()=>H.value||a.value===!0&&F.value!==!0);Ze(()=>{var C,B,ne;if(!O.value){Cn("Viewport element is missing");return}const D=O.value,X=D.getBoundingClientRect(),P=uc().clickDistance(m.value).scaleExtent([t.value,n.value]).translateExtent(i.value),$=He(D).call(P),A=$.on("wheel.zoom"),d=Ot.translate((C=o.value.x)!=null?C:0,(B=o.value.y)!=null?B:0).scale(wt((ne=o.value.zoom)!=null?ne:1,t.value,n.value)),h=[[0,0],[X.width,X.height]],x=P.constrain()(d,h,i.value);P.transform($,x),P.wheelDelta(Q),G.value=P,V.value=$,q.value=A,K.value={x:x.x,y:x.y,zoom:x.k},P.on("start",k=>{var W;if(!k.sourceEvent)return null;E=k.sourceEvent.button,j.value=!0;const se=ue(k.transform);((W=k.sourceEvent)==null?void 0:W.type)==="mousedown"&&(L.value=!0),T=se,g.viewportChangeStart(se),g.moveStart({event:k,flowTransform:se})}),P.on("end",k=>{if(!k.sourceEvent)return null;if(j.value=!1,L.value=!1,R(F.value,E!=null?E:0)&&!M&&g.paneContextMenu(k.sourceEvent),M=!1,de(T,k.transform)){const W=ue(k.transform);T=W,g.viewportChangeEnd(W),g.moveEnd({event:k,flowTransform:W})}}),P.filter(k=>{var W,se,fe;const ce=Y.value||S.value,me=p.value&&k.ctrlKey,$e=k.button;if((F.value===!0||Array.isArray(F.value)&&F.value.includes(1))&&$e===1&&k.type==="mousedown"&&((W=k.target)!=null&&W.closest(".vue-flow__node")||(se=k.target)!=null&&se.closest(".vue-flow__edge")))return!0;if(!F.value&&!ce&&!ie.value&&!v.value&&!p.value||N.value||!v.value&&k.type==="dblclick"||he(k,w.value)&&k.type==="wheel"||he(k,b.value)&&(k.type!=="wheel"||ie.value&&k.type==="wheel"&&!Y.value)||!p.value&&k.ctrlKey&&k.type==="wheel"||!ce&&!ie.value&&!me&&k.type==="wheel")return!1;if(!p&&k.type==="touchstart"&&((fe=k.touches)==null?void 0:fe.length)>1)return k.preventDefault(),!1;if(!F.value&&(k.type==="mousedown"||k.type==="touchstart")||Array.isArray(F.value)&&!F.value.includes($e)&&(k.type==="mousedown"||k.type==="touchstart"))return!1;const tt=Array.isArray(F.value)&&F.value.includes($e)||!$e||$e<=1;return(!k.ctrlKey||k.type==="wheel")&&tt}),ye([N,F],()=>{N.value&&!j.value?P.on("zoom",null):N.value||P.on("zoom",k=>{K.value={x:k.transform.x,y:k.transform.y,zoom:k.transform.k};const W=ue(k.transform);M=R(F.value,E!=null?E:0),g.viewportChange(W),g.move({event:k,flowTransform:W})})},{immediate:!0}),ye([N,ie,u,Y,p,y,w],()=>{ie.value&&!Y.value&&!N.value?$.on("wheel.zoom",k=>{if(he(k,w.value))return!1;const W=Y.value||S.value,se=p.value&&k.ctrlKey;if(!(!y.value||ie.value||W||se))return!1;k.preventDefault(),k.stopImmediatePropagation();const ce=$.property("__zoom").k||1,me=xn();if(k.ctrlKey&&p.value&&me){const Ir=Ge(k),Mr=Q(k),Cr=ce*2**Mr;P.scaleTo($,Cr,Ir,k);return}const $e=k.deltaMode===1?20:1;let tt=u.value===Ft.Vertical?0:k.deltaX*$e,lt=u.value===Ft.Horizontal?0:k.deltaY*$e;!me&&k.shiftKey&&u.value!==Ft.Vertical&&!tt&&lt&&(tt=lt,lt=0),P.translateBy($,-(tt/ce)*c.value,-(lt/ce)*c.value);const Ve=ue($.property("__zoom"));_&&clearTimeout(_),le.value?(g.move({event:k,flowTransform:Ve}),g.viewportChange(Ve),_=setTimeout(()=>{g.moveEnd({event:k,flowTransform:Ve}),g.viewportChangeEnd(Ve),le.value=!1},150)):(le.value=!0,g.moveStart({event:k,flowTransform:Ve}),g.viewportChangeStart(Ve))},{passive:!1}):typeof A!="undefined"&&$.on("wheel.zoom",function(k,W){const se=!y.value&&k.type==="wheel"&&!k.ctrlKey,fe=Y.value||S.value,ce=p.value&&k.ctrlKey;if(!fe&&!l.value&&!ce&&k.type==="wheel"||se||he(k,w.value))return null;k.preventDefault(),A.call(this,k,W)},{passive:!1})},{immediate:!0})});function R(D,X){return X===2&&Array.isArray(D)&&D.includes(2)}function Q(D){const X=D.ctrlKey&&xn()?10:1;return-D.deltaY*(D.deltaMode===1?.05:D.deltaMode?1:.002)*X}function de(D,X){return D.x!==X.x&&!Number.isNaN(X.x)||D.y!==X.y&&!Number.isNaN(X.y)||D.zoom!==X.k&&!Number.isNaN(X.k)}function ue(D){return{x:D.x,y:D.y,zoom:D.k}}function he(D,X){return D.target.closest(`.${X}`)}return(D,X)=>(ee(),ve("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[J(Ad,{"is-selecting":Z.value,"selection-key-pressed":re(H),class:mt({connecting:!!re(I),dragging:re(L),draggable:re(f)===!0||Array.isArray(re(f))&&re(f).includes(0)})},{default:oe(()=>[J(zd,null,{default:oe(()=>[pt(D.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Bd=["id"],Rd=["id"],Vd=["id"],Ld={name:"A11yDescriptions",compatConfig:{MODE:3}},Fd=be({...Ld,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Ee();return(i,r)=>(ee(),ve(ze,null,[Pe("div",{id:`${re(Qi)}-${re(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+xe(re(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,Bd),Pe("div",{id:`${re(Ji)}-${re(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,Rd),re(n)?Se("",!0):(ee(),ve("div",{key:0,id:`${re(hc)}-${re(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%)"}},xe(re(o)),9,Vd))],64))}});function Yd(){const e=Ee();ye(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Gd(e,t,n){return n===te.Left?e-t:n===te.Right?e+t:e}function Xd(e,t,n){return n===te.Top?e-t:n===te.Bottom?e+t:e}const xo=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=te.Top,type:i}){return _e("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Gd(t,e,o),cy:Xd(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};xo.props=["radius","centerX","centerY","position","type"];xo.compatConfig={MODE:3};const fi=xo,Ud=be({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:s,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:f,isValidConnection:v,multiSelectionActive:p,disableKeyboardA11y:S,elementsSelectable:y,edgesUpdatable:w,edgesFocusable:b}=Ee(),g=ae(()=>c(e.id)),I=Bc(g.value,r),N=zt(Pn),L=jt(),G=ge(!1),V=ge(!1),q=ge(""),K=ge(null),O=ge("source"),m=ge(null),j=Ne(()=>typeof g.value.selectable=="undefined"?y.value:g.value.selectable),le=Ne(()=>typeof g.value.updatable=="undefined"?w.value:g.value.updatable),_=Ne(()=>typeof g.value.focusable=="undefined"?b.value:g.value.focusable);Tt(zc,e.id),Tt($c,m);const M=ae(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),E=ae(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),T=ae(()=>{var x;const A=g.value.type||"default",d=N==null?void 0:N[`edge-${A}`];if(d)return d;let h=(x=g.value.template)!=null?x:l.value[A];if(typeof h=="string"&&L){const C=Object.keys(L.appContext.components);C&&C.includes(A)&&(h=bi(A,!1))}return h&&typeof h!="string"?h:(r.error(new Ce(Me.EDGE_TYPE_MISSING,h)),!1)}),{handlePointerDown:z}=yr({nodeId:q,handleId:K,type:O,isValidConnection:v,edgeUpdaterType:O,onEdgeUpdate:F,onEdgeUpdateEnd:ie});return()=>{const A=f(g.value.source),d=f(g.value.target),h="pathOptions"in g.value?g.value.pathOptions:{};if(!A&&!d)return r.error(new Ce(Me.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!A)return r.error(new Ce(Me.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!d)return r.error(new Ce(Me.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||A.hidden||d.hidden)return null;let x;o.value===_t.Strict?x=A.handleBounds.source:x=[...A.handleBounds.source||[],...A.handleBounds.target||[]];const C=Jo(x,g.value.sourceHandle);let B;o.value===_t.Strict?B=d.handleBounds.target:B=[...d.handleBounds.target||[],...d.handleBounds.source||[]];const ne=Jo(B,g.value.targetHandle),k=(C==null?void 0:C.position)||te.Bottom,W=(ne==null?void 0:ne.position)||te.Top,{x:se,y:fe}=bn(A,C,k),{x:ce,y:me}=bn(d,ne,W);return g.value.sourceX=se,g.value.sourceY=fe,g.value.targetX=ce,g.value.targetY=me,_e("g",{ref:m,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${T.value===!1?"default":g.value.type||"default"}`,s.value,M.value,{updating:G.value,selected:g.value.selected,animated:g.value.animated,inactive:!j.value}],onClick:R,onContextmenu:Q,onDblclick:de,onMouseenter:ue,onMousemove:he,onMouseleave:D,onKeyDown:_.value?$:void 0,tabIndex:_.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":_.value?`${Ji}-${t}`:void 0,role:_.value?"button":"img"},[V.value?null:_e(T.value===!1?l.value.default:T.value,{id:e.id,sourceNode:A,targetNode:d,source:g.value.source,target:g.value.target,type:g.value.type,updatable:le.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('#${Wt(g.value.markerStart,t)}')`,markerEnd:`url('#${Wt(g.value.markerEnd,t)}')`,sourcePosition:k,targetPosition:W,sourceX:se,sourceY:fe,targetX:ce,targetY:me,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...h}),[le.value==="source"||le.value===!0?[_e("g",{onMousedown:X,onMouseenter:H,onMouseout:Y},_e(fi,{position:k,centerX:se,centerY:fe,radius:i.value,type:"source","data-type":"source"}))]:null,le.value==="target"||le.value===!0?[_e("g",{onMousedown:P,onMouseenter:H,onMouseout:Y},_e(fi,{position:W,centerX:ce,centerY:me,radius:i.value,type:"target","data-type":"target"}))]:null]])};function H(){G.value=!0}function Y(){G.value=!1}function F(A,d){I.emit.update({event:A,edge:g.value,connection:d})}function ie(A){I.emit.updateEnd({event:A,edge:g.value}),V.value=!1}function Z(A,d){var h;A.button===0&&(V.value=!0,q.value=d?g.value.target:g.value.source,K.value=(h=d?g.value.targetHandle:g.value.sourceHandle)!=null?h:"",O.value=d?"target":"source",I.emit.updateStart({event:A,edge:g.value}),z(A))}function R(A){var d;const h={event:A,edge:g.value};j.value&&(a.value=!1,g.value.selected&&p.value?(u([g.value]),(d=m.value)==null||d.blur()):n([g.value])),I.emit.click(h)}function Q(A){I.emit.contextMenu({event:A,edge:g.value})}function de(A){I.emit.doubleClick({event:A,edge:g.value})}function ue(A){I.emit.mouseEnter({event:A,edge:g.value})}function he(A){I.emit.mouseMove({event:A,edge:g.value})}function D(A){I.emit.mouseLeave({event:A,edge:g.value})}function X(A){Z(A,!0)}function P(A){Z(A,!1)}function $(A){var d;!S.value&&er.includes(A.key)&&j.value&&(A.key==="Escape"?((d=m.value)==null||d.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Zd=Ud,qd={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},Wd=be({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:s,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:f}=Ee(),v=(e=zt(Pn))==null?void 0:e["connection-line"],p=ae(()=>{var g;return f((g=o.value)==null?void 0:g.nodeId)}),S=ae(()=>{var I;var g;return(I=f((g=i.value)==null?void 0:g.nodeId))!=null?I:null}),y=ae(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),w=ae(()=>l.value.markerStart?`url(#${Wt(l.value.markerStart,t)})`:""),b=ae(()=>l.value.markerEnd?`url(#${Wt(l.value.markerEnd,t)})`:"");return()=>{var H,Y,F,ie;var g,I,N,L;if(!p.value||!o.value)return null;const G=o.value.handleId,V=o.value.type,q=p.value.handleBounds;let K=q==null?void 0:q[V];if(n.value===_t.Loose&&(K=K||(q==null?void 0:q[V==="source"?"target":"source"])),!K)return null;const O=(H=G?K.find(Z=>Z.id===G):K[0])!=null?H:null,m=(O==null?void 0:O.position)||te.Top,{x:j,y:le}=bn(p.value,O,m);let _=null;S.value&&((g=i.value)!=null&&g.handleId)&&(n.value===_t.Strict?_=((I=S.value.handleBounds[V==="source"?"target":"source"])==null?void 0:I.find(Z=>{var R;return Z.id===((R=i.value)==null?void 0:R.handleId)}))||null:_=((N=[...S.value.handleBounds.source||[],...S.value.handleBounds.target||[]])==null?void 0:N.find(Z=>{var R;return Z.id===((R=i.value)==null?void 0:R.handleId)}))||null);const M=(Y=(L=i.value)==null?void 0:L.position)!=null?Y:m?qd[m]:null;if(!m||!M)return null;const E=(ie=(F=a.value)!=null?F:l.value.type)!=null?ie:ct.Bezier;let T="";const z={sourceX:j,sourceY:le,sourcePosition:m,targetX:y.value.x,targetY:y.value.y,targetPosition:M};return E===ct.Bezier?[T]=Sr(z):E===ct.Step?[T]=so({...z,borderRadius:0}):E===ct.SmoothStep?[T]=so(z):E===ct.SimpleBezier?[T]=Nr(z):T=`M${j},${le} ${y.value.x},${y.value.y}`,_e("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},_e("g",{class:"vue-flow__connection"},v?_e(v,{sourceX:j,sourceY:le,sourcePosition:m,targetX:y.value.x,targetY:y.value.y,targetPosition:M,sourceNode:p.value,sourceHandle:O,targetNode:S.value,targetHandle:_,markerEnd:b.value,markerStart:w.value,connectionStatus:u.value}):_e("path",{d:T,class:[l.value.class,u,"vue-flow__connection-path"],style:{...s.value,...l.value.style},"marker-end":b.value,"marker-start":w.value})))}}}),Kd=Wd,jd=["id","markerWidth","markerHeight","markerUnits","orient"],Qd={name:"MarkerType",compatConfig:{MODE:3}},Jd=be({...Qd,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)=>(ee(),ve("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===re(no).ArrowClosed?(ee(),ve("polyline",{key:0,style:De({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Se("",!0),t.type===re(no).Arrow?(ee(),ve("polyline",{key:1,style:De({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Se("",!0)],8,jd))}}),ef={class:"vue-flow__marker vue-flow__container"},tf={name:"MarkerDefinitions",compatConfig:{MODE:3}},nf=be({...tf,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=Ee(),r=ae(()=>{const a=new Set,s=[],l=u=>{if(u){const c=Wt(u,t);a.has(c)||(typeof u=="object"?s.push({...u,id:c,color:u.color||i.value}):s.push({id:c,color:i.value,type:u}),a.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 s.sort((u,c)=>u.id.localeCompare(c.id))});return(a,s)=>(ee(),ve("svg",ef,[Pe("defs",null,[(ee(!0),ve(ze,null,vt(r.value,l=>(ee(),we(Jd,{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))])]))}}),of={name:"Edges",compatConfig:{MODE:3}},rf=be({...of,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Ee();return(i,r)=>(ee(),ve(ze,null,[J(nf),(ee(!0),ve(ze,null,vt(re(n),a=>(ee(),ve("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:De({zIndex:re(Ic)(a,re(t),re(o))})},[J(re(Zd),{id:a.id},null,8,["id"])],4))),128)),J(re(Kd))],64))}}),af=be({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:s,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:f,nodeExtent:v,elevateNodesOnSelect:p,disableKeyboardA11y:S,ariaLiveMessage:y,snapToGrid:w,snapGrid:b,nodeDragThreshold:g,nodesDraggable:I,elementsSelectable:N,nodesConnectable:L,nodesFocusable:G}=Ee(),V=ge(null);Tt(pr,V),Tt(vr,e.id);const q=zt(Pn),K=jt(),O=wr(),{node:m,parentNode:j}=_r(e.id),le=Ne(()=>typeof m.draggable=="undefined"?I.value:m.draggable),_=Ne(()=>typeof m.selectable=="undefined"?N.value:m.selectable),M=Ne(()=>typeof m.connectable=="undefined"?L.value:m.connectable),E=Ne(()=>typeof m.focusable=="undefined"?G.value:m.focusable),T=Ne(()=>!!m.dimensions.width&&!!m.dimensions.height),z=ae(()=>{const d=m.type||"default",h=q==null?void 0:q[`node-${d}`];if(h)return h;let x=m.template||f.value[d];if(typeof x=="string"&&K){const C=Object.keys(K.appContext.components);C&&C.includes(d)&&(x=bi(d,!1))}return x&&typeof x!="string"?x:(a.error(new Ce(Me.NODE_TYPE_MISSING,x)),!1)}),{emit:H,on:Y}=Fc(m,a),F=mr({id:e.id,el:V,disabled:()=>!le.value,selectable:_,dragHandle:()=>m.dragHandle,onStart(d){H.dragStart(d)},onDrag(d){H.drag(d)},onStop(d){H.dragStop(d)},onClick(d){$(d)}}),ie=ae(()=>m.class instanceof Function?m.class(m):m.class),Z=ae(()=>{const d=(m.style instanceof Function?m.style(m):m.style)||{},h=m.width instanceof Function?m.width(m):m.width,x=m.height instanceof Function?m.height(m):m.height;return!d.width&&h&&(d.width=typeof h=="string"?h:`${h}px`),!d.height&&x&&(d.height=typeof x=="string"?x:`${x}px`),d}),R=Ne(()=>{var d,h;return Number((h=(d=m.zIndex)!=null?d:Z.value.zIndex)!=null?h:0)});return c(d=>{(d.includes(e.id)||!d.length)&&de()}),Ze(()=>{ye(()=>m.hidden,(d=!1,h,x)=>{!d&&V.value&&(e.resizeObserver.observe(V.value),x(()=>{V.value&&e.resizeObserver.unobserve(V.value)}))},{immediate:!0,flush:"post"})}),ye([()=>m.type,()=>m.sourcePosition,()=>m.targetPosition],()=>{Xe(()=>{u([{id:e.id,nodeElement:V.value,forceUpdate:!0}])})}),ye([()=>m.position.x,()=>m.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},R,()=>m.selected,()=>m.dimensions.height,()=>m.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,h,x,C,B,ne])=>{const k={x:d,y:h,z:ne+(p.value&&m.selected?1e3:0)};typeof x!="undefined"&&typeof C!="undefined"?m.computedPosition=bc({x,y:C,z:B},k):m.computedPosition=k},{flush:"post",immediate:!0}),ye([()=>m.extent,v],([d,h],[x,C])=>{(d!==x||h!==C)&&Q()}),m.extent==="parent"||typeof m.extent=="object"&&"range"in m.extent&&m.extent.range==="parent"?Zn(()=>T).toBe(!0).then(Q):Q(),()=>{var d,h;return m.hidden?null:_e("div",{ref:V,"data-id":m.id,class:["vue-flow__node",`vue-flow__node-${z.value===!1?"default":m.type||"default"}`,{[n.value]:le.value,dragging:F==null?void 0:F.value,draggable:le.value,selected:m.selected,selectable:_.value,parent:m.isParent},ie.value],style:{visibility:T.value?"visible":"hidden",zIndex:(d=m.computedPosition.z)!=null?d:R.value,transform:`translate(${m.computedPosition.x}px,${m.computedPosition.y}px)`,pointerEvents:_.value||le.value?"all":"none",...Z.value},tabIndex:E.value?0:void 0,role:E.value?"button":void 0,"aria-describedby":S.value?void 0:`${Qi}-${t}`,"aria-label":m.ariaLabel,onMouseenter:ue,onMousemove:he,onMouseleave:D,onContextmenu:X,onClick:$,onDblclick:P,onKeydown:A},[_e(z.value===!1?f.value.default:z.value,{id:m.id,type:m.type,data:m.data,events:{...m.events,...Y},selected:m.selected,resizing:m.resizing,dragging:F.value,connectable:M.value,position:m.computedPosition,dimensions:m.dimensions,isValidTargetPos:m.isValidTargetPos,isValidSourcePos:m.isValidSourcePos,parent:m.parentNode,parentNodeId:m.parentNode,zIndex:(h=m.computedPosition.z)!=null?h:R.value,targetPosition:m.targetPosition,sourcePosition:m.sourcePosition,label:m.label,dragHandle:m.dragHandle,onUpdateNodeInternals:de})])};function Q(){const d=m.computedPosition;w.value&&(d.x=b.value[0]*Math.round(d.x/b.value[0]),d.y=b.value[1]*Math.round(d.y/b.value[1]));const{computedPosition:h,position:x}=_o(m,d,a.error,v.value,j.value);(m.computedPosition.x!==h.x||m.computedPosition.y!==h.y)&&(m.computedPosition={...m.computedPosition,...h}),(m.position.x!==x.x||m.position.y!==x.y)&&(m.position=x)}function de(){V.value&&u([{id:e.id,nodeElement:V.value,forceUpdate:!0}])}function ue(d){F!=null&&F.value||H.mouseEnter({event:d,node:m})}function he(d){F!=null&&F.value||H.mouseMove({event:d,node:m})}function D(d){F!=null&&F.value||H.mouseLeave({event:d,node:m})}function X(d){return H.contextMenu({event:d,node:m})}function P(d){return H.doubleClick({event:d,node:m})}function $(d){_.value&&(!o.value||!le.value||g.value>0)&&ao(m,r.value,l,s,i,!1,V.value),H.click({event:d,node:m})}function A(d){if(!(oo(d)||S.value))if(er.includes(d.key)&&_.value){const h=d.key==="Escape";ao(m,r.value,l,s,i,h,V.value)}else le.value&&m.selected&&Pt[d.key]&&(y.value=`Moved selected node ${d.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~m.position.x}, y: ${~~m.position.y}`,O({x:Pt[d.key].x,y:Pt[d.key].y},d.shiftKey))}}}),sf=af;function lf(e={includeHiddenNodes:!1}){const{nodes:t}=Ee();return ae(()=>{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 uf={class:"vue-flow__nodes vue-flow__container"},cf={name:"Nodes",compatConfig:{MODE:3}},df=be({...cf,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Ee(),i=lf(),r=ge();return ye(i,a=>{a&&Xe(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Ze(()=>{r.value=new ResizeObserver(a=>{const s=a.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Xe(()=>n(s))})}),_i(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,s)=>(ee(),ve("div",uf,[r.value?(ee(!0),ve(ze,{key:0},vt(re(t),(l,u,c,f)=>{const v=[l.id];if(f&&f.key===l.id&&Hr(f,v))return f;const p=(ee(),we(re(sf),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=v,p},s,0),128)):Se("",!0)]))}});function ff(){const{emits:e}=Ee();Ze(()=>{if(gr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ce(Me.MISSING_STYLES))}})}const hf=Pe("div",{class:"vue-flow__edge-labels"},null,-1),gf={name:"VueFlow",compatConfig:{MODE:3}},vf=be({...gf,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:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Or(),r=$n(o,"modelValue",n),a=$n(o,"nodes",n),s=$n(o,"edges",n),l=Ee(o),u=Xc({modelValue:r,nodes:a,edges:s},o,l);return Zc(n,l.hooks),Yd(),ff(),Tt(Pn,i),lo(()=>{u()}),t(l),(c,f)=>(ee(),ve("div",{ref:re(l).vueFlowRef,class:"vue-flow"},[J(Hd,null,{default:oe(()=>[J(rf),hf,J(df),pt(c.$slots,"zoom-pane")]),_:3}),pt(c.$slots,"default"),J(Fd)],512))}}),Nt=["jina-embeddings-v2-base-en","jina-colbert-v2","jina-clip-v1","jina-reranker-v2-base-multilingual","jina-embeddings-v3","reader-lm-1.5b"],pf=["jina-embedding-b-en-v1","reader-lm-1.5b","reader-lm-0.5b"],hi=[{id:"E1-2",source:"jina-embedding-b-en-v1",target:"jina-embeddings-v2-base-en",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-3",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-zh",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-4",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-de",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-5",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-code",sourceHandle:"source-right",targetHandle:"target-left",markerEnd:"arrow",type:"smoothstep",style:"stroke: #323838"},{id:"E2-6",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-es",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-7",source:"jina-embeddings-v2-base-en",target:"jina-colbert-v1-en",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-9",source:"jina-embeddings-v2-base-en",target:"jina-clip-v1",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E7-8",source:"jina-colbert-v1-en",target:"jina-colbert-v2",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-11",source:"jina-reranker-v1-base-en",target:"jina-reranker-v1-tiny-en",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-12",source:"jina-reranker-v1-base-en",target:"jina-reranker-v1-turbo-en",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-13",source:"jina-reranker-v1-base-en",target:"jina-reranker-v2-base-multilingual",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-14",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v3",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E15-16",source:"reader-lm-1.5b",target:"reader-lm-0.5b",sourceHandle:"source-top",targetHandle:"target-bottom",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"}],mf=[{id:"E1-2",source:"jina-embedding-b-en-v1",target:"jina-embeddings-v2-base-en",sourceHandle:"source-left",targetHandle:"target-bottom",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-3",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-zh",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-4",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-de",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-5",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-code",sourceHandle:"source-right",targetHandle:"target-left",markerEnd:"arrow",type:"smoothstep",style:"stroke: #323838"},{id:"E2-6",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v2-base-es",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-7",source:"jina-embeddings-v2-base-en",target:"jina-colbert-v1-en",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-9",source:"jina-embeddings-v2-base-en",target:"jina-clip-v1",sourceHandle:"source-top",targetHandle:"target-bottom",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E7-8",source:"jina-colbert-v1-en",target:"jina-colbert-v2",sourceHandle:"source-left",targetHandle:"target-right",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-11",source:"jina-reranker-v1-base-en",target:"jina-reranker-v1-tiny-en",sourceHandle:"source-right",targetHandle:"target-right",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-12",source:"jina-reranker-v1-base-en",target:"jina-reranker-v1-turbo-en",sourceHandle:"source-right",targetHandle:"target-right",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E10-13",source:"jina-reranker-v1-base-en",target:"jina-reranker-v2-base-multilingual",sourceHandle:"source-left",targetHandle:"target-right",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E2-14",source:"jina-embeddings-v2-base-en",target:"jina-embeddings-v3",sourceHandle:"source-top",targetHandle:"target-bottom",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"},{id:"E15-16",source:"reader-lm-1.5b",target:"reader-lm-0.5b",sourceHandle:"source-right",targetHandle:"target-left",type:"smoothstep",markerEnd:"arrow",style:"stroke: #323838"}],Ke=100,kt=340,je=36,Bt=50,yf=be({__name:"EmbeddingGraph",setup(e,{expose:t}){t();const n=Yr(),o=ta(),{allModels:i}=zn(o),r=na(),{searchImmediate:a}=zn(r),s=Fr(),{settings:l}=zn(s),u=ge(!1),{t:c}=vi({useScope:"global"}),{onNodesInitialized:f,onNodeMouseEnter:v,onNodeMouseLeave:p,onEdgeMouseEnter:S,onEdgeMouseLeave:y,onNodeClick:w,getNodes:b,getEdges:g}=Ee(),I=ge(),N=ge([]),L=ge(hi),G=ge(null),V=ge(""),q=ae(()=>n.screen.lt.md),K=ae(()=>sa(i.value,["release_date"],["asc"])),O=ae(()=>{const D=Object.keys(I.value||{});return q.value?D.reverse():D}),m=ae(()=>V.value?b.value.filter(D=>D.id.toLowerCase().includes(V.value.toLowerCase())):[]),j=ae(()=>V.value||G.value),le=D=>{var X;return!j.value||m.value.some(P=>P.id===D)||((X=G.value)==null?void 0:X.name)===D},_=()=>{if(G.value=null,!V.value){E();return}M(m.value,"node"),m.value.length&&Xe(()=>{var P,$;const D=R(($=(P=m.value[m.value.length-1])==null?void 0:P.data)==null?void 0:$.release_date),X=document.getElementById(`${D}`);X&&X.scrollIntoView({behavior:"smooth",block:"start"})})},M=(D,X)=>{X==="node"?(b.value.forEach(P=>{D.some($=>$.id===P.id||$.id===P.id)?P.style={opacity:1,border:"1px solid #787d7d"}:P.style={opacity:.3}}),g.value.forEach(P=>{var A;const $=(A=document.querySelector(`.vue-flow__edge[data-id="${P.id}"]`))==null?void 0:A.parentElement;D.some(d=>d.id===P.source||d.id===P.target)?(P.style={stroke:"#929595"},$==null||$.setAttribute("style","z-index: 100"),P.sourceNode.style={opacity:1,border:"1px solid #787d7d"},P.targetNode.style={opacity:1,border:"1px solid #787d7d"}):$==null||$.setAttribute("style","z-index: 0")})):X==="edge"&&(g.value.forEach(P=>{var A;const $=(A=document.querySelector(`.vue-flow__edge[data-id="${P.id}"]`))==null?void 0:A.parentElement;D.some(d=>d.id===P.id||d.id===P.id)?(P.style={stroke:"#929595"},$==null||$.setAttribute("style","z-index: 100")):$==null||$.setAttribute("style","z-index: 0")}),b.value.forEach(P=>{D.some($=>$.source===P.id||$.target===P.id)?P.style={opacity:1}:P.style={opacity:.3}}))},E=()=>{b.value.forEach(D=>{D.style={opacity:1}}),g.value.forEach(D=>{var P;const X=(P=document.querySelector(`.vue-flow__edge[data-id="${D.id}"]`))==null?void 0:P.parentElement;D.style={opacity:1,stroke:"#323838"},X==null||X.setAttribute("style","z-index: 0")})},T=async D=>{document.querySelector("header.q-header--hidden")&&window.scrollBy(0,-10),a.value=!0,l.value.lastQuestion=D,l.value.showSearchBar=!0},z=D=>D.split("-").slice(0,3).join(" "),H=()=>{G.value=null,j.value||E()},Y=ge({}),F=ae(()=>{const D=Object.keys(I.value||{});let X=0;if(q.value)return D.forEach($=>{var x,C,B,ne;const A=(C=(x=I.value)==null?void 0:x[$])==null?void 0:C.filter(k=>Nt.includes(k.name)),d=(ne=(B=I.value)==null?void 0:B[$])==null?void 0:ne.filter(k=>!Nt.includes(k.name)),h=Math.max((A==null?void 0:A.length)||0,(d==null?void 0:d.length)||0);ua(Y.value,$,`${h}fr`),h>1&&(X+=h-1)}),{height:`${D.length*(Ke+je*2)+X*(Ke+je)}px`,width:kt*2+200+"px"};const P=Math.max(...D.map($=>{var A,d;return((d=(A=I.value)==null?void 0:A[$])==null?void 0:d.length)||0}));return{width:`${D.length*(kt+Bt)}px`,height:P*(Ke+je)+160+"px"}}),ie=ae(()=>({"grid-template-columns":q.value?"1fr":`repeat(auto-fill, ${kt+Bt}px)`,"grid-template-rows":q.value?Object.values(Y.value).reverse().join(" "):"unset"})),Z=ae(()=>({minHeight:q.value?`${Ke+je*2}px`:"unset"})),R=D=>{const X=new Date(D).getFullYear(),P=new Date(D).getMonth()+1;return`${X}Q${Math.ceil(P/3)}`},Q=(D,X)=>{var ne,k;const P=R(D.release_date),$=q.value?Object.keys(I.value||{}).reverse():Object.keys(I.value||{}),A=$.indexOf(P),d=[],h=[];(k=(ne=I.value)==null?void 0:ne[P])==null||k.forEach(W=>{Nt.includes(W.name)?d.unshift(W):h.unshift(W)});let x=0;q.value?X?x=d.findIndex(W=>W.name===D.name):x=h.findIndex(W=>W.name===D.name):x=d.concat(h).findIndex(W=>W.name===D.name),x===-1&&(x=0);const C=$.slice(0,A);let B=0;return C.forEach(W=>{var me,$e,tt,lt;const se=($e=(me=I.value)==null?void 0:me[W])==null?void 0:$e.filter(Ve=>Nt.includes(Ve.name)),fe=(lt=(tt=I.value)==null?void 0:tt[W])==null?void 0:lt.filter(Ve=>!Nt.includes(Ve.name)),ce=Math.max((se==null?void 0:se.length)||0,(fe==null?void 0:fe.length)||0);B+=ce-1}),q.value?{x:X?100:100+kt+Bt,y:(Ke+je)*(x+B)+(Ke+je*2)*A+je}:{x:25+A*(kt+Bt),y:parseInt(F.value.height)-(100+Ke)-x*(Ke+je)}},de=async()=>{var D;u.value=!0,(D=i.value)!=null&&D.length||await o.getModels(),I.value={},K.value.forEach(X=>{var $;const P=R(X.release_date);($=I.value)!=null&&$[P]?I.value[P].push(X):I.value={...I.value,[P]:[X]}}),N.value=K.value.map(X=>{const P=Nt.includes(X.name);return{id:X.name,data:{...X,isFrontier:P},position:Q(X,P),type:"custom",class:`node ${P?"is-frontier":"is-variant"}`}}),u.value=!1},ue=async()=>{L.value=q.value?mf:hi,await de()};ye(q,()=>{ue()}),mi(()=>{ue()}),f(()=>{const D=document.querySelector(".models-graph-wrapper");D&&!q.value&&(D.scrollLeft=parseInt(F.value.width))}),w(D=>{V.value?m.value.some(X=>X.id===D.node.id)?G.value=D.node.data:(D.event.stopImmediatePropagation(),D.event.preventDefault()):(M([D.node],"node"),G.value=D.node.data)}),v(D=>{j.value||M([D.node],"node")}),p(()=>{j.value||E()}),S(D=>{j.value||M([D.edge],"edge")}),y(()=>{j.value||E()});const he={$q:n,embeddingStore:o,allModels:i,searchStore:r,searchImmediate:a,userStore:s,settings:l,isModelsLoading:u,t:c,onNodesInitialized:f,onNodeMouseEnter:v,onNodeMouseLeave:p,onEdgeMouseEnter:S,onEdgeMouseLeave:y,onNodeClick:w,getNodes:b,getEdges:g,NODE_HEIGHT:Ke,NODE_WIDTH:kt,OFFSET_Y:je,OFFSET_X:Bt,modelsByQuarter:I,modelNodes:N,edges:L,activeModel:G,query:V,vertical:q,sortedModels:K,quarters:O,filteredNodes:m,isHighlighting:j,isNodeHoverable:le,onFilter:_,highlightElements:M,removeHighlight:E,onSearch:T,getDefaultQuery:z,beforeHideDetails:H,verticalRows:Y,containerStyle:F,timelineStyle:ie,quarterStyle:Z,getQuarter:R,getPosition:Q,getModels:de,initialize:ue,get date(){return Qr},get VueFlow(){return vf},get Position(){return te},get Handle(){return Kt},get langcode2emojis(){return Jr},get ccncOptions(){return Gr},get cloudPartners(){return Xr},get MODELS_WITHOUT_API(){return pf},get embeddingIcon(){return Ur},get rerankerIcon(){return Zr},get readerIcon(){return qr}};return Object.defineProperty(he,"__isScriptSetup",{enumerable:!1,value:!0}),he}}),_f={class:"row justify-center full-width"},wf={class:"models-graph-wrapper"},bf=["id"],xf={class:"label bg-grey-8 text-black"};function Ef(e,t,n,o,i,r){return ee(),ve(ze,null,[Pe("div",_f,[J(Wr,{modelValue:o.query,"onUpdate:modelValue":[t[0]||(t[0]=a=>o.query=a),o.onFilter],outlined:"",square:"",debounce:"300",label:o.t("model_graph.search_models"),class:"q-my-xl search-box",style:De({width:o.vertical?"80%":"40%"}),clearable:""},{prepend:oe(()=>[J(Le,{name:"search",class:"cursor-pointer"})]),_:1},8,["modelValue","label","style"])]),Pe("div",{class:mt(["models-graph",{"is-vertical":o.vertical}])},[Pe("div",wf,[Pe("div",{class:"models-graph-inner",style:De(o.containerStyle)},[Pe("div",{class:"timeline",style:De(o.timelineStyle)},[(ee(!0),ve(ze,null,vt(o.quarters,a=>(ee(),ve("div",{key:a,class:"section",style:De(o.quarterStyle),id:a},[Pe("span",xf,xe(a),1)],12,bf))),128))],4),o.isModelsLoading?Se("",!0):(ee(),we(o.VueFlow,{key:0,nodes:o.modelNodes,edges:o.edges,"zoom-on-scroll":!1,"zoom-on-double-click":!1,"zoom-on-pinch":!1,"nodes-draggable":!1,"pan-on-drag":!1,"fit-view-on-init":!1},{"node-custom":oe(({data:a})=>[bt((ee(),we(xt,{class:"full-width full-height cursor-pointer",style:{"flex-direction":"column"}},{default:oe(()=>[J(Ye,{caption:"",class:"justify-between row full-width items-center q-mb-xs"},{default:oe(()=>{var s,l,u;return[Pe("div",null,[(s=a.request_path)!=null&&s.includes("embedding")?(ee(),we(Le,{key:0,name:"img:"+o.embeddingIcon},{default:oe(()=>[J(Fe,null,{default:oe(()=>[ke(xe(o.t("landing_page.embeddings")),1)]),_:1})]),_:1},8,["name"])):(l=a.request_path)!=null&&l.includes("rank")?(ee(),we(Le,{key:1,name:"img:"+o.rerankerIcon},{default:oe(()=>[J(Fe,null,{default:oe(()=>[ke(xe(o.t("landing_page.reranker")),1)]),_:1})]),_:1},8,["name"])):(u=a.tags)!=null&&u.includes("reader")?(ee(),we(Le,{key:2,name:"img:"+o.readerIcon},{default:oe(()=>[J(Fe,null,{default:oe(()=>[ke(xe(o.t("landing_page.reader")),1)]),_:1})]),_:1},8,["name"])):Se("",!0),o.ccncOptions.includes(a.name)?(ee(),we(Le,{key:3,name:"fab fa-creative-commons"},{default:oe(()=>[J(Fe,null,{default:oe(()=>[ke(xe(o.t("landing_page.ccbync")),1)]),_:1})]),_:1})):Se("",!0)]),J(ut,{icon:"calendar_month",size:"xs",square:"",dense:"",class:"text-dim",color:"transparent",label:o.date.formatDate(a.release_date,"YYYY-MM-DD")},null,8,["label"])]}),_:2},1024),J(Oe,{class:"no-wrap"},{default:oe(()=>[J(Ye,{class:"text-weight-bold",style:{"font-size":"14px"}},{default:oe(()=>[Pe("code",null,xe(a.name),1)]),_:2},1024),J(Ye,{caption:"",class:"row q-py-sm no-wrap"},{default:oe(()=>{var s,l,u,c,f,v;return[a.tags&&a.tags.includes("multimodal")?(ee(),we(ut,{key:0,square:"",size:"xs",outline:"",style:{"border-radius":"0"},class:"text-dim",label:o.t("embedding.multimodal"),icon:"mms"},{default:oe(()=>[o.isNodeHoverable(a.name)?(ee(),we(Fe,{key:0},{default:oe(()=>[ke(xe(o.t("embedding.multimodal_explain")),1)]),_:1})):Se("",!0)]),_:2},1032,["label"])):Se("",!0),(s=a.request_path)!=null&&s.includes("multi-embeddings")?(ee(),we(ut,{key:1,class:"text-dim",style:{"border-radius":"0"},icon:"grid_4x4",label:o.t("embedding.multi_embedding"),square:"",size:"xs",outline:""},{default:oe(()=>[J(Fe,null,{default:oe(()=>[ke(xe(o.t("embedding.multi_embedding_explain")),1)]),_:1})]),_:1},8,["label"])):Se("",!0),J(ut,{label:(l=a.meta_data)==null?void 0:l.token_length,square:"",size:"xs",outline:"",icon:"notes",class:"text-dim",style:{"border-radius":"0"}},{default:oe(()=>[o.isNodeHoverable(a.name)?(ee(),we(Fe,{key:0},{default:oe(()=>{var p;return[ke(xe(o.t("embedding.token_length_explain",{_tokenLength:(p=a.meta_data)==null?void 0:p.token_length})),1)]}),_:2},1024)):Se("",!0)]),_:2},1032,["label"]),(u=a.request_path)!=null&&u.includes("embedding")?(ee(),we(ut,{key:2,label:(c=a.meta_data)==null?void 0:c.output_dim,square:"",class:"text-dim",size:"xs",outline:"",icon:"mdi-axis-arrow",style:{"border-radius":"0"}},{default:oe(()=>[o.isNodeHoverable(a.name)?(ee(),we(Fe,{key:0},{default:oe(()=>{var p;return[ke(xe(o.t("embedding.output_dim_explain",{_outputDim:(p=a.meta_data)==null?void 0:p.output_dim})),1)]}),_:2},1024)):Se("",!0)]),_:2},1032,["label"])):Se("",!0),J(ut,{label:(f=a.meta_data)==null?void 0:f.size,square:"",size:"xs",class:"text-dim",outline:"",icon:"mdi-matrix",style:{"border-radius":"0"}},{default:oe(()=>[o.isNodeHoverable(a.name)?(ee(),we(Fe,{key:0},{default:oe(()=>{var p;return[ke(xe(o.t("embedding.size_explain",{_size:(p=a.meta_data)==null?void 0:p.size})),1)]}),_:2},1024)):Se("",!0)]),_:2},1032,["label"]),J(ut,{label:o.langcode2emojis((v=a.meta_data)==null?void 0:v.language),square:"",class:"text-dim",size:"xs",outline:"",style:{"border-radius":"0"}},{default:oe(()=>[o.isNodeHoverable(a.name)?(ee(),we(Fe,{key:0},{default:oe(()=>{var p;return[ke(xe(o.t("embedding.language_explain",{_language:o.langcode2emojis((p=a.meta_data)==null?void 0:p.language)})),1)]}),_:2},1024)):Se("",!0)]),_:2},1032,["label"])]}),_:2},1024)]),_:2},1024)]),_:2},1024)),[[Et]]),J(jr,{flat:"","auto-close":"",anchor:o.vertical?"bottom start":"top right",self:"top left",class:"lock-blur model-menu bg-transparent",style:{width:"400px"},onBeforeHide:o.beforeHideDetails},{default:oe(()=>[J(Kr),o.MODELS_WITHOUT_API.includes(a.name)?Se("",!0):bt((ee(),we(xt,{key:0,clickable:"",href:`/?sui&model=${a.name}`},{default:oe(()=>[J(Oe,{avatar:""},{default:oe(()=>[J(Le,{name:"code"})]),_:1}),J(Oe,null,{default:oe(()=>[J(Ye,{caption:""},{default:oe(()=>[ke(xe(o.t("model_graph.use_it_via")),1)]),_:1}),J(Ye,null,{default:oe(()=>[ke(xe(o.t("model_graph.api")),1)]),_:1})]),_:1})]),_:2},1032,["href"])),[[Et]]),(ee(!0),ve(ze,null,vt(o.cloudPartners,s=>bt((ee(),we(xt,{clickable:"",key:s.label,href:s.link,target:"_blank"},{default:oe(()=>[J(Oe,{avatar:""},{default:oe(()=>[J(Le,{name:s.icon},null,8,["name"])]),_:2},1024),J(Oe,null,{default:oe(()=>[J(Ye,{caption:""},{default:oe(()=>[ke(xe(o.t("model_graph.deploy_it_on")),1)]),_:1}),J(Oe,null,{default:oe(()=>[ke(xe(s.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["href"])),[[Et]])),128)),bt((ee(),we(xt,{clickable:"",href:"/contact-sales"},{default:oe(()=>[J(Oe,{avatar:""},{default:oe(()=>[J(Le,{name:"handshake"})]),_:1}),J(Oe,null,{default:oe(()=>[J(Ye,null,{default:oe(()=>[ke(xe(o.t("model_graph.contact_sales_about_it")),1)]),_:1})]),_:1})]),_:1})),[[Et]]),bt((ee(),we(xt,{clickable:"",href:`https://huggingface.co/jinaai/${a.name}`,target:"_blank"},{default:oe(()=>[J(Oe,{avatar:""},{default:oe(()=>[J(Le,{name:"img:/huggingface_logo.svg"})]),_:1}),J(Oe,null,{default:oe(()=>[J(Ye,null,{default:oe(()=>[ke(xe(o.t("model_graph.find_on_hf")),1)]),_:1})]),_:1})]),_:2},1032,["href"])),[[Et]]),bt((ee(),we(xt,{clickable:"",onClick:s=>o.onSearch(o.getDefaultQuery(a.name))},{default:oe(()=>[J(Oe,{avatar:""},{default:oe(()=>[J(Le,{name:"search"})]),_:1}),J(Oe,null,{default:oe(()=>[J(Ye,{caption:""},{default:oe(()=>[ke(xe(o.t("model_graph.search_for")),1)]),_:1}),J(Ye,null,{default:oe(()=>[t[1]||(t[1]=ke('"')),Pe("code",null,xe(o.getDefaultQuery(a.name)),1),t[2]||(t[2]=ke('"'))]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"])),[[Et]])]),_:2},1032,["anchor"]),J(o.Handle,{id:"source-top",type:"source",position:o.Position.Top},null,8,["position"]),J(o.Handle,{id:"target-top",type:"target",position:o.Position.Top},null,8,["position"]),J(o.Handle,{id:"source-bottom",type:"source",position:o.Position.Bottom},null,8,["position"]),J(o.Handle,{id:"target-bottom",type:"target",position:o.Position.Bottom},null,8,["position"]),J(o.Handle,{id:"source-left",type:"source",position:o.Position.Left},null,8,["position"]),J(o.Handle,{id:"target-left",type:"target",position:o.Position.Left},null,8,["position"]),J(o.Handle,{id:"source-right",type:"source",position:o.Position.Right},null,8,["position"]),J(o.Handle,{id:"target-right",type:"target",position:o.Position.Right},null,8,["position"])]),_:1},8,["nodes","edges"])),J(ea,{showing:o.isModelsLoading},null,8,["showing"])],4)])],2)],64)}const zf=uo(yf,[["render",Ef],["__file","EmbeddingGraph.vue"]]);export{zf as E,ga as I,Of as L};
