@svgrid/grid 3.0.2 → 3.0.4

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 (281) hide show
  1. package/README.md +2 -1
  2. package/dist/GridMenus.svelte +44 -2
  3. package/dist/SvChartMenu.svelte +69 -0
  4. package/dist/SvChartMenu.svelte.d.ts +11 -0
  5. package/dist/SvChartPanes.svelte +113 -0
  6. package/dist/SvChartPanes.svelte.d.ts +20 -0
  7. package/dist/SvGrid.controller.svelte.d.ts +110 -39
  8. package/dist/SvGrid.controller.svelte.js +655 -200
  9. package/dist/SvGrid.css +105 -2
  10. package/dist/SvGrid.svelte +386 -514
  11. package/dist/SvGrid.types.d.ts +210 -9
  12. package/dist/SvGridCellEditor.svelte +17 -0
  13. package/dist/SvGridChart.svelte +2257 -329
  14. package/dist/SvGridChart.svelte.d.ts +6 -106
  15. package/dist/SvGridChart.types.d.ts +338 -0
  16. package/dist/SvGridChart.types.js +1 -0
  17. package/dist/SvGridChartBuilder.svelte +323 -0
  18. package/dist/SvGridChartBuilder.svelte.d.ts +34 -0
  19. package/dist/SvGridChartPanel.svelte +221 -275
  20. package/dist/SvGridChartPickers.svelte +417 -0
  21. package/dist/SvGridChartPickers.svelte.d.ts +70 -0
  22. package/dist/SvGridChartView.svelte +13 -14
  23. package/dist/SvModal.svelte +7 -1
  24. package/dist/SvModal.svelte.d.ts +5 -0
  25. package/dist/ai.d.ts +40 -8
  26. package/dist/ai.js +135 -24
  27. package/dist/aria.d.ts +11 -0
  28. package/dist/build-api.js +108 -22
  29. package/dist/cdn/GridMenus-7kbpnnBW.js +635 -0
  30. package/dist/cdn/GridMenus-BL7ZgQvU.js +636 -0
  31. package/dist/cdn/SvChartMenu-Bl6PBbkT.js +58 -0
  32. package/dist/cdn/SvChartMenu-FBSMINA6.js +59 -0
  33. package/dist/cdn/{SvDateRangeInput-DMLKmGEc.js → SvDateRangeInput-BeU_TkbQ.js} +15 -14
  34. package/dist/cdn/{SvDateRangeInput-CaOuMs8O.js → SvDateRangeInput-yX8vzleW.js} +38 -37
  35. package/dist/cdn/{SvDateTimePicker-sonaH0oh.js → SvDateTimePicker-DQwt4UAs.js} +139 -180
  36. package/dist/cdn/SvDateTimePicker-vNU6bZ-q.js +775 -0
  37. package/dist/cdn/{SvGridCellEditor-CjEJMJKc.js → SvGridCellEditor-B1p-vCK5.js} +188 -178
  38. package/dist/cdn/{SvGridCellEditor-BWnTi2N7.js → SvGridCellEditor-D_0q4xAu.js} +98 -88
  39. package/dist/cdn/SvGridChart-C3EWAZaM.js +3574 -0
  40. package/dist/cdn/SvGridChart-DzLkSwCH.js +3572 -0
  41. package/dist/cdn/SvGridChartBuilder-BE2T1ykB.js +783 -0
  42. package/dist/cdn/SvGridChartBuilder-CfII62sZ.js +784 -0
  43. package/dist/cdn/SvGridChartPanel-CCX5_Wgd.js +675 -0
  44. package/dist/cdn/SvGridChartPanel-xf4sWVTo.js +699 -0
  45. package/dist/cdn/SvGridChartView-CfuXmY5I.js +48 -0
  46. package/dist/cdn/SvGridChartView-DYwabQWj.js +47 -0
  47. package/dist/cdn/SvMenuList-CLN8OuIK.js +452 -0
  48. package/dist/cdn/SvMenuList-DkGhNKjf.js +451 -0
  49. package/dist/cdn/SvModal-BAE-pjZX.js +396 -0
  50. package/dist/cdn/SvModal-CIZWCcad.js +397 -0
  51. package/dist/cdn/chart-Dz7SqMXH.js +4341 -0
  52. package/dist/cdn/chart-export-BXqueeWJ.js +135 -0
  53. package/dist/cdn/chart-export-pdf-DONFUnNY.js +110 -0
  54. package/dist/cdn/chart-panel-messages-CUbf2R4i.js +1052 -0
  55. package/dist/cdn/chart-panel-messages-CmNrMdsr.js +1053 -0
  56. package/dist/cdn/chart-summary-BJW_tg_X.js +138 -0
  57. package/dist/cdn/chart-trend-CaN9mDEV.js +50 -0
  58. package/dist/cdn/chart-validate-HcOVFAfJ.js +188 -0
  59. package/dist/cdn/{column-resize-DsfNXMom.js → column-resize-DpmOLfRp.js} +3 -3
  60. package/dist/cdn/{date-format-BnnHlqGw.js → date-format-CtquV-p3.js} +583 -603
  61. package/dist/cdn/{date-format-BNii4zeD.js → date-format-D6KFzU_W.js} +347 -367
  62. package/dist/cdn/dismissable-DAHetSNk.js +44 -0
  63. package/dist/cdn/editor-contract-LXgQJAgd.js +22 -0
  64. package/dist/cdn/focus-trap-BBOQYBma.js +65 -0
  65. package/dist/cdn/{row-resize-BRcimkUT.js → row-resize-niQCp040.js} +44 -36
  66. package/dist/cdn/{src-DNbz94Ct.js → src-BKhZ6eXd.js} +10227 -9787
  67. package/dist/cdn/{src-BJ2opd0j.js → src-V1uu8iE9.js} +6568 -6128
  68. package/dist/cdn/svgrid.js +26 -15
  69. package/dist/cdn/svgrid.svelte-external.js +26 -15
  70. package/dist/chart-axes.d.ts +53 -0
  71. package/dist/chart-axes.js +351 -0
  72. package/dist/chart-cartesian.d.ts +88 -0
  73. package/dist/chart-cartesian.js +1862 -0
  74. package/dist/chart-decimate.d.ts +51 -0
  75. package/dist/chart-decimate.js +199 -0
  76. package/dist/chart-export-pdf.d.ts +47 -0
  77. package/dist/chart-export-pdf.js +187 -0
  78. package/dist/chart-export.d.ts +2 -1
  79. package/dist/chart-export.js +18 -3
  80. package/dist/chart-financial.d.ts +91 -0
  81. package/dist/chart-financial.js +175 -0
  82. package/dist/chart-flow.d.ts +10 -0
  83. package/dist/chart-flow.js +298 -0
  84. package/dist/chart-format.d.ts +18 -0
  85. package/dist/chart-format.js +65 -0
  86. package/dist/chart-grid.d.ts +8 -0
  87. package/dist/chart-grid.js +190 -0
  88. package/dist/chart-hierarchy.d.ts +17 -0
  89. package/dist/chart-hierarchy.js +146 -0
  90. package/dist/chart-indicators.d.ts +115 -0
  91. package/dist/chart-indicators.js +389 -0
  92. package/dist/chart-messages.d.ts +95 -0
  93. package/dist/chart-messages.js +92 -0
  94. package/dist/chart-motion.d.ts +16 -0
  95. package/dist/chart-motion.js +141 -0
  96. package/dist/chart-panel-messages.d.ts +265 -0
  97. package/dist/chart-panel-messages.js +285 -0
  98. package/dist/chart-pivot.d.ts +87 -0
  99. package/dist/chart-pivot.js +156 -0
  100. package/dist/chart-polar.d.ts +25 -0
  101. package/dist/chart-polar.js +700 -0
  102. package/dist/chart-samples.d.ts +16 -0
  103. package/dist/chart-samples.js +153 -0
  104. package/dist/chart-scale.d.ts +113 -0
  105. package/dist/chart-scale.js +405 -0
  106. package/dist/chart-stats.d.ts +111 -0
  107. package/dist/chart-stats.js +419 -0
  108. package/dist/chart-stream.d.ts +45 -0
  109. package/dist/chart-stream.js +91 -0
  110. package/dist/chart-summary.d.ts +27 -0
  111. package/dist/chart-summary.js +205 -0
  112. package/dist/chart-sync.svelte.d.ts +32 -0
  113. package/dist/chart-sync.svelte.js +23 -0
  114. package/dist/chart-table.d.ts +35 -0
  115. package/dist/chart-table.js +165 -0
  116. package/dist/chart-trend.d.ts +19 -0
  117. package/dist/chart-trend.js +61 -0
  118. package/dist/chart-types.d.ts +1456 -0
  119. package/dist/chart-types.js +6 -0
  120. package/dist/chart-validate.d.ts +43 -0
  121. package/dist/chart-validate.js +272 -0
  122. package/dist/chart-zoom.d.ts +40 -0
  123. package/dist/chart-zoom.js +145 -0
  124. package/dist/chart.d.ts +186 -865
  125. package/dist/chart.js +460 -2204
  126. package/dist/clipboard.d.ts +1 -0
  127. package/dist/clipboard.js +137 -18
  128. package/dist/column-resize.d.ts +3 -0
  129. package/dist/column-resize.js +4 -1
  130. package/dist/columns.js +3 -0
  131. package/dist/command-context.d.ts +19 -0
  132. package/dist/command-context.js +116 -0
  133. package/dist/core.d.ts +7 -0
  134. package/dist/createPopoverSelect.svelte.d.ts +2 -2
  135. package/dist/editing.d.ts +2 -8
  136. package/dist/editing.js +262 -33
  137. package/dist/fill-patterns.d.ts +0 -5
  138. package/dist/fill-patterns.js +56 -2
  139. package/dist/grid-messages.d.ts +10 -3
  140. package/dist/grid-messages.js +5 -0
  141. package/dist/history.d.ts +83 -0
  142. package/dist/history.js +133 -0
  143. package/dist/index.d.ts +24 -6
  144. package/dist/index.js +20 -2
  145. package/dist/keyboard-handlers.js +88 -31
  146. package/dist/keyboard.d.ts +55 -0
  147. package/dist/keyboard.js +132 -0
  148. package/dist/menus.d.ts +3 -1
  149. package/dist/menus.js +7 -2
  150. package/dist/merges.d.ts +97 -0
  151. package/dist/merges.js +147 -0
  152. package/dist/row-resize.d.ts +3 -0
  153. package/dist/row-resize.js +14 -0
  154. package/dist/scroll-sync.d.ts +1 -0
  155. package/dist/scroll-sync.js +24 -0
  156. package/dist/selection.d.ts +16 -0
  157. package/dist/selection.js +108 -16
  158. package/dist/shortcut-registry.d.ts +145 -0
  159. package/dist/shortcut-registry.js +44 -0
  160. package/dist/svgrid-wrapper.types.d.ts +213 -22
  161. package/dist/virtualization/virtualizer.js +38 -17
  162. package/package.json +6 -1
  163. package/src/GridMenus.svelte +44 -2
  164. package/src/SvChartMenu.svelte +69 -0
  165. package/src/SvChartPanes.svelte +113 -0
  166. package/src/SvChartPanes.test.ts +66 -0
  167. package/src/SvGrid.controller.svelte.ts +629 -172
  168. package/src/SvGrid.css +105 -2
  169. package/src/SvGrid.svelte +386 -514
  170. package/src/SvGrid.types.ts +188 -8
  171. package/src/SvGridCellEditor.svelte +17 -0
  172. package/src/SvGridChart.svelte +2257 -329
  173. package/src/SvGridChart.test.ts +1419 -1
  174. package/src/SvGridChart.types.ts +336 -0
  175. package/src/SvGridChartBuilder.svelte +323 -0
  176. package/src/SvGridChartPanel.svelte +221 -275
  177. package/src/SvGridChartPickers.svelte +417 -0
  178. package/src/SvGridChartView.svelte +13 -14
  179. package/src/SvModal.svelte +7 -1
  180. package/src/SvModal.test.ts +9 -0
  181. package/src/ai.test.ts +57 -2
  182. package/src/ai.ts +166 -22
  183. package/src/aria.d.ts +11 -0
  184. package/src/build-api.coverage.test.ts +184 -0
  185. package/src/build-api.ts +107 -18
  186. package/src/chart-axes.test.ts +573 -0
  187. package/src/chart-axes.ts +342 -0
  188. package/src/chart-cartesian.ts +1863 -0
  189. package/src/chart-decimate.test.ts +249 -0
  190. package/src/chart-decimate.ts +186 -0
  191. package/src/chart-export-pdf.test.ts +91 -0
  192. package/src/chart-export-pdf.ts +207 -0
  193. package/src/chart-export.test.ts +14 -0
  194. package/src/chart-export.ts +13 -3
  195. package/src/chart-financial.ts +208 -0
  196. package/src/chart-flow.ts +286 -0
  197. package/src/chart-format.ts +67 -0
  198. package/src/chart-grid.ts +179 -0
  199. package/src/chart-hierarchy.ts +135 -0
  200. package/src/chart-indicators.test.ts +443 -0
  201. package/src/chart-indicators.ts +384 -0
  202. package/src/chart-messages.test.ts +21 -0
  203. package/src/chart-messages.ts +184 -0
  204. package/src/chart-motion.test.ts +71 -0
  205. package/src/chart-motion.ts +148 -0
  206. package/src/chart-panel-messages.test.ts +29 -0
  207. package/src/chart-panel-messages.ts +550 -0
  208. package/src/chart-pivot.test.ts +54 -0
  209. package/src/chart-pivot.ts +225 -0
  210. package/src/chart-polar.ts +674 -0
  211. package/src/chart-samples.ts +106 -0
  212. package/src/chart-scale.ts +394 -0
  213. package/src/chart-series-types.test.ts +714 -0
  214. package/src/chart-stats.ts +409 -0
  215. package/src/chart-stream.test.ts +75 -0
  216. package/src/chart-stream.ts +114 -0
  217. package/src/chart-summary.test.ts +90 -0
  218. package/src/chart-summary.ts +197 -0
  219. package/src/chart-sync.svelte.ts +41 -0
  220. package/src/chart-table.test.ts +76 -0
  221. package/src/chart-table.ts +178 -0
  222. package/src/chart-trend.ts +47 -0
  223. package/src/chart-types.ts +1309 -0
  224. package/src/chart-validate.test.ts +100 -0
  225. package/src/chart-validate.ts +247 -0
  226. package/src/chart-zoom.test.ts +137 -0
  227. package/src/chart-zoom.ts +124 -0
  228. package/src/chart.coverage.test.ts +81 -0
  229. package/src/chart.test.ts +56 -3
  230. package/src/chart.ts +557 -2784
  231. package/src/clipboard.test.ts +151 -0
  232. package/src/clipboard.ts +145 -16
  233. package/src/column-resize.ts +7 -1
  234. package/src/columns.ts +2 -0
  235. package/src/command-context.test.ts +200 -0
  236. package/src/command-context.ts +137 -0
  237. package/src/core.ts +7 -0
  238. package/src/editing.test.ts +281 -3
  239. package/src/editing.ts +256 -38
  240. package/src/fill-patterns.test.ts +35 -0
  241. package/src/fill-patterns.ts +56 -2
  242. package/src/grid-messages.ts +16 -3
  243. package/src/history.test.ts +196 -0
  244. package/src/history.ts +162 -0
  245. package/src/icon-seam.test.ts +3 -2
  246. package/src/index.ts +150 -2
  247. package/src/keyboard-handlers.coverage.test.ts +126 -6
  248. package/src/keyboard-handlers.ts +91 -30
  249. package/src/keyboard-shortcuts.seam.test.ts +200 -0
  250. package/src/keyboard.test.ts +124 -1
  251. package/src/keyboard.ts +142 -0
  252. package/src/menus.test.ts +26 -0
  253. package/src/menus.ts +10 -3
  254. package/src/merges.test.ts +112 -0
  255. package/src/merges.ts +168 -0
  256. package/src/pivot.grid.test.ts +40 -5
  257. package/src/row-resize.test.ts +44 -0
  258. package/src/row-resize.ts +17 -0
  259. package/src/scroll-sync.test.ts +42 -1
  260. package/src/scroll-sync.ts +25 -0
  261. package/src/selection.multi-range.test.ts +34 -0
  262. package/src/selection.test.ts +30 -2
  263. package/src/selection.ts +111 -19
  264. package/src/shortcut-registry.test.ts +97 -0
  265. package/src/shortcut-registry.ts +181 -0
  266. package/src/svgrid-wrapper.types.ts +184 -13
  267. package/src/svgrid.behavior.test.ts +135 -0
  268. package/src/svgrid.charting.test.ts +513 -3
  269. package/src/svgrid.context-menu.test.ts +31 -0
  270. package/src/svgrid.new-features.wrapper.test.ts +10 -3
  271. package/src/virtualization/virtualizer.ts +39 -17
  272. package/dist/cdn/GridMenus-DyFA-QxA.js +0 -602
  273. package/dist/cdn/GridMenus-M2XP9t0_.js +0 -603
  274. package/dist/cdn/SvDateTimePicker-CCbDZNZB.js +0 -816
  275. package/dist/cdn/SvGridChart-DAb9RbRs.js +0 -1480
  276. package/dist/cdn/SvGridChart-Yl-IXZFO.js +0 -1481
  277. package/dist/cdn/SvGridChartPanel-DayQpDsR.js +0 -834
  278. package/dist/cdn/SvGridChartPanel-aqf8n-vJ.js +0 -810
  279. package/dist/cdn/SvGridChartView-CxfakxR0.js +0 -56
  280. package/dist/cdn/SvGridChartView-Dm_YEx9L.js +0 -55
  281. package/dist/cdn/chart-CKJRCPOk.js +0 -1652
