uplot-plus 0.1.0 → 0.1.2

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,23 +1,23 @@
1
- import { jsx as E, jsxs as J, Fragment as Ae } from "react/jsx-runtime";
2
- import { useRef as X, useContext as Pe, createContext as Le, useEffect as Y, useState as vt, useCallback as K, useSyncExternalStore as fe, memo as ze, useLayoutEffect as Dt } from "react";
3
- 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 || {}), G = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(G || {}), O = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(O || {}), N = /* @__PURE__ */ ((t) => (t[t.Linear = 1] = "Linear", t[t.Ordinal = 2] = "Ordinal", t[t.Log = 3] = "Log", t[t.Asinh = 4] = "Asinh", t))(N || {}), yt = /* @__PURE__ */ ((t) => (t[t.Ascending = 1] = "Ascending", t[t.Descending = -1] = "Descending", t[t.Unsorted = 0] = "Unsorted", t))(yt || {});
4
- function Mt(t) {
1
+ import { jsx as E, jsxs as Q, Fragment as Pe } from "react/jsx-runtime";
2
+ import { useRef as X, useContext as Le, createContext as ze, useEffect as Y, useState as vt, useCallback as N, useSyncExternalStore as he, memo as De, useLayoutEffect as Dt } from "react";
3
+ 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 || {}), G = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(G || {}), K = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(K || {}), O = /* @__PURE__ */ ((t) => (t[t.Linear = 1] = "Linear", t[t.Ordinal = 2] = "Ordinal", t[t.Log = 3] = "Log", t[t.Asinh = 4] = "Asinh", t))(O || {}), yt = /* @__PURE__ */ ((t) => (t[t.Ascending = 1] = "Ascending", t[t.Descending = -1] = "Descending", t[t.Unsorted = 0] = "Unsorted", t))(yt || {});
4
+ function xt(t) {
5
5
  return t % 2;
6
6
  }
7
- var Q = /* @__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))(Q || {});
8
- const q = Math, Vt = q.PI, gt = q.abs, nt = q.floor, H = q.round, Tt = q.ceil, qt = q.min, kt = q.max, wt = q.pow, Zt = q.sign, tt = q.log10, St = q.log2, De = (t, e = 1) => q.sinh(t) * e, Wt = (t, e = 1) => q.asinh(t / e), j = 1 / 0, he = Number.isInteger;
9
- function Ht(t, e) {
7
+ var tt = /* @__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))(tt || {});
8
+ const J = Math, Ht = J.PI, gt = J.abs, st = J.floor, $ = J.round, Tt = J.ceil, qt = J.min, kt = J.max, wt = J.pow, Zt = J.sign, et = J.log10, bt = J.log2, Fe = (t, e = 1) => J.sinh(t) * e, Wt = (t, e = 1) => J.asinh(t / e), q = 1 / 0, de = Number.isInteger;
9
+ function Vt(t, e) {
10
10
  return t[e] ?? 0;
11
11
  }
12
12
  function ct(t, e, n = 0, s = e.length - 1) {
13
13
  let o;
14
14
  const i = s <= 2147483647;
15
15
  for (; s - n > 1; )
16
- o = i ? n + s >> 1 : nt((n + s) / 2), Ht(e, o) < t ? n = o : s = o;
17
- return t - Ht(e, n) <= Ht(e, s) - t ? n : s;
16
+ o = i ? n + s >> 1 : st((n + s) / 2), Vt(e, o) < t ? n = o : s = o;
17
+ return t - Vt(e, n) <= Vt(e, s) - t ? n : s;
18
18
  }
19
- const de = (t) => t != null, ge = (t) => t != null && t > 0;
20
- function pe(t) {
19
+ const ge = (t) => t != null, pe = (t) => t != null && t > 0;
20
+ function me(t) {
21
21
  return (e, n, s) => {
22
22
  let o = -1, i = -1;
23
23
  for (let l = n; l <= s; l++)
@@ -33,37 +33,37 @@ function pe(t) {
33
33
  return [o, i];
34
34
  };
35
35
  }
36
- const Ft = pe(de), me = pe(ge);
37
- function Fe(t, e, n, s = yt.Unsorted, o = !1) {
38
- const i = o ? me : Ft, l = o ? ge : de, [r, a] = i(t, e, n);
39
- let c = t[r] ?? j, u = t[r] ?? -j;
36
+ const Ft = me(ge), we = me(pe);
37
+ function Re(t, e, n, s = yt.Unsorted, o = !1) {
38
+ const i = o ? we : Ft, l = o ? pe : ge, [r, a] = i(t, e, n);
39
+ let c = t[r] ?? q, u = t[r] ?? -q;
40
40
  if (r > -1)
41
41
  if (s === yt.Ascending)
42
- c = t[r] ?? j, u = t[a] ?? -j;
42
+ c = t[r] ?? q, u = t[a] ?? -q;
43
43
  else if (s === yt.Descending)
44
- c = t[a] ?? j, u = t[r] ?? -j;
44
+ c = t[a] ?? q, u = t[r] ?? -q;
45
45
  else
46
- for (let h = r; h <= a; h++) {
47
- const f = t[h];
46
+ for (let d = r; d <= a; d++) {
47
+ const f = t[d];
48
48
  f != null && l(f) && (f < c ? c = f : f > u && (u = f));
49
49
  }
50
50
  return [c, u];
51
51
  }
52
52
  function ut(t, e = 0) {
53
- if (he(t))
53
+ if (de(t))
54
54
  return t;
55
55
  const n = 10 ** e, s = t * n * (1 + Number.EPSILON);
56
- return H(s) / n;
56
+ return $(s) / n;
57
57
  }
58
- const xt = /* @__PURE__ */ new Map();
58
+ const Mt = /* @__PURE__ */ new Map();
59
59
  function _e(t) {
60
60
  return (String(t).split(".")[1] ?? "").length;
61
61
  }
62
- const Re = /\.\d*?(?=9{6,}|0{6,})/gm;
62
+ const Ge = /\.\d*?(?=9{6,}|0{6,})/gm;
63
63
  function It(t) {
64
- if (he(t) || xt.has(t))
64
+ if (de(t) || Mt.has(t))
65
65
  return t;
66
- const e = `${t}`, n = e.match(Re);
66
+ const e = `${t}`, n = e.match(Ge);
67
67
  if (n == null)
68
68
  return t;
69
69
  const s = n[0].length - 1;
@@ -73,69 +73,69 @@ function It(t) {
73
73
  }
74
74
  return ut(t, s);
75
75
  }
