@highstate/designer 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BG6GxCJR.js → 8p8hHNKb.js} +1 -1
- package/.output/public/_nuxt/{XDaPkSr7.js → B2yha3tK.js} +1 -1
- package/.output/public/_nuxt/{BbK_ajct.js → BBdd5e-P.js} +1 -1
- package/.output/public/_nuxt/{D3NDyH_4.js → BJCLCDEU.js} +1 -1
- package/.output/public/_nuxt/{Cl5t2I-P.js → BNKpk_J-.js} +1 -1
- package/.output/public/_nuxt/{SDZL1Ln2.js → Cm8RCLWU.js} +1 -1
- package/.output/public/_nuxt/{Deh1XDdt.js → Coaw_UDX.js} +1 -1
- package/.output/public/_nuxt/{DWvcuTbA.js → CrsuDi_R.js} +1 -1
- package/.output/public/_nuxt/{CNdW-337.js → D-6xwGAn.js} +1 -1
- package/.output/public/_nuxt/{JXjzidi6.js → DH0TeGmy.js} +1 -1
- package/.output/public/_nuxt/{wLgi3sdh.js → DOyVva0m.js} +1 -1
- package/.output/public/_nuxt/{C3UGTNZQ.js → Dkp-fog0.js} +1 -1
- package/.output/public/_nuxt/{B9Wk0_zF.js → Dp7F1VOI.js} +1 -1
- package/.output/public/_nuxt/{CrxtFyJB.js → LoOpS6-W.js} +371 -371
- package/.output/public/_nuxt/{tFLxhK-g.js → Ou6kGHs0.js} +1 -1
- package/.output/public/_nuxt/{Eu9bCW6_.js → YKhVXekE.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/1b406212-b25a-4e7f-827b-097f816c087b.json +1 -0
- package/.output/public/_nuxt/{entry.DfmVQ5lK.css → entry.DXDO6kt2.css} +1 -1
- package/.output/public/_nuxt/graph-layout-CVosnvhn.js +1 -0
- package/.output/public/_nuxt/{graph-resolver-CUk_wyie.js → graph-resolver-DGViKqWe.js} +4 -4
- package/.output/public/_nuxt/{C5WOBMna.js → obT3sI9W.js} +1 -1
- package/.output/public/_nuxt/{vj6pa4vE.js → vYowaR43.js} +1 -1
- package/.output/public/_nuxt/{71DWnp3w.js → xqGqC3LV.js} +1 -1
- package/.output/server/index.mjs +1065 -684
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +5 -5
- package/.output/public/_nuxt/builds/meta/fd45206f-e637-4a78-877b-68f5c43246ec.json +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var $,He;function We(){if(He)return $;He=1;var E="\0",b="\0",f="";class d{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(r){r&&(this._isDirected=Object.hasOwn(r,"directed")?r.directed:!0,this._isMultigraph=Object.hasOwn(r,"multigraph")?r.multigraph:!1,this._isCompound=Object.hasOwn(r,"compound")?r.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[b]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(r){return this._label=r,this}graph(){return this._label}setDefaultNodeLabel(r){return this._defaultNodeLabelFn=r,typeof r!="function"&&(this._defaultNodeLabelFn=()=>r),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var r=this;return this.nodes().filter(t=>Object.keys(r._in[t]).length===0)}sinks(){var r=this;return this.nodes().filter(t=>Object.keys(r._out[t]).length===0)}setNodes(r,t){var u=arguments,h=this;return r.forEach(function(w){u.length>1?h.setNode(w,t):h.setNode(w)}),this}setNode(r,t){return Object.hasOwn(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=t),this):(this._nodes[r]=arguments.length>1?t:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=b,this._children[r]={},this._children[b][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)}node(r){return this._nodes[r]}hasNode(r){return Object.hasOwn(this._nodes,r)}removeNode(r){var t=this;if(Object.hasOwn(this._nodes,r)){var u=h=>t.removeEdge(t._edgeObjs[h]);delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],this.children(r).forEach(function(h){t.setParent(h)}),delete this._children[r]),Object.keys(this._in[r]).forEach(u),delete this._in[r],delete this._preds[r],Object.keys(this._out[r]).forEach(u),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this}setParent(r,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=b;else{t+="";for(var u=t;u!==void 0;u=this.parent(u))if(u===r)throw new Error("Setting "+t+" as parent of "+r+" would create a cycle");this.setNode(t)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=t,this._children[t][r]=!0,this}_removeFromParentsChildList(r){delete this._children[this._parent[r]][r]}parent(r){if(this._isCompound){var t=this._parent[r];if(t!==b)return t}}children(r=b){if(this._isCompound){var t=this._children[r];if(t)return Object.keys(t)}else{if(r===b)return this.nodes();if(this.hasNode(r))return[]}}predecessors(r){var t=this._preds[r];if(t)return Object.keys(t)}successors(r){var t=this._sucs[r];if(t)return Object.keys(t)}neighbors(r){var t=this.predecessors(r);if(t){const h=new Set(t);for(var u of this.successors(r))h.add(u);return Array.from(h.values())}}isLeaf(r){var t;return this.isDirected()?t=this.successors(r):t=this.neighbors(r),t.length===0}filterNodes(r){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var u=this;Object.entries(this._nodes).forEach(function([I,c]){r(I)&&t.setNode(I,c)}),Object.values(this._edgeObjs).forEach(function(I){t.hasNode(I.v)&&t.hasNode(I.w)&&t.setEdge(I,u.edge(I))});var h={};function w(I){var c=u.parent(I);return c===void 0||t.hasNode(c)?(h[I]=c,c):c in h?h[c]:w(c)}return this._isCompound&&t.nodes().forEach(I=>t.setParent(I,w(I))),t}setDefaultEdgeLabel(r){return this._defaultEdgeLabelFn=r,typeof r!="function"&&(this._defaultEdgeLabelFn=()=>r),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(r,t){var u=this,h=arguments;return r.reduce(function(w,I){return h.length>1?u.setEdge(w,I,t):u.setEdge(w,I),I}),this}setEdge(){var r,t,u,h,w=!1,I=arguments[0];typeof I=="object"&&I!==null&&"v"in I?(r=I.v,t=I.w,u=I.name,arguments.length===2&&(h=arguments[1],w=!0)):(r=I,t=arguments[1],u=arguments[3],arguments.length>2&&(h=arguments[2],w=!0)),r=""+r,t=""+t,u!==void 0&&(u=""+u);var c=e(this._isDirected,r,t,u);if(Object.hasOwn(this._edgeLabels,c))return w&&(this._edgeLabels[c]=h),this;if(u!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(t),this._edgeLabels[c]=w?h:this._defaultEdgeLabelFn(r,t,u);var O=o(this._isDirected,r,t,u);return r=O.v,t=O.w,Object.freeze(O),this._edgeObjs[c]=O,a(this._preds[t],r),a(this._sucs[r],t),this._in[t][c]=O,this._out[r][c]=O,this._edgeCount++,this}edge(r,t,u){var h=arguments.length===1?n(this._isDirected,arguments[0]):e(this._isDirected,r,t,u);return this._edgeLabels[h]}edgeAsObj(){const r=this.edge(...arguments);return typeof r!="object"?{label:r}:r}hasEdge(r,t,u){var h=arguments.length===1?n(this._isDirected,arguments[0]):e(this._isDirected,r,t,u);return Object.hasOwn(this._edgeLabels,h)}removeEdge(r,t,u){var h=arguments.length===1?n(this._isDirected,arguments[0]):e(this._isDirected,r,t,u),w=this._edgeObjs[h];return w&&(r=w.v,t=w.w,delete this._edgeLabels[h],delete this._edgeObjs[h],i(this._preds[t],r),i(this._sucs[r],t),delete this._in[t][h],delete this._out[r][h],this._edgeCount--),this}inEdges(r,t){var u=this._in[r];if(u){var h=Object.values(u);return t?h.filter(w=>w.v===t):h}}outEdges(r,t){var u=this._out[r];if(u){var h=Object.values(u);return t?h.filter(w=>w.w===t):h}}nodeEdges(r,t){var u=this.inEdges(r,t);if(u)return u.concat(this.outEdges(r,t))}}function a(s,r){s[r]?s[r]++:s[r]=1}function i(s,r){--s[r]||delete s[r]}function e(s,r,t,u){var h=""+r,w=""+t;if(!s&&h>w){var I=h;h=w,w=I}return h+f+w+f+(u===void 0?E:u)}function o(s,r,t,u){var h=""+r,w=""+t;if(!s&&h>w){var I=h;h=w,w=I}var c={v:h,w};return u&&(c.name=u),c}function n(s,r){return e(s,r.v,r.w,r.name)}return $=d,$}var J,Xe;function $r(){return Xe||(Xe=1,J="2.2.4"),J}var K,Qe;function Jr(){return Qe||(Qe=1,K={Graph:We(),version:$r()}),K}var Z,$e;function Kr(){if($e)return Z;$e=1;var E=We();Z={write:b,read:a};function b(i){var e={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:f(i),edges:d(i)};return i.graph()!==void 0&&(e.value=structuredClone(i.graph())),e}function f(i){return i.nodes().map(function(e){var o=i.node(e),n=i.parent(e),s={v:e};return o!==void 0&&(s.value=o),n!==void 0&&(s.parent=n),s})}function d(i){return i.edges().map(function(e){var o=i.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),o!==void 0&&(n.value=o),n})}function a(i){var e=new E(i.options).setGraph(i.value);return i.nodes.forEach(function(o){e.setNode(o.v,o.value),o.parent&&e.setParent(o.v,o.parent)}),i.edges.forEach(function(o){e.setEdge({v:o.v,w:o.w,name:o.name},o.value)}),e}return Z}var ee,Je;function Zr(){if(Je)return ee;Je=1,ee=E;function E(b){var f={},d=[],a;function i(e){Object.hasOwn(f,e)||(f[e]=!0,a.push(e),b.successors(e).forEach(i),b.predecessors(e).forEach(i))}return b.nodes().forEach(function(e){a=[],i(e),a.length&&d.push(a)}),d}return ee}var re,Ke;function Vr(){if(Ke)return re;Ke=1;class E{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(f){return f.key})}has(f){return Object.hasOwn(this._keyIndices,f)}priority(f){var d=this._keyIndices[f];if(d!==void 0)return this._arr[d].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(f,d){var a=this._keyIndices;if(f=String(f),!Object.hasOwn(a,f)){var i=this._arr,e=i.length;return a[f]=e,i.push({key:f,priority:d}),this._decrease(e),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var f=this._arr.pop();return delete this._keyIndices[f.key],this._heapify(0),f.key}decrease(f,d){var a=this._keyIndices[f];if(d>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+f+" Old: "+this._arr[a].priority+" New: "+d);this._arr[a].priority=d,this._decrease(a)}_heapify(f){var d=this._arr,a=2*f,i=a+1,e=f;a<d.length&&(e=d[a].priority<d[e].priority?a:e,i<d.length&&(e=d[i].priority<d[e].priority?i:e),e!==f&&(this._swap(f,e),this._heapify(e)))}_decrease(f){for(var d=this._arr,a=d[f].priority,i;f!==0&&(i=f>>1,!(d[i].priority<a));)this._swap(f,i),f=i}_swap(f,d){var a=this._arr,i=this._keyIndices,e=a[f],o=a[d];a[f]=o,a[d]=e,i[o.key]=f,i[e.key]=d}}return re=E,re}var te,Ze;function Br(){if(Ze)return te;Ze=1;var E=Vr();te=f;var b=()=>1;function f(a,i,e,o){return d(a,String(i),e||b,o||function(n){return a.outEdges(n)})}function d(a,i,e,o){var n={},s=new E,r,t,u=function(h){var w=h.v!==r?h.v:h.w,I=n[w],c=e(h),O=t.distance+c;if(c<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+h+" Weight: "+c);O<I.distance&&(I.distance=O,I.predecessor=r,s.decrease(w,O))};for(a.nodes().forEach(function(h){var w=h===i?0:Number.POSITIVE_INFINITY;n[h]={distance:w},s.add(h,w)});s.size()>0&&(r=s.removeMin(),t=n[r],t.distance!==Number.POSITIVE_INFINITY);)o(r).forEach(u);return n}return te}var ne,er;function et(){if(er)return ne;er=1;var E=Br();ne=b;function b(f,d,a){return f.nodes().reduce(function(i,e){return i[e]=E(f,e,d,a),i},{})}return ne}var ie,rr;function Wr(){if(rr)return ie;rr=1,ie=E;function E(b){var f=0,d=[],a={},i=[];function e(o){var n=a[o]={onStack:!0,lowlink:f,index:f++};if(d.push(o),b.successors(o).forEach(function(t){Object.hasOwn(a,t)?a[t].onStack&&(n.lowlink=Math.min(n.lowlink,a[t].index)):(e(t),n.lowlink=Math.min(n.lowlink,a[t].lowlink))}),n.lowlink===n.index){var s=[],r;do r=d.pop(),a[r].onStack=!1,s.push(r);while(o!==r);i.push(s)}}return b.nodes().forEach(function(o){Object.hasOwn(a,o)||e(o)}),i}return ie}var ae,tr;function rt(){if(tr)return ae;tr=1;var E=Wr();ae=b;function b(f){return E(f).filter(function(d){return d.length>1||d.length===1&&f.hasEdge(d[0],d[0])})}return ae}var se,nr;function tt(){if(nr)return se;nr=1,se=b;var E=()=>1;function b(d,a,i){return f(d,a||E,i||function(e){return d.outEdges(e)})}function f(d,a,i){var e={},o=d.nodes();return o.forEach(function(n){e[n]={},e[n][n]={distance:0},o.forEach(function(s){n!==s&&(e[n][s]={distance:Number.POSITIVE_INFINITY})}),i(n).forEach(function(s){var r=s.v===n?s.w:s.v,t=a(s);e[n][r]={distance:t,predecessor:n}})}),o.forEach(function(n){var s=e[n];o.forEach(function(r){var t=e[r];o.forEach(function(u){var h=t[n],w=s[u],I=t[u],c=h.distance+w.distance;c<I.distance&&(I.distance=c,I.predecessor=w.predecessor)})})}),e}return se}var oe,ir;function Yr(){if(ir)return oe;ir=1;function E(f){var d={},a={},i=[];function e(o){if(Object.hasOwn(a,o))throw new b;Object.hasOwn(d,o)||(a[o]=!0,d[o]=!0,f.predecessors(o).forEach(e),delete a[o],i.push(o))}if(f.sinks().forEach(e),Object.keys(d).length!==f.nodeCount())throw new b;return i}class b extends Error{constructor(){super(...arguments)}}return oe=E,E.CycleException=b,oe}var de,ar;function nt(){if(ar)return de;ar=1;var E=Yr();de=b;function b(f){try{E(f)}catch(d){if(d instanceof E.CycleException)return!1;throw d}return!0}return de}var ue,sr;function zr(){if(sr)return ue;sr=1,ue=E;function E(a,i,e){Array.isArray(i)||(i=[i]);var o=a.isDirected()?t=>a.successors(t):t=>a.neighbors(t),n=e==="post"?b:f,s=[],r={};return i.forEach(t=>{if(!a.hasNode(t))throw new Error("Graph does not have node: "+t);n(t,o,r,s)}),s}function b(a,i,e,o){for(var n=[[a,!1]];n.length>0;){var s=n.pop();s[1]?o.push(s[0]):Object.hasOwn(e,s[0])||(e[s[0]]=!0,n.push([s[0],!0]),d(i(s[0]),r=>n.push([r,!1])))}}function f(a,i,e,o){for(var n=[a];n.length>0;){var s=n.pop();Object.hasOwn(e,s)||(e[s]=!0,o.push(s),d(i(s),r=>n.push(r)))}}function d(a,i){for(var e=a.length;e--;)i(a[e],e,a);return a}return ue}var le,or;function it(){if(or)return le;or=1;var E=zr();le=b;function b(f,d){return E(f,d,"post")}return le}var he,dr;function at(){if(dr)return he;dr=1;var E=zr();he=b;function b(f,d){return E(f,d,"pre")}return he}var fe,ur;function st(){if(ur)return fe;ur=1;var E=We(),b=Vr();fe=f;function f(d,a){var i=new E,e={},o=new b,n;function s(t){var u=t.v===n?t.w:t.v,h=o.priority(u);if(h!==void 0){var w=a(t);w<h&&(e[u]=n,o.decrease(u,w))}}if(d.nodeCount()===0)return i;d.nodes().forEach(function(t){o.add(t,Number.POSITIVE_INFINITY),i.setNode(t)}),o.decrease(d.nodes()[0],0);for(var r=!1;o.size()>0;){if(n=o.removeMin(),Object.hasOwn(e,n))i.setEdge(n,e[n]);else{if(r)throw new Error("Input graph is not connected: "+d);r=!0}d.nodeEdges(n).forEach(s)}return i}return fe}var ce,lr;function ot(){return lr||(lr=1,ce={components:Zr(),dijkstra:Br(),dijkstraAll:et(),findCycles:rt(),floydWarshall:tt(),isAcyclic:nt(),postorder:it(),preorder:at(),prim:st(),tarjan:Wr(),topsort:Yr()}),ce}var pe,hr;function W(){if(hr)return pe;hr=1;var E=Jr();return pe={Graph:E.Graph,json:Kr(),alg:ot(),version:E.version},pe}var me,fr;function dt(){if(fr)return me;fr=1;class E{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,i=a._prev;if(i!==a)return b(i),i}enqueue(a){let i=this._sentinel;a._prev&&a._next&&b(a),a._next=i._next,i._next._prev=a,i._next=a,a._prev=i}toString(){let a=[],i=this._sentinel,e=i._prev;for(;e!==i;)a.push(JSON.stringify(e,f)),e=e._prev;return"["+a.join(", ")+"]"}}function b(d){d._prev._next=d._next,d._next._prev=d._prev,delete d._next,delete d._prev}function f(d,a){if(d!=="_next"&&d!=="_prev")return a}return me=E,me}var be,cr;function ut(){if(cr)return be;cr=1;let E=W().Graph,b=dt();be=d;let f=()=>1;function d(s,r){if(s.nodeCount()<=1)return[];let t=e(s,r||f);return a(t.graph,t.buckets,t.zeroIdx).flatMap(h=>s.outEdges(h.v,h.w))}function a(s,r,t){let u=[],h=r[r.length-1],w=r[0],I;for(;s.nodeCount();){for(;I=w.dequeue();)i(s,r,t,I);for(;I=h.dequeue();)i(s,r,t,I);if(s.nodeCount()){for(let c=r.length-2;c>0;--c)if(I=r[c].dequeue(),I){u=u.concat(i(s,r,t,I,!0));break}}}return u}function i(s,r,t,u,h){let w=h?[]:void 0;return s.inEdges(u.v).forEach(I=>{let c=s.edge(I),O=s.node(I.v);h&&w.push({v:I.v,w:I.w}),O.out-=c,o(r,t,O)}),s.outEdges(u.v).forEach(I=>{let c=s.edge(I),O=I.w,p=s.node(O);p.in-=c,o(r,t,p)}),s.removeNode(u.v),w}function e(s,r){let t=new E,u=0,h=0;s.nodes().forEach(c=>{t.setNode(c,{v:c,in:0,out:0})}),s.edges().forEach(c=>{let O=t.edge(c.v,c.w)||0,p=r(c),k=O+p;t.setEdge(c.v,c.w,k),h=Math.max(h,t.node(c.v).out+=p),u=Math.max(u,t.node(c.w).in+=p)});let w=n(h+u+3).map(()=>new b),I=u+1;return t.nodes().forEach(c=>{o(w,I,t.node(c))}),{graph:t,buckets:w,zeroIdx:I}}function o(s,r,t){t.out?t.in?s[t.out-t.in+r].enqueue(t):s[s.length-1].enqueue(t):s[0].enqueue(t)}function n(s){const r=[];for(let t=0;t<s;t++)r.push(t);return r}return be}var ve,pr;function F(){if(pr)return ve;pr=1;let E=W().Graph;ve={addBorderNode:r,addDummyNode:b,applyWithChunking:h,asNonCompoundGraph:d,buildLayerMatrix:o,intersectRect:e,mapValues:j,maxRank:w,normalizeRanks:n,notime:O,partition:I,pick:R,predecessorWeights:i,range:C,removeEmptyRanks:s,simplify:f,successorWeights:a,time:c,uniqueId:k,zipObject:L};function b(l,m,g,y){let x;do x=k(y);while(l.hasNode(x));return g.dummy=m,l.setNode(x,g),x}function f(l){let m=new E().setGraph(l.graph());return l.nodes().forEach(g=>m.setNode(g,l.node(g))),l.edges().forEach(g=>{let y=m.edge(g.v,g.w)||{weight:0,minlen:1},x=l.edge(g);m.setEdge(g.v,g.w,{weight:y.weight+x.weight,minlen:Math.max(y.minlen,x.minlen)})}),m}function d(l){let m=new E({multigraph:l.isMultigraph()}).setGraph(l.graph());return l.nodes().forEach(g=>{l.children(g).length||m.setNode(g,l.node(g))}),l.edges().forEach(g=>{m.setEdge(g,l.edge(g))}),m}function a(l){let m=l.nodes().map(g=>{let y={};return l.outEdges(g).forEach(x=>{y[x.w]=(y[x.w]||0)+l.edge(x).weight}),y});return L(l.nodes(),m)}function i(l){let m=l.nodes().map(g=>{let y={};return l.inEdges(g).forEach(x=>{y[x.v]=(y[x.v]||0)+l.edge(x).weight}),y});return L(l.nodes(),m)}function e(l,m){let g=l.x,y=l.y,x=m.x-g,T=m.y-y,S=l.width/2,G=l.height/2;if(!x&&!T)throw new Error("Not possible to find intersection inside of the rectangle");let Y,z;return Math.abs(T)*S>Math.abs(x)*G?(T<0&&(G=-G),Y=G*x/T,z=G):(x<0&&(S=-S),Y=S,z=S*T/x),{x:g+Y,y:y+z}}function o(l){let m=C(w(l)+1).map(()=>[]);return l.nodes().forEach(g=>{let y=l.node(g),x=y.rank;x!==void 0&&(m[x][y.order]=g)}),m}function n(l){let m=l.nodes().map(y=>{let x=l.node(y).rank;return x===void 0?Number.MAX_VALUE:x}),g=h(Math.min,m);l.nodes().forEach(y=>{let x=l.node(y);Object.hasOwn(x,"rank")&&(x.rank-=g)})}function s(l){let m=l.nodes().map(S=>l.node(S).rank),g=h(Math.min,m),y=[];l.nodes().forEach(S=>{let G=l.node(S).rank-g;y[G]||(y[G]=[]),y[G].push(S)});let x=0,T=l.graph().nodeRankFactor;Array.from(y).forEach((S,G)=>{S===void 0&&G%T!==0?--x:S!==void 0&&x&&S.forEach(Y=>l.node(Y).rank+=x)})}function r(l,m,g,y){let x={width:0,height:0};return arguments.length>=4&&(x.rank=g,x.order=y),b(l,"border",x,m)}function t(l,m=u){const g=[];for(let y=0;y<l.length;y+=m){const x=l.slice(y,y+m);g.push(x)}return g}const u=65535;function h(l,m){if(m.length>u){const g=t(m);return l.apply(null,g.map(y=>l.apply(null,y)))}else return l.apply(null,m)}function w(l){const g=l.nodes().map(y=>{let x=l.node(y).rank;return x===void 0?Number.MIN_VALUE:x});return h(Math.max,g)}function I(l,m){let g={lhs:[],rhs:[]};return l.forEach(y=>{m(y)?g.lhs.push(y):g.rhs.push(y)}),g}function c(l,m){let g=Date.now();try{return m()}finally{console.log(l+" time: "+(Date.now()-g)+"ms")}}function O(l,m){return m()}let p=0;function k(l){var m=++p;return toString(l)+m}function C(l,m,g=1){m==null&&(m=l,l=0);let y=T=>T<m;g<0&&(y=T=>m<T);const x=[];for(let T=l;y(T);T+=g)x.push(T);return x}function R(l,m){const g={};for(const y of m)l[y]!==void 0&&(g[y]=l[y]);return g}function j(l,m){let g=m;return typeof m=="string"&&(g=y=>y[m]),Object.entries(l).reduce((y,[x,T])=>(y[x]=g(T,x),y),{})}function L(l,m){return l.reduce((g,y,x)=>(g[y]=m[x],g),{})}return ve}var we,mr;function lt(){if(mr)return we;mr=1;let E=ut(),b=F().uniqueId;we={run:f,undo:a};function f(i){(i.graph().acyclicer==="greedy"?E(i,o(i)):d(i)).forEach(n=>{let s=i.edge(n);i.removeEdge(n),s.forwardName=n.name,s.reversed=!0,i.setEdge(n.w,n.v,s,b("rev"))});function o(n){return s=>n.edge(s).weight}}function d(i){let e=[],o={},n={};function s(r){Object.hasOwn(n,r)||(n[r]=!0,o[r]=!0,i.outEdges(r).forEach(t=>{Object.hasOwn(o,t.w)?e.push(t):s(t.w)}),delete o[r])}return i.nodes().forEach(s),e}function a(i){i.edges().forEach(e=>{let o=i.edge(e);if(o.reversed){i.removeEdge(e);let n=o.forwardName;delete o.reversed,delete o.forwardName,i.setEdge(e.w,e.v,o,n)}})}return we}var ge,br;function ht(){if(br)return ge;br=1;let E=F();ge={run:b,undo:d};function b(a){a.graph().dummyChains=[],a.edges().forEach(i=>f(a,i))}function f(a,i){let e=i.v,o=a.node(e).rank,n=i.w,s=a.node(n).rank,r=i.name,t=a.edge(i),u=t.labelRank;if(s===o+1)return;a.removeEdge(i);let h,w,I;for(I=0,++o;o<s;++I,++o)t.points=[],w={width:0,height:0,edgeLabel:t,edgeObj:i,rank:o},h=E.addDummyNode(a,"edge",w,"_d"),o===u&&(w.width=t.width,w.height=t.height,w.dummy="edge-label",w.labelpos=t.labelpos),a.setEdge(e,h,{weight:t.weight},r),I===0&&a.graph().dummyChains.push(h),e=h;a.setEdge(e,n,{weight:t.weight},r)}function d(a){a.graph().dummyChains.forEach(i=>{let e=a.node(i),o=e.edgeLabel,n;for(a.setEdge(e.edgeObj,o);e.dummy;)n=a.successors(i)[0],a.removeNode(i),o.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(o.x=e.x,o.y=e.y,o.width=e.width,o.height=e.height),i=n,e=a.node(i)})}return ge}var Ee,vr;function H(){if(vr)return Ee;vr=1;const{applyWithChunking:E}=F();Ee={longestPath:b,slack:f};function b(d){var a={};function i(e){var o=d.node(e);if(Object.hasOwn(a,e))return o.rank;a[e]=!0;let n=d.outEdges(e).map(r=>r==null?Number.POSITIVE_INFINITY:i(r.w)-d.edge(r).minlen);var s=E(Math.min,n);return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}d.sources().forEach(i)}function f(d,a){return d.node(a.w).rank-d.node(a.v).rank-d.edge(a).minlen}return Ee}var _e,wr;function Ur(){if(wr)return _e;wr=1;var E=W().Graph,b=H().slack;_e=f;function f(e){var o=new E({directed:!1}),n=e.nodes()[0],s=e.nodeCount();o.setNode(n,{});for(var r,t;d(o,e)<s;)r=a(o,e),t=o.hasNode(r.v)?b(e,r):-b(e,r),i(o,e,t);return o}function d(e,o){function n(s){o.nodeEdges(s).forEach(r=>{var t=r.v,u=s===t?r.w:t;!e.hasNode(u)&&!b(o,r)&&(e.setNode(u,{}),e.setEdge(s,u,{}),n(u))})}return e.nodes().forEach(n),e.nodeCount()}function a(e,o){return o.edges().reduce((s,r)=>{let t=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(t=b(o,r)),t<s[0]?[t,r]:s},[Number.POSITIVE_INFINITY,null])[1]}function i(e,o,n){e.nodes().forEach(s=>o.node(s).rank+=n)}return _e}var ye,gr;function ft(){if(gr)return ye;gr=1;var E=Ur(),b=H().slack,f=H().longestPath,d=W().alg.preorder,a=W().alg.postorder,i=F().simplify;ye=e,e.initLowLimValues=r,e.initCutValues=o,e.calcCutValue=s,e.leaveEdge=u,e.enterEdge=h,e.exchangeEdges=w;function e(p){p=i(p),f(p);var k=E(p);r(k),o(k,p);for(var C,R;C=u(k);)R=h(k,p,C),w(k,p,C,R)}function o(p,k){var C=a(p,p.nodes());C=C.slice(0,C.length-1),C.forEach(R=>n(p,k,R))}function n(p,k,C){var R=p.node(C),j=R.parent;p.edge(C,j).cutvalue=s(p,k,C)}function s(p,k,C){var R=p.node(C),j=R.parent,L=!0,l=k.edge(C,j),m=0;return l||(L=!1,l=k.edge(j,C)),m=l.weight,k.nodeEdges(C).forEach(g=>{var y=g.v===C,x=y?g.w:g.v;if(x!==j){var T=y===L,S=k.edge(g).weight;if(m+=T?S:-S,c(p,C,x)){var G=p.edge(C,x).cutvalue;m+=T?-G:G}}}),m}function r(p,k){arguments.length<2&&(k=p.nodes()[0]),t(p,{},1,k)}function t(p,k,C,R,j){var L=C,l=p.node(R);return k[R]=!0,p.neighbors(R).forEach(m=>{Object.hasOwn(k,m)||(C=t(p,k,C,m,R))}),l.low=L,l.lim=C++,j?l.parent=j:delete l.parent,C}function u(p){return p.edges().find(k=>p.edge(k).cutvalue<0)}function h(p,k,C){var R=C.v,j=C.w;k.hasEdge(R,j)||(R=C.w,j=C.v);var L=p.node(R),l=p.node(j),m=L,g=!1;L.lim>l.lim&&(m=l,g=!0);var y=k.edges().filter(x=>g===O(p,p.node(x.v),m)&&g!==O(p,p.node(x.w),m));return y.reduce((x,T)=>b(k,T)<b(k,x)?T:x)}function w(p,k,C,R){var j=C.v,L=C.w;p.removeEdge(j,L),p.setEdge(R.v,R.w,{}),r(p),o(p,k),I(p,k)}function I(p,k){var C=p.nodes().find(j=>!k.node(j).parent),R=d(p,C);R=R.slice(1),R.forEach(j=>{var L=p.node(j).parent,l=k.edge(j,L),m=!1;l||(l=k.edge(L,j),m=!0),k.node(j).rank=k.node(L).rank+(m?l.minlen:-l.minlen)})}function c(p,k,C){return p.hasEdge(k,C)}function O(p,k,C){return C.low<=k.lim&&k.lim<=C.lim}return ye}var ke,Er;function ct(){if(Er)return ke;Er=1;var E=H(),b=E.longestPath,f=Ur(),d=ft();ke=a;function a(n){switch(n.graph().ranker){case"network-simplex":o(n);break;case"tight-tree":e(n);break;case"longest-path":i(n);break;default:o(n)}}var i=b;function e(n){b(n),f(n)}function o(n){d(n)}return ke}var Oe,_r;function pt(){if(_r)return Oe;_r=1,Oe=E;function E(d){let a=f(d);d.graph().dummyChains.forEach(i=>{let e=d.node(i),o=e.edgeObj,n=b(d,a,o.v,o.w),s=n.path,r=n.lca,t=0,u=s[t],h=!0;for(;i!==o.w;){if(e=d.node(i),h){for(;(u=s[t])!==r&&d.node(u).maxRank<e.rank;)t++;u===r&&(h=!1)}if(!h){for(;t<s.length-1&&d.node(u=s[t+1]).minRank<=e.rank;)t++;u=s[t]}d.setParent(i,u),i=d.successors(i)[0]}})}function b(d,a,i,e){let o=[],n=[],s=Math.min(a[i].low,a[e].low),r=Math.max(a[i].lim,a[e].lim),t,u;t=i;do t=d.parent(t),o.push(t);while(t&&(a[t].low>s||r>a[t].lim));for(u=t,t=e;(t=d.parent(t))!==u;)n.push(t);return{path:o.concat(n.reverse()),lca:u}}function f(d){let a={},i=0;function e(o){let n=i;d.children(o).forEach(e),a[o]={low:n,lim:i++}}return d.children().forEach(e),a}return Oe}var Ne,yr;function mt(){if(yr)return Ne;yr=1;let E=F();Ne={run:b,cleanup:i};function b(e){let o=E.addDummyNode(e,"root",{},"_root"),n=d(e),s=Object.values(n),r=E.applyWithChunking(Math.max,s)-1,t=2*r+1;e.graph().nestingRoot=o,e.edges().forEach(h=>e.edge(h).minlen*=t);let u=a(e)+1;e.children().forEach(h=>f(e,o,t,u,r,n,h)),e.graph().nodeRankFactor=t}function f(e,o,n,s,r,t,u){let h=e.children(u);if(!h.length){u!==o&&e.setEdge(o,u,{weight:0,minlen:n});return}let w=E.addBorderNode(e,"_bt"),I=E.addBorderNode(e,"_bb"),c=e.node(u);e.setParent(w,u),c.borderTop=w,e.setParent(I,u),c.borderBottom=I,h.forEach(O=>{f(e,o,n,s,r,t,O);let p=e.node(O),k=p.borderTop?p.borderTop:O,C=p.borderBottom?p.borderBottom:O,R=p.borderTop?s:2*s,j=k!==C?1:r-t[u]+1;e.setEdge(w,k,{weight:R,minlen:j,nestingEdge:!0}),e.setEdge(C,I,{weight:R,minlen:j,nestingEdge:!0})}),e.parent(u)||e.setEdge(o,w,{weight:0,minlen:r+t[u]})}function d(e){var o={};function n(s,r){var t=e.children(s);t&&t.length&&t.forEach(u=>n(u,r+1)),o[s]=r}return e.children().forEach(s=>n(s,1)),o}function a(e){return e.edges().reduce((o,n)=>o+e.edge(n).weight,0)}function i(e){var o=e.graph();e.removeNode(o.nestingRoot),delete o.nestingRoot,e.edges().forEach(n=>{var s=e.edge(n);s.nestingEdge&&e.removeEdge(n)})}return Ne}var Ce,kr;function bt(){if(kr)return Ce;kr=1;let E=F();Ce=b;function b(d){function a(i){let e=d.children(i),o=d.node(i);if(e.length&&e.forEach(a),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let n=o.minRank,s=o.maxRank+1;n<s;++n)f(d,"borderLeft","_bl",i,o,n),f(d,"borderRight","_br",i,o,n)}}d.children().forEach(a)}function f(d,a,i,e,o,n){let s={width:0,height:0,rank:n,borderType:a},r=o[a][n-1],t=E.addDummyNode(d,"border",s,i);o[a][n]=t,d.setParent(t,e),r&&d.setEdge(r,t,{weight:1})}return Ce}var xe,Or;function vt(){if(Or)return xe;Or=1,xe={adjust:E,undo:b};function E(n){let s=n.graph().rankdir.toLowerCase();(s==="lr"||s==="rl")&&f(n)}function b(n){let s=n.graph().rankdir.toLowerCase();(s==="bt"||s==="rl")&&a(n),(s==="lr"||s==="rl")&&(e(n),f(n))}function f(n){n.nodes().forEach(s=>d(n.node(s))),n.edges().forEach(s=>d(n.edge(s)))}function d(n){let s=n.width;n.width=n.height,n.height=s}function a(n){n.nodes().forEach(s=>i(n.node(s))),n.edges().forEach(s=>{let r=n.edge(s);r.points.forEach(i),Object.hasOwn(r,"y")&&i(r)})}function i(n){n.y=-n.y}function e(n){n.nodes().forEach(s=>o(n.node(s))),n.edges().forEach(s=>{let r=n.edge(s);r.points.forEach(o),Object.hasOwn(r,"x")&&o(r)})}function o(n){let s=n.x;n.x=n.y,n.y=s}return xe}var Ie,Nr;function wt(){if(Nr)return Ie;Nr=1;let E=F();Ie=b;function b(f){let d={},a=f.nodes().filter(r=>!f.children(r).length),i=a.map(r=>f.node(r).rank),e=E.applyWithChunking(Math.max,i),o=E.range(e+1).map(()=>[]);function n(r){if(d[r])return;d[r]=!0;let t=f.node(r);o[t.rank].push(r),f.successors(r).forEach(n)}return a.sort((r,t)=>f.node(r).rank-f.node(t).rank).forEach(n),o}return Ie}var Re,Cr;function gt(){if(Cr)return Re;Cr=1;let E=F().zipObject;Re=b;function b(d,a){let i=0;for(let e=1;e<a.length;++e)i+=f(d,a[e-1],a[e]);return i}function f(d,a,i){let e=E(i,i.map((u,h)=>h)),o=a.flatMap(u=>d.outEdges(u).map(h=>({pos:e[h.w],weight:d.edge(h).weight})).sort((h,w)=>h.pos-w.pos)),n=1;for(;n<i.length;)n<<=1;let s=2*n-1;n-=1;let r=new Array(s).fill(0),t=0;return o.forEach(u=>{let h=u.pos+n;r[h]+=u.weight;let w=0;for(;h>0;)h%2&&(w+=r[h+1]),h=h-1>>1,r[h]+=u.weight;t+=u.weight*w}),t}return Re}var je,xr;function Et(){if(xr)return je;xr=1,je=E;function E(b,f=[]){return f.map(d=>{let a=b.inEdges(d);if(a.length){let i=a.reduce((e,o)=>{let n=b.edge(o),s=b.node(o.v);return{sum:e.sum+n.weight*s.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:d,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:d}})}return je}var qe,Ir;function _t(){if(Ir)return qe;Ir=1;let E=F();qe=b;function b(a,i){let e={};a.forEach((n,s)=>{let r=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:s};n.barycenter!==void 0&&(r.barycenter=n.barycenter,r.weight=n.weight)}),i.edges().forEach(n=>{let s=e[n.v],r=e[n.w];s!==void 0&&r!==void 0&&(r.indegree++,s.out.push(e[n.w]))});let o=Object.values(e).filter(n=>!n.indegree);return f(o)}function f(a){let i=[];function e(n){return s=>{s.merged||(s.barycenter===void 0||n.barycenter===void 0||s.barycenter>=n.barycenter)&&d(n,s)}}function o(n){return s=>{s.in.push(n),--s.indegree===0&&a.push(s)}}for(;a.length;){let n=a.pop();i.push(n),n.in.reverse().forEach(e(n)),n.out.forEach(o(n))}return i.filter(n=>!n.merged).map(n=>E.pick(n,["vs","i","barycenter","weight"]))}function d(a,i){let e=0,o=0;a.weight&&(e+=a.barycenter*a.weight,o+=a.weight),i.weight&&(e+=i.barycenter*i.weight,o+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=e/o,a.weight=o,a.i=Math.min(i.i,a.i),i.merged=!0}return qe}var Le,Rr;function yt(){if(Rr)return Le;Rr=1;let E=F();Le=b;function b(a,i){let e=E.partition(a,w=>Object.hasOwn(w,"barycenter")),o=e.lhs,n=e.rhs.sort((w,I)=>I.i-w.i),s=[],r=0,t=0,u=0;o.sort(d(!!i)),u=f(s,n,u),o.forEach(w=>{u+=w.vs.length,s.push(w.vs),r+=w.barycenter*w.weight,t+=w.weight,u=f(s,n,u)});let h={vs:s.flat(!0)};return t&&(h.barycenter=r/t,h.weight=t),h}function f(a,i,e){let o;for(;i.length&&(o=i[i.length-1]).i<=e;)i.pop(),a.push(o.vs),e++;return e}function d(a){return(i,e)=>i.barycenter<e.barycenter?-1:i.barycenter>e.barycenter?1:a?e.i-i.i:i.i-e.i}return Le}var Te,jr;function kt(){if(jr)return Te;jr=1;let E=Et(),b=_t(),f=yt();Te=d;function d(e,o,n,s){let r=e.children(o),t=e.node(o),u=t?t.borderLeft:void 0,h=t?t.borderRight:void 0,w={};u&&(r=r.filter(p=>p!==u&&p!==h));let I=E(e,r);I.forEach(p=>{if(e.children(p.v).length){let k=d(e,p.v,n,s);w[p.v]=k,Object.hasOwn(k,"barycenter")&&i(p,k)}});let c=b(I,n);a(c,w);let O=f(c,s);if(u&&(O.vs=[u,O.vs,h].flat(!0),e.predecessors(u).length)){let p=e.node(e.predecessors(u)[0]),k=e.node(e.predecessors(h)[0]);Object.hasOwn(O,"barycenter")||(O.barycenter=0,O.weight=0),O.barycenter=(O.barycenter*O.weight+p.order+k.order)/(O.weight+2),O.weight+=2}return O}function a(e,o){e.forEach(n=>{n.vs=n.vs.flatMap(s=>o[s]?o[s].vs:s)})}function i(e,o){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+o.barycenter*o.weight)/(e.weight+o.weight),e.weight+=o.weight):(e.barycenter=o.barycenter,e.weight=o.weight)}return Te}var Se,qr;function Ot(){if(qr)return Se;qr=1;let E=W().Graph,b=F();Se=f;function f(a,i,e){let o=d(a),n=new E({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(s=>a.node(s));return a.nodes().forEach(s=>{let r=a.node(s),t=a.parent(s);(r.rank===i||r.minRank<=i&&i<=r.maxRank)&&(n.setNode(s),n.setParent(s,t||o),a[e](s).forEach(u=>{let h=u.v===s?u.w:u.v,w=n.edge(h,s),I=w!==void 0?w.weight:0;n.setEdge(h,s,{weight:a.edge(u).weight+I})}),Object.hasOwn(r,"minRank")&&n.setNode(s,{borderLeft:r.borderLeft[i],borderRight:r.borderRight[i]}))}),n}function d(a){for(var i;a.hasNode(i=b.uniqueId("_root")););return i}return Se}var Me,Lr;function Nt(){if(Lr)return Me;Lr=1,Me=E;function E(b,f,d){let a={},i;d.forEach(e=>{let o=b.parent(e),n,s;for(;o;){if(n=b.parent(o),n?(s=a[n],a[n]=o):(s=i,i=o),s&&s!==o){f.setEdge(s,o);return}o=n}})}return Me}var Pe,Tr;function Ct(){if(Tr)return Pe;Tr=1;let E=wt(),b=gt(),f=kt(),d=Ot(),a=Nt(),i=W().Graph,e=F();Pe=o;function o(t,u){if(u&&typeof u.customOrder=="function"){u.customOrder(t,o);return}let h=e.maxRank(t),w=n(t,e.range(1,h+1),"inEdges"),I=n(t,e.range(h-1,-1,-1),"outEdges"),c=E(t);if(r(t,c),u&&u.disableOptimalOrderHeuristic)return;let O=Number.POSITIVE_INFINITY,p;for(let k=0,C=0;C<4;++k,++C){s(k%2?w:I,k%4>=2),c=e.buildLayerMatrix(t);let R=b(t,c);R<O&&(C=0,p=Object.assign({},c),O=R)}r(t,p)}function n(t,u,h){return u.map(function(w){return d(t,w,h)})}function s(t,u){let h=new i;t.forEach(function(w){let I=w.graph().root,c=f(w,I,h,u);c.vs.forEach((O,p)=>w.node(O).order=p),a(w,h,c.vs)})}function r(t,u){Object.values(u).forEach(h=>h.forEach((w,I)=>t.node(w).order=I))}return Pe}var Ge,Sr;function xt(){if(Sr)return Ge;Sr=1;let E=W().Graph,b=F();Ge={positionX:h,findType1Conflicts:f,findType2Conflicts:d,addConflict:i,hasConflict:e,verticalAlignment:o,horizontalCompaction:n,alignCoordinates:t,findSmallestWidthAlignment:r,balance:u};function f(c,O){let p={};function k(C,R){let j=0,L=0,l=C.length,m=R[R.length-1];return R.forEach((g,y)=>{let x=a(c,g),T=x?c.node(x).order:l;(x||g===m)&&(R.slice(L,y+1).forEach(S=>{c.predecessors(S).forEach(G=>{let Y=c.node(G),z=Y.order;(z<j||T<z)&&!(Y.dummy&&c.node(S).dummy)&&i(p,G,S)})}),L=y+1,j=T)}),R}return O.length&&O.reduce(k),p}function d(c,O){let p={};function k(R,j,L,l,m){let g;b.range(j,L).forEach(y=>{g=R[y],c.node(g).dummy&&c.predecessors(g).forEach(x=>{let T=c.node(x);T.dummy&&(T.order<l||T.order>m)&&i(p,x,g)})})}function C(R,j){let L=-1,l,m=0;return j.forEach((g,y)=>{if(c.node(g).dummy==="border"){let x=c.predecessors(g);x.length&&(l=c.node(x[0]).order,k(j,m,y,L,l),m=y,L=l)}k(j,m,j.length,l,R.length)}),j}return O.length&&O.reduce(C),p}function a(c,O){if(c.node(O).dummy)return c.predecessors(O).find(p=>c.node(p).dummy)}function i(c,O,p){if(O>p){let C=O;O=p,p=C}let k=c[O];k||(c[O]=k={}),k[p]=!0}function e(c,O,p){if(O>p){let k=O;O=p,p=k}return!!c[O]&&Object.hasOwn(c[O],p)}function o(c,O,p,k){let C={},R={},j={};return O.forEach(L=>{L.forEach((l,m)=>{C[l]=l,R[l]=l,j[l]=m})}),O.forEach(L=>{let l=-1;L.forEach(m=>{let g=k(m);if(g.length){g=g.sort((x,T)=>j[x]-j[T]);let y=(g.length-1)/2;for(let x=Math.floor(y),T=Math.ceil(y);x<=T;++x){let S=g[x];R[m]===m&&l<j[S]&&!e(p,m,S)&&(R[S]=m,R[m]=C[m]=C[S],l=j[S])}}})}),{root:C,align:R}}function n(c,O,p,k,C){let R={},j=s(c,O,p,C),L=C?"borderLeft":"borderRight";function l(y,x){let T=j.nodes(),S=T.pop(),G={};for(;S;)G[S]?y(S):(G[S]=!0,T.push(S),T=T.concat(x(S))),S=T.pop()}function m(y){R[y]=j.inEdges(y).reduce((x,T)=>Math.max(x,R[T.v]+j.edge(T)),0)}function g(y){let x=j.outEdges(y).reduce((S,G)=>Math.min(S,R[G.w]-j.edge(G)),Number.POSITIVE_INFINITY),T=c.node(y);x!==Number.POSITIVE_INFINITY&&T.borderType!==L&&(R[y]=Math.max(R[y],x))}return l(m,j.predecessors.bind(j)),l(g,j.successors.bind(j)),Object.keys(k).forEach(y=>R[y]=R[p[y]]),R}function s(c,O,p,k){let C=new E,R=c.graph(),j=w(R.nodesep,R.edgesep,k);return O.forEach(L=>{let l;L.forEach(m=>{let g=p[m];if(C.setNode(g),l){var y=p[l],x=C.edge(y,g);C.setEdge(y,g,Math.max(j(c,m,l),x||0))}l=m})}),C}function r(c,O){return Object.values(O).reduce((p,k)=>{let C=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY;Object.entries(k).forEach(([L,l])=>{let m=I(c,L)/2;C=Math.max(l+m,C),R=Math.min(l-m,R)});const j=C-R;return j<p[0]&&(p=[j,k]),p},[Number.POSITIVE_INFINITY,null])[1]}function t(c,O){let p=Object.values(O),k=b.applyWithChunking(Math.min,p),C=b.applyWithChunking(Math.max,p);["u","d"].forEach(R=>{["l","r"].forEach(j=>{let L=R+j,l=c[L];if(l===O)return;let m=Object.values(l),g=k-b.applyWithChunking(Math.min,m);j!=="l"&&(g=C-b.applyWithChunking(Math.max,m)),g&&(c[L]=b.mapValues(l,y=>y+g))})})}function u(c,O){return b.mapValues(c.ul,(p,k)=>{if(O)return c[O.toLowerCase()][k];{let C=Object.values(c).map(R=>R[k]).sort((R,j)=>R-j);return(C[1]+C[2])/2}})}function h(c){let O=b.buildLayerMatrix(c),p=Object.assign(f(c,O),d(c,O)),k={},C;["u","d"].forEach(j=>{C=j==="u"?O:Object.values(O).reverse(),["l","r"].forEach(L=>{L==="r"&&(C=C.map(y=>Object.values(y).reverse()));let l=(j==="u"?c.predecessors:c.successors).bind(c),m=o(c,C,p,l),g=n(c,C,m.root,m.align,L==="r");L==="r"&&(g=b.mapValues(g,y=>-y)),k[j+L]=g})});let R=r(c,k);return t(k,R),u(k,c.graph().align)}function w(c,O,p){return(k,C,R)=>{let j=k.node(C),L=k.node(R),l=0,m;if(l+=j.width/2,Object.hasOwn(j,"labelpos"))switch(j.labelpos.toLowerCase()){case"l":m=-j.width/2;break;case"r":m=j.width/2;break}if(m&&(l+=p?m:-m),m=0,l+=(j.dummy?O:c)/2,l+=(L.dummy?O:c)/2,l+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":m=L.width/2;break;case"r":m=-L.width/2;break}return m&&(l+=p?m:-m),m=0,l}}function I(c,O){return c.node(O).width}return Ge}var De,Mr;function It(){if(Mr)return De;Mr=1;let E=F(),b=xt().positionX;De=f;function f(a){a=E.asNonCompoundGraph(a),d(a),Object.entries(b(a)).forEach(([i,e])=>a.node(i).x=e)}function d(a){let i=E.buildLayerMatrix(a),e=a.graph().ranksep,o=0;i.forEach(n=>{const s=n.reduce((r,t)=>{const u=a.node(t).height;return r>u?r:u},0);n.forEach(r=>a.node(r).y=o+s/2),o+=s+e})}return De}var Fe,Pr;function Rt(){if(Pr)return Fe;Pr=1;let E=lt(),b=ht(),f=ct(),d=F().normalizeRanks,a=pt(),i=F().removeEmptyRanks,e=mt(),o=bt(),n=vt(),s=Ct(),r=It(),t=F(),u=W().Graph;Fe=h;function h(v,_){let N=_&&_.debugTiming?t.time:t.notime;N("layout",()=>{let q=N(" buildLayoutGraph",()=>l(v));N(" runLayout",()=>w(q,N,_)),N(" updateInputGraph",()=>I(v,q))})}function w(v,_,N){_(" makeSpaceForEdgeLabels",()=>m(v)),_(" removeSelfEdges",()=>Hr(v)),_(" acyclic",()=>E.run(v)),_(" nestingGraph.run",()=>e.run(v)),_(" rank",()=>f(t.asNonCompoundGraph(v))),_(" injectEdgeLabelProxies",()=>g(v)),_(" removeEmptyRanks",()=>i(v)),_(" nestingGraph.cleanup",()=>e.cleanup(v)),_(" normalizeRanks",()=>d(v)),_(" assignRankMinMax",()=>y(v)),_(" removeEdgeLabelProxies",()=>x(v)),_(" normalize.run",()=>b.run(v)),_(" parentDummyChains",()=>a(v)),_(" addBorderSegments",()=>o(v)),_(" order",()=>s(v,N)),_(" insertSelfEdges",()=>Xr(v)),_(" adjustCoordinateSystem",()=>n.adjust(v)),_(" position",()=>r(v)),_(" positionSelfEdges",()=>Qr(v)),_(" removeBorderNodes",()=>z(v)),_(" normalize.undo",()=>b.undo(v)),_(" fixupEdgeLabelCoords",()=>G(v)),_(" undoCoordinateSystem",()=>n.undo(v)),_(" translateGraph",()=>T(v)),_(" assignNodeIntersects",()=>S(v)),_(" reversePoints",()=>Y(v)),_(" acyclic.undo",()=>E.undo(v))}function I(v,_){v.nodes().forEach(N=>{let q=v.node(N),M=_.node(N);q&&(q.x=M.x,q.y=M.y,q.rank=M.rank,_.children(N).length&&(q.width=M.width,q.height=M.height))}),v.edges().forEach(N=>{let q=v.edge(N),M=_.edge(N);q.points=M.points,Object.hasOwn(M,"x")&&(q.x=M.x,q.y=M.y)}),v.graph().width=_.graph().width,v.graph().height=_.graph().height}let c=["nodesep","edgesep","ranksep","marginx","marginy"],O={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},p=["acyclicer","ranker","rankdir","align"],k=["width","height"],C={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function l(v){let _=new u({multigraph:!0,compound:!0}),N=Q(v.graph());return _.setGraph(Object.assign({},O,X(N,c),t.pick(N,p))),v.nodes().forEach(q=>{let M=Q(v.node(q));const P=X(M,k);Object.keys(C).forEach(D=>{P[D]===void 0&&(P[D]=C[D])}),_.setNode(q,P),_.setParent(q,v.parent(q))}),v.edges().forEach(q=>{let M=Q(v.edge(q));_.setEdge(q,Object.assign({},j,X(M,R),t.pick(M,L)))}),_}function m(v){let _=v.graph();_.ranksep/=2,v.edges().forEach(N=>{let q=v.edge(N);q.minlen*=2,q.labelpos.toLowerCase()!=="c"&&(_.rankdir==="TB"||_.rankdir==="BT"?q.width+=q.labeloffset:q.height+=q.labeloffset)})}function g(v){v.edges().forEach(_=>{let N=v.edge(_);if(N.width&&N.height){let q=v.node(_.v),P={rank:(v.node(_.w).rank-q.rank)/2+q.rank,e:_};t.addDummyNode(v,"edge-proxy",P,"_ep")}})}function y(v){let _=0;v.nodes().forEach(N=>{let q=v.node(N);q.borderTop&&(q.minRank=v.node(q.borderTop).rank,q.maxRank=v.node(q.borderBottom).rank,_=Math.max(_,q.maxRank))}),v.graph().maxRank=_}function x(v){v.nodes().forEach(_=>{let N=v.node(_);N.dummy==="edge-proxy"&&(v.edge(N.e).labelRank=N.rank,v.removeNode(_))})}function T(v){let _=Number.POSITIVE_INFINITY,N=0,q=Number.POSITIVE_INFINITY,M=0,P=v.graph(),D=P.marginx||0,V=P.marginy||0;function Ye(B){let A=B.x,U=B.y,ze=B.width,Ue=B.height;_=Math.min(_,A-ze/2),N=Math.max(N,A+ze/2),q=Math.min(q,U-Ue/2),M=Math.max(M,U+Ue/2)}v.nodes().forEach(B=>Ye(v.node(B))),v.edges().forEach(B=>{let A=v.edge(B);Object.hasOwn(A,"x")&&Ye(A)}),_-=D,q-=V,v.nodes().forEach(B=>{let A=v.node(B);A.x-=_,A.y-=q}),v.edges().forEach(B=>{let A=v.edge(B);A.points.forEach(U=>{U.x-=_,U.y-=q}),Object.hasOwn(A,"x")&&(A.x-=_),Object.hasOwn(A,"y")&&(A.y-=q)}),P.width=N-_+D,P.height=M-q+V}function S(v){v.edges().forEach(_=>{let N=v.edge(_),q=v.node(_.v),M=v.node(_.w),P,D;N.points?(P=N.points[0],D=N.points[N.points.length-1]):(N.points=[],P=M,D=q),N.points.unshift(t.intersectRect(q,P)),N.points.push(t.intersectRect(M,D))})}function G(v){v.edges().forEach(_=>{let N=v.edge(_);if(Object.hasOwn(N,"x"))switch((N.labelpos==="l"||N.labelpos==="r")&&(N.width-=N.labeloffset),N.labelpos){case"l":N.x-=N.width/2+N.labeloffset;break;case"r":N.x+=N.width/2+N.labeloffset;break}})}function Y(v){v.edges().forEach(_=>{let N=v.edge(_);N.reversed&&N.points.reverse()})}function z(v){v.nodes().forEach(_=>{if(v.children(_).length){let N=v.node(_),q=v.node(N.borderTop),M=v.node(N.borderBottom),P=v.node(N.borderLeft[N.borderLeft.length-1]),D=v.node(N.borderRight[N.borderRight.length-1]);N.width=Math.abs(D.x-P.x),N.height=Math.abs(M.y-q.y),N.x=P.x+N.width/2,N.y=q.y+N.height/2}}),v.nodes().forEach(_=>{v.node(_).dummy==="border"&&v.removeNode(_)})}function Hr(v){v.edges().forEach(_=>{if(_.v===_.w){var N=v.node(_.v);N.selfEdges||(N.selfEdges=[]),N.selfEdges.push({e:_,label:v.edge(_)}),v.removeEdge(_)}})}function Xr(v){var _=t.buildLayerMatrix(v);_.forEach(N=>{var q=0;N.forEach((M,P)=>{var D=v.node(M);D.order=P+q,(D.selfEdges||[]).forEach(V=>{t.addDummyNode(v,"selfedge",{width:V.label.width,height:V.label.height,rank:D.rank,order:P+ ++q,e:V.e,label:V.label},"_se")}),delete D.selfEdges})})}function Qr(v){v.nodes().forEach(_=>{var N=v.node(_);if(N.dummy==="selfedge"){var q=v.node(N.e.v),M=q.x+q.width/2,P=q.y,D=N.x-M,V=q.height/2;v.setEdge(N.e,N.label),v.removeNode(_),N.label.points=[{x:M+2*D/3,y:P-V},{x:M+5*D/6,y:P-V},{x:M+D,y:P},{x:M+5*D/6,y:P+V},{x:M+2*D/3,y:P+V}],N.label.x=N.x,N.label.y=N.y}})}function X(v,_){return t.mapValues(t.pick(v,_),Number)}function Q(v){var _={};return v&&Object.entries(v).forEach(([N,q])=>{typeof N=="string"&&(N=N.toLowerCase()),_[N]=q}),_}return Fe}var Ae,Gr;function jt(){if(Gr)return Ae;Gr=1;let E=F(),b=W().Graph;Ae={debugOrdering:f};function f(d){let a=E.buildLayerMatrix(d),i=new b({compound:!0,multigraph:!0}).setGraph({});return d.nodes().forEach(e=>{i.setNode(e,{label:e}),i.setParent(e,"layer"+d.node(e).rank)}),d.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),a.forEach((e,o)=>{let n="layer"+o;i.setNode(n,{rank:"same"}),e.reduce((s,r)=>(i.setEdge(s,r,{style:"invis"}),r))}),i}return Ae}var Ve,Dr;function qt(){return Dr||(Dr=1,Ve="1.1.4"),Ve}var Be,Fr;function Lt(){return Fr||(Fr=1,Be={graphlib:W(),layout:Rt(),debug:jt(),util:{time:F().time,notime:F().notime},version:qt()}),Be}var Ar=Lt();self.onmessage=E=>{const b=new Ar.graphlib.Graph;b.setDefaultEdgeLabel(()=>({})),b.setGraph({rankdir:"LR",ranksep:200,nodesep:150});for(const a of E.data.nodes)b.setNode(a.id,{width:a.width,height:a.height});for(const a of E.data.edges)b.setEdge(a.source,a.target);Ar.layout(b);const f=E.data.nodes.map(a=>{const i=b.node(a.id);return{id:a.id,x:i.x-a.width/2,y:i.y-a.height/2}}),d={requestId:E.data.requestId,nodes:f};self.postMessage(d)};
|