import{a as S,b as be,c as qe,d as O,k as We,e as ze,f as Xe,g as T,h as me,j as ge,l as He,m as ye,t as Ue,n as xe,o as Je,p as Ke,G as g,q as f,i as m,r as I,v as E,s as G}from"./graph-DJb07jXm.js";import{an as F,ao as Ze,ap as Qe,aq as Ee,ar as A,as as ke,at as en,au as Oe,av as U,aw as nn,ax as rn,ay as J,az as tn,aA as Ne,aB as an,aC as on,aD as X}from"./index-BXIz7y_C.js";var un=/\s/;function dn(e){for(var n=e.length;n--&&un.test(e.charAt(n)););return n}var sn=/^\s+/;function fn(e){return e&&e.slice(0,dn(e)+1).replace(sn,"")}var ae=NaN,cn=/^[-+]0x[0-9a-f]+$/i,ln=/^0b[01]+$/i,hn=/^0o[0-7]+$/i,vn=parseInt;function pn(e){if(typeof e=="number")return e;if(S(e))return ae;if(F(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=F(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=fn(e);var r=ln.test(e);return r||hn.test(e)?vn(e.slice(2),r?2:8):cn.test(e)?ae:+e}var oe=1/0,wn=17976931348623157e292;function M(e){if(!e)return e===0?e:0;if(e=pn(e),e===oe||e===-oe){var n=e<0?-1:1;return n*wn}return e===e?e:0}function bn(e){var n=M(e),r=n%1;return n===n?r?n-r:n:0}function N(e){var n=e==null?0:e.length;return n?be(e):[]}function mn(e){return Ze(Qe(e,void 0,N),e+"")}var gn=1,yn=4;function xn(e){return qe(e,gn|yn)}var Le=Object.prototype,En=Le.hasOwnProperty,kn=Ee(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&A(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var Nn=Math.max;function Ln(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:bn(r);return i<0&&(i=Nn(t+i,0)),ze(e,O(n),i)}var K=On(Ln);function Pe(e,n){var r=-1,t=Oe(e)?Array(e.length):[];return Xe(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function w(e,n){var r=U(e)?T:Pe;return r(e,O(n))}function Pn(e,n){return e==null?e:nn(e,me(n),ke)}function _n(e,n){return e&&ge(e,me(n))}function Cn(e,n){return e>n}var In=Object.prototype,Rn=In.hasOwnProperty;function Tn(e,n){return e!=null&&Rn.call(e,n)}function _e(e,n){return e!=null&&He(e,n,Tn)}function Ce(e,n){return en||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function jn(e,n,r){n.length?n=T(n,function(o){return U(o)?function(a){return xe(a,o.length===1?o[0]:o)}:o}):n=[J];var t=-1;n=T(n,an(O));var i=Pe(e,function(o,a,u){var d=T(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Fn(i,function(o,a){return Bn(o,a,r)})}function Gn(e,n){return Sn(e,n,function(r,t){return Je(e,t)})}var j=mn(function(e,n){return e==null?{}:Gn(e,n)}),Vn=Math.ceil,Yn=Math.max;function $n(e,n,r,t){for(var i=-1,o=Yn(Vn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function Dn(e){return function(n,r,t){return t&&typeof t!="number"&&A(n,r,t)&&(r=t=void 0),n=M(n),r===void 0?(r=n,n=0):r=M(r),t=t===void 0?n1&&A(e,n[0],n[1])?n=[]:r>2&&A(n[0],n[1],n[2])&&(n=[n[0]]),jn(e,be(n),[])}),qn=0;function ee(e){var n=++qn;return Ke(e)+n}function Wn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t0;--u)if(a=n[u].dequeue(),a){t=t.concat($(e,n,r,a,!0));break}}}return t}function $(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,H(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,H(n,r,s)}),e.removeNode(t.v),o}function Zn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new Xn}),a=t+1;return f(r.nodes(),function(u){H(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function H(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Qn(e){var n=e.graph().acyclicer==="greedy"?Jn(e,r(e)):er(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,ee("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function er(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function nr(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function L(e,n,r,t){var i;do i=ee(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function rr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Ie(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function de(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function Y(e){var n=w(k(Re(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function tr(e){var n=_(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);_e(t,"rank")&&(t.rank-=n)})}function ir(e){var n=_(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){m(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function se(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),L(e,"border",i,n)}function Re(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function ar(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function or(e,n){return n()}function ur(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===le(e,e.node(c.v),u)&&d!==le(e,e.node(c.w),u)});return Q(s,function(c){return C(n,c)})}function Ve(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),te(e),re(e,n),Er(e,n)}function Er(e,n){var r=K(e.nodes(),function(i){return!n.node(i).parent}),t=yr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function kr(e,n,r){return e.hasEdge(n,r)}function le(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Or(e){switch(e.graph().ranker){case"network-simplex":he(e);break;case"tight-tree":Lr(e);break;case"longest-path":Nr(e);break;default:he(e)}}var Nr=ne;function Lr(e){ne(e),Me(e)}function he(e){x(e)}function Pr(e){var n=L(e,"root",{},"_root"),r=_r(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=Cr(e)+1;f(e.children(),function(a){Ye(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ye(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=se(e,"_bt"),s=se(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(l){Ye(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,P=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:b,minlen:P,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:P,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function _r(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function Cr(e){return G(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Ir(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Rr(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Tr(e,n,r){var t=Mr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),l=m(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Mr(e){for(var n;e.hasNode(n=ee("_root")););return n}function Sr(e,n){for(var r=0,t=1;t0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function Ar(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!_e(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Br(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=G(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function jr(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return Gr(t)}function Gr(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Vr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return j(o,["vs","i","barycenter","weight"])})}function Vr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Yr(e,n){var r=ar(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort($r(!!n)),d=ve(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ve(o,i,d)});var s={vs:N(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ve(e,n,r){for(var t;n.length&&(t=B(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function $r(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function $e(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Br(e,i);f(s,function(p){if(e.children(p.v).length){var b=$e(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&qr(p,b)}});var c=jr(s,r);Dr(c,d);var l=Yr(c,t);if(a&&(l.vs=N([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function Dr(e,n){f(e,function(r){r.vs=N(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function qr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function Wr(e){var n=Re(e),r=pe(e,k(1,n+1),"inEdges"),t=pe(e,k(n-1,-1,-1),"outEdges"),i=Ar(e);we(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){zr(u%2?r:t,u%4>=2),i=Y(e);var s=Sr(e,i);sa||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Ur(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Jr(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=B(o);return f(o,function(c,l){var h=Zr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(o.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var P=e.node(b),ie=P.order;(ies)&&De(r,h,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(a,s,l,u,d),s=l,u=d)}t(a,s,a.length,d,o.length)}),a}return G(n,i),r}function Zr(e,n){if(e.node(n).dummy)return K(e.predecessors(n),function(r){return e.node(r).dummy})}function De(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Qr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function et(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return a[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];o[s]===s&&d{var t=r(" buildLayoutGraph",()=>xt(e));r(" runLayout",()=>ct(t,r)),r(" updateInputGraph",()=>lt(e,t))})}function ct(e,n){n(" makeSpaceForEdgeLabels",()=>Et(e)),n(" removeSelfEdges",()=>Rt(e)),n(" acyclic",()=>Qn(e)),n(" nestingGraph.run",()=>Pr(e)),n(" rank",()=>Or(Ie(e))),n(" injectEdgeLabelProxies",()=>kt(e)),n(" removeEmptyRanks",()=>ir(e)),n(" nestingGraph.cleanup",()=>Ir(e)),n(" normalizeRanks",()=>tr(e)),n(" assignRankMinMax",()=>Ot(e)),n(" removeEdgeLabelProxies",()=>Nt(e)),n(" normalize.run",()=>lr(e)),n(" parentDummyChains",()=>Xr(e)),n(" addBorderSegments",()=>ur(e)),n(" order",()=>Wr(e)),n(" insertSelfEdges",()=>Tt(e)),n(" adjustCoordinateSystem",()=>dr(e)),n(" position",()=>st(e)),n(" positionSelfEdges",()=>Mt(e)),n(" removeBorderNodes",()=>It(e)),n(" normalize.undo",()=>vr(e)),n(" fixupEdgeLabelCoords",()=>_t(e)),n(" undoCoordinateSystem",()=>sr(e)),n(" translateGraph",()=>Lt(e)),n(" assignNodeIntersects",()=>Pt(e)),n(" reversePoints",()=>Ct(e)),n(" acyclic.undo",()=>nr(e))}function lt(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var ht=["nodesep","edgesep","ranksep","marginx","marginy"],vt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},pt=["acyclicer","ranker","rankdir","align"],wt=["width","height"],bt={width:0,height:0},mt=["minlen","weight","width","height","labeloffset"],gt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yt=["labelpos"];function xt(e){var n=new g({multigraph:!0,compound:!0}),r=z(e.graph());return n.setGraph(X({},vt,W(r,ht),j(r,pt))),f(e.nodes(),function(t){var i=z(e.node(t));n.setNode(t,kn(W(i,wt),bt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=z(e.edge(t));n.setEdge(t,X({},gt,W(i,mt),j(i,yt)))}),n}function Et(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function kt(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};L(e,"edge-proxy",o,"_ep")}})}function Ot(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Nt(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Lt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Pt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(de(t,o)),r.points.push(de(i,a))})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Ct(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function It(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(B(r.borderLeft)),a=e.node(B(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Rt(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Tt(e){var n=Y(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){L(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Mt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function W(e,n){return V(j(e,n),Number)}function z(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{kn as d,At as l,w as m,j as p,k as r,ee as u};