/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/drilldown
 * @requires highcharts
 *
 * Highcharts Drilldown module
 *
 * (c) 2009-2026 Highsoft AS
 *
 * Author: Torstein Hønsi
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 *
 */import*as t from"../highcharts.js";var e,i={};i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let o=t.default;var r=i.n(o);let l={mainBreadcrumb:"Main"},n=t.default.Templating;var s=i.n(n);let{doc:a,win:d}=r();function p(t,e,i,o={}){let l="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(l,"hcEvents")||(l.hcEvents={});let n=l.hcEvents;r().Point&&t instanceof r().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let s=t.addEventListener;s&&s.call(t,e,i,!!r().supportsPassiveEvents&&{passive:void 0===o.passive?-1!==e.indexOf("touch"):o.passive,capture:!1}),n[e]||(n[e]=[]);let a={fn:i,order:"number"==typeof o.order?o.order:1/0};return n[e].push(a),n[e].sort((t,e)=>t.order-e.order),function(){y(t,e,i)}}function h(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function c(t,e,i,o){if(i=i||{},a?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==r())){let o=a.createEvent("Events");o.initEvent(e,!0,!0),i=h(o,i),t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(e,i)}else if(t.hcEvents){i.target||h(i,{preventDefault:function(){i.defaultPrevented=!0},target:t,type:e});let o=[],r=t,l=!1;for(;r.hcEvents;)Object.hasOwnProperty.call(r,"hcEvents")&&r.hcEvents[e]&&(o.length&&(l=!0),o.unshift.apply(o,r.hcEvents[e])),r=Object.getPrototypeOf(r);l&&o.sort((t,e)=>t.order-e.order),o.forEach(e=>{!1===e.fn.call(t,i,t)&&i.preventDefault()})}o&&!i.defaultPrevented&&o.call(t,i)}function u(t){return w(t)&&"number"==typeof t.nodeType}function m(t){return"string"==typeof t}function f(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function w(t,e){return!!t&&"object"==typeof t&&(!e||!f(t))}function g(t,...e){let i,o=[t,...e],r={},l=function(t,e){return"object"!=typeof t&&(t={}),b(e,function(i,o){if("__proto__"!==o&&"constructor"!==o){let r;!w(i,!0)||(r=i?.constructor,w(i,!0)&&!u(i)&&r?.name&&"Object"!==r.name)||u(i)?t[o]=e[o]:t[o]=l(t[o]||{},i)}}),t};!0===t&&(r=o[1],o=Array.prototype.slice.call(o,2));let n=o.length;for(i=0;i<n;i++)r=l(r,o[i]);return r}function b(t,e,i){for(let o in t)Object.hasOwnProperty.call(t,o)&&e.call(i||t[o],t[o],o,t)}function v(){let t=arguments,e=t.length;for(let i=0;i<e;i++){let e=t[i];if(null!=e)return e}}function y(t,e,i){function o(e,i){let o=t.removeEventListener;o&&o.call(t,e,i,!1)}function r(i){let r,l;t.nodeName&&(e?(r={})[e]=!0:r=i,b(r,function(t,e){if(i[e])for(l=i[e].length;l--;)o(e,i[e][l].fn)}))}let l="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(l,"hcEvents")){let t=l.hcEvents;if(e){let l=t[e]||[];i?(t[e]=l.filter(function(t){return i!==t.fn}),o(e,i)):(r(t),t[e]=[])}else r(t),delete l.hcEvents}}Array.prototype.find;function D(t,e,i){return e>0?setTimeout(t,e,i):(t.call(0,i),-1)}let{format:x}=s(),{composed:S}=r();function B(){if(this.breadcrumbs){let t=this.resetZoomButton&&this.resetZoomButton.getBBox(),e=this.breadcrumbs.options;t&&"right"===e.position.align&&"plotBox"===e.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-e.buttonSpacing)}}function O(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function L(){let t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){let e=t.options,i=e.buttonTheme,o=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,r=e.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+o,t.yOffset=o):"middle"!==r?(this.plotTop+=o,t.yOffset=-o):t.yOffset=void 0}}function E(){this.breadcrumbs&&this.breadcrumbs.redraw()}function A(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class T{static compose(t,e){var i;i="Breadcrumbs",0>S.indexOf(i)&&S.push(i)&&(p(t,"destroy",O),p(t,"afterShowResetZoom",B),p(t,"getMargins",L),p(t,"redraw",E),p(t,"selection",A),h(e.lang,l))}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];let i=g(t.options.drilldown&&t.options.drilldown.drillUpButton,T.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=i||{}}updateProperties(t){this.setList(t),this.setLevel(),this.isDirty=!0}setList(t){this.list=t}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(t){let e=this.chart,i=this.options,o=e.options.lang,r=v(i.format,i.showFullPath?"{level.name}":"← {level.name}"),l=o&&v(o.drillUpText,o.mainBreadcrumb),n=i.formatter&&i.formatter(t)||x(r,{level:t.levelOptions},e)||"";return(m(n)&&!n.length||"← "===n)&&null!=l&&(n=i.showFullPath?l:"← "+l),n}redraw(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1}render(){let t=this.chart,e=this.options;!this.group&&e&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:e.zIndex}).add()),e.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()}renderFullPathButtons(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()}renderSingleButton(){let t=this.chart,e=this.list,i=this.options.buttonSpacing;this.destroyListElements();let o=this.group?this.group.getBBox().width:i,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,o,i):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())}alignBreadcrumbsGroup(t){if(this.group){let e=this.options,i=e.buttonTheme,o=e.position,r="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",l=this.group.getBBox(),n=2*(i.padding||0)+e.buttonSpacing;o.width=l.width+n,o.height=l.height+n;let s=g(o);t&&(s.x+=t),this.options.rtl&&(s.x+=o.width),s.y=v(s.y,this.yOffset,0),this.group.align(s,!0,r)}}renderButton(t,e,i){let o=this,r=this.chart,l=o.options,n=g(l.buttonTheme),s=r.renderer.button(o.getButtonText(t),e,i,function(e){let i,r=l.events&&l.events.click;r&&(i=r.call(o,e,t,o)),!1!==i&&(l.showFullPath?e.newLevel=t.level:e.newLevel=o.level-1,c(o,"up",e))},n).addClass("highcharts-breadcrumbs-button").add(o.group);return r.styledMode||s.attr(l.style),s}renderSeparator(t,e){let i=this.chart,o=this.options.separator,r=i.renderer.label(o.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(o.style),r}update(t){g(!0,this.options,t),this.destroy(),this.isDirty=!0}updateSingleButton(){let t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})}destroy(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0}destroyListElements(t){let e=this.elementList;b(e,(i,o)=>{(t||!e[o].updated)&&((i=e[o]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[o])}),t&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){b(this.elementList,t=>{t.updated=!1})}updateListElements(){let t=this.elementList,e=this.options.buttonSpacing,i=this.list,o=this.options.rtl,r=o?-1:1,l=function(t,e){return r*t.getBBox().width+r*e},n=function(t,e,i){t.translate(e-t.getBBox().width,i)},s=this.group?l(this.group,e):e,a,d;for(let p=0,h=i.length;p<h;++p){let c,u,m=p===h-1;t[(d=i[p]).level]?(c=(a=t[d.level]).button,a.separator||m?a.separator&&m&&(a.separator.destroy(),delete a.separator):(s+=r*e,a.separator=this.renderSeparator(s,e),o&&n(a.separator,s,e),s+=l(a.separator,e)),t[d.level].updated=!0):(c=this.renderButton(d,s,e),o&&n(c,s,e),s+=l(c,e),m||(u=this.renderSeparator(s,e),o&&n(u,s,e),s+=l(u,e)),t[d.level]={button:c,separator:u,updated:!0}),c&&c.setState(2*!!m)}}}T.defaultOptions={buttonSpacing:5,buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"#334eff"}},floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"#666666",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7};let P={activeAxisLabelStyle:{cursor:"pointer",color:"#0022ff",fontWeight:"bold",textDecoration:"underline"},activeDataLabelStyle:{cursor:"pointer",color:"#0022ff",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}},mapZooming:!0},{animObject:C}=r();function M(t,e,i,o){t[i?"addClass":"removeClass"]("highcharts-drilldown-point"),o||t.css({cursor:e})}function I(t){let e=this,i=e.chart,{drilldownLevels:o,styledMode:r}=i,l=C(i.options.drilldown?.animation),{xAxis:n,yAxis:s}=this;if(!t){let t;o?.forEach(i=>{e.options._ddSeriesId===i.lowerSeriesOptions._ddSeriesId&&(t=i.shapeArgs)&&(t.x=(t.x||0)+(i.plotLeft??n.pos)-n.pos,t.y=(t.y||0)+(i.plotTop??s.pos)-s.pos,r||(t.fill=i.color))}),e.points.forEach(i=>{i.graphic?.attr(t).animate(h(i.shapeArgs,{fill:i.color||e.color}),l)}),this.dataLabelsGroups?.forEach(t=>i.drilldown?.fadeInGroup(t)),delete this.animate}}function _(t){let e=this,i=C((e.chart.options.drilldown||{}).animation);e.trackerGroups?.forEach(t=>{"dataLabelsGroup"===t?e.dataLabelsGroups?.forEach(t=>{t?.on("mouseover",()=>{})}):e[t]?.on("mouseover")});let o=e.group,r=o!==e.chart.columnGroup;r&&delete e.group,(this.points||this.data).forEach(l=>{let n=l.graphic,s=t.shapeArgs;if(n&&s){let a=()=>{n.destroy(),o&&r&&(o=o.destroy())};delete l.graphic,e.chart.styledMode||(s.fill=t.color),i.duration?n.animate(s,g(i,{complete:a})):(n.attr(s),a())}})}function k(t){let e=this,i=e.drilldownLevel,o=C(e.chart.options.drilldown?.animation);t||(e.points.forEach(t=>{let e=t.dataLabel;t.graphic&&t.graphic.hide(),e&&(e.hidden="hidden"===e.attr("visibility"),e.hidden||(e.hide(),e.connector?.hide()))}),D(()=>{if(e.points){let t=[];e.data.forEach(e=>{t.push(e)}),e.nodes&&(t=t.concat(e.nodes)),t.forEach((t,e)=>{let o=e===(i&&i.pointIndex)?"show":"fadeIn",r=t.dataLabel;t.graphic&&t.visible&&t.graphic[o]("show"===o||void 0),r&&!r.hidden&&(r.fadeIn(),r.connector?.fadeIn())})}},Math.max(o.duration-50,0)),delete this.animate)}function V(t){let e=this,i=e.chart,o=e.group;i&&o&&e.options&&i.options.drilldown?.animation&&(t&&i.mapView?(o.attr({opacity:.01}),i.mapView.allowTransformAnimation=!1,e.options.inactiveOtherPoints=!0,e.options.enableMouseTracking=!1):(o.animate({opacity:1},i.options.drilldown.animation,()=>{e.options&&(e.options.inactiveOtherPoints=!1,e.options.enableMouseTracking=e.userOptions?.enableMouseTracking??!0)}),e.dataLabelsGroups?.forEach(t=>i.drilldown?.fadeInGroup(t))))}function Z(){let t=this.chart;t?.mapView&&(t.mapView.allowTransformAnimation=!1),this.options&&(this.options.inactiveOtherPoints=!0)}function G(t){let e=this.chart,i=this.group;e&&i&&(t?(i.attr({opacity:.01}),this.options&&(this.options.inactiveOtherPoints=!0)):(i.animate({opacity:1},(e.options.drilldown||{}).animation),this.dataLabelsGroups?.forEach(t=>e.drilldown?.fadeInGroup(t))))}function N(){return this.drilldown&&!this.unbindDrilldownClick&&(this.unbindDrilldownClick=p(this,"click",U)),this}function j(){let t=this.series,e=t.chart.styledMode;this.drilldown&&t.halo&&"hover"===this.state?M(t.halo,"pointer",!0,e):t.halo&&M(t.halo,"auto",!1,e)}function U(t){let e=this.series;e.xAxis&&!1===(e.chart.options.drilldown||{}).allowPointDrilldown?e.xAxis.drilldownCategory(this.x,t):this.runDrilldown(void 0,void 0,t)}function F(t){let e=t.options||{};e.drilldown&&!this.unbindDrilldownClick?this.unbindDrilldownClick=p(this,"click",U):!e.drilldown&&void 0!==e.drilldown&&this.unbindDrilldownClick&&(this.unbindDrilldownClick=this.unbindDrilldownClick())}function z(){let t=this.chart,e=t.options.drilldown?.activeDataLabelStyle||{},i=t.renderer,o=t.styledMode;for(let t of this.points){var r;let l=(f(r=t.options.dataLabels)?r:[r])[0]||{},n=t.dlOptions||l.style||{};if(t.drilldown&&t.dataLabel){if("contrast"===e.color&&!o){let e=m(t.color)&&t.color||m(this.color)&&this.color;m(e)&&(n.color=i.getContrast(e))}l&&l.color&&(n.color=l.color),t.dataLabel.addClass("highcharts-drilldown-data-label"),o||t.dataLabel.css(e).css(n)}}}function R(){let t=this.chart.styledMode;for(let e of this.points)e.drilldown&&e.graphic&&M(e.graphic,"pointer",!0,t)}function W(t){let e=this.chart,i=this.points,o=e.drilldownLevels||[],r=o[o.length-1],l=C(e.options.drilldown?.animation);if(this.is("item")&&(l.duration=0),this.center){let o=r.shapeArgs||{},n=o.start||0,s=((o.end||0)-n)/this.points.length,a=e.styledMode;if(o.y=(o.y||0)+((r.plotTop??e.plotTop)-e.plotTop)/2,!t){let t,d;for(let e=0,p=i.length;e<p;++e){t=(d=i[e]).shapeArgs||{},a||(o.fill=r.color,t.fill=d.color);let p=g(o,{start:n+e*s,end:n+(e+1)*s});d.graphic?.attr(p).animate(t,l)}this.dataLabelsGroups?.forEach(t=>e.drilldown?.fadeInGroup(t)),delete this.animate}}}function H(){this.runDrilldown()}function q(t,e,i){let o=this.series,r=o.chart,l=r.options.drilldown||{},n=(l.series||[]).length,s;for(r.ddDupes||(r.ddDupes=[]),r.colorCounter=r.symbolCounter=0;n--&&!s;)l.series&&l.series[n].id===this.drilldown&&this.drilldown&&-1===r.ddDupes.indexOf(this.drilldown)&&(s=l.series[n],r.ddDupes.push(this.drilldown));c(r,"drilldown",{point:this,seriesOptions:s,category:e,originalEvent:i,points:void 0!==e&&o.xAxis.getDDPoints(e).slice(0)},e=>{let i=e.point.series?.chart,o=e.seriesOptions;i&&o&&(t?i.addSingleSeriesAsDrilldown(e.point,o):i.addSeriesAsDrilldown(e.point,o))})}let J=function(t,e){let i=t.prototype.pointClass,o=i.prototype;if(!o.doDrilldown){let{column:r,map:l,pie:n}=e;if(p(i,"afterInit",N),p(i,"afterSetState",j),p(i,"update",F),o.doDrilldown=H,o.runDrilldown=q,p(t,"afterDrawDataLabels",z),p(t,"afterDrawTracker",R),r){let t=r.prototype;t.animateDrilldown=I,t.animateDrillupFrom=_,t.animateDrillupTo=k}if(l){let t=l.prototype;t.animateDrilldown=V,t.animateDrillupFrom=Z,t.animateDrillupTo=G}if(n){let t=n.prototype;t.animateDrilldown=W,t.animateDrillupFrom=_,t.animateDrillupTo=k}}},{animObject:K}=r(),{noop:Q}=r(),X=1;function Y(t,e){this.getDDPoints(t).forEach(function(i){w(i)&&i.series&&i.series.visible&&i.runDrilldown&&i.runDrilldown(!0,t,e)}),this.chart.applyDrilldown()}function $(t){return this.ddPoints&&this.ddPoints[t]||[]}function tt(t){let e=[],i=t.drilldownLevels;return i&&i.length&&(e[0]||e.push({level:0,levelOptions:i[0].seriesOptions}),i.forEach(function(t){let i=e[e.length-1];t.levelNumber+1>i.level&&e.push({level:t.levelNumber+1,levelOptions:g({name:t.lowerSeries.name},t.pointOptions)})})),e}class te{constructor(t){this.chart=t}addSeriesAsDrilldown(t,e){let i=this.chart||this;if(c(this,"addSeriesAsDrilldown",{seriesOptions:e}),i.mapView){if(t.series.isDrilling=!0,i.series.forEach(t=>{t.options.inactiveOtherPoints=!0,t.dataLabelsGroups?.forEach(t=>t?.destroy()),t.dataLabelsGroups=[],t.points?.forEach(t=>{t.dataLabels&&(t.dataLabels=[])})}),i.options.drilldown&&!i.mapView.projection.hasGeoProjection&&P){var o;let t;null==(o=i.options.drilldown,!function t(e,i,o,r){b(e,function(l,n){w(l,!0)&&!l.nodeType?(o[n]=f(l)?[]:{},t(l,i[n]||{},o[n],r+1),0===Object.keys(o[n]).length&&("colorAxis"!==n||0!==r)&&delete o[n]):(e[n]!==i[n]||n in e&&!(n in i))&&"__proto__"!==n&&"constructor"!==n&&(o[n]=e[n])})}(o,P,t={},0),t).mapZooming&&(i.options.drilldown.mapZooming=!1)}if(i.options.drilldown&&i.options.drilldown.animation&&i.options.drilldown.mapZooming){i.mapView.allowTransformAnimation=!0;let o=K(i.options.drilldown.animation);if("boolean"!=typeof o){let r=o.complete,l=function(o){o&&o.applyDrilldown&&i.mapView&&(i.addSingleSeriesAsDrilldown(t,e),i.applyDrilldown(),i.mapView.allowTransformAnimation=!1)};o.complete=function(){r&&r.apply(this,arguments),l.apply(this,arguments)}}t.zoomTo(o)}else i.addSingleSeriesAsDrilldown(t,e),i.applyDrilldown()}else i.addSingleSeriesAsDrilldown(t,e),i.applyDrilldown()}addSingleSeriesAsDrilldown(t,e){let i=this.chart||this,o=t.series,r=o.xAxis,l=o.yAxis,n=r&&i.inverted?l:r,s=r&&i.inverted?r:l,a=i.styledMode?{colorIndex:t.colorIndex??o.colorIndex}:{color:t.color||o.color},d=o.options._levelNumber||0;i.drilldownLevels||(i.drilldownLevels=[]),e=h(h({_ddSeriesId:X++},a),e);let p=[],c=[],u;(u=i.drilldownLevels[i.drilldownLevels.length-1])&&u.levelNumber!==d&&(u=void 0),o.chart.series.forEach(t=>{t.xAxis===r&&(t.options._ddSeriesId=t.options._ddSeriesId||X++,t.options.colorIndex=t.colorIndex,t.options._levelNumber=t.options._levelNumber||d,u?(p=u.levelSeries,c=u.levelSeriesOptions):(p.push(t),t.purgedOptions=g({_ddSeriesId:t.options._ddSeriesId,_levelNumber:t.options._levelNumber,selected:t.options.selected},t.userOptions),c.push(t.purgedOptions)))}),r?.names&&(r.names.length=0);let m=i.addSeries(e,!1);m.options._levelNumber=d+1,r&&(r.userMin=r.userMax=void 0,l.userMin=l.userMax=void 0),m.isDrilling=!0;let f=h({levelNumber:d,seriesOptions:o.options,seriesPurgedOptions:o.purgedOptions,levelSeriesOptions:c,levelSeries:p,shapeArgs:t.shapeArgs,bBox:t.graphic?t.graphic.getBBox():{},color:t.isNull?"rgba(0,0,0,0)":a.color,lowerSeries:m,lowerSeriesOptions:e,plotTop:s?.pos??i.plotTop,plotLeft:n?.pos??i.plotLeft,pointOptions:t.options,pointIndex:t.index,oldExtremes:{xMin:r?.userMin,xMax:r?.userMax,yMin:l?.userMin,yMax:l?.userMax},resetZoomButton:u&&u.levelNumber===d?void 0:i.resetZoomButton},a);i.drilldownLevels.push(f),o.type===m.type&&(m.animate=m.animateDrilldown||Q,m.options.animation=!0)}applyDrilldown(){let t,e=this.chart||this,i=e.options.drilldown,o=e.drilldownLevels;o&&o.length>0&&(t=o[o.length-1].levelNumber,e.hasCartesianSeries=o.some(t=>t.lowerSeries?.isCartesian),(e.drilldownLevels||[]).forEach(o=>{e.mapView&&i?.mapZooming&&(e.redraw(),o.lowerSeries.isDrilling=!1,e.mapView.fitToBounds(o.lowerSeries.bounds),o.lowerSeries.isDrilling=!0),o.levelNumber===t&&o.levelSeries.forEach(r=>{if(e.mapView){if(r.options&&r.options._levelNumber===t&&r.group){let t={};i&&(t=i.animation),r.group.animate({opacity:0},t,()=>{r.remove(!1),o.levelSeries.filter(t=>Object.keys(t).length).length||(e.resetZoomButton&&(e.resetZoomButton.hide(),delete e.resetZoomButton),e.pointer?.reset(),c(e,"afterDrilldown"),e.mapView&&(e.series.forEach(t=>{t.isDirtyData=!0,t.isDrilling=!1}),e.mapView.fitToBounds(void 0,void 0),e.mapView.allowTransformAnimation=!0),c(e,"afterApplyDrilldown"))})}}else r.options&&r.options._levelNumber===t&&r.remove(!1)})})),e.mapView||(e.resetZoomButton&&(e.resetZoomButton.hide(),delete e.resetZoomButton),e.pointer?.reset(),c(e,"afterDrilldown"),e.hasCartesianSeries||e.axes.forEach(t=>{t.destroy(!0),t.init(e,g(t.userOptions,t.options))}),e.redraw(i?.animation),c(e,"afterApplyDrilldown"))}drillUp(t){let e=this.chart||this;if(!e.drilldownLevels||0===e.drilldownLevels.length)return;c(e,"beforeDrillUp");let i=e.drilldownLevels,o=i[i.length-1].levelNumber,r=e.series,l=e.drilldownLevels.length,n=e.options.drilldown||{},s=(t,i)=>{let o;if(r.forEach(e=>{e.options._ddSeriesId===t._ddSeriesId&&(o=e)}),(o=o||e.addSeries(t,!1)).type===i.type&&o.animateDrillupTo&&(o.animate=o.animateDrillupTo),t===h.seriesPurgedOptions)return o},a=t=>{t.remove(!1),e.series.forEach(t=>{t.colorAxis&&(t.isDirtyData=!0),t.options.inactiveOtherPoints=!1,t.group&&t.visible&&t.group.attr({opacity:1})}),e.redraw()},d=i.length,p,h,u;for(e.symbolCounter=e.colorCounter=0;d--;){let m,f;if((h=i[d]).levelNumber===o){if(i.pop(),!(m=h.lowerSeries).chart){for(p=r.length;p--;)if(r[p].options.id===h.lowerSeriesOptions.id&&r[p].options._levelNumber===o+1){m=r[p];break}}m.dataTable.setColumn("x",[]),m.xAxis&&m.xAxis.names&&(0===l||d===l-1)&&(m.xAxis.names.length=0),h.levelSeriesOptions.forEach(t=>{let e=s(t,m);e&&(f=e)}),c(e,"drillup",{seriesOptions:h.seriesPurgedOptions||h.seriesOptions}),f&&(f.type===m.type&&(f.drilldownLevel=h,f.options.animation=n.animation,m.chart&&m.animateDrillupFrom?.(h)),f.options._levelNumber=o);let w=m;if(e.mapView||w.remove(!1),f?.xAxis&&(u=h.oldExtremes,f.xAxis.setExtremes(u.xMin,u.xMax,!1),f.yAxis.setExtremes(u.yMin,u.yMax,!1)),h.resetZoomButton&&(e.resetZoomButton=h.resetZoomButton),e.mapView){let i=h.levelNumber===o&&t,r=n.animation&&n.mapZooming;i?m.remove(!1):(m.dataLabelsGroups?.forEach(t=>{t?.destroy()}),m.dataLabelsGroups=[],e.mapView&&f&&(r&&(m.isDrilling=!0,f.isDrilling=!0,e.redraw(!1),e.mapView.fitToBounds(m.bounds,void 0,!0,!1)),e.mapView.allowTransformAnimation=!0,c(e,"afterDrillUp",{seriesOptions:f?f.userOptions:void 0}),r?(e.mapView.setView(void 0,e.mapView.minZoom??1,!0,{complete:function(){Object.prototype.hasOwnProperty.call(this,"complete")&&a(m)}}),f._hasTracking=!1):(e.mapView.allowTransformAnimation=!1,m.group?m.group.animate({opacity:0},n.animation,()=>{a(m),e.mapView&&(e.mapView.allowTransformAnimation=!0)}):(a(m),e.mapView.allowTransformAnimation=!0)),f.isDrilling=!1))}else c(e,"afterDrillUp")}}e.mapView||t||e.redraw(n.animation),e.ddDupes&&(e.ddDupes.length=0),c(e,"drillupall")}fadeInGroup(t){let e=K(this.chart.options.drilldown?.animation);t&&(t.hide(),D(()=>{t?.added&&t.fadeIn()},Math.max(e.duration-50,0)))}update(t,e=!0){let i=this.chart;g(!0,i.options.drilldown,t),e&&i.redraw()}}!function(t){function e(t){let e=this.chart,i=this.getLevel()-t.newLevel,o=i>1;for(let t=0;t<i;t++)t===i-1&&(o=!1),e.drillUp(o)}function i(){let t=this.options.drilldown,e=t&&t.breadcrumbs;this.breadcrumbs||(this.breadcrumbs=new T(this,e)),this.breadcrumbs.updateProperties(tt(this))}function o(){this.breadcrumbs&&this.breadcrumbs.updateProperties(tt(this))}function r(){this.drilldown=new te(this)}function l(){this.resetZoomButton&&(this.resetZoomButton=this.resetZoomButton.destroy())}function n(){this.resetZoomButton&&this.showResetZoom()}function s(){(this.xAxis||[]).forEach(t=>{let e={};t.ddPoints=e,t.series.forEach(t=>{let i=t.getColumn("x"),o=t.points,r=t.options.data||[];for(let l=0,n=i.length,s;l<n;l++)if("number"!=typeof(s=r[l])&&(s=t.pointClass.prototype.optionsToObject.call({series:t},s)).drilldown){e[i[l]]||(e[i[l]]=[]);let r=l-(t.cropStart||0);e[i[l]].push(!o||!(r>=0)||!(r<o.length)||o[r])}}),b(t.ticks,t=>t.drillable())})}function a(t){let e=this.breadcrumbs,i=t.options.drilldown&&t.options.drilldown.breadcrumbs;e&&i&&e.update(i)}function d(t){this.attr({opacity:.1,visibility:"inherit"}).animate({opacity:this.newOpacity??1},t||{duration:250})}function h(){let t=this.pos,e=this.label,i=this.axis,o="xAxis"===i.coll&&i.getDDPoints,r=o&&i.getDDPoints(t),l=i.chart.styledMode;o&&(e&&r&&r.length?(e.drillable=!0,e.basicStyles||l||(e.basicStyles=g(e.styles)),e.addClass("highcharts-drilldown-axis-label"),e.removeOnDrillableClick&&y(e.element,"click"),e.removeOnDrillableClick=p(e.element,"click",function(e){e.preventDefault(),i.drilldownCategory(t,e)}),!l&&i.chart.options.drilldown&&e.css(i.chart.options.drilldown.activeAxisLabelStyle||{})):e&&e.drillable&&e.removeOnDrillableClick&&(l||(e.styles={},e.element.removeAttribute("style"),e.css(e.basicStyles)),e.removeOnDrillableClick(),e.removeClass("highcharts-drilldown-axis-label")))}t.compose=function(t,c,u,m,f,w,g){J(m,f);let b=c.prototype;if(!b.drillUp){let m=w.prototype.Element,f=te.prototype,v=t.prototype,y=m.prototype,D=g.prototype;v.drilldownCategory=Y,v.getDDPoints=$,T.compose(c,u),p(T,"up",e),b.addSeriesAsDrilldown=f.addSeriesAsDrilldown,b.addSingleSeriesAsDrilldown=f.addSingleSeriesAsDrilldown,b.applyDrilldown=f.applyDrilldown,b.drillUp=f.drillUp,p(c,"afterDrilldown",i),p(c,"afterDrillUp",o),p(c,"afterInit",r),p(c,"drillup",l),p(c,"drillupall",n),p(c,"render",s),p(c,"update",a),u.drilldown=P,y.fadeIn=d,D.drillable=h}}}(e||(e={}));let ti=e,to=r();to.Breadcrumbs=to.Breadcrumbs||T,ti.compose(to.Axis,to.Chart,to.defaultOptions,to.Series,to.seriesTypes,to.SVGRenderer,to.Tick);let tr=r();export{tr as default};