var zl=Object.defineProperty,Vl=Object.defineProperties;var Kl=Object.getOwnPropertyDescriptors;var fs=Object.getOwnPropertySymbols;var Hl=Object.prototype.hasOwnProperty,$l=Object.prototype.propertyIsEnumerable;var cs=(e,t,r)=>t in e?zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,br=(e,t)=>{for(var r in t||(t={}))Hl.call(t,r)&&cs(e,r,t[r]);if(fs)for(var r of fs(t))$l.call(t,r)&&cs(e,r,t[r]);return e},yr=(e,t)=>Vl(e,Kl(t));var ie=(e,t,r)=>new Promise((a,n)=>{var i=o=>{try{u(r.next(o))}catch(f){n(f)}},s=o=>{try{u(r.throw(o))}catch(f){n(f)}},u=o=>o.done?a(o.value):Promise.resolve(o.value).then(i,s);u((r=r.apply(e,t)).next())});import{_ as Me}from"./icon.vue_vue_type_script_setup_true_lang-A1WxWGAl.js";import{c as $e,S as Wl,a as Ie,N as Du,Q as ds,d as Fh,p as Yl,k as Fe,e as _e,O as mr,g as de,s as Xl,b as hs,i as ls,u as Y,L as jh,f as ne,w as We,x as vs,_ as Zl}from"./index-DMqaFtX4.js";import{c as Bu}from"./_commonjs-dynamic-modules-TDtrdbi3.js";import{u as Ze,P as Ye,_ as Jl,a as Ql}from"./vue-flow-core-CpTXh2CK.js";import ev from"./processNode-fXOuXilZ.js";import rv from"./animationEdge-BKzo8IOZ.js";var qr,ps;function nv(){if(ps)return qr;ps=1;function e(){this.__data__=[],this.size=0}return qr=e,qr}var wr,_s;function Ce(){if(_s)return wr;_s=1;function e(t,r){return t===r||t!==t&&r!==r}return wr=e,wr}var Rr,gs;function Je(){if(gs)return Rr;gs=1;var e=Ce();function t(r,a){for(var n=r.length;n--;)if(e(r[n][0],a))return n;return-1}return Rr=t,Rr}var Er,bs;function tv(){if(bs)return Er;bs=1;var e=Je(),t=Array.prototype,r=t.splice;function a(n){var i=this.__data__,s=e(i,n);if(s<0)return!1;var u=i.length-1;return s==u?i.pop():r.call(i,s,1),--this.size,!0}return Er=a,Er}var Ir,ys;function av(){if(ys)return Ir;ys=1;var e=Je();function t(r){var a=this.__data__,n=e(a,r);return n<0?void 0:a[n][1]}return Ir=t,Ir}var Cr,ms;function iv(){if(ms)return Cr;ms=1;var e=Je();function t(r){return e(this.__data__,r)>-1}return Cr=t,Cr}var Ar,qs;function uv(){if(qs)return Ar;qs=1;var e=Je();function t(r,a){var n=this.__data__,i=e(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return Ar=t,Ar}var Sr,ws;function Qe(){if(ws)return Sr;ws=1;var e=nv(),t=tv(),r=av(),a=iv(),n=uv();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u-1&&a%1==0&&a-1&&r%1==0&&r<=e}return En=t,En}var In,mo;function Mv(){if(mo)return In;mo=1;var e=ge(),t=Ku(),r=ae(),a="[object Arguments]",n="[object Array]",i="[object Boolean]",s="[object Date]",u="[object Error]",o="[object Function]",f="[object Map]",c="[object Number]",d="[object Object]",h="[object RegExp]",l="[object Set]",y="[object String]",p="[object WeakMap]",v="[object ArrayBuffer]",_="[object DataView]",g="[object Float32Array]",b="[object Float64Array]",m="[object Int8Array]",q="[object Int16Array]",w="[object Int32Array]",R="[object Uint8Array]",S="[object Uint8ClampedArray]",C="[object Uint16Array]",A="[object Uint32Array]",O={};O[g]=O[b]=O[m]=O[q]=O[w]=O[R]=O[S]=O[C]=O[A]=!0,O[a]=O[n]=O[v]=O[i]=O[_]=O[s]=O[u]=O[o]=O[f]=O[c]=O[d]=O[h]=O[l]=O[y]=O[p]=!1;function P(M){return r(M)&&t(M.length)&&!!O[e(M)]}return In=P,In}var Cn,qo;function ur(){if(qo)return Cn;qo=1;function e(t){return function(r){return t(r)}}return Cn=e,Cn}var ke={exports:{}};ke.exports;var wo;function Hu(){return wo||(wo=1,function(e,t){var r=Gh(),a=t&&!t.nodeType&&t,n=a&&!0&&e&&!e.nodeType&&e,i=n&&n.exports===a,s=i&&r.process,u=function(){try{var o=n&&n.require&&n.require("util").types;return o||s&&s.binding&&s.binding("util")}catch(f){}}();e.exports=u}(ke,ke.exports)),ke.exports}var An,Ro;function Be(){if(Ro)return An;Ro=1;var e=Mv(),t=ur(),r=Hu(),a=r&&r.isTypedArray,n=a?t(a):e;return An=n,An}var Sn,Eo;function Uh(){if(Eo)return Sn;Eo=1;var e=Ov(),t=De(),r=U(),a=Se(),n=ir(),i=Be(),s=Object.prototype,u=s.hasOwnProperty;function o(f,c){var d=r(f),h=!d&&t(f),l=!d&&!h&&a(f),y=!d&&!h&&!l&&i(f),p=d||h||l||y,v=p?e(f.length,String):[],_=v.length;for(var g in f)(c||u.call(f,g))&&!(p&&(g=="length"||l&&(g=="offset"||g=="parent")||y&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||n(g,_)))&&v.push(g);return v}return Sn=o,Sn}var Tn,Io;function sr(){if(Io)return Tn;Io=1;var e=Object.prototype;function t(r){var a=r&&r.constructor,n=typeof a=="function"&&a.prototype||e;return r===n}return Tn=t,Tn}var On,Co;function zh(){if(Co)return On;Co=1;function e(t,r){return function(a){return t(r(a))}}return On=e,On}var xn,Ao;function Lv(){if(Ao)return xn;Ao=1;var e=zh(),t=e(Object.keys,Object);return xn=t,xn}var Pn,So;function $u(){if(So)return Pn;So=1;var e=sr(),t=Lv(),r=Object.prototype,a=r.hasOwnProperty;function n(i){if(!e(i))return t(i);var s=[];for(var u in Object(i))a.call(i,u)&&u!="constructor"&&s.push(u);return s}return Pn=n,Pn}var Mn,To;function se(){if(To)return Mn;To=1;var e=je(),t=Ku();function r(a){return a!=null&&t(a.length)&&!e(a)}return Mn=r,Mn}var Ln,Oo;function he(){if(Oo)return Ln;Oo=1;var e=Uh(),t=$u(),r=se();function a(n){return r(n)?e(n):t(n)}return Ln=a,Ln}var kn,xo;function kv(){if(xo)return kn;xo=1;var e=Ge(),t=he();function r(a,n){return a&&e(n,t(n),a)}return kn=r,kn}var Nn,Po;function Nv(){if(Po)return Nn;Po=1;function e(t){var r=[];if(t!=null)for(var a in Object(t))r.push(a);return r}return Nn=e,Nn}var Fn,Mo;function Fv(){if(Mo)return Fn;Mo=1;var e=X(),t=sr(),r=Nv(),a=Object.prototype,n=a.hasOwnProperty;function i(s){if(!e(s))return r(s);var u=t(s),o=[];for(var f in s)f=="constructor"&&(u||!n.call(s,f))||o.push(f);return o}return Fn=i,Fn}var jn,Lo;function ye(){if(Lo)return jn;Lo=1;var e=Uh(),t=Fv(),r=se();function a(n){return r(n)?e(n,!0):t(n)}return jn=a,jn}var Gn,ko;function jv(){if(ko)return Gn;ko=1;var e=Ge(),t=ye();function r(a,n){return a&&e(n,t(n),a)}return Gn=r,Gn}var Ne={exports:{}};Ne.exports;var No;function Vh(){return No||(No=1,function(e,t){var r=re(),a=t&&!t.nodeType&&t,n=a&&!0&&e&&!e.nodeType&&e,i=n&&n.exports===a,s=i?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function o(f,c){if(c)return f.slice();var d=f.length,h=u?u(d):new f.constructor(d);return f.copy(h),h}e.exports=o}(Ne,Ne.exports)),Ne.exports}var Dn,Fo;function Kh(){if(Fo)return Dn;Fo=1;function e(t,r){var a=-1,n=t.length;for(r||(r=Array(n));++al))return!1;var p=d.get(s),v=d.get(u);if(p&&v)return p==u&&v==s;var _=-1,g=!0,b=o&n?new e:void 0;for(d.set(s,u),d.set(u,s);++_0&&i(c)?n>1?r(c,n-1,i,s,u):e(u,c):s||(u[u.length]=c)}return u}return xa=r,xa}var Pa,Oc;function kp(){if(Oc)return Pa;Oc=1;function e(t,r,a){switch(a.length){case 0:return t.call(r);case 1:return t.call(r,a[0]);case 2:return t.call(r,a[0],a[1]);case 3:return t.call(r,a[0],a[1],a[2])}return t.apply(r,a)}return Pa=e,Pa}var Ma,xc;function wl(){if(xc)return Ma;xc=1;var e=kp(),t=Math.max;function r(a,n,i){return n=t(n===void 0?a.length-1:n,0),function(){for(var s=arguments,u=-1,o=t(s.length-n,0),f=Array(o);++u0){if(++i>=e)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}return ka=a,ka}var Na,Lc;function Rl(){if(Lc)return Na;Lc=1;var e=Np(),t=Fp(),r=t(e);return Na=r,Na}var Fa,kc;function lr(){if(kc)return Fa;kc=1;var e=me(),t=wl(),r=Rl();function a(n,i){return r(t(n,i,e),n+"")}return Fa=a,Fa}var ja,Nc;function El(){if(Nc)return ja;Nc=1;function e(t,r,a,n){for(var i=t.length,s=a+(n?1:-1);n?s--:++s-1}return Ua=t,Ua}var za,Bc;function Up(){if(Bc)return za;Bc=1;function e(t,r,a){for(var n=-1,i=t==null?0:t.length;++n=s){var _=f?null:n(o);if(_)return i(_);y=!1,h=a,v=new e}else v=f?[]:p;e:for(;++d1?l.setNode(y,d):l.setNode(y)}),this},n.prototype.setNode=function(c,d){return e.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=r,this._children[c]={},this._children[r][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},n.prototype.node=function(c){return this._nodes[c]},n.prototype.hasNode=function(c){return e.has(this._nodes,c)},n.prototype.removeNode=function(c){var d=this;if(e.has(this._nodes,c)){var h=function(l){d.removeEdge(d._edgeObjs[l])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],e.each(this.children(c),function(l){d.setParent(l)}),delete this._children[c]),e.each(e.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],e.each(e.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},n.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=r;else{d+="";for(var h=d;!e.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},n.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},n.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==r)return d}},n.prototype.children=function(c){if(e.isUndefined(c)&&(c=r),this._isCompound){var d=this._children[c];if(d)return e.keys(d)}else{if(c===r)return this.nodes();if(this.hasNode(c))return[]}},n.prototype.predecessors=function(c){var d=this._preds[c];if(d)return e.keys(d)},n.prototype.successors=function(c){var d=this._sucs[c];if(d)return e.keys(d)},n.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return e.union(d,this.successors(c))},n.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},n.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;e.each(this._nodes,function(p,v){c(v)&&d.setNode(v,p)}),e.each(this._edgeObjs,function(p){d.hasNode(p.v)&&d.hasNode(p.w)&&d.setEdge(p,h.edge(p))});var l={};function y(p){var v=h.parent(p);return v===void 0||d.hasNode(v)?(l[p]=v,v):v in l?l[v]:y(v)}return this._isCompound&&e.each(d.nodes(),function(p){d.setParent(p,y(p))}),d},n.prototype.setDefaultEdgeLabel=function(c){return e.isFunction(c)||(c=e.constant(c)),this._defaultEdgeLabelFn=c,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return e.values(this._edgeObjs)},n.prototype.setPath=function(c,d){var h=this,l=arguments;return e.reduce(c,function(y,p){return l.length>1?h.setEdge(y,p,d):h.setEdge(y,p),p}),this},n.prototype.setEdge=function(){var c,d,h,l,y=!1,p=arguments[0];typeof p=="object"&&p!==null&&"v"in p?(c=p.v,d=p.w,h=p.name,arguments.length===2&&(l=arguments[1],y=!0)):(c=p,d=arguments[1],h=arguments[3],arguments.length>2&&(l=arguments[2],y=!0)),c=""+c,d=""+d,e.isUndefined(h)||(h=""+h);var v=u(this._isDirected,c,d,h);if(e.has(this._edgeLabels,v))return y&&(this._edgeLabels[v]=l),this;if(!e.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[v]=y?l:this._defaultEdgeLabelFn(c,d,h);var _=o(this._isDirected,c,d,h);return c=_.v,d=_.w,Object.freeze(_),this._edgeObjs[v]=_,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][v]=_,this._out[c][v]=_,this._edgeCount++,this},n.prototype.edge=function(c,d,h){var l=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,c,d,h);return this._edgeLabels[l]},n.prototype.hasEdge=function(c,d,h){var l=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,c,d,h);return e.has(this._edgeLabels,l)},n.prototype.removeEdge=function(c,d,h){var l=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,c,d,h),y=this._edgeObjs[l];return y&&(c=y.v,d=y.w,delete this._edgeLabels[l],delete this._edgeObjs[l],s(this._preds[d],c),s(this._sucs[c],d),delete this._in[d][l],delete this._out[c][l],this._edgeCount--),this},n.prototype.inEdges=function(c,d){var h=this._in[c];if(h){var l=e.values(h);return d?e.filter(l,function(y){return y.v===d}):l}},n.prototype.outEdges=function(c,d){var h=this._out[c];if(h){var l=e.values(h);return d?e.filter(l,function(y){return y.w===d}):l}},n.prototype.nodeEdges=function(c,d){var h=this.inEdges(c,d);if(h)return h.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function s(c,d){--c[d]||delete c[d]}function u(c,d,h,l){var y=""+d,p=""+h;if(!c&&y>p){var v=y;y=p,p=v}return y+a+p+a+(e.isUndefined(l)?t:l)}function o(c,d,h,l){var y=""+d,p=""+h;if(!c&&y>p){var v=y;y=p,p=v}var _={v:y,w:p};return l&&(_.name=l),_}function f(c,d){return u(c,d.v,d.w,d.name)}return Ja}var Qa,Zc;function Wp(){return Zc||(Zc=1,Qa="2.1.8"),Qa}var ei,Jc;function Yp(){return Jc||(Jc=1,ei={Graph:ts(),version:Wp()}),ei}var ri,Qc;function Xp(){if(Qc)return ri;Qc=1;var e=Z(),t=ts();ri={write:r,read:i};function r(s){var u={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:a(s),edges:n(s)};return e.isUndefined(s.graph())||(u.value=e.clone(s.graph())),u}function a(s){return e.map(s.nodes(),function(u){var o=s.node(u),f=s.parent(u),c={v:u};return e.isUndefined(o)||(c.value=o),e.isUndefined(f)||(c.parent=f),c})}function n(s){return e.map(s.edges(),function(u){var o=s.edge(u),f={v:u.v,w:u.w};return e.isUndefined(u.name)||(f.name=u.name),e.isUndefined(o)||(f.value=o),f})}function i(s){var u=new t(s.options).setGraph(s.value);return e.each(s.nodes,function(o){u.setNode(o.v,o.value),o.parent&&u.setParent(o.v,o.parent)}),e.each(s.edges,function(o){u.setEdge({v:o.v,w:o.w,name:o.name},o.value)}),u}return ri}var ni,ed;function Zp(){if(ed)return ni;ed=1;var e=Z();ni=t;function t(r){var a={},n=[],i;function s(u){e.has(a,u)||(a[u]=!0,i.push(u),e.each(r.successors(u),s),e.each(r.predecessors(u),s))}return e.each(r.nodes(),function(u){i=[],s(u),i.length&&n.push(i)}),n}return ni}var ti,rd;function Al(){if(rd)return ti;rd=1;var e=Z();ti=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 a=this._keyIndices[r];if(a!==void 0)return this._arr[a].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,a){var n=this._keyIndices;if(r=String(r),!e.has(n,r)){var i=this._arr,s=i.length;return n[r]=s,i.push({key:r,priority:a}),this._decrease(s),!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,a){var n=this._keyIndices[r];if(a>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[n].priority+" New: "+a);this._arr[n].priority=a,this._decrease(n)},t.prototype._heapify=function(r){var a=this._arr,n=2*r,i=n+1,s=r;n>1,!(a[i].priority0&&(d=c.removeMin(),h=f[d],h.distance!==Number.POSITIVE_INFINITY);)o(d).forEach(l);return f}return ai}var ii,td;function Jp(){if(td)return ii;td=1;var e=Sl(),t=Z();ii=r;function r(a,n,i){return t.transform(a.nodes(),function(s,u){s[u]=e(a,u,n,i)},{})}return ii}var ui,ad;function Tl(){if(ad)return ui;ad=1;var e=Z();ui=t;function t(r){var a=0,n=[],i={},s=[];function u(o){var f=i[o]={onStack:!0,lowlink:a,index:a++};if(n.push(o),r.successors(o).forEach(function(h){e.has(i,h)?i[h].onStack&&(f.lowlink=Math.min(f.lowlink,i[h].index)):(u(h),f.lowlink=Math.min(f.lowlink,i[h].lowlink))}),f.lowlink===f.index){var c=[],d;do d=n.pop(),i[d].onStack=!1,c.push(d);while(o!==d);s.push(c)}}return r.nodes().forEach(function(o){e.has(i,o)||u(o)}),s}return ui}var si,id;function Qp(){if(id)return si;id=1;var e=Z(),t=Tl();si=r;function r(a){return e.filter(t(a),function(n){return n.length>1||n.length===1&&a.hasEdge(n[0],n[0])})}return si}var oi,ud;function e_(){if(ud)return oi;ud=1;var e=Z();oi=r;var t=e.constant(1);function r(n,i,s){return a(n,i||t,s||function(u){return n.outEdges(u)})}function a(n,i,s){var u={},o=n.nodes();return o.forEach(function(f){u[f]={},u[f][f]={distance:0},o.forEach(function(c){f!==c&&(u[f][c]={distance:Number.POSITIVE_INFINITY})}),s(f).forEach(function(c){var d=c.v===f?c.w:c.v,h=i(c);u[f][d]={distance:h,predecessor:f}})}),o.forEach(function(f){var c=u[f];o.forEach(function(d){var h=u[d];o.forEach(function(l){var y=h[f],p=c[l],v=h[l],_=y.distance+p.distance;_0;){if(f=o.removeMin(),e.has(u,f))s.setEdge(f,u[f]);else{if(d)throw new Error("Input graph is not connected: "+n);d=!0}n.nodeEdges(f).forEach(c)}return s}return vi}var pi,ld;function i_(){return ld||(ld=1,pi={components:Zp(),dijkstra:Sl(),dijkstraAll:Jp(),findCycles:Qp(),floydWarshall:e_(),isAcyclic:r_(),postorder:n_(),preorder:t_(),prim:a_(),tarjan:Tl(),topsort:Ol()}),pi}var _i,vd;function u_(){if(vd)return _i;vd=1;var e=Yp();return _i={Graph:e.Graph,json:Xp(),alg:i_(),version:e.version},_i}var gi,pd;function ee(){if(pd)return gi;pd=1;var e;if(typeof Bu=="function")try{e=u_()}catch(t){}return e||(e=window.graphlib),gi=e,gi}var bi,_d;function s_(){if(_d)return bi;_d=1;var e=nl(),t=1,r=4;function a(n){return e(n,t|r)}return bi=a,bi}var yi,gd;function vr(){if(gd)return yi;gd=1;var e=Ce(),t=se(),r=ir(),a=X();function n(i,s,u){if(!a(u))return!1;var o=typeof s;return(o=="number"?t(u)&&r(s,u.length):o=="string"&&s in u)?e(u[s],i):!1}return yi=n,yi}var mi,bd;function o_(){if(bd)return mi;bd=1;var e=lr(),t=Ce(),r=vr(),a=ye(),n=Object.prototype,i=n.hasOwnProperty,s=e(function(u,o){u=Object(u);var f=-1,c=o.length,d=c>2?o[2]:void 0;for(d&&r(o[0],o[1],d)&&(c=1);++f-1?o[f?i[c]:c]:void 0}}return qi=a,qi}var wi,md;function c_(){if(md)return wi;md=1;var e=/\s/;function t(r){for(var a=r.length;a--&&e.test(r.charAt(a)););return a}return wi=t,wi}var Ri,qd;function d_(){if(qd)return Ri;qd=1;var e=c_(),t=/^\s+/;function r(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return Ri=r,Ri}var Ei,wd;function h_(){if(wd)return Ei;wd=1;var e=d_(),t=X(),r=Oe(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function o(f){if(typeof f=="number")return f;if(r(f))return a;if(t(f)){var c=typeof f.valueOf=="function"?f.valueOf():f;f=t(c)?c+"":c}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=i.test(f);return d||s.test(f)?u(f.slice(2),d?2:8):n.test(f)?a:+f}return Ei=o,Ei}var Ii,Rd;function Pl(){if(Rd)return Ii;Rd=1;var e=h_(),t=1/0,r=17976931348623157e292;function a(n){if(!n)return n===0?n:0;if(n=e(n),n===t||n===-1/0){var i=n<0?-1:1;return i*r}return n===n?n:0}return Ii=a,Ii}var Ci,Ed;function l_(){if(Ed)return Ci;Ed=1;var e=Pl();function t(r){var a=e(r),n=a%1;return a===a?n?a-n:a:0}return Ci=t,Ci}var Ai,Id;function v_(){if(Id)return Ai;Id=1;var e=El(),t=oe(),r=l_(),a=Math.max;function n(i,s,u){var o=i==null?0:i.length;if(!o)return-1;var f=u==null?0:r(u);return f<0&&(f=a(o+f,0)),e(i,t(s,3),f)}return Ai=n,Ai}var Si,Cd;function p_(){if(Cd)return Si;Cd=1;var e=f_(),t=v_(),r=e(t);return Si=r,Si}var Ti,Ad;function Ml(){if(Ad)return Ti;Ad=1;var e=ns();function t(r){var a=r==null?0:r.length;return a?e(r,1):[]}return Ti=t,Ti}var Oi,Sd;function __(){if(Sd)return Oi;Sd=1;var e=Ju(),t=tl(),r=ye();function a(n,i){return n==null?n:e(n,t(i),r)}return Oi=a,Oi}var xi,Td;function g_(){if(Td)return xi;Td=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return xi=e,xi}var Pi,Od;function b_(){if(Od)return Pi;Od=1;var e=tr(),t=Qu(),r=oe();function a(n,i){var s={};return i=r(i,3),t(n,function(u,o,f){e(s,o,i(u,o,f))}),s}return Pi=a,Pi}var Mi,xd;function as(){if(xd)return Mi;xd=1;var e=Oe();function t(r,a,n){for(var i=-1,s=r.length;++ir}return Li=e,Li}var ki,Md;function m_(){if(Md)return ki;Md=1;var e=as(),t=y_(),r=me();function a(n){return n&&n.length?e(n,r,t):void 0}return ki=a,ki}var Ni,Ld;function Ll(){if(Ld)return Ni;Ld=1;var e=tr(),t=Ce();function r(a,n,i){(i!==void 0&&!t(a[n],i)||i===void 0&&!(n in a))&&e(a,n,i)}return Ni=r,Ni}var Fi,kd;function q_(){if(kd)return Fi;kd=1;var e=ge(),t=or(),r=ae(),a="[object Object]",n=Function.prototype,i=Object.prototype,s=n.toString,u=i.hasOwnProperty,o=s.call(Object);function f(c){if(!r(c)||e(c)!=a)return!1;var d=t(c);if(d===null)return!0;var h=u.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==o}return Fi=f,Fi}var ji,Nd;function kl(){if(Nd)return ji;Nd=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return ji=e,ji}var Gi,Fd;function w_(){if(Fd)return Gi;Fd=1;var e=Ge(),t=ye();function r(a){return e(a,t(a))}return Gi=r,Gi}var Di,jd;function R_(){if(jd)return Di;jd=1;var e=Ll(),t=Vh(),r=Qh(),a=Kh(),n=rl(),i=De(),s=U(),u=Il(),o=Se(),f=je(),c=X(),d=q_(),h=Be(),l=kl(),y=w_();function p(v,_,g,b,m,q,w){var R=l(v,g),S=l(_,g),C=w.get(S);if(C){e(v,g,C);return}var A=q?q(R,S,g+"",v,_,w):void 0,O=A===void 0;if(O){var P=s(S),M=!P&&o(S),k=!P&&!M&&h(S);A=S,P||M||k?s(R)?A=R:u(R)?A=a(R):M?(O=!1,A=t(S,!0)):k?(O=!1,A=r(S,!0)):A=[]:d(S)||i(S)?(A=R,i(R)?A=y(R):(!c(R)||f(R))&&(A=n(S))):O=!1}O&&(w.set(S,A),m(A,S,b,q,w),w.delete(S)),e(v,g,A)}return Di=p,Di}var Bi,Gd;function E_(){if(Gd)return Bi;Gd=1;var e=nr(),t=Ll(),r=Ju(),a=R_(),n=X(),i=ye(),s=kl();function u(o,f,c,d,h){o!==f&&r(f,function(l,y){if(h||(h=new e),n(l))a(o,f,y,c,u,d,h);else{var p=d?d(s(o,y),l,y+"",o,f,h):void 0;p===void 0&&(p=l),t(o,y,p)}},i)}return Bi=u,Bi}var Ui,Dd;function I_(){if(Dd)return Ui;Dd=1;var e=lr(),t=vr();function r(a){return e(function(n,i){var s=-1,u=i.length,o=u>1?i[u-1]:void 0,f=u>2?i[2]:void 0;for(o=a.length>3&&typeof o=="function"?(u--,o):void 0,f&&t(i[0],i[1],f)&&(o=u<3?void 0:o,u=1),n=Object(n);++sa||u&&o&&c&&!f&&!d||i&&o&&c||!n&&c||!s)return 1;if(!i&&!u&&!d&&r=f)return c;var d=n[i];return c*(d=="desc"?-1:1)}}return r.index-a.index}return au=t,au}var iu,th;function B_(){if(th)return iu;th=1;var e=cr(),t=hr(),r=oe(),a=yl(),n=j_(),i=ur(),s=D_(),u=me(),o=U();function f(c,d,h){d.length?d=e(d,function(p){return o(p)?function(v){return t(v,p.length===1?p[0]:p)}:p}):d=[u];var l=-1;d=e(d,i(r));var y=a(c,function(p,v,_){var g=e(d,function(b){return b(p)});return{criteria:g,index:++l,value:p}});return n(y,function(p,v){return s(p,v,h)})}return iu=f,iu}var uu,ah;function U_(){if(ah)return uu;ah=1;var e=ns(),t=B_(),r=lr(),a=vr(),n=r(function(i,s){if(i==null)return[];var u=s.length;return u>1&&a(i,s[0],s[1])?s=[]:u>2&&a(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return uu=n,uu}var su,ih;function z_(){if(ih)return su;ih=1;var e=hl(),t=0;function r(a){var n=++t;return e(a)+n}return su=r,su}var ou,uh;function V_(){if(uh)return ou;uh=1;function e(t,r,a){for(var n=-1,i=t.length,s=r.length,u={};++n0;--v)if(p=c[v].dequeue(),p){h=h.concat(s(f,c,d,p,!0));break}}}return h}function s(f,c,d,h,l){var y=l?[]:void 0;return e.forEach(f.inEdges(h.v),function(p){var v=f.edge(p),_=f.node(p.v);l&&y.push({v:p.v,w:p.w}),_.out-=v,o(c,d,_)}),e.forEach(f.outEdges(h.v),function(p){var v=f.edge(p),_=p.w,g=f.node(_);g.in-=v,o(c,d,g)}),f.removeNode(h.v),y}function u(f,c){var d=new t,h=0,l=0;e.forEach(f.nodes(),function(v){d.setNode(v,{v,in:0,out:0})}),e.forEach(f.edges(),function(v){var _=d.edge(v.v,v.w)||0,g=c(v),b=_+g;d.setEdge(v.v,v.w,b),l=Math.max(l,d.node(v.v).out+=g),h=Math.max(h,d.node(v.w).in+=g)});var y=e.range(l+h+3).map(function(){return new r}),p=h+1;return e.forEach(d.nodes(),function(v){o(y,p,d.node(v))}),{graph:d,buckets:y,zeroIdx:p}}function o(f,c,d){d.out?d.in?f[d.out-d.in+c].enqueue(d):f[f.length-1].enqueue(d):f[0].enqueue(d)}return hu}var lu,dh;function W_(){if(dh)return lu;dh=1;var e=D(),t=$_();lu={run:r,undo:n};function r(i){var s=i.graph().acyclicer==="greedy"?t(i,u(i)):a(i);e.forEach(s,function(o){var f=i.edge(o);i.removeEdge(o),f.forwardName=o.name,f.reversed=!0,i.setEdge(o.w,o.v,f,e.uniqueId("rev"))});function u(o){return function(f){return o.edge(f).weight}}}function a(i){var s=[],u={},o={};function f(c){e.has(o,c)||(o[c]=!0,u[c]=!0,e.forEach(i.outEdges(c),function(d){e.has(u,d.w)?s.push(d):f(d.w)}),delete u[c])}return e.forEach(i.nodes(),f),s}function n(i){e.forEach(i.edges(),function(s){var u=i.edge(s);if(u.reversed){i.removeEdge(s);var o=u.forwardName;delete u.reversed,delete u.forwardName,i.setEdge(s.w,s.v,u,o)}})}return lu}var vu,hh;function W(){if(hh)return vu;hh=1;var e=D(),t=ee().Graph;vu={addDummyNode:r,simplify:a,asNonCompoundGraph:n,successorWeights:i,predecessorWeights:s,intersectRect:u,buildLayerMatrix:o,normalizeRanks:f,removeEmptyRanks:c,addBorderNode:d,maxRank:h,partition:l,time:y,notime:p};function r(v,_,g,b){var m;do m=e.uniqueId(b);while(v.hasNode(m));return g.dummy=_,v.setNode(m,g),m}function a(v){var _=new t().setGraph(v.graph());return e.forEach(v.nodes(),function(g){_.setNode(g,v.node(g))}),e.forEach(v.edges(),function(g){var b=_.edge(g.v,g.w)||{weight:0,minlen:1},m=v.edge(g);_.setEdge(g.v,g.w,{weight:b.weight+m.weight,minlen:Math.max(b.minlen,m.minlen)})}),_}function n(v){var _=new t({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(g){v.children(g).length||_.setNode(g,v.node(g))}),e.forEach(v.edges(),function(g){_.setEdge(g,v.edge(g))}),_}function i(v){var _=e.map(v.nodes(),function(g){var b={};return e.forEach(v.outEdges(g),function(m){b[m.w]=(b[m.w]||0)+v.edge(m).weight}),b});return e.zipObject(v.nodes(),_)}function s(v){var _=e.map(v.nodes(),function(g){var b={};return e.forEach(v.inEdges(g),function(m){b[m.v]=(b[m.v]||0)+v.edge(m).weight}),b});return e.zipObject(v.nodes(),_)}function u(v,_){var g=v.x,b=v.y,m=_.x-g,q=_.y-b,w=v.width/2,R=v.height/2;if(!m&&!q)throw new Error("Not possible to find intersection inside of the rectangle");var S,C;return Math.abs(q)*w>Math.abs(m)*R?(q<0&&(R=-R),S=R*m/q,C=R):(m<0&&(w=-w),S=w,C=w*q/m),{x:g+S,y:b+C}}function o(v){var _=e.map(e.range(h(v)+1),function(){return[]});return e.forEach(v.nodes(),function(g){var b=v.node(g),m=b.rank;e.isUndefined(m)||(_[m][b.order]=g)}),_}function f(v){var _=e.min(e.map(v.nodes(),function(g){return v.node(g).rank}));e.forEach(v.nodes(),function(g){var b=v.node(g);e.has(b,"rank")&&(b.rank-=_)})}function c(v){var _=e.min(e.map(v.nodes(),function(q){return v.node(q).rank})),g=[];e.forEach(v.nodes(),function(q){var w=v.node(q).rank-_;g[w]||(g[w]=[]),g[w].push(q)});var b=0,m=v.graph().nodeRankFactor;e.forEach(g,function(q,w){e.isUndefined(q)&&w%m!==0?--b:b&&e.forEach(q,function(R){v.node(R).rank+=b})})}function d(v,_,g,b){var m={width:0,height:0};return arguments.length>=4&&(m.rank=g,m.order=b),r(v,"border",m,_)}function h(v){return e.max(e.map(v.nodes(),function(_){var g=v.node(_).rank;if(!e.isUndefined(g))return g}))}function l(v,_){var g={lhs:[],rhs:[]};return e.forEach(v,function(b){_(b)?g.lhs.push(b):g.rhs.push(b)}),g}function y(v,_){var g=e.now();try{return _()}finally{console.log(v+" time: "+(e.now()-g)+"ms")}}function p(v,_){return _()}return vu}var pu,lh;function Y_(){if(lh)return pu;lh=1;var e=D(),t=W();pu={run:r,undo:n};function r(i){i.graph().dummyChains=[],e.forEach(i.edges(),function(s){a(i,s)})}function a(i,s){var u=s.v,o=i.node(u).rank,f=s.w,c=i.node(f).rank,d=s.name,h=i.edge(s),l=h.labelRank;if(c!==o+1){i.removeEdge(s);var y,p,v;for(v=0,++o;oC.lim&&(A=C,O=!0);var P=e.filter(m.edges(),function(M){return O===g(b,b.node(M.v),A)&&O!==g(b,b.node(M.w),A)});return e.minBy(P,function(M){return r(m,M)})}function p(b,m,q,w){var R=q.v,S=q.w;b.removeEdge(R,S),b.setEdge(w.v,w.w,{}),d(b),o(b,m),v(b,m)}function v(b,m){var q=e.find(b.nodes(),function(R){return!m.node(R).parent}),w=n(b,q);w=w.slice(1),e.forEach(w,function(R){var S=b.node(R).parent,C=m.edge(R,S),A=!1;C||(C=m.edge(S,R),A=!0),m.node(R).rank=m.node(S).rank+(A?C.minlen:-C.minlen)})}function _(b,m,q){return b.hasEdge(m,q)}function g(b,m,q){return q.low<=m.lim&&m.lim<=q.lim}return bu}var yu,gh;function Z_(){if(gh)return yu;gh=1;var e=Xe(),t=e.longestPath,r=Fl(),a=X_();yu=n;function n(o){switch(o.graph().ranker){case"network-simplex":u(o);break;case"tight-tree":s(o);break;case"longest-path":i(o);break;default:u(o)}}var i=t;function s(o){t(o),r(o)}function u(o){a(o)}return yu}var mu,bh;function J_(){if(bh)return mu;bh=1;var e=D();mu=t;function t(n){var i=a(n);e.forEach(n.graph().dummyChains,function(s){for(var u=n.node(s),o=u.edgeObj,f=r(n,i,o.v,o.w),c=f.path,d=f.lca,h=0,l=c[h],y=!0;s!==o.w;){if(u=n.node(s),y){for(;(l=c[h])!==d&&n.node(l).maxRankc||d>i[h].lim));for(l=h,h=u;(h=n.parent(h))!==l;)f.push(h);return{path:o.concat(f.reverse()),lca:l}}function a(n){var i={},s=0;function u(o){var f=s;e.forEach(n.children(o),u),i[o]={low:f,lim:s++}}return e.forEach(n.children(),u),i}return mu}var qu,yh;function Q_(){if(yh)return qu;yh=1;var e=D(),t=W();qu={run:r,cleanup:s};function r(u){var o=t.addDummyNode(u,"root",{},"_root"),f=n(u),c=e.max(e.values(f))-1,d=2*c+1;u.graph().nestingRoot=o,e.forEach(u.edges(),function(l){u.edge(l).minlen*=d});var h=i(u)+1;e.forEach(u.children(),function(l){a(u,o,d,h,c,f,l)}),u.graph().nodeRankFactor=d}function a(u,o,f,c,d,h,l){var y=u.children(l);if(!y.length){l!==o&&u.setEdge(o,l,{weight:0,minlen:f});return}var p=t.addBorderNode(u,"_bt"),v=t.addBorderNode(u,"_bb"),_=u.node(l);u.setParent(p,l),_.borderTop=p,u.setParent(v,l),_.borderBottom=v,e.forEach(y,function(g){a(u,o,f,c,d,h,g);var b=u.node(g),m=b.borderTop?b.borderTop:g,q=b.borderBottom?b.borderBottom:g,w=b.borderTop?c:2*c,R=m!==q?1:d-h[l]+1;u.setEdge(p,m,{weight:w,minlen:R,nestingEdge:!0}),u.setEdge(q,v,{weight:w,minlen:R,nestingEdge:!0})}),u.parent(l)||u.setEdge(o,p,{weight:0,minlen:d+h[l]})}function n(u){var o={};function f(c,d){var h=u.children(c);h&&h.length&&e.forEach(h,function(l){f(l,d+1)}),o[c]=d}return e.forEach(u.children(),function(c){f(c,1)}),o}function i(u){return e.reduce(u.edges(),function(o,f){return o+u.edge(f).weight},0)}function s(u){var o=u.graph();u.removeNode(o.nestingRoot),delete o.nestingRoot,e.forEach(u.edges(),function(f){var c=u.edge(f);c.nestingEdge&&u.removeEdge(f)})}return qu}var wu,mh;function eg(){if(mh)return wu;mh=1;var e=D(),t=W();wu=r;function r(n){function i(s){var u=n.children(s),o=n.node(s);if(u.length&&e.forEach(u,i),e.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var f=o.minRank,c=o.maxRank+1;f0;)l%2&&(y+=c[l+1]),l=l-1>>1,c[l]+=h.weight;d+=h.weight*y})),d}return Iu}var Cu,Eh;function ag(){if(Eh)return Cu;Eh=1;var e=D();Cu=t;function t(r,a){return e.map(a,function(n){var i=r.inEdges(n);if(i.length){var s=e.reduce(i,function(u,o){var f=r.edge(o),c=r.node(o.v);return{sum:u.sum+f.weight*c.order,weight:u.weight+f.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:n}})}return Cu}var Au,Ih;function ig(){if(Ih)return Au;Ih=1;var e=D();Au=t;function t(n,i){var s={};e.forEach(n,function(o,f){var c=s[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:f};e.isUndefined(o.barycenter)||(c.barycenter=o.barycenter,c.weight=o.weight)}),e.forEach(i.edges(),function(o){var f=s[o.v],c=s[o.w];!e.isUndefined(f)&&!e.isUndefined(c)&&(c.indegree++,f.out.push(s[o.w]))});var u=e.filter(s,function(o){return!o.indegree});return r(u)}function r(n){var i=[];function s(f){return function(c){c.merged||(e.isUndefined(c.barycenter)||e.isUndefined(f.barycenter)||c.barycenter>=f.barycenter)&&a(f,c)}}function u(f){return function(c){c.in.push(f),--c.indegree===0&&n.push(c)}}for(;n.length;){var o=n.pop();i.push(o),e.forEach(o.in.reverse(),s(o)),e.forEach(o.out,u(o))}return e.map(e.filter(i,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function a(n,i){var s=0,u=0;n.weight&&(s+=n.barycenter*n.weight,u+=n.weight),i.weight&&(s+=i.barycenter*i.weight,u+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=s/u,n.weight=u,n.i=Math.min(i.i,n.i),i.merged=!0}return Au}var Su,Ch;function ug(){if(Ch)return Su;Ch=1;var e=D(),t=W();Su=r;function r(i,s){var u=t.partition(i,function(p){return e.has(p,"barycenter")}),o=u.lhs,f=e.sortBy(u.rhs,function(p){return-p.i}),c=[],d=0,h=0,l=0;o.sort(n(!!s)),l=a(c,f,l),e.forEach(o,function(p){l+=p.vs.length,c.push(p.vs),d+=p.barycenter*p.weight,h+=p.weight,l=a(c,f,l)});var y={vs:e.flatten(c,!0)};return h&&(y.barycenter=d/h,y.weight=h),y}function a(i,s,u){for(var o;s.length&&(o=e.last(s)).i<=u;)s.pop(),i.push(o.vs),u++;return u}function n(i){return function(s,u){return s.barycenteru.barycenter?1:i?u.i-s.i:s.i-u.i}}return Su}var Tu,Ah;function sg(){if(Ah)return Tu;Ah=1;var e=D(),t=ag(),r=ig(),a=ug();Tu=n;function n(u,o,f,c){var d=u.children(o),h=u.node(o),l=h?h.borderLeft:void 0,y=h?h.borderRight:void 0,p={};l&&(d=e.filter(d,function(q){return q!==l&&q!==y}));var v=t(u,d);e.forEach(v,function(q){if(u.children(q.v).length){var w=n(u,q.v,f,c);p[q.v]=w,e.has(w,"barycenter")&&s(q,w)}});var _=r(v,f);i(_,p);var g=a(_,c);if(l&&(g.vs=e.flatten([l,g.vs,y],!0),u.predecessors(l).length)){var b=u.node(u.predecessors(l)[0]),m=u.node(u.predecessors(y)[0]);e.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+b.order+m.order)/(g.weight+2),g.weight+=2}return g}function i(u,o){e.forEach(u,function(f){f.vs=e.flatten(f.vs.map(function(c){return o[c]?o[c].vs:c}),!0)})}function s(u,o){e.isUndefined(u.barycenter)?(u.barycenter=o.barycenter,u.weight=o.weight):(u.barycenter=(u.barycenter*u.weight+o.barycenter*o.weight)/(u.weight+o.weight),u.weight+=o.weight)}return Tu}var Ou,Sh;function og(){if(Sh)return Ou;Sh=1;var e=D(),t=ee().Graph;Ou=r;function r(n,i,s){var u=a(n),o=new t({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(f){return n.node(f)});return e.forEach(n.nodes(),function(f){var c=n.node(f),d=n.parent(f);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(o.setNode(f),o.setParent(f,d||u),e.forEach(n[s](f),function(h){var l=h.v===f?h.w:h.v,y=o.edge(l,f),p=e.isUndefined(y)?0:y.weight;o.setEdge(l,f,{weight:n.edge(h).weight+p})}),e.has(c,"minRank")&&o.setNode(f,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),o}function a(n){for(var i;n.hasNode(i=e.uniqueId("_root")););return i}return Ou}var xu,Th;function fg(){if(Th)return xu;Th=1;var e=D();xu=t;function t(r,a,n){var i={},s;e.forEach(n,function(u){for(var o=r.parent(u),f,c;o;){if(f=r.parent(o),f?(c=i[f],i[f]=o):(c=s,s=o),c&&c!==o){a.setEdge(c,o);return}o=f}})}return xu}var Pu,Oh;function cg(){if(Oh)return Pu;Oh=1;var e=D(),t=ng(),r=tg(),a=sg(),n=og(),i=fg(),s=ee().Graph,u=W();Pu=o;function o(h){var l=u.maxRank(h),y=f(h,e.range(1,l+1),"inEdges"),p=f(h,e.range(l-1,-1,-1),"outEdges"),v=t(h);d(h,v);for(var _=Number.POSITIVE_INFINITY,g,b=0,m=0;m<4;++b,++m){c(b%2?y:p,b%4>=2),v=u.buildLayerMatrix(h);var q=r(h,v);q<_&&(m=0,g=e.cloneDeep(v),_=q)}d(h,g)}function f(h,l,y){return e.map(l,function(p){return n(h,p,y)})}function c(h,l){var y=new s;e.forEach(h,function(p){var v=p.graph().root,_=a(p,v,y,l);e.forEach(_.vs,function(g,b){p.node(g).order=b}),i(p,y,_.vs)})}function d(h,l){e.forEach(l,function(y){e.forEach(y,function(p,v){h.node(p).order=v})})}return Pu}var Mu,xh;function dg(){if(xh)return Mu;xh=1;var e=D(),t=ee().Graph,r=W();Mu={positionX:y,findType1Conflicts:a,findType2Conflicts:n,addConflict:s,hasConflict:u,verticalAlignment:o,horizontalCompaction:f,alignCoordinates:h,findSmallestWidthAlignment:d,balance:l};function a(_,g){var b={};function m(q,w){var R=0,S=0,C=q.length,A=e.last(w);return e.forEach(w,function(O,P){var M=i(_,O),k=M?_.node(M).order:C;(M||O===A)&&(e.forEach(w.slice(S,P+1),function(j){e.forEach(_.predecessors(j),function(z){var qe=_.node(z),le=qe.order;(leA)&&s(b,M,O)})})}function q(w,R){var S=-1,C,A=0;return e.forEach(R,function(O,P){if(_.node(O).dummy==="border"){var M=_.predecessors(O);M.length&&(C=_.node(M[0]).order,m(R,A,P,S,C),A=P,S=C)}m(R,A,R.length,C,w.length)}),R}return e.reduce(g,q),b}function i(_,g){if(_.node(g).dummy)return e.find(_.predecessors(g),function(b){return _.node(b).dummy})}function s(_,g,b){if(g>b){var m=g;g=b,b=m}var q=_[g];q||(_[g]=q={}),q[b]=!0}function u(_,g,b){if(g>b){var m=g;g=b,b=m}return e.has(_[g],b)}function o(_,g,b,m){var q={},w={},R={};return e.forEach(g,function(S){e.forEach(S,function(C,A){q[C]=C,w[C]=C,R[C]=A})}),e.forEach(g,function(S){var C=-1;e.forEach(S,function(A){var O=m(A);if(O.length){O=e.sortBy(O,function(z){return R[z]});for(var P=(O.length-1)/2,M=Math.floor(P),k=Math.ceil(P);M<=k;++M){var j=O[M];w[A]===A&&C({}));const o=s==="LR";u.setGraph({rankdir:s}),r.value=s;for(const f of n){const c=e(f.id);u.setNode(f.id,{width:c.dimensions.width||150,height:c.dimensions.height||50})}for(const f of i)u.setEdge(f.source,f.target);return Gu.layout(u),n.map(f=>{const c=u.node(f.id);return yr(br({},f),{targetPosition:o?Ye.Left:Ye.Top,sourcePosition:o?Ye.Right:Ye.Bottom,position:{x:c.x,y:c.y}})})}return{graph:t,layout:a,previousDirection:r}}function yg(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}}function mg(e){const t=[];for(const r of e)for(const a of e)if(r.id!==a.id){const n=`e${r.id}-${a.id}`;t.push({id:n,source:r.id,target:a.id,type:"animation",animated:!0})}return t}function qg(){return e=>{const t=mg(e);yg(t);const r=new Set,a=[];for(const n of t)!r.has(n.target)&&(r.size===0||r.has(n.source))&&(a.push(n),r.add(n.source),r.add(n.target));return a}}function wg({graph:e,cancelOnError:t=!0}){const{updateNodeData:r,getConnectedEdges:a}=Ze(),n=Du(()=>ds(e)),i=Ie(!1),s=new Set,u=new Map,o=new Set;function f(p,v=!1){return ie(this,null,function*(){if(s.has(p.id))return;o.add(p.id);const _=a(p.id).filter(b=>b.target===p.id);if(yield Promise.all(_.map(b=>Rg(()=>!b.data.isAnimating))),o.clear(),!i.value)return;s.add(p.id),r(p.id,{isRunning:!0,isFinished:!1,hasError:!1,isCancelled:!1});const g=Math.floor(Math.random()*2e3)+1e3;return new Promise(b=>{const m=setTimeout(()=>ie(this,null,function*(){const q=n.value.successors(p.id),w=Math.random()<.15;if(!v&&w&&(r(p.id,{isRunning:!1,hasError:!0}),ds(t))){yield h(p.id),u.delete(p.id),b();return}r(p.id,{isRunning:!1,isFinished:!0}),u.delete(p.id),q.length>0&&(yield Promise.all(q.map(R=>f({id:R})))),b()}),v?0:g);u.set(p.id,m)})})}function c(p){return ie(this,null,function*(){if(i.value)return;d(p),i.value=!0;const v=p.filter(_=>{var g;return((g=n.value.predecessors(_.id))==null?void 0:g.length)===0});yield Promise.all(v.map(_=>f(_,!0))),y()})}function d(p){y();for(const v of p)r(v.id,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!1})}function h(p){return ie(this,null,function*(){const v=n.value.successors(p);for(const _ of v)r(_,{isRunning:!1,isSkipped:!0}),yield h(_)})}function l(){return ie(this,null,function*(){i.value=!1;for(const p of o)clearTimeout(u.get(p)),u.delete(p),r(p,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!0}),yield h(p);for(const[p,v]of u)clearTimeout(v),u.delete(p),r(p,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!0}),yield h(p);s.clear(),o.clear()})}function y(){i.value=!1,s.clear(),u.clear()}return{run:c,stop:l,reset:d,isRunning:i}}function Rg(e){return ie(this,null,function*(){return new Promise(t=>{const r=setInterval(()=>{e()&&(clearInterval(r),t())},100)})})}var ue=(e=>(e.Lines="lines",e.Dots="dots",e))(ue||{});const jl=function({dimensions:e,size:t,color:r}){return jh("path",{stroke:r,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Gl=function({radius:e,color:t}){return jh("circle",{cx:e,cy:e,r:e,fill:t})};ue.Lines+"",ue.Dots+"";const Eg={[ue.Dots]:"#81818a",[ue.Lines]:"#eee"},Ig=["id","x","y","width","height","patternTransform"],Cg={key:2,height:"100",width:"100"},Ag=["fill"],Sg=["x","y","fill"],Tg={name:"Background",compatConfig:{MODE:3}},Og=Fh(yr(br({},Tg),{props:{id:{},variant:{default:()=>ue.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:r}=Ze(),a=Yl(()=>{const s=r.value.zoom,[u,o]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],f=[u*s||1,o*s||1],c=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],l=[d*s||1+f[0]/2,h*s||1+f[1]/2];return{scaledGap:f,offset:l,size:c}}),n=Du(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=Du(()=>e.color||e.patternColor||Eg[e.variant||ue.Dots]);return(s,u)=>(_e(),Fe("svg",{class:"vue-flow__background vue-flow__container",style:Xl({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[mr(s.$slots,"pattern-container",{id:n.value},()=>[de("pattern",{id:n.value,x:Y(r).x%a.value.scaledGap[0],y:Y(r).y%a.value.scaledGap[1],width:a.value.scaledGap[0],height:a.value.scaledGap[1],patternTransform:`translate(-${a.value.offset[0]},-${a.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[mr(s.$slots,"pattern",{},()=>[s.variant===Y(ue).Lines?(_e(),hs(Y(jl),{key:0,size:s.lineWidth,color:i.value,dimensions:a.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===Y(ue).Dots?(_e(),hs(Y(Gl),{key:1,color:i.value,radius:a.value.size/2},null,8,["color","radius"])):ls("",!0),s.bgColor?(_e(),Fe("svg",Cg,[de("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,Ag)])):ls("",!0)])],8,Ig)]),de("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${n.value})`},null,8,Sg),mr(s.$slots,"default",{id:n.value})],4))}})),J={x:0,y:0},Q="process",te="animation",xg=[{id:"1",position:J,type:Q},{id:"2",position:J,type:Q},{id:"2a",position:J,type:Q},{id:"2b",position:J,type:Q},{id:"2c",position:J,type:Q},{id:"2d",position:J,type:Q},{id:"3",position:J,type:Q},{id:"4",position:J,type:Q},{id:"5",position:J,type:Q},{id:"6",position:J,type:Q},{id:"7",position:J,type:Q}],Pg=[{id:"e1-2",source:"1",target:"2",type:te,animated:!0},{id:"e1-3",source:"1",target:"3",type:te,animated:!0},{id:"e2-2a",source:"2",target:"2a",type:te,animated:!0},{id:"e2-2b",source:"2",target:"2b",type:te,animated:!0},{id:"e2-2c",source:"2",target:"2c",type:te,animated:!0},{id:"e2c-2d",source:"2c",target:"2d",type:te,animated:!0},{id:"e3-7",source:"3",target:"4",type:te,animated:!0},{id:"e4-5",source:"4",target:"5",type:te,animated:!0},{id:"e5-6",source:"5",target:"6",type:te,animated:!0},{id:"e5-7",source:"5",target:"7",type:te,animated:!0}],Mg={class:"layout-flow"},Lg={class:"layout-panel"},kg=Fh({__name:"index",setup(e){const t=Ie(xg),r=Ie(Pg),a=Ie(!0),n=qg(),{graph:i,layout:s,previousDirection:u}=bg(),{run:o,stop:f,reset:c,isRunning:d}=wg({graph:i,cancelOnError:a}),{fitView:h}=Ze();function l(){return ie(this,null,function*(){yield f(),c(t.value),r.value=n(t.value),vs(()=>{y(u.value)})})}function y(p){return ie(this,null,function*(){yield f(),c(t.value),t.value=s(t.value,r.value,p),vs(()=>{h(),o(t.value)})})}return(p,v)=>(_e(),Fe("div",Mg,[ne(Y(Ql),{nodes:t.value,edges:r.value,onNodesInitialized:v[4]||(v[4]=_=>y("LR"))},{"node-process":We(_=>[ne(ev,{data:_.data,"source-position":_.sourcePosition,"target-position":_.targetPosition},null,8,["data","source-position","target-position"])]),"edge-animation":We(_=>[ne(rv,{id:_.id,source:_.source,target:_.target,"source-x":_.sourceX,"source-y":_.sourceY,targetX:_.targetX,targetY:_.targetY,"source-position":_.sourcePosition,"target-position":_.targetPosition},null,8,["id","source","target","source-x","source-y","targetX","targetY","source-position","target-position"])]),default:We(()=>[ne(Y(Og)),ne(Y(Jl),{class:"process-panel",position:"top-left"},{default:We(()=>[de("div",Lg,[Y(d)?(_e(),Fe("button",{key:0,class:"stop-btn",title:"stop",onClick:v[0]||(v[0]=(..._)=>Y(f)&&Y(f)(..._))},[ne(Me,{name:"stop"}),v[5]||(v[5]=de("span",{class:"spinner"},null,-1))])):(_e(),Fe("button",{key:1,title:"start",onClick:v[1]||(v[1]=_=>Y(o)(t.value))},[ne(Me,{name:"play"})])),de("button",{title:"set horizontal layout",onClick:v[2]||(v[2]=_=>y("LR"))},[ne(Me,{name:"horizontal"})]),de("button",{title:"set vertical layout",onClick:v[3]||(v[3]=_=>y("TB"))},[ne(Me,{name:"vertical"})]),de("button",{title:"shuffle graph",onClick:l},[ne(Me,{name:"shuffle"})])])]),_:1})]),_:1},8,["nodes","edges"])]))}}),zg=Zl(kg,[["__scopeId","data-v-3f47f269"]]);export{zg as default};