/*
 Highcharts JS v10.1.0 (2022-04-29)
 Organization chart series type

 (c) 2019-2021 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/organization",["highcharts","highcharts/modules/sankey"],function(g){b(g);b.Highcharts=g;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function g(b,m,k,g){b.hasOwnProperty(m)||(b[m]=g.apply(null,k),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:m,module:b[m]}})))}
b=b?b._modules:{};g(b,"Series/Organization/OrganizationPoint.js",[b["Core/Series/SeriesRegistry.js"],b["Core/Utilities.js"]],function(b,m){function k(b){var f=b.linksFrom.length;b.linksFrom.forEach(function(a){a.id===a.toNode.linksTo[0].id?f+=k(a.toNode):f--});return f}var g=this&&this.__extends||function(){var b=function(f,a){b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=d}||function(a,d){for(var c in d)d.hasOwnProperty(c)&&(a[c]=d[c])};return b(f,a)};return function(f,
a){function n(){this.constructor=f}b(f,a);f.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}}(),r=m.defined,t=m.find,v=m.pick;return function(b){function f(){var a=null!==b&&b.apply(this,arguments)||this;a.fromNode=void 0;a.linksFrom=void 0;a.linksTo=void 0;a.options=void 0;a.series=void 0;a.toNode=void 0;return a}g(f,b);f.prototype.getSum=function(){return 1};f.prototype.setNodeColumn=function(){b.prototype.setNodeColumn.call(this);var a=this,n=a.getFromNode().fromNode;if(!r(a.options.column)&&
0!==a.linksTo.length&&n&&"hanging"===n.options.layout){a.options.layout=v(a.options.layout,"hanging");a.hangsFrom=n;var d=-1;t(n.linksFrom,function(c,q){(c=c.toNode===a)&&(d=q);return c});for(var c=0;c<n.linksFrom.length;c++){var q=n.linksFrom[c];q.toNode.id===a.id?c=n.linksFrom.length:d+=k(q.toNode)}a.column=(a.column||0)+d}};return f}(b.seriesTypes.sankey.prototype.pointClass)});g(b,"Series/Organization/OrganizationSeries.js",[b["Series/Organization/OrganizationPoint.js"],b["Core/Series/SeriesRegistry.js"],
b["Core/Utilities.js"]],function(b,m,k){var g=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var a in d)d.hasOwnProperty(a)&&(c[a]=d[a])};return a(b,d)};return function(b,d){function c(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)}}(),r=m.seriesTypes.sankey,t=k.css,v=k.extend,w=k.merge,f=k.pick;k=function(a){function b(){var d=null!==a&&
a.apply(this,arguments)||this;d.data=void 0;d.options=void 0;d.points=void 0;return d}g(b,a);b.curvedPath=function(d,c){for(var b=[],a=0;a<d.length;a++){var e=d[a][1],h=d[a][2];if("number"===typeof e&&"number"===typeof h)if(0===a)b.push(["M",e,h]);else if(a===d.length-1)b.push(["L",e,h]);else if(c){var l=d[a-1],p=d[a+1];if(l&&p){var f=l[1];l=l[2];var u=p[1];p=p[2];if("number"===typeof f&&"number"===typeof u&&"number"===typeof l&&"number"===typeof p&&f!==u&&l!==p){var k=f<u?1:-1,g=l<p?1:-1;b.push(["L",
e-k*Math.min(Math.abs(e-f),c),h-g*Math.min(Math.abs(h-l),c)],["C",e,h,e,h,e+k*Math.min(Math.abs(e-u),c),h+g*Math.min(Math.abs(h-p),c)])}}}else b.push(["L",e,h])}return b};b.prototype.alignDataLabel=function(d,c,b){if(b.useHTML){var q=d.shapeArgs.width,e=d.shapeArgs.height,h=this.options.borderWidth+2*this.options.dataLabels.padding;this.chart.inverted&&(q=e,e=d.shapeArgs.width);e-=h;q-=h;if(h=c.text)t(h.element.parentNode,{width:q+"px",height:e+"px"}),t(h.element,{left:0,top:0,width:"100%",height:"100%",
overflow:"hidden"});c.getBBox=function(){return{width:q,height:e}};c.width=q;c.height=e}a.prototype.alignDataLabel.apply(this,arguments)};b.prototype.createNode=function(d){d=a.prototype.createNode.call(this,d);d.getSum=function(){return 1};return d};b.prototype.pointAttribs=function(d,c){var b=this,a=r.prototype.pointAttribs.call(b,d,c),e=b.mapOptionsToLevel[(d.isNode?d.level:d.fromNode.level)||0]||{},h=d.options,l=e.states&&e.states[c]||{};c=["borderRadius","linkColor","linkLineWidth"].reduce(function(d,
c){d[c]=f(l[c],h[c],e[c],b.options[c]);return d},{});d.isNode?c.borderRadius&&(a.r=c.borderRadius):(a.stroke=c.linkColor,a["stroke-width"]=c.linkLineWidth,delete a.fill);return a};b.prototype.translateLink=function(d){var c=d.fromNode,a=d.toNode,f=Math.round(this.options.linkLineWidth)%2/2,e=Math.floor(c.shapeArgs.x+c.shapeArgs.width)+f,h=Math.floor(c.shapeArgs.y+c.shapeArgs.height/2)+f,l=Math.floor(a.shapeArgs.x)+f,p=Math.floor(a.shapeArgs.y+a.shapeArgs.height/2)+f,k=this.options.hangingIndent;var g=
a.options.offset;var m=/%$/.test(g)&&parseInt(g,10),n=this.chart.inverted;n&&(e-=c.shapeArgs.width,l+=a.shapeArgs.width);g=Math.floor(l+(n?1:-1)*(this.colDistance-this.nodeWidth)/2)+f;m&&(50<=m||-50>=m)&&(g=l=Math.floor(l+(n?-.5:.5)*a.shapeArgs.width)+f,p=a.shapeArgs.y,0<m&&(p+=a.shapeArgs.height));a.hangsFrom===c&&(this.chart.inverted?(h=Math.floor(c.shapeArgs.y+c.shapeArgs.height-k/2)+f,p=a.shapeArgs.y+a.shapeArgs.height):h=Math.floor(c.shapeArgs.y+k/2)+f,g=l=Math.floor(a.shapeArgs.x+a.shapeArgs.width/
2)+f);d.plotY=1;d.shapeType="path";d.shapeArgs={d:b.curvedPath([["M",e,h],["L",g,h],["L",g,p],["L",l,p]],this.options.linkRadius)}};b.prototype.translateNode=function(a,c){r.prototype.translateNode.call(this,a,c);c=a.hangsFrom;var b=this.options.hangingIndent||0,d=this.chart.inverted?-1:1,e=a.shapeArgs,f=this.options.hangingIndentTranslation,g=this.options.minNodeLength||10;if(c)if("cumulative"===f)for(e.height-=b,e.y-=d*b;c;)e.y+=d*b,c=c.hangsFrom;else if("shrink"===f)for(;c&&e.height>b+g;)e.height-=
b,c=c.hangsFrom;else e.height-=b,this.chart.inverted||(e.y+=b);a.nodeHeight=this.chart.inverted?e.width:e.height};b.defaultOptions=w(r.defaultOptions,{borderColor:"#666666",borderRadius:3,linkRadius:10,borderWidth:1,dataLabels:{nodeFormatter:function(){function a(a){return Object.keys(a).reduce(function(b,c){return b+c+":"+a[c]+";"},'style="')+'"'}var b={width:"100%",height:"100%",display:"flex","flex-direction":"row","align-items":"center","justify-content":"center"},f={"max-height":"100%","border-radius":"50%"},
g={width:"100%",padding:0,"text-align":"center","white-space":"normal"},e={margin:0},h={margin:0},k={opacity:.75,margin:"5px"};this.point.image&&(f["max-width"]="30%",g.width="70%");this.series.chart.renderer.forExport&&(b.display="block",g.position="absolute",g.left=this.point.image?"30%":0,g.top=0);b="<div "+a(b)+">";this.point.image&&(b+='<img src="'+this.point.image+'" '+a(f)+">");b+="<div "+a(g)+">";this.point.name&&(b+="<h4 "+a(e)+">"+this.point.name+"</h4>");this.point.title&&(b+="<p "+a(h)+
">"+(this.point.title||"")+"</p>");this.point.description&&(b+="<p "+a(k)+">"+this.point.description+"</p>");return b+"</div></div>"},style:{fontWeight:"normal",fontSize:"13px"},useHTML:!0},hangingIndent:20,hangingIndentTranslation:"inherit",linkColor:"#666666",linkLineWidth:1,minNodeLength:10,nodeWidth:50,tooltip:{nodeFormat:"{point.name}<br>{point.title}<br>{point.description}"}});return b}(r);v(k.prototype,{pointClass:b});m.registerSeriesType("organization",k);"";"";return k});g(b,"masters/modules/organization.src.js",
[],function(){})});
//# sourceMappingURL=organization.js.map