highcharts
Version:
JavaScript charting framework
107 lines (104 loc) • 130 kB
JavaScript
/*
Highcharts JS v10.2.0 (2022-07-05)
Accessibility module
(c) 2010-2021 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(x){a(x);a.Highcharts=x;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function x(a,h,n,u){a.hasOwnProperty(h)||(a[h]=u.apply(null,n),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:h,module:a[h]}})))}a=a?a._modules:{};
x(a,"Accessibility/A11yI18n.js",[a["Core/FormatUtilities.js"],a["Core/Utilities.js"]],function(a,h){var n=a.format,u=h.getNestedProperty,q=h.pick,l;(function(a){function y(c,e){var d=c.indexOf("#each("),b=c.indexOf("#plural("),f=c.indexOf("["),v=c.indexOf("]");if(-1<d){v=c.slice(d).indexOf(")")+d;b=c.substring(0,d);f=c.substring(v+1);v=c.substring(d+6,v).split(",");d=Number(v[1]);c="";if(e=u(v[0],e))for(d=isNaN(d)?e.length:d,d=0>d?e.length+d:Math.min(d,e.length),v=0;v<d;++v)c+=b+e[v]+f;return c.length?
c:""}if(-1<b){f=c.slice(b).indexOf(")")+b;b=c.substring(b+8,f).split(",");switch(Number(u(b[0],e))){case 0:c=q(b[4],b[1]);break;case 1:c=q(b[2],b[1]);break;case 2:c=q(b[3],b[1]);break;default:c=b[1]}c?(e=c,e=e.trim&&e.trim()||e.replace(/^\s+|\s+$/g,"")):e="";return e}return-1<f?(b=c.substring(0,f),f=Number(c.substring(f+1,v)),c=void 0,e=u(b,e),!isNaN(f)&&e&&(0>f?(c=e[e.length+f],"undefined"===typeof c&&(c=e[0])):(c=e[f],"undefined"===typeof c&&(c=e[e.length-1]))),"undefined"!==typeof c?c:""):"{"+
c+"}"}function g(c,e,d){var b=function(b,d){b=b.slice(d||0);var f=b.indexOf("{"),c=b.indexOf("}");if(-1<f&&c>f)return{statement:b.substring(f+1,c),begin:d+f+1,end:d+c}},f=[],v=0;do{var z=b(c,v);var a=c.substring(v,z&&z.begin-1);a.length&&f.push({value:a,type:"constant"});z&&f.push({value:z.statement,type:"statement"});v=z?z.end+1:v+1}while(z);f.forEach(function(b){"statement"===b.type&&(b.value=y(b.value,e))});return n(f.reduce(function(b,d){return b+d.value},""),e,d)}function p(c,e){c=c.split(".");
for(var d=this.options.lang,b=0;b<c.length;++b)d=d&&d[c[b]];return"string"===typeof d?g(d,e,this):""}var k=[];a.compose=function(c){-1===k.indexOf(c)&&(k.push(c),c.prototype.langFormat=p);return c};a.i18nFormat=g})(l||(l={}));return l});x(a,"Accessibility/Utils/HTMLUtilities.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,h){function n(a){if("function"===typeof l.MouseEvent)return new l.MouseEvent(a.type,a);if(q.createEvent){var g=q.createEvent("MouseEvent");if(g.initMouseEvent)return g.initMouseEvent(a.type,
a.bubbles,a.cancelable,a.view||l,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget),g}return u(a.type)}function u(a,g){g=g||{x:0,y:0};if("function"===typeof l.MouseEvent)return new l.MouseEvent(a,{bubbles:!0,cancelable:!0,composed:!0,view:l,detail:"click"===a?1:0,screenX:g.x,screenY:g.y,clientX:g.x,clientY:g.y});if(q.createEvent){var y=q.createEvent("MouseEvent");if(y.initMouseEvent)return y.initMouseEvent(a,!0,!0,l,"click"===a?1:0,g.x,
g.y,g.x,g.y,!1,!1,!1,!1,0,null),y}return{type:a}}var q=a.doc,l=a.win,w=h.css;return{addClass:function(a,g){a.classList?a.classList.add(g):0>a.className.indexOf(g)&&(a.className+=" "+g)},cloneMouseEvent:n,cloneTouchEvent:function(a){var g=function(a){for(var k=[],c=0;c<a.length;++c){var e=a.item(c);e&&k.push(e)}return k};if("function"===typeof l.TouchEvent)return g=new l.TouchEvent(a.type,{touches:g(a.touches),targetTouches:g(a.targetTouches),changedTouches:g(a.changedTouches),ctrlKey:a.ctrlKey,shiftKey:a.shiftKey,
altKey:a.altKey,metaKey:a.metaKey,bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed,detail:a.detail,view:a.view}),a.defaultPrevented&&g.preventDefault(),g;g=n(a);g.touches=a.touches;g.changedTouches=a.changedTouches;g.targetTouches=a.targetTouches;return g},escapeStringForHTML:function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},getElement:function(a){return q.getElementById(a)},getFakeMouseEvent:u,
getHeadingTagNameForElement:function(a){var g=function(a){a=parseInt(a.slice(1),10);return"h"+Math.min(6,a+1)},y=function(a){var c;a:{for(c=a;c=c.previousSibling;){var e=c.tagName||"";if(/H[1-6]/.test(e)){c=e;break a}}c=""}if(c)return g(c);a=a.parentElement;if(!a)return"p";c=a.tagName;return/H[1-6]/.test(c)?g(c):y(a)};return y(a)},removeChildNodes:function(a){for(;a.lastChild;)a.removeChild(a.lastChild)},removeClass:function(a,g){a.classList?a.classList.remove(g):a.className=a.className.replace(new RegExp(g,
"g"),"")},removeElement:function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},reverseChildNodes:function(a){for(var g=a.childNodes.length;g--;)a.appendChild(a.childNodes[g])},stripHTMLTagsFromString:function(a){return"string"===typeof a?a.replace(/<\/?[^>]+(>|$)/g,""):a},visuallyHideElement:function(a){w(a,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(1px, 1px, 1px, 1px)",marginTop:"-3px","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)",
filter:"alpha(opacity=1)",opacity:.01})}}});x(a,"Accessibility/Utils/ChartUtilities.js",[a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,n){function u(b,f){var c=f.type,e=b.hcEvents;p.createEvent&&(b.dispatchEvent||b.fireEvent)?b.dispatchEvent?b.dispatchEvent(f):b.fireEvent(c,f):e&&e[c]?d(b,c,f):b.element&&u(b.element,f)}function q(b){var d=b.chart,c={},e="Seconds";c.Seconds=((b.dataMax||b.max||0)-(b.dataMin||b.min||0))/1E3;c.Minutes=c.Seconds/60;
c.Hours=c.Minutes/60;c.Days=c.Hours/24;["Minutes","Hours","Days"].forEach(function(b){2<c[b]&&(e=b)});var a=c[e].toFixed("Seconds"!==e&&"Minutes"!==e?1:0);return d.langFormat("accessibility.axis.timeRange"+e,{chart:d,axis:b,range:a.replace(".0","")})}function l(b){var d=b.chart,c=d.options,e=c&&c.accessibility&&c.accessibility.screenReaderSection.axisRangeDateFormat||"",a={min:b.dataMin||b.min||0,max:b.dataMax||b.max||0};c=function(f){return b.dateTime?d.time.dateFormat(e,a[f]):a[f].toString()};return d.langFormat("accessibility.axis.rangeFromTo",
{chart:d,axis:b,rangeFrom:c("min"),rangeTo:c("max")})}function w(b){if(b.points&&b.points.length)return(b=e(b.points,function(b){return!!b.graphic}))&&b.graphic&&b.graphic.element}function y(b){var d=w(b);return d&&d.parentNode||b.graph&&b.graph.element||b.group&&b.group.element}function g(b,d){d.setAttribute("aria-hidden",!1);d!==b.renderTo&&d.parentNode&&d.parentNode!==p.body&&(Array.prototype.forEach.call(d.parentNode.childNodes,function(b){b.hasAttribute("aria-hidden")||b.setAttribute("aria-hidden",
!0)}),g(b,d.parentNode))}var p=a.doc,k=h.stripHTMLTagsFromString,c=n.defined,e=n.find,d=n.fireEvent;return{fireEventOnWrappedOrUnwrappedElement:u,getChartTitle:function(b){return k(b.options.title.text||b.langFormat("accessibility.defaultChartTitle",{chart:b}))},getAxisDescription:function(b){return b&&(b.userOptions&&b.userOptions.accessibility&&b.userOptions.accessibility.description||b.axisTitle&&b.axisTitle.textStr||b.options.id||b.categories&&"categories"||b.dateTime&&"Time"||"values")},getAxisRangeDescription:function(b){var d=
b.options||{};return d.accessibility&&"undefined"!==typeof d.accessibility.rangeDescription?d.accessibility.rangeDescription:b.categories?(d=b.chart,b=b.dataMax&&b.dataMin?d.langFormat("accessibility.axis.rangeCategories",{chart:d,axis:b,numCategories:b.dataMax-b.dataMin+1}):"",b):!b.dateTime||0!==b.min&&0!==b.dataMin?l(b):q(b)},getPointFromXY:function(b,d,c){for(var f=b.length,a;f--;)if(a=e(b[f].points||[],function(b){return b.x===d&&b.y===c}))return a},getSeriesFirstPointElement:w,getSeriesFromName:function(b,
d){return d?(b.series||[]).filter(function(b){return b.name===d}):b.series},getSeriesA11yElement:y,unhideChartElementFromAT:g,hideSeriesFromAT:function(b){(b=y(b))&&b.setAttribute("aria-hidden",!0)},scrollToPoint:function(b){var f=b.series.xAxis,e=b.series.yAxis,a=f&&f.scrollbar?f:e;if((f=a&&a.scrollbar)&&c(f.to)&&c(f.from)){e=f.to-f.from;if(c(a.dataMin)&&c(a.dataMax)){var k=a.toPixels(a.dataMin),g=a.toPixels(a.dataMax);b=(a.toPixels(b["xAxis"===a.coll?"x":"y"]||0)-k)/(g-k)}else b=0;f.updatePosition(b-
e/2,b+e/2);d(f,"changed",{from:f.from,to:f.to,trigger:"scrollbar",DOMEvent:null})}}}});x(a,"Accessibility/Utils/DOMElementProvider.js",[a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h){var n=a.doc,u=h.removeElement;return function(){function a(){this.elements=[]}a.prototype.createElement=function(){var a=n.createElement.apply(n,arguments);this.elements.push(a);return a};a.prototype.destroyCreatedElements=function(){this.elements.forEach(function(a){u(a)});this.elements=
[]};return a}()});x(a,"Accessibility/Utils/EventProvider.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,h){var n=h.addEvent;return function(){function h(){this.eventRemovers=[]}h.prototype.addEvent=function(){var h=n.apply(a,arguments);this.eventRemovers.push(h);return h};h.prototype.removeAddedEvents=function(){this.eventRemovers.forEach(function(a){return a()});this.eventRemovers=[]};return h}()});x(a,"Accessibility/AccessibilityComponent.js",[a["Accessibility/Utils/ChartUtilities.js"],
a["Accessibility/Utils/DOMElementProvider.js"],a["Accessibility/Utils/EventProvider.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,n,u,q){var l=a.fireEventOnWrappedOrUnwrappedElement,w=u.getFakeMouseEvent;a=q.extend;u=function(){function a(){this.proxyProvider=this.keyCodes=this.eventProvider=this.domElementProvider=this.chart=void 0}a.prototype.initBase=function(a,p){this.chart=a;this.eventProvider=new n;this.domElementProvider=new h;this.proxyProvider=p;this.keyCodes=
{left:37,right:39,up:38,down:40,enter:13,space:32,esc:27,tab:9,pageUp:33,pageDown:34,end:35,home:36}};a.prototype.addEvent=function(a,p,k,c){return this.eventProvider.addEvent(a,p,k,c)};a.prototype.createElement=function(a,p){return this.domElementProvider.createElement(a,p)};a.prototype.fakeClickEvent=function(a){var g=w("click");l(a,g)};a.prototype.destroyBase=function(){this.domElementProvider.destroyCreatedElements();this.eventProvider.removeAddedEvents()};return a}();a(u.prototype,{init:function(){},
getKeyboardNavigation:function(){},onChartUpdate:function(){},onChartRender:function(){},destroy:function(){}});return u});x(a,"Accessibility/KeyboardNavigationHandler.js",[a["Core/Utilities.js"]],function(a){var h=a.find;a=function(){function a(a,h){this.chart=a;this.keyCodeMap=h.keyCodeMap||[];this.validate=h.validate;this.init=h.init;this.terminate=h.terminate;this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}a.prototype.run=function(a){var n=a.which||a.keyCode,l=this.response.noHandler,
w=h(this.keyCodeMap,function(a){return-1<a[0].indexOf(n)});w?l=w[1].call(this,n,a):9===n&&(l=this.response[a.shiftKey?"prev":"next"]);return l};return a}();"";return a});x(a,"Accessibility/Components/ContainerComponent.js",[a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,n,u,q){var l=this&&this.__extends||function(){var a=function(c,e){a=
Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var a in b)b.hasOwnProperty(a)&&(d[a]=b[a])};return a(c,e)};return function(c,e){function d(){this.constructor=c}a(c,e);c.prototype=null===e?Object.create(e):(d.prototype=e.prototype,new d)}}(),w=n.unhideChartElementFromAT,y=n.getChartTitle,g=u.doc,p=q.stripHTMLTagsFromString;return function(a){function c(){return null!==a&&a.apply(this,arguments)||this}l(c,a);c.prototype.onChartUpdate=function(){this.handleSVGTitleElement();
this.setSVGContainerLabel();this.setGraphicContainerAttrs();this.setRenderToAttrs();this.makeCreditsAccessible()};c.prototype.handleSVGTitleElement=function(){var a=this.chart,d="highcharts-title-"+a.index,b=p(a.langFormat("accessibility.svgContainerTitle",{chartTitle:y(a)}));if(b.length){var c=this.svgTitleElement=this.svgTitleElement||g.createElementNS("http://www.w3.org/2000/svg","title");c.textContent=b;c.id=d;a.renderTo.insertBefore(c,a.renderTo.firstChild)}};c.prototype.setSVGContainerLabel=
function(){var a=this.chart,d=a.langFormat("accessibility.svgContainerLabel",{chartTitle:y(a)});a.renderer.box&&d.length&&a.renderer.box.setAttribute("aria-label",d)};c.prototype.setGraphicContainerAttrs=function(){var a=this.chart,d=a.langFormat("accessibility.graphicContainerLabel",{chartTitle:y(a)});d.length&&a.container.setAttribute("aria-label",d)};c.prototype.setRenderToAttrs=function(){var a=this.chart,d="disabled"!==a.options.accessibility.landmarkVerbosity,b=a.langFormat("accessibility.chartContainerLabel",
{title:y(a),chart:a});b&&(a.renderTo.setAttribute("role",d?"region":"group"),a.renderTo.setAttribute("aria-label",b))};c.prototype.makeCreditsAccessible=function(){var a=this.chart,d=a.credits;d&&(d.textStr&&d.element.setAttribute("aria-label",a.langFormat("accessibility.credits",{creditsStr:p(d.textStr)})),w(a,d.element))};c.prototype.getKeyboardNavigation=function(){var a=this.chart;return new h(a,{keyCodeMap:[],validate:function(){return!0},init:function(){var d=a.accessibility;d&&d.keyboardNavigation.tabindexContainer.focus()}})};
c.prototype.destroy=function(){this.chart.renderTo.setAttribute("aria-hidden",!0)};return c}(a)});x(a,"Accessibility/FocusBorder.js",[a["Core/Renderer/SVG/SVGLabel.js"],a["Core/Utilities.js"]],function(a,h){var n=h.addEvent,w=h.pick,q;(function(h){function l(){var b=this.focusElement,d=this.options.accessibility.keyboardNavigation.focusBorder;b&&(b.removeFocusBorder(),d.enabled&&b.addFocusBorder(d.margin,{stroke:d.style.color,strokeWidth:d.style.lineWidth,r:d.style.borderRadius}))}function y(b,d){var a=
this.options.accessibility.keyboardNavigation.focusBorder;(d=d||b.element)&&d.focus&&(d.hcEvents&&d.hcEvents.focusin||n(d,"focusin",function(){}),d.focus(),a.hideBrowserFocusOutline&&(d.style.outline="none"));this.focusElement&&this.focusElement.removeFocusBorder();this.focusElement=b;this.renderFocusBorder()}function g(b){if(!b.focusBorderDestroyHook){var d=b.destroy;b.destroy=function(){b.focusBorder&&b.focusBorder.destroy&&b.focusBorder.destroy();return d.apply(b,arguments)};b.focusBorderDestroyHook=
d}}function p(b,d){this.focusBorder&&this.removeFocusBorder();var c=this.getBBox(),f=w(b,3),e=this.parentGroup,v=this.scaleX||e&&e.scaleX,p=this.scaleY||e&&e.scaleY;v=(v?!p:p)?Math.abs(v||p||1):(Math.abs(v||1)+Math.abs(p||1))/2;c.x+=this.translateX?this.translateX:0;c.y+=this.translateY?this.translateY:0;p=c.x-f;var h=c.y-f,B=c.width+2*f,C=c.height+2*f,D=this instanceof a;if("text"===this.element.nodeName||D){var H=!!this.rotation;if(D)var t={x:H?1:0,y:0};else{var m=t=0;"middle"===this.attr("text-anchor")?
t=m=.5:this.rotation?t=.25:m=.75;t={x:t,y:m}}m=+this.attr("x");var r=+this.attr("y");isNaN(m)||(p=m-c.width*t.x-f);isNaN(r)||(h=r-c.height*t.y-f);D&&H&&(D=B,B=C,C=D,isNaN(m)||(p=m-c.height*t.x-f),isNaN(r)||(h=r-c.width*t.y-f))}this.focusBorder=this.renderer.rect(p,h,B,C,parseInt((d&&d.r||0).toString(),10)/v).addClass("highcharts-focus-border").attr({zIndex:99}).add(e);this.renderer.styledMode||this.focusBorder.attr({stroke:d&&d.stroke,"stroke-width":(d&&d.strokeWidth||0)/v});k(this,b,d);g(this)}function k(d){for(var a=
[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];d.focusBorderUpdateHooks||(d.focusBorderUpdateHooks={},b.forEach(function(b){b+="Setter";var c=d[b]||d._defaultSetter;d.focusBorderUpdateHooks[b]=c;d[b]=function(){var b=c.apply(d,arguments);d.addFocusBorder.apply(d,a);return b}}))}function c(){e(this);this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook);this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}function e(b){b.focusBorderUpdateHooks&&
(Object.keys(b.focusBorderUpdateHooks).forEach(function(d){var a=b.focusBorderUpdateHooks[d];a===b._defaultSetter?delete b[d]:b[d]=a}),delete b.focusBorderUpdateHooks)}var d=[],b="x y transform width height r d stroke-width".split(" ");h.compose=function(b,a){-1===d.indexOf(b)&&(d.push(b),b=b.prototype,b.renderFocusBorder=l,b.setFocusToElement=y);-1===d.indexOf(a)&&(d.push(a),a=a.prototype,a.addFocusBorder=p,a.removeFocusBorder=c)}})(q||(q={}));return q});x(a,"Accessibility/Utils/Announcer.js",[a["Core/Renderer/HTML/AST.js"],
a["Accessibility/Utils/DOMElementProvider.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,n,u,q){var l=n.doc,w=u.addClass,y=u.visuallyHideElement,g=q.attr;return function(){function p(a,c){this.chart=a;this.domElementProvider=new h;this.announceRegion=this.addAnnounceRegion(c)}p.prototype.destroy=function(){this.domElementProvider.destroyCreatedElements()};p.prototype.announce=function(k){var c=this;a.setElementHTML(this.announceRegion,k);this.clearAnnouncementRegionTimer&&
clearTimeout(this.clearAnnouncementRegionTimer);this.clearAnnouncementRegionTimer=setTimeout(function(){c.announceRegion.innerHTML=a.emptyHTML;delete c.clearAnnouncementRegionTimer},1E3)};p.prototype.addAnnounceRegion=function(a){var c=this.chart.announcerContainer||this.createAnnouncerContainer(),e=this.domElementProvider.createElement("div");g(e,{"aria-hidden":!1,"aria-live":a});this.chart.styledMode?w(e,"highcharts-visually-hidden"):y(e);c.appendChild(e);return e};p.prototype.createAnnouncerContainer=
function(){var a=this.chart,c=l.createElement("div");g(c,{"aria-hidden":!1,"class":"highcharts-announcer-container"});c.style.position="relative";a.renderTo.insertBefore(c,a.renderTo.firstChild);return a.announcerContainer=c};return p}()});x(a,"Accessibility/Components/AnnotationsA11y.js",[a["Accessibility/Utils/HTMLUtilities.js"]],function(a){function h(a){return(a.annotations||[]).reduce(function(a,p){p.options&&!1!==p.options.visible&&(a=a.concat(p.labels));return a},[])}function n(a){return a.options&&
a.options.accessibility&&a.options.accessibility.description||a.graphic&&a.graphic.text&&a.graphic.text.textStr||""}function w(a){var g=a.options&&a.options.accessibility&&a.options.accessibility.description;if(g)return g;g=a.chart;var p=n(a),k=a.points.filter(function(d){return!!d.graphic}).map(function(d){var b=d.accessibility&&d.accessibility.valueDescription||d.graphic&&d.graphic.element&&d.graphic.element.getAttribute("aria-label")||"";d=d&&d.series.name||"";return(d?d+", ":"")+"data point "+
b}).filter(function(d){return!!d}),c=k.length,e="accessibility.screenReaderSection.annotations.description"+(1<c?"MultiplePoints":c?"SinglePoint":"NoPoints");a={annotationText:p,annotation:a,numPoints:c,annotationPoint:k[0],additionalAnnotationPoints:k.slice(1)};return g.langFormat(e,a)}function q(a){return h(a).map(function(a){return(a=l(G(w(a))))?"<li>".concat(a,"</li>"):""})}var l=a.escapeStringForHTML,G=a.stripHTMLTagsFromString;return{getAnnotationsInfoHTML:function(a){var g=a.annotations;if(!g||
!g.length)return"";a=q(a);return'<ul style="list-style-type: none">'.concat(a.join(" "),"</ul>")},getAnnotationLabelDescription:w,getAnnotationListItems:q,getPointAnnotationTexts:function(a){var g=h(a.series.chart).filter(function(g){return-1<g.points.indexOf(a)});return g.length?g.map(function(a){return"".concat(n(a))}):[]}}});x(a,"Accessibility/Components/InfoRegionsComponent.js",[a["Accessibility/A11yI18n.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/Utils/Announcer.js"],a["Accessibility/Components/AnnotationsA11y.js"],
a["Core/Renderer/HTML/AST.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/FormatUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,n,u,q,l,G,y,g,p){function k(b,a){var d=a[0],r=b.series&&b.series[0]||{};r={numSeries:b.series.length,numPoints:r.points&&r.points.length,chart:b,mapTitle:b.mapView&&b.mapView.geoMap&&b.mapView.geoMap.title};if(!d)return b.langFormat("accessibility.chartTypes.emptyChart",r);if("map"===d)return r.mapTitle?
b.langFormat("accessibility.chartTypes.mapTypeDescription",r):b.langFormat("accessibility.chartTypes.unknownMap",r);if(1<b.types.length)return b.langFormat("accessibility.chartTypes.combinationChart",r);a=a[0];d=b.langFormat("accessibility.seriesTypeDescriptions."+a,r);var c=b.series&&2>b.series.length?"Single":"Multiple";return(b.langFormat("accessibility.chartTypes."+a+c,r)||b.langFormat("accessibility.chartTypes.default"+c,r))+(d?" "+d:"")}var c=this&&this.__extends||function(){var b=function(a,
d){b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d])};return b(a,d)};return function(a,d){function r(){this.constructor=a}b(a,d);a.prototype=null===d?Object.create(d):(r.prototype=d.prototype,new r)}}(),e=u.getAnnotationsInfoHTML,d=l.getAxisDescription,b=l.getAxisRangeDescription,f=l.getChartTitle,v=l.unhideChartElementFromAT,z=G.format,L=y.doc,w=g.addClass,x=g.getElement,A=g.getHeadingTagNameForElement,
E=g.stripHTMLTagsFromString,B=g.visuallyHideElement,C=p.attr,D=p.pick;return function(g){function t(){var b=null!==g&&g.apply(this,arguments)||this;b.announcer=void 0;b.screenReaderSections={};return b}c(t,g);t.prototype.init=function(){var b=this.chart,a=this;this.initRegionsDefinitions();this.addEvent(b,"aftergetTableAST",function(b){a.onDataTableCreated(b)});this.addEvent(b,"afterViewData",function(b){a.dataTableDiv=b;setTimeout(function(){a.focusDataTable()},300)});this.announcer=new n(b,"assertive")};
t.prototype.initRegionsDefinitions=function(){var b=this;this.screenReaderSections={before:{element:null,buildContent:function(a){var d=a.options.accessibility.screenReaderSection.beforeChartFormatter;return d?d(a):b.defaultBeforeChartFormatter(a)},insertIntoDOM:function(b,a){a.renderTo.insertBefore(b,a.renderTo.firstChild)},afterInserted:function(){"undefined"!==typeof b.sonifyButtonId&&b.initSonifyButton(b.sonifyButtonId);"undefined"!==typeof b.dataTableButtonId&&b.initDataTableButton(b.dataTableButtonId)}},
after:{element:null,buildContent:function(a){var d=a.options.accessibility.screenReaderSection.afterChartFormatter;return d?d(a):b.defaultAfterChartFormatter()},insertIntoDOM:function(b,a){a.renderTo.insertBefore(b,a.container.nextSibling)},afterInserted:function(){b.chart.accessibility&&b.chart.accessibility.keyboardNavigation.updateExitAnchor()}}}};t.prototype.onChartRender=function(){var b=this;this.linkedDescriptionElement=this.getLinkedDescriptionElement();this.setLinkedDescriptionAttrs();Object.keys(this.screenReaderSections).forEach(function(a){b.updateScreenReaderSection(a)})};
t.prototype.getLinkedDescriptionElement=function(){var b=this.chart.options.accessibility.linkedDescription;if(b){if("string"!==typeof b)return b;b=z(b,this.chart);b=L.querySelectorAll(b);if(1===b.length)return b[0]}};t.prototype.setLinkedDescriptionAttrs=function(){var b=this.linkedDescriptionElement;b&&(b.setAttribute("aria-hidden","true"),w(b,"highcharts-linked-description"))};t.prototype.updateScreenReaderSection=function(b){var a=this.chart,d=this.screenReaderSections[b],c=d.buildContent(a),
m=d.element=d.element||this.createElement("div"),f=m.firstChild||this.createElement("div");c?(this.setScreenReaderSectionAttribs(m,b),q.setElementHTML(f,c),m.appendChild(f),d.insertIntoDOM(m,a),a.styledMode?w(f,"highcharts-visually-hidden"):B(f),v(a,f),d.afterInserted&&d.afterInserted()):(m.parentNode&&m.parentNode.removeChild(m),d.element=null)};t.prototype.setScreenReaderSectionAttribs=function(b,a){var d=this.chart,c=d.langFormat("accessibility.screenReaderSection."+a+"RegionLabel",{chart:d,chartTitle:f(d)});
a="highcharts-screen-reader-region-".concat(a,"-").concat(d.index);C(b,{id:a,"aria-label":c||void 0});b.style.position="relative";c&&b.setAttribute("role","all"===d.options.accessibility.landmarkVerbosity?"region":"group")};t.prototype.defaultBeforeChartFormatter=function(){var b=this.chart,d=b.options.accessibility.screenReaderSection.beforeChartFormat;if(!d)return"";var c=this.getAxesDescription(),M=b.sonify&&b.options.sonification&&b.options.sonification.enabled,I="highcharts-a11y-sonify-data-btn-"+
b.index,v="hc-linkto-highcharts-data-table-"+b.index,t=e(b),C=b.langFormat("accessibility.screenReaderSection.annotations.heading",{chart:b});c={headingTagName:A(b.renderTo),chartTitle:f(b),typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:c.xAxis,yAxisDescription:c.yAxis,playAsSoundButton:M?this.getSonifyButtonText(I):"",viewTableButton:b.getCSV?this.getDataTableButtonText(v):"",annotationsTitle:t?C:"",annotationsList:t};
b=a.i18nFormat(d,c,b);this.dataTableButtonId=v;this.sonifyButtonId=I;return b.replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")};t.prototype.defaultAfterChartFormatter=function(){var b=this.chart,d=b.options.accessibility.screenReaderSection.afterChartFormat;if(!d)return"";var c={endOfChartMarker:this.getEndOfChartMarkerText()};return a.i18nFormat(d,c,b).replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")};t.prototype.getLinkedDescription=function(){var b=this.linkedDescriptionElement;return E(b&&b.innerHTML||"")};t.prototype.getLongdescText=
function(){var b=this.chart.options,a=b.caption;a=a&&a.text;var d=this.getLinkedDescription();return b.accessibility.description||d||a||""};t.prototype.getTypeDescriptionText=function(){var b=this.chart;return b.types?b.options.accessibility.typeDescription||k(b,b.types):""};t.prototype.getDataTableButtonText=function(b){var a=this.chart;a=a.langFormat("accessibility.table.viewAsDataTableButtonText",{chart:a,chartTitle:f(a)});return'<button id="'+b+'">'+a+"</button>"};t.prototype.getSonifyButtonText=
function(b){var a=this.chart;if(a.options.sonification&&!1===a.options.sonification.enabled)return"";a=a.langFormat("accessibility.sonification.playAsSoundButtonText",{chart:a,chartTitle:f(a)});return'<button id="'+b+'">'+a+"</button>"};t.prototype.getSubtitleText=function(){var b=this.chart.options.subtitle;return E(b&&b.text||"")};t.prototype.getEndOfChartMarkerText=function(){var b=this.chart,a=b.langFormat("accessibility.screenReaderSection.endOfChartMarker",{chart:b});return'<div id="highcharts-end-of-chart-marker-'+
b.index+'">'+a+"</div>"};t.prototype.onDataTableCreated=function(b){var a=this.chart;if(a.options.accessibility.enabled){this.viewDataTableButton&&this.viewDataTableButton.setAttribute("aria-expanded","true");var d=b.tree.attributes||{};d.tabindex=-1;d.summary=a.langFormat("accessibility.table.tableSummary",{chart:a});b.tree.attributes=d}};t.prototype.focusDataTable=function(){var b=this.dataTableDiv;(b=b&&b.getElementsByTagName("table")[0])&&b.focus&&b.focus()};t.prototype.initSonifyButton=function(b){var a=
this,d=this.sonifyButton=x(b),c=this.chart,f=function(b){d&&(d.setAttribute("aria-hidden","true"),d.setAttribute("aria-label",""));b.preventDefault();b.stopPropagation();b=c.langFormat("accessibility.sonification.playAsSoundClickAnnouncement",{chart:c});a.announcer.announce(b);setTimeout(function(){d&&(d.removeAttribute("aria-hidden"),d.removeAttribute("aria-label"));c.sonify&&c.sonify()},1E3)};d&&c&&(d.setAttribute("tabindex",-1),d.onclick=function(b){(c.options.accessibility&&c.options.accessibility.screenReaderSection.onPlayAsSoundClick||
f).call(this,b,c)})};t.prototype.initDataTableButton=function(b){var a=this.viewDataTableButton=x(b),d=this.chart;b=b.replace("hc-linkto-","");a&&(C(a,{tabindex:-1,"aria-expanded":!!x(b)}),a.onclick=d.options.accessibility.screenReaderSection.onViewDataTableClick||function(){d.viewData()})};t.prototype.getAxesDescription=function(){var b=this.chart,a=function(a,d){a=b[a];return 1<a.length||a[0]&&D(a[0].options.accessibility&&a[0].options.accessibility.enabled,d)},d=!!b.types&&0>b.types.indexOf("map")&&
0>b.types.indexOf("treemap")&&0>b.types.indexOf("tilemap"),c=!!b.hasCartesianSeries,f=a("xAxis",!b.angular&&c&&d);a=a("yAxis",c&&d);d={};f&&(d.xAxis=this.getAxisDescriptionText("xAxis"));a&&(d.yAxis=this.getAxisDescriptionText("yAxis"));return d};t.prototype.getAxisDescriptionText=function(a){var c=this.chart,f=c[a];return c.langFormat("accessibility.axis."+a+"Description"+(1<f.length?"Plural":"Singular"),{chart:c,names:f.map(function(b){return d(b)}),ranges:f.map(function(a){return b(a)}),numAxes:f.length})};
t.prototype.destroy=function(){this.announcer&&this.announcer.destroy()};return t}(h)});x(a,"Accessibility/Components/MenuComponent.js",[a["Core/Chart/Chart.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,n,u,q,l){var w=this&&this.__extends||function(){var a=function(c,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&
function(b,a){b.__proto__=a}||function(b,a){for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d])};return a(c,d)};return function(c,d){function b(){this.constructor=c}a(c,d);c.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}(),y=h.attr,g=q.getChartTitle,p=q.unhideChartElementFromAT,k=l.getFakeMouseEvent;h=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}w(c,a);c.prototype.init=function(){var a=this.chart,b=this;this.addEvent(a,"exportMenuShown",function(){b.onMenuShown()});
this.addEvent(a,"exportMenuHidden",function(){b.onMenuHidden()});this.createProxyGroup()};c.prototype.onMenuHidden=function(){var a=this.chart.exportContextMenu;a&&a.setAttribute("aria-hidden","true");this.setExportButtonExpandedState("false")};c.prototype.onMenuShown=function(){var a=this.chart,b=a.exportContextMenu;b&&(this.addAccessibleContextMenuAttribs(),p(a,b));this.setExportButtonExpandedState("true")};c.prototype.setExportButtonExpandedState=function(a){this.exportButtonProxy&&this.exportButtonProxy.buttonElement.setAttribute("aria-expanded",
a)};c.prototype.onChartRender=function(){var a=this.chart,b=a.focusElement,c=a.accessibility;this.proxyProvider.clearGroup("chartMenu");this.proxyMenuButton();this.exportButtonProxy&&b&&b===a.exportingGroup&&(b.focusBorder?a.setFocusToElement(b,this.exportButtonProxy.buttonElement):c&&c.keyboardNavigation.tabindexContainer.focus())};c.prototype.proxyMenuButton=function(){var a=this.chart,b=this.proxyProvider,c=a.exportSVGElements&&a.exportSVGElements[0],e=a.options.exporting,k=a.exportSVGElements&&
a.exportSVGElements[0];e&&!1!==e.enabled&&e.accessibility&&e.accessibility.enabled&&k&&k.element&&c&&(this.exportButtonProxy=b.addProxyElement("chartMenu",{click:c},{"aria-label":a.langFormat("accessibility.exporting.menuButtonLabel",{chart:a,chartTitle:g(a)}),"aria-expanded":!1,title:a.options.lang.contextButtonTitle||null}))};c.prototype.createProxyGroup=function(){this.chart&&this.proxyProvider&&this.proxyProvider.addGroup("chartMenu","div")};c.prototype.addAccessibleContextMenuAttribs=function(){var a=
this.chart,b=a.exportDivElements;b&&b.length&&(b.forEach(function(b){b&&("LI"!==b.tagName||b.children&&b.children.length?b.setAttribute("aria-hidden","true"):b.setAttribute("tabindex",-1))}),(b=b[0]&&b[0].parentNode)&&y(b,{"aria-hidden":void 0,"aria-label":a.langFormat("accessibility.exporting.chartMenuLabel",{chart:a}),role:"list"}))};c.prototype.getKeyboardNavigation=function(){var a=this.keyCodes,b=this.chart,c=this;return new u(b,{keyCodeMap:[[[a.left,a.up],function(){return c.onKbdPrevious(this)}],
[[a.right,a.down],function(){return c.onKbdNext(this)}],[[a.enter,a.space],function(){return c.onKbdClick(this)}]],validate:function(){return!!b.exporting&&!1!==b.options.exporting.enabled&&!1!==b.options.exporting.accessibility.enabled},init:function(){var a=c.exportButtonProxy,d=c.chart.exportingGroup;a&&d&&b.setFocusToElement(d,a.buttonElement)},terminate:function(){b.hideExportMenu()}})};c.prototype.onKbdPrevious=function(a){var b=this.chart,d=b.options.accessibility;a=a.response;for(var c=b.highlightedExportItemIx||
0;c--;)if(b.highlightExportItem(c))return a.success;return d.keyboardNavigation.wrapAround?(b.highlightLastExportItem(),a.success):a.prev};c.prototype.onKbdNext=function(a){var b=this.chart,d=b.options.accessibility;a=a.response;for(var c=(b.highlightedExportItemIx||0)+1;c<b.exportDivElements.length;++c)if(b.highlightExportItem(c))return a.success;return d.keyboardNavigation.wrapAround?(b.highlightExportItem(0),a.success):a.next};c.prototype.onKbdClick=function(a){var b=this.chart,d=b.exportDivElements[b.highlightedExportItemIx],
c=(b.exportSVGElements&&b.exportSVGElements[0]).element;b.openMenu?this.fakeClickEvent(d):(this.fakeClickEvent(c),b.highlightExportItem(0));return a.response.success};return c}(n);(function(c){function e(){var a=this.exportSVGElements&&this.exportSVGElements[0];if(a&&(a=a.element,a.onclick))a.onclick(k("click"))}function d(){var a=this.exportDivElements;a&&this.exportContextMenu&&this.openMenu&&(a.forEach(function(a){if(a&&"highcharts-menu-item"===a.className&&a.onmouseout)a.onmouseout(k("mouseout"))}),
this.highlightedExportItemIx=0,this.exportContextMenu.hideMenu(),this.container.focus())}function b(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItemIx];if(b&&"LI"===b.tagName&&(!b.children||!b.children.length)){var c=!!(this.renderTo.getElementsByTagName("g")[0]||{}).focus;b.focus&&c&&b.focus();if(d&&d.onmouseout)d.onmouseout(k("mouseout"));if(b.onmouseover)b.onmouseover(k("mouseover"));this.highlightedExportItemIx=
a;return!0}return!1}function f(){if(this.exportDivElements)for(var a=this.exportDivElements.length;a--;)if(this.highlightExportItem(a))return!0;return!1}var v=[];c.compose=function(c){-1===v.indexOf(c)&&(v.push(c),c=a.prototype,c.hideExportMenu=d,c.highlightExportItem=b,c.highlightLastExportItem=f,c.showExportMenu=e)}})(h||(h={}));return h});x(a,"Accessibility/KeyboardNavigation.js",[a["Core/Globals.js"],a["Accessibility/Components/MenuComponent.js"],a["Core/Utilities.js"],a["Accessibility/Utils/EventProvider.js"],
a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,n,u,q){var l=a.doc,w=a.win,y=n.addEvent,g=n.fireEvent,p=q.getElement;n=function(){function a(a,e){this.components=this.chart=void 0;this.currentModuleIx=NaN;this.exitAnchor=this.eventProvider=void 0;this.modules=[];this.tabindexContainer=void 0;this.init(a,e)}a.prototype.init=function(a,e){var d=this,b=this.eventProvider=new u;this.chart=a;this.components=e;this.modules=[];this.currentModuleIx=0;this.update();b.addEvent(this.tabindexContainer,
"keydown",function(a){return d.onKeydown(a)});b.addEvent(this.tabindexContainer,"focus",function(a){return d.onFocus(a)});["mouseup","touchend"].forEach(function(a){return b.addEvent(l,a,function(){return d.onMouseUp()})});["mousedown","touchstart"].forEach(function(c){return b.addEvent(a.renderTo,c,function(){d.isClickingChart=!0})});b.addEvent(a.renderTo,"mouseover",function(){d.pointerIsOverChart=!0});b.addEvent(a.renderTo,"mouseout",function(){d.pointerIsOverChart=!1})};a.prototype.update=function(a){var c=
this.chart.options.accessibility;c=c&&c.keyboardNavigation;var d=this.components;this.updateContainerTabindex();c&&c.enabled&&a&&a.length?(this.modules=a.reduce(function(a,c){c=d[c].getKeyboardNavigation();return a.concat(c)},[]),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())};a.prototype.updateExitAnchor=function(){var a="highcharts-end-of-chart-marker-".concat(this.chart.index);a=p(a);this.removeExitAnchor();a?(this.makeElementAnExitAnchor(a),this.exitAnchor=
a):this.createExitAnchor()};a.prototype.move=function(a){var c=this.modules&&this.modules[this.currentModuleIx];c&&c.terminate&&c.terminate(a);this.chart.focusElement&&this.chart.focusElement.removeFocusBorder();this.currentModuleIx+=a;if(c=this.modules&&this.modules[this.currentModuleIx]){if(c.validate&&!c.validate())return this.move(a);if(c.init)return c.init(a),!0}this.currentModuleIx=0;this.exiting=!0;0<a?this.exitAnchor&&this.exitAnchor.focus():this.tabindexContainer.focus();return!1};a.prototype.onFocus=
function(a){var c=this.chart;a=a.relatedTarget&&c.container.contains(a.relatedTarget);this.exiting||this.tabbingInBackwards||this.isClickingChart||a||(a=this.getFirstValidModuleIx(),null!==a&&(this.currentModuleIx=a,this.modules[a].init(1)));this.exiting=!1};a.prototype.onMouseUp=function(){delete this.isClickingChart;if(!this.keyboardReset){var a=this.chart;if(!this.pointerIsOverChart){var e=this.modules&&this.modules[this.currentModuleIx||0];e&&e.terminate&&e.terminate();this.currentModuleIx=0}a.focusElement&&
(a.focusElement.removeFocusBorder(),delete a.focusElement);this.keyboardReset=!0}};a.prototype.onKeydown=function(a){a=a||w.event;var c=this.modules&&this.modules.length&&this.modules[this.currentModuleIx],d;this.exiting=this.keyboardReset=!1;if(c){var b=c.run(a);b===c.response.success?d=!0:b===c.response.prev?d=this.move(-1):b===c.response.next&&(d=this.move(1));d&&(a.preventDefault(),a.stopPropagation())}};a.prototype.updateContainerTabindex=function(){var a=this.chart.options.accessibility;a=a&&
a.keyboardNavigation;a=!(a&&!1===a.enabled);var e=this.chart,d=e.container;e.renderTo.hasAttribute("tabindex")&&(d.removeAttribute("tabindex"),d=e.renderTo);this.tabindexContainer=d;var b=d.getAttribute("tabindex");a&&!b?d.setAttribute("tabindex","0"):a||e.container.removeAttribute("tabindex")};a.prototype.createExitAnchor=function(){var a=this.chart,e=this.exitAnchor=l.createElement("div");a.renderTo.appendChild(e);this.makeElementAnExitAnchor(e)};a.prototype.makeElementAnExitAnchor=function(a){var c=
this.tabindexContainer.getAttribute("tabindex")||0;a.setAttribute("class","highcharts-exit-anchor");a.setAttribute("tabindex",c);a.setAttribute("aria-hidden",!1);this.addExitAnchorEventsToEl(a)};a.prototype.removeExitAnchor=function(){this.exitAnchor&&this.exitAnchor.parentNode&&(this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor)};a.prototype.addExitAnchorEventsToEl=function(a){var c=this.chart,d=this;this.eventProvider.addEvent(a,"focus",function(a){a=a||w.event;var b=
!(a.relatedTarget&&c.container.contains(a.relatedTarget)||d.exiting);c.focusElement&&delete c.focusElement;b?(d.tabbingInBackwards=!0,d.tabindexContainer.focus(),delete d.tabbingInBackwards,a.preventDefault(),d.modules&&d.modules.length&&(d.currentModuleIx=d.modules.length-1,(a=d.modules[d.currentModuleIx])&&a.validate&&!a.validate()?d.move(-1):a&&a.init(-1))):d.exiting=!1})};a.prototype.getFirstValidModuleIx=function(){for(var a=this.modules.length,e=0;e<a;++e){var d=this.modules[e];if(!d.validate||
d.validate())return e}return null};a.prototype.destroy=function(){this.removeExitAnchor();this.eventProvider.removeAddedEvents();this.chart.container.removeAttribute("tabindex")};return a}();(function(k){function c(){var a=this;g(this,"dismissPopupContent",{},function(){a.tooltip&&a.tooltip.hide(0);a.hideExportMenu()})}function e(b){27===(b.which||b.keyCode)&&a.charts&&a.charts.forEach(function(a){a&&a.dismissPopupContent&&a.dismissPopupContent()})}var d=[];k.compose=function(a){h.compose(a);-1===
d.indexOf(a)&&(d.push(a),a.prototype.dismissPopupContent=c);-1===d.indexOf(l)&&(d.push(l),y(l,"keydown",e));return a}})(n||(n={}));return n});x(a,"Accessibility/Components/LegendComponent.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Globals.js"],a["Core/Legend/Legend.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,n,u,
q,l,G,y){function g(a){var b=a.legend&&a.legend.allItems,d=a.options.legend.accessibility||{};return!(!b||!b.length||a.colorAxis&&a.colorAxis.length||!1===d.enabled)}function p(a,d){d.setState(a?"hover":"",!0);["legendGroup","legendItem","legendSymbol"].forEach(function(c){(c=(c=d[c])&&c.element||c)&&b(c,a?"mouseover":"mouseout")})}var k=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&
(a[d]=b[d])};return a(b,d)};return function(b,d){function c(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)}}(),c=a.animObject,e=h.doc,d=u.addEvent,b=u.fireEvent,f=u.isNumber,v=u.pick,z=u.syncTimeout,w=G.getChartTitle,x=y.stripHTMLTagsFromString,F=y.addClass,A=y.removeClass;a=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;b.highlightedLegendItemIx=NaN;b.proxyGroup=null;return b}k(b,a);b.prototype.init=function(){var a=this;
this.recreateProxies();this.addEvent(n,"afterScroll",function(){this.chart===a.chart&&(a.proxyProvider.updateGroupProxyElementPositions("legend"),a.updateLegendItemProxyVisibility(),-1<a.highlightedLegendItemIx&&this.chart.highlightLegendItem(a.highlightedLegendItemIx))});this.addEvent(n,"afterPositionItem",function(b){this.chart===a.chart&&this.chart.renderer&&a.updateProxyPositionForItem(b.item)});this.addEvent(n,"afterRender",function(){this.chart===a.chart&&this.chart.renderer&&a.recreateProxies()&&
z(function(){return a.proxyProvider.updateGroupProxyElementPositions("legend")},c(v(this.chart.renderer.globalAnimation,!0)).duration)})};b.prototype.updateLegendItemProxyVisibility=function(){var a=this.chart,b=a.legend,d=b.currentPage||1,c=b.clipHeight||0;(b.allItems||[]).forEach(function(f){if(f.a11yProxyElement){var r=f.a11yProxyElement.element,e=!1;if(b.pages&&b.pages.length){e=f.pageIx||0;var m=f._legendItemPos?f._legendItemPos[1]:0;f=f.legendItem?Math.round(f.legendItem.getBBox().height):0;
e=m+f-b.pages[e]>c||e!==d-1}e?a.styledMode?F(r,"highcharts-a11y-invisible"):r.style.visibility="hidden":(A(r,"highcharts-a11y-invisible"),r.style.visibility="")}})};b.prototype.onChartRender=function(){g(this.chart)||this.removeProxies()};b.prototype.highlightAdjacentLegendPage=function(a){var b=this.chart,d=b.legend;a=(d.currentPage||1)+a;var c=d.pages||[];if(0<a&&a<=c.length){c=d.allItems.length;for(var f=0;f<c;++f)if(d.allItems[f].pageIx+1===a){b.highlightLegendItem(f)&&(this.highlightedLegendItemIx=
f);break}}};b.prototype.updateProxyPositionForItem=function(a){a.a11yProxyElement&&a.a11yProxyElement.refreshPosition()};b.prototype.recreateProxies=function(){var a=e.activeElement,b=this.proxyGroup;a=a&&b&&b.contains(a);this.removeProxies();return g(this.chart)?(this.addLegendProxyGroup(),this.proxyLegendItems(),this.updateLegendItemProxyVisibility(),this.updateLegendTitle(),a&&this.chart.highlightLegendItem(this.highlightedLegendItemIx),!0):!1};b.prototype.removeProxies=function(){this.proxyProvider.removeGroup("legend")};
b.prototype.updateLegendTitle=function(){var a=this.chart,b=x((a.legend&&a.legend.options.title&&a.legend.options.title.text||"").replace(/<br ?\/?>/g," "));a=a.langFormat("accessibility.legend.legendLabel"+(b?"":"NoTitle"),{chart:a,legendTitle:b,chartTitle:w(a)});this.proxyProvider.updateGroupAttrs("legend",{"aria-label":a})};b.prototype.addLegendProxyGroup=function(){this.proxyGroup=this.proxyProvider.addGroup("legend","ul",{"aria-label":"_placeholder_",role:"all"===this.chart.options.accessibility.landmarkVerbosity?
"region":null})};b.prototype.proxyLegendItems=function(){var a=this;(this.chart.legend&&this.chart.legend.allItems||[]).forEach(function(b){b.legendItem&&b.legendItem.element&&a.proxyLegendItem(b)})};b.prototype.proxyLegendItem=function(a){if(a.legendItem&&a.legendGroup){var b=this.chart.langFormat("accessibility.legend.legendItem",{chart:this.chart,itemName:x(a.name),item:a});a.a11yProxyElement=this.proxyProvider.addProxyElement("legend",{click:a.legendItem,visual:(a.legendGroup.div?a.legendItem:
a.legendGroup).element},{tabindex:-1,"aria-pressed":a.visible,"aria-label":b})}};b.prototype.getKeyboardNavigation=function(){var a=this.keyCodes,b=this,d=this.chart;return new l(d,{keyCodeMap:[[[a.left,a.right,a.up,a.down],function(a){return b.onKbdArrowKey(this,a)}],[[a.enter,a.space],function(d){return h.isFirefox&&d===a.space?this.response.success:b.onKbdClick(this)}],[[a.pageDown,a.pageUp],function(d){b.highlightAdjacentLegendPage(d===a.pageDown?1:-1);return this.response.success}]],validate:function(){return b.shouldHaveLegendNavigation()},
init:function(){d.highlightLegendItem(0);b.highlightedLegendItemIx=0},terminate:function(){b.highlightedLegendItemIx=-1;d.legend.allItems.forEach(function(a){return p(!1,a)})}})};b.prototype.onKbdArrowKey=function(a,b){var d=this.keyCodes,c=a.response,f=this.chart,r=f.options.accessibility,e=f.legend.allItems.length;b=b===d.left||b===d.up?-1:1;if(f.highlightLegendItem(this.highlightedLegendItemIx+b))return this.highlightedLegendItemIx+=b,c.success;1<e&&r.keyboardNavigation.wrapAround&&a.init(b);return c.success};
b.prototype.onKbdClick=function(a){var b=this.chart.legend.allItems[this.highlightedLegendItemIx];b&&b.a11yProxyElement&&b.a11yProxyElement.click();return a.response.success};b.prototype.shouldHaveLegendNavigation=function(){var a=this.chart,b=a.colorAxis&&a.colorAxis.length,d=(a.options.legend||{}).accessibility||{};return!!(a.legend&&a.legend.allItems&&a.legend.display&&!b&&d.enabled&&d.keyboardNavigation&&d.keyboardNavigation.enabled)};return b}(q);(function(a){function b(a){var b=this.legend.allItems,
d=this.accessibility&&this.accessibility.components.legend.highlightedLegendItemIx,c=b[a];return c?(f(d)&&b[d]&&p(!1,b[d]),b=this.legend,a=b.allItems[a].pageIx,d=b.currentPage,"undefined"!==typeof a&&a+1!==d&&b.scroll(1+a-d),a=c.legendItem,b=c.a11yProxyElement&&c.a11yProxyElement.buttonElement,a&&a.element&&b&&this.setFocusToElement(a,b),p(!0,c),!0):!1}function c(a){var b=a.item;this.chart.options.accessibility.enabled&&b&&b.a11yProxyElement&&b.a11yProxyElement.buttonElement.setAttribute("aria-pressed",
a.visible?"true":"false")}var e=[];a.compose=function(a,f){-1===e.indexOf(a)&&(e.push(a),a.prototype.highlightLegendItem=b);-1===e.indexOf(f)&&(e.push(f),d(f,"afterColorizeItem",c))}})(a||(a={}));return a});x(a,"Accessibility/Components/SeriesComponent/SeriesDescriber.js",[a["Accessibility/Components/AnnotationsA11y.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/FormatUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,n,u,q){function l(a){var b=
a.index;return a.series&&a.series.data&&m(b)?D(a.series.data,function(a){return!!(a&&"undefined"!==typeof a.index&&a.index>b&&a.graphic&&a.graphic.element)})||null:null}function w(a){var b=a.chart.options.accessibility.series.pointDescriptionEnabledThreshold;return!!(!1!==b&&a.points&&a.points.length>=b)}function y(a){var b=a.options.accessibility||{};return!w(a)&&!b.exposeAsGroupOnly}function g(a){var b=a.chart.options.accessibility.keyboardNavigation.seriesNavigation;return!(!a.points||!(a.points.length<
b.pointNavigationEnabledThreshold||!1===b.pointNavigationEnabledThreshold))}function p(a,b){var d=a.series,c=d.chart;a=c.options.accessibility.point||{};var f=d.options.accessibility&&d.options.accessibility.point||{};d=d.tooltipOptions||{};c=c.options.lang;return H(b)?E(b,f.valueDecimals||a.valueDecimals||d.valueDecimals||-1,c.decimalPoint,c.accessibility.thousandsSep||c.thousandsSep):b}function k(a){var b=(a.options.accessibility||{}).description;return b&&a.chart.langFormat("accessibility.series.description",
{description:b,series:a})||""}function c(a,b){return a.chart.langFormat("accessibility.series."+b+"Description",{name:z(a[b]),series:a})}function e(a,b,d){var c=b||"",f=d||"";return a.series.pointArrayMap.reduce(function(b,d){b+=b.length?", ":"";var r=p(a,t(a[d],a.options[d]));return b+(d+": "+c+r+f)},"")}function d(a){var b=a.series,d=1<b.chart.series.length||b.options.name,c=a.series;var f=c.chart;var r=c.options.accessibility;r=r&&r.point&&r.point.valueDescriptionFormat||f.options.accessibility.point.valueDescriptionFormat;
c=t(c.xAxis&&c.xAxis.options.accessibility&&c.xAxis.options.accessibility.enabled,!f.angular);if(c){var g=a.series;var k=g.chart;var z=g.options.accessibility&&g.options.accessibility.point||{},h=k.options.accessibility.point||{};(g=g.xAxis&&g.xAxis.dateTime)?(g=g.getXDateFormat(a.x||0,k.options.tooltip.dateTimeLabelFormats),z=z.dateFormatter&&z.dateFormatter(a)||h.dateFormatter&&h.dateFormatter(a)||z.dateFormat||h.dateFormat||g,k=k.time.dateFormat(z,a.x||0,void 0)):k=void 0;z=(a.series.xAxis||{}).categories&&
m(a.category)&&(""+a.category).replace("<br/>"," ");h=a.id&&0>a.id.indexOf("highcharts-");g="x, "+a.x;k=a.name||k||z||(h?a.id:g)}else k="";z=m(a.index)?a.index+1:"";h=a.series;var l=h.chart.options.accessibility.point||{},n=h.chart.options.accessibility&&h.chart.options.accessibility.point||{},B=h.tooltipOptions||{};g=n.valuePrefix||l.valuePrefix||B.valuePrefix||"";l=n.valueSuffix||l.valueSuffix||B.valueSuffix||"";n=p(a,a["undefined"!==typeof a.value?"value":"y"]);h=a.isNull?h.chart.langFormat("accessibility.series.nullPointValue",
{point:a}):h.pointArrayMap?e(a,g,l):g+n+l;f=A(r,{point:a,index:z,xDescription:k,value:h,separator:c?", ":""},f);r=(r=a.options&&a.options.accessibility&&a.options.accessibility.description)?" "+r:"";b=d?" "+b.name+".":"";d=a.series.chart;c=v(a);k={point:a,annotations:c};d=c.length?d.langFormat("accessibility.series.pointAnnotationsDescription",k):"";a.accessibility=a.accessibility||{};a.accessibility.valueDescription=f;return f+r+b+(d?" "+d:"")}function b(a){var b=y(a),c=g(a),f=a.chart.options.accessibility.point.describeNull;
(b||c)&&a.points.forEach(function(c){var e;if(!(e=c.graphic&&c.graphic.element)){var r=c.series;e=r&&r.chart;r=r&&r.is("sunburst");e=e&&e.options.accessibility.point.describeNull;if(e=c.isNull&&!r&&e){r=c.series;var m=l(c);r=(e=m&&m.graphic)?e.pa