/*
 Highcharts JS v8.2.0 (2020-08-20)

 (c) 2014-2019 Highsoft AS
 Authors: Jon Arild Nygard / Oystein Moseng

 License: www.highcharts.com/license
*/
(function(e){"object"===typeof module&&module.exports?(e["default"]=e,module.exports=e):"function"===typeof define&&define.amd?define("highcharts/modules/treemap",["highcharts"],function(u){e(u);e.Highcharts=u;return e}):e("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(e){function u(e,d,n,v){e.hasOwnProperty(d)||(e[d]=v.apply(null,n))}e=e?e._modules:{};u(e,"Mixins/TreeSeries.js",[e["Core/Color.js"],e["Core/Utilities.js"]],function(e,d){var n=d.extend,v=d.isArray,p=d.isNumber,l=d.isObject,
h=d.merge,t=d.pick;return{getColor:function(g,f){var n=f.index,h=f.mapOptionsToLevel,l=f.parentColor,d=f.parentColorIndex,C=f.series,r=f.colors,I=f.siblings,m=C.points,p=C.chart.options.chart,x;if(g){m=m[g.i];g=h[g.level]||{};if(h=m&&g.colorByPoint){var v=m.index%(r?r.length:p.colorCount);var B=r&&r[v]}if(!C.chart.styledMode){r=m&&m.options.color;p=g&&g.color;if(x=l)x=(x=g&&g.colorVariation)&&"brightness"===x.key?e.parse(l).brighten(n/I*x.to).get():l;x=t(r,p,B,x,C.color)}var H=t(m&&m.options.colorIndex,
g&&g.colorIndex,v,d,f.colorIndex)}return{color:x,colorIndex:H}},getLevelOptions:function(g){var f=null;if(l(g)){f={};var e=p(g.from)?g.from:1;var d=g.levels;var t={};var A=l(g.defaults)?g.defaults:{};v(d)&&(t=d.reduce(function(f,g){if(l(g)&&p(g.level)){var d=h({},g);var M="boolean"===typeof d.levelIsConstant?d.levelIsConstant:A.levelIsConstant;delete d.levelIsConstant;delete d.level;g=g.level+(M?0:e-1);l(f[g])?n(f[g],d):f[g]=d}return f},{}));d=p(g.to)?g.to:1;for(g=0;g<=d;g++)f[g]=h({},A,l(t[g])?t[g]:
{})}return f},setTreeValues:function z(f,d){var e=d.before,h=d.idRoot,l=d.mapIdToNode[h],r=d.points[f.i],p=r&&r.options||{},m=0,v=[];n(f,{levelDynamic:f.level-(("boolean"===typeof d.levelIsConstant?d.levelIsConstant:1)?0:l.level),name:t(r&&r.name,""),visible:h===f.id||("boolean"===typeof d.visible?d.visible:!1)});"function"===typeof e&&(f=e(f,d));f.children.forEach(function(e,h){var l=n({},d);n(l,{index:h,siblings:f.children.length,visible:f.visible});e=z(e,l);v.push(e);e.visible&&(m+=e.val)});f.visible=
0<m||f.visible;e=t(p.value,m);n(f,{children:v,childrenTotal:m,isLeaf:f.visible&&!m,val:e});return f},updateRootId:function(f){if(l(f)){var d=l(f.options)?f.options:{};d=t(f.rootNode,d.rootId,"");l(f.userOptions)&&(f.userOptions.rootId=d);f.rootNode=d}return d}}});u(e,"Mixins/DrawPoint.js",[],function(){var e=function(d){return"function"===typeof d},d=function(d){var n,p=this,l=p.graphic,h=d.animatableAttribs,t=d.onComplete,g=d.css,f=d.renderer,u=null===(n=p.series)||void 0===n?void 0:n.options.animation;
if(p.shouldDraw())l||(p.graphic=l=f[d.shapeType](d.shapeArgs).add(d.group)),l.css(g).attr(d.attribs).animate(h,d.isNew?!1:u,t);else if(l){var z=function(){p.graphic=l=l.destroy();e(t)&&t()};Object.keys(h).length?l.animate(h,void 0,function(){z()}):z()}};return{draw:d,drawPoint:function(e){(e.attribs=e.attribs||{})["class"]=this.getClassName();d.call(this,e)},isFn:e}});u(e,"Series/TreemapSeries.js",[e["Core/Globals.js"],e["Mixins/TreeSeries.js"],e["Mixins/DrawPoint.js"],e["Core/Color.js"],e["Mixins/LegendSymbol.js"],
e["Core/Series/Point.js"],e["Core/Utilities.js"]],function(e,d,n,v,p,l,h){var t=d.getColor,g=d.getLevelOptions,f=d.updateRootId,u=v.parse,z=h.addEvent,H=h.correctFloat,A=h.defined,C=h.error,r=h.extend,I=h.fireEvent,m=h.isArray,L=h.isNumber,x=h.isObject,F=h.isString,B=h.merge,N=h.objectEach,w=h.pick;d=h.seriesType;var O=h.stableSort,J=e.seriesTypes;h=e.noop;var D=e.Series,P=function(a,b,c){c=c||this;N(a,function(q,k){b.call(c,q,k,a)})},G=function(a,b,c){c=c||this;a=b.call(c,a);!1!==a&&G(a,b,c)},K=
!1;d("treemap","scatter",{allowTraversingTree:!1,animationLimit:250,showInLegend:!1,marker:!1,colorByPoint:!1,dataLabels:{defer:!1,enabled:!0,formatter:function(){var a=this&&this.point?this.point:{};return F(a.name)?a.name:""},inside:!0,verticalAlign:"middle"},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}<br/>"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",
x:-10,y:10}},traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"#e6e6e6",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"#999999",brightness:J.heatmap?0:.1,halo:!1,opacity:.75,shadow:!1}}},{pointArrayMap:["value"],directTouch:!0,optionalAxis:"colorAxis",getSymbol:h,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){a=m(a)?a:[];var c=m(b)?b:[];b=a.reduce(function(a,
b,c){b=w(b.parent,"");"undefined"===typeof a[b]&&(a[b]=[]);a[b].push(c);return a},{"":[]});P(b,function(a,b,d){""!==b&&-1===c.indexOf(b)&&(a.forEach(function(a){d[""].push(a)}),delete d[b])});return b},getTree:function(){var a=this.data.map(function(a){return a.id});a=this.getListOfParents(this.data,a);this.nodeMap=[];return this.buildNode("",-1,0,a,null)},hasData:function(){return!!this.processedXData.length},init:function(a,b){var c=e.colorMapSeriesMixin;c&&(this.colorAttribs=c.colorAttribs);c=
z(this,"setOptions",function(a){a=a.userOptions;A(a.allowDrillToNode)&&!A(a.allowTraversingTree)&&(a.allowTraversingTree=a.allowDrillToNode,delete a.allowDrillToNode);A(a.drillUpButton)&&!A(a.traverseUpButton)&&(a.traverseUpButton=a.drillUpButton,delete a.drillUpButton)});D.prototype.init.call(this,a,b);delete this.opacity;this.eventsToUnbind.push(c);this.options.allowTraversingTree&&this.eventsToUnbind.push(z(this,"click",this.onClickDrillToNode))},buildNode:function(a,b,c,d,k){var e=this,q=[],f=
e.points[b],g=0,E;(d[a]||[]).forEach(function(b){E=e.buildNode(e.points[b].id,b,c+1,d,a);g=Math.max(E.height+1,g);q.push(E)});b={id:a,i:b,children:q,height:g,level:c,parent:k,visible:!1};e.nodeMap[b.id]=b;f&&(f.node=b);return b},setTreeValues:function(a){var b=this,c=b.options,d=b.nodeMap[b.rootNode];c="boolean"===typeof c.levelIsConstant?c.levelIsConstant:!0;var k=0,e=[],y=b.points[a.i];a.children.forEach(function(a){a=b.setTreeValues(a);e.push(a);a.ignore||(k+=a.val)});O(e,function(a,b){return a.sortIndex-
b.sortIndex});var f=w(y&&y.options.value,k);y&&(y.value=f);r(a,{children:e,childrenTotal:k,ignore:!(w(y&&y.visible,!0)&&0<f),isLeaf:a.visible&&!k,levelDynamic:a.level-(c?0:d.level),name:w(y&&y.name,""),sortIndex:w(y&&y.sortIndex,-f),val:f});return a},calculateChildrenAreas:function(a,b){var c=this,d=c.options,k=c.mapOptionsToLevel[a.level+1],e=w(c[k&&k.layoutAlgorithm]&&k.layoutAlgorithm,d.layoutAlgorithm),f=d.alternateStartingDirection,g=[];a=a.children.filter(function(a){return!a.ignore});k&&k.layoutStartingDirection&&
(b.direction="vertical"===k.layoutStartingDirection?0:1);g=c[e](b,a);a.forEach(function(a,k){k=g[k];a.values=B(k,{val:a.childrenTotal,direction:f?1-b.direction:b.direction});a.pointValues=B(k,{x:k.x/c.axisRatio,y:100-k.y-k.height,width:k.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this,b=a.xAxis,c=a.yAxis,d=a.chart.styledMode;a.points.forEach(function(k){var e=k.node,f=e.pointValues;e=e.visible;if(f&&e){e=f.height;var q=f.width,g=
f.x,E=f.y,h=d?0:(a.pointAttribs(k)["stroke-width"]||0)%2/2;f=Math.round(b.toPixels(g,!0))-h;q=Math.round(b.toPixels(g+q,!0))-h;g=Math.round(c.toPixels(E,!0))-h;e=Math.round(c.toPixels(E+e,!0))-h;k.shapeArgs={x:Math.min(f,q),y:Math.min(g,e),width:Math.abs(q-f),height:Math.abs(e-g)};k.plotX=k.shapeArgs.x+k.shapeArgs.width/2;k.plotY=k.shapeArgs.y+k.shapeArgs.height/2}else delete k.plotX,delete k.plotY})},setColorRecursive:function(a,b,c,e,k){var d=this,f=d&&d.chart;f=f&&f.options&&f.options.colors;if(a){var q=
t(a,{colors:f,index:e,mapOptionsToLevel:d.mapOptionsToLevel,parentColor:b,parentColorIndex:c,series:d,siblings:k});if(b=d.points[a.i])b.color=q.color,b.colorIndex=q.colorIndex;(a.children||[]).forEach(function(b,c){d.setColorRecursive(b,q.color,q.colorIndex,c,a.children.length)})}},algorithmGroup:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,
b){return Math.max(a/b,b/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/
this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,c,d){var k,e,f,q,g=c.lW,h=c.lH,l=c.plot,p=0,r=c.elArr.length-1;if(b)g=c.nW,h=c.nH;else var m=c.elArr[c.elArr.length-1];c.elArr.forEach(function(a){if(b||p<r)0===c.direction?(k=l.x,e=l.y,f=g,q=a/f):(k=l.x,e=l.y,q=h,f=a/q),d.push({x:k,y:e,width:f,height:H(q)}),0===c.direction?l.y+=q:l.x+=f;p+=1});c.reset();0===c.direction?
c.width-=g:c.height-=h;l.y=l.parent.y+(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);a&&(c.direction=1-c.direction);b||c.addElement(m)},algorithmLowAspectRatio:function(a,b,c){var d=[],k=this,e,f={x:b.x,y:b.y,parent:b},g=0,l=c.length-1,h=new this.algorithmGroup(b.height,b.width,b.direction,f);c.forEach(function(c){e=c.val/b.val*b.height*b.width;h.addElement(e);h.lP.nR>h.lP.lR&&k.algorithmCalcPoints(a,!1,h,d,f);g===l&&k.algorithmCalcPoints(a,!0,h,d,f);g+=1});return d},algorithmFill:function(a,
b,c){var d=[],k,e=b.direction,f=b.x,g=b.y,h=b.width,l=b.height,p,r,m,n;c.forEach(function(c){k=c.val/b.val*b.height*b.width;p=f;r=g;0===e?(n=l,m=k/n,h-=m,f+=m):(m=h,n=k/m,l-=n,g+=n);d.push({x:p,y:r,width:m,height:n});a&&(e=1-e)});return d},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a=
this,b=a.options,c=f(a);D.prototype.translate.call(a);var d=a.tree=a.getTree();var e=a.nodeMap[c];a.renderTraverseUpButton(c);a.mapOptionsToLevel=g({from:e.level+1,levels:b.levels,to:d.height,defaults:{levelIsConstant:a.options.levelIsConstant,colorByPoint:b.colorByPoint}});""===c||e&&e.children.length||(a.setRootNode("",!1),c=a.rootNode,e=a.nodeMap[c]);G(a.nodeMap[a.rootNode],function(b){var c=!1,d=b.parent;b.visible=!0;if(d||""===d)c=a.nodeMap[d];return c});G(a.nodeMap[a.rootNode].children,function(a){var b=
!1;a.forEach(function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});a.setTreeValues(d);a.axisRatio=a.xAxis.len/a.yAxis.len;a.nodeMap[""].pointValues=c={x:0,y:0,width:100,height:100};a.nodeMap[""].values=c=B(c,{width:c.width*a.axisRatio,direction:"vertical"===b.layoutStartingDirection?0:1,val:d.val});a.calculateChildrenAreas(d,c);a.colorAxis||b.colorByPoint||a.setColorRecursive(a.tree);b.allowTraversingTree&&(b=e.pointValues,a.xAxis.setExtremes(b.x,b.x+b.width,!1),
a.yAxis.setExtremes(b.y,b.y+b.height,!1),a.xAxis.setScale(),a.yAxis.setScale());a.setPointValues()},drawDataLabels:function(){var a=this,b=a.mapOptionsToLevel,c,d;a.points.filter(function(a){return a.node.visible}).forEach(function(e){d=b[e.node.level];c={style:{}};e.node.isLeaf||(c.enabled=!1);d&&d.dataLabels&&(c=B(c,d.dataLabels),a._hasPointLabels=!0);e.shapeArgs&&(c.style.width=e.shapeArgs.width,e.dataLabel&&e.dataLabel.css({width:e.shapeArgs.width+"px"}));e.dlOptions=B(c,e.options.dataLabels)});
D.prototype.drawDataLabels.call(this)},alignDataLabel:function(a,b,c){var d=c.style;!A(d.textOverflow)&&b.text&&b.getBBox().width>b.text.textWidth&&b.css({textOverflow:"ellipsis",width:d.width+="px"});J.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:(a.node.zIndex||0)+1})},pointAttribs:function(a,b){var c=x(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},d=a&&c[a.node.level]||{};c=this.options;var e=b&&c.states[b]||{},f=a&&a.getClassName()||"";a={stroke:a&&
a.borderColor||d.borderColor||e.borderColor||c.borderColor,"stroke-width":w(a&&a.borderWidth,d.borderWidth,e.borderWidth,c.borderWidth),dashstyle:a&&a.borderDashStyle||d.borderDashStyle||e.borderDashStyle||c.borderDashStyle,fill:a&&a.color||this.color};-1!==f.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==f.indexOf("highcharts-internal-node-interactive")?(b=w(e.opacity,c.opacity),a.fill=u(a.fill).setOpacity(b).get(),a.cursor="pointer"):-1!==f.indexOf("highcharts-internal-node")?
a.fill="none":b&&(a.fill=u(a.fill).brighten(e.brightness).get());return a},drawPoints:function(){var a=this,b=a.chart,c=b.renderer,d=b.styledMode,e=a.options,f=d?{}:e.shadow,g=e.borderRadius,h=b.pointCount<e.animationLimit,l=e.allowTraversingTree;a.points.forEach(function(b){var k=b.node.levelDynamic,q={},m={},p={},n="level-group-"+k,t=!!b.graphic,u=h&&t,v=b.shapeArgs;b.shouldDraw()&&(g&&(m.r=g),B(!0,u?q:m,t?v:{},d?{}:a.pointAttribs(b,b.selected&&"select")),a.colorAttribs&&d&&r(p,a.colorAttribs(b)),
a[n]||(a[n]=c.g(n).attr({zIndex:1E3-k}).add(a.group),a[n].survive=!0));b.draw({animatableAttribs:q,attribs:m,css:p,group:a[n],renderer:c,shadow:f,shapeArgs:v,shapeType:"rect"});l&&b.graphic&&(b.drillId=e.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b))})},onClickDrillToNode:function(a){var b=(a=a.point)&&a.drillId;F(b)&&(this.isDrillAllowed?this.isDrillAllowed(b):1)&&(a.setState(""),this.setRootNode(b,!0,{trigger:"click"}))},drillToByGroup:function(a){var b=!1;1!==a.node.level-this.nodeMap[this.rootNode].level||
a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=this.nodeMap[this.rootNode];a&&F(a.parent)&&this.setRootNode(a.parent,!0,{trigger:"traverseUpButton"})},drillToNode:function(a,b){C(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"});this.setRootNode(a,b)},setRootNode:function(a,b,c){a=r({newRootId:a,previousRootId:this.rootNode,
redraw:w(b,!0),series:this},c);I(this,"setRootNode",a,function(a){var b=a.series;b.idPreviousRoot=a.previousRootId;b.rootNode=a.newRootId;b.isDirty=!0;a.redraw&&b.chart.redraw()})},isDrillAllowed:function(a){var b=this.tree,c=b.children[0];return!(1===b.children.length&&(""===this.rootNode&&a===c.id||this.rootNode===c.id&&""===a))},renderTraverseUpButton:function(a){var b=this,c=b.nodeMap[a],d=b.options.traverseUpButton,e=w(d.text,c.name,"< Back");""!==a&&(!b.isDrillAllowed||F(c.parent)&&b.isDrillAllowed(c.parent))?
this.drillUpButton?(this.drillUpButton.placed=!1,this.drillUpButton.attr({text:e}).align()):(c=(a=d.theme)&&a.states,this.drillUpButton=this.chart.renderer.button(e,null,null,function(){b.drillUp()},a,c&&c.hover,c&&c.select).addClass("highcharts-drillup-button").attr({align:d.position.align,zIndex:7}).add().align(d.position,!1,d.relativeTo||"plotBox")):b.drillUpButton&&(b.drillUpButton=b.drillUpButton.destroy())},buildKDTree:h,drawLegendSymbol:p.drawRectangle,getExtremes:function(){var a=D.prototype.getExtremes.call(this,
this.colorValueData),b=a.dataMax;this.valueMin=a.dataMin;this.valueMax=b;return D.prototype.getExtremes.call(this)},getExtremesFromAll:!0,setState:function(a){this.options.inactiveOtherPoints=!0;D.prototype.setState.call(this,a,!1);this.options.inactiveOtherPoints=!1},utils:{recursive:G}},{draw:n.drawPoint,setVisible:J.pie.prototype.pointClass.prototype.setVisible,getClassName:function(){var a=l.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?
a+=" highcharts-above-level":this.node.isLeaf||w(c.interactByLeaf,!c.allowTraversingTree)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";return a},isValid:function(){return this.id||L(this.value)},setState:function(a){l.prototype.setState.call(this,a);this.graphic&&this.graphic.attr({zIndex:"hover"===a?1:0})},shouldDraw:function(){return L(this.plotY)&&null!==this.y}});z(e.Series,"afterBindAxes",function(){var a=this.xAxis,b=this.yAxis;if(a&&b)if(this.is("treemap")){var c=
{endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};r(b.options,c);r(a.options,c);K=!0}else K&&(b.setOptions(b.userOptions),a.setOptions(a.userOptions),K=!1)});""});u(e,"masters/modules/treemap.src.js",[],function(){})});
//# sourceMappingURL=treemap.js.map