76
- function Xt(t, e, n = !0) {
76
+ function Et(t, e, n = !0) {
77
77
  return n ? It(Tt(It(t / e)) * e) : Tt(t / e) * e;
78
78
  }
79
- function we(t, e, n = !0) {
80
- return n ? It(nt(It(t / e)) * e) : nt(t / e) * e;
79
+ function ve(t, e, n = !0) {
80
+ return n ? It(st(It(t / e)) * e) : st(t / e) * e;
81
81
  }
82
- function ve(t, e, n, s) {
82
+ function Me(t, e, n, s) {
83
83
  const o = [], i = s.map(_e);
84
84
  for (let l = e; l < n; l++) {
85
85
  const r = gt(l);
86
86
  for (let a = 0; a < s.length; a++) {
87
- const c = s[a] ?? 0, u = i[a] ?? 0, h = +`${c}e${l}`, f = (l >= 0 ? 0 : r) + (l >= u ? 0 : u), d = h;
88
- o.push(d), xt.set(d, f);
87
+ const c = s[a] ?? 0, u = i[a] ?? 0, d = +`${c}e${l}`, f = (l >= 0 ? 0 : r) + (l >= u ? 0 : u), g = d;
88
+ o.push(g), Mt.set(g, f);
89
89
  }
90
90
  }
91
91
  return o;
92
92
  }
93
- const Ge = new Intl.NumberFormat(), xe = (t) => Ge.format(t), Ve = 0.1, lt = {
93
+ const He = new Intl.NumberFormat(), xe = (t) => He.format(t), Ve = 0.1, lt = {
94
94
  mode: 3,
95
95
  pad: Ve,
96
96
  soft: null
97
- }, Ct = { pad: 0, soft: null, mode: 0 }, He = { min: Ct, max: Ct };
98
- function bt(t, e, n, s) {
97
+ }, Ct = { pad: 0, soft: null, mode: 0 }, $e = { min: Ct, max: Ct };
98
+ function St(t, e, n, s) {
99
99
  let o;
100
- typeof n == "number" ? (Ct.pad = n, Ct.soft = null, Ct.mode = 0, o = He) : o = n;
101
- const i = o.min, l = o.max, r = i.pad, a = l.pad, c = i.hard ?? -j, u = l.hard ?? j, h = i.soft ?? j, f = l.soft ?? -j, d = i.mode, y = l.mode;
102
- let S = e - t;
103
- const p = tt(S), g = kt(gt(t), gt(e)), I = tt(g), L = gt(I - p);
104
- (S < 1e-24 || L > 10) && (S = 0, (t === 0 || e === 0) && (S = 1e-24));
105
- const P = S || g || 1e3, T = tt(P), M = wt(10, nt(T)), w = P * (S === 0 ? t === 0 ? 0.1 : 1 : r), b = ut(we(t - w, M / 10), 24), k = t >= h && (d === 1 || d === 3 && b <= h || d === 2 && b >= h) ? h : j, D = kt(c, b < k && t >= k ? k : qt(k, b)), m = P * (S === 0 ? e === 0 ? 0.1 : 1 : a), v = ut(Xt(e + m, M / 10), 24), x = e <= f && (y === 1 || y === 3 && v >= f || y === 2 && v <= f) ? f : -j, C = qt(u, v > x && e <= x ? x : kt(x, v));
106
- return D === C && D === 0 ? [0, 100] : [D, C];
100
+ typeof n == "number" ? (Ct.pad = n, Ct.soft = null, Ct.mode = 0, o = $e) : o = n;
101
+ const i = o.min, l = o.max, r = i.pad, a = l.pad, c = i.hard ?? -q, u = l.hard ?? q, d = i.soft ?? q, f = l.soft ?? -q, g = i.mode, M = l.mode;
102
+ let b = e - t;
103
+ const P = et(b), h = kt(gt(t), gt(e)), C = et(h), I = gt(C - P);
104
+ (b < 1e-24 || I > 10) && (b = 0, (t === 0 || e === 0) && (b = 1e-24));
105
+ const L = b || h || 1e3, T = et(L), x = wt(10, st(T)), m = L * (b === 0 ? t === 0 ? 0.1 : 1 : r), S = ut(ve(t - m, x / 10), 24), y = t >= d && (g === 1 || g === 3 && S <= d || g === 2 && S >= d) ? d : q, z = kt(c, S < y && t >= y ? y : qt(y, S)), p = L * (b === 0 ? e === 0 ? 0.1 : 1 : a), w = ut(Et(e + p, x / 10), 24), v = e <= f && (M === 1 || M === 3 && w >= f || M === 2 && w <= f) ? f : -q, k = qt(u, w > v && e <= v ? v : kt(v, w));
106
+ return z === k && z === 0 ? [0, 100] : [z, k];
107
107
  }
108
108
  function Be(t, e, n, s) {
109
109
  n === 2 && (s = !0);
110
110
  const o = Zt(t), i = Zt(e);
111
111
  t === e && (o === -1 ? (t *= n, e /= n) : (t /= n, e *= n));
112
- const l = n === 10 ? tt : St, r = o === 1 ? nt : Tt, a = i === 1 ? Tt : nt, c = l(gt(t)), u = l(gt(e)), h = r(c), f = a(u);
113
- let d = wt(n, h), y = wt(n, f);
114
- return n === 10 && (h < 0 && (d = ut(d, -h)), f < 0 && (y = ut(y, -f))), s ? (t = d * o, e = y * i) : (t = we(t, wt(n, nt(c)), !1), e = Xt(e, wt(n, nt(u)), !1)), [t, e];
112
+ const l = n === 10 ? et : bt, r = o === 1 ? st : Tt, a = i === 1 ? Tt : st, c = l(gt(t)), u = l(gt(e)), d = r(c), f = a(u);
113
+ let g = wt(n, d), M = wt(n, f);
114
+ return n === 10 && (d < 0 && (g = ut(g, -d)), f < 0 && (M = ut(M, -f))), s ? (t = g * o, e = M * i) : (t = ve(t, wt(n, st(c)), !1), e = Et(e, wt(n, st(u)), !1)), [t, e];
115
115
  }
116
116
  function Jt(t) {
117
- return (tt((t ^ t >> 31) - (t >> 31)) | 0) + 1;
117
+ return (et((t ^ t >> 31) - (t >> 31)) | 0) + 1;
118
118
  }
119
- function Ee(t, e, n, s, o) {
119
+ function We(t, e, n, s, o) {
120
120
  const i = kt(Jt(t), Jt(e)), l = e - t;
121
121
  let r = kt(0, ct(o / s * l, n) - 1);
122
122
  do {
123
123
  const a = n[r] ?? 0, c = s * a / l;
124
- if (c >= o * 0.9 && i + (a < 5 ? xt.get(a) ?? 0 : 0) <= 17)
124
+ if (c >= o * 0.9 && i + (a < 5 ? Mt.get(a) ?? 0 : 0) <= 17)
125
125
  return [a, c];
126
126
  } while (++r < n.length);
127
127
  return [0, 0];
128
128
  }
129
- function We(t) {
129
+ function Ee(t) {
130
130
  return {
131
131
  id: t.id,
132
132
  min: t.min ?? null,
133
133
  max: t.max ?? null,
134
- distr: t.distr ?? N.Linear,
134
+ distr: t.distr ?? O.Linear,
135
135
  log: t.log ?? 10,
136
136
  asinh: t.asinh ?? 1,
137
137
  ori: t.ori ?? (t.id === "x" ? G.Horizontal : G.Vertical),
138
- dir: t.dir ?? O.Forward,
138
+ dir: t.dir ?? K.Forward,
139
139
  time: t.time ?? !1,
140
140
  auto: t.auto ?? !0,
141
141
  range: t.range ?? null,
@@ -146,60 +146,60 @@ function We(t) {
146
146
  function at(t) {
147
147
  t._min = null, t._max = null;
148
148
  }
149
- function Me(t) {
149
+ function be(t) {
150
150
  if (t._min != null) return t._min;
151
151
  const { min: e, distr: n } = t;
152
152
  if (e == null) return 0;
153
- if (n === N.Log) {
153
+ if (n === O.Log) {
154
154
  const s = e > 0 ? e : 1e-10;
155
- t._min = (t.log === 10 ? tt : St)(s);
156
- } else n === N.Asinh ? t._min = Wt(e, t.asinh) : t._min = e;
155
+ t._min = (t.log === 10 ? et : bt)(s);
156
+ } else n === O.Asinh ? t._min = Wt(e, t.asinh) : t._min = e;
157
157
  return t._min;
158
158
  }
159
159
  function Se(t) {
160
160
  if (t._max != null) return t._max;
161
161
  const { max: e, distr: n } = t;
162
162
  if (e == null) return 0;
163
- if (n === N.Log) {
163
+ if (n === O.Log) {
164
164
  const s = e > 0 ? e : 1e-10;
165
- t._max = (t.log === 10 ? tt : St)(s);
166
- } else n === N.Asinh ? t._max = Wt(e, t.asinh) : t._max = e;
165
+ t._max = (t.log === 10 ? et : bt)(s);
166
+ } else n === O.Asinh ? t._max = Wt(e, t.asinh) : t._max = e;
167
167
  return t._max;
168
168
  }
169
169
  function Xe(t, e) {
170
170
  if (e.min == null || e.max == null) return 0;
171
- const n = Me(e), o = Se(e) - n;
171
+ const n = be(e), o = Se(e) - n;
172
172
  if (o === 0) return 0;
173
173
  const { distr: i } = e;
174
- if (i === N.Log) {
175
- const l = e.log === 10 ? tt : St, r = t > 0 ? t : 1e-10;
174
+ if (i === O.Log) {
175
+ const l = e.log === 10 ? et : bt, r = t > 0 ? t : 1e-10;
176
176
  return (l(r) - n) / o;
177
177
  }
178
- return i === N.Asinh ? (Wt(t, e.asinh) - n) / o : (t - n) / o;
178
+ return i === O.Asinh ? (Wt(t, e.asinh) - n) / o : (t - n) / o;
179
179
  }
180
- function $e(t, e) {
180
+ function Ye(t, e) {
181
181
  if (e.min == null || e.max == null) return 0;
182
- const n = Me(e), s = Se(e);
182
+ const n = be(e), s = Se(e);
183
183
  if (s === n) return e.min;
184
184
  const { distr: o } = e;
185
- return o === N.Log ? Math.pow(e.log, n + t * (s - n)) : o === N.Asinh ? De(n + t * (s - n), e.asinh) : n + t * (s - n);
185
+ return o === O.Log ? Math.pow(e.log, n + t * (s - n)) : o === O.Asinh ? Fe(n + t * (s - n), e.asinh) : n + t * (s - n);
186
186
  }
187
- function V(t, e, n, s) {
187
+ function H(t, e, n, s) {
188
188
  const o = Xe(t, e);
189
189
  let i;
190
- return e.ori === G.Horizontal ? i = e.dir === O.Forward ? o : 1 - o : i = e.dir === O.Forward ? 1 - o : o, s + i * n;
190
+ return e.ori === G.Horizontal ? i = e.dir === K.Forward ? o : 1 - o : i = e.dir === K.Forward ? 1 - o : o, s + i * n;
191
191
  }
192
192
  function it(t, e, n, s) {
193
193
  if (n === 0) return e.min ?? 0;
194
194
  let o = (t - s) / n;
195
- return e.ori === G.Horizontal ? e.dir === O.Backward && (o = 1 - o) : e.dir !== O.Backward && (o = 1 - o), $e(o, e);
195
+ return e.ori === G.Horizontal ? e.dir === K.Backward && (o = 1 - o) : e.dir !== K.Backward && (o = 1 - o), Ye(o, e);
196
196
  }
197
- class Ye {
197
+ class Ue {
198
198
  constructor() {
199
199
  this.scales = /* @__PURE__ */ new Map(), this.groupXScales = /* @__PURE__ */ new Map();
200
200
  }
201
201
  addScale(e) {
202
- this.scales.set(e.id, We(e));
202
+ this.scales.set(e.id, Ee(e));
203
203
  }
204
204
  removeScale(e) {
205
205
  this.scales.delete(e);
@@ -234,29 +234,29 @@ class Ye {
234
234
  var s, o, i, l, r, a;
235
235
  const n = /* @__PURE__ */ new Map();
236
236
  for (const [c, u] of this.groupXScales) {
237
- const h = this.scales.get(u);
238
- if (!h || !h.auto) continue;
237
+ const d = this.scales.get(u);
238
+ if (!d || !d.auto) continue;
239
239
  const f = e[c];
240
240
  if (!f || f.x.length === 0) continue;
241
- const d = f.x[0], y = f.x[f.x.length - 1];
242
- if (d == null || y == null) continue;
243
- const S = n.get(u);
244
- S ? (S.dataMin = Math.min(S.dataMin, d), S.dataMax = Math.max(S.dataMax, y)) : n.set(u, { dataMin: d, dataMax: y });
241
+ const g = f.x[0], M = f.x[f.x.length - 1];
242
+ if (g == null || M == null) continue;
243
+ const b = n.get(u);
244
+ b ? (b.dataMin = Math.min(b.dataMin, g), b.dataMax = Math.max(b.dataMax, M)) : n.set(u, { dataMin: g, dataMax: M });
245
245
  }
246
- for (const [c, { dataMin: u, dataMax: h }] of n) {
246
+ for (const [c, { dataMin: u, dataMax: d }] of n) {
247
247
  const f = this.scales.get(c);
248
248
  if (f) {
249
249
  if (f.range) {
250
- const [d, y] = bt(u, h, {
250
+ const [g, M] = St(u, d, {
251
251
  min: { pad: ((s = f.range.min) == null ? void 0 : s.pad) ?? 0, soft: ((o = f.range.min) == null ? void 0 : o.soft) ?? null, mode: ((i = f.range.min) == null ? void 0 : i.mode) ?? 0 },
252
252
  max: { pad: ((l = f.range.max) == null ? void 0 : l.pad) ?? 0, soft: ((r = f.range.max) == null ? void 0 : r.soft) ?? null, mode: ((a = f.range.max) == null ? void 0 : a.mode) ?? 0 }
253
253
  });
254
- f.min = d, f.max = y;
254
+ f.min = g, f.max = M;
255
255
  } else
256
- u === h ? [f.min, f.max] = bt(u, h, {
256
+ u === d ? [f.min, f.max] = St(u, d, {
257
257
  min: { pad: 0.1, soft: null, mode: 0 },
258
258
  max: { pad: 0.1, soft: null, mode: 0 }
259
- }) : (f.min = u, f.max = h);
259
+ }) : (f.min = u, f.max = d);
260
260
  at(f);
261
261
  }
262
262
  }
@@ -267,66 +267,66 @@ class Ye {
267
267
  * For each y-scale: range from all series that reference it, within the visible x-window.
268
268
  */
269
269
  autoRange(e, n, s) {
270
- var r, a, c, u, h, f, d, y, S, p, g, I;
270
+ var r, a, c, u, d, f, g, M, b, P, h, C;
271
271
  const o = /* @__PURE__ */ new Map();
272
- for (const [L, P] of this.groupXScales) {
273
- const T = this.scales.get(P);
272
+ for (const [I, L] of this.groupXScales) {
273
+ const T = this.scales.get(L);
274
274
  if (!T || !T.auto) continue;
275
- const M = e[L];
276
- if (!M || M.x.length === 0) continue;
277
- const w = M.x[0], b = M.x[M.x.length - 1];
278
- if (w == null || b == null) continue;
279
- const k = o.get(P);
280
- k ? (k.dataMin = Math.min(k.dataMin, w), k.dataMax = Math.max(k.dataMax, b)) : o.set(P, { dataMin: w, dataMax: b });
281
- }
282
- for (const [L, { dataMin: P, dataMax: T }] of o) {
283
- const M = this.scales.get(L);
284
- if (M) {
285
- if (M.range) {
286
- const [w, b] = bt(P, T, {
287
- min: { pad: ((r = M.range.min) == null ? void 0 : r.pad) ?? 0, soft: ((a = M.range.min) == null ? void 0 : a.soft) ?? null, mode: ((c = M.range.min) == null ? void 0 : c.mode) ?? 0 },
288
- max: { pad: ((u = M.range.max) == null ? void 0 : u.pad) ?? 0, soft: ((h = M.range.max) == null ? void 0 : h.soft) ?? null, mode: ((f = M.range.max) == null ? void 0 : f.mode) ?? 0 }
275
+ const x = e[I];
276
+ if (!x || x.x.length === 0) continue;
277
+ const m = x.x[0], S = x.x[x.x.length - 1];
278
+ if (m == null || S == null) continue;
279
+ const y = o.get(L);
280
+ y ? (y.dataMin = Math.min(y.dataMin, m), y.dataMax = Math.max(y.dataMax, S)) : o.set(L, { dataMin: m, dataMax: S });
281
+ }
282
+ for (const [I, { dataMin: L, dataMax: T }] of o) {
283
+ const x = this.scales.get(I);
284
+ if (x) {
285
+ if (x.range) {
286
+ const [m, S] = St(L, T, {
287
+ min: { pad: ((r = x.range.min) == null ? void 0 : r.pad) ?? 0, soft: ((a = x.range.min) == null ? void 0 : a.soft) ?? null, mode: ((c = x.range.min) == null ? void 0 : c.mode) ?? 0 },
288
+ max: { pad: ((u = x.range.max) == null ? void 0 : u.pad) ?? 0, soft: ((d = x.range.max) == null ? void 0 : d.soft) ?? null, mode: ((f = x.range.max) == null ? void 0 : f.mode) ?? 0 }
289
289
  });
290
- M.min = w, M.max = b;
290
+ x.min = m, x.max = S;
291
291
  } else
292
- P === T ? [M.min, M.max] = bt(P, T, {
292
+ L === T ? [x.min, x.max] = St(L, T, {
293
293
  min: { pad: 0.1, soft: null, mode: 0 },
294
294
  max: { pad: 0.1, soft: null, mode: 0 }
295
- }) : (M.min = P, M.max = T);
296
- at(M);
295
+ }) : (x.min = L, x.max = T);
296
+ at(x);
297
297
  }
298
298
  }
299
299
  const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
300
- for (const { group: L, index: P, yScale: T } of n) {
301
- const M = e[L];
302
- if (!M) continue;
303
- const w = M.series[P];
304
- if (!w || w.length === 0) continue;
305
- const b = s.windows.get(L), k = b ? b[0] : 0, D = b ? b[1] : w.length - 1, m = this.scales.get(T), v = (m == null ? void 0 : m.distr) === N.Log, [x, C] = s.getCachedMinMax(L, P, k, D, 0, v), z = i.get(T), A = l.get(T);
306
- i.set(T, z != null ? Math.min(z, x) : x), l.set(T, A != null ? Math.max(A, C) : C);
307
- }
308
- for (const [L, P] of i) {
309
- const T = this.scales.get(L);
300
+ for (const { group: I, index: L, yScale: T } of n) {
301
+ const x = e[I];
302
+ if (!x) continue;
303
+ const m = x.series[L];
304
+ if (!m || m.length === 0) continue;
305
+ const S = s.windows.get(I), y = S ? S[0] : 0, z = S ? S[1] : m.length - 1, p = this.scales.get(T), w = (p == null ? void 0 : p.distr) === O.Log, [v, k] = s.getCachedMinMax(I, L, y, z, 0, w), D = i.get(T), A = l.get(T);
306
+ i.set(T, D != null ? Math.min(D, v) : v), l.set(T, A != null ? Math.max(A, k) : k);
307
+ }
308
+ for (const [I, L] of i) {
309
+ const T = this.scales.get(I);
310
310
  if (!T || !T.auto) continue;
311
- const M = l.get(L) ?? -j;
312
- if (P === j) continue;
313
- let w, b;
314
- if (T.distr === N.Log)
315
- [w, b] = Be(P, M, T.log, !1);
311
+ const x = l.get(I) ?? -q;
312
+ if (L === q) continue;
313
+ let m, S;
314
+ if (T.distr === O.Log)
315
+ [m, S] = Be(L, x, T.log, !1);
316
316
  else {
317
- const k = T.range ?? { min: lt, max: lt };
318
- [w, b] = bt(P, M, {
319
- min: { pad: ((d = k.min) == null ? void 0 : d.pad) ?? lt.pad, soft: ((y = k.min) == null ? void 0 : y.soft) ?? lt.soft, mode: ((S = k.min) == null ? void 0 : S.mode) ?? lt.mode },
320
- max: { pad: ((p = k.max) == null ? void 0 : p.pad) ?? lt.pad, soft: ((g = k.max) == null ? void 0 : g.soft) ?? lt.soft, mode: ((I = k.max) == null ? void 0 : I.mode) ?? lt.mode }
317
+ const y = T.range ?? { min: lt, max: lt };
318
+ [m, S] = St(L, x, {
319
+ min: { pad: ((g = y.min) == null ? void 0 : g.pad) ?? lt.pad, soft: ((M = y.min) == null ? void 0 : M.soft) ?? lt.soft, mode: ((b = y.min) == null ? void 0 : b.mode) ?? lt.mode },
320
+ max: { pad: ((P = y.max) == null ? void 0 : P.pad) ?? lt.pad, soft: ((h = y.max) == null ? void 0 : h.soft) ?? lt.soft, mode: ((C = y.max) == null ? void 0 : C.mode) ?? lt.mode }
321
321
  });
322
322
  }
323
- T.min = w, T.max = b, at(T);
323
+ T.min = m, T.max = S, at(T);
324
324
  }
325
325
  }
326
326
  }
327
- const Ue = 1024;
328
- class Oe {
329
- constructor(e, n = Ue) {
327
+ const Ke = 1024;
328
+ class Ne {
329
+ constructor(e, n = Ke) {
330
330
  this.data = e, this.len = e.length, this.blockSize = n, this.nBlocks = Math.ceil(e.length / n), this.blocks = new Float64Array(this.nBlocks * 2), this.buildAll();
331
331
  }
332
332
  /** Build min/max for all blocks */
@@ -335,8 +335,8 @@ class Oe {
335
335
  for (let l = 0; l < s; l++) {
336
336
  const r = l * n, a = Math.min(r + n, i);
337
337
  let c = 1 / 0, u = -1 / 0;
338
- for (let h = r; h < a; h++) {
339
- const f = e[h];
338
+ for (let d = r; d < a; d++) {
339
+ const f = e[d];
340
340
  f != null && (f < c && (c = f), f > u && (u = f));
341
341
  }
342
342
  o[l * 2] = c, o[l * 2 + 1] = u;
@@ -352,24 +352,24 @@ class Oe {
352
352
  const a = Math.floor(e / o), c = Math.floor(n / o);
353
353
  if (a === c) {
354
354
  for (let f = e; f <= n; f++) {
355
- const d = s[f];
356
- d != null && (d < l && (l = d), d > r && (r = d));
355
+ const g = s[f];
356
+ g != null && (g < l && (l = g), g > r && (r = g));
357
357
  }
358
358
  return [l, r];
359
359
  }
360
360
  const u = (a + 1) * o - 1;
361
361
  for (let f = e; f <= u; f++) {
362
- const d = s[f];
363
- d != null && (d < l && (l = d), d > r && (r = d));
362
+ const g = s[f];
363
+ g != null && (g < l && (l = g), g > r && (r = g));
364
364
  }
365
365
  for (let f = a + 1; f < c; f++) {
366
- const d = i[f * 2] ?? 1 / 0, y = i[f * 2 + 1] ?? -1 / 0;
367
- d < l && (l = d), y > r && (r = y);
366
+ const g = i[f * 2] ?? 1 / 0, M = i[f * 2 + 1] ?? -1 / 0;
367
+ g < l && (l = g), M > r && (r = M);
368
368
  }
369
- const h = c * o;
370
- for (let f = h; f <= n; f++) {
371
- const d = s[f];
372
- d != null && (d < l && (l = d), d > r && (r = d));
369
+ const d = c * o;
370
+ for (let f = d; f <= n; f++) {
371
+ const g = s[f];
372
+ g != null && (g < l && (l = g), g > r && (r = g));
373
373
  }
374
374
  return [l, r];
375
375
  }
@@ -383,8 +383,8 @@ class Oe {
383
383
  const l = e * s, r = Math.min(l + s, i);
384
384
  let a = 1 / 0, c = -1 / 0;
385
385
  for (let u = l; u < r; u++) {
386
- const h = n[u];
387
- h != null && (h < a && (a = h), h > c && (c = h));
386
+ const d = n[u];
387
+ d != null && (d < a && (a = d), d > c && (c = d));
388
388
  }
389
389
  o[e * 2] = a, o[e * 2 + 1] = c;
390
390
  }
@@ -407,7 +407,7 @@ class Oe {
407
407
  this.data = e;
408
408
  }
409
409
  }
410
- class Ne {
410
+ class Oe {
411
411
  constructor() {
412
412
  this.data = [], this.windows = /* @__PURE__ */ new Map(), this.minMaxCache = /* @__PURE__ */ new Map(), this.blockTrees = /* @__PURE__ */ new Map();
413
413
  }
@@ -425,7 +425,7 @@ class Ne {
425
425
  if (!i) return;
426
426
  const l = i.series[n];
427
427
  if (!(!l || l.length === 0))
428
- return o = new Oe(l), this.blockTrees.set(s, o), o;
428
+ return o = new Ne(l), this.blockTrees.set(s, o), o;
429
429
  }
430
430
  /**
431
431
  * Update the visible window for each xGroup based on its x-scale range.
@@ -446,8 +446,8 @@ class Ne {
446
446
  a = 0, c = 0;
447
447
  else {
448
448
  a = ct(l.min, u), c = ct(l.max, u);
449
- const h = u[a], f = u[c];
450
- a > 0 && h != null && h > l.min && a--, c < u.length - 1 && f != null && f < l.max && c++;
449
+ const d = u[a], f = u[c];
450
+ a > 0 && d != null && d > l.min && a--, c < u.length - 1 && f != null && f < l.max && c++;
451
451
  }
452
452
  }
453
453
  (!r || r[0] !== a || r[1] !== c) && (n = !0, (s = this.minMaxCache.get(o)) == null || s.clear()), this.windows.set(o, [a, c]);
@@ -474,17 +474,17 @@ class Ne {
474
474
  let r = this.minMaxCache.get(e);
475
475
  const a = `${n}:${s}:${o}`;
476
476
  if (r) {
477
- const d = r.get(a);
478
- if (d != null) return d;
477
+ const g = r.get(a);
478
+ if (g != null) return g;
479
479
  } else
480
480
  r = /* @__PURE__ */ new Map(), this.minMaxCache.set(e, r);
481
481
  const c = this.data[e];
482
482
  if (!c) return [1 / 0, -1 / 0];
483
483
  const u = c.series[n];
484
484
  if (!u || u.length === 0) return [1 / 0, -1 / 0];
485
- let h;
485
+ let d;
486
486
  const f = !l && i === yt.Unsorted ? this.getOrBuildTree(e, n) : void 0;
487
- return f ? h = f.rangeMinMax(s, o) : h = Fe(u, s, o, i, l), r.set(a, h), h;
487
+ return f ? d = f.rangeMinMax(s, o) : d = Re(u, s, o, i, l), r.set(a, d), d;
488
488
  }
489
489
  /** Get block tree for a series (exposed for incremental append) */
490
490
  getBlockTree(e, n) {
@@ -512,8 +512,8 @@ class Ne {
512
512
  if (!a || !Array.isArray(a)) continue;
513
513
  const c = s[r];
514
514
  if (c)
515
- for (let h = 0; h < c.length; h++)
516
- a.push(c[h] ?? null);
515
+ for (let d = 0; d < c.length; d++)
516
+ a.push(c[d] ?? null);
517
517
  const u = this.blockTrees.get(`${e}:${r}`);
518
518
  u && (u.setData(a), u.grow(a.length));
519
519
  }
@@ -530,7 +530,7 @@ class Ne {
530
530
  return e;
531
531
  }
532
532
  }
533
- class Ke {
533
+ class je {
534
534
  constructor() {
535
535
  this.state = {
536
536
  left: -10,
@@ -556,39 +556,44 @@ class Ke {
556
556
  */
557
557
  update(e, n, s, o, i, l, r, a) {
558
558
  this.state.left = e, this.state.top = n;
559
- let c = 1 / 0, u = -1, h = -1, f = -1;
560
- for (let d = 0; d < o.length; d++) {
561
- const y = o[d];
562
- if (y == null) continue;
563
- const S = y.x;
564
- if (S.length === 0) continue;
565
- const p = a(d);
566
- if (p == null) continue;
567
- const g = l(p);
568
- if (g == null || g.min == null || g.max == null) continue;
569
- const [I, L] = r(d), P = s.width, T = s.left, M = it(e + T, g, P, T), w = ct(M, S, I, L), b = [w];
570
- w > I && b.push(w - 1), w < L && b.push(w + 1);
571
- const k = /* @__PURE__ */ new Map();
572
- for (const D of b) {
573
- const m = S[D];
574
- if (m == null) continue;
575
- const v = V(m, g, P, T);
576
- for (const x of i) {
577
- if (x.group !== d || x.show === !1) continue;
578
- const C = y.series[x.index];
579
- if (C == null) continue;
580
- const z = C[D];
581
- if (z == null) continue;
582
- let A = k.get(x.yScale);
583
- if (A == null && !k.has(x.yScale) && (A = l(x.yScale), k.set(x.yScale, A)), A == null || A.min == null || A.max == null) continue;
584
- const F = s.height, _ = s.top, R = V(z, A, F, _), B = e + T - v, $ = n + _ - R, W = B * B + $ * $;
585
- if (W < c && (c = W, u = d, h = x.index, f = D, W === 0))
559
+ let c = 1 / 0, u = -1, d = -1, f = -1;
560
+ const g = /* @__PURE__ */ new Map();
561
+ for (const M of i) {
562
+ if (M.show === !1) continue;
563
+ let b = g.get(M.group);
564
+ b == null && (b = [], g.set(M.group, b)), b.push(M);
565
+ }
566
+ for (let M = 0; M < o.length; M++) {
567
+ const b = o[M];
568
+ if (b == null) continue;
569
+ const P = b.x;
570
+ if (P.length === 0) continue;
571
+ const h = a(M);
572
+ if (h == null) continue;
573
+ const C = l(h);
574
+ if (C == null || C.min == null || C.max == null) continue;
575
+ const [I, L] = r(M), T = s.width, x = s.left, m = it(e + x, C, T, x), S = ct(m, P, I, L), y = [S];
576
+ S > I && y.push(S - 1), S < L && y.push(S + 1);
577
+ const z = /* @__PURE__ */ new Map();
578
+ for (const p of y) {
579
+ const w = P[p];
580
+ if (w == null) continue;
581
+ const v = H(w, C, T, x);
582
+ for (const k of g.get(M) ?? []) {
583
+ const D = b.series[k.index];
584
+ if (D == null) continue;
585
+ const A = D[p];
586
+ if (A == null) continue;
587
+ let F = z.get(k.yScale);
588
+ if (F == null && !z.has(k.yScale) && (F = l(k.yScale), z.set(k.yScale, F)), F == null || F.min == null || F.max == null) continue;
589
+ const R = s.height, _ = s.top, V = H(A, F, R, _), B = e + x - v, W = n + _ - V, j = B * B + W * W;
590
+ if (j < c && (c = j, u = M, d = k.index, f = p, j === 0))
586
591
  break;
587
592
  }
588
593
  if (c === 0) break;
589
594
  }
590
595
  }
591
- this.state.activeGroup = u, this.state.activeSeriesIdx = h, this.state.activeDataIdx = f;
596
+ this.state.activeGroup = u, this.state.activeSeriesIdx = d, this.state.activeDataIdx = f;
592
597
  }
593
598
  /**
594
599
  * Sync cursor to a specific x-value (from another chart in a sync group).
@@ -605,27 +610,27 @@ class Ke {
605
610
  if (l == null || l.min == null || l.max == null) return;
606
611
  const [r, a] = n.dataStore.getWindow(0), c = ct(e, o.x, r, a), u = o.x[c];
607
612
  if (u == null) return;
608
- const h = V(u, l, n.plotBox.width, n.plotBox.left);
609
- this.state.left = h - n.plotBox.left, this.state.activeGroup = 0, this.state.activeDataIdx = c;
610
- let f = 0, d = n.plotBox.height / 2;
611
- for (const y of n.seriesConfigs) {
612
- if (y.group !== 0 || y.show === !1) continue;
613
- const S = o.series[y.index];
614
- if (S == null) continue;
615
- const p = S[c];
616
- if (p == null) continue;
617
- const g = n.scaleManager.getScale(y.yScale);
618
- if (!(g == null || g.min == null || g.max == null)) {
619
- d = V(p, g, n.plotBox.height, n.plotBox.top) - n.plotBox.top, f = y.index;
613
+ const d = H(u, l, n.plotBox.width, n.plotBox.left);
614
+ this.state.left = d - n.plotBox.left, this.state.activeGroup = 0, this.state.activeDataIdx = c;
615
+ let f = 0, g = n.plotBox.height / 2;
616
+ for (const M of n.seriesConfigs) {
617
+ if (M.group !== 0 || M.show === !1) continue;
618
+ const b = o.series[M.index];
619
+ if (b == null) continue;
620
+ const P = b[c];
621
+ if (P == null) continue;
622
+ const h = n.scaleManager.getScale(M.yScale);
623
+ if (!(h == null || h.min == null || h.max == null)) {
624
+ g = H(P, h, n.plotBox.height, n.plotBox.top) - n.plotBox.top, f = M.index;
620
625
  break;
621
626
  }
622
627
  }
623
- this.state.top = d, this.state.activeSeriesIdx = f;
628
+ this.state.top = g, this.state.activeSeriesIdx = f;
624
629
  }
625
630
  }
626
- class je {
631
+ class qe {
627
632
  constructor() {
628
- this.flags = Q.None, this.frameId = null, this.callback = null;
633
+ this.flags = tt.None, this.frameId = null, this.callback = null;
629
634
  }
630
635
  /** Mark one or more dirty flags */
631
636
  mark(e) {
@@ -641,7 +646,7 @@ class je {
641
646
  }
642
647
  /** Clear all flags (called after a redraw) */
643
648
  clear() {
644
- this.flags = Q.None;
649
+ this.flags = tt.None;
645
650
  }
646
651
  /** Set the redraw callback */
647
652
  onRedraw(e) {
@@ -661,47 +666,47 @@ class je {
661
666
  }
662
667
  /** Clean up */
663
668
  dispose() {
664
- this.cancel(), this.callback = null, this.flags = Q.None;
669
+ this.cancel(), this.callback = null, this.flags = tt.None;
665
670
  }
666
671
  }
667
- function _t(t, e, n) {
672
+ function Rt(t, e, n) {
668
673
  t.lineTo(e, n);
669
674
  }
670
- function Rt(t, e, n) {
675
+ function _t(t, e, n) {
671
676
  t.lineTo(n, e);
672
677
  }
673
- function $t(t, e, n, s, o, i) {
678
+ function Xt(t, e, n, s, o, i) {
674
679
  const l = [];
675
680
  let r = -1;
676
- const a = o === O.Forward ? n : s, c = o === O.Forward ? s : n, u = o;
677
- for (let h = a; o === O.Forward ? h <= c : h >= c; h += u)
678
- if (e[h] === null || e[h] === void 0) {
681
+ const a = o === K.Forward ? n : s, c = o === K.Forward ? s : n, u = o;
682
+ for (let d = a; o === K.Forward ? d <= c : d >= c; d += u)
683
+ if (e[d] === null || e[d] === void 0) {
679
684
  if (r === -1) {
680
- const f = Math.max(n, Math.min(h - o, s));
685
+ const f = Math.max(n, Math.min(d - o, s));
681
686
  r = i(t[f]);
682
687
  }
683
688
  } else
684
- r !== -1 && (l.push([r, i(t[h])]), r = -1);
689
+ r !== -1 && (l.push([r, i(t[d])]), r = -1);
685
690
  return r !== -1 && l.push([r, i(t[s])]), l;
686
691
  }
687
692
  function Yt(t, e, n, s, o, i) {
688
693
  const l = new Path2D();
689
694
  let r = e === G.Horizontal ? n : s;
690
695
  const a = e === G.Horizontal ? n + o : s + i, c = e === G.Horizontal ? s : n, u = e === G.Horizontal ? i : o;
691
- for (const [h, f] of t)
692
- h > r && (e === G.Horizontal ? l.rect(r, c, h - r, u) : l.rect(c, r, u, h - r)), r = f;
696
+ for (const [d, f] of t)
697
+ d > r && (e === G.Horizontal ? l.rect(r, c, d - r, u) : l.rect(c, r, u, d - r)), r = f;
693
698
  return r < a && (e === G.Horizontal ? l.rect(r, c, a - r, u) : l.rect(c, r, u, a - r)), l;
694
699
  }
695
- function be(t) {
700
+ function ye(t) {
696
701
  return (e, n, s, o, i, l) => {
697
702
  s !== o && (i !== s && l !== s && t(e, n, s), i !== o && l !== o && t(e, n, o), t(e, n, l));
698
703
  };
699
704
  }
700
- const qe = be(_t), Ze = be(Rt);
701
- function Je() {
702
- return (t, e, n, s, o, i, l, r, a, c, u, h, f) => {
703
- const d = (f == null ? void 0 : f.spanGaps) ?? !1;
704
- if ([a, c] = (s.distr === N.Log ? me : Ft)(e, a, c), a === -1)
705
+ const Ze = ye(Rt), Je = ye(_t);
706
+ function Qe() {
707
+ return (t, e, n, s, o, i, l, r, a, c, u, d, f) => {
708
+ const g = (f == null ? void 0 : f.spanGaps) ?? !1;
709
+ if ([a, c] = (s.distr === O.Log ? we : Ft)(e, a, c), a === -1)
705
710
  return {
706
711
  stroke: new Path2D(),
707
712
  fill: null,
@@ -709,70 +714,85 @@ function Je() {
709
714
  band: null,
710
715
  gaps: null
711
716
  };
712
- const S = (w) => h(V(w, n, o, l)), p = (w) => h(V(w, s, i, r));
713
- let g, I;
714
- n.ori === G.Horizontal ? (g = _t, I = qe) : (g = Rt, I = Ze);
715
- const L = {
717
+ const b = (m) => d(H(m, n, o, l)), P = (m) => d(H(m, s, i, r));
718
+ let h, C;
719
+ n.ori === G.Horizontal ? (h = Rt, C = Ze) : (h = _t, C = Je);
720
+ const I = {
716
721
  stroke: new Path2D(),
717
722
  fill: null,
718
723
  clip: null,
719
724
  band: null,
720
725
  gaps: null
721
- }, P = L.stroke;
726
+ }, L = I.stroke;
722
727
  let T = !1;
723
728
  if (c - a >= o * 4) {
724
- const w = (A) => it(A, n, o, l);
725
- let b = null, k = 0, D = 0, m = 0, v = S(t[u === O.Forward ? a : c]);
726
- const x = S(t[a]), C = S(t[c]);
727
- let z = w(u === O.Forward ? x + 1 : C - 1);
728
- for (let A = u === O.Forward ? a : c; A >= a && A <= c; A += u) {
729
- const F = t[A], R = (u === O.Forward ? F < z : F > z) ? v : S(F), B = e[A];
730
- R === v ? B != null ? (m = B, b == null ? (g(P, R, p(m)), D = b = k = m) : m < b ? b = m : m > k && (k = m)) : B === null && !d && (T = !0) : (b != null && I(P, v, p(b), p(k), p(D), p(m)), B != null ? (m = B, g(P, R, p(m)), b = k = D = m) : (b = null, k = 0, B === null && !d && (T = !0)), v = R, z = w(v + u));
729
+ const m = (A) => it(A, n, o, l);
730
+ let S = null, y = 0, z = 0, p = 0, w = b(t[u === K.Forward ? a : c]);
731
+ const v = b(t[a]), k = b(t[c]);
732
+ let D = m(u === K.Forward ? v + 1 : k - 1);
733
+ for (let A = u === K.Forward ? a : c; A >= a && A <= c; A += u) {
734
+ const F = t[A], _ = (u === K.Forward ? F < D : F > D) ? w : b(F), V = e[A];
735
+ _ === w ? V != null ? (p = V, S == null ? (h(L, _, P(p)), z = S = y = p) : p < S ? S = p : p > y && (y = p)) : V === null && !g && (T = !0) : (S != null && C(L, w, P(S), P(y), P(z), P(p)), V != null ? (p = V, h(L, _, P(p)), S = y = z = p) : (S = null, y = 0, V === null && !g && (T = !0)), w = _, D = m(w + u));
731
736
  }
732
- b != null && (b !== k ? I(P, v, p(b), p(k), p(D), p(m)) : g(P, v, p(m)));
737
+ S != null && (S !== y ? C(L, w, P(S), P(y), P(z), P(p)) : h(L, w, P(p)));
733
738
  } else
734
- for (let w = u === O.Forward ? a : c; w >= a && w <= c; w += u) {
735
- const b = e[w];
736
- b === null && !d ? T = !0 : b != null && g(P, S(t[w]), p(b));
739
+ for (let m = u === K.Forward ? a : c; m >= a && m <= c; m += u) {
740
+ const S = e[m];
741
+ S === null && !g ? T = !0 : S != null && h(L, b(t[m]), P(S));
737
742
  }
738
743
  {
739
- const w = L.fill = new Path2D(P), b = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, k = p(b);
740
- let D = l, m = l + o;
741
- u === O.Backward && ([m, D] = [D, m]), g(w, m, k), g(w, D, k);
744
+ const m = I.fill = new Path2D(L), S = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, y = P(S);
745
+ let z = l, p = l + o;
746
+ u === K.Backward && ([p, z] = [z, p]), h(m, p, y), h(m, z, y);
742
747
  }
743
748
  if (T) {
744
- const w = $t(t, e, a, c, u, S);
745
- L.gaps = w, L.clip = Yt(w, n.ori, l, r, o, i);
749
+ const m = Xt(t, e, a, c, u, b);
750
+ I.gaps = m, I.clip = Yt(m, n.ori, l, r, o, i);
746
751
  }
747
- return L;
752
+ return I;
748
753
  };
749
754
  }
750
- function Qt(t, e, n) {
751
- return typeof e == "string" ? e : Qe(t, e, n);
755
+ const Qt = /* @__PURE__ */ new WeakMap();
756
+ function te(t, e, n) {
757
+ return typeof e == "string" ? e : tn(t, e, n);
752
758
  }
753
- function Qe(t, e, n) {
754
- const s = t.createLinearGradient(0, n.top, 0, n.top + n.height);
755
- for (const [o, i] of e.stops)
756
- s.addColorStop(o, i);
757
- return s;
759
+ function tn(t, e, n) {
760
+ const s = Qt.get(e);
761
+ if (s != null && s.top === n.top && s.height === n.height)
762
+ return s.grad;
763
+ const o = t.createLinearGradient(0, n.top, 0, n.top + n.height);
764
+ for (const [i, l] of e.stops)
765
+ o.addColorStop(i, l);
766
+ return Qt.set(e, { grad: o, top: n.top, height: n.height }), o;
758
767
  }
759
- function tn(t, e, n, s, o) {
768
+ function en(t, e, n, s, o) {
760
769
  if (e.show === !1) return;
761
770
  const i = e.alpha ?? 1;
762
771
  t.save(), i < 1 && (t.globalAlpha = i), n.clip && t.clip(n.clip);
763
772
  const l = o ?? { top: 0, width: t.canvas.width / s, height: t.canvas.height / s };
764
- if (e.fill && n.fill && (t.fillStyle = Qt(t, e.fill, l), t.fill(n.fill)), e.stroke) {
773
+ if (e.fill && n.fill && (t.fillStyle = te(t, e.fill, l), t.fill(n.fill)), e.stroke) {
765
774
  const r = (e.width ?? 1) * s;
766
- t.strokeStyle = Qt(t, e.stroke, l), t.lineWidth = r, t.lineJoin = e.join ?? "round", t.lineCap = e.cap ?? "butt", e.dash && t.setLineDash(e.dash.map((h) => h * s));
775
+ t.strokeStyle = te(t, e.stroke, l), t.lineWidth = r, t.lineJoin = e.join ?? "round", t.lineCap = e.cap ?? "butt", e.dash && t.setLineDash(e.dash.map((d) => d * s));
767
776
  const a = e.pxAlign ?? 1, c = r % 2 / 2;
768
777
  a === 1 && c > 0 && t.translate(c, c), t.stroke(n.stroke);
769
778
  }
770
779
  t.restore();
771
780
  }
772
- const en = Je(), te = 64;
773
- class nn {
781
+ const nn = Qe(), ee = 64;
782
+ class sn {
774
783
  constructor() {
775
- this.ctx = null, this.pxRatio = 1, this.pathCache = /* @__PURE__ */ new Map(), this.pathCacheSize = 0, this.lruOrder = [], this.snapshotCanvas = null, this.snapshotValid = !1, this.cachedFillStyle = "", this.cachedStrokeStyle = "", this.cachedLineWidth = -1, this.cachedFont = "", this.cachedTextAlign = "", this.cachedTextBaseline = "", this.cachedGlobalAlpha = -1;
784
+ this.ctx = null, this.pxRatio = 1, this.pathCache = /* @__PURE__ */ new Map(), this.pathCacheSize = 0, this.bandCache = /* @__PURE__ */ new Map(), this.lruHead = null, this.lruTail = null, this.lruMap = /* @__PURE__ */ new Map(), this.snapshotCanvas = null, this.snapshotValid = !1, this.cachedFillStyle = "", this.cachedStrokeStyle = "", this.cachedLineWidth = -1, this.cachedFont = "", this.cachedTextAlign = "", this.cachedTextBaseline = "", this.cachedGlobalAlpha = -1;
785
+ }
786
+ lruKey(e, n, s) {
787
+ return `${e}:${n}:${s}`;
788
+ }
789
+ /** Unlink a node from the doubly-linked list */
790
+ lruUnlink(e) {
791
+ e.prev != null ? e.prev.next = e.next : this.lruHead = e.next, e.next != null ? e.next.prev = e.prev : this.lruTail = e.prev, e.prev = null, e.next = null;
792
+ }
793
+ /** Append a node to the tail (most-recently-used) */
794
+ lruAppend(e) {
795
+ e.prev = this.lruTail, e.next = null, this.lruTail != null ? this.lruTail.next = e : this.lruHead = e, this.lruTail = e;
776
796
  }
777
797
  setContext(e, n) {
778
798
  this.ctx = e, this.pxRatio = n, this.resetPropertyCache();
@@ -837,52 +857,82 @@ class nn {
837
857
  if (l == null) return;
838
858
  const r = this.windowKey(s, o), a = l.get(r);
839
859
  if (a != null) {
840
- const c = this.lruOrder.findIndex((u) => u.group === e && u.index === n && u.key === r);
841
- if (c >= 0) {
842
- const u = this.lruOrder.splice(c, 1)[0];
843
- u != null && this.lruOrder.push(u);
844
- }
860
+ const c = this.lruMap.get(this.lruKey(e, n, r));
861
+ c != null && c !== this.lruTail && (this.lruUnlink(c), this.lruAppend(c));
845
862
  }
846
863
  return a;
847
864
  }
848
865
  /** Store paths in cache, evicting oldest 25% when at capacity */
849
866
  setCachedPaths(e, n, s, o, i) {
850
- if (this.pathCacheSize >= te) {
851
- const c = te >> 2, u = this.lruOrder.splice(0, c);
852
- for (const h of u) {
853
- const f = this.pathCache.get(h.group);
854
- if (f == null) continue;
855
- const d = f.get(h.index);
856
- d != null && (d.delete(h.key), this.pathCacheSize--, d.size === 0 && f.delete(h.index), f.size === 0 && this.pathCache.delete(h.group));
867
+ if (this.pathCacheSize >= ee) {
868
+ const u = ee >> 2;
869
+ let d = this.lruHead;
870
+ for (let f = 0; f < u && d != null; f++) {
871
+ const g = d.next, M = this.pathCache.get(d.group);
872
+ if (M != null) {
873
+ const b = M.get(d.index);
874
+ b != null && (b.delete(d.key), this.pathCacheSize--, b.size === 0 && M.delete(d.index), M.size === 0 && this.pathCache.delete(d.group));
875
+ }
876
+ this.lruMap.delete(this.lruKey(d.group, d.index, d.key)), d = g;
857
877
  }
878
+ this.lruHead = d, d != null ? d.prev = null : this.lruTail = null;
858
879
  }
859
880
  let l = this.pathCache.get(e);
860
881
  l == null && (l = /* @__PURE__ */ new Map(), this.pathCache.set(e, l));
861
882
  let r = l.get(n);
862
883
  r == null && (r = /* @__PURE__ */ new Map(), l.set(n, r));
863
- const a = this.windowKey(s, o);
864
- r.has(a) || (this.pathCacheSize++, this.lruOrder.push({ group: e, index: n, key: a })), r.set(a, i);
884
+ const a = this.windowKey(s, o), c = this.lruKey(e, n, a);
885
+ if (!r.has(a)) {
886
+ this.pathCacheSize++;
887
+ const u = { group: e, index: n, key: a, prev: null, next: null };
888
+ this.lruAppend(u), this.lruMap.set(c, u);
889
+ }
890
+ r.set(a, i);
865
891
  }
866
892
  /** Invalidate paths for a specific series (all windows) */
867
893
  invalidateSeries(e, n) {
868
894
  const s = this.pathCache.get(e);
869
895
  if (s == null) return;
870
896
  const o = s.get(n);
871
- o != null && (this.pathCacheSize -= o.size, s.delete(n), this.lruOrder = this.lruOrder.filter((i) => !(i.group === e && i.index === n)));
897
+ if (o != null) {
898
+ this.pathCacheSize -= o.size;
899
+ for (const i of o.keys()) {
900
+ const l = this.lruKey(e, n, i), r = this.lruMap.get(l);
901
+ r != null && (this.lruUnlink(r), this.lruMap.delete(l));
902
+ }
903
+ s.delete(n);
904
+ }
872
905
  }
873
906
  /** Invalidate cached paths for a specific group */
874
907
  clearGroupCache(e) {
875
908
  const n = this.pathCache.get(e);
876
909
  if (n != null) {
877
- for (const s of n.values())
878
- this.pathCacheSize -= s.size;
879
- this.pathCache.delete(e), this.lruOrder = this.lruOrder.filter((s) => s.group !== e);
910
+ for (const [s, o] of n.entries()) {
911
+ this.pathCacheSize -= o.size;
912
+ for (const i of o.keys()) {
913
+ const l = this.lruKey(e, s, i), r = this.lruMap.get(l);
914
+ r != null && (this.lruUnlink(r), this.lruMap.delete(l));
915
+ }
916
+ }
917
+ this.pathCache.delete(e);
880
918
  }
919
+ for (const s of this.bandCache.keys())
920
+ s.startsWith(`${e}:`) && this.bandCache.delete(s);
881
921
  this.snapshotValid = !1;
882
922
  }
883
923
  /** Invalidate all cached paths (e.g. on scale change) */
884
924
  clearCache() {
885
- this.pathCache.clear(), this.pathCacheSize = 0, this.lruOrder.length = 0, this.snapshotValid = !1;
925
+ this.pathCache.clear(), this.pathCacheSize = 0, this.lruHead = null, this.lruTail = null, this.lruMap.clear(), this.bandCache.clear(), this.snapshotValid = !1;
926
+ }
927
+ // --- Band path cache ---
928
+ bandKey(e, n, s, o, i) {
929
+ return `${e}:${n}:${s}:${o}:${i}`;
930
+ }
931
+ getCachedBandPath(e, n, s, o, i) {
932
+ return this.bandCache.get(this.bandKey(e, n, s, o, i));
933
+ }
934
+ setCachedBandPath(e, n, s, o, i, l) {
935
+ this.bandCache.set(this.bandKey(e, n, s, o, i), l);
886
936
  }
887
937
  /**
888
938
  * Draw a single series onto the canvas (assumes context is already clipped).
@@ -894,7 +944,7 @@ class nn {
894
944
  const i = e.config.group, l = e.config.index, [r, a] = e.window;
895
945
  let c = this.getCachedPaths(i, l, r, a);
896
946
  if (c == null) {
897
- const u = e.config.paths ?? en, h = e.xScale.dir, f = (S) => H(S), d = e.config.fillTo, y = typeof d == "function" ? d(e.yScale.min ?? 0, e.yScale.max ?? 0) : d;
947
+ const u = e.config.paths ?? nn, d = e.xScale.dir, f = (b) => $(b), g = e.config.fillTo, M = typeof g == "function" ? g(e.yScale.min ?? 0, e.yScale.max ?? 0) : g;
898
948
  c = u(
899
949
  e.dataX,
900
950
  e.dataY,
@@ -906,12 +956,12 @@ class nn {
906
956
  n.top,
907
957
  r,
908
958
  a,
909
- h,
959
+ d,
910
960
  f,
911
- { fillTo: y, spanGaps: e.config.spanGaps }
961
+ { fillTo: M, spanGaps: e.config.spanGaps }
912
962
  ), this.setCachedPaths(i, l, r, a, c);
913
963
  }
914
- tn(o, e.config, c, s, n);
964
+ en(o, e.config, c, s, n);
915
965
  }
916
966
  /**
917
967
  * Full draw cycle: clear canvas and draw all series.
@@ -926,36 +976,36 @@ class nn {
926
976
  i.restore(), this.resetPropertyCache();
927
977
  }
928
978
  }
929
- const ye = [1, 2, 2.5, 5], sn = ve(10, -32, 0, ye), on = ve(10, 0, 32, ye), ft = sn.concat(on);
930
- function ln(t, e, n, s, o) {
979
+ const ke = [1, 2, 2.5, 5], on = Me(10, -32, 0, ke), ln = Me(10, 0, 32, ke), ft = on.concat(ln);
980
+ function rn(t, e, n, s, o) {
931
981
  if (n <= 0 || e < t) return [];
932
- const i = [], l = xt.get(n) ?? 0, r = o ? t : ut(Xt(t, n), l);
982
+ const i = [], l = Mt.get(n) ?? 0, r = o ? t : ut(Et(t, n), l);
933
983
  for (let a = r; a <= e; a = ut(a + n, l))
934
984
  i.push(Object.is(a, -0) ? 0 : a);
935
985
  return i;
936
986
  }
937
- function ee(t) {
987
+ function ne(t) {
938
988
  return t.map((e) => xe(e));
939
989
  }
940
- function rn(t, e, n) {
990
+ function an(t, e, n) {
941
991
  if (t <= 0 || e <= 0 || t >= e) return [];
942
- const s = [], i = nt((n === 10 ? tt : St)(t));
992
+ const s = [], i = st((n === 10 ? et : bt)(t));
943
993
  let l = wt(n, i);
944
994
  n === 10 && (l = ft[ct(l, ft)] ?? l);
945
995
  let r = l, a = l * n;
946
996
  n === 10 && (a = ft[ct(a, ft)] ?? a);
947
997
  let c = 0;
948
998
  do {
949
- if (r >= t && s.push(r), r = r + l, n === 10 && !xt.has(r)) {
950
- const u = xt.get(l) ?? 0;
999
+ if (r >= t && s.push(r), r = r + l, n === 10 && !Mt.has(r)) {
1000
+ const u = Mt.get(l) ?? 0;
951
1001
  r = ut(r, u);
952
1002
  }
953
1003
  r >= a * (1 - 1e-10) && (l = r, a = l * n, n === 10 && (a = ft[ct(a, ft)] ?? a));
954
1004
  } while (r <= e && ++c < 1e4);
955
1005
  return s;
956
1006
  }
957
- function an(t, e) {
958
- const n = e === 10 ? tt : St;
1007
+ function cn(t, e) {
1008
+ const n = e === 10 ? et : bt;
959
1009
  return t.map((s) => {
960
1010
  if (s === 0) return !0;
961
1011
  if (s < 0) return !1;
@@ -963,36 +1013,36 @@ function an(t, e) {
963
1013
  return gt(o - Math.round(o)) < 1e-10;
964
1014
  });
965
1015
  }
966
- function cn(t, e) {
1016
+ function un(t, e) {
967
1017
  const s = xe(Math.max(Math.abs(t), Math.abs(e))).length * 7;
968
1018
  return Math.max(50, s + 16);
969
1019
  }
970
- function un(t, e, n, s) {
1020
+ function fn(t, e, n, s) {
971
1021
  if (s <= 0)
972
1022
  return [0, 0];
973
- const o = Mt(t.side) === G.Vertical, i = t.space ?? (o ? 30 : cn(e, n)), l = t.incrs ?? ft;
974
- return Ee(e, n, l, s, i);
1023
+ const o = xt(t.side) === G.Vertical, i = t.space ?? (o ? 30 : un(e, n)), l = t.incrs ?? ft;
1024
+ return We(e, n, l, s, i);
975
1025
  }
976
- const fn = 50;
977
- function hn(t, e, n) {
1026
+ const hn = 50;
1027
+ function dn(t, e, n) {
978
1028
  var r, a;
979
1029
  if (t.size != null)
980
1030
  return t.size;
981
1031
  const s = ((r = t.ticks) == null ? void 0 : r.show) !== !1 ? ((a = t.ticks) == null ? void 0 : a.size) ?? 10 : 0, o = t.gap ?? 5, i = 12;
982
- if (Mt(t.side) === G.Vertical && e != null) {
1032
+ if (xt(t.side) === G.Vertical && e != null) {
983
1033
  let c = 0;
984
- for (const h of e)
985
- h.length > c && (c = h.length);
1034
+ for (const d of e)
1035
+ d.length > c && (c = d.length);
986
1036
  const u = c * 7;
987
1037
  return Math.max(50, s + o + u + 4);
988
1038
  }
989
1039
  return Math.max(50, s + o + i + 3);
990
1040
  }
991
- function dn(t) {
1041
+ function gn(t) {
992
1042
  return {
993
1043
  config: t,
994
1044
  _show: t.show !== !1,
995
- _size: t.size ?? fn,
1045
+ _size: t.size ?? hn,
996
1046
  _pos: 0,
997
1047
  _lpos: 0,
998
1048
  _splits: null,
@@ -1002,7 +1052,7 @@ function dn(t) {
1002
1052
  _rotate: 0
1003
1053
  };
1004
1054
  }
1005
- const mt = 60, ht = 3600, rt = 86400, dt = 2592e3, At = 31536e3, gn = [
1055
+ const mt = 60, ht = 3600, rt = 86400, dt = 2592e3, At = 31536e3, pn = [
1006
1056
  // Seconds
1007
1057
  1,
1008
1058
  5,
@@ -1036,7 +1086,7 @@ const mt = 60, ht = 3600, rt = 86400, dt = 2592e3, At = 31536e3, gn = [
1036
1086
  // Years
1037
1087
  At
1038
1088
  ];
1039
- function pn(t, e, n, s) {
1089
+ function mn(t, e, n, s) {
1040
1090
  const o = [];
1041
1091
  if (n <= 0 || t >= e) return o;
1042
1092
  let i;
@@ -1070,39 +1120,39 @@ function pn(t, e, n, s) {
1070
1120
  }
1071
1121
  return o;
1072
1122
  }
1073
- const ne = /* @__PURE__ */ new Map();
1074
- function mn(t, e) {
1123
+ const se = /* @__PURE__ */ new Map();
1124
+ function wn(t, e) {
1075
1125
  const n = JSON.stringify(t) + (e ?? "");
1076
- let s = ne.get(n);
1077
- return s == null && (s = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }), ne.set(n, s)), s;
1126
+ let s = se.get(n);
1127
+ return s == null && (s = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }), se.set(n, s)), s;
1078
1128
  }
1079
- function et(t, e, n) {
1129
+ function nt(t, e, n) {
1080
1130
  const s = new Date(t * 1e3);
1081
- return mn(e, n).format(s);
1082
- }
1083
- function wn(t, e) {
1084
- return et(t, { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1131
+ return wn(e, n).format(s);
1085
1132
  }
1086
1133
  function vn(t, e) {
1087
- return et(t, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1134
+ return nt(t, { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1135
+ }
1136
+ function Mn(t, e) {
1137
+ return nt(t, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
1088
1138
  }
1089
1139
  function xn(t, e) {
1090
- return et(t, { hour: "2-digit", minute: "2-digit", hour12: !1 }, e);
1140
+ return nt(t, { hour: "2-digit", minute: "2-digit", hour12: !1 }, e);
1091
1141
  }
1092
- function Mn(t, e) {
1093
- return et(t, { month: "short", day: "numeric" }, e);
1142
+ function bn(t, e) {
1143
+ return nt(t, { month: "short", day: "numeric" }, e);
1094
1144
  }
1095
1145
  function Sn(t, e) {
1096
- return et(t, { year: "numeric" }, e);
1146
+ return nt(t, { year: "numeric" }, e);
1097
1147
  }
1098
- function bn(t, e) {
1099
- return et(t, { year: "numeric", month: "short" }, e);
1148
+ function yn(t, e) {
1149
+ return nt(t, { year: "numeric", month: "short" }, e);
1100
1150
  }
1101
- function yn(t, e, n) {
1151
+ function kn(t, e, n) {
1102
1152
  let s;
1103
- return e >= At ? s = Sn : e >= dt ? s = bn : e >= rt ? s = Mn : e >= ht ? s = xn : e >= mt ? s = vn : s = wn, t.map((o) => s(o, n));
1153
+ return e >= At ? s = Sn : e >= dt ? s = yn : e >= rt ? s = bn : e >= ht ? s = xn : e >= mt ? s = Mn : s = vn, t.map((o) => s(o, n));
1104
1154
  }
1105
- function kn(t, e, n, s, o) {
1155
+ function Cn(t, e, n, s, o) {
1106
1156
  const i = e - t;
1107
1157
  if (i <= 0 || s <= 0) return [0, 0];
1108
1158
  for (const r of n) {
@@ -1113,8 +1163,8 @@ function kn(t, e, n, s, o) {
1113
1163
  const l = n[n.length - 1] ?? At;
1114
1164
  return [l, s / (i / l)];
1115
1165
  }
1116
- const Cn = 3;
1117
- function Tn(t, e, n, s, o) {
1166
+ const Tn = 3;
1167
+ function In(t, e, n, s, o) {
1118
1168
  let i = !0;
1119
1169
  for (const l of t) {
1120
1170
  const r = l.config;
@@ -1126,47 +1176,47 @@ function Tn(t, e, n, s, o) {
1126
1176
  continue;
1127
1177
  } else
1128
1178
  l._show || (i = !1, l._show = !0);
1129
- const c = r.side, h = Mt(c) === G.Horizontal ? n : s, { min: f, max: d } = a;
1130
- let y, S;
1179
+ const c = r.side, d = xt(c) === G.Horizontal ? n : s, { min: f, max: g } = a;
1180
+ let M, b;
1131
1181
  if (a.time) {
1132
- const g = r.space ?? 80;
1133
- [y, S] = kn(f, d, gn, h, g);
1182
+ const h = r.space ?? 80;
1183
+ [M, b] = Cn(f, g, pn, d, h);
1134
1184
  } else
1135
- [y, S] = un(r, f, d, h);
1136
- if (l._incr = y, l._space = S, S === 0)
1185
+ [M, b] = fn(r, f, g, d);
1186
+ if (l._incr = M, l._space = b, b === 0)
1137
1187
  continue;
1138
1188
  if (r.splits)
1139
- l._splits = r.splits(f, d, y, S);
1189
+ l._splits = r.splits(f, g, M, b);
1140
1190
  else if (a.time)
1141
- l._splits = pn(f, d, y);
1142
- else if (a.distr === N.Log)
1143
- l._splits = rn(f, d, a.log);
1191
+ l._splits = mn(f, g, M);
1192
+ else if (a.distr === O.Log)
1193
+ l._splits = an(f, g, a.log);
1144
1194
  else {
1145
- const g = a.distr === N.Ordinal;
1146
- l._splits = ln(f, d, y, S, g);
1195
+ const h = a.distr === O.Ordinal;
1196
+ l._splits = rn(f, g, M, b, h);
1147
1197
  }
1148
1198
  if (r.values)
1149
- l._values = r.values(l._splits, S, y);
1199
+ l._values = r.values(l._splits, b, M);
1150
1200
  else if (a.time)
1151
- l._values = yn(l._splits, y);
1152
- else if (a.distr === N.Log) {
1153
- const g = an(l._splits, a.log), I = ee(l._splits);
1154
- l._values = I.map((L, P) => g[P] ? L : "");
1201
+ l._values = kn(l._splits, M);
1202
+ else if (a.distr === O.Log) {
1203
+ const h = cn(l._splits, a.log), C = ne(l._splits);
1204
+ l._values = C.map((I, L) => h[L] ? I : "");
1155
1205
  } else
1156
- l._values = ee(l._splits);
1206
+ l._values = ne(l._splits);
1157
1207
  l._rotate = c === U.Bottom ? r.rotate ?? 0 : 0;
1158
- const p = l._size;
1159
- l._size = Tt(hn(r, l._values)), p !== l._size && (i = !1);
1208
+ const P = l._size;
1209
+ l._size = Tt(dn(r, l._values)), P !== l._size && (i = !1);
1160
1210
  }
1161
1211
  return i;
1162
1212
  }
1163
- function se(t, e, n) {
1213
+ function oe(t, e, n) {
1164
1214
  let s = t, o = e, i = 0, l = 0;
1165
1215
  for (const r of n) {
1166
1216
  if (!r._show)
1167
1217
  continue;
1168
- const a = r.config.side, c = Mt(a) === G.Vertical, u = r.config.label != null ? r.config.labelSize ?? 20 : 0, h = r._size + u;
1169
- h > 0 && (c ? (s -= h, a === U.Left && (i += h)) : (o -= h, a === U.Top && (l += h)));
1218
+ const a = r.config.side, c = xt(a) === G.Vertical, u = r.config.label != null ? r.config.labelSize ?? 20 : 0, d = r._size + u;
1219
+ d > 0 && (c ? (s -= d, a === U.Left && (i += d)) : (o -= d, a === U.Top && (l += d)));
1170
1220
  }
1171
1221
  return {
1172
1222
  left: i,
@@ -1175,7 +1225,7 @@ function se(t, e, n) {
1175
1225
  height: Math.max(o, 0)
1176
1226
  };
1177
1227
  }
1178
- function In(t, e) {
1228
+ function An(t, e) {
1179
1229
  let n = e.top, s = e.left + e.width, o = e.top + e.height, i = e.left;
1180
1230
  function l(r, a) {
1181
1231
  switch (r) {
@@ -1205,91 +1255,97 @@ function In(t, e) {
1205
1255
  }
1206
1256
  }
1207
1257
  }
1208
- function An(t, e, n, s) {
1258
+ function Pn(t, e, n, s) {
1209
1259
  for (const r of n)
1210
1260
  r._size = 0;
1211
1261
  let o = !1, i = 0, l = { left: 0, top: 0, width: t, height: e };
1212
1262
  for (; !o; ) {
1213
1263
  i++;
1214
- const r = Tn(
1264
+ const r = In(
1215
1265
  n,
1216
1266
  s,
1217
1267
  l.width,
1218
1268
  l.height
1219
1269
  );
1220
- o = i === Cn || r, o || (l = se(t, e, n));
1270
+ o = i === Tn || r, o || (l = oe(t, e, n));
1221
1271
  }
1222
- return l = se(t, e, n), In(n, l), l;
1272
+ return l = oe(t, e, n), An(n, l), l;
1223
1273
  }
1224
- const oe = "top", le = "bottom", Pn = "left", Ln = "right";
1225
- function ie(t, e) {
1274
+ const le = "top", ie = "bottom", Ln = "left", zn = "right";
1275
+ function re(t, e) {
1226
1276
  return e === 1 ? t : t.replace(/(\d+(?:\.\d+)?)px/, (n, s) => `${Math.round(Number(s) * e)}px`);
1227
1277
  }
1228
- function re(t, e, n, s, o, i, l, r, a, c, u) {
1229
- const h = r % 2 / 2;
1230
- t.save(), t.translate(h, h), t.strokeStyle = a, t.lineWidth = r, c.length > 0 && t.setLineDash(c), t.beginPath();
1231
- let f = 0, d = 0, y = 0, S = 0;
1232
- const p = i + (o === U.Top || o === U.Left ? -l : l);
1233
- s === G.Horizontal ? (d = i, S = p) : (f = i, y = p);
1234
- for (let g = 0; g < e.length; g++)
1235
- n[g] != null && (s === G.Horizontal ? f = y = e[g] ?? 0 : d = S = e[g] ?? 0, t.moveTo(f, d), t.lineTo(y, S));
1278
+ function ae(t, e, n, s, o, i, l, r, a, c, u) {
1279
+ const d = r % 2 / 2;
1280
+ t.save(), t.translate(d, d), t.strokeStyle = a, t.lineWidth = r, c.length > 0 && t.setLineDash(c), t.beginPath();
1281
+ let f = 0, g = 0, M = 0, b = 0;
1282
+ const P = i + (o === U.Top || o === U.Left ? -l : l);
1283
+ s === G.Horizontal ? (g = i, b = P) : (f = i, M = P);
1284
+ for (let h = 0; h < e.length; h++)
1285
+ n[h] != null && (s === G.Horizontal ? f = M = e[h] ?? 0 : g = b = e[h] ?? 0, t.moveTo(f, g), t.lineTo(M, b));
1236
1286
  t.stroke(), t.restore();
1237
1287
  }
1238
- function zn(t, e, n, s, o) {
1239
- const i = H(s.left * o), l = H(s.top * o), r = H(s.width * o), a = H(s.height * o);
1288
+ function Dn(t, e, n, s, o) {
1289
+ const i = $(s.left * o), l = $(s.top * o), r = $(s.width * o), a = $(s.height * o);
1240
1290
  for (const c of e) {
1241
1291
  if (!c._show)
1242
1292
  continue;
1243
- const u = c.config, h = u.side, f = Mt(h), d = n(u.scale);
1244
- if (!d || d.min == null || d.max == null)
1293
+ const u = c.config, d = u.side, f = xt(d), g = n(u.scale);
1294
+ if (!g || g.min == null || g.max == null)
1245
1295
  continue;
1246
- const y = u.stroke ?? "#000", S = h === U.Top || h === U.Left ? -1 : 1, p = c._splits, g = c._values;
1247
- if (!p || !g || c._space === 0)
1296
+ const M = u.stroke ?? "#000", b = d === U.Top || d === U.Left ? -1 : 1, P = c._splits, h = c._values;
1297
+ if (!P || !h || c._space === 0)
1248
1298
  continue;
1249
- const I = f === G.Horizontal ? s.width : s.height, L = f === G.Horizontal ? s.left : s.top, P = p.map((k) => H(V(k, d, I, L) * o)), T = g.map((k) => k === "" ? null : k), M = u.grid;
1250
- if ((M == null ? void 0 : M.show) !== !1) {
1251
- const k = (M == null ? void 0 : M.stroke) ?? "rgba(0,0,0,0.12)", D = H(((M == null ? void 0 : M.width) ?? 2) * o), m = ((M == null ? void 0 : M.dash) ?? []).map((C) => C * o), v = f === G.Horizontal ? l : i, x = f === G.Horizontal ? a : r;
1252
- re(t, P, T, f, 2, v, x, D, k, m);
1299
+ const C = f === G.Horizontal ? s.width : s.height, I = f === G.Horizontal ? s.left : s.top, L = P.map((y) => $(H(y, g, C, I) * o)), T = h.map((y) => y === "" ? null : y), x = u.grid;
1300
+ if ((x == null ? void 0 : x.show) !== !1) {
1301
+ const y = (x == null ? void 0 : x.stroke) ?? "rgba(0,0,0,0.12)", z = $(((x == null ? void 0 : x.width) ?? 2) * o), p = ((x == null ? void 0 : x.dash) ?? []).map((k) => k * o), w = f === G.Horizontal ? l : i, v = f === G.Horizontal ? a : r;
1302
+ ae(t, L, T, f, 2, w, v, z, y, p);
1253
1303
  }
1254
- const w = u.ticks;
1255
- if ((w == null ? void 0 : w.show) !== !1) {
1256
- const k = (w == null ? void 0 : w.stroke) ?? y, D = H(((w == null ? void 0 : w.width) ?? 1) * o), m = H(((w == null ? void 0 : w.size) ?? 10) * o), v = ((w == null ? void 0 : w.dash) ?? []).map((C) => C * o), x = H(c._pos * o);
1257
- re(t, P, T, f, h, x, m, D, k, v);
1304
+ const m = u.ticks;
1305
+ if ((m == null ? void 0 : m.show) !== !1) {
1306
+ const y = (m == null ? void 0 : m.stroke) ?? M, z = $(((m == null ? void 0 : m.width) ?? 1) * o), p = $(((m == null ? void 0 : m.size) ?? 10) * o), w = ((m == null ? void 0 : m.dash) ?? []).map((k) => k * o), v = $(c._pos * o);
1307
+ ae(t, L, T, f, d, v, p, z, y, w);
1258
1308
  }
1259
1309
  {
1260
- const k = (w == null ? void 0 : w.show) !== !1 ? ((w == null ? void 0 : w.size) ?? 10) * o : 0, D = H((u.gap ?? 5) * o), m = H(c._pos * o), v = (k + D) * S, x = m + v, C = ie(u.font ?? "12px system-ui, sans-serif", o), z = f === G.Horizontal ? "center" : h === U.Left ? Ln : Pn, A = f === G.Horizontal ? h === U.Bottom ? oe : le : "middle";
1261
- t.font = C, t.fillStyle = y, t.textAlign = z, t.textBaseline = A;
1262
- const F = c._rotate * -Vt / 180;
1263
- for (let _ = 0; _ < g.length; _++) {
1264
- const R = g[_];
1265
- if (R == null || R === "")
1266
- continue;
1267
- const B = P[_] ?? 0;
1268
- if (F !== 0)
1269
- t.save(), t.translate(B, x), t.rotate(F), t.fillText(R, 0, 0), t.restore();
1270
- else {
1271
- const $ = f === G.Horizontal ? B : x, W = f === G.Horizontal ? x : B;
1272
- t.fillText(R, $, W);
1310
+ const y = (m == null ? void 0 : m.show) !== !1 ? ((m == null ? void 0 : m.size) ?? 10) * o : 0, z = $((u.gap ?? 5) * o), p = $(c._pos * o), w = (y + z) * b, v = p + w, k = re(u.font ?? "12px system-ui, sans-serif", o), D = f === G.Horizontal ? "center" : d === U.Left ? zn : Ln, A = f === G.Horizontal ? d === U.Bottom ? le : ie : "middle";
1311
+ t.font = k, t.fillStyle = M, t.textAlign = D, t.textBaseline = A;
1312
+ const F = c._rotate * -Ht / 180;
1313
+ if (F !== 0) {
1314
+ const R = Math.cos(F), _ = Math.sin(F);
1315
+ for (let V = 0; V < h.length; V++) {
1316
+ const B = h[V];
1317
+ if (B == null || B === "")
1318
+ continue;
1319
+ const W = L[V] ?? 0;
1320
+ t.setTransform(R, _, -_, R, W, v), t.fillText(B, 0, 0);
1321
+ }
1322
+ t.setTransform(1, 0, 0, 1, 0, 0);
1323
+ } else
1324
+ for (let R = 0; R < h.length; R++) {
1325
+ const _ = h[R];
1326
+ if (_ == null || _ === "")
1327
+ continue;
1328
+ const V = L[R] ?? 0, B = f === G.Horizontal ? V : v, W = f === G.Horizontal ? v : V;
1329
+ t.fillText(_, B, W);
1273
1330
  }
1274
- }
1275
1331
  }
1276
1332
  if (u.label != null) {
1277
- const k = ie(u.labelFont ?? "bold 12px system-ui, sans-serif", o);
1278
- t.font = k, t.fillStyle = y, t.textAlign = "center", t.textBaseline = h === U.Bottom ? oe : le;
1279
- const D = H((c._lpos + (u.labelGap ?? 0) * S) * o);
1333
+ const y = re(u.labelFont ?? "bold 12px system-ui, sans-serif", o);
1334
+ t.font = y, t.fillStyle = M, t.textAlign = "center", t.textBaseline = d === U.Bottom ? le : ie;
1335
+ const z = $((c._lpos + (u.labelGap ?? 0) * b) * o);
1280
1336
  f === G.Vertical ? (t.save(), t.translate(
1281
- D,
1282
- H(l + a / 2)
1283
- ), t.rotate((h === U.Left ? -Vt : Vt) / 2), t.fillText(u.label, 0, 0), t.restore()) : t.fillText(u.label, H(i + r / 2), D);
1337
+ z,
1338
+ $(l + a / 2)
1339
+ ), t.rotate((d === U.Left ? -Ht : Ht) / 2), t.fillText(u.label, 0, 0), t.restore()) : t.fillText(u.label, $(i + r / 2), z);
1284
1340
  }
1285
- const b = u.border;
1286
- if ((b == null ? void 0 : b.show) !== !1 && b != null) {
1287
- const k = b.stroke ?? y, D = H((b.width ?? 1) * o), m = (b.dash ?? []).map((x) => x * o), v = H(c._pos * o);
1288
- t.strokeStyle = k, t.lineWidth = D, m.length > 0 && t.setLineDash(m), t.beginPath(), f === G.Horizontal ? (t.moveTo(i, v), t.lineTo(i + r, v)) : (t.moveTo(v, l), t.lineTo(v, l + a)), t.stroke(), m.length > 0 && t.setLineDash([]);
1341
+ const S = u.border;
1342
+ if ((S == null ? void 0 : S.show) !== !1 && S != null) {
1343
+ const y = S.stroke ?? M, z = $((S.width ?? 1) * o), p = (S.dash ?? []).map((v) => v * o), w = $(c._pos * o);
1344
+ t.strokeStyle = y, t.lineWidth = z, p.length > 0 && t.setLineDash(p), t.beginPath(), f === G.Horizontal ? (t.moveTo(i, w), t.lineTo(i + r, w)) : (t.moveTo(w, l), t.lineTo(w, l + a)), t.stroke(), p.length > 0 && t.setLineDash([]);
1289
1345
  }
1290
1346
  }
1291
1347
  }
1292
- const Dn = {
1348
+ const Fn = {
1293
1349
  stroke: "#607D8B",
1294
1350
  width: 1,
1295
1351
  dash: [5, 3],
@@ -1297,27 +1353,27 @@ const Dn = {
1297
1353
  showX: !0,
1298
1354
  showY: !0
1299
1355
  };
1300
- function ae(t, e, n, s, o, i, l, r, a) {
1301
- var L;
1356
+ function ce(t, e, n, s, o, i, l, r, a) {
1357
+ var I;
1302
1358
  if (e.left < 0 || e.top < 0) return;
1303
- const c = { ...Dn, ...a }, u = s, h = H(n.left * u), f = H(n.top * u), d = H(n.width * u), y = H(n.height * u), S = H(c.width * u), p = S % 2 / 2, g = H((n.left + e.left) * u) + p, I = H((n.top + e.top) * u) + p;
1304
- if (t.save(), t.strokeStyle = c.stroke, t.lineWidth = S, t.setLineDash(c.dash.map((P) => P * u)), c.showX && (t.beginPath(), t.moveTo(g, f), t.lineTo(g, f + y), t.stroke()), c.showY && (t.beginPath(), t.moveTo(h, I), t.lineTo(h + d, I), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
1305
- const P = e.activeGroup, T = e.activeSeriesIdx, M = e.activeDataIdx, w = o[P];
1306
- if (w != null && T >= 0 && T < w.series.length && M < w.x.length) {
1307
- const b = w.x[M], k = w.series[T], D = k != null ? k[M] : null;
1308
- if (b != null && D != null) {
1309
- let m = c.stroke, v = !0;
1310
- for (const x of i)
1311
- if (x.group === P && x.index === T) {
1312
- const C = x.stroke;
1313
- m = (typeof C == "string" ? C : void 0) ?? c.stroke, v = ((L = x.cursor) == null ? void 0 : L.show) !== !1;
1359
+ const c = { ...Fn, ...a }, u = s, d = $(n.left * u), f = $(n.top * u), g = $(n.width * u), M = $(n.height * u), b = $(c.width * u), P = b % 2 / 2, h = $((n.left + e.left) * u) + P, C = $((n.top + e.top) * u) + P;
1360
+ if (t.save(), t.strokeStyle = c.stroke, t.lineWidth = b, t.setLineDash(c.dash.map((L) => L * u)), c.showX && (t.beginPath(), t.moveTo(h, f), t.lineTo(h, f + M), t.stroke()), c.showY && (t.beginPath(), t.moveTo(d, C), t.lineTo(d + g, C), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
1361
+ const L = e.activeGroup, T = e.activeSeriesIdx, x = e.activeDataIdx, m = o[L];
1362
+ if (m != null && T >= 0 && T < m.series.length && x < m.x.length) {
1363
+ const S = m.x[x], y = m.series[T], z = y != null ? y[x] : null;
1364
+ if (S != null && z != null) {
1365
+ let p = c.stroke, w = !0;
1366
+ for (const v of i)
1367
+ if (v.group === L && v.index === T) {
1368
+ const k = v.stroke;
1369
+ p = (typeof k == "string" ? k : void 0) ?? c.stroke, w = ((I = v.cursor) == null ? void 0 : I.show) !== !1;
1314
1370
  break;
1315
1371
  }
1316
- if (v) {
1317
- const x = r(P), C = x != null ? l(x) : void 0, z = Fn(i, P, T), A = z != null ? l(z) : void 0;
1318
- if (C != null && A != null && C.min != null && C.max != null && A.min != null && A.max != null) {
1319
- const F = H(V(b, C, n.width, n.left) * u), _ = H(V(D, A, n.height, n.top) * u), R = c.pointRadius * u, B = H(2 * u);
1320
- t.beginPath(), t.arc(F, _, R, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = m, t.lineWidth = B, t.stroke();
1372
+ if (w) {
1373
+ const v = r(L), k = v != null ? l(v) : void 0, D = Rn(i, L, T), A = D != null ? l(D) : void 0;
1374
+ if (k != null && A != null && k.min != null && k.max != null && A.min != null && A.max != null) {
1375
+ const F = $(H(S, k, n.width, n.left) * u), R = $(H(z, A, n.height, n.top) * u), _ = c.pointRadius * u, V = $(2 * u);
1376
+ t.beginPath(), t.arc(F, R, _, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = p, t.lineWidth = V, t.stroke();
1321
1377
  }
1322
1378
  }
1323
1379
  }
@@ -1325,7 +1381,7 @@ function ae(t, e, n, s, o, i, l, r, a) {
1325
1381
  }
1326
1382
  t.restore();
1327
1383
  }
1328
- function Fn(t, e, n) {
1384
+ function Rn(t, e, n) {
1329
1385
  for (const s of t)
1330
1386
  if (s.group === e && s.index === n)
1331
1387
  return s.yScale;
@@ -1335,25 +1391,25 @@ const _n = {
1335
1391
  stroke: "rgba(0,0,0,0.15)",
1336
1392
  width: 1
1337
1393
  };
1338
- function ce(t, e, n, s, o) {
1394
+ function ue(t, e, n, s, o) {
1339
1395
  if (!e.show || e.width <= 0) return;
1340
- const i = { ..._n, ...o }, l = s, r = H((n.left + e.left) * l), a = H((n.top + e.top) * l), c = H(e.width * l), u = H(e.height * l);
1341
- t.save(), t.fillStyle = i.fill, t.fillRect(r, a, c, u), i.width > 0 && (t.strokeStyle = i.stroke, t.lineWidth = H(i.width * l), t.strokeRect(r, a, c, u)), t.restore();
1342
- }
1343
- function Rn(t, e, n, s, o, i, l, r, a, c, u, h) {
1344
- const f = u / 2 * l, d = Math.max(1, H(u * 0.2)) * l, y = (c == null ? void 0 : c.stroke) ?? h, S = (c == null ? void 0 : c.fill) ?? "#fff";
1345
- t.save(), t.strokeStyle = y, t.fillStyle = S, t.lineWidth = d, (c == null ? void 0 : c.dash) != null && t.setLineDash(c.dash.map((p) => p * l));
1346
- for (let p = r; p <= a; p++) {
1347
- const g = n[p];
1348
- if (g == null) continue;
1349
- const I = e[p];
1350
- if (I == null) continue;
1351
- const L = H(V(I, s, i.width, i.left) * l), P = H(V(g, o, i.height, i.top) * l);
1352
- t.beginPath(), t.arc(L, P, f, 0, Math.PI * 2), t.fill(), t.stroke();
1396
+ const i = { ..._n, ...o }, l = s, r = $((n.left + e.left) * l), a = $((n.top + e.top) * l), c = $(e.width * l), u = $(e.height * l);
1397
+ t.save(), t.fillStyle = i.fill, t.fillRect(r, a, c, u), i.width > 0 && (t.strokeStyle = i.stroke, t.lineWidth = $(i.width * l), t.strokeRect(r, a, c, u)), t.restore();
1398
+ }
1399
+ function Gn(t, e, n, s, o, i, l, r, a, c, u, d) {
1400
+ const f = u / 2 * l, g = Math.max(1, $(u * 0.2)) * l, M = (c == null ? void 0 : c.stroke) ?? d, b = (c == null ? void 0 : c.fill) ?? "#fff";
1401
+ t.save(), t.strokeStyle = M, t.fillStyle = b, t.lineWidth = g, (c == null ? void 0 : c.dash) != null && t.setLineDash(c.dash.map((P) => P * l));
1402
+ for (let P = r; P <= a; P++) {
1403
+ const h = n[P];
1404
+ if (h == null) continue;
1405
+ const C = e[P];
1406
+ if (C == null) continue;
1407
+ const I = $(H(C, s, i.width, i.left) * l), L = $(H(h, o, i.height, i.top) * l);
1408
+ t.beginPath(), t.arc(I, L, f, 0, Math.PI * 2), t.fill(), t.stroke();
1353
1409
  }
1354
1410
  t.restore();
1355
1411
  }
1356
- function Gn(t, e, n, s, o, i, l) {
1412
+ function Hn(t, e, n, s, o, i, l) {
1357
1413
  if (typeof t == "function")
1358
1414
  return t(e, n, s, o, i);
1359
1415
  if (t === !0) return !0;
@@ -1361,42 +1417,41 @@ function Gn(t, e, n, s, o, i, l) {
1361
1417
  const r = o - s;
1362
1418
  return r > 0 && r <= i / l;
1363
1419
  }
1364
- function Vn(t, e, n, s, o, i, l, r, a, c, u) {
1365
- if (c > u || c < 0) return;
1366
- const h = e.fill ?? "rgba(0, 120, 255, 0.1)", f = (S) => V(S, i, r.width, r.left) * a, d = (S) => V(S, l, r.height, r.top) * a;
1367
- t.save(), t.fillStyle = h, t.beginPath();
1368
- let y = !1;
1369
- for (let S = c; S <= u; S++) {
1370
- const p = s[S], g = n[S];
1371
- if (p == null || g == null) continue;
1372
- const I = f(g), L = d(p);
1373
- y ? t.lineTo(I, L) : (t.moveTo(I, L), y = !0);
1374
- }
1375
- if (!y) {
1376
- t.restore();
1377
- return;
1420
+ function Vn(t, e, n, s, o, i, l, r, a) {
1421
+ if (r > a || r < 0) return null;
1422
+ const c = (g) => H(g, s, i.width, i.left) * l, u = (g) => H(g, o, i.height, i.top) * l, d = new Path2D();
1423
+ let f = !1;
1424
+ for (let g = r; g <= a; g++) {
1425
+ const M = e[g], b = t[g];
1426
+ if (M == null || b == null) continue;
1427
+ const P = c(b), h = u(M);
1428
+ f ? d.lineTo(P, h) : (d.moveTo(P, h), f = !0);
1378
1429
  }
1379
- for (let S = u; S >= c; S--) {
1380
- const p = o[S], g = n[S];
1381
- p == null || g == null || t.lineTo(f(g), d(p));
1430
+ if (!f) return null;
1431
+ for (let g = a; g >= r; g--) {
1432
+ const M = n[g], b = t[g];
1433
+ M == null || b == null || d.lineTo(c(b), u(M));
1382
1434
  }
1383
- t.closePath(), t.fill(), t.restore();
1435
+ return d.closePath(), d;
1384
1436
  }
1385
- function Bt(t, e, n, s) {
1437
+ function $n(t, e, n) {
1438
+ t.save(), t.fillStyle = e.fill ?? "rgba(0, 120, 255, 0.1)", t.fill(n), t.restore();
1439
+ }
1440
+ function $t(t, e, n, s) {
1386
1441
  return { ctx: t, plotBox: e, pxRatio: n, getScale: s, valToX: (l, r = "x") => {
1387
1442
  const a = s(r);
1388
- return a == null || a.min == null || a.max == null ? null : V(l, a, e.width, e.left);
1443
+ return a == null || a.min == null || a.max == null ? null : H(l, a, e.width, e.left);
1389
1444
  }, valToY: (l, r) => {
1390
1445
  const a = s(r);
1391
- return a == null || a.min == null || a.max == null ? null : V(l, a, e.height, e.top);
1446
+ return a == null || a.min == null || a.max == null ? null : H(l, a, e.height, e.top);
1392
1447
  } };
1393
1448
  }
1394
- function Hn() {
1449
+ function Bn() {
1395
1450
  const t = {
1396
- scaleManager: new Ye(),
1397
- dataStore: new Ne(),
1398
- renderer: new nn(),
1399
- cursorManager: new Ke(),
1451
+ scaleManager: new Ue(),
1452
+ dataStore: new Oe(),
1453
+ renderer: new sn(),
1454
+ cursorManager: new je(),
1400
1455
  selectState: { show: !1, left: 0, top: 0, width: 0, height: 0 },
1401
1456
  scaleConfigs: [],
1402
1457
  seriesConfigs: [],
@@ -1409,7 +1464,7 @@ function Hn() {
1409
1464
  plotBox: { left: 0, top: 0, width: 0, height: 0 },
1410
1465
  canvas: null,
1411
1466
  listeners: /* @__PURE__ */ new Set(),
1412
- scheduler: new je(),
1467
+ scheduler: new qe(),
1413
1468
  drawHooks: /* @__PURE__ */ new Set(),
1414
1469
  cursorDrawHooks: /* @__PURE__ */ new Set(),
1415
1470
  focusedSeries: null,
@@ -1445,10 +1500,10 @@ function Hn() {
1445
1500
  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(), t.scheduleRedraw();
1446
1501
  },
1447
1502
  scheduleRedraw() {
1448
- t.scheduler.mark(Q.Full);
1503
+ t.scheduler.mark(tt.Full);
1449
1504
  },
1450
1505
  scheduleCursorRedraw() {
1451
- t.scheduler.mark(Q.Cursor);
1506
+ t.scheduler.mark(tt.Cursor);
1452
1507
  },
1453
1508
  subscribe(e) {
1454
1509
  return t.listeners.add(e), () => {
@@ -1461,100 +1516,102 @@ function Hn() {
1461
1516
  const u = a.getContext("2d");
1462
1517
  if (u == null) return;
1463
1518
  s.setContext(u, r);
1464
- const f = (c.dirty & ~(Q.Cursor | Q.Select)) === 0, d = (p) => e.getScale(p);
1519
+ const f = (c.dirty & ~(tt.Cursor | tt.Select)) === 0, g = (h) => e.getScale(h);
1465
1520
  if (f && s.restoreSnapshot(u)) {
1466
- if (ae(
1521
+ if (ce(
1467
1522
  u,
1468
1523
  t.cursorManager.state,
1469
1524
  t.plotBox,
1470
1525
  r,
1471
1526
  n.data,
1472
1527
  o,
1473
- d,
1474
- (p) => e.getGroupXScaleKey(p)
1475
- ), ce(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
1528
+ g,
1529
+ (h) => e.getGroupXScaleKey(h)
1530
+ ), ue(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
1476
1531
  u.save(), u.scale(r, r);
1477
- const p = Bt(u, t.plotBox, r, d);
1478
- for (const g of t.cursorDrawHooks)
1532
+ const h = $t(u, t.plotBox, r, g);
1533
+ for (const C of t.cursorDrawHooks)
1479
1534
  try {
1480
- g(p, t.cursorManager.state);
1535
+ C(h, t.cursorManager.state);
1481
1536
  } catch (I) {
1482
1537
  console.warn("[uPlot+] draw hook error:", I);
1483
1538
  }
1484
1539
  u.restore();
1485
1540
  }
1486
- for (const p of t.listeners) p();
1541
+ for (const h of t.listeners) h();
1487
1542
  return;
1488
1543
  }
1489
- e.autoRangeX(n.data), n.updateWindows((p) => {
1490
- const g = e.getGroupXScaleKey(p);
1491
- return g != null ? e.getScale(g) : void 0;
1544
+ e.autoRangeX(n.data), n.updateWindows((h) => {
1545
+ const C = e.getGroupXScaleKey(h);
1546
+ return C != null ? e.getScale(C) : void 0;
1492
1547
  });
1493
- const y = o.map((p) => ({
1494
- group: p.group,
1495
- index: p.index,
1496
- yScale: p.yScale
1548
+ const M = o.map((h) => ({
1549
+ group: h.group,
1550
+ index: h.index,
1551
+ yScale: h.yScale
1497
1552
  }));
1498
- e.autoRange(n.data, y, n), Bn(t), t.axisStates.length > 0 ? t.plotBox = An(i, l, t.axisStates, d) : t.plotBox = {
1553
+ e.autoRange(n.data, M, n), Wn(t), t.axisStates.length > 0 ? t.plotBox = Pn(i, l, t.axisStates, g) : t.plotBox = {
1499
1554
  left: 10,
1500
1555
  top: 10,
1501
1556
  width: i - 20,
1502
1557
  height: l - 20
1503
- }, u.clearRect(0, 0, i * r, l * r), t.axisStates.length > 0 && zn(u, t.axisStates, d, t.plotBox, r);
1504
- const S = [];
1505
- for (const p of o) {
1506
- const g = e.getGroupXScaleKey(p.group), I = g != null ? e.getScale(g) : void 0, L = e.getScale(p.yScale);
1507
- I == null || L == null || S.push({
1508
- config: p,
1509
- dataX: n.getXValues(p.group),
1510
- dataY: n.getYValues(p.group, p.index),
1558
+ }, u.clearRect(0, 0, i * r, l * r), t.axisStates.length > 0 && Dn(u, t.axisStates, g, t.plotBox, r);
1559
+ const b = [];
1560
+ for (const h of o) {
1561
+ const C = e.getGroupXScaleKey(h.group), I = C != null ? e.getScale(C) : void 0, L = e.getScale(h.yScale);
1562
+ I == null || L == null || b.push({
1563
+ config: h,
1564
+ dataX: n.getXValues(h.group),
1565
+ dataY: n.getYValues(h.group, h.index),
1511
1566
  xScale: I,
1512
1567
  yScale: L,
1513
- window: n.getWindow(p.group)
1568
+ window: n.getWindow(h.group)
1514
1569
  });
1515
1570
  }
1516
1571
  u.save(), u.scale(r, r), u.beginPath(), u.rect(t.plotBox.left, t.plotBox.top, t.plotBox.width, t.plotBox.height), u.clip();
1517
- for (let p = 0; p < S.length; p++) {
1518
- const g = S[p];
1519
- g != null && (t.focusedSeries != null && p !== t.focusedSeries ? (u.globalAlpha = t.focusAlpha, s.drawSeries(g, t.plotBox, 1), u.globalAlpha = 1) : s.drawSeries(g, t.plotBox, 1));
1572
+ for (let h = 0; h < b.length; h++) {
1573
+ const C = b[h];
1574
+ C != null && (t.focusedSeries != null && h !== t.focusedSeries ? (u.globalAlpha = t.focusAlpha, s.drawSeries(C, t.plotBox, 1), u.globalAlpha = 1) : s.drawSeries(C, t.plotBox, 1));
1520
1575
  }
1521
- for (const p of t.bandConfigs) {
1522
- const g = e.getGroupXScaleKey(p.group), I = g != null ? e.getScale(g) : void 0, L = o.find((b) => b.group === p.group && b.index === p.series[0]), P = o.find((b) => b.group === p.group && b.index === p.series[1]);
1523
- if (I == null || L == null || P == null) continue;
1524
- const T = e.getScale(L.yScale);
1525
- if (T == null) continue;
1526
- const [M, w] = n.getWindow(p.group);
1527
- Vn(
1528
- u,
1529
- p,
1530
- n.getXValues(p.group),
1531
- n.getYValues(p.group, p.series[0]),
1532
- n.getYValues(p.group, p.series[1]),
1576
+ const P = /* @__PURE__ */ new Map();
1577
+ for (const h of o)
1578
+ P.set(`${h.group}-${h.index}`, h);
1579
+ for (const h of t.bandConfigs) {
1580
+ const C = e.getGroupXScaleKey(h.group), I = C != null ? e.getScale(C) : void 0, L = P.get(`${h.group}-${h.series[0]}`), T = P.get(`${h.group}-${h.series[1]}`);
1581
+ if (I == null || L == null || T == null) continue;
1582
+ const x = e.getScale(L.yScale);
1583
+ if (x == null) continue;
1584
+ const [m, S] = n.getWindow(h.group), y = h.series[0], z = h.series[1];
1585
+ let p = s.getCachedBandPath(h.group, y, z, m, S);
1586
+ p == null && (p = Vn(
1587
+ n.getXValues(h.group),
1588
+ n.getYValues(h.group, y),
1589
+ n.getYValues(h.group, z),
1533
1590
  I,
1534
- T,
1591
+ x,
1535
1592
  t.plotBox,
1536
1593
  r,
1537
- M,
1538
- w
1539
- );
1594
+ m,
1595
+ S
1596
+ ) ?? void 0, p != null && s.setCachedBandPath(h.group, y, z, m, S, p)), p != null && $n(u, h, p);
1540
1597
  }
1541
- for (const p of S) {
1542
- const g = p.config;
1543
- if (g.show === !1) continue;
1544
- const I = g.points, L = g.width ?? 1, P = (I == null ? void 0 : I.size) ?? 3 + L * 2, T = (I == null ? void 0 : I.space) ?? P * 2, [M, w] = p.window;
1545
- Gn(I == null ? void 0 : I.show, g.group, g.index, M, w, t.plotBox.width, T) && Rn(
1598
+ for (const h of b) {
1599
+ const C = h.config;
1600
+ if (C.show === !1) continue;
1601
+ const I = C.points, L = C.width ?? 1, T = (I == null ? void 0 : I.size) ?? 3 + L * 2, x = (I == null ? void 0 : I.space) ?? T * 2, [m, S] = h.window;
1602
+ Hn(I == null ? void 0 : I.show, C.group, C.index, m, S, t.plotBox.width, x) && Gn(
1546
1603
  u,
1547
- p.dataX,
1548
- p.dataY,
1549
- p.xScale,
1550
- p.yScale,
1604
+ h.dataX,
1605
+ h.dataY,
1606
+ h.xScale,
1607
+ h.yScale,
1551
1608
  t.plotBox,
1552
1609
  r,
1553
- M,
1554
- w,
1610
+ m,
1611
+ S,
1555
1612
  I,
1556
- P,
1557
- (typeof g.stroke == "string" ? g.stroke : null) ?? "#000"
1613
+ T,
1614
+ (typeof C.stroke == "string" ? C.stroke : null) ?? "#000"
1558
1615
  );
1559
1616
  }
1560
1617
  if (u.restore(), t.drawHooks.size > 0) {
@@ -1564,10 +1621,10 @@ function Hn() {
1564
1621
  t.plotBox.width * r,
1565
1622
  t.plotBox.height * r
1566
1623
  ), u.clip(), u.scale(r, r);
1567
- const p = Bt(u, t.plotBox, r, d);
1568
- for (const g of t.drawHooks)
1624
+ const h = $t(u, t.plotBox, r, g);
1625
+ for (const C of t.drawHooks)
1569
1626
  try {
1570
- g(p);
1627
+ C(h);
1571
1628
  } catch (I) {
1572
1629
  console.warn("[uPlot+] draw hook error:", I);
1573
1630
  }
@@ -1579,175 +1636,175 @@ function Hn() {
1579
1636
  t.plotBox,
1580
1637
  n.data,
1581
1638
  o,
1582
- d,
1583
- (p) => n.getWindow(p),
1584
- (p) => e.getGroupXScaleKey(p)
1585
- )), ae(
1639
+ g,
1640
+ (h) => n.getWindow(h),
1641
+ (h) => e.getGroupXScaleKey(h)
1642
+ )), ce(
1586
1643
  u,
1587
1644
  t.cursorManager.state,
1588
1645
  t.plotBox,
1589
1646
  r,
1590
1647
  n.data,
1591
1648
  o,
1592
- d,
1593
- (p) => e.getGroupXScaleKey(p)
1594
- ), ce(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
1649
+ g,
1650
+ (h) => e.getGroupXScaleKey(h)
1651
+ ), ue(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
1595
1652
  u.save(), u.scale(r, r);
1596
- const p = Bt(u, t.plotBox, r, d);
1597
- for (const g of t.cursorDrawHooks)
1653
+ const h = $t(u, t.plotBox, r, g);
1654
+ for (const C of t.cursorDrawHooks)
1598
1655
  try {
1599
- g(p, t.cursorManager.state);
1656
+ C(h, t.cursorManager.state);
1600
1657
  } catch (I) {
1601
1658
  console.warn("[uPlot+] draw hook error:", I);
1602
1659
  }
1603
1660
  u.restore();
1604
1661
  }
1605
- for (const p of t.listeners) p();
1662
+ for (const h of t.listeners) h();
1606
1663
  if (t._prevScaleRanges.size > 0 && t.eventCallbacks.onScaleChange != null)
1607
- for (const p of e.getAllScales()) {
1608
- if (p.min == null || p.max == null) continue;
1609
- const g = t._prevScaleRanges.get(p.id);
1610
- if (g == null || g.min !== p.min || g.max !== p.max)
1664
+ for (const h of e.getAllScales()) {
1665
+ if (h.min == null || h.max == null) continue;
1666
+ const C = t._prevScaleRanges.get(h.id);
1667
+ if (C == null || C.min !== h.min || C.max !== h.max)
1611
1668
  try {
1612
- t.eventCallbacks.onScaleChange(p.id, p.min, p.max);
1669
+ t.eventCallbacks.onScaleChange(h.id, h.min, h.max);
1613
1670
  } catch (I) {
1614
1671
  console.warn("[uPlot+] event callback error:", I);
1615
1672
  }
1616
1673
  }
1617
1674
  t._prevScaleRanges.clear();
1618
- for (const p of e.getAllScales())
1619
- p.min != null && p.max != null && t._prevScaleRanges.set(p.id, { min: p.min, max: p.max });
1675
+ for (const h of e.getAllScales())
1676
+ h.min != null && h.max != null && t._prevScaleRanges.set(h.id, { min: h.min, max: h.max });
1620
1677
  }
1621
1678
  };
1622
1679
  return t.scheduler.onRedraw(() => t.redraw()), t;
1623
1680
  }
1624
- function Bn(t) {
1681
+ function Wn(t) {
1625
1682
  const { axisConfigs: e, axisStates: n } = t, s = /* @__PURE__ */ new Map();
1626
1683
  for (const o of n)
1627
1684
  s.set(`${o.config.scale}:${o.config.side}`, o);
1628
1685
  t.axisStates = e.map((o) => {
1629
1686
  const i = `${o.scale}:${o.side}`, l = s.get(i);
1630
- return l != null ? (l.config = o, l) : dn(o);
1687
+ return l != null ? (l.config = o, l) : gn(o);
1631
1688
  });
1632
1689
  }
1633
1690
  function En() {
1634
1691
  const t = X(null);
1635
- return t.current === null && (t.current = Hn()), t.current;
1692
+ return t.current === null && (t.current = Bn()), t.current;
1636
1693
  }
1637
- const ke = Le(null);
1638
- function st() {
1639
- const t = Pe(ke);
1694
+ const Ce = ze(null);
1695
+ function ot() {
1696
+ const t = Le(Ce);
1640
1697
  if (!t)
1641
1698
  throw new Error("useChart must be used within a <Chart> component");
1642
1699
  return t;
1643
1700
  }
1644
- function Wn(t, e) {
1701
+ function Xn(t, e) {
1645
1702
  Y(() => {
1646
1703
  if (e != null)
1647
- return Xn(t, e);
1704
+ return Yn(t, e);
1648
1705
  }, [t, e]);
1649
1706
  }
1650
- function Xn(t, e) {
1707
+ function Yn(t, e) {
1651
1708
  let n = null;
1652
1709
  const s = { show: !1, left: 0, top: 0, width: 0, height: 0 };
1653
1710
  let o = null, i = null, l = !1;
1654
- function r(m) {
1655
- const v = e.getBoundingClientRect(), x = t.plotBox, C = m.clientX - v.left - x.left, z = m.clientY - v.top - x.top;
1656
- return { cx: C, cy: z };
1711
+ function r(p) {
1712
+ const w = e.getBoundingClientRect(), v = t.plotBox, k = p.clientX - w.left - v.left, D = p.clientY - w.top - v.top;
1713
+ return { cx: k, cy: D };
1657
1714
  }
1658
- function a(m, v) {
1659
- const x = t.plotBox;
1660
- return m >= 0 && m <= x.width && v >= 0 && v <= x.height;
1715
+ function a(p, w) {
1716
+ const v = t.plotBox;
1717
+ return p >= 0 && p <= v.width && w >= 0 && w <= v.height;
1661
1718
  }
1662
- function c(m, v) {
1663
- const x = e.getBoundingClientRect(), C = m - x.left, z = v - x.top, A = t.plotBox;
1719
+ function c(p, w) {
1720
+ const v = e.getBoundingClientRect(), k = p - v.left, D = w - v.top, A = t.plotBox;
1664
1721
  for (const F of t.axisStates) {
1665
- const _ = F.config, R = _.side;
1722
+ const R = F.config, _ = R.side;
1666
1723
  if (F._size <= 0) continue;
1667
- const $ = z >= A.top && z <= A.top + A.height, W = C >= A.left && C <= A.left + A.width;
1668
- if (R === U.Left && C < A.left && $ || R === U.Right && C > A.left + A.width && $ || R === U.Top && z < A.top && W || R === U.Bottom && z > A.top + A.height && W) {
1669
- const Z = Mt(R);
1670
- return { scaleId: _.scale, ori: Z };
1724
+ const B = D >= A.top && D <= A.top + A.height, W = k >= A.left && k <= A.left + A.width;
1725
+ if (_ === U.Left && k < A.left && B || _ === U.Right && k > A.left + A.width && B || _ === U.Top && D < A.top && W || _ === U.Bottom && D > A.top + A.height && W) {
1726
+ const Z = xt(_);
1727
+ return { scaleId: R.scale, ori: Z };
1671
1728
  }
1672
1729
  }
1673
1730
  return null;
1674
1731
  }
1675
- function u(m, v, x) {
1676
- const C = t.cursorManager.state;
1677
- let z = null;
1678
- if (C.activeGroup >= 0 && C.activeDataIdx >= 0) {
1679
- const A = t.dataStore.data[C.activeGroup];
1732
+ function u(p, w, v) {
1733
+ const k = t.cursorManager.state;
1734
+ let D = null;
1735
+ if (k.activeGroup >= 0 && k.activeDataIdx >= 0) {
1736
+ const A = t.dataStore.data[k.activeGroup];
1680
1737
  if (A != null) {
1681
- const F = A.x[C.activeDataIdx], _ = A.series[C.activeSeriesIdx], R = _ != null ? _[C.activeDataIdx] : void 0;
1682
- if (F != null && R != null) {
1683
- const B = t.plotBox, $ = t.scaleManager.getGroupXScaleKey(C.activeGroup), W = $ != null ? t.scaleManager.getScale($) : void 0, ot = t.seriesConfigs.find(
1684
- (jt) => jt.group === C.activeGroup && jt.index === C.activeSeriesIdx
1685
- ), Z = ot != null ? t.scaleManager.getScale(ot.yScale) : void 0;
1686
- let pt = v, Gt = x;
1687
- (W == null ? void 0 : W.min) != null && W.max != null && (pt = V(F, W, B.width, B.left) - B.left), (Z == null ? void 0 : Z.min) != null && Z.max != null && (Gt = V(R, Z, B.height, B.top) - B.top);
1688
- const Nt = v - pt, Kt = x - Gt;
1689
- z = {
1690
- group: C.activeGroup,
1691
- seriesIdx: C.activeSeriesIdx,
1692
- dataIdx: C.activeDataIdx,
1738
+ const F = A.x[k.activeDataIdx], R = A.series[k.activeSeriesIdx], _ = R != null ? R[k.activeDataIdx] : void 0;
1739
+ if (F != null && _ != null) {
1740
+ const V = t.plotBox, B = t.scaleManager.getGroupXScaleKey(k.activeGroup), W = B != null ? t.scaleManager.getScale(B) : void 0, j = t.seriesConfigs.find(
1741
+ (jt) => jt.group === k.activeGroup && jt.index === k.activeSeriesIdx
1742
+ ), Z = j != null ? t.scaleManager.getScale(j.yScale) : void 0;
1743
+ let pt = w, Gt = v;
1744
+ (W == null ? void 0 : W.min) != null && W.max != null && (pt = H(F, W, V.width, V.left) - V.left), (Z == null ? void 0 : Z.min) != null && Z.max != null && (Gt = H(_, Z, V.height, V.top) - V.top);
1745
+ const Nt = w - pt, Ot = v - Gt;
1746
+ D = {
1747
+ group: k.activeGroup,
1748
+ seriesIdx: k.activeSeriesIdx,
1749
+ dataIdx: k.activeDataIdx,
1693
1750
  xVal: F,
1694
- yVal: R,
1751
+ yVal: _,
1695
1752
  pxX: pt,
1696
1753
  pxY: Gt,
1697
- dist: Math.sqrt(Nt * Nt + Kt * Kt)
1754
+ dist: Math.sqrt(Nt * Nt + Ot * Ot)
1698
1755
  };
1699
1756
  }
1700
1757
  }
1701
1758
  }
1702
- return { plotX: v, plotY: x, point: z, srcEvent: m };
1759
+ return { plotX: w, plotY: v, point: D, srcEvent: p };
1703
1760
  }
1704
- function h(m) {
1705
- const v = t.plotBox, x = m.left / v.width, C = (m.left + m.width) / v.width, z = {};
1761
+ function d(p) {
1762
+ const w = t.plotBox, v = p.left / w.width, k = (p.left + p.width) / w.width, D = {};
1706
1763
  for (const A of t.scaleManager.getAllScales()) {
1707
1764
  if (A.ori !== G.Horizontal || A.min == null || A.max == null) continue;
1708
1765
  const F = it(
1709
- v.left + x * v.width,
1766
+ w.left + v * w.width,
1710
1767
  A,
1711
- v.width,
1712
- v.left
1713
- ), _ = it(
1714
- v.left + C * v.width,
1768
+ w.width,
1769
+ w.left
1770
+ ), R = it(
1771
+ w.left + k * w.width,
1715
1772
  A,
1716
- v.width,
1717
- v.left
1773
+ w.width,
1774
+ w.left
1718
1775
  );
1719
- z[A.id] = {
1720
- min: Math.min(F, _),
1721
- max: Math.max(F, _)
1776
+ D[A.id] = {
1777
+ min: Math.min(F, R),
1778
+ max: Math.max(F, R)
1722
1779
  };
1723
1780
  }
1724
- return { left: x, right: C, ranges: z };
1781
+ return { left: v, right: k, ranges: D };
1725
1782
  }
1726
1783
  function f() {
1727
- const m = t.eventCallbacks.onScaleChange;
1728
- if (m != null)
1729
- for (const v of t.scaleManager.getAllScales()) {
1730
- if (v.min == null || v.max == null) continue;
1731
- const x = t._prevScaleRanges.get(v.id);
1732
- (x == null || x.min !== v.min || x.max !== v.max) && m(v.id, v.min, v.max);
1784
+ const p = t.eventCallbacks.onScaleChange;
1785
+ if (p != null)
1786
+ for (const w of t.scaleManager.getAllScales()) {
1787
+ if (w.min == null || w.max == null) continue;
1788
+ const v = t._prevScaleRanges.get(w.id);
1789
+ (v == null || v.min !== w.min || v.max !== w.max) && p(w.id, w.min, w.max);
1733
1790
  }
1734
1791
  }
1735
- function d(m, v) {
1792
+ function g(p, w) {
1736
1793
  if (i != null) {
1737
- const A = e.getBoundingClientRect(), F = m.clientY - A.top, _ = t.plotBox, R = (F - i.startY) / _.height, B = i.startMax - i.startMin, $ = t.scaleManager.getScale(i.scaleId);
1738
- $ != null && ($.min = i.startMin + R * B, $.max = i.startMax + R * B, $.auto = !1, at($), t.renderer.clearCache(), t.scheduleRedraw());
1794
+ const A = e.getBoundingClientRect(), F = p.clientY - A.top, R = t.plotBox, _ = (F - i.startY) / R.height, V = i.startMax - i.startMin, B = t.scaleManager.getScale(i.scaleId);
1795
+ B != null && (B.min = i.startMin + _ * V, B.max = i.startMax + _ * V, B.auto = !1, at(B), t.renderer.clearCache(), t.scheduleRedraw());
1739
1796
  return;
1740
1797
  }
1741
- const x = r(m);
1742
- if (x == null) return;
1743
- const { cx: C, cy: z } = x;
1744
- if (!a(C, z) && n == null) {
1798
+ const v = r(p);
1799
+ if (v == null) return;
1800
+ const { cx: k, cy: D } = v;
1801
+ if (!a(k, D) && n == null) {
1745
1802
  t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw();
1746
1803
  return;
1747
1804
  }
1748
1805
  if (t.cursorManager.update(
1749
- C,
1750
- z,
1806
+ k,
1807
+ D,
1751
1808
  t.plotBox,
1752
1809
  t.dataStore.data,
1753
1810
  t.seriesConfigs,
@@ -1758,46 +1815,46 @@ function Xn(t, e) {
1758
1815
  const A = t.cursorManager.state;
1759
1816
  if (A.activeGroup >= 0 && A.activeSeriesIdx >= 0) {
1760
1817
  const F = t.seriesConfigs.findIndex(
1761
- (_) => _.group === A.activeGroup && _.index === A.activeSeriesIdx
1818
+ (R) => R.group === A.activeGroup && R.index === A.activeSeriesIdx
1762
1819
  );
1763
- F >= 0 && t.focusedSeries !== F && (t.focusedSeries = F, t.renderer.clearCache(), t.scheduleRedraw());
1820
+ F >= 0 && t.focusedSeries !== F && (t.focusedSeries = F, t.scheduleRedraw());
1764
1821
  }
1765
1822
  }
1766
- if (v != null && t.eventCallbacks.onCursorMove != null && a(C, z))
1823
+ if (w != null && t.eventCallbacks.onCursorMove != null && a(k, D))
1767
1824
  try {
1768
- t.eventCallbacks.onCursorMove(u(v, C, z));
1825
+ t.eventCallbacks.onCursorMove(u(w, k, D));
1769
1826
  } catch (A) {
1770
1827
  console.warn("[uPlot+] event callback error:", A);
1771
1828
  }
1772
1829
  if (n != null) {
1773
- const A = n.x, F = t.plotBox, _ = Math.max(0, Math.min(C, F.width));
1774
- s.show = !0, s.left = Math.min(A, _), s.top = 0, s.width = Math.abs(_ - A), s.height = F.height, t.selectState = s;
1830
+ const A = n.x, F = t.plotBox, R = Math.max(0, Math.min(k, F.width));
1831
+ s.show = !0, s.left = Math.min(A, R), s.top = 0, s.width = Math.abs(R - A), s.height = F.height, t.selectState = s;
1775
1832
  }
1776
- n != null ? t.scheduler.mark(Q.Cursor | Q.Select) : t.scheduleCursorRedraw();
1833
+ n != null ? t.scheduler.mark(tt.Cursor | tt.Select) : t.scheduleCursorRedraw();
1777
1834
  }
1778
- function y(m) {
1779
- d(m, m);
1835
+ function M(p) {
1836
+ g(p, p);
1780
1837
  }
1781
- function S(m) {
1782
- if (m.button !== 0) return;
1783
- const v = c(m.clientX, m.clientY);
1784
- if (v != null && v.ori === G.Vertical) {
1785
- const C = t.scaleManager.getScale(v.scaleId);
1786
- if (C != null && C.min != null && C.max != null) {
1787
- const z = e.getBoundingClientRect();
1838
+ function b(p) {
1839
+ if (p.button !== 0) return;
1840
+ const w = c(p.clientX, p.clientY);
1841
+ if (w != null && w.ori === G.Vertical) {
1842
+ const k = t.scaleManager.getScale(w.scaleId);
1843
+ if (k != null && k.min != null && k.max != null) {
1844
+ const D = e.getBoundingClientRect();
1788
1845
  i = {
1789
- scaleId: v.scaleId,
1790
- startY: m.clientY - z.top,
1791
- startMin: C.min,
1792
- startMax: C.max
1793
- }, m.preventDefault();
1846
+ scaleId: w.scaleId,
1847
+ startY: p.clientY - D.top,
1848
+ startMin: k.min,
1849
+ startMax: k.max
1850
+ }, p.preventDefault();
1794
1851
  return;
1795
1852
  }
1796
1853
  }
1797
- const x = r(m);
1798
- x != null && a(x.cx, x.cy) && (n = { x: x.cx, y: x.cy }, l = !1, s.show = !1, s.left = 0, s.width = 0, t.selectState = s);
1854
+ const v = r(p);
1855
+ v != null && a(v.cx, v.cy) && (n = { x: v.cx, y: v.cy }, l = !1, s.show = !1, s.left = 0, s.width = 0, t.selectState = s);
1799
1856
  }
1800
- function p(m) {
1857
+ function P(p) {
1801
1858
  if (i != null) {
1802
1859
  f(), i = null;
1803
1860
  return;
@@ -1805,159 +1862,159 @@ function Xn(t, e) {
1805
1862
  if (n != null) {
1806
1863
  if (s.width > 5) {
1807
1864
  l = !0;
1808
- let v = !0;
1865
+ let w = !0;
1809
1866
  if (t.eventCallbacks.onSelect != null) {
1810
- const x = h(s);
1811
- let C;
1867
+ const v = d(s);
1868
+ let k;
1812
1869
  try {
1813
- C = t.eventCallbacks.onSelect(x);
1814
- } catch (z) {
1815
- console.warn("[uPlot+] event callback error:", z);
1870
+ k = t.eventCallbacks.onSelect(v);
1871
+ } catch (D) {
1872
+ console.warn("[uPlot+] event callback error:", D);
1816
1873
  }
1817
- C === !1 && (v = !1);
1874
+ k === !1 && (w = !1);
1818
1875
  }
1819
- v && (w(s), f());
1876
+ w && (m(s), f());
1820
1877
  }
1821
1878
  n = null, s.show = !1, s.left = 0, s.width = 0, t.selectState = s, t.scheduleRedraw();
1822
1879
  }
1823
1880
  }
1824
- function g(m) {
1825
- p();
1881
+ function h(p) {
1882
+ P();
1826
1883
  }
1827
- function I(m) {
1884
+ function C(p) {
1828
1885
  if (l) {
1829
1886
  l = !1;
1830
1887
  return;
1831
1888
  }
1832
- const v = t.eventCallbacks.onClick;
1833
- if (v == null) return;
1834
- const x = r(m);
1835
- if (x != null && a(x.cx, x.cy))
1889
+ const w = t.eventCallbacks.onClick;
1890
+ if (w == null) return;
1891
+ const v = r(p);
1892
+ if (v != null && a(v.cx, v.cy))
1836
1893
  try {
1837
- v(u(m, x.cx, x.cy));
1838
- } catch (C) {
1839
- console.warn("[uPlot+] event callback error:", C);
1894
+ w(u(p, v.cx, v.cy));
1895
+ } catch (k) {
1896
+ console.warn("[uPlot+] event callback error:", k);
1840
1897
  }
1841
1898
  }
1842
- function L(m) {
1843
- const v = t.eventCallbacks.onContextMenu;
1844
- if (v == null) return;
1845
- const x = r(m);
1846
- if (x != null && a(x.cx, x.cy)) {
1847
- m.preventDefault();
1899
+ function I(p) {
1900
+ const w = t.eventCallbacks.onContextMenu;
1901
+ if (w == null) return;
1902
+ const v = r(p);
1903
+ if (v != null && a(v.cx, v.cy)) {
1904
+ p.preventDefault();
1848
1905
  try {
1849
- v(u(m, x.cx, x.cy));
1850
- } catch (C) {
1851
- console.warn("[uPlot+] event callback error:", C);
1906
+ w(u(p, v.cx, v.cy));
1907
+ } catch (k) {
1908
+ console.warn("[uPlot+] event callback error:", k);
1852
1909
  }
1853
1910
  }
1854
1911
  }
1855
- function P(m) {
1856
- var v, x;
1912
+ function L(p) {
1913
+ var w, v;
1857
1914
  t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), n != null && (n = null, s.show = !1, s.width = 0, t.selectState = s), i != null && (i = null), t.scheduleCursorRedraw();
1858
1915
  try {
1859
- (x = (v = t.eventCallbacks).onCursorLeave) == null || x.call(v);
1860
- } catch (C) {
1861
- console.warn("[uPlot+] event callback error:", C);
1916
+ (v = (w = t.eventCallbacks).onCursorLeave) == null || v.call(w);
1917
+ } catch (k) {
1918
+ console.warn("[uPlot+] event callback error:", k);
1862
1919
  }
1863
1920
  }
1864
- function T(m) {
1921
+ function T(p) {
1865
1922
  if (t.eventCallbacks.onDblClick != null) {
1866
- const v = r(m);
1867
- if (v != null && a(v.cx, v.cy)) {
1868
- let x;
1923
+ const w = r(p);
1924
+ if (w != null && a(w.cx, w.cy)) {
1925
+ let v;
1869
1926
  try {
1870
- x = t.eventCallbacks.onDblClick(u(m, v.cx, v.cy));
1871
- } catch (C) {
1872
- console.warn("[uPlot+] event callback error:", C);
1927
+ v = t.eventCallbacks.onDblClick(u(p, w.cx, w.cy));
1928
+ } catch (k) {
1929
+ console.warn("[uPlot+] event callback error:", k);
1873
1930
  }
1874
- if (x === !1)
1931
+ if (v === !1)
1875
1932
  return;
1876
1933
  }
1877
1934
  }
1878
- for (const v of t.scaleConfigs)
1879
- t.scaleManager.addScale(v);
1935
+ for (const w of t.scaleConfigs)
1936
+ t.scaleManager.addScale(w);
1880
1937
  t.renderer.clearCache(), t.scheduleRedraw();
1881
1938
  }
1882
- function M(m) {
1939
+ function x(p) {
1883
1940
  if (!t.wheelZoom) return;
1884
- const v = r(m);
1885
- if (v == null || !a(v.cx, v.cy)) return;
1886
- m.preventDefault();
1887
- const x = Math.max(0.1, Math.min(10, 1 - m.deltaY * 1e-3)), C = t.plotBox;
1888
- for (const z of t.scaleManager.getAllScales()) {
1889
- if (z.ori !== G.Horizontal || z.min == null || z.max == null) continue;
1890
- const A = it(v.cx + C.left, z, C.width, C.left), F = A - (A - z.min) * x, _ = A + (z.max - A) * x;
1891
- z.min = Math.min(F, _), z.max = Math.max(F, _), z.auto = !1, at(z);
1941
+ const w = r(p);
1942
+ if (w == null || !a(w.cx, w.cy)) return;
1943
+ p.preventDefault();
1944
+ const v = Math.max(0.1, Math.min(10, 1 - p.deltaY * 1e-3)), k = t.plotBox;
1945
+ for (const D of t.scaleManager.getAllScales()) {
1946
+ if (D.ori !== G.Horizontal || D.min == null || D.max == null) continue;
1947
+ const A = it(w.cx + k.left, D, k.width, k.left), F = A - (A - D.min) * v, R = A + (D.max - A) * v;
1948
+ D.min = Math.min(F, R), D.max = Math.max(F, R), D.auto = !1, at(D);
1892
1949
  }
1893
1950
  t.renderer.clearCache(), t.scheduleRedraw(), f();
1894
1951
  }
1895
- function w(m) {
1896
- const v = t.plotBox, x = m.left / v.width, C = (m.left + m.width) / v.width;
1897
- for (const z of t.scaleManager.getAllScales()) {
1898
- if (z.ori !== G.Horizontal || z.min == null || z.max == null) continue;
1952
+ function m(p) {
1953
+ const w = t.plotBox, v = p.left / w.width, k = (p.left + p.width) / w.width;
1954
+ for (const D of t.scaleManager.getAllScales()) {
1955
+ if (D.ori !== G.Horizontal || D.min == null || D.max == null) continue;
1899
1956
  const A = it(
1900
- v.left + x * v.width,
1901
- z,
1902
- v.width,
1903
- v.left
1957
+ w.left + v * w.width,
1958
+ D,
1959
+ w.width,
1960
+ w.left
1904
1961
  ), F = it(
1905
- v.left + C * v.width,
1906
- z,
1907
- v.width,
1908
- v.left
1962
+ w.left + k * w.width,
1963
+ D,
1964
+ w.width,
1965
+ w.left
1909
1966
  );
1910
- z.min = Math.min(A, F), z.max = Math.max(A, F), z.auto = !1, at(z);
1967
+ D.min = Math.min(A, F), D.max = Math.max(A, F), D.auto = !1, at(D);
1911
1968
  }
1912
1969
  t.renderer.clearCache();
1913
1970
  }
1914
- function b(m) {
1915
- if (m.touches.length === 2) {
1916
- const C = m.touches[0], z = m.touches[1], A = z.clientX - C.clientX, F = z.clientY - C.clientY;
1971
+ function S(p) {
1972
+ if (p.touches.length === 2) {
1973
+ const k = p.touches[0], D = p.touches[1], A = D.clientX - k.clientX, F = D.clientY - k.clientY;
1917
1974
  o = {
1918
1975
  dist: Math.sqrt(A * A + F * F),
1919
- midX: (C.clientX + z.clientX) / 2,
1920
- midY: (C.clientY + z.clientY) / 2
1976
+ midX: (k.clientX + D.clientX) / 2,
1977
+ midY: (k.clientY + D.clientY) / 2
1921
1978
  }, n = null;
1922
1979
  return;
1923
1980
  }
1924
- const v = m.touches[0];
1925
- if (v == null) return;
1926
- const x = r(v);
1927
- x != null && a(x.cx, x.cy) && (n = { x: x.cx, y: x.cy }, l = !1);
1981
+ const w = p.touches[0];
1982
+ if (w == null) return;
1983
+ const v = r(w);
1984
+ v != null && a(v.cx, v.cy) && (n = { x: v.cx, y: v.cy }, l = !1);
1928
1985
  }
1929
- function k(m) {
1930
- if (m.touches.length === 2 && o != null) {
1931
- m.preventDefault();
1932
- const x = m.touches[0], C = m.touches[1], z = C.clientX - x.clientX, A = C.clientY - x.clientY, F = Math.sqrt(z * z + A * A), _ = F / o.dist, R = e.getBoundingClientRect(), B = t.plotBox, $ = o.midX - R.left - B.left;
1986
+ function y(p) {
1987
+ if (p.touches.length === 2 && o != null) {
1988
+ p.preventDefault();
1989
+ const v = p.touches[0], k = p.touches[1], D = k.clientX - v.clientX, A = k.clientY - v.clientY, F = Math.sqrt(D * D + A * A), R = F / o.dist, _ = e.getBoundingClientRect(), V = t.plotBox, B = o.midX - _.left - V.left;
1933
1990
  for (const W of t.scaleManager.getAllScales()) {
1934
1991
  if (W.ori !== G.Horizontal || W.min == null || W.max == null) continue;
1935
- const ot = it($ + B.left, W, B.width, B.left), Z = ot - (ot - W.min) / _, pt = ot + (W.max - ot) / _;
1992
+ const j = it(B + V.left, W, V.width, V.left), Z = j - (j - W.min) / R, pt = j + (W.max - j) / R;
1936
1993
  W.min = Math.min(Z, pt), W.max = Math.max(Z, pt), W.auto = !1, at(W);
1937
1994
  }
1938
1995
  o.dist = F, t.renderer.clearCache(), t.scheduleRedraw(), f();
1939
1996
  return;
1940
1997
  }
1941
- const v = m.touches[0];
1942
- v != null && (d(v, m), n != null && m.preventDefault());
1998
+ const w = p.touches[0];
1999
+ w != null && (g(w, p), n != null && p.preventDefault());
1943
2000
  }
1944
- function D(m) {
2001
+ function z(p) {
1945
2002
  if (o != null) {
1946
2003
  o = null;
1947
2004
  return;
1948
2005
  }
1949
- m.changedTouches[0] != null && p();
2006
+ p.changedTouches[0] != null && P();
1950
2007
  }
1951
- return e.addEventListener("mousemove", y), e.addEventListener("mousedown", S), e.addEventListener("mouseup", g), e.addEventListener("click", I), e.addEventListener("contextmenu", L), e.addEventListener("mouseleave", P), e.addEventListener("dblclick", T), e.addEventListener("wheel", M, { passive: !1 }), e.addEventListener("touchstart", b, { passive: !0 }), e.addEventListener("touchmove", k, { passive: !1 }), e.addEventListener("touchend", D), () => {
1952
- e.removeEventListener("mousemove", y), e.removeEventListener("mousedown", S), e.removeEventListener("mouseup", g), e.removeEventListener("click", I), e.removeEventListener("contextmenu", L), e.removeEventListener("mouseleave", P), e.removeEventListener("dblclick", T), e.removeEventListener("wheel", M), e.removeEventListener("touchstart", b), e.removeEventListener("touchmove", k), e.removeEventListener("touchend", D);
2008
+ return e.addEventListener("mousemove", M), e.addEventListener("mousedown", b), e.addEventListener("mouseup", h), e.addEventListener("click", C), e.addEventListener("contextmenu", I), e.addEventListener("mouseleave", L), e.addEventListener("dblclick", T), e.addEventListener("wheel", x, { passive: !1 }), e.addEventListener("touchstart", S, { passive: !0 }), e.addEventListener("touchmove", y, { passive: !1 }), e.addEventListener("touchend", z), () => {
2009
+ e.removeEventListener("mousemove", M), e.removeEventListener("mousedown", b), e.removeEventListener("mouseup", h), e.removeEventListener("click", C), e.removeEventListener("contextmenu", I), e.removeEventListener("mouseleave", L), e.removeEventListener("dblclick", T), e.removeEventListener("wheel", x), e.removeEventListener("touchstart", S), e.removeEventListener("touchmove", y), e.removeEventListener("touchend", z);
1953
2010
  };
1954
2011
  }
1955
- const Et = /* @__PURE__ */ new Map();
1956
- function $n(t) {
1957
- let e = Et.get(t);
1958
- return e == null && (e = new Yn(t), Et.set(t, e)), e;
2012
+ const Bt = /* @__PURE__ */ new Map();
2013
+ function Un(t) {
2014
+ let e = Bt.get(t);
2015
+ return e == null && (e = new Kn(t), Bt.set(t, e)), e;
1959
2016
  }
1960
- class Yn {
2017
+ class Kn {
1961
2018
  constructor(e) {
1962
2019
  this.members = /* @__PURE__ */ new Set(), this.publishing = !1, this.syncedStores = /* @__PURE__ */ new WeakSet(), this.key = e;
1963
2020
  }
@@ -1967,7 +2024,7 @@ class Yn {
1967
2024
  }
1968
2025
  /** Remove a chart from this sync group. Cleans up empty groups. */
1969
2026
  leave(e) {
1970
- this.members.delete(e), this.members.size === 0 && Et.delete(this.key);
2027
+ this.members.delete(e), this.members.size === 0 && Bt.delete(this.key);
1971
2028
  }
1972
2029
  /**
1973
2030
  * Publish cursor position from one chart to all others in the group.
@@ -1997,10 +2054,10 @@ class Yn {
1997
2054
  this.publishing = !1;
1998
2055
  }
1999
2056
  }
2000
- function Un(t, e) {
2057
+ function Nn(t, e) {
2001
2058
  Y(() => {
2002
2059
  if (e == null) return;
2003
- const n = $n(e);
2060
+ const n = Un(e);
2004
2061
  n.join(t);
2005
2062
  let s = -1, o = -1;
2006
2063
  const i = t.subscribe(() => {
@@ -2024,72 +2081,72 @@ function Ut({
2024
2081
  syncKey: a,
2025
2082
  cursor: c,
2026
2083
  onClick: u,
2027
- onContextMenu: h,
2084
+ onContextMenu: d,
2028
2085
  onDblClick: f,
2029
- onCursorMove: d,
2030
- onCursorLeave: y,
2031
- onScaleChange: S,
2032
- onSelect: p
2086
+ onCursorMove: g,
2087
+ onCursorLeave: M,
2088
+ onScaleChange: b,
2089
+ onSelect: P
2033
2090
  }) {
2034
- var v;
2035
- const g = En(), [I, L] = vt(null), P = i ?? (typeof window < "u" && window.devicePixelRatio || 1), T = (c == null ? void 0 : c.wheelZoom) ?? !1, M = ((v = c == null ? void 0 : c.focus) == null ? void 0 : v.alpha) ?? ((c == null ? void 0 : c.focus) != null ? 0.15 : 1);
2091
+ var w;
2092
+ const h = En(), [C, I] = vt(null), L = i ?? (typeof window < "u" && window.devicePixelRatio || 1), T = (c == null ? void 0 : c.wheelZoom) ?? !1, x = ((w = c == null ? void 0 : c.focus) == null ? void 0 : w.alpha) ?? ((c == null ? void 0 : c.focus) != null ? 0.15 : 1);
2036
2093
  Y(() => {
2037
- g.wheelZoom = T, g.focusAlpha = M;
2038
- }, [g, T, M]), g.eventCallbacks.onClick = u, g.eventCallbacks.onContextMenu = h, g.eventCallbacks.onDblClick = f, g.eventCallbacks.onCursorMove = d, g.eventCallbacks.onCursorLeave = y, g.eventCallbacks.onScaleChange = S, g.eventCallbacks.onSelect = p, Wn(g, I), Un(g, a);
2039
- const w = K((x) => {
2040
- g.canvas = x, x && g.scheduleRedraw();
2041
- }, [g]), b = K((x) => {
2042
- L(x);
2094
+ h.wheelZoom = T, h.focusAlpha = x;
2095
+ }, [h, T, x]), h.eventCallbacks.onClick = u, h.eventCallbacks.onContextMenu = d, h.eventCallbacks.onDblClick = f, h.eventCallbacks.onCursorMove = g, h.eventCallbacks.onCursorLeave = M, h.eventCallbacks.onScaleChange = b, h.eventCallbacks.onSelect = P, Xn(h, C), Nn(h, a);
2096
+ const m = N((v) => {
2097
+ h.canvas = v, v && h.scheduleRedraw();
2098
+ }, [h]), S = N((v) => {
2099
+ I(v);
2043
2100
  }, []);
2044
2101
  Y(() => {
2045
- g.pxRatio = P, g.setSize(t, e);
2046
- }, [g, t, e, P]), Y(() => () => {
2047
- g.canvas = null, g.scheduler.cancel(), g.focusedSeries = null;
2048
- }, [g]), Y(() => {
2049
- if (I == null || typeof ResizeObserver > "u") return;
2050
- const x = new ResizeObserver((C) => {
2051
- const z = C[0];
2052
- if (z == null) return;
2053
- const { width: A, height: F } = z.contentRect;
2054
- A > 0 && F > 0 && (A !== g.width || F !== g.height) && g.setSize(Math.round(A), Math.round(F));
2102
+ h.pxRatio = L, h.setSize(t, e);
2103
+ }, [h, t, e, L]), Y(() => () => {
2104
+ h.canvas = null, h.scheduler.cancel(), h.focusedSeries = null;
2105
+ }, [h]), Y(() => {
2106
+ if (C == null || typeof ResizeObserver > "u") return;
2107
+ const v = new ResizeObserver((k) => {
2108
+ const D = k[0];
2109
+ if (D == null) return;
2110
+ const { width: A, height: F } = D.contentRect;
2111
+ A > 0 && F > 0 && (A !== h.width || F !== h.height) && h.setSize(Math.round(A), Math.round(F));
2055
2112
  });
2056
- return x.observe(I), () => {
2057
- x.disconnect();
2113
+ return v.observe(C), () => {
2114
+ v.disconnect();
2058
2115
  };
2059
- }, [g, I]);
2060
- const k = X(n);
2116
+ }, [h, C]);
2117
+ const y = X(n);
2061
2118
  Y(() => {
2062
- if (n === k.current && g.dataStore.data.length > 0) return;
2063
- k.current = n, g.dataStore.setData(n), g.renderer.clearCache();
2064
- const x = "x";
2065
- g.scaleManager.getScale(x) || g.registerScale({
2066
- id: x,
2119
+ if (n === y.current && h.dataStore.data.length > 0) return;
2120
+ y.current = n, h.dataStore.setData(n), h.renderer.clearCache();
2121
+ const v = "x";
2122
+ h.scaleManager.getScale(v) || h.registerScale({
2123
+ id: v,
2067
2124
  auto: !0
2068
2125
  });
2069
- for (let C = 0; C < n.length; C++)
2070
- g.scaleManager.setGroupXScale(C, x);
2071
- g.scheduleRedraw();
2072
- }, [g, n]);
2073
- const D = X(l);
2074
- D.current = l, Y(() => {
2075
- const x = (C) => {
2076
- var z;
2077
- (z = D.current) == null || z.call(D, C);
2126
+ for (let k = 0; k < n.length; k++)
2127
+ h.scaleManager.setGroupXScale(k, v);
2128
+ h.scheduleRedraw();
2129
+ }, [h, n]);
2130
+ const z = X(l);
2131
+ z.current = l, Y(() => {
2132
+ const v = (k) => {
2133
+ var D;
2134
+ (D = z.current) == null || D.call(z, k);
2078
2135
  };
2079
- return g.drawHooks.add(x), () => {
2080
- g.drawHooks.delete(x);
2136
+ return h.drawHooks.add(v), () => {
2137
+ h.drawHooks.delete(v);
2081
2138
  };
2082
- }, [g]);
2083
- const m = X(r);
2084
- return m.current = r, Y(() => {
2085
- const x = (C, z) => {
2139
+ }, [h]);
2140
+ const p = X(r);
2141
+ return p.current = r, Y(() => {
2142
+ const v = (k, D) => {
2086
2143
  var A;
2087
- (A = m.current) == null || A.call(m, C, z);
2144
+ (A = p.current) == null || A.call(p, k, D);
2088
2145
  };
2089
- return g.cursorDrawHooks.add(x), () => {
2090
- g.cursorDrawHooks.delete(x);
2146
+ return h.cursorDrawHooks.add(v), () => {
2147
+ h.cursorDrawHooks.delete(v);
2091
2148
  };
2092
- }, [g]), /* @__PURE__ */ E(ke.Provider, { value: g, children: /* @__PURE__ */ J(
2149
+ }, [h]), /* @__PURE__ */ E(Ce.Provider, { value: h, children: /* @__PURE__ */ Q(
2093
2150
  "div",
2094
2151
  {
2095
2152
  className: o,
@@ -2103,7 +2160,7 @@ function Ut({
2103
2160
  /* @__PURE__ */ E(
2104
2161
  "div",
2105
2162
  {
2106
- ref: b,
2163
+ ref: S,
2107
2164
  style: {
2108
2165
  position: "relative",
2109
2166
  width: `${t}px`,
@@ -2114,7 +2171,7 @@ function Ut({
2114
2171
  children: /* @__PURE__ */ E(
2115
2172
  "canvas",
2116
2173
  {
2117
- ref: w,
2174
+ ref: m,
2118
2175
  style: {
2119
2176
  position: "absolute",
2120
2177
  left: 0,
@@ -2129,7 +2186,7 @@ function Ut({
2129
2186
  }
2130
2187
  ) });
2131
2188
  }
2132
- function ue(t) {
2189
+ function fe(t) {
2133
2190
  return t != null && typeof t == "object" && !Array.isArray(t);
2134
2191
  }
2135
2192
  function On(t, e) {
@@ -2139,14 +2196,14 @@ function On(t, e) {
2139
2196
  if (t[o] !== e[o]) return !1;
2140
2197
  return !0;
2141
2198
  }
2142
- function Ot(t, e) {
2199
+ function Kt(t, e) {
2143
2200
  if (t === null) return !1;
2144
2201
  const n = t, s = e, o = Object.keys(n), i = Object.keys(s);
2145
2202
  if (o.length !== i.length) return !1;
2146
2203
  for (const l of i) {
2147
2204
  const r = n[l], a = s[l];
2148
2205
  if (r !== a)
2149
- if (ue(r) && ue(a)) {
2206
+ if (fe(r) && fe(a)) {
2150
2207
  if (!On(r, a)) return !1;
2151
2208
  } else
2152
2209
  return !1;
@@ -2154,7 +2211,7 @@ function Ot(t, e) {
2154
2211
  return !0;
2155
2212
  }
2156
2213
  function Lt(t) {
2157
- const e = st(), n = X(t);
2214
+ const e = ot(), n = X(t);
2158
2215
  n.current = t, Y(() => {
2159
2216
  const o = n.current;
2160
2217
  return e.registerScale({ ...o }), e.scheduleRedraw(), () => {
@@ -2163,13 +2220,13 @@ function Lt(t) {
2163
2220
  }, [e, t.id]);
2164
2221
  const s = X(null);
2165
2222
  return Y(() => {
2166
- Ot(s.current, t) || (s.current = t, e.scaleConfigs = e.scaleConfigs.map(
2223
+ Kt(s.current, t) || (s.current = t, e.scaleConfigs = e.scaleConfigs.map(
2167
2224
  (o) => o.id === t.id ? { ...t } : o
2168
2225
  ), e.scaleManager.addScale({ ...t }), e.scheduleRedraw());
2169
2226
  }), null;
2170
2227
  }
2171
- function Ce(t) {
2172
- const e = st(), n = X(t);
2228
+ function Te(t) {
2229
+ const e = ot(), n = X(t);
2173
2230
  n.current = t, Y(() => {
2174
2231
  const o = n.current;
2175
2232
  return e.registerSeries({ ...o, show: o.show ?? !0 }), e.renderer.clearCache(), e.scheduleRedraw(), () => {
@@ -2178,16 +2235,16 @@ function Ce(t) {
2178
2235
  }, [e, t.group, t.index]);
2179
2236
  const s = X(null);
2180
2237
  return Y(() => {
2181
- Ot(s.current, t) || (s.current = t, e.seriesConfigs = e.seriesConfigs.map(
2238
+ Kt(s.current, t) || (s.current = t, e.seriesConfigs = e.seriesConfigs.map(
2182
2239
  (o) => o.group === t.group && o.index === t.index ? { ...t, show: t.show ?? !0 } : o
2183
2240
  ), e.renderer.invalidateSeries(t.group, t.index), e.scheduleRedraw());
2184
2241
  }), null;
2185
2242
  }
2186
- function Nn(t) {
2243
+ function jn(t) {
2187
2244
  return { ...t, side: t.side ?? (t.scale === "x" ? U.Bottom : U.Left), show: t.show ?? !0 };
2188
2245
  }
2189
2246
  function zt(t) {
2190
- const e = st(), n = Nn(t), s = X(n);
2247
+ const e = ot(), n = jn(t), s = X(n);
2191
2248
  s.current = n, Y(() => {
2192
2249
  const i = s.current;
2193
2250
  return e.axisConfigs = e.axisConfigs.filter(
@@ -2200,13 +2257,13 @@ function zt(t) {
2200
2257
  }, [e, n.scale, n.side]);
2201
2258
  const o = X(null);
2202
2259
  return Y(() => {
2203
- Ot(o.current, t) || (o.current = t, e.axisConfigs = e.axisConfigs.map(
2260
+ Kt(o.current, t) || (o.current = t, e.axisConfigs = e.axisConfigs.map(
2204
2261
  (i) => i.scale === n.scale && i.side === n.side ? n : i
2205
2262
  ), e.scheduleRedraw());
2206
2263
  }), null;
2207
2264
  }
2208
- function rs({ series: t, group: e, fill: n, dir: s }) {
2209
- const o = st(), i = X(null), l = t[0], r = t[1];
2265
+ function cs({ series: t, group: e, fill: n, dir: s }) {
2266
+ const o = ot(), i = X(null), l = t[0], r = t[1];
2210
2267
  return Y(() => {
2211
2268
  const a = { series: [l, r], group: e, fill: n, dir: s };
2212
2269
  return i.current != null && (o.bandConfigs = o.bandConfigs.filter((c) => c !== i.current)), i.current = a, o.bandConfigs.push(a), o.scheduleRedraw(), () => {
@@ -2214,12 +2271,12 @@ function rs({ series: t, group: e, fill: n, dir: s }) {
2214
2271
  };
2215
2272
  }, [o, l, r, e, n, s]), null;
2216
2273
  }
2217
- const Kn = {
2274
+ const qn = {
2218
2275
  width: 12,
2219
2276
  height: 3,
2220
2277
  borderRadius: 1,
2221
2278
  display: "inline-block"
2222
- }, jn = { fontWeight: 600 }, qn = {
2279
+ }, Zn = { fontWeight: 600 }, Jn = {
2223
2280
  display: "inline-flex",
2224
2281
  alignItems: "center",
2225
2282
  gap: 4,
@@ -2227,34 +2284,34 @@ const Kn = {
2227
2284
  cursor: "pointer",
2228
2285
  fontSize: 12,
2229
2286
  fontFamily: "sans-serif"
2230
- }, Zn = ze(function({ group: e, index: n, label: s, color: o, isHidden: i, valueStr: l, store: r }) {
2231
- const a = K(() => {
2287
+ }, Qn = De(function({ group: e, index: n, label: s, color: o, isHidden: i, valueStr: l, store: r }) {
2288
+ const a = N(() => {
2232
2289
  r.toggleSeries(e, n);
2233
2290
  }, [r, e, n]);
2234
- return /* @__PURE__ */ J(
2291
+ return /* @__PURE__ */ Q(
2235
2292
  "span",
2236
2293
  {
2237
2294
  onClick: a,
2238
- style: { ...qn, opacity: i ? 0.4 : 1 },
2295
+ style: { ...Jn, opacity: i ? 0.4 : 1 },
2239
2296
  children: [
2240
- /* @__PURE__ */ E("span", { style: { ...Kn, backgroundColor: o } }),
2297
+ /* @__PURE__ */ E("span", { style: { ...qn, backgroundColor: o } }),
2241
2298
  /* @__PURE__ */ E("span", { children: s }),
2242
- l && /* @__PURE__ */ E("span", { style: jn, children: l })
2299
+ l && /* @__PURE__ */ E("span", { style: Zn, children: l })
2243
2300
  ]
2244
2301
  }
2245
2302
  );
2246
2303
  });
2247
- function as({ show: t = !0, position: e = "bottom", className: n }) {
2248
- const s = st(), o = X({ activeGroup: -1, activeDataIdx: -1, seriesCount: 0, revision: -1 }), i = K(
2304
+ function us({ show: t = !0, position: e = "bottom", className: n }) {
2305
+ const s = ot(), o = X({ activeGroup: -1, activeDataIdx: -1, seriesCount: 0, revision: -1 }), i = N(
2249
2306
  (u) => s.subscribe(u),
2250
2307
  [s]
2251
- ), l = K(() => {
2252
- const { activeGroup: u, activeDataIdx: h } = s.cursorManager.state, f = s.seriesConfigs.length, { revision: d } = s, y = o.current;
2253
- if (y.activeGroup === u && y.activeDataIdx === h && y.seriesCount === f && y.revision === d)
2254
- return y;
2255
- const S = { activeGroup: u, activeDataIdx: h, seriesCount: f, revision: d };
2256
- return o.current = S, S;
2257
- }, [s]), r = fe(i, l);
2308
+ ), l = N(() => {
2309
+ const { activeGroup: u, activeDataIdx: d } = s.cursorManager.state, f = s.seriesConfigs.length, { revision: g } = s, M = o.current;
2310
+ if (M.activeGroup === u && M.activeDataIdx === d && M.seriesCount === f && M.revision === g)
2311
+ return M;
2312
+ const b = { activeGroup: u, activeDataIdx: d, seriesCount: f, revision: g };
2313
+ return o.current = b, b;
2314
+ }, [s]), r = he(i, l);
2258
2315
  if (!t) return null;
2259
2316
  const { activeGroup: a, activeDataIdx: c } = r;
2260
2317
  return /* @__PURE__ */ E(
@@ -2269,19 +2326,19 @@ function as({ show: t = !0, position: e = "bottom", className: n }) {
2269
2326
  padding: "4px 0"
2270
2327
  },
2271
2328
  children: s.seriesConfigs.map((u) => {
2272
- const h = typeof u.stroke == "string" ? u.stroke : "#000";
2329
+ const d = typeof u.stroke == "string" ? u.stroke : "#000";
2273
2330
  let f = "";
2274
2331
  if (c >= 0 && a >= 0) {
2275
- const y = s.dataStore.getYValues(u.group, u.index)[c];
2276
- y != null && (f = typeof y == "number" ? y.toPrecision(4) : String(y));
2332
+ const M = s.dataStore.getYValues(u.group, u.index)[c];
2333
+ M != null && (f = typeof M == "number" ? M.toPrecision(4) : String(M));
2277
2334
  }
2278
2335
  return /* @__PURE__ */ E(
2279
- Zn,
2336
+ Qn,
2280
2337
  {
2281
2338
  group: u.group,
2282
2339
  index: u.index,
2283
2340
  label: u.label ?? `Series ${u.index}`,
2284
- color: h,
2341
+ color: d,
2285
2342
  isHidden: u.show === !1,
2286
2343
  valueStr: f,
2287
2344
  store: s
@@ -2292,49 +2349,49 @@ function as({ show: t = !0, position: e = "bottom", className: n }) {
2292
2349
  }
2293
2350
  );
2294
2351
  }
2295
- const Jn = 160;
2296
- function cs({
2352
+ const ts = 160;
2353
+ function fs({
2297
2354
  show: t = !0,
2298
2355
  className: e,
2299
2356
  children: n,
2300
2357
  offset: s = {}
2301
2358
  }) {
2302
- const o = st(), i = X({ left: -10, top: -10, activeGroup: -1, activeDataIdx: -1, revision: -1 }), l = K(
2303
- (w) => o.subscribe(w),
2359
+ const o = ot(), i = X({ left: -10, top: -10, activeGroup: -1, activeDataIdx: -1, revision: -1 }), l = N(
2360
+ (m) => o.subscribe(m),
2304
2361
  [o]
2305
- ), r = K(() => {
2306
- const w = o.cursorManager.state, { revision: b } = o, k = i.current;
2307
- if (k.left === w.left && k.top === w.top && k.activeGroup === w.activeGroup && k.activeDataIdx === w.activeDataIdx && k.revision === b)
2308
- return k;
2309
- const D = {
2310
- left: w.left,
2311
- top: w.top,
2312
- activeGroup: w.activeGroup,
2313
- activeDataIdx: w.activeDataIdx,
2314
- revision: b
2362
+ ), r = N(() => {
2363
+ const m = o.cursorManager.state, { revision: S } = o, y = i.current;
2364
+ if (y.left === m.left && y.top === m.top && y.activeGroup === m.activeGroup && y.activeDataIdx === m.activeDataIdx && y.revision === S)
2365
+ return y;
2366
+ const z = {
2367
+ left: m.left,
2368
+ top: m.top,
2369
+ activeGroup: m.activeGroup,
2370
+ activeDataIdx: m.activeDataIdx,
2371
+ revision: S
2315
2372
  };
2316
- return i.current = D, D;
2317
- }, [o]), a = fe(l, r);
2373
+ return i.current = z, z;
2374
+ }, [o]), a = he(l, r);
2318
2375
  if (!t || a.activeDataIdx < 0 || a.activeGroup < 0 || a.left < 0) return null;
2319
- const { activeGroup: c, activeDataIdx: u } = a, h = o.plotBox, f = o.dataStore.data[c], d = f != null ? f.x[u] ?? null : null, y = d != null ? parseFloat(d.toPrecision(6)).toString() : "", S = [];
2320
- for (const w of o.seriesConfigs) {
2321
- if (w.show === !1) continue;
2322
- const b = o.dataStore.getYValues(w.group, w.index), k = w.group === c ? b[u] : null;
2323
- S.push({
2324
- label: w.label ?? `Series ${w.index}`,
2325
- value: k,
2326
- color: typeof w.stroke == "string" ? w.stroke : "#000",
2327
- group: w.group,
2328
- index: w.index
2376
+ const { activeGroup: c, activeDataIdx: u } = a, d = o.plotBox, f = o.dataStore.data[c], g = f != null ? f.x[u] ?? null : null, M = g != null ? parseFloat(g.toPrecision(6)).toString() : "", b = [];
2377
+ for (const m of o.seriesConfigs) {
2378
+ if (m.show === !1) continue;
2379
+ const S = o.dataStore.getYValues(m.group, m.index), y = m.group === c ? S[u] : null;
2380
+ b.push({
2381
+ label: m.label ?? `Series ${m.index}`,
2382
+ value: y,
2383
+ color: typeof m.stroke == "string" ? m.stroke : "#000",
2384
+ group: m.group,
2385
+ index: m.index
2329
2386
  });
2330
2387
  }
2331
- const p = {
2332
- x: d,
2333
- xLabel: y,
2334
- items: S,
2335
- left: a.left + h.left,
2336
- top: a.top + h.top
2337
- }, g = s.x ?? 12, I = s.y ?? -12, L = a.left + h.left + g + Jn > h.left + h.width, P = a.top + h.top + I < h.top, T = L ? p.left - g : p.left + g, M = P ? p.top + Math.abs(I) : p.top + I;
2388
+ const P = {
2389
+ x: g,
2390
+ xLabel: M,
2391
+ items: b,
2392
+ left: a.left + d.left,
2393
+ top: a.top + d.top
2394
+ }, h = s.x ?? 12, C = s.y ?? -12, I = a.left + d.left + h + ts > d.left + d.width, L = a.top + d.top + C < d.top, T = I ? P.left - h : P.left + h, x = L ? P.top + Math.abs(C) : P.top + C;
2338
2395
  return n ? /* @__PURE__ */ E(
2339
2396
  "div",
2340
2397
  {
@@ -2342,22 +2399,22 @@ function cs({
2342
2399
  style: {
2343
2400
  position: "absolute",
2344
2401
  left: T,
2345
- top: M,
2346
- transform: L ? "translateX(-100%)" : void 0,
2402
+ top: x,
2403
+ transform: I ? "translateX(-100%)" : void 0,
2347
2404
  pointerEvents: "none",
2348
2405
  zIndex: 100
2349
2406
  },
2350
- children: n(p)
2407
+ children: n(P)
2351
2408
  }
2352
- ) : /* @__PURE__ */ J(
2409
+ ) : /* @__PURE__ */ Q(
2353
2410
  "div",
2354
2411
  {
2355
2412
  className: e,
2356
2413
  style: {
2357
2414
  position: "absolute",
2358
2415
  left: T,
2359
- top: M,
2360
- transform: L ? "translateX(-100%)" : void 0,
2416
+ top: x,
2417
+ transform: I ? "translateX(-100%)" : void 0,
2361
2418
  pointerEvents: "none",
2362
2419
  zIndex: 100,
2363
2420
  background: "rgba(0,0,0,0.85)",
@@ -2370,20 +2427,20 @@ function cs({
2370
2427
  lineHeight: 1.5
2371
2428
  },
2372
2429
  children: [
2373
- /* @__PURE__ */ E("div", { style: { fontWeight: 600, marginBottom: 2 }, children: y }),
2374
- S.map((w) => /* @__PURE__ */ J("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
2375
- /* @__PURE__ */ E("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: w.color, display: "inline-block" } }),
2376
- /* @__PURE__ */ J("span", { children: [
2377
- w.label,
2430
+ /* @__PURE__ */ E("div", { style: { fontWeight: 600, marginBottom: 2 }, children: M }),
2431
+ b.map((m) => /* @__PURE__ */ Q("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
2432
+ /* @__PURE__ */ E("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: m.color, display: "inline-block" } }),
2433
+ /* @__PURE__ */ Q("span", { children: [
2434
+ m.label,
2378
2435
  ":"
2379
2436
  ] }),
2380
- /* @__PURE__ */ E("span", { style: { fontWeight: 600 }, children: w.value != null ? w.value.toPrecision(4) : "—" })
2381
- ] }, `${w.group}:${w.index}`))
2437
+ /* @__PURE__ */ E("span", { style: { fontWeight: 600 }, children: m.value != null ? m.value.toPrecision(4) : "—" })
2438
+ ] }, `${m.group}:${m.index}`))
2382
2439
  ]
2383
2440
  }
2384
2441
  );
2385
2442
  }
2386
- function us({
2443
+ function hs({
2387
2444
  width: t,
2388
2445
  height: e,
2389
2446
  data: n,
@@ -2397,93 +2454,93 @@ function us({
2397
2454
  if (o != null && n.length > 0) {
2398
2455
  const T = n[0];
2399
2456
  if (T != null && T.x.length > 1) {
2400
- const M = T.x[0], b = T.x[T.x.length - 1] - M;
2401
- if (b > 0)
2457
+ const x = T.x[0], S = T.x[T.x.length - 1] - x;
2458
+ if (S > 0)
2402
2459
  return [
2403
- Math.max(0, (o[0] - M) / b),
2404
- Math.min(1, (o[1] - M) / b)
2460
+ Math.max(0, (o[0] - x) / S),
2461
+ Math.min(1, (o[1] - x) / S)
2405
2462
  ];
2406
2463
  }
2407
2464
  }
2408
2465
  return [0.25, 0.75];
2409
- }), h = X(null);
2466
+ }), d = X(null);
2410
2467
  Y(() => {
2411
2468
  if (s == null || n.length === 0) return;
2412
2469
  const T = n[0];
2413
2470
  if (T == null || T.x.length < 2) return;
2414
- const M = T.x[0], b = T.x[T.x.length - 1] - M, k = M + c[0] * b, D = M + c[1] * b, m = h.current, v = Math.max(1e-10, Math.abs(D - k) * 1e-12);
2415
- m != null && Math.abs(m[0] - k) < v && Math.abs(m[1] - D) < v || (h.current = [k, D], s(k, D));
2471
+ const x = T.x[0], S = T.x[T.x.length - 1] - x, y = x + c[0] * S, z = x + c[1] * S, p = d.current, w = Math.max(1e-10, Math.abs(z - y) * 1e-12);
2472
+ p != null && Math.abs(p[0] - y) < w && Math.abs(p[1] - z) < w || (d.current = [y, z], s(y, z));
2416
2473
  }, [c, n, s]);
2417
- const f = X(null), d = K((T) => {
2418
- const M = a.current;
2419
- if (M == null) return 0;
2420
- const w = M.getBoundingClientRect();
2421
- return Math.max(0, Math.min(1, (T - w.left) / w.width));
2422
- }, []), y = K((T) => {
2423
- const M = a.current;
2424
- if (M == null) return;
2425
- const w = d(T.clientX), b = M.getBoundingClientRect().width, k = b > 0 ? 8 / b : 0;
2426
- let D;
2427
- if (Math.abs(w - c[0]) < k)
2428
- D = "left";
2429
- else if (Math.abs(w - c[1]) < k)
2430
- D = "right";
2431
- else if (w >= c[0] && w <= c[1])
2432
- D = "move";
2474
+ const f = X(null), g = N((T) => {
2475
+ const x = a.current;
2476
+ if (x == null) return 0;
2477
+ const m = x.getBoundingClientRect();
2478
+ return Math.max(0, Math.min(1, (T - m.left) / m.width));
2479
+ }, []), M = N((T) => {
2480
+ const x = a.current;
2481
+ if (x == null) return;
2482
+ const m = g(T.clientX), S = x.getBoundingClientRect().width, y = S > 0 ? 8 / S : 0;
2483
+ let z;
2484
+ if (Math.abs(m - c[0]) < y)
2485
+ z = "left";
2486
+ else if (Math.abs(m - c[1]) < y)
2487
+ z = "right";
2488
+ else if (m >= c[0] && m <= c[1])
2489
+ z = "move";
2433
2490
  else {
2434
- const m = c[1] - c[0], v = m / 2, x = Math.max(0, Math.min(1 - m, w - v));
2435
- u([x, x + m]), D = "move";
2491
+ const p = c[1] - c[0], w = p / 2, v = Math.max(0, Math.min(1 - p, m - w));
2492
+ u([v, v + p]), z = "move";
2436
2493
  }
2437
2494
  f.current = {
2438
- mode: D,
2495
+ mode: z,
2439
2496
  startX: T.clientX,
2440
2497
  startFrac: [...c]
2441
- }, M.setPointerCapture(T.pointerId), T.preventDefault();
2442
- }, [c, d]), S = K((T) => {
2443
- const M = f.current;
2444
- if (M == null) return;
2445
- const w = d(T.clientX), b = d(M.startX), k = w - b;
2446
- if (M.mode === "move") {
2447
- const D = M.startFrac[1] - M.startFrac[0];
2448
- let m = M.startFrac[0] + k;
2449
- m = Math.max(0, Math.min(1 - D, m)), u([m, m + D]);
2450
- } else if (M.mode === "left") {
2451
- const D = Math.max(0, Math.min(M.startFrac[1] - 0.01, M.startFrac[0] + k));
2452
- u([D, M.startFrac[1]]);
2498
+ }, x.setPointerCapture(T.pointerId), T.preventDefault();
2499
+ }, [c, g]), b = N((T) => {
2500
+ const x = f.current;
2501
+ if (x == null) return;
2502
+ const m = g(T.clientX), S = g(x.startX), y = m - S;
2503
+ if (x.mode === "move") {
2504
+ const z = x.startFrac[1] - x.startFrac[0];
2505
+ let p = x.startFrac[0] + y;
2506
+ p = Math.max(0, Math.min(1 - z, p)), u([p, p + z]);
2507
+ } else if (x.mode === "left") {
2508
+ const z = Math.max(0, Math.min(x.startFrac[1] - 0.01, x.startFrac[0] + y));
2509
+ u([z, x.startFrac[1]]);
2453
2510
  } else {
2454
- const D = Math.min(1, Math.max(M.startFrac[0] + 0.01, M.startFrac[1] + k));
2455
- u([M.startFrac[0], D]);
2511
+ const z = Math.min(1, Math.max(x.startFrac[0] + 0.01, x.startFrac[1] + y));
2512
+ u([x.startFrac[0], z]);
2456
2513
  }
2457
- }, [d]), p = K((T) => {
2514
+ }, [g]), P = N((T) => {
2458
2515
  f.current = null;
2459
- const M = a.current;
2460
- M != null && M.releasePointerCapture(T.pointerId);
2461
- }, []), g = `${c[0] * 100}%`, I = `${(c[1] - c[0]) * 100}%`, L = n[0], P = L != null ? L.series.length : 0;
2462
- return /* @__PURE__ */ J("div", { className: i, style: { position: "relative", width: t, height: e }, children: [
2463
- /* @__PURE__ */ J(Ut, { width: t, height: e, data: n, children: [
2516
+ const x = a.current;
2517
+ x != null && x.releasePointerCapture(T.pointerId);
2518
+ }, []), h = `${c[0] * 100}%`, C = `${(c[1] - c[0]) * 100}%`, I = n[0], L = I != null ? I.series.length : 0;
2519
+ return /* @__PURE__ */ Q("div", { className: i, style: { position: "relative", width: t, height: e }, children: [
2520
+ /* @__PURE__ */ Q(Ut, { width: t, height: e, data: n, children: [
2464
2521
  /* @__PURE__ */ E(Lt, { id: "x" }),
2465
2522
  /* @__PURE__ */ E(Lt, { id: "y" }),
2466
2523
  /* @__PURE__ */ E(zt, { scale: "x", show: !1 }),
2467
2524
  /* @__PURE__ */ E(zt, { scale: "y", show: !1 }),
2468
- Array.from({ length: P }, (T, M) => /* @__PURE__ */ E(
2469
- Ce,
2525
+ Array.from({ length: L }, (T, x) => /* @__PURE__ */ E(
2526
+ Te,
2470
2527
  {
2471
2528
  group: 0,
2472
- index: M,
2529
+ index: x,
2473
2530
  yScale: "y",
2474
- stroke: l != null && l[M] != null ? l[M] : `hsl(${M * 137}, 60%, 50%)`,
2531
+ stroke: l != null && l[x] != null ? l[x] : `hsl(${x * 137}, 60%, 50%)`,
2475
2532
  width: 1
2476
2533
  },
2477
- M
2534
+ x
2478
2535
  ))
2479
2536
  ] }),
2480
- /* @__PURE__ */ J(
2537
+ /* @__PURE__ */ Q(
2481
2538
  "div",
2482
2539
  {
2483
2540
  ref: a,
2484
- onPointerDown: y,
2485
- onPointerMove: S,
2486
- onPointerUp: p,
2541
+ onPointerDown: M,
2542
+ onPointerMove: b,
2543
+ onPointerUp: P,
2487
2544
  style: {
2488
2545
  position: "absolute",
2489
2546
  top: 0,
@@ -2501,7 +2558,7 @@ function us({
2501
2558
  position: "absolute",
2502
2559
  top: 0,
2503
2560
  left: 0,
2504
- width: g,
2561
+ width: h,
2505
2562
  height: "100%",
2506
2563
  background: "rgba(0,0,0,0.3)",
2507
2564
  pointerEvents: "none"
@@ -2528,8 +2585,8 @@ function us({
2528
2585
  style: {
2529
2586
  position: "absolute",
2530
2587
  top: 0,
2531
- left: g,
2532
- width: I,
2588
+ left: h,
2589
+ width: C,
2533
2590
  height: "100%",
2534
2591
  borderLeft: "2px solid rgba(0,100,255,0.8)",
2535
2592
  borderRight: "2px solid rgba(0,100,255,0.8)",
@@ -2537,7 +2594,7 @@ function us({
2537
2594
  cursor: "grab",
2538
2595
  pointerEvents: "none"
2539
2596
  },
2540
- children: r && /* @__PURE__ */ J(Ae, { children: [
2597
+ children: r && /* @__PURE__ */ Q(Pe, { children: [
2541
2598
  /* @__PURE__ */ E("div", { style: {
2542
2599
  position: "absolute",
2543
2600
  left: -5,
@@ -2571,7 +2628,7 @@ function us({
2571
2628
  ] });
2572
2629
  }
2573
2630
  function Pt(t) {
2574
- const e = st(), n = X(t);
2631
+ const e = ot(), n = X(t);
2575
2632
  n.current = t, Y(() => {
2576
2633
  const s = (o) => n.current(o);
2577
2634
  return e.drawHooks.add(s), () => {
@@ -2579,8 +2636,8 @@ function Pt(t) {
2579
2636
  };
2580
2637
  }, [e]);
2581
2638
  }
2582
- function fs(t) {
2583
- const e = st(), n = X(t);
2639
+ function ds(t) {
2640
+ const e = ot(), n = X(t);
2584
2641
  n.current = t, Y(() => {
2585
2642
  const s = (o, i) => n.current(o, i);
2586
2643
  return e.cursorDrawHooks.add(s), () => {
@@ -2588,13 +2645,13 @@ function fs(t) {
2588
2645
  };
2589
2646
  }, [e]);
2590
2647
  }
2591
- function hs({
2648
+ function gs({
2592
2649
  lanes: t,
2593
2650
  laneHeight: e = 24,
2594
2651
  gap: n = 2,
2595
2652
  scaleId: s = "x"
2596
2653
  }) {
2597
- const o = st();
2654
+ const o = ot();
2598
2655
  return Pt(({ ctx: i, plotBox: l, pxRatio: r }) => {
2599
2656
  const a = o.scaleManager.getScale(s);
2600
2657
  if (a == null || a.min == null || a.max == null) return;
@@ -2604,21 +2661,21 @@ function hs({
2604
2661
  l.width * r,
2605
2662
  l.height * r
2606
2663
  ), i.clip();
2607
- const c = (e + n) * r, u = e * r, h = l.top * r;
2664
+ const c = (e + n) * r, u = e * r, d = l.top * r;
2608
2665
  for (let f = 0; f < t.length; f++) {
2609
- const d = t[f];
2610
- if (d == null) continue;
2611
- const y = h + f * c;
2612
- i.fillStyle = "#666", i.font = `${11 * r}px sans-serif`, i.textAlign = "right", i.textBaseline = "middle", i.fillText(d.label, (l.left - 6) * r, y + u / 2);
2613
- for (const S of d.segments) {
2614
- const p = V(S.start, a, l.width, l.left) * r, I = V(S.end, a, l.width, l.left) * r - p;
2615
- I <= 0 || (i.fillStyle = S.color ?? "#4dabf7", i.fillRect(p, y, I, u), S.label != null && I > 20 * r && (i.fillStyle = "#fff", i.font = `${10 * r}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(S.label, p + I / 2, y + u / 2, I - 4 * r)));
2666
+ const g = t[f];
2667
+ if (g == null) continue;
2668
+ const M = d + f * c;
2669
+ i.fillStyle = "#666", i.font = `${11 * r}px sans-serif`, i.textAlign = "right", i.textBaseline = "middle", i.fillText(g.label, (l.left - 6) * r, M + u / 2);
2670
+ for (const b of g.segments) {
2671
+ const P = H(b.start, a, l.width, l.left) * r, C = H(b.end, a, l.width, l.left) * r - P;
2672
+ C <= 0 || (i.fillStyle = b.color ?? "#4dabf7", i.fillRect(P, M, C, u), b.label != null && C > 20 * r && (i.fillStyle = "#fff", i.font = `${10 * r}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(b.label, P + C / 2, M + u / 2, C - 4 * r)));
2616
2673
  }
2617
2674
  }
2618
2675
  i.restore();
2619
2676
  }), null;
2620
2677
  }
2621
- function ds({
2678
+ function ps({
2622
2679
  data: t,
2623
2680
  width: e = 150,
2624
2681
  height: n = 30,
@@ -2629,13 +2686,13 @@ function ds({
2629
2686
  fillTo: r,
2630
2687
  className: a
2631
2688
  }) {
2632
- return /* @__PURE__ */ E("div", { style: { pointerEvents: "none" }, className: a, children: /* @__PURE__ */ J(Ut, { width: e, height: n, data: t, children: [
2689
+ return /* @__PURE__ */ E("div", { style: { pointerEvents: "none" }, className: a, children: /* @__PURE__ */ Q(Ut, { width: e, height: n, data: t, children: [
2633
2690
  /* @__PURE__ */ E(Lt, { id: "x" }),
2634
2691
  /* @__PURE__ */ E(Lt, { id: "y" }),
2635
2692
  /* @__PURE__ */ E(zt, { scale: "x", show: !1 }),
2636
2693
  /* @__PURE__ */ E(zt, { scale: "y", show: !1 }),
2637
2694
  /* @__PURE__ */ E(
2638
- Ce,
2695
+ Te,
2639
2696
  {
2640
2697
  group: 0,
2641
2698
  index: 0,
@@ -2649,18 +2706,18 @@ function ds({
2649
2706
  )
2650
2707
  ] }) });
2651
2708
  }
2652
- function gs({
2709
+ function ms({
2653
2710
  minWidth: t = 100,
2654
2711
  minHeight: e = 100,
2655
2712
  aspectRatio: n,
2656
2713
  initialHeight: s = 300,
2657
2714
  ...o
2658
2715
  }) {
2659
- const i = X(null), [l, r] = vt(null), a = K(
2716
+ const i = X(null), [l, r] = vt(null), a = N(
2660
2717
  (c) => {
2661
2718
  const u = Math.max(c.width, t);
2662
- let h;
2663
- return n != null ? h = Math.max(u / n, e) : h = Math.max(c.height || s, e), { width: Math.round(u), height: Math.round(h) };
2719
+ let d;
2720
+ return n != null ? d = Math.max(u / n, e) : d = Math.max(c.height || s, e), { width: Math.round(u), height: Math.round(d) };
2664
2721
  },
2665
2722
  [t, e, n, s]
2666
2723
  );
@@ -2669,13 +2726,13 @@ function gs({
2669
2726
  if (c == null) return;
2670
2727
  const u = c.getBoundingClientRect();
2671
2728
  if (r(a({ width: u.width, height: u.height })), typeof ResizeObserver > "u") return;
2672
- const h = new ResizeObserver((f) => {
2673
- const d = f[0];
2674
- if (d == null) return;
2675
- const { width: y, height: S } = d.contentRect;
2676
- r(a({ width: y, height: S }));
2729
+ const d = new ResizeObserver((f) => {
2730
+ const g = f[0];
2731
+ if (g == null) return;
2732
+ const { width: M, height: b } = g.contentRect;
2733
+ r(a({ width: M, height: b }));
2677
2734
  });
2678
- return h.observe(c), () => h.disconnect();
2735
+ return d.observe(c), () => d.disconnect();
2679
2736
  }, [a]), /* @__PURE__ */ E(
2680
2737
  "div",
2681
2738
  {
@@ -2688,29 +2745,29 @@ function gs({
2688
2745
  }
2689
2746
  );
2690
2747
  }
2691
- function Qn(t, e, n, s = {}) {
2692
- const { ctx: o, plotBox: i } = t, l = V(n, e, i.height, i.top);
2748
+ function es(t, e, n, s = {}) {
2749
+ const { ctx: o, plotBox: i } = t, l = H(n, e, i.height, i.top);
2693
2750
  o.beginPath(), o.moveTo(i.left, l), o.lineTo(i.left + i.width, l), o.strokeStyle = s.stroke ?? "red", o.lineWidth = s.width ?? 1, s.dash && o.setLineDash(s.dash), o.stroke(), s.dash && o.setLineDash([]);
2694
2751
  }
2695
- function ts(t, e, n, s = {}) {
2696
- const { ctx: o, plotBox: i } = t, l = V(n, e, i.width, i.left);
2752
+ function ns(t, e, n, s = {}) {
2753
+ const { ctx: o, plotBox: i } = t, l = H(n, e, i.width, i.left);
2697
2754
  o.beginPath(), o.moveTo(l, i.top), o.lineTo(l, i.top + i.height), o.strokeStyle = s.stroke ?? "red", o.lineWidth = s.width ?? 1, s.dash && o.setLineDash(s.dash), o.stroke(), s.dash && o.setLineDash([]);
2698
2755
  }
2699
- function ps(t, e, n, s, o, i, l = {}) {
2700
- const { ctx: r, plotBox: a } = t, c = V(s, e, a.width, a.left), u = V(o, n, a.height, a.top);
2756
+ function ws(t, e, n, s, o, i, l = {}) {
2757
+ const { ctx: r, plotBox: a } = t, c = H(s, e, a.width, a.left), u = H(o, n, a.height, a.top);
2701
2758
  r.font = l.font ?? "12px sans-serif", r.fillStyle = l.fill ?? "#000", r.textBaseline = "bottom", r.fillText(i, c, u - 4);
2702
2759
  }
2703
- function es(t, e, n, s, o = {}) {
2704
- const { ctx: i, plotBox: l } = t, r = V(s, e, l.height, l.top), a = V(n, e, l.height, l.top);
2760
+ function ss(t, e, n, s, o = {}) {
2761
+ const { ctx: i, plotBox: l } = t, r = H(s, e, l.height, l.top), a = H(n, e, l.height, l.top);
2705
2762
  i.fillStyle = o.fill ?? "rgba(255,0,0,0.1)", i.fillRect(l.left, Math.min(r, a), l.width, Math.abs(a - r)), o.stroke && (i.strokeStyle = o.stroke, i.lineWidth = o.width ?? 1, o.dash && i.setLineDash(o.dash), i.strokeRect(l.left, Math.min(r, a), l.width, Math.abs(a - r)), o.dash && i.setLineDash([]));
2706
2763
  }
2707
- function ms(t) {
2764
+ function vs(t) {
2708
2765
  const e = X(t);
2709
2766
  return Dt(() => {
2710
2767
  e.current = t;
2711
2768
  }), Pt((n) => {
2712
2769
  const s = e.current, o = s.yScale ?? "y", i = n.getScale(o);
2713
- if (i != null && (Qn(n, i, s.value, {
2770
+ if (i != null && (es(n, i, s.value, {
2714
2771
  stroke: s.stroke,
2715
2772
  width: s.width,
2716
2773
  dash: s.dash
@@ -2722,13 +2779,13 @@ function ms(t) {
2722
2779
  }
2723
2780
  }), null;
2724
2781
  }
2725
- function ws(t) {
2782
+ function Ms(t) {
2726
2783
  const e = X(t);
2727
2784
  return Dt(() => {
2728
2785
  e.current = t;
2729
2786
  }), Pt((n) => {
2730
2787
  const s = e.current, o = s.xScale ?? "x", i = n.getScale(o);
2731
- if (i != null && (ts(n, i, s.value, {
2788
+ if (i != null && (ns(n, i, s.value, {
2732
2789
  stroke: s.stroke,
2733
2790
  width: s.width,
2734
2791
  dash: s.dash
@@ -2740,13 +2797,13 @@ function ws(t) {
2740
2797
  }
2741
2798
  }), null;
2742
2799
  }
2743
- function vs(t) {
2800
+ function xs(t) {
2744
2801
  const e = X(t);
2745
2802
  return Dt(() => {
2746
2803
  e.current = t;
2747
2804
  }), Pt((n) => {
2748
2805
  const s = e.current, o = n.getScale(s.yScale ?? "y");
2749
- o != null && es(n, o, s.yMin, s.yMax, {
2806
+ o != null && ss(n, o, s.yMin, s.yMax, {
2750
2807
  fill: s.fill,
2751
2808
  stroke: s.stroke,
2752
2809
  width: s.strokeWidth,
@@ -2754,7 +2811,7 @@ function vs(t) {
2754
2811
  });
2755
2812
  }), null;
2756
2813
  }
2757
- function xs(t) {
2814
+ function bs(t) {
2758
2815
  const e = X(t);
2759
2816
  return Dt(() => {
2760
2817
  e.current = t;
@@ -2765,113 +2822,138 @@ function xs(t) {
2765
2822
  l.font = s.font ?? "12px sans-serif", l.fillStyle = s.fill ?? "#000", l.textAlign = s.align ?? "left", l.textBaseline = s.baseline ?? "bottom", l.fillText(s.text, o, i - 4);
2766
2823
  }), null;
2767
2824
  }
2768
- function Ms(t, e) {
2769
- const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] = vt(t), [r, a] = vt(!1), [c, u] = vt(0), h = X(0), f = X(0), d = X(0), y = K(
2770
- (g, ...I) => {
2771
- l((L) => {
2772
- const P = L[0];
2773
- if (P == null) return L;
2774
- const T = P.x, M = Math.max(0, T.length + g.length - n), w = M > 0 ? T.slice(M).concat(g) : T.concat(g), b = P.series.map((k, D) => {
2775
- const m = k, v = I[D] ?? [];
2776
- return M > 0 ? m.slice(M).concat(v) : m.concat(v);
2825
+ function Ss(t, e) {
2826
+ const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] = vt(t), [r, a] = vt(!1), [c, u] = vt(0), d = X(0), f = X(0), g = X(0), M = X(/* @__PURE__ */ new Map()), b = X(0), P = X(n);
2827
+ P.current = n;
2828
+ const h = N(
2829
+ (T, x, ...m) => {
2830
+ let S = M.current.get(T);
2831
+ S == null && (S = { x: [], series: m.map(() => []) }, M.current.set(T, S)), S.x.push(...x);
2832
+ for (let y = 0; y < m.length; y++) {
2833
+ let z = S.series[y];
2834
+ z == null && (z = [], S.series[y] = z), z.push(...m[y] ?? []);
2835
+ }
2836
+ b.current === 0 && (b.current = requestAnimationFrame(() => {
2837
+ b.current = 0;
2838
+ const y = M.current;
2839
+ M.current = /* @__PURE__ */ new Map();
2840
+ const z = P.current;
2841
+ l((p) => {
2842
+ const w = p.slice();
2843
+ for (const [v, { x: k, series: D }] of y) {
2844
+ const A = w[v];
2845
+ if (A == null) continue;
2846
+ const F = A.x, R = Math.max(0, F.length + k.length - z), _ = R > 0 ? F.slice(R).concat(k) : F.concat(k), V = A.series.map((B, W) => {
2847
+ const j = B, Z = D[W] ?? [];
2848
+ return R > 0 ? j.slice(R).concat(Z) : j.concat(Z);
2849
+ });
2850
+ w[v] = { x: _, series: V };
2851
+ }
2852
+ return w;
2777
2853
  });
2778
- return [{ x: w, series: b }];
2779
- });
2854
+ }));
2855
+ },
2856
+ []
2857
+ ), C = N(
2858
+ (T, ...x) => {
2859
+ h(0, T, ...x);
2780
2860
  },
2781
- [n]
2782
- ), S = K(() => {
2861
+ [h]
2862
+ ), I = N(() => {
2783
2863
  a(!0);
2784
- }, []), p = K(() => {
2864
+ }, []), L = N(() => {
2785
2865
  a(!1);
2786
2866
  }, []);
2787
2867
  return Y(() => {
2788
2868
  if (!r) {
2789
- h.current !== 0 && (cancelAnimationFrame(h.current), h.current = 0);
2869
+ d.current !== 0 && (cancelAnimationFrame(d.current), d.current = 0);
2790
2870
  return;
2791
2871
  }
2792
- d.current = performance.now(), f.current = 0;
2793
- const g = (I) => {
2872
+ g.current = performance.now(), f.current = 0;
2873
+ const T = (x) => {
2794
2874
  f.current++;
2795
- const L = I - d.current;
2796
- L >= 1e3 && (u(Math.round(f.current * 1e3 / L)), f.current = 0, d.current = I), h.current = requestAnimationFrame(g);
2875
+ const m = x - g.current;
2876
+ m >= 1e3 && (u(Math.round(f.current * 1e3 / m)), f.current = 0, g.current = x), d.current = requestAnimationFrame(T);
2797
2877
  };
2798
- return h.current = requestAnimationFrame(g), () => {
2799
- h.current !== 0 && (cancelAnimationFrame(h.current), h.current = 0);
2878
+ return d.current = requestAnimationFrame(T), () => {
2879
+ d.current !== 0 && (cancelAnimationFrame(d.current), d.current = 0);
2800
2880
  };
2801
- }, [r]), Y(() => {
2881
+ }, [r]), Y(() => () => {
2882
+ b.current !== 0 && cancelAnimationFrame(b.current);
2883
+ }, []), Y(() => {
2802
2884
  o && a(!0);
2803
- }, [o]), { data: i, push: y, start: S, stop: p, running: r, fps: c };
2885
+ }, [o]), { data: i, push: C, pushGroup: h, start: I, stop: L, running: r, fps: c };
2804
2886
  }
2805
- function Ss(t) {
2806
- return (e, n, s, o, i, l, r, a, c, u, h, f, d) => {
2807
- const y = (d == null ? void 0 : d.align) ?? t ?? 1, S = (d == null ? void 0 : d.spanGaps) ?? !1;
2887
+ function ys(t) {
2888
+ return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
2889
+ const M = (g == null ? void 0 : g.align) ?? t ?? 1, b = (g == null ? void 0 : g.spanGaps) ?? !1;
2808
2890
  if ([c, u] = Ft(n, c, u), c === -1)
2809
2891
  return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
2810
- const p = (k) => f(V(k, s, i, r)), g = (k) => f(V(k, o, l, a)), I = s.ori === G.Horizontal ? _t : Rt, L = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, P = L.stroke;
2892
+ const P = (y) => f(H(y, s, i, r)), h = (y) => f(H(y, o, l, a)), C = s.ori === G.Horizontal ? Rt : _t, I = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, L = I.stroke;
2811
2893
  let T = !1;
2812
- const M = h === O.Forward ? c : u;
2813
- let w = g(n[M]), b = p(e[M]);
2814
- I(P, b, w);
2815
- for (let k = M; k >= c && k <= u; k += h) {
2816
- const D = n[k];
2817
- if (D == null) {
2818
- D === null && !S && (T = !0);
2894
+ const x = d === K.Forward ? c : u;
2895
+ let m = h(n[x]), S = P(e[x]);
2896
+ C(L, S, m);
2897
+ for (let y = x; y >= c && y <= u; y += d) {
2898
+ const z = n[y];
2899
+ if (z == null) {
2900
+ z === null && !b && (T = !0);
2819
2901
  continue;
2820
2902
  }
2821
- const m = p(e[k]), v = g(D);
2822
- if (y === 1)
2823
- I(P, m, w);
2824
- else if (y === -1)
2825
- I(P, b, v);
2903
+ const p = P(e[y]), w = h(z);
2904
+ if (M === 1)
2905
+ C(L, p, m);
2906
+ else if (M === -1)
2907
+ C(L, S, w);
2826
2908
  else {
2827
- const x = f((b + m) / 2);
2828
- I(P, x, w), I(P, x, v);
2909
+ const v = f((S + p) / 2);
2910
+ C(L, v, m), C(L, v, w);
2829
2911
  }
2830
- I(P, m, v), w = v, b = m;
2912
+ C(L, p, w), m = w, S = p;
2831
2913
  }
2832
2914
  {
2833
- const k = L.fill = new Path2D(P), D = (d == null ? void 0 : d.fillTo) ?? o.min ?? 0, m = g(D);
2834
- let v = r, x = r + i;
2835
- h === O.Backward && ([x, v] = [v, x]), I(k, x, m), I(k, v, m);
2915
+ const y = I.fill = new Path2D(L), z = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, p = h(z);
2916
+ let w = r, v = r + i;
2917
+ d === K.Backward && ([v, w] = [w, v]), C(y, v, p), C(y, w, p);
2836
2918
  }
2837
2919
  if (T) {
2838
- const k = $t(e, n, c, u, h, p);
2839
- L.gaps = k, L.clip = Yt(k, s.ori, r, a, i, l);
2920
+ const y = Xt(e, n, c, u, d, P);
2921
+ I.gaps = y, I.clip = Yt(y, s.ori, r, a, i, l);
2840
2922
  }
2841
- return L;
2923
+ return I;
2842
2924
  };
2843
2925
  }
2844
- function bs() {
2845
- return (t, e, n, s, o, i, l, r, a, c, u, h, f) => {
2846
- const d = (f == null ? void 0 : f.barWidth) ?? 0.6, y = (f == null ? void 0 : f.barGap) ?? 0, S = (f == null ? void 0 : f.barRadius) ?? 0, p = (f == null ? void 0 : f.barGroupIdx) ?? 0, g = (f == null ? void 0 : f.barGroupCount) ?? 1, I = (x) => h(V(x, n, o, l)), L = (x) => h(V(x, s, i, r));
2847
- let P = o;
2926
+ function ks() {
2927
+ return (t, e, n, s, o, i, l, r, a, c, u, d, f) => {
2928
+ const g = (f == null ? void 0 : f.barWidth) ?? 0.6, M = (f == null ? void 0 : f.barGap) ?? 0, b = (f == null ? void 0 : f.barRadius) ?? 0, P = (f == null ? void 0 : f.barGroupIdx) ?? 0, h = (f == null ? void 0 : f.barGroupCount) ?? 1, C = (v) => d(H(v, n, o, l)), I = (v) => d(H(v, s, i, r));
2929
+ let L = o;
2848
2930
  if (c > a) {
2849
- let x = 1 / 0, C = -1;
2850
- for (let z = a; z <= c; z++)
2851
- if (e[z] != null) {
2852
- if (C >= 0) {
2853
- const A = t[z], F = t[C], _ = Math.abs(I(A) - I(F));
2854
- _ < x && (x = _);
2931
+ let v = 1 / 0, k = -1;
2932
+ for (let D = a; D <= c; D++)
2933
+ if (e[D] != null) {
2934
+ if (k >= 0) {
2935
+ const A = t[D], F = t[k], R = Math.abs(C(A) - C(F));
2936
+ R < v && (v = R);
2855
2937
  }
2856
- C = z;
2938
+ k = D;
2857
2939
  }
2858
- x < 1 / 0 && (P = x);
2859
- }
2860
- const T = P * (1 - d), M = Math.max(0, T + y), w = Math.max(1, h(P - M)), b = g > 1 ? Math.max(1, h(w / Math.max(1, g))) : w, k = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, D = L(k), m = new Path2D(), v = n.ori === G.Horizontal;
2861
- for (let x = u === O.Forward ? a : c; x >= a && x <= c; x += u) {
2862
- const C = e[x];
2863
- if (C == null) continue;
2864
- const z = I(t[x]), A = L(C), F = g > 1 ? (p - (g - 1) / 2) * b : 0, _ = h(z - b / 2 + F), R = Math.min(A, D), $ = Math.max(A, D) - R;
2865
- if ($ !== 0)
2866
- if (S > 0) {
2867
- const W = Math.min(S * b, $ / 2);
2868
- ns(m, v, _, R, b, $, W, C < k);
2940
+ v < 1 / 0 && (L = v);
2941
+ }
2942
+ const T = L * (1 - g), x = Math.max(0, T + M), m = Math.max(1, d(L - x)), S = h > 1 ? Math.max(1, d(m / Math.max(1, h))) : m, y = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, z = I(y), p = new Path2D(), w = n.ori === G.Horizontal;
2943
+ for (let v = u === K.Forward ? a : c; v >= a && v <= c; v += u) {
2944
+ const k = e[v];
2945
+ if (k == null) continue;
2946
+ const D = C(t[v]), A = I(k), F = h > 1 ? (P - (h - 1) / 2) * S : 0, R = d(D - S / 2 + F), _ = Math.min(A, z), B = Math.max(A, z) - _;
2947
+ if (B !== 0)
2948
+ if (b > 0) {
2949
+ const W = Math.min(b * S, B / 2);
2950
+ os(p, w, R, _, S, B, W, k < y);
2869
2951
  } else
2870
- v ? m.rect(_, R, b, $) : m.rect(R, _, $, b);
2952
+ w ? p.rect(R, _, S, B) : p.rect(_, R, B, S);
2871
2953
  }
2872
2954
  return {
2873
- stroke: m,
2874
- fill: m,
2955
+ stroke: p,
2956
+ fill: p,
2875
2957
  // bars are filled with the same path
2876
2958
  clip: null,
2877
2959
  band: null,
@@ -2879,74 +2961,74 @@ function bs() {
2879
2961
  };
2880
2962
  };
2881
2963
  }
2882
- function ns(t, e, n, s, o, i, l, r) {
2964
+ function os(t, e, n, s, o, i, l, r) {
2883
2965
  l = Math.min(l, o / 2, i / 2), e ? r ? (t.moveTo(n, s), t.lineTo(n + o, s), t.lineTo(n + o, s + i - l), t.arc(n + o - l, s + i - l, l, 0, Math.PI / 2), t.lineTo(n + l, s + i), t.arc(n + l, s + i - l, l, Math.PI / 2, Math.PI), t.closePath()) : (t.moveTo(n, s + i), t.lineTo(n, s + l), t.arc(n + l, s + l, l, Math.PI, Math.PI * 1.5), t.lineTo(n + o - l, s), t.arc(n + o - l, s + l, l, Math.PI * 1.5, 0), t.lineTo(n + o, s + i), t.closePath()) : r ? (t.moveTo(s, n), t.lineTo(s, n + o), t.lineTo(s + i - l, n + o), t.arc(s + i - l, n + o - l, l, Math.PI / 2, 0, !0), t.lineTo(s + i, n + l), t.arc(s + i - l, n + l, l, 0, -Math.PI / 2, !0), t.closePath()) : (t.moveTo(s + i, n), t.lineTo(s + l, n), t.arc(s + l, n + l, l, -Math.PI / 2, Math.PI, !0), t.lineTo(s, n + o - l), t.arc(s + l, n + o - l, l, Math.PI, Math.PI / 2, !0), t.lineTo(s + i, n + o), t.closePath());
2884
2966
  }
2885
- function Te(t) {
2886
- return (e, n, s, o, i, l, r, a, c, u, h, f, d) => {
2887
- const y = (d == null ? void 0 : d.spanGaps) ?? !1;
2967
+ function Ie(t) {
2968
+ return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
2969
+ const M = (g == null ? void 0 : g.spanGaps) ?? !1;
2888
2970
  if ([c, u] = Ft(n, c, u), c === -1)
2889
2971
  return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
2890
- const S = (b) => f(V(b, s, i, r)), p = (b) => f(V(b, o, l, a)), g = s.ori === G.Horizontal ? _t : Rt, I = [], L = [];
2891
- let P = !1;
2892
- for (let b = h === O.Forward ? c : u; b >= c && b <= u; b += h) {
2893
- const k = n[b];
2894
- k != null ? (I.push(S(e[b])), L.push(p(k))) : k === null && !y && (P = !0);
2895
- }
2896
- const T = s.ori === G.Horizontal, M = t(I, L, T, f), w = {
2897
- stroke: M ?? new Path2D(),
2972
+ const b = (S) => f(H(S, s, i, r)), P = (S) => f(H(S, o, l, a)), h = s.ori === G.Horizontal ? Rt : _t, C = [], I = [];
2973
+ let L = !1;
2974
+ for (let S = d === K.Forward ? c : u; S >= c && S <= u; S += d) {
2975
+ const y = n[S];
2976
+ y != null ? (C.push(b(e[S])), I.push(P(y))) : y === null && !M && (L = !0);
2977
+ }
2978
+ const T = s.ori === G.Horizontal, x = t(C, I, T, f), m = {
2979
+ stroke: x ?? new Path2D(),
2898
2980
  fill: null,
2899
2981
  clip: null,
2900
2982
  band: null,
2901
2983
  gaps: null
2902
2984
  };
2903
- if (M != null) {
2904
- const b = w.fill = new Path2D(M), k = (d == null ? void 0 : d.fillTo) ?? o.min ?? 0, D = p(k);
2905
- let m = r, v = r + i;
2906
- h === O.Backward && ([v, m] = [m, v]), g(b, v, D), g(b, m, D);
2985
+ if (x != null) {
2986
+ const S = m.fill = new Path2D(x), y = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, z = P(y);
2987
+ let p = r, w = r + i;
2988
+ d === K.Backward && ([w, p] = [p, w]), h(S, w, z), h(S, p, z);
2907
2989
  }
2908
- if (P) {
2909
- const b = $t(e, n, c, u, h, S);
2910
- w.gaps = b, w.clip = Yt(b, s.ori, r, a, i, l);
2990
+ if (L) {
2991
+ const S = Xt(e, n, c, u, d, b);
2992
+ m.gaps = S, m.clip = Yt(S, s.ori, r, a, i, l);
2911
2993
  }
2912
- return w;
2994
+ return m;
2913
2995
  };
2914
2996
  }
2915
- function ys() {
2916
- return Te(ss);
2997
+ function Cs() {
2998
+ return Ie(ls);
2917
2999
  }
2918
- const ss = (t, e, n, s) => {
3000
+ const ls = (t, e, n, s) => {
2919
3001
  const o = t.length;
2920
3002
  if (o < 2) return null;
2921
3003
  const i = new Path2D(), l = t[0] ?? 0, r = e[0] ?? 0;
2922
3004
  if (n ? i.moveTo(l, r) : i.moveTo(r, l), o === 2) {
2923
- const f = t[1] ?? 0, d = e[1] ?? 0;
2924
- return n ? i.lineTo(f, d) : i.lineTo(d, f), i;
3005
+ const f = t[1] ?? 0, g = e[1] ?? 0;
3006
+ return n ? i.lineTo(f, g) : i.lineTo(g, f), i;
2925
3007
  }
2926
- const a = new Array(o), c = new Array(o - 1), u = new Array(o - 1), h = new Array(o - 1);
3008
+ const a = new Array(o), c = new Array(o - 1), u = new Array(o - 1), d = new Array(o - 1);
2927
3009
  for (let f = 0; f < o - 1; f++)
2928
- u[f] = (e[f + 1] ?? 0) - (e[f] ?? 0), h[f] = (t[f + 1] ?? 0) - (t[f] ?? 0), c[f] = h[f] !== 0 ? (u[f] ?? 0) / (h[f] ?? 1) : 0;
3010
+ u[f] = (e[f + 1] ?? 0) - (e[f] ?? 0), d[f] = (t[f + 1] ?? 0) - (t[f] ?? 0), c[f] = d[f] !== 0 ? (u[f] ?? 0) / (d[f] ?? 1) : 0;
2929
3011
  a[0] = c[0] ?? 0;
2930
3012
  for (let f = 1; f < o - 1; f++) {
2931
- const d = c[f] ?? 0, y = c[f - 1] ?? 0;
2932
- if (d === 0 || y === 0 || y > 0 != d > 0)
3013
+ const g = c[f] ?? 0, M = c[f - 1] ?? 0;
3014
+ if (g === 0 || M === 0 || M > 0 != g > 0)
2933
3015
  a[f] = 0;
2934
3016
  else {
2935
- const S = h[f] ?? 1, p = h[f - 1] ?? 1;
2936
- a[f] = 3 * (p + S) / ((2 * S + p) / y + (S + 2 * p) / d), isFinite(a[f] ?? 0) || (a[f] = 0);
3017
+ const b = d[f] ?? 1, P = d[f - 1] ?? 1;
3018
+ a[f] = 3 * (P + b) / ((2 * b + P) / M + (b + 2 * P) / g), isFinite(a[f] ?? 0) || (a[f] = 0);
2937
3019
  }
2938
3020
  }
2939
3021
  a[o - 1] = c[o - 2] ?? 0;
2940
3022
  for (let f = 0; f < o - 1; f++) {
2941
- const d = h[f] ?? 1, y = t[f] ?? 0, S = e[f] ?? 0, p = t[f + 1] ?? 0, g = e[f + 1] ?? 0, I = a[f] ?? 0, L = a[f + 1] ?? 0, P = y + d / 3, T = S + I * d / 3, M = p - d / 3, w = g - L * d / 3;
2942
- n ? i.bezierCurveTo(P, T, M, w, p, g) : i.bezierCurveTo(T, P, w, M, g, p);
3023
+ const g = d[f] ?? 1, M = t[f] ?? 0, b = e[f] ?? 0, P = t[f + 1] ?? 0, h = e[f + 1] ?? 0, C = a[f] ?? 0, I = a[f + 1] ?? 0, L = M + g / 3, T = b + C * g / 3, x = P - g / 3, m = h - I * g / 3;
3024
+ n ? i.bezierCurveTo(L, T, x, m, P, h) : i.bezierCurveTo(T, L, m, x, h, P);
2943
3025
  }
2944
3026
  return i;
2945
3027
  };
2946
- function ks() {
2947
- return Te(os);
3028
+ function Ts() {
3029
+ return Ie(is);
2948
3030
  }
2949
- const os = (t, e, n, s) => {
3031
+ const is = (t, e, n, s) => {
2950
3032
  const o = t.length;
2951
3033
  if (o < 2) return null;
2952
3034
  const i = new Path2D(), l = s(t[0] ?? 0), r = s(e[0] ?? 0);
@@ -2955,41 +3037,41 @@ const os = (t, e, n, s) => {
2955
3037
  return n ? i.lineTo(a, c) : i.lineTo(c, a), i;
2956
3038
  }
2957
3039
  for (let a = 0; a < o - 1; a++) {
2958
- const c = a === 0 ? 0 : a - 1, u = t[c] ?? 0, h = e[c] ?? 0, f = t[a] ?? 0, d = e[a] ?? 0, y = t[a + 1] ?? 0, S = e[a + 1] ?? 0, p = a + 2 < o ? t[a + 2] ?? 0 : y, g = a + 2 < o ? e[a + 2] ?? 0 : S, I = Math.hypot(u - f, h - d), L = Math.hypot(f - y, d - S), P = Math.hypot(y - p, S - g), T = Math.sqrt(P), M = P, w = Math.sqrt(L), b = L, k = Math.sqrt(I), D = I, m = 2 * D + 3 * k * w + b, v = 2 * M + 3 * T * w + b, x = 3 * k * (k + w), C = 3 * T * (T + w);
2959
- let z, A, F, _;
2960
- if (x > 0) {
2961
- const R = 1 / x;
2962
- z = (-b * u + m * f + D * y) * R, A = (-b * h + m * d + D * S) * R;
3040
+ const c = a === 0 ? 0 : a - 1, u = t[c] ?? 0, d = e[c] ?? 0, f = t[a] ?? 0, g = e[a] ?? 0, M = t[a + 1] ?? 0, b = e[a + 1] ?? 0, P = a + 2 < o ? t[a + 2] ?? 0 : M, h = a + 2 < o ? e[a + 2] ?? 0 : b, C = Math.hypot(u - f, d - g), I = Math.hypot(f - M, g - b), L = Math.hypot(M - P, b - h), T = Math.sqrt(L), x = L, m = Math.sqrt(I), S = I, y = Math.sqrt(C), z = C, p = 2 * z + 3 * y * m + S, w = 2 * x + 3 * T * m + S, v = 3 * y * (y + m), k = 3 * T * (T + m);
3041
+ let D, A, F, R;
3042
+ if (v > 0) {
3043
+ const _ = 1 / v;
3044
+ D = (-S * u + p * f + z * M) * _, A = (-S * d + p * g + z * b) * _;
2963
3045
  } else
2964
- z = f, A = d;
2965
- if (C > 0) {
2966
- const R = 1 / C;
2967
- F = (M * f + v * y - b * p) * R, _ = (M * d + v * S - b * g) * R;
3046
+ D = f, A = g;
3047
+ if (k > 0) {
3048
+ const _ = 1 / k;
3049
+ F = (x * f + w * M - S * P) * _, R = (x * g + w * b - S * h) * _;
2968
3050
  } else
2969
- F = y, _ = S;
2970
- n ? i.bezierCurveTo(z, A, F, _, y, S) : i.bezierCurveTo(A, z, _, F, S, y);
3051
+ F = M, R = b;
3052
+ n ? i.bezierCurveTo(D, A, F, R, M, b) : i.bezierCurveTo(A, D, R, F, b, M);
2971
3053
  }
2972
3054
  return i;
2973
3055
  };
2974
- function Cs(t = 4) {
2975
- return (e, n, s, o, i, l, r, a, c, u, h, f, d) => {
2976
- const y = (L) => f(V(L, s, i, r)), S = (L) => f(V(L, o, l, a)), p = t / 2, g = new Path2D(), I = s.ori === G.Horizontal;
2977
- for (let L = h === O.Forward ? c : u; L >= c && L <= u; L += h) {
2978
- const P = n[L];
2979
- if (P == null) continue;
2980
- const T = y(e[L]), M = S(P);
2981
- I ? (g.moveTo(T + p, M), g.arc(T, M, p, 0, Math.PI * 2)) : (g.moveTo(M + p, T), g.arc(M, T, p, 0, Math.PI * 2));
3056
+ function Is(t = 4) {
3057
+ return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
3058
+ const M = (I) => f(H(I, s, i, r)), b = (I) => f(H(I, o, l, a)), P = t / 2, h = new Path2D(), C = s.ori === G.Horizontal;
3059
+ for (let I = d === K.Forward ? c : u; I >= c && I <= u; I += d) {
3060
+ const L = n[I];
3061
+ if (L == null) continue;
3062
+ const T = M(e[I]), x = b(L);
3063
+ C ? (h.moveTo(T + P, x), h.arc(T, x, P, 0, Math.PI * 2)) : (h.moveTo(x + P, T), h.arc(x, T, P, 0, Math.PI * 2));
2982
3064
  }
2983
3065
  return {
2984
- stroke: g,
2985
- fill: g,
3066
+ stroke: h,
3067
+ fill: h,
2986
3068
  clip: null,
2987
3069
  band: null,
2988
3070
  gaps: null
2989
3071
  };
2990
3072
  };
2991
3073
  }
2992
- function Ts(t) {
3074
+ function As(t) {
2993
3075
  return ({ ctx: e, plotBox: n, pxRatio: s }) => {
2994
3076
  const {
2995
3077
  xValues: o,
@@ -2999,52 +3081,52 @@ function Ts(t) {
2999
3081
  close: a,
3000
3082
  xScale: c,
3001
3083
  yScale: u,
3002
- upColor: h = "#26a69a",
3084
+ upColor: d = "#26a69a",
3003
3085
  downColor: f = "#ef5350",
3004
- bodyWidth: d = 0.6,
3005
- wickWidth: y = 1
3086
+ bodyWidth: g = 0.6,
3087
+ wickWidth: M = 1
3006
3088
  } = t;
3007
3089
  if (c.min == null || c.max == null || u.min == null || u.max == null) return;
3008
- const S = o.length;
3009
- if (S === 0) return;
3010
- const g = Math.max(2, n.width / S * d) * s / 2;
3090
+ const b = o.length;
3091
+ if (b === 0) return;
3092
+ const h = Math.max(2, n.width / b * g) * s / 2;
3011
3093
  e.save();
3012
- for (let I = 0; I < S; I++) {
3013
- const L = o[I], P = i[I], T = l[I], M = r[I], w = a[I];
3014
- if (L == null || P == null || T == null || M == null || w == null) continue;
3015
- const b = V(L, c, n.width, n.left) * s, k = V(P, u, n.height, n.top) * s, D = V(T, u, n.height, n.top) * s, m = V(M, u, n.height, n.top) * s, v = V(w, u, n.height, n.top) * s, C = w >= P ? h : f;
3016
- e.strokeStyle = C, e.lineWidth = y * s, e.beginPath(), e.moveTo(b, D), e.lineTo(b, m), e.stroke();
3017
- const z = Math.min(k, v), A = Math.abs(v - k);
3018
- e.fillStyle = C, e.fillRect(b - g, z, g * 2, Math.max(A, 1 * s));
3094
+ for (let C = 0; C < b; C++) {
3095
+ const I = o[C], L = i[C], T = l[C], x = r[C], m = a[C];
3096
+ if (I == null || L == null || T == null || x == null || m == null) continue;
3097
+ const S = H(I, c, n.width, n.left) * s, y = H(L, u, n.height, n.top) * s, z = H(T, u, n.height, n.top) * s, p = H(x, u, n.height, n.top) * s, w = H(m, u, n.height, n.top) * s, k = m >= L ? d : f;
3098
+ e.strokeStyle = k, e.lineWidth = M * s, e.beginPath(), e.moveTo(S, z), e.lineTo(S, p), e.stroke();
3099
+ const D = Math.min(y, w), A = Math.abs(w - y);
3100
+ e.fillStyle = k, e.fillRect(S - h, D, h * 2, Math.max(A, 1 * s));
3019
3101
  }
3020
3102
  e.restore();
3021
3103
  };
3022
3104
  }
3023
- function Is(t, e, n = 0) {
3105
+ function Ps(t, e, n = 0) {
3024
3106
  const s = e ?? t.series.map((c, u) => u), o = t.x.length, i = [], l = new Float64Array(o);
3025
3107
  for (let c = 0; c < s.length; c++) {
3026
3108
  const u = s[c];
3027
3109
  if (u == null) continue;
3028
- const h = t.series[u];
3029
- if (h == null) continue;
3110
+ const d = t.series[u];
3111
+ if (d == null) continue;
3030
3112
  const f = new Array(o);
3031
- for (let d = 0; d < o; d++) {
3032
- const y = h[d];
3033
- y != null ? (l[d] = l[d] + y, f[d] = l[d]) : f[d] = null;
3113
+ for (let g = 0; g < o; g++) {
3114
+ const M = d[g];
3115
+ M != null ? (l[g] = l[g] + M, f[g] = l[g]) : f[g] = null;
3034
3116
  }
3035
3117
  i.push(f);
3036
3118
  }
3037
3119
  const r = [];
3038
3120
  for (let c = 0; c < t.series.length; c++) {
3039
- const u = s.indexOf(c), h = u >= 0 ? i[u] : void 0;
3040
- h != null ? r.push(h) : r.push(t.series[c] ?? []);
3121
+ const u = s.indexOf(c), d = u >= 0 ? i[u] : void 0;
3122
+ d != null ? r.push(d) : r.push(t.series[c] ?? []);
3041
3123
  }
3042
3124
  const a = [];
3043
3125
  for (let c = s.length - 1; c > 0; c--) {
3044
- const u = s[c], h = s[c - 1];
3045
- u != null && h != null && a.push({
3126
+ const u = s[c], d = s[c - 1];
3127
+ u != null && d != null && a.push({
3046
3128
  group: n,
3047
- series: [u, h]
3129
+ series: [u, d]
3048
3130
  });
3049
3131
  }
3050
3132
  return {
@@ -3052,7 +3134,7 @@ function Is(t, e, n = 0) {
3052
3134
  bands: a
3053
3135
  };
3054
3136
  }
3055
- function As(t) {
3137
+ function Ls(t) {
3056
3138
  const e = /* @__PURE__ */ new Set();
3057
3139
  for (const [i] of t)
3058
3140
  for (let l = 0; l < i.length; l++) {
@@ -3077,35 +3159,35 @@ function As(t) {
3077
3159
  }
3078
3160
  return [{ x: n, series: o }];
3079
3161
  }
3080
- function Ps(t) {
3162
+ function zs(t) {
3081
3163
  const e = (t == null ? void 0 : t.decimals) ?? 1;
3082
3164
  return (n) => n.map((s) => {
3083
3165
  const o = Math.abs(s);
3084
3166
  return o >= 1e9 ? (s / 1e9).toFixed(e) + "B" : o >= 1e6 ? (s / 1e6).toFixed(e) + "M" : o >= 1e3 ? (s / 1e3).toFixed(e) + "K" : s.toFixed(o >= 1 ? 0 : e);
3085
3167
  });
3086
3168
  }
3087
- function Ls(t, e = 0) {
3169
+ function Ds(t, e = 0) {
3088
3170
  return (n) => n.map((s) => s.toFixed(e) + t);
3089
3171
  }
3090
- function zs(t) {
3172
+ function Fs(t) {
3091
3173
  const e = (t == null ? void 0 : t.utc) ?? !1;
3092
- return (n) => n.map((s) => e ? et(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }, "UTC") : et(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }));
3174
+ return (n) => n.map((s) => e ? nt(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }, "UTC") : nt(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }));
3093
3175
  }
3094
- function Ds(t) {
3176
+ function Rs(t) {
3095
3177
  const e = t != null && t.utc ? "UTC" : void 0, n = (t == null ? void 0 : t.format) ?? "short";
3096
- return (s) => s.map((o) => et(o, { month: n }, e));
3178
+ return (s) => s.map((o) => nt(o, { month: n }, e));
3097
3179
  }
3098
- function Fs(t) {
3180
+ function _s(t) {
3099
3181
  const { tz: e, ...n } = t ?? {};
3100
- return (s) => s.map((o) => et(o, n, e));
3182
+ return (s) => s.map((o) => nt(o, n, e));
3101
3183
  }
3102
- function _s(t, e = 0) {
3184
+ function Gs(t, e = 0) {
3103
3185
  return (n) => n.map((s) => {
3104
3186
  const o = Math.round(s) - e;
3105
3187
  return t[o] ?? String(s);
3106
3188
  });
3107
3189
  }
3108
- function Ie(t) {
3190
+ function Ae(t) {
3109
3191
  const e = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(t);
3110
3192
  if (e)
3111
3193
  return [
@@ -3123,8 +3205,8 @@ function Ie(t) {
3123
3205
  const s = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);
3124
3206
  return s ? [Number(s[1]), Number(s[2]), Number(s[3])] : null;
3125
3207
  }
3126
- function Rs(t, e = 0.8, n = 0) {
3127
- const s = Ie(t);
3208
+ function Hs(t, e = 0.8, n = 0) {
3209
+ const s = Ae(t);
3128
3210
  if (s == null)
3129
3211
  return { type: "linear", stops: [[0, t], [1, t]] };
3130
3212
  const [o, i, l] = s;
@@ -3136,13 +3218,13 @@ function Rs(t, e = 0.8, n = 0) {
3136
3218
  ]
3137
3219
  };
3138
3220
  }
3139
- function Gs(t, e) {
3140
- const n = Ie(t);
3221
+ function Vs(t, e) {
3222
+ const n = Ae(t);
3141
3223
  if (n == null) return t;
3142
3224
  const [s, o, i] = n;
3143
3225
  return `rgba(${s},${o},${i},${e})`;
3144
3226
  }
3145
- function Vs(t, e = 65, n = 50) {
3227
+ function $s(t, e = 65, n = 50) {
3146
3228
  const s = [];
3147
3229
  for (let i = 0; i < t; i++) {
3148
3230
  const l = i * 137.508 % 360;
@@ -3151,53 +3233,53 @@ function Vs(t, e = 65, n = 50) {
3151
3233
  return s;
3152
3234
  }
3153
3235
  export {
3154
- xs as AnnotationLabel,
3236
+ bs as AnnotationLabel,
3155
3237
  zt as Axis,
3156
- rs as Band,
3238
+ cs as Band,
3157
3239
  Ut as Chart,
3158
- O as Direction,
3159
- N as Distribution,
3160
- ms as HLine,
3161
- as as Legend,
3240
+ K as Direction,
3241
+ O as Distribution,
3242
+ vs as HLine,
3243
+ us as Legend,
3162
3244
  G as Orientation,
3163
- vs as Region,
3164
- gs as ResponsiveChart,
3245
+ xs as Region,
3246
+ ms as ResponsiveChart,
3165
3247
  Lt as Scale,
3166
- Ce as Series,
3248
+ Te as Series,
3167
3249
  U as Side,
3168
3250
  yt as SortOrder,
3169
- ds as Sparkline,
3170
- hs as Timeline,
3171
- cs as Tooltip,
3172
- ws as VLine,
3173
- us as ZoomRanger,
3174
- As as alignData,
3175
- bs as bars,
3176
- ks as catmullRom,
3177
- Ts as drawCandlesticks,
3178
- Qn as drawHLine,
3179
- ps as drawLabel,
3180
- es as drawRegion,
3181
- ts as drawVLine,
3182
- Rs as fadeGradient,
3183
- Ps as fmtCompact,
3184
- Fs as fmtDateStr,
3185
- zs as fmtHourMin,
3186
- _s as fmtLabels,
3187
- Ds as fmtMonthName,
3188
- Ls as fmtSuffix,
3189
- Je as linear,
3190
- ys as monotoneCubic,
3191
- Vs as palette,
3192
- Cs as points,
3251
+ ps as Sparkline,
3252
+ gs as Timeline,
3253
+ fs as Tooltip,
3254
+ Ms as VLine,
3255
+ hs as ZoomRanger,
3256
+ Ls as alignData,
3257
+ ks as bars,
3258
+ Ts as catmullRom,
3259
+ As as drawCandlesticks,
3260
+ es as drawHLine,
3261
+ ws as drawLabel,
3262
+ ss as drawRegion,
3263
+ ns as drawVLine,
3264
+ Hs as fadeGradient,
3265
+ zs as fmtCompact,
3266
+ _s as fmtDateStr,
3267
+ Fs as fmtHourMin,
3268
+ Gs as fmtLabels,
3269
+ Rs as fmtMonthName,
3270
+ Ds as fmtSuffix,
3271
+ Qe as linear,
3272
+ Cs as monotoneCubic,
3273
+ $s as palette,
3274
+ Is as points,
3193
3275
  it as posToVal,
3194
- Mt as sideOrientation,
3195
- Is as stackGroup,
3196
- Ss as stepped,
3197
- st as useChart,
3198
- fs as useCursorDrawHook,
3276
+ xt as sideOrientation,
3277
+ Ps as stackGroup,
3278
+ ys as stepped,
3279
+ ot as useChart,
3280
+ ds as useCursorDrawHook,
3199
3281
  Pt as useDrawHook,
3200
- Ms as useStreamingData,
3201
- V as valToPos,
3202
- Gs as withAlpha
3282
+ Ss as useStreamingData,
3283
+ H as valToPos,
3284
+ Vs as withAlpha
3203
3285
  };