apexcharts 8.3.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +20039 -19931
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +3 -8
  6. package/dist/apexcharts.esm.js +950 -574
  7. package/dist/apexcharts.full.js +23401 -22504
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21723 -21287
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21758 -21242
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +118 -65
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +404 -218
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +379 -205
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +118 -65
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +379 -205
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +404 -218
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +20034 -19926
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +106 -11
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +404 -218
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +282 -184
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +137 -124
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +31 -15
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +206 -119
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +1 -1
  63. package/dist/features/keyboard.esm.js +1 -1
  64. package/dist/features/keyboard.js +1 -1
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +52 -28
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +27 -14
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +35 -21
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +160 -55
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +78 -28
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +876 -543
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +2 -2
  105. package/dist/features/waterfall.esm.js +14 -25
  106. package/dist/features/waterfall.js +2 -2
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1893 -1342
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +38 -54
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +455 -276
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +156 -91
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +118 -65
  122. package/dist/line.js +2 -2
  123. package/dist/pictograms.common.js +2 -2
  124. package/dist/pictograms.esm.js +2 -2
  125. package/dist/pictograms.js +2 -2
  126. package/dist/pie.common.js +2 -2
  127. package/dist/pie.esm.js +106 -11
  128. package/dist/pie.js +2 -2
  129. package/dist/polarArea.common.js +2 -2
  130. package/dist/polarArea.esm.js +106 -11
  131. package/dist/radar.common.js +2 -2
  132. package/dist/radar.esm.js +23 -9
  133. package/dist/radar.js +2 -2
  134. package/dist/radialBar.common.js +2 -2
  135. package/dist/radialBar.esm.js +108 -14
  136. package/dist/radialBar.js +2 -2
  137. package/dist/raincloud.common.js +2 -2
  138. package/dist/raincloud.esm.js +39 -31
  139. package/dist/rangeArea.common.js +2 -2
  140. package/dist/rangeArea.esm.js +118 -65
  141. package/dist/rangeBar.common.js +2 -2
  142. package/dist/rangeBar.esm.js +404 -218
  143. package/dist/scatter.common.js +2 -2
  144. package/dist/scatter.esm.js +118 -65
  145. package/dist/streamgraph.common.js +2 -2
  146. package/dist/streamgraph.esm.js +276 -118
  147. package/dist/sunburst.common.js +2 -2
  148. package/dist/sunburst.esm.js +333 -116
  149. package/dist/sunburst.js +2 -2
  150. package/dist/treemap.common.js +2 -2
  151. package/dist/treemap.esm.js +155 -124
  152. package/dist/treemap.js +2 -2
  153. package/dist/unit-shapes.common.js +2 -2
  154. package/dist/unit-shapes.esm.js +2 -2
  155. package/dist/unit-shapes.js +2 -2
  156. package/dist/unit.common.js +2 -2
  157. package/dist/unit.esm.js +29 -27
  158. package/dist/unit.js +2 -2
  159. package/dist/violin.common.js +2 -2
  160. package/dist/violin.esm.js +14 -5
  161. package/dist/violin.js +2 -2
  162. package/dist/waterfall.common.js +2 -2
  163. package/dist/waterfall.esm.js +417 -242
  164. package/package.json +1 -1
  165. package/src/apexcharts.js +37 -60
  166. package/src/assets/apexcharts.css +3 -8
  167. package/src/charts/Bar.js +30 -12
  168. package/src/charts/BarStacked.js +10 -4
  169. package/src/charts/BoxCandleStick.js +8 -2
  170. package/src/charts/Icicle.js +60 -76
  171. package/src/charts/Line.js +58 -22
  172. package/src/charts/Pie.js +136 -14
  173. package/src/charts/Radar.js +6 -9
  174. package/src/charts/Radial.js +2 -6
  175. package/src/charts/RangeBar.js +13 -13
  176. package/src/charts/Scatter.js +5 -7
  177. package/src/charts/Sunburst.js +157 -135
  178. package/src/charts/Treemap.js +100 -56
  179. package/src/charts/common/Breadcrumb.js +37 -16
  180. package/src/charts/common/PreviousPaths.js +45 -0
  181. package/src/charts/common/Stats.js +30 -23
  182. package/src/charts/common/bar/DataLabels.js +85 -77
  183. package/src/charts/common/bar/Helpers.js +144 -56
  184. package/src/charts/common/line/Helpers.js +8 -11
  185. package/src/charts/common/partition/NodeTooltip.js +62 -22
  186. package/src/charts/common/partition/Partition.js +64 -19
  187. package/src/charts/common/partition/Tint.js +6 -3
  188. package/src/charts/common/partition/Transitions.js +108 -0
  189. package/src/charts/common/treemap/ColorScale.js +30 -14
  190. package/src/charts/common/treemap/Helpers.js +47 -68
  191. package/src/charts/common/treemap/Nested.js +2 -3
  192. package/src/features/raincloud.js +16 -10
  193. package/src/features/stats.js +67 -62
  194. package/src/modules/Animations.js +102 -95
  195. package/src/modules/AxisMapping.js +47 -12
  196. package/src/modules/Base.js +12 -14
  197. package/src/modules/CoreUtils.js +26 -46
  198. package/src/modules/Data.js +82 -55
  199. package/src/modules/DataLabels.js +14 -13
  200. package/src/modules/Exports.js +44 -19
  201. package/src/modules/Fill.js +17 -8
  202. package/src/modules/Filters.js +50 -50
  203. package/src/modules/Graphics.js +65 -84
  204. package/src/modules/Markers.js +57 -58
  205. package/src/modules/MorphPieces.js +16 -10
  206. package/src/modules/MorphTypeChange.js +21 -9
  207. package/src/modules/Range.js +32 -55
  208. package/src/modules/RendererController.js +4 -4
  209. package/src/modules/Responsive.js +5 -1
  210. package/src/modules/Scales.js +24 -15
  211. package/src/modules/Series.js +85 -73
  212. package/src/modules/Toolbar.js +3 -2
  213. package/src/modules/UnitLayoutRegistry.js +8 -5
  214. package/src/modules/UnitMarkRegistry.js +7 -10
  215. package/src/modules/ZoomPanSelection.js +4 -0
  216. package/src/modules/animations/AxisTransition.js +11 -4
  217. package/src/modules/animations/DataLabelTransition.js +30 -15
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LayoutTransition.js +43 -32
  220. package/src/modules/animations/LengthTransition.js +176 -84
  221. package/src/modules/annotations/Helpers.js +68 -52
  222. package/src/modules/axes/AxesUtils.js +14 -12
  223. package/src/modules/axes/Grid.js +21 -7
  224. package/src/modules/axes/XAxis.js +4 -4
  225. package/src/modules/axes/YAxis.js +12 -13
  226. package/src/modules/dimensions/Dimensions.js +9 -3
  227. package/src/modules/dimensions/Grid.js +2 -2
  228. package/src/modules/dimensions/XAxis.js +2 -5
  229. package/src/modules/drilldown/Breadcrumb.js +11 -53
  230. package/src/modules/drilldown/Drilldown.js +151 -95
  231. package/src/modules/helpers/InitCtxVariables.js +2 -1
  232. package/src/modules/helpers/UpdateHelpers.js +165 -15
  233. package/src/modules/helpers/XKey.js +56 -0
  234. package/src/modules/highlightFilter/HighlightFilter.js +98 -49
  235. package/src/modules/highlightFilter/PiePart.js +6 -3
  236. package/src/modules/highlightFilter/RadialPart.js +41 -7
  237. package/src/modules/highlightFilter/TreemapPart.js +71 -44
  238. package/src/modules/highlightFilter/util.js +23 -7
  239. package/src/modules/legend/Helpers.js +6 -1
  240. package/src/modules/legend/Legend.js +39 -13
  241. package/src/modules/license/LicenseEnforcer.js +5 -0
  242. package/src/modules/settings/Defaults.js +62 -106
  243. package/src/modules/settings/Globals.js +5 -0
  244. package/src/modules/settings/Options.js +0 -7
  245. package/src/modules/settings/TypeAliases.js +33 -16
  246. package/src/modules/streamgraph/StreamData.js +81 -35
  247. package/src/modules/streamgraph/StreamLabels.js +44 -17
  248. package/src/modules/tooltip/Labels.js +80 -80
  249. package/src/modules/tooltip/Marker.js +25 -21
  250. package/src/modules/tooltip/Position.js +88 -51
  251. package/src/modules/tooltip/Tooltip.js +229 -253
  252. package/src/modules/tooltip/Utils.js +64 -131
  253. package/src/modules/tooltip/constants.js +5 -5
  254. package/src/modules/trellis/Trellis.js +402 -248
  255. package/src/modules/trellis/TrellisChrome.js +110 -44
  256. package/src/modules/trellis/TrellisExports.js +48 -13
  257. package/src/modules/trellis/TrellisFrames.js +11 -15
  258. package/src/modules/trellis/TrellisScales.js +201 -115
  259. package/src/modules/trellis/TrellisSplit.js +72 -36
  260. package/src/modules/trellis/TrellisSync.js +41 -13
  261. package/src/modules/trellis/TrellisTooltip.js +101 -78
  262. package/src/modules/trellis/pivotRows.js +20 -6
  263. package/src/modules/waterfall/WaterfallData.js +14 -30
  264. package/src/modules/weave/WeaveHost.js +18 -12
  265. package/src/pictograms/registry.js +2 -1
  266. package/src/renderers/Renderer.js +41 -37
  267. package/src/renderers/canvas/CanvasCompositor.js +4 -1
  268. package/src/renderers/canvas/CanvasGraphics.js +56 -24
  269. package/src/ssr/RenderShim.js +129 -20
  270. package/src/svg/SVGContainer.js +3 -2
  271. package/src/svg/SVGFilter.js +26 -17
  272. package/src/types/internal.d.ts +8 -6
  273. package/src/unit-shapes/registry.js +3 -1
  274. package/src/utils/DateTime.js +5 -20
  275. package/src/utils/Utils.js +0 -14
  276. package/src/utils/nameAsHtml.js +16 -0
  277. package/types/apexcharts.d.ts +72 -13
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const o in t)if("default"!==o){const a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>t[o]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),o=e.__apex_Graphics,a=e.__apex_Utils,n=e.__apex_CoreUtils,i=e.__apex_Animations_applyProgressiveReveal;class s{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var o,a;const n=this.w;if("vertical"===t.label.orientation){const i=null!==e?e:0,s=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${i}']`);if(null!==s){const e=s.getBBox();s.setAttribute("x",String(parseFloat(null!=(o=s.getAttribute("x"))?o:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;s.setAttribute("y",String(parseFloat(null!=(a=s.getAttribute("y"))?a:"0")+n));const{x:i,y:l}=this.annoCtx.graphics.rotateAroundCenter(s);s.setAttribute("transform",`rotate(-90 ${i} ${l})`)}}}addBackgroundToAnno(t,e){const o=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const a=o.dom.baseEl.querySelector(".apexcharts-grid");if(!a)return null;const n=a.getBoundingClientRect(),i=a.getBBox(),s=n.width/i.width||1,l=t.getBoundingClientRect();let{left:r,right:d,top:h,bottom:c}=e.label.style.padding;"vertical"===e.label.orientation&&([h,c,r,d]=[r,d,h,c]);const x=n.left-i.x*s,p=n.top-i.y*s,g=(l.left-x)/s-r,f=(l.top-p)/s-h,b=this.annoCtx.graphics.drawRect(g,f,l.width/s+r+d,l.height/s+h+c,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&b.node.classList.add(e.id),b}annotationsBackground(){const t=this.w,e=(e,o,a)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${o}']`);if(n){const o=n.parentNode,a=this.addBackgroundToAnno(n,e);if(a){null==o||o.insertBefore(a.node,n);const s=n.getAttribute("x");null!==s&&i(a,parseFloat(s),t),e.label.mouseEnter&&a.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&a.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&a.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,o)=>e(t,o,"xaxis")),t.config.annotations.yaxis.forEach((t,o)=>e(t,o,"yaxis")),t.config.annotations.points.forEach((t,o)=>e(t,o,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?a.isNumber(t.globals.minY)&&a.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:a.isNumber(t.globals.minX)&&a.isNumber(t.globals.xRange)}getY1Y2(t,e){var o,a,i;const s=this.w,l="y1"===t?e.y:e.y2,r="string"==typeof l&&l.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=s.config.xaxis.convertedCatToNumeric?s.labelData.categoryLabels:s.labelData.labels,a=t.indexOf(l);if(!r&&-1===a)return{yP:0,clipped:!0};const n=s.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${a+1})`);d=n?parseFloat(null!=(o=n.getAttribute("y"))?o:"0"):(s.layout.gridHeight/t.length-1)*(a+1)-s.globals.barHeight,void 0!==e.seriesIndex&&s.globals.barHeight&&(d+=this.barSlotOffset(e.seriesIndex,s.globals.barHeight))}else{if(!s.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=s.globals.seriesYAxisMap[e.yAxisIndex],o=null!=(a=null==t?void 0:t[0])?a:null;if(null===o&&s.seriesData.series.length)return{yP:0,clipped:!0};const r=null===o?s.globals.minY:s.globals.minYArr[o],c=null===o?s.globals.maxY-s.globals.minY:s.globals.yRange[o],x=s.config.yaxis[e.yAxisIndex].logarithmic&&null!==o?new n(this.w).getLogVal(s.config.yaxis[e.yAxisIndex].logBase,l,o)/s.globals.yLogRatio[o]:(l-r)/(c/s.layout.gridHeight);d=s.layout.gridHeight-Math.min(Math.max(x,0),s.layout.gridHeight),h=x>s.layout.gridHeight||x<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(i=s.config.yaxis[e.yAxisIndex])?void 0:i.reversed)&&(d=x)}return r&&(d=parseFloat(l)),{yP:d,clipped:h}}getX1X2(t,e){const o=this.w,a="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?o.globals.minY:o.globals.minX,i=this.annoCtx.invertAxis?o.globals.maxY:o.globals.maxX,s=this.annoCtx.invertAxis?o.globals.yRange[0]:o.globals.xRange;let l=!1;const r="string"==typeof a&&a.includes("px"),d=null==a&&e.marker;if(!r&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(i-a)/(s/o.layout.gridWidth):(a-n)/(s/o.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(a)),"string"==typeof a&&a.includes("px")&&(h=parseFloat(a)),null==a&&e.marker&&(h=o.layout.gridWidth),void 0!==e.seriesIndex&&o.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,o.globals.barWidth)),"number"!=typeof h&&(h=0,l=!0),parseFloat(h.toFixed(10))>parseFloat(o.layout.gridWidth.toFixed(10))?(h=o.layout.gridWidth,l=!0):h<0&&(h=0,l=!0),{x:h,clipped:l}}barSlotOffset(t,e){const o=this.w;if(o.config.chart.stacked)return 0;let a=0,n=0;return o.seriesData.series.forEach((e,i)=>{var s;const l=null==(s=o.config.series[i])?void 0:s.type;!e.length||o.globals.comboCharts&&"bar"!==l&&"column"!==l||(i<t&&n++,a++)}),e*(n-(a-1)/2)}getStringX(t){var e;const o=this.w;let a=t;if(o.config.xaxis.convertedCatToNumeric&&o.labelData.categoryLabels.length){const e=String(t);t=o.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=o.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),i=o.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return i?a=parseFloat(null!=(e=i.getAttribute("x"))?e:"0"):n>-1&&(a=o.axisFlags.isXNumeric?(t-o.globals.minX)/(o.globals.xRange/o.layout.gridWidth):o.globals.padHorizontal+(n+.5)*o.layout.gridWidth/o.globals.dataPoints),a}}class l{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new s(this.annoCtx)}addXaxisAnnotation(t,e,o){const n=this.w,s=this.helpers.getX1X2("x1",t);let l=s.x;const r=s.clipped;let d,h=!0;const c=t.label.text,x=t.strokeDashArray;if(a.isNumber(l)){if(null===t.x2||void 0===t.x2){if(!r){const o=this.annoCtx.graphics.drawLine(l+t.offsetX,0+t.offsetY,l+t.offsetX,n.layout.gridHeight+t.offsetY,t.borderColor,x,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id),i(o,l+t.offsetX,n)}}else{const o=this.helpers.getX1X2("x2",t);if(d=o.x,h=o.clipped,d<l){const t=l;l=d,d=t}const a=this.annoCtx.graphics.drawRect(l+t.offsetX,0+t.offsetY,d-l,n.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,x);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),i(a,l+t.offsetX,n)}if(!r||!h){const a=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),s="top"===t.label.position?4:"center"===t.label.position?n.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):n.layout.gridHeight,r=this.annoCtx.graphics.drawText({x:l+t.label.offsetX,y:s+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:o}),e.appendChild(r.node),i(r,l+t.label.offsetX,n),this.annoCtx.helpers.setOrientations(t,o)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,o)=>{this.addXaxisAnnotation(t,e.node,o)}),e}}const r=e.__apex_axes_AxesUtils;class d{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx),this.axesUtils=new r(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,o){const a=this.w,n=t.strokeDashArray;let i=this.helpers.getY1Y2("y1",t),s=i.yP;const l=i.clipped;let r,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!l){h=!0;const o=this.annoCtx.graphics.drawLine(0+t.offsetX,s+t.offsetY,this._getYAxisAnnotationWidth(t),s+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}else{if(i=this.helpers.getY1Y2("y2",t),r=i.yP,d=i.clipped,r>s){const t=s;s=r,r=t}if(!l||!d){h=!0;const o=this.annoCtx.graphics.drawRect(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),s-r,0,t.fillColor,t.opacity,1,t.borderColor,n);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?a.layout.gridWidth:"center"===t.label.position?a.layout.gridWidth/2:0,i=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=r?r:s)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});i.attr({rel:o}),e.appendChild(i.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let o=e.layout.gridWidth;return o=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),o+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,o)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,o)}),e}}const h=e.__apex_BrowserAPIs_BrowserAPIs;class c{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx)}addPointAnnotation(t,e,o){const n=this.w;if(n.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const s=this.helpers.getX1X2("x1",t),l=s.x,r=s.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(a.isNumber(l)&&!c&&!r){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let s=this.annoCtx.graphics.drawMarker(l+t.marker.offsetX,h+t.marker.offsetY,a);e.appendChild(s.node);const r=[s.node];i(s,l,n);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,l+t.label.offsetX,t.label),x=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(x.attr({rel:o}),e.appendChild(x.node),i(x,l,n),t.customSVG.SVG){const o=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});o.attr({transform:`translate(${l+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),o.node.innerHTML=t.customSVG.SVG,e.appendChild(o.node),r.push(o.node)}if(t.image.path){const e=t.image.width?t.image.width:20,o=t.image.height?t.image.height:20;s=this.annoCtx.addImage({x:l+t.image.offsetX-e/2,y:h+t.image.offsetY-o/2,width:e,height:o,path:t.image.path,appendTo:".apexcharts-point-annotations"}),r.push(s.node)}t.tooltip&&t.tooltip.enabled&&r.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&s.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&s.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&s.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,o){const a=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,o.style.fontSize,o.style.fontFamily,void 0,!0,o.style.fontWeight);let i,s;switch(o.textAnchor){case"start":i=e,s=e+n;break;case"end":i=e-n,s=e;break;default:i=e-n/2,s=e+n/2}const l=o.style.padding||{};return i-=l.left||0,s+=l.right||0,i<0?e-i:s>a.layout.gridWidth?e-(s-a.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=h.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,o=t.tooltip||{};if("function"==typeof o.formatter)return o.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let a=null!=o.text?o.text:t.label&&t.label.text;return Array.isArray(a)&&(a=a.join("<br/>")),null==a?"":String(a)}showPointTooltip(t,e){const o=this.w,a=this.getPointTooltipContent(t);if(!a)return;const n=this.getPointTooltipEl();n.innerHTML=a;const i=t.tooltip.theme||o.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${i}`),n.classList.add("apexcharts-active");const s=o.dom.elWrap.getBoundingClientRect(),l=e.getBoundingClientRect(),r=n.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=l.left-s.left+l.width/2-r.width/2,x=l.top-s.top-r.height-10;c=Math.max(0,Math.min(c,s.width-r.width)),x<0&&(x=l.top-s.top+l.height+10),n.style.left=c+d+"px",n.style.top=x+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,o)=>{this.addPointAnnotation(t,e.node,o)}),e}}const x=e.__apex_Options;e.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:a=null}={}){this.w=t,this.theme=e,this.timeScale=a,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new o(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new s(this),this.xAxisAnnotations=new l(this),this.yAxisAnnotations=new d(this),this.pointsAnnotations=new c(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),o=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,i=[e,o,a],s=[o.node,e.node,a.node],l="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,r=[l,!1,l];for(let e=0;e<3;e++)t.dom.elGraphical.add(i[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!r[e]&&s[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:s[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,o){this.xAxisAnnotations.addXaxisAnnotation(t,e,o)}addYaxisAnnotation(t,e,o){this.yAxisAnnotations.addYaxisAnnotation(t,e,o)}addPointAnnotation(t,e,o){this.pointsAnnotations.addPointAnnotation(t,e,o)}addText(t){const{x:e,y:o,text:a,textAnchor:n,foreColor:i,fontSize:s,fontFamily:l,fontWeight:r,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:x,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:b=4,paddingRight:u=4,paddingBottom:y=2,paddingTop:m=2}=t,A=this.w,w=A.dom.baseEl.querySelector(f);if(!w)return;const C=this.graphics.drawText({x:e,y:o,text:a,textAnchor:n||"start",fontSize:s||"12px",fontWeight:r||"regular",fontFamily:l||A.config.chart.fontFamily,foreColor:i||A.config.chart.foreColor,cssClass:d||""});w.appendChild(C.node);const v=C.bbox();if(a){const t=this.graphics.drawRect(v.x-b,v.y-m,v.width+b+u,v.height+y+m,p,h||"transparent",1,c,g,x);w.insertBefore(t.node,C.node)}}addImage(t){const e=this.w,{path:o,x:a=0,y:n=0,width:i=20,height:s=20,appendTo:l=".apexcharts-svg"}=t,r=e.dom.Paper.image(o);r.size(i,s).move(a,n);const d=e.dom.baseEl.querySelector(l);return d&&d.appendChild(r.node),r}addXaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"xaxis",contextMethod:o.addXaxisAnnotation}),o}addYaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"yaxis",contextMethod:o.addYaxisAnnotation}),o}addPointAnnotationExternal(t,e,o){return void 0===this.invertAxis&&(this.invertAxis=o.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"point",contextMethod:o.addPointAnnotation}),o}addAnnotationExternal({params:t,pushToMemory:e,context:o,type:n,contextMethod:i}){var s;const l=o,r=l.w,d=r.dom.baseEl.querySelector(`.apexcharts-${n}-annotations`),h=((null==(s=r.config.annotations["point"===n?"points":n])?void 0:s.length)||0)+d.childNodes.length,c=new x,p=Object.assign({},"xaxis"===n?c.xAxisAnnotation:"yaxis"===n?c.yAxisAnnotation:c.pointAnnotation),g=a.extend(p,t);switch(n){case"xaxis":this.addXaxisAnnotation(g,d,h);break;case"yaxis":this.addYaxisAnnotation(g,d,h);break;case"point":this.addPointAnnotation(g,d,h)}const f=r.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${h}']`),b=this.helpers.addBackgroundToAnno(f,g);return b&&d.insertBefore(b.node,f),e&&r.globals.memory.methodsToExec.push({context:l,id:g.id?g.id:a.randomId(),method:i,label:"addAnnotation",params:t}),o}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const o=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(o,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const o=t.w;this._removeAnnotationTooltip(o);const a=o.dom.baseEl.querySelectorAll(`.${e}`);a&&(o.globals.memory.methodsToExec=o.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(o.config.annotations).forEach(t=>{const a=o.config.annotations[t];Array.isArray(a)&&(o.config.annotations[t]=a.filter(t=>t.id!==e))}),Array.prototype.forEach.call(a,t=>{t.parentElement.removeChild(t)}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
5
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const o in t)if("default"!==o){const a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>t[o]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),o=e.__apex_Graphics,a=e.__apex_Utils,n=e.__apex_CoreUtils,i=e.__apex_Animations_applyProgressiveReveal;class s{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var o,a;const n=this.w;if("vertical"===t.label.orientation){const i=null!==e?e:0,s=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${i}']`);if(null!==s){const e=s.getBBox();s.setAttribute("x",String(parseFloat(null!=(o=s.getAttribute("x"))?o:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;s.setAttribute("y",String(parseFloat(null!=(a=s.getAttribute("y"))?a:"0")+n));const{x:i,y:l}=this.annoCtx.graphics.rotateAroundCenter(s);s.setAttribute("transform",`rotate(-90 ${i} ${l})`)}}}addBackgroundToAnno(t,e,o){const a=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const n=a.dom.baseEl.querySelector(".apexcharts-grid");if(!n)return null;const i=n.getBoundingClientRect(),s=n.getBBox(),l=i.width/s.width||1,r=t.getBoundingClientRect();let{left:d,right:h,top:c,bottom:x}=e.label.style.padding;"vertical"===e.label.orientation&&([c,x,d,h]=[d,h,c,x]);const p=i.left-s.x*l,g=i.top-s.y*l,f=(r.left-p)/l-d,b=(r.top-g)/l-c,u=()=>{const t=this.annoCtx.graphics.drawRect(f,b,r.width/l+d+h,r.height/l+c+x,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&t.node.classList.add(e.id),t};return o?u:u()}annotationsBackground(){const t=this.w,e=[],o=(o,a,n)=>{const s=t.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${a}']`),l=this.addBackgroundToAnno(s,o,!0);l&&e.push(()=>{const e=l(),a=s.parentNode;null==a||a.insertBefore(e.node,s);const n=s.getAttribute("x");null!==n&&i(e,parseFloat(n),t),o.label.mouseEnter&&e.node.addEventListener("mouseenter",o.label.mouseEnter.bind(this,o)),o.label.mouseLeave&&e.node.addEventListener("mouseleave",o.label.mouseLeave.bind(this,o)),o.label.click&&e.node.addEventListener("click",o.label.click.bind(this,o))})};t.config.annotations.xaxis.forEach((t,e)=>o(t,e,"xaxis")),t.config.annotations.yaxis.forEach((t,e)=>o(t,e,"yaxis")),t.config.annotations.points.forEach((t,e)=>o(t,e,"point")),e.forEach(t=>t())}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?a.isNumber(t.globals.minY)&&a.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:a.isNumber(t.globals.minX)&&a.isNumber(t.globals.xRange)}getY1Y2(t,e){var o,a,i;const s=this.w,l="y1"===t?e.y:e.y2,r="string"==typeof l&&l.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=s.config.xaxis.convertedCatToNumeric?s.labelData.categoryLabels:s.labelData.labels,a=t.indexOf(l);if(!r&&-1===a)return{yP:0,clipped:!0};const n=s.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${a+1})`);d=n?parseFloat(null!=(o=n.getAttribute("y"))?o:"0"):(s.layout.gridHeight/t.length-1)*(a+1)-s.globals.barHeight,void 0!==e.seriesIndex&&s.globals.barHeight&&(d+=this.barSlotOffset(e.seriesIndex,s.globals.barHeight))}else{if(!s.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=s.globals.seriesYAxisMap[e.yAxisIndex],o=null!=(a=null==t?void 0:t[0])?a:null;if(null===o&&s.seriesData.series.length)return{yP:0,clipped:!0};const r=null===o?s.globals.minY:s.globals.minYArr[o],c=null===o?s.globals.maxY-s.globals.minY:s.globals.yRange[o],x=s.config.yaxis[e.yAxisIndex].logarithmic&&null!==o?new n(this.w).getLogVal(s.config.yaxis[e.yAxisIndex].logBase,l,o)/s.globals.yLogRatio[o]:(l-r)/(c/s.layout.gridHeight);d=s.layout.gridHeight-Math.min(Math.max(x,0),s.layout.gridHeight),h=x>s.layout.gridHeight||x<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(i=s.config.yaxis[e.yAxisIndex])?void 0:i.reversed)&&(d=x)}return r&&(d=parseFloat(l)),{yP:d,clipped:h}}getX1X2(t,e){const o=this.w,a="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?o.globals.minY:o.globals.minX,i=this.annoCtx.invertAxis?o.globals.maxY:o.globals.maxX,s=this.annoCtx.invertAxis?o.globals.yRange[0]:o.globals.xRange;let l=!1;const r="string"==typeof a&&a.includes("px"),d=null==a&&e.marker;if(!r&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(i-a)/(s/o.layout.gridWidth):(a-n)/(s/o.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(a)),"string"==typeof a&&a.includes("px")&&(h=parseFloat(a)),null==a&&e.marker&&(h=o.layout.gridWidth),void 0!==e.seriesIndex&&o.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,o.globals.barWidth)),"number"!=typeof h&&(h=0,l=!0),parseFloat(h.toFixed(10))>parseFloat(o.layout.gridWidth.toFixed(10))?(h=o.layout.gridWidth,l=!0):h<0&&(h=0,l=!0),{x:h,clipped:l}}barSlotOffset(t,e){const o=this.w;if(o.config.chart.stacked)return 0;let a=0,n=0;return o.seriesData.series.forEach((e,i)=>{var s;const l=null==(s=o.config.series[i])?void 0:s.type;!e.length||o.globals.comboCharts&&"bar"!==l&&"column"!==l||(i<t&&n++,a++)}),e*(n-(a-1)/2)}getStringX(t){var e;const o=this.w;let a=t;if(o.config.xaxis.convertedCatToNumeric&&o.labelData.categoryLabels.length){const e=String(t);t=o.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=o.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),i=o.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return i?a=parseFloat(null!=(e=i.getAttribute("x"))?e:"0"):n>-1&&(a=o.axisFlags.isXNumeric?(t-o.globals.minX)/(o.globals.xRange/o.layout.gridWidth):o.globals.padHorizontal+(n+.5)*o.layout.gridWidth/o.globals.dataPoints),a}}class l{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new s(this.annoCtx)}addXaxisAnnotation(t,e,o){const n=this.w,s=this.helpers.getX1X2("x1",t);let l=s.x;const r=s.clipped;let d,h=!0;const c=t.label.text,x=t.strokeDashArray;if(a.isNumber(l)){if(null===t.x2||void 0===t.x2){if(!r){const o=this.annoCtx.graphics.drawLine(l+t.offsetX,0+t.offsetY,l+t.offsetX,n.layout.gridHeight+t.offsetY,t.borderColor,x,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id),i(o,l+t.offsetX,n)}}else{const o=this.helpers.getX1X2("x2",t);if(d=o.x,h=o.clipped,d<l){const t=l;l=d,d=t}const a=this.annoCtx.graphics.drawRect(l+t.offsetX,0+t.offsetY,d-l,n.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,x);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),i(a,l+t.offsetX,n)}if(!r||!h){const a=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),s="top"===t.label.position?4:"center"===t.label.position?n.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):n.layout.gridHeight,r=this.annoCtx.graphics.drawText({x:l+t.label.offsetX,y:s+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:o}),e.appendChild(r.node),i(r,l+t.label.offsetX,n),this.annoCtx.helpers.setOrientations(t,o)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,o)=>{this.addXaxisAnnotation(t,e.node,o)}),e}}const r=e.__apex_axes_AxesUtils;class d{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx),this.axesUtils=new r(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,o){const a=this.w,n=t.strokeDashArray;let i=this.helpers.getY1Y2("y1",t),s=i.yP;const l=i.clipped;let r,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!l){h=!0;const o=this.annoCtx.graphics.drawLine(0+t.offsetX,s+t.offsetY,this._getYAxisAnnotationWidth(t),s+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}else{if(i=this.helpers.getY1Y2("y2",t),r=i.yP,d=i.clipped,r>s){const t=s;s=r,r=t}if(!l||!d){h=!0;const o=this.annoCtx.graphics.drawRect(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),s-r,0,t.fillColor,t.opacity,1,t.borderColor,n);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?a.layout.gridWidth:"center"===t.label.position?a.layout.gridWidth/2:0,i=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=r?r:s)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});i.attr({rel:o}),e.appendChild(i.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let o=e.layout.gridWidth;return o=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),o+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,o)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,o)}),e}}const h=e.__apex_BrowserAPIs_BrowserAPIs;class c{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx)}addPointAnnotation(t,e,o){const n=this.w;if(n.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const s=this.helpers.getX1X2("x1",t),l=s.x,r=s.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(a.isNumber(l)&&!c&&!r){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let s=this.annoCtx.graphics.drawMarker(l+t.marker.offsetX,h+t.marker.offsetY,a);e.appendChild(s.node);const r=[s.node];i(s,l,n);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,l+t.label.offsetX,t.label),x=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(x.attr({rel:o}),e.appendChild(x.node),i(x,l,n),t.customSVG.SVG){const o=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});o.attr({transform:`translate(${l+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),o.node.innerHTML=t.customSVG.SVG,e.appendChild(o.node),r.push(o.node)}if(t.image.path){const e=t.image.width?t.image.width:20,o=t.image.height?t.image.height:20;s=this.annoCtx.addImage({x:l+t.image.offsetX-e/2,y:h+t.image.offsetY-o/2,width:e,height:o,path:t.image.path,appendTo:".apexcharts-point-annotations"}),r.push(s.node)}t.tooltip&&t.tooltip.enabled&&r.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&s.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&s.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&s.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,o){const a=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,o.style.fontSize,o.style.fontFamily,void 0,!0,o.style.fontWeight);let i,s;switch(o.textAnchor){case"start":i=e,s=e+n;break;case"end":i=e-n,s=e;break;default:i=e-n/2,s=e+n/2}const l=o.style.padding||{};return i-=l.left||0,s+=l.right||0,i<0?e-i:s>a.layout.gridWidth?e-(s-a.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=h.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,o=t.tooltip||{};if("function"==typeof o.formatter)return o.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let a=null!=o.text?o.text:t.label&&t.label.text;return Array.isArray(a)&&(a=a.join("<br/>")),null==a?"":String(a)}showPointTooltip(t,e){const o=this.w,a=this.getPointTooltipContent(t);if(!a)return;const n=this.getPointTooltipEl();n.innerHTML=a;const i=t.tooltip.theme||o.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${i}`),n.classList.add("apexcharts-active");const s=o.dom.elWrap.getBoundingClientRect(),l=e.getBoundingClientRect(),r=n.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=l.left-s.left+l.width/2-r.width/2,x=l.top-s.top-r.height-10;c=Math.max(0,Math.min(c,s.width-r.width)),x<0&&(x=l.top-s.top+l.height+10),n.style.left=c+d+"px",n.style.top=x+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,o)=>{this.addPointAnnotation(t,e.node,o)}),e}}const x=e.__apex_Options;e.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:a=null}={}){this.w=t,this.theme=e,this.timeScale=a,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new o(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new s(this),this.xAxisAnnotations=new l(this),this.yAxisAnnotations=new d(this),this.pointsAnnotations=new c(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),o=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,i=[e,o,a],s=[o.node,e.node,a.node],l="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,r=[l,!1,l];for(let e=0;e<3;e++)t.dom.elGraphical.add(i[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!r[e]&&s[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:s[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,o){this.xAxisAnnotations.addXaxisAnnotation(t,e,o)}addYaxisAnnotation(t,e,o){this.yAxisAnnotations.addYaxisAnnotation(t,e,o)}addPointAnnotation(t,e,o){this.pointsAnnotations.addPointAnnotation(t,e,o)}addText(t){const{x:e,y:o,text:a,textAnchor:n,foreColor:i,fontSize:s,fontFamily:l,fontWeight:r,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:x,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:b=4,paddingRight:u=4,paddingBottom:y=2,paddingTop:m=2}=t,A=this.w,w=A.dom.baseEl.querySelector(f);if(!w)return;const C=this.graphics.drawText({x:e,y:o,text:a,textAnchor:n||"start",fontSize:s||"12px",fontWeight:r||"regular",fontFamily:l||A.config.chart.fontFamily,foreColor:i||A.config.chart.foreColor,cssClass:d||""});w.appendChild(C.node);const v=C.bbox();if(a){const t=this.graphics.drawRect(v.x-b,v.y-m,v.width+b+u,v.height+y+m,p,h||"transparent",1,c,g,x);w.insertBefore(t.node,C.node)}}addImage(t){const e=this.w,{path:o,x:a=0,y:n=0,width:i=20,height:s=20,appendTo:l=".apexcharts-svg"}=t,r=e.dom.Paper.image(o);r.size(i,s).move(a,n);const d=e.dom.baseEl.querySelector(l);return d&&d.appendChild(r.node),r}addXaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"xaxis",contextMethod:o.addXaxisAnnotation}),o}addYaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"yaxis",contextMethod:o.addYaxisAnnotation}),o}addPointAnnotationExternal(t,e,o){return void 0===this.invertAxis&&(this.invertAxis=o.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"point",contextMethod:o.addPointAnnotation}),o}addAnnotationExternal({params:t,pushToMemory:e,context:o,type:n,contextMethod:i}){var s;const l=o,r=l.w,d=r.dom.baseEl.querySelector(`.apexcharts-${n}-annotations`),h=((null==(s=r.config.annotations["point"===n?"points":n])?void 0:s.length)||0)+d.childNodes.length,c=new x,p=Object.assign({},"xaxis"===n?c.xAxisAnnotation:"yaxis"===n?c.yAxisAnnotation:c.pointAnnotation),g=a.extend(p,t);switch(n){case"xaxis":this.addXaxisAnnotation(g,d,h);break;case"yaxis":this.addYaxisAnnotation(g,d,h);break;case"point":this.addPointAnnotation(g,d,h)}const f=r.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${h}']`),b=this.helpers.addBackgroundToAnno(f,g);return b&&d.insertBefore(b.node,f),e&&r.globals.memory.methodsToExec.push({context:l,id:g.id?g.id:a.randomId(),method:i,label:"addAnnotation",params:t}),o}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const o=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(o,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const o=t.w;this._removeAnnotationTooltip(o);const a=o.dom.baseEl.querySelectorAll(`.${e}`);a&&(o.globals.memory.methodsToExec=o.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(o.config.annotations).forEach(t=>{const a=o.config.annotations[t];Array.isArray(a)&&(o.config.annotations[t]=a.filter(t=>t.id!==e))}),Array.prototype.forEach.call(a,t=>{t.parentElement.removeChild(t)}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -51,10 +51,16 @@ class Helpers {
51
51
  }
