/*
 Highcharts JS v8.1.2 (2020-06-16)

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

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