/*
 Highcharts Gantt JS v10.1.0 (2022-04-29)

 Tree Grid

 (c) 2016-2021 Jon Arild Nygard

 License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?(h["default"]=h,module.exports=h):"function"===typeof define&&define.amd?define("highcharts/modules/treegrid",["highcharts"],function(C){h(C);h.Highcharts=C;return h}):h("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(h){function C(h,p,A,x){h.hasOwnProperty(p)||(h[p]=x.apply(null,A),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:p,module:h[p]}})))}h=h?h._modules:{};C(h,
"Core/Axis/BrokenAxis.js",[h["Extensions/Stacking.js"],h["Core/Utilities.js"]],function(h,p){var A=p.addEvent,x=p.find,t=p.fireEvent,n=p.isArray,k=p.isNumber,z=p.pick,D;(function(a){function g(){"undefined"!==typeof this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)}function v(){this.brokenAxis&&this.brokenAxis.hasBreaks&&(this.options.ordinal=!1)}function p(){var u=this.brokenAxis;if(u&&u.hasBreaks){for(var a=this.tickPositions,b=this.tickPositions.info,e=[],m=0;m<a.length;m++)u.isInAnyBreak(a[m])||
e.push(a[m]);this.tickPositions=e;this.tickPositions.info=b}}function D(){this.brokenAxis||(this.brokenAxis=new y(this))}function f(){var a=this.options.connectNulls,b=this.points,e=this.xAxis,d=this.yAxis;if(this.isDirty)for(var m=b.length;m--;){var H=b[m],I=!(null===H.y&&!1===a)&&(e&&e.brokenAxis&&e.brokenAxis.isInAnyBreak(H.x,!0)||d&&d.brokenAxis&&d.brokenAxis.isInAnyBreak(H.y,!0));H.visible=I?!1:!1!==H.options.visible}}function d(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,
z(this.pointArrayMap,["y"]))}function e(a,b){var e=this,u=e.points,m,F,d,l;if(a&&a.brokenAxis&&a.brokenAxis.hasBreaks){var c=a.brokenAxis;b.forEach(function(b){m=c&&c.breakArray||[];F=a.isXAxis?a.min:z(e.options.threshold,a.min);u.forEach(function(e){l=z(e["stack"+b.toUpperCase()],e[b]);m.forEach(function(b){if(k(F)&&k(l)){d=!1;if(F<b.from&&l>b.to||F>b.from&&l<b.from)d="pointBreak";else if(F<b.from&&l>b.from&&l<b.to||F>b.from&&l>b.to&&l<b.from)d="pointInBreak";d&&t(a,d,{point:e,brk:b})}})})})}}function c(){var b=
this.currentDataGrouping,a=b&&b.gapSize;b=this.points.slice();var e=this.yAxis,d=this.options.gapSize,m=b.length-1,c;if(d&&0<m)for("value"!==this.options.gapUnit&&(d*=this.basePointRange),a&&a>d&&a>=this.basePointRange&&(d=a),c=void 0;m--;)c&&!1!==c.visible||(c=b[m+1]),a=b[m],!1!==c.visible&&!1!==a.visible&&(c.x-a.x>d&&(c=(a.x+c.x)/2,b.splice(m+1,0,{isNull:!0,x:c}),e.stacking&&this.options.stacking&&(c=e.stacking.stacks[this.stackKey][c]=new h(e,e.options.stackLabels,!1,c,this.stack),c.total=0)),
c=a);return this.getGraphPath(b)}var b=[];a.compose=function(a,F){-1===b.indexOf(a)&&(b.push(a),a.keepProps.push("brokenAxis"),A(a,"init",D),A(a,"afterInit",g),A(a,"afterSetTickPositions",p),A(a,"afterSetOptions",v));if(-1===b.indexOf(F)){b.push(F);var u=F.prototype;u.drawBreaks=e;u.gappedPath=c;A(F,"afterGeneratePoints",f);A(F,"afterRender",d)}return a};var y=function(){function a(a){this.hasBreaks=!1;this.axis=a}a.isInBreak=function(a,b){var e=a.repeat||Infinity,m=a.from,d=a.to-a.from;b=b>=m?(b-
m)%e:e-(m-b)%e;return a.inclusive?b<=d:b<d&&0!==b};a.lin2Val=function(b){var e=this.brokenAxis;e=e&&e.breakArray;if(!e||!k(b))return b;var d;for(d=0;d<e.length;d++){var m=e[d];if(m.from>=b)break;else m.to<b?b+=m.len:a.isInBreak(m,b)&&(b+=m.len)}return b};a.val2Lin=function(b){var e=this.brokenAxis;e=e&&e.breakArray;if(!e||!k(b))return b;var d=b,m;for(m=0;m<e.length;m++){var c=e[m];if(c.to<=b)d-=c.len;else if(c.from>=b)break;else if(a.isInBreak(c,b)){d-=b-c.from;break}}return d};a.prototype.findBreakAt=
function(a,b){return x(b,function(b){return b.from<a&&a<b.to})};a.prototype.isInAnyBreak=function(b,e){var d=this.axis,m=d.options.breaks||[],c=m.length,I;if(c&&k(b)){for(;c--;)if(a.isInBreak(m[c],b)){var l=!0;I||(I=z(m[c].showPoints,!d.isXAxis))}var G=l&&e?l&&!I:l}return G};a.prototype.setBreaks=function(b,e){var d=this,c=d.axis,y=n(b)&&!!b.length;c.isDirty=d.hasBreaks!==y;d.hasBreaks=y;c.options.breaks=c.userOptions.breaks=b;c.forceRedraw=!0;c.series.forEach(function(b){b.isDirty=!0});y||c.val2lin!==
a.val2Lin||(delete c.val2lin,delete c.lin2val);y&&(c.userOptions.ordinal=!1,c.lin2val=a.lin2Val,c.val2lin=a.val2Lin,c.setExtremes=function(b,a,e,y,m){if(d.hasBreaks){for(var l=this.options.breaks||[],w;w=d.findBreakAt(b,l);)b=w.to;for(;w=d.findBreakAt(a,l);)a=w.from;a<b&&(a=b)}c.constructor.prototype.setExtremes.call(this,b,a,e,y,m)},c.setAxisTranslation=function(){c.constructor.prototype.setAxisTranslation.call(this);d.unitLength=void 0;if(d.hasBreaks){var b=c.options.breaks||[],e=[],y=[],w=z(c.pointRangePadding,
0),m=0,B,g=c.userMin||c.min,f=c.userMax||c.max,u;b.forEach(function(b){B=b.repeat||Infinity;k(g)&&k(f)&&(a.isInBreak(b,g)&&(g+=b.to%B-g%B),a.isInBreak(b,f)&&(f-=f%B-b.from%B))});b.forEach(function(b){r=b.from;B=b.repeat||Infinity;if(k(g)&&k(f)){for(;r-B>g;)r-=B;for(;r<g;)r+=B;for(u=r;u<f;u+=B)e.push({value:u,move:"in"}),e.push({value:u+b.to-b.from,move:"out",size:b.breakSize})}});e.sort(function(b,r){return b.value===r.value?("in"===b.move?0:1)-("in"===r.move?0:1):b.value-r.value});var q=0;var r=
g;e.forEach(function(b){q+="in"===b.move?1:-1;1===q&&"in"===b.move&&(r=b.value);0===q&&k(r)&&(y.push({from:r,to:b.value,len:b.value-r-(b.size||0)}),m+=b.value-r-(b.size||0))});d.breakArray=y;k(g)&&k(f)&&k(c.min)&&(d.unitLength=f-g-m+w,t(c,"afterBreaks"),c.staticScale?c.transA=c.staticScale:d.unitLength&&(c.transA*=(f-c.min+w)/d.unitLength),w&&(c.minPixelPadding=c.transA*(c.minPointOffset||0)),c.min=g,c.max=f)}});z(e,!0)&&c.chart.redraw()};return a}();a.Additions=y})(D||(D={}));return D});C(h,"Core/Axis/GridAxis.js",
[h["Core/Axis/Axis.js"],h["Core/Axis/AxisDefaults.js"],h["Core/Globals.js"],h["Core/Utilities.js"]],function(h,p,A,x){var t=A.dateFormats,n=x.addEvent,k=x.defined,z=x.erase,D=x.find,a=x.isArray,g=x.isNumber,v=x.merge,E=x.pick,J=x.timeUnits,f=x.wrap,d;(function(e){function c(b,r){var a={width:0,height:0};r.forEach(function(r){r=b[r];if(x.isObject(r,!0)){var q=x.isObject(r.label,!0)?r.label:{};r=q.getBBox?q.getBBox().height:0;q.textStr&&!g(q.textPxLength)&&(q.textPxLength=q.getBBox().width);var c=g(q.textPxLength)?
Math.round(q.textPxLength):0;q.textStr&&(c=Math.round(q.getBBox().width));a.height=Math.max(r,a.height);a.width=Math.max(c,a.width)}});"treegrid"===this.options.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode&&(a.width+=this.options.labels.indentation*((this.treeGrid.mapOfPosToGridNode[-1].height||0)-1));return a}function b(){var b=this.grid;(b&&b.columns||[]).forEach(function(b){b.getOffset()})}function d(b){if(!0===(this.options.grid||{}).enabled){var r=this.axisTitle,a=this.height,q=this.horiz,
c=this.left,d=this.offset,l=this.opposite,g=this.options,y=this.top,w=this.width,f=this.tickSize(),m=r&&r.getBBox().width,k=g.title.x,u=g.title.y,G=E(g.title.margin,q?5:10);r=this.chart.renderer.fontMetrics(g.title.style.fontSize,r).f;f=(q?y+a:c)+(q?1:-1)*(l?-1:1)*(f?f[0]/2:0)+(this.side===e.Side.bottom?r:0);b.titlePosition.x=q?c-(m||0)/2-G+k:f+(l?w:0)+d+k;b.titlePosition.y=q?f-(l?a:0)+(l?r:-r)/2+d+u:y-G+u}}function u(){var b=this.chart,a=this.options.grid;a=void 0===a?{}:a;var c=this.userOptions;
if(a.enabled){var e=this.options;e.labels.align=E(e.labels.align,"center");this.categories||(e.showLastLabel=!1);this.labelRotation=0;e.labels.rotation=0}if(a.columns){e=this.grid.columns=[];for(var d=this.grid.columnIndex=0;++d<a.columns.length;){var l=v(c,a.columns[a.columns.length-d-1],{linkedTo:0,type:"category",scrollbar:{enabled:!1}});delete l.grid.columns;l=new h(this.chart,l);l.grid.isColumn=!0;l.grid.columnIndex=d;z(b.axes,l);z(b[this.coll],l);e.push(l)}}}function F(){var b=this.grid,a=this.options;
if(!0===(a.grid||{}).enabled){var c=this.min||0,d=this.max||0;this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions);this.rightWall&&this.rightWall.destroy();if(this.grid&&this.grid.isOuterAxis()&&this.axisLine){var l=a.lineWidth;if(l){l=this.getLinePath(l);var g=l[0],f=l[1],y=((this.tickSize("tick")||[1])[0]-1)*(this.side===e.Side.top||this.side===e.Side.left?-1:1);"M"===g[0]&&"L"===f[0]&&(this.horiz?(g[2]+=y,f[2]+=y):(g[1]+=y,f[1]+=y));!this.horiz&&this.chart.marginRight&&
(g=[g,["L",this.left,g[2]||0]],y=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(d+this.tickmarkOffset)],f=[["M",f[1]||0,this.toPixels(d+this.tickmarkOffset)],y],this.grid.upperBorder||0===c%1||(this.grid.upperBorder=this.grid.renderBorder(g)),this.grid.upperBorder&&(this.grid.upperBorder.attr({stroke:a.lineColor,"stroke-width":a.lineWidth}),this.grid.upperBorder.animate({d:g})),this.grid.lowerBorder||0===d%1||(this.grid.lowerBorder=this.grid.renderBorder(f)),this.grid.lowerBorder&&
(this.grid.lowerBorder.attr({stroke:a.lineColor,"stroke-width":a.lineWidth}),this.grid.lowerBorder.animate({d:f})));this.grid.axisLineExtra?(this.grid.axisLineExtra.attr({stroke:a.lineColor,"stroke-width":a.lineWidth}),this.grid.axisLineExtra.animate({d:l})):this.grid.axisLineExtra=this.grid.renderBorder(l);this.axisLine[this.showAxis?"show":"hide"]()}}(b&&b.columns||[]).forEach(function(b){b.render()});if(!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent&&this.linkedParent.scrollbar)){b=
this.tickmarkOffset;a=this.tickPositions[this.tickPositions.length-1];l=this.tickPositions[0];for(g=f=void 0;(f=this.hiddenLabels.pop())&&f.element;)f.show();for(;(g=this.hiddenMarks.pop())&&g.element;)g.show();(f=this.ticks[l].label)&&(c-l>b?this.hiddenLabels.push(f.hide()):f.show());(f=this.ticks[a].label)&&(a-d>b?this.hiddenLabels.push(f.hide()):f.show());(c=this.ticks[a].mark)&&a-d<b&&0<a-d&&this.ticks[a].isLast&&this.hiddenMarks.push(c.hide())}}}function t(){var b=this.tickPositions&&this.tickPositions.info,
a=this.options,c=this.userOptions.labels||{};(a.grid||{}).enabled&&(this.horiz?(this.series.forEach(function(b){b.options.pointRange=0}),b&&a.dateTimeLabelFormats&&a.labels&&!k(c.align)&&(!1===a.dateTimeLabelFormats[b.unitName].range||1<b.count)&&(a.labels.align="left",k(c.x)||(a.labels.x=3))):"treegrid"!==this.options.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function K(b){var a=this.options;b=b.userOptions;var c=a&&x.isObject(a.grid,!0)?a.grid:{};if(!0===c.enabled){var q=
v(!0,{className:"highcharts-grid-axis "+(b.className||""),dateTimeLabelFormats:{hour:{list:["%H:%M","%H"]},day:{list:["%A, %e. %B","%a, %e. %b","%E"]},week:{list:["Week %W","W%W"]},month:{list:["%B","%b","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"13px"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},b);"xAxis"===this.coll&&(k(b.linkedTo)&&
!k(b.tickPixelInterval)&&(q.tickPixelInterval=350),k(b.tickPixelInterval)||!k(b.linkedTo)||k(b.tickPositioner)||k(b.tickInterval)||(q.tickPositioner=function(b,a){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(c){for(var e=q.units||[],d=void 0,r=void 0,l=void 0,f=0;f<e.length;f++)if(e[f][0]===c.unitName){d=f;break}e[d+1]?(l=e[d+1][0],r=(e[d+1][1]||[1])[0]):"year"===c.unitName&&(l="year",r=10*c.count);c=J[l];this.tickInterval=c*r;return this.getTimeTicks({unitRange:c,
count:r,unitName:l},b,a,this.options.startOfWeek)}}));v(!0,this.options,q);this.horiz&&(a.minPadding=E(b.minPadding,0),a.maxPadding=E(b.maxPadding,0));g(a.grid.borderWidth)&&(a.tickWidth=a.lineWidth=c.borderWidth)}}function m(b){b=(b=b.userOptions)&&b.grid||{};var a=b.columns;b.enabled&&a&&v(!0,this.options,a[a.length-1])}function H(){(this.grid.columns||[]).forEach(function(b){b.setScale()})}function I(b){var c=p.defaultLeftAxisOptions,e=this.horiz,d=this.maxLabelDimensions,q=this.options.grid;q=
void 0===q?{}:q;q.enabled&&d&&(c=2*Math.abs(c.labels.x),e=e?q.cellHeight||c+d.height:c+d.width,a(b.tickSize)?b.tickSize[0]=e:b.tickSize=[e,0])}function l(){this.axes.forEach(function(b){(b.grid&&b.grid.columns||[]).forEach(function(b){b.setAxisSize();b.setAxisTranslation()})})}function G(b){var a=this.grid;(a.columns||[]).forEach(function(a){a.destroy(b.keepEvents)});a.columns=void 0}function w(b){b=b.userOptions||{};var a=b.grid||{};a.enabled&&k(a.borderColor)&&(b.tickColor=b.lineColor=a.borderColor);
this.grid||(this.grid=new L(this));this.hiddenLabels=[];this.hiddenMarks=[]}function M(b){var a=this.label,c=this.axis,d=c.reversed,l=c.chart,q=c.options.grid||{},f=c.options.labels,y=f.align,w=e.Side[c.side],m=b.tickmarkOffset,k=c.tickPositions,u=this.pos-m;k=g(k[b.index+1])?k[b.index+1]-m:(c.max||0)+m;var G=c.tickSize("tick");m=G?G[0]:0;G=G?G[1]/2:0;if(!0===q.enabled){if("top"===w){q=c.top+c.offset;var B=q-m}else"bottom"===w?(B=l.chartHeight-c.bottom+c.offset,q=B+m):(q=c.top+c.len-(c.translate(d?
k:u)||0),B=c.top+c.len-(c.translate(d?u:k)||0));"right"===w?(w=l.chartWidth-c.right+c.offset,d=w+m):"left"===w?(d=c.left+c.offset,w=d-m):(w=Math.round(c.left+(c.translate(d?k:u)||0))-G,d=Math.min(Math.round(c.left+(c.translate(d?u:k)||0))-G,c.left+c.len));this.slotWidth=d-w;b.pos.x="left"===y?w:"right"===y?d:w+(d-w)/2;b.pos.y=B+(q-B)/2;l=l.renderer.fontMetrics(f.style.fontSize,a&&a.element);a=a?a.getBBox().height:0;f.useHTML?b.pos.y+=l.b+-(a/2):(a=Math.round(a/l.h),b.pos.y+=(l.b-(l.h-l.f))/2+-((a-
1)*l.h/2));b.pos.x+=c.horiz&&f.x||0}}function B(b){var a=b.axis,c=b.value;if(a.options.grid&&a.options.grid.enabled){var d=a.tickPositions,e=(a.linkedParent||a).series[0],l=c===d[0];d=c===d[d.length-1];var q=e&&D(e.options.data,function(b){return b[a.isXAxis?"x":"y"]===c}),f=void 0;q&&e.is("gantt")&&(f=v(q),A.seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(f));b.isFirst=l;b.isLast=d;b.point=f}}function N(){var b=this.options,a=this.categories,c=this.tickPositions,d=c[0],e=c[c.length-1],
l=this.linkedParent&&this.linkedParent.min||this.min,f=this.linkedParent&&this.linkedParent.max||this.max,g=this.tickInterval;!0!==(b.grid||{}).enabled||a||!this.horiz&&!this.isLinked||(d<l&&d+g>l&&!b.startOnTick&&(c[0]=l),e>f&&e-g<f&&!b.endOnTick&&(c[c.length-1]=f))}function O(b){var a=this.options.grid;return!0===(void 0===a?{}:a).enabled&&this.categories?this.tickInterval:b.apply(this,Array.prototype.slice.call(arguments,1))}(function(b){b[b.top=0]="top";b[b.right=1]="right";b[b.bottom=2]="bottom";
b[b.left=3]="left"})(e.Side||(e.Side={}));e.compose=function(a,e,g){-1===a.keepProps.indexOf("grid")&&(a.keepProps.push("grid"),a.prototype.getMaxLabelDimensions=c,f(a.prototype,"unsquish",O),n(a,"init",w),n(a,"afterGetOffset",b),n(a,"afterGetTitlePosition",d),n(a,"afterInit",u),n(a,"afterRender",F),n(a,"afterSetAxisTranslation",t),n(a,"afterSetOptions",K),n(a,"afterSetOptions",m),n(a,"afterSetScale",H),n(a,"afterTickSize",I),n(a,"trimTicks",N),n(a,"destroy",G));n(e,"afterSetChartSize",l);n(g,"afterGetLabelPosition",
M);n(g,"labelFormat",B);return a};var L=function(){function b(b){this.axis=b}b.prototype.isOuterAxis=function(){var b=this.axis,a=b.grid.columnIndex,c=b.linkedParent&&b.linkedParent.grid.columns||b.grid.columns,d=a?b.linkedParent:b,e=-1,l=0;b.chart[b.coll].forEach(function(a,c){a.side!==b.side||a.options.isInternal||(l=c,a===d&&(e=c))});return l===e&&(g(a)?c.length===a:!0)};b.prototype.renderBorder=function(b){var a=this.axis,c=a.chart.renderer,d=a.options;b=c.path(b).addClass("highcharts-axis-line").add(a.axisBorder);
c.styledMode||b.attr({stroke:d.lineColor,"stroke-width":d.lineWidth,zIndex:7});return b};return b}();e.Additions=L})(d||(d={}));t.E=function(a){return this.dateFormat("%a",a,!0).charAt(0)};t.W=function(a){var c=this,b=new this.Date(a);["Hours","Milliseconds","Minutes","Seconds"].forEach(function(a){c.set(a,b,0)});var d=(this.get("Day",b)+6)%7;a=new this.Date(b.valueOf());this.set("Date",a,this.get("Date",b)-d+3);d=new this.Date(this.get("FullYear",a),0,1);4!==this.get("Day",d)&&(this.set("Month",
b,0),this.set("Date",b,1+(11-this.get("Day",d))%7));return(1+Math.floor((a.valueOf()-d.valueOf())/6048E5)).toString()};"";return d});C(h,"Gantt/Tree.js",[h["Core/Utilities.js"]],function(h){var p=h.extend,A=h.isNumber,x=h.pick,t=function(k,h){var n=k.reduce(function(a,g){var k=x(g.parent,"");"undefined"===typeof a[k]&&(a[k]=[]);a[k].push(g);return a},{});Object.keys(n).forEach(function(a,g){var k=n[a];""!==a&&-1===h.indexOf(a)&&(k.forEach(function(a){g[""].push(a)}),delete g[a])});return n},n=function(k,
h,t,a,g,v){var E=0,z=0,f=v&&v.after,d=v&&v.before;h={data:a,depth:t-1,id:k,level:t,parent:h};var e,c;"function"===typeof d&&d(h,v);d=(g[k]||[]).map(function(b){var a=n(b.id,k,t+1,b,g,v),d=b.start;b=!0===b.milestone?d:b.end;e=!A(e)||d<e?d:e;c=!A(c)||b>c?b:c;E=E+1+a.descendants;z=Math.max(a.height+1,z);return a});a&&(a.start=x(a.start,e),a.end=x(a.end,c));p(h,{children:d,descendants:E,height:z});"function"===typeof f&&f(h,v);return h};return{getListOfParents:t,getNode:n,getTree:function(k,h){var p=
k.map(function(a){return a.id});k=t(k,p);return n("",null,1,null,k,h)}}});C(h,"Core/Axis/TreeGridTick.js",[h["Core/Utilities.js"]],function(h){var p=h.addEvent,A=h.isObject,x=h.isNumber,t=h.pick,n=h.wrap,k;(function(k){function h(){this.treeGrid||(this.treeGrid=new z(this))}function a(a,d){a=a.treeGrid;var e=!a.labelIcon,c=d.renderer,b=d.xy,f=d.options,g=f.width||0,k=f.height||0,h=b.x-g/2-(f.padding||0);b=b.y-k/2;var n=d.collapsed?90:180,m=d.show&&x(b),v=a.labelIcon;v||(a.labelIcon=v=c.path(c.symbols[f.type](f.x||
0,f.y||0,g,k)).addClass("highcharts-label-icon").add(d.group));v.attr({y:m?0:-9999});c.styledMode||v.attr({cursor:"pointer",fill:t(d.color,"#666666"),"stroke-width":1,stroke:f.lineColor,strokeWidth:f.lineWidth||0});v[e?"attr":"animate"]({translateX:h,translateY:b,rotation:n})}function g(a,d,e,c,b,g,k,h,n){var f=t(this.options&&this.options.labels,g);g=this.pos;var m=this.axis,u="treegrid"===m.options.type;a=a.apply(this,[d,e,c,b,f,k,h,n]);u&&(d=f&&A(f.symbol,!0)?f.symbol:{},f=f&&x(f.indentation)?
f.indentation:0,g=(g=(m=m.treeGrid.mapOfPosToGridNode)&&m[g])&&g.depth||1,a.x+=(d.width||0)+2*(d.padding||0)+(g-1)*f);return a}function v(f){var d=this,e=d.pos,c=d.axis,b=d.label,g=c.treeGrid.mapOfPosToGridNode,k=c.options,h=t(d.options&&d.options.labels,k&&k.labels),n=h&&A(h.symbol,!0)?h.symbol:{},v=(g=g&&g[e])&&g.depth;k="treegrid"===k.type;var m=-1<c.tickPositions.indexOf(e);e=c.chart.styledMode;k&&g&&b&&b.element&&b.addClass("highcharts-treegrid-node-level-"+v);f.apply(d,Array.prototype.slice.call(arguments,
1));k&&b&&b.element&&g&&g.descendants&&0<g.descendants&&(c=c.treeGrid.isCollapsed(g),a(d,{color:!e&&b.styles&&b.styles.color||"",collapsed:c,group:b.parentGroup,options:n,renderer:b.renderer,show:m,xy:b.xy}),n="highcharts-treegrid-node-"+(c?"expanded":"collapsed"),b.addClass("highcharts-treegrid-node-"+(c?"collapsed":"expanded")).removeClass(n),e||b.css({cursor:"pointer"}),[b,d.treeGrid.labelIcon].forEach(function(a){a&&!a.attachedTreeGridEvents&&(p(a.element,"mouseover",function(){b.addClass("highcharts-treegrid-node-active");
b.renderer.styledMode||b.css({textDecoration:"underline"})}),p(a.element,"mouseout",function(){var a=A(h.style)?h.style:{};b.removeClass("highcharts-treegrid-node-active");b.renderer.styledMode||b.css({textDecoration:a.textDecoration})}),p(a.element,"click",function(){d.treeGrid.toggleCollapse()}),a.attachedTreeGridEvents=!0)}))}var E=!1;k.compose=function(a){E||(p(a,"init",h),n(a.prototype,"getLabelPosition",g),n(a.prototype,"renderLabel",v),a.prototype.collapse=function(a){this.treeGrid.collapse(a)},
a.prototype.expand=function(a){this.treeGrid.expand(a)},a.prototype.toggleCollapse=function(a){this.treeGrid.toggleCollapse(a)},E=!0)};var z=function(){function a(a){this.tick=a}a.prototype.collapse=function(a){var d=this.tick,c=d.axis,b=c.brokenAxis;b&&c.treeGrid.mapOfPosToGridNode&&(d=c.treeGrid.collapse(c.treeGrid.mapOfPosToGridNode[d.pos]),b.setBreaks(d,t(a,!0)))};a.prototype.destroy=function(){this.labelIcon&&this.labelIcon.destroy()};a.prototype.expand=function(a){var d=this.tick,c=d.axis,b=
c.brokenAxis;b&&c.treeGrid.mapOfPosToGridNode&&(d=c.treeGrid.expand(c.treeGrid.mapOfPosToGridNode[d.pos]),b.setBreaks(d,t(a,!0)))};a.prototype.toggleCollapse=function(a){var d=this.tick,c=d.axis,b=c.brokenAxis;b&&c.treeGrid.mapOfPosToGridNode&&(d=c.treeGrid.toggleCollapse(c.treeGrid.mapOfPosToGridNode[d.pos]),b.setBreaks(d,t(a,!0)))};return a}();k.Additions=z})(k||(k={}));return k});C(h,"Series/TreeUtilities.js",[h["Core/Color/Color.js"],h["Core/Utilities.js"]],function(h,p){function t(a,g){var k=
g.before,h=g.idRoot,n=g.mapIdToNode[h],f=g.points[a.i],d=f&&f.options||{},e=[],c=0;a.levelDynamic=a.level-(!1!==g.levelIsConstant?0:n.level);a.name=D(f&&f.name,"");a.visible=h===a.id||!0===g.visible;"function"===typeof k&&(a=k(a,g));a.children.forEach(function(b,d){var f=x({},g);x(f,{index:d,siblings:a.children.length,visible:a.visible});b=t(b,f);e.push(b);b.visible&&(c+=b.val)});k=D(d.value,c);a.visible=0<=k&&(0<c||a.visible);a.children=e;a.childrenTotal=c;a.isLeaf=a.visible&&!c;a.val=k;return a}
var x=p.extend,C=p.isArray,n=p.isNumber,k=p.isObject,z=p.merge,D=p.pick;return{getColor:function(a,g){var k=g.index,n=g.mapOptionsToLevel,p=g.parentColor,f=g.parentColorIndex,d=g.series,e=g.colors,c=g.siblings,b=d.points,y=d.chart.options.chart,u;if(a){b=b[a.i];a=n[a.level]||{};if(n=b&&a.colorByPoint){var t=b.index%(e?e.length:y.colorCount);var x=e&&e[t]}if(!d.chart.styledMode){e=b&&b.options.color;y=a&&a.color;if(u=p)u=(u=a&&a.colorVariation)&&"brightness"===u.key&&k&&c?h.parse(p).brighten(k/c*u.to).get():
p;u=D(e,y,x,u,d.color)}var z=D(b&&b.options.colorIndex,a&&a.colorIndex,t,f,g.colorIndex)}return{color:u,colorIndex:z}},getLevelOptions:function(a){var g=null;if(k(a)){g={};var h=n(a.from)?a.from:1;var p=a.levels;var t={};var f=k(a.defaults)?a.defaults:{};C(p)&&(t=p.reduce(function(a,e){if(k(e)&&n(e.level)){var c=z({},e);var b=D(c.levelIsConstant,f.levelIsConstant);delete c.levelIsConstant;delete c.level;e=e.level+(b?0:h-1);k(a[e])?z(!0,a[e],c):a[e]=c}return a},{}));p=n(a.to)?a.to:1;for(a=0;a<=p;a++)g[a]=
z({},f,k(t[a])?t[a]:{})}return g},setTreeValues:t,updateRootId:function(a){if(k(a)){var g=k(a.options)?a.options:{};g=D(a.rootNode,g.rootId,"");k(a.userOptions)&&(a.userOptions.rootId=g);a.rootNode=g}return g}}});C(h,"Core/Axis/TreeGridAxis.js",[h["Core/Axis/BrokenAxis.js"],h["Core/Axis/GridAxis.js"],h["Gantt/Tree.js"],h["Core/Axis/TreeGridTick.js"],h["Series/TreeUtilities.js"],h["Core/Utilities.js"]],function(h,p,A,x,C,n){var k=C.getLevelOptions,t=n.addEvent,D=n.find,a=n.fireEvent,g=n.isArray,v=
n.isObject,E=n.isString,J=n.merge,f=n.pick,d=n.wrap,e;(function(c){function b(a,b){var c=a.collapseEnd||0;a=a.collapseStart||0;c>=b&&(a-=.5);return{from:a,to:c,showPoints:!1}}function e(a,b,c){var d=[],e=[],l={},g="boolean"===typeof b?b:!1,f={},k=-1;a=A.getTree(a,{after:function(a){a=f[a.pos];var b=0,c=0;a.children.forEach(function(a){c+=(a.descendants||0)+1;b=Math.max((a.height||0)+1,b)});a.descendants=c;a.height=b;a.collapsed&&e.push(a)},before:function(a){var b=v(a.data,!0)?a.data:{},c=E(b.name)?
b.name:"",e=l[a.parent];e=v(e,!0)?f[e.pos]:null;var h=function(a){return a.name===c},w;g&&v(e,!0)&&(w=D(e.children,h))?(h=w.pos,w.nodes.push(a)):h=k++;f[h]||(f[h]=w={depth:e?e.depth+1:0,name:c,id:b.id,nodes:[a],children:[],pos:h},-1!==h&&d.push(c),v(e,!0)&&e.children.push(w));E(a.id)&&(l[a.id]=a);w&&!0===b.collapsed&&(w.collapsed=!0);a.pos=h}});f=function(a,b){var c=function(a,d,e){var l=d+(-1===d?0:b-1),g=(l-d)/2,f=d+g;a.nodes.forEach(function(a){var b=a.data;v(b,!0)&&(b.y=d+(b.seriesIndex||0),delete b.seriesIndex);
a.pos=f});e[f]=a;a.pos=f;a.tickmarkOffset=g+.5;a.collapseStart=l+.5;a.children.forEach(function(a){c(a,l+1,e);l=(a.collapseEnd||0)-.5});a.collapseEnd=l+.5;return e};return c(a["-1"],-1,{})}(f,c);return{categories:d,mapOfIdToNode:l,mapOfPosToGridNode:f,collapsedNodes:e,tree:a}}function n(a){a.target.axes.filter(function(a){return"treegrid"===a.options.type}).forEach(function(b){var c=b.options||{},d=c.labels,l=c.uniqueNames;c=c.max;var f=0;if(!b.treeGrid.mapOfPosToGridNode||b.series.some(function(a){return!a.hasRendered||
a.isDirtyData||a.isDirty})){var h=b.series.reduce(function(a,b){b.visible&&((b.options.data||[]).forEach(function(c){b.options.keys&&b.options.keys.length&&(c=b.pointClass.prototype.optionsToObject.call({series:b},c),b.pointClass.setGanttPointAliases(c));v(c,!0)&&(c.seriesIndex=f,a.push(c))}),!0===l&&f++);return a},[]);if(c&&h.length<c)for(var m=h.length;m<=c;m++)h.push({name:m+"\u200b"});c=e(h,l||!1,!0===l?f:1);b.categories=c.categories;b.treeGrid.mapOfPosToGridNode=c.mapOfPosToGridNode;b.hasNames=
!0;b.treeGrid.tree=c.tree;b.series.forEach(function(a){var b=(a.options.data||[]).map(function(b){g(b)&&a.options.keys&&a.options.keys.length&&h.forEach(function(a){0<=b.indexOf(a.x)&&0<=b.indexOf(a.x2)&&(b=a)});return v(b,!0)?J(b):b});a.visible&&a.setData(b,!1)});b.treeGrid.mapOptionsToLevel=k({defaults:d,from:1,levels:d&&d.levels,to:b.treeGrid.tree&&b.treeGrid.tree.height});"beforeRender"===a.type&&(b.treeGrid.collapsedNodes=c.collapsedNodes)}})}function z(a,b){var c=this.treeGrid.mapOptionsToLevel||
{},d=this.ticks,e=d[b],l;if("treegrid"===this.options.type&&this.treeGrid.mapOfPosToGridNode){var f=this.treeGrid.mapOfPosToGridNode[b];(c=c[f.depth])&&(l={labels:c});!e&&m?d[b]=new m(this,b,void 0,void 0,{category:f.name,tickmarkOffset:f.tickmarkOffset,options:l}):(e.parameters.category=f.name,e.options=l,e.addLabel())}else a.apply(this,Array.prototype.slice.call(arguments,1))}function C(a,b,c){var d=this,l="treegrid"===c.type;d.treeGrid||(d.treeGrid=new H(d));l&&(t(b,"beforeRender",n),t(b,"beforeRedraw",
n),t(b,"addSeries",function(a){a.options.data&&(a=e(a.options.data,c.uniqueNames||!1,1),d.treeGrid.collapsedNodes=(d.treeGrid.collapsedNodes||[]).concat(a.collapsedNodes))}),t(d,"foundExtremes",function(){d.treeGrid.collapsedNodes&&d.treeGrid.collapsedNodes.forEach(function(a){var b=d.treeGrid.collapse(a);d.brokenAxis&&(d.brokenAxis.setBreaks(b,!1),d.treeGrid.collapsedNodes&&(d.treeGrid.collapsedNodes=d.treeGrid.collapsedNodes.filter(function(b){return a.collapseStart!==b.collapseStart||a.collapseEnd!==
b.collapseEnd})))})}),t(d,"afterBreaks",function(){"yAxis"===d.coll&&!d.staticScale&&d.chart.options.chart.height&&(d.isDirty=!0)}),c=J({grid:{enabled:!0},labels:{align:"left",levels:[{level:void 0},{level:1,style:{fontWeight:"bold"}}],symbol:{type:"triangle",x:-5,y:-5,height:10,width:10,padding:5}},uniqueNames:!1},c,{reversed:!0,grid:{columns:void 0}}));a.apply(d,[b,c]);l&&(d.hasNames=!0,d.options.showLastLabel=!0)}function K(b){var c=this.options;"treegrid"===c.type?(this.min=f(this.userMin,c.min,
this.dataMin),this.max=f(this.userMax,c.max,this.dataMax),a(this,"foundExtremes"),this.setAxisTranslation(),this.tickmarkOffset=.5,this.tickInterval=1,this.tickPositions=this.treeGrid.mapOfPosToGridNode?this.treeGrid.getTickPositions():[]):b.apply(this,Array.prototype.slice.call(arguments,1))}var m;c.compose=function(a,b,c,e){-1===a.keepProps.indexOf("treeGrid")&&(a.keepProps.push("treeGrid"),m=e,d(a.prototype,"generateTick",z),d(a.prototype,"init",C),d(a.prototype,"setTickInterval",K),a.prototype.utils=
{getNode:A.getNode},p.compose(a,b,e),h.compose(a,c),x.compose(e));return a};var H=function(){function a(a){this.axis=a}a.prototype.setCollapsedStatus=function(a){var b=this.axis,c=b.chart;b.series.forEach(function(b){var d=b.options.data;if(a.id&&d){var e=c.get(a.id);b=d[b.data.indexOf(e)];e&&b&&(e.collapsed=a.collapsed,b.collapsed=a.collapsed)}})};a.prototype.collapse=function(a){var c=this.axis,d=c.options.breaks||[],e=b(a,c.max);d.push(e);a.collapsed=!0;c.treeGrid.setCollapsedStatus(a);return d};
a.prototype.expand=function(a){var c=this.axis,d=c.options.breaks||[],e=b(a,c.max);a.collapsed=!1;c.treeGrid.setCollapsedStatus(a);return d.reduce(function(a,b){b.to===e.to&&b.from===e.from||a.push(b);return a},[])};a.prototype.getTickPositions=function(){var a=this.axis,b=Math.floor(a.min/a.tickInterval)*a.tickInterval,c=Math.ceil(a.max/a.tickInterval)*a.tickInterval;return Object.keys(a.treeGrid.mapOfPosToGridNode||{}).reduce(function(d,e){e=+e;!(e>=b&&e<=c)||a.brokenAxis&&a.brokenAxis.isInAnyBreak(e)||
d.push(e);return d},[])};a.prototype.isCollapsed=function(a){var c=this.axis,d=c.options.breaks||[],e=b(a,c.max);return d.some(function(a){return a.from===e.from&&a.to===e.to})};a.prototype.toggleCollapse=function(a){return this.isCollapsed(a)?this.expand(a):this.collapse(a)};return a}();c.Additions=H})(e||(e={}));return e});C(h,"masters/modules/treegrid.src.js",[h["Core/Globals.js"],h["Core/Axis/TreeGridAxis.js"]],function(h,p){p.compose(h.Axis,h.Chart,h.Series,h.Tick)})});
//# sourceMappingURL=treegrid.js.map