apexcharts 8.1.0 → 8.2.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 (245) hide show
  1. package/README.md +14 -8
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +660 -897
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +748 -791
  6. package/dist/apexcharts.full.js +1502 -1782
  7. package/dist/apexcharts.full.min.js +2 -2
  8. package/dist/apexcharts.js +1409 -1689
  9. package/dist/apexcharts.min.js +2 -2
  10. package/dist/apexcharts.ssr.common.js +2 -2
  11. package/dist/apexcharts.ssr.esm.js +1610 -1744
  12. package/dist/area.common.js +2 -2
  13. package/dist/area.esm.js +25 -67
  14. package/dist/bar.common.js +2 -2
  15. package/dist/bar.esm.js +159 -163
  16. package/dist/bar.js +2 -2
  17. package/dist/boxPlot.common.js +2 -2
  18. package/dist/boxPlot.esm.js +125 -106
  19. package/dist/bubble.common.js +2 -2
  20. package/dist/bubble.esm.js +25 -67
  21. package/dist/candlestick.common.js +2 -2
  22. package/dist/candlestick.esm.js +125 -106
  23. package/dist/candlestick.js +2 -2
  24. package/dist/column.common.js +2 -2
  25. package/dist/column.esm.js +159 -163
  26. package/dist/core.common.js +2 -2
  27. package/dist/core.esm.js +660 -897
  28. package/dist/donut.common.js +2 -2
  29. package/dist/donut.esm.js +25 -33
  30. package/dist/dumbbell.common.js +2 -2
  31. package/dist/dumbbell.esm.js +159 -163
  32. package/dist/features/all.common.js +2 -2
  33. package/dist/features/all.esm.js +461 -414
  34. package/dist/features/annotations.common.js +2 -2
  35. package/dist/features/annotations.esm.js +5 -8
  36. package/dist/features/annotations.js +2 -2
  37. package/dist/features/context-menu.common.js +1 -1
  38. package/dist/features/context-menu.esm.js +1 -1
  39. package/dist/features/context-menu.js +1 -1
  40. package/dist/features/drilldown.common.js +1 -1
  41. package/dist/features/drilldown.esm.js +1 -1
  42. package/dist/features/drilldown.js +1 -1
  43. package/dist/features/dumbbell.common.js +1 -1
  44. package/dist/features/dumbbell.esm.js +1 -1
  45. package/dist/features/dumbbell.js +1 -1
  46. package/dist/features/exports.common.js +2 -2
  47. package/dist/features/exports.esm.js +2 -2
  48. package/dist/features/exports.js +2 -2
  49. package/dist/features/facet.common.js +1 -1
  50. package/dist/features/facet.esm.js +1 -1
  51. package/dist/features/facet.js +1 -1
  52. package/dist/features/highlight-filter.common.js +2 -2
  53. package/dist/features/highlight-filter.esm.js +14 -35
  54. package/dist/features/highlight-filter.js +2 -2
  55. package/dist/features/history.common.js +2 -2
  56. package/dist/features/history.esm.js +4 -3
  57. package/dist/features/history.js +2 -2
  58. package/dist/features/ink.common.js +1 -1
  59. package/dist/features/ink.esm.js +1 -1
  60. package/dist/features/ink.js +1 -1
  61. package/dist/features/keyboard.common.js +2 -2
  62. package/dist/features/keyboard.esm.js +20 -23
  63. package/dist/features/keyboard.js +2 -2
  64. package/dist/features/legend.common.js +2 -2
  65. package/dist/features/legend.esm.js +61 -41
  66. package/dist/features/legend.js +2 -2
  67. package/dist/features/link.common.js +2 -2
  68. package/dist/features/link.esm.js +8 -8
  69. package/dist/features/link.js +2 -2
  70. package/dist/features/marks.common.js +1 -1
  71. package/dist/features/marks.esm.js +1 -1
  72. package/dist/features/marks.js +1 -1
  73. package/dist/features/measure.common.js +1 -1
  74. package/dist/features/measure.esm.js +1 -1
  75. package/dist/features/measure.js +1 -1
  76. package/dist/features/morph.common.js +2 -2
  77. package/dist/features/morph.esm.js +260 -279
  78. package/dist/features/morph.js +2 -2
  79. package/dist/features/perspectives.common.js +2 -2
  80. package/dist/features/perspectives.esm.js +28 -19
  81. package/dist/features/perspectives.js +2 -2
  82. package/dist/features/raincloud.common.js +1 -1
  83. package/dist/features/raincloud.esm.js +1 -1
  84. package/dist/features/raincloud.js +1 -1
  85. package/dist/features/renderer-canvas.common.js +1 -1
  86. package/dist/features/renderer-canvas.esm.js +1 -1
  87. package/dist/features/renderer-canvas.js +1 -1
  88. package/dist/features/stats.common.js +1 -1
  89. package/dist/features/stats.esm.js +1 -1
  90. package/dist/features/stats.js +1 -1
  91. package/dist/features/storyboard.common.js +2 -2
  92. package/dist/features/storyboard.esm.js +24 -15
  93. package/dist/features/storyboard.js +2 -2
  94. package/dist/features/streamgraph.common.js +1 -1
  95. package/dist/features/streamgraph.esm.js +1 -1
  96. package/dist/features/streamgraph.js +1 -1
  97. package/dist/features/toolbar.common.js +2 -2
  98. package/dist/features/toolbar.esm.js +10 -15
  99. package/dist/features/toolbar.js +2 -2
  100. package/dist/features/trellis.common.js +2 -2
  101. package/dist/features/trellis.esm.js +31 -19
  102. package/dist/features/trellis.js +2 -2
  103. package/dist/features/waterfall.common.js +1 -1
  104. package/dist/features/waterfall.esm.js +1 -1
  105. package/dist/features/waterfall.js +1 -1
  106. package/dist/features/weave.common.js +2 -2
  107. package/dist/features/weave.esm.js +114 -55
  108. package/dist/features/weave.js +2 -2
  109. package/dist/full.common.js +2 -2
  110. package/dist/full.esm.js +99 -95
  111. package/dist/heatmap.common.js +2 -2
  112. package/dist/heatmap.esm.js +47 -14
  113. package/dist/heatmap.js +2 -2
  114. package/dist/histogram.common.js +2 -2
  115. package/dist/histogram.esm.js +159 -163
  116. package/dist/icicle.common.js +1 -1
  117. package/dist/icicle.esm.js +1 -1
  118. package/dist/icicle.js +1 -1
  119. package/dist/line.common.js +2 -2
  120. package/dist/line.esm.js +25 -67
  121. package/dist/line.js +2 -2
  122. package/dist/pictograms.common.js +1 -1
  123. package/dist/pictograms.esm.js +1 -1
  124. package/dist/pictograms.js +1 -1
  125. package/dist/pie.common.js +2 -2
  126. package/dist/pie.esm.js +25 -33
  127. package/dist/pie.js +2 -2
  128. package/dist/polarArea.common.js +2 -2
  129. package/dist/polarArea.esm.js +25 -33
  130. package/dist/radar.common.js +2 -2
  131. package/dist/radar.esm.js +2 -2
  132. package/dist/radar.js +2 -2
  133. package/dist/radialBar.common.js +2 -2
  134. package/dist/radialBar.esm.js +32 -42
  135. package/dist/radialBar.js +2 -2
  136. package/dist/raincloud.common.js +2 -2
  137. package/dist/raincloud.esm.js +2 -7
  138. package/dist/rangeArea.common.js +2 -2
  139. package/dist/rangeArea.esm.js +25 -67
  140. package/dist/rangeBar.common.js +2 -2
  141. package/dist/rangeBar.esm.js +159 -163
  142. package/dist/scatter.common.js +2 -2
  143. package/dist/scatter.esm.js +25 -67
  144. package/dist/streamgraph.common.js +2 -2
  145. package/dist/streamgraph.esm.js +25 -67
  146. package/dist/sunburst.common.js +1 -1
  147. package/dist/sunburst.esm.js +1 -1
  148. package/dist/sunburst.js +1 -1
  149. package/dist/treemap.common.js +2 -2
  150. package/dist/treemap.esm.js +28 -90
  151. package/dist/treemap.js +2 -2
  152. package/dist/unit-shapes.common.js +1 -1
  153. package/dist/unit-shapes.esm.js +1 -1
  154. package/dist/unit-shapes.js +1 -1
  155. package/dist/unit.common.js +2 -2
  156. package/dist/unit.esm.js +22 -5
  157. package/dist/unit.js +2 -2
  158. package/dist/violin.common.js +2 -2
  159. package/dist/violin.esm.js +2 -7
  160. package/dist/violin.js +2 -2
  161. package/dist/waterfall.common.js +2 -2
  162. package/dist/waterfall.esm.js +159 -163
  163. package/package.json +3 -1
  164. package/src/apexcharts.js +81 -122
  165. package/src/charts/Bar.js +16 -5
  166. package/src/charts/BarStacked.js +42 -88
  167. package/src/charts/BoxCandleStick.js +1 -7
  168. package/src/charts/HeatMap.js +69 -18
  169. package/src/charts/Line.js +21 -71
  170. package/src/charts/Pie.js +45 -33
  171. package/src/charts/Radar.js +4 -1
  172. package/src/charts/Radial.js +9 -10
  173. package/src/charts/RangeBar.js +1 -7
  174. package/src/charts/Treemap.js +25 -78
  175. package/src/charts/Unit.js +28 -10
  176. package/src/charts/Violin.js +1 -7
  177. package/src/charts/common/Hierarchy.js +0 -22
  178. package/src/charts/common/Stats.js +6 -28
  179. package/src/charts/common/bar/DataLabels.js +94 -83
  180. package/src/charts/common/bar/Helpers.js +34 -57
  181. package/src/charts/common/treemap/Helpers.js +1 -1
  182. package/src/entries/full.js +0 -17
  183. package/src/features/link.js +9 -10
  184. package/src/features/perspectives.js +20 -19
  185. package/src/libs/Treemap-squared.js +7 -47
  186. package/src/modules/Animations.js +20 -64
  187. package/src/modules/Base.js +3 -2
  188. package/src/modules/Core.js +17 -12
  189. package/src/modules/CoreUtils.js +32 -33
  190. package/src/modules/Data.js +130 -85
  191. package/src/modules/DataLabels.js +18 -2
  192. package/src/modules/Events.js +1 -4
  193. package/src/modules/Exports.js +3 -2
  194. package/src/modules/Fill.js +4 -4
  195. package/src/modules/Graphics.js +8 -14
  196. package/src/modules/MorphPieces.js +4 -2
  197. package/src/modules/MorphTypeChange.js +332 -316
  198. package/src/modules/Range.js +52 -91
  199. package/src/modules/Responsive.js +186 -61
  200. package/src/modules/Scales.js +4 -47
  201. package/src/modules/Series.js +14 -45
  202. package/src/modules/Theme.js +33 -5
  203. package/src/modules/Toolbar.js +7 -13
  204. package/src/modules/accessibility/KeyboardNavigation.js +29 -28
  205. package/src/modules/animations/CircleTransition.js +1 -4
  206. package/src/modules/animations/StreamScroll.js +6 -4
  207. package/src/modules/annotations/Annotations.js +0 -2
  208. package/src/modules/annotations/Helpers.js +4 -11
  209. package/src/modules/axes/XAxis.js +4 -4
  210. package/src/modules/axes/YAxis.js +0 -5
  211. package/src/modules/dimensions/Dimensions.js +1 -5
  212. package/src/modules/dimensions/Grid.js +13 -2
  213. package/src/modules/dimensions/YAxis.js +7 -6
  214. package/src/modules/helpers/Destroy.js +3 -0
  215. package/src/modules/helpers/InitCtxVariables.js +0 -2
  216. package/src/modules/helpers/UpdateHelpers.js +21 -11
  217. package/src/modules/highlightFilter/HighlightFilter.js +18 -40
  218. package/src/modules/highlightFilter/PiePart.js +1 -1
  219. package/src/modules/highlightFilter/RadialPart.js +1 -1
  220. package/src/modules/history/History.js +7 -2
  221. package/src/modules/legend/Legend.js +100 -62
  222. package/src/modules/license/LicenseEnforcer.js +6 -1
  223. package/src/modules/settings/Config.js +10 -54
  224. package/src/modules/settings/Defaults.js +180 -33
  225. package/src/modules/settings/Globals.js +7 -2
  226. package/src/modules/tooltip/AxesTooltip.js +4 -2
  227. package/src/modules/tooltip/Intersect.js +7 -21
  228. package/src/modules/tooltip/Marker.js +2 -2
  229. package/src/modules/tooltip/Position.js +10 -20
  230. package/src/modules/tooltip/Tooltip.js +24 -27
  231. package/src/modules/tooltip/Utils.js +0 -32
  232. package/src/modules/trellis/TrellisExports.js +21 -9
  233. package/src/modules/trellis/TrellisTooltip.js +18 -8
  234. package/src/modules/weave/Claims.js +8 -2
  235. package/src/modules/weave/Highlights.js +5 -2
  236. package/src/modules/weave/PluginAPI.js +6 -3
  237. package/src/modules/weave/WeaveHost.js +128 -64
  238. package/src/ssr/RenderShim.js +162 -3
  239. package/src/ssr/SSRRenderer.js +43 -6
  240. package/src/svg/SVGAnimation.js +10 -7
  241. package/src/types/internal.d.ts +22 -5
  242. package/src/utils/Constants.js +7 -8
  243. package/src/utils/DateTime.js +10 -177
  244. package/src/utils/Utils.js +14 -76
  245. package/types/apexcharts.d.ts +18 -7
@@ -54,7 +54,7 @@ var __async = (__this, __arguments, generator) => {
54
54
  });
55
55
  };
56
56
  /*!
57
- * ApexCharts v8.1.0
57
+ * ApexCharts v8.2.0
58
58
  * (c) 2018-2026 ApexCharts
59
59
  */
60
60
 
@@ -763,21 +763,13 @@ var __async = (__this, __arguments, generator) => {
763
763
  arrToExtend = extendedArr;
764
764
  return arrToExtend;
765
765
  }
766
- // If month counter exceeds 12, it starts again from 1
767
766
  /**
768
- * @param {number} month
769
- */
770
- static monthMod(month) {
771
- return month % 12;
772
- }
773
- /**
774
- * clone object with optional shallow copy for performance
767
+ * Deep clone, preserving shared and circular references.
775
768
  * @param {*} source - Source object to clone
776
769
  * @param {WeakMap<any, any>} visited - Circular reference tracker
777
- * @param {boolean} shallow - If true, performs shallow copy (default: false)
778
770
  * @returns {*} Cloned object
779
771
  */
