/*
 Highcharts JS v10.3.2 (2022-11-28)
 Treegraph chart series type

  (c) 2010-2022 Pawel Lysy Grzegorz Blachlinski

 License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?(d["default"]=d,module.exports=d):"function"===typeof define&&define.amd?define("highcharts/modules/treegraph",["highcharts","highcharts/modules/treemap"],function(h){d(h);d.Highcharts=h;return d}):d("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(d){function h(d,f,c,b){d.hasOwnProperty(f)||(d[f]=b.apply(null,c),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:f,module:d[f]}})))}
d=d?d._modules:{};h(d,"Series/PathUtilities.js",[],function(){return{curvedPath:function(d,f){for(var c=[],b=0;b<d.length;b++){var a=d[b][1],e=d[b][2];if("number"===typeof a&&"number"===typeof e)if(0===b)c.push(["M",a,e]);else if(b===d.length-1)c.push(["L",a,e]);else if(f){var g=d[b-1],l=d[b+1];if(g&&l){var m=g[1];g=g[2];var k=l[1];l=l[2];if("number"===typeof m&&"number"===typeof k&&"number"===typeof g&&"number"===typeof l&&m!==k&&g!==l){var B=m<k?1:-1,t=g<l?1:-1;c.push(["L",a-B*Math.min(Math.abs(a-
m),f),e-t*Math.min(Math.abs(e-g),f)],["C",a,e,a,e,a+B*Math.min(Math.abs(a-k),f),e+t*Math.min(Math.abs(e-l),f)])}}}else c.push(["L",a,e])}return c}}});h(d,"Series/Treegraph/TreegraphNode.js",[d["Core/Series/SeriesRegistry.js"]],function(d){var f=this&&this.__extends||function(){var c=function(b,a){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e])};return c(b,a)};return function(b,a){function e(){this.constructor=
b}c(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}();return function(c){function b(){var a=null!==c&&c.apply(this,arguments)||this;a.mod=0;a.shift=0;a.change=0;a.children=[];a.preX=0;a.hidden=!1;a.wasVisited=!1;a.collapsed=!1;return a}f(b,c);b.prototype.nextLeft=function(){return this.getLeftMostChild()||this.thread};b.prototype.nextRight=function(){return this.getRightMostChild()||this.thread};b.prototype.getAncestor=function(a,e){return a.ancestor.children[0]===this.children[0]?
a.ancestor:e};b.prototype.getLeftMostSibling=function(){var a=this.getParent();if(a){var e=0;for(a=a.children;e<a.length;e++){var b=a[e];if(b&&b.point.visible)return b}}};b.prototype.hasChildren=function(){for(var a=this.children,b=0;b<a.length;b++)if(a[b].point.visible)return!0;return!1};b.prototype.getLeftSibling=function(){var a=this.getParent();if(a){a=a.children;for(var b=this.relativeXPosition-1;0<=b;b--)if(a[b]&&a[b].point.visible)return a[b]}};b.prototype.getLeftMostChild=function(){for(var a=
this.children,b=0;b<a.length;b++)if(a[b].point.visible)return a[b]};b.prototype.getRightMostChild=function(){for(var a=this.children,b=a.length-1;0<=b;b--)if(a[b].point.visible)return a[b]};b.prototype.getParent=function(){return this.parentNode};b.prototype.getFirstChild=function(){for(var a=this.children,b=0;b<a.length;b++)if(a[b].point.visible)return a[b]};return b}(d.seriesTypes.treemap.prototype.NodeClass)});h(d,"Series/Treegraph/TreegraphPoint.js",[d["Core/Series/Point.js"],d["Core/Series/SeriesRegistry.js"],
d["Core/Utilities.js"]],function(d,f,c){var b=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function e(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),a=c.addEvent,e=c.fireEvent,g=c.merge,l=c.pick;f=function(a){function c(){var b=null!==a&&a.apply(this,arguments)||
this;b.options=void 0;b.isLink=!1;b.series=void 0;b.node=void 0;b.setState=d.prototype.setState;return b}b(c,a);c.prototype.draw=function(){a.prototype.draw.apply(this,arguments);this.renderCollapseButton()};c.prototype.renderCollapseButton=function(){var a=this.series,b=this.graphic&&this.graphic.parentGroup;a=g(a.options.collapseButton,(a.mapOptionsToLevel[this.node.level||0]||{}).collapseButton,this.series.options.collapseButton);var c=a.width,e=a.height,d=a.shape,f=a.style,m=this.series.chart;
if(this.shapeArgs)if(this.collapseButtonOptions=a,this.collapseButton)this.node.children.length&&a.enabled?(b=this.getCollapseBtnPosition(a),l=b.x,k=b.y,this.collapseButton.attr({text:this.collapsed?"+":"-",rotation:m.inverted?90:0,rotationOriginX:c/2,rotationOriginY:e/2,visibility:!this.visible||a.onlyOnHover&&"hover"!==this.state&&!this.collapsed?"hidden":"inherit"}).animate({x:l,y:k})):(this.collapseButton.destroy(),delete this.collapseButton);else if(this.node.children.length&&a.enabled){k=this.getCollapseBtnPosition(a);
var l=k.x,k=k.y;this.collapseButton=m.renderer.label(this.collapsed?"+":"-",l,k,d).attr({height:e-4,width:c-4,padding:2,fill:"#cccccc",rotation:m.inverted?90:0,rotationOriginX:c/2,rotationOriginY:e/2,stroke:"#333333","stroke-width":1,"text-align":"center",align:"center",zIndex:1}).addClass("highcharts-tracker").addClass("highcharts-collapse-button").removeClass("highcharts-no-tooltip").css(f||{}).add(b);this.collapseButton.element.point=this;a.onlyOnHover&&!this.collapsed&&this.collapseButton.hide()}};
c.prototype.toggleCollapse=function(a){this.collapsed=l(a,!this.collapsed);e(this.series,"toggleCollapse");this.series.redraw()};c.prototype.shouldDraw=function(){return a.prototype.shouldDraw.call(this)&&this.visible};c.prototype.destroy=function(){this.collapseButton&&(this.collapseButton.destroy(),delete this.collapseButton,this.collapseButton=void 0);a.prototype.destroy.apply(this,arguments)};c.prototype.getCollapseBtnPosition=function(a){var b=a.width,c=a.height,e=this.shapeArgs||{},g=e.x,d=
e.y,f=e.width;e=e.height;return{x:(void 0===g?0:g)+a.x+(this.series.chart.inverted?.3*-c:(void 0===f?0:f)+-.3*b),y:(void 0===d?0:d)+(void 0===e?0:e)/2-c/2+a.y}};return c}(f.seriesTypes.treemap.prototype.pointClass);a(f,"mouseOut",function(){var a=this.collapseButton,b=this.collapseButtonOptions;a&&b&&b.onlyOnHover&&!this.collapsed&&a.hide()});a(f,"mouseOver",function(){this.collapseButton&&this.collapseButton.show()});a(f,"click",function(){this.toggleCollapse()});return f});h(d,"Series/Treegraph/TreegraphLink.js",
[d["Core/Series/Point.js"],d["Core/Utilities.js"],d["Core/Series/SeriesRegistry.js"]],function(d,f,c){var b=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function e(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),a=f.pick,e=f.extend;return function(c){function g(){var a=
null!==c&&c.apply(this,arguments)||this;a.isLink=!0;a.node={};a.formatPrefix="link";a.dataLabelOnNull=!0;return a}b(g,c);g.prototype.init=function(a,b,e,d){var g=c.prototype.init.apply(this,arguments);this.formatPrefix="link";this.dataLabelOnNull=!0;d&&(g.fromNode=d.node.parentNode.point,g.visible=d.visible,g.toNode=d,this.id=g.toNode.id+"-"+g.fromNode.id);return g};g.prototype.update=function(b,c,g,f){var l={id:this.id,formatPrefix:this.formatPrefix};d.prototype.update.call(this,b,this.isLink?!1:
c,g,f);this.visible=this.toNode.visible;e(this,l);a(c,!0)&&this.series.chart.redraw(g)};return g}(c.seriesTypes.column.prototype.pointClass)});h(d,"Series/Treegraph/TreegraphLayout.js",[d["Series/Treegraph/TreegraphNode.js"]],function(d){return function(){function f(){}f.createDummyNode=function(c,b,a,e){e=new d;e.id=c.id+"-"+a;e.ancestor=c;e.children.push(b);e.parent=c.id;e.parentNode=c;e.point=b.point;e.level=b.level-a;e.relativeXPosition=b.relativeXPosition;e.visible=b.visible;c.children[b.relativeXPosition]=
e;b.oldParentNode=c;b.relativeXPosition=0;b.parentNode=e;b.parent=e.id;return e};f.prototype.calculatePositions=function(c){var b=c.nodeList;this.resetValues(b);if(c=c.tree)this.calculateRelativeX(c,0),this.beforeLayout(b),this.firstWalk(c),this.secondWalk(c,-c.preX),this.afterLayout(b)};f.prototype.beforeLayout=function(c){for(var b=0;b<c.length;b++)for(var a=c[b],e=0,d=0,l=a.children;d<l.length;d++){var m=l[d];if(m&&1<m.level-a.level)for(var k=m.level-a.level-1;0<k;)m=f.createDummyNode(a,m,k,e),
k--;++e}};f.prototype.resetValues=function(c){for(var b=0;b<c.length;b++){var a=c[b];a.mod=0;a.ancestor=a;a.shift=0;a.thread=void 0;a.change=0;a.preX=0}};f.prototype.calculateRelativeX=function(c,b){for(var a=c.children,e=0,d=a.length;e<d;++e)this.calculateRelativeX(a[e],e);c.relativeXPosition=b};f.prototype.firstWalk=function(c){if(c.hasChildren()){var b=c.getLeftMostChild();for(var a=0,e=c.children;a<e.length;a++){var d=e[a];this.firstWalk(d);b=this.apportion(d,b)}this.executeShifts(c);b=c.getLeftMostChild();
a=c.getRightMostChild();a=(b.preX+a.preX)/2;(b=c.getLeftSibling())?(c.preX=b.preX+1,c.mod=c.preX-a):c.preX=a}else(b=c.getLeftSibling())?(c.preX=b.preX+1,c.mod=c.preX):c.preX=0};f.prototype.secondWalk=function(c,b){c.yPosition=c.preX+b;c.xPosition=c.level;for(var a=0,e=c.children;a<e.length;a++)this.secondWalk(e[a],b+c.mod)};f.prototype.executeShifts=function(c){for(var b=0,a=0,e=c.children.length-1;0<=e;e--){var d=c.children[e];d.preX+=b;d.mod+=b;a+=d.change;b+=d.shift+a}};f.prototype.apportion=function(c,
b){var a=c.getLeftSibling();if(a){for(var e=c,d=c,f=e.getLeftMostSibling(),m=e.mod,k=d.mod,h=a.mod,t=f.mod;a&&a.nextRight()&&e&&e.nextLeft();){a=a.nextRight();f=f.nextLeft();e=e.nextLeft();d=d.nextRight();d.ancestor=c;var n=a.preX+h-(e.preX+m)+1;0<n&&(this.moveSubtree(c.getAncestor(a,b),c,n),m+=n,k+=n);h+=a.mod;m+=e.mod;t+=f.mod;k+=d.mod}a&&a.nextRight()&&!d.nextRight()&&(d.thread=a.nextRight(),d.mod+=h-k);e&&e.nextLeft()&&!f.nextLeft()&&(f.thread=e.nextLeft(),f.mod+=m-t);b=c}return b};f.prototype.moveSubtree=
function(c,b,a){var e=b.relativeXPosition-c.relativeXPosition;b.change-=a/e;b.shift+=a;b.preX+=a;b.mod+=a;c.change+=a/e};f.prototype.afterLayout=function(c){for(var b=0;b<c.length;b++){var a=c[b];a.oldParentNode&&(a.relativeXPosition=a.parentNode.relativeXPosition,a.parent=a.oldParentNode.parent,a.parentNode=a.oldParentNode,delete a.oldParentNode.children[a.relativeXPosition],a.oldParentNode.children[a.relativeXPosition]=a,a.oldParentNode=void 0)}};return f}()});h(d,"Series/Treegraph/TreegraphSeriesDefaults.js",
[],function(){return{reversed:!1,marker:{radius:10,lineWidth:0,symbol:"circle",fillOpacity:1,states:{}},link:{color:"#666666",lineWidth:1,radius:10,cursor:"default",type:"curved"},collapseButton:{onlyOnHover:!0,enabled:!0,x:0,y:0,height:10,width:10,shape:"circle"},tooltip:{linkFormat:"{point.fromNode.id} \u2192 {point.toNode.id}",pointFormat:"{point.id}"},dataLabels:{linkTextPath:{attributes:{startOffset:"50%"}},enabled:!0,linkFormatter:function(){return""},formatter:function(){return this.point.id}}}});
h(d,"Series/Treegraph/TreegraphSeries.js",[d["Series/PathUtilities.js"],d["Core/Series/SeriesRegistry.js"],d["Core/Renderer/SVG/SVGRenderer.js"],d["Series/Treegraph/TreegraphNode.js"],d["Series/Treegraph/TreegraphPoint.js"],d["Series/TreeUtilities.js"],d["Core/Utilities.js"],d["Series/Treegraph/TreegraphLink.js"],d["Series/Treegraph/TreegraphLayout.js"],d["Series/Treegraph/TreegraphSeriesDefaults.js"]],function(d,f,c,b,a,e,g,l,m,k){var h=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),t=d.curvedPath,n=f.series.prototype;d=f.seriesTypes;var C=d.treemap,x=d.column,D=c.prototype.symbols,E=e.getLevelOptions;c=g.extend;var F=g.isArray,u=g.merge,v=g.pick,z=g.relativeLength;g=function(a){function b(){var b=null!==a&&
a.apply(this,arguments)||this;b.data=void 0;b.options=void 0;b.points=void 0;b.layoutModifier=void 0;b.nodeMap=void 0;b.tree=void 0;b.nodeList=[];b.layoutAlgorythm=void 0;b.links=[];b.mapOptionsToLevel=void 0;return b}h(b,a);b.prototype.init=function(){a.prototype.init.apply(this,arguments);this.layoutAlgorythm=new m};b.prototype.getLayoutModifiers=function(){var b=this,a=this.chart,c=this,d=a.plotSizeX,e=a.plotSizeY,f=Infinity,g=-Infinity,l=Infinity,m=-Infinity,k=0,h=0,A=0,w=0;this.points.forEach(function(a){var q=
a.node;a=u(b.options.marker,(c.mapOptionsToLevel[a.node.level]||{}).marker,a.options.marker);var p=z(a.radius||0,Math.min(d,e)),r=a.symbol,y="circle"!==r&&a.height?z(a.height,e):2*p;p="circle"!==r&&a.width?z(a.width,d):2*p;q.nodeSizeX=p;q.nodeSizeY=y;q.xPosition<=f&&(f=q.xPosition,r=a.lineWidth||0,h=Math.max(p+r,h));q.xPosition>=g&&(g=q.xPosition,r=a.lineWidth||0,k=Math.max(p+r,k));q.yPosition<=l&&(l=q.yPosition,r=a.lineWidth||0,w=Math.max(y+r,w));q.yPosition>=m&&(m=q.yPosition,r=a.lineWidth||0,A=
Math.max(y+r,A))});a=m===l?1:(e-(w+A)/2)/(m-l);var n=g===f?1:(d-(k+k)/2)/(g-f);return{ax:n,bx:g===f?d/2:-n*f+h/2,ay:a,by:m===l?e/2:-a*l+w/2}};b.prototype.getLinks=function(){var a=this,b=[];this.data.forEach(function(c,d){d=a.mapOptionsToLevel[c.node.level||0]||{};c.node.parent?(d=u(d,c.options),c.linkToParent&&c.linkToParent.update?c.linkToParent.update(d,!1):(d=(new a.LinkClass).init(a,d,void 0,c),c.linkToParent=d),c.linkToParent.index=b.push(c.linkToParent)-1):c.linkToParent&&(a.links.splice(c.linkToParent.index),
c.linkToParent.destroy(),delete c.linkToParent)});return b};b.prototype.buildTree=function(b,c,d,e,f){var q=this.points[c];d=q&&q.level||d;return a.prototype.buildTree.call(this,b,c,d,e,f)};b.prototype.markerAttribs=function(){return{}};b.prototype.setCollapsedStatus=function(a,b){var c=this,d=a.point;d&&(d.collapsed=v(d.collapsed,(this.mapOptionsToLevel[a.level]||{}).collapsed),d.visible=b,b=!1===b?!1:!d.collapsed);a.children.forEach(function(a){c.setCollapsedStatus(a,b)})};b.prototype.drawTracker=
function(){x.prototype.drawTracker.apply(this,arguments);x.prototype.drawTracker.call(this,this.links)};b.prototype.translate=function(){var a=this,b=this.options,c=e.updateRootId(this);n.translate.call(this);var d=this.tree=this.getTree();var f=this.nodeMap[c];""===c||f&&f.children.length||(this.setRootNode("",!1),c=this.rootNode,f=this.nodeMap[c]);this.mapOptionsToLevel=E({from:f.level+1,levels:b.levels,to:d.height,defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:b.colorByPoint}});
this.setCollapsedStatus(d,!0);this.links=this.getLinks();this.setTreeValues(d);this.layoutAlgorythm.calculatePositions(this);this.layoutModifier=this.getLayoutModifiers();this.points.forEach(function(b){a.translateNode(b)});this.points.forEach(function(b){b.linkToParent&&a.translateLink(b.linkToParent)})};b.prototype.translateLink=function(a){var b=a.fromNode,c=a.toNode,d=this.options.link.lineWidth,e=Math.round(d)%2/2,f=v(this.options.link.curveFactor,.5),g=v(a.options.link&&a.options.link.type,
this.options.link.type);if(b.shapeArgs&&c.shapeArgs){var p=b.shapeArgs.width||0,l=this.chart.inverted,m=Math.floor((b.shapeArgs.y||0)+(b.shapeArgs.height||0)/2)+e,k=Math.floor((c.shapeArgs.y||0)+(c.shapeArgs.height||0)/2)+e,h=Math.floor((b.shapeArgs.x||0)+p)+e,n=Math.floor(c.shapeArgs.x||0)+e;l&&(h-=p,n+=c.shapeArgs.width||0);b=c.node.xPosition-b.node.xPosition;a.shapeType="path";p=(Math.abs(n-h)+p)/b-p;f=p*f*(l?-1:1);a.plotX=Math.floor((n+h)/2)+e;a.plotY=k;a.shapeArgs="straight"===g?{d:[["M",h,m],
["L",h+p*(l?-1:1),k],["L",n,k]]}:"curved"===g?{d:[["M",h,m],["C",h+f,m,h-f+p*(l?-1:1),k,h+p*(l?-1:1),k],["L",n,k]]}:{d:t([["M",h,m],["L",h+p*(l?-.5:.5),m],["L",h+p*(l?-.5:.5),k],["L",n,k]],this.options.link.radius)};a.dlBox={x:(h+n)/2,y:(m+k)/2,height:d,width:0};a.tooltipPos=l?[(this.chart.plotSizeY||0)-a.dlBox.y,(this.chart.plotSizeX||0)-a.dlBox.x]:[a.dlBox.x,a.dlBox.y]}};b.prototype.drawNodeLabels=function(a){for(var b=this.mapOptionsToLevel,c,d,e=0;e<a.length;e++){var f=a[e];d=b[f.node.level];
c={style:{}};d&&d.dataLabels&&(c=u(c,d.dataLabels),this._hasPointLabels=!0);f.shapeArgs&&(c.style.width=f.shapeArgs.width,f.dataLabel&&f.dataLabel.css({width:f.shapeArgs.width+"px"}));f.dlOptions=u(c,f.options.dataLabels)}n.drawDataLabels.call(this,a)};b.prototype.drawDataLabels=function(){this.options.dataLabels&&(F(this.options.dataLabels)||(this.options.dataLabels=[this.options.dataLabels]),this.drawNodeLabels(this.points),n.drawDataLabels.call(this,this.links))};b.prototype.destroy=function(){for(var a=
0,b=this.links;a<b.length;a++)b[a].destroy();return n.destroy.apply(this,arguments)};b.prototype.pointAttribs=function(a,b){var c=this.mapOptionsToLevel[a.node.level||0]||{},d=a.options,e=c.states&&c.states[b]||{};a.options.marker=u(this.options.marker,c.marker,a.options.marker);var f=v(e.borderRadius,d.borderRadius,c.borderRadius,this.options.borderRadius),g=v(e.link&&e.link.color,d.link&&d.link.color,c.link&&c.link.color,this.options.link&&this.options.link.color);c=v(e.link&&e.link.lineWidth,d.link&&
d.link.lineWidth,c.link&&c.link.lineWidth,this.options.link&&this.options.link.lineWidth);b=n.pointAttribs.call(this,a,b);a.isLink?(b.stroke=g,b["stroke-width"]=c,delete b.fill):f&&(b.r=f);return b};b.prototype.drawPoints=function(){a.prototype.drawPoints.apply(this,arguments);x.prototype.drawPoints.call(this,this.links)};b.prototype.translateNode=function(a){var b=this.chart,c=a.node,d=b.plotSizeY,e=b.plotSizeX,f=this.layoutModifier,g=f.ax*c.xPosition+f.bx,l=f.ay*c.yPosition+f.by;f=u(this.options.marker,
(this.mapOptionsToLevel[c.level]||{}).marker,a.options.marker).symbol;var k=c.nodeSizeY,h=c.nodeSizeX,m=this.options.reversed;g=c.x=b.inverted?e-h/2-g:g-h/2;c=c.y=m?l-k/2:d-l-k/2;a.shapeType="path";a.plotX=g;a.plotY=c;a.shapeArgs={d:D[f||"circle"](g,c,h,k),x:g,y:c,width:h,height:k,cursor:a.node.isLeaf?"default":"pointer"};a.tooltipPos=b.inverted?[d-c-k/2,e-g-h/2]:[g+h/2,c]};b.defaultOptions=u(C.defaultOptions,k);return b}(C);c(g.prototype,{pointClass:a,NodeClass:b,LinkClass:l});f.registerSeriesType("treegraph",
g);"";return g});h(d,"masters/modules/treegraph.src.js",[],function(){})});
//# sourceMappingURL=treegraph.js.map