/* Highcharts JS v11.1.0 (2023-06-05) Highcharts Drilldown module Author: Torstein Honsi License: www.highcharts.com/license */ 'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/drilldown",["highcharts"],function(l){a(l);a.Highcharts=l;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function l(a,k,p,l){a.hasOwnProperty(k)||(a[k]=l.apply(null,p),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:k,module:a[k]}})))}a=a?a._modules: {};l(a,"Extensions/Breadcrumbs/BreadcrumbsDefaults.js",[],function(){return{lang:{mainBreadcrumb:"Main"},options:{buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"#334eff"}},buttonSpacing:5,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}}});l(a,"Extensions/Breadcrumbs/Breadcrumbs.js", [a["Extensions/Breadcrumbs/BreadcrumbsDefaults.js"],a["Core/Chart/Chart.js"],a["Core/Templating.js"],a["Core/Utilities.js"]],function(a,k,p,l){function t(){if(this.breadcrumbs){const f=this.resetZoomButton&&this.resetZoomButton.getBBox(),d=this.breadcrumbs.options;f&&"right"===d.position.align&&"plotBox"===d.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-f.width-d.buttonSpacing)}}function G(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function H(){const f=this.breadcrumbs; if(f&&!f.options.floating&&f.level){var d=f.options,g=d.buttonTheme;g=(g.height||0)+2*(g.padding||0)+d.buttonSpacing;d=d.position.verticalAlign;"bottom"===d?(this.marginBottom=(this.marginBottom||0)+g,f.yOffset=g):"middle"!==d?(this.plotTop+=g,f.yOffset=-g):f.yOffset=void 0}}function w(){this.breadcrumbs&&this.breadcrumbs.redraw()}function D(f){!0===f.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}const {format:I}=p,{addEvent:x,defined:E,extend:y,fireEvent:F,isString:R, merge:r,objectEach:L,pick:u}=l,h=[];class C{static compose(f,d){l.pushUnique(h,f)&&(x(k,"destroy",G),x(k,"afterShowResetZoom",t),x(k,"getMargins",H),x(k,"redraw",w),x(k,"selection",D));l.pushUnique(h,d)&&y(d.lang,a.lang)}constructor(f,d){this.elementList={};this.isDirty=!0;this.level=0;this.list=[];d=r(f.options.drilldown&&f.options.drilldown.drillUpButton,C.defaultOptions,f.options.navigation&&f.options.navigation.breadcrumbs,d);this.chart=f;this.options=d||{}}updateProperties(f){this.setList(f); this.setLevel();this.isDirty=!0}setList(f){this.list=f}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(f){const d=this.chart,g=this.options;var a=d.options.lang;const h=u(g.format,g.showFullPath?"{level.name}":"\u2190 {level.name}");a=a&&u(a.drillUpText,a.mainBreadcrumb);f=g.formatter&&g.formatter(f)||I(h,{level:f.levelOptions},d)||"";(R(f)&&!f.length||"\u2190 "===f)&&E(a)&&(f=g.showFullPath?a:"\u2190 "+a);return f}redraw(){this.isDirty&&this.render(); this.group&&this.group.align();this.isDirty=!1}render(){const f=this.chart,d=this.options;!this.group&&d&&(this.group=f.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:d.zIndex}).add());d.showFullPath?this.renderFullPathButtons():this.renderSingleButton();this.alignBreadcrumbsGroup()}renderFullPathButtons(){this.destroySingleButton();this.resetElementListState();this.updateListElements();this.destroyListElements()}renderSingleButton(){const f= this.chart;var d=this.list;const g=this.options.buttonSpacing;this.destroyListElements();const a=this.group?this.group.getBBox().width:g;d=d[d.length-2];!f.drillUpButton&&0{if(f||!d[h].updated)a=d[h],a.button&&a.button.destroy(),a.separator&&a.separator.destroy(),delete a.button,delete a.separator,delete d[h]});f&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){L(this.elementList,a=>{a.updated=!1})}updateListElements(){const a=this.elementList, d=this.options.buttonSpacing,g=this.list,h=this.options.rtl,k=h?-1:1,q=function(a,d){return k*a.getBBox().width+k*d},p=function(a,d,c){a.translate(d-a.getBBox().width,c)};let l=this.group?q(this.group,d):d,t,r;for(let f=0,u=g.length;f{var c;b.options.inactiveOtherPoints=!0;null===(c=b.dataLabelsGroup)||void 0===c?void 0:c.destroy();delete b.dataLabelsGroup});if(e.options.drilldown&&!e.mapView.projection.hasGeoProjection&&u.drilldown){var a=f(e.options.drilldown,u.drilldown);C(a.mapZooming)||(e.options.drilldown.mapZooming=!1)}if(e.options.drilldown&&e.options.drilldown.animation&&e.options.drilldown.mapZooming){e.mapView.allowTransformAnimation= !0;a=r(e.options.drilldown.animation);if("boolean"!==typeof a){const d=a.complete,n=function(a){a&&a.applyDrilldown&&e.mapView&&(e.addSingleSeriesAsDrilldown(c,b),e.applyDrilldown(),e.mapView.allowTransformAnimation=!1)};a.complete=function(){d&&d.apply(this,arguments);n.apply(this,arguments)}}c.zoomTo(a)}else e.addSingleSeriesAsDrilldown(c,b),e.applyDrilldown()}else e.addSingleSeriesAsDrilldown(c,b),e.applyDrilldown()};p.prototype.addSingleSeriesAsDrilldown=function(c,b){let e=c.series,a=e.xAxis, A=e.yAxis,f,g=[],h=[],v,m,l;l=this.styledMode?{colorIndex:q(c.colorIndex,e.colorIndex)}:{color:c.color||e.color};this.drilldownLevels||(this.drilldownLevels=[]);v=e.options._levelNumber||0;(m=this.drilldownLevels[this.drilldownLevels.length-1])&&m.levelNumber!==v&&(m=void 0);b=d(d({_ddSeriesId:N++},l),b);f=e.points.indexOf(c);e.chart.series.forEach(function(b){b.xAxis===a&&(b.options._ddSeriesId=b.options._ddSeriesId||N++,b.options.colorIndex=b.colorIndex,b.options._levelNumber=b.options._levelNumber|| v,m?(g=m.levelSeries,h=m.levelSeriesOptions):(g.push(b),b.purgedOptions=z({_ddSeriesId:b.options._ddSeriesId,_levelNumber:b.options._levelNumber,selected:b.options.selected},b.userOptions),h.push(b.purgedOptions)))});c=d({levelNumber:v,seriesOptions:e.options,seriesPurgedOptions:e.purgedOptions,levelSeriesOptions:h,levelSeries:g,shapeArgs:c.shapeArgs,bBox:c.graphic?c.graphic.getBBox():{},color:c.isNull?Q.parse(l.color).setOpacity(0).get():l.color,lowerSeriesOptions:b,pointOptions:e.options.data[f], pointIndex:f,oldExtremes:{xMin:a&&a.userMin,xMax:a&&a.userMax,yMin:A&&A.userMin,yMax:A&&A.userMax},resetZoomButton:m&&m.levelNumber===v?void 0:this.resetZoomButton},l);this.drilldownLevels.push(c);a&&a.names&&(a.names.length=0);b=c.lowerSeries=this.addSeries(b,!1);b.options._levelNumber=v+1;a&&(a.oldPos=a.pos,a.userMin=a.userMax=null,A.userMin=A.userMax=null);b.isDrilling=!0;e.type===b.type&&(b.animate=b.animateDrilldown||t,b.options.animation=!0)};p.prototype.applyDrilldown=function(){const c=this, b=this.drilldownLevels;let e;b&&0Object.keys(b).length).length||(c.resetZoomButton&&(c.resetZoomButton.hide(),delete c.resetZoomButton),c.pointer.reset(),g(c,"afterDrilldown"),c.mapView&&(c.series.forEach(b=>{b.isDirtyData=!0;b.isDrilling=!1}),c.mapView.fitToBounds(void 0,void 0)),g(c,"afterApplyDrilldown"))})):a.options&&a.options._levelNumber===e&&a.remove(!1)})}));c.mapView||(this.resetZoomButton&&(this.resetZoomButton.hide(),delete this.resetZoomButton),this.pointer.reset(),g(this,"afterDrilldown"),this.redraw(), g(this,"afterApplyDrilldown"))};const O=function(c){const b=[];(c=c.drilldownLevels)&&c.length&&(b[0]||b.push({level:0,levelOptions:c[0].seriesOptions}),c.forEach(function(c,a){c.levelNumber+1>b[b.length-1].level&&b.push({level:c.levelNumber+1,levelOptions:z({name:c.lowerSeries.name},c.pointOptions)})}));return b};p.prototype.drillUp=function(c){if(this.drilldownLevels&&0!==this.drilldownLevels.length){g(this,"beforeDrillUp");for(var b=this,a=b.drilldownLevels,d=a[a.length-1].levelNumber,f=b.series, h=b.drilldownLevels.length,l=function(c,a){let e;f.forEach(function(b){b.options._ddSeriesId===c._ddSeriesId&&(e=b)});e=e||b.addSeries(c,!1);e.type===a.type&&e.animateDrillupTo&&(e.animate=e.animateDrillupTo);if(c===k.seriesPurgedOptions)return e},K=c=>{c.remove(!1);b.series.forEach(b=>{b.colorAxis&&(b.isDirtyData=!0);b.options.inactiveOtherPoints=!1});b.redraw()},v=a.length,m,k;v--;){let e,n;k=a[v];if(k.levelNumber===d){a.pop();e=k.lowerSeries;if(!e.chart)for(m=f.length;m--;)if(f[m].options.id=== k.lowerSeriesOptions.id&&f[m].options._levelNumber===d+1){e=f[m];break}e.xData=[];e.xAxis&&e.xAxis.names&&(0===h||v===h)&&(e.xAxis.names.length=0);k.levelSeriesOptions.forEach(b=>{(b=l(b,e))&&(n=b)});g(b,"drillup",{seriesOptions:k.seriesPurgedOptions||k.seriesOptions});n&&(n.type===e.type&&(n.drilldownLevel=k,n.options.animation=b.options.drilldown.animation,e.animateDrillupFrom&&e.chart&&e.animateDrillupFrom(k)),n.options._levelNumber=d);m=e;b.mapView||m.remove(!1);n&&n.xAxis&&(m=k.oldExtremes,n.xAxis.setExtremes(m.xMin, m.xMax,!1),n.yAxis.setExtremes(m.yMin,m.yMax,!1));k.resetZoomButton&&(b.resetZoomButton=k.resetZoomButton);this.mapView?(m=b.options.drilldown&&b.options.drilldown.animation&&b.options.drilldown.mapZooming,k.levelNumber===d&&c?e.remove(!1):(e.dataLabelsGroup&&(e.dataLabelsGroup.destroy(),delete e.dataLabelsGroup),b.mapView&&n&&(m&&(e.isDrilling=!0,n.isDrilling=!0,b.redraw(!1),b.mapView.fitToBounds(e.bounds,void 0,!0,!1)),b.mapView.allowTransformAnimation=!0,g(b,"afterDrillUp",{seriesOptions:n?n.userOptions: void 0}),m?b.mapView.setView(void 0,1,!0,{complete:function(){Object.prototype.hasOwnProperty.call(this,"complete")&&K(e)}}):(b.mapView.allowTransformAnimation=!1,e.group?e.group.animate({opacity:0},b.options.drilldown.animation,function(){K(e);b.mapView&&(b.mapView.allowTransformAnimation=!0)}):(K(e),b.mapView.allowTransformAnimation=!0)),n.isDrilling=!1,b.ddDupes&&(b.ddDupes.length=0),g(b,"drillupall")))):(g(b,"afterDrillUp"),this.redraw(),this.ddDupes&&(this.ddDupes.length=0),g(b,"drillupall"))}}}}; h(p,"afterInit",function(){const c=this;c.drilldown={chart:c,fadeInGroup:k,update:function(b,e){z(!0,c.options.drilldown,b);q(e,!0)&&c.redraw()}}});h(p,"render",function(){(this.xAxis||[]).forEach(function(c){c.ddPoints={};c.series.forEach(function(b){let e,a=b.xData||[],d=b.points;for(e=0;e