UNPKG

highcharts

Version:
34 lines 64.2 kB
!/** * Highcharts JS v13.0.1 (2026-08-17) * @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 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating,t._Highcharts.AST,t._Highcharts.Color):"function"==typeof define&&define.amd?define("highcharts/modules/annotations",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.Templating,t.AST,t.Color)}):"object"==typeof exports?exports["highcharts/modules/annotations"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating,t._Highcharts.AST,t._Highcharts.Color):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Templating,t.Highcharts.AST,t.Highcharts.Color)}("u"<typeof window?this:window,(t,e,i,s,o)=>(()=>{"use strict";var n,a,r,h,l,c={660(t){t.exports=s},620(t){t.exports=o},512(t){t.exports=e},984(t){t.exports=i},944(e){e.exports=t}};let p={};function d(t){let e=p[t];if(void 0!==e)return e.exports;let i=p[t]={exports:{}};return c[t](i,i.exports,d),i.exports}d.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return d.d(e,{a:e}),e},d.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var s=e[i++],o=e[i++];d.o(t,s)?0===o&&i++:0===o?Object.defineProperty(t,s,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,s,{enumerable:!0,get:o})}else for(var s in e)d.o(e,s)&&!d.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},d.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let u={};d.d(u,{default:()=>ee});var g=d(944),m=d.n(g);function f(t,e){let i=this.initAnnotation(t);return this.options.annotations.push(i.options),(0,g.pick)(e,!0)&&(i.redraw(),i.graphic.attr({opacity:1})),i}function v(){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((e,i)=>{if(!t.annotations.some(t=>t.options===e)){let s=t.initAnnotation(e);t.options.annotations[i]=s.options}}),t.drawAnnotations(),(0,g.addEvent)(t,"redraw",t.drawAnnotations),(0,g.addEvent)(t,"destroy",function(){t.plotBoxClip.destroy(),t.controlPointsGroup.destroy()}),(0,g.addEvent)(t,"exportData",function(e){let i=t.annotations,s=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,o=!e.dataRows[1].xValues,n=t.options.lang&&t.options.lang.exportData&&t.options.lang.exportData.annotationHeader,a=e.dataRows[0].length,r=t.options.exporting?.csv?.annotations?.itemDelimiter,h=t.options.exporting?.csv?.annotations?.join;i.forEach(t=>{t.options.labelOptions?.includeInDataExport&&t.labels.forEach(t=>{if(t.options.text){let i=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=e.dataRows[0].length,a=Array(t);for(let e=0;e<t;++e)a[e]="";a.push(i),a.xValues=[],a.xValues[o]=s,e.dataRows.push(a),n=!0}if(n||e.dataRows.forEach(t=>{!n&&t.xValues&&void 0!==o&&s===t.xValues[o]&&(h&&t.length>a?t[t.length-1]+=r+i:t.push(i),n=!0)}),!n){let t=e.dataRows[0].length,n=Array(t);for(let e=0;e<t;++e)n[e]="";n[0]=s,n.push(i),n.xValues=[],void 0!==o&&(n.xValues[o]=s),e.dataRows.push(n)}})}})});let l=0;e.dataRows.forEach(t=>{l=Math.max(l,t.length)});let c=l-e.dataRows[0].length;for(let t=0;t<c;t++){let i=function(t){let e;return s&&!1!==(e=s(t))?e:(e=n+" "+t,o)?{columnTitle:e,topLevelColumnTitle:e}:e}(t+1);o?(e.dataRows[0].push(i.topLevelColumnTitle),e.dataRows[1].push(i.columnTitle)):e.dataRows[0].push(i)}})}function y(){this.plotBoxClip.attr(this.plotBox),this.annotations.forEach(t=>{t.redraw(),t.graphic.animate({opacity:1},t.animationConfig)})}function x(t){let e=this.annotations,i="annotations"===t.coll?t:(0,g.find)(e,function(e){return e.options.id===t});i&&((0,g.fireEvent)(i,"remove"),(0,g.erase)(this.options.annotations,i.options),(0,g.erase)(e,i),i.destroy())}function b(){let t=this.options.annotations,e=this.userOptions.annotations;this.annotations=[],(0,g.isArray)(this.options.annotations)||(this.options.annotations=[]),(0,g.isObject)(e,!0)&&(0,g.isObject)(t,!0)&&this.options.annotations.push(t)}function A(t){this.chart.hasDraggedAnnotation||t.apply(this,Array.prototype.slice.call(arguments,1))}(a||(a={})).compose=function(t,e,i){let s=e.prototype;if(!s.addAnnotation){let o=i.prototype;(0,g.addEvent)(e,"afterInit",b),s.addAnnotation=f,s.callbacks.push(v),s.collectionsWithInit.annotations=[f],s.collectionsWithUpdate.push("annotations"),s.drawAnnotations=y,s.removeAnnotation=x,s.initAnnotation=function(e){let i=new(t.types[e.type]||t)(this,e);return this.annotations.push(i),i},(0,g.wrap)(o,"onContainerMouseDown",A)}};let E=a,k={visible:!0,animation:{},crop:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"var(--highcharts-neutral-color-100)",borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return(0,g.defined)(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:"var(--highcharts-background-color)",stroke:"var(--highcharts-neutral-color-100)","stroke-width":2},height:10,symbol:"circle",visible:!1,width:10},events:{},typeOptions:{},types:{},zIndex:6},{doc:w,isTouchDevice:C}=m(),P=class{addEvents(){let t=this,e=function(e){(0,g.addEvent)(e,C?"touchstart":"mousedown",e=>{t.onMouseDown(e)},{passive:!1})};if(e(this.graphic.element),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&e(t.graphic.text.element)}),(0,g.objectEach)(t.options.events,(e,i)=>{let s=function(s){"click"===i&&t.cancelClick||e.call(t,t.chart.pointer?.normalize(s),t.target,t)};-1===(t.nonDOMEvents||[]).indexOf(i)?((0,g.addEvent)(t.graphic.element,i,s,{passive:!1}),t.graphic.div&&(0,g.addEvent)(t.graphic.div,i,s,{passive:!1})):(0,g.addEvent)(t,i,s,{passive:!1})}),t.options.draggable&&((0,g.addEvent)(t,"drag",t.onDrag),!t.graphic.renderer.styledMode)){let e={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[t.options.draggable]};t.graphic.css(e),(t.labels||[]).forEach(t=>{t.options.useHTML&&t.graphic.text&&!t.graphic.text.foreignObject&&t.graphic.text.css(e)})}t.isUpdating||(0,g.fireEvent)(t,"add")}destroy(){this.removeDocEvents(),(0,g.removeEvent)(this),this.hcEvents=null}mouseMoveToRadians(t,e,i){let s=t.prevChartY-i,o=t.prevChartX-e,n=t.chartY-i,a=t.chartX-e,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,e,i){let s=t.prevChartX-e,o=t.prevChartY-i,n=t.chartX-e,a=t.chartY-i,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 e=t.chartX-t.prevChartX,i=t.chartY-t.prevChartY,s;return this.chart.inverted&&(s=i,i=e,e=s),{x:e,y:i}}onDrag(t){if(this.chart.isInsidePlot(t.chartX-this.chart.plotLeft,t.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){let e=this.mouseMoveToTranslation(t);"x"===this.options.draggable&&(e.y=0),"y"===this.options.draggable&&(e.x=0),this.points.length?this.translate(e.x,e.y):(this.shapes.forEach(t=>t.translate(e.x,e.y)),this.labels.forEach(t=>t.translate(e.x,e.y))),this.redraw(!1)}}onMouseDown(t){if(t.preventDefault&&t.preventDefault(),2===t.button)return;let e=this,i=e.chart.pointer,s=t?.sourceCapabilities?.firesTouchEvents||!1,o=(t=i?.normalize(t)||t).chartX,n=t.chartY;e.cancelClick=!1,e.chart.hasDraggedAnnotation=!0,e.removeDrag=(0,g.addEvent)(w,C||s?"touchmove":"mousemove",function(t){e.hasDragged=!0,(t=i?.normalize(t)||t).prevChartX=o,t.prevChartY=n,(0,g.fireEvent)(e,"drag",t),o=t.chartX,n=t.chartY},C||s?{passive:!1}:void 0),e.removeMouseUp=(0,g.addEvent)(w,C||s?"touchend":"mouseup",function(){let t=(0,g.pick)(e.target&&e.target.annotation,e.target);t&&(t.cancelClick=e.hasDragged),e.cancelClick=e.hasDragged,e.chart.hasDraggedAnnotation=!1,e.hasDragged&&(0,g.fireEvent)((0,g.pick)(t,e),"afterUpdate"),e.hasDragged=!1,e.onMouseUp()},C||s?{passive:!1}:void 0)}onMouseUp(){this.removeDocEvents()}removeDocEvents(){this.removeDrag&&(this.removeDrag=this.removeDrag()),this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())}},O=class extends P{constructor(t,e,i,s){super(),this.nonDOMEvents=["drag"],this.chart=t,this.target=e,this.options=i,this.index=(0,g.pick)(i.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,e=this.options;this.graphic=t.renderer.symbol(e.symbol,0,0,e.width,e.height).add(t.controlPointsGroup).css(e.style),this.setVisibility(e.visible),this.addEvents()}setVisibility(t){this.graphic[t?"show":"hide"](),this.options.visible=t}update(t){let e=this.chart,i=this.target,s=this.index,o=(0,g.merge)(!0,this.options,t);this.destroy(),this.constructor(e,i,o,s),this.render(e.controlPointsGroup),this.redraw()}},M={backgroundColor:"color",backgroundColors:"color",borderColor:"color",borderRadius:"string",color:"color",fill:"color",fontSize:"string",labels:"string",name:"string",stroke:"color",title:"string"},N={annotationsFieldsTypes:M,getAssignedAxis:function(t){return t.filter(t=>{let e=t.axis.getExtremes(),i=e.min,s=e.max,o=(0,g.pick)(t.axis.minPointOffset,0);return(0,g.isNumber)(i)&&(0,g.isNumber)(s)&&t.value>=i-o&&t.value<=s+o&&!t.axis.options.isInternal})[0]},getAxisFromOptions:function(t,e,i){return(0,g.isNumber)(i)?t[e][i]:(0,g.defined)(i)?(0,g.find)(t[e],t=>t.options.id===i):void 0},getFieldType:function(t,e){let i=M[t],s=typeof e;return(0,g.defined)(i)&&(s=i),({string:"text",number:"number",boolean:"checkbox",color:"color"})[s]}};var B=d(512),T=d.n(B);let{getAxisFromOptions:S}=N,{series:{prototype:L}}=T();class I{static fromPoint(t){return new I(t.series.chart,null,{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis})}static pointToPixels(t,e){let i=t.series,s=i.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))),i&&!e&&(o+=(a=i.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,e,i){this.mock=!0,this.point=this,this.series={visible:!0,chart:t,getPlotBox:L.getPlotBox},this.target=e||null,this.options=i,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,e=this.plotY,i=this.series.xAxis,s=this.series.yAxis,o={x:t,y:e,isInsidePlot:!0,options:{}};return i&&(o.isInsidePlot=(0,g.defined)(t)&&t>=0&&t<=i.len),s&&(o.isInsidePlot=o.isInsidePlot&&(0,g.defined)(e)&&e>=0&&e<=s.len),(0,g.fireEvent)(this.series.chart,"afterIsInsidePlot",o),o.isInsidePlot}refresh(){let t=this.series,e=t.xAxis,i=t.yAxis,s=this.getOptions();e?(this.x=s.x,this.plotX=e.toPixels(s.x,!0)):(this.x=void 0,this.plotX=s.x),i?(this.y=s.y,this.plotY=i.toPixels(s.y,!0)):(this.y=null,this.plotY=s.y),this.isInside=this.isInsidePlot()}refreshOptions(){let t=this.series,e=t.xAxis,i=t.yAxis;this.x=this.options.x=e?this.options.x=e.toValue(this.plotX,!0):this.plotX,this.y=this.options.y=i?i.toValue(this.plotY,!0):this.plotY}rotate(t,e,i){if(!this.hasDynamicOptions()){let s=Math.cos(i),o=Math.sin(i),n=this.plotX-t,a=this.plotY-e;this.plotX=n*s-a*o+t,this.plotY=n*o+a*s+e,this.refreshOptions()}}scale(t,e,i,s){if(!this.hasDynamicOptions()){let o=this.plotX*i,n=this.plotY*s;this.plotX=(1-i)*t+o,this.plotY=(1-s)*e+n,this.refreshOptions()}}setAxis(t,e){let i=e+"Axis",s=t[i],o=this.series.chart;this.series[i]="object"==typeof s?s:S(o,i,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,e,i,s){this.hasDynamicOptions()||(this.plotX+=i,this.plotY+=s,this.refreshOptions())}}!function(t){function e(){let t=this.controlPoints,e=this.options.controlPoints||[];e.forEach((i,s)=>{let o=(0,g.merge)(this.options.controlPointOptions,i);o.index||(o.index=s),e[s]=o,t.push(new O(this.chart,this,o))})}function i(t){let e=t.series.getPlotBox(),i=t.series.chart,s=t.mock?t.toAnchor():i.tooltip&&i.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:(0,g.merge)(o,{x:o.x+(t.mock?e.translateX:i.plotLeft),y:o.y+(t.mock?e.translateY:i.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(){let t=this.options;return t.points||t.point&&(0,g.splat)(t.point)}function n(){let t,e,i=this.getPointsOptions(),s=this.points,o=i?.length||0;for(t=0;t<o;t++){if(!(e=this.point(i[t],s[t]))){s.length=0;return}e.mock&&e.refresh(),s[t]=e}return s}function a(t,e){if(t&&t.series)return t;if(!e||null===e.series){if((0,g.isObject)(t))e=new I(this.chart,this,t);else if((0,g.isString)(t))e=this.chart.get(t)||null;else if("function"==typeof t){let i=t.call(e,this);e=i.series?i:new I(this.chart,this,t)}}return e}function r(t){this.controlPoints.forEach(e=>e.redraw(t))}function h(){this.controlPoints.forEach(t=>t.render())}function l(t,e,i,s,o){if(this.chart.inverted){let t=e;e=i,i=t}this.points.forEach((n,a)=>this.transformPoint(t,e,i,s,o,a),this)}function c(t,e,i,s,o,n){let a=this.points[n];a.mock||(a=this.points[n]=I.fromPoint(a)),a[t](e,i,s,o)}function p(t,e){this.transform("translate",null,null,t,e)}function d(t,e,i){this.transformPoint("translate",null,null,t,e,i)}t.compose=function(t){let u=t.prototype;u.addControlPoints||(0,g.merge)(!0,u,{addControlPoints:e,anchor:i,destroyControlTarget:s,getPointsOptions:o,linkPoints:n,point:a,redrawControlPoints:r,renderControlPoints:h,transform:l,transformPoint:c,translate:p,translatePoint:d})}}(r||(r={}));let D=r;class Y{constructor(t,e,i,s){this.annotation=t,this.chart=t.chart,this.collection="label"===s?"labels":"shapes",this.controlPoints=[],this.options=e,this.points=[],this.index=i,this.itemType=s,this.init(t,e,i)}attr(){this.graphic.attr.apply(this.graphic,arguments)}attrsFromOptions(t){let e,i,s=this.constructor.attrsMap,o={},n=this.chart.styledMode;for(e in t)i=s[e],void 0===s[e]||n&&-1!==["fill","stroke","stroke-width"].indexOf(i)||(o[i]=t[e]);return o}destroy(){this.graphic&&(this.graphic=this.graphic.destroy()),this.tracker&&(this.tracker=this.tracker.destroy()),this.destroyControlTarget()}calculateAnnotationSize(t,e,i){let s=i.toPixels(t,!0);return Math.abs(i.toPixels(t+e,!0)-s)}init(t,e,i){this.annotation=t,this.chart=t.chart,this.options=e,this.points=[],this.controlPoints=[],this.index=i,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,e,i){this.transform("rotate",t,e,i)}scale(t,e,i,s){this.transform("scale",t,e,i,s)}setControlPointsVisibility(t){this.controlPoints.forEach(e=>{e.setVisibility(t)})}shouldBeDrawn(){return!!this.points.length}translateShape(t,e,i){let s=this.annotation.chart,o=this.annotation.userOptions,n=s.annotations.indexOf(this.annotation),a=s.options.annotations[n];this.translatePoint(t,e,0),i&&this.translatePoint(t,e,1),a[this.collection][this.index].point=this.options.point,o[this.collection][this.index].point=this.options.point}update(t){let e=this.annotation,i=(0,g.merge)(!0,this.options,t),s=this.graphic.parentGroup,o=this.constructor;this.destroy();let n=new o(e,i,this.index,this.itemType);(0,g.merge)(!0,this,n),this.render(s),this.redraw()}}D.compose(Y);let X=Y,{defaultMarkers:F}={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}}]}}},R=j("marker-end"),U=j("marker-start"),W="rgba(192,192,192,"+(m().svg?1e-4:.002)+")";function j(t){return function(e){this.attr(t,"url(#"+e+")")}}function H(){this.options.defs=(0,g.merge)(F,this.options.defs||{})}function z(t,e){let i={attributes:{id:t}},s={stroke:e.color||"none",fill:e.color||"rgba(0, 0, 0, 0.75)"};i.children=e.children&&e.children.map(function(t){return(0,g.merge)(s,t)});let o=(0,g.merge)(!0,{attributes:{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"}},e,i),n=this.definition(o);return n.id=t,n}class V extends X{static compose(t,e){let i=e.prototype;i.addMarker||((0,g.addEvent)(t,"afterGetContainer",H),i.addMarker=z)}constructor(t,e,i){super(t,e,i,"shape"),this.type="path"}init(t,e,i){(0,g.defined)(e.yAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=e.yAxis)}),(0,g.defined)(e.xAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=e.xAxis)}),super.init(t,e,i)}toD(){let t=this.options.d;if(t)return"function"==typeof t?t.call(this):t;let e=this.points,i=e.length,s=[],o=i,n=e[0],a=o&&this.anchor(n).absolutePosition,r=0,h;if(a)for(s.push(["M",a.x,a.y]);++r<i&&o;)h=(n=e[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 e=this.options,i=this.attrsFromOptions(e);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(i).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:W,fill:W,"stroke-width":this.graphic.strokeWidth()+2*e.snap}),super.render(),(0,g.extend)(this.graphic,{markerStartSetter:U,markerEndSetter:R}),this.setMarkers(this)}redraw(t){if(this.graphic){let e=this.toD(),i=t?"animate":"attr";e?(this.graphic[i]({d:e}),this.tracker[i]({d:e})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"})),this.graphic.placed=this.tracker.placed=!!e}super.redraw(t)}setMarkers(t){let e=t.options,i=t.chart,s=i.options.defs,o=e.fill,n=(0,g.defined)(o)&&"none"!==o?o:e.stroke;["markerStart","markerEnd"].forEach(function(o){let a,r,h,l,c=e[o];if(c){for(h in s)if((c===((a=s[h]).attributes&&a.attributes.id)||c===a.id)&&"marker"===a.tagName){r=a;break}r&&(l=t[o]=i.renderer.addMarker((e.id||(0,g.uniqueKey)())+"-"+c,(0,g.merge)(r,{color:n})),t.attr(o,l.getAttribute("id")))}})}}V.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};class q extends X{constructor(t,e,i){super(t,e,i,"shape"),this.type="rect",this.translate=super.translateShape}init(t,e,i){let{point:s,xAxis:o,yAxis:n}=e;s&&"string"!=typeof s&&((0,g.defined)(o)&&(s.xAxis=o),(0,g.defined)(n)&&(s.yAxis=n)),super.init(t,e,i)}render(t){let e=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9e9,0,0).attr(e).add(t),super.render()}redraw(t){if(this.graphic){let e=this.points[0],i=this.anchor(e).absolutePosition,s=this.options.width||0,o=this.options.height||0;if(i){let n=(0,g.defined)(this.options.xAxis)?this.chart.xAxis[this.options.xAxis]:void 0,a=(0,g.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;n&&(0,g.defined)(e.x)&&(s=this.calculateAnnotationSize(e.x,s,n)),a&&(0,g.defined)(e.y)&&(o=this.calculateAnnotationSize(e.y,o,a)),this.graphic[t?"animate":"attr"]({x:i.x,y:i.y,width:s,height:o})}else this.attr({x:0,y:-9e9});this.graphic.placed=!!i}super.redraw(t)}}q.attrsMap=(0,g.merge)(V.attrsMap,{width:"width",height:"height"});class $ extends X{constructor(t,e,i){super(t,e,i,"shape"),this.type="circle",this.translate=super.translateShape}init(t,e,i){let{point:s,xAxis:o,yAxis:n}=e;s&&"string"!=typeof s&&((0,g.defined)(o)&&(s.xAxis=o),(0,g.defined)(n)&&(s.yAxis=n)),super.init(t,e,i)}redraw(t){if(this.graphic){let e=this.points[0],i=this.anchor(e).absolutePosition,s=this.options.r||0;if(i){let o=(0,g.defined)(this.options.yAxis)?this.chart.yAxis[this.options.yAxis]:void 0;o&&(0,g.defined)(e.y)&&(s=this.calculateAnnotationSize(e.y,s,o)),this.graphic[t?"animate":"attr"]({x:i.x,y:i.y,r:s})}else this.graphic.attr({x:0,y:-9e9});this.graphic.placed=!!i}super.redraw.call(this,t)}render(t){let e=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9e9,0).attr(e).add(t),super.render()}setRadius(t){this.options.r=t}}$.attrsMap=(0,g.merge)(V.attrsMap,{r:"r"});class _ extends X{constructor(t,e,i){super(t,e,i,"shape"),this.type="ellipse"}init(t,e,i){(0,g.defined)(e.yAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.yAxis=e.yAxis)}),(0,g.defined)(e.xAxis)&&e.points.forEach(t=>{t&&"string"!=typeof t&&(t.xAxis=e.xAxis)}),super.init(t,e,i)}render(t){this.graphic=this.annotation.chart.renderer.createElement("ellipse").attr(this.attrsFromOptions(this.options)).add(t),super.render()}translate(t,e){super.translateShape(t,e,!0)}getDistanceFromLine(t,e,i,s){return Math.abs((e.y-t.y)*i-(e.x-t.x)*s+e.x*t.y-e.y*t.x)/Math.sqrt((e.y-t.y)*(e.y-t.y)+(e.x-t.x)*(e.x-t.x))}getAttrs(t,e){let i=t.x,s=t.y,o=e.x,n=e.y,a=(i+o)/2,r=Math.sqrt((i-o)*(i-o)/4+(s-n)*(s-n)/4),h=180*Math.atan((n-s)/(o-i))/Math.PI;return a<i&&(h+=180),{cx:a,cy:(s+n)/2,rx:r,ry:this.getRY(),angle:h}}getRY(){let t=this.getYAxis();return(0,g.defined)(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 e=this.getAbsolutePosition(this.points[0]),i=this.getAbsolutePosition(this.points[1]),s=this.getAttrs(e,i);e?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=!!e}super.redraw(t)}setYRadius(t){let e=this.annotation.userOptions.shapes;this.options.ry=t,e&&e[0]&&(e[0].ry=t,e[0].ry=t)}}_.attrsMap=(0,g.merge)(V.attrsMap,{ry:"ry"});var G=d(984),K=d.n(G);let{format:Z}=K();function J(t,e,i,s,o){let n=o&&o.anchorX,a=o&&o.anchorY,r,h,l=i/2;return(0,g.isNumber)(n)&&(0,g.isNumber)(a)&&(r=[["M",n,a]],(h=e-a)<0&&(h=-s-h),h<i&&(l=n<t+i/2?h:i-h),a>e+s?r.push(["L",t+l,e+s]):a<e?r.push(["L",t+l,e]):n<t?r.push(["L",t,e+s/2]):n>t+i&&r.push(["L",t+i,e+s/2])),r||[]}class Q extends X{static alignedPosition(t,e){return{x:Math.round((e.x||0)+(t.x||0)+(e.width-(t.width||0))*(0,g.getAlignFactor)(t.align)),y:Math.round((e.y||0)+(t.y||0)+(e.height-(t.height||0))*(0,g.getAlignFactor)(t.verticalAlign))}}static compose(t){t.prototype.symbols.connector=J}static justifiedOptions(t,e,i,s){let o,n=i.align,a=i.verticalAlign,r=e.box?0:e.padding||0,h=e.getBBox(),l={align:n,verticalAlign:a,x:i.x,y:i.y,width:e.width,height:e.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,e,i){super(t,e,i,"label")}translatePoint(t,e){super.translatePoint(t,e,0)}translate(t,e){var i,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 i=t;t=e,e=i}(i=this.options).x||(i.x=0),(s=this.options).y||(s.y=0),this.options.x+=t,this.options.y+=e,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 e=this.options,i=this.attrsFromOptions(e),s=e.style,o=this.annotation.chart.options.chart,n=o.plotBackgroundColor||o.backgroundColor;if(this.graphic=this.annotation.chart.renderer.label("",0,-9999,e.shape,void 0,void 0,e.useHTML,void 0,"annotation-label").attr(i).add(t),!this.annotation.chart.styledMode){if(s?.color==="contrast"){let t=!e.shape||Q.shapesWithoutBackground.indexOf(e.shape)>-1||"none"===e.backgroundColor?n:e.backgroundColor;s.color=this.annotation.chart.renderer.getContrast("string"==typeof t?t:"string"==typeof n?n:"#ffffff")}this.graphic.css(e.style||{}).shadow(e.shadow)}this.graphic.labelrank=e.labelrank,super.render()}redraw(t){let e=this.options,i=this.text||e.format||e.text,s=this.graphic,o=this.points[0];if(!s)return void this.redraw(t);s.attr({text:i?Z(String(i),o,this.annotation.chart):e.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 e=super.anchor.apply(this,arguments),i=this.options.x||0,s=this.options.y||0;return e.absolutePosition.x-=i,e.absolutePosition.y-=s,e.relativePosition.x-=i,e.relativePosition.y-=s,e}position(t){let e=this.graphic,i=this.annotation.chart,s=i.tooltip,o=this.points[0],n=this.options,a=t.absolutePosition,r=t.relativePosition,h,l,c,p,d=o.series.visible&&I.prototype.isInsidePlot.call(o);if(e&&d){let{width:t=0,height:u=0}=e;n.distance&&s?h=s.getPosition.call({chart:i,distance:(0,g.pick)(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=Q.alignedPosition((0,g.extend)(n,{width:t,height:u}),l),"justify"===this.options.overflow&&(h=Q.alignedPosition(Q.justifiedOptions(i,e,n,h),l))),n.crop&&(c=h.x-i.plotLeft,p=h.y-i.plotTop,d=i.isInsidePlot(c,p)&&i.isInsidePlot(c+t,p+u))}return d?h:null}}Q.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"},Q.shapesWithoutBackground=["connector"];class tt extends X{constructor(t,e,i){super(t,e,i,"shape"),this.type="image",this.translate=super.translateShape}render(t){let e=this.attrsFromOptions(this.options),i=this.options;this.graphic=this.annotation.chart.renderer.image(i.src,0,-9e9,i.width,i.height).attr(e).add(t),this.graphic.width=i.width,this.graphic.height=i.height,super.render()}redraw(t){if(this.graphic){let e=this.anchor(this.points[0]),i=Q.prototype.position.call(this,e);i?this.graphic[t?"animate":"attr"]({x:i.x,y:i.y}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!i}super.redraw(t)}}tt.attrsMap={width:"width",height:"height",zIndex:"zIndex"};var te=d(660),ti=d.n(te);let ts=t=>`<?xml version="1.0" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 ${t} ${t}">`,to="#4B4B4D",tn={"close.svg":`${ts(32)} <polygon fill="${to}" points="24.308,8.756 23.248,7.695 16.002,14.941 8.757,7.695 7.695,8.754 14.941,16.001 7.696,23.246 8.755,24.308 16.002,17.061 23.247,24.307 24.308,23.248 17.062,16.001"/> </svg> `,"destroy.svg":`${ts(32)} <g> <rect x="12.75" y="14" fill="${to}" width="1.5" height="10"/> <rect x="17.75" y="14" fill="${to}" width="1.5" height="10"/> <path fill="${to}" d="M25.25,10.5c0-1.517-1.233-2.75-2.75-2.75h-3.25V7c0-1.24-1.01-2.25-2.25-2.25h-2 c-1.24,0-2.25,1.01-2.25,2.25v0.75H9.5c-1.517,0-2.75,1.233-2.75,2.75v1.751h2V27.25h14.5V12.251h2V10.5z M14.25,7 c0-0.413,0.337-0.75,0.75-0.75h2c0.413,0,0.75,0.337,0.75,0.75v0.75h-3.5V7z M21.75,25.75h-11.5V12.251h11.5V25.75z M23.75,10.751 H8.25V10.5c0-0.689,0.561-1.25,1.25-1.25h13c0.689,0,1.25,0.561,1.25,1.25V10.751z"/> </g> </svg> `,"edit.svg":`${ts(32)} <path fill="${to}" d="M22.125,3.814L5.817,20.122l-1.818,7.879l7.879-1.818L28.186,9.875L22.125,3.814z M26.064,9.875 l-1.439,1.439l-3.939-3.939l1.439-1.439L26.064,9.875z M10.186,22.875l9.939-9.939l1.439,1.439l-9.939,9.939L10.186,22.875z M7.686,20.375l9.939-9.939l1.439,1.439l-9.939,9.939L7.686,20.375z M18.686,9.375l0.939-0.939l3.939,3.939l-0.939,0.939 L18.686,9.375z M6.974,21.784l3.242,3.242l-4.215,0.973L6.974,21.784z"/> </svg> `},ta=(t,e,i)=>{let s,o=i[t];return"renderer"===e&&o?(o=encodeURIComponent(o),s=`url("data:image/svg+xml;charset=utf-8,${o}")`):s=e.startsWith("http")&&e.match(/\.(png|svg|jpe?g|gif)$/ig)?'url("'+e+'")':`url("${e}${t}")`,s},tr=class{constructor(t,e){this.iconsURL=e,this.container=this.createPopupContainer(t),this.closeButton=this.addCloseButton()}createPopupContainer(t,e="highcharts-popup highcharts-no-tooltip"){return(0,g.createElement)("div",{className:e},void 0,t)}addCloseButton(t="highcharts-popup-close"){let e=(0,g.createElement)("button",{className:t},void 0,this.container);return(0,g.createElement)("span",{className:"highcharts-icon"},{backgroundImage:ta("close.svg",this.iconsURL,tn)},e),["click","touchstart"].forEach(t=>{(0,g.addEvent)(e,t,this.closeButtonEvents.bind(this))}),(0,g.addEvent)(document,"keydown",t=>{"Escape"===t.code&&this.closeButtonEvents()}),e}closeButtonEvents(){this.closePopup()}showPopup(t="highcharts-annotation-toolbar"){let e=this.container,i=this.closeButton;this.type=void 0,e.innerHTML=ti().emptyHTML,e.className.indexOf(t)>=0&&(e.classList.remove(t),e.removeAttribute("style")),e.appendChild(i),e.style.display="block",e.style.height=""}closePopup(){this.container.style.display="none"}};var th=d(620),tl=d.n(th);let{doc:tc,isFirefox:tp}=m();function td(t,e,i,s,o,n){let a,r;if(!e)return;let h=this.addInput,l=this.lang;(0,g.objectEach)(s,(s,n)=>{a=""!==i?i+"."+n:n,(0,g.isObject)(s)&&(!(0,g.isArray)(s)||(0,g.isArray)(s)&&(0,g.isObject)(s[0])?((r=l[n]||n).match(/\d/g)||o.push([!0,r,t]),td.call(this,t,e,a,s,o,!1)):o.push([this,a,"annotation",t,s]))}),n&&((0,g.stableSort)(o,t=>t[1].match(/format/g)?-1:1),tp&&o.reverse(),o.forEach(t=>{!0===t[0]?(0,g.createElement)("span",{className:"highcharts-annotation-title"},void 0,t[2]).appendChild(tc.createTextNode(t[1])):(t[4]={value:t[4][0],type:t[4][1]},h.apply(t[0],t.splice(1)))}))}let{doc:tu}=m(),{seriesTypes:tg}=T();(n=h||(h={}))[n["params.algorithm"]=0]="params.algorithm",n[n["params.average"]=1]="params.average";let tm={"algorithm-pivotpoints":["standard","fibonacci","camarilla"],"average-disparityindex":["sma","ema","dema","tema","wma"]};function tf(t){let e=(0,g.createElement)("div",{className:"highcharts-popup-lhs-col"},void 0,t),i=(0,g.createElement)("div",{className:"highcharts-popup-rhs-col"},void 0,t);return(0,g.createElement)("div",{className:"highcharts-popup-rhs-col-wrapper"},void 0,i),{lhsCol:e,rhsCol:i}}function tv(t,e,i,s){let o=e.params||e.options.params;s.innerHTML=ti().emptyHTML,(0,g.createElement)("h3",{className:"highcharts-indicator-title"},void 0,s).appendChild(tu.createTextNode(tC(e,i).indicatorFullName)),(0,g.createElement)("input",{type:"hidden",name:"highcharts-type-"+i,value:i},void 0,s),tP.call(this,i,"series",t,s,e,e.linkedParent&&e.linkedParent.options.id),o.volumeSeriesID&&tP.call(this,i,"volume",t,s,e,e.linkedParent&&o.volumeSeriesID),tx.call(this,t,"params",o,i,s)}function ty(t,e,i,s){function o(e,i){let s=m.parentNode.children[1];tv.call(n,t,e,i,m),s&&(s.style.display="block"),l&&e.options&&(0,g.createElement)("input",{type:"hidden",name:"highcharts-id-"+i,value:e.options.id},void 0,m).setAttribute("highcharts-data-series-id",e.options.id)}let n=this,a=n.lang,r=e.querySelectorAll(".highcharts-popup-lhs-col")[0],h=e.querySelectorAll(".highcharts-popup-rhs-col")[0],l="edit"===i,c=l?t.series:t.options.plotOptions||{};if(!t&&c)return;let p,d=[];l||(0,g.isArray)(c)?(0,g.isArray)(c)&&(d=tw.call(this,c)):d=tk.call(this,c,s),(0,g.stableSort)(d,(t,e)=>{let i=t.indicatorFullName.toLowerCase(),s=e.indicatorFullName.toLowerCase();return i<s?-1:+(i>s)}),r.children[1]&&r.children[1].remove();let u=(0,g.createElement)("ul",{className:"highcharts-indicator-list"},void 0,r),m=h.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];if(d.forEach(t=>{let{indicatorFullName:e,indicatorType:i,series:s}=t;p=(0,g.createElement)("li",{className:"highcharts-indicator-list"},void 0,u);let n=(0,g.createElement)("button",{className:"highcharts-indicator-list-item",textContent:e},void 0,p);["click","touchstart"].forEach(t=>{(0,g.addEvent)(n,t,function(){o(s,i)})})}),d.length>0){let{series:t,indicatorType:e}=d[0];o(t,e)}else l||(ti().setElementHTML(m.parentNode.children[0],a.noFilterMatch||""),m.parentNode.children[1].style.display="none")}function tx(t,e,i,s,o){if(!t)return;let n=this.addInput;(0,g.objectEach)(i,(i,a)=>{let r=e+"."+a;if((0,g.defined)(i)&&r)if((0,g.isObject)(i)&&(n.call(this,r,s,o,{}),tx.call(this,t,r,i,s,o)),r in h){let n=tA.call(this,s,r,o);tE.call(this,t,e,n,s,a,i)}else"params.volumeSeriesID"===r||(0,g.isArray)(i)||n.call(this,r,s,o,{value:i,type:"number"})})}function tb(t,e){let i=this,s=e.querySelectorAll(".highcharts-popup-lhs-col")[0],o=this.lang.clearFilter,n=(0,g.createElement)("div",{className:"highcharts-input-wrapper"},void 0,s),a=function(e){ty.call(i,t,i.container,"add",e)},r=this.addInput("searchIndicators","input",n,{value:"",type:"text",htmlFor:"search-indicators",labelClassName:"highcharts-input-search-indicators-label"}),h=(0,g.createElement)("a",{textContent:o},void 0,n);r.classList.add("highcharts-input-search-indicators"),h.classList.add("clear-filter-button"),(0,g.addEvent)(r,"input",function(){a(this.value),this.value.length?h.style.display="inline-block":h.style.display="none"}),["click","touchstart"].forEach(t=>{(0,g.addEvent)(h,t,function(){r.value="",a(""),h.style.display="none"})})}function tA(t,e,i){let s=e.split("."),o=s[s.length-1],n="highcharts-"+e+"-type-"+t,a=this.lang;(0,g.createElement)("label",{htmlFor:n},null,i).appendChild(tu.createTextNode(a[o]||e));let r=(0,g.createElement)("select",{name:n,className:"highcharts-popup-field",id:"highcharts-select-"+e},null,i);return r.setAttribute("id","highcharts-select-"+e),r}function tE(t,e,i,s,o,n,a){"series"===e||"volume"===e?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)&&((0,g.defined)(n)||"volume"!==e||"column"!==t.type||(n=s.id),(0,g.createElement)("option",{value:s.id},void 0,i).appendChild(tu.createTextNode(o)))}):s&&o&&tm[o+"-"+s].forEach(t=>{(0,g.createElement)("option",{value:t},void 0,i).appendChild(tu.createTextNode(t))}),(0,g.defined)(n)&&(i.value=n)}function tk(t,e){let i,s=this.chart&&this.chart.options.lang,o=s&&s.navigation&&s.navigation.popup&&s.navigation.popup.indicatorAliases,n=new Map;return(0,g.objectEach)(t,(t,s)=>{let a=t&&t.options;if(t.params||a&&a.params){let{indicatorFullName:a,indicatorType:r}=tC(t,s);if(e){let s=RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),h=o&&o[r]&&o[r].join(" ")||"";(a.match(s)||h.match(s))&&(i={indicatorFullName:a,indicatorType:r,series:t},n.set(r.toLowerCase(),i))}else i={indicatorFullName:a,indicatorType:r,series:t},n.set(r.toLowerCase(),i)}}),Array.from(n.values())}function tw(t){let e=[];return t.forEach(t=>{t.is("sma")&&e.push({indicatorFullName:t.name,indicatorType:t.type,series:t})}),e}function tC(t,e){let i=t.options,s=tg[e]&&tg[e].prototype.nameBase||e.toUpperCase(),o=e;return i&&i.type&&(o=t.options.type,s=t.name),{indicatorFullName:s,indicatorType:o}}function tP(t,e,i,s,o,n){if(!i)return;let a=tA.call(this,t,e,s);tE.call(this,i,e,a,void 0,void 0,void 0,o),(0,g.defined)(n)&&(a.value=n)}let{doc:tO}=m();function tM(){let t=this.container;return(0,g.createElement)("div",{className:"highcharts-tab-item-content highcharts-no-mousewheel"},void 0,t)}function tN(t,e){let i=this.container,s=this.lang,o="highcharts-tab-item";0===e&&(o+=" highcharts-tab-disabled");let n=(0,g.createElement)("button",{className:o},void 0,i);return n.appendChild(tO.createTextNode(s[t+"Button"]||t)),n.setAttribute("highcharts-data-tab-type",t),n}function tB(){let t=this.container,e=t.querySelectorAll(".highcharts-tab-item"),i=t.querySelectorAll(".highcharts-tab-item-content");for(let t=0;t<e.length;t++)e[t].classList.remove("highcharts-tab-item-active"),i[t].classList.remove("highcharts-tab-item-show")}function tT(t,e){let i=this.container.querySelectorAll(".highcharts-tab-item-content");t.className+=" highcharts-tab-item-active",i[e].className+=" highcharts-tab-item-show"}function tS(t){let e=this;this.container.querySelectorAll(".highcharts-tab-item").forEach((i,s)=>{(0!==t||"edit"!==i.getAttribute("highcharts-data-tab-type"))&&["click","touchstart"].forEach(t=>{(0,g.addEvent)(i,t,function(){tB.call(e),tT.call(e,this,s)})})})}let{doc:tL}=m(),{getOptions:tI}=m();class tD extends tr{constructor(t,e,i){super(t,e),this.chart=i,this.lang=(tI().lang.navigation||{}).popup||{},(0,g.addEvent)(this.container,"mousedown",()=>{let t=i&&i.navigationBindings&&i.navigationBindings.activeAnnotation;if(t){t.cancelClick=!0;let e=(0,g.addEvent)(tL,"click",()=>{setTimeout(()=>{t.cancelClick=!1},0),e()})}})}addInput(t,e,i,s){let o=t.split("."),n=o[o.length-1],a=this.lang,r="highcharts-"+e+"-"+(0,g.pick)(s.htmlFor,n);if(n.match(/^\d+$/)||(0,g.createElement)("label",{htmlFor:r,className:s.labelClassName},void 0,i).appendChild(tL.createTextNode(a[n]||n)),"color"===s.type&&this.chart?.container)return this.createColorInput(t,r,s,i,this.chart.container);let h=(0,g.createElement)("input",{name:r,value:s.value,type:s.type,className:"highcharts-popup-field"},void 0,i);return h.setAttribute("highcharts-data-name",t),h}createColorInput(t,e,i,s,o){let{value:n,alpha:a}=function(t,e){let i=t=>("0"+Math.round(t).toString(16)).slice(-2).toUpperCase(),s=t=>{let[e,s,o,n]=tl().parse(t).rgba;return{value:"#"+i(e)+i(s)+i(o),alpha:n}};if(t.startsWith("rgb")||t.startsWith("rgba"))return s(t);if(t.startsWith("color")||t.startsWith("var")){let o=tL.createElement("span");o.style.setProperty("color",t),e.appendChild(o);let n=window.getComputedStyle(o).color;if(e.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 e=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:"#"+i(e)+i(s)+i(o),alpha:n}}}if(n.startsWith("rgb")||n.startsWith("rgba"))return s(n)}return{value:t,alpha:1}}(i.value||"",o),r=tl().parse(i.value||"").rgba[3],h=isNaN(r)?a:r,l=(0,g.createElement)("div",{className:"highcharts-popup-color-wrapper"},void 0,s),c=(0,g.createElement)("input",{type:"color",value:n,className:"highcharts-popup-field highcharts-popup-field-color"},void 0,l),p=(0,g.createElement)("input",{name:e,id:e,value:n,type:"text",className:"highcharts-popup-field highcharts-popup-field-text"},void 0,l);p.setAttribute("highcharts-data-name",t);let d=(0,g.createElement)("span",{className:"highcharts-popup-color-separator"},void 0,l),u=(0,g.createElement)("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),m=(0,g.createElement)("span",{className:"highcharts-popup-opacity-percent-suffix"},void 0,l);m.appendChild(tL.createTextNode(" %"));let f=(0,g.createElement)("input",{type:"range",value:String(Math.round(100*h)),className:"highcharts-popup-opacity-slider",min:"0",max:"100",step:"1"},void 0,s);f.style.setProperty("--highcharts-popup-opacity-track-color",n),f.style.setProperty("display","none");let v=()=>{let t=/^#[0-9A-Fa-f]{6}$/.test(p.value);d.style.display=t?"":"none",u.style.display=t?"":"none",m.style.display=t?"":"none"};v();let y=t=>{let e=t.target,i=(0,g.clamp)(Number(e.value),0,100);f.value=String(i),u.value=String(Math.round(i))},x=t=>{t.target===c?p.value=c.value.toUpperCase():c.value=p.value,f.style.setProperty("--highcharts-popup-opacity-track-color",c.value),v()};return(0,g.addEvent)(s,"mousedown",t=>{t.target!==u&&t.target!==f&&(f.style.display="none")}),(0,g.addEvent)(u,"focus",()=>{f.style.display=""}),(0,g.addEvent)(u,"input",y),(0,g.addEvent)(f,"input",y),(0,g.addEvent)(c,"input",x),(0,g.addEvent)(p,"input",x),l}closeButtonEvents(){if(this.chart){let t=this.chart.navigationBindings;(0,g.fireEvent)(t,"closePopup"),t&&t.selectedButtonElement&&(0,g.fireEvent)(t,"deselectButton",{button:t.selectedButtonElement})}else super.closeButtonEvents()}addButton(t,e,i,s,o){let n=(0,g.createElement)("button",void 0,void 0,t);return n.appendChild(tL.createTextNode(e)),o&&["click","touchstart"].forEach(t=>{(0,g.addEvent)(n,t,()=>{let t,e,n,a,r;return this.closePopup(),o((t=Array.prototype.slice.call(s.querySelectorAll("input")),e=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:i,linkedTo:n&&n.getAttribute("value")||"",fields:{}},t.forEach(t=>{let e=t.getAttribute("highcharts-data-name");if(t.getAttribute("highcharts-data-series-id"))r.seriesId=t.value;else if(e){let i=t.closest(".highcharts-popup-color-wrapper"),s=i?.querySelector(".highcharts-popup-opacity-percentage"),o=s?Number(s.value)/100:1;if(s){let i=tl().parse(t.value).rgba;r.fields[e]=Number.isNaN(i[0])?t.value:`rgba(${i[0]},${i[1]},${i[2]},${o})`}else r.fields[e]=t.value}else r.type=t.value}),e.forEach(t=>{let e=t.id;if("highcharts-select-series"!==e&&"highcharts-select-volume"!==e){let i=e.split("highcharts-select-")[1];r.fields[i]=t.value}}),a&&(r.fields["params.volumeSeriesID"]=a.getAttribute("value")||""),r))})}),n}showForm(t,e,i,s){e&&(this.showPopup(),"indicators"===t&&this.indicators.addForm.call(this,e,i,s),"annotation-toolbar"===t&&this.annotations.addToolbar.call(this,e,i,s),"annotation-edit"===t&&this.annotations.addForm.call(this,e,i,s),"flag"===t&&this.annotations.addForm.call(this,e,i,s,!0),this.type=t,this.container.style.height=this.container.offsetHeight+"px")}}(0,g.extend)(tD.prototype,{annotations:{addForm:function(t,e,i,s){if(!t)return;let o=this.container,n=this.lang,a=(0,g.createElement)("h2",{className:"highcharts-popup-main-title"},void 0,o);a.appendChild(tc.createTextNode(n[e.langKey]||e.langKey||"")),a=(0,g.createElement)("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},void 0,o);let r=(0,g.createElement)("div",{className:"highcharts-popup-bottom-row"},void 0,o);td.call(this,a,t,"",e,[],!0),this.addButton(r,s?n.addButton||"Add":n.saveButton||"Save",s?"add":"save",o,i)},addToolbar:function(t,e,i){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=(0,g.createElement)("p",{className:"highcharts-annotation-label"},void 0,o);r.setAttribute("aria-label","Annotation type"),r.appendChild(tc.createTextNode((0,g.pick)(s[e.langKey]||e.langKey,e.shapes&&e.shapes[0].type,"")));let h=this.addButton(o,s.editButton||"Edit","edit",o,()=>{n.call(this,"annotation-edit",t,e,i)});h.className+=" highcharts-annotation-edit-button",(0,g.createElement)("span",{className:"highcharts-icon"},{backgroundImage:ta("edit.svg",this.iconsURL,tn)},h),h=this.addButton(o,s.removeButton||"Remove","remove",o,i),h.className+=" highcharts-annotation-remove-button",(0,g.createElement)("span",{className:"highcharts-icon"},{backgroundImage:ta("destroy.svg",this.iconsURL,tn)},h)}},indicators:{addForm:function(t,e,i){let s,o=this.lang;if(!t)return;this.tabs.init.call(this,t);let n=this.container.querySelectorAll(".highcharts-tab-item-content");tf(n[0]),tb.call(this,t,n[0]),ty.call(this,t,n[0],"add"),s=n[0].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.addButton||"add","add",s,i),tf(n[1]),ty.call(this,t,n[1],"edit"),s=n[1].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(s,o.saveButton||"save","edit",s,i),this.addButton(s,o.removeButton||"remove","remove",s,i)},getAmount:function(){let t=0;return this.series.forEach(e=>{(e.params||e.options.params)&&t++}),t}},tabs:{init:function(t){if(!t)return;let e=this.indicators.getAmount.call(t),i=tN.call(this,"add");tN.call(this,"edit",e),tM.call(this),tM.call(this),tS.call(this,e),tT.call(this,i,0)}}});let{composed:tY}=m();function tX(){this.popup&&this.popup.closePopup()}function tF(t){this.popup||(this.popup=new tD(this.chart.container,this.chart.options.navigation.iconsURL||this.chart.options.stockTools&&this.chart.options.stockTools.gui.iconsURL||"renderer",this.chart)),this.popup.showForm(t.formType,this.chart,t.options,t.onSubmit)}function tR(t,e){this.inClass(e.target,"highcharts-popup")||t.apply(this,Array.prototype.slice.call(arguments,1))}let tU=function(t,e){(0,g.pushUnique)(tY,"Popup")&&((0,g.addEvent)(t,"closePopup",tX),(0,g.addEvent)(t,"showPopup",tF),(0,g.wrap)(e.prototype,"onContainerMouseDown",tR))},{defaultOptions:tW}=m();function tj(t,e){let i={};return["labels","shapes"].forEach(s=>{let o=t[s],n=e[s];o&&(n?i[s]=(0,g.splat)(n).map((t,e)=>(0,g.merge)(o[e],t)):i[s]=t[s])}),i}class tH extends P{static compose(t,e,i,s){E.compose(tH,t,i),Q.compose(s),V.compose(t,s),e.compose(tH,t),tU(e,i)}constructor(t,e){super(),this.coll="annotations",this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.index=-1,this.labels=[],this.shapes=[],this.setOptions(e),this.userOptions=e;const i=tj(this.options,e);this.options.labels=i.labels,this.options.shapes=i.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((e,i)=>{let s=this.initLabel(e,i);(0,g.merge)(!0,t[i],s.options)})}addShapes(){let t=this.options.shapes||[];t.forEach((e,i)=>{let s=this.initShape(e,i);(0,g.merge)(!0,t[i],s.options)})}destroy(){let t=this.chart,e=function(t){t.destroy()};this.labels.forEach(e),this.shapes.forEach(e),this.clipXAxis=null,this.clipYAxis=null,(0,g.erase)(t.labelCollectors,this.labelCollector),super.destroy(),this.destroyControlTarget(),(0,g.destroyObjectProperties)(this,t)}destroyItem(t){(0,g.erase)(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,e){this.setOptions(e);let i=tj(this.options,e);this.options.labels=i.labels,this.options.shapes=i.shapes,this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.userOptions=e,this.labels=[],this.shapes=[]}init(t,e,i=this.index){let s=this.chart,o=this.options.animation;this.index=i,this.linkPoints(),this.addControlPoints(),this.addShapes(),this.addLabels(),this.setLabelCollector(),this.animationConfig=(0,g.getDeferredAnimation)(s,o)}initLabel(t,e){this.options.labelOptions?.align;let i=new Q(this,(0,g.merge)(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},t),e);return i.itemType="label",this.labels.push(i),i}initShape(t,e){let i=(0,g.merge)(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},t),s=new tH.shapesMap[i.type||"rect"](this,i,e);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,e){if(t.linkPoints(),t.shouldBeDrawn()){let i,s;t.graphic||this.renderItem(t),t.redraw((0,g.pick)(e,!0)&&t.graphic.placed),t.points.length&&(i=t.graphic,s=t.points.some(t=>!1!==t.series.visible&&!1!==t.visible),i&&(s?"hidden"===i.visibility&&i.show():i.hide()))}else this.destroyItem(t)}redrawItems(t,e){let i=t.length;for(;i--;)this.redrawItem(t[i],e)}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 e=t.length;for(;e--;)this.renderItem(t[e])}setClipAxes(){let t=this.chart.xAxis,e=this.chart.yAxis,i=[...this.options.labels??[],...this.options.shapes??[]].reduce((i,s)=>{let o=s&&(s.point||"points"in s&&s.points?.[0]);return[t[o&&o.xAxis]||i[0],e[o&&o.yAxis]||i[1]]},[]);this.clipXAxis=i[0],this.clipYAxis=i[1]}setControlPointsVisibility(t){let e=function(e){e.setControlPointsVisibility(t)};this.controlPoints.forEach(e=>{e.setVisibility(t)}),this.shapes.forEach(e),this.labels.forEach(e)}setLabelCollector(){let t=this;t.labelCollector=function(){return t.labels.reduce(function(t,e){return e.options.allowOverlap||t.push(e.graphic),t},[])},t.chart.labelCollectors.push(t.labelCollector)}setOptions(t){var e;this.opti