let e;/**
 * Highcharts Gantt JS v13.0.0 (2026-06-11)
 * @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 t from"../highcharts.js";var i,s,r,o={};o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n=t.default;var a=o.n(n);let l=t.default.StackItem;var d=o.n(l);!function(e){function t(){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 e=this.brokenAxis;if(e?.hasBreaks){let t=this.tickPositions,i=this.tickPositions.info,s=[];for(let i=0;i<t.length;i++)e.isInAnyBreak(t[i])||s.push(t[i]);this.tickPositions=s,this.tickPositions.info=i}}function r(){this.brokenAxis||(this.brokenAxis=new c(this))}function o(){let{isDirty:e,options:{connectNulls:t},points:i,xAxis:s,yAxis:r}=this;if(e){let e=i.length;for(;e--;){let o=i[e],n=(null!==o.y||!1!==t)&&(s?.brokenAxis?.isInAnyBreak(o.x,!0)||r?.brokenAxis?.isInAnyBreak(o.y,!0));o.visible=!n&&!1!==o.options.visible}}}function a(){this.drawBreaks(this.xAxis,["x"]),this.drawBreaks(this.yAxis,(0,n.pick)(this.pointArrayMap,["y"]))}function l(e,t){let i,s,r,o=this,a=o.points;if(e?.brokenAxis?.hasBreaks){let l=e.brokenAxis;t.forEach(function(t){i=l?.breakArray||[],s=e.isXAxis?e.min:(0,n.pick)(o.options.threshold,e.min),a.forEach(function(o){r=o["stack"+t.toUpperCase()]??o[t],i.forEach(function(t){if((0,n.isNumber)(s)&&(0,n.isNumber)(r)){let i="";s<t.from&&r>t.to||s>t.from&&r<t.from?i="pointBreak":(s<t.from&&r>t.from&&r<t.to||s>t.from&&r>t.to&&r<t.from)&&(i="pointInBreak"),i&&(0,n.fireEvent)(e,i,{point:o,brk:t})}})})})}}function h(){let e=this.currentDataGrouping,t=e?.gapSize,i=this.points.slice(),s=this.yAxis,r=this.options.gapSize,o=i.length-1;if(r&&o>0){let e,n;for("value"!==this.options.gapUnit&&(r*=this.basePointRange),t&&t>r&&t>=this.basePointRange&&(r=t);o--;)if(n&&!1!==n.visible||(n=i[o+1]),e=i[o],!1!==n.visible&&!1!==e.visible){if(n.x-e.x>r){let t=(e.x+n.x)/2;i.splice(o+1,0,{isNull:!0,x:t}),s.stacking&&this.options.stacking&&((s.stacking.stacks[this.stackKey][t]=new(d())(s,s.options.stackLabels,!1,t,this.stack??"")).total=0)}n=e}}return this.getGraphPath(i)}e.compose=function(e,d){if(!e.keepProps.includes("brokenAxis")){e.keepProps.push("brokenAxis"),(0,n.addEvent)(e,"init",r),(0,n.addEvent)(e,"afterInit",t),(0,n.addEvent)(e,"afterSetTickPositions",s),(0,n.addEvent)(e,"afterSetOptions",i);let c=d.prototype;c.drawBreaks=l,c.gappedPath=h,(0,n.addEvent)(d,"afterGeneratePoints",o),(0,n.addEvent)(d,"afterRender",a)}return e};class c{static isInBreak(e,t){let i=e.repeat||1/0,s=e.from,r=e.to-e.from,o=t>=s?(t-s)%i:i-(s-t)%i;return e.inclusive?o<=r:o<r&&0!==o}static lin2Val(e){let t=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!(0,n.isNumber)(e))return e;let r=e;if(e>t)for(let e of s)if(e.from>r)break;else e.to<=r&&e.to>t?r+=e.len:c.isInBreak(e,r)&&(r+=e.len);else if(e<t)for(let e of s)if(e.from>t)break;else e.from>=r&&e.from<t?r-=e.len:c.isInBreak(e,r)&&(r-=e.len);return r}static val2Lin(e){let t=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!(0,n.isNumber)(e))return e;let r=e;if(e>t){for(let i of s)if(i.to<=e&&i.to>t)r-=i.len;else if(i.from>e)break;else if(c.isInBreak(i,e)){r-=e-i.from;break}}else if(e<t){for(let i of s)if(i.from>=e&&i.from<t)r+=i.len;else if(i.from>t)break;else if(c.isInBreak(i,e)){r+=i.to-e;break}}return r}constructor(e){this.axis=e}findBreakAt(e,t){return(0,n.find)(t,function(t){return t.from<e&&e<t.to})}isInAnyBreak(e,t){let i=this.axis,s=i.options.breaks||[],r=s.length,o,a,l;if(r&&(0,n.isNumber)(e)){for(;r--;)c.isInBreak(s[r],e)&&(o=!0,a||(a=(0,n.pick)(s[r].showPoints,!i.isXAxis)));l=o&&t?o&&!a:o}return l}setBreaks(e,t){let i=this,s=i.axis,r=s.chart.time,o=(0,n.isArray)(e)&&!!Object.keys(e?.[0]||{}).length;s.isDirty=(i.hasBreaks??!1)!==o,i.hasBreaks=o,e?.forEach(e=>{e.from=r.parse(e.from)||0,e.to=r.parse(e.to)||0}),e!==s.options.breaks&&(s.options.breaks=s.userOptions.breaks=e),s.forceRedraw=!0,s.series.forEach(function(e){e.isDirty=!0}),o||s.val2lin!==c.val2Lin||(delete s.val2lin,delete s.lin2val),o&&(s.userOptions.ordinal=!1,s.lin2val=c.lin2Val,s.val2lin=c.val2Lin,s.setExtremes=function(e,t,r,o,n){if(i.hasBreaks&&!s.treeGrid?.tree){let s,r=this.brokenAxis.breakArray||[];for(;s=i.findBreakAt(e,r);)e=s.to;for(;s=i.findBreakAt(t,r);)t=s.from;t<e&&(t=e)}s.constructor.prototype.setExtremes.call(this,e,t,r,o,n)},s.setAxisTranslation=function(){if(s.constructor.prototype.setAxisTranslation.call(this),i.unitLength=void 0,i.hasBreaks){let e=s.options.breaks||[],t=[],r=[],o=s.pointRangePadding??0,a=0,l,d,h=s.userMin??s.min,p=s.userMax??s.max,f,u,m=(0,n.isNumber)(h)?Math.min(s.dataMin??h,h):s.dataMin??h,g=(0,n.isNumber)(p)?Math.max(s.dataMax??p,p):s.dataMax??p;s.treeGrid?.tree||e.forEach(function(e){d=e.repeat||1/0,(0,n.isNumber)(h)&&(0,n.isNumber)(p)&&(c.isInBreak(e,h)&&(h+=e.to%d-h%d),c.isInBreak(e,p)&&(p-=p%d-e.from%d))}),(0,n.isNumber)(m)&&(0,n.isNumber)(g)&&e.forEach(function(e){for(f=e.from,d=e.repeat||1/0;f-d>m;)f-=d;for(;f<m;)f+=d;for(u=f;u<g;u+=d)t.push({value:u,move:"in"}),t.push({value:u+e.to-e.from,move:"out",size:e.breakSize})}),t.sort(function(e,t){return e.value===t.value?("in"!==e.move)-("in"!==t.move):e.value-t.value}),l=0,f=m,t.forEach(e=>{1===(l+="in"===e.move?1:-1)&&"in"===e.move&&(f=e.value),0===l&&(0,n.isNumber)(f)&&(r.push({from:f,to:e.value,len:e.value-f-(e.size||0)}),(0,n.isNumber)(h)&&(0,n.isNumber)(p)&&f<p&&e.value>h&&(a+=e.value-f-(e.size||0)))}),i.breakArray=r,(0,n.isNumber)(h)&&(0,n.isNumber)(p)&&(0,n.isNumber)(s.min)&&(i.unitLength=p-h-a+o,(0,n.fireEvent)(s,"afterBreaks"),s.staticScale?s.transA=s.staticScale:i.unitLength&&(s.transA*=(p-s.min+o)/i.unitLength),o&&(s.minPixelPadding=s.transA*(s.minPointOffset||0)),s.min=h,s.max=p)}}),(0,n.pick)(t,!0)&&s.chart.redraw()}}e.Additions=c}(s||(s={}));let h=s,c=t.default.Axis;var p=o.n(c);let{dateFormats:f}=a();function u(e){return(0,n.isObject)(e,!0)}function m(e,t){let i={width:0,height:0};if(t.forEach(function(t){let s=e[t],r=0,o=0,a;u(s)&&(r=(a=u(s.label)?s.label:{}).getBBox?a.getBBox().height:0,a.textStr&&!(0,n.isNumber)(a.textPxLength)&&(a.textPxLength=a.getBBox().width),o=(0,n.isNumber)(a.textPxLength)?Math.round(a.textPxLength):0,a.textStr&&(o=Math.round(a.getBBox().width)),i.height=Math.max(r,i.height),i.width=Math.max(o,i.width))}),"treegrid"===this.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode){let e=this.treeGrid.mapOfPosToGridNode[-1].height||0;i.width+=this.options.labels.indentation*(e-1)}return i}function g(e){let{grid:t}=this,i=3===this.side;if(i||e.apply(this),!t?.isColumn){let e=t?.columns||[];i&&(e=e.slice().reverse()),e.forEach(e=>{e.getOffset()})}i&&e.apply(this)}function k(e){if(!0===(this.options.grid||{}).enabled){let{axisTitle:t,height:i,horiz:s,left:o,offset:n,opposite:a,options:l,top:d,width:h}=this,c=this.tickSize(),p=t?.getBBox().width,f=l.title,{x:u,y:m}=f,g=f.margin??(s?5:10),k=t?this.chart.renderer.fontMetrics(t).f:0,b=(s?d+i:o)+(s?1:-1)*(a?-1:1)*(c?c[0]/2:0)+(this.side===r.bottom?k:0);if(e.titlePosition.x=s?o-(p||0)/2-g+u:b+(a?h:0)+n+u,e.titlePosition.y=s?b-(a?i:0)+(a?k:-k)/2+n+m:d-g+m,!s){let[t=0]=c||[];"left"===f.textAlign?e.titlePosition.x-=t/2:"right"===f.textAlign&&(e.titlePosition.x+=t/2)}}}function b(){let e,{chart:t,options:{grid:i={}},userOptions:s}=this;if(i.enabled&&((e=this.options).labels.align=(0,n.pick)(e.labels.align,"center"),this.categories||(e.showLastLabel=!1),this.labelRotation=0,e.labels.rotation=0,e.minTickInterval=1),i.columns){let e=this.grid.columns=[],r=this.grid.columnIndex=0;for(;++r<i.columns.length;){let o=(0,n.merge)(s,i.columns[r],{isInternal:!0,linkedTo:0,scrollbar:{enabled:!1}},{grid:{columns:void 0}}),a=new(p())(this.chart,o,this.coll);a.grid.isColumn=!0,a.grid.columnIndex=r,(0,n.erase)(t.axes,a),(0,n.erase)(t[this.coll]||[],a),e.push(a)}}}function x(){let{axisTitle:e,grid:t,options:i}=this;if(!0===(i.grid||{}).enabled){let s=this.min||0,o=this.max||0,n=this.ticks[this.tickPositions[0]];if(e&&!this.chart.styledMode&&n?.slotWidth&&!this.options.title.style.width&&e.css({width:`${n.slotWidth}px`}),this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions),this.rightWall&&this.rightWall.destroy(),this.grid?.isOuterAxis()&&this.axisLine){let e=i.lineWidth;if(e){let t=this.getLinePath(e),n=t[0],a=t[1],l=(this.tickSize("tick")||[1])[0]*(this.side===r.top||this.side===r.left?-1:1);if("M"===n[0]&&"L"===a[0]&&(this.horiz?(n[2]+=l,a[2]+=l):(n[1]+=l,a[1]+=l)),!this.horiz&&this.chart.marginRight){let e=["L",this.left,n[2]||0],t=[n,e],r=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(o+this.tickmarkOffset)],l=[["M",a[1]||0,this.toPixels(o+this.tickmarkOffset)],r];this.grid.upperBorder||s%1==0||(this.grid.upperBorder=this.grid.renderBorder(t)),this.grid.upperBorder&&(this.grid.upperBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.upperBorder.animate({d:t})),this.grid.lowerBorder||o%1==0||(this.grid.lowerBorder=this.grid.renderBorder(l)),this.grid.lowerBorder&&(this.grid.lowerBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.lowerBorder.animate({d:l}))}this.grid.axisLineExtra?(this.grid.axisLineExtra.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.axisLineExtra.animate({d:t})):this.grid.axisLineExtra=this.grid.renderBorder(t),this.axisLine[this.showAxis?"show":"hide"]()}}if((t?.columns||[]).forEach(e=>e.render()),!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent?.scrollbar)&&this.tickPositions.length){let e,t,i=this.tickmarkOffset,r=this.tickPositions[this.tickPositions.length-1],n=this.tickPositions[0];for(;(e=this.hiddenLabels.pop())&&e.element;)e.show();for(;(t=this.hiddenMarks.pop())&&t.element;)t.show();(e=this.ticks[n].label)&&(s-n>i?this.hiddenLabels.push(e.hide()):e.show()),(e=this.ticks[r].label)&&(r-o>i?this.hiddenLabels.push(e.hide()):e.show());let a=this.ticks[r].mark;a&&r-o<i&&r-o>0&&this.ticks[r].isLast&&this.hiddenMarks.push(a.hide())}}}function v(){let e=this.tickPositions?.info,t=this.options,i=t.grid||{},s=this.userOptions.labels||{};i.enabled&&(this.horiz?(this.series.forEach(e=>{e.options.pointRange=0}),e&&t.dateTimeLabelFormats&&t.labels&&!(0,n.defined)(s.align)&&(!1===t.dateTimeLabelFormats[e.unitName].range||e.count>1)&&(t.labels.align="left",(0,n.defined)(s.x)||(t.labels.x=3))):"treegrid"!==this.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function y(e){let t,i=this.options,s=e.userOptions,r=i&&u(i.grid)?i.grid:{};!0===r.enabled&&(t=(0,n.merge)(!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&&((0,n.defined)(s.linkedTo)&&!(0,n.defined)(s.tickPixelInterval)&&(t.tickPixelInterval=350),!(!(0,n.defined)(s.tickPixelInterval)&&(0,n.defined)(s.linkedTo))||(0,n.defined)(s.tickPositioner)||(0,n.defined)(s.tickInterval)||(0,n.defined)(s.units)||(t.tickPositioner=function(e,i){let s=this.linkedParent?.tickPositions?.info;if(s){let r=t.units||[],o,a=1,l="year";for(let e=0;e<r.length;e++){let t=r[e];if(t&&t[0]===s.unitName){o=e;break}}let d=(0,n.isNumber)(o)&&r[o+1];if(d){l=d[0]||"year";let e=d[1];a=e?.[0]||1}else"year"===s.unitName&&(a=10*s.count);let h=n.timeUnits[l];return this.tickInterval=h*a,this.chart.time.getTimeTicks({unitRange:h,count:a,unitName:l},e,i,this.options.startOfWeek)}})),(0,n.merge)(!0,this.options,t),this.horiz&&(i.minPadding=(0,n.pick)(s.minPadding,0),i.maxPadding=(0,n.pick)(s.maxPadding,0)),(0,n.isNumber)(i.grid.borderWidth)&&(i.tickWidth=i.lineWidth=r.borderWidth))}function P(e){let t=e.userOptions,i=t?.grid||{},s=i.columns;i.enabled&&s&&(0,n.merge)(!0,this.options,s[0])}function O(){(this.grid.columns||[]).forEach(e=>e.setScale())}function E(e){let{horiz:t,maxLabelDimensions:i,options:{grid:s={}}}=this;if(s.enabled&&i){let r=2*this.options.labels.distance,o=t?s.cellHeight||r+i.height:r+i.width;(0,n.isArray)(e.tickSize)?e.tickSize[0]=o:e.tickSize=[o,0]}}function N(){this.axes.forEach(e=>{(e.grid?.columns||[]).forEach(e=>{e.setAxisSize(),e.setAxisTranslation()})})}function A(e){let{grid:t}=this;(t.columns||[]).forEach(t=>t.destroy(e.keepEvents)),t.columns=void 0}function G(e){let t=e.userOptions||{},i=(0,n.merge)({borderColor:"var(--highcharts-neutral-color-20)"},t.grid||{});i.enabled&&(0,n.defined)(i.borderColor)&&(t.tickColor=t.lineColor=i.borderColor),this.grid||(this.grid=new M(this)),this.hiddenLabels=[],this.hiddenMarks=[],this.clippable=!1}function w(e){let t=this.label,i=this.axis,s=i.reversed,o=i.chart,a=i.options.grid||{},l=i.options.labels,d=l.align,h=r[i.side],c=e.tickmarkOffset,p=i.tickPositions,f=this.pos-c,u=(0,n.isNumber)(p[e.index+1])?p[e.index+1]-c:(i.max||0)+c,m=i.tickSize("tick"),g=m?m[0]:0,k=m?m[1]/2:0;if(!0===a.enabled){let r,n,a,c;if("top"===h?n=(r=i.top+i.offset)-g:"bottom"===h?r=(n=o.chartHeight-i.bottom+i.offset)+g:(r=i.top+i.len-(i.translate(s?u:f)||0),n=i.top+i.len-(i.translate(s?f:u)||0)),"right"===h?c=(a=o.chartWidth-i.right+i.offset)+g:"left"===h?a=(c=i.left+i.offset)-g:(a=Math.round(i.left+(i.translate(s?u:f)||0))-k,c=Math.min(Math.round(i.left+(i.translate(s?f:u)||0))-k,i.left+i.len)),this.slotWidth=c-a,e.pos.x="left"===d?a:"right"===d?c:a+(c-a)/2,e.pos.y=n+(r-n)/2,t){let i=o.renderer.fontMetrics(t),s=t.getBBox().height;if(l.useHTML)e.pos.y+=i.b+-(s/2);else{let t=Math.round(s/i.h);e.pos.y+=(i.b-(i.h-i.f))/2+-((t-1)*i.h/2)}}e.pos.x+=i.horiz&&l.x||0}}function B(e){let{axis:t,value:i}=e;if(t.options.grid?.enabled){let s,r=t.tickPositions,o=(t.linkedParent||t).series,l=o.reduce((e,t)=>t.is("gantt")?e?.concat(t.options?.data??[]):e,[])??[],d=i===r[0],h=i===r[r.length-1],c=o[0]&&(0,n.find)(l,function(e){return e[t.isXAxis?"x":"y"]===i});c&&(s=(0,n.merge)(c),a().seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(s,t.chart)),e.isFirst=d,e.isLast=h,e.point=s}}function I(){let e=this.options,t=e.grid||{},i=this.categories,s=this.tickPositions,r=s[0],o=s[1],a=s[s.length-1],l=s[s.length-2],d=this.linkedParent?.min,h=this.linkedParent?.max,c=d||this.min,p=h||this.max,f=this.tickInterval,u=(0,n.isNumber)(c)&&c>=r+f&&c<o,m=(0,n.isNumber)(c)&&r<c&&r+f>c,g=(0,n.isNumber)(p)&&a>p&&a-f<p,k=(0,n.isNumber)(p)&&p<=a-f&&p>l;!0===t.enabled&&!i&&(this.isXAxis||this.isLinked)&&((m||u)&&!e.startOnTick&&(s[0]=c),(g||k)&&!e.endOnTick&&(s[s.length-1]=p))}function T(e){var t;let{options:{grid:i={}}}=this;return!0===i.enabled&&this.categories?this.tickInterval:e.apply(this,(t=arguments,Array.prototype.slice.call(t,1)))}(i=r||(r={}))[i.top=0]="top",i[i.right=1]="right",i[i.bottom=2]="bottom",i[i.left=3]="left";class M{constructor(e){this.axis=e}isOuterAxis(){let e=this.axis,t=e.chart,i=e.grid.columnIndex,s=e.linkedParent?.grid.columns||e.grid.columns||[],r=i?e.linkedParent:e,o=-1,a=0;return 3===e.side&&!t.inverted&&s.length?!e.linkedParent:((t[e.coll]||[]).forEach((t,i)=>{t.side!==e.side||t.options.isInternal||(a=i,t===r&&(o=i))}),a===o&&(!(0,n.isNumber)(i)||s.length===i))}renderBorder(e){let t=this.axis,i=t.chart.renderer,s=t.options,r=i.path(e).addClass("highcharts-axis-line").add(t.axisGroup);return i.styledMode||r.attr({stroke:s.lineColor,"stroke-width":s.lineWidth,zIndex:7}),r}}f.E=function(e){return this.dateFormat("%a",e,!0).charAt(0)},f.W=function(e){let t=this.toParts(e),i=(t[7]+6)%7,s=t.slice(0);s[2]=t[2]-i+3;let r=this.toParts(this.makeTime(s[0],0,1));return 4!==r[7]&&(t[1]=0,t[2]=1+(11-r[7])%7),(1+Math.floor((this.makeTime(s[0],s[1],s[2])-this.makeTime(r[0],r[1],r[2]))/6048e5)).toString()};function L(e,t,i,s,r,o){let a=o&&o.after,l=o&&o.before,d={data:s,depth:i-1,id:e,level:i,parent:t||""},h=0,c=0,p,f;"function"==typeof l&&l(d,o);let u=(r[e]||[]).map(t=>{let s=L(t.id,e,i+1,t,r,o),a=t.start||NaN,l=!0===t.milestone?a:t.end||NaN;return p=!(0,n.isNumber)(p)||a<p?a:p,f=!(0,n.isNumber)(f)||l>f?l:f,h=h+1+s.descendants,c=Math.max(s.height+1,c),s});return s&&(s.start??(s.start=p),s.end??(s.end=f)),(0,n.extend)(d,{children:u,descendants:h,height:c}),"function"==typeof a&&a(d,o),d}let C=function(e,t){let i,s;return L("",null,1,null,(i=[],Object.keys(s=e.reduce((e,t)=>{let{parent:s="",id:r}=t;return void 0===e[s]&&(e[s]=[]),e[s].push(t),r&&i.push(r),e},{})).forEach(e=>{if(""!==e&&-1===i.indexOf(e)){let t=s[e].map(function(e){let{...t}=e;return t});s[""].push(...t),delete s[e]}}),s),t)};function S(){this.treeGrid||(this.treeGrid=new W(this))}function j(e,t,i,s,r,o,a,l,d){let h,c,p,f=(0,n.pick)(this.options?.labels,o),u=this.pos,m=this.axis,g="treegrid"===m.type,k=e.apply(this,[t,i,s,r,f,a,l,d]);if(g){let{width:e=0,padding:t=5*!m.linkedParent}=f&&(0,n.isObject)(f.symbol,!0)?f.symbol:{},i=f&&(0,n.isNumber)(f.indentation)?f.indentation:0;h=m.treeGrid.mapOfPosToGridNode,c=h?.[u],p=c?.depth||1,k.x+=e+2*t+(p-1)*i}return k}function z(e){let t,{pos:i,axis:s,label:r,treeGrid:o,options:a}=this,l=o?.labelIcon,d=r?.element,{treeGrid:h,options:c,chart:p,tickPositions:f}=s,u=h.mapOfPosToGridNode,m=(0,n.pick)(a?.labels,c?.labels),g=m&&(0,n.isObject)(m.symbol,!0)?m.symbol:{},k=u?.[i],{descendants:b,depth:x}=k||{},v=k&&b&&b>0,y="treegrid"===s.type&&d,P=f.indexOf(i)>-1,O="highcharts-treegrid-node-",E=O+"level-",N=p.styledMode;if(y&&k&&r.removeClass(RegExp(E+".*")).addClass(E+x),e.apply(this,Array.prototype.slice.call(arguments,1)),y&&v){var A;let e,i,s,a,d,c,p,f,u,b,x,v;t=h.isCollapsed(k),A={color:!N&&r.styles.color||"",collapsed:t,group:r.parentGroup,options:g,renderer:r.renderer,show:P,xy:r.xy},i=!(e=this.treeGrid).labelIcon,s=A.renderer,a=A.xy,c=(d=A.options).width||0,p=d.height||0,f=d.padding??this.axis.linkedParent?0:5,u={x:a.x-c/2-f,y:a.y-p/2},b=A.collapsed?90:180,x=A.show&&(0,n.isNumber)(u.y),(v=e.labelIcon)||(e.labelIcon=v=s.path(s.symbols[d.type](d.x||0,d.y||0,c,p)).addClass("highcharts-label-icon").add(A.group)),v[x?"show":"hide"](),s.styledMode||v.attr({cursor:"pointer",fill:A.color||"var(--highcharts-neutral-color-60)","stroke-width":1,stroke:d.lineColor,strokeWidth:d.lineWidth||0}),v[i?"attr":"animate"]({translateX:u.x,translateY:u.y,rotation:b}),r.addClass(O+(t?"collapsed":"expanded")).removeClass(O+(t?"expanded":"collapsed")),N||r.css({cursor:"pointer"}),[r,l].forEach(e=>{e&&!e.attachedTreeGridEvents&&((0,n.addEvent)(e.element,"mouseover",function(){r.addClass("highcharts-treegrid-node-active"),r.renderer.styledMode||r.css({textDecoration:"underline"})}),(0,n.addEvent)(e.element,"mouseout",function(){let e;e=(0,n.isObject)(m.style)?m.style:{},r.removeClass("highcharts-treegrid-node-active"),r.renderer.styledMode||r.css({textDecoration:e.textDecoration||"none"})}),(0,n.addEvent)(e.element,"click",function(){o.toggleCollapse()}),e.attachedTreeGridEvents=!0)})}else l&&((0,n.removeEvent)(d),r?.css({cursor:"default"}),l.destroy(),o.labelIcon=void 0)}class W{static compose(e){let t=e.prototype;t.toggleCollapse||((0,n.addEvent)(e,"init",S),(0,n.wrap)(t,"getLabelPosition",j),(0,n.wrap)(t,"renderLabel",z),t.collapse=function(e){this.treeGrid.collapse(e)},t.expand=function(e){this.treeGrid.expand(e)},t.toggleCollapse=function(e){this.treeGrid.toggleCollapse(e)})}constructor(e){this.tick=e}collapse(e){let{pos:t,axis:i}=this.tick,{treeGrid:s,brokenAxis:r}=i,o=s.mapOfPosToGridNode;r&&o&&r.setBreaks(s.collapse(o[t]),e??!0)}destroy(){this.labelIcon?.destroy()}expand(e){let{pos:t,axis:i}=this.tick,{treeGrid:s,brokenAxis:r}=i,o=s.mapOfPosToGridNode;r&&o&&r.setBreaks(s.expand(o[t]),e??!0)}toggleCollapse(e=!0){let{axis:t,pos:i}=this.tick,{brokenAxis:s,treeGrid:r}=t;if(s&&r.mapOfPosToGridNode){let o=!!(t.scrollbar&&t.staticScale),a=t.pos+t.len+(r.pendingSizeAdjustment||0);if(r.pendingSizeAdjustment=0,s.setBreaks(r.toggleCollapse(r.mapOfPosToGridNode[i]),o&&e),o){let e=t.toValue(t.toPixels(t.dataMax)),i=t.toValue(a)-t.tickmarkOffset,s=t.userMin??t.min;if(r.adjustedMax=e!==t.dataMax?e-t.tickmarkOffset:void 0,i>t.dataMax){let e=a-t.toPixels(t.dataMax+t.tickmarkOffset);i=r.adjustedMax??t.dataMax,(s=t.toValue(t.toPixels(s-t.tickmarkOffset)-e)+t.tickmarkOffset)<t.dataMin&&(e=t.toPixels(t.dataMin)-t.toPixels(s),s=t.dataMin,r.pendingSizeAdjustment=e)}t.setExtremes((0,n.correctFloat)(s),(0,n.correctFloat)(i),!1,!1,{trigger:"toggleCollapse"})}e&&t.chart.redraw()}}}let R=t.default.Color;var D=o.n(R);let{getLevelOptions:F}={getColor:function(e,t){let i,s,r,o,a,l,d=t.index,h=t.mapOptionsToLevel,c=t.parentColor,p=t.parentColorIndex,f=t.series,u=t.colors,m=t.siblings,g=f.points,k=f.chart.options.chart;if(e){let b;i=g[e.i],s=h[e.level]||{},i&&s.colorByPoint&&(o=i.index%(u?u.length:k.colorCount),r=u&&u[o]),f.chart.styledMode||(a=(0,n.pick)(i&&i.options.color,s&&s.color,r,c&&((b=s&&s.colorVariation)&&"brightness"===b.key&&d&&m?D().parse(c).brighten(b.to*(d/m)).get():c),f.color)),l=(0,n.pick)(i&&i.options.colorIndex,s&&s.colorIndex,o,p,t.colorIndex)}return{color:a,colorIndex:l}},getLevelOptions:function(e){let t,i,s,r,o,a,l={};if((0,n.isObject)(e))for(r=(0,n.isNumber)(e.from)?e.from:1,a=e.levels,i={},t=(0,n.isObject)(e.defaults)?e.defaults:{},(0,n.isArray)(a)&&(i=a.reduce((e,i)=>{let s,o,a;return(0,n.isObject)(i)&&(0,n.isNumber)(i.level)&&(a=(0,n.merge)({},i),o=(0,n.pick)(a.levelIsConstant,t.levelIsConstant),delete a.levelIsConstant,delete a.level,s=i.level+(o?0:r-1),(0,n.isObject)(e[s])?(0,n.merge)(!0,e[s],a):e[s]=a),e},{})),o=(0,n.isNumber)(e.to)?e.to:1,s=0;s<=o;s++)l[s]=(0,n.merge)({},t,(0,n.isObject)(i[s])?i[s]:{});return l},getNodeWidth:function(e,t){let{chart:i,options:s}=e,{nodeDistance:r=0,nodeWidth:o=0}=s,{plotSizeX:a=1}=i;if("auto"===o){if("string"==typeof r&&/%$/.test(r))return a/(t+parseFloat(r)/100*(t-1));let e=Number(r);return(a+e)/(t||1)-e}return(0,n.relativeLength)(o,a)},setTreeValues:function e(t,i){let s=i.before,r=i.idRoot,o=i.mapIdToNode[r],a=!1!==i.levelIsConstant,l=i.points[t.i],d=l&&l.options||{},h=[],c=0;t.levelDynamic=t.level-(a?0:o.level),t.name=(0,n.pick)(l&&l.name,""),t.visible=r===t.id||!0===i.visible,"function"==typeof s&&(t=s(t,i)),t.children.forEach((s,r)=>{let o=(0,n.extend)({},i);(0,n.extend)(o,{index:r,siblings:t.children.length,visible:t.visible}),s=e(s,o),h.push(s),s.visible&&(c+=s.val)});let p=(0,n.pick)(d.value,c);return t.visible=p>=0&&(c>0||t.visible),t.children=h,t.childrenTotal=c,t.isLeaf=t.visible&&!c,t.val=p,t},updateRootId:function(e){let t,i;return(0,n.isObject)(e)&&(i=(0,n.isObject)(e.options)?e.options:{},t=(0,n.pick)(e.rootNode,i.rootId,""),(0,n.isObject)(e.userOptions)&&(e.userOptions.rootId=t),e.rootNode=t),t}};function V(e){return Array(e.dataTable.rowCount).fill(void 0).map((t,i)=>e.dataTable.getRowObject(i))}function H(e){return{from:e.collapseStart||0,to:e.collapseEnd||0,showPoints:!1}}function X(e,t,i){var s;let r,o=[],a=[],l={},d=t||!1,h={},c=-1,p=C(e,{after:function(e){let t=h[e.pos],i=0,s=0;t.children.forEach(function(e){s+=(e.descendants||0)+1,i=Math.max((e.height||0)+1,i)}),t.descendants=s,t.height=i,t.collapsed&&a.push(t)},before:function(e){let t,i,s=(0,n.isObject)(e.data,!0)?e.data:{},r=(0,n.isString)(s.name)?s.name:"",a=l[e.parent],p=(0,n.isObject)(a,!0)?h[a.pos]:null;d&&(0,n.isObject)(p,!0)&&(t=(0,n.find)(p.children,function(e){return e.name===r}))?(i=t.pos,t.nodes.push(e)):i=c++,!h[i]&&(h[i]=t={depth:p?p.depth+1:0,name:r,id:s.id,nodes:[e],children:[],pos:i},-1!==i&&o.push(r),(0,n.isObject)(p,!0)&&p.children.push(t)),(0,n.isString)(e.id)&&(l[e.id]=e),t&&!0===s.collapsed&&(t.collapsed=!0),e.pos=i}});return s=h,{categories:o,mapOfIdToNode:l,mapOfPosToGridNode:h=(r=function(e,t,s){let o=e.nodes,a=t+(-1===t?0:i-1),l=(a-t)/2,d=t+l;return o.forEach(function(e){let i=e.data;(0,n.isObject)(i,!0)&&(i.y=t+(i.yIndex||0)),e.pos=d}),s[d]=e,e.pos=d,e.tickmarkOffset=l+.5,e.collapseStart=a+.5,e.children.forEach(function(e){r(e,a+1,s),a=(e.collapseEnd||0)-.5}),e.collapseEnd=a+.5,s})(s["-1"],-1,{}),collapsedNodes:a,tree:p}}function q(e){let t=e.target;t.axes.filter(e=>"treegrid"===e.type).forEach(function(i){let s=i.options,r=s.labels,o=i.uniqueNames,a=t.time.parse(s.max),l=!i.treeGrid.mapOfPosToGridNode||i.series.some(function(e){return!e.hasRendered||e.isDirtyData||e.isDirty}),d=0,h,c;if(l){let s=[];if(h=i.series.reduce(function(e,i){let r=V(i),a=r[0],l=Array.isArray(a)&&!a.find(e=>"object"==typeof e);return s.push(l),i.visible&&(r.forEach(function(s){(l||i.options.keys?.length)&&(s=i.pointClass.prototype.optionsToObject.call({series:i},s),i.pointClass.setGanttPointAliases(s,t)),(0,n.isObject)(s,!0)&&(s.yIndex=d,s.seriesIndex=i.index,e.push(s))}),!0===o&&d++),e},[]),a&&h.length<a)for(let e=h.length;e<=a;e++)h.push({name:e+"​"});i.categories=(c=X(h,o||!1,!0===o?d:1)).categories,i.treeGrid.mapOfPosToGridNode=c.mapOfPosToGridNode,i.hasNames=!0,i.treeGrid.tree=c.tree,i.series.forEach(e=>{let t=h.filter(t=>t.seriesIndex===e.index);t.forEach(e=>{delete e.seriesIndex,delete e.yIndex}),e.visible&&e.setData(t,!1)}),i.treeGrid.mapOptionsToLevel=F({defaults:r,from:1,levels:r?.levels,to:i.treeGrid.tree?.height}),"beforeRender"===e.type&&(i.treeGrid.collapsedNodes=c.collapsedNodes)}})}function U(t,i){let s=this.treeGrid.mapOptionsToLevel||{},r="treegrid"===this.type,o=this.ticks,n=o[i],a,l,d;r&&this.treeGrid.mapOfPosToGridNode?((a=s[(d=this.treeGrid.mapOfPosToGridNode[i]).depth])&&(l={labels:a}),!n&&e?o[i]=n=new e(this,i,void 0,void 0,{category:d.name,tickmarkOffset:d.tickmarkOffset,options:l}):(n.parameters.category=d.name,n.options=l,n.addLabel(),this.isDirty=!0)):t.apply(this,Array.prototype.slice.call(arguments,1))}function _(e,t,i,s){let r=this,o="treegrid"===i.type;r.treeGrid||(r.treeGrid=new Y(r)),o&&((0,n.addEvent)(t,"beforeRender",q),(0,n.addEvent)(t,"beforeRedraw",q),(0,n.addEvent)(t,"addSeries",function(e){if(e.options.data){let t=X(e.options.data,i.uniqueNames||!1,1);r.treeGrid.collapsedNodes=(r.treeGrid.collapsedNodes||[]).concat(t.collapsedNodes)}}),(0,n.addEvent)(r,"foundExtremes",function(){r.treeGrid.collapsedNodes?.forEach(function(e){let t=r.treeGrid.collapse(e);r.brokenAxis&&(r.brokenAxis.setBreaks(t,!1),r.treeGrid.collapsedNodes&&(r.treeGrid.collapsedNodes=r.treeGrid.collapsedNodes.filter(t=>e.collapseStart!==t.collapseStart||e.collapseEnd!==t.collapseEnd)))})}),(0,n.addEvent)(r,"afterBreaks",function(){"yAxis"===r.coll&&!r.staticScale&&r.chart.options.chart.height&&(r.isDirty=!0)}),i=(0,n.merge)({grid:{enabled:!0},labels:{align:"left",levels:[{level:void 0},{level:1,style:{fontWeight:"bold"}}],symbol:{type:"triangle",x:-5,y:-3,height:6,width:8}},uniqueNames:!1},i,{reversed:!0})),e.apply(r,[t,i,s]),o&&(r.hasNames=!0,r.options.showLastLabel=!0)}function $(e){let t=this.options,i=this.chart.time,s="number"==typeof t.linkedTo?this.chart[this.coll]?.[t.linkedTo]:void 0;if("treegrid"===this.type){if(this.min=this.userMin??i.parse(t.min)??this.dataMin,this.max=this.userMax??i.parse(t.max)??this.dataMax,(0,n.fireEvent)(this,"foundExtremes"),this.setAxisTranslation(),this.tickInterval=1,this.tickmarkOffset=.5,this.tickPositions=this.treeGrid.mapOfPosToGridNode?this.treeGrid.getTickPositions():[],s){let e=s.getExtremes();this.min=e.min??e.dataMin,this.max=e.max??e.dataMax,this.tickPositions=s.tickPositions}this.linkedParent=s}else e.apply(this,Array.prototype.slice.call(arguments,1))}function K(e){let t=this;"treegrid"===this.type&&t.visible&&t.tickPositions.forEach(function(e){let i=t.ticks[e];i.label?.attachedTreeGridEvents&&((0,n.removeEvent)(i.label.element),i.label.attachedTreeGridEvents=!1)}),e.apply(t,Array.prototype.slice.call(arguments,1))}class Y{static compose(t,i,s,r){var o,a,l;if(!t.keepProps.includes("treeGrid")){let i=t.prototype;t.keepProps.push("treeGrid"),(0,n.wrap)(i,"generateTick",U),(0,n.wrap)(i,"init",_),(0,n.wrap)(i,"setTickInterval",$),(0,n.wrap)(i,"redraw",K),i.utils={getNode:L},e||(e=r)}return o=t,a=i,l=r,o.keepProps.includes("grid")||(o.keepProps.push("grid"),o.prototype.getMaxLabelDimensions=m,(0,n.wrap)(o.prototype,"unsquish",T),(0,n.wrap)(o.prototype,"getOffset",g),(0,n.addEvent)(o,"init",G),(0,n.addEvent)(o,"afterGetTitlePosition",k),(0,n.addEvent)(o,"afterInit",b),(0,n.addEvent)(o,"afterRender",x),(0,n.addEvent)(o,"afterSetAxisTranslation",v),(0,n.addEvent)(o,"afterSetOptions",y),(0,n.addEvent)(o,"afterSetOptions",P),(0,n.addEvent)(o,"afterSetScale",O),(0,n.addEvent)(o,"afterTickSize",E),(0,n.addEvent)(o,"trimTicks",I),(0,n.addEvent)(o,"destroy",A),(0,n.addEvent)(a,"afterSetChartSize",N),(0,n.addEvent)(l,"afterGetLabelPosition",w),(0,n.addEvent)(l,"labelFormat",B)),h.compose(t,s),W.compose(r),t}constructor(e){this.pendingSizeAdjustment=0,this.axis=e}setCollapsedStatus(e){let t=this.axis,i=t.chart;t.series.forEach(function(t){let s=V(t);if(e.id&&s){let r=i.get(e.id),o=s[t.data.indexOf(r)];t.dataTable.setRow({collapsed:e.collapsed},t.data.indexOf(r)),r&&(0,n.isObject)(o,!0)&&(r.collapsed=e.collapsed,o.collapsed=e.collapsed)}})}collapse(e){let t=this.axis,i=t.options.breaks||[],s=H(e);return i.push(s),e.collapsed=!0,t.treeGrid.setCollapsedStatus(e),i}expand(e){let t=this.axis,i=H(e);return e.collapsed=!1,t.treeGrid.setCollapsedStatus(e),t.options.breaks?.reduce(function(e,t){return(t.to!==i.to||t.from!==i.from)&&e.push(t),e},[])||[]}getTickPositions(){let e=this.axis,t=Math.floor(e.min/e.tickInterval)*e.tickInterval,i=Math.ceil(e.max/e.tickInterval)*e.tickInterval;return Object.keys(e.treeGrid.mapOfPosToGridNode||{}).reduce(function(s,r){let o=+r;return o>=t&&o<=i&&!e.brokenAxis?.isInAnyBreak(o)&&s.push(o),s},[])}isCollapsed(e){let t=this.axis.options.breaks||[],i=H(e);return t.some(function(e){return e.from===i.from&&e.to===i.to})}toggleCollapse(e){return this.isCollapsed(e)?this.expand(e):this.collapse(e)}}let J=a();Y.compose(J.Axis,J.Chart,J.Series,J.Tick);let Q=a();export{Q as default};