/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/annotations
 * @requires highcharts
 *
 * Annotations 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 i,e,s,o,n,a={};a.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return a.d(i,{a:i}),i},a.d=(t,i)=>{for(var e in i)a.o(i,e)&&!a.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},a.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);let r=t.default;var h=a.n(r);let{doc:l,win:c}=h();function p(t,i,e,s={}){let o="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let n=o.hcEvents;h().Point&&t instanceof h().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let a=t.addEventListener;a&&a.call(t,i,e,!!h().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==i.indexOf("touch"):s.passive,capture:!1}),n[i]||(n[i]=[]);let r={fn:e,order:"number"==typeof s.order?s.order:1/0};return n[i].push(r),n[i].sort((t,i)=>t.order-i.order),function(){B(t,i,e)}}function d(t,i,e,s,o){var n,a,r;let h=l.createElement(t);return i&&f(h,i),o&&(n={padding:"0",border:"none",margin:"0"},f(h.style,n)),e&&(a=h,r=e,f(a.style,r)),s&&s.appendChild(h),h}function u(t){return null!=t}function g(t,i){let e=t.length;for(;e--;)if(t[e]===i){t.splice(e,1);break}}function f(t,i){let e;for(e in t||(t={}),i)t[e]=i[e];return t}function y(t,i,e,s){if(e=e||{},l?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==h())){let s=l.createEvent("Events");s.initEvent(i,!0,!0),e=f(s,e),t.dispatchEvent?t.dispatchEvent(e):t.fireEvent(i,e)}else if(t.hcEvents){e.target||f(e,{preventDefault:function(){e.defaultPrevented=!0},target:t,type:i});let s=[],o=t,n=!1;for(;o.hcEvents;)Object.hasOwnProperty.call(o,"hcEvents")&&o.hcEvents[i]&&(s.length&&(n=!0),s.unshift.apply(s,o.hcEvents[i])),o=Object.getPrototypeOf(o);n&&s.sort((t,i)=>t.order-i.order),s.forEach(i=>{!1===i.fn.call(t,e,t)&&e.preventDefault()})}s&&!e.defaultPrevented&&s.call(t,e)}let m=(t="")=>({center:.5,right:1,middle:.5,bottom:1})[t]||0,v=Array.prototype.find?function(t,i){return t.find(i)}:function(t,i){let e,s=t.length;for(e=0;e<s;e++)if(i(t[e],e))return t[e]};function x(t){return w(t)&&"number"==typeof t.nodeType}function b(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function A(t){return"string"==typeof t}function k(t){let i=Object.prototype.toString.call(t);return"[object Array]"===i||"[object Array Iterator]"===i}function w(t,i){return!!t&&"object"==typeof t&&(!i||!k(t))}function C(t,...i){let e,s=[t,...i],o={},n=function(t,i){return"object"!=typeof t&&(t={}),P(i,function(e,s){if("__proto__"!==s&&"constructor"!==s){let o;!w(e,!0)||(o=e?.constructor,w(e,!0)&&!x(e)&&o?.name&&"Object"!==o.name)||x(e)?t[s]=i[s]:t[s]=n(t[s]||{},e)}}),t};!0===t&&(o=s[1],s=Array.prototype.slice.call(s,2));let a=s.length;for(e=0;e<a;e++)o=n(o,s[e]);return o}function P(t,i,e){for(let s in t)Object.hasOwnProperty.call(t,s)&&i.call(e||t[s],t[s],s,t)}function E(){let t=arguments,i=t.length;for(let e=0;e<i;e++){let i=t[e];if(null!=i)return i}}function O(t,i){return 0>t.indexOf(i)&&!!t.push(i)}function B(t,i,e){function s(i,e){let s=t.removeEventListener;s&&s.call(t,i,e,!1)}function o(e){let o,n;t.nodeName&&(i?(o={})[i]=!0:o=e,P(o,function(t,i){if(e[i])for(n=e[i].length;n--;)s(i,e[i][n].fn)}))}let n="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(n,"hcEvents")){let t=n.hcEvents;if(i){let n=t[i]||[];e?(t[i]=n.filter(function(t){return e!==t.fn}),s(i,e)):(o(t),t[i]=[])}else o(t),delete n.hcEvents}}function N(t,i){let e,s,o=t.length;for(s=0;s<o;s++)t[s].safeI=s;for(t.sort(function(t,s){return 0===(e=i(t,s))?t.safeI-s.safeI:e}),s=0;s<o;s++)delete t[s].safeI}function M(t,i,e){let s=t[i];t[i]=function(){let t=arguments,i=this;return e.apply(this,[function(){return s.apply(i,arguments.length?arguments:t)}].concat([].slice.call(arguments)))}}function T(t,i){let e=this.initAnnotation(t);return this.options.annotations.push(e.options),E(i,!0)&&(e.redraw(),e.graphic.attr({opacity:1})),e}function I(){let t=this;t.plotBoxClip=this.renderer.clipRect(this.plotBox),t.controlPointsGroup=t.renderer.g("control-points").attr({zIndex:99}).clip(t.plotBoxClip).add(),t.options.annotations.forEach((i,e)=>{if(!t.annotations.some(t=>t.options===i)){let s=t.initAnnotation(i);t.options.annotations[e]=s.options}}),t.drawAnnotations(),p(t,"redraw",t.drawAnnotations),p(t,"destroy",function(){t.plotBoxClip.destroy(),t.controlPointsGroup.destroy()}),p(t,"exportData",function(i){let e=t.annotations,s=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,o=!i.dataRows[1].xValues,n=t.options.lang&&t.options.lang.exportData&&t.options.lang.exportData.annotationHeader,a=i.dataRows[0].length,r=t.options.exporting?.csv?.annotations?.itemDelimiter,h=t.options.exporting?.csv?.annotations?.join;e.forEach(t=>{t.options.labelOptions?.includeInDataExport&&t.labels.forEach(t=>{if(t.options.text){let e=t.options.text;t.points.forEach(t=>{let s=t.x,o=t.series.xAxis?t.series.xAxis.index:-1,n=!1;if(-1===o){let t=i.dataRows[0].length,a=Array(t);for(let i=0;i<t;++i)a[i]="";a.push(e),a.xValues=[],a.xValues[o]=s,i.dataRows.push(a),n=!0}if(n||i.dataRows.forEach(t=>{!n&&t.xValues&&void 0!==o&&s===t.xValues[o]&&(h&&t.length>a?t[t.length-1]+=r+e:t.push(e),n=!0)}),!n){let t=i.dataRows[0].length,n=Array(t);for(let i=0;i<t;++i)n[i]="";n[0]=s,n.push(e),n.xValues=[],void 0!==o&&(n.xValues[o]=s),i.dataRows.push(n)}})}})});let l=0;i.dataRows.forEach(t=>{l=Math.max(l,t.length)});let c=l-i.dataRows[0].length;for(let t=0;t<c;t++){let e=function(t){let i;return s&&!1!==(i=s(t))?i:(i=n+" "+t,o)?{columnTitle:i,topLevelColumnTitle:i}:i}(t+1);o?(i.dataRows[0].push(e.topLevelColumnTitle),i.dataRows[1].push(e.columnTitle)):i.dataRows[0].push(e)}})}function L(){this.plotBoxClip.attr(this.plotBox),this.annotations.forEach(t=>{t.redraw(),t.graphic.animate({opacity:1},t.animationConfig)})}function D(t){let i=this.annotations,e="annotations"===t.coll?t:v(i,function(i){return i.options.id===t});e&&(y(e,"remove"),g(this.options.annotations,e.options),g(i,e),e.destroy())}function S(){let t=this.options.annotations,i=this.userOptions.annotations;this.annotations=[],k(this.options.annotations)||(this.options.annotations=[]),w(i,!0)&&w(t,!0)&&this.options.annotations.push(t)}function Y(t){this.chart.hasDraggedAnnotation||t.apply(this,Array.prototype.slice.call(arguments,1))}(e||(e={})).compose=function(t,i,e){let s=i.prototype;if(!s.addAnnotation){let o=e.prototype;p(i,"afterInit",S),s.addAnnotation=T,s.callbacks.push(I),s.collectionsWithInit.annotations=[T],s.collectionsWithUpdate.push("annotations"),s.drawAnnotations=L,s.removeAnnotation=D,s.initAnnotation=function(i){let e=new(t.types[i.type]||t)(this,i);return this.annotations.push(e),e},M(o,"onContainerMouseDown",Y)}};let X=e,F={visible:!0,animation:{},crop:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"#000000",borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return u(this.y)?""+this.y:"Annotation label"},includeInDataExport:!0,overflow:"justify",padding:5,shadow:!1,shape:"callout",style:{fontSize:"0.7em",fontWeight:"normal",color:"contrast"},useHTML:!1,verticalAlign:"bottom",x:0,y:-16},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1,fill:"rgba(0, 0, 0, 0.75)",r:0,snap:2},controlPointOptions:{events:{},style:{cursor:"pointer",fill:"#ffffff",stroke:"#000000","stroke-width":2},height:10,symbol:"circle",visible:!1,width:10},events:{},typeOptions:{},types:{},zIndex:6},{doc:R,isTouchDevice:U}=h(),W=class{addEvents(){let t=this,i=function(i){p(i,U?"touchstart":"mousedown",i=>{t.onMouseDown(i)},{passive:!1})};if(i(this.graphic.element),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&i(t.graphic.text.element)}),P(t.options.events,(i,e)=>{let s=function(s){"click"===e&&t.cancelClick||i.call(t,t.chart.pointer?.normalize(s),t.target,t)};-1===(t.nonDOMEvents||[]).indexOf(e)?(p(t.graphic.element,e,s,{passive:!1}),t.graphic.div&&p(t.graphic.div,e,s,{passive:!1})):p(t,e,s,{passive:!1})}),t.options.draggable&&(p(t,"drag",t.onDrag),!t.graphic.renderer.styledMode)){let i={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[t.options.draggable]};t.graphic.css(i),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&t.graphic.text.css(i)})}t.isUpdating||y(t,"add")}destroy(){this.removeDocEvents(),B(this),this.hcEvents=null}mouseMoveToRadians(t,i,e){let s=t.prevChartY-e,o=t.prevChartX-i,n=t.chartY-e,a=t.chartX-i,r;return this.chart.inverted&&(r=o,o=s,s=r,r=a,a=n,n=r),Math.atan2(n,a)-Math.atan2(s,o)}mouseMoveToScale(t,i,e){let s=t.prevChartX-i,o=t.prevChartY-e,n=t.chartX-i,a=t.chartY-e,r=(n||1)/(s||1),h=(a||1)/(o||1);if(this.chart.inverted){let t=h;h=r,r=t}return{x:r,y:h}}mouseMoveToTranslation(t){let i=t.chartX-t.prevChartX,e=t.chartY-t.prevChartY,s;return this.chart.inverted&&(s=e,e=i,i=s),{x:i,y:e}}onDrag(t){if(this.chart.isInsidePlot(t.chartX-this.chart.plotLeft,t.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){let i=this.mouseMoveToTranslation(t);"x"===this.options.draggable&&(i.y=0),"y"===this.options.draggable&&(i.x=0),this.points.length?this.translate(i.x,i.y):(this.shapes.forEach(t=>t.translate(i.x,i.y)),this.labels.forEach(t=>t.translate(i.x,i.y))),this.redraw(!1)}}onMouseDown(t){if(t.preventDefault&&t.preventDefault(),2===t.button)return;let i=this,e=i.chart.pointer,s=t?.sourceCapabilities?.firesTouchEvents||!1,o=(t=e?.normalize(t)||t).chartX,n=t.chartY;i.cancelClick=!1,i.chart.hasDraggedAnnotation=!0,i.removeDrag=p(R,U||s?"touchmove":"mousemove",function(t){i.hasDragged=!0,(t=e?.normalize(t)||t).prevChartX=o,t.prevChartY=n,y(i,"drag",t),o=t.chartX,n=t.chartY},U||s?{passive:!1}:void 0),i.removeMouseUp=p(R,U||s?"touchend":"mouseup",function(){let t=E(i.target&&i.target.annotation,i.target);t&&(t.cancelClick=i.hasDragged),i.cancelClick=i.hasDragged,i.chart.hasDraggedAnnotation=!1,i.hasDragged&&y(E(t,i),"afterUpdate"),i.hasDragged=!1,i.onMouseUp()},U||s?{passive:!1}:void 0)}onMouseUp(){this.removeDocEvents()}removeDocEvents(){this.removeDrag&&(this.removeDrag=this.removeDrag()),this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())}},j=class extends W{constructor(t,i,e,s){super(),this.nonDOMEvents=["drag"],this.chart=t,this.target=i,this.options=e,this.index=E(e.index,s)}destroy(){super.destroy(),this.graphic&&(this.graphic=this.graphic.destroy()),this.chart=null,this.target=null,this.options=null}redraw(t){this.graphic[t?"animate":"attr"](this.options.positioner.call(this,this.target,this))}render(){let t=this.chart,i=this.options;this.graphic=t.renderer.symbol(i.symbol,0,0,i.width,i.height).add(t.controlPointsGroup).css(i.style),this.setVisibility(i.visible),this.addEvents()}setVisibility(t){this.graphic[t?"show":"hide"](),this.options.visible=t}update(t){let i=this.chart,e=this.target,s=this.index,o=C(!0,this.options,t);this.destroy(),this.constructor(i,e,o,s),this.render(i.controlPointsGroup),this.redraw()}},z=t.default.SeriesRegistry;var V=a.n(z);let{series:{prototype:q}}=V();class H{static fromPoint(t){return new H(t.series.chart,null,{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis})}static pointToPixels(t,i){let e=t.series,s=e.chart,o=t.plotX||0,n=t.plotY||0,a;return s.inverted&&(t.mock?(o=t.plotY,n=t.plotX):(o=s.plotWidth-(t.plotY||0),n=s.plotHeight-(t.plotX||0))),e&&!i&&(o+=(a=e.getPlotBox()).translateX,n+=a.translateY),{x:o,y:n}}static pointToOptions(t){return{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis}}constructor(t,i,e){this.mock=!0,this.point=this,this.series={visible:!0,chart:t,getPlotBox:q.getPlotBox},this.target=i||null,this.options=e,this.applyOptions(this.getOptions())}applyOptions(t){this.command=t.command,this.setAxis(t,"x"),this.setAxis(t,"y"),this.refresh()}getOptions(){return this.hasDynamicOptions()&&"function"==typeof this.options?this.options(this.target):this.options}hasDynamicOptions(){return"function"==typeof this.options}isInsidePlot(){let t=this.plotX,i=this.plotY,e=this.series.xAxis,s=this.series.yAxis,o={x:t,y:i,isInsidePlot:!0,options:{}};return e&&(o.isInsidePlot=u(t)&&t>=0&&t<=e.len),s&&(o.isInsidePlot=o.isInsidePlot&&u(i)&&i>=0&&i<=s.len),y(this.series.chart,"afterIsInsidePlot",o),o.isInsidePlot}refresh(){let t=this.series,i=t.xAxis,e=t.yAxis,s=this.getOptions();i?(this.x=s.x,this.plotX=i.toPixels(s.x,!0)):(this.x=void 0,this.plotX=s.x),e?(this.y=s.y,this.plotY=e.toPixels(s.y,!0)):(this.y=null,this.plotY=s.y),this.isInside=this.isInsidePlot()}refreshOptions(){let t=this.series,i=t.xAxis,e=t.yAxis;this.x=this.options.x=i?this.options.x=i.toValue(this.plotX,!0):this.plotX,this.y=this.options.y=e?e.toValue(this.plotY,!0):this.plotY}rotate(t,i,e){if(!this.hasDynamicOptions()){let s=Math.cos(e),o=Math.sin(e),n=this.plotX-t,a=this.plotY-i;this.plotX=n*s-a*o+t,this.plotY=n*o+a*s+i,this.refreshOptions()}}scale(t,i,e,s){if(!this.hasDynamicOptions()){let o=this.plotX*e,n=this.plotY*s;this.plotX=(1-e)*t+o,this.plotY=(1-s)*i+n,this.refreshOptions()}}setAxis(t,i){let e=i+"Axis",s=t[e],o=this.series.chart;this.series[e]="object"==typeof s?s:u(s)?o[e][s]||o.get(s):null}toAnchor(){let t=[this.plotX,this.plotY,0,0];return this.series.chart.inverted&&(t[0]=this.plotY,t[1]=this.plotX),t}translate(t,i,e,s){this.hasDynamicOptions()||(this.plotX+=e,this.plotY+=s,this.refreshOptions())}}!function(t){function i(){let t=this.controlPoints,i=this.options.controlPoints||[];i.forEach((e,s)=>{let o=C(this.options.controlPointOptions,e);o.index||(o.index=s),i[s]=o,t.push(new j(this.chart,this,o))})}function e(t){let i=t.series.getPlotBox(),e=t.series.chart,s=t.mock?t.toAnchor():e.tooltip&&e.tooltip.getAnchor.call({chart:t.series.chart},t)||[0,0,0,0],o={x:s[0]+(this.options.x||0),y:s[1]+(this.options.y||0),height:s[2]||0,width:s[3]||0};return{relativePosition:o,absolutePosition:C(o,{x:o.x+(t.mock?i.translateX:e.plotLeft),y:o.y+(t.mock?i.translateY:e.plotTop)})}}function s(){this.controlPoints.forEach(t=>t.destroy()),this.chart=null,this.controlPoints=null,this.points=null,this.options=null,this.annotation&&(this.annotation=null)}function o(){var t;let i=this.options;return i.points||i.point&&(k(t=i.point)?t:[t])}function n(){let t,i,e=this.getPointsOptions(),s=this.points,o=e?.length||0;for(t=0;t<o;t++){if(!(i=this.point(e[t],s[t]))){s.length=0;return}i.mock&&i.refresh(),s[t]=i}return s}function a(t,i){if(t&&t.series)return t;if(!i||null===i.series){if(w(t))i=new H(this.chart,this,t);else if(A(t))i=this.chart.get(t)||null;else if("function"==typeof t){let e=t.call(i,this);i=e.series?e:new H(this.chart,this,t)}}return i}function r(t){this.controlPoints.forEach(i=>i.redraw(t))}function h(){this.controlPoints.forEach(t=>t.render())}function l(t,i,e,s,o){if(this.chart.inverted){let t=i;i=e,e=t}this.points.forEach((n,a)=>this.transformPoint(t,i,e,s,o,a),this)}function c(t,i,e,s,o,n){let a=this.points[n];a.mock||(a=this.points[n]=H.fromPoint(a)),a[t](i,e,s,o)}function p(t,i){this.transform("translate",null,null,t,i)}function d(t,i,e){this.transformPoint("translate",null,null,t,i,e)}t.compose=function(t){let u=t.prototype;u.addControlPoints||C(!0,u,{addControlPoints:i,anchor:e,destroyControlTarget:s,getPointsOptions:o,linkPoints:n,point:a,redrawControlPoints:r,renderControlPoints:h,transform:l,transformPoint:c,translate:p,translatePoint:d})}}(s||(s={}));let G=s;class K{constructor(t,i,e,s){this.annotation=t,this.chart=t.chart,this.collection="label"===s?"labels":"shapes",this.controlPoints=[],this.options=i,this.points=[],this.index=e,this.itemType=s,this.init(t,i,e)}attr(){this.graphic.attr.apply(this.graphic,arguments)}attrsFromOptions(t){let i,e,s=this.constructor.attrsMap,o={},n=this.chart.styledMode;for(i in t)e=s[i],void 0===s[i]||n&&-1!==["fill","stroke","stroke-width"].indexOf(e)||(o[e]=t[i]);return o}destroy(){this.graphic&&(this.graphic=this.graphic.destroy()),this.tracker&&(this.tracker=this.tracker.destroy()),this.destroyControlTarget()}calculateAnnotationSize(t,i,e){let s=e.toPixels(t,!0);return Math.abs(e.toPixels(t+i,!0)-s)}init(t,i,e){this.annotation=t,this.chart=t.chart,this.options=i,this.points=[],this.controlPoints=[],this.index=e,this.linkPoints(),this.addControlPoints()}redraw(t){this.redrawControlPoints(t)}render(t){this.options.className&&this.graphic&&this.graphic.addClass(this.options.className),this.renderControlPoints()}rotate(t,i,e){this.transform("rotate",t,i,e)}scale(t,i,e,s){this.transform("scale",t,i,e,s)}setControlPointsVisibility(t){this.controlPoints.forEach(i=>{i.setVisibility(t)})}shouldBeDrawn(){return!!this.points.length}translateShape(t,i,e){let s=this.annotation.chart,o=this.annotation.userOptions,n=s.annotations.indexOf(this.annotation),a=s.options.annotations[n];this.translatePoint(t,i,0),e&&this.translatePoint(t,i,1),a[this.collection][this.index].point=this.options.point,o[this.collection][this.index].point=this.options.point}update(t){let i=this.annotation,e=C(!0,this.options,t),s=this.graphic.parentGroup,o=this.constructor;this.destroy(),C(!0,this,new o(i,e,this.index,this.itemType)),this.render(s),this.redraw()}}G.compose(K);let _=K,{defaultMarkers:$}={defaultMarkers:{arrow:{tagName:"marker",attributes:{id:"arrow",refY:5,refX:9,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 0 L 10 5 L 0 10 Z","stroke-width":0}}]},"reverse-arrow":{tagName:"marker",attributes:{id:"reverse-arrow",refY:5,refX:1,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 5 L 10 0 L 10 10 Z","stroke-width":0}}]}}},Z=tt("marker-end"),J=tt("marker-start"),Q="rgba(192,192,192,"+(h().svg?1e-4:.002)+")";function tt(t){return function(i){this.attr(t,"url(#"+i+")")}}function ti(){this.options.defs=C($,this.options.defs||{})}function te(t,i){let e={attributes:{id:t}},s={stroke:i.color||"none",fill:i.color||"rgba(0, 0, 0, 0.75)"};e.children=i.children&&i.children.map(function(t){return C(s,t)});let o=C(!0,{attributes:{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"}},i,e),n=this.definition(o);return n.id=t,n}class ts extends _{static compose(t,i){let e=i.prototype;e.addMarker||(p(t,"afterGetContainer",ti),e.addMarker=te)}constructor(t,i,e){super(t,i,e,"shape"),this.type="path"}init(t,i,e){u(i.yAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=i.yAxis)}),u(i.xAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=i.xAxis)}),super.init(t,i,e)}toD(){let t=this.options.d;if(t)return"function"==typeof t?t.call(this):t;let i=this.points,e=i.length,s=[],o=e,n=i[0],a=o&&this.anchor(n).absolutePosition,r=0,h;if(a)for(s.push(["M",a.x,a.y]);++r<e&&o;)h=(n=i[r]).command||"L",a=this.anchor(n).absolutePosition,"M"===h||"L"===h?s.push([h,a.x,a.y]):"Z"===h&&s.push([h]),o=n.series.visible;return o&&this.graphic?this.chart.renderer.crispLine(s,this.graphic.strokeWidth()):null}shouldBeDrawn(){return super.shouldBeDrawn()||!!this.options.d}render(t){let i=this.options,e=this.attrsFromOptions(i);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(e).add(t),this.tracker=this.annotation.chart.renderer.path([["M",0,0]]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(t),this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:Q,fill:Q,"stroke-width":this.graphic.strokeWidth()+2*i.snap}),super.render(),f(this.graphic,{markerStartSetter:J,markerEndSetter:Z}),this.setMarkers(this)}redraw(t){if(this.graphic){let i=this.toD(),e=t?"animate":"attr";i?(this.graphic[e]({d:i}),this.tracker[e]({d:i})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"})),this.graphic.placed=this.tracker.placed=!!i}super.redraw(t)}setMarkers(t){let i=t.options,e=t.chart,s=e.options.defs,o=i.fill,n=u(o)&&"none"!==o?o:i.stroke;["markerStart","markerEnd"].forEach(function(o){let a,h,l,c,p=i[o];if(p){for(l in s)if((p===((a=s[l]).attributes&&a.attributes.id)||p===a.id)&&"marker"===a.tagName){h=a;break}h&&(c=t[o]=e.renderer.addMarker((i.id||(0,r.uniqueKey)())+"-"+p,C(h,{color:n})),t.attr(o,c.getAttribute("id")))}})}}ts.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};class to extends _{constructor(t,i,e){super(t,i,e,"shape"),this.type="rect",this.translate=super.translateShape}init(t,i,e){let{point:s,xAxis:o,yAxis:n}=i;s&&"string"!=typeof s&&(u(o)&&(s.xAxis=o),u(n)&&(s.yAxis=n)),super.init(t,i,e)}render(t){let i=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9e9,0,0).attr(i).add(t),super.render()}redraw(t){if(this.graphic){let i=this.points[0],e=this.anchor(i).absolutePosition,s=this.options.width||0,o=this.options.height||0;if(e){let n=u(this.options.xAxis)?this.chart.xAxis[this.options.xAxis]:void 0,a=u(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;n&&u(i.x)&&(s=this.calculateAnnotationSize(i.x,s,n)),a&&u(i.y)&&(o=this.calculateAnnotationSize(i.y,o,a)),this.graphic[t?"animate":"attr"]({x:e.x,y:e.y,width:s,height:o})}else this.attr({x:0,y:-9e9});this.graphic.placed=!!e}super.redraw(t)}}to.attrsMap=C(ts.attrsMap,{width:"width",height:"height"});class tn extends _{constructor(t,i,e){super(t,i,e,"shape"),this.type="circle",this.translate=super.translateShape}init(t,i,e){let{point:s,xAxis:o,yAxis:n}=i;s&&"string"!=typeof s&&(u(o)&&(s.xAxis=o),u(n)&&(s.yAxis=n)),super.init(t,i,e)}redraw(t){if(this.graphic){let i=this.points[0],e=this.anchor(i).absolutePosition,s=this.options.r||0;if(e){let o=u(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;o&&u(i.y)&&(s=this.calculateAnnotationSize(i.y,s,o)),this.graphic[t?"animate":"attr"]({x:e.x,y:e.y,r:s})}else this.graphic.attr({x:0,y:-9e9});this.graphic.placed=!!e}super.redraw.call(this,t)}render(t){let i=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9e9,0).attr(i).add(t),super.render()}setRadius(t){this.options.r=t}}tn.attrsMap=C(ts.attrsMap,{r:"r"});class ta extends _{constructor(t,i,e){super(t,i,e,"shape"),this.type="ellipse"}init(t,i,e){u(i.yAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=i.yAxis)}),u(i.xAxis)&&i.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=i.xAxis)}),super.init(t,i,e)}render(t){this.graphic=this.annotation.chart.renderer.createElement("ellipse").attr(this.attrsFromOptions(this.options)).add(t),super.render()}translate(t,i){super.translateShape(t,i,!0)}getDistanceFromLine(t,i,e,s){return Math.abs((i.y-t.y)*e-(i.x-t.x)*s+i.x*t.y-i.y*t.x)/Math.sqrt((i.y-t.y)*(i.y-t.y)+(i.x-t.x)*(i.x-t.x))}getAttrs(t,i){let e=t.x,s=t.y,o=i.x,n=i.y,a=(e+o)/2,r=Math.sqrt((e-o)*(e-o)/4+(s-n)*(s-n)/4),h=180*Math.atan((n-s)/(o-e))/Math.PI;return a<e&&(h+=180),{cx:a,cy:(s+n)/2,rx:r,ry:this.getRY(),angle:h}}getRY(){let t=this.getYAxis();return u(t)?Math.abs(t.toPixels(this.options.ry)-t.toPixels(0)):this.options.ry}getYAxis(){let t=this.options.yAxis;return this.chart.yAxis[t]}getAbsolutePosition(t){return this.anchor(t).absolutePosition}redraw(t){if(this.graphic){let i=this.getAbsolutePosition(this.points[0]),e=this.getAbsolutePosition(this.points[1]),s=this.getAttrs(i,e);i?this.graphic[t?"animate":"attr"]({cx:s.cx,cy:s.cy,rx:s.rx,ry:s.ry,rotation:s.angle,rotationOriginX:s.cx,rotationOriginY:s.cy}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!i}super.redraw(t)}setYRadius(t){let i=this.annotation.userOptions.shapes;this.options.ry=t,i&&i[0]&&(i[0].ry=t,i[0].ry=t)}}ta.attrsMap=C(ts.attrsMap,{ry:"ry"});let tr=t.default.Templating;var th=a.n(tr);let{format:tl}=th();function tc(t,i,e,s,o){let n=o&&o.anchorX,a=o&&o.anchorY,r,h,l=e/2;return b(n)&&b(a)&&(r=[["M",n,a]],(h=i-a)<0&&(h=-s-h),h<e&&(l=n<t+e/2?h:e-h),a>i+s?r.push(["L",t+l,i+s]):a<i?r.push(["L",t+l,i]):n<t?r.push(["L",t,i+s/2]):n>t+e&&r.push(["L",t+e,i+s/2])),r||[]}class tp extends _{static alignedPosition(t,i){return{x:Math.round((i.x||0)+(t.x||0)+(i.width-(t.width||0))*m(t.align)),y:Math.round((i.y||0)+(t.y||0)+(i.height-(t.height||0))*m(t.verticalAlign))}}static compose(t){t.prototype.symbols.connector=tc}static justifiedOptions(t,i,e,s){let o,n=e.align,a=e.verticalAlign,r=i.box?0:i.padding||0,h=i.getBBox(),l={align:n,verticalAlign:a,x:e.x,y:e.y,width:i.width,height:i.height},c=(s.x||0)-t.plotLeft,p=(s.y||0)-t.plotTop;return(o=c+r)<0&&("right"===n?l.align="left":l.x=(l.x||0)-o),(o=c+h.width-r)>t.plotWidth&&("left"===n?l.align="right":l.x=(l.x||0)+t.plotWidth-o),(o=p+r)<0&&("bottom"===a?l.verticalAlign="top":l.y=(l.y||0)-o),(o=p+h.height-r)>t.plotHeight&&("top"===a?l.verticalAlign="bottom":l.y=(l.y||0)+t.plotHeight-o),l}constructor(t,i,e){super(t,i,e,"label")}translatePoint(t,i){super.translatePoint(t,i,0)}translate(t,i){var e,s;let o=this.annotation.chart,n=this.annotation.userOptions,a=o.annotations.indexOf(this.annotation),r=o.options.annotations[a];if(o.inverted){let e=t;t=i,i=e}(e=this.options).x||(e.x=0),(s=this.options).y||(s.y=0),this.options.x+=t,this.options.y+=i,r[this.collection][this.index].x=this.options.x,r[this.collection][this.index].y=this.options.y,n[this.collection][this.index].x=this.options.x,n[this.collection][this.index].y=this.options.y}render(t){let i=this.options,e=this.attrsFromOptions(i),s=i.style,o=this.annotation.chart.options.chart,n=o.plotBackgroundColor||o.backgroundColor;if(this.graphic=this.annotation.chart.renderer.label("",0,-9999,i.shape,void 0,void 0,i.useHTML,void 0,"annotation-label").attr(e).add(t),!this.annotation.chart.styledMode){if(s?.color==="contrast"){let t=!i.shape||tp.shapesWithoutBackground.indexOf(i.shape)>-1||"none"===i.backgroundColor?n:i.backgroundColor;s.color=this.annotation.chart.renderer.getContrast("string"==typeof t?t:"string"==typeof n?n:"#ffffff")}this.graphic.css(i.style||{}).shadow(i.shadow)}this.graphic.labelrank=i.labelrank,super.render()}redraw(t){let i=this.options,e=this.text||i.format||i.text,s=this.graphic,o=this.points[0];if(!s)return void this.redraw(t);s.attr({text:e?tl(String(e),o,this.annotation.chart):i.formatter.call(o,o)});let n=this.anchor(o),a=this.position(n);a?(s.alignAttr=a,a.anchorX=n.absolutePosition.x,a.anchorY=n.absolutePosition.y,s[t?"animate":"attr"](a)):s.attr({x:0,y:-9999}),s.placed=!!a,super.redraw(t)}anchor(t){let i=super.anchor.apply(this,arguments),e=this.options.x||0,s=this.options.y||0;return i.absolutePosition.x-=e,i.absolutePosition.y-=s,i.relativePosition.x-=e,i.relativePosition.y-=s,i}position(t){let i=this.graphic,e=this.annotation.chart,s=e.tooltip,o=this.points[0],n=this.options,a=t.absolutePosition,r=t.relativePosition,h,l,c,p,d=o.series.visible&&H.prototype.isInsidePlot.call(o);if(i&&d){let{width:t=0,height:u=0}=i;n.distance&&s?h=s.getPosition.call({chart:e,distance:E(n.distance,16),getPlayingField:s.getPlayingField,pointer:s.pointer},t,u,{plotX:r.x,plotY:r.y,negative:o.negative,ttBelow:o.ttBelow,h:r.height||r.width}):n.positioner?h=n.positioner.call(this,this):(l={x:a.x,y:a.y,width:0,height:0},h=tp.alignedPosition(f(n,{width:t,height:u}),l),"justify"===this.options.overflow&&(h=tp.alignedPosition(tp.justifiedOptions(e,i,n,h),l))),n.crop&&(c=h.x-e.plotLeft,p=h.y-e.plotTop,d=e.isInsidePlot(c,p)&&e.isInsidePlot(c+t,p+u))}return d?h:null}}tp.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"},tp.shapesWithoutBackground=["connector"];class td extends _{constructor(t,i,e){super(t,i,e,"shape"),this.type="image",this.translate=super.translateShape}render(t){let i=this.attrsFromOptions(this.options),e=this.options;this.graphic=this.annotation.chart.renderer.image(e.src,0,-9e9,e.width,e.height).attr(i).add(t),this.graphic.width=e.width,this.graphic.height=e.height,super.render()}redraw(t){if(this.graphic){let i=this.anchor(this.points[0]),e=tp.prototype.position.call(this,i);e?this.graphic[t?"animate":"attr"]({x:e.x,y:e.y}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!e}super.redraw(t)}}td.attrsMap={width:"width",height:"height",zIndex:"zIndex"};let tu=t.default.AST;var tg=a.n(tu);let tf=class{constructor(t,i){this.iconsURL=i,this.container=this.createPopupContainer(t),this.closeButton=this.addCloseButton()}createPopupContainer(t,i="highcharts-popup highcharts-no-tooltip"){return d("div",{className:i},void 0,t)}addCloseButton(t="highcharts-popup-close"){let i=this,e=this.iconsURL,s=d("button",{className:t},void 0,this.container);return d("span",{className:"highcharts-icon"},{backgroundImage:"url("+(e.match(/png|svg|jpeg|jpg|gif/ig)?e:e+"close.svg")+")"},s),["click","touchstart"].forEach(t=>{p(s,t,i.closeButtonEvents.bind(i))}),p(document,"keydown",function(t){"Escape"===t.code&&i.closeButtonEvents()}),s}closeButtonEvents(){this.closePopup()}showPopup(t="highcharts-annotation-toolbar"){let i=this.container,e=this.closeButton;this.type=void 0,i.innerHTML=tg().emptyHTML,i.className.indexOf(t)>=0&&(i.classList.remove(t),i.removeAttribute("style")),i.appendChild(e),i.style.display="block",i.style.height=""}closePopup(){this.container.style.display="none"}},ty=t.default.Color;var tm=a.n(ty);let{doc:tv,isFirefox:tx}=h();function tb(t,i,e,s,o,n){let a,r;if(!i)return;let h=this.addInput,l=this.lang;P(s,(s,n)=>{a=""!==e?e+"."+n:n,w(s)&&(!k(s)||k(s)&&w(s[0])?((r=l[n]||n).match(/\d/g)||o.push([!0,r,t]),tb.call(this,t,i,a,s,o,!1)):o.push([this,a,"annotation",t,s]))}),n&&(N(o,t=>t[1].match(/format/g)?-1:1),tx&&o.reverse(),o.forEach(t=>{!0===t[0]?d("span",{className:"highcharts-annotation-title"},void 0,t[2]).appendChild(tv.createTextNode(t[1])):(t[4]={value:t[4][0],type:t[4][1]},h.apply(t[0],t.splice(1)))}))}let{doc:tA}=h(),{seriesTypes:tk}=V();(i=o||(o={}))[i["params.algorithm"]=0]="params.algorithm",i[i["params.average"]=1]="params.average";let tw={"algorithm-pivotpoints":["standard","fibonacci","camarilla"],"average-disparityindex":["sma","ema","dema","tema","wma"]};function tC(t){let i=d("div",{className:"highcharts-popup-lhs-col"},void 0,t),e=d("div",{className:"highcharts-popup-rhs-col"},void 0,t);return d("div",{className:"highcharts-popup-rhs-col-wrapper"},void 0,e),{lhsCol:i,rhsCol:e}}function tP(t,i,e,s){let o=i.params||i.options.params;s.innerHTML=tg().emptyHTML,d("h3",{className:"highcharts-indicator-title"},void 0,s).appendChild(tA.createTextNode(tL(i,e).indicatorFullName)),d("input",{type:"hidden",name:"highcharts-type-"+e,value:e},void 0,s),tD.call(this,e,"series",t,s,i,i.linkedParent&&i.linkedParent.options.id),o.volumeSeriesID&&tD.call(this,e,"volume",t,s,i,i.linkedParent&&o.volumeSeriesID),tO.call(this,t,"params",o,e,s)}function tE(t,i,e,s){function o(i,e){let s=y.parentNode.children[1];tP.call(n,t,i,e,y),s&&(s.style.display="block"),l&&i.options&&d("input",{type:"hidden",name:"highcharts-id-"+e,value:i.options.id},void 0,y).setAttribute("highcharts-data-series-id",i.options.id)}let n=this,a=n.lang,r=i.querySelectorAll(".highcharts-popup-lhs-col")[0],h=i.querySelectorAll(".highcharts-popup-rhs-col")[0],l="edit"===e,c=l?t.series:t.options.plotOptions||{};if(!t&&c)return;let u,g=[];l||k(c)?k(c)&&(g=tI.call(this,c)):g=tT.call(this,c,s),N(g,(t,i)=>{let e=t.indicatorFullName.toLowerCase(),s=i.indicatorFullName.toLowerCase();return e<s?-1:+(e>s)}),r.children[1]&&r.children[1].remove();let f=d("ul",{className:"highcharts-indicator-list"},void 0,r),y=h.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];if(g.forEach(t=>{let{indicatorFullName:i,indicatorType:e,series:s}=t;u=d("li",{className:"highcharts-indicator-list"},void 0,f);let n=d("button",{className:"highcharts-indicator-list-item",textContent:i},void 0,u);["click","touchstart"].forEach(t=>{p(n,t,function(){o(s,e)})})}),g.length>0){let{series:t,indicatorType:i}=g[0];o(t,i)}else l||(tg().setElementHTML(y.parentNode.children[0],a.noFilterMatch||""),y.parentNode.children[1].style.display="none")}function tO(t,i,e,s,n){if(!t)return;let a=this.addInput;P(e,(e,r)=>{let h=i+"."+r;if(u(e)&&h)if(w(e)&&(a.call(this,h,s,n,{}),tO.call(this,t,h,e,s,n)),h in o){let o=tN.call(this,s,h,n);tM.call(this,t,i,o,s,r,e)}else"params.volumeSeriesID"===h||k(e)||a.call(this,h,s,n,{value:e,type:"number"})})}function tB(t,i){let e=this,s=i.querySelectorAll(".highcharts-popup-lhs-col")[0],o=this.lang.clearFilter,n=d("div",{className:"highcharts-input-wrapper"},void 0,s),a=function(i){tE.call(e,t,e.container,"add",i)},r=this.addInput("searchIndicators","input",n,{value:"",type:"text",htmlFor:"search-indicators",labelClassName:"highcharts-input-search-indicators-label"}),h=d("a",{textContent:o},void 0,n);r.classList.add("highcharts-input-search-indicators"),h.classList.add("clear-filter-button"),p(r,"input",function(){a(this.value),this.value.length?h.style.display="inline-block":h.style.display="none"}),["click","touchstart"].forEach(t=>{p(h,t,function(){r.value="",a(""),h.style.display="none"})})}function tN(t,i,e){let s=i.split("."),o=s[s.length-1],n="highcharts-"+i+"-type-"+t,a=this.lang;d("label",{htmlFor:n},null,e).appendChild(tA.createTextNode(a[o]||i));let r=d("select",{name:n,className:"highcharts-popup-field",id:"highcharts-select-"+i},null,e);return r.setAttribute("id","highcharts-select-"+i),r}function tM(t,i,e,s,o,n,a){"series"===i||"volume"===i?t.series.forEach(t=>{let s=t.options,o=s.name||s.params?t.name:s.id||"";"highcharts-navigator-series"!==s.id&&s.id!==(a&&a.options&&a.options.id)&&(u(n)||"volume"!==i||"column"!==t.type||(n=s.id),d("option",{value:s.id},void 0,e).appendChild(tA.createTextNode(o)))}):s&&o&&tw[o+"-"+s].forEach(t=>{d("option",{value:t},void 0,e).appendChild(tA.createTextNode(t))}),u(n)&&(e.value=n)}function tT(t,i){let e,s=this.chart&&this.chart.options.lang,o=s&&s.navigation&&s.navigation.popup&&s.navigation.popup.indicatorAliases,n=new Map;return P(t,(t,s)=>{let a=t&&t.options;if(t.params||a&&a.params){let{indicatorFullName:a,indicatorType:r}=tL(t,s);if(i){let s=RegExp(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),h=o&&o[r]&&o[r].join(" ")||"";(a.match(s)||h.match(s))&&(e={indicatorFullName:a,indicatorType:r,series:t},n.set(r.toLowerCase(),e))}else e={indicatorFullName:a,indicatorType:r,series:t},n.set(r.toLowerCase(),e)}}),Array.from(n.values())}function tI(t){let i=[];return t.forEach(t=>{t.is("sma")&&i.push({indicatorFullName:t.name,indicatorType:t.type,series:t})}),i}function tL(t,i){let e=t.options,s=tk[i]&&tk[i].prototype.nameBase||i.toUpperCase(),o=i;return e&&e.type&&(o=t.options.type,s=t.name),{indicatorFullName:s,indicatorType:o}}function tD(t,i,e,s,o,n){if(!e)return;let a=tN.call(this,t,i,s);tM.call(this,e,i,a,void 0,void 0,void 0,o),u(n)&&(a.value=n)}let{doc:tS}=h();function tY(){return d("div",{className:"highcharts-tab-item-content highcharts-no-mousewheel"},void 0,this.container)}function tX(t,i){let e=this.container,s=this.lang,o="highcharts-tab-item";0===i&&(o+=" highcharts-tab-disabled");let n=d("button",{className:o},void 0,e);return n.appendChild(tS.createTextNode(s[t+"Button"]||t)),n.setAttribute("highcharts-data-tab-type",t),n}function tF(){let t=this.container,i=t.querySelectorAll(".highcharts-tab-item"),e=t.querySelectorAll(".highcharts-tab-item-content");for(let t=0;t<i.length;t++)i[t].classList.remove("highcharts-tab-item-active"),e[t].classList.remove("highcharts-tab-item-show")}function tR(t,i){let e=this.container.querySelectorAll(".highcharts-tab-item-content");t.className+=" highcharts-tab-item-active",e[i].className+=" highcharts-tab-item-show"}function tU(t){let i=this;this.container.querySelectorAll(".highcharts-tab-item").forEach((e,s)=>{(0!==t||"edit"!==e.getAttribute("highcharts-data-tab-type"))&&["click","touchstart"].forEach(t=>{p(e,t,function(){tF.call(i),tR.call(i,this,s)})})})}let{doc:tW}=h(),{getOptions:tj}=h();class tz extends tf{constructor(t,i,e){super(t,i),this.chart=e,this.lang=(tj().lang.navigation||{}).popup||{},p(this.container,"mousedown",()=>{let t=e&&e.navigationBindings&&e.navigationBindings.activeAnnotation;if(t){t.cancelClick=!0;let i=p(tW,"click",()=>{setTimeout(()=>{t.cancelClick=!1},0),i()})}})}addInput(t,i,e,s){let o=t.split("."),n=o[o.length-1],a=this.lang,r="highcharts-"+i+"-"+E(s.htmlFor,n);if(n.match(/^\d+$/)||d("label",{htmlFor:r,className:s.labelClassName},void 0,e).appendChild(tW.createTextNode(a[n]||n)),"color"===s.type&&this.chart?.container)return this.createColorInput(t,r,s,e,this.chart.container);let h=d("input",{name:r,value:s.value,type:s.type,className:"highcharts-popup-field"},void 0,e);return h.setAttribute("highcharts-data-name",t),h}createColorInput(t,i,e,s,o){let{value:n,alpha:a}=function(t,i){let e=t=>("0"+Math.round(t).toString(16)).slice(-2).toUpperCase(),s=t=>{let[i,s,o,n]=tm().parse(t).rgba;return{value:"#"+e(i)+e(s)+e(o),alpha:n}};if(t.startsWith("rgb")||t.startsWith("rgba"))return s(t);if(t.startsWith("color")||t.startsWith("var")){let o=tW.createElement("span");o.style.setProperty("color",t),i.appendChild(o);let n=window.getComputedStyle(o).color;if(i.removeChild(o),n.startsWith("color")){let t=n.match(RegExp("color\\s*\\(\\s*srgb\\s+([\\d.]+)\\s+([\\d.]+)\\s+([\\d.]+)\\s+(?:\\s*\\/\\s*([\\d.]+))?\\s*\\)"));if(t){let i=Math.round(255*parseFloat(t[1])),s=Math.round(255*parseFloat(t[2])),o=Math.round(255*parseFloat(t[3])),n=t[4]?parseFloat(t[4]):1;return{value:"#"+e(i)+e(s)+e(o),alpha:n}}}if(n.startsWith("rgb")||n.startsWith("rgba"))return s(n)}return{value:t,alpha:1}}(e.value||"",o),r=tm().parse(e.value||"").rgba[3],h=isNaN(r)?a:r,l=d("div",{className:"highcharts-popup-color-wrapper"},void 0,s),c=d("input",{type:"color",value:n,className:"highcharts-popup-field highcharts-popup-field-color"},void 0,l),u=d("input",{name:i,id:i,value:n,type:"text",className:"highcharts-popup-field highcharts-popup-field-text"},void 0,l);u.setAttribute("highcharts-data-name",t);let g=d("span",{className:"highcharts-popup-color-separator"},void 0,l),f=d("input",{type:"number",value:String(Math.round(100*h)),className:"highcharts-popup-field highcharts-popup-opacity-percentage",min:"0",max:"100",step:"1"},void 0,l),y=d("span",{className:"highcharts-popup-opacity-percent-suffix"},void 0,l);y.appendChild(tW.createTextNode(" %"));let m=d("input",{type:"range",value:String(Math.round(100*h)),className:"highcharts-popup-opacity-slider",min:"0",max:"100",step:"1"},void 0,s);m.style.setProperty("--highcharts-popup-opacity-track-color",n),m.style.setProperty("display","none");let v=()=>{let t=/^#[0-9A-Fa-f]{6}$/.test(u.value);g.style.display=t?"":"none",f.style.display=t?"":"none",y.style.display=t?"":"none"};v();let x=t=>{var i;let e=(i=Number(t.target.value),i>0?i<100?i:100:0);m.value=String(e),f.value=String(Math.round(e))},b=t=>{t.target===c?u.value=c.value.toUpperCase():c.value=u.value,m.style.setProperty("--highcharts-popup-opacity-track-color",c.value),v()};return p(s,"mousedown",t=>{t.target!==f&&t.target!==m&&(m.style.display="none")}),p(f,"focus",()=>{m.style.display=""}),p(f,"input",x),p(m,"input",x),p(c,"input",b),p(u,"input",b),l}closeButtonEvents(){if(this.chart){let t=this.chart.navigationBindings;y(t,"closePopup"),t&&t.selectedButtonElement&&y(t,"deselectButton",{button:t.selectedButtonElement})}else super.closeButtonEvents()}addButton(t,i,e,s,o){let n=d("button",void 0,void 0,t);return n.appendChild(tW.createTextNode(i)),o&&["click","touchstart"].forEach(t=>{p(n,t,()=>{let t,i,n,a,r;return this.closePopup(),o((t=Array.prototype.slice.call(s.querySelectorAll("input")),i=Array.prototype.slice.call(s.querySelectorAll("select")),n=s.querySelectorAll("#highcharts-select-series > option:checked")[0],a=s.querySelectorAll("#highcharts-select-volume > option:checked")[0],r={actionType:e,linkedTo:n&&n.getAttribute("value")||"",fields:{}},t.forEach(t=>{let i=t.getAttribute("highcharts-data-name");if(t.getAttribute("highcharts-data-series-id"))r.seriesId=t.value;else if(i){let e=t.closest(".highcharts-popup-color-wrapper"),s=e?.querySelector(".highcharts-popup-opacity-percentage"),o=s?Number(s.value)/100:1;if(s){let e=tm().parse(t.value).rgba;r.fields[i]=Number.isNaN(e[0])?t.value:`rgba(${e[0]},${e[1]},${e[2]},${o})`}else r.fields[i]=t.value}else r.type=t.value}),i.forEach(t=>{let i=t.id;if("highcharts-select-series"!==i&&"highcharts-select-volume"!==i){let e=i.split("highcharts-select-")[1];r.fields[e]=t.value}}),a&&(r.fields["params.volumeSeriesID"]=a.getAttribute("value")||""),r))})}),n}showForm(t,i,e,s){i&&(this.showPopup(),"indicators"===t&&this.indicators.addForm.call(this,i,e,s),"annotation-toolbar"===t&&this.annotations.addToolbar.call(this,i,e,s),"annotation-edit"===t&&this.annotations.addForm.call(this,i,e,s),"flag"===t&&this.annotations.addForm.call(this,i,e,s,!0),this.type=t,this.container.style.height=this.container.offsetHeight+"px")}}f(tz.prototype,{annotations:{addForm:function(t,i,e,s){if(!t)return;let o=this.container,n=this.lang,a=d("h2",{className:"highcharts-popup-main-title"},void 0,o);a.appendChild(tv.createTextNode(n[i.langKey]||i.langKey||"")),a=d("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},void 0,o);let r=d("div",{className:"highcharts-popup-bottom-row"},void 0,o);tb.call(this,a,t,"",i,[],!0),this.addButton(r,s?n.addButton||"Add":n.saveButton||"Save",s?"add":"save",o,e)},addToolbar:function(t,i,e){let s=this.lang,o=this.container,n=this.showForm,a="highcharts-annotation-toolbar";-1===o.className.indexOf(a)&&(o.className+=" "+a+" highcharts-no-mousewheel"),t&&(o.style.top=t.plotTop+10+"px");let r=d("p",{className:"highcharts-annotation-label"},void 0,o);r.setAttribute("aria-label","Annotation type"),r.appendChild(tv.createTextNode(E(s[i.langKey]||i.langKey,i.shapes&&i.shapes[0].type,"")));let h=this.addButton(o,s.editButton||"Edit","edit",o,()=>{n.call(this,"annotation-edit",t,i,e)});h.className+=" highcharts-annotation-edit-button",d("span",{className:"highcharts-icon"},{backgroundImage:`url(${this.iconsURL}edit.svg)`},h),h=this.addButton(o,s.removeButton||"Remove","remove",o,e),h.className+=" highcharts-annotation-remove-button",d("span",{className:"highcharts-icon"},{backgroundImage:`url(${this.iconsURL}destroy.svg)`},h)}},indicators:{addForm:function(t,i,e){let s,o=this.lang;if(!t)return;this.tabs.init.call(this,t);let n=this.container.querySelectorAll(".highcharts-tab-item-content");tC(n[0]),tB.call(this,t,n[0]),tE.call(this,t,n[0],"add"),s=n[0].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.addButton||"add","add",s,e),tC(n[1]),tE.call(this,t,n[1],"edit"),s=n[1].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.saveButton||"save","edit",s,e),this.addButton(s,o.removeButton||"remove","remove",s,e)},getAmount:function(){let t=0;return this.series.forEach(i=>{(i.params||i.options.params)&&t++}),t}},tabs:{init:function(t){if(!t)return;let i=this.indicators.getAmount.call(t),e=tX.call(this,"add");tX.call(this,"edit",i),tY.call(this),tY.call(this),tU.call(this,i),tR.call(this,e,0)}}});let{composed:tV}=h();function tq(){this.popup&&this.popup.closePopup()}function tH(t){this.popup||(this.popup=new tz(this.chart.container,this.chart.options.navigation.iconsURL||this.chart.options.stockTools&&this.chart.options.stockTools.gui.iconsURL||"https://code.highcharts.com/12.6.0/gfx/stock-icons/",this.chart)),this.popup.showForm(t.formType,this.chart,t.options,t.onSubmit)}function tG(t,i){this.inClass(i.target,"highcharts-popup")||t.apply(this,Array.prototype.slice.call(arguments,1))}let tK=function(t,i){O(tV,"Popup")&&(p(t,"closePopup",tq),p(t,"showPopup",tH),M(i.prototype,"onContainerMouseDown",tG))},{getDeferredAnimation:t_}=h(),{defaultOptions:t$}=h();function tZ(t,i){let e={};return["labels","shapes"].forEach(s=>{let o=t[s],n=i[s];if(o)if(n)e[s]=(k(n)?n:[n]).map((t,i)=>C(o[i],t));else e[s]=t[s]}),e}class tJ extends W{static compose(t,i,e,s){X.compose(tJ,t,e),tp.compose(s),ts.compose(t,s),i.compose(tJ,t),tK(i,e)}constructor(t,i){super(),this.coll="annotations",this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.index=-1,this.labels=[],this.shapes=[],this.setOptions(i),this.userOptions=i;let e=tZ(this.options,i);this.options.labels=e.labels,this.options.shapes=e.shapes,this.init(t,this.options)}addClipPaths(){this.setClipAxes(),this.clipXAxis&&this.clipYAxis&&this.options.crop&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))}addLabels(){let t=this.options.labels||[];t.forEach((i,e)=>{let s=this.initLabel(i,e);C(!0,t[e],s.options)})}addShapes(){let t=this.options.shapes||[];t.forEach((i,e)=>{let s=this.initShape(i,e);C(!0,t[e],s.options)})}destroy(){var t;let i=this.chart,e=function(t){t.destroy()};this.labels.forEach(e),this.shapes.forEach(e),this.clipXAxis=null,this.clipYAxis=null,g(i.labelCollectors,this.labelCollector),super.destroy(),this.destroyControlTarget(),t=this,P(t,function(e,s){e!==i&&e?.destroy&&e.destroy(),e?.destroy,delete t[s]})}destroyItem(t){g(this[t.itemType+"s"],t),t.destroy()}getClipBox(){if(this.clipXAxis&&this.clipYAxis)return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}}initProperties(t,i){this.setOptions(i);let e=tZ(this.options,i);this.options.labels=e.labels,this.options.shapes=e.shapes,this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.userOptions=i,this.labels=[],this.shapes=[]}init(t,i,e=this.index){let s=this.chart,o=this.options.animation;this.index=e,this.linkPoints(),this.addControlPoints(),this.addShapes(),this.addLabels(),this.setLabelCollector(),this.animationConfig=t_(s,o)}initLabel(t,i){this.options.labelOptions?.align;let e=new tp(this,C(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},t),i);return e.itemType="label",this.labels.push(e),e}initShape(t,i){let e=C(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},t),s=new tJ.shapesMap[e.type||"rect"](this,e,i);return s.itemType="shape",this.shapes.push(s),s}redraw(t){this.linkPoints(),this.graphic||this.render(),this.clipRect&&this.clipRect.animate(this.getClipBox()),this.redrawItems(this.shapes,t),this.redrawItems(this.labels,t),this.redrawControlPoints(t)}redrawItem(t,i){if(t.linkPoints(),t.shouldBeDrawn()){let e,s;t.graphic||this.renderItem(t),t.redraw(E(i,!0)&&t.graphic.placed),t.points.length&&(e=t.graphic,s=t.points.some(t=>!1!==t.series.visible&&!1!==t.visible),e&&(s?"hidden"===e.visibility&&e.show():e.hide()))}else this.destroyItem(t)}redrawItems(t,i){let e=t.length;for(;e--;)this.redrawItem(t[e],i)}remove(){return this.chart.removeAnnotation(this)}render(){let t=this.chart.renderer;this.graphic=t.g("annotation").addClass(this.options.className||"").attr({opacity:0,zIndex:this.options.zIndex,visibility:this.options.visible?"inherit":"hidden"}).add(),this.shapesGroup=t.g("annotation-shapes").add(this.graphic),this.options.crop&&this.shapesGroup.clip(this.chart.plotBoxClip),this.labelsGroup=t.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic),this.addClipPaths(),this.clipRect&&this.graphic.clip(this.clipRect),this.renderItems(this.shapes),this.renderItems(this.labels),this.addEvents(),this.renderControlPoints()}renderItem(t){t.render("label"===t.itemType?this.labelsGroup:this.shapesGroup)}renderItems(t){let i=t.length;for(;i--;)this.renderItem(t[i])}setClipAxes(){let t=this.chart.xAxis,i=this.chart.yAxis,e=[...this.options.labels??[],...this.options.shapes??[]].reduce((e,s)=>{let o=s&&(s.point||"points"in s&&s.points?.[0]);return[t[o&&o.xAxis]||e[0],i[o&&o.yAxis]||e[1]]},[]);this.clipXAxis=e[0],this.clipYAxis=e[1]}setControlPointsVisibility(t){let i=function(i){i.setControlPointsVisibility(t)};this.controlPoints.forEach(i=>{i.setVisibility(t)}),this.shapes.forEach(i),this.labels.forEach(i)}setLabelCollector(){let t=this;t.labelCollector=function(){return t.labels.reduce(function(t,i){return i.options.allowOverlap||t.push(i.graphic),t},[])},t.chart.labelCollectors.push(t.labelCollector)}setOptions(t){var i;this.options=C(this.defaultOptions,t.type&&this.defaultOptions.types?.[t.type]||{},t),(i=this.options).typeOptions||(i.typeOptions={})}setVisibility(t){let i=this.options,e=this.chart.navigationBindings,s=E(t,!i.visible);if(this.graphic.attr("visibility",s?"inherit":"hidden"),!s){let t=function(t){t.setControlPointsVisibility(s)};this.shapes.forEach(t),this.labels.forEach(t),e.activeAnnotation===this&&e.popup&&"annotation-toolbar"===e.popup.type&&y(e,"closePopup")}i.visible=s}update(t,i){let e=this.chart,s=tZ(this.userOptions,t),o=e.annotations.indexOf(this),n=C(!0,this.userOptions,t);n.labels=s.labels,n.shapes=s.shapes,this.destroy(),this.initProperties(e,n),this.init(e,n),e.options.annotations[o]=this.options,this.isUpdating=!0,E(i,!0)&&e.drawAnnotations(),y(this,"afterUpdate"),this.isUpdating=!1}}tJ.ControlPoint=j,tJ.MockPoint=H,tJ.shapesMap={rect:to,circle:tn,ellipse:ta,path:ts,image:td},tJ.types={},tJ.prototype.defaultOptions=F,t$.annotations=F,tJ.prototype.nonDOMEvents=["add","afterUpdate","drag","remove"],G.compose(tJ);var tQ=n||(n={});tQ.compose=function(t){return t.navigation||(t.navigation=new t0(t)),t};class t0{constructor(t){this.updates=[],this.chart=t}addUpdate(t){this.chart.navigation.updates.push(t)}update(t,i){this.updates.forEach(e=>{e.call(this.chart,t,i)})}}tQ.Additions=t0;let t1=n,t2={backgroundColor:"color",backgroundColors:"color",borderColor:"color",borderRadius:"string",color:"color",fill:"color",fontSize:"string",labels:"string",name:"string",stroke:"color",title:"string"},t9={annotationsFieldsTypes:t2,getAssignedAxis:function(t){return t.filter(t=>{let i=t.axis.getExtremes(),e=i.min,s=i.max,o=E(t.axis.minPointOffset,0);return b(e)&&b(s)&&t.value>=e-o&&t.value<=s+o&&!t.axis.options.isInternal})[0]},getFieldType:function(t,i){let e=t2[t],s=typeof i;return u(e)&&(s=e),({string:"text",number:"number",boolean:"checkbox",color:"color"})[s]}},{getAssignedAxis:t5}=t9,t4={lang:{navigation:{popup:{simpleShapes:"Simple shapes",lines:"Lines",circle:"Circle",ellipse:"Ellipse",rectangle:"Rectangle",label:"Label",shapeOptions:"Shape options",typeOptions:"Details",fill:"Fill",format:"Text",strokeWidth:"Line width",stroke:"Line color",title:"Title",name:"Name",labelOptions:"Label options",labels:"Labels",backgroundColor:"Background color",backgroundColors:"Background colors",borderColor:"Border color",borderRadius:"Border radius",borderWidth:"Border width",style:"Style",padding:"Padding",fontSize:"Font size",color:"Color",height:"Height",shapes:"Shape options"}}},navigation:{bindingsClassName:"highcharts-bindings-container",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&t5(i.xAxis),s=i&&t5(i.yAxis),o=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation(C({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{x:e.value,y:s.value,xAxis:e.axis.index,yAxis:s.axis.index},r:5}]},o.annotationsOptions,o.bindings.circleAnnotation.annotationsOptions))},steps:[function(t,i){let e,s=i.options.shapes,o=s&&s[0]&&s[0].point||{};if(b(o.xAxis)&&b(o.yAxis)){let i=this.chart.inverted,s=this.chart.xAxis[o.xAxis].toPixels(o.x),n=this.chart.yAxis[o.yAxis].toPixels(o.y);e=Math.max(Math.sqrt(Math.pow(i?n-t.chartX:s-t.chartX,2)+Math.pow(i?s-t.chartY:n-t.chartY,2)),5)}i.update({shapes:[{r:e}]})}]},ellipseAnnotation:{className:"highcharts-ellipse-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&t5(i.xAxis),s=i&&t5(i.yAxis),o=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation(C({langKey:"ellipse",type:"basicAnnotation",shapes:[{type:"ellipse",xAxis:e.axis.index,yAxis:s.axis.index,points:[{x:e.value,y:s.value},{x:e.value,y:s.value}],ry:1}]},o.annotationsOptions,o.bindings.ellipseAnnotation.annotationsOptions))},steps:[function(t,i){let e=i.shapes[0],s=e.getAbsolutePosition(e.points[1]);e.translatePoint(t.chartX-s.x,t.chartY-s.y,1),e.redraw(!1)},function(t,i){let e=i.shapes[0],s=e.getAbsolutePosition(e.points[0]),o=e.getAbsolutePosition(e.points[1]),n=e.getDistanceFromLine(s,o,t.chartX,t.chartY),a=e.getYAxis(),r=Math.abs(a.toValue(0)-a.toValue(n));e.setYRadius(r),e.redraw(!1)}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&t5(i.xAxis),s=i&&t5(i.yAxis);if(!e||!s)return;let o=e.value,n=s.value,a=e.axis.index,r=s.axis.index,h=this.chart.options.navigation;return this.chart.addAnnotation(C({langKey:"rectangle",type:"basicAnnotation",shapes:[{type:"path",points:[{xAxis:a,yAxis:r,x:o,y:n},{xAxis:a,yAxis:r,x:o,y:n},{xAxis:a,yAxis:r,x:o,y:n},{xAxis:a,yAxis:r,x:o,y:n},{command:"Z"}]}]},h.annotationsOptions,h.bindings.rectangleAnnotation.annotationsOptions))},steps:[function(t,i){let e=i.options.shapes,s=e&&e[0]&&e[0].points||[],o=this.chart.pointer?.getCoordinates(t),n=o&&t5(o.xAxis),a=o&&t5(o.yAxis);if(n&&a){let t=n.value,e=a.value;s[1].x=t,s[2].x=t,s[2].y=e,s[3].y=e,i.update({shapes:[{points:s}]})}}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(t){let i=this.chart.pointer?.getCoordinates(t),e=i&&t5(i.xAxis),s=i&&t5(i.yAxis),o=this.chart.options.navigation;if(e&&s)return this.chart.addAnnotation(C({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}",overflow:"none",crop:!0},labels:[{point:{xAxis:e.axis.index,yAxis:s.axis.index,x:e.value,y:s.value}}]},o.annotationsOptions,o.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}},{setOptions:t3}=h(),{format:t6}=th(),{composed:t7,doc:t8,win:it}=h(),{getAssignedAxis:ii,getFieldType:ie}=t9;function is(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()}function io(){this.navigationBindings&&this.navigationBindings.destroy()}function ia(){let t=this.options;t&&t.navigation&&t.navigation.bindings&&(this.navigationBindings=new ip(this,t.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())}function ir(){let t=this.navigationBindings,i="highcharts-disabled-btn";if(this&&t){let e=!1;if(this.series.forEach(t=>{!t.options.isInternal&&t.visible&&(e=!0)}),this.navigationBindings&&this.navigationBindings.container&&this.navigationBindings.container[0]){let s=this.navigationBindings.container[0];P(t.boundClassNames,(t,o)=>{let n=s.querySelectorAll("."+o);if(n)for(let s=0;s<n.length;s++){let o=n[s],a=o.className;"normal"===t.noDataState||e?-1!==a.indexOf(i)&&o.classList.remove(i):-1===a.indexOf(i)&&(o.className+=" "+i)}})}}}function ih(){this.deselectAnnotation()}function il(){this.selectedButtonElement=null}function ic(t){let i,e,s=t.prototype.defaultOptions.events&&t.prototype.defaultOptions.events.click;function o(t){let i=this,e=i.chart.navigationBindings,o=e.activeAnnotation;s&&s.call(i,t),o!==i?(e.deselectAnnotation(),e.activeAnnotation=i,i.setControlPointsVisibility(!0),y(e,"showPopup",{annotation:i,formType:"annotation-toolbar",options:e.annotationToFields(i),onSubmit:function(t){if("remove"===t.actionType)e.activeAnnotation=!1,e.chart.removeAnnotation(i);else{let s={};e.fieldsToOptions(t.fields,s),e.deselectAnnotation();let o=s.typeOptions;"measure"===i.options.type&&(o.crosshairY.enabled=0!==o.crosshairY.strokeWidth,o.crosshairX.enabled=0!==o.crosshairX.strokeWidth),i.update(s)}}})):y(e,"closePopup"),t.activeAnnotation=!0}C(!0,t.prototype.defaultOptions.events,{click:o,touchstart:function(t){i=t.touches[0].clientX,e=t.touches[0].clientY},touchend:function(t){i&&Math.sqrt(Math.pow(i-t.changedTouches[0].clientX,2)+Math.pow(e-t.changedTouches[0].clientY,2))>=4||o.call(this,t)}})}class ip{static compose(t,i){O(t7,"NavigationBindings")&&(p(t,"remove",is),ic(t),P(t.types,t=>{ic(t)}),p(i,"destroy",io),p(i,"load",ia),p(i,"render",ir),p(ip,"closePopup",ih),p(ip,"deselectButton",il),t3(t4))}constructor(t,i){this.boundClassNames=void 0,this.chart=t,this.options=i,this.eventsToUnbind=[],this.container=this.chart.container.getElementsByClassName(this.options.bindingsClassName||""),this.container.length||(this.container=t8.getElementsByClassName(this.options.bindingsClassName||""))}getCoords(t){let i=this.chart.pointer?.getCoordinates(t);return[i&&ii(i.xAxis),i&&ii(i.yAxis)]}initEvents(){let t=this,i=t.chart,e=t.container,s=t.options;t.boundClassNames={},P(s.bindings||{},i=>{t.boundClassNames[i.className]=i}),[].forEach.call(e,i=>{t.eventsToUnbind.push(p(i,"click",e=>{let s=t.getButtonEvents(i,e);s&&!s.button.classList.contains("highcharts-disabled-btn")&&t.bindingsButtonClick(s.button,s.events,e)}))}),P(s.events||{},(i,e)=>{"function"==typeof i&&t.eventsToUnbind.push(p(t,e,i,{passive:!1}))}),t.eventsToUnbind.push(p(i.container,"click",function(e){!i.cancelClick&&i.isInsidePlot(e.chartX-i.plotLeft,e.chartY-i.plotTop,{visiblePlotOnly:!0})&&t.bindingsChartClick(this,e)})),t.eventsToUnbind.push(p(i.container,h().isTouchDevice?"touchmove":"mousemove",function(i){t.bindingsContainerMouseMove(this,i)},h().isTouchDevice?{passive:!1}:void 0))}initUpdate(){let t=this;t1.compose(this.chart).navigation.addUpdate(i=>{t.update(i)})}bindingsButtonClick(t,i,e){let s=this.chart,o=s.renderer.boxWrapper,n=!0;this.selectedButtonElement&&(this.selectedButtonElement.classList===t.classList&&(n=!1),y(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&s.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1)),n?(this.selectedButton=i,this.selectedButtonElement=t,y(this,"selectButton",{button:t}),i.init&&i.init.call(this,t,e),(i.start||i.steps)&&s.renderer.boxWrapper.addClass("highcharts-draw-mode")):(s.stockTools&&t.classList.remove("highcharts-active"),o.removeClass("highcharts-draw-mode"),this.nextEvent=!1,this.mouseMoveEvent=!1,this.selectedButton=null)}bindingsChartClick(t,i){t=this.chart;let e=this.activeAnnotation,s=this.selectedButton,o=t.renderer.boxWrapper;e&&(e.cancelClick||i.activeAnnotation||!i.target.parentNode||function(t,i){let e=it.Element.prototype,s=e.matches||e.msMatchesSelector||e.webkitMatchesSelector,o=null;if(e.closest)o=e.closest.call(t,i);else do{if(s.call(t,i))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return o}(i.target,".highcharts-popup")?e.cancelClick&&setTimeout(()=>{e.cancelClick=!1},0):y(this,"closePopup")),s&&s.start&&(this.nextEvent?(this.nextEvent(i,this.currentUserDetails),this.steps&&(this.stepIndex++,s.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=s.steps[this.stepIndex]:(y(this,"deselectButton",{button:this.selectedButtonElement}),o.removeClass("highcharts-draw-mode"),s.end&&s.end.call(this,i,this.currentUserDetails),this.nextEvent=!1,this.mouseMoveEvent=!1,this.selectedButton=null))):(this.currentUserDetails=s.start.call(this,i),this.currentUserDetails&&s.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=s.steps[this.stepIndex]):(y(this,"deselectButton",{button:this.selectedButtonElement}),o.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,s.end&&s.end.call(this,i,this.currentUserDetails))))}bindingsContainerMouseMove(t,i){this.mouseMoveEvent&&this.mouseMoveEvent(i,this.currentUserDetails)}fieldsToOptions(t,i){return P(t,(t,e)=>{let s=parseFloat(t),o=e.split("."),n=o.length-1;if(!b(s)||t.match(/px|em/g)||e.match(/format/g)||(t=s),"undefined"!==t){let e=i;o.forEach((i,s)=>{if("__proto__"!==i&&"constructor"!==i){let a=E(o[s+1],"");n===s?e[i]=t:(e[i]||(e[i]=a.match(/\d/g)?[]:{}),e=e[i])}})}}),i}deselectAnnotation(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)}annotationToFields(t){let i=t.options,e=ip.annotationsEditable,s=e.nestedOptions,o=E(i.type,i.shapes?.[0]?.type,i.labels?.[0]?.type,"label"),n=ip.annotationsNonEditable[i.langKey]||[],a={langKey:i.langKey,type:o};function r(i,e,o,a,h){let l;o&&u(i)&&-1===n.indexOf(e)&&((o.indexOf&&o.indexOf(e))>=0||o[e]||!0===o)&&(k(i)?(a[e]=[],i.forEach((t,i)=>{w(t)?(a[e][i]={},P(t,(t,o)=>{r(t,o,s[e],a[e][i],e)})):r(t,0,s[e],a[e],e)})):w(i)?(l={},k(a)?(a.push(l),l[e]={},l=l[e]):a[e]=l,P(i,(t,i)=>{r(t,i,0===e?o:s[e],l,e)})):"format"===e?a[e]=[t6(i,t.labels[0].points[0]).toString(),"text"]:k(a)?a.push([i,ie(h,i)]):a[e]=[i,ie(e,i)])}return P(i,(t,n)=>{"typeOptions"===n&&"basicAnnotation"!==a.type?(a[n]={},P(i[n],(t,i)=>{r(t,i,s,a[n],i)})):r(t,n,e[o],a,n)}),a}getClickedClassNames(t,i){var e,s;let o,n,a,r=i.target,h=[],l;for(;r&&r.tagName&&(e=r,n=A(s="class")&&!u(void 0),a=(t,i)=>{u(t)?e.setAttribute(i,t):n?(o=e.getAttribute(i))||"class"!==i||(o=e.getAttribute(i+"Name")):e.removeAttribute(i)},A(s)?a(void 0,s):P(s,a),(l=o)&&(h=h.concat(l.split(" ").map(t=>[t,r]))),(r=r.parentNode)!==t););return h}getButtonEvents(t,i){let e,s=this;return this.getClickedClassNames(t,i).forEach(t=>{s.boundClassNames[t[0]]&&!e&&(e={events:s.boundClassNames[t[0]],button:t[1]})}),e}update(t){this.options=C(!0,this.options,t),this.removeEvents(),this.initEvents()}removeEvents(){this.eventsToUnbind.forEach(t=>t())}destroy(){this.removeEvents()}}ip.annotationsEditable={nestedOptions:{labelOptions:["style","format","backgroundColor"],labels:["style"],label:["style"],style:["fontSize","color"],background:["fill","strokeWidth","stroke"],innerBackground:["fill","strokeWidth","stroke"],outerBackground:["fill","strokeWidth","stroke"],shapeOptions:["fill","strokeWidth","stroke"],shapes:["fill","strokeWidth","stroke"],line:["strokeWidth","stroke"],backgroundColors:[!0],connector:["fill","strokeWidth","stroke"],crosshairX:["strokeWidth","stroke"],crosshairY:["strokeWidth","stroke"]},circle:["shapes"],ellipse:["shapes"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],fibonacci:[],tunnel:["background","line","height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[],basicAnnotation:["shapes","labelOptions"]},ip.annotationsNonEditable={rectangle:["crosshairX","crosshairY","labelOptions"],ellipse:["labelOptions"],circle:["labelOptions"]};let id=h();id.Annotation=id.Annotation||tJ,id.NavigationBindings=id.NavigationBindings||ip,id.Annotation.compose(id.Chart,id.NavigationBindings,id.Pointer,id.SVGRenderer);let iu=h();export{iu as default};