uplot-plus 0.5.5 → 0.5.10

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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var xn = Object.defineProperty;
2
2
  var Cn = (t, e, n) => e in t ? xn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var X = (t, e, n) => Cn(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { jsx as B, jsxs as ft, Fragment as kn } from "react/jsx-runtime";
5
- import { useRef as N, useSyncExternalStore as Wt, useContext as Tn, createContext as An, useEffect as Z, useState as Mt, useLayoutEffect as Ut, forwardRef as In, useMemo as Ln, useCallback as Gt } from "react";
4
+ import { jsx as V, jsxs as dt, Fragment as kn } from "react/jsx-runtime";
5
+ import { useRef as Y, useSyncExternalStore as Gt, useContext as Tn, createContext as An, useEffect as rt, useState as ut, useLayoutEffect as j, useCallback as Lt, forwardRef as In, useMemo as Pn } from "react";
6
6
  function ai(t = 0.15) {
7
7
  return (e) => {
8
8
  e.focusAlpha = t;
@@ -17,24 +17,24 @@ const ue = [
17
17
  ["pinch", "zoomX"],
18
18
  ["touchDrag", "zoomX"]
19
19
  ];
20
- var U = /* @__PURE__ */ ((t) => (t[t.Top = 0] = "Top", t[t.Right = 1] = "Right", t[t.Bottom = 2] = "Bottom", t[t.Left = 3] = "Left", t))(U || {}), W = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(W || {}), O = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(O || {}), j = /* @__PURE__ */ ((t) => (t[t.Linear = 1] = "Linear", t[t.Ordinal = 2] = "Ordinal", t[t.Log = 3] = "Log", t[t.Asinh = 4] = "Asinh", t))(j || {}), Ft = /* @__PURE__ */ ((t) => (t[t.Ascending = 1] = "Ascending", t[t.Descending = -1] = "Descending", t[t.Unsorted = 0] = "Unsorted", t))(Ft || {});
21
- function _t(t) {
20
+ var N = /* @__PURE__ */ ((t) => (t[t.Top = 0] = "Top", t[t.Right = 1] = "Right", t[t.Bottom = 2] = "Bottom", t[t.Left = 3] = "Left", t))(N || {}), W = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(W || {}), O = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(O || {}), q = /* @__PURE__ */ ((t) => (t[t.Linear = 1] = "Linear", t[t.Ordinal = 2] = "Ordinal", t[t.Log = 3] = "Log", t[t.Asinh = 4] = "Asinh", t))(q || {}), Ht = /* @__PURE__ */ ((t) => (t[t.Ascending = 1] = "Ascending", t[t.Descending = -1] = "Descending", t[t.Unsorted = 0] = "Unsorted", t))(Ht || {});
21
+ function Et(t) {
22
22
  return t % 2;
23
23
  }
24
24
  var it = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Scales = 1] = "Scales", t[t.Axes = 2] = "Axes", t[t.Paths = 4] = "Paths", t[t.Cursor = 8] = "Cursor", t[t.Select = 16] = "Select", t[t.Size = 32] = "Size", t[t.Full = 63] = "Full", t))(it || {});
25
- const nt = Math, Qt = nt.PI, rt = nt.abs, at = nt.floor, R = nt.round, Ht = nt.ceil, fe = nt.min, Lt = nt.max, yt = nt.pow, Ae = nt.sign, lt = nt.log10, Dt = nt.log2, Pn = (t, e = 1) => nt.sinh(t) * e, ge = (t, e = 1) => nt.asinh(t / e), Q = 1 / 0, Ze = Number.isInteger;
26
- function te(t, e) {
25
+ const nt = Math, te = nt.PI, lt = nt.abs, ft = nt.floor, R = nt.round, Wt = nt.ceil, fe = nt.min, _t = nt.max, xt = nt.pow, Te = nt.sign, ct = nt.log10, Ft = nt.log2, Ln = (t, e = 1) => nt.sinh(t) * e, de = (t, e = 1) => nt.asinh(t / e), Q = 1 / 0, qe = Number.isInteger;
26
+ function ee(t, e) {
27
27
  return t[e] ?? 0;
28
28
  }
29
- function wt(t, e, n = 0, o = e.length - 1) {
29
+ function St(t, e, n = 0, o = e.length - 1) {
30
30
  let s;
31
31
  const r = o <= 2147483647;
32
32
  for (; o - n > 1; )
33
- s = r ? n + o >> 1 : at((n + o) / 2), te(e, s) < t ? n = s : o = s;
34
- return t - te(e, n) <= te(e, o) - t ? n : o;
33
+ s = r ? n + o >> 1 : ft((n + o) / 2), ee(e, s) < t ? n = s : o = s;
34
+ return t - ee(e, n) <= ee(e, o) - t ? n : o;
35
35
  }
36
- const Je = (t) => t != null, Qe = (t) => t != null && t > 0;
37
- function tn(t) {
36
+ const Ze = (t) => t != null, Je = (t) => t != null && t > 0;
37
+ function Qe(t) {
38
38
  return (e, n, o) => {
39
39
  let s = -1, r = -1;
40
40
  for (let i = n; i <= o; i++)
@@ -50,14 +50,14 @@ function tn(t) {
50
50
  return [s, r];
51
51
  };
52
52
  }
53
- const Kt = tn(Je), en = tn(Qe);
54
- function _n(t, e, n, o = Ft.Unsorted, s = !1) {
55
- const r = s ? en : Kt, i = s ? Qe : Je, [l, c] = r(t, e, n);
53
+ const Ot = Qe(Ze), tn = Qe(Je);
54
+ function _n(t, e, n, o = Ht.Unsorted, s = !1) {
55
+ const r = s ? tn : Ot, i = s ? Je : Ze, [l, c] = r(t, e, n);
56
56
  let f = t[l] ?? Q, a = t[l] ?? -Q;
57
57
  if (l > -1)
58
- if (o === Ft.Ascending)
58
+ if (o === Ht.Ascending)
59
59
  f = t[l] ?? Q, a = t[c] ?? -Q;
60
- else if (o === Ft.Descending)
60
+ else if (o === Ht.Descending)
61
61
  f = t[c] ?? Q, a = t[l] ?? -Q;
62
62
  else
63
63
  for (let d = l; d <= c; d++) {
@@ -66,19 +66,19 @@ function _n(t, e, n, o = Ft.Unsorted, s = !1) {
66
66
  }
67
67
  return [f, a];
68
68
  }
69
- function ut(t, e = 0) {
70
- if (Ze(t))
69
+ function ht(t, e = 0) {
70
+ if (qe(t))
71
71
  return t;
72
72
  const n = 10 ** e, o = t * n * (1 + Number.EPSILON);
73
73
  return R(o) / n;
74
74
  }
75
- const Pt = /* @__PURE__ */ new Map();
75
+ const Dt = /* @__PURE__ */ new Map();
76
76
  function Dn(t) {
77
77
  return (String(t).split(".")[1] ?? "").length;
78
78
  }
79
79
  const En = /\.\d*?(?=9{6,}|0{6,})/gm;
80
- function Ct(t) {
81
- if (Ze(t) || Pt.has(t))
80
+ function kt(t) {
81
+ if (qe(t) || Dt.has(t))
82
82
  return t;
83
83
  const e = `${t}`, n = e.match(En);
84
84
  if (n == null)
@@ -86,38 +86,38 @@ function Ct(t) {
86
86
  const o = n[0].length - 1;
87
87
  if (e.indexOf("e-") !== -1) {
88
88
  const s = e.split("e"), r = s[0] ?? "0", i = s[1] ?? "0";
89
- return +`${Ct(+r)}e${i}`;
89
+ return +`${kt(+r)}e${i}`;
90
90
  }
91
- return ut(t, o);
91
+ return ht(t, o);
92
92
  }
93
93
  function Fn(t, e, n = !0) {
94
- return n ? Ct(ut(Ct(t / e)) * e) : ut(t / e) * e;
94
+ return n ? kt(ht(kt(t / e)) * e) : ht(t / e) * e;
95
95
  }
96
- function pe(t, e, n = !0) {
97
- return n ? Ct(Ht(Ct(t / e)) * e) : Ht(t / e) * e;
96
+ function ge(t, e, n = !0) {
97
+ return n ? kt(Wt(kt(t / e)) * e) : Wt(t / e) * e;
98
98
  }
99
- function nn(t, e, n = !0) {
100
- return n ? Ct(at(Ct(t / e)) * e) : at(t / e) * e;
99
+ function en(t, e, n = !0) {
100
+ return n ? kt(ft(kt(t / e)) * e) : ft(t / e) * e;
101
101
  }
102
102
  function zn(t) {
103
103
  return t === 0 ? (e) => e : t === 1 ? R : (e) => Fn(e, t);
104
104
  }
105
- function on(t, e, n, o) {
105
+ function nn(t, e, n, o) {
106
106
  const s = [], r = o.map(Dn);
107
107
  for (let i = e; i < n; i++) {
108
- const l = rt(i);
108
+ const l = lt(i);
109
109
  for (let c = 0; c < o.length; c++) {
110
110
  const f = o[c] ?? 0, a = r[c] ?? 0, d = +`${f}e${i}`, u = (i >= 0 ? 0 : l) + (i >= a ? 0 : a), h = d;
111
- s.push(h), Pt.set(h, u);
111
+ s.push(h), Dt.set(h, u);
112
112
  }
113
113
  }
114
114
  return s;
115
115
  }
116
116
  function tt(t, e, n) {
117
- return fe(Lt(t, e), n);
117
+ return fe(_t(t, e), n);
118
118
  }
119
- const Hn = new Intl.NumberFormat(), sn = (t) => Hn.format(t);
120
- function Ie(t, e, n) {
119
+ const Hn = new Intl.NumberFormat(), on = (t) => Hn.format(t);
120
+ function Ae(t, e, n) {
121
121
  for (; e <= n; ) {
122
122
  if (t[e] != null)
123
123
  return !0;
@@ -125,52 +125,52 @@ function Ie(t, e, n) {
125
125
  }
126
126
  return !1;
127
127
  }
128
- const $n = 0.1, gt = {
128
+ const $n = 0.1, mt = {
129
129
  mode: 3,
130
130
  pad: $n,
131
131
  soft: null
132
- }, zt = { pad: 0, soft: null, mode: 0 }, Wn = { min: zt, max: zt };
133
- function ee(t, e, n, o) {
132
+ }, $t = { pad: 0, soft: null, mode: 0 }, Wn = { min: $t, max: $t };
133
+ function ne(t, e, n, o) {
134
134
  let s;
135
- typeof n == "number" ? (zt.pad = n, zt.soft = null, zt.mode = 0, s = Wn) : s = n;
136
- const r = s.min, i = s.max, l = r.pad, c = i.pad, f = r.hard ?? -Q, a = i.hard ?? Q, d = r.soft ?? Q, u = i.soft ?? -Q, h = r.mode, p = i.mode;
135
+ typeof n == "number" ? ($t.pad = n, $t.soft = null, $t.mode = 0, s = Wn) : s = n;
136
+ const r = s.min, i = s.max, l = r.pad, c = i.pad, f = r.hard ?? -Q, a = i.hard ?? Q, d = r.soft ?? Q, u = i.soft ?? -Q, h = r.mode, g = i.mode;
137
137
  let w = e - t;
138
- const b = lt(w), g = Lt(rt(t), rt(e)), m = lt(g), M = rt(m - b);
139
- (w < 1e-24 || M > 10) && (w = 0, (t === 0 || e === 0) && (w = 1e-24));
140
- const v = w || g || 1e3, D = lt(v), T = yt(10, at(D)), y = v * (w === 0 ? t === 0 ? 0.1 : 1 : l), x = ut(nn(t - y, T / 10), 24), A = h === 1 || h === 3 && x <= d || h === 2 && x >= d, L = t >= d && A ? d : Q, k = Lt(f, x < L && t >= L ? L : fe(L, x)), E = v * (w === 0 ? e === 0 ? 0.1 : 1 : c), P = ut(pe(e + E, T / 10), 24), F = p === 1 || p === 3 && P >= u || p === 2 && P <= u, $ = e <= u && F ? u : -Q, S = fe(a, P > $ && e <= $ ? $ : Lt($, P));
141
- return k === S && k === 0 ? [-1, 1] : [k, S];
138
+ const S = ct(w), b = _t(lt(t), lt(e)), M = ct(b), p = lt(M - S);
139
+ (w < 1e-24 || p > 10) && (w = 0, (t === 0 || e === 0) && (w = 1e-24));
140
+ const m = w || b || 1e3, T = ct(m), A = xt(10, ft(T)), y = m * (w === 0 ? t === 0 ? 0.1 : 1 : l), x = ht(en(t - y, A / 10), 24), P = h === 1 || h === 3 && x <= d || h === 2 && x >= d, L = t >= d && P ? d : Q, F = _t(f, x < L && t >= L ? L : fe(L, x)), I = m * (w === 0 ? e === 0 ? 0.1 : 1 : c), C = ht(ge(e + I, A / 10), 24), E = g === 1 || g === 3 && C >= u || g === 2 && C <= u, H = e <= u && E ? u : -Q, v = fe(a, C > H && e <= H ? H : _t(H, C));
141
+ return F === v && F === 0 ? [-1, 1] : [F, v];
142
142
  }
143
- function rn(t, e, n, o) {
143
+ function sn(t, e, n, o) {
144
144
  n === 2 && (o = !0);
145
- const s = Ae(t), r = Ae(e);
145
+ const s = Te(t), r = Te(e);
146
146
  t === e && (s === -1 ? (t *= n, e /= n) : (t /= n, e *= n));
147
- const i = n === 10 ? lt : Dt, l = s === 1 ? at : Ht, c = r === 1 ? Ht : at, f = i(rt(t)), a = i(rt(e)), d = l(f), u = c(a);
148
- let h = yt(n, d), p = yt(n, u);
149
- return n === 10 && (d < 0 && (h = ut(h, -d)), u < 0 && (p = ut(p, -u))), o ? (t = h * s, e = p * r) : (t = nn(t, yt(n, at(f)), !1), e = pe(e, yt(n, at(a)), !1)), [t, e];
147
+ const i = n === 10 ? ct : Ft, l = s === 1 ? ft : Wt, c = r === 1 ? Wt : ft, f = i(lt(t)), a = i(lt(e)), d = l(f), u = c(a);
148
+ let h = xt(n, d), g = xt(n, u);
149
+ return n === 10 && (d < 0 && (h = ht(h, -d)), u < 0 && (g = ht(g, -u))), o ? (t = h * s, e = g * r) : (t = en(t, xt(n, ft(f)), !1), e = ge(e, xt(n, ft(a)), !1)), [t, e];
150
150
  }
151
- function Gn(t, e, n, o) {
152
- const s = rn(t, e, n, o);
151
+ function Rn(t, e, n, o) {
152
+ const s = sn(t, e, n, o);
153
153
  return t === 0 && (s[0] = 0), e === 0 && (s[1] = 0), s;
154
154
  }
155
- function Le(t) {
156
- return (lt((t ^ t >> 31) - (t >> 31)) | 0) + 1;
155
+ function Ie(t) {
156
+ return (ct((t ^ t >> 31) - (t >> 31)) | 0) + 1;
157
157
  }
158
- function Rn(t, e, n, o, s) {
159
- const r = Lt(Le(t), Le(e)), i = e - t;
160
- let l = Lt(0, wt(s / o * i, n) - 1);
158
+ function Gn(t, e, n, o, s) {
159
+ const r = _t(Ie(t), Ie(e)), i = e - t;
160
+ let l = _t(0, St(s / o * i, n) - 1);
161
161
  do {
162
162
  const c = n[l] ?? 0, f = o * c / i;
163
- if (f >= s * 0.9 && r + (c < 5 ? Pt.get(c) ?? 0 : 0) <= 17)
163
+ if (f >= s * 0.9 && r + (c < 5 ? Dt.get(c) ?? 0 : 0) <= 17)
164
164
  return [c, f];
165
165
  } while (++l < n.length);
166
166
  return [0, 0];
167
167
  }
168
- function Vn(t) {
168
+ function Bn(t) {
169
169
  return {
170
170
  id: t.id,
171
171
  min: t.min ?? null,
172
172
  max: t.max ?? null,
173
- distr: t.distr ?? j.Linear,
173
+ distr: t.distr ?? q.Linear,
174
174
  log: t.log ?? 10,
175
175
  asinh: t.asinh ?? 1,
176
176
  ori: t.ori ?? (t.id === "x" ? W.Horizontal : W.Vertical),
@@ -188,55 +188,55 @@ function Vn(t) {
188
188
  function K(t) {
189
189
  return t.min != null && t.max != null;
190
190
  }
191
- function ht(t) {
191
+ function gt(t) {
192
192
  t._min = null, t._max = null;
193
193
  }
194
- function ln(t) {
194
+ function rn(t) {
195
195
  if (t._min != null) return t._min;
196
196
  const { min: e, distr: n } = t;
197
197
  if (e == null) return 0;
198
- if (n === j.Log) {
198
+ if (n === q.Log) {
199
199
  e <= 0 && console.warn(`[uPlot+] Log scale "${t.id}": min value ${e} <= 0, clamping to 1e-10`);
200
200
  const o = e > 0 ? e : 1e-10;
201
- t._min = (t.log === 10 ? lt : Dt)(o);
202
- } else n === j.Asinh ? t._min = ge(e, t.asinh) : t._min = e;
201
+ t._min = (t.log === 10 ? ct : Ft)(o);
202
+ } else n === q.Asinh ? t._min = de(e, t.asinh) : t._min = e;
203
203
  return t._min;
204
204
  }
205
- function cn(t) {
205
+ function ln(t) {
206
206
  if (t._max != null) return t._max;
207
207
  const { max: e, distr: n } = t;
208
208
  if (e == null) return 0;
209
- if (n === j.Log) {
209
+ if (n === q.Log) {
210
210
  e <= 0 && console.warn(`[uPlot+] Log scale "${t.id}": max value ${e} <= 0, clamping to 1e-10`);
211
211
  const o = e > 0 ? e : 1e-10;
212
- t._max = (t.log === 10 ? lt : Dt)(o);
213
- } else n === j.Asinh ? t._max = ge(e, t.asinh) : t._max = e;
212
+ t._max = (t.log === 10 ? ct : Ft)(o);
213
+ } else n === q.Asinh ? t._max = de(e, t.asinh) : t._max = e;
214
214
  return t._max;
215
215
  }
216
- function Bn(t, e) {
216
+ function Vn(t, e) {
217
217
  if (e.min == null || e.max == null) return 0;
218
- const n = ln(e), s = cn(e) - n;
218
+ const n = rn(e), s = ln(e) - n;
219
219
  if (s === 0) return 0;
220
220
  const { distr: r } = e;
221
- if (r === j.Log) {
222
- const i = e.log === 10 ? lt : Dt, l = t > 0 ? t : 1e-10;
221
+ if (r === q.Log) {
222
+ const i = e.log === 10 ? ct : Ft, l = t > 0 ? t : 1e-10;
223
223
  return (i(l) - n) / s;
224
224
  }
225
- return r === j.Asinh ? (ge(t, e.asinh) - n) / s : (t - n) / s;
225
+ return r === q.Asinh ? (de(t, e.asinh) - n) / s : (t - n) / s;
226
226
  }
227
227
  function Xn(t, e) {
228
228
  if (e.min == null || e.max == null) return 0;
229
- const n = ln(e), o = cn(e);
229
+ const n = rn(e), o = ln(e);
230
230
  if (o === n) return e.min;
231
231
  const { distr: s } = e;
232
- return s === j.Log ? Math.pow(e.log, n + t * (o - n)) : s === j.Asinh ? Pn(n + t * (o - n), e.asinh) : n + t * (o - n);
232
+ return s === q.Log ? Math.pow(e.log, n + t * (o - n)) : s === q.Asinh ? Ln(n + t * (o - n), e.asinh) : n + t * (o - n);
233
233
  }
234
- function V(t, e, n, o) {
235
- const s = Bn(t, e);
234
+ function B(t, e, n, o) {
235
+ const s = Vn(t, e);
236
236
  let r;
237
237
  return e.ori === W.Horizontal ? r = e.dir === O.Forward ? s : 1 - s : r = e.dir === O.Forward ? 1 - s : s, o + r * n;
238
238
  }
239
- function vt(t, e, n, o) {
239
+ function bt(t, e, n, o) {
240
240
  if (n === 0) return e.min ?? 0;
241
241
  let s = (t - o) / n;
242
242
  return e.ori === W.Horizontal ? e.dir === O.Backward && (s = 1 - s) : e.dir !== O.Backward && (s = 1 - s), Xn(s, e);
@@ -251,7 +251,7 @@ class Yn {
251
251
  X(this, "groupXScales", /* @__PURE__ */ new Map());
252
252
  }
253
253
  addScale(e) {
254
- this.scales.set(e.id, Vn(e));
254
+ this.scales.set(e.id, Bn(e));
255
255
  }
256
256
  removeScale(e) {
257
257
  this.scales.delete(e);
@@ -276,7 +276,7 @@ class Yn {
276
276
  */
277
277
  setRange(e, n, o) {
278
278
  const s = this.scales.get(e);
279
- s && (s.min = n, s.max = o, ht(s));
279
+ s && (s.min = n, s.max = o, gt(s));
280
280
  }
281
281
  /**
282
282
  * Auto-range only x-scales from data (cheap: just reads first/last x values).
@@ -290,42 +290,42 @@ class Yn {
290
290
  if (!d || !d.auto) continue;
291
291
  const u = e[f];
292
292
  if (!u || u.x.length === 0) continue;
293
- const h = u.x[0], p = u.x[u.x.length - 1];
294
- if (h == null || p == null) continue;
293
+ const h = u.x[0], g = u.x[u.x.length - 1];
294
+ if (h == null || g == null) continue;
295
295
  const w = n.get(a);
296
- w ? (w.dataMin = Math.min(w.dataMin, h), w.dataMax = Math.max(w.dataMax, p), w.groups.push(f)) : n.set(a, { dataMin: h, dataMax: p, groups: [f] });
296
+ w ? (w.dataMin = Math.min(w.dataMin, h), w.dataMax = Math.max(w.dataMax, g), w.groups.push(f)) : n.set(a, { dataMin: h, dataMax: g, groups: [f] });
297
297
  }
298
298
  for (const [f, { dataMin: a, dataMax: d, groups: u }] of n) {
299
299
  const h = this.scales.get(f);
300
300
  if (!h) continue;
301
- let p = !0, w = Q;
302
- for (const b of u) {
303
- const g = e[b];
304
- if (g) {
305
- for (let m = 0; m < g.x.length; m++)
306
- if (Number.isInteger(g.x[m]) || (p = !1), m > 0) {
307
- const M = g.x[m] - g.x[m - 1];
308
- M > 0 && M < w && (w = M);
301
+ let g = !0, w = Q;
302
+ for (const S of u) {
303
+ const b = e[S];
304
+ if (b) {
305
+ for (let M = 0; M < b.x.length; M++)
306
+ if (Number.isInteger(b.x[M]) || (g = !1), M > 0) {
307
+ const p = b.x[M] - b.x[M - 1];
308
+ p > 0 && p < w && (w = p);
309
309
  }
310
310
  }
311
311
  }
312
- if (h._discrete = p, h.range) {
313
- const [b, g] = ee(a, d, {
312
+ if (h._discrete = g, h.range) {
313
+ const [S, b] = ne(a, d, {
314
314
  min: { pad: ((o = h.range.min) == null ? void 0 : o.pad) ?? 0, soft: ((s = h.range.min) == null ? void 0 : s.soft) ?? null, mode: ((r = h.range.min) == null ? void 0 : r.mode) ?? 0 },
315
315
  max: { pad: ((i = h.range.max) == null ? void 0 : i.pad) ?? 0, soft: ((l = h.range.max) == null ? void 0 : l.soft) ?? null, mode: ((c = h.range.max) == null ? void 0 : c.mode) ?? 0 }
316
316
  });
317
- h.min = b, h.max = g;
317
+ h.min = S, h.max = b;
318
318
  } else if (a === d)
319
- [h.min, h.max] = ee(a, d, {
319
+ [h.min, h.max] = ne(a, d, {
320
320
  min: { pad: 0.1, soft: null, mode: 0 },
321
321
  max: { pad: 0.1, soft: null, mode: 0 }
322
322
  });
323
323
  else if (w < Q) {
324
- const b = w / 2;
325
- h.min = a - b, h.max = d + b;
324
+ const S = w / 2;
325
+ h.min = a - S, h.max = d + S;
326
326
  } else
327
327
  h.min = a, h.max = d;
328
- h._cfgMin != null && (h.min = h._cfgMin), h._cfgMax != null && (h.max = h._cfgMax), ht(h);
328
+ h._cfgMin != null && (h.min = h._cfgMin), h._cfgMax != null && (h.max = h._cfgMax), gt(h);
329
329
  }
330
330
  }
331
331
  /**
@@ -336,32 +336,32 @@ class Yn {
336
336
  autoRange(e, n, o) {
337
337
  var i, l, c, f, a, d;
338
338
  const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
339
- for (const { group: u, index: h, yScale: p } of n) {
339
+ for (const { group: u, index: h, yScale: g } of n) {
340
340
  const w = e[u];
341
341
  if (!w) continue;
342
- const b = w.series[h];
343
- if (!b || b.length === 0) continue;
344
- const g = o.windows.get(u), m = g ? g[0] : 0, M = g ? g[1] : b.length - 1, v = this.scales.get(p), D = (v == null ? void 0 : v.distr) === j.Log, [T, y] = o.getCachedMinMax(u, h, m, M, 0, D), x = s.get(p), A = r.get(p);
345
- s.set(p, x != null ? Math.min(x, T) : T), r.set(p, A != null ? Math.max(A, y) : y);
342
+ const S = w.series[h];
343
+ if (!S || S.length === 0) continue;
344
+ const b = o.windows.get(u), M = b ? b[0] : 0, p = b ? b[1] : S.length - 1, m = this.scales.get(g), T = (m == null ? void 0 : m.distr) === q.Log, [A, y] = o.getCachedMinMax(u, h, M, p, 0, T), x = s.get(g), P = r.get(g);
345
+ s.set(g, x != null ? Math.min(x, A) : A), r.set(g, P != null ? Math.max(P, y) : y);
346
346
  }
347
347
  for (const [u, h] of s) {
348
- const p = this.scales.get(u);
349
- if (!p || !p.auto) continue;
348
+ const g = this.scales.get(u);
349
+ if (!g || !g.auto) continue;
350
350
  const w = r.get(u) ?? -Q;
351
351
  if (h === Q) continue;
352
- let b, g;
353
- if (p.distr === j.Log)
354
- [b, g] = rn(h, w, p.log, !1);
355
- else if (p.distr === j.Asinh)
356
- [b, g] = Gn(h, w, p.log, !1);
352
+ let S, b;
353
+ if (g.distr === q.Log)
354
+ [S, b] = sn(h, w, g.log, !1);
355
+ else if (g.distr === q.Asinh)
356
+ [S, b] = Rn(h, w, g.log, !1);
357
357
  else {
358
- const m = p.range ?? { min: gt, max: gt };
359
- [b, g] = ee(h, w, {
360
- min: { pad: ((i = m.min) == null ? void 0 : i.pad) ?? gt.pad, soft: ((l = m.min) == null ? void 0 : l.soft) ?? gt.soft, mode: ((c = m.min) == null ? void 0 : c.mode) ?? gt.mode },
361
- max: { pad: ((f = m.max) == null ? void 0 : f.pad) ?? gt.pad, soft: ((a = m.max) == null ? void 0 : a.soft) ?? gt.soft, mode: ((d = m.max) == null ? void 0 : d.mode) ?? gt.mode }
358
+ const M = g.range ?? { min: mt, max: mt };
359
+ [S, b] = ne(h, w, {
360
+ min: { pad: ((i = M.min) == null ? void 0 : i.pad) ?? mt.pad, soft: ((l = M.min) == null ? void 0 : l.soft) ?? mt.soft, mode: ((c = M.min) == null ? void 0 : c.mode) ?? mt.mode },
361
+ max: { pad: ((f = M.max) == null ? void 0 : f.pad) ?? mt.pad, soft: ((a = M.max) == null ? void 0 : a.soft) ?? mt.soft, mode: ((d = M.max) == null ? void 0 : d.mode) ?? mt.mode }
362
362
  });
363
363
  }
364
- p._cfgMin != null && (b = p._cfgMin), p._cfgMax != null && (g = p._cfgMax), p.min = b, p.max = g, ht(p);
364
+ g._cfgMin != null && (S = g._cfgMin), g._cfgMax != null && (b = g._cfgMax), g.min = S, g.max = b, gt(g);
365
365
  }
366
366
  }
367
367
  }
@@ -414,8 +414,8 @@ class Un {
414
414
  h != null && (h < i && (i = h), h > l && (l = h));
415
415
  }
416
416
  for (let u = c + 1; u < f; u++) {
417
- const h = r[u * 2] ?? 1 / 0, p = r[u * 2 + 1] ?? -1 / 0;
418
- h < i && (i = h), p > l && (l = p);
417
+ const h = r[u * 2] ?? 1 / 0, g = r[u * 2 + 1] ?? -1 / 0;
418
+ h < i && (i = h), g > l && (l = g);
419
419
  }
420
420
  const d = f * s;
421
421
  for (let u = d; u <= n; u++) {
@@ -502,7 +502,7 @@ class Kn {
502
502
  if (a.length === 0)
503
503
  c = 0, f = 0;
504
504
  else {
505
- c = wt(i.min, a), f = wt(i.max, a);
505
+ c = St(i.min, a), f = St(i.max, a);
506
506
  const d = a[c], u = a[f];
507
507
  c > 0 && d != null && d > i.min && c--, f < a.length - 1 && u != null && u < i.max && f++;
508
508
  }
@@ -540,7 +540,7 @@ class Kn {
540
540
  const a = f.series[n];
541
541
  if (!a || a.length === 0) return [1 / 0, -1 / 0];
542
542
  let d;
543
- const u = !i && r === Ft.Unsorted ? this.getOrBuildTree(e, n) : void 0;
543
+ const u = !i && r === Ht.Unsorted ? this.getOrBuildTree(e, n) : void 0;
544
544
  return u ? d = u.rangeMinMax(o, s) : d = _n(a, o, s, r, i), l.set(c, d), d;
545
545
  }
546
546
  /** Get block tree for a series (exposed for incremental append) */
@@ -591,12 +591,12 @@ class Kn {
591
591
  return e;
592
592
  }
593
593
  }
594
- const Rt = -10;
594
+ const Bt = -10;
595
595
  class On {
596
596
  constructor() {
597
597
  X(this, "state", {
598
- left: Rt,
599
- top: Rt,
598
+ left: Bt,
599
+ top: Bt,
600
600
  activeGroup: -1,
601
601
  activeSeriesIdx: -1,
602
602
  activeDataIdx: -1
@@ -623,7 +623,7 @@ class On {
623
623
  }
624
624
  /** Hide the cursor (move off-screen) */
625
625
  hide() {
626
- this.state.left = Rt, this.state.top = Rt, this.state.activeGroup = -1, this.state.activeSeriesIdx = -1, this.state.activeDataIdx = -1;
626
+ this.state.left = Bt, this.state.top = Bt, this.state.activeGroup = -1, this.state.activeSeriesIdx = -1, this.state.activeDataIdx = -1;
627
627
  }
628
628
  /**
629
629
  * Update cursor position and snap to nearest data point.
@@ -639,31 +639,31 @@ class On {
639
639
  this.state.left = e, this.state.top = n;
640
640
  let f = 1 / 0, a = -1, d = -1, u = -1;
641
641
  const h = this.getGroupedConfigs(r);
642
- for (let p = 0; p < s.length; p++) {
643
- const w = s[p];
642
+ for (let g = 0; g < s.length; g++) {
643
+ const w = s[g];
644
644
  if (w == null) continue;
645
- const b = w.x;
646
- if (b.length === 0) continue;
647
- const g = c(p);
648
- if (g == null) continue;
649
- const m = i(g);
650
- if (m == null || !K(m)) continue;
651
- const [M, v] = l(p), D = o.width, T = o.left, y = vt(e + T, m, D, T), x = wt(y, b, M, v), A = [x];
652
- x > M && A.push(x - 1), x < v && A.push(x + 1);
645
+ const S = w.x;
646
+ if (S.length === 0) continue;
647
+ const b = c(g);
648
+ if (b == null) continue;
649
+ const M = i(b);
650
+ if (M == null || !K(M)) continue;
651
+ const [p, m] = l(g), T = o.width, A = o.left, y = bt(e + A, M, T, A), x = St(y, S, p, m), P = [x];
652
+ x > p && P.push(x - 1), x < m && P.push(x + 1);
653
653
  const L = /* @__PURE__ */ new Map();
654
- for (const k of A) {
655
- const E = b[k];
656
- if (E == null) continue;
657
- const P = V(E, m, D, T);
658
- for (const F of h.get(p) ?? []) {
659
- const $ = w.series[F.index];
660
- if ($ == null) continue;
661
- const S = $[k];
662
- if (S == null) continue;
663
- let C = L.get(F.yScale);
664
- if (C == null && !L.has(F.yScale) && (C = i(F.yScale), L.set(F.yScale, C)), C == null || !K(C)) continue;
665
- const _ = o.height, I = o.top, H = V(S, C, _, I), z = e + T - P, G = n + I - H, Y = z * z + G * G;
666
- if (Y < f && (f = Y, a = p, d = F.index, u = k, Y === 0))
654
+ for (const F of P) {
655
+ const I = S[F];
656
+ if (I == null) continue;
657
+ const C = B(I, M, T, A);
658
+ for (const E of h.get(g) ?? []) {
659
+ const H = w.series[E.index];
660
+ if (H == null) continue;
661
+ const v = H[F];
662
+ if (v == null) continue;
663
+ let k = L.get(E.yScale);
664
+ if (k == null && !L.has(E.yScale) && (k = i(E.yScale), L.set(E.yScale, k)), k == null || !K(k)) continue;
665
+ const _ = o.height, D = o.top, $ = B(v, k, _, D), z = e + A - C, G = n + D - $, U = z * z + G * G;
666
+ if (U < f && (f = U, a = g, d = E.index, u = F, U === 0))
667
667
  break;
668
668
  }
669
669
  if (f === 0) break;
@@ -675,33 +675,33 @@ class On {
675
675
  * Sync cursor to a specific x-value (from another chart in a sync group).
676
676
  * Finds the closest data index and positions the cursor there.
677
677
  */
678
- syncToValue(e, n) {
679
- const o = n.dataStore.data;
680
- if (o.length === 0) return;
681
- const s = o[0];
682
- if (s == null) return;
683
- const r = n.scaleManager.getGroupXScaleKey(0);
684
- if (r == null) return;
685
- const i = n.scaleManager.getScale(r);
686
- if (i == null || !K(i)) return;
687
- const [l, c] = n.dataStore.getWindow(0), f = wt(e, s.x, l, c), a = s.x[f];
688
- if (a == null) return;
689
- const d = V(a, i, n.plotBox.width, n.plotBox.left);
690
- this.state.left = d - n.plotBox.left, this.state.activeGroup = 0, this.state.activeDataIdx = f;
691
- let u = 0, h = n.plotBox.height / 2;
692
- for (const p of n.seriesConfigs) {
693
- if (p.group !== 0 || p.show === !1) continue;
694
- const w = s.series[p.index];
695
- if (w == null) continue;
696
- const b = w[f];
678
+ syncToValue(e, n, o = 0) {
679
+ const s = n.dataStore.data;
680
+ if (s.length === 0) return;
681
+ const r = o < s.length ? o : 0, i = s[r];
682
+ if (i == null) return;
683
+ const l = n.scaleManager.getGroupXScaleKey(r);
684
+ if (l == null) return;
685
+ const c = n.scaleManager.getScale(l);
686
+ if (c == null || !K(c)) return;
687
+ const [f, a] = n.dataStore.getWindow(r), d = St(e, i.x, f, a), u = i.x[d];
688
+ if (u == null) return;
689
+ const h = B(u, c, n.plotBox.width, n.plotBox.left);
690
+ this.state.left = h - n.plotBox.left, this.state.activeGroup = r, this.state.activeDataIdx = d;
691
+ let g = 0, w = n.plotBox.height / 2;
692
+ for (const S of n.seriesConfigs) {
693
+ if (S.group !== r || S.show === !1) continue;
694
+ const b = i.series[S.index];
697
695
  if (b == null) continue;
698
- const g = n.scaleManager.getScale(p.yScale);
699
- if (!(g == null || !K(g))) {
700
- h = V(b, g, n.plotBox.height, n.plotBox.top) - n.plotBox.top, u = p.index;
696
+ const M = b[d];
697
+ if (M == null) continue;
698
+ const p = n.scaleManager.getScale(S.yScale);
699
+ if (!(p == null || !K(p))) {
700
+ w = B(M, p, n.plotBox.height, n.plotBox.top) - n.plotBox.top, g = S.index;
701
701
  break;
702
702
  }
703
703
  }
704
- this.state.top = h, this.state.activeSeriesIdx = u;
704
+ this.state.top = w, this.state.activeSeriesIdx = g;
705
705
  }
706
706
  }
707
707
  class jn {
@@ -747,14 +747,14 @@ class jn {
747
747
  this.cancel(), this.callback = null, this.flags = it.None;
748
748
  }
749
749
  }
750
- const Ot = { width: 1 }, qn = { width: 0, fill: "auto", fillTo: 0, points: { show: !1 }, cursor: { show: !1 } }, Zn = { width: 0, cursor: { show: !1 } };
751
- function jt(t, e, n) {
750
+ const jt = { width: 1 }, qn = { width: 0, fill: "auto", fillTo: 0, points: { show: !1 }, cursor: { show: !1 } }, Zn = { width: 0, cursor: { show: !1 } };
751
+ function qt(t, e, n) {
752
752
  t.lineTo(e, n);
753
753
  }
754
- function qt(t, e, n) {
754
+ function Zt(t, e, n) {
755
755
  t.lineTo(n, e);
756
756
  }
757
- function me(t, e, n, o, s, r) {
757
+ function pe(t, e, n, o, s, r) {
758
758
  const i = [];
759
759
  let l = -1;
760
760
  const c = s === O.Forward ? n : o, f = s === O.Forward ? o : n, a = s;
@@ -768,7 +768,7 @@ function me(t, e, n, o, s, r) {
768
768
  l !== -1 && (i.push([l, r(t[d])]), l = -1);
769
769
  return l !== -1 && i.push([l, r(t[o])]), i;
770
770
  }
771
- function we(t, e, n, o, s, r) {
771
+ function me(t, e, n, o, s, r) {
772
772
  const i = new Path2D();
773
773
  let l = e === W.Horizontal ? n : o;
774
774
  const c = e === W.Horizontal ? n + s : o + r, f = e === W.Horizontal ? o : n, a = e === W.Horizontal ? r : s;
@@ -776,16 +776,16 @@ function we(t, e, n, o, s, r) {
776
776
  d > l && (e === W.Horizontal ? i.rect(l, f, d - l, a) : i.rect(f, l, a, d - l)), l = u;
777
777
  return l < c && (e === W.Horizontal ? i.rect(l, f, c - l, a) : i.rect(f, l, a, c - l)), i;
778
778
  }
779
- function an(t) {
779
+ function cn(t) {
780
780
  return (e, n, o, s, r, i) => {
781
781
  o !== s && (r !== o && i !== o && t(e, n, o), r !== s && i !== s && t(e, n, s), t(e, n, i));
782
782
  };
783
783
  }
784
- const Jn = an(jt), Qn = an(qt);
784
+ const Jn = cn(qt), Qn = cn(Zt);
785
785
  function to() {
786
786
  const t = (e, n, o, s, r, i, l, c, f, a, d, u, h) => {
787
- const p = (h == null ? void 0 : h.spanGaps) ?? !1;
788
- if ([f, a] = (s.distr === j.Log ? en : Kt)(n, f, a), f === -1)
787
+ const g = (h == null ? void 0 : h.spanGaps) ?? !1;
788
+ if ([f, a] = (s.distr === q.Log ? tn : Ot)(n, f, a), f === -1)
789
789
  return {
790
790
  stroke: new Path2D(),
791
791
  fill: null,
@@ -793,52 +793,52 @@ function to() {
793
793
  band: null,
794
794
  gaps: null
795
795
  };
796
- const b = (x) => u(V(x, o, r, l)), g = (x) => u(V(x, s, i, c));
797
- let m, M;
798
- o.ori === W.Horizontal ? (m = jt, M = Jn) : (m = qt, M = Qn);
799
- const v = {
796
+ const S = (x) => u(B(x, o, r, l)), b = (x) => u(B(x, s, i, c));
797
+ let M, p;
798
+ o.ori === W.Horizontal ? (M = qt, p = Jn) : (M = Zt, p = Qn);
799
+ const m = {
800
800
  stroke: new Path2D(),
801
801
  fill: null,
802
802
  clip: null,
803
803
  band: null,
804
804
  gaps: null
805
- }, D = v.stroke;
806
- let T = !1;
805
+ }, T = m.stroke;
806
+ let A = !1;
807
807
  if (a - f >= r * 4) {
808
- const x = (C) => vt(C, o, r, l);
809
- let A = null, L = 0, k = 0, E = 0, P = b(e[d === O.Forward ? f : a]);
810
- const F = b(e[f]), $ = b(e[a]);
811
- let S = x(d === O.Forward ? F + 1 : $ - 1);
812
- for (let C = d === O.Forward ? f : a; C >= f && C <= a; C += d) {
813
- const _ = e[C], H = (d === O.Forward ? _ < S : _ > S) ? P : b(_), z = n[C];
814
- H === P ? z != null ? (E = z, A == null ? (m(D, H, g(E)), k = A = L = E) : E < A ? A = E : E > L && (L = E)) : z === null && !p && (T = !0) : (A != null && M(D, P, g(A), g(L), g(k), g(E)), z != null ? (E = z, m(D, H, g(E)), A = L = k = E) : (A = null, L = 0, z === null && !p && (T = !0)), P = H, S = x(P + d));
808
+ const x = (k) => bt(k, o, r, l);
809
+ let P = null, L = 0, F = 0, I = 0, C = S(e[d === O.Forward ? f : a]);
810
+ const E = S(e[f]), H = S(e[a]);
811
+ let v = x(d === O.Forward ? E + 1 : H - 1);
812
+ for (let k = d === O.Forward ? f : a; k >= f && k <= a; k += d) {
813
+ const _ = e[k], $ = (d === O.Forward ? _ < v : _ > v) ? C : S(_), z = n[k];
814
+ $ === C ? z != null ? (I = z, P == null ? (M(T, $, b(I)), F = P = L = I) : I < P ? P = I : I > L && (L = I)) : z === null && !g && (A = !0) : (P != null && p(T, C, b(P), b(L), b(F), b(I)), z != null ? (I = z, M(T, $, b(I)), P = L = F = I) : (P = null, L = 0, z === null && !g && (A = !0)), C = $, v = x(C + d));
815
815
  }
816
- A != null && (A !== L ? M(D, P, g(A), g(L), g(k), g(E)) : m(D, P, g(E)));
816
+ P != null && (P !== L ? p(T, C, b(P), b(L), b(F), b(I)) : M(T, C, b(I)));
817
817
  } else
818
818
  for (let x = d === O.Forward ? f : a; x >= f && x <= a; x += d) {
819
- const A = n[x];
820
- A === null && !p ? T = !0 : A != null && m(D, b(e[x]), g(A));
819
+ const P = n[x];
820
+ P === null && !g ? A = !0 : P != null && M(T, S(e[x]), b(P));
821
821
  }
822
822
  {
823
- const x = v.fill = new Path2D(D), A = (h == null ? void 0 : h.fillTo) ?? s.min ?? 0, L = g(A);
824
- let k = b(e[f]), E = b(e[a]);
825
- d === O.Backward && ([E, k] = [k, E]), m(x, E, L), m(x, k, L);
823
+ const x = m.fill = new Path2D(T), P = (h == null ? void 0 : h.fillTo) ?? s.min ?? 0, L = b(P);
824
+ let F = S(e[f]), I = S(e[a]);
825
+ d === O.Backward && ([I, F] = [F, I]), M(x, I, L), M(x, F, L);
826
826
  }
827
- if (T) {
828
- const x = me(e, n, f, a, d, b);
829
- v.gaps = x, v.clip = we(x, o.ori, l, c, r, i);
827
+ if (A) {
828
+ const x = pe(e, n, f, a, d, S);
829
+ m.gaps = x, m.clip = me(x, o.ori, l, c, r, i);
830
830
  }
831
- return v;
831
+ return m;
832
832
  };
833
- return t.defaults = Ot, t;
833
+ return t.defaults = jt, t;
834
834
  }
835
- function un(t, e, n) {
835
+ function an(t, e, n) {
836
836
  const o = t.length;
837
837
  if (n = Math.max(2, Math.round(n)), o <= n) {
838
- const u = new Uint32Array(o), h = new Float64Array(o), p = new Array(o);
838
+ const u = new Uint32Array(o), h = new Float64Array(o), g = new Array(o);
839
839
  for (let w = 0; w < o; w++)
840
- u[w] = w, h[w] = t[w], p[w] = e[w] ?? null;
841
- return { indices: u, x: h, y: p };
840
+ u[w] = w, h[w] = t[w], g[w] = e[w] ?? null;
841
+ return { indices: u, x: h, y: g };
842
842
  }
843
843
  const s = [];
844
844
  let r = -1, i = 0;
@@ -851,17 +851,17 @@ function un(t, e, n) {
851
851
  y: []
852
852
  };
853
853
  if (i <= n) {
854
- const u = new Uint32Array(i), h = new Float64Array(i), p = new Array(i);
854
+ const u = new Uint32Array(i), h = new Float64Array(i), g = new Array(i);
855
855
  let w = 0;
856
- for (let b = 0; b < o; b++)
857
- e[b] != null && (u[w] = b, h[w] = t[b], p[w] = e[b], w++);
858
- return { indices: u, x: h, y: p };
856
+ for (let S = 0; S < o; S++)
857
+ e[S] != null && (u[w] = S, h[w] = t[S], g[w] = e[S], w++);
858
+ return { indices: u, x: h, y: g };
859
859
  }
860
860
  const l = [];
861
861
  for (const [u, h] of s) {
862
- const p = h - u + 1, w = Math.max(2, Math.round(n * (p / i))), b = eo(t, e, u, h, w);
863
- for (const g of b)
864
- l.push(g);
862
+ const g = h - u + 1, w = Math.max(2, Math.round(n * (g / i))), S = eo(t, e, u, h, w);
863
+ for (const b of S)
864
+ l.push(b);
865
865
  }
866
866
  const c = l.length, f = new Uint32Array(c), a = new Float64Array(c), d = new Array(c);
867
867
  for (let u = 0; u < c; u++) {
@@ -883,23 +883,23 @@ function eo(t, e, n, o, s) {
883
883
  let f = n;
884
884
  for (let a = 0; a < l; a++) {
885
885
  const d = n + 1 + Math.floor(a * c), u = Math.min(n + 1 + Math.floor((a + 1) * c) - 1, o - 1);
886
- let h = 0, p = 0, w = 0;
886
+ let h = 0, g = 0, w = 0;
887
887
  if (a < l - 1) {
888
- const v = n + 1 + Math.floor((a + 1) * c), D = Math.min(n + 1 + Math.floor((a + 2) * c) - 1, o - 1);
889
- for (let T = v; T <= D; T++)
890
- h += t[T], p += e[T], w++;
888
+ const m = n + 1 + Math.floor((a + 1) * c), T = Math.min(n + 1 + Math.floor((a + 2) * c) - 1, o - 1);
889
+ for (let A = m; A <= T; A++)
890
+ h += t[A], g += e[A], w++;
891
891
  } else
892
- h = t[o], p = e[o], w = 1;
893
- w > 0 && (h /= w, p /= w);
894
- const b = t[f], g = e[f];
895
- let m = d, M = -1;
896
- for (let v = d; v <= u; v++) {
897
- const D = t[v], T = e[v], y = Math.abs(
898
- b * (T - p) + D * (p - g) + h * (g - T)
892
+ h = t[o], g = e[o], w = 1;
893
+ w > 0 && (h /= w, g /= w);
894
+ const S = t[f], b = e[f];
895
+ let M = d, p = -1;
896
+ for (let m = d; m <= u; m++) {
897
+ const T = t[m], A = e[m], y = Math.abs(
898
+ S * (A - g) + T * (g - b) + h * (b - A)
899
899
  );
900
- y > M && (M = y, m = v);
900
+ y > p && (p = y, M = m);
901
901
  }
902
- i.push(m), f = m;
902
+ i.push(M), f = M;
903
903
  }
904
904
  return i.push(o), i;
905
905
  }
@@ -909,7 +909,7 @@ function ui(t, e) {
909
909
  return t;
910
910
  const o = /* @__PURE__ */ new Set();
911
911
  for (const c of t.series) {
912
- const f = un(t.x, c, e);
912
+ const f = an(t.x, c, e);
913
913
  for (let a = 0; a < f.indices.length; a++)
914
914
  o.add(f.indices[a]);
915
915
  }
@@ -932,16 +932,16 @@ function ui(t, e) {
932
932
  return { x: i, series: l };
933
933
  }
934
934
  function no(t) {
935
- const n = to(), o = (s, r, i, l, c, f, a, d, u, h, p, w, b) => {
936
- const g = h - u + 1, m = Math.round(c * 1);
937
- if (g > m * 2) {
938
- const M = h - u + 1, v = new Float64Array(M), D = new Array(M);
939
- for (let y = 0; y < M; y++)
940
- v[y] = s[u + y], D[y] = r[u + y] ?? null;
941
- const T = un(v, D, m);
935
+ const n = to(), o = (s, r, i, l, c, f, a, d, u, h, g, w, S) => {
936
+ const b = h - u + 1, M = Math.round(c * 1);
937
+ if (b > M * 2) {
938
+ const p = h - u + 1, m = new Float64Array(p), T = new Array(p);
939
+ for (let y = 0; y < p; y++)
940
+ m[y] = s[u + y], T[y] = r[u + y] ?? null;
941
+ const A = an(m, T, M);
942
942
  return n(
943
- T.x,
944
- T.y,
943
+ A.x,
944
+ A.y,
945
945
  i,
946
946
  l,
947
947
  c,
@@ -949,10 +949,10 @@ function no(t) {
949
949
  a,
950
950
  d,
951
951
  0,
952
- T.x.length - 1,
953
- p,
952
+ A.x.length - 1,
953
+ g,
954
954
  w,
955
- b
955
+ S
956
956
  );
957
957
  }
958
958
  return n(
@@ -966,15 +966,15 @@ function no(t) {
966
966
  d,
967
967
  u,
968
968
  h,
969
- p,
969
+ g,
970
970
  w,
971
- b
971
+ S
972
972
  );
973
973
  };
974
- return o.defaults = Ot, o;
974
+ return o.defaults = jt, o;
975
975
  }
976
976
  const Pe = /* @__PURE__ */ new WeakMap();
977
- function _e(t, e, n) {
977
+ function Le(t, e, n) {
978
978
  return typeof e == "string" ? e : oo(t, e, n);
979
979
  }
980
980
  function oo(t, e, n) {
@@ -991,15 +991,15 @@ function so(t, e, n, o, s) {
991
991
  const r = e.alpha ?? 1;
992
992
  t.save(), r < 1 && (t.globalAlpha = r), n.clip && t.clip(n.clip);
993
993
  const i = s ?? { left: 0, top: 0, width: t.canvas.width / o, height: t.canvas.height / o };
994
- if (e.fill && n.fill && (t.fillStyle = _e(t, e.fill, i), t.fill(n.fill)), e.stroke) {
994
+ if (e.fill && n.fill && (t.fillStyle = Le(t, e.fill, i), t.fill(n.fill)), e.stroke) {
995
995
  const l = (e.width ?? 1) * o;
996
- t.strokeStyle = _e(t, e.stroke, i), t.lineWidth = l, t.lineJoin = e.join ?? "round", t.lineCap = e.cap ?? "butt", e.dash && t.setLineDash(e.dash.map((d) => d * o));
996
+ t.strokeStyle = Le(t, e.stroke, i), t.lineWidth = l, t.lineJoin = e.join ?? "round", t.lineCap = e.cap ?? "butt", e.dash && t.setLineDash(e.dash.map((d) => d * o));
997
997
  const c = e.pxAlign ?? 0, f = l % 2 / 2;
998
998
  c === 1 && f > 0 && t.translate(f, f), t.stroke(n.stroke);
999
999
  }
1000
1000
  t.restore();
1001
1001
  }
1002
- const io = no(), De = 64;
1002
+ const io = no(), _e = 64;
1003
1003
  class ro {
1004
1004
  constructor() {
1005
1005
  X(this, "ctx", null);
@@ -1069,8 +1069,8 @@ class ro {
1069
1069
  /** Store paths in cache, evicting oldest 25% when at capacity.
1070
1070
  * Callers may pass padded i0/i1 (wider than the visible window) for "runway" during panning. */
1071
1071
  setCachedPaths(e, n, o, s, r) {
1072
- if (this.pathCache.size >= De) {
1073
- const l = De >> 2, c = this.pathCache.keys();
1072
+ if (this.pathCache.size >= _e) {
1073
+ const l = _e >> 2, c = this.pathCache.keys();
1074
1074
  for (let f = 0; f < l; f++) {
1075
1075
  const a = c.next().value;
1076
1076
  a != null && this.pathCache.delete(a);
@@ -1118,9 +1118,9 @@ class ro {
1118
1118
  const r = e.config.group, i = e.config.index, [l, c] = e.window;
1119
1119
  let f = this.getCachedPaths(r, i, l, c);
1120
1120
  if (f == null) {
1121
- const a = e.config.paths ?? io, d = e.xScale.dir, u = zn(e.config.pxAlign ?? 0), h = c - l, p = Math.max(1, Math.ceil(h * 0.1)), w = e.dataX.length, b = Math.max(0, l - p), g = Math.min(w - 1, c + p), m = e.config.fillTo;
1122
- let M;
1123
- typeof m == "function" ? M = m(e.yScale.min ?? 0, e.yScale.max ?? 0) : m === 0 && e.yScale.distr === j.Log ? M = 1 : M = m, f = a(
1121
+ const a = e.config.paths ?? io, d = e.xScale.dir, u = zn(e.config.pxAlign ?? 0), h = c - l, g = Math.max(1, Math.ceil(h * 0.1)), w = e.dataX.length, S = Math.max(0, l - g), b = Math.min(w - 1, c + g), M = e.config.fillTo;
1122
+ let p;
1123
+ typeof M == "function" ? p = M(e.yScale.min ?? 0, e.yScale.max ?? 0) : M === 0 && e.yScale.distr === q.Log ? p = 1 : p = M, f = a(
1124
1124
  e.dataX,
1125
1125
  e.dataY,
1126
1126
  e.xScale,
@@ -1129,12 +1129,12 @@ class ro {
1129
1129
  n.height,
1130
1130
  n.left,
1131
1131
  n.top,
1132
+ S,
1132
1133
  b,
1133
- g,
1134
1134
  d,
1135
1135
  u,
1136
- { fillTo: M, spanGaps: e.config.spanGaps }
1137
- ), this.setCachedPaths(r, i, b, g, f);
1136
+ { fillTo: p, spanGaps: e.config.spanGaps }
1137
+ ), this.setCachedPaths(r, i, S, b, f);
1138
1138
  }
1139
1139
  so(s, e.config, f, o, n);
1140
1140
  }
@@ -1151,40 +1151,40 @@ class ro {
1151
1151
  r.restore();
1152
1152
  }
1153
1153
  }
1154
- const fn = [1, 2, 2.5, 5], lo = on(10, -32, 0, fn), co = on(10, 0, 32, fn), St = lo.concat(co);
1154
+ const un = [1, 2, 2.5, 5], lo = nn(10, -32, 0, un), co = nn(10, 0, 32, un), Mt = lo.concat(co);
1155
1155
  function ao(t, e, n, o, s) {
1156
1156
  if (n <= 0 || e < t) return [];
1157
- const r = [], i = Pt.get(n) ?? 0, l = s ? Math.ceil(t / n) * n : ut(pe(t, n), i);
1158
- for (let c = l; c <= e; c = ut(c + n, i))
1157
+ const r = [], i = Dt.get(n) ?? 0, l = s ? Math.ceil(t / n) * n : ht(ge(t, n), i);
1158
+ for (let c = l; c <= e; c = ht(c + n, i))
1159
1159
  r.push(Object.is(c, -0) ? 0 : c);
1160
1160
  return r;
1161
1161
  }
1162
- function ne(t) {
1163
- return t.map((e) => sn(e));
1162
+ function oe(t) {
1163
+ return t.map((e) => on(e));
1164
1164
  }
1165
1165
  function uo(t, e, n) {
1166
1166
  if (t <= 0 || e <= 0 || t >= e) return [];
1167
- const o = [], r = at((n === 10 ? lt : Dt)(t));
1168
- let i = yt(n, r);
1169
- n === 10 && (i = St[wt(i, St)] ?? i);
1167
+ const o = [], r = ft((n === 10 ? ct : Ft)(t));
1168
+ let i = xt(n, r);
1169
+ n === 10 && (i = Mt[St(i, Mt)] ?? i);
1170
1170
  let l = i, c = i * n;
1171
- n === 10 && (c = St[wt(c, St)] ?? c);
1171
+ n === 10 && (c = Mt[St(c, Mt)] ?? c);
1172
1172
  let f = 0;
1173
1173
  do {
1174
- if (l >= t && o.push(l), l = l + i, n === 10 && !Pt.has(l)) {
1175
- const a = Pt.get(i) ?? 0;
1176
- l = ut(l, a);
1174
+ if (l >= t && o.push(l), l = l + i, n === 10 && !Dt.has(l)) {
1175
+ const a = Dt.get(i) ?? 0;
1176
+ l = ht(l, a);
1177
1177
  }
1178
- l >= c * (1 - 1e-10) && (i = l, c = i * n, n === 10 && (c = St[wt(c, St)] ?? c));
1178
+ l >= c * (1 - 1e-10) && (i = l, c = i * n, n === 10 && (c = Mt[St(c, Mt)] ?? c));
1179
1179
  } while (l <= e && ++f < 1e4);
1180
1180
  return o;
1181
1181
  }
1182
1182
  function fo(t, e, n = 1) {
1183
1183
  const o = [];
1184
- if (Math.max(rt(t), rt(e)) === 0) return [0];
1184
+ if (Math.max(lt(t), lt(e)) === 0) return [0];
1185
1185
  if (t < 0) {
1186
- const i = rt(t);
1187
- let l = yt(10, at(lt(Math.max(i, n))));
1186
+ const i = lt(t);
1187
+ let l = xt(10, ft(ct(Math.max(i, n))));
1188
1188
  for (; l >= n; ) {
1189
1189
  const c = -l;
1190
1190
  c >= t && c <= e && o.push(c), l /= 10;
@@ -1200,29 +1200,29 @@ function fo(t, e, n = 1) {
1200
1200
  const r = [];
1201
1201
  for (const i of o) {
1202
1202
  const l = r[r.length - 1];
1203
- (r.length === 0 || l != null && rt(i - l) > 1e-10) && r.push(i);
1203
+ (r.length === 0 || l != null && lt(i - l) > 1e-10) && r.push(i);
1204
1204
  }
1205
1205
  return r;
1206
1206
  }
1207
1207
  function ho(t, e) {
1208
- const n = e === 10 ? lt : Dt;
1208
+ const n = e === 10 ? ct : Ft;
1209
1209
  return t.map((o) => {
1210
1210
  if (o === 0) return !0;
1211
1211
  if (o < 0) return !1;
1212
1212
  const s = n(o);
1213
- return rt(s - Math.round(s)) < 1e-10;
1213
+ return lt(s - Math.round(s)) < 1e-10;
1214
1214
  });
1215
1215
  }
1216
1216
  const go = 7, po = 50, mo = 16;
1217
1217
  function wo(t, e) {
1218
- const o = sn(Math.max(Math.abs(t), Math.abs(e))).length * go;
1218
+ const o = on(Math.max(Math.abs(t), Math.abs(e))).length * go;
1219
1219
  return Math.max(po, o + mo);
1220
1220
  }
1221
1221
  function vo(t, e, n, o) {
1222
1222
  if (o <= 0)
1223
1223
  return [0, 0];
1224
- const s = _t(t.side) === W.Vertical, r = t.space ?? (s ? 30 : wo(e, n)), i = t.incrs ?? St;
1225
- return Rn(e, n, i, o, r);
1224
+ const s = Et(t.side) === W.Vertical, r = t.space ?? (s ? 30 : wo(e, n)), i = t.incrs ?? Mt;
1225
+ return Gn(e, n, i, o, r);
1226
1226
  }
1227
1227
  const So = 50;
1228
1228
  function bo(t, e, n) {
@@ -1230,7 +1230,7 @@ function bo(t, e, n) {
1230
1230
  if (t.size != null)
1231
1231
  return t.size;
1232
1232
  const o = ((l = t.ticks) == null ? void 0 : l.show) !== !1 ? ((c = t.ticks) == null ? void 0 : c.size) ?? 10 : 0, s = t.gap ?? 5, r = 12;
1233
- if (_t(t.side) === W.Vertical && e != null) {
1233
+ if (Et(t.side) === W.Vertical && e != null) {
1234
1234
  let f = 0;
1235
1235
  for (const d of e)
1236
1236
  d.length > f && (f = d.length);
@@ -1253,7 +1253,7 @@ function Mo(t) {
1253
1253
  _rotate: 0
1254
1254
  };
1255
1255
  }
1256
- const yo = 1, It = 60, bt = 3600, mt = 86400, xo = 604800, xt = 2592e3, $t = 31536e3, Co = [
1256
+ const yo = 1, Pt = 60, yt = 3600, vt = 86400, xo = 604800, Ct = 2592e3, Rt = 31536e3, Co = [
1257
1257
  // Seconds
1258
1258
  yo,
1259
1259
  5,
@@ -1261,46 +1261,46 @@ const yo = 1, It = 60, bt = 3600, mt = 86400, xo = 604800, xt = 2592e3, $t = 315
1261
1261
  15,
1262
1262
  30,
1263
1263
  // Minutes
1264
- It,
1265
- 5 * It,
1266
- 10 * It,
1267
- 15 * It,
1268
- 30 * It,
1264
+ Pt,
1265
+ 5 * Pt,
1266
+ 10 * Pt,
1267
+ 15 * Pt,
1268
+ 30 * Pt,
1269
1269
  // Hours
1270
- bt,
1271
- 2 * bt,
1272
- 3 * bt,
1273
- 4 * bt,
1274
- 6 * bt,
1275
- 12 * bt,
1270
+ yt,
1271
+ 2 * yt,
1272
+ 3 * yt,
1273
+ 4 * yt,
1274
+ 6 * yt,
1275
+ 12 * yt,
1276
1276
  // Days
1277
- mt,
1278
- 2 * mt,
1279
- 3 * mt,
1280
- 7 * mt,
1281
- 14 * mt,
1277
+ vt,
1278
+ 2 * vt,
1279
+ 3 * vt,
1280
+ 7 * vt,
1281
+ 14 * vt,
1282
1282
  // Months (approximate)
1283
- xt,
1284
- 2 * xt,
1285
- 3 * xt,
1286
- 6 * xt,
1283
+ Ct,
1284
+ 2 * Ct,
1285
+ 3 * Ct,
1286
+ 6 * Ct,
1287
1287
  // Years
1288
- $t
1288
+ Rt
1289
1289
  ];
1290
1290
  function ko(t, e, n) {
1291
1291
  const o = [];
1292
1292
  if (n <= 0 || t >= e) return o;
1293
1293
  let s;
1294
- if (n >= $t) {
1294
+ if (n >= Rt) {
1295
1295
  const r = new Date(t * 1e3);
1296
1296
  for (r.setUTCMonth(0, 1), r.setUTCHours(0, 0, 0, 0), s = r.getTime() / 1e3, s < t && (r.setUTCFullYear(r.getUTCFullYear() + 1), s = r.getTime() / 1e3); s <= e; )
1297
- o.push(s), r.setUTCFullYear(r.getUTCFullYear() + Math.round(n / $t)), s = r.getTime() / 1e3;
1297
+ o.push(s), r.setUTCFullYear(r.getUTCFullYear() + Math.round(n / Rt)), s = r.getTime() / 1e3;
1298
1298
  return o;
1299
1299
  }
1300
- if (n >= xt) {
1300
+ if (n >= Ct) {
1301
1301
  const r = new Date(t * 1e3);
1302
1302
  r.setUTCDate(1), r.setUTCHours(0, 0, 0, 0), s = r.getTime() / 1e3;
1303
- const i = Math.max(1, Math.round(n / xt));
1303
+ const i = Math.max(1, Math.round(n / Ct));
1304
1304
  if (s < t && (r.setUTCMonth(r.getUTCMonth() + 1), s = r.getTime() / 1e3), i > 1) {
1305
1305
  const l = r.getUTCMonth(), c = Math.ceil((l + 1) / i) * i;
1306
1306
  r.setUTCMonth(c - 1), s = r.getTime() / 1e3;
@@ -1309,9 +1309,9 @@ function ko(t, e, n) {
1309
1309
  o.push(s), r.setUTCMonth(r.getUTCMonth() + i), s = r.getTime() / 1e3;
1310
1310
  return o;
1311
1311
  }
1312
- if (n >= mt) {
1312
+ if (n >= vt) {
1313
1313
  const r = new Date(t * 1e3);
1314
- r.setUTCHours(0, 0, 0, 0), s = r.getTime() / 1e3, s < t && (s += mt);
1314
+ r.setUTCHours(0, 0, 0, 0), s = r.getTime() / 1e3, s < t && (s += vt);
1315
1315
  } else
1316
1316
  s = Math.ceil(t / n) * n;
1317
1317
  for (let r = 0; ; r++) {
@@ -1321,40 +1321,40 @@ function ko(t, e, n) {
1321
1321
  }
1322
1322
  return o;
1323
1323
  }
1324
- const Ee = /* @__PURE__ */ new Map();
1324
+ const De = /* @__PURE__ */ new Map();
1325
1325
  function To(t, e) {
1326
1326
  const n = JSON.stringify(t) + (e ?? "");
1327
- let o = Ee.get(n);
1328
- return o == null && (o = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }), Ee.set(n, o)), o;
1327
+ let o = De.get(n);
1328
+ return o == null && (o = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }), De.set(n, o)), o;
1329
1329
  }
1330
- function ct(t, e, n) {
1330
+ function at(t, e, n) {
1331
1331
  const o = new Date(t * 1e3);
1332
1332
  return To(e, n).format(o);
1333
1333
  }
1334
1334
  function Ao(t, e) {
1335
- return ct(t, { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1335
+ return at(t, { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1336
1336
  }
1337
1337
  function Io(t, e) {
1338
- return ct(t, { year: "numeric", month: "2-digit", day: "2-digit" }, e);
1339
- }
1340
- function Lo(t, e) {
1341
- return ct(t, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1338
+ return at(t, { year: "numeric", month: "2-digit", day: "2-digit" }, e);
1342
1339
  }
1343
1340
  function Po(t, e) {
1344
- return ct(t, { hour: "2-digit", minute: "2-digit", hour12: !1 }, e);
1341
+ return at(t, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1342
+ }
1343
+ function Lo(t, e) {
1344
+ return at(t, { hour: "2-digit", minute: "2-digit", hour12: !1 }, e);
1345
1345
  }
1346
1346
  function _o(t, e) {
1347
- return ct(t, { month: "short", day: "numeric" }, e);
1347
+ return at(t, { month: "short", day: "numeric" }, e);
1348
1348
  }
1349
1349
  function Do(t, e) {
1350
- return ct(t, { year: "numeric" }, e);
1350
+ return at(t, { year: "numeric" }, e);
1351
1351
  }
1352
1352
  function Eo(t, e) {
1353
- return ct(t, { year: "numeric", month: "short" }, e);
1353
+ return at(t, { year: "numeric", month: "short" }, e);
1354
1354
  }
1355
1355
  function Fo(t, e, n) {
1356
1356
  let o;
1357
- return e >= $t ? o = Do : e >= xt ? o = Eo : e >= xo ? o = Io : e >= mt ? o = _o : e >= bt ? o = Po : e >= It ? o = Lo : o = Ao, t.map((s) => o(s, n));
1357
+ return e >= Rt ? o = Do : e >= Ct ? o = Eo : e >= xo ? o = Io : e >= vt ? o = _o : e >= yt ? o = Lo : e >= Pt ? o = Po : o = Ao, t.map((s) => o(s, n));
1358
1358
  }
1359
1359
  function zo(t, e, n, o, s) {
1360
1360
  const r = e - t;
@@ -1364,7 +1364,7 @@ function zo(t, e, n, o, s) {
1364
1364
  if (f >= s)
1365
1365
  return [l, f];
1366
1366
  }
1367
- const i = n[n.length - 1] ?? $t;
1367
+ const i = n[n.length - 1] ?? Rt;
1368
1368
  return [i, o / (r / i)];
1369
1369
  }
1370
1370
  const Ho = 3;
@@ -1380,50 +1380,50 @@ function $o(t, e, n, o, s) {
1380
1380
  continue;
1381
1381
  } else
1382
1382
  i._show || (r = !1, i._show = !0);
1383
- const f = l.side, d = _t(f) === W.Horizontal ? n : o, u = c.min, h = c.max;
1384
- let p, w;
1383
+ const f = l.side, d = Et(f) === W.Horizontal ? n : o, u = c.min, h = c.max;
1384
+ let g, w;
1385
1385
  if (c.time) {
1386
- const g = l.space ?? 80;
1387
- [p, w] = zo(u, h, Co, d, g);
1386
+ const b = l.space ?? 80;
1387
+ [g, w] = zo(u, h, Co, d, b);
1388
1388
  } else
1389
- [p, w] = vo(l, u, h, d);
1390
- if (c._discrete && p > 0 && p < 1 && (p = 1), i._incr = p, i._space = w, w === 0)
1389
+ [g, w] = vo(l, u, h, d);
1390
+ if (c._discrete && g > 0 && g < 1 && (g = 1), i._incr = g, i._space = w, w === 0)
1391
1391
  continue;
1392
1392
  if (l.splits)
1393
- i._splits = l.splits(u, h, p, w);
1393
+ i._splits = l.splits(u, h, g, w);
1394
1394
  else if (c.time)
1395
- i._splits = ko(u, h, p);
1396
- else if (c.distr === j.Log)
1395
+ i._splits = ko(u, h, g);
1396
+ else if (c.distr === q.Log)
1397
1397
  i._splits = uo(u, h, c.log);
1398
- else if (c.distr === j.Asinh)
1398
+ else if (c.distr === q.Asinh)
1399
1399
  i._splits = fo(u, h, c.asinh);
1400
1400
  else {
1401
- const g = c.distr === j.Ordinal || c._discrete;
1402
- i._splits = ao(u, h, p, w, g);
1401
+ const b = c.distr === q.Ordinal || c._discrete;
1402
+ i._splits = ao(u, h, g, w, b);
1403
1403
  }
1404
1404
  if (l.values)
1405
- i._values = l.values(i._splits, w, p);
1405
+ i._values = l.values(i._splits, w, g);
1406
1406
  else if (c.time)
1407
- i._values = Fo(i._splits, p);
1408
- else if (c.distr === j.Log) {
1409
- const g = ho(i._splits, c.log), m = ne(i._splits);
1410
- i._values = m.map((M, v) => g[v] ? M : "");
1411
- } else c.distr, j.Asinh, i._values = ne(i._splits);
1412
- i._rotate = f === U.Bottom ? l.rotate ?? 0 : 0;
1413
- const b = i._size;
1414
- i._size = Ht(bo(l, i._values)), b !== i._size && (r = !1);
1407
+ i._values = Fo(i._splits, g);
1408
+ else if (c.distr === q.Log) {
1409
+ const b = ho(i._splits, c.log), M = oe(i._splits);
1410
+ i._values = M.map((p, m) => b[m] ? p : "");
1411
+ } else c.distr, q.Asinh, i._values = oe(i._splits);
1412
+ i._rotate = f === N.Bottom ? l.rotate ?? 0 : 0;
1413
+ const S = i._size;
1414
+ i._size = Wt(bo(l, i._values)), S !== i._size && (r = !1);
1415
1415
  }
1416
1416
  return r;
1417
1417
  }
1418
- function Fe(t, e, n, o = 0) {
1418
+ function Ee(t, e, n, o = 0) {
1419
1419
  let s = t, r = e - o, i = 0, l = o;
1420
1420
  for (const f of n) {
1421
1421
  if (!f._show)
1422
1422
  continue;
1423
- const a = f.config.side, d = _t(a) === W.Vertical, u = f.config.label != null ? f.config.labelSize ?? 20 : 0, h = f._size + u;
1424
- h > 0 && (d ? (s -= h, a === U.Left && (i += h)) : (r -= h, a === U.Top && (l += h)));
1423
+ const a = f.config.side, d = Et(a) === W.Vertical, u = f.config.label != null ? f.config.labelSize ?? 20 : 0, h = f._size + u;
1424
+ h > 0 && (d ? (s -= h, a === N.Left && (i += h)) : (r -= h, a === N.Top && (l += h)));
1425
1425
  }
1426
- return !n.some((f) => f._show && f.config.side === U.Top) && l <= o && (l += 8, r -= 8), {
1426
+ return !n.some((f) => f._show && f.config.side === N.Top) && l <= o && (l += 8, r -= 8), {
1427
1427
  left: i,
1428
1428
  top: l,
1429
1429
  width: Math.max(s, 0),
@@ -1434,17 +1434,17 @@ function Wo(t, e) {
1434
1434
  let n = e.top, o = e.left + e.width, s = e.top + e.height, r = e.left;
1435
1435
  function i(l, c) {
1436
1436
  switch (l) {
1437
- case U.Top:
1437
+ case N.Top:
1438
1438
  return n -= c, n + c;
1439
- case U.Right: {
1439
+ case N.Right: {
1440
1440
  const f = o;
1441
1441
  return o += c, f;
1442
1442
  }
1443
- case U.Bottom: {
1443
+ case N.Bottom: {
1444
1444
  const f = s;
1445
1445
  return s += c, f;
1446
1446
  }
1447
- case U.Left:
1447
+ case N.Left:
1448
1448
  return r -= c, r + c;
1449
1449
  default:
1450
1450
  return 0;
@@ -1460,7 +1460,7 @@ function Wo(t, e) {
1460
1460
  }
1461
1461
  }
1462
1462
  }
1463
- function Go(t, e, n, o, s = 0) {
1463
+ function Ro(t, e, n, o, s = 0) {
1464
1464
  for (const c of n)
1465
1465
  c._size = 0;
1466
1466
  let r = !1, i = 0, l = { left: 0, top: 0, width: t, height: e };
@@ -1472,85 +1472,85 @@ function Go(t, e, n, o, s = 0) {
1472
1472
  l.width,
1473
1473
  l.height
1474
1474
  );
1475
- r = i === Ho || c, r || (l = Fe(t, e, n, s));
1475
+ r = i === Ho || c, r || (l = Ee(t, e, n, s));
1476
1476
  }
1477
- return l = Fe(t, e, n, s), Wo(n, l), l;
1477
+ return l = Ee(t, e, n, s), Wo(n, l), l;
1478
1478
  }
1479
- const ze = "top", He = "bottom", Ro = "left", Vo = "right";
1480
- function oe(t, e) {
1479
+ const Fe = "top", ze = "bottom", Go = "left", Bo = "right";
1480
+ function se(t, e) {
1481
1481
  return e === 1 ? t : t.replace(/(\d+(?:\.\d+)?)px/, (n, o) => `${Math.round(Number(o) * e)}px`);
1482
1482
  }
1483
- function $e(t, e, n, o, s, r, i, l, c, f, a) {
1483
+ function He(t, e, n, o, s, r, i, l, c, f, a) {
1484
1484
  const d = l % 2 / 2;
1485
1485
  t.save(), t.translate(d, d), t.strokeStyle = c, t.lineWidth = l, f.length > 0 && t.setLineDash(f), t.beginPath();
1486
- let u = 0, h = 0, p = 0, w = 0;
1487
- const b = r + (s === U.Top || s === U.Left ? -i : i);
1488
- o === W.Horizontal ? (h = r, w = b) : (u = r, p = b);
1489
- for (let g = 0; g < e.length; g++)
1490
- n[g] != null && (o === W.Horizontal ? u = p = e[g] ?? 0 : h = w = e[g] ?? 0, t.moveTo(u, h), t.lineTo(p, w));
1486
+ let u = 0, h = 0, g = 0, w = 0;
1487
+ const S = r + (s === N.Top || s === N.Left ? -i : i);
1488
+ o === W.Horizontal ? (h = r, w = S) : (u = r, g = S);
1489
+ for (let b = 0; b < e.length; b++)
1490
+ n[b] != null && (o === W.Horizontal ? u = g = e[b] ?? 0 : h = w = e[b] ?? 0, t.moveTo(u, h), t.lineTo(g, w));
1491
1491
  t.stroke(), t.restore();
1492
1492
  }
1493
- function Bo(t, e, n, o, s, r) {
1493
+ function Vo(t, e, n, o, s, r) {
1494
1494
  const i = R(o.left * s), l = R(o.top * s), c = R(o.width * s), f = R(o.height * s);
1495
1495
  for (const a of e) {
1496
1496
  if (!a._show)
1497
1497
  continue;
1498
- const d = a.config, u = d.side, h = _t(u), p = n(d.scale);
1499
- if (!p || !K(p))
1498
+ const d = a.config, u = d.side, h = Et(u), g = n(d.scale);
1499
+ if (!g || !K(g))
1500
1500
  continue;
1501
- const w = d.stroke ?? "#000", b = u === U.Top || u === U.Left ? -1 : 1, g = a._splits, m = a._values;
1502
- if (!g || !m || a._space === 0)
1501
+ const w = d.stroke ?? "#000", S = u === N.Top || u === N.Left ? -1 : 1, b = a._splits, M = a._values;
1502
+ if (!b || !M || a._space === 0)
1503
1503
  continue;
1504
- const M = h === W.Horizontal ? o.width : o.height, v = h === W.Horizontal ? o.left : o.top, D = g.map((L) => R(V(L, p, M, v) * s)), T = m.map((L) => L === "" ? null : L), y = d.grid;
1504
+ const p = h === W.Horizontal ? o.width : o.height, m = h === W.Horizontal ? o.left : o.top, T = b.map((L) => R(B(L, g, p, m) * s)), A = M.map((L) => L === "" ? null : L), y = d.grid;
1505
1505
  if ((y == null ? void 0 : y.show) !== !1) {
1506
- const L = (y == null ? void 0 : y.stroke) ?? "rgba(0,0,0,0.12)", k = R(((y == null ? void 0 : y.width) ?? 2) * s), E = ((y == null ? void 0 : y.dash) ?? []).map(($) => $ * s), P = h === W.Horizontal ? l : i, F = h === W.Horizontal ? f : c;
1507
- $e(t, D, T, h, 2, P, F, k, L, E);
1506
+ const L = (y == null ? void 0 : y.stroke) ?? "rgba(0,0,0,0.12)", F = R(((y == null ? void 0 : y.width) ?? 2) * s), I = ((y == null ? void 0 : y.dash) ?? []).map((H) => H * s), C = h === W.Horizontal ? l : i, E = h === W.Horizontal ? f : c;
1507
+ He(t, T, A, h, 2, C, E, F, L, I);
1508
1508
  }
1509
1509
  const x = d.ticks;
1510
1510
  if ((x == null ? void 0 : x.show) !== !1) {
1511
- const L = (x == null ? void 0 : x.stroke) ?? w, k = R(((x == null ? void 0 : x.width) ?? 1) * s), E = R(((x == null ? void 0 : x.size) ?? 10) * s), P = ((x == null ? void 0 : x.dash) ?? []).map(($) => $ * s), F = R(a._pos * s);
1512
- $e(t, D, T, h, u, F, E, k, L, P);
1511
+ const L = (x == null ? void 0 : x.stroke) ?? w, F = R(((x == null ? void 0 : x.width) ?? 1) * s), I = R(((x == null ? void 0 : x.size) ?? 10) * s), C = ((x == null ? void 0 : x.dash) ?? []).map((H) => H * s), E = R(a._pos * s);
1512
+ He(t, T, A, h, u, E, I, F, L, C);
1513
1513
  }
1514
1514
  {
1515
- const L = (x == null ? void 0 : x.show) !== !1 ? ((x == null ? void 0 : x.size) ?? 10) * s : 0, k = R((d.gap ?? 5) * s), E = R(a._pos * s), P = (L + k) * b, F = E + P, $ = oe(d.font ?? "12px system-ui, sans-serif", s), S = h === W.Horizontal ? "center" : u === U.Left ? Vo : Ro, C = h === W.Horizontal ? u === U.Bottom ? ze : He : "middle";
1516
- t.font = $, t.fillStyle = w, t.textAlign = S, t.textBaseline = C;
1517
- const _ = a._rotate * -Qt / 180;
1515
+ const L = (x == null ? void 0 : x.show) !== !1 ? ((x == null ? void 0 : x.size) ?? 10) * s : 0, F = R((d.gap ?? 5) * s), I = R(a._pos * s), C = (L + F) * S, E = I + C, H = se(d.font ?? "12px system-ui, sans-serif", s), v = h === W.Horizontal ? "center" : u === N.Left ? Bo : Go, k = h === W.Horizontal ? u === N.Bottom ? Fe : ze : "middle";
1516
+ t.font = H, t.fillStyle = w, t.textAlign = v, t.textBaseline = k;
1517
+ const _ = a._rotate * -te / 180;
1518
1518
  if (_ !== 0) {
1519
- const I = Math.cos(_), H = Math.sin(_);
1520
- for (let z = 0; z < m.length; z++) {
1521
- const G = m[z];
1519
+ const D = Math.cos(_), $ = Math.sin(_);
1520
+ for (let z = 0; z < M.length; z++) {
1521
+ const G = M[z];
1522
1522
  if (G == null || G === "")
1523
1523
  continue;
1524
- const Y = D[z] ?? 0;
1525
- t.setTransform(I, H, -H, I, Y, F), t.fillText(G, 0, 0);
1524
+ const U = T[z] ?? 0;
1525
+ t.setTransform(D, $, -$, D, U, E), t.fillText(G, 0, 0);
1526
1526
  }
1527
1527
  t.setTransform(1, 0, 0, 1, 0, 0);
1528
1528
  } else
1529
- for (let I = 0; I < m.length; I++) {
1530
- const H = m[I];
1531
- if (H == null || H === "")
1529
+ for (let D = 0; D < M.length; D++) {
1530
+ const $ = M[D];
1531
+ if ($ == null || $ === "")
1532
1532
  continue;
1533
- const z = D[I] ?? 0, G = h === W.Horizontal ? z : F, Y = h === W.Horizontal ? F : z;
1534
- t.fillText(H, G, Y);
1533
+ const z = T[D] ?? 0, G = h === W.Horizontal ? z : E, U = h === W.Horizontal ? E : z;
1534
+ t.fillText($, G, U);
1535
1535
  }
1536
1536
  }
1537
1537
  if (d.label != null) {
1538
- const L = oe(d.labelFont ?? "bold 12px system-ui, sans-serif", s);
1539
- t.font = L, t.fillStyle = w, t.textAlign = "center", t.textBaseline = u === U.Bottom ? ze : He;
1540
- const k = R((a._lpos + (d.labelGap ?? 0) * b) * s);
1538
+ const L = se(d.labelFont ?? "bold 12px system-ui, sans-serif", s);
1539
+ t.font = L, t.fillStyle = w, t.textAlign = "center", t.textBaseline = u === N.Bottom ? Fe : ze;
1540
+ const F = R((a._lpos + (d.labelGap ?? 0) * S) * s);
1541
1541
  h === W.Vertical ? (t.save(), t.translate(
1542
- k,
1542
+ F,
1543
1543
  R(l + f / 2)
1544
- ), t.rotate((u === U.Left ? -Qt : Qt) / 2), t.fillText(d.label, 0, 0), t.restore()) : t.fillText(d.label, R(i + c / 2), k);
1544
+ ), t.rotate((u === N.Left ? -te : te) / 2), t.fillText(d.label, 0, 0), t.restore()) : t.fillText(d.label, R(i + c / 2), F);
1545
1545
  }
1546
- const A = d.border;
1547
- if ((A == null ? void 0 : A.show) !== !1 && A != null) {
1548
- const L = A.stroke ?? w, k = R((A.width ?? 1) * s), E = (A.dash ?? []).map((F) => F * s), P = R(a._pos * s);
1549
- t.strokeStyle = L, t.lineWidth = k, E.length > 0 && t.setLineDash(E), t.beginPath(), h === W.Horizontal ? (t.moveTo(i, P), t.lineTo(i + c, P)) : (t.moveTo(P, l), t.lineTo(P, l + f)), t.stroke(), E.length > 0 && t.setLineDash([]);
1546
+ const P = d.border;
1547
+ if ((P == null ? void 0 : P.show) !== !1 && P != null) {
1548
+ const L = P.stroke ?? w, F = R((P.width ?? 1) * s), I = (P.dash ?? []).map((E) => E * s), C = R(a._pos * s);
1549
+ t.strokeStyle = L, t.lineWidth = F, I.length > 0 && t.setLineDash(I), t.beginPath(), h === W.Horizontal ? (t.moveTo(i, C), t.lineTo(i + c, C)) : (t.moveTo(C, l), t.lineTo(C, l + f)), t.stroke(), I.length > 0 && t.setLineDash([]);
1550
1550
  }
1551
1551
  }
1552
1552
  if (r != null) {
1553
- const a = oe("bold 14px system-ui, sans-serif", s);
1553
+ const a = se("bold 14px system-ui, sans-serif", s);
1554
1554
  t.font = a, t.fillStyle = "#000", t.textAlign = "center", t.textBaseline = "top", t.fillText(r, R(i + c / 2), R(4 * s));
1555
1555
  }
1556
1556
  }
@@ -1562,26 +1562,26 @@ const Xo = 2, Yo = "#fff", No = {
1562
1562
  showX: !0,
1563
1563
  showY: !0
1564
1564
  };
1565
- function We(t, e, n, o, s, r, i, l, c, f) {
1566
- var v;
1565
+ function $e(t, e, n, o, s, r, i, l, c, f) {
1566
+ var m;
1567
1567
  if (e.left < 0 || e.top < 0) return;
1568
- const a = { ...No, ...c }, d = o, u = R(n.left * d), h = R(n.top * d), p = R(n.width * d), w = R(n.height * d), b = R(a.width * d), g = b % 2 / 2, m = R((n.left + e.left) * d) + g, M = R((n.top + e.top) * d) + g;
1569
- if (t.save(), t.strokeStyle = a.stroke, t.lineWidth = b, t.setLineDash(a.dash.map((D) => D * d)), a.showX && (t.beginPath(), t.moveTo(m, h), t.lineTo(m, h + w), t.stroke()), a.showY && (t.beginPath(), t.moveTo(u, M), t.lineTo(u + p, M), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
1570
- const D = e.activeGroup, T = e.activeSeriesIdx, y = e.activeDataIdx, x = s[D];
1571
- if (x != null && T >= 0 && T < x.series.length && y < x.x.length) {
1572
- const A = x.x[y], L = x.series[T], k = L != null ? L[y] : null;
1573
- if (A != null && k != null) {
1574
- let E = a.stroke, P = !0;
1575
- const F = f == null ? void 0 : f.get(`${D}:${T}`);
1576
- if (F != null) {
1577
- const $ = F.stroke;
1578
- E = (typeof $ == "string" ? $ : void 0) ?? a.stroke, P = ((v = F.cursor) == null ? void 0 : v.show) !== !1;
1568
+ const a = { ...No, ...c }, d = o, u = R(n.left * d), h = R(n.top * d), g = R(n.width * d), w = R(n.height * d), S = R(a.width * d), b = S % 2 / 2, M = R((n.left + e.left) * d) + b, p = R((n.top + e.top) * d) + b;
1569
+ if (t.save(), t.strokeStyle = a.stroke, t.lineWidth = S, t.setLineDash(a.dash.map((T) => T * d)), a.showX && (t.beginPath(), t.moveTo(M, h), t.lineTo(M, h + w), t.stroke()), a.showY && (t.beginPath(), t.moveTo(u, p), t.lineTo(u + g, p), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
1570
+ const T = e.activeGroup, A = e.activeSeriesIdx, y = e.activeDataIdx, x = s[T];
1571
+ if (x != null && A >= 0 && A < x.series.length && y < x.x.length) {
1572
+ const P = x.x[y], L = x.series[A], F = L != null ? L[y] : null;
1573
+ if (P != null && F != null) {
1574
+ let I = a.stroke, C = !0;
1575
+ const E = f == null ? void 0 : f.get(`${T}:${A}`);
1576
+ if (E != null) {
1577
+ const H = E.stroke;
1578
+ I = (typeof H == "string" ? H : void 0) ?? a.stroke, C = ((m = E.cursor) == null ? void 0 : m.show) !== !1;
1579
1579
  }
1580
- if (P) {
1581
- const $ = l(D), S = $ != null ? i($) : void 0, C = (F == null ? void 0 : F.yScale) ?? Uo(r, D, T), _ = C != null ? i(C) : void 0;
1582
- if (S != null && _ != null && K(S) && K(_)) {
1583
- const I = R(V(A, S, n.width, n.left) * d), H = R(V(k, _, n.height, n.top) * d), z = a.pointRadius * d, G = R(Xo * d);
1584
- t.beginPath(), t.arc(I, H, z, 0, Math.PI * 2), t.fillStyle = Yo, t.fill(), t.strokeStyle = E, t.lineWidth = G, t.stroke();
1580
+ if (C) {
1581
+ const H = l(T), v = H != null ? i(H) : void 0, k = (E == null ? void 0 : E.yScale) ?? Uo(r, T, A), _ = k != null ? i(k) : void 0;
1582
+ if (v != null && _ != null && K(v) && K(_)) {
1583
+ const D = R(B(P, v, n.width, n.left) * d), $ = R(B(F, _, n.height, n.top) * d), z = a.pointRadius * d, G = R(Xo * d);
1584
+ t.beginPath(), t.arc(D, $, z, 0, Math.PI * 2), t.fillStyle = Yo, t.fill(), t.strokeStyle = I, t.lineWidth = G, t.stroke();
1585
1585
  }
1586
1586
  }
1587
1587
  }
@@ -1599,21 +1599,21 @@ const Ko = {
1599
1599
  stroke: "rgba(0,0,0,0.15)",
1600
1600
  width: 1
1601
1601
  };
1602
- function Ge(t, e, n, o, s) {
1602
+ function We(t, e, n, o, s) {
1603
1603
  if (!e.show || e.width <= 0) return;
1604
1604
  const r = { ...Ko, ...s }, i = o, l = R((n.left + e.left) * i), c = R((n.top + e.top) * i), f = R(e.width * i), a = R(e.height * i);
1605
1605
  t.save(), t.fillStyle = r.fill, t.fillRect(l, c, f, a), r.width > 0 && (t.strokeStyle = r.stroke, t.lineWidth = R(r.width * i), t.strokeRect(l, c, f, a)), t.restore();
1606
1606
  }
1607
1607
  function Oo(t, e, n, o, s, r, i, l, c, f, a, d) {
1608
- const u = a / 2 * i, h = Math.max(1, R(a * 0.2)) * i, p = (f == null ? void 0 : f.stroke) ?? d, w = (f == null ? void 0 : f.fill) ?? "#fff";
1609
- t.save(), t.strokeStyle = p, t.fillStyle = w, t.lineWidth = h, (f == null ? void 0 : f.dash) != null && t.setLineDash(f.dash.map((b) => b * i));
1610
- for (let b = l; b <= c; b++) {
1611
- const g = n[b];
1612
- if (g == null) continue;
1613
- const m = e[b];
1614
- if (m == null) continue;
1615
- const M = R(V(m, o, r.width, r.left) * i), v = R(V(g, s, r.height, r.top) * i);
1616
- t.beginPath(), t.arc(M, v, u, 0, Math.PI * 2), t.fill(), t.stroke();
1608
+ const u = a / 2 * i, h = Math.max(1, R(a * 0.2)) * i, g = (f == null ? void 0 : f.stroke) ?? d, w = (f == null ? void 0 : f.fill) ?? "#fff";
1609
+ t.save(), t.strokeStyle = g, t.fillStyle = w, t.lineWidth = h, (f == null ? void 0 : f.dash) != null && t.setLineDash(f.dash.map((S) => S * i));
1610
+ for (let S = l; S <= c; S++) {
1611
+ const b = n[S];
1612
+ if (b == null) continue;
1613
+ const M = e[S];
1614
+ if (M == null) continue;
1615
+ const p = R(B(M, o, r.width, r.left) * i), m = R(B(b, s, r.height, r.top) * i);
1616
+ t.beginPath(), t.arc(p, m, u, 0, Math.PI * 2), t.fill(), t.stroke();
1617
1617
  }
1618
1618
  t.restore();
1619
1619
  }
@@ -1626,19 +1626,19 @@ function jo(t, e, n, o, s, r, i) {
1626
1626
  return l > 0 && l <= r / i;
1627
1627
  }
1628
1628
  function qo(t, e, n, o, s, r, i, l, c) {
1629
- if (l > c || l < 0 || !Ie(e, l, c) && !Ie(n, l, c)) return null;
1630
- const f = (h) => V(h, o, r.width, r.left) * i, a = (h) => V(h, s, r.height, r.top) * i, d = new Path2D();
1629
+ if (l > c || l < 0 || !Ae(e, l, c) && !Ae(n, l, c)) return null;
1630
+ const f = (h) => B(h, o, r.width, r.left) * i, a = (h) => B(h, s, r.height, r.top) * i, d = new Path2D();
1631
1631
  let u = !1;
1632
1632
  for (let h = l; h <= c; h++) {
1633
- const p = e[h], w = t[h];
1634
- if (p == null || w == null) continue;
1635
- const b = f(w), g = a(p);
1636
- u ? d.lineTo(b, g) : (d.moveTo(b, g), u = !0);
1633
+ const g = e[h], w = t[h];
1634
+ if (g == null || w == null) continue;
1635
+ const S = f(w), b = a(g);
1636
+ u ? d.lineTo(S, b) : (d.moveTo(S, b), u = !0);
1637
1637
  }
1638
1638
  if (!u) return null;
1639
1639
  for (let h = c; h >= l; h--) {
1640
- const p = n[h], w = t[h];
1641
- p == null || w == null || d.lineTo(f(w), a(p));
1640
+ const g = n[h], w = t[h];
1641
+ g == null || w == null || d.lineTo(f(w), a(g));
1642
1642
  }
1643
1643
  return d.closePath(), d;
1644
1644
  }
@@ -1663,28 +1663,40 @@ function Jo(t) {
1663
1663
  const l = { id: i, auto: !0 };
1664
1664
  t.scaleConfigs.push(l), t.scaleManager.addScale(l), n.add(i);
1665
1665
  }
1666
- t.axisConfigs.some((i) => i.scale === "x") || t.axisConfigs.push({
1667
- scale: "x",
1668
- side: U.Bottom,
1669
- show: !0,
1670
- label: t.xlabel ?? "X Axis"
1671
- });
1666
+ if (!t.axisConfigs.some((i) => i.scale === "x"))
1667
+ t.axisConfigs.push({
1668
+ scale: "x",
1669
+ side: N.Bottom,
1670
+ show: !0,
1671
+ label: t.xlabel ?? "X Axis",
1672
+ _default: !0
1673
+ });
1674
+ else {
1675
+ const i = t.axisConfigs.find((l) => l.scale === "x" && l._default === !0);
1676
+ i != null && (i.label = t.xlabel ?? "X Axis");
1677
+ }
1672
1678
  const r = new Set(t.axisConfigs.map((i) => i.scale));
1673
1679
  for (const i of o)
1674
- r.has(i) || (t.axisConfigs.push({
1675
- scale: i,
1676
- side: U.Left,
1677
- show: !0,
1678
- label: t.ylabel ?? "Y Axis"
1679
- }), r.add(i));
1680
+ if (!r.has(i))
1681
+ t.axisConfigs.push({
1682
+ scale: i,
1683
+ side: N.Left,
1684
+ show: !0,
1685
+ label: t.ylabel ?? "Y Axis",
1686
+ _default: !0
1687
+ }), r.add(i);
1688
+ else {
1689
+ const l = t.axisConfigs.find((c) => c.scale === i && c._default === !0);
1690
+ l != null && (l.label = t.ylabel ?? "Y Axis");
1691
+ }
1680
1692
  }
1681
- function se(t, e, n, o) {
1693
+ function Vt(t, e, n, o) {
1682
1694
  return { ctx: t, plotBox: e, pxRatio: n, getScale: o, valToX: (i, l = "x") => {
1683
1695
  const c = o(l);
1684
- return c == null || !K(c) ? null : V(i, c, e.width, e.left);
1696
+ return c == null || !K(c) ? null : B(i, c, e.width, e.left);
1685
1697
  }, valToY: (i, l) => {
1686
1698
  const c = o(l);
1687
- return c == null || !K(c) ? null : V(i, c, e.height, e.top);
1699
+ return c == null || !K(c) ? null : B(i, c, e.height, e.top);
1688
1700
  } };
1689
1701
  }
1690
1702
  const Qo = {
@@ -1742,6 +1754,7 @@ function ts() {
1742
1754
  cursorListeners: /* @__PURE__ */ new Set(),
1743
1755
  scheduler: new jn(),
1744
1756
  drawHooks: /* @__PURE__ */ new Set(),
1757
+ unclippedDrawHooks: /* @__PURE__ */ new Set(),
1745
1758
  cursorDrawHooks: /* @__PURE__ */ new Set(),
1746
1759
  focusedSeries: null,
1747
1760
  focusAlpha: 1,
@@ -1753,6 +1766,7 @@ function ts() {
1753
1766
  revision: 0,
1754
1767
  eventCallbacks: {},
1755
1768
  _prevScaleRanges: /* @__PURE__ */ new Map(),
1769
+ _prevPlotBox: null,
1756
1770
  seriesConfigMap: /* @__PURE__ */ new Map(),
1757
1771
  registerScale(e) {
1758
1772
  t.scaleConfigs = t.scaleConfigs.filter((n) => n.id !== e.id), t.scaleConfigs.push(e), t.scaleManager.addScale(e);
@@ -1777,8 +1791,9 @@ function ts() {
1777
1791
  setFocus(e) {
1778
1792
  t.focusedSeries = e, t.scheduleRedraw();
1779
1793
  },
1780
- setSize(e, n) {
1781
- t.width === e && t.height === n || (t.width = e, t.height = n, t.canvas && (t.canvas.width = e * t.pxRatio, t.canvas.height = n * t.pxRatio, t.canvas.style.width = `${e}px`, t.canvas.style.height = `${n}px`), t.renderer.clearCache());
1794
+ setSize(e, n, o) {
1795
+ const s = o ?? t.pxRatio;
1796
+ t.width === e && t.height === n && t.pxRatio === s || (t.pxRatio = s, t.width = e, t.height = n, t.canvas && (t.canvas.width = e * t.pxRatio, t.canvas.height = n * t.pxRatio, t.canvas.style.width = `${e}px`, t.canvas.style.height = `${n}px`), t.renderer.clearCache());
1782
1797
  },
1783
1798
  scheduleRedraw() {
1784
1799
  t.scheduler.mark(it.Full);
@@ -1802,9 +1817,9 @@ function ts() {
1802
1817
  const a = c.getContext("2d");
1803
1818
  if (a == null) return;
1804
1819
  o.setContext(a, l);
1805
- const u = (f.dirty & ~(it.Cursor | it.Select)) === 0, h = (g) => e.getScale(g);
1820
+ const u = (f.dirty & ~(it.Cursor | it.Select)) === 0, h = (p) => e.getScale(p);
1806
1821
  if (u && o.restoreSnapshot(a)) {
1807
- if (We(
1822
+ if ($e(
1808
1823
  a,
1809
1824
  t.cursorManager.state,
1810
1825
  t.plotBox,
@@ -1812,36 +1827,36 @@ function ts() {
1812
1827
  n.data,
1813
1828
  s,
1814
1829
  h,
1815
- (g) => e.getGroupXScaleKey(g),
1830
+ (p) => e.getGroupXScaleKey(p),
1816
1831
  void 0,
1817
1832
  t.seriesConfigMap
1818
- ), Ge(a, t.selectState, t.plotBox, l), t.cursorDrawHooks.size > 0) {
1833
+ ), We(a, t.selectState, t.plotBox, l), t.cursorDrawHooks.size > 0) {
1819
1834
  a.save(), a.scale(l, l);
1820
- const g = se(a, t.plotBox, l, h);
1835
+ const p = Vt(a, t.plotBox, l, h);
1821
1836
  for (const m of t.cursorDrawHooks)
1822
1837
  try {
1823
- m(g, t.cursorManager.state);
1824
- } catch (M) {
1825
- console.warn("[uPlot+] draw hook error:", M);
1838
+ m(p, t.cursorManager.state);
1839
+ } catch (T) {
1840
+ console.warn("[uPlot+] draw hook error:", T);
1826
1841
  }
1827
1842
  a.restore();
1828
1843
  }
1829
1844
  Re(t);
1830
- for (const g of t.cursorListeners) g();
1845
+ for (const p of t.cursorListeners) p();
1831
1846
  return;
1832
1847
  }
1833
- Jo(t), e.autoRangeX(n.data), n.updateWindows((g) => {
1834
- const m = e.getGroupXScaleKey(g);
1848
+ Jo(t), e.autoRangeX(n.data), n.updateWindows((p) => {
1849
+ const m = e.getGroupXScaleKey(p);
1835
1850
  return m != null ? e.getScale(m) : void 0;
1836
1851
  });
1837
- const p = s.map((g) => ({
1838
- group: g.group,
1839
- index: g.index,
1840
- yScale: g.yScale
1852
+ const g = s.map((p) => ({
1853
+ group: p.group,
1854
+ index: p.index,
1855
+ yScale: p.yScale
1841
1856
  }));
1842
- if (e.autoRange(n.data, p, n), es(t), t.axisStates.length > 0) {
1843
- const g = t.title != null ? 20 : 0;
1844
- t.plotBox = Go(r, i, t.axisStates, h, g);
1857
+ if (e.autoRange(n.data, g, n), es(t), t.axisStates.length > 0) {
1858
+ const p = t.title != null ? 20 : 0;
1859
+ t.plotBox = Ro(r, i, t.axisStates, h, p);
1845
1860
  } else
1846
1861
  t.plotBox = {
1847
1862
  left: 10,
@@ -1849,62 +1864,63 @@ function ts() {
1849
1864
  width: r - 20,
1850
1865
  height: i - 20
1851
1866
  };
1852
- a.clearRect(0, 0, r * l, i * l), t.axisStates.length > 0 && Bo(a, t.axisStates, h, t.plotBox, l, t.title);
1853
- const w = [];
1854
- for (const g of s) {
1855
- const m = e.getGroupXScaleKey(g.group), M = m != null ? e.getScale(m) : void 0, v = e.getScale(g.yScale);
1856
- M == null || v == null || w.push({
1857
- config: g,
1858
- dataX: n.getXValues(g.group),
1859
- dataY: n.getYValues(g.group, g.index),
1860
- xScale: M,
1861
- yScale: v,
1862
- window: n.getWindow(g.group)
1867
+ const w = t._prevPlotBox, S = t.plotBox;
1868
+ w != null && (w.left !== S.left || w.top !== S.top || w.width !== S.width || w.height !== S.height) && o.clearCache(), t._prevPlotBox = { ...S }, a.clearRect(0, 0, r * l, i * l), t.axisStates.length > 0 && Vo(a, t.axisStates, h, t.plotBox, l, t.title);
1869
+ const b = [];
1870
+ for (const p of s) {
1871
+ const m = e.getGroupXScaleKey(p.group), T = m != null ? e.getScale(m) : void 0, A = e.getScale(p.yScale);
1872
+ T == null || A == null || b.push({
1873
+ config: p,
1874
+ dataX: n.getXValues(p.group),
1875
+ dataY: n.getYValues(p.group, p.index),
1876
+ xScale: T,
1877
+ yScale: A,
1878
+ window: n.getWindow(p.group)
1863
1879
  });
1864
1880
  }
1865
- o.checkScaleStamp(w), a.save(), a.scale(l, l), a.beginPath(), a.rect(t.plotBox.left, t.plotBox.top, t.plotBox.width, t.plotBox.height), a.clip();
1866
- for (let g = 0; g < w.length; g++) {
1867
- const m = w[g];
1868
- m != null && (t.focusedSeries != null && g !== t.focusedSeries ? (a.globalAlpha = t.focusAlpha, o.drawSeries(m, t.plotBox, 1), a.globalAlpha = 1) : o.drawSeries(m, t.plotBox, 1));
1881
+ o.checkScaleStamp(b), a.save(), a.scale(l, l), a.beginPath(), a.rect(t.plotBox.left, t.plotBox.top, t.plotBox.width, t.plotBox.height), a.clip();
1882
+ for (let p = 0; p < b.length; p++) {
1883
+ const m = b[p];
1884
+ m != null && (t.focusedSeries != null && p !== t.focusedSeries ? (a.globalAlpha = t.focusAlpha, o.drawSeries(m, t.plotBox, 1), a.globalAlpha = 1) : o.drawSeries(m, t.plotBox, 1));
1869
1885
  }
1870
- const b = /* @__PURE__ */ new Map();
1871
- for (const g of s)
1872
- b.set(`${g.group}-${g.index}`, g);
1873
- for (const g of t.bandConfigs) {
1874
- const m = e.getGroupXScaleKey(g.group), M = m != null ? e.getScale(m) : void 0, v = b.get(`${g.group}-${g.series[0]}`), D = b.get(`${g.group}-${g.series[1]}`);
1875
- if (M == null || v == null || D == null) continue;
1876
- const T = e.getScale(v.yScale);
1877
- if (T == null) continue;
1878
- const [y, x] = n.getWindow(g.group), A = g.series[0], L = g.series[1];
1879
- let k = o.getCachedBandPath(g.group, A, L, y, x);
1880
- k == null && (k = qo(
1881
- n.getXValues(g.group),
1882
- n.getYValues(g.group, A),
1883
- n.getYValues(g.group, L),
1884
- M,
1886
+ const M = /* @__PURE__ */ new Map();
1887
+ for (const p of s)
1888
+ M.set(`${p.group}-${p.index}`, p);
1889
+ for (const p of t.bandConfigs) {
1890
+ const m = e.getGroupXScaleKey(p.group), T = m != null ? e.getScale(m) : void 0, A = M.get(`${p.group}-${p.series[0]}`), y = M.get(`${p.group}-${p.series[1]}`);
1891
+ if (T == null || A == null || y == null) continue;
1892
+ const x = e.getScale(A.yScale);
1893
+ if (x == null) continue;
1894
+ const [P, L] = n.getWindow(p.group), F = p.series[0], I = p.series[1];
1895
+ let C = o.getCachedBandPath(p.group, F, I, P, L);
1896
+ C == null && (C = qo(
1897
+ n.getXValues(p.group),
1898
+ n.getYValues(p.group, F),
1899
+ n.getYValues(p.group, I),
1885
1900
  T,
1901
+ x,
1886
1902
  t.plotBox,
1887
1903
  l,
1888
- y,
1889
- x
1890
- ) ?? void 0, k != null && o.setCachedBandPath(g.group, A, L, y, x, k)), k != null && Zo(a, g, k);
1904
+ P,
1905
+ L
1906
+ ) ?? void 0, C != null && o.setCachedBandPath(p.group, F, I, P, L, C)), C != null && Zo(a, p, C);
1891
1907
  }
1892
- for (const g of w) {
1893
- const m = g.config;
1908
+ for (const p of b) {
1909
+ const m = p.config;
1894
1910
  if (m.show === !1) continue;
1895
- const M = m.points, v = m.width ?? 1, D = (M == null ? void 0 : M.size) ?? 3 + v * 2, T = (M == null ? void 0 : M.space) ?? D * 2, [y, x] = g.window;
1896
- jo(M == null ? void 0 : M.show, m.group, m.index, y, x, t.plotBox.width, T) && Oo(
1911
+ const T = m.points, A = m.width ?? 1, y = (T == null ? void 0 : T.size) ?? 3 + A * 2, x = (T == null ? void 0 : T.space) ?? y * 2, [P, L] = p.window;
1912
+ jo(T == null ? void 0 : T.show, m.group, m.index, P, L, t.plotBox.width, x) && Oo(
1897
1913
  a,
1898
- g.dataX,
1899
- g.dataY,
1900
- g.xScale,
1901
- g.yScale,
1914
+ p.dataX,
1915
+ p.dataY,
1916
+ p.xScale,
1917
+ p.yScale,
1902
1918
  t.plotBox,
1903
1919
  l,
1920
+ P,
1921
+ L,
1922
+ T,
1904
1923
  y,
1905
- x,
1906
- M,
1907
- D,
1908
1924
  (typeof m.stroke == "string" ? m.stroke : null) ?? "#000"
1909
1925
  );
1910
1926
  }
@@ -1915,12 +1931,23 @@ function ts() {
1915
1931
  t.plotBox.width * l,
1916
1932
  t.plotBox.height * l
1917
1933
  ), a.clip(), a.scale(l, l);
1918
- const g = se(a, t.plotBox, l, h);
1934
+ const p = Vt(a, t.plotBox, l, h);
1919
1935
  for (const m of t.drawHooks)
1920
1936
  try {
1921
- m(g);
1922
- } catch (M) {
1923
- console.warn("[uPlot+] draw hook error:", M);
1937
+ m(p);
1938
+ } catch (T) {
1939
+ console.warn("[uPlot+] draw hook error:", T);
1940
+ }
1941
+ a.restore();
1942
+ }
1943
+ if (t.unclippedDrawHooks.size > 0) {
1944
+ a.save(), a.scale(l, l);
1945
+ const p = Vt(a, t.plotBox, l, h);
1946
+ for (const m of t.unclippedDrawHooks)
1947
+ try {
1948
+ m(p);
1949
+ } catch (T) {
1950
+ console.warn("[uPlot+] draw hook error:", T);
1924
1951
  }
1925
1952
  a.restore();
1926
1953
  }
@@ -1931,9 +1958,9 @@ function ts() {
1931
1958
  n.data,
1932
1959
  s,
1933
1960
  h,
1934
- (g) => n.getWindow(g),
1935
- (g) => e.getGroupXScaleKey(g)
1936
- )), We(
1961
+ (p) => n.getWindow(p),
1962
+ (p) => e.getGroupXScaleKey(p)
1963
+ )), $e(
1937
1964
  a,
1938
1965
  t.cursorManager.state,
1939
1966
  t.plotBox,
@@ -1941,37 +1968,37 @@ function ts() {
1941
1968
  n.data,
1942
1969
  s,
1943
1970
  h,
1944
- (g) => e.getGroupXScaleKey(g),
1971
+ (p) => e.getGroupXScaleKey(p),
1945
1972
  void 0,
1946
1973
  t.seriesConfigMap
1947
- ), Ge(a, t.selectState, t.plotBox, l), t.cursorDrawHooks.size > 0) {
1974
+ ), We(a, t.selectState, t.plotBox, l), t.cursorDrawHooks.size > 0) {
1948
1975
  a.save(), a.scale(l, l);
1949
- const g = se(a, t.plotBox, l, h);
1976
+ const p = Vt(a, t.plotBox, l, h);
1950
1977
  for (const m of t.cursorDrawHooks)
1951
1978
  try {
1952
- m(g, t.cursorManager.state);
1953
- } catch (M) {
1954
- console.warn("[uPlot+] draw hook error:", M);
1979
+ m(p, t.cursorManager.state);
1980
+ } catch (T) {
1981
+ console.warn("[uPlot+] draw hook error:", T);
1955
1982
  }
1956
1983
  a.restore();
1957
1984
  }
1958
1985
  Re(t);
1959
- for (const g of t.listeners) g();
1960
- for (const g of t.cursorListeners) g();
1986
+ for (const p of t.listeners) p();
1987
+ for (const p of t.cursorListeners) p();
1961
1988
  if (t._prevScaleRanges.size > 0 && t.eventCallbacks.onScaleChange != null)
1962
- for (const g of e.getAllScales()) {
1963
- if (!K(g)) continue;
1964
- const m = t._prevScaleRanges.get(g.id);
1965
- if (m == null || m.min !== g.min || m.max !== g.max)
1989
+ for (const p of e.getAllScales()) {
1990
+ if (!K(p)) continue;
1991
+ const m = t._prevScaleRanges.get(p.id);
1992
+ if (m == null || m.min !== p.min || m.max !== p.max)
1966
1993
  try {
1967
- t.eventCallbacks.onScaleChange(g.id, g.min, g.max);
1968
- } catch (M) {
1969
- console.warn("[uPlot+] event callback error:", M);
1994
+ t.eventCallbacks.onScaleChange(p.id, p.min, p.max);
1995
+ } catch (T) {
1996
+ console.warn("[uPlot+] event callback error:", T);
1970
1997
  }
1971
1998
  }
1972
1999
  t._prevScaleRanges.clear();
1973
- for (const g of e.getAllScales())
1974
- K(g) && t._prevScaleRanges.set(g.id, { min: g.min, max: g.max });
2000
+ for (const p of e.getAllScales())
2001
+ K(p) && t._prevScaleRanges.set(p.id, { min: p.min, max: p.max });
1975
2002
  },
1976
2003
  getSnapshot: () => t.snapshot,
1977
2004
  // --- Config facade methods ---
@@ -2007,7 +2034,7 @@ function ts() {
2007
2034
  t.canvas = e;
2008
2035
  },
2009
2036
  setLabels(e, n, o) {
2010
- t.title = e, t.xlabel = n, t.ylabel = o;
2037
+ t.title = e, t.xlabel = n, t.ylabel = o, t.scheduleRedraw();
2011
2038
  },
2012
2039
  redrawSync() {
2013
2040
  t.scheduler.cancel(), t.scheduler.mark(it.Full), t.redraw(), t.scheduler.clear();
@@ -2025,18 +2052,18 @@ function es(t) {
2025
2052
  });
2026
2053
  }
2027
2054
  function ns() {
2028
- const t = N(null);
2055
+ const t = Y(null);
2029
2056
  return t.current === null && (t.current = ts()), t.current;
2030
2057
  }
2031
- const hn = An(null);
2058
+ const fn = An(null);
2032
2059
  function st() {
2033
- const t = Tn(hn);
2060
+ const t = Tn(fn);
2034
2061
  if (!t)
2035
2062
  throw new Error("useChart must be used within a <Chart> component");
2036
2063
  return t;
2037
2064
  }
2038
2065
  function fi(t = "cursor") {
2039
- const e = st(), n = t === "full" ? e.subscribe : e.subscribeCursor, o = Wt(n, e.getSnapshot);
2066
+ const e = st(), n = t === "full" ? e.subscribe : e.subscribeCursor, o = Gt(n, e.getSnapshot);
2040
2067
  return {
2041
2068
  // Reactive snapshot fields
2042
2069
  left: o.left,
@@ -2061,19 +2088,19 @@ function fi(t = "cursor") {
2061
2088
  setFocus: (s) => e.setFocus(s)
2062
2089
  };
2063
2090
  }
2064
- const Ve = 5, dn = 1e-3, os = 0.1, ss = 10;
2065
- function ve(t, e) {
2091
+ const Ge = 5, hn = 1e-3, os = 0.1, ss = 10;
2092
+ function we(t, e) {
2066
2093
  const n = t.shiftKey ? "shift" : t.altKey ? "alt" : t.ctrlKey ? "ctrl" : "", o = t.button === 1 ? "Middle" : t.button === 2 ? "Right" : "Left";
2067
2094
  return n ? `${n}${o}${e}` : `${o.toLowerCase()}${e}`;
2068
2095
  }
2069
2096
  function is(t) {
2070
- return ve(t, "Drag");
2097
+ return we(t, "Drag");
2071
2098
  }
2072
2099
  function rs(t) {
2073
- return ve(t, "Click");
2100
+ return we(t, "Click");
2074
2101
  }
2075
2102
  function ls(t) {
2076
- return ve(t, "Dblclick");
2103
+ return we(t, "Dblclick");
2077
2104
  }
2078
2105
  function cs(t) {
2079
2106
  const e = t.shiftKey ? "shift" : t.altKey ? "alt" : t.ctrlKey ? "ctrl" : "";
@@ -2094,10 +2121,10 @@ function us(t, e, n, o, s = !0) {
2094
2121
  function fs(t, e) {
2095
2122
  const n = [];
2096
2123
  for (const o of t.scaleManager.getAllScales())
2097
- K(o) && (e != null && !e(o.ori) || n.push({ id: o.id, ori: o.ori, startMin: o.min, startMax: o.max }));
2124
+ K(o) && (e != null && !e(o.ori) || n.push({ id: o.id, ori: o.ori, dir: o.dir, startMin: o.min, startMax: o.max }));
2098
2125
  return n;
2099
2126
  }
2100
- function Et(t) {
2127
+ function zt(t) {
2101
2128
  const e = t.eventCallbacks.onScaleChange;
2102
2129
  if (e != null)
2103
2130
  for (const n of t.scaleManager.getAllScales()) {
@@ -2108,13 +2135,13 @@ function Et(t) {
2108
2135
  }
2109
2136
  function re(t, e, n, o) {
2110
2137
  if (!(e instanceof WheelEvent)) return;
2111
- const s = tt(1 - e.deltaY * dn, os, ss), r = t.plotBox;
2138
+ const s = tt(1 - e.deltaY * hn, os, ss), r = t.plotBox;
2112
2139
  for (const i of t.scaleManager.getAllScales()) {
2113
2140
  if (!K(i) || !o(i.ori)) continue;
2114
- const l = i.ori === W.Horizontal, c = l ? r.width : r.height, f = l ? r.left : r.top, a = l ? n.cx + r.left : n.cy + r.top, d = vt(a, i, c, f), u = d - (d - i.min) * s, h = d + (i.max - d) * s;
2115
- i.min = Math.min(u, h), i.max = Math.max(u, h), i.auto = !1, ht(i);
2141
+ const l = i.ori === W.Horizontal, c = l ? r.width : r.height, f = l ? r.left : r.top, a = l ? n.cx + r.left : n.cy + r.top, d = bt(a, i, c, f), u = d - (d - i.min) * s, h = d + (i.max - d) * s;
2142
+ i.min = Math.min(u, h), i.max = Math.max(u, h), i.auto = !1, gt(i);
2116
2143
  }
2117
- t.scheduleRedraw(), Et(t);
2144
+ t.scheduleRedraw(), zt(t);
2118
2145
  }
2119
2146
  function le(t, e, n) {
2120
2147
  const o = { show: !1, left: 0, top: 0, width: 0, height: 0 }, s = e.cx, r = e.cy;
@@ -2124,7 +2151,7 @@ function le(t, e, n) {
2124
2151
  o.show = !0, o.left = Math.min(s, a), o.top = Math.min(r, d), o.width = Math.abs(a - s), o.height = Math.abs(d - r), n(W.Vertical) || (o.top = 0, o.height = f.height), n(W.Horizontal) || (o.left = 0, o.width = f.width), t.selectState = o, t.scheduler.mark(it.Cursor | it.Select);
2125
2152
  },
2126
2153
  onEnd(i, l, c) {
2127
- const f = n(W.Horizontal) && o.width > Ve, a = n(W.Vertical) && o.height > Ve;
2154
+ const f = n(W.Horizontal) && o.width > Ge, a = n(W.Vertical) && o.height > Ge;
2128
2155
  if (f || a) {
2129
2156
  let d = !0;
2130
2157
  if (t.eventCallbacks.onSelect != null) {
@@ -2132,12 +2159,12 @@ function le(t, e, n) {
2132
2159
  let h;
2133
2160
  try {
2134
2161
  h = t.eventCallbacks.onSelect(u);
2135
- } catch (p) {
2136
- console.warn("[uPlot+] event callback error:", p);
2162
+ } catch (g) {
2163
+ console.warn("[uPlot+] event callback error:", g);
2137
2164
  }
2138
2165
  h === !1 && (d = !1);
2139
2166
  }
2140
- d && (hs(t, o, n), Et(t));
2167
+ d && (hs(t, o, n), zt(t));
2141
2168
  }
2142
2169
  o.show = !1, o.left = 0, o.width = 0, t.selectState = o, t.scheduleRedraw();
2143
2170
  }
@@ -2147,8 +2174,8 @@ function hs(t, e, n) {
2147
2174
  const o = t.plotBox;
2148
2175
  for (const s of t.scaleManager.getAllScales()) {
2149
2176
  if (!K(s) || !n(s.ori)) continue;
2150
- const r = s.ori === W.Horizontal, i = r ? o.width : o.height, l = r ? o.left : o.top, c = r ? e.left : e.top, f = r ? e.width : e.height, a = c / i, d = (c + f) / i, u = vt(l + a * i, s, i, l), h = vt(l + d * i, s, i, l);
2151
- s.min = Math.min(u, h), s.max = Math.max(u, h), s.auto = !1, ht(s);
2177
+ const r = s.ori === W.Horizontal, i = r ? o.width : o.height, l = r ? o.left : o.top, c = r ? e.left : e.top, f = r ? e.width : e.height, a = c / i, d = (c + f) / i, u = bt(l + a * i, s, i, l), h = bt(l + d * i, s, i, l);
2178
+ s.min = Math.min(u, h), s.max = Math.max(u, h), s.auto = !1, gt(s);
2152
2179
  }
2153
2180
  }
2154
2181
  function ce(t, e, n, o) {
@@ -2159,13 +2186,13 @@ function ce(t, e, n, o) {
2159
2186
  for (const d of s) {
2160
2187
  const u = t.scaleManager.getScale(d.id);
2161
2188
  if (u == null) continue;
2162
- const h = d.ori === W.Horizontal, p = h ? f.width : f.height, w = h ? a.clientX - r : a.clientY - i, b = h ? -1 : 1, g = d.startMax - d.startMin;
2163
- u.min = d.startMin + b * (w / p) * g, u.max = d.startMax + b * (w / p) * g, u.auto = !1, ht(u);
2189
+ const h = d.ori === W.Horizontal, g = h ? f.width : f.height, w = h ? a.clientX - r : a.clientY - i, S = (h ? -1 : 1) * d.dir, b = d.startMax - d.startMin;
2190
+ u.min = d.startMin + S * (w / g) * b, u.max = d.startMax + S * (w / g) * b, u.auto = !1, gt(u);
2164
2191
  }
2165
2192
  t.renderer.clearCache(), t.scheduleRedraw();
2166
2193
  },
2167
2194
  onEnd() {
2168
- Et(t);
2195
+ zt(t);
2169
2196
  }
2170
2197
  };
2171
2198
  }
@@ -2179,74 +2206,74 @@ function Be(t, e, n) {
2179
2206
  const i = s ? e.clientY - r.top : e.clientX - r.left, l = o.min, c = o.max, f = n.scaleId;
2180
2207
  return {
2181
2208
  onMove(d, u) {
2182
- const h = t.plotBox, p = u, w = s ? h.height : h.width, g = ((s ? p.clientY - r.top : p.clientX - r.left) - i) / w, m = s ? 1 : -1, M = c - l, v = t.scaleManager.getScale(f);
2183
- v != null && (v.min = l + m * g * M, v.max = c + m * g * M, v.auto = !1, ht(v), t.renderer.clearCache(), t.scheduleRedraw());
2209
+ const h = t.plotBox, g = u, w = s ? h.height : h.width, b = ((s ? g.clientY - r.top : g.clientX - r.left) - i) / w, M = (s ? 1 : -1) * o.dir, p = c - l, m = t.scaleManager.getScale(f);
2210
+ m != null && (m.min = l + M * b * p, m.max = c + M * b * p, m.auto = !1, gt(m), t.renderer.clearCache(), t.scheduleRedraw());
2184
2211
  },
2185
2212
  onEnd() {
2186
- Et(t);
2213
+ zt(t);
2187
2214
  }
2188
2215
  };
2189
2216
  }
2190
2217
  function ae(t, e, n) {
2191
2218
  if (!(e instanceof WheelEvent)) return;
2192
- const o = e.deltaY * dn * 10;
2219
+ const o = e.deltaY * hn * 10;
2193
2220
  for (const s of t.scaleManager.getAllScales()) {
2194
2221
  if (!K(s) || !n(s.ori)) continue;
2195
2222
  const r = s.max - s.min;
2196
- s.min += o * r, s.max += o * r, s.auto = !1, ht(s);
2223
+ s.min += o * r, s.max += o * r, s.auto = !1, gt(s);
2197
2224
  }
2198
- t.renderer.clearCache(), t.scheduleRedraw(), Et(t);
2225
+ t.renderer.clearCache(), t.scheduleRedraw(), zt(t);
2199
2226
  }
2200
- const Vt = (t) => t === W.Horizontal, Bt = (t) => t === W.Vertical, Xt = () => !0;
2227
+ const Xt = (t) => t === W.Horizontal, Yt = (t) => t === W.Vertical, Nt = () => !0;
2201
2228
  function ds(t) {
2202
2229
  switch (t) {
2203
2230
  case "zoomX":
2204
2231
  return (e, n, o) => {
2205
2232
  if (n instanceof WheelEvent) {
2206
- re(e, n, o, Vt);
2233
+ re(e, n, o, Xt);
2207
2234
  return;
2208
2235
  }
2209
- return le(e, o, Vt);
2236
+ return le(e, o, Xt);
2210
2237
  };
2211
2238
  case "zoomY":
2212
2239
  return (e, n, o) => {
2213
2240
  if (n instanceof WheelEvent) {
2214
- re(e, n, o, Bt);
2241
+ re(e, n, o, Yt);
2215
2242
  return;
2216
2243
  }
2217
- return le(e, o, Bt);
2244
+ return le(e, o, Yt);
2218
2245
  };
2219
2246
  case "zoomXY":
2220
2247
  return (e, n, o) => {
2221
2248
  if (n instanceof WheelEvent) {
2222
- re(e, n, o, Xt);
2249
+ re(e, n, o, Nt);
2223
2250
  return;
2224
2251
  }
2225
- return le(e, o, Xt);
2252
+ return le(e, o, Nt);
2226
2253
  };
2227
2254
  case "panX":
2228
2255
  return (e, n, o) => {
2229
2256
  if (n instanceof WheelEvent) {
2230
- ae(e, n, Vt);
2257
+ ae(e, n, Xt);
2231
2258
  return;
2232
2259
  }
2233
- return o.scaleId != null ? Be(e, n, o) : ce(e, n, Vt);
2260
+ return o.scaleId != null ? Be(e, n, o) : ce(e, n, Xt);
2234
2261
  };
2235
2262
  case "panY":
2236
2263
  return (e, n, o) => {
2237
2264
  if (n instanceof WheelEvent) {
2238
- ae(e, n, Bt);
2265
+ ae(e, n, Yt);
2239
2266
  return;
2240
2267
  }
2241
- return o.scaleId != null ? Be(e, n, o) : ce(e, n, Bt);
2268
+ return o.scaleId != null ? Be(e, n, o) : ce(e, n, Yt);
2242
2269
  };
2243
2270
  case "panXY":
2244
2271
  return (e, n, o) => {
2245
2272
  if (n instanceof WheelEvent) {
2246
- ae(e, n, Xt);
2273
+ ae(e, n, Nt);
2247
2274
  return;
2248
2275
  }
2249
- return ce(e, n, Xt);
2276
+ return ce(e, n, Nt);
2250
2277
  };
2251
2278
  case "reset":
2252
2279
  return (e) => {
@@ -2261,307 +2288,307 @@ function ds(t) {
2261
2288
  return;
2262
2289
  }
2263
2290
  }
2264
- function Xe(t) {
2291
+ function Ve(t) {
2265
2292
  return typeof t == "function" ? t : ds(t);
2266
2293
  }
2267
2294
  function gs(t, e) {
2268
2295
  const n = t.plotBox, o = e.left / n.width, s = (e.left + e.width) / n.width, r = {};
2269
2296
  for (const i of t.scaleManager.getAllScales()) {
2270
2297
  if (i.ori !== W.Horizontal || !K(i)) continue;
2271
- const l = vt(n.left + o * n.width, i, n.width, n.left), c = vt(n.left + s * n.width, i, n.width, n.left);
2298
+ const l = bt(n.left + o * n.width, i, n.width, n.left), c = bt(n.left + s * n.width, i, n.width, n.left);
2272
2299
  r[i.id] = { min: Math.min(l, c), max: Math.max(l, c) };
2273
2300
  }
2274
2301
  return { left: o, right: s, ranges: r };
2275
2302
  }
2276
2303
  function ps(t, e) {
2277
- Z(() => {
2304
+ rt(() => {
2278
2305
  if (e != null)
2279
2306
  return ms(t, e);
2280
2307
  }, [t, e]);
2281
2308
  }
2282
2309
  function ms(t, e) {
2283
2310
  let n = null, o = !1, s = null, r = -1, i = -1;
2284
- function l(S) {
2285
- const C = e.getBoundingClientRect(), _ = t.plotBox;
2311
+ function l(v) {
2312
+ const k = e.getBoundingClientRect(), _ = t.plotBox;
2286
2313
  return {
2287
- cx: S.clientX - C.left - _.left,
2288
- cy: S.clientY - C.top - _.top
2314
+ cx: v.clientX - k.left - _.left,
2315
+ cy: v.clientY - k.top - _.top
2289
2316
  };
2290
2317
  }
2291
- function c(S, C) {
2318
+ function c(v, k) {
2292
2319
  const _ = t.plotBox;
2293
- return S >= 0 && S <= _.width && C >= 0 && C <= _.height;
2320
+ return v >= 0 && v <= _.width && k >= 0 && k <= _.height;
2294
2321
  }
2295
- function f(S, C) {
2296
- const _ = e.getBoundingClientRect(), I = S - _.left, H = C - _.top, z = t.plotBox;
2322
+ function f(v, k) {
2323
+ const _ = e.getBoundingClientRect(), D = v - _.left, $ = k - _.top, z = t.plotBox;
2297
2324
  for (const G of t.axisStates) {
2298
- const Y = G.config, q = Y.side;
2325
+ const U = G.config, Z = U.side;
2299
2326
  if (G._size <= 0) continue;
2300
- const ot = H >= z.top && H <= z.top + z.height, J = I >= z.left && I <= z.left + z.width;
2301
- if (q === U.Left && I < z.left && ot || q === U.Right && I > z.left + z.width && ot || q === U.Top && H < z.top && J || q === U.Bottom && H > z.top + z.height && J)
2302
- return { scaleId: Y.scale, ori: _t(q) };
2327
+ const ot = $ >= z.top && $ <= z.top + z.height, J = D >= z.left && D <= z.left + z.width;
2328
+ if (Z === N.Left && D < z.left && ot || Z === N.Right && D > z.left + z.width && ot || Z === N.Top && $ < z.top && J || Z === N.Bottom && $ > z.top + z.height && J)
2329
+ return { scaleId: U.scale, ori: Et(Z) };
2303
2330
  }
2304
2331
  return null;
2305
2332
  }
2306
- function a(S) {
2307
- const { cx: C, cy: _ } = l(S);
2308
- return { cx: C, cy: _, inPlot: c(C, _) };
2333
+ function a(v) {
2334
+ const { cx: k, cy: _ } = l(v);
2335
+ return { cx: k, cy: _, inPlot: c(k, _) };
2309
2336
  }
2310
- function d(S) {
2337
+ function d(v) {
2311
2338
  if (n == null) {
2312
- p();
2339
+ g();
2313
2340
  return;
2314
2341
  }
2315
- e.contains(S.target) || (o = !0, n.onMove(t, S, a(S)), m(S, S));
2342
+ e.contains(v.target) || (o = !0, n.onMove(t, v, a(v)), M(v, v));
2316
2343
  }
2317
- function u(S) {
2318
- p(), n != null && (e.contains(S.target) || (n.onEnd(t, S, a(S)), n = null, r = -1, i = -1, t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw()));
2344
+ function u(v) {
2345
+ g(), n != null && (e.contains(v.target) || (n.onEnd(t, v, a(v)), n = null, r = -1, i = -1, t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw()));
2319
2346
  }
2320
2347
  function h() {
2321
2348
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
2322
2349
  }
2323
- function p() {
2350
+ function g() {
2324
2351
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
2325
2352
  }
2326
2353
  function w() {
2327
- n != null && (n = null, p(), t.cursorManager.hide(), t.scheduleCursorRedraw());
2354
+ n != null && (n = null, g(), t.cursorManager.hide(), t.scheduleCursorRedraw());
2328
2355
  }
2329
- function b(S, C, _) {
2330
- const I = t.cursorManager.state;
2331
- let H = null;
2332
- if (I.activeGroup >= 0 && I.activeDataIdx >= 0) {
2333
- const z = t.dataStore.data[I.activeGroup];
2356
+ function S(v, k, _) {
2357
+ const D = t.cursorManager.state;
2358
+ let $ = null;
2359
+ if (D.activeGroup >= 0 && D.activeDataIdx >= 0) {
2360
+ const z = t.dataStore.data[D.activeGroup];
2334
2361
  if (z != null) {
2335
- const G = z.x[I.activeDataIdx], Y = z.series[I.activeSeriesIdx], q = Y != null ? Y[I.activeDataIdx] : void 0;
2336
- if (G != null && q != null) {
2337
- const et = t.plotBox, ot = t.scaleManager.getGroupXScaleKey(I.activeGroup), J = ot != null ? t.scaleManager.getScale(ot) : void 0, dt = t.seriesConfigMap.get(`${I.activeGroup}:${I.activeSeriesIdx}`), Tt = dt != null ? t.scaleManager.getScale(dt.yScale) : void 0;
2338
- let At = C, Jt = _;
2339
- J != null && K(J) && (At = V(G, J, et.width, et.left) - et.left), Tt != null && K(Tt) && (Jt = V(q, Tt, et.height, et.top) - et.top);
2340
- const ke = C - At, Te = _ - Jt;
2341
- H = {
2342
- group: I.activeGroup,
2343
- seriesIdx: I.activeSeriesIdx,
2344
- dataIdx: I.activeDataIdx,
2362
+ const G = z.x[D.activeDataIdx], U = z.series[D.activeSeriesIdx], Z = U != null ? U[D.activeDataIdx] : void 0;
2363
+ if (G != null && Z != null) {
2364
+ const et = t.plotBox, ot = t.scaleManager.getGroupXScaleKey(D.activeGroup), J = ot != null ? t.scaleManager.getScale(ot) : void 0, pt = t.seriesConfigMap.get(`${D.activeGroup}:${D.activeSeriesIdx}`), At = pt != null ? t.scaleManager.getScale(pt.yScale) : void 0;
2365
+ let It = k, Qt = _;
2366
+ J != null && K(J) && (It = B(G, J, et.width, et.left) - et.left), At != null && K(At) && (Qt = B(Z, At, et.height, et.top) - et.top);
2367
+ const Ce = k - It, ke = _ - Qt;
2368
+ $ = {
2369
+ group: D.activeGroup,
2370
+ seriesIdx: D.activeSeriesIdx,
2371
+ dataIdx: D.activeDataIdx,
2345
2372
  xVal: G,
2346
- yVal: q,
2347
- pxX: At,
2348
- pxY: Jt,
2349
- dist: Math.sqrt(ke * ke + Te * Te)
2373
+ yVal: Z,
2374
+ pxX: It,
2375
+ pxY: Qt,
2376
+ dist: Math.sqrt(Ce * Ce + ke * ke)
2350
2377
  };
2351
2378
  }
2352
2379
  }
2353
2380
  }
2354
- return { plotX: C, plotY: _, point: H, srcEvent: S };
2381
+ return { plotX: k, plotY: _, point: $, srcEvent: v };
2355
2382
  }
2356
- function g(S, C, _, I = !0) {
2357
- const H = us(t.actionMap, S, C, _, I);
2358
- if (!(H == null || H === "none"))
2359
- return Xe(H);
2383
+ function b(v, k, _, D = !0) {
2384
+ const $ = us(t.actionMap, v, k, _, D);
2385
+ if (!($ == null || $ === "none"))
2386
+ return Ve($);
2360
2387
  }
2361
- function m(S, C) {
2362
- const { cx: _, cy: I } = l(S);
2363
- if (!c(_, I) && n == null) {
2388
+ function M(v, k) {
2389
+ const { cx: _, cy: D } = l(v);
2390
+ if (!c(_, D) && n == null) {
2364
2391
  r = -1, i = -1, t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw();
2365
2392
  return;
2366
2393
  }
2367
- const H = _ !== r || I !== i;
2368
- if (r = _, i = I, t.cursorManager.update(
2394
+ const $ = _ !== r || D !== i;
2395
+ if (r = _, i = D, t.cursorManager.update(
2369
2396
  _,
2370
- I,
2397
+ D,
2371
2398
  t.plotBox,
2372
2399
  t.dataStore.data,
2373
2400
  t.seriesConfigs,
2374
2401
  (z) => t.scaleManager.getScale(z),
2375
2402
  (z) => t.dataStore.getWindow(z),
2376
2403
  (z) => t.scaleManager.getGroupXScaleKey(z)
2377
- ), H) {
2378
- const z = { cx: _, cy: I, inPlot: c(_, I) }, G = t.actionMap.get("hover");
2404
+ ), $) {
2405
+ const z = { cx: _, cy: D, inPlot: c(_, D) }, G = t.actionMap.get("hover");
2379
2406
  if (G != null && G !== "none") {
2380
- const Y = Xe(G);
2381
- if (Y != null && Y(t, C ?? S, z), t.focusAlpha < 1) {
2382
- const q = t.cursorManager.state;
2383
- if (q.activeGroup >= 0 && q.activeSeriesIdx >= 0) {
2407
+ const U = Ve(G);
2408
+ if (U != null && U(t, k ?? v, z), t.focusAlpha < 1) {
2409
+ const Z = t.cursorManager.state;
2410
+ if (Z.activeGroup >= 0 && Z.activeSeriesIdx >= 0) {
2384
2411
  const et = t.seriesConfigs.findIndex(
2385
- (ot) => ot.group === q.activeGroup && ot.index === q.activeSeriesIdx
2412
+ (ot) => ot.group === Z.activeGroup && ot.index === Z.activeSeriesIdx
2386
2413
  );
2387
2414
  et >= 0 && t.focusedSeries !== et && (t.focusedSeries = et, t.scheduleRedraw());
2388
2415
  }
2389
2416
  }
2390
2417
  }
2391
2418
  }
2392
- if (C != null && t.eventCallbacks.onCursorMove != null && c(_, I))
2419
+ if (k != null && t.eventCallbacks.onCursorMove != null && c(_, D))
2393
2420
  try {
2394
- t.eventCallbacks.onCursorMove(b(C, _, I));
2421
+ t.eventCallbacks.onCursorMove(S(k, _, D));
2395
2422
  } catch (z) {
2396
2423
  console.warn("[uPlot+] event callback error:", z);
2397
2424
  }
2398
2425
  t.scheduleCursorRedraw();
2399
2426
  }
2400
- function M() {
2427
+ function p() {
2401
2428
  document.activeElement !== e && e.focus();
2402
2429
  }
2403
- function v(S) {
2404
- const C = a(S), _ = f(S.clientX, S.clientY);
2405
- let I;
2406
- if (_ != null && S.button === 0)
2407
- I = _.ori === W.Horizontal ? "xGutterDrag" : "yGutterDrag", C.scaleId = _.scaleId, C.ori = _.ori;
2408
- else if (I = is(S), !C.inPlot) return;
2409
- C.action = I;
2410
- const H = g(I, S, C, !1);
2411
- if (H == null) return;
2412
- (S.button !== 0 || _ != null) && S.preventDefault();
2413
- const z = H(t, S, C);
2430
+ function m(v) {
2431
+ const k = a(v), _ = f(v.clientX, v.clientY);
2432
+ let D;
2433
+ if (_ != null && v.button === 0)
2434
+ D = _.ori === W.Horizontal ? "xGutterDrag" : "yGutterDrag", k.scaleId = _.scaleId, k.ori = _.ori;
2435
+ else if (D = is(v), !k.inPlot) return;
2436
+ k.action = D;
2437
+ const $ = b(D, v, k, !1);
2438
+ if ($ == null) return;
2439
+ (v.button !== 0 || _ != null) && v.preventDefault();
2440
+ const z = $(t, v, k);
2414
2441
  z != null && (n = z, o = !1, h());
2415
2442
  }
2416
- function D(S) {
2443
+ function T(v) {
2417
2444
  if (n != null) {
2418
- o = !0, n.onMove(t, S, a(S)), m(S, S);
2445
+ o = !0, n.onMove(t, v, a(v)), M(v, v);
2419
2446
  return;
2420
2447
  }
2421
- m(S, S);
2448
+ M(v, v);
2422
2449
  }
2423
- function T(S) {
2450
+ function A(v) {
2424
2451
  if (n != null) {
2425
- n.onEnd(t, S, a(S)), n = null;
2452
+ n.onEnd(t, v, a(v)), n = null;
2426
2453
  return;
2427
2454
  }
2428
2455
  }
2429
- function y(S) {
2456
+ function y(v) {
2430
2457
  if (o) {
2431
2458
  o = !1;
2432
2459
  return;
2433
2460
  }
2434
- const C = a(S);
2435
- if (!C.inPlot) return;
2436
- const _ = rs(S);
2437
- C.action = _;
2438
- const I = g(_, S, C);
2439
- I != null && I(t, S, C);
2440
- const H = t.eventCallbacks.onClick;
2441
- if (H != null)
2461
+ const k = a(v);
2462
+ if (!k.inPlot) return;
2463
+ const _ = rs(v);
2464
+ k.action = _;
2465
+ const D = b(_, v, k);
2466
+ D != null && D(t, v, k);
2467
+ const $ = t.eventCallbacks.onClick;
2468
+ if ($ != null)
2442
2469
  try {
2443
- H(b(S, C.cx, C.cy));
2470
+ $(S(v, k.cx, k.cy));
2444
2471
  } catch (z) {
2445
2472
  console.warn("[uPlot+] event callback error:", z);
2446
2473
  }
2447
2474
  }
2448
- function x(S) {
2475
+ function x(v) {
2449
2476
  if (n != null) {
2450
- S.preventDefault();
2477
+ v.preventDefault();
2451
2478
  return;
2452
2479
  }
2453
- const C = a(S);
2454
- if (!C.inPlot) return;
2455
- S.preventDefault(), C.action = "rightClick";
2456
- const _ = g("rightClick", S, C);
2457
- _ != null && _(t, S, C);
2458
- const I = t.eventCallbacks.onContextMenu;
2459
- if (I != null)
2480
+ const k = a(v);
2481
+ if (!k.inPlot) return;
2482
+ v.preventDefault(), k.action = "rightClick";
2483
+ const _ = b("rightClick", v, k);
2484
+ _ != null && _(t, v, k);
2485
+ const D = t.eventCallbacks.onContextMenu;
2486
+ if (D != null)
2460
2487
  try {
2461
- I(b(S, C.cx, C.cy));
2462
- } catch (H) {
2463
- console.warn("[uPlot+] event callback error:", H);
2488
+ D(S(v, k.cx, k.cy));
2489
+ } catch ($) {
2490
+ console.warn("[uPlot+] event callback error:", $);
2464
2491
  }
2465
2492
  }
2466
- function A(S) {
2467
- var C, _;
2493
+ function P(v) {
2494
+ var k, _;
2468
2495
  if (n == null) {
2469
2496
  r = -1, i = -1, t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw();
2470
2497
  try {
2471
- (_ = (C = t.eventCallbacks).onCursorLeave) == null || _.call(C);
2472
- } catch (I) {
2473
- console.warn("[uPlot+] event callback error:", I);
2498
+ (_ = (k = t.eventCallbacks).onCursorLeave) == null || _.call(k);
2499
+ } catch (D) {
2500
+ console.warn("[uPlot+] event callback error:", D);
2474
2501
  }
2475
2502
  }
2476
2503
  }
2477
- function L(S) {
2478
- const C = a(S);
2479
- if (!C.inPlot) return;
2504
+ function L(v) {
2505
+ const k = a(v);
2506
+ if (!k.inPlot) return;
2480
2507
  if (t.eventCallbacks.onDblClick != null) {
2481
- let H;
2508
+ let $;
2482
2509
  try {
2483
- H = t.eventCallbacks.onDblClick(b(S, C.cx, C.cy));
2510
+ $ = t.eventCallbacks.onDblClick(S(v, k.cx, k.cy));
2484
2511
  } catch (z) {
2485
2512
  console.warn("[uPlot+] event callback error:", z);
2486
2513
  }
2487
- if (H === !1) return;
2514
+ if ($ === !1) return;
2488
2515
  }
2489
- const _ = ls(S);
2490
- C.action = _;
2491
- const I = g(_, S, C, !1);
2492
- I != null && I(t, S, C);
2493
- }
2494
- function k(S) {
2495
- const C = a(S);
2496
- if (!C.inPlot) return;
2497
- const _ = cs(S);
2498
- C.action = _;
2499
- const I = g(_, S, C);
2500
- I != null && (S.preventDefault(), I(t, S, C));
2501
- }
2502
- function E(S) {
2503
- if (S.touches.length === 2) {
2504
- const z = S.touches[0], G = S.touches[1], Y = G.clientX - z.clientX, q = G.clientY - z.clientY;
2516
+ const _ = ls(v);
2517
+ k.action = _;
2518
+ const D = b(_, v, k, !1);
2519
+ D != null && D(t, v, k);
2520
+ }
2521
+ function F(v) {
2522
+ const k = a(v);
2523
+ if (!k.inPlot) return;
2524
+ const _ = cs(v);
2525
+ k.action = _;
2526
+ const D = b(_, v, k);
2527
+ D != null && (v.preventDefault(), D(t, v, k));
2528
+ }
2529
+ function I(v) {
2530
+ if (v.touches.length === 2) {
2531
+ const z = v.touches[0], G = v.touches[1], U = G.clientX - z.clientX, Z = G.clientY - z.clientY;
2505
2532
  s = {
2506
- dist: Math.sqrt(Y * Y + q * q),
2533
+ dist: Math.sqrt(U * U + Z * Z),
2507
2534
  midX: (z.clientX + G.clientX) / 2,
2508
2535
  midY: (z.clientY + G.clientY) / 2
2509
2536
  }, n = null;
2510
2537
  return;
2511
2538
  }
2512
- const C = S.touches[0];
2513
- if (C == null) return;
2514
- const _ = a(C);
2539
+ const k = v.touches[0];
2540
+ if (k == null) return;
2541
+ const _ = a(k);
2515
2542
  if (!_.inPlot) return;
2516
- const I = g("touchDrag", S, _);
2517
- if (I == null) return;
2518
- const H = I(t, S, _);
2519
- H != null && (n = H, o = !1);
2520
- }
2521
- function P(S) {
2522
- if (S.touches.length === 2 && s != null) {
2523
- S.preventDefault();
2524
- const _ = S.touches[0], I = S.touches[1], H = I.clientX - _.clientX, z = I.clientY - _.clientY, G = Math.sqrt(H * H + z * z), Y = a({ clientX: s.midX, clientY: s.midY });
2525
- if (g("pinch", S, Y) != null) {
2543
+ const D = b("touchDrag", v, _);
2544
+ if (D == null) return;
2545
+ const $ = D(t, v, _);
2546
+ $ != null && (n = $, o = !1);
2547
+ }
2548
+ function C(v) {
2549
+ if (v.touches.length === 2 && s != null) {
2550
+ v.preventDefault();
2551
+ const _ = v.touches[0], D = v.touches[1], $ = D.clientX - _.clientX, z = D.clientY - _.clientY, G = Math.sqrt($ * $ + z * z), U = a({ clientX: s.midX, clientY: s.midY });
2552
+ if (b("pinch", v, U) != null) {
2526
2553
  const et = G / s.dist, ot = t.plotBox;
2527
2554
  for (const J of t.scaleManager.getAllScales()) {
2528
2555
  if (J.ori !== W.Horizontal || !K(J)) continue;
2529
- const dt = vt(Y.cx + ot.left, J, ot.width, ot.left), Tt = dt - (dt - J.min) / et, At = dt + (J.max - dt) / et;
2530
- J.min = Math.min(Tt, At), J.max = Math.max(Tt, At), J.auto = !1, ht(J);
2556
+ const pt = bt(U.cx + ot.left, J, ot.width, ot.left), At = pt - (pt - J.min) / et, It = pt + (J.max - pt) / et;
2557
+ J.min = Math.min(At, It), J.max = Math.max(At, It), J.auto = !1, gt(J);
2531
2558
  }
2532
- s.dist = G, t.renderer.clearCache(), t.scheduleRedraw(), Et(t);
2559
+ s.dist = G, t.renderer.clearCache(), t.scheduleRedraw(), zt(t);
2533
2560
  }
2534
2561
  return;
2535
2562
  }
2536
- const C = S.touches[0];
2537
- if (C != null) {
2563
+ const k = v.touches[0];
2564
+ if (k != null) {
2538
2565
  if (n != null) {
2539
- o = !0, n.onMove(t, S, a(C)), m(C, S), S.preventDefault();
2566
+ o = !0, n.onMove(t, v, a(k)), M(k, v), v.preventDefault();
2540
2567
  return;
2541
2568
  }
2542
- m(C, S);
2569
+ M(k, v);
2543
2570
  }
2544
2571
  }
2545
- function F(S) {
2572
+ function E(v) {
2546
2573
  if (s != null) {
2547
2574
  s = null;
2548
2575
  return;
2549
2576
  }
2550
- const C = S.changedTouches[0];
2551
- C != null && n != null && (n.onEnd(t, S, a(C)), n = null);
2577
+ const k = v.changedTouches[0];
2578
+ k != null && n != null && (n.onEnd(t, v, a(k)), n = null);
2552
2579
  }
2553
- function $(S) {
2554
- const C = {
2580
+ function H(v) {
2581
+ const k = {
2555
2582
  cx: r,
2556
2583
  cy: i,
2557
2584
  inPlot: r >= 0 && i >= 0
2558
- }, _ = as(S);
2559
- C.action = _;
2560
- const I = g(_, S, C);
2561
- I != null && (S.preventDefault(), I(t, S, C));
2585
+ }, _ = as(v);
2586
+ k.action = _;
2587
+ const D = b(_, v, k);
2588
+ D != null && (v.preventDefault(), D(t, v, k));
2562
2589
  }
2563
- return e.addEventListener("mouseenter", M), e.addEventListener("mousemove", D), e.addEventListener("mousedown", v), e.addEventListener("mouseup", T), e.addEventListener("click", y), e.addEventListener("contextmenu", x), e.addEventListener("mouseleave", A), e.addEventListener("dblclick", L), e.addEventListener("wheel", k, { passive: !1 }), e.addEventListener("touchstart", E, { passive: !0 }), e.addEventListener("touchmove", P, { passive: !1 }), e.addEventListener("touchend", F), e.addEventListener("keydown", $), window.addEventListener("blur", w), () => {
2564
- p(), e.removeEventListener("mouseenter", M), e.removeEventListener("mousemove", D), e.removeEventListener("mousedown", v), e.removeEventListener("mouseup", T), e.removeEventListener("click", y), e.removeEventListener("contextmenu", x), e.removeEventListener("mouseleave", A), e.removeEventListener("dblclick", L), e.removeEventListener("wheel", k), e.removeEventListener("touchstart", E), e.removeEventListener("touchmove", P), e.removeEventListener("touchend", F), e.removeEventListener("keydown", $), window.removeEventListener("blur", w);
2590
+ return e.addEventListener("mouseenter", p), e.addEventListener("mousemove", T), e.addEventListener("mousedown", m), e.addEventListener("mouseup", A), e.addEventListener("click", y), e.addEventListener("contextmenu", x), e.addEventListener("mouseleave", P), e.addEventListener("dblclick", L), e.addEventListener("wheel", F, { passive: !1 }), e.addEventListener("touchstart", I, { passive: !0 }), e.addEventListener("touchmove", C, { passive: !1 }), e.addEventListener("touchend", E), e.addEventListener("keydown", H), window.addEventListener("blur", w), () => {
2591
+ g(), e.removeEventListener("mouseenter", p), e.removeEventListener("mousemove", T), e.removeEventListener("mousedown", m), e.removeEventListener("mouseup", A), e.removeEventListener("click", y), e.removeEventListener("contextmenu", x), e.removeEventListener("mouseleave", P), e.removeEventListener("dblclick", L), e.removeEventListener("wheel", F), e.removeEventListener("touchstart", I), e.removeEventListener("touchmove", C), e.removeEventListener("touchend", E), e.removeEventListener("keydown", H), window.removeEventListener("blur", w);
2565
2592
  };
2566
2593
  }
2567
2594
  const he = /* @__PURE__ */ new Map();
@@ -2609,12 +2636,12 @@ class vs {
2609
2636
  return;
2610
2637
  }
2611
2638
  for (const l of this.members)
2612
- l !== e && (this.syncedStores.add(l), l.cursorManager.syncToValue(i, l), l.scheduleCursorRedraw());
2639
+ l !== e && (this.syncedStores.add(l), l.cursorManager.syncToValue(i, l, o), l.scheduleCursorRedraw());
2613
2640
  this.publishing = !1;
2614
2641
  }
2615
2642
  }
2616
2643
  function Ss(t, e) {
2617
- Z(() => {
2644
+ rt(() => {
2618
2645
  if (e == null) return;
2619
2646
  const n = ws(e);
2620
2647
  n.join(t);
@@ -2628,24 +2655,24 @@ function Ss(t, e) {
2628
2655
  };
2629
2656
  }, [t, e]);
2630
2657
  }
2631
- function gn(t) {
2658
+ function dn(t) {
2632
2659
  return t instanceof Float64Array ? t : new Float64Array(t);
2633
2660
  }
2634
- function pn(t) {
2661
+ function gn(t) {
2635
2662
  return t instanceof Float64Array || t.some((e) => e == null) ? t : new Float64Array(t);
2636
2663
  }
2637
- function Ye(t) {
2638
- return { x: gn(t.x), series: [pn(t.y)] };
2664
+ function Xe(t) {
2665
+ return { x: dn(t.x), series: [gn(t.y)] };
2639
2666
  }
2640
2667
  function bs(t) {
2641
- return { x: gn(t.x), series: t.series.map(pn) };
2668
+ return { x: dn(t.x), series: t.series.map(gn) };
2642
2669
  }
2643
- function de(t) {
2670
+ function pn(t) {
2644
2671
  if (!Array.isArray(t))
2645
- return [Ye(t)];
2672
+ return [Xe(t)];
2646
2673
  if (t.length === 0) return [];
2647
2674
  const e = t[0];
2648
- return e == null ? [] : "series" in e ? t.map(bs) : t.map(Ye);
2675
+ return e == null ? [] : "series" in e ? t.map(bs) : t.map(Xe);
2649
2676
  }
2650
2677
  function mn({
2651
2678
  width: t,
@@ -2662,68 +2689,69 @@ function mn({
2662
2689
  syncKey: d,
2663
2690
  actions: u,
2664
2691
  onClick: h,
2665
- onContextMenu: p,
2692
+ onContextMenu: g,
2666
2693
  onDblClick: w,
2667
- onCursorMove: b,
2668
- onCursorLeave: g,
2669
- onScaleChange: m,
2670
- onSelect: M
2694
+ onCursorMove: S,
2695
+ onCursorLeave: b,
2696
+ onScaleChange: M,
2697
+ onSelect: p
2671
2698
  }) {
2672
- const v = ns(), [D, T] = Mt(null), y = r ?? (typeof window < "u" && window.devicePixelRatio || 1);
2673
- Z(() => {
2674
- v.actionMap = u != null ? new Map([...ue, ...u]) : new Map(ue);
2675
- }, [v, u]), Z(() => {
2676
- v.setLabels(i, l, c);
2677
- }, [v, i, l, c]);
2678
- const x = v.eventCallbacks;
2679
- x.onClick = h, x.onContextMenu = p, x.onDblClick = w, x.onCursorMove = b, x.onCursorLeave = g, x.onScaleChange = m, x.onSelect = M, ps(v, D), Ss(v, d);
2680
- const A = N(null), L = (I) => {
2681
- A.current !== I && (A.current = I, v.setCanvas(I), I && v.scheduleRedraw());
2682
- }, k = N(null), E = (I) => {
2683
- k.current !== I && (k.current = I, T(I));
2684
- };
2685
- Ut(() => {
2686
- v.pxRatio = y, v.setSize(t, e), v.redrawSync();
2687
- }, [v, t, e, y]), Z(() => () => {
2688
- v.setCanvas(null), v.scheduler.cancel(), v.focusedSeries = null, v.eventCallbacks = {};
2689
- }, [v]), Z(() => {
2690
- if (D == null || typeof ResizeObserver > "u") return;
2691
- const I = new ResizeObserver((H) => {
2692
- const z = H[0];
2693
- if (z == null) return;
2694
- const { width: G, height: Y } = z.contentRect;
2695
- G > 0 && Y > 0 && (G !== v.width || Y !== v.height) && (v.setSize(Math.round(G), Math.round(Y)), v.scheduleRedraw());
2699
+ const m = ns(), [T, A] = ut(null), y = r ?? (typeof window < "u" && window.devicePixelRatio || 1);
2700
+ rt(() => {
2701
+ m.actionMap = u != null ? new Map([...ue, ...u]) : new Map(ue);
2702
+ }, [m, u]), j(() => {
2703
+ m.setLabels(i, l, c);
2704
+ }, [m, i, l, c]), rt(() => {
2705
+ const v = m.eventCallbacks;
2706
+ v.onClick = h, v.onContextMenu = g, v.onDblClick = w, v.onCursorMove = S, v.onCursorLeave = b, v.onScaleChange = M, v.onSelect = p;
2707
+ }, [m, h, g, w, S, b, M, p]), ps(m, T), Ss(m, d);
2708
+ const x = Y(null), P = Lt((v) => {
2709
+ x.current !== v && (x.current = v, m.setCanvas(v), v && m.scheduleRedraw());
2710
+ }, [m]), L = Y(null), F = Lt((v) => {
2711
+ L.current !== v && (L.current = v, A(v));
2712
+ }, []), I = Y(f);
2713
+ j(() => {
2714
+ I.current = f;
2715
+ });
2716
+ const C = Y(a);
2717
+ j(() => {
2718
+ C.current = a;
2719
+ });
2720
+ const E = Y(!1), H = Y(n);
2721
+ return j(() => {
2722
+ n === H.current && m.dataStore.data.length > 0 || (H.current = n, E.current = !0, m.setData(pn(n)), m.scheduleRedraw());
2723
+ }, [m, n]), j(() => {
2724
+ m.setSize(t, e, y), E.current && m.redrawSync();
2725
+ }, [m, t, e, y]), rt(() => () => {
2726
+ m.setCanvas(null), m.scheduler.cancel(), m.focusedSeries = null, m.eventCallbacks = {};
2727
+ }, [m]), rt(() => {
2728
+ if (T == null || typeof ResizeObserver > "u") return;
2729
+ const v = new ResizeObserver((k) => {
2730
+ const _ = k[0];
2731
+ if (_ == null) return;
2732
+ const { width: D, height: $ } = _.contentRect;
2733
+ D > 0 && $ > 0 && (D !== m.width || $ !== m.height) && (m.setSize(Math.round(D), Math.round($)), m.scheduleRedraw());
2696
2734
  });
2697
- return I.observe(D), () => {
2698
- I.disconnect();
2735
+ return v.observe(T), () => {
2736
+ v.disconnect();
2699
2737
  };
2700
- }, [v, D]);
2701
- const P = N(void 0), F = N(de(n));
2702
- n !== P.current && (P.current = n, F.current = de(n));
2703
- const $ = F.current, S = N(n);
2704
- Z(() => {
2705
- n === S.current && v.dataStore.data.length > 0 || (S.current = n, v.setData($), v.scheduleRedraw());
2706
- }, [v, n, $]);
2707
- const C = N(f);
2708
- C.current = f, Z(() => {
2709
- const I = (H) => {
2710
- var z;
2711
- (z = C.current) == null || z.call(C, H);
2738
+ }, [m, T]), j(() => {
2739
+ const v = (k) => {
2740
+ var _;
2741
+ (_ = I.current) == null || _.call(I, k);
2712
2742
  };
2713
- return v.drawHooks.add(I), () => {
2714
- v.drawHooks.delete(I);
2743
+ return m.drawHooks.add(v), () => {
2744
+ m.drawHooks.delete(v);
2715
2745
  };
2716
- }, [v]);
2717
- const _ = N(a);
2718
- return _.current = a, Z(() => {
2719
- const I = (H, z) => {
2720
- var G;
2721
- (G = _.current) == null || G.call(_, H, z);
2746
+ }, [m]), j(() => {
2747
+ const v = (k, _) => {
2748
+ var D;
2749
+ (D = C.current) == null || D.call(C, k, _);
2722
2750
  };
2723
- return v.cursorDrawHooks.add(I), () => {
2724
- v.cursorDrawHooks.delete(I);
2751
+ return m.cursorDrawHooks.add(v), () => {
2752
+ m.cursorDrawHooks.delete(v);
2725
2753
  };
2726
- }, [v]), /* @__PURE__ */ B(hn.Provider, { value: v, children: /* @__PURE__ */ ft(
2754
+ }, [m]), /* @__PURE__ */ V(fn.Provider, { value: m, children: /* @__PURE__ */ dt(
2727
2755
  "div",
2728
2756
  {
2729
2757
  className: s,
@@ -2734,11 +2762,11 @@ function mn({
2734
2762
  width: `${t}px`
2735
2763
  },
2736
2764
  children: [
2737
- /* @__PURE__ */ B(
2765
+ /* @__PURE__ */ V(
2738
2766
  "div",
2739
2767
  {
2740
- ref: E,
2741
- tabIndex: -1,
2768
+ ref: F,
2769
+ tabIndex: 0,
2742
2770
  style: {
2743
2771
  position: "relative",
2744
2772
  width: `${t}px`,
@@ -2747,10 +2775,10 @@ function mn({
2747
2775
  outline: "none",
2748
2776
  order: 0
2749
2777
  },
2750
- children: /* @__PURE__ */ B(
2778
+ children: /* @__PURE__ */ V(
2751
2779
  "canvas",
2752
2780
  {
2753
- ref: L,
2781
+ ref: P,
2754
2782
  style: {
2755
2783
  position: "absolute",
2756
2784
  left: 0,
@@ -2765,7 +2793,7 @@ function mn({
2765
2793
  }
2766
2794
  ) });
2767
2795
  }
2768
- function Ne(t) {
2796
+ function Ye(t) {
2769
2797
  return t != null && typeof t == "object" && !Array.isArray(t);
2770
2798
  }
2771
2799
  function Ms(t, e) {
@@ -2782,28 +2810,30 @@ function ys(t, e) {
2782
2810
  for (const i of r) {
2783
2811
  const l = n[i], c = o[i];
2784
2812
  if (l !== c)
2785
- if (Ne(l) && Ne(c)) {
2813
+ if (Ye(l) && Ye(c)) {
2786
2814
  if (!Ms(l, c)) return !1;
2787
2815
  } else
2788
2816
  return !1;
2789
2817
  }
2790
2818
  return !0;
2791
2819
  }
2792
- function Se(t, e, n, o, s) {
2793
- const r = st(), i = N(t);
2794
- i.current = t, Z(() => {
2820
+ function ve(t, e, n, o, s) {
2821
+ const r = st(), i = Y(t);
2822
+ j(() => {
2823
+ i.current = t;
2824
+ }), j(() => {
2795
2825
  const c = i.current;
2796
2826
  return n(r, c), r.scheduleRedraw(), () => {
2797
2827
  o(r, c), r.scheduleRedraw();
2798
2828
  };
2799
2829
  }, [r, ...e]);
2800
- const l = N(null);
2801
- Z(() => {
2830
+ const l = Y(t);
2831
+ j(() => {
2802
2832
  ys(l.current, t) || (l.current = t, s(r, t), r.scheduleRedraw());
2803
2833
  });
2804
2834
  }
2805
2835
  function hi(t) {
2806
- return Se(
2836
+ return ve(
2807
2837
  t,
2808
2838
  [t.id],
2809
2839
  (e, n) => e.registerScale(n),
@@ -2869,7 +2899,7 @@ function gi(t, e = 65, n = 50) {
2869
2899
  }
2870
2900
  return o;
2871
2901
  }
2872
- const Ue = [
2902
+ const Ne = [
2873
2903
  "#e74c3c",
2874
2904
  "#3498db",
2875
2905
  "#2ecc71",
@@ -2886,9 +2916,9 @@ const Ue = [
2886
2916
  "#8e44ad",
2887
2917
  "#d35400"
2888
2918
  ];
2889
- function Ke(t, e) {
2919
+ function Ue(t, e) {
2890
2920
  var i;
2891
- const n = (i = t.paths) == null ? void 0 : i.defaults, o = t.stroke ?? Ue[e % Ue.length] ?? "#000", s = t.fill ?? (n == null ? void 0 : n.fill), r = s === "auto" && typeof o == "string" ? Cs(o, 0.5) : s === "auto" ? void 0 : s;
2921
+ const n = (i = t.paths) == null ? void 0 : i.defaults, o = t.stroke ?? Ne[e % Ne.length] ?? "#000", s = t.fill ?? (n == null ? void 0 : n.fill), r = s === "auto" && typeof o == "string" ? Cs(o, 0.5) : s === "auto" ? void 0 : s;
2892
2922
  return {
2893
2923
  ...n,
2894
2924
  ...t,
@@ -2899,23 +2929,23 @@ function Ke(t, e) {
2899
2929
  };
2900
2930
  }
2901
2931
  function vn(t) {
2902
- return Se(
2932
+ return ve(
2903
2933
  t,
2904
2934
  [t.group, t.index],
2905
- (e, n) => e.registerSeries(Ke(n, e.seriesConfigs.length)),
2935
+ (e, n) => e.registerSeries(Ue(n, e.seriesConfigs.length)),
2906
2936
  (e, n) => e.unregisterSeries(n.group, n.index),
2907
2937
  (e, n) => {
2908
2938
  const o = e.seriesConfigs.findIndex((s) => s.group === n.group && s.index === n.index);
2909
- e.updateSeries(Ke(n, o >= 0 ? o : e.seriesConfigs.length));
2939
+ e.updateSeries(Ue(n, o >= 0 ? o : e.seriesConfigs.length));
2910
2940
  }
2911
2941
  ), null;
2912
2942
  }
2913
2943
  function ks(t) {
2914
- return { ...t, side: t.side ?? (t.scale === "x" ? U.Bottom : U.Left), show: t.show ?? !0 };
2944
+ return { ...t, side: t.side ?? (t.scale === "x" ? N.Bottom : N.Left), show: t.show ?? !0 };
2915
2945
  }
2916
- function Yt(t) {
2946
+ function Ut(t) {
2917
2947
  const e = ks(t);
2918
- return Se(
2948
+ return ve(
2919
2949
  e,
2920
2950
  [e.scale, e.side],
2921
2951
  (n, o) => n.registerAxis(o),
@@ -2924,8 +2954,8 @@ function Yt(t) {
2924
2954
  ), null;
2925
2955
  }
2926
2956
  function pi({ series: t, group: e, fill: n, dir: o }) {
2927
- const s = st(), r = N(null), i = t[0], l = t[1];
2928
- return Z(() => {
2957
+ const s = st(), r = Y(null), i = t[0], l = t[1];
2958
+ return rt(() => {
2929
2959
  const c = { series: [i, l], group: e, fill: n, dir: o };
2930
2960
  return r.current != null && s.unregisterBand(r.current), r.current = c, s.registerBand(c), s.scheduleRedraw(), () => {
2931
2961
  r.current != null && s.unregisterBand(r.current), r.current = null, s.scheduleRedraw();
@@ -2945,7 +2975,7 @@ const Ts = {
2945
2975
  cursor: "pointer",
2946
2976
  fontSize: 12,
2947
2977
  fontFamily: "sans-serif"
2948
- }, Is = { ...Sn, opacity: 1 }, Ls = { ...Sn, opacity: 0.4 }, Oe = /* @__PURE__ */ new Map(), Ps = {
2978
+ }, Is = { ...Sn, opacity: 1 }, Ps = { ...Sn, opacity: 0.4 }, Ke = /* @__PURE__ */ new Map(), Ls = {
2949
2979
  display: "flex",
2950
2980
  flexWrap: "wrap",
2951
2981
  justifyContent: "center",
@@ -2959,29 +2989,29 @@ const Ts = {
2959
2989
  padding: "4px 0"
2960
2990
  };
2961
2991
  function Ds({ group: t, index: e, label: n, color: o, isHidden: s, valueStr: r, store: i }) {
2962
- let l = Oe.get(o);
2963
- return l == null && (l = { ...Ts, backgroundColor: o }, Oe.set(o, l)), /* @__PURE__ */ ft(
2992
+ let l = Ke.get(o);
2993
+ return l == null && (l = { ...Ts, backgroundColor: o }, Ke.set(o, l)), /* @__PURE__ */ dt(
2964
2994
  "span",
2965
2995
  {
2966
2996
  onClick: () => i.toggleSeries(t, e),
2967
- style: s ? Ls : Is,
2997
+ style: s ? Ps : Is,
2968
2998
  children: [
2969
- /* @__PURE__ */ B("span", { style: l }),
2970
- /* @__PURE__ */ B("span", { children: n }),
2971
- r && /* @__PURE__ */ B("span", { style: As, children: r })
2999
+ /* @__PURE__ */ V("span", { style: l }),
3000
+ /* @__PURE__ */ V("span", { children: n }),
3001
+ r && /* @__PURE__ */ V("span", { style: As, children: r })
2972
3002
  ]
2973
3003
  }
2974
3004
  );
2975
3005
  }
2976
3006
  function mi({ show: t = !0, position: e = "bottom", className: n }) {
2977
- const o = st(), s = Wt(o.subscribeCursor, o.getSnapshot);
3007
+ const o = st(), s = Gt(o.subscribeCursor, o.getSnapshot);
2978
3008
  if (!t) return null;
2979
3009
  const { activeGroup: r, activeDataIdx: i } = s;
2980
- return /* @__PURE__ */ B(
3010
+ return /* @__PURE__ */ V(
2981
3011
  "div",
2982
3012
  {
2983
3013
  className: n,
2984
- style: e === "top" ? Ps : _s,
3014
+ style: e === "top" ? Ls : _s,
2985
3015
  children: o.seriesConfigs.map((l) => {
2986
3016
  if (l.legend === !1) return null;
2987
3017
  const c = typeof l.stroke == "string" ? l.stroke : "#000";
@@ -2990,7 +3020,7 @@ function mi({ show: t = !0, position: e = "bottom", className: n }) {
2990
3020
  const d = o.dataStore.getYValues(l.group, l.index)[i];
2991
3021
  d != null && (f = typeof d == "number" ? d.toPrecision(4) : String(d));
2992
3022
  }
2993
- return /* @__PURE__ */ B(
3023
+ return /* @__PURE__ */ V(
2994
3024
  Ds,
2995
3025
  {
2996
3026
  group: l.group,
@@ -3025,31 +3055,31 @@ const Es = {
3025
3055
  borderRadius: 1,
3026
3056
  display: "inline-block",
3027
3057
  flexShrink: 0
3028
- }, zs = { fontWeight: 600 }, Zt = {
3058
+ }, zs = { fontWeight: 600 }, Jt = {
3029
3059
  display: "flex",
3030
3060
  alignItems: "center",
3031
3061
  gap: 4,
3032
3062
  padding: "1px 4px"
3033
- }, Hs = { ...Zt, opacity: 1, cursor: "pointer" }, $s = { ...Zt, opacity: 1, cursor: "default" }, Ws = { ...Zt, opacity: 0.4, cursor: "pointer" }, Gs = { ...Zt, opacity: 0.4, cursor: "default" }, je = /* @__PURE__ */ new Map();
3034
- function Rs(t) {
3035
- let e = je.get(t);
3036
- return e == null && (e = { ...Fs, backgroundColor: t }, je.set(t, e)), e;
3063
+ }, Hs = { ...Jt, opacity: 1, cursor: "pointer" }, $s = { ...Jt, opacity: 1, cursor: "default" }, Ws = { ...Jt, opacity: 0.4, cursor: "pointer" }, Rs = { ...Jt, opacity: 0.4, cursor: "default" }, Oe = /* @__PURE__ */ new Map();
3064
+ function Gs(t) {
3065
+ let e = Oe.get(t);
3066
+ return e == null && (e = { ...Fs, backgroundColor: t }, Oe.set(t, e)), e;
3037
3067
  }
3038
- function be({
3068
+ function Se({
3039
3069
  label: t,
3040
3070
  color: e,
3041
3071
  value: n,
3042
3072
  isHidden: o,
3043
3073
  onClick: s
3044
3074
  }) {
3045
- return /* @__PURE__ */ ft("div", { onClick: s, style: o ? s ? Ws : Gs : s ? Hs : $s, children: [
3046
- /* @__PURE__ */ B("span", { style: Rs(e) }),
3047
- /* @__PURE__ */ B("span", { children: t }),
3048
- n && /* @__PURE__ */ B("span", { style: zs, children: n })
3075
+ return /* @__PURE__ */ dt("div", { onClick: s, style: o ? s ? Ws : Rs : s ? Hs : $s, children: [
3076
+ /* @__PURE__ */ V("span", { style: Gs(e) }),
3077
+ /* @__PURE__ */ V("span", { children: t }),
3078
+ n && /* @__PURE__ */ V("span", { style: zs, children: n })
3049
3079
  ] });
3050
3080
  }
3051
- const Nt = In(function({ left: e, top: n, children: o, className: s, style: r, onMouseDown: i, onMouseEnter: l, onMouseLeave: c }, f) {
3052
- return /* @__PURE__ */ B(
3081
+ const Kt = In(function({ left: e, top: n, children: o, className: s, style: r, onMouseDown: i, onMouseEnter: l, onMouseLeave: c }, f) {
3082
+ return /* @__PURE__ */ V(
3053
3083
  "div",
3054
3084
  {
3055
3085
  ref: f,
@@ -3062,62 +3092,67 @@ const Nt = In(function({ left: e, top: n, children: o, className: s, style: r, o
3062
3092
  }
3063
3093
  );
3064
3094
  });
3065
- function Vs(t, e, n, o, s) {
3095
+ function Bs(t, e, n, o, s) {
3066
3096
  if (s < 0 || o < 0) return "";
3067
3097
  const i = t.dataStore.getYValues(e, n)[s];
3068
3098
  return i == null ? "" : typeof i == "number" ? i.toPrecision(4) : String(i);
3069
3099
  }
3070
- const Bs = {}, Xs = { pointerEvents: "none", zIndex: 100 }, Ys = { fontWeight: 600, marginBottom: 2, padding: "0 4px" };
3100
+ const Vs = {}, Xs = { pointerEvents: "none", zIndex: 100 }, Ys = { fontWeight: 600, marginBottom: 2, padding: "0 4px" };
3071
3101
  function wi({
3072
3102
  show: t = !0,
3073
3103
  className: e,
3074
3104
  children: n,
3075
- offset: o = Bs
3105
+ offset: o = Vs,
3106
+ precision: s = 2
3076
3107
  }) {
3077
- var A, L;
3078
- const s = st(), r = Wt(s.subscribeCursor, s.getSnapshot), i = N(null);
3079
- if (!t || r.activeDataIdx < 0 || r.activeGroup < 0 || r.left < 0) return null;
3080
- const { activeGroup: l, activeDataIdx: c } = r, f = s.plotBox, a = s.dataStore.data[l], d = a != null ? a.x[c] ?? null : null, u = d != null ? parseFloat(d.toPrecision(6)).toString() : "", h = [];
3081
- for (const k of s.seriesConfigs) {
3082
- if (k.show === !1 || k.legend === !1) continue;
3083
- const E = s.dataStore.getYValues(k.group, k.index), P = k.group === l ? E[c] : null;
3084
- h.push({
3085
- label: k.label ?? `Series ${k.index}`,
3086
- value: P,
3087
- color: typeof k.stroke == "string" ? k.stroke : "#000",
3088
- group: k.group,
3089
- index: k.index
3108
+ const r = st(), i = Gt(r.subscribeCursor, r.getSnapshot), l = Y(null), [c, f] = ut({ w: 0, h: 0 });
3109
+ if (j(() => {
3110
+ const I = l.current;
3111
+ if (!I) return;
3112
+ const C = I.offsetWidth, E = I.offsetHeight;
3113
+ (C !== c.w || E !== c.h) && f({ w: C, h: E });
3114
+ }), !t || i.activeDataIdx < 0 || i.activeGroup < 0 || i.left < 0) return null;
3115
+ const { activeGroup: a, activeDataIdx: d } = i, u = r.plotBox, h = r.dataStore.data[a], g = h != null ? h.x[d] ?? null : null, w = g != null ? parseFloat(g.toFixed(s)).toString() : "", S = [];
3116
+ for (const I of r.seriesConfigs) {
3117
+ if (I.show === !1 || I.legend === !1) continue;
3118
+ const C = r.dataStore.getYValues(I.group, I.index), E = I.group === a ? C[d] : null;
3119
+ S.push({
3120
+ label: I.label ?? `Series ${I.index}`,
3121
+ value: E,
3122
+ color: typeof I.stroke == "string" ? I.stroke : "#000",
3123
+ group: I.group,
3124
+ index: I.index
3090
3125
  });
3091
3126
  }
3092
- const p = {
3093
- x: d,
3094
- xLabel: u,
3095
- items: h,
3096
- left: r.left + f.left,
3097
- top: r.top + f.top
3098
- }, w = o.x ?? 12, b = o.y ?? -12, g = ((A = i.current) == null ? void 0 : A.offsetWidth) ?? 0, m = ((L = i.current) == null ? void 0 : L.offsetHeight) ?? 0, M = r.left + f.left, v = r.top + f.top, D = f.left + f.width, T = f.top + f.height, y = tt(M + w, f.left, D - g), x = tt(v + b, f.top, T - m);
3099
- return n ? /* @__PURE__ */ B(
3127
+ const b = {
3128
+ x: g,
3129
+ xLabel: w,
3130
+ items: S,
3131
+ left: i.left + u.left,
3132
+ top: i.top + u.top
3133
+ }, M = o.x ?? 12, p = o.y ?? -12, m = c.w, T = c.h, A = i.left + u.left, y = i.top + u.top, x = u.left + u.width, P = u.top + u.height, L = tt(A + M, u.left, x - m), F = tt(y + p, u.top, P - T);
3134
+ return n ? /* @__PURE__ */ V(
3100
3135
  "div",
3101
3136
  {
3102
- ref: i,
3137
+ ref: l,
3103
3138
  className: e,
3104
- style: { position: "absolute", left: y, top: x, whiteSpace: "nowrap", pointerEvents: "none", zIndex: 100 },
3105
- children: n(p)
3139
+ style: { position: "absolute", left: L, top: F, whiteSpace: "nowrap", pointerEvents: "none", zIndex: 100 },
3140
+ children: n(b)
3106
3141
  }
3107
- ) : /* @__PURE__ */ ft(Nt, { ref: i, left: y, top: x, className: e, style: Xs, children: [
3108
- /* @__PURE__ */ B("div", { style: Ys, children: u }),
3109
- h.map((k) => /* @__PURE__ */ B(
3110
- be,
3142
+ ) : /* @__PURE__ */ dt(Kt, { ref: l, left: L, top: F, className: e, style: Xs, children: [
3143
+ /* @__PURE__ */ V("div", { style: Ys, children: w }),
3144
+ S.map((I) => /* @__PURE__ */ V(
3145
+ Se,
3111
3146
  {
3112
- label: k.label,
3113
- color: k.color,
3114
- value: k.value != null ? k.value.toPrecision(4) : "—"
3147
+ label: I.label,
3148
+ color: I.color,
3149
+ value: I.value != null ? I.value.toPrecision(4) : "—"
3115
3150
  },
3116
- `${k.group}:${k.index}`
3151
+ `${I.group}:${I.index}`
3117
3152
  ))
3118
3153
  ] });
3119
3154
  }
3120
- const Ns = 8, qe = 0.01, Us = [0.25, 0.75];
3155
+ const Ns = 8, je = 0.01, Us = [0.25, 0.75];
3121
3156
  function vi({
3122
3157
  width: t,
3123
3158
  height: e,
@@ -3128,76 +3163,77 @@ function vi({
3128
3163
  colors: i,
3129
3164
  grips: l = !1
3130
3165
  }) {
3131
- const c = N(null), f = Ln(() => de(n), [n]), [a, d] = Mt(() => {
3166
+ const c = Y(null), f = Pn(() => pn(n), [n]), [a, d] = ut(() => {
3132
3167
  if (s != null && f.length > 0) {
3133
- const T = f[0];
3134
- if (T != null && T.x.length > 1) {
3135
- const y = T.x[0], A = T.x[T.x.length - 1] - y;
3136
- if (A > 0)
3168
+ const A = f[0];
3169
+ if (A != null && A.x.length > 1) {
3170
+ const y = A.x[0], P = A.x[A.x.length - 1] - y;
3171
+ if (P > 0)
3137
3172
  return [
3138
- Math.max(0, (s[0] - y) / A),
3139
- Math.min(1, (s[1] - y) / A)
3173
+ Math.max(0, (s[0] - y) / P),
3174
+ Math.min(1, (s[1] - y) / P)
3140
3175
  ];
3141
3176
  }
3142
3177
  }
3143
3178
  return Us;
3144
- }), u = N(null);
3145
- Z(() => {
3179
+ }), u = Y(null);
3180
+ rt(() => {
3146
3181
  if (o == null || f.length === 0) return;
3147
- const T = f[0];
3148
- if (T == null || T.x.length < 2) return;
3149
- const y = T.x[0], A = T.x[T.x.length - 1] - y, L = y + a[0] * A, k = y + a[1] * A, E = u.current, P = Math.max(1e-10, Math.abs(k - L) * 1e-12);
3150
- E != null && Math.abs(E[0] - L) < P && Math.abs(E[1] - k) < P || (u.current = [L, k], o(L, k));
3182
+ const A = f[0];
3183
+ if (A == null || A.x.length < 2) return;
3184
+ const y = A.x[0], P = A.x[A.x.length - 1] - y, L = y + a[0] * P, F = y + a[1] * P, I = u.current, C = Math.max(1e-10, Math.abs(F - L) * 1e-12);
3185
+ I != null && Math.abs(I[0] - L) < C && Math.abs(I[1] - F) < C || (u.current = [L, F], o(L, F));
3151
3186
  }, [a, f, o]);
3152
- const h = N(null), p = Gt((T) => {
3187
+ const h = Y(null), g = Lt((A) => {
3153
3188
  const y = c.current;
3154
3189
  if (y == null) return 0;
3155
3190
  const x = y.getBoundingClientRect();
3156
- return tt((T - x.left) / x.width, 0, 1);
3157
- }, []), w = Gt((T) => {
3191
+ return tt((A - x.left) / x.width, 0, 1);
3192
+ }, []), w = Lt((A) => {
3158
3193
  const y = c.current;
3159
3194
  if (y == null) return;
3160
- const x = p(T.clientX), A = y.getBoundingClientRect().width, L = A > 0 ? Ns / A : 0;
3161
- let k;
3195
+ const x = g(A.clientX), P = y.getBoundingClientRect().width, L = P > 0 ? Ns / P : 0;
3196
+ let F;
3162
3197
  if (Math.abs(x - a[0]) < L)
3163
- k = "left";
3198
+ F = "left";
3164
3199
  else if (Math.abs(x - a[1]) < L)
3165
- k = "right";
3200
+ F = "right";
3166
3201
  else if (x >= a[0] && x <= a[1])
3167
- k = "move";
3202
+ F = "move";
3168
3203
  else {
3169
- const E = a[1] - a[0], P = E / 2, F = tt(x - P, 0, 1 - E);
3170
- d([F, F + E]), k = "move";
3204
+ const I = a[1] - a[0], C = I / 2, E = tt(x - C, 0, 1 - I), H = [E, E + I];
3205
+ d(H), h.current = { mode: "move", startX: A.clientX, startFrac: H }, y.setPointerCapture(A.pointerId), A.preventDefault();
3206
+ return;
3171
3207
  }
3172
3208
  h.current = {
3173
- mode: k,
3174
- startX: T.clientX,
3209
+ mode: F,
3210
+ startX: A.clientX,
3175
3211
  startFrac: [...a]
3176
- }, y.setPointerCapture(T.pointerId), T.preventDefault();
3177
- }, [a, p]), b = Gt((T) => {
3212
+ }, y.setPointerCapture(A.pointerId), A.preventDefault();
3213
+ }, [a, g]), S = Lt((A) => {
3178
3214
  const y = h.current;
3179
3215
  if (y == null) return;
3180
- const x = p(T.clientX), A = p(y.startX), L = x - A;
3216
+ const x = g(A.clientX), P = g(y.startX), L = x - P;
3181
3217
  if (y.mode === "move") {
3182
- const k = y.startFrac[1] - y.startFrac[0], E = tt(y.startFrac[0] + L, 0, 1 - k);
3183
- d([E, E + k]);
3218
+ const F = y.startFrac[1] - y.startFrac[0], I = tt(y.startFrac[0] + L, 0, 1 - F);
3219
+ d([I, I + F]);
3184
3220
  } else if (y.mode === "left") {
3185
- const k = tt(y.startFrac[0] + L, 0, y.startFrac[1] - qe);
3186
- d([k, y.startFrac[1]]);
3221
+ const F = tt(y.startFrac[0] + L, 0, y.startFrac[1] - je);
3222
+ d([F, y.startFrac[1]]);
3187
3223
  } else {
3188
- const k = tt(y.startFrac[1] + L, y.startFrac[0] + qe, 1);
3189
- d([y.startFrac[0], k]);
3224
+ const F = tt(y.startFrac[1] + L, y.startFrac[0] + je, 1);
3225
+ d([y.startFrac[0], F]);
3190
3226
  }
3191
- }, [p]), g = Gt((T) => {
3227
+ }, [g]), b = Lt((A) => {
3192
3228
  h.current = null;
3193
3229
  const y = c.current;
3194
- y != null && y.releasePointerCapture(T.pointerId);
3195
- }, []), m = `${a[0] * 100}%`, M = `${(a[1] - a[0]) * 100}%`, v = f[0], D = v != null ? v.series.length : 0;
3196
- return /* @__PURE__ */ ft("div", { className: r, style: { position: "relative", width: t, height: e }, children: [
3197
- /* @__PURE__ */ ft(mn, { width: t, height: e, data: n, children: [
3198
- /* @__PURE__ */ B(Yt, { scale: "x", show: !1 }),
3199
- /* @__PURE__ */ B(Yt, { scale: "y", show: !1 }),
3200
- Array.from({ length: D }, (T, y) => /* @__PURE__ */ B(
3230
+ y != null && y.releasePointerCapture(A.pointerId);
3231
+ }, []), M = `${a[0] * 100}%`, p = `${(a[1] - a[0]) * 100}%`, m = f[0], T = m != null ? m.series.length : 0;
3232
+ return /* @__PURE__ */ dt("div", { className: r, style: { position: "relative", width: t, height: e }, children: [
3233
+ /* @__PURE__ */ dt(mn, { width: t, height: e, data: n, children: [
3234
+ /* @__PURE__ */ V(Ut, { scale: "x", show: !1 }),
3235
+ /* @__PURE__ */ V(Ut, { scale: "y", show: !1 }),
3236
+ Array.from({ length: T }, (A, y) => /* @__PURE__ */ V(
3201
3237
  vn,
3202
3238
  {
3203
3239
  group: 0,
@@ -3209,13 +3245,13 @@ function vi({
3209
3245
  `0:${y}`
3210
3246
  ))
3211
3247
  ] }),
3212
- /* @__PURE__ */ ft(
3248
+ /* @__PURE__ */ dt(
3213
3249
  "div",
3214
3250
  {
3215
3251
  ref: c,
3216
3252
  onPointerDown: w,
3217
- onPointerMove: b,
3218
- onPointerUp: g,
3253
+ onPointerMove: S,
3254
+ onPointerUp: b,
3219
3255
  style: {
3220
3256
  position: "absolute",
3221
3257
  top: 0,
@@ -3226,21 +3262,21 @@ function vi({
3226
3262
  touchAction: "none"
3227
3263
  },
3228
3264
  children: [
3229
- /* @__PURE__ */ B(
3265
+ /* @__PURE__ */ V(
3230
3266
  "div",
3231
3267
  {
3232
3268
  style: {
3233
3269
  position: "absolute",
3234
3270
  top: 0,
3235
3271
  left: 0,
3236
- width: m,
3272
+ width: M,
3237
3273
  height: "100%",
3238
3274
  background: "rgba(0,0,0,0.3)",
3239
3275
  pointerEvents: "none"
3240
3276
  }
3241
3277
  }
3242
3278
  ),
3243
- /* @__PURE__ */ B(
3279
+ /* @__PURE__ */ V(
3244
3280
  "div",
3245
3281
  {
3246
3282
  style: {
@@ -3254,14 +3290,14 @@ function vi({
3254
3290
  }
3255
3291
  }
3256
3292
  ),
3257
- /* @__PURE__ */ B(
3293
+ /* @__PURE__ */ V(
3258
3294
  "div",
3259
3295
  {
3260
3296
  style: {
3261
3297
  position: "absolute",
3262
3298
  top: 0,
3263
- left: m,
3264
- width: M,
3299
+ left: M,
3300
+ width: p,
3265
3301
  height: "100%",
3266
3302
  borderLeft: "2px solid rgba(0,100,255,0.8)",
3267
3303
  borderRight: "2px solid rgba(0,100,255,0.8)",
@@ -3269,8 +3305,8 @@ function vi({
3269
3305
  cursor: "grab",
3270
3306
  pointerEvents: "none"
3271
3307
  },
3272
- children: l && /* @__PURE__ */ ft(kn, { children: [
3273
- /* @__PURE__ */ B("div", { style: {
3308
+ children: l && /* @__PURE__ */ dt(kn, { children: [
3309
+ /* @__PURE__ */ V("div", { style: {
3274
3310
  position: "absolute",
3275
3311
  left: -5,
3276
3312
  top: "50%",
@@ -3282,7 +3318,7 @@ function vi({
3282
3318
  cursor: "ew-resize",
3283
3319
  pointerEvents: "auto"
3284
3320
  } }),
3285
- /* @__PURE__ */ B("div", { style: {
3321
+ /* @__PURE__ */ V("div", { style: {
3286
3322
  position: "absolute",
3287
3323
  right: -5,
3288
3324
  top: "50%",
@@ -3302,18 +3338,24 @@ function vi({
3302
3338
  )
3303
3339
  ] });
3304
3340
  }
3305
- function kt(t) {
3306
- const e = st(), n = N(t);
3307
- n.current = t, Z(() => {
3308
- const o = (s) => n.current(s);
3309
- return e.drawHooks.add(o), () => {
3310
- e.drawHooks.delete(o);
3341
+ function Tt(t, e) {
3342
+ const n = st(), o = Y(t);
3343
+ j(() => {
3344
+ o.current = t;
3345
+ });
3346
+ const s = (e == null ? void 0 : e.clipped) !== !1;
3347
+ j(() => {
3348
+ const r = (l) => o.current(l), i = s ? n.drawHooks : n.unclippedDrawHooks;
3349
+ return i.add(r), () => {
3350
+ i.delete(r);
3311
3351
  };
3312
- }, [e]);
3352
+ }, [n, s]);
3313
3353
  }
3314
3354
  function Si(t) {
3315
- const e = st(), n = N(t);
3316
- n.current = t, Z(() => {
3355
+ const e = st(), n = Y(t);
3356
+ j(() => {
3357
+ n.current = t;
3358
+ }), j(() => {
3317
3359
  const o = (s, r) => n.current(s, r);
3318
3360
  return e.cursorDrawHooks.add(o), () => {
3319
3361
  e.cursorDrawHooks.delete(o);
@@ -3327,28 +3369,35 @@ function bi({
3327
3369
  scaleId: o = "x"
3328
3370
  }) {
3329
3371
  const s = st();
3330
- return kt(({ ctx: r, plotBox: i, pxRatio: l }) => {
3372
+ return Tt(({ ctx: r, plotBox: i, pxRatio: l }) => {
3331
3373
  const c = s.scaleManager.getScale(o);
3332
3374
  if (c == null || !K(c)) return;
3333
- r.save(), r.beginPath(), r.rect(
3375
+ r.save();
3376
+ const f = (e + n) * l, a = e * l, d = i.top * l;
3377
+ r.fillStyle = "#666", r.font = `${11 * l}px sans-serif`, r.textAlign = "right", r.textBaseline = "middle";
3378
+ for (let u = 0; u < t.length; u++) {
3379
+ const h = t[u];
3380
+ if (h == null) continue;
3381
+ const g = d + u * f;
3382
+ r.fillText(h.label, (i.left - 6) * l, g + a / 2);
3383
+ }
3384
+ r.beginPath(), r.rect(
3334
3385
  i.left * l,
3335
3386
  i.top * l,
3336
3387
  i.width * l,
3337
3388
  i.height * l
3338
3389
  ), r.clip();
3339
- const f = (e + n) * l, a = e * l, d = i.top * l;
3340
3390
  for (let u = 0; u < t.length; u++) {
3341
3391
  const h = t[u];
3342
3392
  if (h == null) continue;
3343
- const p = d + u * f;
3344
- r.fillStyle = "#666", r.font = `${11 * l}px sans-serif`, r.textAlign = "right", r.textBaseline = "middle", r.fillText(h.label, (i.left - 6) * l, p + a / 2);
3393
+ const g = d + u * f;
3345
3394
  for (const w of h.segments) {
3346
- const b = V(w.start, c, i.width, i.left) * l, m = V(w.end, c, i.width, i.left) * l - b;
3347
- m <= 0 || (r.fillStyle = w.color ?? "#4dabf7", r.fillRect(b, p, m, a), w.label != null && m > 20 * l && (r.fillStyle = "#fff", r.font = `${10 * l}px sans-serif`, r.textAlign = "center", r.textBaseline = "middle", r.fillText(w.label, b + m / 2, p + a / 2, m - 4 * l)));
3395
+ const S = B(w.start, c, i.width, i.left) * l, M = B(w.end, c, i.width, i.left) * l - S;
3396
+ M <= 0 || (r.fillStyle = w.color ?? "#4dabf7", r.fillRect(S, g, M, a), w.label != null && M > 20 * l && (r.fillStyle = "#fff", r.font = `${10 * l}px sans-serif`, r.textAlign = "center", r.textBaseline = "middle", r.fillText(w.label, S + M / 2, g + a / 2, M - 4 * l)));
3348
3397
  }
3349
3398
  }
3350
3399
  r.restore();
3351
- }), null;
3400
+ }, { clipped: !1 }), null;
3352
3401
  }
3353
3402
  function Mi({
3354
3403
  data: t,
@@ -3361,10 +3410,10 @@ function Mi({
3361
3410
  fillTo: l,
3362
3411
  className: c
3363
3412
  }) {
3364
- return /* @__PURE__ */ B("div", { style: { pointerEvents: "none" }, className: c, children: /* @__PURE__ */ ft(mn, { width: e, height: n, data: t, children: [
3365
- /* @__PURE__ */ B(Yt, { scale: "x", show: !1 }),
3366
- /* @__PURE__ */ B(Yt, { scale: "y", show: !1 }),
3367
- /* @__PURE__ */ B(
3413
+ return /* @__PURE__ */ V("div", { style: { pointerEvents: "none" }, className: c, children: /* @__PURE__ */ dt(mn, { width: e, height: n, data: t, children: [
3414
+ /* @__PURE__ */ V(Ut, { scale: "x", show: !1 }),
3415
+ /* @__PURE__ */ V(Ut, { scale: "y", show: !1 }),
3416
+ /* @__PURE__ */ V(
3368
3417
  vn,
3369
3418
  {
3370
3419
  group: 0,
@@ -3379,19 +3428,19 @@ function Mi({
3379
3428
  )
3380
3429
  ] }) });
3381
3430
  }
3382
- const pt = 8, Ks = { x: 12, y: -12 }, Os = { pointerEvents: "none" };
3431
+ const wt = 8, Ks = { x: 12, y: -12 }, Os = { pointerEvents: "none" };
3383
3432
  function js(t, e, n, o) {
3384
3433
  if (t != null && typeof t == "object") return t;
3385
3434
  switch (t) {
3386
3435
  case "top-left":
3387
- return { x: e.left + pt, y: e.top + pt };
3436
+ return { x: e.left + wt, y: e.top + wt };
3388
3437
  case "bottom-left":
3389
- return { x: e.left + pt, y: e.top + e.height - o - pt };
3438
+ return { x: e.left + wt, y: e.top + e.height - o - wt };
3390
3439
  case "bottom-right":
3391
- return { x: e.left + e.width - n - pt, y: e.top + e.height - o - pt };
3440
+ return { x: e.left + e.width - n - wt, y: e.top + e.height - o - wt };
3392
3441
  case "top-right":
3393
3442
  default:
3394
- return { x: e.left + e.width - n - pt, y: e.top + pt };
3443
+ return { x: e.left + e.width - n - wt, y: e.top + wt };
3395
3444
  }
3396
3445
  }
3397
3446
  function yi({
@@ -3402,66 +3451,71 @@ function yi({
3402
3451
  show: s = !0,
3403
3452
  className: r
3404
3453
  }) {
3405
- var k, E;
3406
- const i = st(), l = Wt(i.subscribeCursor, i.getSnapshot), [c, f] = Mt(null), [a, d] = Mt(!1), [u, h] = Mt(!1), p = N(!1), w = N(!1), b = N({ dx: 0, dy: 0 }), [g, m] = Mt(!1), M = N(null);
3407
- Ut(() => {
3408
- if (t !== "draggable" || g || l.plotWidth <= 0) return;
3409
- m(!0);
3410
- const P = M.current, F = (P == null ? void 0 : P.offsetWidth) ?? 0, $ = (P == null ? void 0 : P.offsetHeight) ?? 0;
3411
- f(js(e, i.plotBox, F, $));
3412
- }, [t, g, l.plotWidth, e, i.plotBox]);
3413
- const v = (P, F) => {
3414
- w.current || i.toggleSeries(P, F);
3415
- }, D = (P) => {
3454
+ const i = st(), l = Gt(i.subscribeCursor, i.getSnapshot), [c, f] = ut(null), [a, d] = ut(!1), [u, h] = ut(!1), g = Y(!1), w = Y(!1), S = Y({ dx: 0, dy: 0 }), [b, M] = ut(!1), p = Y(null), [m, T] = ut({ w: 0, h: 0 });
3455
+ j(() => {
3456
+ if (t !== "cursor") return;
3457
+ const C = p.current;
3458
+ if (!C) return;
3459
+ const E = C.offsetWidth, H = C.offsetHeight;
3460
+ (E !== m.w || H !== m.h) && T({ w: E, h: H });
3461
+ }), j(() => {
3462
+ if (t !== "draggable" || b || l.plotWidth <= 0) return;
3463
+ M(!0);
3464
+ const C = p.current, E = (C == null ? void 0 : C.offsetWidth) ?? 0, H = (C == null ? void 0 : C.offsetHeight) ?? 0;
3465
+ f(js(e, i.plotBox, E, H));
3466
+ }, [t, b, l.plotWidth, e, i.plotBox]);
3467
+ const A = (C, E) => {
3468
+ w.current || i.toggleSeries(C, E);
3469
+ }, y = (C) => {
3416
3470
  if (t !== "draggable") return;
3417
- P.stopPropagation(), P.preventDefault(), p.current = !0, h(!0), w.current = !1;
3418
- const F = P.currentTarget.getBoundingClientRect();
3419
- b.current = { dx: P.clientX - F.left, dy: P.clientY - F.top };
3471
+ C.stopPropagation(), C.preventDefault(), g.current = !0, h(!0), w.current = !1;
3472
+ const E = C.currentTarget.getBoundingClientRect();
3473
+ S.current = { dx: C.clientX - E.left, dy: C.clientY - E.top };
3420
3474
  };
3421
- if (Z(() => {
3475
+ if (rt(() => {
3422
3476
  if (!s || t !== "draggable") return;
3423
- const P = ($) => {
3477
+ const C = (H) => {
3424
3478
  var _;
3425
- if (!p.current) return;
3479
+ if (!g.current) return;
3426
3480
  w.current = !0;
3427
- const S = (_ = i.canvas) == null ? void 0 : _.parentElement;
3428
- if (!S) return;
3429
- const C = S.getBoundingClientRect();
3430
- f({ x: $.clientX - C.left - b.current.dx, y: $.clientY - C.top - b.current.dy });
3431
- }, F = () => {
3432
- p.current = !1, h(!1);
3481
+ const v = (_ = i.canvas) == null ? void 0 : _.parentElement;
3482
+ if (!v) return;
3483
+ const k = v.getBoundingClientRect();
3484
+ f({ x: H.clientX - k.left - S.current.dx, y: H.clientY - k.top - S.current.dy });
3485
+ }, E = () => {
3486
+ g.current = !1, h(!1);
3433
3487
  };
3434
- return window.addEventListener("mousemove", P), window.addEventListener("mouseup", F), () => {
3435
- window.removeEventListener("mousemove", P), window.removeEventListener("mouseup", F);
3488
+ return window.addEventListener("mousemove", C), window.addEventListener("mouseup", E), () => {
3489
+ window.removeEventListener("mousemove", C), window.removeEventListener("mouseup", E);
3436
3490
  };
3437
3491
  }, [i, s, t]), !s) return null;
3438
- const { activeGroup: T, activeDataIdx: y, left: x, top: A } = l, L = i.seriesConfigs.filter((P) => P.legend !== !1).map((P) => {
3439
- const F = typeof P.stroke == "string" ? P.stroke : "#000", $ = Vs(i, P.group, P.index, T, y), S = t === "draggable";
3440
- return /* @__PURE__ */ B(
3441
- be,
3492
+ const { activeGroup: x, activeDataIdx: P, left: L, top: F } = l, I = i.seriesConfigs.filter((C) => C.legend !== !1).map((C) => {
3493
+ const E = typeof C.stroke == "string" ? C.stroke : "#000", H = Bs(i, C.group, C.index, x, P), v = t === "draggable";
3494
+ return /* @__PURE__ */ V(
3495
+ Se,
3442
3496
  {
3443
- label: P.label ?? `Series ${P.index}`,
3444
- color: F,
3445
- value: $,
3446
- isHidden: P.show === !1,
3447
- onClick: S ? () => v(P.group, P.index) : void 0
3497
+ label: C.label ?? `Series ${C.index}`,
3498
+ color: E,
3499
+ value: H,
3500
+ isHidden: C.show === !1,
3501
+ onClick: v ? () => A(C.group, C.index) : void 0
3448
3502
  },
3449
- `${P.group}:${P.index}`
3503
+ `${C.group}:${C.index}`
3450
3504
  );
3451
3505
  });
3452
3506
  if (t === "cursor") {
3453
- if (x < 0) return null;
3454
- const P = ((k = M.current) == null ? void 0 : k.offsetWidth) ?? 0, F = ((E = M.current) == null ? void 0 : E.offsetHeight) ?? 0, $ = l.plotLeft + l.plotWidth, S = l.plotTop + l.plotHeight, C = tt(x + l.plotLeft + n.x, l.plotLeft, $ - P), _ = tt(A + l.plotTop + n.y, l.plotTop, S - F);
3455
- return /* @__PURE__ */ B(Nt, { ref: M, left: C, top: _, className: r, style: Os, children: L });
3507
+ if (L < 0) return null;
3508
+ const C = m.w, E = m.h, H = l.plotLeft + l.plotWidth, v = l.plotTop + l.plotHeight, k = tt(L + l.plotLeft + n.x, l.plotLeft, H - C), _ = tt(F + l.plotTop + n.y, l.plotTop, v - E);
3509
+ return /* @__PURE__ */ V(Kt, { ref: p, left: k, top: _, className: r, style: Os, children: I });
3456
3510
  }
3457
- return c == null ? null : /* @__PURE__ */ B(
3458
- Nt,
3511
+ return c == null ? null : /* @__PURE__ */ V(
3512
+ Kt,
3459
3513
  {
3460
- ref: M,
3514
+ ref: p,
3461
3515
  left: c.x,
3462
3516
  top: c.y,
3463
3517
  className: r,
3464
- onMouseDown: D,
3518
+ onMouseDown: y,
3465
3519
  onMouseEnter: () => d(!0),
3466
3520
  onMouseLeave: () => {
3467
3521
  d(!1), w.current = !1;
@@ -3472,7 +3526,7 @@ function yi({
3472
3526
  opacity: a || u ? 1 : o,
3473
3527
  transition: "opacity 0.2s ease"
3474
3528
  },
3475
- children: L
3529
+ children: I
3476
3530
  }
3477
3531
  );
3478
3532
  }
@@ -3482,20 +3536,24 @@ function xi({
3482
3536
  show: e = !0,
3483
3537
  className: n
3484
3538
  }) {
3485
- var m, M;
3486
- const o = st(), s = Wt(o.subscribe, o.getSnapshot), [r, i] = Mt(!1), l = N(-1), c = N(0), f = N(null);
3487
- if (Z(() => {
3488
- const v = s.activeSeriesIdx;
3489
- v !== l.current && (l.current = v, i(!1), window.clearTimeout(c.current), v >= 0 && (c.current = window.setTimeout(() => i(!0), t)));
3490
- }, [s.activeSeriesIdx, t]), Z(() => () => {
3539
+ const o = st(), s = Gt(o.subscribeCursor, o.getSnapshot), [r, i] = ut(!1), l = Y(-1), c = Y(0), f = Y(null), [a, d] = ut({ w: 0, h: 0 });
3540
+ if (j(() => {
3541
+ const m = f.current;
3542
+ if (!m) return;
3543
+ const T = m.offsetWidth, A = m.offsetHeight;
3544
+ (T !== a.w || A !== a.h) && d({ w: T, h: A });
3545
+ }), rt(() => {
3546
+ const m = s.activeSeriesIdx;
3547
+ m !== l.current && (l.current = m, i(!1), window.clearTimeout(c.current), m >= 0 && (c.current = window.setTimeout(() => i(!0), t)));
3548
+ }, [s.activeSeriesIdx, t]), rt(() => () => {
3491
3549
  window.clearTimeout(c.current);
3492
3550
  }, []), !e || !r || s.left < 0) return null;
3493
- const a = o.seriesConfigs.find(
3494
- (v) => v.group === s.activeGroup && v.index === s.activeSeriesIdx
3551
+ const u = o.seriesConfigs.find(
3552
+ (m) => m.group === s.activeGroup && m.index === s.activeSeriesIdx
3495
3553
  );
3496
- if (!(a != null && a.label) || a.legend === !1) return null;
3497
- const d = typeof a.stroke == "string" ? a.stroke : "#000", u = ((m = f.current) == null ? void 0 : m.offsetWidth) ?? 80, h = ((M = f.current) == null ? void 0 : M.offsetHeight) ?? 24, p = s.left + s.plotLeft, w = s.top + s.plotTop, b = tt(p - u / 2, s.plotLeft, s.plotLeft + s.plotWidth - u), g = tt(w - h - 12, s.plotTop, s.plotTop + s.plotHeight - h);
3498
- return /* @__PURE__ */ B(Nt, { ref: f, left: b, top: g, className: n, style: qs, children: /* @__PURE__ */ B(be, { label: a.label, color: d }) });
3554
+ if (!(u != null && u.label) || u.legend === !1) return null;
3555
+ const h = typeof u.stroke == "string" ? u.stroke : "#000", g = a.w, w = a.h, S = s.left + s.plotLeft, b = s.top + s.plotTop, M = tt(S - g / 2, s.plotLeft, s.plotLeft + s.plotWidth - g), p = tt(b - w - 12, s.plotTop, s.plotTop + s.plotHeight - w);
3556
+ return /* @__PURE__ */ V(Kt, { ref: f, left: M, top: p, className: n, style: qs, children: /* @__PURE__ */ V(Se, { label: u.label, color: h }) });
3499
3557
  }
3500
3558
  function bn(t, e, n, o, s, r, i, l, c) {
3501
3559
  const f = i / 2;
@@ -3515,13 +3573,13 @@ function Ci({
3515
3573
  medianColor: r = "#e74c3c",
3516
3574
  whiskerColor: i = "#555"
3517
3575
  }) {
3518
- return kt(({ ctx: l, plotBox: c, valToX: f, valToY: a }) => {
3576
+ return Tt(({ ctx: l, plotBox: c, valToX: f, valToY: a }) => {
3519
3577
  const d = c.width / t.length * n, u = d * 0.3;
3520
3578
  for (let h = 0; h < t.length; h++) {
3521
- const p = t[h];
3522
- if (p == null) continue;
3523
- const w = f(h + 1), b = a(p.min, e), g = a(p.q1, e), m = a(p.median, e), M = a(p.q3, e), v = a(p.max, e);
3524
- w == null || b == null || g == null || m == null || M == null || v == null || bn(l, w, b, v, g, M, d, m, {
3579
+ const g = t[h];
3580
+ if (g == null) continue;
3581
+ const w = f(h + 1), S = a(g.min, e), b = a(g.q1, e), M = a(g.median, e), p = a(g.q3, e), m = a(g.max, e);
3582
+ w == null || S == null || b == null || M == null || p == null || m == null || bn(l, w, S, m, b, p, d, M, {
3525
3583
  wickColor: i,
3526
3584
  bodyFill: o,
3527
3585
  bodyStroke: s,
@@ -3568,28 +3626,28 @@ function ki({
3568
3626
  colorMap: o = Zs,
3569
3627
  yScale: s = "y"
3570
3628
  }) {
3571
- return kt(({ ctx: r, valToX: i, valToY: l }) => {
3572
- var g;
3629
+ return Tt(({ ctx: r, valToX: i, valToY: l }) => {
3630
+ var b;
3573
3631
  if (t.length === 0) return;
3574
- const c = t.length, f = ((g = t[0]) == null ? void 0 : g.length) ?? 0;
3632
+ const c = t.length, f = ((b = t[0]) == null ? void 0 : b.length) ?? 0;
3575
3633
  if (f === 0) return;
3576
- const a = (e == null ? void 0 : e[0]) ?? 0, d = (e == null ? void 0 : e[1]) ?? c, u = (n == null ? void 0 : n[0]) ?? 0, h = (n == null ? void 0 : n[1]) ?? f, p = (d - a) / c, w = (h - u) / f;
3577
- let b = 0;
3578
- for (const m of t)
3579
- for (const M of m)
3580
- M > b && (b = M);
3581
- if (b !== 0)
3582
- for (let m = 0; m < c; m++) {
3583
- const M = t[m];
3584
- if (M == null) continue;
3585
- const v = i(a + m * p), D = i(a + (m + 1) * p);
3586
- if (v == null || D == null) continue;
3587
- const T = D - v;
3634
+ const a = (e == null ? void 0 : e[0]) ?? 0, d = (e == null ? void 0 : e[1]) ?? c, u = (n == null ? void 0 : n[0]) ?? 0, h = (n == null ? void 0 : n[1]) ?? f, g = (d - a) / c, w = (h - u) / f;
3635
+ let S = 0;
3636
+ for (const M of t)
3637
+ for (const p of M)
3638
+ p > S && (S = p);
3639
+ if (S !== 0)
3640
+ for (let M = 0; M < c; M++) {
3641
+ const p = t[M];
3642
+ if (p == null) continue;
3643
+ const m = i(a + M * g), T = i(a + (M + 1) * g);
3644
+ if (m == null || T == null) continue;
3645
+ const A = T - m;
3588
3646
  for (let y = 0; y < f; y++) {
3589
- const x = M[y] ?? 0, A = u + y * w, L = u + (y + 1) * w, k = l(L, s), E = l(A, s);
3590
- if (k == null || E == null) continue;
3591
- const P = E - k;
3592
- r.fillStyle = o(x / b), r.fillRect(v, k, T, P);
3647
+ const x = p[y] ?? 0, P = u + y * w, L = u + (y + 1) * w, F = l(L, s), I = l(P, s);
3648
+ if (F == null || I == null) continue;
3649
+ const C = I - F;
3650
+ r.fillStyle = o(x / S), r.fillRect(m, F, A, C);
3593
3651
  }
3594
3652
  }
3595
3653
  }), null;
@@ -3613,65 +3671,65 @@ function Ti({
3613
3671
  maxSize: r = 10
3614
3672
  }) {
3615
3673
  const i = st();
3616
- return kt(({ ctx: l, valToX: c, valToY: f }) => {
3617
- var g;
3674
+ return Tt(({ ctx: l, valToX: c, valToY: f }) => {
3675
+ var b;
3618
3676
  const a = i.dataStore.data[e];
3619
3677
  if (a == null) return;
3620
3678
  const d = a.x, u = a.series[n];
3621
3679
  if (u == null) return;
3622
- let h = 1 / 0, p = -1 / 0;
3623
- for (let m = 0; m < u.length; m++) {
3624
- const M = u[m];
3625
- M != null && (M < h && (h = M), M > p && (p = M));
3680
+ let h = 1 / 0, g = -1 / 0;
3681
+ for (let M = 0; M < u.length; M++) {
3682
+ const p = u[M];
3683
+ p != null && (p < h && (h = p), p > g && (g = p));
3626
3684
  }
3627
- const w = p - h || 1, b = ((g = i.seriesConfigs.find(
3628
- (m) => m.group === e && m.index === n
3629
- )) == null ? void 0 : g.yScale) ?? "y";
3685
+ const w = g - h || 1, S = ((b = i.seriesConfigs.find(
3686
+ (M) => M.group === e && M.index === n
3687
+ )) == null ? void 0 : b.yScale) ?? "y";
3630
3688
  l.strokeStyle = o, l.lineWidth = 1.5, l.lineCap = "round";
3631
- for (let m = 0; m < d.length; m++) {
3632
- const M = u[m], v = t[m];
3633
- if (M == null || v == null) continue;
3634
- const D = c(d[m]), T = f(M, b);
3635
- if (D == null || T == null) continue;
3636
- const y = (M - h) / w, x = s + y * (r - s);
3637
- Js(l, D, T, v, x);
3689
+ for (let M = 0; M < d.length; M++) {
3690
+ const p = u[M], m = t[M];
3691
+ if (p == null || m == null) continue;
3692
+ const T = c(d[M]), A = f(p, S);
3693
+ if (T == null || A == null) continue;
3694
+ const y = (p - h) / w, x = s + y * (r - s);
3695
+ Js(l, T, A, m, x);
3638
3696
  }
3639
3697
  }), null;
3640
3698
  }
3641
3699
  const Qs = 4;
3642
- function Me(t, e) {
3700
+ function be(t, e) {
3643
3701
  t.strokeStyle = e.stroke ?? "red", t.lineWidth = e.width ?? 1, e.dash && t.setLineDash(e.dash);
3644
3702
  }
3645
- function ye(t, e) {
3703
+ function Me(t, e) {
3646
3704
  e.dash && t.setLineDash([]);
3647
3705
  }
3648
3706
  function ti(t, e, n, o = {}) {
3649
- const { ctx: s, plotBox: r } = t, i = V(n, e, r.height, r.top);
3650
- s.beginPath(), s.moveTo(r.left, i), s.lineTo(r.left + r.width, i), Me(s, o), s.stroke(), ye(s, o);
3707
+ const { ctx: s, plotBox: r } = t, i = B(n, e, r.height, r.top);
3708
+ s.beginPath(), s.moveTo(r.left, i), s.lineTo(r.left + r.width, i), be(s, o), s.stroke(), Me(s, o);
3651
3709
  }
3652
3710
  function ei(t, e, n, o = {}) {
3653
- const { ctx: s, plotBox: r } = t, i = V(n, e, r.width, r.left);
3654
- s.beginPath(), s.moveTo(i, r.top), s.lineTo(i, r.top + r.height), Me(s, o), s.stroke(), ye(s, o);
3711
+ const { ctx: s, plotBox: r } = t, i = B(n, e, r.width, r.left);
3712
+ s.beginPath(), s.moveTo(i, r.top), s.lineTo(i, r.top + r.height), be(s, o), s.stroke(), Me(s, o);
3655
3713
  }
3656
3714
  function Ai(t, e, n, o, s, r, i = {}) {
3657
- const { ctx: l, plotBox: c } = t, f = V(o, e, c.width, c.left), a = V(s, n, c.height, c.top);
3715
+ const { ctx: l, plotBox: c } = t, f = B(o, e, c.width, c.left), a = B(s, n, c.height, c.top);
3658
3716
  l.font = i.font ?? "12px sans-serif", l.fillStyle = i.fill ?? "#000", l.textBaseline = "bottom", l.fillText(r, f, a - Qs);
3659
3717
  }
3660
3718
  function ni(t, e, n, o, s = {}) {
3661
- const { ctx: r, plotBox: i } = t, l = V(o, e, i.height, i.top), c = V(n, e, i.height, i.top);
3662
- r.fillStyle = s.fill ?? "rgba(255,0,0,0.1)", r.fillRect(i.left, Math.min(l, c), i.width, Math.abs(c - l)), s.stroke && (Me(r, s), r.strokeRect(i.left, Math.min(l, c), i.width, Math.abs(c - l)), ye(r, s));
3719
+ const { ctx: r, plotBox: i } = t, l = B(o, e, i.height, i.top), c = B(n, e, i.height, i.top);
3720
+ r.fillStyle = s.fill ?? "rgba(255,0,0,0.1)", r.fillRect(i.left, Math.min(l, c), i.width, Math.abs(c - l)), s.stroke && (be(r, s), r.strokeRect(i.left, Math.min(l, c), i.width, Math.abs(c - l)), Me(r, s));
3663
3721
  }
3664
- function xe(t, e, n) {
3665
- const o = N(t);
3666
- Ut(() => {
3722
+ function ye(t, e, n) {
3723
+ const o = Y(t);
3724
+ j(() => {
3667
3725
  o.current = t;
3668
- }, [t]), kt((s) => {
3726
+ }, [t]), Tt((s) => {
3669
3727
  const r = s.getScale(e);
3670
3728
  r != null && n(s, r, o.current);
3671
3729
  });
3672
3730
  }
3673
3731
  function Ii(t) {
3674
- return xe(t, t.yScale ?? "y", (e, n, o) => {
3732
+ return ye(t, t.yScale ?? "y", (e, n, o) => {
3675
3733
  if (ti(e, n, o.value, {
3676
3734
  stroke: o.stroke,
3677
3735
  width: o.width,
@@ -3684,8 +3742,8 @@ function Ii(t) {
3684
3742
  }
3685
3743
  }), null;
3686
3744
  }
3687
- function Li(t) {
3688
- return xe(t, t.xScale ?? "x", (e, n, o) => {
3745
+ function Pi(t) {
3746
+ return ye(t, t.xScale ?? "x", (e, n, o) => {
3689
3747
  if (ei(e, n, o.value, {
3690
3748
  stroke: o.stroke,
3691
3749
  width: o.width,
@@ -3698,8 +3756,8 @@ function Li(t) {
3698
3756
  }
3699
3757
  }), null;
3700
3758
  }
3701
- function Pi(t) {
3702
- return xe(t, t.yScale ?? "y", (e, n, o) => {
3759
+ function Li(t) {
3760
+ return ye(t, t.yScale ?? "y", (e, n, o) => {
3703
3761
  ni(e, n, o.yMin, o.yMax, {
3704
3762
  fill: o.fill,
3705
3763
  stroke: o.stroke,
@@ -3709,10 +3767,10 @@ function Pi(t) {
3709
3767
  }), null;
3710
3768
  }
3711
3769
  function _i(t) {
3712
- const e = N(t);
3713
- return Ut(() => {
3770
+ const e = Y(t);
3771
+ return j(() => {
3714
3772
  e.current = t;
3715
- }), kt((n) => {
3773
+ }), Tt((n) => {
3716
3774
  const o = e.current, s = n.valToX(o.x, o.xScale ?? "x"), r = n.valToY(o.y, o.yScale ?? "y");
3717
3775
  if (s == null || r == null) return;
3718
3776
  const { ctx: i } = n;
@@ -3720,79 +3778,79 @@ function _i(t) {
3720
3778
  }), null;
3721
3779
  }
3722
3780
  function Di(t) {
3723
- const e = (n, o, s, r, i, l, c, f, a, d, u, h, p) => {
3724
- const w = (p == null ? void 0 : p.align) ?? t ?? 1, b = (p == null ? void 0 : p.spanGaps) ?? !1;
3725
- if ([a, d] = Kt(o, a, d), a === -1)
3781
+ const e = (n, o, s, r, i, l, c, f, a, d, u, h, g) => {
3782
+ const w = (g == null ? void 0 : g.align) ?? t ?? 1, S = (g == null ? void 0 : g.spanGaps) ?? !1;
3783
+ if ([a, d] = Ot(o, a, d), a === -1)
3726
3784
  return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
3727
- const g = (L) => h(V(L, s, i, c)), m = (L) => h(V(L, r, l, f)), M = s.ori === W.Horizontal ? jt : qt, v = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, D = v.stroke;
3728
- let T = !1;
3785
+ const b = (L) => h(B(L, s, i, c)), M = (L) => h(B(L, r, l, f)), p = s.ori === W.Horizontal ? qt : Zt, m = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, T = m.stroke;
3786
+ let A = !1;
3729
3787
  const y = u === O.Forward ? a : d;
3730
- let x = m(o[y]), A = g(n[y]);
3731
- M(D, A, x);
3788
+ let x = M(o[y]), P = b(n[y]);
3789
+ p(T, P, x);
3732
3790
  for (let L = y; L >= a && L <= d; L += u) {
3733
- const k = o[L];
3734
- if (k == null) {
3735
- k === null && !b && (T = !0);
3791
+ const F = o[L];
3792
+ if (F == null) {
3793
+ F === null && !S && (A = !0);
3736
3794
  continue;
3737
3795
  }
3738
- const E = g(n[L]), P = m(k);
3796
+ const I = b(n[L]), C = M(F);
3739
3797
  if (w === 1)
3740
- M(D, E, x);
3798
+ p(T, I, x);
3741
3799
  else if (w === -1)
3742
- M(D, A, P);
3800
+ p(T, P, C);
3743
3801
  else {
3744
- const F = h((A + E) / 2);
3745
- M(D, F, x), M(D, F, P);
3802
+ const E = h((P + I) / 2);
3803
+ p(T, E, x), p(T, E, C);
3746
3804
  }
3747
- M(D, E, P), x = P, A = E;
3805
+ p(T, I, C), x = C, P = I;
3748
3806
  }
3749
3807
  {
3750
- const L = v.fill = new Path2D(D), k = (p == null ? void 0 : p.fillTo) ?? r.min ?? 0, E = m(k);
3751
- let P = g(n[a]), F = g(n[d]);
3752
- u === O.Backward && ([F, P] = [P, F]), M(L, F, E), M(L, P, E);
3808
+ const L = m.fill = new Path2D(T), F = (g == null ? void 0 : g.fillTo) ?? r.min ?? 0, I = M(F);
3809
+ let C = b(n[a]), E = b(n[d]);
3810
+ u === O.Backward && ([E, C] = [C, E]), p(L, E, I), p(L, C, I);
3753
3811
  }
3754
- if (T) {
3755
- const L = me(n, o, a, d, u, g);
3756
- v.gaps = L, v.clip = we(L, s.ori, c, f, i, l);
3812
+ if (A) {
3813
+ const L = pe(n, o, a, d, u, b);
3814
+ m.gaps = L, m.clip = me(L, s.ori, c, f, i, l);
3757
3815
  }
3758
- return v;
3816
+ return m;
3759
3817
  };
3760
- return e.defaults = Ot, e;
3818
+ return e.defaults = jt, e;
3761
3819
  }
3762
- function Ce(t) {
3820
+ function xe(t) {
3763
3821
  return t.defaults = qn, t;
3764
3822
  }
3765
3823
  function Mn() {
3766
- return Ce((e, n, o, s, r, i, l, c, f, a, d, u, h) => {
3767
- const p = (h == null ? void 0 : h.barWidth) ?? 0.6, w = (h == null ? void 0 : h.barGap) ?? 0, b = (h == null ? void 0 : h.barRadius) ?? 0, g = (h == null ? void 0 : h.barGroupIdx) ?? 0, m = (h == null ? void 0 : h.barGroupCount) ?? 1, M = (F) => u(V(F, o, r, l)), v = (F) => u(V(F, s, i, c));
3768
- let D = r;
3824
+ return xe((e, n, o, s, r, i, l, c, f, a, d, u, h) => {
3825
+ const g = (h == null ? void 0 : h.barWidth) ?? 0.6, w = (h == null ? void 0 : h.barGap) ?? 0, S = (h == null ? void 0 : h.barRadius) ?? 0, b = (h == null ? void 0 : h.barGroupIdx) ?? 0, M = (h == null ? void 0 : h.barGroupCount) ?? 1, p = (E) => u(B(E, o, r, l)), m = (E) => u(B(E, s, i, c));
3826
+ let T = r;
3769
3827
  if (a > f) {
3770
- let F = 1 / 0, $ = -1;
3771
- for (let S = f; S <= a; S++)
3772
- if (n[S] != null) {
3773
- if ($ >= 0) {
3774
- const C = e[S], _ = e[$], I = Math.abs(M(C) - M(_));
3775
- I < F && (F = I);
3828
+ let E = 1 / 0, H = -1;
3829
+ for (let v = f; v <= a; v++)
3830
+ if (n[v] != null) {
3831
+ if (H >= 0) {
3832
+ const k = e[v], _ = e[H], D = Math.abs(p(k) - p(_));
3833
+ D < E && (E = D);
3776
3834
  }
3777
- $ = S;
3835
+ H = v;
3778
3836
  }
3779
- F < 1 / 0 && (D = F);
3837
+ E < 1 / 0 && (T = E);
3780
3838
  }
3781
- const T = D * (1 - p), y = Math.max(0, T + w), x = Math.max(1, u(D - y)), A = m > 1 ? Math.max(1, u(x / Math.max(1, m))) : x, L = (h == null ? void 0 : h.fillTo) ?? s.min ?? 0, k = v(L), E = new Path2D(), P = o.ori === W.Horizontal;
3782
- for (let F = d === O.Forward ? f : a; F >= f && F <= a; F += d) {
3783
- const $ = n[F];
3784
- if ($ == null) continue;
3785
- const S = M(e[F]), C = v($), _ = m > 1 ? (g - (m - 1) / 2) * A : 0, I = u(S - A / 2 + _), H = Math.min(C, k), G = Math.max(C, k) - H;
3839
+ const A = T * (1 - g), y = Math.max(0, A + w), x = Math.max(1, u(T - y)), P = M > 1 ? Math.max(1, u(x / Math.max(1, M))) : x, L = (h == null ? void 0 : h.fillTo) ?? s.min ?? 0, F = m(L), I = new Path2D(), C = o.ori === W.Horizontal;
3840
+ for (let E = d === O.Forward ? f : a; E >= f && E <= a; E += d) {
3841
+ const H = n[E];
3842
+ if (H == null) continue;
3843
+ const v = p(e[E]), k = m(H), _ = M > 1 ? (b - (M - 1) / 2) * P : 0, D = u(v - P / 2 + _), $ = Math.min(k, F), G = Math.max(k, F) - $;
3786
3844
  if (G !== 0)
3787
- if (b > 0) {
3788
- const Y = Math.min(b * A, G / 2);
3789
- oi(E, P, I, H, A, G, Y, $ < L);
3845
+ if (S > 0) {
3846
+ const U = Math.min(S * P, G / 2);
3847
+ oi(I, C, D, $, P, G, U, H < L);
3790
3848
  } else
3791
- P ? E.rect(I, H, A, G) : E.rect(H, I, G, A);
3849
+ C ? I.rect(D, $, P, G) : I.rect($, D, G, P);
3792
3850
  }
3793
3851
  return {
3794
- stroke: E,
3795
- fill: E,
3852
+ stroke: I,
3853
+ fill: I,
3796
3854
  // bars are filled with the same path
3797
3855
  clip: null,
3798
3856
  band: null,
@@ -3802,21 +3860,21 @@ function Mn() {
3802
3860
  }
3803
3861
  function Ei(t, e) {
3804
3862
  const n = Mn();
3805
- return Ce((s, r, i, l, c, f, a, d, u, h, p, w, b) => {
3806
- const g = {
3807
- ...b,
3863
+ return xe((s, r, i, l, c, f, a, d, u, h, g, w, S) => {
3864
+ const b = {
3865
+ ...S,
3808
3866
  barGroupIdx: t,
3809
3867
  barGroupCount: e
3810
3868
  };
3811
- return n(s, r, i, l, c, f, a, d, u, h, p, w, g);
3869
+ return n(s, r, i, l, c, f, a, d, u, h, g, w, b);
3812
3870
  });
3813
3871
  }
3814
3872
  function Fi() {
3815
3873
  const t = Mn();
3816
- return Ce((n, o, s, r, i, l, c, f, a, d, u, h, p) => {
3874
+ return xe((n, o, s, r, i, l, c, f, a, d, u, h, g) => {
3817
3875
  const w = {
3818
3876
  barWidth: 0.8,
3819
- ...p
3877
+ ...g
3820
3878
  };
3821
3879
  return t(n, o, s, r, i, l, c, f, a, d, u, h, w);
3822
3880
  });
@@ -3825,17 +3883,17 @@ function oi(t, e, n, o, s, r, i, l) {
3825
3883
  i = Math.min(i, s / 2, r / 2), e ? l ? (t.moveTo(n, o), t.lineTo(n + s, o), t.lineTo(n + s, o + r - i), t.arc(n + s - i, o + r - i, i, 0, Math.PI / 2), t.lineTo(n + i, o + r), t.arc(n + i, o + r - i, i, Math.PI / 2, Math.PI), t.closePath()) : (t.moveTo(n, o + r), t.lineTo(n, o + i), t.arc(n + i, o + i, i, Math.PI, Math.PI * 1.5), t.lineTo(n + s - i, o), t.arc(n + s - i, o + i, i, Math.PI * 1.5, 0), t.lineTo(n + s, o + r), t.closePath()) : l ? (t.moveTo(o, n), t.lineTo(o, n + s), t.lineTo(o + r - i, n + s), t.arc(o + r - i, n + s - i, i, Math.PI / 2, 0, !0), t.lineTo(o + r, n + i), t.arc(o + r - i, n + i, i, 0, -Math.PI / 2, !0), t.closePath()) : (t.moveTo(o + r, n), t.lineTo(o + i, n), t.arc(o + i, n + i, i, -Math.PI / 2, Math.PI, !0), t.lineTo(o, n + s - i), t.arc(o + i, n + s - i, i, Math.PI, Math.PI / 2, !0), t.lineTo(o + r, n + s), t.closePath());
3826
3884
  }
3827
3885
  function yn(t) {
3828
- const e = (n, o, s, r, i, l, c, f, a, d, u, h, p) => {
3829
- const w = (p == null ? void 0 : p.spanGaps) ?? !1;
3830
- if ([a, d] = Kt(o, a, d), a === -1)
3886
+ const e = (n, o, s, r, i, l, c, f, a, d, u, h, g) => {
3887
+ const w = (g == null ? void 0 : g.spanGaps) ?? !1;
3888
+ if ([a, d] = Ot(o, a, d), a === -1)
3831
3889
  return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
3832
- const b = (A) => h(V(A, s, i, c)), g = (A) => h(V(A, r, l, f)), m = s.ori === W.Horizontal ? jt : qt, M = [], v = [];
3833
- let D = !1;
3834
- for (let A = u === O.Forward ? a : d; A >= a && A <= d; A += u) {
3835
- const L = o[A];
3836
- L != null ? (M.push(b(n[A])), v.push(g(L))) : L === null && !w && (D = !0);
3890
+ const S = (P) => h(B(P, s, i, c)), b = (P) => h(B(P, r, l, f)), M = s.ori === W.Horizontal ? qt : Zt, p = [], m = [];
3891
+ let T = !1;
3892
+ for (let P = u === O.Forward ? a : d; P >= a && P <= d; P += u) {
3893
+ const L = o[P];
3894
+ L != null ? (p.push(S(n[P])), m.push(b(L))) : L === null && !w && (T = !0);
3837
3895
  }
3838
- const T = s.ori === W.Horizontal, y = t(M, v, T, h), x = {
3896
+ const A = s.ori === W.Horizontal, y = t(p, m, A, h), x = {
3839
3897
  stroke: y ?? new Path2D(),
3840
3898
  fill: null,
3841
3899
  clip: null,
@@ -3843,17 +3901,17 @@ function yn(t) {
3843
3901
  gaps: null
3844
3902
  };
3845
3903
  if (y != null) {
3846
- const A = x.fill = new Path2D(y), L = (p == null ? void 0 : p.fillTo) ?? r.min ?? 0, k = g(L);
3847
- let E = b(n[a]), P = b(n[d]);
3848
- u === O.Backward && ([P, E] = [E, P]), m(A, P, k), m(A, E, k);
3904
+ const P = x.fill = new Path2D(y), L = (g == null ? void 0 : g.fillTo) ?? r.min ?? 0, F = b(L);
3905
+ let I = S(n[a]), C = S(n[d]);
3906
+ u === O.Backward && ([C, I] = [I, C]), M(P, C, F), M(P, I, F);
3849
3907
  }
3850
- if (D) {
3851
- const A = me(n, o, a, d, u, b);
3852
- x.gaps = A, x.clip = we(A, s.ori, c, f, i, l);
3908
+ if (T) {
3909
+ const P = pe(n, o, a, d, u, S);
3910
+ x.gaps = P, x.clip = me(P, s.ori, c, f, i, l);
3853
3911
  }
3854
3912
  return x;
3855
3913
  };
3856
- return e.defaults = Ot, e;
3914
+ return e.defaults = jt, e;
3857
3915
  }
3858
3916
  function zi() {
3859
3917
  return yn(si);
@@ -3871,18 +3929,18 @@ const si = (t, e, n, o) => {
3871
3929
  a[u] = (e[u + 1] ?? 0) - (e[u] ?? 0), d[u] = (t[u + 1] ?? 0) - (t[u] ?? 0), f[u] = d[u] !== 0 ? (a[u] ?? 0) / (d[u] ?? 1) : 0;
3872
3930
  c[0] = f[0] ?? 0;
3873
3931
  for (let u = 1; u < s - 1; u++) {
3874
- const h = f[u] ?? 0, p = f[u - 1] ?? 0;
3875
- if (h === 0 || p === 0 || p > 0 != h > 0)
3932
+ const h = f[u] ?? 0, g = f[u - 1] ?? 0;
3933
+ if (h === 0 || g === 0 || g > 0 != h > 0)
3876
3934
  c[u] = 0;
3877
3935
  else {
3878
- const w = d[u] ?? 1, b = d[u - 1] ?? 1;
3879
- c[u] = 3 * (b + w) / ((2 * w + b) / p + (w + 2 * b) / h), isFinite(c[u] ?? 0) || (c[u] = 0);
3936
+ const w = d[u] ?? 1, S = d[u - 1] ?? 1;
3937
+ c[u] = 3 * (S + w) / ((2 * w + S) / g + (w + 2 * S) / h), isFinite(c[u] ?? 0) || (c[u] = 0);
3880
3938
  }
3881
3939
  }
3882
3940
  c[s - 1] = f[s - 2] ?? 0;
3883
3941
  for (let u = 0; u < s - 1; u++) {
3884
- const h = d[u] ?? 1, p = t[u] ?? 0, w = e[u] ?? 0, b = t[u + 1] ?? 0, g = e[u + 1] ?? 0, m = c[u] ?? 0, M = c[u + 1] ?? 0, v = p + h / 3, D = w + m * h / 3, T = b - h / 3, y = g - M * h / 3;
3885
- n ? r.bezierCurveTo(v, D, T, y, b, g) : r.bezierCurveTo(D, v, y, T, g, b);
3942
+ const h = d[u] ?? 1, g = t[u] ?? 0, w = e[u] ?? 0, S = t[u + 1] ?? 0, b = e[u + 1] ?? 0, M = c[u] ?? 0, p = c[u + 1] ?? 0, m = g + h / 3, T = w + M * h / 3, A = S - h / 3, y = b - p * h / 3;
3943
+ n ? r.bezierCurveTo(m, T, A, y, S, b) : r.bezierCurveTo(T, m, y, A, b, S);
3886
3944
  }
3887
3945
  return r;
3888
3946
  };
@@ -3898,34 +3956,34 @@ const ii = (t, e, n, o) => {
3898
3956
  return n ? r.lineTo(c, f) : r.lineTo(f, c), r;
3899
3957
  }
3900
3958
  for (let c = 0; c < s - 1; c++) {
3901
- const f = c === 0 ? 0 : c - 1, a = t[f] ?? 0, d = e[f] ?? 0, u = t[c] ?? 0, h = e[c] ?? 0, p = t[c + 1] ?? 0, w = e[c + 1] ?? 0, b = c + 2 < s ? t[c + 2] ?? 0 : p, g = c + 2 < s ? e[c + 2] ?? 0 : w, m = Math.hypot(a - u, d - h), M = Math.hypot(u - p, h - w), v = Math.hypot(p - b, w - g), D = Math.sqrt(v), T = v, y = Math.sqrt(M), x = M, A = Math.sqrt(m), L = m, k = 2 * L + 3 * A * y + x, E = 2 * T + 3 * D * y + x, P = 3 * A * (A + y), F = 3 * D * (D + y);
3902
- let $, S, C, _;
3903
- if (P > 0) {
3904
- const I = 1 / P;
3905
- $ = (-x * a + k * u + L * p) * I, S = (-x * d + k * h + L * w) * I;
3959
+ const f = c === 0 ? 0 : c - 1, a = t[f] ?? 0, d = e[f] ?? 0, u = t[c] ?? 0, h = e[c] ?? 0, g = t[c + 1] ?? 0, w = e[c + 1] ?? 0, S = c + 2 < s ? t[c + 2] ?? 0 : g, b = c + 2 < s ? e[c + 2] ?? 0 : w, M = Math.hypot(a - u, d - h), p = Math.hypot(u - g, h - w), m = Math.hypot(g - S, w - b), T = Math.sqrt(m), A = m, y = Math.sqrt(p), x = p, P = Math.sqrt(M), L = M, F = 2 * L + 3 * P * y + x, I = 2 * A + 3 * T * y + x, C = 3 * P * (P + y), E = 3 * T * (T + y);
3960
+ let H, v, k, _;
3961
+ if (C > 0) {
3962
+ const D = 1 / C;
3963
+ H = (-x * a + F * u + L * g) * D, v = (-x * d + F * h + L * w) * D;
3906
3964
  } else
3907
- $ = u, S = h;
3908
- if (F > 0) {
3909
- const I = 1 / F;
3910
- C = (T * u + E * p - x * b) * I, _ = (T * h + E * w - x * g) * I;
3965
+ H = u, v = h;
3966
+ if (E > 0) {
3967
+ const D = 1 / E;
3968
+ k = (A * u + I * g - x * S) * D, _ = (A * h + I * w - x * b) * D;
3911
3969
  } else
3912
- C = p, _ = w;
3913
- n ? r.bezierCurveTo($, S, C, _, p, w) : r.bezierCurveTo(S, $, _, C, w, p);
3970
+ k = g, _ = w;
3971
+ n ? r.bezierCurveTo(H, v, k, _, g, w) : r.bezierCurveTo(v, H, _, k, w, g);
3914
3972
  }
3915
3973
  return r;
3916
3974
  };
3917
3975
  function $i(t = 4) {
3918
- const e = (n, o, s, r, i, l, c, f, a, d, u, h, p) => {
3919
- const w = (v) => h(V(v, s, i, c)), b = (v) => h(V(v, r, l, f)), g = t / 2, m = new Path2D(), M = s.ori === W.Horizontal;
3920
- for (let v = u === O.Forward ? a : d; v >= a && v <= d; v += u) {
3921
- const D = o[v];
3922
- if (D == null) continue;
3923
- const T = w(n[v]), y = b(D);
3924
- M ? (m.moveTo(T + g, y), m.arc(T, y, g, 0, Math.PI * 2)) : (m.moveTo(y + g, T), m.arc(y, T, g, 0, Math.PI * 2));
3976
+ const e = (n, o, s, r, i, l, c, f, a, d, u, h, g) => {
3977
+ const w = (m) => h(B(m, s, i, c)), S = (m) => h(B(m, r, l, f)), b = t / 2, M = new Path2D(), p = s.ori === W.Horizontal;
3978
+ for (let m = u === O.Forward ? a : d; m >= a && m <= d; m += u) {
3979
+ const T = o[m];
3980
+ if (T == null) continue;
3981
+ const A = w(n[m]), y = S(T);
3982
+ p ? (M.moveTo(A + b, y), M.arc(A, y, b, 0, Math.PI * 2)) : (M.moveTo(y + b, A), M.arc(y, A, b, 0, Math.PI * 2));
3925
3983
  }
3926
3984
  return {
3927
- stroke: m,
3928
- fill: m,
3985
+ stroke: M,
3986
+ fill: M,
3929
3987
  clip: null,
3930
3988
  band: null,
3931
3989
  gaps: null
@@ -3943,29 +4001,29 @@ function Wi({
3943
4001
  wickWidth: i = 1
3944
4002
  }) {
3945
4003
  const l = st();
3946
- return kt(({ ctx: c, plotBox: f, valToX: a, valToY: d }) => {
4004
+ return Tt(({ ctx: c, plotBox: f, valToX: a, valToY: d }) => {
3947
4005
  const u = l.dataStore.data[t];
3948
4006
  if (u == null) return;
3949
- const h = u.x, p = u.series[e[0]], w = u.series[e[1]], b = u.series[e[2]], g = u.series[e[3]];
3950
- if (p == null || w == null || b == null || g == null) return;
3951
- const m = h.length;
3952
- if (m === 0) return;
3953
- const M = Math.max(2, f.width / m * r);
3954
- for (let v = 0; v < m; v++) {
3955
- const D = h[v], T = p[v], y = w[v], x = b[v], A = g[v];
3956
- if (D == null || T == null || y == null || x == null || A == null) continue;
3957
- const L = a(D), k = d(y, n), E = d(x, n), P = d(T, n), F = d(A, n);
3958
- if (L == null || k == null || E == null || P == null || F == null) continue;
3959
- const S = A >= T ? o : s;
3960
- bn(c, L, k, E, P, F, M, null, {
3961
- wickColor: S,
4007
+ const h = u.x, g = u.series[e[0]], w = u.series[e[1]], S = u.series[e[2]], b = u.series[e[3]];
4008
+ if (g == null || w == null || S == null || b == null) return;
4009
+ const M = h.length;
4010
+ if (M === 0) return;
4011
+ const p = Math.max(2, f.width / M * r);
4012
+ for (let m = 0; m < M; m++) {
4013
+ const T = h[m], A = g[m], y = w[m], x = S[m], P = b[m];
4014
+ if (T == null || A == null || y == null || x == null || P == null) continue;
4015
+ const L = a(T), F = d(y, n), I = d(x, n), C = d(A, n), E = d(P, n);
4016
+ if (L == null || F == null || I == null || C == null || E == null) continue;
4017
+ const v = P >= A ? o : s;
4018
+ bn(c, L, F, I, C, E, p, null, {
4019
+ wickColor: v,
3962
4020
  wickWidth: i,
3963
- bodyFill: S
4021
+ bodyFill: v
3964
4022
  });
3965
4023
  }
3966
4024
  }), null;
3967
4025
  }
3968
- function Gi(t, e, n = 0) {
4026
+ function Ri(t, e, n = 0) {
3969
4027
  const o = e ?? t.series.map((a, d) => d), s = t.x.length, r = [], i = new Float64Array(s);
3970
4028
  for (let a = 0; a < o.length; a++) {
3971
4029
  const d = o[a];
@@ -3973,9 +4031,9 @@ function Gi(t, e, n = 0) {
3973
4031
  const u = t.series[d];
3974
4032
  if (u == null) continue;
3975
4033
  const h = new Array(s);
3976
- for (let p = 0; p < s; p++) {
3977
- const w = u[p];
3978
- w != null ? (i[p] = i[p] + w, h[p] = i[p]) : h[p] = null;
4034
+ for (let g = 0; g < s; g++) {
4035
+ const w = u[g];
4036
+ w != null ? (i[g] = i[g] + w, h[g] = i[g]) : h[g] = null;
3979
4037
  }
3980
4038
  r.push(h);
3981
4039
  }
@@ -4002,7 +4060,7 @@ function Gi(t, e, n = 0) {
4002
4060
  bands: f
4003
4061
  };
4004
4062
  }
4005
- function Ri(t) {
4063
+ function Gi(t) {
4006
4064
  const e = /* @__PURE__ */ new Set();
4007
4065
  for (const [r] of t)
4008
4066
  for (let i = 0; i < r.length; i++) {
@@ -4027,14 +4085,14 @@ function Ri(t) {
4027
4085
  }
4028
4086
  return [{ x: n, series: s }];
4029
4087
  }
4030
- function Vi(t) {
4088
+ function Bi(t) {
4031
4089
  const e = (t == null ? void 0 : t.decimals) ?? 1;
4032
4090
  return (n) => n.map((o) => {
4033
4091
  const s = Math.abs(o);
4034
4092
  return s >= 1e9 ? (o / 1e9).toFixed(e) + "B" : s >= 1e6 ? (o / 1e6).toFixed(e) + "M" : s >= 1e3 ? (o / 1e3).toFixed(e) + "K" : o.toFixed(s >= 1 ? 0 : e);
4035
4093
  });
4036
4094
  }
4037
- function Bi(t, e = 0) {
4095
+ function Vi(t, e = 0) {
4038
4096
  return (n) => n.map((o) => o.toFixed(e) + t);
4039
4097
  }
4040
4098
  function Xi(t, e = 0) {
@@ -4045,15 +4103,15 @@ function Yi(t, e, n = 0) {
4045
4103
  }
4046
4104
  function Ni(t) {
4047
4105
  const e = (t == null ? void 0 : t.utc) ?? !1;
4048
- return (n) => n.map((o) => e ? ct(o, { hour: "2-digit", minute: "2-digit", hour12: !1 }, "UTC") : ct(o, { hour: "2-digit", minute: "2-digit", hour12: !1 }));
4106
+ return (n) => n.map((o) => e ? at(o, { hour: "2-digit", minute: "2-digit", hour12: !1 }, "UTC") : at(o, { hour: "2-digit", minute: "2-digit", hour12: !1 }));
4049
4107
  }
4050
4108
  function Ui(t) {
4051
4109
  const e = t != null && t.utc ? "UTC" : void 0, n = (t == null ? void 0 : t.format) ?? "short";
4052
- return (o) => o.map((s) => ct(s, { month: n }, e));
4110
+ return (o) => o.map((s) => at(s, { month: n }, e));
4053
4111
  }
4054
4112
  function Ki(t) {
4055
4113
  const { tz: e, ...n } = t ?? {};
4056
- return (o) => o.map((s) => ct(s, n, e));
4114
+ return (o) => o.map((s) => at(s, n, e));
4057
4115
  }
4058
4116
  function Oi(t, e = 0) {
4059
4117
  return (n) => n.map((o) => {
@@ -4063,32 +4121,32 @@ function Oi(t, e = 0) {
4063
4121
  }
4064
4122
  export {
4065
4123
  _i as AnnotationLabel,
4066
- Yt as Axis,
4124
+ Ut as Axis,
4067
4125
  pi as Band,
4068
4126
  Ci as BoxWhisker,
4069
4127
  Wi as Candlestick,
4070
4128
  mn as Chart,
4071
4129
  ue as DEFAULT_ACTIONS,
4072
4130
  O as Direction,
4073
- j as Distribution,
4131
+ q as Distribution,
4074
4132
  yi as FloatingLegend,
4075
4133
  Ii as HLine,
4076
4134
  ki as Heatmap,
4077
4135
  xi as HoverLabel,
4078
4136
  mi as Legend,
4079
4137
  W as Orientation,
4080
- Pi as Region,
4138
+ Li as Region,
4081
4139
  hi as Scale,
4082
4140
  vn as Series,
4083
- U as Side,
4084
- Ft as SortOrder,
4141
+ N as Side,
4142
+ Ht as SortOrder,
4085
4143
  Mi as Sparkline,
4086
4144
  bi as Timeline,
4087
4145
  wi as Tooltip,
4088
- Li as VLine,
4146
+ Pi as VLine,
4089
4147
  Ti as Vector,
4090
4148
  vi as ZoomRanger,
4091
- Ri as alignData,
4149
+ Gi as alignData,
4092
4150
  Mn as bars,
4093
4151
  Hi as catmullRom,
4094
4152
  ti as drawHLine,
@@ -4096,30 +4154,30 @@ export {
4096
4154
  ni as drawRegion,
4097
4155
  ei as drawVLine,
4098
4156
  di as fadeGradient,
4099
- Vi as fmtCompact,
4157
+ Bi as fmtCompact,
4100
4158
  Ki as fmtDateStr,
4101
4159
  Ni as fmtHourMin,
4102
4160
  Oi as fmtLabels,
4103
4161
  Ui as fmtMonthName,
4104
4162
  Xi as fmtPrefix,
4105
- Bi as fmtSuffix,
4163
+ Vi as fmtSuffix,
4106
4164
  Yi as fmtWrap,
4107
4165
  ai as focus,
4108
4166
  Ei as groupedBars,
4109
4167
  to as linear,
4110
- un as lttb,
4168
+ an as lttb,
4111
4169
  ui as lttbGroup,
4112
4170
  zi as monotoneCubic,
4113
4171
  gi as palette,
4114
4172
  $i as points,
4115
- vt as posToVal,
4116
- _t as sideOrientation,
4117
- Gi as stackGroup,
4173
+ bt as posToVal,
4174
+ Et as sideOrientation,
4175
+ Ri as stackGroup,
4118
4176
  Fi as stackedBars,
4119
4177
  Di as stepped,
4120
4178
  fi as useChart,
4121
4179
  Si as useCursorDrawHook,
4122
- kt as useDrawHook,
4123
- V as valToPos,
4180
+ Tt as useDrawHook,
4181
+ B as valToPos,
4124
4182
  Cs as withAlpha
4125
4183
  };