apexcharts 8.2.0 → 8.3.1

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 (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  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 +4 -2
  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 +10 -4
  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 +14 -9
  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 +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  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 +9 -5
  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 +2 -1
  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 +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  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 +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,i=(t,e)=>{for(var r in e||(e={}))s.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))o.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n));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 r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),u=h.__apex_Graphics,d=h.__apex_Utils;class f{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/f.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*f.xRatio(t)}static screenXToPlotPx(t,e){const r=t.dom.baseEl,n=r&&r.querySelector(".apexcharts-svg");if(!n)return e-t.layout.translateX;const s=n.getBoundingClientRect(),o=t.globals.svgWidth?s.width/t.globals.svgWidth:1;return(e-s.left)/(o||1)-t.layout.translateX}}const g=h.__apex_Environment_Environment;function p(t,e){const r=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const a=t||{},{hidden:c}=a,h=((t,e)=>{var r={};for(var a in t)s.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&n)for(var a of n(t))e.indexOf(a)<0&&o.call(t,a)&&(r[a]=t[a]);return r})(a,["hidden"]);let u=h.data;if(Array.isArray(u)&&!u.length){const t=r.find(t=>t.index===e);t&&Array.isArray(t.data)&&(u=t.data)}return l(i({},h),{data:Array.isArray(u)?u.slice():u})})}const m=["wiggle","silhouette","zero","expand"],y=["inside-out","inverse","none"];function b(t,e,r){const n=r&&void 0!==r[e]?r[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}function x(t,e){var r,n;const s=e.config,o=e.globals;if(!Array.isArray(t))return t;o.streamgraphRawSeries||(o.streamgraphRawSeries=p(t,o));const a=o.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const r=t[e],n=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(r=s.plotOptions)?void 0:r.streamgraph)||{},h=-1!==m.indexOf(c.offset)?c.offset:"wiggle",u=-1!==y.indexOf(c.order)?c.order:"inside-out",f=null==(n=s.xaxis)?void 0:n.categories,g=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(o),{xs:x,rows:v,grids:w}=function(t,e){var r;const n=[],s=[],o=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(r=t[l])?void 0:r.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:r,y:a,rest:l}=b(c[t],t,e),u=r instanceof Date?r.getTime():r;o.has(u)||(o.set(u,n.length),n.push(r),s.push(i({},l))),h.set(o.get(u),d.parseNumber(a))}a.push(h)}return{xs:n,rows:s,grids:a}}(a,f),_=function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r]instanceof Date?t[r].getTime():t[r];if("number"!=typeof n||!isFinite(n))return null;e.push(r)}const r=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));r.sort((t,e)=>t.v-e.v);const n=r.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(x),A=_?_.map(t=>x[t]):x,S=_?_.map(t=>v[t]):v,O=A.length;let F=!1;const P=[];for(let t=0;t<a.length;t++){const e=new Array(O);for(let r=0;r<O;r++){const n=w[t].get(_?_[r]:r);let s=null==n?0:Number(n);isFinite(s)||(s=0),s<0&&(F=!0,s=0),e[r]=s}P.push(e)}F&&!o.streamgraphWarnedNegative&&(o.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const T=[];for(let t=0;t<a.length;t++)-1===g.indexOf(t)&&T.push(t);let M=P;if("expand"===h){M=P.map(t=>t.slice());for(let t=0;t<O;t++){let e=0;for(let r=0;r<T.length;r++)e+=M[T[r]][t];if(e)for(let r=0;r<T.length;r++)M[T[r]][t]/=e}}const W=function(t,e,r){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},s={};for(let t=0;t<e.length;t++){const o=e[t],a=r[o];let i=0,l=-1/0,c=0;for(let t=0;t<a.length;t++)i+=a[t],a[t]>l&&(l=a[t],c=t);n[o]=i,s[o]=c}const o=e.slice().sort((t,e)=>s[t]-s[e]||t-e);let a=0,i=0;const l=[],c=[];for(let t=0;t<o.length;t++){const e=o[t];a<i?(a+=n[e],l.push(e)):(i+=n[e],c.push(e))}return c.reverse().concat(l)}(u,T,M),z=function(t,e,r,n){const s=new Array(n).fill(0);if(0===n||0===e.length)return s;if("zero"===t||"expand"===t)return s;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let s=0;s<e.length;s++)n+=r[e[s]][t];s[t]=-n/2}return s}let o=0;for(let t=1;t<n;t++){let n=0,a=0;for(let s=0;s<e.length;s++){const o=r[e[s]],i=o[t];let l=(i-o[t-1])/2;for(let n=0;n<s;n++){const s=r[e[n]];l+=s[t]-s[t-1]}n+=i,a+=l*i}n&&(o-=a/n),s[t]=o}return s}(h,W,M,O),E=a.map(()=>null),j=a.map(()=>null);for(let t=0;t<W.length;t++)E[W[t]]=new Array(O),j[W[t]]=new Array(O);for(let t=0;t<O;t++){let e=z[t];for(let r=0;r<W.length;r++){const n=W[r],s=E[n],o=j[n];s[t]=e,e+=M[n][t],o[t]=e}}return e.streamgraphData={names:a.map((t,e)=>{var r;return null!=(r=null==t?void 0:t.name)?r:`Series ${e+1}`}),xs:A,values:P,lows:E,highs:j,order:W,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},a.map((t,e)=>{const r=E[e],n=j[e];if(!r||!n)return l(i({},t),{data:[]});const s=new Array(O);for(let t=0;t<O;t++)s[t]=l(i({},S[t]),{x:A[t],y:[r[t],n[t]]});return l(i({},t),{data:s})})}const v="__apexcharts_series_transforms__";var w,_;globalThis[v]||(globalThis[v]={}),w="streamgraph","function"==typeof(_=x)?globalThis[v][w]=_:console.warn(`ApexCharts: registerSeriesTransform("${w}") expects a function (series, w) => series.`),h.default.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const r=this.w,n=r.globals,s=r.layout.gridHeight,o=n.maxY-n.minY;if(!o||!isFinite(o))return s/2;const a=(t-n.minY)/o;return(null==(e=r.config.yaxis[0])?void 0:e.reversed)?a*s:s-a*s}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,r,n,s,o,a;const i=this.w;if(!this.isActive())return;const l=null==(e=null==(t=i.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const c=i.dom.elGraphical,h=i.streamgraphData;if(!c||!h)return;this.removeLabels();const d=new u(i,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(r=l.style)?void 0:r.fontSize)||"auto",p=(null==(n=l.style)?void 0:n.fontFamily)||i.config.chart.fontFamily,m=(null==(s=l.style)?void 0:s.fontWeight)||600,y=null==l.minWidth?24:l.minWidth,b=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],r=this._placeLabel(e,{fontSize:g,fontFamily:p,fontWeight:m,minWidth:y,graphics:d});r&&b.push(r)}let x=0;for(const t of this._deconflict(b)){const e=t.k,r=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:p,fontWeight:m,foreColor:(null==(a=null==(o=l.style)?void 0:o.colors)?void 0:a[e])||t.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(e)),f.add(r),x++}if(!x)return;const v=c.node.querySelector(".apexcharts-xaxis");v?c.node.insertBefore(f.node,v):c.add(f),this.holdUntilBandsLand(f)}_placeLabel(t,{fontSize:e,fontFamily:r,fontWeight:n,minWidth:s,graphics:o}){const a=this.w,i=a.streamgraphData,l=i.lows[t],c=i.highs[t];if(!l||!c)return null;const h=a.globals.seriesXvalues[t],u=l.length;if(!Array.isArray(h)||h.length<u||0===u)return null;const d=new Array(u);let f=0;for(let t=0;t<u;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));d[t]=e,e>f&&(f=e)}if(f<=0)return null;const g=this._resolveFontSize(e,f),p=String(i.names[t]);let m=g,y=o.getTextRects(p,`${m}px`,r,"",!0,n);if(f<y.height+6)return null;const b=this._widestRun(d,h,y.height+6,u);if(!b)return null;if(y.width>b.width&&"auto"===e){const t=Math.floor(m*(b.width/y.width));if(t<this._autoBounds().min)return null;if(m=t,y=o.getTextRects(p,`${m}px`,r,"",!0,n),f<y.height+6)return null}const x=y.height+6,v=[];for(const e of this._runs(d,x,u)){const n=Number(h[e.l]),a=Number(h[e.r]);if(!isFinite(n)||!isFinite(a))continue;let i=a-n;if(i<=0&&u>1){const t=Math.abs(Number(h[Math.min(e.r+1,u-1)])-Number(h[Math.max(e.l-1,0)]));i=isFinite(t)?t:0}if(i<s||i<.35*y.width)continue;const d=y.width<=i?p:o.getTextBasedOnMaxWidth({text:p,maxWidth:i,fontSize:`${m}px`,fontFamily:r});if(!d||"..."===d)continue;const f=d===p?y.width:y.width*(d.length/p.length),g=[n+i/2];i>2.2*f&&g.push(n+f/2+2,a-f/2-2);for(const r of g){let n=e.l,s=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-r);e<s&&(s=e,n=t)}v.push({x:r,y:(this._yPx(l[n])+this._yPx(c[n]))/2,text:d,color:this._contrastOn(t),fontSize:`${m}px`,width:f,height:y.height})}if(v.length>=6)break}return v.length?{k:t,weight:f,candidates:v}:null}_runs(t,e,r){const n=[];let s=0;for(;s<r;){if(t[s]<e){s++;continue}let o=s,a=t[s];for(;o+1<r&&t[o+1]>=e;)o++,t[o]>a&&(a=t[o]);n.push({l:s,r:o,maxT:a}),s=o+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,r,n){let s=-1;for(const o of this._runs(t,r,n)){const t=Number(e[o.r])-Number(e[o.l]);isFinite(t)&&t>s&&(s=t)}return s>=0?{width:s}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),r=[],n=t=>!r.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const s={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(n(s)){r.push(l(i({k:t.k},e),{box:s}));break}}return r}_autoBounds(){var t,e;const r=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:r,max:n}=this._autoBounds();return Math.max(r,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const r=this.w,n=null==(e=r.globals.colors)?void 0:e[t],s="string"==typeof n?d.parseHex(n):null;return s?d.relativeLuminance(s)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,r=e.streamgraphData;if(!r||!r.order.length)return-1;const n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const s=n.getBoundingClientRect(),o=e.globals.svgWidth?s.width/e.globals.svgWidth:1,a=f.screenXToPlotPx(e,t.clientX),i=(t.clientY-s.top)/(o||1)-e.layout.translateY;if(a<0||a>e.layout.gridWidth)return-1;if(i<0||i>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[r.order[0]];if(!Array.isArray(l)||!l.length)return-1;const c=e.interact?e.interact.capturedDataPointIndex:-1;let h=-1;if(c>=0&&c<l.length)h=c;else{let t=1/0;for(let e=0;e<l.length;e++){const r=Math.abs(Number(l[e])-a);r<t&&(t=r,h=e)}}if(h<0)return-1;let u=-1,d=1/0;for(let t=0;t<r.order.length;t++){const e=r.order[t],n=this._yPx(r.highs[e][h]),s=this._yPx(r.lows[e][h]),o=Math.min(n,s),a=Math.max(n,s);if(i>=o&&i<=a)return e;const l=i<o?o-i:i-a;l<d&&(d=l,u=e)}return u}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const r=this._hoverCfg(),n=null==r.opacity?.35:r.opacity,s=e.dom.baseEl.querySelectorAll(".apexcharts-series"),o=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(e,r)=>t<0||r===t;for(let t=0;t<s.length;t++){const e=s[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}for(let t=0;t<o.length;t++){const r=o[t];r.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",e.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const r=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<r.length;t++)this._restoreLabel(r[t])}holdUntilBandsLand(t){const e=this.w;g.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default}),exports.streamgraphTransform=x;
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,i=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))s.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n));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 r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),u=h.__apex_Graphics,d=h.__apex_Utils;class f{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/f.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*f.xRatio(t)}static plotRect(t){var e,r,n;const o=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(r=t.dom.baseEl)?void 0:r.querySelector(".apexcharts-svg")),s=(null==(n=o||t.dom.elWrap)?void 0:n.getBoundingClientRect())||{left:0,top:0,width:0},a=(o&&t.globals.svgWidth?s.width/t.globals.svgWidth:1)||1;return{left:s.left+t.layout.translateX*a,top:s.top+t.layout.translateY*a,width:t.layout.gridWidth*a,height:t.layout.gridHeight*a,zoom:a}}static screenXToPlotPx(t,e,r=f.plotRect(t)){return(e-r.left)/r.zoom}}const g=h.__apex_Environment_Environment;function p(t,e){const r=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const a=t||{},{hidden:c}=a,h=((t,e)=>{var r={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&n)for(var a of n(t))e.indexOf(a)<0&&s.call(t,a)&&(r[a]=t[a]);return r})(a,["hidden"]);let u=h.data;if(Array.isArray(u)&&!u.length){const t=r.find(t=>t.index===e);t&&Array.isArray(t.data)&&(u=t.data)}return l(i({},h),{data:Array.isArray(u)?u.slice():u})})}const m=["wiggle","silhouette","zero","expand"],y=["inside-out","inverse","none"];function b(t,e,r){const n=r&&void 0!==r[e]?r[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}function x(t,e){var r,n;const o=e.config,s=e.globals;if(!Array.isArray(t))return t;s.streamgraphRawSeries||(s.streamgraphRawSeries=p(t,s));const a=s.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const r=t[e],n=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(r=o.plotOptions)?void 0:r.streamgraph)||{},h=-1!==m.indexOf(c.offset)?c.offset:"wiggle",u=-1!==y.indexOf(c.order)?c.order:"inside-out",f=null==(n=o.xaxis)?void 0:n.categories,g=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(s),{xs:x,rows:v,grids:w}=function(t,e){var r;const n=[],o=[],s=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(r=t[l])?void 0:r.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:r,y:a,rest:l}=b(c[t],t,e),u=r instanceof Date?r.getTime():r;s.has(u)||(s.set(u,n.length),n.push(r),o.push(i({},l))),h.set(s.get(u),d.parseNumber(a))}a.push(h)}return{xs:n,rows:o,grids:a}}(a,f),_=function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r]instanceof Date?t[r].getTime():t[r];if("number"!=typeof n||!isFinite(n))return null;e.push(r)}const r=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));r.sort((t,e)=>t.v-e.v);const n=r.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(x),A=_?_.map(t=>x[t]):x,S=_?_.map(t=>v[t]):v,O=A.length;let P=!1;const F=[];for(let t=0;t<a.length;t++){const e=new Array(O);for(let r=0;r<O;r++){const n=w[t].get(_?_[r]:r);let o=null==n?0:Number(n);isFinite(o)||(o=0),o<0&&(P=!0,o=0),e[r]=o}F.push(e)}P&&!s.streamgraphWarnedNegative&&(s.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const T=[];for(let t=0;t<a.length;t++)-1===g.indexOf(t)&&T.push(t);let W=F;if("expand"===h){W=F.map(t=>t.slice());for(let t=0;t<O;t++){let e=0;for(let r=0;r<T.length;r++)e+=W[T[r]][t];if(e)for(let r=0;r<T.length;r++)W[T[r]][t]/=e}}const z=function(t,e,r){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},o={};for(let t=0;t<e.length;t++){const s=e[t],a=r[s];let i=0,l=-1/0,c=0;for(let t=0;t<a.length;t++)i+=a[t],a[t]>l&&(l=a[t],c=t);n[s]=i,o[s]=c}const s=e.slice().sort((t,e)=>o[t]-o[e]||t-e);let a=0,i=0;const l=[],c=[];for(let t=0;t<s.length;t++){const e=s[t];a<i?(a+=n[e],l.push(e)):(i+=n[e],c.push(e))}return c.reverse().concat(l)}(u,T,W),M=function(t,e,r,n){const o=new Array(n).fill(0);if(0===n||0===e.length)return o;if("zero"===t||"expand"===t)return o;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let o=0;o<e.length;o++)n+=r[e[o]][t];o[t]=-n/2}return o}let s=0;for(let t=1;t<n;t++){let n=0,a=0;for(let o=0;o<e.length;o++){const s=r[e[o]],i=s[t];let l=(i-s[t-1])/2;for(let n=0;n<o;n++){const o=r[e[n]];l+=o[t]-o[t-1]}n+=i,a+=l*i}n&&(s-=a/n),o[t]=s}return o}(h,z,W,O),E=a.map(()=>null),j=a.map(()=>null);for(let t=0;t<z.length;t++)E[z[t]]=new Array(O),j[z[t]]=new Array(O);for(let t=0;t<O;t++){let e=M[t];for(let r=0;r<z.length;r++){const n=z[r],o=E[n],s=j[n];o[t]=e,e+=W[n][t],s[t]=e}}return e.streamgraphData={names:a.map((t,e)=>{var r;return null!=(r=null==t?void 0:t.name)?r:`Series ${e+1}`}),xs:A,values:F,lows:E,highs:j,order:z,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},a.map((t,e)=>{const r=E[e],n=j[e];if(!r||!n)return l(i({},t),{data:[]});const o=new Array(O);for(let t=0;t<O;t++)o[t]=l(i({},S[t]),{x:A[t],y:[r[t],n[t]]});return l(i({},t),{data:o})})}const v="__apexcharts_series_transforms__";var w,_;globalThis[v]||(globalThis[v]={}),w="streamgraph","function"==typeof(_=x)?globalThis[v][w]=_:console.warn(`ApexCharts: registerSeriesTransform("${w}") expects a function (series, w) => series.`),h.default.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const r=this.w,n=r.globals,o=r.layout.gridHeight,s=n.maxY-n.minY;if(!s||!isFinite(s))return o/2;const a=(t-n.minY)/s;return(null==(e=r.config.yaxis[0])?void 0:e.reversed)?a*o:o-a*o}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,r,n,o,s,a;const i=this.w;if(!this.isActive())return;const l=null==(e=null==(t=i.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const c=i.dom.elGraphical,h=i.streamgraphData;if(!c||!h)return;this.removeLabels();const d=new u(i,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(r=l.style)?void 0:r.fontSize)||"auto",p=(null==(n=l.style)?void 0:n.fontFamily)||i.config.chart.fontFamily,m=(null==(o=l.style)?void 0:o.fontWeight)||600,y=null==l.minWidth?24:l.minWidth,b=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],r=this._placeLabel(e,{fontSize:g,fontFamily:p,fontWeight:m,minWidth:y,graphics:d});r&&b.push(r)}let x=0;for(const t of this._deconflict(b)){const e=t.k,r=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:p,fontWeight:m,foreColor:(null==(a=null==(s=l.style)?void 0:s.colors)?void 0:a[e])||t.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(e)),f.add(r),x++}if(!x)return;const v=c.node.querySelector(".apexcharts-xaxis");v?c.node.insertBefore(f.node,v):c.add(f),this.holdUntilBandsLand(f)}_placeLabel(t,{fontSize:e,fontFamily:r,fontWeight:n,minWidth:o,graphics:s}){const a=this.w,i=a.streamgraphData,l=i.lows[t],c=i.highs[t];if(!l||!c)return null;const h=a.globals.seriesXvalues[t],u=l.length;if(!Array.isArray(h)||h.length<u||0===u)return null;const d=new Array(u);let f=0;for(let t=0;t<u;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));d[t]=e,e>f&&(f=e)}if(f<=0)return null;const g=this._resolveFontSize(e,f),p=String(i.names[t]);let m=g,y=s.getTextRects(p,`${m}px`,r,"",!0,n);if(f<y.height+6)return null;const b=this._widestRun(d,h,y.height+6,u);if(!b)return null;if(y.width>b.width&&"auto"===e){const t=Math.floor(m*(b.width/y.width));if(t<this._autoBounds().min)return null;if(m=t,y=s.getTextRects(p,`${m}px`,r,"",!0,n),f<y.height+6)return null}const x=y.height+6,v=[];for(const e of this._runs(d,x,u)){const a=Number(h[e.l]),i=Number(h[e.r]);if(!isFinite(a)||!isFinite(i))continue;let d=i-a;if(d<=0&&u>1){const t=Math.abs(Number(h[Math.min(e.r+1,u-1)])-Number(h[Math.max(e.l-1,0)]));d=isFinite(t)?t:0}if(d<o||d<.35*y.width)continue;const f=y.width<=d?p:s.getTextBasedOnMaxWidth({text:p,maxWidth:d,fontSize:`${m}px`,fontFamily:r,fontWeight:n});if(!f||"..."===f)continue;const g=f===p?y.width:y.width*(f.length/p.length),b=[a+d/2];d>2.2*g&&b.push(a+g/2+2,i-g/2-2);for(const r of b){let n=e.l,o=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-r);e<o&&(o=e,n=t)}v.push({x:r,y:(this._yPx(l[n])+this._yPx(c[n]))/2,text:f,color:this._contrastOn(t),fontSize:`${m}px`,width:g,height:y.height})}if(v.length>=6)break}return v.length?{k:t,weight:f,candidates:v}:null}_runs(t,e,r){const n=[];let o=0;for(;o<r;){if(t[o]<e){o++;continue}let s=o,a=t[o];for(;s+1<r&&t[s+1]>=e;)s++,t[s]>a&&(a=t[s]);n.push({l:o,r:s,maxT:a}),o=s+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,r,n){let o=-1;for(const s of this._runs(t,r,n)){const t=Number(e[s.r])-Number(e[s.l]);isFinite(t)&&t>o&&(o=t)}return o>=0?{width:o}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),r=[],n=t=>!r.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const o={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(n(o)){r.push(l(i({k:t.k},e),{box:o}));break}}return r}_autoBounds(){var t,e;const r=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:r,max:n}=this._autoBounds();return Math.max(r,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const r=this.w,n=null==(e=r.globals.colors)?void 0:e[t],o="string"==typeof n?d.parseHex(n):null;return o?d.relativeLuminance(o)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,r=e.streamgraphData;if(!r||!r.order.length)return-1;const n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const o=n.getBoundingClientRect(),s=e.globals.svgWidth?o.width/e.globals.svgWidth:1,a=f.screenXToPlotPx(e,t.clientX),i=(t.clientY-o.top)/(s||1)-e.layout.translateY;if(a<0||a>e.layout.gridWidth)return-1;if(i<0||i>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[r.order[0]];if(!Array.isArray(l)||!l.length)return-1;const c=e.interact?e.interact.capturedDataPointIndex:-1;let h=-1;if(c>=0&&c<l.length)h=c;else{let t=1/0;for(let e=0;e<l.length;e++){const r=Math.abs(Number(l[e])-a);r<t&&(t=r,h=e)}}if(h<0)return-1;let u=-1,d=1/0;for(let t=0;t<r.order.length;t++){const e=r.order[t],n=this._yPx(r.highs[e][h]),o=this._yPx(r.lows[e][h]),s=Math.min(n,o),a=Math.max(n,o);if(i>=s&&i<=a)return e;const l=i<s?s-i:i-a;l<d&&(d=l,u=e)}return u}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const r=this._hoverCfg(),n=null==r.opacity?.35:r.opacity,o=e.dom.baseEl.querySelectorAll(".apexcharts-series"),s=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(e,r)=>t<0||r===t;for(let t=0;t<o.length;t++){const e=o[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}for(let t=0;t<s.length;t++){const r=s[t];r.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",e.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const r=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<r.length;t++)this._restoreLabel(r[t])}holdUntilBandsLand(t){const e=this.w;g.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default}),exports.streamgraphTransform=x;
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  /*!
33
- * ApexCharts v8.2.0
33
+ * ApexCharts v8.3.1
34
34
  * (c) 2018-2026 ApexCharts
35
35
  */
36
36
  import * as _core from "apexcharts/core";
@@ -68,22 +68,55 @@ class AxisMapping {
68
68
  return w.globals.minX + px * AxisMapping.xRatio(w);
69
69
  }
70
70
  /**
71
- * Client (screen) x -> pixels from the plot origin. The origin is the svg
72
- * element's left edge plus `translateX`, never the `.apexcharts-grid` box
73
- * (fact 2 above), so the result does not depend on what the grid happens to
74
- * render. `svgWidth` is the unscaled width the svg was drawn at, so the ratio
75
- * against the measured one is the CSS zoom of any container the chart sits in.
71
+ * The plot area on screen, in client px: its corner is where the plot's
72
+ * group is translated to (translateX, translateY into the svg), and it is
73
+ * gridWidth by gridHeight. The one screen-to-plot measurement: the tooltip,
74
+ * zoom, selection and every other pointer reader map through it, so x and y
75
+ * cannot disagree under CSS zoom.
76
+ *
77
+ * Never the `.apexcharts-grid` group's box: a group measures to the union
78
+ * of what it happens to draw (fact 2 above). The plot's outline starts a
79
+ * pixel down (`Grid.drawGridArea`), so unless gridlines or row bands reach
80
+ * the top edge the box starts a pixel below the plot, and on a numeric-x bar
81
+ * chart the horizontal gridlines run `barPadForNumericAxis` out past both
82
+ * sides.
83
+ *
84
+ * `zoom` is the CSS zoom of any container the chart sits in (screen px per
85
+ * plot px): the measured svg width over `svgWidth`, the unscaled width it
86
+ * was drawn at. A distance measured on screen from this corner is divided
87
+ * by it to land in plot px, the space the series are laid out and painted in.
88
+ * With nothing mounted to measure, screen px are taken as svg px.
89
+ *
90
+ * @param {import('../types/internal').ChartStateW} w
91
+ * @returns {{ left: number, top: number, width: number, height: number, zoom: number }}
92
+ */
93
+ static plotRect(w) {
94
+ var _a, _b, _c;
95
+ const svg = ((_a = w.dom.Paper) == null ? void 0 : _a.node) || ((_b = w.dom.baseEl) == null ? void 0 : _b.querySelector(".apexcharts-svg"));
96
+ const box = ((_c = svg || w.dom.elWrap) == null ? void 0 : _c.getBoundingClientRect()) || {
97
+ left: 0,
98
+ top: 0,
99
+ width: 0
100
+ };
101
+ const zoom = (svg && w.globals.svgWidth ? box.width / w.globals.svgWidth : 1) || 1;
102
+ return {
103
+ left: box.left + w.layout.translateX * zoom,
104
+ top: box.top + w.layout.translateY * zoom,
105
+ width: w.layout.gridWidth * zoom,
106
+ height: w.layout.gridHeight * zoom,
107
+ zoom
108
+ };
109
+ }
110
+ /**
111
+ * Client (screen) x -> pixels from the plot origin of {@link plotRect}.
112
+ * Pass the rect when the caller has already measured it.
76
113
  * @param {import('../types/internal').ChartStateW} w
77
114
  * @param {number} screenX
115
+ * @param {{ left: number, zoom: number }} [plot]
78
116
  * @returns {number}
79
117
  */
80
- static screenXToPlotPx(w, screenX) {
81
- const baseEl = w.dom.baseEl;
82
- const svg = baseEl && baseEl.querySelector(".apexcharts-svg");
83
- if (!svg) return screenX - w.layout.translateX;
84
- const svgRect = svg.getBoundingClientRect();
85
- const zoom = w.globals.svgWidth ? svgRect.width / w.globals.svgWidth : 1;
86
- return (screenX - svgRect.left) / (zoom || 1) - w.layout.translateX;
118
+ static screenXToPlotPx(w, screenX, plot = AxisMapping.plotRect(w)) {
119
+ return (screenX - plot.left) / plot.zoom;
87
120
  }
88
121
  }
89
122
  const Environment = _core.__apex_Environment_Environment;
@@ -277,7 +310,8 @@ class StreamLabels {
277
310
  text: name,
278
311
  maxWidth: span,
279
312
  fontSize: `${px}px`,
280
- fontFamily
313
+ fontFamily,
314
+ fontWeight
281
315
  });
282
316
  if (!text || text === "...") continue;
283
317
  const drawnWidth = text === name ? rect.width : rect.width * (text.length / name.length);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(e){var t="undefined"!=typeof globalThis?globalThis:self,r=t.ApexCharts;if(r&&r.__internals)return e.call(t);if(r)throw new Error("ApexCharts: dist/features/streamgraph.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/streamgraph.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/streamgraph.js",run:e,done:!1},a=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);a.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var r=t.ApexCharts;if(r)if(r.__internals){s.done=!0;var n=a.indexOf(s);-1!==n&&a.splice(n,1);try{e.call(t),r.__drainsAddons||t.console.warn("ApexCharts: dist/features/streamgraph.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/streamgraph.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/streamgraph.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/streamgraph.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";var t=Object.defineProperty,r=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(e,r,s)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,l=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&i(e,r,t[r]);if(a)for(var r of a(t))o.call(t,r)&&i(e,r,t[r]);return e},h=(e,t)=>r(e,s(t));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Graphics,f=globalThis.ApexCharts.__internals.__apex_Utils;class u{static xRatio(e){const t=e.layout.gridWidth||1;return(e.globals.maxX-e.globals.minX)/t}static dataXToPx(e,t){return(t-e.globals.minX)/u.xRatio(e)}static pxToDataX(e,t){return e.globals.minX+t*u.xRatio(e)}static screenXToPlotPx(e,t){const r=e.dom.baseEl,s=r&&r.querySelector(".apexcharts-svg");if(!s)return t-e.layout.translateX;const a=s.getBoundingClientRect(),n=e.globals.svgWidth?a.width/e.globals.svgWidth:1;return(t-a.left)/(n||1)-e.layout.translateX}}const p=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function g(e,t){const r=(t.collapsedSeries||[]).concat(t.ancillaryCollapsedSeries||[]);return e.map((e,t)=>{const s=e||{},{hidden:i}=s,c=((e,t)=>{var r={};for(var s in e)n.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&a)for(var s of a(e))t.indexOf(s)<0&&o.call(e,s)&&(r[s]=e[s]);return r})(s,["hidden"]);let d=c.data;if(Array.isArray(d)&&!d.length){const e=r.find(e=>e.index===t);e&&Array.isArray(e.data)&&(d=e.data)}return h(l({},c),{data:Array.isArray(d)?d.slice():d})})}const m=["wiggle","silhouette","zero","expand"],x=["inside-out","inverse","none"];function y(e,t,r){const s=r&&void 0!==r[t]?r[t]:t+1;return null==e?{x:s,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:s,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:s,y:e.y,rest:e}:{x:s,y:e,rest:{}}}function b(e,t){var r,s;const a=t.config,n=t.globals;if(!Array.isArray(e))return e;n.streamgraphRawSeries||(n.streamgraphRawSeries=g(e,n));const o=n.streamgraphRawSeries;if(o.some(e=>function(e){for(let t=0;t<e.length;t++){const r=e[t],s=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[])))return t.streamgraphData=null,e;const i=(null==(r=a.plotOptions)?void 0:r.streamgraph)||{},c=-1!==m.indexOf(i.offset)?i.offset:"wiggle",d=-1!==x.indexOf(i.order)?i.order:"inside-out",u=null==(s=a.xaxis)?void 0:s.categories,p=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(n),{xs:b,rows:v,grids:w}=function(e,t){var r;const s=[],a=[],n=new Map,o=[];for(let i=0;i<e.length;i++){const h=Array.isArray(null==(r=e[i])?void 0:r.data)?e[i].data:[],c=new Map;for(let e=0;e<h.length;e++){const{x:r,y:o,rest:i}=y(h[e],e,t),d=r instanceof Date?r.getTime():r;n.has(d)||(n.set(d,s.length),s.push(r),a.push(l({},i))),c.set(n.get(d),f.parseNumber(o))}o.push(c)}return{xs:s,rows:a,grids:o}}(o,u),_=function(e){const t=[];for(let r=0;r<e.length;r++){const s=e[r]instanceof Date?e[r].getTime():e[r];if("number"!=typeof s||!isFinite(s))return null;t.push(r)}const r=t.map(t=>({j:t,v:e[t]instanceof Date?e[t].getTime():e[t]}));r.sort((e,t)=>e.v-t.v);const s=r.map(e=>e.j);for(let e=0;e<s.length;e++)if(s[e]!==e)return s;return null}(b),A=_?_.map(e=>b[e]):b,S=_?_.map(e=>v[e]):v,C=A.length;let j=!1;const T=[];for(let e=0;e<o.length;e++){const t=new Array(C);for(let r=0;r<C;r++){const s=w[e].get(_?_[r]:r);let a=null==s?0:Number(s);isFinite(a)||(a=0),a<0&&(j=!0,a=0),t[r]=a}T.push(t)}j&&!n.streamgraphWarnedNegative&&(n.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const O=[];for(let e=0;e<o.length;e++)-1===p.indexOf(e)&&O.push(e);let F=T;if("expand"===c){F=T.map(e=>e.slice());for(let e=0;e<C;e++){let t=0;for(let r=0;r<O.length;r++)t+=F[O[r]][e];if(t)for(let r=0;r<O.length;r++)F[O[r]][e]/=t}}const E=function(e,t,r){if("none"===e)return t.slice();if("inverse"===e)return t.slice().reverse();const s={},a={};for(let e=0;e<t.length;e++){const n=t[e],o=r[n];let i=0,l=-1/0,h=0;for(let e=0;e<o.length;e++)i+=o[e],o[e]>l&&(l=o[e],h=e);s[n]=i,a[n]=h}const n=t.slice().sort((e,t)=>a[e]-a[t]||e-t);let o=0,i=0;const l=[],h=[];for(let e=0;e<n.length;e++){const t=n[e];o<i?(o+=s[t],l.push(t)):(i+=s[t],h.push(t))}return h.reverse().concat(l)}(d,O,F),P=function(e,t,r,s){const a=new Array(s).fill(0);if(0===s||0===t.length)return a;if("zero"===e||"expand"===e)return a;if("silhouette"===e){for(let e=0;e<s;e++){let s=0;for(let a=0;a<t.length;a++)s+=r[t[a]][e];a[e]=-s/2}return a}let n=0;for(let e=1;e<s;e++){let s=0,o=0;for(let a=0;a<t.length;a++){const n=r[t[a]],i=n[e];let l=(i-n[e-1])/2;for(let s=0;s<a;s++){const a=r[t[s]];l+=a[e]-a[e-1]}s+=i,o+=l*i}s&&(n-=o/s),a[e]=n}return a}(c,E,F,C),L=o.map(()=>null),W=o.map(()=>null);for(let e=0;e<E.length;e++)L[E[e]]=new Array(C),W[E[e]]=new Array(C);for(let e=0;e<C;e++){let t=P[e];for(let r=0;r<E.length;r++){const s=E[r],a=L[s],n=W[s];a[e]=t,t+=F[s][e],n[e]=t}}return t.streamgraphData={names:o.map((e,t)=>{var r;return null!=(r=null==e?void 0:e.name)?r:`Series ${t+1}`}),xs:A,values:T,lows:L,highs:W,order:E,offset:c,hidden:o.map((e,t)=>t).filter(e=>-1!==p.indexOf(e))},o.map((e,t)=>{const r=L[t],s=W[t];if(!r||!s)return h(l({},e),{data:[]});const a=new Array(C);for(let e=0;e<C;e++)a[e]=h(l({},S[e]),{x:A[e],y:[r[e],s[e]]});return h(l({},e),{data:a})})}const v="__apexcharts_series_transforms__";var w,_;globalThis[v]||(globalThis[v]={}),w="streamgraph","function"==typeof(_=b)?globalThis[v][w]=_:console.warn(`ApexCharts: registerSeriesTransform("${w}") expects a function (series, w) => series.`),c.registerFeatures({streamgraph:class{constructor(e,t){this.w=e,this.ctx=t,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(e){var t;const r=this.w,s=r.globals,a=r.layout.gridHeight,n=s.maxY-s.minY;if(!n||!isFinite(n))return a/2;const o=(e-s.minY)/n;return(null==(t=r.config.yaxis[0])?void 0:t.reversed)?o*a:a-o*a}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var e,t,r,s,a,n,o;const i=this.w;if(!this.isActive())return;const l=null==(t=null==(e=i.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels;if(!l||!1===l.show)return;const h=i.dom.elGraphical,c=i.streamgraphData;if(!h||!c)return;this.removeLabels();const f=new d(i,this.ctx),u=f.group({class:"apexcharts-streamgraph-labels"}),p=(null==(r=l.style)?void 0:r.fontSize)||"auto",g=(null==(s=l.style)?void 0:s.fontFamily)||i.config.chart.fontFamily,m=(null==(a=l.style)?void 0:a.fontWeight)||600,x=null==l.minWidth?24:l.minWidth,y=[];for(let e=0;e<c.order.length;e++){const t=c.order[e],r=this._placeLabel(t,{fontSize:p,fontFamily:g,fontWeight:m,minWidth:x,graphics:f});r&&y.push(r)}let b=0;for(const e of this._deconflict(y)){const t=e.k,r=f.drawText({x:e.x,y:e.y,text:e.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:e.fontSize,fontFamily:g,fontWeight:m,foreColor:(null==(o=null==(n=l.style)?void 0:n.colors)?void 0:o[t])||e.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(t)),u.add(r),b++}if(!b)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(u.node,v):h.add(u),this.holdUntilBandsLand(u)}_placeLabel(e,{fontSize:t,fontFamily:r,fontWeight:s,minWidth:a,graphics:n}){const o=this.w,i=o.streamgraphData,l=i.lows[e],h=i.highs[e];if(!l||!h)return null;const c=o.globals.seriesXvalues[e],d=l.length;if(!Array.isArray(c)||c.length<d||0===d)return null;const f=new Array(d);let u=0;for(let e=0;e<d;e++){const t=Math.abs(this._yPx(h[e])-this._yPx(l[e]));f[e]=t,t>u&&(u=t)}if(u<=0)return null;const p=this._resolveFontSize(t,u),g=String(i.names[e]);let m=p,x=n.getTextRects(g,`${m}px`,r,"",!0,s);if(u<x.height+6)return null;const y=this._widestRun(f,c,x.height+6,d);if(!y)return null;if(x.width>y.width&&"auto"===t){const e=Math.floor(m*(y.width/x.width));if(e<this._autoBounds().min)return null;if(m=e,x=n.getTextRects(g,`${m}px`,r,"",!0,s),u<x.height+6)return null}const b=x.height+6,v=[];for(const t of this._runs(f,b,d)){const s=Number(c[t.l]),o=Number(c[t.r]);if(!isFinite(s)||!isFinite(o))continue;let i=o-s;if(i<=0&&d>1){const e=Math.abs(Number(c[Math.min(t.r+1,d-1)])-Number(c[Math.max(t.l-1,0)]));i=isFinite(e)?e:0}if(i<a||i<.35*x.width)continue;const f=x.width<=i?g:n.getTextBasedOnMaxWidth({text:g,maxWidth:i,fontSize:`${m}px`,fontFamily:r});if(!f||"..."===f)continue;const u=f===g?x.width:x.width*(f.length/g.length),p=[s+i/2];i>2.2*u&&p.push(s+u/2+2,o-u/2-2);for(const r of p){let s=t.l,a=1/0;for(let e=t.l;e<=t.r;e++){const t=Math.abs(Number(c[e])-r);t<a&&(a=t,s=e)}v.push({x:r,y:(this._yPx(l[s])+this._yPx(h[s]))/2,text:f,color:this._contrastOn(e),fontSize:`${m}px`,width:u,height:x.height})}if(v.length>=6)break}return v.length?{k:e,weight:u,candidates:v}:null}_runs(e,t,r){const s=[];let a=0;for(;a<r;){if(e[a]<t){a++;continue}let n=a,o=e[a];for(;n+1<r&&e[n+1]>=t;)n++,e[n]>o&&(o=e[n]);s.push({l:a,r:n,maxT:o}),a=n+1}return s.sort((e,t)=>t.maxT-e.maxT)}_widestRun(e,t,r,s){let a=-1;for(const n of this._runs(e,r,s)){const e=Number(t[n.r])-Number(t[n.l]);isFinite(e)&&e>a&&(a=e)}return a>=0?{width:a}:null}_deconflict(e){const t=e.slice().sort((e,t)=>t.weight-e.weight),r=[],s=e=>!r.some(t=>e.left<t.box.right&&e.right>t.box.left&&e.top<t.box.bottom&&e.bottom>t.box.top);for(const e of t)for(const t of e.candidates){const a={left:t.x-t.width/2,right:t.x+t.width/2,top:t.y-t.height/2,bottom:t.y+t.height/2};if(s(a)){r.push(h(l({k:e.k},t),{box:a}));break}}return r}_autoBounds(){var e,t;const r=(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(e,t){if("auto"!==e){const t=parseFloat(e);return isFinite(t)&&t>0?t:12}const{min:r,max:s}=this._autoBounds();return Math.max(r,Math.min(s,Math.round(.36*t)))}_contrastOn(e){var t;const r=this.w,s=null==(t=r.globals.colors)?void 0:t[e],a="string"==typeof s?f.parseHex(s):null;return a?f.relativeLuminance(a)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const e=this.w.dom.elGraphical,t=e&&e.node.querySelector(".apexcharts-streamgraph-labels");t&&t.parentNode&&t.parentNode.removeChild(t)}bindHover(){const e=this.w;if(!p.isBrowser())return;if(!1===this._hoverCfg().show)return;const t=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");t&&!t.__apexStreamHover&&(t.__apexStreamHover=!0,t.addEventListener("mousemove",e=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(e))}),t.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var e,t;return(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.hover)||{}}_bandAt(e){const t=this.w,r=t.streamgraphData;if(!r||!r.order.length)return-1;const s=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");if(!s)return-1;const a=s.getBoundingClientRect(),n=t.globals.svgWidth?a.width/t.globals.svgWidth:1,o=u.screenXToPlotPx(t,e.clientX),i=(e.clientY-a.top)/(n||1)-t.layout.translateY;if(o<0||o>t.layout.gridWidth)return-1;if(i<0||i>t.layout.gridHeight)return-1;const l=t.globals.seriesXvalues[r.order[0]];if(!Array.isArray(l)||!l.length)return-1;const h=t.interact?t.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<l.length)c=h;else{let e=1/0;for(let t=0;t<l.length;t++){const r=Math.abs(Number(l[t])-o);r<e&&(e=r,c=t)}}if(c<0)return-1;let d=-1,f=1/0;for(let e=0;e<r.order.length;e++){const t=r.order[e],s=this._yPx(r.highs[t][c]),a=this._yPx(r.lows[t][c]),n=Math.min(s,a),o=Math.max(s,a);if(i>=n&&i<=o)return t;const l=i<n?n-i:i-o;l<f&&(f=l,d=t)}return d}_dim(e){const t=this.w;if(e===this._hovered)return;this._hovered=e;const r=this._hoverCfg(),s=null==r.opacity?.35:r.opacity,a=t.dom.baseEl.querySelectorAll(".apexcharts-series"),n=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),o=(t,r)=>e<0||r===e;for(let e=0;e<a.length;e++){const t=a[e];t.style.transition="opacity .15s ease",t.style.opacity=o(0,Number(t.getAttribute("data:realIndex")))?"":String(s)}for(let e=0;e<n.length;e++){const r=n[e];r.style.transition="opacity .15s ease, fill .15s ease",o(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",t.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(e){const t=e.getAttribute("data:fill");t&&e.setAttribute("fill",t),e.style.opacity=""}clearDim(){this._hovered=-1;const e=this.w;if(!e.dom.baseEl)return;const t=e.dom.baseEl.querySelectorAll(".apexcharts-series");for(let e=0;e<t.length;e++)t[e].style.opacity="";const r=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let e=0;e<r.length;e++)this._restoreLabel(r[e])}holdUntilBandsLand(e){const t=this.w;p.isBrowser()&&t.globals.shouldAnimate&&!t.globals.animationEnded&&(e.node.classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:e.node,holdUntilComplete:!0}))}}}),e.default=c,e.streamgraphTransform=b,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).ApexStreamgraph={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,r=e.ApexCharts;if(r&&r.__internals)return t.call(e);if(r)throw new Error("ApexCharts: dist/features/streamgraph.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/streamgraph.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/streamgraph.js",run:t,done:!1},a=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);a.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var r=e.ApexCharts;if(r)if(r.__internals){s.done=!0;var n=a.indexOf(s);-1!==n&&a.splice(n,1);try{t.call(e),r.__drainsAddons||e.console.warn("ApexCharts: dist/features/streamgraph.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/streamgraph.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/streamgraph.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/streamgraph.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";var e=Object.defineProperty,r=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(t,r,s)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,l=(t,e)=>{for(var r in e||(e={}))n.call(e,r)&&i(t,r,e[r]);if(a)for(var r of a(e))o.call(e,r)&&i(t,r,e[r]);return t},h=(t,e)=>r(t,s(e));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Graphics,u=globalThis.ApexCharts.__internals.__apex_Utils;class f{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/f.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*f.xRatio(t)}static plotRect(t){var e,r,s;const a=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(r=t.dom.baseEl)?void 0:r.querySelector(".apexcharts-svg")),n=(null==(s=a||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},o=(a&&t.globals.svgWidth?n.width/t.globals.svgWidth:1)||1;return{left:n.left+t.layout.translateX*o,top:n.top+t.layout.translateY*o,width:t.layout.gridWidth*o,height:t.layout.gridHeight*o,zoom:o}}static screenXToPlotPx(t,e,r=f.plotRect(t)){return(e-r.left)/r.zoom}}const p=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function g(t,e){const r=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const s=t||{},{hidden:i}=s,c=((t,e)=>{var r={};for(var s in t)n.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(null!=t&&a)for(var s of a(t))e.indexOf(s)<0&&o.call(t,s)&&(r[s]=t[s]);return r})(s,["hidden"]);let d=c.data;if(Array.isArray(d)&&!d.length){const t=r.find(t=>t.index===e);t&&Array.isArray(t.data)&&(d=t.data)}return h(l({},c),{data:Array.isArray(d)?d.slice():d})})}const m=["wiggle","silhouette","zero","expand"],x=["inside-out","inverse","none"];function y(t,e,r){const s=r&&void 0!==r[e]?r[e]:e+1;return null==t?{x:s,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,rest:t}:{x:s,y:t,rest:{}}}function b(t,e){var r,s;const a=e.config,n=e.globals;if(!Array.isArray(t))return t;n.streamgraphRawSeries||(n.streamgraphRawSeries=g(t,n));const o=n.streamgraphRawSeries;if(o.some(t=>function(t){for(let e=0;e<t.length;e++){const r=t[e],s=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const i=(null==(r=a.plotOptions)?void 0:r.streamgraph)||{},c=-1!==m.indexOf(i.offset)?i.offset:"wiggle",d=-1!==x.indexOf(i.order)?i.order:"inside-out",f=null==(s=a.xaxis)?void 0:s.categories,p=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(n),{xs:b,rows:v,grids:w}=function(t,e){var r;const s=[],a=[],n=new Map,o=[];for(let i=0;i<t.length;i++){const h=Array.isArray(null==(r=t[i])?void 0:r.data)?t[i].data:[],c=new Map;for(let t=0;t<h.length;t++){const{x:r,y:o,rest:i}=y(h[t],t,e),d=r instanceof Date?r.getTime():r;n.has(d)||(n.set(d,s.length),s.push(r),a.push(l({},i))),c.set(n.get(d),u.parseNumber(o))}o.push(c)}return{xs:s,rows:a,grids:o}}(o,f),_=function(t){const e=[];for(let r=0;r<t.length;r++){const s=t[r]instanceof Date?t[r].getTime():t[r];if("number"!=typeof s||!isFinite(s))return null;e.push(r)}const r=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));r.sort((t,e)=>t.v-e.v);const s=r.map(t=>t.j);for(let t=0;t<s.length;t++)if(s[t]!==t)return s;return null}(b),A=_?_.map(t=>b[t]):b,S=_?_.map(t=>v[t]):v,C=A.length;let j=!1;const T=[];for(let t=0;t<o.length;t++){const e=new Array(C);for(let r=0;r<C;r++){const s=w[t].get(_?_[r]:r);let a=null==s?0:Number(s);isFinite(a)||(a=0),a<0&&(j=!0,a=0),e[r]=a}T.push(e)}j&&!n.streamgraphWarnedNegative&&(n.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const O=[];for(let t=0;t<o.length;t++)-1===p.indexOf(t)&&O.push(t);let F=T;if("expand"===c){F=T.map(t=>t.slice());for(let t=0;t<C;t++){let e=0;for(let r=0;r<O.length;r++)e+=F[O[r]][t];if(e)for(let r=0;r<O.length;r++)F[O[r]][t]/=e}}const P=function(t,e,r){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const s={},a={};for(let t=0;t<e.length;t++){const n=e[t],o=r[n];let i=0,l=-1/0,h=0;for(let t=0;t<o.length;t++)i+=o[t],o[t]>l&&(l=o[t],h=t);s[n]=i,a[n]=h}const n=e.slice().sort((t,e)=>a[t]-a[e]||t-e);let o=0,i=0;const l=[],h=[];for(let t=0;t<n.length;t++){const e=n[t];o<i?(o+=s[e],l.push(e)):(i+=s[e],h.push(e))}return h.reverse().concat(l)}(d,O,F),W=function(t,e,r,s){const a=new Array(s).fill(0);if(0===s||0===e.length)return a;if("zero"===t||"expand"===t)return a;if("silhouette"===t){for(let t=0;t<s;t++){let s=0;for(let a=0;a<e.length;a++)s+=r[e[a]][t];a[t]=-s/2}return a}let n=0;for(let t=1;t<s;t++){let s=0,o=0;for(let a=0;a<e.length;a++){const n=r[e[a]],i=n[t];let l=(i-n[t-1])/2;for(let s=0;s<a;s++){const a=r[e[s]];l+=a[t]-a[t-1]}s+=i,o+=l*i}s&&(n-=o/s),a[t]=n}return a}(c,P,F,C),E=o.map(()=>null),z=o.map(()=>null);for(let t=0;t<P.length;t++)E[P[t]]=new Array(C),z[P[t]]=new Array(C);for(let t=0;t<C;t++){let e=W[t];for(let r=0;r<P.length;r++){const s=P[r],a=E[s],n=z[s];a[t]=e,e+=F[s][t],n[t]=e}}return e.streamgraphData={names:o.map((t,e)=>{var r;return null!=(r=null==t?void 0:t.name)?r:`Series ${e+1}`}),xs:A,values:T,lows:E,highs:z,order:P,offset:c,hidden:o.map((t,e)=>e).filter(t=>-1!==p.indexOf(t))},o.map((t,e)=>{const r=E[e],s=z[e];if(!r||!s)return h(l({},t),{data:[]});const a=new Array(C);for(let t=0;t<C;t++)a[t]=h(l({},S[t]),{x:A[t],y:[r[t],s[t]]});return h(l({},t),{data:a})})}const v="__apexcharts_series_transforms__";var w,_;globalThis[v]||(globalThis[v]={}),w="streamgraph","function"==typeof(_=b)?globalThis[v][w]=_:console.warn(`ApexCharts: registerSeriesTransform("${w}") expects a function (series, w) => series.`),c.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const r=this.w,s=r.globals,a=r.layout.gridHeight,n=s.maxY-s.minY;if(!n||!isFinite(n))return a/2;const o=(t-s.minY)/n;return(null==(e=r.config.yaxis[0])?void 0:e.reversed)?o*a:a-o*a}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,r,s,a,n,o;const i=this.w;if(!this.isActive())return;const l=null==(e=null==(t=i.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const h=i.dom.elGraphical,c=i.streamgraphData;if(!h||!c)return;this.removeLabels();const u=new d(i,this.ctx),f=u.group({class:"apexcharts-streamgraph-labels"}),p=(null==(r=l.style)?void 0:r.fontSize)||"auto",g=(null==(s=l.style)?void 0:s.fontFamily)||i.config.chart.fontFamily,m=(null==(a=l.style)?void 0:a.fontWeight)||600,x=null==l.minWidth?24:l.minWidth,y=[];for(let t=0;t<c.order.length;t++){const e=c.order[t],r=this._placeLabel(e,{fontSize:p,fontFamily:g,fontWeight:m,minWidth:x,graphics:u});r&&y.push(r)}let b=0;for(const t of this._deconflict(y)){const e=t.k,r=u.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:g,fontWeight:m,foreColor:(null==(o=null==(n=l.style)?void 0:n.colors)?void 0:o[e])||t.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(e)),f.add(r),b++}if(!b)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(f.node,v):h.add(f),this.holdUntilBandsLand(f)}_placeLabel(t,{fontSize:e,fontFamily:r,fontWeight:s,minWidth:a,graphics:n}){const o=this.w,i=o.streamgraphData,l=i.lows[t],h=i.highs[t];if(!l||!h)return null;const c=o.globals.seriesXvalues[t],d=l.length;if(!Array.isArray(c)||c.length<d||0===d)return null;const u=new Array(d);let f=0;for(let t=0;t<d;t++){const e=Math.abs(this._yPx(h[t])-this._yPx(l[t]));u[t]=e,e>f&&(f=e)}if(f<=0)return null;const p=this._resolveFontSize(e,f),g=String(i.names[t]);let m=p,x=n.getTextRects(g,`${m}px`,r,"",!0,s);if(f<x.height+6)return null;const y=this._widestRun(u,c,x.height+6,d);if(!y)return null;if(x.width>y.width&&"auto"===e){const t=Math.floor(m*(y.width/x.width));if(t<this._autoBounds().min)return null;if(m=t,x=n.getTextRects(g,`${m}px`,r,"",!0,s),f<x.height+6)return null}const b=x.height+6,v=[];for(const e of this._runs(u,b,d)){const o=Number(c[e.l]),i=Number(c[e.r]);if(!isFinite(o)||!isFinite(i))continue;let u=i-o;if(u<=0&&d>1){const t=Math.abs(Number(c[Math.min(e.r+1,d-1)])-Number(c[Math.max(e.l-1,0)]));u=isFinite(t)?t:0}if(u<a||u<.35*x.width)continue;const f=x.width<=u?g:n.getTextBasedOnMaxWidth({text:g,maxWidth:u,fontSize:`${m}px`,fontFamily:r,fontWeight:s});if(!f||"..."===f)continue;const p=f===g?x.width:x.width*(f.length/g.length),y=[o+u/2];u>2.2*p&&y.push(o+p/2+2,i-p/2-2);for(const r of y){let s=e.l,a=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(c[t])-r);e<a&&(a=e,s=t)}v.push({x:r,y:(this._yPx(l[s])+this._yPx(h[s]))/2,text:f,color:this._contrastOn(t),fontSize:`${m}px`,width:p,height:x.height})}if(v.length>=6)break}return v.length?{k:t,weight:f,candidates:v}:null}_runs(t,e,r){const s=[];let a=0;for(;a<r;){if(t[a]<e){a++;continue}let n=a,o=t[a];for(;n+1<r&&t[n+1]>=e;)n++,t[n]>o&&(o=t[n]);s.push({l:a,r:n,maxT:o}),a=n+1}return s.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,r,s){let a=-1;for(const n of this._runs(t,r,s)){const t=Number(e[n.r])-Number(e[n.l]);isFinite(t)&&t>a&&(a=t)}return a>=0?{width:a}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),r=[],s=t=>!r.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const a={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(s(a)){r.push(h(l({k:t.k},e),{box:a}));break}}return r}_autoBounds(){var t,e;const r=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:r,max:s}=this._autoBounds();return Math.max(r,Math.min(s,Math.round(.36*e)))}_contrastOn(t){var e;const r=this.w,s=null==(e=r.globals.colors)?void 0:e[t],a="string"==typeof s?u.parseHex(s):null;return a?u.relativeLuminance(a)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!p.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,r=e.streamgraphData;if(!r||!r.order.length)return-1;const s=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!s)return-1;const a=s.getBoundingClientRect(),n=e.globals.svgWidth?a.width/e.globals.svgWidth:1,o=f.screenXToPlotPx(e,t.clientX),i=(t.clientY-a.top)/(n||1)-e.layout.translateY;if(o<0||o>e.layout.gridWidth)return-1;if(i<0||i>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[r.order[0]];if(!Array.isArray(l)||!l.length)return-1;const h=e.interact?e.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<l.length)c=h;else{let t=1/0;for(let e=0;e<l.length;e++){const r=Math.abs(Number(l[e])-o);r<t&&(t=r,c=e)}}if(c<0)return-1;let d=-1,u=1/0;for(let t=0;t<r.order.length;t++){const e=r.order[t],s=this._yPx(r.highs[e][c]),a=this._yPx(r.lows[e][c]),n=Math.min(s,a),o=Math.max(s,a);if(i>=n&&i<=o)return e;const l=i<n?n-i:i-o;l<u&&(u=l,d=e)}return d}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const r=this._hoverCfg(),s=null==r.opacity?.35:r.opacity,a=e.dom.baseEl.querySelectorAll(".apexcharts-series"),n=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),o=(e,r)=>t<0||r===t;for(let t=0;t<a.length;t++){const e=a[t];e.style.transition="opacity .15s ease",e.style.opacity=o(0,Number(e.getAttribute("data:realIndex")))?"":String(s)}for(let t=0;t<n.length;t++){const r=n[t];r.style.transition="opacity .15s ease, fill .15s ease",o(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",e.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++)e[t].style.opacity="";const r=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<r.length;t++)this._restoreLabel(r[t])}holdUntilBandsLand(t){const e=this.w;p.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),t.default=c,t.streamgraphTransform=b,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).ApexStreamgraph={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,x=h.__apex_BrowserAPIs_BrowserAPIs,f=h.__apex_math_SVGNS;class b{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],o=document.createElementNS(f,"image");o.setAttribute("x",n.getAttribute("x")||"0"),o.setAttribute("y",n.getAttribute("y")||"0"),o.setAttribute("width",n.getAttribute("width")||"0"),o.setAttribute("height",n.getAttribute("height")||"0"),o.setAttribute("href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(o,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!p.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=x.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!p.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(f,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,n;const o=this.w;let a=t||o.config.chart.toolbar.export.scale||o.config.chart.toolbar.export.width/o.globals.svgWidth;a||(a=1);const l=o.globals.svgWidth*a,r=o.globals.svgHeight*a;null==(i=o.globals.layoutTween)||i.finish(),null==(s=o.globals.circleTween)||s.finish(),null==(n=o.globals.highlightTween)||n.finish(),[...o.globals.chromeTweens||[]].forEach(t=>t());const c=o.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=r+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${o.globals.svgWidth}px" height="${o.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${r}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==a&&this.scaleSvgNode(u,a),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const o=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(o).catch(()=>this.getBase64FromUrl(n).then(o).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,o=document.createElement("canvas");o.width=i.globals.svgWidth*n,o.height=parseInt(i.dom.elWrap.style.height,10)*n;const a=this.resolveExportBackground(),l=o.getContext("2d");if(!l)return s();l.fillStyle=a,l.fillRect(0,0,o.width,o.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{l.drawImage(n,0,0);const t=o;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=o.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w,o=n.globals,a=n.config.chart.toolbar.export.csv,l=!t&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);t||(t=l||n.config.series);const r=new Set(l&&l===o.dumbbellRawSeries?n.dumbbellData.hidden:o.collapsedSeriesIndices),c=[],h=[],d="datetime"===n.config.xaxis.type,p=n.config.xaxis.labels.datetimeUTC,x=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},f=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),b=(t,e)=>{const i=new Date(t);if(p||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,o,a]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${o} ${n} ${a}`},y=(t,e)=>"function"==typeof a.categoryFormatter?a.categoryFormatter(t):null==t?"":f(t)?b(t,e):g.isNumber(t)?t:x(String(t).split(i).join("")),w=t=>"function"==typeof a.valueFormatter?a.valueFormatter(t):x(t),v=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),S=t=>{let e="";if(o.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new m(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=v.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;d&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},M=n.candleData,R=n.rangeData,_=n.violinData,E=t.length>1,X=t.map((t,e)=>{const s=l?"":t.type||n.config.chart.type,o="candlestick"===s?{open:M.seriesCandleO,high:M.seriesCandleH,low:M.seriesCandleL,close:M.seriesCandleC}:"boxPlot"===s?{minimum:M.seriesCandleO,q1:M.seriesCandleH,median:M.seriesCandleM,q3:M.seriesCandleL,maximum:M.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:R.seriesRangeStart,maximum:R.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,a=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=o?Object.keys(o):[a];return{head:o&&E?c.map(t=>`${a} ${t}`):c,cells:i=>{var s;const n=r.has(e);if(!o){const e=n||null==(s=t.data)?void 0:s[i];return[w(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(o).map(t=>{var s;const o=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return w(Array.isArray(o)?o.length:o)})}}});if(o.axisCharts)if(c.push([a.headerCategory,...X.flatMap(t=>t.head)].join(i)),o.allSeriesHasEqualX||n.config.xaxis.categories.length||n.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=S(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}h.push([e,...X.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const n=Array.isArray(t)?t[0]:t.x,o=String(n);let a=e.get(o);a||(a={cat:n,values:X.map(t=>t.head.map(()=>""))},e.set(o,a)),a.values[i]=X[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?n.axisFlags.isXNumeric?t.cat<e.cat?-1:1:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([a.headerCategory,a.headerValue].join(i)),t.forEach((t,e)=>{c.push([y(n.labelData.labels[e]),w(r.has(e)?"":n.seriesData.series[e])].join(i))});const P=h.map(t=>t[0]).filter(f),A=new Set(P.map(t=>b(t))).size<P.length;h.forEach(t=>c.push([y(t[0],A),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||a.filename,".csv")}triggerDownload(t,e,i){if(p.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}class y{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const n=this.w,o=!!t.resetOnly,a=()=>x.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=x.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=a();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=a(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,o?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=r(l({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(c());const u=[],m=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&u.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};m("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),m("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&n.config.chart[t].enabled&&u.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&n.config.chart.zoom.enabled&&u.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&n.config.chart.measure&&n.config.chart.measure.enabled&&u.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),m("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&u.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)u.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});u.forEach((t,e)=>{t.index&&g.moveIndexInArray(u,e,t.index)});for(let t=0;t<u.length;t++)d.setAttrs(u[t].el,{class:u[t].class,title:u[t].title,"aria-label":u[t].title}),u[t].el.innerHTML=u[t].icon,h.appendChild(u[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),o||this._createHamburgerMenu(h),o?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),d.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(x.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,o,a,l,r;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(r=this.elMenuIcon)||r.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.interact[s];i.toggleOtherControls();const o="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==o||o.classList.add(i.selectedClass)),null==o||o.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,o=!n.interact.measureEnabled;this.toggleOtherControls(),o&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,n=(e+s)/2,o=(i+s)/2,a=this._getNewMinXMaxX(n,o);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),o=i-(s-i),a=this._getNewMinXMaxX(n,o);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new b(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(g.clone(i.globals.initialSeries));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class w{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/w.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*w.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),o=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(o||1)-t.layout.translateX}}const v=h.__apex_tooltip_Utils,S=h.__apex_index_Box;h.default.registerFeatures({toolbar:y,zoomPanSelection:class extends y{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new S(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:n,max:o}=this._currentXWindow(),a=o-n,l=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let r=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*a-l*r,d=h+r;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-o)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(r(l({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=w.dataXToPx(t,t.config.chart.selection.xaxis.min),s=w.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),o=n(i),a=n(i+s);o===i&&a===i+s||(t.attr({x:o,width:a-o}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const n=s.startX,o=s.startY;let a=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,m=d-o,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(a=!0,u=Math.abs(u)),o>d&&(c=!0,m=Math.abs(m)),g="x"===e?{x:a?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?o-m:o,width:i.layout.gridWidth,height:m}:{x:a?n-u:n,y:c?o-m:o,width:u,height:m},g=r(l({},g),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(g),s.selectionDragging("resizing"),g}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const n=this.selectionRect.node.getBoundingClientRect(),o=this.xyRatios;let a,l,r,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)a=e.globals.yAxisScale[0].niceMin+h*o.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+d*o.invertedYRatio,r=0,c=1;else{if(!e.globals.xAxisScale)return;a=w.pxToDataX(e,h),l=w.pxToDataX(e,d),r=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*o.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*o.yRatio[0]}const u={xaxis:{min:a,max:l},yaxis:{min:r,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,o=this.xyRatios,a=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const r=this._screenXToPlotPx(l.left),c=this._screenXToPlotPx(l.right),h=this._screenYToPlotPx(l.top),d=this._screenYToPlotPx(l.bottom);let u,m;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+r*o.invertedYRatio,m=s.globals.yAxisScale[0].niceMin+c*o.invertedYRatio):(u=w.pxToDataX(s,r),m=w.pxToDataX(s,c));const p=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*h,a=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*d;p.push(n),x.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==m)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),m=Math.floor(m),u<1&&(u=1,m=s.globals.dataPoints),m-u<2&&(m=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:m}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=p[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const o={xaxis:i};s.config.chart.group||(o.yaxis=t);const l=n.ctx.updateHelpers._updateOptions(o,!1,n.w.config.chart.animations.dynamicAnimation.enabled);l&&"function"==typeof l.then?l.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,o=null;if(o={min:u,max:m},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=p[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:o,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(o)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){var i,s;const n=this.w,o=this.xyRatios;if(!n.globals.initialConfig)return;const a=g.clone(n.globals.initialConfig.yaxis);let l=o.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=o.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const o=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<o||e>a)&&(t=r,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=v.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return w.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),o=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=o?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),o=e.layout.gridWidth||1,a=v.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:a,ratio0:(n.max-n.min)/o/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,o=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:a,max:l}=this._currentXWindow();this._m().pinch={d0:n,cx0:o,minX0:a,maxX0:l,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],n=t.touches[1],o=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=this._screenXToPlotPx((s.clientX+n.clientX)/2),l=i.maxX0-i.minX0,r=l*(i.d0/o);let c=i.minX0+i.cx0/i.gridWidth*l-a/i.gridWidth*r,h=c+r;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],o=this.ctx.toolbar;o&&o.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),o=Math.abs(s.clientY-i.startY);if(n<6&&o<6)return void this._pushSample(s.clientX,t.timeStamp);if(o>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let o=t,a=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-a;if(a=t,o*=Math.pow(n,s/16.6667),Math.abs(o)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=o*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,x=h.__apex_math_SVGNS;class b{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],o=document.createElementNS(x,"image");o.setAttribute("x",n.getAttribute("x")||"0"),o.setAttribute("y",n.getAttribute("y")||"0"),o.setAttribute("width",n.getAttribute("width")||"0"),o.setAttribute("height",n.getAttribute("height")||"0"),o.setAttribute("href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(o,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!p.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=f.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!p.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(x,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,n;const o=this.w;let a=t||o.config.chart.toolbar.export.scale||o.config.chart.toolbar.export.width/o.globals.svgWidth;a||(a=1);const l=o.globals.svgWidth*a,r=o.globals.svgHeight*a;null==(i=o.globals.layoutTween)||i.finish(),null==(s=o.globals.circleTween)||s.finish(),null==(n=o.globals.highlightTween)||n.finish(),[...o.globals.chromeTweens||[]].forEach(t=>t());const c=o.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=r+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${o.globals.svgWidth}px" height="${o.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${r}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==a&&this.scaleSvgNode(u,a),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const o=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(o).catch(()=>this.getBase64FromUrl(n).then(o).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,o=document.createElement("canvas");o.width=i.globals.svgWidth*n,o.height=parseInt(i.dom.elWrap.style.height,10)*n;const a=this.resolveExportBackground(),l=o.getContext("2d");if(!l)return s();l.fillStyle=a,l.fillRect(0,0,o.width,o.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{l.drawImage(n,0,0);const t=o;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=o.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w,o=n.globals,a=n.config.chart.toolbar.export.csv,l=!t&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);t||(t=l||n.config.series);const r=new Set(l&&l===o.dumbbellRawSeries?n.dumbbellData.hidden:o.collapsedSeriesIndices),c=[],h=[],d="datetime"===n.config.xaxis.type,p=n.config.xaxis.labels.datetimeUTC,f=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},x=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),b=(t,e)=>{const i=new Date(t);if(p||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,o,a]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${o} ${n} ${a}`},w=(t,e)=>"function"==typeof a.categoryFormatter?a.categoryFormatter(t):null==t?"":x(t)?b(t,e):g.isNumber(t)?t:f(String(t).split(i).join("")),y=t=>"function"==typeof a.valueFormatter?a.valueFormatter(t):f(t),v=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),S=t=>{let e="";if(o.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new m(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=v.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;d&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},M=n.candleData,R=n.rangeData,_=n.violinData,E=t.length>1,X=t.map((t,e)=>{const s=l?"":t.type||n.config.chart.type,o="candlestick"===s?{open:M.seriesCandleO,high:M.seriesCandleH,low:M.seriesCandleL,close:M.seriesCandleC}:"boxPlot"===s?{minimum:M.seriesCandleO,q1:M.seriesCandleH,median:M.seriesCandleM,q3:M.seriesCandleL,maximum:M.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:R.seriesRangeStart,maximum:R.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,a=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=o?Object.keys(o):[a];return{head:o&&E?c.map(t=>`${a} ${t}`):c,cells:i=>{var s;const n=r.has(e);if(!o){const e=n||null==(s=t.data)?void 0:s[i];return[y(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(o).map(t=>{var s;const o=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return y(Array.isArray(o)?o.length:o)})}}});if(o.axisCharts)if(c.push([a.headerCategory,...X.flatMap(t=>t.head)].join(i)),o.allSeriesHasEqualX||n.config.xaxis.categories.length||n.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=S(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}h.push([e,...X.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;const n=new Map;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const o=Array.isArray(t)?t[0]:t.x,a=String(o),l=n.get(a)||0;n.set(a,l+1);const r=`${l}:${a}`;let c=e.get(r);c||(c={cat:o,values:X.map(t=>t.head.map(()=>""))},e.set(r,c)),c.values[i]=X[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?n.axisFlags.isXNumeric?t.cat<e.cat?-1:t.cat>e.cat?1:0:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([a.headerCategory,a.headerValue].join(i)),t.forEach((t,e)=>{c.push([w(n.labelData.labels[e]),y(r.has(e)?"":n.seriesData.series[e])].join(i))});const P=h.map(t=>t[0]).filter(x),A=new Set(P.map(t=>+new Date(t))),C=new Set([...A].map(t=>b(t))).size<A.size;h.forEach(t=>c.push([w(t[0],C),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||a.filename,".csv")}triggerDownload(t,e,i){if(p.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}class w{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const n=this.w,o=!!t.resetOnly,a=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=a();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=a(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,o?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=r(l({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(c());const u=[],m=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&u.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};m("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),m("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&n.config.chart[t].enabled&&u.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&n.config.chart.zoom.enabled&&u.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&n.config.chart.measure&&n.config.chart.measure.enabled&&u.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),m("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&u.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)u.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});u.forEach((t,e)=>{t.index&&g.moveIndexInArray(u,e,t.index)});for(let t=0;t<u.length;t++)d.setAttrs(u[t].el,{class:u[t].class,title:u[t].title,"aria-label":u[t].title}),u[t].el.innerHTML=u[t].icon,h.appendChild(u[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),o||this._createHamburgerMenu(h),o?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),d.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,o,a,l,r;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(r=this.elMenuIcon)||r.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.interact[s];i.toggleOtherControls();const o="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==o||o.classList.add(i.selectedClass)),null==o||o.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,o=!n.interact.measureEnabled;this.toggleOtherControls(),o&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,n=(e+s)/2,o=(i+s)/2,a=this._getNewMinXMaxX(n,o);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),o=i-(s-i),a=this._getNewMinXMaxX(n,o);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new b(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(g.clone(i.globals._initialSeriesPeek));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class y{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/y.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*y.xRatio(t)}static plotRect(t){var e,i,s;const n=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(i=t.dom.baseEl)?void 0:i.querySelector(".apexcharts-svg")),o=(null==(s=n||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},a=(n&&t.globals.svgWidth?o.width/t.globals.svgWidth:1)||1;return{left:o.left+t.layout.translateX*a,top:o.top+t.layout.translateY*a,width:t.layout.gridWidth*a,height:t.layout.gridHeight*a,zoom:a}}static screenXToPlotPx(t,e,i=y.plotRect(t)){return(e-i.left)/i.zoom}}const v=h.__apex_tooltip_Utils,S=h.__apex_index_Box;h.default.registerFeatures({toolbar:w,zoomPanSelection:class extends w{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new S(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheelZoomGreedy(){return!0===this.w.config.chart.zoom.allowMouseWheelZoom}_showWheelHint(t){const e=this.w;if(!1===e.config.chart.zoom.wheelHint)return;if(Math.abs(t.deltaY)<=Math.abs(t.deltaX))return;const i=e.dom.elWrap;if(!i)return;let s=i.querySelector(".apexcharts-wheel-hint");if(!s){const t=f.getWindow(),n=t&&t.navigator,o=!!n&&/Mac|iPhone|iPad/.test(n.platform||n.userAgent),a=(e.globals.locale.toolbar.wheelZoomHint||"").replace("{key}",o?"\u2318":"Ctrl");s=f.createElement("div"),s.className="apexcharts-wheel-hint",s.setAttribute("aria-hidden","true");const l=f.createElement("span");l.textContent=a,l.style.fontFamily=e.config.chart.fontFamily,s.appendChild(l),i.appendChild(s),s.offsetWidth}s.classList.add("apexcharts-wheel-hint-visible");const n=e.interact;n.wheelHintTimer&&clearTimeout(n.wheelHintTimer),n.wheelHintTimer=setTimeout(()=>this._hideWheelHint(),1200)}_hideWheelHint(){var t;const e=this.w,i=e.interact;i.wheelHintTimer&&(clearTimeout(i.wheelHintTimer),i.wheelHintTimer=null);const s=null==(t=e.dom.elWrap)?void 0:t.querySelector(".apexcharts-wheel-hint");s&&s.classList.remove("apexcharts-wheel-hint-visible")}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){const e=this._wheel();if(!this._wheelZoomGreedy()&&!t.ctrlKey&&!t.metaKey&&null==e.endTimer)return void this._showWheelHint(t);t.preventDefault(),this._hideWheelHint();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:n,max:o}=this._currentXWindow(),a=o-n,l=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let r=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*a-l*r,d=h+r;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-o)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(r(l({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=y.dataXToPx(t,t.config.chart.selection.xaxis.min),s=y.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),o=n(i),a=n(i+s);o===i&&a===i+s||(t.attr({x:o,width:a-o}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const n=s.startX,o=s.startY;let a=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,m=d-o,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(a=!0,u=Math.abs(u)),o>d&&(c=!0,m=Math.abs(m)),g="x"===e?{x:a?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?o-m:o,width:i.layout.gridWidth,height:m}:{x:a?n-u:n,y:c?o-m:o,width:u,height:m},g=r(l({},g),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(g),s.selectionDragging("resizing"),g}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const n=this.selectionRect.node.getBoundingClientRect(),o=this.xyRatios;let a,l,r,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)a=e.globals.yAxisScale[0].niceMin+h*o.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+d*o.invertedYRatio,r=0,c=1;else{if(!e.globals.xAxisScale)return;a=y.pxToDataX(e,h),l=y.pxToDataX(e,d),r=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*o.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*o.yRatio[0]}const u={xaxis:{min:a,max:l},yaxis:{min:r,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,o=this.xyRatios,a=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const r=this._screenXToPlotPx(l.left),c=this._screenXToPlotPx(l.right),h=this._screenYToPlotPx(l.top),d=this._screenYToPlotPx(l.bottom);let u,m;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+r*o.invertedYRatio,m=s.globals.yAxisScale[0].niceMin+c*o.invertedYRatio):(u=y.pxToDataX(s,r),m=y.pxToDataX(s,c));const p=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*h,a=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*d;p.push(n),f.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==m)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),m=Math.floor(m),u<1&&(u=1,m=s.globals.dataPoints),m-u<2&&(m=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:m}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=p[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const o={xaxis:i};s.config.chart.group||(o.yaxis=t);const l=n.ctx.updateHelpers._updateOptions(o,!1,n.w.config.chart.animations.dynamicAnimation.enabled);l&&"function"==typeof l.then?l.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,o=null;if(o={min:u,max:m},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=p[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:o,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(o)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){var i,s;const n=this.w,o=this.xyRatios;if(!n.globals.initialConfig)return;const a=g.clone(n.globals.initialConfig.yaxis);let l=o.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=o.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const o=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<o||e>a)&&(t=r,e=c)}if(t===r&&e===c)return;const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=v.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return y.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),o=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=o?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}panBy(t){const e=this.w;if(!e.interact.zoomed)return;const{min:i,max:s}=this._currentXWindow();let n=(s-i)*t;if(e.config.xaxis.convertedCatToNumeric&&(n=n>0?Math.ceil(n):Math.floor(n)),e.axisFlags.isRangeBar){const t=e.rangeData;let o=1/0,a=-1/0;if(t.seriesRangeStart.concat(t.seriesRangeEnd).flat().forEach(t=>{null!=t&&(o=Math.min(o,t),a=Math.max(a,t))}),n=n>0?Math.min(n,Math.max(0,a-s)):Math.max(n,Math.min(0,o-i)),!n)return}this._applyXRange(i+n,s+n,!1)&&this._fireScrolled()}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),o=e.layout.gridWidth||1,a=v.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:a,ratio0:(n.max-n.min)/o/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,o=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:a,max:l}=this._currentXWindow();this._m().pinch={d0:n,cx0:o,minX0:a,maxX0:l,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],n=t.touches[1],o=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=this._screenXToPlotPx((s.clientX+n.clientX)/2),l=i.maxX0-i.minX0,r=l*(i.d0/o);let c=i.minX0+i.cx0/i.gridWidth*l-a/i.gridWidth*r,h=c+r;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],o=this.ctx.toolbar;o&&o.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),o=Math.abs(s.clientY-i.startY);if(n<6&&o<6)return void this._pushSample(s.clientX,t.timeStamp);if(o>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let o=t,a=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-a;if(a=t,o*=Math.pow(n,s/16.6667),Math.abs(o)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=o*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});