@hpcc-js/graph 2.78.0 → 2.79.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common"),require("@hpcc-js/util"),require("@hpcc-js/api"),require("@hpcc-js/react"),require("@hpcc-js/html")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util","@hpcc-js/api","@hpcc-js/react","@hpcc-js/html"],t):t((e=e||self)["@hpcc-js/graph"]={},e["@hpcc-js/common"],e["@hpcc-js/util"],e["@hpcc-js/api"],e["@hpcc-js/react"],e["@hpcc-js/html"])}(this,function(e,t,r,n,o,i){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||t)}var f=Math.PI,d=2*f,p=d-1e-6;function g(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function v(){return new g}function y(e){return function(){return e}}g.prototype=v.prototype={constructor:g,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,o,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,r,n,o){e=+e,t=+t,r=+r,n=+n,o=+o;var i=this._x1,a=this._y1,s=r-e,u=n-t,c=i-e,l=a-t,h=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>1e-6)if(Math.abs(l*s-u*c)>1e-6&&o){var d=r-i,p=n-a,g=s*s+u*u,v=d*d+p*p,y=Math.sqrt(g),m=Math.sqrt(h),_=o*Math.tan((f-Math.acos((g+h-v)/(2*y*m)))/2),b=_/m,w=_/y;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*c)+","+(t+b*l)),this._+="A"+o+","+o+",0,0,"+ +(l*d>c*p)+","+(this._x1=e+w*s)+","+(this._y1=t+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,r,n,o,i){e=+e,t=+t,i=!!i;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,l=1^i,h=i?n-o:o-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),r&&(h<0&&(h=h%d+d),h>p?this._+="A"+r+","+r+",0,1,"+l+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):h>1e-6&&(this._+="A"+r+","+r+",0,"+ +(h>=f)+","+l+","+(this._x1=e+r*Math.cos(o))+","+(this._y1=t+r*Math.sin(o))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var m=1e-12;function _(e){this._context=e}function b(e){return new _(e)}function w(e){return e[0]}function x(e){return e[1]}function E(){var e=w,t=x,r=y(!0),n=null,o=b,i=null;function a(a){var s,u,c,l=a.length,h=!1;for(null==n&&(i=o(c=v())),s=0;s<=l;++s)!(s<l&&r(u=a[s],s,a))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(u,s,a),+t(u,s,a));if(c)return i=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:y(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:y(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:y(!!e),a):r},a.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),a):o},a.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),a):n},a}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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)}}};var k=Array.prototype.slice;function D(e){return e.source}function S(e){return e.target}function C(e,t,r,n,o){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,o,n,o)}function A(){return function(e){var t=D,r=S,n=w,o=x,i=null;function a(){var a,s=k.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(i||(i=a=v()),e(i,+n.apply(this,(s[0]=u,s)),+o.apply(this,s),+n.apply(this,(s[0]=c,s)),+o.apply(this,s)),a)return i=null,a+""||null}return a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(e){return arguments.length?(r=e,a):r},a.x=function(e){return arguments.length?(n="function"==typeof e?e:y(+e),a):n},a.y=function(e){return arguments.length?(o="function"==typeof e?e:y(+e),a):o},a.context=function(e){return arguments.length?(i=null==e?null:e,a):i},a}(C)}function j(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 P(e){this._context=e}function F(e){return new P(e)}function M(e,t){this._basis=new P(e),this._beta=t}P.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:j(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},point: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:j(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},M.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,o=e[0],i=t[0],a=e[r]-o,s=t[r]-i,u=-1;++u<=r;)n=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(o+n*a),this._beta*t[u]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(e){return 1===t?new P(e):new M(e,t)}return r.beta=function(t){return e(+t)},r})(.85);function O(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 N(e,t){this._context=e,this._k=(1-t)/6}N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:O(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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:O(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}};var I=function e(t){function r(e){return new N(e,t)}return r.tension=function(t){return e(+t)},r}(0);function T(e,t){this._context=e,this._alpha=t}T.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(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;default:!function(e,t,r){var n=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>m){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,o=(o*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>m){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/l,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/l}e._context.bezierCurveTo(n,o,i,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(e){return t?new T(e,t):new N(e,0)}return r.alpha=function(t){return e(+t)},r})(.5);function L(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}L(".graph_Edge{fill:none;stroke:#656565;stroke-width:1px}.graph_Edge .common_TextBox .common_Text{fill:#000;stroke:none}.graph_Edge .common_TextBox .common_Shape{fill:#fff;stroke:none}.graph_Edge.selected{stroke:red!important}.graph_Edge.selected .common_Text{fill:red!important}");var Q=F,R=function(e){function r(){var r=e.call(this)||this;return r._points=[],r._weight=100,r._strokeDasharray=null,r._hidden=!1,r._textBox=(new t.TextBox).padding(0),r}return s(r,e),r.prototype.graphID=function(e){return arguments.length?(this._graphID=e,this):this._graphID},r.prototype.sourceVertex=function(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex},r.prototype.targetVertex=function(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex},r.prototype.weight=function(e){return arguments.length?(this._weight=e,this):this._weight},r.prototype.points=function(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points},r.prototype.hidden=function(e){return arguments.length?(this._hidden=e,this):this._hidden},r.prototype.text=function(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._elementPath=r.append("path"),this._textBox.text()&&this._textBox.target(t).tooltip(this.tooltip()).render()},r.prototype.update=function(r,n,o,i){e.prototype.update.call(this,r,n);var a=this;t.Platform.svgMarkerGlitch&&!i&&n.transition().duration((o||0)+100).on("start",function(){a._pushMarkers(n)}).on("end",function(){a._popMarkers(n)});var s=a._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),u=n.selectAll(".point2").data(this.showControlPoints()?s:[]);u.enter().append("circle").attr("class","point2").style("stroke","red").merge(u).attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}).attr("r",1),u.exit().remove();var c=E().x(function(e){return e.x}).y(function(e){return e.y}).curve(Q)(s),l=this._elementPath;o&&(l=l.transition().duration(o)),l.attr("opacity",this._hidden?0:1).attr("marker-start",t.Platform.svgMarkerGlitch&&i||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",t.Platform.svgMarkerGlitch&&i||!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",c),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(s),o)},r.prototype.exit=function(t,r){this._textBox&&this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype._findMidPoint=function(e){var t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){var 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}},r.prototype._calculateEdgePoints=function(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];var n=r?r.filter(function(r){return!e.contains(r)&&!t.contains(r)}):[],o=0===n.length?t.pos():n[0],i=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,o)),n.push(t.intersection(t._pos,i)),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]){var a=n[0].x-n[1].x,s=n[0].y-n[1].y;if(Math.sqrt(a*a+s*s))if(this.showArc()){var u=(n[0].x+n[1].x)/2-s*this.arcDepth()/100,c=(n[0].y+n[1].y)/2+a*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:u,y:c},{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},r}(t.SVGWidget);R.prototype._class+=" graph_Edge",R.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),R.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),R.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),R.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),R.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),R.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),R.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),R.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),R.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),R.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),R.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),R.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return V(null==t&&r.path)}},r.exports),r.exports}function V(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var G=function(){this.__data__=[],this.size=0};var H=function(e,t){return e===t||e!=e&&t!=t};var U=function(e,t){for(var r=e.length;r--;)if(H(e[r][0],t))return r;return-1},W=Array.prototype.splice;var q=function(e){var t=this.__data__,r=U(t,e);return!(r<0||(r==t.length-1?t.pop():W.call(t,r,1),--this.size,0))};var Y=function(e){var t=this.__data__,r=U(t,e);return r<0?void 0:t[r][1]};var $=function(e){return U(this.__data__,e)>-1};var X=function(e,t){var r=this.__data__,n=U(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function J(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])}}J.prototype.clear=G,J.prototype.delete=q,J.prototype.get=Y,J.prototype.has=$,J.prototype.set=X;var K=J;var Z=function(){this.__data__=new K,this.size=0};var ee=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var te=function(e){return this.__data__.get(e)};var re=function(e){return this.__data__.has(e)},ne="object"==typeof B&&B&&B.Object===Object&&B,oe="object"==typeof self&&self&&self.Object===Object&&self,ie=ne||oe||Function("return this")(),ae=ie.Symbol,se=Object.prototype,ue=se.hasOwnProperty,ce=se.toString,le=ae?ae.toStringTag:void 0;var he=function(e){var t=ue.call(e,le),r=e[le];try{e[le]=void 0;var n=!0}catch(e){}var o=ce.call(e);return n&&(t?e[le]=r:delete e[le]),o},fe=Object.prototype.toString;var de=function(e){return fe.call(e)},pe="[object Null]",ge="[object Undefined]",ve=ae?ae.toStringTag:void 0;var ye=function(e){return null==e?void 0===e?ge:pe:ve&&ve in Object(e)?he(e):de(e)};var me=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e="[object AsyncFunction]",be="[object Function]",we="[object GeneratorFunction]",xe="[object Proxy]";var Ee,ke=function(e){if(!me(e))return!1;var t=ye(e);return t==be||t==we||t==_e||t==xe},De=ie["__core-js_shared__"],Se=(Ee=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||""))?"Symbol(src)_1."+Ee:"";var Ce=function(e){return!!Se&&Se in e},Ae=Function.prototype.toString;var je=function(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Pe=/^\[object .+?Constructor\]$/,Fe=Function.prototype,Me=Object.prototype,Oe=Fe.toString,Ne=Me.hasOwnProperty,Ie=RegExp("^"+Oe.call(Ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Te=function(e){return!(!me(e)||Ce(e))&&(ke(e)?Ie:Pe).test(je(e))};var Le=function(e,t){return null==e?void 0:e[t]};var Qe=function(e,t){var r=Le(e,t);return Te(r)?r:void 0},Re=Qe(ie,"Map"),Be=Qe(Object,"create");var ze=function(){this.__data__=Be?Be(null):{},this.size=0};var Ve=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ge="__lodash_hash_undefined__",He=Object.prototype.hasOwnProperty;var Ue=function(e){var t=this.__data__;if(Be){var r=t[e];return r===Ge?void 0:r}return He.call(t,e)?t[e]:void 0},We=Object.prototype.hasOwnProperty;var qe=function(e){var t=this.__data__;return Be?void 0!==t[e]:We.call(t,e)},Ye="__lodash_hash_undefined__";var $e=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Be&&void 0===t?Ye:t,this};function Xe(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])}}Xe.prototype.clear=ze,Xe.prototype.delete=Ve,Xe.prototype.get=Ue,Xe.prototype.has=qe,Xe.prototype.set=$e;var Je=Xe;var Ke=function(){this.size=0,this.__data__={hash:new Je,map:new(Re||K),string:new Je}};var Ze=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var et=function(e,t){var r=e.__data__;return Ze(t)?r["string"==typeof t?"string":"hash"]:r.map};var tt=function(e){var t=et(this,e).delete(e);return this.size-=t?1:0,t};var rt=function(e){return et(this,e).get(e)};var nt=function(e){return et(this,e).has(e)};var ot=function(e,t){var r=et(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function it(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])}}it.prototype.clear=Ke,it.prototype.delete=tt,it.prototype.get=rt,it.prototype.has=nt,it.prototype.set=ot;var at=it,st=200;var ut=function(e,t){var r=this.__data__;if(r instanceof K){var n=r.__data__;if(!Re||n.length<st-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new at(n)}return r.set(e,t),this.size=r.size,this};function ct(e){var t=this.__data__=new K(e);this.size=t.size}ct.prototype.clear=Z,ct.prototype.delete=ee,ct.prototype.get=te,ct.prototype.has=re,ct.prototype.set=ut;var lt=ct;var ht=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e},ft=function(){try{var e=Qe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var dt=function(e,t,r){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},pt=Object.prototype.hasOwnProperty;var gt=function(e,t,r){var n=e[t];pt.call(e,t)&&H(n,r)&&(void 0!==r||t in e)||dt(e,t,r)};var vt=function(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),o?dt(r,s,u):gt(r,s,u)}return r};var yt=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var mt=function(e){return null!=e&&"object"==typeof e},_t="[object Arguments]";var bt=function(e){return mt(e)&&ye(e)==_t},wt=Object.prototype,xt=wt.hasOwnProperty,Et=wt.propertyIsEnumerable,kt=bt(function(){return arguments}())?bt:function(e){return mt(e)&&xt.call(e,"callee")&&!Et.call(e,"callee")},Dt=Array.isArray;var St=function(){return!1},Ct=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=(o?o.isBuffer:void 0)||St;e.exports=i}),At=9007199254740991,jt=/^(?:0|[1-9]\d*)$/;var Pt=function(e,t){var r=typeof e;return!!(t=null==t?At:t)&&("number"==r||"symbol"!=r&&jt.test(e))&&e>-1&&e%1==0&&e<t},Ft=9007199254740991;var Mt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ft},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var Nt=function(e){return mt(e)&&Mt(e.length)&&!!Ot[ye(e)]};var It=function(e){return function(t){return e(t)}},Tt=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&ne.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Lt=Tt&&Tt.isTypedArray,Qt=Lt?It(Lt):Nt,Rt=Object.prototype.hasOwnProperty;var Bt=function(e,t){var r=Dt(e),n=!r&&kt(e),o=!r&&!n&&Ct(e),i=!r&&!n&&!o&&Qt(e),a=r||n||o||i,s=a?yt(e.length,String):[],u=s.length;for(var c in e)!t&&!Rt.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Pt(c,u))||s.push(c);return s},zt=Object.prototype;var Vt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||zt)};var Gt=function(e,t){return function(r){return e(t(r))}},Ht=Gt(Object.keys,Object),Ut=Object.prototype.hasOwnProperty;var Wt=function(e){if(!Vt(e))return Ht(e);var t=[];for(var r in Object(e))Ut.call(e,r)&&"constructor"!=r&&t.push(r);return t};var qt=function(e){return null!=e&&Mt(e.length)&&!ke(e)};var Yt=function(e){return qt(e)?Bt(e):Wt(e)};var $t=function(e,t){return e&&vt(t,Yt(t),e)};var Xt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Jt=Object.prototype.hasOwnProperty;var Kt=function(e){if(!me(e))return Xt(e);var t=Vt(e),r=[];for(var n in e)("constructor"!=n||!t&&Jt.call(e,n))&&r.push(n);return r};var Zt=function(e){return qt(e)?Bt(e,!0):Kt(e)};var er=function(e,t){return e&&vt(t,Zt(t),e)},tr=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}});var rr=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var nr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i};var or=function(){return[]},ir=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,sr=ar?function(e){return null==e?[]:(e=Object(e),nr(ar(e),function(t){return ir.call(e,t)}))}:or;var ur=function(e,t){return vt(e,sr(e),t)};var cr=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},lr=Gt(Object.getPrototypeOf,Object),hr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)cr(t,sr(e)),e=lr(e);return t}:or;var fr=function(e,t){return vt(e,hr(e),t)};var dr=function(e,t,r){var n=t(e);return Dt(e)?n:cr(n,r(e))};var pr=function(e){return dr(e,Yt,sr)};var gr=function(e){return dr(e,Zt,hr)},vr=Qe(ie,"DataView"),yr=Qe(ie,"Promise"),mr=Qe(ie,"Set"),_r=Qe(ie,"WeakMap"),br=je(vr),wr=je(Re),xr=je(yr),Er=je(mr),kr=je(_r),Dr=ye;(vr&&"[object DataView]"!=Dr(new vr(new ArrayBuffer(1)))||Re&&"[object Map]"!=Dr(new Re)||yr&&"[object Promise]"!=Dr(yr.resolve())||mr&&"[object Set]"!=Dr(new mr)||_r&&"[object WeakMap]"!=Dr(new _r))&&(Dr=function(e){var t=ye(e),r="[object Object]"==t?e.constructor:void 0,n=r?je(r):"";if(n)switch(n){case br:return"[object DataView]";case wr:return"[object Map]";case xr:return"[object Promise]";case Er:return"[object Set]";case kr:return"[object WeakMap]"}return t});var Sr=Dr,Cr=Object.prototype.hasOwnProperty;var Ar=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Cr.call(e,"index")&&(r.index=e.index,r.input=e.input),r},jr=ie.Uint8Array;var Pr=function(e){var t=new e.constructor(e.byteLength);return new jr(t).set(new jr(e)),t};var Fr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Mr=/\w*$/;var Or=function(e){var t=new e.constructor(e.source,Mr.exec(e));return t.lastIndex=e.lastIndex,t},Nr=ae?ae.prototype:void 0,Ir=Nr?Nr.valueOf:void 0;var Tr=function(e){return Ir?Object(Ir.call(e)):{}};var Lr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Qr="[object Boolean]",Rr="[object Date]",Br="[object Map]",zr="[object Number]",Vr="[object RegExp]",Gr="[object Set]",Hr="[object String]",Ur="[object Symbol]",Wr="[object ArrayBuffer]",qr="[object DataView]",Yr="[object Float32Array]",$r="[object Float64Array]",Xr="[object Int8Array]",Jr="[object Int16Array]",Kr="[object Int32Array]",Zr="[object Uint8Array]",en="[object Uint8ClampedArray]",tn="[object Uint16Array]",rn="[object Uint32Array]";var nn=function(e,t,r){var n=e.constructor;switch(t){case Wr:return Pr(e);case Qr:case Rr:return new n(+e);case qr:return Fr(e,r);case Yr:case $r:case Xr:case Jr:case Kr:case Zr:case en:case tn:case rn:return Lr(e,r);case Br:return new n;case zr:case Hr:return new n(e);case Vr:return Or(e);case Gr:return new n;case Ur:return Tr(e)}},on=Object.create,an=function(){function e(){}return function(t){if(!me(t))return{};if(on)return on(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var sn=function(e){return"function"!=typeof e.constructor||Vt(e)?{}:an(lr(e))},un="[object Map]";var cn=function(e){return mt(e)&&Sr(e)==un},ln=Tt&&Tt.isMap,hn=ln?It(ln):cn,fn="[object Set]";var dn=function(e){return mt(e)&&Sr(e)==fn},pn=Tt&&Tt.isSet,gn=pn?It(pn):dn,vn=1,yn=2,mn=4,_n="[object Arguments]",bn="[object Function]",wn="[object GeneratorFunction]",xn="[object Object]",En={};En[_n]=En["[object Array]"]=En["[object ArrayBuffer]"]=En["[object DataView]"]=En["[object Boolean]"]=En["[object Date]"]=En["[object Float32Array]"]=En["[object Float64Array]"]=En["[object Int8Array]"]=En["[object Int16Array]"]=En["[object Int32Array]"]=En["[object Map]"]=En["[object Number]"]=En[xn]=En["[object RegExp]"]=En["[object Set]"]=En["[object String]"]=En["[object Symbol]"]=En["[object Uint8Array]"]=En["[object Uint8ClampedArray]"]=En["[object Uint16Array]"]=En["[object Uint32Array]"]=!0,En["[object Error]"]=En[bn]=En["[object WeakMap]"]=!1;var kn=function e(t,r,n,o,i,a){var s,u=r&vn,c=r&yn,l=r&mn;if(n&&(s=i?n(t,o,i,a):n(t)),void 0!==s)return s;if(!me(t))return t;var h=Dt(t);if(h){if(s=Ar(t),!u)return rr(t,s)}else{var f=Sr(t),d=f==bn||f==wn;if(Ct(t))return tr(t,u);if(f==xn||f==_n||d&&!i){if(s=c||d?{}:sn(t),!u)return c?fr(t,er(s,t)):ur(t,$t(s,t))}else{if(!En[f])return i?t:{};s=nn(t,f,u)}}a||(a=new lt);var p=a.get(t);if(p)return p;a.set(t,s),gn(t)?t.forEach(function(o){s.add(e(o,r,n,o,t,a))}):hn(t)&&t.forEach(function(o,i){s.set(i,e(o,r,n,i,t,a))});var g=h?void 0:(l?c?gr:pr:c?Zt:Yt)(t);return ht(g||t,function(o,i){g&&(o=t[i=o]),gt(s,i,e(o,r,n,i,t,a))}),s},Dn=4;var Sn=function(e){return kn(e,Dn)};var Cn=function(e){return function(){return e}};var An=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}();var jn=function(e,t){return e&&An(e,t,Yt)};var Pn=function(e,t){return function(r,n){if(null==r)return r;if(!qt(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(jn);var Fn=function(e){return e};var Mn=function(e){return"function"==typeof e?e:Fn};var On=function(e,t){return(Dt(e)?ht:Pn)(e,Mn(t))},Nn=On;var In=function(e,t){var r=[];return Pn(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r},Tn="__lodash_hash_undefined__";var Ln=function(e){return this.__data__.set(e,Tn),this};var Qn=function(e){return this.__data__.has(e)};function Rn(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new at;++t<r;)this.add(e[t])}Rn.prototype.add=Rn.prototype.push=Ln,Rn.prototype.has=Qn;var Bn=Rn;var zn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var Vn=function(e,t){return e.has(t)},Gn=1,Hn=2;var Un=function(e,t,r,n,o,i){var a=r&Gn,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var h=-1,f=!0,d=r&Hn?new Bn:void 0;for(i.set(e,t),i.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var v=a?n(g,p,h,t,e,i):n(p,g,h,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!zn(t,function(e,t){if(!Vn(d,t)&&(p===e||o(p,e,r,n,i)))return d.push(t)})){f=!1;break}}else if(p!==g&&!o(p,g,r,n,i)){f=!1;break}}return i.delete(e),i.delete(t),f};var Wn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var qn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Yn=1,$n=2,Xn="[object Boolean]",Jn="[object Date]",Kn="[object Error]",Zn="[object Map]",eo="[object Number]",to="[object RegExp]",ro="[object Set]",no="[object String]",oo="[object Symbol]",io="[object ArrayBuffer]",ao="[object DataView]",so=ae?ae.prototype:void 0,uo=so?so.valueOf:void 0;var co=function(e,t,r,n,o,i,a){switch(r){case ao:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case io:return!(e.byteLength!=t.byteLength||!i(new jr(e),new jr(t)));case Xn:case Jn:case eo:return H(+e,+t);case Kn:return e.name==t.name&&e.message==t.message;case to:case no:return e==t+"";case Zn:var s=Wn;case ro:var u=n&Yn;if(s||(s=qn),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=$n,a.set(e,t);var l=Un(s(e),s(t),n,o,i,a);return a.delete(e),l;case oo:if(uo)return uo.call(e)==uo.call(t)}return!1},lo=1,ho=Object.prototype.hasOwnProperty;var fo=function(e,t,r,n,o,i){var a=r&lo,s=pr(e),u=s.length;if(u!=pr(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:ho.call(t,l)))return!1}var h=i.get(e),f=i.get(t);if(h&&f)return h==t&&f==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=a;++c<u;){var g=e[l=s[c]],v=t[l];if(n)var y=a?n(v,g,l,t,e,i):n(g,v,l,e,t,i);if(!(void 0===y?g===v||o(g,v,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var m=e.constructor,_=t.constructor;m!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return i.delete(e),i.delete(t),d},po=1,go="[object Arguments]",vo="[object Array]",yo="[object Object]",mo=Object.prototype.hasOwnProperty;var _o=function(e,t,r,n,o,i){var a=Dt(e),s=Dt(t),u=a?vo:Sr(e),c=s?vo:Sr(t),l=(u=u==go?yo:u)==yo,h=(c=c==go?yo:c)==yo,f=u==c;if(f&&Ct(e)){if(!Ct(t))return!1;a=!0,l=!1}if(f&&!l)return i||(i=new lt),a||Qt(e)?Un(e,t,r,n,o,i):co(e,t,u,r,n,o,i);if(!(r&po)){var d=l&&mo.call(e,"__wrapped__"),p=h&&mo.call(t,"__wrapped__");if(d||p){var g=d?e.value():e,v=p?t.value():t;return i||(i=new lt),o(g,v,r,n,i)}}return!!f&&(i||(i=new lt),fo(e,t,r,n,o,i))};var bo=function e(t,r,n,o,i){return t===r||(null==t||null==r||!mt(t)&&!mt(r)?t!=t&&r!=r:_o(t,r,n,o,e,i))},wo=1,xo=2;var Eo=function(e,t,r,n){var o=r.length,i=o,a=!n;if(null==e)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var u=(s=r[o])[0],c=e[u],l=s[1];if(a&&s[2]){if(void 0===c&&!(u in e))return!1}else{var h=new lt;if(n)var f=n(c,l,u,e,t,h);if(!(void 0===f?bo(l,c,wo|xo,n,h):f))return!1}}return!0};var ko=function(e){return e==e&&!me(e)};var Do=function(e){for(var t=Yt(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,ko(o)]}return t};var So=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Co=function(e){var t=Do(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||Eo(r,e,t)}},Ao="[object Symbol]";var jo=function(e){return"symbol"==typeof e||mt(e)&&ye(e)==Ao},Po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fo=/^\w*$/;var Mo=function(e,t){if(Dt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!jo(e))||Fo.test(e)||!Po.test(e)||null!=t&&e in Object(t)},Oo="Expected a function";function No(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Oo);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(No.Cache||at),r}No.Cache=at;var Io=No,To=500;var Lo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qo=/\\(\\)?/g,Ro=function(e){var t=Io(e,function(e){return r.size===To&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Lo,function(e,r,n,o){t.push(n?o.replace(Qo,"$1"):r||e)}),t});var Bo=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},zo=1/0,Vo=ae?ae.prototype:void 0,Go=Vo?Vo.toString:void 0;var Ho=function e(t){if("string"==typeof t)return t;if(Dt(t))return Bo(t,e)+"";if(jo(t))return Go?Go.call(t):"";var r=t+"";return"0"==r&&1/t==-zo?"-0":r};var Uo=function(e){return null==e?"":Ho(e)};var Wo=function(e,t){return Dt(e)?e:Mo(e,t)?[e]:Ro(Uo(e))},qo=1/0;var Yo=function(e){if("string"==typeof e||jo(e))return e;var t=e+"";return"0"==t&&1/e==-qo?"-0":t};var $o=function(e,t){for(var r=0,n=(t=Wo(t,e)).length;null!=e&&r<n;)e=e[Yo(t[r++])];return r&&r==n?e:void 0};var Xo=function(e,t,r){var n=null==e?void 0:$o(e,t);return void 0===n?r:n};var Jo=function(e,t){return null!=e&&t in Object(e)};var Ko=function(e,t,r){for(var n=-1,o=(t=Wo(t,e)).length,i=!1;++n<o;){var a=Yo(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&Mt(o)&&Pt(a,o)&&(Dt(e)||kt(e))};var Zo=function(e,t){return null!=e&&Ko(e,t,Jo)},ei=1,ti=2;var ri=function(e,t){return Mo(e)&&ko(t)?So(Yo(e),t):function(r){var n=Xo(r,e);return void 0===n&&n===t?Zo(r,e):bo(t,n,ei|ti)}};var ni=function(e){return function(t){return null==t?void 0:t[e]}};var oi=function(e){return function(t){return $o(t,e)}};var ii=function(e){return Mo(e)?ni(Yo(e)):oi(e)};var ai=function(e){return"function"==typeof e?e:null==e?Fn:"object"==typeof e?Dt(e)?ri(e[0],e[1]):Co(e):ii(e)};var si=function(e,t){return(Dt(e)?nr:In)(e,ai(t))},ui=Object.prototype.hasOwnProperty;var ci=function(e,t){return null!=e&&ui.call(e,t)};var li=function(e,t){return null!=e&&Ko(e,t,ci)},hi="[object Map]",fi="[object Set]",di=Object.prototype.hasOwnProperty;var pi=function(e){if(null==e)return!0;if(qt(e)&&(Dt(e)||"string"==typeof e||"function"==typeof e.splice||Ct(e)||Qt(e)||kt(e)))return!e.length;var t=Sr(e);if(t==hi||t==fi)return!e.size;if(Vt(e))return!Wt(e).length;for(var r in e)if(di.call(e,r))return!1;return!0};var gi=function(e){return void 0===e};var vi=function(e,t){var r=-1,n=qt(e)?Array(e.length):[];return Pn(e,function(e,o,i){n[++r]=t(e,o,i)}),n};var yi=function(e,t){return(Dt(e)?Bo:vi)(e,ai(t))};var mi=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r};var _i=function(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r};var bi=function(e,t,r){var n=Dt(e)?mi:_i,o=arguments.length<3;return n(e,ai(t),r,o,Pn)},wi="[object String]";var xi=function(e){return"string"==typeof e||!Dt(e)&&mt(e)&&ye(e)==wi},Ei=ni("length"),ki=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Di=function(e){return ki.test(e)},Si="[\\ud800-\\udfff]",Ci="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ai="\\ud83c[\\udffb-\\udfff]",ji="[^\\ud800-\\udfff]",Pi="(?:\\ud83c[\\udde6-\\uddff]){2}",Fi="[\\ud800-\\udbff][\\udc00-\\udfff]",Mi="(?:"+Ci+"|"+Ai+")"+"?",Oi="[\\ufe0e\\ufe0f]?"+Mi+("(?:\\u200d(?:"+[ji,Pi,Fi].join("|")+")[\\ufe0e\\ufe0f]?"+Mi+")*"),Ni="(?:"+[ji+Ci+"?",Ci,Pi,Fi,Si].join("|")+")",Ii=RegExp(Ai+"(?="+Ai+")|"+Ni+Oi,"g");var Ti=function(e){for(var t=Ii.lastIndex=0;Ii.test(e);)++t;return t};var Li=function(e){return Di(e)?Ti(e):Ei(e)},Qi="[object Map]",Ri="[object Set]";var Bi=function(e){if(null==e)return 0;if(qt(e))return xi(e)?Li(e):e.length;var t=Sr(e);return t==Qi||t==Ri?e.size:Wt(e).length};var zi=function(e,t,r){var n=Dt(e),o=n||Ct(e)||Qt(e);if(t=ai(t),null==r){var i=e&&e.constructor;r=o?n?new i:[]:me(e)&&ke(i)?an(lr(e)):{}}return(o?ht:jn)(e,function(e,n,o){return t(r,e,n,o)}),r},Vi=ae?ae.isConcatSpreadable:void 0;var Gi=function(e){return Dt(e)||kt(e)||!!(Vi&&e&&e[Vi])};var Hi=function e(t,r,n,o,i){var a=-1,s=t.length;for(n||(n=Gi),i||(i=[]);++a<s;){var u=t[a];r>0&&n(u)?r>1?e(u,r-1,n,o,i):cr(i,u):o||(i[i.length]=u)}return i};var Ui=function(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)},Wi=Math.max;var qi=function(e,t,r){return t=Wi(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Wi(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),Ui(e,this,s)}},Yi=ft?function(e,t){return ft(e,"toString",{configurable:!0,enumerable:!1,value:Cn(t),writable:!0})}:Fn,$i=800,Xi=16,Ji=Date.now;var Ki=function(e){var t=0,r=0;return function(){var n=Ji(),o=Xi-(n-r);if(r=n,o>0){if(++t>=$i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Yi);var Zi=function(e,t){return Ki(qi(e,t,Fn),e+"")};var ea=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1};var ta=function(e){return e!=e};var ra=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1};var na=function(e,t,r){return t==t?ra(e,t,r):ea(e,ta,r)};var oa=function(e,t){return!(null==e||!e.length)&&na(e,t,0)>-1};var ia=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1};var aa=function(){},sa=mr&&1/qn(new mr([,-0]))[1]==1/0?function(e){return new mr(e)}:aa,ua=200;var ca=function(e,t,r){var n=-1,o=oa,i=e.length,a=!0,s=[],u=s;if(r)a=!1,o=ia;else if(i>=ua){var c=t?null:sa(e);if(c)return qn(c);a=!1,o=Vn,u=new Bn}else u=t?[]:s;e:for(;++n<i;){var l=e[n],h=t?t(l):l;if(l=r||0!==l?l:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),s.push(l)}else o(u,h,r)||(u!==s&&u.push(h),s.push(l))}return s};var la=function(e){return mt(e)&&qt(e)},ha=Zi(function(e){return ca(Hi(e,1,la,!0))});var fa=function(e,t){return Bo(t,function(t){return e[t]})};var da,pa=function(e){return null==e?[]:fa(e,Yt(e))};try{da={clone:Sn,constant:Cn,each:Nn,filter:si,has:li,isArray:Dt,isEmpty:pi,isFunction:ke,isUndefined:gi,keys:Yt,map:yi,reduce:bi,size:Bi,transform:zi,union:ha,values:pa}}catch(e){}da||(da=window._);var ga=da,va=ba,ya="\0",ma="\0",_a="";function ba(e){this._isDirected=!ga.has(e,"directed")||e.directed,this._isMultigraph=!!ga.has(e,"multigraph")&&e.multigraph,this._isCompound=!!ga.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=ga.constant(void 0),this._defaultEdgeLabelFn=ga.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[ma]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function wa(e,t){e[t]?e[t]++:e[t]=1}function xa(e,t){--e[t]||delete e[t]}function Ea(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+_a+i+_a+(ga.isUndefined(n)?ya:n)}function ka(e,t){return Ea(e,t.v,t.w,t.name)}ba.prototype._nodeCount=0,ba.prototype._edgeCount=0,ba.prototype.isDirected=function(){return this._isDirected},ba.prototype.isMultigraph=function(){return this._isMultigraph},ba.prototype.isCompound=function(){return this._isCompound},ba.prototype.setGraph=function(e){return this._label=e,this},ba.prototype.graph=function(){return this._label},ba.prototype.setDefaultNodeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultNodeLabelFn=e,this},ba.prototype.nodeCount=function(){return this._nodeCount},ba.prototype.nodes=function(){return ga.keys(this._nodes)},ba.prototype.sources=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._in[t])})},ba.prototype.sinks=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._out[t])})},ba.prototype.setNodes=function(e,t){var r=arguments,n=this;return ga.each(e,function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this},ba.prototype.setNode=function(e,t){return ga.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=ma,this._children[e]={},this._children[ma][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},ba.prototype.node=function(e){return this._nodes[e]},ba.prototype.hasNode=function(e){return ga.has(this._nodes,e)},ba.prototype.removeNode=function(e){var t=this;if(ga.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ga.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),ga.each(ga.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],ga.each(ga.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},ba.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ga.isUndefined(t))t=ma;else{for(var r=t+="";!ga.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},ba.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},ba.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==ma)return t}},ba.prototype.children=function(e){if(ga.isUndefined(e)&&(e=ma),this._isCompound){var t=this._children[e];if(t)return ga.keys(t)}else{if(e===ma)return this.nodes();if(this.hasNode(e))return[]}},ba.prototype.predecessors=function(e){var t=this._preds[e];if(t)return ga.keys(t)},ba.prototype.successors=function(e){var t=this._sucs[e];if(t)return ga.keys(t)},ba.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return ga.union(t,this.successors(e))},ba.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},ba.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;ga.each(this._nodes,function(r,n){e(n)&&t.setNode(n,r)}),ga.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&ga.each(t.nodes(),function(e){t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))}),t},ba.prototype.setDefaultEdgeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultEdgeLabelFn=e,this},ba.prototype.edgeCount=function(){return this._edgeCount},ba.prototype.edges=function(){return ga.values(this._edgeObjs)},ba.prototype.setPath=function(e,t){var r=this,n=arguments;return ga.reduce(e,function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this},ba.prototype.setEdge=function(){var e,t,r,n,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,r=i.name,2===arguments.length&&(n=arguments[1],o=!0)):(e=i,t=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),e=""+e,t=""+t,ga.isUndefined(r)||(r=""+r);var a=Ea(this._isDirected,e,t,r);if(ga.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=n),this;if(!ga.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[a]=o?n:this._defaultEdgeLabelFn(e,t,r);var s=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};n&&(s.name=n);return s}(this._isDirected,e,t,r);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[a]=s,wa(this._preds[t],e),wa(this._sucs[e],t),this._in[t][a]=s,this._out[e][a]=s,this._edgeCount++,this},ba.prototype.edge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return this._edgeLabels[n]},ba.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return ga.has(this._edgeLabels,n)},ba.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r),o=this._edgeObjs[n];return o&&(e=o.v,t=o.w,delete this._edgeLabels[n],delete this._edgeObjs[n],xa(this._preds[t],e),xa(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},ba.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.v===t}):n}},ba.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.w===t}):n}},ba.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))};var Da={Graph:va,version:"2.1.8"},Sa={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ca(e),edges:Aa(e)};ga.isUndefined(e.graph())||(t.value=ga.clone(e.graph()));return t},read:function(e){var t=new va(e.options).setGraph(e.value);return ga.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),ga.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}};function Ca(e){return ga.map(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),o={v:t};return ga.isUndefined(r)||(o.value=r),ga.isUndefined(n)||(o.parent=n),o})}function Aa(e){return ga.map(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return ga.isUndefined(t.name)||(n.name=t.name),ga.isUndefined(r)||(n.value=r),n})}var ja=function(e){var t,r={},n=[];function o(n){ga.has(r,n)||(r[n]=!0,t.push(n),ga.each(e.successors(n),o),ga.each(e.predecessors(n),o))}return ga.each(e.nodes(),function(e){t=[],o(e),t.length&&n.push(t)}),n};var Pa=Fa;function Fa(){this._arr=[],this._keyIndices={}}Fa.prototype.size=function(){return this._arr.length},Fa.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Fa.prototype.has=function(e){return ga.has(this._keyIndices,e)},Fa.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},Fa.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Fa.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!ga.has(r,e)){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1},Fa.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},Fa.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)},Fa.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Fa.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},Fa.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t};var Ma=function(e,t,r,n){return function(e,t,r,n){var o,i,a={},s=new Pa,u=function(e){var t=e.v!==o?e.v:e.w,n=a[t],u=r(e),c=i.distance+u;if(u<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+u);c<n.distance&&(n.distance=c,n.predecessor=o,s.decrease(t,c))};e.nodes().forEach(function(e){var r=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:r},s.add(e,r)});for(;s.size()>0&&(o=s.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)n(o).forEach(u);return a}(e,String(t),r||Oa,n||function(t){return e.outEdges(t)})},Oa=ga.constant(1);var Na=function(e,t,r){return ga.transform(e.nodes(),function(n,o){n[o]=Ma(e,o,t,r)},{})};var Ia=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){ga.has(n,i)||function i(a){var s=n[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach(function(e){ga.has(n,e)?n[e].onStack&&(s.lowlink=Math.min(s.lowlink,n[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,n[e].lowlink))}),s.lowlink===s.index){var u,c=[];do{u=r.pop(),n[u].onStack=!1,c.push(u)}while(a!==u);o.push(c)}}(i)}),o};var Ta=function(e){return ga.filter(Ia(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})};var La=function(e,t,r){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],a=i[r],s=n.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)})})}),n}(e,t||Qa,r||function(t){return e.outEdges(t)})},Qa=ga.constant(1);var Ra=Ba;function Ba(e){var t={},r={},n=[];if(ga.each(e.sinks(),function o(i){if(ga.has(r,i))throw new za;ga.has(t,i)||(r[i]=!0,t[i]=!0,ga.each(e.predecessors(i),o),delete r[i],n.push(i))}),ga.size(t)!==e.nodeCount())throw new za;return n}function za(){}Ba.CycleException=za,za.prototype=new Error;var Va=function(e,t,r){ga.isArray(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return ga.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);!function e(t,r,n,o,i,a){ga.has(o,r)||(o[r]=!0,n||a.push(r),ga.each(i(r),function(r){e(t,r,n,o,i,a)}),n&&a.push(r))}(e,t,"post"===r,i,n,o)}),o};var Ga,Ha={Graph:Da.Graph,json:Sa,alg:{components:ja,dijkstra:Ma,dijkstraAll:Na,findCycles:Ta,floydWarshall:La,isAcyclic:function(e){try{Ra(e)}catch(e){if(e instanceof Ra.CycleException)return!1;throw e}return!0},postorder:function(e,t){return Va(e,t,"post")},preorder:function(e,t){return Va(e,t,"pre")},prim:function(e,t){var r,n=new va,o={},i=new Pa;function a(e){var n=e.v===r?e.w:e.v,a=i.priority(n);if(void 0!==a){var s=t(e);s<a&&(o[n]=r,i.decrease(n,s))}}if(0===e.nodeCount())return n;ga.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),n.setNode(e)}),i.decrease(e.nodes()[0],0);var s=!1;for(;i.size()>0;){if(r=i.removeMin(),ga.has(o,r))n.setEdge(r,o[r]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(r).forEach(a)}return n},tarjan:Ia,topsort:Ra},version:Da.version};try{Ga=Ha}catch(e){}Ga||(Ga=window.graphlib);var Ua=Ga,Wa=1,qa=4;var Ya=function(e){return kn(e,Wa|qa)};var $a=function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?qt(r)&&Pt(t,r.length):"string"==n&&t in r)&&H(r[t],e)},Xa=Object.prototype,Ja=Xa.hasOwnProperty,Ka=Zi(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&$a(t[0],t[1],o)&&(n=1);++r<n;)for(var i=t[r],a=Zt(i),s=-1,u=a.length;++s<u;){var c=a[s],l=e[c];(void 0===l||H(l,Xa[c])&&!Ja.call(e,c))&&(e[c]=i[c])}return e});var Za=function(e){return function(t,r,n){var o=Object(t);if(!qt(t)){var i=ai(r);t=Yt(t),r=function(e){return i(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[i?t[a]:a]:void 0}},es=/\s/;var ts=function(e){for(var t=e.length;t--&&es.test(e.charAt(t)););return t},rs=/^\s+/;var ns=function(e){return e?e.slice(0,ts(e)+1).replace(rs,""):e},os=NaN,is=/^[-+]0x[0-9a-f]+$/i,as=/^0b[01]+$/i,ss=/^0o[0-7]+$/i,us=parseInt;var cs=function(e){if("number"==typeof e)return e;if(jo(e))return os;if(me(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=me(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ns(e);var r=as.test(e);return r||ss.test(e)?us(e.slice(2),r?2:8):is.test(e)?os:+e},ls=1/0,hs=1.7976931348623157e308;var fs=function(e){return e?(e=cs(e))===ls||e===-ls?(e<0?-1:1)*hs:e==e?e:0:0===e?e:0};var ds=function(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0},ps=Math.max;var gs=Za(function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ds(r);return o<0&&(o=ps(n+o,0)),ea(e,ai(t),o)});var vs=function(e){return null!=e&&e.length?Hi(e,1):[]};var ys=function(e,t){return null==e?e:An(e,Mn(t),Zt)};var ms=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var _s=function(e,t){var r={};return t=ai(t),jn(e,function(e,n,o){dt(r,n,t(e,n,o))}),r};var bs=function(e,t,r){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(null!=a&&(void 0===s?a==a&&!jo(a):r(a,s)))var s=a,u=i}return u};var ws=function(e,t){return e>t};var xs=function(e){return e&&e.length?bs(e,Fn,ws):void 0};var Es=function(e,t,r){(void 0===r||H(e[t],r))&&(void 0!==r||t in e)||dt(e,t,r)},ks="[object Object]",Ds=Function.prototype,Ss=Object.prototype,Cs=Ds.toString,As=Ss.hasOwnProperty,js=Cs.call(Object);var Ps=function(e){if(!mt(e)||ye(e)!=ks)return!1;var t=lr(e);if(null===t)return!0;var r=As.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Cs.call(r)==js};var Fs=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Ms=function(e){return vt(e,Zt(e))};var Os=function(e,t,r,n,o,i,a){var s=Fs(e,r),u=Fs(t,r),c=a.get(u);if(c)Es(e,r,c);else{var l=i?i(s,u,r+"",e,t,a):void 0,h=void 0===l;if(h){var f=Dt(u),d=!f&&Ct(u),p=!f&&!d&&Qt(u);l=u,f||d||p?Dt(s)?l=s:la(s)?l=rr(s):d?(h=!1,l=tr(u,!0)):p?(h=!1,l=Lr(u,!0)):l=[]:Ps(u)||kt(u)?(l=s,kt(s)?l=Ms(s):me(s)&&!ke(s)||(l=sn(u))):h=!1}h&&(a.set(u,l),o(l,u,n,i,a),a.delete(u)),Es(e,r,l)}};var Ns=function e(t,r,n,o,i){t!==r&&An(r,function(a,s){if(i||(i=new lt),me(a))Os(t,r,s,n,e,o,i);else{var u=o?o(Fs(t,s),a,s+"",t,r,i):void 0;void 0===u&&(u=a),Es(t,s,u)}},Zt)};var Is=function(e){return Zi(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&$a(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t})}(function(e,t,r){Ns(e,t,r)});var Ts=function(e,t){return e<t};var Ls=function(e){return e&&e.length?bs(e,Fn,Ts):void 0};var Qs=function(e,t){return e&&e.length?bs(e,ai(t),Ts):void 0},Rs=function(){return ie.Date.now()};var Bs=function(e,t,r,n){if(!me(e))return e;for(var o=-1,i=(t=Wo(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var u=Yo(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var l=s[u];void 0===(c=n?n(l,u,s):void 0)&&(c=me(l)?l:Pt(t[o+1])?[]:{})}gt(s,u,c),s=s[u]}return e};var zs=function(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=$o(e,a);r(s,a)&&Bs(i,Wo(a,e),s)}return i};var Vs=function(e,t){return zs(e,t,function(t,r){return Zo(e,r)})};var Gs=function(e){return Ki(qi(e,void 0,vs),e+"")}(function(e,t){return null==e?{}:Vs(e,t)}),Hs=Math.ceil,Us=Math.max;var Ws=function(e,t,r,n){for(var o=-1,i=Us(Hs((t-e)/(r||1)),0),a=Array(i);i--;)a[n?i:++o]=e,e+=r;return a};var qs=function(e){return function(t,r,n){return n&&"number"!=typeof n&&$a(t,r,n)&&(r=n=void 0),t=fs(t),void 0===r?(r=t,t=0):r=fs(r),n=void 0===n?t<r?1:-1:fs(n),Ws(t,r,n,e)}}();var Ys=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e};var $s=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,o=e==e,i=jo(e),a=void 0!==t,s=null===t,u=t==t,c=jo(t);if(!s&&!c&&!i&&e>t||i&&a&&u&&!s&&!c||n&&a&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&e<t||c&&r&&o&&!n&&!i||s&&r&&o||!a&&o||!u)return-1}return 0};var Xs=function(e,t,r){for(var n=-1,o=e.criteria,i=t.criteria,a=o.length,s=r.length;++n<a;){var u=$s(o[n],i[n]);if(u)return n>=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index};var Js=function(e,t,r){t=t.length?Bo(t,function(e){return Dt(e)?function(t){return $o(t,1===e.length?e[0]:e)}:e}):[Fn];var n=-1;t=Bo(t,It(ai));var o=vi(e,function(e,r,o){return{criteria:Bo(t,function(t){return t(e)}),index:++n,value:e}});return Ys(o,function(e,t){return Xs(e,t,r)})},Ks=Zi(function(e,t){if(null==e)return[];var r=t.length;return r>1&&$a(e,t[0],t[1])?t=[]:r>2&&$a(t[0],t[1],t[2])&&(t=[t[0]]),Js(e,Hi(t,1),[])}),Zs=0;var eu=function(e){var t=++Zs;return Uo(e)+t};var tu=function(e,t,r){for(var n=-1,o=e.length,i=t.length,a={};++n<o;){var s=n<i?t[n]:void 0;r(a,e[n],s)}return a};var ru,nu=function(e,t){return tu(e||[],t||[],gt)};try{ru={cloneDeep:Ya,constant:Cn,defaults:Ka,each:Nn,filter:si,find:gs,flatten:vs,forEach:On,forIn:ys,has:li,isUndefined:gi,last:ms,map:yi,mapValues:_s,max:xs,merge:Is,min:Ls,minBy:Qs,now:Rs,pick:Gs,range:qs,reduce:bi,sortBy:Ks,uniqueId:eu,values:pa,zipObject:nu}}catch(e){}ru||(ru=window._);var ou=ru,iu=au;function au(){var e={};e._next=e._prev=e,this._sentinel=e}function su(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function uu(e,t){if("_next"!==e&&"_prev"!==e)return t}au.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return su(t),t},au.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&su(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},au.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,uu)),r=r._prev;return"["+e.join(", ")+"]"};var cu=Ua.Graph,lu=function(e,t){if(e.nodeCount()<=1)return[];var r=function(e,t){var r=new cu,n=0,o=0;ou.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),ou.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=t(e),s=i+a;r.setEdge(e.v,e.w,s),o=Math.max(o,r.node(e.v).out+=a),n=Math.max(n,r.node(e.w).in+=a)});var i=ou.range(o+n+3).map(function(){return new iu}),a=n+1;return ou.forEach(r.nodes(),function(e){du(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,t||hu),n=function(e,t,r){var n,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;n=a.dequeue();)fu(e,t,r,n);for(;n=i.dequeue();)fu(e,t,r,n);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(n=t[s].dequeue()){o=o.concat(fu(e,t,r,n,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return ou.flatten(ou.map(n,function(t){return e.outEdges(t.v,t.w)}),!0)},hu=ou.constant(1);function fu(e,t,r,n,o){var i=o?[]:void 0;return ou.forEach(e.inEdges(n.v),function(n){var a=e.edge(n),s=e.node(n.v);o&&i.push({v:n.v,w:n.w}),s.out-=a,du(t,r,s)}),ou.forEach(e.outEdges(n.v),function(n){var o=e.edge(n),i=n.w,a=e.node(i);a.in-=o,du(t,r,a)}),e.removeNode(n.v),i}function du(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)}var pu={run:function(e){var t="greedy"===e.graph().acyclicer?lu(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],r={},n={};return ou.forEach(e.nodes(),function o(i){ou.has(n,i)||(n[i]=!0,r[i]=!0,ou.forEach(e.outEdges(i),function(e){ou.has(r,e.w)?t.push(e):o(e.w)}),delete r[i])}),t}(e);ou.forEach(t,function(t){var r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,ou.uniqueId("rev"))})},undo:function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}};var gu=Ua.Graph,vu={addDummyNode:yu,simplify:function(e){var t=(new gu).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new gu({multigraph:e.isMultigraph()}).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t},successorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.outEdges(t),function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.inEdges(t),function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},intersectRect:function(e,t){var r,n,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");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);return{x:o+r,y:i+n}},buildLayerMatrix:function(e){var t=ou.map(ou.range(mu(e)+1),function(){return[]});return ou.forEach(e.nodes(),function(r){var n=e.node(r),o=n.rank;ou.isUndefined(o)||(t[o][n.order]=r)}),t},normalizeRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank}));ou.forEach(e.nodes(),function(r){var n=e.node(r);ou.has(n,"rank")&&(n.rank-=t)})},removeEmptyRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank})),r=[];ou.forEach(e.nodes(),function(n){var o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});var n=0,o=e.graph().nodeRankFactor;ou.forEach(r,function(t,r){ou.isUndefined(t)&&r%o!=0?--n:n&&ou.forEach(t,function(t){e.node(t).rank+=n})})},addBorderNode:function(e,t,r,n){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=n);return yu(e,"border",o,t)},maxRank:mu,partition:function(e,t){var r={lhs:[],rhs:[]};return ou.forEach(e,function(e){t(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,t){var r=ou.now();try{return t()}finally{console.log(e+" time: "+(ou.now()-r)+"ms")}},notime:function(e,t){return t()}};function yu(e,t,r,n){var o;do{o=ou.uniqueId(n)}while(e.hasNode(o));return r.dummy=t,e.setNode(o,r),o}function mu(e){return ou.max(ou.map(e.nodes(),function(t){var r=e.node(t).rank;if(!ou.isUndefined(r))return r}))}var _u={run:function(e){e.graph().dummyChains=[],ou.forEach(e.edges(),function(t){!function(e,t){var r,n,o,i=t.v,a=e.node(i).rank,s=t.w,u=e.node(s).rank,c=t.name,l=e.edge(t),h=l.labelRank;if(u===a+1)return;for(e.removeEdge(t),o=0,++a;a<u;++o,++a)l.points=[],n={width:0,height:0,edgeLabel:l,edgeObj:t,rank:a},r=vu.addDummyNode(e,"edge",n,"_d"),a===h&&(n.width=l.width,n.height=l.height,n.dummy="edge-label",n.labelpos=l.labelpos),e.setEdge(i,r,{weight:l.weight},c),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,s,{weight:l.weight},c)}(e,t)})},undo:function(e){ou.forEach(e.graph().dummyChains,function(t){var r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}};var bu=function(e){var t={};ou.forEach(e.sources(),function r(n){var o=e.node(n);if(ou.has(t,n))return o.rank;t[n]=!0;var i=ou.min(ou.map(e.outEdges(n),function(t){return r(t.w)-e.edge(t).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},wu=function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen};var xu=Ua.Graph,Eu=wu,ku=function(e){var t,r,n=new xu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();n.setNode(o,{});for(;Du(n,e)<i;)t=Su(n,e),r=n.hasNode(t.v)?Eu(e,t):-Eu(e,t),Cu(n,e,r);return n};function Du(e,t){return ou.forEach(e.nodes(),function r(n){ou.forEach(t.nodeEdges(n),function(o){var i=o.v,a=n===i?o.w:i;e.hasNode(a)||Eu(t,o)||(e.setNode(a,{}),e.setEdge(n,a,{}),r(a))})}),e.nodeCount()}function Su(e,t){return ou.minBy(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Eu(t,r)})}function Cu(e,t,r){ou.forEach(e.nodes(),function(e){t.node(e).rank+=r})}var Au=wu,ju=bu,Pu=Ua.alg.preorder,Fu=Ua.alg.postorder,Mu=vu.simplify,Ou=Nu;function Nu(e){e=Mu(e),ju(e);var t,r=ku(e);for(Lu(r),Iu(r,e);t=Qu(r);)Bu(r,e,t,Ru(r,e,t))}function Iu(e,t){var r=Fu(e,e.nodes());r=r.slice(0,r.length-1),ou.forEach(r,function(r){!function(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=Tu(e,t,r)}(e,t,r)})}function Tu(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),a=0;return i||(o=!1,i=t.edge(n,r)),a=i.weight,ou.forEach(t.nodeEdges(r),function(i){var s=i.v===r,u=s?i.w:i.v;if(u!==n){var c=s===o,l=t.edge(i).weight;if(a+=c?l:-l,function(e,t,r){return e.hasEdge(t,r)}(e,r,u)){var h=e.edge(r,u).cutvalue;a+=c?-h:h}}}),a}function Lu(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var a=n;var s=t.node(o);r[o]=!0;ou.forEach(t.neighbors(o),function(i){ou.has(r,i)||(n=e(t,r,n,i,o))});s.low=a;s.lim=n++;i?s.parent=i:delete s.parent;return n}(e,{},1,t)}function Qu(e){return ou.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Ru(e,t,r){var n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);var i=e.node(n),a=e.node(o),s=i,u=!1;i.lim>a.lim&&(s=a,u=!0);var c=ou.filter(t.edges(),function(t){return u===zu(e,e.node(t.v),s)&&u!==zu(e,e.node(t.w),s)});return ou.minBy(c,function(e){return Au(t,e)})}function Bu(e,t,r,n){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(n.v,n.w,{}),Lu(e),Iu(e,t),function(e,t){var r=ou.find(e.nodes(),function(e){return!t.node(e).parent}),n=Pu(e,r);n=n.slice(1),ou.forEach(n,function(r){var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function zu(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}Nu.initLowLimValues=Lu,Nu.initCutValues=Iu,Nu.calcCutValue=Tu,Nu.leaveEdge=Qu,Nu.enterEdge=Ru,Nu.exchangeEdges=Bu;var Vu=bu,Gu=function(e){switch(e.graph().ranker){case"network-simplex":Uu(e);break;case"tight-tree":!function(e){Vu(e),ku(e)}(e);break;case"longest-path":Hu(e);break;default:Uu(e)}};var Hu=Vu;function Uu(e){Ou(e)}var Wu=function(e){var t=function(e){var t={},r=0;return ou.forEach(e.children(),function n(o){var i=r;ou.forEach(e.children(o),n),t[o]={low:i,lim:r++}}),t}(e);ou.forEach(e.graph().dummyChains,function(r){for(var n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){var o,i,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>u||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;r!==o.w;){if(n=e.node(r),l){for(;(c=a[u])!==s&&e.node(c).maxRank<n.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&e.node(c=a[u+1]).minRank<=n.rank;)u++;c=a[u]}e.setParent(r,c),r=e.successors(r)[0]}})};var qu={run:function(e){var t=vu.addDummyNode(e,"root",{},"_root"),r=function(e){var t={};return ou.forEach(e.children(),function(r){!function r(n,o){var i=e.children(n);i&&i.length&&ou.forEach(i,function(e){r(e,o+1)}),t[n]=o}(r,1)}),t}(e),n=ou.max(ou.values(r))-1,o=2*n+1;e.graph().nestingRoot=t,ou.forEach(e.edges(),function(t){e.edge(t).minlen*=o});var i=function(e){return ou.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}(e)+1;ou.forEach(e.children(),function(a){!function e(t,r,n,o,i,a,s){var u=t.children(s);if(!u.length)return void(s!==r&&t.setEdge(r,s,{weight:0,minlen:n}));var c=vu.addBorderNode(t,"_bt");var l=vu.addBorderNode(t,"_bb");var h=t.node(s);t.setParent(c,s);h.borderTop=c;t.setParent(l,s);h.borderBottom=l;ou.forEach(u,function(u){e(t,r,n,o,i,a,u);var h=t.node(u),f=h.borderTop?h.borderTop:u,d=h.borderBottom?h.borderBottom:u,p=h.borderTop?o:2*o,g=f!==d?1:i-a[s]+1;t.setEdge(c,f,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,l,{weight:p,minlen:g,nestingEdge:!0})});t.parent(s)||t.setEdge(r,c,{weight:0,minlen:i+a[s]})}(e,t,o,i,n,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,ou.forEach(e.edges(),function(t){var r=e.edge(t);r.nestingEdge&&e.removeEdge(t)})}};var Yu=function(e){ou.forEach(e.children(),function t(r){var n=e.children(r);var o=e.node(r);n.length&&ou.forEach(n,t);if(ou.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)$u(e,"borderLeft","_bl",r,o,i),$u(e,"borderRight","_br",r,o,i)}})};function $u(e,t,r,n,o,i){var a={width:0,height:0,rank:i,borderType:t},s=o[t][i-1],u=vu.addDummyNode(e,"border",a,r);o[t][i]=u,e.setParent(u,n),s&&e.setEdge(s,u,{weight:1})}var Xu={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||Ju(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){ou.forEach(e.nodes(),function(t){Zu(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,Zu),ou.has(r,"y")&&Zu(r)})}(e);"lr"!==t&&"rl"!==t||(!function(e){ou.forEach(e.nodes(),function(t){ec(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,ec),ou.has(r,"x")&&ec(r)})}(e),Ju(e))}};function Ju(e){ou.forEach(e.nodes(),function(t){Ku(e.node(t))}),ou.forEach(e.edges(),function(t){Ku(e.edge(t))})}function Ku(e){var t=e.width;e.width=e.height,e.height=t}function Zu(e){e.y=-e.y}function ec(e){var t=e.x;e.x=e.y,e.y=t}var tc=function(e){var t={},r=ou.filter(e.nodes(),function(t){return!e.children(t).length}),n=ou.max(ou.map(r,function(t){return e.node(t).rank})),o=ou.map(ou.range(n+1),function(){return[]});var i=ou.sortBy(r,function(t){return e.node(t).rank});return ou.forEach(i,function r(n){if(!ou.has(t,n)){t[n]=!0;var i=e.node(n);o[i.rank].push(n),ou.forEach(e.successors(n),r)}}),o};var rc=function(e,t){for(var r=0,n=1;n<t.length;++n)r+=nc(e,t[n-1],t[n]);return r};function nc(e,t,r){for(var n=ou.zipObject(r,ou.map(r,function(e,t){return t})),o=ou.flatten(ou.map(t,function(t){return ou.sortBy(ou.map(e.outEdges(t),function(t){return{pos:n[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var s=ou.map(new Array(a),function(){return 0}),u=0;return ou.forEach(o.forEach(function(e){var t=e.pos+i;s[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=s[t+1]),s[t=t-1>>1]+=e.weight;u+=e.weight*r})),u}var oc=function(e,t){return ou.map(t,function(t){var r=e.inEdges(t);if(r.length){var n=ou.reduce(r,function(t,r){var n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})};var ic=function(e,t){var r={};return ou.forEach(e,function(e,t){var n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};ou.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)}),ou.forEach(t.edges(),function(e){var t=r[e.v],n=r[e.w];ou.isUndefined(t)||ou.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))}),function(e){var t=[];function r(e){return function(t){var r,n,o,i;t.merged||(ou.isUndefined(t.barycenter)||ou.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(n=t,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),n.weight&&(o+=n.barycenter*n.weight,i+=n.weight),r.vs=n.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(n.i,r.i),n.merged=!0)}}function n(t){return function(r){r.in.push(t),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();t.push(o),ou.forEach(o.in.reverse(),r(o)),ou.forEach(o.out,n(o))}return ou.map(ou.filter(t,function(e){return!e.merged}),function(e){return ou.pick(e,["vs","i","barycenter","weight"])})}(ou.filter(r,function(e){return!e.indegree}))};var ac=function(e,t){var r=vu.partition(e,function(e){return ou.has(e,"barycenter")}),n=r.lhs,o=ou.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,s=0,u=0;n.sort((c=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i})),u=sc(i,o,u),ou.forEach(n,function(e){u+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,s+=e.weight,u=sc(i,o,u)});var c;var l={vs:ou.flatten(i,!0)};s&&(l.barycenter=a/s,l.weight=s);return l};function sc(e,t,r){for(var n;t.length&&(n=ou.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}var uc=function e(t,r,n,o){var i=t.children(r);var a=t.node(r);var s=a?a.borderLeft:void 0;var u=a?a.borderRight:void 0;var c={};s&&(i=ou.filter(i,function(e){return e!==s&&e!==u}));var l=oc(t,i);ou.forEach(l,function(r){if(t.children(r.v).length){var i=e(t,r.v,n,o);c[r.v]=i,ou.has(i,"barycenter")&&(a=r,s=i,ou.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var h=ic(l,n);!function(e,t){ou.forEach(e,function(e){e.vs=ou.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,c);var f=ac(h,o);if(s&&(f.vs=ou.flatten([s,f.vs,u],!0),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(u)[0]);ou.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+p.order)/(f.weight+2),f.weight+=2}return f};var cc=Ua.Graph,lc=function(e,t,r){var n=function(e){var t;for(;e.hasNode(t=ou.uniqueId("_root")););return t}(e),o=new cc({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(t){return e.node(t)});return ou.forEach(e.nodes(),function(i){var a=e.node(i),s=e.parent(i);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||n),ou.forEach(e[r](i),function(t){var r=t.v===i?t.w:t.v,n=o.edge(r,i),a=ou.isUndefined(n)?0:n.weight;o.setEdge(r,i,{weight:e.edge(t).weight+a})}),ou.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o};var hc=function(e,t,r){var n,o={};ou.forEach(r,function(r){for(var i,a,s=e.parent(r);s;){if((i=e.parent(s))?(a=o[i],o[i]=s):(a=n,n=s),a&&a!==s)return void t.setEdge(a,s);s=i}})};var fc=Ua.Graph,dc=function(e){var t=vu.maxRank(e),r=pc(e,ou.range(1,t+1),"inEdges"),n=pc(e,ou.range(t-1,-1,-1),"outEdges"),o=tc(e);vc(e,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){gc(s%2?r:n,s%4>=2),o=vu.buildLayerMatrix(e);var c=rc(e,o);c<a&&(u=0,i=ou.cloneDeep(o),a=c)}vc(e,i)};function pc(e,t,r){return ou.map(t,function(t){return lc(e,t,r)})}function gc(e,t){var r=new fc;ou.forEach(e,function(e){var n=e.graph().root,o=uc(e,n,r,t);ou.forEach(o.vs,function(t,r){e.node(t).order=r}),hc(e,r,o.vs)})}function vc(e,t){ou.forEach(t,function(t){ou.forEach(t,function(t,r){e.node(t).order=r})})}var yc=Ua.Graph,mc=function(e){var t,r=vu.buildLayerMatrix(e),n=ou.merge(_c(e,r),bc(e,r)),o={};ou.forEach(["u","d"],function(i){t="u"===i?r:ou.values(r).reverse(),ou.forEach(["l","r"],function(r){"r"===r&&(t=ou.map(t,function(e){return ou.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),s=Ec(e,t,n,a),u=kc(e,t,s.root,s.align,"r"===r);"r"===r&&(u=ou.mapValues(u,function(e){return-e})),o[i+r]=u})});var i=Dc(e,o);return Sc(o,i),Cc(o,e.graph().align)};function _c(e,t){var r={};return ou.reduce(t,function(t,n){var o=0,i=0,a=t.length,s=ou.last(n);return ou.forEach(n,function(t,u){var c=function(e,t){if(e.node(t).dummy)return ou.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),l=c?e.node(c).order:a;(c||t===s)&&(ou.forEach(n.slice(i,u+1),function(t){ou.forEach(e.predecessors(t),function(n){var i=e.node(n),a=i.order;!(a<o||l<a)||i.dummy&&e.node(t).dummy||wc(r,n,t)})}),i=u+1,o=l)}),n}),r}function bc(e,t){var r={};function n(t,n,o,i,a){var s;ou.forEach(ou.range(n,o),function(n){s=t[n],e.node(s).dummy&&ou.forEach(e.predecessors(s),function(t){var n=e.node(t);n.dummy&&(n.order<i||n.order>a)&&wc(r,t,s)})})}return ou.reduce(t,function(t,r){var o,i=-1,a=0;return ou.forEach(r,function(s,u){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(o=e.node(c[0]).order,n(r,a,u,i,o),a=u,i=o)}n(r,a,r.length,o,t.length)}),r}),r}function wc(e,t,r){if(t>r){var n=t;t=r,r=n}var o=e[t];o||(e[t]=o={}),o[r]=!0}function xc(e,t,r){if(t>r){var n=t;t=r,r=n}return ou.has(e[t],r)}function Ec(e,t,r,n){var o={},i={},a={};return ou.forEach(t,function(e){ou.forEach(e,function(e,t){o[e]=e,i[e]=e,a[e]=t})}),ou.forEach(t,function(e){var t=-1;ou.forEach(e,function(e){var s=n(e);if(s.length)for(var u=((s=ou.sortBy(s,function(e){return a[e]})).length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var h=s[c];i[e]===e&&t<a[h]&&!xc(r,e,h)&&(i[h]=e,i[e]=o[e]=o[h],t=a[h])}})}),{root:o,align:i}}function kc(e,t,r,n,o){var i={},a=function(e,t,r,n){var o=new yc,i=e.graph(),a=function(e,t,r){return function(n,o,i){var a,s=n.node(o),u=n.node(i),c=0;if(c+=s.width/2,ou.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2}if(a&&(c+=r?a:-a),a=0,c+=(s.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,ou.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=u.width/2;break;case"r":a=-u.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,n);return ou.forEach(t,function(t){var n;ou.forEach(t,function(t){var i=r[t];if(o.setNode(i),n){var s=r[n],u=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,n),u||0))}n=t})}),o}(e,t,r,o),s=o?"borderLeft":"borderRight";function u(e,t){for(var r=a.nodes(),n=r.pop(),o={};n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return u(function(e){i[e]=a.inEdges(e).reduce(function(e,t){return Math.max(e,i[t.v]+a.edge(t))},0)},a.predecessors.bind(a)),u(function(t){var r=a.outEdges(t).reduce(function(e,t){return Math.min(e,i[t.w]-a.edge(t))},Number.POSITIVE_INFINITY),n=e.node(t);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(i[t]=Math.max(i[t],r))},a.successors.bind(a)),ou.forEach(n,function(e){i[e]=i[r[e]]}),i}function Dc(e,t){return ou.minBy(ou.values(t),function(t){var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return ou.forIn(t,function(t,o){var i=function(e,t){return e.node(t).width}(e,o)/2;r=Math.max(t+i,r),n=Math.min(t-i,n)}),r-n})}function Sc(e,t){var r=ou.values(t),n=ou.min(r),o=ou.max(r);ou.forEach(["u","d"],function(r){ou.forEach(["l","r"],function(i){var a,s=r+i,u=e[s];if(u!==t){var c=ou.values(u);(a="l"===i?n-ou.min(c):o-ou.max(c))&&(e[s]=ou.mapValues(u,function(e){return e+a}))}})})}function Cc(e,t){return ou.mapValues(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var o=ou.sortBy(ou.map(e,n));return(o[1]+o[2])/2})}var Ac=mc,jc=function(e){(function(e){var t=vu.buildLayerMatrix(e),r=e.graph().ranksep,n=0;ou.forEach(t,function(t){var o=ou.max(ou.map(t,function(t){return e.node(t).height}));ou.forEach(t,function(t){e.node(t).y=n+o/2}),n+=o+r})})(e=vu.asNonCompoundGraph(e)),ou.forEach(Ac(e),function(t,r){e.node(r).x=t})};var Pc=vu.normalizeRanks,Fc=vu.removeEmptyRanks,Mc=vu,Oc=Ua.Graph,Nc=function(e,t){var r=t&&t.debugTiming?Mc.time:Mc.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return function(e){var t=new Oc({multigraph:!0,compound:!0}),r=Hc(e.graph());return t.setGraph(ou.merge({},Tc,Gc(r,Ic),ou.pick(r,Lc))),ou.forEach(e.nodes(),function(r){var n=Hc(e.node(r));t.setNode(r,ou.defaults(Gc(n,Qc),Rc)),t.setParent(r,e.parent(r))}),ou.forEach(e.edges(),function(r){var n=Hc(e.edge(r));t.setEdge(r,ou.merge({},zc,Gc(n,Bc),ou.pick(n,Vc)))}),t}(e)});r(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,ou.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){ou.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){pu.run(e)}),t(" nestingGraph.run",function(){qu.run(e)}),t(" rank",function(){Gu(Mc.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),o=e.node(t.w),i={rank:(o.rank-n.rank)/2+n.rank,e:t};Mc.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){Fc(e)}),t(" nestingGraph.cleanup",function(){qu.cleanup(e)}),t(" normalizeRanks",function(){Pc(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;ou.forEach(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=ou.max(t,n.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){_u.run(e)}),t(" parentDummyChains",function(){Wu(e)}),t(" addBorderSegments",function(){Yu(e)}),t(" order",function(){dc(e)}),t(" insertSelfEdges",function(){!function(e){var t=Mc.buildLayerMatrix(e);ou.forEach(t,function(t){var r=0;ou.forEach(t,function(t,n){var o=e.node(t);o.order=n+r,ou.forEach(o.selfEdges,function(t){Mc.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){Xu.adjust(e)}),t(" position",function(){jc(e)}),t(" positionSelfEdges",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,a=r.x-o,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){ou.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(ou.last(r.borderLeft)),a=e.node(ou.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),ou.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){_u.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(ou.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){Xu.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){var i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),r=Math.max(r,i+s/2),n=Math.min(n,a-u/2),o=Math.max(o,a+u/2)}ou.forEach(e.nodes(),function(t){u(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.has(r,"x")&&u(r)}),t-=a,n-=s,ou.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=t,o.y-=n}),ou.forEach(e.edges(),function(r){var o=e.edge(r);ou.forEach(o.points,function(e){e.x-=t,e.y-=n}),ou.has(o,"x")&&(o.x-=t),ou.has(o,"y")&&(o.y-=n)}),i.width=r-t+a,i.height=o-n+s}(e)}),t(" assignNodeIntersects",function(){!function(e){ou.forEach(e.edges(),function(t){var r,n,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=a,n=i),o.points.unshift(Mc.intersectRect(i,r)),o.points.push(Mc.intersectRect(a,n))})}(e)}),t(" reversePoints",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}(e)}),t(" acyclic.undo",function(){pu.undo(e)})}(t,r)}),r(" updateInputGraph",function(){!function(e,t){ou.forEach(e.nodes(),function(r){var n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,t.children(r).length&&(n.width=o.width,n.height=o.height))}),ou.forEach(e.edges(),function(r){var n=e.edge(r),o=t.edge(r);n.points=o.points,ou.has(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var Ic=["nodesep","edgesep","ranksep","marginx","marginy"],Tc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Lc=["acyclicer","ranker","rankdir","align"],Qc=["width","height"],Rc={width:0,height:0},Bc=["minlen","weight","width","height","labeloffset"],zc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Vc=["labelpos"];function Gc(e,t){return ou.mapValues(ou.pick(e,t),Number)}function Hc(e){var t={};return ou.forEach(e,function(e,r){t[r.toLowerCase()]=e}),t}var Uc=Ua.Graph;var Wc={graphlib:Ua,layout:Nc,debug:{debugOrdering:function(e){var t=vu.buildLayerMatrix(e),r=new Uc({compound:!0,multigraph:!0}).setGraph({});return ou.forEach(e.nodes(),function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)}),ou.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),ou.forEach(t,function(e,t){var n="layer"+t;r.setNode(n,{rank:"same"}),ou.reduce(e,function(e,t){return r.setEdge(e,t,{style:"invis"}),t})}),r}},util:{time:vu.time,notime:vu.notime},version:"0.8.5"},qc=Wc.graphlib,Yc=Wc.layout,$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(qc.Graph),Xc=function(){function e(){this._g=new $c({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel(function(){return{debug:"error"}}),this._g.setDefaultEdgeLabel(function(){return{debug:"error"}})}return e.prototype.parent=function(e){return this._g.parent(e)},e.prototype.filterNodes=function(e){var t=[];return this.eachNode(function(r){e(r)&&t.push(r)}),t},e.prototype.eachNode=function(e){this._g.nodes().forEach(function(t){e(t,this.node(t))},this)},e.prototype.filterEdges=function(e){var t=[];return this.eachEdge(function(r){e(r)&&t.push(r)}),t},e.prototype.eachEdge=function(e){this._g.edges().forEach(function(t){e(t,t.v,t.w,this.edge(t))},this)},e.prototype.setData=function(e,t,r,n,o){for(var i=this,a={addedVertices:[],addedEdges:[]},s=e.concat(t),u=0;u<s.length;++u){var c=s[u];o&&this._g.hasNode(c._id)||(this._g.setNode(c._id,c),a.addedVertices.push(c))}for(u=0;u<r.length;++u){var l=r[u];o&&this._g.hasEdge(l._id)||(l._sourceVertex&&l._targetVertex?(this._g.setEdge(l._sourceVertex._id,l._targetVertex._id,l,l._id),a.addedEdges.push(l)):console.log("Bad edge definition"))}if(n)for(u=0;u<n.length;++u)this._g.setParent(n[u].child._id,n[u].parent._id);if(o){var h=r.map(function(e){return e._id});this.filterEdges(function(e){return h.indexOf(e.name)<0}).forEach(function(e){return i._g.removeEdge(e.v,e.w,e.name)});var f=s.map(function(e){return e._id});this.filterNodes(function(e){return f.indexOf(e)<0}).forEach(function(e){return i._g.removeNode(e)})}return a},e.prototype.node=function(e){return this._g.node(e)},e.prototype.nodeCount=function(){return this._g.nodeCount()},e.prototype.nodes=function(){var e=this;return this._g.nodes().map(function(t){return e._g.node(t)})},e.prototype.nodeEdges=function(e){return this._g.nodeEdges(e)},e.prototype.edge=function(e){return this._g.edge(e)},e.prototype.edges=function(){var e=this;return this._g.edges().map(function(t){return e._g.edge(t)})},e.prototype.neighbors=function(e){var t=this;return this._g.neighbors(e).map(function(e){return t._g.node(e)})},e.prototype.singleNeighbors=function(e){var t=this;return this._g.neighbors(e).filter(function(e){return 1===t._g.neighbors(e).length}).map(function(e){return t._g.node(e)})},e.prototype.gatherShortestPath=function(e,t){for(var r=[],n=t,o=e[n];o;){if(o.distance<1/0&&o.predecessor){var i=this._g.nodeEdges(n,o.predecessor)[0];r.push(this._g.edge(i))}o=e[n=o.predecessor]}return r},e.prototype.shortestPath=function(e,t){return this.gatherShortestPath(qc.alg.dijkstra(this._g,e),t)},e.prototype.undirectedShortestPath=function(e,t){var r=this;return this.gatherShortestPath(qc.alg.dijkstra(this._g,e,null,function(e){return r._g.nodeEdges(e)}),t)},e.prototype.getJSON=function(){var e=qc.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}," ")},e}();function Jc(e,t){var r;function n(){var n,o,i=r.length,a=0,s=0;for(n=0;n<i;++n)a+=(o=r[n]).x,s+=o.y;for(a=a/i-e,s=s/i-t,n=0;n<i;++n)(o=r[n]).x-=a,o.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n}function Kc(e){return function(){return e}}function Zc(){return 1e-6*(Math.random()-.5)}function el(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i,a,s,u,c,l,h,f,d=e._root,p={data:n},g=e._x0,v=e._y0,y=e._x1,m=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a,o=d,!(d=d[h=l<<1|c]))return o[h]=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,o?o[h]=p:e._root=p,e;do{o=o?o[h]=new Array(4):e._root=new Array(4),(c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a}while((h=l<<1|c)==(f=(u>=a)<<1|s>=i));return o[f]=d,o[h]=p,e}function tl(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function rl(e){return e[0]}function nl(e){return e[1]}function ol(e,t,r){var n=new il(null==t?rl:t,null==r?nl:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function il(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function al(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var sl=ol.prototype=il.prototype;function ul(e){return e.index}function cl(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function ll(e){var r,n,o,i,a,s=ul,u=function(e){return 1/Math.min(i[e.source.index],i[e.target.index])},c=Kc(30),l=1;function h(t){for(var o=0,i=e.length;o<l;++o)for(var s,u,c,h,f,d,p,g=0;g<i;++g)u=(s=e[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Zc(),f=c.y+c.vy-u.y-u.vy||Zc(),h*=d=((d=Math.sqrt(h*h+f*f))-n[g])/d*t*r[g],f*=d,c.vx-=h*(p=a[g]),c.vy-=f*p,u.vx+=h*(p=1-p),u.vy+=f*p}function f(){if(o){var u,c,l=o.length,h=e.length,f=t.map(o,s);for(u=0,i=new Array(l);u<h;++u)(c=e[u]).index=u,"object"!=typeof c.source&&(c.source=cl(f,c.source)),"object"!=typeof c.target&&(c.target=cl(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(u=0,a=new Array(h);u<h;++u)c=e[u],a[u]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);r=new Array(h),d(),n=new Array(h),p()}}function d(){if(o)for(var t=0,n=e.length;t<n;++t)r[t]=+u(e[t],t,e)}function p(){if(o)for(var t=0,r=e.length;t<r;++t)n[t]=+c(e[t],t,e)}return null==e&&(e=[]),h.initialize=function(e){o=e,f()},h.links=function(t){return arguments.length?(e=t,f(),h):e},h.id=function(e){return arguments.length?(s=e,h):s},h.iterations=function(e){return arguments.length?(l=+e,h):l},h.strength=function(e){return arguments.length?(u="function"==typeof e?e:Kc(+e),d(),h):u},h.distance=function(e){return arguments.length?(c="function"==typeof e?e:Kc(+e),p(),h):c},h}sl.copy=function(){var e,t,r=new il(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=al(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var o=0;o<4;++o)(t=n.source[o])&&(t.length?e.push({source:t,target:n.target[o]=new Array(4)}):n.target[o]=al(t));return r},sl.add=function(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return el(this.cover(t,r),t,r,e)},sl.addAll=function(e){var t,r,n,o,i=e.length,a=new Array(i),s=new Array(i),u=1/0,c=1/0,l=-1/0,h=-1/0;for(r=0;r<i;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(o=+this._y.call(null,t))||(a[r]=n,s[r]=o,n<u&&(u=n),n>l&&(l=n),o<c&&(c=o),o>h&&(h=o));if(u>l||c>h)return this;for(this.cover(u,c).cover(l,h),r=0;r<i;++r)el(this,a[r],s[r],e[r]);return this},sl.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a,s,u=o-r,c=this._root;r>e||e>=o||n>t||t>=i;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:o=r+u,i=n+u;break;case 1:r=o-u,i=n+u;break;case 2:o=r+u,n=i-u;break;case 3:r=o-u,n=i-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this},sl.data=function(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e},sl.extent=function(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]]},sl.find=function(e,t,r){var n,o,i,a,s,u,c,l=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new tl(g,l,h,f,d)),null==r?r=1/0:(l=e-r,h=t-r,f=e+r,d=t+r,r*=r);u=p.pop();)if(!(!(g=u.node)||(o=u.x0)>f||(i=u.y0)>d||(a=u.x1)<l||(s=u.y1)<h))if(g.length){var v=(o+a)/2,y=(i+s)/2;p.push(new tl(g[3],v,y,a,s),new tl(g[2],o,y,v,s),new tl(g[1],v,i,a,y),new tl(g[0],o,i,v,y)),(c=(t>=y)<<1|e>=v)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var m=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),b=m*m+_*_;if(b<r){var w=Math.sqrt(r=b);l=e-w,h=t-w,f=e+w,d=t+w,n=g.data}}return n},sl.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,o,i,a,s,u,c,l,h,f,d=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=i>=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+y)/2))?g=u:y=u,t=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,f=h)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(o=d.next)&&delete d.next,n?(o?n.next=o:delete n.next,this):t?(o?t[h]=o:delete t[h],(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=o,this)},sl.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},sl.root=function(){return this._root},sl.size=function(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e},sl.visit=function(e){var t,r,n,o,i,a,s=[],u=this._root;for(u&&s.push(new tl(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,o=t.y0,i=t.x1,a=t.y1)&&u.length){var c=(n+i)/2,l=(o+a)/2;(r=u[3])&&s.push(new tl(r,c,l,i,a)),(r=u[2])&&s.push(new tl(r,n,l,c,a)),(r=u[1])&&s.push(new tl(r,c,o,i,l)),(r=u[0])&&s.push(new tl(r,n,o,c,l))}return this},sl.visitAfter=function(e){var t,r=[],n=[];for(this._root&&r.push(new tl(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var o=t.node;if(o.length){var i,a=t.x0,s=t.y0,u=t.x1,c=t.y1,l=(a+u)/2,h=(s+c)/2;(i=o[0])&&r.push(new tl(i,a,s,l,h)),(i=o[1])&&r.push(new tl(i,l,s,u,h)),(i=o[2])&&r.push(new tl(i,a,h,l,c)),(i=o[3])&&r.push(new tl(i,l,h,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},sl.x=function(e){return arguments.length?(this._x=e,this):this._x},sl.y=function(e){return arguments.length?(this._y=e,this):this._y};var hl,fl,dl=0,pl=0,gl=0,vl=1e3,yl=0,ml=0,_l=0,bl="object"==typeof performance&&performance.now?performance:Date,wl="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xl(){return ml||(wl(El),ml=bl.now()+_l)}function El(){ml=0}function kl(){this._call=this._time=this._next=null}function Dl(e,t,r){var n=new kl;return n.restart(e,t,r),n}function Sl(){ml=(yl=bl.now())+_l,dl=pl=0;try{!function(){xl(),++dl;for(var e,t=hl;t;)(e=ml-t._time)>=0&&t._call.call(null,e),t=t._next;--dl}()}finally{dl=0,function(){var e,t,r=hl,n=1/0;for(;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:hl=t);fl=e,Al(n)}(),ml=0}}function Cl(){var e=bl.now(),t=e-yl;t>vl&&(_l-=t,yl=e)}function Al(e){dl||(pl&&(pl=clearTimeout(pl)),e-ml>24?(e<1/0&&(pl=setTimeout(Sl,e-bl.now()-_l)),gl&&(gl=clearInterval(gl))):(gl||(yl=bl.now(),gl=setInterval(Cl,vl)),dl=1,wl(Sl)))}function jl(e){return e.x}function Pl(e){return e.y}kl.prototype=Dl.prototype={constructor:kl,restart:function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?xl():+r)+(null==t?0:+t),this._next||fl===this||(fl?fl._next=this:hl=this,fl=this),this._call=e,this._time=r,Al()},stop:function(){this._call&&(this._call=null,this._time=1/0,Al())}};var Fl=10,Ml=Math.PI*(3-Math.sqrt(5));function Ol(e){var r,n=1,o=.001,i=1-Math.pow(o,1/300),a=0,s=.6,u=t.map(),c=Dl(h),l=t.dispatch("tick","end");function h(){f(),l.call("tick",r),n<o&&(c.stop(),l.call("end",r))}function f(t){var o,c,l=e.length;void 0===t&&(t=1);for(var h=0;h<t;++h)for(n+=(a-n)*i,u.each(function(e){e(n)}),o=0;o<l;++o)null==(c=e[o]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return r}function d(){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 o=Fl*Math.sqrt(r),i=r*Ml;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),d(),r={tick:f,restart:function(){return c.restart(h),r},stop:function(){return c.stop(),r},nodes:function(t){return arguments.length?(e=t,d(),u.each(p),r):e},alpha:function(e){return arguments.length?(n=+e,r):n},alphaMin:function(e){return arguments.length?(o=+e,r):o},alphaDecay:function(e){return arguments.length?(i=+e,r):+i},alphaTarget:function(e){return arguments.length?(a=+e,r):a},velocityDecay:function(e){return arguments.length?(s=1-e,r):1-s},force:function(e,t){return arguments.length>1?(null==t?u.remove(e):u.set(e,p(t)),r):u.get(e)},find:function(t,r,n){var o,i,a,s,u,c=0,l=e.length;for(null==n?n=1/0:n*=n,c=0;c<l;++c)(a=(o=t-(s=e[c]).x)*o+(i=r-s.y)*i)<n&&(u=s,n=a);return u},on:function(e,t){return arguments.length>1?(l.on(e,t),r):l.on(e)}}}function Nl(){var e,t,r,n,o=Kc(-30),i=1,a=1/0,s=.81;function u(n){var o,i=e.length,a=ol(e,jl,Pl).visitAfter(l);for(r=n,o=0;o<i;++o)t=e[o],a.visit(h)}function c(){if(e){var t,r,i=e.length;for(n=new Array(i),t=0;t<i;++t)r=e[t],n[r.index]=+o(r,t,e)}}function l(e){var t,r,o,i,a,s=0,u=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,o+=r*t.x,i+=r*t.y);e.x=o/u,e.y=i/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=n[t.data.index]}while(t=t.next)}e.value=s}function h(e,o,u,c){if(!e.value)return!0;var l=e.x-t.x,h=e.y-t.y,f=c-o,d=l*l+h*h;if(f*f/s<d)return d<a&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)),t.vx+=l*e.value*r/d,t.vy+=h*e.value*r/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(f=n[e.data.index]*r/d,t.vx+=l*f,t.vy+=h*f)}while(e=e.next)}}return u.initialize=function(t){e=t,c()},u.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(i=e*e,u):Math.sqrt(i)},u.distanceMax=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.theta=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u}function Il(e,t,r,n){var o=this;this.pos={};n=n||(t<r?t-0:r-0)/2;var i=e.nodeCount(),a=-Math.PI/2,s=2*Math.PI/i;e.eachNode(function(e,i){var u=i.getBBox();o.pos[e]={x:i.fixed?i.x:t/2+Math.cos(a)*(n-0),y:i.fixed?i.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s})}function Tl(e,t,r,n){n=n||{};var o=this;this.pos={},this.vertices=[],this.vertexMap={},e.eachNode(function(t){var 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};o.vertices.push(i),o.vertexMap[t]=i}),this.edges=[],e.eachEdge(function(e,t,r){o.edges.push({source:t,target:r})});var i=ll().id(function(e){return e.id}).distance(n.linkDistance).strength(n.linkStrength),a=Nl().strength(function(e){var t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)});if(this.force=Ol().force("link",i).force("charge",a).force("center",Jc(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();var s=e.nodeCount();s=Math.min(s*s,500);for(var u=0;u<s;++u)this.force.tick();this.force.stop()}}function Ll(e,t,r,n){var o=new qc.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});e.eachNode(function(t){var r=e.node(t).getBBox();o.setNode(t,{width:r.width,height:r.height})}),e.eachEdge(function(t,r,i){var a=e.edge(t);o.setEdge(r,i,{weight:a.weight()},a._id),n.digraph||o.setEdge(i,r,{weight:a.weight()},a._id)}),e.eachNode(function(t){o.setParent(t,e.parent(t))}),this.dagreLayout=Yc(o,{debugTiming:!1});var i=-o.graph().width/2,a=-o.graph().height/2;o.nodes().forEach(function(e){var n=o.node(e);n.x+=i+t/2,n.y+=a+r/2}),o.edges().forEach(function(e){for(var n=o.edge(e),s=0;s<n.points.length;++s)n.points[s].x+=i+t/2,n.points[s].y+=a+r/2}),this.digraph=o}Il.prototype.nodePos=function(e){return this.pos[e]},Il.prototype.edgePoints=function(e){return[]},Tl.prototype.nodePos=function(e){return this.vertexMap[e]},Tl.prototype.edgePoints=function(e){return[]},Ll.prototype.nodePos=function(e){return this.digraph.node(e)},Ll.prototype.edgePoints=function(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points};L(".graph_Subgraph .border{fill:none;stroke:#1f77b4;stroke-width:1px;pointer-events:none}.graph_Subgraph.selected>rect{stroke:red!important}");var Ql=14,Rl=18,Bl=function(e){function r(){var r=e.call(this)||this;return r._textWidget=(new t.Text).anchor("start").fontSize(Ql),r._buttonMin=(new t.Icon).diameter(Rl).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",function(){r.minClick()},!0).on("dblclick",function(){},!0),r._minState="normal",r}return s(r,e),r.prototype.minState=function(e){return arguments.length?(this._minState=e,this):this._minState},r.prototype.calcIcon=function(){switch(this._minState){case"normal":return"";case"partial":return""}},r.prototype.getBBox=function(e,t){var r=this.width(),n=this.height();return{x:-r/2,y:-n/2-Ql,width:r,height:n}},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._border=r.append("rect").attr("class","border"),this._textWidget.target(t),this._buttonMin.target(t)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.getBBox();this._border.attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(t.Palette.textColor(this.border_colorFill())),this._textWidget.pos({x:o.x+4,y:o.y+Ql}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:o.x+o.width-(Rl/2+4),y:o.y+(Rl/2+4)}).faChar(this.calcIcon()).render()},r.prototype.exit=function(t,r){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),e.prototype.exit.call(this,t,r)},r.prototype.intersection=function(e,t){var r=null;return[].forEach(function(e){(null===r||r.d>e.d)&&(r=e)}),r&&r.i?r.i:null},r.prototype.click=function(e){console.log("Clicked: "+e.id)},r.prototype.minClick=function(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()},r}(t.SVGWidget);Bl.prototype._class+=" graph_Subgraph",Bl.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),Bl.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),Bl.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),Bl.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),Bl.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),Bl.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),Bl.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});L(".graph_Vertex.selected .common_Shape{stroke:red!important}");var zl=function(e){function r(){var r=e.call(this)||this;return r._icon=new t.Icon,r._textBox=new t.TextBox,r._annotationWidgets={},r.pos({x:void 0,y:void 0}),r}return s(r,e),r.prototype.getIconBBox=function(){var 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}},r.prototype.getBBox=function(e,t){var r=this.getIconBBox(),n=this._textBox.getBBox(!0),o=Math.min(r.x,n.x),i=Math.min(r.y,n.y);return{x:o,y:i,width:Math.max(r.x+r.width,n.x+n.width)-o,height:Math.max(r.y+r.height,n.y+n.height)-i}},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),delete this._prevHash,this._icon.target(t),this._textBox.target(t),r.on("mouseover",function(e){return n.mouseover(e.data())}).on("mouseout",function(e){return n.mouseout(e.data())})},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.hashSum();if(this._prevHash!==o){this._prevHash=o,n.classed("centroid",this.centroid()),n.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();var i=this.getIconBBox();this._icon.move(i);var a=this,s=n.selectAll(".annotation").data(this.annotationIcons()),u=s.enter().append("g").attr("class","annotation").each(function(e,r){a._annotationWidgets[r]=(new t.Icon).target(this).shape("square")}),c=this._textBox.getBBox(!0),l=c.width/2,h=c.height/2;u.merge(s).each(function(e,t){var r=a._annotationWidgets[t];for(var n in r.diameter(a.annotationDiameter()).shape_colorFill(a.textbox_shape_colorFill()).shape_colorStroke(a.textbox_shape_colorStroke()),e)r[n]?r[n](e[n]):window.__hpcc_debug&&console.log("Invalid annotation property: "+n);r.render();var o=r.getBBox(!0);r.move({x:l-o.width/2+4,y:h+o.height/2-4}),l-=o.width+a.annotationSpacing()}),s.exit().each(function(e,r){var n=t.select(this);a._annotationWidgets[r].target(null),delete a._annotationWidgets[r],n.remove()})}},r.prototype.exit=function(t,r){for(var n in this._annotationWidgets)this._annotationWidgets[n].target(null);this._icon.target(null),this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype.contains=function(e){return this._icon.contains(e)||this._textBox.contains(e)},r.prototype.intersection=function(e,t){var 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},r.prototype.mouseover=function(e){},r.prototype.mouseout=function(e){},r}(t.SVGWidget);zl.prototype._class+=" graph_Vertex",zl.prototype.publishProxy("faChar","_icon"),zl.prototype.publishProxy("imageUrl","_icon"),zl.prototype.publishProxy("icon_diameter","_icon","diameter"),zl.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),zl.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),zl.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),zl.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),zl.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),zl.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),zl.prototype.publishProxy("text","_textBox"),zl.prototype.publishProxy("anchor","_textBox"),zl.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),zl.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),zl.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),zl.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),zl.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),zl.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),zl.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),zl.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),zl.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),zl.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});L(".graph_Graph .marker{fill:#656565;stroke:none;stroke-width:1px}.graph_Graph .zoom{fill:none;pointer-events:all}.graph_Graph .selectionBrush{fill:none;stroke:#a9a9a9}.graph_Graph .graphEdge.shortest-path .graph_Edge{stroke:red}");var Vl=function(e){function r(){var r=e.call(this)||this;r._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return r.layoutClick("Hierarchy")}),r._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return r.layoutClick("ForceDirected")}),r._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return r.layoutClick("ForceDirected2")}),r._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return r.layoutClick("Circle")}),r._dataHash=0,r._neighborOffsets=[],n.IGraph.call(r),n.ITooltip.call(r),r.tooltipHTML(function(e){var t;return e instanceof Bl?t=e.title().replace(/\n/g,"<br>"):(e instanceof zl||e instanceof R)&&(t=e.text().replace(/\n/g,"<br>")),t?'<p style="text-align:center">'+t+"</p>":null}),r._drawStartPos="origin";var o=[r._toggleHierarchy,r._toggleForceDirected,r._toggleForceDirected2,r._toggleCircle,new t.Spacer];return r._iconBar.buttons(o.concat(r._iconBar.buttons())),r._graphData=new Xc,r.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},r._selection=new t.Utility.Selection(r),r.zoomToFitLimit(1),r}return s(r,e),r.prototype.iconBarButtons=function(){return this._iconBar.buttons()},r.prototype.layoutClick=function(e){var t=this;this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render(function(e){t.applyScaleOnLayout(!1)})},r.prototype.getOffsetPos=function(){return{x:0,y:0}},r.prototype.size=function(t){return e.prototype.size.apply(this,arguments)},r.prototype.clear=function(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)},r.prototype.data=function(t,r){var n=e.prototype.data.apply(this,arguments);if(arguments.length){r||(this._graphData=new Xc,this._renderCount=0);var o=this._graphData.setData(t.subgraphs||[],t.vertices||[],t.edges||[],t.hierarchy||[],r||!1);o.addedVertices.length&&this._dataHash++;var i=this;o.addedVertices.forEach(function(e){e._graphID=i._id}),o.addedEdges.forEach(function(e){e._graphID=i._id});var a={};this._graphData.edges().forEach(function(e){a[e._sourceVertex._id]||(a[e._sourceVertex._id]={}),a[e._sourceVertex._id][e._targetVertex._id]||(a[e._sourceVertex._id][e._targetVertex._id]=0);var t=++a[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)})}return n},r.prototype.graphData=function(){return this._graphData},r.prototype.selection=function(e){return arguments.length?(this._selection.set(e),this):this._selection.get()},r.prototype.linkcolor_default=function(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor},r.prototype.linktooltip_default=function(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip},r.prototype.dragstart=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.__drag_dx=n.x-e.x(),e.__drag_dy=n.y-e.y(),this._dragging=!0,this.forceLayout){n.active||this.forceLayout.force.alphaTarget(.3).restart();var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=o.x,o.fy=o.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map(function(r){return t.select(r.target()).raise(),{neighbor:r,offsetX:e.x()-r.x(),offsetY:e.y()-r.y()}}));for(var i=e.target(),a=i.nextSibling;a;)i.parentNode.insertBefore(a,i),a=i.nextSibling;t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=r._graphData.edge(e);r._pushMarkers(t.element())})}},r.prototype.dragging=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.move({x:n.x-e.__drag_dx,y:n.y-e.__drag_dy}),this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=n.x-e.__drag_dx,o.fy=n.y-e.__drag_dy}this._neighborOffsets.forEach(function(t){var o=n.x-e.__drag_dx-t.offsetX,i=n.y-e.__drag_dy-t.offsetY;if(r.forceLayout){var a=r.forceLayout.vertexMap[t.neighbor.id()];a.fixed=!0,a.fx=o,a.fy=i}t.neighbor.move({x:o,y:i})}),this.refreshIncidentEdges(e,!0)}},r.prototype.dragend=function(e){var r=this;if(this.allowDragging()){if(t.d3Event().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){var n=e.calcSnap(this.snapToGrid());e.move(n[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!1,o.fx=null,o.fy=null,this._neighborOffsets.forEach(function(e){var t=r.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null})}this._neighborOffsets=[],t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=this._graphData.edge(e);this._popMarkers(t.element())})}},r.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n),this._zoomGrab.on("click.clear",function(){o.selectionClearOnBackgroundClick()&&o._selection.clear()}),this._d3Drag=t.drag().on("start",function(e){return o.dragstart(e)}).on("end",function(e){return o.dragend(e)}).on("drag",function(e){return o.dragging(e)}),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new t.SVGGlowFilter(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")},r.prototype.getBounds=function(e,t){var r=[[null,null],[null,null]];return e.forEach(function(e){var n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},o=n.x-n.width/2,i=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>o)&&(r[0][0]=o),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<i)&&(r[1][0]=i),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)}),r},r.prototype.getVertexBounds=function(e){return this.getBounds(this._graphData.nodes(),e)},r.prototype.getSelectionBounds=function(e){return this.getBounds(this._selection.get(),e)},r.prototype.centerOnItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(o)},r.prototype.zoomToItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(o)},r.prototype.updateVertices=function(e,r,n){var o=this.width(),i=this.height(),a=this,s=e.selectAll("#"+this._id+r+" > .graphVertex").data(n,function(e){return e.id()});s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event()),a.selectionChanged()}).on("click",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",n,{vertex:e})}).on("dblclick",function(e){t.d3Event().stopPropagation();var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",n,{vertex:e})}).on("contextmenu",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",n,{vertex:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.vertex_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.vertex_mouseout(t.select(this),e)}).each(function(e){t.select(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||o/2,y:e.y()||i/2}).animationFrameRender(),a.allowDragging()&&t.select(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()){var t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}}))}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),s.order()},r.prototype.update=function(r,n){var o=this;e.prototype.update.call(this,r,n),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());var i=this.layout();this._toggleHierarchy.selected("Hierarchy"===i).render(),this._toggleForceDirected.selected("ForceDirected"===i).render(),this._toggleForceDirected2.selected("ForceDirected2"===i).render(),this._toggleCircle.selected("Circle"===i).render();var a=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter(function(e){return"Hierarchy"===o.layout()&&e instanceof Bl})),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter(function(e){return!(e instanceof Bl)}));var s=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],function(e){return e.id()});s.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event())}).on("click",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_click(a.rowToObj(e.data()),"",n,{edge:e})}).on("dblclick",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_dblclick(a.rowToObj(e.data()),"",n,{edge:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.edge_mouseout(t.select(this),e)}).each(function(e){e.target(this).animationFrameRender()}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))},r.prototype.exit=function(t,r){this._graphData.nodes().forEach(function(e){return e.target(null)}),this._graphData.edges().forEach(function(e){return e.target(null)}),e.prototype.exit.call(this,t,r)},r.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.doLayout().then(function(){r.progress("end"),t&&t(e)})}),this},r.prototype.doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(r,n){requestAnimationFrame(function(){t._prevLayout!==t.layout()||t._prevDataHash!==t._dataHash?(t._prevLayout=t.layout(),t._prevDataHash=t._dataHash,t._doLayout(e).then(function(){r()})):r()})})},r.prototype._doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(n,o){t.progress("layout-start"),t.forceLayout&&(t.forceLayout.force.stop(),t.forceLayout=null);var i=t,a=t.getLayoutEngine();if("ForceDirected2"===t.layout()){var s=0,u=0;t.forceLayout=a,t.forceLayout.force.on("tick",function(){var e=performance.now();i.progress("layout-tick"),a.vertices.forEach(function(e){if(e.fixed);else{var t=i._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}}),i._graphData.edges().forEach(function(e){e.points([],!1,!1)}),i.applyScaleOnLayout(),s+=performance.now()-e,++u,console.log("tick:"+s/u)}).on("end",function(){i.progress("layout-end")}),t.forceLayout.force.restart(),n()}else a&&(t.forceLayout=null,i._dragging=!0,i._graphData.nodes().forEach(function(e){var t=a.nodePos(e._id);e instanceof r.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)}),i._graphData.edges().forEach(function(t){var r=a.edgePoints(t);t.points(r,e)}),i.applyScaleOnLayout()&&requestAnimationFrame(function(){i.zoomToFit(),n()}),t._fixIEMarkers(),setTimeout(function(){i._dragging=!1},e?e+50:50),t.progress("layout-end"),i.applyScaleOnLayout()||n())})},r.prototype.getLayoutEngine=function(){switch(this.layout()){case"Circle":return new Il(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new Tl(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 Tl(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 Ll(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},r.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.nodeEdges(e.id()),o=0;o<n.length;++o){var i=this._graphData.edge(n[o]);r[i.id()]=i,i._sourceVertex.id()!==e.id()&&(t[i._sourceVertex.id()]=i._sourceVertex),i._targetVertex.id()!==e.id()&&(t[i._targetVertex.id()]=i._targetVertex)}return{vertices:t,edges:r}},r.prototype.highlightVerticies=function(e){var t=this,r=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",function(t){return!e||e[t.id()]}).style("filter",function(r){return e&&e[r.id()]?"url(#"+t.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(t){return!e||e[t.id()]?1:r.highlight.opacity}),this},r.prototype.highlightEdges=function(e){var 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},r.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id()]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t._sourceVertex.id()]=t._sourceVertex,r[t._targetVertex.id()]=t._targetVertex;var n={};n[t.id()]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.refreshIncidentEdges=function(e,t){var r=this;this._graphData.nodeEdges(e.id()).forEach(function(e){r._graphData.edge(e).points([],!1,t)})},r.prototype.centroids=function(){return this._graphData.nodes().filter(function(e){return e.centroid()})},r.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){e._graphData.undirectedShortestPath(r.id(),n.id()).forEach(function(e){t[e.id()]=!0})})}),this.svgE.selectAll(".graphEdge").classed("shortest-path",function(e){return!0===t[e.id()]})}},r.prototype.vertex_click=function(e,t,r,o){o&&o.vertex&&o.vertex._placeholderElement.node().parentNode.appendChild(o.vertex._placeholderElement.node()),n.IGraph.prototype.vertex_click.apply(this,arguments)},r.prototype.vertex_dblclick=function(e,t,r,n){},r.prototype.vertex_contextmenu=function(e,t,r,n){},r.prototype.vertex_mouseover=function(e,t){this.highlightVertex(e,t)},r.prototype.vertex_mouseout=function(e,t){this.highlightVertex(null,null)},r.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},r.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},r.prototype.addMarkers=function(e){void 0===e&&(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)},r.prototype.progress=function(e){},r.Subgraph=Bl,r.Vertex=zl,r.Edge=R,r.profileID=0,r}(t.SVGZoomWidget);Vl.prototype._class+=" graph_Graph",Vl.prototype.implements(n.IGraph.prototype),Vl.prototype.implements(n.ITooltip.prototype),Vl.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),Vl.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),Vl.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),Vl.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),Vl.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),Vl.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),Vl.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),Vl.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Vl.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),Vl.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),Vl.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),Vl.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});var Gl=Vl.prototype.scale;Vl.prototype.scale=function(e,t){var r=Gl.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var Hl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.iconColumn()},t.prototype.indexes=function(){var 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())}},t.prototype.mapper=function(){var e=this,t=this.indexes();return function(r){return{faChar:r[t.iconCol],tooltip:r[t.tooltipCol],shape_colorFill:r[t.shapeFillCol]||e.shapeFillDefault(),shape_colorStroke:r[t.shapeStrokeCol]||e.shapeStrokeDefault(),image_colorFill:r[t.iconFillCol]||e.iconFillDefault()}}},t}(t.PropertyExt);Hl.prototype._class+=" graph_Annotation",Hl.prototype.publish("iconColumn","","set","Icon column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),Hl.prototype.publish("iconFillColumn","","set","Icon fill color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("tooltipColumn","","set","Tooltip column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),Hl.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),Hl.prototype.publish("shapeFillColumn","","set","Shape fill color column",function(){return this._owner.columns()},{optional:!0});var Ul=function(e){function t(){var t=e.call(this)||this;return t._vertexMap={},t._edgeMap={},t._merge=!1,t._adjacencyData=[],t}return s(t,e),t.prototype.linksColumns=function(){var e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map(function(e){return e.label()}):[]},t.prototype.validAnnotations=function(){return this.annotations().filter(function(e){return e.valid()})},t.prototype.updateData=function(){var t=this,n=r.hashSum([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map(function(e){return e.hashSum()})]);if(this._prevAdjacencyDataHash!==n){this._prevAdjacencyDataHash=n;for(var o=this.columns(),i=o.indexOf(this.uidColumn()),a=o.indexOf(this.labelColumn()),s=o.indexOf(this.iconColumn()),u=o.indexOf(this.linksColumn()),c=this.linksColumns(),l=c.indexOf(this.linkUidColumn()),h=c.indexOf(this.linkLabelColumn()),f=this.validAnnotations().map(function(e){return e.mapper()}),d={},p={},g={vertices:this._adjacencyData.map(function(e){var r=e[i];if(void 0!==r){var n=d[r]||t._vertexMap[r];return n||(n=new zl),d[r]=n,n.text(e[a]).data(e).faChar(e[s]).annotationIcons(f.map(function(t){return t(e)})),n}}).filter(function(e){return!!e}),edges:[]},v=0,y=this._adjacencyData;v<y.length;v++){var m=y[v],_=m[i],b=m[u];if(void 0!==_&&void 0!==b)for(var w=0,x=b;w<x.length;w++){var E=x[w],k=E[l],D=E[h],S=_+"->"+k,C=p[S]||this._edgeMap[S];C||(d[_]&&d[k]?C=(new R).sourceVertex(d[_]).targetVertex(d[k]).data(E):console.log("Missing vertices for edge: "+S)),C&&(C.text(D),p[S]=C,g.edges.push(C))}}this._vertexMap=d,this._edgeMap=p,e.prototype.data.call(this,g,this._merge)}},t.prototype.data=function(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.")},t.prototype.update=function(t,r){this.updateData(),e.prototype.update.call(this,t,r)},t.prototype.click=function(e,t,r){console.log("click")},t}(Vl);function Wl(e,t){return e.sourceLinks.length?e.depth:t-1}function ql(e){return function(){return e}}function Yl(e,t){return Xl(e.source,t.source)||e.index-t.index}function $l(e,t){return Xl(e.target,t.target)||e.index-t.index}function Xl(e,t){return e.y0-t.y0}function Jl(e){return e.value}function Kl(e){return e.index}function Zl(e){return e.nodes}function eh(e){return e.links}function th(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function rh({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(const e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function nh(){let e,r,n,o=0,i=0,a=1,s=1,u=24,c=8,l=Kl,h=Wl,f=Zl,d=eh,p=6;function g(){const g={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];const r=new Map(e.map((t,r)=>[l(t,r,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:o}=n;"object"!=typeof t&&(t=n.source=th(r,t)),"object"!=typeof o&&(o=n.target=th(r,o)),t.sourceLinks.push(n),o.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}(g),function({nodes:e}){for(const r of e)r.value=void 0===r.fixedValue?Math.max(t.sum(r.sourceLinks,Jl),t.sum(r.targetLinks,Jl)):r.fixedValue}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.depth=o;for(const{target:t}of e.sourceLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.height=o;for(const{source:t}of e.targetLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function(n){const l=function({nodes:e}){const n=t.max(e,e=>e.depth)+1,i=(a-o-u)/(n-1),s=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(h.call(null,t,n))));t.layer=e,t.x0=o+e*i,t.x1=t.x0+u,s[e]?s[e].push(t):s[e]=[t]}if(r)for(const e of s)e.sort(r);return s}(n);e=Math.min(c,(s-i)/(t.max(l,e=>e.length)-1)),function(r){const n=t.min(r,r=>(s-i-(r.length-1)*e)/t.sum(r,Jl));for(const t of r){let r=i;for(const o of t){o.y0=r,o.y1=r+o.value*n,r=o.y1+e;for(const e of o.sourceLinks)e.width=e.value*n}r=(s-r+e)/(t.length+1);for(let e=0;e<t.length;++e){const n=t[e];n.y0+=r*(e+1),n.y1+=r*(e+1)}x(t)}}(l);for(let e=0;e<p;++e){const t=Math.pow(.99,e),r=Math.max(1-t,(e+1)/p);y(l,t,r),v(l,t,r)}}(g),rh(g),g}function v(e,t,n){for(let o=1,i=e.length;o<i;++o){const i=e[o];for(const e of i){let r=0,n=0;for(const{source:t,value:o}of e.targetLinks){let i=o*(e.layer-t.layer);r+=E(t,e)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function y(e,t,n){for(let o=e.length-2;o>=0;--o){const i=e[o];for(const e of i){let r=0,n=0;for(const{target:t,value:o}of e.sourceLinks){let i=o*(t.layer-e.layer);r+=k(e,t)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function m(t,r){const n=t.length>>1,o=t[n];b(t,o.y0-e,n-1,r),_(t,o.y1+e,n+1,r),b(t,s,t.length-1,r),_(t,i,0,r)}function _(t,r,n,o){for(;n<t.length;++n){const i=t[n],a=(r-i.y0)*o;a>1e-6&&(i.y0+=a,i.y1+=a),r=i.y1+e}}function b(t,r,n,o){for(;n>=0;--n){const i=t[n],a=(i.y1-r)*o;a>1e-6&&(i.y0-=a,i.y1-=a),r=i.y0-e}}function w({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort($l);for(const{target:{targetLinks:t}}of e)t.sort(Yl)}}function x(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort($l),r.sort(Yl)}function E(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:o,width:i}of t.sourceLinks){if(o===r)break;n+=i+e}for(const{source:e,width:o}of r.targetLinks){if(e===t)break;n-=o}return n}function k(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:o,width:i}of r.targetLinks){if(o===t)break;n+=i+e}for(const{target:e,width:o}of t.sourceLinks){if(e===r)break;n-=o}return n}return g.update=function(e){return rh(e),e},g.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:ql(e),g):l},g.nodeAlign=function(e){return arguments.length?(h="function"==typeof e?e:ql(e),g):h},g.nodeSort=function(e){return arguments.length?(r=e,g):r},g.nodeWidth=function(e){return arguments.length?(u=+e,g):u},g.nodePadding=function(t){return arguments.length?(c=e=+t,g):c},g.nodes=function(e){return arguments.length?(f="function"==typeof e?e:ql(e),g):f},g.links=function(e){return arguments.length?(d="function"==typeof e?e:ql(e),g):d},g.linkSort=function(e){return arguments.length?(n=e,g):n},g.size=function(e){return arguments.length?(o=i=0,a=+e[0],s=+e[1],g):[a-o,s-i]},g.extent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],i=+e[0][1],s=+e[1][1],g):[[o,i],[a,s]]},g.iterations=function(e){return arguments.length?(p=+e,g):p},g}function oh(e){return[e.source.x1,e.y0]}function ih(e){return[e.target.x0,e.y1]}function ah(){return A().source(oh).target(ih)}Ul.prototype._class+=" graph_AdjacencyGraph",Ul.prototype.publish("uidColumn","","set","UID column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("labelColumn","","set","Label column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("iconColumn","","set","Icon column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linksColumn","","set","Links column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linkUidColumn","","set","Link UID column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("linkLabelColumn","","set","Link Label column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:Hl});L(".graph_Sankey .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_Sankey .node.selected rect{stroke:red}.graph_Sankey .node.over rect{stroke:orange}.graph_Sankey .node.selected.over rect{stroke:red}.graph_Sankey .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_Sankey .node.selected text{fill:red}.graph_Sankey .node.over text{fill:orange}.graph_Sankey .node.selected.over text{fill:red}.graph_Sankey .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_Sankey .link:hover{stroke-opacity:.5}");var sh={mean:t.mean,median:t.median,min:t.min,max:t.max,sum:t.sum},uh=function(e){function t(){return e.call(this)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.column()},t.prototype.aggregate=function(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:var t=this._owner.columns().indexOf(this.aggrColumn());return sh[this.aggrType()](e,function(e){return+e[t]})}},t}(t.PropertyExt);uh.prototype._class+=" graph_Sankey.SankeyColumn",uh.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0}),uh.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:function(e){return!e._owner||0===e._owner.mappings().indexOf(e)}}),uh.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this._owner?this._owner.columns():[]},{optional:!0,disable:function(e){return!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e)}});var ch=function(e){function r(){var r=e.call(this)||this;return t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(r,e),r.prototype.sankeyData=function(){var e={vertices:[],edges:[]};if(0===this.data().length)return e;var t={},r=this.mappings().filter(function(e){return e.valid()});return r.forEach(function(r,n){this._db.rollupView([r.column()]).entries().forEach(function(o){var i=r.column()+":"+n+":"+o.key;t[i]||(e.vertices.push({__id:i,__category:r.column(),name:o.key,origRow:o.value,value:o.value[n][2]}),t[i]=e.vertices.length-1)},this)},this),r.forEach(function(n,o){if(o<r.length-1){var i=r[o+1];this._db.rollupView([n.column(),i.column()]).entries().forEach(function(r){var a=n.column()+":"+o+":"+r.key;r.values.forEach(function(r){var n=i.column()+":"+(o+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})})})}},this),e},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=new nh,this._selection.widgetElement(r)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData(),a=2*o;this._d3Sankey.extent([[o,o],[this.width()-a,this.height()-a]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:i.vertices,links:i.edges});var s=this,u=n.selectAll(".link").data(i.edges);u.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(u).attr("d",ah()).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}),u.exit().remove();var c=n.selectAll(".node").data(i.vertices);c.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){s.click(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).on("dblclick",function(e){s.dblclick(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(c).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",s._d3Sankey.nodeWidth()).style("fill",function(e){return s._palette(e.name)}).style("stroke",function(e){return s.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",s.xAxisMovement()||s.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<s.width()/2}).attr("x",6+s._d3Sankey.nodeWidth()).attr("text-anchor","start")}),c.exit().remove()},r.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},r.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},r.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},r}(t.SVGWidget);ch.prototype._class+=" graph_Sankey",ch.prototype.Column=uh,ch.prototype.mixin(t.Utility.SimpleSelectionMixin),ch.prototype._palette=t.Palette.ordinal("default"),ch.prototype.publish("paletteID","default","set","Color palette for this widget",ch.prototype._palette.switch()),ch.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:uh}),ch.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),ch.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),ch.prototype.publish("vertexWidth",36,"number","Vertex Width"),ch.prototype.publish("vertexPadding",40,"number","Vertex Padding"),ch.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),ch.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement");var lh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),hh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(I),fh=function(){function e(e){this._running=!1,this._graph=e}return e.prototype.start=function(){return this._running=!0,this._graph.progress("layout-start"),Promise.resolve(this)},e.prototype.stop=function(){return this._running=!1,this._graph.progress("layout-stop"),this},e.prototype.running=function(){return this._running},e.prototype.center=function(e){if(e.length%2==1)return e[Math.floor(e.length/2)];var t=e[e.length/2-1],r=e[e.length/2];return[(t[0]+r[0])/2,(t[1]+r[1])/2]},e.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target),o=[[r.x,r.y],[n.x,n.y]];if(t){var i=o[0][0]-o[1][0],a=o[0][1]-o[1][1];if(Math.sqrt(i*i+a*a)){var s=(o[0][0]+o[1][0])/2-a*t/100,u=(o[0][1]+o[1][1])/2+i*t/100;return{path:hh([o[0],[s,u],o[1]]),labelPos:[s,u]}}}return{path:lh(o),labelPos:this.center(o)}},e}(),dh=function(e){return e*Math.PI/180},ph=function(e){function t(t,r){void 0===r&&(r=60);var n=e.call(this,t)||this;return n.sideLength=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices();r.allEdges().forEach(function(e){return delete e.points});var o,i=(o=n.length,t.sideLength/(2*Math.sin(dh(180/o)))),a=360/n.length;return n.forEach(function(t,r){delete t.fx,delete t.fy,t.x=e.width/2+Math.cos(dh(r*a))*i,t.y=e.height/2+Math.sin(dh(r*a))*i}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t._running=!1,t})},t}(fh);var gh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),vh=function(e){return"cluster_"+e};function yh(e,t,r,n){var o=e-r,i=t-n;return Math.sqrt(o*o+i*i)}var mh=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData();return function(e,t){var r=new Blob(['!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return r(null==n&&t.path)}},t.exports),t.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var t=function(){this.__data__=[],this.size=0};var o=function(e,n){return e===n||e!=e&&n!=n};var i=function(e,n){for(var r=e.length;r--;)if(o(e[r][0],n))return r;return-1},a=Array.prototype.splice;var u=function(e){var n=this.__data__,r=i(n,e);return!(r<0||(r==n.length-1?n.pop():a.call(n,r,1),--this.size,0))};var c=function(e){var n=this.__data__,r=i(n,e);return r<0?void 0:n[r][1]};var s=function(e){return i(this.__data__,e)>-1};var f=function(e,n){var r=this.__data__,t=i(r,e);return t<0?(++this.size,r.push([e,n])):r[t][1]=n,this};function d(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}d.prototype.clear=t,d.prototype.delete=u,d.prototype.get=c,d.prototype.has=s,d.prototype.set=f;var h=d;var v=function(){this.__data__=new h,this.size=0};var l=function(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r};var p=function(e){return this.__data__.get(e)};var g=function(e){return this.__data__.has(e)},y="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,_=y||b||Function("return this")(),m=_.Symbol,w=Object.prototype,E=w.hasOwnProperty,j=w.toString,k=m?m.toStringTag:void 0;var x=function(e){var n=E.call(e,k),r=e[k];try{e[k]=void 0;var t=!0}catch(e){}var o=j.call(e);return t&&(n?e[k]=r:delete e[k]),o},N=Object.prototype.toString;var O=function(e){return N.call(e)},I="[object Null]",A="[object Undefined]",C=m?m.toStringTag:void 0;var M=function(e){return null==e?void 0===e?A:I:C&&C in Object(e)?x(e):O(e)};var S=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},P="[object AsyncFunction]",L="[object Function]",T="[object GeneratorFunction]",F="[object Proxy]";var R,z=function(e){if(!S(e))return!1;var n=M(e);return n==L||n==T||n==P||n==F},D=_["__core-js_shared__"],U=(R=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";var B=function(e){return!!U&&U in e},G=Function.prototype.toString;var V=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\\[object .+?Constructor\\]$/,Y=Function.prototype,$=Object.prototype,W=Y.toString,K=$.hasOwnProperty,J=RegExp("^"+W.call(K).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");var Q=function(e){return!(!S(e)||B(e))&&(z(e)?J:q).test(V(e))};var H=function(e,n){return null==e?void 0:e[n]};var X=function(e,n){var r=H(e,n);return Q(r)?r:void 0},Z=X(_,"Map"),ee=X(Object,"create");var ne=function(){this.__data__=ee?ee(null):{},this.size=0};var re=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},te="__lodash_hash_undefined__",oe=Object.prototype.hasOwnProperty;var ie=function(e){var n=this.__data__;if(ee){var r=n[e];return r===te?void 0:r}return oe.call(n,e)?n[e]:void 0},ae=Object.prototype.hasOwnProperty;var ue=function(e){var n=this.__data__;return ee?void 0!==n[e]:ae.call(n,e)},ce="__lodash_hash_undefined__";var se=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ee&&void 0===n?ce:n,this};function fe(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}fe.prototype.clear=ne,fe.prototype.delete=re,fe.prototype.get=ie,fe.prototype.has=ue,fe.prototype.set=se;var de=fe;var he=function(){this.size=0,this.__data__={hash:new de,map:new(Z||h),string:new de}};var ve=function(e){var n=typeof e;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e};var le=function(e,n){var r=e.__data__;return ve(n)?r["string"==typeof n?"string":"hash"]:r.map};var pe=function(e){var n=le(this,e).delete(e);return this.size-=n?1:0,n};var ge=function(e){return le(this,e).get(e)};var ye=function(e){return le(this,e).has(e)};var be=function(e,n){var r=le(this,e),t=r.size;return r.set(e,n),this.size+=r.size==t?0:1,this};function _e(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}_e.prototype.clear=he,_e.prototype.delete=pe,_e.prototype.get=ge,_e.prototype.has=ye,_e.prototype.set=be;var me=_e,we=200;var Ee=function(e,n){var r=this.__data__;if(r instanceof h){var t=r.__data__;if(!Z||t.length<we-1)return t.push([e,n]),this.size=++r.size,this;r=this.__data__=new me(t)}return r.set(e,n),this.size=r.size,this};function je(e){var n=this.__data__=new h(e);this.size=n.size}je.prototype.clear=v,je.prototype.delete=l,je.prototype.get=p,je.prototype.has=g,je.prototype.set=Ee;var ke=je;var xe=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t&&!1!==n(e[r],r,e););return e},Ne=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Oe=function(e,n,r){"__proto__"==n&&Ne?Ne(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r},Ie=Object.prototype.hasOwnProperty;var Ae=function(e,n,r){var t=e[n];Ie.call(e,n)&&o(t,r)&&(void 0!==r||n in e)||Oe(e,n,r)};var Ce=function(e,n,r,t){var o=!r;r||(r={});for(var i=-1,a=n.length;++i<a;){var u=n[i],c=t?t(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?Oe(r,u,c):Ae(r,u,c)}return r};var Me=function(e,n){for(var r=-1,t=Array(e);++r<e;)t[r]=n(r);return t};var Se=function(e){return null!=e&&"object"==typeof e},Pe="[object Arguments]";var Le=function(e){return Se(e)&&M(e)==Pe},Te=Object.prototype,Fe=Te.hasOwnProperty,Re=Te.propertyIsEnumerable,ze=Le(function(){return arguments}())?Le:function(e){return Se(e)&&Fe.call(e,"callee")&&!Re.call(e,"callee")},De=Array.isArray;var Ue=function(){return!1},Be=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=(o?o.isBuffer:void 0)||Ue;e.exports=i}),Ge=9007199254740991,Ve=/^(?:0|[1-9]\\d*)$/;var qe=function(e,n){var r=typeof e;return!!(n=null==n?Ge:n)&&("number"==r||"symbol"!=r&&Ve.test(e))&&e>-1&&e%1==0&&e<n},Ye=9007199254740991;var $e=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ye},We={};We["[object Float32Array]"]=We["[object Float64Array]"]=We["[object Int8Array]"]=We["[object Int16Array]"]=We["[object Int32Array]"]=We["[object Uint8Array]"]=We["[object Uint8ClampedArray]"]=We["[object Uint16Array]"]=We["[object Uint32Array]"]=!0,We["[object Arguments]"]=We["[object Array]"]=We["[object ArrayBuffer]"]=We["[object Boolean]"]=We["[object DataView]"]=We["[object Date]"]=We["[object Error]"]=We["[object Function]"]=We["[object Map]"]=We["[object Number]"]=We["[object Object]"]=We["[object RegExp]"]=We["[object Set]"]=We["[object String]"]=We["[object WeakMap]"]=!1;var Ke=function(e){return Se(e)&&$e(e.length)&&!!We[M(e)]};var Je=function(e){return function(n){return e(n)}},Qe=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r&&y.process,i=function(){try{var e=t&&t.require&&t.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),He=Qe&&Qe.isTypedArray,Xe=He?Je(He):Ke,Ze=Object.prototype.hasOwnProperty;var en=function(e,n){var r=De(e),t=!r&&ze(e),o=!r&&!t&&Be(e),i=!r&&!t&&!o&&Xe(e),a=r||t||o||i,u=a?Me(e.length,String):[],c=u.length;for(var s in e)!n&&!Ze.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||qe(s,c))||u.push(s);return u},nn=Object.prototype;var rn=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||nn)};var tn=function(e,n){return function(r){return e(n(r))}},on=tn(Object.keys,Object),an=Object.prototype.hasOwnProperty;var un=function(e){if(!rn(e))return on(e);var n=[];for(var r in Object(e))an.call(e,r)&&"constructor"!=r&&n.push(r);return n};var cn=function(e){return null!=e&&$e(e.length)&&!z(e)};var sn=function(e){return cn(e)?en(e):un(e)};var fn=function(e,n){return e&&Ce(n,sn(n),e)};var dn=function(e){var n=[];if(null!=e)for(var r in Object(e))n.push(r);return n},hn=Object.prototype.hasOwnProperty;var vn=function(e){if(!S(e))return dn(e);var n=rn(e),r=[];for(var t in e)("constructor"!=t||!n&&hn.call(e,t))&&r.push(t);return r};var ln=function(e){return cn(e)?en(e,!0):vn(e)};var pn=function(e,n){return e&&Ce(n,ln(n),e)},gn=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var r=e.length,t=i?i(r):new e.constructor(r);return e.copy(t),t}});var yn=function(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n};var bn=function(e,n){for(var r=-1,t=null==e?0:e.length,o=0,i=[];++r<t;){var a=e[r];n(a,r,e)&&(i[o++]=a)}return i};var _n=function(){return[]},mn=Object.prototype.propertyIsEnumerable,wn=Object.getOwnPropertySymbols,En=wn?function(e){return null==e?[]:(e=Object(e),bn(wn(e),function(n){return mn.call(e,n)}))}:_n;var jn=function(e,n){return Ce(e,En(e),n)};var kn=function(e,n){for(var r=-1,t=n.length,o=e.length;++r<t;)e[o+r]=n[r];return e},xn=tn(Object.getPrototypeOf,Object),Nn=Object.getOwnPropertySymbols?function(e){for(var n=[];e;)kn(n,En(e)),e=xn(e);return n}:_n;var On=function(e,n){return Ce(e,Nn(e),n)};var In=function(e,n,r){var t=n(e);return De(e)?t:kn(t,r(e))};var An=function(e){return In(e,sn,En)};var Cn=function(e){return In(e,ln,Nn)},Mn=X(_,"DataView"),Sn=X(_,"Promise"),Pn=X(_,"Set"),Ln=X(_,"WeakMap"),Tn=V(Mn),Fn=V(Z),Rn=V(Sn),zn=V(Pn),Dn=V(Ln),Un=M;(Mn&&"[object DataView]"!=Un(new Mn(new ArrayBuffer(1)))||Z&&"[object Map]"!=Un(new Z)||Sn&&"[object Promise]"!=Un(Sn.resolve())||Pn&&"[object Set]"!=Un(new Pn)||Ln&&"[object WeakMap]"!=Un(new Ln))&&(Un=function(e){var n=M(e),r="[object Object]"==n?e.constructor:void 0,t=r?V(r):"";if(t)switch(t){case Tn:return"[object DataView]";case Fn:return"[object Map]";case Rn:return"[object Promise]";case zn:return"[object Set]";case Dn:return"[object WeakMap]"}return n});var Bn=Un,Gn=Object.prototype.hasOwnProperty;var Vn=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&Gn.call(e,"index")&&(r.index=e.index,r.input=e.input),r},qn=_.Uint8Array;var Yn=function(e){var n=new e.constructor(e.byteLength);return new qn(n).set(new qn(e)),n};var $n=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Wn=/\\w*$/;var Kn=function(e){var n=new e.constructor(e.source,Wn.exec(e));return n.lastIndex=e.lastIndex,n},Jn=m?m.prototype:void 0,Qn=Jn?Jn.valueOf:void 0;var Hn=function(e){return Qn?Object(Qn.call(e)):{}};var Xn=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Zn="[object Boolean]",er="[object Date]",nr="[object Map]",rr="[object Number]",tr="[object RegExp]",or="[object Set]",ir="[object String]",ar="[object Symbol]",ur="[object ArrayBuffer]",cr="[object DataView]",sr="[object Float32Array]",fr="[object Float64Array]",dr="[object Int8Array]",hr="[object Int16Array]",vr="[object Int32Array]",lr="[object Uint8Array]",pr="[object Uint8ClampedArray]",gr="[object Uint16Array]",yr="[object Uint32Array]";var br=function(e,n,r){var t=e.constructor;switch(n){case ur:return Yn(e);case Zn:case er:return new t(+e);case cr:return $n(e,r);case sr:case fr:case dr:case hr:case vr:case lr:case pr:case gr:case yr:return Xn(e,r);case nr:return new t;case rr:case ir:return new t(e);case tr:return Kn(e);case or:return new t;case ar:return Hn(e)}},_r=Object.create,mr=function(){function e(){}return function(n){if(!S(n))return{};if(_r)return _r(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();var wr=function(e){return"function"!=typeof e.constructor||rn(e)?{}:mr(xn(e))},Er="[object Map]";var jr=function(e){return Se(e)&&Bn(e)==Er},kr=Qe&&Qe.isMap,xr=kr?Je(kr):jr,Nr="[object Set]";var Or=function(e){return Se(e)&&Bn(e)==Nr},Ir=Qe&&Qe.isSet,Ar=Ir?Je(Ir):Or,Cr=1,Mr=2,Sr=4,Pr="[object Arguments]",Lr="[object Function]",Tr="[object GeneratorFunction]",Fr="[object Object]",Rr={};Rr[Pr]=Rr["[object Array]"]=Rr["[object ArrayBuffer]"]=Rr["[object DataView]"]=Rr["[object Boolean]"]=Rr["[object Date]"]=Rr["[object Float32Array]"]=Rr["[object Float64Array]"]=Rr["[object Int8Array]"]=Rr["[object Int16Array]"]=Rr["[object Int32Array]"]=Rr["[object Map]"]=Rr["[object Number]"]=Rr[Fr]=Rr["[object RegExp]"]=Rr["[object Set]"]=Rr["[object String]"]=Rr["[object Symbol]"]=Rr["[object Uint8Array]"]=Rr["[object Uint8ClampedArray]"]=Rr["[object Uint16Array]"]=Rr["[object Uint32Array]"]=!0,Rr["[object Error]"]=Rr[Lr]=Rr["[object WeakMap]"]=!1;var zr=function e(n,r,t,o,i,a){var u,c=r&Cr,s=r&Mr,f=r&Sr;if(t&&(u=i?t(n,o,i,a):t(n)),void 0!==u)return u;if(!S(n))return n;var d=De(n);if(d){if(u=Vn(n),!c)return yn(n,u)}else{var h=Bn(n),v=h==Lr||h==Tr;if(Be(n))return gn(n,c);if(h==Fr||h==Pr||v&&!i){if(u=s||v?{}:wr(n),!c)return s?On(n,pn(u,n)):jn(n,fn(u,n))}else{if(!Rr[h])return i?n:{};u=br(n,h,c)}}a||(a=new ke);var l=a.get(n);if(l)return l;a.set(n,u),Ar(n)?n.forEach(function(o){u.add(e(o,r,t,o,n,a))}):xr(n)&&n.forEach(function(o,i){u.set(i,e(o,r,t,i,n,a))});var p=d?void 0:(f?s?Cn:An:s?ln:sn)(n);return xe(p||n,function(o,i){p&&(o=n[i=o]),Ae(u,i,e(o,r,t,i,n,a))}),u},Dr=4;var Ur=function(e){return zr(e,Dr)};var Br=function(e){return function(){return e}};var Gr=function(e){return function(n,r,t){for(var o=-1,i=Object(n),a=t(n),u=a.length;u--;){var c=a[e?u:++o];if(!1===r(i[c],c,i))break}return n}}();var Vr=function(e,n){return e&&Gr(e,n,sn)};var qr=function(e,n){return function(r,t){if(null==r)return r;if(!cn(r))return e(r,t);for(var o=r.length,i=n?o:-1,a=Object(r);(n?i--:++i<o)&&!1!==t(a[i],i,a););return r}}(Vr);var Yr=function(e){return e};var $r=function(e){return"function"==typeof e?e:Yr};var Wr=function(e,n){return(De(e)?xe:qr)(e,$r(n))},Kr=Wr;var Jr=function(e,n){var r=[];return qr(e,function(e,t,o){n(e,t,o)&&r.push(e)}),r},Qr="__lodash_hash_undefined__";var Hr=function(e){return this.__data__.set(e,Qr),this};var Xr=function(e){return this.__data__.has(e)};function Zr(e){var n=-1,r=null==e?0:e.length;for(this.__data__=new me;++n<r;)this.add(e[n])}Zr.prototype.add=Zr.prototype.push=Hr,Zr.prototype.has=Xr;var et=Zr;var nt=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t;)if(n(e[r],r,e))return!0;return!1};var rt=function(e,n){return e.has(n)},tt=1,ot=2;var it=function(e,n,r,t,o,i){var a=r&tt,u=e.length,c=n.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),f=i.get(n);if(s&&f)return s==n&&f==e;var d=-1,h=!0,v=r&ot?new et:void 0;for(i.set(e,n),i.set(n,e);++d<u;){var l=e[d],p=n[d];if(t)var g=a?t(p,l,d,n,e,i):t(l,p,d,e,n,i);if(void 0!==g){if(g)continue;h=!1;break}if(v){if(!nt(n,function(e,n){if(!rt(v,n)&&(l===e||o(l,e,r,t,i)))return v.push(n)})){h=!1;break}}else if(l!==p&&!o(l,p,r,t,i)){h=!1;break}}return i.delete(e),i.delete(n),h};var at=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e,t){r[++n]=[t,e]}),r};var ut=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e){r[++n]=e}),r},ct=1,st=2,ft="[object Boolean]",dt="[object Date]",ht="[object Error]",vt="[object Map]",lt="[object Number]",pt="[object RegExp]",gt="[object Set]",yt="[object String]",bt="[object Symbol]",_t="[object ArrayBuffer]",mt="[object DataView]",wt=m?m.prototype:void 0,Et=wt?wt.valueOf:void 0;var jt=function(e,n,r,t,i,a,u){switch(r){case mt:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case _t:return!(e.byteLength!=n.byteLength||!a(new qn(e),new qn(n)));case ft:case dt:case lt:return o(+e,+n);case ht:return e.name==n.name&&e.message==n.message;case pt:case yt:return e==n+"";case vt:var c=at;case gt:var s=t&ct;if(c||(c=ut),e.size!=n.size&&!s)return!1;var f=u.get(e);if(f)return f==n;t|=st,u.set(e,n);var d=it(c(e),c(n),t,i,a,u);return u.delete(e),d;case bt:if(Et)return Et.call(e)==Et.call(n)}return!1},kt=1,xt=Object.prototype.hasOwnProperty;var Nt=function(e,n,r,t,o,i){var a=r&kt,u=An(e),c=u.length;if(c!=An(n).length&&!a)return!1;for(var s=c;s--;){var f=u[s];if(!(a?f in n:xt.call(n,f)))return!1}var d=i.get(e),h=i.get(n);if(d&&h)return d==n&&h==e;var v=!0;i.set(e,n),i.set(n,e);for(var l=a;++s<c;){var p=e[f=u[s]],g=n[f];if(t)var y=a?t(g,p,f,n,e,i):t(p,g,f,e,n,i);if(!(void 0===y?p===g||o(p,g,r,t,i):y)){v=!1;break}l||(l="constructor"==f)}if(v&&!l){var b=e.constructor,_=n.constructor;b!=_&&"constructor"in e&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(v=!1)}return i.delete(e),i.delete(n),v},Ot=1,It="[object Arguments]",At="[object Array]",Ct="[object Object]",Mt=Object.prototype.hasOwnProperty;var St=function(e,n,r,t,o,i){var a=De(e),u=De(n),c=a?At:Bn(e),s=u?At:Bn(n),f=(c=c==It?Ct:c)==Ct,d=(s=s==It?Ct:s)==Ct,h=c==s;if(h&&Be(e)){if(!Be(n))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new ke),a||Xe(e)?it(e,n,r,t,o,i):jt(e,n,c,r,t,o,i);if(!(r&Ot)){var v=f&&Mt.call(e,"__wrapped__"),l=d&&Mt.call(n,"__wrapped__");if(v||l){var p=v?e.value():e,g=l?n.value():n;return i||(i=new ke),o(p,g,r,t,i)}}return!!h&&(i||(i=new ke),Nt(e,n,r,t,o,i))};var Pt=function e(n,r,t,o,i){return n===r||(null==n||null==r||!Se(n)&&!Se(r)?n!=n&&r!=r:St(n,r,t,o,e,i))},Lt=1,Tt=2;var Ft=function(e,n,r,t){var o=r.length,i=o,a=!t;if(null==e)return!i;for(e=Object(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=r[o])[0],s=e[c],f=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var d=new ke;if(t)var h=t(s,f,c,e,n,d);if(!(void 0===h?Pt(f,s,Lt|Tt,t,d):h))return!1}}return!0};var Rt=function(e){return e==e&&!S(e)};var zt=function(e){for(var n=sn(e),r=n.length;r--;){var t=n[r],o=e[t];n[r]=[t,o,Rt(o)]}return n};var Dt=function(e,n){return function(r){return null!=r&&r[e]===n&&(void 0!==n||e in Object(r))}};var Ut=function(e){var n=zt(e);return 1==n.length&&n[0][2]?Dt(n[0][0],n[0][1]):function(r){return r===e||Ft(r,e,n)}},Bt="[object Symbol]";var Gt=function(e){return"symbol"==typeof e||Se(e)&&M(e)==Bt},Vt=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,qt=/^\\w*$/;var Yt=function(e,n){if(De(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gt(e))||qt.test(e)||!Vt.test(e)||null!=n&&e in Object(n)},$t="Expected a function";function Wt(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new TypeError($t);var r=function(){var t=arguments,o=n?n.apply(this,t):t[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,t);return r.cache=i.set(o,a)||i,a};return r.cache=new(Wt.Cache||me),r}Wt.Cache=me;var Kt=Wt,Jt=500;var Qt=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ht=/\\\\(\\\\)?/g,Xt=function(e){var n=Kt(e,function(e){return r.size===Jt&&r.clear(),e}),r=n.cache;return n}(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(Qt,function(e,r,t,o){n.push(t?o.replace(Ht,"$1"):r||e)}),n});var Zt=function(e,n){for(var r=-1,t=null==e?0:e.length,o=Array(t);++r<t;)o[r]=n(e[r],r,e);return o},eo=1/0,no=m?m.prototype:void 0,ro=no?no.toString:void 0;var to=function e(n){if("string"==typeof n)return n;if(De(n))return Zt(n,e)+"";if(Gt(n))return ro?ro.call(n):"";var r=n+"";return"0"==r&&1/n==-eo?"-0":r};var oo=function(e){return null==e?"":to(e)};var io=function(e,n){return De(e)?e:Yt(e,n)?[e]:Xt(oo(e))},ao=1/0;var uo=function(e){if("string"==typeof e||Gt(e))return e;var n=e+"";return"0"==n&&1/e==-ao?"-0":n};var co=function(e,n){for(var r=0,t=(n=io(n,e)).length;null!=e&&r<t;)e=e[uo(n[r++])];return r&&r==t?e:void 0};var so=function(e,n,r){var t=null==e?void 0:co(e,n);return void 0===t?r:t};var fo=function(e,n){return null!=e&&n in Object(e)};var ho=function(e,n,r){for(var t=-1,o=(n=io(n,e)).length,i=!1;++t<o;){var a=uo(n[t]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++t!=o?i:!!(o=null==e?0:e.length)&&$e(o)&&qe(a,o)&&(De(e)||ze(e))};var vo=function(e,n){return null!=e&&ho(e,n,fo)},lo=1,po=2;var go=function(e,n){return Yt(e)&&Rt(n)?Dt(uo(e),n):function(r){var t=so(r,e);return void 0===t&&t===n?vo(r,e):Pt(n,t,lo|po)}};var yo=function(e){return function(n){return null==n?void 0:n[e]}};var bo=function(e){return function(n){return co(n,e)}};var _o=function(e){return Yt(e)?yo(uo(e)):bo(e)};var mo=function(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?De(e)?go(e[0],e[1]):Ut(e):_o(e)};var wo=function(e,n){return(De(e)?bn:Jr)(e,mo(n))},Eo=Object.prototype.hasOwnProperty;var jo=function(e,n){return null!=e&&Eo.call(e,n)};var ko=function(e,n){return null!=e&&ho(e,n,jo)},xo="[object Map]",No="[object Set]",Oo=Object.prototype.hasOwnProperty;var Io=function(e){if(null==e)return!0;if(cn(e)&&(De(e)||"string"==typeof e||"function"==typeof e.splice||Be(e)||Xe(e)||ze(e)))return!e.length;var n=Bn(e);if(n==xo||n==No)return!e.size;if(rn(e))return!un(e).length;for(var r in e)if(Oo.call(e,r))return!1;return!0};var Ao=function(e){return void 0===e};var Co=function(e,n){var r=-1,t=cn(e)?Array(e.length):[];return qr(e,function(e,o,i){t[++r]=n(e,o,i)}),t};var Mo=function(e,n){return(De(e)?Zt:Co)(e,mo(n))};var So=function(e,n,r,t){var o=-1,i=null==e?0:e.length;for(t&&i&&(r=e[++o]);++o<i;)r=n(r,e[o],o,e);return r};var Po=function(e,n,r,t,o){return o(e,function(e,o,i){r=t?(t=!1,e):n(r,e,o,i)}),r};var Lo=function(e,n,r){var t=De(e)?So:Po,o=arguments.length<3;return t(e,mo(n),r,o,qr)},To="[object String]";var Fo=function(e){return"string"==typeof e||!De(e)&&Se(e)&&M(e)==To},Ro=yo("length"),zo=RegExp("[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]");var Do=function(e){return zo.test(e)},Uo="[\\\\ud800-\\\\udfff]",Bo="[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]",Go="\\\\ud83c[\\\\udffb-\\\\udfff]",Vo="[^\\\\ud800-\\\\udfff]",qo="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Yo="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",$o="(?:"+Bo+"|"+Go+")"+"?",Wo="[\\\\ufe0e\\\\ufe0f]?"+$o+("(?:\\\\u200d(?:"+[Vo,qo,Yo].join("|")+")[\\\\ufe0e\\\\ufe0f]?"+$o+")*"),Ko="(?:"+[Vo+Bo+"?",Bo,qo,Yo,Uo].join("|")+")",Jo=RegExp(Go+"(?="+Go+")|"+Ko+Wo,"g");var Qo=function(e){for(var n=Jo.lastIndex=0;Jo.test(e);)++n;return n};var Ho=function(e){return Do(e)?Qo(e):Ro(e)},Xo="[object Map]",Zo="[object Set]";var ei=function(e){if(null==e)return 0;if(cn(e))return Fo(e)?Ho(e):e.length;var n=Bn(e);return n==Xo||n==Zo?e.size:un(e).length};var ni=function(e,n,r){var t=De(e),o=t||Be(e)||Xe(e);if(n=mo(n),null==r){var i=e&&e.constructor;r=o?t?new i:[]:S(e)&&z(i)?mr(xn(e)):{}}return(o?xe:Vr)(e,function(e,t,o){return n(r,e,t,o)}),r},ri=m?m.isConcatSpreadable:void 0;var ti=function(e){return De(e)||ze(e)||!!(ri&&e&&e[ri])};var oi=function e(n,r,t,o,i){var a=-1,u=n.length;for(t||(t=ti),i||(i=[]);++a<u;){var c=n[a];r>0&&t(c)?r>1?e(c,r-1,t,o,i):kn(i,c):o||(i[i.length]=c)}return i};var ii=function(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)},ai=Math.max;var ui=function(e,n,r){return n=ai(void 0===n?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=ai(t.length-n,0),a=Array(i);++o<i;)a[o]=t[n+o];o=-1;for(var u=Array(n+1);++o<n;)u[o]=t[o];return u[n]=r(a),ii(e,this,u)}},ci=Ne?function(e,n){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:Br(n),writable:!0})}:Yr,si=800,fi=16,di=Date.now;var hi=function(e){var n=0,r=0;return function(){var t=di(),o=fi-(t-r);if(r=t,o>0){if(++n>=si)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}(ci);var vi=function(e,n){return hi(ui(e,n,Yr),e+"")};var li=function(e,n,r,t){for(var o=e.length,i=r+(t?1:-1);t?i--:++i<o;)if(n(e[i],i,e))return i;return-1};var pi=function(e){return e!=e};var gi=function(e,n,r){for(var t=r-1,o=e.length;++t<o;)if(e[t]===n)return t;return-1};var yi=function(e,n,r){return n==n?gi(e,n,r):li(e,pi,r)};var bi=function(e,n){return!(null==e||!e.length)&&yi(e,n,0)>-1};var _i=function(e,n,r){for(var t=-1,o=null==e?0:e.length;++t<o;)if(r(n,e[t]))return!0;return!1};var mi=function(){},wi=Pn&&1/ut(new Pn([,-0]))[1]==1/0?function(e){return new Pn(e)}:mi,Ei=200;var ji=function(e,n,r){var t=-1,o=bi,i=e.length,a=!0,u=[],c=u;if(r)a=!1,o=_i;else if(i>=Ei){var s=n?null:wi(e);if(s)return ut(s);a=!1,o=rt,c=new et}else c=n?[]:u;e:for(;++t<i;){var f=e[t],d=n?n(f):f;if(f=r||0!==f?f:0,a&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;n&&c.push(d),u.push(f)}else o(c,d,r)||(c!==u&&c.push(d),u.push(f))}return u};var ki=function(e){return Se(e)&&cn(e)},xi=vi(function(e){return ji(oi(e,1,ki,!0))});var Ni=function(e,n){return Zt(n,function(n){return e[n]})};var Oi,Ii=function(e){return null==e?[]:Ni(e,sn(e))};try{Oi={clone:Ur,constant:Br,each:Kr,filter:wo,has:ko,isArray:De,isEmpty:Io,isFunction:z,isUndefined:Ao,keys:sn,map:Mo,reduce:Lo,size:ei,transform:ni,union:xi,values:Ii}}catch(e){}Oi||(Oi=window._);var Ai=Oi,Ci=Li,Mi="\\0",Si="\\0",Pi="";function Li(e){this._isDirected=!Ai.has(e,"directed")||e.directed,this._isMultigraph=!!Ai.has(e,"multigraph")&&e.multigraph,this._isCompound=!!Ai.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=Ai.constant(void 0),this._defaultEdgeLabelFn=Ai.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Si]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Ti(e,n){e[n]?e[n]++:e[n]=1}function Fi(e,n){--e[n]||delete e[n]}function Ri(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+Pi+i+Pi+(Ai.isUndefined(t)?Mi:t)}function zi(e,n){return Ri(e,n.v,n.w,n.name)}Li.prototype._nodeCount=0,Li.prototype._edgeCount=0,Li.prototype.isDirected=function(){return this._isDirected},Li.prototype.isMultigraph=function(){return this._isMultigraph},Li.prototype.isCompound=function(){return this._isCompound},Li.prototype.setGraph=function(e){return this._label=e,this},Li.prototype.graph=function(){return this._label},Li.prototype.setDefaultNodeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultNodeLabelFn=e,this},Li.prototype.nodeCount=function(){return this._nodeCount},Li.prototype.nodes=function(){return Ai.keys(this._nodes)},Li.prototype.sources=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._in[n])})},Li.prototype.sinks=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._out[n])})},Li.prototype.setNodes=function(e,n){var r=arguments,t=this;return Ai.each(e,function(e){r.length>1?t.setNode(e,n):t.setNode(e)}),this},Li.prototype.setNode=function(e,n){return Ai.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Si,this._children[e]={},this._children[Si][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},Li.prototype.node=function(e){return this._nodes[e]},Li.prototype.hasNode=function(e){return Ai.has(this._nodes,e)},Li.prototype.removeNode=function(e){var n=this;if(Ai.has(this._nodes,e)){var r=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Ai.each(this.children(e),function(e){n.setParent(e)}),delete this._children[e]),Ai.each(Ai.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],Ai.each(Ai.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},Li.prototype.setParent=function(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ai.isUndefined(n))n=Si;else{for(var r=n+="";!Ai.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this},Li.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},Li.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(n!==Si)return n}},Li.prototype.children=function(e){if(Ai.isUndefined(e)&&(e=Si),this._isCompound){var n=this._children[e];if(n)return Ai.keys(n)}else{if(e===Si)return this.nodes();if(this.hasNode(e))return[]}},Li.prototype.predecessors=function(e){var n=this._preds[e];if(n)return Ai.keys(n)},Li.prototype.successors=function(e){var n=this._sucs[e];if(n)return Ai.keys(n)},Li.prototype.neighbors=function(e){var n=this.predecessors(e);if(n)return Ai.union(n,this.successors(e))},Li.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},Li.prototype.filterNodes=function(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Ai.each(this._nodes,function(r,t){e(t)&&n.setNode(t,r)}),Ai.each(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,r.edge(e))});var t={};return this._isCompound&&Ai.each(n.nodes(),function(e){n.setParent(e,function e(o){var i=r.parent(o);return void 0===i||n.hasNode(i)?(t[o]=i,i):i in t?t[i]:e(i)}(e))}),n},Li.prototype.setDefaultEdgeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultEdgeLabelFn=e,this},Li.prototype.edgeCount=function(){return this._edgeCount},Li.prototype.edges=function(){return Ai.values(this._edgeObjs)},Li.prototype.setPath=function(e,n){var r=this,t=arguments;return Ai.reduce(e,function(e,o){return t.length>1?r.setEdge(e,o,n):r.setEdge(e,o),o}),this},Li.prototype.setEdge=function(){var e,n,r,t,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,n=i.w,r=i.name,2===arguments.length&&(t=arguments[1],o=!0)):(e=i,n=arguments[1],r=arguments[3],arguments.length>2&&(t=arguments[2],o=!0)),e=""+e,n=""+n,Ai.isUndefined(r)||(r=""+r);var a=Ri(this._isDirected,e,n,r);if(Ai.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=t),this;if(!Ai.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[a]=o?t:this._defaultEdgeLabelFn(e,n,r);var u=function(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};t&&(u.name=t);return u}(this._isDirected,e,n,r);return e=u.v,n=u.w,Object.freeze(u),this._edgeObjs[a]=u,Ti(this._preds[n],e),Ti(this._sucs[e],n),this._in[n][a]=u,this._out[e][a]=u,this._edgeCount++,this},Li.prototype.edge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return this._edgeLabels[t]},Li.prototype.hasEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return Ai.has(this._edgeLabels,t)},Li.prototype.removeEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r),o=this._edgeObjs[t];return o&&(e=o.v,n=o.w,delete this._edgeLabels[t],delete this._edgeObjs[t],Fi(this._preds[n],e),Fi(this._sucs[e],n),delete this._in[n][t],delete this._out[e][t],this._edgeCount--),this},Li.prototype.inEdges=function(e,n){var r=this._in[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.v===n}):t}},Li.prototype.outEdges=function(e,n){var r=this._out[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.w===n}):t}},Li.prototype.nodeEdges=function(e,n){var r=this.inEdges(e,n);if(r)return r.concat(this.outEdges(e,n))};var Di={Graph:Ci,version:"2.1.8"},Ui={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Bi(e),edges:Gi(e)};Ai.isUndefined(e.graph())||(n.value=Ai.clone(e.graph()));return n},read:function(e){var n=new Ci(e.options).setGraph(e.value);return Ai.each(e.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),Ai.each(e.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}};function Bi(e){return Ai.map(e.nodes(),function(n){var r=e.node(n),t=e.parent(n),o={v:n};return Ai.isUndefined(r)||(o.value=r),Ai.isUndefined(t)||(o.parent=t),o})}function Gi(e){return Ai.map(e.edges(),function(n){var r=e.edge(n),t={v:n.v,w:n.w};return Ai.isUndefined(n.name)||(t.name=n.name),Ai.isUndefined(r)||(t.value=r),t})}var Vi=function(e){var n,r={},t=[];function o(t){Ai.has(r,t)||(r[t]=!0,n.push(t),Ai.each(e.successors(t),o),Ai.each(e.predecessors(t),o))}return Ai.each(e.nodes(),function(e){n=[],o(e),n.length&&t.push(n)}),t};var qi=Yi;function Yi(){this._arr=[],this._keyIndices={}}Yi.prototype.size=function(){return this._arr.length},Yi.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Yi.prototype.has=function(e){return Ai.has(this._keyIndices,e)},Yi.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},Yi.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Yi.prototype.add=function(e,n){var r=this._keyIndices;if(e=String(e),!Ai.has(r,e)){var t=this._arr,o=t.length;return r[e]=o,t.push({key:e,priority:n}),this._decrease(o),!0}return!1},Yi.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},Yi.prototype.decrease=function(e,n){var r=this._keyIndices[e];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)},Yi.prototype._heapify=function(e){var n=this._arr,r=2*e,t=r+1,o=e;r<n.length&&(o=n[r].priority<n[o].priority?r:o,t<n.length&&(o=n[t].priority<n[o].priority?t:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Yi.prototype._decrease=function(e){for(var n,r=this._arr,t=r[e].priority;0!==e&&!(r[n=e>>1].priority<t);)this._swap(e,n),e=n},Yi.prototype._swap=function(e,n){var r=this._arr,t=this._keyIndices,o=r[e],i=r[n];r[e]=i,r[n]=o,t[i.key]=e,t[o.key]=n};var $i=function(e,n,r,t){return function(e,n,r,t){var o,i,a={},u=new qi,c=function(e){var n=e.v!==o?e.v:e.w,t=a[n],c=r(e),s=i.distance+c;if(c<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+c);s<t.distance&&(t.distance=s,t.predecessor=o,u.decrease(n,s))};e.nodes().forEach(function(e){var r=e===n?0:Number.POSITIVE_INFINITY;a[e]={distance:r},u.add(e,r)});for(;u.size()>0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)t(o).forEach(c);return a}(e,String(n),r||Wi,t||function(n){return e.outEdges(n)})},Wi=Ai.constant(1);var Ki=function(e,n,r){return Ai.transform(e.nodes(),function(t,o){t[o]=$i(e,o,n,r)},{})};var Ji=function(e){var n=0,r=[],t={},o=[];return e.nodes().forEach(function(i){Ai.has(t,i)||function i(a){var u=t[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),e.successors(a).forEach(function(e){Ai.has(t,e)?t[e].onStack&&(u.lowlink=Math.min(u.lowlink,t[e].index)):(i(e),u.lowlink=Math.min(u.lowlink,t[e].lowlink))}),u.lowlink===u.index){var c,s=[];do{c=r.pop(),t[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}(i)}),o};var Qi=function(e){return Ai.filter(Ji(e),function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])})};var Hi=function(e,n,r){return function(e,n,r){var t={},o=e.nodes();return o.forEach(function(e){t[e]={},t[e][e]={distance:0},o.forEach(function(n){e!==n&&(t[e][n]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=n(r);t[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var n=t[e];o.forEach(function(r){var i=t[r];o.forEach(function(r){var t=i[e],o=n[r],a=i[r],u=t.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)})})}),t}(e,n||Xi,r||function(n){return e.outEdges(n)})},Xi=Ai.constant(1);var Zi=ea;function ea(e){var n={},r={},t=[];if(Ai.each(e.sinks(),function o(i){if(Ai.has(r,i))throw new na;Ai.has(n,i)||(r[i]=!0,n[i]=!0,Ai.each(e.predecessors(i),o),delete r[i],t.push(i))}),Ai.size(n)!==e.nodeCount())throw new na;return t}function na(){}ea.CycleException=na,na.prototype=new Error;var ra=function(e,n,r){Ai.isArray(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return Ai.each(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);!function e(n,r,t,o,i,a){Ai.has(o,r)||(o[r]=!0,t||a.push(r),Ai.each(i(r),function(r){e(n,r,t,o,i,a)}),t&&a.push(r))}(e,n,"post"===r,i,t,o)}),o};var ta,oa={Graph:Di.Graph,json:Ui,alg:{components:Vi,dijkstra:$i,dijkstraAll:Ki,findCycles:Qi,floydWarshall:Hi,isAcyclic:function(e){try{Zi(e)}catch(e){if(e instanceof Zi.CycleException)return!1;throw e}return!0},postorder:function(e,n){return ra(e,n,"post")},preorder:function(e,n){return ra(e,n,"pre")},prim:function(e,n){var r,t=new Ci,o={},i=new qi;function a(e){var t=e.v===r?e.w:e.v,a=i.priority(t);if(void 0!==a){var u=n(e);u<a&&(o[t]=r,i.decrease(t,u))}}if(0===e.nodeCount())return t;Ai.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),t.setNode(e)}),i.decrease(e.nodes()[0],0);var u=!1;for(;i.size()>0;){if(r=i.removeMin(),Ai.has(o,r))t.setEdge(r,o[r]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(r).forEach(a)}return t},tarjan:Ji,topsort:Zi},version:Di.version};try{ta=oa}catch(e){}ta||(ta=window.graphlib);var ia=ta,aa=1,ua=4;var ca=function(e){return zr(e,aa|ua)};var sa=function(e,n,r){if(!S(r))return!1;var t=typeof n;return!!("number"==t?cn(r)&&qe(n,r.length):"string"==t&&n in r)&&o(r[n],e)},fa=Object.prototype,da=fa.hasOwnProperty,ha=vi(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&sa(n[0],n[1],i)&&(t=1);++r<t;)for(var a=n[r],u=ln(a),c=-1,s=u.length;++c<s;){var f=u[c],d=e[f];(void 0===d||o(d,fa[f])&&!da.call(e,f))&&(e[f]=a[f])}return e});var va=function(e){return function(n,r,t){var o=Object(n);if(!cn(n)){var i=mo(r);n=sn(n),r=function(e){return i(o[e],e,o)}}var a=e(n,r,t);return a>-1?o[i?n[a]:a]:void 0}},la=/\\s/;var pa=function(e){for(var n=e.length;n--&&la.test(e.charAt(n)););return n},ga=/^\\s+/;var ya=function(e){return e?e.slice(0,pa(e)+1).replace(ga,""):e},ba=NaN,_a=/^[-+]0x[0-9a-f]+$/i,ma=/^0b[01]+$/i,wa=/^0o[0-7]+$/i,Ea=parseInt;var ja=function(e){if("number"==typeof e)return e;if(Gt(e))return ba;if(S(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=S(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=ya(e);var r=ma.test(e);return r||wa.test(e)?Ea(e.slice(2),r?2:8):_a.test(e)?ba:+e},ka=1/0,xa=1.7976931348623157e308;var Na=function(e){return e?(e=ja(e))===ka||e===-ka?(e<0?-1:1)*xa:e==e?e:0:0===e?e:0};var Oa=function(e){var n=Na(e),r=n%1;return n==n?r?n-r:n:0},Ia=Math.max;var Aa=va(function(e,n,r){var t=null==e?0:e.length;if(!t)return-1;var o=null==r?0:Oa(r);return o<0&&(o=Ia(t+o,0)),li(e,mo(n),o)});var Ca=function(e){return null!=e&&e.length?oi(e,1):[]};var Ma=function(e,n){return null==e?e:Gr(e,$r(n),ln)};var Sa=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0};var Pa=function(e,n){var r={};return n=mo(n),Vr(e,function(e,t,o){Oe(r,t,n(e,t,o))}),r};var La=function(e,n,r){for(var t=-1,o=e.length;++t<o;){var i=e[t],a=n(i);if(null!=a&&(void 0===u?a==a&&!Gt(a):r(a,u)))var u=a,c=i}return c};var Ta=function(e,n){return e>n};var Fa=function(e){return e&&e.length?La(e,Yr,Ta):void 0};var Ra=function(e,n,r){(void 0===r||o(e[n],r))&&(void 0!==r||n in e)||Oe(e,n,r)},za="[object Object]",Da=Function.prototype,Ua=Object.prototype,Ba=Da.toString,Ga=Ua.hasOwnProperty,Va=Ba.call(Object);var qa=function(e){if(!Se(e)||M(e)!=za)return!1;var n=xn(e);if(null===n)return!0;var r=Ga.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&Ba.call(r)==Va};var Ya=function(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]};var $a=function(e){return Ce(e,ln(e))};var Wa=function(e,n,r,t,o,i,a){var u=Ya(e,r),c=Ya(n,r),s=a.get(c);if(s)Ra(e,r,s);else{var f=i?i(u,c,r+"",e,n,a):void 0,d=void 0===f;if(d){var h=De(c),v=!h&&Be(c),l=!h&&!v&&Xe(c);f=c,h||v||l?De(u)?f=u:ki(u)?f=yn(u):v?(d=!1,f=gn(c,!0)):l?(d=!1,f=Xn(c,!0)):f=[]:qa(c)||ze(c)?(f=u,ze(u)?f=$a(u):S(u)&&!z(u)||(f=wr(c))):d=!1}d&&(a.set(c,f),o(f,c,t,i,a),a.delete(c)),Ra(e,r,f)}};var Ka=function e(n,r,t,o,i){n!==r&&Gr(r,function(a,u){if(i||(i=new ke),S(a))Wa(n,r,u,t,e,o,i);else{var c=o?o(Ya(n,u),a,u+"",n,r,i):void 0;void 0===c&&(c=a),Ra(n,u,c)}},ln)};var Ja=function(e){return vi(function(n,r){var t=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&sa(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),n=Object(n);++t<o;){var u=r[t];u&&e(n,u,t,i)}return n})}(function(e,n,r){Ka(e,n,r)});var Qa=function(e,n){return e<n};var Ha=function(e){return e&&e.length?La(e,Yr,Qa):void 0};var Xa=function(e,n){return e&&e.length?La(e,mo(n),Qa):void 0},Za=function(){return _.Date.now()};var eu=function(e,n,r,t){if(!S(e))return e;for(var o=-1,i=(n=io(n,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=uo(n[o]),s=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];void 0===(s=t?t(f,c,u):void 0)&&(s=S(f)?f:qe(n[o+1])?[]:{})}Ae(u,c,s),u=u[c]}return e};var nu=function(e,n,r){for(var t=-1,o=n.length,i={};++t<o;){var a=n[t],u=co(e,a);r(u,a)&&eu(i,io(a,e),u)}return i};var ru=function(e,n){return nu(e,n,function(n,r){return vo(e,r)})};var tu=function(e){return hi(ui(e,void 0,Ca),e+"")}(function(e,n){return null==e?{}:ru(e,n)}),ou=Math.ceil,iu=Math.max;var au=function(e,n,r,t){for(var o=-1,i=iu(ou((n-e)/(r||1)),0),a=Array(i);i--;)a[t?i:++o]=e,e+=r;return a};var uu=function(e){return function(n,r,t){return t&&"number"!=typeof t&&sa(n,r,t)&&(r=t=void 0),n=Na(n),void 0===r?(r=n,n=0):r=Na(r),t=void 0===t?n<r?1:-1:Na(t),au(n,r,t,e)}}();var cu=function(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e};var su=function(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=Gt(e),a=void 0!==n,u=null===n,c=n==n,s=Gt(n);if(!u&&!s&&!i&&e>n||i&&a&&c&&!u&&!s||t&&a&&c||!r&&c||!o)return 1;if(!t&&!i&&!s&&e<n||s&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!c)return-1}return 0};var fu=function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var c=su(o[t],i[t]);if(c)return t>=u?c:c*("desc"==r[t]?-1:1)}return e.index-n.index};var du=function(e,n,r){n=n.length?Zt(n,function(e){return De(e)?function(n){return co(n,1===e.length?e[0]:e)}:e}):[Yr];var t=-1;n=Zt(n,Je(mo));var o=Co(e,function(e,r,o){return{criteria:Zt(n,function(n){return n(e)}),index:++t,value:e}});return cu(o,function(e,n){return fu(e,n,r)})},hu=vi(function(e,n){if(null==e)return[];var r=n.length;return r>1&&sa(e,n[0],n[1])?n=[]:r>2&&sa(n[0],n[1],n[2])&&(n=[n[0]]),du(e,oi(n,1),[])}),vu=0;var lu=function(e){var n=++vu;return oo(e)+n};var pu=function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a};var gu,yu=function(e,n){return pu(e||[],n||[],Ae)};try{gu={cloneDeep:ca,constant:Br,defaults:ha,each:Kr,filter:wo,find:Aa,flatten:Ca,forEach:Wr,forIn:Ma,has:ko,isUndefined:Ao,last:Sa,map:Mo,mapValues:Pa,max:Fa,merge:Ja,min:Ha,minBy:Xa,now:Za,pick:tu,range:uu,reduce:Lo,sortBy:hu,uniqueId:lu,values:Ii,zipObject:yu}}catch(e){}gu||(gu=window._);var bu=gu,_u=mu;function mu(){var e={};e._next=e._prev=e,this._sentinel=e}function wu(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Eu(e,n){if("_next"!==e&&"_prev"!==e)return n}mu.prototype.dequeue=function(){var e=this._sentinel,n=e._prev;if(n!==e)return wu(n),n},mu.prototype.enqueue=function(e){var n=this._sentinel;e._prev&&e._next&&wu(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n},mu.prototype.toString=function(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,Eu)),r=r._prev;return"["+e.join(", ")+"]"};var ju=ia.Graph,ku=function(e,n){if(e.nodeCount()<=1)return[];var r=function(e,n){var r=new ju,t=0,o=0;bu.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),bu.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=n(e),u=i+a;r.setEdge(e.v,e.w,u),o=Math.max(o,r.node(e.v).out+=a),t=Math.max(t,r.node(e.w).in+=a)});var i=bu.range(o+t+3).map(function(){return new _u}),a=t+1;return bu.forEach(r.nodes(),function(e){Ou(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,n||xu),t=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)Nu(e,n,r,t);for(;t=i.dequeue();)Nu(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(Nu(e,n,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return bu.flatten(bu.map(t,function(n){return e.outEdges(n.v,n.w)}),!0)},xu=bu.constant(1);function Nu(e,n,r,t,o){var i=o?[]:void 0;return bu.forEach(e.inEdges(t.v),function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Ou(n,r,u)}),bu.forEach(e.outEdges(t.v),function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Ou(n,r,a)}),e.removeNode(t.v),i}function Ou(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var Iu={run:function(e){var n="greedy"===e.graph().acyclicer?ku(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],r={},t={};return bu.forEach(e.nodes(),function o(i){bu.has(t,i)||(t[i]=!0,r[i]=!0,bu.forEach(e.outEdges(i),function(e){bu.has(r,e.w)?n.push(e):o(e.w)}),delete r[i])}),n}(e);bu.forEach(n,function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,bu.uniqueId("rev"))})},undo:function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}};var Au=ia.Graph,Cu={addDummyNode:Mu,simplify:function(e){var n=(new Au).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),n},asNonCompoundGraph:function(e){var n=new Au({multigraph:e.isMultigraph()}).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n},successorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.outEdges(n),function(n){r[n.w]=(r[n.w]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.inEdges(n),function(n){r[n.v]=(r[n.v]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},intersectRect:function(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,s=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*c>Math.abs(a)*s?(u<0&&(s=-s),r=s*a/u,t=s):(a<0&&(c=-c),r=c,t=c*u/a);return{x:o+r,y:i+t}},buildLayerMatrix:function(e){var n=bu.map(bu.range(Su(e)+1),function(){return[]});return bu.forEach(e.nodes(),function(r){var t=e.node(r),o=t.rank;bu.isUndefined(o)||(n[o][t.order]=r)}),n},normalizeRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank}));bu.forEach(e.nodes(),function(r){var t=e.node(r);bu.has(t,"rank")&&(t.rank-=n)})},removeEmptyRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank})),r=[];bu.forEach(e.nodes(),function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=e.graph().nodeRankFactor;bu.forEach(r,function(n,r){bu.isUndefined(n)&&r%o!=0?--t:t&&bu.forEach(n,function(n){e.node(n).rank+=t})})},addBorderNode:function(e,n,r,t){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=t);return Mu(e,"border",o,n)},maxRank:Su,partition:function(e,n){var r={lhs:[],rhs:[]};return bu.forEach(e,function(e){n(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,n){var r=bu.now();try{return n()}finally{console.log(e+" time: "+(bu.now()-r)+"ms")}},notime:function(e,n){return n()}};function Mu(e,n,r,t){var o;do{o=bu.uniqueId(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function Su(e){return bu.max(bu.map(e.nodes(),function(n){var r=e.node(n).rank;if(!bu.isUndefined(r))return r}))}var Pu={run:function(e){e.graph().dummyChains=[],bu.forEach(e.edges(),function(n){!function(e,n){var r,t,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,s=n.name,f=e.edge(n),d=f.labelRank;if(c===a+1)return;for(e.removeEdge(n),o=0,++a;a<c;++o,++a)f.points=[],t={width:0,height:0,edgeLabel:f,edgeObj:n,rank:a},r=Cu.addDummyNode(e,"edge",t,"_d"),a===d&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),e.setEdge(i,r,{weight:f.weight},s),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,u,{weight:f.weight},s)}(e,n)})},undo:function(e){bu.forEach(e.graph().dummyChains,function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}};var Lu=function(e){var n={};bu.forEach(e.sources(),function r(t){var o=e.node(t);if(bu.has(n,t))return o.rank;n[t]=!0;var i=bu.min(bu.map(e.outEdges(t),function(n){return r(n.w)-e.edge(n).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},Tu=function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen};var Fu=ia.Graph,Ru=Tu,zu=function(e){var n,r,t=new Fu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();t.setNode(o,{});for(;Du(t,e)<i;)n=Uu(t,e),r=t.hasNode(n.v)?Ru(e,n):-Ru(e,n),Bu(t,e,r);return t};function Du(e,n){return bu.forEach(e.nodes(),function r(t){bu.forEach(n.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||Ru(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}),e.nodeCount()}function Uu(e,n){return bu.minBy(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Ru(n,r)})}function Bu(e,n,r){bu.forEach(e.nodes(),function(e){n.node(e).rank+=r})}var Gu=Tu,Vu=Lu,qu=ia.alg.preorder,Yu=ia.alg.postorder,$u=Cu.simplify,Wu=Ku;function Ku(e){e=$u(e),Vu(e);var n,r=zu(e);for(Hu(r),Ju(r,e);n=Xu(r);)ec(r,e,n,Zu(r,e,n))}function Ju(e,n){var r=Yu(e,e.nodes());r=r.slice(0,r.length-1),bu.forEach(r,function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=Qu(e,n,r)}(e,n,r)})}function Qu(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,bu.forEach(n.nodeEdges(r),function(i){var u,c,s=i.v===r,f=s?i.w:i.v;if(f!==t){var d=s===o,h=n.edge(i).weight;if(a+=d?h:-h,u=r,c=f,e.hasEdge(u,c)){var v=e.edge(r,f).cutvalue;a+=d?-v:v}}}),a}function Hu(e,n){arguments.length<2&&(n=e.nodes()[0]),function e(n,r,t,o,i){var a=t;var u=n.node(o);r[o]=!0;bu.forEach(n.neighbors(o),function(i){bu.has(r,i)||(t=e(n,r,t,i,o))});u.low=a;u.lim=t++;i?u.parent=i:delete u.parent;return t}(e,{},1,n)}function Xu(e){return bu.find(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Zu(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,c=!1;i.lim>a.lim&&(u=a,c=!0);var s=bu.filter(n.edges(),function(n){return c===nc(e,e.node(n.v),u)&&c!==nc(e,e.node(n.w),u)});return bu.minBy(s,function(e){return Gu(n,e)})}function ec(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),Hu(e),Ju(e,n),function(e,n){var r=bu.find(e.nodes(),function(e){return!n.node(e).parent}),t=qu(e,r);t=t.slice(1),bu.forEach(t,function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)})}(e,n)}function nc(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}Ku.initLowLimValues=Hu,Ku.initCutValues=Ju,Ku.calcCutValue=Qu,Ku.leaveEdge=Xu,Ku.enterEdge=Zu,Ku.exchangeEdges=ec;var rc=Lu,tc=function(e){switch(e.graph().ranker){case"network-simplex":ic(e);break;case"tight-tree":!function(e){rc(e),zu(e)}(e);break;case"longest-path":oc(e);break;default:ic(e)}};var oc=rc;function ic(e){Wu(e)}var ac=function(e){var n=function(e){var n={},r=0;return bu.forEach(e.children(),function t(o){var i=r;bu.forEach(e.children(o),t),n[o]={low:i,lim:r++}}),n}(e);bu.forEach(e.graph().dummyChains,function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],c=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||s>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,s=a[c],f=!0;r!==o.w;){if(t=e.node(r),f){for(;(s=a[c])!==u&&e.node(s).maxRank<t.rank;)c++;s===u&&(f=!1)}if(!f){for(;c<a.length-1&&e.node(s=a[c+1]).minRank<=t.rank;)c++;s=a[c]}e.setParent(r,s),r=e.successors(r)[0]}})};var uc={run:function(e){var n=Cu.addDummyNode(e,"root",{},"_root"),r=function(e){var n={};return bu.forEach(e.children(),function(r){!function r(t,o){var i=e.children(t);i&&i.length&&bu.forEach(i,function(e){r(e,o+1)}),n[t]=o}(r,1)}),n}(e),t=bu.max(bu.values(r))-1,o=2*t+1;e.graph().nestingRoot=n,bu.forEach(e.edges(),function(n){e.edge(n).minlen*=o});var i=function(e){return bu.reduce(e.edges(),function(n,r){return n+e.edge(r).weight},0)}(e)+1;bu.forEach(e.children(),function(a){!function e(n,r,t,o,i,a,u){var c=n.children(u);if(!c.length)return void(u!==r&&n.setEdge(r,u,{weight:0,minlen:t}));var s=Cu.addBorderNode(n,"_bt");var f=Cu.addBorderNode(n,"_bb");var d=n.node(u);n.setParent(s,u);d.borderTop=s;n.setParent(f,u);d.borderBottom=f;bu.forEach(c,function(c){e(n,r,t,o,i,a,c);var d=n.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,l=d.borderTop?o:2*o,p=h!==v?1:i-a[u]+1;n.setEdge(s,h,{weight:l,minlen:p,nestingEdge:!0}),n.setEdge(v,f,{weight:l,minlen:p,nestingEdge:!0})});n.parent(u)||n.setEdge(r,s,{weight:0,minlen:i+a[u]})}(e,n,o,i,t,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,bu.forEach(e.edges(),function(n){var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}};var cc=function(e){bu.forEach(e.children(),function n(r){var t=e.children(r);var o=e.node(r);t.length&&bu.forEach(t,n);if(bu.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)sc(e,"borderLeft","_bl",r,o,i),sc(e,"borderRight","_br",r,o,i)}})};function sc(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],c=Cu.addDummyNode(e,"border",a,r);o[n][i]=c,e.setParent(c,t),u&&e.setEdge(u,c,{weight:1})}var fc={adjust:function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||dc(e)},undo:function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){bu.forEach(e.nodes(),function(n){vc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,vc),bu.has(r,"y")&&vc(r)})}(e);"lr"!==n&&"rl"!==n||(!function(e){bu.forEach(e.nodes(),function(n){lc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,lc),bu.has(r,"x")&&lc(r)})}(e),dc(e))}};function dc(e){bu.forEach(e.nodes(),function(n){hc(e.node(n))}),bu.forEach(e.edges(),function(n){hc(e.edge(n))})}function hc(e){var n=e.width;e.width=e.height,e.height=n}function vc(e){e.y=-e.y}function lc(e){var n=e.x;e.x=e.y,e.y=n}var pc=function(e){var n={},r=bu.filter(e.nodes(),function(n){return!e.children(n).length}),t=bu.max(bu.map(r,function(n){return e.node(n).rank})),o=bu.map(bu.range(t+1),function(){return[]});var i=bu.sortBy(r,function(n){return e.node(n).rank});return bu.forEach(i,function r(t){if(!bu.has(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),bu.forEach(e.successors(t),r)}}),o};var gc=function(e,n){for(var r=0,t=1;t<n.length;++t)r+=yc(e,n[t-1],n[t]);return r};function yc(e,n,r){for(var t=bu.zipObject(r,bu.map(r,function(e,n){return n})),o=bu.flatten(bu.map(n,function(n){return bu.sortBy(bu.map(e.outEdges(n),function(n){return{pos:t[n.w],weight:e.edge(n).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var u=bu.map(new Array(a),function(){return 0}),c=0;return bu.forEach(o.forEach(function(e){var n=e.pos+i;u[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*r})),c}var bc=function(e,n){return bu.map(n,function(n){var r=e.inEdges(n);if(r.length){var t=bu.reduce(r,function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}},{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}})};var _c=function(e,n){var r={};return bu.forEach(e,function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};bu.isUndefined(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),bu.forEach(n.edges(),function(e){var n=r[e.v],t=r[e.w];bu.isUndefined(n)||bu.isUndefined(t)||(t.indegree++,n.out.push(r[e.w]))}),function(e){var n=[];function r(e){return function(n){var r,t,o,i;n.merged||(bu.isUndefined(n.barycenter)||bu.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&(t=n,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),t.weight&&(o+=t.barycenter*t.weight,i+=t.weight),r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0)}}function t(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),bu.forEach(o.in.reverse(),r(o)),bu.forEach(o.out,t(o))}return bu.map(bu.filter(n,function(e){return!e.merged}),function(e){return bu.pick(e,["vs","i","barycenter","weight"])})}(bu.filter(r,function(e){return!e.indegree}))};var mc=function(e,n){var r=Cu.partition(e,function(e){return bu.has(e,"barycenter")}),t=r.lhs,o=bu.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,u=0,c=0;t.sort((s=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:s?n.i-e.i:e.i-n.i})),c=wc(i,o,c),bu.forEach(t,function(e){c+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,c=wc(i,o,c)});var s;var f={vs:bu.flatten(i,!0)};u&&(f.barycenter=a/u,f.weight=u);return f};function wc(e,n,r){for(var t;n.length&&(t=bu.last(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}var Ec=function e(n,r,t,o){var i=n.children(r);var a=n.node(r);var u=a?a.borderLeft:void 0;var c=a?a.borderRight:void 0;var s={};u&&(i=bu.filter(i,function(e){return e!==u&&e!==c}));var f=bc(n,i);bu.forEach(f,function(r){if(n.children(r.v).length){var i=e(n,r.v,t,o);s[r.v]=i,bu.has(i,"barycenter")&&(a=r,u=i,bu.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u});var d=_c(f,t);!function(e,n){bu.forEach(e,function(e){e.vs=bu.flatten(e.vs.map(function(e){return n[e]?n[e].vs:e}),!0)})}(d,s);var h=mc(d,o);if(u&&(h.vs=bu.flatten([u,h.vs,c],!0),n.predecessors(u).length)){var v=n.node(n.predecessors(u)[0]),l=n.node(n.predecessors(c)[0]);bu.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+l.order)/(h.weight+2),h.weight+=2}return h};var jc=ia.Graph,kc=function(e,n,r){var t=function(e){var n;for(;e.hasNode(n=bu.uniqueId("_root")););return n}(e),o=new jc({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(n){return e.node(n)});return bu.forEach(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),bu.forEach(e[r](i),function(n){var r=n.v===i?n.w:n.v,t=o.edge(r,i),a=bu.isUndefined(t)?0:t.weight;o.setEdge(r,i,{weight:e.edge(n).weight+a})}),bu.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o};var xc=function(e,n,r){var t,o={};bu.forEach(r,function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}})};var Nc=ia.Graph,Oc=function(e){var n=Cu.maxRank(e),r=Ic(e,bu.range(1,n+1),"inEdges"),t=Ic(e,bu.range(n-1,-1,-1),"outEdges"),o=pc(e);Cc(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ac(u%2?r:t,u%4>=2),o=Cu.buildLayerMatrix(e);var s=gc(e,o);s<a&&(c=0,i=bu.cloneDeep(o),a=s)}Cc(e,i)};function Ic(e,n,r){return bu.map(n,function(n){return kc(e,n,r)})}function Ac(e,n){var r=new Nc;bu.forEach(e,function(e){var t=e.graph().root,o=Ec(e,t,r,n);bu.forEach(o.vs,function(n,r){e.node(n).order=r}),xc(e,r,o.vs)})}function Cc(e,n){bu.forEach(n,function(n){bu.forEach(n,function(n,r){e.node(n).order=r})})}var Mc=ia.Graph,Sc=function(e){var n,r=Cu.buildLayerMatrix(e),t=bu.merge(Pc(e,r),Lc(e,r)),o={};bu.forEach(["u","d"],function(i){n="u"===i?r:bu.values(r).reverse(),bu.forEach(["l","r"],function(r){"r"===r&&(n=bu.map(n,function(e){return bu.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),u=Rc(e,n,t,a),c=zc(e,n,u.root,u.align,"r"===r);"r"===r&&(c=bu.mapValues(c,function(e){return-e})),o[i+r]=c})});var i=Dc(e,o);return Uc(o,i),Bc(o,e.graph().align)};function Pc(e,n){var r={};return bu.reduce(n,function(n,t){var o=0,i=0,a=n.length,u=bu.last(t);return bu.forEach(t,function(n,c){var s=function(e,n){if(e.node(n).dummy)return bu.find(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),f=s?e.node(s).order:a;(s||n===u)&&(bu.forEach(t.slice(i,c+1),function(n){bu.forEach(e.predecessors(n),function(t){var i=e.node(t),a=i.order;!(a<o||f<a)||i.dummy&&e.node(n).dummy||Tc(r,t,n)})}),i=c+1,o=f)}),t}),r}function Lc(e,n){var r={};function t(n,t,o,i,a){var u;bu.forEach(bu.range(t,o),function(t){u=n[t],e.node(u).dummy&&bu.forEach(e.predecessors(u),function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&Tc(r,n,u)})})}return bu.reduce(n,function(n,r){var o,i=-1,a=0;return bu.forEach(r,function(u,c){if("border"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,t(r,a,c,i,o),a=c,i=o)}t(r,a,r.length,o,n.length)}),r}),r}function Tc(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Fc(e,n,r){if(n>r){var t=n;n=r,r=t}return bu.has(e[n],r)}function Rc(e,n,r,t){var o={},i={},a={};return bu.forEach(n,function(e){bu.forEach(e,function(e,n){o[e]=e,i[e]=e,a[e]=n})}),bu.forEach(n,function(e){var n=-1;bu.forEach(e,function(e){var u=t(e);if(u.length)for(var c=((u=bu.sortBy(u,function(e){return a[e]})).length-1)/2,s=Math.floor(c),f=Math.ceil(c);s<=f;++s){var d=u[s];i[e]===e&&n<a[d]&&!Fc(r,e,d)&&(i[d]=e,i[e]=o[e]=o[d],n=a[d])}})}),{root:o,align:i}}function zc(e,n,r,t,o){var i={},a=function(e,n,r,t){var o=new Mc,i=e.graph(),a=function(e,n,r){return function(t,o,i){var a,u=t.node(o),c=t.node(i),s=0;if(s+=u.width/2,bu.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(s+=r?a:-a),a=0,s+=(u.dummy?n:e)/2,s+=(c.dummy?n:e)/2,s+=c.width/2,bu.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(s+=r?a:-a),a=0,s}}(i.nodesep,i.edgesep,t);return bu.forEach(n,function(n){var t;bu.forEach(n,function(n){var i=r[n];if(o.setNode(i),t){var u=r[t],c=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,t),c||0))}t=n})}),o}(e,n,r,o),u=o?"borderLeft":"borderRight";function c(e,n){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c(function(e){i[e]=a.inEdges(e).reduce(function(e,n){return Math.max(e,i[n.v]+a.edge(n))},0)},a.predecessors.bind(a)),c(function(n){var r=a.outEdges(n).reduce(function(e,n){return Math.min(e,i[n.w]-a.edge(n))},Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==u&&(i[n]=Math.max(i[n],r))},a.successors.bind(a)),bu.forEach(t,function(e){i[e]=i[r[e]]}),i}function Dc(e,n){return bu.minBy(bu.values(n),function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return bu.forIn(n,function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;r=Math.max(n+i,r),t=Math.min(n-i,t)}),r-t})}function Uc(e,n){var r=bu.values(n),t=bu.min(r),o=bu.max(r);bu.forEach(["u","d"],function(r){bu.forEach(["l","r"],function(i){var a,u=r+i,c=e[u];if(c!==n){var s=bu.values(c);(a="l"===i?t-bu.min(s):o-bu.max(s))&&(e[u]=bu.mapValues(c,function(e){return e+a}))}})})}function Bc(e,n){return bu.mapValues(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var o=bu.sortBy(bu.map(e,t));return(o[1]+o[2])/2})}var Gc=Sc,Vc=function(e){(function(e){var n=Cu.buildLayerMatrix(e),r=e.graph().ranksep,t=0;bu.forEach(n,function(n){var o=bu.max(bu.map(n,function(n){return e.node(n).height}));bu.forEach(n,function(n){e.node(n).y=t+o/2}),t+=o+r})})(e=Cu.asNonCompoundGraph(e)),bu.forEach(Gc(e),function(n,r){e.node(r).x=n})};var qc=Cu.normalizeRanks,Yc=Cu.removeEmptyRanks,$c=Cu,Wc=ia.Graph,Kc=function(e,n){var r=n&&n.debugTiming?$c.time:$c.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return function(e){var n=new Wc({multigraph:!0,compound:!0}),r=os(e.graph());return n.setGraph(bu.merge({},Qc,ts(r,Jc),bu.pick(r,Hc))),bu.forEach(e.nodes(),function(r){var t=os(e.node(r));n.setNode(r,bu.defaults(ts(t,Xc),Zc)),n.setParent(r,e.parent(r))}),bu.forEach(e.edges(),function(r){var t=os(e.edge(r));n.setEdge(r,bu.merge({},ns,ts(t,es),bu.pick(t,rs)))}),n}(e)});r(" runLayout",function(){!function(e,n){n(" makeSpaceForEdgeLabels",function(){!function(e){var n=e.graph();n.ranksep/=2,bu.forEach(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(e)}),n(" removeSelfEdges",function(){!function(e){bu.forEach(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)}),n(" acyclic",function(){Iu.run(e)}),n(" nestingGraph.run",function(){uc.run(e)}),n(" rank",function(){tc($c.asNonCompoundGraph(e))}),n(" injectEdgeLabelProxies",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o=e.node(n.w),i={rank:(o.rank-t.rank)/2+t.rank,e:n};$c.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),n(" removeEmptyRanks",function(){Yc(e)}),n(" nestingGraph.cleanup",function(){uc.cleanup(e)}),n(" normalizeRanks",function(){qc(e)}),n(" assignRankMinMax",function(){!function(e){var n=0;bu.forEach(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=bu.max(n,t.maxRank))}),e.graph().maxRank=n}(e)}),n(" removeEdgeLabelProxies",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}(e)}),n(" normalize.run",function(){Pu.run(e)}),n(" parentDummyChains",function(){ac(e)}),n(" addBorderSegments",function(){cc(e)}),n(" order",function(){Oc(e)}),n(" insertSelfEdges",function(){!function(e){var n=$c.buildLayerMatrix(e);bu.forEach(n,function(n){var r=0;bu.forEach(n,function(n,t){var o=e.node(n);o.order=t+r,bu.forEach(o.selfEdges,function(n){$c.addDummyNode(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)}),n(" adjustCoordinateSystem",function(){fc.adjust(e)}),n(" position",function(){Vc(e)}),n(" positionSelfEdges",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}(e)}),n(" removeBorderNodes",function(){!function(e){bu.forEach(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(bu.last(r.borderLeft)),a=e.node(bu.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),bu.forEach(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)}),n(" normalize.undo",function(){Pu.undo(e)}),n(" fixupEdgeLabelCoords",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(bu.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),n(" undoCoordinateSystem",function(){fc.undo(e)}),n(" translateGraph",function(){!function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function c(e){var i=e.x,a=e.y,u=e.width,c=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-c/2),o=Math.max(o,a+c/2)}bu.forEach(e.nodes(),function(n){c(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.has(r,"x")&&c(r)}),n-=a,t-=u,bu.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=n,o.y-=t}),bu.forEach(e.edges(),function(r){var o=e.edge(r);bu.forEach(o.points,function(e){e.x-=n,e.y-=t}),bu.has(o,"x")&&(o.x-=n),bu.has(o,"y")&&(o.y-=t)}),i.width=r-n+a,i.height=o-t+u}(e)}),n(" assignNodeIntersects",function(){!function(e){bu.forEach(e.edges(),function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift($c.intersectRect(i,r)),o.points.push($c.intersectRect(a,t))})}(e)}),n(" reversePoints",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}(e)}),n(" acyclic.undo",function(){Iu.undo(e)})}(n,r)}),r(" updateInputGraph",function(){!function(e,n){bu.forEach(e.nodes(),function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))}),bu.forEach(e.edges(),function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,bu.has(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n)})})};var Jc=["nodesep","edgesep","ranksep","marginx","marginy"],Qc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Hc=["acyclicer","ranker","rankdir","align"],Xc=["width","height"],Zc={width:0,height:0},es=["minlen","weight","width","height","labeloffset"],ns={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},rs=["labelpos"];function ts(e,n){return bu.mapValues(bu.pick(e,n),Number)}function os(e){var n={};return bu.forEach(e,function(e,r){n[r.toLowerCase()]=e}),n}var is=ia.Graph;var as={graphlib:ia,layout:Kc,debug:{debugOrdering:function(e){var n=Cu.buildLayerMatrix(e),r=new is({compound:!0,multigraph:!0}).setGraph({});return bu.forEach(e.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),bu.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),bu.forEach(n,function(e,n){var t="layer"+n;r.setNode(t,{rank:"same"}),bu.reduce(e,function(e,n){return r.setEdge(e,n,{style:"invis"}),n})}),r}},util:{time:Cu.time,notime:Cu.notime},version:"0.8.5"},us=as.graphlib,cs=as.layout;n(function(n,r){n.exports=function(){function n(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},t=0,o=void 0,i=void 0,a=function(e,n){v[t]=e,v[t+1]=n,2===(t+=2)&&(i?i(l):_())},u="undefined"!=typeof window?window:void 0,c=u||{},s=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(l,1)}}var v=new Array(1e3);function l(){for(var e=0;e<t;e+=2){var n=v[e],r=v[e+1];n(r),v[e]=void 0,v[e+1]=void 0}t=0}var p,g,y,b,_=void 0;function m(e,n){var r=this,t=new this.constructor(j);void 0===t[E]&&F(t);var o=r._state;if(o){var i=arguments[o-1];a(function(){return L(o,t,i,r._result)})}else S(r,t,e,n);return t}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(j);return I(n,e),n}f?_=function(){return process.nextTick(l)}:s?(g=0,y=new s(l),b=document.createTextNode(""),y.observe(b,{characterData:!0}),_=function(){b.data=g=++g%2}):d?((p=new MessageChannel).port1.onmessage=l,_=function(){return p.port2.postMessage(0)}):_=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(l)}:h()}catch(e){return h()}}():h();var E=Math.random().toString(36).substring(2);function j(){}var k=void 0,x=1,N=2;function O(e,r,t){r.constructor===e.constructor&&t===m&&r.constructor.resolve===w?function(e,n){n._state===x?C(e,n._result):n._state===N?M(e,n._result):S(n,void 0,function(n){return I(e,n)},function(n){return M(e,n)})}(e,r):void 0===t?C(e,r):n(t)?function(e,n,r){a(function(e){var t=!1,o=function(e,n,r,t){try{e.call(n,r,t)}catch(e){return e}}(r,n,function(r){t||(t=!0,n!==r?I(e,r):C(e,r))},function(n){t||(t=!0,M(e,n))},e._label);!t&&o&&(t=!0,M(e,o))},e)}(e,r,t):C(e,r)}function I(e,n){if(e===n)M(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(t=n),null===t||"object"!==o&&"function"!==o)C(e,n);else{var r=void 0;try{r=n.then}catch(n){return void M(e,n)}O(e,n,r)}var t,o}function A(e){e._onerror&&e._onerror(e._result),P(e)}function C(e,n){e._state===k&&(e._result=n,e._state=x,0!==e._subscribers.length&&a(P,e))}function M(e,n){e._state===k&&(e._state=N,e._result=n,a(A,e))}function S(e,n,r,t){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+x]=r,o[i+N]=t,0===i&&e._state&&a(P,e)}function P(e){var n=e._subscribers,r=e._state;if(0!==n.length){for(var t=void 0,o=void 0,i=e._result,a=0;a<n.length;a+=3)t=n[a],o=n[a+r],t?L(r,t,o,i):o(i);e._subscribers.length=0}}function L(e,r,t,o){var i=n(t),a=void 0,u=void 0,c=!0;if(i){try{a=t(o)}catch(e){c=!1,u=e}if(r===a)return void M(r,new TypeError("A promises callback cannot return that same promise."))}else a=o;r._state!==k||(i&&c?I(r,a):!1===c?M(r,u):e===x?C(r,a):e===N&&M(r,a))}var T=0;function F(e){e[E]=T++,e._state=void 0,e._result=void 0,e._subscribers=[]}var R=function(){function e(e,n){this._instanceConstructor=e,this.promise=new e(j),this.promise[E]||F(this.promise),r(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&C(this.promise,this._result))):M(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var n=0;this._state===k&&n<e.length;n++)this._eachEntry(e[n],n)},e.prototype._eachEntry=function(e,n){var r=this._instanceConstructor,t=r.resolve;if(t===w){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(e){a=!0,i=e}if(o===m&&e._state!==k)this._settledAt(e._state,n,e._result);else if("function"!=typeof o)this._remaining--,this._result[n]=e;else if(r===z){var u=new r(j);a?M(u,i):O(u,e,o),this._willSettleAt(u,n)}else this._willSettleAt(new r(function(n){return n(e)}),n)}else this._willSettleAt(t(e),n)},e.prototype._settledAt=function(e,n,r){var t=this.promise;t._state===k&&(this._remaining--,e===N?M(t,r):this._result[n]=r),0===this._remaining&&C(t,this._result)},e.prototype._willSettleAt=function(e,n){var r=this;S(e,void 0,function(e){return r._settledAt(x,n,e)},function(e){return r._settledAt(N,n,e)})},e}(),z=function(){function e(n){this[E]=T++,this._result=this._state=void 0,this._subscribers=[],j!==n&&("function"!=typeof n&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,n){try{n(function(n){I(e,n)},function(n){M(e,n)})}catch(n){M(e,n)}}(this,n):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this.constructor;return n(e)?this.then(function(n){return r.resolve(e()).then(function(){return n})},function(n){return r.resolve(e()).then(function(){throw n})}):this.then(e,e)},e}();return z.prototype.then=m,z.all=function(e){return new R(this,e).promise},z.race=function(e){var n=this;return r(e)?new n(function(r,t){for(var o=e.length,i=0;i<o;i++)n.resolve(e[i]).then(r,t)}):new n(function(e,n){return n(new TypeError("You must pass an array to race."))})},z.resolve=w,z.reject=function(e){var n=new this(j);return M(n,e),n},z._setScheduler=function(e){i=e},z._setAsap=function(e){a=e},z._asap=a,z.polyfill=function(){var n=void 0;if(void 0!==e)n=e;else if("undefined"!=typeof self)n=self;else try{n=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=n.Promise;if(r){var t=null;try{t=Object.prototype.toString.call(r.resolve())}catch(e){}if("[object Promise]"===t&&!r.cast)return}n.Promise=z},z.Promise=z,z}()}).polyfill();self.onmessage=function(e){var n=function(e,n){var r=e.subgraphs,t=e.nodes,o=e.links,i=e.hierarchy,a=new us.Graph({multigraph:!0,compound:!0,directed:!1!==n.digraph}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});r.forEach(function(e){a.setNode(e.id,e)}),t.forEach(function(e){a.setNode(e.id,e)}),o.forEach(function(e){a.setEdge(e.source.id,e.target.id,e,e.id)}),i.forEach(function(e){a.setParent(e.child,e.parent)}),cs(a,{debugTiming:!1});var u=-a.graph().width/2||0,c=-a.graph().height/2;return a.nodes().forEach(function(e){var n=a.node(e);n.x+=u,n.y+=c}),a.edges().forEach(function(e){var n=a.edge(e);n.points=n.points.map(function(e){return[e.x+u,e.y+c]})}),{subgraphs:r,nodes:t,links:o}}.apply(void 0,e.data);self.postMessage(n)}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}({subgraphs:n.allSubgraphs().map(function(e){return u(u({},e.props),{id:vh(e.id)})}),nodes:n.allVertices().map(function(e){delete e.fx,delete e.fy;var t=e.element.node().getBBox();return u({width:t.width,height:t.height},e.props)}),links:n.allEdges().map(function(e){return e.props}),hierarchy:h(h([],n.allSubgraphs().filter(function(e){return!!n.subgraphParent(e.id)}).map(function(e){return{parent:vh(n.subgraphParent(e.id).props.id),child:vh(e.id)}})),n.allVertices().filter(function(e){return void 0!==n.vertexParent(e.id)}).map(function(e){return{parent:vh(n.vertexParent(e.id).props.id),child:e.id}}))},this._options).response.then(function(e){return t.running()&&(e.subgraphs.forEach(function(e){var t=n.subgraph(e.id.substring(8));t.x=e.x+r.width/2,t.y=e.y+r.height/2,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id),o=yh(t.source.x,t.source.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2),i=yh(t.target.x,t.target.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2);t.points=h(h([o<i?[t.source.x,t.source.y]:[t.target.x,t.target.y]],e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]})),[o<i?[t.target.x,t.target.y]:[t.source.x,t.source.y]])}),t._graph.moveVertices(!0).moveSubgraphs(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:gh(o),labelPos:this.center(o)}},t}(fh),_h=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices(),o=r.allEdges();o.forEach(function(e){return delete e.points}),t._links=ll(o).id(function(e){return e.id}).distance(t._options.linkDistance).strength(t._options.linkStrength),t._charge=Nl().strength(t._options.repulsionStrength).distanceMin(t._options.distanceMin).distanceMax(t._options.distanceMax),t._center=Jc(e.width/2,e.height/2);var i=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(n[i]-o.x)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength),a=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(n[i]-o.y)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength);return t._simulation=Ol(n.map(function(r){var n=r.element.node().getBBox(),o=n.width,i=n.height;return r.fx=t._options.pinCentroid&&r.centroid?e.width/2:void 0,r.fy=t._options.pinCentroid&&r.centroid?e.height/2:void 0,r.width=o,r.height=i,r})).force("link",t._links).force("charge",t._charge).force("center",t._center).force("x",i).force("y",a).alpha(t._options.alpha/2).alphaMin(t._options.alphaMin).alphaDecay(t._options.alphaDecay).velocityDecay(t._options.velocityDecay).stop(),t})},t.prototype.stop=function(){return this._simulation.stop(),e.prototype.stop.call(this)},t}(fh),bh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t._simulation.tick(t._options.iterations),t.stop(),t._graph.moveVertices(!1).moveEdges(!1),t})},t}(_h),wh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return new Promise(function(e){t._simulation.on("tick",function(){t._graph.moveVertices(!1).moveEdges(!1),t._graph.progress("layout-tick")}).on("end",function(){t._running=!1,e(t)}).restart()})})},t}(_h);function xh(e,t){var r=new Blob(['!function(){"use strict";function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||e)}var e,t,n;e={exports:{}},t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,n=function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise(function(r,t){e=r,n=t});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=!0,d="";"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),t&&(d=t),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var p,h,m=o.print||console.log.bind(console),v=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit,o.wasmBinary&&(p=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&O("no native wasm support detected");var w=!1;function _(r,e){r||O("Assertion failed: "+e)}var y,g,E,b,k,D,S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&S)return S.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function F(r,e){return r?P(E,r,e):""}function x(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a)),s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function A(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function M(r){y=r,o.HEAP8=g=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=k=new Float64Array(r)}o.INITIAL_MEMORY;var R=[],C=[],z=[],j=0,T=null;function B(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function N(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var e=T;T=null,e()}}function O(r){o.onAbort&&o.onAbort(r),v(r+=""),w=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var L,I,U,H,W="data:application/octet-stream;base64,";function q(r){return r.startsWith(W)}function G(r){try{if(r==L&&p)return new Uint8Array(p);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){O(r)}}q(L="expatlib.wasm")||(I=L,L=o.locateFile?o.locateFile(I,d):d+I);var V={11922:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";e.startElement()},12140:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";e.endElement()},12352:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";e.characterData()}};function J(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?D.get(t)():D.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}var X={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=X.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=X.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return X.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return X.normalize(r.join("/"))},join2:function(r,e){return X.normalize(r+"/"+e)}},Y={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Q.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Y.resolve(r).substr(1),e=Y.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},K={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){K.ttys[r]={input:[],output:[],ops:e},Q.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var e=K.ttys[r.node.rdev];if(!e)throw new Q.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Q.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new Q.ErrnoError(29)}if(void 0===s&&0===i)throw new Q.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Q.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new Q.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=ir(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(m(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(P(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(v(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(v(P(r.output,0)),r.output=[])}}},$={ops_table:null,mount:function(r){return $.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Q.isBlkdev(t)||Q.isFIFO(t))throw new Q.ErrnoError(63);$.ops_table||($.ops_table={dir:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,lookup:$.node_ops.lookup,mknod:$.node_ops.mknod,rename:$.node_ops.rename,unlink:$.node_ops.unlink,rmdir:$.node_ops.rmdir,readdir:$.node_ops.readdir,symlink:$.node_ops.symlink},stream:{llseek:$.stream_ops.llseek}},file:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:{llseek:$.stream_ops.llseek,read:$.stream_ops.read,write:$.stream_ops.write,allocate:$.stream_ops.allocate,mmap:$.stream_ops.mmap,msync:$.stream_ops.msync}},link:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,readlink:$.node_ops.readlink},stream:{}},chrdev:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:Q.chrdev_stream_ops}});var o=Q.createNode(r,e,t,n);return Q.isDir(o.mode)?(o.node_ops=$.ops_table.dir.node,o.stream_ops=$.ops_table.dir.stream,o.contents={}):Q.isFile(o.mode)?(o.node_ops=$.ops_table.file.node,o.stream_ops=$.ops_table.file.stream,o.usedBytes=0,o.contents=null):Q.isLink(o.mode)?(o.node_ops=$.ops_table.link.node,o.stream_ops=$.ops_table.link.stream):Q.isChrdev(o.mode)&&(o.node_ops=$.ops_table.chrdev.node,o.stream_ops=$.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Q.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Q.isDir(r.mode)?e.size=4096:Q.isFile(r.mode)?e.size=r.usedBytes:Q.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&$.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Q.genericErrors[44]},mknod:function(r,e,t,n){return $.createNode(r,e,t,n)},rename:function(r,e,t){if(Q.isDir(r.mode)){var n;try{n=Q.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new Q.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Q.lookupNode(r,e);for(var n in t.contents)throw new Q.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=$.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Q.isLink(r.mode))throw new Q.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===g.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if($.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Q.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Q.ErrnoError(28);return n},allocate:function(r,e,t){$.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new Q.ErrnoError(28);if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==y){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=void O()))throw new Q.ErrnoError(48);g.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);return 2&o?0:($.stream_ops.write(r,e,0,n,t,!1),0)}}},Q={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=Y.resolve(Q.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new Q.ErrnoError(32);for(var o=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=Q.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=Q.lookupNode(i,o[s]),a=X.join2(a,o[s]),Q.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;Q.isLink(i.mode);){var f=Q.readlink(a);if(a=Y.resolve(X.dirname(a),f),i=Q.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new Q.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(Q.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Q.nameTable.length},hashAddNode:function(r){var e=Q.hashName(r.parent.id,r.name);r.name_next=Q.nameTable[e],Q.nameTable[e]=r},hashRemoveNode:function(r){var e=Q.hashName(r.parent.id,r.name);if(Q.nameTable[e]===r)Q.nameTable[e]=r.name_next;else for(var t=Q.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=Q.mayLookup(r);if(t)throw new Q.ErrnoError(t,r);for(var n=Q.hashName(r.id,e),o=Q.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Q.lookup(r,e)},createNode:function(r,e,t,n){var o=new Q.FSNode(r,e,t,n);return Q.hashAddNode(o),o},destroyNode:function(r){Q.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=Q.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return Q.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=Q.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{return Q.lookupNode(r,e),20}catch(r){}return Q.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=Q.lookupNode(r,e)}catch(r){return r.errno}var o=Q.nodePermissions(r,"wx");if(o)return o;if(t){if(!Q.isDir(n.mode))return 54;if(Q.isRoot(n)||Q.getPath(n)===Q.cwd())return 10}else if(Q.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?Q.isLink(r.mode)?32:Q.isDir(r.mode)&&("r"!==Q.flagsToPermissionString(e)||512&e)?31:Q.nodePermissions(r,Q.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||Q.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!Q.streams[t])return t;throw new Q.ErrnoError(33)},getStream:function(r){return Q.streams[r]},createStream:function(r,e,t){Q.FSStream||(Q.FSStream=function(){},Q.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Q.FSStream;for(var o in r)n[o]=r[o];r=n;var i=Q.nextfd(e,t);return r.fd=i,Q.streams[i]=r,r},closeStream:function(r){Q.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=Q.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new Q.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){Q.devices[r]={stream_ops:e}},getDevice:function(r){return Q.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),Q.syncFSRequests++,Q.syncFSRequests>1&&v("warning: "+Q.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Q.getMounts(Q.root.mount),n=0;function o(r){return Q.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&Q.root)throw new Q.ErrnoError(10);if(!o&&!i){var a=Q.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Q.isMountpoint(n))throw new Q.ErrnoError(10);if(!Q.isDir(n.mode))throw new Q.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Q.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=Q.lookupPath(r,{follow_mount:!1});if(!Q.isMountpoint(e.node))throw new Q.ErrnoError(28);var t=e.node,n=t.mounted,o=Q.getMounts(n);Object.keys(Q.nameTable).forEach(function(r){for(var e=Q.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&Q.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=Q.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new Q.ErrnoError(28);var i=Q.mayCreate(n,o);if(i)throw new Q.ErrnoError(i);if(!n.node_ops.mknod)throw new Q.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,Q.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,Q.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Q.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,Q.mknod(r,e,t)},symlink:function(r,e){if(!Y.resolve(r))throw new Q.ErrnoError(44);var t=Q.lookupPath(e,{parent:!0}).node;if(!t)throw new Q.ErrnoError(44);var n=X.basename(e),o=Q.mayCreate(t,n);if(o)throw new Q.ErrnoError(o);if(!t.node_ops.symlink)throw new Q.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=X.dirname(r),i=X.dirname(e),a=X.basename(r),s=X.basename(e);if(t=Q.lookupPath(r,{parent:!0}).node,n=Q.lookupPath(e,{parent:!0}).node,!t||!n)throw new Q.ErrnoError(44);if(t.mount!==n.mount)throw new Q.ErrnoError(75);var u,c=Q.lookupNode(t,a),f=Y.relative(r,i);if("."!==f.charAt(0))throw new Q.ErrnoError(28);if("."!==(f=Y.relative(e,o)).charAt(0))throw new Q.ErrnoError(55);try{u=Q.lookupNode(n,s)}catch(r){}if(c!==u){var l=Q.isDir(c.mode),d=Q.mayDelete(t,a,l);if(d)throw new Q.ErrnoError(d);if(d=u?Q.mayDelete(n,s,l):Q.mayCreate(n,s))throw new Q.ErrnoError(d);if(!t.node_ops.rename)throw new Q.ErrnoError(63);if(Q.isMountpoint(c)||u&&Q.isMountpoint(u))throw new Q.ErrnoError(10);if(n!==t&&(d=Q.nodePermissions(t,"w")))throw new Q.ErrnoError(d);try{Q.trackingDelegate.willMovePath}catch(t){v("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}Q.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{Q.hashAddNode(c)}try{Q.trackingDelegate.onMovePath}catch(t){v("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!0);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.rmdir)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=Q.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new Q.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!1);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.unlink)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=Q.lookupPath(r).node;if(!e)throw new Q.ErrnoError(44);if(!e.node_ops.readlink)throw new Q.ErrnoError(28);return Y.resolve(Q.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=Q.lookupPath(r,{follow:!e}).node;if(!t)throw new Q.ErrnoError(44);if(!t.node_ops.getattr)throw new Q.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return Q.stat(r,!0)},chmod:function(r,e,t){var n;if(!(n="string"==typeof r?Q.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){Q.chmod(r,e,!0)},fchmod:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);Q.chmod(t.node,e)},chown:function(r,e,t,n){var o;if(!(o="string"==typeof r?Q.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){Q.chown(r,e,t,!0)},fchown:function(r,e,t){var n=Q.getStream(r);if(!n)throw new Q.ErrnoError(8);Q.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new Q.ErrnoError(28);var t;if(!(t="string"==typeof r?Q.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);if(Q.isDir(t.mode))throw new Q.ErrnoError(31);if(!Q.isFile(t.mode))throw new Q.ErrnoError(28);var n=Q.nodePermissions(t,"w");if(n)throw new Q.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);if(0==(2097155&t.flags))throw new Q.ErrnoError(28);Q.truncate(t.node,e)},utime:function(r,e,t){var n=Q.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new Q.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?Q.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=X.normalize(r);try{a=Q.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new Q.ErrnoError(20)}else a=Q.mknod(r,t,0),s=!0;if(!a)throw new Q.ErrnoError(44);if(Q.isChrdev(a.mode)&&(e&=-513),65536&e&&!Q.isDir(a.mode))throw new Q.ErrnoError(54);if(!s){var u=Q.mayOpen(a,e);if(u)throw new Q.ErrnoError(u)}512&e&&Q.truncate(a,0),e&=-131713;var c=Q.createStream({node:a,path:Q.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(Q.readFiles||(Q.readFiles={}),r in Q.readFiles||(Q.readFiles[r]=1,v("FS.trackingDelegate error on read file: "+r)));try{Q.trackingDelegate.onOpenFile}catch(e){v("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(Q.isClosed(r))throw new Q.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{Q.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Q.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Q.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(1==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.read)throw new Q.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.write)throw new Q.ErrnoError(28);r.seekable&&1024&r.flags&&Q.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&Q.trackingDelegate.onWriteToFile&&Q.trackingDelegate.onWriteToFile(r.path)}catch(e){v("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(e<0||t<=0)throw new Q.ErrnoError(28);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(!Q.isFile(r.node.mode)&&!Q.isDir(r.node.mode))throw new Q.ErrnoError(43);if(!r.stream_ops.allocate)throw new Q.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Q.ErrnoError(2);if(1==(2097155&r.flags))throw new Q.ErrnoError(2);if(!r.stream_ops.mmap)throw new Q.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new Q.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=Q.open(r,e.flags),o=Q.stat(r).size,i=new Uint8Array(o);return Q.read(n,i,0,o,0),"utf8"===e.encoding?t=P(i,0):"binary"===e.encoding&&(t=i),Q.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=Q.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(A(e)+1),i=x(e,o,0,o.length);Q.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Q.write(n,e,0,e.byteLength,void 0,t.canOwn)}Q.close(n)},cwd:function(){return Q.currentPath},chdir:function(r){var e=Q.lookupPath(r,{follow:!0});if(null===e.node)throw new Q.ErrnoError(44);if(!Q.isDir(e.node.mode))throw new Q.ErrnoError(54);var t=Q.nodePermissions(e.node,"x");if(t)throw new Q.ErrnoError(t);Q.currentPath=e.path},createDefaultDirectories:function(){Q.mkdir("/tmp"),Q.mkdir("/home"),Q.mkdir("/home/web_user")},createDefaultDevices:function(){Q.mkdir("/dev"),Q.registerDevice(Q.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),Q.mkdev("/dev/null",Q.makedev(1,3)),K.register(Q.makedev(5,0),K.default_tty_ops),K.register(Q.makedev(6,0),K.default_tty1_ops),Q.mkdev("/dev/tty",Q.makedev(5,0)),Q.mkdev("/dev/tty1",Q.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){O("randomDevice")}}();Q.createDevice("/dev","random",r),Q.createDevice("/dev","urandom",r),Q.mkdir("/dev/shm"),Q.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Q.mkdir("/proc");var r=Q.mkdir("/proc/self");Q.mkdir("/proc/self/fd"),Q.mount({mount:function(){var e=Q.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=Q.getStream(t);if(!n)throw new Q.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?Q.createDevice("/dev","stdin",o.stdin):Q.symlink("/dev/tty","/dev/stdin"),o.stdout?Q.createDevice("/dev","stdout",null,o.stdout):Q.symlink("/dev/tty","/dev/stdout"),o.stderr?Q.createDevice("/dev","stderr",null,o.stderr):Q.symlink("/dev/tty1","/dev/stderr"),Q.open("/dev/stdin",0),Q.open("/dev/stdout",1),Q.open("/dev/stderr",1)},ensureErrnoError:function(){Q.ErrnoError||(Q.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Q.ErrnoError.prototype=new Error,Q.ErrnoError.prototype.constructor=Q.ErrnoError,[44].forEach(function(r){Q.genericErrors[r]=new Q.ErrnoError(r),Q.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){Q.ensureErrnoError(),Q.nameTable=new Array(4096),Q.mount($,{},"/"),Q.createDefaultDirectories(),Q.createDefaultDevices(),Q.createSpecialDirectories(),Q.filesystems={MEMFS:$}},init:function(r,e,t){Q.init.initialized=!0,Q.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,Q.createStandardStreams()},quit:function(){Q.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<Q.streams.length;e++){var t=Q.streams[e];t&&Q.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=Q.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=Q.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Q.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=X.basename(r),n=Q.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:Q.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=X.join2(r,i);try{Q.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=X.join2("string"==typeof r?r:Q.getPath(r),e),a=Q.getMode(n,o);return Q.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?X.join2("string"==typeof r?r:Q.getPath(r),e):r,s=Q.getMode(n,o),u=Q.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}Q.chmod(u,146|s);var d=Q.open(u,577);Q.write(d,t,0,t.length,0,i),Q.close(d),Q.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=X.join2("string"==typeof r?r:Q.getPath(r),e),i=Q.getMode(!!t,!!n);Q.createDevice.major||(Q.createDevice.major=64);var a=Q.makedev(Q.createDevice.major++,0);return Q.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new Q.ErrnoError(29)}if(void 0===u&&0===a)throw new Q.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new Q.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Q.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=ir(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new Q.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ir(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=Q.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return Q.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){Q.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?Y.resolve(X.join2(r,e)):r;function p(t){function u(t){l&&l(),c||Q.createDataFile(r,e,t,n,i,f),a&&a(),N()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),N()}),p=!0)}),p||u(t)}B(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){_(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&N()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&B()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){m("creating db"),o.result.createObjectStore(Q.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Q.DB_STORE_NAME],"readwrite"),i=n.objectStore(Q.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(Q.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([Q.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(Q.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){Q.analyzePath(r).exists&&Q.unlink(r),Q.createDataFile(X.dirname(r),X.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},Z={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=Q.cwd();else{var o=Q.getStream(r);if(!o)throw new Q.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Q.ErrnoError(44);return n}return X.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&X.normalize(e)!==X.normalize(Q.getPath(r.node)))return-54;throw r}return b[t>>2]=n.dev,b[t+4>>2]=0,b[t+8>>2]=n.ino,b[t+12>>2]=n.mode,b[t+16>>2]=n.nlink,b[t+20>>2]=n.uid,b[t+24>>2]=n.gid,b[t+28>>2]=n.rdev,b[t+32>>2]=0,H=[n.size>>>0,(U=n.size,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+40>>2]=H[0],b[t+44>>2]=H[1],b[t+48>>2]=4096,b[t+52>>2]=n.blocks,b[t+56>>2]=n.atime.getTime()/1e3|0,b[t+60>>2]=0,b[t+64>>2]=n.mtime.getTime()/1e3|0,b[t+68>>2]=0,b[t+72>>2]=n.ctime.getTime()/1e3|0,b[t+76>>2]=0,H=[n.ino>>>0,(U=n.ino,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+80>>2]=H[0],b[t+84>>2]=H[1],0},doMsync:function(r,e,t,n,o){var i=E.slice(r,r+t);Q.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=X.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Q.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Q.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=Q.readlink(r),o=Math.min(t,A(n)),i=g[e+o];return x(n,E,e,t+1),g[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=Q.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&Q.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=Q.getStream(t);return n&&Q.close(n),Q.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.read(r,g,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.write(r,g,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return Z.varargs+=4,b[Z.varargs-4>>2]},getStr:function(r){return F(r)},getStreamFromFD:function(r){var e=Q.getStream(r);if(!e)throw new Q.ErrnoError(8);return e},get64:function(r,e){return r}},rr=[];function er(r){try{return h.grow(r-y.byteLength+65535>>>16),M(h.buffer),1}catch(r){}}var tr={};function nr(){if(!nr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in tr)void 0===tr[e]?delete r[e]:r[e]=tr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);nr.strings=t}return nr.strings}var or=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Q.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function ir(r,e,t){var n=t>0?t:A(r)+1,o=new Array(n),i=x(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(or.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Q.isDir(this.mode)}},isDevice:{get:function(){return Q.isChrdev(this.mode)}}}),Q.FSNode=or,Q.staticInit();var ar={g:function(){return 42},i:function(r,e,t){Z.varargs=t;try{var n=Z.getStr(r),o=t?Z.get():0;return Q.open(n,e,o).fd}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),-r.errno}},b:function(){O()},a:function(r,e,t){var n=function(r,e){var t;for(rr.length=0,e>>=2;t=E[r++];){var n=t<105;n&&1&e&&e++,rr.push(n?k[e++>>1]:b[e]),++e}return rr}(e,t);return V[r].apply(null,n)},k:function(r,e,t){E.copyWithin(r,e,e+t)},l:function(r){var e,t,n=E.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),er(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},e:function(r,e){try{var t=0;return nr().forEach(function(n,o){var i=e+t;b[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)g[e++>>0]=r.charCodeAt(n);t||(g[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},f:function(r,e){try{var t=nr();b[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),b[e>>2]=n,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},c:function(r){try{var e=Z.getStreamFromFD(r);return Q.close(e),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},h:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doReadv(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},j:function(r,e,t,n,o){try{var i=Z.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(Q.llseek(i,a,n),H=[i.position>>>0,(U=i.position,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[o>>2]=H[0],b[o+4>>2]=H[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},d:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doWritev(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},m:function(r){var e=Date.now();return b[r>>2]=e/1e3|0,b[r+4>>2]=e%1e3*1e3|0,0}};!function(){var r={a:ar};function e(r,e){var t,n=r.exports;o.asm=n,M((h=o.asm.n).buffer),D=o.asm.H,t=o.asm.o,C.unshift(t),N()}function t(r){e(r.instance)}function i(e){return(!p&&l&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+L+"\'";return r.arrayBuffer()}).catch(function(){return G(L)}):Promise.resolve().then(function(){return G(L)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){v("failed to asynchronously prepare wasm: "+r),O(r)})}if(B(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return v("Module.instantiateWasm callback failed with error: "+r),!1}(p||"function"!=typeof WebAssembly.instantiateStreaming||q(L)||"function"!=typeof fetch?i(t):fetch(L,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return v("wasm streaming compile failed: "+r),v("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.o).apply(null,arguments)};var sr,ur=o._emscripten_bind_CExpat_CExpat_0=function(){return(ur=o._emscripten_bind_CExpat_CExpat_0=o.asm.p).apply(null,arguments)},cr=o._emscripten_bind_CExpat_version_0=function(){return(cr=o._emscripten_bind_CExpat_version_0=o.asm.q).apply(null,arguments)},fr=o._emscripten_bind_CExpat_create_0=function(){return(fr=o._emscripten_bind_CExpat_create_0=o.asm.r).apply(null,arguments)},lr=o._emscripten_bind_CExpat_destroy_0=function(){return(lr=o._emscripten_bind_CExpat_destroy_0=o.asm.s).apply(null,arguments)},dr=o._emscripten_bind_CExpat_parse_1=function(){return(dr=o._emscripten_bind_CExpat_parse_1=o.asm.t).apply(null,arguments)},pr=o._emscripten_bind_CExpat_tag_0=function(){return(pr=o._emscripten_bind_CExpat_tag_0=o.asm.u).apply(null,arguments)},hr=o._emscripten_bind_CExpat_attrs_0=function(){return(hr=o._emscripten_bind_CExpat_attrs_0=o.asm.v).apply(null,arguments)},mr=o._emscripten_bind_CExpat_content_0=function(){return(mr=o._emscripten_bind_CExpat_content_0=o.asm.w).apply(null,arguments)},vr=o._emscripten_bind_CExpat_startElement_0=function(){return(vr=o._emscripten_bind_CExpat_startElement_0=o.asm.x).apply(null,arguments)},wr=o._emscripten_bind_CExpat_endElement_0=function(){return(wr=o._emscripten_bind_CExpat_endElement_0=o.asm.y).apply(null,arguments)},_r=o._emscripten_bind_CExpat_characterData_0=function(){return(_r=o._emscripten_bind_CExpat_characterData_0=o.asm.z).apply(null,arguments)},yr=o._emscripten_bind_CExpat___destroy___0=function(){return(yr=o._emscripten_bind_CExpat___destroy___0=o.asm.A).apply(null,arguments)},gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.B).apply(null,arguments)},Er=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(Er=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.C).apply(null,arguments)},br=o._emscripten_bind_CExpatJS_startElement_0=function(){return(br=o._emscripten_bind_CExpatJS_startElement_0=o.asm.D).apply(null,arguments)},kr=o._emscripten_bind_CExpatJS_endElement_0=function(){return(kr=o._emscripten_bind_CExpatJS_endElement_0=o.asm.E).apply(null,arguments)},Dr=o._emscripten_bind_CExpatJS_characterData_0=function(){return(Dr=o._emscripten_bind_CExpatJS_characterData_0=o.asm.F).apply(null,arguments)},Sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(Sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.G).apply(null,arguments)};function Pr(r){function t(){sr||(sr=!0,o.calledRun=!0,w||(o.noFSInit||Q.init.initialized||Q.init(),Q.ignorePermissions=!1,J(C),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;J(z)}()))}j>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),R.unshift(r);var r;J(R)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),t()},1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)},T=function r(){sr||Pr(),sr||(T=r)},o.run=Pr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Fr(){}function xr(r){return(r||Fr).__cache__}function Ar(r,e){var t=xr(e),n=t[r];return n||((n=Object.create((e||Fr).prototype)).ptr=r,t[r]=n)}Pr(),Fr.prototype=Object.create(Fr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.__class__=Fr,Fr.__cache__={},o.WrapperObject=Fr,o.getCache=xr,o.wrapPointer=Ar,o.castObject=function(r,e){return Ar(r.ptr,e)},o.NULL=Ar(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete xr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Mr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Mr.needed){for(var r=0;r<Mr.temps.length;r++)o._free(Mr.temps[r]);Mr.temps.length=0,o._free(Mr.buffer),Mr.buffer=0,Mr.size+=Mr.needed,Mr.needed=0}Mr.buffer||(Mr.size+=128,Mr.buffer=o._malloc(Mr.size),_(Mr.buffer)),Mr.pos=0},alloc:function(r,e){_(Mr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Mr.pos+i>=Mr.size?(_(i>0),Mr.needed+=i,t=o._malloc(i),Mr.temps.push(t)):(t=Mr.buffer+Mr.pos,Mr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Rr(){this.ptr=ur(),xr(Rr)[this.ptr]=this}function Cr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function zr(){this.ptr=Er(),xr(zr)[this.ptr]=this}return Rr.prototype=Object.create(Fr.prototype),Rr.prototype.constructor=Rr,Rr.prototype.__class__=Rr,Rr.__cache__={},o.CExpat=Rr,Rr.prototype.version=Rr.prototype.version=function(){var r=this.ptr;return F(cr(r))},Rr.prototype.create=Rr.prototype.create=function(){var r=this.ptr;return!!fr(r)},Rr.prototype.destroy=Rr.prototype.destroy=function(){var r=this.ptr;lr(r)},Rr.prototype.parse=Rr.prototype.parse=function(r){var e=this.ptr;return Mr.prepare(),r=r&&"object"==typeof r?r.ptr:function(r){if("string"==typeof r){var e=ir(r),t=Mr.alloc(e,g);return Mr.copy(e,g,t),t}return r}(r),!!dr(e,r)},Rr.prototype.tag=Rr.prototype.tag=function(){var r=this.ptr;return F(pr(r))},Rr.prototype.attrs=Rr.prototype.attrs=function(){var r=this.ptr;return F(hr(r))},Rr.prototype.content=Rr.prototype.content=function(){var r=this.ptr;return F(mr(r))},Rr.prototype.startElement=Rr.prototype.startElement=function(){var r=this.ptr;vr(r)},Rr.prototype.endElement=Rr.prototype.endElement=function(){var r=this.ptr;wr(r)},Rr.prototype.characterData=Rr.prototype.characterData=function(){var r=this.ptr;_r(r)},Rr.prototype.__destroy__=Rr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},Cr.prototype=Object.create(Fr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.VoidPtr=Cr,Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;gr(r)},zr.prototype=Object.create(Rr.prototype),zr.prototype.constructor=zr,zr.prototype.__class__=zr,zr.__cache__={},o.CExpatJS=zr,zr.prototype.startElement=zr.prototype.startElement=function(){var r=this.ptr;br(r)},zr.prototype.endElement=zr.prototype.endElement=function(){var r=this.ptr;kr(r)},zr.prototype.characterData=zr.prototype.characterData=function(){var r=this.ptr;Dr(r)},zr.prototype.__destroy__=zr.prototype.__destroy__=function(){var r=this.ptr;Sr(r)},r.ready},e.exports=n;var o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function i(r,e,t){var n=r.default||r;return n.__hpcc_promise||(n.__hpcc_promise=n({wasmBinary:t,locateFile:function(r,t){return function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(e||function(r){if(!arguments.length)return o;var e=o;return o=r,e}()||t||".","/")+"/"+function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(r,"/")}})),n.__hpcc_promise}!function(){function r(r,e){this.tag=r,this.attrs=e,this._content=""}Object.defineProperty(r.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),r.prototype.appendContent=function(r){this._content+=r}}();var a={exports:{}};!function(r,e){var t=function(){var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise(function(r,e){t=r,n=e});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=function(r,e){throw e},d=!0,p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var h=o.print||console.log.bind(console),m=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit&&(l=o.quit);var v=16;var w,_=0,y=function(r){_=r},g=function(){return _};o.wasmBinary&&(w=o.wasmBinary);var E,b=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&V("no native wasm support detected");var k=!1;function D(r,e){r||V("Assertion failed: "+e)}var S,P,F,x,A,M,R,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&C)return C.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function j(r,e){return r?z(F,r,e):""}function T(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function B(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function N(r){S=r,o.HEAP8=P=new Int8Array(r),o.HEAP16=x=new Int16Array(r),o.HEAP32=A=new Int32Array(r),o.HEAPU8=F=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=M=new Float64Array(r)}o.INITIAL_MEMORY;var O=[],L=[],I=[],U=0;var H=0,W=null;function q(r){H++,o.monitorRunDependencies&&o.monitorRunDependencies(H)}function G(r){if(H--,o.monitorRunDependencies&&o.monitorRunDependencies(H),0==H&&W){var e=W;W=null,e()}}function V(r){o.onAbort&&o.onAbort(r),m(r+=""),k=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var J,X,Y,K,$="data:application/octet-stream;base64,";function Q(r){return r.startsWith($)}function Z(r){try{if(r==J&&w)return new Uint8Array(w);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){V(r)}}Q(J="graphvizlib.wasm")||(X=J,J=o.locateFile?o.locateFile(X,p):p+X);var rr,er={141888:function(r,e){var t=j(r),n=j(e);lr.createPath("/",ir.dirname(t)),lr.writeFile(ir.join("/",t),n)}};function tr(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?R.get(t)():R.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}rr=function(){return performance.now()};var nr=!0;function or(r){return A[Ar()>>2]=r,r}var ir={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=ir.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=ir.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return ir.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return ir.normalize(r.join("/"))},join2:function(r,e){return ir.normalize(r+"/"+e)}};var ar={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:lr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=ar.resolve(r).substr(1),e=ar.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},sr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){sr.ttys[r]={input:[],output:[],ops:e},lr.registerDevice(r,sr.stream_ops)},stream_ops:{open:function(r){var e=sr.ttys[r.node.rdev];if(!e)throw new lr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new lr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new lr.ErrnoError(29)}if(void 0===s&&0===i)throw new lr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new lr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new lr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=_r(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(h(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(h(z(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(m(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(z(r.output,0)),r.output=[])}}};function ur(r,e){F.fill(0,r,r+e)}function cr(r){r=function(r,e){return e||(e=v),Math.ceil(r/e)*e}(r,65536);var e=zr(65536,r);return e?(ur(e,r),e):0}var fr={ops_table:null,mount:function(r){return fr.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(lr.isBlkdev(t)||lr.isFIFO(t))throw new lr.ErrnoError(63);fr.ops_table||(fr.ops_table={dir:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,lookup:fr.node_ops.lookup,mknod:fr.node_ops.mknod,rename:fr.node_ops.rename,unlink:fr.node_ops.unlink,rmdir:fr.node_ops.rmdir,readdir:fr.node_ops.readdir,symlink:fr.node_ops.symlink},stream:{llseek:fr.stream_ops.llseek}},file:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:{llseek:fr.stream_ops.llseek,read:fr.stream_ops.read,write:fr.stream_ops.write,allocate:fr.stream_ops.allocate,mmap:fr.stream_ops.mmap,msync:fr.stream_ops.msync}},link:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,readlink:fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:lr.chrdev_stream_ops}});var o=lr.createNode(r,e,t,n);return lr.isDir(o.mode)?(o.node_ops=fr.ops_table.dir.node,o.stream_ops=fr.ops_table.dir.stream,o.contents={}):lr.isFile(o.mode)?(o.node_ops=fr.ops_table.file.node,o.stream_ops=fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):lr.isLink(o.mode)?(o.node_ops=fr.ops_table.link.node,o.stream_ops=fr.ops_table.link.stream):lr.isChrdev(o.mode)&&(o.node_ops=fr.ops_table.chrdev.node,o.stream_ops=fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=lr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,lr.isDir(r.mode)?e.size=4096:lr.isFile(r.mode)?e.size=r.usedBytes:lr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&fr.resizeFileStorage(r,e.size)},lookup:function(r,e){throw lr.genericErrors[44]},mknod:function(r,e,t,n){return fr.createNode(r,e,t,n)},rename:function(r,e,t){if(lr.isDir(r.mode)){var n;try{n=lr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new lr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=lr.lookupNode(r,e);for(var n in t.contents)throw new lr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=fr.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!lr.isLink(r.mode))throw new lr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===P.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(fr.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&lr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new lr.ErrnoError(28);return n},allocate:function(r,e,t){fr.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new lr.ErrnoError(28);if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==S){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=cr(t)))throw new lr.ErrnoError(48);P.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);return 2&o?0:(fr.stream_ops.write(r,e,0,n,t,!1),0)}}};var lr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=ar.resolve(lr.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new lr.ErrnoError(32);for(var o=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=lr.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=lr.lookupNode(i,o[s]),a=ir.join2(a,o[s]),lr.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;lr.isLink(i.mode);){var f=lr.readlink(a);if(a=ar.resolve(ir.dirname(a),f),i=lr.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new lr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(lr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%lr.nameTable.length},hashAddNode:function(r){var e=lr.hashName(r.parent.id,r.name);r.name_next=lr.nameTable[e],lr.nameTable[e]=r},hashRemoveNode:function(r){var e=lr.hashName(r.parent.id,r.name);if(lr.nameTable[e]===r)lr.nameTable[e]=r.name_next;else for(var t=lr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=lr.mayLookup(r);if(t)throw new lr.ErrnoError(t,r);for(var n=lr.hashName(r.id,e),o=lr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return lr.lookup(r,e)},createNode:function(r,e,t,n){var o=new lr.FSNode(r,e,t,n);return lr.hashAddNode(o),o},destroyNode:function(r){lr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=lr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return lr.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=lr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{lr.lookupNode(r,e);return 20}catch(r){}return lr.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=lr.lookupNode(r,e)}catch(r){return r.errno}var o=lr.nodePermissions(r,"wx");if(o)return o;if(t){if(!lr.isDir(n.mode))return 54;if(lr.isRoot(n)||lr.getPath(n)===lr.cwd())return 10}else if(lr.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?lr.isLink(r.mode)?32:lr.isDir(r.mode)&&("r"!==lr.flagsToPermissionString(e)||512&e)?31:lr.nodePermissions(r,lr.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||lr.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!lr.streams[t])return t;throw new lr.ErrnoError(33)},getStream:function(r){return lr.streams[r]},createStream:function(r,e,t){lr.FSStream||(lr.FSStream=function(){},lr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new lr.FSStream;for(var o in r)n[o]=r[o];r=n;var i=lr.nextfd(e,t);return r.fd=i,lr.streams[i]=r,r},closeStream:function(r){lr.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=lr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new lr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){lr.devices[r]={stream_ops:e}},getDevice:function(r){return lr.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),lr.syncFSRequests++,lr.syncFSRequests>1&&m("warning: "+lr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=lr.getMounts(lr.root.mount),n=0;function o(r){return lr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&lr.root)throw new lr.ErrnoError(10);if(!o&&!i){var a=lr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,lr.isMountpoint(n))throw new lr.ErrnoError(10);if(!lr.isDir(n.mode))throw new lr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?lr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=lr.lookupPath(r,{follow_mount:!1});if(!lr.isMountpoint(e.node))throw new lr.ErrnoError(28);var t=e.node,n=t.mounted,o=lr.getMounts(n);Object.keys(lr.nameTable).forEach(function(r){for(var e=lr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&lr.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=lr.lookupPath(r,{parent:!0}).node,o=ir.basename(r);if(!o||"."===o||".."===o)throw new lr.ErrnoError(28);var i=lr.mayCreate(n,o);if(i)throw new lr.ErrnoError(i);if(!n.node_ops.mknod)throw new lr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,lr.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,lr.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{lr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,lr.mknod(r,e,t)},symlink:function(r,e){if(!ar.resolve(r))throw new lr.ErrnoError(44);var t=lr.lookupPath(e,{parent:!0}).node;if(!t)throw new lr.ErrnoError(44);var n=ir.basename(e),o=lr.mayCreate(t,n);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.symlink)throw new lr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=ir.dirname(r),i=ir.dirname(e),a=ir.basename(r),s=ir.basename(e);if(t=lr.lookupPath(r,{parent:!0}).node,n=lr.lookupPath(e,{parent:!0}).node,!t||!n)throw new lr.ErrnoError(44);if(t.mount!==n.mount)throw new lr.ErrnoError(75);var u,c=lr.lookupNode(t,a),f=ar.relative(r,i);if("."!==f.charAt(0))throw new lr.ErrnoError(28);if("."!==(f=ar.relative(e,o)).charAt(0))throw new lr.ErrnoError(55);try{u=lr.lookupNode(n,s)}catch(r){}if(c!==u){var l=lr.isDir(c.mode),d=lr.mayDelete(t,a,l);if(d)throw new lr.ErrnoError(d);if(d=u?lr.mayDelete(n,s,l):lr.mayCreate(n,s))throw new lr.ErrnoError(d);if(!t.node_ops.rename)throw new lr.ErrnoError(63);if(lr.isMountpoint(c)||u&&lr.isMountpoint(u))throw new lr.ErrnoError(10);if(n!==t&&(d=lr.nodePermissions(t,"w")))throw new lr.ErrnoError(d);try{lr.trackingDelegate.willMovePath}catch(t){m("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}lr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{lr.hashAddNode(c)}try{lr.trackingDelegate.onMovePath}catch(t){m("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!0);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.rmdir)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=lr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new lr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!1);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.unlink)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=lr.lookupPath(r).node;if(!e)throw new lr.ErrnoError(44);if(!e.node_ops.readlink)throw new lr.ErrnoError(28);return ar.resolve(lr.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=lr.lookupPath(r,{follow:!e}).node;if(!t)throw new lr.ErrnoError(44);if(!t.node_ops.getattr)throw new lr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return lr.stat(r,!0)},chmod:function(r,e,t){var n;"string"==typeof r?n=lr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new lr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){lr.chmod(r,e,!0)},fchmod:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);lr.chmod(t.node,e)},chown:function(r,e,t,n){var o;"string"==typeof r?o=lr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new lr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){lr.chown(r,e,t,!0)},fchown:function(r,e,t){var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);lr.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new lr.ErrnoError(28);var t;"string"==typeof r?t=lr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new lr.ErrnoError(63);if(lr.isDir(t.mode))throw new lr.ErrnoError(31);if(!lr.isFile(t.mode))throw new lr.ErrnoError(28);var n=lr.nodePermissions(t,"w");if(n)throw new lr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);if(0==(2097155&t.flags))throw new lr.ErrnoError(28);lr.truncate(t.node,e)},utime:function(r,e,t){var n=lr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new lr.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?lr.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=ir.normalize(r);try{a=lr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new lr.ErrnoError(20)}else a=lr.mknod(r,t,0),s=!0;if(!a)throw new lr.ErrnoError(44);if(lr.isChrdev(a.mode)&&(e&=-513),65536&e&&!lr.isDir(a.mode))throw new lr.ErrnoError(54);if(!s){var u=lr.mayOpen(a,e);if(u)throw new lr.ErrnoError(u)}512&e&&lr.truncate(a,0),e&=-131713;var c=lr.createStream({node:a,path:lr.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(lr.readFiles||(lr.readFiles={}),r in lr.readFiles||(lr.readFiles[r]=1,m("FS.trackingDelegate error on read file: "+r)));try{lr.trackingDelegate.onOpenFile}catch(e){m("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(lr.isClosed(r))throw new lr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{lr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new lr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new lr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(1==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.read)throw new lr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.write)throw new lr.ErrnoError(28);r.seekable&&1024&r.flags&&lr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&lr.trackingDelegate.onWriteToFile&&lr.trackingDelegate.onWriteToFile(r.path)}catch(e){m("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(e<0||t<=0)throw new lr.ErrnoError(28);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(!lr.isFile(r.node.mode)&&!lr.isDir(r.node.mode))throw new lr.ErrnoError(43);if(!r.stream_ops.allocate)throw new lr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new lr.ErrnoError(2);if(1==(2097155&r.flags))throw new lr.ErrnoError(2);if(!r.stream_ops.mmap)throw new lr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new lr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=lr.open(r,e.flags),o=lr.stat(r).size,i=new Uint8Array(o);return lr.read(n,i,0,o,0),"utf8"===e.encoding?t=z(i,0):"binary"===e.encoding&&(t=i),lr.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=lr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(B(e)+1),i=T(e,o,0,o.length);lr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lr.write(n,e,0,e.byteLength,void 0,t.canOwn)}lr.close(n)},cwd:function(){return lr.currentPath},chdir:function(r){var e=lr.lookupPath(r,{follow:!0});if(null===e.node)throw new lr.ErrnoError(44);if(!lr.isDir(e.node.mode))throw new lr.ErrnoError(54);var t=lr.nodePermissions(e.node,"x");if(t)throw new lr.ErrnoError(t);lr.currentPath=e.path},createDefaultDirectories:function(){lr.mkdir("/tmp"),lr.mkdir("/home"),lr.mkdir("/home/web_user")},createDefaultDevices:function(){lr.mkdir("/dev"),lr.registerDevice(lr.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),lr.mkdev("/dev/null",lr.makedev(1,3)),sr.register(lr.makedev(5,0),sr.default_tty_ops),sr.register(lr.makedev(6,0),sr.default_tty1_ops),lr.mkdev("/dev/tty",lr.makedev(5,0)),lr.mkdev("/dev/tty1",lr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){V("randomDevice")}}();lr.createDevice("/dev","random",r),lr.createDevice("/dev","urandom",r),lr.mkdir("/dev/shm"),lr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){lr.mkdir("/proc");var r=lr.mkdir("/proc/self");lr.mkdir("/proc/self/fd"),lr.mount({mount:function(){var e=lr.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=lr.getStream(t);if(!n)throw new lr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?lr.createDevice("/dev","stdin",o.stdin):lr.symlink("/dev/tty","/dev/stdin"),o.stdout?lr.createDevice("/dev","stdout",null,o.stdout):lr.symlink("/dev/tty","/dev/stdout"),o.stderr?lr.createDevice("/dev","stderr",null,o.stderr):lr.symlink("/dev/tty1","/dev/stderr"),lr.open("/dev/stdin",0),lr.open("/dev/stdout",1),lr.open("/dev/stderr",1)},ensureErrnoError:function(){lr.ErrnoError||(lr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},lr.ErrnoError.prototype=new Error,lr.ErrnoError.prototype.constructor=lr.ErrnoError,[44].forEach(function(r){lr.genericErrors[r]=new lr.ErrnoError(r),lr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){lr.ensureErrnoError(),lr.nameTable=new Array(4096),lr.mount(fr,{},"/"),lr.createDefaultDirectories(),lr.createDefaultDevices(),lr.createSpecialDirectories(),lr.filesystems={MEMFS:fr}},init:function(r,e,t){lr.init.initialized=!0,lr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,lr.createStandardStreams()},quit:function(){lr.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<lr.streams.length;e++){var t=lr.streams[e];t&&lr.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=lr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=lr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ir.basename(r),n=lr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:lr.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ir.join2(r,i);try{lr.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=ir.join2("string"==typeof r?r:lr.getPath(r),e),a=lr.getMode(n,o);return lr.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?ir.join2("string"==typeof r?r:lr.getPath(r),e):r,s=lr.getMode(n,o),u=lr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}lr.chmod(u,146|s);var d=lr.open(u,577);lr.write(d,t,0,t.length,0,i),lr.close(d),lr.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=ir.join2("string"==typeof r?r:lr.getPath(r),e),i=lr.getMode(!!t,!!n);lr.createDevice.major||(lr.createDevice.major=64);var a=lr.makedev(lr.createDevice.major++,0);return lr.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new lr.ErrnoError(29)}if(void 0===u&&0===a)throw new lr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new lr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),lr.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=_r(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new lr.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_r(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,h("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=lr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return lr.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){lr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?ar.resolve(ir.join2(r,e)):r;function p(t){function u(t){l&&l(),c||lr.createDataFile(r,e,t,n,i,f),a&&a(),G()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),G()}),p=!0)}),p||u(t)}q(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){D(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&G()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&q()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){h("creating db"),o.result.createObjectStore(lr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([lr.DB_STORE_NAME],"readwrite"),i=n.objectStore(lr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(lr.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([lr.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(lr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){lr.analyzePath(r).exists&&lr.unlink(r),lr.createDataFile(ir.dirname(r),ir.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},dr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=lr.cwd();else{var o=lr.getStream(r);if(!o)throw new lr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new lr.ErrnoError(44);return n}return ir.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&ir.normalize(e)!==ir.normalize(lr.getPath(r.node)))return-54;throw r}return A[t>>2]=n.dev,A[t+4>>2]=0,A[t+8>>2]=n.ino,A[t+12>>2]=n.mode,A[t+16>>2]=n.nlink,A[t+20>>2]=n.uid,A[t+24>>2]=n.gid,A[t+28>>2]=n.rdev,A[t+32>>2]=0,K=[n.size>>>0,(Y=n.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+40>>2]=K[0],A[t+44>>2]=K[1],A[t+48>>2]=4096,A[t+52>>2]=n.blocks,A[t+56>>2]=n.atime.getTime()/1e3|0,A[t+60>>2]=0,A[t+64>>2]=n.mtime.getTime()/1e3|0,A[t+68>>2]=0,A[t+72>>2]=n.ctime.getTime()/1e3|0,A[t+76>>2]=0,K=[n.ino>>>0,(Y=n.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+80>>2]=K[0],A[t+84>>2]=K[1],0},doMsync:function(r,e,t,n,o){var i=F.slice(r,r+t);lr.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=ir.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),lr.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return lr.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=lr.readlink(r),o=Math.min(t,B(n)),i=P[e+o];return T(n,F,e,t+1),P[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=lr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&lr.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=lr.getStream(t);return n&&lr.close(n),lr.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.read(r,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.write(r,P,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return dr.varargs+=4,A[dr.varargs-4>>2]},getStr:function(r){return j(r)},getStreamFromFD:function(r){var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);return e},get64:function(r,e){return r}};var pr=[];function hr(r){try{return E.grow(r-S.byteLength+65535>>>16),N(E.buffer),1}catch(r){}}var mr={};function vr(){if(!vr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in mr)void 0===mr[e]?delete r[e]:r[e]=mr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);vr.strings=t}return vr.strings}var wr=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=lr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function _r(r,e,t){var n=t>0?t:B(r)+1,o=new Array(n),i=T(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(wr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return lr.isDir(this.mode)}},isDevice:{get:function(){return lr.isChrdev(this.mode)}}}),lr.FSNode=wr,lr.staticInit();var yr={z:function(r,e){return function(r,e){var t;if(0===r)t=Date.now();else{if(1!==r&&4!==r||!nr)return or(28),-1;t=rr()}return A[e>>2]=t/1e3|0,A[e+4>>2]=t%1e3*1e3*1e3|0,0}(r,e)},A:function(r,e){try{return r=dr.getStr(r),dr.doAccess(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},i:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 0:return(o=dr.get())<0?-28:lr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=dr.get();return n.flags|=o,0;case 12:return o=dr.get(),x[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return or(28),-1;default:return-28}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},l:function(r,e){try{var t=dr.getStreamFromFD(r);return dr.doStat(lr.stat,t.path,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},e:function(){return 42},B:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=dr.get();return A[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=dr.get(),lr.ioctl(n,e,o);case 21523:case 21524:return n.tty?0:-59;default:V("bad ioctl syscall "+e)}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},y:function(r,e,t,n,o,i){try{return function(r,e,t,n,o,i){var a;i<<=12;var s=!1;if(0!=(16&n)&&r%65536!=0)return-28;if(0!=(32&n)){if(!(a=cr(e)))return-48;s=!0}else{var u=lr.getStream(o);if(!u)return-8;var c=lr.mmap(u,r,e,i,t,n);a=c.ptr,s=c.allocated}return dr.mappings[a]={malloc:a,len:e,allocated:s,fd:o,prot:t,flags:n,offset:i},a}(r,e,t,n,o,i)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},x:function(r,e){try{return function(r,e){var t=dr.mappings[r];if(0===e||!t)return-28;if(e===t.len){var n=lr.getStream(t.fd);n&&2&t.prot&&dr.doMsync(r,n,e,t.flags,t.offset),dr.mappings[r]=null,t.allocated&&xr(t.malloc)}return 0}(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},f:function(r,e,t){dr.varargs=t;try{var n=dr.getStr(r),o=t?dr.get():0;return lr.open(n,e,o).fd}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},D:function(r,e){try{return r=dr.getStr(r),dr.doStat(lr.stat,r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},C:function(r){try{return r=dr.getStr(r),lr.unlink(r),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},t:function(){throw"longjmp"},s:function(){V()},E:function(r,e,t){var n=function(r,e){var t;for(pr.length=0,e>>=2;t=F[r++];){var n=t<105;n&&1&e&&e++,pr.push(n?M[e++>>1]:A[e]),++e}return pr}(e,t);return er[r].apply(null,n)},q:function(r,e,t){F.copyWithin(r,e,e+t)},r:function(r){var e,t,n=F.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),hr(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},v:function(r,e){try{var t=0;return vr().forEach(function(n,o){var i=e+t;A[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)P[e++>>0]=r.charCodeAt(n);t||(P[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},w:function(r,e){try{var t=vr();A[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),A[e>>2]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},a:function(r){!function(r,e){b||U>0||(o.onExit&&o.onExit(r),k=!0),l(r,new jr(r))}(r)},d:function(r){try{var e=dr.getStreamFromFD(r);return lr.close(e),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},u:function(r,e){try{var t=dr.getStreamFromFD(r),n=t.tty?2:lr.isDir(t.mode)?3:lr.isLink(t.mode)?7:4;return P[e>>0]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},k:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doReadv(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},o:function(r,e,t,n,o){try{var i=dr.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(lr.llseek(i,a,n),K=[i.position>>>0,(Y=i.position,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[o>>2]=K[0],A[o+4>>2]=K[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},j:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doWritev(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},c:function(){return g()},p:function(r){var e=Date.now();return A[r>>2]=e/1e3|0,A[r+4>>2]=e%1e3*1e3|0,0},m:function(r,e,t,n,o,i,a){var s=Mr();try{return R.get(r)(e,t,n,o,i,a)}catch(r){if(Rr(s),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},n:function(r,e){var t=Mr();try{R.get(r)(e)}catch(r){if(Rr(t),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},b:function(r){y(r)},g:function(r){var e=Date.now()/1e3|0;return r&&(A[r>>2]=e),e},h:function(r){return 0!==r&&ur(r,16),0}};!function(){var r={a:yr};function e(r,e){var t,n=r.exports;o.asm=n,N((E=o.asm.F).buffer),R=o.asm.O,t=o.asm.G,L.unshift(t),G()}function t(r){e(r.instance)}function i(e){return(!w&&d&&"function"==typeof fetch?fetch(J,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+J+"\'";return r.arrayBuffer()}).catch(function(){return Z(J)}):Promise.resolve().then(function(){return Z(J)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){m("failed to asynchronously prepare wasm: "+r),V(r)})}if(q(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return m("Module.instantiateWasm callback failed with error: "+r),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||Q(J)||"function"!=typeof fetch?i(t):fetch(J,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return m("wasm streaming compile failed: "+r),m("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.G).apply(null,arguments)};var gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.H).apply(null,arguments)},Er=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(Er=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.I).apply(null,arguments)},br=o._emscripten_bind_Graphviz_version_0=function(){return(br=o._emscripten_bind_Graphviz_version_0=o.asm.J).apply(null,arguments)},kr=o._emscripten_bind_Graphviz_lastError_0=function(){return(kr=o._emscripten_bind_Graphviz_lastError_0=o.asm.K).apply(null,arguments)},Dr=o._emscripten_bind_Graphviz_layout_3=function(){return(Dr=o._emscripten_bind_Graphviz_layout_3=o.asm.L).apply(null,arguments)},Sr=o._emscripten_bind_Graphviz_createFile_2=function(){return(Sr=o._emscripten_bind_Graphviz_createFile_2=o.asm.M).apply(null,arguments)},Pr=o._emscripten_bind_Graphviz___destroy___0=function(){return(Pr=o._emscripten_bind_Graphviz___destroy___0=o.asm.N).apply(null,arguments)};o._malloc=function(){return(o._malloc=o.asm.P).apply(null,arguments)};var Fr,xr=o._free=function(){return(xr=o._free=o.asm.Q).apply(null,arguments)},Ar=o.___errno_location=function(){return(Ar=o.___errno_location=o.asm.R).apply(null,arguments)},Mr=o.stackSave=function(){return(Mr=o.stackSave=o.asm.S).apply(null,arguments)},Rr=o.stackRestore=function(){return(Rr=o.stackRestore=o.asm.T).apply(null,arguments)},Cr=o._setThrew=function(){return(Cr=o._setThrew=o.asm.U).apply(null,arguments)},zr=o._memalign=function(){return(zr=o._memalign=o.asm.V).apply(null,arguments)};function jr(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function Tr(r){function e(){Fr||(Fr=!0,o.calledRun=!0,k||(o.noFSInit||lr.init.initialized||lr.init(),lr.ignorePermissions=!1,tr(L),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),I.unshift(r);var r;tr(I)}()))}H>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),O.unshift(r);var r;tr(O)}(),H>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),e()},1)):e()))}if(W=function r(){Fr||Tr(),Fr||(W=r)},o.run=Tr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Br(){}function Nr(r){return(r||Br).__cache__}function Or(r,e){var t=Nr(e),n=t[r];return n||((n=Object.create((e||Br).prototype)).ptr=r,t[r]=n)}Tr(),Br.prototype=Object.create(Br.prototype),Br.prototype.constructor=Br,Br.prototype.__class__=Br,Br.__cache__={},o.WrapperObject=Br,o.getCache=Nr,o.wrapPointer=Or,o.castObject=function(r,e){return Or(r.ptr,e)},o.NULL=Or(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Nr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Lr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Lr.needed){for(var r=0;r<Lr.temps.length;r++)o._free(Lr.temps[r]);Lr.temps.length=0,o._free(Lr.buffer),Lr.buffer=0,Lr.size+=Lr.needed,Lr.needed=0}Lr.buffer||(Lr.size+=128,Lr.buffer=o._malloc(Lr.size),D(Lr.buffer)),Lr.pos=0},alloc:function(r,e){D(Lr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Lr.pos+i>=Lr.size?(D(i>0),Lr.needed+=i,t=o._malloc(i),Lr.temps.push(t)):(t=Lr.buffer+Lr.pos,Lr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Ir(r){if("string"==typeof r){var e=_r(r),t=Lr.alloc(e,P);return Lr.copy(e,P,t),t}return r}function Ur(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Hr(r,e){r&&"object"==typeof r&&(r=r.ptr),e&&"object"==typeof e&&(e=e.ptr),this.ptr=Er(r,e),Nr(Hr)[this.ptr]=this}return Ur.prototype=Object.create(Br.prototype),Ur.prototype.constructor=Ur,Ur.prototype.__class__=Ur,Ur.__cache__={},o.VoidPtr=Ur,Ur.prototype.__destroy__=Ur.prototype.__destroy__=function(){var r=this.ptr;gr(r)},Hr.prototype=Object.create(Br.prototype),Hr.prototype.constructor=Hr,Hr.prototype.__class__=Hr,Hr.__cache__={},o.Graphviz=Hr,Hr.prototype.version=Hr.prototype.version=function(){var r=this.ptr;return j(br(r))},Hr.prototype.lastError=Hr.prototype.lastError=function(){var r=this.ptr;return j(kr(r))},Hr.prototype.layout=Hr.prototype.layout=function(r,e,t){var n=this.ptr;return Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),t=t&&"object"==typeof t?t.ptr:Ir(t),j(Dr(n,r,e,t))},Hr.prototype.createFile=Hr.prototype.createFile=function(r,e){var t=this.ptr;Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),Sr(t,r,e)},Hr.prototype.__destroy__=Hr.prototype.__destroy__=function(){var r=this.ptr;Pr(r)},e.ready}}();r.exports=t}(a);var s=a.exports,u=Object.freeze(Object.assign(Object.create(null),a.exports,{default:s})),c=function(){return(c=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},f=function(r,e){for(var t=0,n=e.length,o=r.length;t<n;t++,o++)r[o]=e[t];return r};function l(r){return{path:r.path,data:\'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\\n<svg width="\'+r.width+\'" height="\'+r.height+\'"></svg>\'}}function d(r,e){var t,n=c({images:[],files:[]},e);f(f([],n.files),(t=n.images,t.map(l))).forEach(function(e){return r.createFile(e.path,e.data)})}var p={layout:function(r,e,t,n){return void 0===e&&(e="svg"),void 0===t&&(t="dot"),r?i(u,null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then(function(o){var i=new o.Graphviz(void 0!==(null==n?void 0:n.yInvert)&&(null==n?void 0:n.yInvert),void 0!==(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);d(i,n);var a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a}):Promise.resolve("")},circo:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"circo",t)},dot:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"dot",t)},fdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"fdp",t)},sfdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"sfdp",t)},neato:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"neato",t)},osage:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"osage",t)},patchwork:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"patchwork",t)},twopi:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"twopi",t)}},h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(function(r,e,t){return r(t={path:e,exports:{},require:function(r,e){return m(null==e&&t.path)}},t.exports),t.exports})(function(r,e){r.exports=function(){function r(r){return"function"==typeof r}var e=Array.isArray?Array.isArray:function(r){return"[object Array]"===Object.prototype.toString.call(r)},t=0,n=void 0,o=void 0,i=function(r,e){d[t]=r,d[t+1]=e,2===(t+=2)&&(o?o(p):y())},a="undefined"!=typeof window?window:void 0,s=a||{},u=s.MutationObserver||s.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var r=setTimeout;return function(){return r(p,1)}}var d=new Array(1e3);function p(){for(var r=0;r<t;r+=2){var e=d[r],n=d[r+1];e(n),d[r]=void 0,d[r+1]=void 0}t=0}var m,v,w,_,y=void 0;function g(r,e){var t=this,n=new this.constructor(k);void 0===n[b]&&B(n);var o=t._state;if(o){var a=arguments[o-1];i(function(){return j(o,n,a,t._result)})}else C(t,n,r,e);return n}function E(r){if(r&&"object"==typeof r&&r.constructor===this)return r;var e=new this(k);return x(e,r),e}c?y=function(){return process.nextTick(p)}:u?(v=0,w=new u(p),_=document.createTextNode(""),w.observe(_,{characterData:!0}),y=function(){_.data=v=++v%2}):f?((m=new MessageChannel).port1.onmessage=p,y=function(){return m.port2.postMessage(0)}):y=void 0===a?function(){try{var r=Function("return this")().require("vertx");return void 0!==(n=r.runOnLoop||r.runOnContext)?function(){n(p)}:l()}catch(r){return l()}}():l();var b=Math.random().toString(36).substring(2);function k(){}var D=void 0,S=1,P=2;function F(e,t,n){t.constructor===e.constructor&&n===g&&t.constructor.resolve===E?function(r,e){e._state===S?M(r,e._result):e._state===P?R(r,e._result):C(e,void 0,function(e){return x(r,e)},function(e){return R(r,e)})}(e,t):void 0===n?M(e,t):r(n)?function(r,e,t){i(function(r){var n=!1,o=function(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}(t,e,function(t){n||(n=!0,e!==t?x(r,t):M(r,t))},function(e){n||(n=!0,R(r,e))},r._label);!n&&o&&(n=!0,R(r,o))},r)}(e,t,n):M(e,t)}function x(r,e){if(r===e)R(r,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(n=e),null===n||"object"!==o&&"function"!==o)M(r,e);else{var t=void 0;try{t=e.then}catch(e){return void R(r,e)}F(r,e,t)}var n,o}function A(r){r._onerror&&r._onerror(r._result),z(r)}function M(r,e){r._state===D&&(r._result=e,r._state=S,0!==r._subscribers.length&&i(z,r))}function R(r,e){r._state===D&&(r._state=P,r._result=e,i(A,r))}function C(r,e,t,n){var o=r._subscribers,a=o.length;r._onerror=null,o[a]=e,o[a+S]=t,o[a+P]=n,0===a&&r._state&&i(z,r)}function z(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?j(t,n,o,i):o(i);r._subscribers.length=0}}function j(e,t,n,o){var i=r(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void R(t,new TypeError("A promises callback cannot return that same promise."))}else a=o;t._state!==D||(i&&u?x(t,a):!1===u?R(t,s):e===S?M(t,a):e===P&&R(t,a))}var T=0;function B(r){r[b]=T++,r._state=void 0,r._result=void 0,r._subscribers=[]}var N=function(){function r(r,t){this._instanceConstructor=r,this.promise=new r(k),this.promise[b]||B(this.promise),e(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&M(this.promise,this._result))):R(this.promise,new Error("Array Methods must be provided an Array"))}return r.prototype._enumerate=function(r){for(var e=0;this._state===D&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===E){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===g&&r._state!==D)this._settledAt(r._state,e,r._result);else if("function"!=typeof o)this._remaining--,this._result[e]=r;else if(t===O){var s=new t(k);a?R(s,i):F(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t(function(e){return e(r)}),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===D&&(this._remaining--,r===P?R(n,t):this._result[e]=t),0===this._remaining&&M(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;C(r,void 0,function(r){return t._settledAt(S,e,r)},function(r){return t._settledAt(P,e,r)})},r}(),O=function(){function e(r){this[b]=T++,this._result=this._state=void 0,this._subscribers=[],k!==r&&("function"!=typeof r&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(r,e){try{e(function(e){x(r,e)},function(e){R(r,e)})}catch(e){R(r,e)}}(this,r):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(r){return this.then(null,r)},e.prototype.finally=function(e){var t=this.constructor;return r(e)?this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})}):this.then(e,e)},e}();return O.prototype.then=g,O.all=function(r){return new N(this,r).promise},O.race=function(r){var t=this;return e(r)?new t(function(e,n){for(var o=r.length,i=0;i<o;i++)t.resolve(r[i]).then(e,n)}):new t(function(r,e){return e(new TypeError("You must pass an array to race."))})},O.resolve=E,O.reject=function(r){var e=new this(k);return R(e,r),e},O._setScheduler=function(r){o=r},O._setAsap=function(r){i=r},O._asap=i,O.polyfill=function(){var r=void 0;if(void 0!==h)r=h;else if("undefined"!=typeof self)r=self;else try{r=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if("[object Promise]"===t&&!e.cast)return}r.Promise=O},O.Promise=O,O}()}).polyfill();function v(r){return void 0!==r.children}var w=function(r){var e=[];return r.children.forEach(function(r){v(r)?e.push(w(r)):e.push(_(r))}),"subgraph cluster_"+r.id+\' {\\nid="\'+r.id+\'";\\nlabel="\'+r.text+\'";\\nmargin=16;\\n\'+e.join("\\n")+"\\n}"},_=function(r){return r.id+\' [id="\'+r.id+\'" label="\'+r.text+\'" width=\'+b(r.width)+" height="+b(r.height)+"]"},y=function(r,e,t,n){return r+" -> "+e+\' [id="\'+t+\'", label="\'+n+\'"]\'},g=function(r){return 96*r/72},E=function(r){return 96*r},b=function(r){return r/96};function k(r){var e=r?r.split(",").map(function(r){return g(+r)}):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function D(r,e){var t=r.split(",").map(function(r){return g(+r)}),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function S(r,e,t){return void 0===t&&(t="json"),p[r](e,t).then(function(r){return"json"===t?JSON.parse(r):r})}function P(e,t){if(self.document=self.document||{currentScript:{src:t.wasmFolder+"/dummy.js"}},e.raw)return S(t.engine,e.raw,"svg");var n={},o=[],i=[],a={},s=[],u=[],c={},f=[],l=[];return e.items.forEach(function(r){return function r(e,t){v(e)?(n[e.id]=e,o.push(e),e.children.forEach(function(e){return r(e,!1)}),t&&i.push(w(e))):(a[e.id]=e,s.push(e),t&&u.push(_(e)))}(r,!0)}),e.links.forEach(function(r){c[r.id]=r,f.push(r),l.push(y(r.source.id,r.target.id,r.id,r.text))}),S(t.engine,"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n"+i.join("\\n")+"\\n\\n"+l.join("\\n")+"\\n\\n"+u.join("\\n")+"\\n}").then(function(e){var t=k(e.bb);return e.objects&&e.objects.forEach(function(r){if(r.nodes){var e=function(r,e){var t=k(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,f=r.height,l=D(u,t),d=E(+c),p=E(+f),{x:l.x,y:l.y,width:d,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,f,l,d,p}),e.edges&&e.edges.forEach(function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(" ").map(function(r){return D(r,t)}).map(function(r){return[r.x-t.width/2,r.y-t.height/2]}),o=n.shift();return r(r([],n),[o])}return[]}(e,t))}),{clusters:o,nodes:s,links:f}})}self.onmessage=function(r){P.apply(void 0,r.data).then(function(r){self.postMessage(r)})}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}var Eh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),kh=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o._engine=r,o._wasmFolder=n,o}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData(),o={};return xh({items:n.hierarchy(function(e,t,r){switch(e){case"subgraph":return{id:t.id,text:t.props.text,children:r};case"vertex":delete t.fx,delete t.fy;var n=t.element.node().getBBox(),i={id:t.id,text:t.props.text,width:n.width,height:n.height};return o[i.id]=i,i}}),links:n.allEdges().map(function(e){return{id:e.props.id,source:o[e.source.id],target:o[e.target.id],text:e.props.label||""}}),raw:""},{engine:this._engine,wasmFolder:this._wasmFolder}).response.then(function(e){return t.running()&&(e.clusters.forEach(function(e){var t=n.subgraph(e.id);t.x=e.x+r.width/2-e.width,t.y=e.y+r.height/2-e.height,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id);t.points=h(h([[t.source.x,t.source.y]],void 0!==e.points?e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]}):[]),[[t.target.x,t.target.y]])}),t._graph.moveSubgraphs(!0).moveVertices(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:Eh(o),labelPos:this.center(o)}},t}(fh),Dh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t.stop(),t})},t}(fh);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData();return r.allEdges().forEach(function(e){return delete e.points}),r.allVertices().forEach(function(t){delete t.fx,delete t.fy,t.x=e.width/2+5*Math.random()-2.5,t.y=e.height/2+5*Math.random()-2.5}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t})}}(fh);function Sh(e,t){return e.parent===t.parent?1:2}function Ch(e,t){return e+t.x}function Ah(e,t){return Math.max(e,t.y)}function jh(){var e=Sh,t=1,r=1,n=!1;function o(o){var i,a=0;o.eachAfter(function(t){var r=t.children;r?(t.x=function(e){return e.reduce(Ch,0)/e.length}(r),t.y=function(e){return 1+e.reduce(Ah,0)}(r)):(t.x=i?a+=e(t,i):0,t.y=0,i=t)});var s=function(e){for(var t;t=e.children;)e=t[0];return e}(o),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(o),c=s.x-e(s,u)/2,l=u.x+e(u,s)/2;return o.eachAfter(n?function(e){e.x=(e.x-o.x)*t,e.y=(o.y-e.y)*r}:function(e){e.x=(e.x-c)/(l-c)*t,e.y=(1-(o.y?e.y/o.y:1))*r})}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}function Ph(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Fh(e,t){var r,n,o,i,a,s=new Ih(e),u=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=Mh);r=c.pop();)if(u&&(r.value=+r.data.value),(o=t(r.data))&&(a=o.length))for(r.children=new Array(a),i=a-1;i>=0;--i)c.push(n=r.children[i]=new Ih(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(Nh)}function Mh(e){return e.children}function Oh(e){e.data=e.data.data}function Nh(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ih(e){this.data=e,this.depth=this.height=0,this.parent=null}function Th(e,t){return e.parent===t.parent?1:2}function Lh(e){var t=e.children;return t?t[0]:e.t}function Qh(e){var t=e.children;return t?t[t.length-1]:e.t}function Rh(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function Bh(e,t,r){return e.a.parent===t.parent?e.a:r}function zh(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function Vh(){var e=Th,t=1,r=1,n=null;function o(o){var u=function(e){for(var t,r,n,o,i,a=new zh(e,0),s=[a];t=s.pop();)if(n=t._.children)for(t.children=new Array(i=n.length),o=i-1;o>=0;--o)s.push(r=t.children[o]=new zh(n[o],o)),r.parent=t;return(a.parent=new zh(null,0)).children=[a],a}(o);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(a),n)o.eachBefore(s);else{var c=o,l=o,h=o;o.eachBefore(function(e){e.x<c.x&&(c=e),e.x>l.x&&(l=e),e.depth>h.depth&&(h=e)});var f=c===l?1:e(c,l)/2,d=f-c.x,p=t/(l.x+f+d),g=r/(h.depth||1);o.eachBefore(function(e){e.x=(e.x+d)*p,e.y=e.depth*g})}return o}function i(t){var r=t.children,n=t.parent.children,o=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,o=e.children,i=o.length;--i>=0;)(t=o[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var i=(r[0].z+r[r.length-1].z)/2;o?(t.z=o.z+e(t._,o._),t.m=t.z-i):t.z=i}else o&&(t.z=o.z+e(t._,o._));t.parent.A=function(t,r,n){if(r){for(var o,i=t,a=t,s=r,u=i.parent.children[0],c=i.m,l=a.m,h=s.m,f=u.m;s=Qh(s),i=Lh(i),s&&i;)u=Lh(u),(a=Qh(a)).a=t,(o=s.z+h-i.z-c+e(s._,i._))>0&&(Rh(Bh(s,t,n),t,o),c+=o,l+=o),h+=s.m,c+=i.m,f+=u.m,l+=a.m;s&&!Qh(a)&&(a.t=s,a.m+=h-l),i&&!Lh(u)&&(u.t=i,u.m+=c-f,n=t)}return n}(t,o,t.parent.A||n[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}Ih.prototype=Fh.prototype={constructor:Ih,count:function(){return this.eachAfter(Ph)},each:function(e){var t,r,n,o,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(e(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;o=a.pop();)e(o);return this},eachBefore:function(e){for(var t,r,n=this,o=[n];n=o.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)o.push(t[r]);return this},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each(function(t){e.push(t)}),e},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Fh(this).eachBefore(Oh)}},zh.prototype=Object.create(Ih.prototype);var Gh=A().x(function(e){return e.x}).y(function(e){return e.y}),Hh=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=e),void 0===n&&(n=t),this.x1=e,this.y1=t,this.x2=r,this.y2=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.x2-this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.y2-this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return{x:this.x1+this.width/2,y:this.y1+this.height/2}},enumerable:!1,configurable:!0}),e.prototype.reset=function(e,t){this.x1=e,this.x2=e,this.y1=t,this.y2=t},e.prototype.expand=function(e,t){this.x1>e?this.x1=e:this.x2<e&&(this.x2=e),this.y1>t?this.y1=t:this.y2<t&&(this.y2=t)},e}(),Uh=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n._visited={},n}return s(t,e),t.prototype.sortTree=function(e,t){var r=this;t||(t=this._tree),t.children.sort(function(t,r){return e.neighbors(r.origData.id).length-e.neighbors(t.origData.id).length});var n=[];t.children.forEach(function(e,t){t%2==0?n.push(e):n.unshift(e)}),t.children=n,t.children.forEach(function(t){return r.sortTree(e,t)})},t.prototype.depthFirst=function(e,t,r){var n=this;if(void 0===r&&(this._visited={},this._tree=void 0),!this._visited[t.id]){this._visited[t.id]=t;var o={origData:t,children:[]};void 0===r?this._tree=o:r.children.push(o),e.neighbors(t.id).forEach(function(t){return n.depthFirst(e,t,o)})}},t.prototype.breadthFirst=function(e,t){var r=this;this._visited={},this._visited[t.id]=t,this._tree={origData:t,children:[]};var n=[];n.push(this._tree);for(var o=function(){var t=n.shift();e.neighbors(t.origData.id).forEach(function(e){if(!r._visited[e.id]){r._visited[e.id]=e;var o={origData:e,children:[]};t.children.push(o),n.push(o)}})};n.length;)o();this.sortTree(e)},t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){for(var e,r=t._graph.graphData(),n=0,o=r.allVertices();n<o.length;n++){var i=o[n];if(delete i.fx,delete i.fy,void 0===e&&(e=i),i.centroid){e=i;break}}return r.allEdges().forEach(function(e){return delete e.points}),t.breadthFirst(r,e),t._d3Hierarchy=Fh(t._tree),t})},t.prototype.finalize=function(e){var t=this._graph.size(),r=new Hh;e.forEach(function(e,t){0===t?r.reset(e.origData.x,e.origData.y):r.expand(e.origData.x,e.origData.y)});var n=t.width/2-r.center.x,o=t.height/2-r.center.y;e.forEach(function(e){e.origData.x+=n,e.origData.y+=o}),this._graph.moveVertices(!0).moveEdges(!0),this.stop()},t}(fh),Wh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),qh=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.angle=e.x,e.data.origData.radius=e.y,e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh),Yh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),$h=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh);L(".graph_Graph2 .allowDragging .graphVertex,.graph_Graph2 .graphVertex{cursor:pointer}.graph_Graph2 .allowDragging .graphVertex.grabbed{cursor:grabbing}.graph_Graph2 .graphEdge{stroke:#a9a9a9;fill:none}.graph_Graph2 .graphEdge>text{stroke:none;fill:#000}.graph_Graph2 .graphEdge.hide-text>text{display:none}.graph_Graph2 g.selected circle,.graph_Graph2 g.selected rect{stroke:red!important}");var Xh=(r.getScriptSrc("/graph/lib-umd/graph2/graph")||r.getScriptSrc("/graph/dist/index")||".")+"/graph/dist",Jh=function(e){e.fx=e.sx=e.x,e.fy=e.sy=e.y},Kh=function(e,t){e.fx=e.sx+t.fx-t.sx,e.fy=e.sy+t.fy-t.sy},Zh=function(e){e.x=e.fx,e.y=e.fy,e.fx=e.sx=void 0,e.fy=e.sy=void 0},ef=function(e){function n(){var n=e.call(this)||this;n._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return n.layoutClick("Hierarchy")}),n._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return n.layoutClick("ForceDirected")}),n._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return n.layoutClick("ForceDirected2")}),n._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return n.layoutClick("Circle")}),n._toggleDot=(new t.ToggleButton).faChar("fa-angle-double-down").tooltip("DOT").on("click",function(){return n.layoutClick("DOT")}),n._toggleNeato=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Neato").on("click",function(){return n.layoutClick("Neato")}),n._toggleFDP=(new t.ToggleButton).faChar("fa-asterisk").tooltip("FDP").on("click",function(){return n.layoutClick("FDP")}),n._toggleTwoPI=(new t.ToggleButton).faChar("fa-bullseye").tooltip("TwoPI").on("click",function(){return n.layoutClick("TwoPI")}),n._toggleCirco=(new t.ToggleButton).faChar("fa-cogs").tooltip("Circo").on("click",function(){return n.layoutClick("Circo")}),n._toggleT=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Tree").on("click",function(){return n.layoutClick("Tree")}),n._toggleRT=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Radial Tree").on("click",function(){return n.layoutClick("RadialTree")}),n._toggleD=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Dendrogram").on("click",function(){return n.layoutClick("Dendrogram")}),n._toggleRD=(new t.ToggleButton).faChar("fa-asterisk").tooltip("Radial Dendrogram").on("click",function(){return n.layoutClick("RadialDendrogram")}),n._graphData=(new r.Graph2).idFunc(function(e){return e.id}).sourceFunc(function(e){return e.source.id}).targetFunc(function(e){return e.target.id}).updateFunc(function(e,t){return e.props=t.props,e}),n._prevDoClickTime=0,n._tooltip=new i.HTMLTooltip,n._selection=new t.Utility.Selection(n),n._dragHandler=t.drag(),n._catPalette=t.Palette.ordinal("hpcc10"),n._categories=[],n._annotations=[],n._origData={subgraphs:[],vertices:[],edges:[],hierarchy:[]},n._layoutAlgo=new Dh(n),n.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},n._centroidRenderer=o.Vertex,n._vertexRenderer=o.Vertex,n._transformScale=1;var a=n;n._drawStartPos="origin";var s=[n._toggleHierarchy,n._toggleForceDirected,n._toggleForceDirected2,n._toggleCircle,new t.Spacer,n._toggleDot,n._toggleNeato,n._toggleFDP,n._toggleTwoPI,n._toggleCirco,new t.Spacer,n._toggleT,n._toggleRT,n._toggleD,n._toggleRD,new t.Spacer];return n._iconBar.buttons(s.concat(n._iconBar.buttons())),n._dragHandler.on("start",function(e){if(a.allowDragging()){t.select(this).classed("grabbed",!0),Jh(e),t.Utility.safeRaise(this),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Jh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(e){Jh(e)})}}).on("drag",function(e){if(a.allowDragging()){e.fx=e.sx+a.rproject(t.d3Event().x-e.sx),e.fy=e.sy+a.rproject(t.d3Event().y-e.sy),a._graphData.vertexEdges(e.id).forEach(function(e){return delete e.points}),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(t){var r=a._graphData.vertex(t.id);Kh(r,e),a.moveVertexPlaceholder(r,!1,!0)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(t){Kh(t,e),a.moveVertexPlaceholder(t,!1,!0)})}}).on("end",function(e){var r=!0;if(a.allowDragging()){r=Math.abs(e.sx-e.fx)<1&&Math.abs(e.sy-e.fy)<1,Zh(e);var n=a.selection();a.selected(e.props,n)?n.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Zh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(Zh),t.select(this).classed("grabbed",!1)}if(r){a._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event().sourceEvent),a.selectionChanged();var o=e.element.classed("selected");a.vertex_click(e.props.origData||e.props,"",o);var i=Date.now();i-a._prevDoClickTime<a.doubleClickMaxDelay()&&a.vertex_dblclick(e.props.origData||e.props,"",o),a._prevDoClickTime=i}}).filter(function(){return!0}),n.zoomToFitLimit(1),n}return s(n,e),n.prototype.iconBarButtons=function(){return this._iconBar.buttons()},n.prototype.categories=function(e){return void 0===e?this._categories:(this._categories=e,this)},n.prototype.annotations=function(e){return void 0===e?this._annotations:(this._annotations=e,this)},n.prototype.data=function(e,t){var r=this;return void 0===e?this._origData:(this._origData=e,this._graphData.mergeSubgraphs((e.subgraphs||[]).map(function(e){return{id:e.id,props:e}})),this._graphData.mergeVertices((e.vertices||[]).map(function(e){return{id:e.id,centroid:e.centroid,props:e}})),this._graphData.mergeEdges((e.edges||[]).filter(function(e){return r._graphData.vertexExists(e.source.id)&&r._graphData.vertexExists(e.target.id)}).map(function(e){return{id:e.id,props:e,source:r._graphData.vertex(e.source.id),target:r._graphData.vertex(e.target.id)}})),this._graphData.clearParents(),(e.hierarchy?e.hierarchy:[]).forEach(function(e){r._graphData.subgraphExists(e.child.id)?r._graphData.subgraphParent(e.child.id,e.parent.id):r._graphData.vertexExists(e.child.id)&&r._graphData.vertexParent(e.child.id,e.parent.id)}),this)},n.prototype.selected=function(e,t){return(t||this.selection()).some(function(t){return t.id===e.id})},n.prototype.selection=function(e){var t=this;return arguments.length?(this._selection.set(e.map(function(e){var r=t._graphData.item(e.id);return{_id:r.id,element:function(){return r.element}}})),this):this._selection.get().map(function(e){return t._graphData.item(e._id).props})},n.prototype.graphData=function(){return this._graphData},n.prototype.resetLayout=function(){return delete this._prevLayout,this},n.prototype.layoutRunning=function(){return this._layoutAlgo&&this._layoutAlgo.running()},n.prototype.layoutAlgo=function(e){var t=this;return this._layoutAlgo&&this._layoutAlgo.stop(),this._layoutAlgo=e,this._layoutAlgo.start().then(function(){t.updateIconBar(),t.applyScaleOnLayout()&&setTimeout(function(){t.zoomToFit()},t.transitionDuration())})},n.prototype.layoutClick=function(e){this.layoutRunning()?(this._layoutAlgo.stop(),this.updateIconBar()):(delete this._prevLayout,this.layout(e).render())},n.prototype.updateIconBarItem=function(e,t){var r=this.layout(),n=this._layoutAlgo&&this._layoutAlgo.running();e.enabled(!n||r===t).selected(n&&r===t).render()},n.prototype.updateIconBar=function(){e.prototype.updateIconBar.call(this),this.updateIconBarItem(this._toggleHierarchy,"Hierarchy"),this.updateIconBarItem(this._toggleDot,"DOT"),this.updateIconBarItem(this._toggleForceDirected,"ForceDirected"),this.updateIconBarItem(this._toggleNeato,"Neato"),this.updateIconBarItem(this._toggleFDP,"FDP"),this.updateIconBarItem(this._toggleForceDirected2,"ForceDirected2"),this.updateIconBarItem(this._toggleCircle,"Circle"),this.updateIconBarItem(this._toggleTwoPI,"TwoPI"),this.updateIconBarItem(this._toggleCirco,"Circo"),this.updateIconBarItem(this._toggleT,"Tree"),this.updateIconBarItem(this._toggleRT,"RadialTree"),this.updateIconBarItem(this._toggleD,"Dendrogram"),this.updateIconBarItem(this._toggleRD,"RadialDendrogram")},n.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.vertexEdges(e.id),o=0;o<n.length;++o){var i=this._graphData.edge(n[o].id);r[i.id]=i,i.source.id!==e.id&&(t[i.source.id]=i.source),i.target.id!==e.id&&(t[i.target.id]=i.target)}return{vertices:t,edges:r}},n.prototype.centerOnItem=function(e){var t,r,n,o=this._graphData.item(e);if((this._graphData.isSubgraph(o)||this._graphData.isVertex(o))&&(r=o.x,n=o.y),this._graphData.isEdge(o)&&(r=(t=[0,0])[0],n=t[1]),void 0!==r&&void 0!==n){var i=o.element.node().getBBox();if(this._graphData.isVertex(o)){var a=this.projectPlacholder(o);r=a.x,n=a.y}else this._graphData.isSubgraph(o)&&(r=this.project(o.x),n=this.project(o.y));var s=i.x+i.width/2,u=i.y+i.height/2,c={x:r+s-i.width/2,y:n+u-i.height/2,width:i.width,height:i.height};this.centerOnBBox(c)}},n.prototype.hideVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!0),this},n.prototype.showVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!1),this},n.prototype.highlightVerticies=function(e){var t=this,r=this,n=this._vertexG.selectAll(".graphVertex"),i=!r.showVertexLabels()&&r.showVertexLabelsOnHighlight();return n.classed("graphVertex-highlighted",function(t){return!e||e[t.id]}).style("filter",function(r){return e&&e[r.id]?"url(#"+t.id()+"_glow)":null}).each(function(t){if(i){var n=r.calcProps(t.centroid,u({showLabel:!(!e||!e[t.id])},r.vertexMapper(t.props,t.props.origData)));o.render(t.centroid?r._centroidRenderer:r._vertexRenderer,n,this)}}).transition().duration(this.transitionDuration()).on("end",function(t){e&&e[t.id]&&t.element.node()&&t.element.node().parentNode&&t.element.node().parentNode.appendChild(t.element.node())}).style("opacity",function(t){return t.props.hidden?0:!e||e[t.id]?1:r.highlight.opacity}),this},n.prototype.highlightEdges=function(e){var t=this;return this._edgeG.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:t.edgeStrokeWidth()+"px"}).transition().duration(this.transitionDuration()).style("opacity",function(r){return r.source.props.hidden||r.target.props.hidden?0:!e||e[r.id]?1:t.highlight.opacity}),this},n.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t.source.id]=t.source,r[t.target.id]=t.target;var n={};n[t.id]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.moveSubgraphPlaceholder=function(e,t){var r=this.project(e.x),n=this.project(e.y),i=this.project(e.props.width,!0),a=this.project(e.props.height,!0);return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+r+" "+n+")").each(function(e){o.render(o.Subgraph,u(u({},e.props),{width:i,height:a}),this)}),this},n.prototype.moveEdgePlaceholder=function(e,t){var r,n,o=this._layoutAlgo.edgePath(e,this.edgeArcDepth());if(e.elementPath&&(t?e.elementPath.transition():e.elementPath).attr("d",o.path).attr("stroke-dasharray",function(e){return e.props.strokeDasharray}),e.elementText){var i=null!==(n=null===(r=e.props.label)||void 0===r?void 0:r.split("\n"))&&void 0!==n?n:[];e.elementText.selectAll(".textLine").data(i,function(e){return e}).join(function(e){return e.append("tspan").attr("class","textLine").attr("x",0)},function(e){return e.attr("dy",function(e,t){return t+"em"}).text(function(e){return e})},function(e){return e.remove()}),(t?e.elementText.transition():e.elementText).attr("transform","translate("+o.labelPos[0]+" "+o.labelPos[1]+")").attr("font-family",function(e){return e.props.fontFamily||null})}return this},n.prototype.moveVertexPlaceholder=function(e,t,r){var n=this,o=this.projectPlacholder(e),i=o.x,a=o.y;return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+i+" "+a+")"),r&&this._graphData.vertexEdges(e.id).forEach(function(e){return n.moveEdgePlaceholder(e,t)}),this},n.prototype.moveSubgraphs=function(e){var t=this;return this._graphData.allSubgraphs().forEach(function(r){return t.moveSubgraphPlaceholder(r,e)}),this},n.prototype.moveEdges=function(e){var t=this;return this._graphData.allEdges().forEach(function(r){return t.moveEdgePlaceholder(r,e)}),this},n.prototype.moveVertices=function(e){var t=this;return this._graphData.allVertices().forEach(function(r){return t.moveVertexPlaceholder(r,e,!1)}),this},n.prototype.project=function(e,t){void 0===t&&(t=!1);e=void 0!==e?e:0;var r=this._transformScale;return t&&(this._transformScale>this.maxScale()+(this._transformScale-this.maxScale())/2?r=this.maxScale()+(this._transformScale-this.maxScale())/2:(this._transformScale,this.minScale(),this._transformScale,this.minScale())),Math.round(e*r*10)/10},n.prototype.rproject=function(e){return e=void 0!==e?e:0,Math.round(e/this._transformScale*10)/10},n.prototype.projectPlacholder=function(e){return{x:this.project(void 0!==e.fx?e.fx:e.x),y:this.project(void 0!==e.fy?e.fy:e.y)}},n.prototype.categoryID=function(e,t){return void 0===t&&(t="cat"),void 0===e||""===e?"":""+t+this.id()+"_"+e},n.prototype.updateCategories=function(){var e=this;o.render(o.Icons,{icons:this._categories.map(function(t){return u(u({},t),{id:e.categoryID(t.id),fill:t.fill||"transparent",imageCharFill:t.imageCharFill||e._catPalette(t.id)})})},this._svgDefsCat.node())},n.prototype.updateAnnotations=function(){var e=this;o.render(o.Icons,{icons:this._annotations.map(function(t){return u(u({},t),{id:e.categoryID(t.id,"ann"),shape:t.shape||"square",height:t.height||12,fill:t.fill||e._catPalette(t.id)})})},this._svgDefsAnn.node())},n.prototype.updateEdges=function(){var e=this,r=this;return this._edgeG.selectAll(".graphEdge").data(this._graphData.allEdges(),function(e){return e.id}).join(function(e){return e.append("g").attr("class","graphEdge").on("click.selectionBag",function(e){r._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event()),r.selectionChanged()}).on("click",function(e){var t=e.element.classed("selected");r.edge_click(e.props.origData||e.props,"",t)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){r.edge_mouseout(t.select(this),e)}).each(function(e){e.element=t.select(this),e.elementPath=e.element.append("path"),e.elementText=e.element.append("text").attr("text-anchor","middle")})},function(e){return e.attr("opacity",function(e){return e.source.props.hidden||e.target.props.hidden?0:1}).classed("hide-text",!r.showEdgeLabels())},function(e){return e.each(function(e){delete e.element}).remove()}).style("stroke",function(t){var r,n;return null!==(n=null===(r=t.props)||void 0===r?void 0:r.color)&&void 0!==n?n:e.edgeColor()}).style("stroke-width",this.edgeStrokeWidth()+"px"),this},n.prototype.centroidRenderer=function(e){return arguments.length?(this._centroidRenderer=e,this):this._centroidRenderer},n.prototype.vertexRenderer=function(e){return arguments.length?(this._vertexRenderer=e,this):this._vertexRenderer},n.prototype.vertexMapper=function(e,t){var r=this;return u(u({},e),{categoryID:this.categoryID(e.categoryID),annotationIDs:e.annotationIDs?e.annotationIDs.map(function(e){return r.categoryID(e,"ann")}):[]})},n.prototype.updateVertices=function(){var e=this,r=this;return this._vertexG.selectAll(".graphVertex").data(this._graphData.allVertices(),function(e){return e.id}).join(function(n){return n.append("g").attr("class","graphVertex").on("dblclick",function(e){t.d3Event().stopPropagation()}).on("mousein",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");r.vertex_mousein(e.props.origData||e.props,"",n)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");e.props.tooltip&&r._tooltip.tooltipHTML(r.tooltipHTML.bind(r)).triggerElement(e.element).tooltipWidth(r.tooltipWidth()).tooltipHeight(r.tooltipHeight()).enablePointerEvents(r.enableTooltipPointerEvents()).closeDelay(r.tooltipCloseDelay()).direction("n").data(e).visible(!0).render(),r.vertex_mouseover(e.props.origData||e.props,"",n)}).on("mouseout",function(e){r.highlightVertex(null,null);var t=e.element.classed("selected");r.vertex_mouseout(e.props.origData||e.props,"",t),e.props.tooltip&&r._tooltip.mouseout()}).call(e._dragHandler).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).remove()}).classed("centroid",function(e){return e.centroid}).attr("opacity",function(e){return e.props.hidden?0:1}).attr("filter",function(t){return t.centroid?"url(#"+e.id()+"_glow)":null}).each(function(e){var t=r.calcProps(e.centroid,u({showLabel:r.showVertexLabels()},r.vertexMapper(e.props,e.props.origData)));o.render(e.centroid?r._centroidRenderer:r._vertexRenderer,t,this)}),this},n.prototype.calcProps=function(e,t){t.icon||(t.icon={}),e?(t.textHeight=t.textHeight?t.textHeight:this.centroidTextHeight()*this.centroidScale(),t.textPadding=t.textPadding?t.textPadding:this.centroidTextPadding()*this.centroidScale(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.centroidLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.centroidIconHeight()*this.centroidScale(),t.icon.padding=t.icon.padding?t.icon.padding:this.centroidIconPadding()*this.centroidScale(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.centroidIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.centroidIconFontFamily()):(t.textHeight=t.textHeight?t.textHeight:this.vertexTextHeight(),t.textPadding=t.textPadding?t.textPadding:this.vertexTextPadding(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.vertexLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.vertexIconHeight(),t.icon.padding=t.icon.padding?t.icon.padding:this.vertexIconPadding(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.vertexIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.vertexIconFontFamily());var r=t.icon.imageChar,n=t.icon.imageFontFamily,o=t.icon.height-t.icon.padding,i=this.textRect(r,n,o);return t.icon.yOffset=-(i.top-o/2)-i.height/2+(t.icon.padding>0?o/t.icon.padding/2:0),t},n.prototype.hasSubgraphs=function(){switch(this.layout()){case"DOT":case"Hierarchy":return!0}return!1},n.prototype.updateSubgraphs=function(){var e=this;return this._subgraphG.selectAll(".subgraphPlaceholder").data(this.hasSubgraphs()?this._graphData.allSubgraphs():[],function(e){return e.id}).join(function(r){return r.append("g").attr("class","subgraphPlaceholder").on("click.selectionBag",function(r){e._selection.click({_id:r.id,element:function(){return r.element}},t.d3Event()),e.selectionChanged()}).on("click",function(t){var r=t.element.classed("selected");e.subgraph_click(t.props.origData||t.props,"",r)}).on("mouseover",function(){t.Utility.safeRaise(this)}).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).transition().style("opacity",0).remove()}).each(function(t){e.moveSubgraphPlaceholder(t,!1)}),this},n.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n);var i=this.locateSVGNode(r);this._svgDefs=t.select(i).select("defs"),this._centroidFilter=new t.SVGGlowFilter(this._svgDefs,this._id+"_glow"),this._svgDefsCat=this._svgDefs.append("g"),this._svgDefsAnn=this._svgDefs.append("g"),this._subgraphG=this._renderElement.append("g"),this._edgeG=this._renderElement.append("g"),this._vertexG=this._renderElement.append("g"),this._tooltip.target(r),this.on("startMarqueeSelection",function(){}).on("updateMarqueeSelection",function(e){var t=o._graphData.allVertices().filter(function(t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height});o.selection(t.map(function(e){return e.props}))}).on("endMarqueeSelection",function(){o.selectionChanged()})},n.prototype.forceDirectedOptions=function(){return{alpha:this.forceDirectedAlpha(),alphaMin:this.forceDirectedAlphaMin(),alphaDecay:this.forceDirectedAlphaDecay(),velocityDecay:this.forceDirectedVelocityDecay(),repulsionStrength:this.forceDirectedRepulsionStrength(),iterations:this.forceDirectedIterations(),linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),pinCentroid:this.forceDirectedPinCentroid(),forceStrength:this.forceDirectedForceStrength(),distanceMin:this.forceDirectedMinDistance(),distanceMax:this.forceDirectedMaxDistance()}},n.prototype.layoutOptions=function(e){switch(e){case"ForceDirected":case"ForceDirected2":case"ForceDirectedHybrid":return this.forceDirectedOptions();case"Hierarchy":return{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()};case"Tree":case"Dendrogram":return{rankdir:this.treeRankDirection()};case"DOT":case"Neato":case"FDP":case"TwoPI":case"Circo":return this.wasmFolder()||Xh;case"None":case"Circle":case"RadialTree":case"RadialDendrogram":default:return}},n.prototype.updateLayout=function(){var e=this,t=this.layout(),n=this.layoutOptions(t),o=r.hashSum([t,n]);if(this._prevLayout!==o)switch(this._prevLayout=o,t){case"None":this.layoutAlgo(new Dh(this));break;case"Circle":this.layoutAlgo(new ph(this));break;case"ForceDirected":this.layoutAlgo(new bh(this,n));break;case"ForceDirected2":this.layoutAlgo(new wh(this,n));break;case"ForceDirectedHybrid":this.layoutAlgo(new bh(this,n)).then(function(){e.layoutAlgo(new wh(e,n))});break;case"Hierarchy":this.layoutAlgo(new mh(this,n));break;case"DOT":this.layoutAlgo(new kh(this,"dot",n));break;case"Tree":this.layoutAlgo(new Wh(this,n));break;case"RadialTree":this.layoutAlgo(new qh(this));break;case"Dendrogram":this.layoutAlgo(new Yh(this,n));break;case"RadialDendrogram":this.layoutAlgo(new $h(this));break;case"Neato":this.layoutAlgo(new kh(this,"neato",n));break;case"FDP":this.layoutAlgo(new kh(this,"fdp",n));break;case"TwoPI":this.layoutAlgo(new kh(this,"twopi",n));break;case"Circo":this.layoutAlgo(new kh(this,"circo",n))}},n.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._centroidFilter.update(this.centroidColor()),this._renderElement.classed("allowDragging",this.allowDragging()),this.updateCategories(),this.updateAnnotations(),this.updateSubgraphs(),this.updateVertices(),this.updateEdges(),this.updateLayout(),this.updateIconBar()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r),this._tooltip.target(null)},n.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.progress("stop"),t&&t(e)}),this},n.prototype.zoomed=function(t){e.prototype.zoomed.call(this,t);var r=this.size(),n=r.width,o=r.height;t.k<this.minScale()?(this._edgeG.attr("transform","scale("+this.minScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.minScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.minScale()/t.k+")"),this._transformScale=t.k/this.minScale()):t.k>this.maxScale()?(this._edgeG.attr("transform","scale("+this.maxScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.maxScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.maxScale()/t.k+")"),this._transformScale=t.k/this.maxScale()):(this._transformScale=1,this._edgeG.attr("transform",null),this._subgraphG.attr("transform",null),this._vertexG.attr("transform",null)),this._prevTransformScale===this._transformScale&&this._prevWidth===n&&this._prevHeight===o||(this._prevTransformScale=this._transformScale,this._prevWidth=n,this._prevHeight=o,this.moveSubgraphs(!1).moveVertices(!1).moveEdges(!1))},n.prototype.centroids=function(){return this._graphData.allVertices().filter(function(e){return!!e.centroid})},n.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){var o=e._graphData.dijkstra(r.id,n.id),i=o.ids;o.len&&i.forEach(function(e){t[e]=!0})})}),this._edgeG.selectAll(".graphEdge")}},n.prototype.tooltipHTML=function(e){return e.props.tooltip},n.prototype.subgraph_click=function(e,t,r){},n.prototype.vertex_click=function(e,t,r){},n.prototype.vertex_dblclick=function(e,t,r){},n.prototype.vertex_mousein=function(e,t,r){},n.prototype.vertex_mouseover=function(e,t,r){},n.prototype.vertex_mouseout=function(e,t,r){},n.prototype.edge_click=function(e,t,r){},n.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},n.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},n.prototype.progress=function(e){},n}(t.SVGZoomWidget);ef.prototype._class+=" graph_Graph2",ef.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices"),ef.prototype.publish("dragSingleNeighbors",!0,"boolean","Dragging a Vertex also moves its singleton neighbors"),ef.prototype.publish("layout","ForceDirectedHybrid","set","Default Layout",["Hierarchy","DOT","Tree","Dendrogram","RadialTree","RadialDendrogram","ForceDirected","ForceDirected2","ForceDirectedHybrid","Neato","FDP","Circle","TwoPI","Circo","None"]),ef.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"]),ef.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout"),ef.prototype.publish("highlightOnMouseOverVertex",!0,"boolean","Highlight Vertex on Mouse Over"),ef.prototype.publish("highlightOnMouseOverEdge",!0,"boolean","Highlight Edge on Mouse Over"),ef.prototype.publish("transitionDuration",250,"number","Transition Duration"),ef.prototype.publish("showEdges",!0,"boolean","Show Edges"),ef.prototype.publish("showEdgeLabels",!0,"boolean","Show Edge labels"),ef.prototype.publish("showEdgeLabelsOnHighlight",!0,"boolean","Show Edge labels when highlighted"),ef.prototype.publish("showVertexLabels",!0,"boolean","Show Vertex labels"),ef.prototype.publish("showVertexLabelsOnHighlight",!0,"boolean","Show Vertex labels when highlighted"),ef.prototype.publish("snapToGrid",0,"number","Snap to Grid"),ef.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),ef.prototype.publish("edgeArcDepth",8,"number","Edge Arc Depth"),ef.prototype.publish("edgeColor",null,"html-color","Edge line stroke color",null,{optional:!0}),ef.prototype.publish("edgeStrokeWidth",1,"number","Edge line stroke width (pixels)"),ef.prototype.publish("minScale",.6,"number","Min scale size for text"),ef.prototype.publish("maxScale",1,"number","Max scale size for text"),ef.prototype.publish("tooltipWidth",256,"number","Tooltip width (pixels)"),ef.prototype.publish("tooltipHeight",128,"number","Tooltip width (pixels)"),ef.prototype.publish("enableTooltipPointerEvents",!1,"boolean","If true, tooltip will use the style: 'pointer-events: all'"),ef.prototype.publish("tooltipCloseDelay",0,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),ef.prototype.publish("doubleClickMaxDelay",300,"number","Number of milliseconds to wait before a subsequent click is not considered a double click"),ef.prototype.publish("centroidColor","#00A000","html-color","Centroid Glow Color"),ef.prototype.publish("centroidScale",1,"number","Centroid Scale"),ef.prototype.publish("centroidTextHeight",12,"number","Centroid Text Height"),ef.prototype.publish("centroidTextPadding",4,"number","Centroid Text Padding"),ef.prototype.publish("centroidIconHeight",50,"number","Centroid Icon Height"),ef.prototype.publish("centroidIconPadding",10,"number","Centroid Icon Padding"),ef.prototype.publish("centroidIconStrokeWidth",4,"number","Centroid Icon Stroke Width"),ef.prototype.publish("centroidIconFontFamily","FontAwesome","string","Centroid Icon Font Family"),ef.prototype.publish("centroidLabelFontFamily","FontAwesome","string","Centroid Label Font Family"),ef.prototype.publish("vertexTextHeight",10,"number","Vertex Text Height"),ef.prototype.publish("vertexTextPadding",4,"number","Vertex Text Padding"),ef.prototype.publish("vertexIconHeight",50,"number","Vertex Icon Height"),ef.prototype.publish("vertexIconPadding",10,"number","Vertex Icon Padding"),ef.prototype.publish("vertexIconStrokeWidth",0,"number","Vertex Icon Stroke Width"),ef.prototype.publish("vertexIconFontFamily","FontAwesome","string","Vertex Icon Font Family"),ef.prototype.publish("vertexLabelFontFamily","FontAwesome","string","Vertex Label Font Family"),ef.prototype.publish("highlightSelectedPathToCentroid",!0,"boolean","Highlight path to Center Vertex (for selected vertices)"),ef.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph2",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("forceDirectedAlpha",1,"number","Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaMin",.001,"number","Min Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaDecay",.0228,"number","Defaults to 1 - pow(alphaMin, 1 / 300)",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedRepulsionStrength",-350,"number","Charge strength ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedVelocityDecay",.4,"number","Velocity Decay ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedIterations",300,"number","Iterations",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedPinCentroid",!1,"boolean","Pin centroid to center",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedForceStrength",0,"number","Strength of center force",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMinDistance",1,"number","Min distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMaxDistance",1/0,"number","Max distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("treeRankDirection","LR","set","Direction for Rank Nodes",["TB","LR"],{disable:function(e){return"Tree"!==e.layout()&&"Dendrogram"!==e.layout()}}),ef.prototype.publish("wasmFolder",null,"string","WASM Folder",null,{optional:!0,disable:function(e){return["DOT","Neato","FDP","TwoPI","Circo"].indexOf(e.layout())<0}});var tf=ef.prototype.scale;function rf(e,t){var r={};return t.forEach(function(t,n){return r[t]=e[n]}),r}ef.prototype.scale=function(e,t){var r=tf.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var nf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},r.prototype.valid=function(){return!!this.columnID()},c([t.publish("","set","Annotation column (boolean)",function(){return this._owner.vertexColumns()}),l("design:type",Function)],r.prototype,"columnID",void 0),c([t.publish("","string","Annotation ID"),l("design:type",Function)],r.prototype,"annotationID",void 0),r}(t.PropertyExt);nf.prototype._class+=" graph_AnnotationColumn";var of=function(e){function n(){var t=e.call(this)||this;return t._prevSubgraphs=[],t._masterSubgraphs=[],t._masterSubgraphsMap={},t._prevVertices=[],t._masterVertices=[],t._masterVerticesMap={},t._prevEdges=[],t._masterEdges=[],t._masterEdgesMap={},t._prevHierarchy=[],t._masterHierarchy=[],t._masterHierarchyMap={},t.vertexRenderer(o.Vertex3).centroidRenderer(o.CentroidVertex3).edgeColor("#287EC4").edgeStrokeWidth(2).edgeArcDepth(0),t}return s(n,e),n.prototype.clear=function(){this._prevSubgraphs=[],this._masterSubgraphs=[],this._masterSubgraphsMap={},this._prevVertices=[],this._masterVertices=[],this._masterVerticesMap={},this._prevEdges=[],this._masterEdges=[],this._prevHierarchy=[],this._masterHierarchy=[],this._masterHierarchyMap={},this._graphData.clear(),this.resetLayout()},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeSubgraphs=function(){var e=this,t=this.subgraphColumns(),n=this.indexOf(t,this.subgraphIDColumn(),"id"),o=this.indexOf(t,this.subgraphLabelColumn(),"label"),i=this.subgraphs().map(function(e){return{id:""+e[n],text:""+e[o],origData:rf(e,t)}}),a=r.compare2(this._prevSubgraphs,i,function(e){return e.id});a.exit.forEach(function(t){e._masterSubgraphs=e._masterSubgraphs.filter(function(e){return e.id!==t.id}),delete e._masterSubgraphsMap[t.id]}),a.enter.forEach(function(t){e._masterSubgraphs.push(t),e._masterSubgraphsMap[t.id]=t}),a.update.forEach(function(t){e._masterSubgraphsMap[t.id].origData=t.origData}),this._prevSubgraphs=i},n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id}),delete e._masterVerticesMap[t.id]}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),f.update.forEach(function(t){e._masterVerticesMap[t.id].origData=t.origData}),this._prevVertices=h},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.indexOf(t,this.edgeColorColumn(),"color"),c=this.edges().map(function(r){var c=e._masterVerticesMap[""+r[o]];c||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var l=e._masterVerticesMap[""+r[i]];return l||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:c,target:l,weight:+r[s]||1,color:r[u],label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),l=r.compare2(this._masterEdges,c,function(e){return e.id});l.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id}),delete e._masterEdgesMap[t.id]}),l.enter.forEach(function(t){e._masterEdges.push(t),e._masterEdgesMap[t.id]=t}),l.update.forEach(function(t){e._masterEdgesMap[t.id].origData=t.origData}),this._prevEdges=c},n.prototype.mergeHierarchy=function(){var e=this,t=this.hierarchyColumns(),n=this.indexOf(t,this.hierarchyParentIDColumn(),"parentID"),o=this.indexOf(t,this.hierarchyChildIDColumn(),"childID"),i=this.hierarchy().map(function(t){return{id:t[n]+"=>"+t[o],parent:e._masterSubgraphsMap[""+t[n]],child:e._masterSubgraphsMap[""+t[o]]||e._masterVerticesMap[""+t[o]]}}),a=r.compare2(this._prevHierarchy,i,function(e){return e.id});a.exit.forEach(function(t){e._masterHierarchy=e._masterHierarchy.filter(function(e){return e.id!==t.id}),delete e._masterHierarchyMap[t.id]}),a.enter.forEach(function(t){e._masterHierarchy.push(t),e._masterHierarchyMap[t.id]=t}),this._prevHierarchy=i},n.prototype.update=function(t,r){this.mergeSubgraphs(),this.mergeVertices(),this.mergeEdges(),this.mergeHierarchy(),this.data({subgraphs:this._masterSubgraphs,vertices:this._masterVertices,edges:this._masterEdges,hierarchy:this._masterHierarchy}),e.prototype.update.call(this,t,r)},n.prototype.render=function(t){return e.prototype.render.call(this,function(e){t&&t(e)}),this},c([t.publish([],"any","Subgraph Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphColumns",void 0),c([t.publish([],"any","Subgraphs",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphs",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"subgraphIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"subgraphLabelColumn",void 0),c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge weight column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),c([t.publish("","set","Edge color column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeColorColumn",void 0),c([t.publish([],"any","Subgraph Columns"),l("design:type",Function)],n.prototype,"hierarchyColumns",void 0),c([t.publish([],"any","Subgraphs"),l("design:type",Function)],n.prototype,"hierarchy",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"hierarchyParentIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"hierarchyChildIDColumn",void 0),n}(ef);of.prototype._class+=" graph_DataGraph";L(".graph_SankeyGraph .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_SankeyGraph .node.selected rect{stroke:red}.graph_SankeyGraph .node.over rect{stroke:orange}.graph_SankeyGraph .node.selected.over rect{stroke:red}.graph_SankeyGraph .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_SankeyGraph .node.selected text{fill:red}.graph_SankeyGraph .node.over text{fill:orange}.graph_SankeyGraph .node.selected.over text{fill:red}.graph_SankeyGraph .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_SankeyGraph .link:hover{stroke-opacity:.5}");var af=function(e){function n(){var r=e.call(this)||this;return r._prevVertices=[],r._masterVertices=[],r._masterVerticesMap={},r._prevEdges=[],r._masterEdges=[],t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(n,e),n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id})}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),this._prevVertices=h},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.edges().map(function(r){var u=e._masterVerticesMap[""+r[o]];u||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var c=e._masterVerticesMap[""+r[i]];return c||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:u,target:c,value:+r[s]||0,label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),c=r.compare2(this._masterEdges,u,function(e){return e.id});c.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id})}),c.enter.forEach(function(t){e._masterEdges.push(t)}),this._prevEdges=u},n.prototype.sankeyData=function(){return this.mergeVertices(),this.mergeEdges(),{vertices:this._masterVertices,edges:this._masterEdges}},n.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=nh(),this._selection.widgetElement(r)},n.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData();this._d3Sankey.nodeId(function(e){return e.id}).extent([[0,0],[this.width(),this.height()]]),i.vertices.length>0&&this._d3Sankey({nodes:i.vertices,links:i.edges});var a=this,s=n.selectAll(".link").data(i.edges);s.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(s).attr("d",ah()).style("stroke-width",function(e){return Math.max(1,e.width)}).select("title").text(function(e){return e.source.text+" → "+e.target.text+"\n"+e.value}),s.exit().remove();var u=n.selectAll(".node").data(i.vertices);u.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){a.click(e.origData,"",a._selection.selected(this))}).on("dblclick",function(e){a.dblclick(e.origData,"",a._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(u).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",function(e){return e.x1-e.x0}).style("fill",function(e){return a._palette(e.categoryID)}).style("stroke",function(e){return a.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",a.xAxisMovement()||a.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.text}).filter(function(e){return e.x0<a.width()/2}).attr("x",6+a._d3Sankey.nodeWidth()).attr("text-anchor","start")}),u.exit().remove()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},n.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},n.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),n}(t.SVGWidget);af.prototype._class+=" graph_SankeyGraph",af.prototype.mixin(t.Utility.SimpleSelectionMixin),af.prototype._palette=t.Palette.ordinal("category10"),af.prototype.publish("paletteID","category10","set","Color palette for this widget",af.prototype._palette.switch()),af.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),af.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),af.prototype.publish("vertexWidth",36,"number","Vertex Width"),af.prototype.publish("vertexPadding",20,"number","Vertex Padding"),af.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),af.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),e.AdjacencyGraph=Ul,e.Annotation=Hl,e.AnnotationColumn=nf,e.BUILD_VERSION="2.101.0",e.DataGraph=of,e.Edge=R,e.Graph=Vl,e.Graph2=ef,e.PKG_NAME="@hpcc-js/graph",e.PKG_VERSION="2.78.0",e.Sankey=ch,e.SankeyColumn=uh,e.SankeyGraph=af,e.Subgraph=Bl,e.Vertex=zl,e.graphviz=function(e,t,r){return void 0===t&&(t="dot"),void 0===r&&(r=Xh),xh({items:[],links:[],raw:e},{engine:t,wasmFolder:r})},e.toJsonObj=rf,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common"),require("@hpcc-js/util"),require("@hpcc-js/api"),require("@hpcc-js/react"),require("@hpcc-js/html")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util","@hpcc-js/api","@hpcc-js/react","@hpcc-js/html"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/graph"]={},e["@hpcc-js/common"],e["@hpcc-js/util"],e["@hpcc-js/api"],e["@hpcc-js/react"],e["@hpcc-js/html"])}(this,(function(e,t,r,n,o,i){"use strict";var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)};function c(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var d=Math.PI,f=2*d,p=1e-6,g=f-p;function y(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function v(){return new y}function _(e){return function(){return e}}y.prototype=v.prototype={constructor:y,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,o,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,r,n,o){e=+e,t=+t,r=+r,n=+n,o=+o;var i=this._x1,a=this._y1,s=r-e,u=n-t,c=i-e,l=a-t,h=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>p)if(Math.abs(l*s-u*c)>p&&o){var f=r-i,g=n-a,y=s*s+u*u,v=f*f+g*g,_=Math.sqrt(y),m=Math.sqrt(h),b=o*Math.tan((d-Math.acos((y+h-v)/(2*_*m)))/2),w=b/m,x=b/_;Math.abs(w-1)>p&&(this._+="L"+(e+w*c)+","+(t+w*l)),this._+="A"+o+","+o+",0,0,"+ +(l*f>c*g)+","+(this._x1=e+x*s)+","+(this._y1=t+x*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,r,n,o,i){e=+e,t=+t,i=!!i;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,l=1^i,h=i?n-o:o-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>p||Math.abs(this._y1-c)>p)&&(this._+="L"+u+","+c),r&&(h<0&&(h=h%f+f),h>g?this._+="A"+r+","+r+",0,1,"+l+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):h>p&&(this._+="A"+r+","+r+",0,"+ +(h>=d)+","+l+","+(this._x1=e+r*Math.cos(o))+","+(this._y1=t+r*Math.sin(o))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function m(e){this._context=e}function b(e){return new m(e)}function w(e){return e[0]}function x(e){return e[1]}function E(){var e=w,t=x,r=_(!0),n=null,o=b,i=null;function a(a){var s,u,c,l=a.length,h=!1;for(null==n&&(i=o(c=v())),s=0;s<=l;++s)!(s<l&&r(u=a[s],s,a))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(u,s,a),+t(u,s,a));if(c)return i=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:_(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:_(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:_(!!e),a):r},a.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),a):o},a.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),a):n},a}m.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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)}}};var k=Array.prototype.slice;function S(e){return e.source}function D(e){return e.target}function C(e,t,r,n,o){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,o,n,o)}function A(){return function(e){var t=S,r=D,n=w,o=x,i=null;function a(){var a,s=k.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(i||(i=a=v()),e(i,+n.apply(this,(s[0]=u,s)),+o.apply(this,s),+n.apply(this,(s[0]=c,s)),+o.apply(this,s)),a)return i=null,a+""||null}return a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(e){return arguments.length?(r=e,a):r},a.x=function(e){return arguments.length?(n="function"==typeof e?e:_(+e),a):n},a.y=function(e){return arguments.length?(o="function"==typeof e?e:_(+e),a):o},a.context=function(e){return arguments.length?(i=null==e?null:e,a):i},a}(C)}function M(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 F(e){this._context=e}function I(e){return new F(e)}function P(e,t){this._basis=new F(e),this._beta=t}F.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:M(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},point: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:M(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},P.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,o=e[0],i=t[0],a=e[r]-o,s=t[r]-i,u=-1;++u<=r;)n=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(o+n*a),this._beta*t[u]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(e){return 1===t?new F(e):new P(e,t)}return r.beta=function(t){return e(+t)},r})(.85);function O(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 j(e,t){this._context=e,this._k=(1-t)/6}j.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:O(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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:O(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}};var T=function e(t){function r(e){return new j(e,t)}return r.tension=function(t){return e(+t)},r}(0);function N(e,t){this._context=e,this._alpha=t}N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(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;default:!function(e,t,r){var n=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,o=(o*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>1e-12){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/l,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/l}e._context.bezierCurveTo(n,o,i,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(e){return t?new N(e,t):new j(e,0)}return r.alpha=function(t){return e(+t)},r})(.5);function Y(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Y(".graph_Edge{fill:none;stroke:#656565;stroke-width:1px}.graph_Edge .common_TextBox .common_Text{fill:#000;stroke:none}.graph_Edge .common_TextBox .common_Shape{fill:#fff;stroke:none}.graph_Edge.selected{stroke:red!important}.graph_Edge.selected .common_Text{fill:red!important}");var L,R=I,B=function(e){function r(){var r=e.call(this)||this;return r._points=[],r._weight=100,r._strokeDasharray=null,r._hidden=!1,r._textBox=(new t.TextBox).padding(0),r}return s(r,e),r.prototype.graphID=function(e){return arguments.length?(this._graphID=e,this):this._graphID},r.prototype.sourceVertex=function(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex},r.prototype.targetVertex=function(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex},r.prototype.weight=function(e){return arguments.length?(this._weight=e,this):this._weight},r.prototype.points=function(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points},r.prototype.hidden=function(e){return arguments.length?(this._hidden=e,this):this._hidden},r.prototype.text=function(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._elementPath=r.append("path"),this._textBox.text()&&this._textBox.target(t).tooltip(this.tooltip()).render()},r.prototype.update=function(r,n,o,i){e.prototype.update.call(this,r,n);var a=this;t.Platform.svgMarkerGlitch&&!i&&n.transition().duration((o||0)+100).on("start",(function(){a._pushMarkers(n)})).on("end",(function(){a._popMarkers(n)}));var s=a._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),u=n.selectAll(".point2").data(this.showControlPoints()?s:[]);u.enter().append("circle").attr("class","point2").style("stroke","red").merge(u).attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})).attr("r",1),u.exit().remove();var c=E().x((function(e){return e.x})).y((function(e){return e.y})).curve(R)(s),l=this._elementPath;o&&(l=l.transition().duration(o)),l.attr("opacity",this._hidden?0:1).attr("marker-start",t.Platform.svgMarkerGlitch&&i||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",t.Platform.svgMarkerGlitch&&i||!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",c),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(s),o)},r.prototype.exit=function(t,r){this._textBox&&this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype._findMidPoint=function(e){var t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){var 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}},r.prototype._calculateEdgePoints=function(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];var n=r?r.filter((function(r){return!e.contains(r)&&!t.contains(r)})):[],o=0===n.length?t.pos():n[0],i=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,o)),n.push(t.intersection(t._pos,i)),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]){var a=n[0].x-n[1].x,s=n[0].y-n[1].y;if(Math.sqrt(a*a+s*s))if(this.showArc()){var u=(n[0].x+n[1].x)/2-s*this.arcDepth()/100,c=(n[0].y+n[1].y)/2+a*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:u,y:c},{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},r}(t.SVGWidget);B.prototype._class+=" graph_Edge",B.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),B.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),B.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),B.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),B.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),B.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),B.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),B.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),B.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),B.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),B.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),B.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");try{L=require("graphlib")}catch(e){}L||(L=window.graphlib);var V,z=L;try{V={cloneDeep:require("lodash/cloneDeep"),constant:require("lodash/constant"),defaults:require("lodash/defaults"),each:require("lodash/each"),filter:require("lodash/filter"),find:require("lodash/find"),flatten:require("lodash/flatten"),forEach:require("lodash/forEach"),forIn:require("lodash/forIn"),has:require("lodash/has"),isUndefined:require("lodash/isUndefined"),last:require("lodash/last"),map:require("lodash/map"),mapValues:require("lodash/mapValues"),max:require("lodash/max"),merge:require("lodash/merge"),min:require("lodash/min"),minBy:require("lodash/minBy"),now:require("lodash/now"),pick:require("lodash/pick"),range:require("lodash/range"),reduce:require("lodash/reduce"),sortBy:require("lodash/sortBy"),uniqueId:require("lodash/uniqueId"),values:require("lodash/values"),zipObject:require("lodash/zipObject")}}catch(e){}V||(V=window._);var G=V,H=U;function U(){var e={};e._next=e._prev=e,this._sentinel=e}function q(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function W(e,t){if("_next"!==e&&"_prev"!==e)return t}U.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return q(t),t},U.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&q(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},U.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,W)),r=r._prev;return"["+e.join(", ")+"]"};var X=G,K=z.Graph,$=H,J=function(e,t){if(e.nodeCount()<=1)return[];var r=function(e,t){var r=new K,n=0,o=0;X.forEach(e.nodes(),(function(e){r.setNode(e,{v:e,in:0,out:0})})),X.forEach(e.edges(),(function(e){var i=r.edge(e.v,e.w)||0,a=t(e),s=i+a;r.setEdge(e.v,e.w,s),o=Math.max(o,r.node(e.v).out+=a),n=Math.max(n,r.node(e.w).in+=a)}));var i=X.range(o+n+3).map((function(){return new $})),a=n+1;return X.forEach(r.nodes(),(function(e){ee(i,a,r.node(e))})),{graph:r,buckets:i,zeroIdx:a}}(e,t||Q),n=function(e,t,r){var n,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;n=a.dequeue();)Z(e,t,r,n);for(;n=i.dequeue();)Z(e,t,r,n);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(n=t[s].dequeue()){o=o.concat(Z(e,t,r,n,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return X.flatten(X.map(n,(function(t){return e.outEdges(t.v,t.w)})),!0)},Q=X.constant(1);function Z(e,t,r,n,o){var i=o?[]:void 0;return X.forEach(e.inEdges(n.v),(function(n){var a=e.edge(n),s=e.node(n.v);o&&i.push({v:n.v,w:n.w}),s.out-=a,ee(t,r,s)})),X.forEach(e.outEdges(n.v),(function(n){var o=e.edge(n),i=n.w,a=e.node(i);a.in-=o,ee(t,r,a)})),e.removeNode(n.v),i}function ee(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)}var te=G,re=J,ne={run:function(e){var t="greedy"===e.graph().acyclicer?re(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],r={},n={};function o(i){te.has(n,i)||(n[i]=!0,r[i]=!0,te.forEach(e.outEdges(i),(function(e){te.has(r,e.w)?t.push(e):o(e.w)})),delete r[i])}return te.forEach(e.nodes(),o),t}(e);te.forEach(t,(function(t){var r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,te.uniqueId("rev"))}))},undo:function(e){te.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}}))}};var oe=G,ie=z.Graph,ae={addDummyNode:se,simplify:function(e){var t=(new ie).setGraph(e.graph());return oe.forEach(e.nodes(),(function(r){t.setNode(r,e.node(r))})),oe.forEach(e.edges(),(function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})})),t},asNonCompoundGraph:function(e){var t=new ie({multigraph:e.isMultigraph()}).setGraph(e.graph());return oe.forEach(e.nodes(),(function(r){e.children(r).length||t.setNode(r,e.node(r))})),oe.forEach(e.edges(),(function(r){t.setEdge(r,e.edge(r))})),t},successorWeights:function(e){var t=oe.map(e.nodes(),(function(t){var r={};return oe.forEach(e.outEdges(t),(function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight})),r}));return oe.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=oe.map(e.nodes(),(function(t){var r={};return oe.forEach(e.inEdges(t),(function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight})),r}));return oe.zipObject(e.nodes(),t)},intersectRect:function(e,t){var r,n,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");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);return{x:o+r,y:i+n}},buildLayerMatrix:function(e){var t=oe.map(oe.range(ue(e)+1),(function(){return[]}));return oe.forEach(e.nodes(),(function(r){var n=e.node(r),o=n.rank;oe.isUndefined(o)||(t[o][n.order]=r)})),t},normalizeRanks:function(e){var t=oe.min(oe.map(e.nodes(),(function(t){return e.node(t).rank})));oe.forEach(e.nodes(),(function(r){var n=e.node(r);oe.has(n,"rank")&&(n.rank-=t)}))},removeEmptyRanks:function(e){var t=oe.min(oe.map(e.nodes(),(function(t){return e.node(t).rank}))),r=[];oe.forEach(e.nodes(),(function(n){var o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)}));var n=0,o=e.graph().nodeRankFactor;oe.forEach(r,(function(t,r){oe.isUndefined(t)&&r%o!=0?--n:n&&oe.forEach(t,(function(t){e.node(t).rank+=n}))}))},addBorderNode:function(e,t,r,n){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=n);return se(e,"border",o,t)},maxRank:ue,partition:function(e,t){var r={lhs:[],rhs:[]};return oe.forEach(e,(function(e){t(e)?r.lhs.push(e):r.rhs.push(e)})),r},time:function(e,t){var r=oe.now();try{return t()}finally{console.log(e+" time: "+(oe.now()-r)+"ms")}},notime:function(e,t){return t()}};function se(e,t,r,n){var o;do{o=oe.uniqueId(n)}while(e.hasNode(o));return r.dummy=t,e.setNode(o,r),o}function ue(e){return oe.max(oe.map(e.nodes(),(function(t){var r=e.node(t).rank;if(!oe.isUndefined(r))return r})))}var ce=G,le=ae,he={run:function(e){e.graph().dummyChains=[],ce.forEach(e.edges(),(function(t){!function(e,t){var r,n,o,i=t.v,a=e.node(i).rank,s=t.w,u=e.node(s).rank,c=t.name,l=e.edge(t),h=l.labelRank;if(u===a+1)return;for(e.removeEdge(t),o=0,++a;a<u;++o,++a)l.points=[],n={width:0,height:0,edgeLabel:l,edgeObj:t,rank:a},r=le.addDummyNode(e,"edge",n,"_d"),a===h&&(n.width=l.width,n.height=l.height,n.dummy="edge-label",n.labelpos=l.labelpos),e.setEdge(i,r,{weight:l.weight},c),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,s,{weight:l.weight},c)}(e,t)}))},undo:function(e){ce.forEach(e.graph().dummyChains,(function(t){var r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)}))}};var de=G,fe={longestPath:function(e){var t={};de.forEach(e.sources(),(function r(n){var o=e.node(n);if(de.has(t,n))return o.rank;t[n]=!0;var i=de.min(de.map(e.outEdges(n),(function(t){return r(t.w)-e.edge(t).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}};var pe=G,ge=z.Graph,ye=fe.slack,ve=function(e){var t,r,n=new ge({directed:!1}),o=e.nodes()[0],i=e.nodeCount();n.setNode(o,{});for(;_e(n,e)<i;)t=me(n,e),r=n.hasNode(t.v)?ye(e,t):-ye(e,t),be(n,e,r);return n};function _e(e,t){return pe.forEach(e.nodes(),(function r(n){pe.forEach(t.nodeEdges(n),(function(o){var i=o.v,a=n===i?o.w:i;e.hasNode(a)||ye(t,o)||(e.setNode(a,{}),e.setEdge(n,a,{}),r(a))}))})),e.nodeCount()}function me(e,t){return pe.minBy(t.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return ye(t,r)}))}function be(e,t,r){pe.forEach(e.nodes(),(function(e){t.node(e).rank+=r}))}var we=G,xe=ve,Ee=fe.slack,ke=fe.longestPath,Se=z.alg.preorder,De=z.alg.postorder,Ce=ae.simplify,Ae=Me;function Me(e){e=Ce(e),ke(e);var t,r=xe(e);for(Pe(r),Fe(r,e);t=je(r);)Ne(r,e,t,Te(r,e,t))}function Fe(e,t){var r=De(e,e.nodes());r=r.slice(0,r.length-1),we.forEach(r,(function(r){!function(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=Ie(e,t,r)}(e,t,r)}))}function Ie(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),a=0;return i||(o=!1,i=t.edge(n,r)),a=i.weight,we.forEach(t.nodeEdges(r),(function(i){var s=i.v===r,u=s?i.w:i.v;if(u!==n){var c=s===o,l=t.edge(i).weight;if(a+=c?l:-l,function(e,t,r){return e.hasEdge(t,r)}(e,r,u)){var h=e.edge(r,u).cutvalue;a+=c?-h:h}}})),a}function Pe(e,t){arguments.length<2&&(t=e.nodes()[0]),Oe(e,{},1,t)}function Oe(e,t,r,n,o){var i=r,a=e.node(n);return t[n]=!0,we.forEach(e.neighbors(n),(function(o){we.has(t,o)||(r=Oe(e,t,r,o,n))})),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function je(e){return we.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function Te(e,t,r){var n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);var i=e.node(n),a=e.node(o),s=i,u=!1;i.lim>a.lim&&(s=a,u=!0);var c=we.filter(t.edges(),(function(t){return u===Ye(e,e.node(t.v),s)&&u!==Ye(e,e.node(t.w),s)}));return we.minBy(c,(function(e){return Ee(t,e)}))}function Ne(e,t,r,n){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(n.v,n.w,{}),Pe(e),Fe(e,t),function(e,t){var r=we.find(e.nodes(),(function(e){return!t.node(e).parent})),n=Se(e,r);n=n.slice(1),we.forEach(n,(function(r){var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)}))}(e,t)}function Ye(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}Me.initLowLimValues=Pe,Me.initCutValues=Fe,Me.calcCutValue=Ie,Me.leaveEdge=je,Me.enterEdge=Te,Me.exchangeEdges=Ne;var Le=fe.longestPath,Re=ve,Be=Ae,Ve=function(e){switch(e.graph().ranker){case"network-simplex":default:Ge(e);break;case"tight-tree":!function(e){Le(e),Re(e)}(e);break;case"longest-path":ze(e)}};var ze=Le;function Ge(e){Be(e)}var He=G,Ue=function(e){var t=function(e){var t={},r=0;function n(o){var i=r;He.forEach(e.children(o),n),t[o]={low:i,lim:r++}}return He.forEach(e.children(),n),t}(e);He.forEach(e.graph().dummyChains,(function(r){for(var n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){var o,i,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>u||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;r!==o.w;){if(n=e.node(r),l){for(;(c=a[u])!==s&&e.node(c).maxRank<n.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&e.node(c=a[u+1]).minRank<=n.rank;)u++;c=a[u]}e.setParent(r,c),r=e.successors(r)[0]}}))};var qe=G,We=ae,Xe={run:function(e){var t=We.addDummyNode(e,"root",{},"_root"),r=function(e){var t={};function r(n,o){var i=e.children(n);i&&i.length&&qe.forEach(i,(function(e){r(e,o+1)})),t[n]=o}return qe.forEach(e.children(),(function(e){r(e,1)})),t}(e),n=qe.max(qe.values(r))-1,o=2*n+1;e.graph().nestingRoot=t,qe.forEach(e.edges(),(function(t){e.edge(t).minlen*=o}));var i=function(e){return qe.reduce(e.edges(),(function(t,r){return t+e.edge(r).weight}),0)}(e)+1;qe.forEach(e.children(),(function(a){Ke(e,t,o,i,n,r,a)})),e.graph().nodeRankFactor=o},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,qe.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}};function Ke(e,t,r,n,o,i,a){var s=e.children(a);if(s.length){var u=We.addBorderNode(e,"_bt"),c=We.addBorderNode(e,"_bb"),l=e.node(a);e.setParent(u,a),l.borderTop=u,e.setParent(c,a),l.borderBottom=c,qe.forEach(s,(function(s){Ke(e,t,r,n,o,i,s);var l=e.node(s),h=l.borderTop?l.borderTop:s,d=l.borderBottom?l.borderBottom:s,f=l.borderTop?n:2*n,p=h!==d?1:o-i[a]+1;e.setEdge(u,h,{weight:f,minlen:p,nestingEdge:!0}),e.setEdge(d,c,{weight:f,minlen:p,nestingEdge:!0})})),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:o+i[a]})}else a!==t&&e.setEdge(t,a,{weight:0,minlen:r})}var $e=G,Je=ae,Qe=function(e){$e.forEach(e.children(),(function t(r){var n=e.children(r),o=e.node(r);if(n.length&&$e.forEach(n,t),$e.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Ze(e,"borderLeft","_bl",r,o,i),Ze(e,"borderRight","_br",r,o,i)}}))};function Ze(e,t,r,n,o,i){var a={width:0,height:0,rank:i,borderType:t},s=o[t][i-1],u=Je.addDummyNode(e,"border",a,r);o[t][i]=u,e.setParent(u,n),s&&e.setEdge(s,u,{weight:1})}var et=G,tt={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||rt(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){et.forEach(e.nodes(),(function(t){ot(e.node(t))})),et.forEach(e.edges(),(function(t){var r=e.edge(t);et.forEach(r.points,ot),et.has(r,"y")&&ot(r)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){et.forEach(e.nodes(),(function(t){it(e.node(t))})),et.forEach(e.edges(),(function(t){var r=e.edge(t);et.forEach(r.points,it),et.has(r,"x")&&it(r)}))}(e),rt(e))}};function rt(e){et.forEach(e.nodes(),(function(t){nt(e.node(t))})),et.forEach(e.edges(),(function(t){nt(e.edge(t))}))}function nt(e){var t=e.width;e.width=e.height,e.height=t}function ot(e){e.y=-e.y}function it(e){var t=e.x;e.x=e.y,e.y=t}var at=G,st=function(e){var t={},r=at.filter(e.nodes(),(function(t){return!e.children(t).length})),n=at.max(at.map(r,(function(t){return e.node(t).rank}))),o=at.map(at.range(n+1),(function(){return[]}));function i(r){if(!at.has(t,r)){t[r]=!0;var n=e.node(r);o[n.rank].push(r),at.forEach(e.successors(r),i)}}var a=at.sortBy(r,(function(t){return e.node(t).rank}));return at.forEach(a,i),o};var ut=G,ct=function(e,t){for(var r=0,n=1;n<t.length;++n)r+=lt(e,t[n-1],t[n]);return r};function lt(e,t,r){for(var n=ut.zipObject(r,ut.map(r,(function(e,t){return t}))),o=ut.flatten(ut.map(t,(function(t){return ut.sortBy(ut.map(e.outEdges(t),(function(t){return{pos:n[t.w],weight:e.edge(t).weight}})),"pos")})),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var s=ut.map(new Array(a),(function(){return 0})),u=0;return ut.forEach(o.forEach((function(e){var t=e.pos+i;s[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=s[t+1]),s[t=t-1>>1]+=e.weight;u+=e.weight*r}))),u}var ht=G;var dt=G;var ft=G,pt=ae;function gt(e,t,r){for(var n;t.length&&(n=ft.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}var yt=G,vt=function(e,t){return ht.map(t,(function(t){var r=e.inEdges(t);if(r.length){var n=ht.reduce(r,(function(t,r){var n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}}),{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}}))},_t=function(e,t){var r={};return dt.forEach(e,(function(e,t){var n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};dt.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)})),dt.forEach(t.edges(),(function(e){var t=r[e.v],n=r[e.w];dt.isUndefined(t)||dt.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))})),function(e){var t=[];function r(e){return function(t){t.merged||(dt.isUndefined(t.barycenter)||dt.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(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}(e,t)}}function n(t){return function(r){r.in.push(t),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();t.push(o),dt.forEach(o.in.reverse(),r(o)),dt.forEach(o.out,n(o))}return dt.map(dt.filter(t,(function(e){return!e.merged})),(function(e){return dt.pick(e,["vs","i","barycenter","weight"])}))}(dt.filter(r,(function(e){return!e.indegree})))},mt=function(e,t){var r=pt.partition(e,(function(e){return ft.has(e,"barycenter")})),n=r.lhs,o=ft.sortBy(r.rhs,(function(e){return-e.i})),i=[],a=0,s=0,u=0;n.sort((c=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i})),u=gt(i,o,u),ft.forEach(n,(function(e){u+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,s+=e.weight,u=gt(i,o,u)}));var c;var l={vs:ft.flatten(i,!0)};s&&(l.barycenter=a/s,l.weight=s);return l},bt=function e(t,r,n,o){var i=t.children(r),a=t.node(r),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,c={};s&&(i=yt.filter(i,(function(e){return e!==s&&e!==u})));var l=vt(t,i);yt.forEach(l,(function(r){if(t.children(r.v).length){var i=e(t,r.v,n,o);c[r.v]=i,yt.has(i,"barycenter")&&(a=r,s=i,yt.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s}));var h=_t(l,n);!function(e,t){yt.forEach(e,(function(e){e.vs=yt.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(h,c);var d=mt(h,o);if(s&&(d.vs=yt.flatten([s,d.vs,u],!0),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(u)[0]);yt.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d};var wt=G,xt=z.Graph,Et=function(e,t,r){var n=function(e){var t;for(;e.hasNode(t=wt.uniqueId("_root")););return t}(e),o=new xt({compound:!0}).setGraph({root:n}).setDefaultNodeLabel((function(t){return e.node(t)}));return wt.forEach(e.nodes(),(function(i){var a=e.node(i),s=e.parent(i);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||n),wt.forEach(e[r](i),(function(t){var r=t.v===i?t.w:t.v,n=o.edge(r,i),a=wt.isUndefined(n)?0:n.weight;o.setEdge(r,i,{weight:e.edge(t).weight+a})})),wt.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))})),o};var kt=G;var St=G,Dt=st,Ct=ct,At=bt,Mt=Et,Ft=function(e,t,r){var n,o={};kt.forEach(r,(function(r){for(var i,a,s=e.parent(r);s;){if((i=e.parent(s))?(a=o[i],o[i]=s):(a=n,n=s),a&&a!==s)return void t.setEdge(a,s);s=i}}))},It=z.Graph,Pt=ae,Ot=function(e){var t=Pt.maxRank(e),r=jt(e,St.range(1,t+1),"inEdges"),n=jt(e,St.range(t-1,-1,-1),"outEdges"),o=Dt(e);Nt(e,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Tt(s%2?r:n,s%4>=2),o=Pt.buildLayerMatrix(e);var c=Ct(e,o);c<a&&(u=0,i=St.cloneDeep(o),a=c)}Nt(e,i)};function jt(e,t,r){return St.map(t,(function(t){return Mt(e,t,r)}))}function Tt(e,t){var r=new It;St.forEach(e,(function(e){var n=e.graph().root,o=At(e,n,r,t);St.forEach(o.vs,(function(t,r){e.node(t).order=r})),Ft(e,r,o.vs)}))}function Nt(e,t){St.forEach(t,(function(t){St.forEach(t,(function(t,r){e.node(t).order=r}))}))}var Yt=G,Lt=z.Graph,Rt=ae,Bt=function(e){var t,r=Rt.buildLayerMatrix(e),n=Yt.merge(Vt(e,r),zt(e,r)),o={};Yt.forEach(["u","d"],(function(i){t="u"===i?r:Yt.values(r).reverse(),Yt.forEach(["l","r"],(function(r){"r"===r&&(t=Yt.map(t,(function(e){return Yt.values(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),s=Ut(e,t,n,a),u=qt(e,t,s.root,s.align,"r"===r);"r"===r&&(u=Yt.mapValues(u,(function(e){return-e}))),o[i+r]=u}))}));var i=Wt(e,o);return Xt(o,i),Kt(o,e.graph().align)};function Vt(e,t){var r={};return Yt.reduce(t,(function(t,n){var o=0,i=0,a=t.length,s=Yt.last(n);return Yt.forEach(n,(function(t,u){var c=function(e,t){if(e.node(t).dummy)return Yt.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),l=c?e.node(c).order:a;(c||t===s)&&(Yt.forEach(n.slice(i,u+1),(function(t){Yt.forEach(e.predecessors(t),(function(n){var i=e.node(n),a=i.order;!(a<o||l<a)||i.dummy&&e.node(t).dummy||Gt(r,n,t)}))})),i=u+1,o=l)})),n})),r}function zt(e,t){var r={};function n(t,n,o,i,a){var s;Yt.forEach(Yt.range(n,o),(function(n){s=t[n],e.node(s).dummy&&Yt.forEach(e.predecessors(s),(function(t){var n=e.node(t);n.dummy&&(n.order<i||n.order>a)&&Gt(r,t,s)}))}))}return Yt.reduce(t,(function(t,r){var o,i=-1,a=0;return Yt.forEach(r,(function(s,u){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(o=e.node(c[0]).order,n(r,a,u,i,o),a=u,i=o)}n(r,a,r.length,o,t.length)})),r})),r}function Gt(e,t,r){if(t>r){var n=t;t=r,r=n}var o=e[t];o||(e[t]=o={}),o[r]=!0}function Ht(e,t,r){if(t>r){var n=t;t=r,r=n}return Yt.has(e[t],r)}function Ut(e,t,r,n){var o={},i={},a={};return Yt.forEach(t,(function(e){Yt.forEach(e,(function(e,t){o[e]=e,i[e]=e,a[e]=t}))})),Yt.forEach(t,(function(e){var t=-1;Yt.forEach(e,(function(e){var s=n(e);if(s.length){s=Yt.sortBy(s,(function(e){return a[e]}));for(var u=(s.length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var h=s[c];i[e]===e&&t<a[h]&&!Ht(r,e,h)&&(i[h]=e,i[e]=o[e]=o[h],t=a[h])}}}))})),{root:o,align:i}}function qt(e,t,r,n,o){var i={},a=function(e,t,r,n){var o=new Lt,i=e.graph(),a=function(e,t,r){return function(n,o,i){var a,s=n.node(o),u=n.node(i),c=0;if(c+=s.width/2,Yt.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2}if(a&&(c+=r?a:-a),a=0,c+=(s.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,Yt.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=u.width/2;break;case"r":a=-u.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,n);return Yt.forEach(t,(function(t){var n;Yt.forEach(t,(function(t){var i=r[t];if(o.setNode(i),n){var s=r[n],u=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,n),u||0))}n=t}))})),o}(e,t,r,o),s=o?"borderLeft":"borderRight";function u(e,t){for(var r=a.nodes(),n=r.pop(),o={};n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return u((function(e){i[e]=a.inEdges(e).reduce((function(e,t){return Math.max(e,i[t.v]+a.edge(t))}),0)}),a.predecessors.bind(a)),u((function(t){var r=a.outEdges(t).reduce((function(e,t){return Math.min(e,i[t.w]-a.edge(t))}),Number.POSITIVE_INFINITY),n=e.node(t);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(i[t]=Math.max(i[t],r))}),a.successors.bind(a)),Yt.forEach(n,(function(e){i[e]=i[r[e]]})),i}function Wt(e,t){return Yt.minBy(Yt.values(t),(function(t){var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return Yt.forIn(t,(function(t,o){var i=function(e,t){return e.node(t).width}(e,o)/2;r=Math.max(t+i,r),n=Math.min(t-i,n)})),r-n}))}function Xt(e,t){var r=Yt.values(t),n=Yt.min(r),o=Yt.max(r);Yt.forEach(["u","d"],(function(r){Yt.forEach(["l","r"],(function(i){var a,s=r+i,u=e[s];if(u!==t){var c=Yt.values(u);(a="l"===i?n-Yt.min(c):o-Yt.max(c))&&(e[s]=Yt.mapValues(u,(function(e){return e+a})))}}))}))}function Kt(e,t){return Yt.mapValues(e.ul,(function(r,n){if(t)return e[t.toLowerCase()][n];var o=Yt.sortBy(Yt.map(e,n));return(o[1]+o[2])/2}))}var $t=G,Jt=ae,Qt=Bt,Zt=function(e){(function(e){var t=Jt.buildLayerMatrix(e),r=e.graph().ranksep,n=0;$t.forEach(t,(function(t){var o=$t.max($t.map(t,(function(t){return e.node(t).height})));$t.forEach(t,(function(t){e.node(t).y=n+o/2})),n+=o+r}))})(e=Jt.asNonCompoundGraph(e)),$t.forEach(Qt(e),(function(t,r){e.node(r).x=t}))};var er=G,tr=ne,rr=he,nr=Ve,or=ae.normalizeRanks,ir=Ue,ar=ae.removeEmptyRanks,sr=Xe,ur=Qe,cr=tt,lr=Ot,hr=Zt,dr=ae,fr=z.Graph,pr=function(e,t){var r=t&&t.debugTiming?dr.time:dr.notime;r("layout",(function(){var t=r(" buildLayoutGraph",(function(){return function(e){var t=new fr({multigraph:!0,compound:!0}),r=kr(e.graph());return t.setGraph(er.merge({},yr,Er(r,gr),er.pick(r,vr))),er.forEach(e.nodes(),(function(r){var n=kr(e.node(r));t.setNode(r,er.defaults(Er(n,_r),mr)),t.setParent(r,e.parent(r))})),er.forEach(e.edges(),(function(r){var n=kr(e.edge(r));t.setEdge(r,er.merge({},wr,Er(n,br),er.pick(n,xr)))})),t}(e)}));r(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,er.forEach(e.edges(),(function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){er.forEach(e.edges(),(function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){tr.run(e)})),t(" nestingGraph.run",(function(){sr.run(e)})),t(" rank",(function(){nr(dr.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){er.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),o={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};dr.addDummyNode(e,"edge-proxy",o,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){ar(e)})),t(" nestingGraph.cleanup",(function(){sr.cleanup(e)})),t(" normalizeRanks",(function(){or(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;er.forEach(e.nodes(),(function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=er.max(t,n.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){er.forEach(e.nodes(),(function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){rr.run(e)})),t(" parentDummyChains",(function(){ir(e)})),t(" addBorderSegments",(function(){ur(e)})),t(" order",(function(){lr(e)})),t(" insertSelfEdges",(function(){!function(e){var t=dr.buildLayerMatrix(e);er.forEach(t,(function(t){var r=0;er.forEach(t,(function(t,n){var o=e.node(t);o.order=n+r,er.forEach(o.selfEdges,(function(t){dr.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){cr.adjust(e)})),t(" position",(function(){hr(e)})),t(" positionSelfEdges",(function(){!function(e){er.forEach(e.nodes(),(function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,a=r.x-o,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){er.forEach(e.nodes(),(function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(er.last(r.borderLeft)),a=e.node(er.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}})),er.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){rr.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){er.forEach(e.edges(),(function(t){var r=e.edge(t);if(er.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){cr.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){var i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),r=Math.max(r,i+s/2),n=Math.min(n,a-u/2),o=Math.max(o,a+u/2)}er.forEach(e.nodes(),(function(t){u(e.node(t))})),er.forEach(e.edges(),(function(t){var r=e.edge(t);er.has(r,"x")&&u(r)})),t-=a,n-=s,er.forEach(e.nodes(),(function(r){var o=e.node(r);o.x-=t,o.y-=n})),er.forEach(e.edges(),(function(r){var o=e.edge(r);er.forEach(o.points,(function(e){e.x-=t,e.y-=n})),er.has(o,"x")&&(o.x-=t),er.has(o,"y")&&(o.y-=n)})),i.width=r-t+a,i.height=o-n+s}(e)})),t(" assignNodeIntersects",(function(){!function(e){er.forEach(e.edges(),(function(t){var r,n,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=a,n=i),o.points.unshift(dr.intersectRect(i,r)),o.points.push(dr.intersectRect(a,n))}))}(e)})),t(" reversePoints",(function(){!function(e){er.forEach(e.edges(),(function(t){var r=e.edge(t);r.reversed&&r.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){tr.undo(e)}))}(t,r)})),r(" updateInputGraph",(function(){!function(e,t){er.forEach(e.nodes(),(function(r){var n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,t.children(r).length&&(n.width=o.width,n.height=o.height))})),er.forEach(e.edges(),(function(r){var n=e.edge(r),o=t.edge(r);n.points=o.points,er.has(o,"x")&&(n.x=o.x,n.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var gr=["nodesep","edgesep","ranksep","marginx","marginy"],yr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vr=["acyclicer","ranker","rankdir","align"],_r=["width","height"],mr={width:0,height:0},br=["minlen","weight","width","height","labeloffset"],wr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xr=["labelpos"];function Er(e,t){return er.mapValues(er.pick(e,t),Number)}function kr(e){var t={};return er.forEach(e,(function(e,r){t[r.toLowerCase()]=e})),t}var Sr=G,Dr=ae,Cr=z.Graph;var Ar={graphlib:z,layout:pr,debug:{debugOrdering:function(e){var t=Dr.buildLayerMatrix(e),r=new Cr({compound:!0,multigraph:!0}).setGraph({});return Sr.forEach(e.nodes(),(function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)})),Sr.forEach(e.edges(),(function(e){r.setEdge(e.v,e.w,{},e.name)})),Sr.forEach(t,(function(e,t){var n="layer"+t;r.setNode(n,{rank:"same"}),Sr.reduce(e,(function(e,t){return r.setEdge(e,t,{style:"invis"}),t}))})),r}},util:{time:ae.time,notime:ae.notime},version:"0.8.5"},Mr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(Ar.graphlib.Graph),Fr=function(){function e(){this._g=new Mr({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel((function(){return{debug:"error"}})),this._g.setDefaultEdgeLabel((function(){return{debug:"error"}}))}return e.prototype.parent=function(e){return this._g.parent(e)},e.prototype.filterNodes=function(e){var t=[];return this.eachNode((function(r){e(r)&&t.push(r)})),t},e.prototype.eachNode=function(e){this._g.nodes().forEach((function(t){e(t,this.node(t))}),this)},e.prototype.filterEdges=function(e){var t=[];return this.eachEdge((function(r){e(r)&&t.push(r)})),t},e.prototype.eachEdge=function(e){this._g.edges().forEach((function(t){e(t,t.v,t.w,this.edge(t))}),this)},e.prototype.setData=function(e,t,r,n,o){for(var i=this,a={addedVertices:[],addedEdges:[]},s=e.concat(t),u=0;u<s.length;++u){var c=s[u];o&&this._g.hasNode(c._id)||(this._g.setNode(c._id,c),a.addedVertices.push(c))}for(u=0;u<r.length;++u){var l=r[u];o&&this._g.hasEdge(l._id)||(l._sourceVertex&&l._targetVertex?(this._g.setEdge(l._sourceVertex._id,l._targetVertex._id,l,l._id),a.addedEdges.push(l)):console.log("Bad edge definition"))}if(n)for(u=0;u<n.length;++u)this._g.setParent(n[u].child._id,n[u].parent._id);if(o){var h=r.map((function(e){return e._id}));this.filterEdges((function(e){return h.indexOf(e.name)<0})).forEach((function(e){return i._g.removeEdge(e.v,e.w)}));var d=s.map((function(e){return e._id}));this.filterNodes((function(e){return d.indexOf(e)<0})).forEach((function(e){return i._g.removeNode(e)}))}return a},e.prototype.node=function(e){return this._g.node(e)},e.prototype.nodeCount=function(){return this._g.nodeCount()},e.prototype.nodes=function(){var e=this;return this._g.nodes().map((function(t){return e._g.node(t)}))},e.prototype.nodeEdges=function(e){return this._g.nodeEdges(e)},e.prototype.edge=function(e){return this._g.edge(e)},e.prototype.edges=function(){var e=this;return this._g.edges().map((function(t){return e._g.edge(t)}))},e.prototype.neighbors=function(e){var t=this;return this._g.neighbors(e).map((function(e){return t._g.node(e)}))},e.prototype.singleNeighbors=function(e){var t=this;return this._g.neighbors(e).filter((function(e){return 1===t._g.neighbors(e).length})).map((function(e){return t._g.node(e)}))},e.prototype.gatherShortestPath=function(e,t){for(var r=[],n=t,o=e[n];o;){if(o.distance<1/0&&o.predecessor){var i=this._g.nodeEdges(n,o.predecessor)[0];r.push(this._g.edge(i))}o=e[n=o.predecessor]}return r},e.prototype.shortestPath=function(e,t){return this.gatherShortestPath(Ar.graphlib.alg.dijkstra(this._g,e),t)},e.prototype.undirectedShortestPath=function(e,t){var r=this;return this.gatherShortestPath(Ar.graphlib.alg.dijkstra(this._g,e,null,(function(e){return r._g.nodeEdges(e)})),t)},e.prototype.getJSON=function(){var e=Ar.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})," ")},e}();function Ir(e,t){var r;function n(){var n,o,i=r.length,a=0,s=0;for(n=0;n<i;++n)a+=(o=r[n]).x,s+=o.y;for(a=a/i-e,s=s/i-t,n=0;n<i;++n)(o=r[n]).x-=a,o.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n}function Pr(e){return function(){return e}}function Or(){return 1e-6*(Math.random()-.5)}function jr(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i,a,s,u,c,l,h,d,f=e._root,p={data:n},g=e._x0,y=e._y0,v=e._x1,_=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((c=t>=(i=(g+v)/2))?g=i:v=i,(l=r>=(a=(y+_)/2))?y=a:_=a,o=f,!(f=f[h=l<<1|c]))return o[h]=p,e;if(s=+e._x.call(null,f.data),u=+e._y.call(null,f.data),t===s&&r===u)return p.next=f,o?o[h]=p:e._root=p,e;do{o=o?o[h]=new Array(4):e._root=new Array(4),(c=t>=(i=(g+v)/2))?g=i:v=i,(l=r>=(a=(y+_)/2))?y=a:_=a}while((h=l<<1|c)==(d=(u>=a)<<1|s>=i));return o[d]=f,o[h]=p,e}function Tr(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function Nr(e){return e[0]}function Yr(e){return e[1]}function Lr(e,t,r){var n=new Rr(null==t?Nr:t,null==r?Yr:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function Rr(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function Br(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Vr=Lr.prototype=Rr.prototype;function zr(e){return e.index}function Gr(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function Hr(e){var r,n,o,i,a,s=zr,u=function(e){return 1/Math.min(i[e.source.index],i[e.target.index])},c=Pr(30),l=1;function h(t){for(var o=0,i=e.length;o<l;++o)for(var s,u,c,h,d,f,p,g=0;g<i;++g)u=(s=e[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Or(),d=c.y+c.vy-u.y-u.vy||Or(),h*=f=((f=Math.sqrt(h*h+d*d))-n[g])/f*t*r[g],d*=f,c.vx-=h*(p=a[g]),c.vy-=d*p,u.vx+=h*(p=1-p),u.vy+=d*p}function d(){if(o){var u,c,l=o.length,h=e.length,d=t.map(o,s);for(u=0,i=new Array(l);u<h;++u)(c=e[u]).index=u,"object"!=typeof c.source&&(c.source=Gr(d,c.source)),"object"!=typeof c.target&&(c.target=Gr(d,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(u=0,a=new Array(h);u<h;++u)c=e[u],a[u]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);r=new Array(h),f(),n=new Array(h),p()}}function f(){if(o)for(var t=0,n=e.length;t<n;++t)r[t]=+u(e[t],t,e)}function p(){if(o)for(var t=0,r=e.length;t<r;++t)n[t]=+c(e[t],t,e)}return null==e&&(e=[]),h.initialize=function(e){o=e,d()},h.links=function(t){return arguments.length?(e=t,d(),h):e},h.id=function(e){return arguments.length?(s=e,h):s},h.iterations=function(e){return arguments.length?(l=+e,h):l},h.strength=function(e){return arguments.length?(u="function"==typeof e?e:Pr(+e),f(),h):u},h.distance=function(e){return arguments.length?(c="function"==typeof e?e:Pr(+e),p(),h):c},h}Vr.copy=function(){var e,t,r=new Rr(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=Br(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var o=0;o<4;++o)(t=n.source[o])&&(t.length?e.push({source:t,target:n.target[o]=new Array(4)}):n.target[o]=Br(t));return r},Vr.add=function(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return jr(this.cover(t,r),t,r,e)},Vr.addAll=function(e){var t,r,n,o,i=e.length,a=new Array(i),s=new Array(i),u=1/0,c=1/0,l=-1/0,h=-1/0;for(r=0;r<i;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(o=+this._y.call(null,t))||(a[r]=n,s[r]=o,n<u&&(u=n),n>l&&(l=n),o<c&&(c=o),o>h&&(h=o));if(u>l||c>h)return this;for(this.cover(u,c).cover(l,h),r=0;r<i;++r)jr(this,a[r],s[r],e[r]);return this},Vr.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a,s,u=o-r,c=this._root;r>e||e>=o||n>t||t>=i;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:o=r+u,i=n+u;break;case 1:r=o-u,i=n+u;break;case 2:o=r+u,n=i-u;break;case 3:r=o-u,n=i-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this},Vr.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},Vr.extent=function(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]]},Vr.find=function(e,t,r){var n,o,i,a,s,u,c,l=this._x0,h=this._y0,d=this._x1,f=this._y1,p=[],g=this._root;for(g&&p.push(new Tr(g,l,h,d,f)),null==r?r=1/0:(l=e-r,h=t-r,d=e+r,f=t+r,r*=r);u=p.pop();)if(!(!(g=u.node)||(o=u.x0)>d||(i=u.y0)>f||(a=u.x1)<l||(s=u.y1)<h))if(g.length){var y=(o+a)/2,v=(i+s)/2;p.push(new Tr(g[3],y,v,a,s),new Tr(g[2],o,v,y,s),new Tr(g[1],y,i,a,v),new Tr(g[0],o,i,y,v)),(c=(t>=v)<<1|e>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var _=e-+this._x.call(null,g.data),m=t-+this._y.call(null,g.data),b=_*_+m*m;if(b<r){var w=Math.sqrt(r=b);l=e-w,h=t-w,d=e+w,f=t+w,n=g.data}}return n},Vr.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,o,i,a,s,u,c,l,h,d,f=this._root,p=this._x0,g=this._y0,y=this._x1,v=this._y1;if(!f)return this;if(f.length)for(;;){if((c=i>=(s=(p+y)/2))?p=s:y=s,(l=a>=(u=(g+v)/2))?g=u:v=u,t=f,!(f=f[h=l<<1|c]))return this;if(!f.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,d=h)}for(;f.data!==e;)if(n=f,!(f=f.next))return this;return(o=f.next)&&delete f.next,n?(o?n.next=o:delete n.next,this):t?(o?t[h]=o:delete t[h],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(r?r[d]=f:this._root=f),this):(this._root=o,this)},Vr.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},Vr.root=function(){return this._root},Vr.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},Vr.visit=function(e){var t,r,n,o,i,a,s=[],u=this._root;for(u&&s.push(new Tr(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,o=t.y0,i=t.x1,a=t.y1)&&u.length){var c=(n+i)/2,l=(o+a)/2;(r=u[3])&&s.push(new Tr(r,c,l,i,a)),(r=u[2])&&s.push(new Tr(r,n,l,c,a)),(r=u[1])&&s.push(new Tr(r,c,o,i,l)),(r=u[0])&&s.push(new Tr(r,n,o,c,l))}return this},Vr.visitAfter=function(e){var t,r=[],n=[];for(this._root&&r.push(new Tr(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var o=t.node;if(o.length){var i,a=t.x0,s=t.y0,u=t.x1,c=t.y1,l=(a+u)/2,h=(s+c)/2;(i=o[0])&&r.push(new Tr(i,a,s,l,h)),(i=o[1])&&r.push(new Tr(i,l,s,u,h)),(i=o[2])&&r.push(new Tr(i,a,h,l,c)),(i=o[3])&&r.push(new Tr(i,l,h,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},Vr.x=function(e){return arguments.length?(this._x=e,this):this._x},Vr.y=function(e){return arguments.length?(this._y=e,this):this._y};var Ur,qr,Wr=0,Xr=0,Kr=0,$r=0,Jr=0,Qr=0,Zr="object"==typeof performance&&performance.now?performance:Date,en="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tn(){return Jr||(en(rn),Jr=Zr.now()+Qr)}function rn(){Jr=0}function nn(){this._call=this._time=this._next=null}function on(e,t,r){var n=new nn;return n.restart(e,t,r),n}function an(){Jr=($r=Zr.now())+Qr,Wr=Xr=0;try{!function(){tn(),++Wr;for(var e,t=Ur;t;)(e=Jr-t._time)>=0&&t._call.call(null,e),t=t._next;--Wr}()}finally{Wr=0,function(){var e,t,r=Ur,n=1/0;for(;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:Ur=t);qr=e,un(n)}(),Jr=0}}function sn(){var e=Zr.now(),t=e-$r;t>1e3&&(Qr-=t,$r=e)}function un(e){Wr||(Xr&&(Xr=clearTimeout(Xr)),e-Jr>24?(e<1/0&&(Xr=setTimeout(an,e-Zr.now()-Qr)),Kr&&(Kr=clearInterval(Kr))):(Kr||($r=Zr.now(),Kr=setInterval(sn,1e3)),Wr=1,en(an)))}function cn(e){return e.x}function ln(e){return e.y}nn.prototype=on.prototype={constructor:nn,restart:function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?tn():+r)+(null==t?0:+t),this._next||qr===this||(qr?qr._next=this:Ur=this,qr=this),this._call=e,this._time=r,un()},stop:function(){this._call&&(this._call=null,this._time=1/0,un())}};var hn=Math.PI*(3-Math.sqrt(5));function dn(e){var r,n=1,o=.001,i=1-Math.pow(o,1/300),a=0,s=.6,u=t.map(),c=on(h),l=t.dispatch("tick","end");function h(){d(),l.call("tick",r),n<o&&(c.stop(),l.call("end",r))}function d(t){var o,c,l=e.length;void 0===t&&(t=1);for(var h=0;h<t;++h)for(n+=(a-n)*i,u.each((function(e){e(n)})),o=0;o<l;++o)null==(c=e[o]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return r}function f(){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 o=10*Math.sqrt(r),i=r*hn;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),f(),r={tick:d,restart:function(){return c.restart(h),r},stop:function(){return c.stop(),r},nodes:function(t){return arguments.length?(e=t,f(),u.each(p),r):e},alpha:function(e){return arguments.length?(n=+e,r):n},alphaMin:function(e){return arguments.length?(o=+e,r):o},alphaDecay:function(e){return arguments.length?(i=+e,r):+i},alphaTarget:function(e){return arguments.length?(a=+e,r):a},velocityDecay:function(e){return arguments.length?(s=1-e,r):1-s},force:function(e,t){return arguments.length>1?(null==t?u.remove(e):u.set(e,p(t)),r):u.get(e)},find:function(t,r,n){var o,i,a,s,u,c=0,l=e.length;for(null==n?n=1/0:n*=n,c=0;c<l;++c)(a=(o=t-(s=e[c]).x)*o+(i=r-s.y)*i)<n&&(u=s,n=a);return u},on:function(e,t){return arguments.length>1?(l.on(e,t),r):l.on(e)}}}function fn(){var e,t,r,n,o=Pr(-30),i=1,a=1/0,s=.81;function u(n){var o,i=e.length,a=Lr(e,cn,ln).visitAfter(l);for(r=n,o=0;o<i;++o)t=e[o],a.visit(h)}function c(){if(e){var t,r,i=e.length;for(n=new Array(i),t=0;t<i;++t)r=e[t],n[r.index]=+o(r,t,e)}}function l(e){var t,r,o,i,a,s=0,u=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,o+=r*t.x,i+=r*t.y);e.x=o/u,e.y=i/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=n[t.data.index]}while(t=t.next)}e.value=s}function h(e,o,u,c){if(!e.value)return!0;var l=e.x-t.x,h=e.y-t.y,d=c-o,f=l*l+h*h;if(d*d/s<f)return f<a&&(0===l&&(f+=(l=Or())*l),0===h&&(f+=(h=Or())*h),f<i&&(f=Math.sqrt(i*f)),t.vx+=l*e.value*r/f,t.vy+=h*e.value*r/f),!0;if(!(e.length||f>=a)){(e.data!==t||e.next)&&(0===l&&(f+=(l=Or())*l),0===h&&(f+=(h=Or())*h),f<i&&(f=Math.sqrt(i*f)));do{e.data!==t&&(d=n[e.data.index]*r/f,t.vx+=l*d,t.vy+=h*d)}while(e=e.next)}}return u.initialize=function(t){e=t,c()},u.strength=function(e){return arguments.length?(o="function"==typeof e?e:Pr(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(i=e*e,u):Math.sqrt(i)},u.distanceMax=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.theta=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u}function pn(e,t,r,n){var o=this;this.pos={};n=n||(t<r?t-0:r-0)/2;var i=e.nodeCount(),a=-Math.PI/2,s=2*Math.PI/i;e.eachNode((function(e,i){var u=i.getBBox();o.pos[e]={x:i.fixed?i.x:t/2+Math.cos(a)*(n-0),y:i.fixed?i.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s}))}function gn(e,t,r,n){n=n||{};var o=this;this.pos={},this.vertices=[],this.vertexMap={},e.eachNode((function(t){var 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};o.vertices.push(i),o.vertexMap[t]=i})),this.edges=[],e.eachEdge((function(e,t,r){o.edges.push({source:t,target:r})}));var i=Hr().id((function(e){return e.id})).distance(n.linkDistance).strength(n.linkStrength),a=fn().strength((function(e){var t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)}));if(this.force=dn().force("link",i).force("charge",a).force("center",Ir(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();var s=e.nodeCount();s=Math.min(s*s,500);for(var u=0;u<s;++u)this.force.tick();this.force.stop()}}function yn(e,t,r,n){var o=new Ar.graphlib.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel((function(){return{}})).setDefaultEdgeLabel((function(){return{}}));e.eachNode((function(t){var r=e.node(t).getBBox();o.setNode(t,{width:r.width,height:r.height})})),e.eachEdge((function(t,r,i){var a=e.edge(t);o.setEdge(r,i,{weight:a.weight()},a._id),n.digraph||o.setEdge(i,r,{weight:a.weight()},a._id)})),e.eachNode((function(t){o.setParent(t,e.parent(t))})),this.dagreLayout=Ar.layout(o,{debugTiming:!1});var i=-o.graph().width/2,a=-o.graph().height/2;o.nodes().forEach((function(e){var n=o.node(e);n.x+=i+t/2,n.y+=a+r/2})),o.edges().forEach((function(e){for(var n=o.edge(e),s=0;s<n.points.length;++s)n.points[s].x+=i+t/2,n.points[s].y+=a+r/2})),this.digraph=o}pn.prototype.nodePos=function(e){return this.pos[e]},pn.prototype.edgePoints=function(e){return[]},gn.prototype.nodePos=function(e){return this.vertexMap[e]},gn.prototype.edgePoints=function(e){return[]},yn.prototype.nodePos=function(e){return this.digraph.node(e)},yn.prototype.edgePoints=function(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points};Y(".graph_Subgraph .border{fill:none;stroke:#1f77b4;stroke-width:1px;pointer-events:none}.graph_Subgraph.selected>rect{stroke:red!important}");var vn=function(e){function r(){var r=e.call(this)||this;return r._textWidget=(new t.Text).anchor("start").fontSize(14),r._buttonMin=(new t.Icon).diameter(18).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",(function(){r.minClick()}),!0).on("dblclick",(function(){}),!0),r._minState="normal",r}return s(r,e),r.prototype.minState=function(e){return arguments.length?(this._minState=e,this):this._minState},r.prototype.calcIcon=function(){switch(this._minState){case"normal":return"";case"partial":return""}},r.prototype.getBBox=function(e,t){var r=this.width(),n=this.height();return{x:-r/2,y:-n/2-14,width:r,height:n}},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._border=r.append("rect").attr("class","border"),this._textWidget.target(t),this._buttonMin.target(t)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.getBBox();this._border.attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(t.Palette.textColor(this.border_colorFill())),this._textWidget.pos({x:o.x+4,y:o.y+14}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:o.x+o.width-13,y:o.y+13}).faChar(this.calcIcon()).render()},r.prototype.exit=function(t,r){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),e.prototype.exit.call(this,t,r)},r.prototype.intersection=function(e,t){var r=null;return[].forEach((function(e){(null===r||r.d>e.d)&&(r=e)})),r&&r.i?r.i:null},r.prototype.click=function(e){console.log("Clicked: "+e.id)},r.prototype.minClick=function(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()},r}(t.SVGWidget);vn.prototype._class+=" graph_Subgraph",vn.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),vn.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),vn.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),vn.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),vn.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),vn.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),vn.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});Y(".graph_Vertex.selected .common_Shape{stroke:red!important}");var _n=function(e){function r(){var r=e.call(this)||this;return r._icon=new t.Icon,r._textBox=new t.TextBox,r._annotationWidgets={},r.pos({x:void 0,y:void 0}),r}return s(r,e),r.prototype.getIconBBox=function(){var 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}},r.prototype.getBBox=function(e,t){var r=this.getIconBBox(),n=this._textBox.getBBox(!0),o=Math.min(r.x,n.x),i=Math.min(r.y,n.y);return{x:o,y:i,width:Math.max(r.x+r.width,n.x+n.width)-o,height:Math.max(r.y+r.height,n.y+n.height)-i}},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),delete this._prevHash,this._icon.target(t),this._textBox.target(t),r.on("mouseover",(function(e){return n.mouseover(e.data())})).on("mouseout",(function(e){return n.mouseout(e.data())}))},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.hashSum();if(this._prevHash!==o){this._prevHash=o,n.classed("centroid",this.centroid()),n.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();var i=this.getIconBBox();this._icon.move(i);var a=this,s=n.selectAll(".annotation").data(this.annotationIcons()),u=s.enter().append("g").attr("class","annotation").each((function(e,r){a._annotationWidgets[r]=(new t.Icon).target(this).shape("square")})),c=this._textBox.getBBox(!0),l=c.width/2,h=c.height/2;u.merge(s).each((function(e,t){var r=a._annotationWidgets[t];for(var n in r.diameter(a.annotationDiameter()).shape_colorFill(a.textbox_shape_colorFill()).shape_colorStroke(a.textbox_shape_colorStroke()),e)r[n]?r[n](e[n]):globalThis.__hpcc_debug&&console.log("Invalid annotation property: "+n);r.render();var o=r.getBBox(!0);r.move({x:l-o.width/2+4,y:h+o.height/2-4}),l-=o.width+a.annotationSpacing()})),s.exit().each((function(e,r){var n=t.select(this);a._annotationWidgets[r].target(null),delete a._annotationWidgets[r],n.remove()}))}},r.prototype.exit=function(t,r){for(var n in this._annotationWidgets)this._annotationWidgets[n].target(null);this._icon.target(null),this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype.contains=function(e){return this._icon.contains(e)||this._textBox.contains(e)},r.prototype.intersection=function(e,t){var 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},r.prototype.mouseover=function(e){},r.prototype.mouseout=function(e){},r}(t.SVGWidget);_n.prototype._class+=" graph_Vertex",_n.prototype.publishProxy("faChar","_icon"),_n.prototype.publishProxy("imageUrl","_icon"),_n.prototype.publishProxy("icon_diameter","_icon","diameter"),_n.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),_n.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),_n.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),_n.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),_n.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),_n.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),_n.prototype.publishProxy("text","_textBox"),_n.prototype.publishProxy("anchor","_textBox"),_n.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),_n.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),_n.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),_n.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),_n.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),_n.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),_n.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),_n.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),_n.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),_n.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});Y(".graph_Graph .marker{fill:#656565;stroke:none;stroke-width:1px}.graph_Graph .zoom{fill:none;pointer-events:all}.graph_Graph .selectionBrush{fill:none;stroke:#a9a9a9}.graph_Graph .graphEdge.shortest-path .graph_Edge{stroke:red}");var mn=function(e){function r(){var r=e.call(this)||this;r._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",(function(){return r.layoutClick("Hierarchy")})),r._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",(function(){return r.layoutClick("ForceDirected")})),r._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",(function(){return r.layoutClick("ForceDirected2")})),r._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",(function(){return r.layoutClick("Circle")})),r._dataHash=0,r._neighborOffsets=[],n.IGraph.call(r),n.ITooltip.call(r),r.tooltipHTML((function(e){var t;return e instanceof vn?t=e.title().replace(/\n/g,"<br>"):(e instanceof _n||e instanceof B)&&(t=e.text().replace(/\n/g,"<br>")),t?'<p style="text-align:center">'.concat(t,"</p>"):null})),r._drawStartPos="origin";var o=[r._toggleHierarchy,r._toggleForceDirected,r._toggleForceDirected2,r._toggleCircle,new t.Spacer];return r._iconBar.buttons(o.concat(r._iconBar.buttons())),r._graphData=new Fr,r.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},r._selection=new t.Utility.Selection(r),r.zoomToFitLimit(1),r}return s(r,e),r.prototype.iconBarButtons=function(){return this._iconBar.buttons()},r.prototype.layoutClick=function(e){var t=this;this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render((function(e){t.applyScaleOnLayout(!1)}))},r.prototype.getOffsetPos=function(){return{x:0,y:0}},r.prototype.size=function(t){var r=e.prototype.size.apply(this,arguments);return r},r.prototype.clear=function(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)},r.prototype.data=function(t,r){var n=e.prototype.data.apply(this,arguments);if(arguments.length){r||(this._graphData=new Fr,this._renderCount=0);var o=this._graphData.setData(t.subgraphs||[],t.vertices||[],t.edges||[],t.hierarchy||[],r||!1);o.addedVertices.length&&this._dataHash++;var i=this;o.addedVertices.forEach((function(e){e._graphID=i._id})),o.addedEdges.forEach((function(e){e._graphID=i._id}));var a={};this._graphData.edges().forEach((function(e){a[e._sourceVertex._id]||(a[e._sourceVertex._id]={}),a[e._sourceVertex._id][e._targetVertex._id]||(a[e._sourceVertex._id][e._targetVertex._id]=0);var t=++a[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)}))}return n},r.prototype.graphData=function(){return this._graphData},r.prototype.selection=function(e){return arguments.length?(this._selection.set(e),this):this._selection.get()},r.prototype.linkcolor_default=function(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor},r.prototype.linktooltip_default=function(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip},r.prototype.dragstart=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.__drag_dx=n.x-e.x(),e.__drag_dy=n.y-e.y(),this._dragging=!0,this.forceLayout){n.active||this.forceLayout.force.alphaTarget(.3).restart();var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=o.x,o.fy=o.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map((function(r){return t.select(r.target()).raise(),{neighbor:r,offsetX:e.x()-r.x(),offsetY:e.y()-r.y()}})));for(var i=e.target(),a=i.nextSibling;a;)i.parentNode.insertBefore(a,i),a=i.nextSibling;t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach((function(e){var t=r._graphData.edge(e);r._pushMarkers(t.element())}))}},r.prototype.dragging=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.move({x:n.x-e.__drag_dx,y:n.y-e.__drag_dy}),this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=n.x-e.__drag_dx,o.fy=n.y-e.__drag_dy}this._neighborOffsets.forEach((function(t){var o=n.x-e.__drag_dx-t.offsetX,i=n.y-e.__drag_dy-t.offsetY;if(r.forceLayout){var a=r.forceLayout.vertexMap[t.neighbor.id()];a.fixed=!0,a.fx=o,a.fy=i}t.neighbor.move({x:o,y:i})})),this.refreshIncidentEdges(e,!0)}},r.prototype.dragend=function(e){var r=this;if(this.allowDragging()){if(t.d3Event().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){var n=e.calcSnap(this.snapToGrid());e.move(n[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!1,o.fx=null,o.fy=null,this._neighborOffsets.forEach((function(e){var t=r.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null}))}this._neighborOffsets=[],t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach((function(e){var t=this._graphData.edge(e);this._popMarkers(t.element())}))}},r.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n),this._zoomGrab.on("click.clear",(function(){o.selectionClearOnBackgroundClick()&&o._selection.clear()})),this._d3Drag=t.drag().on("start",(function(e){return o.dragstart(e)})).on("end",(function(e){return o.dragend(e)})).on("drag",(function(e){return o.dragging(e)})),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new t.SVGGlowFilter(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")},r.prototype.getBounds=function(e,t){var r=[[null,null],[null,null]];return e.forEach((function(e){var n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},o=n.x-n.width/2,i=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>o)&&(r[0][0]=o),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<i)&&(r[1][0]=i),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)})),r},r.prototype.getVertexBounds=function(e){return this.getBounds(this._graphData.nodes(),e)},r.prototype.getSelectionBounds=function(e){return this.getBounds(this._selection.get(),e)},r.prototype.centerOnItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(o)},r.prototype.zoomToItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(o)},r.prototype.updateVertices=function(e,r,n){var o=this.width(),i=this.height(),a=this,s=e.selectAll("#"+this._id+r+" > .graphVertex").data(n,(function(e){return e.id()}));s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",(function(e){a._selection.click(e,t.d3Event()),a.selectionChanged()})).on("click",(function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",n,{vertex:e})})).on("dblclick",(function(e){t.d3Event().stopPropagation();var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",n,{vertex:e})})).on("contextmenu",(function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",n,{vertex:e})})).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",(function(e){a._dragging||a.vertex_mouseover(t.select(this),e)})).on("mouseout",(function(e){a._dragging||a.vertex_mouseout(t.select(this),e)})).each((function(e){t.select(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||o/2,y:e.y()||i/2}).animationFrameRender(),a.allowDragging()&&t.select(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()){var t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}})))})).transition().duration(750).style("opacity",1),s.each((function(e){e.animationFrameRender()})),s.exit().each((function(e){e.target(null)})).remove(),s.order()},r.prototype.update=function(r,n){var o=this;e.prototype.update.call(this,r,n),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());var i=this.layout();this._toggleHierarchy.selected("Hierarchy"===i).render(),this._toggleForceDirected.selected("ForceDirected"===i).render(),this._toggleForceDirected2.selected("ForceDirected2"===i).render(),this._toggleCircle.selected("Circle"===i).render();var a=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter((function(e){return"Hierarchy"===o.layout()&&e instanceof vn}))),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter((function(e){return!(e instanceof vn)})));var s=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],(function(e){return e.id()}));s.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",(function(e){a._selection.click(e,t.d3Event())})).on("click",(function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_click(a.rowToObj(e.data()),"",n,{edge:e})})).on("dblclick",(function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_dblclick(a.rowToObj(e.data()),"",n,{edge:e})})).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",(function(e){a._dragging||a.edge_mouseover(t.select(this),e)})).on("mouseout",(function(e){a._dragging||a.edge_mouseout(t.select(this),e)})).each((function(e){e.target(this).animationFrameRender()})).transition().duration(750).style("opacity",1),s.each((function(e){e.animationFrameRender()})),s.exit().each((function(e){e.target(null)})).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))},r.prototype.exit=function(t,r){this._graphData.nodes().forEach((function(e){return e.target(null)})),this._graphData.edges().forEach((function(e){return e.target(null)})),e.prototype.exit.call(this,t,r)},r.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,(function(e){r.doLayout().then((function(){r.progress("end"),t&&t(e)}))})),this},r.prototype.doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise((function(r,n){requestAnimationFrame((function(){t._prevLayout!==t.layout()||t._prevDataHash!==t._dataHash?(t._prevLayout=t.layout(),t._prevDataHash=t._dataHash,t._doLayout(e).then((function(){r()}))):r()}))}))},r.prototype._doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise((function(n,o){t.progress("layout-start"),t.forceLayout&&(t.forceLayout.force.stop(),t.forceLayout=null);var i=t,a=t.getLayoutEngine();if("ForceDirected2"===t.layout()){var s=0,u=0;t.forceLayout=a,t.forceLayout.force.on("tick",(function(){var e=performance.now();i.progress("layout-tick"),a.vertices.forEach((function(e){if(e.fixed);else{var t=i._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}})),i._graphData.edges().forEach((function(e){e.points([],!1,!1)})),i.applyScaleOnLayout(),s+=performance.now()-e,++u,console.log("tick:"+s/u)})).on("end",(function(){i.progress("layout-end")})),t.forceLayout.force.restart(),n()}else a&&(t.forceLayout=null,i._dragging=!0,i._graphData.nodes().forEach((function(e){var t=a.nodePos(e.id());e instanceof r.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)})),i._graphData.edges().forEach((function(t){var r=a.edgePoints(t);t.points(r,e)})),i.applyScaleOnLayout()&&requestAnimationFrame((function(){i.zoomToFit(),n()})),t._fixIEMarkers(),setTimeout((function(){i._dragging=!1}),e?e+50:50),t.progress("layout-end"),i.applyScaleOnLayout()||n())}))},r.prototype.getLayoutEngine=function(){switch(this.layout()){case"Circle":return new pn(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new gn(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 gn(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 yn(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},r.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.nodeEdges(e.id()),o=0;o<n.length;++o){var i=this._graphData.edge(n[o]);r[i.id()]=i,i._sourceVertex.id()!==e.id()&&(t[i._sourceVertex.id()]=i._sourceVertex),i._targetVertex.id()!==e.id()&&(t[i._targetVertex.id()]=i._targetVertex)}return{vertices:t,edges:r}},r.prototype.highlightVerticies=function(e){var t=this,r=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",(function(t){return!e||e[t.id()]})).style("filter",(function(r){return e&&e[r.id()]?"url(#"+t.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(t){return!e||e[t.id()]?1:r.highlight.opacity})),this},r.prototype.highlightEdges=function(e){var 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},r.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id()]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t._sourceVertex.id()]=t._sourceVertex,r[t._targetVertex.id()]=t._targetVertex;var n={};n[t.id()]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.refreshIncidentEdges=function(e,t){var r=this;this._graphData.nodeEdges(e.id()).forEach((function(e){r._graphData.edge(e).points([],!1,t)}))},r.prototype.centroids=function(){return this._graphData.nodes().filter((function(e){return e.centroid()}))},r.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach((function(r){e.selection().forEach((function(n){e._graphData.undirectedShortestPath(r.id(),n.id()).forEach((function(e){t[e.id()]=!0}))}))})),this.svgE.selectAll(".graphEdge").classed("shortest-path",(function(e){return!0===t[e.id()]}))}},r.prototype.vertex_click=function(e,t,r,o){o&&o.vertex&&o.vertex._placeholderElement.node().parentNode.appendChild(o.vertex._placeholderElement.node()),n.IGraph.prototype.vertex_click.apply(this,arguments)},r.prototype.vertex_dblclick=function(e,t,r,n){},r.prototype.vertex_contextmenu=function(e,t,r,n){},r.prototype.vertex_mouseover=function(e,t){this.highlightVertex(e,t)},r.prototype.vertex_mouseout=function(e,t){this.highlightVertex(null,null)},r.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},r.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},r.prototype.addMarkers=function(e){void 0===e&&(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)},r.prototype.progress=function(e){},r.Subgraph=vn,r.Vertex=_n,r.Edge=B,r.profileID=0,r}(t.SVGZoomWidget);mn.prototype._class+=" graph_Graph",mn.prototype.implements(n.IGraph.prototype),mn.prototype.implements(n.ITooltip.prototype),mn.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),mn.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),mn.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),mn.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),mn.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),mn.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),mn.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),mn.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),mn.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),mn.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),mn.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),mn.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),mn.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),mn.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),mn.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),mn.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),mn.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),mn.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),mn.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});var bn=mn.prototype.scale;mn.prototype.scale=function(e,t){var r=bn.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var wn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.iconColumn()},t.prototype.indexes=function(){var 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())}},t.prototype.mapper=function(){var e=this,t=this.indexes();return function(r){return{faChar:r[t.iconCol],tooltip:r[t.tooltipCol],shape_colorFill:r[t.shapeFillCol]||e.shapeFillDefault(),shape_colorStroke:r[t.shapeStrokeCol]||e.shapeStrokeDefault(),image_colorFill:r[t.iconFillCol]||e.iconFillDefault()}}},t}(t.PropertyExt);wn.prototype._class+=" graph_Annotation",wn.prototype.publish("iconColumn","","set","Icon column",(function(){return this._owner.columns()}),{optional:!0}),wn.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),wn.prototype.publish("iconFillColumn","","set","Icon fill color column",(function(){return this._owner.columns()}),{optional:!0}),wn.prototype.publish("tooltipColumn","","set","Tooltip column",(function(){return this._owner.columns()}),{optional:!0}),wn.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),wn.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",(function(){return this._owner.columns()}),{optional:!0}),wn.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),wn.prototype.publish("shapeFillColumn","","set","Shape fill color column",(function(){return this._owner.columns()}),{optional:!0});var xn=function(e){function t(){var t=e.call(this)||this;return t._vertexMap={},t._edgeMap={},t._merge=!1,t._adjacencyData=[],t}return s(t,e),t.prototype.linksColumns=function(){var e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map((function(e){return e.label()})):[]},t.prototype.validAnnotations=function(){return this.annotations().filter((function(e){return e.valid()}))},t.prototype.updateData=function(){var t=this,n=r.hashSum([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map((function(e){return e.hashSum()}))]);if(this._prevAdjacencyDataHash!==n){this._prevAdjacencyDataHash=n;for(var o=this.columns(),i=o.indexOf(this.uidColumn()),a=o.indexOf(this.labelColumn()),s=o.indexOf(this.iconColumn()),u=o.indexOf(this.linksColumn()),c=this.linksColumns(),l=c.indexOf(this.linkUidColumn()),h=c.indexOf(this.linkLabelColumn()),d=this.validAnnotations().map((function(e){return e.mapper()})),f={},p={},g={vertices:this._adjacencyData.map((function(e){var r=e[i];if(void 0!==r){var n=f[r]||t._vertexMap[r];return n||(n=new _n),f[r]=n,n.text(e[a]).data(e).faChar(e[s]).annotationIcons(d.map((function(t){return t(e)}))),n}})).filter((function(e){return!!e})),edges:[]},y=0,v=this._adjacencyData;y<v.length;y++){var _=v[y],m=_[i],b=_[u];if(void 0!==m&&void 0!==b)for(var w=0,x=b;w<x.length;w++){var E=x[w],k=E[l],S=E[h],D="".concat(m,"->").concat(k),C=p[D]||this._edgeMap[D];C||(f[m]&&f[k]?C=(new B).sourceVertex(f[m]).targetVertex(f[k]).data(E):console.log("Missing vertices for edge: "+D)),C&&(C.text(S),p[D]=C,g.edges.push(C))}}this._vertexMap=f,this._edgeMap=p,e.prototype.data.call(this,g,this._merge)}},t.prototype.data=function(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.")},t.prototype.update=function(t,r){this.updateData(),e.prototype.update.call(this,t,r)},t.prototype.click=function(e,t,r){console.log("click")},t}(mn);function En(e,t){return e.sourceLinks.length?e.depth:t-1}function kn(e){return function(){return e}}function Sn(e,t){return Cn(e.source,t.source)||e.index-t.index}function Dn(e,t){return Cn(e.target,t.target)||e.index-t.index}function Cn(e,t){return e.y0-t.y0}function An(e){return e.value}function Mn(e){return e.index}function Fn(e){return e.nodes}function In(e){return e.links}function Pn(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function On({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(const e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function jn(){let e,r,n,o=0,i=0,a=1,s=1,u=24,c=8,l=Mn,h=En,d=Fn,f=In,p=6;function g(){const e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return y(e),v(e),_(e),m(e),b(e),On(e),e}function y({nodes:e,links:t}){for(const[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];const r=new Map(e.map(((t,r)=>[l(t,r,e),t])));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:o}=n;"object"!=typeof t&&(t=n.source=Pn(r,t)),"object"!=typeof o&&(o=n.target=Pn(r,o)),t.sourceLinks.push(n),o.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}function v({nodes:e}){for(const r of e)r.value=void 0===r.fixedValue?Math.max(t.sum(r.sourceLinks,An),t.sum(r.targetLinks,An)):r.fixedValue}function _({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.depth=o;for(const{target:t}of e.sourceLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}function m({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.height=o;for(const{source:t}of e.targetLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}function b(n){const l=function({nodes:e}){const n=t.max(e,(e=>e.depth))+1,i=(a-o-u)/(n-1),s=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(h.call(null,t,n))));t.layer=e,t.x0=o+e*i,t.x1=t.x0+u,s[e]?s[e].push(t):s[e]=[t]}if(r)for(const e of s)e.sort(r);return s}(n);e=Math.min(c,(s-i)/(t.max(l,(e=>e.length))-1)),function(r){const n=t.min(r,(r=>(s-i-(r.length-1)*e)/t.sum(r,An)));for(const t of r){let r=i;for(const o of t){o.y0=r,o.y1=r+o.value*n,r=o.y1+e;for(const e of o.sourceLinks)e.width=e.value*n}r=(s-r+e)/(t.length+1);for(let e=0;e<t.length;++e){const n=t[e];n.y0+=r*(e+1),n.y1+=r*(e+1)}C(t)}}(l);for(let e=0;e<p;++e){const t=Math.pow(.99,e),r=Math.max(1-t,(e+1)/p);x(l,t,r),w(l,t,r)}}function w(e,t,n){for(let o=1,i=e.length;o<i;++o){const i=e[o];for(const e of i){let r=0,n=0;for(const{source:t,value:o}of e.targetLinks){let i=o*(e.layer-t.layer);r+=A(t,e)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,D(e)}void 0===r&&i.sort(Cn),E(i,n)}}function x(e,t,n){for(let o=e.length-2;o>=0;--o){const i=e[o];for(const e of i){let r=0,n=0;for(const{target:t,value:o}of e.sourceLinks){let i=o*(t.layer-e.layer);r+=M(e,t)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,D(e)}void 0===r&&i.sort(Cn),E(i,n)}}function E(t,r){const n=t.length>>1,o=t[n];S(t,o.y0-e,n-1,r),k(t,o.y1+e,n+1,r),S(t,s,t.length-1,r),k(t,i,0,r)}function k(t,r,n,o){for(;n<t.length;++n){const i=t[n],a=(r-i.y0)*o;a>1e-6&&(i.y0+=a,i.y1+=a),r=i.y1+e}}function S(t,r,n,o){for(;n>=0;--n){const i=t[n],a=(i.y1-r)*o;a>1e-6&&(i.y0-=a,i.y1-=a),r=i.y0-e}}function D({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort(Dn);for(const{target:{targetLinks:t}}of e)t.sort(Sn)}}function C(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(Dn),r.sort(Sn)}function A(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:o,width:i}of t.sourceLinks){if(o===r)break;n+=i+e}for(const{source:e,width:o}of r.targetLinks){if(e===t)break;n-=o}return n}function M(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:o,width:i}of r.targetLinks){if(o===t)break;n+=i+e}for(const{target:e,width:o}of t.sourceLinks){if(e===r)break;n-=o}return n}return g.update=function(e){return On(e),e},g.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:kn(e),g):l},g.nodeAlign=function(e){return arguments.length?(h="function"==typeof e?e:kn(e),g):h},g.nodeSort=function(e){return arguments.length?(r=e,g):r},g.nodeWidth=function(e){return arguments.length?(u=+e,g):u},g.nodePadding=function(t){return arguments.length?(c=e=+t,g):c},g.nodes=function(e){return arguments.length?(d="function"==typeof e?e:kn(e),g):d},g.links=function(e){return arguments.length?(f="function"==typeof e?e:kn(e),g):f},g.linkSort=function(e){return arguments.length?(n=e,g):n},g.size=function(e){return arguments.length?(o=i=0,a=+e[0],s=+e[1],g):[a-o,s-i]},g.extent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],i=+e[0][1],s=+e[1][1],g):[[o,i],[a,s]]},g.iterations=function(e){return arguments.length?(p=+e,g):p},g}function Tn(e){return[e.source.x1,e.y0]}function Nn(e){return[e.target.x0,e.y1]}function Yn(){return A().source(Tn).target(Nn)}xn.prototype._class+=" graph_AdjacencyGraph",xn.prototype.publish("uidColumn","","set","UID column",(function(){return this.columns()}),{optional:!0}),xn.prototype.publish("labelColumn","","set","Label column",(function(){return this.columns()}),{optional:!0}),xn.prototype.publish("iconColumn","","set","Icon column",(function(){return this.columns()}),{optional:!0}),xn.prototype.publish("linksColumn","","set","Links column",(function(){return this.columns()}),{optional:!0}),xn.prototype.publish("linkUidColumn","","set","Link UID column",(function(){return this.linksColumns()}),{optional:!0}),xn.prototype.publish("linkLabelColumn","","set","Link Label column",(function(){return this.linksColumns()}),{optional:!0}),xn.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:wn});Y(".graph_Sankey .node rect{fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9;cursor:move}.graph_Sankey .node.selected rect{stroke:red}.graph_Sankey .node.over rect{stroke:orange}.graph_Sankey .node.selected.over rect{stroke:red}.graph_Sankey .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_Sankey .node.selected text{fill:red}.graph_Sankey .node.over text{fill:orange}.graph_Sankey .node.selected.over text{fill:red}.graph_Sankey .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_Sankey .link:hover{stroke-opacity:.5}");var Ln={mean:t.mean,median:t.median,min:t.min,max:t.max,sum:t.sum},Rn=function(e){function t(){return e.call(this)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.column()},t.prototype.aggregate=function(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:var t=this._owner.columns().indexOf(this.aggrColumn());return Ln[this.aggrType()](e,(function(e){return+e[t]}))}},t}(t.PropertyExt);Rn.prototype._class+=" graph_Sankey.SankeyColumn",Rn.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0}),Rn.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:function(e){return!e._owner||0===e._owner.mappings().indexOf(e)}}),Rn.prototype.publish("aggrColumn",null,"set","Aggregation Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0,disable:function(e){return!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e)}});var Bn=function(e){function r(){var r=e.call(this)||this;return t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(r,e),r.prototype.sankeyData=function(){var e={vertices:[],edges:[]};if(0===this.data().length)return e;var t={},r=this.mappings().filter((function(e){return e.valid()}));return r.forEach((function(r,n){this._db.rollupView([r.column()]).entries().forEach((function(o){var i=r.column()+":"+n+":"+o.key;t[i]||(e.vertices.push({__id:i,__category:r.column(),name:o.key,origRow:o.value,value:o.value[n][2]}),t[i]=e.vertices.length-1)}),this)}),this),r.forEach((function(n,o){if(o<r.length-1){var i=r[o+1];this._db.rollupView([n.column(),i.column()]).entries().forEach((function(r){var a=n.column()+":"+o+":"+r.key;r.values.forEach((function(r){var n=i.column()+":"+(o+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})}))}))}}),this),e},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=new jn,this._selection.widgetElement(r)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData(),a=2*o;this._d3Sankey.extent([[o,o],[this.width()-a,this.height()-a]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:i.vertices,links:i.edges});var s=this,u=n.selectAll(".link").data(i.edges);u.enter().append("path").attr("class","link").each((function(){t.select(this).append("title")})).merge(u).attr("d",Yn()).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})),u.exit().remove();var c=n.selectAll(".node").data(i.vertices);c.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",(function(e){s.click(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))})).on("dblclick",(function(e){s.dblclick(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))})).each((function(){var e=t.select(this);e.append("rect"),e.append("text")})).merge(c).attr("transform",(function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"})).each((function(){var e=t.select(this);e.select("rect").attr("height",(function(e){return e.y1-e.y0})).attr("width",s._d3Sankey.nodeWidth()).style("fill",(function(e){return s._palette(e.name)})).style("stroke",(function(e){return s.vertexStrokeColor()})).style("stroke-width",(function(e){return o})).style("cursor",s.xAxisMovement()||s.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<s.width()/2})).attr("x",6+s._d3Sankey.nodeWidth()).attr("text-anchor","start")})),c.exit().remove()},r.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},r.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},r.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},r}(t.SVGWidget);Bn.prototype._class+=" graph_Sankey",Bn.prototype.Column=Rn,Bn.prototype.mixin(t.Utility.SimpleSelectionMixin),Bn.prototype._palette=t.Palette.ordinal("default"),Bn.prototype.publish("paletteID","default","set","Color palette for this widget",Bn.prototype._palette.switch()),Bn.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:Rn}),Bn.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),Bn.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),Bn.prototype.publish("vertexWidth",36,"number","Vertex Width"),Bn.prototype.publish("vertexPadding",40,"number","Vertex Padding"),Bn.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),Bn.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement");var Vn=E().x((function(e){return e[0]})).y((function(e){return e[1]})).curve(I),zn=E().x((function(e){return e[0]})).y((function(e){return e[1]})).curve(T),Gn=function(){function e(e){this._running=!1,this._graph=e}return e.prototype.start=function(){return this._running=!0,this._graph.progress("layout-start"),Promise.resolve(this)},e.prototype.stop=function(){return this._running=!1,this._graph.progress("layout-stop"),this},e.prototype.running=function(){return this._running},e.prototype.center=function(e){if(e.length%2==1)return e[Math.floor(e.length/2)];var t=e[e.length/2-1],r=e[e.length/2];return[(t[0]+r[0])/2,(t[1]+r[1])/2]},e.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target),o=[[r.x,r.y],[n.x,n.y]];if(t){var i=o[0][0]-o[1][0],a=o[0][1]-o[1][1];if(Math.sqrt(i*i+a*a)){var s=(o[0][0]+o[1][0])/2-a*t/100,u=(o[0][1]+o[1][1])/2+i*t/100;return{path:zn([o[0],[s,u],o[1]]),labelPos:[s,u]}}}return{path:Vn(o),labelPos:this.center(o)}},e}(),Hn=function(e){return e*Math.PI/180},Un=function(e){function t(t,r){void 0===r&&(r=60);var n=e.call(this,t)||this;return n.sideLength=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices();r.allEdges().forEach((function(e){return delete e.points}));var o,i=(o=n.length,t.sideLength/(2*Math.sin(Hn(180/o)))),a=360/n.length;return n.forEach((function(t,r){delete t.fx,delete t.fy,t.x=e.width/2+Math.cos(Hn(r*a))*i,t.y=e.height/2+Math.sin(Hn(r*a))*i})),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t._running=!1,t}))},t}(Gn);var qn=E().x((function(e){return e[0]})).y((function(e){return e[1]})).curve(I),Wn=function(e){return"cluster_".concat(e)};function Xn(e,t,r,n){var o=e-r,i=t-n;return Math.sqrt(o*o+i*i)}var Kn=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData();return function(e,t){var r=new Blob(['!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(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.\')}var n={exports:{}};n.exports=function(){function e(n,r,o){function i(s,u){if(!r[s]){if(!n[s]){if(!u&&t)return t(s);if(a)return a(s,!0);var c=new Error("Cannot find module \'"+s+"\'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};n[s][0].call(f.exports,(function(e){return i(n[s][1][e]||e)}),f,f.exports,e,n,r,o)}return r[s].exports}for(var a=t,s=0;s<o.length;s++)i(o[s]);return i}return e}()({1:[function(e,t,n){t.exports={graphlib:e("./lib/graphlib"),layout:e("./lib/layout"),debug:e("./lib/debug"),util:{time:e("./lib/util").time,notime:e("./lib/util").notime},version:e("./lib/version")}},{"./lib/debug":6,"./lib/graphlib":7,"./lib/layout":9,"./lib/util":29,"./lib/version":30}],2:[function(e,t,n){var r=e("./lodash"),o=e("./greedy-fas");function i(e){var t="greedy"===e.graph().acyclicer?o(e,n(e)):a(e);function n(e){return function(t){return e.edge(t).weight}}r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))}function a(e){var t=[],n={},o={};function i(a){r.has(o,a)||(o[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):i(e.w)})),delete n[a])}return r.forEach(e.nodes(),i),t}function s(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}t.exports={run:i,undo:s}},{"./greedy-fas":8,"./lodash":10}],3:[function(e,t,n){var r=e("./lodash"),o=e("./util");function i(e){function t(n){var o=e.children(n),i=e.node(n);if(o.length&&r.forEach(o,t),r.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,u=i.maxRank+1;s<u;++s)a(e,"borderLeft","_bl",n,i,s),a(e,"borderRight","_br",n,i,s)}}r.forEach(e.children(),t)}function a(e,t,n,r,i,a){var s={width:0,height:0,rank:a,borderType:t},u=i[t][a-1],c=o.addDummyNode(e,"border",s,n);i[t][a]=c,e.setParent(c,r),u&&e.setEdge(u,c,{weight:1})}t.exports=i},{"./lodash":10,"./util":29}],4:[function(e,t,n){var r=e("./lodash");function o(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||a(e)}function i(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||u(e),"lr"!==t&&"rl"!==t||(f(e),a(e))}function a(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){s(e.edge(t))}))}function s(e){var t=e.width;e.width=e.height,e.height=t}function u(e){r.forEach(e.nodes(),(function(t){c(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,c),r.has(n,"y")&&c(n)}))}function c(e){e.y=-e.y}function f(e){r.forEach(e.nodes(),(function(t){d(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,d),r.has(n,"x")&&d(n)}))}function d(e){var t=e.x;e.x=e.y,e.y=t}t.exports={adjust:o,undo:i}},{"./lodash":10}],5:[function(e,t,n){function r(){var e={};e._next=e._prev=e,this._sentinel=e}function o(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=r,r.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return o(t),t},r.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&o(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},r.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return"["+e.join(", ")+"]"}},{}],6:[function(e,t,n){var r=e("./lodash"),o=e("./util"),i=e("./graphlib").Graph;function a(e){var t=o.buildLayerMatrix(e),n=new i({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}t.exports={debugOrdering:a}},{"./graphlib":7,"./lodash":10,"./util":29}],7:[function(e,t,n){var r;if("function"==typeof e)try{r=e("graphlib")}catch(e){}r||(r=window.graphlib),t.exports=r},{graphlib:31}],8:[function(e,t,n){var r=e("./lodash"),o=e("./graphlib").Graph,i=e("./data/list");t.exports=s;var a=r.constant(1);function s(e,t){if(e.nodeCount()<=1)return[];var n=f(e,t||a),o=u(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(o,(function(t){return e.outEdges(t.v,t.w)})),!0)}function u(e,t,n){for(var r,o=[],i=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)c(e,t,n,r);for(;r=i.dequeue();)c(e,t,n,r);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(r=t[s].dequeue()){o=o.concat(c(e,t,n,r,!0));break}}return o}function c(e,t,n,o,i){var a=i?[]:void 0;return r.forEach(e.inEdges(o.v),(function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,d(t,n,s)})),r.forEach(e.outEdges(o.v),(function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,d(t,n,a)})),e.removeNode(o.v),a}function f(e,t){var n=new o,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,o=t(e),i=r+o;n.setEdge(e.v,e.w,i),s=Math.max(s,n.node(e.v).out+=o),a=Math.max(a,n.node(e.w).in+=o)}));var u=r.range(s+a+3).map((function(){return new i})),c=a+1;return r.forEach(n.nodes(),(function(e){d(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}function d(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(e,t,n){var r=e("./lodash"),o=e("./acyclic"),i=e("./normalize"),a=e("./rank"),s=e("./util").normalizeRanks,u=e("./parent-dummy-chains"),c=e("./util").removeEmptyRanks,f=e("./nesting-graph"),d=e("./add-border-segments"),h=e("./coordinate-system"),l=e("./order"),p=e("./position"),v=e("./util"),_=e("./graphlib").Graph;function y(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return I(e)}));n(" runLayout",(function(){g(t,n)})),n(" updateInputGraph",(function(){b(e,t)}))}))}function g(e,t){t(" makeSpaceForEdgeLabels",(function(){S(e)})),t(" removeSelfEdges",(function(){B(e)})),t(" acyclic",(function(){o.run(e)})),t(" nestingGraph.run",(function(){f.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){C(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){f.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){N(e)})),t(" removeEdgeLabelProxies",(function(){T(e)})),t(" normalize.run",(function(){i.run(e)})),t(" parentDummyChains",(function(){u(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){l(e)})),t(" insertSelfEdges",(function(){G(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){p(e)})),t(" positionSelfEdges",(function(){R(e)})),t(" removeBorderNodes",(function(){D(e)})),t(" normalize.undo",(function(){i.undo(e)})),t(" fixupEdgeLabelCoords",(function(){P(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){M(e)})),t(" assignNodeIntersects",(function(){L(e)})),t(" reversePoints",(function(){F(e)})),t(" acyclic.undo",(function(){o.undo(e)}))}function b(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,t.children(n).length&&(r.width=o.width,r.height=o.height))})),r.forEach(e.edges(),(function(n){var o=e.edge(n),i=t.edge(n);o.points=i.points,r.has(i,"x")&&(o.x=i.x,o.y=i.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}t.exports=y;var m=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],E=["width","height"],j={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],A={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function I(e){var t=new _({multigraph:!0,compound:!0}),n=z(e.graph());return t.setGraph(r.merge({},x,U(n,m),r.pick(n,w))),r.forEach(e.nodes(),(function(n){var o=z(e.node(n));t.setNode(n,r.defaults(U(o,E),j)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var o=z(e.edge(n));t.setEdge(n,r.merge({},A,U(o,k),r.pick(o,O)))})),t}function S(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}function C(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",o,"_ep")}}))}function N(e){var t=0;r.forEach(e.nodes(),(function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=r.max(t,o.maxRank))})),e.graph().maxRank=t}function T(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}function M(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),s=a.marginx||0,u=a.marginy||0;function c(e){var r=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),o=Math.min(o,a-u/2),i=Math.max(i,a+u/2)}r.forEach(e.nodes(),(function(t){c(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&c(n)})),t-=s,o-=u,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=o})),r.forEach(e.edges(),(function(n){var i=e.edge(n);r.forEach(i.points,(function(e){e.x-=t,e.y-=o})),r.has(i,"x")&&(i.x-=t),r.has(i,"y")&&(i.y-=o)})),a.width=n-t+s,a.height=i-o+u}function L(e){r.forEach(e.edges(),(function(t){var n,r,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(v.intersectRect(i,n)),o.points.push(v.intersectRect(a,r))}))}function P(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.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 F(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}function D(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}function B(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}function G(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,o){var i=e.node(t);i.order=o+n,r.forEach(i.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:o+ ++n,e:t.e,label:t.label},"_se")})),delete i.selfEdges}))}))}function R(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}}))}function U(e,t){return r.mapValues(r.pick(e,t),Number)}function z(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(e,t,n){var r;if("function"==typeof e)try{r={cloneDeep:e("lodash/cloneDeep"),constant:e("lodash/constant"),defaults:e("lodash/defaults"),each:e("lodash/each"),filter:e("lodash/filter"),find:e("lodash/find"),flatten:e("lodash/flatten"),forEach:e("lodash/forEach"),forIn:e("lodash/forIn"),has:e("lodash/has"),isUndefined:e("lodash/isUndefined"),last:e("lodash/last"),map:e("lodash/map"),mapValues:e("lodash/mapValues"),max:e("lodash/max"),merge:e("lodash/merge"),min:e("lodash/min"),minBy:e("lodash/minBy"),now:e("lodash/now"),pick:e("lodash/pick"),range:e("lodash/range"),reduce:e("lodash/reduce"),sortBy:e("lodash/sortBy"),uniqueId:e("lodash/uniqueId"),values:e("lodash/values"),zipObject:e("lodash/zipObject")}}catch(e){}r||(r=window._),t.exports=r},{"lodash/cloneDeep":227,"lodash/constant":228,"lodash/defaults":229,"lodash/each":230,"lodash/filter":232,"lodash/find":233,"lodash/flatten":235,"lodash/forEach":236,"lodash/forIn":237,"lodash/has":239,"lodash/isUndefined":258,"lodash/last":261,"lodash/map":262,"lodash/mapValues":263,"lodash/max":264,"lodash/merge":266,"lodash/min":267,"lodash/minBy":268,"lodash/now":270,"lodash/pick":271,"lodash/range":273,"lodash/reduce":274,"lodash/sortBy":276,"lodash/uniqueId":286,"lodash/values":287,"lodash/zipObject":288}],11:[function(e,t,n){var r=e("./lodash"),o=e("./util");function i(e){var t=o.addDummyNode(e,"root",{},"_root"),n=s(e),i=r.max(r.values(n))-1,c=2*i+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=c}));var f=u(e)+1;r.forEach(e.children(),(function(r){a(e,t,c,f,i,n,r)})),e.graph().nodeRankFactor=c}function a(e,t,n,i,s,u,c){var f=e.children(c);if(f.length){var d=o.addBorderNode(e,"_bt"),h=o.addBorderNode(e,"_bb"),l=e.node(c);e.setParent(d,c),l.borderTop=d,e.setParent(h,c),l.borderBottom=h,r.forEach(f,(function(r){a(e,t,n,i,s,u,r);var o=e.node(r),f=o.borderTop?o.borderTop:r,l=o.borderBottom?o.borderBottom:r,p=o.borderTop?i:2*i,v=f!==l?1:s-u[c]+1;e.setEdge(d,f,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(l,h,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+u[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}function s(e){var t={};function n(o,i){var a=e.children(o);a&&a.length&&r.forEach(a,(function(e){n(e,i+1)})),t[o]=i}return r.forEach(e.children(),(function(e){n(e,1)})),t}function u(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}function c(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}t.exports={run:i,cleanup:c}},{"./lodash":10,"./util":29}],12:[function(e,t,n){var r=e("./lodash"),o=e("./util");function i(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){a(e,t)}))}function a(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,s=t.name,u=e.edge(t),c=u.labelRank;if(a!==r+1){var f,d,h;for(e.removeEdge(t),h=0,++r;r<a;++h,++r)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:t,rank:r},f=o.addDummyNode(e,"edge",d,"_d"),r===c&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),e.setEdge(n,f,{weight:u.weight},s),0===h&&e.graph().dummyChains.push(f),n=f;e.setEdge(n,i,{weight:u.weight},s)}}function s(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=n,r=e.node(t)}))}t.exports={run:i,undo:s}},{"./lodash":10,"./util":29}],13:[function(e,t,n){var r=e("../lodash");function o(e,t,n){var o,i={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=i[r],i[r]=s):(a=o,o=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}t.exports=o},{"../lodash":10}],14:[function(e,t,n){var r=e("../lodash");function o(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var o=r.reduce(n,(function(t,n){var r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}}))}t.exports=o},{"../lodash":10}],15:[function(e,t,n){var r=e("../lodash"),o=e("../graphlib").Graph;function i(e,t,n){var i=a(e),s=new o({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(o){var a=e.node(o),u=e.parent(o);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(s.setNode(o),s.setParent(o,u||i),r.forEach(e[n](o),(function(t){var n=t.v===o?t.w:t.v,i=s.edge(n,o),a=r.isUndefined(i)?0:i.weight;s.setEdge(n,o,{weight:e.edge(t).weight+a})})),r.has(a,"minRank")&&s.setNode(o,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))})),s}function a(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}t.exports=i},{"../graphlib":7,"../lodash":10}],16:[function(e,t,n){var r=e("../lodash");function o(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}function i(e,t,n){for(var o=r.zipObject(n,r.map(n,(function(e,t){return t}))),i=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:o[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(i.forEach((function(e){var t=e.pos+a;u[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=u[t+1]),u[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}t.exports=o},{"../lodash":10}],17:[function(e,t,n){var r=e("../lodash"),o=e("./init-order"),i=e("./cross-count"),a=e("./sort-subgraph"),s=e("./build-layer-graph"),u=e("./add-subgraph-constraints"),c=e("../graphlib").Graph,f=e("../util");function d(e){var t=f.maxRank(e),n=h(e,r.range(1,t+1),"inEdges"),a=h(e,r.range(t-1,-1,-1),"outEdges"),s=o(e);p(e,s);for(var u,c=Number.POSITIVE_INFINITY,d=0,v=0;v<4;++d,++v){l(d%2?n:a,d%4>=2),s=f.buildLayerMatrix(e);var _=i(e,s);_<c&&(v=0,u=r.cloneDeep(s),c=_)}p(e,u)}function h(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function l(e,t){var n=new c;r.forEach(e,(function(e){var o=e.graph().root,i=a(e,o,n,t);r.forEach(i.vs,(function(t,n){e.node(t).order=n})),u(e,n,i.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}t.exports=d},{"../graphlib":7,"../lodash":10,"../util":29,"./add-subgraph-constraints":13,"./build-layer-graph":15,"./cross-count":16,"./init-order":18,"./sort-subgraph":20}],18:[function(e,t,n){var r=e("../lodash");function o(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),o=r.max(r.map(n,(function(t){return e.node(t).rank}))),i=r.map(r.range(o+1),(function(){return[]}));function a(n){if(!r.has(t,n)){t[n]=!0;var o=e.node(n);i[o.rank].push(n),r.forEach(e.successors(n),a)}}var s=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(s,a),i}t.exports=o},{"../lodash":10}],19:[function(e,t,n){var r=e("../lodash");function o(e,t){var n={};return r.forEach(e,(function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],o=n[e.w];r.isUndefined(t)||r.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))})),i(r.filter(n,(function(e){return!e.indegree})))}function i(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&a(e,t)}}function o(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),r.forEach(i.in.reverse(),n(i)),r.forEach(i.out,o(i))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}function a(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}t.exports=o},{"../lodash":10}],20:[function(e,t,n){var r=e("../lodash"),o=e("./barycenter"),i=e("./resolve-conflicts"),a=e("./sort");function s(e,t,n,f){var d=e.children(t),h=e.node(t),l=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,v={};l&&(d=r.filter(d,(function(e){return e!==l&&e!==p})));var _=o(e,d);r.forEach(_,(function(t){if(e.children(t.v).length){var o=s(e,t.v,n,f);v[t.v]=o,r.has(o,"barycenter")&&c(t,o)}}));var y=i(_,n);u(y,v);var g=a(y,f);if(l&&(g.vs=r.flatten([l,g.vs,p],!0),e.predecessors(l).length)){var b=e.node(e.predecessors(l)[0]),m=e.node(e.predecessors(p)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+b.order+m.order)/(g.weight+2),g.weight+=2}return g}function u(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}function c(e,t){r.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}t.exports=s},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(e,t,n){var r=e("../lodash"),o=e("../util");function i(e,t){var n=o.partition(e,(function(e){return r.has(e,"barycenter")})),i=n.lhs,u=r.sortBy(n.rhs,(function(e){return-e.i})),c=[],f=0,d=0,h=0;i.sort(s(!!t)),h=a(c,u,h),r.forEach(i,(function(e){h+=e.vs.length,c.push(e.vs),f+=e.barycenter*e.weight,d+=e.weight,h=a(c,u,h)}));var l={vs:r.flatten(c,!0)};return d&&(l.barycenter=f/d,l.weight=d),l}function a(e,t,n){for(var o;t.length&&(o=r.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}function s(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}t.exports=i},{"../lodash":10,"../util":29}],22:[function(e,t,n){var r=e("./lodash");function o(e){var t=a(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),o=r.edgeObj,a=i(e,t,o.v,o.w),s=a.path,u=a.lca,c=0,f=s[c],d=!0;n!==o.w;){if(r=e.node(n),d){for(;(f=s[c])!==u&&e.node(f).maxRank<r.rank;)c++;f===u&&(d=!1)}if(!d){for(;c<s.length-1&&e.node(f=s[c+1]).minRank<=r.rank;)c++;f=s[c]}e.setParent(n,f),n=e.successors(n)[0]}}))}function i(e,t,n,r){var o,i,a=[],s=[],u=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);o=n;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>u||c>t[o].lim));for(i=o,o=r;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}function a(e){var t={},n=0;function o(i){var a=n;r.forEach(e.children(i),o),t[i]={low:a,lim:n++}}return r.forEach(e.children(),o),t}t.exports=o},{"./lodash":10}],23:[function(e,t,n){var r=e("../lodash"),o=e("../graphlib").Graph,i=e("../util");function a(e,t){var n={};function o(t,o){var i=0,a=0,s=t.length,f=r.last(o);return r.forEach(o,(function(t,d){var h=u(e,t),l=h?e.node(h).order:s;(h||t===f)&&(r.forEach(o.slice(a,d+1),(function(t){r.forEach(e.predecessors(t),(function(r){var o=e.node(r),a=o.order;!(a<i||l<a)||o.dummy&&e.node(t).dummy||c(n,r,t)}))})),a=d+1,i=l)})),o}return r.reduce(t,o),n}function s(e,t){var n={};function o(t,o,i,a,s){var u;r.forEach(r.range(o,i),(function(o){u=t[o],e.node(u).dummy&&r.forEach(e.predecessors(u),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&c(n,t,u)}))}))}function i(t,n){var i,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(i=e.node(c[0]).order,o(n,s,u,a,i),s=u,a=i)}o(n,s,n.length,i,t.length)})),n}return r.reduce(t,i),n}function u(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}function c(e,t,n){if(t>n){var r=t;t=n,n=r}var o=e[t];o||(e[t]=o={}),o[n]=!0}function f(e,t,n){if(t>n){var o=t;t=n,n=o}return r.has(e[t],n)}function d(e,t,n,o){var i={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){i[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var u=o(e);if(u.length){u=r.sortBy(u,(function(e){return s[e]}));for(var c=(u.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var l=u[d];a[e]===e&&t<s[l]&&!f(n,e,l)&&(a[l]=e,a[e]=i[e]=i[l],t=s[l])}}}))})),{root:i,align:a}}function h(e,t,n,o,i){var a={},s=l(e,t,n,i),u=i?"borderLeft":"borderRight";function c(e,t){for(var n=s.nodes(),r=n.pop(),o={};r;)o[r]?e(r):(o[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function f(e){a[e]=s.inEdges(e).reduce((function(e,t){return Math.max(e,a[t.v]+s.edge(t))}),0)}function d(t){var n=s.outEdges(t).reduce((function(e,t){return Math.min(e,a[t.w]-s.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(a[t]=Math.max(a[t],n))}return c(f,s.predecessors.bind(s)),c(d,s.successors.bind(s)),r.forEach(o,(function(e){a[e]=a[n[e]]})),a}function l(e,t,n,i){var a=new o,s=e.graph(),u=g(s.nodesep,s.edgesep,i);return r.forEach(t,(function(t){var o;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),o){var i=n[o],s=a.edge(i,r);a.setEdge(i,r,Math.max(u(e,t,o),s||0))}o=t}))})),a}function p(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var i=b(e,r)/2;n=Math.max(t+i,n),o=Math.min(t-i,o)})),n-o}))}function v(e,t){var n=r.values(t),o=r.min(n),i=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=e[u];if(c!==t){var f=r.values(c);(s="l"===a?o-r.min(f):i-r.max(f))&&(e[u]=r.mapValues(c,(function(e){return e+s})))}}))}))}function _(e,t){return r.mapValues(e.ul,(function(n,o){if(t)return e[t.toLowerCase()][o];var i=r.sortBy(r.map(e,o));return(i[1]+i[2])/2}))}function y(e){var t,n=i.buildLayerMatrix(e),o=r.merge(a(e,n),s(e,n)),u={};r.forEach(["u","d"],(function(i){t="u"===i?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),s=d(e,t,o,a),c=h(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(e){return-e}))),u[i+n]=c}))}));var c=p(e,u);return v(u,c),_(u,e.graph().align)}function g(e,t,n){return function(o,i,a){var s,u=o.node(i),c=o.node(a),f=0;if(f+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(f+=n?s:-s),s=0,f+=(u.dummy?t:e)/2,f+=(c.dummy?t:e)/2,f+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(f+=n?s:-s),s=0,f}}function b(e,t){return e.node(t).width}t.exports={positionX:y,findType1Conflicts:a,findType2Conflicts:s,addConflict:c,hasConflict:f,verticalAlignment:d,horizontalCompaction:h,alignCoordinates:v,findSmallestWidthAlignment:p,balance:_}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(e,t,n){var r=e("../lodash"),o=e("../util"),i=e("./bk").positionX;function a(e){s(e=o.asNonCompoundGraph(e)),r.forEach(i(e),(function(t,n){e.node(n).x=t}))}function s(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,i=0;r.forEach(t,(function(t){var o=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=i+o/2})),i+=o+n}))}t.exports=a},{"../lodash":10,"../util":29,"./bk":23}],25:[function(e,t,n){var r=e("../lodash"),o=e("../graphlib").Graph,i=e("./util").slack;function a(e){var t,n,r=new o({directed:!1}),a=e.nodes()[0],f=e.nodeCount();for(r.setNode(a,{});s(r,e)<f;)t=u(r,e),n=r.hasNode(t.v)?i(e,t):-i(e,t),c(r,e,n);return r}function s(e,t){function n(o){r.forEach(t.nodeEdges(o),(function(r){var a=r.v,s=o===a?r.w:a;e.hasNode(s)||i(t,r)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))}))}return r.forEach(e.nodes(),n),e.nodeCount()}function u(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return i(t,n)}))}function c(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}t.exports=a},{"../graphlib":7,"../lodash":10,"./util":28}],26:[function(e,t,n){var r=e("./util").longestPath,o=e("./feasible-tree"),i=e("./network-simplex");function a(e){switch(e.graph().ranker){case"network-simplex":default:c(e);break;case"tight-tree":u(e);break;case"longest-path":s(e)}}t.exports=a;var s=r;function u(e){r(e),o(e)}function c(e){i(e)}},{"./feasible-tree":25,"./network-simplex":27,"./util":28}],27:[function(e,t,n){var r=e("../lodash"),o=e("./feasible-tree"),i=e("./util").slack,a=e("./util").longestPath,s=e("../graphlib").alg.preorder,u=e("../graphlib").alg.postorder,c=e("../util").simplify;function f(e){e=c(e),a(e);var t,n=o(e);for(p(n),d(n,e);t=_(n);)g(n,e,t,y(n,e,t))}function d(e,t){var n=u(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){h(e,t,n)}))}function h(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=l(e,t,n)}function l(e,t,n){var o=e.node(n).parent,i=!0,a=t.edge(n,o),s=0;return a||(i=!1,a=t.edge(o,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a=r.v===n,u=a?r.w:r.v;if(u!==o){var c=a===i,f=t.edge(r).weight;if(s+=c?f:-f,m(e,n,u)){var d=e.edge(n,u).cutvalue;s+=c?-d:d}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),v(e,{},1,t)}function v(e,t,n,o,i){var a=n,s=e.node(o);return t[o]=!0,r.forEach(e.neighbors(o),(function(i){r.has(t,i)||(n=v(e,t,n,i,o))})),s.low=a,s.lim=n++,i?s.parent=i:delete s.parent,n}function _(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function y(e,t,n){var o=n.v,a=n.w;t.hasEdge(o,a)||(o=n.w,a=n.v);var s=e.node(o),u=e.node(a),c=s,f=!1;s.lim>u.lim&&(c=u,f=!0);var d=r.filter(t.edges(),(function(t){return f===x(e,e.node(t.v),c)&&f!==x(e,e.node(t.w),c)}));return r.minBy(d,(function(e){return i(t,e)}))}function g(e,t,n,r){var o=n.v,i=n.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),p(e),d(e,t),b(e,t)}function b(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),o=s(e,n);o=o.slice(1),r.forEach(o,(function(n){var r=e.node(n).parent,o=t.edge(n,r),i=!1;o||(o=t.edge(r,n),i=!0),t.node(n).rank=t.node(r).rank+(i?o.minlen:-o.minlen)}))}function m(e,t,n){return e.hasEdge(t,n)}function x(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=f,f.initLowLimValues=p,f.initCutValues=d,f.calcCutValue=l,f.leaveEdge=_,f.enterEdge=y,f.exchangeEdges=g},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(e,t,n){var r=e("../lodash");function o(e){var t={};function n(o){var i=e.node(o);if(r.has(t,o))return i.rank;t[o]=!0;var a=r.min(r.map(e.outEdges(o),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),i.rank=a}r.forEach(e.sources(),n)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}t.exports={longestPath:o,slack:i}},{"../lodash":10}],29:[function(e,t,n){var r=e("./lodash"),o=e("./graphlib").Graph;function i(e,t,n,o){var i;do{i=r.uniqueId(o)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function a(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t}function s(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t}function u(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)}function c(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)}function f(e,t){var n,r,o=e.x,i=e.y,a=t.x-o,s=t.y-i,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),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}}function d(e){var t=r.map(r.range(v(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var o=e.node(n),i=o.rank;r.isUndefined(i)||(t[i][o.order]=n)})),t}function h(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)}))}function l(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)}));var o=0,i=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%i!=0?--o:o&&r.forEach(t,(function(t){e.node(t).rank+=o}))}))}function p(e,t,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),i(e,"border",o,t)}function v(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}function _(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n}function y(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}}function g(e,t){return t()}t.exports={addDummyNode:i,simplify:a,asNonCompoundGraph:s,successorWeights:u,predecessorWeights:c,intersectRect:f,buildLayerMatrix:d,normalizeRanks:h,removeEmptyRanks:l,addBorderNode:p,maxRank:v,partition:_,time:y,notime:g}},{"./graphlib":7,"./lodash":10}],30:[function(e,t,n){t.exports="0.8.5"},{}],31:[function(e,t,n){var r=e("./lib");t.exports={Graph:r.Graph,json:e("./lib/json"),alg:e("./lib/alg"),version:r.version}},{"./lib":47,"./lib/alg":38,"./lib/json":48}],32:[function(e,t,n){var r=e("../lodash");function o(e){var t,n={},o=[];function i(o){r.has(n,o)||(n[o]=!0,t.push(o),r.each(e.successors(o),i),r.each(e.predecessors(o),i))}return r.each(e.nodes(),(function(e){t=[],i(e),t.length&&o.push(t)})),o}t.exports=o},{"../lodash":49}],33:[function(e,t,n){var r=e("../lodash");function o(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}t.exports=o},{"../lodash":49}],34:[function(e,t,n){var r=e("./dijkstra"),o=e("../lodash");function i(e,t,n){return o.transform(e.nodes(),(function(o,i){o[i]=r(e,i,t,n)}),{})}t.exports=i},{"../lodash":49,"./dijkstra":35}],35:[function(e,t,n){var r=e("../lodash"),o=e("../data/priority-queue");t.exports=a;var i=r.constant(1);function a(e,t,n,r){return s(e,String(t),n||i,r||function(t){return e.outEdges(t)})}function s(e,t,n,r){var i,a,s={},u=new o,c=function(e){var t=e.v!==i?e.v:e.w,r=s[t],o=n(e),c=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,u.decrease(t,c))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},u.add(e,n)}));u.size()>0&&(i=u.removeMin(),(a=s[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return s}},{"../data/priority-queue":45,"../lodash":49}],36:[function(e,t,n){var r=e("../lodash"),o=e("./tarjan");function i(e){return r.filter(o(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}t.exports=i},{"../lodash":49,"./tarjan":43}],37:[function(e,t,n){var r=e("../lodash");t.exports=i;var o=r.constant(1);function i(e,t,n){return a(e,t||o,n||function(t){return e.outEdges(t)})}function a(e,t,n){var r={},o=e.nodes();return o.forEach((function(e){r[e]={},r[e][e]={distance:0},o.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var o=n.v===e?n.w:n.v,i=t(n);r[e][o]={distance:i,predecessor:e}}))})),o.forEach((function(e){var t=r[e];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[e],o=t[n],a=i[n],s=r.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)}))}))})),r}},{"../lodash":49}],38:[function(e,t,n){t.exports={components:e("./components"),dijkstra:e("./dijkstra"),dijkstraAll:e("./dijkstra-all"),findCycles:e("./find-cycles"),floydWarshall:e("./floyd-warshall"),isAcyclic:e("./is-acyclic"),postorder:e("./postorder"),preorder:e("./preorder"),prim:e("./prim"),tarjan:e("./tarjan"),topsort:e("./topsort")}},{"./components":32,"./dijkstra":35,"./dijkstra-all":34,"./find-cycles":36,"./floyd-warshall":37,"./is-acyclic":39,"./postorder":40,"./preorder":41,"./prim":42,"./tarjan":43,"./topsort":44}],39:[function(e,t,n){var r=e("./topsort");function o(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}t.exports=o},{"./topsort":44}],40:[function(e,t,n){var r=e("./dfs");function o(e,t){return r(e,t,"post")}t.exports=o},{"./dfs":33}],41:[function(e,t,n){var r=e("./dfs");function o(e,t){return r(e,t,"pre")}t.exports=o},{"./dfs":33}],42:[function(e,t,n){var r=e("../lodash"),o=e("../graph"),i=e("../data/priority-queue");function a(e,t){var n,a=new o,s={},u=new i;function c(e){var r=e.v===n?e.w:e.v,o=u.priority(r);if(void 0!==o){var i=t(e);i<o&&(s[r]=n,u.decrease(r,i))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);for(var f=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(f)throw new Error("Input graph is not connected: "+e);f=!0}e.nodeEdges(n).forEach(c)}return a}t.exports=a},{"../data/priority-queue":45,"../graph":46,"../lodash":49}],43:[function(e,t,n){var r=e("../lodash");function o(e){var t=0,n=[],o={},i=[];function a(s){var u=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(o,e)?o[e].onStack&&(u.lowlink=Math.min(u.lowlink,o[e].index)):(a(e),u.lowlink=Math.min(u.lowlink,o[e].lowlink))})),u.lowlink===u.index){var c,f=[];do{c=n.pop(),o[c].onStack=!1,f.push(c)}while(s!==c);i.push(f)}}return e.nodes().forEach((function(e){r.has(o,e)||a(e)})),i}t.exports=o},{"../lodash":49}],44:[function(e,t,n){var r=e("../lodash");function o(e){var t={},n={},o=[];function a(s){if(r.has(n,s))throw new i;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],o.push(s))}if(r.each(e.sinks(),a),r.size(t)!==e.nodeCount())throw new i;return o}function i(){}t.exports=o,o.CycleException=i,i.prototype=new Error},{"../lodash":49}],45:[function(e,t,n){var r=e("../lodash");function o(){this._arr=[],this._keyIndices={}}t.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,i=o.length;return n[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},o.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},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}},{"../lodash":49}],46:[function(e,t,n){var r=e("./lodash");t.exports=s;var o="\\0",i="\\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function u(e,t){e[t]?e[t]++:e[t]=1}function c(e,t){--e[t]||delete e[t]}function f(e,t,n,i){var s=""+t,u=""+n;if(!e&&s>u){var c=s;s=u,u=c}return s+a+u+a+(r.isUndefined(i)?o:i)}function d(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}function h(e,t){return f(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,(function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children[i][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};function i(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(o[e]=r,r):r in o?o[r]:i(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,i(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,(function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,o,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(o=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],i=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=f(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return i&&(this._edgeLabels[s]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=i?o:this._defaultEdgeLabelFn(e,t,n);var c=d(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[s]=c,u(this._preds[t],e),u(this._sucs[e],t),this._in[t][s]=c,this._out[e][s]=c,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?h(this._isDirected,arguments[0]):f(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?h(this._isDirected,arguments[0]):f(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?h(this._isDirected,arguments[0]):f(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.v===t})):o}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.w===t})):o}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},{"./lodash":49}],47:[function(e,t,n){t.exports={Graph:e("./graph"),version:e("./version")}},{"./graph":46,"./version":50}],48:[function(e,t,n){var r=e("./lodash"),o=e("./graph");function i(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:a(e),edges:s(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t}function a(e){return r.map(e.nodes(),(function(t){var n=e.node(t),o=e.parent(t),i={v:t};return r.isUndefined(n)||(i.value=n),r.isUndefined(o)||(i.parent=o),i}))}function s(e){return r.map(e.edges(),(function(t){var n=e.edge(t),o={v:t.v,w:t.w};return r.isUndefined(t.name)||(o.name=t.name),r.isUndefined(n)||(o.value=n),o}))}function u(e){var t=new o(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}t.exports={write:i,read:u}},{"./graph":46,"./lodash":49}],49:[function(e,t,n){var r;if("function"==typeof e)try{r={clone:e("lodash/clone"),constant:e("lodash/constant"),each:e("lodash/each"),filter:e("lodash/filter"),has:e("lodash/has"),isArray:e("lodash/isArray"),isEmpty:e("lodash/isEmpty"),isFunction:e("lodash/isFunction"),isUndefined:e("lodash/isUndefined"),keys:e("lodash/keys"),map:e("lodash/map"),reduce:e("lodash/reduce"),size:e("lodash/size"),transform:e("lodash/transform"),union:e("lodash/union"),values:e("lodash/values")}}catch(e){}r||(r=window._),t.exports=r},{"lodash/clone":226,"lodash/constant":228,"lodash/each":230,"lodash/filter":232,"lodash/has":239,"lodash/isArray":243,"lodash/isEmpty":247,"lodash/isFunction":248,"lodash/isUndefined":258,"lodash/keys":259,"lodash/map":262,"lodash/reduce":274,"lodash/size":275,"lodash/transform":284,"lodash/union":285,"lodash/values":287}],50:[function(e,t,n){t.exports="2.1.8"},{}],51:[function(e,t,n){var r=e("./_getNative")(e("./_root"),"DataView");t.exports=r},{"./_getNative":163,"./_root":208}],52:[function(e,t,n){var r=e("./_hashClear"),o=e("./_hashDelete"),i=e("./_hashGet"),a=e("./_hashHas"),s=e("./_hashSet");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},{"./_hashClear":172,"./_hashDelete":173,"./_hashGet":174,"./_hashHas":175,"./_hashSet":176}],53:[function(e,t,n){var r=e("./_listCacheClear"),o=e("./_listCacheDelete"),i=e("./_listCacheGet"),a=e("./_listCacheHas"),s=e("./_listCacheSet");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},{"./_listCacheClear":188,"./_listCacheDelete":189,"./_listCacheGet":190,"./_listCacheHas":191,"./_listCacheSet":192}],54:[function(e,t,n){var r=e("./_getNative")(e("./_root"),"Map");t.exports=r},{"./_getNative":163,"./_root":208}],55:[function(e,t,n){var r=e("./_mapCacheClear"),o=e("./_mapCacheDelete"),i=e("./_mapCacheGet"),a=e("./_mapCacheHas"),s=e("./_mapCacheSet");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},{"./_mapCacheClear":193,"./_mapCacheDelete":194,"./_mapCacheGet":195,"./_mapCacheHas":196,"./_mapCacheSet":197}],56:[function(e,t,n){var r=e("./_getNative")(e("./_root"),"Promise");t.exports=r},{"./_getNative":163,"./_root":208}],57:[function(e,t,n){var r=e("./_getNative")(e("./_root"),"Set");t.exports=r},{"./_getNative":163,"./_root":208}],58:[function(e,t,n){var r=e("./_MapCache"),o=e("./_setCacheAdd"),i=e("./_setCacheHas");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},{"./_MapCache":55,"./_setCacheAdd":210,"./_setCacheHas":211}],59:[function(e,t,n){var r=e("./_ListCache"),o=e("./_stackClear"),i=e("./_stackDelete"),a=e("./_stackGet"),s=e("./_stackHas"),u=e("./_stackSet");function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},{"./_ListCache":53,"./_stackClear":215,"./_stackDelete":216,"./_stackGet":217,"./_stackHas":218,"./_stackSet":219}],60:[function(e,t,n){var r=e("./_root").Symbol;t.exports=r},{"./_root":208}],61:[function(e,t,n){var r=e("./_root").Uint8Array;t.exports=r},{"./_root":208}],62:[function(e,t,n){var r=e("./_getNative")(e("./_root"),"WeakMap");t.exports=r},{"./_getNative":163,"./_root":208}],63:[function(e,t,n){function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=r},{}],64:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}t.exports=r},{}],65:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}t.exports=r},{}],66:[function(e,t,n){var r=e("./_baseIndexOf");function o(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}t.exports=o},{"./_baseIndexOf":95}],67:[function(e,t,n){function r(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}t.exports=r},{}],68:[function(e,t,n){var r=e("./_baseTimes"),o=e("./isArguments"),i=e("./isArray"),a=e("./isBuffer"),s=e("./_isIndex"),u=e("./isTypedArray"),c=Object.prototype.hasOwnProperty;function f(e,t){var n=i(e),f=!n&&o(e),d=!n&&!f&&a(e),h=!n&&!f&&!d&&u(e),l=n||f||d||h,p=l?r(e.length,String):[],v=p.length;for(var _ in e)!t&&!c.call(e,_)||l&&("length"==_||d&&("offset"==_||"parent"==_)||h&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||s(_,v))||p.push(_);return p}t.exports=f},{"./_baseTimes":125,"./_isIndex":181,"./isArguments":242,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],69:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}t.exports=r},{}],70:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}t.exports=r},{}],71:[function(e,t,n){function r(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}t.exports=r},{}],72:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],73:[function(e,t,n){var r=e("./_baseProperty")("length");t.exports=r},{"./_baseProperty":117}],74:[function(e,t,n){var r=e("./_baseAssignValue"),o=e("./eq");function i(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}t.exports=i},{"./_baseAssignValue":79,"./eq":231}],75:[function(e,t,n){var r=e("./_baseAssignValue"),o=e("./eq"),i=Object.prototype.hasOwnProperty;function a(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}t.exports=a},{"./_baseAssignValue":79,"./eq":231}],76:[function(e,t,n){var r=e("./eq");function o(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}t.exports=o},{"./eq":231}],77:[function(e,t,n){var r=e("./_copyObject"),o=e("./keys");function i(e,t){return e&&r(t,o(t),e)}t.exports=i},{"./_copyObject":143,"./keys":259}],78:[function(e,t,n){var r=e("./_copyObject"),o=e("./keysIn");function i(e,t){return e&&r(t,o(t),e)}t.exports=i},{"./_copyObject":143,"./keysIn":260}],79:[function(e,t,n){var r=e("./_defineProperty");function o(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}t.exports=o},{"./_defineProperty":153}],80:[function(e,t,n){var r=e("./_Stack"),o=e("./_arrayEach"),i=e("./_assignValue"),a=e("./_baseAssign"),s=e("./_baseAssignIn"),u=e("./_cloneBuffer"),c=e("./_copyArray"),f=e("./_copySymbols"),d=e("./_copySymbolsIn"),h=e("./_getAllKeys"),l=e("./_getAllKeysIn"),p=e("./_getTag"),v=e("./_initCloneArray"),_=e("./_initCloneByTag"),y=e("./_initCloneObject"),g=e("./isArray"),b=e("./isBuffer"),m=e("./isMap"),x=e("./isObject"),w=e("./isSet"),E=e("./keys"),j=1,k=2,A=4,O="[object Arguments]",I="[object Array]",S="[object Boolean]",C="[object Date]",N="[object Error]",T="[object Function]",M="[object GeneratorFunction]",L="[object Map]",P="[object Number]",F="[object Object]",D="[object RegExp]",B="[object Set]",G="[object String]",R="[object Symbol]",U="[object WeakMap]",z="[object ArrayBuffer]",V="[object DataView]",q="[object Float32Array]",K="[object Float64Array]",H="[object Int8Array]",Y="[object Int16Array]",$="[object Int32Array]",W="[object Uint8Array]",J="[object Uint8ClampedArray]",X="[object Uint16Array]",Z="[object Uint32Array]",Q={};function ee(e,t,n,I,S,C){var N,L=t&j,P=t&k,D=t&A;if(n&&(N=S?n(e,I,S,C):n(e)),void 0!==N)return N;if(!x(e))return e;var B=g(e);if(B){if(N=v(e),!L)return c(e,N)}else{var G=p(e),R=G==T||G==M;if(b(e))return u(e,L);if(G==F||G==O||R&&!S){if(N=P||R?{}:y(e),!L)return P?d(e,s(N,e)):f(e,a(N,e))}else{if(!Q[G])return S?e:{};N=_(e,G,L)}}C||(C=new r);var U=C.get(e);if(U)return U;C.set(e,N),w(e)?e.forEach((function(r){N.add(ee(r,t,n,r,e,C))})):m(e)&&e.forEach((function(r,o){N.set(o,ee(r,t,n,o,e,C))}));var z=D?P?l:h:P?keysIn:E,V=B?void 0:z(e);return o(V||e,(function(r,o){V&&(r=e[o=r]),i(N,o,ee(r,t,n,o,e,C))})),N}Q[O]=Q[I]=Q[z]=Q[V]=Q[S]=Q[C]=Q[q]=Q[K]=Q[H]=Q[Y]=Q[$]=Q[L]=Q[P]=Q[F]=Q[D]=Q[B]=Q[G]=Q[R]=Q[W]=Q[J]=Q[X]=Q[Z]=!0,Q[N]=Q[T]=Q[U]=!1,t.exports=ee},{"./_Stack":59,"./_arrayEach":64,"./_assignValue":75,"./_baseAssign":77,"./_baseAssignIn":78,"./_cloneBuffer":135,"./_copyArray":142,"./_copySymbols":144,"./_copySymbolsIn":145,"./_getAllKeys":159,"./_getAllKeysIn":160,"./_getTag":168,"./_initCloneArray":177,"./_initCloneByTag":178,"./_initCloneObject":179,"./isArray":243,"./isBuffer":246,"./isMap":250,"./isObject":251,"./isSet":254,"./keys":259}],81:[function(e,t,n){var r=e("./isObject"),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();t.exports=i},{"./isObject":251}],82:[function(e,t,n){var r=e("./_baseForOwn"),o=e("./_createBaseEach")(r);t.exports=o},{"./_baseForOwn":88,"./_createBaseEach":148}],83:[function(e,t,n){var r=e("./isSymbol");function o(e,t,n){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}t.exports=o},{"./isSymbol":256}],84:[function(e,t,n){var r=e("./_baseEach");function o(e,t){var n=[];return r(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}t.exports=o},{"./_baseEach":82}],85:[function(e,t,n){function r(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],86:[function(e,t,n){var r=e("./_arrayPush"),o=e("./_isFlattenable");function i(e,t,n,a,s){var u=-1,c=e.length;for(n||(n=o),s||(s=[]);++u<c;){var f=e[u];t>0&&n(f)?t>1?i(f,t-1,n,a,s):r(s,f):a||(s[s.length]=f)}return s}t.exports=i},{"./_arrayPush":70,"./_isFlattenable":180}],87:[function(e,t,n){var r=e("./_createBaseFor")();t.exports=r},{"./_createBaseFor":149}],88:[function(e,t,n){var r=e("./_baseFor"),o=e("./keys");function i(e,t){return e&&r(e,t,o)}t.exports=i},{"./_baseFor":87,"./keys":259}],89:[function(e,t,n){var r=e("./_castPath"),o=e("./_toKey");function i(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}t.exports=i},{"./_castPath":133,"./_toKey":223}],90:[function(e,t,n){var r=e("./_arrayPush"),o=e("./isArray");function i(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}t.exports=i},{"./_arrayPush":70,"./isArray":243}],91:[function(e,t,n){var r=e("./_Symbol"),o=e("./_getRawTag"),i=e("./_objectToString"),a="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;function c(e){return null==e?void 0===e?s:a:u&&u in Object(e)?o(e):i(e)}t.exports=c},{"./_Symbol":60,"./_getRawTag":165,"./_objectToString":205}],92:[function(e,t,n){function r(e,t){return e>t}t.exports=r},{}],93:[function(e,t,n){var r=Object.prototype.hasOwnProperty;function o(e,t){return null!=e&&r.call(e,t)}t.exports=o},{}],94:[function(e,t,n){function r(e,t){return null!=e&&t in Object(e)}t.exports=r},{}],95:[function(e,t,n){var r=e("./_baseFindIndex"),o=e("./_baseIsNaN"),i=e("./_strictIndexOf");function a(e,t,n){return t==t?i(e,t,n):r(e,o,n)}t.exports=a},{"./_baseFindIndex":85,"./_baseIsNaN":101,"./_strictIndexOf":220}],96:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./isObjectLike"),i="[object Arguments]";function a(e){return o(e)&&r(e)==i}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],97:[function(e,t,n){var r=e("./_baseIsEqualDeep"),o=e("./isObjectLike");function i(e,t,n,a,s){return e===t||(null==e||null==t||!o(e)&&!o(t)?e!=e&&t!=t:r(e,t,n,a,i,s))}t.exports=i},{"./_baseIsEqualDeep":98,"./isObjectLike":252}],98:[function(e,t,n){var r=e("./_Stack"),o=e("./_equalArrays"),i=e("./_equalByTag"),a=e("./_equalObjects"),s=e("./_getTag"),u=e("./isArray"),c=e("./isBuffer"),f=e("./isTypedArray"),d=1,h="[object Arguments]",l="[object Array]",p="[object Object]",v=Object.prototype.hasOwnProperty;function _(e,t,n,_,y,g){var b=u(e),m=u(t),x=b?l:s(e),w=m?l:s(t),E=(x=x==h?p:x)==p,j=(w=w==h?p:w)==p,k=x==w;if(k&&c(e)){if(!c(t))return!1;b=!0,E=!1}if(k&&!E)return g||(g=new r),b||f(e)?o(e,t,n,_,y,g):i(e,t,x,n,_,y,g);if(!(n&d)){var A=E&&v.call(e,"__wrapped__"),O=j&&v.call(t,"__wrapped__");if(A||O){var I=A?e.value():e,S=O?t.value():t;return g||(g=new r),y(I,S,n,_,g)}}return!!k&&(g||(g=new r),a(e,t,n,_,y,g))}t.exports=_},{"./_Stack":59,"./_equalArrays":154,"./_equalByTag":155,"./_equalObjects":156,"./_getTag":168,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],99:[function(e,t,n){var r=e("./_getTag"),o=e("./isObjectLike"),i="[object Map]";function a(e){return o(e)&&r(e)==i}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],100:[function(e,t,n){var r=e("./_Stack"),o=e("./_baseIsEqual"),i=1,a=2;function s(e,t,n,s){var u=n.length,c=u,f=!s;if(null==e)return!c;for(e=Object(e);u--;){var d=n[u];if(f&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++u<c;){var h=(d=n[u])[0],l=e[h],p=d[1];if(f&&d[2]){if(void 0===l&&!(h in e))return!1}else{var v=new r;if(s)var _=s(l,p,h,e,t,v);if(!(void 0===_?o(p,l,i|a,s,v):_))return!1}}return!0}t.exports=s},{"./_Stack":59,"./_baseIsEqual":97}],101:[function(e,t,n){function r(e){return e!=e}t.exports=r},{}],102:[function(e,t,n){var r=e("./isFunction"),o=e("./_isMasked"),i=e("./isObject"),a=e("./_toSource"),s=/[\\\\^$.*+?()[\\]{}|]/g,u=/^\\[object .+?Constructor\\]$/,c=Function.prototype,f=Object.prototype,d=c.toString,h=f.hasOwnProperty,l=RegExp("^"+d.call(h).replace(s,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");function p(e){return!(!i(e)||o(e))&&(r(e)?l:u).test(a(e))}t.exports=p},{"./_isMasked":185,"./_toSource":224,"./isFunction":248,"./isObject":251}],103:[function(e,t,n){var r=e("./_getTag"),o=e("./isObjectLike"),i="[object Set]";function a(e){return o(e)&&r(e)==i}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],104:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./isLength"),i=e("./isObjectLike"),a="[object Arguments]",s="[object Array]",u="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Function]",h="[object Map]",l="[object Number]",p="[object Object]",v="[object RegExp]",_="[object Set]",y="[object String]",g="[object WeakMap]",b="[object ArrayBuffer]",m="[object DataView]",x="[object Float64Array]",w="[object Int8Array]",E="[object Int16Array]",j="[object Int32Array]",k="[object Uint8Array]",A="[object Uint8ClampedArray]",O="[object Uint16Array]",I="[object Uint32Array]",S={};function C(e){return i(e)&&o(e.length)&&!!S[r(e)]}S["[object Float32Array]"]=S[x]=S[w]=S[E]=S[j]=S[k]=S[A]=S[O]=S[I]=!0,S[a]=S[s]=S[b]=S[u]=S[m]=S[c]=S[f]=S[d]=S[h]=S[l]=S[p]=S[v]=S[_]=S[y]=S[g]=!1,t.exports=C},{"./_baseGetTag":91,"./isLength":249,"./isObjectLike":252}],105:[function(e,t,n){var r=e("./_baseMatches"),o=e("./_baseMatchesProperty"),i=e("./identity"),a=e("./isArray"),s=e("./property");function u(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}t.exports=u},{"./_baseMatches":110,"./_baseMatchesProperty":111,"./identity":241,"./isArray":243,"./property":272}],106:[function(e,t,n){var r=e("./_isPrototype"),o=e("./_nativeKeys"),i=Object.prototype.hasOwnProperty;function a(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}t.exports=a},{"./_isPrototype":186,"./_nativeKeys":202}],107:[function(e,t,n){var r=e("./isObject"),o=e("./_isPrototype"),i=e("./_nativeKeysIn"),a=Object.prototype.hasOwnProperty;function s(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}t.exports=s},{"./_isPrototype":186,"./_nativeKeysIn":203,"./isObject":251}],108:[function(e,t,n){function r(e,t){return e<t}t.exports=r},{}],109:[function(e,t,n){var r=e("./_baseEach"),o=e("./isArrayLike");function i(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}t.exports=i},{"./_baseEach":82,"./isArrayLike":244}],110:[function(e,t,n){var r=e("./_baseIsMatch"),o=e("./_getMatchData"),i=e("./_matchesStrictComparable");function a(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}t.exports=a},{"./_baseIsMatch":100,"./_getMatchData":162,"./_matchesStrictComparable":199}],111:[function(e,t,n){var r=e("./_baseIsEqual"),o=e("./get"),i=e("./hasIn"),a=e("./_isKey"),s=e("./_isStrictComparable"),u=e("./_matchesStrictComparable"),c=e("./_toKey"),f=1,d=2;function h(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,f|d)}}t.exports=h},{"./_baseIsEqual":97,"./_isKey":183,"./_isStrictComparable":187,"./_matchesStrictComparable":199,"./_toKey":223,"./get":238,"./hasIn":240}],112:[function(e,t,n){var r=e("./_Stack"),o=e("./_assignMergeValue"),i=e("./_baseFor"),a=e("./_baseMergeDeep"),s=e("./isObject"),u=e("./keysIn"),c=e("./_safeGet");function f(e,t,n,d,h){e!==t&&i(t,(function(i,u){if(h||(h=new r),s(i))a(e,t,u,n,f,d,h);else{var l=d?d(c(e,u),i,u+"",e,t,h):void 0;void 0===l&&(l=i),o(e,u,l)}}),u)}t.exports=f},{"./_Stack":59,"./_assignMergeValue":74,"./_baseFor":87,"./_baseMergeDeep":113,"./_safeGet":209,"./isObject":251,"./keysIn":260}],113:[function(e,t,n){var r=e("./_assignMergeValue"),o=e("./_cloneBuffer"),i=e("./_cloneTypedArray"),a=e("./_copyArray"),s=e("./_initCloneObject"),u=e("./isArguments"),c=e("./isArray"),f=e("./isArrayLikeObject"),d=e("./isBuffer"),h=e("./isFunction"),l=e("./isObject"),p=e("./isPlainObject"),v=e("./isTypedArray"),_=e("./_safeGet"),y=e("./toPlainObject");function g(e,t,n,g,b,m,x){var w=_(e,n),E=_(t,n),j=x.get(E);if(j)r(e,n,j);else{var k=m?m(w,E,n+"",e,t,x):void 0,A=void 0===k;if(A){var O=c(E),I=!O&&d(E),S=!O&&!I&&v(E);k=E,O||I||S?c(w)?k=w:f(w)?k=a(w):I?(A=!1,k=o(E,!0)):S?(A=!1,k=i(E,!0)):k=[]:p(E)||u(E)?(k=w,u(w)?k=y(w):l(w)&&!h(w)||(k=s(E))):A=!1}A&&(x.set(E,k),b(k,E,g,m,x),x.delete(E)),r(e,n,k)}}t.exports=g},{"./_assignMergeValue":74,"./_cloneBuffer":135,"./_cloneTypedArray":139,"./_copyArray":142,"./_initCloneObject":179,"./_safeGet":209,"./isArguments":242,"./isArray":243,"./isArrayLikeObject":245,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isPlainObject":253,"./isTypedArray":257,"./toPlainObject":282}],114:[function(e,t,n){var r=e("./_arrayMap"),o=e("./_baseIteratee"),i=e("./_baseMap"),a=e("./_baseSortBy"),s=e("./_baseUnary"),u=e("./_compareMultiple"),c=e("./identity");function f(e,t,n){var f=-1;t=r(t.length?t:[c],s(o));var d=i(e,(function(e,n,o){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return a(d,(function(e,t){return u(e,t,n)}))}t.exports=f},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./_baseSortBy":124,"./_baseUnary":127,"./_compareMultiple":141,"./identity":241}],115:[function(e,t,n){var r=e("./_basePickBy"),o=e("./hasIn");function i(e,t){return r(e,t,(function(t,n){return o(e,n)}))}t.exports=i},{"./_basePickBy":116,"./hasIn":240}],116:[function(e,t,n){var r=e("./_baseGet"),o=e("./_baseSet"),i=e("./_castPath");function a(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],f=r(e,c);n(f,c)&&o(u,i(c,e),f)}return u}t.exports=a},{"./_baseGet":89,"./_baseSet":122,"./_castPath":133}],117:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}t.exports=r},{}],118:[function(e,t,n){var r=e("./_baseGet");function o(e){return function(t){return r(t,e)}}t.exports=o},{"./_baseGet":89}],119:[function(e,t,n){var r=Math.ceil,o=Math.max;function i(e,t,n,i){for(var a=-1,s=o(r((t-e)/(n||1)),0),u=Array(s);s--;)u[i?s:++a]=e,e+=n;return u}t.exports=i},{}],120:[function(e,t,n){function r(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}t.exports=r},{}],121:[function(e,t,n){var r=e("./identity"),o=e("./_overRest"),i=e("./_setToString");function a(e,t){return i(o(e,t,r),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./identity":241}],122:[function(e,t,n){var r=e("./_assignValue"),o=e("./_castPath"),i=e("./_isIndex"),a=e("./isObject"),s=e("./_toKey");function u(e,t,n,u){if(!a(e))return e;for(var c=-1,f=(t=o(t,e)).length,d=f-1,h=e;null!=h&&++c<f;){var l=s(t[c]),p=n;if(c!=d){var v=h[l];void 0===(p=u?u(v,l,h):void 0)&&(p=a(v)?v:i(t[c+1])?[]:{})}r(h,l,p),h=h[l]}return e}t.exports=u},{"./_assignValue":75,"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isObject":251}],123:[function(e,t,n){var r=e("./constant"),o=e("./_defineProperty"),i=e("./identity"),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;t.exports=a},{"./_defineProperty":153,"./constant":228,"./identity":241}],124:[function(e,t,n){function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=r},{}],125:[function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=r},{}],126:[function(e,t,n){var r=e("./_Symbol"),o=e("./_arrayMap"),i=e("./isArray"),a=e("./isSymbol"),s=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;function f(e){if("string"==typeof e)return e;if(i(e))return o(e,f)+"";if(a(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}t.exports=f},{"./_Symbol":60,"./_arrayMap":69,"./isArray":243,"./isSymbol":256}],127:[function(e,t,n){function r(e){return function(t){return e(t)}}t.exports=r},{}],128:[function(e,t,n){var r=e("./_SetCache"),o=e("./_arrayIncludes"),i=e("./_arrayIncludesWith"),a=e("./_cacheHas"),s=e("./_createSet"),u=e("./_setToArray"),c=200;function f(e,t,n){var f=-1,d=o,h=e.length,l=!0,p=[],v=p;if(n)l=!1,d=i;else if(h>=c){var _=t?null:s(e);if(_)return u(_);l=!1,d=a,v=new r}else v=t?[]:p;e:for(;++f<h;){var y=e[f],g=t?t(y):y;if(y=n||0!==y?y:0,l&&g==g){for(var b=v.length;b--;)if(v[b]===g)continue e;t&&v.push(g),p.push(y)}else d(v,g,n)||(v!==p&&v.push(g),p.push(y))}return p}t.exports=f},{"./_SetCache":58,"./_arrayIncludes":66,"./_arrayIncludesWith":67,"./_cacheHas":131,"./_createSet":152,"./_setToArray":212}],129:[function(e,t,n){var r=e("./_arrayMap");function o(e,t){return r(t,(function(t){return e[t]}))}t.exports=o},{"./_arrayMap":69}],130:[function(e,t,n){function r(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var s=r<i?t[r]:void 0;n(a,e[r],s)}return a}t.exports=r},{}],131:[function(e,t,n){function r(e,t){return e.has(t)}t.exports=r},{}],132:[function(e,t,n){var r=e("./identity");function o(e){return"function"==typeof e?e:r}t.exports=o},{"./identity":241}],133:[function(e,t,n){var r=e("./isArray"),o=e("./_isKey"),i=e("./_stringToPath"),a=e("./toString");function s(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}t.exports=s},{"./_isKey":183,"./_stringToPath":222,"./isArray":243,"./toString":283}],134:[function(e,t,n){var r=e("./_Uint8Array");function o(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}t.exports=o},{"./_Uint8Array":61}],135:[function(e,t,n){var r=e("./_root"),o="object"==typeof n&&n&&!n.nodeType&&n,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}t.exports=u},{"./_root":208}],136:[function(e,t,n){var r=e("./_cloneArrayBuffer");function o(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}t.exports=o},{"./_cloneArrayBuffer":134}],137:[function(e,t,n){var r=/\\w*$/;function o(e){var t=new e.constructor(e.source,r.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=o},{}],138:[function(e,t,n){var r=e("./_Symbol"),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a},{"./_Symbol":60}],139:[function(e,t,n){var r=e("./_cloneArrayBuffer");function o(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}t.exports=o},{"./_cloneArrayBuffer":134}],140:[function(e,t,n){var r=e("./isSymbol");function o(e,t){if(e!==t){var n=void 0!==e,o=null===e,i=e==e,a=r(e),s=void 0!==t,u=null===t,c=t==t,f=r(t);if(!u&&!f&&!a&&e>t||a&&s&&c&&!u&&!f||o&&s&&c||!n&&c||!i)return 1;if(!o&&!a&&!f&&e<t||f&&n&&i&&!o&&!a||u&&n&&i||!s&&i||!c)return-1}return 0}t.exports=o},{"./isSymbol":256}],141:[function(e,t,n){var r=e("./_compareAscending");function o(e,t,n){for(var o=-1,i=e.criteria,a=t.criteria,s=i.length,u=n.length;++o<s;){var c=r(i[o],a[o]);if(c)return o>=u?c:c*("desc"==n[o]?-1:1)}return e.index-t.index}t.exports=o},{"./_compareAscending":140}],142:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],143:[function(e,t,n){var r=e("./_assignValue"),o=e("./_baseAssignValue");function i(e,t,n,i){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],f=i?i(n[c],e[c],c,n,e):void 0;void 0===f&&(f=e[c]),a?o(n,c,f):r(n,c,f)}return n}t.exports=i},{"./_assignValue":75,"./_baseAssignValue":79}],144:[function(e,t,n){var r=e("./_copyObject"),o=e("./_getSymbols");function i(e,t){return r(e,o(e),t)}t.exports=i},{"./_copyObject":143,"./_getSymbols":166}],145:[function(e,t,n){var r=e("./_copyObject"),o=e("./_getSymbolsIn");function i(e,t){return r(e,o(e),t)}t.exports=i},{"./_copyObject":143,"./_getSymbolsIn":167}],146:[function(e,t,n){var r=e("./_root")["__core-js_shared__"];t.exports=r},{"./_root":208}],147:[function(e,t,n){var r=e("./_baseRest"),o=e("./_isIterateeCall");function i(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t}))}t.exports=i},{"./_baseRest":121,"./_isIterateeCall":182}],148:[function(e,t,n){var r=e("./isArrayLike");function o(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}t.exports=o},{"./isArrayLike":244}],149:[function(e,t,n){function r(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===n(i[u],u,i))break}return t}}t.exports=r},{}],150:[function(e,t,n){var r=e("./_baseIteratee"),o=e("./isArrayLike"),i=e("./keys");function a(e){return function(t,n,a){var s=Object(t);if(!o(t)){var u=r(n,3);t=i(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[u?t[c]:c]:void 0}}t.exports=a},{"./_baseIteratee":105,"./isArrayLike":244,"./keys":259}],151:[function(e,t,n){var r=e("./_baseRange"),o=e("./_isIterateeCall"),i=e("./toFinite");function a(e){return function(t,n,a){return a&&"number"!=typeof a&&o(t,n,a)&&(n=a=void 0),t=i(t),void 0===n?(n=t,t=0):n=i(n),a=void 0===a?t<n?1:-1:i(a),r(t,n,a,e)}}t.exports=a},{"./_baseRange":119,"./_isIterateeCall":182,"./toFinite":279}],152:[function(e,t,n){var r=e("./_Set"),o=e("./noop"),i=e("./_setToArray"),a=1/0,s=r&&1/i(new r([,-0]))[1]==a?function(e){return new r(e)}:o;t.exports=s},{"./_Set":57,"./_setToArray":212,"./noop":269}],153:[function(e,t,n){var r=e("./_getNative"),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=o},{"./_getNative":163}],154:[function(e,t,n){var r=e("./_SetCache"),o=e("./_arraySome"),i=e("./_cacheHas"),a=1,s=2;function u(e,t,n,u,c,f){var d=n&a,h=e.length,l=t.length;if(h!=l&&!(d&&l>h))return!1;var p=f.get(e);if(p&&f.get(t))return p==t;var v=-1,_=!0,y=n&s?new r:void 0;for(f.set(e,t),f.set(t,e);++v<h;){var g=e[v],b=t[v];if(u)var m=d?u(b,g,v,t,e,f):u(g,b,v,e,t,f);if(void 0!==m){if(m)continue;_=!1;break}if(y){if(!o(t,(function(e,t){if(!i(y,t)&&(g===e||c(g,e,n,u,f)))return y.push(t)}))){_=!1;break}}else if(g!==b&&!c(g,b,n,u,f)){_=!1;break}}return f.delete(e),f.delete(t),_}t.exports=u},{"./_SetCache":58,"./_arraySome":72,"./_cacheHas":131}],155:[function(e,t,n){var r=e("./_Symbol"),o=e("./_Uint8Array"),i=e("./eq"),a=e("./_equalArrays"),s=e("./_mapToArray"),u=e("./_setToArray"),c=1,f=2,d="[object Boolean]",h="[object Date]",l="[object Error]",p="[object Map]",v="[object Number]",_="[object RegExp]",y="[object Set]",g="[object String]",b="[object Symbol]",m="[object ArrayBuffer]",x="[object DataView]",w=r?r.prototype:void 0,E=w?w.valueOf:void 0;function j(e,t,n,r,w,j,k){switch(n){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case m:return!(e.byteLength!=t.byteLength||!j(new o(e),new o(t)));case d:case h:case v:return i(+e,+t);case l:return e.name==t.name&&e.message==t.message;case _:case g:return e==t+"";case p:var A=s;case y:var O=r&c;if(A||(A=u),e.size!=t.size&&!O)return!1;var I=k.get(e);if(I)return I==t;r|=f,k.set(e,t);var S=a(A(e),A(t),r,w,j,k);return k.delete(e),S;case b:if(E)return E.call(e)==E.call(t)}return!1}t.exports=j},{"./_Symbol":60,"./_Uint8Array":61,"./_equalArrays":154,"./_mapToArray":198,"./_setToArray":212,"./eq":231}],156:[function(e,t,n){var r=e("./_getAllKeys"),o=1,i=Object.prototype.hasOwnProperty;function a(e,t,n,a,s,u){var c=n&o,f=r(e),d=f.length;if(d!=r(t).length&&!c)return!1;for(var h=d;h--;){var l=f[h];if(!(c?l in t:i.call(t,l)))return!1}var p=u.get(e);if(p&&u.get(t))return p==t;var v=!0;u.set(e,t),u.set(t,e);for(var _=c;++h<d;){var y=e[l=f[h]],g=t[l];if(a)var b=c?a(g,y,l,t,e,u):a(y,g,l,e,t,u);if(!(void 0===b?y===g||s(y,g,n,a,u):b)){v=!1;break}_||(_="constructor"==l)}if(v&&!_){var m=e.constructor,x=t.constructor;m==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof x&&x instanceof x||(v=!1)}return u.delete(e),u.delete(t),v}t.exports=a},{"./_getAllKeys":159}],157:[function(e,t,n){var r=e("./flatten"),o=e("./_overRest"),i=e("./_setToString");function a(e){return i(o(e,void 0,r),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./flatten":235}],158:[function(t,n,r){(function(e){var t="object"==typeof e&&e&&e.Object===Object&&e;n.exports=t}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],159:[function(e,t,n){var r=e("./_baseGetAllKeys"),o=e("./_getSymbols"),i=e("./keys");function a(e){return r(e,i,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbols":166,"./keys":259}],160:[function(e,t,n){var r=e("./_baseGetAllKeys"),o=e("./_getSymbolsIn"),i=e("./keysIn");function a(e){return r(e,i,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbolsIn":167,"./keysIn":260}],161:[function(e,t,n){var r=e("./_isKeyable");function o(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}t.exports=o},{"./_isKeyable":184}],162:[function(e,t,n){var r=e("./_isStrictComparable"),o=e("./keys");function i(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}t.exports=i},{"./_isStrictComparable":187,"./keys":259}],163:[function(e,t,n){var r=e("./_baseIsNative"),o=e("./_getValue");function i(e,t){var n=o(e,t);return r(n)?n:void 0}t.exports=i},{"./_baseIsNative":102,"./_getValue":169}],164:[function(e,t,n){var r=e("./_overArg")(Object.getPrototypeOf,Object);t.exports=r},{"./_overArg":206}],165:[function(e,t,n){var r=e("./_Symbol"),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;function u(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}t.exports=u},{"./_Symbol":60}],166:[function(e,t,n){var r=e("./_arrayFilter"),o=e("./stubArray"),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;t.exports=s},{"./_arrayFilter":65,"./stubArray":277}],167:[function(e,t,n){var r=e("./_arrayPush"),o=e("./_getPrototype"),i=e("./_getSymbols"),a=e("./stubArray"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;t.exports=s},{"./_arrayPush":70,"./_getPrototype":164,"./_getSymbols":166,"./stubArray":277}],168:[function(e,t,n){var r=e("./_DataView"),o=e("./_Map"),i=e("./_Promise"),a=e("./_Set"),s=e("./_WeakMap"),u=e("./_baseGetTag"),c=e("./_toSource"),f="[object Map]",d="[object Object]",h="[object Promise]",l="[object Set]",p="[object WeakMap]",v="[object DataView]",_=c(r),y=c(o),g=c(i),b=c(a),m=c(s),x=u;(r&&x(new r(new ArrayBuffer(1)))!=v||o&&x(new o)!=f||i&&x(i.resolve())!=h||a&&x(new a)!=l||s&&x(new s)!=p)&&(x=function(e){var t=u(e),n=t==d?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case _:return v;case y:return f;case g:return h;case b:return l;case m:return p}return t}),t.exports=x},{"./_DataView":51,"./_Map":54,"./_Promise":56,"./_Set":57,"./_WeakMap":62,"./_baseGetTag":91,"./_toSource":224}],169:[function(e,t,n){function r(e,t){return null==e?void 0:e[t]}t.exports=r},{}],170:[function(e,t,n){var r=e("./_castPath"),o=e("./isArguments"),i=e("./isArray"),a=e("./_isIndex"),s=e("./isLength"),u=e("./_toKey");function c(e,t,n){for(var c=-1,f=(t=r(t,e)).length,d=!1;++c<f;){var h=u(t[c]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++c!=f?d:!!(f=null==e?0:e.length)&&s(f)&&a(h,f)&&(i(e)||o(e))}t.exports=c},{"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isArguments":242,"./isArray":243,"./isLength":249}],171:[function(e,t,n){var r=RegExp("[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]");function o(e){return r.test(e)}t.exports=o},{}],172:[function(e,t,n){var r=e("./_nativeCreate");function o(){this.__data__=r?r(null):{},this.size=0}t.exports=o},{"./_nativeCreate":201}],173:[function(e,t,n){function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=r},{}],174:[function(e,t,n){var r=e("./_nativeCreate"),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}t.exports=a},{"./_nativeCreate":201}],175:[function(e,t,n){var r=e("./_nativeCreate"),o=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}t.exports=i},{"./_nativeCreate":201}],176:[function(e,t,n){var r=e("./_nativeCreate"),o="__lodash_hash_undefined__";function i(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}t.exports=i},{"./_nativeCreate":201}],177:[function(e,t,n){var r=Object.prototype.hasOwnProperty;function o(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&r.call(e,"index")&&(n.index=e.index,n.input=e.input),n}t.exports=o},{}],178:[function(e,t,n){var r=e("./_cloneArrayBuffer"),o=e("./_cloneDataView"),i=e("./_cloneRegExp"),a=e("./_cloneSymbol"),s=e("./_cloneTypedArray"),u="[object Boolean]",c="[object Date]",f="[object Map]",d="[object Number]",h="[object RegExp]",l="[object Set]",p="[object String]",v="[object Symbol]",_="[object ArrayBuffer]",y="[object DataView]",g="[object Float32Array]",b="[object Float64Array]",m="[object Int8Array]",x="[object Int16Array]",w="[object Int32Array]",E="[object Uint8Array]",j="[object Uint8ClampedArray]",k="[object Uint16Array]",A="[object Uint32Array]";function O(e,t,n){var O=e.constructor;switch(t){case _:return r(e);case u:case c:return new O(+e);case y:return o(e,n);case g:case b:case m:case x:case w:case E:case j:case k:case A:return s(e,n);case f:return new O;case d:case p:return new O(e);case h:return i(e);case l:return new O;case v:return a(e)}}t.exports=O},{"./_cloneArrayBuffer":134,"./_cloneDataView":136,"./_cloneRegExp":137,"./_cloneSymbol":138,"./_cloneTypedArray":139}],179:[function(e,t,n){var r=e("./_baseCreate"),o=e("./_getPrototype"),i=e("./_isPrototype");function a(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}t.exports=a},{"./_baseCreate":81,"./_getPrototype":164,"./_isPrototype":186}],180:[function(e,t,n){var r=e("./_Symbol"),o=e("./isArguments"),i=e("./isArray"),a=r?r.isConcatSpreadable:void 0;function s(e){return i(e)||o(e)||!!(a&&e&&e[a])}t.exports=s},{"./_Symbol":60,"./isArguments":242,"./isArray":243}],181:[function(e,t,n){var r=9007199254740991,o=/^(?:0|[1-9]\\d*)$/;function i(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i},{}],182:[function(e,t,n){var r=e("./eq"),o=e("./isArrayLike"),i=e("./_isIndex"),a=e("./isObject");function s(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&i(t,n.length):"string"==s&&t in n)&&r(n[t],e)}t.exports=s},{"./_isIndex":181,"./eq":231,"./isArrayLike":244,"./isObject":251}],183:[function(e,t,n){var r=e("./isArray"),o=e("./isSymbol"),i=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,a=/^\\w*$/;function s(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}t.exports=s},{"./isArray":243,"./isSymbol":256}],184:[function(e,t,n){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.exports=r},{}],185:[function(e,t,n){var r,o=e("./_coreJsData"),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";function a(e){return!!i&&i in e}t.exports=a},{"./_coreJsData":146}],186:[function(e,t,n){var r=Object.prototype;function o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}t.exports=o},{}],187:[function(e,t,n){var r=e("./isObject");function o(e){return e==e&&!r(e)}t.exports=o},{"./isObject":251}],188:[function(e,t,n){function r(){this.__data__=[],this.size=0}t.exports=r},{}],189:[function(e,t,n){var r=e("./_assocIndexOf"),o=Array.prototype.splice;function i(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}t.exports=i},{"./_assocIndexOf":76}],190:[function(e,t,n){var r=e("./_assocIndexOf");function o(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}t.exports=o},{"./_assocIndexOf":76}],191:[function(e,t,n){var r=e("./_assocIndexOf");function o(e){return r(this.__data__,e)>-1}t.exports=o},{"./_assocIndexOf":76}],192:[function(e,t,n){var r=e("./_assocIndexOf");function o(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}t.exports=o},{"./_assocIndexOf":76}],193:[function(e,t,n){var r=e("./_Hash"),o=e("./_ListCache"),i=e("./_Map");function a(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}t.exports=a},{"./_Hash":52,"./_ListCache":53,"./_Map":54}],194:[function(e,t,n){var r=e("./_getMapData");function o(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}t.exports=o},{"./_getMapData":161}],195:[function(e,t,n){var r=e("./_getMapData");function o(e){return r(this,e).get(e)}t.exports=o},{"./_getMapData":161}],196:[function(e,t,n){var r=e("./_getMapData");function o(e){return r(this,e).has(e)}t.exports=o},{"./_getMapData":161}],197:[function(e,t,n){var r=e("./_getMapData");function o(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}t.exports=o},{"./_getMapData":161}],198:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}t.exports=r},{}],199:[function(e,t,n){function r(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}t.exports=r},{}],200:[function(e,t,n){var r=e("./memoize"),o=500;function i(e){var t=r(e,(function(e){return n.size===o&&n.clear(),e})),n=t.cache;return t}t.exports=i},{"./memoize":265}],201:[function(e,t,n){var r=e("./_getNative")(Object,"create");t.exports=r},{"./_getNative":163}],202:[function(e,t,n){var r=e("./_overArg")(Object.keys,Object);t.exports=r},{"./_overArg":206}],203:[function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=r},{}],204:[function(e,t,n){var r=e("./_freeGlobal"),o="object"==typeof n&&n&&!n.nodeType&&n,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":158}],205:[function(e,t,n){var r=Object.prototype.toString;function o(e){return r.call(e)}t.exports=o},{}],206:[function(e,t,n){function r(e,t){return function(n){return e(t(n))}}t.exports=r},{}],207:[function(e,t,n){var r=e("./_apply"),o=Math.max;function i(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=n(u),r(e,this,c)}}t.exports=i},{"./_apply":63}],208:[function(e,t,n){var r=e("./_freeGlobal"),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},{"./_freeGlobal":158}],209:[function(e,t,n){function r(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}t.exports=r},{}],210:[function(e,t,n){var r="__lodash_hash_undefined__";function o(e){return this.__data__.set(e,r),this}t.exports=o},{}],211:[function(e,t,n){function r(e){return this.__data__.has(e)}t.exports=r},{}],212:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}t.exports=r},{}],213:[function(e,t,n){var r=e("./_baseSetToString"),o=e("./_shortOut")(r);t.exports=o},{"./_baseSetToString":123,"./_shortOut":214}],214:[function(e,t,n){var r=800,o=16,i=Date.now;function a(e){var t=0,n=0;return function(){var a=i(),s=o-(a-n);if(n=a,s>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a},{}],215:[function(e,t,n){var r=e("./_ListCache");function o(){this.__data__=new r,this.size=0}t.exports=o},{"./_ListCache":53}],216:[function(e,t,n){function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=r},{}],217:[function(e,t,n){function r(e){return this.__data__.get(e)}t.exports=r},{}],218:[function(e,t,n){function r(e){return this.__data__.has(e)}t.exports=r},{}],219:[function(e,t,n){var r=e("./_ListCache"),o=e("./_Map"),i=e("./_MapCache"),a=200;function s(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}t.exports=s},{"./_ListCache":53,"./_Map":54,"./_MapCache":55}],220:[function(e,t,n){function r(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}t.exports=r},{}],221:[function(e,t,n){var r=e("./_asciiSize"),o=e("./_hasUnicode"),i=e("./_unicodeSize");function a(e){return o(e)?i(e):r(e)}t.exports=a},{"./_asciiSize":73,"./_hasUnicode":171,"./_unicodeSize":225}],222:[function(e,t,n){var r=e("./_memoizeCapped"),o=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,i=/\\\\(\\\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));t.exports=a},{"./_memoizeCapped":200}],223:[function(e,t,n){var r=e("./isSymbol"),o=1/0;function i(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}t.exports=i},{"./isSymbol":256}],224:[function(e,t,n){var r=Function.prototype.toString;function o(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}t.exports=o},{}],225:[function(e,t,n){var r="\\\\ud800-\\\\udfff",o="["+r+"]",i="[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]",a="\\\\ud83c[\\\\udffb-\\\\udfff]",s="[^"+r+"]",u="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",c="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",f="(?:"+i+"|"+a+")?",d="[\\\\ufe0e\\\\ufe0f]?",h=d+f+"(?:\\\\u200d(?:"+[s,u,c].join("|")+")"+d+f+")*",l="(?:"+[s+i+"?",i,u,c,o].join("|")+")",p=RegExp(a+"(?="+a+")|"+l+h,"g");function v(e){for(var t=p.lastIndex=0;p.test(e);)++t;return t}t.exports=v},{}],226:[function(e,t,n){var r=e("./_baseClone"),o=4;function i(e){return r(e,o)}t.exports=i},{"./_baseClone":80}],227:[function(e,t,n){var r=e("./_baseClone"),o=1,i=4;function a(e){return r(e,o|i)}t.exports=a},{"./_baseClone":80}],228:[function(e,t,n){function r(e){return function(){return e}}t.exports=r},{}],229:[function(e,t,n){var r=e("./_baseRest"),o=e("./eq"),i=e("./_isIterateeCall"),a=e("./keysIn"),s=Object.prototype,u=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&i(t[0],t[1],c)&&(r=1);++n<r;)for(var f=t[n],d=a(f),h=-1,l=d.length;++h<l;){var p=d[h],v=e[p];(void 0===v||o(v,s[p])&&!u.call(e,p))&&(e[p]=f[p])}return e}));t.exports=c},{"./_baseRest":121,"./_isIterateeCall":182,"./eq":231,"./keysIn":260}],230:[function(e,t,n){t.exports=e("./forEach")},{"./forEach":236}],231:[function(e,t,n){function r(e,t){return e===t||e!=e&&t!=t}t.exports=r},{}],232:[function(e,t,n){var r=e("./_arrayFilter"),o=e("./_baseFilter"),i=e("./_baseIteratee"),a=e("./isArray");function s(e,t){return(a(e)?r:o)(e,i(t,3))}t.exports=s},{"./_arrayFilter":65,"./_baseFilter":84,"./_baseIteratee":105,"./isArray":243}],233:[function(e,t,n){var r=e("./_createFind")(e("./findIndex"));t.exports=r},{"./_createFind":150,"./findIndex":234}],234:[function(e,t,n){var r=e("./_baseFindIndex"),o=e("./_baseIteratee"),i=e("./toInteger"),a=Math.max;function s(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:i(n);return u<0&&(u=a(s+u,0)),r(e,o(t,3),u)}t.exports=s},{"./_baseFindIndex":85,"./_baseIteratee":105,"./toInteger":280}],235:[function(e,t,n){var r=e("./_baseFlatten");function o(e){return null!=e&&e.length?r(e,1):[]}t.exports=o},{"./_baseFlatten":86}],236:[function(e,t,n){var r=e("./_arrayEach"),o=e("./_baseEach"),i=e("./_castFunction"),a=e("./isArray");function s(e,t){return(a(e)?r:o)(e,i(t))}t.exports=s},{"./_arrayEach":64,"./_baseEach":82,"./_castFunction":132,"./isArray":243}],237:[function(e,t,n){var r=e("./_baseFor"),o=e("./_castFunction"),i=e("./keysIn");function a(e,t){return null==e?e:r(e,o(t),i)}t.exports=a},{"./_baseFor":87,"./_castFunction":132,"./keysIn":260}],238:[function(e,t,n){var r=e("./_baseGet");function o(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}t.exports=o},{"./_baseGet":89}],239:[function(e,t,n){var r=e("./_baseHas"),o=e("./_hasPath");function i(e,t){return null!=e&&o(e,t,r)}t.exports=i},{"./_baseHas":93,"./_hasPath":170}],240:[function(e,t,n){var r=e("./_baseHasIn"),o=e("./_hasPath");function i(e,t){return null!=e&&o(e,t,r)}t.exports=i},{"./_baseHasIn":94,"./_hasPath":170}],241:[function(e,t,n){function r(e){return e}t.exports=r},{}],242:[function(e,t,n){var r=e("./_baseIsArguments"),o=e("./isObjectLike"),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};t.exports=u},{"./_baseIsArguments":96,"./isObjectLike":252}],243:[function(e,t,n){var r=Array.isArray;t.exports=r},{}],244:[function(e,t,n){var r=e("./isFunction"),o=e("./isLength");function i(e){return null!=e&&o(e.length)&&!r(e)}t.exports=i},{"./isFunction":248,"./isLength":249}],245:[function(e,t,n){var r=e("./isArrayLike"),o=e("./isObjectLike");function i(e){return o(e)&&r(e)}t.exports=i},{"./isArrayLike":244,"./isObjectLike":252}],246:[function(e,t,n){var r=e("./_root"),o=e("./stubFalse"),i="object"==typeof n&&n&&!n.nodeType&&n,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;t.exports=u},{"./_root":208,"./stubFalse":278}],247:[function(e,t,n){var r=e("./_baseKeys"),o=e("./_getTag"),i=e("./isArguments"),a=e("./isArray"),s=e("./isArrayLike"),u=e("./isBuffer"),c=e("./_isPrototype"),f=e("./isTypedArray"),d="[object Map]",h="[object Set]",l=Object.prototype.hasOwnProperty;function p(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||f(e)||i(e)))return!e.length;var t=o(e);if(t==d||t==h)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(l.call(e,n))return!1;return!0}t.exports=p},{"./_baseKeys":106,"./_getTag":168,"./_isPrototype":186,"./isArguments":242,"./isArray":243,"./isArrayLike":244,"./isBuffer":246,"./isTypedArray":257}],248:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./isObject"),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function c(e){if(!o(e))return!1;var t=r(e);return t==a||t==s||t==i||t==u}t.exports=c},{"./_baseGetTag":91,"./isObject":251}],249:[function(e,t,n){var r=9007199254740991;function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}t.exports=o},{}],250:[function(e,t,n){var r=e("./_baseIsMap"),o=e("./_baseUnary"),i=e("./_nodeUtil"),a=i&&i.isMap,s=a?o(a):r;t.exports=s},{"./_baseIsMap":99,"./_baseUnary":127,"./_nodeUtil":204}],251:[function(e,t,n){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=r},{}],252:[function(e,t,n){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],253:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./_getPrototype"),i=e("./isObjectLike"),a="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,f=u.hasOwnProperty,d=c.call(Object);function h(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}t.exports=h},{"./_baseGetTag":91,"./_getPrototype":164,"./isObjectLike":252}],254:[function(e,t,n){var r=e("./_baseIsSet"),o=e("./_baseUnary"),i=e("./_nodeUtil"),a=i&&i.isSet,s=a?o(a):r;t.exports=s},{"./_baseIsSet":103,"./_baseUnary":127,"./_nodeUtil":204}],255:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./isArray"),i=e("./isObjectLike"),a="[object String]";function s(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}t.exports=s},{"./_baseGetTag":91,"./isArray":243,"./isObjectLike":252}],256:[function(e,t,n){var r=e("./_baseGetTag"),o=e("./isObjectLike"),i="[object Symbol]";function a(e){return"symbol"==typeof e||o(e)&&r(e)==i}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],257:[function(e,t,n){var r=e("./_baseIsTypedArray"),o=e("./_baseUnary"),i=e("./_nodeUtil"),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},{"./_baseIsTypedArray":104,"./_baseUnary":127,"./_nodeUtil":204}],258:[function(e,t,n){function r(e){return void 0===e}t.exports=r},{}],259:[function(e,t,n){var r=e("./_arrayLikeKeys"),o=e("./_baseKeys"),i=e("./isArrayLike");function a(e){return i(e)?r(e):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeys":106,"./isArrayLike":244}],260:[function(e,t,n){var r=e("./_arrayLikeKeys"),o=e("./_baseKeysIn"),i=e("./isArrayLike");function a(e){return i(e)?r(e,!0):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeysIn":107,"./isArrayLike":244}],261:[function(e,t,n){function r(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}t.exports=r},{}],262:[function(e,t,n){var r=e("./_arrayMap"),o=e("./_baseIteratee"),i=e("./_baseMap"),a=e("./isArray");function s(e,t){return(a(e)?r:i)(e,o(t,3))}t.exports=s},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./isArray":243}],263:[function(e,t,n){var r=e("./_baseAssignValue"),o=e("./_baseForOwn"),i=e("./_baseIteratee");function a(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,o,t(e,o,i))})),n}t.exports=a},{"./_baseAssignValue":79,"./_baseForOwn":88,"./_baseIteratee":105}],264:[function(e,t,n){var r=e("./_baseExtremum"),o=e("./_baseGt"),i=e("./identity");function a(e){return e&&e.length?r(e,i,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseGt":92,"./identity":241}],265:[function(e,t,n){var r=e("./_MapCache"),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},{"./_MapCache":55}],266:[function(e,t,n){var r=e("./_baseMerge"),o=e("./_createAssigner")((function(e,t,n){r(e,t,n)}));t.exports=o},{"./_baseMerge":112,"./_createAssigner":147}],267:[function(e,t,n){var r=e("./_baseExtremum"),o=e("./_baseLt"),i=e("./identity");function a(e){return e&&e.length?r(e,i,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseLt":108,"./identity":241}],268:[function(e,t,n){var r=e("./_baseExtremum"),o=e("./_baseIteratee"),i=e("./_baseLt");function a(e,t){return e&&e.length?r(e,o(t,2),i):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseIteratee":105,"./_baseLt":108}],269:[function(e,t,n){function r(){}t.exports=r},{}],270:[function(e,t,n){var r=e("./_root"),o=function(){return r.Date.now()};t.exports=o},{"./_root":208}],271:[function(e,t,n){var r=e("./_basePick"),o=e("./_flatRest")((function(e,t){return null==e?{}:r(e,t)}));t.exports=o},{"./_basePick":115,"./_flatRest":157}],272:[function(e,t,n){var r=e("./_baseProperty"),o=e("./_basePropertyDeep"),i=e("./_isKey"),a=e("./_toKey");function s(e){return i(e)?r(a(e)):o(e)}t.exports=s},{"./_baseProperty":117,"./_basePropertyDeep":118,"./_isKey":183,"./_toKey":223}],273:[function(e,t,n){var r=e("./_createRange")();t.exports=r},{"./_createRange":151}],274:[function(e,t,n){var r=e("./_arrayReduce"),o=e("./_baseEach"),i=e("./_baseIteratee"),a=e("./_baseReduce"),s=e("./isArray");function u(e,t,n){var u=s(e)?r:a,c=arguments.length<3;return u(e,i(t,4),n,c,o)}t.exports=u},{"./_arrayReduce":71,"./_baseEach":82,"./_baseIteratee":105,"./_baseReduce":120,"./isArray":243}],275:[function(e,t,n){var r=e("./_baseKeys"),o=e("./_getTag"),i=e("./isArrayLike"),a=e("./isString"),s=e("./_stringSize"),u="[object Map]",c="[object Set]";function f(e){if(null==e)return 0;if(i(e))return a(e)?s(e):e.length;var t=o(e);return t==u||t==c?e.size:r(e).length}t.exports=f},{"./_baseKeys":106,"./_getTag":168,"./_stringSize":221,"./isArrayLike":244,"./isString":255}],276:[function(e,t,n){var r=e("./_baseFlatten"),o=e("./_baseOrderBy"),i=e("./_baseRest"),a=e("./_isIterateeCall"),s=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));t.exports=s},{"./_baseFlatten":86,"./_baseOrderBy":114,"./_baseRest":121,"./_isIterateeCall":182}],277:[function(e,t,n){function r(){return[]}t.exports=r},{}],278:[function(e,t,n){function r(){return!1}t.exports=r},{}],279:[function(e,t,n){var r=e("./toNumber"),o=1/0,i=17976931348623157e292;function a(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}t.exports=a},{"./toNumber":281}],280:[function(e,t,n){var r=e("./toFinite");function o(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}t.exports=o},{"./toFinite":279}],281:[function(e,t,n){var r=e("./isObject"),o=e("./isSymbol"),i=NaN,a=/^\\s+|\\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;function d(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||c.test(e)?f(e.slice(2),n?2:8):s.test(e)?i:+e}t.exports=d},{"./isObject":251,"./isSymbol":256}],282:[function(e,t,n){var r=e("./_copyObject"),o=e("./keysIn");function i(e){return r(e,o(e))}t.exports=i},{"./_copyObject":143,"./keysIn":260}],283:[function(e,t,n){var r=e("./_baseToString");function o(e){return null==e?"":r(e)}t.exports=o},{"./_baseToString":126}],284:[function(e,t,n){var r=e("./_arrayEach"),o=e("./_baseCreate"),i=e("./_baseForOwn"),a=e("./_baseIteratee"),s=e("./_getPrototype"),u=e("./isArray"),c=e("./isBuffer"),f=e("./isFunction"),d=e("./isObject"),h=e("./isTypedArray");function l(e,t,n){var l=u(e),p=l||c(e)||h(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?l?new v:[]:d(e)&&f(v)?o(s(e)):{}}return(p?r:i)(e,(function(e,r,o){return t(n,e,r,o)})),n}t.exports=l},{"./_arrayEach":64,"./_baseCreate":81,"./_baseForOwn":88,"./_baseIteratee":105,"./_getPrototype":164,"./isArray":243,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isTypedArray":257}],285:[function(e,t,n){var r=e("./_baseFlatten"),o=e("./_baseRest"),i=e("./_baseUniq"),a=e("./isArrayLikeObject"),s=o((function(e){return i(r(e,1,a,!0))}));t.exports=s},{"./_baseFlatten":86,"./_baseRest":121,"./_baseUniq":128,"./isArrayLikeObject":245}],286:[function(e,t,n){var r=e("./toString"),o=0;function i(e){var t=++o;return r(e)+t}t.exports=i},{"./toString":283}],287:[function(e,t,n){var r=e("./_baseValues"),o=e("./keys");function i(e){return null==e?[]:r(e,o(e))}t.exports=i},{"./_baseValues":129,"./keys":259}],288:[function(e,t,n){var r=e("./_assignValue"),o=e("./_baseZipObject");function i(e,t){return o(e||[],t||[],r)}t.exports=i},{"./_assignValue":75,"./_baseZipObject":130}]},{},[1])(1);var r={exports:{}};\n/*!\n\t * @overview es6-promise - a tiny implementation of Promises/A+.\n\t * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n\t * @license Licensed under MIT license\n\t * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n\t * @version v4.2.8+1e68dce6\n\t */function o(e,t){var r=e.subgraphs,o=e.nodes,i=e.links,a=e.hierarchy,s=new n.exports.graphlib.Graph({multigraph:!0,compound:!0,directed:!1!==t.digraph}).setGraph(t).setDefaultNodeLabel((function(){return{}})).setDefaultEdgeLabel((function(){return{}}));r.forEach((function(e){s.setNode(e.id,e)})),o.forEach((function(e){s.setNode(e.id,e)})),i.forEach((function(e){s.setEdge(e.source.id,e.target.id,e,e.id)})),a.forEach((function(e){s.setParent(e.child,e.parent)})),n.exports.layout(s,{debugTiming:!1});var u=-s.graph().width/2||0,c=-s.graph().height/2;return s.nodes().forEach((function(e){var t=s.node(e);t.x+=u,t.y+=c})),s.edges().forEach((function(e){var t=s.edge(e);t.points=t.points.map((function(e){return[e.x+u,e.y+c]}))})),{subgraphs:r,nodes:o,links:i}}!function(t,n){t.exports=function(){function t(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function n(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,i=void 0,a=void 0,s=function(e,t){m[o]=e,m[o+1]=t,2===(o+=2)&&(a?a(x):E())};function u(e){a=e}function c(e){s=e}var f="undefined"!=typeof window?window:void 0,d=f||{},h=d.MutationObserver||d.WebKitMutationObserver,l="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){return function(){return process.nextTick(x)}}function _(){return void 0!==i?function(){i(x)}:b()}function y(){var e=0,t=new h(x),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function g(){var e=new MessageChannel;return e.port1.onmessage=x,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(x,1)}}var m=new Array(1e3);function x(){for(var e=0;e<o;e+=2)(0,m[e])(m[e+1]),m[e]=void 0,m[e+1]=void 0;o=0}function w(){try{var e=Function("return this")().require("vertx");return i=e.runOnLoop||e.runOnContext,_()}catch(e){return b()}}var E=void 0;function j(e,t){var n=this,r=new this.constructor(O);void 0===r[A]&&Y(r);var o=n._state;if(o){var i=arguments[o-1];s((function(){return V(o,r,i,n._result)}))}else U(n,r,e,t);return r}function k(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(O);return D(n,e),n}E=l?v():h?y():p?g():void 0===f?w():b();var A=Math.random().toString(36).substring(2);function O(){}var I=void 0,S=1,C=2;function N(){return new TypeError("You cannot resolve a promise with itself")}function T(){return new TypeError("A promises callback cannot return that same promise.")}function M(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function L(e,t,n){s((function(e){var r=!1,o=M(n,t,(function(n){r||(r=!0,t!==n?D(e,n):G(e,n))}),(function(t){r||(r=!0,R(e,t))}),"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,R(e,o))}),e)}function P(e,t){t._state===S?G(e,t._result):t._state===C?R(e,t._result):U(t,void 0,(function(t){return D(e,t)}),(function(t){return R(e,t)}))}function F(e,t,r){t.constructor===e.constructor&&r===j&&t.constructor.resolve===k?P(e,t):void 0===r?G(e,t):n(r)?L(e,t,r):G(e,t)}function D(e,n){if(e===n)R(e,N());else if(t(n)){var r=void 0;try{r=n.then}catch(t){return void R(e,t)}F(e,n,r)}else G(e,n)}function B(e){e._onerror&&e._onerror(e._result),z(e)}function G(e,t){e._state===I&&(e._result=t,e._state=S,0!==e._subscribers.length&&s(z,e))}function R(e,t){e._state===I&&(e._state=C,e._result=t,s(B,e))}function U(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+S]=n,o[i+C]=r,0===i&&e._state&&s(z,e)}function z(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?V(n,r,o,i):o(i);e._subscribers.length=0}}function V(e,t,r,o){var i=n(r),a=void 0,s=void 0,u=!0;if(i){try{a=r(o)}catch(e){u=!1,s=e}if(t===a)return void R(t,T())}else a=o;t._state!==I||(i&&u?D(t,a):!1===u?R(t,s):e===S?G(t,a):e===C&&R(t,a))}function q(e,t){try{t((function(t){D(e,t)}),(function(t){R(e,t)}))}catch(t){R(e,t)}}var K=0;function H(){return K++}function Y(e){e[A]=K++,e._state=void 0,e._result=void 0,e._subscribers=[]}function $(){return new Error("Array Methods must be provided an Array")}var W=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(O),this.promise[A]||Y(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?G(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&G(this.promise,this._result))):R(this.promise,$())}return e.prototype._enumerate=function(e){for(var t=0;this._state===I&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===k){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(e){a=!0,i=e}if(o===j&&e._state!==I)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===te){var s=new n(O);a?R(s,i):F(s,e,o),this._willSettleAt(s,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===I&&(this._remaining--,e===C?R(r,n):this._result[t]=n),0===this._remaining&&G(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;U(e,void 0,(function(e){return n._settledAt(S,t,e)}),(function(e){return n._settledAt(C,t,e)}))},e}();function J(e){return new W(this,e).promise}function X(e){var t=this;return r(e)?new t((function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function Z(e){var t=new this(O);return R(t,e),t}function Q(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[A]=H(),this._result=this._state=void 0,this._subscribers=[],O!==t&&("function"!=typeof t&&Q(),this instanceof e?q(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this,r=t.constructor;return n(e)?t.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):t.then(e,e)},e}();function ne(){var t=void 0;if(void 0!==e)t=e;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=te}return te.prototype.then=j,te.all=J,te.race=X,te.resolve=k,te.reject=Z,te._setScheduler=u,te._setAsap=c,te._asap=s,te.polyfill=ne,te.Promise=te,te}()}(r),r.exports.polyfill(),self.onmessage=function(e){var t=o.apply(void 0,e.data);self.postMessage(t)}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise((function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])}))}}({subgraphs:n.allSubgraphs().map((function(e){return u(u({},e.props),{id:Wn(e.id)})})),nodes:n.allVertices().map((function(e){delete e.fx,delete e.fy;var t=e.element.node().getBBox();return u({width:t.width,height:t.height},e.props)})),links:n.allEdges().map((function(e){return e.props})),hierarchy:h(h([],n.allSubgraphs().filter((function(e){return!!n.subgraphParent(e.id)})).map((function(e){return{parent:Wn(n.subgraphParent(e.id).props.id),child:Wn(e.id)}})),!0),n.allVertices().filter((function(e){return void 0!==n.vertexParent(e.id)})).map((function(e){return{parent:Wn(n.vertexParent(e.id).props.id),child:e.id}})),!0)},this._options).response.then((function(e){return t.running()&&(e.subgraphs.forEach((function(e){var t=n.subgraph(e.id.substring(8));t.x=e.x+r.width/2,t.y=e.y+r.height/2,t.props.width=e.width,t.props.height=e.height})),e.nodes.forEach((function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2})),e.links.forEach((function(e){var t=n.edge(e.id),o=Xn(t.source.x,t.source.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2),i=Xn(t.target.x,t.target.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2);t.points=h(h([o<i?[t.source.x,t.source.y]:[t.target.x,t.target.y]],e.points.map((function(e){return[e[0]+r.width/2,e[1]+r.height/2]})),!0),[o<i?[t.target.x,t.target.y]:[t.source.x,t.source.y]],!1)})),t._graph.moveVertices(!0).moveSubgraphs(!0).moveEdges(!0),t.stop()),t}))},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map((function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]}))),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:qn(o),labelPos:this.center(o)}},t}(Gn),$n=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices(),o=r.allEdges();o.forEach((function(e){return delete e.points})),t._links=Hr(o).id((function(e){return e.id})).distance(t._options.linkDistance).strength(t._options.linkStrength),t._charge=fn().strength(t._options.repulsionStrength).distanceMin(t._options.distanceMin).distanceMax(t._options.distanceMax),t._center=Ir(e.width/2,e.height/2);var i=function(e){var t,r,n,o=Pr(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(n[i]-o.x)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Pr(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Pr(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Pr(+t),a(),i):e},i}().strength(t._options.forceStrength),a=function(e){var t,r,n,o=Pr(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(n[i]-o.y)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Pr(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Pr(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Pr(+t),a(),i):e},i}().strength(t._options.forceStrength);return t._simulation=dn(n.map((function(r){var n=r.element.node().getBBox(),o=n.width,i=n.height;return r.fx=t._options.pinCentroid&&r.centroid?e.width/2:void 0,r.fy=t._options.pinCentroid&&r.centroid?e.height/2:void 0,r.width=o,r.height=i,r}))).force("link",t._links).force("charge",t._charge).force("center",t._center).force("x",i).force("y",a).alpha(t._options.alpha/2).alphaMin(t._options.alphaMin).alphaDecay(t._options.alphaDecay).velocityDecay(t._options.velocityDecay).stop(),t}))},t.prototype.stop=function(){return this._simulation.stop(),e.prototype.stop.call(this)},t}(Gn),Jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){return t._simulation.tick(t._options.iterations),t.stop(),t._graph.moveVertices(!1).moveEdges(!1),t}))},t}($n),Qn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){return new Promise((function(e){t._simulation.on("tick",(function(){t._graph.moveVertices(!1).moveEdges(!1),t._graph.progress("layout-tick")})).on("end",(function(){t._running=!1,e(t)})).restart()}))}))},t}($n);function Zn(e,t){var r=new Blob(['!function(){"use strict";\n/*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}function e(r,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(t){if("default"!==t&&!(t in r)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}))})),Object.freeze(r)}var t,n,o,i={exports:{}};t=i,n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,o=function(r){var e,t,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(r,n){e=r,t=n}));var i,a,s=Object.assign({},o),u="./this.program",c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),n&&(c=n),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},a=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var l,d,f=o.print||console.log.bind(console),p=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit,o.wasmBinary&&(l=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&L("no native wasm support detected");var h=!1;function m(r,e){r||L(e)}var v,w,_,y,E,g,b="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function k(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&b)return b.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function D(r,e){return r?k(_,r,e):""}function S(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a)),s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function A(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function P(r){v=r,o.HEAP8=w=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=y=new Int32Array(r),o.HEAPU8=_=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=E=new Float64Array(r)}o.INITIAL_MEMORY;var x,F,M,R,C=[],j=[],z=[],T=0,B=null;function N(r){T++,o.monitorRunDependencies&&o.monitorRunDependencies(T)}function O(r){if(T--,o.monitorRunDependencies&&o.monitorRunDependencies(T),0==T&&B){var e=B;B=null,e()}}function L(r){o.onAbort&&o.onAbort(r),p(r="Aborted("+r+")"),h=!0,r+=". Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw t(e),e}function I(r){return r.startsWith("data:application/octet-stream;base64,")}function U(r){try{if(r==x&&l)return new Uint8Array(l);throw"both async and sync fetching of the wasm failed"}catch(r){L(r)}}o.preloadedImages={},o.preloadedAudios={},I(x="expatlib.wasm")||(F=x,x=o.locateFile?o.locateFile(F,c):c+F);var H={11678:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";e.startElement()},11896:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";e.endElement()},12108:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";e.characterData()}};function G(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?q(t)():q(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}function q(r){return g.get(r)}var W={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=W.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=W.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=W.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return W.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return W.normalize(r.join("/"))},join2:function(r,e){return W.normalize(r+"/"+e)}},V={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Y.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=W.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=V.resolve(r).substr(1),e=V.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},J={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){J.ttys[r]={input:[],output:[],ops:e},Y.registerDevice(r,J.stream_ops)},stream_ops:{open:function(r){var e=J.ttys[r.node.rdev];if(!e)throw new Y.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Y.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new Y.ErrnoError(29)}if(void 0===s&&0===i)throw new Y.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Y.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new Y.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=or(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(f(k(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(f(k(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(p(k(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(p(k(r.output,0)),r.output=[])}}},X={ops_table:null,mount:function(r){return X.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Y.isBlkdev(t)||Y.isFIFO(t))throw new Y.ErrnoError(63);X.ops_table||(X.ops_table={dir:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr,lookup:X.node_ops.lookup,mknod:X.node_ops.mknod,rename:X.node_ops.rename,unlink:X.node_ops.unlink,rmdir:X.node_ops.rmdir,readdir:X.node_ops.readdir,symlink:X.node_ops.symlink},stream:{llseek:X.stream_ops.llseek}},file:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr},stream:{llseek:X.stream_ops.llseek,read:X.stream_ops.read,write:X.stream_ops.write,allocate:X.stream_ops.allocate,mmap:X.stream_ops.mmap,msync:X.stream_ops.msync}},link:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr,readlink:X.node_ops.readlink},stream:{}},chrdev:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr},stream:Y.chrdev_stream_ops}});var o=Y.createNode(r,e,t,n);return Y.isDir(o.mode)?(o.node_ops=X.ops_table.dir.node,o.stream_ops=X.ops_table.dir.stream,o.contents={}):Y.isFile(o.mode)?(o.node_ops=X.ops_table.file.node,o.stream_ops=X.ops_table.file.stream,o.usedBytes=0,o.contents=null):Y.isLink(o.mode)?(o.node_ops=X.ops_table.link.node,o.stream_ops=X.ops_table.link.stream):Y.isChrdev(o.mode)&&(o.node_ops=X.ops_table.chrdev.node,o.stream_ops=X.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Y.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Y.isDir(r.mode)?e.size=4096:Y.isFile(r.mode)?e.size=r.usedBytes:Y.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&X.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Y.genericErrors[44]},mknod:function(r,e,t,n){return X.createNode(r,e,t,n)},rename:function(r,e,t){if(Y.isDir(r.mode)){var n;try{n=Y.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new Y.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Y.lookupNode(r,e);for(var n in t.contents)throw new Y.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=X.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Y.isLink(r.mode))throw new Y.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===w.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(X.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Y.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Y.ErrnoError(28);return n},allocate:function(r,e,t){X.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new Y.ErrnoError(28);if(!Y.isFile(r.node.mode))throw new Y.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==v){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=void L()))throw new Y.ErrnoError(48);w.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!Y.isFile(r.node.mode))throw new Y.ErrnoError(43);return 2&o||X.stream_ops.write(r,e,0,n,t,!1),0}}},Y={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(!(r=V.resolve(Y.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new Y.ErrnoError(32);for(var o=W.normalizeArray(r.split("/").filter((r=>!!r)),!1),i=Y.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=Y.lookupNode(i,o[s]),a=W.join2(a,o[s]),Y.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;Y.isLink(i.mode);){var l=Y.readlink(a);if(a=V.resolve(W.dirname(a),l),i=Y.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new Y.ErrnoError(32)}}return{path:a,node:i}},getPath:r=>{for(var e;;){if(Y.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Y.nameTable.length},hashAddNode:r=>{var e=Y.hashName(r.parent.id,r.name);r.name_next=Y.nameTable[e],Y.nameTable[e]=r},hashRemoveNode:r=>{var e=Y.hashName(r.parent.id,r.name);if(Y.nameTable[e]===r)Y.nameTable[e]=r.name_next;else for(var t=Y.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:(r,e)=>{var t=Y.mayLookup(r);if(t)throw new Y.ErrnoError(t,r);for(var n=Y.hashName(r.id,e),o=Y.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Y.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new Y.FSNode(r,e,t,n);return Y.hashAddNode(o),o},destroyNode:r=>{Y.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=Y.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>Y.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=Y.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{return Y.lookupNode(r,e),20}catch(r){}return Y.nodePermissions(r,"wx")},mayDelete:(r,e,t)=>{var n;try{n=Y.lookupNode(r,e)}catch(r){return r.errno}var o=Y.nodePermissions(r,"wx");if(o)return o;if(t){if(!Y.isDir(n.mode))return 54;if(Y.isRoot(n)||Y.getPath(n)===Y.cwd())return 10}else if(Y.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?Y.isLink(r.mode)?32:Y.isDir(r.mode)&&("r"!==Y.flagsToPermissionString(e)||512&e)?31:Y.nodePermissions(r,Y.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=Y.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!Y.streams[t])return t;throw new Y.ErrnoError(33)},getStream:r=>Y.streams[r],createStream:(r,e,t)=>{Y.FSStream||(Y.FSStream=function(){},Y.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),r=Object.assign(new Y.FSStream,r);var n=Y.nextfd(e,t);return r.fd=n,Y.streams[n]=r,r},closeStream:r=>{Y.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=Y.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new Y.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{Y.devices[r]={stream_ops:e}},getDevice:r=>Y.devices[r],getMounts:r=>{for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{"function"==typeof r&&(e=r,r=!1),Y.syncFSRequests++,Y.syncFSRequests>1&&p("warning: "+Y.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Y.getMounts(Y.root.mount),n=0;function o(r){return Y.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o="/"===t,i=!t;if(o&&Y.root)throw new Y.ErrnoError(10);if(!o&&!i){var a=Y.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Y.isMountpoint(n))throw new Y.ErrnoError(10);if(!Y.isDir(n.mode))throw new Y.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Y.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=Y.lookupPath(r,{follow_mount:!1});if(!Y.isMountpoint(e.node))throw new Y.ErrnoError(28);var t=e.node,n=t.mounted,o=Y.getMounts(n);Object.keys(Y.nameTable).forEach((r=>{for(var e=Y.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&Y.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=Y.lookupPath(r,{parent:!0}).node,o=W.basename(r);if(!o||"."===o||".."===o)throw new Y.ErrnoError(28);var i=Y.mayCreate(n,o);if(i)throw new Y.ErrnoError(i);if(!n.node_ops.mknod)throw new Y.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,Y.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,Y.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Y.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,Y.mknod(r,e,t)),symlink:(r,e)=>{if(!V.resolve(r))throw new Y.ErrnoError(44);var t=Y.lookupPath(e,{parent:!0}).node;if(!t)throw new Y.ErrnoError(44);var n=W.basename(e),o=Y.mayCreate(t,n);if(o)throw new Y.ErrnoError(o);if(!t.node_ops.symlink)throw new Y.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:(r,e)=>{var t,n,o=W.dirname(r),i=W.dirname(e),a=W.basename(r),s=W.basename(e);if(t=Y.lookupPath(r,{parent:!0}).node,n=Y.lookupPath(e,{parent:!0}).node,!t||!n)throw new Y.ErrnoError(44);if(t.mount!==n.mount)throw new Y.ErrnoError(75);var u,c=Y.lookupNode(t,a),l=V.relative(r,i);if("."!==l.charAt(0))throw new Y.ErrnoError(28);if("."!==(l=V.relative(e,o)).charAt(0))throw new Y.ErrnoError(55);try{u=Y.lookupNode(n,s)}catch(r){}if(c!==u){var d=Y.isDir(c.mode),f=Y.mayDelete(t,a,d);if(f)throw new Y.ErrnoError(f);if(f=u?Y.mayDelete(n,s,d):Y.mayCreate(n,s))throw new Y.ErrnoError(f);if(!t.node_ops.rename)throw new Y.ErrnoError(63);if(Y.isMountpoint(c)||u&&Y.isMountpoint(u))throw new Y.ErrnoError(10);if(n!==t&&(f=Y.nodePermissions(t,"w")))throw new Y.ErrnoError(f);Y.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{Y.hashAddNode(c)}}},rmdir:r=>{var e=Y.lookupPath(r,{parent:!0}).node,t=W.basename(r),n=Y.lookupNode(e,t),o=Y.mayDelete(e,t,!0);if(o)throw new Y.ErrnoError(o);if(!e.node_ops.rmdir)throw new Y.ErrnoError(63);if(Y.isMountpoint(n))throw new Y.ErrnoError(10);e.node_ops.rmdir(e,t),Y.destroyNode(n)},readdir:r=>{var e=Y.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new Y.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=Y.lookupPath(r,{parent:!0}).node;if(!e)throw new Y.ErrnoError(44);var t=W.basename(r),n=Y.lookupNode(e,t),o=Y.mayDelete(e,t,!1);if(o)throw new Y.ErrnoError(o);if(!e.node_ops.unlink)throw new Y.ErrnoError(63);if(Y.isMountpoint(n))throw new Y.ErrnoError(10);e.node_ops.unlink(e,t),Y.destroyNode(n)},readlink:r=>{var e=Y.lookupPath(r).node;if(!e)throw new Y.ErrnoError(44);if(!e.node_ops.readlink)throw new Y.ErrnoError(28);return V.resolve(Y.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var t=Y.lookupPath(r,{follow:!e}).node;if(!t)throw new Y.ErrnoError(44);if(!t.node_ops.getattr)throw new Y.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>Y.stat(r,!0),chmod:(r,e,t)=>{var n;if(!(n="string"==typeof r?Y.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new Y.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{Y.chmod(r,e,!0)},fchmod:(r,e)=>{var t=Y.getStream(r);if(!t)throw new Y.ErrnoError(8);Y.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;if(!(o="string"==typeof r?Y.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new Y.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{Y.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=Y.getStream(r);if(!n)throw new Y.ErrnoError(8);Y.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new Y.ErrnoError(28);var t;if(!(t="string"==typeof r?Y.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new Y.ErrnoError(63);if(Y.isDir(t.mode))throw new Y.ErrnoError(31);if(!Y.isFile(t.mode))throw new Y.ErrnoError(28);var n=Y.nodePermissions(t,"w");if(n)throw new Y.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=Y.getStream(r);if(!t)throw new Y.ErrnoError(8);if(0==(2097155&t.flags))throw new Y.ErrnoError(28);Y.truncate(t.node,e)},utime:(r,e,t)=>{var n=Y.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:(r,e,t,n,i)=>{if(""===r)throw new Y.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?Y.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=W.normalize(r);try{a=Y.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new Y.ErrnoError(20)}else a=Y.mknod(r,t,0),s=!0;if(!a)throw new Y.ErrnoError(44);if(Y.isChrdev(a.mode)&&(e&=-513),65536&e&&!Y.isDir(a.mode))throw new Y.ErrnoError(54);if(!s){var u=Y.mayOpen(a,e);if(u)throw new Y.ErrnoError(u)}512&e&&Y.truncate(a,0),e&=-131713;var c=Y.createStream({node:a,path:Y.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(Y.readFiles||(Y.readFiles={}),r in Y.readFiles||(Y.readFiles[r]=1)),c},close:r=>{if(Y.isClosed(r))throw new Y.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{Y.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(Y.isClosed(r))throw new Y.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Y.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Y.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new Y.ErrnoError(28);if(Y.isClosed(r))throw new Y.ErrnoError(8);if(1==(2097155&r.flags))throw new Y.ErrnoError(8);if(Y.isDir(r.node.mode))throw new Y.ErrnoError(31);if(!r.stream_ops.read)throw new Y.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Y.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new Y.ErrnoError(28);if(Y.isClosed(r))throw new Y.ErrnoError(8);if(0==(2097155&r.flags))throw new Y.ErrnoError(8);if(Y.isDir(r.node.mode))throw new Y.ErrnoError(31);if(!r.stream_ops.write)throw new Y.ErrnoError(28);r.seekable&&1024&r.flags&&Y.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Y.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(Y.isClosed(r))throw new Y.ErrnoError(8);if(e<0||t<=0)throw new Y.ErrnoError(28);if(0==(2097155&r.flags))throw new Y.ErrnoError(8);if(!Y.isFile(r.node.mode)&&!Y.isDir(r.node.mode))throw new Y.ErrnoError(43);if(!r.stream_ops.allocate)throw new Y.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Y.ErrnoError(2);if(1==(2097155&r.flags))throw new Y.ErrnoError(2);if(!r.stream_ops.mmap)throw new Y.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new Y.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=Y.open(r,e.flags),o=Y.stat(r).size,i=new Uint8Array(o);return Y.read(n,i,0,o,0),"utf8"===e.encoding?t=k(i,0):"binary"===e.encoding&&(t=i),Y.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=Y.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(A(e)+1),i=S(e,o,0,o.length);Y.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Y.write(n,e,0,e.byteLength,void 0,t.canOwn)}Y.close(n)},cwd:()=>Y.currentPath,chdir:r=>{var e=Y.lookupPath(r,{follow:!0});if(null===e.node)throw new Y.ErrnoError(44);if(!Y.isDir(e.node.mode))throw new Y.ErrnoError(54);var t=Y.nodePermissions(e.node,"x");if(t)throw new Y.ErrnoError(t);Y.currentPath=e.path},createDefaultDirectories:()=>{Y.mkdir("/tmp"),Y.mkdir("/home"),Y.mkdir("/home/web_user")},createDefaultDevices:()=>{Y.mkdir("/dev"),Y.registerDevice(Y.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),Y.mkdev("/dev/null",Y.makedev(1,3)),J.register(Y.makedev(5,0),J.default_tty_ops),J.register(Y.makedev(6,0),J.default_tty1_ops),Y.mkdev("/dev/tty",Y.makedev(5,0)),Y.mkdev("/dev/tty1",Y.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){L("randomDevice")}}();Y.createDevice("/dev","random",r),Y.createDevice("/dev","urandom",r),Y.mkdir("/dev/shm"),Y.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Y.mkdir("/proc");var r=Y.mkdir("/proc/self");Y.mkdir("/proc/self/fd"),Y.mount({mount:()=>{var e=Y.createNode(r,"fd",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=Y.getStream(t);if(!n)throw new Y.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?Y.createDevice("/dev","stdin",o.stdin):Y.symlink("/dev/tty","/dev/stdin"),o.stdout?Y.createDevice("/dev","stdout",null,o.stdout):Y.symlink("/dev/tty","/dev/stdout"),o.stderr?Y.createDevice("/dev","stderr",null,o.stderr):Y.symlink("/dev/tty1","/dev/stderr"),Y.open("/dev/stdin",0),Y.open("/dev/stdout",1),Y.open("/dev/stderr",1)},ensureErrnoError:()=>{Y.ErrnoError||(Y.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Y.ErrnoError.prototype=new Error,Y.ErrnoError.prototype.constructor=Y.ErrnoError,[44].forEach((r=>{Y.genericErrors[r]=new Y.ErrnoError(r),Y.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{Y.ensureErrnoError(),Y.nameTable=new Array(4096),Y.mount(X,{},"/"),Y.createDefaultDirectories(),Y.createDefaultDevices(),Y.createSpecialDirectories(),Y.filesystems={MEMFS:X}},init:(r,e,t)=>{Y.init.initialized=!0,Y.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,Y.createStandardStreams()},quit:()=>{Y.init.initialized=!1;for(var r=0;r<Y.streams.length;r++){var e=Y.streams[r];e&&Y.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=Y.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{r=(n=Y.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Y.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=W.basename(r),n=Y.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:(r,e,t,n)=>{r="string"==typeof r?r:Y.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=W.join2(r,i);try{Y.mkdir(a)}catch(r){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=W.join2("string"==typeof r?r:Y.getPath(r),e),a=Y.getMode(n,o);return Y.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r="string"==typeof r?r:Y.getPath(r),a=e?W.join2(r,e):r);var s=Y.getMode(n,o),u=Y.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,d=t.length;l<d;++l)c[l]=t.charCodeAt(l);t=c}Y.chmod(u,146|s);var f=Y.open(u,577);Y.write(f,t,0,t.length,0,i),Y.close(f),Y.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=W.join2("string"==typeof r?r:Y.getPath(r),e),i=Y.getMode(!!t,!!n);Y.createDevice.major||(Y.createDevice.major=64);var a=Y.makedev(Y.createDevice.major++,0);return Y.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new Y.ErrnoError(29)}if(void 0===u&&0===a)throw new Y.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new Y.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Y.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!i)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=or(i(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new Y.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((r=>{var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):or(o.responseText||"",!0)})(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=Y.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach((r=>{var e=s.stream_ops[r];u[r]=function(){return Y.forceLoadFile(s),e.apply(null,arguments)}})),u.read=(r,e,t,n,o)=>{Y.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:(r,e,t,n,o,i,s,u,c,l)=>{var d=e?V.resolve(W.join2(r,e)):r;function f(t){function a(t){l&&l(),u||Y.createDataFile(r,e,t,n,o,c),i&&i(),O()}Browser.handledByPreloadPlugin(t,d,a,(()=>{s&&s(),O()}))||a(t)}N(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;a(r,(function(t){m(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&O()}),(function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()})),o&&N()}(t,(r=>f(r)),s):f(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Y.indexedDB();try{var o=n.open(Y.DB_NAME(),Y.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=()=>{f("creating db"),o.result.createObjectStore(Y.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([Y.DB_STORE_NAME],"readwrite"),i=n.objectStore(Y.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach((r=>{var e=i.put(Y.analyzePath(r).object.contents,r);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=Y.indexedDB();try{var o=n.open(Y.DB_NAME(),Y.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([Y.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(Y.DB_STORE_NAME),s=0,u=0,c=r.length;function l(){0==u?e():t()}r.forEach((r=>{var e=a.get(r);e.onsuccess=()=>{Y.analyzePath(r).exists&&Y.unlink(r),Y.createDataFile(W.dirname(r),W.basename(r),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=t},o.onerror=t}},K={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=Y.cwd();else{var o=Y.getStream(r);if(!o)throw new Y.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Y.ErrnoError(44);return n}return W.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&W.normalize(e)!==W.normalize(Y.getPath(r.node)))return-54;throw r}return y[t>>2]=n.dev,y[t+4>>2]=0,y[t+8>>2]=n.ino,y[t+12>>2]=n.mode,y[t+16>>2]=n.nlink,y[t+20>>2]=n.uid,y[t+24>>2]=n.gid,y[t+28>>2]=n.rdev,y[t+32>>2]=0,R=[n.size>>>0,(M=n.size,+Math.abs(M)>=1?M>0?(0|Math.min(+Math.floor(M/4294967296),4294967295))>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],y[t+40>>2]=R[0],y[t+44>>2]=R[1],y[t+48>>2]=4096,y[t+52>>2]=n.blocks,y[t+56>>2]=n.atime.getTime()/1e3|0,y[t+60>>2]=0,y[t+64>>2]=n.mtime.getTime()/1e3|0,y[t+68>>2]=0,y[t+72>>2]=n.ctime.getTime()/1e3|0,y[t+76>>2]=0,R=[n.ino>>>0,(M=n.ino,+Math.abs(M)>=1?M>0?(0|Math.min(+Math.floor(M/4294967296),4294967295))>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],y[t+80>>2]=R[0],y[t+84>>2]=R[1],0},doMsync:function(r,e,t,n,o){var i=_.slice(r,r+t);Y.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=W.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Y.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Y.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=Y.readlink(r),o=Math.min(t,A(n)),i=w[e+o];return S(n,_,e,t+1),w[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t=Y.lookupPath(r,{follow:!0}).node;if(!t)return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&Y.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=Y.getStream(t);return n&&Y.close(n),Y.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=y[e+8*i>>2],s=y[e+(8*i+4)>>2],u=Y.read(r,w,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=y[e+8*i>>2],s=y[e+(8*i+4)>>2],u=Y.write(r,w,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return K.varargs+=4,y[K.varargs-4>>2]},getStr:function(r){return D(r)},getStreamFromFD:function(r){var e=Y.getStream(r);if(!e)throw new Y.ErrnoError(8);return e},get64:function(r,e){return r}},$=[];function Q(r){try{return d.grow(r-v.byteLength+65535>>>16),P(d.buffer),1}catch(r){}}var Z={};function rr(){if(!rr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var e in Z)void 0===Z[e]?delete r[e]:r[e]=Z[e];var t=[];for(var e in r)t.push(e+"="+r[e]);rr.strings=t}return rr.strings}var er=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Y.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},tr=365,nr=146;function or(r,e,t){var n=t>0?t:A(r)+1,o=new Array(n),i=S(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(er.prototype,{read:{get:function(){return(this.mode&tr)===tr},set:function(r){r?this.mode|=tr:this.mode&=-366}},write:{get:function(){return(this.mode&nr)===nr},set:function(r){r?this.mode|=nr:this.mode&=-147}},isFolder:{get:function(){return Y.isDir(this.mode)}},isDevice:{get:function(){return Y.isChrdev(this.mode)}}}),Y.FSNode=er,Y.staticInit();var ir={g:function(r,e,t){K.varargs=t;try{var n=K.getStr(r),o=t?K.get():0;return Y.open(n,e,o).fd}catch(r){if(void 0===Y||!(r instanceof Y.ErrnoError))throw r;return-r.errno}},d:function(){L("")},a:function(r,e,t){var n=function(r,e){var t;for($.length=0,e>>=2;t=_[r++];){var n=t<105;n&&1&e&&e++,$.push(n?E[e++>>1]:y[e]),++e}return $}(e,t);return H[r].apply(null,n)},j:function(r,e,t){_.copyWithin(r,e,e+t)},e:function(r){var e,t,n=_.length,o=2147483648;if((r>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,r+100663296),Q(Math.min(o,(e=Math.max(r,a))+((t=65536)-e%t)%t)))return!0}return!1},h:function(r,e){var t=0;return rr().forEach((function(n,o){var i=e+t;y[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)w[e++>>0]=r.charCodeAt(n);t||(w[e>>0]=0)}(n,i),t+=n.length+1})),0},i:function(r,e){var t=rr();y[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),y[e>>2]=n,0},c:function(r){try{var e=K.getStreamFromFD(r);return Y.close(e),0}catch(r){if(void 0===Y||!(r instanceof Y.ErrnoError))throw r;return r.errno}},f:function(r,e,t,n){try{var o=K.getStreamFromFD(r),i=K.doReadv(o,e,t);return y[n>>2]=i,0}catch(r){if(void 0===Y||!(r instanceof Y.ErrnoError))throw r;return r.errno}},k:function(r,e,t,n,o){try{var i=K.getStreamFromFD(r),a=4294967296*t+(e>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(Y.llseek(i,a,n),R=[i.position>>>0,(M=i.position,+Math.abs(M)>=1?M>0?(0|Math.min(+Math.floor(M/4294967296),4294967295))>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],y[o>>2]=R[0],y[o+4>>2]=R[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){if(void 0===Y||!(r instanceof Y.ErrnoError))throw r;return r.errno}},b:function(r,e,t,n){try{var o=K.getStreamFromFD(r),i=K.doWritev(o,e,t);return y[n>>2]=i,0}catch(r){if(void 0===Y||!(r instanceof Y.ErrnoError))throw r;return r.errno}},l:function(r){var e=Date.now();return y[r>>2]=e/1e3|0,y[r+4>>2]=e%1e3*1e3|0,0}};!function(){var r={a:ir};function e(r,e){var t,n=r.exports;o.asm=n,P((d=o.asm.m).buffer),g=o.asm.G,t=o.asm.n,j.unshift(t),O()}function n(r){e(r.instance)}function i(e){return(l||"function"!=typeof fetch?Promise.resolve().then((function(){return U(x)})):fetch(x,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+x+"\'";return r.arrayBuffer()})).catch((function(){return U(x)}))).then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){p("failed to asynchronously prepare wasm: "+r),L(r)}))}if(N(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return p("Module.instantiateWasm callback failed with error: "+r),!1}(l||"function"!=typeof WebAssembly.instantiateStreaming||I(x)||"function"!=typeof fetch?i(n):fetch(x,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(n,(function(r){return p("wasm streaming compile failed: "+r),p("falling back to ArrayBuffer instantiation"),i(n)}))}))).catch(t)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)};var ar,sr=o._emscripten_bind_CExpat_CExpat_0=function(){return(sr=o._emscripten_bind_CExpat_CExpat_0=o.asm.o).apply(null,arguments)},ur=o._emscripten_bind_CExpat_version_0=function(){return(ur=o._emscripten_bind_CExpat_version_0=o.asm.p).apply(null,arguments)},cr=o._emscripten_bind_CExpat_create_0=function(){return(cr=o._emscripten_bind_CExpat_create_0=o.asm.q).apply(null,arguments)},lr=o._emscripten_bind_CExpat_destroy_0=function(){return(lr=o._emscripten_bind_CExpat_destroy_0=o.asm.r).apply(null,arguments)},dr=o._emscripten_bind_CExpat_parse_1=function(){return(dr=o._emscripten_bind_CExpat_parse_1=o.asm.s).apply(null,arguments)},fr=o._emscripten_bind_CExpat_tag_0=function(){return(fr=o._emscripten_bind_CExpat_tag_0=o.asm.t).apply(null,arguments)},pr=o._emscripten_bind_CExpat_attrs_0=function(){return(pr=o._emscripten_bind_CExpat_attrs_0=o.asm.u).apply(null,arguments)},hr=o._emscripten_bind_CExpat_content_0=function(){return(hr=o._emscripten_bind_CExpat_content_0=o.asm.v).apply(null,arguments)},mr=o._emscripten_bind_CExpat_startElement_0=function(){return(mr=o._emscripten_bind_CExpat_startElement_0=o.asm.w).apply(null,arguments)},vr=o._emscripten_bind_CExpat_endElement_0=function(){return(vr=o._emscripten_bind_CExpat_endElement_0=o.asm.x).apply(null,arguments)},wr=o._emscripten_bind_CExpat_characterData_0=function(){return(wr=o._emscripten_bind_CExpat_characterData_0=o.asm.y).apply(null,arguments)},_r=o._emscripten_bind_CExpat___destroy___0=function(){return(_r=o._emscripten_bind_CExpat___destroy___0=o.asm.z).apply(null,arguments)},yr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(yr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.A).apply(null,arguments)},Er=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(Er=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.B).apply(null,arguments)},gr=o._emscripten_bind_CExpatJS_startElement_0=function(){return(gr=o._emscripten_bind_CExpatJS_startElement_0=o.asm.C).apply(null,arguments)},br=o._emscripten_bind_CExpatJS_endElement_0=function(){return(br=o._emscripten_bind_CExpatJS_endElement_0=o.asm.D).apply(null,arguments)},kr=o._emscripten_bind_CExpatJS_characterData_0=function(){return(kr=o._emscripten_bind_CExpatJS_characterData_0=o.asm.E).apply(null,arguments)},Dr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(Dr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.F).apply(null,arguments)};function Sr(r){function t(){ar||(ar=!0,o.calledRun=!0,h||(o.noFSInit||Y.init.initialized||Y.init(),Y.ignorePermissions=!1,G(j),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;G(z)}()))}T>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),C.unshift(r);var r;G(C)}(),T>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.H).apply(null,arguments)},B=function r(){ar||Sr(),ar||(B=r)},o.run=Sr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Ar(){}function Pr(r){return(r||Ar).__cache__}function xr(r,e){var t=Pr(e),n=t[r];return n||((n=Object.create((e||Ar).prototype)).ptr=r,t[r]=n)}Sr(),Ar.prototype=Object.create(Ar.prototype),Ar.prototype.constructor=Ar,Ar.prototype.__class__=Ar,Ar.__cache__={},o.WrapperObject=Ar,o.getCache=Pr,o.wrapPointer=xr,o.castObject=function(r,e){return xr(r.ptr,e)},o.NULL=xr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Pr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Fr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Fr.needed){for(var r=0;r<Fr.temps.length;r++)o._free(Fr.temps[r]);Fr.temps.length=0,o._free(Fr.buffer),Fr.buffer=0,Fr.size+=Fr.needed,Fr.needed=0}Fr.buffer||(Fr.size+=128,Fr.buffer=o._malloc(Fr.size),m(Fr.buffer)),Fr.pos=0},alloc:function(r,e){m(Fr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Fr.pos+i>=Fr.size?(m(i>0),Fr.needed+=i,t=o._malloc(i),Fr.temps.push(t)):(t=Fr.buffer+Fr.pos,Fr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Mr(){this.ptr=sr(),Pr(Mr)[this.ptr]=this}function Rr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Cr(){this.ptr=Er(),Pr(Cr)[this.ptr]=this}return Mr.prototype=Object.create(Ar.prototype),Mr.prototype.constructor=Mr,Mr.prototype.__class__=Mr,Mr.__cache__={},o.CExpat=Mr,Mr.prototype.version=Mr.prototype.version=function(){var r=this.ptr;return D(ur(r))},Mr.prototype.create=Mr.prototype.create=function(){var r=this.ptr;return!!cr(r)},Mr.prototype.destroy=Mr.prototype.destroy=function(){var r=this.ptr;lr(r)},Mr.prototype.parse=Mr.prototype.parse=function(r){var e=this.ptr;return Fr.prepare(),r=r&&"object"==typeof r?r.ptr:function(r){if("string"==typeof r){var e=or(r),t=Fr.alloc(e,w);return Fr.copy(e,w,t),t}return r}(r),!!dr(e,r)},Mr.prototype.tag=Mr.prototype.tag=function(){var r=this.ptr;return D(fr(r))},Mr.prototype.attrs=Mr.prototype.attrs=function(){var r=this.ptr;return D(pr(r))},Mr.prototype.content=Mr.prototype.content=function(){var r=this.ptr;return D(hr(r))},Mr.prototype.startElement=Mr.prototype.startElement=function(){var r=this.ptr;mr(r)},Mr.prototype.endElement=Mr.prototype.endElement=function(){var r=this.ptr;vr(r)},Mr.prototype.characterData=Mr.prototype.characterData=function(){var r=this.ptr;wr(r)},Mr.prototype.__destroy__=Mr.prototype.__destroy__=function(){var r=this.ptr;_r(r)},Rr.prototype=Object.create(Ar.prototype),Rr.prototype.constructor=Rr,Rr.prototype.__class__=Rr,Rr.__cache__={},o.VoidPtr=Rr,Rr.prototype.__destroy__=Rr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},Cr.prototype=Object.create(Mr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.CExpatJS=Cr,Cr.prototype.startElement=Cr.prototype.startElement=function(){var r=this.ptr;gr(r)},Cr.prototype.endElement=Cr.prototype.endElement=function(){var r=this.ptr;br(r)},Cr.prototype.characterData=Cr.prototype.characterData=function(){var r=this.ptr;kr(r)},Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;Dr(r)},r.ready},t.exports=o;var a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function s(r,e,t){var n=r.default||r;return n.__hpcc_promise||(n.__hpcc_promise=n({wasmBinary:t,locateFile:function(r,t){return"".concat(function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(e||function(r){if(!arguments.length)return a;var e=a;return a=r,e}()||t||".","/"),"/").concat(function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(r,"/"))}})),n.__hpcc_promise}!function(){function r(r,e){this.tag=r,this.attrs=e,this._content=""}Object.defineProperty(r.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),r.prototype.appendContent=function(r){this._content+=r}}();var u={exports:{}};!function(r,e){var t=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(r,e){t=r,n=e}));var i,a,s=Object.assign({},o),u="./this.program",c=(r,e)=>{throw e},l="";"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},a=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var d=o.print||console.log.bind(console),f=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit);var p,h=0;o.wasmBinary&&(p=o.wasmBinary);var m,v=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&L("no native wasm support detected");var w=!1;function _(r,e){r||L(e)}var y,E,g,b,k,D,S,A="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&A)return A.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function x(r,e){return r?P(g,r,e):""}function F(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function M(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function R(r){y=r,o.HEAP8=E=new Int8Array(r),o.HEAP16=b=new Int16Array(r),o.HEAP32=k=new Int32Array(r),o.HEAPU8=g=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=D=new Float64Array(r)}o.INITIAL_MEMORY;var C=[],j=[],z=[];var T=0,B=null;function N(r){T++,o.monitorRunDependencies&&o.monitorRunDependencies(T)}function O(r){if(T--,o.monitorRunDependencies&&o.monitorRunDependencies(T),0==T&&B){var e=B;B=null,e()}}function L(r){o.onAbort&&o.onAbort(r),f(r="Aborted("+r+")"),w=!0,r+=". Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var I,U,H,G;function q(r){return r.startsWith("data:application/octet-stream;base64,")}function W(r){try{if(r==I&&p)return new Uint8Array(p);throw"both async and sync fetching of the wasm failed"}catch(r){L(r)}}q(I="graphvizlib.wasm")||(U=I,I=o.locateFile?o.locateFile(U,l):l+U);var V,J={161520:function(r,e){var t=x(r),n=x(e);tr.createPath("/",$.dirname(t)),tr.writeFile($.join("/",t),n)}};function X(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?Y(t)():Y(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}function Y(r){return S.get(r)}V=()=>performance.now();function K(r){return k[gr()>>2]=r,r}var $={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=$.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=$.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=$.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return $.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return $.normalize(r.join("/"))},join2:function(r,e){return $.normalize(r+"/"+e)}};var Q={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:tr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=$.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Q.resolve(r).substr(1),e=Q.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},Z={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){Z.ttys[r]={input:[],output:[],ops:e},tr.registerDevice(r,Z.stream_ops)},stream_ops:{open:function(r){var e=Z.ttys[r.node.rdev];if(!e)throw new tr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new tr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new tr.ErrnoError(29)}if(void 0===s&&0===i)throw new tr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new tr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new tr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=dr(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(d(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(d(P(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(f(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(f(P(r.output,0)),r.output=[])}}};function rr(r){r=function(r,e){return Math.ceil(r/e)*e}(r,65536);var e=br(65536,r);return e?(function(r,e){g.fill(0,r,r+e)}(e,r),e):0}var er={ops_table:null,mount:function(r){return er.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(tr.isBlkdev(t)||tr.isFIFO(t))throw new tr.ErrnoError(63);er.ops_table||(er.ops_table={dir:{node:{getattr:er.node_ops.getattr,setattr:er.node_ops.setattr,lookup:er.node_ops.lookup,mknod:er.node_ops.mknod,rename:er.node_ops.rename,unlink:er.node_ops.unlink,rmdir:er.node_ops.rmdir,readdir:er.node_ops.readdir,symlink:er.node_ops.symlink},stream:{llseek:er.stream_ops.llseek}},file:{node:{getattr:er.node_ops.getattr,setattr:er.node_ops.setattr},stream:{llseek:er.stream_ops.llseek,read:er.stream_ops.read,write:er.stream_ops.write,allocate:er.stream_ops.allocate,mmap:er.stream_ops.mmap,msync:er.stream_ops.msync}},link:{node:{getattr:er.node_ops.getattr,setattr:er.node_ops.setattr,readlink:er.node_ops.readlink},stream:{}},chrdev:{node:{getattr:er.node_ops.getattr,setattr:er.node_ops.setattr},stream:tr.chrdev_stream_ops}});var o=tr.createNode(r,e,t,n);return tr.isDir(o.mode)?(o.node_ops=er.ops_table.dir.node,o.stream_ops=er.ops_table.dir.stream,o.contents={}):tr.isFile(o.mode)?(o.node_ops=er.ops_table.file.node,o.stream_ops=er.ops_table.file.stream,o.usedBytes=0,o.contents=null):tr.isLink(o.mode)?(o.node_ops=er.ops_table.link.node,o.stream_ops=er.ops_table.link.stream):tr.isChrdev(o.mode)&&(o.node_ops=er.ops_table.chrdev.node,o.stream_ops=er.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=tr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,tr.isDir(r.mode)?e.size=4096:tr.isFile(r.mode)?e.size=r.usedBytes:tr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&er.resizeFileStorage(r,e.size)},lookup:function(r,e){throw tr.genericErrors[44]},mknod:function(r,e,t,n){return er.createNode(r,e,t,n)},rename:function(r,e,t){if(tr.isDir(r.mode)){var n;try{n=tr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new tr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=tr.lookupNode(r,e);for(var n in t.contents)throw new tr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=er.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!tr.isLink(r.mode))throw new tr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===E.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(er.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&tr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new tr.ErrnoError(28);return n},allocate:function(r,e,t){er.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new tr.ErrnoError(28);if(!tr.isFile(r.node.mode))throw new tr.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==y){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=rr(t)))throw new tr.ErrnoError(48);E.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!tr.isFile(r.node.mode))throw new tr.ErrnoError(43);return 2&o||er.stream_ops.write(r,e,0,n,t,!1),0}}};var tr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(!(r=Q.resolve(tr.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new tr.ErrnoError(32);for(var o=$.normalizeArray(r.split("/").filter((r=>!!r)),!1),i=tr.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=tr.lookupNode(i,o[s]),a=$.join2(a,o[s]),tr.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;tr.isLink(i.mode);){var l=tr.readlink(a);if(a=Q.resolve($.dirname(a),l),i=tr.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new tr.ErrnoError(32)}}return{path:a,node:i}},getPath:r=>{for(var e;;){if(tr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%tr.nameTable.length},hashAddNode:r=>{var e=tr.hashName(r.parent.id,r.name);r.name_next=tr.nameTable[e],tr.nameTable[e]=r},hashRemoveNode:r=>{var e=tr.hashName(r.parent.id,r.name);if(tr.nameTable[e]===r)tr.nameTable[e]=r.name_next;else for(var t=tr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:(r,e)=>{var t=tr.mayLookup(r);if(t)throw new tr.ErrnoError(t,r);for(var n=tr.hashName(r.id,e),o=tr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return tr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new tr.FSNode(r,e,t,n);return tr.hashAddNode(o),o},destroyNode:r=>{tr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=tr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>tr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=tr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{tr.lookupNode(r,e);return 20}catch(r){}return tr.nodePermissions(r,"wx")},mayDelete:(r,e,t)=>{var n;try{n=tr.lookupNode(r,e)}catch(r){return r.errno}var o=tr.nodePermissions(r,"wx");if(o)return o;if(t){if(!tr.isDir(n.mode))return 54;if(tr.isRoot(n)||tr.getPath(n)===tr.cwd())return 10}else if(tr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?tr.isLink(r.mode)?32:tr.isDir(r.mode)&&("r"!==tr.flagsToPermissionString(e)||512&e)?31:tr.nodePermissions(r,tr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=tr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!tr.streams[t])return t;throw new tr.ErrnoError(33)},getStream:r=>tr.streams[r],createStream:(r,e,t)=>{tr.FSStream||(tr.FSStream=function(){},tr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),r=Object.assign(new tr.FSStream,r);var n=tr.nextfd(e,t);return r.fd=n,tr.streams[n]=r,r},closeStream:r=>{tr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=tr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new tr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{tr.devices[r]={stream_ops:e}},getDevice:r=>tr.devices[r],getMounts:r=>{for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{"function"==typeof r&&(e=r,r=!1),tr.syncFSRequests++,tr.syncFSRequests>1&&f("warning: "+tr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=tr.getMounts(tr.root.mount),n=0;function o(r){return tr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o="/"===t,i=!t;if(o&&tr.root)throw new tr.ErrnoError(10);if(!o&&!i){var a=tr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,tr.isMountpoint(n))throw new tr.ErrnoError(10);if(!tr.isDir(n.mode))throw new tr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?tr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=tr.lookupPath(r,{follow_mount:!1});if(!tr.isMountpoint(e.node))throw new tr.ErrnoError(28);var t=e.node,n=t.mounted,o=tr.getMounts(n);Object.keys(tr.nameTable).forEach((r=>{for(var e=tr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&tr.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=tr.lookupPath(r,{parent:!0}).node,o=$.basename(r);if(!o||"."===o||".."===o)throw new tr.ErrnoError(28);var i=tr.mayCreate(n,o);if(i)throw new tr.ErrnoError(i);if(!n.node_ops.mknod)throw new tr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,tr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,tr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{tr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,tr.mknod(r,e,t)),symlink:(r,e)=>{if(!Q.resolve(r))throw new tr.ErrnoError(44);var t=tr.lookupPath(e,{parent:!0}).node;if(!t)throw new tr.ErrnoError(44);var n=$.basename(e),o=tr.mayCreate(t,n);if(o)throw new tr.ErrnoError(o);if(!t.node_ops.symlink)throw new tr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:(r,e)=>{var t,n,o=$.dirname(r),i=$.dirname(e),a=$.basename(r),s=$.basename(e);if(t=tr.lookupPath(r,{parent:!0}).node,n=tr.lookupPath(e,{parent:!0}).node,!t||!n)throw new tr.ErrnoError(44);if(t.mount!==n.mount)throw new tr.ErrnoError(75);var u,c=tr.lookupNode(t,a),l=Q.relative(r,i);if("."!==l.charAt(0))throw new tr.ErrnoError(28);if("."!==(l=Q.relative(e,o)).charAt(0))throw new tr.ErrnoError(55);try{u=tr.lookupNode(n,s)}catch(r){}if(c!==u){var d=tr.isDir(c.mode),f=tr.mayDelete(t,a,d);if(f)throw new tr.ErrnoError(f);if(f=u?tr.mayDelete(n,s,d):tr.mayCreate(n,s))throw new tr.ErrnoError(f);if(!t.node_ops.rename)throw new tr.ErrnoError(63);if(tr.isMountpoint(c)||u&&tr.isMountpoint(u))throw new tr.ErrnoError(10);if(n!==t&&(f=tr.nodePermissions(t,"w")))throw new tr.ErrnoError(f);tr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{tr.hashAddNode(c)}}},rmdir:r=>{var e=tr.lookupPath(r,{parent:!0}).node,t=$.basename(r),n=tr.lookupNode(e,t),o=tr.mayDelete(e,t,!0);if(o)throw new tr.ErrnoError(o);if(!e.node_ops.rmdir)throw new tr.ErrnoError(63);if(tr.isMountpoint(n))throw new tr.ErrnoError(10);e.node_ops.rmdir(e,t),tr.destroyNode(n)},readdir:r=>{var e=tr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new tr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=tr.lookupPath(r,{parent:!0}).node;if(!e)throw new tr.ErrnoError(44);var t=$.basename(r),n=tr.lookupNode(e,t),o=tr.mayDelete(e,t,!1);if(o)throw new tr.ErrnoError(o);if(!e.node_ops.unlink)throw new tr.ErrnoError(63);if(tr.isMountpoint(n))throw new tr.ErrnoError(10);e.node_ops.unlink(e,t),tr.destroyNode(n)},readlink:r=>{var e=tr.lookupPath(r).node;if(!e)throw new tr.ErrnoError(44);if(!e.node_ops.readlink)throw new tr.ErrnoError(28);return Q.resolve(tr.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var t=tr.lookupPath(r,{follow:!e}).node;if(!t)throw new tr.ErrnoError(44);if(!t.node_ops.getattr)throw new tr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>tr.stat(r,!0),chmod:(r,e,t)=>{var n;"string"==typeof r?n=tr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new tr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{tr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=tr.getStream(r);if(!t)throw new tr.ErrnoError(8);tr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;"string"==typeof r?o=tr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new tr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{tr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=tr.getStream(r);if(!n)throw new tr.ErrnoError(8);tr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new tr.ErrnoError(28);var t;"string"==typeof r?t=tr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new tr.ErrnoError(63);if(tr.isDir(t.mode))throw new tr.ErrnoError(31);if(!tr.isFile(t.mode))throw new tr.ErrnoError(28);var n=tr.nodePermissions(t,"w");if(n)throw new tr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=tr.getStream(r);if(!t)throw new tr.ErrnoError(8);if(0==(2097155&t.flags))throw new tr.ErrnoError(28);tr.truncate(t.node,e)},utime:(r,e,t)=>{var n=tr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:(r,e,t,n,i)=>{if(""===r)throw new tr.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?tr.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=$.normalize(r);try{a=tr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new tr.ErrnoError(20)}else a=tr.mknod(r,t,0),s=!0;if(!a)throw new tr.ErrnoError(44);if(tr.isChrdev(a.mode)&&(e&=-513),65536&e&&!tr.isDir(a.mode))throw new tr.ErrnoError(54);if(!s){var u=tr.mayOpen(a,e);if(u)throw new tr.ErrnoError(u)}512&e&&tr.truncate(a,0),e&=-131713;var c=tr.createStream({node:a,path:tr.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(tr.readFiles||(tr.readFiles={}),r in tr.readFiles||(tr.readFiles[r]=1)),c},close:r=>{if(tr.isClosed(r))throw new tr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{tr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(tr.isClosed(r))throw new tr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new tr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new tr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new tr.ErrnoError(28);if(tr.isClosed(r))throw new tr.ErrnoError(8);if(1==(2097155&r.flags))throw new tr.ErrnoError(8);if(tr.isDir(r.node.mode))throw new tr.ErrnoError(31);if(!r.stream_ops.read)throw new tr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new tr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new tr.ErrnoError(28);if(tr.isClosed(r))throw new tr.ErrnoError(8);if(0==(2097155&r.flags))throw new tr.ErrnoError(8);if(tr.isDir(r.node.mode))throw new tr.ErrnoError(31);if(!r.stream_ops.write)throw new tr.ErrnoError(28);r.seekable&&1024&r.flags&&tr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new tr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(tr.isClosed(r))throw new tr.ErrnoError(8);if(e<0||t<=0)throw new tr.ErrnoError(28);if(0==(2097155&r.flags))throw new tr.ErrnoError(8);if(!tr.isFile(r.node.mode)&&!tr.isDir(r.node.mode))throw new tr.ErrnoError(43);if(!r.stream_ops.allocate)throw new tr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new tr.ErrnoError(2);if(1==(2097155&r.flags))throw new tr.ErrnoError(2);if(!r.stream_ops.mmap)throw new tr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new tr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=tr.open(r,e.flags),o=tr.stat(r).size,i=new Uint8Array(o);return tr.read(n,i,0,o,0),"utf8"===e.encoding?t=P(i,0):"binary"===e.encoding&&(t=i),tr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=tr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(M(e)+1),i=F(e,o,0,o.length);tr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");tr.write(n,e,0,e.byteLength,void 0,t.canOwn)}tr.close(n)},cwd:()=>tr.currentPath,chdir:r=>{var e=tr.lookupPath(r,{follow:!0});if(null===e.node)throw new tr.ErrnoError(44);if(!tr.isDir(e.node.mode))throw new tr.ErrnoError(54);var t=tr.nodePermissions(e.node,"x");if(t)throw new tr.ErrnoError(t);tr.currentPath=e.path},createDefaultDirectories:()=>{tr.mkdir("/tmp"),tr.mkdir("/home"),tr.mkdir("/home/web_user")},createDefaultDevices:()=>{tr.mkdir("/dev"),tr.registerDevice(tr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),tr.mkdev("/dev/null",tr.makedev(1,3)),Z.register(tr.makedev(5,0),Z.default_tty_ops),Z.register(tr.makedev(6,0),Z.default_tty1_ops),tr.mkdev("/dev/tty",tr.makedev(5,0)),tr.mkdev("/dev/tty1",tr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){L("randomDevice")}}();tr.createDevice("/dev","random",r),tr.createDevice("/dev","urandom",r),tr.mkdir("/dev/shm"),tr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{tr.mkdir("/proc");var r=tr.mkdir("/proc/self");tr.mkdir("/proc/self/fd"),tr.mount({mount:()=>{var e=tr.createNode(r,"fd",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=tr.getStream(t);if(!n)throw new tr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?tr.createDevice("/dev","stdin",o.stdin):tr.symlink("/dev/tty","/dev/stdin"),o.stdout?tr.createDevice("/dev","stdout",null,o.stdout):tr.symlink("/dev/tty","/dev/stdout"),o.stderr?tr.createDevice("/dev","stderr",null,o.stderr):tr.symlink("/dev/tty1","/dev/stderr"),tr.open("/dev/stdin",0),tr.open("/dev/stdout",1),tr.open("/dev/stderr",1)},ensureErrnoError:()=>{tr.ErrnoError||(tr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},tr.ErrnoError.prototype=new Error,tr.ErrnoError.prototype.constructor=tr.ErrnoError,[44].forEach((r=>{tr.genericErrors[r]=new tr.ErrnoError(r),tr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{tr.ensureErrnoError(),tr.nameTable=new Array(4096),tr.mount(er,{},"/"),tr.createDefaultDirectories(),tr.createDefaultDevices(),tr.createSpecialDirectories(),tr.filesystems={MEMFS:er}},init:(r,e,t)=>{tr.init.initialized=!0,tr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,tr.createStandardStreams()},quit:()=>{tr.init.initialized=!1;for(var r=0;r<tr.streams.length;r++){var e=tr.streams[r];e&&tr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=tr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{r=(n=tr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=tr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=$.basename(r),n=tr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:(r,e,t,n)=>{r="string"==typeof r?r:tr.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=$.join2(r,i);try{tr.mkdir(a)}catch(r){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=$.join2("string"==typeof r?r:tr.getPath(r),e),a=tr.getMode(n,o);return tr.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r="string"==typeof r?r:tr.getPath(r),a=e?$.join2(r,e):r);var s=tr.getMode(n,o),u=tr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,d=t.length;l<d;++l)c[l]=t.charCodeAt(l);t=c}tr.chmod(u,146|s);var f=tr.open(u,577);tr.write(f,t,0,t.length,0,i),tr.close(f),tr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=$.join2("string"==typeof r?r:tr.getPath(r),e),i=tr.getMode(!!t,!!n);tr.createDevice.major||(tr.createDevice.major=64);var a=tr.makedev(tr.createDevice.major++,0);return tr.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new tr.ErrnoError(29)}if(void 0===u&&0===a)throw new tr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new tr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),tr.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!i)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=dr(i(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new tr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((r=>{var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,e)=>{if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):dr(o.responseText||"",!0)})(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,d("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=tr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach((r=>{var e=s.stream_ops[r];u[r]=function(){return tr.forceLoadFile(s),e.apply(null,arguments)}})),u.read=(r,e,t,n,o)=>{tr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:(r,e,t,n,o,i,s,u,c,l)=>{var d=e?Q.resolve($.join2(r,e)):r;function f(t){function a(t){l&&l(),u||tr.createDataFile(r,e,t,n,o,c),i&&i(),O()}Browser.handledByPreloadPlugin(t,d,a,(()=>{s&&s(),O()}))||a(t)}N(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;a(r,(function(t){_(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&O()}),(function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()})),o&&N()}(t,(r=>f(r)),s):f(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=tr.indexedDB();try{var o=n.open(tr.DB_NAME(),tr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=()=>{d("creating db"),o.result.createObjectStore(tr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([tr.DB_STORE_NAME],"readwrite"),i=n.objectStore(tr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach((r=>{var e=i.put(tr.analyzePath(r).object.contents,r);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=tr.indexedDB();try{var o=n.open(tr.DB_NAME(),tr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([tr.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(tr.DB_STORE_NAME),s=0,u=0,c=r.length;function l(){0==u?e():t()}r.forEach((r=>{var e=a.get(r);e.onsuccess=()=>{tr.analyzePath(r).exists&&tr.unlink(r),tr.createDataFile($.dirname(r),$.basename(r),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=t},o.onerror=t}},nr={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=tr.cwd();else{var o=tr.getStream(r);if(!o)throw new tr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new tr.ErrnoError(44);return n}return $.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&$.normalize(e)!==$.normalize(tr.getPath(r.node)))return-54;throw r}return k[t>>2]=n.dev,k[t+4>>2]=0,k[t+8>>2]=n.ino,k[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,k[t+20>>2]=n.uid,k[t+24>>2]=n.gid,k[t+28>>2]=n.rdev,k[t+32>>2]=0,G=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],k[t+40>>2]=G[0],k[t+44>>2]=G[1],k[t+48>>2]=4096,k[t+52>>2]=n.blocks,k[t+56>>2]=n.atime.getTime()/1e3|0,k[t+60>>2]=0,k[t+64>>2]=n.mtime.getTime()/1e3|0,k[t+68>>2]=0,k[t+72>>2]=n.ctime.getTime()/1e3|0,k[t+76>>2]=0,G=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],k[t+80>>2]=G[0],k[t+84>>2]=G[1],0},doMsync:function(r,e,t,n,o){var i=g.slice(r,r+t);tr.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=$.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),tr.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return tr.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=tr.readlink(r),o=Math.min(t,M(n)),i=E[e+o];return F(n,g,e,t+1),E[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t=tr.lookupPath(r,{follow:!0}).node;if(!t)return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&tr.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=tr.getStream(t);return n&&tr.close(n),tr.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e+8*i>>2],s=k[e+(8*i+4)>>2],u=tr.read(r,E,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e+8*i>>2],s=k[e+(8*i+4)>>2],u=tr.write(r,E,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return nr.varargs+=4,k[nr.varargs-4>>2]},getStr:function(r){return x(r)},getStreamFromFD:function(r){var e=tr.getStream(r);if(!e)throw new tr.ErrnoError(8);return e},get64:function(r,e){return r}};var or=[];function ir(r){try{return m.grow(r-y.byteLength+65535>>>16),R(m.buffer),1}catch(r){}}var ar={};function sr(){if(!sr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var e in ar)void 0===ar[e]?delete r[e]:r[e]=ar[e];var t=[];for(var e in r)t.push(e+"="+r[e]);sr.strings=t}return sr.strings}var ur=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=tr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,lr=146;function dr(r,e,t){var n=t>0?t:M(r)+1,o=new Array(n),i=F(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&lr)===lr},set:function(r){r?this.mode|=lr:this.mode&=-147}},isFolder:{get:function(){return tr.isDir(this.mode)}},isDevice:{get:function(){return tr.isChrdev(this.mode)}}}),tr.FSNode=ur,tr.staticInit();var fr={s:function(r,e){return function(r,e){var t;if(0===r)t=Date.now();else{if(1!==r&&4!==r)return K(28),-1;t=V()}return k[e>>2]=t/1e3|0,k[e+4>>2]=t%1e3*1e3*1e3|0,0}(r,e)},j:function(r,e,t,n){try{return e=nr.getStr(e),e=nr.calculateAt(r,e),nr.doAccess(e,t)}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},i:function(r,e,t){nr.varargs=t;try{var n=nr.getStreamFromFD(r);switch(e){case 0:return(o=nr.get())<0?-28:tr.open(n.path,n.flags,0,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=nr.get();return n.flags|=o,0;case 5:o=nr.get();return b[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return K(28),-1}}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},z:function(r,e){try{var t=nr.getStreamFromFD(r);return nr.doStat(tr.stat,t.path,e)}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},x:function(r,e,t,n){try{e=nr.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=nr.calculateAt(r,e,i),nr.doStat(o?tr.lstat:tr.stat,e,t)}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},A:function(r,e,t){nr.varargs=t;try{var n=nr.getStreamFromFD(r);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=nr.get();return k[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=nr.get();return tr.ioctl(n,e,o);default:L("bad ioctl syscall "+e)}}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},d:function(r,e,t){nr.varargs=t;try{var n=nr.getStr(r),o=t?nr.get():0;return tr.open(n,e,o).fd}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},y:function(r,e){try{return r=nr.getStr(r),nr.doStat(tr.stat,r,e)}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},r:function(r){try{return r=nr.getStr(r),tr.unlink(r),0}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},p:function(){throw 1/0},t:function(r,e,t,n,o,i,a,s){try{var u=tr.getStream(o);if(!u)return-8;var c=tr.mmap(u,r,e,i,t,n),l=c.ptr;return k[a>>2]=c.allocated,l}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},u:function(r,e,t,n,o,i){try{var a=tr.getStream(o);a&&(2&t&&nr.doMsync(r,a,e,n,i),tr.munmap(a))}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return-r.errno}},o:function(){L("")},C:function(r,e,t){var n=function(r,e){var t;for(or.length=0,e>>=2;t=g[r++];){var n=t<105;n&&1&e&&e++,or.push(n?D[e++>>1]:k[e]),++e}return or}(e,t);return J[r].apply(null,n)},B:function(r,e,t){g.copyWithin(r,e,e+t)},q:function(r){var e,t,n=g.length,o=2147483648;if((r>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,r+100663296),ir(Math.min(o,(e=Math.max(r,a))+((t=65536)-e%t)%t)))return!0}return!1},v:function(r,e){var t=0;return sr().forEach((function(n,o){var i=e+t;k[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)E[e++>>0]=r.charCodeAt(n);t||(E[e>>0]=0)}(n,i),t+=n.length+1})),0},w:function(r,e){var t=sr();k[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),k[e>>2]=n,0},e:function(r){!function(r,e){!function(r){v||(o.onExit&&o.onExit(r),w=!0);c(r,new Ar(r))}(r)}(r)},c:function(r){try{var e=nr.getStreamFromFD(r);return tr.close(e),0}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return r.errno}},g:function(r,e,t,n){try{var o=nr.getStreamFromFD(r),i=nr.doReadv(o,e,t);return k[n>>2]=i,0}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return r.errno}},n:function(r,e,t,n,o){try{var i=nr.getStreamFromFD(r),a=4294967296*t+(e>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(tr.llseek(i,a,n),G=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],k[o>>2]=G[0],k[o+4>>2]=G[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return r.errno}},h:function(r,e,t,n){try{var o=nr.getStreamFromFD(r),i=nr.doWritev(o,e,t);return k[n>>2]=i,0}catch(r){if(void 0===tr||!(r instanceof tr.ErrnoError))throw r;return r.errno}},b:function(){return h},k:function(r){var e=Date.now();return k[r>>2]=e/1e3|0,k[r+4>>2]=e%1e3*1e3|0,0},l:function(r,e,t,n,o,i,a){var s=Dr();try{return Y(r)(e,t,n,o,i,a)}catch(r){if(Sr(s),r!==r+0)throw r;kr(1,0)}},m:function(r,e){var t=Dr();try{Y(r)(e)}catch(r){if(Sr(t),r!==r+0)throw r;kr(1,0)}},a:function(r){h=r},f:function(r){var e=Date.now()/1e3|0;return r&&(k[r>>2]=e),e}};!function(){var r={a:fr};function e(r,e){var t,n=r.exports;o.asm=n,R((m=o.asm.D).buffer),S=o.asm.M,t=o.asm.E,j.unshift(t),O()}function t(r){e(r.instance)}function i(e){return(p||"function"!=typeof fetch?Promise.resolve().then((function(){return W(I)})):fetch(I,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+I+"\'";return r.arrayBuffer()})).catch((function(){return W(I)}))).then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){f("failed to asynchronously prepare wasm: "+r),L(r)}))}if(N(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return f("Module.instantiateWasm callback failed with error: "+r),!1}(p||"function"!=typeof WebAssembly.instantiateStreaming||q(I)||"function"!=typeof fetch?i(t):fetch(I,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(r){return f("wasm streaming compile failed: "+r),f("falling back to ArrayBuffer instantiation"),i(t)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.E).apply(null,arguments)};var pr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(pr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.F).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(hr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.G).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_version_0=function(){return(mr=o._emscripten_bind_Graphviz_version_0=o.asm.H).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_lastError_0=function(){return(vr=o._emscripten_bind_Graphviz_lastError_0=o.asm.I).apply(null,arguments)},wr=o._emscripten_bind_Graphviz_layout_3=function(){return(wr=o._emscripten_bind_Graphviz_layout_3=o.asm.J).apply(null,arguments)},_r=o._emscripten_bind_Graphviz_createFile_2=function(){return(_r=o._emscripten_bind_Graphviz_createFile_2=o.asm.K).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.L).apply(null,arguments)};o._malloc=function(){return(o._malloc=o.asm.N).apply(null,arguments)},o._free=function(){return(o._free=o.asm.O).apply(null,arguments)};var Er,gr=o.___errno_location=function(){return(gr=o.___errno_location=o.asm.P).apply(null,arguments)},br=o._emscripten_builtin_memalign=function(){return(br=o._emscripten_builtin_memalign=o.asm.Q).apply(null,arguments)},kr=o._setThrew=function(){return(kr=o._setThrew=o.asm.R).apply(null,arguments)},Dr=o.stackSave=function(){return(Dr=o.stackSave=o.asm.S).apply(null,arguments)},Sr=o.stackRestore=function(){return(Sr=o.stackRestore=o.asm.T).apply(null,arguments)};function Ar(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function Pr(r){function e(){Er||(Er=!0,o.calledRun=!0,w||(o.noFSInit||tr.init.initialized||tr.init(),tr.ignorePermissions=!1,X(j),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;X(z)}()))}T>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),C.unshift(r);var r;X(C)}(),T>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(B=function r(){Er||Pr(),Er||(B=r)},o.run=Pr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function xr(){}function Fr(r){return(r||xr).__cache__}function Mr(r,e){var t=Fr(e),n=t[r];return n||((n=Object.create((e||xr).prototype)).ptr=r,t[r]=n)}Pr(),xr.prototype=Object.create(xr.prototype),xr.prototype.constructor=xr,xr.prototype.__class__=xr,xr.__cache__={},o.WrapperObject=xr,o.getCache=Fr,o.wrapPointer=Mr,o.castObject=function(r,e){return Mr(r.ptr,e)},o.NULL=Mr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Fr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Rr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Rr.needed){for(var r=0;r<Rr.temps.length;r++)o._free(Rr.temps[r]);Rr.temps.length=0,o._free(Rr.buffer),Rr.buffer=0,Rr.size+=Rr.needed,Rr.needed=0}Rr.buffer||(Rr.size+=128,Rr.buffer=o._malloc(Rr.size),_(Rr.buffer)),Rr.pos=0},alloc:function(r,e){_(Rr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Rr.pos+i>=Rr.size?(_(i>0),Rr.needed+=i,t=o._malloc(i),Rr.temps.push(t)):(t=Rr.buffer+Rr.pos,Rr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Cr(r){if("string"==typeof r){var e=dr(r),t=Rr.alloc(e,E);return Rr.copy(e,E,t),t}return r}function jr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function zr(r,e){r&&"object"==typeof r&&(r=r.ptr),e&&"object"==typeof e&&(e=e.ptr),this.ptr=hr(r,e),Fr(zr)[this.ptr]=this}return jr.prototype=Object.create(xr.prototype),jr.prototype.constructor=jr,jr.prototype.__class__=jr,jr.__cache__={},o.VoidPtr=jr,jr.prototype.__destroy__=jr.prototype.__destroy__=function(){var r=this.ptr;pr(r)},zr.prototype=Object.create(xr.prototype),zr.prototype.constructor=zr,zr.prototype.__class__=zr,zr.__cache__={},o.Graphviz=zr,zr.prototype.version=zr.prototype.version=function(){var r=this.ptr;return x(mr(r))},zr.prototype.lastError=zr.prototype.lastError=function(){var r=this.ptr;return x(vr(r))},zr.prototype.layout=zr.prototype.layout=function(r,e,t){var n=this.ptr;return Rr.prepare(),r=r&&"object"==typeof r?r.ptr:Cr(r),e=e&&"object"==typeof e?e.ptr:Cr(e),t=t&&"object"==typeof t?t.ptr:Cr(t),x(wr(n,r,e,t))},zr.prototype.createFile=zr.prototype.createFile=function(r,e){var t=this.ptr;Rr.prepare(),r=r&&"object"==typeof r?r.ptr:Cr(r),e=e&&"object"==typeof e?e.ptr:Cr(e),_r(t,r,e)},zr.prototype.__destroy__=zr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},e.ready}})();r.exports=t}(u);var c=u.exports,l=Object.freeze(e({__proto__:null,default:c},[u.exports])),d=function(){return d=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},d.apply(this,arguments)},f=function(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))};function p(r){return{path:r.path,data:\'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\\n<svg width="\'.concat(r.width,\'" height="\').concat(r.height,\'"></svg>\')}}function h(r,e){var t,n=d({images:[],files:[]},e);f(f([],n.files,!0),(t=n.images,t.map(p)),!0).forEach((function(e){return r.createFile(e.path,e.data)}))}var m={layout:function(r,e,t,n){return void 0===e&&(e="svg"),void 0===t&&(t="dot"),r?s(l,null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then((function(o){var i=new o.Graphviz(void 0!==(null==n?void 0:n.yInvert)&&(null==n?void 0:n.yInvert),void 0!==(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);h(i,n);var a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a})):Promise.resolve("")},circo:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"circo",t)},dot:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"dot",t)},fdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"fdp",t)},sfdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"sfdp",t)},neato:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"neato",t)},osage:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"osage",t)},patchwork:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"patchwork",t)},twopi:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"twopi",t)}},v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var w={exports:{}};\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */function _(r){return void 0!==r.children}!function(r,e){r.exports=function(){function r(r){var e=typeof r;return null!==r&&("object"===e||"function"===e)}function e(r){return"function"==typeof r}var t=Array.isArray?Array.isArray:function(r){return"[object Array]"===Object.prototype.toString.call(r)},n=0,o=void 0,i=void 0,a=function(r,e){E[n]=r,E[n+1]=e,2===(n+=2)&&(i?i(g):k())};function s(r){i=r}function u(r){a=r}var c="undefined"!=typeof window?window:void 0,l=c||{},d=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){return function(){return process.nextTick(g)}}function m(){return void 0!==o?function(){o(g)}:y()}function w(){var r=0,e=new d(g),t=document.createTextNode("");return e.observe(t,{characterData:!0}),function(){t.data=r=++r%2}}function _(){var r=new MessageChannel;return r.port1.onmessage=g,function(){return r.port2.postMessage(0)}}function y(){var r=setTimeout;return function(){return r(g,1)}}var E=new Array(1e3);function g(){for(var r=0;r<n;r+=2)(0,E[r])(E[r+1]),E[r]=void 0,E[r+1]=void 0;n=0}function b(){try{var r=Function("return this")().require("vertx");return o=r.runOnLoop||r.runOnContext,m()}catch(r){return y()}}var k=void 0;function D(r,e){var t=this,n=new this.constructor(P);void 0===n[A]&&J(n);var o=t._state;if(o){var i=arguments[o-1];a((function(){return G(o,n,i,t._result)}))}else U(t,n,r,e);return n}function S(r){var e=this;if(r&&"object"==typeof r&&r.constructor===e)return r;var t=new e(P);return N(t,r),t}k=f?h():d?w():p?_():void 0===c?b():y();var A=Math.random().toString(36).substring(2);function P(){}var x=void 0,F=1,M=2;function R(){return new TypeError("You cannot resolve a promise with itself")}function C(){return new TypeError("A promises callback cannot return that same promise.")}function j(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}function z(r,e,t){a((function(r){var n=!1,o=j(t,e,(function(t){n||(n=!0,e!==t?N(r,t):L(r,t))}),(function(e){n||(n=!0,I(r,e))}),"Settle: "+(r._label||" unknown promise"));!n&&o&&(n=!0,I(r,o))}),r)}function T(r,e){e._state===F?L(r,e._result):e._state===M?I(r,e._result):U(e,void 0,(function(e){return N(r,e)}),(function(e){return I(r,e)}))}function B(r,t,n){t.constructor===r.constructor&&n===D&&t.constructor.resolve===S?T(r,t):void 0===n?L(r,t):e(n)?z(r,t,n):L(r,t)}function N(e,t){if(e===t)I(e,R());else if(r(t)){var n=void 0;try{n=t.then}catch(r){return void I(e,r)}B(e,t,n)}else L(e,t)}function O(r){r._onerror&&r._onerror(r._result),H(r)}function L(r,e){r._state===x&&(r._result=e,r._state=F,0!==r._subscribers.length&&a(H,r))}function I(r,e){r._state===x&&(r._state=M,r._result=e,a(O,r))}function U(r,e,t,n){var o=r._subscribers,i=o.length;r._onerror=null,o[i]=e,o[i+F]=t,o[i+M]=n,0===i&&r._state&&a(H,r)}function H(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?G(t,n,o,i):o(i);r._subscribers.length=0}}function G(r,t,n,o){var i=e(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void I(t,C())}else a=o;t._state!==x||(i&&u?N(t,a):!1===u?I(t,s):r===F?L(t,a):r===M&&I(t,a))}function q(r,e){try{e((function(e){N(r,e)}),(function(e){I(r,e)}))}catch(e){I(r,e)}}var W=0;function V(){return W++}function J(r){r[A]=W++,r._state=void 0,r._result=void 0,r._subscribers=[]}function X(){return new Error("Array Methods must be provided an Array")}var Y=function(){function r(r,e){this._instanceConstructor=r,this.promise=new r(P),this.promise[A]||J(this.promise),t(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):I(this.promise,X())}return r.prototype._enumerate=function(r){for(var e=0;this._state===x&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===S){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===D&&r._state!==x)this._settledAt(r._state,e,r._result);else if("function"!=typeof o)this._remaining--,this._result[e]=r;else if(t===er){var s=new t(P);a?I(s,i):B(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t((function(e){return e(r)})),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===x&&(this._remaining--,r===M?I(n,t):this._result[e]=t),0===this._remaining&&L(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;U(r,void 0,(function(r){return t._settledAt(F,e,r)}),(function(r){return t._settledAt(M,e,r)}))},r}();function K(r){return new Y(this,r).promise}function $(r){var e=this;return t(r)?new e((function(t,n){for(var o=r.length,i=0;i<o;i++)e.resolve(r[i]).then(t,n)})):new e((function(r,e){return e(new TypeError("You must pass an array to race."))}))}function Q(r){var e=new this(P);return I(e,r),e}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function rr(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}var er=function(){function r(e){this[A]=V(),this._result=this._state=void 0,this._subscribers=[],P!==e&&("function"!=typeof e&&Z(),this instanceof r?q(this,e):rr())}return r.prototype.catch=function(r){return this.then(null,r)},r.prototype.finally=function(r){var t=this,n=t.constructor;return e(r)?t.then((function(e){return n.resolve(r()).then((function(){return e}))}),(function(e){return n.resolve(r()).then((function(){throw e}))})):t.then(r,r)},r}();function tr(){var r=void 0;if(void 0!==v)r=v;else if("undefined"!=typeof self)r=self;else try{r=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if("[object Promise]"===t&&!e.cast)return}r.Promise=er}return er.prototype.then=D,er.all=K,er.race=$,er.resolve=S,er.reject=Q,er._setScheduler=s,er._setAsap=u,er._asap=a,er.polyfill=tr,er.Promise=er,er}()}(w),w.exports.polyfill();var y=function(r){var e=[];return r.children.forEach((function(r){_(r)?e.push(y(r)):e.push(E(r))})),"subgraph cluster_".concat(r.id,\' {\\nid="\').concat(r.id,\'";\\nlabel="\').concat(r.text,\'";\\nmargin=16;\\n\').concat(e.join("\\n"),"\\n}")},E=function(r){return"".concat(r.id,\' [id="\').concat(r.id,\'" label="\').concat(r.text,\'" width=\').concat(k(r.width)," height=").concat(k(r.height),"]")},g=function(r){return 96*r/72},b=function(r){return 96*r},k=function(r){return r/96};function D(r){var e=r?r.split(",").map((function(r){return g(+r)})):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function S(r,e){var t=r.split(",").map((function(r){return g(+r)})),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function A(r,e,t){return void 0===t&&(t="json"),m[r](e,t).then((function(r){return"json"===t?JSON.parse(r):r}))}function P(e,t){if(self.document=self.document||{currentScript:{src:t.wasmFolder+"/dummy.js"}},e.raw)return A(t.engine,e.raw,"svg");var n={},o=[],i=[],a={},s=[],u=[],c={},l=[],d=[];function f(r,e){_(r)?(n[r.id]=r,o.push(r),r.children.forEach((function(r){return f(r,!1)})),e&&i.push(y(r))):(a[r.id]=r,s.push(r),e&&u.push(E(r)))}return e.items.forEach((function(r){return f(r,!0)})),e.links.forEach((function(r){var e,t,n,o;c[r.id]=r,l.push(r),d.push((e=r.source.id,t=r.target.id,n=r.id,o=r.text,"".concat(e," -> ").concat(t,\' [id="\').concat(n,\'", label="\').concat(o,\'"]\')))})),A(t.engine,"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n".concat(i.join("\\n"),"\\n\\n").concat(d.join("\\n"),"\\n\\n").concat(u.join("\\n"),"\\n}")).then((function(e){var t=D(e.bb);return e.objects&&e.objects.forEach((function(r){if(r.nodes){var e=function(r,e){var t=D(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,l=r.height,d=S(u,t),f=b(+c),p=b(+l),{x:d.x,y:d.y,width:f,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,l,d,f,p})),e.edges&&e.edges.forEach((function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(" ").map((function(r){return S(r,t)})).map((function(r){return[r.x-t.width/2,r.y-t.height/2]})),o=n.shift();return r(r([],n,!0),[o],!1)}return[]}(e,t))})),{clusters:o,nodes:s,links:l}}))}self.onmessage=function(r){P.apply(void 0,r.data).then((function(r){self.postMessage(r)}))}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise((function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])}))}}var eo=E().x((function(e){return e[0]})).y((function(e){return e[1]})).curve(I),to=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o._engine=r,o._wasmFolder=n,o}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData(),o={};return Zn({items:n.hierarchy((function(e,t,r){switch(e){case"subgraph":return{id:t.id,text:t.props.text,children:r};case"vertex":delete t.fx,delete t.fy;var n=t.element.node().getBBox(),i={id:t.id,text:t.props.text,width:n.width,height:n.height};return o[i.id]=i,i}})),links:n.allEdges().map((function(e){return{id:e.props.id,source:o[e.source.id],target:o[e.target.id],text:e.props.label||""}})),raw:""},{engine:this._engine,wasmFolder:this._wasmFolder}).response.then((function(e){return t.running()&&(e.clusters.forEach((function(e){var t=n.subgraph(e.id);t.x=e.x+r.width/2-e.width,t.y=e.y+r.height/2-e.height,t.props.width=e.width,t.props.height=e.height})),e.nodes.forEach((function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2})),e.links.forEach((function(e){var t=n.edge(e.id);t.points=h(h([[t.source.x,t.source.y]],void 0!==e.points?e.points.map((function(e){return[e[0]+r.width/2,e[1]+r.height/2]})):[],!0),[[t.target.x,t.target.y]],!1)})),t._graph.moveSubgraphs(!0).moveVertices(!0).moveEdges(!0),t.stop()),t}))},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map((function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]}))),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:eo(o),labelPos:this.center(o)}},t}(Gn),ro=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){return t.stop(),t}))},t}(Gn);function no(e,t){return e.parent===t.parent?1:2}function oo(e,t){return e+t.x}function io(e,t){return Math.max(e,t.y)}function ao(){var e=no,t=1,r=1,n=!1;function o(o){var i,a=0;o.eachAfter((function(t){var r=t.children;r?(t.x=function(e){return e.reduce(oo,0)/e.length}(r),t.y=function(e){return 1+e.reduce(io,0)}(r)):(t.x=i?a+=e(t,i):0,t.y=0,i=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(o),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(o),c=s.x-e(s,u)/2,l=u.x+e(u,s)/2;return o.eachAfter(n?function(e){e.x=(e.x-o.x)*t,e.y=(o.y-e.y)*r}:function(e){e.x=(e.x-c)/(l-c)*t,e.y=(1-(o.y?e.y/o.y:1))*r})}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}function so(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function uo(e,t){var r,n,o,i,a,s=new fo(e),u=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=co);r=c.pop();)if(u&&(r.value=+r.data.value),(o=t(r.data))&&(a=o.length))for(r.children=new Array(a),i=a-1;i>=0;--i)c.push(n=r.children[i]=new fo(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(ho)}function co(e){return e.children}function lo(e){e.data=e.data.data}function ho(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function fo(e){this.data=e,this.depth=this.height=0,this.parent=null}function po(e,t){return e.parent===t.parent?1:2}function go(e){var t=e.children;return t?t[0]:e.t}function yo(e){var t=e.children;return t?t[t.length-1]:e.t}function vo(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function _o(e,t,r){return e.a.parent===t.parent?e.a:r}function mo(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function bo(){var e=po,t=1,r=1,n=null;function o(o){var u=function(e){for(var t,r,n,o,i,a=new mo(e,0),s=[a];t=s.pop();)if(n=t._.children)for(t.children=new Array(i=n.length),o=i-1;o>=0;--o)s.push(r=t.children[o]=new mo(n[o],o)),r.parent=t;return(a.parent=new mo(null,0)).children=[a],a}(o);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(a),n)o.eachBefore(s);else{var c=o,l=o,h=o;o.eachBefore((function(e){e.x<c.x&&(c=e),e.x>l.x&&(l=e),e.depth>h.depth&&(h=e)}));var d=c===l?1:e(c,l)/2,f=d-c.x,p=t/(l.x+d+f),g=r/(h.depth||1);o.eachBefore((function(e){e.x=(e.x+f)*p,e.y=e.depth*g}))}return o}function i(t){var r=t.children,n=t.parent.children,o=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,o=e.children,i=o.length;--i>=0;)(t=o[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var i=(r[0].z+r[r.length-1].z)/2;o?(t.z=o.z+e(t._,o._),t.m=t.z-i):t.z=i}else o&&(t.z=o.z+e(t._,o._));t.parent.A=function(t,r,n){if(r){for(var o,i=t,a=t,s=r,u=i.parent.children[0],c=i.m,l=a.m,h=s.m,d=u.m;s=yo(s),i=go(i),s&&i;)u=go(u),(a=yo(a)).a=t,(o=s.z+h-i.z-c+e(s._,i._))>0&&(vo(_o(s,t,n),t,o),c+=o,l+=o),h+=s.m,c+=i.m,d+=u.m,l+=a.m;s&&!yo(a)&&(a.t=s,a.m+=h-l),i&&!go(u)&&(u.t=i,u.m+=c-d,n=t)}return n}(t,o,t.parent.A||n[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=t._graph.size(),r=t._graph.graphData();return r.allEdges().forEach((function(e){return delete e.points})),r.allVertices().forEach((function(t){delete t.fx,delete t.fy,t.x=e.width/2+5*Math.random()-2.5,t.y=e.height/2+5*Math.random()-2.5})),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t}))}}(Gn),fo.prototype=uo.prototype={constructor:fo,count:function(){return this.eachAfter(so)},each:function(e){var t,r,n,o,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(e(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;o=a.pop();)e(o);return this},eachBefore:function(e){for(var t,r,n=this,o=[n];n=o.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)o.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;e=r.pop(),t=n.pop();for(;e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return uo(this).eachBefore(lo)}},mo.prototype=Object.create(fo.prototype);var wo=A().x((function(e){return e.x})).y((function(e){return e.y})),xo=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=e),void 0===n&&(n=t),this.x1=e,this.y1=t,this.x2=r,this.y2=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.x2-this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.y2-this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return{x:this.x1+this.width/2,y:this.y1+this.height/2}},enumerable:!1,configurable:!0}),e.prototype.reset=function(e,t){this.x1=e,this.x2=e,this.y1=t,this.y2=t},e.prototype.expand=function(e,t){this.x1>e?this.x1=e:this.x2<e&&(this.x2=e),this.y1>t?this.y1=t:this.y2<t&&(this.y2=t)},e}(),Eo=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n._visited={},n}return s(t,e),t.prototype.sortTree=function(e,t){var r=this;t||(t=this._tree),t.children.sort((function(t,r){return e.neighbors(r.origData.id).length-e.neighbors(t.origData.id).length}));var n=[];t.children.forEach((function(e,t){t%2==0?n.push(e):n.unshift(e)})),t.children=n,t.children.forEach((function(t){return r.sortTree(e,t)}))},t.prototype.depthFirst=function(e,t,r){var n=this;if(void 0===r&&(this._visited={},this._tree=void 0),!this._visited[t.id]){this._visited[t.id]=t;var o={origData:t,children:[]};void 0===r?this._tree=o:r.children.push(o),e.neighbors(t.id).forEach((function(t){return n.depthFirst(e,t,o)}))}},t.prototype.breadthFirst=function(e,t){var r=this;this._visited={},this._visited[t.id]=t,this._tree={origData:t,children:[]};var n=[];n.push(this._tree);for(var o=function(){var t=n.shift();e.neighbors(t.origData.id).forEach((function(e){if(!r._visited[e.id]){r._visited[e.id]=e;var o={origData:e,children:[]};t.children.push(o),n.push(o)}}))};n.length;)o();this.sortTree(e)},t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){for(var e,r=t._graph.graphData(),n=0,o=r.allVertices();n<o.length;n++){var i=o[n];if(delete i.fx,delete i.fy,void 0===e&&(e=i),i.centroid){e=i;break}}return r.allEdges().forEach((function(e){return delete e.points})),t.breadthFirst(r,e),t._d3Hierarchy=uo(t._tree),t}))},t.prototype.finalize=function(e){var t=this._graph.size(),r=new xo;e.forEach((function(e,t){0===t?r.reset(e.origData.x,e.origData.y):r.expand(e.origData.x,e.origData.y)}));var n=t.width/2-r.center.x,o=t.height/2-r.center.y;e.forEach((function(e){e.origData.x+=n,e.origData.y+=o})),this._graph.moveVertices(!0).moveEdges(!0),this.stop()},t}(Gn),ko=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=bo().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map((function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data}));return t.finalize(e),t}))},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:wo({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Eo),So=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=bo().size([2*Math.PI,512]).separation((function(e,t){return(e.parent==t.parent?1:2)/e.depth}))(t._d3Hierarchy).descendants().map((function(e){return e.data.origData.angle=e.x,e.data.origData.radius=e.y,e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data}));return t.finalize(e),t}))},t}(Eo),Do=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=ao().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map((function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data}));return t.finalize(e),t}))},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:wo({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Eo),Co=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then((function(){var e=ao().size([2*Math.PI,512]).separation((function(e,t){return(e.parent==t.parent?1:2)/e.depth}))(t._d3Hierarchy).descendants().map((function(e){return e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data}));return t.finalize(e),t}))},t}(Eo);Y(".graph_Graph2 .allowDragging .graphVertex,.graph_Graph2 .graphVertex{cursor:pointer}.graph_Graph2 .allowDragging .graphVertex.grabbed{cursor:grabbing}.graph_Graph2 .graphEdge{stroke:#a9a9a9;fill:none}.graph_Graph2 .graphEdge>text{stroke:none;fill:#000}.graph_Graph2 .graphEdge.hide-text>text{display:none}.graph_Graph2 g.selected circle,.graph_Graph2 g.selected rect{stroke:red!important}");var Ao="".concat(r.getScriptSrc("/graph/lib-umd/graph2/graph")||r.getScriptSrc("/graph/dist/index")||".","/graph/dist"),Mo=function(e){e.fx=e.sx=e.x,e.fy=e.sy=e.y},Fo=function(e,t){e.fx=e.sx+t.fx-t.sx,e.fy=e.sy+t.fy-t.sy},Io=function(e){e.x=e.fx,e.y=e.fy,e.fx=e.sx=void 0,e.fy=e.sy=void 0},Po=function(e){function n(){var n=e.call(this)||this;n._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",(function(){return n.layoutClick("Hierarchy")})),n._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",(function(){return n.layoutClick("ForceDirected")})),n._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",(function(){return n.layoutClick("ForceDirected2")})),n._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",(function(){return n.layoutClick("Circle")})),n._toggleDot=(new t.ToggleButton).faChar("fa-angle-double-down").tooltip("DOT").on("click",(function(){return n.layoutClick("DOT")})),n._toggleNeato=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Neato").on("click",(function(){return n.layoutClick("Neato")})),n._toggleFDP=(new t.ToggleButton).faChar("fa-asterisk").tooltip("FDP").on("click",(function(){return n.layoutClick("FDP")})),n._toggleTwoPI=(new t.ToggleButton).faChar("fa-bullseye").tooltip("TwoPI").on("click",(function(){return n.layoutClick("TwoPI")})),n._toggleCirco=(new t.ToggleButton).faChar("fa-cogs").tooltip("Circo").on("click",(function(){return n.layoutClick("Circo")})),n._toggleT=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Tree").on("click",(function(){return n.layoutClick("Tree")})),n._toggleRT=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Radial Tree").on("click",(function(){return n.layoutClick("RadialTree")})),n._toggleD=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Dendrogram").on("click",(function(){return n.layoutClick("Dendrogram")})),n._toggleRD=(new t.ToggleButton).faChar("fa-asterisk").tooltip("Radial Dendrogram").on("click",(function(){return n.layoutClick("RadialDendrogram")})),n._graphData=(new r.Graph2).idFunc((function(e){return e.id})).sourceFunc((function(e){return e.source.id})).targetFunc((function(e){return e.target.id})).updateFunc((function(e,t){return e.props=t.props,e})),n._prevDoClickTime=0,n._tooltip=new i.HTMLTooltip,n._selection=new t.Utility.Selection(n),n._dragHandler=t.drag(),n._catPalette=t.Palette.ordinal("hpcc10"),n._categories=[],n._annotations=[],n._origData={subgraphs:[],vertices:[],edges:[],hierarchy:[]},n._layoutAlgo=new ro(n),n.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},n._centroidRenderer=o.Vertex,n._vertexRenderer=o.Vertex,n._transformScale=1;var a=n;n._drawStartPos="origin";var s=[n._toggleHierarchy,n._toggleForceDirected,n._toggleForceDirected2,n._toggleCircle,new t.Spacer,n._toggleDot,n._toggleNeato,n._toggleFDP,n._toggleTwoPI,n._toggleCirco,new t.Spacer,n._toggleT,n._toggleRT,n._toggleD,n._toggleRD,new t.Spacer];return n._iconBar.buttons(s.concat(n._iconBar.buttons())),n._dragHandler.on("start",(function(e){if(a.allowDragging()){t.select(this).classed("grabbed",!0),Mo(e),t.Utility.safeRaise(this),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter((function(t){return t.id!==e.props.id})).forEach((function(e){var t=a._graphData.vertex(e.id);Mo(t)})):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach((function(e){Mo(e)}))}})).on("drag",(function(e){if(a.allowDragging()){e.fx=e.sx+a.rproject(t.d3Event().x-e.sx),e.fy=e.sy+a.rproject(t.d3Event().y-e.sy),a._graphData.vertexEdges(e.id).forEach((function(e){return delete e.points})),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter((function(t){return t.id!==e.props.id})).forEach((function(t){var r=a._graphData.vertex(t.id);Fo(r,e),a.moveVertexPlaceholder(r,!1,!0)})):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach((function(t){Fo(t,e),a.moveVertexPlaceholder(t,!1,!0)}))}})).on("end",(function(e){var r=!0;if(a.allowDragging()){r=Math.abs(e.sx-e.fx)<1&&Math.abs(e.sy-e.fy)<1,Io(e);var n=a.selection();a.selected(e.props,n)?n.filter((function(t){return t.id!==e.props.id})).forEach((function(e){var t=a._graphData.vertex(e.id);Io(t)})):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(Io),t.select(this).classed("grabbed",!1)}if(r){a._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event().sourceEvent),a.selectionChanged();var o=e.element.classed("selected");a.vertex_click(e.props.origData||e.props,"",o);var i=Date.now();i-a._prevDoClickTime<a.doubleClickMaxDelay()&&a.vertex_dblclick(e.props.origData||e.props,"",o),a._prevDoClickTime=i}})).filter((function(){return!0})),n.zoomToFitLimit(1),n}return s(n,e),n.prototype.iconBarButtons=function(){return this._iconBar.buttons()},n.prototype.categories=function(e){return void 0===e?this._categories:(this._categories=e,this)},n.prototype.annotations=function(e){return void 0===e?this._annotations:(this._annotations=e,this)},n.prototype.data=function(e,t){var r=this;return void 0===e?this._origData:(this._origData=e,this._graphData.mergeSubgraphs((e.subgraphs||[]).map((function(e){return{id:e.id,props:e}}))),this._graphData.mergeVertices((e.vertices||[]).map((function(e){return{id:e.id,centroid:e.centroid,props:e}}))),this._graphData.mergeEdges((e.edges||[]).filter((function(e){return r._graphData.vertexExists(e.source.id)&&r._graphData.vertexExists(e.target.id)})).map((function(e){return{id:e.id,props:e,source:r._graphData.vertex(e.source.id),target:r._graphData.vertex(e.target.id)}}))),this._graphData.clearParents(),(e.hierarchy?e.hierarchy:[]).forEach((function(e){r._graphData.subgraphExists(e.child.id)?r._graphData.subgraphParent(e.child.id,e.parent.id):r._graphData.vertexExists(e.child.id)&&r._graphData.vertexParent(e.child.id,e.parent.id)})),this)},n.prototype.selected=function(e,t){return(t||this.selection()).some((function(t){return t.id===e.id}))},n.prototype.selection=function(e){var t=this;return arguments.length?(this._selection.set(e.map((function(e){var r=t._graphData.item(e.id);return{_id:r.id,element:function(){return r.element}}}))),this):this._selection.get().map((function(e){return t._graphData.item(e._id).props}))},n.prototype.graphData=function(){return this._graphData},n.prototype.resetLayout=function(){return delete this._prevLayout,this},n.prototype.layoutRunning=function(){return this._layoutAlgo&&this._layoutAlgo.running()},n.prototype.layoutAlgo=function(e){var t=this;return this._layoutAlgo&&this._layoutAlgo.stop(),this._layoutAlgo=e,this._layoutAlgo.start().then((function(){t.updateIconBar(),t.applyScaleOnLayout()&&setTimeout((function(){t.zoomToFit()}),t.transitionDuration())}))},n.prototype.layoutClick=function(e){this.layoutRunning()?(this._layoutAlgo.stop(),this.updateIconBar()):(delete this._prevLayout,this.layout(e).render())},n.prototype.updateIconBarItem=function(e,t){var r=this.layout(),n=this._layoutAlgo&&this._layoutAlgo.running();e.enabled(!n||r===t).selected(n&&r===t).render()},n.prototype.updateIconBar=function(){e.prototype.updateIconBar.call(this),this.updateIconBarItem(this._toggleHierarchy,"Hierarchy"),this.updateIconBarItem(this._toggleDot,"DOT"),this.updateIconBarItem(this._toggleForceDirected,"ForceDirected"),this.updateIconBarItem(this._toggleNeato,"Neato"),this.updateIconBarItem(this._toggleFDP,"FDP"),this.updateIconBarItem(this._toggleForceDirected2,"ForceDirected2"),this.updateIconBarItem(this._toggleCircle,"Circle"),this.updateIconBarItem(this._toggleTwoPI,"TwoPI"),this.updateIconBarItem(this._toggleCirco,"Circo"),this.updateIconBarItem(this._toggleT,"Tree"),this.updateIconBarItem(this._toggleRT,"RadialTree"),this.updateIconBarItem(this._toggleD,"Dendrogram"),this.updateIconBarItem(this._toggleRD,"RadialDendrogram")},n.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.vertexEdges(e.id),o=0;o<n.length;++o){var i=this._graphData.edge(n[o].id);r[i.id]=i,i.source.id!==e.id&&(t[i.source.id]=i.source),i.target.id!==e.id&&(t[i.target.id]=i.target)}return{vertices:t,edges:r}},n.prototype.centerOnItem=function(e){var t,r,n,o=this._graphData.item(e);if((this._graphData.isSubgraph(o)||this._graphData.isVertex(o))&&(r=o.x,n=o.y),this._graphData.isEdge(o)&&(r=(t=[0,0])[0],n=t[1]),void 0!==r&&void 0!==n){var i=o.element.node().getBBox();if(this._graphData.isVertex(o)){var a=this.projectPlacholder(o);r=a.x,n=a.y}else this._graphData.isSubgraph(o)&&(r=this.project(o.x),n=this.project(o.y));var s=i.x+i.width/2,u=i.y+i.height/2,c={x:r+s-i.width/2,y:n+u-i.height/2,width:i.width,height:i.height};this.centerOnBBox(c)}},n.prototype.hideVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!0),this},n.prototype.showVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!1),this},n.prototype.highlightVerticies=function(e){var t=this,r=this,n=this._vertexG.selectAll(".graphVertex"),i=!r.showVertexLabels()&&r.showVertexLabelsOnHighlight();return n.classed("graphVertex-highlighted",(function(t){return!e||e[t.id]})).style("filter",(function(r){return e&&e[r.id]?"url(#"+t.id()+"_glow)":null})).each((function(t){if(i){var n=r.calcProps(t.centroid,u({showLabel:!(!e||!e[t.id])},r.vertexMapper(t.props,t.props.origData)));o.render(t.centroid?r._centroidRenderer:r._vertexRenderer,n,this)}})).transition().duration(this.transitionDuration()).on("end",(function(t){e&&e[t.id]&&t.element.node()&&t.element.node().parentNode&&t.element.node().parentNode.appendChild(t.element.node())})).style("opacity",(function(t){return t.props.hidden?0:!e||e[t.id]?1:r.highlight.opacity})),this},n.prototype.highlightEdges=function(e){var t=this;return this._edgeG.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:t.edgeStrokeWidth()+"px"})).transition().duration(this.transitionDuration()).style("opacity",(function(r){return r.source.props.hidden||r.target.props.hidden?0:!e||e[r.id]?1:t.highlight.opacity})),this},n.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t.source.id]=t.source,r[t.target.id]=t.target;var n={};n[t.id]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.moveSubgraphPlaceholder=function(e,t){var r=this.project(e.x),n=this.project(e.y),i=this.project(e.props.width,!0),a=this.project(e.props.height,!0);return e.element&&(t?e.element.transition():e.element).attr("transform","translate(".concat(r," ").concat(n,")")).each((function(e){o.render(o.Subgraph,u(u({},e.props),{width:i,height:a}),this)})),this},n.prototype.moveEdgePlaceholder=function(e,t){var r,n,o=this._layoutAlgo.edgePath(e,this.edgeArcDepth());if(e.elementPath&&(t?e.elementPath.transition():e.elementPath).attr("d",o.path).attr("stroke-dasharray",(function(e){return e.props.strokeDasharray})),e.elementText){var i=null!==(n=null===(r=e.props.label)||void 0===r?void 0:r.split("\n"))&&void 0!==n?n:[];e.elementText.selectAll(".textLine").data(i,(function(e){return e})).join((function(e){return e.append("tspan").attr("class","textLine").attr("x",0)}),(function(e){return e.attr("dy",(function(e,t){return"".concat(t,"em")})).text((function(e){return e}))}),(function(e){return e.remove()})),(t?e.elementText.transition():e.elementText).attr("transform","translate(".concat(o.labelPos[0]," ").concat(o.labelPos[1],")")).attr("font-family",(function(e){return e.props.fontFamily||null}))}return this},n.prototype.moveVertexPlaceholder=function(e,t,r){var n=this,o=this.projectPlacholder(e),i=o.x,a=o.y;return e.element&&(t?e.element.transition():e.element).attr("transform","translate(".concat(i," ").concat(a,")")),r&&this._graphData.vertexEdges(e.id).forEach((function(e){return n.moveEdgePlaceholder(e,t)})),this},n.prototype.moveSubgraphs=function(e){var t=this;return this._graphData.allSubgraphs().forEach((function(r){return t.moveSubgraphPlaceholder(r,e)})),this},n.prototype.moveEdges=function(e){var t=this;return this._graphData.allEdges().forEach((function(r){return t.moveEdgePlaceholder(r,e)})),this},n.prototype.moveVertices=function(e){var t=this;return this._graphData.allVertices().forEach((function(r){return t.moveVertexPlaceholder(r,e,!1)})),this},n.prototype.project=function(e,t){void 0===t&&(t=!1);e=void 0!==e?e:0;var r=this._transformScale;return t&&(this._transformScale>this.maxScale()+(this._transformScale-this.maxScale())/2?r=this.maxScale()+(this._transformScale-this.maxScale())/2:(this._transformScale,this.minScale(),this._transformScale,this.minScale())),Math.round(e*r*10)/10},n.prototype.rproject=function(e){return e=void 0!==e?e:0,Math.round(e/this._transformScale*10)/10},n.prototype.projectPlacholder=function(e){return{x:this.project(void 0!==e.fx?e.fx:e.x),y:this.project(void 0!==e.fy?e.fy:e.y)}},n.prototype.categoryID=function(e,t){return void 0===t&&(t="cat"),void 0===e||""===e?"":"".concat(t).concat(this.id(),"_").concat(e)},n.prototype.updateCategories=function(){var e=this;o.render(o.Icons,{icons:this._categories.map((function(t){return u(u({},t),{id:e.categoryID(t.id),fill:t.fill||"transparent",imageCharFill:t.imageCharFill||e._catPalette(t.id)})}))},this._svgDefsCat.node())},n.prototype.updateAnnotations=function(){var e=this;o.render(o.Icons,{icons:this._annotations.map((function(t){return u(u({},t),{id:e.categoryID(t.id,"ann"),shape:t.shape||"square",height:t.height||12,fill:t.fill||e._catPalette(t.id)})}))},this._svgDefsAnn.node())},n.prototype.updateEdges=function(){var e=this,r=this;return this._edgeG.selectAll(".graphEdge").data(this._graphData.allEdges(),(function(e){return e.id})).join((function(e){return e.append("g").attr("class","graphEdge").on("click.selectionBag",(function(e){r._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event()),r.selectionChanged()})).on("click",(function(e){var t=e.element.classed("selected");r.edge_click(e.props.origData||e.props,"",t)})).on("mouseover",(function(e){t.Utility.safeRaise(this),r.edge_mouseover(t.select(this),e)})).on("mouseout",(function(e){r.edge_mouseout(t.select(this),e)})).each((function(e){e.element=t.select(this),e.elementPath=e.element.append("path"),e.elementText=e.element.append("text").attr("text-anchor","middle")}))}),(function(e){return e.attr("opacity",(function(e){return e.source.props.hidden||e.target.props.hidden?0:1})).classed("hide-text",!r.showEdgeLabels())}),(function(e){return e.each((function(e){delete e.element})).remove()})).style("stroke",(function(t){var r,n;return null!==(n=null===(r=t.props)||void 0===r?void 0:r.color)&&void 0!==n?n:e.edgeColor()})).style("stroke-width",this.edgeStrokeWidth()+"px"),this},n.prototype.centroidRenderer=function(e){return arguments.length?(this._centroidRenderer=e,this):this._centroidRenderer},n.prototype.vertexRenderer=function(e){return arguments.length?(this._vertexRenderer=e,this):this._vertexRenderer},n.prototype.vertexMapper=function(e,t){var r=this;return u(u({},e),{categoryID:this.categoryID(e.categoryID),annotationIDs:e.annotationIDs?e.annotationIDs.map((function(e){return r.categoryID(e,"ann")})):[]})},n.prototype.updateVertices=function(){var e=this,r=this;return this._vertexG.selectAll(".graphVertex").data(this._graphData.allVertices(),(function(e){return e.id})).join((function(n){return n.append("g").attr("class","graphVertex").on("dblclick",(function(e){t.d3Event().stopPropagation()})).on("mousein",(function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");r.vertex_mousein(e.props.origData||e.props,"",n)})).on("mouseover",(function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");e.props.tooltip&&r._tooltip.tooltipHTML(r.tooltipHTML.bind(r)).triggerElement(e.element).tooltipWidth(r.tooltipWidth()).tooltipHeight(r.tooltipHeight()).enablePointerEvents(r.enableTooltipPointerEvents()).closeDelay(r.tooltipCloseDelay()).direction("n").data(e).visible(!0).render(),r.vertex_mouseover(e.props.origData||e.props,"",n)})).on("mouseout",(function(e){r.highlightVertex(null,null);var t=e.element.classed("selected");r.vertex_mouseout(e.props.origData||e.props,"",t),e.props.tooltip&&r._tooltip.mouseout()})).call(e._dragHandler).each((function(e){e.element=t.select(this)}))}),(function(e){return e}),(function(e){return e.each((function(e){delete e.element})).remove()})).classed("centroid",(function(e){return e.centroid})).attr("opacity",(function(e){return e.props.hidden?0:1})).attr("filter",(function(t){return t.centroid?"url(#"+e.id()+"_glow)":null})).each((function(e){var t=r.calcProps(e.centroid,u({showLabel:r.showVertexLabels()},r.vertexMapper(e.props,e.props.origData)));o.render(e.centroid?r._centroidRenderer:r._vertexRenderer,t,this)})),this},n.prototype.calcProps=function(e,t){t.icon||(t.icon={}),e?(t.textHeight=t.textHeight?t.textHeight:this.centroidTextHeight()*this.centroidScale(),t.textPadding=t.textPadding?t.textPadding:this.centroidTextPadding()*this.centroidScale(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.centroidLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.centroidIconHeight()*this.centroidScale(),t.icon.padding=t.icon.padding?t.icon.padding:this.centroidIconPadding()*this.centroidScale(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.centroidIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.centroidIconFontFamily()):(t.textHeight=t.textHeight?t.textHeight:this.vertexTextHeight(),t.textPadding=t.textPadding?t.textPadding:this.vertexTextPadding(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.vertexLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.vertexIconHeight(),t.icon.padding=t.icon.padding?t.icon.padding:this.vertexIconPadding(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.vertexIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.vertexIconFontFamily());var r=t.icon.imageChar,n=t.icon.imageFontFamily,o=t.icon.height-t.icon.padding,i=this.textRect(r,n,o);return t.icon.yOffset=-(i.top-o/2)-i.height/2+(t.icon.padding>0?o/t.icon.padding/2:0),t},n.prototype.hasSubgraphs=function(){switch(this.layout()){case"DOT":case"Hierarchy":return!0}return!1},n.prototype.updateSubgraphs=function(){var e=this;return this._subgraphG.selectAll(".subgraphPlaceholder").data(this.hasSubgraphs()?this._graphData.allSubgraphs():[],(function(e){return e.id})).join((function(r){return r.append("g").attr("class","subgraphPlaceholder").on("click.selectionBag",(function(r){e._selection.click({_id:r.id,element:function(){return r.element}},t.d3Event()),e.selectionChanged()})).on("click",(function(t){var r=t.element.classed("selected");e.subgraph_click(t.props.origData||t.props,"",r)})).on("mouseover",(function(){t.Utility.safeRaise(this)})).each((function(e){e.element=t.select(this)}))}),(function(e){return e}),(function(e){return e.each((function(e){delete e.element})).transition().style("opacity",0).remove()})).each((function(t){e.moveSubgraphPlaceholder(t,!1)})),this},n.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n);var i=this.locateSVGNode(r);this._svgDefs=t.select(i).select("defs"),this._centroidFilter=new t.SVGGlowFilter(this._svgDefs,this._id+"_glow"),this._svgDefsCat=this._svgDefs.append("g"),this._svgDefsAnn=this._svgDefs.append("g"),this._subgraphG=this._renderElement.append("g"),this._edgeG=this._renderElement.append("g"),this._vertexG=this._renderElement.append("g"),this._tooltip.target(r),this.on("startMarqueeSelection",(function(){})).on("updateMarqueeSelection",(function(e){var t=o._graphData.allVertices().filter((function(t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}));o.selection(t.map((function(e){return e.props})))})).on("endMarqueeSelection",(function(){o.selectionChanged()}))},n.prototype.forceDirectedOptions=function(){return{alpha:this.forceDirectedAlpha(),alphaMin:this.forceDirectedAlphaMin(),alphaDecay:this.forceDirectedAlphaDecay(),velocityDecay:this.forceDirectedVelocityDecay(),repulsionStrength:this.forceDirectedRepulsionStrength(),iterations:this.forceDirectedIterations(),linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),pinCentroid:this.forceDirectedPinCentroid(),forceStrength:this.forceDirectedForceStrength(),distanceMin:this.forceDirectedMinDistance(),distanceMax:this.forceDirectedMaxDistance()}},n.prototype.layoutOptions=function(e){switch(e){case"ForceDirected":case"ForceDirected2":case"ForceDirectedHybrid":return this.forceDirectedOptions();case"Hierarchy":return{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()};case"Tree":case"Dendrogram":return{rankdir:this.treeRankDirection()};case"DOT":case"Neato":case"FDP":case"TwoPI":case"Circo":return this.wasmFolder()||Ao;default:return}},n.prototype.updateLayout=function(){var e=this,t=this.layout(),n=this.layoutOptions(t),o=r.hashSum([t,n]);if(this._prevLayout!==o)switch(this._prevLayout=o,t){case"None":this.layoutAlgo(new ro(this));break;case"Circle":this.layoutAlgo(new Un(this));break;case"ForceDirected":this.layoutAlgo(new Jn(this,n));break;case"ForceDirected2":this.layoutAlgo(new Qn(this,n));break;case"ForceDirectedHybrid":this.layoutAlgo(new Jn(this,n)).then((function(){e.layoutAlgo(new Qn(e,n))}));break;case"Hierarchy":this.layoutAlgo(new Kn(this,n));break;case"DOT":this.layoutAlgo(new to(this,"dot",n));break;case"Tree":this.layoutAlgo(new ko(this,n));break;case"RadialTree":this.layoutAlgo(new So(this));break;case"Dendrogram":this.layoutAlgo(new Do(this,n));break;case"RadialDendrogram":this.layoutAlgo(new Co(this));break;case"Neato":this.layoutAlgo(new to(this,"neato",n));break;case"FDP":this.layoutAlgo(new to(this,"fdp",n));break;case"TwoPI":this.layoutAlgo(new to(this,"twopi",n));break;case"Circo":this.layoutAlgo(new to(this,"circo",n))}},n.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._centroidFilter.update(this.centroidColor()),this._renderElement.classed("allowDragging",this.allowDragging()),this.updateCategories(),this.updateAnnotations(),this.updateSubgraphs(),this.updateVertices(),this.updateEdges(),this.updateLayout(),this.updateIconBar()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r),this._tooltip.target(null)},n.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,(function(e){r.progress("stop"),t&&t(e)})),this},n.prototype.zoomed=function(t){e.prototype.zoomed.call(this,t);var r=this.size(),n=r.width,o=r.height;t.k<this.minScale()?(this._edgeG.attr("transform","scale(".concat(this.minScale()/t.k,")")),this._subgraphG.attr("transform","scale(".concat(this.minScale()/t.k,")")),this._vertexG.attr("transform","scale(".concat(this.minScale()/t.k,")")),this._transformScale=t.k/this.minScale()):t.k>this.maxScale()?(this._edgeG.attr("transform","scale(".concat(this.maxScale()/t.k,")")),this._subgraphG.attr("transform","scale(".concat(this.maxScale()/t.k,")")),this._vertexG.attr("transform","scale(".concat(this.maxScale()/t.k,")")),this._transformScale=t.k/this.maxScale()):(this._transformScale=1,this._edgeG.attr("transform",null),this._subgraphG.attr("transform",null),this._vertexG.attr("transform",null)),this._prevTransformScale===this._transformScale&&this._prevWidth===n&&this._prevHeight===o||(this._prevTransformScale=this._transformScale,this._prevWidth=n,this._prevHeight=o,this.moveSubgraphs(!1).moveVertices(!1).moveEdges(!1))},n.prototype.centroids=function(){return this._graphData.allVertices().filter((function(e){return!!e.centroid}))},n.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach((function(r){e.selection().forEach((function(n){var o=e._graphData.dijkstra(r.id,n.id),i=o.ids;o.len&&i.forEach((function(e){t[e]=!0}))}))})),this._edgeG.selectAll(".graphEdge")}},n.prototype.tooltipHTML=function(e){return e.props.tooltip},n.prototype.subgraph_click=function(e,t,r){},n.prototype.vertex_click=function(e,t,r){},n.prototype.vertex_dblclick=function(e,t,r){},n.prototype.vertex_mousein=function(e,t,r){},n.prototype.vertex_mouseover=function(e,t,r){},n.prototype.vertex_mouseout=function(e,t,r){},n.prototype.edge_click=function(e,t,r){},n.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},n.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},n.prototype.progress=function(e){},n}(t.SVGZoomWidget);Po.prototype._class+=" graph_Graph2",Po.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices"),Po.prototype.publish("dragSingleNeighbors",!0,"boolean","Dragging a Vertex also moves its singleton neighbors"),Po.prototype.publish("layout","ForceDirectedHybrid","set","Default Layout",["Hierarchy","DOT","Tree","Dendrogram","RadialTree","RadialDendrogram","ForceDirected","ForceDirected2","ForceDirectedHybrid","Neato","FDP","Circle","TwoPI","Circo","None"]),Po.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"]),Po.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout"),Po.prototype.publish("highlightOnMouseOverVertex",!0,"boolean","Highlight Vertex on Mouse Over"),Po.prototype.publish("highlightOnMouseOverEdge",!0,"boolean","Highlight Edge on Mouse Over"),Po.prototype.publish("transitionDuration",250,"number","Transition Duration"),Po.prototype.publish("showEdges",!0,"boolean","Show Edges"),Po.prototype.publish("showEdgeLabels",!0,"boolean","Show Edge labels"),Po.prototype.publish("showEdgeLabelsOnHighlight",!0,"boolean","Show Edge labels when highlighted"),Po.prototype.publish("showVertexLabels",!0,"boolean","Show Vertex labels"),Po.prototype.publish("showVertexLabelsOnHighlight",!0,"boolean","Show Vertex labels when highlighted"),Po.prototype.publish("snapToGrid",0,"number","Snap to Grid"),Po.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Po.prototype.publish("edgeArcDepth",8,"number","Edge Arc Depth"),Po.prototype.publish("edgeColor",null,"html-color","Edge line stroke color",null,{optional:!0}),Po.prototype.publish("edgeStrokeWidth",1,"number","Edge line stroke width (pixels)"),Po.prototype.publish("minScale",.6,"number","Min scale size for text"),Po.prototype.publish("maxScale",1,"number","Max scale size for text"),Po.prototype.publish("tooltipWidth",256,"number","Tooltip width (pixels)"),Po.prototype.publish("tooltipHeight",128,"number","Tooltip width (pixels)"),Po.prototype.publish("enableTooltipPointerEvents",!1,"boolean","If true, tooltip will use the style: 'pointer-events: all'"),Po.prototype.publish("tooltipCloseDelay",0,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),Po.prototype.publish("doubleClickMaxDelay",300,"number","Number of milliseconds to wait before a subsequent click is not considered a double click"),Po.prototype.publish("centroidColor","#00A000","html-color","Centroid Glow Color"),Po.prototype.publish("centroidScale",1,"number","Centroid Scale"),Po.prototype.publish("centroidTextHeight",12,"number","Centroid Text Height"),Po.prototype.publish("centroidTextPadding",4,"number","Centroid Text Padding"),Po.prototype.publish("centroidIconHeight",50,"number","Centroid Icon Height"),Po.prototype.publish("centroidIconPadding",10,"number","Centroid Icon Padding"),Po.prototype.publish("centroidIconStrokeWidth",4,"number","Centroid Icon Stroke Width"),Po.prototype.publish("centroidIconFontFamily","FontAwesome","string","Centroid Icon Font Family"),Po.prototype.publish("centroidLabelFontFamily","FontAwesome","string","Centroid Label Font Family"),Po.prototype.publish("vertexTextHeight",10,"number","Vertex Text Height"),Po.prototype.publish("vertexTextPadding",4,"number","Vertex Text Padding"),Po.prototype.publish("vertexIconHeight",50,"number","Vertex Icon Height"),Po.prototype.publish("vertexIconPadding",10,"number","Vertex Icon Padding"),Po.prototype.publish("vertexIconStrokeWidth",0,"number","Vertex Icon Stroke Width"),Po.prototype.publish("vertexIconFontFamily","FontAwesome","string","Vertex Icon Font Family"),Po.prototype.publish("vertexLabelFontFamily","FontAwesome","string","Vertex Label Font Family"),Po.prototype.publish("highlightSelectedPathToCentroid",!0,"boolean","Highlight path to Center Vertex (for selected vertices)"),Po.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{disable:function(e){return"Hierarchy"!==e.layout()}}),Po.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),Po.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),Po.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),Po.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph2",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),Po.prototype.publish("forceDirectedAlpha",1,"number","Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedAlphaMin",.001,"number","Min Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedAlphaDecay",.0228,"number","Defaults to 1 - pow(alphaMin, 1 / 300)",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedRepulsionStrength",-350,"number","Charge strength ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedVelocityDecay",.4,"number","Velocity Decay ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedIterations",300,"number","Iterations",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedPinCentroid",!1,"boolean","Pin centroid to center",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedForceStrength",0,"number","Strength of center force",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedMinDistance",1,"number","Min distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("forceDirectedMaxDistance",1/0,"number","Max distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),Po.prototype.publish("treeRankDirection","LR","set","Direction for Rank Nodes",["TB","LR"],{disable:function(e){return"Tree"!==e.layout()&&"Dendrogram"!==e.layout()}}),Po.prototype.publish("wasmFolder",null,"string","WASM Folder",null,{optional:!0,disable:function(e){return["DOT","Neato","FDP","TwoPI","Circo"].indexOf(e.layout())<0}});var Oo=Po.prototype.scale;function jo(e,t){var r={};return t.forEach((function(t,n){return r[t]=e[n]})),r}Po.prototype.scale=function(e,t){var r=Oo.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var To=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},r.prototype.valid=function(){return!!this.columnID()},c([t.publish("","set","Annotation column (boolean)",(function(){return this._owner.vertexColumns()})),l("design:type",Function)],r.prototype,"columnID",void 0),c([t.publish("","string","Annotation ID"),l("design:type",Function)],r.prototype,"annotationID",void 0),r}(t.PropertyExt);To.prototype._class+=" graph_AnnotationColumn";var No=function(e){function n(){var t=e.call(this)||this;return t._prevSubgraphs=[],t._masterSubgraphs=[],t._masterSubgraphsMap={},t._prevVertices=[],t._masterVertices=[],t._masterVerticesMap={},t._prevEdges=[],t._masterEdges=[],t._masterEdgesMap={},t._prevHierarchy=[],t._masterHierarchy=[],t._masterHierarchyMap={},t.vertexRenderer(o.Vertex3).centroidRenderer(o.CentroidVertex3).edgeColor("#287EC4").edgeStrokeWidth(2).edgeArcDepth(0),t}return s(n,e),n.prototype.clear=function(){this._prevSubgraphs=[],this._masterSubgraphs=[],this._masterSubgraphsMap={},this._prevVertices=[],this._masterVertices=[],this._masterVerticesMap={},this._prevEdges=[],this._masterEdges=[],this._prevHierarchy=[],this._masterHierarchy=[],this._masterHierarchyMap={},this._graphData.clear(),this.resetLayout()},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeSubgraphs=function(){var e=this,t=this.subgraphColumns(),n=this.indexOf(t,this.subgraphIDColumn(),"id"),o=this.indexOf(t,this.subgraphLabelColumn(),"label"),i=this.subgraphs().map((function(e){return{id:""+e[n],text:""+e[o],origData:jo(e,t)}})),a=r.compare2(this._prevSubgraphs,i,(function(e){return e.id}));a.exit.forEach((function(t){e._masterSubgraphs=e._masterSubgraphs.filter((function(e){return e.id!==t.id})),delete e._masterSubgraphsMap[t.id]})),a.enter.forEach((function(t){e._masterSubgraphs.push(t),e._masterSubgraphsMap[t.id]=t})),a.update.forEach((function(t){e._masterSubgraphsMap[t.id].origData=t.origData})),this._prevSubgraphs=i},n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map((function(r){return e.indexOf(t,r.columnID(),"")})),h=this.vertices().map((function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:jo(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map((function(e,t){return r[e]?n[t].annotationID():void 0})).filter((function(e){return!!e}))}})),d=r.compare2(this._prevVertices,h,(function(e){return e.id}));d.exit.forEach((function(t){e._masterVertices=e._masterVertices.filter((function(e){return e.id!==t.id})),delete e._masterVerticesMap[t.id]})),d.enter.forEach((function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t})),d.update.forEach((function(t){e._masterVerticesMap[t.id].origData=t.origData})),this._prevVertices=h},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.indexOf(t,this.edgeColorColumn(),"color"),c=this.edges().map((function(r){var c=e._masterVerticesMap[""+r[o]];c||console.error('Invalid edge source entity "'.concat(r[o],'" does not exist.'));var l=e._masterVerticesMap[""+r[i]];return l||console.error('Invalid edge target entity "'.concat(r[i],'" does not exist.')),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:c,target:l,weight:+r[s]||1,color:r[u],label:a>=0?""+r[a]:"",origData:jo(r,t)}})).filter((function(e){return e.source&&e.target})),l=r.compare2(this._masterEdges,c,(function(e){return e.id}));l.exit.forEach((function(t){e._masterEdges=e._masterEdges.filter((function(e){return e.id!==t.id})),delete e._masterEdgesMap[t.id]})),l.enter.forEach((function(t){e._masterEdges.push(t),e._masterEdgesMap[t.id]=t})),l.update.forEach((function(t){e._masterEdgesMap[t.id].origData=t.origData})),this._prevEdges=c},n.prototype.mergeHierarchy=function(){var e=this,t=this.hierarchyColumns(),n=this.indexOf(t,this.hierarchyParentIDColumn(),"parentID"),o=this.indexOf(t,this.hierarchyChildIDColumn(),"childID"),i=this.hierarchy().map((function(t){return{id:t[n]+"=>"+t[o],parent:e._masterSubgraphsMap[""+t[n]],child:e._masterSubgraphsMap[""+t[o]]||e._masterVerticesMap[""+t[o]]}})),a=r.compare2(this._prevHierarchy,i,(function(e){return e.id}));a.exit.forEach((function(t){e._masterHierarchy=e._masterHierarchy.filter((function(e){return e.id!==t.id})),delete e._masterHierarchyMap[t.id]})),a.enter.forEach((function(t){e._masterHierarchy.push(t),e._masterHierarchyMap[t.id]=t})),this._prevHierarchy=i},n.prototype.update=function(t,r){this.mergeSubgraphs(),this.mergeVertices(),this.mergeEdges(),this.mergeHierarchy(),this.data({subgraphs:this._masterSubgraphs,vertices:this._masterVertices,edges:this._masterEdges,hierarchy:this._masterHierarchy}),e.prototype.update.call(this,t,r)},n.prototype.render=function(t){return e.prototype.render.call(this,(function(e){t&&t(e)})),this},c([t.publish([],"any","Subgraph Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphColumns",void 0),c([t.publish([],"any","Subgraphs",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphs",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"subgraphIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"subgraphLabelColumn",void 0),c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:To}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge weight column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),c([t.publish("","set","Edge color column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeColorColumn",void 0),c([t.publish([],"any","Subgraph Columns"),l("design:type",Function)],n.prototype,"hierarchyColumns",void 0),c([t.publish([],"any","Subgraphs"),l("design:type",Function)],n.prototype,"hierarchy",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"hierarchyParentIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"hierarchyChildIDColumn",void 0),n}(Po);No.prototype._class+=" graph_DataGraph";Y(".graph_SankeyGraph .node rect{fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9;cursor:move}.graph_SankeyGraph .node.selected rect{stroke:red}.graph_SankeyGraph .node.over rect{stroke:orange}.graph_SankeyGraph .node.selected.over rect{stroke:red}.graph_SankeyGraph .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_SankeyGraph .node.selected text{fill:red}.graph_SankeyGraph .node.over text{fill:orange}.graph_SankeyGraph .node.selected.over text{fill:red}.graph_SankeyGraph .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_SankeyGraph .link:hover{stroke-opacity:.5}");var Yo=function(e){function n(){var r=e.call(this)||this;return r._prevVertices=[],r._masterVertices=[],r._masterVerticesMap={},r._prevEdges=[],r._masterEdges=[],t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(n,e),n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map((function(r){return e.indexOf(t,r.columnID(),"")})),h=this.vertices().map((function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:jo(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map((function(e,t){return r[e]?n[t].annotationID():void 0})).filter((function(e){return!!e}))}})),d=r.compare2(this._prevVertices,h,(function(e){return e.id}));d.exit.forEach((function(t){e._masterVertices=e._masterVertices.filter((function(e){return e.id!==t.id}))})),d.enter.forEach((function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t})),this._prevVertices=h},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.edges().map((function(r){var u=e._masterVerticesMap[""+r[o]];u||console.error('Invalid edge source entity "'.concat(r[o],'" does not exist.'));var c=e._masterVerticesMap[""+r[i]];return c||console.error('Invalid edge target entity "'.concat(r[i],'" does not exist.')),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:u,target:c,value:+r[s]||0,label:a>=0?""+r[a]:"",origData:jo(r,t)}})).filter((function(e){return e.source&&e.target})),c=r.compare2(this._masterEdges,u,(function(e){return e.id}));c.exit.forEach((function(t){e._masterEdges=e._masterEdges.filter((function(e){return e.id!==t.id}))})),c.enter.forEach((function(t){e._masterEdges.push(t)})),this._prevEdges=u},n.prototype.sankeyData=function(){return this.mergeVertices(),this.mergeEdges(),{vertices:this._masterVertices,edges:this._masterEdges}},n.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=jn(),this._selection.widgetElement(r)},n.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData();this._d3Sankey.nodeId((function(e){return e.id})).extent([[0,0],[this.width(),this.height()]]),i.vertices.length>0&&this._d3Sankey({nodes:i.vertices,links:i.edges});var a=this,s=n.selectAll(".link").data(i.edges);s.enter().append("path").attr("class","link").each((function(){t.select(this).append("title")})).merge(s).attr("d",Yn()).style("stroke-width",(function(e){return Math.max(1,e.width)})).select("title").text((function(e){return e.source.text+" → "+e.target.text+"\n"+e.value})),s.exit().remove();var u=n.selectAll(".node").data(i.vertices);u.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",(function(e){a.click(e.origData,"",a._selection.selected(this))})).on("dblclick",(function(e){a.dblclick(e.origData,"",a._selection.selected(this))})).each((function(){var e=t.select(this);e.append("rect"),e.append("text")})).merge(u).attr("transform",(function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"})).each((function(){var e=t.select(this);e.select("rect").attr("height",(function(e){return e.y1-e.y0})).attr("width",(function(e){return e.x1-e.x0})).style("fill",(function(e){return a._palette(e.categoryID)})).style("stroke",(function(e){return a.vertexStrokeColor()})).style("stroke-width",(function(e){return o})).style("cursor",a.xAxisMovement()||a.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.text})).filter((function(e){return e.x0<a.width()/2})).attr("x",6+a._d3Sankey.nodeWidth()).attr("text-anchor","start")})),u.exit().remove()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},n.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},n.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",(function(){return this.vertexColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:To}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge target ID column",(function(){return this.edgeColumns()}),{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),n}(t.SVGWidget);Yo.prototype._class+=" graph_SankeyGraph",Yo.prototype.mixin(t.Utility.SimpleSelectionMixin),Yo.prototype._palette=t.Palette.ordinal("category10"),Yo.prototype.publish("paletteID","category10","set","Color palette for this widget",Yo.prototype._palette.switch()),Yo.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),Yo.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),Yo.prototype.publish("vertexWidth",36,"number","Vertex Width"),Yo.prototype.publish("vertexPadding",20,"number","Vertex Padding"),Yo.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),Yo.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),e.AdjacencyGraph=xn,e.Annotation=wn,e.AnnotationColumn=To,e.BUILD_VERSION="2.102.9",e.DataGraph=No,e.Edge=B,e.Graph=mn,e.Graph2=Po,e.PKG_NAME="@hpcc-js/graph",e.PKG_VERSION="2.79.3",e.Sankey=Bn,e.SankeyColumn=Rn,e.SankeyGraph=Yo,e.Subgraph=vn,e.Vertex=_n,e.graphviz=function(e,t,r){return void 0===t&&(t="dot"),void 0===r&&(r=Ao),Zn({items:[],links:[],raw:e},{engine:t,wasmFolder:r})},e.toJsonObj=jo,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=index.min.js.map