@gitton-dev/plugin-dependency-graph 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/package.json +78 -0
- package/ui/assets/createLucideIcon-BZIv-Q5M.js +60 -0
- package/ui/assets/settings-BpCjyyrk.js +11 -0
- package/ui/assets/settings-BwrmGl9f.css +1 -0
- package/ui/assets/sidebar-BTt4rFoN.css +1 -0
- package/ui/assets/sidebar-CmvYg4Qf.js +38 -0
- package/ui/src/settings/index.html +14 -0
- package/ui/src/sidebar/index.html +14 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{r as Ev,g as Sv,R as Cv,a as f_,b as F,j as P,c as nc,d as or,e as l_}from"./createLucideIcon-BZIv-Q5M.js";function ue(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;r<e.length;r++)(n=ue(e[r]))!==""&&(t+=(t&&" ")+n);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var d_={value:()=>{}};function kr(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new vr(r)}function vr(e){this._=e}function h_(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}vr.prototype=kr.prototype={constructor:vr,on:function(e,t){var r=this._,n=h_(e+"",r),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(e=n[a]).type)&&(i=p_(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=n[a]).type)r[i]=Yc(r[i],e.name,t);else if(t==null)for(i in r)r[i]=Yc(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new vr(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};function p_(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function Yc(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=d_,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Hu="http://www.w3.org/1999/xhtml";const Wc={svg:"http://www.w3.org/2000/svg",xhtml:Hu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pr(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Wc.hasOwnProperty(t)?{space:Wc[t],local:e}:e}function g_(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Hu&&t.documentElement.namespaceURI===Hu?t.createElement(e):t.createElementNS(r,e)}}function v_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qv(e){var t=Pr(e);return(t.local?v_:g_)(t)}function y_(){}function ic(e){return e==null?y_:function(){return this.querySelector(e)}}function m_(e){typeof e!="function"&&(e=ic(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=new Array(o),u,c,f=0;f<o;++f)(u=a[f])&&(c=e.call(u,u.__data__,f,a))&&("__data__"in u&&(c.__data__=u.__data__),s[f]=c);return new ve(n,this._parents)}function __(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function b_(){return[]}function Iv(e){return e==null?b_:function(){return this.querySelectorAll(e)}}function x_(e){return function(){return __(e.apply(this,arguments))}}function w_(e){typeof e=="function"?e=x_(e):e=Iv(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var o=t[a],s=o.length,u,c=0;c<s;++c)(u=o[c])&&(n.push(e.call(u,u.__data__,c,o)),i.push(u));return new ve(n,i)}function Nv(e){return function(){return this.matches(e)}}function Rv(e){return function(t){return t.matches(e)}}var E_=Array.prototype.find;function S_(e){return function(){return E_.call(this.children,e)}}function C_(){return this.firstElementChild}function q_(e){return this.select(e==null?C_:S_(typeof e=="function"?e:Rv(e)))}var I_=Array.prototype.filter;function N_(){return Array.from(this.children)}function R_(e){return function(){return I_.call(this.children,e)}}function A_(e){return this.selectAll(e==null?N_:R_(typeof e=="function"?e:Rv(e)))}function M_(e){typeof e!="function"&&(e=Nv(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],u,c=0;c<o;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&s.push(u);return new ve(n,this._parents)}function Av(e){return new Array(e.length)}function T_(){return new ve(this._enter||this._groups.map(Av),this._parents)}function xr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xr.prototype={constructor:xr,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 k_(e){return function(){return e}}function P_(e,t,r,n,i,a){for(var o=0,s,u=t.length,c=a.length;o<c;++o)(s=t[o])?(s.__data__=a[o],n[o]=s):r[o]=new xr(e,a[o]);for(;o<u;++o)(s=t[o])&&(i[o]=s)}function L_(e,t,r,n,i,a,o){var s,u,c=new Map,f=t.length,l=a.length,d=new Array(f),h;for(s=0;s<f;++s)(u=t[s])&&(d[s]=h=o.call(u,u.__data__,s,t)+"",c.has(h)?i[s]=u:c.set(h,u));for(s=0;s<l;++s)h=o.call(e,a[s],s,a)+"",(u=c.get(h))?(n[s]=u,u.__data__=a[s],c.delete(h)):r[s]=new xr(e,a[s]);for(s=0;s<f;++s)(u=t[s])&&c.get(d[s])===u&&(i[s]=u)}function O_(e){return e.__data__}function D_(e,t){if(!arguments.length)return Array.from(this,O_);var r=t?L_:P_,n=this._parents,i=this._groups;typeof e!="function"&&(e=k_(e));for(var a=i.length,o=new Array(a),s=new Array(a),u=new Array(a),c=0;c<a;++c){var f=n[c],l=i[c],d=l.length,h=j_(e.call(f,f&&f.__data__,c,n)),g=h.length,m=s[c]=new Array(g),v=o[c]=new Array(g),y=u[c]=new Array(d);r(f,l,m,v,y,h,t);for(var b=0,p=0,_,x;b<g;++b)if(_=m[b]){for(b>=p&&(p=b+1);!(x=v[p])&&++p<g;);_._next=x||null}}return o=new ve(o,n),o._enter=s,o._exit=u,o}function j_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function F_(){return new ve(this._exit||this._groups.map(Av),this._parents)}function $_(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function z_(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,o=Math.min(i,a),s=new Array(i),u=0;u<o;++u)for(var c=r[u],f=n[u],l=c.length,d=s[u]=new Array(l),h,g=0;g<l;++g)(h=c[g]||f[g])&&(d[g]=h);for(;u<i;++u)s[u]=r[u];return new ve(s,this._parents)}function B_(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],o;--i>=0;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function H_(e){e||(e=V_);function t(l,d){return l&&d?e(l.__data__,d.__data__):!l-!d}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var o=r[a],s=o.length,u=i[a]=new Array(s),c,f=0;f<s;++f)(c=o[f])&&(u[f]=c);u.sort(t)}return new ve(i,this._parents).order()}function V_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function G_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function U_(){return Array.from(this)}function Y_(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null}function W_(){let e=0;for(const t of this)++e;return e}function X_(){return!this.node()}function K_(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Z_(e){return function(){this.removeAttribute(e)}}function Q_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function J_(e,t){return function(){this.setAttribute(e,t)}}function eb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tb(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function rb(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function nb(e,t){var r=Pr(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?Q_:Z_:typeof t=="function"?r.local?rb:tb:r.local?eb:J_)(r,t))}function Mv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ib(e){return function(){this.style.removeProperty(e)}}function ab(e,t,r){return function(){this.style.setProperty(e,t,r)}}function ob(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function sb(e,t,r){return arguments.length>1?this.each((t==null?ib:typeof t=="function"?ob:ab)(e,t,r??"")):gt(this.node(),e)}function gt(e,t){return e.style.getPropertyValue(t)||Mv(e).getComputedStyle(e,null).getPropertyValue(t)}function ub(e){return function(){delete this[e]}}function cb(e,t){return function(){this[e]=t}}function fb(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function lb(e,t){return arguments.length>1?this.each((t==null?ub:typeof t=="function"?fb:cb)(e,t)):this.node()[e]}function Tv(e){return e.trim().split(/^|\s+/)}function ac(e){return e.classList||new kv(e)}function kv(e){this._node=e,this._names=Tv(e.getAttribute("class")||"")}kv.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 Pv(e,t){for(var r=ac(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function Lv(e,t){for(var r=ac(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function db(e){return function(){Pv(this,e)}}function hb(e){return function(){Lv(this,e)}}function pb(e,t){return function(){(t.apply(this,arguments)?Pv:Lv)(this,e)}}function gb(e,t){var r=Tv(e+"");if(arguments.length<2){for(var n=ac(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?pb:t?db:hb)(r,t))}function vb(){this.textContent=""}function yb(e){return function(){this.textContent=e}}function mb(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _b(e){return arguments.length?this.each(e==null?vb:(typeof e=="function"?mb:yb)(e)):this.node().textContent}function bb(){this.innerHTML=""}function xb(e){return function(){this.innerHTML=e}}function wb(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Eb(e){return arguments.length?this.each(e==null?bb:(typeof e=="function"?wb:xb)(e)):this.node().innerHTML}function Sb(){this.nextSibling&&this.parentNode.appendChild(this)}function Cb(){return this.each(Sb)}function qb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ib(){return this.each(qb)}function Nb(e){var t=typeof e=="function"?e:qv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Rb(){return null}function Ab(e,t){var r=typeof e=="function"?e:qv(e),n=t==null?Rb:typeof t=="function"?t:ic(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Mb(){var e=this.parentNode;e&&e.removeChild(this)}function Tb(){return this.each(Mb)}function kb(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pb(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lb(e){return this.select(e?Pb:kb)}function Ob(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Db(e){return function(t){e.call(this,t,this.__data__)}}function jb(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Fb(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function $b(e,t,r){return function(){var n=this.__on,i,a=Db(t);if(n){for(var o=0,s=n.length;o<s;++o)if((i=n[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function zb(e,t,r){var n=jb(e+""),i,a=n.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,c=s.length,f;u<c;++u)for(i=0,f=s[u];i<a;++i)if((o=n[i]).type===f.type&&o.name===f.name)return f.value}return}for(s=t?$b:Fb,i=0;i<a;++i)this.each(s(n[i],t,r));return this}function Ov(e,t,r){var n=Mv(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Bb(e,t){return function(){return Ov(this,e,t)}}function Hb(e,t){return function(){return Ov(this,e,t.apply(this,arguments))}}function Vb(e,t){return this.each((typeof t=="function"?Hb:Bb)(e,t))}function*Gb(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,o;i<a;++i)(o=n[i])&&(yield o)}var Dv=[null];function ve(e,t){this._groups=e,this._parents=t}function Ut(){return new ve([[document.documentElement]],Dv)}function Ub(){return this}ve.prototype=Ut.prototype={constructor:ve,select:m_,selectAll:w_,selectChild:q_,selectChildren:A_,filter:M_,data:D_,enter:T_,exit:F_,join:$_,merge:z_,selection:Ub,order:B_,sort:H_,call:G_,nodes:U_,node:Y_,size:W_,empty:X_,each:K_,attr:nb,style:sb,property:lb,classed:gb,text:_b,html:Eb,raise:Cb,lower:Ib,append:Nb,insert:Ab,remove:Tb,clone:Lb,datum:Ob,on:zb,dispatch:Vb,[Symbol.iterator]:Gb};function ge(e){return typeof e=="string"?new ve([[document.querySelector(e)]],[document.documentElement]):new ve([[e]],Dv)}function Yb(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _e(e,t){if(e=Yb(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.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 Wb={passive:!1},Ot={capture:!0,passive:!1};function ln(e){e.stopImmediatePropagation()}function ht(e){e.preventDefault(),e.stopImmediatePropagation()}function jv(e){var t=e.document.documentElement,r=ge(e).on("dragstart.drag",ht,Ot);"onselectstart"in t?r.on("selectstart.drag",ht,Ot):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Fv(e,t){var r=e.document.documentElement,n=ge(e).on("dragstart.drag",null);t&&(n.on("click.drag",ht,Ot),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const sr=e=>()=>e;function Vu(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:o,y:s,dx:u,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}Vu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Xb(e){return!e.ctrlKey&&!e.button}function Kb(){return this.parentNode}function Zb(e,t){return t??{x:e.x,y:e.y}}function Qb(){return navigator.maxTouchPoints||"ontouchstart"in this}function $v(){var e=Xb,t=Kb,r=Zb,n=Qb,i={},a=kr("start","drag","end"),o=0,s,u,c,f,l=0;function d(_){_.on("mousedown.drag",h).filter(n).on("touchstart.drag",v).on("touchmove.drag",y,Wb).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,x){if(!(f||!e.call(this,_,x))){var w=p(this,t.call(this,_,x),_,x,"mouse");w&&(ge(_.view).on("mousemove.drag",g,Ot).on("mouseup.drag",m,Ot),jv(_.view),ln(_),c=!1,s=_.clientX,u=_.clientY,w("start",_))}}function g(_){if(ht(_),!c){var x=_.clientX-s,w=_.clientY-u;c=x*x+w*w>l}i.mouse("drag",_)}function m(_){ge(_.view).on("mousemove.drag mouseup.drag",null),Fv(_.view,c),ht(_),i.mouse("end",_)}function v(_,x){if(e.call(this,_,x)){var w=_.changedTouches,E=t.call(this,_,x),I=w.length,q,R;for(q=0;q<I;++q)(R=p(this,E,_,x,w[q].identifier,w[q]))&&(ln(_),R("start",_,w[q]))}}function y(_){var x=_.changedTouches,w=x.length,E,I;for(E=0;E<w;++E)(I=i[x[E].identifier])&&(ht(_),I("drag",_,x[E]))}function b(_){var x=_.changedTouches,w=x.length,E,I;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),E=0;E<w;++E)(I=i[x[E].identifier])&&(ln(_),I("end",_,x[E]))}function p(_,x,w,E,I,q){var R=a.copy(),C=_e(q||w,x),N,L,S;if((S=r.call(_,new Vu("beforestart",{sourceEvent:w,target:d,identifier:I,active:o,x:C[0],y:C[1],dx:0,dy:0,dispatch:R}),E))!=null)return N=S.x-C[0]||0,L=S.y-C[1]||0,function T(M,j,O){var k=C,H;switch(M){case"start":i[I]=T,H=o++;break;case"end":delete i[I],--o;case"drag":C=_e(O||j,x),H=o;break}R.call(M,_,new Vu(M,{sourceEvent:j,subject:S,target:d,identifier:I,active:H,x:C[0]+N,y:C[1]+L,dx:C[0]-k[0],dy:C[1]-k[1],dispatch:R}),E)}}return d.filter=function(_){return arguments.length?(e=typeof _=="function"?_:sr(!!_),d):e},d.container=function(_){return arguments.length?(t=typeof _=="function"?_:sr(_),d):t},d.subject=function(_){return arguments.length?(r=typeof _=="function"?_:sr(_),d):r},d.touchable=function(_){return arguments.length?(n=typeof _=="function"?_:sr(!!_),d):n},d.on=function(){var _=a.on.apply(a,arguments);return _===a?d:_},d.clickDistance=function(_){return arguments.length?(l=(_=+_)*_,d):Math.sqrt(l)},d}function oc(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function zv(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Yt(){}var Dt=.7,wr=1/Dt,pt="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Jb=/^#([0-9a-f]{3,8})$/,ex=new RegExp(`^rgb\\(${pt},${pt},${pt}\\)$`),tx=new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`),rx=new RegExp(`^rgba\\(${pt},${pt},${pt},${jt}\\)$`),nx=new RegExp(`^rgba\\(${Re},${Re},${Re},${jt}\\)$`),ix=new RegExp(`^hsl\\(${jt},${Re},${Re}\\)$`),ax=new RegExp(`^hsla\\(${jt},${Re},${Re},${jt}\\)$`),Xc={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};oc(Yt,tt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kc,formatHex:Kc,formatHex8:ox,formatHsl:sx,formatRgb:Zc,toString:Zc});function Kc(){return this.rgb().formatHex()}function ox(){return this.rgb().formatHex8()}function sx(){return Bv(this).formatHsl()}function Zc(){return this.rgb().formatRgb()}function tt(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Jb.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Qc(t):r===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ur(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ur(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=ex.exec(e))?new he(t[1],t[2],t[3],1):(t=tx.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rx.exec(e))?ur(t[1],t[2],t[3],t[4]):(t=nx.exec(e))?ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ix.exec(e))?tf(t[1],t[2]/100,t[3]/100,1):(t=ax.exec(e))?tf(t[1],t[2]/100,t[3]/100,t[4]):Xc.hasOwnProperty(e)?Qc(Xc[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function Qc(e){return new he(e>>16&255,e>>8&255,e&255,1)}function ur(e,t,r,n){return n<=0&&(e=t=r=NaN),new he(e,t,r,n)}function ux(e){return e instanceof Yt||(e=tt(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Gu(e,t,r,n){return arguments.length===1?ux(e):new he(e,t,r,n??1)}function he(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}oc(he,Gu,zv(Yt,{brighter(e){return e=e==null?wr:Math.pow(wr,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dt:Math.pow(Dt,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Je(this.r),Je(this.g),Je(this.b),Er(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:Jc,formatHex:Jc,formatHex8:cx,formatRgb:ef,toString:ef}));function Jc(){return`#${Qe(this.r)}${Qe(this.g)}${Qe(this.b)}`}function cx(){return`#${Qe(this.r)}${Qe(this.g)}${Qe(this.b)}${Qe((isNaN(this.opacity)?1:this.opacity)*255)}`}function ef(){const e=Er(this.opacity);return`${e===1?"rgb(":"rgba("}${Je(this.r)}, ${Je(this.g)}, ${Je(this.b)}${e===1?")":`, ${e})`}`}function Er(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qe(e){return e=Je(e),(e<16?"0":"")+e.toString(16)}function tf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new be(e,t,r,n)}function Bv(e){if(e instanceof be)return new be(e.h,e.s,e.l,e.opacity);if(e instanceof Yt||(e=tt(e)),!e)return new be;if(e instanceof be)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,u=(a+i)/2;return s?(t===a?o=(r-n)/s+(r<n)*6:r===a?o=(n-t)/s+2:o=(t-r)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new be(o,s,u,e.opacity)}function fx(e,t,r,n){return arguments.length===1?Bv(e):new be(e,t,r,n??1)}function be(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}oc(be,fx,zv(Yt,{brighter(e){return e=e==null?wr:Math.pow(wr,e),new be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dt:Math.pow(Dt,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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new he(dn(e>=240?e-240:e+120,i,n),dn(e,i,n),dn(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new be(rf(this.h),cr(this.s),cr(this.l),Er(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=Er(this.opacity);return`${e===1?"hsl(":"hsla("}${rf(this.h)}, ${cr(this.s)*100}%, ${cr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rf(e){return e=(e||0)%360,e<0?e+360:e}function cr(e){return Math.max(0,Math.min(1,e||0))}function dn(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const sc=e=>()=>e;function lx(e,t){return function(r){return e+r*t}}function dx(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function hx(e){return(e=+e)==1?Hv:function(t,r){return r-t?dx(t,r,e):sc(isNaN(t)?r:t)}}function Hv(e,t){var r=t-e;return r?lx(e,r):sc(isNaN(e)?t:e)}const Sr=(function e(t){var r=hx(t);function n(i,a){var o=r((i=Gu(i)).r,(a=Gu(a)).r),s=r(i.g,a.g),u=r(i.b,a.b),c=Hv(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=u(f),i.opacity=c(f),i+""}}return n.gamma=e,n})(1);function px(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function gx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vx(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Pt(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function yx(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ne(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function mx(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Pt(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Uu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hn=new RegExp(Uu.source,"g");function _x(e){return function(){return e}}function bx(e){return function(t){return e(t)+""}}function Vv(e,t){var r=Uu.lastIndex=hn.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(e=e+"",t=t+"";(n=Uu.exec(e))&&(i=hn.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:Ne(n,i)})),r=hn.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?bx(u[0].x):_x(t):(t=u.length,function(c){for(var f=0,l;f<t;++f)s[(l=u[f]).i]=l.x(c);return s.join("")})}function Pt(e,t){var r=typeof t,n;return t==null||r==="boolean"?sc(t):(r==="number"?Ne:r==="string"?(n=tt(t))?(t=n,Sr):Vv:t instanceof tt?Sr:t instanceof Date?yx:gx(t)?px:Array.isArray(t)?vx:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?mx:Ne)(e,t)}var nf=180/Math.PI,Yu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gv(e,t,r,n,i,a){var o,s,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*r+t*n)&&(r-=e*u,n-=t*u),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,u/=s),e*n<t*r&&(e=-e,t=-t,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*nf,skewX:Math.atan(u)*nf,scaleX:o,scaleY:s}}var fr;function xx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yu:Gv(t.a,t.b,t.c,t.d,t.e,t.f)}function wx(e){return e==null||(fr||(fr=document.createElementNS("http://www.w3.org/2000/svg","g")),fr.setAttribute("transform",e),!(e=fr.transform.baseVal.consolidate()))?Yu:(e=e.matrix,Gv(e.a,e.b,e.c,e.d,e.e,e.f))}function Uv(e,t,r,n){function i(c){return c.length?c.pop()+" ":""}function a(c,f,l,d,h,g){if(c!==l||f!==d){var m=h.push("translate(",null,t,null,r);g.push({i:m-4,x:Ne(c,l)},{i:m-2,x:Ne(f,d)})}else(l||d)&&h.push("translate("+l+t+d+r)}function o(c,f,l,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:l.push(i(l)+"rotate(",null,n)-2,x:Ne(c,f)})):f&&l.push(i(l)+"rotate("+f+n)}function s(c,f,l,d){c!==f?d.push({i:l.push(i(l)+"skewX(",null,n)-2,x:Ne(c,f)}):f&&l.push(i(l)+"skewX("+f+n)}function u(c,f,l,d,h,g){if(c!==l||f!==d){var m=h.push(i(h)+"scale(",null,",",null,")");g.push({i:m-4,x:Ne(c,l)},{i:m-2,x:Ne(f,d)})}else(l!==1||d!==1)&&h.push(i(h)+"scale("+l+","+d+")")}return function(c,f){var l=[],d=[];return c=e(c),f=e(f),a(c.translateX,c.translateY,f.translateX,f.translateY,l,d),o(c.rotate,f.rotate,l,d),s(c.skewX,f.skewX,l,d),u(c.scaleX,c.scaleY,f.scaleX,f.scaleY,l,d),c=f=null,function(h){for(var g=-1,m=d.length,v;++g<m;)l[(v=d[g]).i]=v.x(h);return l.join("")}}}var Ex=Uv(xx,"px, ","px)","deg)"),Sx=Uv(wx,", ",")",")"),Cx=1e-12;function af(e){return((e=Math.exp(e))+1/e)/2}function qx(e){return((e=Math.exp(e))-1/e)/2}function Ix(e){return((e=Math.exp(2*e))-1)/(e+1)}const yr=(function e(t,r,n){function i(a,o){var s=a[0],u=a[1],c=a[2],f=o[0],l=o[1],d=o[2],h=f-s,g=l-u,m=h*h+g*g,v,y;if(m<Cx)y=Math.log(d/c)/t,v=function(E){return[s+E*h,u+E*g,c*Math.exp(t*E*y)]};else{var b=Math.sqrt(m),p=(d*d-c*c+n*m)/(2*c*r*b),_=(d*d-c*c-n*m)/(2*d*r*b),x=Math.log(Math.sqrt(p*p+1)-p),w=Math.log(Math.sqrt(_*_+1)-_);y=(w-x)/t,v=function(E){var I=E*y,q=af(x),R=c/(r*b)*(q*Ix(t*I+x)-qx(x));return[s+R*h,u+R*g,c*q/af(t*I+x)]}}return v.duration=y*1e3*t/Math.SQRT2,v}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,u=s*s;return e(o,s,u)},i})(Math.SQRT2,2,4);var vt=0,Rt=0,It=0,Yv=1e3,Cr,At,qr=0,rt=0,Lr=0,Ft=typeof performance=="object"&&performance.now?performance:Date,Wv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function uc(){return rt||(Wv(Nx),rt=Ft.now()+Lr)}function Nx(){rt=0}function Ir(){this._call=this._time=this._next=null}Ir.prototype=Xv.prototype={constructor:Ir,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?uc():+r)+(t==null?0:+t),!this._next&&At!==this&&(At?At._next=this:Cr=this,At=this),this._call=e,this._time=r,Wu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wu())}};function Xv(e,t,r){var n=new Ir;return n.restart(e,t,r),n}function Rx(){uc(),++vt;for(var e=Cr,t;e;)(t=rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vt}function of(){rt=(qr=Ft.now())+Lr,vt=Rt=0;try{Rx()}finally{vt=0,Mx(),rt=0}}function Ax(){var e=Ft.now(),t=e-qr;t>Yv&&(Lr-=t,qr=e)}function Mx(){for(var e,t=Cr,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Cr=r);At=e,Wu(n)}function Wu(e){if(!vt){Rt&&(Rt=clearTimeout(Rt));var t=e-rt;t>24?(e<1/0&&(Rt=setTimeout(of,e-Ft.now()-Lr)),It&&(It=clearInterval(It))):(It||(qr=Ft.now(),It=setInterval(Ax,Yv)),vt=1,Wv(of))}}function sf(e,t,r){var n=new Ir;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var Tx=kr("start","end","cancel","interrupt"),kx=[],Kv=0,uf=1,Xu=2,mr=3,cf=4,Ku=5,_r=6;function Or(e,t,r,n,i,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;Px(e,r,{name:t,index:n,group:i,on:Tx,tween:kx,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Kv})}function cc(e,t){var r=Se(e,t);if(r.state>Kv)throw new Error("too late; already scheduled");return r}function Me(e,t){var r=Se(e,t);if(r.state>mr)throw new Error("too late; already running");return r}function Se(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Px(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=Xv(a,0,r.time);function a(c){r.state=uf,r.timer.restart(o,r.delay,r.time),r.delay<=c&&o(c-r.delay)}function o(c){var f,l,d,h;if(r.state!==uf)return u();for(f in n)if(h=n[f],h.name===r.name){if(h.state===mr)return sf(o);h.state===cf?(h.state=_r,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete n[f]):+f<t&&(h.state=_r,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete n[f])}if(sf(function(){r.state===mr&&(r.state=cf,r.timer.restart(s,r.delay,r.time),s(c))}),r.state=Xu,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Xu){for(r.state=mr,i=new Array(d=r.tween.length),f=0,l=-1;f<d;++f)(h=r.tween[f].value.call(e,e.__data__,r.index,r.group))&&(i[++l]=h);i.length=l+1}}function s(c){for(var f=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(u),r.state=Ku,1),l=-1,d=i.length;++l<d;)i[l].call(e,f);r.state===Ku&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=_r,r.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function br(e,t){var r=e.__transition,n,i,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((n=r[o]).name!==t){a=!1;continue}i=n.state>Xu&&n.state<Ku,n.state=_r,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[o]}a&&delete e.__transition}}function Lx(e){return this.each(function(){br(this,e)})}function Ox(e,t){var r,n;return function(){var i=Me(this,e),a=i.tween;if(a!==r){n=r=a;for(var o=0,s=n.length;o<s;++o)if(n[o].name===t){n=n.slice(),n.splice(o,1);break}}i.tween=n}}function Dx(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=Me(this,e),o=a.tween;if(o!==n){i=(n=o).slice();for(var s={name:t,value:r},u=0,c=i.length;u<c;++u)if(i[u].name===t){i[u]=s;break}u===c&&i.push(s)}a.tween=i}}function jx(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Se(this.node(),r).tween,i=0,a=n.length,o;i<a;++i)if((o=n[i]).name===e)return o.value;return null}return this.each((t==null?Ox:Dx)(r,e,t))}function fc(e,t,r){var n=e._id;return e.each(function(){var i=Me(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Se(i,n).value[t]}}function Zv(e,t){var r;return(typeof t=="number"?Ne:t instanceof tt?Sr:(r=tt(t))?(t=r,Sr):Vv)(e,t)}function Fx(e){return function(){this.removeAttribute(e)}}function $x(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zx(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===n?a:a=t(n=o,r)}}function Bx(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===n?a:a=t(n=o,r)}}function Hx(e,t,r){var n,i,a;return function(){var o,s=r(this),u;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),u=s+"",o===u?null:o===n&&u===i?a:(i=u,a=t(n=o,s)))}}function Vx(e,t,r){var n,i,a;return function(){var o,s=r(this),u;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),u=s+"",o===u?null:o===n&&u===i?a:(i=u,a=t(n=o,s)))}}function Gx(e,t){var r=Pr(e),n=r==="transform"?Sx:Zv;return this.attrTween(e,typeof t=="function"?(r.local?Vx:Hx)(r,n,fc(this,"attr."+e,t)):t==null?(r.local?$x:Fx)(r):(r.local?Bx:zx)(r,n,t))}function Ux(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Yx(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Wx(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&Yx(e,a)),r}return i._value=t,i}function Xx(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&Ux(e,a)),r}return i._value=t,i}function Kx(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Pr(e);return this.tween(r,(n.local?Wx:Xx)(n,t))}function Zx(e,t){return function(){cc(this,e).delay=+t.apply(this,arguments)}}function Qx(e,t){return t=+t,function(){cc(this,e).delay=t}}function Jx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zx:Qx)(t,e)):Se(this.node(),t).delay}function ew(e,t){return function(){Me(this,e).duration=+t.apply(this,arguments)}}function tw(e,t){return t=+t,function(){Me(this,e).duration=t}}function rw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ew:tw)(t,e)):Se(this.node(),t).duration}function nw(e,t){if(typeof t!="function")throw new Error;return function(){Me(this,e).ease=t}}function iw(e){var t=this._id;return arguments.length?this.each(nw(t,e)):Se(this.node(),t).ease}function aw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Me(this,e).ease=r}}function ow(e){if(typeof e!="function")throw new Error;return this.each(aw(this._id,e))}function sw(e){typeof e!="function"&&(e=Nv(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],u,c=0;c<o;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&s.push(u);return new $e(n,this._parents,this._name,this._id)}function uw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s<a;++s)for(var u=t[s],c=r[s],f=u.length,l=o[s]=new Array(f),d,h=0;h<f;++h)(d=u[h]||c[h])&&(l[h]=d);for(;s<n;++s)o[s]=t[s];return new $e(o,this._parents,this._name,this._id)}function cw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function fw(e,t,r){var n,i,a=cw(t)?cc:Me;return function(){var o=a(this,e),s=o.on;s!==n&&(i=(n=s).copy()).on(t,r),o.on=i}}function lw(e,t){var r=this._id;return arguments.length<2?Se(this.node(),r).on.on(e):this.each(fw(r,e,t))}function dw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function hw(){return this.on("end.remove",dw(this._id))}function pw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ic(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,c=a[o]=new Array(u),f,l,d=0;d<u;++d)(f=s[d])&&(l=e.call(f,f.__data__,d,s))&&("__data__"in f&&(l.__data__=f.__data__),c[d]=l,Or(c[d],t,r,d,c,Se(f,r)));return new $e(a,this._parents,t,r)}function gw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Iv(e));for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var u=n[s],c=u.length,f,l=0;l<c;++l)if(f=u[l]){for(var d=e.call(f,f.__data__,l,u),h,g=Se(f,r),m=0,v=d.length;m<v;++m)(h=d[m])&&Or(h,t,r,m,d,g);a.push(d),o.push(f)}return new $e(a,o,t,r)}var vw=Ut.prototype.constructor;function yw(){return new vw(this._groups,this._parents)}function mw(e,t){var r,n,i;return function(){var a=gt(this,e),o=(this.style.removeProperty(e),gt(this,e));return a===o?null:a===r&&o===n?i:i=t(r=a,n=o)}}function Qv(e){return function(){this.style.removeProperty(e)}}function _w(e,t,r){var n,i=r+"",a;return function(){var o=gt(this,e);return o===i?null:o===n?a:a=t(n=o,r)}}function bw(e,t,r){var n,i,a;return function(){var o=gt(this,e),s=r(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(e),gt(this,e))),o===u?null:o===n&&u===i?a:(i=u,a=t(n=o,s))}}function xw(e,t){var r,n,i,a="style."+t,o="end."+a,s;return function(){var u=Me(this,e),c=u.on,f=u.value[a]==null?s||(s=Qv(t)):void 0;(c!==r||i!==f)&&(n=(r=c).copy()).on(o,i=f),u.on=n}}function ww(e,t,r){var n=(e+="")=="transform"?Ex:Zv;return t==null?this.styleTween(e,mw(e,n)).on("end.style."+e,Qv(e)):typeof t=="function"?this.styleTween(e,bw(e,n,fc(this,"style."+e,t))).each(xw(this._id,e)):this.styleTween(e,_w(e,n,t),r).on("end.style."+e,null)}function Ew(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Sw(e,t,r){var n,i;function a(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&Ew(e,o,r)),n}return a._value=t,a}function Cw(e,t,r){var n="style."+(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;return this.tween(n,Sw(e,t,r??""))}function qw(e){return function(){this.textContent=e}}function Iw(e){return function(){var t=e(this);this.textContent=t??""}}function Nw(e){return this.tween("text",typeof e=="function"?Iw(fc(this,"text",e)):qw(e==null?"":e+""))}function Rw(e){return function(t){this.textContent=e.call(this,t)}}function Aw(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Rw(i)),t}return n._value=e,n}function Mw(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,Aw(e))}function Tw(){for(var e=this._name,t=this._id,r=Jv(),n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,u,c=0;c<s;++c)if(u=o[c]){var f=Se(u,t);Or(u,e,r,c,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new $e(n,this._parents,e,r)}function kw(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,o){var s={value:o},u={value:function(){--i===0&&a()}};r.each(function(){var c=Me(this,n),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),c.on=t}),i===0&&a()})}var Pw=0;function $e(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function Jv(){return++Pw}var De=Ut.prototype;$e.prototype={constructor:$e,select:pw,selectAll:gw,selectChild:De.selectChild,selectChildren:De.selectChildren,filter:sw,merge:uw,selection:yw,transition:Tw,call:De.call,nodes:De.nodes,node:De.node,size:De.size,empty:De.empty,each:De.each,on:lw,attr:Gx,attrTween:Kx,style:ww,styleTween:Cw,text:Nw,textTween:Mw,remove:hw,tween:jx,delay:Jx,duration:rw,ease:iw,easeVarying:ow,end:kw,[Symbol.iterator]:De[Symbol.iterator]};function Lw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ow={time:null,delay:0,duration:250,ease:Lw};function Dw(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function jw(e){var t,r;e instanceof $e?(t=e._id,e=e._name):(t=Jv(),(r=Ow).time=uc(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,u,c=0;c<s;++c)(u=o[c])&&Or(u,e,t,c,o,r||Dw(u,t));return new $e(n,this._parents,e,t)}Ut.prototype.interrupt=Lx;Ut.prototype.transition=jw;const lr=e=>()=>e;function Fw(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function je(e,t,r){this.k=e,this.x=t,this.y=r}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 Dr=new je(1,0,0);ey.prototype=je.prototype;function ey(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Dr;return e.__zoom}function pn(e){e.stopImmediatePropagation()}function Nt(e){e.preventDefault(),e.stopImmediatePropagation()}function $w(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function zw(){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 ff(){return this.__zoom||Dr}function Bw(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Hw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vw(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],o=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ty(){var e=$w,t=zw,r=Vw,n=Bw,i=Hw,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,u=yr,c=kr("start","zoom","end"),f,l,d,h=500,g=150,m=0,v=10;function y(S){S.property("__zoom",ff).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",C).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(S,T,M,j){var O=S.selection?S.selection():S;O.property("__zoom",ff),S!==O?x(S,T,M,j):O.interrupt().each(function(){w(this,arguments).event(j).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},y.scaleBy=function(S,T,M,j){y.scaleTo(S,function(){var O=this.__zoom.k,k=typeof T=="function"?T.apply(this,arguments):T;return O*k},M,j)},y.scaleTo=function(S,T,M,j){y.transform(S,function(){var O=t.apply(this,arguments),k=this.__zoom,H=M==null?_(O):typeof M=="function"?M.apply(this,arguments):M,G=k.invert(H),V=typeof T=="function"?T.apply(this,arguments):T;return r(p(b(k,V),H,G),O,o)},M,j)},y.translateBy=function(S,T,M,j){y.transform(S,function(){return r(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,j)},y.translateTo=function(S,T,M,j,O){y.transform(S,function(){var k=t.apply(this,arguments),H=this.__zoom,G=j==null?_(k):typeof j=="function"?j.apply(this,arguments):j;return r(Dr.translate(G[0],G[1]).scale(H.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof M=="function"?-M.apply(this,arguments):-M),k,o)},j,O)};function b(S,T){return T=Math.max(a[0],Math.min(a[1],T)),T===S.k?S:new je(T,S.x,S.y)}function p(S,T,M){var j=T[0]-M[0]*S.k,O=T[1]-M[1]*S.k;return j===S.x&&O===S.y?S:new je(S.k,j,O)}function _(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function x(S,T,M,j){S.on("start.zoom",function(){w(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(j).end()}).tween("zoom",function(){var O=this,k=arguments,H=w(O,k).event(j),G=t.apply(O,k),V=M==null?_(G):typeof M=="function"?M.apply(O,k):M,Y=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),A=O.__zoom,D=typeof T=="function"?T.apply(O,k):T,$=u(A.invert(V).concat(Y/A.k),D.invert(V).concat(Y/D.k));return function(z){if(z===1)z=D;else{var B=$(z),U=Y/B[2];z=new je(U,V[0]-B[0]*U,V[1]-B[1]*U)}H.zoom(null,z)}})}function w(S,T,M){return!M&&S.__zooming||new E(S,T)}function E(S,T){this.that=S,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,T),this.taps=0}E.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,T){return this.mouse&&S!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var T=ge(this.that).datum();c.call(S,this.that,new Fw(S,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:c}),T)}};function I(S,...T){if(!e.apply(this,arguments))return;var M=w(this,T).event(S),j=this.__zoom,O=Math.max(a[0],Math.min(a[1],j.k*Math.pow(2,n.apply(this,arguments)))),k=_e(S);if(M.wheel)(M.mouse[0][0]!==k[0]||M.mouse[0][1]!==k[1])&&(M.mouse[1]=j.invert(M.mouse[0]=k)),clearTimeout(M.wheel);else{if(j.k===O)return;M.mouse=[k,j.invert(k)],br(this),M.start()}Nt(S),M.wheel=setTimeout(H,g),M.zoom("mouse",r(p(b(j,O),M.mouse[0],M.mouse[1]),M.extent,o));function H(){M.wheel=null,M.end()}}function q(S,...T){if(d||!e.apply(this,arguments))return;var M=S.currentTarget,j=w(this,T,!0).event(S),O=ge(S.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",Y,!0),k=_e(S,M),H=S.clientX,G=S.clientY;jv(S.view),pn(S),j.mouse=[k,this.__zoom.invert(k)],br(this),j.start();function V(A){if(Nt(A),!j.moved){var D=A.clientX-H,$=A.clientY-G;j.moved=D*D+$*$>m}j.event(A).zoom("mouse",r(p(j.that.__zoom,j.mouse[0]=_e(A,M),j.mouse[1]),j.extent,o))}function Y(A){O.on("mousemove.zoom mouseup.zoom",null),Fv(A.view,j.moved),Nt(A),j.event(A).end()}}function R(S,...T){if(e.apply(this,arguments)){var M=this.__zoom,j=_e(S.changedTouches?S.changedTouches[0]:S,this),O=M.invert(j),k=M.k*(S.shiftKey?.5:2),H=r(p(b(M,k),j,O),t.apply(this,T),o);Nt(S),s>0?ge(this).transition().duration(s).call(x,H,j,S):ge(this).call(y.transform,H,j,S)}}function C(S,...T){if(e.apply(this,arguments)){var M=S.touches,j=M.length,O=w(this,T,S.changedTouches.length===j).event(S),k,H,G,V;for(pn(S),H=0;H<j;++H)G=M[H],V=_e(G,this),V=[V,this.__zoom.invert(V),G.identifier],O.touch0?!O.touch1&&O.touch0[2]!==V[2]&&(O.touch1=V,O.taps=0):(O.touch0=V,k=!0,O.taps=1+!!f);f&&(f=clearTimeout(f)),k&&(O.taps<2&&(l=V[0],f=setTimeout(function(){f=null},h)),br(this),O.start())}}function N(S,...T){if(this.__zooming){var M=w(this,T).event(S),j=S.changedTouches,O=j.length,k,H,G,V;for(Nt(S),k=0;k<O;++k)H=j[k],G=_e(H,this),M.touch0&&M.touch0[2]===H.identifier?M.touch0[0]=G:M.touch1&&M.touch1[2]===H.identifier&&(M.touch1[0]=G);if(H=M.that.__zoom,M.touch1){var Y=M.touch0[0],A=M.touch0[1],D=M.touch1[0],$=M.touch1[1],z=(z=D[0]-Y[0])*z+(z=D[1]-Y[1])*z,B=(B=$[0]-A[0])*B+(B=$[1]-A[1])*B;H=b(H,Math.sqrt(z/B)),G=[(Y[0]+D[0])/2,(Y[1]+D[1])/2],V=[(A[0]+$[0])/2,(A[1]+$[1])/2]}else if(M.touch0)G=M.touch0[0],V=M.touch0[1];else return;M.zoom("touch",r(p(H,G,V),M.extent,o))}}function L(S,...T){if(this.__zooming){var M=w(this,T).event(S),j=S.changedTouches,O=j.length,k,H;for(pn(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),k=0;k<O;++k)H=j[k],M.touch0&&M.touch0[2]===H.identifier?delete M.touch0:M.touch1&&M.touch1[2]===H.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(H=_e(H,this),Math.hypot(l[0]-H[0],l[1]-H[1])<v)){var G=ge(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return y.wheelDelta=function(S){return arguments.length?(n=typeof S=="function"?S:lr(+S),y):n},y.filter=function(S){return arguments.length?(e=typeof S=="function"?S:lr(!!S),y):e},y.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:lr(!!S),y):i},y.extent=function(S){return arguments.length?(t=typeof S=="function"?S:lr([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),y):t},y.scaleExtent=function(S){return arguments.length?(a[0]=+S[0],a[1]=+S[1],y):[a[0],a[1]]},y.translateExtent=function(S){return arguments.length?(o[0][0]=+S[0][0],o[1][0]=+S[1][0],o[0][1]=+S[0][1],o[1][1]=+S[1][1],y):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},y.constrain=function(S){return arguments.length?(r=S,y):r},y.duration=function(S){return arguments.length?(s=+S,y):s},y.interpolate=function(S){return arguments.length?(u=S,y):u},y.on=function(){var S=c.on.apply(c,arguments);return S===c?y:S},y.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,y):Math.sqrt(m)},y.tapDistance=function(S){return arguments.length?(v=+S,y):v},y}const Ae={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:n})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:n}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},$t=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ry=["Enter"," ","Escape"],ny={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var yt;(function(e){e.Strict="strict",e.Loose="loose"})(yt||(yt={}));var et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(et||(et={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));const iy={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Xe;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Xe||(Xe={}));var Bt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bt||(Bt={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const lf={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function ay(e){return e===null?null:e?"valid":"invalid"}const oy=e=>"id"in e&&"source"in e&&"target"in e,Gw=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),lc=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Wt=(e,t=[0,0])=>{const{width:r,height:n}=ze(e),i=e.origin??t,a=r*i[0],o=n*i[1];return{x:e.position.x-a,y:e.position.y-o}},Uw=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((n,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):lc(i)?i:t.nodeLookup.get(i.id));const s=o?Nr(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return jr(n,s)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Fr(r)},Xt=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(r=jr(r,Nr(i)),n=!0)}),n?Fr(r):{x:0,y:0,width:0,height:0}},dc=(e,t,[r,n,i]=[0,0,1],a=!1,o=!1)=>{const s={...Zt(t,[r,n,i]),width:t.width/i,height:t.height/i},u=[];for(const c of e.values()){const{measured:f,selectable:l=!0,hidden:d=!1}=c;if(o&&!l||d)continue;const h=f.width??c.width??c.initialWidth??null,g=f.height??c.height??c.initialHeight??null,m=Ht(s,_t(c)),v=(h??0)*(g??0),y=a&&m>0;(!c.internals.handleBounds||y||m>=v||c.dragging)&&u.push(c)}return u},Yw=(e,t)=>{const r=new Set;return e.forEach(n=>{r.add(n.id)}),t.filter(n=>r.has(n.source)||r.has(n.target))};function Ww(e,t){const r=new Map,n=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!n||n.has(i.id))&&r.set(i.id,i)}),r}async function Xw({nodes:e,width:t,height:r,panZoom:n,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const s=Ww(e,o),u=Xt(s),c=hc(u,t,r,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await n.setViewport(c,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function sy({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:n=[0,0],nodeExtent:i,onError:a}){const o=r.get(e),s=o.parentId?r.get(o.parentId):void 0,{x:u,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},f=o.origin??n;let l=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!s)a==null||a("005",Ae.error005());else{const h=s.measured.width,g=s.measured.height;h&&g&&(l=[[u,c],[u+h,c+g]])}else s&&bt(o.extent)&&(l=[[o.extent[0][0]+u,o.extent[0][1]+c],[o.extent[1][0]+u,o.extent[1][1]+c]]);const d=bt(l)?nt(t,l,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Ae.error015())),{position:{x:d.x-u+(o.measured.width??0)*f[0],y:d.y-c+(o.measured.height??0)*f[1]},positionAbsolute:d}}async function Kw({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:n,onBeforeDelete:i}){const a=new Set(e.map(d=>d.id)),o=[];for(const d of r){if(d.deletable===!1)continue;const h=a.has(d.id),g=!h&&d.parentId&&o.find(m=>m.id===d.parentId);(h||g)&&o.push(d)}const s=new Set(t.map(d=>d.id)),u=n.filter(d=>d.deletable!==!1),f=Yw(o,u);for(const d of u)s.has(d.id)&&!f.find(g=>g.id===d.id)&&f.push(d);if(!i)return{edges:f,nodes:o};const l=await i({nodes:o,edges:f});return typeof l=="boolean"?l?{edges:f,nodes:o}:{edges:[],nodes:[]}:l}const mt=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),nt=(e={x:0,y:0},t,r)=>({x:mt(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:mt(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function uy(e,t,r){const{width:n,height:i}=ze(r),{x:a,y:o}=r.internals.positionAbsolute;return nt(e,[[a,o],[a+n,o+i]],t)}const df=(e,t,r)=>e<t?mt(Math.abs(e-t),1,t)/t:e>r?-mt(Math.abs(e-r),1,t)/t:0,cy=(e,t,r=15,n=40)=>{const i=df(e.x,n,t.width-n)*r,a=df(e.y,n,t.height-n)*r;return[i,a]},jr=(e,t)=>({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)}),Zu=({x:e,y:t,width:r,height:n})=>({x:e,y:t,x2:e+r,y2:t+n}),Fr=({x:e,y:t,x2:r,y2:n})=>({x:e,y:t,width:r-e,height:n-t}),_t=(e,t=[0,0])=>{var i,a;const{x:r,y:n}=lc(e)?e.internals.positionAbsolute:Wt(e,t);return{x:r,y:n,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Nr=(e,t=[0,0])=>{var i,a;const{x:r,y:n}=lc(e)?e.internals.positionAbsolute:Wt(e,t);return{x:r,y:n,x2:r+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:n+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},fy=(e,t)=>Fr(jr(Zu(e),Zu(t))),Ht=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),n=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*n)},hf=e=>xe(e.width)&&xe(e.height)&&xe(e.x)&&xe(e.y),xe=e=>!isNaN(e)&&isFinite(e),Zw=(e,t)=>{},Kt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zt=({x:e,y:t},[r,n,i],a=!1,o=[1,1])=>{const s={x:(e-r)/i,y:(t-n)/i};return a?Kt(s,o):s},Rr=({x:e,y:t},[r,n,i])=>({x:e*i+r,y:t*i+n});function ft(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qw(e,t,r){if(typeof e=="string"||typeof e=="number"){const n=ft(e,r),i=ft(e,t);return{top:n,right:i,bottom:n,left:i,x:i*2,y:n*2}}if(typeof e=="object"){const n=ft(e.top??e.y??0,r),i=ft(e.bottom??e.y??0,r),a=ft(e.left??e.x??0,t),o=ft(e.right??e.x??0,t);return{top:n,right:o,bottom:i,left:a,x:a+o,y:n+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Jw(e,t,r,n,i,a){const{x:o,y:s}=Rr(e,[t,r,n]),{x:u,y:c}=Rr({x:e.x+e.width,y:e.y+e.height},[t,r,n]),f=i-u,l=a-c;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(f),bottom:Math.floor(l)}}const hc=(e,t,r,n,i,a)=>{const o=Qw(a,t,r),s=(t-o.x)/e.width,u=(r-o.y)/e.height,c=Math.min(s,u),f=mt(c,n,i),l=e.x+e.width/2,d=e.y+e.height/2,h=t/2-l*f,g=r/2-d*f,m=Jw(e,h,g,f,t,r),v={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:h-v.left+v.right,y:g-v.top+v.bottom,zoom:f}},Vt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function bt(e){return e!=null&&e!=="parent"}function ze(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function ly(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function dy(e,t={width:0,height:0},r,n,i){const a={...e},o=n.get(r);if(o){const s=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*s[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*s[1]}return a}function pf(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function e1(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}function t1(e){return{...ny,...e||{}}}function Lt(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:n,containerBounds:i}){const{x:a,y:o}=we(e),s=Zt({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},n),{x:u,y:c}=r?Kt(s,t):s;return{xSnapped:u,ySnapped:c,...s}}const pc=e=>({width:e.offsetWidth,height:e.offsetHeight}),hy=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},r1=["INPUT","SELECT","TEXTAREA"];function py(e){var n,i;const t=((i=(n=e.composedPath)==null?void 0:n.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:r1.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const gy=e=>"clientX"in e,we=(e,t)=>{var a,o;const r=gy(e),n=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=r?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:n-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},gf=(e,t,r,n,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const s=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(s.left-r.left)/n,y:(s.top-r.top)/n,...pc(o)}})};function vy({sourceX:e,sourceY:t,targetX:r,targetY:n,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){const u=e*.125+i*.375+o*.375+r*.125,c=t*.125+a*.375+s*.375+n*.125,f=Math.abs(u-e),l=Math.abs(c-t);return[u,c,f,l]}function dr(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function vf({pos:e,x1:t,y1:r,x2:n,y2:i,c:a}){switch(e){case Q.Left:return[t-dr(t-n,a),r];case Q.Right:return[t+dr(n-t,a),r];case Q.Top:return[t,r-dr(r-i,a)];case Q.Bottom:return[t,r+dr(i-r,a)]}}function yy({sourceX:e,sourceY:t,sourcePosition:r=Q.Bottom,targetX:n,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){const[s,u]=vf({pos:r,x1:e,y1:t,x2:n,y2:i,c:o}),[c,f]=vf({pos:a,x1:n,y1:i,x2:e,y2:t,c:o}),[l,d,h,g]=vy({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:s,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${e},${t} C${s},${u} ${c},${f} ${n},${i}`,l,d,h,g]}function my({sourceX:e,sourceY:t,targetX:r,targetY:n}){const i=Math.abs(r-e)/2,a=r<e?r+i:r-i,o=Math.abs(n-t)/2,s=n<t?n+o:n-o;return[a,s,i,o]}function n1({sourceNode:e,targetNode:t,selected:r=!1,zIndex:n=0,elevateOnSelect:i=!1,zIndexMode:a="basic"}){if(a==="manual")return n;const o=i&&r?n+1e3:n,s=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+s}function i1({sourceNode:e,targetNode:t,width:r,height:n,transform:i}){const a=jr(Nr(e),Nr(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:n/i[2]};return Ht(o,Fr(a))>0}const a1=({source:e,sourceHandle:t,target:r,targetHandle:n})=>`xy-edge__${e}${t||""}-${r}${n||""}`,o1=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),s1=(e,t,r={})=>{if(!e.source||!e.target)return t;const n=r.getEdgeId||a1;let i;return oy(e)?i={...e}:i={...e,id:n(e)},o1(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function _y({sourceX:e,sourceY:t,targetX:r,targetY:n}){const[i,a,o,s]=my({sourceX:e,sourceY:t,targetX:r,targetY:n});return[`M ${e},${t}L ${r},${n}`,i,a,o,s]}const yf={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},u1=({source:e,sourcePosition:t=Q.Bottom,target:r})=>t===Q.Left||t===Q.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},mf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function c1({source:e,sourcePosition:t=Q.Bottom,target:r,targetPosition:n=Q.Top,center:i,offset:a,stepPosition:o}){const s=yf[t],u=yf[n],c={x:e.x+s.x*a,y:e.y+s.y*a},f={x:r.x+u.x*a,y:r.y+u.y*a},l=u1({source:c,sourcePosition:t,target:f}),d=l.x!==0?"x":"y",h=l[d];let g=[],m,v;const y={x:0,y:0},b={x:0,y:0},[,,p,_]=my({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(s[d]*u[d]===-1){d==="x"?(m=i.x??c.x+(f.x-c.x)*o,v=i.y??(c.y+f.y)/2):(m=i.x??(c.x+f.x)/2,v=i.y??c.y+(f.y-c.y)*o);const w=[{x:m,y:c.y},{x:m,y:f.y}],E=[{x:c.x,y:v},{x:f.x,y:v}];s[d]===h?g=d==="x"?w:E:g=d==="x"?E:w}else{const w=[{x:c.x,y:f.y}],E=[{x:f.x,y:c.y}];if(d==="x"?g=s.x===h?E:w:g=s.y===h?w:E,t===n){const N=Math.abs(e[d]-r[d]);if(N<=a){const L=Math.min(a-1,a-N);s[d]===h?y[d]=(c[d]>e[d]?-1:1)*L:b[d]=(f[d]>r[d]?-1:1)*L}}if(t!==n){const N=d==="x"?"y":"x",L=s[d]===u[N],S=c[N]>f[N],T=c[N]<f[N];(s[d]===1&&(!L&&S||L&&T)||s[d]!==1&&(!L&&T||L&&S))&&(g=d==="x"?w:E)}const I={x:c.x+y.x,y:c.y+y.y},q={x:f.x+b.x,y:f.y+b.y},R=Math.max(Math.abs(I.x-g[0].x),Math.abs(q.x-g[0].x)),C=Math.max(Math.abs(I.y-g[0].y),Math.abs(q.y-g[0].y));R>=C?(m=(I.x+q.x)/2,v=g[0].y):(m=g[0].x,v=(I.y+q.y)/2)}return[[e,{x:c.x+y.x,y:c.y+y.y},...g,{x:f.x+b.x,y:f.y+b.y},r],m,v,p,_]}function f1(e,t,r,n){const i=Math.min(mf(e,t)/2,mf(t,r)/2,n),{x:a,y:o}=t;if(e.x===a&&a===r.x||e.y===o&&o===r.y)return`L${a} ${o}`;if(e.y===o){const c=e.x<r.x?-1:1,f=e.y<r.y?1:-1;return`L ${a+i*c},${o}Q ${a},${o} ${a},${o+i*f}`}const s=e.x<r.x?1:-1,u=e.y<r.y?-1:1;return`L ${a},${o+i*u}Q ${a},${o} ${a+i*s},${o}`}function Qu({sourceX:e,sourceY:t,sourcePosition:r=Q.Bottom,targetX:n,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:u,offset:c=20,stepPosition:f=.5}){const[l,d,h,g,m]=c1({source:{x:e,y:t},sourcePosition:r,target:{x:n,y:i},targetPosition:a,center:{x:s,y:u},offset:c,stepPosition:f});return[l.reduce((y,b,p)=>{let _="";return p>0&&p<l.length-1?_=f1(l[p-1],b,l[p+1],o):_=`${p===0?"M":"L"}${b.x} ${b.y}`,y+=_,y},""),d,h,g,m]}function _f(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function l1(e){var l;const{sourceNode:t,targetNode:r}=e;if(!_f(t)||!_f(r))return null;const n=t.internals.handleBounds||bf(t.handles),i=r.internals.handleBounds||bf(r.handles),a=xf((n==null?void 0:n.source)??[],e.sourceHandle),o=xf(e.connectionMode===yt.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(l=e.onError)==null||l.call(e,"008",Ae.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=(a==null?void 0:a.position)||Q.Bottom,u=(o==null?void 0:o.position)||Q.Top,c=it(t,a,s),f=it(r,o,u);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:s,targetPosition:u}}function bf(e){if(!e)return null;const t=[],r=[];for(const n of e)n.width=n.width??1,n.height=n.height??1,n.type==="source"?t.push(n):n.type==="target"&&r.push(n);return{source:t,target:r}}function it(e,t,r=Q.Left,n=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??ze(e);if(n)return{x:i+o/2,y:a+s/2};switch((t==null?void 0:t.position)??r){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function xf(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function Ju(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function d1(e,{id:t,defaultColor:r,defaultMarkerStart:n,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,s)=>([s.markerStart||n,s.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const c=Ju(u,t);a.has(c)||(o.push({id:c,color:u.color||r,...u}),a.add(c))}}),o),[]).sort((o,s)=>o.id.localeCompare(s.id))}const by=1e3,h1=10,gc={nodeOrigin:[0,0],nodeExtent:$t,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},p1={...gc,checkEquality:!0};function vc(e,t){const r={...e};for(const n in t)t[n]!==void 0&&(r[n]=t[n]);return r}function g1(e,t,r){const n=vc(gc,r);for(const i of e.values())if(i.parentId)mc(i,e,t,n);else{const a=Wt(i,n.nodeOrigin),o=bt(i.extent)?i.extent:n.nodeExtent,s=nt(a,o,ze(i));i.internals.positionAbsolute=s}}function v1(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],n=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?r.push(a):i.type==="target"&&n.push(a)}return{source:r,target:n}}function yc(e){return e==="manual"}function ec(e,t,r,n={}){var c,f;const i=vc(p1,n),a={i:0},o=new Map(t),s=i!=null&&i.elevateNodesOnSelect&&!yc(i.zIndexMode)?by:0;let u=e.length>0;t.clear(),r.clear();for(const l of e){let d=o.get(l.id);if(i.checkEquality&&l===(d==null?void 0:d.internals.userNode))t.set(l.id,d);else{const h=Wt(l,i.nodeOrigin),g=bt(l.extent)?l.extent:i.nodeExtent,m=nt(h,g,ze(l));d={...i.defaults,...l,measured:{width:(c=l.measured)==null?void 0:c.width,height:(f=l.measured)==null?void 0:f.height},internals:{positionAbsolute:m,handleBounds:v1(l,d),z:xy(l,s,i.zIndexMode),userNode:l}},t.set(l.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(u=!1),l.parentId&&mc(d,t,r,n,a)}return u}function y1(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function mc(e,t,r,n,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:u}=vc(gc,n),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}y1(e,r),i&&!f.parentId&&f.internals.rootParentIndex===void 0&&u==="auto"&&(f.internals.rootParentIndex=++i.i,f.internals.z=f.internals.z+i.i*h1),i&&f.internals.rootParentIndex!==void 0&&(i.i=f.internals.rootParentIndex);const l=a&&!yc(u)?by:0,{x:d,y:h,z:g}=m1(e,f,o,s,l,u),{positionAbsolute:m}=e.internals,v=d!==m.x||h!==m.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:h}:m,z:g}})}function xy(e,t,r){const n=xe(e.zIndex)?e.zIndex:0;return yc(r)?n:n+(e.selected?t:0)}function m1(e,t,r,n,i,a){const{x:o,y:s}=t.internals.positionAbsolute,u=ze(e),c=Wt(e,r),f=bt(e.extent)?nt(c,e.extent,u):c;let l=nt({x:o+f.x,y:s+f.y},n,u);e.extent==="parent"&&(l=uy(l,u,t));const d=xy(e,i,a),h=t.internals.z??0;return{x:l.x,y:l.y,z:h>=d?h+1:d}}function _c(e,t,r,n=[0,0]){var o;const i=[],a=new Map;for(const s of e){const u=t.get(s.parentId);if(!u)continue;const c=((o=a.get(s.parentId))==null?void 0:o.expandedRect)??_t(u),f=fy(c,s.rect);a.set(s.parentId,{expandedRect:f,parent:u})}return a.size>0&&a.forEach(({expandedRect:s,parent:u},c)=>{var p;const f=u.internals.positionAbsolute,l=ze(u),d=u.origin??n,h=s.x<f.x?Math.round(Math.abs(f.x-s.x)):0,g=s.y<f.y?Math.round(Math.abs(f.y-s.y)):0,m=Math.max(l.width,Math.round(s.width)),v=Math.max(l.height,Math.round(s.height)),y=(m-l.width)*d[0],b=(v-l.height)*d[1];(h>0||g>0||y||b)&&(i.push({id:c,type:"position",position:{x:u.position.x-h+y,y:u.position.y-g+b}}),(p=r.get(c))==null||p.forEach(_=>{e.some(x=>x.id===_.id)||i.push({id:_.id,type:"position",position:{x:_.position.x+h,y:_.position.y+g}})})),(l.width<s.width||l.height<s.height||h||g)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?d[0]*h-y:0),height:v+(g?d[1]*g-b:0)}})}),i}function _1(e,t,r,n,i,a,o){const s=n==null?void 0:n.querySelector(".xyflow__viewport");let u=!1;if(!s)return{changes:[],updatedInternals:u};const c=[],f=window.getComputedStyle(s),{m22:l}=new window.DOMMatrixReadOnly(f.transform),d=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),u=!0;continue}const m=pc(h.nodeElement),v=g.measured.width!==m.width||g.measured.height!==m.height;if(!!(m.width&&m.height&&(v||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),p=bt(g.extent)?g.extent:a;let{positionAbsolute:_}=g.internals;g.parentId&&g.extent==="parent"?_=uy(_,m,t.get(g.parentId)):p&&(_=nt(_,p,m));const x={...g,measured:m,internals:{...g.internals,positionAbsolute:_,handleBounds:{source:gf("source",h.nodeElement,b,l,g.id),target:gf("target",h.nodeElement,b,l,g.id)}}};t.set(g.id,x),g.parentId&&mc(x,t,r,{nodeOrigin:i,zIndexMode:o}),u=!0,v&&(c.push({id:g.id,type:"dimensions",dimensions:m}),g.expandParent&&g.parentId&&d.push({id:g.id,parentId:g.parentId,rect:_t(x,i)}))}}if(d.length>0){const h=_c(d,t,r,i);c.push(...h)}return{changes:c,updatedInternals:u}}async function b1({delta:e,panZoom:t,transform:r,translateExtent:n,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,a]],n),s=!!o&&(o.x!==r[0]||o.y!==r[1]||o.k!==r[2]);return Promise.resolve(s)}function wf(e,t,r,n,i,a){let o=i;const s=n.get(o)||new Map;n.set(o,s.set(r,t)),o=`${i}-${e}`;const u=n.get(o)||new Map;if(n.set(o,u.set(r,t)),a){o=`${i}-${e}-${a}`;const c=n.get(o)||new Map;n.set(o,c.set(r,t))}}function wy(e,t,r){e.clear(),t.clear();for(const n of r){const{source:i,target:a,sourceHandle:o=null,targetHandle:s=null}=n,u={edgeId:n.id,source:i,target:a,sourceHandle:o,targetHandle:s},c=`${i}-${o}--${a}-${s}`,f=`${a}-${s}--${i}-${o}`;wf("source",u,f,e,i,o),wf("target",u,c,e,a,s),t.set(n.id,n)}}function Ey(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:Ey(r,t):!1}function Ef(e,t,r){var i;let n=e;do{if((i=n==null?void 0:n.matches)!=null&&i.call(n,t))return!0;if(n===r)return!1;n=n==null?void 0:n.parentElement}while(n);return!1}function x1(e,t,r,n){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===n)&&(!o.parentId||!Ey(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const s=e.get(a);s&&i.set(a,{id:a,position:s.position||{x:0,y:0},distance:{x:r.x-s.internals.positionAbsolute.x,y:r.y-s.internals.positionAbsolute.y},extent:s.extent,parentId:s.parentId,origin:s.origin,expandParent:s.expandParent,internals:{positionAbsolute:s.internals.positionAbsolute||{x:0,y:0}},measured:{width:s.measured.width??0,height:s.measured.height??0}})}return i}function gn({nodeId:e,dragItems:t,nodeLookup:r,dragging:n=!0}){var o,s,u;const i=[];for(const[c,f]of t){const l=(o=r.get(c))==null?void 0:o.internals.userNode;l&&i.push({...l,position:f.position,dragging:n})}if(!e)return[i[0],i];const a=(s=r.get(e))==null?void 0:s.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:n}:i[0],i]}function w1({dragItems:e,snapGrid:t,x:r,y:n}){const i=e.values().next().value;if(!i)return null;const a={x:r-i.distance.x,y:n-i.distance.y},o=Kt(a,t);return{x:o.x-a.x,y:o.y-a.y}}function E1({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:n,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,u=!1,c={x:0,y:0},f=null,l=!1,d=null,h=!1,g=!1,m=null;function v({noDragClassName:b,handleSelector:p,domNode:_,isSelectable:x,nodeId:w,nodeClickDistance:E=0}){d=ge(_);function I({x:N,y:L}){const{nodeLookup:S,nodeExtent:T,snapGrid:M,snapToGrid:j,nodeOrigin:O,onNodeDrag:k,onSelectionDrag:H,onError:G,updateNodePositions:V}=t();a={x:N,y:L};let Y=!1;const A=s.size>1,D=A&&T?Zu(Xt(s)):null,$=A&&j?w1({dragItems:s,snapGrid:M,x:N,y:L}):null;for(const[z,B]of s){if(!S.has(z))continue;let U={x:N-B.distance.x,y:L-B.distance.y};j&&(U=$?{x:Math.round(U.x+$.x),y:Math.round(U.y+$.y)}:Kt(U,M));let X=null;if(A&&T&&!B.extent&&D){const{positionAbsolute:W}=B.internals,te=W.x-D.x+T[0][0],Z=W.x+B.measured.width-D.x2+T[1][0],re=W.y-D.y+T[0][1],ee=W.y+B.measured.height-D.y2+T[1][1];X=[[te,re],[Z,ee]]}const{position:K,positionAbsolute:J}=sy({nodeId:z,nextPosition:U,nodeLookup:S,nodeExtent:X||T,nodeOrigin:O,onError:G});Y=Y||B.position.x!==K.x||B.position.y!==K.y,B.position=K,B.internals.positionAbsolute=J}if(g=g||Y,!!Y&&(V(s,!0),m&&(n||k||!w&&H))){const[z,B]=gn({nodeId:w,dragItems:s,nodeLookup:S});n==null||n(m,s,z,B),k==null||k(m,z,B),w||H==null||H(m,B)}}async function q(){if(!f)return;const{transform:N,panBy:L,autoPanSpeed:S,autoPanOnNodeDrag:T}=t();if(!T){u=!1,cancelAnimationFrame(o);return}const[M,j]=cy(c,f,S);(M!==0||j!==0)&&(a.x=(a.x??0)-M/N[2],a.y=(a.y??0)-j/N[2],await L({x:M,y:j})&&I(a)),o=requestAnimationFrame(q)}function R(N){var A;const{nodeLookup:L,multiSelectionActive:S,nodesDraggable:T,transform:M,snapGrid:j,snapToGrid:O,selectNodesOnDrag:k,onNodeDragStart:H,onSelectionDragStart:G,unselectNodesAndEdges:V}=t();l=!0,(!k||!x)&&!S&&w&&((A=L.get(w))!=null&&A.selected||V()),x&&k&&w&&(e==null||e(w));const Y=Lt(N.sourceEvent,{transform:M,snapGrid:j,snapToGrid:O,containerBounds:f});if(a=Y,s=x1(L,T,Y,w),s.size>0&&(r||H||!w&&G)){const[D,$]=gn({nodeId:w,dragItems:s,nodeLookup:L});r==null||r(N.sourceEvent,s,D,$),H==null||H(N.sourceEvent,D,$),w||G==null||G(N.sourceEvent,$)}}const C=$v().clickDistance(E).on("start",N=>{const{domNode:L,nodeDragThreshold:S,transform:T,snapGrid:M,snapToGrid:j}=t();f=(L==null?void 0:L.getBoundingClientRect())||null,h=!1,g=!1,m=N.sourceEvent,S===0&&R(N),a=Lt(N.sourceEvent,{transform:T,snapGrid:M,snapToGrid:j,containerBounds:f}),c=we(N.sourceEvent,f)}).on("drag",N=>{const{autoPanOnNodeDrag:L,transform:S,snapGrid:T,snapToGrid:M,nodeDragThreshold:j,nodeLookup:O}=t(),k=Lt(N.sourceEvent,{transform:S,snapGrid:T,snapToGrid:M,containerBounds:f});if(m=N.sourceEvent,(N.sourceEvent.type==="touchmove"&&N.sourceEvent.touches.length>1||w&&!O.has(w))&&(h=!0),!h){if(!u&&L&&l&&(u=!0,q()),!l){const H=we(N.sourceEvent,f),G=H.x-c.x,V=H.y-c.y;Math.sqrt(G*G+V*V)>j&&R(N)}(a.x!==k.xSnapped||a.y!==k.ySnapped)&&s&&l&&(c=we(N.sourceEvent,f),I(k))}}).on("end",N=>{if(!(!l||h)&&(u=!1,l=!1,cancelAnimationFrame(o),s.size>0)){const{nodeLookup:L,updateNodePositions:S,onNodeDragStop:T,onSelectionDragStop:M}=t();if(g&&(S(s,!1),g=!1),i||T||!w&&M){const[j,O]=gn({nodeId:w,dragItems:s,nodeLookup:L,dragging:!1});i==null||i(N.sourceEvent,s,j,O),T==null||T(N.sourceEvent,j,O),w||M==null||M(N.sourceEvent,O)}}}).filter(N=>{const L=N.target;return!N.button&&(!b||!Ef(L,`.${b}`,_))&&(!p||Ef(L,p,_))});d.call(C)}function y(){d==null||d.on(".drag",null)}return{update:v,destroy:y}}function S1(e,t,r){const n=[],i={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const a of t.values())Ht(i,_t(a))>0&&n.push(a);return n}const C1=250;function q1(e,t,r,n){var s,u;let i=[],a=1/0;const o=S1(e,r,t+C1);for(const c of o){const f=[...((s=c.internals.handleBounds)==null?void 0:s.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const l of f){if(n.nodeId===l.nodeId&&n.type===l.type&&n.id===l.id)continue;const{x:d,y:h}=it(c,l,l.position,!0),g=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));g>t||(g<a?(i=[{...l,x:d,y:h}],a=g):g===a&&i.push({...l,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){const c=n.type==="source"?"target":"source";return i.find(f=>f.type===c)??i[0]}return i[0]}function Sy(e,t,r,n,i,a=!1){var c,f,l;const o=n.get(e);if(!o)return null;const s=i==="strict"?(c=o.internals.handleBounds)==null?void 0:c[t]:[...((f=o.internals.handleBounds)==null?void 0:f.source)??[],...((l=o.internals.handleBounds)==null?void 0:l.target)??[]],u=(r?s==null?void 0:s.find(d=>d.id===r):s==null?void 0:s[0])??null;return u&&a?{...u,...it(o,u,u.position,!0)}:u}function Cy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function I1(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const qy=()=>!0;function N1(e,{connectionMode:t,connectionRadius:r,handleId:n,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:u,lib:c,autoPanOnConnect:f,flowId:l,panBy:d,cancelConnection:h,onConnectStart:g,onConnect:m,onConnectEnd:v,isValidConnection:y=qy,onReconnectEnd:b,updateConnection:p,getTransform:_,getFromHandle:x,autoPanSpeed:w,dragThreshold:E=1,handleDomNode:I}){const q=hy(e.target);let R=0,C;const{x:N,y:L}=we(e),S=Cy(a,I),T=s==null?void 0:s.getBoundingClientRect();let M=!1;if(!T||!S)return;const j=Sy(i,S,n,u,t);if(!j)return;let O=we(e,T),k=!1,H=null,G=!1,V=null;function Y(){if(!f||!T)return;const[K,J]=cy(O,T,w);d({x:K,y:J}),R=requestAnimationFrame(Y)}const A={...j,nodeId:i,type:S,position:j.position},D=u.get(i);let z={inProgress:!0,isValid:null,from:it(D,A,Q.Left,!0),fromHandle:A,fromPosition:A.position,fromNode:D,to:O,toHandle:null,toPosition:lf[A.position],toNode:null,pointer:O};function B(){M=!0,p(z),g==null||g(e,{nodeId:i,handleId:n,handleType:S})}E===0&&B();function U(K){if(!M){const{x:ee,y:le}=we(K),fe=ee-N,ke=le-L;if(!(fe*fe+ke*ke>E*E))return;B()}if(!x()||!A){X(K);return}const J=_();O=we(K,T),C=q1(Zt(O,J,!1,[1,1]),r,u,A),k||(Y(),k=!0);const W=Iy(K,{handle:C,connectionMode:t,fromNodeId:i,fromHandleId:n,fromType:o?"target":"source",isValidConnection:y,doc:q,lib:c,flowId:l,nodeLookup:u});V=W.handleDomNode,H=W.connection,G=I1(!!C,W.isValid);const te=u.get(i),Z=te?it(te,A,Q.Left,!0):z.from,re={...z,from:Z,isValid:G,to:W.toHandle&&G?Rr({x:W.toHandle.x,y:W.toHandle.y},J):O,toHandle:W.toHandle,toPosition:G&&W.toHandle?W.toHandle.position:lf[A.position],toNode:W.toHandle?u.get(W.toHandle.nodeId):null,pointer:O};p(re),z=re}function X(K){if(!("touches"in K&&K.touches.length>0)){if(M){(C||V)&&H&&G&&(m==null||m(H));const{inProgress:J,...W}=z,te={...W,toPosition:z.toHandle?z.toPosition:null};v==null||v(K,te),a&&(b==null||b(K,te))}h(),cancelAnimationFrame(R),k=!1,G=!1,H=null,V=null,q.removeEventListener("mousemove",U),q.removeEventListener("mouseup",X),q.removeEventListener("touchmove",U),q.removeEventListener("touchend",X)}}q.addEventListener("mousemove",U),q.addEventListener("mouseup",X),q.addEventListener("touchmove",U),q.addEventListener("touchend",X)}function Iy(e,{handle:t,connectionMode:r,fromNodeId:n,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:u,isValidConnection:c=qy,nodeLookup:f}){const l=a==="target",d=t?o.querySelector(`.${s}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:g}=we(e),m=o.elementFromPoint(h,g),v=m!=null&&m.classList.contains(`${s}-flow__handle`)?m:d,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const b=Cy(void 0,v),p=v.getAttribute("data-nodeid"),_=v.getAttribute("data-handleid"),x=v.classList.contains("connectable"),w=v.classList.contains("connectableend");if(!p||!b)return y;const E={source:l?p:n,sourceHandle:l?_:i,target:l?n:p,targetHandle:l?i:_};y.connection=E;const q=x&&w&&(r===yt.Strict?l&&b==="source"||!l&&b==="target":p!==n||_!==i);y.isValid=q&&c(E),y.toHandle=Sy(p,b,_,f,r,!0)}return y}const tc={onPointerDown:N1,isValid:Iy};function R1({domNode:e,panZoom:t,getTransform:r,getViewScale:n}){const i=ge(e);function a({translateExtent:s,width:u,height:c,zoomStep:f=1,pannable:l=!0,zoomable:d=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const _=r(),x=p.sourceEvent.ctrlKey&&Vt()?10:1,w=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*f,E=_[2]*Math.pow(2,w*x);t.scaleTo(E)};let m=[0,0];const v=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(m=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},y=p=>{const _=r();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const x=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],w=[x[0]-m[0],x[1]-m[1]];m=x;const E=n()*Math.max(_[2],Math.log(_[2]))*(h?-1:1),I={x:_[0]-w[0]*E,y:_[1]-w[1]*E},q=[[0,0],[u,c]];t.setViewportConstrained({x:I.x,y:I.y,zoom:_[2]},q,s)},b=ty().on("start",v).on("zoom",l?y:null).on("zoom.wheel",d?g:null);i.call(b,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:_e}}const $r=e=>({x:e.x,y:e.y,zoom:e.k}),vn=({x:e,y:t,zoom:r})=>Dr.translate(e,t).scale(r),lt=(e,t)=>e.target.closest(`.${t}`),Ny=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),A1=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yn=(e,t=0,r=A1,n=()=>{})=>{const i=typeof t=="number"&&t>0;return i||n(),i?e.transition().duration(t).ease(r).on("end",n):e},Ry=e=>{const t=e.ctrlKey&&Vt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function M1({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:n,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:u,onPanZoomEnd:c}){return f=>{if(lt(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const l=r.property("__zoom").k||1;if(f.ctrlKey&&o){const v=_e(f),y=Ry(f),b=l*Math.pow(2,y);n.scaleTo(r,b,v,f);return}const d=f.deltaMode===1?20:1;let h=i===et.Vertical?0:f.deltaX*d,g=i===et.Horizontal?0:f.deltaY*d;!Vt()&&f.shiftKey&&i!==et.Vertical&&(h=f.deltaY*d,g=0),n.translateBy(r,-(h/l)*a,-(g/l)*a,{internal:!0});const m=$r(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(f,m),e.panScrollTimeout=setTimeout(()=>{c==null||c(f,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s==null||s(f,m))}}function T1({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(n,i){const a=n.type==="wheel",o=!t&&a&&!n.ctrlKey,s=lt(n,e);if(n.ctrlKey&&a&&s&&n.preventDefault(),o||s)return null;n.preventDefault(),r.call(this,n,i)}}function k1({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return n=>{var a,o,s;if((a=n.sourceEvent)!=null&&a.internal)return;const i=$r(n.transform);e.mouseButton=((o=n.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((s=n.sourceEvent)==null?void 0:s.type)==="mousedown"&&t(!0),r&&(r==null||r(n.sourceEvent,i))}}function P1({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:n,onPanZoom:i}){return a=>{var o,s;e.usedRightMouseButton=!!(r&&Ny(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||n([a.transform.x,a.transform.y,a.transform.k]),i&&!((s=a.sourceEvent)!=null&&s.internal)&&(i==null||i(a.sourceEvent,$r(a.transform)))}}function L1({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:n,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var s;if(!((s=o.sourceEvent)!=null&&s.internal)&&(e.isZoomingOrPanning=!1,a&&Ny(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,n(!1),i)){const u=$r(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},r?150:0)}}}function O1({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:n,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:u,lib:c,connectionInProgress:f}){return l=>{var v;const d=e||t,h=r&&l.ctrlKey,g=l.type==="wheel";if(l.button===1&&l.type==="mousedown"&&(lt(l,`${c}-flow__node`)||lt(l,`${c}-flow__edge`)))return!0;if(!n&&!d&&!i&&!a&&!r||o||f&&!g||lt(l,s)&&g||lt(l,u)&&(!g||i&&g&&!e)||!r&&l.ctrlKey&&g)return!1;if(!r&&l.type==="touchstart"&&((v=l.touches)==null?void 0:v.length)>1)return l.preventDefault(),!1;if(!d&&!i&&!h&&g||!n&&(l.type==="mousedown"||l.type==="touchstart")||Array.isArray(n)&&!n.includes(l.button)&&l.type==="mousedown")return!1;const m=Array.isArray(n)&&n.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||g)&&m}}function D1({domNode:e,minZoom:t,maxZoom:r,translateExtent:n,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),l=ty().scaleExtent([t,r]).translateExtent(n),d=ge(e).call(l);b({x:i.x,y:i.y,zoom:mt(i.zoom,t,r)},[[0,0],[f.width,f.height]],n);const h=d.on("wheel.zoom"),g=d.on("dblclick.zoom");l.wheelDelta(Ry);function m(C,N){return d?new Promise(L=>{l==null||l.interpolate((N==null?void 0:N.interpolate)==="linear"?Pt:yr).transform(yn(d,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>L(!0)),C)}):Promise.resolve(!1)}function v({noWheelClassName:C,noPanClassName:N,onPaneContextMenu:L,userSelectionActive:S,panOnScroll:T,panOnDrag:M,panOnScrollMode:j,panOnScrollSpeed:O,preventScrolling:k,zoomOnPinch:H,zoomOnScroll:G,zoomOnDoubleClick:V,zoomActivationKeyPressed:Y,lib:A,onTransformChange:D,connectionInProgress:$,paneClickDistance:z,selectionOnDrag:B}){S&&!c.isZoomingOrPanning&&y();const U=T&&!Y&&!S;l.clickDistance(B?1/0:!xe(z)||z<0?0:z);const X=U?M1({zoomPanValues:c,noWheelClassName:C,d3Selection:d,d3Zoom:l,panOnScrollMode:j,panOnScrollSpeed:O,zoomOnPinch:H,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):T1({noWheelClassName:C,preventScrolling:k,d3ZoomHandler:h});if(d.on("wheel.zoom",X,{passive:!1}),!S){const J=k1({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:o});l.on("start",J);const W=P1({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!L,onPanZoom:a,onTransformChange:D});l.on("zoom",W);const te=L1({zoomPanValues:c,panOnDrag:M,panOnScroll:T,onPaneContextMenu:L,onPanZoomEnd:s,onDraggingChange:u});l.on("end",te)}const K=O1({zoomActivationKeyPressed:Y,panOnDrag:M,zoomOnScroll:G,panOnScroll:T,zoomOnDoubleClick:V,zoomOnPinch:H,userSelectionActive:S,noPanClassName:N,noWheelClassName:C,lib:A,connectionInProgress:$});l.filter(K),V?d.on("dblclick.zoom",g):d.on("dblclick.zoom",null)}function y(){l.on("zoom",null)}async function b(C,N,L){const S=vn(C),T=l==null?void 0:l.constrain()(S,N,L);return T&&await m(T),new Promise(M=>M(T))}async function p(C,N){const L=vn(C);return await m(L,N),new Promise(S=>S(L))}function _(C){if(d){const N=vn(C),L=d.property("__zoom");(L.k!==C.zoom||L.x!==C.x||L.y!==C.y)&&(l==null||l.transform(d,N,null,{sync:!0}))}}function x(){const C=d?ey(d.node()):{x:0,y:0,k:1};return{x:C.x,y:C.y,zoom:C.k}}function w(C,N){return d?new Promise(L=>{l==null||l.interpolate((N==null?void 0:N.interpolate)==="linear"?Pt:yr).scaleTo(yn(d,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>L(!0)),C)}):Promise.resolve(!1)}function E(C,N){return d?new Promise(L=>{l==null||l.interpolate((N==null?void 0:N.interpolate)==="linear"?Pt:yr).scaleBy(yn(d,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>L(!0)),C)}):Promise.resolve(!1)}function I(C){l==null||l.scaleExtent(C)}function q(C){l==null||l.translateExtent(C)}function R(C){const N=!xe(C)||C<0?0:C;l==null||l.clickDistance(N)}return{update:v,destroy:y,setViewport:p,setViewportConstrained:b,getViewport:x,scaleTo:w,scaleBy:E,setScaleExtent:I,setTranslateExtent:q,syncViewport:_,setClickDistance:R}}var xt;(function(e){e.Line="line",e.Handle="handle"})(xt||(xt={}));function j1({width:e,prevWidth:t,height:r,prevHeight:n,affectsX:i,affectsY:a}){const o=e-t,s=r-n,u=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(u[0]=u[0]*-1),s&&a&&(u[1]=u[1]*-1),u}function Sf(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),n=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:n,affectsY:i}}function Ye(e,t){return Math.max(0,t-e)}function We(e,t){return Math.max(0,e-t)}function hr(e,t,r){return Math.max(0,t-e,e-r)}function Cf(e,t){return e?!t:t}function F1(e,t,r,n,i,a,o,s){let{affectsX:u,affectsY:c}=t;const{isHorizontal:f,isVertical:l}=t,d=f&&l,{xSnapped:h,ySnapped:g}=r,{minWidth:m,maxWidth:v,minHeight:y,maxHeight:b}=n,{x:p,y:_,width:x,height:w,aspectRatio:E}=e;let I=Math.floor(f?h-e.pointerX:0),q=Math.floor(l?g-e.pointerY:0);const R=x+(u?-I:I),C=w+(c?-q:q),N=-a[0]*x,L=-a[1]*w;let S=hr(R,m,v),T=hr(C,y,b);if(o){let O=0,k=0;u&&I<0?O=Ye(p+I+N,o[0][0]):!u&&I>0&&(O=We(p+R+N,o[1][0])),c&&q<0?k=Ye(_+q+L,o[0][1]):!c&&q>0&&(k=We(_+C+L,o[1][1])),S=Math.max(S,O),T=Math.max(T,k)}if(s){let O=0,k=0;u&&I>0?O=We(p+I,s[0][0]):!u&&I<0&&(O=Ye(p+R,s[1][0])),c&&q>0?k=We(_+q,s[0][1]):!c&&q<0&&(k=Ye(_+C,s[1][1])),S=Math.max(S,O),T=Math.max(T,k)}if(i){if(f){const O=hr(R/E,y,b)*E;if(S=Math.max(S,O),o){let k=0;!u&&!c||u&&!c&&d?k=We(_+L+R/E,o[1][1])*E:k=Ye(_+L+(u?I:-I)/E,o[0][1])*E,S=Math.max(S,k)}if(s){let k=0;!u&&!c||u&&!c&&d?k=Ye(_+R/E,s[1][1])*E:k=We(_+(u?I:-I)/E,s[0][1])*E,S=Math.max(S,k)}}if(l){const O=hr(C*E,m,v)/E;if(T=Math.max(T,O),o){let k=0;!u&&!c||c&&!u&&d?k=We(p+C*E+N,o[1][0])/E:k=Ye(p+(c?q:-q)*E+N,o[0][0])/E,T=Math.max(T,k)}if(s){let k=0;!u&&!c||c&&!u&&d?k=Ye(p+C*E,s[1][0])/E:k=We(p+(c?q:-q)*E,s[0][0])/E,T=Math.max(T,k)}}}q=q+(q<0?T:-T),I=I+(I<0?S:-S),i&&(d?R>C*E?q=(Cf(u,c)?-I:I)/E:I=(Cf(u,c)?-q:q)*E:f?(q=I/E,c=u):(I=q*E,u=c));const M=u?p+I:p,j=c?_+q:_;return{width:x+(u?-I:I),height:w+(c?-q:q),x:a[0]*I*(u?-1:1)+M,y:a[1]*q*(c?-1:1)+j}}const Ay={width:0,height:0,x:0,y:0},$1={...Ay,pointerX:0,pointerY:0,aspectRatio:1};function z1(e){return[[0,0],[e.measured.width,e.measured.height]]}function B1(e,t,r){const n=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=r[0]*a,u=r[1]*o;return[[n-s,i-u],[n+a-s,i+o-u]]}function H1({domNode:e,nodeId:t,getStoreItems:r,onChange:n,onEnd:i}){const a=ge(e);let o={controlDirection:Sf("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:c,boundaries:f,keepAspectRatio:l,resizeDirection:d,onResizeStart:h,onResize:g,onResizeEnd:m,shouldResize:v}){let y={...Ay},b={...$1};o={boundaries:f,resizeDirection:d,keepAspectRatio:l,controlDirection:Sf(c)};let p,_=null,x=[],w,E,I,q=!1;const R=$v().on("start",C=>{const{nodeLookup:N,transform:L,snapGrid:S,snapToGrid:T,nodeOrigin:M,paneDomNode:j}=r();if(p=N.get(t),!p)return;_=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:k}=Lt(C.sourceEvent,{transform:L,snapGrid:S,snapToGrid:T,containerBounds:_});y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...y,pointerX:O,pointerY:k,aspectRatio:y.width/y.height},w=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(w=N.get(p.parentId),E=w&&p.extent==="parent"?z1(w):void 0),x=[],I=void 0;for(const[H,G]of N)if(G.parentId===t&&(x.push({id:H,position:{...G.position},extent:G.extent}),G.extent==="parent"||G.expandParent)){const V=B1(G,p,G.origin??M);I?I=[[Math.min(V[0][0],I[0][0]),Math.min(V[0][1],I[0][1])],[Math.max(V[1][0],I[1][0]),Math.max(V[1][1],I[1][1])]]:I=V}h==null||h(C,{...y})}).on("drag",C=>{const{transform:N,snapGrid:L,snapToGrid:S,nodeOrigin:T}=r(),M=Lt(C.sourceEvent,{transform:N,snapGrid:L,snapToGrid:S,containerBounds:_}),j=[];if(!p)return;const{x:O,y:k,width:H,height:G}=y,V={},Y=p.origin??T,{width:A,height:D,x:$,y:z}=F1(b,o.controlDirection,M,o.boundaries,o.keepAspectRatio,Y,E,I),B=A!==H,U=D!==G,X=$!==O&&B,K=z!==k&&U;if(!X&&!K&&!B&&!U)return;if((X||K||Y[0]===1||Y[1]===1)&&(V.x=X?$:y.x,V.y=K?z:y.y,y.x=V.x,y.y=V.y,x.length>0)){const Z=$-O,re=z-k;for(const ee of x)ee.position={x:ee.position.x-Z+Y[0]*(A-H),y:ee.position.y-re+Y[1]*(D-G)},j.push(ee)}if((B||U)&&(V.width=B&&(!o.resizeDirection||o.resizeDirection==="horizontal")?A:y.width,V.height=U&&(!o.resizeDirection||o.resizeDirection==="vertical")?D:y.height,y.width=V.width,y.height=V.height),w&&p.expandParent){const Z=Y[0]*(V.width??0);V.x&&V.x<Z&&(y.x=Z,b.x=b.x-(V.x-Z));const re=Y[1]*(V.height??0);V.y&&V.y<re&&(y.y=re,b.y=b.y-(V.y-re))}const J=j1({width:y.width,prevWidth:H,height:y.height,prevHeight:G,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),W={...y,direction:J};(v==null?void 0:v(C,W))!==!1&&(q=!0,g==null||g(C,W),n(V,j))}).on("end",C=>{q&&(m==null||m(C,{...y}),i==null||i({...y}),q=!1)});a.call(R)}function u(){a.on(".drag",null)}return{update:s,destroy:u}}var mn={exports:{}},_n={},bn={exports:{}},xn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var qf;function V1(){if(qf)return xn;qf=1;var e=Ev();function t(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(l,d){var h=d(),g=n({inst:{value:h,getSnapshot:d}}),m=g[0].inst,v=g[1];return a(function(){m.value=h,m.getSnapshot=d,u(m)&&v({inst:m})},[l,h,d]),i(function(){return u(m)&&v({inst:m}),l(function(){u(m)&&v({inst:m})})},[l]),o(h),h}function u(l){var d=l.getSnapshot;l=l.value;try{var h=d();return!r(l,h)}catch{return!0}}function c(l,d){return d()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return xn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,xn}var If;function G1(){return If||(If=1,bn.exports=V1()),bn.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Nf;function U1(){if(Nf)return _n;Nf=1;var e=Ev(),t=G1();function r(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,s=e.useMemo,u=e.useDebugValue;return _n.useSyncExternalStoreWithSelector=function(c,f,l,d,h){var g=a(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function y(w){if(!b){if(b=!0,p=w,w=d(w),h!==void 0&&m.hasValue){var E=m.value;if(h(E,w))return _=E}return _=w}if(E=_,n(p,w))return E;var I=d(w);return h!==void 0&&h(E,I)?(p=w,E):(p=w,_=I)}var b=!1,p,_,x=l===void 0?null:l;return[function(){return y(f())},x===null?void 0:function(){return y(x())}]},[f,l,d,h]);var v=i(c,g[0],g[1]);return o(function(){m.hasValue=!0,m.value=v},[v]),u(v),v},_n}var Rf;function Y1(){return Rf||(Rf=1,mn.exports=U1()),mn.exports}var W1=Y1();const X1=Sv(W1),K1={},Af=e=>{let t;const r=new Set,n=(f,l)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const h=t;t=l??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(g=>g(t,h))}},i=()=>t,u={setState:n,getState:i,getInitialState:()=>c,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(K1?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},c=t=e(n,i,u);return u},Z1=e=>e?Af(e):Af,{useDebugValue:Q1}=Cv,{useSyncExternalStoreWithSelector:J1}=X1,eE=e=>e;function My(e,t=eE,r){const n=J1(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Q1(n),n}const Mf=(e,t)=>{const r=Z1(e),n=(i,a=t)=>My(r,i,a);return Object.assign(n,r),n},tE=(e,t)=>e?Mf(e,t):Mf;function ie(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,i]of e)if(!Object.is(i,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}f_();const zr=F.createContext(null),rE=zr.Provider,Ty=Ae.error001();function ne(e,t){const r=F.useContext(zr);if(r===null)throw new Error(Ty);return My(r,e,t)}function ae(){const e=F.useContext(zr);if(e===null)throw new Error(Ty);return F.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Tf={display:"none"},nE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ky="react-flow__node-desc",Py="react-flow__edge-desc",iE="react-flow__aria-live",aE=e=>e.ariaLiveMessage,oE=e=>e.ariaLabelConfig;function sE({rfId:e}){const t=ne(aE);return P.jsx("div",{id:`${iE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:nE,children:t})}function uE({rfId:e,disableKeyboardA11y:t}){const r=ne(oE);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${ky}-${e}`,style:Tf,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${Py}-${e}`,style:Tf,children:r["edge.a11yDescription.default"]}),!t&&P.jsx(sE,{rfId:e})]})}const Br=F.forwardRef(({position:e="top-left",children:t,className:r,style:n,...i},a)=>{const o=`${e}`.split("-");return P.jsx("div",{className:ue(["react-flow__panel",r,...o]),style:n,ref:a,...i,children:t})});Br.displayName="Panel";function cE({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:P.jsx(Br,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:P.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const fE=e=>{const t=[],r=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,n]of e.edgeLookup)n.selected&&r.push(n);return{selectedNodes:t,selectedEdges:r}},pr=e=>e.id;function lE(e,t){return ie(e.selectedNodes.map(pr),t.selectedNodes.map(pr))&&ie(e.selectedEdges.map(pr),t.selectedEdges.map(pr))}function dE({onSelectionChange:e}){const t=ae(),{selectedNodes:r,selectedEdges:n}=ne(fE,lE);return F.useEffect(()=>{const i={nodes:r,edges:n};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[r,n,e]),null}const hE=e=>!!e.onSelectionChangeHandlers;function pE({onSelectionChange:e}){const t=ne(hE);return e||t?P.jsx(dE,{onSelectionChange:e}):null}const Ly=[0,0],gE={x:0,y:0,zoom:1},vE=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],kf=[...vE,"rfId"],yE=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Pf={translateExtent:$t,nodeOrigin:Ly,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function mE(e){const{setNodes:t,setEdges:r,setMinZoom:n,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:u}=ne(yE,ie),c=ae();F.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{f.current=Pf,s()}),[]);const f=F.useRef(Pf);return F.useEffect(()=>{for(const l of kf){const d=e[l],h=f.current[l];d!==h&&(typeof e[l]>"u"||(l==="nodes"?t(d):l==="edges"?r(d):l==="minZoom"?n(d):l==="maxZoom"?i(d):l==="translateExtent"?a(d):l==="nodeExtent"?o(d):l==="ariaLabelConfig"?c.setState({ariaLabelConfig:t1(d)}):l==="fitView"?c.setState({fitViewQueued:d}):l==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[l]:d})))}f.current=e},kf.map(l=>e[l])),null}function Lf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _E(e){var n;const[t,r]=F.useState(e==="system"?null:e);return F.useEffect(()=>{if(e!=="system"){r(e);return}const i=Lf(),a=()=>r(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(n=Lf())!=null&&n.matches?"dark":"light"}const Of=typeof document<"u"?document:null;function Gt(e=null,t={target:Of,actInsideInputWithModifier:!0}){const[r,n]=F.useState(!1),i=F.useRef(!1),a=F.useRef(new Set([])),[o,s]=F.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(l=>typeof l=="string").map(l=>l.replace("+",`
|
|
18
|
+
`).replace(`
|
|
19
|
+
|
|
20
|
+
`,`
|
|
21
|
+
+`).split(`
|
|
22
|
+
`)),f=c.reduce((l,d)=>l.concat(...d),[]);return[c,f]}return[[],[]]},[e]);return F.useEffect(()=>{const u=(t==null?void 0:t.target)??Of,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=h=>{var v,y;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!c)&&py(h))return!1;const m=jf(h.code,s);if(a.current.add(h[m]),Df(o,a.current,!1)){const b=((y=(v=h.composedPath)==null?void 0:v.call(h))==null?void 0:y[0])||h.target,p=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(i.current||!p)&&h.preventDefault(),n(!0)}},l=h=>{const g=jf(h.code,s);Df(o,a.current,!0)?(n(!1),a.current.clear()):a.current.delete(h[g]),h.key==="Meta"&&a.current.clear(),i.current=!1},d=()=>{a.current.clear(),n(!1)};return u==null||u.addEventListener("keydown",f),u==null||u.addEventListener("keyup",l),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{u==null||u.removeEventListener("keydown",f),u==null||u.removeEventListener("keyup",l),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,n]),r}function Df(e,t,r){return e.filter(n=>r||n.length===t.size).some(n=>n.every(i=>t.has(i)))}function jf(e,t){return t.includes(e)?"code":"key"}const bE=()=>{const e=ae();return F.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:n}=e.getState();return n?n.scaleTo(t,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[n,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??n,y:t.y??i,zoom:t.zoom??a},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,n]=e.getState().transform;return{x:t,y:r,zoom:n}},setCenter:async(t,r,n)=>e.getState().setCenter(t,r,n),fitBounds:async(t,r)=>{const{width:n,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),u=hc(t,n,i,a,o,(r==null?void 0:r.padding)??.1);return s?(await s.setViewport(u,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:n,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:s,y:u}=o.getBoundingClientRect(),c={x:t.x-s,y:t.y-u},f=r.snapGrid??i,l=r.snapToGrid??a;return Zt(c,n,l,f)},flowToScreenPosition:t=>{const{transform:r,domNode:n}=e.getState();if(!n)return t;const{x:i,y:a}=n.getBoundingClientRect(),o=Rr(t,r);return{x:o.x+i,y:o.y+a}}}),[])};function Oy(e,t){const r=[],n=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")n.set(a.id,[a]);else{const o=n.get(a.id);o?o.push(a):n.set(a.id,[a])}for(const a of t){const o=n.get(a.id);if(!o){r.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){r.push({...o[0].item});continue}const s={...a};for(const u of o)xE(u,s);r.push(s)}return i.length&&i.forEach(a=>{a.index!==void 0?r.splice(a.index,0,{...a.item}):r.push({...a.item})}),r}function xE(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Dy(e,t){return Oy(e,t)}function jy(e,t){return Oy(e,t)}function Ze(e,t){return{id:e,type:"select",selected:t}}function dt(e,t=new Set,r=!1){const n=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(r&&(a.selected=o),n.push(Ze(a.id,o)))}return n}function Ff({items:e=[],lookup:t}){var i;const r=[],n=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const s=t.get(o.id),u=((i=s==null?void 0:s.internals)==null?void 0:i.userNode)??s;u!==void 0&&u!==o&&r.push({id:o.id,item:o,type:"replace"}),u===void 0&&r.push({item:o,type:"add",index:a})}for(const[a]of t)n.get(a)===void 0&&r.push({id:a,type:"remove"});return r}function $f(e){return{id:e.id,type:"remove"}}const zf=e=>Gw(e),wE=e=>oy(e);function Fy(e){return F.forwardRef(e)}const EE=typeof window<"u"?F.useLayoutEffect:F.useEffect;function Bf(e){const[t,r]=F.useState(BigInt(0)),[n]=F.useState(()=>SE(()=>r(i=>i+BigInt(1))));return EE(()=>{const i=n.get();i.length&&(e(i),n.reset())},[t]),n}function SE(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const $y=F.createContext(null);function CE({children:e}){const t=ae(),r=F.useCallback(s=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:f,onNodesChange:l,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let m=u;for(const y of s)m=typeof y=="function"?y(m):y;let v=Ff({items:m,lookup:d});for(const y of g.values())v=y(v);f&&c(m),v.length>0?l==null||l(v):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:p}=t.getState();y&&p(b)})},[]),n=Bf(r),i=F.useCallback(s=>{const{edges:u=[],setEdges:c,hasDefaultEdges:f,onEdgesChange:l,edgeLookup:d}=t.getState();let h=u;for(const g of s)h=typeof g=="function"?g(h):g;f?c(h):l&&l(Ff({items:h,lookup:d}))},[]),a=Bf(i),o=F.useMemo(()=>({nodeQueue:n,edgeQueue:a}),[]);return P.jsx($y.Provider,{value:o,children:e})}function qE(){const e=F.useContext($y);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const IE=e=>!!e.panZoom;function bc(){const e=bE(),t=ae(),r=qE(),n=ne(IE),i=F.useMemo(()=>{const a=l=>t.getState().nodeLookup.get(l),o=l=>{r.nodeQueue.push(l)},s=l=>{r.edgeQueue.push(l)},u=l=>{var y,b;const{nodeLookup:d,nodeOrigin:h}=t.getState(),g=zf(l)?l:d.get(l.id),m=g.parentId?dy(g.position,g.measured,g.parentId,d,h):g.position,v={...g,position:m,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((b=g.measured)==null?void 0:b.height)??g.height};return _t(v)},c=(l,d,h={replace:!1})=>{o(g=>g.map(m=>{if(m.id===l){const v=typeof d=="function"?d(m):d;return h.replace&&zf(v)?v:{...m,...v}}return m}))},f=(l,d,h={replace:!1})=>{s(g=>g.map(m=>{if(m.id===l){const v=typeof d=="function"?d(m):d;return h.replace&&wE(v)?v:{...m,...v}}return m}))};return{getNodes:()=>t.getState().nodes.map(l=>({...l})),getNode:l=>{var d;return(d=a(l))==null?void 0:d.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:l=[]}=t.getState();return l.map(d=>({...d}))},getEdge:l=>t.getState().edgeLookup.get(l),setNodes:o,setEdges:s,addNodes:l=>{const d=Array.isArray(l)?l:[l];r.nodeQueue.push(h=>[...h,...d])},addEdges:l=>{const d=Array.isArray(l)?l:[l];r.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:l=[],edges:d=[],transform:h}=t.getState(),[g,m,v]=h;return{nodes:l.map(y=>({...y})),edges:d.map(y=>({...y})),viewport:{x:g,y:m,zoom:v}}},deleteElements:async({nodes:l=[],edges:d=[]})=>{const{nodes:h,edges:g,onNodesDelete:m,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:p,onBeforeDelete:_}=t.getState(),{nodes:x,edges:w}=await Kw({nodesToRemove:l,edgesToRemove:d,nodes:h,edges:g,onBeforeDelete:_}),E=w.length>0,I=x.length>0;if(E){const q=w.map($f);v==null||v(w),b(q)}if(I){const q=x.map($f);m==null||m(x),y(q)}return(I||E)&&(p==null||p({nodes:x,edges:w})),{deletedNodes:x,deletedEdges:w}},getIntersectingNodes:(l,d=!0,h)=>{const g=hf(l),m=g?l:u(l),v=h!==void 0;return m?(h||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!g&&(y.id===l.id||!b.internals.positionAbsolute))return!1;const p=_t(v?y:b),_=Ht(p,m);return d&&_>0||_>=p.width*p.height||_>=m.width*m.height}):[]},isNodeIntersecting:(l,d,h=!0)=>{const m=hf(l)?l:u(l);if(!m)return!1;const v=Ht(m,d);return h&&v>0||v>=d.width*d.height||v>=m.width*m.height},updateNode:c,updateNodeData:(l,d,h={replace:!1})=>{c(l,g=>{const m=typeof d=="function"?d(g):d;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},updateEdge:f,updateEdgeData:(l,d,h={replace:!1})=>{f(l,g=>{const m=typeof d=="function"?d(g):d;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},getNodesBounds:l=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return Uw(l,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:l,id:d,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}-${l}${d?`-${d}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:l,handleId:d,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}${l?d?`-${l}-${d}`:`-${l}`:""}`))==null?void 0:g.values())??[])},fitView:async l=>{const d=t.getState().fitViewResolver??e1();return t.setState({fitViewQueued:!0,fitViewOptions:l,fitViewResolver:d}),r.nodeQueue.push(h=>[...h]),d.promise}}},[]);return F.useMemo(()=>({...i,...e,viewportInitialized:n}),[n])}const Hf=e=>e.selected,NE=typeof window<"u"?window:void 0;function RE({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=ae(),{deleteElements:n}=bc(),i=Gt(e,{actInsideInputWithModifier:!1}),a=Gt(t,{target:NE});F.useEffect(()=>{if(i){const{edges:o,nodes:s}=r.getState();n({nodes:s.filter(Hf),edges:o.filter(Hf)}),r.setState({nodesSelectionActive:!1})}},[i]),F.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])}function AE(e){const t=ae();F.useEffect(()=>{const r=()=>{var i,a,o,s;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const n=pc(e.current);(n.height===0||n.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",Ae.error004())),t.setState({width:n.width||500,height:n.height||500})};if(e.current){r(),window.addEventListener("resize",r);const n=new ResizeObserver(()=>r());return n.observe(e.current),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}}},[])}const Hr={position:"absolute",width:"100%",height:"100%",top:0,left:0},ME=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function TE({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:n=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=et.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:u,translateExtent:c,minZoom:f,maxZoom:l,zoomActivationKeyCode:d,preventScrolling:h=!0,children:g,noWheelClassName:m,noPanClassName:v,onViewportChange:y,isControlledViewport:b,paneClickDistance:p,selectionOnDrag:_}){const x=ae(),w=F.useRef(null),{userSelectionActive:E,lib:I,connectionInProgress:q}=ne(ME,ie),R=Gt(d),C=F.useRef();AE(w);const N=F.useCallback(L=>{y==null||y({x:L[0],y:L[1],zoom:L[2]}),b||x.setState({transform:L})},[y,b]);return F.useEffect(()=>{if(w.current){C.current=D1({domNode:w.current,minZoom:f,maxZoom:l,translateExtent:c,viewport:u,onDraggingChange:M=>x.setState({paneDragging:M}),onPanZoomStart:(M,j)=>{const{onViewportChangeStart:O,onMoveStart:k}=x.getState();k==null||k(M,j),O==null||O(j)},onPanZoom:(M,j)=>{const{onViewportChange:O,onMove:k}=x.getState();k==null||k(M,j),O==null||O(j)},onPanZoomEnd:(M,j)=>{const{onViewportChangeEnd:O,onMoveEnd:k}=x.getState();k==null||k(M,j),O==null||O(j)}});const{x:L,y:S,zoom:T}=C.current.getViewport();return x.setState({panZoom:C.current,transform:[L,S,T],domNode:w.current.closest(".react-flow")}),()=>{var M;(M=C.current)==null||M.destroy()}}},[]),F.useEffect(()=>{var L;(L=C.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:n,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:R,preventScrolling:h,noPanClassName:v,userSelectionActive:E,noWheelClassName:m,lib:I,onTransformChange:N,connectionInProgress:q,selectionOnDrag:_,paneClickDistance:p})},[e,t,r,n,i,a,o,s,R,h,v,E,m,I,N,q,_,p]),P.jsx("div",{className:"react-flow__renderer",ref:w,style:Hr,children:g})}const kE=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function PE(){const{userSelectionActive:e,userSelectionRect:t}=ne(kE,ie);return e&&t?P.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wn=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},LE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function OE({isSelecting:e,selectionKeyPressed:t,selectionMode:r=zt.Full,panOnDrag:n,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:s,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:l,onPaneMouseMove:d,onPaneMouseLeave:h,children:g}){const m=ae(),{userSelectionActive:v,elementsSelectable:y,dragging:b,connectionInProgress:p}=ne(LE,ie),_=y&&(e||v),x=F.useRef(null),w=F.useRef(),E=F.useRef(new Set),I=F.useRef(new Set),q=F.useRef(!1),R=O=>{if(q.current||p){q.current=!1;return}u==null||u(O),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=O=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){O.preventDefault();return}c==null||c(O)},N=f?O=>f(O):void 0,L=O=>{q.current&&(O.stopPropagation(),q.current=!1)},S=O=>{var D,$;const{domNode:k}=m.getState();if(w.current=k==null?void 0:k.getBoundingClientRect(),!w.current)return;const H=O.target===x.current;if(!H&&!!O.target.closest(".nokey")||!e||!(a&&H||t)||O.button!==0||!O.isPrimary)return;($=(D=O.target)==null?void 0:D.setPointerCapture)==null||$.call(D,O.pointerId),q.current=!1;const{x:Y,y:A}=we(O.nativeEvent,w.current);m.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:A,x:Y,y:A}}),H||(O.stopPropagation(),O.preventDefault())},T=O=>{const{userSelectionRect:k,transform:H,nodeLookup:G,edgeLookup:V,connectionLookup:Y,triggerNodeChanges:A,triggerEdgeChanges:D,defaultEdgeOptions:$,resetSelectedElements:z}=m.getState();if(!w.current||!k)return;const{x:B,y:U}=we(O.nativeEvent,w.current),{startX:X,startY:K}=k;if(!q.current){const re=t?0:i;if(Math.hypot(B-X,U-K)<=re)return;z(),o==null||o(O)}q.current=!0;const J={startX:X,startY:K,x:B<X?B:X,y:U<K?U:K,width:Math.abs(B-X),height:Math.abs(U-K)},W=E.current,te=I.current;E.current=new Set(dc(G,J,H,r===zt.Partial,!0).map(re=>re.id)),I.current=new Set;const Z=($==null?void 0:$.selectable)??!0;for(const re of E.current){const ee=Y.get(re);if(ee)for(const{edgeId:le}of ee.values()){const fe=V.get(le);fe&&(fe.selectable??Z)&&I.current.add(le)}}if(!pf(W,E.current)){const re=dt(G,E.current,!0);A(re)}if(!pf(te,I.current)){const re=dt(V,I.current);D(re)}m.setState({userSelectionRect:J,userSelectionActive:!0,nodesSelectionActive:!1})},M=O=>{var k,H;O.button===0&&((H=(k=O.target)==null?void 0:k.releasePointerCapture)==null||H.call(k,O.pointerId),!v&&O.target===x.current&&m.getState().userSelectionRect&&(R==null||R(O)),m.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(s==null||s(O),m.setState({nodesSelectionActive:E.current.size>0})))},j=n===!0||Array.isArray(n)&&n.includes(0);return P.jsxs("div",{className:ue(["react-flow__pane",{draggable:j,dragging:b,selection:e}]),onClick:_?void 0:wn(R,x),onContextMenu:wn(C,x),onWheel:wn(N,x),onPointerEnter:_?void 0:l,onPointerMove:_?T:d,onPointerUp:_?M:void 0,onPointerDownCapture:_?S:void 0,onClickCapture:_?L:void 0,onPointerLeave:h,ref:x,style:Hr,children:[g,P.jsx(PE,{})]})}function rc({id:e,store:t,unselect:r=!1,nodeRef:n}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:u}=t.getState(),c=s.get(e);if(!c){u==null||u("012",Ae.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(r||c.selected&&o)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var f;return(f=n==null?void 0:n.current)==null?void 0:f.blur()})):i([e])}function zy({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:n,nodeId:i,isSelectable:a,nodeClickDistance:o}){const s=ae(),[u,c]=F.useState(!1),f=F.useRef();return F.useEffect(()=>{f.current=E1({getStoreItems:()=>s.getState(),onNodeMouseDown:l=>{rc({id:l,store:s,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),F.useEffect(()=>{var l,d;if(t)(l=f.current)==null||l.destroy();else if(e.current)return(d=f.current)==null||d.update({noDragClassName:r,handleSelector:n,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=f.current)==null||h.destroy()}},[r,n,t,a,e,i]),u}const DE=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function By(){const e=ae();return F.useCallback(r=>{const{nodeExtent:n,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:s,updateNodePositions:u,nodeLookup:c,nodeOrigin:f}=e.getState(),l=new Map,d=DE(o),h=i?a[0]:5,g=i?a[1]:5,m=r.direction.x*h*r.factor,v=r.direction.y*g*r.factor;for(const[,y]of c){if(!d(y))continue;let b={x:y.internals.positionAbsolute.x+m,y:y.internals.positionAbsolute.y+v};i&&(b=Kt(b,a));const{position:p,positionAbsolute:_}=sy({nodeId:y.id,nextPosition:b,nodeLookup:c,nodeExtent:n,nodeOrigin:f,onError:s});y.position=p,y.internals.positionAbsolute=_,l.set(y.id,y)}u(l)},[])}const xc=F.createContext(null),jE=xc.Provider;xc.Consumer;const Hy=()=>F.useContext(xc),FE=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),$E=(e,t,r)=>n=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=n,{fromHandle:s,toHandle:u,isValid:c}=o,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===r;return{connectingFrom:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===r,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===r,isPossibleEndHandle:a===yt.Strict?(s==null?void 0:s.type)!==r:e!==(s==null?void 0:s.nodeId)||t!==(s==null?void 0:s.id),connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:f&&c}};function zE({type:e="source",position:t=Q.Top,isValidConnection:r,isConnectable:n=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:u,className:c,onMouseDown:f,onTouchStart:l,...d},h){var T,M;const g=o||null,m=e==="target",v=ae(),y=Hy(),{connectOnClick:b,noPanClassName:p,rfId:_}=ne(FE,ie),{connectingFrom:x,connectingTo:w,clickConnecting:E,isPossibleEndHandle:I,connectionInProcess:q,clickConnectionInProcess:R,valid:C}=ne($E(y,g,e),ie);y||(M=(T=v.getState()).onError)==null||M.call(T,"010",Ae.error010());const N=j=>{const{defaultEdgeOptions:O,onConnect:k,hasDefaultEdges:H}=v.getState(),G={...O,...j};if(H){const{edges:V,setEdges:Y}=v.getState();Y(s1(G,V))}k==null||k(G),s==null||s(G)},L=j=>{if(!y)return;const O=gy(j.nativeEvent);if(i&&(O&&j.button===0||!O)){const k=v.getState();tc.onPointerDown(j.nativeEvent,{handleDomNode:j.currentTarget,autoPanOnConnect:k.autoPanOnConnect,connectionMode:k.connectionMode,connectionRadius:k.connectionRadius,domNode:k.domNode,nodeLookup:k.nodeLookup,lib:k.lib,isTarget:m,handleId:g,nodeId:y,flowId:k.rfId,panBy:k.panBy,cancelConnection:k.cancelConnection,onConnectStart:k.onConnectStart,onConnectEnd:k.onConnectEnd,updateConnection:k.updateConnection,onConnect:N,isValidConnection:r||k.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:k.autoPanSpeed,dragThreshold:k.connectionDragThreshold})}O?f==null||f(j):l==null||l(j)},S=j=>{const{onClickConnectStart:O,onClickConnectEnd:k,connectionClickStartHandle:H,connectionMode:G,isValidConnection:V,lib:Y,rfId:A,nodeLookup:D,connection:$}=v.getState();if(!y||!H&&!i)return;if(!H){O==null||O(j.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const z=hy(j.target),B=r||V,{connection:U,isValid:X}=tc.isValid(j.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:G,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:B,flowId:A,doc:z,lib:Y,nodeLookup:D});X&&U&&N(U);const K=structuredClone($);delete K.inProgress,K.toPosition=K.toHandle?K.toHandle.position:null,k==null||k(j,K),v.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${g}-${e}`,className:ue(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,c,{source:!m,target:m,connectable:n,connectablestart:i,connectableend:a,clickconnecting:E,connectingfrom:x,connectingto:w,valid:C,connectionindicator:n&&(!q||I)&&(q||R?a:i)}]),onMouseDown:L,onTouchStart:L,onClick:b?S:void 0,ref:h,...d,children:u})}const Ar=F.memo(Fy(zE));function BE({data:e,isConnectable:t,sourcePosition:r=Q.Bottom}){return P.jsxs(P.Fragment,{children:[e==null?void 0:e.label,P.jsx(Ar,{type:"source",position:r,isConnectable:t})]})}function HE({data:e,isConnectable:t,targetPosition:r=Q.Top,sourcePosition:n=Q.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(Ar,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,P.jsx(Ar,{type:"source",position:n,isConnectable:t})]})}function VE(){return null}function GE({data:e,isConnectable:t,targetPosition:r=Q.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(Ar,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const Mr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Vf={input:BE,default:HE,output:GE,group:VE};function UE(e){var t,r,n,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((n=e.style)==null?void 0:n.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const YE=e=>{const{width:t,height:r,x:n,y:i}=Xt(e.nodeLookup,{filter:a=>!!a.selected});return{width:xe(t)?t:null,height:xe(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${n}px,${i}px)`}};function WE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const n=ae(),{width:i,height:a,transformString:o,userSelectionActive:s}=ne(YE,ie),u=By(),c=F.useRef(null);if(F.useEffect(()=>{var d;r||(d=c.current)==null||d.focus({preventScroll:!0})},[r]),zy({nodeRef:c}),s||!i||!a)return null;const f=e?d=>{const h=n.getState().nodes.filter(g=>g.selected);e(d,h)}:void 0,l=d=>{Object.prototype.hasOwnProperty.call(Mr,d.key)&&(d.preventDefault(),u({direction:Mr[d.key],factor:d.shiftKey?4:1}))};return P.jsx("div",{className:ue(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:P.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:r?void 0:-1,onKeyDown:r?void 0:l,style:{width:i,height:a}})})}const Gf=typeof window<"u"?window:void 0,XE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Vy({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:f,selectionMode:l,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:_,panOnScrollSpeed:x,panOnScrollMode:w,zoomOnDoubleClick:E,panOnDrag:I,defaultViewport:q,translateExtent:R,minZoom:C,maxZoom:N,preventScrolling:L,onSelectionContextMenu:S,noWheelClassName:T,noPanClassName:M,disableKeyboardA11y:j,onViewportChange:O,isControlledViewport:k}){const{nodesSelectionActive:H,userSelectionActive:G}=ne(XE,ie),V=Gt(c,{target:Gf}),Y=Gt(m,{target:Gf}),A=Y||I,D=Y||_,$=f&&A!==!0,z=V||G||$;return RE({deleteKeyCode:u,multiSelectionKeyCode:g}),P.jsx(TE,{onPaneContextMenu:a,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:D,panOnScrollSpeed:x,panOnScrollMode:w,zoomOnDoubleClick:E,panOnDrag:!V&&A,defaultViewport:q,translateExtent:R,minZoom:C,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:L,noWheelClassName:T,noPanClassName:M,onViewportChange:O,isControlledViewport:k,paneClickDistance:s,selectionOnDrag:$,children:P.jsxs(OE,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:A,isSelecting:!!z,selectionMode:l,selectionKeyPressed:V,paneClickDistance:s,selectionOnDrag:$,children:[e,H&&P.jsx(WE,{onSelectionContextMenu:S,noPanClassName:M,disableKeyboardA11y:j})]})})}Vy.displayName="FlowRenderer";const KE=F.memo(Vy),ZE=e=>t=>e?dc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function QE(e){return ne(F.useCallback(ZE(e),[e]),ie)}const JE=e=>e.updateNodeInternals;function eS(){const e=ne(JE),[t]=F.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const n=new Map;r.forEach(i=>{const a=i.target.getAttribute("data-id");n.set(a,{id:a,nodeElement:i.target,force:!0})}),e(n)}));return F.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function tS({node:e,nodeType:t,hasDimensions:r,resizeObserver:n}){const i=ae(),a=F.useRef(null),o=F.useRef(null),s=F.useRef(e.sourcePosition),u=F.useRef(e.targetPosition),c=F.useRef(t),f=r&&!!e.internals.handleBounds;return F.useEffect(()=>{a.current&&!e.hidden&&(!f||o.current!==a.current)&&(o.current&&(n==null||n.unobserve(o.current)),n==null||n.observe(a.current),o.current=a.current)},[f,e.hidden]),F.useEffect(()=>()=>{o.current&&(n==null||n.unobserve(o.current),o.current=null)},[]),F.useEffect(()=>{if(a.current){const l=c.current!==t,d=s.current!==e.sourcePosition,h=u.current!==e.targetPosition;(l||d||h)&&(c.current=t,s.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function rS({id:e,onClick:t,onMouseEnter:r,onMouseMove:n,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:u,nodesConnectable:c,nodesFocusable:f,resizeObserver:l,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:g,rfId:m,nodeTypes:v,nodeClickDistance:y,onError:b}){const{node:p,internals:_,isParent:x}=ne(B=>{const U=B.nodeLookup.get(e),X=B.parentLookup.has(e);return{node:U,internals:U.internals,isParent:X}},ie);let w=p.type||"default",E=(v==null?void 0:v[w])||Vf[w];E===void 0&&(b==null||b("003",Ae.error003(w)),w="default",E=(v==null?void 0:v.default)||Vf.default);const I=!!(p.draggable||s&&typeof p.draggable>"u"),q=!!(p.selectable||u&&typeof p.selectable>"u"),R=!!(p.connectable||c&&typeof p.connectable>"u"),C=!!(p.focusable||f&&typeof p.focusable>"u"),N=ae(),L=ly(p),S=tS({node:p,nodeType:w,hasDimensions:L,resizeObserver:l}),T=zy({nodeRef:S,disabled:p.hidden||!I,noDragClassName:d,handleSelector:p.dragHandle,nodeId:e,isSelectable:q,nodeClickDistance:y}),M=By();if(p.hidden)return null;const j=ze(p),O=UE(p),k=q||I||t||r||n||i,H=r?B=>r(B,{..._.userNode}):void 0,G=n?B=>n(B,{..._.userNode}):void 0,V=i?B=>i(B,{..._.userNode}):void 0,Y=a?B=>a(B,{..._.userNode}):void 0,A=o?B=>o(B,{..._.userNode}):void 0,D=B=>{const{selectNodesOnDrag:U,nodeDragThreshold:X}=N.getState();q&&(!U||!I||X>0)&&rc({id:e,store:N,nodeRef:S}),t&&t(B,{..._.userNode})},$=B=>{if(!(py(B.nativeEvent)||g)){if(ry.includes(B.key)&&q){const U=B.key==="Escape";rc({id:e,store:N,unselect:U,nodeRef:S})}else if(I&&p.selected&&Object.prototype.hasOwnProperty.call(Mr,B.key)){B.preventDefault();const{ariaLabelConfig:U}=N.getState();N.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),M({direction:Mr[B.key],factor:B.shiftKey?4:1})}}},z=()=>{var te;if(g||!((te=S.current)!=null&&te.matches(":focus-visible")))return;const{transform:B,width:U,height:X,autoPanOnNodeFocus:K,setCenter:J}=N.getState();if(!K)return;dc(new Map([[e,p]]),{x:0,y:0,width:U,height:X},B,!0).length>0||J(p.position.x+j.width/2,p.position.y+j.height/2,{zoom:B[2]})};return P.jsx("div",{className:ue(["react-flow__node",`react-flow__node-${w}`,{[h]:I},p.className,{selected:p.selected,selectable:q,parent:x,draggable:I,dragging:T}]),ref:S,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:k?"all":"none",visibility:L?"visible":"hidden",...p.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:H,onMouseMove:G,onMouseLeave:V,onContextMenu:Y,onClick:D,onDoubleClick:A,onKeyDown:C?$:void 0,tabIndex:C?0:void 0,onFocus:C?z:void 0,role:p.ariaRole??(C?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${ky}-${m}`,"aria-label":p.ariaLabel,...p.domAttributes,children:P.jsx(jE,{value:e,children:P.jsx(E,{id:e,data:p.data,type:w,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:p.selected??!1,selectable:q,draggable:I,deletable:p.deletable??!0,isConnectable:R,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:T,dragHandle:p.dragHandle,zIndex:_.z,parentId:p.parentId,...j})})})}var nS=F.memo(rS);const iS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Gy(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:i,onError:a}=ne(iS,ie),o=QE(e.onlyRenderVisibleElements),s=eS();return P.jsx("div",{className:"react-flow__nodes",style:Hr,children:o.map(u=>P.jsx(nS,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}Gy.displayName="NodeRenderer";const aS=F.memo(Gy);function oS(e){return ne(F.useCallback(r=>{if(!e)return r.edges.map(i=>i.id);const n=[];if(r.width&&r.height)for(const i of r.edges){const a=r.nodeLookup.get(i.source),o=r.nodeLookup.get(i.target);a&&o&&i1({sourceNode:a,targetNode:o,width:r.width,height:r.height,transform:r.transform})&&n.push(i.id)}return n},[e]),ie)}const sS=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return P.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},uS=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return P.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Uf={[Bt.Arrow]:sS,[Bt.ArrowClosed]:uS};function cS(e){const t=ae();return F.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(Uf,e)?Uf[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Ae.error009(e)),null)},[e])}const fS=({id:e,type:t,color:r,width:n=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:s="auto-start-reverse"})=>{const u=cS(t);return u?P.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${n}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:s,refX:"0",refY:"0",children:P.jsx(u,{color:r,strokeWidth:o})}):null},Uy=({defaultColor:e,rfId:t})=>{const r=ne(a=>a.edges),n=ne(a=>a.defaultEdgeOptions),i=F.useMemo(()=>d1(r,{id:t,defaultColor:e,defaultMarkerStart:n==null?void 0:n.markerStart,defaultMarkerEnd:n==null?void 0:n.markerEnd}),[r,n,t,e]);return i.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:i.map(a=>P.jsx(fS,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};Uy.displayName="MarkerDefinitions";var lS=F.memo(Uy);function Yy({x:e,y:t,label:r,labelStyle:n,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:u,className:c,...f}){const[l,d]=F.useState({x:1,y:0,width:0,height:0}),h=ue(["react-flow__edge-textwrapper",c]),g=F.useRef(null);return F.useEffect(()=>{if(g.current){const m=g.current.getBBox();d({x:m.x,y:m.y,width:m.width,height:m.height})}},[r]),r?P.jsxs("g",{transform:`translate(${e-l.width/2} ${t-l.height/2})`,className:h,visibility:l.width?"visible":"hidden",...f,children:[i&&P.jsx("rect",{width:l.width+2*o[0],x:-o[0],y:-o[1],height:l.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:s,ry:s}),P.jsx("text",{className:"react-flow__edge-text",y:l.height/2,dy:"0.3em",ref:g,style:n,children:r}),u]}):null}Yy.displayName="EdgeText";const dS=F.memo(Yy);function Vr({path:e,labelX:t,labelY:r,label:n,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:u,interactionWidth:c=20,...f}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...f,d:e,fill:"none",className:ue(["react-flow__edge-path",f.className])}),c?P.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,n&&xe(t)&&xe(r)?P.jsx(dS,{x:t,y:r,label:n,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:u}):null]})}function Yf({pos:e,x1:t,y1:r,x2:n,y2:i}){return e===Q.Left||e===Q.Right?[.5*(t+n),r]:[t,.5*(r+i)]}function Wy({sourceX:e,sourceY:t,sourcePosition:r=Q.Bottom,targetX:n,targetY:i,targetPosition:a=Q.Top}){const[o,s]=Yf({pos:r,x1:e,y1:t,x2:n,y2:i}),[u,c]=Yf({pos:a,x1:n,y1:i,x2:e,y2:t}),[f,l,d,h]=vy({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:u,targetControlY:c});return[`M${e},${t} C${o},${s} ${u},${c} ${n},${i}`,f,l,d,h]}function Xy(e){return F.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:y})=>{const[b,p,_]=Wy({sourceX:r,sourceY:n,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return P.jsx(Vr,{id:x,path:b,labelX:p,labelY:_,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:y})})}const hS=Xy({isInternal:!1}),Ky=Xy({isInternal:!0});hS.displayName="SimpleBezierEdge";Ky.displayName="SimpleBezierEdgeInternal";function Zy(e){return F.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:l,style:d,sourcePosition:h=Q.Bottom,targetPosition:g=Q.Top,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:b})=>{const[p,_,x]=Qu({sourceX:r,sourceY:n,sourcePosition:h,targetX:i,targetY:a,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),w=e.isInternal?void 0:t;return P.jsx(Vr,{id:w,path:p,labelX:_,labelY:x,label:o,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:l,style:d,markerEnd:m,markerStart:v,interactionWidth:b})})}const Qy=Zy({isInternal:!1}),Jy=Zy({isInternal:!0});Qy.displayName="SmoothStepEdge";Jy.displayName="SmoothStepEdgeInternal";function em(e){return F.memo(({id:t,...r})=>{var i;const n=e.isInternal?void 0:t;return P.jsx(Qy,{...r,id:n,pathOptions:F.useMemo(()=>{var a;return{borderRadius:0,offset:(a=r.pathOptions)==null?void 0:a.offset}},[(i=r.pathOptions)==null?void 0:i.offset])})})}const pS=em({isInternal:!1}),tm=em({isInternal:!0});pS.displayName="StepEdge";tm.displayName="StepEdgeInternal";function rm(e){return F.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:l,style:d,markerEnd:h,markerStart:g,interactionWidth:m})=>{const[v,y,b]=_y({sourceX:r,sourceY:n,targetX:i,targetY:a}),p=e.isInternal?void 0:t;return P.jsx(Vr,{id:p,path:v,labelX:y,labelY:b,label:o,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:l,style:d,markerEnd:h,markerStart:g,interactionWidth:m})})}const gS=rm({isInternal:!1}),nm=rm({isInternal:!0});gS.displayName="StraightEdge";nm.displayName="StraightEdgeInternal";function im(e){return F.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,sourcePosition:o=Q.Bottom,targetPosition:s=Q.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:b})=>{const[p,_,x]=yy({sourceX:r,sourceY:n,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:y==null?void 0:y.curvature}),w=e.isInternal?void 0:t;return P.jsx(Vr,{id:w,path:p,labelX:_,labelY:x,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:b})})}const vS=im({isInternal:!1}),am=im({isInternal:!0});vS.displayName="BezierEdge";am.displayName="BezierEdgeInternal";const Wf={default:am,straight:nm,step:tm,smoothstep:Jy,simplebezier:Ky},Xf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yS=(e,t,r)=>r===Q.Left?e-t:r===Q.Right?e+t:e,mS=(e,t,r)=>r===Q.Top?e-t:r===Q.Bottom?e+t:e,Kf="react-flow__edgeupdater";function Zf({position:e,centerX:t,centerY:r,radius:n=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return P.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:ue([Kf,`${Kf}-${s}`]),cx:yS(t,n,e),cy:mS(r,n,e),r:n,stroke:"transparent",fill:"transparent"})}function _S({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:n,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:u,onReconnect:c,onReconnectStart:f,onReconnectEnd:l,setReconnecting:d,setUpdateHover:h}){const g=ae(),m=(_,x)=>{if(_.button!==0)return;const{autoPanOnConnect:w,domNode:E,isValidConnection:I,connectionMode:q,connectionRadius:R,lib:C,onConnectStart:N,onConnectEnd:L,cancelConnection:S,nodeLookup:T,rfId:M,panBy:j,updateConnection:O}=g.getState(),k=x.type==="target",H=(Y,A)=>{d(!1),l==null||l(Y,r,x.type,A)},G=Y=>c==null?void 0:c(r,Y),V=(Y,A)=>{d(!0),f==null||f(_,r,x.type),N==null||N(Y,A)};tc.onPointerDown(_.nativeEvent,{autoPanOnConnect:w,connectionMode:q,connectionRadius:R,domNode:E,handleId:x.id,nodeId:x.nodeId,nodeLookup:T,isTarget:k,edgeUpdaterType:x.type,lib:C,flowId:M,cancelConnection:S,panBy:j,isValidConnection:I,onConnect:G,onConnectStart:V,onConnectEnd:L,onReconnectEnd:H,updateConnection:O,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},v=_=>m(_,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),y=_=>m(_,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),b=()=>h(!0),p=()=>h(!1);return P.jsxs(P.Fragment,{children:[(e===!0||e==="source")&&P.jsx(Zf,{position:s,centerX:n,centerY:i,radius:t,onMouseDown:v,onMouseEnter:b,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&P.jsx(Zf,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:p,type:"target"})]})}function bS({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:n,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:u,onMouseLeave:c,reconnectRadius:f,onReconnect:l,onReconnectStart:d,onReconnectEnd:h,rfId:g,edgeTypes:m,noPanClassName:v,onError:y,disableKeyboardA11y:b}){let p=ne(J=>J.edgeLookup.get(e));const _=ne(J=>J.defaultEdgeOptions);p=_?{..._,...p}:p;let x=p.type||"default",w=(m==null?void 0:m[x])||Wf[x];w===void 0&&(y==null||y("011",Ae.error011(x)),x="default",w=(m==null?void 0:m.default)||Wf.default);const E=!!(p.focusable||t&&typeof p.focusable>"u"),I=typeof l<"u"&&(p.reconnectable||r&&typeof p.reconnectable>"u"),q=!!(p.selectable||n&&typeof p.selectable>"u"),R=F.useRef(null),[C,N]=F.useState(!1),[L,S]=F.useState(!1),T=ae(),{zIndex:M,sourceX:j,sourceY:O,targetX:k,targetY:H,sourcePosition:G,targetPosition:V}=ne(F.useCallback(J=>{const W=J.nodeLookup.get(p.source),te=J.nodeLookup.get(p.target);if(!W||!te)return{zIndex:p.zIndex,...Xf};const Z=l1({id:e,sourceNode:W,targetNode:te,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:J.connectionMode,onError:y});return{zIndex:n1({selected:p.selected,zIndex:p.zIndex,sourceNode:W,targetNode:te,elevateOnSelect:J.elevateEdgesOnSelect,zIndexMode:J.zIndexMode}),...Z||Xf}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),ie),Y=F.useMemo(()=>p.markerStart?`url('#${Ju(p.markerStart,g)}')`:void 0,[p.markerStart,g]),A=F.useMemo(()=>p.markerEnd?`url('#${Ju(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||j===null||O===null||k===null||H===null)return null;const D=J=>{var re;const{addSelectedEdges:W,unselectNodesAndEdges:te,multiSelectionActive:Z}=T.getState();q&&(T.setState({nodesSelectionActive:!1}),p.selected&&Z?(te({nodes:[],edges:[p]}),(re=R.current)==null||re.blur()):W([e])),i&&i(J,p)},$=a?J=>{a(J,{...p})}:void 0,z=o?J=>{o(J,{...p})}:void 0,B=s?J=>{s(J,{...p})}:void 0,U=u?J=>{u(J,{...p})}:void 0,X=c?J=>{c(J,{...p})}:void 0,K=J=>{var W;if(!b&&ry.includes(J.key)&&q){const{unselectNodesAndEdges:te,addSelectedEdges:Z}=T.getState();J.key==="Escape"?((W=R.current)==null||W.blur(),te({edges:[p]})):Z([e])}};return P.jsx("svg",{style:{zIndex:M},children:P.jsxs("g",{className:ue(["react-flow__edge",`react-flow__edge-${x}`,p.className,v,{selected:p.selected,animated:p.animated,inactive:!q&&!i,updating:C,selectable:q}]),onClick:D,onDoubleClick:$,onContextMenu:z,onMouseEnter:B,onMouseMove:U,onMouseLeave:X,onKeyDown:E?K:void 0,tabIndex:E?0:void 0,role:p.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":E?`${Py}-${g}`:void 0,ref:R,...p.domAttributes,children:[!L&&P.jsx(w,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:q,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:j,sourceY:O,targetX:k,targetY:H,sourcePosition:G,targetPosition:V,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:Y,markerEnd:A,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),I&&P.jsx(_S,{edge:p,isReconnectable:I,reconnectRadius:f,onReconnect:l,onReconnectStart:d,onReconnectEnd:h,sourceX:j,sourceY:O,targetX:k,targetY:H,sourcePosition:G,targetPosition:V,setUpdateHover:N,setReconnecting:S})]})})}var xS=F.memo(bS);const wS=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function om({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:n,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:f,reconnectRadius:l,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:b,onError:p}=ne(wS,ie),_=oS(t);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(lS,{defaultColor:e,rfId:r}),_.map(x=>P.jsx(xS,{id:x,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:b,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:u,onMouseLeave:c,onClick:f,reconnectRadius:l,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,rfId:r,onError:p,edgeTypes:n,disableKeyboardA11y:m},x))]})}om.displayName="EdgeRenderer";const ES=F.memo(om),SS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CS({children:e}){const t=ne(SS);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function qS(e){const t=bc(),r=F.useRef(!1);F.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const IS=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function NS(e){const t=ne(IS),r=ae();return F.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function RS(e){return e.connection.inProgress?{...e.connection,to:Zt(e.connection.to,e.transform)}:{...e.connection}}function AS(e){return RS}function MS(e){const t=AS();return ne(t,ie)}const TS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function kS({containerStyle:e,style:t,type:r,component:n}){const{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:u}=ne(TS,ie);return!(a&&i&&u)?null:P.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:ue(["react-flow__connection",ay(s)]),children:P.jsx(sm,{style:t,type:r,CustomComponent:n,isValid:s})})})}const sm=({style:e,type:t=Xe.Bezier,CustomComponent:r,isValid:n})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:u,to:c,toNode:f,toHandle:l,toPosition:d,pointer:h}=MS();if(!i)return;if(r)return P.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:d,connectionStatus:ay(n),toNode:f,toHandle:l,pointer:h});let g="";const m={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Xe.Bezier:[g]=yy(m);break;case Xe.SimpleBezier:[g]=Wy(m);break;case Xe.Step:[g]=Qu({...m,borderRadius:0});break;case Xe.SmoothStep:[g]=Qu(m);break;default:[g]=_y(m)}return P.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};sm.displayName="ConnectionLine";const PS={};function Qf(e=PS){F.useRef(e),ae(),F.useEffect(()=>{},[e])}function LS(){ae(),F.useRef(!1),F.useEffect(()=>{},[])}function um({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:n,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,onSelectionContextMenu:l,onSelectionStart:d,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:p,selectionMode:_,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:E,deleteKeyCode:I,onlyRenderVisibleElements:q,elementsSelectable:R,defaultViewport:C,translateExtent:N,minZoom:L,maxZoom:S,preventScrolling:T,defaultMarkerColor:M,zoomOnScroll:j,zoomOnPinch:O,panOnScroll:k,panOnScrollSpeed:H,panOnScrollMode:G,zoomOnDoubleClick:V,panOnDrag:Y,onPaneClick:A,onPaneMouseEnter:D,onPaneMouseMove:$,onPaneMouseLeave:z,onPaneScroll:B,onPaneContextMenu:U,paneClickDistance:X,nodeClickDistance:K,onEdgeContextMenu:J,onEdgeMouseEnter:W,onEdgeMouseMove:te,onEdgeMouseLeave:Z,reconnectRadius:re,onReconnect:ee,onReconnectStart:le,onReconnectEnd:fe,noDragClassName:ke,noWheelClassName:qe,noPanClassName:de,disableKeyboardA11y:se,nodeExtent:Ve,rfId:Pe,viewport:Ge,onViewportChange:Ue}){return Qf(e),Qf(t),LS(),qS(r),NS(Ge),P.jsx(KE,{onPaneClick:A,onPaneMouseEnter:D,onPaneMouseMove:$,onPaneMouseLeave:z,onPaneContextMenu:U,onPaneScroll:B,paneClickDistance:X,deleteKeyCode:I,selectionKeyCode:b,selectionOnDrag:p,selectionMode:_,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:E,elementsSelectable:R,zoomOnScroll:j,zoomOnPinch:O,zoomOnDoubleClick:V,panOnScroll:k,panOnScrollSpeed:H,panOnScrollMode:G,panOnDrag:Y,defaultViewport:C,translateExtent:N,minZoom:L,maxZoom:S,onSelectionContextMenu:l,preventScrolling:T,noDragClassName:ke,noWheelClassName:qe,noPanClassName:de,disableKeyboardA11y:se,onViewportChange:Ue,isControlledViewport:!!Ge,children:P.jsxs(CS,{children:[P.jsx(ES,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ee,onReconnectStart:le,onReconnectEnd:fe,onlyRenderVisibleElements:q,onEdgeContextMenu:J,onEdgeMouseEnter:W,onEdgeMouseMove:te,onEdgeMouseLeave:Z,reconnectRadius:re,defaultMarkerColor:M,noPanClassName:de,disableKeyboardA11y:se,rfId:Pe}),P.jsx(kS,{style:m,type:g,component:v,containerStyle:y}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(aS,{nodeTypes:e,onNodeClick:n,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,nodeClickDistance:K,onlyRenderVisibleElements:q,noPanClassName:de,noDragClassName:ke,disableKeyboardA11y:se,nodeExtent:Ve,rfId:Pe}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}um.displayName="GraphView";const OS=F.memo(um),Jf=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:u=.5,maxZoom:c=2,nodeOrigin:f,nodeExtent:l,zIndexMode:d="basic"}={})=>{const h=new Map,g=new Map,m=new Map,v=new Map,y=n??t??[],b=r??e??[],p=f??[0,0],_=l??$t;wy(m,v,y);const x=ec(b,h,g,{nodeOrigin:p,nodeExtent:_,zIndexMode:d});let w=[0,0,1];if(o&&i&&a){const E=Xt(h,{filter:C=>!!((C.width||C.initialWidth)&&(C.height||C.initialHeight))}),{x:I,y:q,zoom:R}=hc(E,i,a,u,c,(s==null?void 0:s.padding)??.1);w=[I,q,R]}return{rfId:"1",width:i??0,height:a??0,transform:w,nodes:b,nodesInitialized:x,nodeLookup:h,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:n!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:$t,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...iy},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Zw,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ny,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},DS=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:u,maxZoom:c,nodeOrigin:f,nodeExtent:l,zIndexMode:d})=>tE((h,g)=>{async function m(){const{nodeLookup:v,panZoom:y,fitViewOptions:b,fitViewResolver:p,width:_,height:x,minZoom:w,maxZoom:E}=g();y&&(await Xw({nodes:v,width:_,height:x,panZoom:y,minZoom:w,maxZoom:E},b),p==null||p.resolve(!0),h({fitViewResolver:null}))}return{...Jf({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:u,maxZoom:c,nodeOrigin:f,nodeExtent:l,defaultNodes:r,defaultEdges:n,zIndexMode:d}),setNodes:v=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:p,elevateNodesOnSelect:_,fitViewQueued:x,zIndexMode:w}=g(),E=ec(v,y,b,{nodeOrigin:p,nodeExtent:l,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:w});x&&E?(m(),h({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:v,nodesInitialized:E})},setEdges:v=>{const{connectionLookup:y,edgeLookup:b}=g();wy(y,b,v),h({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:b}=g();b(v),h({hasDefaultNodes:!0})}if(y){const{setEdges:b}=g();b(y),h({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:p,domNode:_,nodeOrigin:x,nodeExtent:w,debug:E,fitViewQueued:I,zIndexMode:q}=g(),{changes:R,updatedInternals:C}=_1(v,b,p,_,x,w,q);C&&(g1(b,p,{nodeOrigin:x,nodeExtent:w,zIndexMode:q}),I?(m(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(R==null?void 0:R.length)>0&&(E&&console.log("React Flow: trigger node changes",R),y==null||y(R)))},updateNodePositions:(v,y=!1)=>{const b=[];let p=[];const{nodeLookup:_,triggerNodeChanges:x,connection:w,updateConnection:E,onNodesChangeMiddlewareMap:I}=g();for(const[q,R]of v){const C=_.get(q),N=!!(C!=null&&C.expandParent&&(C!=null&&C.parentId)&&(R!=null&&R.position)),L={id:q,type:"position",position:N?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:y};if(C&&w.inProgress&&w.fromNode.id===C.id){const S=it(C,w.fromHandle,Q.Left,!0);E({...w,from:S})}N&&C.parentId&&b.push({id:q,parentId:C.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),p.push(L)}if(b.length>0){const{parentLookup:q,nodeOrigin:R}=g(),C=_c(b,_,q,R);p.push(...C)}for(const q of I.values())p=q(p);x(p)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:b,nodes:p,hasDefaultNodes:_,debug:x}=g();if(v!=null&&v.length){if(_){const w=Dy(v,p);b(w)}x&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:b,edges:p,hasDefaultEdges:_,debug:x}=g();if(v!=null&&v.length){if(_){const w=jy(v,p);b(w)}x&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:x}=g();if(y){const w=v.map(E=>Ze(E,!0));_(w);return}_(dt(p,new Set([...v]),!0)),x(dt(b))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:x}=g();if(y){const w=v.map(E=>Ze(E,!0));x(w);return}x(dt(b,new Set([...v]))),_(dt(p,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:b,nodes:p,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:w}=g(),E=v||p,I=y||b,q=E.map(C=>{const N=_.get(C.id);return N&&(N.selected=!1),Ze(C.id,!1)}),R=I.map(C=>Ze(C.id,!1));x(q),w(R)},setMinZoom:v=>{const{panZoom:y,maxZoom:b}=g();y==null||y.setScaleExtent([v,b]),h({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:b}=g();y==null||y.setScaleExtent([b,v]),h({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),h({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:p,elementsSelectable:_}=g();if(!_)return;const x=y.reduce((E,I)=>I.selected?[...E,Ze(I.id,!1)]:E,[]),w=v.reduce((E,I)=>I.selected?[...E,Ze(I.id,!1)]:E,[]);b(x),p(w)},setNodeExtent:v=>{const{nodes:y,nodeLookup:b,parentLookup:p,nodeOrigin:_,elevateNodesOnSelect:x,nodeExtent:w,zIndexMode:E}=g();v[0][0]===w[0][0]&&v[0][1]===w[0][1]&&v[1][0]===w[1][0]&&v[1][1]===w[1][1]||(ec(y,b,p,{nodeOrigin:_,nodeExtent:v,elevateNodesOnSelect:x,checkEquality:!1,zIndexMode:E}),h({nodeExtent:v}))},panBy:v=>{const{transform:y,width:b,height:p,panZoom:_,translateExtent:x}=g();return b1({delta:v,panZoom:_,transform:y,translateExtent:x,width:b,height:p})},setCenter:async(v,y,b)=>{const{width:p,height:_,maxZoom:x,panZoom:w}=g();if(!w)return Promise.resolve(!1);const E=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:x;return await w.setViewport({x:p/2-v*E,y:_/2-y*E,zoom:E},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...iy}})},updateConnection:v=>{h({connection:v})},reset:()=>h({...Jf()})}},Object.is);function jS({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:n,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:u,fitView:c,nodeOrigin:f,nodeExtent:l,zIndexMode:d,children:h}){const[g]=F.useState(()=>DS({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:c,minZoom:o,maxZoom:s,fitViewOptions:u,nodeOrigin:f,nodeExtent:l,zIndexMode:d}));return P.jsx(rE,{value:g,children:P.jsx(CE,{children:h})})}function FS({children:e,nodes:t,edges:r,defaultNodes:n,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:u,minZoom:c,maxZoom:f,nodeOrigin:l,nodeExtent:d,zIndexMode:h}){return F.useContext(zr)?P.jsx(P.Fragment,{children:e}):P.jsx(jS,{initialNodes:t,initialEdges:r,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:f,nodeOrigin:l,nodeExtent:d,zIndexMode:h,children:e})}const $S={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function zS({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:u,onInit:c,onMove:f,onMoveStart:l,onMoveEnd:d,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:w,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:q,onNodesDelete:R,onEdgesDelete:C,onDelete:N,onSelectionChange:L,onSelectionDragStart:S,onSelectionDrag:T,onSelectionDragStop:M,onSelectionContextMenu:j,onSelectionStart:O,onSelectionEnd:k,onBeforeDelete:H,connectionMode:G,connectionLineType:V=Xe.Bezier,connectionLineStyle:Y,connectionLineComponent:A,connectionLineContainerStyle:D,deleteKeyCode:$="Backspace",selectionKeyCode:z="Shift",selectionOnDrag:B=!1,selectionMode:U=zt.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=Vt()?"Meta":"Control",zoomActivationKeyCode:J=Vt()?"Meta":"Control",snapToGrid:W,snapGrid:te,onlyRenderVisibleElements:Z=!1,selectNodesOnDrag:re,nodesDraggable:ee,autoPanOnNodeFocus:le,nodesConnectable:fe,nodesFocusable:ke,nodeOrigin:qe=Ly,edgesFocusable:de,edgesReconnectable:se,elementsSelectable:Ve=!0,defaultViewport:Pe=gE,minZoom:Ge=.5,maxZoom:Ue=2,translateExtent:Le=$t,preventScrolling:nr=!0,nodeExtent:ct,defaultMarkerColor:cn="#b1b1b7",zoomOnScroll:ir=!0,zoomOnPinch:Ie=!0,panOnScroll:Oe=!1,panOnScrollSpeed:d0=.5,panOnScrollMode:h0=et.Free,zoomOnDoubleClick:p0=!0,panOnDrag:g0=!0,onPaneClick:v0,onPaneMouseEnter:y0,onPaneMouseMove:m0,onPaneMouseLeave:_0,onPaneScroll:b0,onPaneContextMenu:x0,paneClickDistance:w0=1,nodeClickDistance:E0=0,children:S0,onReconnect:C0,onReconnectStart:q0,onReconnectEnd:I0,onEdgeContextMenu:N0,onEdgeDoubleClick:R0,onEdgeMouseEnter:A0,onEdgeMouseMove:M0,onEdgeMouseLeave:T0,reconnectRadius:k0=10,onNodesChange:P0,onEdgesChange:L0,noDragClassName:O0="nodrag",noWheelClassName:D0="nowheel",noPanClassName:$c="nopan",fitView:zc,fitViewOptions:Bc,connectOnClick:j0,attributionPosition:F0,proOptions:$0,defaultEdgeOptions:z0,elevateNodesOnSelect:B0=!0,elevateEdgesOnSelect:H0=!1,disableKeyboardA11y:Hc=!1,autoPanOnConnect:V0,autoPanOnNodeDrag:G0,autoPanSpeed:U0,connectionRadius:Y0,isValidConnection:W0,onError:X0,style:K0,id:Vc,nodeDragThreshold:Z0,connectionDragThreshold:Q0,viewport:J0,onViewportChange:e_,width:t_,height:r_,colorMode:n_="light",debug:i_,onScroll:ar,ariaLabelConfig:a_,zIndexMode:Gc="basic",...o_},s_){const fn=Vc||"1",u_=_E(n_),c_=F.useCallback(Uc=>{Uc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ar==null||ar(Uc)},[ar]);return P.jsx("div",{"data-testid":"rf__wrapper",...o_,onScroll:c_,style:{...K0,...$S},ref:s_,className:ue(["react-flow",i,u_]),id:Vc,role:"application",children:P.jsxs(FS,{nodes:e,edges:t,width:t_,height:r_,fitView:zc,fitViewOptions:Bc,minZoom:Ge,maxZoom:Ue,nodeOrigin:qe,nodeExtent:ct,zIndexMode:Gc,children:[P.jsx(OS,{onInit:c,onNodeClick:s,onEdgeClick:u,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:w,nodeTypes:a,edgeTypes:o,connectionLineType:V,connectionLineStyle:Y,connectionLineComponent:A,connectionLineContainerStyle:D,selectionKeyCode:z,selectionOnDrag:B,selectionMode:U,deleteKeyCode:$,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:J,onlyRenderVisibleElements:Z,defaultViewport:Pe,translateExtent:Le,minZoom:Ge,maxZoom:Ue,preventScrolling:nr,zoomOnScroll:ir,zoomOnPinch:Ie,zoomOnDoubleClick:p0,panOnScroll:Oe,panOnScrollSpeed:d0,panOnScrollMode:h0,panOnDrag:g0,onPaneClick:v0,onPaneMouseEnter:y0,onPaneMouseMove:m0,onPaneMouseLeave:_0,onPaneScroll:b0,onPaneContextMenu:x0,paneClickDistance:w0,nodeClickDistance:E0,onSelectionContextMenu:j,onSelectionStart:O,onSelectionEnd:k,onReconnect:C0,onReconnectStart:q0,onReconnectEnd:I0,onEdgeContextMenu:N0,onEdgeDoubleClick:R0,onEdgeMouseEnter:A0,onEdgeMouseMove:M0,onEdgeMouseLeave:T0,reconnectRadius:k0,defaultMarkerColor:cn,noDragClassName:O0,noWheelClassName:D0,noPanClassName:$c,rfId:fn,disableKeyboardA11y:Hc,nodeExtent:ct,viewport:J0,onViewportChange:e_}),P.jsx(mE,{nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ee,autoPanOnNodeFocus:le,nodesConnectable:fe,nodesFocusable:ke,edgesFocusable:de,edgesReconnectable:se,elementsSelectable:Ve,elevateNodesOnSelect:B0,elevateEdgesOnSelect:H0,minZoom:Ge,maxZoom:Ue,nodeExtent:ct,onNodesChange:P0,onEdgesChange:L0,snapToGrid:W,snapGrid:te,connectionMode:G,translateExtent:Le,connectOnClick:j0,defaultEdgeOptions:z0,fitView:zc,fitViewOptions:Bc,onNodesDelete:R,onEdgesDelete:C,onDelete:N,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:q,onSelectionDrag:T,onSelectionDragStart:S,onSelectionDragStop:M,onMove:f,onMoveStart:l,onMoveEnd:d,noPanClassName:$c,nodeOrigin:qe,rfId:fn,autoPanOnConnect:V0,autoPanOnNodeDrag:G0,autoPanSpeed:U0,onError:X0,connectionRadius:Y0,isValidConnection:W0,selectNodesOnDrag:re,nodeDragThreshold:Z0,connectionDragThreshold:Q0,onBeforeDelete:H,debug:i_,ariaLabelConfig:a_,zIndexMode:Gc}),P.jsx(pE,{onSelectionChange:L}),S0,P.jsx(cE,{proOptions:$0,position:F0}),P.jsx(uE,{rfId:fn,disableKeyboardA11y:Hc})]})})}var BS=Fy(zS);function HS(e){const[t,r]=F.useState(e),n=F.useCallback(i=>r(a=>Dy(i,a)),[]);return[t,r,n]}function VS(e){const[t,r]=F.useState(e),n=F.useCallback(i=>r(a=>jy(i,a)),[]);return[t,r,n]}function GS({dimensions:e,lineWidth:t,variant:r,className:n}){return P.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ue(["react-flow__background-pattern",r,n])})}function US({radius:e,className:t}){return P.jsx("circle",{cx:e,cy:e,r:e,className:ue(["react-flow__background-pattern","dots",t])})}var Fe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fe||(Fe={}));const YS={[Fe.Dots]:1,[Fe.Lines]:1,[Fe.Cross]:6},WS=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cm({id:e,variant:t=Fe.Dots,gap:r=20,size:n,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:u,className:c,patternClassName:f}){const l=F.useRef(null),{transform:d,patternId:h}=ne(WS,ie),g=n||YS[t],m=t===Fe.Dots,v=t===Fe.Cross,y=Array.isArray(r)?r:[r,r],b=[y[0]*d[2]||1,y[1]*d[2]||1],p=g*d[2],_=Array.isArray(a)?a:[a,a],x=v?[p,p]:b,w=[_[0]*d[2]||1+x[0]/2,_[1]*d[2]||1+x[1]/2],E=`${h}${e||""}`;return P.jsxs("svg",{className:ue(["react-flow__background",c]),style:{...u,...Hr,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:l,"data-testid":"rf__background",children:[P.jsx("pattern",{id:E,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`,children:m?P.jsx(US,{radius:p/2,className:f}):P.jsx(GS,{dimensions:x,lineWidth:i,variant:t,className:f})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}cm.displayName="Background";const XS=F.memo(cm);function KS(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZS(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function QS(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function JS(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function eC(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function gr({children:e,className:t,...r}){return P.jsx("button",{type:"button",className:ue(["react-flow__controls-button",t]),...r,children:e})}const tC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function fm({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:n=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:u,className:c,children:f,position:l="bottom-left",orientation:d="vertical","aria-label":h}){const g=ae(),{isInteractive:m,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:b}=ne(tC,ie),{zoomIn:p,zoomOut:_,fitView:x}=bc(),w=()=>{p(),a==null||a()},E=()=>{_(),o==null||o()},I=()=>{x(i),s==null||s()},q=()=>{g.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),u==null||u(!m)},R=d==="horizontal"?"horizontal":"vertical";return P.jsxs(Br,{className:ue(["react-flow__controls",R,c]),position:l,style:e,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[t&&P.jsxs(P.Fragment,{children:[P.jsx(gr,{onClick:w,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:P.jsx(KS,{})}),P.jsx(gr,{onClick:E,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:v,children:P.jsx(ZS,{})})]}),r&&P.jsx(gr,{className:"react-flow__controls-fitview",onClick:I,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:P.jsx(QS,{})}),n&&P.jsx(gr,{className:"react-flow__controls-interactive",onClick:q,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:m?P.jsx(eC,{}):P.jsx(JS,{})}),f]})}fm.displayName="Controls";const rC=F.memo(fm);function nC({id:e,x:t,y:r,width:n,height:i,style:a,color:o,strokeColor:s,strokeWidth:u,className:c,borderRadius:f,shapeRendering:l,selected:d,onClick:h}){const{background:g,backgroundColor:m}=a||{},v=o||g||m;return P.jsx("rect",{className:ue(["react-flow__minimap-node",{selected:d},c]),x:t,y:r,rx:f,ry:f,width:n,height:i,style:{fill:v,stroke:s,strokeWidth:u},shapeRendering:l,onClick:h?y=>h(y,e):void 0})}const iC=F.memo(nC),aC=e=>e.nodes.map(t=>t.id),En=e=>e instanceof Function?e:()=>e;function oC({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:n=5,nodeStrokeWidth:i,nodeComponent:a=iC,onClick:o}){const s=ne(aC,ie),u=En(t),c=En(e),f=En(r),l=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:s.map(d=>P.jsx(uC,{id:d,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:f,nodeBorderRadius:n,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:l},d))})}function sC({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:n,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:u}){const{node:c,x:f,y:l,width:d,height:h}=ne(g=>{const{internals:m}=g.nodeLookup.get(e),v=m.userNode,{x:y,y:b}=m.positionAbsolute,{width:p,height:_}=ze(v);return{node:v,x:y,y:b,width:p,height:_}},ie);return!c||c.hidden||!ly(c)?null:P.jsx(s,{x:f,y:l,width:d,height:h,style:c.style,selected:!!c.selected,className:n(c),color:t(c),borderRadius:i,strokeColor:r(c),strokeWidth:a,shapeRendering:o,onClick:u,id:c.id})}const uC=F.memo(sC);var cC=F.memo(oC);const fC=200,lC=150,dC=e=>!e.hidden,hC=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?fy(Xt(e.nodeLookup,{filter:dC}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},pC="react-flow__minimap-desc";function lm({style:e,className:t,nodeStrokeColor:r,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:u,maskColor:c,maskStrokeColor:f,maskStrokeWidth:l,position:d="bottom-right",onClick:h,onNodeClick:g,pannable:m=!1,zoomable:v=!1,ariaLabel:y,inversePan:b,zoomStep:p=1,offsetScale:_=5}){const x=ae(),w=F.useRef(null),{boundingRect:E,viewBB:I,rfId:q,panZoom:R,translateExtent:C,flowWidth:N,flowHeight:L,ariaLabelConfig:S}=ne(hC,ie),T=(e==null?void 0:e.width)??fC,M=(e==null?void 0:e.height)??lC,j=E.width/T,O=E.height/M,k=Math.max(j,O),H=k*T,G=k*M,V=_*k,Y=E.x-(H-E.width)/2-V,A=E.y-(G-E.height)/2-V,D=H+V*2,$=G+V*2,z=`${pC}-${q}`,B=F.useRef(0),U=F.useRef();B.current=k,F.useEffect(()=>{if(w.current&&R)return U.current=R1({domNode:w.current,panZoom:R,getTransform:()=>x.getState().transform,getViewScale:()=>B.current}),()=>{var W;(W=U.current)==null||W.destroy()}},[R]),F.useEffect(()=>{var W;(W=U.current)==null||W.update({translateExtent:C,width:N,height:L,inversePan:b,pannable:m,zoomStep:p,zoomable:v})},[m,v,b,p,C,N,L]);const X=h?W=>{var re;const[te,Z]=((re=U.current)==null?void 0:re.pointer(W))||[0,0];h(W,{x:te,y:Z})}:void 0,K=g?F.useCallback((W,te)=>{const Z=x.getState().nodeLookup.get(te).internals.userNode;g(W,Z)},[]):void 0,J=y??S["minimap.ariaLabel"];return P.jsx(Br,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof l=="number"?l*k:void 0,"--xy-minimap-node-background-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:ue(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:T,height:M,viewBox:`${Y} ${A} ${D} ${$}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":z,ref:w,onClick:X,children:[J&&P.jsx("title",{id:z,children:J}),P.jsx(cC,{onClick:K,nodeColor:n,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-V},${A-V}h${D+V*2}v${$+V*2}h${-D-V*2}z
|
|
23
|
+
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}lm.displayName="MiniMap";F.memo(lm);const gC=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,vC={[xt.Line]:"right",[xt.Handle]:"bottom-right"};function yC({nodeId:e,position:t,variant:r=xt.Handle,className:n,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:l=!1,resizeDirection:d,autoScale:h=!0,shouldResize:g,onResizeStart:m,onResize:v,onResizeEnd:y}){const b=Hy(),p=typeof e=="string"?e:b,_=ae(),x=F.useRef(null),w=r===xt.Handle,E=ne(F.useCallback(gC(w&&h),[w,h]),ie),I=F.useRef(null),q=t??vC[r];F.useEffect(()=>{if(!(!x.current||!p))return I.current||(I.current=H1({domNode:x.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:C,transform:N,snapGrid:L,snapToGrid:S,nodeOrigin:T,domNode:M}=_.getState();return{nodeLookup:C,transform:N,snapGrid:L,snapToGrid:S,nodeOrigin:T,paneDomNode:M}},onChange:(C,N)=>{const{triggerNodeChanges:L,nodeLookup:S,parentLookup:T,nodeOrigin:M}=_.getState(),j=[],O={x:C.x,y:C.y},k=S.get(p);if(k&&k.expandParent&&k.parentId){const H=k.origin??M,G=C.width??k.measured.width??0,V=C.height??k.measured.height??0,Y={id:k.id,parentId:k.parentId,rect:{width:G,height:V,...dy({x:C.x??k.position.x,y:C.y??k.position.y},{width:G,height:V},k.parentId,S,H)}},A=_c([Y],S,T,M);j.push(...A),O.x=C.x?Math.max(H[0]*G,C.x):void 0,O.y=C.y?Math.max(H[1]*V,C.y):void 0}if(O.x!==void 0&&O.y!==void 0){const H={id:p,type:"position",position:{...O}};j.push(H)}if(C.width!==void 0&&C.height!==void 0){const G={id:p,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:C.width,height:C.height}};j.push(G)}for(const H of N){const G={...H,type:"position"};j.push(G)}L(j)},onEnd:({width:C,height:N})=>{const L={id:p,type:"dimensions",resizing:!1,dimensions:{width:C,height:N}};_.getState().triggerNodeChanges([L])}})),I.current.update({controlPosition:q,boundaries:{minWidth:s,minHeight:u,maxWidth:c,maxHeight:f},keepAspectRatio:l,resizeDirection:d,onResizeStart:m,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var C;(C=I.current)==null||C.destroy()}},[q,s,u,c,f,l,m,v,y,g]);const R=q.split("-");return P.jsx("div",{className:ue(["react-flow__resize-control","nodrag",...R,r,n]),ref:x,style:{...i,scale:E,...o&&{[w?"backgroundColor":"borderColor"]:o}},children:a})}F.memo(yC);const mC=[/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g,/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g,/import\s+type\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g],_C=[".ts",".tsx",".js",".jsx",".mjs",".cjs",".vue",".svelte"],bC=["",".ts",".tsx",".js",".jsx","/index.ts","/index.tsx","/index.js","/index.jsx"];function xC(e){return _C.some(t=>e.endsWith(t))}function wC(e){const t=new Set;for(const r of mC){r.lastIndex=0;let n;for(;(n=r.exec(e))!==null;){const i=n[1];(i.startsWith(".")||i.startsWith("@/")||i.startsWith("~/"))&&t.add(i)}}return Array.from(t)}function EC(e,t){if(t.startsWith("@/")||t.startsWith("~/"))return t.replace(/^[@~]\//,"src/");const r=e.split("/").slice(0,-1).join("/"),n=t.split("/"),i=r?r.split("/"):[];for(const a of n)a===".."?i.pop():a!=="."&&i.push(a);return i.join("/")}function SC(e){const t=e.split("/");return t[t.length-1]}async function CC(e,t,r="",n=["src"],i=["node_modules","dist","build",".git"]){const a=new Map,o=[];async function s(c){const f=await t(c);if(!(!f.success||!f.entries))for(const l of f.entries){const d=c?`${c}/${l.name}`:l.name;i.some(h=>d.includes(h))||(l.isDirectory?await s(d):xC(l.name)&&o.push(d))}}if(n.length>0)for(const c of n)await s(c);else await s(r);for(const c of o){const f=await e(c);if(!f.success||!f.content)continue;const d=wC(f.content).map(h=>EC(c,h));a.set(c,{id:c,path:c,name:SC(c),dependencies:d,dependents:[]})}const u=[];for(const[c,f]of a)for(const l of f.dependencies){let d=null;for(const h of bC){const g=l+h;if(a.has(g)){d=g;break}}if(d){u.push({source:c,target:d});const h=a.get(d);h&&h.dependents.push(c)}}return{nodes:a,edges:u}}/**
|
|
24
|
+
* @license lucide-react v0.469.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/const qC=nc("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
29
|
+
* @license lucide-react v0.469.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/const el=nc("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
34
|
+
* @license lucide-react v0.469.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/const IC=nc("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function wc(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Sn,tl;function NC(){if(tl)return Sn;tl=1;function e(){this.__data__=[],this.size=0}return Sn=e,Sn}var Cn,rl;function wt(){if(rl)return Cn;rl=1;function e(t,r){return t===r||t!==t&&r!==r}return Cn=e,Cn}var qn,nl;function Gr(){if(nl)return qn;nl=1;var e=wt();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return qn=t,qn}var In,il;function RC(){if(il)return In;il=1;var e=Gr(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return In=n,In}var Nn,al;function AC(){if(al)return Nn;al=1;var e=Gr();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Nn=t,Nn}var Rn,ol;function MC(){if(ol)return Rn;ol=1;var e=Gr();function t(r){return e(this.__data__,r)>-1}return Rn=t,Rn}var An,sl;function TC(){if(sl)return An;sl=1;var e=Gr();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return An=t,An}var Mn,ul;function Ur(){if(ul)return Mn;ul=1;var e=NC(),t=RC(),r=AC(),n=MC(),i=TC();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Mn=a,Mn}var Tn,cl;function kC(){if(cl)return Tn;cl=1;var e=Ur();function t(){this.__data__=new e,this.size=0}return Tn=t,Tn}var kn,fl;function PC(){if(fl)return kn;fl=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return kn=e,kn}var Pn,ll;function LC(){if(ll)return Pn;ll=1;function e(t){return this.__data__.get(t)}return Pn=e,Pn}var Ln,dl;function OC(){if(dl)return Ln;dl=1;function e(t){return this.__data__.has(t)}return Ln=e,Ln}var On,hl;function dm(){if(hl)return On;hl=1;var e=typeof or=="object"&&or&&or.Object===Object&∨return On=e,On}var Dn,pl;function Ce(){if(pl)return Dn;pl=1;var e=dm(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Dn=r,Dn}var jn,gl;function Et(){if(gl)return jn;gl=1;var e=Ce(),t=e.Symbol;return jn=t,jn}var Fn,vl;function DC(){if(vl)return Fn;vl=1;var e=Et(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return Fn=a,Fn}var $n,yl;function jC(){if(yl)return $n;yl=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return $n=r,$n}var zn,ml;function at(){if(ml)return zn;ml=1;var e=Et(),t=DC(),r=jC(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return zn=o,zn}var Bn,_l;function ye(){if(_l)return Bn;_l=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Bn=e,Bn}var Hn,bl;function Qt(){if(bl)return Hn;bl=1;var e=at(),t=ye(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return Hn=o,Hn}var Vn,xl;function FC(){if(xl)return Vn;xl=1;var e=Ce(),t=e["__core-js_shared__"];return Vn=t,Vn}var Gn,wl;function $C(){if(wl)return Gn;wl=1;var e=FC(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Gn=r,Gn}var Un,El;function hm(){if(El)return Un;El=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Un=r,Un}var Yn,Sl;function zC(){if(Sl)return Yn;Sl=1;var e=Qt(),t=$C(),r=ye(),n=hm(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var h=e(d)?f:a;return h.test(n(d))}return Yn=l,Yn}var Wn,Cl;function BC(){if(Cl)return Wn;Cl=1;function e(t,r){return t==null?void 0:t[r]}return Wn=e,Wn}var Xn,ql;function ot(){if(ql)return Xn;ql=1;var e=zC(),t=BC();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Xn=r,Xn}var Kn,Il;function Ec(){if(Il)return Kn;Il=1;var e=ot(),t=Ce(),r=e(t,"Map");return Kn=r,Kn}var Zn,Nl;function Yr(){if(Nl)return Zn;Nl=1;var e=ot(),t=e(Object,"create");return Zn=t,Zn}var Qn,Rl;function HC(){if(Rl)return Qn;Rl=1;var e=Yr();function t(){this.__data__=e?e(null):{},this.size=0}return Qn=t,Qn}var Jn,Al;function VC(){if(Al)return Jn;Al=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Jn=e,Jn}var ei,Ml;function GC(){if(Ml)return ei;Ml=1;var e=Yr(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return ei=i,ei}var ti,Tl;function UC(){if(Tl)return ti;Tl=1;var e=Yr(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return ti=n,ti}var ri,kl;function YC(){if(kl)return ri;kl=1;var e=Yr(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return ri=r,ri}var ni,Pl;function WC(){if(Pl)return ni;Pl=1;var e=HC(),t=VC(),r=GC(),n=UC(),i=YC();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ni=a,ni}var ii,Ll;function XC(){if(Ll)return ii;Ll=1;var e=WC(),t=Ur(),r=Ec();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return ii=n,ii}var ai,Ol;function KC(){if(Ol)return ai;Ol=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return ai=e,ai}var oi,Dl;function Wr(){if(Dl)return oi;Dl=1;var e=KC();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return oi=t,oi}var si,jl;function ZC(){if(jl)return si;jl=1;var e=Wr();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return si=t,si}var ui,Fl;function QC(){if(Fl)return ui;Fl=1;var e=Wr();function t(r){return e(this,r).get(r)}return ui=t,ui}var ci,$l;function JC(){if($l)return ci;$l=1;var e=Wr();function t(r){return e(this,r).has(r)}return ci=t,ci}var fi,zl;function eq(){if(zl)return fi;zl=1;var e=Wr();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return fi=t,fi}var li,Bl;function Sc(){if(Bl)return li;Bl=1;var e=XC(),t=ZC(),r=QC(),n=JC(),i=eq();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,li=a,li}var di,Hl;function tq(){if(Hl)return di;Hl=1;var e=Ur(),t=Ec(),r=Sc(),n=200;function i(a,o){var s=this.__data__;if(s instanceof e){var u=s.__data__;if(!t||u.length<n-1)return u.push([a,o]),this.size=++s.size,this;s=this.__data__=new r(u)}return s.set(a,o),this.size=s.size,this}return di=i,di}var hi,Vl;function Xr(){if(Vl)return hi;Vl=1;var e=Ur(),t=kC(),r=PC(),n=LC(),i=OC(),a=tq();function o(s){var u=this.__data__=new e(s);this.size=u.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,hi=o,hi}var pi,Gl;function Cc(){if(Gl)return pi;Gl=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i&&r(t[n],n,t)!==!1;);return t}return pi=e,pi}var gi,Ul;function pm(){if(Ul)return gi;Ul=1;var e=ot(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return gi=t,gi}var vi,Yl;function Kr(){if(Yl)return vi;Yl=1;var e=pm();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return vi=t,vi}var yi,Wl;function Zr(){if(Wl)return yi;Wl=1;var e=Kr(),t=wt(),r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s){var u=a[o];(!(n.call(a,o)&&t(u,s))||s===void 0&&!(o in a))&&e(a,o,s)}return yi=i,yi}var mi,Xl;function Jt(){if(Xl)return mi;Xl=1;var e=Zr(),t=Kr();function r(n,i,a,o){var s=!a;a||(a={});for(var u=-1,c=i.length;++u<c;){var f=i[u],l=o?o(a[f],n[f],f,a,n):void 0;l===void 0&&(l=n[f]),s?t(a,f,l):e(a,f,l)}return a}return mi=r,mi}var _i,Kl;function rq(){if(Kl)return _i;Kl=1;function e(t,r){for(var n=-1,i=Array(t);++n<t;)i[n]=r(n);return i}return _i=e,_i}var bi,Zl;function Te(){if(Zl)return bi;Zl=1;function e(t){return t!=null&&typeof t=="object"}return bi=e,bi}var xi,Ql;function nq(){if(Ql)return xi;Ql=1;var e=at(),t=Te(),r="[object Arguments]";function n(i){return t(i)&&e(i)==r}return xi=n,xi}var wi,Jl;function er(){if(Jl)return wi;Jl=1;var e=nq(),t=Te(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(o){return t(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return wi=a,wi}var Ei,ed;function ce(){if(ed)return Ei;ed=1;var e=Array.isArray;return Ei=e,Ei}var Mt={exports:{}},Si,td;function iq(){if(td)return Si;td=1;function e(){return!1}return Si=e,Si}Mt.exports;var rd;function St(){return rd||(rd=1,(function(e,t){var r=Ce(),n=iq(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,s=o?r.Buffer:void 0,u=s?s.isBuffer:void 0,c=u||n;e.exports=c})(Mt,Mt.exports)),Mt.exports}var Ci,nd;function Qr(){if(nd)return Ci;nd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return Ci=r,Ci}var qi,id;function qc(){if(id)return qi;id=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return qi=t,qi}var Ii,ad;function aq(){if(ad)return Ii;ad=1;var e=at(),t=qc(),r=Te(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",u="[object Function]",c="[object Map]",f="[object Number]",l="[object Object]",d="[object RegExp]",h="[object Set]",g="[object String]",m="[object WeakMap]",v="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",p="[object Float64Array]",_="[object Int8Array]",x="[object Int16Array]",w="[object Int32Array]",E="[object Uint8Array]",I="[object Uint8ClampedArray]",q="[object Uint16Array]",R="[object Uint32Array]",C={};C[b]=C[p]=C[_]=C[x]=C[w]=C[E]=C[I]=C[q]=C[R]=!0,C[n]=C[i]=C[v]=C[a]=C[y]=C[o]=C[s]=C[u]=C[c]=C[f]=C[l]=C[d]=C[h]=C[g]=C[m]=!1;function N(L){return r(L)&&t(L.length)&&!!C[e(L)]}return Ii=N,Ii}var Ni,od;function Jr(){if(od)return Ni;od=1;function e(t){return function(r){return t(r)}}return Ni=e,Ni}var Tt={exports:{}};Tt.exports;var sd;function Ic(){return sd||(sd=1,(function(e,t){var r=dm(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=(function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();e.exports=s})(Tt,Tt.exports)),Tt.exports}var Ri,ud;function tr(){if(ud)return Ri;ud=1;var e=aq(),t=Jr(),r=Ic(),n=r&&r.isTypedArray,i=n?t(n):e;return Ri=i,Ri}var Ai,cd;function gm(){if(cd)return Ai;cd=1;var e=rq(),t=er(),r=ce(),n=St(),i=Qr(),a=tr(),o=Object.prototype,s=o.hasOwnProperty;function u(c,f){var l=r(c),d=!l&&t(c),h=!l&&!d&&n(c),g=!l&&!d&&!h&&a(c),m=l||d||h||g,v=m?e(c.length,String):[],y=v.length;for(var b in c)(f||s.call(c,b))&&!(m&&(b=="length"||h&&(b=="offset"||b=="parent")||g&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||i(b,y)))&&v.push(b);return v}return Ai=u,Ai}var Mi,fd;function en(){if(fd)return Mi;fd=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return Mi=t,Mi}var Ti,ld;function vm(){if(ld)return Ti;ld=1;function e(t,r){return function(n){return t(r(n))}}return Ti=e,Ti}var ki,dd;function oq(){if(dd)return ki;dd=1;var e=vm(),t=e(Object.keys,Object);return ki=t,ki}var Pi,hd;function Nc(){if(hd)return Pi;hd=1;var e=en(),t=oq(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&o.push(s);return o}return Pi=i,Pi}var Li,pd;function Be(){if(pd)return Li;pd=1;var e=Qt(),t=qc();function r(n){return n!=null&&t(n.length)&&!e(n)}return Li=r,Li}var Oi,gd;function Ke(){if(gd)return Oi;gd=1;var e=gm(),t=Nc(),r=Be();function n(i){return r(i)?e(i):t(i)}return Oi=n,Oi}var Di,vd;function sq(){if(vd)return Di;vd=1;var e=Jt(),t=Ke();function r(n,i){return n&&e(i,t(i),n)}return Di=r,Di}var ji,yd;function uq(){if(yd)return ji;yd=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return ji=e,ji}var Fi,md;function cq(){if(md)return Fi;md=1;var e=ye(),t=en(),r=uq(),n=Object.prototype,i=n.hasOwnProperty;function a(o){if(!e(o))return r(o);var s=t(o),u=[];for(var c in o)c=="constructor"&&(s||!i.call(o,c))||u.push(c);return u}return Fi=a,Fi}var $i,_d;function st(){if(_d)return $i;_d=1;var e=gm(),t=cq(),r=Be();function n(i){return r(i)?e(i,!0):t(i)}return $i=n,$i}var zi,bd;function fq(){if(bd)return zi;bd=1;var e=Jt(),t=st();function r(n,i){return n&&e(i,t(i),n)}return zi=r,zi}var kt={exports:{}};kt.exports;var xd;function ym(){return xd||(xd=1,(function(e,t){var r=Ce(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(c,f){if(f)return c.slice();var l=c.length,d=s?s(l):new c.constructor(l);return c.copy(d),d}e.exports=u})(kt,kt.exports)),kt.exports}var Bi,wd;function mm(){if(wd)return Bi;wd=1;function e(t,r){var n=-1,i=t.length;for(r||(r=Array(i));++n<i;)r[n]=t[n];return r}return Bi=e,Bi}var Hi,Ed;function _m(){if(Ed)return Hi;Ed=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=0,o=[];++n<i;){var s=t[n];r(s,n,t)&&(o[a++]=s)}return o}return Hi=e,Hi}var Vi,Sd;function bm(){if(Sd)return Vi;Sd=1;function e(){return[]}return Vi=e,Vi}var Gi,Cd;function Rc(){if(Cd)return Gi;Cd=1;var e=_m(),t=bm(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(s){return n.call(o,s)}))}:t;return Gi=a,Gi}var Ui,qd;function lq(){if(qd)return Ui;qd=1;var e=Jt(),t=Rc();function r(n,i){return e(n,t(n),i)}return Ui=r,Ui}var Yi,Id;function Ac(){if(Id)return Yi;Id=1;function e(t,r){for(var n=-1,i=r.length,a=t.length;++n<i;)t[a+n]=r[n];return t}return Yi=e,Yi}var Wi,Nd;function tn(){if(Nd)return Wi;Nd=1;var e=vm(),t=e(Object.getPrototypeOf,Object);return Wi=t,Wi}var Xi,Rd;function xm(){if(Rd)return Xi;Rd=1;var e=Ac(),t=tn(),r=Rc(),n=bm(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var s=[];o;)e(s,r(o)),o=t(o);return s}:n;return Xi=a,Xi}var Ki,Ad;function dq(){if(Ad)return Ki;Ad=1;var e=Jt(),t=xm();function r(n,i){return e(n,t(n),i)}return Ki=r,Ki}var Zi,Md;function wm(){if(Md)return Zi;Md=1;var e=Ac(),t=ce();function r(n,i,a){var o=i(n);return t(n)?o:e(o,a(n))}return Zi=r,Zi}var Qi,Td;function Em(){if(Td)return Qi;Td=1;var e=wm(),t=Rc(),r=Ke();function n(i){return e(i,r,t)}return Qi=n,Qi}var Ji,kd;function hq(){if(kd)return Ji;kd=1;var e=wm(),t=xm(),r=st();function n(i){return e(i,r,t)}return Ji=n,Ji}var ea,Pd;function pq(){if(Pd)return ea;Pd=1;var e=ot(),t=Ce(),r=e(t,"DataView");return ea=r,ea}var ta,Ld;function gq(){if(Ld)return ta;Ld=1;var e=ot(),t=Ce(),r=e(t,"Promise");return ta=r,ta}var ra,Od;function Sm(){if(Od)return ra;Od=1;var e=ot(),t=Ce(),r=e(t,"Set");return ra=r,ra}var na,Dd;function vq(){if(Dd)return na;Dd=1;var e=ot(),t=Ce(),r=e(t,"WeakMap");return na=r,na}var ia,jd;function Ct(){if(jd)return ia;jd=1;var e=pq(),t=Ec(),r=gq(),n=Sm(),i=vq(),a=at(),o=hm(),s="[object Map]",u="[object Object]",c="[object Promise]",f="[object Set]",l="[object WeakMap]",d="[object DataView]",h=o(e),g=o(t),m=o(r),v=o(n),y=o(i),b=a;return(e&&b(new e(new ArrayBuffer(1)))!=d||t&&b(new t)!=s||r&&b(r.resolve())!=c||n&&b(new n)!=f||i&&b(new i)!=l)&&(b=function(p){var _=a(p),x=_==u?p.constructor:void 0,w=x?o(x):"";if(w)switch(w){case h:return d;case g:return s;case m:return c;case v:return f;case y:return l}return _}),ia=b,ia}var aa,Fd;function yq(){if(Fd)return aa;Fd=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&t.call(n,"index")&&(a.index=n.index,a.input=n.input),a}return aa=r,aa}var oa,$d;function Cm(){if($d)return oa;$d=1;var e=Ce(),t=e.Uint8Array;return oa=t,oa}var sa,zd;function Mc(){if(zd)return sa;zd=1;var e=Cm();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return sa=t,sa}var ua,Bd;function mq(){if(Bd)return ua;Bd=1;var e=Mc();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.byteLength)}return ua=t,ua}var ca,Hd;function _q(){if(Hd)return ca;Hd=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return ca=t,ca}var fa,Vd;function bq(){if(Vd)return fa;Vd=1;var e=Et(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(i){return r?Object(r.call(i)):{}}return fa=n,fa}var la,Gd;function qm(){if(Gd)return la;Gd=1;var e=Mc();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.length)}return la=t,la}var da,Ud;function xq(){if(Ud)return da;Ud=1;var e=Mc(),t=mq(),r=_q(),n=bq(),i=qm(),a="[object Boolean]",o="[object Date]",s="[object Map]",u="[object Number]",c="[object RegExp]",f="[object Set]",l="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",g="[object DataView]",m="[object Float32Array]",v="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",p="[object Int32Array]",_="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",E="[object Uint32Array]";function I(q,R,C){var N=q.constructor;switch(R){case h:return e(q);case a:case o:return new N(+q);case g:return t(q,C);case m:case v:case y:case b:case p:case _:case x:case w:case E:return i(q,C);case s:return new N;case u:case l:return new N(q);case c:return r(q);case f:return new N;case d:return n(q)}}return da=I,da}var ha,Yd;function Im(){if(Yd)return ha;Yd=1;var e=ye(),t=Object.create,r=(function(){function n(){}return function(i){if(!e(i))return{};if(t)return t(i);n.prototype=i;var a=new n;return n.prototype=void 0,a}})();return ha=r,ha}var pa,Wd;function Nm(){if(Wd)return pa;Wd=1;var e=Im(),t=tn(),r=en();function n(i){return typeof i.constructor=="function"&&!r(i)?e(t(i)):{}}return pa=n,pa}var ga,Xd;function wq(){if(Xd)return ga;Xd=1;var e=Ct(),t=Te(),r="[object Map]";function n(i){return t(i)&&e(i)==r}return ga=n,ga}var va,Kd;function Eq(){if(Kd)return va;Kd=1;var e=wq(),t=Jr(),r=Ic(),n=r&&r.isMap,i=n?t(n):e;return va=i,va}var ya,Zd;function Sq(){if(Zd)return ya;Zd=1;var e=Ct(),t=Te(),r="[object Set]";function n(i){return t(i)&&e(i)==r}return ya=n,ya}var ma,Qd;function Cq(){if(Qd)return ma;Qd=1;var e=Sq(),t=Jr(),r=Ic(),n=r&&r.isSet,i=n?t(n):e;return ma=i,ma}var _a,Jd;function Rm(){if(Jd)return _a;Jd=1;var e=Xr(),t=Cc(),r=Zr(),n=sq(),i=fq(),a=ym(),o=mm(),s=lq(),u=dq(),c=Em(),f=hq(),l=Ct(),d=yq(),h=xq(),g=Nm(),m=ce(),v=St(),y=Eq(),b=ye(),p=Cq(),_=Ke(),x=st(),w=1,E=2,I=4,q="[object Arguments]",R="[object Array]",C="[object Boolean]",N="[object Date]",L="[object Error]",S="[object Function]",T="[object GeneratorFunction]",M="[object Map]",j="[object Number]",O="[object Object]",k="[object RegExp]",H="[object Set]",G="[object String]",V="[object Symbol]",Y="[object WeakMap]",A="[object ArrayBuffer]",D="[object DataView]",$="[object Float32Array]",z="[object Float64Array]",B="[object Int8Array]",U="[object Int16Array]",X="[object Int32Array]",K="[object Uint8Array]",J="[object Uint8ClampedArray]",W="[object Uint16Array]",te="[object Uint32Array]",Z={};Z[q]=Z[R]=Z[A]=Z[D]=Z[C]=Z[N]=Z[$]=Z[z]=Z[B]=Z[U]=Z[X]=Z[M]=Z[j]=Z[O]=Z[k]=Z[H]=Z[G]=Z[V]=Z[K]=Z[J]=Z[W]=Z[te]=!0,Z[L]=Z[S]=Z[Y]=!1;function re(ee,le,fe,ke,qe,de){var se,Ve=le&w,Pe=le&E,Ge=le&I;if(fe&&(se=qe?fe(ee,ke,qe,de):fe(ee)),se!==void 0)return se;if(!b(ee))return ee;var Ue=m(ee);if(Ue){if(se=d(ee),!Ve)return o(ee,se)}else{var Le=l(ee),nr=Le==S||Le==T;if(v(ee))return a(ee,Ve);if(Le==O||Le==q||nr&&!qe){if(se=Pe||nr?{}:g(ee),!Ve)return Pe?u(ee,i(se,ee)):s(ee,n(se,ee))}else{if(!Z[Le])return qe?ee:{};se=h(ee,Le,Ve)}}de||(de=new e);var ct=de.get(ee);if(ct)return ct;de.set(ee,se),p(ee)?ee.forEach(function(Ie){se.add(re(Ie,le,fe,Ie,ee,de))}):y(ee)&&ee.forEach(function(Ie,Oe){se.set(Oe,re(Ie,le,fe,Oe,ee,de))});var cn=Ge?Pe?f:c:Pe?x:_,ir=Ue?void 0:cn(ee);return t(ir||ee,function(Ie,Oe){ir&&(Oe=Ie,Ie=ee[Oe]),r(se,Oe,re(Ie,le,fe,Oe,ee,de))}),se}return _a=re,_a}var ba,eh;function qq(){if(eh)return ba;eh=1;var e=Rm(),t=4;function r(n){return e(n,t)}return ba=r,ba}var xa,th;function Tc(){if(th)return xa;th=1;function e(t){return function(){return t}}return xa=e,xa}var wa,rh;function Iq(){if(rh)return wa;rh=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),s=i(r),u=s.length;u--;){var c=s[t?u:++a];if(n(o[c],c,o)===!1)break}return r}}return wa=e,wa}var Ea,nh;function kc(){if(nh)return Ea;nh=1;var e=Iq(),t=e();return Ea=t,Ea}var Sa,ih;function Pc(){if(ih)return Sa;ih=1;var e=kc(),t=Ke();function r(n,i){return n&&e(n,i,t)}return Sa=r,Sa}var Ca,ah;function Nq(){if(ah)return Ca;ah=1;var e=Be();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,s=n?o:-1,u=Object(i);(n?s--:++s<o)&&a(u[s],s,u)!==!1;);return i}}return Ca=t,Ca}var qa,oh;function rn(){if(oh)return qa;oh=1;var e=Pc(),t=Nq(),r=t(e);return qa=r,qa}var Ia,sh;function ut(){if(sh)return Ia;sh=1;function e(t){return t}return Ia=e,Ia}var Na,uh;function Am(){if(uh)return Na;uh=1;var e=ut();function t(r){return typeof r=="function"?r:e}return Na=t,Na}var Ra,ch;function Mm(){if(ch)return Ra;ch=1;var e=Cc(),t=rn(),r=Am(),n=ce();function i(a,o){var s=n(a)?e:t;return s(a,r(o))}return Ra=i,Ra}var Aa,fh;function Tm(){return fh||(fh=1,Aa=Mm()),Aa}var Ma,lh;function Rq(){if(lh)return Ma;lh=1;var e=rn();function t(r,n){var i=[];return e(r,function(a,o,s){n(a,o,s)&&i.push(a)}),i}return Ma=t,Ma}var Ta,dh;function Aq(){if(dh)return Ta;dh=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Ta=t,Ta}var ka,hh;function Mq(){if(hh)return ka;hh=1;function e(t){return this.__data__.has(t)}return ka=e,ka}var Pa,ph;function km(){if(ph)return Pa;ph=1;var e=Sc(),t=Aq(),r=Mq();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new e;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Pa=n,Pa}var La,gh;function Tq(){if(gh)return La;gh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(t[n],n,t))return!0;return!1}return La=e,La}var Oa,vh;function Pm(){if(vh)return Oa;vh=1;function e(t,r){return t.has(r)}return Oa=e,Oa}var Da,yh;function Lm(){if(yh)return Da;yh=1;var e=km(),t=Tq(),r=Pm(),n=1,i=2;function a(o,s,u,c,f,l){var d=u&n,h=o.length,g=s.length;if(h!=g&&!(d&&g>h))return!1;var m=l.get(o),v=l.get(s);if(m&&v)return m==s&&v==o;var y=-1,b=!0,p=u&i?new e:void 0;for(l.set(o,s),l.set(s,o);++y<h;){var _=o[y],x=s[y];if(c)var w=d?c(x,_,y,s,o,l):c(_,x,y,o,s,l);if(w!==void 0){if(w)continue;b=!1;break}if(p){if(!t(s,function(E,I){if(!r(p,I)&&(_===E||f(_,E,u,c,l)))return p.push(I)})){b=!1;break}}else if(!(_===x||f(_,x,u,c,l))){b=!1;break}}return l.delete(o),l.delete(s),b}return Da=a,Da}var ja,mh;function kq(){if(mh)return ja;mh=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i,a){n[++r]=[a,i]}),n}return ja=e,ja}var Fa,_h;function Lc(){if(_h)return Fa;_h=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i){n[++r]=i}),n}return Fa=e,Fa}var $a,bh;function Pq(){if(bh)return $a;bh=1;var e=Et(),t=Cm(),r=wt(),n=Lm(),i=kq(),a=Lc(),o=1,s=2,u="[object Boolean]",c="[object Date]",f="[object Error]",l="[object Map]",d="[object Number]",h="[object RegExp]",g="[object Set]",m="[object String]",v="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",p=e?e.prototype:void 0,_=p?p.valueOf:void 0;function x(w,E,I,q,R,C,N){switch(I){case b:if(w.byteLength!=E.byteLength||w.byteOffset!=E.byteOffset)return!1;w=w.buffer,E=E.buffer;case y:return!(w.byteLength!=E.byteLength||!C(new t(w),new t(E)));case u:case c:case d:return r(+w,+E);case f:return w.name==E.name&&w.message==E.message;case h:case m:return w==E+"";case l:var L=i;case g:var S=q&o;if(L||(L=a),w.size!=E.size&&!S)return!1;var T=N.get(w);if(T)return T==E;q|=s,N.set(w,E);var M=n(L(w),L(E),q,R,C,N);return N.delete(w),M;case v:if(_)return _.call(w)==_.call(E)}return!1}return $a=x,$a}var za,xh;function Lq(){if(xh)return za;xh=1;var e=Em(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s,u,c,f){var l=s&t,d=e(a),h=d.length,g=e(o),m=g.length;if(h!=m&&!l)return!1;for(var v=h;v--;){var y=d[v];if(!(l?y in o:n.call(o,y)))return!1}var b=f.get(a),p=f.get(o);if(b&&p)return b==o&&p==a;var _=!0;f.set(a,o),f.set(o,a);for(var x=l;++v<h;){y=d[v];var w=a[y],E=o[y];if(u)var I=l?u(E,w,y,o,a,f):u(w,E,y,a,o,f);if(!(I===void 0?w===E||c(w,E,s,u,f):I)){_=!1;break}x||(x=y=="constructor")}if(_&&!x){var q=a.constructor,R=o.constructor;q!=R&&"constructor"in a&&"constructor"in o&&!(typeof q=="function"&&q instanceof q&&typeof R=="function"&&R instanceof R)&&(_=!1)}return f.delete(a),f.delete(o),_}return za=i,za}var Ba,wh;function Oq(){if(wh)return Ba;wh=1;var e=Xr(),t=Lm(),r=Pq(),n=Lq(),i=Ct(),a=ce(),o=St(),s=tr(),u=1,c="[object Arguments]",f="[object Array]",l="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function g(m,v,y,b,p,_){var x=a(m),w=a(v),E=x?f:i(m),I=w?f:i(v);E=E==c?l:E,I=I==c?l:I;var q=E==l,R=I==l,C=E==I;if(C&&o(m)){if(!o(v))return!1;x=!0,q=!1}if(C&&!q)return _||(_=new e),x||s(m)?t(m,v,y,b,p,_):r(m,v,E,y,b,p,_);if(!(y&u)){var N=q&&h.call(m,"__wrapped__"),L=R&&h.call(v,"__wrapped__");if(N||L){var S=N?m.value():m,T=L?v.value():v;return _||(_=new e),p(S,T,y,b,_)}}return C?(_||(_=new e),n(m,v,y,b,p,_)):!1}return Ba=g,Ba}var Ha,Eh;function Om(){if(Eh)return Ha;Eh=1;var e=Oq(),t=Te();function r(n,i,a,o,s){return n===i?!0:n==null||i==null||!t(n)&&!t(i)?n!==n&&i!==i:e(n,i,a,o,r,s)}return Ha=r,Ha}var Va,Sh;function Dq(){if(Sh)return Va;Sh=1;var e=Xr(),t=Om(),r=1,n=2;function i(a,o,s,u){var c=s.length,f=c,l=!u;if(a==null)return!f;for(a=Object(a);c--;){var d=s[c];if(l&&d[2]?d[1]!==a[d[0]]:!(d[0]in a))return!1}for(;++c<f;){d=s[c];var h=d[0],g=a[h],m=d[1];if(l&&d[2]){if(g===void 0&&!(h in a))return!1}else{var v=new e;if(u)var y=u(g,m,h,a,o,v);if(!(y===void 0?t(m,g,r|n,u,v):y))return!1}}return!0}return Va=i,Va}var Ga,Ch;function Dm(){if(Ch)return Ga;Ch=1;var e=ye();function t(r){return r===r&&!e(r)}return Ga=t,Ga}var Ua,qh;function jq(){if(qh)return Ua;qh=1;var e=Dm(),t=Ke();function r(n){for(var i=t(n),a=i.length;a--;){var o=i[a],s=n[o];i[a]=[o,s,e(s)]}return i}return Ua=r,Ua}var Ya,Ih;function jm(){if(Ih)return Ya;Ih=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Ya=e,Ya}var Wa,Nh;function Fq(){if(Nh)return Wa;Nh=1;var e=Dq(),t=jq(),r=jm();function n(i){var a=t(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||e(o,i,a)}}return Wa=n,Wa}var Xa,Rh;function qt(){if(Rh)return Xa;Rh=1;var e=at(),t=Te(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Xa=n,Xa}var Ka,Ah;function Oc(){if(Ah)return Ka;Ah=1;var e=ce(),t=qt(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Ka=i,Ka}var Za,Mh;function $q(){if(Mh)return Za;Mh=1;var e=Sc(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Za=r,Za}var Qa,Th;function zq(){if(Th)return Qa;Th=1;var e=$q(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Qa=r,Qa}var Ja,kh;function Bq(){if(kh)return Ja;kh=1;var e=zq(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return Ja=n,Ja}var eo,Ph;function nn(){if(Ph)return eo;Ph=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return eo=e,eo}var to,Lh;function Hq(){if(Lh)return to;Lh=1;var e=Et(),t=nn(),r=ce(),n=qt(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return to=o,to}var ro,Oh;function Fm(){if(Oh)return ro;Oh=1;var e=Hq();function t(r){return r==null?"":e(r)}return ro=t,ro}var no,Dh;function an(){if(Dh)return no;Dh=1;var e=ce(),t=Oc(),r=Bq(),n=Fm();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return no=i,no}var io,jh;function rr(){if(jh)return io;jh=1;var e=qt();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return io=t,io}var ao,Fh;function on(){if(Fh)return ao;Fh=1;var e=an(),t=rr();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return ao=r,ao}var oo,$h;function Vq(){if($h)return oo;$h=1;var e=on();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return oo=t,oo}var so,zh;function Gq(){if(zh)return so;zh=1;function e(t,r){return t!=null&&r in Object(t)}return so=e,so}var uo,Bh;function $m(){if(Bh)return uo;Bh=1;var e=an(),t=er(),r=ce(),n=Qr(),i=qc(),a=rr();function o(s,u,c){u=e(u,s);for(var f=-1,l=u.length,d=!1;++f<l;){var h=a(u[f]);if(!(d=s!=null&&c(s,h)))break;s=s[h]}return d||++f!=l?d:(l=s==null?0:s.length,!!l&&i(l)&&n(h,l)&&(r(s)||t(s)))}return uo=o,uo}var co,Hh;function zm(){if(Hh)return co;Hh=1;var e=Gq(),t=$m();function r(n,i){return n!=null&&t(n,i,e)}return co=r,co}var fo,Vh;function Uq(){if(Vh)return fo;Vh=1;var e=Om(),t=Vq(),r=zm(),n=Oc(),i=Dm(),a=jm(),o=rr(),s=1,u=2;function c(f,l){return n(f)&&i(l)?a(o(f),l):function(d){var h=t(d,f);return h===void 0&&h===l?r(d,f):e(l,h,s|u)}}return fo=c,fo}var lo,Gh;function Bm(){if(Gh)return lo;Gh=1;function e(t){return function(r){return r==null?void 0:r[t]}}return lo=e,lo}var ho,Uh;function Yq(){if(Uh)return ho;Uh=1;var e=on();function t(r){return function(n){return e(n,r)}}return ho=t,ho}var po,Yh;function Wq(){if(Yh)return po;Yh=1;var e=Bm(),t=Yq(),r=Oc(),n=rr();function i(a){return r(a)?e(n(a)):t(a)}return po=i,po}var go,Wh;function He(){if(Wh)return go;Wh=1;var e=Fq(),t=Uq(),r=ut(),n=ce(),i=Wq();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?t(o[0],o[1]):e(o):i(o)}return go=a,go}var vo,Xh;function Hm(){if(Xh)return vo;Xh=1;var e=_m(),t=Rq(),r=He(),n=ce();function i(a,o){var s=n(a)?e:t;return s(a,r(o,3))}return vo=i,vo}var yo,Kh;function Xq(){if(Kh)return yo;Kh=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n,i){return n!=null&&t.call(n,i)}return yo=r,yo}var mo,Zh;function Vm(){if(Zh)return mo;Zh=1;var e=Xq(),t=$m();function r(n,i){return n!=null&&t(n,i,e)}return mo=r,mo}var _o,Qh;function Kq(){if(Qh)return _o;Qh=1;var e=Nc(),t=Ct(),r=er(),n=ce(),i=Be(),a=St(),o=en(),s=tr(),u="[object Map]",c="[object Set]",f=Object.prototype,l=f.hasOwnProperty;function d(h){if(h==null)return!0;if(i(h)&&(n(h)||typeof h=="string"||typeof h.splice=="function"||a(h)||s(h)||r(h)))return!h.length;var g=t(h);if(g==u||g==c)return!h.size;if(o(h))return!e(h).length;for(var m in h)if(l.call(h,m))return!1;return!0}return _o=d,_o}var bo,Jh;function Gm(){if(Jh)return bo;Jh=1;function e(t){return t===void 0}return bo=e,bo}var xo,ep;function Um(){if(ep)return xo;ep=1;var e=rn(),t=Be();function r(n,i){var a=-1,o=t(n)?Array(n.length):[];return e(n,function(s,u,c){o[++a]=i(s,u,c)}),o}return xo=r,xo}var wo,tp;function Ym(){if(tp)return wo;tp=1;var e=nn(),t=He(),r=Um(),n=ce();function i(a,o){var s=n(a)?e:r;return s(a,t(o,3))}return wo=i,wo}var Eo,rp;function Zq(){if(rp)return Eo;rp=1;function e(t,r,n,i){var a=-1,o=t==null?0:t.length;for(i&&o&&(n=t[++a]);++a<o;)n=r(n,t[a],a,t);return n}return Eo=e,Eo}var So,np;function Qq(){if(np)return So;np=1;function e(t,r,n,i,a){return a(t,function(o,s,u){n=i?(i=!1,o):r(n,o,s,u)}),n}return So=e,So}var Co,ip;function Wm(){if(ip)return Co;ip=1;var e=Zq(),t=rn(),r=He(),n=Qq(),i=ce();function a(o,s,u){var c=i(o)?e:n,f=arguments.length<3;return c(o,r(s,4),u,f,t)}return Co=a,Co}var qo,ap;function Jq(){if(ap)return qo;ap=1;var e=at(),t=ce(),r=Te(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return qo=i,qo}var Io,op;function eI(){if(op)return Io;op=1;var e=Bm(),t=e("length");return Io=t,Io}var No,sp;function tI(){if(sp)return No;sp=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+e+i+a+"]");function u(c){return s.test(c)}return No=u,No}var Ro,up;function rI(){if(up)return Ro;up=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",s="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",c="(?:"+s+"|"+u+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",g=c+"?",m="["+a+"]?",v="(?:"+h+"(?:"+[f,l,d].join("|")+")"+m+g+")*",y=m+g+v,b="(?:"+[f+s+"?",s,l,d,o].join("|")+")",p=RegExp(u+"(?="+u+")|"+b+y,"g");function _(x){for(var w=p.lastIndex=0;p.test(x);)++w;return w}return Ro=_,Ro}var Ao,cp;function nI(){if(cp)return Ao;cp=1;var e=eI(),t=tI(),r=rI();function n(i){return t(i)?r(i):e(i)}return Ao=n,Ao}var Mo,fp;function iI(){if(fp)return Mo;fp=1;var e=Nc(),t=Ct(),r=Be(),n=Jq(),i=nI(),a="[object Map]",o="[object Set]";function s(u){if(u==null)return 0;if(r(u))return n(u)?i(u):u.length;var c=t(u);return c==a||c==o?u.size:e(u).length}return Mo=s,Mo}var To,lp;function aI(){if(lp)return To;lp=1;var e=Cc(),t=Im(),r=Pc(),n=He(),i=tn(),a=ce(),o=St(),s=Qt(),u=ye(),c=tr();function f(l,d,h){var g=a(l),m=g||o(l)||c(l);if(d=n(d,4),h==null){var v=l&&l.constructor;m?h=g?new v:[]:u(l)?h=s(v)?t(i(l)):{}:h={}}return(m?e:r)(l,function(y,b,p){return d(h,y,b,p)}),h}return To=f,To}var ko,dp;function oI(){if(dp)return ko;dp=1;var e=Et(),t=er(),r=ce(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return ko=i,ko}var Po,hp;function Dc(){if(hp)return Po;hp=1;var e=Ac(),t=oI();function r(n,i,a,o,s){var u=-1,c=n.length;for(a||(a=t),s||(s=[]);++u<c;){var f=n[u];i>0&&a(f)?i>1?r(f,i-1,a,o,s):e(s,f):o||(s[s.length]=f)}return s}return Po=r,Po}var Lo,pp;function sI(){if(pp)return Lo;pp=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Lo=e,Lo}var Oo,gp;function Xm(){if(gp)return Oo;gp=1;var e=sI(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,s=-1,u=t(o.length-i,0),c=Array(u);++s<u;)c[s]=o[i+s];s=-1;for(var f=Array(i+1);++s<i;)f[s]=o[s];return f[i]=a(c),e(n,this,f)}}return Oo=r,Oo}var Do,vp;function uI(){if(vp)return Do;vp=1;var e=Tc(),t=pm(),r=ut(),n=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Do=n,Do}var jo,yp;function cI(){if(yp)return jo;yp=1;var e=800,t=16,r=Date.now;function n(i){var a=0,o=0;return function(){var s=r(),u=t-(s-o);if(o=s,u>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return jo=n,jo}var Fo,mp;function Km(){if(mp)return Fo;mp=1;var e=uI(),t=cI(),r=t(e);return Fo=r,Fo}var $o,_p;function sn(){if(_p)return $o;_p=1;var e=ut(),t=Xm(),r=Km();function n(i,a){return r(t(i,a,e),i+"")}return $o=n,$o}var zo,bp;function Zm(){if(bp)return zo;bp=1;function e(t,r,n,i){for(var a=t.length,o=n+(i?1:-1);i?o--:++o<a;)if(r(t[o],o,t))return o;return-1}return zo=e,zo}var Bo,xp;function fI(){if(xp)return Bo;xp=1;function e(t){return t!==t}return Bo=e,Bo}var Ho,wp;function lI(){if(wp)return Ho;wp=1;function e(t,r,n){for(var i=n-1,a=t.length;++i<a;)if(t[i]===r)return i;return-1}return Ho=e,Ho}var Vo,Ep;function dI(){if(Ep)return Vo;Ep=1;var e=Zm(),t=fI(),r=lI();function n(i,a,o){return a===a?r(i,a,o):e(i,t,o)}return Vo=n,Vo}var Go,Sp;function hI(){if(Sp)return Go;Sp=1;var e=dI();function t(r,n){var i=r==null?0:r.length;return!!i&&e(r,n,0)>-1}return Go=t,Go}var Uo,Cp;function pI(){if(Cp)return Uo;Cp=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;)if(n(r,t[i]))return!0;return!1}return Uo=e,Uo}var Yo,qp;function gI(){if(qp)return Yo;qp=1;function e(){}return Yo=e,Yo}var Wo,Ip;function vI(){if(Ip)return Wo;Ip=1;var e=Sm(),t=gI(),r=Lc(),n=1/0,i=e&&1/r(new e([,-0]))[1]==n?function(a){return new e(a)}:t;return Wo=i,Wo}var Xo,Np;function yI(){if(Np)return Xo;Np=1;var e=km(),t=hI(),r=pI(),n=Pm(),i=vI(),a=Lc(),o=200;function s(u,c,f){var l=-1,d=t,h=u.length,g=!0,m=[],v=m;if(f)g=!1,d=r;else if(h>=o){var y=c?null:i(u);if(y)return a(y);g=!1,d=n,v=new e}else v=c?[]:m;e:for(;++l<h;){var b=u[l],p=c?c(b):b;if(b=f||b!==0?b:0,g&&p===p){for(var _=v.length;_--;)if(v[_]===p)continue e;c&&v.push(p),m.push(b)}else d(v,p,f)||(v!==m&&v.push(p),m.push(b))}return m}return Xo=s,Xo}var Ko,Rp;function Qm(){if(Rp)return Ko;Rp=1;var e=Be(),t=Te();function r(n){return t(n)&&e(n)}return Ko=r,Ko}var Zo,Ap;function mI(){if(Ap)return Zo;Ap=1;var e=Dc(),t=sn(),r=yI(),n=Qm(),i=t(function(a){return r(e(a,1,n,!0))});return Zo=i,Zo}var Qo,Mp;function _I(){if(Mp)return Qo;Mp=1;var e=nn();function t(r,n){return e(n,function(i){return r[i]})}return Qo=t,Qo}var Jo,Tp;function Jm(){if(Tp)return Jo;Tp=1;var e=_I(),t=Ke();function r(n){return n==null?[]:e(n,t(n))}return Jo=r,Jo}var es,kp;function me(){if(kp)return es;kp=1;var e;if(typeof wc=="function")try{e={clone:qq(),constant:Tc(),each:Tm(),filter:Hm(),has:Vm(),isArray:ce(),isEmpty:Kq(),isFunction:Qt(),isUndefined:Gm(),keys:Ke(),map:Ym(),reduce:Wm(),size:iI(),transform:aI(),union:mI(),values:Jm()}}catch{}return e||(e=window._),es=e,es}var ts,Pp;function jc(){if(Pp)return ts;Pp=1;var e=me();ts=i;var t="\0",r="\0",n="";function i(f){this._isDirected=e.has(f,"directed")?f.directed:!0,this._isMultigraph=e.has(f,"multigraph")?f.multigraph:!1,this._isCompound=e.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(f){return this._label=f,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultNodeLabelFn=f,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return e.keys(this._nodes)},i.prototype.sources=function(){var f=this;return e.filter(this.nodes(),function(l){return e.isEmpty(f._in[l])})},i.prototype.sinks=function(){var f=this;return e.filter(this.nodes(),function(l){return e.isEmpty(f._out[l])})},i.prototype.setNodes=function(f,l){var d=arguments,h=this;return e.each(f,function(g){d.length>1?h.setNode(g,l):h.setNode(g)}),this},i.prototype.setNode=function(f,l){return e.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=l),this):(this._nodes[f]=arguments.length>1?l:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=r,this._children[f]={},this._children[r][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},i.prototype.node=function(f){return this._nodes[f]},i.prototype.hasNode=function(f){return e.has(this._nodes,f)},i.prototype.removeNode=function(f){var l=this;if(e.has(this._nodes,f)){var d=function(h){l.removeEdge(l._edgeObjs[h])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],e.each(this.children(f),function(h){l.setParent(h)}),delete this._children[f]),e.each(e.keys(this._in[f]),d),delete this._in[f],delete this._preds[f],e.each(e.keys(this._out[f]),d),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},i.prototype.setParent=function(f,l){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(l))l=r;else{l+="";for(var d=l;!e.isUndefined(d);d=this.parent(d))if(d===f)throw new Error("Setting "+l+" as parent of "+f+" would create a cycle");this.setNode(l)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=l,this._children[l][f]=!0,this},i.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},i.prototype.parent=function(f){if(this._isCompound){var l=this._parent[f];if(l!==r)return l}},i.prototype.children=function(f){if(e.isUndefined(f)&&(f=r),this._isCompound){var l=this._children[f];if(l)return e.keys(l)}else{if(f===r)return this.nodes();if(this.hasNode(f))return[]}},i.prototype.predecessors=function(f){var l=this._preds[f];if(l)return e.keys(l)},i.prototype.successors=function(f){var l=this._sucs[f];if(l)return e.keys(l)},i.prototype.neighbors=function(f){var l=this.predecessors(f);if(l)return e.union(l,this.successors(f))},i.prototype.isLeaf=function(f){var l;return this.isDirected()?l=this.successors(f):l=this.neighbors(f),l.length===0},i.prototype.filterNodes=function(f){var l=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});l.setGraph(this.graph());var d=this;e.each(this._nodes,function(m,v){f(v)&&l.setNode(v,m)}),e.each(this._edgeObjs,function(m){l.hasNode(m.v)&&l.hasNode(m.w)&&l.setEdge(m,d.edge(m))});var h={};function g(m){var v=d.parent(m);return v===void 0||l.hasNode(v)?(h[m]=v,v):v in h?h[v]:g(v)}return this._isCompound&&e.each(l.nodes(),function(m){l.setParent(m,g(m))}),l},i.prototype.setDefaultEdgeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultEdgeLabelFn=f,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return e.values(this._edgeObjs)},i.prototype.setPath=function(f,l){var d=this,h=arguments;return e.reduce(f,function(g,m){return h.length>1?d.setEdge(g,m,l):d.setEdge(g,m),m}),this},i.prototype.setEdge=function(){var f,l,d,h,g=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(f=m.v,l=m.w,d=m.name,arguments.length===2&&(h=arguments[1],g=!0)):(f=m,l=arguments[1],d=arguments[3],arguments.length>2&&(h=arguments[2],g=!0)),f=""+f,l=""+l,e.isUndefined(d)||(d=""+d);var v=s(this._isDirected,f,l,d);if(e.has(this._edgeLabels,v))return g&&(this._edgeLabels[v]=h),this;if(!e.isUndefined(d)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(l),this._edgeLabels[v]=g?h:this._defaultEdgeLabelFn(f,l,d);var y=u(this._isDirected,f,l,d);return f=y.v,l=y.w,Object.freeze(y),this._edgeObjs[v]=y,a(this._preds[l],f),a(this._sucs[f],l),this._in[l][v]=y,this._out[f][v]=y,this._edgeCount++,this},i.prototype.edge=function(f,l,d){var h=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,f,l,d);return this._edgeLabels[h]},i.prototype.hasEdge=function(f,l,d){var h=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,f,l,d);return e.has(this._edgeLabels,h)},i.prototype.removeEdge=function(f,l,d){var h=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,f,l,d),g=this._edgeObjs[h];return g&&(f=g.v,l=g.w,delete this._edgeLabels[h],delete this._edgeObjs[h],o(this._preds[l],f),o(this._sucs[f],l),delete this._in[l][h],delete this._out[f][h],this._edgeCount--),this},i.prototype.inEdges=function(f,l){var d=this._in[f];if(d){var h=e.values(d);return l?e.filter(h,function(g){return g.v===l}):h}},i.prototype.outEdges=function(f,l){var d=this._out[f];if(d){var h=e.values(d);return l?e.filter(h,function(g){return g.w===l}):h}},i.prototype.nodeEdges=function(f,l){var d=this.inEdges(f,l);if(d)return d.concat(this.outEdges(f,l))};function a(f,l){f[l]?f[l]++:f[l]=1}function o(f,l){--f[l]||delete f[l]}function s(f,l,d,h){var g=""+l,m=""+d;if(!f&&g>m){var v=g;g=m,m=v}return g+n+m+n+(e.isUndefined(h)?t:h)}function u(f,l,d,h){var g=""+l,m=""+d;if(!f&&g>m){var v=g;g=m,m=v}var y={v:g,w:m};return h&&(y.name=h),y}function c(f,l){return s(f,l.v,l.w,l.name)}return ts}var rs,Lp;function bI(){return Lp||(Lp=1,rs="2.1.8"),rs}var ns,Op;function xI(){return Op||(Op=1,ns={Graph:jc(),version:bI()}),ns}var is,Dp;function wI(){if(Dp)return is;Dp=1;var e=me(),t=jc();is={write:r,read:a};function r(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:i(o)};return e.isUndefined(o.graph())||(s.value=e.clone(o.graph())),s}function n(o){return e.map(o.nodes(),function(s){var u=o.node(s),c=o.parent(s),f={v:s};return e.isUndefined(u)||(f.value=u),e.isUndefined(c)||(f.parent=c),f})}function i(o){return e.map(o.edges(),function(s){var u=o.edge(s),c={v:s.v,w:s.w};return e.isUndefined(s.name)||(c.name=s.name),e.isUndefined(u)||(c.value=u),c})}function a(o){var s=new t(o.options).setGraph(o.value);return e.each(o.nodes,function(u){s.setNode(u.v,u.value),u.parent&&s.setParent(u.v,u.parent)}),e.each(o.edges,function(u){s.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),s}return is}var as,jp;function EI(){if(jp)return as;jp=1;var e=me();as=t;function t(r){var n={},i=[],a;function o(s){e.has(n,s)||(n[s]=!0,a.push(s),e.each(r.successors(s),o),e.each(r.predecessors(s),o))}return e.each(r.nodes(),function(s){a=[],o(s),a.length&&i.push(a)}),i}return as}var os,Fp;function e0(){if(Fp)return os;Fp=1;var e=me();os=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,n){var i=this._keyIndices;if(r=String(r),!e.has(i,r)){var a=this._arr,o=a.length;return i[r]=o,a.push({key:r,priority:n}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,n){var i=this._keyIndices[r];if(n>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[i].priority+" New: "+n);this._arr[i].priority=n,this._decrease(i)},t.prototype._heapify=function(r){var n=this._arr,i=2*r,a=i+1,o=r;i<n.length&&(o=n[i].priority<n[o].priority?i:o,a<n.length&&(o=n[a].priority<n[o].priority?a:o),o!==r&&(this._swap(r,o),this._heapify(o)))},t.prototype._decrease=function(r){for(var n=this._arr,i=n[r].priority,a;r!==0&&(a=r>>1,!(n[a].priority<i));)this._swap(r,a),r=a},t.prototype._swap=function(r,n){var i=this._arr,a=this._keyIndices,o=i[r],s=i[n];i[r]=s,i[n]=o,a[s.key]=r,a[o.key]=n},os}var ss,$p;function t0(){if($p)return ss;$p=1;var e=me(),t=e0();ss=n;var r=e.constant(1);function n(a,o,s,u){return i(a,String(o),s||r,u||function(c){return a.outEdges(c)})}function i(a,o,s,u){var c={},f=new t,l,d,h=function(g){var m=g.v!==l?g.v:g.w,v=c[m],y=s(g),b=d.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+y);b<v.distance&&(v.distance=b,v.predecessor=l,f.decrease(m,b))};for(a.nodes().forEach(function(g){var m=g===o?0:Number.POSITIVE_INFINITY;c[g]={distance:m},f.add(g,m)});f.size()>0&&(l=f.removeMin(),d=c[l],d.distance!==Number.POSITIVE_INFINITY);)u(l).forEach(h);return c}return ss}var us,zp;function SI(){if(zp)return us;zp=1;var e=t0(),t=me();us=r;function r(n,i,a){return t.transform(n.nodes(),function(o,s){o[s]=e(n,s,i,a)},{})}return us}var cs,Bp;function r0(){if(Bp)return cs;Bp=1;var e=me();cs=t;function t(r){var n=0,i=[],a={},o=[];function s(u){var c=a[u]={onStack:!0,lowlink:n,index:n++};if(i.push(u),r.successors(u).forEach(function(d){e.has(a,d)?a[d].onStack&&(c.lowlink=Math.min(c.lowlink,a[d].index)):(s(d),c.lowlink=Math.min(c.lowlink,a[d].lowlink))}),c.lowlink===c.index){var f=[],l;do l=i.pop(),a[l].onStack=!1,f.push(l);while(u!==l);o.push(f)}}return r.nodes().forEach(function(u){e.has(a,u)||s(u)}),o}return cs}var fs,Hp;function CI(){if(Hp)return fs;Hp=1;var e=me(),t=r0();fs=r;function r(n){return e.filter(t(n),function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return fs}var ls,Vp;function qI(){if(Vp)return ls;Vp=1;var e=me();ls=r;var t=e.constant(1);function r(i,a,o){return n(i,a||t,o||function(s){return i.outEdges(s)})}function n(i,a,o){var s={},u=i.nodes();return u.forEach(function(c){s[c]={},s[c][c]={distance:0},u.forEach(function(f){c!==f&&(s[c][f]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(f){var l=f.v===c?f.w:f.v,d=a(f);s[c][l]={distance:d,predecessor:c}})}),u.forEach(function(c){var f=s[c];u.forEach(function(l){var d=s[l];u.forEach(function(h){var g=d[c],m=f[h],v=d[h],y=g.distance+m.distance;y<v.distance&&(v.distance=y,v.predecessor=m.predecessor)})})}),s}return ls}var ds,Gp;function n0(){if(Gp)return ds;Gp=1;var e=me();ds=t,t.CycleException=r;function t(n){var i={},a={},o=[];function s(u){if(e.has(a,u))throw new r;e.has(i,u)||(a[u]=!0,i[u]=!0,e.each(n.predecessors(u),s),delete a[u],o.push(u))}if(e.each(n.sinks(),s),e.size(i)!==n.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,ds}var hs,Up;function II(){if(Up)return hs;Up=1;var e=n0();hs=t;function t(r){try{e(r)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return hs}var ps,Yp;function i0(){if(Yp)return ps;Yp=1;var e=me();ps=t;function t(n,i,a){e.isArray(i)||(i=[i]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],u={};return e.each(i,function(c){if(!n.hasNode(c))throw new Error("Graph does not have node: "+c);r(n,c,a==="post",u,o,s)}),s}function r(n,i,a,o,s,u){e.has(o,i)||(o[i]=!0,a||u.push(i),e.each(s(i),function(c){r(n,c,a,o,s,u)}),a&&u.push(i))}return ps}var gs,Wp;function NI(){if(Wp)return gs;Wp=1;var e=i0();gs=t;function t(r,n){return e(r,n,"post")}return gs}var vs,Xp;function RI(){if(Xp)return vs;Xp=1;var e=i0();vs=t;function t(r,n){return e(r,n,"pre")}return vs}var ys,Kp;function AI(){if(Kp)return ys;Kp=1;var e=me(),t=jc(),r=e0();ys=n;function n(i,a){var o=new t,s={},u=new r,c;function f(d){var h=d.v===c?d.w:d.v,g=u.priority(h);if(g!==void 0){var m=a(d);m<g&&(s[h]=c,u.decrease(h,m))}}if(i.nodeCount()===0)return o;e.each(i.nodes(),function(d){u.add(d,Number.POSITIVE_INFINITY),o.setNode(d)}),u.decrease(i.nodes()[0],0);for(var l=!1;u.size()>0;){if(c=u.removeMin(),e.has(s,c))o.setEdge(c,s[c]);else{if(l)throw new Error("Input graph is not connected: "+i);l=!0}i.nodeEdges(c).forEach(f)}return o}return ys}var ms,Zp;function MI(){return Zp||(Zp=1,ms={components:EI(),dijkstra:t0(),dijkstraAll:SI(),findCycles:CI(),floydWarshall:qI(),isAcyclic:II(),postorder:NI(),preorder:RI(),prim:AI(),tarjan:r0(),topsort:n0()}),ms}var _s,Qp;function TI(){if(Qp)return _s;Qp=1;var e=xI();return _s={Graph:e.Graph,json:wI(),alg:MI(),version:e.version},_s}var bs,Jp;function Ee(){if(Jp)return bs;Jp=1;var e;if(typeof wc=="function")try{e=TI()}catch{}return e||(e=window.graphlib),bs=e,bs}var xs,eg;function kI(){if(eg)return xs;eg=1;var e=Rm(),t=1,r=4;function n(i){return e(i,t|r)}return xs=n,xs}var ws,tg;function un(){if(tg)return ws;tg=1;var e=wt(),t=Be(),r=Qr(),n=ye();function i(a,o,s){if(!n(s))return!1;var u=typeof o;return(u=="number"?t(s)&&r(o,s.length):u=="string"&&o in s)?e(s[o],a):!1}return ws=i,ws}var Es,rg;function PI(){if(rg)return Es;rg=1;var e=sn(),t=wt(),r=un(),n=st(),i=Object.prototype,a=i.hasOwnProperty,o=e(function(s,u){s=Object(s);var c=-1,f=u.length,l=f>2?u[2]:void 0;for(l&&r(u[0],u[1],l)&&(f=1);++c<f;)for(var d=u[c],h=n(d),g=-1,m=h.length;++g<m;){var v=h[g],y=s[v];(y===void 0||t(y,i[v])&&!a.call(s,v))&&(s[v]=d[v])}return s});return Es=o,Es}var Ss,ng;function LI(){if(ng)return Ss;ng=1;var e=He(),t=Be(),r=Ke();function n(i){return function(a,o,s){var u=Object(a);if(!t(a)){var c=e(o,3);a=r(a),o=function(l){return c(u[l],l,u)}}var f=i(a,o,s);return f>-1?u[c?a[f]:f]:void 0}}return Ss=n,Ss}var Cs,ig;function OI(){if(ig)return Cs;ig=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Cs=t,Cs}var qs,ag;function DI(){if(ag)return qs;ag=1;var e=OI(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return qs=r,qs}var Is,og;function jI(){if(og)return Is;og=1;var e=DI(),t=ye(),r=qt(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=t(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=e(c);var l=a.test(c);return l||o.test(c)?s(c.slice(2),l?2:8):i.test(c)?n:+c}return Is=u,Is}var Ns,sg;function a0(){if(sg)return Ns;sg=1;var e=jI(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return Ns=n,Ns}var Rs,ug;function FI(){if(ug)return Rs;ug=1;var e=a0();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return Rs=t,Rs}var As,cg;function $I(){if(cg)return As;cg=1;var e=Zm(),t=He(),r=FI(),n=Math.max;function i(a,o,s){var u=a==null?0:a.length;if(!u)return-1;var c=s==null?0:r(s);return c<0&&(c=n(u+c,0)),e(a,t(o,3),c)}return As=i,As}var Ms,fg;function zI(){if(fg)return Ms;fg=1;var e=LI(),t=$I(),r=e(t);return Ms=r,Ms}var Ts,lg;function o0(){if(lg)return Ts;lg=1;var e=Dc();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return Ts=t,Ts}var ks,dg;function BI(){if(dg)return ks;dg=1;var e=kc(),t=Am(),r=st();function n(i,a){return i==null?i:e(i,t(a),r)}return ks=n,ks}var Ps,hg;function HI(){if(hg)return Ps;hg=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ps=e,Ps}var Ls,pg;function VI(){if(pg)return Ls;pg=1;var e=Kr(),t=Pc(),r=He();function n(i,a){var o={};return a=r(a,3),t(i,function(s,u,c){e(o,u,a(s,u,c))}),o}return Ls=n,Ls}var Os,gg;function Fc(){if(gg)return Os;gg=1;var e=qt();function t(r,n,i){for(var a=-1,o=r.length;++a<o;){var s=r[a],u=n(s);if(u!=null&&(c===void 0?u===u&&!e(u):i(u,c)))var c=u,f=s}return f}return Os=t,Os}var Ds,vg;function GI(){if(vg)return Ds;vg=1;function e(t,r){return t>r}return Ds=e,Ds}var js,yg;function UI(){if(yg)return js;yg=1;var e=Fc(),t=GI(),r=ut();function n(i){return i&&i.length?e(i,r,t):void 0}return js=n,js}var Fs,mg;function s0(){if(mg)return Fs;mg=1;var e=Kr(),t=wt();function r(n,i,a){(a!==void 0&&!t(n[i],a)||a===void 0&&!(i in n))&&e(n,i,a)}return Fs=r,Fs}var $s,_g;function YI(){if(_g)return $s;_g=1;var e=at(),t=tn(),r=Te(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,u=o.call(Object);function c(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var d=s.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&o.call(d)==u}return $s=c,$s}var zs,bg;function u0(){if(bg)return zs;bg=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return zs=e,zs}var Bs,xg;function WI(){if(xg)return Bs;xg=1;var e=Jt(),t=st();function r(n){return e(n,t(n))}return Bs=r,Bs}var Hs,wg;function XI(){if(wg)return Hs;wg=1;var e=s0(),t=ym(),r=qm(),n=mm(),i=Nm(),a=er(),o=ce(),s=Qm(),u=St(),c=Qt(),f=ye(),l=YI(),d=tr(),h=u0(),g=WI();function m(v,y,b,p,_,x,w){var E=h(v,b),I=h(y,b),q=w.get(I);if(q){e(v,b,q);return}var R=x?x(E,I,b+"",v,y,w):void 0,C=R===void 0;if(C){var N=o(I),L=!N&&u(I),S=!N&&!L&&d(I);R=I,N||L||S?o(E)?R=E:s(E)?R=n(E):L?(C=!1,R=t(I,!0)):S?(C=!1,R=r(I,!0)):R=[]:l(I)||a(I)?(R=E,a(E)?R=g(E):(!f(E)||c(E))&&(R=i(I))):C=!1}C&&(w.set(I,R),_(R,I,p,x,w),w.delete(I)),e(v,b,R)}return Hs=m,Hs}var Vs,Eg;function KI(){if(Eg)return Vs;Eg=1;var e=Xr(),t=s0(),r=kc(),n=XI(),i=ye(),a=st(),o=u0();function s(u,c,f,l,d){u!==c&&r(c,function(h,g){if(d||(d=new e),i(h))n(u,c,g,f,s,l,d);else{var m=l?l(o(u,g),h,g+"",u,c,d):void 0;m===void 0&&(m=h),t(u,g,m)}},a)}return Vs=s,Vs}var Gs,Sg;function ZI(){if(Sg)return Gs;Sg=1;var e=sn(),t=un();function r(n){return e(function(i,a){var o=-1,s=a.length,u=s>1?a[s-1]:void 0,c=s>2?a[2]:void 0;for(u=n.length>3&&typeof u=="function"?(s--,u):void 0,c&&t(a[0],a[1],c)&&(u=s<3?void 0:u,s=1),i=Object(i);++o<s;){var f=a[o];f&&n(i,f,o,u)}return i})}return Gs=r,Gs}var Us,Cg;function QI(){if(Cg)return Us;Cg=1;var e=KI(),t=ZI(),r=t(function(n,i,a){e(n,i,a)});return Us=r,Us}var Ys,qg;function c0(){if(qg)return Ys;qg=1;function e(t,r){return t<r}return Ys=e,Ys}var Ws,Ig;function JI(){if(Ig)return Ws;Ig=1;var e=Fc(),t=c0(),r=ut();function n(i){return i&&i.length?e(i,r,t):void 0}return Ws=n,Ws}var Xs,Ng;function eN(){if(Ng)return Xs;Ng=1;var e=Fc(),t=He(),r=c0();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return Xs=n,Xs}var Ks,Rg;function tN(){if(Rg)return Ks;Rg=1;var e=Ce(),t=function(){return e.Date.now()};return Ks=t,Ks}var Zs,Ag;function rN(){if(Ag)return Zs;Ag=1;var e=Zr(),t=an(),r=Qr(),n=ye(),i=rr();function a(o,s,u,c){if(!n(o))return o;s=t(s,o);for(var f=-1,l=s.length,d=l-1,h=o;h!=null&&++f<l;){var g=i(s[f]),m=u;if(g==="__proto__"||g==="constructor"||g==="prototype")return o;if(f!=d){var v=h[g];m=c?c(v,g,h):void 0,m===void 0&&(m=n(v)?v:r(s[f+1])?[]:{})}e(h,g,m),h=h[g]}return o}return Zs=a,Zs}var Qs,Mg;function nN(){if(Mg)return Qs;Mg=1;var e=on(),t=rN(),r=an();function n(i,a,o){for(var s=-1,u=a.length,c={};++s<u;){var f=a[s],l=e(i,f);o(l,f)&&t(c,r(f,i),l)}return c}return Qs=n,Qs}var Js,Tg;function iN(){if(Tg)return Js;Tg=1;var e=nN(),t=zm();function r(n,i){return e(n,i,function(a,o){return t(n,o)})}return Js=r,Js}var eu,kg;function aN(){if(kg)return eu;kg=1;var e=o0(),t=Xm(),r=Km();function n(i){return r(t(i,void 0,e),i+"")}return eu=n,eu}var tu,Pg;function oN(){if(Pg)return tu;Pg=1;var e=iN(),t=aN(),r=t(function(n,i){return n==null?{}:e(n,i)});return tu=r,tu}var ru,Lg;function sN(){if(Lg)return ru;Lg=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var s=-1,u=t(e((i-n)/(a||1)),0),c=Array(u);u--;)c[o?u:++s]=n,n+=a;return c}return ru=r,ru}var nu,Og;function uN(){if(Og)return nu;Og=1;var e=sN(),t=un(),r=a0();function n(i){return function(a,o,s){return s&&typeof s!="number"&&t(a,o,s)&&(o=s=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),s=s===void 0?a<o?1:-1:r(s),e(a,o,s,i)}}return nu=n,nu}var iu,Dg;function cN(){if(Dg)return iu;Dg=1;var e=uN(),t=e();return iu=t,iu}var au,jg;function fN(){if(jg)return au;jg=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return au=e,au}var ou,Fg;function lN(){if(Fg)return ou;Fg=1;var e=qt();function t(r,n){if(r!==n){var i=r!==void 0,a=r===null,o=r===r,s=e(r),u=n!==void 0,c=n===null,f=n===n,l=e(n);if(!c&&!l&&!s&&r>n||s&&u&&f&&!c&&!l||a&&u&&f||!i&&f||!o)return 1;if(!a&&!s&&!l&&r<n||l&&i&&o&&!a&&!s||c&&i&&o||!u&&o||!f)return-1}return 0}return ou=t,ou}var su,$g;function dN(){if($g)return su;$g=1;var e=lN();function t(r,n,i){for(var a=-1,o=r.criteria,s=n.criteria,u=o.length,c=i.length;++a<u;){var f=e(o[a],s[a]);if(f){if(a>=c)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return su=t,su}var uu,zg;function hN(){if(zg)return uu;zg=1;var e=nn(),t=on(),r=He(),n=Um(),i=fN(),a=Jr(),o=dN(),s=ut(),u=ce();function c(f,l,d){l.length?l=e(l,function(m){return u(m)?function(v){return t(v,m.length===1?m[0]:m)}:m}):l=[s];var h=-1;l=e(l,a(r));var g=n(f,function(m,v,y){var b=e(l,function(p){return p(m)});return{criteria:b,index:++h,value:m}});return i(g,function(m,v){return o(m,v,d)})}return uu=c,uu}var cu,Bg;function pN(){if(Bg)return cu;Bg=1;var e=Dc(),t=hN(),r=sn(),n=un(),i=r(function(a,o){if(a==null)return[];var s=o.length;return s>1&&n(a,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return cu=i,cu}var fu,Hg;function gN(){if(Hg)return fu;Hg=1;var e=Fm(),t=0;function r(n){var i=++t;return e(n)+i}return fu=r,fu}var lu,Vg;function vN(){if(Vg)return lu;Vg=1;function e(t,r,n){for(var i=-1,a=t.length,o=r.length,s={};++i<a;){var u=i<o?r[i]:void 0;n(s,t[i],u)}return s}return lu=e,lu}var du,Gg;function yN(){if(Gg)return du;Gg=1;var e=Zr(),t=vN();function r(n,i){return t(n||[],i||[],e)}return du=r,du}var hu,Ug;function oe(){if(Ug)return hu;Ug=1;var e;if(typeof wc=="function")try{e={cloneDeep:kI(),constant:Tc(),defaults:PI(),each:Tm(),filter:Hm(),find:zI(),flatten:o0(),forEach:Mm(),forIn:BI(),has:Vm(),isUndefined:Gm(),last:HI(),map:Ym(),mapValues:VI(),max:UI(),merge:QI(),min:JI(),minBy:eN(),now:tN(),pick:oN(),range:cN(),reduce:Wm(),sortBy:pN(),uniqueId:gN(),values:Jm(),zipObject:yN()}}catch{}return e||(e=window._),hu=e,hu}var pu,Yg;function mN(){if(Yg)return pu;Yg=1,pu=e;function e(){var n={};n._next=n._prev=n,this._sentinel=n}e.prototype.dequeue=function(){var n=this._sentinel,i=n._prev;if(i!==n)return t(i),i},e.prototype.enqueue=function(n){var i=this._sentinel;n._prev&&n._next&&t(n),n._next=i._next,i._next._prev=n,i._next=n,n._prev=i},e.prototype.toString=function(){for(var n=[],i=this._sentinel,a=i._prev;a!==i;)n.push(JSON.stringify(a,r)),a=a._prev;return"["+n.join(", ")+"]"};function t(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,i){if(n!=="_next"&&n!=="_prev")return i}return pu}var gu,Wg;function _N(){if(Wg)return gu;Wg=1;var e=oe(),t=Ee().Graph,r=mN();gu=i;var n=e.constant(1);function i(c,f){if(c.nodeCount()<=1)return[];var l=s(c,f||n),d=a(l.graph,l.buckets,l.zeroIdx);return e.flatten(e.map(d,function(h){return c.outEdges(h.v,h.w)}),!0)}function a(c,f,l){for(var d=[],h=f[f.length-1],g=f[0],m;c.nodeCount();){for(;m=g.dequeue();)o(c,f,l,m);for(;m=h.dequeue();)o(c,f,l,m);if(c.nodeCount()){for(var v=f.length-2;v>0;--v)if(m=f[v].dequeue(),m){d=d.concat(o(c,f,l,m,!0));break}}}return d}function o(c,f,l,d,h){var g=h?[]:void 0;return e.forEach(c.inEdges(d.v),function(m){var v=c.edge(m),y=c.node(m.v);h&&g.push({v:m.v,w:m.w}),y.out-=v,u(f,l,y)}),e.forEach(c.outEdges(d.v),function(m){var v=c.edge(m),y=m.w,b=c.node(y);b.in-=v,u(f,l,b)}),c.removeNode(d.v),g}function s(c,f){var l=new t,d=0,h=0;e.forEach(c.nodes(),function(v){l.setNode(v,{v,in:0,out:0})}),e.forEach(c.edges(),function(v){var y=l.edge(v.v,v.w)||0,b=f(v),p=y+b;l.setEdge(v.v,v.w,p),h=Math.max(h,l.node(v.v).out+=b),d=Math.max(d,l.node(v.w).in+=b)});var g=e.range(h+d+3).map(function(){return new r}),m=d+1;return e.forEach(l.nodes(),function(v){u(g,m,l.node(v))}),{graph:l,buckets:g,zeroIdx:m}}function u(c,f,l){l.out?l.in?c[l.out-l.in+f].enqueue(l):c[c.length-1].enqueue(l):c[0].enqueue(l)}return gu}var vu,Xg;function bN(){if(Xg)return vu;Xg=1;var e=oe(),t=_N();vu={run:r,undo:i};function r(a){var o=a.graph().acyclicer==="greedy"?t(a,s(a)):n(a);e.forEach(o,function(u){var c=a.edge(u);a.removeEdge(u),c.forwardName=u.name,c.reversed=!0,a.setEdge(u.w,u.v,c,e.uniqueId("rev"))});function s(u){return function(c){return u.edge(c).weight}}}function n(a){var o=[],s={},u={};function c(f){e.has(u,f)||(u[f]=!0,s[f]=!0,e.forEach(a.outEdges(f),function(l){e.has(s,l.w)?o.push(l):c(l.w)}),delete s[f])}return e.forEach(a.nodes(),c),o}function i(a){e.forEach(a.edges(),function(o){var s=a.edge(o);if(s.reversed){a.removeEdge(o);var u=s.forwardName;delete s.reversed,delete s.forwardName,a.setEdge(o.w,o.v,s,u)}})}return vu}var yu,Kg;function pe(){if(Kg)return yu;Kg=1;var e=oe(),t=Ee().Graph;yu={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:o,intersectRect:s,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:f,addBorderNode:l,maxRank:d,partition:h,time:g,notime:m};function r(v,y,b,p){var _;do _=e.uniqueId(p);while(v.hasNode(_));return b.dummy=y,v.setNode(_,b),_}function n(v){var y=new t().setGraph(v.graph());return e.forEach(v.nodes(),function(b){y.setNode(b,v.node(b))}),e.forEach(v.edges(),function(b){var p=y.edge(b.v,b.w)||{weight:0,minlen:1},_=v.edge(b);y.setEdge(b.v,b.w,{weight:p.weight+_.weight,minlen:Math.max(p.minlen,_.minlen)})}),y}function i(v){var y=new t({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(b){v.children(b).length||y.setNode(b,v.node(b))}),e.forEach(v.edges(),function(b){y.setEdge(b,v.edge(b))}),y}function a(v){var y=e.map(v.nodes(),function(b){var p={};return e.forEach(v.outEdges(b),function(_){p[_.w]=(p[_.w]||0)+v.edge(_).weight}),p});return e.zipObject(v.nodes(),y)}function o(v){var y=e.map(v.nodes(),function(b){var p={};return e.forEach(v.inEdges(b),function(_){p[_.v]=(p[_.v]||0)+v.edge(_).weight}),p});return e.zipObject(v.nodes(),y)}function s(v,y){var b=v.x,p=v.y,_=y.x-b,x=y.y-p,w=v.width/2,E=v.height/2;if(!_&&!x)throw new Error("Not possible to find intersection inside of the rectangle");var I,q;return Math.abs(x)*w>Math.abs(_)*E?(x<0&&(E=-E),I=E*_/x,q=E):(_<0&&(w=-w),I=w,q=w*x/_),{x:b+I,y:p+q}}function u(v){var y=e.map(e.range(d(v)+1),function(){return[]});return e.forEach(v.nodes(),function(b){var p=v.node(b),_=p.rank;e.isUndefined(_)||(y[_][p.order]=b)}),y}function c(v){var y=e.min(e.map(v.nodes(),function(b){return v.node(b).rank}));e.forEach(v.nodes(),function(b){var p=v.node(b);e.has(p,"rank")&&(p.rank-=y)})}function f(v){var y=e.min(e.map(v.nodes(),function(x){return v.node(x).rank})),b=[];e.forEach(v.nodes(),function(x){var w=v.node(x).rank-y;b[w]||(b[w]=[]),b[w].push(x)});var p=0,_=v.graph().nodeRankFactor;e.forEach(b,function(x,w){e.isUndefined(x)&&w%_!==0?--p:p&&e.forEach(x,function(E){v.node(E).rank+=p})})}function l(v,y,b,p){var _={width:0,height:0};return arguments.length>=4&&(_.rank=b,_.order=p),r(v,"border",_,y)}function d(v){return e.max(e.map(v.nodes(),function(y){var b=v.node(y).rank;if(!e.isUndefined(b))return b}))}function h(v,y){var b={lhs:[],rhs:[]};return e.forEach(v,function(p){y(p)?b.lhs.push(p):b.rhs.push(p)}),b}function g(v,y){var b=e.now();try{return y()}finally{console.log(v+" time: "+(e.now()-b)+"ms")}}function m(v,y){return y()}return yu}var mu,Zg;function xN(){if(Zg)return mu;Zg=1;var e=oe(),t=pe();mu={run:r,undo:i};function r(a){a.graph().dummyChains=[],e.forEach(a.edges(),function(o){n(a,o)})}function n(a,o){var s=o.v,u=a.node(s).rank,c=o.w,f=a.node(c).rank,l=o.name,d=a.edge(o),h=d.labelRank;if(f!==u+1){a.removeEdge(o);var g,m,v;for(v=0,++u;u<f;++v,++u)d.points=[],m={width:0,height:0,edgeLabel:d,edgeObj:o,rank:u},g=t.addDummyNode(a,"edge",m,"_d"),u===h&&(m.width=d.width,m.height=d.height,m.dummy="edge-label",m.labelpos=d.labelpos),a.setEdge(s,g,{weight:d.weight},l),v===0&&a.graph().dummyChains.push(g),s=g;a.setEdge(s,c,{weight:d.weight},l)}}function i(a){e.forEach(a.graph().dummyChains,function(o){var s=a.node(o),u=s.edgeLabel,c;for(a.setEdge(s.edgeObj,u);s.dummy;)c=a.successors(o)[0],a.removeNode(o),u.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(u.x=s.x,u.y=s.y,u.width=s.width,u.height=s.height),o=c,s=a.node(o)})}return mu}var _u,Qg;function Tr(){if(Qg)return _u;Qg=1;var e=oe();_u={longestPath:t,slack:r};function t(n){var i={};function a(o){var s=n.node(o);if(e.has(i,o))return s.rank;i[o]=!0;var u=e.min(e.map(n.outEdges(o),function(c){return a(c.w)-n.edge(c).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),s.rank=u}e.forEach(n.sources(),a)}function r(n,i){return n.node(i.w).rank-n.node(i.v).rank-n.edge(i).minlen}return _u}var bu,Jg;function f0(){if(Jg)return bu;Jg=1;var e=oe(),t=Ee().Graph,r=Tr().slack;bu=n;function n(s){var u=new t({directed:!1}),c=s.nodes()[0],f=s.nodeCount();u.setNode(c,{});for(var l,d;i(u,s)<f;)l=a(u,s),d=u.hasNode(l.v)?r(s,l):-r(s,l),o(u,s,d);return u}function i(s,u){function c(f){e.forEach(u.nodeEdges(f),function(l){var d=l.v,h=f===d?l.w:d;!s.hasNode(h)&&!r(u,l)&&(s.setNode(h,{}),s.setEdge(f,h,{}),c(h))})}return e.forEach(s.nodes(),c),s.nodeCount()}function a(s,u){return e.minBy(u.edges(),function(c){if(s.hasNode(c.v)!==s.hasNode(c.w))return r(u,c)})}function o(s,u,c){e.forEach(s.nodes(),function(f){u.node(f).rank+=c})}return bu}var xu,ev;function wN(){if(ev)return xu;ev=1;var e=oe(),t=f0(),r=Tr().slack,n=Tr().longestPath,i=Ee().alg.preorder,a=Ee().alg.postorder,o=pe().simplify;xu=s,s.initLowLimValues=l,s.initCutValues=u,s.calcCutValue=f,s.leaveEdge=h,s.enterEdge=g,s.exchangeEdges=m;function s(p){p=o(p),n(p);var _=t(p);l(_),u(_,p);for(var x,w;x=h(_);)w=g(_,p,x),m(_,p,x,w)}function u(p,_){var x=a(p,p.nodes());x=x.slice(0,x.length-1),e.forEach(x,function(w){c(p,_,w)})}function c(p,_,x){var w=p.node(x),E=w.parent;p.edge(x,E).cutvalue=f(p,_,x)}function f(p,_,x){var w=p.node(x),E=w.parent,I=!0,q=_.edge(x,E),R=0;return q||(I=!1,q=_.edge(E,x)),R=q.weight,e.forEach(_.nodeEdges(x),function(C){var N=C.v===x,L=N?C.w:C.v;if(L!==E){var S=N===I,T=_.edge(C).weight;if(R+=S?T:-T,y(p,x,L)){var M=p.edge(x,L).cutvalue;R+=S?-M:M}}}),R}function l(p,_){arguments.length<2&&(_=p.nodes()[0]),d(p,{},1,_)}function d(p,_,x,w,E){var I=x,q=p.node(w);return _[w]=!0,e.forEach(p.neighbors(w),function(R){e.has(_,R)||(x=d(p,_,x,R,w))}),q.low=I,q.lim=x++,E?q.parent=E:delete q.parent,x}function h(p){return e.find(p.edges(),function(_){return p.edge(_).cutvalue<0})}function g(p,_,x){var w=x.v,E=x.w;_.hasEdge(w,E)||(w=x.w,E=x.v);var I=p.node(w),q=p.node(E),R=I,C=!1;I.lim>q.lim&&(R=q,C=!0);var N=e.filter(_.edges(),function(L){return C===b(p,p.node(L.v),R)&&C!==b(p,p.node(L.w),R)});return e.minBy(N,function(L){return r(_,L)})}function m(p,_,x,w){var E=x.v,I=x.w;p.removeEdge(E,I),p.setEdge(w.v,w.w,{}),l(p),u(p,_),v(p,_)}function v(p,_){var x=e.find(p.nodes(),function(E){return!_.node(E).parent}),w=i(p,x);w=w.slice(1),e.forEach(w,function(E){var I=p.node(E).parent,q=_.edge(E,I),R=!1;q||(q=_.edge(I,E),R=!0),_.node(E).rank=_.node(I).rank+(R?q.minlen:-q.minlen)})}function y(p,_,x){return p.hasEdge(_,x)}function b(p,_,x){return x.low<=_.lim&&_.lim<=x.lim}return xu}var wu,tv;function EN(){if(tv)return wu;tv=1;var e=Tr(),t=e.longestPath,r=f0(),n=wN();wu=i;function i(u){switch(u.graph().ranker){case"network-simplex":s(u);break;case"tight-tree":o(u);break;case"longest-path":a(u);break;default:s(u)}}var a=t;function o(u){t(u),r(u)}function s(u){n(u)}return wu}var Eu,rv;function SN(){if(rv)return Eu;rv=1;var e=oe();Eu=t;function t(i){var a=n(i);e.forEach(i.graph().dummyChains,function(o){for(var s=i.node(o),u=s.edgeObj,c=r(i,a,u.v,u.w),f=c.path,l=c.lca,d=0,h=f[d],g=!0;o!==u.w;){if(s=i.node(o),g){for(;(h=f[d])!==l&&i.node(h).maxRank<s.rank;)d++;h===l&&(g=!1)}if(!g){for(;d<f.length-1&&i.node(h=f[d+1]).minRank<=s.rank;)d++;h=f[d]}i.setParent(o,h),o=i.successors(o)[0]}})}function r(i,a,o,s){var u=[],c=[],f=Math.min(a[o].low,a[s].low),l=Math.max(a[o].lim,a[s].lim),d,h;d=o;do d=i.parent(d),u.push(d);while(d&&(a[d].low>f||l>a[d].lim));for(h=d,d=s;(d=i.parent(d))!==h;)c.push(d);return{path:u.concat(c.reverse()),lca:h}}function n(i){var a={},o=0;function s(u){var c=o;e.forEach(i.children(u),s),a[u]={low:c,lim:o++}}return e.forEach(i.children(),s),a}return Eu}var Su,nv;function CN(){if(nv)return Su;nv=1;var e=oe(),t=pe();Su={run:r,cleanup:o};function r(s){var u=t.addDummyNode(s,"root",{},"_root"),c=i(s),f=e.max(e.values(c))-1,l=2*f+1;s.graph().nestingRoot=u,e.forEach(s.edges(),function(h){s.edge(h).minlen*=l});var d=a(s)+1;e.forEach(s.children(),function(h){n(s,u,l,d,f,c,h)}),s.graph().nodeRankFactor=l}function n(s,u,c,f,l,d,h){var g=s.children(h);if(!g.length){h!==u&&s.setEdge(u,h,{weight:0,minlen:c});return}var m=t.addBorderNode(s,"_bt"),v=t.addBorderNode(s,"_bb"),y=s.node(h);s.setParent(m,h),y.borderTop=m,s.setParent(v,h),y.borderBottom=v,e.forEach(g,function(b){n(s,u,c,f,l,d,b);var p=s.node(b),_=p.borderTop?p.borderTop:b,x=p.borderBottom?p.borderBottom:b,w=p.borderTop?f:2*f,E=_!==x?1:l-d[h]+1;s.setEdge(m,_,{weight:w,minlen:E,nestingEdge:!0}),s.setEdge(x,v,{weight:w,minlen:E,nestingEdge:!0})}),s.parent(h)||s.setEdge(u,m,{weight:0,minlen:l+d[h]})}function i(s){var u={};function c(f,l){var d=s.children(f);d&&d.length&&e.forEach(d,function(h){c(h,l+1)}),u[f]=l}return e.forEach(s.children(),function(f){c(f,1)}),u}function a(s){return e.reduce(s.edges(),function(u,c){return u+s.edge(c).weight},0)}function o(s){var u=s.graph();s.removeNode(u.nestingRoot),delete u.nestingRoot,e.forEach(s.edges(),function(c){var f=s.edge(c);f.nestingEdge&&s.removeEdge(c)})}return Su}var Cu,iv;function qN(){if(iv)return Cu;iv=1;var e=oe(),t=pe();Cu=r;function r(i){function a(o){var s=i.children(o),u=i.node(o);if(s.length&&e.forEach(s,a),e.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var c=u.minRank,f=u.maxRank+1;c<f;++c)n(i,"borderLeft","_bl",o,u,c),n(i,"borderRight","_br",o,u,c)}}e.forEach(i.children(),a)}function n(i,a,o,s,u,c){var f={width:0,height:0,rank:c,borderType:a},l=u[a][c-1],d=t.addDummyNode(i,"border",f,o);u[a][c]=d,i.setParent(d,s),l&&i.setEdge(l,d,{weight:1})}return Cu}var qu,av;function IN(){if(av)return qu;av=1;var e=oe();qu={adjust:t,undo:r};function t(c){var f=c.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(c)}function r(c){var f=c.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&a(c),(f==="lr"||f==="rl")&&(s(c),n(c))}function n(c){e.forEach(c.nodes(),function(f){i(c.node(f))}),e.forEach(c.edges(),function(f){i(c.edge(f))})}function i(c){var f=c.width;c.width=c.height,c.height=f}function a(c){e.forEach(c.nodes(),function(f){o(c.node(f))}),e.forEach(c.edges(),function(f){var l=c.edge(f);e.forEach(l.points,o),e.has(l,"y")&&o(l)})}function o(c){c.y=-c.y}function s(c){e.forEach(c.nodes(),function(f){u(c.node(f))}),e.forEach(c.edges(),function(f){var l=c.edge(f);e.forEach(l.points,u),e.has(l,"x")&&u(l)})}function u(c){var f=c.x;c.x=c.y,c.y=f}return qu}var Iu,ov;function NN(){if(ov)return Iu;ov=1;var e=oe();Iu=t;function t(r){var n={},i=e.filter(r.nodes(),function(c){return!r.children(c).length}),a=e.max(e.map(i,function(c){return r.node(c).rank})),o=e.map(e.range(a+1),function(){return[]});function s(c){if(!e.has(n,c)){n[c]=!0;var f=r.node(c);o[f.rank].push(c),e.forEach(r.successors(c),s)}}var u=e.sortBy(i,function(c){return r.node(c).rank});return e.forEach(u,s),o}return Iu}var Nu,sv;function RN(){if(sv)return Nu;sv=1;var e=oe();Nu=t;function t(n,i){for(var a=0,o=1;o<i.length;++o)a+=r(n,i[o-1],i[o]);return a}function r(n,i,a){for(var o=e.zipObject(a,e.map(a,function(d,h){return h})),s=e.flatten(e.map(i,function(d){return e.sortBy(e.map(n.outEdges(d),function(h){return{pos:o[h.w],weight:n.edge(h).weight}}),"pos")}),!0),u=1;u<a.length;)u<<=1;var c=2*u-1;u-=1;var f=e.map(new Array(c),function(){return 0}),l=0;return e.forEach(s.forEach(function(d){var h=d.pos+u;f[h]+=d.weight;for(var g=0;h>0;)h%2&&(g+=f[h+1]),h=h-1>>1,f[h]+=d.weight;l+=d.weight*g})),l}return Nu}var Ru,uv;function AN(){if(uv)return Ru;uv=1;var e=oe();Ru=t;function t(r,n){return e.map(n,function(i){var a=r.inEdges(i);if(a.length){var o=e.reduce(a,function(s,u){var c=r.edge(u),f=r.node(u.v);return{sum:s.sum+c.weight*f.order,weight:s.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:i}})}return Ru}var Au,cv;function MN(){if(cv)return Au;cv=1;var e=oe();Au=t;function t(i,a){var o={};e.forEach(i,function(u,c){var f=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:c};e.isUndefined(u.barycenter)||(f.barycenter=u.barycenter,f.weight=u.weight)}),e.forEach(a.edges(),function(u){var c=o[u.v],f=o[u.w];!e.isUndefined(c)&&!e.isUndefined(f)&&(f.indegree++,c.out.push(o[u.w]))});var s=e.filter(o,function(u){return!u.indegree});return r(s)}function r(i){var a=[];function o(c){return function(f){f.merged||(e.isUndefined(f.barycenter)||e.isUndefined(c.barycenter)||f.barycenter>=c.barycenter)&&n(c,f)}}function s(c){return function(f){f.in.push(c),--f.indegree===0&&i.push(f)}}for(;i.length;){var u=i.pop();a.push(u),e.forEach(u.in.reverse(),o(u)),e.forEach(u.out,s(u))}return e.map(e.filter(a,function(c){return!c.merged}),function(c){return e.pick(c,["vs","i","barycenter","weight"])})}function n(i,a){var o=0,s=0;i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=o/s,i.weight=s,i.i=Math.min(a.i,i.i),a.merged=!0}return Au}var Mu,fv;function TN(){if(fv)return Mu;fv=1;var e=oe(),t=pe();Mu=r;function r(a,o){var s=t.partition(a,function(m){return e.has(m,"barycenter")}),u=s.lhs,c=e.sortBy(s.rhs,function(m){return-m.i}),f=[],l=0,d=0,h=0;u.sort(i(!!o)),h=n(f,c,h),e.forEach(u,function(m){h+=m.vs.length,f.push(m.vs),l+=m.barycenter*m.weight,d+=m.weight,h=n(f,c,h)});var g={vs:e.flatten(f,!0)};return d&&(g.barycenter=l/d,g.weight=d),g}function n(a,o,s){for(var u;o.length&&(u=e.last(o)).i<=s;)o.pop(),a.push(u.vs),s++;return s}function i(a){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:a?s.i-o.i:o.i-s.i}}return Mu}var Tu,lv;function kN(){if(lv)return Tu;lv=1;var e=oe(),t=AN(),r=MN(),n=TN();Tu=i;function i(s,u,c,f){var l=s.children(u),d=s.node(u),h=d?d.borderLeft:void 0,g=d?d.borderRight:void 0,m={};h&&(l=e.filter(l,function(x){return x!==h&&x!==g}));var v=t(s,l);e.forEach(v,function(x){if(s.children(x.v).length){var w=i(s,x.v,c,f);m[x.v]=w,e.has(w,"barycenter")&&o(x,w)}});var y=r(v,c);a(y,m);var b=n(y,f);if(h&&(b.vs=e.flatten([h,b.vs,g],!0),s.predecessors(h).length)){var p=s.node(s.predecessors(h)[0]),_=s.node(s.predecessors(g)[0]);e.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+p.order+_.order)/(b.weight+2),b.weight+=2}return b}function a(s,u){e.forEach(s,function(c){c.vs=e.flatten(c.vs.map(function(f){return u[f]?u[f].vs:f}),!0)})}function o(s,u){e.isUndefined(s.barycenter)?(s.barycenter=u.barycenter,s.weight=u.weight):(s.barycenter=(s.barycenter*s.weight+u.barycenter*u.weight)/(s.weight+u.weight),s.weight+=u.weight)}return Tu}var ku,dv;function PN(){if(dv)return ku;dv=1;var e=oe(),t=Ee().Graph;ku=r;function r(i,a,o){var s=n(i),u=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(c){return i.node(c)});return e.forEach(i.nodes(),function(c){var f=i.node(c),l=i.parent(c);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(u.setNode(c),u.setParent(c,l||s),e.forEach(i[o](c),function(d){var h=d.v===c?d.w:d.v,g=u.edge(h,c),m=e.isUndefined(g)?0:g.weight;u.setEdge(h,c,{weight:i.edge(d).weight+m})}),e.has(f,"minRank")&&u.setNode(c,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),u}function n(i){for(var a;i.hasNode(a=e.uniqueId("_root")););return a}return ku}var Pu,hv;function LN(){if(hv)return Pu;hv=1;var e=oe();Pu=t;function t(r,n,i){var a={},o;e.forEach(i,function(s){for(var u=r.parent(s),c,f;u;){if(c=r.parent(u),c?(f=a[c],a[c]=u):(f=o,o=u),f&&f!==u){n.setEdge(f,u);return}u=c}})}return Pu}var Lu,pv;function ON(){if(pv)return Lu;pv=1;var e=oe(),t=NN(),r=RN(),n=kN(),i=PN(),a=LN(),o=Ee().Graph,s=pe();Lu=u;function u(d){var h=s.maxRank(d),g=c(d,e.range(1,h+1),"inEdges"),m=c(d,e.range(h-1,-1,-1),"outEdges"),v=t(d);l(d,v);for(var y=Number.POSITIVE_INFINITY,b,p=0,_=0;_<4;++p,++_){f(p%2?g:m,p%4>=2),v=s.buildLayerMatrix(d);var x=r(d,v);x<y&&(_=0,b=e.cloneDeep(v),y=x)}l(d,b)}function c(d,h,g){return e.map(h,function(m){return i(d,m,g)})}function f(d,h){var g=new o;e.forEach(d,function(m){var v=m.graph().root,y=n(m,v,g,h);e.forEach(y.vs,function(b,p){m.node(b).order=p}),a(m,g,y.vs)})}function l(d,h){e.forEach(h,function(g){e.forEach(g,function(m,v){d.node(m).order=v})})}return Lu}var Ou,gv;function DN(){if(gv)return Ou;gv=1;var e=oe(),t=Ee().Graph,r=pe();Ou={positionX:g,findType1Conflicts:n,findType2Conflicts:i,addConflict:o,hasConflict:s,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:d,findSmallestWidthAlignment:l,balance:h};function n(y,b){var p={};function _(x,w){var E=0,I=0,q=x.length,R=e.last(w);return e.forEach(w,function(C,N){var L=a(y,C),S=L?y.node(L).order:q;(L||C===R)&&(e.forEach(w.slice(I,N+1),function(T){e.forEach(y.predecessors(T),function(M){var j=y.node(M),O=j.order;(O<E||S<O)&&!(j.dummy&&y.node(T).dummy)&&o(p,M,T)})}),I=N+1,E=S)}),w}return e.reduce(b,_),p}function i(y,b){var p={};function _(w,E,I,q,R){var C;e.forEach(e.range(E,I),function(N){C=w[N],y.node(C).dummy&&e.forEach(y.predecessors(C),function(L){var S=y.node(L);S.dummy&&(S.order<q||S.order>R)&&o(p,L,C)})})}function x(w,E){var I=-1,q,R=0;return e.forEach(E,function(C,N){if(y.node(C).dummy==="border"){var L=y.predecessors(C);L.length&&(q=y.node(L[0]).order,_(E,R,N,I,q),R=N,I=q)}_(E,R,E.length,q,w.length)}),E}return e.reduce(b,x),p}function a(y,b){if(y.node(b).dummy)return e.find(y.predecessors(b),function(p){return y.node(p).dummy})}function o(y,b,p){if(b>p){var _=b;b=p,p=_}var x=y[b];x||(y[b]=x={}),x[p]=!0}function s(y,b,p){if(b>p){var _=b;b=p,p=_}return e.has(y[b],p)}function u(y,b,p,_){var x={},w={},E={};return e.forEach(b,function(I){e.forEach(I,function(q,R){x[q]=q,w[q]=q,E[q]=R})}),e.forEach(b,function(I){var q=-1;e.forEach(I,function(R){var C=_(R);if(C.length){C=e.sortBy(C,function(M){return E[M]});for(var N=(C.length-1)/2,L=Math.floor(N),S=Math.ceil(N);L<=S;++L){var T=C[L];w[R]===R&&q<E[T]&&!s(p,R,T)&&(w[T]=R,w[R]=x[R]=x[T],q=E[T])}}})}),{root:x,align:w}}function c(y,b,p,_,x){var w={},E=f(y,b,p,x),I=x?"borderLeft":"borderRight";function q(N,L){for(var S=E.nodes(),T=S.pop(),M={};T;)M[T]?N(T):(M[T]=!0,S.push(T),S=S.concat(L(T))),T=S.pop()}function R(N){w[N]=E.inEdges(N).reduce(function(L,S){return Math.max(L,w[S.v]+E.edge(S))},0)}function C(N){var L=E.outEdges(N).reduce(function(T,M){return Math.min(T,w[M.w]-E.edge(M))},Number.POSITIVE_INFINITY),S=y.node(N);L!==Number.POSITIVE_INFINITY&&S.borderType!==I&&(w[N]=Math.max(w[N],L))}return q(R,E.predecessors.bind(E)),q(C,E.successors.bind(E)),e.forEach(_,function(N){w[N]=w[p[N]]}),w}function f(y,b,p,_){var x=new t,w=y.graph(),E=m(w.nodesep,w.edgesep,_);return e.forEach(b,function(I){var q;e.forEach(I,function(R){var C=p[R];if(x.setNode(C),q){var N=p[q],L=x.edge(N,C);x.setEdge(N,C,Math.max(E(y,R,q),L||0))}q=R})}),x}function l(y,b){return e.minBy(e.values(b),function(p){var _=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;return e.forIn(p,function(w,E){var I=v(y,E)/2;_=Math.max(w+I,_),x=Math.min(w-I,x)}),_-x})}function d(y,b){var p=e.values(b),_=e.min(p),x=e.max(p);e.forEach(["u","d"],function(w){e.forEach(["l","r"],function(E){var I=w+E,q=y[I],R;if(q!==b){var C=e.values(q);R=E==="l"?_-e.min(C):x-e.max(C),R&&(y[I]=e.mapValues(q,function(N){return N+R}))}})})}function h(y,b){return e.mapValues(y.ul,function(p,_){if(b)return y[b.toLowerCase()][_];var x=e.sortBy(e.map(y,_));return(x[1]+x[2])/2})}function g(y){var b=r.buildLayerMatrix(y),p=e.merge(n(y,b),i(y,b)),_={},x;e.forEach(["u","d"],function(E){x=E==="u"?b:e.values(b).reverse(),e.forEach(["l","r"],function(I){I==="r"&&(x=e.map(x,function(N){return e.values(N).reverse()}));var q=(E==="u"?y.predecessors:y.successors).bind(y),R=u(y,x,p,q),C=c(y,x,R.root,R.align,I==="r");I==="r"&&(C=e.mapValues(C,function(N){return-N})),_[E+I]=C})});var w=l(y,_);return d(_,w),h(_,y.graph().align)}function m(y,b,p){return function(_,x,w){var E=_.node(x),I=_.node(w),q=0,R;if(q+=E.width/2,e.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":R=-E.width/2;break;case"r":R=E.width/2;break}if(R&&(q+=p?R:-R),R=0,q+=(E.dummy?b:y)/2,q+=(I.dummy?b:y)/2,q+=I.width/2,e.has(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":R=I.width/2;break;case"r":R=-I.width/2;break}return R&&(q+=p?R:-R),R=0,q}}function v(y,b){return y.node(b).width}return Ou}var Du,vv;function jN(){if(vv)return Du;vv=1;var e=oe(),t=pe(),r=DN().positionX;Du=n;function n(a){a=t.asNonCompoundGraph(a),i(a),e.forEach(r(a),function(o,s){a.node(s).x=o})}function i(a){var o=t.buildLayerMatrix(a),s=a.graph().ranksep,u=0;e.forEach(o,function(c){var f=e.max(e.map(c,function(l){return a.node(l).height}));e.forEach(c,function(l){a.node(l).y=u+f/2}),u+=f+s})}return Du}var ju,yv;function FN(){if(yv)return ju;yv=1;var e=oe(),t=bN(),r=xN(),n=EN(),i=pe().normalizeRanks,a=SN(),o=pe().removeEmptyRanks,s=CN(),u=qN(),c=IN(),f=ON(),l=jN(),d=pe(),h=Ee().Graph;ju=g;function g(A,D){var $=D&&D.debugTiming?d.time:d.notime;$("layout",function(){var z=$(" buildLayoutGraph",function(){return q(A)});$(" runLayout",function(){m(z,$)}),$(" updateInputGraph",function(){v(A,z)})})}function m(A,D){D(" makeSpaceForEdgeLabels",function(){R(A)}),D(" removeSelfEdges",function(){k(A)}),D(" acyclic",function(){t.run(A)}),D(" nestingGraph.run",function(){s.run(A)}),D(" rank",function(){n(d.asNonCompoundGraph(A))}),D(" injectEdgeLabelProxies",function(){C(A)}),D(" removeEmptyRanks",function(){o(A)}),D(" nestingGraph.cleanup",function(){s.cleanup(A)}),D(" normalizeRanks",function(){i(A)}),D(" assignRankMinMax",function(){N(A)}),D(" removeEdgeLabelProxies",function(){L(A)}),D(" normalize.run",function(){r.run(A)}),D(" parentDummyChains",function(){a(A)}),D(" addBorderSegments",function(){u(A)}),D(" order",function(){f(A)}),D(" insertSelfEdges",function(){H(A)}),D(" adjustCoordinateSystem",function(){c.adjust(A)}),D(" position",function(){l(A)}),D(" positionSelfEdges",function(){G(A)}),D(" removeBorderNodes",function(){O(A)}),D(" normalize.undo",function(){r.undo(A)}),D(" fixupEdgeLabelCoords",function(){M(A)}),D(" undoCoordinateSystem",function(){c.undo(A)}),D(" translateGraph",function(){S(A)}),D(" assignNodeIntersects",function(){T(A)}),D(" reversePoints",function(){j(A)}),D(" acyclic.undo",function(){t.undo(A)})}function v(A,D){e.forEach(A.nodes(),function($){var z=A.node($),B=D.node($);z&&(z.x=B.x,z.y=B.y,D.children($).length&&(z.width=B.width,z.height=B.height))}),e.forEach(A.edges(),function($){var z=A.edge($),B=D.edge($);z.points=B.points,e.has(B,"x")&&(z.x=B.x,z.y=B.y)}),A.graph().width=D.graph().width,A.graph().height=D.graph().height}var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},p=["acyclicer","ranker","rankdir","align"],_=["width","height"],x={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},I=["labelpos"];function q(A){var D=new h({multigraph:!0,compound:!0}),$=Y(A.graph());return D.setGraph(e.merge({},b,V($,y),e.pick($,p))),e.forEach(A.nodes(),function(z){var B=Y(A.node(z));D.setNode(z,e.defaults(V(B,_),x)),D.setParent(z,A.parent(z))}),e.forEach(A.edges(),function(z){var B=Y(A.edge(z));D.setEdge(z,e.merge({},E,V(B,w),e.pick(B,I)))}),D}function R(A){var D=A.graph();D.ranksep/=2,e.forEach(A.edges(),function($){var z=A.edge($);z.minlen*=2,z.labelpos.toLowerCase()!=="c"&&(D.rankdir==="TB"||D.rankdir==="BT"?z.width+=z.labeloffset:z.height+=z.labeloffset)})}function C(A){e.forEach(A.edges(),function(D){var $=A.edge(D);if($.width&&$.height){var z=A.node(D.v),B=A.node(D.w),U={rank:(B.rank-z.rank)/2+z.rank,e:D};d.addDummyNode(A,"edge-proxy",U,"_ep")}})}function N(A){var D=0;e.forEach(A.nodes(),function($){var z=A.node($);z.borderTop&&(z.minRank=A.node(z.borderTop).rank,z.maxRank=A.node(z.borderBottom).rank,D=e.max(D,z.maxRank))}),A.graph().maxRank=D}function L(A){e.forEach(A.nodes(),function(D){var $=A.node(D);$.dummy==="edge-proxy"&&(A.edge($.e).labelRank=$.rank,A.removeNode(D))})}function S(A){var D=Number.POSITIVE_INFINITY,$=0,z=Number.POSITIVE_INFINITY,B=0,U=A.graph(),X=U.marginx||0,K=U.marginy||0;function J(W){var te=W.x,Z=W.y,re=W.width,ee=W.height;D=Math.min(D,te-re/2),$=Math.max($,te+re/2),z=Math.min(z,Z-ee/2),B=Math.max(B,Z+ee/2)}e.forEach(A.nodes(),function(W){J(A.node(W))}),e.forEach(A.edges(),function(W){var te=A.edge(W);e.has(te,"x")&&J(te)}),D-=X,z-=K,e.forEach(A.nodes(),function(W){var te=A.node(W);te.x-=D,te.y-=z}),e.forEach(A.edges(),function(W){var te=A.edge(W);e.forEach(te.points,function(Z){Z.x-=D,Z.y-=z}),e.has(te,"x")&&(te.x-=D),e.has(te,"y")&&(te.y-=z)}),U.width=$-D+X,U.height=B-z+K}function T(A){e.forEach(A.edges(),function(D){var $=A.edge(D),z=A.node(D.v),B=A.node(D.w),U,X;$.points?(U=$.points[0],X=$.points[$.points.length-1]):($.points=[],U=B,X=z),$.points.unshift(d.intersectRect(z,U)),$.points.push(d.intersectRect(B,X))})}function M(A){e.forEach(A.edges(),function(D){var $=A.edge(D);if(e.has($,"x"))switch(($.labelpos==="l"||$.labelpos==="r")&&($.width-=$.labeloffset),$.labelpos){case"l":$.x-=$.width/2+$.labeloffset;break;case"r":$.x+=$.width/2+$.labeloffset;break}})}function j(A){e.forEach(A.edges(),function(D){var $=A.edge(D);$.reversed&&$.points.reverse()})}function O(A){e.forEach(A.nodes(),function(D){if(A.children(D).length){var $=A.node(D),z=A.node($.borderTop),B=A.node($.borderBottom),U=A.node(e.last($.borderLeft)),X=A.node(e.last($.borderRight));$.width=Math.abs(X.x-U.x),$.height=Math.abs(B.y-z.y),$.x=U.x+$.width/2,$.y=z.y+$.height/2}}),e.forEach(A.nodes(),function(D){A.node(D).dummy==="border"&&A.removeNode(D)})}function k(A){e.forEach(A.edges(),function(D){if(D.v===D.w){var $=A.node(D.v);$.selfEdges||($.selfEdges=[]),$.selfEdges.push({e:D,label:A.edge(D)}),A.removeEdge(D)}})}function H(A){var D=d.buildLayerMatrix(A);e.forEach(D,function($){var z=0;e.forEach($,function(B,U){var X=A.node(B);X.order=U+z,e.forEach(X.selfEdges,function(K){d.addDummyNode(A,"selfedge",{width:K.label.width,height:K.label.height,rank:X.rank,order:U+ ++z,e:K.e,label:K.label},"_se")}),delete X.selfEdges})})}function G(A){e.forEach(A.nodes(),function(D){var $=A.node(D);if($.dummy==="selfedge"){var z=A.node($.e.v),B=z.x+z.width/2,U=z.y,X=$.x-B,K=z.height/2;A.setEdge($.e,$.label),A.removeNode(D),$.label.points=[{x:B+2*X/3,y:U-K},{x:B+5*X/6,y:U-K},{x:B+X,y:U},{x:B+5*X/6,y:U+K},{x:B+2*X/3,y:U+K}],$.label.x=$.x,$.label.y=$.y}})}function V(A,D){return e.mapValues(e.pick(A,D),Number)}function Y(A){var D={};return e.forEach(A,function($,z){D[z.toLowerCase()]=$}),D}return ju}var Fu,mv;function $N(){if(mv)return Fu;mv=1;var e=oe(),t=pe(),r=Ee().Graph;Fu={debugOrdering:n};function n(i){var a=t.buildLayerMatrix(i),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(i.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+i.node(s).rank)}),e.forEach(i.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),e.forEach(a,function(s,u){var c="layer"+u;o.setNode(c,{rank:"same"}),e.reduce(s,function(f,l){return o.setEdge(f,l,{style:"invis"}),l})}),o}return Fu}var $u,_v;function zN(){return _v||(_v=1,$u="0.8.5"),$u}var zu,bv;function BN(){return bv||(bv=1,zu={graphlib:Ee(),layout:FN(),debug:$N(),util:{time:pe().time,notime:pe().notime},version:zN()}),zu}var HN=BN();const xv=Sv(HN);function l0(e,t,r={direction:"LR",nodeSpacing:50,rankSpacing:150}){const n=new xv.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:r.direction,nodesep:r.nodeSpacing,ranksep:r.rankSpacing});const i=150,a=36;return e.forEach(s=>{n.setNode(s.id,{width:i,height:a})}),t.forEach(s=>{n.setEdge(s.source,s.target)}),xv.layout(n),{nodes:e.map(s=>{const u=n.node(s.id);return{...s,targetPosition:r.direction==="LR"?Q.Left:Q.Top,sourcePosition:r.direction==="LR"?Q.Right:Q.Bottom,position:{x:u.x-i/2,y:u.y-a/2}}}),edges:t}}function Bu(e,t){const r=[],n=[];for(const[i,a]of e.nodes){const o=t===i,s=t?a.dependencies.some(u=>e.nodes.has(u)&&u===t)||a.dependents.includes(t):!1;r.push({id:i,data:{label:a.name,fullPath:a.path,dependencies:a.dependencies.length,dependents:a.dependents.length},position:{x:0,y:0},style:{opacity:t&&!o&&!s?.3:1}})}for(const i of e.edges){const a=t?i.source===t||i.target===t:!0;n.push({id:`${i.source}-${i.target}`,source:i.source,target:i.target,markerEnd:{type:Bt.ArrowClosed,width:15,height:15},style:{opacity:t&&!a?.2:1,strokeWidth:a&&t?2:1.5},animated:a&&!!t})}return l0(r,n)}function VN(){const[e,t]=F.useState(null),[r,n,i]=HS([]),[a,o,s]=VS([]),[u,c]=F.useState(!1),[f,l]=F.useState(null),[d,h]=F.useState(""),[g,m]=F.useState(null),[v,y]=F.useState("LR"),b=F.useCallback(async()=>{c(!0),l(null),m(null);try{const R=await CC(async L=>gitton.fs.readFile(L),async L=>gitton.fs.readdir(L),"",["src"],["node_modules","dist","build",".git","__tests__","*.test.*","*.spec.*"]);t(R);const{nodes:C,edges:N}=Bu(R,null);n(C),o(N),R.nodes.size===0&&l("No analyzable files found in src/ directory")}catch(R){l(R instanceof Error?R.message:"Failed to analyze dependencies"),gitton.ui.showNotification("Failed to analyze dependencies","error")}finally{c(!1)}},[n,o]);F.useEffect(()=>{b()},[b]);const p=F.useMemo(()=>!d||!e?r:r.filter(R=>R.data.fullPath.toLowerCase().includes(d.toLowerCase())||R.data.label.toLowerCase().includes(d.toLowerCase())),[r,d,e]),_=F.useMemo(()=>{if(!d)return a;const R=new Set(p.map(C=>C.id));return a.filter(C=>R.has(C.source)&&R.has(C.target))},[a,p,d]),x=F.useCallback((R,C)=>{const N=g===C.id?null:C.id;if(m(N),e){const{nodes:L,edges:S}=Bu(e,N);n(L),o(S)}},[g,e,n,o]),w=F.useCallback(()=>{if(g&&e){m(null);const{nodes:R,edges:C}=Bu(e,null);n(R),o(C)}},[g,e,n,o]),E=F.useCallback(()=>{const R=v==="LR"?"TB":"LR";if(y(R),e){const{nodes:C,edges:N}=l0(r.map(L=>({...L,position:{x:0,y:0}})),a,{direction:R,nodeSpacing:50,rankSpacing:150});n(C),o(N)}},[v,e,r,a,n,o]),I=F.useMemo(()=>e?{files:e.nodes.size,connections:e.edges.length}:null,[e]),q=F.useMemo(()=>{if(!g||!e)return null;const R=e.nodes.get(g);return R?{path:R.path,dependencies:R.dependencies.filter(C=>{for(const N of["",".ts",".tsx",".js",".jsx","/index.ts","/index.tsx","/index.js","/index.jsx"])if(e.nodes.has(C+N))return!0;return!1}).length,dependents:R.dependents.length}:null},[g,e]);return P.jsxs("div",{className:"flex flex-col h-full",children:[P.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-border",children:[P.jsxs("div",{className:"flex-1 relative",children:[P.jsx(IC,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),P.jsx("input",{type:"text",placeholder:"Search files...",value:d,onChange:R=>h(R.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm bg-muted border border-border rounded-md focus:outline-none focus:ring-1 focus:ring-primary"})]}),P.jsx("button",{onClick:E,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground",title:`Switch to ${v==="LR"?"vertical":"horizontal"} layout`,children:P.jsx(qC,{className:"w-4 h-4"})}),P.jsx("button",{onClick:b,disabled:u,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground disabled:opacity-50",title:"Refresh",children:P.jsx(el,{className:`w-4 h-4 ${u?"animate-spin":""}`})})]}),I&&P.jsxs("div",{className:"flex items-center gap-4 px-3 py-2 text-xs text-muted-foreground border-b border-border",children:[P.jsxs("span",{children:[I.files," files"]}),P.jsxs("span",{children:[I.connections," connections"]}),q&&P.jsxs(P.Fragment,{children:[P.jsxs("span",{className:"ml-auto",children:["→ ",q.dependencies," deps"]}),P.jsxs("span",{children:["← ",q.dependents," refs"]})]})]}),q&&P.jsx("div",{className:"px-3 py-2 text-xs bg-primary/10 border-b border-border",children:P.jsx("div",{className:"font-mono truncate",title:q.path,children:q.path})}),P.jsxs("div",{className:"flex-1 relative",children:[u&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:P.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[P.jsx(el,{className:"w-4 h-4 animate-spin"}),"Analyzing dependencies..."]})}),f&&!u&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:P.jsxs("div",{className:"text-center p-4",children:[P.jsx("p",{className:"text-sm text-muted-foreground",children:f}),P.jsx("button",{onClick:b,className:"mt-2 px-3 py-1 text-xs bg-primary text-primary-foreground rounded-md hover:opacity-90",children:"Retry"})]})}),!f&&!u&&e&&e.nodes.size>0&&P.jsxs(BS,{nodes:d?p:r,edges:d?_:a,onNodesChange:i,onEdgesChange:s,onNodeClick:x,onPaneClick:w,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[P.jsx(rC,{showInteractive:!1}),P.jsx(XS,{variant:Fe.Dots,gap:16,size:1})]})]})]})}function wv(){l_.createRoot(document.getElementById("root")).render(P.jsx(Cv.StrictMode,{children:P.jsx(VN,{})}))}window.gitton?wv():window.addEventListener("gitton:ready",wv);
|