!/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * Treegraph chart series type
 * @module highcharts/modules/treegraph
 * @requires highcharts
 * @requires highcharts/modules/treemap
 *
 *  (c) 2010-2026 Highsoft AS
 *  Author: Pawel Lysy Grzegorz Blachlinski
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("highcharts"),require("highcharts").SeriesRegistry,require("highcharts").SVGRenderer,require("highcharts").Point,require("highcharts").Color,require("highcharts").SVGElement):"function"==typeof define&&define.amd?define("highcharts/modules/treegraph",[["highcharts/highcharts"],["highcharts/highcharts","SeriesRegistry"],["highcharts/highcharts","SVGRenderer"],["highcharts/highcharts","Point"],["highcharts/highcharts","Color"],["highcharts/highcharts","SVGElement"]],e):"object"==typeof exports?exports["highcharts/modules/treegraph"]=e(require("highcharts"),require("highcharts").SeriesRegistry,require("highcharts").SVGRenderer,require("highcharts").Point,require("highcharts").Color,require("highcharts").SVGElement):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.SVGRenderer,t.Highcharts.Point,t.Highcharts.Color,t.Highcharts.SVGElement)}(this,function(t,e,i,o,r,n){return function(){"use strict";var s,a,l,h,p={28:function(t){t.exports=n},260:function(t){t.exports=o},512:function(t){t.exports=e},540:function(t){t.exports=i},620:function(t){t.exports=r},944:function(e){e.exports=t}},d={};function c(t){var e=d[t];if(void 0!==e)return e.exports;var i=d[t]={exports:{}};return p[t](i,i.exports,c),i.exports}c.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(e,{a:e}),e},c.d=function(t,e){for(var i in e)c.o(e,i)&&!c.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},c.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};c.d(u,{default:function(){return tm}});var f=c(944),v=c.n(f);function y(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.bendAt,s=t.width,a=t.inverted,l=void 0!==a&&a,h=t.radius;if(t.parentVisible){var p=null!=n?n:(void 0===s?0:s)/2;return function(t,e){for(var i=[],o=0;o<t.length;o++){var r=t[o][1],n=t[o][2];if("number"==typeof r&&"number"==typeof n)if(0===o)i.push(["M",r,n]);else if(o===t.length-1)i.push(["L",r,n]);else if(e){var s=t[o-1],a=t[o+1];if(s&&a){var l=s[1],h=s[2],p=a[1],d=a[2];if("number"==typeof l&&"number"==typeof p&&"number"==typeof h&&"number"==typeof d&&l!==p&&h!==d){var c=l<p?1:-1,u=h<d?1:-1;i.push(["L",r-c*Math.min(Math.abs(r-l),e),n-u*Math.min(Math.abs(n-h),e)],["C",r,n,r,n,r+c*Math.min(Math.abs(r-p),e),n+u*Math.min(Math.abs(n-d),e)])}}}else i.push(["L",r,n])}return i}([["M",e,i],["L",e+p*(l?-1:1),i],["L",e+p*(l?-1:1),r],["L",o,r]],h)}return[["M",e,i],["L",e,i],["C",e,i,e,r,e,r],["L",e,r],["C",e,i,e,r,e,r],["L",e,r]]}var g=c(512),b=c.n(g),m=c(540),x=c.n(m),P=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mod=0,e.shift=0,e.change=0,e.children=[],e.preX=0,e.hidden=!1,e.wasVisited=!1,e.collapsed=!1,e}return P(e,t),e.prototype.nextLeft=function(){return this.getLeftMostChild()||this.thread},e.prototype.nextRight=function(){return this.getRightMostChild()||this.thread},e.prototype.getAncestor=function(t,e){return t.ancestor.children[0]===this.children[0]?t.ancestor:e},e.prototype.getLeftMostSibling=function(){var t=this.getParent();if(t)for(var e=0,i=t.children;e<i.length;e++){var o=i[e];if(o&&o.point.visible)return o}},e.prototype.hasChildren=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return!0;return!1},e.prototype.getLeftSibling=function(){var t=this.getParent();if(t){for(var e=t.children,i=this.relativeXPosition-1;i>=0;i--)if(e[i]&&e[i].point.visible)return e[i]}},e.prototype.getLeftMostChild=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return t[e]},e.prototype.getRightMostChild=function(){for(var t=this.children,e=t.length-1;e>=0;e--)if(t[e].point.visible)return t[e]},e.prototype.getParent=function(){return this.parentNode},e.prototype.getFirstChild=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return t[e]},e}(b().seriesTypes.treemap.prototype.NodeClass),L=c(260),C=c.n(L),O=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),T=b().seriesTypes.treemap.prototype.pointClass,w=v().addEvent,M=v().fireEvent,S=v().merge,X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dataLabelOnHidden=!0,e.isLink=!1,e.setState=C().prototype.setState,e}return O(e,t),e.prototype.draw=function(){t.prototype.draw.apply(this,arguments);var e=this.graphic;e&&e.animate({visibility:this.visible?"inherit":"hidden"}),this.renderCollapseButton()},e.prototype.renderCollapseButton=function(){var t=this.series,e=this.graphic&&this.graphic.parentGroup,i=t.mapOptionsToLevel[this.node.level||0]||{},o=S(t.options.collapseButton,i.collapseButton,this.options.collapseButton),r=o.width,n=o.height,s=o.shape,a=o.style,l=this.series.chart,h=this.visible&&(this.collapsed||!o.onlyOnHover||"hover"===this.state)?1:0;if(this.shapeArgs)if(this.collapseButtonOptions=o,this.collapseButton)if(this.node.children.length&&o.enabled){var p=this.getCollapseBtnPosition(o),d=p.x,c=p.y;this.collapseButton.attr({text:this.collapsed?"+":"-",rotation:90*!!l.inverted,rotationOriginX:r/2,rotationOriginY:n/2,visibility:this.visible?"inherit":"hidden"}).animate({x:d,y:c,opacity:h})}else this.collapseButton.destroy(),delete this.collapseButton;else{if(!this.node.children.length||!o.enabled)return;var u=this.getCollapseBtnPosition(o),d=u.x,c=u.y,f=o.fillColor||this.color||"#cccccc";this.collapseButton=l.renderer.label(this.collapsed?"+":"-",d,c,s).attr({height:n-4,width:r-4,padding:2,fill:f,rotation:90*!!l.inverted,rotationOriginX:r/2,rotationOriginY:n/2,stroke:o.lineColor||"#ffffff","stroke-width":o.lineWidth,"text-align":"center",align:"center",zIndex:1,opacity:h,visibility:this.visible?"inherit":"hidden"}).addClass("highcharts-tracker").addClass("highcharts-collapse-button").removeClass("highcharts-no-tooltip").css(S({color:"string"==typeof f?l.renderer.getContrast(f):"#333333"},a)).add(e),this.collapseButton.element.point=this}},e.prototype.toggleCollapse=function(t){var e=this.series;this.update({collapsed:null!=t?t:!this.collapsed},!1,void 0,!1),M(e,"toggleCollapse"),e.redraw()},e.prototype.destroy=function(){this.collapseButton&&(this.collapseButton.destroy(),delete this.collapseButton,this.collapseButton=void 0),this.linkToParent&&(this.linkToParent.destroy(),delete this.linkToParent),t.prototype.destroy.apply(this,arguments)},e.prototype.getCollapseBtnPosition=function(t){var e=this.series.chart.inverted,i=t.width,o=t.height,r=this.shapeArgs||{},n=r.x,s=r.y,a=r.width,l=r.height;return{x:(void 0===n?0:n)+t.x+(e?-(.3*o):(void 0===a?0:a)+-.3*i),y:(void 0===s?0:s)+(void 0===l?0:l)/2-o/2+t.y}},e}(T);w(X,"mouseOut",function(){var t=this.collapseButton,e=this.collapseButtonOptions;t&&(null==e?void 0:e.onlyOnHover)&&!this.collapsed&&t.animate({opacity:0})}),w(X,"mouseOver",function(){var t,e;this.collapseButton&&this.visible&&this.collapseButton.animate({opacity:1},null==(e=null==(t=this.series.options.states)?void 0:t.hover)?void 0:e.animation)}),w(X,"click",function(){this.toggleCollapse()});var A=c(620),N=(v().extend,v().isArray),_=v().isNumber,B=v().isObject,R=v().merge,W=v().pick,j=v().relativeLength,E=function(t){var e,i,o,r,n,s,a={};if(B(t))for(r=_(t.from)?t.from:1,s=t.levels,i={},e=B(t.defaults)?t.defaults:{},N(s)&&(i=s.reduce(function(t,i){var o,n,s;return B(i)&&_(i.level)&&(n=W((s=R({},i)).levelIsConstant,e.levelIsConstant),delete s.levelIsConstant,delete s.level,B(t[o=i.level+(n?0:r-1)])?R(!0,t[o],s):t[o]=s),t},{})),n=_(t.to)?t.to:1,o=0;o<=n;o++)a[o]=R({},e,B(i[o])?i[o]:{});return a},V=function(t,e){var i=t.chart,o=t.options,r=o.nodeDistance,n=void 0===r?0:r,s=o.nodeWidth,a=void 0===s?0:s,l=i.plotSizeX,h=void 0===l?1:l;if("auto"===a){if("string"==typeof n&&/%$/.test(n))return h/(e+parseFloat(n)/100*(e-1));var p=Number(n);return(h+p)/(e||1)-p}return j(a,h)},q=function(t){var e,i;return B(t)&&(i=B(t.options)?t.options:{},e=W(t.rootNode,i.rootId,""),B(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e},z=(l=function(t,e){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),D=v().pick,H=v().extend,I=function(t){function e(e,i,o,r){var n=t.call(this,e,i,o)||this;return n.dataLabelOnNull=!0,n.formatPrefix="link",n.isLink=!0,n.node={},n.formatPrefix="link",n.dataLabelOnNull=!0,r&&(n.fromNode=r.node.parentNode.point,n.visible=r.visible,n.toNode=r,n.id=n.toNode.id+"-"+n.fromNode.id),n}return z(e,t),e.prototype.update=function(t,e,i,o){var r={id:this.id,formatPrefix:this.formatPrefix};C().prototype.update.call(this,t,!this.isLink&&e,i,o),this.visible=this.toNode.visible,H(this,r),D(e,!0)&&this.series.chart.redraw(i)},e}(b().seriesTypes.column.prototype.pointClass),Y=function(){function t(){}return t.createDummyNode=function(t,e,i){var o=new k;return o.id=t.id+"-"+i,o.ancestor=t,o.children.push(e),o.parent=t.id,o.parentNode=t,o.point=e.point,o.level=e.level-i,o.relativeXPosition=e.relativeXPosition,o.visible=e.visible,t.children[e.relativeXPosition]=o,e.oldParentNode=t,e.relativeXPosition=0,e.parentNode=o,e.parent=o.id,o},t.prototype.calculatePositions=function(t){var e=t.nodeList;this.resetValues(e);var i=t.tree;i&&(this.calculateRelativeX(i,0),this.beforeLayout(e),this.firstWalk(i),this.secondWalk(i,-i.preX),this.afterLayout(e))},t.prototype.beforeLayout=function(e){for(var i=0;i<e.length;i++)for(var o=e[i],r=0,n=o.children;r<n.length;r++){var s=n[r];if(s&&s.level-o.level>1)for(var a=s.level-o.level-1;a>0;)s=t.createDummyNode(o,s,a),a--}},t.prototype.resetValues=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.mod=0,i.ancestor=i,i.shift=0,i.thread=void 0,i.change=0,i.preX=0}},t.prototype.calculateRelativeX=function(t,e){for(var i=t.children,o=0,r=i.length;o<r;++o)this.calculateRelativeX(i[o],o);t.relativeXPosition=e},t.prototype.firstWalk=function(t){var e;if(t.hasChildren()){for(var i=t.getLeftMostChild(),o=0,r=t.children;o<r.length;o++){var n=r[o];this.firstWalk(n),i=this.apportion(n,i)}this.executeShifts(t);var s=t.getLeftMostChild(),a=t.getRightMostChild(),l=(s.preX+a.preX)/2;(e=t.getLeftSibling())?(t.preX=e.preX+1,t.mod=t.preX-l):t.preX=l}else(e=t.getLeftSibling())?(t.preX=e.preX+1,t.mod=t.preX):t.preX=0},t.prototype.secondWalk=function(t,e){var i,o;t.yPosition=t.preX+e,t.xPosition=null!=(o=null==(i=t.point)?void 0:i.x)?o:t.level;for(var r=0,n=t.children;r<n.length;r++){var s=n[r];this.secondWalk(s,e+t.mod)}},t.prototype.executeShifts=function(t){for(var e=0,i=0,o=t.children.length-1;o>=0;o--){var r=t.children[o];r.preX+=e,r.mod+=e,i+=r.change,e+=r.shift+i}},t.prototype.apportion=function(t,e){var i=t.getLeftSibling();if(i){for(var o=t,r=t,n=i,s=o.getLeftMostSibling(),a=o.mod,l=r.mod,h=n.mod,p=s.mod;n&&n.nextRight()&&o&&o.nextLeft();){n=n.nextRight(),s=s.nextLeft(),o=o.nextLeft(),(r=r.nextRight()).ancestor=t;var d=n.preX+h-(o.preX+a)+1;d>0&&(this.moveSubtree(t.getAncestor(n,e),t,d),a+=d,l+=d),h+=n.mod,a+=o.mod,p+=s.mod,l+=r.mod}n&&n.nextRight()&&!r.nextRight()&&(r.thread=n.nextRight(),r.mod+=h-l),o&&o.nextLeft()&&!s.nextLeft()&&(s.thread=o.nextLeft(),s.mod+=a-p),e=t}return e},t.prototype.moveSubtree=function(t,e,i){var o=e.relativeXPosition-t.relativeXPosition;e.change-=i/o,e.shift+=i,e.preX+=i,e.mod+=i,t.change+=i/o},t.prototype.afterLayout=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.oldParentNode&&(i.relativeXPosition=i.parentNode.relativeXPosition,i.parent=i.oldParentNode.parent,i.parentNode=i.oldParentNode,i.oldParentNode.children.splice(i.relativeXPosition,1,i),i.oldParentNode=void 0)}},t}(),G={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,lineWidth:1,x:0,y:0,height:18,width:18,shape:"circle",style:{cursor:"pointer",fontWeight:"bold",fontSize:"1em"}},fillSpace:!1,tooltip:{linkFormat:"{point.fromNode.id} → {point.toNode.id}",pointFormat:"{point.id}"},dataLabels:{defer:!0,linkTextPath:{attributes:{startOffset:"50%"}},enabled:!0,linkFormatter:function(){return""},pointFormat:void 0,padding:5,style:{textOverflow:"none"}},nodeDistance:30,nodeWidth:void 0},F=c(28),$=c.n(F),K=v().deg2rad,U=v().addEvent,J=v().merge,Q=v().uniqueKey,Z=v().defined,tt=v().extend;function te(t,e){var i=this;e=J(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);var o=this.renderer.url,r=this.text||this,n=r.textPath,s=e.attributes,a=e.enabled;if(t=t||n&&n.path,n&&n.undo(),t&&a){var l=U(r,"afterModifyTree",function(e){if(t&&a){var n=t.attr("id");n||t.attr("id",n=Q());var l={x:0,y:0};Z(s.dx)&&(l.dx=s.dx,delete s.dx),Z(s.dy)&&(l.dy=s.dy,delete s.dy),r.attr(l),i.attr({transform:""}),i.box&&(i.box=i.box.destroy());var h=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:tt(s,{"text-anchor":s.textAnchor,href:""+o+"#".concat(n)}),children:h}}});r.textPath={path:t,undo:l}}else r.attr({dx:0,dy:0}),delete r.textPath;return this.added&&(r.textCache="",this.renderer.buildText(r)),this}function ti(t){var e,i=t.bBox,o=null==(e=this.element)?void 0:e.querySelector("textPath");if(o){for(var r=[],n=this.renderer.fontMetrics(this.element),s=n.b,a=n.h-s,l=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),h=o.innerHTML.replace(l,"").split(/<tspan class="highcharts-br"[^>]*>/),p=h.length,d=function(t,e){var i=e.x,r=e.y,n=(o.getRotationOfChar(t)-90)*K,l=Math.cos(n),h=Math.sin(n);return[[i-a*l,r-a*h],[i+s*l,r+s*h]]},c=0,u=0;u<p;u++){for(var f=h[u].length,v=0;v<f;v+=5)try{var y=c+v+u,g=d(y,o.getStartPositionOfChar(y)),b=g[0],m=g[1];0===v?(r.push(m),r.push(b)):(0===u&&r.unshift(m),u===p-1&&r.push(b))}catch(t){break}c+=f-1;try{var y=c+u,x=o.getEndPositionOfChar(y),P=d(y,x),b=P[0],m=P[1];r.unshift(m),r.unshift(b)}catch(t){break}}r.length&&r.push(r[0].slice()),i.polygon=r}return i}function to(t){var e,i=t.labelOptions,o=t.point,r=i[o.formatPrefix+"TextPath"]||i.textPath;r&&!i.useHTML&&(this.setTextPath((null==(e=o.getDataLabelPath)?void 0:e.call(o,this))||o.graphic,r),o.dataLabelPath&&!r.enabled&&(o.dataLabelPath=o.dataLabelPath.destroy()))}var tr=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),tn={default:y,orthogonal:y,straight:function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.width,s=t.inverted;return t.parentVisible?[["M",e,i],["L",e+(void 0===n?0:n)*(void 0!==s&&s?-1:1),r],["L",o,r]]:[["M",e,i],["L",e,r],["L",e,r]]},curved:function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.offset,s=void 0===n?0:n,a=t.width,l=void 0===a?0:a,h=t.inverted,p=void 0!==h&&h;return t.parentVisible?[["M",e,i],["C",e+s,i,e-s+l*(p?-1:1),r,e+l*(p?-1:1),r],["L",o,r]]:[["M",e,i],["C",e,i,e,r,e,r],["L",o,r]]}},ts=b().series.prototype,ta=b().seriesTypes,tl=ta.treemap,th=ta.column,tp=x().prototype.symbols,td=v().arrayMax,tc=v().crisp,tu=v().extend,tf=v().merge,tv=v().pick,ty=v().relativeLength,tg=v().splat;({compose:function(t){U(t,"afterGetBBox",ti),U(t,"beforeAddingDataLabel",to);var e=t.prototype;e.setTextPath||(e.setTextPath=te)}}).compose($());var tb=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.nodeList=[],e.links=[],e}return tr(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.layoutAlgorythm=new Y;var e=this,i=this.chart.labelCollectors;i.some(function(t){return"collectorFunc"===t.name})||i.push(function(){var t=[];if(e.options.dataLabels&&!tg(e.options.dataLabels)[0].allowOverlap)for(var i=0,o=e.links||[];i<o.length;i++){var r=o[i];r.dataLabel&&t.push(r.dataLabel)}return t})},e.prototype.getLayoutModifiers=function(){var t,e=this,i=this.chart,o=this,r=i.plotSizeX,n=i.plotSizeY,s=(null==(t=o.options.link)?void 0:t.lineWidth)||0,a=td(this.points.map(function(t){return t.node.xPosition})),l=1/0,h=-1/0,p=1/0,d=-1/0,c=0,u=0,f=0,v=0;this.points.forEach(function(t){if(!e.options.fillSpace||t.visible){var i,y=t.node,g=o.mapOptionsToLevel[t.node.level]||{},b=tf(e.options.marker,g.marker,t.options.marker),m=null!=(i=b.width)?i:V(e,a),x=ty(b.radius||0,Math.min(r,n)),P=Math.max(b.lineWidth||0,s),k=b.symbol,L="circle"!==k&&b.height?ty(b.height,n):2*x,C="circle"!==k&&m?ty(m,r):2*x;y.nodeSizeX=C,y.nodeSizeY=L,y.xPosition<=l&&(l=y.xPosition,u=Math.max(C+P,u)),y.xPosition>=h&&(h=y.xPosition,c=Math.max(C+P,c)),y.yPosition<=p&&(p=y.yPosition,v=Math.max(L+P,v)),y.yPosition>=d&&(d=y.yPosition,f=Math.max(L+P,f))}});var y=d===p?1:(n-(v+f)/2)/(d-p),g=d===p?n/2:-y*p+v/2,b=h===l?1:(r-(c+c)/2)/(h-l),m=h===l?r/2:-b*l+u/2;return{ax:b,bx:m,ay:y,by:g}},e.prototype.getLinks=function(){var t=this,e=this,i=[];return this.data.forEach(function(o){var r,n=e.mapOptionsToLevel[null!=(r=o.node.level)?r:0]||{};if(o.node.parent){var s=tf(n,o.options);if(!o.linkToParent||o.linkToParent.destroyed){var a=new e.LinkClass(e,s,void 0,o);o.linkToParent=a}else o.collapsed=tv(o.collapsed,(t.mapOptionsToLevel[o.node.level]||{}).collapsed),o.linkToParent.visible=o.linkToParent.toNode.visible;o.linkToParent.index=i.push(o.linkToParent)-1}else o.linkToParent&&(e.links.splice(o.linkToParent.index),o.linkToParent.destroy(),delete o.linkToParent)}),i},e.prototype.buildTree=function(e,i,o,r,n){var s,a=this.points[i];return o=null!=(s=null==a?void 0:a.level)?s:o,t.prototype.buildTree.call(this,e,i,o,r,n)},e.prototype.markerAttribs=function(){return{}},e.prototype.setCollapsedStatus=function(t,e){var i=this,o=t.point;o&&(o.collapsed=tv(o.collapsed,(this.mapOptionsToLevel[t.level]||{}).collapsed),o.visible=e,e=!1!==e&&!o.collapsed),t.children.forEach(function(t){i.setCollapsedStatus(t,e)})},e.prototype.drawTracker=function(){th.prototype.drawTracker.apply(this,arguments),th.prototype.drawTracker.call(this,this.links)},e.prototype.translate=function(){var t,e=this,i=this.options,o=q(this);ts.translate.call(this);var r=this.tree=this.getTree();t=this.nodeMap[o],""===o||t&&t.children.length||(this.setRootNode("",!1),o=this.rootNode,t=this.nodeMap[o]),this.mapOptionsToLevel=E({from:t.level+1,levels:i.levels,to:r.height,defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:i.colorByPoint}}),this.setCollapsedStatus(r,!0),this.links=this.getLinks(),this.setTreeValues(r),this.layoutAlgorythm.calculatePositions(this),this.layoutModifier=this.getLayoutModifiers(),this.points.forEach(function(t){e.translateNode(t)}),this.points.forEach(function(t){t.linkToParent&&e.translateLink(t.linkToParent)}),i.colorByPoint||this.setColorRecursive(this.tree)},e.prototype.translateLink=function(t){var e,i,o,r,n,s,a,l,h,p=t.fromNode,d=t.toNode,c=(null==(e=this.options.link)?void 0:e.lineWidth)||0,u=tv(null==(i=this.options.link)?void 0:i.curveFactor,.5),f=d.x!==d.node.level||p.x!==p.node.level,v=tv(null==(o=t.options.link)?void 0:o.type,null==(r=this.options.link)?void 0:r.type,"default");if(p.shapeArgs&&d.shapeArgs){var y=p.shapeArgs.width||0,g=this.chart.inverted,b=tc((p.shapeArgs.y||0)+(p.shapeArgs.height||0)/2,c),m=tc((d.shapeArgs.y||0)+(d.shapeArgs.height||0)/2,c),x=tc((p.shapeArgs.x||0)+y,c),P=tc(d.shapeArgs.x||0,c);g&&(x-=Math.round(y),P+=Math.round(d.shapeArgs.width||0));var k=d.node.xPosition-p.node.xPosition,L=Math.abs(P-x)+y,C=(f?L:L/k)-y,O=tc((P+x)/2,c),T=ty(null!=(l=null!=(s=null==(n=t.options.link)?void 0:n.bendAt)?s:null==(a=this.options.link)?void 0:a.bendAt)?l:"50%",L-y);t.shapeType="path",t.plotX=O,t.plotY=m,t.shapeArgs={d:tn[v]({x1:x,y1:b,x2:P,y2:m,width:C,offset:C*u*(g?-1:1),inverted:g,parentVisible:d.visible,radius:null==(h=this.options.link)?void 0:h.radius,bendAt:T})},t.dlBox={x:(x+P)/2,y:(b+m)/2,height:c,width:0},t.tooltipPos=g?[(this.chart.plotSizeY||0)-t.dlBox.y,(this.chart.plotSizeX||0)-t.dlBox.x]:[t.dlBox.x,t.dlBox.y]}},e.prototype.drawNodeLabels=function(t){for(var e,i,o,r,n,s,a=this.mapOptionsToLevel,l=0;l<t.length;l++){var h=t[l];if(s=a[h.node.level],n={style:{}},s&&s.dataLabels&&(n=tf(n,s.dataLabels),this.hasDataLabels=function(){return!0}),h.shapeArgs&&this.options.dataLabels){var p={},d=h.shapeArgs,c=d.width,u=void 0===c?0:c,f=d.height,v=void 0===f?0:f;this.chart.inverted&&(u=(e=[v,u])[0],v=e[1]),(null==(i=tg(this.options.dataLabels)[0].style)?void 0:i.width)||(p.width=""+u+"px"),(null==(o=tg(this.options.dataLabels)[0].style)?void 0:o.lineClamp)||(p.lineClamp=Math.floor(v/16)),tu(n.style,p),null==(r=h.dataLabel)||r.css(p)}h.dlOptions=tf(n,h.options.dataLabels)}ts.drawDataLabels.call(this,t)},e.prototype.alignDataLabel=function(e,i){var o=e.visible;e.visible=!0,t.prototype.alignDataLabel.apply(this,arguments),i.animate({opacity:+(!1!==o)},void 0,function(){o||i.hide()}),e.visible=o},e.prototype.drawDataLabels=function(){this.options.dataLabels&&(this.options.dataLabels=tg(this.options.dataLabels),this.drawNodeLabels(this.points),ts.drawDataLabels.call(this,this.links))},e.prototype.destroy=function(){if(this.links){for(var t=0,e=this.links;t<e.length;t++)e[t].destroy();this.links.length=0}return ts.destroy.apply(this,arguments)},e.prototype.pointAttribs=function(t,e){var i,o=t&&this.mapOptionsToLevel[null!=(i=t.node.level)?i:0]||{},r=t&&t.options,n=o.states&&o.states[e]||{};t&&(t.options.marker=tf(this.options.marker,o.marker,t.options.marker));var s=tv(n&&n.link&&n.link.color,r&&r.link&&r.link.color,o&&o.link&&o.link.color,this.options.link&&this.options.link.color),a=tv(n&&n.link&&n.link.lineWidth,r&&r.link&&r.link.lineWidth,o&&o.link&&o.link.lineWidth,this.options.link&&this.options.link.lineWidth),l=ts.pointAttribs.call(this,t,e);return t&&(t.isLink&&(l.stroke=s,l["stroke-width"]=a,delete l.fill),t.visible||(l.opacity=0)),l},e.prototype.drawPoints=function(){tl.prototype.drawPoints.apply(this,arguments),th.prototype.drawPoints.call(this,this.links)},e.prototype.translateNode=function(t){var e=this.chart,i=t.node,o=t.plotX,r=void 0===o?0:o,n=e.plotSizeY,s=e.plotSizeX,a=this.layoutModifier,l=a.ax,h=a.bx,p=a.ay,d=a.by,c=this.isCartesian?e.inverted?s-r:r:l*i.xPosition+h,u=p*i.yPosition+d,f=this.mapOptionsToLevel[i.level]||{},v=tf(this.options.marker,f.marker,t.options.marker).symbol,y=i.nodeSizeY,g=i.nodeSizeX,b=this.options.reversed,m=i.x=e.inverted?s-g/2-c:c-g/2,x=i.y=b?u-y/2:n-u-y/2,P=tv(t.options.borderRadius,f.borderRadius,this.options.borderRadius),k=tp[v||"circle"];if(void 0===k?(t.hasImage=!0,t.shapeType="image",t.imageUrl=v.match(/^url\((.*?)\)$/)[1]):t.shapeType="path",!t.visible&&t.linkToParent){var L=t.linkToParent.fromNode;if(L){var C=L.shapeArgs||{},O=C.x,T=void 0===O?0:O,w=C.y,M=void 0===w?0:w,S=C.width,X=C.height;t.shapeArgs||(t.shapeArgs={}),t.hasImage||tu(t.shapeArgs,{d:k(T,M,void 0===S?0:S,void 0===X?0:X,P?{r:P}:void 0)}),tu(t.shapeArgs,{x:T,y:M}),t.plotX=L.plotX,t.plotY=L.plotY}}else t.plotX=m,t.plotY=x,t.shapeArgs={x:m,y:x,width:g,height:y,cursor:t.node.isLeaf?"default":"pointer"},t.hasImage||(t.shapeArgs.d=k(m,x,g,y,P?{r:P}:void 0));t.tooltipPos=e.inverted?[n-x-y/2,s-m-g/2]:[m+g/2,x]},e.defaultOptions=tf(tl.defaultOptions,G),e}(tl);tu(tb.prototype,{forceDL:!0,pointClass:X,NodeClass:k,LinkClass:I,isCartesian:!1}),b().registerSeriesType("treegraph",tb);var tm=v();return u.default}()});