@@ -0,0 +1,3574 @@
1
+ import { a as e } from "./editor-contract-LXgQJAgd.js";
2
+ import { i as t } from "./chart-trend-CaN9mDEV.js";
3
+ import { C as n, D as r, E as i, H as a, O as o, T as s, X as c, c as l, et as u, g as d, gt as f, ht as ee, i as te, mt as ne, o as re, r as ie, w as ae } from "./chart-Dz7SqMXH.js";
4
+ import { a as oe, t as se } from "./chart-export-BXqueeWJ.js";
5
+ import * as p from "svelte/internal/client";
6
+ import "svelte/internal/disclose-version";
7
+ import { tick as ce, untrack as le } from "svelte";
8
+ //#region src/chart-zoom.ts
9
+ function m(e, t, n) {
10
+ if (n <= 0) return null;
11
+ let r = Math.max(0, Math.min(n - 1, Math.round(e))), i = Math.max(0, Math.min(n - 1, Math.round(t)));
12
+ return i < r && ([r, i] = [i, r]), r === 0 && i === n - 1 ? null : {
13
+ i0: r,
14
+ i1: i
15
+ };
16
+ }
17
+ function ue(e, t, n, r) {
18
+ if (t <= 2) return null;
19
+ let i = e ? e.i0 : 0, a = e ? e.i1 : t - 1, o = a - i + 1, s = Math.max(2, Math.min(t, Math.round(o * r)));
20
+ if (s === o) return e;
21
+ let c = o > 1 ? (Math.max(i, Math.min(a, n)) - i) / (o - 1) : .5, l = Math.round(n - c * (s - 1));
22
+ return l = Math.max(0, Math.min(t - s, l)), m(l, l + s - 1, t);
23
+ }
24
+ function de(e, t, n) {
25
+ if (!e || !n) return e;
26
+ let r = e.i1 - e.i0, i = e.i0 + Math.round(n);
27
+ return i = Math.max(0, Math.min(t - 1 - r, i)), m(i, i + r, t);
28
+ }
29
+ function fe(e, t, n, r) {
30
+ return !Number.isFinite(r) || r <= 0 ? e : ue(e, t, n, 1 / r);
31
+ }
32
+ function pe(e, t, n) {
33
+ let r = e.length;
34
+ if (!r) return null;
35
+ let i = e.map((e) => Date.parse(e)), a = [...i].reverse().find(Number.isFinite);
36
+ if (a == null) return null;
37
+ let o = n ?? a, s = 864e5, c, l = o;
38
+ if (typeof t == "object") {
39
+ if (t.from) c = Date.parse(t.from);
40
+ else if (t.days) c = o - t.days * s;
41
+ else return null;
42
+ t.to && (l = Date.parse(t.to));
43
+ } else switch (t) {
44
+ case "1W":
45
+ c = o - 7 * s;
46
+ break;
47
+ case "1M":
48
+ c = me(o, -1);
49
+ break;
50
+ case "3M":
51
+ c = me(o, -3);
52
+ break;
53
+ case "6M":
54
+ c = me(o, -6);
55
+ break;
56
+ case "1Y":
57
+ c = me(o, -12);
58
+ break;
59
+ case "YTD": {
60
+ let e = new Date(o);
61
+ c = Date.UTC(e.getUTCFullYear(), 0, 1);
62
+ break;
63
+ }
64
+ default: return null;
65
+ }
66
+ if (!Number.isFinite(c) || !Number.isFinite(l)) return null;
67
+ let u = -1, d = -1;
68
+ for (let e = 0; e < r; e += 1) {
69
+ let t = i[e];
70
+ Number.isFinite(t) && (t >= c && u < 0 && (u = e), t <= l && (d = e));
71
+ }
72
+ return u < 0 || d < 0 || d < u ? null : m(u, d, r);
73
+ }
74
+ function me(e, t) {
75
+ let n = new Date(e);
76
+ return Date.UTC(n.getUTCFullYear(), n.getUTCMonth() + t, n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes());
77
+ }
78
+ function he(e, t) {
79
+ let n = -1, r = Infinity;
80
+ for (let i = 0; i < e.length; i += 1) {
81
+ let a = Date.parse(e[i]);
82
+ if (!Number.isFinite(a)) continue;
83
+ let o = Math.abs(a - t);
84
+ o < r && (r = o, n = i);
85
+ }
86
+ return n;
87
+ }
88
+ //#endregion
89
+ //#region src/chart-sync.svelte.ts
90
+ var h = /* @__PURE__ */ new Map();
91
+ function ge(e) {
92
+ let t = h.get(e);
93
+ if (t) return t;
94
+ let n = p.proxy({
95
+ hover: null,
96
+ zoom: null
97
+ });
98
+ return h.set(e, n), n;
99
+ }
100
+ function _e(e, t) {
101
+ ge(e).hover = t;
102
+ }
103
+ function ve(e, t, n, r, i = null) {
104
+ ge(e).zoom = {
105
+ window: t,
106
+ count: n,
107
+ from: r,
108
+ labels: i
109
+ };
110
+ }
111
+ //#endregion
112
+ //#region src/chart-motion.ts
113
+ var g = (e, t, n) => e + (t - e) * n, _ = (e) => Math.round(e * 100) / 100;
114
+ function ye(e, t, n) {
115
+ return n >= 1 ? t : n <= 0 && e.type === t.type ? e : e.type === t.type ? {
116
+ ...t,
117
+ bars: be(e.bars, t.bars, n, t.plot.y + t.plot.h),
118
+ lines: xe(e.lines, t.lines, n),
119
+ candles: Ce(e.candles, t.candles, n),
120
+ slices: y(e.slices, t.slices, n),
121
+ arcs: Te(e.arcs, t.arcs, n),
122
+ yTicks: t.yTicks.map((t) => {
123
+ let r = e.yTicks.find((e) => e.value === t.value);
124
+ return r ? {
125
+ ...t,
126
+ y: _(g(r.y, t.y, n))
127
+ } : t;
128
+ })
129
+ } : t;
130
+ }
131
+ var v = (e) => `${e.series}\u0000${e.label}`;
132
+ function be(e, t, n, r) {
133
+ if (!e.length && !t.length) return t;
134
+ let i = new Map(e.map((e) => [v(e), e])), a = /* @__PURE__ */ new Set(), o = t.map((e) => {
135
+ let t = v(e);
136
+ a.add(t);
137
+ let o = i.get(t);
138
+ if (!o) {
139
+ let t = g(r, e.y, n);
140
+ return {
141
+ ...e,
142
+ y: _(t),
143
+ h: _(Math.max(0, g(0, e.h, n)))
144
+ };
145
+ }
146
+ return {
147
+ ...e,
148
+ x: _(g(o.x, e.x, n)),
149
+ y: _(g(o.y, e.y, n)),
150
+ w: _(g(o.w, e.w, n)),
151
+ h: _(g(o.h, e.h, n))
152
+ };
153
+ });
154
+ for (let t of e) a.has(v(t)) || o.push({
155
+ ...t,
156
+ y: _(g(t.y, r, n)),
157
+ h: _(Math.max(0, g(t.h, 0, n)))
158
+ });
159
+ return o;
160
+ }
161
+ function xe(e, t, n) {
162
+ if (!e.length) return t;
163
+ let r = new Map(e.map((e) => [e.label, e]));
164
+ return t.map((e) => {
165
+ let t = r.get(e.label);
166
+ if (!t || t.points.length !== e.points.length) return e;
167
+ let a = e.points.map((e, r) => {
168
+ let i = t.points[r];
169
+ return !e.defined || !i.defined ? e : {
170
+ ...e,
171
+ x: _(g(i.x, e.x, n)),
172
+ y: _(g(i.y, e.y, n))
173
+ };
174
+ });
175
+ return {
176
+ ...e,
177
+ points: a,
178
+ path: i(a, !!e.smooth, { step: e.step })
179
+ };
180
+ });
181
+ }
182
+ var Se = (e) => `${e.series}\u0000${e.label}`;
183
+ function Ce(e, t, n) {
184
+ if (!e.length) return t;
185
+ let r = new Map(e.map((e) => [Se(e), e]));
186
+ return t.map((e) => {
187
+ let t = r.get(Se(e));
188
+ if (!t) return e;
189
+ let i = g(t.yOpen, e.yOpen, n), a = g(t.yClose, e.yClose, n);
190
+ return {
191
+ ...e,
192
+ x: _(g(t.x, e.x, n)),
193
+ xCenter: _(g(t.xCenter, e.xCenter, n)),
194
+ yOpen: _(i),
195
+ yClose: _(a),
196
+ yHigh: _(g(t.yHigh, e.yHigh, n)),
197
+ yLow: _(g(t.yLow, e.yLow, n)),
198
+ bodyY: _(Math.min(i, a)),
199
+ bodyH: _(Math.max(1, Math.abs(a - i)))
200
+ };
201
+ });
202
+ }
203
+ function y(e, t, n) {
204
+ if (!e.length || t.some((e) => !e.arc)) return t;
205
+ let r = new Map(e.map((e) => [e.label, e]));
206
+ return t.map((e) => {
207
+ let t = r.get(e.label);
208
+ if (!t?.arc || !e.arc) return e;
209
+ let i = g(t.arc.a0, e.arc.a0, n), a = g(t.arc.a1, e.arc.a1, n), o = (i + a) / 2, c = (e.arc.r + e.arc.ir) / 2 || e.arc.r * .6;
210
+ return {
211
+ ...e,
212
+ path: s(e.arc.cx, e.arc.cy, e.arc.ir, e.arc.r, i, a),
213
+ cx: _(e.arc.cx + c * Math.cos(o)),
214
+ cy: _(e.arc.cy + c * Math.sin(o)),
215
+ arc: {
216
+ ...e.arc,
217
+ a0: i,
218
+ a1: a
219
+ }
220
+ };
221
+ });
222
+ }
223
+ var we = (e) => e.nodePath ? e.nodePath.join("/") : `${e.series}\u0000${e.label}`;
224
+ function Te(e, t, n) {
225
+ if (!e.length) return t;
226
+ let r = new Map(e.map((e) => [we(e), e]));
227
+ return t.map((e) => {
228
+ let t = r.get(we(e));
229
+ if (!t) return e;
230
+ let i = g(t.a0, e.a0, n), a = g(t.a1, e.a1, n), o = g(t.r0, e.r0, n), c = g(t.r1, e.r1, n), l = (i + a) / 2, u = (o + c) / 2;
231
+ return {
232
+ ...e,
233
+ a0: i,
234
+ a1: a,
235
+ r0: o,
236
+ r1: c,
237
+ path: s(e.cx, e.cy, o, c, i, a),
238
+ lx: _(e.cx + u * Math.cos(l)),
239
+ ly: _(e.cy + u * Math.sin(l))
240
+ };
241
+ });
242
+ }
243
+ //#endregion
244
+ //#region src/chart-messages.ts
245
+ var Ee = {
246
+ chartLabel: "{type} chart",
247
+ dataTable: "{type} chart data",
248
+ dataTableCapped: ", first {shown} of {total} rows",
249
+ noData: "No data",
250
+ noValue: "no value",
251
+ seriesAtCategory: "{series}: {value} at {category}",
252
+ densePoints: "{count} points, {from} to {to}. Arrow keys step through values.",
253
+ drillIn: ", drill in",
254
+ sankeyNode: "{label}: in {in}, out {out}",
255
+ total: "Total",
256
+ rSquared: "R² {value}",
257
+ describeChart: "Describe chart",
258
+ describeCopied: "Description copied",
259
+ drillPath: "Drilldown path",
260
+ drillRoot: "All",
261
+ dateRange: "Date range",
262
+ showLast: "Show the last {preset}",
263
+ pan: "Pan",
264
+ panTitle: "Drag the plot to pan the zoomed window",
265
+ resetZoom: "Reset zoom",
266
+ resetZoomTitle: "Reset zoom (or double-click the plot)",
267
+ annotate: "Annotate",
268
+ annotateOnTitle: "Click the plot to pin a note, or a marker to remove it",
269
+ annotateOffTitle: "Pin notes on the chart",
270
+ drawingTools: "Drawing tools",
271
+ draw: "Draw: {tool}",
272
+ toolTrend: "Trend",
273
+ toolRay: "Ray",
274
+ toolFib: "Fib",
275
+ toolRect: "Rect",
276
+ toolArrow: "Arrow",
277
+ toolText: "Text",
278
+ drawing: "{tool} drawing",
279
+ deleteDrawing: "Delete",
280
+ deleteDrawingTitle: "Remove the selected drawing (Delete)",
281
+ clearDrawings: "Clear",
282
+ clearDrawingsTitle: "Remove every drawing",
283
+ noteText: "Note text",
284
+ removeNote: "Remove note: {label}",
285
+ png: "PNG",
286
+ downloadPng: "Download PNG",
287
+ svg: "SVG",
288
+ downloadSvg: "Download SVG",
289
+ pdf: "PDF",
290
+ downloadPdf: "Download PDF",
291
+ downloadCsv: "Download CSV",
292
+ print: "Print",
293
+ printTitle: "Print the chart",
294
+ copy: "Copy",
295
+ copied: "✓ Copied",
296
+ copyTitle: "Copy chart as image",
297
+ copyAsImage: "Copy as image",
298
+ range: "Range",
299
+ series: "Series",
300
+ showSeries: "Show",
301
+ hideSeries: "Hide",
302
+ isolateHint: "double-click to isolate",
303
+ showMore: "+{n} more",
304
+ showLess: "Show less",
305
+ rangeBrush: "Range brush",
306
+ brushRange: "{from} to {to}"
307
+ };
308
+ function De(t) {
309
+ return e(Ee, t);
310
+ }
311
+ function b(e, t) {
312
+ return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e);
313
+ }
314
+ //#endregion
315
+ //#region src/SvGridChart.svelte
316
+ var Oe = p.from_html("<span class=\"sv-grid-chart-crumb is-current svelte-hyytey\" aria-current=\"page\"> </span>"), ke = p.from_html("<button type=\"button\" class=\"sv-grid-chart-tool sv-grid-chart-crumb svelte-hyytey\"> </button>"), Ae = p.from_html("<span class=\"sv-grid-chart-crumb-sep svelte-hyytey\" aria-hidden=\"true\">/</span> <!>", 1), je = p.from_html("<nav class=\"sv-grid-chart-crumbs svelte-hyytey\"><button type=\"button\" class=\"sv-grid-chart-tool sv-grid-chart-crumb svelte-hyytey\"> </button> <!></nav>"), Me = p.from_html("<button type=\"button\" class=\"sv-grid-chart-tool sv-grid-chart-preset svelte-hyytey\"> </button>"), Ne = p.from_html("<span class=\"sv-grid-chart-presets svelte-hyytey\" role=\"group\"></span>"), Pe = p.from_html("<button type=\"button\"><svg aria-hidden=\"true\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 9l-3 3 3 3\"></path><path d=\"M9 5l3-3 3 3\"></path><path d=\"M15 19l-3 3-3-3\"></path><path d=\"M19 9l3 3-3 3\"></path><path d=\"M2 12h20\"></path><path d=\"M12 2v20\"></path></svg> </button>"), Fe = p.from_html("<button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"><svg aria-hidden=\"true\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 7v6h6\"></path><path d=\"M21 17a9 9 0 0 0-15-6.7L3 13\"></path></svg> </button>"), Ie = p.from_html("<button type=\"button\"><svg aria-hidden=\"true\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v6\"></path><circle cx=\"12\" cy=\"11\" r=\"3\"></circle><path d=\"M12 14v8\"></path></svg> </button>"), Le = p.from_html("<button type=\"button\"> </button>"), Re = p.from_html("<button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button>", 1), ze = p.from_html("<span class=\"sv-grid-chart-drawtools svelte-hyytey\" role=\"group\"><!> <!></span>"), Be = p.from_html("<div class=\"sv-grid-chart-toolbar svelte-hyytey\" role=\"toolbar\"><!> <!> <!> <!> <!> <!> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button> <button type=\"button\" class=\"sv-grid-chart-tool svelte-hyytey\"> </button></div>"), Ve = p.from_html("<div class=\"sv-grid-chart-toolbar is-crumbs-only svelte-hyytey\" role=\"toolbar\"><!></div>"), He = p.from_svg("<clipPath><rect></rect></clipPath>"), Ue = p.from_svg("<linearGradient x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\"></stop><stop offset=\"1\"></stop></linearGradient>"), We = p.from_svg("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\"><rect width=\"6\" height=\"6\"></rect><rect width=\"3\" height=\"6\" fill=\"rgba(255,255,255,0.35)\"></rect></pattern>"), Ge = p.from_svg("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\"><rect width=\"6\" height=\"6\"></rect><path d=\"M0 0L6 6 M6 0L0 6\" stroke=\"rgba(255,255,255,0.45)\" stroke-width=\"1\"></path></pattern>"), Ke = p.from_svg("<pattern width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\"><rect width=\"6\" height=\"6\"></rect><circle cx=\"3\" cy=\"3\" r=\"1.2\" fill=\"rgba(255,255,255,0.55)\"></circle></pattern>"), qe = p.from_svg("<pattern width=\"8\" height=\"8\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(-45)\"><rect width=\"8\" height=\"8\"></rect><line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"8\" stroke=\"rgba(0,0,0,0.18)\" stroke-width=\"2\"></line></pattern>"), Je = p.from_svg("<defs><!><!><!></defs>"), Ye = p.from_svg("<text class=\"sv-grid-chart-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), Xe = p.from_svg("<text class=\"sv-grid-chart-subtitle svelte-hyytey\" text-anchor=\"middle\"> </text>"), Ze = p.from_svg("<text class=\"sv-grid-chart-caption svelte-hyytey\" text-anchor=\"start\"> </text>"), Qe = p.from_svg("<line class=\"sv-grid-chart-gridline svelte-hyytey\"></line>"), $e = p.from_svg("<!><text class=\"sv-grid-chart-axis is-x svelte-hyytey\" text-anchor=\"middle\"> </text>", 1), et = p.from_svg("<line class=\"sv-grid-chart-gridline svelte-hyytey\"></line>"), tt = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"end\"> </text>"), nt = p.from_svg("<text class=\"sv-grid-chart-axis-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), rt = p.from_svg("<text class=\"sv-grid-chart-axis-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), it = p.from_svg("<!><!><!><!><!>", 1), at = p.from_svg("<line></line>"), ot = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"end\"> </text>"), st = p.from_svg("<!><!>", 1), ct = p.from_svg("<line class=\"sv-grid-chart-gridline svelte-hyytey\"></line>"), lt = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\"> </text>"), ut = p.from_svg("<text class=\"sv-grid-chart-axis is-x svelte-hyytey\"> </text>"), dt = p.from_svg("<text class=\"sv-grid-chart-axis is-x svelte-hyytey\" text-anchor=\"middle\"> </text>"), ft = p.from_svg("<line class=\"sv-grid-chart-gridline svelte-hyytey\" opacity=\"0.5\"></line>"), pt = p.from_svg("<line class=\"sv-grid-chart-gridline svelte-hyytey\"></line><!><text class=\"sv-grid-chart-axis sv-grid-chart-group-label svelte-hyytey\" text-anchor=\"middle\"> </text>", 1), mt = p.from_svg("<text class=\"sv-grid-chart-axis-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), ht = p.from_svg("<text class=\"sv-grid-chart-axis-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), gt = p.from_svg("<text class=\"sv-grid-chart-axis-title svelte-hyytey\" text-anchor=\"middle\"> </text>"), _t = p.from_svg("<!><!><!><!><!><!><!><!>", 1), vt = p.from_svg("<text class=\"sv-grid-chart-reflabel svelte-hyytey\" text-anchor=\"end\"> </text>"), yt = p.from_svg("<text class=\"sv-grid-chart-reflabel svelte-hyytey\" text-anchor=\"middle\"> </text>"), bt = p.from_svg("<rect class=\"sv-grid-chart-refband svelte-hyytey\"></rect><!>", 1), xt = p.from_svg("<path class=\"sv-grid-chart-band svelte-hyytey\" fill-opacity=\"0.12\" stroke=\"none\"></path>"), St = p.from_svg("<path class=\"sv-grid-chart-area svelte-hyytey\" stroke=\"none\"></path>"), Ct = p.from_svg("<circle class=\"sv-grid-chart-dot is-active svelte-hyytey\" r=\"4\"></circle>"), wt = p.from_svg("<circle></circle>"), Tt = p.from_svg("<path fill=\"none\" stroke-width=\"1.5\"></path>"), Et = p.from_svg("<path></path>"), Dt = p.from_svg("<g class=\"svelte-hyytey\"><!><!><path class=\"sv-grid-chart-linepath svelte-hyytey\" fill=\"none\" stroke-linejoin=\"round\" stroke-linecap=\"round\"></path><!></g>"), Ot = p.from_svg("<rect rx=\"1\"></rect>"), kt = p.from_svg("<circle class=\"sv-grid-chart-dot svelte-hyytey\" fill-opacity=\"0.55\"></circle>"), At = p.from_svg("<g class=\"sv-grid-chart-stem svelte-hyytey\"><line class=\"svelte-hyytey\"></line><!><circle class=\"sv-grid-chart-dot svelte-hyytey\"></circle></g>"), jt = p.from_svg("<line class=\"sv-grid-chart-ohlc svelte-hyytey\"></line><line class=\"sv-grid-chart-ohlc svelte-hyytey\"></line><line class=\"sv-grid-chart-ohlc svelte-hyytey\"></line>", 1), Mt = p.from_svg("<line class=\"sv-grid-chart-wick svelte-hyytey\"></line><rect class=\"sv-grid-chart-candle svelte-hyytey\"></rect>", 1), Nt = p.from_svg("<circle class=\"sv-grid-chart-outlier svelte-hyytey\" r=\"2\" fill=\"none\"></circle>"), Pt = p.from_svg("<line class=\"sv-grid-chart-whisker svelte-hyytey\"></line><line class=\"sv-grid-chart-whisker svelte-hyytey\"></line><line class=\"sv-grid-chart-whisker svelte-hyytey\"></line><rect class=\"sv-grid-chart-box svelte-hyytey\" fill-opacity=\"0.25\"></rect><line class=\"sv-grid-chart-median svelte-hyytey\"></line><!>", 1), Ft = p.from_svg("<line class=\"sv-grid-chart-errorbar svelte-hyytey\"></line><line class=\"sv-grid-chart-errorbar svelte-hyytey\"></line><line class=\"sv-grid-chart-errorbar svelte-hyytey\"></line>", 1), It = p.from_svg("<circle fill-opacity=\"0.7\"></circle>"), Lt = p.from_svg("<g class=\"sv-grid-chart-refpill svelte-hyytey\"><rect height=\"16\" rx=\"3\" class=\"svelte-hyytey\"></rect><text text-anchor=\"middle\" fill=\"#fff\" class=\"svelte-hyytey\"> </text></g>"), Rt = p.from_svg("<text class=\"sv-grid-chart-reflabel svelte-hyytey\" text-anchor=\"end\"> </text>"), zt = p.from_svg("<line class=\"sv-grid-chart-refline svelte-hyytey\"></line><!>", 1), Bt = p.from_svg("<line class=\"sv-grid-chart-refline svelte-hyytey\"></line><text class=\"sv-grid-chart-reflabel svelte-hyytey\" text-anchor=\"start\"> </text>", 1), Vt = p.from_svg("<path class=\"sv-grid-chart-overlay-band svelte-hyytey\" fill-opacity=\"0.1\" stroke-opacity=\"0.35\" stroke-width=\"1\"></path>"), Ht = p.from_svg("<!><path class=\"sv-grid-chart-overlay svelte-hyytey\" fill=\"none\" stroke-width=\"2\" stroke-dasharray=\"6 4\" stroke-linejoin=\"round\" stroke-linecap=\"round\"></path>", 1), Ut = p.from_svg("<line class=\"sv-grid-chart-datalabel-leader svelte-hyytey\"></line>"), Wt = p.from_svg("<!><text> </text>", 1), Gt = p.from_svg("<text class=\"sv-grid-chart-serieslabel svelte-hyytey\" text-anchor=\"start\"> </text>"), Kt = p.from_svg("<line stroke-width=\"1.5\"></line><rect height=\"13\" rx=\"2\"></rect><text class=\"sv-grid-chart-annotation-flagtext svelte-hyytey\" text-anchor=\"middle\" fill=\"#fff\"> </text>", 1), qt = p.from_svg("<path stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1.2\"></path><text class=\"sv-grid-chart-annotation-flagtext svelte-hyytey\" text-anchor=\"middle\" fill=\"#fff\"> </text><text class=\"sv-grid-chart-annotation-label svelte-hyytey\"> </text>", 1), Jt = p.from_svg("<rect width=\"9\" height=\"9\" stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1.5\"></rect><text class=\"sv-grid-chart-annotation-label svelte-hyytey\"> </text>", 1), Yt = p.from_svg("<circle stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1.5\"></circle><text class=\"sv-grid-chart-annotation-label svelte-hyytey\"> </text>", 1), Xt = p.from_svg("<g><!></g>"), Zt = p.from_svg("<path class=\"svelte-hyytey\"></path>"), Qt = p.from_svg("<line class=\"sv-grid-chart-drawing-hit svelte-hyytey\"></line><line stroke-width=\"1.5\" class=\"svelte-hyytey\"></line><!>", 1), $t = p.from_svg("<rect fill-opacity=\"0.08\" stroke-width=\"1.2\" class=\"svelte-hyytey\"></rect>"), en = p.from_svg("<line class=\"sv-grid-chart-drawing-hit svelte-hyytey\"></line><line stroke-width=\"1.2\" stroke-dasharray=\"4 3\" class=\"svelte-hyytey\"></line><text class=\"sv-grid-chart-drawing-label svelte-hyytey\" text-anchor=\"end\"> </text>", 1), tn = p.from_svg("<line stroke-width=\"1\" class=\"svelte-hyytey\"></line><text class=\"sv-grid-chart-drawing-label svelte-hyytey\"> </text>", 1), nn = p.from_svg("<!><rect class=\"sv-grid-chart-drawing-hit svelte-hyytey\"></rect>", 1), rn = p.from_svg("<text class=\"sv-grid-chart-drawing-text svelte-hyytey\"> </text>"), an = p.from_svg("<circle class=\"sv-grid-chart-drawing-handle svelte-hyytey\" r=\"5\" fill=\"var(--sg-bg, #fff)\" stroke-width=\"1.5\"></circle>"), on = p.from_svg("<g><!><!></g>"), sn = p.from_svg("<rect fill=\"var(--sg-accent, #2563eb)\" fill-opacity=\"0.08\" stroke=\"var(--sg-accent, #2563eb)\" stroke-dasharray=\"4 3\"></rect>"), cn = p.from_svg("<line stroke=\"var(--sg-accent, #2563eb)\" stroke-width=\"1.5\" stroke-dasharray=\"4 3\"></line>"), ln = p.from_svg("<circle r=\"3.5\" fill=\"var(--sg-accent, #2563eb)\"></circle><!>", 1), un = p.from_svg("<g class=\"sv-grid-chart-drawings\"><!><!></g>"), dn = p.from_svg("<line class=\"sv-grid-chart-crosshair svelte-hyytey\"></line>"), fn = p.from_svg("<g class=\"sv-grid-chart-crosshair-label svelte-hyytey\" pointer-events=\"none\"><rect height=\"15\" rx=\"3\" class=\"svelte-hyytey\"></rect><text text-anchor=\"middle\" class=\"svelte-hyytey\"> </text></g>"), pn = p.from_svg("<g class=\"sv-grid-chart-crosshair-label svelte-hyytey\" pointer-events=\"none\"><rect height=\"15\" rx=\"3\" class=\"svelte-hyytey\"></rect><text text-anchor=\"middle\" class=\"svelte-hyytey\"> </text></g><!>", 1), mn = p.from_svg("<line class=\"sv-grid-chart-crosshair svelte-hyytey\"></line><!>", 1), hn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"end\"> </text>"), gn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"middle\"> </text>"), _n = p.from_svg("<text class=\"sv-grid-chart-heatlabel svelte-hyytey\" text-anchor=\"middle\"> </text>"), vn = p.from_svg("<rect class=\"sv-grid-chart-heatcell svelte-hyytey\"></rect><!>", 1), yn = p.from_svg("<stop></stop>"), bn = p.from_svg("<defs><linearGradient x1=\"0\" y1=\"1\" x2=\"0\" y2=\"0\"></linearGradient></defs><rect class=\"sv-grid-chart-heatlegend svelte-hyytey\" width=\"10\"></rect><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\"> </text><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\"> </text>", 1), xn = p.from_svg("<!><!><!><!>", 1), Sn = p.from_svg("<text class=\"sv-grid-chart-funnel-label svelte-hyytey\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-funnel-value svelte-hyytey\" text-anchor=\"middle\"> </text>", 1), Cn = p.from_svg("<path class=\"sv-grid-chart-funnel-seg svelte-hyytey\"></path><!>", 1), wn = p.from_svg("<circle class=\"sv-grid-chart-radar-ring svelte-hyytey\"></circle>"), Tn = p.from_svg("<line class=\"sv-grid-chart-radar-spoke svelte-hyytey\"></line><text class=\"sv-grid-chart-axis svelte-hyytey\"> </text>", 1), En = p.from_svg("<circle class=\"sv-grid-chart-radar-dot svelte-hyytey\" r=\"3\" role=\"img\"></circle>"), Dn = p.from_svg("<path class=\"sv-grid-chart-radar-poly svelte-hyytey\" fill-opacity=\"0.18\" stroke-width=\"2\"></path><!>", 1), On = p.from_svg("<!><!><!>", 1), kn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\"> </text>"), An = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"end\"> </text>"), jn = p.from_svg("<rect rx=\"2\" role=\"img\"></rect>"), Mn = p.from_svg("<rect class=\"sv-grid-chart-calendar-legend svelte-hyytey\" width=\"10\" height=\"10\" rx=\"2\"></rect><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\"> </text>", 1), Nn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\">Less</text><!><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"start\">More</text>", 1), Pn = p.from_svg("<!><!><!><!>", 1), Fn = p.from_svg("<line></line>"), In = p.from_svg("<path fill=\"none\" stroke-width=\"4\" stroke-linecap=\"butt\" opacity=\"0.7\"></path>"), Ln = p.from_svg("<line stroke=\"var(--sg-fg, #0f172a)\" stroke-width=\"2.5\" stroke-linecap=\"round\"></line>"), Rn = p.from_svg("<!><path fill=\"none\" stroke=\"var(--sg-border, #e2e8f0)\" stroke-width=\"16\" stroke-linecap=\"round\"></path><!><path fill=\"none\" stroke-width=\"16\" stroke-linecap=\"round\"></path><!><path class=\"sv-grid-chart-gauge-needle svelte-hyytey\"></path><circle class=\"sv-grid-chart-gauge-hub svelte-hyytey\"></circle><circle class=\"sv-grid-chart-gauge-hub-dot svelte-hyytey\" r=\"2.5\"></circle><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-axis svelte-hyytey\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-gauge-value svelte-hyytey\" text-anchor=\"middle\"> </text>", 1), zn = p.from_svg("<text class=\"sv-grid-chart-treemap-label svelte-hyytey\"> </text>"), Bn = p.from_svg("<text class=\"sv-grid-chart-treemap-value svelte-hyytey\" opacity=\"0.85\"> </text>"), Vn = p.from_svg("<rect class=\"sv-grid-chart-treemap-cell svelte-hyytey\"></rect><!><!>", 1), Hn = p.from_svg("<path class=\"sv-grid-chart-sankey-link svelte-hyytey\" fill=\"none\" stroke-opacity=\"0.35\" role=\"img\"></path>"), Un = p.from_svg("<rect class=\"sv-grid-chart-sankey-node svelte-hyytey\" role=\"img\"></rect><text class=\"sv-grid-chart-sankey-label svelte-hyytey\"> </text>", 1), Wn = p.from_svg("<!><!>", 1), Gn = p.from_svg("<circle class=\"sv-grid-chart-gridline svelte-hyytey\" fill=\"none\"></circle>"), Kn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\"> </text>"), qn = p.from_svg("<path class=\"sv-grid-chart-arc-track svelte-hyytey\"></path>"), Jn = p.from_svg("<path class=\"sv-grid-chart-ribbon svelte-hyytey\" fill-opacity=\"0.45\" stroke-opacity=\"0.6\"></path>"), Yn = p.from_svg("<path stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1\"></path>"), Xn = p.from_svg("<text class=\"sv-grid-chart-axis svelte-hyytey\"> </text>"), Zn = p.from_svg("<text class=\"sv-grid-chart-datalabel on-bar svelte-hyytey\" text-anchor=\"middle\" dominant-baseline=\"middle\" pointer-events=\"none\"> </text>"), Qn = p.from_svg("<!><!><!><!><!><!>", 1), $n = p.from_svg("<rect></rect>"), er = p.from_svg("<line class=\"sv-grid-chart-bullet-target\" stroke=\"var(--sg-fg, #0f172a)\" stroke-width=\"2.5\"></line>"), tr = p.from_svg("<g class=\"sv-grid-chart-bullet\"><!><rect class=\"sv-grid-chart-bar svelte-hyytey\"></rect><!></g>"), nr = p.from_svg("<polyline class=\"sv-grid-chart-callout svelte-hyytey\" fill=\"none\" stroke-width=\"1\"></polyline><text class=\"sv-grid-chart-callout-label svelte-hyytey\"> </text>", 1), rr = p.from_svg("<text class=\"sv-grid-chart-datalabel on-bar svelte-hyytey\" text-anchor=\"middle\" dominant-baseline=\"middle\"> </text>"), ir = p.from_svg("<path stroke=\"var(--sg-bg, #fff)\" stroke-width=\"1\"></path><!>", 1), ar = p.from_svg("<text class=\"sv-grid-chart-donut-total svelte-hyytey\" text-anchor=\"middle\"> </text><text class=\"sv-grid-chart-donut-label svelte-hyytey\" text-anchor=\"middle\"> </text>", 1), or = p.from_svg("<rect class=\"sv-grid-chart-cat-hit svelte-hyytey\" data-dense=\"true\"></rect>"), sr = p.from_svg("<rect class=\"sv-grid-chart-cat-hit svelte-hyytey\"></rect>"), cr = p.from_svg("<rect class=\"sv-grid-chart-zoom-rect svelte-hyytey\"></rect>"), lr = p.from_svg("<path fill-opacity=\"0.10\" stroke=\"none\"></path>"), ur = p.from_svg("<!><path fill=\"none\" stroke-width=\"1.2\" opacity=\"0.75\"></path>", 1), dr = p.from_svg("<rect opacity=\"0.55\"></rect>"), fr = p.from_html("<div class=\"sv-grid-chart-brush-host svelte-hyytey\"><svg class=\"sv-grid-chart-brush svelte-hyytey\" width=\"100%\" role=\"slider\" tabindex=\"0\" aria-orientation=\"horizontal\"><!><!><rect class=\"sv-grid-chart-brush-mask svelte-hyytey\"></rect><rect class=\"sv-grid-chart-brush-mask svelte-hyytey\"></rect><rect class=\"sv-grid-chart-brush-window svelte-hyytey\"></rect><rect class=\"sv-grid-chart-brush-handle svelte-hyytey\" width=\"8\"></rect><rect class=\"sv-grid-chart-brush-handle svelte-hyytey\" width=\"8\"></rect></svg></div>"), pr = p.from_html("<div class=\"sv-grid-chart-empty svelte-hyytey\"> </div>"), mr = p.from_html("<input class=\"sv-grid-chart-textdraft svelte-hyytey\" type=\"text\"/>"), hr = p.from_html("<span class=\"sv-grid-chart-tooltip-dot svelte-hyytey\"></span>"), gr = p.from_html("<span class=\"sv-grid-chart-tooltip-row-label svelte-hyytey\"> </span>"), _r = p.from_html("<span class=\"sv-grid-chart-tooltip-row svelte-hyytey\"><!> <!> <span class=\"sv-grid-chart-tooltip-row-value svelte-hyytey\"> </span></span>"), vr = p.from_html("<span class=\"sv-grid-chart-tooltip-title svelte-hyytey\"> </span> <!>", 1), yr = p.from_html("<div role=\"tooltip\"><!></div>"), br = p.from_html("<span class=\"sv-grid-chart-swatch svelte-hyytey\"></span> ", 1), xr = p.from_html("<button type=\"button\"><!></button>"), Sr = p.from_html("<button type=\"button\" class=\"sv-grid-chart-legend-more svelte-hyytey\"> </button>"), Cr = p.from_html("<div><!> <!></div>"), wr = p.from_html("<div class=\"sv-grid-chart-live sv-grid-chart-sr-only svelte-hyytey\" aria-live=\"polite\" aria-atomic=\"true\"> </div>"), Tr = p.from_html("<th> </th>"), Er = p.from_html("<td> </td>"), Dr = p.from_html("<tr></tr>"), Or = p.from_html("<div><!> <svg width=\"100%\"><!><!><!><!><!><!><g><!><!><!><!><!><!><!><!></g><!><!><g></g><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!><!></svg> <!> <!> <!> <!> <!> <!> <!> <div class=\"sv-grid-chart-sr-only svelte-hyytey\"><table><caption> <!><!></caption><thead><tr></tr></thead><tbody></tbody></table></div></div>"), kr = {
317
+ hash: "svelte-hyytey",
318
+ code: ".sv-grid-chart.svelte-hyytey {position:relative;display:flex;flex-direction:column;gap:8px;width:100%;background:var(--sg-chart-bg, transparent);}\n /* Legend on top: the legend row moves above the plot, the toolbar stays\n first. Left / right: a two-column grid, the legend a column of chips\n beside the plot and the brush, the toolbar spanning both. */.sv-grid-chart.is-legend-top.svelte-hyytey .sv-grid-chart-toolbar:where(.svelte-hyytey) {order:-2;}.sv-grid-chart.is-legend-top.svelte-hyytey .sv-grid-chart-legend:where(.svelte-hyytey) {order:-1;}.sv-grid-chart.is-legend-left.svelte-hyytey,\n .sv-grid-chart.is-legend-right.svelte-hyytey {display:grid;grid-template-rows:auto 1fr auto;align-items:start;}.sv-grid-chart.is-legend-left.svelte-hyytey {grid-template-columns:auto minmax(0, 1fr);grid-template-areas:'tb tb' 'lg svg' 'lg br';}.sv-grid-chart.is-legend-right.svelte-hyytey {grid-template-columns:minmax(0, 1fr) auto;grid-template-areas:'tb tb' 'svg lg' 'br lg';}.sv-grid-chart.is-legend-left.svelte-hyytey .sv-grid-chart-toolbar:where(.svelte-hyytey),\n .sv-grid-chart.is-legend-right.svelte-hyytey .sv-grid-chart-toolbar:where(.svelte-hyytey) {grid-area:tb;}.sv-grid-chart.is-legend-left.svelte-hyytey .sv-grid-chart-svg:where(.svelte-hyytey),\n .sv-grid-chart.is-legend-right.svelte-hyytey .sv-grid-chart-svg:where(.svelte-hyytey) {grid-area:svg;}.sv-grid-chart.is-legend-left.svelte-hyytey .sv-grid-chart-brush-host:where(.svelte-hyytey),\n .sv-grid-chart.is-legend-right.svelte-hyytey .sv-grid-chart-brush-host:where(.svelte-hyytey) {grid-area:br;}.sv-grid-chart-brush-host.svelte-hyytey {display:block;min-width:0;}.sv-grid-chart.is-legend-left.svelte-hyytey .sv-grid-chart-legend:where(.svelte-hyytey),\n .sv-grid-chart.is-legend-right.svelte-hyytey .sv-grid-chart-legend:where(.svelte-hyytey) {grid-area:lg;}.sv-grid-chart-legend.is-vertical.svelte-hyytey {flex-direction:column;align-items:flex-start;gap:4px;max-width:180px;padding-top:6px;}\n /* Autosize: the SVG is laid out at the pixel size the host actually has\n (see the dimension bindings in the script), so it needs no aspect-ratio\n scaling of its own. The host takes its height from a flex or grid parent\n that stretches it, never from a percentage: `height: 100%` inside a parent\n with other content over-measures by that content, the SVG grows into the\n gap, and the next measurement grows again, without end. */.sv-grid-chart.is-autosize.svelte-hyytey {min-height:0;}.sv-grid-chart.is-autosize.svelte-hyytey .sv-grid-chart-svg:where(.svelte-hyytey) {flex:none;min-height:0;}.sv-grid-chart-svg.svelte-hyytey {display:block;width:100%;height:auto;}.sv-grid-chart-title.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-size:calc(14px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;}.sv-grid-chart-subtitle.svelte-hyytey {fill:var(--sg-muted, #64748b);font-size:calc(11.5px * var(--sg-chart-font-scale, 1));font-family:inherit;}.sv-grid-chart-caption.svelte-hyytey {fill:var(--sg-muted, #64748b);font-size:calc(10px * var(--sg-chart-font-scale, 1));font-family:inherit;}.sv-grid-chart-refband.svelte-hyytey {pointer-events:none;}\n /* Enter effects. Fade is the per-mark keyframe every mark already has;\n wipe animates the plot clip's width from 0 (a keyframe with only `from`\n ends at the element's own value); grow scales bars up from their base. */.sv-grid-chart-wipe.svelte-hyytey {\n animation: svelte-hyytey-sv-grid-chart-wipe 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;}\n @keyframes svelte-hyytey-sv-grid-chart-wipe {\n from { width: 0; }\n }.sv-grid-chart-marks.is-enter-grow.svelte-hyytey .sv-grid-chart-bar:where(.svelte-hyytey) {transform-box:fill-box;transform-origin:50% 100%;\n animation: svelte-hyytey-sv-grid-chart-grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;}\n @keyframes svelte-hyytey-sv-grid-chart-grow {\n from { transform: scaleY(0.02); }\n }.sv-grid-chart-marks.is-enter-none.svelte-hyytey :where(.svelte-hyytey),\n .sv-grid-chart-marks.is-enter-none.svelte-hyytey {\n animation: none !important;}.sv-grid-chart-svg.is-pannable.svelte-hyytey {cursor:grab;}.sv-grid-chart-svg.is-pannable.svelte-hyytey:active {cursor:grabbing;}.sv-grid-chart-presets.svelte-hyytey {display:inline-flex;gap:2px;margin-right:6px;}.sv-grid-chart-crumbs.svelte-hyytey {display:inline-flex;align-items:center;gap:2px;margin-right:8px;font-size:calc(11.5px * var(--sg-chart-font-scale, 1));}.sv-grid-chart-crumb.is-current.svelte-hyytey {font-weight:600;color:var(--sg-fg, #0f172a);padding:0 4px;}.sv-grid-chart-crumb-sep.svelte-hyytey {color:var(--sg-muted, #64748b);}.sv-grid-chart-arc.is-drillable.svelte-hyytey,\n .sv-grid-chart-slice.is-drillable.svelte-hyytey {cursor:zoom-in;}.sv-grid-chart-bar.is-selected.svelte-hyytey,\n .sv-grid-chart-slice.is-selected.svelte-hyytey,\n .sv-grid-chart-arc.is-selected.svelte-hyytey {stroke:var(--sg-fg, #0f172a);stroke-width:2;}.sv-grid-chart-dot.is-selected.svelte-hyytey {stroke:var(--sg-fg, #0f172a);stroke-width:2;r:5;}.sv-grid-chart-scatter.is-selected.svelte-hyytey {stroke:var(--sg-fg, #0f172a);stroke-width:2;fill-opacity:1;}.sv-grid-chart-preset.svelte-hyytey {padding-inline:6px;}.sv-grid-chart-arc-track.svelte-hyytey {fill:var(--sg-border, #e2e8f0);opacity:0.45;pointer-events:none;}.sv-grid-chart-arc.svelte-hyytey {transition:opacity 0.1s ease;\n animation: svelte-hyytey-sv-grid-chart-in 0.3s ease both;}.sv-grid-chart-ribbon.svelte-hyytey {transition:opacity 0.1s ease;}.sv-grid-chart-stem.svelte-hyytey line:where(.svelte-hyytey) {stroke-linecap:round;}.sv-grid-chart-dot.is-stroked.svelte-hyytey {fill:none;}.sv-grid-chart-tooltip.is-custom.svelte-hyytey {padding:0;background:transparent;color:inherit;border:0;box-shadow:none;}.sv-grid-chart-gridline.svelte-hyytey {stroke:var(--sg-border, #e2e8f0);stroke-width:1;opacity:0.6;}.sv-grid-chart-gridline.is-zero.svelte-hyytey {stroke:var(--sg-muted, #94a3b8);opacity:0.9;}.sv-grid-chart-axis.svelte-hyytey {fill:var(--sg-muted, #64748b);font-size:calc(10px * var(--sg-chart-font-scale, 1));font-family:inherit;}.sv-grid-chart-axis-title.svelte-hyytey {fill:var(--sg-muted, #64748b);font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;}.sv-grid-chart-group-label.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-weight:600;}.sv-grid-chart-crosshair.svelte-hyytey {stroke:var(--sg-accent, #2563eb);stroke-width:1;stroke-dasharray:3 3;opacity:0.65;pointer-events:none;}.sv-grid-chart-callout.svelte-hyytey {opacity:0.8;pointer-events:none;}.sv-grid-chart-callout-label.svelte-hyytey {font-size:calc(10.5px * var(--sg-chart-font-scale, 1));font-family:inherit;fill:var(--sg-fg, #0f172a);pointer-events:none;}.sv-grid-chart-crosshair-label.svelte-hyytey rect:where(.svelte-hyytey) {fill:var(--sg-fg, #0f172a);opacity:0.85;}.sv-grid-chart-crosshair-label.svelte-hyytey text:where(.svelte-hyytey) {fill:var(--sg-bg, #fff);font-size:calc(9.5px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;}.sv-grid-chart-refline.svelte-hyytey {stroke-width:1.5;opacity:0.9;pointer-events:none;}.sv-grid-chart-reflabel.svelte-hyytey {font-size:calc(9.5px * var(--sg-chart-font-scale, 1));font-weight:700;font-family:inherit;pointer-events:none;}.sv-grid-chart-overlay.svelte-hyytey {opacity:0.85;pointer-events:none;}.sv-grid-chart-annotation-marker.svelte-hyytey {pointer-events:none;}.sv-grid-chart-annotation-marker.has-text.svelte-hyytey {pointer-events:auto;cursor:help;}.sv-grid-chart-annotation-marker.svelte-hyytey:focus-visible {outline:2px solid var(--sg-accent, #2563eb);outline-offset:2px;}.sv-grid-chart-annotation-label.svelte-hyytey {font-size:calc(10px * var(--sg-chart-font-scale, 1));font-weight:700;font-family:inherit;pointer-events:none;}.sv-grid-chart-serieslabel.svelte-hyytey {font-size:calc(10.5px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;pointer-events:none;}.sv-grid-chart-annotation-flagtext.svelte-hyytey {font-size:calc(9px * var(--sg-chart-font-scale, 1));font-weight:700;font-family:inherit;pointer-events:none;}.sv-grid-chart-refpill.svelte-hyytey text:where(.svelte-hyytey) {font-size:calc(9.5px * var(--sg-chart-font-scale, 1));font-weight:700;font-family:inherit;pointer-events:none;}\n /* Drawings. The hit line is a fat invisible stroke so a 1.5px trend line\n can be clicked; handles only exist on the selected drawing. */.sv-grid-chart-drawing-hit.svelte-hyytey {stroke:transparent;stroke-width:10;fill:transparent;pointer-events:stroke;}.sv-grid-chart-drawing.is-fib.svelte-hyytey .sv-grid-chart-drawing-hit:where(.svelte-hyytey),\n .sv-grid-chart-drawing.is-rect.svelte-hyytey rect:where(.svelte-hyytey),\n .sv-grid-chart-drawing.is-text.svelte-hyytey text:where(.svelte-hyytey) {pointer-events:all;}.sv-grid-chart-drawing[role='button'].svelte-hyytey {cursor:pointer;}.sv-grid-chart-drawing.svelte-hyytey:focus-visible {outline:none;}.sv-grid-chart-drawing.is-selected.svelte-hyytey line:where(.svelte-hyytey),\n .sv-grid-chart-drawing.is-selected.svelte-hyytey rect:where(.svelte-hyytey),\n .sv-grid-chart-drawing.svelte-hyytey:focus-visible line:where(.svelte-hyytey),\n .sv-grid-chart-drawing.svelte-hyytey:focus-visible rect:where(.svelte-hyytey) {filter:drop-shadow(0 0 2px var(--sg-accent, #2563eb));}.sv-grid-chart-drawing-label.svelte-hyytey {font-size:calc(9px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;pointer-events:none;}.sv-grid-chart-drawing-text.svelte-hyytey {font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;}.sv-grid-chart-drawing-handle.svelte-hyytey {cursor:move;}.sv-grid-chart-textdraft.svelte-hyytey {position:absolute;z-index:11;transform:translate(0, -50%);width:160px;font:inherit;font-size:calc(12px * var(--sg-chart-font-scale, 1));padding:3px 6px;border:1px solid var(--sg-accent, #2563eb);border-radius:4px;background:var(--sg-bg, #fff);color:var(--sg-fg, #0f172a);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);}.sv-grid-chart-svg.is-drawing.svelte-hyytey {cursor:crosshair;}.sv-grid-chart-drawtools.svelte-hyytey {display:inline-flex;gap:2px;padding-right:6px;margin-right:2px;border-right:1px solid var(--sg-border, #e2e8f0);}\n /* Heatmap cells. Stroke uses the border token (not bg) so the cell\n separators stay visible in BOTH light and dark themes - on dark mode\n a bg-colored stroke disappeared into the navy cells. */.sv-grid-chart-heatcell.svelte-hyytey {stroke:var(--sg-border, #cbd5e1);stroke-width:1;transition:opacity 100ms ease;cursor:default;}.sv-grid-chart-svg.is-clickable.svelte-hyytey .sv-grid-chart-heatcell:where(.svelte-hyytey) {cursor:pointer;}.sv-grid-chart-heatcell.svelte-hyytey:hover {opacity:0.85;}.sv-grid-chart-heatlabel.svelte-hyytey {font-size:calc(10px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;pointer-events:none;user-select:none;}\n /* Legend gradient bar gets a visible outline + axis labels next to it\n pull from the regular axis class so they follow the theme. */.sv-grid-chart-heatlegend.svelte-hyytey {stroke:var(--sg-border, #cbd5e1);stroke-width:1;}\n /* Funnel segments + labels. */.sv-grid-chart-funnel-seg.svelte-hyytey {stroke:var(--sg-bg, #ffffff);stroke-width:2;transition:opacity 100ms ease;cursor:default;}.sv-grid-chart-svg.is-clickable.svelte-hyytey .sv-grid-chart-funnel-seg:where(.svelte-hyytey) {cursor:pointer;}.sv-grid-chart-funnel-seg.svelte-hyytey:hover {opacity:0.88;}.sv-grid-chart-funnel-label.svelte-hyytey {font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:700;font-family:inherit;pointer-events:none;}.sv-grid-chart-funnel-value.svelte-hyytey {font-size:calc(10px * var(--sg-chart-font-scale, 1));font-family:inherit;opacity:0.85;pointer-events:none;}\n /* Radar grid + polygons. */.sv-grid-chart-radar-ring.svelte-hyytey {fill:none;stroke:var(--sg-border, #e2e8f0);stroke-width:1;opacity:0.6;}.sv-grid-chart-radar-spoke.svelte-hyytey {stroke:var(--sg-border, #e2e8f0);stroke-width:1;opacity:0.6;}.sv-grid-chart-radar-poly.svelte-hyytey {transition:opacity 100ms ease;pointer-events:none;}.sv-grid-chart-radar-dot.svelte-hyytey {transition:r 100ms ease;cursor:default;}.sv-grid-chart-radar-dot.svelte-hyytey:hover {r:4.5;}\n /* Calendar heatmap cells. Blank cells get a faint outline so the grid\n still reads on days with no data. */.sv-grid-chart-calendar-cell.svelte-hyytey {stroke:var(--sg-border, #e2e8f0);stroke-width:0.5;transition:opacity 100ms ease;cursor:default;}.sv-grid-chart-calendar-cell.is-blank.svelte-hyytey {stroke-opacity:0.5;}.sv-grid-chart-calendar-cell.svelte-hyytey:hover {opacity:0.85;}.sv-grid-chart-calendar-legend.svelte-hyytey {stroke:var(--sg-border, #cbd5e1);stroke-width:0.5;}\n /* Gauge centre readout. */.sv-grid-chart-gauge-value.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-size:calc(22px * var(--sg-chart-font-scale, 1));font-weight:800;font-family:inherit;pointer-events:none;}\n /* Gauge tick marks: faint minors, stronger majors. */.sv-grid-chart-gauge-tick.svelte-hyytey {stroke:var(--sg-muted, #94a3b8);stroke-width:1;opacity:0.4;}.sv-grid-chart-gauge-tick.is-major.svelte-hyytey {stroke-width:2;opacity:0.7;}\n /* Pointer needle + hub. */.sv-grid-chart-gauge-needle.svelte-hyytey {fill:var(--sg-fg, #0f172a);\n /* A hairline of the background colour around the needle keeps it legible\n where it crosses the value arc, which is the same weight and often a\n similar tone. */stroke:var(--sg-bg, #ffffff);stroke-width:0.75;stroke-linejoin:round;}.sv-grid-chart-gauge-hub.svelte-hyytey {fill:var(--sg-fg, #0f172a);stroke:var(--sg-bg, #ffffff);stroke-width:2;}.sv-grid-chart-gauge-hub-dot.svelte-hyytey {fill:var(--sg-bg, #ffffff);}\n /* Tree-map cells. White separators give the squarified rects breathing\n room without distracting from the data. */.sv-grid-chart-treemap-cell.svelte-hyytey {stroke:var(--sg-bg, #ffffff);stroke-width:1;transition:opacity 100ms ease;cursor:default;}.sv-grid-chart-svg.is-clickable.svelte-hyytey .sv-grid-chart-treemap-cell:where(.svelte-hyytey) {cursor:pointer;}.sv-grid-chart-treemap-cell.svelte-hyytey:hover {opacity:0.88;}.sv-grid-chart-treemap-label.svelte-hyytey {font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;pointer-events:none;}.sv-grid-chart-treemap-value.svelte-hyytey {font-size:calc(10px * var(--sg-chart-font-scale, 1));font-family:inherit;pointer-events:none;}\n /* Sankey nodes + links. Links use stroke not fill so per-ribbon width\n comes from stroke-width directly. */.sv-grid-chart-sankey-node.svelte-hyytey {transition:opacity 100ms ease;cursor:default;}.sv-grid-chart-sankey-node.svelte-hyytey:hover {opacity:0.88;}.sv-grid-chart-sankey-link.svelte-hyytey {transition:stroke-opacity 100ms ease;cursor:default;}.sv-grid-chart-sankey-link.svelte-hyytey:hover {stroke-opacity:0.6;}.sv-grid-chart-sankey-label.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:600;font-family:inherit;pointer-events:none;}\n /* Brush mini-map: a compact secondary chart with a draggable window. */.sv-grid-chart-brush.svelte-hyytey {display:block;width:100%;height:auto;margin-top:4px;border-top:1px solid var(--sg-border, #e2e8f0);user-select:none;touch-action:none;}.sv-grid-chart-brush-mask.svelte-hyytey {fill:var(--sg-bg, #ffffff);fill-opacity:0.65;pointer-events:none;}.sv-grid-chart-brush-window.svelte-hyytey {fill:var(--sg-accent, #2563eb);fill-opacity:0.10;stroke:var(--sg-accent, #2563eb);stroke-width:1;cursor:grab;}.sv-grid-chart-brush-window.svelte-hyytey:active {cursor:grabbing;}.sv-grid-chart-brush-handle.svelte-hyytey {fill:var(--sg-accent, #2563eb);fill-opacity:0.4;cursor:ew-resize;}.sv-grid-chart-brush-handle.svelte-hyytey:hover {fill-opacity:0.7;}.sv-grid-chart-scatter.svelte-hyytey {transition:opacity 0.2s ease;stroke-width:1;}.is-clickable.svelte-hyytey .sv-grid-chart-scatter:where(.svelte-hyytey),\n .sv-grid-chart-scatter.svelte-hyytey:hover {cursor:pointer;}.sv-grid-chart-cat-hit.svelte-hyytey {fill:transparent;}.sv-grid-chart-cat-hit.svelte-hyytey:focus-visible,\n .sv-grid-chart-slice.svelte-hyytey:focus-visible,\n .sv-grid-chart-arc.svelte-hyytey:focus-visible,\n .sv-grid-chart-heatcell.svelte-hyytey:focus-visible,\n .sv-grid-chart-funnel-seg.svelte-hyytey:focus-visible,\n .sv-grid-chart-treemap-cell.svelte-hyytey:focus-visible,\n .sv-grid-chart-sankey-node.svelte-hyytey:focus-visible,\n .sv-grid-chart-sankey-link.svelte-hyytey:focus-visible,\n .sv-grid-chart-calendar-cell.svelte-hyytey:focus-visible,\n .sv-grid-chart-radar-dot.svelte-hyytey:focus-visible,\n .sv-grid-chart-scatter.svelte-hyytey:focus-visible,\n .sv-grid-chart-brush.svelte-hyytey:focus-visible {outline:2px solid var(--sg-accent, #2563eb);outline-offset:1px;}.sv-grid-chart-datalabel.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-size:calc(9.5px * var(--sg-chart-font-scale, 1));font-weight:600;font-variant-numeric:tabular-nums;pointer-events:none;}.sv-grid-chart-datalabel-leader.svelte-hyytey {stroke:var(--sg-muted, #64748b);stroke-width:1;pointer-events:none;}.sv-grid-chart-datalabel.on-bar.svelte-hyytey {fill:#fff;}.sv-grid-chart-donut-total.svelte-hyytey {fill:var(--sg-fg, #0f172a);font-size:calc(16px * var(--sg-chart-font-scale, 1));font-weight:800;font-variant-numeric:tabular-nums;}.sv-grid-chart-donut-label.svelte-hyytey {fill:var(--sg-muted, #64748b);font-size:calc(10px * var(--sg-chart-font-scale, 1));}.sv-grid-chart-bar.svelte-hyytey {transition:x 0.3s ease, y 0.3s ease, width 0.3s ease, height 0.3s ease;}.sv-grid-chart-dot.svelte-hyytey {transition:cx 0.3s ease, cy 0.3s ease;}.sv-grid-chart-candle.svelte-hyytey {stroke-width:1;transition:x 0.3s ease, y 0.3s ease, width 0.3s ease, height 0.3s ease;}.sv-grid-chart-wick.svelte-hyytey,\n .sv-grid-chart-ohlc.svelte-hyytey {stroke-width:1;shape-rendering:crispEdges;}.sv-grid-chart-box.svelte-hyytey {stroke-width:1;transition:x 0.3s ease, y 0.3s ease, width 0.3s ease, height 0.3s ease;}.sv-grid-chart-whisker.svelte-hyytey,\n .sv-grid-chart-errorbar.svelte-hyytey {stroke-width:1;shape-rendering:crispEdges;}\n /* The median is the number people read off a box plot, so it gets the\n weight. Everything else on the mark is 1px. */.sv-grid-chart-median.svelte-hyytey {stroke-width:2;shape-rendering:crispEdges;}.sv-grid-chart-outlier.svelte-hyytey {stroke-width:1;}.is-clickable.svelte-hyytey .sv-grid-chart-cat-hit:where(.svelte-hyytey),\n .is-clickable.svelte-hyytey .sv-grid-chart-slice:where(.svelte-hyytey) {cursor:pointer;}.sv-grid-chart-empty.svelte-hyytey {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--sg-muted, #94a3b8);font-size:calc(13px * var(--sg-chart-font-scale, 1));pointer-events:none;}\n\n /* Toolbar above the chart: reset-zoom, PNG / SVG / Copy. */.sv-grid-chart-toolbar.svelte-hyytey {display:flex;justify-content:flex-end;gap:4px;flex-wrap:wrap;}.sv-grid-chart-tool.svelte-hyytey {display:inline-flex;align-items:center;gap:4px;border:1px solid var(--sg-border, #cbd5e1);background:var(--sg-bg, #ffffff);color:var(--sg-fg, #1e293b);font-size:calc(11px * var(--sg-chart-font-scale, 1));font-weight:500;padding:3px 8px;border-radius:4px;cursor:pointer;transition:background-color 100ms ease, border-color 100ms ease;}.sv-grid-chart-tool.svelte-hyytey:hover {background:var(--sg-row-hover-bg, #f1f5f9);border-color:var(--sg-accent, #2563eb);}\n\n /* Annotate mode: the toggle reads as pressed, the plot as a target, and a\n marker as something you can click to take away. */.sv-grid-chart-tool.is-on.svelte-hyytey {background:var(--sg-accent, #2563eb);border-color:var(--sg-accent, #2563eb);color:var(--sg-on-accent, #fff);}.sv-grid-chart-svg.is-annotating.svelte-hyytey {cursor:copy;}.sv-grid-chart-annotation-marker.is-removable.svelte-hyytey {cursor:pointer;}\n\n /* Drag-to-zoom: translucent accent rectangle over the plot. */.sv-grid-chart-svg.is-zoomable.svelte-hyytey {cursor:crosshair;}.sv-grid-chart-svg.is-dragging.svelte-hyytey {cursor:crosshair;user-select:none;}.sv-grid-chart-zoom-rect.svelte-hyytey {fill:var(--sg-accent, #2563eb);fill-opacity:0.12;stroke:var(--sg-accent, #2563eb);stroke-width:1;stroke-dasharray:3 3;pointer-events:none;}.sv-grid-chart-tooltip.svelte-hyytey {position:absolute;z-index:10;transform:translate(-50%, calc(-100% - 12px));pointer-events:none;white-space:nowrap;padding:6px 9px;border-radius:6px;background:var(--sg-fg, #0f172a);color:var(--sg-bg, #fff);font-size:calc(11.5px * var(--sg-chart-font-scale, 1));line-height:1.4;box-shadow:0 6px 18px rgba(0, 0, 0, 0.28);display:flex;flex-direction:column;gap:1px;}.sv-grid-chart-tooltip.is-below.svelte-hyytey {transform:translate(-50%, 16px);}\n /* A corner tooltip anchors its own corner to the plot's, no flipping. */.sv-grid-chart-tooltip.is-fixed.svelte-hyytey {transform:none;}.sv-grid-chart-tooltip.is-fixed.is-right.svelte-hyytey {transform:translate(-100%, 0);}.sv-grid-chart-tooltip.is-fixed.is-bottom.svelte-hyytey {transform:translate(0, -100%);}.sv-grid-chart-tooltip.is-fixed.is-right.is-bottom.svelte-hyytey {transform:translate(-100%, -100%);}\n /* Pinned: selectable text, and a ring so a reader sees it is held. */.sv-grid-chart-tooltip.is-pinned.svelte-hyytey {pointer-events:auto;user-select:text;box-shadow:0 0 0 2px var(--sg-accent, #2563eb), 0 6px 18px rgba(0, 0, 0, 0.28);}.sv-grid-chart-tooltip-title.svelte-hyytey {opacity:0.75;font-size:calc(10.5px * var(--sg-chart-font-scale, 1));margin-bottom:1px;}.sv-grid-chart-tooltip-row.svelte-hyytey {display:flex;align-items:center;gap:6px;}.sv-grid-chart-tooltip-dot.svelte-hyytey {width:8px;height:8px;border-radius:2px;flex-shrink:0;}.sv-grid-chart-tooltip-row-label.svelte-hyytey {opacity:0.85;}.sv-grid-chart-tooltip-row-value.svelte-hyytey {margin-left:auto;padding-left:10px;font-weight:700;font-variant-numeric:tabular-nums;}.sv-grid-chart-legend.svelte-hyytey {display:flex;flex-wrap:wrap;gap:6px 12px;font-size:calc(12px * var(--sg-chart-font-scale, 1));color:var(--sg-fg, #0f172a);}.sv-grid-chart-legend-item.svelte-hyytey {display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;color:inherit;font:inherit;padding:1px 2px;border-radius:4px;cursor:pointer;}.sv-grid-chart-legend-item.svelte-hyytey:disabled {cursor:default;}.sv-grid-chart-legend-item.is-off.svelte-hyytey {color:var(--sg-muted, #94a3b8);text-decoration:line-through;}.sv-grid-chart-legend-item.is-isolated.svelte-hyytey {background:var(--sg-header-bg, #f1f5f9);font-weight:700;}.sv-grid-chart-legend-more.svelte-hyytey {border:1px dashed var(--sg-border, #cbd5e1);background:transparent;color:var(--sg-muted, #64748b);font:inherit;font-size:calc(11px * var(--sg-chart-font-scale, 1));padding:1px 7px;border-radius:999px;cursor:pointer;}.sv-grid-chart-legend-more.svelte-hyytey:hover {color:var(--sg-fg, #0f172a);border-color:var(--sg-accent, #2563eb);}.sv-grid-chart-sr-only.svelte-hyytey {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}.sv-grid-chart-swatch.svelte-hyytey {width:12px;height:12px;border-radius:3px;border:1.5px solid transparent;display:inline-block;box-sizing:border-box;}\n\n /* Enter animation. Marks fade in when they are first created; the position\n transitions above then handle everything after that, so a chart appears\n smoothly and moves smoothly rather than popping into place and then\n animating.\n\n A fade rather than the wipe you would normally reach for. A wipe needs a\n clip-path over all the marks, and the marks here are direct children of the\n <svg> - grouping them is a large edit across every chart type, for a nicer\n version of something already pleasant. Noted rather than done.\n\n `both` matters: it holds the from-state before the animation starts, so a\n mark cannot flash at full opacity for a frame first. It also means that\n when `animation: none` applies below, the rule stops applying entirely and\n the mark is simply painted - not stuck invisible. */\n @keyframes svelte-hyytey-sv-grid-chart-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }.sv-grid-chart-bar.svelte-hyytey,\n .sv-grid-chart-linepath.svelte-hyytey,\n .sv-grid-chart-area.svelte-hyytey,\n .sv-grid-chart-slice.svelte-hyytey,\n .sv-grid-chart-candle.svelte-hyytey,\n .sv-grid-chart-box.svelte-hyytey,\n .sv-grid-chart-funnel-seg.svelte-hyytey,\n .sv-grid-chart-heatcell.svelte-hyytey,\n .sv-grid-chart-treemap-cell.svelte-hyytey {\n animation: svelte-hyytey-sv-grid-chart-in 0.3s ease-out both;}\n\n /* Reduced motion. Every other animated component in the kit honours this\n (SvCard, SvCircularProgress, SvCollapsible); the chart never did, so a\n reader who has asked the OS for less movement still got every bar, dot,\n candle and box sliding on each re-aggregation - and a chart re-aggregates\n on every filter keystroke, which is the worst case for it. */\n @media (prefers-reduced-motion: reduce) {.sv-grid-chart-bar.svelte-hyytey,\n .sv-grid-chart-dot.svelte-hyytey,\n .sv-grid-chart-candle.svelte-hyytey,\n .sv-grid-chart-box.svelte-hyytey {transition:none;}.sv-grid-chart-bar.svelte-hyytey,\n .sv-grid-chart-linepath.svelte-hyytey,\n .sv-grid-chart-area.svelte-hyytey,\n .sv-grid-chart-slice.svelte-hyytey,\n .sv-grid-chart-candle.svelte-hyytey,\n .sv-grid-chart-box.svelte-hyytey,\n .sv-grid-chart-funnel-seg.svelte-hyytey,\n .sv-grid-chart-heatcell.svelte-hyytey,\n .sv-grid-chart-treemap-cell.svelte-hyytey {\n animation: none;}\n }\n\n /* ---- Forced colors (Windows High Contrast) ---------------------------\n The UA forces fill and stroke along with color and background, which\n would paint every series the same. Colour carries the data, so the\n marks keep theirs (forced-color-adjust: none, the one case the spec\n allows it for). Everything that is chrome rather than data takes the\n system palette instead: text, gridlines, the crosshair and its pills,\n focus rings, the legend's swatches and the tooltip. */\n @media (forced-colors: active) {.sv-grid-chart-svg.svelte-hyytey,\n .sv-grid-chart-brush.svelte-hyytey,\n .sv-grid-chart-swatch.svelte-hyytey {forced-color-adjust:none;}.sv-grid-chart-axis.svelte-hyytey,\n .sv-grid-chart-axis-title.svelte-hyytey,\n .sv-grid-chart-title.svelte-hyytey,\n .sv-grid-chart-subtitle.svelte-hyytey,\n .sv-grid-chart-caption.svelte-hyytey,\n .sv-grid-chart-datalabel.svelte-hyytey,\n .sv-grid-chart-callout-label.svelte-hyytey,\n .sv-grid-chart-donut-total.svelte-hyytey,\n .sv-grid-chart-donut-label.svelte-hyytey,\n .sv-grid-chart-sankey-label.svelte-hyytey,\n .sv-grid-chart-annotation-label.svelte-hyytey {fill:CanvasText;}.sv-grid-chart-gridline.svelte-hyytey {stroke:GrayText;opacity:1;}.sv-grid-chart-crosshair.svelte-hyytey {stroke:Highlight;opacity:1;}.sv-grid-chart-crosshair-label.svelte-hyytey rect:where(.svelte-hyytey),\n .sv-grid-chart-refpill.svelte-hyytey rect:where(.svelte-hyytey) {fill:Highlight;opacity:1;}.sv-grid-chart-crosshair-label.svelte-hyytey text:where(.svelte-hyytey),\n .sv-grid-chart-refpill.svelte-hyytey text:where(.svelte-hyytey) {fill:HighlightText;}.sv-grid-chart-cat-hit.svelte-hyytey:focus-visible,\n .sv-grid-chart-slice.svelte-hyytey:focus-visible,\n .sv-grid-chart-arc.svelte-hyytey:focus-visible,\n .sv-grid-chart-heatcell.svelte-hyytey:focus-visible,\n .sv-grid-chart-funnel-seg.svelte-hyytey:focus-visible,\n .sv-grid-chart-treemap-cell.svelte-hyytey:focus-visible,\n .sv-grid-chart-sankey-node.svelte-hyytey:focus-visible,\n .sv-grid-chart-sankey-link.svelte-hyytey:focus-visible,\n .sv-grid-chart-calendar-cell.svelte-hyytey:focus-visible,\n .sv-grid-chart-radar-dot.svelte-hyytey:focus-visible,\n .sv-grid-chart-scatter.svelte-hyytey:focus-visible,\n .sv-grid-chart-brush.svelte-hyytey:focus-visible,\n .sv-grid-chart-annotation-marker.svelte-hyytey:focus-visible {outline:3px solid Highlight;}.sv-grid-chart-slice.is-selected.svelte-hyytey,\n .sv-grid-chart-arc.is-selected.svelte-hyytey {stroke:Highlight;stroke-width:3;}.sv-grid-chart-brush-mask.svelte-hyytey {fill:Canvas;fill-opacity:0.7;}.sv-grid-chart-brush-window.svelte-hyytey {stroke:Highlight;fill:Highlight;fill-opacity:0.2;}.sv-grid-chart-brush-handle.svelte-hyytey {fill:Highlight;}.sv-grid-chart-tooltip.svelte-hyytey {border:1px solid CanvasText;}.sv-grid-chart-legend-item.is-off.svelte-hyytey .sv-grid-chart-swatch:where(.svelte-hyytey) {forced-color-adjust:auto;}\n }"
319
+ };
320
+ function Ar(e, i) {
321
+ p.push(i, !0), p.append_styles(e, kr);
322
+ let s = p.prop(i, "legend", 3, !0), m = p.prop(i, "interactive", 3, !0), me = p.prop(i, "tooltipMode", 3, "shared"), h = p.prop(i, "tooltipPosition", 3, "follow"), g = p.prop(i, "tooltipSticky", 3, !1), _ = p.prop(i, "zoomable", 3, !1), v = p.prop(i, "zoom", 15, null), be = p.prop(i, "rangePresets", 3, !1), xe = p.prop(i, "contextMenu", 3, !1), Se = p.prop(i, "animate", 3, !1), Ce = p.prop(i, "drillable", 3, !1), y = p.prop(i, "drillPath", 31, () => p.proxy([])), we = p.prop(i, "selectable", 3, !1), Te = p.prop(i, "selected", 31, () => p.proxy([])), Ee = p.prop(i, "announce", 3, !0), Ar = p.prop(i, "describe", 3, !0), jr = p.prop(i, "live", 3, !1), Mr = p.prop(i, "hoverHighlight", 3, !0), Nr = p.prop(i, "crosshairLabels", 3, !0), Pr = p.prop(i, "brush", 3, !1), Fr = p.prop(i, "brushHeight", 3, 88), Ir = p.prop(i, "autosize", 3, !1), Lr = p.prop(i, "annotatable", 3, !1), Rr = p.prop(i, "drawable", 3, !1), x = p.derived(() => De(i.localeText)), zr = p.state("");
323
+ p.user_effect(() => {
324
+ if (!Ar()) {
325
+ p.set(zr, "");
326
+ return;
327
+ }
328
+ let e = p.get(I), t = !0;
329
+ return import("./chart-summary-BJW_tg_X.js").then((e) => e.n).then(({ chartSummary: n }) => {
330
+ t && p.set(zr, n(e), !0);
331
+ }), () => {
332
+ t = !1;
333
+ };
334
+ });
335
+ async function Br() {
336
+ if (p.get(zr)) {
337
+ try {
338
+ await navigator.clipboard?.writeText(p.get(zr));
339
+ } catch {}
340
+ p.set(mo, `${p.get(x).describeCopied}. ${p.get(zr)}`);
341
+ }
342
+ }
343
+ let Vr = p.state(0), Hr = p.state(0), Ur = p.derived(() => i.width ?? (Ir() && p.get(Vr) > 24 ? p.get(Vr) : i.spec.width ?? 520)), Wr = p.derived(() => i.height ?? (Ir() && p.get(Hr) > 24 ? p.get(Hr) : i.spec.height ?? 300)), Gr = p.derived(() => {
344
+ if (!i.spec.responsive?.length) return;
345
+ let e;
346
+ for (let t of re(i.spec.responsive, p.get(Ur), p.get(Wr))) t.legend !== void 0 && (e = t.legend);
347
+ return e;
348
+ }), S = p.derived(() => {
349
+ if (!i.spec.responsive?.length) return i.spec;
350
+ let { responsive: e, ...t } = l(i.spec, p.get(Ur), p.get(Wr));
351
+ return t;
352
+ }), Kr = p.derived(() => p.get(Gr) ?? s()), qr = p.derived(() => p.get(Kr) === !0 ? "bottom" : p.get(Kr) === !1 ? null : p.get(Kr)), Jr = p.derived(() => p.get(qr) === "left" || p.get(qr) === "right"), Yr = p.state(0), Xr = p.state(0), Zr = p.state(0), Qr = p.state(0), $r = p.derived(() => {
353
+ if (!Ir() || p.get(Vr) <= 24) return null;
354
+ let e = p.get(ii) ? p.get(Yr) : 0, t = p.get(qr) ? p.get(Zr) : 0, n = p.get(qr) ? p.get(Xr) : 0, r = Pr() && !ca.has(i.spec.type) ? p.get(Qr) : 0, a = Math.max(120, Math.round(p.get(Vr) - (p.get(Jr) ? n + 8 : 0))), o = e + (p.get(Jr) ? 0 : t) + r, s = p.get(Jr) ? 16 : (e ? 8 : 0) + (t ? 8 : 0) + (r ? 8 : 0);
355
+ return {
356
+ width: a,
357
+ height: p.get(Hr) > 24 ? Math.max(120, Math.round(p.get(Hr) - o - s)) : void 0
358
+ };
359
+ }), ei = p.derived(() => i.width ?? p.get($r)?.width), ti = p.derived(() => i.height ?? p.get($r)?.height), ni = p.derived(() => typeof i.dataLabels == "object" ? {
360
+ show: !0,
361
+ ...i.dataLabels
362
+ } : i.dataLabels === void 0 ? p.get(S).dataLabels ? {
363
+ show: p.get(S).dataLabels.show !== !1,
364
+ ...p.get(S).dataLabels
365
+ } : { show: !1 } : { show: !!i.dataLabels }), C = p.derived(() => _() ? _() === !0 ? {
366
+ drag: !0,
367
+ wheel: !1,
368
+ pinch: !1,
369
+ pan: !1,
370
+ axis: "x"
371
+ } : {
372
+ drag: _().drag !== !1,
373
+ wheel: _().wheel ?? !1,
374
+ pinch: _().pinch ?? !!_().wheel,
375
+ pan: _().pan ?? !1,
376
+ axis: _().axis ?? "x"
377
+ } : null), ri = p.state(!1), ii = p.derived(() => i.toolbar ?? (!!_() || !!i.onDrill || Lr() || !!be() || Ce() || !!Rr())), w = p.state(!1), T = (e) => i.formatValue ? i.formatValue(e) : p.get(S).valueFormat ? t(e, p.get(S).valueFormat, p.get(S)) : Number.isFinite(e) ? e.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(e), ai = p.derived(() => {
378
+ let e = p.get(S).y2Axis;
379
+ return i.formatValue ? i.formatValue : e?.formatter ? (t) => e.formatter(t, -1) : e?.format ? (n) => t(n, e.format, p.get(S)) : (e) => Number.isFinite(e) ? e.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(e);
380
+ }), oi = p.derived(() => new Set(p.get(S).series.filter((e) => e.axis === "right").map((e) => e.label))), si = (e) => e && p.get(oi).has(e) ? p.get(ai) : T, ci = p.state(p.proxy(new Set(i.spec.series.filter((e) => e.visible === !1).map((e) => e.label)))), li = p.state(null), ui = p.state(null), di = p.state(null), fi = p.derived(() => p.get(S).palette ?? p.get(ui) ?? ne), E = `svgc-${Math.random().toString(36).slice(2, 8)}`, D = p.derived(() => p.get(S).series.map((e, t) => ({
381
+ ...e,
382
+ color: e.color ?? p.get(fi)[t % p.get(fi).length]
383
+ }))), pi = p.derived(() => p.get(S).series.map((e, t) => e.pattern ? e.pattern : p.get(S).patternFallback ? [
384
+ "stripe",
385
+ "crosshatch",
386
+ "dots",
387
+ "diagonal"
388
+ ][t % 4] : "solid")), mi = p.derived(() => {
389
+ let e = {};
390
+ return p.get(D).forEach((t, n) => {
391
+ let r = p.get(pi)[n];
392
+ e[t.label] = r === "solid" || !r ? t.color : `url(#${E}-pat-${n})`;
393
+ }), e;
394
+ }), hi = p.derived(() => p.get(D).map((e, t) => ({
395
+ id: `${E}-pat-${t}`,
396
+ color: e.color,
397
+ kind: p.get(pi)[t] ?? "solid"
398
+ })).filter((e) => e.kind !== "solid")), gi = p.derived(() => {
399
+ if (p.get(li) == null) return p.get(ci);
400
+ let e = p.get(S).type === "pie" ? p.get(Ca) : p.get(S).series.map((e) => e.label);
401
+ return new Set(e.filter((e) => e !== p.get(li)));
402
+ }), _i = p.derived(() => v() !== null);
403
+ function O(e) {
404
+ if (!(e === null && v() === null || e !== null && v() !== null && e.i0 === v().i0 && e.i1 === v().i1 && (e.y?.min ?? null) === (v().y?.min ?? null) && (e.y?.max ?? null) === (v().y?.max ?? null)) && (v(e), i.onZoom?.(e), i.syncGroup && !yi)) {
405
+ let t = p.get(S).categories.length;
406
+ ve(i.syncGroup, e, t, vi, e ? [p.get(S).categories[e.i0] ?? "", p.get(S).categories[e.i1] ?? ""] : null);
407
+ }
408
+ }
409
+ let vi = Symbol("svchart"), yi = !1, bi = p.derived(() => i.syncGroup ? ge(i.syncGroup) : null), xi = p.state(!1);
410
+ function Si(e) {
411
+ O(e);
412
+ }
413
+ function Ci() {
414
+ O(null);
415
+ }
416
+ function wi(e, t) {
417
+ let n = ro(e, t);
418
+ return n == null ? null : (v() ? v().i0 : 0) + n;
419
+ }
420
+ function Ti(e) {
421
+ if (!p.get(C)?.wheel || !p.get(z) || p.get(w) || p.get(C).wheel === "modifier" && !(e.ctrlKey || e.metaKey)) return;
422
+ let t = ji(e);
423
+ if (!t || t.x < p.get(L).plot.x || t.x > p.get(L).plot.x + p.get(L).plot.w) return;
424
+ e.preventDefault();
425
+ let n = wi(e.clientX, e.currentTarget) ?? 0, r = e.deltaY > 0 ? 1.25 : .8;
426
+ O(ue(v(), p.get(S).categories.length, n, r));
427
+ }
428
+ let Ei = /* @__PURE__ */ new Map(), Di = null, Oi = null, ki = (e) => !!p.get(C)?.pan && p.get(_i) && (p.get(ri) || (p.get(C).pan === "shift" || p.get(C).pan === !0) && e.shiftKey), k = p.state(null), A = p.state(null), j = p.state(null), Ai = p.derived(() => {
429
+ if (!p.get(A) || !p.get(j)) return null;
430
+ let e = Math.min(p.get(A).x, p.get(j).x), t = Math.min(p.get(A).y, p.get(j).y), n = Math.abs(p.get(j).x - p.get(A).x), r = Math.abs(p.get(j).y - p.get(A).y);
431
+ return n > 4 && r > 4 ? {
432
+ x: e,
433
+ y: t,
434
+ w: n,
435
+ h: r
436
+ } : null;
437
+ });
438
+ function ji(e) {
439
+ if (!p.get(k)) return null;
440
+ let t = p.get(k).getBoundingClientRect();
441
+ return {
442
+ x: (e.clientX - t.left) / t.width * p.get(L).width,
443
+ y: (e.clientY - t.top) / t.height * p.get(L).height
444
+ };
445
+ }
446
+ function Mi(e) {
447
+ let t = p.get(B) ? e.y - p.get(L).plot.y : e.x - p.get(L).plot.x, n = Math.floor(t / p.get(Za));
448
+ return Math.max(0, Math.min(p.get(I).categories.length - 1, n));
449
+ }
450
+ function Ni(e) {
451
+ if (p.get(w) || p.get(M) || p.get(Wi) || !p.get(C) || !p.get(z)) return;
452
+ let t = ji(e);
453
+ if (t && !(t.x < p.get(L).plot.x || t.x > p.get(L).plot.x + p.get(L).plot.w || t.y < p.get(L).plot.y || t.y > p.get(L).plot.y + p.get(L).plot.h)) {
454
+ if (e.target.setPointerCapture?.(e.pointerId), p.get(C).pinch && (Ei.set(e.pointerId, t), Ei.size === 2)) {
455
+ let [e, t] = [...Ei.values()];
456
+ Di = {
457
+ dist: Math.hypot(e.x - t.x, e.y - t.y) || 1,
458
+ mid: Mi({
459
+ x: (e.x + t.x) / 2,
460
+ y: (e.y + t.y) / 2
461
+ }) + (v() ? v().i0 : 0),
462
+ start: v()
463
+ }, p.set(A, null), p.set(j, null);
464
+ return;
465
+ }
466
+ if (ki(e)) {
467
+ Oi = {
468
+ startIndex: Mi(t),
469
+ start: v()
470
+ };
471
+ return;
472
+ }
473
+ p.get(C).drag && (p.set(A, t, !0), p.set(j, t, !0));
474
+ }
475
+ }
476
+ function Pi(e) {
477
+ if (Di && Ei.has(e.pointerId)) {
478
+ let t = ji(e);
479
+ t && Ei.set(e.pointerId, t);
480
+ let [n, r] = [...Ei.values()];
481
+ if (n && r) {
482
+ let e = Math.hypot(n.x - r.x, n.y - r.y) || 1;
483
+ O(fe(Di.start, p.get(S).categories.length, Di.mid, e / Di.dist));
484
+ }
485
+ return;
486
+ }
487
+ if (Oi) {
488
+ let t = ji(e);
489
+ if (!t) return;
490
+ let n = Oi.startIndex - Mi(t);
491
+ O(de(Oi.start, p.get(S).categories.length, n));
492
+ return;
493
+ }
494
+ p.get(A) && p.set(j, ji(e), !0);
495
+ }
496
+ function Fi(e) {
497
+ if (e && Ei.delete(e.pointerId), Di) {
498
+ Ei.size < 2 && (Di = null);
499
+ return;
500
+ }
501
+ if (Oi) {
502
+ Oi = null;
503
+ return;
504
+ }
505
+ if (!p.get(A) || !p.get(j)) {
506
+ p.set(A, null), p.set(j, null);
507
+ return;
508
+ }
509
+ let t = p.get(Ai);
510
+ if (t) {
511
+ let e = p.get(C)?.axis ?? "x", n = Mi({
512
+ x: t.x,
513
+ y: t.y
514
+ }), r = Mi({
515
+ x: t.x + t.w,
516
+ y: t.y + t.h
517
+ }), i = v() ? v().i0 : 0, a = e === "y" ? v()?.i0 ?? 0 : i + Math.min(n, r), o = e === "y" ? v()?.i1 ?? p.get(S).categories.length - 1 : i + Math.max(n, r), s;
518
+ if (e !== "x" && p.get(R) && !p.get(B)) {
519
+ let e = p.get(R).yInvert(t.y), n = p.get(R).yInvert(t.y + t.h);
520
+ Number.isFinite(e) && Number.isFinite(n) && e !== n && (s = {
521
+ min: Math.min(e, n),
522
+ max: Math.max(e, n)
523
+ });
524
+ }
525
+ (o > a || s) && O({
526
+ i0: a,
527
+ i1: Math.max(a, o),
528
+ ...s ? { y: s } : {}
529
+ });
530
+ }
531
+ p.set(A, null), p.set(j, null);
532
+ }
533
+ function Ii() {
534
+ _() && p.get(_i) && Ci();
535
+ }
536
+ let Li = [
537
+ "trend",
538
+ "hray",
539
+ "fib",
540
+ "rect",
541
+ "arrow",
542
+ "text"
543
+ ], Ri = p.derived(() => ({
544
+ trend: p.get(x).toolTrend,
545
+ hray: p.get(x).toolRay,
546
+ fib: p.get(x).toolFib,
547
+ rect: p.get(x).toolRect,
548
+ arrow: p.get(x).toolArrow,
549
+ text: p.get(x).toolText
550
+ })), zi = p.derived(() => Rr() ? Rr() === !0 ? Li : Rr() : []), M = p.state(null), N = p.state(null), P = p.state(null), Bi = p.state(null), Vi = p.state(null), Hi = p.state("");
551
+ function Ui() {
552
+ let e = p.get(Vi), t = p.get(Hi).trim();
553
+ p.set(Vi, null), p.set(Hi, ""), !(!e || !t) && Yi([...Ki(), {
554
+ id: `d${Date.now().toString(36)}${Gi++}`,
555
+ kind: "text",
556
+ points: [{
557
+ x: e.x,
558
+ y: e.y
559
+ }],
560
+ text: t
561
+ }]);
562
+ }
563
+ let Wi = p.state(null), Gi = 0, Ki = () => p.get(S).drawings ?? [];
564
+ function qi(e) {
565
+ if (!p.get(R)) return null;
566
+ let t = p.get(L).axes?.x;
567
+ if (t?.type === "number") return p.get(R).xInvertValue(e);
568
+ if (t?.type === "time") return new Date(p.get(R).xInvertValue(e)).toISOString();
569
+ let n = Math.round(p.get(R).xInvert(e));
570
+ return p.get(I).categories[n] ?? null;
571
+ }
572
+ function Ji(e) {
573
+ let t = ji(e);
574
+ if (!t || !p.get(R) || t.x < p.get(L).plot.x || t.x > p.get(L).plot.x + p.get(L).plot.w || t.y < p.get(L).plot.y || t.y > p.get(L).plot.y + p.get(L).plot.h) return null;
575
+ let n = qi(t.x);
576
+ if (n == null) return null;
577
+ let r = p.get(R).yInvert(t.y);
578
+ return Number.isFinite(r) ? {
579
+ x: n,
580
+ y: Math.round(r * 1e3) / 1e3,
581
+ px: t.x,
582
+ py: t.y
583
+ } : null;
584
+ }
585
+ function Yi(e) {
586
+ i.onDrawingsChange?.(e);
587
+ }
588
+ function Xi(e) {
589
+ p.set(M, p.get(M) === e ? null : e, !0), p.set(N, null), p.set(P, null), p.set(Vi, null);
590
+ }
591
+ function Zi(e) {
592
+ if (!p.get(M)) return;
593
+ let t = Ji(e);
594
+ if (!t) return;
595
+ if (p.get(M) === "text") {
596
+ let n = p.get(K)?.getBoundingClientRect();
597
+ p.set(Hi, ""), p.set(Vi, {
598
+ x: t.x,
599
+ y: t.y,
600
+ left: n ? e.clientX - n.left : 0,
601
+ top: n ? e.clientY - n.top : 0
602
+ }, !0);
603
+ return;
604
+ }
605
+ if (p.get(M) === "hray") {
606
+ Yi([...Ki(), {
607
+ id: `d${Date.now().toString(36)}${Gi++}`,
608
+ kind: p.get(M),
609
+ points: [{
610
+ x: t.x,
611
+ y: t.y
612
+ }]
613
+ }]);
614
+ return;
615
+ }
616
+ if (!p.get(N)) {
617
+ p.set(N, t, !0), p.set(P, {
618
+ x: t.px,
619
+ y: t.py
620
+ }, !0);
621
+ return;
622
+ }
623
+ let n = p.get(N);
624
+ p.set(N, null), p.set(P, null), Yi([...Ki(), {
625
+ id: `d${Date.now().toString(36)}${Gi++}`,
626
+ kind: p.get(M),
627
+ points: [{
628
+ x: n.x,
629
+ y: n.y
630
+ }, {
631
+ x: t.x,
632
+ y: t.y
633
+ }]
634
+ }]);
635
+ }
636
+ function Qi(e) {
637
+ if (p.get(Wi)) {
638
+ let t = Ji(e);
639
+ if (!t) return;
640
+ let { id: n, index: r } = p.get(Wi);
641
+ Yi(Ki().map((e) => e.id === n ? {
642
+ ...e,
643
+ points: e.points.map((e, n) => n === r ? {
644
+ x: t.x,
645
+ y: t.y
646
+ } : e)
647
+ } : e));
648
+ return;
649
+ }
650
+ if (p.get(N)) {
651
+ let t = ji(e);
652
+ t && p.set(P, t, !0);
653
+ }
654
+ }
655
+ function $i(e) {
656
+ Yi(Ki().filter((t) => t.id !== e)), p.get(Bi) === e && p.set(Bi, null);
657
+ }
658
+ function ea(e, t) {
659
+ (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), $i(t));
660
+ }
661
+ function ta(e) {
662
+ if (e.key === "Escape") {
663
+ if (p.get(J)) {
664
+ na();
665
+ return;
666
+ }
667
+ p.get(M) && (p.get(N) ? (p.set(N, null), p.set(P, null)) : p.set(M, null));
668
+ }
669
+ }
670
+ function na() {
671
+ p.set(J, null), Z();
672
+ }
673
+ function ra(e) {
674
+ if (!(!g() || !p.get(q))) {
675
+ if (p.get(J) && p.get(J).index === e) {
676
+ na();
677
+ return;
678
+ }
679
+ p.set(J, {
680
+ index: e,
681
+ series: p.get(q).ctx.series ?? null
682
+ }, !0);
683
+ }
684
+ }
685
+ p.user_effect(() => {
686
+ if (!p.get(J) || typeof document > "u") return;
687
+ let e = (e) => {
688
+ p.get(K) && e.target instanceof Node && p.get(K).contains(e.target) || na();
689
+ };
690
+ return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
691
+ });
692
+ let ia = (e) => {
693
+ e.focus();
694
+ }, aa = p.derived(() => p.get(S).type === "candlestick" || p.get(S).type === "ohlc"), oa = p.derived(() => p.get(S).type === "ohlc"), sa = p.derived(() => Math.max(50, (p.get(ei) ?? p.get(S).width ?? 520) - 60)), ca = /* @__PURE__ */ new Set([
695
+ "pie",
696
+ "heatmap",
697
+ "funnel",
698
+ "radar",
699
+ "calendar",
700
+ "gauge",
701
+ "treemap",
702
+ "sankey",
703
+ "sunburst",
704
+ "radial-bar",
705
+ "radial-column",
706
+ "nightingale",
707
+ "chord",
708
+ "bullet"
709
+ ]), la = /* @__PURE__ */ new Set([
710
+ "lollipop",
711
+ "dumbbell",
712
+ "range-area",
713
+ "range-bar",
714
+ "stream",
715
+ "pareto"
716
+ ]), ua = p.derived(() => Pr() && !ca.has(p.get(S).type)), da = p.derived(() => ({
717
+ ...p.get(S),
718
+ width: p.get(ei) ?? p.get(S).width,
719
+ height: Fr(),
720
+ title: void 0,
721
+ subtitle: void 0,
722
+ caption: void 0,
723
+ yAxisTitle: void 0,
724
+ y2AxisTitle: void 0,
725
+ xAxisTitle: void 0,
726
+ xAxis: {
727
+ ...p.get(S).xAxis,
728
+ title: void 0,
729
+ labels: !1
730
+ },
731
+ yAxis: {
732
+ ...p.get(S).yAxis,
733
+ title: void 0,
734
+ labels: !1
735
+ },
736
+ y2Axis: {
737
+ ...p.get(S).y2Axis,
738
+ title: void 0,
739
+ labels: !1
740
+ },
741
+ referenceLines: void 0,
742
+ referenceBands: void 0,
743
+ annotations: void 0,
744
+ drawings: void 0,
745
+ seriesLabels: void 0,
746
+ dataLabels: { show: !1 },
747
+ type: p.get(aa) || p.get(S).type === "boxplot" || la.has(p.get(S).type) ? "line" : p.get(S).type === "histogram" ? "bar" : p.get(S).type,
748
+ stackOffset: void 0,
749
+ series: p.get(D).filter((e) => !p.get(gi).has(e.label)).map((e) => e.ohlc || e.boxes ? {
750
+ ...e,
751
+ ohlc: void 0,
752
+ boxes: void 0,
753
+ errors: void 0,
754
+ type: "line"
755
+ } : e.errors || e.type && la.has(e.type) || e.type === "scatter" ? {
756
+ ...e,
757
+ errors: void 0,
758
+ type: e.type && (la.has(e.type) || e.type === "scatter") ? "line" : e.type
759
+ } : e)
760
+ })), F = p.derived(() => p.get(ua) ? ie(c(p.get(da), p.get(sa))) : null), fa = p.derived(() => {
761
+ let e = p.get(S).categories.length;
762
+ return !v() || e === 0 ? {
763
+ t0: 0,
764
+ t1: 1
765
+ } : {
766
+ t0: v().i0 / e,
767
+ t1: (v().i1 + 1) / e
768
+ };
769
+ }), pa = p.state(null);
770
+ function ma(e, t) {
771
+ let n = t.getBoundingClientRect();
772
+ return p.get(F) ? (e.clientX - n.left) / n.width * p.get(F).width : 0;
773
+ }
774
+ function ha(e, t) {
775
+ if (!p.get(F)) return;
776
+ let n = e.currentTarget, r = ma(e, n.ownerSVGElement ?? n);
777
+ p.set(pa, {
778
+ mode: t,
779
+ startX: r,
780
+ startT0: p.get(fa).t0,
781
+ startT1: p.get(fa).t1
782
+ }, !0), e.currentTarget.setPointerCapture?.(e.pointerId), e.stopPropagation();
783
+ }
784
+ function ga(e) {
785
+ if (!p.get(pa) || !p.get(F)) return;
786
+ let t = (ma(e, e.currentTarget.ownerSVGElement ?? e.currentTarget) - p.get(pa).startX) / p.get(F).plot.w, n = p.get(S).categories.length;
787
+ if (n === 0) return;
788
+ let r = p.get(pa).startT0, i = p.get(pa).startT1;
789
+ if (p.get(pa).mode === "move") {
790
+ let e = i - r;
791
+ r = Math.max(0, Math.min(1 - e, r + t)), i = r + e;
792
+ } else p.get(pa).mode === "left" ? r = Math.max(0, Math.min(i - 1 / n, r + t)) : i = Math.min(1, Math.max(r + 1 / n, i + t));
793
+ let a = Math.max(0, Math.floor(r * n)), o = Math.min(n - 1, Math.ceil(i * n) - 1);
794
+ a === 0 && o === n - 1 ? O(null) : O({
795
+ i0: a,
796
+ i1: Math.max(a, o),
797
+ ...v()?.y ? { y: v().y } : {}
798
+ });
799
+ }
800
+ function _a(e) {
801
+ p.set(pa, null), e.currentTarget.releasePointerCapture?.(e.pointerId);
802
+ }
803
+ let va = p.derived(() => p.get(S).tree ?? p.get(S).treemap ?? null), ya = p.derived(() => Ce() && !!p.get(va) && (p.get(S).type === "sunburst" || p.get(S).type === "treemap" || p.get(S).type === "pie")), ba = p.derived(() => p.get(ya) && y().length ? n(p.get(va), y()) : p.get(va)), xa = (e) => e.value ?? (e.children ?? []).reduce((e, t) => e + xa(t), 0), Sa = p.derived(() => p.get(S).type === "pie" && p.get(ya) && p.get(ba) ? p.get(ba) : null), Ca = p.derived(() => p.get(Sa) ? (p.get(Sa).children ?? []).map((e) => e.name) : p.get(S).categories), wa = (e) => !!p.get(Sa) && !!p.get(Sa).children?.find((t) => t.name === e)?.children?.length;
804
+ function Ta(e) {
805
+ y(e);
806
+ }
807
+ function Ea(e) {
808
+ return !p.get(ya) || !e || !p.get(va) || !n(p.get(va), e)?.children?.length ? !1 : (Ta(e), !0);
809
+ }
810
+ let I = p.derived(() => {
811
+ if (p.get(Sa)) {
812
+ let e = p.get(Sa).children ?? [], t = p.get(S).series[0]?.label ?? p.get(Sa).name, n = e.map((e) => p.get(gi).has(e.name) ? 0 : xa(e)), r = e.map((e) => e.color ?? null);
813
+ return {
814
+ ...p.get(S),
815
+ categories: p.get(Ca),
816
+ series: [{
817
+ label: t,
818
+ values: n,
819
+ ...r.some(Boolean) ? { colors: r } : {}
820
+ }]
821
+ };
822
+ }
823
+ if (p.get(ya) && p.get(ba) && y().length) {
824
+ let e = {
825
+ ...p.get(S),
826
+ tree: p.get(ba),
827
+ treemap: p.get(ba)
828
+ };
829
+ return p.get(S).type === "treemap" ? e : {
830
+ ...e,
831
+ series: p.get(D)
832
+ };
833
+ }
834
+ if (p.get(S).type === "pie" || p.get(Ha)) {
835
+ let e = p.get(D)[0];
836
+ if (!e) return p.get(S);
837
+ let t = e.values.map((e, t) => p.get(gi).has(p.get(S).categories[t] ?? String(t)) ? 0 : e);
838
+ return {
839
+ ...p.get(S),
840
+ series: [{
841
+ ...e,
842
+ values: t
843
+ }]
844
+ };
845
+ }
846
+ let e = p.get(D).filter((e) => !p.get(gi).has(e.label)), t = v() ? d({
847
+ ...p.get(S),
848
+ series: e
849
+ }, v().i0, v().i1) : {
850
+ ...p.get(S),
851
+ series: e
852
+ };
853
+ if (v()?.y) {
854
+ let e = v().y.axis === "right" ? "y2Axis" : "yAxis";
855
+ t = {
856
+ ...t,
857
+ [e]: {
858
+ ...t[e] ?? {},
859
+ min: v().y.min,
860
+ max: v().y.max,
861
+ nice: !1
862
+ }
863
+ };
864
+ }
865
+ return c(t, p.get(sa));
866
+ }), Da = p.state(!1), Oa = p.derived(() => ie({
867
+ ...p.get(I),
868
+ palette: p.get(fi),
869
+ ...p.get(ei) || p.get(ti) ? {
870
+ width: p.get(ei),
871
+ height: p.get(ti)
872
+ } : {},
873
+ ...i.dataLabels === void 0 ? {} : { dataLabels: p.get(ni) }
874
+ }, p.get(Da) ? "dark" : "light")), ka = p.derived(() => Se() ? Se() === !0 ? {
875
+ duration: 400,
876
+ enter: "fade",
877
+ update: !0
878
+ } : {
879
+ duration: Se().duration ?? 400,
880
+ enter: Se().enter ?? "fade",
881
+ update: Se().update ?? !0
882
+ } : null), Aa = p.state(!1);
883
+ p.user_effect(() => {
884
+ if (typeof matchMedia != "function") return;
885
+ let e = matchMedia("(prefers-reduced-motion: reduce)");
886
+ p.set(Aa, e.matches, !0);
887
+ let t = () => p.set(Aa, e.matches, !0);
888
+ return e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
889
+ });
890
+ let ja = p.state(null), L = p.derived(() => p.get(ja) && p.get(ja).t < 1 ? ye(p.get(ja).from, p.get(Oa), p.get(ja).t) : p.get(Oa)), Ma = null, Na = 0;
891
+ p.user_effect(() => {
892
+ let e = p.get(Oa);
893
+ le(() => {
894
+ let t = Ma;
895
+ if (Ma = e, !t || !p.get(ka)?.update || p.get(Aa) || p.get(ka).duration <= 0 || jr() || e.bars.length + e.arcs.length > 600 || e.lines.some((e) => e.points.length > 600) || t.type !== e.type) return;
896
+ let n = p.get(ja) && p.get(ja).t < 1 ? ye(p.get(ja).from, t, p.get(ja).t) : t;
897
+ cancelAnimationFrame(Na);
898
+ let r = performance.now(), i = p.get(ka).duration;
899
+ p.set(ja, {
900
+ from: n,
901
+ t: 0
902
+ }, !0);
903
+ let a = (e) => {
904
+ let t = Math.min(1, (e - r) / i), o = 1 - (1 - t) ** 3;
905
+ p.set(ja, t >= 1 ? null : {
906
+ from: n,
907
+ t: o
908
+ }, !0), t < 1 && (Na = requestAnimationFrame(a));
909
+ };
910
+ Na = requestAnimationFrame(a);
911
+ });
912
+ });
913
+ let Pa = p.derived(() => p.get(Aa) || jr() ? "none" : p.get(ka)?.enter ?? "fade"), Fa = p.derived(() => p.get(L).lines.flatMap((e, t) => e.style?.gradient ? [{
914
+ id: `${E}-grad-${t}`,
915
+ ...e.style.gradient
916
+ }] : [])), Ia = p.derived(() => p.get(S).yAxis?.title ?? p.get(S).yAxisTitle), La = p.derived(() => p.get(S).y2Axis?.title ?? p.get(S).y2AxisTitle), Ra = p.derived(() => p.get(S).xAxis?.title ?? p.get(S).xAxisTitle), R = p.derived(() => u(p.get(L))), za = p.derived(() => ({
917
+ geo: p.get(L),
918
+ scales: p.get(R),
919
+ xOf: p.get(R)?.xOf ?? null,
920
+ yOf: p.get(R)?.yOf ?? null
921
+ })), z = p.derived(() => !ca.has(p.get(S).type)), Ba = p.derived(() => p.get(S).type === "sunburst" || p.get(S).type === "radial-bar" || p.get(S).type === "radial-column" || p.get(S).type === "nightingale" || p.get(S).type === "chord"), Va = p.derived(() => p.get(S).type === "bullet"), Ha = p.derived(() => (p.get(S).type === "radial-bar" || p.get(S).type === "radial-column" || p.get(S).type === "nightingale") && p.get(S).series.length === 1), Ua = p.derived(() => p.get(S).type === "scatter"), Wa = p.derived(() => p.get(S).type === "heatmap"), Ga = p.derived(() => p.get(S).type === "funnel"), Ka = p.derived(() => p.get(S).type === "radar"), qa = p.derived(() => p.get(S).type === "calendar"), Ja = p.derived(() => p.get(S).type === "gauge"), Ya = p.derived(() => p.get(S).type === "treemap"), Xa = p.derived(() => p.get(S).type === "sankey"), B = p.derived(() => p.get(L).orientation === "horizontal"), Za = p.derived(() => (p.get(B) ? p.get(L).plot.h : p.get(L).plot.w) / Math.max(1, p.get(I).categories.length)), Qa = p.derived(() => p.get(z) && !p.get(Ua) && !p.get(B) && p.get(Za) < 4 && p.get(I).categories.length > 1), $a = p.derived(() => v() ? v().i1 - v().i0 + 1 : p.get(S).categories.length), eo = p.derived(() => p.get(ni).show && p.get(z) && !p.get(Ua) ? r(p.get(L), p.get(ni), (e, t) => si(t)(e), {
922
+ stacked: !!(p.get(S).stacked || p.get(S).stacked100),
923
+ dense: p.get(Qa),
924
+ share: !!p.get(S).stacked100
925
+ }) : []), to = 1e3;
926
+ function no(e, t, n) {
927
+ let r = n.ownerSVGElement ?? n;
928
+ if (!r || typeof r.getBoundingClientRect != "function") return null;
929
+ let i = r.getBoundingClientRect();
930
+ if (!i.width || !i.height) return null;
931
+ let a = r.viewBox?.baseVal, o = a && a.width ? a.width / i.width : 1, s = a && a.height ? a.height / i.height : 1;
932
+ return {
933
+ x: (e - i.left) * o + (a ? a.x : 0),
934
+ y: (t - i.top) * s + (a ? a.y : 0)
935
+ };
936
+ }
937
+ function ro(e, t) {
938
+ let n = no(e, 0, t);
939
+ if (!n) return null;
940
+ let r = n.x, i = p.get(L).lines[0]?.points, a = p.get(I).categories.length;
941
+ if (!i || i.length !== a) {
942
+ let e = Math.floor((r - p.get(L).plot.x) / p.get(Za));
943
+ return e >= 0 && e < a ? e : null;
944
+ }
945
+ let o = 0, s = i.length - 1;
946
+ for (; o < s;) {
947
+ let e = o + s >> 1;
948
+ i[e].x < r ? o = e + 1 : s = e;
949
+ }
950
+ return o > 0 && Math.abs(i[o - 1].x - r) <= Math.abs(i[o].x - r) && --o, o;
951
+ }
952
+ let V = p.state(0);
953
+ function io(e) {
954
+ if (ms(e, p.get(V)) || ss(e, p.get(V))) return;
955
+ let t = p.get(I).categories.length - 1, n = Math.max(1, Math.floor(t / 10)), r = p.get(V);
956
+ switch (e.key) {
957
+ case "ArrowRight":
958
+ case "ArrowDown":
959
+ r = Math.min(t, p.get(V) + 1);
960
+ break;
961
+ case "ArrowLeft":
962
+ case "ArrowUp":
963
+ r = Math.max(0, p.get(V) - 1);
964
+ break;
965
+ case "Home":
966
+ r = 0;
967
+ break;
968
+ case "End":
969
+ r = t;
970
+ break;
971
+ case "PageDown":
972
+ r = Math.min(t, p.get(V) + n);
973
+ break;
974
+ case "PageUp":
975
+ r = Math.max(0, p.get(V) - n);
976
+ break;
977
+ case "Enter":
978
+ case " ":
979
+ e.preventDefault(), $o(e, p.get(V));
980
+ return;
981
+ default: return;
982
+ }
983
+ e.preventDefault(), p.set(V, r, !0), Uo(e.currentTarget, r);
984
+ }
985
+ let ao = p.state(null), oo = p.derived(() => p.get(di) ?? (Mr() ? p.get(ao) : null)), H = (e) => p.get(oo) && p.get(oo) !== e ? .18 : 1, so = null;
986
+ function co(e) {
987
+ i.onHover && (e === so || e !== null && so !== null && e.category === so.category && e.index === so.index && e.series === so.series && e.value === so.value || (so = e, i.onHover(e)));
988
+ }
989
+ let U = p.derived(() => we() === "multi" ? "multi" : we() ? "single" : null), lo = (e, t, n, r) => e.category === t && e.series === n && (e.index === void 0 || r === void 0 || e.index === r), uo = (e, t, n) => Te().some((r) => lo(r, e, t, n)), fo = (e, t, n) => p.get(U) && Te().length && !uo(e, t, n) ? .35 : 1;
990
+ function po(e, t, n, r) {
991
+ if (!p.get(U)) return;
992
+ let a = r === void 0 ? {
993
+ category: e,
994
+ series: t
995
+ } : {
996
+ category: e,
997
+ series: t,
998
+ index: r
999
+ }, o = p.get(U) === "multi" || !!(n && (n.ctrlKey || n.metaKey || n.shiftKey)), s;
1000
+ s = uo(e, t, r) ? o ? Te().filter((n) => !lo(n, e, t, r)) : [] : o ? [...Te(), a] : [a], Te(s), i.onSelectionChange?.(s);
1001
+ }
1002
+ let W = p.state(null), mo = p.state(""), ho = p.derived(() => p.get(S).type === "heatmap" || p.get(S).type === "calendar" || p.get(S).type === "gauge" ? [] : p.get(S).type === "pie" || p.get(Ha) ? p.get(Ca).map((e, t) => ({
1003
+ label: e,
1004
+ color: p.get(S).categoryColors?.[e] ?? p.get(I).series[0]?.colors?.[t] ?? p.get(fi)[t % p.get(fi).length],
1005
+ off: p.get(ci).has(e)
1006
+ })) : p.get(S).type === "sunburst" || p.get(S).type === "chord" ? p.get(L).legend.map((e) => ({
1007
+ label: e.label,
1008
+ color: e.color,
1009
+ off: !1
1010
+ })) : p.get(D).map((e) => ({
1011
+ label: e.label,
1012
+ color: e.color,
1013
+ off: p.get(ci).has(e.label)
1014
+ }))), go = p.derived(() => be() ? be() === !0 ? [
1015
+ "1W",
1016
+ "1M",
1017
+ "3M",
1018
+ "6M",
1019
+ "YTD",
1020
+ "1Y",
1021
+ "All"
1022
+ ] : be() : []), _o = p.derived(() => p.get(go).length > 0 && p.get(z) && (p.get(S).xType === "time" || p.get(S).xType === "ordinal-time" || p.get(S).xAxis?.type === "time" || p.get(S).xAxis?.type === "ordinal-time")), vo = (e) => typeof e == "string" ? e : e.label;
1023
+ function yo(e) {
1024
+ O(pe(p.get(S).categories, e));
1025
+ }
1026
+ let bo = p.derived(() => p.get(S).type !== "sunburst" && p.get(S).type !== "chord"), xo = p.state(!1), So = p.derived(() => p.get(ho).length > 10), Co = p.derived(() => p.get(So) && !p.get(xo) ? p.get(ho).slice(0, 10) : p.get(ho)), wo = p.derived(() => p.get(S).type === "pie" ? p.get(L).slices.every((e) => e.value <= 0) : p.get(S).type === "scatter" ? p.get(L).scatterPoints.length === 0 : p.get(S).type === "heatmap" ? p.get(L).heatmapCells.length === 0 : p.get(S).type === "funnel" ? p.get(L).funnelSegments.length === 0 : p.get(S).type === "radar" ? p.get(L).radarSeries.length === 0 : p.get(S).type === "calendar" ? p.get(L).calendarCells.length === 0 : p.get(S).type === "gauge" ? !p.get(L).gauge : p.get(S).type === "treemap" ? p.get(L).treemapCells.length === 0 : p.get(S).type === "sankey" ? p.get(L).sankeyNodes.length === 0 : p.get(aa) ? p.get(L).candles.length === 0 : p.get(S).type === "boxplot" ? p.get(L).boxes.length === 0 : p.get(Ba) ? p.get(L).arcs.length === 0 : p.get(Va) ? p.get(L).bullets.length === 0 : p.get(L).bars.length === 0 && p.get(L).stems.length === 0 && p.get(L).lines.every((e) => e.points.every((e) => !e.defined))), To = null;
1027
+ function Eo(e) {
1028
+ if (!m() || !p.get(bo)) return;
1029
+ if (p.get(li) != null) {
1030
+ To = {
1031
+ label: p.get(li),
1032
+ at: Date.now()
1033
+ }, p.set(li, null);
1034
+ return;
1035
+ }
1036
+ let t = new Set(p.get(ci));
1037
+ t.has(e) ? t.delete(e) : t.add(e), p.set(ci, t, !0);
1038
+ }
1039
+ function Do(e) {
1040
+ if (!m() || !p.get(bo)) return;
1041
+ let t = To;
1042
+ To = null;
1043
+ let n = new Set(p.get(ci));
1044
+ if (n.delete(e), t && t.label === e && Date.now() - t.at < 600) {
1045
+ p.set(ci, n, !0);
1046
+ return;
1047
+ }
1048
+ p.set(ci, n, !0), p.set(li, p.get(li) === e ? null : e, !0);
1049
+ }
1050
+ let Oo = (e, t) => Number.isFinite(e) ? si(t)(e) : "", ko = p.derived(() => {
1051
+ if (p.get(S).type === "pie") {
1052
+ let e = p.get(Sa) ? p.get(I).series[0] : p.get(D)[0];
1053
+ return {
1054
+ cols: ["Category", "Value"],
1055
+ rows: p.get(Ca).map((t, n) => [t, Oo(e?.values[n])])
1056
+ };
1057
+ }
1058
+ if (p.get(Ua)) {
1059
+ let e = [];
1060
+ for (let t of p.get(D)) for (let n of t.points ?? []) e.push([
1061
+ t.label,
1062
+ T(n.x),
1063
+ T(n.y),
1064
+ n.r == null ? "" : T(n.r)
1065
+ ]);
1066
+ return {
1067
+ cols: [
1068
+ "Series",
1069
+ "X",
1070
+ "Y",
1071
+ "Size"
1072
+ ],
1073
+ rows: e
1074
+ };
1075
+ }
1076
+ if (p.get(Ba)) return {
1077
+ cols: [
1078
+ p.get(S).type === "chord" ? "Group" : "Category",
1079
+ "Series",
1080
+ "Value"
1081
+ ],
1082
+ rows: p.get(L).arcs.map((e) => [
1083
+ e.nodePath ? e.nodePath.join(" / ") : e.label,
1084
+ e.series,
1085
+ T(e.value)
1086
+ ])
1087
+ };
1088
+ if (p.get(Va)) return {
1089
+ cols: [
1090
+ "Category",
1091
+ "Value",
1092
+ "Target"
1093
+ ],
1094
+ rows: p.get(L).bullets.map((e) => [
1095
+ e.label,
1096
+ T(e.value),
1097
+ e.target == null ? "" : T(e.target)
1098
+ ])
1099
+ };
1100
+ if (p.get(aa)) {
1101
+ let e = [];
1102
+ for (let t of p.get(D)) (t.ohlc ?? []).forEach((n, r) => {
1103
+ n && e.push([
1104
+ p.get(S).categories[r] ?? String(r),
1105
+ t.label,
1106
+ T(n.o),
1107
+ T(n.h),
1108
+ T(n.l),
1109
+ T(n.c)
1110
+ ]);
1111
+ });
1112
+ return {
1113
+ cols: [
1114
+ "Date",
1115
+ "Series",
1116
+ "Open",
1117
+ "High",
1118
+ "Low",
1119
+ "Close"
1120
+ ],
1121
+ rows: e
1122
+ };
1123
+ }
1124
+ if (p.get(S).type === "waterfall") {
1125
+ let e = p.get(D)[0];
1126
+ return {
1127
+ cols: ["Category", e?.label ?? "Value"],
1128
+ rows: p.get(S).categories.map((t, n) => {
1129
+ let r = p.get(L).bars.find((e) => e.index === n);
1130
+ return [t, r ? T(r.value) : Oo(e?.values[n])];
1131
+ })
1132
+ };
1133
+ }
1134
+ return {
1135
+ cols: ["Category", ...p.get(D).map((e) => e.label)],
1136
+ rows: p.get(S).categories.map((e, t) => [e, ...p.get(D).map((e) => Oo(e.values[t], e.label))])
1137
+ };
1138
+ }), Ao = p.derived(() => p.get(ko).rows.length > to), jo = p.derived(() => p.get(Ao) ? p.get(ko).rows.slice(0, to) : p.get(ko).rows);
1139
+ function G(e, t = 12) {
1140
+ return e.length > t ? e.slice(0, t - 1) + "…" : e;
1141
+ }
1142
+ let Mo = (e, t) => i.formatValue ? i.formatValue(e) : t, K = p.state(null);
1143
+ function No(e) {
1144
+ if (!e) return !1;
1145
+ let t = 0, n = 0, r = 0, i = e.trim().startsWith("#") ? e.trim().slice(1) : "";
1146
+ if (i.length === 6) t = parseInt(i.slice(0, 2), 16), n = parseInt(i.slice(2, 4), 16), r = parseInt(i.slice(4, 6), 16);
1147
+ else {
1148
+ let i = /rgba?\(([^)]+)\)/.exec(e);
1149
+ if (!i) return !1;
1150
+ let a = i[1].split(",").map((e) => parseFloat(e));
1151
+ t = a[0] ?? 0, n = a[1] ?? 0, r = a[2] ?? 0;
1152
+ }
1153
+ return .299 * t + .587 * n + .114 * r < 128;
1154
+ }
1155
+ p.user_effect(() => {
1156
+ if (!p.get(K) || typeof window > "u") return;
1157
+ let e = p.get(K), t = () => {
1158
+ let t = getComputedStyle(e);
1159
+ p.set(Da, No(t.getPropertyValue("--sg-bg")), !0);
1160
+ let n = [];
1161
+ for (let e = 1; e <= 8; e += 1) {
1162
+ let r = t.getPropertyValue(`--sg-chart-${e}`).trim();
1163
+ n.push(r || ne[e - 1]);
1164
+ }
1165
+ (!p.get(ui) || n.some((e, t) => e !== p.get(ui)[t])) && p.set(ui, n.some((e, t) => e !== ne[t]) ? n : null, !0);
1166
+ };
1167
+ t();
1168
+ let n = new MutationObserver(t);
1169
+ return n.observe(document.documentElement, {
1170
+ attributes: !0,
1171
+ attributeFilter: [
1172
+ "data-theme",
1173
+ "class",
1174
+ "style"
1175
+ ]
1176
+ }), () => n.disconnect();
1177
+ });
1178
+ let q = p.state(null), J = p.state(null), Y = p.state(null);
1179
+ function X(e, t, n, r, a) {
1180
+ if (!m() || !p.get(K) || r.length === 0 || p.get(J) && p.get(q)) return;
1181
+ let o = p.get(K).getBoundingClientRect(), s = {
1182
+ category: n,
1183
+ index: -1,
1184
+ rows: r,
1185
+ ...a
1186
+ }, c = i.tooltipFormat?.(s), l = h() !== "follow", u, d;
1187
+ if (l && p.get(k)) {
1188
+ let e = p.get(k).getBoundingClientRect(), t = e.width / (p.get(L).width || 1), n = e.height / (p.get(L).height || 1), r = h() === "top-right" || h() === "bottom-right", i = h() === "bottom-left" || h() === "bottom-right";
1189
+ u = e.left - o.left + (r ? (p.get(L).plot.x + p.get(L).plot.w) * t - 8 : p.get(L).plot.x * t + 8), d = e.top - o.top + (i ? (p.get(L).plot.y + p.get(L).plot.h) * n - 8 : p.get(L).plot.y * n + 8);
1190
+ } else u = Math.max(70, Math.min(o.width - 70, e - o.left)), d = t - o.top;
1191
+ p.set(q, {
1192
+ left: u,
1193
+ top: d,
1194
+ below: !l && d < 44,
1195
+ fixed: l,
1196
+ title: c?.title ?? n,
1197
+ rows: c?.rows ?? r,
1198
+ ctx: s
1199
+ }, !0), co({
1200
+ category: s.category,
1201
+ index: s.index,
1202
+ series: s.series ?? null,
1203
+ value: s.value ?? null
1204
+ });
1205
+ }
1206
+ function Po(e, t) {
1207
+ let n = null, r = Infinity;
1208
+ for (let i of p.get(L).lines) {
1209
+ let a = i.points[e];
1210
+ if (!a?.defined) continue;
1211
+ let o = Math.abs(a.y - t);
1212
+ o < r && (r = o, n = i.label);
1213
+ }
1214
+ for (let i of p.get(L).bars) {
1215
+ if (i.label !== p.get(I).categories[e]) continue;
1216
+ let a = t < i.y ? i.y - t : t > i.y + i.h ? t - (i.y + i.h) : 0;
1217
+ a < r && (r = a, n = i.series);
1218
+ }
1219
+ for (let i of p.get(L).candles) {
1220
+ if (i.label !== p.get(I).categories[e]) continue;
1221
+ let a = t < i.yHigh ? i.yHigh - t : t > i.yLow ? t - i.yLow : 0;
1222
+ a < r && (r = a, n = i.series);
1223
+ }
1224
+ return n === null ? null : {
1225
+ label: n,
1226
+ distance: r
1227
+ };
1228
+ }
1229
+ function Fo(e) {
1230
+ let t = [];
1231
+ if (p.get(S).type === "waterfall") {
1232
+ let n = p.get(L).bars.find((t) => t.index === e), r = p.get(I).series[0];
1233
+ return n && r && t.push({
1234
+ label: r.label,
1235
+ color: n.color,
1236
+ value: T(n.value)
1237
+ }), t;
1238
+ }
1239
+ for (let n of p.get(I).series) {
1240
+ let r = n.color, i = n.ohlc?.[e];
1241
+ if (i) {
1242
+ t.push({
1243
+ label: `${n.label} O`,
1244
+ color: r,
1245
+ value: T(i.o)
1246
+ }), t.push({
1247
+ label: `${n.label} H`,
1248
+ value: T(i.h)
1249
+ }), t.push({
1250
+ label: `${n.label} L`,
1251
+ value: T(i.l)
1252
+ }), t.push({
1253
+ label: `${n.label} C`,
1254
+ value: T(i.c)
1255
+ });
1256
+ continue;
1257
+ }
1258
+ let a = n.boxes?.[e];
1259
+ if (a) {
1260
+ t.push({
1261
+ label: `${n.label} max`,
1262
+ color: r,
1263
+ value: T(a.max)
1264
+ }), t.push({
1265
+ label: `${n.label} Q3`,
1266
+ value: T(a.q3)
1267
+ }), t.push({
1268
+ label: `${n.label} median`,
1269
+ value: T(a.median)
1270
+ }), t.push({
1271
+ label: `${n.label} Q1`,
1272
+ value: T(a.q1)
1273
+ }), t.push({
1274
+ label: `${n.label} min`,
1275
+ value: T(a.min)
1276
+ }), a.outliers?.length && t.push({
1277
+ label: `${n.label} outliers`,
1278
+ value: String(a.outliers.length)
1279
+ });
1280
+ continue;
1281
+ }
1282
+ let o = n.values[e], s = si(n.label), c = n.lowValues?.[e];
1283
+ if (Number.isFinite(o) && Number.isFinite(c)) {
1284
+ t.push({
1285
+ label: n.label,
1286
+ color: r,
1287
+ value: `${s(c)} to ${s(o)}`
1288
+ });
1289
+ continue;
1290
+ }
1291
+ let l = n.targets?.[e];
1292
+ if (Number.isFinite(o) && Number.isFinite(l)) {
1293
+ t.push({
1294
+ label: n.label,
1295
+ color: r,
1296
+ value: s(o)
1297
+ }), t.push({
1298
+ label: `${n.label} target`,
1299
+ value: s(l)
1300
+ });
1301
+ continue;
1302
+ }
1303
+ if (Number.isFinite(o)) {
1304
+ t.push({
1305
+ label: n.label,
1306
+ color: r,
1307
+ value: s(o)
1308
+ });
1309
+ let i = n.errors?.[e];
1310
+ if (i != null) {
1311
+ let e = typeof i == "number" ? o - Math.abs(i) : Math.min(i.lo, i.hi), r = typeof i == "number" ? o + Math.abs(i) : Math.max(i.lo, i.hi);
1312
+ Number.isFinite(e) && Number.isFinite(r) && t.push({
1313
+ label: `${n.label} range`,
1314
+ value: `${s(e)} - ${s(r)}`
1315
+ });
1316
+ }
1317
+ }
1318
+ }
1319
+ for (let n of p.get(L).overlays) {
1320
+ let r = n.points[e];
1321
+ if (!r?.defined) continue;
1322
+ let i = p.get(I).series.find((e) => e.overlay && n.label === `${e.label} (${e.overlay})`);
1323
+ if (!i?.overlay) continue;
1324
+ let o = n.r2 === void 0 ? "" : ` (${b(p.get(x).rSquared, { value: n.r2.toFixed(2) })})`;
1325
+ t.push({
1326
+ label: `${i.label} ${a(i.overlay)}`,
1327
+ color: n.color,
1328
+ value: `${si(i.label)(r.value)}${o}`
1329
+ });
1330
+ }
1331
+ return t;
1332
+ }
1333
+ let Io = p.state(null);
1334
+ function Lo(e) {
1335
+ let n = p.get(L).axes?.y, r = n ? Math.abs(n.max - n.min) : 100, i = r >= 100 ? 0 : r >= 10 ? 1 : r >= 1 ? 2 : 3, a = Number(e.toFixed(i)), o = p.get(S).yAxis;
1336
+ return o?.formatter ? o.formatter(a, -1) : o?.format ? t(a, o.format, p.get(S)) : Mo(a, T(a));
1337
+ }
1338
+ let Ro = p.derived(() => p.get(S).xType === "time" || p.get(S).xType === "ordinal-time" || p.get(S).xAxis?.type === "time" || p.get(S).xAxis?.type === "ordinal-time"), zo = p.derived(() => p.get(Ro) ? ee(p.get(I).categories.map((e) => Date.parse(e))) : "day"), Bo = (e) => {
1339
+ let t = Date.parse(e);
1340
+ return Number.isFinite(t) ? f(t) : e;
1341
+ };
1342
+ function Vo(e) {
1343
+ let t = p.get(I).categories[e] ?? "";
1344
+ if (!p.get(Ro)) return t;
1345
+ let n = Date.parse(t);
1346
+ return Number.isFinite(n) ? p.get(S).xAxis?.formatter ? p.get(S).xAxis.formatter(n, e) : f(n, p.get(zo)) : t;
1347
+ }
1348
+ function Ho(e, t, n, r) {
1349
+ p.set(Y, n, !0);
1350
+ let a = ji({
1351
+ clientX: e,
1352
+ clientY: t
1353
+ })?.y;
1354
+ p.set(Io, a != null && Number.isFinite(a) && a >= p.get(L).plot.y && a <= p.get(L).plot.y + p.get(L).plot.h ? a : null, !0);
1355
+ let o = p.get(I).categories[n] ?? "", s = Fo(n), c, l, u = p.get(W) && p.get(I).series.some((e) => e.label === p.get(W)) ? p.get(W) : null;
1356
+ if (u) c = u, l = p.get(I).series.find((e) => e.label === u)?.values[n], s = s.filter((e) => e.label === u || e.label?.startsWith(u + " "));
1357
+ else {
1358
+ let i = r ? no(e, t, r) : ji({
1359
+ clientX: e,
1360
+ clientY: t
1361
+ }), a = i && Number.isFinite(i.y) ? Po(n, i.y) : null;
1362
+ p.set(ao, a && a.distance <= 18 ? a.label : null, !0), me() === "single" && a && r && (c = a.label, l = p.get(I).series.find((e) => e.label === a.label)?.values[n], s = s.filter((e) => e.label === a.label || e.label?.startsWith(a.label + " ")));
1363
+ }
1364
+ if (X(e, t, Vo(n), s, {
1365
+ category: o,
1366
+ index: n,
1367
+ series: c,
1368
+ value: l
1369
+ }), i.syncGroup && !p.get(xi)) {
1370
+ let e = Date.parse(o);
1371
+ _e(i.syncGroup, {
1372
+ label: o,
1373
+ index: (v() ? v().i0 : 0) + n,
1374
+ time: Number.isFinite(e) ? e : null,
1375
+ from: vi
1376
+ });
1377
+ }
1378
+ }
1379
+ function Uo(e, t) {
1380
+ let n = e.getBoundingClientRect();
1381
+ if (Ho(n.left + n.width / 2, n.top + 12, t), !Ee()) return;
1382
+ let r = Vo(t);
1383
+ if (p.get(W)) {
1384
+ let e = p.get(I).series.find((e) => e.label === p.get(W))?.values[t];
1385
+ p.set(mo, b(p.get(x).seriesAtCategory, {
1386
+ series: p.get(W),
1387
+ value: Number.isFinite(e) ? si(p.get(W))(e) : p.get(x).noValue,
1388
+ category: r
1389
+ }), !0);
1390
+ } else p.set(mo, `${r}: ${Fo(t).map((e) => `${e.label ?? ""} ${e.value}`).join(", ")}`);
1391
+ }
1392
+ function Z() {
1393
+ p.get(J) || (p.set(Y, null), p.set(Io, null), p.set(ao, null), p.set(q, null), co(null), i.syncGroup && !p.get(xi) && p.get(bi)?.hover?.from === vi && _e(i.syncGroup, null));
1394
+ }
1395
+ p.user_effect(() => {
1396
+ if (!p.get(bi)) return;
1397
+ let e = p.get(bi).hover;
1398
+ le(() => {
1399
+ if (!e) {
1400
+ p.get(xi) && (p.set(xi, !1), p.set(Y, null), p.set(q, null));
1401
+ return;
1402
+ }
1403
+ if (e.from === vi) return;
1404
+ let t = p.get(I).categories.indexOf(e.label);
1405
+ if (t < 0 && e.time != null && (t = he(p.get(I).categories, e.time)), t < 0 || !p.get(k) || !p.get(R)) return;
1406
+ p.set(xi, !0);
1407
+ let n = p.get(k).getBoundingClientRect(), r = n.width / p.get(L).width, i = n.height / p.get(L).height, a = p.get(R).xOf(t);
1408
+ Ho(n.left + a * r, n.top + (p.get(L).plot.y + 12) * i, t), p.set(xi, !0);
1409
+ });
1410
+ }), p.user_effect(() => {
1411
+ if (!p.get(bi)) return;
1412
+ let e = p.get(bi).zoom;
1413
+ le(() => {
1414
+ if (!e || e.from === vi) return;
1415
+ let t = p.get(S).categories.length, n = e.window;
1416
+ if (n && e.count !== t) {
1417
+ if (!e.labels) return;
1418
+ let r = he(p.get(S).categories, Date.parse(e.labels[0])), i = he(p.get(S).categories, Date.parse(e.labels[1]));
1419
+ if (r < 0 || i < 0) return;
1420
+ n = r === 0 && i === t - 1 ? null : {
1421
+ i0: Math.min(r, i),
1422
+ i1: Math.max(r, i)
1423
+ };
1424
+ }
1425
+ yi = !0;
1426
+ try {
1427
+ O(n);
1428
+ } finally {
1429
+ yi = !1;
1430
+ }
1431
+ });
1432
+ });
1433
+ function Wo(e, t, n, r, i) {
1434
+ X(e, t, n, [{ value: `${T(r)} · ${i.toFixed(1)}%` }], {
1435
+ series: n,
1436
+ value: r
1437
+ });
1438
+ }
1439
+ function Go(e, t, n) {
1440
+ p.set(ao, n.series, !0);
1441
+ let r = [{
1442
+ label: "x",
1443
+ value: T(n.x)
1444
+ }, {
1445
+ label: "y",
1446
+ value: T(n.y)
1447
+ }], i = p.get(I).series.find((e) => e.label === n.series && e.overlay), o = i?.overlay ? p.get(L).overlays.find((e) => e.label === `${i.label} (${i.overlay})`) : void 0;
1448
+ if (i?.overlay && o) {
1449
+ let e = o.r2 === void 0 ? "" : ` (${b(p.get(x).rSquared, { value: o.r2.toFixed(2) })})`;
1450
+ r.push({
1451
+ label: a(i.overlay),
1452
+ color: o.color,
1453
+ value: `${o.equation ?? ""}${e}`
1454
+ });
1455
+ }
1456
+ X(e, t, n.label || n.series, r, {
1457
+ series: n.series,
1458
+ value: n.y
1459
+ });
1460
+ }
1461
+ function Ko(e, t, n) {
1462
+ X(e, t, `${n.rowLabel} · ${n.colLabel}`, [{
1463
+ color: n.color,
1464
+ value: T(n.value)
1465
+ }]);
1466
+ }
1467
+ function qo(e, t, n) {
1468
+ let r = [{ value: T(n.value) }, {
1469
+ label: "conversion",
1470
+ value: `${(n.conversion * 100).toFixed(1)}%`
1471
+ }];
1472
+ n.dropoff > 0 && r.push({
1473
+ label: "drop-off",
1474
+ value: `${(n.dropoff * 100).toFixed(1)}%`
1475
+ }), X(e, t, n.label, r, { value: n.value });
1476
+ }
1477
+ function Jo(e, t, n) {
1478
+ p.set(ao, p.get(Ha) || p.get(S).type === "sunburst" || p.get(S).type === "chord" ? n.label : n.series, !0), X(e, t, n.series ? `${n.label} \u00b7 ${n.series}` : n.label, [{
1479
+ color: n.color,
1480
+ value: T(n.value)
1481
+ }], {
1482
+ category: n.label,
1483
+ series: n.series || void 0,
1484
+ value: n.value
1485
+ });
1486
+ }
1487
+ function Yo(e, t, n) {
1488
+ X(e, t, `${n.source} \u2192 ${n.target}`, [{
1489
+ color: n.color,
1490
+ value: T(n.value)
1491
+ }], {
1492
+ category: n.source,
1493
+ series: n.target,
1494
+ value: n.value
1495
+ });
1496
+ }
1497
+ function Xo(e, t, n) {
1498
+ p.set(ao, n.series, !0);
1499
+ let r = [{
1500
+ color: n.color,
1501
+ label: n.series,
1502
+ value: T(n.value)
1503
+ }];
1504
+ n.target != null && r.push({
1505
+ label: "target",
1506
+ value: T(n.target)
1507
+ }), X(e, t, n.label, r, {
1508
+ category: n.label,
1509
+ series: n.series,
1510
+ value: n.value
1511
+ });
1512
+ }
1513
+ function Zo(e, t, n) {
1514
+ p.set(ao, n.series, !0);
1515
+ let r = [{
1516
+ color: n.color,
1517
+ label: n.series,
1518
+ value: n.dumbbell && n.value2 != null ? `${T(n.value2)} to ${T(n.value)}` : T(n.value)
1519
+ }];
1520
+ X(e, t, n.label, r, {
1521
+ category: n.label,
1522
+ series: n.series,
1523
+ value: n.value
1524
+ });
1525
+ }
1526
+ function Qo(e, t, n, r, i, a) {
1527
+ p.set(ao, n, !0), X(e, t, `${n} · ${r}`, [{
1528
+ color: a,
1529
+ value: T(i)
1530
+ }], {
1531
+ category: r,
1532
+ series: n,
1533
+ value: i
1534
+ });
1535
+ }
1536
+ function $o(e, t) {
1537
+ if (p.get(M)) return;
1538
+ g() && "clientX" in e && !p.get(w) && (p.get(J) && p.get(J).index === t ? na() : (p.set(J, null), Ho(e.clientX, e.clientY, t, e.currentTarget), ra(t)));
1539
+ let n = p.get(I).categories[t] ?? "";
1540
+ if (!p.get(U)) {
1541
+ Q(n, "", 0, t, e);
1542
+ return;
1543
+ }
1544
+ let r = "clientX" in e ? ji(e) : null, i = r ? Po(t, r.y) : null, a = p.get(W) ?? i?.label ?? (p.get(I).series.length === 1 ? p.get(I).series[0].label : "");
1545
+ Q(n, a, p.get(I).series.find((e) => e.label === a)?.values[t] ?? 0, t, e);
1546
+ }
1547
+ function Q(e, t, n, r, a) {
1548
+ if (po(e, t, a, r), p.get(w) && i.onAnnotate && r !== void 0) {
1549
+ let a = t ? n : p.get(I).series[0]?.values[r];
1550
+ i.onAnnotate({
1551
+ category: e,
1552
+ index: r,
1553
+ value: Number.isFinite(a) ? a : 0
1554
+ });
1555
+ return;
1556
+ }
1557
+ let o;
1558
+ if (r !== void 0) {
1559
+ let e = [];
1560
+ for (let n of p.get(I).series) {
1561
+ if (!n.rowIds || t && n.label !== t) continue;
1562
+ let i = n.rowIds[r];
1563
+ i?.length && e.push(i);
1564
+ }
1565
+ e.length && (o = e.flat());
1566
+ }
1567
+ let s = {
1568
+ category: e,
1569
+ series: t,
1570
+ value: n,
1571
+ rowIds: o
1572
+ };
1573
+ i.onSelect?.(s), o && o.length && i.onDrill?.(s);
1574
+ }
1575
+ function es(e, t) {
1576
+ let n = e.ownerSVGElement ?? e.closest("svg");
1577
+ if (!n) return;
1578
+ let r = n.querySelector(`[data-cat-index="${t}"]`);
1579
+ r && (r.focus?.(), Uo(r, t));
1580
+ }
1581
+ function ts(e, t) {
1582
+ if (ms(e, t)) return;
1583
+ let n = p.get(I).categories.length - 1, r = e.currentTarget;
1584
+ if (ss(e, t)) return;
1585
+ let a = p.get(B) ? "ArrowDown" : "ArrowRight", o = p.get(B) ? "ArrowUp" : "ArrowLeft", s = p.get(B) ? "ArrowRight" : "ArrowUp", c = p.get(B) ? "ArrowLeft" : "ArrowDown";
1586
+ switch (e.key) {
1587
+ case a:
1588
+ e.preventDefault(), es(r, Math.min(n, t + 1));
1589
+ return;
1590
+ case o:
1591
+ e.preventDefault(), es(r, Math.max(0, t - 1));
1592
+ return;
1593
+ case s:
1594
+ case c: {
1595
+ e.preventDefault();
1596
+ let n = p.get(I).series.map((e) => e.label);
1597
+ if (!n.length) return;
1598
+ let i = (p.get(W) ? n.indexOf(p.get(W)) : -1) + (e.key === c ? 1 : -1);
1599
+ p.set(W, i < 0 || i >= n.length ? null : n[i], !0), p.set(di, p.get(W), !0), Uo(r, t);
1600
+ return;
1601
+ }
1602
+ case "Home":
1603
+ e.preventDefault(), es(r, 0);
1604
+ return;
1605
+ case "End":
1606
+ e.preventDefault(), es(r, n);
1607
+ return;
1608
+ case "PageDown":
1609
+ e.preventDefault(), es(r, Math.min(n, t + Math.max(1, Math.floor(n / 10))));
1610
+ return;
1611
+ case "PageUp":
1612
+ e.preventDefault(), es(r, Math.max(0, t - Math.max(1, Math.floor(n / 10))));
1613
+ return;
1614
+ case "Enter":
1615
+ case " ":
1616
+ if (!i.onSelect && !p.get(U)) return;
1617
+ e.preventDefault(), $o(e, t);
1618
+ return;
1619
+ case "Escape":
1620
+ p.get(W) && (p.set(W, null), p.set(di, null), Uo(r, t));
1621
+ return;
1622
+ }
1623
+ }
1624
+ let ns = p.state(p.proxy({
1625
+ sel: "",
1626
+ i: 0
1627
+ })), rs = (e, t) => m() ? (p.get(ns).sel === e ? p.get(ns).i : 0) === t ? 0 : -1 : void 0;
1628
+ function is(e, t) {
1629
+ (p.get(ns).sel !== e || p.get(ns).i !== t) && p.set(ns, {
1630
+ sel: e,
1631
+ i: t
1632
+ }, !0);
1633
+ }
1634
+ function as(e, t, n, r, i) {
1635
+ if (e.key === "Enter" || e.key === " ") {
1636
+ r && (e.preventDefault(), r());
1637
+ return;
1638
+ }
1639
+ let a = e.currentTarget, o = a.ownerSVGElement ?? a.closest("svg");
1640
+ if (!o) return;
1641
+ let s = o.querySelectorAll(t), c = s.length;
1642
+ if (!c) return;
1643
+ let l = i && i.colMajor ? i.cols : 1, u = i ? i.colMajor ? 1 : i.cols : 1, d;
1644
+ switch (e.key) {
1645
+ case "ArrowRight":
1646
+ d = n + l;
1647
+ break;
1648
+ case "ArrowLeft":
1649
+ d = n - l;
1650
+ break;
1651
+ case "ArrowDown":
1652
+ d = n + u;
1653
+ break;
1654
+ case "ArrowUp":
1655
+ d = n - u;
1656
+ break;
1657
+ case "Home":
1658
+ d = 0;
1659
+ break;
1660
+ case "End":
1661
+ d = c - 1;
1662
+ break;
1663
+ case "PageDown":
1664
+ d = n + Math.max(1, Math.floor(c / 10));
1665
+ break;
1666
+ case "PageUp":
1667
+ d = n - Math.max(1, Math.floor(c / 10));
1668
+ break;
1669
+ default: return;
1670
+ }
1671
+ e.preventDefault(), d = Math.max(0, Math.min(c - 1, d)), d !== n && (p.set(ns, {
1672
+ sel: t,
1673
+ i: d
1674
+ }, !0), s[d].focus?.());
1675
+ }
1676
+ let os = (e) => {
1677
+ let t = e.getBoundingClientRect();
1678
+ return {
1679
+ x: t.left + t.width / 2,
1680
+ y: t.top
1681
+ };
1682
+ };
1683
+ function ss(e, t) {
1684
+ if (!p.get(C) || !p.get(z)) return !1;
1685
+ let n = p.get(S).categories.length, r = (v()?.i0 ?? 0) + t, i, a = p.get(B) ? "ArrowDown" : "ArrowRight", o = p.get(B) ? "ArrowUp" : "ArrowLeft";
1686
+ if (e.key === "+" || e.key === "=") i = ue(v(), n, r, .8);
1687
+ else if (e.key === "-" || e.key === "_") i = ue(v(), n, r, 1.25);
1688
+ else if (e.key === "0") i = null;
1689
+ else if (e.shiftKey && v() && (e.key === a || e.key === o)) {
1690
+ let t = v().i1 - v().i0 + 1;
1691
+ i = de(v(), n, (e.key === a ? 1 : -1) * Math.max(1, Math.floor(t / 10)));
1692
+ }
1693
+ if (i === void 0) return !1;
1694
+ e.preventDefault(), O(i);
1695
+ let s = Math.max(0, Math.min(i ? i.i1 - i.i0 : n - 1, r - (i?.i0 ?? 0)));
1696
+ return ce().then(() => {
1697
+ let e = p.get(k)?.querySelector(p.get(Qa) ? "[data-dense=\"true\"]" : `[data-cat-index="${s}"]`);
1698
+ e && (e.focus?.(), p.get(Qa) && p.set(V, s, !0), Uo(e, s));
1699
+ }), !0;
1700
+ }
1701
+ function cs(e) {
1702
+ let t = p.get(S).categories.length;
1703
+ if (!t) return;
1704
+ let n = v() ?? {
1705
+ i0: 0,
1706
+ i1: t - 1
1707
+ }, r = n.i1 - n.i0 + 1, i = (n.i0 + n.i1) / 2, a = e.shiftKey ? r : Math.max(1, Math.floor(r / 10)), o;
1708
+ switch (e.key) {
1709
+ case "ArrowRight":
1710
+ o = de(v(), t, a);
1711
+ break;
1712
+ case "ArrowLeft":
1713
+ o = de(v(), t, -a);
1714
+ break;
1715
+ case "ArrowUp":
1716
+ case "+":
1717
+ case "=":
1718
+ o = ue(v(), t, i, .8);
1719
+ break;
1720
+ case "ArrowDown":
1721
+ case "-":
1722
+ case "_":
1723
+ o = ue(v(), t, i, 1.25);
1724
+ break;
1725
+ case "Home":
1726
+ o = v() ? {
1727
+ ...v(),
1728
+ i0: 0,
1729
+ i1: r - 1
1730
+ } : null;
1731
+ break;
1732
+ case "End":
1733
+ o = v() ? {
1734
+ ...v(),
1735
+ i0: t - r,
1736
+ i1: t - 1
1737
+ } : null;
1738
+ break;
1739
+ case "0":
1740
+ case "Escape":
1741
+ o = null;
1742
+ break;
1743
+ default: return;
1744
+ }
1745
+ e.preventDefault(), O(o);
1746
+ }
1747
+ let ls = p.state("idle"), us = p.state(null), ds = p.state(null);
1748
+ function fs(e) {
1749
+ if (!xe()) return;
1750
+ e.preventDefault();
1751
+ let t = p.get(z) && !p.get(Ua) ? ro(e.clientX, e.currentTarget) : null;
1752
+ ps(e.clientX, e.clientY, t);
1753
+ }
1754
+ function ps(e, t, n) {
1755
+ let r = n == null ? {} : {
1756
+ category: p.get(I).categories[n],
1757
+ index: (v() ? v().i0 : 0) + n,
1758
+ ...p.get(W) ? {
1759
+ series: p.get(W),
1760
+ value: p.get(I).series.find((e) => e.label === p.get(W))?.values[n]
1761
+ } : {}
1762
+ }, i = () => p.set(us, {
1763
+ x: e,
1764
+ y: t,
1765
+ target: r
1766
+ }, !0);
1767
+ p.get(ds) ? i() : import("./SvChartMenu-FBSMINA6.js").then((e) => {
1768
+ p.set(ds, e.default, !0), i();
1769
+ });
1770
+ }
1771
+ function ms(e, t) {
1772
+ if (!xe() || !(e.key === "ContextMenu" || e.key === "F10" && e.shiftKey)) return !1;
1773
+ e.preventDefault();
1774
+ let n = e.currentTarget.getBoundingClientRect();
1775
+ return ps(n.left + n.width / 2, n.top + Math.min(n.height / 2, 24), t), !0;
1776
+ }
1777
+ let hs = p.derived(() => {
1778
+ if (!p.get(us)) return [];
1779
+ let e = [
1780
+ {
1781
+ label: p.get(x).downloadPng,
1782
+ onSelect: () => {
1783
+ ys("png");
1784
+ }
1785
+ },
1786
+ {
1787
+ label: p.get(x).downloadSvg,
1788
+ onSelect: () => {
1789
+ ys("svg");
1790
+ }
1791
+ },
1792
+ {
1793
+ label: p.get(x).downloadPdf,
1794
+ onSelect: () => {
1795
+ bs();
1796
+ }
1797
+ },
1798
+ ...se(p.get(S)) ? [{
1799
+ label: p.get(x).downloadCsv,
1800
+ onSelect: () => {
1801
+ oe(p.get(S));
1802
+ }
1803
+ }] : [],
1804
+ {
1805
+ label: p.get(x).copyAsImage,
1806
+ onSelect: () => {
1807
+ Ss();
1808
+ }
1809
+ },
1810
+ {
1811
+ label: p.get(x).print,
1812
+ onSelect: () => {
1813
+ xs();
1814
+ }
1815
+ },
1816
+ ...Ar() && p.get(zr) ? [{
1817
+ label: p.get(x).describeChart,
1818
+ onSelect: () => {
1819
+ Br();
1820
+ }
1821
+ }] : []
1822
+ ];
1823
+ _() && p.get(_i) && e.push({ separator: !0 }, {
1824
+ label: p.get(x).resetZoom,
1825
+ onSelect: Ci
1826
+ }), p.get(_o) && e.push({ separator: !0 }, {
1827
+ label: p.get(x).range,
1828
+ children: p.get(go).map((e) => ({
1829
+ label: vo(e),
1830
+ onSelect: () => yo(e)
1831
+ }))
1832
+ }), p.get(bo) && p.get(ho).length > 1 && e.push({ separator: !0 }, {
1833
+ label: p.get(x).series,
1834
+ children: p.get(ho).map((e) => ({
1835
+ label: `${e.off ? " " : "✓"} ${e.label}`,
1836
+ onSelect: () => Eo(e.label)
1837
+ }))
1838
+ });
1839
+ let t = typeof xe() == "function" ? xe()(p.get(us).target) : Array.isArray(xe()) ? xe() : [];
1840
+ return t.length && e.push({ separator: !0 }, ...t), e;
1841
+ });
1842
+ function gs() {
1843
+ if (!p.get(k)) return null;
1844
+ let e = p.get(k).cloneNode(!0);
1845
+ e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.removeAttribute("class");
1846
+ let t = p.get(k).getBoundingClientRect();
1847
+ t.width && e.setAttribute("width", String(Math.round(t.width))), t.height && e.setAttribute("height", String(Math.round(t.height)));
1848
+ let n = document.createElement("style"), r = Array.from(document.styleSheets), i = [];
1849
+ for (let e of r) try {
1850
+ for (let t of Array.from(e.cssRules ?? [])) {
1851
+ let e = t.cssText;
1852
+ e.includes(".sv-grid-chart") && i.push(e);
1853
+ }
1854
+ } catch {}
1855
+ if (n.textContent = i.join("\n"), e.insertBefore(n, e.firstChild), p.get(K) && typeof getComputedStyle == "function") {
1856
+ let t = getComputedStyle(p.get(K)), n = [
1857
+ "--sg-bg",
1858
+ "--sg-fg",
1859
+ "--sg-muted",
1860
+ "--sg-border",
1861
+ "--sg-accent",
1862
+ "--sg-chart-bg",
1863
+ "--sg-chart-font-scale"
1864
+ ].map((e) => {
1865
+ let n = t.getPropertyValue(e).trim();
1866
+ return n ? `${e}:${n}` : "";
1867
+ }).filter(Boolean);
1868
+ t.fontFamily && n.push(`font-family:${t.fontFamily}`), n.length && e.setAttribute("style", n.join(";"));
1869
+ }
1870
+ return new XMLSerializer().serializeToString(e);
1871
+ }
1872
+ function _s(e, t) {
1873
+ let n = URL.createObjectURL(e), r = document.createElement("a");
1874
+ r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
1875
+ }
1876
+ async function vs(e) {
1877
+ return new Promise((t) => {
1878
+ let n = p.get(k)?.getBoundingClientRect(), r = Math.max(1, Math.round(n?.width ?? p.get(L).width)), i = Math.max(1, Math.round(n?.height ?? p.get(L).height)), a = window.devicePixelRatio || 1, o = document.createElement("canvas");
1879
+ o.width = r * a, o.height = i * a;
1880
+ let s = o.getContext("2d");
1881
+ if (!s) {
1882
+ t(null);
1883
+ return;
1884
+ }
1885
+ let c = new Image();
1886
+ c.onload = () => {
1887
+ s.scale(a, a), s.drawImage(c, 0, 0, r, i), o.toBlob((e) => t(e), "image/png");
1888
+ }, c.onerror = () => t(null), c.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(e);
1889
+ });
1890
+ }
1891
+ async function ys(e) {
1892
+ let t = gs();
1893
+ if (!t) return;
1894
+ let n = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
1895
+ if (e === "svg") {
1896
+ _s(new Blob([t], { type: "image/svg+xml" }), `chart-${n}.svg`);
1897
+ return;
1898
+ }
1899
+ let r = await vs(t);
1900
+ r && _s(r, `chart-${n}.png`);
1901
+ }
1902
+ async function bs() {
1903
+ if (!p.get(K)) return;
1904
+ let e = await import("./chart-export-pdf-DONFUnNY.js").then((e) => e.r), t = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
1905
+ await e.downloadChartPdf(p.get(K), `chart-${t}.pdf`, {
1906
+ title: p.get(S).title,
1907
+ subtitle: p.get(S).subtitle,
1908
+ caption: p.get(S).caption
1909
+ });
1910
+ }
1911
+ async function xs() {
1912
+ p.get(K) && (await import("./chart-export-pdf-DONFUnNY.js").then((e) => e.r)).printChart(p.get(K), { title: p.get(S).title });
1913
+ }
1914
+ async function Ss() {
1915
+ let e = gs();
1916
+ if (!e) {
1917
+ p.set(ls, "err");
1918
+ return;
1919
+ }
1920
+ try {
1921
+ let t = await vs(e);
1922
+ if (!t) throw Error("rasterize failed");
1923
+ let n = window.ClipboardItem;
1924
+ n && navigator.clipboard?.write ? await navigator.clipboard.write([new n({ "image/png": t })]) : await navigator.clipboard.writeText(e), p.set(ls, "ok");
1925
+ } catch {
1926
+ p.set(ls, "err");
1927
+ }
1928
+ setTimeout(() => p.set(ls, "idle"), 1500);
1929
+ }
1930
+ var Cs = {
1931
+ zoomTo: Si,
1932
+ resetZoom: Ci
1933
+ }, ws = Or();
1934
+ let Ts;
1935
+ {
1936
+ let e = (e) => {
1937
+ var t = je(), n = p.child(t), r = p.child(n, !0);
1938
+ p.reset(n);
1939
+ var i = p.sibling(n, 2);
1940
+ p.each(i, 17, y, p.index, (e, t, n) => {
1941
+ var r = Ae(), i = p.sibling(p.first_child(r), 2), a = (e) => {
1942
+ var n = Oe(), r = p.child(n, !0);
1943
+ p.reset(n), p.template_effect(() => p.set_text(r, p.get(t))), p.append(e, n);
1944
+ }, o = (e) => {
1945
+ var r = ke(), i = p.child(r, !0);
1946
+ p.reset(r), p.template_effect(() => p.set_text(i, p.get(t))), p.delegated("click", r, () => Ta(y().slice(0, n + 1))), p.append(e, r);
1947
+ };
1948
+ p.if(i, (e) => {
1949
+ n === y().length - 1 ? e(a) : e(o, -1);
1950
+ }), p.append(e, r);
1951
+ }), p.reset(t), p.template_effect(() => {
1952
+ p.set_attribute(t, "aria-label", p.get(x).drillPath), p.set_text(r, p.get(va)?.name || p.get(x).drillRoot);
1953
+ }), p.delegated("click", n, () => Ta([])), p.append(e, t);
1954
+ };
1955
+ var Es = p.child(ws), Ds = (t) => {
1956
+ var n = Be(), r = p.child(n), i = (t) => {
1957
+ e(t);
1958
+ };
1959
+ p.if(r, (e) => {
1960
+ p.get(ya) && y().length && e(i);
1961
+ });
1962
+ var a = p.sibling(r, 2), o = (e) => {
1963
+ var t = Ne();
1964
+ p.each(t, 21, () => p.get(go), (e) => vo(e), (e, t) => {
1965
+ var n = Me(), r = p.child(n, !0);
1966
+ p.reset(n), p.template_effect((e, t) => {
1967
+ p.set_attribute(n, "title", e), p.set_text(r, t);
1968
+ }, [() => b(p.get(x).showLast, { preset: vo(p.get(t)) }), () => vo(p.get(t))]), p.delegated("click", n, () => yo(p.get(t))), p.append(e, n);
1969
+ }), p.reset(t), p.template_effect(() => p.set_attribute(t, "aria-label", p.get(x).dateRange)), p.append(e, t);
1970
+ };
1971
+ p.if(a, (e) => {
1972
+ p.get(_o) && e(o);
1973
+ });
1974
+ var s = p.sibling(a, 2), c = (e) => {
1975
+ var t = Pe();
1976
+ let n;
1977
+ var r = p.sibling(p.child(t));
1978
+ p.reset(t), p.template_effect(() => {
1979
+ n = p.set_class(t, 1, "sv-grid-chart-tool svelte-hyytey", null, n, { "is-on": p.get(ri) }), p.set_attribute(t, "aria-pressed", p.get(ri)), p.set_attribute(t, "title", p.get(x).panTitle), p.set_text(r, ` ${p.get(x).pan ?? ""}`);
1980
+ }), p.delegated("click", t, () => p.set(ri, !p.get(ri))), p.append(e, t);
1981
+ };
1982
+ p.if(s, (e) => {
1983
+ p.get(C) && (p.get(C).pan === "mode" || p.get(C).pan === !0) && p.get(_i) && e(c);
1984
+ });
1985
+ var l = p.sibling(s, 2), u = (e) => {
1986
+ var t = Fe(), n = p.sibling(p.child(t));
1987
+ p.reset(t), p.template_effect(() => {
1988
+ p.set_attribute(t, "title", p.get(x).resetZoomTitle), p.set_text(n, ` ${p.get(x).resetZoom ?? ""}`);
1989
+ }), p.delegated("click", t, Ci), p.append(e, t);
1990
+ };
1991
+ p.if(l, (e) => {
1992
+ _() && p.get(_i) && e(u);
1993
+ });
1994
+ var d = p.sibling(l, 2), f = (e) => {
1995
+ var t = Ie();
1996
+ let n;
1997
+ var r = p.sibling(p.child(t));
1998
+ p.reset(t), p.template_effect(() => {
1999
+ n = p.set_class(t, 1, "sv-grid-chart-tool svelte-hyytey", null, n, { "is-on": p.get(w) }), p.set_attribute(t, "aria-pressed", p.get(w)), p.set_attribute(t, "title", p.get(w) ? p.get(x).annotateOnTitle : p.get(x).annotateOffTitle), p.set_text(r, ` ${p.get(x).annotate ?? ""}`);
2000
+ }), p.delegated("click", t, () => p.set(w, !p.get(w))), p.append(e, t);
2001
+ };
2002
+ p.if(d, (e) => {
2003
+ Lr() && e(f);
2004
+ });
2005
+ var ee = p.sibling(d, 2), te = (e) => {
2006
+ var t = ze(), n = p.child(t);
2007
+ p.each(n, 16, () => p.get(zi), (e) => e, (e, t) => {
2008
+ var n = Le();
2009
+ let r;
2010
+ var i = p.child(n, !0);
2011
+ p.reset(n), p.template_effect((e) => {
2012
+ r = p.set_class(n, 1, "sv-grid-chart-tool sv-grid-chart-drawtool svelte-hyytey", null, r, { "is-on": p.get(M) === t }), p.set_attribute(n, "aria-pressed", p.get(M) === t), p.set_attribute(n, "title", e), p.set_text(i, p.get(Ri)[t]);
2013
+ }, [() => b(p.get(x).draw, { tool: p.get(Ri)[t] })]), p.delegated("click", n, () => Xi(t)), p.append(e, n);
2014
+ });
2015
+ var r = p.sibling(n, 2), i = (e) => {
2016
+ var t = Re(), n = p.first_child(t), r = p.child(n, !0);
2017
+ p.reset(n);
2018
+ var i = p.sibling(n, 2), a = p.child(i, !0);
2019
+ p.reset(i), p.template_effect(() => {
2020
+ n.disabled = !p.get(Bi), p.set_attribute(n, "title", p.get(x).deleteDrawingTitle), p.set_text(r, p.get(x).deleteDrawing), p.set_attribute(i, "title", p.get(x).clearDrawingsTitle), p.set_text(a, p.get(x).clearDrawings);
2021
+ }), p.delegated("click", n, () => p.get(Bi) && $i(p.get(Bi))), p.delegated("click", i, () => Yi([])), p.append(e, t);
2022
+ }, a = p.derived(() => Ki().length);
2023
+ p.if(r, (e) => {
2024
+ p.get(a) && e(i);
2025
+ }), p.reset(t), p.template_effect(() => p.set_attribute(t, "aria-label", p.get(x).drawingTools)), p.append(e, t);
2026
+ };
2027
+ p.if(ee, (e) => {
2028
+ p.get(zi).length && p.get(z) && e(te);
2029
+ });
2030
+ var ne = p.sibling(ee, 2), re = p.child(ne, !0);
2031
+ p.reset(ne);
2032
+ var ie = p.sibling(ne, 2), ae = p.child(ie, !0);
2033
+ p.reset(ie);
2034
+ var oe = p.sibling(ie, 2), se = p.child(oe, !0);
2035
+ p.reset(oe);
2036
+ var ce = p.sibling(oe, 2), le = p.child(ce, !0);
2037
+ p.reset(ce);
2038
+ var m = p.sibling(ce, 2), ue = p.child(m, !0);
2039
+ p.reset(m), p.reset(n), p.template_effect(() => {
2040
+ p.set_attribute(ne, "title", p.get(x).downloadPng), p.set_text(re, p.get(x).png), p.set_attribute(ie, "title", p.get(x).downloadSvg), p.set_text(ae, p.get(x).svg), p.set_attribute(oe, "title", p.get(x).downloadPdf), p.set_text(se, p.get(x).pdf), p.set_attribute(ce, "title", p.get(x).printTitle), p.set_text(le, p.get(x).print), p.set_attribute(m, "title", p.get(x).copyTitle), p.set_text(ue, p.get(ls) === "ok" ? p.get(x).copied : p.get(x).copy);
2041
+ }), p.delegated("click", ne, () => ys("png")), p.delegated("click", ie, () => ys("svg")), p.delegated("click", oe, bs), p.delegated("click", ce, xs), p.delegated("click", m, Ss), p.bind_element_size(n, "clientHeight", (e) => p.set(Yr, e)), p.append(t, n);
2042
+ }, Os = (t) => {
2043
+ var n = Ve(), r = p.child(n);
2044
+ e(r), p.reset(n), p.bind_element_size(n, "clientHeight", (e) => p.set(Yr, e)), p.append(t, n);
2045
+ };
2046
+ p.if(Es, (e) => {
2047
+ p.get(ii) ? e(Ds) : p.get(ya) && y().length && e(Os, 1);
2048
+ });
2049
+ var $ = p.sibling(Es, 2);
2050
+ let t, r;
2051
+ var ks = p.child($), As = (e) => {
2052
+ var t = Je(), n = p.child(t), r = (e) => {
2053
+ var t = He(), n = p.child(t);
2054
+ let r;
2055
+ p.reset(t), p.template_effect(() => {
2056
+ p.set_attribute(t, "id", `${E}-plot`), p.set_attribute(n, "x", p.get(L).plot.x - 4), p.set_attribute(n, "y", p.get(L).plot.y - 4), p.set_attribute(n, "width", p.get(L).plot.w + 8), p.set_attribute(n, "height", p.get(L).plot.h + 8), r = p.set_class(n, 0, "svelte-hyytey", null, r, { "sv-grid-chart-wipe": p.get(Pa) === "wipe" });
2057
+ }), p.append(e, t);
2058
+ };
2059
+ p.if(n, (e) => {
2060
+ p.get(z) && e(r);
2061
+ });
2062
+ var i = p.sibling(n);
2063
+ p.each(i, 17, () => p.get(Fa), (e) => e.id, (e, t) => {
2064
+ var n = Ue(), r = p.child(n), i = p.sibling(r);
2065
+ p.reset(n), p.template_effect(() => {
2066
+ p.set_attribute(n, "id", p.get(t).id), p.set_attribute(r, "stop-color", p.get(t).from), p.set_attribute(i, "stop-color", p.get(t).to === "transparent" ? p.get(t).from : p.get(t).to), p.set_attribute(i, "stop-opacity", p.get(t).to === "transparent" ? 0 : 1);
2067
+ }), p.append(e, n);
2068
+ });
2069
+ var a = p.sibling(i);
2070
+ p.each(a, 17, () => p.get(hi), (e) => e.id, (e, t) => {
2071
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
2072
+ var n = We(), r = p.child(n);
2073
+ p.next(), p.reset(n), p.template_effect(() => {
2074
+ p.set_attribute(n, "id", p.get(t).id), p.set_attribute(r, "fill", p.get(t).color);
2075
+ }), p.append(e, n);
2076
+ }, a = (e) => {
2077
+ var n = Ge(), r = p.child(n);
2078
+ p.next(), p.reset(n), p.template_effect(() => {
2079
+ p.set_attribute(n, "id", p.get(t).id), p.set_attribute(r, "fill", p.get(t).color);
2080
+ }), p.append(e, n);
2081
+ }, o = (e) => {
2082
+ var n = Ke(), r = p.child(n);
2083
+ p.next(), p.reset(n), p.template_effect(() => {
2084
+ p.set_attribute(n, "id", p.get(t).id), p.set_attribute(r, "fill", p.get(t).color);
2085
+ }), p.append(e, n);
2086
+ }, s = (e) => {
2087
+ var n = qe(), r = p.child(n);
2088
+ p.next(), p.reset(n), p.template_effect(() => {
2089
+ p.set_attribute(n, "id", p.get(t).id), p.set_attribute(r, "fill", p.get(t).color);
2090
+ }), p.append(e, n);
2091
+ };
2092
+ p.if(r, (e) => {
2093
+ p.get(t).kind === "stripe" ? e(i) : p.get(t).kind === "crosshatch" ? e(a, 1) : p.get(t).kind === "dots" ? e(o, 2) : p.get(t).kind === "diagonal" && e(s, 3);
2094
+ }), p.append(e, n);
2095
+ }), p.reset(t), p.append(e, t);
2096
+ };
2097
+ p.if(ks, (e) => {
2098
+ (p.get(hi).length || p.get(Fa).length || p.get(z)) && e(As);
2099
+ });
2100
+ var js = p.sibling(ks), Ms = (e) => {
2101
+ var t = Ye(), n = p.child(t, !0);
2102
+ p.reset(t), p.template_effect(() => {
2103
+ p.set_attribute(t, "x", p.get(L).frame.title.x), p.set_attribute(t, "y", p.get(L).frame.title.y), p.set_text(n, p.get(L).frame.title.text);
2104
+ }), p.append(e, t);
2105
+ };
2106
+ p.if(js, (e) => {
2107
+ p.get(L).frame.title && e(Ms);
2108
+ });
2109
+ var Ns = p.sibling(js), Ps = (e) => {
2110
+ var t = Xe(), n = p.child(t, !0);
2111
+ p.reset(t), p.template_effect(() => {
2112
+ p.set_attribute(t, "x", p.get(L).frame.subtitle.x), p.set_attribute(t, "y", p.get(L).frame.subtitle.y), p.set_text(n, p.get(L).frame.subtitle.text);
2113
+ }), p.append(e, t);
2114
+ };
2115
+ p.if(Ns, (e) => {
2116
+ p.get(L).frame.subtitle && e(Ps);
2117
+ });
2118
+ var Fs = p.sibling(Ns), Is = (e) => {
2119
+ var t = Ze(), n = p.child(t, !0);
2120
+ p.reset(t), p.template_effect(() => {
2121
+ p.set_attribute(t, "x", p.get(L).frame.caption.x), p.set_attribute(t, "y", p.get(L).frame.caption.y), p.set_text(n, p.get(L).frame.caption.text);
2122
+ }), p.append(e, t);
2123
+ };
2124
+ p.if(Fs, (e) => {
2125
+ p.get(L).frame.caption && e(Is);
2126
+ });
2127
+ var Ls = p.sibling(Fs), Rs = (e) => {
2128
+ var t = it(), n = p.first_child(t);
2129
+ p.each(n, 17, () => p.get(L).valueTicks, (e) => e.label + e.x, (e, t, n, r) => {
2130
+ var i = $e(), a = p.first_child(i), o = (e) => {
2131
+ var n = Qe();
2132
+ p.template_effect(() => {
2133
+ p.set_attribute(n, "x1", p.get(t).x), p.set_attribute(n, "y1", p.get(L).plot.y), p.set_attribute(n, "x2", p.get(t).x), p.set_attribute(n, "y2", p.get(L).plot.y + p.get(L).plot.h);
2134
+ }), p.append(e, n);
2135
+ };
2136
+ p.if(a, (e) => {
2137
+ p.get(L).grid.x && e(o);
2138
+ });
2139
+ var s = p.sibling(a), c = p.child(s, !0);
2140
+ p.reset(s), p.template_effect(() => {
2141
+ p.set_attribute(s, "x", p.get(t).x), p.set_attribute(s, "y", p.get(L).plot.y + p.get(L).plot.h + 14), p.set_text(c, p.get(t).label);
2142
+ }), p.append(e, i);
2143
+ });
2144
+ var r = p.sibling(n), i = (e) => {
2145
+ var t = p.comment(), n = p.first_child(t);
2146
+ p.each(n, 17, () => p.get(L).catTicks, (e) => e.value, (e, t, n, r) => {
2147
+ var i = et();
2148
+ p.template_effect(() => {
2149
+ p.set_attribute(i, "x1", p.get(L).plot.x), p.set_attribute(i, "y1", p.get(t).y), p.set_attribute(i, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(i, "y2", p.get(t).y);
2150
+ }), p.append(e, i);
2151
+ }), p.append(e, t);
2152
+ };
2153
+ p.if(r, (e) => {
2154
+ p.get(L).grid.y && e(i);
2155
+ });
2156
+ var a = p.sibling(r);
2157
+ p.each(a, 17, () => p.get(L).catTicks, (e) => e.value, (e, t, n, r) => {
2158
+ var i = tt(), a = p.child(i, !0);
2159
+ p.reset(i), p.template_effect((e) => {
2160
+ p.set_attribute(i, "x", p.get(L).plot.x - 6), p.set_attribute(i, "y", p.get(t).y + 3), p.set_text(a, e);
2161
+ }, [() => G(p.get(t).label, 18)]), p.append(e, i);
2162
+ });
2163
+ var o = p.sibling(a), s = (e) => {
2164
+ var t = nt();
2165
+ p.set_attribute(t, "x", 13);
2166
+ var n = p.child(t, !0);
2167
+ p.reset(t), p.template_effect(() => {
2168
+ p.set_attribute(t, "y", p.get(L).plot.y + p.get(L).plot.h / 2), p.set_attribute(t, "transform", `rotate(-90 13 ${p.get(L).plot.y + p.get(L).plot.h / 2})`), p.set_text(n, p.get(Ia));
2169
+ }), p.append(e, t);
2170
+ };
2171
+ p.if(o, (e) => {
2172
+ p.get(Ia) && e(s);
2173
+ });
2174
+ var c = p.sibling(o), l = (e) => {
2175
+ var t = rt(), n = p.child(t, !0);
2176
+ p.reset(t), p.template_effect(() => {
2177
+ p.set_attribute(t, "x", p.get(L).plot.x + p.get(L).plot.w / 2), p.set_attribute(t, "y", p.get(L).height - 3 - p.get(L).frame.bottom), p.set_text(n, p.get(Ra));
2178
+ }), p.append(e, t);
2179
+ };
2180
+ p.if(c, (e) => {
2181
+ p.get(Ra) && e(l);
2182
+ }), p.append(e, t);
2183
+ }, zs = (e) => {
2184
+ var t = _t(), n = p.first_child(t);
2185
+ p.each(n, 17, () => p.get(L).yTicks, (e) => e.value, (e, t, n, r) => {
2186
+ var i = st(), a = p.first_child(i), o = (e) => {
2187
+ var n = at();
2188
+ let r;
2189
+ p.template_effect(() => {
2190
+ r = p.set_class(n, 0, "sv-grid-chart-gridline svelte-hyytey", null, r, { "is-zero": p.get(t).value === 0 }), p.set_attribute(n, "x1", p.get(L).plot.x), p.set_attribute(n, "y1", p.get(t).y), p.set_attribute(n, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(n, "y2", p.get(t).y);
2191
+ }), p.append(e, n);
2192
+ };
2193
+ p.if(a, (e) => {
2194
+ (p.get(L).grid.y || p.get(t).value === 0) && e(o);
2195
+ });
2196
+ var s = p.sibling(a), c = (e) => {
2197
+ var n = ot(), r = p.child(n, !0);
2198
+ p.reset(n), p.template_effect((e) => {
2199
+ p.set_attribute(n, "x", p.get(L).plot.x - 6), p.set_attribute(n, "y", p.get(t).y + 3), p.set_text(r, e);
2200
+ }, [() => Mo(p.get(t).value, p.get(t).label)]), p.append(e, n);
2201
+ };
2202
+ p.if(s, (e) => {
2203
+ p.get(t).label && e(c);
2204
+ }), p.append(e, i);
2205
+ });
2206
+ var r = p.sibling(n), i = (e) => {
2207
+ var t = p.comment(), n = p.first_child(t);
2208
+ p.each(n, 17, () => p.get(L).xTicks, (e) => e.label + e.x, (e, t, n, r) => {
2209
+ var i = ct();
2210
+ p.template_effect(() => {
2211
+ p.set_attribute(i, "x1", p.get(t).x), p.set_attribute(i, "y1", p.get(L).plot.y), p.set_attribute(i, "x2", p.get(t).x), p.set_attribute(i, "y2", p.get(L).plot.y + p.get(L).plot.h);
2212
+ }), p.append(e, i);
2213
+ }), p.append(e, t);
2214
+ };
2215
+ p.if(r, (e) => {
2216
+ p.get(L).grid.x && e(i);
2217
+ });
2218
+ var a = p.sibling(r), o = (e) => {
2219
+ var t = p.comment(), n = p.first_child(t);
2220
+ p.each(n, 17, () => p.get(L).y2Ticks, (e) => e.value, (e, t, n, r) => {
2221
+ var i = p.comment(), a = p.first_child(i), o = (e) => {
2222
+ var n = lt(), r = p.child(n, !0);
2223
+ p.reset(n), p.template_effect((e) => {
2224
+ p.set_attribute(n, "x", p.get(L).plot.x + p.get(L).plot.w + 6), p.set_attribute(n, "y", p.get(t).y + 3), p.set_text(r, e);
2225
+ }, [() => Mo(p.get(t).value, p.get(t).label)]), p.append(e, n);
2226
+ };
2227
+ p.if(a, (e) => {
2228
+ p.get(t).label && e(o);
2229
+ }), p.append(e, i);
2230
+ }), p.append(e, t);
2231
+ };
2232
+ p.if(a, (e) => {
2233
+ p.get(L).hasRightAxis && e(o);
2234
+ });
2235
+ var s = p.sibling(a);
2236
+ p.each(s, 17, () => p.get(L).xTicks, (e) => e.label + e.x, (e, t, n, r) => {
2237
+ var i = p.comment(), a = p.first_child(i), o = (e) => {}, s = (e) => {
2238
+ var n = ut(), r = p.child(n, !0);
2239
+ p.reset(n), p.template_effect((e) => {
2240
+ p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(L).plot.y + p.get(L).plot.h + 12), p.set_attribute(n, "text-anchor", p.get(L).xLabelAngle < 0 ? "end" : "start"), p.set_attribute(n, "transform", `rotate(${p.get(L).xLabelAngle} ${p.get(t).x} ${p.get(L).plot.y + p.get(L).plot.h + 12})`), p.set_text(r, e);
2241
+ }, [() => G(p.get(t).label, Math.abs(p.get(L).xLabelAngle) >= 60 ? 18 : 12)]), p.append(e, n);
2242
+ }, c = (e) => {
2243
+ var n = dt(), r = p.child(n, !0);
2244
+ p.reset(n), p.template_effect((e) => {
2245
+ p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(L).plot.y + p.get(L).plot.h + 16), p.set_text(r, e);
2246
+ }, [() => G(p.get(t).label, 16)]), p.append(e, n);
2247
+ };
2248
+ p.if(a, (e) => {
2249
+ p.get(t).label ? p.get(L).xLabelRotated ? e(s, 1) : e(c, -1) : e(o);
2250
+ }), p.append(e, i);
2251
+ });
2252
+ var c = p.sibling(s);
2253
+ p.each(c, 17, () => p.get(L).categoryGroupTicks, (e) => e.label + e.x0, (e, t) => {
2254
+ let n = p.derived(() => p.get(L).plot.y + p.get(L).plot.h + (p.get(L).xLabelRotated ? 46 : 32));
2255
+ var r = pt(), i = p.first_child(r), a = p.sibling(i), o = (e) => {
2256
+ var r = ft();
2257
+ p.template_effect(() => {
2258
+ p.set_attribute(r, "x1", p.get(t).x0), p.set_attribute(r, "y1", p.get(L).plot.y + p.get(L).plot.h), p.set_attribute(r, "x2", p.get(t).x0), p.set_attribute(r, "y2", p.get(n) - 9);
2259
+ }), p.append(e, r);
2260
+ };
2261
+ p.if(a, (e) => {
2262
+ p.get(t).x0 > p.get(L).plot.x + 1 && e(o);
2263
+ });
2264
+ var s = p.sibling(a), c = p.child(s, !0);
2265
+ p.reset(s), p.template_effect((e) => {
2266
+ p.set_attribute(i, "x1", p.get(t).x0 + 3), p.set_attribute(i, "y1", p.get(n) - 9), p.set_attribute(i, "x2", p.get(t).x1 - 3), p.set_attribute(i, "y2", p.get(n) - 9), p.set_attribute(s, "x", p.get(t).xCenter), p.set_attribute(s, "y", p.get(n)), p.set_text(c, e);
2267
+ }, [() => G(p.get(t).label, Math.max(4, Math.floor((p.get(t).x1 - p.get(t).x0) / 7)))]), p.append(e, r);
2268
+ });
2269
+ var l = p.sibling(c), u = (e) => {
2270
+ var t = mt();
2271
+ p.set_attribute(t, "x", 13);
2272
+ var n = p.child(t, !0);
2273
+ p.reset(t), p.template_effect(() => {
2274
+ p.set_attribute(t, "y", p.get(L).plot.y + p.get(L).plot.h / 2), p.set_attribute(t, "transform", `rotate(-90 13 ${p.get(L).plot.y + p.get(L).plot.h / 2})`), p.set_text(n, p.get(Ia));
2275
+ }), p.append(e, t);
2276
+ };
2277
+ p.if(l, (e) => {
2278
+ p.get(Ia) && e(u);
2279
+ });
2280
+ var d = p.sibling(l), f = (e) => {
2281
+ var t = ht(), n = p.child(t, !0);
2282
+ p.reset(t), p.template_effect(() => {
2283
+ p.set_attribute(t, "x", p.get(L).width - 12), p.set_attribute(t, "y", p.get(L).plot.y + p.get(L).plot.h / 2), p.set_attribute(t, "transform", `rotate(90 ${p.get(L).width - 12} ${p.get(L).plot.y + p.get(L).plot.h / 2})`), p.set_text(n, p.get(La));
2284
+ }), p.append(e, t);
2285
+ };
2286
+ p.if(d, (e) => {
2287
+ p.get(La) && e(f);
2288
+ });
2289
+ var ee = p.sibling(d), te = (e) => {
2290
+ var t = gt(), n = p.child(t, !0);
2291
+ p.reset(t), p.template_effect(() => {
2292
+ p.set_attribute(t, "x", p.get(L).plot.x + p.get(L).plot.w / 2), p.set_attribute(t, "y", p.get(L).height - 3 - p.get(L).frame.bottom), p.set_text(n, p.get(Ra));
2293
+ }), p.append(e, t);
2294
+ };
2295
+ p.if(ee, (e) => {
2296
+ p.get(Ra) && e(te);
2297
+ }), p.append(e, t);
2298
+ };
2299
+ p.if(Ls, (e) => {
2300
+ p.get(B) ? e(Rs) : p.get(z) && e(zs, 1);
2301
+ });
2302
+ var Bs = p.sibling(Ls);
2303
+ p.each(Bs, 17, () => p.get(L).referenceBands, p.index, (e, t) => {
2304
+ var n = bt(), r = p.first_child(n), i = p.sibling(r), a = (e) => {
2305
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
2306
+ var n = vt(), r = p.child(n, !0);
2307
+ p.reset(n), p.template_effect(() => {
2308
+ p.set_attribute(n, "x", p.get(t).x + p.get(t).w - 3), p.set_attribute(n, "y", p.get(t).y + 10), p.set_attribute(n, "fill", p.get(t).color), p.set_text(r, p.get(t).label);
2309
+ }), p.append(e, n);
2310
+ }, a = (e) => {
2311
+ var n = yt(), r = p.child(n, !0);
2312
+ p.reset(n), p.template_effect(() => {
2313
+ p.set_attribute(n, "x", p.get(t).x + p.get(t).w / 2), p.set_attribute(n, "y", p.get(t).y + 10), p.set_attribute(n, "fill", p.get(t).color), p.set_text(r, p.get(t).label);
2314
+ }), p.append(e, n);
2315
+ };
2316
+ p.if(r, (e) => {
2317
+ p.get(t).axis === "y" ? e(i) : e(a, -1);
2318
+ }), p.append(e, n);
2319
+ };
2320
+ p.if(i, (e) => {
2321
+ p.get(t).label && e(a);
2322
+ }), p.template_effect(() => {
2323
+ p.set_attribute(r, "x", p.get(t).x), p.set_attribute(r, "y", p.get(t).y), p.set_attribute(r, "width", p.get(t).w), p.set_attribute(r, "height", p.get(t).h), p.set_attribute(r, "fill", p.get(t).color), p.set_attribute(r, "fill-opacity", p.get(t).opacity);
2324
+ }), p.append(e, n);
2325
+ });
2326
+ var Vs = p.sibling(Bs);
2327
+ let a;
2328
+ var Hs = p.child(Vs);
2329
+ p.each(Hs, 19, () => p.get(L).lines, (e, t) => e.label + t, (e, t, n) => {
2330
+ let r = p.derived(() => p.get(t).style?.gradient ? `${E}-grad-${p.get(n)}` : null);
2331
+ var i = Dt(), a = p.child(i), s = (e) => {
2332
+ var n = xt();
2333
+ p.template_effect(() => {
2334
+ p.set_attribute(n, "d", p.get(t).bandPath), p.set_attribute(n, "fill", p.get(t).color);
2335
+ }), p.append(e, n);
2336
+ };
2337
+ p.if(a, (e) => {
2338
+ p.get(t).bandPath && e(s);
2339
+ });
2340
+ var c = p.sibling(a), l = (e) => {
2341
+ var n = St();
2342
+ p.template_effect(() => {
2343
+ p.set_attribute(n, "d", p.get(t).areaPath), p.set_attribute(n, "fill", p.get(r) ? `url(#${p.get(r)})` : p.get(mi)[p.get(t).label] ?? p.get(t).color), p.set_attribute(n, "fill-opacity", p.get(r) ? .6 : p.get(t).range ? .35 : .15);
2344
+ }), p.append(e, n);
2345
+ };
2346
+ p.if(c, (e) => {
2347
+ p.get(t).areaPath && e(l);
2348
+ });
2349
+ var u = p.sibling(c), d = p.sibling(u), f = (e) => {
2350
+ let n = p.derived(() => p.get(t).points[p.get(Y) ?? -1]);
2351
+ var r = p.comment(), i = p.first_child(r), a = (e) => {
2352
+ var r = Ct();
2353
+ p.template_effect(() => {
2354
+ p.set_attribute(r, "cx", p.get(n).x), p.set_attribute(r, "cy", p.get(n).y), p.set_attribute(r, "fill", p.get(n).marker?.color ?? p.get(t).color);
2355
+ }), p.append(e, r);
2356
+ };
2357
+ p.if(i, (e) => {
2358
+ p.get(n)?.defined && e(a);
2359
+ }), p.append(e, r);
2360
+ }, ee = (e) => {
2361
+ var n = p.comment(), r = p.first_child(n);
2362
+ p.each(r, 17, () => p.get(t).points, p.index, (e, n, r) => {
2363
+ var i = p.comment(), a = p.first_child(i), s = (e) => {
2364
+ let i = p.derived(() => p.get(n).marker?.shape ?? "circle"), a = p.derived(() => (p.get(n).marker?.size ?? 3) + +(p.get(Y) === r)), s = p.derived(() => p.get(n).marker?.color ?? p.get(t).color);
2365
+ var c = p.comment(), l = p.first_child(c), u = (e) => {
2366
+ var i = wt();
2367
+ let o;
2368
+ p.template_effect((e, t) => {
2369
+ o = p.set_class(i, 0, "sv-grid-chart-dot svelte-hyytey", null, o, e), p.set_attribute(i, "cx", p.get(n).x), p.set_attribute(i, "cy", p.get(n).y), p.set_attribute(i, "r", p.get(a)), p.set_attribute(i, "fill", p.get(s)), p.set_style(i, t);
2370
+ }, [() => ({
2371
+ "is-active": p.get(Y) === r,
2372
+ "is-selected": uo(p.get(n).label, p.get(t).label)
2373
+ }), () => `opacity:${fo(p.get(n).label, p.get(t).label)}`]), p.append(e, i);
2374
+ }, d = (e) => {
2375
+ var t = Tt();
2376
+ let c;
2377
+ p.template_effect((e) => {
2378
+ c = p.set_class(t, 0, "sv-grid-chart-dot is-stroked svelte-hyytey", null, c, { "is-active": p.get(Y) === r }), p.set_attribute(t, "d", e), p.set_attribute(t, "stroke", p.get(s));
2379
+ }, [() => o(p.get(i), p.get(n).x, p.get(n).y, p.get(a))]), p.append(e, t);
2380
+ }, f = (e) => {
2381
+ var t = Et();
2382
+ let c;
2383
+ p.template_effect((e) => {
2384
+ c = p.set_class(t, 0, "sv-grid-chart-dot svelte-hyytey", null, c, { "is-active": p.get(Y) === r }), p.set_attribute(t, "d", e), p.set_attribute(t, "fill", p.get(s));
2385
+ }, [() => o(p.get(i), p.get(n).x, p.get(n).y, p.get(a))]), p.append(e, t);
2386
+ };
2387
+ p.if(l, (e) => {
2388
+ p.get(i) === "circle" ? e(u) : p.get(i) === "cross" ? e(d, 1) : e(f, -1);
2389
+ }), p.append(e, c);
2390
+ };
2391
+ p.if(a, (e) => {
2392
+ p.get(n).defined && p.get(n).marker?.shape !== "none" && e(s);
2393
+ }), p.append(e, i);
2394
+ }), p.append(e, n);
2395
+ };
2396
+ p.if(d, (e) => {
2397
+ p.get(Qa) ? e(f) : e(ee, -1);
2398
+ }), p.reset(i), p.template_effect((e) => {
2399
+ p.set_style(i, e), p.set_attribute(u, "d", p.get(t).path), p.set_attribute(u, "stroke", p.get(t).color), p.set_attribute(u, "stroke-width", p.get(t).style?.strokeWidth ?? (p.get(t).range ? 1 : 2)), p.set_attribute(u, "stroke-dasharray", p.get(t).style?.dash);
2400
+ }, [() => `opacity:${H(p.get(t).label) * (p.get(t).style?.opacity ?? 1)}`]), p.append(e, i);
2401
+ });
2402
+ var Us = p.sibling(Hs), Ws = (e) => {
2403
+ var t = p.comment(), n = p.first_child(t);
2404
+ p.snippet(n, () => i.underlay, () => p.get(za)), p.append(e, t);
2405
+ };
2406
+ p.if(Us, (e) => {
2407
+ i.underlay && e(Ws);
2408
+ });
2409
+ var Gs = p.sibling(Us);
2410
+ p.each(Gs, 17, () => p.get(L).bars, p.index, (e, t) => {
2411
+ var n = Ot();
2412
+ let r;
2413
+ p.template_effect((e, i, a) => {
2414
+ r = p.set_class(n, 0, "sv-grid-chart-bar svelte-hyytey", null, r, e), p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(t).y), p.set_attribute(n, "width", p.get(t).w), p.set_attribute(n, "height", p.get(t).h), p.set_attribute(n, "fill", i), p.set_style(n, a);
2415
+ }, [
2416
+ () => ({ "is-selected": uo(p.get(t).label, p.get(t).series, p.get(t).index) }),
2417
+ () => p.get(mi)[p.get(t).series]?.startsWith("url(") ? p.get(mi)[p.get(t).series] : p.get(t).color,
2418
+ () => `opacity:${H(p.get(t).series) * (p.get(t).opacity ?? 1) * fo(p.get(t).label, p.get(t).series, p.get(t).index)}`
2419
+ ]), p.delegated("click", n, function(...e) {
2420
+ (p.get(U) ? (e) => {
2421
+ e.stopPropagation(), Q(p.get(t).label, p.get(t).series, p.get(t).value, p.get(t).index, e);
2422
+ } : void 0)?.apply(this, e);
2423
+ }), p.append(e, n);
2424
+ });
2425
+ var Ks = p.sibling(Gs);
2426
+ p.each(Ks, 17, () => p.get(L).stems, p.index, (e, t) => {
2427
+ var n = At(), r = p.child(n), i = p.sibling(r), a = (e) => {
2428
+ var n = kt();
2429
+ p.template_effect(() => {
2430
+ p.set_attribute(n, "cx", p.get(t).xCenter), p.set_attribute(n, "cy", p.get(t).y0), p.set_attribute(n, "r", p.get(t).r), p.set_attribute(n, "fill", p.get(t).color2 ?? p.get(t).color), p.set_attribute(n, "stroke", p.get(t).color2 ?? p.get(t).color);
2431
+ }), p.append(e, n);
2432
+ };
2433
+ p.if(i, (e) => {
2434
+ p.get(t).dumbbell && e(a);
2435
+ });
2436
+ var o = p.sibling(i);
2437
+ p.reset(n), p.template_effect((e) => {
2438
+ p.set_style(n, e), p.set_attribute(r, "x1", p.get(t).xCenter), p.set_attribute(r, "y1", p.get(t).y0), p.set_attribute(r, "x2", p.get(t).xCenter), p.set_attribute(r, "y2", p.get(t).y1), p.set_attribute(r, "stroke", p.get(t).dumbbell ? "var(--sg-muted, #94a3b8)" : p.get(t).color), p.set_attribute(r, "stroke-width", p.get(t).dumbbell ? 2 : 1.5), p.set_attribute(o, "cx", p.get(t).xCenter), p.set_attribute(o, "cy", p.get(t).y1), p.set_attribute(o, "r", p.get(t).r), p.set_attribute(o, "fill", p.get(t).color);
2439
+ }, [() => `opacity:${H(p.get(t).series)}`]), p.delegated("mousemove", n, (e) => Zo(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", n, Z), p.append(e, n);
2440
+ });
2441
+ var qs = p.sibling(Ks);
2442
+ p.each(qs, 17, () => p.get(L).candles, p.index, (e, t) => {
2443
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
2444
+ var n = jt(), r = p.first_child(n), i = p.sibling(r), a = p.sibling(i);
2445
+ p.template_effect((e, n, o) => {
2446
+ p.set_attribute(r, "x1", p.get(t).xCenter), p.set_attribute(r, "y1", p.get(t).yHigh), p.set_attribute(r, "x2", p.get(t).xCenter), p.set_attribute(r, "y2", p.get(t).yLow), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, e), p.set_attribute(i, "x1", p.get(t).x), p.set_attribute(i, "y1", p.get(t).yOpen), p.set_attribute(i, "x2", p.get(t).xCenter), p.set_attribute(i, "y2", p.get(t).yOpen), p.set_attribute(i, "stroke", p.get(t).color), p.set_style(i, n), p.set_attribute(a, "x1", p.get(t).xCenter), p.set_attribute(a, "y1", p.get(t).yClose), p.set_attribute(a, "x2", p.get(t).x + p.get(t).w), p.set_attribute(a, "y2", p.get(t).yClose), p.set_attribute(a, "stroke", p.get(t).color), p.set_style(a, o);
2447
+ }, [
2448
+ () => `opacity:${H(p.get(t).series)}`,
2449
+ () => `opacity:${H(p.get(t).series)}`,
2450
+ () => `opacity:${H(p.get(t).series)}`
2451
+ ]), p.append(e, n);
2452
+ }, a = (e) => {
2453
+ var n = Mt(), r = p.first_child(n), i = p.sibling(r);
2454
+ p.template_effect((e, n) => {
2455
+ p.set_attribute(r, "x1", p.get(t).xCenter), p.set_attribute(r, "y1", p.get(t).yHigh), p.set_attribute(r, "x2", p.get(t).xCenter), p.set_attribute(r, "y2", p.get(t).yLow), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, e), p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(t).bodyY), p.set_attribute(i, "width", p.get(t).w), p.set_attribute(i, "height", p.get(t).bodyH), p.set_attribute(i, "fill", p.get(t).hollow ? "none" : p.get(t).color), p.set_attribute(i, "stroke", p.get(t).color), p.set_style(i, n);
2456
+ }, [() => `opacity:${H(p.get(t).series)}`, () => `opacity:${H(p.get(t).series)}`]), p.append(e, n);
2457
+ };
2458
+ p.if(r, (e) => {
2459
+ p.get(oa) ? e(i) : e(a, -1);
2460
+ }), p.append(e, n);
2461
+ });
2462
+ var Js = p.sibling(qs);
2463
+ p.each(Js, 17, () => p.get(L).boxes, p.index, (e, t) => {
2464
+ var n = Pt(), r = p.first_child(n), i = p.sibling(r), a = p.sibling(i), o = p.sibling(a), s = p.sibling(o), c = p.sibling(s);
2465
+ p.each(c, 17, () => p.get(t).outliers, p.index, (e, n) => {
2466
+ var r = Nt();
2467
+ p.template_effect((e) => {
2468
+ p.set_attribute(r, "cx", p.get(t).xCenter), p.set_attribute(r, "cy", p.get(n).y), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, e);
2469
+ }, [() => `opacity:${H(p.get(t).series)}`]), p.append(e, r);
2470
+ }), p.template_effect((e, n, c, l, u) => {
2471
+ p.set_attribute(r, "x1", p.get(t).xCenter), p.set_attribute(r, "y1", p.get(t).yMax), p.set_attribute(r, "x2", p.get(t).xCenter), p.set_attribute(r, "y2", p.get(t).yMin), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, e), p.set_attribute(i, "x1", p.get(t).x + p.get(t).w * .25), p.set_attribute(i, "y1", p.get(t).yMax), p.set_attribute(i, "x2", p.get(t).x + p.get(t).w * .75), p.set_attribute(i, "y2", p.get(t).yMax), p.set_attribute(i, "stroke", p.get(t).color), p.set_style(i, n), p.set_attribute(a, "x1", p.get(t).x + p.get(t).w * .25), p.set_attribute(a, "y1", p.get(t).yMin), p.set_attribute(a, "x2", p.get(t).x + p.get(t).w * .75), p.set_attribute(a, "y2", p.get(t).yMin), p.set_attribute(a, "stroke", p.get(t).color), p.set_style(a, c), p.set_attribute(o, "x", p.get(t).x), p.set_attribute(o, "y", p.get(t).boxY), p.set_attribute(o, "width", p.get(t).w), p.set_attribute(o, "height", p.get(t).boxH), p.set_attribute(o, "fill", p.get(t).color), p.set_attribute(o, "stroke", p.get(t).color), p.set_style(o, l), p.set_attribute(s, "x1", p.get(t).x), p.set_attribute(s, "y1", p.get(t).yMedian), p.set_attribute(s, "x2", p.get(t).x + p.get(t).w), p.set_attribute(s, "y2", p.get(t).yMedian), p.set_attribute(s, "stroke", p.get(t).color), p.set_style(s, u);
2472
+ }, [
2473
+ () => `opacity:${H(p.get(t).series)}`,
2474
+ () => `opacity:${H(p.get(t).series)}`,
2475
+ () => `opacity:${H(p.get(t).series)}`,
2476
+ () => `opacity:${H(p.get(t).series)}`,
2477
+ () => `opacity:${H(p.get(t).series)}`
2478
+ ]), p.append(e, n);
2479
+ });
2480
+ var Ys = p.sibling(Js);
2481
+ p.each(Ys, 17, () => p.get(L).errorBars, p.index, (e, t) => {
2482
+ var n = Ft(), r = p.first_child(n), i = p.sibling(r), a = p.sibling(i);
2483
+ p.template_effect((e, n, o) => {
2484
+ p.set_attribute(r, "x1", p.get(t).xCenter), p.set_attribute(r, "y1", p.get(t).yHi), p.set_attribute(r, "x2", p.get(t).xCenter), p.set_attribute(r, "y2", p.get(t).yLo), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, e), p.set_attribute(i, "x1", p.get(t).xCenter - p.get(t).cap), p.set_attribute(i, "y1", p.get(t).yHi), p.set_attribute(i, "x2", p.get(t).xCenter + p.get(t).cap), p.set_attribute(i, "y2", p.get(t).yHi), p.set_attribute(i, "stroke", p.get(t).color), p.set_style(i, n), p.set_attribute(a, "x1", p.get(t).xCenter - p.get(t).cap), p.set_attribute(a, "y1", p.get(t).yLo), p.set_attribute(a, "x2", p.get(t).xCenter + p.get(t).cap), p.set_attribute(a, "y2", p.get(t).yLo), p.set_attribute(a, "stroke", p.get(t).color), p.set_style(a, o);
2485
+ }, [
2486
+ () => `opacity:${H(p.get(t).series)}`,
2487
+ () => `opacity:${H(p.get(t).series)}`,
2488
+ () => `opacity:${H(p.get(t).series)}`
2489
+ ]), p.append(e, n);
2490
+ });
2491
+ var Xs = p.sibling(Ys);
2492
+ p.each(Xs, 17, () => p.get(L).scatterPoints, p.index, (e, t, n) => {
2493
+ var r = It();
2494
+ let a;
2495
+ p.template_effect((e, n, o, s) => {
2496
+ a = p.set_class(r, 0, "sv-grid-chart-scatter svelte-hyytey", null, a, e), p.set_attribute(r, "cx", p.get(t).cx), p.set_attribute(r, "cy", p.get(t).cy), p.set_attribute(r, "r", p.get(t).r), p.set_attribute(r, "fill", p.get(t).color), p.set_attribute(r, "stroke", p.get(t).color), p.set_style(r, n), p.set_attribute(r, "role", p.get(U) || i.onSelect ? "button" : "img"), p.set_attribute(r, "tabindex", o), p.set_attribute(r, "aria-label", s);
2497
+ }, [
2498
+ () => ({ "is-selected": uo(p.get(t).label || p.get(t).series, p.get(t).series, n) }),
2499
+ () => `opacity:${H(p.get(t).series) * fo(p.get(t).label || p.get(t).series, p.get(t).series, n)}`,
2500
+ () => rs(".sv-grid-chart-scatter", n),
2501
+ () => `${p.get(t).label || p.get(t).series}: ${T(p.get(t).x)}, ${T(p.get(t).y)}`
2502
+ ]), p.delegated("mousemove", r, (e) => Go(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", r, Z), p.delegated("click", r, function(...e) {
2503
+ (p.get(U) || i.onSelect ? (e) => {
2504
+ e.stopPropagation(), Q(p.get(t).label || p.get(t).series, p.get(t).series, p.get(t).y, n, e);
2505
+ } : void 0)?.apply(this, e);
2506
+ }), p.event("focus", r, (e) => {
2507
+ is(".sv-grid-chart-scatter", n);
2508
+ let r = os(e.currentTarget);
2509
+ Go(r.x, r.y, p.get(t));
2510
+ }), p.event("blur", r, Z), p.delegated("keydown", r, (e) => as(e, ".sv-grid-chart-scatter", n, p.get(U) || i.onSelect ? () => Q(p.get(t).label || p.get(t).series, p.get(t).series, p.get(t).y, n, e) : null)), p.append(e, r);
2511
+ }), p.reset(Vs);
2512
+ var Zs = p.sibling(Vs);
2513
+ p.each(Zs, 17, () => p.get(L).referenceLines, p.index, (e, t) => {
2514
+ var n = zt(), r = p.first_child(n), i = p.sibling(r), a = (e) => {
2515
+ let n = p.derived(() => Math.max(28, p.get(t).label.length * 6.4 + 10));
2516
+ var r = Lt(), i = p.child(r), a = p.sibling(i), o = p.child(a, !0);
2517
+ p.reset(a), p.reset(r), p.template_effect(() => {
2518
+ p.set_attribute(i, "x", p.get(L).plot.x + p.get(L).plot.w - p.get(n)), p.set_attribute(i, "y", p.get(t).y - 8), p.set_attribute(i, "width", p.get(n)), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(a, "x", p.get(L).plot.x + p.get(L).plot.w - p.get(n) / 2), p.set_attribute(a, "y", p.get(t).y + 3.5), p.set_text(o, p.get(t).label);
2519
+ }), p.append(e, r);
2520
+ }, o = (e) => {
2521
+ var n = Rt(), r = p.child(n, !0);
2522
+ p.reset(n), p.template_effect(() => {
2523
+ p.set_attribute(n, "x", p.get(L).plot.x + p.get(L).plot.w - 3), p.set_attribute(n, "y", p.get(t).y - 3), p.set_attribute(n, "fill", p.get(t).color), p.set_text(r, p.get(t).label);
2524
+ }), p.append(e, n);
2525
+ };
2526
+ p.if(i, (e) => {
2527
+ p.get(t).pill ? e(a) : e(o, -1);
2528
+ }), p.template_effect(() => {
2529
+ p.set_attribute(r, "x1", p.get(L).plot.x), p.set_attribute(r, "y1", p.get(t).y), p.set_attribute(r, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(r, "y2", p.get(t).y), p.set_attribute(r, "stroke", p.get(t).color), p.set_attribute(r, "stroke-dasharray", p.get(t).dashed ? "5 4" : void 0);
2530
+ }), p.append(e, n);
2531
+ });
2532
+ var Qs = p.sibling(Zs);
2533
+ p.each(Qs, 17, () => p.get(L).referenceLinesV, p.index, (e, t) => {
2534
+ var n = Bt(), r = p.first_child(n), i = p.sibling(r), a = p.child(i, !0);
2535
+ p.reset(i), p.template_effect(() => {
2536
+ p.set_attribute(r, "x1", p.get(t).x), p.set_attribute(r, "y1", p.get(L).plot.y), p.set_attribute(r, "x2", p.get(t).x), p.set_attribute(r, "y2", p.get(L).plot.y + p.get(L).plot.h), p.set_attribute(r, "stroke", p.get(t).color), p.set_attribute(r, "stroke-dasharray", p.get(t).dashed ? "5 4" : void 0), p.set_attribute(i, "x", p.get(t).x + 3), p.set_attribute(i, "y", p.get(L).plot.y + 9), p.set_attribute(i, "fill", p.get(t).color), p.set_text(a, p.get(t).label);
2537
+ }), p.append(e, n);
2538
+ });
2539
+ var $s = p.sibling(Qs);
2540
+ let s;
2541
+ p.each($s, 23, () => p.get(L).overlays, (e, t) => e.label + t, (e, t) => {
2542
+ var n = Ht(), r = p.first_child(n), i = (e) => {
2543
+ var n = Vt();
2544
+ p.template_effect(() => {
2545
+ p.set_attribute(n, "d", p.get(t).bandPath), p.set_attribute(n, "fill", p.get(t).color), p.set_attribute(n, "stroke", p.get(t).color);
2546
+ }), p.append(e, n);
2547
+ };
2548
+ p.if(r, (e) => {
2549
+ p.get(t).bandPath && e(i);
2550
+ });
2551
+ var a = p.sibling(r);
2552
+ p.template_effect(() => {
2553
+ p.set_attribute(a, "d", p.get(t).path), p.set_attribute(a, "stroke", p.get(t).color);
2554
+ }), p.append(e, n);
2555
+ }), p.reset($s);
2556
+ var ec = p.sibling($s);
2557
+ p.each(ec, 17, () => p.get(eo), p.index, (e, t) => {
2558
+ var n = Wt(), r = p.first_child(n), i = (e) => {
2559
+ var n = Ut();
2560
+ p.template_effect((e) => {
2561
+ p.set_attribute(n, "x1", p.get(t).leader.x1), p.set_attribute(n, "y1", p.get(t).leader.y1), p.set_attribute(n, "x2", p.get(t).leader.x2), p.set_attribute(n, "y2", p.get(t).leader.y2), p.set_style(n, e);
2562
+ }, [() => `opacity:${H(p.get(t).series)}`]), p.append(e, n);
2563
+ };
2564
+ p.if(r, (e) => {
2565
+ p.get(t).leader && e(i);
2566
+ });
2567
+ var a = p.sibling(r);
2568
+ let o;
2569
+ var s = p.child(a, !0);
2570
+ p.reset(a), p.template_effect((e) => {
2571
+ o = p.set_class(a, 0, "sv-grid-chart-datalabel svelte-hyytey", null, o, { "on-bar": p.get(t).onBar }), p.set_attribute(a, "x", p.get(t).x), p.set_attribute(a, "y", p.get(t).y), p.set_attribute(a, "text-anchor", p.get(t).anchor), p.set_attribute(a, "transform", p.get(t).angle ? `rotate(${p.get(t).angle} ${p.get(t).x} ${p.get(t).y})` : void 0), p.set_style(a, e), p.set_text(s, p.get(t).text);
2572
+ }, [() => `opacity:${H(p.get(t).series)}`]), p.append(e, n);
2573
+ });
2574
+ var tc = p.sibling(ec);
2575
+ p.each(tc, 17, () => p.get(L).seriesLabels, (e) => e.series, (e, t) => {
2576
+ var n = Gt(), r = p.child(n, !0);
2577
+ p.reset(n), p.template_effect((e) => {
2578
+ p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(t).y + 3.5), p.set_attribute(n, "fill", p.get(t).color), p.set_style(n, e), p.set_text(r, p.get(t).text);
2579
+ }, [() => `opacity:${H(p.get(t).series)}`]), p.append(e, n);
2580
+ });
2581
+ var nc = p.sibling(tc), rc = (e) => {
2582
+ var t = p.comment(), n = p.first_child(t);
2583
+ p.snippet(n, () => i.overlay, () => p.get(za)), p.append(e, t);
2584
+ };
2585
+ p.if(nc, (e) => {
2586
+ i.overlay && e(rc);
2587
+ });
2588
+ var ic = p.sibling(nc);
2589
+ p.each(ic, 19, () => p.get(L).annotations, (e, t) => e.label + t, (e, t, n) => {
2590
+ let r = p.derived(() => p.get(t).placement === "left" ? -8 : p.get(t).placement === "right" ? 8 : 0), a = p.derived(() => p.get(t).placement === "bottom" ? 14 : p.get(t).placement === "top" ? -8 : 0), o = p.derived(() => p.get(t).placement === "left" ? "end" : p.get(t).placement === "right" ? "start" : "middle"), s = p.derived(() => p.get(w) && !!i.onAnnotationRemove), c = p.derived(() => Math.max(14, p.get(t).label.length * 6.2 + 8));
2591
+ var l = Xt();
2592
+ let u;
2593
+ var d = p.child(l), f = (e) => {
2594
+ var n = Kt(), r = p.first_child(n), i = p.sibling(r), a = p.sibling(i), o = p.child(a, !0);
2595
+ p.reset(a), p.template_effect(() => {
2596
+ p.set_attribute(r, "x1", p.get(t).x), p.set_attribute(r, "y1", p.get(t).y), p.set_attribute(r, "x2", p.get(t).x), p.set_attribute(r, "y2", p.get(t).y - 24), p.set_attribute(r, "stroke", p.get(t).color), p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(t).y - 24), p.set_attribute(i, "width", p.get(c)), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(a, "x", p.get(t).x + p.get(c) / 2), p.set_attribute(a, "y", p.get(t).y - 14.5), p.set_text(o, p.get(t).label);
2597
+ }), p.append(e, n);
2598
+ }, ee = (e) => {
2599
+ var n = qt(), i = p.first_child(n), s = p.sibling(i), c = p.child(s, !0);
2600
+ p.reset(s);
2601
+ var l = p.sibling(s), u = p.child(l, !0);
2602
+ p.reset(l), p.template_effect((e) => {
2603
+ p.set_attribute(i, "d", `M${p.get(t).x},${p.get(t).y} c-7,-9 -8,-13 -8,-16 a8,8 0 1,1 16,0 c0,3 -1,7 -8,16 z`), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(s, "x", p.get(t).x), p.set_attribute(s, "y", p.get(t).y - 12.5), p.set_text(c, e), p.set_attribute(l, "x", p.get(t).x + p.get(r)), p.set_attribute(l, "y", p.get(t).y + p.get(a)), p.set_attribute(l, "text-anchor", p.get(o)), p.set_attribute(l, "fill", p.get(t).color), p.set_text(u, p.get(t).label);
2604
+ }, [() => p.get(t).label.slice(0, 1)]), p.append(e, n);
2605
+ }, te = (e) => {
2606
+ var n = Jt(), i = p.first_child(n), s = p.sibling(i), c = p.child(s, !0);
2607
+ p.reset(s), p.template_effect(() => {
2608
+ p.set_attribute(i, "x", p.get(t).x - 4.5), p.set_attribute(i, "y", p.get(t).y - 4.5), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(s, "x", p.get(t).x + p.get(r)), p.set_attribute(s, "y", p.get(t).y + p.get(a)), p.set_attribute(s, "text-anchor", p.get(o)), p.set_attribute(s, "fill", p.get(t).color), p.set_text(c, p.get(t).label);
2609
+ }), p.append(e, n);
2610
+ }, ne = (e) => {
2611
+ var n = Yt(), i = p.first_child(n), c = p.sibling(i), l = p.child(c, !0);
2612
+ p.reset(c), p.template_effect(() => {
2613
+ p.set_attribute(i, "cx", p.get(t).x), p.set_attribute(i, "cy", p.get(t).y), p.set_attribute(i, "r", p.get(s) ? 6 : 4), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(c, "x", p.get(t).x + p.get(r)), p.set_attribute(c, "y", p.get(t).y + p.get(a)), p.set_attribute(c, "text-anchor", p.get(o)), p.set_attribute(c, "fill", p.get(t).color), p.set_text(l, p.get(t).label);
2614
+ }), p.append(e, n);
2615
+ };
2616
+ p.if(d, (e) => {
2617
+ p.get(t).shape === "flag" ? e(f) : p.get(t).shape === "pin" ? e(ee, 1) : p.get(t).shape === "square" ? e(te, 2) : e(ne, -1);
2618
+ }), p.reset(l), p.template_effect((e) => {
2619
+ u = p.set_class(l, 0, "sv-grid-chart-annotation-marker svelte-hyytey", null, u, {
2620
+ "is-removable": p.get(s),
2621
+ "has-text": !!p.get(t).text
2622
+ }), p.set_attribute(l, "role", p.get(s) ? "button" : p.get(t).text ? "img" : void 0), p.set_attribute(l, "tabindex", p.get(s) || p.get(t).text ? 0 : void 0), p.set_attribute(l, "aria-label", e);
2623
+ }, [() => p.get(s) ? b(p.get(x).removeNote, { label: p.get(t).label }) : p.get(t).text ? `${p.get(t).label}: ${p.get(t).text}` : void 0]), p.delegated("click", l, (e) => {
2624
+ !p.get(w) || !i.onAnnotationRemove || (e.stopPropagation(), i.onAnnotationRemove(p.get(n)));
2625
+ }), p.delegated("keydown", l, (e) => {
2626
+ !p.get(w) || !i.onAnnotationRemove || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), i.onAnnotationRemove(p.get(n)));
2627
+ }), p.event("mouseenter", l, (e) => {
2628
+ p.get(t).text && X(e.clientX, e.clientY, p.get(t).label, [{ value: p.get(t).text }]);
2629
+ }), p.event("mouseleave", l, () => {
2630
+ p.get(t).text && p.set(q, null);
2631
+ }), p.event("focus", l, () => {
2632
+ if (!p.get(t).text || !p.get(k)) return;
2633
+ let e = p.get(k).getBoundingClientRect();
2634
+ X(e.left + p.get(t).x * e.width / p.get(L).width, e.top + p.get(t).y * e.height / p.get(L).height, p.get(t).label, [{ value: p.get(t).text }]);
2635
+ }), p.event("blur", l, () => {
2636
+ p.get(t).text && p.set(q, null);
2637
+ }), p.append(e, l);
2638
+ });
2639
+ var ac = p.sibling(ic), oc = (e) => {
2640
+ var t = un(), n = p.child(t);
2641
+ p.each(n, 17, () => p.get(L).drawings, (e) => e.id, (e, t) => {
2642
+ let n = p.derived(() => p.get(t).points[0]), r = p.derived(() => p.get(t).points[1]), i = p.derived(() => p.get(Bi) === p.get(t).id);
2643
+ var a = on();
2644
+ let o;
2645
+ var s = p.child(a), c = (e) => {
2646
+ let i = p.derived(() => Math.atan2(p.get(r).y - p.get(n).y, p.get(r).x - p.get(n).x));
2647
+ var a = Qt(), o = p.first_child(a), s = p.sibling(o), c = p.sibling(s), l = (e) => {
2648
+ var n = Zt();
2649
+ p.template_effect((e) => {
2650
+ p.set_attribute(n, "d", e), p.set_attribute(n, "fill", p.get(t).color);
2651
+ }, [() => `M${p.get(r).x},${p.get(r).y} L${p.get(r).x - 10 * Math.cos(p.get(i) - .45)},${p.get(r).y - 10 * Math.sin(p.get(i) - .45)} L${p.get(r).x - 10 * Math.cos(p.get(i) + .45)},${p.get(r).y - 10 * Math.sin(p.get(i) + .45)} Z`]), p.append(e, n);
2652
+ };
2653
+ p.if(c, (e) => {
2654
+ p.get(t).kind === "arrow" && e(l);
2655
+ }), p.template_effect(() => {
2656
+ p.set_attribute(o, "x1", p.get(n).x), p.set_attribute(o, "y1", p.get(n).y), p.set_attribute(o, "x2", p.get(r).x), p.set_attribute(o, "y2", p.get(r).y), p.set_attribute(s, "x1", p.get(n).x), p.set_attribute(s, "y1", p.get(n).y), p.set_attribute(s, "x2", p.get(r).x), p.set_attribute(s, "y2", p.get(r).y), p.set_attribute(s, "stroke", p.get(t).color);
2657
+ }), p.append(e, a);
2658
+ }, l = (e) => {
2659
+ var i = $t();
2660
+ p.template_effect((e, n, r, a) => {
2661
+ p.set_attribute(i, "x", e), p.set_attribute(i, "y", n), p.set_attribute(i, "width", r), p.set_attribute(i, "height", a), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(i, "stroke", p.get(t).color);
2662
+ }, [
2663
+ () => Math.min(p.get(n).x, p.get(r).x),
2664
+ () => Math.min(p.get(n).y, p.get(r).y),
2665
+ () => Math.abs(p.get(r).x - p.get(n).x),
2666
+ () => Math.abs(p.get(r).y - p.get(n).y)
2667
+ ]), p.append(e, i);
2668
+ }, u = (e) => {
2669
+ var r = en(), i = p.first_child(r), a = p.sibling(i), o = p.sibling(a), s = p.child(o, !0);
2670
+ p.reset(o), p.template_effect(() => {
2671
+ p.set_attribute(i, "x1", p.get(n).x), p.set_attribute(i, "y1", p.get(n).y), p.set_attribute(i, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(i, "y2", p.get(n).y), p.set_attribute(a, "x1", p.get(n).x), p.set_attribute(a, "y1", p.get(n).y), p.set_attribute(a, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(a, "y2", p.get(n).y), p.set_attribute(a, "stroke", p.get(t).color), p.set_attribute(o, "x", p.get(L).plot.x + p.get(L).plot.w - 3), p.set_attribute(o, "y", p.get(n).y - 3), p.set_attribute(o, "fill", p.get(t).color), p.set_text(s, p.get(t).label);
2672
+ }), p.append(e, r);
2673
+ }, d = (e) => {
2674
+ let i = p.derived(() => Math.min(p.get(n).x, p.get(r).x)), a = p.derived(() => Math.max(p.get(n).x, p.get(r).x));
2675
+ var o = nn(), s = p.first_child(o);
2676
+ p.each(s, 17, () => p.get(t).levels, (e) => e.ratio, (e, n) => {
2677
+ var r = tn(), o = p.first_child(r), s = p.sibling(o), c = p.child(s, !0);
2678
+ p.reset(s), p.template_effect(() => {
2679
+ p.set_attribute(o, "x1", p.get(i)), p.set_attribute(o, "y1", p.get(n).y), p.set_attribute(o, "x2", p.get(a)), p.set_attribute(o, "y2", p.get(n).y), p.set_attribute(o, "stroke", p.get(t).color), p.set_attribute(o, "stroke-dasharray", p.get(n).ratio === 0 || p.get(n).ratio === 1 ? void 0 : "3 3"), p.set_attribute(s, "x", p.get(i) + 3), p.set_attribute(s, "y", p.get(n).y - 2), p.set_attribute(s, "fill", p.get(t).color), p.set_text(c, p.get(n).label);
2680
+ }), p.append(e, r);
2681
+ });
2682
+ var c = p.sibling(s);
2683
+ p.template_effect((e, t) => {
2684
+ p.set_attribute(c, "x", p.get(i)), p.set_attribute(c, "y", e), p.set_attribute(c, "width", p.get(a) - p.get(i)), p.set_attribute(c, "height", t);
2685
+ }, [() => Math.min(p.get(n).y, p.get(r).y), () => Math.abs(p.get(r).y - p.get(n).y)]), p.append(e, o);
2686
+ }, f = (e) => {
2687
+ var r = rn(), i = p.child(r, !0);
2688
+ p.reset(r), p.template_effect(() => {
2689
+ p.set_attribute(r, "x", p.get(n).x), p.set_attribute(r, "y", p.get(n).y), p.set_attribute(r, "fill", p.get(t).color), p.set_text(i, p.get(t).text ?? "");
2690
+ }), p.append(e, r);
2691
+ };
2692
+ p.if(s, (e) => {
2693
+ (p.get(t).kind === "trend" || p.get(t).kind === "arrow") && p.get(r) ? e(c) : p.get(t).kind === "rect" && p.get(r) ? e(l, 1) : p.get(t).kind === "hray" ? e(u, 2) : p.get(t).kind === "fib" && p.get(r) && p.get(t).levels ? e(d, 3) : p.get(t).kind === "text" && e(f, 4);
2694
+ });
2695
+ var ee = p.sibling(s), te = (e) => {
2696
+ var n = p.comment(), r = p.first_child(n);
2697
+ p.each(r, 17, () => p.get(t).points, p.index, (e, n, r) => {
2698
+ var i = an();
2699
+ p.template_effect(() => {
2700
+ p.set_attribute(i, "cx", p.get(n).x), p.set_attribute(i, "cy", p.get(n).y), p.set_attribute(i, "stroke", p.get(t).color);
2701
+ }), p.delegated("pointerdown", i, (e) => {
2702
+ e.stopPropagation(), e.preventDefault(), p.set(Wi, {
2703
+ id: p.get(t).id,
2704
+ index: r
2705
+ }, !0), p.get(k)?.setPointerCapture?.(e.pointerId);
2706
+ }), p.append(e, i);
2707
+ }), p.append(e, n);
2708
+ };
2709
+ p.if(ee, (e) => {
2710
+ p.get(i) && Rr() && e(te);
2711
+ }), p.reset(a), p.template_effect((e) => {
2712
+ o = p.set_class(a, 0, `sv-grid-chart-drawing is-${p.get(t).kind}`, "svelte-hyytey", o, { "is-selected": p.get(i) }), p.set_attribute(a, "role", Rr() ? "button" : void 0), p.set_attribute(a, "tabindex", Rr() ? 0 : void 0), p.set_attribute(a, "aria-label", e);
2713
+ }, [() => Rr() ? `${b(p.get(x).drawing, { tool: p.get(Ri)[p.get(t).kind] })}${p.get(t).text ? `: ${p.get(t).text}` : ""}` : void 0]), p.delegated("click", a, (e) => {
2714
+ Rr() && !p.get(M) && (e.stopPropagation(), p.set(Bi, p.get(i) ? null : p.get(t).id, !0));
2715
+ }), p.delegated("keydown", a, (e) => {
2716
+ Rr() && ea(e, p.get(t).id);
2717
+ }), p.append(e, a);
2718
+ });
2719
+ var r = p.sibling(n), i = (e) => {
2720
+ var t = ln(), n = p.first_child(t), r = p.sibling(n), i = (e) => {
2721
+ var t = sn();
2722
+ p.template_effect((e, n, r, i) => {
2723
+ p.set_attribute(t, "x", e), p.set_attribute(t, "y", n), p.set_attribute(t, "width", r), p.set_attribute(t, "height", i);
2724
+ }, [
2725
+ () => Math.min(p.get(N).px, p.get(P).x),
2726
+ () => Math.min(p.get(N).py, p.get(P).y),
2727
+ () => Math.abs(p.get(P).x - p.get(N).px),
2728
+ () => Math.abs(p.get(P).y - p.get(N).py)
2729
+ ]), p.append(e, t);
2730
+ }, a = (e) => {
2731
+ var t = cn();
2732
+ p.template_effect(() => {
2733
+ p.set_attribute(t, "x1", p.get(N).px), p.set_attribute(t, "y1", p.get(N).py), p.set_attribute(t, "x2", p.get(P).x), p.set_attribute(t, "y2", p.get(P).y);
2734
+ }), p.append(e, t);
2735
+ };
2736
+ p.if(r, (e) => {
2737
+ p.get(M) === "rect" ? e(i) : e(a, -1);
2738
+ }), p.template_effect(() => {
2739
+ p.set_attribute(n, "cx", p.get(N).px), p.set_attribute(n, "cy", p.get(N).py);
2740
+ }), p.append(e, t);
2741
+ };
2742
+ p.if(r, (e) => {
2743
+ p.get(N) && p.get(P) && e(i);
2744
+ }), p.reset(t), p.template_effect(() => p.set_attribute(t, "clip-path", `url(#${E}-plot)`)), p.append(e, t);
2745
+ };
2746
+ p.if(ac, (e) => {
2747
+ (p.get(L).drawings.length || p.get(N)) && e(oc);
2748
+ });
2749
+ var sc = p.sibling(ac), cc = (e) => {
2750
+ var t = p.comment(), n = p.first_child(t), r = (e) => {
2751
+ let t = p.derived(() => p.get(L).plot.y + p.get(Za) * p.get(Y) + p.get(Za) / 2);
2752
+ var n = dn();
2753
+ p.template_effect(() => {
2754
+ p.set_attribute(n, "x1", p.get(L).plot.x), p.set_attribute(n, "y1", p.get(t)), p.set_attribute(n, "x2", p.get(L).plot.x + p.get(L).plot.w), p.set_attribute(n, "y2", p.get(t));
2755
+ }), p.append(e, n);
2756
+ }, i = (e) => {
2757
+ let t = p.derived(() => p.get(L).lines[0]?.points[p.get(Y)]), n = p.derived(() => p.get(t) && Number.isFinite(p.get(t).x) ? p.get(t).x : p.get(L).plot.x + p.get(Za) * p.get(Y) + p.get(Za) / 2);
2758
+ var r = mn(), i = p.first_child(r), a = p.sibling(i), o = (e) => {
2759
+ let t = p.derived(() => G(p.get(q)?.title ?? p.get(I).categories[p.get(Y)] ?? "", 16)), r = p.derived(() => Math.max(24, p.get(t).length * 6.2 + 10));
2760
+ var i = pn(), a = p.first_child(i), o = p.child(a), s = p.sibling(o), c = p.child(s, !0);
2761
+ p.reset(s), p.reset(a);
2762
+ var l = p.sibling(a), u = (e) => {
2763
+ let t = p.derived(() => Lo(p.get(R).yInvert(p.get(Io)))), n = p.derived(() => Math.max(24, p.get(t).length * 6.2 + 10));
2764
+ var r = fn(), i = p.child(r), a = p.sibling(i), o = p.child(a, !0);
2765
+ p.reset(a), p.reset(r), p.template_effect((e, r) => {
2766
+ p.set_attribute(i, "x", e), p.set_attribute(i, "y", p.get(Io) - 7.5), p.set_attribute(i, "width", p.get(n)), p.set_attribute(a, "x", r), p.set_attribute(a, "y", p.get(Io) + 3.5), p.set_text(o, p.get(t));
2767
+ }, [() => Math.max(0, p.get(L).plot.x - p.get(n) - 2), () => Math.max(p.get(n) / 2, p.get(L).plot.x - 2 - p.get(n) / 2)]), p.append(e, r);
2768
+ };
2769
+ p.if(l, (e) => {
2770
+ p.get(Io) != null && p.get(R) && p.get(L).axes && e(u);
2771
+ }), p.template_effect((e, n) => {
2772
+ p.set_attribute(o, "x", e), p.set_attribute(o, "y", p.get(L).plot.y + p.get(L).plot.h + 2), p.set_attribute(o, "width", p.get(r)), p.set_attribute(s, "x", n), p.set_attribute(s, "y", p.get(L).plot.y + p.get(L).plot.h + 13), p.set_text(c, p.get(t));
2773
+ }, [() => Math.max(0, Math.min(p.get(L).width - p.get(r), p.get(n) - p.get(r) / 2)), () => Math.max(p.get(r) / 2, Math.min(p.get(L).width - p.get(r) / 2, p.get(n)))]), p.append(e, i);
2774
+ };
2775
+ p.if(a, (e) => {
2776
+ Nr() && e(o);
2777
+ }), p.template_effect(() => {
2778
+ p.set_attribute(i, "x1", p.get(n)), p.set_attribute(i, "y1", p.get(L).plot.y), p.set_attribute(i, "x2", p.get(n)), p.set_attribute(i, "y2", p.get(L).plot.y + p.get(L).plot.h);
2779
+ }), p.append(e, r);
2780
+ };
2781
+ p.if(n, (e) => {
2782
+ p.get(B) ? e(r) : e(i, -1);
2783
+ }), p.append(e, t);
2784
+ };
2785
+ p.if(sc, (e) => {
2786
+ p.get(z) && p.get(Y) !== null && e(cc);
2787
+ });
2788
+ var lc = p.sibling(sc), uc = (e) => {
2789
+ var t = xn(), n = p.first_child(t);
2790
+ p.each(n, 17, () => p.get(L).heatmapRowTicks, (e) => e.value, (e, t, n, r) => {
2791
+ var i = hn(), a = p.child(i, !0);
2792
+ p.reset(i), p.template_effect((e) => {
2793
+ p.set_attribute(i, "x", p.get(L).plot.x - 8), p.set_attribute(i, "y", p.get(t).y + 3), p.set_text(a, e);
2794
+ }, [() => G(p.get(t).label, 22)]), p.append(e, i);
2795
+ });
2796
+ var r = p.sibling(n);
2797
+ p.each(r, 19, () => p.get(L).heatmapColTicks, (e, t) => e.label + t, (e, t, n, r) => {
2798
+ var i = gn(), a = p.child(i, !0);
2799
+ p.reset(i), p.template_effect((e) => {
2800
+ p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(L).plot.y + p.get(L).plot.h + 14), p.set_text(a, e);
2801
+ }, [() => G(p.get(t).label, 14)]), p.append(e, i);
2802
+ });
2803
+ var a = p.sibling(r);
2804
+ p.each(a, 17, () => p.get(L).heatmapCells, p.index, (e, t, n) => {
2805
+ var r = vn(), a = p.first_child(r), o = p.sibling(a), s = (e) => {
2806
+ var n = _n(), r = p.child(n, !0);
2807
+ p.reset(n), p.template_effect((e) => {
2808
+ p.set_attribute(n, "x", p.get(t).x + p.get(t).w / 2), p.set_attribute(n, "y", p.get(t).y + p.get(t).h / 2 + 3), p.set_attribute(n, "fill", p.get(t).textColor), p.set_text(r, e);
2809
+ }, [() => T(p.get(t).value)]), p.append(e, n);
2810
+ };
2811
+ p.if(o, (e) => {
2812
+ p.get(ni).show && p.get(t).w > 22 && p.get(t).h > 14 && e(s);
2813
+ }), p.template_effect((e, n) => {
2814
+ p.set_attribute(a, "x", p.get(t).x), p.set_attribute(a, "y", p.get(t).y), p.set_attribute(a, "width", p.get(t).w), p.set_attribute(a, "height", p.get(t).h), p.set_attribute(a, "fill", p.get(t).color), p.set_attribute(a, "role", i.onSelect || p.get(U) ? "button" : "img"), p.set_attribute(a, "tabindex", e), p.set_attribute(a, "aria-label", n);
2815
+ }, [() => rs(".sv-grid-chart-heatcell", n), () => `${p.get(t).rowLabel} ${p.get(t).colLabel}: ${T(p.get(t).value)}`]), p.delegated("mousemove", a, (e) => Ko(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", a, Z), p.event("focus", a, (e) => {
2816
+ is(".sv-grid-chart-heatcell", n);
2817
+ let r = os(e.currentTarget);
2818
+ Ko(r.x, r.y, p.get(t));
2819
+ }), p.event("blur", a, Z), p.delegated("click", a, () => Q(p.get(t).colLabel, p.get(t).rowLabel, p.get(t).value)), p.delegated("keydown", a, (e) => as(e, ".sv-grid-chart-heatcell", n, i.onSelect || p.get(U) ? () => Q(p.get(t).colLabel, p.get(t).rowLabel, p.get(t).value) : null, { cols: p.get(L).heatmapColTicks.length })), p.append(e, r);
2820
+ });
2821
+ var o = p.sibling(a), s = (e) => {
2822
+ let t = p.derived(() => p.get(L).plot.x + p.get(L).plot.w + 14), n = p.derived(() => p.get(L).plot.h - 20), r = p.derived(() => p.get(L).heatmapLegend);
2823
+ var i = bn(), a = p.first_child(i), o = p.child(a);
2824
+ p.each(o, 21, () => p.get(r), p.index, (e, t, n) => {
2825
+ var i = yn();
2826
+ p.template_effect(() => {
2827
+ p.set_attribute(i, "offset", `${n / (p.get(r).length - 1) * 100}%`), p.set_attribute(i, "stop-color", p.get(t).color);
2828
+ }), p.append(e, i);
2829
+ }), p.reset(o), p.reset(a);
2830
+ var s = p.sibling(a), c = p.sibling(s), l = p.child(c, !0);
2831
+ p.reset(c);
2832
+ var u = p.sibling(c), d = p.child(u, !0);
2833
+ p.reset(u), p.template_effect(() => {
2834
+ p.set_attribute(o, "id", `${E}-heatscale`), p.set_attribute(s, "x", p.get(t)), p.set_attribute(s, "y", p.get(L).plot.y + 10), p.set_attribute(s, "height", p.get(n)), p.set_attribute(s, "fill", `url(#${E}-heatscale)`), p.set_attribute(c, "x", p.get(t) + 14), p.set_attribute(c, "y", p.get(L).plot.y + 14), p.set_text(l, p.get(r)[p.get(r).length - 1].label), p.set_attribute(u, "x", p.get(t) + 14), p.set_attribute(u, "y", p.get(L).plot.y + 10 + p.get(n)), p.set_text(d, p.get(r)[0].label);
2835
+ }), p.append(e, i);
2836
+ };
2837
+ p.if(o, (e) => {
2838
+ p.get(L).heatmapLegend.length && e(s);
2839
+ }), p.append(e, t);
2840
+ };
2841
+ p.if(lc, (e) => {
2842
+ p.get(Wa) && e(uc);
2843
+ });
2844
+ var dc = p.sibling(lc), fc = (e) => {
2845
+ var t = p.comment(), n = p.first_child(t);
2846
+ p.each(n, 17, () => p.get(L).funnelSegments, p.index, (e, t, n) => {
2847
+ var r = Cn(), a = p.first_child(r), o = p.sibling(a), s = (e) => {
2848
+ var n = Sn(), r = p.first_child(n), i = p.child(r, !0);
2849
+ p.reset(r);
2850
+ var a = p.sibling(r), o = p.child(a);
2851
+ p.reset(a), p.template_effect((e, n, s) => {
2852
+ p.set_attribute(r, "x", p.get(t).cx), p.set_attribute(r, "y", p.get(t).cy - 3), p.set_attribute(r, "fill", p.get(t).textColor), p.set_text(i, e), p.set_attribute(a, "x", p.get(t).cx), p.set_attribute(a, "y", p.get(t).cy + 11), p.set_attribute(a, "fill", p.get(t).textColor), p.set_text(o, `${n ?? ""} · ${s ?? ""}%`);
2853
+ }, [
2854
+ () => G(p.get(t).label, 24),
2855
+ () => T(p.get(t).value),
2856
+ () => (p.get(t).conversion * 100).toFixed(0)
2857
+ ]), p.append(e, n);
2858
+ }, c = p.derived(() => p.get(L).plot.h / Math.max(1, p.get(L).funnelSegments.length) >= 26);
2859
+ p.if(o, (e) => {
2860
+ p.get(c) && e(s);
2861
+ }), p.template_effect((e, n) => {
2862
+ p.set_attribute(a, "d", p.get(t).path), p.set_attribute(a, "fill", p.get(t).color), p.set_attribute(a, "role", i.onSelect || p.get(U) ? "button" : "img"), p.set_attribute(a, "tabindex", e), p.set_attribute(a, "aria-label", n);
2863
+ }, [() => rs(".sv-grid-chart-funnel-seg", n), () => `${p.get(t).label}: ${T(p.get(t).value)}`]), p.delegated("mousemove", a, (e) => qo(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", a, Z), p.event("focus", a, (e) => {
2864
+ is(".sv-grid-chart-funnel-seg", n);
2865
+ let r = os(e.currentTarget);
2866
+ qo(r.x, r.y, p.get(t));
2867
+ }), p.event("blur", a, Z), p.delegated("click", a, () => Q(p.get(t).label, p.get(t).label, p.get(t).value, n)), p.delegated("keydown", a, (e) => as(e, ".sv-grid-chart-funnel-seg", n, i.onSelect || p.get(U) ? () => Q(p.get(t).label, p.get(t).label, p.get(t).value, n) : null)), p.append(e, r);
2868
+ }), p.append(e, t);
2869
+ };
2870
+ p.if(dc, (e) => {
2871
+ p.get(Ga) && e(fc);
2872
+ });
2873
+ var pc = p.sibling(dc), mc = (e) => {
2874
+ let t = p.derived(() => p.get(L).radarCenter);
2875
+ var n = On(), r = p.first_child(n);
2876
+ p.each(r, 17, () => p.get(L).radarRings, p.index, (e, n, r) => {
2877
+ let i = p.derived(() => p.get(t).r * ((r + 1) / p.get(L).radarRings.length));
2878
+ var a = wn();
2879
+ p.template_effect(() => {
2880
+ p.set_attribute(a, "cx", p.get(t).cx), p.set_attribute(a, "cy", p.get(t).cy), p.set_attribute(a, "r", p.get(i));
2881
+ }), p.append(e, a);
2882
+ });
2883
+ var i = p.sibling(r);
2884
+ p.each(i, 17, () => p.get(L).radarAxes, p.index, (e, n) => {
2885
+ let r = p.derived(() => p.get(n).x - p.get(t).cx), i = p.derived(() => p.get(n).y - p.get(t).cy), a = p.derived(() => p.get(t).cx + p.get(r) * 1.08), o = p.derived(() => p.get(t).cy + p.get(i) * 1.08);
2886
+ var s = Tn(), c = p.first_child(s), l = p.sibling(c), u = p.child(l, !0);
2887
+ p.reset(l), p.template_effect((e) => {
2888
+ p.set_attribute(c, "x1", p.get(t).cx), p.set_attribute(c, "y1", p.get(t).cy), p.set_attribute(c, "x2", p.get(n).x), p.set_attribute(c, "y2", p.get(n).y), p.set_attribute(l, "x", p.get(a)), p.set_attribute(l, "y", p.get(o) + 3), p.set_attribute(l, "text-anchor", e), p.set_text(u, p.get(n).label);
2889
+ }, [() => Math.abs(p.get(r)) < 1 ? "middle" : p.get(r) > 0 ? "start" : "end"]), p.append(e, s);
2890
+ });
2891
+ var a = p.sibling(i);
2892
+ p.each(a, 17, () => p.get(L).radarSeries, p.index, (e, t, n) => {
2893
+ var r = Dn(), i = p.first_child(r), a = p.sibling(i);
2894
+ p.each(a, 17, () => p.get(t).points, p.index, (e, r, i) => {
2895
+ let a = p.derived(() => n * p.get(t).points.length + i);
2896
+ var o = En();
2897
+ p.template_effect((e, n) => {
2898
+ p.set_attribute(o, "cx", p.get(r).x), p.set_attribute(o, "cy", p.get(r).y), p.set_attribute(o, "fill", p.get(t).color), p.set_attribute(o, "tabindex", e), p.set_attribute(o, "aria-label", n);
2899
+ }, [() => rs(".sv-grid-chart-radar-dot", p.get(a)), () => `${p.get(t).label} ${p.get(r).axis}: ${T(p.get(r).value)}`]), p.delegated("mousemove", o, (e) => Qo(e.clientX, e.clientY, p.get(t).label, p.get(r).axis, p.get(r).value, p.get(t).color)), p.event("mouseleave", o, Z), p.event("focus", o, (e) => {
2900
+ is(".sv-grid-chart-radar-dot", p.get(a));
2901
+ let n = os(e.currentTarget);
2902
+ Qo(n.x, n.y, p.get(t).label, p.get(r).axis, p.get(r).value, p.get(t).color);
2903
+ }), p.event("blur", o, Z), p.delegated("keydown", o, (e) => as(e, ".sv-grid-chart-radar-dot", p.get(a))), p.append(e, o);
2904
+ }), p.template_effect((e) => {
2905
+ p.set_attribute(i, "d", p.get(t).path), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(i, "stroke", p.get(t).color), p.set_style(i, e);
2906
+ }, [() => `opacity:${H(p.get(t).label)}`]), p.append(e, r);
2907
+ }), p.append(e, n);
2908
+ };
2909
+ p.if(pc, (e) => {
2910
+ p.get(Ka) && p.get(L).radarCenter && e(mc);
2911
+ });
2912
+ var hc = p.sibling(pc), gc = (e) => {
2913
+ var t = Pn(), n = p.first_child(t);
2914
+ p.each(n, 17, () => p.get(L).calendarMonthTicks, p.index, (e, t, n, r) => {
2915
+ var i = kn(), a = p.child(i, !0);
2916
+ p.reset(i), p.template_effect(() => {
2917
+ p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(L).plot.y - 8), p.set_text(a, p.get(t).label);
2918
+ }), p.append(e, i);
2919
+ });
2920
+ var r = p.sibling(n);
2921
+ p.each(r, 16, () => [
2922
+ "Mon",
2923
+ "Wed",
2924
+ "Fri"
2925
+ ], p.index, (e, t, n) => {
2926
+ let r = p.derived(() => [
2927
+ 1,
2928
+ 3,
2929
+ 5
2930
+ ][n]), i = p.derived(() => p.get(L).calendarCells[p.get(r)]);
2931
+ var a = p.comment(), o = p.first_child(a), s = (e) => {
2932
+ var n = An(), r = p.child(n, !0);
2933
+ p.reset(n), p.template_effect(() => {
2934
+ p.set_attribute(n, "x", p.get(L).plot.x - 6), p.set_attribute(n, "y", p.get(i).y + p.get(i).size / 2 + 3), p.set_text(r, t);
2935
+ }), p.append(e, n);
2936
+ };
2937
+ p.if(o, (e) => {
2938
+ p.get(i) && e(s);
2939
+ }), p.append(e, a);
2940
+ });
2941
+ var i = p.sibling(r);
2942
+ p.each(i, 17, () => p.get(L).calendarCells, p.index, (e, t, n) => {
2943
+ var r = jn();
2944
+ let i;
2945
+ p.template_effect((e, n) => {
2946
+ i = p.set_class(r, 0, "sv-grid-chart-calendar-cell svelte-hyytey", null, i, { "is-blank": !p.get(t).defined }), p.set_attribute(r, "x", p.get(t).x + 1), p.set_attribute(r, "y", p.get(t).y + 1), p.set_attribute(r, "width", p.get(t).size - 2), p.set_attribute(r, "height", p.get(t).size - 2), p.set_attribute(r, "fill", p.get(t).defined ? p.get(t).color : "transparent"), p.set_attribute(r, "tabindex", e), p.set_attribute(r, "aria-label", n);
2947
+ }, [() => rs(".sv-grid-chart-calendar-cell", n), () => `${Bo(p.get(t).date)}: ${p.get(t).defined ? T(p.get(t).value) : p.get(x).noValue}`]), p.delegated("mousemove", r, (e) => p.get(t).defined && X(e.clientX, e.clientY, Bo(p.get(t).date), [{
2948
+ color: p.get(t).color,
2949
+ value: T(p.get(t).value)
2950
+ }])), p.event("mouseleave", r, Z), p.event("focus", r, (e) => {
2951
+ if (is(".sv-grid-chart-calendar-cell", n), p.get(t).defined) {
2952
+ let n = os(e.currentTarget);
2953
+ X(n.x, n.y, Bo(p.get(t).date), [{
2954
+ color: p.get(t).color,
2955
+ value: T(p.get(t).value)
2956
+ }]);
2957
+ }
2958
+ }), p.event("blur", r, Z), p.delegated("keydown", r, (e) => as(e, ".sv-grid-chart-calendar-cell", n, null, {
2959
+ cols: 7,
2960
+ colMajor: !0
2961
+ })), p.append(e, r);
2962
+ });
2963
+ var a = p.sibling(i), o = (e) => {
2964
+ let t = p.derived(() => p.get(L).plot.x + p.get(L).plot.w + 12), n = p.derived(() => p.get(L).plot.y + 4);
2965
+ var r = Nn(), i = p.first_child(r), a = p.sibling(i);
2966
+ p.each(a, 17, () => p.get(L).calendarLegend, p.index, (e, r, i) => {
2967
+ var a = Mn(), o = p.first_child(a), s = p.sibling(o), c = p.child(s, !0);
2968
+ p.reset(s), p.template_effect(() => {
2969
+ p.set_attribute(o, "x", p.get(t)), p.set_attribute(o, "y", p.get(n) + 6 + i * 13), p.set_attribute(o, "fill", p.get(r).color), p.set_attribute(s, "x", p.get(t) + 14), p.set_attribute(s, "y", p.get(n) + 14 + i * 13), p.set_text(c, p.get(r).label);
2970
+ }), p.append(e, a);
2971
+ });
2972
+ var o = p.sibling(a);
2973
+ p.template_effect(() => {
2974
+ p.set_attribute(i, "x", p.get(t)), p.set_attribute(i, "y", p.get(n)), p.set_attribute(o, "x", p.get(t)), p.set_attribute(o, "y", p.get(n) + 12 + p.get(L).calendarLegend.length * 13);
2975
+ }), p.append(e, r);
2976
+ };
2977
+ p.if(a, (e) => {
2978
+ p.get(L).calendarLegend.length && e(o);
2979
+ }), p.append(e, t);
2980
+ };
2981
+ p.if(hc, (e) => {
2982
+ p.get(qa) && e(gc);
2983
+ });
2984
+ var _c = p.sibling(hc), vc = (e) => {
2985
+ let t = p.derived(() => p.get(L).gauge);
2986
+ var n = Rn(), r = p.first_child(n);
2987
+ p.each(r, 17, () => p.get(t).ticks, p.index, (e, t) => {
2988
+ var n = Fn();
2989
+ let r;
2990
+ p.template_effect(() => {
2991
+ r = p.set_class(n, 0, "sv-grid-chart-gauge-tick svelte-hyytey", null, r, { "is-major": p.get(t).major }), p.set_attribute(n, "x1", p.get(t).x1), p.set_attribute(n, "y1", p.get(t).y1), p.set_attribute(n, "x2", p.get(t).x2), p.set_attribute(n, "y2", p.get(t).y2);
2992
+ }), p.append(e, n);
2993
+ });
2994
+ var i = p.sibling(r), a = p.sibling(i);
2995
+ p.each(a, 17, () => p.get(t).rangePaths, p.index, (e, t) => {
2996
+ var n = In();
2997
+ p.template_effect(() => {
2998
+ p.set_attribute(n, "d", p.get(t).path), p.set_attribute(n, "stroke", p.get(t).color);
2999
+ }), p.append(e, n);
3000
+ });
3001
+ var o = p.sibling(a), s = p.sibling(o), c = (e) => {
3002
+ var n = Ln();
3003
+ p.template_effect(() => {
3004
+ p.set_attribute(n, "x1", p.get(t).target.x1), p.set_attribute(n, "y1", p.get(t).target.y1), p.set_attribute(n, "x2", p.get(t).target.x2), p.set_attribute(n, "y2", p.get(t).target.y2);
3005
+ }), p.append(e, n);
3006
+ };
3007
+ p.if(s, (e) => {
3008
+ p.get(t).target && e(c);
3009
+ });
3010
+ var l = p.sibling(s), u = p.sibling(l), d = p.sibling(u), f = p.sibling(d), ee = p.child(f, !0);
3011
+ p.reset(f);
3012
+ var te = p.sibling(f), ne = p.child(te, !0);
3013
+ p.reset(te);
3014
+ var re = p.sibling(te), ie = p.child(re);
3015
+ p.reset(re), p.template_effect((e, n, r, a) => {
3016
+ p.set_attribute(i, "d", p.get(t).trackPath), p.set_attribute(o, "d", p.get(t).valuePath), p.set_attribute(o, "stroke", p.get(t).valueColor ?? "var(--sg-accent, #2563eb)"), p.set_attribute(l, "d", p.get(t).needle.path), p.set_attribute(u, "cx", p.get(t).cx), p.set_attribute(u, "cy", p.get(t).cy), p.set_attribute(u, "r", p.get(t).needle.hubR), p.set_attribute(d, "cx", p.get(t).cx), p.set_attribute(d, "cy", p.get(t).cy), p.set_attribute(f, "x", p.get(t).minLabel.x), p.set_attribute(f, "y", p.get(t).minLabel.y), p.set_text(ee, e), p.set_attribute(te, "x", p.get(t).maxLabel.x), p.set_attribute(te, "y", p.get(t).maxLabel.y), p.set_text(ne, n), p.set_attribute(re, "x", p.get(t).cx), p.set_attribute(re, "y", p.get(t).cy + 38), p.set_text(ie, `${r ?? ""}${a ?? ""}`);
3017
+ }, [
3018
+ () => T(p.get(t).min),
3019
+ () => T(p.get(t).max),
3020
+ () => T(p.get(t).value),
3021
+ () => p.get(t).unit ? /^[%°′″]/.test(p.get(t).unit) ? p.get(t).unit : ` ${p.get(t).unit}` : ""
3022
+ ]), p.append(e, n);
3023
+ };
3024
+ p.if(_c, (e) => {
3025
+ p.get(Ja) && p.get(L).gauge && e(vc);
3026
+ });
3027
+ var yc = p.sibling(_c), bc = (e) => {
3028
+ var t = p.comment(), n = p.first_child(t);
3029
+ p.each(n, 17, () => p.get(L).treemapCells, p.index, (e, t, n) => {
3030
+ var r = Vn(), a = p.first_child(r), o = p.sibling(a), s = (e) => {
3031
+ var n = zn(), r = p.child(n, !0);
3032
+ p.reset(n), p.template_effect((e) => {
3033
+ p.set_attribute(n, "x", p.get(t).x + 4), p.set_attribute(n, "y", p.get(t).y + 12), p.set_attribute(n, "fill", p.get(t).textColor), p.set_text(r, e);
3034
+ }, [() => G(p.get(t).name, Math.max(3, Math.floor(p.get(t).w / 7)))]), p.append(e, n);
3035
+ };
3036
+ p.if(o, (e) => {
3037
+ p.get(t).w > 36 && p.get(t).h > 18 && e(s);
3038
+ });
3039
+ var c = p.sibling(o), l = (e) => {
3040
+ var n = Bn(), r = p.child(n, !0);
3041
+ p.reset(n), p.template_effect((e) => {
3042
+ p.set_attribute(n, "x", p.get(t).x + 4), p.set_attribute(n, "y", p.get(t).y + 24), p.set_attribute(n, "fill", p.get(t).textColor), p.set_text(r, e);
3043
+ }, [() => T(p.get(t).value)]), p.append(e, n);
3044
+ };
3045
+ p.if(c, (e) => {
3046
+ p.get(t).w > 60 && p.get(t).h > 30 && e(l);
3047
+ }), p.template_effect((e, n) => {
3048
+ p.set_attribute(a, "x", p.get(t).x), p.set_attribute(a, "y", p.get(t).y), p.set_attribute(a, "width", p.get(t).w), p.set_attribute(a, "height", p.get(t).h), p.set_attribute(a, "fill", p.get(t).color), p.set_attribute(a, "role", i.onSelect || p.get(U) || p.get(ya) ? "button" : "img"), p.set_attribute(a, "tabindex", e), p.set_attribute(a, "aria-label", n);
3049
+ }, [() => rs(".sv-grid-chart-treemap-cell", n), () => `${p.get(t).name}: ${T(p.get(t).value)}`]), p.delegated("mousemove", a, (e) => X(e.clientX, e.clientY, p.get(t).name, [{
3050
+ color: p.get(t).color,
3051
+ value: T(p.get(t).value)
3052
+ }])), p.event("mouseleave", a, Z), p.event("focus", a, (e) => {
3053
+ is(".sv-grid-chart-treemap-cell", n);
3054
+ let r = os(e.currentTarget);
3055
+ X(r.x, r.y, p.get(t).name, [{
3056
+ color: p.get(t).color,
3057
+ value: T(p.get(t).value)
3058
+ }]);
3059
+ }), p.event("blur", a, Z), p.delegated("click", a, (e) => {
3060
+ p.get(ya) && Ea([...y(), ...ae(p.get(ba), p.get(t).name) ?? []]) || Q(p.get(t).name, "", p.get(t).value, void 0, e);
3061
+ }), p.delegated("keydown", a, (e) => as(e, ".sv-grid-chart-treemap-cell", n, () => {
3062
+ p.get(ya) && Ea([...y(), ...ae(p.get(ba), p.get(t).name) ?? []]) || (i.onSelect || p.get(U)) && Q(p.get(t).name, "", p.get(t).value, void 0, e);
3063
+ })), p.append(e, r);
3064
+ }), p.append(e, t);
3065
+ };
3066
+ p.if(yc, (e) => {
3067
+ p.get(Ya) && e(bc);
3068
+ });
3069
+ var xc = p.sibling(yc), Sc = (e) => {
3070
+ var t = Wn(), n = p.first_child(t);
3071
+ p.each(n, 17, () => p.get(L).sankeyLinks, p.index, (e, t, n) => {
3072
+ var r = Hn();
3073
+ p.template_effect((e, n) => {
3074
+ p.set_attribute(r, "d", p.get(t).path), p.set_attribute(r, "stroke", p.get(t).color), p.set_attribute(r, "stroke-width", p.get(t).width), p.set_attribute(r, "tabindex", e), p.set_attribute(r, "aria-label", n);
3075
+ }, [() => rs(".sv-grid-chart-sankey-link", n), () => `${p.get(t).source} → ${p.get(t).target}: ${T(p.get(t).value)}`]), p.delegated("mousemove", r, (e) => X(e.clientX, e.clientY, `${p.get(t).source} → ${p.get(t).target}`, [{
3076
+ color: p.get(t).color,
3077
+ value: T(p.get(t).value)
3078
+ }])), p.event("mouseleave", r, Z), p.event("focus", r, (e) => {
3079
+ is(".sv-grid-chart-sankey-link", n);
3080
+ let r = os(e.currentTarget);
3081
+ X(r.x, r.y, `${p.get(t).source} → ${p.get(t).target}`, [{
3082
+ color: p.get(t).color,
3083
+ value: T(p.get(t).value)
3084
+ }]);
3085
+ }), p.event("blur", r, Z), p.delegated("keydown", r, (e) => as(e, ".sv-grid-chart-sankey-link", n)), p.append(e, r);
3086
+ });
3087
+ var r = p.sibling(n);
3088
+ p.each(r, 17, () => p.get(L).sankeyNodes, p.index, (e, t, n) => {
3089
+ var r = Un(), i = p.first_child(r), a = p.sibling(i), o = p.child(a, !0);
3090
+ p.reset(a), p.template_effect((e, n) => {
3091
+ p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(t).y), p.set_attribute(i, "width", p.get(t).w), p.set_attribute(i, "height", p.get(t).h), p.set_attribute(i, "fill", p.get(t).color), p.set_attribute(i, "tabindex", e), p.set_attribute(i, "aria-label", n), p.set_attribute(a, "x", p.get(t).column === 0 ? p.get(t).x + p.get(t).w + 4 : p.get(t).x - 4), p.set_attribute(a, "y", p.get(t).y + p.get(t).h / 2 + 3), p.set_attribute(a, "text-anchor", p.get(t).column === 0 ? "start" : "end"), p.set_text(o, p.get(t).label);
3092
+ }, [() => rs(".sv-grid-chart-sankey-node", n), () => b(p.get(x).sankeyNode, {
3093
+ label: p.get(t).label,
3094
+ in: T(p.get(t).totalIn),
3095
+ out: T(p.get(t).totalOut)
3096
+ })]), p.delegated("mousemove", i, (e) => X(e.clientX, e.clientY, p.get(t).label, [{
3097
+ label: "in",
3098
+ value: T(p.get(t).totalIn)
3099
+ }, {
3100
+ label: "out",
3101
+ value: T(p.get(t).totalOut)
3102
+ }])), p.event("mouseleave", i, Z), p.event("focus", i, (e) => {
3103
+ is(".sv-grid-chart-sankey-node", n);
3104
+ let r = os(e.currentTarget);
3105
+ X(r.x, r.y, p.get(t).label, [{
3106
+ label: "in",
3107
+ value: T(p.get(t).totalIn)
3108
+ }, {
3109
+ label: "out",
3110
+ value: T(p.get(t).totalOut)
3111
+ }]);
3112
+ }), p.event("blur", i, Z), p.delegated("keydown", i, (e) => as(e, ".sv-grid-chart-sankey-node", n)), p.append(e, r);
3113
+ }), p.append(e, t);
3114
+ };
3115
+ p.if(xc, (e) => {
3116
+ p.get(Xa) && e(Sc);
3117
+ });
3118
+ var Cc = p.sibling(xc), wc = (e) => {
3119
+ var t = Qn(), r = p.first_child(t), a = (e) => {
3120
+ var t = p.comment(), n = p.first_child(t);
3121
+ p.each(n, 17, () => p.get(L).polarRings, p.index, (e, t) => {
3122
+ var n = Gn();
3123
+ p.template_effect(() => {
3124
+ p.set_attribute(n, "cx", p.get(L).radarCenter.cx), p.set_attribute(n, "cy", p.get(L).radarCenter.cy), p.set_attribute(n, "r", p.get(t));
3125
+ }), p.append(e, n);
3126
+ }), p.append(e, t);
3127
+ };
3128
+ p.if(r, (e) => {
3129
+ p.get(L).radarCenter && p.get(L).polarRings.length && e(a);
3130
+ });
3131
+ var o = p.sibling(r);
3132
+ p.each(o, 17, () => p.get(L).polarAxes, p.index, (e, t) => {
3133
+ var n = Kn(), r = p.child(n, !0);
3134
+ p.reset(n), p.template_effect((e) => {
3135
+ p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(t).y + 3), p.set_attribute(n, "text-anchor", p.get(t).x < (p.get(L).radarCenter?.cx ?? 0) - 2 ? "end" : p.get(t).x > (p.get(L).radarCenter?.cx ?? 0) + 2 ? "start" : "middle"), p.set_text(r, e);
3136
+ }, [() => G(p.get(t).label, 14)]), p.append(e, n);
3137
+ });
3138
+ var s = p.sibling(o);
3139
+ p.each(s, 17, () => p.get(L).arcs, p.index, (e, t) => {
3140
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
3141
+ var n = qn();
3142
+ p.template_effect(() => p.set_attribute(n, "d", p.get(t).trackPath)), p.append(e, n);
3143
+ };
3144
+ p.if(r, (e) => {
3145
+ p.get(t).trackPath && e(i);
3146
+ }), p.append(e, n);
3147
+ });
3148
+ var c = p.sibling(s);
3149
+ p.each(c, 17, () => p.get(L).chordRibbons, p.index, (e, t) => {
3150
+ var n = Jn();
3151
+ p.template_effect((e) => {
3152
+ p.set_attribute(n, "d", p.get(t).path), p.set_attribute(n, "fill", p.get(t).color), p.set_attribute(n, "stroke", p.get(t).color), p.set_style(n, e);
3153
+ }, [() => `opacity:${H(p.get(t).source) === 1 && H(p.get(t).target) === 1 ? 1 : .18}`]), p.delegated("mousemove", n, (e) => Yo(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", n, Z), p.append(e, n);
3154
+ });
3155
+ var l = p.sibling(c);
3156
+ p.each(l, 17, () => p.get(L).arcs, p.index, (e, t, r) => {
3157
+ var a = Yn();
3158
+ let o;
3159
+ p.template_effect((e, n, r, s) => {
3160
+ o = p.set_class(a, 0, "sv-grid-chart-arc svelte-hyytey", null, o, e), p.set_attribute(a, "d", p.get(t).path), p.set_attribute(a, "fill", p.get(t).color), p.set_style(a, n), p.set_attribute(a, "role", i.onSelect || p.get(U) || p.get(ya) && p.get(t).nodePath ? "button" : "img"), p.set_attribute(a, "tabindex", r), p.set_attribute(a, "aria-label", s);
3161
+ }, [
3162
+ () => ({
3163
+ "is-selected": uo(p.get(t).label, p.get(t).series),
3164
+ "is-drillable": p.get(ya) && !!p.get(t).nodePath && !!n(p.get(va), p.get(t).nodePath)?.children?.length
3165
+ }),
3166
+ () => `opacity:${H(p.get(Ha) || p.get(S).type === "sunburst" || p.get(S).type === "chord" ? p.get(t).label : p.get(t).series)}`,
3167
+ () => rs(".sv-grid-chart-arc", r),
3168
+ () => `${p.get(t).nodePath ? p.get(t).nodePath.join(" / ") : p.get(t).label}${p.get(t).series ? ` ${p.get(t).series}` : ""}: ${T(p.get(t).value)}`
3169
+ ]), p.delegated("mousemove", a, (e) => Jo(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", a, Z), p.event("focus", a, (e) => {
3170
+ is(".sv-grid-chart-arc", r);
3171
+ let n = os(e.currentTarget);
3172
+ Jo(n.x, n.y, p.get(t));
3173
+ }), p.event("blur", a, Z), p.delegated("click", a, (e) => {
3174
+ p.get(t).nodePath && Ea(p.get(t).nodePath) || Q(p.get(t).label, p.get(t).series, p.get(t).value, void 0, e);
3175
+ }), p.delegated("keydown", a, (e) => as(e, ".sv-grid-chart-arc", r, () => {
3176
+ p.get(t).nodePath && Ea(p.get(t).nodePath) || (i.onSelect || p.get(U)) && Q(p.get(t).label, p.get(t).series, p.get(t).value, void 0, e);
3177
+ })), p.append(e, a);
3178
+ });
3179
+ var u = p.sibling(l);
3180
+ p.each(u, 17, () => p.get(L).arcs, p.index, (e, t) => {
3181
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
3182
+ var n = p.comment(), r = p.first_child(n), i = (e) => {
3183
+ var n = Xn(), r = p.child(n, !0);
3184
+ p.reset(n), p.template_effect((e) => {
3185
+ p.set_attribute(n, "x", p.get(t).lx), p.set_attribute(n, "y", p.get(t).ly + 3), p.set_attribute(n, "text-anchor", p.get(t).lx < p.get(t).cx - 2 ? "end" : p.get(t).lx > p.get(t).cx + 2 ? "start" : "middle"), p.set_text(r, e);
3186
+ }, [() => G(p.get(t).label, 14)]), p.append(e, n);
3187
+ };
3188
+ p.if(r, (e) => {
3189
+ p.get(t).a1 - p.get(t).a0 > .12 && p.get(S).xAxis?.labels !== !1 && e(i);
3190
+ }), p.append(e, n);
3191
+ }, a = (e) => {
3192
+ var n = Zn(), r = p.child(n, !0);
3193
+ p.reset(n), p.template_effect((e) => {
3194
+ p.set_attribute(n, "x", p.get(t).lx), p.set_attribute(n, "y", p.get(t).ly), p.set_attribute(n, "fill", p.get(t).textColor), p.set_text(r, e);
3195
+ }, [() => G(p.get(ni).show && p.get(S).type !== "sunburst" ? T(p.get(t).value) : p.get(t).label, 12)]), p.append(e, n);
3196
+ };
3197
+ p.if(r, (e) => {
3198
+ p.get(S).type === "chord" ? e(i) : (p.get(t).a1 - p.get(t).a0) * (p.get(t).r0 + p.get(t).r1) / 2 > 34 && p.get(t).r1 - p.get(t).r0 > 12 && (p.get(S).type === "sunburst" || p.get(ni).show) && e(a, 1);
3199
+ }), p.append(e, n);
3200
+ }), p.append(e, t);
3201
+ };
3202
+ p.if(Cc, (e) => {
3203
+ p.get(Ba) && e(wc);
3204
+ });
3205
+ var Tc = p.sibling(Cc), Ec = (e) => {
3206
+ var t = p.comment(), n = p.first_child(t);
3207
+ p.each(n, 17, () => p.get(L).bullets, p.index, (e, t) => {
3208
+ var n = tr(), r = p.child(n);
3209
+ p.each(r, 17, () => p.get(t).ranges, p.index, (e, n) => {
3210
+ var r = $n();
3211
+ p.template_effect(() => {
3212
+ p.set_attribute(r, "x", p.get(n).x), p.set_attribute(r, "y", p.get(t).y), p.set_attribute(r, "width", p.get(n).w), p.set_attribute(r, "height", p.get(t).h), p.set_attribute(r, "fill", p.get(n).color);
3213
+ }), p.append(e, r);
3214
+ });
3215
+ var i = p.sibling(r), a = p.sibling(i), o = (e) => {
3216
+ var n = er();
3217
+ p.template_effect(() => {
3218
+ p.set_attribute(n, "x1", p.get(t).targetX), p.set_attribute(n, "y1", p.get(t).y + p.get(t).h * .15), p.set_attribute(n, "x2", p.get(t).targetX), p.set_attribute(n, "y2", p.get(t).y + p.get(t).h * .85);
3219
+ }), p.append(e, n);
3220
+ };
3221
+ p.if(a, (e) => {
3222
+ p.get(t).targetX != null && e(o);
3223
+ }), p.reset(n), p.template_effect(() => {
3224
+ p.set_attribute(i, "x", p.get(t).x), p.set_attribute(i, "y", p.get(t).y + p.get(t).h * .3), p.set_attribute(i, "width", p.get(t).measureW), p.set_attribute(i, "height", p.get(t).h * .4), p.set_attribute(i, "fill", p.get(t).color);
3225
+ }), p.delegated("mousemove", n, (e) => Xo(e.clientX, e.clientY, p.get(t))), p.event("mouseleave", n, Z), p.append(e, n);
3226
+ }), p.append(e, t);
3227
+ };
3228
+ p.if(Tc, (e) => {
3229
+ p.get(Va) && e(Ec);
3230
+ });
3231
+ var Dc = p.sibling(Tc);
3232
+ p.each(Dc, 17, () => p.get(L).slices, p.index, (e, t, n) => {
3233
+ var r = ir(), a = p.first_child(r);
3234
+ let o;
3235
+ var s = p.sibling(a), c = (e) => {
3236
+ var n = nr(), r = p.first_child(n), i = p.sibling(r), a = p.child(i, !0);
3237
+ p.reset(i), p.template_effect((e) => {
3238
+ p.set_attribute(r, "points", `${p.get(t).callout.x1},${p.get(t).callout.y1} ${p.get(t).callout.x2},${p.get(t).callout.y2} ${p.get(t).callout.x3},${p.get(t).callout.y2}`), p.set_attribute(r, "stroke", p.get(t).color), p.set_attribute(i, "x", p.get(t).callout.tx), p.set_attribute(i, "y", p.get(t).callout.ty + 3.5), p.set_attribute(i, "text-anchor", p.get(t).callout.anchor), p.set_text(a, e);
3239
+ }, [() => p.get(ni).formatter ? p.get(ni).formatter(p.get(t).value, {
3240
+ category: p.get(t).label,
3241
+ series: p.get(t).label
3242
+ }) : `${G(p.get(t).label, Math.min(18, p.get(t).callout.maxChars))} ${p.get(t).percent.toFixed(0)}%`]), p.append(e, n);
3243
+ }, l = (e) => {
3244
+ var n = rr(), r = p.child(n);
3245
+ p.reset(n), p.template_effect((e) => {
3246
+ p.set_attribute(n, "x", p.get(t).cx), p.set_attribute(n, "y", p.get(t).cy), p.set_text(r, `${e ?? ""}%`);
3247
+ }, [() => p.get(t).percent.toFixed(0)]), p.append(e, n);
3248
+ };
3249
+ p.if(s, (e) => {
3250
+ p.get(t).callout ? e(c) : p.get(ni).show && p.get(ni).placement !== "outside" && p.get(t).percent >= 6 && e(l, 1);
3251
+ }), p.template_effect((e, n, r, i, s) => {
3252
+ o = p.set_class(a, 0, "sv-grid-chart-slice svelte-hyytey", null, o, e), p.set_attribute(a, "d", p.get(t).path), p.set_attribute(a, "fill", p.get(t).color), p.set_style(a, n), p.set_attribute(a, "role", r), p.set_attribute(a, "tabindex", i), p.set_attribute(a, "aria-label", s);
3253
+ }, [
3254
+ () => ({
3255
+ "is-selected": uo(p.get(t).label, p.get(t).label),
3256
+ "is-drillable": wa(p.get(t).label)
3257
+ }),
3258
+ () => `opacity:${fo(p.get(t).label, p.get(t).label)}`,
3259
+ () => i.onSelect || p.get(U) || wa(p.get(t).label) ? "button" : "img",
3260
+ () => rs(".sv-grid-chart-slice", n),
3261
+ () => `${p.get(t).label}: ${T(p.get(t).value)}, ${p.get(t).percent.toFixed(1)}%${wa(p.get(t).label) ? p.get(x).drillIn : ""}`
3262
+ ]), p.delegated("mousemove", a, (e) => Wo(e.clientX, e.clientY, p.get(t).label, p.get(t).value, p.get(t).percent)), p.event("mouseleave", a, Z), p.event("focus", a, (e) => {
3263
+ is(".sv-grid-chart-slice", n);
3264
+ let r = os(e.currentTarget);
3265
+ Wo(r.x, r.y, p.get(t).label, p.get(t).value, p.get(t).percent);
3266
+ }), p.event("blur", a, Z), p.delegated("click", a, (e) => {
3267
+ wa(p.get(t).label) && Ea([...y(), p.get(t).label]) || Q(p.get(t).label, p.get(t).label, p.get(t).value, n, e);
3268
+ }), p.delegated("keydown", a, (e) => {
3269
+ ms(e, n) || as(e, ".sv-grid-chart-slice", n, () => {
3270
+ wa(p.get(t).label) && Ea([...y(), p.get(t).label]) || (i.onSelect || p.get(U)) && Q(p.get(t).label, p.get(t).label, p.get(t).value, n, e);
3271
+ });
3272
+ }), p.append(e, r);
3273
+ });
3274
+ var Oc = p.sibling(Dc), kc = (e) => {
3275
+ var t = ar(), n = p.first_child(t), r = p.child(n, !0);
3276
+ p.reset(n);
3277
+ var i = p.sibling(n), a = p.child(i, !0);
3278
+ p.reset(i), p.template_effect((e) => {
3279
+ p.set_attribute(n, "x", p.get(L).donut.cx), p.set_attribute(n, "y", p.get(L).donut.cy - 4), p.set_text(r, e), p.set_attribute(i, "x", p.get(L).donut.cx), p.set_attribute(i, "y", p.get(L).donut.cy + 11), p.set_text(a, p.get(x).total);
3280
+ }, [() => T(p.get(L).donut.total)]), p.append(e, t);
3281
+ };
3282
+ p.if(Oc, (e) => {
3283
+ p.get(L).donut && e(kc);
3284
+ });
3285
+ var Ac = p.sibling(Oc), jc = (e) => {
3286
+ var t = p.comment(), n = p.first_child(t), r = (e) => {
3287
+ var t = or();
3288
+ p.template_effect((e) => {
3289
+ p.set_attribute(t, "x", p.get(L).plot.x), p.set_attribute(t, "y", p.get(L).plot.y), p.set_attribute(t, "width", p.get(L).plot.w), p.set_attribute(t, "height", p.get(L).plot.h), p.set_attribute(t, "role", i.onSelect ? "button" : "img"), p.set_attribute(t, "tabindex", m() ? 0 : void 0), p.set_attribute(t, "data-cat-index", p.get(V)), p.set_attribute(t, "aria-label", e);
3290
+ }, [() => b(p.get(x).densePoints, {
3291
+ count: p.get($a),
3292
+ from: p.get(I).categories[0] ?? "",
3293
+ to: p.get(I).categories[p.get(I).categories.length - 1] ?? ""
3294
+ })]), p.delegated("mousemove", t, (e) => {
3295
+ let t = ro(e.clientX, e.currentTarget);
3296
+ t != null && (p.set(V, t, !0), Ho(e.clientX, e.clientY, t));
3297
+ }), p.event("mouseleave", t, Z), p.event("focus", t, (e) => Uo(e.currentTarget, p.get(V))), p.event("blur", t, Z), p.delegated("click", t, (e) => $o(e, p.get(V))), p.delegated("keydown", t, io), p.append(e, t);
3298
+ }, a = (e) => {
3299
+ var t = p.comment(), n = p.first_child(t);
3300
+ p.each(n, 19, () => p.get(I).categories, (e, t) => e + t, (e, t, n) => {
3301
+ let r = p.derived(() => p.get(L).lines[0]?.points), a = p.derived(() => p.get(r)?.[p.get(n)]?.x), o = p.derived(() => !p.get(B) && p.get(r) && p.get(r).length === p.get(I).categories.length && Number.isFinite(p.get(a))), s = p.derived(() => p.get(o) && p.get(n) > 0 ? p.get(r)[p.get(n) - 1].x : null), c = p.derived(() => p.get(o) && p.get(n) < p.get(r).length - 1 ? p.get(r)[p.get(n) + 1].x : null), l = p.derived(() => p.get(o) ? p.get(s) == null ? p.get(L).plot.x : (p.get(s) + p.get(a)) / 2 : p.get(L).plot.x + p.get(Za) * p.get(n)), u = p.derived(() => p.get(o) ? p.get(c) == null ? p.get(L).plot.x + p.get(L).plot.w : (p.get(a) + p.get(c)) / 2 : p.get(L).plot.x + p.get(Za) * (p.get(n) + 1));
3302
+ var d = sr();
3303
+ p.template_effect((e, t) => {
3304
+ p.set_attribute(d, "x", p.get(B) ? p.get(L).plot.x : p.get(l)), p.set_attribute(d, "y", p.get(B) ? p.get(L).plot.y + p.get(Za) * p.get(n) : p.get(L).plot.y), p.set_attribute(d, "width", e), p.set_attribute(d, "height", p.get(B) ? p.get(Za) : p.get(L).plot.h), p.set_attribute(d, "role", i.onSelect ? "button" : "img"), p.set_attribute(d, "tabindex", m() ? p.get(n) === 0 ? 0 : -1 : void 0), p.set_attribute(d, "data-cat-index", p.get(n)), p.set_attribute(d, "aria-label", t);
3305
+ }, [() => p.get(B) ? p.get(L).plot.w : Math.max(0, p.get(u) - p.get(l)), () => `${p.get(t)}: ${Fo(p.get(n)).map((e) => `${e.label} ${e.value}`).join(", ")}`]), p.delegated("mousemove", d, (e) => Ho(e.clientX, e.clientY, p.get(n), e.currentTarget)), p.event("mouseleave", d, Z), p.event("focus", d, (e) => Uo(e.currentTarget, p.get(n))), p.event("blur", d, Z), p.delegated("click", d, (e) => $o(e, p.get(n))), p.delegated("keydown", d, (e) => ts(e, p.get(n))), p.append(e, d);
3306
+ }), p.append(e, t);
3307
+ };
3308
+ p.if(n, (e) => {
3309
+ p.get(Qa) ? e(r) : e(a, -1);
3310
+ }), p.append(e, t);
3311
+ };
3312
+ p.if(Ac, (e) => {
3313
+ p.get(z) && !p.get(Ua) && e(jc);
3314
+ });
3315
+ var Mc = p.sibling(Ac), Nc = (e) => {
3316
+ var t = cr();
3317
+ p.template_effect(() => {
3318
+ p.set_attribute(t, "x", p.get(Ai).x), p.set_attribute(t, "y", p.get(Ai).y), p.set_attribute(t, "width", p.get(Ai).w), p.set_attribute(t, "height", p.get(Ai).h);
3319
+ }), p.append(e, t);
3320
+ };
3321
+ p.if(Mc, (e) => {
3322
+ p.get(Ai) && e(Nc);
3323
+ }), p.reset($), p.bind_this($, (e) => p.set(k, e), () => p.get(k));
3324
+ var Pc = p.sibling($, 2), Fc = (e) => {
3325
+ let t = p.derived(() => p.get(F).plot.x + p.get(fa).t0 * p.get(F).plot.w), n = p.derived(() => (p.get(fa).t1 - p.get(fa).t0) * p.get(F).plot.w);
3326
+ var r = fr(), i = p.child(r);
3327
+ p.set_attribute(i, "aria-valuemin", 0);
3328
+ var a = p.child(i);
3329
+ p.each(a, 17, () => p.get(F).lines, p.index, (e, t) => {
3330
+ var n = ur(), r = p.first_child(n), i = (e) => {
3331
+ var n = lr();
3332
+ p.template_effect(() => {
3333
+ p.set_attribute(n, "d", p.get(t).areaPath), p.set_attribute(n, "fill", p.get(t).color);
3334
+ }), p.append(e, n);
3335
+ };
3336
+ p.if(r, (e) => {
3337
+ p.get(t).areaPath && e(i);
3338
+ });
3339
+ var a = p.sibling(r);
3340
+ p.template_effect(() => {
3341
+ p.set_attribute(a, "d", p.get(t).path), p.set_attribute(a, "stroke", p.get(t).color);
3342
+ }), p.append(e, n);
3343
+ });
3344
+ var o = p.sibling(a);
3345
+ p.each(o, 17, () => p.get(F).bars, p.index, (e, t) => {
3346
+ var n = dr();
3347
+ p.template_effect(() => {
3348
+ p.set_attribute(n, "x", p.get(t).x), p.set_attribute(n, "y", p.get(t).y), p.set_attribute(n, "width", p.get(t).w), p.set_attribute(n, "height", p.get(t).h), p.set_attribute(n, "fill", p.get(t).color);
3349
+ }), p.append(e, n);
3350
+ });
3351
+ var s = p.sibling(o), c = p.sibling(s), l = p.sibling(c), u = p.sibling(l), d = p.sibling(u);
3352
+ p.reset(i), p.reset(r), p.template_effect((e, r) => {
3353
+ p.set_attribute(i, "viewBox", `0 0 ${p.get(F).width} ${p.get(F).height}`), p.set_attribute(i, "aria-label", p.get(x).rangeBrush), p.set_attribute(i, "aria-valuemax", e), p.set_attribute(i, "aria-valuenow", v()?.i0 ?? 0), p.set_attribute(i, "aria-valuetext", r), p.set_attribute(s, "x", p.get(F).plot.x), p.set_attribute(s, "y", p.get(F).plot.y), p.set_attribute(s, "width", p.get(t) - p.get(F).plot.x), p.set_attribute(s, "height", p.get(F).plot.h), p.set_attribute(c, "x", p.get(t) + p.get(n)), p.set_attribute(c, "y", p.get(F).plot.y), p.set_attribute(c, "width", p.get(F).plot.x + p.get(F).plot.w - (p.get(t) + p.get(n))), p.set_attribute(c, "height", p.get(F).plot.h), p.set_attribute(l, "x", p.get(t)), p.set_attribute(l, "y", p.get(F).plot.y), p.set_attribute(l, "width", p.get(n)), p.set_attribute(l, "height", p.get(F).plot.h), p.set_attribute(u, "x", p.get(t) - 4), p.set_attribute(u, "y", p.get(F).plot.y), p.set_attribute(u, "height", p.get(F).plot.h), p.set_attribute(d, "x", p.get(t) + p.get(n) - 4), p.set_attribute(d, "y", p.get(F).plot.y), p.set_attribute(d, "height", p.get(F).plot.h);
3354
+ }, [() => Math.max(0, p.get(S).categories.length - 1), () => b(p.get(x).brushRange, {
3355
+ from: p.get(S).categories[v()?.i0 ?? 0] ?? "",
3356
+ to: p.get(S).categories[v()?.i1 ?? p.get(S).categories.length - 1] ?? ""
3357
+ })]), p.delegated("pointermove", i, ga), p.delegated("keydown", i, cs), p.delegated("pointerdown", l, (e) => ha(e, "move")), p.delegated("pointerup", l, _a), p.event("pointercancel", l, _a), p.delegated("pointerdown", u, (e) => ha(e, "left")), p.delegated("pointerup", u, _a), p.event("pointercancel", u, _a), p.delegated("pointerdown", d, (e) => ha(e, "right")), p.delegated("pointerup", d, _a), p.event("pointercancel", d, _a), p.bind_element_size(r, "clientHeight", (e) => p.set(Qr, e)), p.append(e, r);
3358
+ };
3359
+ p.if(Pc, (e) => {
3360
+ p.get(ua) && p.get(F) && e(Fc);
3361
+ });
3362
+ var Ic = p.sibling(Pc, 2), Lc = (e) => {
3363
+ var t = pr(), n = p.child(t, !0);
3364
+ p.reset(t), p.template_effect(() => p.set_text(n, p.get(x).noData)), p.append(e, t);
3365
+ };
3366
+ p.if(Ic, (e) => {
3367
+ p.get(wo) && e(Lc);
3368
+ });
3369
+ var Rc = p.sibling(Ic, 2), zc = (e) => {
3370
+ var t = p.comment(), n = p.first_child(t);
3371
+ p.component(n, () => p.get(ds), (e, t) => {
3372
+ t(e, {
3373
+ get items() {
3374
+ return p.get(hs);
3375
+ },
3376
+ get x() {
3377
+ return p.get(us).x;
3378
+ },
3379
+ get y() {
3380
+ return p.get(us).y;
3381
+ },
3382
+ onClose: () => p.set(us, null)
3383
+ });
3384
+ }), p.append(e, t);
3385
+ };
3386
+ p.if(Rc, (e) => {
3387
+ p.get(us) && p.get(ds) && e(zc);
3388
+ });
3389
+ var Bc = p.sibling(Rc, 2), Vc = (e) => {
3390
+ var t = mr();
3391
+ p.remove_input_defaults(t), p.effect(() => p.bind_value(t, () => p.get(Hi), (e) => p.set(Hi, e))), p.action(t, (e) => ia?.(e)), p.template_effect(() => {
3392
+ p.set_attribute(t, "placeholder", p.get(x).noteText), p.set_attribute(t, "aria-label", p.get(x).noteText), p.set_style(t, `left:${p.get(Vi).left}px; top:${p.get(Vi).top}px;`);
3393
+ }), p.delegated("keydown", t, (e) => {
3394
+ e.key === "Enter" ? (e.preventDefault(), Ui()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), p.set(Vi, null), p.set(Hi, ""));
3395
+ }), p.event("blur", t, Ui), p.append(e, t);
3396
+ };
3397
+ p.if(Bc, (e) => {
3398
+ p.get(Vi) && e(Vc);
3399
+ });
3400
+ var Hc = p.sibling(Bc, 2), Uc = (e) => {
3401
+ var t = yr();
3402
+ let n;
3403
+ var r = p.child(t), a = (e) => {
3404
+ var t = p.comment(), n = p.first_child(t);
3405
+ p.snippet(n, () => i.tooltip, () => p.get(q).ctx), p.append(e, t);
3406
+ }, o = (e) => {
3407
+ var t = vr(), n = p.first_child(t), r = p.child(n, !0);
3408
+ p.reset(n);
3409
+ var i = p.sibling(n, 2);
3410
+ p.each(i, 17, () => p.get(q).rows, p.index, (e, t) => {
3411
+ var n = _r(), r = p.child(n), i = (e) => {
3412
+ var n = hr();
3413
+ p.template_effect(() => p.set_style(n, `background:${p.get(t).color}`)), p.append(e, n);
3414
+ };
3415
+ p.if(r, (e) => {
3416
+ p.get(t).color && e(i);
3417
+ });
3418
+ var a = p.sibling(r, 2), o = (e) => {
3419
+ var n = gr(), r = p.child(n, !0);
3420
+ p.reset(n), p.template_effect(() => p.set_text(r, p.get(t).label)), p.append(e, n);
3421
+ };
3422
+ p.if(a, (e) => {
3423
+ p.get(t).label && e(o);
3424
+ });
3425
+ var s = p.sibling(a, 2), c = p.child(s, !0);
3426
+ p.reset(s), p.reset(n), p.template_effect(() => p.set_text(c, p.get(t).value)), p.append(e, n);
3427
+ }), p.template_effect(() => p.set_text(r, p.get(q).title)), p.append(e, t);
3428
+ };
3429
+ p.if(r, (e) => {
3430
+ i.tooltip ? e(a) : e(o, -1);
3431
+ }), p.reset(t), p.template_effect(() => {
3432
+ n = p.set_class(t, 1, "sv-grid-chart-tooltip svelte-hyytey", null, n, {
3433
+ "is-below": p.get(q).below,
3434
+ "is-custom": !!i.tooltip,
3435
+ "is-fixed": p.get(q).fixed,
3436
+ "is-right": h() === "top-right" || h() === "bottom-right",
3437
+ "is-bottom": h() === "bottom-left" || h() === "bottom-right",
3438
+ "is-pinned": !!p.get(J)
3439
+ }), p.set_style(t, `left:${p.get(q).left}px; top:${p.get(q).top}px;`);
3440
+ }), p.append(e, t);
3441
+ };
3442
+ p.if(Hc, (e) => {
3443
+ p.get(q) && e(Uc);
3444
+ });
3445
+ var Wc = p.sibling(Hc, 2), Gc = (e) => {
3446
+ var t = Cr();
3447
+ let n;
3448
+ var r = p.child(t);
3449
+ p.each(r, 19, () => p.get(Co), (e) => e.label, (e, t, n) => {
3450
+ var r = xr();
3451
+ let a;
3452
+ var o = p.child(r), s = (e) => {
3453
+ var r = p.comment(), a = p.first_child(r);
3454
+ p.snippet(a, () => i.legendItem, () => ({
3455
+ label: p.get(t).label,
3456
+ color: p.get(t).color,
3457
+ off: p.get(t).off,
3458
+ index: p.get(n)
3459
+ })), p.append(e, r);
3460
+ }, c = (e) => {
3461
+ var n = br(), r = p.first_child(n), i = p.sibling(r);
3462
+ p.template_effect(() => {
3463
+ p.set_style(r, `background:${p.get(t).off ? "transparent" : p.get(t).color}; border-color:${p.get(t).color}`), p.set_text(i, ` ${p.get(t).label ?? ""}`);
3464
+ }), p.append(e, n);
3465
+ };
3466
+ p.if(o, (e) => {
3467
+ i.legendItem ? e(s) : e(c, -1);
3468
+ }), p.reset(r), p.template_effect(() => {
3469
+ a = p.set_class(r, 1, "sv-grid-chart-legend-item svelte-hyytey", null, a, {
3470
+ "is-off": p.get(t).off,
3471
+ "is-isolated": p.get(li) === p.get(t).label
3472
+ }), r.disabled = !m() || !p.get(bo), p.set_attribute(r, "aria-pressed", p.get(bo) ? !p.get(t).off : void 0), p.set_attribute(r, "title", m() ? `${p.get(t).off ? p.get(x).showSeries : p.get(x).hideSeries} ${p.get(t).label} \u00b7 ${p.get(x).isolateHint}` : p.get(t).label);
3473
+ }), p.delegated("click", r, () => Eo(p.get(t).label)), p.delegated("dblclick", r, () => Do(p.get(t).label)), p.event("pointerenter", r, () => m() && p.set(di, p.get(t).label, !0)), p.event("pointerleave", r, () => p.set(di, null)), p.append(e, r);
3474
+ });
3475
+ var a = p.sibling(r, 2), o = (e) => {
3476
+ var t = Sr(), n = p.child(t, !0);
3477
+ p.reset(t), p.template_effect((e) => p.set_text(n, e), [() => p.get(xo) ? p.get(x).showLess : b(p.get(x).showMore, { n: p.get(ho).length - 10 })]), p.delegated("click", t, () => p.set(xo, !p.get(xo))), p.append(e, t);
3478
+ };
3479
+ p.if(a, (e) => {
3480
+ p.get(So) && e(o);
3481
+ }), p.reset(t), p.template_effect(() => n = p.set_class(t, 1, "sv-grid-chart-legend svelte-hyytey", null, n, { "is-vertical": p.get(Jr) })), p.bind_element_size(t, "clientWidth", (e) => p.set(Xr, e)), p.bind_element_size(t, "clientHeight", (e) => p.set(Zr, e)), p.append(e, t);
3482
+ };
3483
+ p.if(Wc, (e) => {
3484
+ p.get(qr) && p.get(ho).length && e(Gc);
3485
+ });
3486
+ var Kc = p.sibling(Wc, 2), qc = (e) => {
3487
+ var t = wr(), n = p.child(t, !0);
3488
+ p.reset(t), p.template_effect(() => p.set_text(n, p.get(mo))), p.append(e, t);
3489
+ };
3490
+ p.if(Kc, (e) => {
3491
+ Ee() && e(qc);
3492
+ });
3493
+ var Jc = p.sibling(Kc, 2), Yc = p.child(Jc), Xc = p.child(Yc), Zc = p.child(Xc, !0), Qc = p.sibling(Zc), $c = (e) => {
3494
+ var t = p.text();
3495
+ p.template_effect((e) => p.set_text(t, e), [() => b(p.get(x).dataTableCapped, {
3496
+ shown: to,
3497
+ total: p.get(ko).rows.length
3498
+ })]), p.append(e, t);
3499
+ };
3500
+ p.if(Qc, (e) => {
3501
+ p.get(Ao) && e($c);
3502
+ });
3503
+ var el = p.sibling(Qc), tl = (e) => {
3504
+ var t = p.text();
3505
+ p.template_effect(() => p.set_text(t, `. ${p.get(zr) ?? ""}`)), p.append(e, t);
3506
+ };
3507
+ p.if(el, (e) => {
3508
+ Ar() && p.get(zr) && e(tl);
3509
+ }), p.reset(Xc);
3510
+ var nl = p.sibling(Xc), rl = p.child(nl);
3511
+ p.each(rl, 20, () => p.get(ko).cols, (e) => e, (e, t) => {
3512
+ var n = Tr(), r = p.child(n, !0);
3513
+ p.reset(n), p.template_effect(() => p.set_text(r, t)), p.append(e, n);
3514
+ }), p.reset(rl), p.reset(nl);
3515
+ var il = p.sibling(nl);
3516
+ p.each(il, 21, () => p.get(jo), p.index, (e, t) => {
3517
+ var n = Dr();
3518
+ p.each(n, 21, () => p.get(t), p.index, (e, t) => {
3519
+ var n = Er(), r = p.child(n, !0);
3520
+ p.reset(n), p.template_effect(() => p.set_text(r, p.get(t))), p.append(e, n);
3521
+ }), p.reset(n), p.append(e, n);
3522
+ }), p.reset(il), p.reset(Yc), p.reset(Jc), p.reset(ws), p.bind_this(ws, (e) => p.set(K, e), () => p.get(K)), p.template_effect((e, n, o) => {
3523
+ t = p.set_class($, 0, "sv-grid-chart-svg svelte-hyytey", null, t, {
3524
+ "is-interactive": m(),
3525
+ "is-clickable": !!i.onSelect || !!i.onDrill,
3526
+ "is-zoomable": !!p.get(C)?.drag && p.get(z) && !p.get(w) && !p.get(ri),
3527
+ "is-pannable": !!p.get(C)?.pan && p.get(z) && p.get(_i) && p.get(ri),
3528
+ "is-annotating": p.get(w),
3529
+ "is-dragging": !!p.get(A),
3530
+ "is-drawing": !!p.get(M)
3531
+ }), p.set_attribute($, "viewBox", `0 0 ${p.get(L).width} ${p.get(L).height}`), p.set_attribute($, "role", m() ? "group" : "img"), p.set_attribute($, "aria-label", n), p.set_attribute($, "aria-description", Ar() && p.get(zr) ? p.get(zr) : void 0), p.set_attribute($, "aria-describedby", `${E}-table`), r = p.set_style($, "", r, { height: Ir() ? `${p.get(ti) ?? p.get(S).height ?? 300}px` : null }), a = p.set_class(Vs, 0, "sv-grid-chart-marks svelte-hyytey", null, a, {
3532
+ "is-enter-grow": p.get(Pa) === "grow",
3533
+ "is-enter-none": p.get(Pa) === "none"
3534
+ }), p.set_attribute(Vs, "clip-path", p.get(z) ? `url(#${E}-plot)` : void 0), s = p.set_class($s, 0, "sv-grid-chart-marks svelte-hyytey", null, s, {
3535
+ "is-enter-grow": p.get(Pa) === "grow",
3536
+ "is-enter-none": p.get(Pa) === "none"
3537
+ }), p.set_attribute($s, "clip-path", p.get(z) ? `url(#${E}-plot)` : void 0), p.set_attribute(Yc, "id", `${E}-table`), p.set_text(Zc, o);
3538
+ }, [
3539
+ () => te(p.get(S).style) || void 0,
3540
+ () => b(p.get(x).chartLabel, { type: p.get(S).type }),
3541
+ () => b(p.get(x).dataTable, { type: p.get(S).type })
3542
+ ]), p.delegated("pointerdown", $, Ni), p.delegated("pointermove", $, (e) => {
3543
+ Pi(e), Qi(e);
3544
+ }), p.delegated("pointerup", $, (e) => {
3545
+ Fi(e), p.set(Wi, null);
3546
+ }), p.event("pointercancel", $, (e) => {
3547
+ Fi(e), p.set(Wi, null);
3548
+ }), p.delegated("click", $, Zi), p.delegated("keydown", $, ta), p.event("wheel", $, Ti), p.delegated("contextmenu", $, fs), p.delegated("dblclick", $, Ii), p.bind_element_size(ws, "clientWidth", (e) => p.set(Vr, e)), p.bind_element_size(ws, "clientHeight", (e) => p.set(Hr, e));
3549
+ }
3550
+ return p.template_effect((e, t, n) => {
3551
+ Ts = p.set_class(ws, 1, "sv-grid-chart svelte-hyytey", null, Ts, {
3552
+ "is-autosize": Ir(),
3553
+ "is-legend-top": p.get(qr) === "top",
3554
+ "is-legend-left": p.get(qr) === "left",
3555
+ "is-legend-right": p.get(qr) === "right"
3556
+ }), p.set_style(ws, e);
3557
+ }, [
3558
+ () => te(p.get(S).style) || void 0,
3559
+ () => b(p.get(x).chartLabel, { type: p.get(S).type }),
3560
+ () => b(p.get(x).dataTable, { type: p.get(S).type })
3561
+ ]), p.append(e, ws), p.pop(Cs);
3562
+ }
3563
+ p.delegate([
3564
+ "click",
3565
+ "pointerdown",
3566
+ "pointermove",
3567
+ "pointerup",
3568
+ "keydown",
3569
+ "contextmenu",
3570
+ "dblclick",
3571
+ "mousemove"
3572
+ ]);
3573
+ //#endregion
3574
+ export { ye as a, ge as c, fe as d, pe as f, De as i, he as l, b as n, _e as o, ue as p, Ee as r, ve as s, Ar as t, de as u };