import{d as Un,i as ve,e as Pn,t as rn,f as Xe,g as Ke,U as qn,h as Hn,S as D,k as y,j as ge,l as tn,m as pe,n as Ze,o as Je,p as Qe,q as ze,r as je,s as nr,u as er,a as rr,v as tr,c as ir}from"./_baseSet-db0c20a6.js";import{d as H,e as an,a as Q,j as ar,k as Vn,b as En,c as we,p as ur,i as xn,l as or,S as cn}from"./_getTag-edecb89a.js";import{i as E,a as G,t as sr}from"./toString-25ea340b.js";import{S as z,a as j,b as fr,i as yn}from"./isSymbol-50749e90.js";import{i as un}from"./isObject-32699ff3.js";import{a as dr}from"./parseCss-87ed7353.js";import{al as Wn}from"./intro.stories-976807a0.js";import{t as hr,n as Xn}from"./now-bd49f550.js";var Kn=1/0,lr=17976931348623157e292;function J(n){if(!n)return n===0?n:0;if(n=hr(n),n===Kn||n===-Kn){var e=n<0?-1:1;return e*lr}return n===n?n:0}function cr(n){var e=J(n),r=e%1;return e===e?r?e-r:e:0}function R(n){return n}function vr(n,e,r){switch(r.length){case 0:return n.call(e);case 1:return n.call(e,r[0]);case 2:return n.call(e,r[0],r[1]);case 3:return n.call(e,r[0],r[1],r[2])}return n.apply(e,r)}function gr(){}var pr=800,wr=16,mr=Date.now;function br(n){var e=0,r=0;return function(){var t=mr(),i=wr-(t-r);if(r=t,i>0){if(++e>=pr)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function I(n){return function(){return n}}var _r=Un?function(n,e){return Un(n,"toString",{configurable:!0,enumerable:!1,value:I(e),writable:!0})}:R;const Er=_r;var xr=br(Er);const me=xr;function be(n,e,r,t){for(var i=n.length,a=r+(t?1:-1);t?a--:++a-1}var Zn=Math.max;function _e(n,e,r){return e=Zn(e===void 0?n.length-1:e,0),function(){for(var t=arguments,i=-1,a=Zn(t.length-e,0),u=Array(a);++i1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=n.length>3&&typeof a=="function"?(i--,a):void 0,u&&B(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++t0&&r(o)?e>1?fn(o,e-1,r,t,i):Xe(i,o):t||(i[i.length]=o)}return i}function F(n){var e=n==null?0:n.length;return e?fn(n,1):[]}function Ar(n){return me(_e(n,void 0,F),n+"")}var Rr="[object Object]",Mr=Function.prototype,Ir=Object.prototype,Ee=Mr.toString,Sr=Ir.hasOwnProperty,Fr=Ee.call(Object);function kr(n){if(!j(n)||fr(n)!=Rr)return!1;var e=Ke(n);if(e===null)return!0;var r=Sr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ee.call(r)==Fr}var $r="__lodash_hash_undefined__";function Dr(n){return this.__data__.set(n,$r),this}function Gr(n){return this.__data__.has(n)}function Y(n){var e=-1,r=n==null?0:n.length;for(this.__data__=new ar;++eo))return!1;var f=a.get(n),d=a.get(e);if(f&&d)return f==e&&d==n;var l=-1,c=!0,g=r&Ur?new Y:void 0;for(a.set(n,e),a.set(e,n);++l2?e[2]:void 0;for(i&&B(e[0],e[1],i)&&(t=1);++r-1?i[a?e[u]:u]:void 0}}var Ft=Math.max;function kt(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:cr(r);return i<0&&(i=Ft(t+i,0)),be(n,C(e),i)}var $t=St(kt);const Sn=$t;function Re(n,e){var r=-1,t=H(n)?Array(n.length):[];return dn(n,function(i,a,u){t[++r]=e(i,a,u)}),t}function m(n,e){var r=E(n)?G:Re;return r(n,C(e))}function Dt(n,e){return n==null?n:Rn(n,In(e),tn)}function Gt(n,e){return n&&Mn(n,In(e))}function Bt(n,e){return n>e}var Yt=Object.prototype,Ut=Yt.hasOwnProperty;function qt(n,e){return n!=null&&Ut.call(n,e)}function p(n,e){return n!=null&&Oe(n,e,qt)}function Ht(n,e){return G(e,function(r){return n[r]})}function O(n){return n==null?[]:Ht(n,y(n))}function b(n){return n===void 0}function Me(n,e){return ne||a&&u&&s&&!o&&!f||t&&u&&s||!r&&s||!i)return 1;if(!t&&!a&&!f&&n=o)return s;var f=r[t];return s*(f=="desc"?-1:1)}}return n.index-e.index}function Jt(n,e,r){e.length?e=G(e,function(a){return E(a)?function(u){return sn(u,a.length===1?a[0]:a)}:a}):e=[R];var t=-1;e=G(e,or(C));var i=Re(n,function(a,u,o){var s=G(e,function(f){return f(a)});return{criteria:s,index:++t,value:a}});return Xt(i,function(a,u){return Zt(a,u,r)})}function Qt(n,e){return Wt(n,e,function(r,t){return Ce(n,t)})}var zt=Ar(function(n,e){return n==null?{}:Qt(n,e)});const en=zt;var jt=Math.ceil,ni=Math.max;function ei(n,e,r,t){for(var i=-1,a=ni(jt((e-n)/(r||1)),0),u=Array(a);a--;)u[t?a:++i]=n,n+=r;return u}function ri(n){return function(e,r,t){return t&&typeof t!="number"&&B(e,r,t)&&(r=t=void 0),e=J(e),r===void 0?(r=e,e=0):r=J(r),t=t===void 0?e1&&B(n,e[0],e[1])?e=[]:r>2&&B(e[0],e[1],e[2])&&(e=[e[0]]),Jt(n,fn(e,1),[])});const W=ai;var ui=1/0,oi=cn&&1/Tn(new cn([,-0]))[1]==ui?function(n){return new cn(n)}:gr;const si=oi;var fi=200;function di(n,e,r){var t=-1,i=Or,a=n.length,u=!0,o=[],s=o;if(r)u=!1,i=Mt;else if(a>=fi){var f=e?null:si(n);if(f)return Tn(f);u=!1,i=xe,s=new Y}else s=e?[]:o;n:for(;++t1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return p(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]=T,this._children[e]={},this._children[T][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 p(this._nodes,e)}removeNode(e){var r=this;if(p(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],h(this.children(e),function(i){r.setParent(i)}),delete this._children[e]),h(y(this._in[e]),t),delete this._in[e],delete this._preds[e],h(y(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(b(r))r=T;else{r+="";for(var t=r;!b(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!==T)return r}}children(e){if(b(e)&&(e=T),this._isCompound){var r=this._children[e];if(r)return y(r)}else{if(e===T)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return y(r)}successors(e){var r=this._sucs[e];if(r)return y(r)}neighbors(e){var r=this.predecessors(e);if(r)return li(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;h(this._nodes,function(u,o){e(o)&&r.setNode(o,u)}),h(this._edgeObjs,function(u){r.hasNode(u.v)&&r.hasNode(u.w)&&r.setEdge(u,t.edge(u))});var i={};function a(u){var o=t.parent(u);return o===void 0||r.hasNode(o)?(i[u]=o,o):o in i?i[o]:a(o)}return this._isCompound&&h(r.nodes(),function(u){r.setParent(u,a(u))}),r}setDefaultEdgeLabel(e){return xn(e)||(e=I(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return O(this._edgeObjs)}setPath(e,r){var t=this,i=arguments;return V(e,function(a,u){return i.length>1?t.setEdge(a,u,r):t.setEdge(a,u),u}),this}setEdge(){var e,r,t,i,a=!1,u=arguments[0];typeof u=="object"&&u!==null&&"v"in u?(e=u.v,r=u.w,t=u.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=u,r=arguments[1],t=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,b(t)||(t=""+t);var o=$(this._isDirected,e,r,t);if(p(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!b(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,t);var s=wi(this._isDirected,e,r,t);return e=s.v,r=s.w,Object.freeze(s),this._edgeObjs[o]=s,re(this._preds[r],e),re(this._sucs[e],r),this._in[r][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,r,t){var i=arguments.length===1?gn(this._isDirected,arguments[0]):$(this._isDirected,e,r,t);return this._edgeLabels[i]}hasEdge(e,r,t){var i=arguments.length===1?gn(this._isDirected,arguments[0]):$(this._isDirected,e,r,t);return p(this._edgeLabels,i)}removeEdge(e,r,t){var i=arguments.length===1?gn(this._isDirected,arguments[0]):$(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],te(this._preds[r],e),te(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=O(t);return r?N(i,function(a){return a.v===r}):i}}outEdges(e,r){var t=this._out[e];if(t){var i=O(t);return r?N(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 re(n,e){n[e]?n[e]++:n[e]=1}function te(n,e){--n[e]||delete n[e]}function $(n,e,r,t){var i=""+e,a=""+r;if(!n&&i>a){var u=i;i=a,a=u}return i+ee+a+ee+(b(t)?pi:t)}function wi(n,e,r,t){var i=""+e,a=""+r;if(!n&&i>a){var u=i;i=a,a=u}var o={v:i,w:a};return t&&(o.name=t),o}function gn(n,e){return $(n,e.v,e.w,e.name)}class mi{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return ie(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&ie(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,bi)),t=t._prev;return"["+e.join(", ")+"]"}}function ie(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function bi(n,e){if(n!=="_next"&&n!=="_prev")return e}var _i=I(1);function Ei(n,e){if(n.nodeCount()<=1)return[];var r=yi(n,e||_i),t=xi(r.graph,r.buckets,r.zeroIdx);return F(m(t,function(i){return n.outEdges(i.v,i.w)}))}function xi(n,e,r){for(var t=[],i=e[e.length-1],a=e[0],u;n.nodeCount();){for(;u=a.dequeue();)pn(n,e,r,u);for(;u=i.dequeue();)pn(n,e,r,u);if(n.nodeCount()){for(var o=e.length-2;o>0;--o)if(u=e[o].dequeue(),u){t=t.concat(pn(n,e,r,u,!0));break}}}return t}function pn(n,e,r,t,i){var a=i?[]:void 0;return h(n.inEdges(t.v),function(u){var o=n.edge(u),s=n.node(u.v);i&&a.push({v:u.v,w:u.w}),s.out-=o,Cn(e,r,s)}),h(n.outEdges(t.v),function(u){var o=n.edge(u),s=u.w,f=n.node(s);f.in-=o,Cn(e,r,f)}),n.removeNode(t.v),a}function yi(n,e){var r=new L,t=0,i=0;h(n.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),h(n.edges(),function(o){var s=r.edge(o.v,o.w)||0,f=e(o),d=s+f;r.setEdge(o.v,o.w,d),i=Math.max(i,r.node(o.v).out+=f),t=Math.max(t,r.node(o.w).in+=f)});var a=S(i+t+3).map(function(){return new mi}),u=t+1;return h(r.nodes(),function(o){Cn(a,u,r.node(o))}),{graph:r,buckets:a,zeroIdx:u}}function Cn(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 Li(n){var e=n.graph().acyclicer==="greedy"?Ei(n,r(n)):Ni(n);h(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,$n("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Ni(n){var e=[],r={},t={};function i(a){p(t,a)||(t[a]=!0,r[a]=!0,h(n.outEdges(a),function(u){p(r,u.w)?e.push(u):i(u.w)}),delete r[a])}return h(n.nodes(),i),e}function Oi(n){h(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=$n(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function Ci(n){var e=new L().setGraph(n.graph());return h(n.nodes(),function(r){e.setNode(r,n.node(r))}),h(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 Ie(n){var e=new L({multigraph:n.isMultigraph()}).setGraph(n.graph());return h(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),h(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function ae(n,e){var r=n.x,t=n.y,i=e.x-r,a=e.y-t,u=n.width/2,o=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)*u>Math.abs(i)*o?(a<0&&(o=-o),s=o*i/a,f=o):(i<0&&(u=-u),s=u,f=u*a/i),{x:r+s,y:t+f}}function ln(n){var e=m(S(Se(n)+1),function(){return[]});return h(n.nodes(),function(r){var t=n.node(r),i=t.rank;b(i)||(e[i][t.order]=r)}),e}function Pi(n){var e=U(m(n.nodes(),function(r){return n.node(r).rank}));h(n.nodes(),function(r){var t=n.node(r);p(t,"rank")&&(t.rank-=e)})}function Ti(n){var e=U(m(n.nodes(),function(a){return n.node(a).rank})),r=[];h(n.nodes(),function(a){var u=n.node(a).rank-e;r[u]||(r[u]=[]),r[u].push(a)});var t=0,i=n.graph().nodeRankFactor;h(r,function(a,u){b(a)&&u%i!==0?--t:t&&h(a,function(o){n.node(o).rank+=t})})}function ue(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 Se(n){return A(m(n.nodes(),function(e){var r=n.node(e).rank;if(!b(r))return r}))}function Ai(n,e){var r={lhs:[],rhs:[]};return h(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ri(n,e){var r=Xn();try{return e()}finally{console.log(n+" time: "+(Xn()-r)+"ms")}}function Mi(n,e){return e()}function Ii(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&h(t,e),p(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,u=i.maxRank+1;au.lim&&(o=u,s=!0);var f=N(e.edges(),function(d){return s===fe(n,n.node(d.v),o)&&s!==fe(n,n.node(d.w),o)});return kn(f,function(d){return q(e,d)})}function qe(n,e,r,t){var i=r.v,a=r.w;n.removeEdge(i,a),n.setEdge(t.v,t.w,{}),Bn(n),Gn(n,e),Ki(n,e)}function Ki(n,e){var r=Sn(n.nodes(),function(i){return!e.node(i).parent}),t=Wi(n,r);t=t.slice(1),h(t,function(i){var a=n.node(i).parent,u=e.edge(i,a),o=!1;u||(u=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?u.minlen:-u.minlen)})}function Zi(n,e,r){return n.hasEdge(e,r)}function fe(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Ji(n){switch(n.graph().ranker){case"network-simplex":de(n);break;case"tight-tree":zi(n);break;case"longest-path":Qi(n);break;default:de(n)}}var Qi=Dn;function zi(n){Dn(n),ke(n)}function de(n){M(n)}function ji(n){var e=k(n,"root",{},"_root"),r=na(n),t=A(O(r))-1,i=2*t+1;n.graph().nestingRoot=e,h(n.edges(),function(u){n.edge(u).minlen*=i});var a=ea(n)+1;h(n.children(),function(u){He(n,e,i,a,t,r,u)}),n.graph().nodeRankFactor=i}function He(n,e,r,t,i,a,u){var o=n.children(u);if(!o.length){u!==e&&n.setEdge(e,u,{weight:0,minlen:r});return}var s=ue(n,"_bt"),f=ue(n,"_bb"),d=n.node(u);n.setParent(s,u),d.borderTop=s,n.setParent(f,u),d.borderBottom=f,h(o,function(l){He(n,e,r,t,i,a,l);var c=n.node(l),g=c.borderTop?c.borderTop:l,v=c.borderBottom?c.borderBottom:l,w=c.borderTop?t:2*t,_=g!==v?1:i-a[u]+1;n.setEdge(s,g,{weight:w,minlen:_,nestingEdge:!0}),n.setEdge(v,f,{weight:w,minlen:_,nestingEdge:!0})}),n.parent(u)||n.setEdge(e,s,{weight:0,minlen:i+a[u]})}function na(n){var e={};function r(t,i){var a=n.children(t);a&&a.length&&h(a,function(u){r(u,i+1)}),e[t]=i}return h(n.children(),function(t){r(t,1)}),e}function ea(n){return V(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function ra(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,h(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function ta(n,e,r){var t={},i;h(r,function(a){for(var u=n.parent(a),o,s;u;){if(o=n.parent(u),o?(s=t[o],t[o]=u):(s=i,i=u),s&&s!==u){e.setEdge(s,u);return}u=o}})}function ia(n,e,r){var t=aa(n),i=new L({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return n.node(a)});return h(n.nodes(),function(a){var u=n.node(a),o=n.parent(a);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(i.setNode(a),i.setParent(a,o||t),h(n[r](a),function(s){var f=s.v===a?s.w:s.v,d=i.edge(f,a),l=b(d)?0:d.weight;i.setEdge(f,a,{weight:n.edge(s).weight+l})}),p(u,"minRank")&&i.setNode(a,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))}),i}function aa(n){for(var e;n.hasNode(e=$n("_root")););return e}function ua(n,e){for(var r=0,t=1;t0;)d%2&&(l+=o[d+1]),d=d-1>>1,o[d]+=f.weight;s+=f.weight*l})),s}function sa(n){var e={},r=N(n.nodes(),function(o){return!n.children(o).length}),t=A(m(r,function(o){return n.node(o).rank})),i=m(S(t+1),function(){return[]});function a(o){if(!p(e,o)){e[o]=!0;var s=n.node(o);i[s.rank].push(o),h(n.successors(o),a)}}var u=W(r,function(o){return n.node(o).rank});return h(u,a),i}function fa(n,e){return m(e,function(r){var t=n.inEdges(r);if(t.length){var i=V(t,function(a,u){var o=n.edge(u),s=n.node(u.v);return{sum:a.sum+o.weight*s.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function da(n,e){var r={};h(n,function(i,a){var u=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};b(i.barycenter)||(u.barycenter=i.barycenter,u.weight=i.weight)}),h(e.edges(),function(i){var a=r[i.v],u=r[i.w];!b(a)&&!b(u)&&(u.indegree++,a.out.push(r[i.w]))});var t=N(r,function(i){return!i.indegree});return ha(t)}function ha(n){var e=[];function r(a){return function(u){u.merged||(b(u.barycenter)||b(a.barycenter)||u.barycenter>=a.barycenter)&&la(a,u)}}function t(a){return function(u){u.in.push(a),--u.indegree===0&&n.push(u)}}for(;n.length;){var i=n.pop();e.push(i),h(i.in.reverse(),r(i)),h(i.out,t(i))}return m(N(e,function(a){return!a.merged}),function(a){return en(a,["vs","i","barycenter","weight"])})}function la(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 ca(n,e){var r=Ai(n,function(d){return p(d,"barycenter")}),t=r.lhs,i=W(r.rhs,function(d){return-d.i}),a=[],u=0,o=0,s=0;t.sort(va(!!e)),s=he(a,i,s),h(t,function(d){s+=d.vs.length,a.push(d.vs),u+=d.barycenter*d.weight,o+=d.weight,s=he(a,i,s)});var f={vs:F(a)};return o&&(f.barycenter=u/o,f.weight=o),f}function he(n,e,r){for(var t;e.length&&(t=nn(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function va(n){return function(e,r){return e.barycenterr.barycenter?1:n?r.i-e.i:e.i-r.i}}function Ve(n,e,r,t){var i=n.children(e),a=n.node(e),u=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,s={};u&&(i=N(i,function(v){return v!==u&&v!==o}));var f=fa(n,i);h(f,function(v){if(n.children(v.v).length){var w=Ve(n,v.v,r,t);s[v.v]=w,p(w,"barycenter")&&pa(v,w)}});var d=da(f,r);ga(d,s);var l=ca(d,t);if(u&&(l.vs=F([u,l.vs,o]),n.predecessors(u).length)){var c=n.node(n.predecessors(u)[0]),g=n.node(n.predecessors(o)[0]);p(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+c.order+g.order)/(l.weight+2),l.weight+=2}return l}function ga(n,e){h(n,function(r){r.vs=F(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function pa(n,e){b(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 wa(n){var e=Se(n),r=le(n,S(1,e+1),"inEdges"),t=le(n,S(e-1,-1,-1),"outEdges"),i=sa(n);ce(n,i);for(var a=Number.POSITIVE_INFINITY,u,o=0,s=0;s<4;++o,++s){ma(o%2?r:t,o%4>=2),i=ln(n);var f=ua(n,i);fu||o>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 Ea(n){var e={},r=0;function t(i){var a=r;h(n.children(i),t),e[i]={low:a,lim:r++}}return h(n.children(),t),e}function xa(n,e){var r={};function t(i,a){var u=0,o=0,s=i.length,f=nn(a);return h(a,function(d,l){var c=La(n,d),g=c?n.node(c).order:s;(c||d===f)&&(h(a.slice(o,l+1),function(v){h(n.predecessors(v),function(w){var _=n.node(w),x=_.order;(xf)&&We(r,c,d)})})}function i(a,u){var o=-1,s,f=0;return h(u,function(d,l){if(n.node(d).dummy==="border"){var c=n.predecessors(d);c.length&&(s=n.node(c[0]).order,t(u,f,l,o,s),f=l,o=s)}t(u,f,u.length,s,a.length)}),u}return V(e,i),r}function La(n,e){if(n.node(e).dummy)return Sn(n.predecessors(e),function(r){return n.node(r).dummy})}function We(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 Na(n,e,r){if(e>r){var t=e;e=r,r=t}return p(n[e],r)}function Oa(n,e,r,t){var i={},a={},u={};return h(e,function(o){h(o,function(s,f){i[s]=s,a[s]=s,u[s]=f})}),h(e,function(o){var s=-1;h(o,function(f){var d=t(f);if(d.length){d=W(d,function(w){return u[w]});for(var l=(d.length-1)/2,c=Math.floor(l),g=Math.ceil(l);c<=g;++c){var v=d[c];a[f]===f&&s