let t;/**
 * Highcharts Gantt JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/treegrid
 * @requires highcharts
 *
 * Tree Grid
 *
 * (c) 2016-2026 Highsoft AS
 * Author: Jon Arild Nygård
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as e from"../highcharts.js";var i,s,o,r={};r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let n=e.default;var l=r.n(n);let a=e.default.StackItem;var d=r.n(a);let{doc:h,win:c}=l();function f(t,e,i,s={}){let o="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let r=o.hcEvents;l().Point&&t instanceof l().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let n=t.addEventListener;n&&n.call(t,e,i,!!l().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==e.indexOf("touch"):s.passive,capture:!1}),r[e]||(r[e]=[]);let a={fn:i,order:"number"==typeof s.order?s.order:1/0};return r[e].push(a),r[e].sort((t,e)=>t.order-e.order),function(){B(t,e,i)}}function p(t,e){return t>1e14?t:parseFloat(t.toPrecision(e||14))}function u(t){return null!=t}function m(t,e){let i=t.length;for(;i--;)if(t[i]===e){t.splice(i,1);break}}function g(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function k(t,e,i,s){if(i=i||{},h?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==l())){let s=h.createEvent("Events");s.initEvent(e,!0,!0),i=g(s,i),t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(e,i)}else if(t.hcEvents){i.target||g(i,{preventDefault:function(){i.defaultPrevented=!0},target:t,type:e});let s=[],o=t,r=!1;for(;o.hcEvents;)Object.hasOwnProperty.call(o,"hcEvents")&&o.hcEvents[e]&&(s.length&&(r=!0),s.unshift.apply(s,o.hcEvents[e])),o=Object.getPrototypeOf(o);r&&s.sort((t,e)=>t.order-e.order),s.forEach(e=>{!1===e.fn.call(t,i,t)&&i.preventDefault()})}s&&!i.defaultPrevented&&s.call(t,i)}let x=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){let i,s=t.length;for(i=0;i<s;i++)if(e(t[i],i))return t[i]};function b(t){return O(t)&&"number"==typeof t.nodeType}function y(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function v(t){return"string"==typeof t}function P(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function O(t,e){return!!t&&"object"==typeof t&&(!e||!P(t))}function E(t,...e){let i,s=[t,...e],o={},r=function(t,e){return"object"!=typeof t&&(t={}),A(e,function(i,s){if("__proto__"!==s&&"constructor"!==s){let o;!O(i,!0)||(o=i?.constructor,O(i,!0)&&!b(i)&&o?.name&&"Object"!==o.name)||b(i)?t[s]=e[s]:t[s]=r(t[s]||{},i)}}),t};!0===t&&(o=s[1],s=Array.prototype.slice.call(s,2));let n=s.length;for(i=0;i<n;i++)o=r(o,s[i]);return o}function A(t,e,i){for(let s in t)Object.hasOwnProperty.call(t,s)&&e.call(i||t[s],t[s],s,t)}function G(){let t=arguments,e=t.length;for(let i=0;i<e;i++){let e=t[i];if(null!=e)return e}}function B(t,e,i){function s(e,i){let s=t.removeEventListener;s&&s.call(t,e,i,!1)}function o(i){let o,r;t.nodeName&&(e?(o={})[e]=!0:o=i,A(o,function(t,e){if(i[e])for(r=i[e].length;r--;)s(e,i[e][r].fn)}))}let r="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(r,"hcEvents")){let t=r.hcEvents;if(e){let r=t[e]||[];i?(t[e]=r.filter(function(t){return i!==t.fn}),s(e,i)):(o(t),t[e]=[])}else o(t),delete r.hcEvents}}function I(t,e,i){let s=t[e];t[e]=function(){let t=arguments,e=this;return i.apply(this,[function(){return s.apply(e,arguments.length?arguments:t)}].concat([].slice.call(arguments)))}}!function(t){function e(){void 0!==this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)}function i(){Object.keys(this.options.breaks?.[0]||{}).length&&(this.options.ordinal=!1)}function s(){let t=this.brokenAxis;if(t?.hasBreaks){let e=this.tickPositions,i=this.tickPositions.info,s=[];for(let i=0;i<e.length;i++)t.isInAnyBreak(e[i])||s.push(e[i]);this.tickPositions=s,this.tickPositions.info=i}}function o(){this.brokenAxis||(this.brokenAxis=new h(this))}function r(){let{isDirty:t,options:{connectNulls:e},points:i,xAxis:s,yAxis:o}=this;if(t){let t=i.length;for(;t--;){let r=i[t],n=(null!==r.y||!1!==e)&&(s?.brokenAxis?.isInAnyBreak(r.x,!0)||o?.brokenAxis?.isInAnyBreak(r.y,!0));r.visible=!n&&!1!==r.options.visible}}}function n(){this.drawBreaks(this.xAxis,["x"]),this.drawBreaks(this.yAxis,G(this.pointArrayMap,["y"]))}function l(t,e){let i,s,o,r=this,n=r.points;if(t?.brokenAxis?.hasBreaks){let l=t.brokenAxis;e.forEach(function(e){i=l?.breakArray||[],s=t.isXAxis?t.min:G(r.options.threshold,t.min),n.forEach(function(r){o=r["stack"+e.toUpperCase()]??r[e],i.forEach(function(e){if(y(s)&&y(o)){let i="";s<e.from&&o>e.to||s>e.from&&o<e.from?i="pointBreak":(s<e.from&&o>e.from&&o<e.to||s>e.from&&o>e.to&&o<e.from)&&(i="pointInBreak"),i&&k(t,i,{point:r,brk:e})}})})})}}function a(){let t=this.currentDataGrouping,e=t?.gapSize,i=this.points.slice(),s=this.yAxis,o=this.options.gapSize,r=i.length-1;if(o&&r>0){let t,n;for("value"!==this.options.gapUnit&&(o*=this.basePointRange),e&&e>o&&e>=this.basePointRange&&(o=e);r--;)if(n&&!1!==n.visible||(n=i[r+1]),t=i[r],!1!==n.visible&&!1!==t.visible){if(n.x-t.x>o){let e=(t.x+n.x)/2;i.splice(r+1,0,{isNull:!0,x:e}),s.stacking&&this.options.stacking&&((s.stacking.stacks[this.stackKey][e]=new(d())(s,s.options.stackLabels,!1,e,this.stack??"")).total=0)}n=t}}return this.getGraphPath(i)}t.compose=function(t,d){if(!t.keepProps.includes("brokenAxis")){t.keepProps.push("brokenAxis"),f(t,"init",o),f(t,"afterInit",e),f(t,"afterSetTickPositions",s),f(t,"afterSetOptions",i);let h=d.prototype;h.drawBreaks=l,h.gappedPath=a,f(d,"afterGeneratePoints",r),f(d,"afterRender",n)}return t};class h{static isInBreak(t,e){let i=t.repeat||1/0,s=t.from,o=t.to-t.from,r=e>=s?(e-s)%i:i-(s-e)%i;return t.inclusive?r<=o:r<o&&0!==r}static lin2Val(t){let e=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!y(t))return t;let o=t;if(t>e)for(let t of s)if(t.from>o)break;else t.to<=o&&t.to>e?o+=t.len:h.isInBreak(t,o)&&(o+=t.len);else if(t<e)for(let t of s)if(t.from>e)break;else t.from>=o&&t.from<e?o-=t.len:h.isInBreak(t,o)&&(o-=t.len);return o}static val2Lin(t){let e=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!y(t))return t;let o=t;if(t>e){for(let i of s)if(i.to<=t&&i.to>e)o-=i.len;else if(i.from>t)break;else if(h.isInBreak(i,t)){o-=t-i.from;break}}else if(t<e){for(let i of s)if(i.from>=t&&i.from<e)o+=i.len;else if(i.from>e)break;else if(h.isInBreak(i,t)){o+=i.to-t;break}}return o}constructor(t){this.axis=t}findBreakAt(t,e){return x(e,function(e){return e.from<t&&t<e.to})}isInAnyBreak(t,e){let i=this.axis,s=i.options.breaks||[],o=s.length,r,n,l;if(o&&y(t)){for(;o--;)h.isInBreak(s[o],t)&&(r=!0,n||(n=G(s[o].showPoints,!i.isXAxis)));l=r&&e?r&&!n:r}return l}setBreaks(t,e){let i=this,s=i.axis,o=s.chart.time,r=P(t)&&!!Object.keys(t?.[0]||{}).length;s.isDirty=(i.hasBreaks??!1)!==r,i.hasBreaks=r,t?.forEach(t=>{t.from=o.parse(t.from)||0,t.to=o.parse(t.to)||0}),t!==s.options.breaks&&(s.options.breaks=s.userOptions.breaks=t),s.forceRedraw=!0,s.series.forEach(function(t){t.isDirty=!0}),r||s.val2lin!==h.val2Lin||(delete s.val2lin,delete s.lin2val),r&&(s.userOptions.ordinal=!1,s.lin2val=h.lin2Val,s.val2lin=h.val2Lin,s.setExtremes=function(t,e,o,r,n){if(i.hasBreaks&&!s.treeGrid?.tree){let s,o=this.brokenAxis.breakArray||[];for(;s=i.findBreakAt(t,o);)t=s.to;for(;s=i.findBreakAt(e,o);)e=s.from;e<t&&(e=t)}s.constructor.prototype.setExtremes.call(this,t,e,o,r,n)},s.setAxisTranslation=function(){if(s.constructor.prototype.setAxisTranslation.call(this),i.unitLength=void 0,i.hasBreaks){let t=s.options.breaks||[],e=[],o=[],r=s.pointRangePadding??0,n=0,l,a,d=s.userMin??s.min,c=s.userMax??s.max,f=s.dataMin??d,p=s.dataMax??c,u,m;y(s.threshold)&&(f=Math.min(f??s.threshold,s.threshold),p=Math.max(p??s.threshold,s.threshold)),s.treeGrid?.tree||t.forEach(function(t){a=t.repeat||1/0,y(d)&&y(c)&&(h.isInBreak(t,d)&&(d+=t.to%a-d%a),h.isInBreak(t,c)&&(c-=c%a-t.from%a))}),y(f)&&y(p)&&t.forEach(function(t){for(u=t.from,a=t.repeat||1/0;u-a>f;)u-=a;for(;u<f;)u+=a;for(m=u;m<p;m+=a)e.push({value:m,move:"in"}),e.push({value:m+t.to-t.from,move:"out",size:t.breakSize})}),e.sort(function(t,e){return t.value===e.value?("in"!==t.move)-("in"!==e.move):t.value-e.value}),l=0,u=f,e.forEach(t=>{1===(l+="in"===t.move?1:-1)&&"in"===t.move&&(u=t.value),0===l&&y(u)&&(o.push({from:u,to:t.value,len:t.value-u-(t.size||0)}),y(d)&&y(c)&&u<c&&t.value>d&&(n+=t.value-u-(t.size||0)))}),i.breakArray=o,y(d)&&y(c)&&y(s.min)&&(i.unitLength=c-d-n+r,k(s,"afterBreaks"),s.staticScale?s.transA=s.staticScale:i.unitLength&&(s.transA*=(c-s.min+r)/i.unitLength),r&&(s.minPixelPadding=s.transA*(s.minPointOffset||0)),s.min=d,s.max=c)}}),G(e,!0)&&s.chart.redraw()}}t.Additions=h}(s||(s={}));let T=s,w=e.default.Axis;var M=r.n(w);let{dateFormats:L}=l();(i=o||(o={}))[i.top=0]="top",i[i.right=1]="right",i[i.bottom=2]="bottom",i[i.left=3]="left";function N(t,e){let i={width:0,height:0};if(e.forEach(function(e){let s=t[e],o=0,r=0,n;O(s,!0)&&(o=(n=O(s.label,!0)?s.label:{}).getBBox?n.getBBox().height:0,n.textStr&&!y(n.textPxLength)&&(n.textPxLength=n.getBBox().width),r=y(n.textPxLength)?Math.round(n.textPxLength):0,n.textStr&&(r=Math.round(n.getBBox().width)),i.height=Math.max(o,i.height),i.width=Math.max(r,i.width))}),"treegrid"===this.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode){let t=this.treeGrid.mapOfPosToGridNode[-1].height||0;i.width+=this.options.labels.indentation*(t-1)}return i}function C(t){let{grid:e}=this,i=3===this.side;if(i||t.apply(this),!e?.isColumn){let t=e?.columns||[];i&&(t=t.slice().reverse()),t.forEach(t=>{t.getOffset()})}i&&t.apply(this)}function S(t){if(!0===(this.options.grid||{}).enabled){let{axisTitle:e,height:i,horiz:s,left:r,offset:n,opposite:l,options:a,top:d,width:h}=this,c=this.tickSize(),f=e?.getBBox().width,p=a.title.x,u=a.title.y,m=G(a.title.margin,s?5:10),g=e?this.chart.renderer.fontMetrics(e).f:0,k=(s?d+i:r)+(s?1:-1)*(l?-1:1)*(c?c[0]/2:0)+(this.side===o.bottom?g:0);t.titlePosition.x=s?r-(f||0)/2-m+p:k+(l?h:0)+n+p,t.titlePosition.y=s?k-(l?i:0)+(l?g:-g)/2+n+u:d-m+u}}function z(){let t,{chart:e,options:{grid:i={}},userOptions:s}=this;if(i.enabled&&((t=this.options).labels.align=G(t.labels.align,"center"),this.categories||(t.showLastLabel=!1),this.labelRotation=0,t.labels.rotation=0,t.minTickInterval=1),i.columns){let t=this.grid.columns=[],o=this.grid.columnIndex=0;for(;++o<i.columns.length;){let r=E(s,i.columns[o],{isInternal:!0,linkedTo:0,scrollbar:{enabled:!1}},{grid:{columns:void 0}}),n=new(M())(this.chart,r,this.coll);n.grid.isColumn=!0,n.grid.columnIndex=o,m(e.axes,n),m(e[this.coll]||[],n),t.push(n)}}}function W(){let{axisTitle:t,grid:e,options:i}=this;if(!0===(i.grid||{}).enabled){let s=this.min||0,r=this.max||0,n=this.ticks[this.tickPositions[0]];if(t&&!this.chart.styledMode&&n?.slotWidth&&!this.options.title.style.width&&t.css({width:`${n.slotWidth}px`}),this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions),this.rightWall&&this.rightWall.destroy(),this.grid?.isOuterAxis()&&this.axisLine){let t=i.lineWidth;if(t){let e=this.getLinePath(t),n=e[0],l=e[1],a=(this.tickSize("tick")||[1])[0]*(this.side===o.top||this.side===o.left?-1:1);if("M"===n[0]&&"L"===l[0]&&(this.horiz?(n[2]+=a,l[2]+=a):(n[1]+=a,l[1]+=a)),!this.horiz&&this.chart.marginRight){let t=["L",this.left,n[2]||0],e=[n,t],o=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(r+this.tickmarkOffset)],a=[["M",l[1]||0,this.toPixels(r+this.tickmarkOffset)],o];this.grid.upperBorder||s%1==0||(this.grid.upperBorder=this.grid.renderBorder(e)),this.grid.upperBorder&&(this.grid.upperBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.upperBorder.animate({d:e})),this.grid.lowerBorder||r%1==0||(this.grid.lowerBorder=this.grid.renderBorder(a)),this.grid.lowerBorder&&(this.grid.lowerBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.lowerBorder.animate({d:a}))}this.grid.axisLineExtra?(this.grid.axisLineExtra.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.axisLineExtra.animate({d:e})):this.grid.axisLineExtra=this.grid.renderBorder(e),this.axisLine[this.showAxis?"show":"hide"]()}}if((e?.columns||[]).forEach(t=>t.render()),!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent?.scrollbar)&&this.tickPositions.length){let t,e,i=this.tickmarkOffset,o=this.tickPositions[this.tickPositions.length-1],n=this.tickPositions[0];for(;(t=this.hiddenLabels.pop())&&t.element;)t.show();for(;(e=this.hiddenMarks.pop())&&e.element;)e.show();(t=this.ticks[n].label)&&(s-n>i?this.hiddenLabels.push(t.hide()):t.show()),(t=this.ticks[o].label)&&(o-r>i?this.hiddenLabels.push(t.hide()):t.show());let l=this.ticks[o].mark;l&&o-r<i&&o-r>0&&this.ticks[o].isLast&&this.hiddenMarks.push(l.hide())}}}function j(){let t=this.tickPositions?.info,e=this.options,i=e.grid||{},s=this.userOptions.labels||{};i.enabled&&(this.horiz?(this.series.forEach(t=>{t.options.pointRange=0}),t&&e.dateTimeLabelFormats&&e.labels&&!u(s.align)&&(!1===e.dateTimeLabelFormats[t.unitName].range||t.count>1)&&(e.labels.align="left",u(s.x)||(e.labels.x=3))):"treegrid"!==this.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function R(t){let e,i=this.options,s=t.userOptions,o=i&&O(i.grid,!0)?i.grid:{};!0===o.enabled&&(e=E(!0,{className:"highcharts-grid-axis "+(s.className||""),dateTimeLabelFormats:{hour:{list:["%[HM]","%[H]"]},day:{list:["%[AeB]","%[aeb]","%[E]"]},week:{list:["Week %W","W%W"]},month:{list:["%[B]","%[b]","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"0.9em"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0,style:{textOverflow:"ellipsis"}},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},s),"xAxis"===this.coll&&(u(s.linkedTo)&&!u(s.tickPixelInterval)&&(e.tickPixelInterval=350),!(!u(s.tickPixelInterval)&&u(s.linkedTo))||u(s.tickPositioner)||u(s.tickInterval)||u(s.units)||(e.tickPositioner=function(t,i){let s=this.linkedParent?.tickPositions?.info;if(s){let o=e.units||[],r,l=1,a="year";for(let t=0;t<o.length;t++){let e=o[t];if(e&&e[0]===s.unitName){r=t;break}}let d=y(r)&&o[r+1];if(d){a=d[0]||"year";let t=d[1];l=t?.[0]||1}else"year"===s.unitName&&(l=10*s.count);let h=n.timeUnits[a];return this.tickInterval=h*l,this.chart.time.getTimeTicks({unitRange:h,count:l,unitName:a},t,i,this.options.startOfWeek)}})),E(!0,this.options,e),this.horiz&&(i.minPadding=G(s.minPadding,0),i.maxPadding=G(s.maxPadding,0)),y(i.grid.borderWidth)&&(i.tickWidth=i.lineWidth=o.borderWidth))}function D(t){let e=t.userOptions,i=e?.grid||{},s=i.columns;i.enabled&&s&&E(!0,this.options,s[0])}function F(){(this.grid.columns||[]).forEach(t=>t.setScale())}function V(t){let{horiz:e,maxLabelDimensions:i,options:{grid:s={}}}=this;if(s.enabled&&i){let o=2*this.options.labels.distance,r=e?s.cellHeight||o+i.height:o+i.width;P(t.tickSize)?t.tickSize[0]=r:t.tickSize=[r,0]}}function _(){this.axes.forEach(t=>{(t.grid?.columns||[]).forEach(t=>{t.setAxisSize(),t.setAxisTranslation()})})}function H(t){let{grid:e}=this;(e.columns||[]).forEach(e=>e.destroy(t.keepEvents)),e.columns=void 0}function X(t){let e=t.userOptions||{},i=e.grid||{};i.enabled&&u(i.borderColor)&&(e.tickColor=e.lineColor=i.borderColor),this.grid||(this.grid=new Y(this)),this.hiddenLabels=[],this.hiddenMarks=[]}function q(t){let e=this.label,i=this.axis,s=i.reversed,r=i.chart,n=i.options.grid||{},l=i.options.labels,a=l.align,d=o[i.side],h=t.tickmarkOffset,c=i.tickPositions,f=this.pos-h,p=y(c[t.index+1])?c[t.index+1]-h:(i.max||0)+h,u=i.tickSize("tick"),m=u?u[0]:0,g=u?u[1]/2:0;if(!0===n.enabled){let o,n,h,c;if("top"===d?n=(o=i.top+i.offset)-m:"bottom"===d?o=(n=r.chartHeight-i.bottom+i.offset)+m:(o=i.top+i.len-(i.translate(s?p:f)||0),n=i.top+i.len-(i.translate(s?f:p)||0)),"right"===d?c=(h=r.chartWidth-i.right+i.offset)+m:"left"===d?h=(c=i.left+i.offset)-m:(h=Math.round(i.left+(i.translate(s?p:f)||0))-g,c=Math.min(Math.round(i.left+(i.translate(s?f:p)||0))-g,i.left+i.len)),this.slotWidth=c-h,t.pos.x="left"===a?h:"right"===a?c:h+(c-h)/2,t.pos.y=n+(o-n)/2,e){let i=r.renderer.fontMetrics(e),s=e.getBBox().height;if(l.useHTML)t.pos.y+=i.b+-(s/2);else{let e=Math.round(s/i.h);t.pos.y+=(i.b-(i.h-i.f))/2+-((e-1)*i.h/2)}}t.pos.x+=i.horiz&&l.x||0}}function U(t){let{axis:e,value:i}=t;if(e.options.grid?.enabled){let s,o=e.tickPositions,r=(e.linkedParent||e).series[0],n=i===o[0],a=i===o[o.length-1],d=r&&x(r.options.data,function(t){return t[e.isXAxis?"x":"y"]===i});d&&r.is("gantt")&&(s=E(d),l().seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(s,e.chart)),t.isFirst=n,t.isLast=a,t.point=s}}function $(){let t=this.options,e=t.grid||{},i=this.categories,s=this.tickPositions,o=s[0],r=s[1],n=s[s.length-1],l=s[s.length-2],a=this.linkedParent?.min,d=this.linkedParent?.max,h=a||this.min,c=d||this.max,f=this.tickInterval,p=y(h)&&h>=o+f&&h<r,u=y(h)&&o<h&&o+f>h,m=y(c)&&n>c&&n-f<c,g=y(c)&&c<=n-f&&c>l;!0===e.enabled&&!i&&(this.isXAxis||this.isLinked)&&((u||p)&&!t.startOnTick&&(s[0]=h),(m||g)&&!t.endOnTick&&(s[s.length-1]=c))}function K(t){var e;let{options:{grid:i={}}}=this;return!0===i.enabled&&this.categories?this.tickInterval:t.apply(this,(e=arguments,Array.prototype.slice.call(e,1)))}class Y{constructor(t){this.axis=t}isOuterAxis(){let t=this.axis,e=t.chart,i=t.grid.columnIndex,s=t.linkedParent?.grid.columns||t.grid.columns||[],o=i?t.linkedParent:t,r=-1,n=0;return 3===t.side&&!e.inverted&&s.length?!t.linkedParent:((e[t.coll]||[]).forEach((e,i)=>{e.side!==t.side||e.options.isInternal||(n=i,e===o&&(r=i))}),n===r&&(!y(i)||s.length===i))}renderBorder(t){let e=this.axis,i=e.chart.renderer,s=e.options,o=i.path(t).addClass("highcharts-axis-line").add(e.axisGroup);return i.styledMode||o.attr({stroke:s.lineColor,"stroke-width":s.lineWidth,zIndex:7}),o}}L.E=function(t){return this.dateFormat("%a",t,!0).charAt(0)},L.W=function(t){let e=this.toParts(t),i=(e[7]+6)%7,s=e.slice(0);s[2]=e[2]-i+3;let o=this.toParts(this.makeTime(s[0],0,1));return 4!==o[7]&&(e[1]=0,e[2]=1+(11-o[7])%7),(1+Math.floor((this.makeTime(s[0],s[1],s[2])-this.makeTime(o[0],o[1],o[2]))/6048e5)).toString()};function J(t,e,i,s,o,r){let n=r&&r.after,l=r&&r.before,a={data:s,depth:i-1,id:t,level:i,parent:e||""},d=0,h=0,c,f;"function"==typeof l&&l(a,r);let p=(o[t]||[]).map(e=>{let s=J(e.id,t,i+1,e,o,r),n=e.start||NaN,l=!0===e.milestone?n:e.end||NaN;return c=!y(c)||n<c?n:c,f=!y(f)||l>f?l:f,d=d+1+s.descendants,h=Math.max(s.height+1,h),s});return s&&(s.start=G(s.start,c),s.end=G(s.end,f)),g(a,{children:p,descendants:d,height:h}),"function"==typeof n&&n(a,r),a}let Q=function(t,e){let i,s;return J("",null,1,null,(i=[],Object.keys(s=t.reduce((t,e)=>{let{parent:s="",id:o}=e;return void 0===t[s]&&(t[s]=[]),t[s].push(e),o&&i.push(o),t},{})).forEach(t=>{if(""!==t&&-1===i.indexOf(t)){let e=s[t].map(function(t){let{...e}=t;return e});s[""].push(...e),delete s[t]}}),s),e)};function Z(){this.treeGrid||(this.treeGrid=new ti(this))}function tt(t,e,i,s,o,r,n,l,a){let d,h,c,f=G(this.options?.labels,r),p=this.pos,u=this.axis,m="treegrid"===u.type,g=t.apply(this,[e,i,s,o,f,n,l,a]);if(m){let{width:t=0,padding:e=5*!u.linkedParent}=f&&O(f.symbol,!0)?f.symbol:{},i=f&&y(f.indentation)?f.indentation:0;d=u.treeGrid.mapOfPosToGridNode,h=d?.[p],c=h?.depth||1,g.x+=t+2*e+(c-1)*i}return g}function te(t){let e,{pos:i,axis:s,label:o,treeGrid:r,options:n}=this,l=r?.labelIcon,a=o?.element,{treeGrid:d,options:h,chart:c,tickPositions:p}=s,u=d.mapOfPosToGridNode,m=G(n?.labels,h?.labels),g=m&&O(m.symbol,!0)?m.symbol:{},k=u?.[i],{descendants:x,depth:b}=k||{},v=k&&x&&x>0,P="treegrid"===s.type&&a,E=p.indexOf(i)>-1,A="highcharts-treegrid-node-",I=A+"level-",T=c.styledMode;if(P&&k&&o.removeClass(RegExp(I+".*")).addClass(I+b),t.apply(this,Array.prototype.slice.call(arguments,1)),P&&v){var w;let t,i,s,n,a,h,c,p,u,x,b,v;e=d.isCollapsed(k),w={color:!T&&o.styles.color||"",collapsed:e,group:o.parentGroup,options:g,renderer:o.renderer,show:E,xy:o.xy},i=!(t=this.treeGrid).labelIcon,s=w.renderer,n=w.xy,h=(a=w.options).width||0,c=a.height||0,p=a.padding??this.axis.linkedParent?0:5,u={x:n.x-h/2-p,y:n.y-c/2},x=w.collapsed?90:180,b=w.show&&y(u.y),(v=t.labelIcon)||(t.labelIcon=v=s.path(s.symbols[a.type](a.x||0,a.y||0,h,c)).addClass("highcharts-label-icon").add(w.group)),v[b?"show":"hide"](),s.styledMode||v.attr({cursor:"pointer",fill:G(w.color,"#666666"),"stroke-width":1,stroke:a.lineColor,strokeWidth:a.lineWidth||0}),v[i?"attr":"animate"]({translateX:u.x,translateY:u.y,rotation:x}),o.addClass(A+(e?"collapsed":"expanded")).removeClass(A+(e?"expanded":"collapsed")),T||o.css({cursor:"pointer"}),[o,l].forEach(t=>{t&&!t.attachedTreeGridEvents&&(f(t.element,"mouseover",function(){o.addClass("highcharts-treegrid-node-active"),o.renderer.styledMode||o.css({textDecoration:"underline"})}),f(t.element,"mouseout",function(){let t;t=O(m.style)?m.style:{},o.removeClass("highcharts-treegrid-node-active"),o.renderer.styledMode||o.css({textDecoration:t.textDecoration||"none"})}),f(t.element,"click",function(){r.toggleCollapse()}),t.attachedTreeGridEvents=!0)})}else l&&(B(a),o?.css({cursor:"default"}),l.destroy(),r.labelIcon=void 0)}class ti{static compose(t){let e=t.prototype;e.toggleCollapse||(f(t,"init",Z),I(e,"getLabelPosition",tt),I(e,"renderLabel",te),e.collapse=function(t){this.treeGrid.collapse(t)},e.expand=function(t){this.treeGrid.expand(t)},e.toggleCollapse=function(t){this.treeGrid.toggleCollapse(t)})}constructor(t){this.tick=t}collapse(t){let{pos:e,axis:i}=this.tick,{treeGrid:s,brokenAxis:o}=i,r=s.mapOfPosToGridNode;o&&r&&o.setBreaks(s.collapse(r[e]),t??!0)}destroy(){this.labelIcon?.destroy()}expand(t){let{pos:e,axis:i}=this.tick,{treeGrid:s,brokenAxis:o}=i,r=s.mapOfPosToGridNode;o&&r&&o.setBreaks(s.expand(r[e]),t??!0)}toggleCollapse(t=!0){let{axis:e,pos:i}=this.tick,{brokenAxis:s,treeGrid:o}=e;if(s&&o.mapOfPosToGridNode){let r=!!(e.scrollbar&&e.staticScale),n=e.pos+e.len+(o.pendingSizeAdjustment||0);if(o.pendingSizeAdjustment=0,s.setBreaks(o.toggleCollapse(o.mapOfPosToGridNode[i]),r&&t),r){let t=e.toValue(e.toPixels(e.dataMax)),i=e.toValue(n)-e.tickmarkOffset,s=e.userMin??e.min;if(o.adjustedMax=t!==e.dataMax?t-e.tickmarkOffset:void 0,i>e.dataMax){let t=n-e.toPixels(e.dataMax+e.tickmarkOffset);i=o.adjustedMax??e.dataMax,(s=e.toValue(e.toPixels(s-e.tickmarkOffset)-t)+e.tickmarkOffset)<e.dataMin&&(t=e.toPixels(e.dataMin)-e.toPixels(s),s=e.dataMin,o.pendingSizeAdjustment=t)}e.setExtremes(p(s),p(i),!1,!1,{trigger:"toggleCollapse"})}t&&e.chart.redraw()}}}let ts=e.default.Color;var to=r.n(ts);let{getLevelOptions:tr}={getColor:function(t,e){let i,s,o,r,n,l,a=e.index,d=e.mapOptionsToLevel,h=e.parentColor,c=e.parentColorIndex,f=e.series,p=e.colors,u=e.siblings,m=f.points,g=f.chart.options.chart;if(t){let k;i=m[t.i],s=d[t.level]||{},i&&s.colorByPoint&&(r=i.index%(p?p.length:g.colorCount),o=p&&p[r]),f.chart.styledMode||(n=G(i&&i.options.color,s&&s.color,o,h&&((k=s&&s.colorVariation)&&"brightness"===k.key&&a&&u?to().parse(h).brighten(k.to*(a/u)).get():h),f.color)),l=G(i&&i.options.colorIndex,s&&s.colorIndex,r,c,e.colorIndex)}return{color:n,colorIndex:l}},getLevelOptions:function(t){let e,i,s,o,r,n,l={};if(O(t))for(o=y(t.from)?t.from:1,n=t.levels,i={},e=O(t.defaults)?t.defaults:{},P(n)&&(i=n.reduce((t,i)=>{let s,r,n;return O(i)&&y(i.level)&&(r=G((n=E({},i)).levelIsConstant,e.levelIsConstant),delete n.levelIsConstant,delete n.level,O(t[s=i.level+(r?0:o-1)])?E(!0,t[s],n):t[s]=n),t},{})),r=y(t.to)?t.to:1,s=0;s<=r;s++)l[s]=E({},e,O(i[s])?i[s]:{});return l},getNodeWidth:function(t,e){let{chart:i,options:s}=t,{nodeDistance:o=0,nodeWidth:r=0}=s,{plotSizeX:n=1}=i;if("auto"===r){if("string"==typeof o&&/%$/.test(o))return n/(e+parseFloat(o)/100*(e-1));let t=Number(o);return(n+t)/(e||1)-t}return/%$/.test(r)?n*parseFloat(r)/100+0:parseFloat(r)},setTreeValues:function t(e,i){let s=i.before,o=i.idRoot,r=i.mapIdToNode[o],n=!1!==i.levelIsConstant,l=i.points[e.i],a=l&&l.options||{},d=[],h=0;e.levelDynamic=e.level-(n?0:r.level),e.name=G(l&&l.name,""),e.visible=o===e.id||!0===i.visible,"function"==typeof s&&(e=s(e,i)),e.children.forEach((s,o)=>{let r=g({},i);g(r,{index:o,siblings:e.children.length,visible:e.visible}),s=t(s,r),d.push(s),s.visible&&(h+=s.val)});let c=G(a.value,h);return e.visible=c>=0&&(h>0||e.visible),e.children=d,e.childrenTotal=h,e.isLeaf=e.visible&&!h,e.val=c,e},updateRootId:function(t){let e,i;return O(t)&&(i=O(t.options)?t.options:{},e=G(t.rootNode,i.rootId,""),O(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}};function tn(t){return{from:t.collapseStart||0,to:t.collapseEnd||0,showPoints:!1}}function tl(t,e,i){var s;let o,r=[],n=[],l={},a=e||!1,d={},h=-1,c=Q(t,{after:function(t){let e=d[t.pos],i=0,s=0;e.children.forEach(function(t){s+=(t.descendants||0)+1,i=Math.max((t.height||0)+1,i)}),e.descendants=s,e.height=i,e.collapsed&&n.push(e)},before:function(t){let e,i,s=O(t.data,!0)?t.data:{},o=v(s.name)?s.name:"",n=l[t.parent],c=O(n,!0)?d[n.pos]:null;a&&O(c,!0)&&(e=x(c.children,function(t){return t.name===o}))?(i=e.pos,e.nodes.push(t)):i=h++,!d[i]&&(d[i]=e={depth:c?c.depth+1:0,name:o,id:s.id,nodes:[t],children:[],pos:i},-1!==i&&r.push(o),O(c,!0)&&c.children.push(e)),v(t.id)&&(l[t.id]=t),e&&!0===s.collapsed&&(e.collapsed=!0),t.pos=i}});return s=d,{categories:r,mapOfIdToNode:l,mapOfPosToGridNode:d=(o=function(t,e,s){let r=t.nodes,n=e+(-1===e?0:i-1),l=(n-e)/2,a=e+l;return r.forEach(function(t){let i=t.data;O(i,!0)&&(i.y=e+(i.seriesIndex||0),delete i.seriesIndex),t.pos=a}),s[a]=t,t.pos=a,t.tickmarkOffset=l+.5,t.collapseStart=n+.5,t.children.forEach(function(t){o(t,n+1,s),n=(t.collapseEnd||0)-.5}),t.collapseEnd=n+.5,s})(s["-1"],-1,{}),collapsedNodes:n,tree:c}}function ta(t){let e=t.target;e.axes.filter(t=>"treegrid"===t.type).forEach(function(i){let s=i.options,o=s.labels,r=i.uniqueNames,n=e.time.parse(s.max),l=!i.treeGrid.mapOfPosToGridNode||i.series.some(function(t){return!t.hasRendered||t.isDirtyData||t.isDirty}),a=0,d,h;if(l){let s=[];if(d=i.series.reduce(function(t,i){let o=i.options.data||[],n=o[0],l=Array.isArray(n)&&!n.find(t=>"object"==typeof t);return s.push(l),i.visible&&(o.forEach(function(s){(l||i.options.keys?.length)&&(s=i.pointClass.prototype.optionsToObject.call({series:i},s),i.pointClass.setGanttPointAliases(s,e)),O(s,!0)&&(s.seriesIndex=a,t.push(s))}),!0===r&&a++),t},[]),n&&d.length<n)for(let t=d.length;t<=n;t++)d.push({name:t+"​"});i.categories=(h=tl(d,r||!1,!0===r?a:1)).categories,i.treeGrid.mapOfPosToGridNode=h.mapOfPosToGridNode,i.hasNames=!0,i.treeGrid.tree=h.tree,i.series.forEach(function(t,e){let i=(t.options.data||[]).map(function(i){return(s[e]||P(i)&&t.options.keys?.length)&&d.forEach(function(t){var e;let s=P(e=i)?e:[e];s.indexOf(t.x||0)>=0&&s.indexOf(t.x2||0)>=0&&(i=t)}),O(i,!0)?E(i):i});t.visible&&t.setData(i,!1)}),i.treeGrid.mapOptionsToLevel=tr({defaults:o,from:1,levels:o?.levels,to:i.treeGrid.tree?.height}),"beforeRender"===t.type&&(i.treeGrid.collapsedNodes=h.collapsedNodes)}})}function td(e,i){let s=this.treeGrid.mapOptionsToLevel||{},o="treegrid"===this.type,r=this.ticks,n=r[i],l,a,d;o&&this.treeGrid.mapOfPosToGridNode?((l=s[(d=this.treeGrid.mapOfPosToGridNode[i]).depth])&&(a={labels:l}),!n&&t?r[i]=n=new t(this,i,void 0,void 0,{category:d.name,tickmarkOffset:d.tickmarkOffset,options:a}):(n.parameters.category=d.name,n.options=a,n.addLabel())):e.apply(this,Array.prototype.slice.call(arguments,1))}function th(t,e,i,s){let o=this,r="treegrid"===i.type;o.treeGrid||(o.treeGrid=new tp(o)),r&&(f(e,"beforeRender",ta),f(e,"beforeRedraw",ta),f(e,"addSeries",function(t){if(t.options.data){let e=tl(t.options.data,i.uniqueNames||!1,1);o.treeGrid.collapsedNodes=(o.treeGrid.collapsedNodes||[]).concat(e.collapsedNodes)}}),f(o,"foundExtremes",function(){o.treeGrid.collapsedNodes?.forEach(function(t){let e=o.treeGrid.collapse(t);o.brokenAxis&&(o.brokenAxis.setBreaks(e,!1),o.treeGrid.collapsedNodes&&(o.treeGrid.collapsedNodes=o.treeGrid.collapsedNodes.filter(e=>t.collapseStart!==e.collapseStart||t.collapseEnd!==e.collapseEnd)))})}),f(o,"afterBreaks",function(){"yAxis"===o.coll&&!o.staticScale&&o.chart.options.chart.height&&(o.isDirty=!0)}),i=E({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}},uniqueNames:!1},i,{reversed:!0})),t.apply(o,[e,i,s]),r&&(o.hasNames=!0,o.options.showLastLabel=!0)}function tc(t){let e=this.options,i=this.chart.time,s="number"==typeof e.linkedTo?this.chart[this.coll]?.[e.linkedTo]:void 0;if("treegrid"===this.type){if(this.min=this.userMin??i.parse(e.min)??this.dataMin,this.max=this.userMax??i.parse(e.max)??this.dataMax,k(this,"foundExtremes"),this.setAxisTranslation(),this.tickInterval=1,this.tickmarkOffset=.5,this.tickPositions=this.treeGrid.mapOfPosToGridNode?this.treeGrid.getTickPositions():[],s){let t=s.getExtremes();this.min=t.min??t.dataMin,this.max=t.max??t.dataMax,this.tickPositions=s.tickPositions}this.linkedParent=s}else t.apply(this,Array.prototype.slice.call(arguments,1))}function tf(t){let e=this;"treegrid"===this.type&&e.visible&&e.tickPositions.forEach(function(t){let i=e.ticks[t];i.label?.attachedTreeGridEvents&&(B(i.label.element),i.label.attachedTreeGridEvents=!1)}),t.apply(e,Array.prototype.slice.call(arguments,1))}class tp{static compose(e,i,s,o){var r,n,l;if(!e.keepProps.includes("treeGrid")){let i=e.prototype;e.keepProps.push("treeGrid"),I(i,"generateTick",td),I(i,"init",th),I(i,"setTickInterval",tc),I(i,"redraw",tf),i.utils={getNode:J},t||(t=o)}return r=e,n=i,l=o,r.keepProps.includes("grid")||(r.keepProps.push("grid"),r.prototype.getMaxLabelDimensions=N,I(r.prototype,"unsquish",K),I(r.prototype,"getOffset",C),f(r,"init",X),f(r,"afterGetTitlePosition",S),f(r,"afterInit",z),f(r,"afterRender",W),f(r,"afterSetAxisTranslation",j),f(r,"afterSetOptions",R),f(r,"afterSetOptions",D),f(r,"afterSetScale",F),f(r,"afterTickSize",V),f(r,"trimTicks",$),f(r,"destroy",H),f(n,"afterSetChartSize",_),f(l,"afterGetLabelPosition",q),f(l,"labelFormat",U)),T.compose(e,s),ti.compose(o),e}constructor(t){this.pendingSizeAdjustment=0,this.axis=t}setCollapsedStatus(t){let e=this.axis,i=e.chart;e.series.forEach(function(e){let s=e.options.data;if(t.id&&s){let o=i.get(t.id),r=s[e.data.indexOf(o)];o&&r&&(o.collapsed=t.collapsed,r.collapsed=t.collapsed)}})}collapse(t){let e=this.axis,i=e.options.breaks||[],s=tn(t);return i.push(s),t.collapsed=!0,e.treeGrid.setCollapsedStatus(t),i}expand(t){let e=this.axis,i=tn(t);return t.collapsed=!1,e.treeGrid.setCollapsedStatus(t),e.options.breaks?.reduce(function(t,e){return(e.to!==i.to||e.from!==i.from)&&t.push(e),t},[])||[]}getTickPositions(){let t=this.axis,e=Math.floor(t.min/t.tickInterval)*t.tickInterval,i=Math.ceil(t.max/t.tickInterval)*t.tickInterval;return Object.keys(t.treeGrid.mapOfPosToGridNode||{}).reduce(function(s,o){let r=+o;return r>=e&&r<=i&&!t.brokenAxis?.isInAnyBreak(r)&&s.push(r),s},[])}isCollapsed(t){let e=this.axis.options.breaks||[],i=tn(t);return e.some(function(t){return t.from===i.from&&t.to===i.to})}toggleCollapse(t){return this.isCollapsed(t)?this.expand(t):this.collapse(t)}}let tu=l();tp.compose(tu.Axis,tu.Chart,tu.Series,tu.Tick);let tm=l();export{tm as default};