/* Highcharts JS v7.1.1 (2019-04-09) Accessibility module (c) 2010-2019 Highsoft AS Author: Oystein Moseng License: www.highcharts.com/license */ (function(g){"object"===typeof module&&module.exports?(g["default"]=g,module.exports=g):"function"===typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(m){g(m);g.Highcharts=m;return g}):g("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(g){function m(d,g,l,k){d.hasOwnProperty(g)||(d[g]=k.apply(null,l))}g=g?g._modules:{};m(g,"modules/accessibility/KeyboardNavigationHandler.js",[g["parts/Globals.js"]],function(d){function g(d,b){this.chart=d;this.keyCodeMap= b.keyCodeMap||[];this.validate=b.validate;this.init=b.init;this.terminate=b.terminate;this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}var l=d.find;g.prototype={run:function(d){var b=d.which||d.keyCode,a=this.response.noHandler,c=l(this.keyCodeMap,function(a){return-1]+(>|$)/g,""):a},htmlencode:function(a){return a.replace(/&/g,"\x26amp;").replace(//g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#x27;").replace(/\//g,"\x26#x2F;")}, init:function(){},getKeyboardNavigation:function(){},onChartUpdate:function(){},onChartRender:function(){},destroy:function(){this.destroyBase()}};return g});m(g,"modules/accessibility/KeyboardNavigation.js",[g["parts/Globals.js"],g["modules/accessibility/KeyboardNavigationHandler.js"]],function(d,g){function l(a,b,f){this.init(a,b,f)}var k=d.merge,b=d.addEvent,a=d.win,c=a.document;l.prototype={init:function(a,h){var f=this;this.chart=a;this.components=h;this.modules=[];this.currentModuleIx=0;a.container.hasAttribute("tabIndex")|| a.container.setAttribute("tabindex","0");this.addExitAnchor();this.unbindKeydownHandler=b(a.renderTo,"keydown",function(a){f.onKeydown(a)});this.unbindMouseUpHandler=b(c,"mouseup",function(){f.onMouseUp()});this.update();this.modules.length&&this.modules[0].init(1)},update:function(a){var b=this.chart.options.accessibility,b=b&&b.keyboardNavigation,f=this.components;b&&b.enabled&&a&&a.length?this.modules=a.reduce(function(a,b){b=f[b].getKeyboardNavigation();return b.length?a.concat(b):(a.push(b), a)},[new g(this.chart,{})]):(this.modules=[],this.currentModuleIx=0)},onMouseUp:function(){if(!(this.keyboardReset||this.chart.pointer&&this.chart.pointer.chartPosition)){var a=this.chart,b=this.modules&&this.modules[this.currentModuleIx||0];b&&b.terminate&&b.terminate();a.focusElement&&a.focusElement.removeFocusBorder();this.currentModuleIx=0;this.keyboardReset=!0}},onKeydown:function(b){b=b||a.event;var c,f=this.modules&&this.modules.length&&this.modules[this.currentModuleIx];this.keyboardReset= !1;if(f){var n=f.run(b);n===f.response.success?c=!0:n===f.response.prev?c=this.prev():n===f.response.next&&(c=this.next());c&&b.preventDefault()}},prev:function(){return this.move(-1)},next:function(){return this.move(1)},move:function(a){var b=this.modules&&this.modules[this.currentModuleIx];b&&b.terminate&&b.terminate(a);this.chart.focusElement&&this.chart.focusElement.removeFocusBorder();this.currentModuleIx+=a;if(b=this.modules&&this.modules[this.currentModuleIx]){if(b.validate&&!b.validate())return this.move(a); if(b.init)return b.init(a),!0}this.currentModuleIx=0;0b&&a.highlightLastExportItem()},terminate:function(){a.hideExportMenu()}})}});return k});m(g,"modules/accessibility/components/SeriesComponent.js",[g["parts/Globals.js"],g["modules/accessibility/AccessibilityComponent.js"],g["modules/accessibility/KeyboardNavigationHandler.js"]],function(d,g,l){function k(a){var b=a.index,f=a.series.points,c=f.length;if(f[b]!==a)for(;c--;){if(f[c]===a)return c}else return b}function b(a){var b=a.chart.options.accessibility,f= a.options.accessibility||{},c=f.keyboardNavigation;return c&&!1===c.enabled||!1===f.enabled||!1===a.options.enableMouseTracking||!a.visible||b.pointDescriptionThreshold&&b.pointDescriptionThreshold<=a.points.length}function a(a){var f=a.series.chart.options.accessibility;return a.isNull&&f.keyboardNavigation.skipNullPoints||!1===a.visible||b(a.series)}var c=d.merge,e=d.pick;d.Series.prototype.keyboardMoveVertical=!0;["column","pie"].forEach(function(a){d.seriesTypes[a]&&(d.seriesTypes[a].prototype.keyboardMoveVertical= !1)});d.Point.prototype.highlight=function(){var a=this.series.chart;if(this.isNull)a.tooltip&&a.tooltip.hide(0);else this.onMouseOver();this.graphic&&a.setFocusToElement(this.graphic);a.highlightedPoint=this;return this};d.Chart.prototype.highlightAdjacentPoint=function(f){var c=this.series,e=this.highlightedPoint,h=e&&k(e)||0,d=e&&e.series.points,g=this.series&&this.series[this.series.length-1],g=g&&g.points&&g.points[g.points.length-1];if(!c[0]||!c[0].points)return!1;if(e){if(c=c[e.series.index+ (f?1:-1)],h=d[h+(f?1:-1)],!h&&c&&(h=c.points[f?0:c.points.length-1]),!h)return!1}else h=f?c[0].points[0]:g;return a(h)?(c=h.series,b(c)?this.highlightedPoint=f?c.points[c.points.length-1]:c.points[0]:this.highlightedPoint=h,this.highlightAdjacentPoint(f)):h.highlight()};d.Series.prototype.highlightFirstValidPoint=function(){var b=this.chart.highlightedPoint,c=(b&&b.series)===this?k(b):0,b=this.points,e=b.length;if(b&&e){for(var h=c;h=d&&f||0<=d&&!f||5>k||a(b))&&ka.id.indexOf("highcharts-")?a.id:"x, "+a.x),t=a.series.pointArrayMap?a.series.pointArrayMap.reduce(function(b,c){return b+(b.length?", ":"")+c+": "+k+r(e(a[c],a.options[c]))+ g},""):void 0!==a.value?k+r(a.value)+g:k+r(a.y)+g;return(void 0!==a.index?a.index+1+". ":"")+(y?m+", ":"")+t+"."+(l?" "+l:"")+(1b&&ea.dataMax&&(c=a.dataMax,e=c-h);this.setExtremes(e,c)};var k=function(b){this.initBase(b);this.init()};k.prototype=new g;d.extend(k.prototype,{init:function(){var b=this,a=this.chart;["afterShowResetZoom","afterDrilldown","drillupall"].forEach(function(c){b.addEvent(a,c,function(){b.updateProxyOverlays()})})},onChartUpdate:function(){var b=this.chart,a=this;b.mapNavButtons&&b.mapNavButtons.forEach(function(c,e){a.unhideElementFromScreenReaders(c.element); c.element.setAttribute("tabindex",-1);c.element.setAttribute("role","button");c.element.setAttribute("aria-label",b.langFormat("accessibility.mapZoom"+(e?"Out":"In"),{chart:b}))})},onChartRender:function(){this.updateProxyOverlays()},updateProxyOverlays:function(){var b=this,a=this.chart,c=function(a,c,f,d){b.removeElement(b[f]);b[f]=b.addProxyGroup();b[c]=b.createProxyButton(a,b[f],{"aria-label":d,tabindex:-1})};b.removeElement(b.drillUpProxyGroup);b.removeElement(b.resetZoomProxyGroup);a.resetZoomButton&& c(a.resetZoomButton,"resetZoomProxyButton","resetZoomProxyGroup",a.langFormat("accessibility.resetZoomButton",{chart:a}));a.drillUpButton&&c(a.drillUpButton,"drillUpProxyButton","drillUpProxyGroup",a.langFormat("accessibility.drillUpButton",{chart:a,buttonText:a.getDrilldownBackText()}))},getMapZoomNavigation:function(){var b=this.keyCodes,a=this.chart,c=this;return new l(a,{keyCodeMap:[[[b.up,b.down,b.left,b.right],function(c){a[c===b.up||c===b.down?"yAxis":"xAxis"][0].panStep(c===b.left||c===b.up? -1:1);return this.response.success}],[[b.tab],function(b,h){a.mapNavButtons[c.focusedMapNavButtonIx].setState(0);if(h.shiftKey&&!c.focusedMapNavButtonIx||!h.shiftKey&&c.focusedMapNavButtonIx)return a.mapZoom(),this.response[h.shiftKey?"prev":"next"];c.focusedMapNavButtonIx+=h.shiftKey?-1:1;b=a.mapNavButtons[c.focusedMapNavButtonIx];a.setFocusToElement(b.box,b.element);b.setState(2);return this.response.success}],[[b.space,b.enter],function(){c.fakeClickEvent(a.mapNavButtons[c.focusedMapNavButtonIx].element); return this.response.success}]],validate:function(){return a.mapZoom&&a.mapNavButtons&&2===a.mapNavButtons.length},init:function(b){var e=a.mapNavButtons[0],f=a.mapNavButtons[1],e=0e)return this.response[0a.types.indexOf("map")),f=a.yAxis,g=1a.types.indexOf("map")),l={};d&&(l.xAxis=a.langFormat("accessibility.axis.xAxisDescription"+ (1a?b.length+a:Math.min(a,b.length),e=0;ed?(f=b[b.length+d],void 0===f&&(f=b[0])):(f=b[d],void 0===f&&(f=b[b.length- 1]))),void 0!==f?f:""):"{"+d+"}"}var l=d.pick;d.i18nFormat=function(k,b,a){var c=function(a,b){a=a.slice(b||0);var c=a.indexOf("{"),d=a.indexOf("}");if(-1c)return{statement:a.substring(c+1,d),begin:b+c+1,end:b+d}},e=[],h,f;f=0;do h=c(k,f),f=k.substring(f,h&&h.begin-1),f.length&&e.push({value:f,type:"constant"}),h&&e.push({value:h.statement,type:"statement"}),f=h&&h.end+1;while(h);e.forEach(function(a){"statement"===a.type&&(a.value=g(a.value,b))});return d.format(e.reduce(function(a,b){return a+ b.value},""),b,a)};d.Chart.prototype.langFormat=function(g,b,a){g=g.split(".");for(var c=this.options.lang,e=0;e