@hpcc-js/graph 3.6.5 → 3.6.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.
Files changed (77) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +256 -256
  3. package/dist/assets/dagre-B-z4SP0u.js.map +1 -1
  4. package/dist/assets/graphviz-DQ0E8zfY.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.umd.cjs +1 -1
  8. package/dist/index.umd.cjs.map +1 -1
  9. package/package.json +6 -6
  10. package/src/AdjacencyGraph.ts +224 -224
  11. package/src/Edge.css +23 -23
  12. package/src/Edge.ts +257 -257
  13. package/src/Graph.css +18 -18
  14. package/src/Graph.ts +1077 -1077
  15. package/src/GraphData.ts +187 -187
  16. package/src/GraphLayouts.ts +214 -214
  17. package/src/Sankey.css +46 -46
  18. package/src/Sankey.ts +304 -304
  19. package/src/Subgraph.css +10 -10
  20. package/src/Subgraph.ts +165 -165
  21. package/src/Vertex.css +3 -3
  22. package/src/Vertex.ts +282 -282
  23. package/src/__package__.ts +3 -3
  24. package/src/__tests__/data.ts +444 -444
  25. package/src/__tests__/index.ts +1 -1
  26. package/src/__tests__/test1.ts +18 -18
  27. package/src/__tests__/test2.ts +80 -80
  28. package/src/__tests__/test3.ts +46 -46
  29. package/src/__tests__/test4.ts +66 -66
  30. package/src/__tests__/test5.ts +85 -85
  31. package/src/common/graphT.css +38 -38
  32. package/src/common/graphT.ts +1363 -1363
  33. package/src/common/index.ts +3 -3
  34. package/src/common/layouts/circle.ts +37 -37
  35. package/src/common/layouts/dagre.ts +145 -145
  36. package/src/common/layouts/dagreWorker.ts +24 -24
  37. package/src/common/layouts/forceDirected.ts +117 -117
  38. package/src/common/layouts/forceDirectedWorker.ts +22 -22
  39. package/src/common/layouts/geoForceDirected.ts +112 -112
  40. package/src/common/layouts/graphviz.ts +137 -137
  41. package/src/common/layouts/graphvizWorker.ts +27 -27
  42. package/src/common/layouts/index.ts +7 -7
  43. package/src/common/layouts/layout.ts +147 -147
  44. package/src/common/layouts/null.ts +39 -39
  45. package/src/common/layouts/placeholders.ts +113 -113
  46. package/src/common/layouts/tree.ts +326 -326
  47. package/src/common/layouts/workers/dagre.ts +46 -46
  48. package/src/common/layouts/workers/dagreOptions.ts +35 -35
  49. package/src/common/layouts/workers/forceDirected.ts +38 -38
  50. package/src/common/layouts/workers/forceDirectedOptions.ts +30 -30
  51. package/src/common/layouts/workers/graphviz.ts +225 -225
  52. package/src/common/layouts/workers/graphvizOptions.ts +70 -70
  53. package/src/common/liteMap.ts +72 -72
  54. package/src/common/liteSVGZooom.ts +61 -61
  55. package/src/common/sankeyGraph.css +45 -45
  56. package/src/common/sankeyGraph.ts +345 -345
  57. package/src/html/annotation.ts +71 -71
  58. package/src/html/component.ts +18 -18
  59. package/src/html/edge.ts +15 -15
  60. package/src/html/graphHtml.ts +11 -11
  61. package/src/html/graphHtmlT.ts +117 -117
  62. package/src/html/icon.ts +64 -64
  63. package/src/html/image.ts +26 -26
  64. package/src/html/imageChar.ts +18 -18
  65. package/src/html/index.ts +8 -8
  66. package/src/html/intersection.ts +110 -110
  67. package/src/html/shape.ts +141 -141
  68. package/src/html/text.ts +59 -59
  69. package/src/html/textBox.ts +45 -45
  70. package/src/html/vertex.ts +67 -67
  71. package/src/index.ts +10 -10
  72. package/src/react/dataGraph.ts +345 -345
  73. package/src/react/graphReact.ts +177 -177
  74. package/src/react/graphReactT.ts +44 -44
  75. package/src/react/index.ts +4 -4
  76. package/src/react/subgraph.tsx +30 -30
  77. package/src/react/vertex.tsx +31 -31
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var e,t,r=Object.defineProperty,n=(e,t)=>r(e,"name",{value:t,configurable:!0}),i=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{SVGWidget as o,TextBox as a,Platform as s,map as u,dispatch as c,Text as h,Icon as l,Palette as f,select as d,SVGZoomWidget as p,ToggleButton as _,Spacer as g,Utility as m,d3Event as v,drag as y,SVGGlowFilter as b,PropertyExt as w,sum as x,max as E,min as C,median as k,mean as D,interpolateNumberArray as M}from"@hpcc-js/common";import{hashSum as F,Graph2 as S,compare2 as R}from"@hpcc-js/util";import{IGraph as j,ITooltip as L}from"@hpcc-js/api";import{render as I,Subgraph as q,Vertex as P,Edge as O,Icons as B,Vertex3 as N,CentroidVertex3 as T,React as $,Text as V}from"@hpcc-js/react";import{HTMLTooltip as z}from"@hpcc-js/html";const U="@hpcc-js/graph",Y="3.6.5",H="3.19.3";var G=Math.PI,X=2*G,W=1e-6,K=X-W;function Q(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Z(){return new Q}function J(e){/* @__PURE__ */
1
+ var e,t,r=Object.defineProperty,n=(e,t)=>r(e,"name",{value:t,configurable:!0}),i=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{SVGWidget as o,TextBox as a,Platform as s,map as u,dispatch as c,Text as h,Icon as l,Palette as f,select as d,SVGZoomWidget as p,ToggleButton as _,Spacer as g,Utility as m,d3Event as v,drag as y,SVGGlowFilter as b,PropertyExt as w,sum as x,max as E,min as C,median as k,mean as D,interpolateNumberArray as M}from"@hpcc-js/common";import{hashSum as F,Graph2 as S,compare2 as R}from"@hpcc-js/util";import{IGraph as j,ITooltip as L}from"@hpcc-js/api";import{render as I,Subgraph as q,Vertex as P,Edge as O,Icons as B,Vertex3 as N,CentroidVertex3 as T,React as $,Text as V}from"@hpcc-js/react";import{HTMLTooltip as z}from"@hpcc-js/html";const U="@hpcc-js/graph",Y="3.6.6",H="3.20.0";var G=Math.PI,X=2*G,W=1e-6,K=X-W;function Q(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Z(){return new Q}function J(e){/* @__PURE__ */
2
2
  return n(function(){return e},"constant")}function A(e){this._context=e}function ee(e){return new A(e)}function te(e){return e[0]}function re(e){return e[1]}function ne(){var e=te,t=re,r=J(!0),i=null,o=ee,a=null;function s(n){var s,u,c,h=n.length,l=!1;for(null==i&&(a=o(c=Z())),s=0;s<=h;++s)!(s<h&&r(u=n[s],s,n))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+e(u,s,n),+t(u,s,n));if(c)return a=null,c+""||null}return n(s,"line"),s.x=function(t){return arguments.length?(e="function"==typeof t?t:J(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:J(+e),s):t},s.defined=function(e){return arguments.length?(r="function"==typeof e?e:J(!!e),s):r},s.curve=function(e){return arguments.length?(o=e,null!=i&&(a=o(i)),s):o},s.context=function(e){return arguments.length?(null==e?i=a=null:a=o(i=e),s):i},s}n(Q,"Path"),n(Z,"path"),Q.prototype=Z.prototype={constructor:Q,moveTo:/* @__PURE__ */n(function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},"moveTo"),closePath:/* @__PURE__ */n(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */n(function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},"lineTo"),quadraticCurveTo:/* @__PURE__ */n(function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */n(function(e,t,r,n,i,o){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+o)},"bezierCurveTo"),arcTo:/* @__PURE__ */n(function(e,t,r,n,i){e=+e,t=+t,r=+r,n=+n,i=+i;var o=this._x1,a=this._y1,s=r-e,u=n-t,c=o-e,h=a-t,l=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(l>W)if(Math.abs(h*s-u*c)>W&&i){var f=r-o,d=n-a,p=s*s+u*u,_=f*f+d*d,g=Math.sqrt(p),m=Math.sqrt(l),v=i*Math.tan((G-Math.acos((p+l-_)/(2*g*m)))/2),y=v/m,b=v/g;Math.abs(y-1)>W&&(this._+="L"+(e+y*c)+","+(t+y*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>c*d)+","+(this._x1=e+b*s)+","+(this._y1=t+b*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},"arcTo"),arc:/* @__PURE__ */n(function(e,t,r,n,i,o){e=+e,t=+t,o=!!o;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,h=1^o,l=o?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>W||Math.abs(this._y1-c)>W)&&(this._+="L"+u+","+c),r&&(l<0&&(l=l%X+X),l>K?this._+="A"+r+","+r+",0,1,"+h+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+h+","+(this._x1=u)+","+(this._y1=c):l>W&&(this._+="A"+r+","+r+",0,"+ +(l>=G)+","+h+","+(this._x1=e+r*Math.cos(i))+","+(this._y1=t+r*Math.sin(i))))},"arc"),rect:/* @__PURE__ */n(function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},"rect"),toString:/* @__PURE__ */n(function(){return this._},"toString")},n(J,"constant$2"),n(A,"Linear"),A.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}},"point")},n(ee,"d3CurveLinear"),n(te,"x$2"),n(re,"y$2"),n(ne,"d3Line");var ie=Array.prototype.slice;function oe(e){return e.source}function ae(e){return e.target}function se(e){var t=oe,r=ae,i=te,o=re,a=null;function s(){var n,s=ie.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(a||(a=n=Z()),e(a,+i.apply(this,(s[0]=u,s)),+o.apply(this,s),+i.apply(this,(s[0]=c,s)),+o.apply(this,s)),n)return a=null,n+""||null}return n(s,"link"),s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(r=e,s):r},s.x=function(e){return arguments.length?(i="function"==typeof e?e:J(+e),s):i},s.y=function(e){return arguments.length?(o="function"==typeof e?e:J(+e),s):o},s.context=function(e){return arguments.length?(a=null==e?null:e,s):a},s}function ue(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function ce(){return se(ue)}function he(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function le(e){this._context=e}function fe(e){return new le(e)}function de(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function pe(e,t){this._context=e,this._k=(1-t)/6}n(oe,"linkSource"),n(ae,"linkTarget"),n(se,"link"),n(ue,"curveHorizontal"),n(ce,"linkHorizontal$1"),n(he,"point$1"),n(le,"Basis"),le.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){switch(this._point){case 3:he(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:he(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t},"point")},n(fe,"d3CurveBasis"),n(de,"point"),n(pe,"Cardinal"),pe.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:de(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:de(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t},"point")};const _e=/* @__PURE__ */n(function e(t){function r(e){return new pe(e,t)}return n(r,"cardinal"),r.tension=function(t){return e(+t)},r},"custom")(0),ge=fe,me=class _Edge extends o{_points;_weight;_strokeDasharray;_hidden;_textBox;_sourceVertex;_targetVertex;_elementPath;_graphID;constructor(){super(),this._points=[],this._weight=100,this._strokeDasharray=null,this._hidden=!1,this._textBox=(new a).padding(0)}graphID(e){return arguments.length?(this._graphID=e,this):this._graphID}sourceVertex(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex}targetVertex(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex}weight(e){return arguments.length?(this._weight=e,this):this._weight}points(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points}hidden(e){return arguments.length?(this._hidden=e,this):this._hidden}text(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()}enter(e,t){super.enter(e,t),this._elementPath=t.append("path"),this._textBox.text()&&this._textBox.target(e).tooltip(this.tooltip()).render()}update(e,t,r,n){super.update(e,t);const i=this;s.svgMarkerGlitch&&!n&&t.transition().duration((r||0)+100).on("start",function(){i._pushMarkers(t)}).on("end",function(){i._popMarkers(t)});const o=i._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),a=t.selectAll(".point2").data(this.showControlPoints()?o:[]);a.enter().append("circle").attr("class","point2").style("stroke","red").merge(a).attr("cx",e=>e.x).attr("cy",e=>e.y).attr("r",1),a.exit().remove();const u=ne().x(function(e){return e.x}).y(function(e){return e.y}).curve(ge)(o);let c=this._elementPath;r&&(c=c.transition().duration(r)),c.attr("opacity",this._hidden?0:1).attr("marker-start",s.svgMarkerGlitch&&n||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",s.svgMarkerGlitch&&n||!this.targetMarker_exists()?null:"url(#"+this._graphID+"_"+this.targetMarker()+"Head)").attr("stroke",this.strokeColor_exists()?this.strokeColor():null).attr("stroke-dasharray",this.strokeDasharray_exists()?this.strokeDasharray():null).attr("d",u),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(o),r)}exit(e,t){this._textBox&&this._textBox.target(null),super.exit(e,t)}_findMidPoint(e){const t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){const r=e[t-1],n=e[t];return{x:(r.x+n.x)/2,y:(r.y+n.y)/2}}return{x:0,y:0}}_calculateEdgePoints(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];let n=r?r.filter(r=>!e.contains(r)&&!t.contains(r)):[];const i=0===n.length?t.pos():n[0],o=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,i)),n.push(t.intersection(t._pos,o)),n[0]||(n[0]=e._pos),n[n.length-1]||(n[n.length-1]=t._pos),(!r||0===r.length)&&2===n.length&&n[0]&&n[1]){const e=n[0].x-n[1].x,t=n[0].y-n[1].y;if(Math.sqrt(e*e+t*t))if(this.showArc()){const r=(n[0].x+n[1].x)/2-t*this.arcDepth()/100,i=(n[0].y+n[1].y)/2+e*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:r,y:i},{x:n[1].x,y:n[1].y}]}else n=[{x:n[0].x,y:n[0].y},{x:n[1].x,y:n[1].y}]}return n}};n(me,"Edge");let ve=me;ve.prototype._class+=" graph_Edge",ve.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),ve.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),ve.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),ve.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),ve.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),ve.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),ve.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),ve.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),ve.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),ve.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),ve.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),ve.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");var ye,be,we,xe,Ee,Ce,ke,De,Me,Fe,Se,Re,je,Le,Ie,qe,Pe,Oe,Be,Ne,Te,$e,Ve,ze,Ue,Ye,He,Ge,Xe,We,Ke,Qe,Ze,Je,Ae,et,tt,rt,nt,it,ot,at,st,ut,ct,ht,lt,ft,dt,pt,_t,gt,mt,vt,yt,bt,wt,xt,Et,Ct,kt,Dt,Mt,Ft,St,Rt,jt,Lt,It,qt,Pt,Ot,Bt,Nt,Tt,$t,Vt,zt,Ut,Yt,Ht,Gt,Xt,Wt,Kt,Qt,Zt,Jt,At,er,tr,rr,nr,ir,or,ar,sr,ur,cr,hr,lr,fr,dr,pr,_r,gr,mr,vr,yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function br(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function wr(){if(be)return ye;function e(){this.__data__=[],this.size=0}return be=1,n(e,"listCacheClear"),ye=e}function xr(){if(xe)return we;function e(e,t){return e===t||e!=e&&t!=t}return xe=1,n(e,"eq"),we=e}function Er(){if(Ce)return Ee;Ce=1;var e=xr();function t(t,r){for(var n=t.length;n--;)if(e(t[n][0],r))return n;return-1}return n(t,"assocIndexOf"),Ee=t}function Cr(){if(De)return ke;De=1;var e=Er(),t=Array.prototype.splice;function r(r){var n=this.__data__,i=e(n,r);return!(i<0)&&(i==n.length-1?n.pop():t.call(n,i,1),--this.size,!0)}return n(r,"listCacheDelete"),ke=r}function kr(){if(Fe)return Me;Fe=1;var e=Er();function t(t){var r=this.__data__,n=e(r,t);return n<0?void 0:r[n][1]}return n(t,"listCacheGet"),Me=t}function Dr(){if(Re)return Se;Re=1;var e=Er();function t(t){return e(this.__data__,t)>-1}return n(t,"listCacheHas"),Se=t}function Mr(){if(Le)return je;Le=1;var e=Er();function t(t,r){var n=this.__data__,i=e(n,t);return i<0?(++this.size,n.push([t,r])):n[i][1]=r,this}return n(t,"listCacheSet"),je=t}function Fr(){if(qe)return Ie;qe=1;var e=wr(),t=Cr(),r=kr(),i=Dr(),o=Mr();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"ListCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Ie=a}function Sr(){if(Oe)return Pe;Oe=1;var e=Fr();function t(){this.__data__=new e,this.size=0}return n(t,"stackClear"),Pe=t}function Rr(){if(Ne)return Be;function e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return Ne=1,n(e,"stackDelete"),Be=e}function jr(){if($e)return Te;function e(e){return this.__data__.get(e)}return $e=1,n(e,"stackGet"),Te=e}function Lr(){if(ze)return Ve;function e(e){return this.__data__.has(e)}return ze=1,n(e,"stackHas"),Ve=e}function Ir(){if(Ye)return Ue;Ye=1;var e="object"==typeof yr&&yr&&yr.Object===Object&&yr;return Ue=e}function qr(){if(Ge)return He;Ge=1;var e=Ir(),t="object"==typeof self&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return He=r}function Pr(){if(We)return Xe;We=1;var e=qr().Symbol;return Xe=e}function Or(){if(Qe)return Ke;Qe=1;var e=Pr(),t=Object.prototype,r=t.hasOwnProperty,i=t.toString,o=e?e.toStringTag:void 0;function a(e){var t=r.call(e,o),n=e[o];try{e[o]=void 0;var a=!0}catch(u){}var s=i.call(e);return a&&(t?e[o]=n:delete e[o]),s}return n(a,"getRawTag"),Ke=a}function Br(){if(Je)return Ze;Je=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return n(t,"objectToString"),Ze=t}function Nr(){if(et)return Ae;et=1;var e=Pr(),t=Or(),r=Br(),i=e?e.toStringTag:void 0;function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?t(e):r(e)}return n(o,"baseGetTag"),Ae=o}function Tr(){if(rt)return tt;function e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}return rt=1,n(e,"isObject"),tt=e}function $r(){if(it)return nt;it=1;var e=Nr(),t=Tr();function r(r){if(!t(r))return!1;var n=e(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}return n(r,"isFunction"),nt=r}function Vr(){if(at)return ot;at=1;var e=qr()["__core-js_shared__"];return ot=e}function zr(){if(ut)return st;ut=1;var e,t=Vr(),r=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";function i(e){return!!r&&r in e}return n(i,"isMasked"),st=i}function Ur(){if(ht)return ct;ht=1;var e=Function.prototype.toString;function t(t){if(null!=t){try{return e.call(t)}catch(r){}try{return t+""}catch(r){}}return""}return n(t,"toSource"),ct=t}function Yr(){if(ft)return lt;ft=1;var e=$r(),t=zr(),r=Tr(),i=Ur(),o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,h=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(n){return!(!r(n)||t(n))&&(e(n)?h:o).test(i(n))}return n(l,"baseIsNative"),lt=l}function Hr(){if(pt)return dt;function e(e,t){return null==e?void 0:e[t]}return pt=1,n(e,"getValue"),dt=e}function Gr(){if(gt)return _t;gt=1;var e=Yr(),t=Hr();function r(r,n){var i=t(r,n);return e(i)?i:void 0}return n(r,"getNative"),_t=r}function Xr(){if(vt)return mt;vt=1;var e=Gr()(qr(),"Map");return mt=e}function Wr(){if(bt)return yt;bt=1;var e=Gr()(Object,"create");return yt=e}function Kr(){if(xt)return wt;xt=1;var e=Wr();function t(){this.__data__=e?e(null):{},this.size=0}return n(t,"hashClear"),wt=t}function Qr(){if(Ct)return Et;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Ct=1,n(e,"hashDelete"),Et=e}function Zr(){if(Dt)return kt;Dt=1;var e=Wr(),t=Object.prototype.hasOwnProperty;function r(r){var n=this.__data__;if(e){var i=n[r];return"__lodash_hash_undefined__"===i?void 0:i}return t.call(n,r)?n[r]:void 0}return n(r,"hashGet"),kt=r}function Jr(){if(Ft)return Mt;Ft=1;var e=Wr(),t=Object.prototype.hasOwnProperty;function r(r){var n=this.__data__;return e?void 0!==n[r]:t.call(n,r)}return n(r,"hashHas"),Mt=r}function Ar(){if(Rt)return St;Rt=1;var e=Wr();function t(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=e&&void 0===r?"__lodash_hash_undefined__":r,this}return n(t,"hashSet"),St=t}function en(){if(Lt)return jt;Lt=1;var e=Kr(),t=Qr(),r=Zr(),i=Jr(),o=Ar();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"Hash"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,jt=a}function tn(){if(qt)return It;qt=1;var e=en(),t=Fr(),r=Xr();function i(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return n(i,"mapCacheClear"),It=i}function rn(){if(Ot)return Pt;function e(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}return Ot=1,n(e,"isKeyable"),Pt=e}function nn(){if(Nt)return Bt;Nt=1;var e=rn();function t(t,r){var n=t.__data__;return e(r)?n["string"==typeof r?"string":"hash"]:n.map}return n(t,"getMapData"),Bt=t}function on(){if($t)return Tt;$t=1;var e=nn();function t(t){var r=e(this,t).delete(t);return this.size-=r?1:0,r}return n(t,"mapCacheDelete"),Tt=t}function an(){if(zt)return Vt;zt=1;var e=nn();function t(t){return e(this,t).get(t)}return n(t,"mapCacheGet"),Vt=t}function sn(){if(Yt)return Ut;Yt=1;var e=nn();function t(t){return e(this,t).has(t)}return n(t,"mapCacheHas"),Ut=t}function un(){if(Gt)return Ht;Gt=1;var e=nn();function t(t,r){var n=e(this,t),i=n.size;return n.set(t,r),this.size+=n.size==i?0:1,this}return n(t,"mapCacheSet"),Ht=t}function cn(){if(Wt)return Xt;Wt=1;var e=tn(),t=on(),r=an(),i=sn(),o=un();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"MapCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Xt=a}function hn(){if(Qt)return Kt;Qt=1;var e=Fr(),t=Xr(),r=cn();function i(n,i){var o=this.__data__;if(o instanceof e){var a=o.__data__;if(!t||a.length<199)return a.push([n,i]),this.size=++o.size,this;o=this.__data__=new r(a)}return o.set(n,i),this.size=o.size,this}return n(i,"stackSet"),Kt=i}function ln(){if(Jt)return Zt;Jt=1;var e=Fr(),t=Sr(),r=Rr(),i=jr(),o=Lr(),a=hn();function s(t){var r=this.__data__=new e(t);this.size=r.size}return n(s,"Stack"),s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=o,s.prototype.set=a,Zt=s}function fn(){if(er)return At;function e(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}return er=1,n(e,"arrayEach"),At=e}function dn(){if(rr)return tr;rr=1;var e=Gr(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return tr=t}function pn(){if(ir)return nr;ir=1;var e=dn();function t(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}return n(t,"baseAssignValue"),nr=t}function _n(){if(ar)return or;ar=1;var e=pn(),t=xr(),r=Object.prototype.hasOwnProperty;function i(n,i,o){var a=n[i];r.call(n,i)&&t(a,o)&&(void 0!==o||i in n)||e(n,i,o)}return n(i,"assignValue"),or=i}function gn(){if(ur)return sr;ur=1;var e=_n(),t=pn();function r(r,n,i,o){var a=!i;i||(i={});for(var s=-1,u=n.length;++s<u;){var c=n[s],h=o?o(i[c],r[c],c,i,r):void 0;void 0===h&&(h=r[c]),a?t(i,c,h):e(i,c,h)}return i}return n(r,"copyObject"),sr=r}function mn(){if(hr)return cr;function e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}return hr=1,n(e,"baseTimes"),cr=e}function vn(){if(fr)return lr;function e(e){return null!=e&&"object"==typeof e}return fr=1,n(e,"isObjectLike"),lr=e}function yn(){if(pr)return dr;pr=1;var e=Nr(),t=vn();function r(r){return t(r)&&"[object Arguments]"==e(r)}return n(r,"baseIsArguments"),dr=r}function bn(){if(gr)return _r;gr=1;var e=yn(),t=vn(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=e(/* @__PURE__ */function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!i.call(e,"callee")};return _r=o}function wn(){if(vr)return mr;vr=1;var e=Array.isArray;return mr=e}n(br,"commonjsRequire"),n(wr,"require_listCacheClear"),n(xr,"requireEq"),n(Er,"require_assocIndexOf"),n(Cr,"require_listCacheDelete"),n(kr,"require_listCacheGet"),n(Dr,"require_listCacheHas"),n(Mr,"require_listCacheSet"),n(Fr,"require_ListCache"),n(Sr,"require_stackClear"),n(Rr,"require_stackDelete"),n(jr,"require_stackGet"),n(Lr,"require_stackHas"),n(Ir,"require_freeGlobal"),n(qr,"require_root"),n(Pr,"require_Symbol"),n(Or,"require_getRawTag"),n(Br,"require_objectToString"),n(Nr,"require_baseGetTag"),n(Tr,"requireIsObject"),n($r,"requireIsFunction"),n(Vr,"require_coreJsData"),n(zr,"require_isMasked"),n(Ur,"require_toSource"),n(Yr,"require_baseIsNative"),n(Hr,"require_getValue"),n(Gr,"require_getNative"),n(Xr,"require_Map"),n(Wr,"require_nativeCreate"),n(Kr,"require_hashClear"),n(Qr,"require_hashDelete"),n(Zr,"require_hashGet"),n(Jr,"require_hashHas"),n(Ar,"require_hashSet"),n(en,"require_Hash"),n(tn,"require_mapCacheClear"),n(rn,"require_isKeyable"),n(nn,"require_getMapData"),n(on,"require_mapCacheDelete"),n(an,"require_mapCacheGet"),n(sn,"require_mapCacheHas"),n(un,"require_mapCacheSet"),n(cn,"require_MapCache"),n(hn,"require_stackSet"),n(ln,"require_Stack"),n(fn,"require_arrayEach"),n(dn,"require_defineProperty"),n(pn,"require_baseAssignValue"),n(_n,"require_assignValue"),n(gn,"require_copyObject"),n(mn,"require_baseTimes"),n(vn,"requireIsObjectLike"),n(yn,"require_baseIsArguments"),n(bn,"requireIsArguments"),n(wn,"requireIsArray");var xn,En,Cn,kn,Dn,Mn,Fn,Sn,Rn,jn,Ln,In={exports:{}};function qn(){if(En)return xn;function e(){return!1}return En=1,n(e,"stubFalse"),xn=e}function Pn(){return Cn||(Cn=1,e=In,t=In.exports,r=qr(),n=qn(),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||n,e.exports=s),In.exports;var e,t,r,n,i,o,a,s}function On(){if(Dn)return kn;Dn=1;var e=/^(?:0|[1-9]\d*)$/;function t(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}return n(t,"isIndex"),kn=t}function Bn(){if(Fn)return Mn;Fn=1;function e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}return n(e,"isLength"),Mn=e}function Nn(){if(Rn)return Sn;Rn=1;var e=Nr(),t=Bn(),r=vn(),i={};function o(n){return r(n)&&t(n.length)&&!!i[e(n)]}return i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,n(o,"baseIsTypedArray"),Sn=o}function Tn(){if(Ln)return jn;function e(e){return function(t){return e(t)}}return Ln=1,n(e,"baseUnary"),jn=e}n(qn,"requireStubFalse"),n(Pn,"requireIsBuffer"),n(On,"require_isIndex"),n(Bn,"requireIsLength"),n(Nn,"require_baseIsTypedArray"),n(Tn,"require_baseUnary");var $n,Vn,zn,Un,Yn,Hn,Gn,Xn,Wn,Kn,Qn,Zn,Jn,An,ei,ti,ri,ni,ii,oi,ai,si,ui,ci,hi,li,fi,di={exports:{}};function pi(){return $n||($n=1,e=di,t=di.exports,r=Ir(),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}(),e.exports=a),di.exports;var e,t,r,n,i,o,a}function _i(){if(zn)return Vn;zn=1;var e=Nn(),t=Tn(),r=pi(),n=r&&r.isTypedArray,i=n?t(n):e;return Vn=i}function gi(){if(Yn)return Un;Yn=1;var e=mn(),t=bn(),r=wn(),i=Pn(),o=On(),a=_i(),s=Object.prototype.hasOwnProperty;function u(n,u){var c=r(n),h=!c&&t(n),l=!c&&!h&&i(n),f=!c&&!h&&!l&&a(n),d=c||h||l||f,p=d?e(n.length,String):[],_=p.length;for(var g in n)!u&&!s.call(n,g)||d&&("length"==g||l&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,_))||p.push(g);return p}return n(u,"arrayLikeKeys"),Un=u}function mi(){if(Gn)return Hn;Gn=1;var e=Object.prototype;function t(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}return n(t,"isPrototype"),Hn=t}function vi(){if(Wn)return Xn;function e(e,t){return function(r){return e(t(r))}}return Wn=1,n(e,"overArg"),Xn=e}function yi(){if(Qn)return Kn;Qn=1;var e=vi()(Object.keys,Object);return Kn=e}function bi(){if(Jn)return Zn;Jn=1;var e=mi(),t=yi(),r=Object.prototype.hasOwnProperty;function i(n){if(!e(n))return t(n);var i=[];for(var o in Object(n))r.call(n,o)&&"constructor"!=o&&i.push(o);return i}return n(i,"baseKeys"),Zn=i}function wi(){if(ei)return An;ei=1;var e=$r(),t=Bn();function r(r){return null!=r&&t(r.length)&&!e(r)}return n(r,"isArrayLike"),An=r}function xi(){if(ri)return ti;ri=1;var e=gi(),t=bi(),r=wi();function i(n){return r(n)?e(n):t(n)}return n(i,"keys"),ti=i}function Ei(){if(ii)return ni;ii=1;var e=gn(),t=xi();function r(r,n){return r&&e(n,t(n),r)}return n(r,"baseAssign"),ni=r}function Ci(){if(ai)return oi;function e(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}return ai=1,n(e,"nativeKeysIn"),oi=e}function ki(){if(ui)return si;ui=1;var e=Tr(),t=mi(),r=Ci(),i=Object.prototype.hasOwnProperty;function o(n){if(!e(n))return r(n);var o=t(n),a=[];for(var s in n)("constructor"!=s||!o&&i.call(n,s))&&a.push(s);return a}return n(o,"baseKeysIn"),si=o}function Di(){if(hi)return ci;hi=1;var e=gi(),t=ki(),r=wi();function i(n){return r(n)?e(n,!0):t(n)}return n(i,"keysIn"),ci=i}function Mi(){if(fi)return li;fi=1;var e=gn(),t=Di();function r(r,n){return r&&e(n,t(n),r)}return n(r,"baseAssignIn"),li=r}n(pi,"require_nodeUtil"),n(_i,"requireIsTypedArray"),n(gi,"require_arrayLikeKeys"),n(mi,"require_isPrototype"),n(vi,"require_overArg"),n(yi,"require_nativeKeys"),n(bi,"require_baseKeys"),n(wi,"requireIsArrayLike"),n(xi,"requireKeys"),n(Ei,"require_baseAssign"),n(Ci,"require_nativeKeysIn"),n(ki,"require_baseKeysIn"),n(Di,"requireKeysIn"),n(Mi,"require_baseAssignIn");var Fi,Si,Ri,ji,Li,Ii,qi,Pi,Oi,Bi,Ni,Ti,$i,Vi,zi,Ui,Yi,Hi,Gi,Xi,Wi,Ki,Qi,Zi,Ji,Ai,eo,to,ro,no,io,oo,ao,so,uo,co,ho,lo,fo,po,_o,go,mo,vo,yo,bo,wo,xo,Eo,Co,ko,Do,Mo,Fo,So,Ro,jo,Lo,Io,qo,Po,Oo,Bo,No,To,$o,Vo,zo,Uo,Yo,Ho,Go,Xo,Wo,Ko,Qo,Zo,Jo,Ao,ea,ta,ra,na,ia,oa,aa,sa,ua,ca,ha,la,fa,da,pa,_a,ga,ma,va,ya,ba,wa,xa,Ea,Ca,ka,Da,Ma,Fa,Sa,Ra,ja,La,Ia,qa,Pa,Oa,Ba,Na,Ta,$a,Va,za,Ua,Ya,Ha,Ga,Xa,Wa,Ka,Qa,Za,Ja,Aa,es,ts,rs,ns,is,os,as,ss,us,cs,hs,ls,fs,ds,ps,_s,gs,ms,vs,ys,bs,ws,xs,Es,Cs,ks,Ds,Ms,Fs,Ss,Rs,js,Ls,Is,qs,Ps,Os,Bs,Ns,Ts,$s,Vs,zs,Us,Ys,Hs,Gs,Xs,Ws,Ks,Qs,Zs,Js,As,eu,tu,ru,nu,iu,ou,au,su,uu,cu,hu,lu,fu,du,pu,_u,gu,mu,vu,yu,bu,wu,xu,Eu,Cu,ku,Du,Mu,Fu,Su,Ru,ju,Lu,Iu,qu,Pu,Ou,Bu,Nu,Tu,$u,Vu,zu,Uu,Yu,Hu,Gu,Xu,Wu,Ku,Qu,Zu,Ju,Au,ec,tc,rc,nc,ic,oc,ac,sc,uc,cc,hc,lc,fc,dc,pc,_c,gc,mc,vc,yc,bc,wc,xc,Ec,Cc,kc,Dc,Mc,Fc,Sc,Rc,jc,Lc,Ic,qc,Pc,Oc,Bc,Nc,Tc,$c,Vc,zc,Uc,Yc,Hc,Gc,Xc,Wc,Kc,Qc,Zc,Jc,Ac,eh,th,rh,nh,ih,oh,ah,sh,uh,ch,hh,lh,fh,dh,ph,_h,gh,mh,vh,yh,bh,wh,xh,Eh,Ch,kh,Dh,Mh,Fh,Sh,Rh,jh,Lh,Ih,qh,Ph,Oh,Bh,Nh,Th,$h,Vh,zh,Uh,Yh,Hh,Gh,Xh,Wh,Kh,Qh,Zh,Jh,Ah,el,tl,rl,nl,il,ol,al,sl,ul,cl,hl,ll,fl,dl,pl,_l,gl,ml,vl,yl,bl,wl,xl,El,Cl,kl,Dl,Ml,Fl,Sl,Rl,jl,Ll,Il,ql,Pl,Ol,Bl,Nl,Tl,$l,Vl,zl,Ul,Yl,Hl,Gl,Xl,Wl,Kl,Ql,Zl,Jl,Al,ef,tf,rf,nf,of,af,sf,uf,cf,hf,lf,ff,df,pf,_f,gf,mf,vf,yf,bf,wf,xf,Ef,Cf,kf,Df,Mf,Ff,Sf={exports:{}};function Rf(){return Fi||(Fi=1,function(e,t){var r=qr(),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}n(u,"cloneBuffer"),e.exports=u}(Sf,Sf.exports)),Sf.exports}function jf(){if(Ri)return Si;function e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}return Ri=1,n(e,"copyArray"),Si=e}function Lf(){if(Li)return ji;function e(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}return Li=1,n(e,"arrayFilter"),ji=e}function If(){if(qi)return Ii;function e(){return[]}return qi=1,n(e,"stubArray"),Ii=e}function qf(){if(Oi)return Pi;Oi=1;var e=Lf(),t=If(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return Pi=n?function(t){return null==t?[]:(t=Object(t),e(n(t),function(e){return r.call(t,e)}))}:t}function Pf(){if(Ni)return Bi;Ni=1;var e=gn(),t=qf();function r(r,n){return e(r,t(r),n)}return n(r,"copySymbols"),Bi=r}function Of(){if($i)return Ti;function e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}return $i=1,n(e,"arrayPush"),Ti=e}function Bf(){if(zi)return Vi;zi=1;var e=vi()(Object.getPrototypeOf,Object);return Vi=e}function Nf(){if(Yi)return Ui;Yi=1;var e=Of(),t=Bf(),r=qf(),n=If(),i=Object.getOwnPropertySymbols;return Ui=i?function(n){for(var i=[];n;)e(i,r(n)),n=t(n);return i}:n}function Tf(){if(Gi)return Hi;Gi=1;var e=gn(),t=Nf();function r(r,n){return e(r,t(r),n)}return n(r,"copySymbolsIn"),Hi=r}function $f(){if(Wi)return Xi;Wi=1;var e=Of(),t=wn();function r(r,n,i){var o=n(r);return t(r)?o:e(o,i(r))}return n(r,"baseGetAllKeys"),Xi=r}function Vf(){if(Qi)return Ki;Qi=1;var e=$f(),t=qf(),r=xi();function i(n){return e(n,r,t)}return n(i,"getAllKeys"),Ki=i}function zf(){if(Ji)return Zi;Ji=1;var e=$f(),t=Nf(),r=Di();function i(n){return e(n,r,t)}return n(i,"getAllKeysIn"),Zi=i}function Uf(){if(eo)return Ai;eo=1;var e=Gr()(qr(),"DataView");return Ai=e}function Yf(){if(ro)return to;ro=1;var e=Gr()(qr(),"Promise");return to=e}function Hf(){if(io)return no;io=1;var e=Gr()(qr(),"Set");return no=e}function Gf(){if(ao)return oo;ao=1;var e=Gr()(qr(),"WeakMap");return oo=e}function Xf(){if(uo)return so;uo=1;var e=Uf(),t=Xr(),r=Yf(),i=Hf(),o=Gf(),a=Nr(),s=Ur(),u="[object Map]",c="[object Promise]",h="[object Set]",l="[object WeakMap]",f="[object DataView]",d=s(e),p=s(t),_=s(r),g=s(i),m=s(o),v=a;return(e&&v(new e(new ArrayBuffer(1)))!=f||t&&v(new t)!=u||r&&v(r.resolve())!=c||i&&v(new i)!=h||o&&v(new o)!=l)&&(v=/* @__PURE__ */n(function(e){var t=a(e),r="[object Object]"==t?e.constructor:void 0,n=r?s(r):"";if(n)switch(n){case d:return f;case p:return u;case _:return c;case g:return h;case m:return l}return t},"getTag")),so=v}function Wf(){if(ho)return co;ho=1;var e=Object.prototype.hasOwnProperty;function t(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}return n(t,"initCloneArray"),co=t}function Kf(){if(fo)return lo;fo=1;var e=qr().Uint8Array;return lo=e}function Qf(){if(_o)return po;_o=1;var e=Kf();function t(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}return n(t,"cloneArrayBuffer"),po=t}function Zf(){if(mo)return go;mo=1;var e=Qf();function t(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}return n(t,"cloneDataView"),go=t}function Jf(){if(yo)return vo;yo=1;var e=/\w*$/;function t(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}return n(t,"cloneRegExp"),vo=t}function Af(){if(wo)return bo;wo=1;var e=Pr(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function i(e){return r?Object(r.call(e)):{}}return n(i,"cloneSymbol"),bo=i}function ed(){if(Eo)return xo;Eo=1;var e=Qf();function t(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}return n(t,"cloneTypedArray"),xo=t}function td(){if(ko)return Co;ko=1;var e=Qf(),t=Zf(),r=Jf(),i=Af(),o=ed();function a(n,a,s){var u=n.constructor;switch(a){case"[object ArrayBuffer]":return e(n);case"[object Boolean]":case"[object Date]":return new u(+n);case"[object DataView]":return t(n,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(n,s);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(n);case"[object RegExp]":return r(n);case"[object Symbol]":return i(n)}}return n(a,"initCloneByTag"),Co=a}function rd(){if(Mo)return Do;Mo=1;var e=Tr(),t=Object.create;return Do=/* @__PURE__ */function(){function r(){}return n(r,"object"),function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var i=new r;return r.prototype=void 0,i}}()}function nd(){if(So)return Fo;So=1;var e=rd(),t=Bf(),r=mi();function i(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}return n(i,"initCloneObject"),Fo=i}function id(){if(jo)return Ro;jo=1;var e=Xf(),t=vn();function r(r){return t(r)&&"[object Map]"==e(r)}return n(r,"baseIsMap"),Ro=r}function od(){if(Io)return Lo;Io=1;var e=id(),t=Tn(),r=pi(),n=r&&r.isMap,i=n?t(n):e;return Lo=i}function ad(){if(Po)return qo;Po=1;var e=Xf(),t=vn();function r(r){return t(r)&&"[object Set]"==e(r)}return n(r,"baseIsSet"),qo=r}function sd(){if(Bo)return Oo;Bo=1;var e=ad(),t=Tn(),r=pi(),n=r&&r.isSet,i=n?t(n):e;return Oo=i}function ud(){if(To)return No;To=1;var e=ln(),t=fn(),r=_n(),i=Ei(),o=Mi(),a=Rf(),s=jf(),u=Pf(),c=Tf(),h=Vf(),l=zf(),f=Xf(),d=Wf(),p=td(),_=nd(),g=wn(),m=Pn(),v=od(),y=Tr(),b=sd(),w=xi(),x=Di(),E="[object Arguments]",C="[object Function]",k="[object Object]",D={};function M(n,F,S,R,j,L){var I,q=1&F,P=2&F,O=4&F;if(S&&(I=j?S(n,R,j,L):S(n)),void 0!==I)return I;if(!y(n))return n;var B=g(n);if(B){if(I=d(n),!q)return s(n,I)}else{var N=f(n),T=N==C||"[object GeneratorFunction]"==N;if(m(n))return a(n,q);if(N==k||N==E||T&&!j){if(I=P||T?{}:_(n),!q)return P?c(n,o(I,n)):u(n,i(I,n))}else{if(!D[N])return j?n:{};I=p(n,N,q)}}L||(L=new e);var $=L.get(n);if($)return $;L.set(n,I),b(n)?n.forEach(function(e){I.add(M(e,F,S,e,n,L))}):v(n)&&n.forEach(function(e,t){I.set(t,M(e,F,S,t,n,L))});var V=B?void 0:(O?P?l:h:P?x:w)(n);return t(V||n,function(e,t){V&&(e=n[t=e]),r(I,t,M(e,F,S,t,n,L))}),I}return D[E]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object DataView]"]=D["[object Boolean]"]=D["[object Date]"]=D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Map]"]=D["[object Number]"]=D[k]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object Symbol]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Error]"]=D[C]=D["[object WeakMap]"]=!1,n(M,"baseClone"),No=M}function cd(){if(Vo)return $o;Vo=1;var e=ud();function t(t){return e(t,4)}return n(t,"clone"),$o=t}function hd(){if(Uo)return zo;function e(e){return function(){return e}}return Uo=1,n(e,"constant"),zo=e}function ld(){if(Ho)return Yo;function e(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}return Ho=1,n(e,"createBaseFor"),Yo=e}function fd(){if(Xo)return Go;Xo=1;var e=ld()();return Go=e}function dd(){if(Ko)return Wo;Ko=1;var e=fd(),t=xi();function r(r,n){return r&&e(r,n,t)}return n(r,"baseForOwn"),Wo=r}function pd(){if(Zo)return Qo;Zo=1;var e=wi();function t(t,r){return function(n,i){if(null==n)return n;if(!e(n))return t(n,i);for(var o=n.length,a=r?o:-1,s=Object(n);(r?a--:++a<o)&&!1!==i(s[a],a,s););return n}}return n(t,"createBaseEach"),Qo=t}function _d(){if(Ao)return Jo;Ao=1;var e=dd(),t=pd()(e);return Jo=t}function gd(){if(ta)return ea;function e(e){return e}return ta=1,n(e,"identity"),ea=e}function md(){if(na)return ra;na=1;var e=gd();function t(t){return"function"==typeof t?t:e}return n(t,"castFunction"),ra=t}function vd(){if(oa)return ia;oa=1;var e=fn(),t=_d(),r=md(),i=wn();function o(n,o){return(i(n)?e:t)(n,r(o))}return n(o,"forEach"),ia=o}function yd(){return sa?aa:(sa=1,aa=vd())}function bd(){if(ca)return ua;ca=1;var e=_d();function t(t,r){var n=[];return e(t,function(e,t,i){r(e,t,i)&&n.push(e)}),n}return n(t,"baseFilter"),ua=t}function wd(){if(la)return ha;la=1;function e(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}return n(e,"setCacheAdd"),ha=e}function xd(){if(da)return fa;function e(e){return this.__data__.has(e)}return da=1,n(e,"setCacheHas"),fa=e}function Ed(){if(_a)return pa;_a=1;var e=cn(),t=wd(),r=xd();function i(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n(i,"SetCache"),i.prototype.add=i.prototype.push=t,i.prototype.has=r,pa=i}function Cd(){if(ma)return ga;function e(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}return ma=1,n(e,"arraySome"),ga=e}function kd(){if(ya)return va;function e(e,t){return e.has(t)}return ya=1,n(e,"cacheHas"),va=e}function Dd(){if(wa)return ba;wa=1;var e=Ed(),t=Cd(),r=kd();function i(n,i,o,a,s,u){var c=1&o,h=n.length,l=i.length;if(h!=l&&!(c&&l>h))return!1;var f=u.get(n),d=u.get(i);if(f&&d)return f==i&&d==n;var p=-1,_=!0,g=2&o?new e:void 0;for(u.set(n,i),u.set(i,n);++p<h;){var m=n[p],v=i[p];if(a)var y=c?a(v,m,p,i,n,u):a(m,v,p,n,i,u);if(void 0!==y){if(y)continue;_=!1;break}if(g){if(!t(i,function(e,t){if(!r(g,t)&&(m===e||s(m,e,o,a,u)))return g.push(t)})){_=!1;break}}else if(m!==v&&!s(m,v,o,a,u)){_=!1;break}}return u.delete(n),u.delete(i),_}return n(i,"equalArrays"),ba=i}function Md(){if(Ea)return xa;function e(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}return Ea=1,n(e,"mapToArray"),xa=e}function Fd(){if(ka)return Ca;function e(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}return ka=1,n(e,"setToArray"),Ca=e}function Sd(){if(Ma)return Da;Ma=1;var e=Pr(),t=Kf(),r=xr(),i=Dd(),o=Md(),a=Fd(),s=e?e.prototype:void 0,u=s?s.valueOf:void 0;function c(e,n,s,c,h,l,f){switch(s){case"[object DataView]":if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=n.byteLength||!l(new t(e),new t(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+n);case"[object Error]":return e.name==n.name&&e.message==n.message;case"[object RegExp]":case"[object String]":return e==n+"";case"[object Map]":var d=o;case"[object Set]":var p=1&c;if(d||(d=a),e.size!=n.size&&!p)return!1;var _=f.get(e);if(_)return _==n;c|=2,f.set(e,n);var g=i(d(e),d(n),c,h,l,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(n)}return!1}return n(c,"equalByTag"),Da=c}function Rd(){if(Sa)return Fa;Sa=1;var e=Vf(),t=Object.prototype.hasOwnProperty;function r(r,n,i,o,a,s){var u=1&i,c=e(r),h=c.length;if(h!=e(n).length&&!u)return!1;for(var l=h;l--;){var f=c[l];if(!(u?f in n:t.call(n,f)))return!1}var d=s.get(r),p=s.get(n);if(d&&p)return d==n&&p==r;var _=!0;s.set(r,n),s.set(n,r);for(var g=u;++l<h;){var m=r[f=c[l]],v=n[f];if(o)var y=u?o(v,m,f,n,r,s):o(m,v,f,r,n,s);if(!(void 0===y?m===v||a(m,v,i,o,s):y)){_=!1;break}g||(g="constructor"==f)}if(_&&!g){var b=r.constructor,w=n.constructor;b==w||!("constructor"in r)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(_=!1)}return s.delete(r),s.delete(n),_}return n(r,"equalObjects"),Fa=r}function jd(){if(ja)return Ra;ja=1;var e=ln(),t=Dd(),r=Sd(),i=Rd(),o=Xf(),a=wn(),s=Pn(),u=_i(),c="[object Arguments]",h="[object Array]",l="[object Object]",f=Object.prototype.hasOwnProperty;function d(n,d,p,_,g,m){var v=a(n),y=a(d),b=v?h:o(n),w=y?h:o(d),x=(b=b==c?l:b)==l,E=(w=w==c?l:w)==l,C=b==w;if(C&&s(n)){if(!s(d))return!1;v=!0,x=!1}if(C&&!x)return m||(m=new e),v||u(n)?t(n,d,p,_,g,m):r(n,d,b,p,_,g,m);if(!(1&p)){var k=x&&f.call(n,"__wrapped__"),D=E&&f.call(d,"__wrapped__");if(k||D){var M=k?n.value():n,F=D?d.value():d;return m||(m=new e),g(M,F,p,_,m)}}return!!C&&(m||(m=new e),i(n,d,p,_,g,m))}return n(d,"baseIsEqualDeep"),Ra=d}function Ld(){if(Ia)return La;Ia=1;var e=jd(),t=vn();function r(n,i,o,a,s){return n===i||(null==n||null==i||!t(n)&&!t(i)?n!=n&&i!=i:e(n,i,o,a,r,s))}return n(r,"baseIsEqual"),La=r}function Id(){if(Pa)return qa;Pa=1;var e=ln(),t=Ld();function r(r,n,i,o){var a=i.length,s=a,u=!o;if(null==r)return!s;for(r=Object(r);a--;){var c=i[a];if(u&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++a<s;){var h=(c=i[a])[0],l=r[h],f=c[1];if(u&&c[2]){if(void 0===l&&!(h in r))return!1}else{var d=new e;if(o)var p=o(l,f,h,r,n,d);if(!(void 0===p?t(f,l,3,o,d):p))return!1}}return!0}return n(r,"baseIsMatch"),qa=r}function qd(){if(Ba)return Oa;Ba=1;var e=Tr();function t(t){return t==t&&!e(t)}return n(t,"isStrictComparable"),Oa=t}function Pd(){if(Ta)return Na;Ta=1;var e=qd(),t=xi();function r(r){for(var n=t(r),i=n.length;i--;){var o=n[i],a=r[o];n[i]=[o,a,e(a)]}return n}return n(r,"getMatchData"),Na=r}function Od(){if(Va)return $a;function e(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}return Va=1,n(e,"matchesStrictComparable"),$a=e}function Bd(){if(Ua)return za;Ua=1;var e=Id(),t=Pd(),r=Od();function i(n){var i=t(n);return 1==i.length&&i[0][2]?r(i[0][0],i[0][1]):function(t){return t===n||e(t,n,i)}}return n(i,"baseMatches"),za=i}function Nd(){if(Ha)return Ya;Ha=1;var e=Nr(),t=vn();function r(r){return"symbol"==typeof r||t(r)&&"[object Symbol]"==e(r)}return n(r,"isSymbol"),Ya=r}function Td(){if(Xa)return Ga;Xa=1;var e=wn(),t=Nd(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function o(n,o){if(e(n))return!1;var a=typeof n;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=n&&!t(n))||(i.test(n)||!r.test(n)||null!=o&&n in Object(o))}return n(o,"isKey"),Ga=o}function $d(){if(Ka)return Wa;Ka=1;var e=cn();function t(r,i){if("function"!=typeof r||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");var o=/* @__PURE__ */n(function(){var e=arguments,t=i?i.apply(this,e):e[0],n=o.cache;if(n.has(t))return n.get(t);var a=r.apply(this,e);return o.cache=n.set(t,a)||n,a},"memoized");return o.cache=new(t.Cache||e),o}return n(t,"memoize"),t.Cache=e,Wa=t}function Vd(){if(Za)return Qa;Za=1;var e=$d();function t(t){var r=e(t,function(e){return 500===n.size&&n.clear(),e}),n=r.cache;return r}return n(t,"memoizeCapped"),Qa=t}function zd(){if(Aa)return Ja;Aa=1;var e=Vd(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,i,o){n.push(i?o.replace(r,"$1"):t||e)}),n});return Ja=n}function Ud(){if(ts)return es;function e(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}return ts=1,n(e,"arrayMap"),es=e}function Yd(){if(ns)return rs;ns=1;var e=Pr(),t=Ud(),r=wn(),i=Nd(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function s(e){if("string"==typeof e)return e;if(r(e))return t(e,s)+"";if(i(e))return a?a.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}return n(s,"baseToString"),rs=s}function Hd(){if(os)return is;os=1;var e=Yd();function t(t){return null==t?"":e(t)}return n(t,"toString"),is=t}function Gd(){if(ss)return as;ss=1;var e=wn(),t=Td(),r=zd(),i=Hd();function o(n,o){return e(n)?n:t(n,o)?[n]:r(i(n))}return n(o,"castPath"),as=o}function Xd(){if(cs)return us;cs=1;var e=Nd();function t(t){if("string"==typeof t||e(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}return n(t,"toKey"),us=t}function Wd(){if(ls)return hs;ls=1;var e=Gd(),t=Xd();function r(r,n){for(var i=0,o=(n=e(n,r)).length;null!=r&&i<o;)r=r[t(n[i++])];return i&&i==o?r:void 0}return n(r,"baseGet"),hs=r}function Kd(){if(ds)return fs;ds=1;var e=Wd();function t(t,r,n){var i=null==t?void 0:e(t,r);return void 0===i?n:i}return n(t,"get"),fs=t}function Qd(){if(_s)return ps;function e(e,t){return null!=e&&t in Object(e)}return _s=1,n(e,"baseHasIn"),ps=e}function Zd(){if(ms)return gs;ms=1;var e=Gd(),t=bn(),r=wn(),i=On(),o=Bn(),a=Xd();function s(n,s,u){for(var c=-1,h=(s=e(s,n)).length,l=!1;++c<h;){var f=a(s[c]);if(!(l=null!=n&&u(n,f)))break;n=n[f]}return l||++c!=h?l:!!(h=null==n?0:n.length)&&o(h)&&i(f,h)&&(r(n)||t(n))}return n(s,"hasPath"),gs=s}function Jd(){if(ys)return vs;ys=1;var e=Qd(),t=Zd();function r(r,n){return null!=r&&t(r,n,e)}return n(r,"hasIn"),vs=r}function Ad(){if(ws)return bs;ws=1;var e=Ld(),t=Kd(),r=Jd(),i=Td(),o=qd(),a=Od(),s=Xd();function u(n,u){return i(n)&&o(u)?a(s(n),u):function(i){var o=t(i,n);return void 0===o&&o===u?r(i,n):e(u,o,3)}}return n(u,"baseMatchesProperty"),bs=u}function ep(){if(Es)return xs;function e(e){return function(t){return null==t?void 0:t[e]}}return Es=1,n(e,"baseProperty"),xs=e}function tp(){if(ks)return Cs;ks=1;var e=Wd();function t(t){return function(r){return e(r,t)}}return n(t,"basePropertyDeep"),Cs=t}function rp(){if(Ms)return Ds;Ms=1;var e=ep(),t=tp(),r=Td(),i=Xd();function o(n){return r(n)?e(i(n)):t(n)}return n(o,"property"),Ds=o}function np(){if(Ss)return Fs;Ss=1;var e=Bd(),t=Ad(),r=gd(),i=wn(),o=rp();function a(n){return"function"==typeof n?n:null==n?r:"object"==typeof n?i(n)?t(n[0],n[1]):e(n):o(n)}return n(a,"baseIteratee"),Fs=a}function ip(){if(js)return Rs;js=1;var e=Lf(),t=bd(),r=np(),i=wn();function o(n,o){return(i(n)?e:t)(n,r(o,3))}return n(o,"filter"),Rs=o}function op(){if(Is)return Ls;Is=1;var e=Object.prototype.hasOwnProperty;function t(t,r){return null!=t&&e.call(t,r)}return n(t,"baseHas"),Ls=t}function ap(){if(Ps)return qs;Ps=1;var e=op(),t=Zd();function r(r,n){return null!=r&&t(r,n,e)}return n(r,"has"),qs=r}function sp(){if(Bs)return Os;Bs=1;var e=bi(),t=Xf(),r=bn(),i=wn(),o=wi(),a=Pn(),s=mi(),u=_i(),c=Object.prototype.hasOwnProperty;function h(n){if(null==n)return!0;if(o(n)&&(i(n)||"string"==typeof n||"function"==typeof n.splice||a(n)||u(n)||r(n)))return!n.length;var h=t(n);if("[object Map]"==h||"[object Set]"==h)return!n.size;if(s(n))return!e(n).length;for(var l in n)if(c.call(n,l))return!1;return!0}return n(h,"isEmpty"),Os=h}function up(){if(Ts)return Ns;function e(e){return void 0===e}return Ts=1,n(e,"isUndefined"),Ns=e}function cp(){if(Vs)return $s;Vs=1;var e=_d(),t=wi();function r(r,n){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(e,t,r){o[++i]=n(e,t,r)}),o}return n(r,"baseMap"),$s=r}function hp(){if(Us)return zs;Us=1;var e=Ud(),t=np(),r=cp(),i=wn();function o(n,o){return(i(n)?e:r)(n,t(o,3))}return n(o,"map"),zs=o}function lp(){if(Hs)return Ys;function e(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}return Hs=1,n(e,"arrayReduce"),Ys=e}function fp(){if(Xs)return Gs;function e(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}return Xs=1,n(e,"baseReduce"),Gs=e}function dp(){if(Ks)return Ws;Ks=1;var e=lp(),t=_d(),r=np(),i=fp(),o=wn();function a(n,a,s){var u=o(n)?e:i,c=arguments.length<3;return u(n,r(a,4),s,c,t)}return n(a,"reduce"),Ws=a}function pp(){if(Zs)return Qs;Zs=1;var e=Nr(),t=wn(),r=vn();function i(n){return"string"==typeof n||!t(n)&&r(n)&&"[object String]"==e(n)}return n(i,"isString"),Qs=i}function _p(){if(As)return Js;As=1;var e=ep()("length");return Js=e}function gp(){if(tu)return eu;tu=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function t(t){return e.test(t)}return n(t,"hasUnicode"),eu=t}function mp(){if(nu)return ru;nu=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?",h=c+u+("(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*"),l="(?:"+[o+r+"?",r,a,s,t].join("|")+")",f=RegExp(i+"(?="+i+")|"+l+h,"g");function d(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}return n(d,"unicodeSize"),ru=d}function vp(){if(ou)return iu;ou=1;var e=_p(),t=gp(),r=mp();function i(n){return t(n)?r(n):e(n)}return n(i,"stringSize"),iu=i}function yp(){if(su)return au;su=1;var e=bi(),t=Xf(),r=wi(),i=pp(),o=vp();function a(n){if(null==n)return 0;if(r(n))return i(n)?o(n):n.length;var a=t(n);return"[object Map]"==a||"[object Set]"==a?n.size:e(n).length}return n(a,"size"),au=a}function bp(){if(cu)return uu;cu=1;var e=fn(),t=rd(),r=dd(),i=np(),o=Bf(),a=wn(),s=Pn(),u=$r(),c=Tr(),h=_i();function l(n,l,f){var d=a(n),p=d||s(n)||h(n);if(l=i(l,4),null==f){var _=n&&n.constructor;f=p?d?new _:[]:c(n)&&u(_)?t(o(n)):{}}return(p?e:r)(n,function(e,t,r){return l(f,e,t,r)}),f}return n(l,"transform"),uu=l}function wp(){if(lu)return hu;lu=1;var e=Pr(),t=bn(),r=wn(),i=e?e.isConcatSpreadable:void 0;function o(e){return r(e)||t(e)||!!(i&&e&&e[i])}return n(o,"isFlattenable"),hu=o}function xp(){if(du)return fu;du=1;var e=Of(),t=wp();function r(n,i,o,a,s){var u=-1,c=n.length;for(o||(o=t),s||(s=[]);++u<c;){var h=n[u];i>0&&o(h)?i>1?r(h,i-1,o,a,s):e(s,h):a||(s[s.length]=h)}return s}return n(r,"baseFlatten"),fu=r}function Ep(){if(_u)return pu;function e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return _u=1,n(e,"apply"),pu=e}function Cp(){if(mu)return gu;mu=1;var e=Ep(),t=Math.max;function r(r,n,i){return n=t(void 0===n?r.length-1:n,0),function(){for(var o=arguments,a=-1,s=t(o.length-n,0),u=Array(s);++a<s;)u[a]=o[n+a];a=-1;for(var c=Array(n+1);++a<n;)c[a]=o[a];return c[n]=i(u),e(r,this,c)}}return n(r,"overRest"),gu=r}function kp(){if(yu)return vu;yu=1;var e=hd(),t=dn(),r=gd();return vu=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}function Dp(){if(wu)return bu;wu=1;var e=Date.now;function t(t){var r=0,n=0;return function(){var i=e(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}return n(t,"shortOut"),bu=t}function Mp(){if(Eu)return xu;Eu=1;var e=kp(),t=Dp()(e);return xu=t}function Fp(){if(ku)return Cu;ku=1;var e=gd(),t=Cp(),r=Mp();function i(n,i){return r(t(n,i,e),n+"")}return n(i,"baseRest"),Cu=i}function Sp(){if(Mu)return Du;function e(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Mu=1,n(e,"baseFindIndex"),Du=e}function Rp(){if(Su)return Fu;function e(e){return e!=e}return Su=1,n(e,"baseIsNaN"),Fu=e}function jp(){if(ju)return Ru;function e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}return ju=1,n(e,"strictIndexOf"),Ru=e}function Lp(){if(Iu)return Lu;Iu=1;var e=Sp(),t=Rp(),r=jp();function i(n,i,o){return i==i?r(n,i,o):e(n,t,o)}return n(i,"baseIndexOf"),Lu=i}function Ip(){if(Pu)return qu;Pu=1;var e=Lp();function t(t,r){return!!(null==t?0:t.length)&&e(t,r,0)>-1}return n(t,"arrayIncludes"),qu=t}function qp(){if(Bu)return Ou;function e(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}return Bu=1,n(e,"arrayIncludesWith"),Ou=e}function Pp(){if(Tu)return Nu;function e(){}return Tu=1,n(e,"noop"),Nu=e}function Op(){if(Vu)return $u;Vu=1;var e=Hf(),t=Pp(),r=Fd(),n=e&&1/r(new e([,-0]))[1]==1/0?function(t){return new e(t)}:t;return $u=n}function Bp(){if(Uu)return zu;Uu=1;var e=Ed(),t=Ip(),r=qp(),i=kd(),o=Op(),a=Fd();function s(n,s,u){var c=-1,h=t,l=n.length,f=!0,d=[],p=d;if(u)f=!1,h=r;else if(l>=200){var _=s?null:o(n);if(_)return a(_);f=!1,h=i,p=new e}else p=s?[]:d;e:for(;++c<l;){var g=n[c],m=s?s(g):g;if(g=u||0!==g?g:0,f&&m==m){for(var v=p.length;v--;)if(p[v]===m)continue e;s&&p.push(m),d.push(g)}else h(p,m,u)||(p!==d&&p.push(m),d.push(g))}return d}return n(s,"baseUniq"),zu=s}function Np(){if(Hu)return Yu;Hu=1;var e=wi(),t=vn();function r(r){return t(r)&&e(r)}return n(r,"isArrayLikeObject"),Yu=r}function Tp(){if(Xu)return Gu;Xu=1;var e=xp(),t=Fp(),r=Bp(),n=Np(),i=t(function(t){return r(e(t,1,n,!0))});return Gu=i}function $p(){if(Ku)return Wu;Ku=1;var e=Ud();function t(t,r){return e(r,function(e){return t[e]})}return n(t,"baseValues"),Wu=t}function Vp(){if(Zu)return Qu;Zu=1;var e=$p(),t=xi();function r(r){return null==r?[]:e(r,t(r))}return n(r,"values"),Qu=r}function zp(){if(Au)return Ju;var e;Au=1;try{e={clone:cd(),constant:hd(),each:yd(),filter:ip(),has:ap(),isArray:wn(),isEmpty:sp(),isFunction:$r(),isUndefined:up(),keys:xi(),map:hp(),reduce:dp(),size:yp(),transform:bp(),union:Tp(),values:Vp()}}catch(t){}return e||(e=window._),Ju=e}function Up(){if(tc)return ec;tc=1;var e=zp();ec=r;var t="\0";function r(r){this._isDirected=!e.has(r,"directed")||r.directed,this._isMultigraph=!!e.has(r,"multigraph")&&r.multigraph,this._isCompound=!!e.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function a(t,r,n,i){var o=""+r,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}return o+""+a+""+(e.isUndefined(i)?"\0":i)}function s(e,t,r,n){var i=""+t,o=""+r;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}function u(e,t){return a(e,t.v,t.w,t.name)}return n(r,"Graph"),r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return e.keys(this._nodes)},r.prototype.sources=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._in[r])})},r.prototype.sinks=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._out[r])})},r.prototype.setNodes=function(t,r){var n=arguments,i=this;return e.each(t,function(e){n.length>1?i.setNode(e,r):i.setNode(e)}),this},r.prototype.setNode=function(r,n){return e.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=n),this):(this._nodes[r]=arguments.length>1?n:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=t,this._children[r]={},this._children[t][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(t){return e.has(this._nodes,t)},r.prototype.removeNode=function(t){var r=this;if(e.has(this._nodes,t)){var i=/* @__PURE__ */n(function(e){r.removeEdge(r._edgeObjs[e])},"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],e.each(this.children(t),function(e){r.setParent(e)}),delete this._children[t]),e.each(e.keys(this._in[t]),i),delete this._in[t],delete this._preds[t],e.each(e.keys(this._out[t]),i),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(r,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(n))n=t;else{for(var i=n+="";!e.isUndefined(i);i=this.parent(i))if(i===r)throw new Error("Setting "+n+" as parent of "+r+" would create a cycle");this.setNode(n)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=n,this._children[n][r]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var r=this._parent[e];if(r!==t)return r}},r.prototype.children=function(r){if(e.isUndefined(r)&&(r=t),this._isCompound){var n=this._children[r];if(n)return e.keys(n)}else{if(r===t)return this.nodes();if(this.hasNode(r))return[]}},r.prototype.predecessors=function(t){var r=this._preds[t];if(r)return e.keys(r)},r.prototype.successors=function(t){var r=this._sucs[t];if(r)return e.keys(r)},r.prototype.neighbors=function(t){var r=this.predecessors(t);if(r)return e.union(r,this.successors(t))},r.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},r.prototype.filterNodes=function(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;e.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)}),e.each(this._edgeObjs,function(e){r.hasNode(e.v)&&r.hasNode(e.w)&&r.setEdge(e,i.edge(e))});var o={};function a(e){var t=i.parent(e);return void 0===t||r.hasNode(t)?(o[e]=t,t):t in o?o[t]:a(t)}return n(a,"findParent"),this._isCompound&&e.each(r.nodes(),function(e){r.setParent(e,a(e))}),r},r.prototype.setDefaultEdgeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return e.values(this._edgeObjs)},r.prototype.setPath=function(t,r){var n=this,i=arguments;return e.reduce(t,function(e,t){return i.length>1?n.setEdge(e,t,r):n.setEdge(e,t),t}),this},r.prototype.setEdge=function(){var t,r,n,o,u=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,r=c.w,n=c.name,2===arguments.length&&(o=arguments[1],u=!0)):(t=c,r=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],u=!0)),t=""+t,r=""+r,e.isUndefined(n)||(n=""+n);var h=a(this._isDirected,t,r,n);if(e.has(this._edgeLabels,h))return u&&(this._edgeLabels[h]=o),this;if(!e.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[h]=u?o:this._defaultEdgeLabelFn(t,r,n);var l=s(this._isDirected,t,r,n);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[h]=l,i(this._preds[r],t),i(this._sucs[t],r),this._in[r][h]=l,this._out[t][h]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,r,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,r,n);return e.has(this._edgeLabels,i)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),i=this._edgeObjs[n];return i&&(e=i.v,t=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],o(this._preds[t],e),o(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(t,r){var n=this._in[t];if(n){var i=e.values(n);return r?e.filter(i,function(e){return e.v===r}):i}},r.prototype.outEdges=function(t,r){var n=this._out[t];if(n){var i=e.values(n);return r?e.filter(i,function(e){return e.w===r}):i}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))},n(i,"incrementOrInitEntry"),n(o,"decrementOrRemoveEntry"),n(a,"edgeArgsToId"),n(s,"edgeArgsToObj"),n(u,"edgeObjToId"),ec}function Yp(){return nc?rc:(nc=1,rc="2.1.8")}function Hp(){return oc?ic:(oc=1,ic={Graph:Up(),version:Yp()})}function Gp(){if(sc)return ac;sc=1;var e=zp(),t=Up();function r(t){var r={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:i(t),edges:o(t)};return e.isUndefined(t.graph())||(r.value=e.clone(t.graph())),r}function i(t){return e.map(t.nodes(),function(r){var n=t.node(r),i=t.parent(r),o={v:r};return e.isUndefined(n)||(o.value=n),e.isUndefined(i)||(o.parent=i),o})}function o(t){return e.map(t.edges(),function(r){var n=t.edge(r),i={v:r.v,w:r.w};return e.isUndefined(r.name)||(i.name=r.name),e.isUndefined(n)||(i.value=n),i})}function a(r){var n=new t(r.options).setGraph(r.value);return e.each(r.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),e.each(r.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}return ac={write:r,read:a},n(r,"write"),n(i,"writeNodes"),n(o,"writeEdges"),n(a,"read"),ac}function Xp(){if(cc)return uc;cc=1;var e=zp();function t(t){var r,i={},o=[];function a(n){e.has(i,n)||(i[n]=!0,r.push(n),e.each(t.successors(n),a),e.each(t.predecessors(n),a))}return n(a,"dfs"),e.each(t.nodes(),function(e){r=[],a(e),r.length&&o.push(r)}),o}return uc=t,n(t,"components"),uc}function Wp(){if(lc)return hc;lc=1;var e=zp();function t(){this._arr=[],this._keyIndices={}}return hc=t,n(t,"PriorityQueue"),t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(t){return e.has(this._keyIndices,t)},t.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,r){var n=this._keyIndices;if(t=String(t),!e.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:r}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},t.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,i=e;r<t.length&&(i=t[r].priority<t[i].priority?r:i,n<t.length&&(i=t[n].priority<t[i].priority?n:i),i!==e&&(this._swap(e,i),this._heapify(i)))},t.prototype._decrease=function(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t},t.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,i=r[e],o=r[t];r[e]=o,r[t]=i,n[o.key]=e,n[i.key]=t},hc}function Kp(){if(dc)return fc;dc=1;var e=zp(),t=Wp();fc=i;var r=e.constant(1);function i(e,t,n,i){return o(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function o(e,r,i,o){var a,s,u={},c=new t,h=/* @__PURE__ */n(function(e){var t=e.v!==a?e.v:e.w,r=u[t],n=i(e),o=s.distance+n;if(n<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+n);o<r.distance&&(r.distance=o,r.predecessor=a,c.decrease(t,o))},"updateNeighbors");for(e.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;u[e]={distance:t},c.add(e,t)});c.size()>0&&(a=c.removeMin(),(s=u[a]).distance!==Number.POSITIVE_INFINITY);)o(a).forEach(h);return u}return n(i,"dijkstra"),n(o,"runDijkstra"),fc}function Qp(){if(_c)return pc;_c=1;var e=Kp(),t=zp();function r(r,n,i){return t.transform(r.nodes(),function(t,o){t[o]=e(r,o,n,i)},{})}return pc=r,n(r,"dijkstraAll"),pc}function Zp(){if(mc)return gc;mc=1;var e=zp();function t(t){var r=0,i=[],o={},a=[];function s(n){var u=o[n]={onStack:!0,lowlink:r,index:r++};if(i.push(n),t.successors(n).forEach(function(t){e.has(o,t)?o[t].onStack&&(u.lowlink=Math.min(u.lowlink,o[t].index)):(s(t),u.lowlink=Math.min(u.lowlink,o[t].lowlink))}),u.lowlink===u.index){var c,h=[];do{c=i.pop(),o[c].onStack=!1,h.push(c)}while(n!==c);a.push(h)}}return n(s,"dfs"),t.nodes().forEach(function(t){e.has(o,t)||s(t)}),a}return gc=t,n(t,"tarjan"),gc}function Jp(){if(yc)return vc;yc=1;var e=zp(),t=Zp();function r(r){return e.filter(t(r),function(e){return e.length>1||1===e.length&&r.hasEdge(e[0],e[0])})}return vc=r,n(r,"findCycles"),vc}function Ap(){if(wc)return bc;wc=1;var e=zp();bc=r;var t=e.constant(1);function r(e,r,n){return i(e,r||t,n||function(t){return e.outEdges(t)})}function i(e,t,r){var n={},i=e.nodes();return i.forEach(function(e){n[e]={},n[e][e]={distance:0},i.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var i=r.v===e?r.w:r.v,o=t(r);n[e][i]={distance:o,predecessor:e}})}),i.forEach(function(e){var t=n[e];i.forEach(function(r){var o=n[r];i.forEach(function(r){var n=o[e],i=t[r],a=o[r],s=n.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)})})}),n}return n(r,"floydWarshall"),n(i,"runFloydWarshall"),bc}function e_(){if(Ec)return xc;Ec=1;var e=zp();function t(t){var i={},o={},a=[];function s(n){if(e.has(o,n))throw new r;e.has(i,n)||(o[n]=!0,i[n]=!0,e.each(t.predecessors(n),s),delete o[n],a.push(n))}if(n(s,"visit"),e.each(t.sinks(),s),e.size(i)!==t.nodeCount())throw new r;return a}function r(){}return xc=t,t.CycleException=r,n(t,"topsort"),n(r,"CycleException"),r.prototype=new Error,xc}function t_(){if(kc)return Cc;kc=1;var e=e_();function t(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Cc=t,n(t,"isAcyclic"),Cc}function r_(){if(Mc)return Dc;Mc=1;var e=zp();function t(t,n,i){e.isArray(n)||(n=[n]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return e.each(n,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===i,s,o,a)}),a}function r(t,n,i,o,a,s){e.has(o,n)||(o[n]=!0,i||s.push(n),e.each(a(n),function(e){r(t,e,i,o,a,s)}),i&&s.push(n))}return Dc=t,n(t,"dfs"),n(r,"doDfs"),Dc}function n_(){if(Sc)return Fc;Sc=1;var e=r_();function t(t,r){return e(t,r,"post")}return Fc=t,n(t,"postorder"),Fc}function i_(){if(jc)return Rc;jc=1;var e=r_();function t(t,r){return e(t,r,"pre")}return Rc=t,n(t,"preorder"),Rc}function o_(){if(Ic)return Lc;Ic=1;var e=zp(),t=Up(),r=Wp();function i(i,o){var a,s=new t,u={},c=new r;function h(e){var t=e.v===a?e.w:e.v,r=c.priority(t);if(void 0!==r){var n=o(e);n<r&&(u[t]=a,c.decrease(t,n))}}if(n(h,"updateNeighbors"),0===i.nodeCount())return s;e.each(i.nodes(),function(e){c.add(e,Number.POSITIVE_INFINITY),s.setNode(e)}),c.decrease(i.nodes()[0],0);for(var l=!1;c.size()>0;){if(a=c.removeMin(),e.has(u,a))s.setEdge(a,u[a]);else{if(l)throw new Error("Input graph is not connected: "+i);l=!0}i.nodeEdges(a).forEach(h)}return s}return Lc=i,n(i,"prim"),Lc}function a_(){return Pc?qc:(Pc=1,qc={components:Xp(),dijkstra:Kp(),dijkstraAll:Qp(),findCycles:Jp(),floydWarshall:Ap(),isAcyclic:t_(),postorder:n_(),preorder:i_(),prim:o_(),tarjan:Zp(),topsort:e_()})}function s_(){if(Bc)return Oc;Bc=1;var e=Hp();return Oc={Graph:e.Graph,json:Gp(),alg:a_(),version:e.version}}function u_(){if(Tc)return Nc;var e;Tc=1;try{e=s_()}catch(t){}return e||(e=window.graphlib),Nc=e}function c_(){if(Vc)return $c;Vc=1;var e=ud();function t(t){return e(t,5)}return n(t,"cloneDeep"),$c=t}function h_(){if(Uc)return zc;Uc=1;var e=xr(),t=wi(),r=On(),i=Tr();function o(n,o,a){if(!i(a))return!1;var s=typeof o;return!!("number"==s?t(a)&&r(o,a.length):"string"==s&&o in a)&&e(a[o],n)}return n(o,"isIterateeCall"),zc=o}function l_(){if(Hc)return Yc;Hc=1;var e=Fp(),t=xr(),r=h_(),n=Di(),i=Object.prototype,o=i.hasOwnProperty,a=e(function(e,a){e=Object(e);var s=-1,u=a.length,c=u>2?a[2]:void 0;for(c&&r(a[0],a[1],c)&&(u=1);++s<u;)for(var h=a[s],l=n(h),f=-1,d=l.length;++f<d;){var p=l[f],_=e[p];(void 0===_||t(_,i[p])&&!o.call(e,p))&&(e[p]=h[p])}return e});return Yc=a}function f_(){if(Xc)return Gc;Xc=1;var e=np(),t=wi(),r=xi();function i(i){return function(o,a,s){var u=Object(o);if(!t(o)){var c=e(a,3);o=r(o),a=/* @__PURE__ */n(function(e){return c(u[e],e,u)},"predicate")}var h=i(o,a,s);return h>-1?u[c?o[h]:h]:void 0}}return n(i,"createFind"),Gc=i}function d_(){if(Kc)return Wc;Kc=1;var e=/\s/;function t(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}return n(t,"trimmedEndIndex"),Wc=t}function p_(){if(Zc)return Qc;Zc=1;var e=d_(),t=/^\s+/;function r(r){return r?r.slice(0,e(r)+1).replace(t,""):r}return n(r,"baseTrim"),Qc=r}function __(){if(Ac)return Jc;Ac=1;var e=p_(),t=Tr(),r=Nd(),i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;function u(n){if("number"==typeof n)return n;if(r(n))return NaN;if(t(n)){var u="function"==typeof n.valueOf?n.valueOf():n;n=t(u)?u+"":u}if("string"!=typeof n)return 0===n?n:+n;n=e(n);var c=o.test(n);return c||a.test(n)?s(n.slice(2),c?2:8):i.test(n)?NaN:+n}return n(u,"toNumber"),Jc=u}function g_(){if(th)return eh;th=1;var e=__(),t=1/0;function r(r){return r?(r=e(r))===t||r===-1/0?17976931348623157e292*(r<0?-1:1):r==r?r:0:0===r?r:0}return n(r,"toFinite"),eh=r}function m_(){if(nh)return rh;nh=1;var e=g_();function t(t){var r=e(t),n=r%1;return r==r?n?r-n:r:0}return n(t,"toInteger"),rh=t}function v_(){if(oh)return ih;oh=1;var e=Sp(),t=np(),r=m_(),i=Math.max;function o(n,o,a){var s=null==n?0:n.length;if(!s)return-1;var u=null==a?0:r(a);return u<0&&(u=i(s+u,0)),e(n,t(o,3),u)}return n(o,"findIndex"),ih=o}function y_(){if(sh)return ah;sh=1;var e=f_()(v_());return ah=e}function b_(){if(ch)return uh;ch=1;var e=xp();function t(t){return(null==t?0:t.length)?e(t,1):[]}return n(t,"flatten"),uh=t}function w_(){if(lh)return hh;lh=1;var e=fd(),t=md(),r=Di();function i(n,i){return null==n?n:e(n,t(i),r)}return n(i,"forIn"),hh=i}function x_(){if(dh)return fh;function e(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}return dh=1,n(e,"last"),fh=e}function E_(){if(_h)return ph;_h=1;var e=pn(),t=dd(),r=np();function i(n,i){var o={};return i=r(i,3),t(n,function(t,r,n){e(o,r,i(t,r,n))}),o}return n(i,"mapValues"),ph=i}function C_(){if(mh)return gh;mh=1;var e=Nd();function t(t,r,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r(a);if(null!=s&&(void 0===u?s==s&&!e(s):n(s,u)))var u=s,c=a}return c}return n(t,"baseExtremum"),gh=t}function k_(){if(yh)return vh;function e(e,t){return e>t}return yh=1,n(e,"baseGt"),vh=e}function D_(){if(wh)return bh;wh=1;var e=C_(),t=k_(),r=gd();function i(n){return n&&n.length?e(n,r,t):void 0}return n(i,"max"),bh=i}function M_(){if(Eh)return xh;Eh=1;var e=pn(),t=xr();function r(r,n,i){(void 0!==i&&!t(r[n],i)||void 0===i&&!(n in r))&&e(r,n,i)}return n(r,"assignMergeValue"),xh=r}function F_(){if(kh)return Ch;kh=1;var e=Nr(),t=Bf(),r=vn(),i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,u=a.call(Object);function c(n){if(!r(n)||"[object Object]"!=e(n))return!1;var i=t(n);if(null===i)return!0;var o=s.call(i,"constructor")&&i.constructor;return"function"==typeof o&&o instanceof o&&a.call(o)==u}return n(c,"isPlainObject"),Ch=c}function S_(){if(Mh)return Dh;function e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}return Mh=1,n(e,"safeGet"),Dh=e}function R_(){if(Sh)return Fh;Sh=1;var e=gn(),t=Di();function r(r){return e(r,t(r))}return n(r,"toPlainObject"),Fh=r}function j_(){if(jh)return Rh;jh=1;var e=M_(),t=Rf(),r=ed(),i=jf(),o=nd(),a=bn(),s=wn(),u=Np(),c=Pn(),h=$r(),l=Tr(),f=F_(),d=_i(),p=S_(),_=R_();function g(n,g,m,v,y,b,w){var x=p(n,m),E=p(g,m),C=w.get(E);if(C)e(n,m,C);else{var k=b?b(x,E,m+"",n,g,w):void 0,D=void 0===k;if(D){var M=s(E),F=!M&&c(E),S=!M&&!F&&d(E);k=E,M||F||S?s(x)?k=x:u(x)?k=i(x):F?(D=!1,k=t(E,!0)):S?(D=!1,k=r(E,!0)):k=[]:f(E)||a(E)?(k=x,a(x)?k=_(x):l(x)&&!h(x)||(k=o(E))):D=!1}D&&(w.set(E,k),y(k,E,v,b,w),w.delete(E)),e(n,m,k)}}return n(g,"baseMergeDeep"),Rh=g}function L_(){if(Ih)return Lh;Ih=1;var e=ln(),t=M_(),r=fd(),i=j_(),o=Tr(),a=Di(),s=S_();function u(n,c,h,l,f){n!==c&&r(c,function(r,a){if(f||(f=new e),o(r))i(n,c,a,h,u,l,f);else{var d=l?l(s(n,a),r,a+"",n,c,f):void 0;void 0===d&&(d=r),t(n,a,d)}},a)}return n(u,"baseMerge"),Lh=u}function I_(){if(Ph)return qh;Ph=1;var e=Fp(),t=h_();function r(r){return e(function(e,n){var i=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=r.length>3&&"function"==typeof a?(o--,a):void 0,s&&t(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++i<o;){var u=n[i];u&&r(e,u,i,a)}return e})}return n(r,"createAssigner"),qh=r}function q_(){if(Bh)return Oh;Bh=1;var e=L_(),t=I_()(function(t,r,n){e(t,r,n)});return Oh=t}function P_(){if(Th)return Nh;function e(e,t){return e<t}return Th=1,n(e,"baseLt"),Nh=e}function O_(){if(Vh)return $h;Vh=1;var e=C_(),t=P_(),r=gd();function i(n){return n&&n.length?e(n,r,t):void 0}return n(i,"min"),$h=i}function B_(){if(Uh)return zh;Uh=1;var e=C_(),t=np(),r=P_();function i(n,i){return n&&n.length?e(n,t(i,2),r):void 0}return n(i,"minBy"),zh=i}function N_(){if(Hh)return Yh;Hh=1;var e=qr();return Yh=/* @__PURE__ */n(function(){return e.Date.now()},"now")}function T_(){if(Xh)return Gh;Xh=1;var e=_n(),t=Gd(),r=On(),i=Tr(),o=Xd();function a(n,a,s,u){if(!i(n))return n;for(var c=-1,h=(a=t(a,n)).length,l=h-1,f=n;null!=f&&++c<h;){var d=o(a[c]),p=s;if("__proto__"===d||"constructor"===d||"prototype"===d)return n;if(c!=l){var _=f[d];void 0===(p=u?u(_,d,f):void 0)&&(p=i(_)?_:r(a[c+1])?[]:{})}e(f,d,p),f=f[d]}return n}return n(a,"baseSet"),Gh=a}function $_(){if(Kh)return Wh;Kh=1;var e=Wd(),t=T_(),r=Gd();function i(n,i,o){for(var a=-1,s=i.length,u={};++a<s;){var c=i[a],h=e(n,c);o(h,c)&&t(u,r(c,n),h)}return u}return n(i,"basePickBy"),Wh=i}function V_(){if(Zh)return Qh;Zh=1;var e=$_(),t=Jd();function r(r,n){return e(r,n,function(e,n){return t(r,n)})}return n(r,"basePick"),Qh=r}function z_(){if(Ah)return Jh;Ah=1;var e=b_(),t=Cp(),r=Mp();function i(n){return r(t(n,void 0,e),n+"")}return n(i,"flatRest"),Jh=i}function U_(){if(tl)return el;tl=1;var e=V_(),t=z_()(function(t,r){return null==t?{}:e(t,r)});return el=t}function Y_(){if(nl)return rl;nl=1;var e=Math.ceil,t=Math.max;function r(r,n,i,o){for(var a=-1,s=t(e((n-r)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=r,r+=i;return u}return n(r,"baseRange"),rl=r}function H_(){if(ol)return il;ol=1;var e=Y_(),t=h_(),r=g_();function i(n){return function(i,o,a){return a&&"number"!=typeof a&&t(i,o,a)&&(o=a=void 0),i=r(i),void 0===o?(o=i,i=0):o=r(o),a=void 0===a?i<o?1:-1:r(a),e(i,o,a,n)}}return n(i,"createRange"),il=i}function G_(){if(sl)return al;sl=1;var e=H_()();return al=e}function X_(){if(cl)return ul;function e(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return cl=1,n(e,"baseSortBy"),ul=e}function W_(){if(ll)return hl;ll=1;var e=Nd();function t(t,r){if(t!==r){var n=void 0!==t,i=null===t,o=t==t,a=e(t),s=void 0!==r,u=null===r,c=r==r,h=e(r);if(!u&&!h&&!a&&t>r||a&&s&&c&&!u&&!h||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!h&&t<r||h&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}return n(t,"compareAscending"),hl=t}function K_(){if(dl)return fl;dl=1;var e=W_();function t(t,r,n){for(var i=-1,o=t.criteria,a=r.criteria,s=o.length,u=n.length;++i<s;){var c=e(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return t.index-r.index}return n(t,"compareMultiple"),fl=t}function Q_(){if(_l)return pl;_l=1;var e=Ud(),t=Wd(),r=np(),i=cp(),o=X_(),a=Tn(),s=K_(),u=gd(),c=wn();function h(n,h,l){h=h.length?e(h,function(e){return c(e)?function(r){return t(r,1===e.length?e[0]:e)}:e}):[u];var f=-1;h=e(h,a(r));var d=i(n,function(t,r,n){return{criteria:e(h,function(e){return e(t)}),index:++f,value:t}});return o(d,function(e,t){return s(e,t,l)})}return n(h,"baseOrderBy"),pl=h}function Z_(){if(ml)return gl;ml=1;var e=xp(),t=Q_(),r=Fp(),n=h_(),i=r(function(r,i){if(null==r)return[];var o=i.length;return o>1&&n(r,i[0],i[1])?i=[]:o>2&&n(i[0],i[1],i[2])&&(i=[i[0]]),t(r,e(i,1),[])});return gl=i}function J_(){if(yl)return vl;yl=1;var e=Hd(),t=0;function r(r){var n=++t;return e(r)+n}return n(r,"uniqueId"),vl=r}function A_(){if(wl)return bl;function e(e,t,r){for(var n=-1,i=e.length,o=t.length,a={};++n<i;){var s=n<o?t[n]:void 0;r(a,e[n],s)}return a}return wl=1,n(e,"baseZipObject"),bl=e}function eg(){if(El)return xl;El=1;var e=_n(),t=A_();function r(r,n){return t(r||[],n||[],e)}return n(r,"zipObject"),xl=r}function tg(){if(kl)return Cl;var e;kl=1;try{e={cloneDeep:c_(),constant:hd(),defaults:l_(),each:yd(),filter:ip(),find:y_(),flatten:b_(),forEach:vd(),forIn:w_(),has:ap(),isUndefined:up(),last:x_(),map:hp(),mapValues:E_(),max:D_(),merge:q_(),min:O_(),minBy:B_(),now:N_(),pick:U_(),range:G_(),reduce:dp(),sortBy:Z_(),uniqueId:J_(),values:Vp(),zipObject:eg()}}catch(t){}return e||(e=window._),Cl=e}function rg(){if(Ml)return Dl;function e(){var e={};e._next=e._prev=e,this._sentinel=e}function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}return Ml=1,Dl=e,n(e,"List"),e.prototype.dequeue=function(){var e=this._sentinel,r=e._prev;if(r!==e)return t(r),r},e.prototype.enqueue=function(e){var r=this._sentinel;e._prev&&e._next&&t(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r},e.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"},n(t,"unlink"),n(r,"filterOutLinks"),Dl}function ng(){if(Sl)return Fl;Sl=1;var e=tg(),t=u_().Graph,r=rg();Fl=o;var i=e.constant(1);function o(t,r){if(t.nodeCount()<=1)return[];var n=u(t,r||i),o=a(n.graph,n.buckets,n.zeroIdx);return e.flatten(e.map(o,function(e){return t.outEdges(e.v,e.w)}),!0)}function a(e,t,r){for(var n,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;n=a.dequeue();)s(e,t,r,n);for(;n=o.dequeue();)s(e,t,r,n);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(n=t[u].dequeue()){i=i.concat(s(e,t,r,n,!0));break}}return i}function s(t,r,n,i,o){var a=o?[]:void 0;return e.forEach(t.inEdges(i.v),function(e){var i=t.edge(e),s=t.node(e.v);o&&a.push({v:e.v,w:e.w}),s.out-=i,c(r,n,s)}),e.forEach(t.outEdges(i.v),function(e){var i=t.edge(e),o=e.w,a=t.node(o);a.in-=i,c(r,n,a)}),t.removeNode(i.v),a}function u(n,i){var o=new t,a=0,s=0;e.forEach(n.nodes(),function(e){o.setNode(e,{v:e,in:0,out:0})}),e.forEach(n.edges(),function(e){var t=o.edge(e.v,e.w)||0,r=i(e),n=t+r;o.setEdge(e.v,e.w,n),s=Math.max(s,o.node(e.v).out+=r),a=Math.max(a,o.node(e.w).in+=r)});var u=e.range(s+a+3).map(function(){return new r}),h=a+1;return e.forEach(o.nodes(),function(e){c(u,h,o.node(e))}),{graph:o,buckets:u,zeroIdx:h}}function c(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}return n(o,"greedyFAS"),n(a,"doGreedyFAS"),n(s,"removeNode"),n(u,"buildState"),n(c,"assignBucket"),Fl}function ig(){if(jl)return Rl;jl=1;var e=tg(),t=ng();function r(r){var o="greedy"===r.graph().acyclicer?t(r,a(r)):i(r);function a(e){return function(t){return e.edge(t).weight}}e.forEach(o,function(t){var n=r.edge(t);r.removeEdge(t),n.forwardName=t.name,n.reversed=!0,r.setEdge(t.w,t.v,n,e.uniqueId("rev"))}),n(a,"weightFn")}function i(t){var r=[],i={},o={};function a(n){e.has(o,n)||(o[n]=!0,i[n]=!0,e.forEach(t.outEdges(n),function(t){e.has(i,t.w)?r.push(t):a(t.w)}),delete i[n])}return n(a,"dfs"),e.forEach(t.nodes(),a),r}function o(t){e.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}return Rl={run:r,undo:o},n(r,"run"),n(i,"dfsFAS"),n(o,"undo"),Rl}function og(){if(Il)return Ll;Il=1;var e=tg(),t=u_().Graph;function r(t,r,n,i){var o;do{o=e.uniqueId(i)}while(t.hasNode(o));return n.dummy=r,t.setNode(o,n),o}function i(r){var n=(new t).setGraph(r.graph());return e.forEach(r.nodes(),function(e){n.setNode(e,r.node(e))}),e.forEach(r.edges(),function(e){var t=n.edge(e.v,e.w)||{weight:0,minlen:1},i=r.edge(e);n.setEdge(e.v,e.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function o(r){var n=new t({multigraph:r.isMultigraph()}).setGraph(r.graph());return e.forEach(r.nodes(),function(e){r.children(e).length||n.setNode(e,r.node(e))}),e.forEach(r.edges(),function(e){n.setEdge(e,r.edge(e))}),n}function a(t){var r=e.map(t.nodes(),function(r){var n={};return e.forEach(t.outEdges(r),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return e.zipObject(t.nodes(),r)}function s(t){var r=e.map(t.nodes(),function(r){var n={};return e.forEach(t.inEdges(r),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return e.zipObject(t.nodes(),r)}function u(e,t){var r,n,i=e.x,o=e.y,a=t.x-i,s=t.y-o,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),r=c*a/s,n=c):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}}function c(t){var r=e.map(e.range(d(t)+1),function(){return[]});return e.forEach(t.nodes(),function(n){var i=t.node(n),o=i.rank;e.isUndefined(o)||(r[o][i.order]=n)}),r}function h(t){var r=e.min(e.map(t.nodes(),function(e){return t.node(e).rank}));e.forEach(t.nodes(),function(n){var i=t.node(n);e.has(i,"rank")&&(i.rank-=r)})}function l(t){var r=e.min(e.map(t.nodes(),function(e){return t.node(e).rank})),n=[];e.forEach(t.nodes(),function(e){var i=t.node(e).rank-r;n[i]||(n[i]=[]),n[i].push(e)});var i=0,o=t.graph().nodeRankFactor;e.forEach(n,function(r,n){e.isUndefined(r)&&n%o!==0?--i:i&&e.forEach(r,function(e){t.node(e).rank+=i})})}function f(e,t,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(e,"border",o,t)}function d(t){return e.max(e.map(t.nodes(),function(r){var n=t.node(r).rank;if(!e.isUndefined(n))return n}))}function p(t,r){var n={lhs:[],rhs:[]};return e.forEach(t,function(e){r(e)?n.lhs.push(e):n.rhs.push(e)}),n}function _(t,r){var n=e.now();try{return r()}finally{console.log(t+" time: "+(e.now()-n)+"ms")}}function g(e,t){return t()}return Ll={addDummyNode:r,simplify:i,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:s,intersectRect:u,buildLayerMatrix:c,normalizeRanks:h,removeEmptyRanks:l,addBorderNode:f,maxRank:d,partition:p,time:_,notime:g},n(r,"addDummyNode"),n(i,"simplify"),n(o,"asNonCompoundGraph"),n(a,"successorWeights"),n(s,"predecessorWeights"),n(u,"intersectRect"),n(c,"buildLayerMatrix"),n(h,"normalizeRanks"),n(l,"removeEmptyRanks"),n(f,"addBorderNode"),n(d,"maxRank"),n(p,"partition"),n(_,"time"),n(g,"notime"),Ll}function ag(){if(Pl)return ql;Pl=1;var e=tg(),t=og();function r(t){t.graph().dummyChains=[],e.forEach(t.edges(),function(e){i(t,e)})}function i(e,r){var n=r.v,i=e.node(n).rank,o=r.w,a=e.node(o).rank,s=r.name,u=e.edge(r),c=u.labelRank;if(a!==i+1){var h,l,f;for(e.removeEdge(r),f=0,++i;i<a;++f,++i)u.points=[],l={width:0,height:0,edgeLabel:u,edgeObj:r,rank:i},h=t.addDummyNode(e,"edge",l,"_d"),i===c&&(l.width=u.width,l.height=u.height,l.dummy="edge-label",l.labelpos=u.labelpos),e.setEdge(n,h,{weight:u.weight},s),0===f&&e.graph().dummyChains.push(h),n=h;e.setEdge(n,o,{weight:u.weight},s)}}function o(t){e.forEach(t.graph().dummyChains,function(e){var r,n=t.node(e),i=n.edgeLabel;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)})}return ql={run:r,undo:o},n(r,"run"),n(i,"normalizeEdge"),n(o,"undo"),ql}function sg(){if(Bl)return Ol;Bl=1;var e=tg();function t(t){var r={};function i(n){var o=t.node(n);if(e.has(r,n))return o.rank;r[n]=!0;var a=e.min(e.map(t.outEdges(n),function(e){return i(e.w)-t.edge(e).minlen}));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}n(i,"dfs"),e.forEach(t.sources(),i)}function r(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}return Ol={longestPath:t,slack:r},n(t,"longestPath"),n(r,"slack"),Ol}function ug(){if(Tl)return Nl;Tl=1;var e=tg(),t=u_().Graph,r=sg().slack;function i(e){var n,i,u=new t({directed:!1}),c=e.nodes()[0],h=e.nodeCount();for(u.setNode(c,{});o(u,e)<h;)n=a(u,e),i=u.hasNode(n.v)?r(e,n):-r(e,n),s(u,e,i);return u}function o(t,i){function o(n){e.forEach(i.nodeEdges(n),function(e){var a=e.v,s=n===a?e.w:a;t.hasNode(s)||r(i,e)||(t.setNode(s,{}),t.setEdge(n,s,{}),o(s))})}return n(o,"dfs"),e.forEach(t.nodes(),o),t.nodeCount()}function a(t,n){return e.minBy(n.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return r(n,e)})}function s(t,r,n){e.forEach(t.nodes(),function(e){r.node(e).rank+=n})}return Nl=i,n(i,"feasibleTree"),n(o,"tightTree"),n(a,"findMinSlackEdge"),n(s,"shiftRanks"),Nl}function cg(){if(Vl)return $l;Vl=1;var e=tg(),t=ug(),r=sg().slack,i=sg().longestPath,o=u_().alg.preorder,a=u_().alg.postorder,s=og().simplify;function u(e){e=s(e),i(e);var r,n=t(e);for(f(n),c(n,e);r=p(n);)g(n,e,r,_(n,e,r))}function c(t,r){var n=a(t,t.nodes());n=n.slice(0,n.length-1),e.forEach(n,function(e){h(t,r,e)})}function h(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=l(e,t,r)}function l(t,r,n){var i=t.node(n).parent,o=!0,a=r.edge(n,i),s=0;return a||(o=!1,a=r.edge(i,n)),s=a.weight,e.forEach(r.nodeEdges(n),function(e){var a=e.v===n,u=a?e.w:e.v;if(u!==i){var c=a===o,h=r.edge(e).weight;if(s+=c?h:-h,v(t,n,u)){var l=t.edge(n,u).cutvalue;s+=c?-l:l}}}),s}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),d(e,{},1,t)}function d(t,r,n,i,o){var a=n,s=t.node(i);return r[i]=!0,e.forEach(t.neighbors(i),function(o){e.has(r,o)||(n=d(t,r,n,o,i))}),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function p(t){return e.find(t.edges(),function(e){return t.edge(e).cutvalue<0})}function _(t,n,i){var o=i.v,a=i.w;n.hasEdge(o,a)||(o=i.w,a=i.v);var s=t.node(o),u=t.node(a),c=s,h=!1;s.lim>u.lim&&(c=u,h=!0);var l=e.filter(n.edges(),function(e){return h===y(t,t.node(e.v),c)&&h!==y(t,t.node(e.w),c)});return e.minBy(l,function(e){return r(n,e)})}function g(e,t,r,n){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(n.v,n.w,{}),f(e),c(e,t),m(e,t)}function m(t,r){var n=e.find(t.nodes(),function(e){return!r.node(e).parent}),i=o(t,n);i=i.slice(1),e.forEach(i,function(e){var n=t.node(e).parent,i=r.edge(e,n),o=!1;i||(i=r.edge(n,e),o=!0),r.node(e).rank=r.node(n).rank+(o?i.minlen:-i.minlen)})}function v(e,t,r){return e.hasEdge(t,r)}function y(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}return $l=u,u.initLowLimValues=f,u.initCutValues=c,u.calcCutValue=l,u.leaveEdge=p,u.enterEdge=_,u.exchangeEdges=g,n(u,"networkSimplex"),n(c,"initCutValues"),n(h,"assignCutValue"),n(l,"calcCutValue"),n(f,"initLowLimValues"),n(d,"dfsAssignLowLim"),n(p,"leaveEdge"),n(_,"enterEdge"),n(g,"exchangeEdges"),n(m,"updateRanks"),n(v,"isTreeEdge"),n(y,"isDescendant"),$l}function hg(){if(Ul)return zl;Ul=1;var e=sg().longestPath,t=ug(),r=cg();function i(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":a(e);break;case"longest-path":o(e)}}zl=i,n(i,"rank");var o=e;function a(r){e(r),t(r)}function s(e){r(e)}return n(a,"tightTreeRanker"),n(s,"networkSimplexRanker"),zl}function lg(){if(Hl)return Yl;Hl=1;var e=tg();function t(t){var n=i(t);e.forEach(t.graph().dummyChains,function(e){for(var i=t.node(e),o=i.edgeObj,a=r(t,n,o.v,o.w),s=a.path,u=a.lca,c=0,h=s[c],l=!0;e!==o.w;){if(i=t.node(e),l){for(;(h=s[c])!==u&&t.node(h).maxRank<i.rank;)c++;h===u&&(l=!1)}if(!l){for(;c<s.length-1&&t.node(h=s[c+1]).minRank<=i.rank;)c++;h=s[c]}t.setParent(e,h),e=t.successors(e)[0]}})}function r(e,t,r,n){var i,o,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);i=r;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>u||c>t[i].lim));for(o=i,i=n;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}function i(t){var r={},i=0;function o(n){var a=i;e.forEach(t.children(n),o),r[n]={low:a,lim:i++}}return n(o,"dfs"),e.forEach(t.children(),o),r}return Yl=t,n(t,"parentDummyChains"),n(r,"findPath"),n(i,"postorder"),Yl}function fg(){if(Xl)return Gl;Xl=1;var e=tg(),t=og();function r(r){var n=t.addDummyNode(r,"root",{},"_root"),s=o(r),u=e.max(e.values(s))-1,c=2*u+1;r.graph().nestingRoot=n,e.forEach(r.edges(),function(e){r.edge(e).minlen*=c});var h=a(r)+1;e.forEach(r.children(),function(e){i(r,n,c,h,u,s,e)}),r.graph().nodeRankFactor=c}function i(r,n,o,a,s,u,c){var h=r.children(c);if(h.length){var l=t.addBorderNode(r,"_bt"),f=t.addBorderNode(r,"_bb"),d=r.node(c);r.setParent(l,c),d.borderTop=l,r.setParent(f,c),d.borderBottom=f,e.forEach(h,function(e){i(r,n,o,a,s,u,e);var t=r.node(e),h=t.borderTop?t.borderTop:e,d=t.borderBottom?t.borderBottom:e,p=t.borderTop?a:2*a,_=h!==d?1:s-u[c]+1;r.setEdge(l,h,{weight:p,minlen:_,nestingEdge:!0}),r.setEdge(d,f,{weight:p,minlen:_,nestingEdge:!0})}),r.parent(c)||r.setEdge(n,l,{weight:0,minlen:s+u[c]})}else c!==n&&r.setEdge(n,c,{weight:0,minlen:o})}function o(t){var r={};function i(n,o){var a=t.children(n);a&&a.length&&e.forEach(a,function(e){i(e,o+1)}),r[n]=o}return n(i,"dfs"),e.forEach(t.children(),function(e){i(e,1)}),r}function a(t){return e.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function s(t){var r=t.graph();t.removeNode(r.nestingRoot),delete r.nestingRoot,e.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})}return Gl={run:r,cleanup:s},n(r,"run"),n(i,"dfs"),n(o,"treeDepths"),n(a,"sumWeights"),n(s,"cleanup"),Gl}function dg(){if(Kl)return Wl;Kl=1;var e=tg(),t=og();function r(t){function r(n){var o=t.children(n),a=t.node(n);if(o.length&&e.forEach(o,r),e.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)i(t,"borderLeft","_bl",n,a,s),i(t,"borderRight","_br",n,a,s)}}n(r,"dfs"),e.forEach(t.children(),r)}function i(e,r,n,i,o,a){var s={width:0,height:0,rank:a,borderType:r},u=o[r][a-1],c=t.addDummyNode(e,"border",s,n);o[r][a]=c,e.setParent(c,i),u&&e.setEdge(u,c,{weight:1})}return Wl=r,n(r,"addBorderSegments"),n(i,"addBorderNode"),Wl}function pg(){if(Zl)return Ql;Zl=1;var e=tg();function t(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)}function r(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||a(e),"lr"!==t&&"rl"!==t||(u(e),i(e))}function i(t){e.forEach(t.nodes(),function(e){o(t.node(e))}),e.forEach(t.edges(),function(e){o(t.edge(e))})}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(t){e.forEach(t.nodes(),function(e){s(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.forEach(n.points,s),e.has(n,"y")&&s(n)})}function s(e){e.y=-e.y}function u(t){e.forEach(t.nodes(),function(e){c(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.forEach(n.points,c),e.has(n,"x")&&c(n)})}function c(e){var t=e.x;e.x=e.y,e.y=t}return Ql={adjust:t,undo:r},n(t,"adjust"),n(r,"undo"),n(i,"swapWidthHeight"),n(o,"swapWidthHeightOne"),n(a,"reverseY"),n(s,"reverseYOne"),n(u,"swapXY"),n(c,"swapXYOne"),Ql}function _g(){if(Al)return Jl;Al=1;var e=tg();function t(t){var r={},i=e.filter(t.nodes(),function(e){return!t.children(e).length}),o=e.max(e.map(i,function(e){return t.node(e).rank})),a=e.map(e.range(o+1),function(){return[]});function s(n){if(!e.has(r,n)){r[n]=!0;var i=t.node(n);a[i.rank].push(n),e.forEach(t.successors(n),s)}}n(s,"dfs");var u=e.sortBy(i,function(e){return t.node(e).rank});return e.forEach(u,s),a}return Jl=t,n(t,"initOrder"),Jl}function gg(){if(tf)return ef;tf=1;var e=tg();function t(e,t){for(var n=0,i=1;i<t.length;++i)n+=r(e,t[i-1],t[i]);return n}function r(t,r,n){for(var i=e.zipObject(n,e.map(n,function(e,t){return t})),o=e.flatten(e.map(r,function(r){return e.sortBy(e.map(t.outEdges(r),function(e){return{pos:i[e.w],weight:t.edge(e).weight}}),"pos")}),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=e.map(new Array(s),function(){return 0}),c=0;return e.forEach(o.forEach(function(e){var t=e.pos+a;u[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=u[t+1]),u[t=t-1>>1]+=e.weight;c+=e.weight*r})),c}return ef=t,n(t,"crossCount"),n(r,"twoLayerCrossCount"),ef}function mg(){if(nf)return rf;nf=1;var e=tg();function t(t,r){return e.map(r,function(r){var n=t.inEdges(r);if(n.length){var i=e.reduce(n,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}return{v:r}})}return rf=t,n(t,"barycenter"),rf}function vg(){if(af)return of;af=1;var e=tg();function t(t,n){var i={};return e.forEach(t,function(t,r){var n=i[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:r};e.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),e.forEach(n.edges(),function(t){var r=i[t.v],n=i[t.w];e.isUndefined(r)||e.isUndefined(n)||(n.indegree++,r.out.push(i[t.w]))}),r(e.filter(i,function(e){return!e.indegree}))}function r(t){var r=[];function o(t){return function(r){r.merged||(e.isUndefined(r.barycenter)||e.isUndefined(t.barycenter)||r.barycenter>=t.barycenter)&&i(t,r)}}function a(e){return function(r){r.in.push(e),0===--r.indegree&&t.push(r)}}for(n(o,"handleIn"),n(a,"handleOut");t.length;){var s=t.pop();r.push(s),e.forEach(s.in.reverse(),o(s)),e.forEach(s.out,a(s))}return e.map(e.filter(r,function(e){return!e.merged}),function(t){return e.pick(t,["vs","i","barycenter","weight"])})}function i(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}return of=t,n(t,"resolveConflicts"),n(r,"doResolveConflicts"),n(i,"mergeEntries"),of}function yg(){if(uf)return sf;uf=1;var e=tg(),t=og();function r(r,n){var a=t.partition(r,function(t){return e.has(t,"barycenter")}),s=a.lhs,u=e.sortBy(a.rhs,function(e){return-e.i}),c=[],h=0,l=0,f=0;s.sort(o(!!n)),f=i(c,u,f),e.forEach(s,function(e){f+=e.vs.length,c.push(e.vs),h+=e.barycenter*e.weight,l+=e.weight,f=i(c,u,f)});var d={vs:e.flatten(c,!0)};return l&&(d.barycenter=h/l,d.weight=l),d}function i(t,r,n){for(var i;r.length&&(i=e.last(r)).i<=n;)r.pop(),t.push(i.vs),n++;return n}function o(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}return sf=r,n(r,"sort"),n(i,"consumeUnsortable"),n(o,"compareWithBias"),sf}function bg(){if(hf)return cf;hf=1;var e=tg(),t=mg(),r=vg(),i=yg();function o(n,u,c,h){var l=n.children(u),f=n.node(u),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,_={};d&&(l=e.filter(l,function(e){return e!==d&&e!==p}));var g=t(n,l);e.forEach(g,function(t){if(n.children(t.v).length){var r=o(n,t.v,c,h);_[t.v]=r,e.has(r,"barycenter")&&s(t,r)}});var m=r(g,c);a(m,_);var v=i(m,h);if(d&&(v.vs=e.flatten([d,v.vs,p],!0),n.predecessors(d).length)){var y=n.node(n.predecessors(d)[0]),b=n.node(n.predecessors(p)[0]);e.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+b.order)/(v.weight+2),v.weight+=2}return v}function a(t,r){e.forEach(t,function(t){t.vs=e.flatten(t.vs.map(function(e){return r[e]?r[e].vs:e}),!0)})}function s(t,r){e.isUndefined(t.barycenter)?(t.barycenter=r.barycenter,t.weight=r.weight):(t.barycenter=(t.barycenter*t.weight+r.barycenter*r.weight)/(t.weight+r.weight),t.weight+=r.weight)}return cf=o,n(o,"sortSubgraph"),n(a,"expandSubgraphs"),n(s,"mergeBarycenters"),cf}function wg(){if(ff)return lf;ff=1;var e=tg(),t=u_().Graph;function r(r,n,o){var a=i(r),s=new t({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(e){return r.node(e)});return e.forEach(r.nodes(),function(t){var i=r.node(t),u=r.parent(t);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(s.setNode(t),s.setParent(t,u||a),e.forEach(r[o](t),function(n){var i=n.v===t?n.w:n.v,o=s.edge(i,t),a=e.isUndefined(o)?0:o.weight;s.setEdge(i,t,{weight:r.edge(n).weight+a})}),e.has(i,"minRank")&&s.setNode(t,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),s}function i(t){for(var r;t.hasNode(r=e.uniqueId("_root")););return r}return lf=r,n(r,"buildLayerGraph"),n(i,"createRootNode"),lf}function xg(){if(pf)return df;pf=1;var e=tg();function t(t,r,n){var i,o={};e.forEach(n,function(e){for(var n,a,s=t.parent(e);s;){if((n=t.parent(s))?(a=o[n],o[n]=s):(a=i,i=s),a&&a!==s)return void r.setEdge(a,s);s=n}})}return df=t,n(t,"addSubgraphConstraints"),df}function Eg(){if(gf)return _f;gf=1;var e=tg(),t=_g(),r=gg(),i=bg(),o=wg(),a=xg(),s=u_().Graph,u=og();function c(n){var i=u.maxRank(n),o=h(n,e.range(1,i+1),"inEdges"),a=h(n,e.range(i-1,-1,-1),"outEdges"),s=t(n);f(n,s);for(var c,d=Number.POSITIVE_INFINITY,p=0,_=0;_<4;++p,++_){l(p%2?o:a,p%4>=2),s=u.buildLayerMatrix(n);var g=r(n,s);g<d&&(_=0,c=e.cloneDeep(s),d=g)}f(n,c)}function h(t,r,n){return e.map(r,function(e){return o(t,e,n)})}function l(t,r){var n=new s;e.forEach(t,function(t){var o=t.graph().root,s=i(t,o,n,r);e.forEach(s.vs,function(e,r){t.node(e).order=r}),a(t,n,s.vs)})}function f(t,r){e.forEach(r,function(r){e.forEach(r,function(e,r){t.node(e).order=r})})}return _f=c,n(c,"order"),n(h,"buildLayerGraphs"),n(l,"sweepLayerGraphs"),n(f,"assignOrder"),_f}function Cg(){if(vf)return mf;vf=1;var e=tg(),t=u_().Graph,r=og();function i(t,r){var i={};function o(r,n){var o=0,u=0,c=r.length,h=e.last(n);return e.forEach(n,function(r,l){var f=a(t,r),d=f?t.node(f).order:c;(f||r===h)&&(e.forEach(n.slice(u,l+1),function(r){e.forEach(t.predecessors(r),function(e){var n=t.node(e),a=n.order;!(a<o||d<a)||n.dummy&&t.node(r).dummy||s(i,e,r)})}),u=l+1,o=d)}),n}return n(o,"visitLayer"),e.reduce(r,o),i}function o(t,r){var i={};function o(r,n,o,a,u){var c;e.forEach(e.range(n,o),function(n){c=r[n],t.node(c).dummy&&e.forEach(t.predecessors(c),function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>u)&&s(i,e,c)})})}function a(r,n){var i,a=-1,s=0;return e.forEach(n,function(e,u){if("border"===t.node(e).dummy){var c=t.predecessors(e);c.length&&(i=t.node(c[0]).order,o(n,s,u,a,i),s=u,a=i)}o(n,s,n.length,i,r.length)}),n}return n(o,"scan"),n(a,"visitLayer"),e.reduce(r,a),i}function a(t,r){if(t.node(r).dummy)return e.find(t.predecessors(r),function(e){return t.node(e).dummy})}function s(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function u(t,r,n){if(r>n){var i=r;r=n,n=i}return e.has(t[r],n)}function c(t,r,n,i){var o={},a={},s={};return e.forEach(r,function(t){e.forEach(t,function(e,t){o[e]=e,a[e]=e,s[e]=t})}),e.forEach(r,function(t){var r=-1;e.forEach(t,function(t){var c=i(t);if(c.length)for(var h=((c=e.sortBy(c,function(e){return s[e]})).length-1)/2,l=Math.floor(h),f=Math.ceil(h);l<=f;++l){var d=c[l];a[t]===t&&r<s[d]&&!u(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],r=s[d])}})}),{root:o,align:a}}function h(t,r,i,o,a){var s={},u=l(t,r,i,a),c=a?"borderLeft":"borderRight";function h(e,t){for(var r=u.nodes(),n=r.pop(),i={};n;)i[n]?e(n):(i[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}function f(e){s[e]=u.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+u.edge(t))},0)}function d(e){var r=u.outEdges(e).reduce(function(e,t){return Math.min(e,s[t.w]-u.edge(t))},Number.POSITIVE_INFINITY),n=t.node(e);r!==Number.POSITIVE_INFINITY&&n.borderType!==c&&(s[e]=Math.max(s[e],r))}return n(h,"iterate"),n(f,"pass1"),n(d,"pass2"),h(f,u.predecessors.bind(u)),h(d,u.successors.bind(u)),e.forEach(o,function(e){s[e]=s[i[e]]}),s}function l(r,n,i,o){var a=new t,s=r.graph(),u=g(s.nodesep,s.edgesep,o);return e.forEach(n,function(t){var n;e.forEach(t,function(e){var t=i[e];if(a.setNode(t),n){var o=i[n],s=a.edge(o,t);a.setEdge(o,t,Math.max(u(r,e,n),s||0))}n=e})}),a}function f(t,r){return e.minBy(e.values(r),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return e.forIn(r,function(e,r){var o=m(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)}),n-i})}function d(t,r){var n=e.values(r),i=e.min(n),o=e.max(n);e.forEach(["u","d"],function(n){e.forEach(["l","r"],function(a){var s,u=n+a,c=t[u];if(c!==r){var h=e.values(c);(s="l"===a?i-e.min(h):o-e.max(h))&&(t[u]=e.mapValues(c,function(e){return e+s}))}})})}function p(t,r){return e.mapValues(t.ul,function(n,i){if(r)return t[r.toLowerCase()][i];var o=e.sortBy(e.map(t,i));return(o[1]+o[2])/2})}function _(t){var n,a=r.buildLayerMatrix(t),s=e.merge(i(t,a),o(t,a)),u={};e.forEach(["u","d"],function(r){n="u"===r?a:e.values(a).reverse(),e.forEach(["l","r"],function(i){"r"===i&&(n=e.map(n,function(t){return e.values(t).reverse()}));var o=("u"===r?t.predecessors:t.successors).bind(t),a=c(0,n,s,o),l=h(t,n,a.root,a.align,"r"===i);"r"===i&&(l=e.mapValues(l,function(e){return-e})),u[r+i]=l})});var l=f(t,u);return d(u,l),p(u,t.graph().align)}function g(t,r,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),h=0;if(h+=u.width/2,e.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(h+=n?s:-s),s=0,h+=(u.dummy?r:t)/2,h+=(c.dummy?r:t)/2,h+=c.width/2,e.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(h+=n?s:-s),s=0,h}}function m(e,t){return e.node(t).width}return mf={positionX:_,findType1Conflicts:i,findType2Conflicts:o,addConflict:s,hasConflict:u,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:d,findSmallestWidthAlignment:f,balance:p},n(i,"findType1Conflicts"),n(o,"findType2Conflicts"),n(a,"findOtherInnerSegmentNode"),n(s,"addConflict"),n(u,"hasConflict"),n(c,"verticalAlignment"),n(h,"horizontalCompaction"),n(l,"buildBlockGraph"),n(f,"findSmallestWidthAlignment"),n(d,"alignCoordinates"),n(p,"balance"),n(_,"positionX"),n(g,"sep"),n(m,"width"),mf}function kg(){if(bf)return yf;bf=1;var e=tg(),t=og(),r=Cg().positionX;function i(n){o(n=t.asNonCompoundGraph(n)),e.forEach(r(n),function(e,t){n.node(t).x=e})}function o(r){var n=t.buildLayerMatrix(r),i=r.graph().ranksep,o=0;e.forEach(n,function(t){var n=e.max(e.map(t,function(e){return r.node(e).height}));e.forEach(t,function(e){r.node(e).y=o+n/2}),o+=n+i})}return yf=i,n(i,"position"),n(o,"positionY"),yf}function Dg(){if(xf)return wf;xf=1;var e=tg(),t=ig(),r=ag(),i=hg(),o=og().normalizeRanks,a=lg(),s=og().removeEmptyRanks,u=fg(),c=dg(),h=pg(),l=Eg(),f=kg(),d=og(),p=u_().Graph;function _(e,t){var r=t&&t.debugTiming?d.time:d.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return D(e)});r(" runLayout",function(){g(t,r)}),r(" updateInputGraph",function(){m(e,t)})})}function g(e,n){n(" makeSpaceForEdgeLabels",function(){M(e)}),n(" removeSelfEdges",function(){O(e)}),n(" acyclic",function(){t.run(e)}),n(" nestingGraph.run",function(){u.run(e)}),n(" rank",function(){i(d.asNonCompoundGraph(e))}),n(" injectEdgeLabelProxies",function(){F(e)}),n(" removeEmptyRanks",function(){s(e)}),n(" nestingGraph.cleanup",function(){u.cleanup(e)}),n(" normalizeRanks",function(){o(e)}),n(" assignRankMinMax",function(){S(e)}),n(" removeEdgeLabelProxies",function(){R(e)}),n(" normalize.run",function(){r.run(e)}),n(" parentDummyChains",function(){a(e)}),n(" addBorderSegments",function(){c(e)}),n(" order",function(){l(e)}),n(" insertSelfEdges",function(){B(e)}),n(" adjustCoordinateSystem",function(){h.adjust(e)}),n(" position",function(){f(e)}),n(" positionSelfEdges",function(){N(e)}),n(" removeBorderNodes",function(){P(e)}),n(" normalize.undo",function(){r.undo(e)}),n(" fixupEdgeLabelCoords",function(){I(e)}),n(" undoCoordinateSystem",function(){h.undo(e)}),n(" translateGraph",function(){j(e)}),n(" assignNodeIntersects",function(){L(e)}),n(" reversePoints",function(){q(e)}),n(" acyclic.undo",function(){t.undo(e)})}function m(t,r){e.forEach(t.nodes(),function(e){var n=t.node(e),i=r.node(e);n&&(n.x=i.x,n.y=i.y,r.children(e).length&&(n.width=i.width,n.height=i.height))}),e.forEach(t.edges(),function(n){var i=t.edge(n),o=r.edge(n);i.points=o.points,e.has(o,"x")&&(i.x=o.x,i.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height}wf=_,n(_,"layout"),n(g,"runLayout"),n(m,"updateInputGraph");var v=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],w=["width","height"],x={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function D(t){var r=new p({multigraph:!0,compound:!0}),n=$(t.graph());return r.setGraph(e.merge({},y,T(n,v),e.pick(n,b))),e.forEach(t.nodes(),function(n){var i=$(t.node(n));r.setNode(n,e.defaults(T(i,w),x)),r.setParent(n,t.parent(n))}),e.forEach(t.edges(),function(n){var i=$(t.edge(n));r.setEdge(n,e.merge({},C,T(i,E),e.pick(i,k)))}),r}function M(t){var r=t.graph();r.ranksep/=2,e.forEach(t.edges(),function(e){var n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function F(t){e.forEach(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};d.addDummyNode(t,"edge-proxy",i,"_ep")}})}function S(t){var r=0;e.forEach(t.nodes(),function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,r=e.max(r,i.maxRank))}),t.graph().maxRank=r}function R(t){e.forEach(t.nodes(),function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function j(t){var r=Number.POSITIVE_INFINITY,i=0,o=Number.POSITIVE_INFINITY,a=0,s=t.graph(),u=s.marginx||0,c=s.marginy||0;function h(e){var t=e.x,n=e.y,s=e.width,u=e.height;r=Math.min(r,t-s/2),i=Math.max(i,t+s/2),o=Math.min(o,n-u/2),a=Math.max(a,n+u/2)}n(h,"getExtremes"),e.forEach(t.nodes(),function(e){h(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.has(n,"x")&&h(n)}),r-=u,o-=c,e.forEach(t.nodes(),function(e){var n=t.node(e);n.x-=r,n.y-=o}),e.forEach(t.edges(),function(n){var i=t.edge(n);e.forEach(i.points,function(e){e.x-=r,e.y-=o}),e.has(i,"x")&&(i.x-=r),e.has(i,"y")&&(i.y-=o)}),s.width=i-r+u,s.height=a-o+c}function L(t){e.forEach(t.edges(),function(e){var r,n,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=a,n=o),i.points.unshift(d.intersectRect(o,r)),i.points.push(d.intersectRect(a,n))})}function I(t){e.forEach(t.edges(),function(r){var n=t.edge(r);if(e.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(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}})}function q(t){e.forEach(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function P(t){e.forEach(t.nodes(),function(r){if(t.children(r).length){var n=t.node(r),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(e.last(n.borderLeft)),s=t.node(e.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}}),e.forEach(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function O(t){e.forEach(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function B(t){var r=d.buildLayerMatrix(t);e.forEach(r,function(r){var n=0;e.forEach(r,function(r,i){var o=t.node(r);o.order=i+n,e.forEach(o.selfEdges,function(e){d.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}function N(t){e.forEach(t.nodes(),function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,o=n.y,a=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],r.label.x=r.x,r.label.y=r.y}})}function T(t,r){return e.mapValues(e.pick(t,r),Number)}function $(t){var r={};return e.forEach(t,function(e,t){r[t.toLowerCase()]=e}),r}return n(D,"buildLayoutGraph"),n(M,"makeSpaceForEdgeLabels"),n(F,"injectEdgeLabelProxies"),n(S,"assignRankMinMax"),n(R,"removeEdgeLabelProxies"),n(j,"translateGraph"),n(L,"assignNodeIntersects"),n(I,"fixupEdgeLabelCoords"),n(q,"reversePointsForReversedEdges"),n(P,"removeBorderNodes"),n(O,"removeSelfEdges"),n(B,"insertSelfEdges"),n(N,"positionSelfEdges"),n(T,"selectNumberAttrs"),n($,"canonicalize"),wf}function Mg(){if(Cf)return Ef;Cf=1;var e=tg(),t=og(),r=u_().Graph;function i(n){var i=t.buildLayerMatrix(n),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(n.nodes(),function(e){o.setNode(e,{label:e}),o.setParent(e,"layer"+n.node(e).rank)}),e.forEach(n.edges(),function(e){o.setEdge(e.v,e.w,{},e.name)}),e.forEach(i,function(t,r){var n="layer"+r;o.setNode(n,{rank:"same"}),e.reduce(t,function(e,t){return o.setEdge(e,t,{style:"invis"}),t})}),o}return Ef={debugOrdering:i},n(i,"debugOrdering"),Ef}function Fg(){return Df?kf:(Df=1,kf="0.8.5")}function Sg(){return Ff?Mf:(Ff=1,Mf={graphlib:u_(),layout:Dg(),debug:Mg(),util:{time:og().time,notime:og().notime},version:Fg()})}n(Rf,"require_cloneBuffer"),n(jf,"require_copyArray"),n(Lf,"require_arrayFilter"),n(If,"requireStubArray"),n(qf,"require_getSymbols"),n(Pf,"require_copySymbols"),n(Of,"require_arrayPush"),n(Bf,"require_getPrototype"),n(Nf,"require_getSymbolsIn"),n(Tf,"require_copySymbolsIn"),n($f,"require_baseGetAllKeys"),n(Vf,"require_getAllKeys"),n(zf,"require_getAllKeysIn"),n(Uf,"require_DataView"),n(Yf,"require_Promise"),n(Hf,"require_Set"),n(Gf,"require_WeakMap"),n(Xf,"require_getTag"),n(Wf,"require_initCloneArray"),n(Kf,"require_Uint8Array"),n(Qf,"require_cloneArrayBuffer"),n(Zf,"require_cloneDataView"),n(Jf,"require_cloneRegExp"),n(Af,"require_cloneSymbol"),n(ed,"require_cloneTypedArray"),n(td,"require_initCloneByTag"),n(rd,"require_baseCreate"),n(nd,"require_initCloneObject"),n(id,"require_baseIsMap"),n(od,"requireIsMap"),n(ad,"require_baseIsSet"),n(sd,"requireIsSet"),n(ud,"require_baseClone"),n(cd,"requireClone"),n(hd,"requireConstant"),n(ld,"require_createBaseFor"),n(fd,"require_baseFor"),n(dd,"require_baseForOwn"),n(pd,"require_createBaseEach"),n(_d,"require_baseEach"),n(gd,"requireIdentity"),n(md,"require_castFunction"),n(vd,"requireForEach"),n(yd,"requireEach"),n(bd,"require_baseFilter"),n(wd,"require_setCacheAdd"),n(xd,"require_setCacheHas"),n(Ed,"require_SetCache"),n(Cd,"require_arraySome"),n(kd,"require_cacheHas"),n(Dd,"require_equalArrays"),n(Md,"require_mapToArray"),n(Fd,"require_setToArray"),n(Sd,"require_equalByTag"),n(Rd,"require_equalObjects"),n(jd,"require_baseIsEqualDeep"),n(Ld,"require_baseIsEqual"),n(Id,"require_baseIsMatch"),n(qd,"require_isStrictComparable"),n(Pd,"require_getMatchData"),n(Od,"require_matchesStrictComparable"),n(Bd,"require_baseMatches"),n(Nd,"requireIsSymbol"),n(Td,"require_isKey"),n($d,"requireMemoize"),n(Vd,"require_memoizeCapped"),n(zd,"require_stringToPath"),n(Ud,"require_arrayMap"),n(Yd,"require_baseToString"),n(Hd,"requireToString"),n(Gd,"require_castPath"),n(Xd,"require_toKey"),n(Wd,"require_baseGet"),n(Kd,"requireGet"),n(Qd,"require_baseHasIn"),n(Zd,"require_hasPath"),n(Jd,"requireHasIn"),n(Ad,"require_baseMatchesProperty"),n(ep,"require_baseProperty"),n(tp,"require_basePropertyDeep"),n(rp,"requireProperty"),n(np,"require_baseIteratee"),n(ip,"requireFilter"),n(op,"require_baseHas"),n(ap,"requireHas"),n(sp,"requireIsEmpty"),n(up,"requireIsUndefined"),n(cp,"require_baseMap"),n(hp,"requireMap"),n(lp,"require_arrayReduce"),n(fp,"require_baseReduce"),n(dp,"requireReduce"),n(pp,"requireIsString"),n(_p,"require_asciiSize"),n(gp,"require_hasUnicode"),n(mp,"require_unicodeSize"),n(vp,"require_stringSize"),n(yp,"requireSize"),n(bp,"requireTransform"),n(wp,"require_isFlattenable"),n(xp,"require_baseFlatten"),n(Ep,"require_apply"),n(Cp,"require_overRest"),n(kp,"require_baseSetToString"),n(Dp,"require_shortOut"),n(Mp,"require_setToString"),n(Fp,"require_baseRest"),n(Sp,"require_baseFindIndex"),n(Rp,"require_baseIsNaN"),n(jp,"require_strictIndexOf"),n(Lp,"require_baseIndexOf"),n(Ip,"require_arrayIncludes"),n(qp,"require_arrayIncludesWith"),n(Pp,"requireNoop"),n(Op,"require_createSet"),n(Bp,"require_baseUniq"),n(Np,"requireIsArrayLikeObject"),n(Tp,"requireUnion"),n($p,"require_baseValues"),n(Vp,"requireValues"),n(zp,"requireLodash$1"),n(Up,"requireGraph"),n(Yp,"requireVersion$1"),n(Hp,"requireLib"),n(Gp,"requireJson"),n(Xp,"requireComponents"),n(Wp,"requirePriorityQueue"),n(Kp,"requireDijkstra"),n(Qp,"requireDijkstraAll"),n(Zp,"requireTarjan"),n(Jp,"requireFindCycles"),n(Ap,"requireFloydWarshall"),n(e_,"requireTopsort"),n(t_,"requireIsAcyclic"),n(r_,"requireDfs"),n(n_,"requirePostorder"),n(i_,"requirePreorder"),n(o_,"requirePrim"),n(a_,"requireAlg"),n(s_,"requireGraphlib$1"),n(u_,"requireGraphlib"),n(c_,"requireCloneDeep"),n(h_,"require_isIterateeCall"),n(l_,"requireDefaults"),n(f_,"require_createFind"),n(d_,"require_trimmedEndIndex"),n(p_,"require_baseTrim"),n(__,"requireToNumber"),n(g_,"requireToFinite"),n(m_,"requireToInteger"),n(v_,"requireFindIndex"),n(y_,"requireFind"),n(b_,"requireFlatten"),n(w_,"requireForIn"),n(x_,"requireLast"),n(E_,"requireMapValues"),n(C_,"require_baseExtremum"),n(k_,"require_baseGt"),n(D_,"requireMax"),n(M_,"require_assignMergeValue"),n(F_,"requireIsPlainObject"),n(S_,"require_safeGet"),n(R_,"requireToPlainObject"),n(j_,"require_baseMergeDeep"),n(L_,"require_baseMerge"),n(I_,"require_createAssigner"),n(q_,"requireMerge"),n(P_,"require_baseLt"),n(O_,"requireMin"),n(B_,"requireMinBy"),n(N_,"requireNow"),n(T_,"require_baseSet"),n($_,"require_basePickBy"),n(V_,"require_basePick"),n(z_,"require_flatRest"),n(U_,"requirePick"),n(Y_,"require_baseRange"),n(H_,"require_createRange"),n(G_,"requireRange"),n(X_,"require_baseSortBy"),n(W_,"require_compareAscending"),n(K_,"require_compareMultiple"),n(Q_,"require_baseOrderBy"),n(Z_,"requireSortBy"),n(J_,"requireUniqueId"),n(A_,"require_baseZipObject"),n(eg,"requireZipObject"),n(tg,"requireLodash"),n(rg,"requireList"),n(ng,"requireGreedyFas"),n(ig,"requireAcyclic"),n(og,"requireUtil$1"),n(ag,"requireNormalize"),n(sg,"requireUtil"),n(ug,"requireFeasibleTree"),n(cg,"requireNetworkSimplex"),n(hg,"requireRank"),n(lg,"requireParentDummyChains"),n(fg,"requireNestingGraph"),n(dg,"requireAddBorderSegments"),n(pg,"requireCoordinateSystem"),n(_g,"requireInitOrder"),n(gg,"requireCrossCount"),n(mg,"requireBarycenter"),n(vg,"requireResolveConflicts"),n(yg,"requireSort"),n(bg,"requireSortSubgraph"),n(wg,"requireBuildLayerGraph"),n(xg,"requireAddSubgraphConstraints"),n(Eg,"requireOrder"),n(Cg,"requireBk"),n(kg,"requirePosition"),n(Dg,"requireLayout"),n(Mg,"requireDebug"),n(Fg,"requireVersion"),n(Sg,"requireDagre");var Rg=Sg();const jg=class _GraphlibGraph extends Rg.graphlib.Graph{};n(jg,"GraphlibGraph");let Lg=jg;const Ig=class _GraphData{_g;constructor(){this._g=new Lg({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel(function(){return{debug:"error"}}),this._g.setDefaultEdgeLabel(function(){return{debug:"error"}})}parent(e){return this._g.parent(e)}filterNodes(e){const t=[];return this.eachNode(function(r){e(r)&&t.push(r)}),t}eachNode(e){this._g.nodes().forEach(t=>{e(t,this.node(t))})}filterEdges(e){const t=[];return this.eachEdge(function(r){e(r)&&t.push(r)}),t}eachEdge(e){this._g.edges().forEach(t=>{e(t,t.v,t.w,this.edge(t))})}setData(e,t,r,n,i){const o={addedVertices:[],addedEdges:[]},a=e.concat(t);for(let s=0;s<a.length;++s){const e=a[s];i&&this._g.hasNode(e._id)||(this._g.setNode(e._id,e),o.addedVertices.push(e))}for(let s=0;s<r.length;++s){const e=r[s];i&&this._g.hasEdge(e._id)||(e._sourceVertex&&e._targetVertex?(this._g.setEdge(e._sourceVertex._id,e._targetVertex._id,e,e._id),o.addedEdges.push(e)):console.warn("Bad edge definition"))}if(n)for(let s=0;s<n.length;++s)this._g.setParent(n[s].child._id,n[s].parent._id);if(i){const e=r.map(function(e){return e._id});this.filterEdges(t=>e.indexOf(t.name)<0).forEach(e=>this._g.removeEdge(e.v,e.w));const t=a.map(function(e){return e._id});this.filterNodes(e=>t.indexOf(e)<0).forEach(e=>this._g.removeNode(e))}return o}node(e){return this._g.node(e)}nodeCount(){return this._g.nodeCount()}nodes(){return this._g.nodes().map(e=>this._g.node(e))}nodeEdges(e){return this._g.nodeEdges(e)}edge(e){return this._g.edge(e)}edges(){return this._g.edges().map(e=>this._g.edge(e))}neighbors(e){return this._g.neighbors(e).map(e=>this._g.node(e))}singleNeighbors(e){return this._g.neighbors(e).filter(e=>1===this._g.neighbors(e).length).map(e=>this._g.node(e))}gatherShortestPath(e,t){const r=[];let n=t,i=e[n];for(;i;){if(i.distance<1/0&&i.predecessor){const e=this._g.nodeEdges(n,i.predecessor)[0];r.push(this._g.edge(e))}n=i.predecessor,i=e[n]}return r}shortestPath(e,t){return this.gatherShortestPath(Rg.graphlib.alg.dijkstra(this._g,e),t)}undirectedShortestPath(e,t){return this.gatherShortestPath(Rg.graphlib.alg.dijkstra(this._g,e,null,e=>this._g.nodeEdges(e)),t)}getJSON(){const e=Rg.graphlib.json.write(this._g);return JSON.stringify(e,function(e,t){return"value"===e?t._text&&t._text._text?t._text._text:t._id:t}," ")}};n(Ig,"GraphData");let qg=Ig;function Pg(e,t){var r;function i(){var n,i,o=r.length,a=0,s=0;for(n=0;n<o;++n)a+=(i=r[n]).x,s+=i.y;for(a=a/o-e,s=s/o-t,n=0;n<o;++n)(i=r[n]).x-=a,i.y-=s}return null==e&&(e=0),null==t&&(t=0),n(i,"force"),i.initialize=function(e){r=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i}function Og(e){return function(){return e}}function Bg(){return 1e-6*(Math.random()-.5)}function Ng(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return Tg(this.cover(t,r),t,r,e)}function Tg(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,o,a,s,u,c,h,l,f,d=e._root,p={data:n},_=e._x0,g=e._y0,m=e._x1,v=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((c=t>=(o=(_+m)/2))?_=o:m=o,(h=r>=(a=(g+v)/2))?g=a:v=a,i=d,!(d=d[l=h<<1|c]))return i[l]=p,e;if(s=+e._x.call(null,d.data),u=+e._y.call(null,d.data),t===s&&r===u)return p.next=d,i?i[l]=p:e._root=p,e;do{i=i?i[l]=new Array(4):e._root=new Array(4),(c=t>=(o=(_+m)/2))?_=o:m=o,(h=r>=(a=(g+v)/2))?g=a:v=a}while((l=h<<1|c)==(f=(u>=a)<<1|s>=o));return i[f]=d,i[l]=p,e}function $g(e){var t,r,n,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,h=-1/0,l=-1/0;for(r=0;r<o;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=n,s[r]=i,n<u&&(u=n),n>h&&(h=n),i<c&&(c=i),i>l&&(l=i));if(u>h||c>l)return this;for(this.cover(u,c).cover(h,l),r=0;r<o;++r)Tg(this,a[r],s[r],e[r]);return this}function Vg(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,o=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,o=(n=Math.floor(t))+1;else{for(var a,s,u=i-r,c=this._root;r>e||e>=i||n>t||t>=o;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=r+u,o=n+u;break;case 1:r=i-u,o=n+u;break;case 2:i=r+u,n=o-u;break;case 3:r=i-u,n=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=o,this}function zg(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e}function Ug(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Yg(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function Hg(e,t,r){var n,i,o,a,s,u,c,h=this._x0,l=this._y0,f=this._x1,d=this._y1,p=[],_=this._root;for(_&&p.push(new Yg(_,h,l,f,d)),null==r?r=1/0:(h=e-r,l=t-r,f=e+r,d=t+r,r*=r);u=p.pop();)if(!(!(_=u.node)||(i=u.x0)>f||(o=u.y0)>d||(a=u.x1)<h||(s=u.y1)<l))if(_.length){var g=(i+a)/2,m=(o+s)/2;p.push(new Yg(_[3],g,m,a,s),new Yg(_[2],i,m,g,s),new Yg(_[1],g,o,a,m),new Yg(_[0],i,o,g,m)),(c=(t>=m)<<1|e>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var v=e-+this._x.call(null,_.data),y=t-+this._y.call(null,_.data),b=v*v+y*y;if(b<r){var w=Math.sqrt(r=b);h=e-w,l=t-w,f=e+w,d=t+w,n=_.data}}return n}function Gg(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,i,o,a,s,u,c,h,l,f,d=this._root,p=this._x0,_=this._y0,g=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(s=(p+g)/2))?p=s:g=s,(h=a>=(u=(_+m)/2))?_=u:m=u,t=d,!(d=d[l=h<<1|c]))return this;if(!d.length)break;(t[l+1&3]||t[l+2&3]||t[l+3&3])&&(r=t,f=l)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):t?(i?t[l]=i:delete t[l],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)}function Xg(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function Wg(){return this._root}function Kg(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e}function Qg(e){var t,r,n,i,o,a,s=[],u=this._root;for(u&&s.push(new Yg(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,i=t.y0,o=t.x1,a=t.y1)&&u.length){var c=(n+o)/2,h=(i+a)/2;(r=u[3])&&s.push(new Yg(r,c,h,o,a)),(r=u[2])&&s.push(new Yg(r,n,h,c,a)),(r=u[1])&&s.push(new Yg(r,c,i,o,h)),(r=u[0])&&s.push(new Yg(r,n,i,c,h))}return this}function Zg(e){var t,r=[],n=[];for(this._root&&r.push(new Yg(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var i=t.node;if(i.length){var o,a=t.x0,s=t.y0,u=t.x1,c=t.y1,h=(a+u)/2,l=(s+c)/2;(o=i[0])&&r.push(new Yg(o,a,s,h,l)),(o=i[1])&&r.push(new Yg(o,h,s,u,l)),(o=i[2])&&r.push(new Yg(o,a,l,h,c)),(o=i[3])&&r.push(new Yg(o,h,l,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function Jg(e){return e[0]}function Ag(e){return arguments.length?(this._x=e,this):this._x}function em(e){return e[1]}function tm(e){return arguments.length?(this._y=e,this):this._y}function rm(e,t,r){var n=new nm(null==t?Jg:t,null==r?em:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function nm(e,t,r,n,i,o){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function im(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}n(Pg,"d3ForceCenter"),n(Og,"constant$1"),n(Bg,"jiggle"),n(Ng,"tree_add"),n(Tg,"add"),n($g,"addAll"),n(Vg,"tree_cover"),n(zg,"tree_data"),n(Ug,"tree_extent"),n(Yg,"Quad"),n(Hg,"tree_find"),n(Gg,"tree_remove"),n(Xg,"removeAll"),n(Wg,"tree_root"),n(Kg,"tree_size"),n(Qg,"tree_visit"),n(Zg,"tree_visitAfter"),n(Jg,"defaultX"),n(Ag,"tree_x"),n(em,"defaultY"),n(tm,"tree_y"),n(rm,"quadtree"),n(nm,"Quadtree"),n(im,"leaf_copy");var om=rm.prototype=nm.prototype;function am(e){return e.index}function sm(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function um(e){var t,r,i,o,a,s=am,c=f,h=Og(30),l=1;function f(e){return 1/Math.min(o[e.source.index],o[e.target.index])}function d(n){for(var i=0,o=e.length;i<l;++i)for(var s,u,c,h,f,d,p,_=0;_<o;++_)u=(s=e[_]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Bg(),f=c.y+c.vy-u.y-u.vy||Bg(),h*=d=((d=Math.sqrt(h*h+f*f))-r[_])/d*n*t[_],f*=d,c.vx-=h*(p=a[_]),c.vy-=f*p,u.vx+=h*(p=1-p),u.vy+=f*p}function p(){if(i){var n,c,h=i.length,l=e.length,f=u(i,s);for(n=0,o=new Array(h);n<l;++n)(c=e[n]).index=n,"object"!=typeof c.source&&(c.source=sm(f,c.source)),"object"!=typeof c.target&&(c.target=sm(f,c.target)),o[c.source.index]=(o[c.source.index]||0)+1,o[c.target.index]=(o[c.target.index]||0)+1;for(n=0,a=new Array(l);n<l;++n)c=e[n],a[n]=o[c.source.index]/(o[c.source.index]+o[c.target.index]);t=new Array(l),_(),r=new Array(l),g()}}function _(){if(i)for(var r=0,n=e.length;r<n;++r)t[r]=+c(e[r],r,e)}function g(){if(i)for(var t=0,n=e.length;t<n;++t)r[t]=+h(e[t],t,e)}return null==e&&(e=[]),n(f,"defaultStrength"),n(d,"force"),n(p,"initialize"),n(_,"initializeStrength"),n(g,"initializeDistance"),d.initialize=function(e){i=e,p()},d.links=function(t){return arguments.length?(e=t,p(),d):e},d.id=function(e){return arguments.length?(s=e,d):s},d.iterations=function(e){return arguments.length?(l=+e,d):l},d.strength=function(e){return arguments.length?(c="function"==typeof e?e:Og(+e),_(),d):c},d.distance=function(e){return arguments.length?(h="function"==typeof e?e:Og(+e),g(),d):h},d}om.copy=function(){var e,t,r=new nm(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=im(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=im(t));return r},om.add=Ng,om.addAll=$g,om.cover=Vg,om.data=zg,om.extent=Ug,om.find=Hg,om.remove=Gg,om.removeAll=Xg,om.root=Wg,om.size=Kg,om.visit=Qg,om.visitAfter=Zg,om.x=Ag,om.y=tm,n(am,"index"),n(sm,"find$1"),n(um,"d3ForceLink");var cm,hm,lm=0,fm=0,dm=0,pm=0,_m=0,gm=0,mm="object"==typeof performance&&performance.now?performance:Date,vm="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ym(){return _m||(vm(bm),_m=mm.now()+gm)}function bm(){_m=0}function wm(){this._call=this._time=this._next=null}function xm(e,t,r){var n=new wm;return n.restart(e,t,r),n}function Em(){ym(),++lm;for(var e,t=cm;t;)(e=_m-t._time)>=0&&t._call.call(null,e),t=t._next;--lm}function Cm(){_m=(pm=mm.now())+gm,lm=fm=0;try{Em()}finally{lm=0,Dm(),_m=0}}function km(){var e=mm.now(),t=e-pm;t>1e3&&(gm-=t,pm=e)}function Dm(){for(var e,t,r=cm,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:cm=t);hm=e,Mm(n)}function Mm(e){lm||(fm&&(fm=clearTimeout(fm)),e-_m>24?(e<1/0&&(fm=setTimeout(Cm,e-mm.now()-gm)),dm&&(dm=clearInterval(dm))):(dm||(pm=mm.now(),dm=setInterval(km,1e3)),lm=1,vm(Cm)))}function Fm(e){return e.x}function Sm(e){return e.y}n(ym,"now"),n(bm,"clearNow"),n(wm,"Timer"),wm.prototype=xm.prototype={constructor:wm,restart:/* @__PURE__ */n(function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?ym():+r)+(null==t?0:+t),this._next||hm===this||(hm?hm._next=this:cm=this,hm=this),this._call=e,this._time=r,Mm()},"restart"),stop:/* @__PURE__ */n(function(){this._call&&(this._call=null,this._time=1/0,Mm())},"stop")},n(xm,"timer"),n(Em,"timerFlush"),n(Cm,"wake"),n(km,"poke"),n(Dm,"nap"),n(Mm,"sleep"),n(Fm,"x$1"),n(Sm,"y$1");var Rm=Math.PI*(3-Math.sqrt(5));function jm(e){var t,r=1,i=.001,o=1-Math.pow(i,1/300),a=0,s=.6,h=u(),l=xm(d),f=c("tick","end");function d(){p(),f.call("tick",t),r<i&&(l.stop(),f.call("end",t))}function p(n){var i,u,c=e.length;void 0===n&&(n=1);for(var l=0;l<n;++l)for(r+=(a-r)*o,h.each(function(e){e(r)}),i=0;i<c;++i)null==(u=e[i]).fx?u.x+=u.vx*=s:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=s:(u.y=u.fy,u.vy=0);return t}function _(){for(var t,r=0,n=e.length;r<n;++r){if((t=e[r]).index=r,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=10*Math.sqrt(r),o=r*Rm;t.x=i*Math.cos(o),t.y=i*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function g(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),n(d,"step"),n(p,"tick"),n(_,"initializeNodes"),n(g,"initializeForce"),_(),t={tick:p,restart:/* @__PURE__ */n(function(){return l.restart(d),t},"restart"),stop:/* @__PURE__ */n(function(){return l.stop(),t},"stop"),nodes:/* @__PURE__ */n(function(r){return arguments.length?(e=r,_(),h.each(g),t):e},"nodes"),alpha:/* @__PURE__ */n(function(e){return arguments.length?(r=+e,t):r},"alpha"),alphaMin:/* @__PURE__ */n(function(e){return arguments.length?(i=+e,t):i},"alphaMin"),alphaDecay:/* @__PURE__ */n(function(e){return arguments.length?(o=+e,t):+o},"alphaDecay"),alphaTarget:/* @__PURE__ */n(function(e){return arguments.length?(a=+e,t):a},"alphaTarget"),velocityDecay:/* @__PURE__ */n(function(e){return arguments.length?(s=1-e,t):1-s},"velocityDecay"),force:/* @__PURE__ */n(function(e,r){return arguments.length>1?(null==r?h.remove(e):h.set(e,g(r)),t):h.get(e)},"force"),find:/* @__PURE__ */n(function(t,r,n){var i,o,a,s,u,c=0,h=e.length;for(null==n?n=1/0:n*=n,c=0;c<h;++c)(a=(i=t-(s=e[c]).x)*i+(o=r-s.y)*o)<n&&(u=s,n=a);return u},"find"),on:/* @__PURE__ */n(function(e,r){return arguments.length>1?(f.on(e,r),t):f.on(e)},"on")}}function Lm(){var e,t,r,i,o=Og(-30),a=1,s=1/0,u=.81;function c(n){var i,o=e.length,a=rm(e,Fm,Sm).visitAfter(l);for(r=n,i=0;i<o;++i)t=e[i],a.visit(f)}function h(){if(e){var t,r,n=e.length;for(i=new Array(n),t=0;t<n;++t)r=e[t],i[r.index]=+o(r,t,e)}}function l(e){var t,r,n,o,a,s=0,u=0;if(e.length){for(n=o=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,n+=r*t.x,o+=r*t.y);e.x=n/u,e.y=o/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=i[t.data.index]}while(t=t.next)}e.value=s}function f(e,n,o,c){if(!e.value)return!0;var h=e.x-t.x,l=e.y-t.y,f=c-n,d=h*h+l*l;if(f*f/u<d)return d<s&&(0===h&&(d+=(h=Bg())*h),0===l&&(d+=(l=Bg())*l),d<a&&(d=Math.sqrt(a*d)),t.vx+=h*e.value*r/d,t.vy+=l*e.value*r/d),!0;if(!(e.length||d>=s)){(e.data!==t||e.next)&&(0===h&&(d+=(h=Bg())*h),0===l&&(d+=(l=Bg())*l),d<a&&(d=Math.sqrt(a*d)));do{e.data!==t&&(f=i[e.data.index]*r/d,t.vx+=h*f,t.vy+=l*f)}while(e=e.next)}}return n(c,"force"),n(h,"initialize"),n(l,"accumulate"),n(f,"apply"),c.initialize=function(t){e=t,h()},c.strength=function(e){return arguments.length?(o="function"==typeof e?e:Og(+e),h(),c):o},c.distanceMin=function(e){return arguments.length?(a=e*e,c):Math.sqrt(a)},c.distanceMax=function(e){return arguments.length?(s=e*e,c):Math.sqrt(s)},c.theta=function(e){return arguments.length?(u=e*e,c):Math.sqrt(u)},c}function Im(e){var t,r,i,o=Og(.1);function a(e){for(var n,o=0,a=t.length;o<a;++o)(n=t[o]).vx+=(i[o]-n.x)*r[o]*e}function s(){if(t){var n,a=t.length;for(r=new Array(a),i=new Array(a),n=0;n<a;++n)r[n]=isNaN(i[n]=+e(t[n],n,t))?0:+o(t[n],n,t)}}return"function"!=typeof e&&(e=Og(null==e?0:+e)),n(a,"force"),n(s,"initialize"),a.initialize=function(e){t=e,s()},a.strength=function(e){return arguments.length?(o="function"==typeof e?e:Og(+e),s(),a):o},a.x=function(t){return arguments.length?(e="function"==typeof t?t:Og(+t),s(),a):e},a}function qm(e){var t,r,i,o=Og(.1);function a(e){for(var n,o=0,a=t.length;o<a;++o)(n=t[o]).vy+=(i[o]-n.y)*r[o]*e}function s(){if(t){var n,a=t.length;for(r=new Array(a),i=new Array(a),n=0;n<a;++n)r[n]=isNaN(i[n]=+e(t[n],n,t))?0:+o(t[n],n,t)}}return"function"!=typeof e&&(e=Og(null==e?0:+e)),n(a,"force"),n(s,"initialize"),a.initialize=function(e){t=e,s()},a.strength=function(e){return arguments.length?(o="function"==typeof e?e:Og(+e),s(),a):o},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Og(+t),s(),a):e},a}n(jm,"d3ForceSimulation"),n(Lm,"d3ForceManyBody"),n(Im,"d3ForceX"),n(qm,"d3ForceY");let Pm=(n(e=class{pos={};constructor(e,t,r,n){const i=this;this.pos={};n=n||(t<r?t-0:r-0)/2;const o=e.nodeCount();let a=-Math.PI/2;const s=2*Math.PI/o;e.eachNode(function(e,o){const u=o.getBBox();i.pos[e]={x:o.fixed?o.x:t/2+Math.cos(a)*(n-0),y:o.fixed?o.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s})}nodePos(e){return this.pos[e]}edgePoints(e){return[]}},"Circle"),e),Om=(n(t=class{pos={};vertices=[];vertexMap={};edges=[];force;constructor(e,t,r,n){n=n||{},this.pos={},this.vertices=[],this.vertexMap={},e.eachNode(t=>{const r=e.node(t),n=r.getBBox(),i={id:t,x:r.pos().x,y:r.pos().y,width:n.width,height:n.height,value:r};this.vertices.push(i),this.vertexMap[t]=i}),this.edges=[],e.eachEdge((e,t,r)=>{this.edges.push({source:t,target:r})});const i=um().id(function(e){return e.id}).distance(n.linkDistance).strength(n.linkStrength),o=Lm().strength(function(e){const t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)});if(this.force=jm().force("link",i).force("charge",o).force("center",Pg(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();let t=e.nodeCount();t=Math.min(t*t,500);for(let e=0;e<t;++e)this.force.tick();this.force.stop()}}nodePos(e){return this.vertexMap[e]}edgePoints(e){return[]}},"ForceDirected"),t);const Bm=class _Hierarchy{digraph;dagreLayout;constructor(e,t,r,n){this.digraph=new Rg.graphlib.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}}),e.eachNode(t=>{const r=e.node(t).getBBox();this.digraph.setNode(t,{width:r.width,height:r.height})}),e.eachEdge((t,r,i)=>{const o=e.edge(t);this.digraph.setEdge(r,i,{weight:o.weight()},o._id),n.digraph||this.digraph.setEdge(i,r,{weight:o.weight()},o._id)}),e.eachNode(t=>{this.digraph.setParent(t,e.parent(t))}),this.dagreLayout=Rg.layout(this.digraph,{debugTiming:!1});const i=-this.digraph.graph().width/2,o=-this.digraph.graph().height/2;this.digraph.nodes().forEach(e=>{const n=this.digraph.node(e);n.x+=i+t/2,n.y+=o+r/2}),this.digraph.edges().forEach(e=>{const n=this.digraph.edge(e);for(let a=0;a<n.points.length;++a)n.points[a].x+=i+t/2,n.points[a].y+=o+r/2}),this.digraph=this.digraph}nodePos(e){return this.digraph.node(e)}edgePoints(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points}};n(Bm,"Hierarchy");let Nm=Bm;const Tm=class _Subgraph extends o{_border;_textWidget=(new h).anchor("start").fontSize(14);_buttonMin=(new l).diameter(18).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",()=>{this.minClick()},!0).on("dblclick",()=>{},!0);_minState="normal";constructor(){super()}minState(e){return arguments.length?(this._minState=e,this):this._minState}calcIcon(){switch(this._minState){case"normal":return"";case"partial":return""}}getBBox(e=!1,t=!1){const r=this.width(),n=this.height();return{x:-r/2,y:-n/2-14,width:r,height:n}}enter(e,t){super.enter(e,t),this._border=t.append("rect").attr("class","border"),this._textWidget.target(e),this._buttonMin.target(e)}update(e,t){super.update(e,t);const r=this.getBBox();this._border.attr("x",r.x).attr("y",r.y).attr("width",r.width).attr("height",r.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(f.textColor(this.border_colorFill())),this._textWidget.pos({x:r.x+4,y:r.y+14}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:r.x+r.width-13,y:r.y+13}).faChar(this.calcIcon()).render()}exit(e,t){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),super.exit(e,t)}intersection(e,t){let r=null;return[].forEach(function(e){(null===r||r.d>e.d)&&(r=e)}),r&&r.i?r.i:null}click(e){}minClick(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()}};n(Tm,"Subgraph");let $m=Tm;$m.prototype._class+=" graph_Subgraph",$m.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),$m.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),$m.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),$m.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),$m.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),$m.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),$m.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});const Vm=class _Vertex extends o{_icon;_textBox;_annotationWidgets;_graphID;constructor(){super(),this._icon=new l,this._textBox=new a,this._annotationWidgets={},this.pos({x:void 0,y:void 0})}getIconBBox(){const e=this._icon.getBBox(!0),t=this._textBox.getBBox(!0);switch(this.iconAnchor()){case"start":return{x:-t.width/2+e.width/3,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"middle":return{x:0,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"end":return{x:t.width/2-e.width/3,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"left":return{x:-t.width/2-e.width/2,y:0,width:e.width,height:e.height}}return{x:0,y:0,width:e.width,height:e.height}}getBBox(e=!1,t=!1){const r=this.getIconBBox(),n=this._textBox.getBBox(!0),i=Math.min(r.x,n.x),o=Math.min(r.y,n.y);return{x:i,y:o,width:Math.max(r.x+r.width,n.x+n.width)-i,height:Math.max(r.y+r.height,n.y+n.height)-o}}enter(e,t){super.enter(e,t),delete this._prevHash,this._icon.target(e),this._textBox.target(e),t.on("mouseover",e=>this.mouseover(e.data())).on("mouseout",e=>this.mouseout(e.data()))}_prevHash;update(e,t){super.update(e,t);const r=this.hashSum();if(this._prevHash!==r){this._prevHash=r,t.classed("centroid",this.centroid()),t.style("filter",this.centroid()?"url(#"+this._graphID+"_glow)":null),this._icon.tooltip(this.iconTooltip()?this.iconTooltip():this.tooltip()).render(),this._textBox.tooltip(this.tooltip()).render();const e=this.getIconBBox();this._icon.move(e);const n=this,i=t.selectAll(".annotation").data(this.annotationIcons()),o=i.enter().append("g").attr("class","annotation").each(function(e,t){n._annotationWidgets[t]=(new l).target(this).shape("square")}),a=this._textBox.getBBox(!0);let s=a.width/2;const u=a.height/2;o.merge(i).each(function(e,t){const r=n._annotationWidgets[t];r.diameter(n.annotationDiameter()).shape_colorFill(n.textbox_shape_colorFill()).shape_colorStroke(n.textbox_shape_colorStroke());for(const n in e)r[n]?r[n](e[n]):globalThis.__hpcc_debug&&console.warn("Invalid annotation property: "+n);r.render();const i=r.getBBox(!0);r.move({x:s-i.width/2+4,y:u+i.height/2-4}),s-=i.width+n.annotationSpacing()}),i.exit().each(function(e,t){const r=d(this);n._annotationWidgets[t].target(null),delete n._annotationWidgets[t],r.remove()})}}exit(e,t){for(const r in this._annotationWidgets)this._annotationWidgets[r].target(null);this._icon.target(null),this._textBox.target(null),super.exit(e,t)}contains(e){return this._icon.contains(e)||this._textBox.contains(e)}intersection(e,t){const r=this._icon.intersection(e,t),n=this._textBox.intersection(e,t);return r&&n?this.distance(r,t)<this.distance(n,t)?r:n:r||n}mouseover(e){}mouseout(e){}};n(Vm,"Vertex");let zm=Vm;zm.prototype._class+=" graph_Vertex",zm.prototype.publishProxy("faChar","_icon"),zm.prototype.publishProxy("imageUrl","_icon"),zm.prototype.publishProxy("icon_diameter","_icon","diameter"),zm.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),zm.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),zm.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),zm.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),zm.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),zm.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),zm.prototype.publishProxy("text","_textBox"),zm.prototype.publishProxy("anchor","_textBox"),zm.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),zm.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),zm.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),zm.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),zm.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),zm.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),zm.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),zm.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),zm.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),zm.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});const Um=class _Graph extends p{_toggleHierarchy=(new _).faChar("fa-sitemap").tooltip("Hierarchy").on("click",()=>this.layoutClick("Hierarchy"));_toggleForceDirected=(new _).faChar("fa-expand").tooltip("Force Directed").on("click",()=>this.layoutClick("ForceDirected"));_toggleForceDirected2=(new _).faChar("fa-arrows").tooltip("Spring").on("click",()=>this.layoutClick("ForceDirected2"));_toggleCircle=(new _).faChar("fa-circle-o").tooltip("Circle").on("click",()=>this.layoutClick("Circle"));_graphData;highlight;_selection;_dragging;forceLayout;_d3Drag;defs;_centroidFilter;svgFragment;svg;svgC;svgE;svgV;constructor(){super(),j.call(this),L.call(this),this.tooltipHTML(function(e){let t;return e instanceof $m?t=e.title().replace(/\n/g,"<br>"):(e instanceof zm||e instanceof ve)&&(t=e.text().replace(/\n/g,"<br>")),t?`<p style="text-align:center">${t}</p>`:null}),this._drawStartPos="origin";const e=[this._toggleHierarchy,this._toggleForceDirected,this._toggleForceDirected2,this._toggleCircle,new g];this._iconBar.buttons(e.concat(this._iconBar.buttons())),this._graphData=new qg,this.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},this._selection=new m.Selection(this),this.zoomToFitLimit(1)}iconBarButtons(){return this._iconBar.buttons()}layoutClick(e){this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render(e=>{this.applyScaleOnLayout(!1)})}getOffsetPos(){return{x:0,y:0}}size(e){return super.size.apply(this,arguments)}clear(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)}_dataHash=0;data(e,t){const r=super.data.apply(this,arguments);if(arguments.length){t||(this._graphData=new qg,this._renderCount=0);const r=this._graphData.setData(e.subgraphs||[],e.vertices||[],e.edges||[],e.hierarchy||[],t||!1);r.addedVertices.length&&this._dataHash++;const n=this;r.addedVertices.forEach(function(e){e._graphID=n._id}),r.addedEdges.forEach(function(e){e._graphID=n._id});const i={};this._graphData.edges().forEach(function(e){i[e._sourceVertex._id]||(i[e._sourceVertex._id]={}),i[e._sourceVertex._id][e._targetVertex._id]||(i[e._sourceVertex._id][e._targetVertex._id]=0);const t=++i[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)})}return r}graphData(){return this._graphData}selection(e){return arguments.length?(this._selection.set(e),this):this._selection.get()}_linkcolor;linkcolor_default(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor}_linktooltip;linktooltip_default(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip}_neighborOffsets=[];dragstart(e){if(this.allowDragging()){const t=v();if(t.sourceEvent.stopPropagation(),e.__drag_dx=t.x-e.x(),e.__drag_dy=t.y-e.y(),this._dragging=!0,this.forceLayout){t.active||this.forceLayout.force.alphaTarget(.3).restart();const r=this.forceLayout.vertexMap[e.id()];r.fixed=!0,r.fx=r.x,r.fy=r.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map(t=>(d(t.target()).raise(),{neighbor:t,offsetX:e.x()-t.x(),offsetY:e.y()-t.y()})));const r=e.target();let n=r.nextSibling;for(;n;)r.parentNode.insertBefore(n,r),n=r.nextSibling;s.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(e=>{const t=this._graphData.edge(e);this._pushMarkers(t.element())})}}dragging(e){if(this.allowDragging()){const t=v();if(t.sourceEvent.stopPropagation(),e.move({x:t.x-e.__drag_dx,y:t.y-e.__drag_dy}),this.forceLayout){const r=this.forceLayout.vertexMap[e.id()];r.fixed=!0,r.fx=t.x-e.__drag_dx,r.fy=t.y-e.__drag_dy}this._neighborOffsets.forEach(r=>{const n=t.x-e.__drag_dx-r.offsetX,i=t.y-e.__drag_dy-r.offsetY;if(this.forceLayout){const e=this.forceLayout.vertexMap[r.neighbor.id()];e.fixed=!0,e.fx=n,e.fy=i}r.neighbor.move({x:n,y:i})}),this.refreshIncidentEdges(e,!0)}}dragend(e){if(this.allowDragging()){if(v().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){const t=e.calcSnap(this.snapToGrid());e.move(t[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){const t=this.forceLayout.vertexMap[e.id()];t.fixed=!1,t.fx=null,t.fy=null,this._neighborOffsets.forEach(e=>{const t=this.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null})}this._neighborOffsets=[],s.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){const t=this._graphData.edge(e);this._popMarkers(t.element())})}}enter(e,t){super.enter(e,t),this._zoomGrab.on("click.clear",()=>{this.selectionClearOnBackgroundClick()&&this._selection.clear()}),this._d3Drag=y().on("start",e=>this.dragstart(e)).on("end",e=>this.dragend(e)).on("drag",e=>this.dragging(e)),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new b(this.defs,this._id+"_glow"),this.svg=this._renderElement.append("svg:g"),this.svgC=this.svg.append("g").attr("id",this._id+"C"),this.svgE=this.svg.append("g").attr("id",this._id+"E"),this.svgV=this.svg.append("g").attr("id",this._id+"V")}getBounds(e,t){const r=[[null,null],[null,null]];return e.forEach(function(e){const n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},i=n.x-n.width/2,o=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>i)&&(r[0][0]=i),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<o)&&(r[1][0]=o),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)}),r}getVertexBounds(e){return this.getBounds(this._graphData.nodes(),e)}getSelectionBounds(e){return this.getBounds(this._selection.get(),e)}centerOnItem(e){const t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,i={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(i)}zoomToItem(e){const t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,i={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(i)}updateVertices(e,t,r){const i=this.width(),o=this.height(),a=this,s=e.selectAll("#"+this._id+t+" > .graphVertex").data(r,function(e){return e.id()});function u(e){d(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||i/2,y:e.y()||o/2}).animationFrameRender(),a.allowDragging()&&d(this).call(a._d3Drag),e.dispatch&&(e.dispatch.on("sizestart",function(e){e.allowResize(a.allowDragging()),a.allowDragging()&&(a._dragging=!0)}),e.dispatch.on("size",function(e){a.refreshIncidentEdges(e,!1)}),e.dispatch.on("sizeend",function(e){if(a._dragging=!1,a.snapToGrid()){const t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}}))}function c(e){e.animationFrameRender()}s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,v()),a.selectionChanged()}).on("click",function(e){const t=d(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",r,{vertex:e})}).on("dblclick",function(e){v().stopPropagation();const t=d(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",r,{vertex:e})}).on("contextmenu",function(e){const t=d(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",r,{vertex:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.vertex_mouseover(d(this),e)}).on("mouseout",function(e){a._dragging||a.vertex_mouseout(d(this),e)}).each(u).transition().duration(750).style("opacity",1),n(u,"createV"),s.each(c),n(c,"updateV"),s.exit().each(function(e){e.target(null)}).remove(),s.order()}update(e,t){super.update(e,t),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());const r=this.layout();this._toggleHierarchy.selected("Hierarchy"===r).render(),this._toggleForceDirected.selected("ForceDirected"===r).render(),this._toggleForceDirected2.selected("ForceDirected2"===r).render(),this._toggleCircle.selected("Circle"===r).render();const i=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter(e=>"Hierarchy"===this.layout()&&e instanceof $m)),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter(e=>!(e instanceof $m)));const o=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],function(e){return e.id()});function a(e){e.target(this).animationFrameRender()}function s(e){e.animationFrameRender()}o.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",function(e){i._selection.click(e,v())}).on("click",function(e){const t=d(this).select(".graph_Edge");let r=!1;t.empty()||(r=t.classed("selected")),i.edge_click(i.rowToObj(e.data()),"",r,{edge:e})}).on("dblclick",function(e){const t=d(this).select(".graph_Edge");let r=!1;t.empty()||(r=t.classed("selected")),i.edge_dblclick(i.rowToObj(e.data()),"",r,{edge:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){i._dragging||i.edge_mouseover(d(this),e)}).on("mouseout",function(e){i._dragging||i.edge_mouseout(d(this),e)}).each(a).transition().duration(750).style("opacity",1),n(a,"createE"),o.each(s),n(s,"updateE"),o.exit().each(function(e){e.target(null)}).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))}exit(e,t){this._graphData.nodes().forEach(e=>e.target(null)),this._graphData.edges().forEach(e=>e.target(null)),super.exit(e,t)}render(e){return this.progress("start"),super.render(t=>{this.doLayout().then(()=>{this.progress("end"),e&&e(t)})}),this}_prevLayout;_prevDataHash;doLayout(e=0){return new Promise((t,r)=>{requestAnimationFrame(()=>{this._prevLayout!==this.layout()||this._prevDataHash!==this._dataHash?(this._prevLayout=this.layout(),this._prevDataHash=this._dataHash,this._doLayout(e).then(()=>{t()})):t()})})}_doLayout(e=0){return new Promise((t,r)=>{this.progress("layout-start"),this.forceLayout&&(this.forceLayout.force.stop(),this.forceLayout=null);const n=this,i=this.getLayoutEngine();"ForceDirected2"===this.layout()?(this.forceLayout=i,this.forceLayout.force.on("tick",function(){n.progress("layout-tick"),i.vertices.forEach(function(e){if(e.fixed);else{const t=n._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}}),n._graphData.edges().forEach(e=>{e.points([],!1,!1)}),n.applyScaleOnLayout()}).on("end",function(){n.progress("layout-end")}),this.forceLayout.force.restart(),t()):i&&(this.forceLayout=null,n._dragging=!0,n._graphData.nodes().forEach(function(e){const t=i.nodePos(e.id());e instanceof _Graph.Subgraph?e.pos({x:t.x,y:t.y}).size({width:t.width,height:t.height}).animationFrameRender():e.move({x:t.x,y:t.y},0)}),n._graphData.edges().forEach(t=>{const r=i.edgePoints(t);t.points(r,e)}),n.applyScaleOnLayout()&&requestAnimationFrame(()=>{n.zoomToFit(),t()}),this._fixIEMarkers(),setTimeout(function(){n._dragging=!1},e?e+50:50),this.progress("layout-end"),n.applyScaleOnLayout()||t())})}getLayoutEngine(){switch(this.layout()){case"Circle":return new Pm(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new Om(this._graphData,this._size.width,this._size.height,{oneShot:!0,linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),friction:this.forceDirectedFriction(),charge:this.forceDirectedCharge(),chargeDistance:this.forceDirectedChargeDistance(),theta:this.forceDirectedTheta(),gravity:this.forceDirectedGravity()});case"ForceDirected2":return new Om(this._graphData,this._size.width,this._size.height,{linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),friction:this.forceDirectedFriction(),charge:this.forceDirectedCharge(),chargeDistance:this.forceDirectedChargeDistance(),theta:this.forceDirectedTheta(),gravity:this.forceDirectedGravity()});case"Hierarchy":return new Nm(this._graphData,this._size.width,this._size.height,{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()})}return null}getNeighborMap(e){const t={},r={};if(e){const n=this._graphData.nodeEdges(e.id());for(let i=0;i<n.length;++i){const o=this._graphData.edge(n[i]);r[o.id()]=o,o._sourceVertex.id()!==e.id()&&(t[o._sourceVertex.id()]=o._sourceVertex),o._targetVertex.id()!==e.id()&&(t[o._targetVertex.id()]=o._targetVertex)}}return{vertices:t,edges:r}}highlightVerticies(e){const t=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",t=>!e||e[t.id()]).style("filter",t=>e&&e[t.id()]?"url(#"+this.id()+"_glow)":null).transition().duration(this.transitionDuration()).on("end",function(t){e&&e[t.id()]&&t._placeholderElement.node()&&t._placeholderElement.node().parentNode&&t._placeholderElement.node().parentNode.appendChild(t._placeholderElement.node())}).style("opacity",function(r){return!e||e[r.id()]?1:t.highlight.opacity}),this}highlightEdges(e){const t=this;return this.svgE.selectAll(".graphEdge").classed("graphEdge-highlighted",function(t){return!e||e[t.id()]}).style("stroke-width",function(r){return e&&e[r.id()]?t.highlight.edge:"1px"}).transition().duration(this.transitionDuration()).style("opacity",function(r){return!e||e[r.id()]?1:t.highlight.opacity}),this}highlightVertex(e,t){if(this.highlightOnMouseOverVertex())if(t){const e=this.getNeighborMap(t);e.vertices[t.id()]=t,this.highlightVerticies(e.vertices),this.highlightEdges(e.edges)}else this.highlightVerticies(null),this.highlightEdges(null)}highlightEdge(e,t){if(this.highlightOnMouseOverEdge())if(t){const e={};e[t._sourceVertex.id()]=t._sourceVertex,e[t._targetVertex.id()]=t._targetVertex;const r={};r[t.id()]=t,this.highlightVerticies(e),this.highlightEdges(r)}else this.highlightVerticies(null),this.highlightEdges(null)}refreshIncidentEdges(e,t){this._graphData.nodeEdges(e.id()).forEach(e=>{this._graphData.edge(e).points([],!1,t)})}centroids(){return this._graphData.nodes().filter(e=>e.centroid())}selectionChanged(){if(this.highlightSelectedPathToCentroid()){const e={};this.centroids().forEach(t=>{this.selection().forEach(r=>{this._graphData.undirectedShortestPath(t.id(),r.id()).forEach(t=>{e[t.id()]=!0})})}),this.svgE.selectAll(".graphEdge").classed("shortest-path",t=>!0===e[t.id()])}}vertex_click(e,t,r,n){n&&n.vertex&&n.vertex._placeholderElement.node().parentNode.appendChild(n.vertex._placeholderElement.node()),j.prototype.vertex_click.apply(this,arguments)}vertex_dblclick(e,t,r,n){}vertex_contextmenu(e,t,r,n){}vertex_mouseover(e,t){this.highlightVertex(e,t)}vertex_mouseout(e,t){this.highlightVertex(null,null)}edge_mouseover(e,t){this.highlightEdge(e,t)}edge_mouseout(e,t){this.highlightEdge(null,null)}addMarkers(e=!1){e&&(this.defs.select("#"+this._id+"_arrowHead").remove(),this.defs.select("#"+this._id+"_circleFoot").remove(),this.defs.select("#"+this._id+"_circleHead").remove(),this.defs.select("#"+this._id+"_glow").remove()),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_arrowHead").attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",8).attr("markerHeight",8).attr("markerUnits","strokeWidth").attr("orient","auto").append("polyline").attr("points","0,0 10,5 0,10 1,5"),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_circleFoot").attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",7).attr("markerHeight",7).attr("markerUnits","strokeWidth").attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",4),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_circleHead").attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",7).attr("markerHeight",7).attr("markerUnits","strokeWidth").attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",4)}progress(e){}};n(Um,"Graph"),i(Um,"Subgraph",$m),i(Um,"Vertex",zm),i(Um,"Edge",ve),i(Um,"profileID",0);let Ym=Um;Ym.prototype._class+=" graph_Graph",Ym.prototype.implements(j.prototype),Ym.prototype.implements(L.prototype),Ym.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),Ym.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),Ym.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),Ym.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),Ym.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),Ym.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),Ym.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),Ym.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),Ym.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),Ym.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),Ym.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Ym.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),Ym.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),Ym.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),Ym.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),Ym.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),Ym.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),Ym.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),Ym.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});const Hm=Ym.prototype.scale;Ym.prototype.scale=function(e,t){const r=Hm.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};const Gm=class _Annotation extends w{_owner;owner(e){return arguments.length?(this._owner=e,this):this._owner}valid(){return!!this.iconColumn()}indexes(){const e=this._owner.columns();return{iconCol:e.indexOf(this.iconColumn()),iconFillCol:e.indexOf(this.iconFillColumn()),tooltipCol:e.indexOf(this.tooltipColumn()),shapeStrokeCol:e.indexOf(this.shapeStrokeColumn()),shapeFillCol:e.indexOf(this.shapeFillColumn())}}mapper(){const e=this.indexes();return t=>({faChar:t[e.iconCol],tooltip:t[e.tooltipCol],shape_colorFill:t[e.shapeFillCol]||this.shapeFillDefault(),shape_colorStroke:t[e.shapeStrokeCol]||this.shapeStrokeDefault(),image_colorFill:t[e.iconFillCol]||this.iconFillDefault()})}};n(Gm,"Annotation");let Xm=Gm;Xm.prototype._class+=" graph_Annotation",Xm.prototype.publish("iconColumn","","set","Icon column",function(){return this._owner.columns()},{optional:!0}),Xm.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),Xm.prototype.publish("iconFillColumn","","set","Icon fill color column",function(){return this._owner.columns()},{optional:!0}),Xm.prototype.publish("tooltipColumn","","set","Tooltip column",function(){return this._owner.columns()},{optional:!0}),Xm.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),Xm.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",function(){return this._owner.columns()},{optional:!0}),Xm.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),Xm.prototype.publish("shapeFillColumn","","set","Shape fill color column",function(){return this._owner.columns()},{optional:!0});const Wm=class _AdjacencyGraph extends Ym{_vertexMap={};_edgeMap={};_prevAdjacencyDataHash;_merge=!1;_adjacencyData=[];constructor(){super()}linksColumns(){const e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map(e=>e.label()):[]}validAnnotations(){return this.annotations().filter(e=>e.valid())}updateData(){const e=F([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map(e=>e.hashSum())]);if(this._prevAdjacencyDataHash!==e){this._prevAdjacencyDataHash=e;const t=this.columns(),r=t.indexOf(this.uidColumn()),n=t.indexOf(this.labelColumn()),i=t.indexOf(this.iconColumn()),o=t.indexOf(this.linksColumn()),a=this.linksColumns(),s=a.indexOf(this.linkUidColumn()),u=a.indexOf(this.linkLabelColumn()),c=this.validAnnotations().map(e=>e.mapper()),h={},l={},f={vertices:this._adjacencyData.map(e=>{const t=e[r];if(void 0!==t){let r=h[t]||this._vertexMap[t];return r||(r=new zm),h[t]=r,r.text(e[n]).data(e).faChar(e[i]).annotationIcons(c.map(t=>t(e))),r}}).filter(e=>!!e),edges:[]};for(const e of this._adjacencyData){const t=e[r],n=e[o];if(void 0!==t&&void 0!==n)for(const e of n){const r=e[s],n=e[u],i=`${t}->${r}`;let o=l[i]||this._edgeMap[i];o||(h[t]&&h[r]?o=(new ve).sourceVertex(h[t]).targetVertex(h[r]).data(e):console.warn("Missing vertices for edge: "+i)),o&&(o.text(n),l[i]=o,f.edges.push(o))}}this._vertexMap=h,this._edgeMap=l,super.data(f,this._merge)}}data(e,t){if(!arguments.length)return this._adjacencyData;if(e instanceof Array)return this._merge=t,this._adjacencyData=e,this;throw new Error("Invalid data shape.")}update(e,t){this.updateData(),super.update(e,t)}click(e,t,r){}};n(Wm,"AdjacencyGraph");let Km=Wm;function Qm(e,t){return e.sourceLinks.length?e.depth:t-1}function Zm(e){return function(){return e}}function Jm(e,t){return ev(e.source,t.source)||e.index-t.index}function Am(e,t){return ev(e.target,t.target)||e.index-t.index}function ev(e,t){return e.y0-t.y0}function tv(e){return e.value}function rv(e){return e.index}function nv(e){return e.nodes}function iv(e){return e.links}function ov(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function av({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(const n of t.targetLinks)n.y1=r+n.width/2,r+=n.width}}function sv(){let e,t,r,i=0,o=0,a=1,s=1,u=24,c=8,h=rv,l=Qm,f=nv,d=iv,p=6;function _(){const e={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return g(e),m(e),v(e),y(e),k(e),av(e),e}function g({nodes:e,links:t}){for(const[r,i]of e.entries())i.index=r,i.sourceLinks=[],i.targetLinks=[];const n=new Map(e.map((t,r)=>[h(t,r,e),t]));for(const[r,i]of t.entries()){i.index=r;let{source:e,target:t}=i;"object"!=typeof e&&(e=i.source=ov(n,e)),"object"!=typeof t&&(t=i.target=ov(n,t)),e.sourceLinks.push(i),t.targetLinks.push(i)}if(null!=r)for(const{sourceLinks:i,targetLinks:o}of e)i.sort(r),o.sort(r)}function m({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(x(t.sourceLinks,tv),x(t.targetLinks,tv)):t.fixedValue}function v({nodes:e}){const t=e.length;let r=new Set(e),n=/* @__PURE__ */new Set,i=0;for(;r.size;){for(const e of r){e.depth=i;for(const{target:t}of e.sourceLinks)n.add(t)}if(++i>t)throw new Error("circular link");r=n,n=/* @__PURE__ */new Set}}function y({nodes:e}){const t=e.length;let r=new Set(e),n=/* @__PURE__ */new Set,i=0;for(;r.size;){for(const e of r){e.height=i;for(const{source:t}of e.targetLinks)n.add(t)}if(++i>t)throw new Error("circular link");r=n,n=/* @__PURE__ */new Set}}function b({nodes:e}){const r=E(e,e=>e.depth)+1,n=(a-i-u)/(r-1),o=new Array(r);for(const t of e){const e=Math.max(0,Math.min(r-1,Math.floor(l.call(null,t,r))));t.layer=e,t.x0=i+e*n,t.x1=t.x0+u,o[e]?o[e].push(t):o[e]=[t]}if(t)for(const i of o)i.sort(t);return o}function w(t){const r=C(t,t=>(s-o-(t.length-1)*e)/x(t,tv));for(const n of t){let t=o;for(const i of n){i.y0=t,i.y1=t+i.value*r,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*r}t=(s-t+e)/(n.length+1);for(let e=0;e<n.length;++e){const r=n[e];r.y0+=t*(e+1),r.y1+=t*(e+1)}L(n)}}function k(t){const r=b(t);e=Math.min(c,(s-o)/(E(r,e=>e.length)-1)),w(r);for(let e=0;e<p;++e){const t=Math.pow(.99,e),n=Math.max(1-t,(e+1)/p);M(r,t,n),D(r,t,n)}}function D(e,r,n){for(let i=1,o=e.length;i<o;++i){const o=e[i];for(const e of o){let t=0,n=0;for(const{source:r,value:o}of e.targetLinks){let i=o*(e.layer-r.layer);t+=I(r,e)*i,n+=i}if(!(n>0))continue;let i=(t/n-e.y0)*r;e.y0+=i,e.y1+=i,j(e)}void 0===t&&o.sort(ev),F(o,n)}}function M(e,r,n){for(let i=e.length-2;i>=0;--i){const o=e[i];for(const e of o){let t=0,n=0;for(const{target:r,value:o}of e.sourceLinks){let i=o*(r.layer-e.layer);t+=q(e,r)*i,n+=i}if(!(n>0))continue;let i=(t/n-e.y0)*r;e.y0+=i,e.y1+=i,j(e)}void 0===t&&o.sort(ev),F(o,n)}}function F(t,r){const n=t.length>>1,i=t[n];R(t,i.y0-e,n-1,r),S(t,i.y1+e,n+1,r),R(t,s,t.length-1,r),S(t,o,0,r)}function S(t,r,n,i){for(;n<t.length;++n){const o=t[n],a=(r-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),r=o.y1+e}}function R(t,r,n,i){for(;n>=0;--n){const o=t[n],a=(o.y1-r)*i;a>1e-6&&(o.y0-=a,o.y1-=a),r=o.y0-e}}function j({sourceLinks:e,targetLinks:t}){if(void 0===r){for(const{source:{sourceLinks:e}}of t)e.sort(Am);for(const{target:{targetLinks:t}}of e)t.sort(Jm)}}function L(e){if(void 0===r)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(Am),r.sort(Jm)}function I(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:o}of t.sourceLinks){if(i===r)break;n+=o+e}for(const{source:e,width:i}of r.targetLinks){if(e===t)break;n-=i}return n}function q(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:i,width:o}of r.targetLinks){if(i===t)break;n+=o+e}for(const{target:e,width:i}of t.sourceLinks){if(e===r)break;n-=i}return n}return n(_,"sankey"),_.update=function(e){return av(e),e},_.nodeId=function(e){return arguments.length?(h="function"==typeof e?e:Zm(e),_):h},_.nodeAlign=function(e){return arguments.length?(l="function"==typeof e?e:Zm(e),_):l},_.nodeSort=function(e){return arguments.length?(t=e,_):t},_.nodeWidth=function(e){return arguments.length?(u=+e,_):u},_.nodePadding=function(t){return arguments.length?(c=e=+t,_):c},_.nodes=function(e){return arguments.length?(f="function"==typeof e?e:Zm(e),_):f},_.links=function(e){return arguments.length?(d="function"==typeof e?e:Zm(e),_):d},_.linkSort=function(e){return arguments.length?(r=e,_):r},_.size=function(e){return arguments.length?(i=o=0,a=+e[0],s=+e[1],_):[a-i,s-o]},_.extent=function(e){return arguments.length?(i=+e[0][0],a=+e[1][0],o=+e[0][1],s=+e[1][1],_):[[i,o],[a,s]]},_.iterations=function(e){return arguments.length?(p=+e,_):p},n(g,"computeNodeLinks"),n(m,"computeNodeValues"),n(v,"computeNodeDepths"),n(y,"computeNodeHeights"),n(b,"computeNodeLayers"),n(w,"initializeNodeBreadths"),n(k,"computeNodeBreadths"),n(D,"relaxLeftToRight"),n(M,"relaxRightToLeft"),n(F,"resolveCollisions"),n(S,"resolveCollisionsTopToBottom"),n(R,"resolveCollisionsBottomToTop"),n(j,"reorderNodeLinks"),n(L,"reorderLinks"),n(I,"targetTop"),n(q,"sourceTop"),_}function uv(e){return[e.source.x1,e.y0]}function cv(e){return[e.target.x0,e.y1]}function hv(){return ce().source(uv).target(cv)}Km.prototype._class+=" graph_AdjacencyGraph",Km.prototype.publish("uidColumn","","set","UID column",function(){return this.columns()},{optional:!0}),Km.prototype.publish("labelColumn","","set","Label column",function(){return this.columns()},{optional:!0}),Km.prototype.publish("iconColumn","","set","Icon column",function(){return this.columns()},{optional:!0}),Km.prototype.publish("linksColumn","","set","Links column",function(){return this.columns()},{optional:!0}),Km.prototype.publish("linkUidColumn","","set","Link UID column",function(){return this.linksColumns()},{optional:!0}),Km.prototype.publish("linkLabelColumn","","set","Link Label column",function(){return this.linksColumns()},{optional:!0}),Km.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:Xm}),n(Qm,"justify"),n(Zm,"constant"),n(Jm,"ascendingSourceBreadth"),n(Am,"ascendingTargetBreadth"),n(ev,"ascendingBreadth"),n(tv,"value"),n(rv,"defaultId"),n(nv,"defaultNodes"),n(iv,"defaultLinks"),n(ov,"find"),n(av,"computeLinkBreadths"),n(sv,"Sankey$1"),n(uv,"horizontalSource"),n(cv,"horizontalTarget"),n(hv,"d3SankeyLinkHorizontal");const lv={mean:D,median:k,min:C,max:E,sum:x},fv=class _SankeyColumn extends w{_owner;constructor(){super()}owner(e){return arguments.length?(this._owner=e,this):this._owner}valid(){return!!this.column()}aggregate(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:const t=this._owner.columns().indexOf(this.aggrColumn());return lv[this.aggrType()](e,function(e){return+e[t]})}}};n(fv,"SankeyColumn");let dv=fv;dv.prototype._class+=" graph_Sankey.SankeyColumn",dv.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0}),dv.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:/* @__PURE__ */n(e=>!e._owner||0===e._owner.mappings().indexOf(e),"disable")}),dv.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this._owner?this._owner.columns():[]},{optional:!0,disable:/* @__PURE__ */n(e=>!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e),"disable")});const pv=class _Sankey extends o{Column;_d3Sankey;_d3SankeyPath;_selection;constructor(){super(),m.SimpleSelectionMixin.call(this,!1),this._drawStartPos="origin"}sankeyData(){const e={vertices:[],edges:[]};if(0===this.data().length)return e;const t={},r=this.mappings().filter(e=>e.valid());return r.forEach((r,n)=>{this._db.rollupView([r.column()]).entries().forEach(function(i){const o=r.column()+":"+n+":"+i.key;t[o]||(e.vertices.push({__id:o,__category:r.column(),name:i.key,origRow:i.value,value:i.value[n][2]}),t[o]=e.vertices.length-1)},this)}),r.forEach((n,i)=>{if(i<r.length-1){const o=r[i+1];this._db.rollupView([n.column(),o.column()]).entries().forEach(function(r){const a=n.column()+":"+i+":"+r.key;r.values.forEach(function(r){const n=o.column()+":"+(i+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})})})}}),e}enter(e,t){super.enter(e,t),this._d3Sankey=new sv,this._selection.widgetElement(t)}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());const r=this.vertexStrokeWidth(),n=this.sankeyData(),i=2*r;this._d3Sankey.extent([[r,r],[this.width()-i,this.height()-i]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:n.vertices,links:n.edges});const o=this,a=t.selectAll(".link").data(n.edges);a.enter().append("path").attr("class","link").each(function(){d(this).append("title")}).merge(a).attr("d",hv()).style("stroke-width",function(e){return Math.max(1,e.width)}).sort(function(e,t){return t.width-e.width}).select("title").text(function(e){return e.source.name+" → "+e.target.name+"\n"+e.value}),a.exit().remove();const s=t.selectAll(".node").data(n.vertices);s.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){o.click(o.rowToObj(e.origRow[0]),"",o._selection.selected(this))}).on("dblclick",function(e){o.dblclick(o.rowToObj(e.origRow[0]),"",o._selection.selected(this))}).each(function(){const e=d(this);e.append("rect"),e.append("text")}).merge(s).attr("transform",function(e){let t=0,n=0;return e.x0&&(t=e.x0),e.y0&&(n=e.y0),"translate("+(t+r)+","+(n+r)+")"}).each(function(){const e=d(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",o._d3Sankey.nodeWidth()).style("fill",function(e){return o._palette(e.name)}).style("stroke",function(e){return o.vertexStrokeColor()}).style("stroke-width",function(e){return r}).style("cursor",o.xAxisMovement()||o.yAxisMovement()?null:"default"),e.select("text").attr("x",-6).attr("y",function(e){return(e.y1-e.y0)/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(e){return e.name}).filter(function(e){return e.x0<o.width()/2}).attr("x",6+o._d3Sankey.nodeWidth()).attr("text-anchor","start")}),s.exit().remove()}exit(e,t){super.exit(e,t)}click(e,t,r){}dblclick(e,t,r){}};n(pv,"Sankey");let _v=pv;function gv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function mv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gv(Object(r),!0).forEach(function(t){yv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function vv(e){return(vv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?/* @__PURE__ */n(function(e){return typeof e},"_typeof"):/* @__PURE__ */n(function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},"_typeof"))(e)}function yv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bv(){return bv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bv.apply(this,arguments)}function wv(e,t){if(e){if("string"==typeof e)return xv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xv(e,t):void 0}}function xv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ev(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=wv(e))||t){r&&(e=r);var i=0,o=/* @__PURE__ */n(function(){},"F");return{s:o,n:/* @__PURE__ */n(function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},"n"),e:/* @__PURE__ */n(function(e){throw e},"e"),f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:/* @__PURE__ */n(function(){r=r.call(e)},"s"),n:/* @__PURE__ */n(function(){var e=r.next();return s=e.done,e},"n"),e:/* @__PURE__ */n(function(e){u=!0,a=e},"e"),f:/* @__PURE__ */n(function(){try{s||null==r.return||r.return()}finally{if(u)throw a}},"f")}}function Cv(e,t){var r=[],i=[];function o(e,t){if(1===e.length)r.push(e[0]),i.push(e[0]);else{for(var n=Array(e.length-1),a=0;a<n.length;a++)0===a&&r.push(e[0]),a===n.length-1&&i.push(e[a+1]),n[a]=[(1-t)*e[a][0]+t*e[a+1][0],(1-t)*e[a][1]+t*e[a+1][1]];o(n,t)}}return n(o,"decasteljauRecurse"),e.length&&o(e,t),{left:r,right:i.reverse()}}function kv(e){var t={};return 4===e.length&&(t.x2=e[2][0],t.y2=e[2][1]),e.length>=3&&(t.x1=e[1][0],t.y1=e[1][1]),t.x=e[e.length-1][0],t.y=e[e.length-1][1],4===e.length?t.type="C":3===e.length?t.type="Q":t.type="L",t}function Dv(e,t){for(var r=[],n=e,i=1/(t=t||2),o=0;o<t-1;o++){var a=Cv(n,i/(1-i*o));r.push(a.left),n=a.right}return r.push(n),r}function Mv(e,t,r){var n=[[e.x,e.y]];return null!=t.x1&&n.push([t.x1,t.y1]),null!=t.x2&&n.push([t.x2,t.y2]),n.push([t.x,t.y]),Dv(n,r).map(kv)}_v.prototype._class+=" graph_Sankey",_v.prototype.Column=dv,_v.prototype.mixin(m.SimpleSelectionMixin),_v.prototype._palette=f.ordinal("default"),_v.prototype.publish("paletteID","default","set","Color palette for this widget",_v.prototype._palette.switch()),_v.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:dv}),_v.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),_v.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),_v.prototype.publish("vertexWidth",36,"number","Vertex Width"),_v.prototype.publish("vertexPadding",40,"number","Vertex Padding"),_v.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),_v.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),n(gv,"ownKeys"),n(mv,"_objectSpread2"),n(vv,"_typeof"),n(yv,"_defineProperty"),n(bv,"_extends"),n(wv,"_unsupportedIterableToArray"),n(xv,"_arrayLikeToArray"),n(Ev,"_createForOfIteratorHelper"),n(Cv,"decasteljau"),n(kv,"pointsToCommand"),n(Dv,"splitCurveAsPoints"),n(Mv,"splitCurve");var Fv=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,Sv={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};function Rv(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=t;return r}function jv(e){return"".concat(e.type).concat(Sv[e.type].map(function(t){return e[t]}).join(","))}function Lv(e,t){var r={x1:"x",y1:"y",x2:"x",y2:"y"},n=["xAxisRotation","largeArcFlag","sweepFlag"];if(e.type!==t.type&&"M"!==t.type.toUpperCase()){var i={};Object.keys(t).forEach(function(o){var a=t[o],s=e[o];void 0===s&&(n.includes(o)?s=a:(void 0===s&&r[o]&&(s=e[r[o]]),void 0===s&&(s=0))),i[o]=s}),i.type=t.type,e=i}return e}function Iv(e,t,r){var n=[];if("L"===t.type||"Q"===t.type||"C"===t.type)n=n.concat(Mv(e,t,r));else{var i=bv({},e);"M"===i.type&&(i.type="L"),(n=n.concat(Rv(r-1).map(function(){return i}))).push(t)}return n}function qv(e,t,r){var n=e.length-1,i=t.length-1,o=n/i,a=Rv(i).reduce(function(t,n,i){var a=Math.floor(o*i);if(r&&a<e.length-1&&r(e[a],e[a+1])){var s=o*i%1<.5;t[a]&&(s?a>0?a-=1:a<e.length-1&&(a+=1):a<e.length-1?a+=1:a>0&&(a-=1))}return t[a]=(t[a]||0)+1,t},[]).reduce(function(t,r,n){if(n===e.length-1){var i=Rv(r,bv({},e[e.length-1]));return"M"===i[0].type&&i.forEach(function(e){e.type="L"}),t.concat(i)}return t.concat(Iv(e[n],e[n+1],r))},[]);return a.unshift(e[0]),a}function Pv(e){for(var t,r,n=(e||"").match(Fv)||[],i=[],o=0;o<n.length;++o)if(t=Sv[n[o]]){r={type:n[o]};for(var a=0;a<t.length;++a)r[t[a]]=+n[o+a+1];o+=t.length,i.push(r)}return i}function Ov(e,t,r){var i=null==e?[]:e.slice(),o=null==t?[]:t.slice(),a="object"===vv(r)?r:{excludeSegment:r,snapEndsToInput:!0},s=a.excludeSegment,u=a.snapEndsToInput;if(!i.length&&!o.length)/* @__PURE__ */
3
3
  return n(function(){return[]},"nullInterpolator");var c=!(0!==i.length&&"Z"!==i[i.length-1].type||0!==o.length&&"Z"!==o[o.length-1].type);i.length>0&&"Z"===i[i.length-1].type&&i.pop(),o.length>0&&"Z"===o[o.length-1].type&&o.pop(),i.length?o.length||o.push(i[0]):i.push(o[0]),0!==Math.abs(o.length-i.length)&&(o.length>i.length?i=qv(i,o,s):o.length<i.length&&(o=qv(o,i,s)));var h=(i=i.map(function(e,t){return Lv(e,o[t])})).map(function(e){return mv({},e)});return c&&(h.push({type:"Z"}),i.push({type:"Z"})),/* @__PURE__ */n(function(e){if(1===e&&u)return null==t?[]:t;if(0===e)return i;for(var r=0;r<h.length;++r){var n,a=i[r],s=o[r],c=h[r],l=Ev(Sv[c.type]);try{for(l.s();!(n=l.n()).done;){var f=n.value;c[f]=(1-e)*a[f]+e*s[f],"largeArcFlag"!==f&&"sweepFlag"!==f||(c[f]=Math.round(c[f]))}}catch(d){l.e(d)}finally{l.f()}}return h},"pathCommandInterpolator")}function Bv(e,t,r){var i=Pv(e),o=Pv(t),a="object"===vv(r)?r:{excludeSegment:r,snapEndsToInput:!0},s=a.excludeSegment,u=a.snapEndsToInput;if(!i.length&&!o.length)/* @__PURE__ */
4
4
  return n(function(){return""},"nullInterpolator");var c=Ov(i,o,{excludeSegment:s,snapEndsToInput:u});/* @__PURE__ */