2 lines
28 KiB
JavaScript
2 lines
28 KiB
JavaScript
|
|
import{a as E}from"./chunk-EYG76IYJ.mjs";import{D as y,E as G,F as x,G as P,H as V,J as B,K as k,L as S,N as yr,P as O,T as A,U as Z,d as N,f as _r,h as Q,i as wr,k as R,n as u,p as I,q as z,s as _,u as br,v as Er,x as q,z as L}from"./chunk-OMTJKCYW.mjs";import{O as F,T as Y,z as vr}from"./chunk-A4ITRWGT.mjs";import{a as s}from"./chunk-GTKDMUJJ.mjs";function g(r,e,n,t){var o;do o=A(t);while(r.hasNode(o));return n.dummy=e,r.setNode(o,n),o}s(g,"addDummyNode");function xr(r){var e=new E().setGraph(r.graph());return u(r.nodes(),function(n){e.setNode(n,r.node(n))}),u(r.edges(),function(n){var t=e.edge(n.v,n.w)||{weight:0,minlen:1},o=r.edge(n);e.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),e}s(xr,"simplify");function X(r){var e=new E({multigraph:r.isMultigraph()}).setGraph(r.graph());return u(r.nodes(),function(n){r.children(n).length||e.setNode(n,r.node(n))}),u(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}s(X,"asNonCompoundGraph");function $(r,e){var n=r.x,t=r.y,o=e.x-n,a=e.y-t,i=r.width/2,f=r.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var d,c;return Math.abs(a)*i>Math.abs(o)*f?(a<0&&(f=-f),d=f*o/a,c=f):(o<0&&(i=-i),d=i,c=i*a/o),{x:n+d,y:t+c}}s($,"intersectRect");function C(r){var e=_(k(er(r)+1),function(){return[]});return u(r.nodes(),function(n){var t=r.node(n),o=t.rank;y(o)||(e[o][t.order]=n)}),e}s(C,"buildLayerMatrix");function kr(r){var e=P(_(r.nodes(),function(n){return r.node(n).rank}));u(r.nodes(),function(n){var t=r.node(n);q(t,"rank")&&(t.rank-=e)})}s(kr,"normalizeRanks");function gr(r){var e=P(_(r.nodes(),function(a){return r.node(a).rank})),n=[];u(r.nodes(),function(a){var i=r.node(a).rank-e;n[i]||(n[i]=[]),n[i].push(a)});var t=0,o=r.graph().nodeRankFactor;u(n,function(a,i){y(a)&&i%o!==0?--t:t&&u(a,function(f){r.node(f).rank+=t})})}s(gr,"removeEmptyRanks");function rr(r,e,n,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=t),g(r,"border",o,e)}s(rr,"addBorderNode");function er(r){return x(_(r.nodes(),function(e){var n=r.node(e).rank;if(!y(n))return n}))}s(er,"maxRank");function Nr(r,e){var n={lhs:[],rhs:[]};return u(r,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}s(Nr,"partition");function Ir(r,e){var n=Q();try{return e()}finally{console.log(r+" time: "+(Q()-n)+"ms")}}s(Ir,"time");function Or(r,e){return e()}s(Or,"notime");function Pr(r){function e(n){var t=r.children(n),o=r.node(n);if(t.length&&u(t,e),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)Lr(r,"borderLeft","_bl",n,o,a),Lr(r,"borderRight","_br",n,o,a)}}s(e,"dfs"),u(r.children(),e)}s(Pr,"addBorderSegments");function Lr(r,e,n,t,o,a){var i={width:0,height:0,rank:a,borderType:e},f=o[e][a-1],d=g(r,"border",i,n);o[e][a]=d,r.setParent(d,t),f&&r.setEdge(f,d,{weight:1})}s(Lr,"addBorderNode");function Tr(r){var e=r.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Rr(r)}s(Tr,"adjust");function jr(r){var e=r.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&pe(r),(e==="lr"||e==="rl")&&(me(r),Rr(r))}s(jr,"undo");function Rr(r){u(r.nodes(),function(e){Cr(r.node(e))}),u(r.edges(),function(e){Cr(r.edge(e))})}s(Rr,"swapWidthHeight");function Cr(r){var e=r.width;r.width=r.height,r.height=e}s(Cr,"swapWidthHeightOne");function pe(r){u(r.nodes(),function(e){nr(r.node(e))}),u(r.edges(),function(e){var n=r.edge(e);u(n.points,nr),Object.prototype.hasOwnProperty.call(n,"y")&&nr(n)})}s(pe,"reverseY");function nr(r){r.y=-r.y}s(nr,"reverseYOne");function me(r){u(r.nodes(),function(e){tr(r.node(e))}),u(r.edges(),function(e){var n=r.edge(e);u(n.points,tr),Object.prototype.hasOwnProperty.call(n,"x")&&tr(n)})}s(me,"swapXY");function tr(r){var e=r.x;r.x=r.y,r.y=e}s(tr,"swapXYOne");var H=class{static{s(this,"List")}constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return Sr(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&Sr(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._
|