apexcharts 7.3.0 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +30 -11
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +545 -463
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +984 -801
  6. package/dist/apexcharts.js +519 -254
  7. package/dist/apexcharts.min.js +2 -2
  8. package/dist/apexcharts.ssr.common.js +2 -2
  9. package/dist/apexcharts.ssr.esm.js +519 -254
  10. package/dist/area.common.js +1 -1
  11. package/dist/area.esm.js +1 -1
  12. package/dist/bar.common.js +2 -2
  13. package/dist/bar.esm.js +20 -10
  14. package/dist/bar.js +2 -2
  15. package/dist/boxPlot.common.js +2 -2
  16. package/dist/boxPlot.esm.js +20 -10
  17. package/dist/bubble.common.js +1 -1
  18. package/dist/bubble.esm.js +1 -1
  19. package/dist/candlestick.common.js +2 -2
  20. package/dist/candlestick.esm.js +20 -10
  21. package/dist/candlestick.js +2 -2
  22. package/dist/column.common.js +2 -2
  23. package/dist/column.esm.js +20 -10
  24. package/dist/core.common.js +2 -2
  25. package/dist/core.esm.js +545 -463
  26. package/dist/donut.common.js +1 -1
  27. package/dist/donut.esm.js +1 -1
  28. package/dist/dumbbell.common.js +2 -2
  29. package/dist/dumbbell.esm.js +20 -10
  30. package/dist/features/all.common.js +2 -2
  31. package/dist/features/all.esm.js +199 -26
  32. package/dist/features/annotations.common.js +1 -1
  33. package/dist/features/annotations.esm.js +1 -1
  34. package/dist/features/annotations.js +1 -1
  35. package/dist/features/context-menu.common.js +1 -1
  36. package/dist/features/context-menu.esm.js +1 -1
  37. package/dist/features/context-menu.js +1 -1
  38. package/dist/features/drilldown.common.js +1 -1
  39. package/dist/features/drilldown.esm.js +1 -1
  40. package/dist/features/drilldown.js +1 -1
  41. package/dist/features/dumbbell.common.js +1 -1
  42. package/dist/features/dumbbell.esm.js +1 -1
  43. package/dist/features/dumbbell.js +1 -1
  44. package/dist/features/exports.common.js +2 -2
  45. package/dist/features/exports.esm.js +12 -14
  46. package/dist/features/exports.js +2 -2
  47. package/dist/features/facet.common.js +1 -1
  48. package/dist/features/facet.esm.js +1 -1
  49. package/dist/features/facet.js +1 -1
  50. package/dist/features/history.common.js +1 -1
  51. package/dist/features/history.esm.js +1 -1
  52. package/dist/features/history.js +1 -1
  53. package/dist/features/ink.common.js +1 -1
  54. package/dist/features/ink.esm.js +1 -1
  55. package/dist/features/ink.js +1 -1
  56. package/dist/features/keyboard.common.js +2 -2
  57. package/dist/features/keyboard.esm.js +14 -1
  58. package/dist/features/keyboard.js +2 -2
  59. package/dist/features/legend.common.js +1 -1
  60. package/dist/features/legend.esm.js +1 -1
  61. package/dist/features/legend.js +1 -1
  62. package/dist/features/link.common.js +1 -1
  63. package/dist/features/link.esm.js +38 -38
  64. package/dist/features/link.js +1 -1
  65. package/dist/features/marks.common.js +1 -1
  66. package/dist/features/marks.esm.js +1 -1
  67. package/dist/features/marks.js +1 -1
  68. package/dist/features/measure.common.js +1 -1
  69. package/dist/features/measure.esm.js +1 -1
  70. package/dist/features/measure.js +1 -1
  71. package/dist/features/morph.common.js +1 -1
  72. package/dist/features/morph.esm.js +1 -1
  73. package/dist/features/morph.js +1 -1
  74. package/dist/features/perspectives.common.js +1 -1
  75. package/dist/features/perspectives.esm.js +11 -11
  76. package/dist/features/perspectives.js +1 -1
  77. package/dist/features/raincloud.common.js +1 -1
  78. package/dist/features/raincloud.esm.js +1 -1
  79. package/dist/features/raincloud.js +1 -1
  80. package/dist/features/renderer-canvas.common.js +1 -1
  81. package/dist/features/renderer-canvas.esm.js +1 -1
  82. package/dist/features/renderer-canvas.js +1 -1
  83. package/dist/features/stats.common.js +1 -1
  84. package/dist/features/stats.esm.js +1 -1
  85. package/dist/features/stats.js +1 -1
  86. package/dist/features/storyboard.common.js +1 -1
  87. package/dist/features/storyboard.esm.js +11 -11
  88. package/dist/features/storyboard.js +1 -1
  89. package/dist/features/streamgraph.common.js +1 -1
  90. package/dist/features/streamgraph.esm.js +1 -1
  91. package/dist/features/streamgraph.js +1 -1
  92. package/dist/features/toolbar.common.js +2 -2
  93. package/dist/features/toolbar.esm.js +172 -25
  94. package/dist/features/toolbar.js +2 -2
  95. package/dist/features/trellis.common.js +1 -1
  96. package/dist/features/trellis.esm.js +1 -1
  97. package/dist/features/trellis.js +1 -1
  98. package/dist/features/waterfall.common.js +1 -1
  99. package/dist/features/waterfall.esm.js +1 -1
  100. package/dist/features/waterfall.js +1 -1
  101. package/dist/features/weave.common.js +2 -2
  102. package/dist/features/weave.esm.js +15 -2
  103. package/dist/features/weave.js +2 -2
  104. package/dist/heatmap.common.js +1 -1
  105. package/dist/heatmap.esm.js +1 -1
  106. package/dist/heatmap.js +1 -1
  107. package/dist/histogram.common.js +2 -2
  108. package/dist/histogram.esm.js +20 -10
  109. package/dist/line.common.js +1 -1
  110. package/dist/line.esm.js +1 -1
  111. package/dist/line.js +1 -1
  112. package/dist/pictograms.common.js +1 -1
  113. package/dist/pictograms.esm.js +1 -1
  114. package/dist/pictograms.js +1 -1
  115. package/dist/pie.common.js +1 -1
  116. package/dist/pie.esm.js +1 -1
  117. package/dist/pie.js +1 -1
  118. package/dist/polarArea.common.js +1 -1
  119. package/dist/polarArea.esm.js +1 -1
  120. package/dist/radar.common.js +1 -1
  121. package/dist/radar.esm.js +1 -1
  122. package/dist/radar.js +1 -1
  123. package/dist/radialBar.common.js +1 -1
  124. package/dist/radialBar.esm.js +1 -1
  125. package/dist/radialBar.js +1 -1
  126. package/dist/raincloud.common.js +2 -2
  127. package/dist/raincloud.esm.js +20 -10
  128. package/dist/rangeArea.common.js +1 -1
  129. package/dist/rangeArea.esm.js +1 -1
  130. package/dist/rangeBar.common.js +2 -2
  131. package/dist/rangeBar.esm.js +20 -10
  132. package/dist/scatter.common.js +1 -1
  133. package/dist/scatter.esm.js +1 -1
  134. package/dist/streamgraph.common.js +1 -1
  135. package/dist/streamgraph.esm.js +1 -1
  136. package/dist/sunburst.common.js +1 -1
  137. package/dist/sunburst.esm.js +1 -1
  138. package/dist/sunburst.js +1 -1
  139. package/dist/treemap.common.js +1 -1
  140. package/dist/treemap.esm.js +1 -1
  141. package/dist/treemap.js +1 -1
  142. package/dist/unit-shapes.common.js +1 -1
  143. package/dist/unit-shapes.esm.js +1 -1
  144. package/dist/unit-shapes.js +1 -1
  145. package/dist/unit.common.js +1 -1
  146. package/dist/unit.esm.js +79 -79
  147. package/dist/unit.js +1 -1
  148. package/dist/violin.common.js +2 -2
  149. package/dist/violin.esm.js +20 -10
  150. package/dist/violin.js +2 -2
  151. package/dist/waterfall.common.js +2 -2
  152. package/dist/waterfall.esm.js +20 -10
  153. package/package.json +2 -2
  154. package/src/apexcharts.js +39 -15
  155. package/src/charts/common/bar/Helpers.js +31 -12
  156. package/src/modules/Data.js +8 -2
  157. package/src/modules/Exports.js +14 -12
  158. package/src/modules/Formatters.js +24 -1
  159. package/src/modules/Range.js +28 -1
  160. package/src/modules/Toolbar.js +112 -2
  161. package/src/modules/ZoomPanSelection.js +85 -7
  162. package/src/modules/accessibility/KeyboardNavigation.js +14 -0
  163. package/src/modules/axes/YAxis.js +12 -15
  164. package/src/modules/helpers/UpdateHelpers.js +25 -8
  165. package/src/modules/settings/Globals.js +5 -10
  166. package/src/modules/settings/Options.js +15 -0
  167. package/src/modules/weave/PluginAPI.js +21 -1
  168. package/src/ssr/DOMShim.js +50 -0
  169. package/src/types/internal.d.ts +1 -1
  170. package/src/utils/Utils.js +6 -9
  171. package/types/apexcharts.d.ts +17 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";var e=Object.defineProperty,r=Object.defineProperties,t=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(r,t,l)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[t]=l,s=(e,r)=>{for(var t in r||(r={}))n.call(r,t)&&o(e,t,r[t]);if(l)for(var t of l(r))a.call(r,t)&&o(e,t,r[t]);return e},u=(e,l)=>r(e,t(l));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function i(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const c=i(require("apexcharts/core")),d=c.__apex_Utils;function f(e,r,t){const l=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:l,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:l,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:l,y:e.y,rest:e}:{x:l,y:e,rest:{}}}function b(e,r){var t;const l=r.config,n=r.globals;if(!Array.isArray(e))return e;n.dumbbellRawSeries||(n.dumbbellRawSeries=e.map(e=>u(s({},e),{data:Array.isArray(null==e?void 0:e.data)?e.data.slice():null==e?void 0:e.data})));const a=n.dumbbellRawSeries,o=a.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],l=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(l)&&2===l.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[]));if(o)return r.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},e;const i=null==(t=l.xaxis)?void 0:t.categories,c=n.collapsedSeriesIndices||[],{xs:b,rows:p,byX:y}=function(e,r){var t;const l=[],n=[],a=new Map,o=[];for(let u=0;u<e.length;u++){const i=Array.isArray(null==(t=e[u])?void 0:t.data)?e[u].data:[],c=new Map;for(let e=0;e<i.length;e++){const{x:t,y:o,rest:u}=f(i[e],e,r),b=t instanceof Date?t.getTime():t;a.has(b)||(a.set(b,l.length),l.push(t),n.push(s({},u)));const p=a.get(b);c.set(p,d.parseNumber(o))}o.push(c)}return{xs:l,rows:n,byX:o}}(a,i),g=[],h=[],m=[];for(let e=0;e<a.length;e++)-1===c.indexOf(e)&&m.push(e);const v=[];for(let e=0;e<b.length;e++){const r=[];for(let t=0;t<a.length;t++){const l=y[t].has(e)?y[t].get(e):null;r.push(null!=l&&isFinite(l)?l:null)}g.push(r);let t=null,l=null,n=-1,o=-1;for(let e=0;e<m.length;e++){const a=m[e],s=r[a];null!==s&&((null===t||s<t)&&(t=s,n=a),(null===l||s>l)&&(l=s,o=a))}null!==t&&null!==l?(h.push([n,o]),v.push(u(s({},p[e]),{x:b[e],y:[t,l]}))):(h.push(null),v.push(u(s({},p[e]),{x:b[e],y:null})))}r.dumbbellData={form:"series",names:a.map((e,r)=>{var t;return null!=(t=null==e?void 0:e.name)?t:`Series ${r+1}`}),values:g,order:h,carrier:m.length?m[0]:0,hidden:a.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const x=r.dumbbellData.carrier;return a.map((e,r)=>u(s({},e),{data:r===x&&m.length?v:[]}))}const p="__apexcharts_series_transforms__";var y,g;globalThis[p]||(globalThis[p]={}),y="dumbbell","function"==typeof(g=b)&&(globalThis[p][y]=g),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default}),exports.dumbbellTransform=b;
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * ApexCharts v7.3.0
21
+ * ApexCharts v7.4.0
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ApexDumbbell={})}(this,function(e){"use strict";var r=Object.defineProperty,t=Object.defineProperties,l=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(e,t,l)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,i=(e,r)=>{for(var t in r||(r={}))s.call(r,t)&&o(e,t,r[t]);if(n)for(var t of n(r))a.call(r,t)&&o(e,t,r[t]);return e},u=(e,r)=>t(e,l(r));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Utils;function f(e,r,t){const l=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:l,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:l,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:l,y:e.y,rest:e}:{x:l,y:e,rest:{}}}function p(e,r){var t;const l=r.config,n=r.globals;if(!Array.isArray(e))return e;n.dumbbellRawSeries||(n.dumbbellRawSeries=e.map(e=>u(i({},e),{data:Array.isArray(null==e?void 0:e.data)?e.data.slice():null==e?void 0:e.data})));const s=n.dumbbellRawSeries,a=s.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],l=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(l)&&2===l.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[]));if(a)return r.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},e;const o=null==(t=l.xaxis)?void 0:t.categories,c=n.collapsedSeriesIndices||[],{xs:p,rows:b,byX:y}=function(e,r){var t;const l=[],n=[],s=new Map,a=[];for(let o=0;o<e.length;o++){const u=Array.isArray(null==(t=e[o])?void 0:t.data)?e[o].data:[],c=new Map;for(let e=0;e<u.length;e++){const{x:t,y:a,rest:o}=f(u[e],e,r),p=t instanceof Date?t.getTime():t;s.has(p)||(s.set(p,l.length),l.push(t),n.push(i({},o)));const b=s.get(p);c.set(b,d.parseNumber(a))}a.push(c)}return{xs:l,rows:n,byX:a}}(s,o),h=[],g=[],m=[];for(let e=0;e<s.length;e++)-1===c.indexOf(e)&&m.push(e);const x=[];for(let e=0;e<p.length;e++){const r=[];for(let t=0;t<s.length;t++){const l=y[t].has(e)?y[t].get(e):null;r.push(null!=l&&isFinite(l)?l:null)}h.push(r);let t=null,l=null,n=-1,a=-1;for(let e=0;e<m.length;e++){const s=m[e],o=r[s];null!==o&&((null===t||o<t)&&(t=o,n=s),(null===l||o>l)&&(l=o,a=s))}null!==t&&null!==l?(g.push([n,a]),x.push(u(i({},b[e]),{x:p[e],y:[t,l]}))):(g.push(null),x.push(u(i({},b[e]),{x:p[e],y:null})))}r.dumbbellData={form:"series",names:s.map((e,r)=>{var t;return null!=(t=null==e?void 0:e.name)?t:`Series ${r+1}`}),values:h,order:g,carrier:m.length?m[0]:0,hidden:s.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const v=r.dumbbellData.carrier;return s.map((e,r)=>u(i({},e),{data:r===v&&m.length?x:[]}))}const b="__apexcharts_series_transforms__";var y,h;globalThis[b]||(globalThis[b]={}),y="dumbbell","function"==typeof(h=p)?globalThis[b][y]=h:console.warn(`ApexCharts: registerSeriesTransform("${y}") expects a function (series, w) => series.`),e.default=c,e.dumbbellTransform=p,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),s=t.__apex_axes_AxesUtils,a=t.__apex_Data,r=t.__apex_Series,o=t.__apex_Utils,i=t.__apex_Environment_Environment,n=t.__apex_BrowserAPIs_BrowserAPIs,l=t.__apex_math_SVGNS;t.default.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),a=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",a*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+a)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let a;try{a=t[e].toDataURL()}catch(e){continue}const r=s[e],o=document.createElementNS(l,"image");o.setAttribute("x",r.getAttribute("x")||"0"),o.setAttribute("y",r.getAttribute("y")||"0"),o.setAttribute("width",r.getAttribute("width")||"0"),o.setAttribute("height",r.getAttribute("height")||"0"),o.setAttribute("href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.parentNode&&r.parentNode.replaceChild(o,r)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),a=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),a&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||a&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):a&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):a&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!i.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=n.getComputedStyle(t),a=s&&s.fontFamily;a&&a.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!i.isBrowser())return Promise.resolve([]);const e=[],t=[],s=t=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t})})};return Array.from(document.styleSheets||[]).forEach(e=>{let a=null;try{a=e.cssRules}catch(e){a=null}a?Array.from(a).forEach(e=>{5===e.type&&e.cssText&&s(e.cssText)}):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(s).catch(()=>{}))}),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!i.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const a=document.createElementNS(l,"style");a.textContent=s,e.insertBefore(a,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e){const t=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||t.push(a[2]);return t.length?Promise.all(t.map(e=>this.fetchAsDataUri(e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,a=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),a++)}),a?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(a)}`})})}getSvgString(e){return new Promise(t=>{const s=this.w;let a=e||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;a||(a=1);const r=s.globals.svgWidth*a,o=s.globals.svgHeight*a,i=s.dom.elWrap.cloneNode(!0);i.style.width=r+"px",i.style.height=o+"px",this.inlineCanvasLayers(i),this.applyExportStyles(i);const n=(new XMLSerializer).serializeToString(i);let l=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px; height:${o}px;">\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==a&&this.scaleSvgNode(c,a),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),t(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),a=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),a=e.getAttribute("href"),r=s||a;if(!r||r.startsWith("data:"))return Promise.resolve();const o=r=>{s&&e.setAttributeNS(t,"href",r),!a&&s||e.setAttribute("href",r)};return this.fetchAsDataUri(r).then(o).catch(()=>this.getBase64FromUrl(r).then(o).catch(e=>{}))});return Promise.all(a)}getBase64FromUrl(e){return i.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const s=e.getContext("2d");s&&s.drawImage(a,0,0),t(e.toDataURL())},a.onerror=s,a.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return i.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,a=e?e.scale||e.width/s.globals.svgWidth:1,r=document.createElement("canvas");r.width=s.globals.svgWidth*a,r.height=parseInt(s.dom.elWrap.style.height,10)*a;const o=this.resolveExportBackground(),i=r.getContext("2d");i&&(i.fillStyle=o,i.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{i.drawImage(a,0,0);const e=r;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=r.toDataURL("image/png");t({imgURI:e})}},a.src=s}))})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:i=",",lineDelimiter:n="\n"}){const l=this.w;e||(e=l.config.series);let c=[];const h=[];let g="";const p=l.seriesData.series.map((e,t)=>-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]),u=e=>{if(null==e||o.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)?`'${t}`:t},f=e=>"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():o.isNumber(e)?e:u(e.split(i).join("")),d=e=>"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):u(e),m=Math.max(...e.map(e=>e.data?e.data.length:0)),x=new a(this.w),y=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=e=>{let t="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){const s=l.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=y.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return null===t?"nullvalue":(Array.isArray(t)&&(t=t.join(" ")),o.isNumber(t)?t:t.split(i).join(""))},w=(t,s)=>{var a,r,o,n,g,u;if(c.length&&0===s&&h.push(c.join(i)),t.data){const y=t.data.length?t.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){c=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=e[s].data[m].x:x.isFormat2DArray()&&(y=e[s].data[m]?e[s].data[m][0]:"")),0===s){c.push(f(y));for(let t=0;t<l.seriesData.series.length;t++){const s=x.isFormatXY()?null==(a=e[t].data[m])?void 0:a.y:p[t][m];c.push(d(s))}}("candlestick"===l.config.chart.type||t.type&&"candlestick"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),("boxPlot"===l.config.chart.type||t.type&&"boxPlot"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleM[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.rangeData.seriesRangeStart[s][m]),c.push(l.rangeData.seriesRangeEnd[s][m])),("violin"===l.config.chart.type||t.type&&"violin"===t.type)&&(c.pop(),c.push(null==(r=l.violinData.seriesViolinMin[s])?void 0:r[m]),c.push(null==(o=l.violinData.seriesViolinMax[s])?void 0:o[m]),c.push(null!=(u=null==(g=null==(n=l.violinData.seriesViolinPoints[s])?void 0:n[m])?void 0:g.length)?u:0)),c.length&&h.push(c.join(i))}}}};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):"violin"===l.config.chart.type?(c.push("minimum"),c.push("maximum"),c.push("observations")):e.map((e,t)=>{const s=(e.name?e.name:`series-${t}`)+"";l.globals.axisCharts&&c.push(s.split(i).join("")?s.split(i).join(""):`series-${t}`)}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(i))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?e.map((e,t)=>{l.globals.axisCharts?w(e,t):(c=[],c.push(f(l.labelData.labels[t])),c.push(d(p[t])),h.push(c.join(i)))}):(()=>{const t=new Set,s={};e.forEach((a,r)=>{null==a||a.data.forEach(a=>{let o,i;if(x.isFormatXY())o=a.x,i=a.y;else{if(!x.isFormat2DArray())return;o=a[0],i=a[1]}s[o]||(s[o]=Array(e.length).fill("")),s[o][r]=d(i),t.add(o)})}),c.length&&h.push(c.join(i)),Array.from(t).sort().forEach(e=>{const t=s[e];h.push([f(e),...t].join(i))})})(),g+=h.join(n),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+g),t||l.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(e,t,s){if(i.isSSR())return;const a=document.createElement("a");a.href=e,a.download=(t||this.w.globals.chartID)+s,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
5
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),s=t.__apex_axes_AxesUtils,a=t.__apex_Data,r=t.__apex_Series,o=t.__apex_Utils,i=t.__apex_Environment_Environment,n=t.__apex_BrowserAPIs_BrowserAPIs,l=t.__apex_math_SVGNS;t.default.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),a=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",a*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+a)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let a;try{a=t[e].toDataURL()}catch(e){continue}const r=s[e],o=document.createElementNS(l,"image");o.setAttribute("x",r.getAttribute("x")||"0"),o.setAttribute("y",r.getAttribute("y")||"0"),o.setAttribute("width",r.getAttribute("width")||"0"),o.setAttribute("height",r.getAttribute("height")||"0"),o.setAttribute("href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.parentNode&&r.parentNode.replaceChild(o,r)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),a=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),a&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||a&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):a&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):a&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!i.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=n.getComputedStyle(t),a=s&&s.fontFamily;a&&a.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!i.isBrowser())return Promise.resolve([]);const e=[],t=[],s=t=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t})})};return Array.from(document.styleSheets||[]).forEach(e=>{let a=null;try{a=e.cssRules}catch(e){a=null}a?Array.from(a).forEach(e=>{5===e.type&&e.cssText&&s(e.cssText)}):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(s).catch(()=>{}))}),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!i.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const a=document.createElementNS(l,"style");a.textContent=s,e.insertBefore(a,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e){const t=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||t.push(a[2]);return t.length?Promise.all(t.map(e=>this.fetchAsDataUri(e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,a=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),a++)}),a?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(a)}`})})}getSvgString(e){return new Promise(t=>{const s=this.w;let a=e||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;a||(a=1);const r=s.globals.svgWidth*a,o=s.globals.svgHeight*a,i=s.dom.elWrap.cloneNode(!0);i.style.width=r+"px",i.style.height=o+"px",this.inlineCanvasLayers(i),this.applyExportStyles(i);const n=(new XMLSerializer).serializeToString(i);let l=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px; height:${o}px;">\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==a&&this.scaleSvgNode(c,a),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),t(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),a=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),a=e.getAttribute("href"),r=s||a;if(!r||r.startsWith("data:"))return Promise.resolve();const o=r=>{s&&e.setAttributeNS(t,"href",r),!a&&s||e.setAttribute("href",r)};return this.fetchAsDataUri(r).then(o).catch(()=>this.getBase64FromUrl(r).then(o).catch(e=>{}))});return Promise.all(a)}getBase64FromUrl(e){return i.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const s=e.getContext("2d");s&&s.drawImage(a,0,0),t(e.toDataURL())},a.onerror=s,a.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return i.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,a=e?e.scale||e.width/s.globals.svgWidth:1,r=document.createElement("canvas");r.width=s.globals.svgWidth*a,r.height=parseInt(s.dom.elWrap.style.height,10)*a;const o=this.resolveExportBackground(),i=r.getContext("2d");i&&(i.fillStyle=o,i.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{i.drawImage(a,0,0);const e=r;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=r.toDataURL("image/png");t({imgURI:e})}},a.src=s}))})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:i=",",lineDelimiter:n="\n"}){const l=this.w;e||(e=l.config.series);let c=[];const h=[];let g="";const p=l.seriesData.series.map((e,t)=>-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]),u=e=>{if(null==e||o.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)?`'${t}`:t},f=e=>"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():o.isNumber(e)?e:u(e.split(i).join("")),d=e=>"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):u(e),m=Math.max(...e.map(e=>e.data?e.data.length:0)),x=new a(this.w),y=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=e=>{let t="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){const s=l.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=y.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return null===t?"nullvalue":(Array.isArray(t)&&(t=t.join(" ")),o.isNumber(t)?t:t.split(i).join(""))},w=(t,s)=>{var a,r,o,n,g,u;if(c.length&&0===s&&h.push(c.join(i)),t.data){const y=t.data.length?t.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){c=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=e[s].data[m].x:x.isFormat2DArray()&&(y=e[s].data[m]?e[s].data[m][0]:"")),0===s){c.push(f(y));for(let t=0;t<l.seriesData.series.length;t++){const s=x.isFormatXY()?null==(a=e[t].data[m])?void 0:a.y:p[t][m];c.push(d(s))}}("candlestick"===l.config.chart.type||t.type&&"candlestick"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),("boxPlot"===l.config.chart.type||t.type&&"boxPlot"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleM[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.rangeData.seriesRangeStart[s][m]),c.push(l.rangeData.seriesRangeEnd[s][m])),("violin"===l.config.chart.type||t.type&&"violin"===t.type)&&(c.pop(),c.push(null==(r=l.violinData.seriesViolinMin[s])?void 0:r[m]),c.push(null==(o=l.violinData.seriesViolinMax[s])?void 0:o[m]),c.push(null!=(u=null==(g=null==(n=l.violinData.seriesViolinPoints[s])?void 0:n[m])?void 0:g.length)?u:0)),c.length&&h.push(c.join(i))}}}};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):"violin"===l.config.chart.type?(c.push("minimum"),c.push("maximum"),c.push("observations")):e.map((e,t)=>{const s=(e.name?e.name:`series-${t}`)+"";l.globals.axisCharts&&c.push(s.split(i).join("")?s.split(i).join(""):`series-${t}`)}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(i))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?e.map((e,t)=>{l.globals.axisCharts?w(e,t):(c=[],c.push(f(l.labelData.labels[t])),c.push(d(p[t])),h.push(c.join(i)))}):(()=>{const t=new Map;e.forEach((s,a)=>{null==s||s.data.forEach(s=>{let r,o;if(x.isFormatXY())r=s.x,o=s.y;else{if(!x.isFormat2DArray())return;r=s[0],o=s[1]}const i=String(r);let n=t.get(i);n||(n={cat:r,values:Array(e.length).fill("")},t.set(i,n)),n.values[a]=d(o)})}),c.length&&h.push(c.join(i)),Array.from(t.keys()).sort().forEach(e=>{const{cat:s,values:a}=t.get(e);h.push([f(s),...a].join(i))})})(),g+=h.join(n),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+g),t||l.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(e,t,s){if(i.isSSR())return;const a=document.createElement("a");a.href=e,a.download=(t||this.w.globals.chartID)+s,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -771,8 +771,7 @@ class Exports {
771
771
  }