52
52
  }
53
53
  /**
54
+ * Measure a label's background and draw it. With `deferDraw` it only
55
+ * measures, and returns the step that draws the rect: annotationsBackground
56
+ * measures every label before drawing any, since each rect drawn would force
57
+ * a fresh layout for the next label's reads.
54
58
  * @param {any} annoEl
55
59
  * @param {Record<string, any>} anno
60
+ * @param {boolean} [deferDraw]
61
+ * @returns {any}
56
62
  */
57
- addBackgroundToAnno(annoEl, anno) {
63
+ addBackgroundToAnno(annoEl, anno, deferDraw) {
58
64
  const w = this.w;
59
65
  if (!annoEl || !anno.label.text || !String(anno.label.text).trim()) {
60
66
  return null;
@@ -81,58 +87,68 @@ class Helpers {
81
87
  const gridTop = elGridRect.top - gridBBox.y * zoom;
82
88
  const x1 = (coords.left - gridLeft) / zoom - pleft;
83
89
  const y1 = (coords.top - gridTop) / zoom - ptop;
84
- const elRect = this.annoCtx.graphics.drawRect(
85
- x1,
86
- y1,
87
- coords.width / zoom + pleft + pright,
88
- coords.height / zoom + ptop + pbottom,
89
- anno.label.borderRadius,
90
- anno.label.style.background,
91
- 1,
92
- anno.label.borderWidth,
93
- anno.label.borderColor,
94
- 0
95
- );
96
- if (anno.id) {
97
- elRect.node.classList.add(anno.id);
98
- }
99
- return elRect;
90
+ const draw = () => {
91
+ const elRect = this.annoCtx.graphics.drawRect(
92
+ x1,
93
+ y1,
94
+ coords.width / zoom + pleft + pright,
95
+ coords.height / zoom + ptop + pbottom,
96
+ anno.label.borderRadius,
97
+ anno.label.style.background,
98
+ 1,
99
+ anno.label.borderWidth,
100
+ anno.label.borderColor,
101
+ 0
102
+ );
103
+ if (anno.id) {
104
+ elRect.node.classList.add(anno.id);
105
+ }
106
+ return elRect;
107
+ };
108
+ return deferDraw ? draw : draw();
100
109
  }
101
110
  annotationsBackground() {
102
111
  const w = this.w;
112
+ const drawn = [];
103
113
  const add = (anno, i, type) => {
104
- const annoLabel = w.dom.baseEl.querySelector(
105
- `.apexcharts-${type}-annotations .apexcharts-${type}-annotation-label[rel='${i}']`
114
+ const annoLabel = (
115
+ /** @type {Element} */
116
+ w.dom.baseEl.querySelector(
117
+ `.apexcharts-${type}-annotations .apexcharts-${type}-annotation-label[rel='${i}']`
118
+ )
106
119
  );
107
- if (annoLabel) {
108
- const parent = annoLabel.parentNode;
109
- const elRect = this.addBackgroundToAnno(annoLabel, anno);
110
- if (elRect) {
111
- parent == null ? void 0 : parent.insertBefore(elRect.node, annoLabel);
112
- const labelX = annoLabel.getAttribute("x");
113
- if (labelX !== null) {
114
- applyProgressiveReveal(elRect, parseFloat(labelX), w);
115
- }
116
- if (anno.label.mouseEnter) {
117
- elRect.node.addEventListener(
118
- "mouseenter",
119
- anno.label.mouseEnter.bind(this, anno)
120
- );
121
- }
122
- if (anno.label.mouseLeave) {
123
- elRect.node.addEventListener(
124
- "mouseleave",
125
- anno.label.mouseLeave.bind(this, anno)
126
- );
127
- }
128
- if (anno.label.click) {
129
- elRect.node.addEventListener(
130
- "click",
131
- anno.label.click.bind(this, anno)
132
- );
133
- }
120
+ const draw = this.addBackgroundToAnno(annoLabel, anno, true);
121
+ if (!draw) return;
122
+ drawn.push(() => {
123
+ const elRect = draw();
124
+ const parent = (
125
+ /** @type {Node} */
126
+ annoLabel.parentNode
127
+ );
128
+ parent == null ? void 0 : parent.insertBefore(elRect.node, annoLabel);
129
+ const labelX = annoLabel.getAttribute("x");
130
+ if (labelX !== null) {
131
+ applyProgressiveReveal(elRect, parseFloat(labelX), w);
134
132
  }
135
- }
133
+ if (anno.label.mouseEnter) {
134
+ elRect.node.addEventListener(
135
+ "mouseenter",
136
+ anno.label.mouseEnter.bind(this, anno)
137
+ );
138
+ }
139
+ if (anno.label.mouseLeave) {
140
+ elRect.node.addEventListener(
141
+ "mouseleave",
142
+ anno.label.mouseLeave.bind(this, anno)
143
+ );
144
+ }
145
+ if (anno.label.click) {
146
+ elRect.node.addEventListener(
147
+ "click",
148
+ anno.label.click.bind(this, anno)
149
+ );
150
+ }
151
+ });
136
152
  };
137
153
  w.config.annotations.xaxis.forEach(
138
154
  (anno, i) => add(anno, i, "xaxis")
@@ -143,6 +159,7 @@ class Helpers {
143
159
  w.config.annotations.points.forEach(
144
160
  (anno, i) => add(anno, i, "point")
145
161
  );
162
+ drawn.forEach((draw) => draw());
146
163
  }
147
164
  /**
148
165
  * Does the x position take the category branch of `getX1X2` (a label lookup)
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(t){var e="undefined"!=typeof globalThis?globalThis:self,a=e.ApexCharts;if(a&&a.__internals)return t.call(e);if(a)throw new Error("ApexCharts: dist/features/annotations.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/annotations.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var o={file:"dist/features/annotations.js",run:t,done:!1},n=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);n.push(o),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!o.done){var a=e.ApexCharts;if(a)if(a.__internals){o.done=!0;var s=n.indexOf(o);-1!==s&&n.splice(s,1);try{t.call(e),a.__drainsAddons||e.console.warn("ApexCharts: dist/features/annotations.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/annotations.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/annotations.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/annotations.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";const e=globalThis.ApexCharts,a=globalThis.ApexCharts.__internals.__apex_Graphics,o=globalThis.ApexCharts.__internals.__apex_Utils,n=globalThis.ApexCharts.__internals.__apex_CoreUtils,s=globalThis.ApexCharts.__internals;s.__apex_Animations,s.__apex_Animations_computeStagger,s.__apex_Animations_applyAnimationPolicy,s.__apex_Animations_prefersReducedMotion;const i=s.__apex_Animations_applyProgressiveReveal;class r{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var a,o;const n=this.w;if("vertical"===t.label.orientation){const s=null!==e?e:0,i=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${s}']`);if(null!==i){const e=i.getBBox();i.setAttribute("x",String(parseFloat(null!=(a=i.getAttribute("x"))?a:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;i.setAttribute("y",String(parseFloat(null!=(o=i.getAttribute("y"))?o:"0")+n));const{x:s,y:r}=this.annoCtx.graphics.rotateAroundCenter(i);i.setAttribute("transform",`rotate(-90 ${s} ${r})`)}}}addBackgroundToAnno(t,e){const a=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const o=a.dom.baseEl.querySelector(".apexcharts-grid");if(!o)return null;const n=o.getBoundingClientRect(),s=o.getBBox(),i=n.width/s.width||1,r=t.getBoundingClientRect();let{left:l,right:d,top:h,bottom:c}=e.label.style.padding;"vertical"===e.label.orientation&&([h,c,l,d]=[l,d,h,c]);const p=n.left-s.x*i,x=n.top-s.y*i,g=(r.left-p)/i-l,f=(r.top-x)/i-h,u=this.annoCtx.graphics.drawRect(g,f,r.width/i+l+d,r.height/i+h+c,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&u.node.classList.add(e.id),u}annotationsBackground(){const t=this.w,e=(e,a,o)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${o}-annotations .apexcharts-${o}-annotation-label[rel='${a}']`);if(n){const a=n.parentNode,o=this.addBackgroundToAnno(n,e);if(o){null==a||a.insertBefore(o.node,n);const s=n.getAttribute("x");null!==s&&i(o,parseFloat(s),t),e.label.mouseEnter&&o.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&o.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&o.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,a)=>e(t,a,"xaxis")),t.config.annotations.yaxis.forEach((t,a)=>e(t,a,"yaxis")),t.config.annotations.points.forEach((t,a)=>e(t,a,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?o.isNumber(t.globals.minY)&&o.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:o.isNumber(t.globals.minX)&&o.isNumber(t.globals.xRange)}getY1Y2(t,e){var a,o,s;const i=this.w,r="y1"===t?e.y:e.y2,l="string"==typeof r&&r.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=i.config.xaxis.convertedCatToNumeric?i.labelData.categoryLabels:i.labelData.labels,o=t.indexOf(r);if(!l&&-1===o)return{yP:0,clipped:!0};const n=i.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${o+1})`);d=n?parseFloat(null!=(a=n.getAttribute("y"))?a:"0"):(i.layout.gridHeight/t.length-1)*(o+1)-i.globals.barHeight,void 0!==e.seriesIndex&&i.globals.barHeight&&(d+=this.barSlotOffset(e.seriesIndex,i.globals.barHeight))}else{if(!i.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=i.globals.seriesYAxisMap[e.yAxisIndex],a=null!=(o=null==t?void 0:t[0])?o:null;if(null===a&&i.seriesData.series.length)return{yP:0,clipped:!0};const l=null===a?i.globals.minY:i.globals.minYArr[a],c=null===a?i.globals.maxY-i.globals.minY:i.globals.yRange[a],p=i.config.yaxis[e.yAxisIndex].logarithmic&&null!==a?new n(this.w).getLogVal(i.config.yaxis[e.yAxisIndex].logBase,r,a)/i.globals.yLogRatio[a]:(r-l)/(c/i.layout.gridHeight);d=i.layout.gridHeight-Math.min(Math.max(p,0),i.layout.gridHeight),h=p>i.layout.gridHeight||p<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(s=i.config.yaxis[e.yAxisIndex])?void 0:s.reversed)&&(d=p)}return l&&(d=parseFloat(r)),{yP:d,clipped:h}}getX1X2(t,e){const a=this.w,o="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?a.globals.minY:a.globals.minX,s=this.annoCtx.invertAxis?a.globals.maxY:a.globals.maxX,i=this.annoCtx.invertAxis?a.globals.yRange[0]:a.globals.xRange;let r=!1;const l="string"==typeof o&&o.includes("px"),d=null==o&&e.marker;if(!l&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(s-o)/(i/a.layout.gridWidth):(o-n)/(i/a.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(o)),"string"==typeof o&&o.includes("px")&&(h=parseFloat(o)),null==o&&e.marker&&(h=a.layout.gridWidth),void 0!==e.seriesIndex&&a.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,a.globals.barWidth)),"number"!=typeof h&&(h=0,r=!0),parseFloat(h.toFixed(10))>parseFloat(a.layout.gridWidth.toFixed(10))?(h=a.layout.gridWidth,r=!0):h<0&&(h=0,r=!0),{x:h,clipped:r}}barSlotOffset(t,e){const a=this.w;if(a.config.chart.stacked)return 0;let o=0,n=0;return a.seriesData.series.forEach((e,s)=>{var i;const r=null==(i=a.config.series[s])?void 0:i.type;!e.length||a.globals.comboCharts&&"bar"!==r&&"column"!==r||(s<t&&n++,o++)}),e*(n-(o-1)/2)}getStringX(t){var e;const a=this.w;let o=t;if(a.config.xaxis.convertedCatToNumeric&&a.labelData.categoryLabels.length){const e=String(t);t=a.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=a.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),s=a.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return s?o=parseFloat(null!=(e=s.getAttribute("x"))?e:"0"):n>-1&&(o=a.axisFlags.isXNumeric?(t-a.globals.minX)/(a.globals.xRange/a.layout.gridWidth):a.globals.padHorizontal+(n+.5)*a.layout.gridWidth/a.globals.dataPoints),o}}class l{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new r(this.annoCtx)}addXaxisAnnotation(t,e,a){const n=this.w,s=this.helpers.getX1X2("x1",t);let r=s.x;const l=s.clipped;let d,h=!0;const c=t.label.text,p=t.strokeDashArray;if(o.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!l){const a=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,n.layout.gridHeight+t.offsetY,t.borderColor,p,t.borderWidth);e.appendChild(a.node),t.id&&a.node.classList.add(t.id),i(a,r+t.offsetX,n)}}else{const a=this.helpers.getX1X2("x2",t);if(d=a.x,h=a.clipped,d<r){const t=r;r=d,d=t}const o=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,d-r,n.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,p);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id),i(o,r+t.offsetX,n)}if(!l||!h){const o=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),s="top"===t.label.position?4:"center"===t.label.position?n.layout.gridHeight/2+("vertical"===t.label.orientation?o.width/2:0):n.layout.gridHeight,l=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:s+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?o.width/2-12:-o.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});l.attr({rel:a}),e.appendChild(l.node),i(l,r+t.label.offsetX,n),this.annoCtx.helpers.setOrientations(t,a)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,a)=>{this.addXaxisAnnotation(t,e.node,a)}),e}}const d=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils;class h{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new r(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,a){const o=this.w,n=t.strokeDashArray;let s=this.helpers.getY1Y2("y1",t),i=s.yP;const r=s.clipped;let l,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!r){h=!0;const a=this.annoCtx.graphics.drawLine(0+t.offsetX,i+t.offsetY,this._getYAxisAnnotationWidth(t),i+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(a.node),t.id&&a.node.classList.add(t.id)}}else{if(s=this.helpers.getY1Y2("y2",t),l=s.yP,d=s.clipped,l>i){const t=i;i=l,l=t}if(!r||!d){h=!0;const a=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),i-l,0,t.fillColor,t.opacity,1,t.borderColor,n);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${o.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?o.layout.gridWidth:"center"===t.label.position?o.layout.gridWidth/2:0,s=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:i)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});s.attr({rel:a}),e.appendChild(s.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let a=e.layout.gridWidth;return a=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),a+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,a)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,a)}),e}}const c=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;class p{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new r(this.annoCtx)}addPointAnnotation(t,e,a){const n=this.w;if(n.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const s=this.helpers.getX1X2("x1",t),r=s.x,l=s.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(o.isNumber(r)&&!c&&!l){const o={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let s=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,h+t.marker.offsetY,o);e.appendChild(s.node);const l=[s.node];i(s,r,n);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,r+t.label.offsetX,t.label),p=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(p.attr({rel:a}),e.appendChild(p.node),i(p,r,n),t.customSVG.SVG){const a=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});a.attr({transform:`translate(${r+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),a.node.innerHTML=t.customSVG.SVG,e.appendChild(a.node),l.push(a.node)}if(t.image.path){const e=t.image.width?t.image.width:20,a=t.image.height?t.image.height:20;s=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:h+t.image.offsetY-a/2,width:e,height:a,path:t.image.path,appendTo:".apexcharts-point-annotations"}),l.push(s.node)}t.tooltip&&t.tooltip.enabled&&l.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&s.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&s.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&s.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,a){const o=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,a.style.fontSize,a.style.fontFamily,void 0,!0,a.style.fontWeight);let s,i;switch(a.textAnchor){case"start":s=e,i=e+n;break;case"end":s=e-n,i=e;break;default:s=e-n/2,i=e+n/2}const r=a.style.padding||{};return s-=r.left||0,i+=r.right||0,s<0?e-s:i>o.layout.gridWidth?e-(i-o.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=c.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,a=t.tooltip||{};if("function"==typeof a.formatter)return a.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let o=null!=a.text?a.text:t.label&&t.label.text;return Array.isArray(o)&&(o=o.join("<br/>")),null==o?"":String(o)}showPointTooltip(t,e){const a=this.w,o=this.getPointTooltipContent(t);if(!o)return;const n=this.getPointTooltipEl();n.innerHTML=o;const s=t.tooltip.theme||a.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${s}`),n.classList.add("apexcharts-active");const i=a.dom.elWrap.getBoundingClientRect(),r=e.getBoundingClientRect(),l=n.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=r.left-i.left+r.width/2-l.width/2,p=r.top-i.top-l.height-10;c=Math.max(0,Math.min(c,i.width-l.width)),p<0&&(p=r.top-i.top+r.height+10),n.style.left=c+d+"px",n.style.top=p+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,a)=>{this.addPointAnnotation(t,e.node,a)}),e}}const x=globalThis.ApexCharts.__internals.__apex_Options;e.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:o=null}={}){this.w=t,this.theme=e,this.timeScale=o,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new a(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new r(this),this.xAxisAnnotations=new l(this),this.yAxisAnnotations=new h(this),this.pointsAnnotations=new p(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),a=this.xAxisAnnotations.drawXAxisAnnotations(),o=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,s=[e,a,o],i=[a.node,e.node,o.node],r="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[r,!1,r];for(let e=0;e<3;e++)t.dom.elGraphical.add(s[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&i[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:i[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,a){this.xAxisAnnotations.addXaxisAnnotation(t,e,a)}addYaxisAnnotation(t,e,a){this.yAxisAnnotations.addYaxisAnnotation(t,e,a)}addPointAnnotation(t,e,a){this.pointsAnnotations.addPointAnnotation(t,e,a)}addText(t){const{x:e,y:a,text:o,textAnchor:n,foreColor:s,fontSize:i,fontFamily:r,fontWeight:l,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:p,borderRadius:x,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:u=4,paddingRight:b=4,paddingBottom:m=2,paddingTop:y=2}=t,A=this.w,C=A.dom.baseEl.querySelector(f);if(!C)return;const w=this.graphics.drawText({x:e,y:a,text:o,textAnchor:n||"start",fontSize:i||"12px",fontWeight:l||"regular",fontFamily:r||A.config.chart.fontFamily,foreColor:s||A.config.chart.foreColor,cssClass:d||""});C.appendChild(w.node);const v=w.bbox();if(o){const t=this.graphics.drawRect(v.x-u,v.y-y,v.width+u+b,v.height+m+y,x,h||"transparent",1,c,g,p);C.insertBefore(t.node,w.node)}}addImage(t){const e=this.w,{path:a,x:o=0,y:n=0,width:s=20,height:i=20,appendTo:r=".apexcharts-svg"}=t,l=e.dom.Paper.image(a);l.size(s,i).move(o,n);const d=e.dom.baseEl.querySelector(r);return d&&d.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,a){return this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"xaxis",contextMethod:a.addXaxisAnnotation}),a}addYaxisAnnotationExternal(t,e,a){return this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"yaxis",contextMethod:a.addYaxisAnnotation}),a}addPointAnnotationExternal(t,e,a){return void 0===this.invertAxis&&(this.invertAxis=a.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"point",contextMethod:a.addPointAnnotation}),a}addAnnotationExternal({params:t,pushToMemory:e,context:a,type:n,contextMethod:s}){var i;const r=a,l=r.w,d=l.dom.baseEl.querySelector(`.apexcharts-${n}-annotations`),h=((null==(i=l.config.annotations["point"===n?"points":n])?void 0:i.length)||0)+d.childNodes.length,c=new x,p=Object.assign({},"xaxis"===n?c.xAxisAnnotation:"yaxis"===n?c.yAxisAnnotation:c.pointAnnotation),g=o.extend(p,t);switch(n){case"xaxis":this.addXaxisAnnotation(g,d,h);break;case"yaxis":this.addYaxisAnnotation(g,d,h);break;case"point":this.addPointAnnotation(g,d,h)}const f=l.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${h}']`),u=this.helpers.addBackgroundToAnno(f,g);return u&&d.insertBefore(u.node,f),e&&l.globals.memory.methodsToExec.push({context:r,id:g.id?g.id:o.randomId(),method:s,label:"addAnnotation",params:t}),a}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const a=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(a,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const a=t.w;this._removeAnnotationTooltip(a);const o=a.dom.baseEl.querySelectorAll(`.${e}`);o&&(a.globals.memory.methodsToExec=a.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(a.config.annotations).forEach(t=>{const o=a.config.annotations[t];Array.isArray(o)&&(a.config.annotations[t]=o.filter(t=>t.id!==e))}),Array.prototype.forEach.call(o,t=>{t.parentElement.removeChild(t)}))}}}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexAnnotations={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,a=e.ApexCharts;if(a&&a.__internals)return t.call(e);if(a)throw new Error("ApexCharts: dist/features/annotations.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/annotations.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var o={file:"dist/features/annotations.js",run:t,done:!1},n=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);n.push(o),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!o.done){var a=e.ApexCharts;if(a)if(a.__internals){o.done=!0;var s=n.indexOf(o);-1!==s&&n.splice(s,1);try{t.call(e),a.__drainsAddons||e.console.warn("ApexCharts: dist/features/annotations.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/annotations.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/annotations.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/annotations.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";const e=globalThis.ApexCharts,a=globalThis.ApexCharts.__internals.__apex_Graphics,o=globalThis.ApexCharts.__internals.__apex_Utils,n=globalThis.ApexCharts.__internals.__apex_CoreUtils,s=globalThis.ApexCharts.__internals;s.__apex_Animations,s.__apex_Animations_computeStagger,s.__apex_Animations_applyAnimationPolicy,s.__apex_Animations_prefersReducedMotion;const i=s.__apex_Animations_applyProgressiveReveal;class r{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var a,o;const n=this.w;if("vertical"===t.label.orientation){const s=null!==e?e:0,i=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${s}']`);if(null!==i){const e=i.getBBox();i.setAttribute("x",String(parseFloat(null!=(a=i.getAttribute("x"))?a:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;i.setAttribute("y",String(parseFloat(null!=(o=i.getAttribute("y"))?o:"0")+n));const{x:s,y:r}=this.annoCtx.graphics.rotateAroundCenter(i);i.setAttribute("transform",`rotate(-90 ${s} ${r})`)}}}addBackgroundToAnno(t,e,a){const o=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const n=o.dom.baseEl.querySelector(".apexcharts-grid");if(!n)return null;const s=n.getBoundingClientRect(),i=n.getBBox(),r=s.width/i.width||1,l=t.getBoundingClientRect();let{left:d,right:h,top:c,bottom:p}=e.label.style.padding;"vertical"===e.label.orientation&&([c,p,d,h]=[d,h,c,p]);const x=s.left-i.x*r,g=s.top-i.y*r,f=(l.left-x)/r-d,u=(l.top-g)/r-c,b=()=>{const t=this.annoCtx.graphics.drawRect(f,u,l.width/r+d+h,l.height/r+c+p,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&t.node.classList.add(e.id),t};return a?b:b()}annotationsBackground(){const t=this.w,e=[],a=(a,o,n)=>{const s=t.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${o}']`),r=this.addBackgroundToAnno(s,a,!0);r&&e.push(()=>{const e=r(),o=s.parentNode;null==o||o.insertBefore(e.node,s);const n=s.getAttribute("x");null!==n&&i(e,parseFloat(n),t),a.label.mouseEnter&&e.node.addEventListener("mouseenter",a.label.mouseEnter.bind(this,a)),a.label.mouseLeave&&e.node.addEventListener("mouseleave",a.label.mouseLeave.bind(this,a)),a.label.click&&e.node.addEventListener("click",a.label.click.bind(this,a))})};t.config.annotations.xaxis.forEach((t,e)=>a(t,e,"xaxis")),t.config.annotations.yaxis.forEach((t,e)=>a(t,e,"yaxis")),t.config.annotations.points.forEach((t,e)=>a(t,e,"point")),e.forEach(t=>t())}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?o.isNumber(t.globals.minY)&&o.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:o.isNumber(t.globals.minX)&&o.isNumber(t.globals.xRange)}getY1Y2(t,e){var a,o,s;const i=this.w,r="y1"===t?e.y:e.y2,l="string"==typeof r&&r.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=i.config.xaxis.convertedCatToNumeric?i.labelData.categoryLabels:i.labelData.labels,o=t.indexOf(r);if(!l&&-1===o)return{yP:0,clipped:!0};const n=i.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${o+1})`);d=n?parseFloat(null!=(a=n.getAttribute("y"))?a:"0"):(i.layout.gridHeight/t.length-1)*(o+1)-i.globals.barHeight,void 0!==e.seriesIndex&&i.globals.barHeight&&(d+=this.barSlotOffset(e.seriesIndex,i.globals.barHeight))}else{if(!i.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=i.globals.seriesYAxisMap[e.yAxisIndex],a=null!=(o=null==t?void 0:t[0])?o:null;if(null===a&&i.seriesData.series.length)return{yP:0,clipped:!0};const l=null===a?i.globals.minY:i.globals.minYArr[a],c=null===a?i.globals.maxY-i.globals.minY:i.globals.yRange[a],p=i.config.yaxis[e.yAxisIndex].logarithmic&&null!==a?new n(this.w).getLogVal(i.config.yaxis[e.yAxisIndex].logBase,r,a)/i.globals.yLogRatio[a]:(r-l)/(c/i.layout.gridHeight);d=i.layout.gridHeight-Math.min(Math.max(p,0),i.layout.gridHeight),h=p>i.layout.gridHeight||p<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(s=i.config.yaxis[e.yAxisIndex])?void 0:s.reversed)&&(d=p)}return l&&(d=parseFloat(r)),{yP:d,clipped:h}}getX1X2(t,e){const a=this.w,o="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?a.globals.minY:a.globals.minX,s=this.annoCtx.invertAxis?a.globals.maxY:a.globals.maxX,i=this.annoCtx.invertAxis?a.globals.yRange[0]:a.globals.xRange;let r=!1;const l="string"==typeof o&&o.includes("px"),d=null==o&&e.marker;if(!l&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(s-o)/(i/a.layout.gridWidth):(o-n)/(i/a.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(o)),"string"==typeof o&&o.includes("px")&&(h=parseFloat(o)),null==o&&e.marker&&(h=a.layout.gridWidth),void 0!==e.seriesIndex&&a.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,a.globals.barWidth)),"number"!=typeof h&&(h=0,r=!0),parseFloat(h.toFixed(10))>parseFloat(a.layout.gridWidth.toFixed(10))?(h=a.layout.gridWidth,r=!0):h<0&&(h=0,r=!0),{x:h,clipped:r}}barSlotOffset(t,e){const a=this.w;if(a.config.chart.stacked)return 0;let o=0,n=0;return a.seriesData.series.forEach((e,s)=>{var i;const r=null==(i=a.config.series[s])?void 0:i.type;!e.length||a.globals.comboCharts&&"bar"!==r&&"column"!==r||(s<t&&n++,o++)}),e*(n-(o-1)/2)}getStringX(t){var e;const a=this.w;let o=t;if(a.config.xaxis.convertedCatToNumeric&&a.labelData.categoryLabels.length){const e=String(t);t=a.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=a.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),s=a.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return s?o=parseFloat(null!=(e=s.getAttribute("x"))?e:"0"):n>-1&&(o=a.axisFlags.isXNumeric?(t-a.globals.minX)/(a.globals.xRange/a.layout.gridWidth):a.globals.padHorizontal+(n+.5)*a.layout.gridWidth/a.globals.dataPoints),o}}class l{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new r(this.annoCtx)}addXaxisAnnotation(t,e,a){const n=this.w,s=this.helpers.getX1X2("x1",t);let r=s.x;const l=s.clipped;let d,h=!0;const c=t.label.text,p=t.strokeDashArray;if(o.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!l){const a=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,n.layout.gridHeight+t.offsetY,t.borderColor,p,t.borderWidth);e.appendChild(a.node),t.id&&a.node.classList.add(t.id),i(a,r+t.offsetX,n)}}else{const a=this.helpers.getX1X2("x2",t);if(d=a.x,h=a.clipped,d<r){const t=r;r=d,d=t}const o=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,d-r,n.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,p);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id),i(o,r+t.offsetX,n)}if(!l||!h){const o=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),s="top"===t.label.position?4:"center"===t.label.position?n.layout.gridHeight/2+("vertical"===t.label.orientation?o.width/2:0):n.layout.gridHeight,l=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:s+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?o.width/2-12:-o.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});l.attr({rel:a}),e.appendChild(l.node),i(l,r+t.label.offsetX,n),this.annoCtx.helpers.setOrientations(t,a)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,a)=>{this.addXaxisAnnotation(t,e.node,a)}),e}}const d=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils;class h{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new r(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,a){const o=this.w,n=t.strokeDashArray;let s=this.helpers.getY1Y2("y1",t),i=s.yP;const r=s.clipped;let l,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!r){h=!0;const a=this.annoCtx.graphics.drawLine(0+t.offsetX,i+t.offsetY,this._getYAxisAnnotationWidth(t),i+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(a.node),t.id&&a.node.classList.add(t.id)}}else{if(s=this.helpers.getY1Y2("y2",t),l=s.yP,d=s.clipped,l>i){const t=i;i=l,l=t}if(!r||!d){h=!0;const a=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),i-l,0,t.fillColor,t.opacity,1,t.borderColor,n);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${o.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?o.layout.gridWidth:"center"===t.label.position?o.layout.gridWidth/2:0,s=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:i)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});s.attr({rel:a}),e.appendChild(s.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let a=e.layout.gridWidth;return a=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),a+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,a)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,a)}),e}}const c=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;class p{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new r(this.annoCtx)}addPointAnnotation(t,e,a){const n=this.w;if(n.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const s=this.helpers.getX1X2("x1",t),r=s.x,l=s.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(o.isNumber(r)&&!c&&!l){const o={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let s=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,h+t.marker.offsetY,o);e.appendChild(s.node);const l=[s.node];i(s,r,n);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,r+t.label.offsetX,t.label),p=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(p.attr({rel:a}),e.appendChild(p.node),i(p,r,n),t.customSVG.SVG){const a=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});a.attr({transform:`translate(${r+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),a.node.innerHTML=t.customSVG.SVG,e.appendChild(a.node),l.push(a.node)}if(t.image.path){const e=t.image.width?t.image.width:20,a=t.image.height?t.image.height:20;s=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:h+t.image.offsetY-a/2,width:e,height:a,path:t.image.path,appendTo:".apexcharts-point-annotations"}),l.push(s.node)}t.tooltip&&t.tooltip.enabled&&l.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&s.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&s.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&s.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,a){const o=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,a.style.fontSize,a.style.fontFamily,void 0,!0,a.style.fontWeight);let s,i;switch(a.textAnchor){case"start":s=e,i=e+n;break;case"end":s=e-n,i=e;break;default:s=e-n/2,i=e+n/2}const r=a.style.padding||{};return s-=r.left||0,i+=r.right||0,s<0?e-s:i>o.layout.gridWidth?e-(i-o.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=c.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,a=t.tooltip||{};if("function"==typeof a.formatter)return a.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let o=null!=a.text?a.text:t.label&&t.label.text;return Array.isArray(o)&&(o=o.join("<br/>")),null==o?"":String(o)}showPointTooltip(t,e){const a=this.w,o=this.getPointTooltipContent(t);if(!o)return;const n=this.getPointTooltipEl();n.innerHTML=o;const s=t.tooltip.theme||a.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${s}`),n.classList.add("apexcharts-active");const i=a.dom.elWrap.getBoundingClientRect(),r=e.getBoundingClientRect(),l=n.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=r.left-i.left+r.width/2-l.width/2,p=r.top-i.top-l.height-10;c=Math.max(0,Math.min(c,i.width-l.width)),p<0&&(p=r.top-i.top+r.height+10),n.style.left=c+d+"px",n.style.top=p+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,a)=>{this.addPointAnnotation(t,e.node,a)}),e}}const x=globalThis.ApexCharts.__internals.__apex_Options;e.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:o=null}={}){this.w=t,this.theme=e,this.timeScale=o,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new a(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new r(this),this.xAxisAnnotations=new l(this),this.yAxisAnnotations=new h(this),this.pointsAnnotations=new p(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),a=this.xAxisAnnotations.drawXAxisAnnotations(),o=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,s=[e,a,o],i=[a.node,e.node,o.node],r="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[r,!1,r];for(let e=0;e<3;e++)t.dom.elGraphical.add(s[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&i[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:i[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,a){this.xAxisAnnotations.addXaxisAnnotation(t,e,a)}addYaxisAnnotation(t,e,a){this.yAxisAnnotations.addYaxisAnnotation(t,e,a)}addPointAnnotation(t,e,a){this.pointsAnnotations.addPointAnnotation(t,e,a)}addText(t){const{x:e,y:a,text:o,textAnchor:n,foreColor:s,fontSize:i,fontFamily:r,fontWeight:l,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:p,borderRadius:x,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:u=4,paddingRight:b=4,paddingBottom:m=2,paddingTop:y=2}=t,A=this.w,C=A.dom.baseEl.querySelector(f);if(!C)return;const w=this.graphics.drawText({x:e,y:a,text:o,textAnchor:n||"start",fontSize:i||"12px",fontWeight:l||"regular",fontFamily:r||A.config.chart.fontFamily,foreColor:s||A.config.chart.foreColor,cssClass:d||""});C.appendChild(w.node);const v=w.bbox();if(o){const t=this.graphics.drawRect(v.x-u,v.y-y,v.width+u+b,v.height+m+y,x,h||"transparent",1,c,g,p);C.insertBefore(t.node,w.node)}}addImage(t){const e=this.w,{path:a,x:o=0,y:n=0,width:s=20,height:i=20,appendTo:r=".apexcharts-svg"}=t,l=e.dom.Paper.image(a);l.size(s,i).move(o,n);const d=e.dom.baseEl.querySelector(r);return d&&d.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,a){return this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"xaxis",contextMethod:a.addXaxisAnnotation}),a}addYaxisAnnotationExternal(t,e,a){return this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"yaxis",contextMethod:a.addYaxisAnnotation}),a}addPointAnnotationExternal(t,e,a){return void 0===this.invertAxis&&(this.invertAxis=a.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:a,type:"point",contextMethod:a.addPointAnnotation}),a}addAnnotationExternal({params:t,pushToMemory:e,context:a,type:n,contextMethod:s}){var i;const r=a,l=r.w,d=l.dom.baseEl.querySelector(`.apexcharts-${n}-annotations`),h=((null==(i=l.config.annotations["point"===n?"points":n])?void 0:i.length)||0)+d.childNodes.length,c=new x,p=Object.assign({},"xaxis"===n?c.xAxisAnnotation:"yaxis"===n?c.yAxisAnnotation:c.pointAnnotation),g=o.extend(p,t);switch(n){case"xaxis":this.addXaxisAnnotation(g,d,h);break;case"yaxis":this.addYaxisAnnotation(g,d,h);break;case"point":this.addPointAnnotation(g,d,h)}const f=l.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${h}']`),u=this.helpers.addBackgroundToAnno(f,g);return u&&d.insertBefore(u.node,f),e&&l.globals.memory.methodsToExec.push({context:r,id:g.id?g.id:o.randomId(),method:s,label:"addAnnotation",params:t}),a}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const a=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(a,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const a=t.w;this._removeAnnotationTooltip(a);const o=a.dom.baseEl.querySelectorAll(`.${e}`);o&&(a.globals.memory.methodsToExec=a.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(a.config.annotations).forEach(t=>{const o=a.config.annotations[t];Array.isArray(o)&&(a.config.annotations[t]=o.filter(t=>t.id!==e))}),Array.prototype.forEach.call(o,t=>{t.parentElement.removeChild(t)}))}}}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexAnnotations={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),n=t.__apex_Environment_Environment,i=t.__apex_Utils,s=t.__apex_tooltip_Utils;t.default.registerFeatures({contextMenu:class{constructor(e,t){this.w=e,this.ctx=t,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),t.addEventListener("mounted",this._afterRender),t.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!n.isBrowser())return;const e=this.w.dom.Paper&&this.w.dom.Paper.node;e&&(e.addEventListener("contextmenu",this._onContext),this._trigger=e)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(e){this._enabled()&&(e.preventDefault(),this.open(e.clientX,e.clientY))}_clientToData(e,t){const n=this.w;if(!n.globals.axisCharts||!n.dom.baseEl||!n.dom.baseEl.querySelector(".apexcharts-svg"))return null;const i=s.plotRect(n);if(!i.width||!i.height)return null;const o=e=>e<0?0:e>1?1:e,r=o((e-i.left)/i.width),a=o((t-i.top)/i.height),l=n.globals.minX+r*(n.globals.maxX-n.globals.minX),c=n.globals.yAxisScale&&n.globals.yAxisScale[0],h=c&&isFinite(c.niceMin)?c.niceMin:n.globals.minY,u=c&&isFinite(c.niceMax)?c.niceMax:n.globals.maxY;return{x:l,y:u-a*(u-h)}}_resolveItems(e){const t=this._cfg(),n=Array.isArray(t.items)&&t.items.length?t.items:["annotate","xline","yline","measure"],i=t.labels||{},s=[];return n.forEach(t=>{if("string"==typeof t){if("annotate"===t)s.push({id:"annotate",label:i.annotate||"Add note here",run:()=>this._annotate(e)});else if("xline"===t)s.push({id:"xline",label:i.xline||"Annotate here",run:()=>this._line(e,"x")});else if("yline"===t)s.push({id:"yline",label:i.yline||"Mark this level",run:()=>this._line(e,"y")});else if("measure"===t){const t=this.ctx.measure;t&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&s.push({id:"measure",label:i.measure||"Measure from here",run:()=>t.seedFromClient(e.clientX,e.clientY)})}}else t&&"object"==typeof t&&"function"==typeof t.onClick&&s.push({id:t.id||"custom",label:t.label||"Action",run:()=>t.onClick(this.ctx,e)})}),s}_annotate(e){if(null==e.x||null==e.y)return;const t=this._cfg(),n=this.ctx.ink;n&&"function"==typeof n.createAt?n.createAt(e.x,e.y,{text:t.noteText||"Note"}):this.ctx.addPointAnnotation({x:e.x,y:e.y,marker:{size:5},label:{text:t.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(e,t){const n=this._cfg().line||{},s="x"===t?e.x:e.y;if(null==s)return;const o=this.ctx.ink;if(o&&"function"==typeof o.createLineAt)return void o.createLineAt(t,s,{text:n.text,strokeDashArray:n.strokeDashArray,color:n.color});const r={strokeDashArray:null!=n.strokeDashArray?n.strokeDashArray:4};n.text&&(r.label={text:n.text}),n.color&&(r.borderColor=n.color,r.label=i.extend(r.label||{},{borderColor:n.color})),"x"===t?this.ctx.addXaxisAnnotation(i.extend(r,{x:s}),!0):this.ctx.addYaxisAnnotation(i.extend(r,{y:s}),!0)}open(e,t){this.close();const n=this.w,i=n.dom.elWrap,o=this._doc();if(!i||!o)return;const r=this._clientToData(e,t),a=n.globals,l={x:r?r.x:null,y:r?r.y:null,seriesIndex:a.capturedSeriesIndex>=0?a.capturedSeriesIndex:null,dataPointIndex:a.capturedDataPointIndex>=0?a.capturedDataPointIndex:null,clientX:e,clientY:t},c=this._resolveItems(l);if(!c.length)return;this._items=c;const h=o.createElement("div");h.className="apexcharts-context-menu",h.setAttribute("role","menu"),h.style.position="absolute",h.style.visibility="hidden",c.forEach((e,t)=>{const n=o.createElement("button");n.type="button",n.className="apexcharts-context-menu-item",n.setAttribute("role","menuitem"),n.tabIndex=-1,n.textContent=e.label,n.addEventListener("click",e=>{e.stopPropagation(),this._activate(t)}),n.addEventListener("mouseenter",()=>this._focus(t)),h.appendChild(n)}),i.appendChild(h),this.menu=h;const u=i.getBoundingClientRect(),d=s.plotRect(n).zoom;let x=(e-u.left)/d,_=(t-u.top)/d;const m=h.offsetWidth,f=h.offsetHeight,p=Math.max(0,i.clientWidth-m),g=Math.max(0,i.clientHeight-f);x>p&&(x=p),_>g&&(_=g),h.style.left=Math.max(0,x)+"px",h.style.top=Math.max(0,_)+"px",h.style.visibility="visible",o.addEventListener("mousedown",this._onDocDown,!0),o.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(e){if(!this.menu)return;const t=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&t[this._focusIndex]&&t[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=e,t[e]&&(t[e].classList.add("apexcharts-context-menu-item--active"),"function"==typeof t[e].focus&&t[e].focus())}_activate(e){const t=this._items[e];this.close(),t&&t.run()}_onDocDown(e){this.menu&&this.menu.contains(e.target)||this.close()}_onKey(e){this.menu&&this._items.length&&("Escape"===e.key?(e.preventDefault(),this.close()):"ArrowDown"===e.key?(e.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===e.key?(e.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const e=this._doc();e&&(e.removeEventListener("mousedown",this._onDocDown,!0),e.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(e){var t="undefined"!=typeof globalThis?globalThis:self,n=t.ApexCharts;if(n&&n.__internals)return e.call(t);if(n)throw new Error("ApexCharts: dist/features/context-menu.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/context-menu.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/context-menu.js",run:e,done:!1},i=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);i.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var n=t.ApexCharts;if(n)if(n.__internals){s.done=!0;var o=i.indexOf(s);-1!==o&&i.splice(o,1);try{e.call(t),n.__drainsAddons||t.console.warn("ApexCharts: dist/features/context-menu.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){t.console.error("ApexCharts: dist/features/context-menu.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/context-menu.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else t.console.warn("ApexCharts: dist/features/context-menu.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,t;e=this,t=function(e){"use strict";const t=globalThis.ApexCharts,n=globalThis.ApexCharts.__internals.__apex_Environment_Environment,s=globalThis.ApexCharts.__internals.__apex_Utils,i=globalThis.ApexCharts.__internals.__apex_tooltip_Utils;t.registerFeatures({contextMenu:class{constructor(e,t){this.w=e,this.ctx=t,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),t.addEventListener("mounted",this._afterRender),t.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!n.isBrowser())return;const e=this.w.dom.Paper&&this.w.dom.Paper.node;e&&(e.addEventListener("contextmenu",this._onContext),this._trigger=e)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(e){this._enabled()&&(e.preventDefault(),this.open(e.clientX,e.clientY))}_clientToData(e,t){const n=this.w;if(!n.globals.axisCharts||!n.dom.baseEl||!n.dom.baseEl.querySelector(".apexcharts-svg"))return null;const s=i.plotRect(n);if(!s.width||!s.height)return null;const o=e=>e<0?0:e>1?1:e,a=o((e-s.left)/s.width),r=o((t-s.top)/s.height),l=n.globals.minX+a*(n.globals.maxX-n.globals.minX),h=n.globals.yAxisScale&&n.globals.yAxisScale[0],c=h&&isFinite(h.niceMin)?h.niceMin:n.globals.minY,d=h&&isFinite(h.niceMax)?h.niceMax:n.globals.maxY;return{x:l,y:d-r*(d-c)}}_resolveItems(e){const t=this._cfg(),n=Array.isArray(t.items)&&t.items.length?t.items:["annotate","xline","yline","measure"],s=t.labels||{},i=[];return n.forEach(t=>{if("string"==typeof t){if("annotate"===t)i.push({id:"annotate",label:s.annotate||"Add note here",run:()=>this._annotate(e)});else if("xline"===t)i.push({id:"xline",label:s.xline||"Annotate here",run:()=>this._line(e,"x")});else if("yline"===t)i.push({id:"yline",label:s.yline||"Mark this level",run:()=>this._line(e,"y")});else if("measure"===t){const t=this.ctx.measure;t&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&i.push({id:"measure",label:s.measure||"Measure from here",run:()=>t.seedFromClient(e.clientX,e.clientY)})}}else t&&"object"==typeof t&&"function"==typeof t.onClick&&i.push({id:t.id||"custom",label:t.label||"Action",run:()=>t.onClick(this.ctx,e)})}),i}_annotate(e){if(null==e.x||null==e.y)return;const t=this._cfg(),n=this.ctx.ink;n&&"function"==typeof n.createAt?n.createAt(e.x,e.y,{text:t.noteText||"Note"}):this.ctx.addPointAnnotation({x:e.x,y:e.y,marker:{size:5},label:{text:t.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(e,t){const n=this._cfg().line||{},i="x"===t?e.x:e.y;if(null==i)return;const o=this.ctx.ink;if(o&&"function"==typeof o.createLineAt)return void o.createLineAt(t,i,{text:n.text,strokeDashArray:n.strokeDashArray,color:n.color});const a={strokeDashArray:null!=n.strokeDashArray?n.strokeDashArray:4};n.text&&(a.label={text:n.text}),n.color&&(a.borderColor=n.color,a.label=s.extend(a.label||{},{borderColor:n.color})),"x"===t?this.ctx.addXaxisAnnotation(s.extend(a,{x:i}),!0):this.ctx.addYaxisAnnotation(s.extend(a,{y:i}),!0)}open(e,t){this.close();const n=this.w,s=n.dom.elWrap,o=this._doc();if(!s||!o)return;const a=this._clientToData(e,t),r=n.globals,l={x:a?a.x:null,y:a?a.y:null,seriesIndex:r.capturedSeriesIndex>=0?r.capturedSeriesIndex:null,dataPointIndex:r.capturedDataPointIndex>=0?r.capturedDataPointIndex:null,clientX:e,clientY:t},h=this._resolveItems(l);if(!h.length)return;this._items=h;const c=o.createElement("div");c.className="apexcharts-context-menu",c.setAttribute("role","menu"),c.style.position="absolute",c.style.visibility="hidden",h.forEach((e,t)=>{const n=o.createElement("button");n.type="button",n.className="apexcharts-context-menu-item",n.setAttribute("role","menuitem"),n.tabIndex=-1,n.textContent=e.label,n.addEventListener("click",e=>{e.stopPropagation(),this._activate(t)}),n.addEventListener("mouseenter",()=>this._focus(t)),c.appendChild(n)}),s.appendChild(c),this.menu=c;const d=s.getBoundingClientRect(),u=i.plotRect(n).zoom;let x=(e-d.left)/u,f=(t-d.top)/u;const p=c.offsetWidth,_=c.offsetHeight,m=Math.max(0,s.clientWidth-p),g=Math.max(0,s.clientHeight-_);x>m&&(x=m),f>g&&(f=g),c.style.left=Math.max(0,x)+"px",c.style.top=Math.max(0,f)+"px",c.style.visibility="visible",o.addEventListener("mousedown",this._onDocDown,!0),o.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(e){if(!this.menu)return;const t=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&t[this._focusIndex]&&t[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=e,t[e]&&(t[e].classList.add("apexcharts-context-menu-item--active"),"function"==typeof t[e].focus&&t[e].focus())}_activate(e){const t=this._items[e];this.close(),t&&t.run()}_onDocDown(e){this.menu&&this.menu.contains(e.target)||this.close()}_onKey(e){this.menu&&this._items.length&&("Escape"===e.key?(e.preventDefault(),this.close()):"ArrowDown"===e.key?(e.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===e.key?(e.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const e=this._doc();e&&(e.removeEventListener("mousedown",this._onDocDown,!0),e.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexContextMenu={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.3.0
2
+ * ApexCharts v8.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(r)for(var i of r(e))n.call(e,i)&&o(t,i,e[i]);return t},a=(t,r)=>e(t,i(r));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const d=c(require("apexcharts/core")),h=d.__apex_Utils,p=d.__apex_Environment_Environment,u=d.__apex_BrowserAPIs_BrowserAPIs;function f(t,e,i,r){var s;const n=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const n=r.getBoundingClientRect().top,o=e.getBoundingClientRect();let l=i;for(let t=0;t<s.length;t++){const e=s[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(l=Math.min(l,e.top-n)))}return l}(t,i);if(c-o>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${o+a}px`;const d="dark"===t.config.theme.mode;return i.style.background=d?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const w="http://www.w3.org/1999/xhtml";class g{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!p.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const r=i.querySelector(".apexcharts-breadcrumb[aria-label^=Drill]");r&&r.parentNode&&r.parentNode.removeChild(r);const s=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!s||!1===s.show)return;if(0===this.drilldown.depth)return;const n=u.createElementNS(w,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label","Drilldown breadcrumb"),this._position(n,s);const o=null!=s.separator?s.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}const r=this._label(e,i);if(i===t.length-1){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=r,n.appendChild(t)}else{const t=u.createElementNS(w,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=r,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),n.appendChild(t)}}),i.appendChild(n),this.w.globals.axisCharts&&f(this.w,this.ctx,n,s),this._avoidChromeOverlap(n)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const r=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),s=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!s)break;t.style.top=s.getBoundingClientRect().bottom-r+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let r;if(0===e)r=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);r=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(r,{index:e,depth:this.drilldown.depth}):r}_position(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const b="http://www.w3.org/1999/xhtml",_="apexcharts-drilldown-loading";class m{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!p.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=u.createElementNS(b,"div");i.setAttribute("class",_),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=u.createElementNS(b,"div");if(r.setAttribute("class",`${_}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=u.createElementNS(b,"span");e.setAttribute("class",`${_}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${_}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const x="__apexDrilldownMarker";d.default.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new g(t,e,this),this.loading=new m(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const r=this._resolveChild(t);return r?this._drillInto(r,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),Promise.resolve(this.ctx))}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],r=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(r),"up",{from:i,to:s})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const r=this.path[this.path.length-1],s={id:t.id,name:t.name,restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:r,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const r=this.w.config.drilldown.onDrillDown,s=this._cacheGet(t);if(s)return this._drillInto(s,e,i);if(this._pending)return this._pending;let n;this.loading.show();try{n=r({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const o=()=>{this._pending=null,this.loading.hide()},c=Promise.resolve(n).then(r=>{if(o(),this._isDead())return this.ctx;if(!r||!r.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const s=null!=r.id?r:a(l({},r),{id:t});return this._cacheSet(t,s),this._drillInto(s,e,i)},e=>(o(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=c,c}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(h.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=h.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=h.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=h.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?h.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=h.clone(t.plotOptions)),e.has("fill")&&(i.fill=h.clone(t.fill)),e.has("legend")&&(i.legend=h.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,r=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!r.length)return t;const s=e.config.chart.type,n=("pie"===s||"donut"===s||"polarArea"===s)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of r){const r=e.index;i.axisCharts?t[r]&&(t[r].data=Array.isArray(e.data)?e.data.slice():e.data):n[r]&&"object"==typeof n[r]?n[r].y=e.data:void 0!==n[r]&&(n[r]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){var r;const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=a(l({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(r=this.ctx.highlightFilter)||r.drillView(t);const o=e=>this.ctx.updateOptions(t,!1,e,!1,!1),c=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>o(!1)).then(c)}return o(n).then(c)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!p.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const r=e.getBoundingClientRect();let s=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(s=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),s&&"function"==typeof s.getBoundingClientRect){const t=s.getBoundingClientRect();return{x:t.left+t.width/2-r.left,y:t.top+t.height/2-r.top}}const n=i.getBoundingClientRect();return{x:n.left+n.width/2-r.left,y:n.top+n.height/2-r.top}}_zoomDrill(t,e,i){return r=this,s=null,n=function*(){const r=this._zoomDuration(),s="down"===e,n=Math.round(.55*r),o=s?"scale(1.03)":"scale(0.97)",l=s?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",a=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},c=this._markGroup();let d=null;if(c){a(c),d=c.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:n,easing:"ease-in",fill:"forwards"});try{yield d.finished}catch(t){}}yield i();const h=this._markGroup();if(h){a(h),h.style.opacity="0",h.style.transform=l,d&&c===h&&d.cancel();const t=h.animate([{transform:l,opacity:0},{transform:"scale(1)",opacity:1}],{duration:r,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(p=h).style.transform="",p.style.opacity="",p.style.transformOrigin="",p.style.transformBox="",t.cancel()}var p},new Promise((t,e)=>{var i=t=>{try{l(n.next(t))}catch(t){e(t)}},o=t=>{try{l(n.throw(t))}catch(t){e(t)}},l=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);l((n=n.apply(r,s)).next())});var r,s,n}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i||this._retired())return;const r=this._pointAt(i.seriesIndex,i.dataPointIndex);return r&&"object"==typeof r&&null!=r.drilldown?this.drillDown(r.drilldown,r,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,r,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const r=i[t];return r&&Array.isArray(r.data)&&null!=r.data[e]?r.data[e]:null}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){const t=this.w;this._retired()||t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!p.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let r=0;i.forEach((t,i)=>{const s=t&&Array.isArray(t.data)?t.data:null;s&&s.forEach((t,s)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const n=e.querySelectorAll(`[index="${i}"][j="${s}"]`);n.length||r++,n.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),r&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${r} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!p.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const r=t.target;if(!r||"function"!=typeof r.closest)return;if(r.closest(".apexcharts-drilldown-target"))return;if(r.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const s=e.interact.capturedSeriesIndex,n=e.interact.capturedDataPointIndex;if(null==s||null==n||s<0||n<0)return;if(!this._isPointBasedSeries(e.config.series[s]))return;const o=this._pointAt(s,n);return o&&"object"==typeof o&&null!=o.drilldown?this.drillDown(o.drilldown,o,{seriesIndex:s,dataPointIndex:n}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,r=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[x]):[],s=i&&i.marker||{};if(!1===s.show||!Array.isArray(t))return r;const n=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r={seriesIndex:e,dataPointIndex:i,[x]:!0};void 0!==s.size&&(r.size=s.size),void 0!==s.shape&&(r.shape=s.shape),void 0!==s.fillColor&&(r.fillColor=s.fillColor),void 0!==s.strokeColor&&(r.strokeColor=s.strokeColor),n.push(r)})}),r.concat(n)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,r=Array.isArray(i)?i[t]:i;return!(Number(r)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,o=(e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&o(t,i,e[i]);if(r)for(var i of r(e))s.call(e,i)&&o(t,i,e[i]);return t},a=(t,r)=>e(t,i(r));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const d=c(require("apexcharts/core")),h=d.__apex_Utils,u=d.__apex_Environment_Environment,p=d.__apex_BrowserAPIs_BrowserAPIs;function f(t,e,i,r){var n;const s=null==(n=null==e?void 0:e.dimensions)?void 0:n.dimHelpers,o=s?s.getTitleSubtitleCoords("title").height+s.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const n=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!n.length)return i;const s=r.getBoundingClientRect().top,o=e.getBoundingClientRect();let l=i;for(let t=0;t<n.length;t++){const e=n[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(l=Math.min(l,e.top-s)))}return l}(t,i);if(c-o>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${o+a}px`;const d="dark"===t.config.theme.mode;return i.style.background=d?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const w="http://www.w3.org/1999/xhtml";class g{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!u.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const r=i.querySelector(".apexcharts-breadcrumb[aria-label^=Drill]");r&&r.parentNode&&r.parentNode.removeChild(r);const n=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!n||!1===n.show)return;if(0===this.drilldown.depth)return;const s=p.createElementNS(w,"nav");s.setAttribute("class","apexcharts-breadcrumb"),s.setAttribute("aria-label","Drilldown breadcrumb"),function(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(s,n);const o=null!=n.separator?n.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=p.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,s.appendChild(t)}const r=this._label(e,i);if(i===t.length-1){const t=p.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=r,s.appendChild(t)}else{const t=p.createElementNS(w,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=p.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=p.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=r,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),s.appendChild(t)}}),i.appendChild(s),this.w.globals.axisCharts&&f(this.w,this.ctx,s,n),function(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const r=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),n=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!n)break;e.style.top=n.getBoundingClientRect().bottom-r+4+"px"}}(e,s)}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let r;if(0===e)r=null!=i.rootLabel?i.rootLabel:"All";else{const i=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t),n=this.drilldown.stack[e-1];r=i&&i.name||n&&n.name||String(t)}return"function"==typeof i.formatter?i.formatter(r,{index:e,depth:this.drilldown.depth}):r}}const b="http://www.w3.org/1999/xhtml",m="apexcharts-drilldown-loading";class _{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!u.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=p.createElementNS(b,"div");i.setAttribute("class",m),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=p.createElementNS(b,"div");if(r.setAttribute("class",`${m}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=p.createElementNS(b,"span");e.setAttribute("class",`${m}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${m}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const y="__apexDrilldownMarker",x=["xaxis","yaxis","colors","plotOptions","fill","legend"];d.default.registerFeatures({drilldown:class{constructor(t,e){var i,r;this.w=t,this.ctx=e,this.stack=[],this._nav=0,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new g(t,e,this),this.loading=new _(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this._wasOn=!!(null==(i=t.config.drilldown)?void 0:i.enabled),this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),(null==(r=t.config.drilldown)?void 0:r.enabled)&&t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const r=this._resolveChild(t);return r?this._drillInto(r,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),Promise.resolve(this.ctx))}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],r=this.stack.slice(t),n=new Set(r.flatMap(t=>t.keys));this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(r[0].restore,n),"up",{from:i,to:s})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){var r;if(this.stack.length>=32)return console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);const n=this.path[this.path.length-1],s={id:t.id,name:null!=(r=t.name)?r:null==t.id?this._pointLabel(e,i):void 0,keys:x.filter(e=>t[e]),restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:n,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const r=this.w.config.drilldown.onDrillDown,n=this._cacheGet(t);if(n)return this._drillInto(n,e,i);if(this._pending)return this._pending;const s=this._nav;let o;this.loading.show();try{o=r({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const c=()=>{this._pending=null,this.loading.hide()},d=Promise.resolve(o).then(r=>{if(c(),this._stale())return this.ctx;if(!r||!r.data&&!Array.isArray(r.series))return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` or \`series\` array).`)}),this.ctx;const n=null!=r.id?r:a(l({},r),{id:t});return this._cacheSet(t,n),s!==this._nav?this.ctx:this._drillInto(n,e,i)},e=>(c(),this._stale()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=d,d}_stale(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed||this._retired()}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.ctx.responsive,e=t?t.withoutBreakpoints(this.w.config):this.w.config,i={series:this._uncollapseSeries(h.clone(e.series))};Array.isArray(e.labels)&&e.labels.length&&(i.labels=h.clone(e.labels)),i.chart={type:e.chart.type,stacked:e.chart.stacked};for(const t of x)i[t]=h.clone(e[t]);const r=this.w.globals.lastXAxis;return i.xaxis&&r&&(i.xaxis.min=r.min,i.xaxis.max=r.max),i}_uncollapseSeries(t){const e=this.w,i=e.globals,r=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!r.length)return t;const n=e.config.chart.type,s=("pie"===n||"donut"===n||"polarArea"===n)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of r){const r=e.index;i.axisCharts?t[r]&&(t[r].data=Array.isArray(e.data)?e.data.slice():e.data):s[r]&&"object"==typeof s[r]?s[r].y=e.data:void 0!==s[r]&&(s[r]=e.data)}return t}_copyOptionalViewFields(t,e,i){for(const r of x)(i?i.has(r):e[r])&&(t[r]=e[r])}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t,e){const i={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(i.labels=t.labels),this._copyOptionalViewFields(i,t,e),i}_apply(t,e,i){var r;const n=this.w;this._nav++,n.interact.selectedDataPoints=[],n.globals.collapsedSeries=[],n.globals.collapsedSeriesIndices=[],n.globals.ancillaryCollapsedSeries=[],n.globals.ancillaryCollapsedSeriesIndices=[],n.globals.allSeriesCollapsed=!1,n.globals.risingSeries=[],t.markers=a(l({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const s=(!n.config.drilldown.animation||!1!==n.config.drilldown.animation.enabled)&&!1!==n.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(r=this.ctx.highlightFilter)||r.drillView(t);const o=e=>this.ctx.updateOptions(t,!1,e,!1,!1),c=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(s&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>o(!1)).then(c)}return o(s).then(c)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!u.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const r=e.getBoundingClientRect();let n=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(n=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),n&&"function"==typeof n.getBoundingClientRect){const t=n.getBoundingClientRect();return{x:t.left+t.width/2-r.left,y:t.top+t.height/2-r.top}}const s=i.getBoundingClientRect();return{x:s.left+s.width/2-r.left,y:s.top+s.height/2-r.top}}_zoomDrill(t,e,i){return r=this,n=null,s=function*(){const r=this._zoomDuration(),n="down"===e,s=Math.round(.55*r),o=n?"scale(1.03)":"scale(0.97)",l=n?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",a=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},c=t=>{t.style.transform="",t.style.opacity="",t.style.transformOrigin="",t.style.transformBox=""},d=this._markGroup();let h=null;if(d){a(d),h=d.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:s,easing:"ease-in",fill:"forwards"});try{yield h.finished}catch(t){}}try{yield i()}catch(t){throw h&&(h.cancel(),c(d)),t}const u=this._markGroup();if(u){a(u),u.style.opacity="0",u.style.transform=l,h&&d===u&&h.cancel();const t=u.animate([{transform:l,opacity:0},{transform:"scale(1)",opacity:1}],{duration:r,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}c(u),t.cancel()}},new Promise((t,e)=>{var i=t=>{try{l(s.next(t))}catch(t){e(t)}},o=t=>{try{l(s.throw(t))}catch(t){e(t)}},l=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);l((s=s.apply(r,n)).next())});var r,n,s}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){var r;if(!i||!(null==(r=this.w.config.drilldown)?void 0:r.enabled)||this._retired())return;const n=this._pointAt(i.seriesIndex,i.dataPointIndex);return n&&"object"==typeof n&&null!=n.drilldown?this.drillDown(n.drilldown,n,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,n,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const r=i[t];return r&&Array.isArray(r.data)&&null!=r.data[e]?r.data[e]:null}_pointLabel(t,e){const i=t&&null!=t.x?t.x:e&&this.w.globals.labels[e.dataPointIndex];return null!=i?String(i):void 0}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){var t;const e=this.w;if(this._retired())return;const i=null==(t=e.config.drilldown)?void 0:t.enabled;(i||this.stack.length||this._wasOn)&&(this._wasOn=i,i&&(this._markDrillableTargets(),this._wirePlotClick()),this.breadcrumb.render(this.path),e.config.markers&&(e.config.markers.discrete=this._drillMarkers(i&&e.config.series)))}_markDrillableTargets(){if(!u.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;const r=new Set;if(i.forEach((t,e)=>{t&&Array.isArray(t.data)&&t.data.forEach((t,i)=>{t&&"object"==typeof t&&null!=t.drilldown&&r.add(e+":"+i)})}),!r.size)return;const n=new Set;e.querySelectorAll("[index][j]").forEach(t=>{const e=t.getAttribute("index")+":"+t.getAttribute("j");r.has(e)&&(n.add(e),this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target"))});const s=r.size-n.size;s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${s} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!u.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const r=t.target;if(!r||"function"!=typeof r.closest)return;if(r.closest(".apexcharts-drilldown-target"))return;if(r.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const n=e.interact.capturedSeriesIndex,s=e.interact.capturedDataPointIndex;if(null==n||null==s||n<0||s<0)return;if(!this._isPointBasedSeries(e.config.series[n]))return;const o=this._pointAt(n,s);return o&&"object"==typeof o&&null!=o.drilldown?this.drillDown(o.drilldown,o,{seriesIndex:n,dataPointIndex:s}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,r=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[y]):[],n=i&&i.marker||{};if(!1===n.show||!Array.isArray(t))return r;const s=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r={seriesIndex:e,dataPointIndex:i,[y]:!0};void 0!==n.size&&(r.size=n.size),void 0!==n.shape&&(r.shape=n.shape),void 0!==n.fillColor&&(r.fillColor=n.fillColor),void 0!==n.strokeColor&&(r.strokeColor=n.strokeColor),s.push(r)})}),r.concat(s)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,r=Array.isArray(i)?i[t]:i;return!(Number(r)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});