import{a9 as q,aa as fr,ab as O,ac as x,ad as F,ae as fn,af as dr,ag as cr,ah as hr,ai as Te,aj as lr,ak as vr,al as dn,am as X,an as gr,ao as Le,ap as pr,aq as H,ar as an,as as Cn,at as br,au as Ln,av as wr,aw as mr,ax as U,ay as In,az as _r,aA as Ae,aB as Kn,aC as Er,aD as yr,aE as Ne,aF as V,aG as Oe,aH as xr,aI as Pn,aJ as on,aK as Tr,aL as bn,aM as Lr,aN as B,z as Xn,aO as Vn,aP as An}from"./index-BPCszWWQ.js";var Ar="[object Symbol]";function $(n){return typeof n=="symbol"||q(n)&&fr(n)==Ar}function R(n,e){for(var r=-1,t=n==null?0:n.length,i=Array(t);++r-1}function T(n){return fn(n)?dr(n):cr(n)}var Hr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jr=/^\w*$/;function $n(n,e){if(x(n))return!1;var r=typeof n;return r=="number"||r=="symbol"||r=="boolean"||n==null||$(n)?!0:jr.test(n)||!Hr.test(n)||e!=null&&n in Object(e)}var Wr=500;function Kr(n){var e=hr(n,function(t){return r.size===Wr&&r.clear(),t}),r=e.cache;return e}var Xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vr=/\\(\\)?/g,Zr=Kr(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(Xr,function(r,t,i,a){e.push(i?a.replace(Vr,"$1"):t||r)}),e});function $e(n){return n==null?"":Ce(n)}function cn(n,e){return x(n)?n:$n(n,e)?[n]:Zr($e(n))}var Jr=1/0;function Z(n){if(typeof n=="string"||$(n))return n;var e=n+"";return e=="0"&&1/n==-Jr?"-0":e}function hn(n,e){e=cn(e,n);for(var r=0,t=e.length;n!=null&&r0&&r(u)?e>1?ln(u,e-1,r,t,i):Sn(i,u):t||(i[i.length]=u)}return i}function G(n){var e=n==null?0:n.length;return e?ln(n,1):[]}function nt(n){return lr(vr(n,void 0,G),n+"")}function et(n,e,r,t){var i=-1,a=n==null?0:n.length;for(t&&a&&(r=n[++i]);++iu))return!1;var f=a.get(n),d=a.get(e);if(f&&d)return f==e&&d==n;var h=-1,l=!0,g=r&xi?new j:void 0;for(a.set(n,e),a.set(e,n);++h2?e[2]:void 0;for(i&&on(e[0],e[1],i)&&(t=1);++r-1?i[a?e[o]:o]:void 0}}var ha=Math.max;function la(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:Gr(r);return i<0&&(i=ha(t+i,0)),Pe(n,C(e),i)}var kn=ca(la);function Ke(n,e){var r=-1,t=fn(n)?Array(n.length):[];return vn(n,function(i,a,o){t[++r]=e(i,a,o)}),t}function E(n,e){var r=x(n)?R:Ke;return r(n,C(e))}function va(n,e){return n==null?n:Oe(n,Gn(e),X)}function ga(n,e){return n&&Dn(n,Gn(e))}function pa(n,e){return n>e}var ba=Object.prototype,wa=ba.hasOwnProperty;function ma(n,e){return n!=null&&wa.call(n,e)}function b(n,e){return n!=null&&He(n,e,ma)}function _a(n,e){return R(e,function(r){return n[r]})}function N(n){return n==null?[]:_a(n,T(n))}function y(n){return n===void 0}function Xe(n,e){return ne||a&&o&&s&&!u&&!f||t&&o&&s||!r&&s||!i)return 1;if(!t&&!a&&!f&&n=u)return s;var f=r[t];return s*(f=="desc"?-1:1)}}return n.index-e.index}function Aa(n,e,r){e.length?e=R(e,function(a){return x(a)?function(o){return hn(o,a.length===1?a[0]:a)}:a}):e=[V];var t=-1;e=R(e,Cn(C));var i=Ke(n,function(a,o,u){var s=R(e,function(f){return f(a)});return{criteria:s,index:++t,value:a}});return xa(i,function(a,o){return La(a,o,r)})}function Na(n,e){return ya(n,e,function(r,t){return je(n,t)})}var sn=nt(function(n,e){return n==null?{}:Na(n,e)}),Oa=Math.ceil,Ca=Math.max;function Ia(n,e,r,t){for(var i=-1,a=Ca(Oa((e-n)/(r||1)),0),o=Array(a);a--;)o[t?a:++i]=n,n+=r;return o}function Pa(n){return function(e,r,t){return t&&typeof t!="number"&&on(e,r,t)&&(r=t=void 0),e=rn(e),r===void 0?(r=e,e=0):r=rn(r),t=t===void 0?e1&&on(n,e[0],e[1])?e=[]:r>2&&on(e[0],e[1],e[2])&&(e=[e[0]]),Aa(n,ln(e,1),[])}),Sa=1/0,Ma=bn&&1/Rn(new bn([,-0]))[1]==Sa?function(n){return new bn(n)}:kr,Ra=200;function Fa(n,e,r){var t=-1,i=qr,a=n.length,o=!0,u=[],s=u;if(r)o=!1,i=fa;else if(a>=Ra){var f=e?null:Ma(n);if(f)return Rn(f);o=!1,i=Be,s=new j}else s=e?[]:u;n:for(;++t1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return b(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=P,this._children[e]={},this._children[P][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return b(this._nodes,e)}removeNode(e){var r=this;if(b(this._nodes,e)){var t=function(i){r.removeEdge(r._edgeObjs[i])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],c(this.children(e),function(i){r.setParent(i)}),delete this._children[e]),c(T(this._in[e]),t),delete this._in[e],delete this._preds[e],c(T(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(y(r))r=P;else{r+="";for(var t=r;!y(t);t=this.parent(t))if(t===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==P)return r}}children(e){if(y(e)&&(e=P),this._isCompound){var r=this._children[e];if(r)return T(r)}else{if(e===P)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return T(r)}successors(e){var r=this._sucs[e];if(r)return T(r)}neighbors(e){var r=this.predecessors(e);if(r)return Da(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var t=this;c(this._nodes,function(o,u){e(u)&&r.setNode(u,o)}),c(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,t.edge(o))});var i={};function a(o){var u=t.parent(o);return u===void 0||r.hasNode(u)?(i[o]=u,u):u in i?i[u]:a(u)}return this._isCompound&&c(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(e){return Xn(e)||(e=B(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return N(this._edgeObjs)}setPath(e,r){var t=this,i=arguments;return J(e,function(a,o){return i.length>1?t.setEdge(a,o,r):t.setEdge(a,o),o}),this}setEdge(){var e,r,t,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,t=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=o,r=arguments[1],t=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,y(t)||(t=""+t);var u=Y(this._isDirected,e,r,t);if(b(this._edgeLabels,u))return a&&(this._edgeLabels[u]=i),this;if(!y(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[u]=a?i:this._defaultEdgeLabelFn(e,r,t);var s=Ua(this._isDirected,e,r,t);return e=s.v,r=s.w,Object.freeze(s),this._edgeObjs[u]=s,he(this._preds[r],e),he(this._sucs[e],r),this._in[r][u]=s,this._out[e][u]=s,this._edgeCount++,this}edge(e,r,t){var i=arguments.length===1?mn(this._isDirected,arguments[0]):Y(this._isDirected,e,r,t);return this._edgeLabels[i]}hasEdge(e,r,t){var i=arguments.length===1?mn(this._isDirected,arguments[0]):Y(this._isDirected,e,r,t);return b(this._edgeLabels,i)}removeEdge(e,r,t){var i=arguments.length===1?mn(this._isDirected,arguments[0]):Y(this._isDirected,e,r,t),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],le(this._preds[r],e),le(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var t=this._in[e];if(t){var i=N(t);return r?A(i,function(a){return a.v===r}):i}}outEdges(e,r){var t=this._out[e];if(t){var i=N(t);return r?A(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var t=this.inEdges(e,r);if(t)return t.concat(this.outEdges(e,r))}}L.prototype._nodeCount=0;L.prototype._edgeCount=0;function he(n,e){n[e]?n[e]++:n[e]=1}function le(n,e){--n[e]||delete n[e]}function Y(n,e,r,t){var i=""+e,a=""+r;if(!n&&i>a){var o=i;i=a,a=o}return i+ce+a+ce+(y(t)?Ya:t)}function Ua(n,e,r,t){var i=""+e,a=""+r;if(!n&&i>a){var o=i;i=a,a=o}var u={v:i,w:a};return t&&(u.name=t),u}function mn(n,e){return Y(n,e.v,e.w,e.name)}class qa{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return ve(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&ve(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,t=r._prev;t!==r;)e.push(JSON.stringify(t,Ha)),t=t._prev;return"["+e.join(", ")+"]"}}function ve(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Ha(n,e){if(n!=="_next"&&n!=="_prev")return e}var ja=B(1);function Wa(n,e){if(n.nodeCount()<=1)return[];var r=Xa(n,e||ja),t=Ka(r.graph,r.buckets,r.zeroIdx);return G(E(t,function(i){return n.outEdges(i.v,i.w)}))}function Ka(n,e,r){for(var t=[],i=e[e.length-1],a=e[0],o;n.nodeCount();){for(;o=a.dequeue();)_n(n,e,r,o);for(;o=i.dequeue();)_n(n,e,r,o);if(n.nodeCount()){for(var u=e.length-2;u>0;--u)if(o=e[u].dequeue(),o){t=t.concat(_n(n,e,r,o,!0));break}}}return t}function _n(n,e,r,t,i){var a=i?[]:void 0;return c(n.inEdges(t.v),function(o){var u=n.edge(o),s=n.node(o.v);i&&a.push({v:o.v,w:o.w}),s.out-=u,On(e,r,s)}),c(n.outEdges(t.v),function(o){var u=n.edge(o),s=o.w,f=n.node(s);f.in-=u,On(e,r,f)}),n.removeNode(t.v),a}function Xa(n,e){var r=new L,t=0,i=0;c(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(n.edges(),function(u){var s=r.edge(u.v,u.w)||0,f=e(u),d=s+f;r.setEdge(u.v,u.w,d),i=Math.max(i,r.node(u.v).out+=f),t=Math.max(t,r.node(u.w).in+=f)});var a=D(i+t+3).map(function(){return new qa}),o=t+1;return c(r.nodes(),function(u){On(a,o,r.node(u))}),{graph:r,buckets:a,zeroIdx:o}}function On(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function Va(n){var e=n.graph().acyclicer==="greedy"?Wa(n,r(n)):Za(n);c(e,function(t){var i=n.edge(t);n.removeEdge(t),i.forwardName=t.name,i.reversed=!0,n.setEdge(t.w,t.v,i,Un("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Za(n){var e=[],r={},t={};function i(a){b(t,a)||(t[a]=!0,r[a]=!0,c(n.outEdges(a),function(o){b(r,o.w)?e.push(o):i(o.w)}),delete r[a])}return c(n.nodes(),i),e}function Ja(n){c(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}function k(n,e,r,t){var i;do i=Un(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function Qa(n){var e=new L().setGraph(n.graph());return c(n.nodes(),function(r){e.setNode(r,n.node(r))}),c(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),e}function Ve(n){var e=new L({multigraph:n.isMultigraph()}).setGraph(n.graph());return c(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),c(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function ge(n,e){var r=n.x,t=n.y,i=e.x-r,a=e.y-t,o=n.width/2,u=n.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var s,f;return Math.abs(a)*o>Math.abs(i)*u?(a<0&&(u=-u),s=u*i/a,f=u):(i<0&&(o=-o),s=o,f=o*a/i),{x:r+s,y:t+f}}function pn(n){var e=E(D(Ze(n)+1),function(){return[]});return c(n.nodes(),function(r){var t=n.node(r),i=t.rank;y(i)||(e[i][t.order]=r)}),e}function za(n){var e=W(E(n.nodes(),function(r){return n.node(r).rank}));c(n.nodes(),function(r){var t=n.node(r);b(t,"rank")&&(t.rank-=e)})}function no(n){var e=W(E(n.nodes(),function(a){return n.node(a).rank})),r=[];c(n.nodes(),function(a){var o=n.node(a).rank-e;r[o]||(r[o]=[]),r[o].push(a)});var t=0,i=n.graph().nodeRankFactor;c(r,function(a,o){y(a)&&o%i!==0?--t:t&&c(a,function(u){n.node(u).rank+=t})})}function pe(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),k(n,"border",i,e)}function Ze(n){return S(E(n.nodes(),function(e){var r=n.node(e).rank;if(!y(r))return r}))}function eo(n,e){var r={lhs:[],rhs:[]};return c(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ro(n,e){var r=de();try{return e()}finally{console.log(n+" time: "+(de()-r)+"ms")}}function to(n,e){return e()}function io(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&c(t,e),b(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(u=o,s=!0);var f=A(e.edges(),function(d){return s===me(n,n.node(d.v),u)&&s!==me(n,n.node(d.w),u)});return Yn(f,function(d){return K(e,d)})}function ar(n,e,r,t){var i=r.v,a=r.w;n.removeEdge(i,a),n.setEdge(t.v,t.w,{}),jn(n),Hn(n,e),_o(n,e)}function _o(n,e){var r=kn(n.nodes(),function(i){return!e.node(i).parent}),t=wo(n,r);t=t.slice(1),c(t,function(i){var a=n.node(i).parent,o=e.edge(i,a),u=!1;o||(o=e.edge(a,i),u=!0),e.node(i).rank=e.node(a).rank+(u?o.minlen:-o.minlen)})}function Eo(n,e,r){return n.hasEdge(e,r)}function me(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function yo(n){switch(n.graph().ranker){case"network-simplex":_e(n);break;case"tight-tree":To(n);break;case"longest-path":xo(n);break;default:_e(n)}}var xo=qn;function To(n){qn(n),Qe(n)}function _e(n){M(n)}function Lo(n){var e=k(n,"root",{},"_root"),r=Ao(n),t=S(N(r))-1,i=2*t+1;n.graph().nestingRoot=e,c(n.edges(),function(o){n.edge(o).minlen*=i});var a=No(n)+1;c(n.children(),function(o){or(n,e,i,a,t,r,o)}),n.graph().nodeRankFactor=i}function or(n,e,r,t,i,a,o){var u=n.children(o);if(!u.length){o!==e&&n.setEdge(e,o,{weight:0,minlen:r});return}var s=pe(n,"_bt"),f=pe(n,"_bb"),d=n.node(o);n.setParent(s,o),d.borderTop=s,n.setParent(f,o),d.borderBottom=f,c(u,function(h){or(n,e,r,t,i,a,h);var l=n.node(h),g=l.borderTop?l.borderTop:h,v=l.borderBottom?l.borderBottom:h,p=l.borderTop?t:2*t,m=g!==v?1:i-a[o]+1;n.setEdge(s,g,{weight:p,minlen:m,nestingEdge:!0}),n.setEdge(v,f,{weight:p,minlen:m,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,s,{weight:0,minlen:i+a[o]})}function Ao(n){var e={};function r(t,i){var a=n.children(t);a&&a.length&&c(a,function(o){r(o,i+1)}),e[t]=i}return c(n.children(),function(t){r(t,1)}),e}function No(n){return J(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function Oo(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,c(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function Co(n,e,r){var t={},i;c(r,function(a){for(var o=n.parent(a),u,s;o;){if(u=n.parent(o),u?(s=t[u],t[u]=o):(s=i,i=o),s&&s!==o){e.setEdge(s,o);return}o=u}})}function Io(n,e,r){var t=Po(n),i=new L({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return n.node(a)});return c(n.nodes(),function(a){var o=n.node(a),u=n.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,u||t),c(n[r](a),function(s){var f=s.v===a?s.w:s.v,d=i.edge(f,a),h=y(d)?0:d.weight;i.setEdge(f,a,{weight:n.edge(s).weight+h})}),b(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function Po(n){for(var e;n.hasNode(e=Un("_root")););return e}function $o(n,e){for(var r=0,t=1;t0;)d%2&&(h+=u[d+1]),d=d-1>>1,u[d]+=f.weight;s+=f.weight*h})),s}function Mo(n){var e={},r=A(n.nodes(),function(u){return!n.children(u).length}),t=S(E(r,function(u){return n.node(u).rank})),i=E(D(t+1),function(){return[]});function a(u){if(!b(e,u)){e[u]=!0;var s=n.node(u);i[s.rank].push(u),c(n.successors(u),a)}}var o=Q(r,function(u){return n.node(u).rank});return c(o,a),i}function Ro(n,e){return E(e,function(r){var t=n.inEdges(r);if(t.length){var i=J(t,function(a,o){var u=n.edge(o),s=n.node(o.v);return{sum:a.sum+u.weight*s.order,weight:a.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Fo(n,e){var r={};c(n,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};y(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),c(e.edges(),function(i){var a=r[i.v],o=r[i.w];!y(a)&&!y(o)&&(o.indegree++,a.out.push(r[i.w]))});var t=A(r,function(i){return!i.indegree});return Do(t)}function Do(n){var e=[];function r(a){return function(o){o.merged||(y(o.barycenter)||y(a.barycenter)||o.barycenter>=a.barycenter)&&Go(a,o)}}function t(a){return function(o){o.in.push(a),--o.indegree===0&&n.push(o)}}for(;n.length;){var i=n.pop();e.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return E(A(e,function(a){return!a.merged}),function(a){return sn(a,["vs","i","barycenter","weight"])})}function Go(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}function ko(n,e){var r=eo(n,function(d){return b(d,"barycenter")}),t=r.lhs,i=Q(r.rhs,function(d){return-d.i}),a=[],o=0,u=0,s=0;t.sort(Bo(!!e)),s=Ee(a,i,s),c(t,function(d){s+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,u+=d.weight,s=Ee(a,i,s)});var f={vs:G(a)};return u&&(f.barycenter=o/u,f.weight=u),f}function Ee(n,e,r){for(var t;e.length&&(t=un(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function Bo(n){return function(e,r){return e.barycenterr.barycenter?1:n?r.i-e.i:e.i-r.i}}function ur(n,e,r,t){var i=n.children(e),a=n.node(e),o=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,s={};o&&(i=A(i,function(v){return v!==o&&v!==u}));var f=Ro(n,i);c(f,function(v){if(n.children(v.v).length){var p=ur(n,v.v,r,t);s[v.v]=p,b(p,"barycenter")&&Uo(v,p)}});var d=Fo(f,r);Yo(d,s);var h=ko(d,t);if(o&&(h.vs=G([o,h.vs,u]),n.predecessors(o).length)){var l=n.node(n.predecessors(o)[0]),g=n.node(n.predecessors(u)[0]);b(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+g.order)/(h.weight+2),h.weight+=2}return h}function Yo(n,e){c(n,function(r){r.vs=G(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function Uo(n,e){y(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}function qo(n){var e=Ze(n),r=ye(n,D(1,e+1),"inEdges"),t=ye(n,D(e-1,-1,-1),"outEdges"),i=Mo(n);xe(n,i);for(var a=Number.POSITIVE_INFINITY,o,u=0,s=0;s<4;++u,++s){Ho(u%2?r:t,u%4>=2),i=pn(n);var f=$o(n,i);fo||u>e[s].lim));for(f=s,s=t;(s=n.parent(s))!==f;)a.push(s);return{path:i.concat(a.reverse()),lca:f}}function Ko(n){var e={},r=0;function t(i){var a=r;c(n.children(i),t),e[i]={low:a,lim:r++}}return c(n.children(),t),e}function Xo(n,e){var r={};function t(i,a){var o=0,u=0,s=i.length,f=un(a);return c(a,function(d,h){var l=Zo(n,d),g=l?n.node(l).order:s;(l||d===f)&&(c(a.slice(u,h+1),function(v){c(n.predecessors(v),function(p){var m=n.node(p),_=m.order;(_f)&&sr(r,l,d)})})}function i(a,o){var u=-1,s,f=0;return c(o,function(d,h){if(n.node(d).dummy==="border"){var l=n.predecessors(d);l.length&&(s=n.node(l[0]).order,t(o,f,h,u,s),f=h,u=s)}t(o,f,o.length,s,a.length)}),o}return J(e,i),r}function Zo(n,e){if(n.node(e).dummy)return kn(n.predecessors(e),function(r){return n.node(r).dummy})}function sr(n,e,r){if(e>r){var t=e;e=r,r=t}var i=n[e];i||(n[e]=i={}),i[r]=!0}function Jo(n,e,r){if(e>r){var t=e;e=r,r=t}return b(n[e],r)}function Qo(n,e,r,t){var i={},a={},o={};return c(e,function(u){c(u,function(s,f){i[s]=s,a[s]=s,o[s]=f})}),c(e,function(u){var s=-1;c(u,function(f){var d=t(f);if(d.length){d=Q(d,function(p){return o[p]});for(var h=(d.length-1)/2,l=Math.floor(h),g=Math.ceil(h);l<=g;++l){var v=d[l];a[f]===f&&s