780
- static clone(source, visited = /* @__PURE__ */ new WeakMap(), shallow = false) {
772
+ static clone(source, visited = /* @__PURE__ */ new WeakMap()) {
781
773
  if (source === null || typeof source !== "object") {
782
774
  return source;
783
775
  }
@@ -786,51 +778,28 @@ var __async = (__this, __arguments, generator) => {
786
778
  }
787
779
  let cloneResult;
788
780
  if (Array.isArray(source)) {
789
- if (shallow) {
790
- cloneResult = source.slice();
791
- } else {
792
- cloneResult = [];
793
- visited.set(source, cloneResult);
794
- for (let i2 = 0; i2 < source.length; i2++) {
795
- cloneResult[i2] = this.clone(source[i2], visited, false);
796
- }
781
+ cloneResult = [];
782
+ visited.set(source, cloneResult);
783
+ for (let i2 = 0; i2 < source.length; i2++) {
784
+ cloneResult[i2] = this.clone(source[i2], visited);
797
785
  }
798
786
  } else if (source instanceof Date) {
799
787
  cloneResult = new Date(source.getTime());
800
788
  } else {
801
- if (shallow) {
802
- cloneResult = Object.assign({}, source);
803
- } else {
804
- cloneResult = {};
805
- visited.set(source, cloneResult);
806
- for (const prop in source) {
807
- if (Object.prototype.hasOwnProperty.call(source, prop)) {
808
- cloneResult[prop] = this.clone(
809
- /** @type {Record<string,any>} */
810
- source[prop],
811
- visited,
812
- false
813
- );
814
- }
789
+ cloneResult = {};
790
+ visited.set(source, cloneResult);
791
+ for (const prop in source) {
792
+ if (Object.prototype.hasOwnProperty.call(source, prop)) {
793
+ cloneResult[prop] = this.clone(
794
+ /** @type {Record<string,any>} */
795
+ source[prop],
796
+ visited
797
+ );
815
798
  }
816
799
  }
817
800
  }
818
801
  return cloneResult;
819
802
  }
820
- /**
821
- * Shallow clone for performance when deep clone isn't needed
822
- * @param {*} source - Source to clone
823
- * @returns {*} Shallow cloned object
824
- */
825
- static shallowClone(source) {
826
- if (source === null || typeof source !== "object") {
827
- return source;
828
- }
829
- if (Array.isArray(source)) {
830
- return source.slice();
831
- }
832
- return Object.assign({}, source);
833
- }
834
803
  /**
835
804
  * Serialize options for an equality check, with functions included.
836
805
  *
@@ -884,25 +853,6 @@ var __async = (__this, __arguments, generator) => {
884
853
  }
885
854
  return true;
886
855
  }
887
- /**
888
- * @param {number} x
889
- */
890
- static log10(x) {
891
- return Math.log(x) / Math.LN10;
892
- }
893
- /**
894
- * @param {number} x
895
- */
896
- static roundToBase10(x) {
897
- return Math.pow(10, Math.floor(Math.log10(x)));
898
- }
899
- /**
900
- * @param {number} x
901
- * @param {number} base
902
- */
903
- static roundToBase(x, base) {
904
- return Math.pow(base, Math.floor(Math.log(x) / Math.log(base)));
905
- }
906
856
  /**
907
857
  * @param {any} val
908
858
  */
@@ -1240,12 +1190,6 @@ var __async = (__this, __arguments, generator) => {
1240
1190
  arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
1241
1191
  return arr;
1242
1192
  }
1243
- /**
1244
- * @param {string} s
1245
- */
1246
- static extractNumber(s2) {
1247
- return parseFloat(s2.replace(/[^\d.]*/g, ""));
1248
- }
1249
1193
  /**
1250
1194
  * @param {any} el
1251
1195
  * @param {string} cls
@@ -1409,9 +1353,6 @@ var __async = (__this, __arguments, generator) => {
1409
1353
  */
1410
1354
  constructor(w) {
1411
1355
  this.w = w;
1412
- this.months31 = [1, 3, 5, 7, 8, 10, 12];
1413
- this.months30 = [2, 4, 6, 9, 11];
1414
- this.daysCntOfYear = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
1415
1356
  }
1416
1357
  /**
1417
1358
  * @param {any} date
@@ -1453,14 +1394,6 @@ var __async = (__this, __arguments, generator) => {
1453
1394
  output = this.getTimeStamp(output);
1454
1395
  return output;
1455
1396
  }
1456
- // This fixes the difference of x-axis labels between chrome/safari
1457
- // Fixes #1726, #1544, #1485, #1255
1458
- /**
1459
- * @param {string} dateStr
1460
- */
1461
- parseDateWithTimezone(dateStr) {
1462
- return Date.parse(dateStr.replace(/-/g, "/").replace(/[a-z]+/gi, " "));
1463
- }
1464
1397
  // http://stackoverflow.com/questions/14638018/current-time-formatting-with-javascript#answer-14638191
1465
1398
  /**
1466
1399
  * @param {Date} date
@@ -1533,100 +1466,6 @@ var __async = (__this, __arguments, generator) => {
1533
1466
  format = format.replace(/\\(.)/g, "$1");
1534
1467
  return format;
1535
1468
  }
1536
- /**
1537
- * @param {number} minX
1538
- * @param {number} maxX
1539
- */
1540
- getTimeUnitsfromTimestamp(minX, maxX) {
1541
- const w = this.w;
1542
- if (w.config.xaxis.min !== void 0) {
1543
- minX = w.config.xaxis.min;
1544
- }
1545
- if (w.config.xaxis.max !== void 0) {
1546
- maxX = w.config.xaxis.max;
1547
- }
1548
- const tsMin = this.getDate(minX);
1549
- const tsMax = this.getDate(maxX);
1550
- const minD = this.formatDate(tsMin, "yyyy MM dd HH mm ss fff").split(" ");
1551
- const maxD = this.formatDate(tsMax, "yyyy MM dd HH mm ss fff").split(" ");
1552
- return {
1553
- minMillisecond: parseInt(minD[6], 10),
1554
- maxMillisecond: parseInt(maxD[6], 10),
1555
- minSecond: parseInt(minD[5], 10),
1556
- maxSecond: parseInt(maxD[5], 10),
1557
- minMinute: parseInt(minD[4], 10),
1558
- maxMinute: parseInt(maxD[4], 10),
1559
- minHour: parseInt(minD[3], 10),
1560
- maxHour: parseInt(maxD[3], 10),
1561
- minDate: parseInt(minD[2], 10),
1562
- maxDate: parseInt(maxD[2], 10),
1563
- minMonth: parseInt(minD[1], 10) - 1,
1564
- maxMonth: parseInt(maxD[1], 10) - 1,
1565
- minYear: parseInt(minD[0], 10),
1566
- maxYear: parseInt(maxD[0], 10)
1567
- };
1568
- }
1569
- /**
1570
- * @param {number} year
1571
- */
1572
- isLeapYear(year) {
1573
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
1574
- }
1575
- /**
1576
- * @param {number} month
1577
- * @param {number} year
1578
- * @param {number} subtract
1579
- */
1580
- calculcateLastDaysOfMonth(month, year, subtract) {
1581
- const days = this.determineDaysOfMonths(month, year);
1582
- return days - subtract;
1583
- }
1584
- /**
1585
- * @param {number} year
1586
- */
1587
- determineDaysOfYear(year) {
1588
- let days = 365;
1589
- if (this.isLeapYear(year)) {
1590
- days = 366;
1591
- }
1592
- return days;
1593
- }
1594
- /**
1595
- * @param {number} year
1596
- * @param {number} month
1597
- * @param {number} date
1598
- */
1599
- determineRemainingDaysOfYear(year, month, date) {
1600
- let dayOfYear = this.daysCntOfYear[month] + date;
1601
- if (month > 1 && this.isLeapYear(year)) dayOfYear++;
1602
- return dayOfYear;
1603
- }
1604
- /**
1605
- * @param {number} month
1606
- * @param {number} year
1607
- */
1608
- determineDaysOfMonths(month, year) {
1609
- let days = 30;
1610
- month = Utils$1.monthMod(month);
1611
- switch (true) {
1612
- case this.months30.indexOf(month) > -1:
1613
- if (month === 2) {
1614
- if (this.isLeapYear(year)) {
1615
- days = 29;
1616
- } else {
1617
- days = 28;
1618
- }
1619
- }
1620
- break;
1621
- case this.months31.indexOf(month) > -1:
1622
- days = 31;
1623
- break;
1624
- default:
1625
- days = 31;
1626
- break;
1627
- }
1628
- return days;
1629
- }
1630
1469
  // ───────────────────────────────────────────────────────────────────────────
1631
1470
  // Pure date helpers used by the v6 single-interval TimeScale.
1632
1471
  // Native Date setters/getters do all rollover work (leap years, month
@@ -1833,7 +1672,7 @@ var __async = (__this, __arguments, generator) => {
1833
1672
  if (aligned === s2 && d.getMilliseconds() === 0) return timestamp;
1834
1673
  d.setMilliseconds(0);
1835
1674
  d.setSeconds(aligned);
1836
- return d.getTime();
1675
+ break;
1837
1676
  }
1838
1677
  case "minute": {
1839
1678
  const m = d.getMinutes();
@@ -1843,7 +1682,7 @@ var __async = (__this, __arguments, generator) => {
1843
1682
  d.setMilliseconds(0);
1844
1683
  d.setSeconds(0);
1845
1684
  d.setMinutes(aligned);
1846
- return d.getTime();
1685
+ break;
1847
1686
  }
1848
1687
  case "hour": {
1849
1688
  const h = d.getHours();
@@ -1854,7 +1693,7 @@ var __async = (__this, __arguments, generator) => {
1854
1693
  d.setSeconds(0);
1855
1694
  d.setMinutes(0);
1856
1695
  d.setHours(aligned);
1857
- return d.getTime();
1696
+ break;
1858
1697
  }
1859
1698
  case "day": {
1860
1699
  if (d.getHours() === 0 && d.getMinutes() === 0 && d.getSeconds() === 0 && d.getMilliseconds() === 0)
@@ -1895,35 +1734,9 @@ var __async = (__this, __arguments, generator) => {
1895
1734
  }
1896
1735
  }
1897
1736
  }
1898
- return timestamp;
1899
- }
1900
- /**
1901
- * Test whether a timestamp falls exactly on a unit boundary (start of year,
1902
- * start of month, start of day, etc.). Used by the multi-resolution
1903
- * formatter to upgrade a tick's display unit to a coarser scale.
1904
- *
1905
- * @param {number} timestamp
1906
- * @param {'year'|'month'|'day'|'hour'|'minute'|'second'} unit
1907
- * @param {boolean} isUTC
1908
- * @returns {boolean}
1909
- */
1910
- isAtBoundary(timestamp, unit, isUTC) {
1911
- const f = this.getDateFields(timestamp, isUTC);
1912
- switch (unit) {
1913
- case "year":
1914
- return f.month === 0 && f.date === 1 && f.hour === 0 && f.minute === 0 && f.second === 0 && f.ms === 0;
1915
- case "month":
1916
- return f.date === 1 && f.hour === 0 && f.minute === 0 && f.second === 0 && f.ms === 0;
1917
- case "day":
1918
- return f.hour === 0 && f.minute === 0 && f.second === 0 && f.ms === 0;
1919
- case "hour":
1920
- return f.minute === 0 && f.second === 0 && f.ms === 0;
1921
- case "minute":
1922
- return f.second === 0 && f.ms === 0;
1923
- case "second":
1924
- return f.ms === 0;
1925
- }
1926
- return false;
1737
+ const r2 = d.getTime();
1738
+ const shift = new Date(timestamp).getTimezoneOffset() - d.getTimezoneOffset();
1739
+ return r2 < timestamp ? r2 + shift * 6e4 : r2;
1927
1740
  }
1928
1741
  }
1929
1742
  class Formatters {
@@ -5126,12 +4939,8 @@ var __async = (__this, __arguments, generator) => {
5126
4939
  const SOLO_TYPES = [...AXIS_ONLY_TYPES, ...NON_AXIS_TYPES];
5127
4940
  const TYPE_OWNED = "_apexOwnedByType";
5128
4941
  const STACKED_100 = "_apexStacked100";
5129
- const ownedBy = (types, fn) => {
5130
- const marked = (
5131
- /** @type {any} */
5132
- fn
5133
- );
5134
- marked[TYPE_OWNED] = types;
4942
+ const typeOwned = (fn) => {
4943
+ fn[TYPE_OWNED] = true;
5135
4944
  return fn;
5136
4945
  };
5137
4946
  const TYPE_OWNED_PATHS = [
@@ -5180,6 +4989,8 @@ var __async = (__this, __arguments, generator) => {
5180
4989
  "chart.zoom.enabled",
5181
4990
  "chart.animations.dynamicAnimation.enabled"
5182
4991
  ];
4992
+ const floorLabel = (val) => Utils$1.isNumber(val) ? Math.floor(val) : val;
4993
+ const plainFor = (config) => Utils$1.extend(new Options().init(), Defaults.forType(config));
5183
4994
  const readPath = (obj, path) => {
5184
4995
  let cur = (
5185
4996
  /** @type {any} */
@@ -5241,10 +5052,10 @@ var __async = (__this, __arguments, generator) => {
5241
5052
  };
5242
5053
  const isUntouched = (current, fromDefault) => {
5243
5054
  if (typeof current === "function") {
5244
- if (Array.isArray(
5055
+ if (
5245
5056
  /** @type {any} */
5246
5057
  current[TYPE_OWNED]
5247
- )) return true;
5058
+ ) return true;
5248
5059
  return typeof fromDefault === "function" && String(current) === String(fromDefault);
5249
5060
  }
5250
5061
  if (typeof fromDefault === "function") return current === void 0;
@@ -5495,6 +5306,71 @@ var __async = (__this, __arguments, generator) => {
5495
5306
  }
5496
5307
  }
5497
5308
  }
5309
+ /**
5310
+ * Put on or take off the sparkline preset when an update turns
5311
+ * `chart.sparkline.enabled` on or off; construction is the only other place
5312
+ * it is applied. A leaf moves only while it still holds what the outgoing
5313
+ * mode chose, and never when this update names it.
5314
+ *
5315
+ * @param {Record<string, any>} config the merged w.config, mutated in place
5316
+ * @param {boolean} was whether the sparkline was on before the update
5317
+ * @param {Record<string, any>} [options] this update's payload
5318
+ */
5319
+ static syncSparkline(config, was, options2) {
5320
+ var _a;
5321
+ const now = !!((_a = config.chart.sparkline) == null ? void 0 : _a.enabled);
5322
+ if (now === !!was) return;
5323
+ const d = new Defaults({ yaxis: [{ title: {}, axisBorder: {}, axisTicks: {} }] });
5324
+ const plain = plainFor(config);
5325
+ const walk = (preset, target, off, asked2, pre = "") => {
5326
+ for (const k of Object.keys(preset)) {
5327
+ const p = pre + k;
5328
+ if (Utils$1.isObject(preset[k])) {
5329
+ walk(preset[k], target, off, asked2, p + ".");
5330
+ } else if (readPath(asked2, p) === void 0) {
5331
+ const on = preset[k];
5332
+ const base = readPath(off, p);
5333
+ if (isUntouched(readPath(target, p), now ? base : on)) {
5334
+ writePath(target, p, now ? on : base);
5335
+ }
5336
+ }
5337
+ }
5338
+ };
5339
+ walk(d.sparkline({}), config, plain, options2);
5340
+ const asked = options2 == null ? void 0 : options2.yaxis;
5341
+ walk(
5342
+ d.opts.yaxis[0],
5343
+ config.yaxis[0],
5344
+ new Options().yAxis,
5345
+ Array.isArray(asked) ? asked[0] : asked
5346
+ );
5347
+ }
5348
+ /**
5349
+ * @param {Record<string, any>} config
5350
+ */
5351
+ static isHorizontalBar(config) {
5352
+ return config.chart.type === "bar" && !!config.plotOptions.bar.horizontal;
5353
+ }
5354
+ /**
5355
+ * Hand back what reconcile switched off for a horizontal bar (zoom and the
5356
+ * x-axis tooltip; the y-axis one is off by default anyway) when an update
5357
+ * turns it vertical or into another type. Same rule as syncSparkline: a
5358
+ * leaf moves only while it still holds the preset's false, and never when
5359
+ * this update names it.
5360
+ *
5361
+ * @param {Record<string, any>} config the merged w.config, mutated in place
5362
+ * @param {boolean} was whether the chart was a horizontal bar before
5363
+ * @param {Record<string, any>} [options] this update's payload
5364
+ */
5365
+ static syncHorizontal(config, was, options2) {
5366
+ if (!was || Defaults.isHorizontalBar(config)) return;
5367
+ const plain = plainFor(config);
5368
+ for (const p of ["chart.zoom.enabled", "xaxis.tooltip.enabled"]) {
5369
+ if (readPath(options2, p) === void 0 && readPath(config, p) === false) {
5370
+ writePath(config, p, readPath(plain, p));
5371
+ }
5372
+ }
5373
+ }
5498
5374
  /**
5499
5375
  * Settle the option combinations the renderers do not support. Runs on a new
5500
5376
  * chart's config and again after every updateOptions, which reaches the same
@@ -5515,7 +5391,7 @@ var __async = (__this, __arguments, generator) => {
5515
5391
  "tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false."
5516
5392
  );
5517
5393
  }
5518
- if (config.chart.type === "bar" && config.plotOptions.bar.horizontal) {
5394
+ if (Defaults.isHorizontalBar(config)) {
5519
5395
  if (config.yaxis.length > 1) {
5520
5396
  refuse(
5521
5397
  "Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false"
@@ -6023,8 +5899,7 @@ var __async = (__this, __arguments, generator) => {
6023
5899
  },
6024
5900
  tooltip: {
6025
5901
  shared: true,
6026
- custom: ownedBy(
6027
- ["candlestick"],
5902
+ custom: typeOwned(
6028
5903
  ({ seriesIndex, dataPointIndex, w }) => {
6029
5904
  return this._getBoxTooltip(
6030
5905
  w,
@@ -6065,8 +5940,7 @@ var __async = (__this, __arguments, generator) => {
6065
5940
  },
6066
5941
  tooltip: {
6067
5942
  shared: true,
6068
- custom: ownedBy(
6069
- ["boxPlot"],
5943
+ custom: typeOwned(
6070
5944
  ({ seriesIndex, dataPointIndex, w }) => {
6071
5945
  return this._getBoxTooltip(
6072
5946
  w,
@@ -6116,8 +5990,7 @@ var __async = (__this, __arguments, generator) => {
6116
5990
  },
6117
5991
  tooltip: {
6118
5992
  shared: true,
6119
- custom: ownedBy(
6120
- ["violin"],
5993
+ custom: typeOwned(
6121
5994
  ({ seriesIndex, dataPointIndex, w }) => {
6122
5995
  return this._getViolinTooltip(w, seriesIndex, dataPointIndex);
6123
5996
  }
@@ -6161,8 +6034,7 @@ var __async = (__this, __arguments, generator) => {
6161
6034
  }
6162
6035
  },
6163
6036
  tooltip: __spreadProps(__spreadValues({}, base.tooltip), {
6164
- custom: ownedBy(
6165
- ["raincloud"],
6037
+ custom: typeOwned(
6166
6038
  ({ seriesIndex, dataPointIndex, w }) => {
6167
6039
  return this._getRaincloudTooltip(w, seriesIndex, dataPointIndex);
6168
6040
  }
@@ -6245,8 +6117,7 @@ var __async = (__this, __arguments, generator) => {
6245
6117
  tooltip: {
6246
6118
  shared: false,
6247
6119
  followCursor: true,
6248
- custom: ownedBy(
6249
- ["rangeBar"],
6120
+ custom: typeOwned(
6250
6121
  /** @param {Record<string, any>} opts */
6251
6122
  (opts) => {
6252
6123
  if (opts.w.config.plotOptions && opts.w.config.plotOptions.bar && opts.w.config.plotOptions.bar.horizontal) {
@@ -6361,7 +6232,7 @@ var __async = (__this, __arguments, generator) => {
6361
6232
  shared: false,
6362
6233
  intersect: true,
6363
6234
  followCursor: false,
6364
- custom: ownedBy(["rangeBar"], handleDumbbellTooltip)
6235
+ custom: typeOwned(handleDumbbellTooltip)
6365
6236
  }
6366
6237
  });
6367
6238
  }
@@ -6460,8 +6331,7 @@ var __async = (__this, __arguments, generator) => {
6460
6331
  intersect: false,
6461
6332
  shared: true,
6462
6333
  followCursor: true,
6463
- custom: ownedBy(
6464
- ["rangeArea"],
6334
+ custom: typeOwned(
6465
6335
  /** @param {Record<string, any>} opts */
6466
6336
  (opts) => handleRangeAreaTooltip(opts)
6467
6337
  )
@@ -6600,8 +6470,7 @@ var __async = (__this, __arguments, generator) => {
6600
6470
  intersect: false,
6601
6471
  shared: false,
6602
6472
  followCursor: true,
6603
- custom: ownedBy(
6604
- ["streamgraph"],
6473
+ custom: typeOwned(
6605
6474
  /** @param {Record<string, any>} opts */
6606
6475
  (opts) => handleStreamTooltip(opts)
6607
6476
  )
@@ -6686,13 +6555,57 @@ var __async = (__this, __arguments, generator) => {
6686
6555
  opts.dataLabels.formatter = marked;
6687
6556
  return opts;
6688
6557
  }
6689
- // This function removes the left and right spacing in chart for line/area/scatter if xaxis type = category for those charts by converting xaxis = numeric. Numeric/Datetime xaxis prevents the unnecessary spacing in the left/right of the chart area
6690
6558
  /**
6559
+ * Whether a category x axis is drawn as numbers, which removes the edge
6560
+ * spacing a line, area or scatter would otherwise get. Not for the types
6561
+ * that draw names along it (a horizontal bar, a heatmap) or have none.
6562
+ *
6563
+ * @param {string} chartType
6691
6564
  * @param {Record<string, any>} opts
6565
+ * @param {Record<string, any>} chartDefaults
6566
+ * @returns {boolean}
6692
6567
  */
6693
- convertCatToNumeric(opts) {
6694
- opts.xaxis.convertedCatToNumeric = true;
6695
- return opts;
6568
+ static catToNumeric(chartType, opts, chartDefaults) {
6569
+ var _a, _b, _c, _d, _e, _f, _g, _h;
6570
+ const isBarHorizontal = (chartType === "bar" || chartType === "boxPlot" || chartType === "violin") && ((_b = (_a = opts.plotOptions) == null ? void 0 : _a.bar) == null ? void 0 : _b.horizontal);
6571
+ const unsupportedZoom = chartType === "pie" || chartType === "polarArea" || chartType === "donut" || chartType === "radar" || chartType === "radialBar" || chartType === "heatmap" || chartType === "unit" || chartType === "sunburst" || chartType === "icicle";
6572
+ const xaxisType = (_d = opts.xaxis.type) != null ? _d : (_c = chartDefaults.xaxis) == null ? void 0 : _c.type;
6573
+ const isScatterJitter = (chartType === "scatter" || chartType === "bubble") && ((_g = (_f = (_e = opts.plotOptions) == null ? void 0 : _e.scatter) == null ? void 0 : _f.jitter) == null ? void 0 : _g.enabled);
6574
+ const tickPlacement = opts.xaxis.tickPlacement || ((_h = chartDefaults.xaxis) == null ? void 0 : _h.tickPlacement);
6575
+ return !isBarHorizontal && !unsupportedZoom && !isScatterJitter && xaxisType !== "datetime" && xaxisType !== "numeric" && tickPlacement !== "between";
6576
+ }
6577
+ /**
6578
+ * Re-decide the conversion after an update merged into the config: a type
6579
+ * or orientation change can move the chart to the other side of it. When it
6580
+ * turns off, the axis gets back what the conversion took (its names, type,
6581
+ * formatter and tick count); when it turns on, the next render converts.
6582
+ *
6583
+ * @param {Record<string, any>} config the merged w.config, mutated in place
6584
+ * @param {Record<string, any>} [options] this update's payload
6585
+ */
6586
+ static syncCatToNumeric(config, options2) {
6587
+ var _a, _b, _c, _d;
6588
+ const x = config.xaxis;
6589
+ const was = !!x.convertedCatToNumeric;
6590
+ let asked = (_a = options2 == null ? void 0 : options2.xaxis) == null ? void 0 : _a.type;
6591
+ if (was && asked === "numeric") asked = void 0;
6592
+ const cd = Defaults.forType(config);
6593
+ const now = Defaults.catToNumeric(
6594
+ config.chart.type,
6595
+ __spreadProps(__spreadValues({}, config), { xaxis: __spreadProps(__spreadValues({}, x), { type: was ? asked : x.type }) }),
6596
+ cd
6597
+ );
6598
+ if (now === was) return;
6599
+ x.convertedCatToNumeric = now;
6600
+ if (now) return;
6601
+ const f = x.labels.formatter;
6602
+ const base = (f == null ? void 0 : f.baseFormatter) || f;
6603
+ x.labels.formatter = base === floorLabel ? void 0 : base;
6604
+ if ((f == null ? void 0 : f.categoryNames) && !((_b = x.categories) == null ? void 0 : _b.length)) x.categories = f.categoryNames;
6605
+ x.type = asked || ((_c = cd.xaxis) == null ? void 0 : _c.type) || "category";
6606
+ if (x.tickAmount === "dataPoints" && !((_d = options2 == null ? void 0 : options2.xaxis) == null ? void 0 : _d.tickAmount)) {
6607
+ x.tickAmount = void 0;
6608
+ }
6696
6609
  }
6697
6610
  /**
6698
6611
  * @param {Record<string, any>} opts
@@ -6701,12 +6614,7 @@ var __async = (__this, __arguments, generator) => {
6701
6614
  convertCatToNumericXaxis(opts, cats) {
6702
6615
  opts.xaxis.type = "numeric";
6703
6616
  opts.xaxis.labels = opts.xaxis.labels || {};
6704
- opts.xaxis.labels.formatter = opts.xaxis.labels.formatter || /**
6705
- * @param {any} val
6706
- */
6707
- function(val) {
6708
- return Utils$1.isNumber(val) ? Math.floor(val) : val;
6709
- };
6617
+ opts.xaxis.labels.formatter = opts.xaxis.labels.formatter || floorLabel;
6710
6618
  const current = (
6711
6619
  /** @type {any} */
6712
6620
  opts.xaxis.labels.formatter
@@ -7472,7 +7380,9 @@ var __async = (__this, __arguments, generator) => {
7472
7380
  if (!responsiveOverride) {
7473
7381
  opts.xaxis.convertedCatToNumeric = false;
7474
7382
  }
7475
- opts = this.checkForCatToNumericXAxis(this.chartType, chartDefaults, opts);
7383
+ if (Defaults.catToNumeric(this.chartType, opts, chartDefaults)) {
7384
+ opts.xaxis.convertedCatToNumeric = true;
7385
+ }
7476
7386
  if (((_f = opts.chart.sparkline) == null ? void 0 : _f.enabled) || ((_h = (_g = Environment.getApex().chart) == null ? void 0 : _g.sparkline) == null ? void 0 : _h.enabled)) {
7477
7387
  chartDefaults = defaults.sparkline(chartDefaults);
7478
7388
  }
@@ -7557,31 +7467,18 @@ var __async = (__this, __arguments, generator) => {
7557
7467
  }
7558
7468
  return opts;
7559
7469
  }
7560
- /**
7561
- * @param {string} chartType
7562
- * @param {Record<string, any>} chartDefaults
7563
- * @param {Record<string, any>} opts
7564
- */
7565
- checkForCatToNumericXAxis(chartType, chartDefaults, opts) {
7566
- var _a, _b, _c, _d, _e, _f, _g;
7567
- const defaults = new Defaults(opts);
7568
- const isBarHorizontal = (chartType === "bar" || chartType === "boxPlot" || chartType === "violin") && ((_b = (_a = opts.plotOptions) == null ? void 0 : _a.bar) == null ? void 0 : _b.horizontal);
7569
- const unsupportedZoom = chartType === "pie" || chartType === "polarArea" || chartType === "donut" || chartType === "radar" || chartType === "radialBar" || chartType === "heatmap" || chartType === "unit" || chartType === "sunburst" || chartType === "icicle";
7570
- const xaxisType = (_d = opts.xaxis.type) != null ? _d : (_c = chartDefaults.xaxis) == null ? void 0 : _c.type;
7571
- const notNumericXAxis = xaxisType !== "datetime" && xaxisType !== "numeric";
7572
- const isScatterJitter = (chartType === "scatter" || chartType === "bubble") && ((_g = (_f = (_e = opts.plotOptions) == null ? void 0 : _e.scatter) == null ? void 0 : _f.jitter) == null ? void 0 : _g.enabled);
7573
- const tickPlacement = opts.xaxis.tickPlacement ? opts.xaxis.tickPlacement : chartDefaults.xaxis && chartDefaults.xaxis.tickPlacement;
7574
- if (!isBarHorizontal && !unsupportedZoom && !isScatterJitter && notNumericXAxis && tickPlacement !== "between") {
7575
- opts = defaults.convertCatToNumeric(opts);
7576
- }
7577
- return opts;
7578
- }
7579
7470
  /**
7580
7471
  * @param {Record<string, any>} opts
7581
7472
  * @param {import('../../types/internal').ChartStateW} [w]
7582
7473
  */
7583
7474
  extendYAxis(opts, w) {
7475
+ var _a;
7584
7476
  const options2 = new Options();
7477
+ const c = ((_a = opts.chart) == null ? void 0 : _a.type) ? opts.chart : w == null ? void 0 : w.config.chart;
7478
+ options2.yAxis = Utils$1.extend(
7479
+ options2.yAxis,
7480
+ Defaults.typeYAxisDefaults((c == null ? void 0 : c.requestedType) || (c == null ? void 0 : c.type))
7481
+ );
7585
7482
  if (typeof opts.yaxis === "undefined" || !opts.yaxis || Array.isArray(opts.yaxis) && opts.yaxis.length === 0) {
7586
7483
  opts.yaxis = {};
7587
7484
  }
@@ -7918,10 +7815,8 @@ var __async = (__this, __arguments, generator) => {
7918
7815
  __publicField(_Config, "_defaults", null);
7919
7816
  let Config = _Config;
7920
7817
  const LINE_HEIGHT_RATIO = 1.618;
7921
- const NICE_SCALE_ALLOWED_MAG_MSD = [
7922
- [1, 1, 2, 5, 5, 5, 10, 10, 10, 10, 10],
7923
- [1, 1, 2, 5, 5, 5, 10, 10, 10, 10, 10]
7924
- ];
7818
+ const MAG_MSD_ROW = [1, 1, 2, 5, 5, 5, 10, 10, 10, 10, 10];
7819
+ const NICE_SCALE_ALLOWED_MAG_MSD = [MAG_MSD_ROW, MAG_MSD_ROW];
7925
7820
  const NICE_SCALE_DEFAULT_TICKS = [
7926
7821
  1,
7927
7822
  2,
@@ -7978,7 +7873,6 @@ var __async = (__this, __arguments, generator) => {
7978
7873
  gl.seriesXvalues = [];
7979
7874
  gl.seriesYvalues = [];
7980
7875
  gl.dataWasParsed = false;
7981
- gl.originalSeries = null;
7982
7876
  gl.maxValsInArrayIndex = 0;
7983
7877
  gl.yValueDecimal = 0;
7984
7878
  gl.allSeriesHasEqualX = true;
@@ -8115,7 +8009,6 @@ var __async = (__this, __arguments, generator) => {
8115
8009
  "barGroups",
8116
8010
  "lineGroups",
8117
8011
  "areaGroups",
8118
- "originalSeries",
8119
8012
  "collapsedSeries",
8120
8013
  "collapsedSeriesIndices",
8121
8014
  "ancillaryCollapsedSeries",
@@ -8283,6 +8176,10 @@ var __async = (__this, __arguments, generator) => {
8283
8176
  radialNeedleRAF: null,
8284
8177
  unitGatherRAF: null,
8285
8178
  unitExitRAF: null,
8179
+ // The gauge needle's last angle (the next tween starts there) and its
8180
+ // tick fade-in timer, which Destroy.clear() clears.
8181
+ radialNeedleAngle: void 0,
8182
+ radialTickTimer: null,
8286
8183
  // Debounce handles (container resize, selection-rect emit). Persistent
8287
8184
  // so a re-render cannot orphan a pending one; Destroy.clear() clears them.
8288
8185
  resizeTimer: null,
@@ -8321,6 +8218,9 @@ var __async = (__this, __arguments, generator) => {
8321
8218
  // The tokens the last render applied to fore and grid, for the same
8322
8219
  // reason (see Theme.applyTokenChrome).
8323
8220
  tokenChrome: void 0,
8221
+ // What the named theme (theme.name) wrote into config.theme, so a switch
8222
+ // to another named theme can take it back (see Theme._applyNamedThemeMode).
8223
+ namedThemeApplied: void 0,
8324
8224
  lastXAxis: [],
8325
8225
  lastYAxis: [],
8326
8226
  // ── User interaction state (must survive re-renders) ──────────────────────
@@ -8704,7 +8604,8 @@ var __async = (__this, __arguments, generator) => {
8704
8604
  // written by TimeScale.calculateTimeScaleMinMax()
8705
8605
  hasXaxisGroups: false,
8706
8606
  groups: [],
8707
- seriesGroups: []
8607
+ seriesGroups: [],
8608
+ seriesGroupIndex: []
8708
8609
  },
8709
8610
  // Axis / parsing behaviour flags — written by Data.parseData() each render.
8710
8611
  axisFlags: {
@@ -8718,8 +8619,8 @@ var __async = (__this, __arguments, generator) => {
8718
8619
  dataWasParsed: false
8719
8620
  },
8720
8621
  // Parsed series data — written by Data.parseData() each render.
8721
- // Note: initialSeries and originalSeries are intentionally excluded —
8722
- // they are persistent (survive re-renders) and remain on w.globals.
8622
+ // Note: initialSeries is intentionally excluded: it is persistent
8623
+ // (survives re-renders) and remains on w.globals.
8723
8624
  seriesData: {
8724
8625
  series: [],
8725
8626
  // main y-values array
@@ -9074,15 +8975,12 @@ var __async = (__this, __arguments, generator) => {
9074
8975
  getStackedSeriesTotalsByGroups() {
9075
8976
  const w = this.w;
9076
8977
  const total = [];
9077
- w.labelData.seriesGroups.forEach((sg) => {
9078
- const includedIndexes = [];
9079
- w.config.series.forEach((s2, si) => {
9080
- if (sg.indexOf(w.seriesData.seriesNames[si]) > -1) {
9081
- includedIndexes.push(si);
9082
- }
9083
- });
9084
- const excludedIndices = w.seriesData.series.map((_, fi) => includedIndexes.indexOf(fi) === -1 ? fi : -1).filter((f) => f !== -1);
9085
- total.push(this.getStackedSeriesTotals(excludedIndices));
8978
+ w.labelData.seriesGroups.forEach((_, gi) => {
8979
+ total.push(
8980
+ this.getStackedSeriesTotals(
8981
+ w.seriesData.series.map((_2, i2) => i2).filter((i2) => w.labelData.seriesGroupIndex[i2] !== gi)
8982
+ )
8983
+ );
9086
8984
  });
9087
8985
  return total;
9088
8986
  }
@@ -9258,7 +9156,7 @@ var __async = (__this, __arguments, generator) => {
9258
9156
  });
9259
9157
  if (w.config.markers.discrete && w.config.markers.discrete.length) {
9260
9158
  w.config.markers.discrete.forEach((m) => {
9261
- size = Math.max(size, m.size);
9159
+ size = Math.max(size, m.size || 0);
9262
9160
  });
9263
9161
  }
9264
9162
  if (size > 0) {
@@ -9323,11 +9221,20 @@ var __async = (__this, __arguments, generator) => {
9323
9221
  (s2, i2) => isBarSeries(s2) ? -1 : i2
9324
9222
  ).filter((i2) => i2 !== -1) : [];
9325
9223
  const stackedTotals = excluded.length ? this.getStackedSeriesTotals(excluded) : w.seriesData.stackedSeriesTotals;
9326
- w.globals.seriesPercent = w.seriesData.series.map((ser) => {
9224
+ const sx = w.axisFlags.isXNumeric && !w.config.plotOptions.bar.horizontal && w.seriesData.seriesX;
9225
+ const byX = /* @__PURE__ */ new Map();
9226
+ if (sx) {
9227
+ w.seriesData.series.forEach((s2, i2) => {
9228
+ if (excluded.indexOf(i2) < 0) {
9229
+ s2.forEach((v, j2) => byX.set(sx[i2][j2], (byX.get(sx[i2][j2]) || 0) + v));
9230
+ }
9231
+ });
9232
+ }
9233
+ w.globals.seriesPercent = w.seriesData.series.map((ser, i2) => {
9327
9234
  const seriesPercent = [];
9328
9235
  if (Array.isArray(ser)) {
9329
9236
  for (let j2 = 0; j2 < ser.length; j2++) {
9330
- const total = stackedTotals[j2];
9237
+ const total = sx ? byX.get(sx[i2][j2]) : stackedTotals[j2];
9331
9238
  let percent = 0;
9332
9239
  if (total) {
9333
9240
  percent = 100 * ser[j2] / total;
@@ -9368,8 +9275,7 @@ var __async = (__this, __arguments, generator) => {
9368
9275
  yRatio.push(gl.yRange[i2] / this.w.layout.gridHeight);
9369
9276
  }
9370
9277
  xRatio = gl.xRange / this.w.layout.gridWidth;
9371
- invertedYRatio = /** @type {any} */
9372
- gl.yRange / this.w.layout.gridWidth;
9278
+ invertedYRatio = gl.yRange[0] / this.w.layout.gridWidth;
9373
9279
  invertedXRatio = gl.xRange / this.w.layout.gridHeight;
9374
9280
  zRatio = gl.zRange / this.w.layout.gridHeight * 16;
9375
9281
  if (!zRatio) {
@@ -9423,10 +9329,12 @@ var __async = (__this, __arguments, generator) => {
9423
9329
  }
9424
9330
  /**
9425
9331
  * @param {any[]} series
9332
+ * @param {number[]} [realIndices] a combo subset's global series indices
9426
9333
  */
9427
- getLogSeries(series) {
9334
+ getLogSeries(series, realIndices) {
9428
9335
  const w = this.w;
9429
9336
  w.globals.seriesLog = series.map((s2, i2) => {
9337
+ if (realIndices) i2 = realIndices[i2];
9430
9338
  const yAxisIndex = w.globals.seriesYAxisReverseMap[i2];
9431
9339
  if (w.config.yaxis[yAxisIndex] && w.config.yaxis[yAxisIndex].logarithmic) {
9432
9340
  return s2.map((d) => {
@@ -10361,7 +10269,8 @@ var __async = (__this, __arguments, generator) => {
10361
10269
  }
10362
10270
  }
10363
10271
  const start = performance.now();
10364
- const easing = this._easing || _defaultEasing;
10272
+ const root = el.node && el.node.ownerSVGElement;
10273
+ const easing = this._easing || root && root.__apexEase || _defaultEasing;
10365
10274
  const tick = (now) => {
10366
10275
  const elapsed = now - start;
10367
10276
  const rawPos = Math.min(elapsed / duration, 1);
@@ -10586,67 +10495,37 @@ var __async = (__this, __arguments, generator) => {
10586
10495
  }
10587
10496
  gl.reducedMotionLatch = null;
10588
10497
  }
10589
- setDefaultEasing(resolveEasing(anim.easing));
10498
+ const ease = resolveEasing(anim.easing);
10499
+ easeByState.set(w, ease);
10500
+ setDefaultEasing(ease);
10590
10501
  }
10591
10502
  function computeStagger(opts) {
10592
10503
  const style = opts.style;
10593
10504
  const index = opts.index || 0;
10594
10505
  const baseDelay = typeof opts.baseDelay === "number" ? opts.baseDelay : 40;
10595
- const row = opts.row || 0;
10596
- const col = opts.col || 0;
10597
- const groupIndex = opts.groupIndex || 0;
10598
- const perGroup = opts.perGroup || 1;
10599
- const centerDistance = opts.centerDistance || 0;
10600
10506
  switch (style) {
10601
10507
  case "none":
10602
10508
  return 0;
10603
10509
  case "diagonal":
10604
- return (row + col) * baseDelay;
10605
- case "group":
10606
- return groupIndex * baseDelay + index % perGroup * (baseDelay / 4);
10607
- case "centroid":
10608
- return centerDistance * baseDelay * (index + 1);
10609
- case "sequential":
10510
+ return ((opts.row || 0) + (opts.col || 0)) * baseDelay;
10610
10511
  default:
10611
10512
  return index * baseDelay;
10612
10513
  }
10613
10514
  }
10614
10515
  const chartByState = /* @__PURE__ */ new WeakMap();
10516
+ const easeByState = /* @__PURE__ */ new WeakMap();
10615
10517
  class Animations {
10616
10518
  /**
10617
10519
  * @param {import('../types/internal').ChartStateW} w
10618
10520
  * @param {import('../types/internal').ChartContext} [ctx]
10619
10521
  */
10620
10522
  constructor(w, ctx) {
10523
+ var _a, _b;
10621
10524
  this.w = w;
10622
10525
  this.ctx = ctx;
10623
10526
  if (ctx && w && !chartByState.has(w)) chartByState.set(w, ctx);
10624
- }
10625
- /**
10626
- * @param {any} el
10627
- * @param {Record<string, any>} from
10628
- * @param {Record<string, any>} to
10629
- * @param {object} speed
10630
- */
10631
- animateLine(el, from, to, speed) {
10632
- el.attr(from).animate(speed).attr(to);
10633
- }
10634
- /*
10635
- ** Animate radius of a circle element
10636
- * @param {any} el
10637
- * @param {number} speed
10638
- * @param {string} easing
10639
- * @param {Function} cb
10640
- */
10641
- /** @param {any} el @param {any} speed @param {any} easing @param {any} cb */
10642
- animateMarker(el, speed, easing, cb) {
10643
- el.attr({
10644
- opacity: 0
10645
- }).animate(speed).attr({
10646
- opacity: 1
10647
- }).after(() => {
10648
- cb();
10649
- });
10527
+ const paper = (_b = (_a = w == null ? void 0 : w.dom) == null ? void 0 : _a.Paper) == null ? void 0 : _b.node;
10528
+ if (paper) paper.__apexEase = easeByState.get(w);
10650
10529
  }
10651
10530
  /**
10652
10531
  * Scale-up "pop" effect for scatter/bubble markers. Animates
@@ -11599,16 +11478,6 @@ var __async = (__this, __arguments, generator) => {
11599
11478
  const curve = ["C", x1, y1, x2, y2, x, y].join(" ");
11600
11479
  return curve;
11601
11480
  }
11602
- /**
11603
- * @param {number} x1
11604
- * @param {number} y1
11605
- * @param {number} x
11606
- * @param {number} y
11607
- */
11608
- quadraticCurve(x1, y1, x, y) {
11609
- const curve = ["Q", x1, y1, x, y].join(" ");
11610
- return curve;
11611
- }
11612
11481
  /**
11613
11482
  * @param {number} rx
11614
11483
  * @param {number} ry
@@ -11666,7 +11535,9 @@ var __async = (__this, __arguments, generator) => {
11666
11535
  className,
11667
11536
  chartType,
11668
11537
  shouldClipToGrid = true,
11669
- bindEventsOnPaths = true,
11538
+ // The handlers bail on a path without a `j` (a whole-series line or
11539
+ // area), so bind them only for a per-point path.
11540
+ bindEventsOnPaths = typeof j2 === "number",
11670
11541
  drawShadow = true,
11671
11542
  drawMask = null,
11672
11543
  scrollMorph = false,
@@ -11976,7 +11847,7 @@ var __async = (__this, __arguments, generator) => {
11976
11847
  }
11977
11848
  });
11978
11849
  } else {
11979
- if (maxWidth) {
11850
+ if (maxWidth && !isPlainText) {
11980
11851
  truncatedText = this.getTextBasedOnMaxWidth(__spreadValues({
11981
11852
  text
11982
11853
  }, commonProps));
@@ -12424,7 +12295,7 @@ var __async = (__this, __arguments, generator) => {
12424
12295
  * @param {string} selector
12425
12296
  */
12426
12297
  static _findDelegateTarget(node, boundary, selector) {
12427
- while (node && node !== boundary && node !== document) {
12298
+ while (node && node !== boundary) {
12428
12299
  if (node.matches && node.matches(selector)) return node;
12429
12300
  node = node.parentNode;
12430
12301
  }
@@ -12719,7 +12590,7 @@ var __async = (__this, __arguments, generator) => {
12719
12590
  defaultColor = Utils$1.hexToRgba(Utils$1.rgb2hex(fillColor), fillOpacity);
12720
12591
  }
12721
12592
  }
12722
- const resolvedFillColor = Utils$1.isCSSVariable(fillColor) ? Utils$1.getThemeColor(fillColor) : fillColor;
12593
+ const resolvedFillColor = Utils$1.getThemeColor(fillColor, w.dom.elWrap);
12723
12594
  if (fillType === "pattern") {
12724
12595
  patternFill = this.handlePatternFill({
12725
12596
  fillConfig: opts.fillConfig,
@@ -13769,6 +13640,11 @@ var __async = (__this, __arguments, generator) => {
13769
13640
  return result;
13770
13641
  }
13771
13642
  const RADIAL_TYPES = ["radar", "pie", "donut", "polarArea", "radialBar"];
13643
+ function penDrawn(w, i2) {
13644
+ var _a;
13645
+ const t2 = (_a = w.config.series[i2]) == null ? void 0 : _a.type;
13646
+ return !t2 || t2 === "line" || t2 === "area" || t2 === "rangeArea";
13647
+ }
13772
13648
  class DataLabels {
13773
13649
  /**
13774
13650
  * @param {import('../types/internal').ChartStateW} w
@@ -14076,7 +13952,7 @@ var __async = (__this, __arguments, generator) => {
14076
13952
  filters.dropShadow(dataLabelText, textShadow);
14077
13953
  }
14078
13954
  parent.add(dataLabelText);
14079
- applyProgressiveReveal(dataLabelText, x, w);
13955
+ if (penDrawn(w, i2)) applyProgressiveReveal(dataLabelText, x, w);
14080
13956
  if (typeof w.globals.lastDrawnDataLabelsIndexes[i2] === "undefined") {
14081
13957
  w.globals.lastDrawnDataLabelsIndexes[i2] = [];
14082
13958
  }
@@ -14273,7 +14149,8 @@ var __async = (__this, __arguments, generator) => {
14273
14149
  el.setAttribute("fill", bCnf.foreColor);
14274
14150
  if (!bulkReveal) {
14275
14151
  const cxAttr = el.getAttribute("cx");
14276
- if (cxAttr !== null) {
14152
+ const wrap = el.closest && el.closest(".apexcharts-datalabels");
14153
+ if (cxAttr !== null && penDrawn(w, wrap && wrap.getAttribute("data:realIndex"))) {
14277
14154
  applyProgressiveReveal(elRect, parseFloat(cxAttr), w);
14278
14155
  }
14279
14156
  }
@@ -14954,11 +14831,11 @@ var __async = (__this, __arguments, generator) => {
14954
14831
  if (ylabels.show) {
14955
14832
  for (let i2 = 0; i2 <= labels.length - 1; i2++) {
14956
14833
  let label = typeof labels[i2] === "undefined" ? "" : labels[i2];
14957
- label = lbFormatter(label, {
14958
- seriesIndex: realIndex,
14959
- dataPointIndex: i2,
14834
+ label = lbFormatter(
14835
+ label,
14836
+ { seriesIndex: realIndex, dataPointIndex: i2, w },
14960
14837
  w
14961
- });
14838
+ );
14962
14839
  const yColors = this.axesUtils.getYAxisForeColor(
14963
14840
  ylabels.style.colors,
14964
14841
  realIndex
@@ -15722,7 +15599,7 @@ var __async = (__this, __arguments, generator) => {
15722
15599
  const mag = Math.floor(Math.log10(niceStep));
15723
15600
  const magPow = Math.pow(10, mag);
15724
15601
  let magMsd = Math.ceil(niceStep / magPow);
15725
- magMsd = NICE_SCALE_ALLOWED_MAG_MSD[gl.yValueDecimal === 0 ? 0 : 1][magMsd];
15602
+ magMsd = NICE_SCALE_ALLOWED_MAG_MSD[0][magMsd];
15726
15603
  niceStep = magMsd * magPow;
15727
15604
  stepSize = niceStep;
15728
15605
  if (gl.isBarHorizontal && axisCnf.stepSize && axisCnf.type !== "datetime") {
@@ -15883,8 +15760,8 @@ var __async = (__this, __arguments, generator) => {
15883
15760
  niceMax: result[result.length - 1]
15884
15761
  };
15885
15762
  }
15886
- /** @param {number} yMin @param {number} yMax @param {number|string} ticks @param {number} index @param {number|undefined} step */
15887
- linearScale(yMin, yMax, ticks = 10, index = 0, step = void 0) {
15763
+ /** @param {number} yMin @param {number} yMax @param {number|string} ticks @param {number} _index unused, kept for the positional step @param {number|undefined} step */
15764
+ linearScale(yMin, yMax, ticks = 10, _index = 0, step = void 0) {
15888
15765
  const range = Math.abs(yMax - yMin);
15889
15766
  let result = [];
15890
15767
  if (yMin === yMax) {
@@ -15895,7 +15772,6 @@ var __async = (__this, __arguments, generator) => {
15895
15772
  niceMax: result[result.length - 1]
15896
15773
  };
15897
15774
  }
15898
- ticks = this._adjustTicksForSmallRange(ticks, index, range);
15899
15775
  if (
15900
15776
  /** @type {any} */
15901
15777
  ticks === "dataPoints"
@@ -15916,10 +15792,7 @@ var __async = (__this, __arguments, generator) => {
15916
15792
  const multiplier = Math.pow(10, precision);
15917
15793
  step = Math.round((step + Number.EPSILON) * multiplier) / multiplier;
15918
15794
  }
15919
- let tickCount = ticks === Number.MAX_VALUE ? 5 : ticksNum;
15920
- if (ticks === Number.MAX_VALUE) {
15921
- step = 1;
15922
- }
15795
+ let tickCount = ticksNum;
15923
15796
  let v = yMin;
15924
15797
  while (tickCount >= 0) {
15925
15798
  result.push(v);
@@ -16035,23 +15908,6 @@ var __async = (__this, __arguments, generator) => {
16035
15908
  niceMax: yMax
16036
15909
  };
16037
15910
  }
16038
- /**
16039
- * @param {number | string} ticks
16040
- * @param {number} index
16041
- * @param {number} range
16042
- */
16043
- _adjustTicksForSmallRange(ticks, index, range) {
16044
- let newTicks = ticks;
16045
- if (typeof index !== "undefined" && this.w.config.yaxis[index].labels.formatter && this.w.config.yaxis[index].tickAmount === void 0) {
16046
- const formattedVal = Number(
16047
- this.w.config.yaxis[index].labels.formatter(1)
16048
- );
16049
- if (Utils$1.isNumber(formattedVal) && this.w.globals.yValueDecimal === 0) {
16050
- newTicks = Math.ceil(range);
16051
- }
16052
- }
16053
- return newTicks < ticks ? newTicks : ticks;
16054
- }
16055
15911
  /**
16056
15912
  * @param {number} index
16057
15913
  * @param {number} minY
@@ -16122,7 +15978,6 @@ var __async = (__this, __arguments, generator) => {
16122
15978
  const alignZeroParticipants = [];
16123
15979
  const canAlignZero = !gl.isBarHorizontal;
16124
15980
  gl.allSeriesCollapsed = true;
16125
- gl.barGroups = [];
16126
15981
  axisSeriesMap.forEach((axisSeries, ai) => {
16127
15982
  const groupNames = [];
16128
15983
  axisSeries.forEach((as) => {
@@ -16141,7 +15996,6 @@ var __async = (__this, __arguments, generator) => {
16141
15996
  let lowestY = minY;
16142
15997
  let highestY = maxY;
16143
15998
  let seriesType;
16144
- let seriesGroupName;
16145
15999
  if (cnf.chart.stacked) {
16146
16000
  const mapSeries = new Array(gl.dataPoints).fill(0);
16147
16001
  const sumSeries = [];
@@ -16159,15 +16013,6 @@ var __async = (__this, __arguments, generator) => {
16159
16013
  cnf.series[axisSeries[i2]].type;
16160
16014
  }
16161
16015
  const si = axisSeries[i2];
16162
- if (
16163
- /** @type {Record<string,any>} */
16164
- cnf.series[si].group
16165
- ) {
16166
- seriesGroupName = /** @type {Record<string,any>} */
16167
- cnf.series[si].group;
16168
- } else {
16169
- seriesGroupName = "axis-".concat(ai.toString());
16170
- }
16171
16016
  const collapsed = !(gl.collapsedSeriesIndices.indexOf(si) < 0 && gl.ancillaryCollapsedSeriesIndices.indexOf(si) < 0);
16172
16017
  if (!collapsed) {
16173
16018
  gl.allSeriesCollapsed = false;
@@ -16190,9 +16035,6 @@ var __async = (__this, __arguments, generator) => {
16190
16035
  }
16191
16036
  });
16192
16037
  }
16193
- if (seriesType === "bar" || seriesType === "column") {
16194
- gl.barGroups.push(seriesGroupName);
16195
- }
16196
16038
  }
16197
16039
  if (!seriesType) {
16198
16040
  seriesType = cnf.chart.type;
@@ -16241,7 +16083,6 @@ var __async = (__this, __arguments, generator) => {
16241
16083
  maxY = cnf.yaxis[ai].max;
16242
16084
  }
16243
16085
  }
16244
- gl.barGroups = gl.barGroups.filter((v, i2, a2) => a2.indexOf(v) === i2);
16245
16086
  const yaxe = cnf.yaxis[ai];
16246
16087
  const participates = canAlignZero && yaxe.alignZero === true && !yaxe.logarithmic && yaxe.min === void 0 && yaxe.max === void 0 && gl.ignoreYAxisIndexes.indexOf(ai) < 0 && Utils$1.isNumber(minY) && Utils$1.isNumber(maxY);
16247
16088
  if (participates) {
@@ -16730,24 +16571,13 @@ var __async = (__this, __arguments, generator) => {
16730
16571
  const resolved = bound(computed);
16731
16572
  return Utils$1.isNumber(resolved) ? resolved : void 0;
16732
16573
  };
16733
- cnf.yaxis.forEach((yaxe, index) => {
16734
- const max = resolveBound(
16735
- yaxe.max,
16736
- gl.isMultipleYAxis ? gl.maxYArr[index] : gl.maxY
16737
- );
16738
- if (max !== void 0) {
16739
- gl.maxYArr[index] = max;
16740
- gl.maxY = max;
16741
- }
16742
- const min = resolveBound(
16743
- yaxe.min,
16744
- gl.isMultipleYAxis ? gl.minYArr[index] === Number.MIN_VALUE ? 0 : gl.minYArr[index] : gl.minY
16745
- );
16746
- if (min !== void 0) {
16747
- gl.minYArr[index] = min;
16748
- gl.minY = min;
16749
- }
16750
- });
16574
+ const yaxe = cnf.yaxis[0];
16575
+ if (!gl.isMultipleYAxis && yaxe) {
16576
+ const max = resolveBound(yaxe.max, gl.maxY);
16577
+ if (max !== void 0) gl.maxYArr[0] = gl.maxY = max;
16578
+ const min = resolveBound(yaxe.min, gl.minY);
16579
+ if (min !== void 0) gl.minYArr[0] = gl.minY = min;
16580
+ }
16751
16581
  if (gl.isBarHorizontal) {
16752
16582
  const minmax = ["min", "max"];
16753
16583
  minmax.forEach((m) => {
@@ -16800,11 +16630,12 @@ var __async = (__this, __arguments, generator) => {
16800
16630
  };
16801
16631
  }
16802
16632
  setXRange() {
16633
+ var _a, _b;
16803
16634
  const gl = this.w.globals;
16804
16635
  const cnf = this.w.config;
16805
16636
  const isXNumeric = cnf.xaxis.type === "numeric" || cnf.xaxis.type === "datetime" || cnf.xaxis.type === "category" && !this.w.axisFlags.noLabelsProvided || this.w.axisFlags.noLabelsProvided || this.w.axisFlags.isXNumeric;
16806
16637
  const getInitialMinXMaxX = () => {
16807
- var _a;
16638
+ var _a2;
16808
16639
  let minX = gl.minX;
16809
16640
  let maxX = gl.maxX;
16810
16641
  for (let i2 = 0; i2 < this.w.seriesData.series.length; i2++) {
@@ -16813,7 +16644,7 @@ var __async = (__this, __arguments, generator) => {
16813
16644
  this.w.labelData.labels[i2]
16814
16645
  );
16815
16646
  if (!lbls) continue;
16816
- const pe = (_a = this.w.seriesData._parsedExtrema) == null ? void 0 : _a[i2];
16647
+ const pe = (_a2 = this.w.seriesData._parsedExtrema) == null ? void 0 : _a2[i2];
16817
16648
  if (pe && pe.xNumeric && pe.xref === lbls && pe.len === lbls.length) {
16818
16649
  if (pe.maxX > maxX) maxX = pe.maxX;
16819
16650
  if (pe.minX < minX) minX = pe.minX;
@@ -16890,6 +16721,9 @@ var __async = (__this, __arguments, generator) => {
16890
16721
  if (cnf.xaxis.range !== void 0) {
16891
16722
  gl.minX = gl.maxX - cnf.xaxis.range;
16892
16723
  }
16724
+ if (cnf.chart.type === "heatmap") {
16725
+ (_b = (_a = getChartClass("heatmap").prototype).padXRange) == null ? void 0 : _b.call(_a, this);
16726
+ }
16893
16727
  if (gl.minX !== Number.MAX_VALUE && gl.maxX !== -Number.MAX_VALUE) {
16894
16728
  if (cnf.xaxis.convertedCatToNumeric && !this.w.axisFlags.dataFormatXNumeric) {
16895
16729
  const catScale = [];
@@ -17050,49 +16884,30 @@ var __async = (__this, __arguments, generator) => {
17050
16884
  const gl = this.w.globals;
17051
16885
  const windowed = this._autoScaleYEnabled();
17052
16886
  if (!this.w.seriesData.series.length) return;
17053
- let seriesGroups = this.w.labelData.seriesGroups;
17054
- if (!seriesGroups.length) {
17055
- seriesGroups = [this.w.seriesData.seriesNames.map((name2) => name2)];
17056
- }
17057
- const stackedPoss = {};
17058
- const stackedNegs = {};
17059
- seriesGroups.forEach((group) => {
17060
- stackedPoss[group] = [];
17061
- stackedNegs[group] = [];
17062
- const indicesOfSeriesInGroup = this.w.config.series.map(
17063
- (serie, si) => group.indexOf(this.w.seriesData.seriesNames[si]) > -1 ? si : null
17064
- ).filter((f) => f !== null);
17065
- indicesOfSeriesInGroup.forEach((i2) => {
17066
- var _a, _b, _c, _d;
16887
+ const gIdx = this.w.labelData.seriesGroupIndex;
16888
+ const byX = this.w.axisFlags.isXNumeric && !this.w.config.plotOptions.bar.horizontal;
16889
+ const stacks = /* @__PURE__ */ new Map();
16890
+ this.w.config.series.forEach(
16891
+ (serie, i2) => {
17067
16892
  const bounds = windowed ? this._autoScaleXBounds(i2) : null;
17068
16893
  const xs = this.w.seriesData.seriesX[i2];
17069
16894
  const hasX = !!(bounds && xs && xs.length);
16895
+ const stackSeries = this.w.config.chart.stacked && (!gl.comboCharts || !this.w.config.chart.stackOnlyBar || (serie == null ? void 0 : serie.type) === "bar" || (serie == null ? void 0 : serie.type) === "column");
17070
16896
  for (let j2 = 0; j2 < this.w.seriesData.series[gl.maxValsInArrayIndex].length; j2++) {
17071
16897
  if (hasX && (xs[j2] < bounds.lo || xs[j2] > bounds.hi)) continue;
17072
- if (typeof stackedPoss[group][j2] === "undefined") {
17073
- stackedPoss[group][j2] = 0;
17074
- stackedNegs[group][j2] = 0;
16898
+ const key = (gIdx[i2] || 0) + "|" + (byX && xs ? xs[j2] : j2);
16899
+ let st = stacks.get(key);
16900
+ if (!st) stacks.set(key, st = [0, 0]);
16901
+ const v = this.w.seriesData.series[i2][j2];
16902
+ if (stackSeries && v !== null && Utils$1.isNumber(v)) {
16903
+ v > 0 ? st[0] += parseFloat(String(v)) + 1e-4 : st[1] += parseFloat(String(v));
17075
16904
  }
17076
- const stackSeries = this.w.config.chart.stacked && !gl.comboCharts || this.w.config.chart.stacked && gl.comboCharts && (!this.w.config.chart.stackOnlyBar || /** @type {Record<string,any>} */
17077
- ((_b = (_a = this.w.config.series) == null ? void 0 : _a[i2]) == null ? void 0 : _b.type) === "bar" || /** @type {Record<string,any>} */
17078
- ((_d = (_c = this.w.config.series) == null ? void 0 : _c[i2]) == null ? void 0 : _d.type) === "column");
17079
- if (stackSeries) {
17080
- if (this.w.seriesData.series[i2][j2] !== null && Utils$1.isNumber(this.w.seriesData.series[i2][j2])) {
17081
- this.w.seriesData.series[i2][j2] > 0 ? stackedPoss[group][j2] += parseFloat(String(this.w.seriesData.series[i2][j2])) + 1e-4 : stackedNegs[group][j2] += parseFloat(
17082
- String(this.w.seriesData.series[i2][j2])
17083
- );
17084
- }
17085
- }
17086
- }
17087
- });
17088
- });
17089
- Object.entries(stackedPoss).forEach(([key]) => {
17090
- stackedPoss[key].forEach(
17091
- (_, stgi) => {
17092
- gl.maxY = Math.max(gl.maxY, stackedPoss[key][stgi]);
17093
- gl.minY = Math.min(gl.minY, stackedNegs[key][stgi]);
17094
16905
  }
17095
- );
16906
+ }
16907
+ );
16908
+ stacks.forEach((st) => {
16909
+ gl.maxY = Math.max(gl.maxY, st[0]);
16910
+ gl.minY = Math.min(gl.minY, st[1]);
17096
16911
  });
17097
16912
  }
17098
16913
  }
@@ -17160,7 +16975,6 @@ var __async = (__this, __arguments, generator) => {
17160
16975
  this.xaxisFontSize = w.config.xaxis.labels.style.fontSize;
17161
16976
  this.axisFontFamily = w.config.xaxis.labels.style.fontFamily;
17162
16977
  this.xaxisForeColors = w.config.xaxis.labels.style.colors;
17163
- this.isCategoryBarHorizontal = w.config.chart.type === "bar" && w.config.plotOptions.bar.horizontal;
17164
16978
  this.xAxisoffX = w.config.xaxis.position === "bottom" ? w.layout.gridHeight : 0;
17165
16979
  this.drawnLabels = [];
17166
16980
  this.axesUtils = new AxesUtils(w, { theme, timeScale });
@@ -17376,7 +17190,6 @@ var __async = (__this, __arguments, generator) => {
17376
17190
  );
17377
17191
  const timescaleLabels = w.labelData.timescaleLabels;
17378
17192
  if (timescaleLabels.length > 0) {
17379
- this.xaxisLabels = timescaleLabels.slice();
17380
17193
  labels = timescaleLabels.slice();
17381
17194
  tickAmount = labels.length;
17382
17195
  }
@@ -17537,7 +17350,6 @@ var __async = (__this, __arguments, generator) => {
17537
17350
  let xRight = 0;
17538
17351
  let leftOffsetX = 18;
17539
17352
  let rightOffsetX = 1;
17540
- if (w.config.yaxis.length > 1) this.multipleYs = true;
17541
17353
  w.config.yaxis.forEach((yaxe, index) => {
17542
17354
  const shouldNotDrawAxis = w.globals.ignoreYAxisIndexes.includes(index) || !yaxe.show || yaxe.floating || yaxisLabelCoords[index].width === 0;
17543
17355
  const axisWidth = yaxisLabelCoords[index].width + yTitleCoords[index].width;
@@ -17667,9 +17479,6 @@ var __async = (__this, __arguments, generator) => {
17667
17479
  });
17668
17480
  if (e2.type === "keydown") {
17669
17481
  if (w.config.chart.accessibility.enabled && w.config.chart.accessibility.keyboard.enabled) {
17670
- if (me.ctx.keyboardNavigation) {
17671
- me.ctx.keyboardNavigation.handleKey(e2);
17672
- }
17673
17482
  if (typeof w.config.chart.events.keyDown === "function") {
17674
17483
  w.config.chart.events.keyDown(e2, me, opts);
17675
17484
  }
@@ -17946,6 +17755,38 @@ var __async = (__this, __arguments, generator) => {
17946
17755
  }
17947
17756
  return out;
17948
17757
  }
17758
+ function collectPaths(layer, base, prefix, out) {
17759
+ for (const key of Object.keys(layer)) {
17760
+ const path = [...prefix, key];
17761
+ const v = layer[key];
17762
+ const b = Utils$1.isObject(base) ? base[key] : void 0;
17763
+ if (Utils$1.isObject(v) && Utils$1.isObject(b)) {
17764
+ collectPaths(v, b, path, out);
17765
+ } else {
17766
+ out.push(path);
17767
+ }
17768
+ }
17769
+ return out;
17770
+ }
17771
+ function lookup(obj, path) {
17772
+ let o2 = obj;
17773
+ for (const k of path) {
17774
+ if (!Utils$1.isObject(o2) || !(k in o2)) return { found: false };
17775
+ o2 = o2[k];
17776
+ }
17777
+ return { found: true, value: o2 };
17778
+ }
17779
+ function setPath(obj, path, value) {
17780
+ let o2 = obj;
17781
+ for (let i2 = 0; i2 < path.length - 1; i2++) {
17782
+ if (!Utils$1.isObject(o2[path[i2]])) return;
17783
+ o2[path[i2]] = __spreadValues({}, o2[path[i2]]);
17784
+ o2 = o2[path[i2]];
17785
+ }
17786
+ const last = path[path.length - 1];
17787
+ if (value === void 0) delete o2[last];
17788
+ else o2[last] = Utils$1.clone(value);
17789
+ }
17949
17790
  class Responsive {
17950
17791
  /**
17951
17792
  * @param {import('../types/internal').ChartStateW} w
@@ -17953,6 +17794,37 @@ var __async = (__this, __arguments, generator) => {
17953
17794
  constructor(w) {
17954
17795
  this.w = w;
17955
17796
  this._activeBreakpoint = null;
17797
+ this._base = /* @__PURE__ */ new Map();
17798
+ }
17799
+ /**
17800
+ * Folds an options payload into the recorded user values, so a path the
17801
+ * active breakpoint also sets takes the payload's value once the breakpoint
17802
+ * is left. While the breakpoint applies, it still wins over the payload.
17803
+ *
17804
+ * @param {Record<string, any> | null | undefined} opts
17805
+ */
17806
+ absorb(opts) {
17807
+ if (!opts || !this._base.size) return;
17808
+ for (const entry of this._base.values()) {
17809
+ const hit = lookup(opts, entry.path);
17810
+ if (!hit.found) continue;
17811
+ entry.value = Utils$1.isObject(hit.value) && Utils$1.isObject(entry.value) ? Utils$1.extend(entry.value, hit.value) : Utils$1.clone(hit.value);
17812
+ }
17813
+ }
17814
+ /**
17815
+ * A copy of `config` with every path the active breakpoints set put back to
17816
+ * the user's value: the config the chart would have with no breakpoint
17817
+ * active. Snapshots that outlive the breakpoint (initialConfig, Rewind
17818
+ * checkpoints) are taken from this, never from w.config.
17819
+ *
17820
+ * @param {Record<string, any>} config
17821
+ */
17822
+ withoutBreakpoints(config) {
17823
+ const out = __spreadValues({}, config);
17824
+ for (const { path, value } of this._base.values()) {
17825
+ setPath(out, path, value);
17826
+ }
17827
+ return out;
17956
17828
  }
17957
17829
  // the opts parameter if not null has to be set overriding everything
17958
17830
  // as the opts is set by user externally
@@ -17960,56 +17832,63 @@ var __async = (__this, __arguments, generator) => {
17960
17832
  * @param {object} opts
17961
17833
  */
17962
17834
  checkResponsiveConfig(opts) {
17835
+ var _b;
17963
17836
  const w = this.w;
17964
17837
  const cnf = w.config;
17965
- if (cnf.responsive.length === 0) return;
17966
- const res = cnf.responsive.slice();
17838
+ const res = (cnf.responsive || []).slice();
17839
+ if (res.length === 0 && this._activeBreakpoint === null) return;
17967
17840
  res.sort(
17968
17841
  (a2, b) => a2.breakpoint > b.breakpoint ? 1 : b.breakpoint > a2.breakpoint ? -1 : 0
17969
17842
  ).reverse();
17843
+ const width = Environment.isBrowser() ? window.innerWidth > 0 ? window.innerWidth : screen.width : 0;
17844
+ const matching = res.filter(
17845
+ (r2) => width < r2.breakpoint
17846
+ );
17847
+ if (matching.length === 0 && this._activeBreakpoint === null) return;
17970
17848
  const config = new Config({});
17971
- const iterateResponsiveOptions = (newOptions = {}) => {
17972
- var _a;
17973
- const largestBreakpoint = res[0].breakpoint;
17974
- const width = Environment.isBrowser() ? window.innerWidth > 0 ? window.innerWidth : screen.width : 0;
17975
- if (width > largestBreakpoint) {
17976
- if (this._activeBreakpoint !== null) {
17977
- if (!w.globals.initialConfig) return;
17978
- const initialConfig = Utils$1.clone(w.globals.initialConfig);
17979
- initialConfig.series = Utils$1.clone(w.config.series);
17980
- const options2 = CoreUtils.extendArrayProps(config, initialConfig, w);
17981
- newOptions = Utils$1.extend(options2, newOptions);
17982
- this.overrideResponsiveOptions(newOptions);
17983
- this._activeBreakpoint = null;
17984
- }
17985
- } else {
17986
- for (let i2 = 0; i2 < res.length; i2++) {
17987
- if (width < res[i2].breakpoint) {
17988
- const originalUserYaxis = ((_a = res[i2].options) == null ? void 0 : _a.yaxis) ? Utils$1.clone(res[i2].options.yaxis) : null;
17989
- newOptions = CoreUtils.extendArrayProps(config, res[i2].options, w);
17990
- newOptions = Utils$1.extend(w.config, newOptions);
17991
- if (Array.isArray(w.config.yaxis) && originalUserYaxis) {
17992
- const userYaxis = Array.isArray(originalUserYaxis) ? originalUserYaxis : [originalUserYaxis];
17993
- newOptions = __spreadProps(__spreadValues({}, newOptions), {
17994
- yaxis: w.config.yaxis.map(
17995
- (baseAxis, idx) => mergeYaxisOverride(baseAxis, userYaxis[idx])
17996
- )
17997
- });
17998
- }
17999
- this.overrideResponsiveOptions(newOptions);
18000
- this._activeBreakpoint = res[i2].breakpoint;
17849
+ this.absorb(opts);
17850
+ let cfg = Utils$1.extend({}, cnf);
17851
+ if (opts) {
17852
+ const _a = (
17853
+ /** @type {any} */
17854
+ opts
17855
+ ), { series: _series } = _a, rest = __objRest(_a, ["series"]);
17856
+ cfg = Utils$1.extend(cfg, CoreUtils.extendArrayProps(config, rest, w));
17857
+ }
17858
+ cfg = this.withoutBreakpoints(cfg);
17859
+ this._base = /* @__PURE__ */ new Map();
17860
+ this._activeBreakpoint = null;
17861
+ if (matching.length) {
17862
+ for (const r2 of matching) {
17863
+ for (const path of collectPaths(r2.options || {}, cfg, [], [])) {
17864
+ const key = path.join(".");
17865
+ if (!this._base.has(key)) {
17866
+ this._base.set(key, {
17867
+ path,
17868
+ value: Utils$1.clone(lookup(cfg, path).value)
17869
+ });
18001
17870
  }
18002
17871
  }
18003
17872
  }
18004
- };
18005
- if (opts) {
18006
- let options2 = CoreUtils.extendArrayProps(config, opts, w);
18007
- options2 = Utils$1.extend(w.config, options2);
18008
- options2 = Utils$1.extend(options2, opts);
18009
- iterateResponsiveOptions(options2);
18010
- } else {
18011
- iterateResponsiveOptions({});
17873
+ for (const r2 of matching) {
17874
+ const originalUserYaxis = ((_b = r2.options) == null ? void 0 : _b.yaxis) ? Utils$1.clone(r2.options.yaxis) : null;
17875
+ const baseYaxis = cfg.yaxis;
17876
+ cfg = Utils$1.extend(
17877
+ cfg,
17878
+ CoreUtils.extendArrayProps(config, r2.options, w)
17879
+ );
17880
+ if (Array.isArray(baseYaxis) && originalUserYaxis) {
17881
+ const userYaxis = Array.isArray(originalUserYaxis) ? originalUserYaxis : [originalUserYaxis];
17882
+ cfg = __spreadProps(__spreadValues({}, cfg), {
17883
+ yaxis: baseYaxis.map(
17884
+ (baseAxis, idx) => mergeYaxisOverride(baseAxis, userYaxis[idx])
17885
+ )
17886
+ });
17887
+ }
17888
+ this._activeBreakpoint = r2.breakpoint;
17889
+ }
18012
17890
  }
17891
+ this.overrideResponsiveOptions(cfg);
18013
17892
  }
18014
17893
  /**
18015
17894
  * @param {Record<string, any>} newOptions
@@ -18060,11 +17939,11 @@ var __async = (__this, __arguments, generator) => {
18060
17939
  if (!cfg || !cfg.enabled) return;
18061
17940
  const maxPoints = cfg.maxPoints;
18062
17941
  const range = w.config.xaxis.range;
17942
+ const dt = w.config.xaxis.type === "datetime";
18063
17943
  const xOf = (p) => {
18064
- if (p == null) return null;
18065
- if (Array.isArray(p)) return typeof p[0] === "number" ? p[0] : null;
18066
- if (typeof p === "object") return typeof p.x === "number" ? p.x : null;
18067
- return null;
17944
+ const x = Array.isArray(p) ? p[0] : p && p.x;
17945
+ const v = dt && x != null ? new Date(x).getTime() : x;
17946
+ return typeof v === "number" && v === v ? v : null;
18068
17947
  };
18069
17948
  newSeries.forEach((s2) => {
18070
17949
  var _a;
@@ -18949,19 +18828,16 @@ var __async = (__this, __arguments, generator) => {
18949
18828
  if (!geom || !graphical || !Environment.isBrowser()) return;
18950
18829
  if (!graphical.contains(geom.node)) return;
18951
18830
  try {
18952
- const plot = captureLayout(w);
18953
18831
  gl.prevCircleFrame = pendingUntilPaint({
18954
18832
  type: w.config.chart.type,
18955
18833
  circle: currentCircle(w, geom),
18956
18834
  // As rendered, without any tween: what the previous render's own
18957
18835
  // pixels (a radar's polygons) were measured against.
18958
18836
  rendered: { cx: geom.cx, cy: geom.cy, r: geom.r },
18959
- // Where the plot sat, which the circle is measured from.
18960
- origin: { x: plot.rect.x, y: plot.rect.y },
18961
18837
  // What the circle drew, against the svg it was drawn in.
18962
18838
  drawn: drawnBox(geom.node, graphical),
18963
18839
  // An axis chart's plot rect is captured with its axis chrome.
18964
- layout: gl.axisCharts ? null : plot,
18840
+ layout: gl.axisCharts ? null : captureLayout(w),
18965
18841
  texts: readTexts(geom.node, graphical)
18966
18842
  });
18967
18843
  } catch (_) {
@@ -19616,19 +19492,9 @@ var __async = (__this, __arguments, generator) => {
19616
19492
  clearSeriesCache() {
19617
19493
  const w = this.w;
19618
19494
  if (w.globals.cachedSelectors) {
19619
- delete w.globals.cachedSelectors.allSeriesEls;
19620
19495
  delete w.globals.cachedSelectors.highlightSeriesEls;
19621
19496
  }
19622
19497
  }
19623
- getAllSeriesEls() {
19624
- const w = this.w;
19625
- const cacheKey = "allSeriesEls";
19626
- if (!w.globals.cachedSelectors[cacheKey]) {
19627
- w.globals.cachedSelectors[cacheKey] = /** @type {any} */
19628
- w.dom.baseEl.getElementsByClassName(`apexcharts-series`);
19629
- }
19630
- return w.globals.cachedSelectors[cacheKey];
19631
- }
19632
19498
  /**
19633
19499
  * @param {string} seriesName
19634
19500
  */
@@ -19654,13 +19520,6 @@ var __async = (__this, __arguments, generator) => {
19654
19520
  const isHidden = el.classList.contains("apexcharts-series-collapsed") || gl.collapsedSeriesIndices.includes(realIndex) || gl.ancillaryCollapsedSeriesIndices.includes(realIndex);
19655
19521
  return { isHidden, realIndex };
19656
19522
  }
19657
- /**
19658
- * @param {any} elSeries
19659
- * @param {number} index
19660
- */
19661
- addCollapsedClassToSeries(elSeries, index) {
19662
- _Series.addCollapsedClassToSeries(this.w, elSeries, index);
19663
- }
19664
19523
  /**
19665
19524
  * @param {import('../types/internal').ChartStateW} w
19666
19525
  * @param {any} elSeries
@@ -19957,7 +19816,7 @@ var __async = (__this, __arguments, generator) => {
19957
19816
  const nextRecords = [];
19958
19817
  const nextIndices = [];
19959
19818
  records.forEach((rec) => {
19960
- const j2 = rec && rec.name != null ? newNames.indexOf(rec.name) : rec.index;
19819
+ const j2 = rec && rec.name != null && newNames[rec.index] !== rec.name ? newNames.indexOf(rec.name) : rec.index;
19961
19820
  if (j2 == null || j2 < 0 || j2 >= target.length) return;
19962
19821
  const s2 = (
19963
19822
  /** @type {any} */
@@ -20187,10 +20046,10 @@ var __async = (__this, __arguments, generator) => {
20187
20046
  getActiveConfigSeriesIndexByGroup(chartTypes = []) {
20188
20047
  const w = this.w;
20189
20048
  const groups = w.labelData.seriesGroups || [];
20190
- return groups.map((group) => {
20049
+ return groups.map((_, gi) => {
20191
20050
  let last = -1;
20192
20051
  w.config.series.forEach((s2, i2) => {
20193
- if (group.indexOf(w.seriesData.seriesNames[i2]) === -1) return;
20052
+ if (w.labelData.seriesGroupIndex[i2] !== gi) return;
20194
20053
  if (w.globals.comboCharts && chartTypes.length && chartTypes.indexOf(s2.type) === -1) {
20195
20054
  return;
20196
20055
  }
@@ -20482,23 +20341,16 @@ var __async = (__this, __arguments, generator) => {
20482
20341
  hasAllSeriesEqualX() {
20483
20342
  let equalLen = true;
20484
20343
  const w = this.w;
20485
- const filteredSerX = this.filteredSeriesX();
20486
- for (let i2 = 0; i2 < filteredSerX.length - 1; i2++) {
20487
- if (filteredSerX[i2][0] !== filteredSerX[i2 + 1][0]) {
20488
- equalLen = false;
20489
- break;
20490
- }
20344
+ const sx = w.seriesData.seriesX.filter((x) => x == null ? void 0 : x.length);
20345
+ for (let i2 = 1; equalLen && i2 < sx.length; i2++) {
20346
+ const a2 = sx[0];
20347
+ const b = sx[i2];
20348
+ const n2 = a2 === b ? 0 : Math.min(a2.length, b.length);
20349
+ for (let j2 = 0; equalLen && j2 < n2; j2++) equalLen = a2[j2] === b[j2];
20491
20350
  }
20492
20351
  w.globals.allSeriesHasEqualX = equalLen;
20493
20352
  return equalLen;
20494
20353
  }
20495
- filteredSeriesX() {
20496
- const w = this.w;
20497
- const filteredSeriesX = w.seriesData.seriesX.map(
20498
- (ser) => ser.length > 0 ? ser : []
20499
- );
20500
- return filteredSeriesX;
20501
- }
20502
20354
  };
20503
20355
  /**
20504
20356
  * Everything a capture of the screen writes (getPreviousPaths), plus the
@@ -20673,9 +20525,8 @@ var __async = (__this, __arguments, generator) => {
20673
20525
  * opposite-mode default sentinel, so an explicit user value or a value
20674
20526
  * already normalized by checkForDarkTheme/updateThemeOptions is untouched.
20675
20527
  */
20676
- _applyModeDefaults() {
20528
+ _applyModeDefaults(mode = this.w.config.theme.mode) {
20677
20529
  const w = this.w;
20678
- const mode = w.config.theme.mode;
20679
20530
  if (mode === "dark") {
20680
20531
  if (w.config.chart.foreColor === DEFAULT_FORECOLOR_LIGHT) {
20681
20532
  w.config.chart.foreColor = DEFAULT_FORECOLOR_DARK;
@@ -20701,17 +20552,33 @@ var __async = (__this, __arguments, generator) => {
20701
20552
  * explicit config and `follow:'os'` both win over the named theme.
20702
20553
  */
20703
20554
  _applyNamedThemeMode() {
20555
+ var _a;
20556
+ const w = this.w;
20557
+ const theme = w.config.theme;
20558
+ const prev = w.globals.namedThemeApplied || {};
20559
+ const applied = w.globals.namedThemeApplied = {};
20560
+ if (prev.mode && theme.mode === prev.mode) {
20561
+ theme.mode = "";
20562
+ this._applyModeDefaults("light");
20563
+ if (w.config.tooltip) w.config.tooltip.theme = "light";
20564
+ }
20565
+ if (prev.accessibility && ((_a = theme.accessibility) == null ? void 0 : _a.colorBlindMode) === prev.accessibility) {
20566
+ theme.accessibility.colorBlindMode = "";
20567
+ }
20568
+ if (prev.monochrome && theme.monochrome.enabled) {
20569
+ theme.monochrome = prev.monochrome;
20570
+ }
20704
20571
  const named = this._namedTheme;
20705
20572
  if (!named) return;
20706
- const theme = this.w.config.theme;
20707
20573
  if (named.mode && !theme.mode) {
20708
- theme.mode = named.mode;
20574
+ theme.mode = applied.mode = named.mode;
20709
20575
  }
20710
20576
  if (named.accessibility && named.accessibility.colorBlindMode && !(theme.accessibility && theme.accessibility.colorBlindMode)) {
20711
20577
  theme.accessibility = theme.accessibility || {};
20712
- theme.accessibility.colorBlindMode = named.accessibility.colorBlindMode;
20578
+ theme.accessibility.colorBlindMode = applied.accessibility = named.accessibility.colorBlindMode;
20713
20579
  }
20714
20580
  if (named.monochrome && named.monochrome.enabled && !theme.monochrome.enabled) {
20581
+ applied.monochrome = theme.monochrome;
20715
20582
  theme.monochrome = __spreadValues(__spreadValues({}, theme.monochrome), named.monochrome);
20716
20583
  }
20717
20584
  }
@@ -20929,6 +20796,11 @@ var __async = (__this, __arguments, generator) => {
20929
20796
  */
20930
20797
  updateThemeOptions(options2) {
20931
20798
  const mode = options2.theme.mode;
20799
+ const applied = this.w.globals.namedThemeApplied;
20800
+ for (const k in applied) {
20801
+ if (options2.theme[k] !== void 0) delete /** @type {any} */
20802
+ applied[k];
20803
+ }
20932
20804
  if (mode === void 0) return options2;
20933
20805
  options2.chart = options2.chart || {};
20934
20806
  options2.tooltip = options2.tooltip || {};
@@ -21482,7 +21354,7 @@ var __async = (__this, __arguments, generator) => {
21482
21354
  const height = 0;
21483
21355
  const ret = [];
21484
21356
  let labelPad = 10;
21485
- const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme, timeScale: this.dCtx.timeScale });
21357
+ const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme });
21486
21358
  w.config.yaxis.map((yaxe, index) => {
21487
21359
  const formatterArgs = {
21488
21360
  seriesIndex: index,
@@ -21498,9 +21370,9 @@ var __async = (__this, __arguments, generator) => {
21498
21370
  const minV = yS.niceMin === Number.MIN_VALUE ? 0 : yS.niceMin;
21499
21371
  let val = yS.result.reduce((acc, curr) => {
21500
21372
  var _a, _b;
21501
- return ((_a = String(lbFormatter(acc, formatterArgs))) == null ? void 0 : _a.length) > ((_b = String(lbFormatter(curr, formatterArgs))) == null ? void 0 : _b.length) ? acc : curr;
21373
+ return ((_a = String(lbFormatter(acc, formatterArgs, w))) == null ? void 0 : _a.length) > ((_b = String(lbFormatter(curr, formatterArgs, w))) == null ? void 0 : _b.length) ? acc : curr;
21502
21374
  }, minV);
21503
- val = lbFormatter(val, formatterArgs);
21375
+ val = lbFormatter(val, formatterArgs, w);
21504
21376
  let valArr = val;
21505
21377
  if (typeof val === "undefined" || val.length === 0) {
21506
21378
  val = yS.niceMax;
@@ -21513,7 +21385,7 @@ var __async = (__this, __arguments, generator) => {
21513
21385
  labelPad = 0;
21514
21386
  const barYaxisLabels = w.labelData.labels.slice();
21515
21387
  val = Utils$1.getLargestStringFromArr(barYaxisLabels);
21516
- val = lbFormatter(val, { seriesIndex: index, dataPointIndex: -1, w });
21388
+ val = lbFormatter(val, { seriesIndex: index, dataPointIndex: -1, w }, w);
21517
21389
  valArr = this.dCtx.dimHelpers.getLargestStringFromMultiArr(
21518
21390
  val,
21519
21391
  barYaxisLabels
@@ -21589,7 +21461,7 @@ var __async = (__this, __arguments, generator) => {
21589
21461
  let yAxisWidthLeft = 0;
21590
21462
  let yAxisWidthRight = 0;
21591
21463
  const padding = w.globals.yAxisScale.length > 1 ? 10 : 0;
21592
- const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme, timeScale: this.dCtx.timeScale });
21464
+ const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme });
21593
21465
  const isHiddenYAxis = function(index) {
21594
21466
  return w.globals.ignoreYAxisIndexes.indexOf(index) > -1;
21595
21467
  };
@@ -21654,7 +21526,8 @@ var __async = (__this, __arguments, generator) => {
21654
21526
  seriesLen = 1;
21655
21527
  }
21656
21528
  const barsPresent = hasBar(type) || gl.comboBarCount > 0;
21657
- let xRange = Math.abs(gl.initialMaxX - gl.initialMinX);
21529
+ const span = Math.abs(gl.initialMaxX - gl.initialMinX);
21530
+ let xRange = span;
21658
21531
  if (barsPresent && w.axisFlags.isXNumeric && !gl.isBarHorizontal && seriesLen > 0 && xRange !== 0) {
21659
21532
  if (xRange <= 3) {
21660
21533
  xRange = gl.dataPoints;
@@ -21668,6 +21541,10 @@ var __async = (__this, __arguments, generator) => {
21668
21541
  if (barWidth < 1) {
21669
21542
  barWidth = 1;
21670
21543
  }
21544
+ const cw = parseInt(cnf.plotOptions.bar.columnWidth, 10) / 100 || 0;
21545
+ const s2 = gl.minXDiff > 0 ? span / gl.minXDiff : 1;
21546
+ const need = cw / 2 * gridWidth / (s2 + cw) + 4;
21547
+ barWidth = Math.min(barWidth, Math.max(need, gridWidth / 8));
21671
21548
  gl.barPadForNumericAxis = barWidth;
21672
21549
  }
21673
21550
  return barWidth;
@@ -21740,7 +21617,7 @@ var __async = (__this, __arguments, generator) => {
21740
21617
  */
21741
21618
  setGridXPosForDualYAxis(yTitleCoords, yaxisLabelCoords) {
21742
21619
  const { w } = this;
21743
- const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme, timeScale: this.dCtx.timeScale });
21620
+ const axesUtils = new AxesUtils(this.w, { theme: this.dCtx.theme });
21744
21621
  w.config.yaxis.forEach((yaxe, index) => {
21745
21622
  if (w.globals.ignoreYAxisIndexes.indexOf(index) === -1 && !yaxe.floating && !axesUtils.isYAxisHidden(index)) {
21746
21623
  if (yaxe.opposite) {
@@ -21777,7 +21654,6 @@ var __async = (__this, __arguments, generator) => {
21777
21654
  this.w = w;
21778
21655
  this.ctx = ctx;
21779
21656
  this.theme = ctx.theme;
21780
- this.timeScale = ctx.timeScale;
21781
21657
  this.lgRect = /** @type {any} */
21782
21658
  {};
21783
21659
  this.yAxisWidth = 0;
@@ -22013,10 +21889,7 @@ var __async = (__this, __arguments, generator) => {
22013
21889
  throw new Error("Legend position not supported");
22014
21890
  }
22015
21891
  this.dimGrid.setGridXPosForDualYAxis(yTitleCoords, yaxisLabelCoords);
22016
- const objyAxis = new YAxis(this.w, {
22017
- theme: this.theme,
22018
- timeScale: this.timeScale
22019
- });
21892
+ const objyAxis = new YAxis(this.w, { theme: this.theme });
22020
21893
  objyAxis.setYAxisXPosition(yaxisLabelCoords, yTitleCoords);
22021
21894
  }
22022
21895
  setDimensionsForNonAxisCharts() {
@@ -22860,7 +22733,7 @@ var __async = (__this, __arguments, generator) => {
22860
22733
  }
22861
22734
  case "treemap": {
22862
22735
  const treemap = new (getChartClass("treemap"))(ctx.w, ctx);
22863
- elGraph = treemap.draw(this.w.seriesData.series);
22736
+ elGraph = treemap.draw();
22864
22737
  break;
22865
22738
  }
22866
22739
  case "unit": {
@@ -23045,7 +22918,7 @@ var __async = (__this, __arguments, generator) => {
23045
22918
  });
23046
22919
  }
23047
22920
  resizeNonAxisCharts() {
23048
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
22921
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
23049
22922
  const { w } = this;
23050
22923
  const heightStr = w.config.chart.height ? String(w.config.chart.height) : "";
23051
22924
  const userSetFixedHeight = heightStr !== "" && heightStr !== "auto";
@@ -23093,12 +22966,18 @@ var __async = (__this, __arguments, generator) => {
23093
22966
  if (bottom > arcBottomFromSVGTop) arcBottomFromSVGTop = bottom;
23094
22967
  }
23095
22968
  };
23096
- Array.from((_c = el.children) != null ? _c : []).forEach(
23097
- (c) => accumulate(
23098
- /** @type {Element} */
23099
- c
23100
- )
23101
- );
22969
+ const arcY = (_c = w.globals.circleGeometry) == null ? void 0 : _c.y;
22970
+ if (arcY) {
22971
+ arcTopFromSVGTop = w.layout.translateY + arcY[0] - externalLabelMarginY;
22972
+ arcBottomFromSVGTop = w.layout.translateY + arcY[1] + externalLabelMarginY;
22973
+ } else {
22974
+ Array.from((_d = el.children) != null ? _d : []).forEach(
22975
+ (c) => accumulate(
22976
+ /** @type {Element} */
22977
+ c
22978
+ )
22979
+ );
22980
+ }
23102
22981
  if (!Number.isFinite(arcTopFromSVGTop)) arcTopFromSVGTop = 0;
23103
22982
  if (!Number.isFinite(arcBottomFromSVGTop)) {
23104
22983
  const elRect = Utils$1.getBoundingClientRect(el);
@@ -23107,9 +22986,9 @@ var __async = (__this, __arguments, generator) => {
23107
22986
  const padding = Math.max(offY, w.globals.radialSize * 0.2);
23108
22987
  const verticalShift = Math.max(padding - arcTopFromSVGTop, 0);
23109
22988
  if (verticalShift !== 0) {
23110
- w.layout.translateY = ((_d = w.layout.translateY) != null ? _d : 0) + verticalShift;
22989
+ w.layout.translateY = ((_e = w.layout.translateY) != null ? _e : 0) + verticalShift;
23111
22990
  Graphics.setAttrs(this.w.dom.elGraphical.node, {
23112
- transform: `translate(${(_e = w.layout.translateX) != null ? _e : 0}, ${w.layout.translateY})`
22991
+ transform: `translate(${(_f = w.layout.translateX) != null ? _f : 0}, ${w.layout.translateY})`
23113
22992
  });
23114
22993
  arcBottomFromSVGTop += verticalShift;
23115
22994
  }
@@ -23118,7 +22997,7 @@ var __async = (__this, __arguments, generator) => {
23118
22997
  const svgHeight = Math.ceil(
23119
22998
  chartInnerDimensions + legendHeight + bottomPadding
23120
22999
  );
23121
- const chartOffsetY = (_f = w.config.chart.offsetY) != null ? _f : 0;
23000
+ const chartOffsetY = (_g = w.config.chart.offsetY) != null ? _g : 0;
23122
23001
  const elWrapHeight = svgHeight + Math.max(chartOffsetY, 0);
23123
23002
  if (!isPercentHeight) {
23124
23003
  if (this.w.dom.elLegendForeign) {
@@ -23130,14 +23009,14 @@ var __async = (__this, __arguments, generator) => {
23130
23009
  this.w.dom.elWrap.style.height = `${elWrapHeight}px`;
23131
23010
  Graphics.setAttrs(this.w.dom.Paper.node, { height: svgHeight });
23132
23011
  if (Environment.isBrowser()) {
23133
- const grandparent = (_g = this.w.dom.Paper.node.parentNode) == null ? void 0 : _g.parentNode;
23012
+ const grandparent = (_h = this.w.dom.Paper.node.parentNode) == null ? void 0 : _h.parentNode;
23134
23013
  if (grandparent) {
23135
23014
  grandparent.style.minHeight = `${elWrapHeight}px`;
23136
23015
  }
23137
23016
  }
23138
23017
  w.globals.svgHeight = svgHeight;
23139
23018
  if (w.config.legend.position === "bottom" && w.config.legend.show && !w.config.legend.floating) {
23140
- (_h = this.ctx.legend) == null ? void 0 : _h.setLegendWrapXY(20, 0);
23019
+ (_i = this.ctx.legend) == null ? void 0 : _i.setLegendWrapXY(20, 0);
23141
23020
  }
23142
23021
  }
23143
23022
  return;
@@ -23153,7 +23032,7 @@ var __async = (__this, __arguments, generator) => {
23153
23032
  this.w.dom.elWrap.style.height = `${newHeight}px`;
23154
23033
  Graphics.setAttrs(this.w.dom.Paper.node, { height: newHeight });
23155
23034
  if (Environment.isBrowser()) {
23156
- const grandparent = (_i = this.w.dom.Paper.node.parentNode) == null ? void 0 : _i.parentNode;
23035
+ const grandparent = (_j = this.w.dom.Paper.node.parentNode) == null ? void 0 : _j.parentNode;
23157
23036
  if (grandparent) {
23158
23037
  grandparent.style.minHeight = `${newHeight}px`;
23159
23038
  }
@@ -23166,17 +23045,11 @@ var __async = (__this, __arguments, generator) => {
23166
23045
  const resetxyValues = () => this.w.config.series.map(() => []);
23167
23046
  const globalObj = new Globals();
23168
23047
  const { globals: gl } = this.w;
23169
- const parsingFlags = {
23170
- dataWasParsed: this.w.axisFlags.dataWasParsed,
23171
- originalSeries: gl.originalSeries
23172
- };
23048
+ const dataWasParsed = this.w.axisFlags.dataWasParsed;
23173
23049
  globalObj.initGlobalVars(gl);
23174
23050
  gl.seriesXvalues = resetxyValues();
23175
23051
  gl.seriesYvalues = resetxyValues();
23176
- if (parsingFlags.dataWasParsed) {
23177
- this.w.axisFlags.dataWasParsed = parsingFlags.dataWasParsed;
23178
- gl.originalSeries = parsingFlags.originalSeries;
23179
- }
23052
+ if (dataWasParsed) this.w.axisFlags.dataWasParsed = true;
23180
23053
  }
23181
23054
  isMultipleY() {
23182
23055
  if (Array.isArray(this.w.config.yaxis) && this.w.config.yaxis.length > 1) {
@@ -23579,6 +23452,12 @@ var __async = (__this, __arguments, generator) => {
23579
23452
  0
23580
23453
  );
23581
23454
  }
23455
+ function toNum(v) {
23456
+ return typeof v === "number" ? v : v instanceof Date ? v.getTime() : typeof v === "string" && isNaN(
23457
+ /** @type {any} */
23458
+ v
23459
+ ) ? Date.parse(v) : +v;
23460
+ }
23582
23461
  class Data {
23583
23462
  /**
23584
23463
  * @param {import('../types/internal').ChartStateW} w
@@ -23610,6 +23489,7 @@ var __async = (__this, __arguments, generator) => {
23610
23489
  if (!this._pinActive) {
23611
23490
  this.activeSeriesIndex = new Series(this.w).getActiveConfigSeriesIndex();
23612
23491
  }
23492
+ if (this._ownPoint != null) return this._ownPoint;
23613
23493
  const activeItem = (
23614
23494
  /** @type {any} */
23615
23495
  series[this.activeSeriesIndex]
@@ -24295,11 +24175,14 @@ var __async = (__this, __arguments, generator) => {
24295
24175
  const groups = [
24296
24176
  ...new Set(cnf.series.map((s2) => s2.group))
24297
24177
  ];
24298
- cnf.series.forEach((s2, i2) => {
24299
- const index = groups.indexOf(s2.group);
24300
- if (!buckets[index]) buckets[index] = [];
24301
- buckets[index].push(this.w.seriesData.seriesNames[i2]);
24302
- });
24178
+ this.w.labelData.seriesGroupIndex = cnf.series.map(
24179
+ (s2, i2) => {
24180
+ const index = groups.indexOf(s2.group);
24181
+ if (!buckets[index]) buckets[index] = [];
24182
+ buckets[index].push(this.w.seriesData.seriesNames[i2]);
24183
+ return index;
24184
+ }
24185
+ );
24303
24186
  this.w.labelData.seriesGroups = buckets;
24304
24187
  const handleDates = () => {
24305
24188
  for (let j2 = 0; j2 < xlabels.length; j2++) {
@@ -24330,6 +24213,10 @@ var __async = (__this, __arguments, generator) => {
24330
24213
  );
24331
24214
  ser[i2] = __spreadProps(__spreadValues({}, ser[i2]), { data: [] });
24332
24215
  }
24216
+ this._ownPoint = null;
24217
+ for (let k = 0; this._ownPoint == null && k < ser[i2].data.length; k++) {
24218
+ this._ownPoint = ser[i2].data[k];
24219
+ }
24333
24220
  const dr = cnf.chart.dataReducer;
24334
24221
  const rawStash = (_b = (_a = gl.dataReducerRawSeries) == null ? void 0 : _a[i2]) == null ? void 0 : _b.data;
24335
24222
  if ((dr == null ? void 0 : dr.enabled) && !this._isCollapsedIndex(i2) && this.isMultiFormat() && Array.isArray(rawStash) && rawStash.length > ((_c = dr.threshold) != null ? _c : 500)) {
@@ -24420,6 +24307,7 @@ var __async = (__this, __arguments, generator) => {
24420
24307
  }
24421
24308
  }
24422
24309
  this._pinActive = false;
24310
+ this._ownPoint = null;
24423
24311
  return this.w;
24424
24312
  }
24425
24313
  /**
@@ -24515,7 +24403,6 @@ var __async = (__this, __arguments, generator) => {
24515
24403
  resetParsingFlags() {
24516
24404
  const w = this.w;
24517
24405
  w.axisFlags.dataWasParsed = false;
24518
- w.globals.originalSeries = null;
24519
24406
  if (w.config.series) {
24520
24407
  w.config.series.forEach((serie) => {
24521
24408
  if (
@@ -24560,6 +24447,7 @@ var __async = (__this, __arguments, generator) => {
24560
24447
  * @param {any[]} labels
24561
24448
  */
24562
24449
  extractPieDataFromSeriesObjects(seriesArray, values, labels) {
24450
+ const rootColors = this.w.config.chart.type === "sunburst" && this.w.seriesData.seriesColors;
24563
24451
  seriesArray.forEach((serie, serieIndex) => {
24564
24452
  if (!serie.data || !Array.isArray(serie.data)) {
24565
24453
  console.warn(`ApexCharts: Series ${serieIndex} has no valid data array`);
@@ -24569,6 +24457,9 @@ var __async = (__this, __arguments, generator) => {
24569
24457
  if (typeof dataPoint === "object" && dataPoint !== null) {
24570
24458
  const x = dataPoint.x !== void 0 ? dataPoint.x : dataPoint.name;
24571
24459
  const y = dataPoint.y !== void 0 ? dataPoint.y : dataPoint.value;
24460
+ if (rootColors && x !== void 0) {
24461
+ rootColors[labels.length] = dataPoint.color;
24462
+ }
24572
24463
  if (x !== void 0 && y !== void 0) {
24573
24464
  labels.push(String(x));
24574
24465
  values.push(Utils$1.parseNumber(y));
@@ -24708,7 +24599,6 @@ var __async = (__this, __arguments, generator) => {
24708
24599
  */
24709
24600
  parseRawDataIfNeeded(series) {
24710
24601
  const cnf = this.w.config;
24711
- const gl = this.w.globals;
24712
24602
  const globalParsing = cnf.parsing;
24713
24603
  if (this.w.axisFlags.dataWasParsed) {
24714
24604
  return series;
@@ -24734,7 +24624,9 @@ var __async = (__this, __arguments, generator) => {
24734
24624
  return serie;
24735
24625
  }
24736
24626
  const firstDataPoint = serie.data[0];
24737
- if (typeof firstDataPoint === "object" && firstDataPoint !== null && (Object.prototype.hasOwnProperty.call(firstDataPoint, "x") || Object.prototype.hasOwnProperty.call(firstDataPoint, "y")) || Array.isArray(firstDataPoint)) {
24627
+ if (typeof firstDataPoint === "object" && firstDataPoint !== null && (Object.prototype.hasOwnProperty.call(firstDataPoint, "x") || Object.prototype.hasOwnProperty.call(firstDataPoint, "y")) && ![effectiveParsing.x, effectiveParsing.y, effectiveParsing.z].flat().some(
24628
+ (f) => f && f !== "x" && f !== "y" && f !== "z" && this.getNestedValue(firstDataPoint, f) !== void 0
24629
+ ) || Array.isArray(firstDataPoint)) {
24738
24630
  return serie;
24739
24631
  }
24740
24632
  if (!effectiveParsing.x || !effectiveParsing.y || Array.isArray(effectiveParsing.y) && effectiveParsing.y.length === 0) {
@@ -24812,9 +24704,6 @@ var __async = (__this, __arguments, generator) => {
24812
24704
  });
24813
24705
  });
24814
24706
  this.w.axisFlags.dataWasParsed = true;
24815
- if (!gl.originalSeries) {
24816
- gl.originalSeries = Utils$1.clone(series);
24817
- }
24818
24707
  return processedSeries;
24819
24708
  }
24820
24709
  /**
@@ -25064,9 +24953,8 @@ var __async = (__this, __arguments, generator) => {
25064
24953
  * scale. Bands sit at integer positions 0..N-1; the range is padded by a full
25065
24954
  * band on each side (min -1, max N) so jittered dots never clip. Crucially the
25066
24955
  * range bounds and tick count are integers, so the ticks land exactly on the
25067
- * band centers regardless of how the numeric scale "nices" the step (e.g. the
25068
- * small-range reduction in Scales._adjustTicksForSmallRange triggered by a
25069
- * y-axis formatter). Only fills in options the user hasn't set, so explicit
24956
+ * band centers regardless of how the numeric scale "nices" the step. Only
24957
+ * fills in options the user hasn't set, so explicit
25070
24958
  * min/max/tickAmount/formatter still win. The exception is an interactive
25071
24959
  * zoom/pan window (w.interact.zoomed): its fractional bounds are snapped to
25072
24960
  * whole bands so tick labels stay on band centers and edge bands are never
@@ -25123,6 +25011,37 @@ var __async = (__this, __arguments, generator) => {
25123
25011
  xa.labels.formatter = fmt;
25124
25012
  }
25125
25013
  }
25014
+ /**
25015
+ * Refuse a series list an axis chart cannot read, naming the entry.
25016
+ *
25017
+ * A flat list of numbers is the shape pie, donut, polarArea and radialBar
25018
+ * take. Handed to an axis chart it reached `setSeriesYAxisMappings`, which
25019
+ * writes a group name onto every series, and the reader got `Cannot create
25020
+ * property 'group' on number '44'`: no mention of `series`, of the chart
25021
+ * type, or of the shape that would have worked. `column` made it easy to
25022
+ * reach, since it sounds like a sibling of the slice charts and is a bar.
25023
+ *
25024
+ * Checked here because every series reaches the renderer through parseData,
25025
+ * from `new ApexCharts`, `updateOptions` and `updateSeries` alike. A null
25026
+ * entry is let through: a series may be bare until loaded in realtime, and
25027
+ * `setSeriesYAxisMappings` already skips one.
25028
+ *
25029
+ * @param {any[]} ser
25030
+ */
25031
+ assertAxisSeriesShape(ser) {
25032
+ if (!this.w.globals.axisCharts || !Array.isArray(ser)) return;
25033
+ const at = ser.findIndex(
25034
+ (s2) => s2 !== null && s2 !== void 0 && typeof s2 !== "object"
25035
+ );
25036
+ if (at === -1) return;
25037
+ const chart = this.w.config.chart;
25038
+ const type = chart.requestedType ? chart.requestedType : chart.type === "bar" ? "bar or column" : chart.type;
25039
+ const value = ser[at];
25040
+ const shown = typeof value === "string" ? JSON.stringify(value) : String(value);
25041
+ throw new Error(
25042
+ `ApexCharts: a ${type} chart needs each series as an object with its own data, like series: [{ name: 'Sales', data: [44, 55, 13] }], but series[${at}] is the ${typeof value} ${shown}. A flat list of numbers is the form pie, donut, polarArea and radialBar take.`
25043
+ );
25044
+ }
25126
25045
  // Segregate user provided data into appropriate vars
25127
25046
  /**
25128
25047
  * @param {any[]} ser
@@ -25135,6 +25054,7 @@ var __async = (__this, __arguments, generator) => {
25135
25054
  const w = this.w;
25136
25055
  const cnf = w.config;
25137
25056
  const gl = w.globals;
25057
+ this.assertAxisSeriesShape(ser);
25138
25058
  ser = this.parseRawDataIfNeeded(ser);
25139
25059
  ser = this.applySeriesTransform(ser);
25140
25060
  ser = this.expandScatterJitterData(ser);
@@ -25147,10 +25067,10 @@ var __async = (__this, __arguments, generator) => {
25147
25067
  const d = s2 == null ? void 0 : s2.data;
25148
25068
  if (!Array.isArray(d) || d.length === 0) continue;
25149
25069
  const isXY = !Array.isArray(d[0]);
25150
- const firstX = isXY ? (_b = d[0]) == null ? void 0 : _b.x : (_c = d[0]) == null ? void 0 : _c[0];
25151
- const lastX = isXY ? (_d = d[d.length - 1]) == null ? void 0 : _d.x : (_e = d[d.length - 1]) == null ? void 0 : _e[0];
25152
- if (typeof firstX === "number") rawMinX = Math.min(rawMinX, firstX);
25153
- if (typeof lastX === "number") rawMaxX = Math.max(rawMaxX, lastX);
25070
+ const firstX = toNum(isXY ? (_b = d[0]) == null ? void 0 : _b.x : (_c = d[0]) == null ? void 0 : _c[0]);
25071
+ const lastX = toNum(isXY ? (_d = d[d.length - 1]) == null ? void 0 : _d.x : (_e = d[d.length - 1]) == null ? void 0 : _e[0]);
25072
+ if (firstX === firstX) rawMinX = Math.min(rawMinX, firstX);
25073
+ if (lastX === lastX) rawMaxX = Math.max(rawMaxX, lastX);
25154
25074
  }
25155
25075
  if (rawMinX !== Infinity) {
25156
25076
  gl.dataReducerRawMinX = rawMinX;
@@ -25245,58 +25165,6 @@ var __async = (__this, __arguments, generator) => {
25245
25165
  { tail: "Drawing the chart without them." }
25246
25166
  );
25247
25167
  }
25248
- return {
25249
- // w.seriesData (future slice)
25250
- // initialSeries/originalSeries and the stacked totals are deliberately
25251
- // ABSENT: they already live as lazy accessors on gl / w.seriesData, so
25252
- // a snapshot field would either force their materialization (a deep
25253
- // clone plus three O(n) passes per parse that most charts never need)
25254
- // or, as a delegating getter, recurse into itself when a writer copies
25255
- // it back onto the object it delegates to.
25256
- seriesData: {
25257
- series: this.w.seriesData.series,
25258
- seriesNames: this.w.seriesData.seriesNames,
25259
- seriesX: this.w.seriesData.seriesX,
25260
- seriesZ: this.w.seriesData.seriesZ,
25261
- seriesColors: this.w.seriesData.seriesColors,
25262
- seriesGoals: this.w.seriesData.seriesGoals,
25263
- unitData: this.w.seriesData.unitData,
25264
- noLabelsProvided: this.w.axisFlags.noLabelsProvided
25265
- },
25266
- // w.rangeData (future slice)
25267
- rangeData: {
25268
- seriesRangeStart: this.w.rangeData.seriesRangeStart,
25269
- seriesRangeEnd: this.w.rangeData.seriesRangeEnd,
25270
- seriesRange: this.w.rangeData.seriesRange
25271
- },
25272
- // w.candleData (future slice)
25273
- candleData: {
25274
- seriesCandleO: this.w.candleData.seriesCandleO,
25275
- seriesCandleH: this.w.candleData.seriesCandleH,
25276
- seriesCandleM: this.w.candleData.seriesCandleM,
25277
- seriesCandleL: this.w.candleData.seriesCandleL,
25278
- seriesCandleC: this.w.candleData.seriesCandleC,
25279
- seriesBoxPoints: this.w.candleData.seriesBoxPoints
25280
- },
25281
- // w.labelData (future slice)
25282
- labelData: {
25283
- labels: this.w.labelData.labels,
25284
- categoryLabels: this.w.labelData.categoryLabels
25285
- },
25286
- // w.axisFlags (future slice)
25287
- axisFlags: {
25288
- isXNumeric: this.w.axisFlags.isXNumeric,
25289
- dataFormatXNumeric: this.w.axisFlags.dataFormatXNumeric,
25290
- isDataXYZ: this.w.axisFlags.isDataXYZ,
25291
- isRangeData: this.w.axisFlags.isRangeData,
25292
- isRangeBar: this.w.axisFlags.isRangeBar,
25293
- isMultiLineX: this.w.axisFlags.isMultiLineX,
25294
- dataWasParsed: this.w.axisFlags.dataWasParsed,
25295
- hasXaxisGroups: this.w.labelData.hasXaxisGroups,
25296
- groups: this.w.labelData.groups,
25297
- seriesGroups: this.w.labelData.seriesGroups
25298
- }
25299
- };
25300
25168
  }
25301
25169
  /**
25302
25170
  * Slice a sorted-by-x series to a [xmin, xmax] window using binary search.
@@ -25347,7 +25215,7 @@ var __async = (__this, __arguments, generator) => {
25347
25215
  const len = data.length;
25348
25216
  if (len === 0) return data;
25349
25217
  const isXY = !Array.isArray(data[0]);
25350
- const getX = isXY ? (p) => p.x : (p) => p[0];
25218
+ const getX = isXY ? (p) => toNum(p.x) : (p) => toNum(p[0]);
25351
25219
  let lo = 0;
25352
25220
  if (xmin != null) {
25353
25221
  let l2 = 0;
@@ -25386,8 +25254,8 @@ var __async = (__this, __arguments, generator) => {
25386
25254
  const len = data.length;
25387
25255
  if (targetPoints >= len || targetPoints < 3) return data;
25388
25256
  const isXY = !Array.isArray(data[0]);
25389
- const getX = isXY ? (p) => p.x : (p) => p[0];
25390
- const getY = isXY ? (p) => p.y : (p) => p[1];
25257
+ const getX = isXY ? (p) => toNum(p.x) : (p) => toNum(p[0]);
25258
+ const getY = isXY ? (p) => toNum(p.y) : (p) => toNum(p[1]);
25391
25259
  const sampled = [];
25392
25260
  sampled.push(data[0]);
25393
25261
  const bucketSize = (len - 2) / (targetPoints - 2);
@@ -25603,7 +25471,7 @@ var __async = (__this, __arguments, generator) => {
25603
25471
  }
25604
25472
  const payload = options2;
25605
25473
  const updates = charts.map((ch) => {
25606
- var _a, _b;
25474
+ var _a, _b, _c, _d;
25607
25475
  const w = ch.w;
25608
25476
  options2 = payload;
25609
25477
  if (options2 && typeof options2 === "object") {
@@ -25623,10 +25491,12 @@ var __async = (__this, __arguments, generator) => {
25623
25491
  w.globals.previousPaths = [];
25624
25492
  }
25625
25493
  const fromType = w.config.chart.requestedType || w.config.chart.type;
25494
+ const wasSparkline = (_a = w.config.chart.sparkline) == null ? void 0 : _a.enabled;
25495
+ const wasHorizontal = Defaults.isHorizontalBar(w.config);
25626
25496
  if (animate && options2 && typeof options2 === "object") {
25627
- const newType = (_a = options2 == null ? void 0 : options2.chart) == null ? void 0 : _a.type;
25497
+ const newType = (_b = options2 == null ? void 0 : options2.chart) == null ? void 0 : _b.type;
25628
25498
  if (newType && newType !== fromType) {
25629
- (_b = ch.morphTypeChange) == null ? void 0 : _b.captureBeforeDestroy({
25499
+ (_c = ch.morphTypeChange) == null ? void 0 : _c.captureBeforeDestroy({
25630
25500
  fromType,
25631
25501
  toType: newType,
25632
25502
  newSeries: options2.series || w.config.series
@@ -25668,14 +25538,21 @@ var __async = (__this, __arguments, generator) => {
25668
25538
  clearRawSeriesStashes(w);
25669
25539
  }
25670
25540
  w.config = Utils$1.extend(w.config, options2);
25541
+ (_d = ch.responsive) == null ? void 0 : _d.absorb(options2);
25671
25542
  Defaults.handOverTypeDefaults(w.config, fromType, options2);
25543
+ Defaults.syncCatToNumeric(w.config, options2);
25544
+ Defaults.syncSparkline(w.config, wasSparkline, options2);
25545
+ Defaults.syncHorizontal(w.config, wasHorizontal, options2);
25672
25546
  if (overwriteInitialConfig) {
25673
25547
  if (options2.xaxis) w.globals.lastXAxis = Utils$1.clone(options2.xaxis);
25674
25548
  if (options2.yaxis) w.globals.lastYAxis = Utils$1.clone(options2.yaxis);
25675
25549
  const prevInitialSeries = w.globals.initialConfig && w.globals.initialConfig.series;
25676
25550
  const initialConfig = (
25677
25551
  /** @type {NonNullable<typeof w.globals.initialConfig>} */
25678
- Utils$1.extend({}, w.config)
25552
+ Utils$1.extend(
25553
+ {},
25554
+ ch.responsive ? ch.responsive.withoutBreakpoints(w.config) : w.config
25555
+ )
25679
25556
  );
25680
25557
  initialConfig.series = !options2.series && prevInitialSeries ? prevInitialSeries : Utils$1.copySeriesShallow(w.config.series);
25681
25558
  w.globals.initialConfig = initialConfig;
@@ -25737,15 +25614,7 @@ var __async = (__this, __arguments, generator) => {
25737
25614
  reconciledCollapses = true;
25738
25615
  }
25739
25616
  this.ctx.data.resetParsingFlags();
25740
- const parsedState = this.ctx.data.parseData(
25741
- newSeries,
25742
- overwriteInitialSeries
25743
- );
25744
- this.ctx._writeParsedSeriesData(parsedState.seriesData);
25745
- this.ctx._writeParsedRangeData(parsedState.rangeData);
25746
- this.ctx._writeParsedCandleData(parsedState.candleData);
25747
- this.ctx._writeParsedLabelData(parsedState.labelData);
25748
- this.ctx._writeParsedAxisFlags(parsedState.axisFlags);
25617
+ this.ctx.data.parseData(newSeries, overwriteInitialSeries);
25749
25618
  if (overwriteInitialSeries) {
25750
25619
  if (w.globals.initialConfig) {
25751
25620
  w.globals.initialConfig.series = Utils$1.copySeriesShallow(
@@ -25809,6 +25678,7 @@ var __async = (__this, __arguments, generator) => {
25809
25678
  if (w.globals.risingSeries.length > 0) return false;
25810
25679
  if (w.globals.comboCharts) return false;
25811
25680
  if (w.interact.zoomed) return false;
25681
+ if (w.config.chart.type === "radar") return false;
25812
25682
  const strip = (
25813
25683
  /** @type {any} */
25814
25684
  (_a = this.ctx.legend) == null ? void 0 : _a.heatmapGradientLegend
@@ -26435,25 +26305,6 @@ var __async = (__this, __arguments, generator) => {
26435
26305
  const ey = py - cy;
26436
26306
  return { dist: Math.sqrt(ex * ex + ey * ey), t: t2 };
26437
26307
  }
26438
- /**
26439
- * @param {number} val
26440
- * @param {any[]} arr
26441
- */
26442
- closestInArray(val, arr) {
26443
- const curr = arr[0];
26444
- let currIndex = null;
26445
- let diff = Math.abs(val - curr);
26446
- for (let i2 = 0; i2 < arr.length; i2++) {
26447
- const newdiff = Math.abs(val - arr[i2]);
26448
- if (newdiff < diff) {
26449
- diff = newdiff;
26450
- currIndex = i2;
26451
- }
26452
- }
26453
- return {
26454
- j: currIndex
26455
- };
26456
- }
26457
26308
  /**
26458
26309
  * When there are multiple series, it is possible to have different x values for each series.
26459
26310
  * But it may be possible in those multiple series, that there is same x value for 2 or more
@@ -26507,14 +26358,6 @@ var __async = (__this, __arguments, generator) => {
26507
26358
  }
26508
26359
  return sameLen;
26509
26360
  }
26510
- /**
26511
- * @param {any[]} allbars
26512
- */
26513
- getBarsHeight(allbars) {
26514
- const bars = [...allbars];
26515
- const totalHeight = bars.reduce((acc, bar) => acc + bar.getBBox().height, 0);
26516
- return totalHeight;
26517
- }
26518
26361
  /**
26519
26362
  * @param {number} capturedSeries
26520
26363
  */
@@ -27192,17 +27035,12 @@ var __async = (__this, __arguments, generator) => {
27192
27035
  * Along with this, this function also calls the xaxisMove function
27193
27036
  * @memberof Position
27194
27037
  * @param {number} cx - point's x position, wherever point's x is, you need to move crosshair
27195
- * @param {number | null} [j]
27196
27038
  */
27197
- moveXCrosshairs(cx, j2 = null) {
27039
+ moveXCrosshairs(cx) {
27198
27040
  const ttCtx = this.ttCtx;
27199
27041
  const w = this.w;
27200
27042
  const xcrosshairs = ttCtx.getElXCrosshairs();
27201
27043
  let x = cx - ttCtx.xcrosshairsWidth / 2;
27202
- const tickAmount = w.labelData.labels.slice().length;
27203
- if (j2 !== null) {
27204
- x = w.layout.gridWidth / tickAmount * j2;
27205
- }
27206
27044
  if (xcrosshairs !== null && !w.globals.isBarHorizontal) {
27207
27045
  xcrosshairs.setAttribute("x", String(x));
27208
27046
  xcrosshairs.setAttribute("x1", String(x));
@@ -27275,22 +27113,17 @@ var __async = (__this, __arguments, generator) => {
27275
27113
  * @param {number} index
27276
27114
  */
27277
27115
  moveYAxisTooltip(index) {
27278
- var _a, _b, _c;
27116
+ var _a, _b;
27279
27117
  const w = this.w;
27280
27118
  const ttCtx = this.ttCtx;
27281
- if (ttCtx.yaxisTTEls === null) {
27282
- ttCtx.yaxisTTEls = /** @type {any[]} */
27283
- [
27284
- ...w.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")
27285
- ];
27286
- }
27119
+ const el = ttCtx.getYaxisTTEls()[index];
27287
27120
  const ycrosshairsHiddenRectY1 = parseInt(
27288
27121
  (_b = (_a = ttCtx.ycrosshairsHidden) == null ? void 0 : _a.getAttribute("y1")) != null ? _b : "0",
27289
27122
  10
27290
27123
  );
27291
27124
  let cy = w.layout.translateY + ycrosshairsHiddenRectY1;
27292
- if ((_c = ttCtx.yaxisTTEls) == null ? void 0 : _c[index]) {
27293
- const yAxisTTRect = ttCtx.yaxisTTEls[index].getBoundingClientRect();
27125
+ if (el) {
27126
+ const yAxisTTRect = el.getBoundingClientRect();
27294
27127
  const yAxisTTHeight = yAxisTTRect.height;
27295
27128
  let cx;
27296
27129
  const labelsGroup = (
@@ -27313,11 +27146,11 @@ var __async = (__this, __arguments, generator) => {
27313
27146
  }
27314
27147
  cy = cy - yAxisTTHeight / 2;
27315
27148
  if (w.globals.ignoreYAxisIndexes.indexOf(index) === -1 && cy > 0 && cy < w.layout.gridHeight) {
27316
- ttCtx.yaxisTTEls[index].classList.add("apexcharts-active");
27317
- ttCtx.yaxisTTEls[index].style.top = cy + "px";
27318
- ttCtx.yaxisTTEls[index].style.left = cx + w.config.yaxis[index].tooltip.offsetX + "px";
27149
+ el.classList.add("apexcharts-active");
27150
+ el.style.top = cy + "px";
27151
+ el.style.left = cx + w.config.yaxis[index].tooltip.offsetX + "px";
27319
27152
  } else {
27320
- ttCtx.yaxisTTEls[index].classList.remove("apexcharts-active");
27153
+ el.classList.remove("apexcharts-active");
27321
27154
  }
27322
27155
  }
27323
27156
  }
@@ -28158,7 +27991,7 @@ var __async = (__this, __arguments, generator) => {
28158
27991
  cy = y;
28159
27992
  }
28160
27993
  this.tooltipPosition.moveXCrosshairs(cx);
28161
- if (!this.fixedTooltip) {
27994
+ if (!this.ttCtx.fixedTooltip) {
28162
27995
  if (w.config.chart.type === "radar") {
28163
27996
  const elGrid = this.ttCtx.getElGrid();
28164
27997
  if (!elGrid) return;
@@ -29156,16 +28989,11 @@ var __async = (__this, __arguments, generator) => {
29156
28989
  const cx = parseInt(opt.paths.getAttribute("cx"), 10);
29157
28990
  const cy = parseInt(opt.paths.getAttribute("cy"), 10);
29158
28991
  j2 = parseInt(opt.paths.getAttribute("rel"), 10);
29159
- i2 = parseInt(
28992
+ const el = Utils$1.findAncestor(opt.paths, "apexcharts-series");
28993
+ i2 = el ? parseInt(el.getAttribute("data:realIndex"), 10) : parseInt(
29160
28994
  opt.paths.parentNode.parentNode.parentNode.getAttribute("rel"),
29161
28995
  10
29162
28996
  ) - 1;
29163
- if (ttCtx.intersect) {
29164
- const el = Utils$1.findAncestor(opt.paths, "apexcharts-series");
29165
- if (el) {
29166
- i2 = parseInt(el.getAttribute("data:realIndex"), 10);
29167
- }
29168
- }
29169
28997
  ttCtx.tooltipLabels.drawSeriesTexts({
29170
28998
  ttItems: opt.ttItems,
29171
28999
  i: i2,
@@ -29329,11 +29157,6 @@ var __async = (__this, __arguments, generator) => {
29329
29157
  const elGrid = ttCtx.getElGrid();
29330
29158
  if (!elGrid) return;
29331
29159
  }
29332
- if (ttCtx.tooltip === null) {
29333
- ttCtx.tooltip = w.dom.baseEl.querySelector(
29334
- ".apexcharts-tooltip:not(.apexcharts-annotation-tooltip)"
29335
- );
29336
- }
29337
29160
  if (!w.config.tooltip.shared) {
29338
29161
  const crosshairX = !w.globals.isBarHorizontal && barXY.barAnchorXInGrid !== null ? barXY.barAnchorXInGrid / Utils.plotRect(w).zoom : bx;
29339
29162
  ttCtx.tooltipPosition.moveXCrosshairs(crosshairX);
@@ -29832,6 +29655,7 @@ var __async = (__this, __arguments, generator) => {
29832
29655
  const w = this.w;
29833
29656
  const ttCtx = this.ttCtx;
29834
29657
  for (let i2 = 0; i2 < w.config.yaxis.length; i2++) {
29658
+ if (!ttCtx.yaxisTooltips[i2]) continue;
29835
29659
  const isRight = w.config.yaxis[i2].opposite || w.config.yaxis[i2].crosshairs.opposite;
29836
29660
  ttCtx.yaxisOffX = isRight ? w.layout.gridWidth + 1 : 1;
29837
29661
  const tooltipCssClass = isRight ? `apexcharts-yaxistooltip apexcharts-yaxistooltip-${i2} apexcharts-yaxistooltip-right` : `apexcharts-yaxistooltip apexcharts-yaxistooltip-${i2} apexcharts-yaxistooltip-left`;
@@ -29849,8 +29673,7 @@ var __async = (__this, __arguments, generator) => {
29849
29673
  tooltipCssClass + " apexcharts-theme-" + w.config.tooltip.theme
29850
29674
  );
29851
29675
  renderTo.appendChild(ttCtx.yaxisTooltip);
29852
- if (i2 === 0) ttCtx.yaxisTooltipText = [];
29853
- ttCtx.yaxisTooltipText[i2] = BrowserAPIs.createElementNS("http://www.w3.org/1999/xhtml", "div");
29676
+ (ttCtx.yaxisTooltipText || (ttCtx.yaxisTooltipText = []))[i2] = BrowserAPIs.createElementNS("http://www.w3.org/1999/xhtml", "div");
29854
29677
  ttCtx.yaxisTooltipText[i2].classList.add(
29855
29678
  "apexcharts-yaxistooltip-text"
29856
29679
  );
@@ -29959,7 +29782,6 @@ var __async = (__this, __arguments, generator) => {
29959
29782
  this.xcrosshairsWidth = 0;
29960
29783
  this.ycrosshairs = null;
29961
29784
  this.ycrosshairsHidden = null;
29962
- this.tooltip = null;
29963
29785
  this.e = null;
29964
29786
  this.isBarShared = !w.globals.isBarHorizontal && this.tConfig.shared;
29965
29787
  this.lastHoverTime = Date.now();
@@ -29983,7 +29805,6 @@ var __async = (__this, __arguments, generator) => {
29983
29805
  this.offMarkHideTimeout = void 0;
29984
29806
  this.clientX = 0;
29985
29807
  this.clientY = 0;
29986
- this.barSeriesHeight = 0;
29987
29808
  this.tooltipRect = { x: 0, y: 0, ttWidth: 0, ttHeight: 0 };
29988
29809
  }
29989
29810
  /**
@@ -30111,6 +29932,17 @@ var __async = (__this, __arguments, generator) => {
30111
29932
  ".apexcharts-xcrosshairs"
30112
29933
  );
30113
29934
  }
29935
+ /**
29936
+ * The y-axis tooltip nodes by axis index, null for an axis drawn without
29937
+ * one. Cached until the next full render (drawTooltip clears it).
29938
+ * @returns {(HTMLElement | null)[]}
29939
+ */
29940
+ getYaxisTTEls() {
29941
+ const w = this.w;
29942
+ return this.yaxisTTEls || (this.yaxisTTEls = w.config.yaxis.map(
29943
+ (_, i2) => w.dom.baseEl.querySelector(`.apexcharts-yaxistooltip-${i2}`)
29944
+ ));
29945
+ }
30114
29946
  getElGrid() {
30115
29947
  return this._resolveEl(this, "_elGridCache", ".apexcharts-grid");
30116
29948
  }
@@ -31186,15 +31018,9 @@ var __async = (__this, __arguments, generator) => {
31186
31018
  (_a = this.xaxisTooltip) == null ? void 0 : _a.classList.remove("apexcharts-active");
31187
31019
  }
31188
31020
  if (this.yaxisTooltips && this.yaxisTooltips.length) {
31189
- if (this.yaxisTTEls === null) {
31190
- this.yaxisTTEls = /** @type {HTMLElement[]} */
31191
- [
31192
- ...w.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")
31193
- ];
31194
- }
31195
- for (let i2 = 0; i2 < this.yaxisTTEls.length; i2++) {
31196
- this.yaxisTTEls[i2].classList.remove("apexcharts-active");
31197
- }
31021
+ this.getYaxisTTEls().forEach(
31022
+ (el) => el == null ? void 0 : el.classList.remove("apexcharts-active")
31023
+ );
31198
31024
  }
31199
31025
  if (w.config.legend.tooltipHoverFormatter) {
31200
31026
  this.applyLegendHoverText(-1, 0, false);
@@ -31290,19 +31116,10 @@ var __async = (__this, __arguments, generator) => {
31290
31116
  } else if (this.tooltipUtil.hasBars()) {
31291
31117
  if (canvasMode) {
31292
31118
  ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
31293
- }
31294
- this.barSeriesHeight = this.tooltipUtil.getBarsHeight(
31295
- /** @type {any[]} */
31296
- [...bars]
31297
- );
31298
- if (this.barSeriesHeight > 0) {
31119
+ } else if ([...bars].some((b) => b.querySelector("path"))) {
31299
31120
  const graphics = new Graphics(this.w, this.ctx);
31300
31121
  const paths = w.dom.Paper.find(`.apexcharts-bar-area[j='${j2}']`);
31301
31122
  this.deactivateHoverFilter();
31302
- const points = ttCtx.tooltipUtil.getAllMarkers(true);
31303
- if (points.length && !this.barSeriesHeight) {
31304
- handlePoints();
31305
- }
31306
31123
  ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
31307
31124
  for (let b = 0; b < paths.length; b++) {
31308
31125
  graphics.pathMouseEnter(
@@ -32615,7 +32432,6 @@ var __async = (__this, __arguments, generator) => {
32615
32432
  this.ctx.coreUtils = new CoreUtils(this.w);
32616
32433
  this.ctx.crosshairs = new Crosshairs(this.w);
32617
32434
  this.ctx.events = new Events(this.w, this.ctx);
32618
- this.ctx.fill = new Fill(this.w);
32619
32435
  this.ctx.localization = new Localization(this.w);
32620
32436
  this.ctx.options = new Options();
32621
32437
  this.ctx.responsive = new Responsive(this.w);
@@ -32746,14 +32562,15 @@ var __async = (__this, __arguments, generator) => {
32746
32562
  * @param {{ isUpdating: boolean }} opts
32747
32563
  */
32748
32564
  clear({ isUpdating }) {
32749
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
32565
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
32750
32566
  (_a = this.ctx.weave) == null ? void 0 : _a.teardown(isUpdating);
32751
32567
  const gl = this.w.globals;
32752
32568
  if (!isUpdating) {
32753
32569
  gl.isDestroyed = true;
32754
32570
  clearTimeout((_b = gl.resizeTimer) != null ? _b : void 0);
32571
+ clearTimeout((_c = gl.radialTickTimer) != null ? _c : void 0);
32755
32572
  }
32756
- clearTimeout((_c = gl.selectionResizeTimer) != null ? _c : void 0);
32573
+ clearTimeout((_d = gl.selectionResizeTimer) != null ? _d : void 0);
32757
32574
  if (this.ctx._zoomPanSelection) {
32758
32575
  this.ctx._zoomPanSelection.destroy();
32759
32576
  }
@@ -32768,31 +32585,31 @@ var __async = (__this, __arguments, generator) => {
32768
32585
  if (isUpdating) {
32769
32586
  this.ctx._zoomPanSelection = null;
32770
32587
  this.ctx._toolbar = null;
32771
- (_d = this.ctx._keyboardNavigation) == null ? void 0 : _d.destroy();
32588
+ (_e = this.ctx._keyboardNavigation) == null ? void 0 : _e.destroy();
32772
32589
  this.ctx._keyboardNavigation = null;
32773
32590
  } else {
32774
- (_e = this.ctx.perspectives) == null ? void 0 : _e.teardown();
32591
+ (_f = this.ctx.perspectives) == null ? void 0 : _f.teardown();
32775
32592
  this.ctx.perspectives = null;
32776
- (_f = this.ctx.storyboard) == null ? void 0 : _f.teardown();
32593
+ (_g = this.ctx.storyboard) == null ? void 0 : _g.teardown();
32777
32594
  this.ctx.storyboard = null;
32778
- (_g = this.ctx.history) == null ? void 0 : _g.teardown();
32595
+ (_h = this.ctx.history) == null ? void 0 : _h.teardown();
32779
32596
  this.ctx.history = null;
32780
- (_h = this.ctx.linkedViews) == null ? void 0 : _h.teardown();
32597
+ (_i = this.ctx.linkedViews) == null ? void 0 : _i.teardown();
32781
32598
  this.ctx.linkedViews = null;
32782
- (_i = this.ctx.trellis) == null ? void 0 : _i.teardown();
32599
+ (_j = this.ctx.trellis) == null ? void 0 : _j.teardown();
32783
32600
  this.ctx.trellis = null;
32784
- (_j = this.ctx.ink) == null ? void 0 : _j.teardown();
32601
+ (_k = this.ctx.ink) == null ? void 0 : _k.teardown();
32785
32602
  this.ctx.ink = null;
32786
- (_k = this.ctx.measure) == null ? void 0 : _k.teardown();
32603
+ (_l = this.ctx.measure) == null ? void 0 : _l.teardown();
32787
32604
  this.ctx.measure = null;
32788
- (_l = this.ctx._highlightFilter) == null ? void 0 : _l.teardown();
32605
+ (_m = this.ctx._highlightFilter) == null ? void 0 : _m.teardown();
32789
32606
  this.ctx._highlightFilter = null;
32790
- (_m = this.ctx.contextMenu) == null ? void 0 : _m.teardown();
32607
+ (_n = this.ctx.contextMenu) == null ? void 0 : _n.teardown();
32791
32608
  this.ctx.contextMenu = null;
32792
- (_n = this.ctx.osThemeWatcher) == null ? void 0 : _n.teardown();
32609
+ (_o = this.ctx.osThemeWatcher) == null ? void 0 : _o.teardown();
32793
32610
  this.ctx.osThemeWatcher = null;
32794
32611
  this.ctx.weave = null;
32795
- (_p = (_o = this.ctx.rendererController) == null ? void 0 : _o.teardown) == null ? void 0 : _p.call(_o);
32612
+ (_q = (_p = this.ctx.rendererController) == null ? void 0 : _p.teardown) == null ? void 0 : _q.call(_p);
32796
32613
  this.ctx.rendererController = null;
32797
32614
  this.ctx.renderer = null;
32798
32615
  this.ctx.drilldown = null;
@@ -32801,7 +32618,7 @@ var __async = (__this, __arguments, generator) => {
32801
32618
  this.ctx.animations = null;
32802
32619
  this.ctx.axes = null;
32803
32620
  this.ctx.annotations = null;
32804
- (_q = this.ctx.core) == null ? void 0 : _q.unhookBrush();
32621
+ (_r = this.ctx.core) == null ? void 0 : _r.unhookBrush();
32805
32622
  this.ctx.core = null;
32806
32623
  this.ctx.data = null;
32807
32624
  this.ctx.grid = null;
@@ -33334,12 +33151,15 @@ var __async = (__this, __arguments, generator) => {
33334
33151
  }
33335
33152
  function addWatermark(ctx, elWrap) {
33336
33153
  reinstateWatermark(ctx, elWrap);
33337
- if (typeof MutationObserver === "undefined" || ctx._wmWrapObserver) return;
33154
+ if (typeof MutationObserver === "undefined") return;
33155
+ if (ctx._wmWrapObserver && ctx._wmObservedWrap === elWrap) return;
33156
+ if (ctx._wmWrapObserver) ctx._wmWrapObserver.disconnect();
33338
33157
  const wrapObs = new MutationObserver(() => {
33339
33158
  if (!C.node(elWrap)) reinstateWatermark(ctx, elWrap);
33340
33159
  });
33341
33160
  wrapObs.observe(elWrap, { childList: true });
33342
33161
  ctx._wmWrapObserver = wrapObs;
33162
+ ctx._wmObservedWrap = elWrap;
33343
33163
  }
33344
33164
  function teardownWatermark(ctx, elWrap) {
33345
33165
  if (ctx._wmWrapObserver) {
@@ -33351,6 +33171,7 @@ var __async = (__this, __arguments, generator) => {
33351
33171
  ctx._wmNodeObserver = null;
33352
33172
  }
33353
33173
  ctx._wmObservedNode = null;
33174
+ ctx._wmObservedWrap = null;
33354
33175
  const wrap = elWrap || ctx.w && ctx.w.dom && ctx.w.dom.elWrap;
33355
33176
  if (wrap) C.remove(wrap, { manage: false });
33356
33177
  }
@@ -33455,7 +33276,7 @@ var __async = (__this, __arguments, generator) => {
33455
33276
  );
33456
33277
  return Utils$1.clone(payload, seen);
33457
33278
  }
33458
- const _ApexCharts = class _ApexCharts {
33279
+ class ApexCharts {
33459
33280
  /**
33460
33281
  * Creates a new ApexCharts instance.
33461
33282
  *
@@ -33592,6 +33413,17 @@ var __async = (__this, __arguments, generator) => {
33592
33413
  this.afterPrintHandler = this._afterPrint.bind(this);
33593
33414
  }
33594
33415
  }
33416
+ /**
33417
+ * Static Perspectives helpers (decode/fromURL), registered by the
33418
+ * perspectives feature when imported
33419
+ * (`import 'apexcharts/features/perspectives'`); null otherwise. Read from
33420
+ * the globalThis-backed registry so core stays free of the Perspectives
33421
+ * module and every copy of the class sees them.
33422
+ * @returns {any}
33423
+ */
33424
+ static get perspectives() {
33425
+ return InitCtxVariables._featureRegistry.get("perspectivesStatics") || null;
33426
+ }
33595
33427
  /**
33596
33428
  * Renders the chart. Must be called once after construction.
33597
33429
  *
@@ -33808,10 +33640,6 @@ var __async = (__this, __arguments, generator) => {
33808
33640
  defaults.convertCatToNumericXaxis(w.config);
33809
33641
  }
33810
33642
  this.core.setupElements();
33811
- if (w.config.chart.type === "treemap") {
33812
- w.config.grid.show = false;
33813
- w.config.yaxis[0].show = false;
33814
- }
33815
33643
  if (gl.svgWidth === 0) {
33816
33644
  gl.animationEnded = true;
33817
33645
  return null;
@@ -33836,12 +33664,7 @@ var __async = (__this, __arguments, generator) => {
33836
33664
  if (Environment.isBrowser()) {
33837
33665
  this.events.setupEventHandlers();
33838
33666
  }
33839
- const parsedState = this.data.parseData(series, overwriteInitialSeries);
33840
- this._writeParsedSeriesData(parsedState.seriesData);
33841
- this._writeParsedRangeData(parsedState.rangeData);
33842
- this._writeParsedCandleData(parsedState.candleData);
33843
- this._writeParsedLabelData(parsedState.labelData);
33844
- this._writeParsedAxisFlags(parsedState.axisFlags);
33667
+ this.data.parseData(series, overwriteInitialSeries);
33845
33668
  if (overwriteInitialSeries && hiddenAtInit.length) {
33846
33669
  const baseline = (
33847
33670
  /** @type {any[]} */
@@ -33875,10 +33698,6 @@ var __async = (__this, __arguments, generator) => {
33875
33698
  if (w.config.xaxis.type !== "category") {
33876
33699
  this.formatters.setLabelFormatters();
33877
33700
  }
33878
- if (this.ctx.toolbar) {
33879
- this.ctx.toolbar.minX = w.globals.minX;
33880
- this.ctx.toolbar.maxX = w.globals.maxX;
33881
- }
33882
33701
  }
33883
33702
  this.formatters.heatmapLabelFormatters();
33884
33703
  const coreUtils = new CoreUtils(this.w);
@@ -33990,6 +33809,7 @@ var __async = (__this, __arguments, generator) => {
33990
33809
  }
33991
33810
  AxesUtils.pruneRedundantLabelTitles(w.dom.baseEl);
33992
33811
  (_g = me.annotations) == null ? void 0 : _g.drawAxesAnnotations();
33812
+ let tools;
33993
33813
  if (!w.globals.noData) {
33994
33814
  if (Environment.isBrowser() && w.config.tooltip.enabled && !w.globals.noData) {
33995
33815
  (_h = me.w.globals.tooltip) == null ? void 0 : _h.drawTooltip(graphData.xyRatios);
@@ -34006,17 +33826,14 @@ var __async = (__this, __arguments, generator) => {
34006
33826
  });
34007
33827
  }
34008
33828
  } else {
34009
- const tools = w.config.chart.toolbar.tools;
34010
- const toolsArr = [
34011
- "zoom",
34012
- "zoomin",
34013
- "zoomout",
34014
- "selection",
34015
- "pan",
34016
- "reset"
34017
- ];
34018
- toolsArr.forEach((t2) => {
34019
- tools[t2] = false;
33829
+ tools = w.config.chart.toolbar.tools;
33830
+ w.config.chart.toolbar.tools = __spreadProps(__spreadValues({}, tools), {
33831
+ zoom: false,
33832
+ zoomin: false,
33833
+ zoomout: false,
33834
+ selection: false,
33835
+ pan: false,
33836
+ reset: false
34020
33837
  });
34021
33838
  }
34022
33839
  if (w.config.chart.toolbar.show && !w.globals.allSeriesCollapsed) {
@@ -34024,6 +33841,7 @@ var __async = (__this, __arguments, generator) => {
34024
33841
  } else if (!w.globals.allSeriesCollapsed && ((_l = me.toolbar) == null ? void 0 : _l.resetControlDue())) {
34025
33842
  me.toolbar.createToolbar({ resetOnly: true });
34026
33843
  }
33844
+ if (tools) w.config.chart.toolbar.tools = tools;
34027
33845
  }
34028
33846
  (_m = me.weave) == null ? void 0 : _m.dispatch("draw", {
34029
33847
  pass: "full",
@@ -34113,7 +33931,7 @@ var __async = (__this, __arguments, generator) => {
34113
33931
  if (Utils$1.shallowEqual(this.lastUpdateOptions, options2)) {
34114
33932
  return Promise.resolve(this);
34115
33933
  }
34116
- if (options2.series && this.lastUpdateOptions.series && !_ApexCharts._optionsTooBigToCompare(options2)) {
33934
+ if (options2.series && this.lastUpdateOptions.series && !ApexCharts._optionsTooBigToCompare(options2)) {
34117
33935
  if (Utils$1.stringifyForCompare(this.lastUpdateOptions.series) === Utils$1.stringifyForCompare(options2.series)) {
34118
33936
  const optionsWithoutSeries = __spreadValues({}, options2);
34119
33937
  const lastWithoutSeries = __spreadValues({}, this.lastUpdateOptions);
@@ -34222,6 +34040,17 @@ var __async = (__this, __arguments, generator) => {
34222
34040
  const me = this;
34223
34041
  const gl = me.w.globals;
34224
34042
  if (!me.core) return Promise.resolve(me);
34043
+ const t2 = me.trellis;
34044
+ if (t2 && (t2._mounted || t2._rendering)) {
34045
+ return me.updateSeries(
34046
+ me.w.config.series.map(
34047
+ (s2, i2) => newData[i2] ? __spreadProps(__spreadValues({}, s2), { data: s2.data.concat(
34048
+ /** @type {any} */
34049
+ newData[i2].data
34050
+ ) }) : s2
34051
+ )
34052
+ );
34053
+ }
34225
34054
  me.data.resetParsingFlags();
34226
34055
  me.w.globals.dataChanged = true;
34227
34056
  me.w.globals.shouldAnimate = true;
@@ -34262,6 +34091,7 @@ var __async = (__this, __arguments, generator) => {
34262
34091
  }
34263
34092
  }
34264
34093
  trimStreamingSeries(newSeries, me.w);
34094
+ if (reducerRaw) trimStreamingSeries(reducerRaw, me.w);
34265
34095
  me.w.config.series = newSeries;
34266
34096
  return this.update(void 0, overwriteInitialSeries);
34267
34097
  }
@@ -34290,12 +34120,19 @@ var __async = (__this, __arguments, generator) => {
34290
34120
  * runs is the one that captures the new baseline.
34291
34121
  */
34292
34122
  update(options2, overwriteInitialSeries = false) {
34123
+ const t2 = this.trellis;
34124
+ if (t2 && (t2._mounted || t2._rendering)) {
34125
+ return t2.whenSettled().then(() => {
34126
+ t2.teardown();
34127
+ return this.render();
34128
+ });
34129
+ }
34293
34130
  return new Promise((resolve, reject) => {
34294
34131
  var _a;
34295
- if (options2 && this.lastUpdateOptions && !_ApexCharts._optionsTooBigToCompare(options2) && Utils$1.stringifyForCompare(this.lastUpdateOptions) === Utils$1.stringifyForCompare(options2)) {
34132
+ if (options2 && this.lastUpdateOptions && !ApexCharts._optionsTooBigToCompare(options2) && Utils$1.stringifyForCompare(this.lastUpdateOptions) === Utils$1.stringifyForCompare(options2)) {
34296
34133
  return resolve(this);
34297
34134
  }
34298
- this.lastUpdateOptions = options2 && !_ApexCharts._optionsTooBigToCompare(options2) ? Utils$1.clone(options2) : null;
34135
+ this.lastUpdateOptions = options2 && !ApexCharts._optionsTooBigToCompare(options2) ? Utils$1.clone(options2) : null;
34299
34136
  (_a = this.morphTypeChange) == null ? void 0 : _a.retire();
34300
34137
  new Destroy(this.ctx).clear({ isUpdating: true });
34301
34138
  const graphData = this.create(
@@ -34489,34 +34326,7 @@ var __async = (__this, __arguments, generator) => {
34489
34326
  gl.dataChanged = true;
34490
34327
  gl.animationEnded = false;
34491
34328
  PerformanceCache.invalidateSelectors(w);
34492
- const gl2 = w.globals;
34493
- gl2.maxY = -Number.MAX_VALUE;
34494
- gl2.minY = Number.MIN_VALUE;
34495
- gl2.minYArr = [];
34496
- gl2.maxYArr = [];
34497
- gl2.maxX = -Number.MAX_VALUE;
34498
- gl2.minX = Number.MAX_VALUE;
34499
- gl2.initialMaxX = -Number.MAX_VALUE;
34500
- gl2.initialMinX = Number.MAX_VALUE;
34501
- gl2.yAxisScale = [];
34502
- gl2.xAxisScale = null;
34503
- gl2.xAxisTicksPositions = [];
34504
- gl2.xRange = 0;
34505
- gl2.yRange = [];
34506
- gl2.zRange = 0;
34507
- gl2.xTickAmount = 0;
34508
- gl2.multiAxisTickAmount = 0;
34509
- gl2.pointsArray = [];
34510
- gl2.barCanvasCoords = null;
34511
- gl2.dataLabelsRects = [];
34512
- gl2.lastDrawnDataLabelsIndexes = [];
34513
- gl2.textRectsCache = /* @__PURE__ */ new Map();
34514
- gl2.domCache = /* @__PURE__ */ new Map();
34515
- gl2.cachedSelectors = {};
34516
- gl2.disableZoomIn = false;
34517
- gl2.disableZoomOut = false;
34518
- gl2.fadeRevealEls = [];
34519
- gl2.morphBatch = { pending: 0, onDone: null, series: /* @__PURE__ */ new Map() };
34329
+ this.series.hasAllSeriesEqualX();
34520
34330
  if (gl.axisCharts) {
34521
34331
  this.core.coreCalculations();
34522
34332
  if (w.config.xaxis.type !== "category") {
@@ -34689,7 +34499,7 @@ var __async = (__this, __arguments, generator) => {
34689
34499
  warnMissingFeature("ApexCharts.trellis()", "trellis");
34690
34500
  return null;
34691
34501
  }
34692
- const chart = new _ApexCharts(el, options2);
34502
+ const chart = new ApexCharts(el, options2);
34693
34503
  chart.render();
34694
34504
  return chart;
34695
34505
  }
@@ -34702,7 +34512,7 @@ var __async = (__this, __arguments, generator) => {
34702
34512
  BrowserAPIs.querySelectorAll("[data-apexcharts]").forEach(
34703
34513
  (el) => {
34704
34514
  try {
34705
- new _ApexCharts(el, JSON.parse(el.getAttribute("data-options"))).render();
34515
+ new ApexCharts(el, JSON.parse(el.getAttribute("data-options"))).render();
34706
34516
  } catch (e2) {
34707
34517
  console.warn("ApexCharts.initOnLoad():", e2);
34708
34518
  }
@@ -34793,7 +34603,7 @@ var __async = (__this, __arguments, generator) => {
34793
34603
  static setLicense(key) {
34794
34604
  o.setLicense(key);
34795
34605
  reevaluateLicenseAcrossCharts();
34796
- return _ApexCharts;
34606
+ return ApexCharts;
34797
34607
  }
34798
34608
  /**
34799
34609
  * Register a Weave plugin definition (a plain { name, setup } object).
@@ -34806,7 +34616,7 @@ var __async = (__this, __arguments, generator) => {
34806
34616
  */
34807
34617
  static registerPlugin(def) {
34808
34618
  registerPlugin(def);
34809
- return _ApexCharts;
34619
+ return ApexCharts;
34810
34620
  }
34811
34621
  /**
34812
34622
  * Remove a registered Weave plugin definition. Charts already holding an
@@ -34818,7 +34628,7 @@ var __async = (__this, __arguments, generator) => {
34818
34628
  */
34819
34629
  static unregisterPlugin(name2) {
34820
34630
  unregisterPlugin(name2);
34821
- return _ApexCharts;
34631
+ return ApexCharts;
34822
34632
  }
34823
34633
  /**
34824
34634
  * Register a non-SVG series renderer (Strata #2). SVG is built in; the canvas
@@ -34845,29 +34655,29 @@ var __async = (__this, __arguments, generator) => {
34845
34655
  static registerSeriesType(name2, def) {
34846
34656
  const factory = (
34847
34657
  /** @type {any} */
34848
- _ApexCharts._customSeriesFactory
34658
+ ApexCharts._customSeriesFactory
34849
34659
  );
34850
34660
  if (!factory) {
34851
34661
  console.warn(
34852
34662
  `[apexcharts] registerSeriesType("${name2}") requires the Marks feature: import 'apexcharts/features/marks'.`
34853
34663
  );
34854
- return _ApexCharts;
34664
+ return ApexCharts;
34855
34665
  }
34856
34666
  if (!def || typeof def.renderItem !== "function") {
34857
34667
  console.warn(
34858
34668
  `[apexcharts] registerSeriesType("${name2}") needs a def with a renderItem() function.`
34859
34669
  );
34860
- return _ApexCharts;
34670
+ return ApexCharts;
34861
34671
  }
34862
34672
  if (hasChartClass(name2) && !isCustom(name2) || TYPE_ALIASES[name2] || BUILTIN_TYPES.includes(name2)) {
34863
34673
  console.warn(
34864
34674
  `[apexcharts] registerSeriesType("${name2}") would override the built-in "${name2}" chart type; pick another name.`
34865
34675
  );
34866
- return _ApexCharts;
34676
+ return ApexCharts;
34867
34677
  }
34868
34678
  register({ [name2]: factory(name2, def) });
34869
34679
  markCustom(name2);
34870
- return _ApexCharts;
34680
+ return ApexCharts;
34871
34681
  }
34872
34682
  /**
34873
34683
  * Remove a custom series type registered via registerSeriesType. Built-in
@@ -34877,7 +34687,7 @@ var __async = (__this, __arguments, generator) => {
34877
34687
  */
34878
34688
  static unregisterSeriesType(name2) {
34879
34689
  if (isCustom(name2)) unregister(name2);
34880
- return _ApexCharts;
34690
+ return ApexCharts;
34881
34691
  }
34882
34692
  /**
34883
34693
  * Facet (#13): register a named theme (palette + design tokens + mode)
@@ -34890,7 +34700,7 @@ var __async = (__this, __arguments, generator) => {
34890
34700
  */
34891
34701
  static registerTheme(name2, def) {
34892
34702
  registerTheme(name2, def);
34893
- return _ApexCharts;
34703
+ return ApexCharts;
34894
34704
  }
34895
34705
  /**
34896
34706
  * Remove a theme registered via registerTheme. Charts referencing it by
@@ -34901,7 +34711,7 @@ var __async = (__this, __arguments, generator) => {
34901
34711
  */
34902
34712
  static unregisterTheme(name2) {
34903
34713
  unregisterTheme(name2);
34904
- return _ApexCharts;
34714
+ return ApexCharts;
34905
34715
  }
34906
34716
  /**
34907
34717
  * Cadence (#6): register a named easing function referenceable via
@@ -34914,7 +34724,7 @@ var __async = (__this, __arguments, generator) => {
34914
34724
  */
34915
34725
  static registerEasing(name2, fn) {
34916
34726
  registerEasing(name2, fn);
34917
- return _ApexCharts;
34727
+ return ApexCharts;
34918
34728
  }
34919
34729
  /**
34920
34730
  * Register a named unit-chart layout, referenceable via
@@ -34937,7 +34747,7 @@ var __async = (__this, __arguments, generator) => {
34937
34747
  */
34938
34748
  static registerUnitLayout(name2, fn) {
34939
34749
  registerUnitLayout(name2, fn);
34940
- return _ApexCharts;
34750
+ return ApexCharts;
34941
34751
  }
34942
34752
  /**
34943
34753
  * Remove a layout registered via registerUnitLayout. Charts referencing it by
@@ -34947,7 +34757,7 @@ var __async = (__this, __arguments, generator) => {
34947
34757
  */
34948
34758
  static unregisterUnitLayout(name2) {
34949
34759
  unregisterUnitLayout(name2);
34950
- return _ApexCharts;
34760
+ return ApexCharts;
34951
34761
  }
34952
34762
  /**
34953
34763
  * Register a named unit-chart MARK (pictogram), referenceable via
@@ -34971,7 +34781,7 @@ var __async = (__this, __arguments, generator) => {
34971
34781
  */
34972
34782
  static registerUnitMark(name2, def) {
34973
34783
  registerUnitMark(name2, def);
34974
- return _ApexCharts;
34784
+ return ApexCharts;
34975
34785
  }
34976
34786
  /**
34977
34787
  * Remove a mark registered via registerUnitMark. Charts referencing it by
@@ -34982,7 +34792,7 @@ var __async = (__this, __arguments, generator) => {
34982
34792
  */
34983
34793
  static unregisterUnitMark(name2) {
34984
34794
  unregisterUnitMark(name2);
34985
- return _ApexCharts;
34795
+ return ApexCharts;
34986
34796
  }
34987
34797
  /**
34988
34798
  * Register a row source: given a chart's state, what rows is each of its
@@ -35003,7 +34813,7 @@ var __async = (__this, __arguments, generator) => {
35003
34813
  */
35004
34814
  static registerRowSource(name2, fn) {
35005
34815
  registerRowSource(name2, fn);
35006
- return _ApexCharts;
34816
+ return ApexCharts;
35007
34817
  }
35008
34818
  /**
35009
34819
  * Remove a row source registered via registerRowSource.
@@ -35012,7 +34822,7 @@ var __async = (__this, __arguments, generator) => {
35012
34822
  */
35013
34823
  static unregisterRowSource(name2) {
35014
34824
  unregisterRowSource(name2);
35015
- return _ApexCharts;
34825
+ return ApexCharts;
35016
34826
  }
35017
34827
  /**
35018
34828
  * The rows behind this chart's marks, as a unit-chart series.
@@ -35059,15 +34869,15 @@ var __async = (__this, __arguments, generator) => {
35059
34869
  if (!opts || typeof opts.id !== "string") {
35060
34870
  throw new Error("ApexCharts.crossfilter requires an { id } string.");
35061
34871
  }
35062
- const factory = (
34872
+ const engine = (
35063
34873
  /** @type {any} */
35064
- _ApexCharts._crossfilterFactory
34874
+ InitCtxVariables._featureRegistry.get("crossfilter")
35065
34875
  );
35066
- if (!factory) {
34876
+ if (!engine) {
35067
34877
  warnMissingFeature("ApexCharts.crossfilter()", "link");
35068
34878
  return null;
35069
34879
  }
35070
- const coordinator = factory(opts);
34880
+ const coordinator = engine.getOrCreate(opts);
35071
34881
  reevaluateLicenseAcrossCharts();
35072
34882
  return coordinator;
35073
34883
  }
@@ -35078,11 +34888,11 @@ var __async = (__this, __arguments, generator) => {
35078
34888
  * @returns {any}
35079
34889
  */
35080
34890
  static getCrossfilter(id) {
35081
- const get = (
34891
+ const engine = (
35082
34892
  /** @type {any} */
35083
- _ApexCharts._crossfilterGet
34893
+ InitCtxVariables._featureRegistry.get("crossfilter")
35084
34894
  );
35085
- return get ? get(id) : null;
34895
+ return engine ? engine.get(id) : null;
35086
34896
  }
35087
34897
  /**
35088
34898
  * Linked Views (#4): clear crossfilter dimming across this chart and every
@@ -35461,7 +35271,7 @@ var __async = (__this, __arguments, generator) => {
35461
35271
  "apexcharts: Exports feature is not registered. Import apexcharts/features/exports."
35462
35272
  );
35463
35273
  if (this.trellis && this.trellis._mounted) {
35464
- return this.trellis.exports.svgString();
35274
+ return this.trellis.exports.svgString(scale);
35465
35275
  }
35466
35276
  return this.ctx.exports.getSvgString(scale);
35467
35277
  }
@@ -35477,7 +35287,7 @@ var __async = (__this, __arguments, generator) => {
35477
35287
  "apexcharts: Exports feature is not registered. Import apexcharts/features/exports."
35478
35288
  );
35479
35289
  if (this.trellis && this.trellis._mounted) {
35480
- return this.trellis.exports.download("csv");
35290
+ return this.trellis.exports.download("csv", options2);
35481
35291
  }
35482
35292
  return this.ctx.exports.exportToCSV(options2);
35483
35293
  }
@@ -35580,59 +35390,19 @@ var __async = (__this, __arguments, generator) => {
35580
35390
  );
35581
35391
  return this.ctx.drilldown.clearCache(id);
35582
35392
  }
35583
- // ─── Slice write-back stubs ─────────────────────────────────────────────────
35584
35393
  /**
35585
- * Copy own DATA properties of a parse-state slice onto a live w.* slice.
35586
- * Never Object.assign here: several w.* fields (and, historically, snapshot
35587
- * fields) are lazy accessors, and [[Get]]-ing an accessor while copying
35588
- * forces its deferred computation (a deep initialSeries clone plus O(n)
35589
- * stacked-totals passes on every render/update) and can replace the live
35590
- * accessor with a materialized value for the life of the instance.
35591
- * @param {any} target
35592
- * @param {any} slice
35394
+ * Copy the own DATA properties of plotCoords()'s layout slice onto
35395
+ * w.layout. It is the only writer of `w.layout.gridPad`. Never
35396
+ * Object.assign here: [[Get]]-ing a lazy accessor while copying forces its
35397
+ * deferred computation and can replace the live accessor with a value.
35398
+ * @param {Partial<import('./types/internal').LayoutCoords>} slice
35593
35399
  */
35594
- static _writeDataProps(target, slice) {
35400
+ _writeLayoutCoords(slice) {
35595
35401
  for (const key of Object.keys(slice)) {
35596
35402
  const d = Object.getOwnPropertyDescriptor(slice, key);
35597
- if (d && "value" in d) target[key] = d.value;
35403
+ if (d && "value" in d) this.w.layout[key] = d.value;
35598
35404
  }
35599
35405
  }
35600
- /**
35601
- * @param {Partial<import('./types/internal').SeriesData>} slice
35602
- */
35603
- _writeParsedSeriesData(slice) {
35604
- _ApexCharts._writeDataProps(this.w.seriesData, slice);
35605
- }
35606
- /**
35607
- * @param {Partial<import('./types/internal').RangeData>} slice
35608
- */
35609
- _writeParsedRangeData(slice) {
35610
- _ApexCharts._writeDataProps(this.w.rangeData, slice);
35611
- }
35612
- /**
35613
- * @param {Partial<import('./types/internal').CandleData>} slice
35614
- */
35615
- _writeParsedCandleData(slice) {
35616
- _ApexCharts._writeDataProps(this.w.candleData, slice);
35617
- }
35618
- /**
35619
- * @param {Partial<import('./types/internal').LabelData>} slice
35620
- */
35621
- _writeParsedLabelData(slice) {
35622
- _ApexCharts._writeDataProps(this.w.labelData, slice);
35623
- }
35624
- /**
35625
- * @param {Partial<import('./types/internal').AxisFlags>} slice
35626
- */
35627
- _writeParsedAxisFlags(slice) {
35628
- _ApexCharts._writeDataProps(this.w.axisFlags, slice);
35629
- }
35630
- /**
35631
- * @param {Partial<import('./types/internal').LayoutCoords>} slice
35632
- */
35633
- _writeLayoutCoords(slice) {
35634
- _ApexCharts._writeDataProps(this.w.layout, slice);
35635
- }
35636
35406
  _parentResizeCallback() {
35637
35407
  if (!this.w.config.chart.redrawOnParentResize) return;
35638
35408
  if (!this.w.globals.animationEnded) {
@@ -35691,7 +35461,9 @@ var __async = (__this, __arguments, generator) => {
35691
35461
  if (this._printRestore || !this._printEnabled()) return;
35692
35462
  const w = this.w;
35693
35463
  const printWidth = (_b = (_a = w.config.chart.print) == null ? void 0 : _a.width) != null ? _b : 700;
35694
- this._printRestore = { width: w.config.chart.width };
35464
+ this._printRestore = {
35465
+ width: this.responsive.withoutBreakpoints(w.config).chart.width
35466
+ };
35695
35467
  if (typeof printWidth === "number" && printWidth > 0 && w.globals.svgWidth > printWidth) {
35696
35468
  this.updateHelpers._updateOptions(
35697
35469
  { chart: { width: printWidth } },
@@ -35777,16 +35549,7 @@ var __async = (__this, __arguments, generator) => {
35777
35549
  }
35778
35550
  redraw && this._windowResize();
35779
35551
  }
35780
- };
35781
- /**
35782
- * Static Perspectives helpers (decode/fromURL), populated by the perspectives
35783
- * feature when imported (`import 'apexcharts/features/perspectives'`); null
35784
- * otherwise. Declared here as a placeholder so core stays free of the
35785
- * Perspectives module while the assignment in the feature file type-checks.
35786
- * @type {any}
35787
- */
35788
- __publicField(_ApexCharts, "perspectives", null);
35789
- let ApexCharts = _ApexCharts;
35552
+ }
35790
35553
  const coreInternals = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35791
35554
  __proto__: null,
35792
35555
  __apex_Animations: Animations,