772
772
  };
773
773
  const handleUnequalXValues = () => {
774
- const categories = /* @__PURE__ */ new Set();
775
- const data = {};
774
+ const byCategory = /* @__PURE__ */ new Map();
776
775
  series.forEach((s, sI) => {
777
776
  s == null ? void 0 : s.data.forEach((dataItem) => {
778
777
  let cat, value;
@@ -785,23 +784,22 @@ class Exports {
785
784
  } else {
786
785
  return;
787
786
  }
788
- if (!/** @type {Record<string,any>} */
789
- data[cat]) {
790
- data[cat] = Array(
791
- series.length
792
- ).fill("");
787
+ const key = String(cat);
788
+ let row = byCategory.get(key);
789
+ if (!row) {
790
+ row = { cat, values: Array(series.length).fill("") };
791
+ byCategory.set(key, row);
793
792
  }
794
- data[cat][sI] = getFormattedValue(value);
795
- categories.add(cat);
793
+ row.values[sI] = getFormattedValue(value);
796
794
  });
797
795
  });
798
796
  if (columns.length) {
799
797
  rows.push(columns.join(columnDelimiter));
800
798
  }
801
- Array.from(categories).sort().forEach((cat) => {
802
- const values = (
803
- /** @type {Record<string,any>} */
804
- data[cat]
799
+ Array.from(byCategory.keys()).sort().forEach((key) => {
800
+ const { cat, values } = (
801
+ /** @type {{cat: any, values: string[]}} */
802
+ byCategory.get(key)
805
803
  );
806
804
  rows.push([getFormattedCategory(cat), ...values].join(columnDelimiter));
807
805
  });
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexExports={})}(this,function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils,a=globalThis.ApexCharts.__internals.__apex_Data,r=globalThis.ApexCharts.__internals.__apex_Series,i=globalThis.ApexCharts.__internals.__apex_Utils,o=globalThis.ApexCharts.__internals.__apex_Environment_Environment,n=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,l=globalThis.ApexCharts.__internals,c=l.__apex_math_SVGNS;l.__apex_math_Point,l.__apex_math_Matrix,l.__apex_math_Box;t.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),a=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",a*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+a)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let a;try{a=t[e].toDataURL()}catch(e){continue}const r=s[e],i=document.createElementNS(c,"image");i.setAttribute("x",r.getAttribute("x")||"0"),i.setAttribute("y",r.getAttribute("y")||"0"),i.setAttribute("width",r.getAttribute("width")||"0"),i.setAttribute("height",r.getAttribute("height")||"0"),i.setAttribute("href",a),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.parentNode&&r.parentNode.replaceChild(i,r)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),a=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),a&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||a&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):a&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):a&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!o.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=n.getComputedStyle(t),a=s&&s.fontFamily;a&&a.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!o.isBrowser())return Promise.resolve([]);const e=[],t=[],s=t=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t})})};return Array.from(document.styleSheets||[]).forEach(e=>{let a=null;try{a=e.cssRules}catch(e){a=null}a?Array.from(a).forEach(e=>{5===e.type&&e.cssText&&s(e.cssText)}):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(s).catch(()=>{}))}),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!o.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const a=document.createElementNS(c,"style");a.textContent=s,e.insertBefore(a,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e){const t=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||t.push(a[2]);return t.length?Promise.all(t.map(e=>this.fetchAsDataUri(e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,a=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),a++)}),a?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(a)}`})})}getSvgString(e){return new Promise(t=>{const s=this.w;let a=e||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;a||(a=1);const r=s.globals.svgWidth*a,i=s.globals.svgHeight*a,o=s.dom.elWrap.cloneNode(!0);o.style.width=r+"px",o.style.height=i+"px",this.inlineCanvasLayers(o),this.applyExportStyles(o);const n=(new XMLSerializer).serializeToString(o);let l=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px; height:${i}px;">\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==a&&this.scaleSvgNode(c,a),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),t(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),a=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),a=e.getAttribute("href"),r=s||a;if(!r||r.startsWith("data:"))return Promise.resolve();const i=r=>{s&&e.setAttributeNS(t,"href",r),!a&&s||e.setAttribute("href",r)};return this.fetchAsDataUri(r).then(i).catch(()=>this.getBase64FromUrl(r).then(i).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(a)}getBase64FromUrl(e){return o.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const s=e.getContext("2d");s&&s.drawImage(a,0,0),t(e.toDataURL())},a.onerror=s,a.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return o.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,a=e?e.scale||e.width/s.globals.svgWidth:1,r=document.createElement("canvas");r.width=s.globals.svgWidth*a,r.height=parseInt(s.dom.elWrap.style.height,10)*a;const i=this.resolveExportBackground(),o=r.getContext("2d");o&&(o.fillStyle=i,o.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{o.drawImage(a,0,0);const e=r;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=r.toDataURL("image/png");t({imgURI:e})}},a.src=s}))})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:o=",",lineDelimiter:n="\n"}){const l=this.w;e||(e=l.config.series);let c=[];const h=[];let p="";const g=l.seriesData.series.map((e,t)=>-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]),u=e=>{if(null==e||i.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)?`'${t}`:t},f=e=>"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():i.isNumber(e)?e:u(e.split(o).join("")),d=e=>"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):u(e),m=Math.max(...e.map(e=>e.data?e.data.length:0)),x=new a(this.w),y=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=e=>{let t="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){const s=l.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=y.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return null===t?"nullvalue":(Array.isArray(t)&&(t=t.join(" ")),i.isNumber(t)?t:t.split(o).join(""))},w=(t,s)=>{var a,r,i,n,p,u;if(c.length&&0===s&&h.push(c.join(o)),t.data){const y=t.data.length?t.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){c=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=e[s].data[m].x:x.isFormat2DArray()&&(y=e[s].data[m]?e[s].data[m][0]:"")),0===s){c.push(f(y));for(let t=0;t<l.seriesData.series.length;t++){const s=x.isFormatXY()?null==(a=e[t].data[m])?void 0:a.y:g[t][m];c.push(d(s))}}("candlestick"===l.config.chart.type||t.type&&"candlestick"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),("boxPlot"===l.config.chart.type||t.type&&"boxPlot"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleM[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.rangeData.seriesRangeStart[s][m]),c.push(l.rangeData.seriesRangeEnd[s][m])),("violin"===l.config.chart.type||t.type&&"violin"===t.type)&&(c.pop(),c.push(null==(r=l.violinData.seriesViolinMin[s])?void 0:r[m]),c.push(null==(i=l.violinData.seriesViolinMax[s])?void 0:i[m]),c.push(null!=(u=null==(p=null==(n=l.violinData.seriesViolinPoints[s])?void 0:n[m])?void 0:p.length)?u:0)),c.length&&h.push(c.join(o))}}}};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):"violin"===l.config.chart.type?(c.push("minimum"),c.push("maximum"),c.push("observations")):e.map((e,t)=>{const s=(e.name?e.name:`series-${t}`)+"";l.globals.axisCharts&&c.push(s.split(o).join("")?s.split(o).join(""):`series-${t}`)}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(o))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?e.map((e,t)=>{l.globals.axisCharts?w(e,t):(c=[],c.push(f(l.labelData.labels[t])),c.push(d(g[t])),h.push(c.join(o)))}):(()=>{const t=new Set,s={};e.forEach((a,r)=>{null==a||a.data.forEach(a=>{let i,o;if(x.isFormatXY())i=a.x,o=a.y;else{if(!x.isFormat2DArray())return;i=a[0],o=a[1]}s[i]||(s[i]=Array(e.length).fill("")),s[i][r]=d(o),t.add(i)})}),c.length&&h.push(c.join(o)),Array.from(t).sort().forEach(e=>{const t=s[e];h.push([f(e),...t].join(o))})})(),p+=h.join(n),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+p),t||l.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(e,t,s){if(o.isSSR())return;const a=document.createElement("a");a.href=e,a.download=(t||this.w.globals.chartID)+s,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
5
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexExports={})}(this,function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils,a=globalThis.ApexCharts.__internals.__apex_Data,r=globalThis.ApexCharts.__internals.__apex_Series,i=globalThis.ApexCharts.__internals.__apex_Utils,o=globalThis.ApexCharts.__internals.__apex_Environment_Environment,n=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,l=globalThis.ApexCharts.__internals,c=l.__apex_math_SVGNS;l.__apex_math_Point,l.__apex_math_Matrix,l.__apex_math_Box;t.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),a=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",a*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+a)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let a;try{a=t[e].toDataURL()}catch(e){continue}const r=s[e],i=document.createElementNS(c,"image");i.setAttribute("x",r.getAttribute("x")||"0"),i.setAttribute("y",r.getAttribute("y")||"0"),i.setAttribute("width",r.getAttribute("width")||"0"),i.setAttribute("height",r.getAttribute("height")||"0"),i.setAttribute("href",a),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.parentNode&&r.parentNode.replaceChild(i,r)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),a=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),a&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||a&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):a&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):a&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!o.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=n.getComputedStyle(t),a=s&&s.fontFamily;a&&a.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!o.isBrowser())return Promise.resolve([]);const e=[],t=[],s=t=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t})})};return Array.from(document.styleSheets||[]).forEach(e=>{let a=null;try{a=e.cssRules}catch(e){a=null}a?Array.from(a).forEach(e=>{5===e.type&&e.cssText&&s(e.cssText)}):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(s).catch(()=>{}))}),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!o.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const a=document.createElementNS(c,"style");a.textContent=s,e.insertBefore(a,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e){const t=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||t.push(a[2]);return t.length?Promise.all(t.map(e=>this.fetchAsDataUri(e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,a=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),a++)}),a?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(a)}`})})}getSvgString(e){return new Promise(t=>{const s=this.w;let a=e||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;a||(a=1);const r=s.globals.svgWidth*a,i=s.globals.svgHeight*a,o=s.dom.elWrap.cloneNode(!0);o.style.width=r+"px",o.style.height=i+"px",this.inlineCanvasLayers(o),this.applyExportStyles(o);const n=(new XMLSerializer).serializeToString(o);let l=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px; height:${i}px;">\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==a&&this.scaleSvgNode(c,a),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),t(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),a=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),a=e.getAttribute("href"),r=s||a;if(!r||r.startsWith("data:"))return Promise.resolve();const i=r=>{s&&e.setAttributeNS(t,"href",r),!a&&s||e.setAttribute("href",r)};return this.fetchAsDataUri(r).then(i).catch(()=>this.getBase64FromUrl(r).then(i).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(a)}getBase64FromUrl(e){return o.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const s=e.getContext("2d");s&&s.drawImage(a,0,0),t(e.toDataURL())},a.onerror=s,a.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return o.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,a=e?e.scale||e.width/s.globals.svgWidth:1,r=document.createElement("canvas");r.width=s.globals.svgWidth*a,r.height=parseInt(s.dom.elWrap.style.height,10)*a;const i=this.resolveExportBackground(),o=r.getContext("2d");o&&(o.fillStyle=i,o.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{o.drawImage(a,0,0);const e=r;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=r.toDataURL("image/png");t({imgURI:e})}},a.src=s}))})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:o=",",lineDelimiter:n="\n"}){const l=this.w;e||(e=l.config.series);let c=[];const h=[];let p="";const g=l.seriesData.series.map((e,t)=>-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]),u=e=>{if(null==e||i.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)?`'${t}`:t},f=e=>"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():i.isNumber(e)?e:u(e.split(o).join("")),d=e=>"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):u(e),m=Math.max(...e.map(e=>e.data?e.data.length:0)),x=new a(this.w),y=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=e=>{let t="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){const s=l.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=y.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return null===t?"nullvalue":(Array.isArray(t)&&(t=t.join(" ")),i.isNumber(t)?t:t.split(o).join(""))},v=(t,s)=>{var a,r,i,n,p,u;if(c.length&&0===s&&h.push(c.join(o)),t.data){const y=t.data.length?t.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){c=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=e[s].data[m].x:x.isFormat2DArray()&&(y=e[s].data[m]?e[s].data[m][0]:"")),0===s){c.push(f(y));for(let t=0;t<l.seriesData.series.length;t++){const s=x.isFormatXY()?null==(a=e[t].data[m])?void 0:a.y:g[t][m];c.push(d(s))}}("candlestick"===l.config.chart.type||t.type&&"candlestick"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),("boxPlot"===l.config.chart.type||t.type&&"boxPlot"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleM[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.rangeData.seriesRangeStart[s][m]),c.push(l.rangeData.seriesRangeEnd[s][m])),("violin"===l.config.chart.type||t.type&&"violin"===t.type)&&(c.pop(),c.push(null==(r=l.violinData.seriesViolinMin[s])?void 0:r[m]),c.push(null==(i=l.violinData.seriesViolinMax[s])?void 0:i[m]),c.push(null!=(u=null==(p=null==(n=l.violinData.seriesViolinPoints[s])?void 0:n[m])?void 0:p.length)?u:0)),c.length&&h.push(c.join(o))}}}};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):"violin"===l.config.chart.type?(c.push("minimum"),c.push("maximum"),c.push("observations")):e.map((e,t)=>{const s=(e.name?e.name:`series-${t}`)+"";l.globals.axisCharts&&c.push(s.split(o).join("")?s.split(o).join(""):`series-${t}`)}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(o))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?e.map((e,t)=>{l.globals.axisCharts?v(e,t):(c=[],c.push(f(l.labelData.labels[t])),c.push(d(g[t])),h.push(c.join(o)))}):(()=>{const t=new Map;e.forEach((s,a)=>{null==s||s.data.forEach(s=>{let r,i;if(x.isFormatXY())r=s.x,i=s.y;else{if(!x.isFormat2DArray())return;r=s[0],i=s[1]}const o=String(r);let n=t.get(o);n||(n={cat:r,values:Array(e.length).fill("")},t.set(o,n)),n.values[a]=d(i)})}),c.length&&h.push(c.join(o)),Array.from(t.keys()).sort().forEach(e=>{const{cat:s,values:a}=t.get(e);h.push([f(s),...a].join(o))})})(),p+=h.join(n),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+p),t||l.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(e,t,s){if(o.isSSR())return;const a=document.createElement("a");a.href=e,a.download=(t||this.w.globals.chartID)+s,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),r=t.__apex_Environment_Environment,s=t.__apex_BrowserAPIs_BrowserAPIs;class n{constructor(e,t){if(this.w=e,this.ctx=t,"os"!==e.config.theme.follow||!r.isBrowser())return;const s=this._ensureMedia();s&&(this._applyToConfig(s),this._ensureListeners(s))}_ensureMedia(){if(!this.ctx._osThemeMedia){const e=s.matchMedia("(prefers-color-scheme: dark)"),t=s.matchMedia("(prefers-contrast: more)");if(!e&&!t)return null;this.ctx._osThemeMedia={dark:e,contrast:t,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(e){const t=this.w.config.theme;e.dark&&(t.mode=e.dark.matches?"dark":"light"),e.contrast&&e.contrast.matches&&(t.accessibility=t.accessibility||{},t.accessibility.colorBlindMode="highContrast")}_ensureListeners(e){if(e.handler)return;const t=this.ctx,r=()=>{const e=t._osThemeMedia;if(!e)return;const r={mode:e.dark&&e.dark.matches?"dark":"light"};e.contrast&&e.contrast.matches?r.accessibility={colorBlindMode:"highContrast"}:r.accessibility={colorBlindMode:""},t.updateOptions({theme:r},!1,!0,!1)};n._add(e.dark,r),n._add(e.contrast,r),e.handler=r}teardown(){const e=this.ctx._osThemeMedia;e&&(e.handler&&(n._remove(e.dark,e.handler),n._remove(e.contrast,e.handler)),this.ctx._osThemeMedia=null)}static _add(e,t){e&&("function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t))}static _remove(e,t){e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t))}}t.default.registerFeatures({osThemeWatcher:n}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexFacet={})}(this,function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_Environment_Environment,n=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;class i{constructor(e,t){if(this.w=e,this.ctx=t,"os"!==e.config.theme.follow||!s.isBrowser())return;const n=this._ensureMedia();n&&(this._applyToConfig(n),this._ensureListeners(n))}_ensureMedia(){if(!this.ctx._osThemeMedia){const e=n.matchMedia("(prefers-color-scheme: dark)"),t=n.matchMedia("(prefers-contrast: more)");if(!e&&!t)return null;this.ctx._osThemeMedia={dark:e,contrast:t,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(e){const t=this.w.config.theme;e.dark&&(t.mode=e.dark.matches?"dark":"light"),e.contrast&&e.contrast.matches&&(t.accessibility=t.accessibility||{},t.accessibility.colorBlindMode="highContrast")}_ensureListeners(e){if(e.handler)return;const t=this.ctx,s=()=>{const e=t._osThemeMedia;if(!e)return;const s={mode:e.dark&&e.dark.matches?"dark":"light"};e.contrast&&e.contrast.matches?s.accessibility={colorBlindMode:"highContrast"}:s.accessibility={colorBlindMode:""},t.updateOptions({theme:s},!1,!0,!1)};i._add(e.dark,s),i._add(e.contrast,s),e.handler=s}teardown(){const e=this.ctx._osThemeMedia;e&&(e.handler&&(i._remove(e.dark,e.handler),i._remove(e.contrast,e.handler)),this.ctx._osThemeMedia=null)}static _add(e,t){e&&("function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t))}static _remove(e,t){e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t))}}t.registerFeatures({osThemeWatcher:i}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(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 n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const s=n(require("apexcharts/core")),o=s.__apex_Utils,r=s.__apex_Environment_Environment;function a(t,e){const i=null!=t,n=null!=e;return i||n?{min:i?t:null,max:n?e:null}:null}function l(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function c(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function h(t,e){const i=t.config.annotations?o.clone(t.config.annotations):null,n=[],s=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of s){if(!t||"addAnnotation"!==t.label)continue;const i=c(t.method,e);i&&n.push({kind:i,params:o.clone(t.params)})}return{static:i,dynamic:n}}function d(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}function u(t,e){if(!t||!e)return;const i=t.w;i.interact.zoomed=!!e.zoomed,function(t,e,i){const n=t.w;if(null==e&&null==i)return;const s=n.globals.seriesNames||[],o=new Set([...e||[],...i||[]]),r=new Set([...n.globals.collapsedSeriesIndices||[],...n.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<s.length;e++){const i=s[e];if(null==i)continue;const n=o.has(e),a=r.has(e);n&&!a?t.hideSeries(i):!n&&a&&t.showSeries(i)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const i=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);i&&"function"==typeof t[i]&&t[i](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=l(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==i.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}s.default.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;r.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const i=this.ctx.el;if(!i)return;const n=i.ownerDocument,s=n&&n.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(s))return;if(!i.contains(s)&&!this._engaged)return;const o="y"===e||t.shiftKey;t.preventDefault(),o?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&r.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const i=this._capture(t),n=this.stack[this.pointer];if(!n||n.sig!==i.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(i),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=function(t,e){var i,n;const s=t.config.xaxis||{},o=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>a(t&&t.min,t&&t.max)),r=o.some(t=>null!==t),c=t.config.theme,u=e&&e.drilldown;return{v:1,window:{xaxis:a(s.min,s.max),yaxis:r?o:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:l(t.interact.selectedDataPoints),theme:c?{mode:null!=(i=c.mode)?i:null,palette:null!=(n=c.palette)?n:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:h(t,e),drill:u&&u.depth>0?{path:u.path.slice()}:null,measure:d(e)}}(this.w,this.ctx),{config:i,seriesSig:n}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:i,seriesSig:n,label:t||"change",at:r.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,i)}}_cloneConfigCOW(){const n=this.w,s=this.stack[this.pointer];let r,a=null;try{a=JSON.stringify(n.config.series)}catch(t){a=null}if(s&&null!==a&&s.seriesSig===a){const a=n.config,{series:l}=a,c=((n,s)=>{var o={};for(var r in n)e.call(n,r)&&s.indexOf(r)<0&&(o[r]=n[r]);if(null!=n&&t)for(var r of t(n))s.indexOf(r)<0&&i.call(n,r)&&(o[r]=n[r]);return o})(a,["series"]);r=o.clone(c),r.series=s.config.series}else r=o.clone(n.config);return{config:r,seriesSig:a}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let i;this.applying=!0;try{this.ctx.clearAnnotations(),i=this.ctx.updateOptions(o.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(i).then(()=>{this.w.globals.isDestroyed?this.applying=!1:(u(this.ctx,t.view),this._refreshSettle(),this._emitChange())}).catch(()=>{this.applying=!1})}_refreshSettle(){r.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const i=this.stack.findIndex(e=>e.id===t);-1!==i&&i!==this.pointer&&(this.pointer=i,this._restore(this.stack[i],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const i=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=i,i||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,i,n,s,o,r,a;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onUpdated),null==(o=(s=this.ctx).removeEventListener)||o.call(s,"scrolled",this._onUpdated),null==(a=(r=this.ctx).removeEventListener)||a.call(r,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>s.default});
@@ -14,7 +14,7 @@ var __objRest = (source, exclude) => {
14
14
  return target;
15
15
  };
16
16
  /*!
17
- * ApexCharts v7.3.0
17
+ * ApexCharts v7.4.0
18
18
  * (c) 2018-2026 ApexCharts
19
19
  */
20
20
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexHistory={})}(this,function(t){"use strict";var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;const s=globalThis.ApexCharts,o=globalThis.ApexCharts.__internals.__apex_Utils,a=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function r(t,e){const i=null!=t,n=null!=e;return i||n?{min:i?t:null,max:n?e:null}:null}function l(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function h(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function c(t,e){const i=t.config.annotations?o.clone(t.config.annotations):null,n=[],s=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of s){if(!t||"addAnnotation"!==t.label)continue;const i=h(t.method,e);i&&n.push({kind:i,params:o.clone(t.params)})}return{static:i,dynamic:n}}function d(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}function u(t,e){if(!t||!e)return;const i=t.w;i.interact.zoomed=!!e.zoomed,function(t,e,i){const n=t.w;if(null==e&&null==i)return;const s=n.globals.seriesNames||[],o=new Set([...e||[],...i||[]]),a=new Set([...n.globals.collapsedSeriesIndices||[],...n.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<s.length;e++){const i=s[e];if(null==i)continue;const n=o.has(e),r=a.has(e);n&&!r?t.hideSeries(i):!n&&r&&t.showSeries(i)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const i=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);i&&"function"==typeof t[i]&&t[i](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=l(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==i.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}s.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;a.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const i=this.ctx.el;if(!i)return;const n=i.ownerDocument,s=n&&n.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(s))return;if(!i.contains(s)&&!this._engaged)return;const o="y"===e||t.shiftKey;t.preventDefault(),o?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&a.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const i=this._capture(t),n=this.stack[this.pointer];if(!n||n.sig!==i.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(i),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=function(t,e){var i,n;const s=t.config.xaxis||{},o=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>r(t&&t.min,t&&t.max)),a=o.some(t=>null!==t),h=t.config.theme,u=e&&e.drilldown;return{v:1,window:{xaxis:r(s.min,s.max),yaxis:a?o:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:l(t.interact.selectedDataPoints),theme:h?{mode:null!=(i=h.mode)?i:null,palette:null!=(n=h.palette)?n:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:c(t,e),drill:u&&u.depth>0?{path:u.path.slice()}:null,measure:d(e)}}(this.w,this.ctx),{config:i,seriesSig:n}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:i,seriesSig:n,label:t||"change",at:a.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,i)}}_cloneConfigCOW(){const t=this.w,s=this.stack[this.pointer];let a,r=null;try{r=JSON.stringify(t.config.series)}catch(t){r=null}if(s&&null!==r&&s.seriesSig===r){const r=t.config,{series:l}=r,h=((t,s)=>{var o={};for(var a in t)i.call(t,a)&&s.indexOf(a)<0&&(o[a]=t[a]);if(null!=t&&e)for(var a of e(t))s.indexOf(a)<0&&n.call(t,a)&&(o[a]=t[a]);return o})(r,["series"]);a=o.clone(h),a.series=s.config.series}else a=o.clone(t.config);return{config:a,seriesSig:r}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let i;this.applying=!0;try{this.ctx.clearAnnotations(),i=this.ctx.updateOptions(o.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(i).then(()=>{this.w.globals.isDestroyed?this.applying=!1:(u(this.ctx,t.view),this._refreshSettle(),this._emitChange())}).catch(()=>{this.applying=!1})}_refreshSettle(){a.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const i=this.stack.findIndex(e=>e.id===t);-1!==i&&i!==this.pointer&&(this.pointer=i,this._restore(this.stack[i],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const i=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=i,i||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,i,n,s,o,a,r;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onUpdated),null==(o=(s=this.ctx).removeEventListener)||o.call(s,"scrolled",this._onUpdated),null==(r=(a=this.ctx).removeEventListener)||r.call(a,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}}),t.default=s,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const n in t)if("default"!==n){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),n=e.__apex_Utils,i=e.__apex_Options,a=["point","xaxis","yaxis"],s=[10,11,12,14,17,20],o=["circle","square","diamond","triangle"],r={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},l=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class c{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let n=t,i=1/0;for(let a=0;a<e.length;a++){const s=Math.abs(e[a]-t);s<i&&(i=s,n=e[a])}return n}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const n=this.w.globals.yAxisScale,i=n&&n[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const n="point"===t?"points":t;return Array.isArray(e[n])?e[n]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return a.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(a.forEach(n=>{this._annoList(n).forEach((i,a)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+n+"-"+a+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,n,a)),t.addEventListener("touchstart",t=>this._onDown(t,n,a)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(n,a,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,n){if(t.button&&0!==t.button)return;const i=this.w,a=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!a)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const s="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,r=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[n];let c="move",d=null,h=0,p=0;if("xaxis"===e&&null!=l.x2&&(d=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),d)){const t=d.getBoundingClientRect();Math.abs(s.clientX-t.left)<=8?c="resize-x1":Math.abs(s.clientX-t.right)<=8&&(c="resize-x2"),h=parseFloat(d.getAttribute("x"))||0,p=parseFloat(d.getAttribute("width"))||0}this._drag={type:e,index:n,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:d,origX:h,origW:p,startX:s.clientX,startY:s.clientY,scaleX:r&&r.a?r.a:1,scaleY:r&&r.d?r.d:1,dxPixel:0,dyPixel:0,moved:!1},a.addEventListener("mousemove",this._onMove),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const n="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(n.clientX-e.startX)/e.scaleX,e.dyPixel=(n.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,n;null==(n=null==(e=this.ctx.history)?void 0:e.snapshot)||n.call(e,t)}_applyDelta(t,e){const n=this.w,i=n.layout.gridWidth?t.dxPixel*(n.globals.xRange/n.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:a}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=a){const t=e.yAxisIndex||0,i=n.globals.seriesYAxisMap;e.y=this._snapY(a,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,a=n.globals.seriesYAxisMap,s=a&&a[i]?a[i][0]:0,o=n.globals.yRange?n.globals.yRange[s]:null;if(null==o||!n.layout.gridHeight)return;const r=-t.dyPixel*(o/n.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=r),e.y2+=r):"number"==typeof e.y&&(e.y=this._snapY(e.y+r,s))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const n=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!n:n)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,n){const i=this.w,a=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let s=t.x;!a&&"number"==typeof t.x&&i.layout.gridWidth&&(s=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const r=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,c=l&&l[r]?l[r][0]:0,d=i.globals.yRange?i.globals.yRange[c]:null,h=i.config.yaxis[r]&&i.config.yaxis[r].logarithmic;return"number"==typeof t.y&&null!=d&&!h&&i.layout.gridHeight&&(o=t.y-n*(d/i.layout.gridHeight)),{newX:s,newY:o}}_redrawAnno(t,e,n){const i=this.w.dom.baseEl,a=this.ctx.annotations;if(!i||!a)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const s=i.querySelector(".apexcharts-"+t+"-annotations");if(!s)return;"point"===t&&a.pointsAnnotations?a.pointsAnnotations.addPointAnnotation(e,s,n):"xaxis"===t&&a.xAxisAnnotations?a.xAxisAnnotations.addXaxisAnnotation(e,s,n):"yaxis"===t&&a.yAxisAnnotations&&a.yAxisAnnotations.addYaxisAnnotation(e,s,n);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&a.helpers&&e.label&&e.label.text){const t=a.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireAnnotationEvent(t,e){var n;const i=this.w.config.chart.events;"function"==typeof i[t]&&i[t](this.ctx,e),null==(n=this.ctx.events)||n.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,n){const i={type:t,id:e.id,index:n,x:e.x,y:e.y};null!=e.x2&&(i.x2=e.x2),null!=e.y2&&(i.y2=e.y2),this._fireAnnotationEvent("annotationDragged",i)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,a={}){const s=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+s.globals.chartID,r=n.extend((new i).pointAnnotation,{x:t,y:e,id:o,draggable:!0,label:{text:a.text||"Note"}});s.config.annotations||(s.config.annotations={}),Array.isArray(s.config.annotations.points)||(s.config.annotations.points=[]),s.config.annotations.points.push(r);const l=s.config.annotations.points.length-1;return this._redrawAnno("point",r,l),this._checkpoint("ink:create"),this._fireCreated("point",r,l),this._startEdit("point",l,{select:!0}),r}createLineAt(t,e,a={}){const s=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+s.globals.chartID,r="y"===t?"yaxis":"xaxis",l="yaxis"===r?(new i).yAxisAnnotation:(new i).xAxisAnnotation,c={id:o,draggable:!0,strokeDashArray:null!=a.strokeDashArray?a.strokeDashArray:4,label:{text:a.text||""}};a.color&&(c.borderColor=a.color,c.label.borderColor=a.color),"yaxis"===r?c.y=e:c.x=e;const d=n.extend(l,c);s.config.annotations||(s.config.annotations={}),Array.isArray(s.config.annotations[r])||(s.config.annotations[r]=[]),s.config.annotations[r].push(d);const h=s.config.annotations[r].length-1;return this._redrawAnno(r,d,h),this._checkpoint("ink:create"),this._fireCreated(r,d,h),!1!==a.select&&this._startEdit(r,h,{select:!0}),d}_pixelToData(t,e){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const s=(t-a.left)/a.width,o=(e-a.top)/a.height;let r=n.globals.minX+s*n.globals.xRange;const l=(n.globals.minYArr&&null!=n.globals.minYArr[0]?n.globals.minYArr[0]:n.globals.minY)+(1-o)*(n.globals.yRange&&null!=n.globals.yRange[0]?n.globals.yRange[0]:n.globals.maxY-n.globals.minY);return("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric&&(r=Math.round(r)),{x:r,y:l}}_fireCreated(t,e,n){const i={type:t,id:e.id,index:n};void 0!==e.x&&(i.x=e.x),void 0!==e.y&&(i.y=e.y),this._fireAnnotationEvent("annotationCreated",i)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,n=e.createElement("div");n.className="apexcharts-ink-palette";const i=n.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const a=e.createElement("button");a.type="button",a.className="apexcharts-ink-add",a.textContent="+ Note";const s=a.style;s.cursor="pointer",s.font="12px sans-serif",s.padding="4px 9px",s.borderRadius="5px",s.border="1px solid #6366f1",s.color="#4338ca",s.background="#fff",a.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),n.appendChild(a),t.appendChild(n),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:l}static _isLight(t){const e=String(t||"").replace("#",""),n=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(n,16);if(isNaN(i)||6!==n.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,n,i,a,s){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(a?" "+a:""),o.title=n,o.setAttribute("aria-label",n),s?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const n=t.createElement("span");return n.className="apexcharts-ink-cardlabel",n.textContent=e,n}_mkSwatch(t,e,n,i){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-swatch"+(i?" "+i:""),a.title=e,a.setAttribute("aria-label","Color "+e),a.dataset.color=e,a.style.background=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),n(e)}),a}_startEdit(t,e,n={}){const i=this.w,a=this._annoList(t)[e],s=i.dom.baseEl,o=i.dom.elWrap;if(!(a&&a.id&&s&&o))return;this._closeEditor(!1);const l=s.ownerDocument,c=l.createElement("div");c.className="apexcharts-ink-card",c.setAttribute("role","dialog"),c.setAttribute("aria-label","Edit note"),c.style.visibility="hidden";const d=l.createElement("div");d.className="apexcharts-ink-card-row";const h=l.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=a.label&&a.label.text||"",d.appendChild(h),d.appendChild(this._cardBtn(l,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),c.appendChild(d);const p=l.createElement("div");p.className="apexcharts-ink-card-row","point"!==t&&p.appendChild(this._cardLabel(l,"Label")),this._noteColors().forEach(t=>{p.appendChild(this._mkSwatch(l,t,t=>this._applyColor(t)))});const _=l.createElement("span");if(_.className="apexcharts-ink-sep",p.appendChild(_),p.appendChild(this._cardBtn(l,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),p.appendChild(this._cardBtn(l,"A-","Smaller text",()=>this._stepFont(-1))),p.appendChild(this._cardBtn(l,"A+","Larger text",()=>this._stepFont(1))),c.appendChild(p),"point"!==t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(l,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),c.appendChild(t)}if("point"===t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Marker")),t.appendChild(this._cardBtn(l,"-","Smaller marker",()=>this._stepMarker(-1)));const e=l.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(l,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(l,r.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),c.appendChild(t)}o.appendChild(c),this._editor={card:c,input:h,type:t,index:e},this._positionCard(),this._syncCard(),c.style.visibility="",h.focus(),n.select&&h.select(),c.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),l.addEventListener("mousedown",this._onDocDownEditor,!0),l.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,n=e.dom.baseEl,i=e.dom.elWrap,a=this._annoList(t.type)[t.index];if(!n||!i||!a)return;const s=n.querySelector(".apexcharts-"+t.type+"-annotation-label."+a.id)||n.querySelector("."+a.id);if(!s)return;const o=i.getBoundingClientRect(),r=s.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let d=Math.round(r.left-o.left),h=Math.round(r.bottom-o.top)+8;h+c>i.clientHeight-4&&(h=Math.round(r.top-o.top)-c-8),d+l>i.clientWidth-4&&(d=i.clientWidth-l-4),t.card.style.left=Math.max(4,d)+"px",t.card.style.top=Math.max(4,h)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const n=e.label&&e.label.style||{},i=String(n.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const a=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===a)});const s=t.card.querySelector(".apexcharts-ink-btn--bold");s&&s.classList.toggle("apexcharts-ink-btn--active",c._isBold(n));const o=e.marker||{},l=t.card.querySelector(".apexcharts-ink-marker-size");l&&(l.textContent=String("number"==typeof o.size?o.size:4));const d=t.card.querySelector(".apexcharts-ink-btn--shape");d&&(d.textContent=r[o.shape]||r.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const n=t.input.value;e.label||(e.label={}),e.label.text!==n&&(e.label.text=n,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const n=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;n&&(n.removeEventListener("mousedown",this._onDocDownEditor,!0),n.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const n=this._editor;if(!n)return;const i=this._annoList(n.type)[n.index];i&&(this._commitTextOf(n),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(n.type,i,n.index),this._checkpoint(t),this._fireStyled(n.type,i,n.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const n=c._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=n?"#334155":"#ffffff",i.label.borderColor=n?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=n?"#334155":t,i.marker.fillColor=n?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const n=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<s.length;t++)Math.abs(s[t]-n)<Math.abs(s[i]-n)&&(i=t);i=Math.min(s.length-1,Math.max(0,i+t)),e.label.style.fontSize=s[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=c._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const n="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,n+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=o.indexOf(t.marker.shape);t.marker.shape=o[(e+1)%o.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),n=e[t.index];if(this._closeEditor(!1),!n)return;const i=this.w.dom.baseEl;i&&n.id&&i.querySelectorAll("."+n.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let n=t.index;n<e.length;n++)this._redrawAnno(t.type,e[n],n);this._checkpoint("ink:delete"),this._fireDeleted(t.type,n,t.index)}_fireEdited(t,e,n){const i={type:t,id:e.id,index:n,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",i)}_fireStyled(t,e,n){const i={type:t,id:e.id,index:n,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",i)}_fireDeleted(t,e,n){const i={type:t,id:e.id,index:n};this._fireAnnotationEvent("annotationDeleted",i)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,n,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(n=this.ctx).removeEventListener)||i.call(n,"updated",this._onRerender),this._wired=!1)}}e.default.registerFeatures({ink:c}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexInk={})}(this,function(t){"use strict";const e=globalThis.ApexCharts,n=globalThis.ApexCharts.__internals.__apex_Utils,i=globalThis.ApexCharts.__internals.__apex_Options,s=["point","xaxis","yaxis"],a=[10,11,12,14,17,20],o=["circle","square","diamond","triangle"],r={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},l=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class c{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let n=t,i=1/0;for(let s=0;s<e.length;s++){const a=Math.abs(e[s]-t);a<i&&(i=a,n=e[s])}return n}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const n=this.w.globals.yAxisScale,i=n&&n[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const n="point"===t?"points":t;return Array.isArray(e[n])?e[n]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return s.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(s.forEach(n=>{this._annoList(n).forEach((i,s)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+n+"-"+s+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,n,s)),t.addEventListener("touchstart",t=>this._onDown(t,n,s)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(n,s,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,n){if(t.button&&0!==t.button)return;const i=this.w,s=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!s)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const a="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,r=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[n];let c="move",d=null,h=0,p=0;if("xaxis"===e&&null!=l.x2&&(d=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),d)){const t=d.getBoundingClientRect();Math.abs(a.clientX-t.left)<=8?c="resize-x1":Math.abs(a.clientX-t.right)<=8&&(c="resize-x2"),h=parseFloat(d.getAttribute("x"))||0,p=parseFloat(d.getAttribute("width"))||0}this._drag={type:e,index:n,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:d,origX:h,origW:p,startX:a.clientX,startY:a.clientY,scaleX:r&&r.a?r.a:1,scaleY:r&&r.d?r.d:1,dxPixel:0,dyPixel:0,moved:!1},s.addEventListener("mousemove",this._onMove),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const n="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(n.clientX-e.startX)/e.scaleX,e.dyPixel=(n.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,n;null==(n=null==(e=this.ctx.history)?void 0:e.snapshot)||n.call(e,t)}_applyDelta(t,e){const n=this.w,i=n.layout.gridWidth?t.dxPixel*(n.globals.xRange/n.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:s}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=s){const t=e.yAxisIndex||0,i=n.globals.seriesYAxisMap;e.y=this._snapY(s,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,s=n.globals.seriesYAxisMap,a=s&&s[i]?s[i][0]:0,o=n.globals.yRange?n.globals.yRange[a]:null;if(null==o||!n.layout.gridHeight)return;const r=-t.dyPixel*(o/n.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=r),e.y2+=r):"number"==typeof e.y&&(e.y=this._snapY(e.y+r,a))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const n=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!n:n)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,n){const i=this.w,s=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let a=t.x;!s&&"number"==typeof t.x&&i.layout.gridWidth&&(a=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const r=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,c=l&&l[r]?l[r][0]:0,d=i.globals.yRange?i.globals.yRange[c]:null,h=i.config.yaxis[r]&&i.config.yaxis[r].logarithmic;return"number"==typeof t.y&&null!=d&&!h&&i.layout.gridHeight&&(o=t.y-n*(d/i.layout.gridHeight)),{newX:a,newY:o}}_redrawAnno(t,e,n){const i=this.w.dom.baseEl,s=this.ctx.annotations;if(!i||!s)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const a=i.querySelector(".apexcharts-"+t+"-annotations");if(!a)return;"point"===t&&s.pointsAnnotations?s.pointsAnnotations.addPointAnnotation(e,a,n):"xaxis"===t&&s.xAxisAnnotations?s.xAxisAnnotations.addXaxisAnnotation(e,a,n):"yaxis"===t&&s.yAxisAnnotations&&s.yAxisAnnotations.addYaxisAnnotation(e,a,n);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&s.helpers&&e.label&&e.label.text){const t=s.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireAnnotationEvent(t,e){var n;const i=this.w.config.chart.events;"function"==typeof i[t]&&i[t](this.ctx,e),null==(n=this.ctx.events)||n.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,n){const i={type:t,id:e.id,index:n,x:e.x,y:e.y};null!=e.x2&&(i.x2=e.x2),null!=e.y2&&(i.y2=e.y2),this._fireAnnotationEvent("annotationDragged",i)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,r=n.extend((new i).pointAnnotation,{x:t,y:e,id:o,draggable:!0,label:{text:s.text||"Note"}});a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations.points)||(a.config.annotations.points=[]),a.config.annotations.points.push(r);const l=a.config.annotations.points.length-1;return this._redrawAnno("point",r,l),this._checkpoint("ink:create"),this._fireCreated("point",r,l),this._startEdit("point",l,{select:!0}),r}createLineAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,r="y"===t?"yaxis":"xaxis",l="yaxis"===r?(new i).yAxisAnnotation:(new i).xAxisAnnotation,c={id:o,draggable:!0,strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4,label:{text:s.text||""}};s.color&&(c.borderColor=s.color,c.label.borderColor=s.color),"yaxis"===r?c.y=e:c.x=e;const d=n.extend(l,c);a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations[r])||(a.config.annotations[r]=[]),a.config.annotations[r].push(d);const h=a.config.annotations[r].length-1;return this._redrawAnno(r,d,h),this._checkpoint("ink:create"),this._fireCreated(r,d,h),!1!==s.select&&this._startEdit(r,h,{select:!0}),d}_pixelToData(t,e){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const s=i.getBoundingClientRect();if(!s.width||!s.height)return null;const a=(t-s.left)/s.width,o=(e-s.top)/s.height;let r=n.globals.minX+a*n.globals.xRange;const l=(n.globals.minYArr&&null!=n.globals.minYArr[0]?n.globals.minYArr[0]:n.globals.minY)+(1-o)*(n.globals.yRange&&null!=n.globals.yRange[0]?n.globals.yRange[0]:n.globals.maxY-n.globals.minY);return("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric&&(r=Math.round(r)),{x:r,y:l}}_fireCreated(t,e,n){const i={type:t,id:e.id,index:n};void 0!==e.x&&(i.x=e.x),void 0!==e.y&&(i.y=e.y),this._fireAnnotationEvent("annotationCreated",i)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,n=e.createElement("div");n.className="apexcharts-ink-palette";const i=n.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const s=e.createElement("button");s.type="button",s.className="apexcharts-ink-add",s.textContent="+ Note";const a=s.style;a.cursor="pointer",a.font="12px sans-serif",a.padding="4px 9px",a.borderRadius="5px",a.border="1px solid #6366f1",a.color="#4338ca",a.background="#fff",s.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),n.appendChild(s),t.appendChild(n),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:l}static _isLight(t){const e=String(t||"").replace("#",""),n=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(n,16);if(isNaN(i)||6!==n.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,n,i,s,a){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(s?" "+s:""),o.title=n,o.setAttribute("aria-label",n),a?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const n=t.createElement("span");return n.className="apexcharts-ink-cardlabel",n.textContent=e,n}_mkSwatch(t,e,n,i){const s=t.createElement("button");return s.type="button",s.className="apexcharts-ink-swatch"+(i?" "+i:""),s.title=e,s.setAttribute("aria-label","Color "+e),s.dataset.color=e,s.style.background=e,s.addEventListener("mousedown",t=>t.preventDefault()),s.addEventListener("click",t=>{t.stopPropagation(),n(e)}),s}_startEdit(t,e,n={}){const i=this.w,s=this._annoList(t)[e],a=i.dom.baseEl,o=i.dom.elWrap;if(!(s&&s.id&&a&&o))return;this._closeEditor(!1);const l=a.ownerDocument,c=l.createElement("div");c.className="apexcharts-ink-card",c.setAttribute("role","dialog"),c.setAttribute("aria-label","Edit note"),c.style.visibility="hidden";const d=l.createElement("div");d.className="apexcharts-ink-card-row";const h=l.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=s.label&&s.label.text||"",d.appendChild(h),d.appendChild(this._cardBtn(l,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),c.appendChild(d);const p=l.createElement("div");p.className="apexcharts-ink-card-row","point"!==t&&p.appendChild(this._cardLabel(l,"Label")),this._noteColors().forEach(t=>{p.appendChild(this._mkSwatch(l,t,t=>this._applyColor(t)))});const _=l.createElement("span");if(_.className="apexcharts-ink-sep",p.appendChild(_),p.appendChild(this._cardBtn(l,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),p.appendChild(this._cardBtn(l,"A-","Smaller text",()=>this._stepFont(-1))),p.appendChild(this._cardBtn(l,"A+","Larger text",()=>this._stepFont(1))),c.appendChild(p),"point"!==t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(l,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),c.appendChild(t)}if("point"===t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Marker")),t.appendChild(this._cardBtn(l,"-","Smaller marker",()=>this._stepMarker(-1)));const e=l.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(l,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(l,r.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),c.appendChild(t)}o.appendChild(c),this._editor={card:c,input:h,type:t,index:e},this._positionCard(),this._syncCard(),c.style.visibility="",h.focus(),n.select&&h.select(),c.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),l.addEventListener("mousedown",this._onDocDownEditor,!0),l.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,n=e.dom.baseEl,i=e.dom.elWrap,s=this._annoList(t.type)[t.index];if(!n||!i||!s)return;const a=n.querySelector(".apexcharts-"+t.type+"-annotation-label."+s.id)||n.querySelector("."+s.id);if(!a)return;const o=i.getBoundingClientRect(),r=a.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let d=Math.round(r.left-o.left),h=Math.round(r.bottom-o.top)+8;h+c>i.clientHeight-4&&(h=Math.round(r.top-o.top)-c-8),d+l>i.clientWidth-4&&(d=i.clientWidth-l-4),t.card.style.left=Math.max(4,d)+"px",t.card.style.top=Math.max(4,h)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const n=e.label&&e.label.style||{},i=String(n.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const s=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===s)});const a=t.card.querySelector(".apexcharts-ink-btn--bold");a&&a.classList.toggle("apexcharts-ink-btn--active",c._isBold(n));const o=e.marker||{},l=t.card.querySelector(".apexcharts-ink-marker-size");l&&(l.textContent=String("number"==typeof o.size?o.size:4));const d=t.card.querySelector(".apexcharts-ink-btn--shape");d&&(d.textContent=r[o.shape]||r.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const n=t.input.value;e.label||(e.label={}),e.label.text!==n&&(e.label.text=n,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const n=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;n&&(n.removeEventListener("mousedown",this._onDocDownEditor,!0),n.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const n=this._editor;if(!n)return;const i=this._annoList(n.type)[n.index];i&&(this._commitTextOf(n),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(n.type,i,n.index),this._checkpoint(t),this._fireStyled(n.type,i,n.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const n=c._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=n?"#334155":"#ffffff",i.label.borderColor=n?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=n?"#334155":t,i.marker.fillColor=n?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const n=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<a.length;t++)Math.abs(a[t]-n)<Math.abs(a[i]-n)&&(i=t);i=Math.min(a.length-1,Math.max(0,i+t)),e.label.style.fontSize=a[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=c._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const n="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,n+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=o.indexOf(t.marker.shape);t.marker.shape=o[(e+1)%o.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),n=e[t.index];if(this._closeEditor(!1),!n)return;const i=this.w.dom.baseEl;i&&n.id&&i.querySelectorAll("."+n.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let n=t.index;n<e.length;n++)this._redrawAnno(t.type,e[n],n);this._checkpoint("ink:delete"),this._fireDeleted(t.type,n,t.index)}_fireEdited(t,e,n){const i={type:t,id:e.id,index:n,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",i)}_fireStyled(t,e,n){const i={type:t,id:e.id,index:n,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",i)}_fireDeleted(t,e,n){const i={type:t,id:e.id,index:n};this._fireAnnotationEvent("annotationDeleted",i)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,n,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(n=this.ctx).removeEventListener)||i.call(n,"updated",this._onRerender),this._wired=!1)}}e.registerFeatures({ink:c}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});