@umriss-ui/charts 0.3.1 → 0.3.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/charts.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import "./charts.css";
2
- var ye = Object.defineProperty;
3
- var ge = (n, t, e) => t in n ? ye(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
4
- var g = (n, t, e) => ge(n, typeof t != "symbol" ? t + "" : t, e);
5
- import { jsx as I, jsxs as _, Fragment as Nt } from "react/jsx-runtime";
6
- import { useRef as X, useEffect as D, createContext as be, useContext as xe, useSyncExternalStore as Et, useCallback as ve, useState as ke, useMemo as E } from "react";
7
- function Ne() {
2
+ var be = Object.defineProperty;
3
+ var xe = (n, t, e) => t in n ? be(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
4
+ var g = (n, t, e) => xe(n, typeof t != "symbol" ? t + "" : t, e);
5
+ import { jsx as S, jsxs as _, Fragment as Nt } from "react/jsx-runtime";
6
+ import { useRef as Z, useEffect as $, createContext as ve, useContext as ke, useSyncExternalStore as Et, useCallback as Ne, useState as we, useMemo as E } from "react";
7
+ function Ie() {
8
8
  var t;
9
9
  const n = import.meta;
10
10
  return typeof ((t = n.env) == null ? void 0 : t.DEV) == "boolean" ? n.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
11
11
  }
12
- const it = Ne();
13
- function ct(n, t) {
14
- if (it && !n)
12
+ const rt = Ie();
13
+ function ut(n, t) {
14
+ if (rt && !n)
15
15
  throw new Error(`@umriss-ui/charts: ${t}`);
16
16
  }
17
- const Ot = /* @__PURE__ */ new Set();
18
- function G(n, t) {
19
- !it || Ot.has(n) || (Ot.add(n), console.warn(`@umriss-ui/charts: ${t}`));
17
+ const Wt = /* @__PURE__ */ new Set();
18
+ function q(n, t) {
19
+ !rt || Wt.has(n) || (Wt.add(n), console.warn(`@umriss-ui/charts: ${t}`));
20
20
  }
21
- const W = {
21
+ const O = {
22
22
  colorAxis: "rgba(23, 23, 23, 0.17)",
23
23
  colorGrid: "rgba(23, 23, 23, 0.06)",
24
24
  colorText: "#71717a",
@@ -37,7 +37,7 @@ function bt(n, t, e) {
37
37
  const i = n.getPropertyValue(t).trim();
38
38
  return i === "" ? e : i;
39
39
  }
40
- function ne(n, t) {
40
+ function ie(n, t) {
41
41
  const e = n.ownerDocument.createElement("span");
42
42
  e.setAttribute("aria-hidden", "true"), e.style.position = "absolute", e.style.visibility = "hidden", n.appendChild(e);
43
43
  try {
@@ -50,60 +50,60 @@ function ne(n, t) {
50
50
  e.remove();
51
51
  }
52
52
  }
53
- function we(n) {
53
+ function Se(n) {
54
54
  const t = getComputedStyle(n);
55
- return ne(n, (e) => {
56
- const i = (s, o) => {
57
- const a = bt(t, s, o);
58
- if (a === o) return o;
59
- const l = e(`var(${s})`);
60
- return l === `var(${s})` ? a : l;
55
+ return ie(n, (e) => {
56
+ const i = (o, s) => {
57
+ const a = bt(t, o, s);
58
+ if (a === s) return s;
59
+ const l = e(`var(${o})`);
60
+ return l === `var(${o})` ? a : l;
61
61
  }, r = [];
62
- for (let s = 1; s <= 6; s++)
63
- r.push(i(`--uc-series-${s}`, W.series[s - 1] ?? "#2563eb"));
62
+ for (let o = 1; o <= 6; o++)
63
+ r.push(i(`--uc-series-${o}`, O.series[o - 1] ?? "#2563eb"));
64
64
  return {
65
- colorAxis: i("--uc-color-axis", W.colorAxis),
66
- colorGrid: i("--uc-color-grid", W.colorGrid),
67
- colorText: i("--uc-color-text", W.colorText),
68
- colorBg: i("--uc-color-bg", W.colorBg),
69
- colorWarning: i("--uc-color-warning", W.colorWarning),
70
- colorAlarm: i("--uc-color-alarm", W.colorAlarm),
71
- colorOk: i("--uc-color-ok", W.colorOk),
72
- font: bt(t, "--uc-font", W.font),
73
- fontMono: bt(t, "--uc-font-mono", W.fontMono),
65
+ colorAxis: i("--uc-color-axis", O.colorAxis),
66
+ colorGrid: i("--uc-color-grid", O.colorGrid),
67
+ colorText: i("--uc-color-text", O.colorText),
68
+ colorBg: i("--uc-color-bg", O.colorBg),
69
+ colorWarning: i("--uc-color-warning", O.colorWarning),
70
+ colorAlarm: i("--uc-color-alarm", O.colorAlarm),
71
+ colorOk: i("--uc-color-ok", O.colorOk),
72
+ font: bt(t, "--uc-font", O.font),
73
+ fontMono: bt(t, "--uc-font-mono", O.fontMono),
74
74
  series: r
75
75
  };
76
76
  });
77
77
  }
78
- function ie() {
78
+ function re() {
79
79
  var n, t;
80
80
  gt === null && (typeof MutationObserver > "u" || typeof document > "u" || (gt = new MutationObserver(() => Rt()), gt.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && ((t = (n = window.matchMedia("(prefers-color-scheme: dark)")).addEventListener) == null || t.call(n, "change", () => Rt()))));
81
81
  }
82
- function Xn(n, t) {
83
- return ie(), ne(n, (e) => {
82
+ function jn(n, t) {
83
+ return re(), ie(n, (e) => {
84
84
  const i = {};
85
85
  for (const r of Object.keys(t)) i[r] = e(t[r]);
86
86
  return i;
87
87
  });
88
88
  }
89
- function Ie(n) {
90
- ie();
89
+ function Me(n) {
90
+ re();
91
91
  const t = Ht.get(n);
92
92
  if (t !== void 0 && t.generation === wt) return t.theme;
93
- const e = we(n);
93
+ const e = Se(n);
94
94
  return Ht.set(n, { generation: wt, theme: e }), e;
95
95
  }
96
96
  function Rt() {
97
97
  wt++;
98
98
  for (const n of It) n();
99
99
  }
100
- function Se(n) {
100
+ function Le(n) {
101
101
  return It.add(n), () => {
102
102
  It.delete(n);
103
103
  };
104
104
  }
105
- const Me = { width: 0, height: 0 };
106
- class Te {
105
+ const Te = { width: 0, height: 0 };
106
+ class Ae {
107
107
  constructor(t) {
108
108
  g(this, "span", null);
109
109
  g(this, "root");
@@ -120,10 +120,10 @@ class Te {
120
120
  measure(t, e) {
121
121
  const i = `${e}|${t}`, r = this.cache.get(i);
122
122
  if (r !== void 0) return r;
123
- const s = this.ensure();
124
- if (s === null) return Me;
125
- s.className = `uc-measure ${e}`, s.textContent = t;
126
- const o = s.getBoundingClientRect(), a = { width: o.width, height: o.height };
123
+ const o = this.ensure();
124
+ if (o === null) return Te;
125
+ o.className = `uc-measure ${e}`, o.textContent = t;
126
+ const s = o.getBoundingClientRect(), a = { width: s.width, height: s.height };
127
127
  return this.cache.set(i, a), a;
128
128
  }
129
129
  clear() {
@@ -139,8 +139,8 @@ function St(n) {
139
139
  }
140
140
  function mt(n, t) {
141
141
  if (!Number.isFinite(n) || n <= 0) return 1;
142
- const e = Math.max(1, Math.floor(t)), i = n / e, r = Math.pow(10, Math.floor(Math.log10(i))), s = i / r, o = 1e-9;
143
- return (s <= 1 + o ? 1 : s <= 2 + o ? 2 : s <= 5 + o ? 5 : 10) * r;
142
+ const e = Math.max(1, Math.floor(t)), i = n / e, r = Math.pow(10, Math.floor(Math.log10(i))), o = i / r, s = 1e-9;
143
+ return (o <= 1 + s ? 1 : o <= 2 + s ? 2 : o <= 5 + s ? 5 : 10) * r;
144
144
  }
145
145
  function Dt(n) {
146
146
  const t = Math.abs(n);
@@ -155,7 +155,7 @@ function Dt(n) {
155
155
  function Mt(n, t) {
156
156
  return t <= 0 || !Number.isFinite(n) || Math.abs(n) >= 1e21 ? St(n) : St(Number(n.toFixed(Math.min(20, t))));
157
157
  }
158
- function Ae(n, t, e) {
158
+ function Fe(n, t, e) {
159
159
  if (!Number.isFinite(n) || !Number.isFinite(t)) return [0, 1];
160
160
  if (n === t) return [n - 1, t + 1];
161
161
  const i = mt(t - n, e), r = Dt(i);
@@ -167,14 +167,14 @@ function Ae(n, t, e) {
167
167
  function Vt(n, t) {
168
168
  return !Number.isFinite(n) || !Number.isFinite(t) ? [0, 1] : n === t ? [n - 1, t + 1] : [n, t];
169
169
  }
170
- function re(n, t, e) {
170
+ function oe(n, t, e) {
171
171
  if (!Number.isFinite(n) || !Number.isFinite(t)) return [];
172
172
  if (n === t) return [St(n)];
173
- const [i, r] = n < t ? [n, t] : [t, n], s = mt(r - i, e), o = Dt(s), a = s * 1e-9, l = Math.ceil((i - a) / s), c = Math.floor((r + a) / s);
173
+ const [i, r] = n < t ? [n, t] : [t, n], o = mt(r - i, e), s = Dt(o), a = o * 1e-9, l = Math.ceil((i - a) / o), c = Math.floor((r + a) / o);
174
174
  if (!Number.isFinite(l) || !Number.isFinite(c)) return [];
175
175
  const u = [];
176
176
  for (let h = l; h <= c; h++)
177
- u.push(Mt(h * s, o));
177
+ u.push(Mt(h * o, s));
178
178
  return u;
179
179
  }
180
180
  class _t {
@@ -195,17 +195,17 @@ class _t {
195
195
  return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
196
196
  }
197
197
  ticks(t) {
198
- return re(this.domain[0], this.domain[1], t);
198
+ return oe(this.domain[0], this.domain[1], t);
199
199
  }
200
200
  }
201
- let ot = null;
201
+ let at = null;
202
202
  function se() {
203
- if (ot !== null) return ot;
203
+ if (at !== null) return at;
204
204
  const n = typeof navigator > "u" ? void 0 : navigator.language;
205
- return ot = typeof n == "string" && n !== "" ? n : "en-US", ot;
205
+ return at = typeof n == "string" && n !== "" ? n : "en-US", at;
206
206
  }
207
207
  const ht = /* @__PURE__ */ new Map();
208
- function Le(n) {
208
+ function Pe(n) {
209
209
  const t = se(), e = `${t}|${n}`;
210
210
  let i = ht.get(e);
211
211
  return i === void 0 && (i = new Intl.NumberFormat(t, {
@@ -214,8 +214,8 @@ function Le(n) {
214
214
  useGrouping: !0
215
215
  }), ht.set(e, i)), i;
216
216
  }
217
- function Fe(n, t) {
218
- return Le(Math.min(6, Dt(t))).format(n);
217
+ function Ee(n, t) {
218
+ return Pe(Math.min(6, Dt(t))).format(n);
219
219
  }
220
220
  function Bt(n) {
221
221
  if (!Number.isFinite(n)) return "–";
@@ -223,78 +223,78 @@ function Bt(n) {
223
223
  let i = ht.get(e);
224
224
  return i === void 0 && (i = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), ht.set(e, i)), i.format(n);
225
225
  }
226
- const q = 1e3, K = 60 * q, J = 60 * K, U = 24 * J;
227
- function Pe(n) {
228
- const t = n.filter((s) => Number.isFinite(s.from) && Number.isFinite(s.to) && s.to > s.from).sort((s, o) => s.from - o.from), e = [];
229
- for (const s of t) {
230
- const o = e[e.length - 1];
231
- o !== void 0 && s.from <= o.to ? s.to > o.to && (e[e.length - 1] = { from: o.from, to: s.to }) : e.push({ from: s.from, to: s.to });
226
+ const K = 1e3, U = 60 * K, Q = 60 * U, X = 24 * Q;
227
+ function De(n) {
228
+ const t = n.filter((o) => Number.isFinite(o.from) && Number.isFinite(o.to) && o.to > o.from).sort((o, s) => o.from - s.from), e = [];
229
+ for (const o of t) {
230
+ const s = e[e.length - 1];
231
+ s !== void 0 && o.from <= s.to ? o.to > s.to && (e[e.length - 1] = { from: s.from, to: o.to }) : e.push({ from: o.from, to: o.to });
232
232
  }
233
233
  const i = [];
234
234
  let r = 0;
235
- for (const s of e)
236
- i.push(r), r += s.to - s.from;
235
+ for (const o of e)
236
+ i.push(r), r += o.to - o.from;
237
237
  return { intervals: e, offsets: i, total: r };
238
238
  }
239
239
  const Yt = /* @__PURE__ */ new WeakMap();
240
- function z(n) {
240
+ function G(n) {
241
241
  if (!Array.isArray(n)) return n;
242
242
  const t = n, e = Yt.get(t);
243
243
  if (e !== void 0) return e;
244
- const i = Pe(t);
244
+ const i = De(t);
245
245
  return Yt.set(t, i), i;
246
246
  }
247
- function Ee(n, t) {
247
+ function $e(n, t) {
248
248
  const e = n.intervals;
249
- let i = 0, r = e.length - 1, s = -1;
249
+ let i = 0, r = e.length - 1, o = -1;
250
250
  for (; i <= r; ) {
251
- const o = i + r >> 1;
252
- e[o].from <= t ? (s = o, i = o + 1) : r = o - 1;
251
+ const s = i + r >> 1;
252
+ e[s].from <= t ? (o = s, i = s + 1) : r = s - 1;
253
253
  }
254
- return s < 0 ? -1 : t <= e[s].to ? s : -1;
254
+ return o < 0 ? -1 : t <= e[o].to ? o : -1;
255
255
  }
256
256
  function pt(n, t) {
257
- const e = z(t);
257
+ const e = G(t);
258
258
  if (e.intervals.length === 0) return n;
259
- const i = Ee(e, n);
259
+ const i = $e(e, n);
260
260
  return i < 0 ? Number.NaN : e.offsets[i] + (n - e.intervals[i].from);
261
261
  }
262
262
  function dt(n, t) {
263
- const e = z(t), i = e.intervals;
263
+ const e = G(t), i = e.intervals;
264
264
  if (i.length === 0) return n;
265
265
  if (!(n >= 0) || n > e.total) return Number.NaN;
266
266
  if (n === e.total)
267
267
  return i[i.length - 1].to;
268
- let r = 0, s = i.length - 1, o = 0;
269
- for (; r <= s; ) {
270
- const a = r + s >> 1;
271
- e.offsets[a] <= n ? (o = a, r = a + 1) : s = a - 1;
268
+ let r = 0, o = i.length - 1, s = 0;
269
+ for (; r <= o; ) {
270
+ const a = r + o >> 1;
271
+ e.offsets[a] <= n ? (s = a, r = a + 1) : o = a - 1;
272
272
  }
273
- return i[o].from + (n - e.offsets[o]);
273
+ return i[s].from + (n - e.offsets[s]);
274
274
  }
275
- function Zn(n, t, e, i) {
276
- const r = z(n);
277
- for (let s = 0; s < e; s++)
278
- i[s] = pt(t[s], r);
275
+ function Jn(n, t, e, i) {
276
+ const r = G(n);
277
+ for (let o = 0; o < e; o++)
278
+ i[o] = pt(t[o], r);
279
279
  }
280
- function De(n, t) {
281
- const e = z(t);
280
+ function Ce(n, t) {
281
+ const e = G(t);
282
282
  if (e.intervals.length === 0) return n;
283
283
  const i = pt(n, e);
284
284
  if (!Number.isNaN(i)) return i;
285
285
  if (!Number.isFinite(n)) return Number.NaN;
286
286
  for (let r = 0; r < e.intervals.length; r++) {
287
- const s = e.intervals[r];
288
- if (n < s.from) return e.offsets[r];
287
+ const o = e.intervals[r];
288
+ if (n < o.from) return e.offsets[r];
289
289
  }
290
290
  return e.total;
291
291
  }
292
- function $e(n, t) {
293
- const e = z(t);
292
+ function Oe(n, t) {
293
+ const e = G(t);
294
294
  return e.intervals.length === 0 ? !1 : Number.isNaN(pt(n, e));
295
295
  }
296
- function Ce(n) {
297
- const t = z(n), e = [];
296
+ function We(n) {
297
+ const t = G(n), e = [];
298
298
  for (let i = 1; i < t.intervals.length; i++)
299
299
  e.push({
300
300
  from: t.intervals[i - 1].to,
@@ -303,65 +303,65 @@ function Ce(n) {
303
303
  });
304
304
  return e;
305
305
  }
306
- function We(n, t, e) {
307
- return Ce(n).map((i) => i.operatingTime).filter((i) => i >= t && i <= e);
306
+ function He(n, t, e) {
307
+ return We(n).map((i) => i.operatingTime).filter((i) => i >= t && i <= e);
308
308
  }
309
309
  const zt = [
310
- q,
311
- 2 * q,
312
- 5 * q,
313
- 10 * q,
314
- 15 * q,
315
- 30 * q,
316
310
  K,
317
311
  2 * K,
318
312
  5 * K,
319
313
  10 * K,
320
314
  15 * K,
321
315
  30 * K,
322
- J,
323
- 2 * J,
324
- 3 * J,
325
- 6 * J,
326
- 12 * J,
327
316
  U,
328
317
  2 * U,
329
- 7 * U,
330
- 14 * U,
331
- 28 * U
318
+ 5 * U,
319
+ 10 * U,
320
+ 15 * U,
321
+ 30 * U,
322
+ Q,
323
+ 2 * Q,
324
+ 3 * Q,
325
+ 6 * Q,
326
+ 12 * Q,
327
+ X,
328
+ 2 * X,
329
+ 7 * X,
330
+ 14 * X,
331
+ 28 * X
332
332
  ];
333
- function Oe(n, t) {
333
+ function Re(n, t) {
334
334
  const e = zt[0];
335
335
  if (!Number.isFinite(n) || n <= 0) return e;
336
336
  const i = n / Math.max(1, Math.floor(t));
337
337
  for (const r of zt) if (r >= i) return r;
338
- return U * mt(i / U, 1);
338
+ return X * mt(i / X, 1);
339
339
  }
340
- function He(n, t, e, i, r = 0) {
341
- const s = z(n), o = [];
342
- if (!Number.isFinite(t) || !Number.isFinite(e) || !(i > 0)) return o;
340
+ function Ve(n, t, e, i, r = 0) {
341
+ const o = G(n), s = [];
342
+ if (!Number.isFinite(t) || !Number.isFinite(e) || !(i > 0)) return s;
343
343
  const a = Math.ceil((t - r) / i), l = Math.floor((e - r) / i);
344
- if (!Number.isFinite(a) || !Number.isFinite(l)) return o;
344
+ if (!Number.isFinite(a) || !Number.isFinite(l)) return s;
345
345
  let c = Number.NaN;
346
346
  for (let u = a; u <= l; u++) {
347
- const h = r + u * i, p = pt(h, s);
348
- Number.isNaN(p) || p === c || (o.push({ wallClock: h, operatingTime: p }), c = p);
349
- }
350
- return o;
351
- }
352
- function Re(n, t, e, i, r = 0) {
353
- const s = z(n);
354
- if (s.intervals.length === 0 || !(e > t)) return [];
355
- const o = Math.max(0, Math.min(s.total, t)), a = Math.max(0, Math.min(s.total, e)), l = Oe(e - t, i);
356
- return He(
357
- s,
358
- dt(o, s),
359
- dt(a, s),
347
+ const h = r + u * i, p = pt(h, o);
348
+ Number.isNaN(p) || p === c || (s.push({ wallClock: h, operatingTime: p }), c = p);
349
+ }
350
+ return s;
351
+ }
352
+ function _e(n, t, e, i, r = 0) {
353
+ const o = G(n);
354
+ if (o.intervals.length === 0 || !(e > t)) return [];
355
+ const s = Math.max(0, Math.min(o.total, t)), a = Math.max(0, Math.min(o.total, e)), l = Re(e - t, i);
356
+ return Ve(
357
+ o,
358
+ dt(s, o),
359
+ dt(a, o),
360
360
  l,
361
361
  r
362
362
  ).map((u) => u.operatingTime).filter((u) => u >= t && u <= e);
363
363
  }
364
- const Tt = 5, At = 4, xt = 8, Gt = 4, Ve = 8, ut = "uc-tick-label", at = "uc-axis-title", oe = {
364
+ const Lt = 5, Tt = 4, xt = 8, Gt = 4, Be = 8, it = "uc-tick-label", lt = "uc-axis-title", ae = {
365
365
  width: 0,
366
366
  height: 0,
367
367
  plot: { x: 0, y: 0, width: 0, height: 0 },
@@ -369,18 +369,18 @@ const Tt = 5, At = 4, xt = 8, Gt = 4, Ve = 8, ut = "uc-tick-label", at = "uc-axi
369
369
  };
370
370
  function qt(n, t, e) {
371
371
  const i = Math.ceil(t), r = e.get(n);
372
- return r === void 0 || i > r || r - i >= Ve ? (e.set(n, i), i) : r;
372
+ return r === void 0 || i > r || r - i >= Be ? (e.set(n, i), i) : r;
373
373
  }
374
374
  function Kt(n, t) {
375
375
  const e = n.domainMode;
376
376
  if (Array.isArray(e)) {
377
- const s = e;
378
- return s[0] === s[1] ? [s[0] - 1, s[1] + 1] : s;
377
+ const o = e;
378
+ return o[0] === o[1] ? [o[0] - 1, o[1] + 1] : o;
379
379
  }
380
380
  const [i, r] = n.extent;
381
- return n.calendar !== void 0 && n.calendar.length > 0 || e === "data" ? Vt(i, r) : Ae(i, r, t);
381
+ return n.calendar !== void 0 && n.calendar.length > 0 || e === "data" ? Vt(i, r) : Fe(i, r, t);
382
382
  }
383
- function _e(n) {
383
+ function Ye(n) {
384
384
  if (!Number.isFinite(n)) return "";
385
385
  const t = new Date(n), e = (i) => String(i).padStart(2, "0");
386
386
  return `${e(t.getDate())}.${e(t.getMonth() + 1)}. ${e(t.getHours())}:${e(t.getMinutes())}`;
@@ -389,166 +389,168 @@ function Ut(n, t, e) {
389
389
  if (n.tickValues !== void 0)
390
390
  return n.tickValues.filter((r) => r >= t[0] && r <= t[1]);
391
391
  const i = n.calendar;
392
- return i !== void 0 && i.length > 0 ? Re(i, t[0], t[1], e) : re(t[0], t[1], e);
392
+ return i !== void 0 && i.length > 0 ? _e(i, t[0], t[1], e) : oe(t[0], t[1], e);
393
393
  }
394
394
  function Xt(n, t, e) {
395
395
  const i = n.calendar;
396
396
  if (i !== void 0 && i.length > 0) {
397
- const s = n.tickFormat;
398
- return s === void 0 ? (o) => _e(dt(o, i)) : (o) => s(dt(o, i));
397
+ const o = n.tickFormat;
398
+ return o === void 0 ? (s) => Ye(dt(s, i)) : (s) => o(dt(s, i));
399
399
  }
400
400
  if (n.tickFormat !== void 0) return n.tickFormat;
401
401
  const r = mt(Math.abs(t[1] - t[0]), e);
402
- return (s) => Fe(s, r);
402
+ return (o) => Ee(o, r);
403
403
  }
404
- function Be(n) {
405
- const { width: t, height: e, padding: i, axes: r, measure: s, hysteresis: o } = n, a = r.filter((v) => v.position === "left"), l = r.filter((v) => v.position === "right"), c = r.filter((v) => v.position === "top"), u = r.filter((v) => v.position === "bottom"), h = Math.ceil(s("0", ut).height) || 14, p = /* @__PURE__ */ new Map();
404
+ function ze(n) {
405
+ const { width: t, height: e, padding: i, axes: r, measure: o, hysteresis: s } = n, a = r.filter((v) => v.position === "left"), l = r.filter((v) => v.position === "right"), c = r.filter((v) => v.position === "top"), u = r.filter((v) => v.position === "bottom"), h = Math.ceil(o("0", it).height) || 14, p = /* @__PURE__ */ new Map();
406
406
  for (const v of [...c, ...u]) {
407
- const M = v.label === void 0 || v.label === "" ? 0 : Math.ceil(s(v.label, at).height) + Gt;
408
- p.set(v.key, qt(v.key, Tt + At + h + M, o));
407
+ const M = v.label === void 0 || v.label === "" ? 0 : Math.ceil(o(v.label, lt).height) + Gt;
408
+ p.set(v.key, qt(v.key, Lt + Tt + h + M, s));
409
409
  }
410
410
  const d = (v, M) => {
411
411
  let x = 0;
412
- for (let A = 0; A < v.length; A++) {
413
- const $ = v[A];
414
- $ !== void 0 && (x += M.get($.key) ?? 0, A > 0 && (x += xt));
412
+ for (let T = 0; T < v.length; T++) {
413
+ const C = v[T];
414
+ C !== void 0 && (x += M.get(C.key) ?? 0, T > 0 && (x += xt));
415
415
  }
416
416
  return x;
417
417
  }, m = i.top + d(c, p), y = e - i.bottom - d(u, p), f = Math.max(0, y - m), b = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
418
418
  for (const v of [...a, ...l]) {
419
- const M = v.tickCount ?? Math.max(2, Math.round(f / 50)), x = Kt(v, M), A = Ut(v, x, M), $ = Xt(v, x, M), T = A.map($), O = T.map((V) => s(V, ut).width);
420
- let C = 0;
421
- for (const V of O) V > C && (C = V);
422
- const tt = v.label === void 0 || v.label === "" ? 0 : Math.ceil(s(v.label, at).height) + Gt;
423
- b.set(v.key, { axis: v, domain: x, values: A, labels: T, widths: O, format: $ }), k.set(
419
+ const M = v.tickCount ?? Math.max(2, Math.round(f / 50)), x = Kt(v, M), T = Ut(v, x, M), C = Xt(v, x, M), L = T.map(C), W = L.map((R) => o(R, it).width);
420
+ let D = 0;
421
+ for (const R of W) R > D && (D = R);
422
+ for (const R of v.limitLabels ?? []) D = Math.max(D, o(R, it).width + 4);
423
+ const B = v.label === void 0 || v.label === "" ? 0 : Math.ceil(o(v.label, lt).height) + Gt;
424
+ b.set(v.key, { axis: v, domain: x, values: T, labels: L, widths: W, format: C }), k.set(
424
425
  v.key,
425
- qt(v.key, Tt + At + C + tt, o)
426
+ qt(v.key, Lt + Tt + D + B, s)
426
427
  );
427
428
  }
428
- const N = i.left + d(a, k), w = t - i.right - d(l, k), L = Math.max(0, w - N), F = { x: N, y: m, width: L, height: f }, P = (v, M, x, A) => {
429
+ const w = i.left + d(a, k), I = t - i.right - d(l, k), A = Math.max(0, I - w), F = { x: w, y: m, width: A, height: f }, P = (v, M, x, T) => {
429
430
  switch (v.position) {
430
431
  case "left":
431
- return { x: N - x - A, y: m, width: A, height: f };
432
+ return { x: w - x - T, y: m, width: T, height: f };
432
433
  case "right":
433
- return { x: w + x, y: m, width: A, height: f };
434
+ return { x: I + x, y: m, width: T, height: f };
434
435
  case "top":
435
- return { x: N, y: m - x - A, width: L, height: A };
436
+ return { x: w, y: m - x - T, width: A, height: T };
436
437
  default:
437
- return { x: N, y: y + x, width: L, height: A };
438
+ return { x: w, y: y + x, width: A, height: T };
438
439
  }
439
- }, S = [], H = (v) => {
440
+ }, N = [], H = (v) => {
440
441
  let M = 0;
441
- v.forEach((x, A) => {
442
- const $ = k.get(x.key) ?? 0, T = b.get(x.key), O = P(x, A, M, $);
443
- M += $ + xt;
444
- const C = (T == null ? void 0 : T.domain) ?? [0, 1], tt = (T == null ? void 0 : T.format) ?? ((j) => String(j)), V = new _t(C, [m + f, m]), et = ((T == null ? void 0 : T.values) ?? []).map((j, B) => ({
445
- value: j,
446
- label: (T == null ? void 0 : T.labels[B]) ?? "",
447
- px: V.toPx(j),
442
+ v.forEach((x, T) => {
443
+ const C = k.get(x.key) ?? 0, L = b.get(x.key), W = P(x, T, M, C);
444
+ M += C + xt;
445
+ const D = (L == null ? void 0 : L.domain) ?? [0, 1], B = (L == null ? void 0 : L.format) ?? ((J) => String(J)), R = new _t(D, [m + f, m]), et = ((L == null ? void 0 : L.values) ?? []).map((J, Y) => ({
446
+ value: J,
447
+ label: (L == null ? void 0 : L.labels[Y]) ?? "",
448
+ px: R.toPx(J),
448
449
  labelLeft: 0,
449
- labelWidth: (T == null ? void 0 : T.widths[B]) ?? 0
450
+ labelWidth: (L == null ? void 0 : L.widths[Y]) ?? 0
450
451
  }));
451
- S.push({
452
+ N.push({
452
453
  key: x.key,
453
454
  id: x.id,
454
455
  orientation: "y",
455
456
  position: x.position,
456
457
  label: x.label,
457
458
  grid: x.grid,
458
- band: O,
459
- size: $,
460
- stack: A,
461
- domain: C,
462
- scale: V,
459
+ band: W,
460
+ size: C,
461
+ stack: T,
462
+ domain: D,
463
+ scale: R,
463
464
  ticks: et,
464
- format: tt,
465
- titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(s(x.label, at).height),
465
+ format: B,
466
+ titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(o(x.label, lt).height),
466
467
  breaks: []
467
468
  });
468
469
  });
469
470
  };
470
471
  H(a), H(l);
471
- const R = (v) => {
472
+ const V = (v) => {
472
473
  let M = 0;
473
- v.forEach((x, A) => {
474
- const $ = p.get(x.key) ?? 0, T = P(x, A, M, $);
475
- M += $ + xt;
476
- const O = x.tickCount ?? Math.max(2, Math.round(L / 80)), C = Kt(x, O), tt = Ut(x, C, O), V = Xt(x, C, O), et = new _t(C, [N, N + L]), j = tt.map((B) => {
477
- const Ct = V(B), yt = s(Ct, ut).width, Wt = et.toPx(B), me = Wt - yt / 2, pe = Math.min(Math.max(me, 0), Math.max(0, t - yt));
478
- return { value: B, label: Ct, px: Wt, labelLeft: pe, labelWidth: yt };
474
+ v.forEach((x, T) => {
475
+ const C = p.get(x.key) ?? 0, L = P(x, T, M, C);
476
+ M += C + xt;
477
+ const W = x.tickCount ?? Math.max(2, Math.round(A / 80)), D = Kt(x, W), B = Ut(x, D, W), R = Xt(x, D, W), et = new _t(D, [w, w + A]), J = B.map((Y) => {
478
+ const Ct = R(Y), yt = o(Ct, it).width, Ot = et.toPx(Y), ye = Ot - yt / 2, ge = Math.min(Math.max(ye, 0), Math.max(0, t - yt));
479
+ return { value: Y, label: Ct, px: Ot, labelLeft: ge, labelWidth: yt };
479
480
  });
480
- S.push({
481
+ N.push({
481
482
  key: x.key,
482
483
  id: x.id,
483
484
  orientation: "x",
484
485
  position: x.position,
485
486
  label: x.label,
486
487
  grid: x.grid,
487
- band: T,
488
- size: $,
489
- stack: A,
490
- domain: C,
488
+ band: L,
489
+ size: C,
490
+ stack: T,
491
+ domain: D,
491
492
  scale: et,
492
- ticks: j,
493
- format: V,
494
- titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(s(x.label, at).height),
495
- breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] : We(x.calendar, C[0], C[1]).map((B) => et.toPx(B))
493
+ ticks: J,
494
+ format: R,
495
+ titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(o(x.label, lt).height),
496
+ breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] : He(x.calendar, D[0], D[1]).map((Y) => et.toPx(Y))
496
497
  });
497
498
  });
498
499
  };
499
- return R(c), R(u), { width: t, height: e, plot: F, axes: S };
500
+ return V(c), V(u), { width: t, height: e, plot: F, axes: N };
500
501
  }
501
- function Ye(n, t, e) {
502
+ function Ge(n, t, e) {
502
503
  if (t <= 0 || !(e >= n[0])) return -1;
503
504
  let i = 0, r = t - 1;
504
505
  if (n[r] <= e) return r;
505
506
  for (; r - i > 1; ) {
506
- const s = i + r >> 1;
507
- n[s] <= e ? i = s : r = s;
507
+ const o = i + r >> 1;
508
+ n[o] <= e ? i = o : r = o;
508
509
  }
509
510
  return i;
510
511
  }
511
- function ae(n, t, e, i) {
512
+ function le(n, t, e, i) {
512
513
  return e + 1 < t ? n[e + 1] : i;
513
514
  }
514
- function rt(n, t) {
515
+ const ce = 0.28;
516
+ function ot(n, t) {
515
517
  return Number.isFinite(n) ? n : t;
516
518
  }
517
- function le(n) {
519
+ function ue(n) {
518
520
  return !Number.isFinite(n);
519
521
  }
520
522
  function Zt(n, t) {
521
523
  return n < t;
522
524
  }
523
- function ze(n, t, e, i) {
525
+ function qe(n, t, e, i) {
524
526
  const r = new Int32Array(e);
525
- for (let s = 0; s < e; s++) {
526
- const o = n[s], a = rt(t[s], i);
527
- if (!Zt(o, a)) continue;
527
+ for (let o = 0; o < e; o++) {
528
+ const s = n[o], a = ot(t[o], i);
529
+ if (!Zt(s, a)) continue;
528
530
  let l = 0;
529
- for (let c = 0; c < s; c++) {
530
- const u = n[c], h = rt(t[c], i);
531
- Zt(u, h) && o < h && u < a && l++;
531
+ for (let c = 0; c < o; c++) {
532
+ const u = n[c], h = ot(t[c], i);
533
+ Zt(u, h) && s < h && u < a && l++;
532
534
  }
533
- r[s] = l;
535
+ r[o] = l;
534
536
  }
535
537
  return r;
536
538
  }
537
- function Ge(n, t, e, i, r, s, o, a) {
538
- const l = o / 2;
539
- for (let c = i - 1; c >= 0; c--) {
540
- const u = e[c];
541
- if (!(Math.abs(u - s) <= l)) continue;
542
- const h = n[c], p = rt(t[c], a);
543
- if (r >= h && r < p) return c;
539
+ function Ke(n, t, e, i, r, o, s, a, l = null, c = 0) {
540
+ const u = s / 2;
541
+ for (let h = i - 1; h >= 0; h--) {
542
+ const p = e[h] + (l === null ? 0 : l[h] * c);
543
+ if (!(Math.abs(p - o) <= u)) continue;
544
+ const d = n[h], m = ot(t[h], a);
545
+ if (r >= d && r < m) return h;
544
546
  }
545
547
  return -1;
546
548
  }
547
549
  function st(n) {
548
550
  return Math.round(n) + 0.5;
549
551
  }
550
- function qe(n, t) {
551
- const { plot: e, axes: i, theme: r } = t, s = e.x, o = e.x + e.width, a = e.y, l = e.y + e.height;
552
+ function Ue(n, t) {
553
+ const { plot: e, axes: i, theme: r } = t, o = e.x, s = e.x + e.width, a = e.y, l = e.y + e.height;
552
554
  n.lineWidth = 1;
553
555
  for (const c of i)
554
556
  if (c.grid)
@@ -560,7 +562,7 @@ function qe(n, t) {
560
562
  if ((c.orientation === "y" && d.value === 0) === h)
561
563
  if (p = !0, c.orientation === "y") {
562
564
  const y = st(d.px);
563
- n.moveTo(s, y), n.lineTo(o, y);
565
+ n.moveTo(o, y), n.lineTo(s, y);
564
566
  } else {
565
567
  const y = st(d.px);
566
568
  n.moveTo(y, a), n.lineTo(y, l);
@@ -568,8 +570,8 @@ function qe(n, t) {
568
570
  p && (n.strokeStyle = h ? r.colorAxis : r.colorGrid, n.stroke());
569
571
  }
570
572
  }
571
- function Ke(n, t) {
572
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = new Path2D();
573
+ function Xe(n, t) {
574
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = new Path2D();
573
575
  let u = !1;
574
576
  for (let h = 0; h < e; h++) {
575
577
  const p = l[h];
@@ -577,7 +579,7 @@ function Ke(n, t) {
577
579
  u = !1;
578
580
  continue;
579
581
  }
580
- const d = a[h] * i + r, m = p * s + o;
582
+ const d = a[h] * i + r, m = p * o + s;
581
583
  u ? c.lineTo(d, m) : (c.moveTo(d, m), u = !0);
582
584
  }
583
585
  if (n.strokeStyle = t.color, n.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? n.setLineDash(t.dash) : n.setLineDash([]), n.stroke(c), n.setLineDash([]), t.marker) {
@@ -585,14 +587,14 @@ function Ke(n, t) {
585
587
  for (let d = 0; d < e; d++) {
586
588
  const m = l[d];
587
589
  if (Number.isNaN(m)) continue;
588
- const y = a[d] * i + r, f = m * s + o;
590
+ const y = a[d] * i + r, f = m * o + s;
589
591
  p.moveTo(y + h, f), p.arc(y, f, h, 0, Math.PI * 2);
590
592
  }
591
593
  n.fillStyle = t.color, n.fill(p);
592
594
  }
593
595
  }
594
- function Ue(n, t) {
595
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.y0, u = t.baseline * s + o, h = new Path2D(), p = new Path2D();
596
+ function Ze(n, t) {
597
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.y0, u = t.baseline * o + s, h = new Path2D(), p = new Path2D();
596
598
  let d = 0;
597
599
  for (; d < e; ) {
598
600
  for (; d < e && (Number.isNaN(l[d]) || c !== null && Number.isNaN(c[d])); )
@@ -603,91 +605,91 @@ function Ue(n, t) {
603
605
  d++;
604
606
  const y = d - 1;
605
607
  for (let f = m; f <= y; f++) {
606
- const b = a[f] * i + r, k = l[f] * s + o;
608
+ const b = a[f] * i + r, k = l[f] * o + s;
607
609
  f === m ? (h.moveTo(b, k), p.moveTo(b, k)) : (h.lineTo(b, k), p.lineTo(b, k));
608
610
  }
609
611
  if (c === null)
610
612
  h.lineTo(a[y] * i + r, u), h.lineTo(a[m] * i + r, u);
611
613
  else
612
614
  for (let f = y; f >= m; f--)
613
- h.lineTo(a[f] * i + r, c[f] * s + o);
615
+ h.lineTo(a[f] * i + r, c[f] * o + s);
614
616
  h.closePath();
615
617
  }
616
618
  n.globalAlpha = t.alpha * t.fillOpacity, n.fillStyle = t.color, n.fill(h), t.strokeWidth > 0 && (n.globalAlpha = t.alpha, n.strokeStyle = t.color, n.lineWidth = t.strokeWidth, n.setLineDash([]), n.stroke(p));
617
619
  }
618
- function Xe(n, t) {
619
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.baseline * s + o, u = t.offset * i, h = t.width * i, p = new Path2D();
620
+ function je(n, t) {
621
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.baseline * o + s, u = t.offset * i, h = t.width * i, p = new Path2D();
620
622
  for (let d = 0; d < e; d++) {
621
623
  const m = l[d];
622
624
  if (Number.isNaN(m)) continue;
623
- const y = a[d] * i + r + u, f = m * s + o;
625
+ const y = a[d] * i + r + u, f = m * o + s;
624
626
  p.rect(y, f, h, c - f);
625
627
  }
626
628
  n.fillStyle = t.color, n.fill(p);
627
629
  }
628
- function Ze(n, t) {
629
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.radius, u = new Path2D();
630
+ function Je(n, t) {
631
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.radius, u = new Path2D();
630
632
  for (let h = 0; h < e; h++) {
631
633
  const p = l[h];
632
634
  if (Number.isNaN(p)) continue;
633
- const d = a[h] * i + r, m = p * s + o;
635
+ const d = a[h] * i + r, m = p * o + s;
634
636
  u.moveTo(d + c, m), u.arc(d, m, c, 0, Math.PI * 2);
635
637
  }
636
638
  n.fillStyle = t.color, n.fill(u);
637
639
  }
638
- function je(n, t) {
639
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.x, o = t.y, a = t.laneTop, l = t.laneBottom - t.laneTop, c = t.colors.length;
640
+ function Qe(n, t) {
641
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.x, s = t.y, a = t.laneTop, l = t.laneBottom - t.laneTop, c = t.colors.length;
640
642
  if (c === 0 || l <= 0) return;
641
643
  const u = [];
642
644
  for (let p = 0; p < c; p++) u.push(new Path2D());
643
645
  let h = !1;
644
646
  for (let p = 0; p < e; p++) {
645
- const d = o[p];
647
+ const d = s[p];
646
648
  if (Number.isNaN(d)) continue;
647
649
  const m = d | 0, y = u[m];
648
650
  if (y === void 0) continue;
649
- const f = s[p], b = ae(s, e, p, t.domainEnd);
651
+ const f = o[p], b = le(o, e, p, t.domainEnd);
650
652
  b > f && (y.rect(f * i + r, a, (b - f) * i, l), h = !0);
651
653
  }
652
654
  if (h)
653
655
  for (let p = 0; p < c; p++)
654
656
  n.fillStyle = t.colors[p], n.fill(u[p]);
655
657
  }
656
- function Je(n, t) {
657
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.buckets, u = t.colors.length;
658
+ function tn(n, t) {
659
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.buckets, u = t.colors.length;
658
660
  if (u === 0) return;
659
- const h = t.width * i, p = Math.abs(t.height * s), d = [];
661
+ const h = t.width * i, p = Math.abs(t.height * o), d = [];
660
662
  for (let m = 0; m < u; m++) d.push(new Path2D());
661
663
  for (let m = 0; m < e; m++) {
662
664
  const y = c[m];
663
665
  if (y < 0) continue;
664
666
  const f = d[y];
665
667
  if (f === void 0) continue;
666
- const b = a[m] * i + r - h / 2, k = l[m] * s + o - p / 2;
668
+ const b = a[m] * i + r - h / 2, k = l[m] * o + s - p / 2;
667
669
  f.rect(b, k, h, p);
668
670
  }
669
671
  for (let m = 0; m < u; m++)
670
672
  n.fillStyle = t.colors[m], n.fill(d[m]);
671
673
  }
672
- function Qe(n, t) {
673
- const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.x1, u = t.depth, h = Math.abs(t.height * s), p = h * 0.28, d = new Path2D(), m = new Path2D();
674
+ function en(n, t) {
675
+ const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.x1, u = t.depth, h = Math.abs(t.height * o), p = h * ce, d = new Path2D(), m = new Path2D();
674
676
  for (let y = 0; y < e; y++) {
675
677
  const f = l[y];
676
678
  if (Number.isNaN(f)) continue;
677
679
  const b = a[y];
678
680
  if (Number.isNaN(b)) continue;
679
- const k = c[y], N = rt(k, t.domainEnd);
680
- if (!(N >= b)) continue;
681
- const w = b * i + r, L = Math.max(1, (N - b) * i), F = f * s + o + u[y] * p;
682
- (le(k) ? m : d).rect(w, F - h / 2, L, h);
681
+ const k = c[y], w = ot(k, t.domainEnd);
682
+ if (!(w >= b)) continue;
683
+ const I = b * i + r, A = Math.max(1, (w - b) * i), F = f * o + s + u[y] * p;
684
+ (ue(k) ? m : d).rect(I, F - h / 2, A, h);
683
685
  }
684
686
  n.fillStyle = t.color, n.fill(d), n.save(), n.globalAlpha = n.globalAlpha * 0.45, n.fill(m), n.restore(), n.strokeStyle = t.color, n.lineWidth = 1, n.setLineDash([3, 2]), n.stroke(m), n.setLineDash([]);
685
687
  }
686
688
  function jt(n, t, e) {
687
689
  for (const i of e) {
688
690
  if (i.band) {
689
- const r = Math.min(i.fromPx, i.toPx), s = Math.max(i.fromPx, i.toPx);
690
- n.fillStyle = i.color, n.save(), n.globalAlpha = 0.12, i.orientation === "y" ? n.fillRect(t.x, r, t.width, s - r) : n.fillRect(r, t.y, s - r, t.height), n.restore();
691
+ const r = Math.min(i.fromPx, i.toPx), o = Math.max(i.fromPx, i.toPx);
692
+ n.fillStyle = i.color, n.save(), n.globalAlpha = 0.12, i.orientation === "y" ? n.fillRect(t.x, r, t.width, o - r) : n.fillRect(r, t.y, o - r, t.height), n.restore();
691
693
  continue;
692
694
  }
693
695
  if (n.beginPath(), i.orientation === "y") {
@@ -700,47 +702,47 @@ function jt(n, t, e) {
700
702
  n.strokeStyle = i.color, n.lineWidth = 1, n.setLineDash(i.dash), n.stroke(), n.setLineDash([]);
701
703
  }
702
704
  }
703
- function tn(n, t) {
704
- const { width: e, height: i, plot: r, series: s } = t;
705
+ function nn(n, t) {
706
+ const { width: e, height: i, plot: r, series: o } = t;
705
707
  if (n.clearRect(0, 0, e, i), !(r.width <= 0 || r.height <= 0)) {
706
- qe(n, t), n.save(), n.beginPath(), n.rect(r.x, r.y, r.width, r.height), n.clip(), n.lineJoin = "round", n.lineCap = "round", n.globalAlpha = 1, jt(n, r, t.limitBands);
707
- for (const o of s)
708
- if (o.length !== 0)
709
- switch (n.globalAlpha = o.alpha, o.kind) {
708
+ Ue(n, t), n.save(), n.beginPath(), n.rect(r.x, r.y, r.width, r.height), n.clip(), n.lineJoin = "round", n.lineCap = "round", n.globalAlpha = 1, jt(n, r, t.limitBands);
709
+ for (const s of o)
710
+ if (s.length !== 0)
711
+ switch (n.globalAlpha = s.alpha, s.kind) {
710
712
  case "line":
711
- Ke(n, o);
713
+ Xe(n, s);
712
714
  break;
713
715
  case "area":
714
- Ue(n, o);
716
+ Ze(n, s);
715
717
  break;
716
718
  case "bar":
717
- Xe(n, o);
719
+ je(n, s);
718
720
  break;
719
721
  case "scatter":
720
- Ze(n, o);
722
+ Je(n, s);
721
723
  break;
722
724
  case "state":
723
- je(n, o);
725
+ Qe(n, s);
724
726
  break;
725
727
  case "matrix":
726
- Je(n, o);
728
+ tn(n, s);
727
729
  break;
728
730
  case "span":
729
- Qe(n, o);
731
+ en(n, s);
730
732
  break;
731
733
  }
732
734
  n.globalAlpha = 1, jt(n, r, t.limitLines), n.restore();
733
735
  }
734
736
  }
735
- function en(n, t) {
736
- const { width: e, height: i, plot: r, theme: s, hover: o } = t;
737
- if (n.clearRect(0, 0, e, i), o === null || r.width <= 0 || r.height <= 0) return;
738
- const a = st(o.hit.xPx);
739
- a >= r.x && a <= r.x + r.width && (n.beginPath(), n.moveTo(a, r.y), n.lineTo(a, r.y + r.height), n.lineWidth = 1, n.strokeStyle = s.colorAxis, n.setLineDash([]), n.stroke());
740
- for (const l of o.marker)
741
- n.beginPath(), n.arc(l.x, l.y, 5.5, 0, Math.PI * 2), n.fillStyle = s.colorBg, n.fill(), n.beginPath(), n.arc(l.x, l.y, 3.5, 0, Math.PI * 2), n.fillStyle = l.color, n.fill();
742
- }
743
- function nn(n, t, e) {
737
+ function rn(n, t) {
738
+ const { width: e, height: i, plot: r, theme: o, hover: s } = t;
739
+ if (n.clearRect(0, 0, e, i), s === null || r.width <= 0 || r.height <= 0) return;
740
+ const a = st(s.hit.xPx);
741
+ a >= r.x && a <= r.x + r.width && (n.beginPath(), n.moveTo(a, r.y), n.lineTo(a, r.y + r.height), n.lineWidth = 1, n.strokeStyle = o.colorAxis, n.setLineDash([]), n.stroke());
742
+ for (const l of s.marker)
743
+ n.beginPath(), n.arc(l.x, l.y, 5.5, 0, Math.PI * 2), n.fillStyle = o.colorBg, n.fill(), n.beginPath(), n.arc(l.x, l.y, 3.5, 0, Math.PI * 2), n.fillStyle = l.color, n.fill();
744
+ }
745
+ function on(n, t, e) {
744
746
  if (t <= 0) return -1;
745
747
  if (t === 1) return 0;
746
748
  let i = 0, r = t - 1;
@@ -750,24 +752,24 @@ function nn(n, t, e) {
750
752
  const a = i + r >> 1;
751
753
  n[a] <= e ? i = a : r = a;
752
754
  }
753
- const s = e - n[i];
754
- return n[r] - e < s ? r : i;
755
+ const o = e - n[i];
756
+ return n[r] - e < o ? r : i;
755
757
  }
756
758
  function Jt(n, t) {
757
759
  if (t < 2) return 0;
758
760
  const e = n.slice(0, t).sort();
759
761
  let i = Number.POSITIVE_INFINITY;
760
762
  for (let r = 1; r < t; r++) {
761
- const s = e[r] - e[r - 1];
762
- s > 0 && s < i && (i = s);
763
+ const o = e[r] - e[r - 1];
764
+ o > 0 && o < i && (i = o);
763
765
  }
764
766
  return Number.isFinite(i) ? i : 0;
765
767
  }
766
- function lt(n, t) {
768
+ function ct(n, t) {
767
769
  return n > 0 ? n : t;
768
770
  }
769
- function rn(n, t, e, i, r, s, o) {
770
- const a = s / 2, l = o / 2;
771
+ function sn(n, t, e, i, r, o, s) {
772
+ const a = o / 2, l = s / 2;
771
773
  for (let c = 0; c < e; c++) {
772
774
  const u = i - n[c];
773
775
  if (!(u >= -a && u < a)) continue;
@@ -777,77 +779,77 @@ function rn(n, t, e, i, r, s, o) {
777
779
  }
778
780
  return -1;
779
781
  }
780
- const sn = {
782
+ const an = {
781
783
  ok: 0,
782
784
  unknown: 1,
783
785
  warning: 2,
784
786
  alarm: 3
785
787
  };
786
- function jn(n) {
787
- return sn[n];
788
+ function Qn(n) {
789
+ return an[n];
788
790
  }
789
791
  const Qt = { warning: 2, alarm: 3 };
790
- function on(n, t = {}) {
792
+ function ln(n, t = {}) {
791
793
  if (n == null || !Number.isFinite(n))
792
794
  return { verdict: "unknown" };
793
795
  const e = t.target, i = e !== void 0 && Number.isFinite(e) ? n - e : void 0;
794
- let r, s = 0;
796
+ let r, o = 0;
795
797
  for (const a of t.limits ?? []) {
796
798
  const l = a.side === "upper" ? n - a.value : a.value - n;
797
- l > 0 && (r === void 0 || Qt[a.severity] > Qt[r.severity] || a.severity === r.severity && l > s) && (r = a, s = l);
799
+ l > 0 && (r === void 0 || Qt[a.severity] > Qt[r.severity] || a.severity === r.severity && l > o) && (r = a, o = l);
798
800
  }
799
801
  if (r === void 0)
800
802
  return i === void 0 ? { verdict: "ok" } : { verdict: "ok", deviation: i };
801
- const o = {
803
+ const s = {
802
804
  verdict: r.severity,
803
805
  limit: r,
804
- excess: s
806
+ excess: o
805
807
  };
806
- return i === void 0 ? o : { ...o, deviation: i };
807
- }
808
- function an(n, t, e, i, r) {
809
- const s = n.length, o = new Float64Array(s), a = new Float64Array(s), l = typeof i == "function" ? i : null, c = l === null ? null : new Float64Array(s), u = (r == null ? void 0 : r.value) ?? null, h = u === null ? null : new Float64Array(s), p = (r == null ? void 0 : r.xEnd) ?? null, d = p === null ? null : new Float64Array(s), m = (r == null ? void 0 : r.xMap) ?? null, y = (r == null ? void 0 : r.xGap) ?? null;
810
- let f = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, k = Number.POSITIVE_INFINITY, N = Number.NEGATIVE_INFINITY;
811
- typeof i == "number" && s > 0 && (k = i, N = i);
812
- for (let w = 0; w < s; w++) {
813
- const L = n[w], F = t(L, w), P = m === null ? F : m(F);
814
- o[w] = P;
815
- const S = y !== null && y(F);
816
- if (S || (P < f && (f = P), P > b && (b = P)), p !== null) {
817
- const v = p(L, w), M = v ?? Number.NaN, x = !Number.isFinite(M) || m === null ? M : m(M);
818
- d[w] = x, Number.isFinite(x) && (x < f && (f = x), x > b && (b = x));
808
+ return i === void 0 ? s : { ...s, deviation: i };
809
+ }
810
+ function cn(n, t, e, i, r) {
811
+ const o = n.length, s = new Float64Array(o), a = new Float64Array(o), l = typeof i == "function" ? i : null, c = l === null ? null : new Float64Array(o), u = (r == null ? void 0 : r.value) ?? null, h = u === null ? null : new Float64Array(o), p = (r == null ? void 0 : r.xEnd) ?? null, d = p === null ? null : new Float64Array(o), m = (r == null ? void 0 : r.xMap) ?? null, y = (r == null ? void 0 : r.xGap) ?? null;
812
+ let f = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, k = Number.POSITIVE_INFINITY, w = Number.NEGATIVE_INFINITY;
813
+ typeof i == "number" && o > 0 && (k = i, w = i);
814
+ for (let I = 0; I < o; I++) {
815
+ const A = n[I], F = t(A, I), P = m === null ? F : m(F);
816
+ s[I] = P;
817
+ const N = y !== null && y(F);
818
+ if (N || (P < f && (f = P), P > b && (b = P)), p !== null) {
819
+ const v = p(A, I), M = v ?? Number.NaN, x = !Number.isFinite(M) || m === null ? M : m(M);
820
+ d[I] = x, Number.isFinite(x) && (x < f && (f = x), x > b && (b = x));
819
821
  }
820
- const H = S ? null : e(L, w), R = H ?? Number.NaN;
821
- if (a[w] = R, R < k && (k = R), R > N && (N = R), u !== null) {
822
- const v = S ? null : u(L, w);
823
- h[w] = v ?? Number.NaN;
822
+ const H = N ? null : e(A, I), V = H ?? Number.NaN;
823
+ if (a[I] = V, V < k && (k = V), V > w && (w = V), u !== null) {
824
+ const v = N ? null : u(A, I);
825
+ h[I] = v ?? Number.NaN;
824
826
  }
825
827
  if (l !== null) {
826
- const v = S ? null : l(L, w), M = v ?? Number.NaN;
827
- c[w] = M, M < k && (k = M), M > N && (N = M);
828
+ const v = N ? null : l(A, I), M = v ?? Number.NaN;
829
+ c[I] = M, M < k && (k = M), M > w && (w = M);
828
830
  }
829
831
  }
830
- return { series: { x: o, y: a, y0: c, w: h, x1: d, length: s }, extent: { xMin: f, xMax: b, yMin: k, yMax: N } };
832
+ return { series: { x: s, y: a, y0: c, w: h, x1: d, length: o }, extent: { xMin: f, xMax: b, yMin: k, yMax: w } };
831
833
  }
832
- function ln(n, t) {
834
+ function un(n, t) {
833
835
  for (let e = 1; e < t; e++)
834
836
  if (n[e] < n[e - 1]) return e;
835
837
  return -1;
836
838
  }
837
- function cn(n, t, e, i) {
838
- let r = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY;
839
- for (const o of e) {
840
- const a = o.extent;
841
- if (a === null || !(n === "x" ? o.xAxisId === t : o.yAxisId === t)) continue;
839
+ function hn(n, t, e, i) {
840
+ let r = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
841
+ for (const s of e) {
842
+ const a = s.extent;
843
+ if (a === null || !(n === "x" ? s.xAxisId === t : s.yAxisId === t)) continue;
842
844
  const c = n === "x" ? a.xMin : a.yMin, u = n === "x" ? a.xMax : a.yMax;
843
- c < r && (r = c), u > s && (s = u);
845
+ c < r && (r = c), u > o && (o = u);
844
846
  }
845
847
  if (i !== void 0)
846
- for (const o of i)
847
- Number.isFinite(o) && (o < r && (r = o), o > s && (s = o));
848
- return !Number.isFinite(r) || !Number.isFinite(s) ? [0, 1] : [r, s];
848
+ for (const s of i)
849
+ Number.isFinite(s) && (s < r && (r = s), s > o && (o = s));
850
+ return !Number.isFinite(r) || !Number.isFinite(o) ? [0, 1] : [r, o];
849
851
  }
850
- function un(n, t) {
852
+ function dn(n, t) {
851
853
  let e = Number.POSITIVE_INFINITY;
852
854
  for (let i = 1; i < t; i++) {
853
855
  const r = n[i] - n[i - 1];
@@ -855,14 +857,14 @@ function un(n, t) {
855
857
  }
856
858
  return Number.isFinite(e) ? e : 0;
857
859
  }
858
- function hn(n, t) {
860
+ function fn(n, t) {
859
861
  return n > 0 ? n : t;
860
862
  }
861
- function dn(n, t, e, i) {
862
- const r = n * t, s = r / i;
863
- return { offset: -r / 2 + e * s, width: s };
863
+ function mn(n, t, e, i) {
864
+ const r = n * t, o = r / i;
865
+ return { offset: -r / 2 + e * o, width: o };
864
866
  }
865
- function fn(n) {
867
+ function pn(n) {
866
868
  const t = /* @__PURE__ */ new Map();
867
869
  for (const i of n) {
868
870
  if (i.kind !== "bar") continue;
@@ -874,13 +876,13 @@ function fn(n) {
874
876
  let r = Number.POSITIVE_INFINITY;
875
877
  for (const a of i)
876
878
  a.step > 0 && a.step < r && (r = a.step);
877
- const s = Number.isFinite(r) ? r : 0, o = i[0].fraction;
879
+ const o = Number.isFinite(r) ? r : 0, s = i[0].fraction;
878
880
  i.forEach((a, l) => {
879
881
  e.set(a.order, {
880
882
  index: l,
881
883
  size: i.length,
882
- step: s,
883
- fraction: o
884
+ step: o,
885
+ fraction: s
884
886
  });
885
887
  });
886
888
  }
@@ -888,7 +890,7 @@ function fn(n) {
888
890
  }
889
891
  const te = {
890
892
  version: 0,
891
- layout: oe,
893
+ layout: ae,
892
894
  legend: null,
893
895
  series: [],
894
896
  limits: []
@@ -897,10 +899,10 @@ const te = {
897
899
  hover: null,
898
900
  tooltip: null,
899
901
  xLabel: ""
900
- }, mn = 4, pn = 60;
902
+ }, yn = 4, gn = 60;
901
903
  let vt = 0;
902
- const yn = new Float64Array(0), gn = new Int32Array(0);
903
- function Y(n, t) {
904
+ const bn = new Float64Array(0), xn = new Int32Array(0);
905
+ function z(n, t) {
904
906
  return n === t ? !0 : typeof n != "function" || typeof t != "function" ? !1 : String(n) === String(t);
905
907
  }
906
908
  function ft(n, t) {
@@ -909,10 +911,14 @@ function ft(n, t) {
909
911
  for (let e = 0; e < n.length; e++) if (n[e] !== t[e]) return !1;
910
912
  return !0;
911
913
  }
912
- function bn(n, t) {
913
- return n.kind === t.kind && Y(n.accessor, t.accessor) && n.data === t.data && Y(Pt(n), Pt(t)) && Y(Lt(n), Lt(t)) && Y(Ft(n), Ft(t));
914
+ function vn(n, t) {
915
+ return n.kind === t.kind && z(n.accessor, t.accessor) && n.data === t.data && z(Pt(n), Pt(t)) && z(At(n), At(t)) && z(Ft(n), Ft(t)) && // The height of a span widens its y extent, and the extent is made here.
916
+ ne(n) === ne(t);
917
+ }
918
+ function ne(n) {
919
+ return n.kind === "span" ? n.height : void 0;
914
920
  }
915
- function Lt(n) {
921
+ function At(n) {
916
922
  return n.kind === "matrix" ? n.value : void 0;
917
923
  }
918
924
  function Ft(n) {
@@ -933,7 +939,7 @@ function Pt(n) {
933
939
  return;
934
940
  }
935
941
  }
936
- function xn(n, t) {
942
+ function kn(n, t) {
937
943
  if (n.kind !== t.kind) return !1;
938
944
  switch (t.kind) {
939
945
  case "line": {
@@ -942,7 +948,7 @@ function xn(n, t) {
942
948
  }
943
949
  case "area": {
944
950
  const e = n;
945
- return Y(e.baseline, t.baseline) && e.fillOpacity === t.fillOpacity && e.strokeWidth === t.strokeWidth;
951
+ return z(e.baseline, t.baseline) && e.fillOpacity === t.fillOpacity && e.strokeWidth === t.strokeWidth;
946
952
  }
947
953
  case "bar":
948
954
  return n.barWidth === t.barWidth;
@@ -950,64 +956,64 @@ function xn(n, t) {
950
956
  return n.radius === t.radius;
951
957
  case "state": {
952
958
  const e = n;
953
- return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && vn(e.states, t.states);
959
+ return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && Nn(e.states, t.states);
954
960
  }
955
961
  case "matrix":
956
- return kn(n.coloring, t.coloring);
962
+ return wn(n.coloring, t.coloring);
957
963
  case "span":
958
964
  return n.height === t.height;
959
965
  }
960
966
  }
961
- function vn(n, t) {
962
- var e, i, r, s;
967
+ function Nn(n, t) {
968
+ var e, i, r, o;
963
969
  if (n === t) return !0;
964
970
  if (n.length !== t.length) return !1;
965
- for (let o = 0; o < n.length; o++)
966
- if (((e = n[o]) == null ? void 0 : e.label) !== ((i = t[o]) == null ? void 0 : i.label) || ((r = n[o]) == null ? void 0 : r.color) !== ((s = t[o]) == null ? void 0 : s.color)) return !1;
971
+ for (let s = 0; s < n.length; s++)
972
+ if (((e = n[s]) == null ? void 0 : e.label) !== ((i = t[s]) == null ? void 0 : i.label) || ((r = n[s]) == null ? void 0 : r.color) !== ((o = t[s]) == null ? void 0 : o.color)) return !1;
967
973
  return !0;
968
974
  }
969
- function kn(n, t) {
975
+ function wn(n, t) {
970
976
  return n === t ? !0 : n.kind !== t.kind ? !1 : n.kind === "assessment" && t.kind === "assessment" ? n.limits === t.limits : n.kind === "gradient" && t.kind === "gradient" ? ft(n.stops, t.stops) && ft(n.range, t.range) : !1;
971
977
  }
972
- function Nn(n, t) {
978
+ function In(n, t) {
973
979
  return n.kind === "assessment" ? [t.colorOk, t.colorWarning, t.colorAlarm] : n.stops;
974
980
  }
975
- function wn(n, t, e) {
981
+ function Sn(n, t, e) {
976
982
  var c, u;
977
- const i = n.length, r = new Int32Array(i), s = n.w;
978
- if (s === null || e === 0)
983
+ const i = n.length, r = new Int32Array(i), o = n.w;
984
+ if (o === null || e === 0)
979
985
  return r.fill(-1), r;
980
986
  if (t.kind === "assessment") {
981
987
  for (let h = 0; h < i; h++) {
982
- const p = on(s[h], t.limits);
988
+ const p = ln(o[h], t.limits);
983
989
  r[h] = p.verdict === "alarm" ? 2 : p.verdict === "warning" ? 1 : p.verdict === "ok" ? 0 : -1;
984
990
  }
985
991
  return r;
986
992
  }
987
- let o = (c = t.range) == null ? void 0 : c[0], a = (u = t.range) == null ? void 0 : u[1];
988
- if (o === void 0 || a === void 0) {
989
- o = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
993
+ let s = (c = t.range) == null ? void 0 : c[0], a = (u = t.range) == null ? void 0 : u[1];
994
+ if (s === void 0 || a === void 0) {
995
+ s = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
990
996
  for (let h = 0; h < i; h++) {
991
- const p = s[h];
992
- Number.isFinite(p) && (p < o && (o = p), p > a && (a = p));
997
+ const p = o[h];
998
+ Number.isFinite(p) && (p < s && (s = p), p > a && (a = p));
993
999
  }
994
1000
  }
995
- const l = a - o;
1001
+ const l = a - s;
996
1002
  for (let h = 0; h < i; h++) {
997
- const p = s[h];
1003
+ const p = o[h];
998
1004
  if (!Number.isFinite(p)) {
999
1005
  r[h] = -1;
1000
1006
  continue;
1001
1007
  }
1002
- const d = l > 0 ? (p - o) / l : 0.5, m = Math.floor(d * e);
1008
+ const d = l > 0 ? (p - s) / l : 0.5, m = Math.floor(d * e);
1003
1009
  r[h] = m < 0 ? 0 : m >= e ? e - 1 : m;
1004
1010
  }
1005
1011
  return r;
1006
1012
  }
1007
- function In(n, t) {
1013
+ function Mn(n, t) {
1008
1014
  return n === t ? !0 : Array.isArray(n) && Array.isArray(t) ? n[0] === t[0] && n[1] === t[1] : !1;
1009
1015
  }
1010
- class ce {
1016
+ class he {
1011
1017
  constructor() {
1012
1018
  /* ---------- Registration ---------- */
1013
1019
  g(this, "series", /* @__PURE__ */ new Map());
@@ -1046,7 +1052,7 @@ class ce {
1046
1052
  g(this, "theme", null);
1047
1053
  g(this, "unsubscribeTheme", null);
1048
1054
  /* ---------- Layout and interaction ---------- */
1049
- g(this, "layout", oe);
1055
+ g(this, "layout", ae);
1050
1056
  g(this, "hysteresis", /* @__PURE__ */ new Map());
1051
1057
  g(this, "hover", null);
1052
1058
  g(this, "hoverKey", "");
@@ -1067,6 +1073,10 @@ class ce {
1067
1073
  g(this, "onPerf", null);
1068
1074
  /* ================= Materialisation (R-2.6, R-2.7) ================= */
1069
1075
  g(this, "sortednessChecked", !1);
1076
+ g(this, "onFontsLoaded", () => {
1077
+ var t;
1078
+ (t = this.measurer) == null || t.clear(), this.markLayoutDirty();
1079
+ });
1070
1080
  g(this, "themeRoot", null);
1071
1081
  g(this, "subscribeLayout", (t) => (this.layoutSubscribers.add(t), () => {
1072
1082
  this.layoutSubscribers.delete(t);
@@ -1119,12 +1129,12 @@ class ce {
1119
1129
  updateSeries(t, e) {
1120
1130
  const i = this.series.get(t);
1121
1131
  if (i === void 0) return;
1122
- const r = i.config, s = bn(r, e), o = s && r.xAxisId === e.xAxisId && r.yAxisId === e.yAxisId && r.name === e.name && r.color === e.color && r.tone === e.tone && xn(r, e);
1132
+ const r = i.config, o = vn(r, e), s = o && r.xAxisId === e.xAxisId && r.yAxisId === e.yAxisId && r.name === e.name && r.color === e.color && r.tone === e.tone && kn(r, e);
1123
1133
  if (r.name !== e.name && e.name !== void 0) {
1124
1134
  const a = this.slotsByName.get(e.name);
1125
1135
  a === void 0 ? this.slotsByName.set(e.name, i.slot) : this.slotTaken(a, i) || (i.slot = a);
1126
1136
  }
1127
- i.config = e, !o && (s || (i.materialized = null, i.extent = null, i.step = null, i.cellHeight = null, i.depth = null, this.materialsDirty = !0), this.markLayoutDirty());
1137
+ i.config = e, !s && (o || (i.materialized = null, i.extent = null, i.step = null, i.cellHeight = null, i.depth = null, this.materialsDirty = !0), this.markLayoutDirty());
1128
1138
  }
1129
1139
  unregisterSeries(t) {
1130
1140
  this.series.delete(t) && (this.materialsDirty = !0, this.markLayoutDirty());
@@ -1136,9 +1146,9 @@ class ce {
1136
1146
  updateAxis(t, e) {
1137
1147
  const i = this.axes.get(t);
1138
1148
  if (i === void 0) return;
1139
- const r = i.config, s = Y(r.accessor, e.accessor) && r.calendar === e.calendar, o = s && r.id === e.id && r.orientation === e.orientation && r.position === e.position && r.label === e.label && r.tickCount === e.tickCount && r.grid === e.grid && ft(r.ticks, e.ticks) && In(r.domain, e.domain) && Y(r.tickFormat, e.tickFormat);
1140
- if (i.config = e, !o) {
1141
- if (!s || r.id !== e.id) {
1149
+ const r = i.config, o = z(r.accessor, e.accessor) && r.calendar === e.calendar, s = o && r.id === e.id && r.orientation === e.orientation && r.position === e.position && r.label === e.label && r.tickCount === e.tickCount && r.grid === e.grid && ft(r.ticks, e.ticks) && Mn(r.domain, e.domain) && z(r.tickFormat, e.tickFormat);
1150
+ if (i.config = e, !s) {
1151
+ if (!o || r.id !== e.id) {
1142
1152
  for (const a of this.series.values())
1143
1153
  a.materialized = null, a.extent = null, a.step = null, a.cellHeight = null, a.depth = null;
1144
1154
  this.materialsDirty = !0;
@@ -1182,7 +1192,7 @@ class ce {
1182
1192
  }
1183
1193
  updateTooltip(t) {
1184
1194
  const e = this.tooltip;
1185
- if (e !== null && e.mode === t.mode && Y(e.render, t.render)) {
1195
+ if (e !== null && e.mode === t.mode && z(e.render, t.render)) {
1186
1196
  this.tooltip = t;
1187
1197
  return;
1188
1198
  }
@@ -1215,41 +1225,41 @@ class ce {
1215
1225
  /* ================= Checks (R-4.12, R-4.13) ================= */
1216
1226
  /** Called from the Chart after the child effects; DEV only. */
1217
1227
  validate() {
1218
- if (!it) return;
1228
+ if (!rt) return;
1219
1229
  const t = /* @__PURE__ */ new Set();
1220
- for (const { config: s } of this.axesInOrder()) {
1221
- const o = `${s.orientation}:${s.id}`, a = s.orientation === "x" ? "XAxis" : "YAxis";
1222
- ct(
1223
- !t.has(o),
1224
- `Two <${a}> with the same id "${s.id}". A second ${a} needs an own id (R-4.12).`
1225
- ), t.add(o);
1230
+ for (const { config: o } of this.axesInOrder()) {
1231
+ const s = `${o.orientation}:${o.id}`, a = o.orientation === "x" ? "XAxis" : "YAxis";
1232
+ ut(
1233
+ !t.has(s),
1234
+ `Two <${a}> with the same id "${o.id}". A second ${a} needs an own id (R-4.12).`
1235
+ ), t.add(s);
1226
1236
  }
1227
1237
  const e = /* @__PURE__ */ new Set();
1228
- for (const { config: s } of this.series.values())
1229
- ct(
1230
- t.has(`x:${s.xAxisId}`),
1231
- `Series "${s.name ?? "?"}" refers to the unknown x axis "${s.xAxisId}" (R-4.12).`
1232
- ), ct(
1233
- t.has(`y:${s.yAxisId}`),
1234
- `Series "${s.name ?? "?"}" refers to the unknown y axis "${s.yAxisId}" (R-4.12).`
1235
- ), e.add(`x:${s.xAxisId}`), e.add(`y:${s.yAxisId}`);
1236
- for (const s of t)
1237
- !e.has(s) && this.series.size > 0 && G(
1238
- `axis-without-series-${s}`,
1239
- `Axis "${s}" has no bound series; it is drawn with the domain [0, 1] (R-4.13).`
1238
+ for (const { config: o } of this.series.values())
1239
+ ut(
1240
+ t.has(`x:${o.xAxisId}`),
1241
+ `Series "${o.name ?? "?"}" refers to the unknown x axis "${o.xAxisId}" (R-4.12).`
1242
+ ), ut(
1243
+ t.has(`y:${o.yAxisId}`),
1244
+ `Series "${o.name ?? "?"}" refers to the unknown y axis "${o.yAxisId}" (R-4.12).`
1245
+ ), e.add(`x:${o.xAxisId}`), e.add(`y:${o.yAxisId}`);
1246
+ for (const o of t)
1247
+ !e.has(o) && this.series.size > 0 && q(
1248
+ `axis-without-series-${o}`,
1249
+ `Axis "${o}" has no bound series; it is drawn with the domain [0, 1] (R-4.13).`
1240
1250
  );
1241
1251
  const i = /* @__PURE__ */ new Map();
1242
- for (const { config: s } of this.seriesInOrder()) {
1243
- if (s.kind !== "bar") continue;
1244
- const o = i.get(s.xAxisId);
1245
- o === void 0 ? i.set(s.xAxisId, s.barWidth) : o !== s.barWidth && G(
1246
- `bar-width-${s.xAxisId}`,
1247
- `Bars on the x axis "${s.xAxisId}" give different barWidth. A group shares one width fraction; that of the first (${o}) applies (ADR-0002).`
1252
+ for (const { config: o } of this.seriesInOrder()) {
1253
+ if (o.kind !== "bar") continue;
1254
+ const s = i.get(o.xAxisId);
1255
+ s === void 0 ? i.set(o.xAxisId, o.barWidth) : s !== o.barWidth && q(
1256
+ `bar-width-${o.xAxisId}`,
1257
+ `Bars on the x axis "${o.xAxisId}" give different barWidth. A group shares one width fraction; that of the first (${s}) applies (ADR-0002).`
1248
1258
  );
1249
1259
  }
1250
1260
  let r = 0;
1251
- for (const s of this.axesInOrder()) s.config.grid === !0 && r++;
1252
- r > 1 && G(
1261
+ for (const o of this.axesInOrder()) o.config.grid === !0 && r++;
1262
+ r > 1 && q(
1253
1263
  "multiple-grids",
1254
1264
  "More than one axis draws grid. Unaligned grids compete visually; there is no tick alignment between axes in V0 (R-4.15)."
1255
1265
  );
@@ -1267,22 +1277,22 @@ class ce {
1267
1277
  e += i.materialized.length;
1268
1278
  continue;
1269
1279
  }
1270
- const r = i.config, s = r.data ?? this.data, o = this.findXAxis(r.xAxisId);
1271
- if (o === null) continue;
1272
- const a = an(
1273
- s,
1274
- o.accessor,
1280
+ const r = i.config, o = r.data ?? this.data, s = this.findXAxis(r.xAxisId);
1281
+ if (s === null) continue;
1282
+ const a = cn(
1283
+ o,
1284
+ s.accessor,
1275
1285
  r.accessor,
1276
1286
  Pt(r),
1277
1287
  {
1278
- value: Lt(r),
1288
+ value: At(r),
1279
1289
  xEnd: Ft(r),
1280
- xMap: this.mapFor(o),
1281
- xGap: this.gapFor(o)
1290
+ xMap: this.mapFor(s),
1291
+ xGap: this.gapFor(s)
1282
1292
  }
1283
1293
  );
1284
1294
  if (i.materialized = a.series, e += a.series.length, r.kind === "bar") {
1285
- const l = un(a.series.x, a.series.length);
1295
+ const l = dn(a.series.x, a.series.length);
1286
1296
  i.step = l;
1287
1297
  const c = l / 2;
1288
1298
  i.extent = {
@@ -1305,7 +1315,7 @@ class ce {
1305
1315
  yMax: Number.NEGATIVE_INFINITY
1306
1316
  };
1307
1317
  else if (r.kind === "span") {
1308
- i.depth = ze(
1318
+ i.depth = qe(
1309
1319
  a.series.x,
1310
1320
  a.series.x1 ?? new Float64Array(a.series.length),
1311
1321
  a.series.length,
@@ -1322,10 +1332,10 @@ class ce {
1322
1332
  };
1323
1333
  } else
1324
1334
  i.step = null, i.extent = a.extent;
1325
- if (!this.sortednessChecked && it) {
1335
+ if (!this.sortednessChecked && rt) {
1326
1336
  this.sortednessChecked = !0;
1327
- const l = ln(a.series.x, a.series.length);
1328
- l >= 0 && G(
1337
+ const l = un(a.series.x, a.series.length);
1338
+ l >= 0 && q(
1329
1339
  "x-unsorted",
1330
1340
  `X values are not sorted ascending (index ${l}). Binary search and path building assume sortedness; there is no automatic sorting (R-2.6).`
1331
1341
  );
@@ -1335,17 +1345,20 @@ class ce {
1335
1345
  }
1336
1346
  /* ================= DOM binding, DPR, resize ================= */
1337
1347
  bind(t, e, i, r) {
1338
- this.container = t, this.themeRoot = r, this.seriesCanvas = e, this.overlayCanvas = i, this.seriesCtx = e.getContext("2d"), this.overlayCtx = i.getContext("2d"), this.measurer = new Te(r), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Se(() => {
1339
- var s;
1340
- this.theme = null, (s = this.measurer) == null || s.clear(), this.markLayoutDirty();
1341
- }), this.theme = null, this.markLayoutDirty();
1348
+ var s;
1349
+ this.container = t, this.themeRoot = r, this.seriesCanvas = e, this.overlayCanvas = i, this.seriesCtx = e.getContext("2d"), this.overlayCtx = i.getContext("2d"), this.measurer = new Ae(r), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Le(() => {
1350
+ var a;
1351
+ this.theme = null, (a = this.measurer) == null || a.clear(), this.markLayoutDirty();
1352
+ });
1353
+ const o = typeof document > "u" ? void 0 : document.fonts;
1354
+ (s = o == null ? void 0 : o.addEventListener) == null || s.call(o, "loadingdone", this.onFontsLoaded), this.theme = null, this.markLayoutDirty();
1342
1355
  }
1343
1356
  bindTooltip(t) {
1344
1357
  this.tooltipEl = t;
1345
1358
  }
1346
1359
  unbind() {
1347
- var t, e, i;
1348
- this.frameHandle !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this.frameHandle), this.frameHandle = null), (t = this.dprMedia) == null || t.removeEventListener("change", this.onDprChange), this.dprMedia = null, (e = this.unsubscribeTheme) == null || e.call(this), this.unsubscribeTheme = null, (i = this.measurer) == null || i.remove(), this.measurer = null, this.container = null, this.themeRoot = null, this.seriesCanvas = null, this.overlayCanvas = null, this.seriesCtx = null, this.overlayCtx = null, this.tooltipEl = null;
1360
+ var t, e, i, r, o;
1361
+ this.frameHandle !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this.frameHandle), this.frameHandle = null), (t = this.dprMedia) == null || t.removeEventListener("change", this.onDprChange), this.dprMedia = null, (e = this.unsubscribeTheme) == null || e.call(this), this.unsubscribeTheme = null, typeof document < "u" && ((r = (i = document.fonts) == null ? void 0 : i.removeEventListener) == null || r.call(i, "loadingdone", this.onFontsLoaded)), (o = this.measurer) == null || o.remove(), this.measurer = null, this.container = null, this.themeRoot = null, this.seriesCanvas = null, this.overlayCanvas = null, this.seriesCtx = null, this.overlayCtx = null, this.tooltipEl = null;
1349
1362
  }
1350
1363
  /** Detect a change of DPR (a change of monitor): rebind matchMedia (R-2.9). */
1351
1364
  rebindDprWatch() {
@@ -1354,17 +1367,17 @@ class ce {
1354
1367
  }
1355
1368
  /** Called by the ResizeObserver; coalesced onto one rAF (R-2.10). */
1356
1369
  requestResize(t, e) {
1357
- t === this.cssWidth && e === this.cssHeight || (this.pendingWidth = t, this.pendingHeight = e, this.markLayoutDirty());
1370
+ t === (this.pendingWidth ?? this.cssWidth) && e === (this.pendingHeight ?? this.cssHeight) || (this.pendingWidth = t, this.pendingHeight = e, this.markLayoutDirty());
1358
1371
  }
1359
1372
  applyPendingSize() {
1360
1373
  if (this.pendingWidth === null || this.pendingHeight === null) return;
1361
1374
  this.cssWidth = this.pendingWidth, this.cssHeight = this.pendingHeight, this.pendingWidth = null, this.pendingHeight = null;
1362
- const { seriesCanvas: t, overlayCanvas: e, seriesCtx: i, overlayCtx: r, dpr: s } = this;
1375
+ const { seriesCanvas: t, overlayCanvas: e, seriesCtx: i, overlayCtx: r, dpr: o } = this;
1363
1376
  if (!t || !e || !i || !r) return;
1364
- const o = Math.max(0, Math.round(this.cssWidth * s)), a = Math.max(0, Math.round(this.cssHeight * s));
1377
+ const s = Math.max(0, Math.round(this.cssWidth * o)), a = Math.max(0, Math.round(this.cssHeight * o));
1365
1378
  for (const l of [t, e])
1366
- l.width = o, l.height = a, l.style.width = `${this.cssWidth}px`, l.style.height = `${this.cssHeight}px`;
1367
- i.setTransform(s, 0, 0, s, 0, 0), r.setTransform(s, 0, 0, s, 0, 0);
1379
+ l.width = s, l.height = a, l.style.width = `${this.cssWidth}px`, l.style.height = `${this.cssHeight}px`;
1380
+ i.setTransform(o, 0, 0, o, 0, 0), r.setTransform(o, 0, 0, o, 0, 0);
1368
1381
  }
1369
1382
  /* ================= Scheduling (R-2.11) ================= */
1370
1383
  markSeriesDirty() {
@@ -1384,11 +1397,15 @@ class ce {
1384
1397
  }));
1385
1398
  }
1386
1399
  frame() {
1387
- if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = Ie(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
1400
+ if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = Me(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
1388
1401
  this.layoutDirty && this.pushLayoutSnapshot();
1389
1402
  return;
1390
1403
  }
1391
- this.materialsDirty && this.materialize(), this.layoutDirty && (this.updateLayout(), this.layoutDirty = !1, this.pushLayoutSnapshot()), this.seriesDirty && (this.drawSeriesLayer(), this.seriesDirty = !1), this.overlayDirty && (this.drawOverlayLayer(), this.overlayDirty = !1);
1404
+ if (this.materialsDirty && this.materialize(), this.layoutDirty && (this.updateLayout(), this.layoutDirty = !1, this.pushLayoutSnapshot(), this.hover !== null)) {
1405
+ const { mouseX: t, mouseY: e } = this.hover;
1406
+ this.hoverKey = "", this.pointerMove(t, e);
1407
+ }
1408
+ this.seriesDirty && (this.drawSeriesLayer(), this.seriesDirty = !1), this.overlayDirty && (this.drawOverlayLayer(), this.overlayDirty = !1);
1392
1409
  }
1393
1410
  /* ================= Layout ================= */
1394
1411
  /** The effective grid default: only the first registered axis per orientation
@@ -1396,9 +1413,9 @@ class ce {
1396
1413
  gridDefault() {
1397
1414
  const t = /* @__PURE__ */ new Map();
1398
1415
  let e = !0, i = !0;
1399
- for (const [r, s] of [...this.axes.entries()].sort((o, a) => o[1].order - a[1].order)) {
1400
- const o = s.config.orientation === "x" ? e : i;
1401
- t.set(r, s.config.grid ?? o), s.config.orientation === "x" ? e = !1 : i = !1;
1416
+ for (const [r, o] of [...this.axes.entries()].sort((s, a) => s[1].order - a[1].order)) {
1417
+ const s = o.config.orientation === "x" ? e : i;
1418
+ t.set(r, o.config.grid ?? s), o.config.orientation === "x" ? e = !1 : i = !1;
1402
1419
  }
1403
1420
  return t;
1404
1421
  }
@@ -1414,7 +1431,7 @@ class ce {
1414
1431
  yAxisId: r.config.yAxisId,
1415
1432
  extent: r.extent
1416
1433
  }));
1417
- return cn(t, e, i, this.limitValues(t, e));
1434
+ return hn(t, e, i, this.limitValues(t, e));
1418
1435
  }
1419
1436
  /** The values of the limits that are to pull this axis along. */
1420
1437
  limitValues(t, e) {
@@ -1430,41 +1447,42 @@ class ce {
1430
1447
  mapFor(t) {
1431
1448
  const e = t.calendar;
1432
1449
  if (!(e === void 0 || e.length === 0))
1433
- return (i) => De(i, e);
1450
+ return (i) => Ce(i, e);
1434
1451
  }
1435
1452
  gapFor(t) {
1436
1453
  const e = t.calendar;
1437
1454
  if (!(e === void 0 || e.length === 0))
1438
- return (i) => $e(i, e);
1455
+ return (i) => Oe(i, e);
1439
1456
  }
1440
1457
  extentFor(t) {
1441
1458
  return this.axisExtent(t.orientation, t.id);
1442
1459
  }
1443
1460
  updateLayout() {
1444
1461
  const t = this.measurer, e = this.gridDefault(), i = [];
1445
- for (const [r, s] of [...this.axes.entries()].sort((o, a) => o[1].order - a[1].order)) {
1446
- const o = s.config;
1462
+ for (const [r, o] of [...this.axes.entries()].sort((s, a) => s[1].order - a[1].order)) {
1463
+ const s = o.config;
1447
1464
  i.push({
1448
- key: `${o.orientation}:${o.id}`,
1449
- id: o.id,
1450
- orientation: o.orientation,
1451
- position: o.position,
1452
- label: o.label,
1465
+ key: `${s.orientation}:${s.id}`,
1466
+ id: s.id,
1467
+ orientation: s.orientation,
1468
+ position: s.position,
1469
+ label: s.label,
1453
1470
  grid: e.get(r) ?? !1,
1454
- extent: this.extentFor(o),
1455
- domainMode: o.domain,
1456
- tickCount: o.tickCount,
1457
- tickFormat: o.tickFormat,
1458
- tickValues: o.ticks,
1459
- calendar: o.calendar
1471
+ extent: this.extentFor(s),
1472
+ domainMode: s.domain,
1473
+ tickCount: s.tickCount,
1474
+ tickFormat: s.tickFormat,
1475
+ tickValues: s.ticks,
1476
+ calendar: s.calendar,
1477
+ limitLabels: s.orientation === "y" ? this.limitsInOrder().map((a) => a.config).filter((a) => a.orientation === "y" && a.axisId === s.id && a.label !== void 0 && a.label !== "").map((a) => a.label) : void 0
1460
1478
  });
1461
1479
  }
1462
- this.layout = Be({
1480
+ this.layout = ze({
1463
1481
  width: this.cssWidth,
1464
1482
  height: this.cssHeight,
1465
1483
  padding: this.padding,
1466
1484
  axes: i,
1467
- measure: (r, s) => t === null ? { width: 0, height: 0 } : t.measure(r, s),
1485
+ measure: (r, o) => t === null ? { width: 0, height: 0 } : t.measure(r, o),
1468
1486
  hysteresis: this.hysteresis
1469
1487
  });
1470
1488
  }
@@ -1475,26 +1493,26 @@ class ce {
1475
1493
  }
1476
1494
  /* ================= Series colours and legend entries ================= */
1477
1495
  colorFor(t, e) {
1478
- var s;
1496
+ var o;
1479
1497
  if (t.config.color !== void 0) return t.config.color;
1480
1498
  const i = t.config.tone;
1481
1499
  if (i !== void 0) {
1482
- const o = this.theme ?? W;
1483
- return i === "alarm" ? o.colorAlarm : i === "warning" ? o.colorWarning : o.colorOk;
1500
+ const s = this.theme ?? O;
1501
+ return i === "alarm" ? s.colorAlarm : i === "warning" ? s.colorWarning : s.colorOk;
1484
1502
  }
1485
- const r = ((s = this.theme) == null ? void 0 : s.series) ?? W.series;
1486
- return r[this.paletteSlot(t, e) % Math.max(1, r.length)] ?? W.series[0] ?? "#2563eb";
1503
+ const r = ((o = this.theme) == null ? void 0 : o.series) ?? O.series;
1504
+ return r[this.paletteSlot(t, e) % Math.max(1, r.length)] ?? O.series[0] ?? "#2563eb";
1487
1505
  }
1488
1506
  /** Named: the place of the name. Nameless: the index in the registration, as
1489
1507
  before - and a warning as soon as that shifts underneath it. */
1490
1508
  paletteSlot(t, e) {
1491
- return t.config.name !== void 0 ? t.slot : (t.lastSlot !== null && t.lastSlot !== e && G(
1509
+ return t.config.name !== void 0 ? t.slot : (t.lastSlot !== null && t.lastSlot !== e && q(
1492
1510
  "series-without-name-colour",
1493
1511
  "a series without a name has changed its colour, because a series before it went away - with `name` it keeps it."
1494
1512
  ), t.lastSlot = e, e);
1495
1513
  }
1496
1514
  nameFor(t, e) {
1497
- return t.config.name !== void 0 ? t.config.name : (G(
1515
+ return t.config.name !== void 0 ? t.config.name : (q(
1498
1516
  "series-without-name",
1499
1517
  `a series without a name is called "Series ${e + 1}" in the legend and the tooltip - the name belongs in \`name\`.`
1500
1518
  ), `Series ${e + 1}`);
@@ -1502,14 +1520,14 @@ class ce {
1502
1520
  legendItems() {
1503
1521
  const t = [], e = /* @__PURE__ */ new Set();
1504
1522
  return this.seriesInOrder().forEach((i, r) => {
1505
- const s = i.config;
1506
- if (s.kind === "state") {
1507
- s.states.forEach((o, a) => {
1508
- const l = `${o.label}\0${o.color}`;
1523
+ const o = i.config;
1524
+ if (o.kind === "state") {
1525
+ o.states.forEach((s, a) => {
1526
+ const l = `${s.label}\0${s.color}`;
1509
1527
  e.has(l) || (e.add(l), t.push({
1510
1528
  id: `${i.order}:${a}`,
1511
- name: o.label,
1512
- color: o.color,
1529
+ name: s.label,
1530
+ color: s.color,
1513
1531
  seriesId: i.order
1514
1532
  }));
1515
1533
  });
@@ -1540,28 +1558,28 @@ class ce {
1540
1558
  }
1541
1559
  }
1542
1560
  limitItems(t) {
1543
- const e = this.theme ?? W, i = [];
1561
+ const e = this.theme ?? O, i = [];
1544
1562
  for (const { config: r } of this.limitsInOrder()) {
1545
1563
  if (r.kind === "band" !== t) continue;
1546
- const s = this.findAxis(r.orientation, r.axisId);
1547
- if (s === null) continue;
1548
- const o = this.limitColor(r, e), a = this.limitDash(r);
1564
+ const o = this.findAxis(r.orientation, r.axisId);
1565
+ if (o === null) continue;
1566
+ const s = this.limitColor(r, e), a = this.limitDash(r);
1549
1567
  if (r.kind === "band")
1550
1568
  i.push({
1551
1569
  orientation: r.orientation,
1552
- fromPx: s.scale.toPx(r.from),
1553
- toPx: s.scale.toPx(r.to),
1554
- color: o,
1570
+ fromPx: o.scale.toPx(r.from),
1571
+ toPx: o.scale.toPx(r.to),
1572
+ color: s,
1555
1573
  band: !0,
1556
1574
  dash: a
1557
1575
  });
1558
1576
  else {
1559
- const l = s.scale.toPx(r.value);
1577
+ const l = o.scale.toPx(r.value);
1560
1578
  i.push({
1561
1579
  orientation: r.orientation,
1562
1580
  fromPx: l,
1563
1581
  toPx: l,
1564
- color: o,
1582
+ color: s,
1565
1583
  band: !1,
1566
1584
  dash: a
1567
1585
  });
@@ -1576,11 +1594,11 @@ class ce {
1576
1594
  if (i.label === void 0 || i.label === "") continue;
1577
1595
  const r = this.findAxis(i.orientation, i.axisId);
1578
1596
  if (r === null) continue;
1579
- const s = i.kind === "line" ? i.value : (i.from + i.to) / 2;
1597
+ const o = i.kind === "line" ? i.value : (i.from + i.to) / 2;
1580
1598
  t.push({
1581
1599
  id: e,
1582
1600
  axisKey: r.key,
1583
- px: r.scale.toPx(s),
1601
+ px: r.scale.toPx(o),
1584
1602
  label: i.label,
1585
1603
  severity: i.severity,
1586
1604
  role: i.role
@@ -1590,7 +1608,7 @@ class ce {
1590
1608
  }
1591
1609
  /* ================= Drawing ================= */
1592
1610
  drawItems() {
1593
- const t = [], e = this.seriesInOrder(), i = fn(
1611
+ const t = [], e = this.seriesInOrder(), i = pn(
1594
1612
  e.map((r) => ({
1595
1613
  order: r.order,
1596
1614
  kind: r.config.kind,
@@ -1599,18 +1617,18 @@ class ce {
1599
1617
  fraction: r.config.kind === "bar" ? r.config.barWidth : 0
1600
1618
  }))
1601
1619
  );
1602
- return e.forEach((r, s) => {
1603
- const o = r.materialized;
1604
- if (o === null) return;
1620
+ return e.forEach((r, o) => {
1621
+ const s = r.materialized;
1622
+ if (s === null) return;
1605
1623
  const a = this.findAxis("x", r.config.xAxisId), l = this.findAxis("y", r.config.yAxisId);
1606
1624
  if (a === null || l === null) return;
1607
1625
  const c = this.highlight !== null && this.highlight !== r.order, u = {
1608
- x: o.x,
1609
- y: o.y,
1610
- length: o.length,
1626
+ x: s.x,
1627
+ y: s.y,
1628
+ length: s.length,
1611
1629
  xScale: a.scale,
1612
1630
  yScale: l.scale,
1613
- color: this.colorFor(r, s),
1631
+ color: this.colorFor(r, o),
1614
1632
  alpha: c ? 0.25 : 1
1615
1633
  }, h = r.config;
1616
1634
  switch (h.kind) {
@@ -1620,14 +1638,14 @@ class ce {
1620
1638
  kind: "line",
1621
1639
  strokeWidth: h.strokeWidth,
1622
1640
  dash: h.dash,
1623
- marker: h.markers === "always" || h.markers === "auto" && o.length <= pn
1641
+ marker: h.markers === "always" || h.markers === "auto" && s.length <= gn
1624
1642
  });
1625
1643
  break;
1626
1644
  case "area":
1627
1645
  t.push({
1628
1646
  ...u,
1629
1647
  kind: "area",
1630
- y0: o.y0,
1648
+ y0: s.y0,
1631
1649
  baseline: 0,
1632
1650
  fillOpacity: h.fillOpacity,
1633
1651
  strokeWidth: h.strokeWidth
@@ -1639,8 +1657,8 @@ class ce {
1639
1657
  size: 1,
1640
1658
  step: r.step ?? 0,
1641
1659
  fraction: h.barWidth
1642
- }, d = a.scale.domain, m = dn(
1643
- hn(p.step, d[1] - d[0]),
1660
+ }, d = a.scale.domain, m = mn(
1661
+ fn(p.step, d[1] - d[0]),
1644
1662
  p.fraction,
1645
1663
  p.index,
1646
1664
  p.size
@@ -1670,17 +1688,17 @@ class ce {
1670
1688
  break;
1671
1689
  }
1672
1690
  case "matrix": {
1673
- const p = Nn(h.coloring, this.theme ?? W);
1691
+ const p = In(h.coloring, this.theme ?? O);
1674
1692
  t.push({
1675
1693
  ...u,
1676
1694
  kind: "matrix",
1677
- buckets: wn(o, h.coloring, p.length),
1695
+ buckets: Sn(s, h.coloring, p.length),
1678
1696
  colors: p,
1679
- width: lt(
1697
+ width: ct(
1680
1698
  r.step ?? 0,
1681
1699
  a.scale.domain[1] - a.scale.domain[0]
1682
1700
  ),
1683
- height: lt(
1701
+ height: ct(
1684
1702
  r.cellHeight ?? 0,
1685
1703
  l.scale.domain[1] - l.scale.domain[0]
1686
1704
  )
@@ -1691,11 +1709,11 @@ class ce {
1691
1709
  t.push({
1692
1710
  ...u,
1693
1711
  kind: "span",
1694
- x1: o.x1 ?? yn,
1712
+ x1: s.x1 ?? bn,
1695
1713
  // Computed once per materialisation, not per frame: the calculation
1696
1714
  // is quadratic, and a schedule with five hundred spans is pushed and
1697
1715
  // pulled like any other chart.
1698
- depth: r.depth ?? gn,
1716
+ depth: r.depth ?? xn,
1699
1717
  height: h.height ?? 0.6,
1700
1718
  domainEnd: a.scale.domain[1]
1701
1719
  });
@@ -1708,15 +1726,15 @@ class ce {
1708
1726
  axis: a single series fills its band, a stack gets a domain with one unit per
1709
1727
  machine from the caller. */
1710
1728
  lanePx(t, e) {
1711
- const i = e.scale.domain, r = e.scale.toPx(t.laneFrom ?? i[0]), s = e.scale.toPx(t.laneTo ?? i[1]);
1712
- return { top: Math.min(r, s), bottom: Math.max(r, s) };
1729
+ const i = e.scale.domain, r = e.scale.toPx(t.laneFrom ?? i[0]), o = e.scale.toPx(t.laneTo ?? i[1]);
1730
+ return { top: Math.min(r, o), bottom: Math.max(r, o) };
1713
1731
  }
1714
1732
  drawSeriesLayer() {
1715
1733
  var r;
1716
1734
  const t = this.seriesCtx, e = this.theme;
1717
1735
  if (!t || !e) return;
1718
1736
  const i = typeof performance > "u" ? 0 : performance.now();
1719
- tn(t, {
1737
+ nn(t, {
1720
1738
  width: this.cssWidth,
1721
1739
  height: this.cssHeight,
1722
1740
  plot: this.layout.plot,
@@ -1729,7 +1747,7 @@ class ce {
1729
1747
  }
1730
1748
  drawOverlayLayer() {
1731
1749
  const t = this.overlayCtx, e = this.theme;
1732
- !t || !e || (en(t, {
1750
+ !t || !e || (rn(t, {
1733
1751
  width: this.cssWidth,
1734
1752
  height: this.cssHeight,
1735
1753
  plot: this.layout.plot,
@@ -1768,35 +1786,35 @@ class ce {
1768
1786
  if (this.seriesInOrder().forEach((f, b) => {
1769
1787
  const k = f.materialized;
1770
1788
  if (k === null || k.length === 0) return;
1771
- const N = f.config, w = this.findAxis("x", N.xAxisId), L = this.findAxis("y", N.yAxisId);
1772
- if (w === null || L === null) return;
1773
- const F = w.scale.fromPx(t), P = L.scale.fromPx(e), S = this.hitIn(f, k, w, L, e, F, P);
1774
- S !== null && r.push({
1789
+ const w = f.config, I = this.findAxis("x", w.xAxisId), A = this.findAxis("y", w.yAxisId);
1790
+ if (I === null || A === null) return;
1791
+ const F = I.scale.fromPx(t), P = A.scale.fromPx(e), N = this.hitIn(f, k, I, A, e, F, P);
1792
+ N !== null && r.push({
1775
1793
  entry: f,
1776
- index: S.index,
1777
- color: S.color ?? this.colorFor(f, b),
1794
+ index: N.index,
1795
+ color: N.color ?? this.colorFor(f, b),
1778
1796
  name: this.nameFor(f, b),
1779
- px: S.px,
1780
- py: S.py,
1781
- xValue: S.xValue,
1782
- yValue: S.yValue,
1783
- marked: S.marked,
1784
- areal: S.areal,
1785
- value: S.value,
1786
- segment: S.segment
1797
+ px: N.px,
1798
+ py: N.py,
1799
+ xValue: N.xValue,
1800
+ yValue: N.yValue,
1801
+ marked: N.marked,
1802
+ areal: N.areal,
1803
+ value: N.value,
1804
+ segment: N.segment
1787
1805
  });
1788
1806
  }), r.length === 0) return null;
1789
- const s = r.filter((f) => !f.areal), o = s.length > 0 ? s : r;
1790
- let a = o[0];
1807
+ const o = r.filter((f) => !f.areal), s = o.length > 0 ? o : r;
1808
+ let a = s[0];
1791
1809
  if (i === "nearest") {
1792
1810
  let f = Number.POSITIVE_INFINITY;
1793
1811
  for (const b of r) {
1794
- const k = b.areal ? 0 : b.px - t, N = b.areal ? 0 : b.py - e, w = k * k + N * N;
1795
- w < f && (f = w, a = b);
1812
+ const k = b.areal ? 0 : b.px - t, w = b.areal ? 0 : b.py - e, I = k * k + w * w;
1813
+ I < f && (f = I, a = b);
1796
1814
  }
1797
1815
  } else {
1798
1816
  let f = Number.POSITIVE_INFINITY;
1799
- for (const b of o) {
1817
+ for (const b of s) {
1800
1818
  const k = Math.abs(b.px - t);
1801
1819
  k < f && (f = k, a = b);
1802
1820
  }
@@ -1805,7 +1823,7 @@ class ce {
1805
1823
  // An area is always included: it covers the pointer, otherwise it
1806
1824
  // would not have reported a hit at all. Only points have to share the
1807
1825
  // x position.
1808
- (f) => f.areal || Math.abs(f.px - a.px) <= mn
1826
+ (f) => f.areal || Math.abs(f.px - a.px) <= yn
1809
1827
  ), c = l.map((f) => ({
1810
1828
  seriesName: f.name,
1811
1829
  color: f.color,
@@ -1833,16 +1851,16 @@ class ce {
1833
1851
  and a span ask "what lies under the pointer", and that is not the same
1834
1852
  question: for the right half of every segment the nearest point gives the
1835
1853
  wrong answer. */
1836
- hitIn(t, e, i, r, s, o, a) {
1854
+ hitIn(t, e, i, r, o, s, a) {
1837
1855
  const l = t.config, c = e.length;
1838
1856
  if (l.kind === "state") {
1839
1857
  const d = this.lanePx(l, r);
1840
- if (s < d.top || s > d.bottom) return null;
1841
- const m = Ye(e.x, c, o);
1858
+ if (o < d.top || o > d.bottom) return null;
1859
+ const m = Ge(e.x, c, s);
1842
1860
  if (m < 0) return null;
1843
1861
  const y = e.y[m];
1844
1862
  if (Number.isNaN(y)) return null;
1845
- const f = e.x[m], b = ae(e.x, c, m, i.scale.domain[1]), k = l.states[y | 0];
1863
+ const f = e.x[m], b = le(e.x, c, m, i.scale.domain[1]), k = l.states[y | 0];
1846
1864
  return {
1847
1865
  index: m,
1848
1866
  px: i.scale.toPx(f),
@@ -1858,18 +1876,22 @@ class ce {
1858
1876
  if (l.kind === "span") {
1859
1877
  const d = e.x1;
1860
1878
  if (d === null) return null;
1861
- const m = i.scale.domain[1], y = l.height ?? 0.6, f = Ge(
1879
+ const m = i.scale.domain[1], y = l.height ?? 0.6, f = Ke(
1862
1880
  e.x,
1863
1881
  d,
1864
1882
  e.y,
1865
1883
  c,
1866
- o,
1884
+ s,
1867
1885
  a,
1868
1886
  y,
1869
- m
1887
+ m,
1888
+ t.depth,
1889
+ // The drawing moves a covering span down the screen; in lane units that
1890
+ // way carries the sign of the y scale's slope.
1891
+ ce * y * Math.sign(r.scale.m)
1870
1892
  );
1871
1893
  if (f < 0) return null;
1872
- const b = e.x[f], k = e.y[f], N = d[f];
1894
+ const b = e.x[f], k = e.y[f], w = d[f];
1873
1895
  return {
1874
1896
  index: f,
1875
1897
  px: i.scale.toPx(b),
@@ -1880,21 +1902,21 @@ class ce {
1880
1902
  areal: !0,
1881
1903
  segment: {
1882
1904
  from: b,
1883
- to: rt(N, m),
1905
+ to: ot(w, m),
1884
1906
  label: "",
1885
- open: le(N)
1907
+ open: ue(w)
1886
1908
  }
1887
1909
  };
1888
1910
  }
1889
1911
  if (l.kind === "matrix") {
1890
- const d = rn(
1912
+ const d = sn(
1891
1913
  e.x,
1892
1914
  e.y,
1893
1915
  c,
1894
- o,
1916
+ s,
1895
1917
  a,
1896
- lt(t.step ?? 0, i.scale.domain[1] - i.scale.domain[0]),
1897
- lt(t.cellHeight ?? 0, r.scale.domain[1] - r.scale.domain[0])
1918
+ ct(t.step ?? 0, i.scale.domain[1] - i.scale.domain[0]),
1919
+ ct(t.cellHeight ?? 0, r.scale.domain[1] - r.scale.domain[0])
1898
1920
  );
1899
1921
  if (d < 0) return null;
1900
1922
  const m = e.w, y = m === null ? Number.NaN : m[d];
@@ -1914,7 +1936,7 @@ class ce {
1914
1936
  areal: !0
1915
1937
  };
1916
1938
  }
1917
- const u = nn(e.x, c, o);
1939
+ const u = on(e.x, c, s);
1918
1940
  if (u < 0) return null;
1919
1941
  const h = e.y[u];
1920
1942
  if (Number.isNaN(h)) return null;
@@ -1940,10 +1962,10 @@ class ce {
1940
1962
  return;
1941
1963
  }
1942
1964
  const i = t.offsetWidth, r = t.offsetHeight;
1943
- let s = e.hit.xPx + 12;
1944
- s + i > this.cssWidth && (s = e.hit.xPx - 12 - i), s < 0 && (s = 0);
1945
- let o = e.mouseY - r / 2;
1946
- o = Math.min(Math.max(o, 0), Math.max(0, this.cssHeight - r)), t.style.transform = `translate3d(${Math.round(s)}px, ${Math.round(o)}px, 0)`, t.style.opacity = "1";
1965
+ let o = e.hit.xPx + 12;
1966
+ o + i > this.cssWidth && (o = e.hit.xPx - 12 - i), o < 0 && (o = 0);
1967
+ let s = e.mouseY - r / 2;
1968
+ s = Math.min(Math.max(s, 0), Math.max(0, this.cssHeight - r)), t.style.transform = `translate3d(${Math.round(o)}px, ${Math.round(s)}px, 0)`, t.style.opacity = "1";
1947
1969
  }
1948
1970
  /* ================= Snapshots for the HTML layer ================= */
1949
1971
  pushLayoutSnapshot() {
@@ -1968,92 +1990,92 @@ class ce {
1968
1990
  }
1969
1991
  /** Class name of the measuring span for tick labels - keeps the CSS and the
1970
1992
  layout in step. */
1971
- g(ce, "classTick", ut);
1972
- const ue = be(null);
1973
- function Q(n) {
1974
- const t = xe(ue);
1975
- if (t === null && it)
1993
+ g(he, "classTick", it);
1994
+ const de = ve(null);
1995
+ function tt(n) {
1996
+ const t = ke(de);
1997
+ if (t === null && rt)
1976
1998
  throw new Error(
1977
1999
  `@umriss-ui/charts: <${n}> must be used inside a <Chart>.`
1978
2000
  );
1979
2001
  return t;
1980
2002
  }
1981
- function Z(n, t) {
1982
- const e = Q(n), i = X(null);
1983
- D(() => {
2003
+ function j(n, t) {
2004
+ const e = tt(n), i = Z(null);
2005
+ $(() => {
1984
2006
  if (e !== null)
1985
2007
  return i.current = e.registerSeries(t), () => {
1986
2008
  i.current !== null && e.unregisterSeries(i.current), i.current = null;
1987
2009
  };
1988
- }, [e]), D(() => {
2010
+ }, [e]), $(() => {
1989
2011
  e !== null && i.current !== null && e.updateSeries(i.current, t);
1990
2012
  });
1991
2013
  }
1992
- function he(n, t) {
1993
- const e = Q(n), i = X(null);
1994
- D(() => {
2014
+ function fe(n, t) {
2015
+ const e = tt(n), i = Z(null);
2016
+ $(() => {
1995
2017
  if (e !== null)
1996
2018
  return i.current = e.registerAxis(t), () => {
1997
2019
  i.current !== null && e.unregisterAxis(i.current), i.current = null;
1998
2020
  };
1999
- }, [e]), D(() => {
2021
+ }, [e]), $(() => {
2000
2022
  e !== null && i.current !== null && e.updateAxis(i.current, t);
2001
2023
  });
2002
2024
  }
2003
- function de(n, t) {
2004
- const e = Q(n), i = X(null);
2005
- D(() => {
2025
+ function me(n, t) {
2026
+ const e = tt(n), i = Z(null);
2027
+ $(() => {
2006
2028
  if (e !== null)
2007
2029
  return i.current = e.registerLimit(t), () => {
2008
2030
  i.current !== null && e.unregisterLimit(i.current), i.current = null;
2009
2031
  };
2010
- }, [e]), D(() => {
2032
+ }, [e]), $(() => {
2011
2033
  e !== null && i.current !== null && e.updateLimit(i.current, t);
2012
2034
  });
2013
2035
  }
2014
- function Sn(n, t) {
2015
- const e = Q(n);
2016
- D(() => {
2036
+ function Ln(n, t) {
2037
+ const e = tt(n);
2038
+ $(() => {
2017
2039
  if (e !== null)
2018
2040
  return e.registerLegend(t), () => e.unregisterLegend();
2019
- }, [e]), D(() => {
2041
+ }, [e]), $(() => {
2020
2042
  e == null || e.updateLegend(t);
2021
2043
  });
2022
2044
  }
2023
- function Mn(n, t) {
2024
- const e = Q(n);
2025
- D(() => {
2045
+ function Tn(n, t) {
2046
+ const e = tt(n);
2047
+ $(() => {
2026
2048
  if (e !== null)
2027
2049
  return e.registerTooltip(t), () => e.unregisterTooltip();
2028
- }, [e]), D(() => {
2050
+ }, [e]), $(() => {
2029
2051
  e == null || e.updateTooltip(t);
2030
2052
  });
2031
2053
  }
2032
- function Tn(n, t) {
2033
- const { band: e, position: i, orientation: r } = n, s = {
2054
+ function An(n, t) {
2055
+ const { band: e, position: i, orientation: r } = n, o = {
2034
2056
  left: `${e.x}px`,
2035
2057
  top: `${e.y}px`,
2036
2058
  width: `${e.width}px`,
2037
2059
  height: `${e.height}px`
2038
- }, o = Tt + At;
2060
+ }, s = Lt + Tt;
2039
2061
  return /* @__PURE__ */ _(
2040
2062
  "div",
2041
2063
  {
2042
2064
  className: `uc-axis uc-axis-${r} uc-axis-${i}`,
2043
- style: s,
2065
+ style: o,
2044
2066
  "data-axis": n.id,
2045
2067
  children: [
2046
- /* @__PURE__ */ I("span", { className: "uc-axis-line" }),
2068
+ /* @__PURE__ */ S("span", { className: "uc-axis-line" }),
2047
2069
  n.ticks.map((a) => {
2048
2070
  if (r === "y") {
2049
2071
  const c = Math.round(a.px - e.y);
2050
2072
  return /* @__PURE__ */ _("span", { className: "uc-tick", style: { top: `${c}px` }, children: [
2051
- /* @__PURE__ */ I("span", { className: "uc-tick-mark" }),
2052
- /* @__PURE__ */ I(
2073
+ /* @__PURE__ */ S("span", { className: "uc-tick-mark" }),
2074
+ /* @__PURE__ */ S(
2053
2075
  "span",
2054
2076
  {
2055
2077
  className: "uc-tick-label",
2056
- style: { [i === "left" ? "right" : "left"]: `${o}px` },
2078
+ style: { [i === "left" ? "right" : "left"]: `${s}px` },
2057
2079
  children: a.label
2058
2080
  }
2059
2081
  )
@@ -2061,21 +2083,21 @@ function Tn(n, t) {
2061
2083
  }
2062
2084
  const l = Math.round(a.px - e.x);
2063
2085
  return /* @__PURE__ */ _("span", { className: "uc-tick", style: { left: `${l}px` }, children: [
2064
- /* @__PURE__ */ I("span", { className: "uc-tick-mark" }),
2065
- /* @__PURE__ */ I(
2086
+ /* @__PURE__ */ S("span", { className: "uc-tick-mark" }),
2087
+ /* @__PURE__ */ S(
2066
2088
  "span",
2067
2089
  {
2068
2090
  className: "uc-tick-label",
2069
2091
  style: {
2070
2092
  left: `${Math.round(a.labelLeft - e.x) - l}px`,
2071
- [i === "top" ? "bottom" : "top"]: `${o}px`
2093
+ [i === "top" ? "bottom" : "top"]: `${s}px`
2072
2094
  },
2073
2095
  children: a.label
2074
2096
  }
2075
2097
  )
2076
2098
  ] }, a.value);
2077
2099
  }),
2078
- n.breaks.map((a, l) => /* @__PURE__ */ I(
2100
+ n.breaks.map((a, l) => /* @__PURE__ */ S(
2079
2101
  "span",
2080
2102
  {
2081
2103
  className: "uc-break",
@@ -2085,7 +2107,7 @@ function Tn(n, t) {
2085
2107
  `break-${l}`
2086
2108
  )),
2087
2109
  t.map(
2088
- (a) => r === "y" ? /* @__PURE__ */ I(
2110
+ (a) => r === "y" ? /* @__PURE__ */ S(
2089
2111
  "span",
2090
2112
  {
2091
2113
  className: "uc-limit-label",
@@ -2095,7 +2117,7 @@ function Tn(n, t) {
2095
2117
  children: a.label
2096
2118
  },
2097
2119
  `limit-${a.id}`
2098
- ) : /* @__PURE__ */ I(
2120
+ ) : /* @__PURE__ */ S(
2099
2121
  "span",
2100
2122
  {
2101
2123
  className: "uc-limit-label",
@@ -2103,123 +2125,127 @@ function Tn(n, t) {
2103
2125
  "data-role": a.role,
2104
2126
  style: {
2105
2127
  left: `${Math.round(a.px - e.x)}px`,
2106
- [i === "top" ? "bottom" : "top"]: `${o}px`
2128
+ [i === "top" ? "bottom" : "top"]: `${s}px`
2107
2129
  },
2108
2130
  children: a.label
2109
2131
  },
2110
2132
  `limit-${a.id}`
2111
2133
  )
2112
2134
  ),
2113
- n.label !== void 0 && n.label !== "" && /* @__PURE__ */ I("span", { className: "uc-axis-title", children: n.label })
2135
+ n.label !== void 0 && n.label !== "" && /* @__PURE__ */ S("span", { className: "uc-axis-title", children: n.label })
2114
2136
  ]
2115
2137
  },
2116
2138
  n.key
2117
2139
  );
2118
2140
  }
2119
- function An({ scene: n }) {
2141
+ function Fn({ scene: n }) {
2120
2142
  const t = Et(
2121
2143
  n.subscribeLayout,
2122
2144
  n.getLayoutSnapshot,
2123
2145
  n.getLayoutServerSnapshot
2124
2146
  ), { layout: e } = t;
2125
- return e.plot.width <= 0 || e.plot.height <= 0 ? null : /* @__PURE__ */ I("div", { className: "uc-axes", children: e.axes.map(
2126
- (i) => Tn(
2147
+ return e.plot.width <= 0 || e.plot.height <= 0 ? null : /* @__PURE__ */ S("div", { className: "uc-axes", children: e.axes.map(
2148
+ (i) => An(
2127
2149
  i,
2128
2150
  t.limits.filter((r) => r.axisKey === i.key)
2129
2151
  )
2130
2152
  ) });
2131
2153
  }
2132
- function Ln(n) {
2154
+ function Pn(n) {
2133
2155
  var e;
2134
2156
  const t = (e = n.segment) == null ? void 0 : e.label;
2135
2157
  return t !== void 0 && t !== "" ? t : n.value !== void 0 ? Bt(n.value) : Bt(n.yValue);
2136
2158
  }
2137
- function Fn({ scene: n }) {
2159
+ function En({ scene: n }) {
2138
2160
  const t = Et(
2139
2161
  n.subscribeHover,
2140
2162
  n.getHoverSnapshot,
2141
2163
  n.getHoverServerSnapshot
2142
- ), e = ve(
2164
+ ), e = Ne(
2143
2165
  (r) => {
2144
2166
  n.bindTooltip(r);
2145
2167
  },
2146
2168
  [n]
2147
2169
  );
2148
- if (D(() => {
2170
+ if ($(() => {
2149
2171
  n.markOverlayDirty();
2150
2172
  }, [n, t.version]), t.tooltip === null) return null;
2151
2173
  const i = t.hover;
2152
- return /* @__PURE__ */ I("div", { className: "uc-tooltip", ref: e, role: "presentation", children: i === null ? null : t.tooltip.render !== void 0 ? t.tooltip.render(i.hit) : /* @__PURE__ */ _(Nt, { children: [
2153
- /* @__PURE__ */ I("div", { className: "uc-tooltip-head", children: t.xLabel }),
2154
- /* @__PURE__ */ I("div", { className: "uc-tooltip-list", children: i.hit.points.map((r) => /* @__PURE__ */ _("div", { className: "uc-tooltip-row", children: [
2155
- /* @__PURE__ */ I("span", { className: "uc-tooltip-chip", style: { background: r.color } }),
2156
- /* @__PURE__ */ I("span", { className: "uc-tooltip-name", children: r.seriesName }),
2157
- /* @__PURE__ */ I("span", { className: "uc-tooltip-value", children: Ln(r) })
2174
+ return /* @__PURE__ */ S("div", { className: "uc-tooltip", ref: e, role: "presentation", children: i === null ? null : t.tooltip.render !== void 0 ? t.tooltip.render(i.hit) : /* @__PURE__ */ _(Nt, { children: [
2175
+ /* @__PURE__ */ S("div", { className: "uc-tooltip-head", children: t.xLabel }),
2176
+ /* @__PURE__ */ S("div", { className: "uc-tooltip-list", children: i.hit.points.map((r) => /* @__PURE__ */ _("div", { className: "uc-tooltip-row", children: [
2177
+ /* @__PURE__ */ S("span", { className: "uc-tooltip-chip", style: { background: r.color } }),
2178
+ /* @__PURE__ */ S("span", { className: "uc-tooltip-name", children: r.seriesName }),
2179
+ /* @__PURE__ */ S("span", { className: "uc-tooltip-value", children: Pn(r) })
2158
2180
  ] }, `${r.seriesName}-${r.index}`)) })
2159
2181
  ] }) });
2160
2182
  }
2161
- function Jn(n) {
2183
+ function ti(n) {
2162
2184
  const {
2163
2185
  data: t,
2164
2186
  width: e = "100%",
2165
2187
  height: i = 300,
2166
2188
  padding: r = 8,
2167
- ariaLabel: s,
2168
- className: o,
2189
+ ariaLabel: o,
2190
+ className: s,
2169
2191
  style: a,
2170
2192
  onPerf: l,
2171
2193
  children: c
2172
- } = n, [u] = ke(() => new ce()), h = X(null), p = X(null), d = X(null), m = X(null), y = typeof r == "number" ? void 0 : r, f = typeof r == "number" ? r : void 0, b = f ?? (y == null ? void 0 : y.top), k = f ?? (y == null ? void 0 : y.right), N = f ?? (y == null ? void 0 : y.bottom), w = f ?? (y == null ? void 0 : y.left), L = E(
2194
+ } = n, [u] = we(() => new he()), h = Z(null), p = Z(null), d = Z(null), m = Z(null), y = typeof r == "number" ? void 0 : r, f = typeof r == "number" ? r : void 0, b = f ?? (y == null ? void 0 : y.top), k = f ?? (y == null ? void 0 : y.right), w = f ?? (y == null ? void 0 : y.bottom), I = f ?? (y == null ? void 0 : y.left), A = E(
2173
2195
  () => ({
2174
2196
  top: b ?? 8,
2175
2197
  right: k ?? 8,
2176
- bottom: N ?? 8,
2177
- left: w ?? 8
2198
+ bottom: w ?? 8,
2199
+ left: I ?? 8
2178
2200
  }),
2179
- [b, k, N, w]
2201
+ [b, k, w, I]
2180
2202
  );
2181
- s === void 0 && G(
2203
+ o === void 0 && q(
2182
2204
  "chart-arialabel",
2183
2205
  "Chart without ariaLabel - please set a meaningful description (R-7.6)."
2184
- ), D(() => {
2185
- const S = h.current, H = p.current, R = d.current, v = m.current;
2186
- if (!S || !H || !R || !v) return;
2187
- u.bind(H, R, v, S);
2206
+ ), $(() => {
2207
+ const N = h.current, H = p.current, V = d.current, v = m.current;
2208
+ if (!N || !H || !V || !v) return;
2209
+ u.bind(H, V, v, N);
2188
2210
  const M = H.getBoundingClientRect();
2189
2211
  u.requestResize(M.width, M.height);
2190
- const x = new ResizeObserver(($) => {
2191
- var C;
2192
- const T = $[$.length - 1];
2193
- if (T === void 0) return;
2194
- const O = (C = T.contentBoxSize) == null ? void 0 : C[0];
2195
- O !== void 0 ? u.requestResize(O.inlineSize, O.blockSize) : u.requestResize(T.contentRect.width, T.contentRect.height);
2212
+ const x = new ResizeObserver((L) => {
2213
+ var B;
2214
+ const W = L[L.length - 1];
2215
+ if (W === void 0) return;
2216
+ const D = (B = W.contentBoxSize) == null ? void 0 : B[0];
2217
+ D !== void 0 ? u.requestResize(D.inlineSize, D.blockSize) : u.requestResize(W.contentRect.width, W.contentRect.height);
2196
2218
  });
2197
2219
  x.observe(H);
2198
- const A = () => u.pointerLeave();
2199
- return window.addEventListener("blur", A), () => {
2200
- window.removeEventListener("blur", A), x.disconnect(), u.unbind();
2220
+ const T = () => u.pointerLeave();
2221
+ window.addEventListener("blur", T);
2222
+ const C = (L) => {
2223
+ H.contains(L.target) || u.pointerLeave();
2201
2224
  };
2202
- }, [u]), D(() => {
2225
+ return document.addEventListener("pointerdown", C), () => {
2226
+ window.removeEventListener("blur", T), document.removeEventListener("pointerdown", C), x.disconnect(), u.unbind();
2227
+ };
2228
+ }, [u]), $(() => {
2203
2229
  u.setData(t);
2204
- }, [u, t]), D(() => {
2205
- u.setPadding(L);
2206
- }, [u, L]), D(() => {
2230
+ }, [u, t]), $(() => {
2231
+ u.setPadding(A);
2232
+ }, [u, A]), $(() => {
2207
2233
  u.setOnPerf(l ?? null);
2208
- }, [u, l]), D(() => {
2234
+ }, [u, l]), $(() => {
2209
2235
  u.validate();
2210
2236
  });
2211
2237
  const F = {
2212
2238
  width: e === "100%" ? "100%" : `${e}px`,
2213
2239
  height: `${i}px`,
2214
2240
  ...a
2215
- }, P = (S) => {
2216
- u.pointerMove(S.nativeEvent.offsetX, S.nativeEvent.offsetY);
2241
+ }, P = (N) => {
2242
+ u.pointerMove(N.nativeEvent.offsetX, N.nativeEvent.offsetY);
2217
2243
  };
2218
- return /* @__PURE__ */ I(ue.Provider, { value: u, children: /* @__PURE__ */ _(
2244
+ return /* @__PURE__ */ S(de.Provider, { value: u, children: /* @__PURE__ */ _(
2219
2245
  "div",
2220
2246
  {
2221
2247
  ref: h,
2222
- className: o ? `uc-root ${o}` : "uc-root",
2248
+ className: s ? `uc-root ${s}` : "uc-root",
2223
2249
  style: F,
2224
2250
  children: [
2225
2251
  /* @__PURE__ */ _(
@@ -2228,14 +2254,17 @@ function Jn(n) {
2228
2254
  ref: p,
2229
2255
  className: "uc-plot",
2230
2256
  role: "img",
2231
- "aria-label": s,
2257
+ "aria-label": o,
2232
2258
  onPointerMove: P,
2233
- onPointerLeave: () => u.pointerLeave(),
2259
+ onPointerDown: P,
2260
+ onPointerLeave: (N) => {
2261
+ N.pointerType !== "touch" && u.pointerLeave();
2262
+ },
2234
2263
  children: [
2235
- /* @__PURE__ */ I("canvas", { ref: d, className: "uc-layer-series", "aria-hidden": "true" }),
2236
- /* @__PURE__ */ I("canvas", { ref: m, className: "uc-layer-overlay", "aria-hidden": "true" }),
2237
- /* @__PURE__ */ I(An, { scene: u }),
2238
- /* @__PURE__ */ I(Fn, { scene: u })
2264
+ /* @__PURE__ */ S("canvas", { ref: d, className: "uc-layer-series", "aria-hidden": "true" }),
2265
+ /* @__PURE__ */ S("canvas", { ref: m, className: "uc-layer-overlay", "aria-hidden": "true" }),
2266
+ /* @__PURE__ */ S(Fn, { scene: u }),
2267
+ /* @__PURE__ */ S(En, { scene: u })
2239
2268
  ]
2240
2269
  }
2241
2270
  ),
@@ -2244,14 +2273,14 @@ function Jn(n) {
2244
2273
  }
2245
2274
  ) });
2246
2275
  }
2247
- function Qn(n) {
2276
+ function ei(n) {
2248
2277
  const {
2249
2278
  accessor: t,
2250
2279
  baseline: e,
2251
2280
  xAxisId: i = "x",
2252
2281
  yAxisId: r = "y",
2253
- data: s,
2254
- name: o,
2282
+ data: o,
2283
+ name: s,
2255
2284
  color: a,
2256
2285
  fillOpacity: l = 0.18,
2257
2286
  strokeWidth: c = 1.5
@@ -2262,24 +2291,24 @@ function Qn(n) {
2262
2291
  baseline: e,
2263
2292
  xAxisId: i,
2264
2293
  yAxisId: r,
2265
- data: s,
2266
- name: o,
2294
+ data: o,
2295
+ name: s,
2267
2296
  color: a,
2268
2297
  fillOpacity: l,
2269
2298
  strokeWidth: c
2270
2299
  }),
2271
- [t, e, i, r, s, o, a, l, c]
2300
+ [t, e, i, r, o, s, a, l, c]
2272
2301
  );
2273
- return Z("Area", u), null;
2302
+ return j("Area", u), null;
2274
2303
  }
2275
- function ti(n) {
2304
+ function ni(n) {
2276
2305
  const {
2277
2306
  accessor: t,
2278
2307
  xAxisId: e = "x",
2279
2308
  yAxisId: i = "y",
2280
2309
  data: r,
2281
- name: s,
2282
- color: o,
2310
+ name: o,
2311
+ color: s,
2283
2312
  barWidth: a = 0.8
2284
2313
  } = n, l = E(
2285
2314
  () => ({
@@ -2288,22 +2317,22 @@ function ti(n) {
2288
2317
  xAxisId: e,
2289
2318
  yAxisId: i,
2290
2319
  data: r,
2291
- name: s,
2292
- color: o,
2320
+ name: o,
2321
+ color: s,
2293
2322
  barWidth: a
2294
2323
  }),
2295
- [t, e, i, r, s, o, a]
2324
+ [t, e, i, r, o, s, a]
2296
2325
  );
2297
- return Z("Bar", l), null;
2326
+ return j("Bar", l), null;
2298
2327
  }
2299
- function Pn(n) {
2328
+ function Dn(n) {
2300
2329
  const {
2301
2330
  accessor: t,
2302
2331
  xAxisId: e = "x",
2303
2332
  yAxisId: i = "y",
2304
2333
  data: r,
2305
- name: s,
2306
- color: o,
2334
+ name: o,
2335
+ color: s,
2307
2336
  tone: a,
2308
2337
  strokeWidth: l = 1.5,
2309
2338
  dash: c,
@@ -2315,25 +2344,25 @@ function Pn(n) {
2315
2344
  xAxisId: e,
2316
2345
  yAxisId: i,
2317
2346
  data: r,
2318
- name: s,
2319
- color: o,
2347
+ name: o,
2348
+ color: s,
2320
2349
  tone: a,
2321
2350
  strokeWidth: l,
2322
2351
  dash: c,
2323
2352
  markers: u
2324
2353
  }),
2325
- [t, e, i, r, s, o, a, l, c, u]
2354
+ [t, e, i, r, o, s, a, l, c, u]
2326
2355
  );
2327
- return Z("Line", h), null;
2356
+ return j("Line", h), null;
2328
2357
  }
2329
- function En(n) {
2358
+ function $n(n) {
2330
2359
  const {
2331
2360
  accessor: t,
2332
2361
  xAxisId: e = "x",
2333
2362
  yAxisId: i = "y",
2334
2363
  data: r,
2335
- name: s,
2336
- color: o,
2364
+ name: o,
2365
+ color: s,
2337
2366
  tone: a,
2338
2367
  radius: l = 3
2339
2368
  } = n, c = E(
@@ -2343,23 +2372,23 @@ function En(n) {
2343
2372
  xAxisId: e,
2344
2373
  yAxisId: i,
2345
2374
  data: r,
2346
- name: s,
2347
- color: o,
2375
+ name: o,
2376
+ color: s,
2348
2377
  tone: a,
2349
2378
  radius: l
2350
2379
  }),
2351
- [t, e, i, r, s, o, a, l]
2380
+ [t, e, i, r, o, s, a, l]
2352
2381
  );
2353
- return Z("Scatter", c), null;
2382
+ return j("Scatter", c), null;
2354
2383
  }
2355
- function ei(n) {
2384
+ function ii(n) {
2356
2385
  const {
2357
2386
  accessor: t,
2358
2387
  states: e,
2359
2388
  xAxisId: i = "x",
2360
2389
  yAxisId: r = "y",
2361
- data: s,
2362
- name: o,
2390
+ data: o,
2391
+ name: s,
2363
2392
  laneFrom: a,
2364
2393
  laneTo: l
2365
2394
  } = n, c = E(
@@ -2369,16 +2398,16 @@ function ei(n) {
2369
2398
  states: e,
2370
2399
  xAxisId: i,
2371
2400
  yAxisId: r,
2372
- data: s,
2373
- name: o,
2401
+ data: o,
2402
+ name: s,
2374
2403
  laneFrom: a,
2375
2404
  laneTo: l
2376
2405
  }),
2377
- [t, e, i, r, s, o, a, l]
2406
+ [t, e, i, r, o, s, a, l]
2378
2407
  );
2379
- return Z("StateBand", c), null;
2408
+ return j("StateBand", c), null;
2380
2409
  }
2381
- const Dn = [
2410
+ const Cn = [
2382
2411
  "#eef2ff",
2383
2412
  "#c7d2fe",
2384
2413
  "#a5b4fc",
@@ -2387,17 +2416,17 @@ const Dn = [
2387
2416
  "#4f46e5",
2388
2417
  "#4338ca"
2389
2418
  ];
2390
- function ni(n) {
2419
+ function ri(n) {
2391
2420
  const {
2392
2421
  accessor: t,
2393
2422
  value: e,
2394
2423
  coloring: i,
2395
2424
  xAxisId: r = "x",
2396
- yAxisId: s = "y",
2397
- data: o,
2425
+ yAxisId: o = "y",
2426
+ data: s,
2398
2427
  name: a
2399
2428
  } = n, l = E(
2400
- () => i ?? { kind: "gradient", stops: Dn },
2429
+ () => i ?? { kind: "gradient", stops: Cn },
2401
2430
  [i]
2402
2431
  ), c = E(
2403
2432
  () => ({
@@ -2406,22 +2435,22 @@ function ni(n) {
2406
2435
  value: e,
2407
2436
  coloring: l,
2408
2437
  xAxisId: r,
2409
- yAxisId: s,
2410
- data: o,
2438
+ yAxisId: o,
2439
+ data: s,
2411
2440
  name: a
2412
2441
  }),
2413
- [t, e, l, r, s, o, a]
2442
+ [t, e, l, r, o, s, a]
2414
2443
  );
2415
- return Z("Matrix", c), null;
2444
+ return j("Matrix", c), null;
2416
2445
  }
2417
- function ii(n) {
2446
+ function oi(n) {
2418
2447
  const {
2419
2448
  accessor: t,
2420
2449
  to: e,
2421
2450
  xAxisId: i = "x",
2422
2451
  yAxisId: r = "y",
2423
- data: s,
2424
- name: o,
2452
+ data: o,
2453
+ name: s,
2425
2454
  color: a,
2426
2455
  height: l = 0.6
2427
2456
  } = n, c = E(
@@ -2431,14 +2460,14 @@ function ii(n) {
2431
2460
  to: e,
2432
2461
  xAxisId: i,
2433
2462
  yAxisId: r,
2434
- data: s,
2435
- name: o,
2463
+ data: o,
2464
+ name: s,
2436
2465
  color: a,
2437
2466
  height: l
2438
2467
  }),
2439
- [t, e, i, r, s, o, a, l]
2468
+ [t, e, i, r, o, s, a, l]
2440
2469
  );
2441
- return Z("Span", c), null;
2470
+ return j("Span", c), null;
2442
2471
  }
2443
2472
  function nt(n) {
2444
2473
  const {
@@ -2446,8 +2475,8 @@ function nt(n) {
2446
2475
  axisId: e = "y",
2447
2476
  orientation: i = "y",
2448
2477
  severity: r = "alarm",
2449
- label: s,
2450
- color: o,
2478
+ label: o,
2479
+ color: s,
2451
2480
  inExtent: a = !0,
2452
2481
  role: l = "specification"
2453
2482
  } = n, c = E(
@@ -2458,22 +2487,22 @@ function nt(n) {
2458
2487
  orientation: i,
2459
2488
  severity: r,
2460
2489
  role: l,
2461
- label: s,
2462
- color: o,
2490
+ label: o,
2491
+ color: s,
2463
2492
  inExtent: a
2464
2493
  }),
2465
- [t, e, i, r, l, s, o, a]
2494
+ [t, e, i, r, l, o, s, a]
2466
2495
  );
2467
- return de("LimitLine", c), null;
2496
+ return me("LimitLine", c), null;
2468
2497
  }
2469
- function ri(n) {
2498
+ function si(n) {
2470
2499
  const {
2471
2500
  from: t,
2472
2501
  to: e,
2473
2502
  axisId: i = "y",
2474
2503
  orientation: r = "y",
2475
- severity: s = "warning",
2476
- label: o,
2504
+ severity: o = "warning",
2505
+ label: s,
2477
2506
  color: a,
2478
2507
  inExtent: l = !0,
2479
2508
  role: c = "specification"
@@ -2484,17 +2513,17 @@ function ri(n) {
2484
2513
  to: e,
2485
2514
  axisId: i,
2486
2515
  orientation: r,
2487
- severity: s,
2516
+ severity: o,
2488
2517
  role: c,
2489
- label: o,
2518
+ label: s,
2490
2519
  color: a,
2491
2520
  inExtent: l
2492
2521
  }),
2493
- [t, e, i, r, s, c, o, a, l]
2522
+ [t, e, i, r, o, c, s, a, l]
2494
2523
  );
2495
- return de("LimitBand", u), null;
2524
+ return me("LimitBand", u), null;
2496
2525
  }
2497
- const $n = 1.128;
2526
+ const On = 1.128;
2498
2527
  function kt(n, t) {
2499
2528
  return {
2500
2529
  center: n,
@@ -2503,44 +2532,44 @@ function kt(n, t) {
2503
2532
  lower: n - 3 * t
2504
2533
  };
2505
2534
  }
2506
- function si(n, t) {
2535
+ function ai(n, t) {
2507
2536
  return (t - n) / 3;
2508
2537
  }
2509
- function Cn(n, t) {
2538
+ function Wn(n, t) {
2510
2539
  if (t.kind === "given")
2511
2540
  return kt(t.center, t.sigma);
2512
2541
  const e = Math.max(0, Math.trunc(t.from)), i = Math.min(n.length, Math.trunc(t.to));
2513
- let r = 0, s = 0, o = 0, a = 0, l = Number.NaN;
2542
+ let r = 0, o = 0, s = 0, a = 0, l = Number.NaN;
2514
2543
  for (let u = e; u < i; u++) {
2515
2544
  const h = n[u];
2516
2545
  if (!Number.isFinite(h)) {
2517
2546
  l = Number.NaN;
2518
2547
  continue;
2519
2548
  }
2520
- r += h, s++, Number.isFinite(l) && (o += Math.abs(h - l), a++), l = h;
2549
+ r += h, o++, Number.isFinite(l) && (s += Math.abs(h - l), a++), l = h;
2521
2550
  }
2522
- if (s === 0) return kt(Number.NaN, Number.NaN);
2523
- const c = a === 0 ? 0 : o / a / $n;
2524
- return kt(r / s, c);
2551
+ if (o === 0) return kt(Number.NaN, Number.NaN);
2552
+ const c = a === 0 ? 0 : s / a / On;
2553
+ return kt(r / o, c);
2525
2554
  }
2526
- function Wn(n, t = [1, 2]) {
2555
+ function Hn(n, t = [1, 2]) {
2527
2556
  return t.map((e) => ({
2528
2557
  k: e,
2529
2558
  upper: n.center + e * n.sigma,
2530
2559
  lower: n.center - e * n.sigma
2531
2560
  }));
2532
2561
  }
2533
- function On(n, t) {
2562
+ function Rn(n, t) {
2534
2563
  return Number.isFinite(n) ? n > t ? 1 : n < t ? -1 : 0 : 0;
2535
2564
  }
2536
- function fe(n, t) {
2565
+ function pe(n, t) {
2537
2566
  const e = [];
2538
2567
  if (t < 1) return e;
2539
2568
  let i = 0;
2540
2569
  for (let r = 1; r <= n.length; r++) {
2541
- const s = r < n.length ? n[r] : Number.NaN, o = n[i];
2542
- if (s !== o) {
2543
- if (o !== 0 && r - i >= t)
2570
+ const o = r < n.length ? n[r] : Number.NaN, s = n[i];
2571
+ if (o !== s) {
2572
+ if (s !== 0 && r - i >= t)
2544
2573
  for (let a = i; a < r; a++) e.push(a);
2545
2574
  i = r;
2546
2575
  }
@@ -2555,7 +2584,7 @@ const $t = {
2555
2584
  runLength: 9,
2556
2585
  trendLength: 6
2557
2586
  };
2558
- function Hn(n, t) {
2587
+ function Vn(n, t) {
2559
2588
  const e = [];
2560
2589
  for (let i = 0; i < n.length; i++) {
2561
2590
  const r = n[i];
@@ -2563,52 +2592,52 @@ function Hn(n, t) {
2563
2592
  }
2564
2593
  return e;
2565
2594
  }
2566
- function Rn(n, t, e = $t.runLength) {
2567
- return fe(
2568
- n.map((i) => On(i, t.center)),
2595
+ function _n(n, t, e = $t.runLength) {
2596
+ return pe(
2597
+ n.map((i) => Rn(i, t.center)),
2569
2598
  e
2570
2599
  );
2571
2600
  }
2572
- function Vn(n, t = $t.trendLength) {
2601
+ function Bn(n, t = $t.trendLength) {
2573
2602
  const e = [];
2574
2603
  for (let r = 1; r < n.length; r++) {
2575
- const s = n[r - 1], o = n[r];
2576
- e.push(Number.isFinite(s) && Number.isFinite(o) ? Math.sign(o - s) : 0);
2604
+ const o = n[r - 1], s = n[r];
2605
+ e.push(Number.isFinite(o) && Number.isFinite(s) ? Math.sign(s - o) : 0);
2577
2606
  }
2578
2607
  const i = [];
2579
- for (const r of fe(e, Math.max(1, t - 1)))
2608
+ for (const r of pe(e, Math.max(1, t - 1)))
2580
2609
  i[i.length - 1] !== r && i.push(r), i.push(r + 1);
2581
2610
  return i;
2582
2611
  }
2583
- function _n(n, t) {
2612
+ function Yn(n, t) {
2584
2613
  const e = t.center + 2 * t.sigma, i = t.center - 2 * t.sigma, r = /* @__PURE__ */ new Set();
2585
- for (let s = 0; s + 2 < n.length; s++)
2586
- for (const o of [
2587
- [s, s + 1, s + 2].filter((a) => n[a] > e),
2588
- [s, s + 1, s + 2].filter((a) => n[a] < i)
2614
+ for (let o = 0; o + 2 < n.length; o++)
2615
+ for (const s of [
2616
+ [o, o + 1, o + 2].filter((a) => n[a] > e),
2617
+ [o, o + 1, o + 2].filter((a) => n[a] < i)
2589
2618
  ])
2590
- if (o.length >= 2) for (const a of o) r.add(a);
2591
- return [...r].sort((s, o) => s - o);
2619
+ if (s.length >= 2) for (const a of s) r.add(a);
2620
+ return [...r].sort((o, s) => o - s);
2592
2621
  }
2593
- function Bn(n, t, e = {}) {
2594
- const i = { ...$t, ...e }, r = [], s = (o, a) => {
2595
- a.length > 0 && r.push({ rule: o, indices: a });
2622
+ function zn(n, t, e = {}) {
2623
+ const i = { ...$t, ...e }, r = [], o = (s, a) => {
2624
+ a.length > 0 && r.push({ rule: s, indices: a });
2596
2625
  };
2597
- return i.outlier && s("outlier", Hn(n, t)), i.run && s("run", Rn(n, t, i.runLength)), i.trend && s("trend", Vn(n, i.trendLength)), i.twoOfThree && s("twoOfThree", _n(n, t)), r;
2626
+ return i.outlier && o("outlier", Vn(n, t)), i.run && o("run", _n(n, t, i.runLength)), i.trend && o("trend", Bn(n, i.trendLength)), i.twoOfThree && o("twoOfThree", Yn(n, t)), r;
2598
2627
  }
2599
- function Yn(n) {
2628
+ function Gn(n) {
2600
2629
  const t = /* @__PURE__ */ new Set();
2601
2630
  for (const e of n) for (const i of e.indices) t.add(i);
2602
2631
  return [...t].sort((e, i) => e - i);
2603
2632
  }
2604
- function oi(n) {
2633
+ function li(n) {
2605
2634
  const {
2606
2635
  accessor: t,
2607
2636
  data: e,
2608
2637
  origin: i,
2609
2638
  xAxisId: r = "x",
2610
- yAxisId: s = "y",
2611
- name: o,
2639
+ yAxisId: o = "y",
2640
+ name: s,
2612
2641
  color: a,
2613
2642
  rules: l,
2614
2643
  zoneLines: c = !0,
@@ -2619,61 +2648,61 @@ function oi(n) {
2619
2648
  } = n, m = E(() => {
2620
2649
  const F = [];
2621
2650
  for (let P = 0; P < e.length; P++) {
2622
- const S = t(e[P], P);
2623
- F.push(S ?? Number.NaN);
2651
+ const N = t(e[P], P);
2652
+ F.push(N ?? Number.NaN);
2624
2653
  }
2625
2654
  return F;
2626
- }, [e, t]), y = E(() => Cn(m, i), [m, i]), f = E(
2627
- () => Bn(m, y, l ?? {}),
2655
+ }, [e, t]), y = E(() => Wn(m, i), [m, i]), f = E(
2656
+ () => zn(m, y, l ?? {}),
2628
2657
  [m, y, l]
2629
- ), b = E(() => new Set(Yn(f)), [f]);
2630
- D(() => {
2658
+ ), b = E(() => new Set(Gn(f)), [f]);
2659
+ $(() => {
2631
2660
  d == null || d(f);
2632
2661
  }, [f, d]);
2633
2662
  const k = E(
2634
2663
  () => (F, P) => b.has(P) ? t(F, P) : null,
2635
2664
  [b, t]
2636
- ), N = E(
2665
+ ), w = E(
2637
2666
  () => b.size === 0 ? e : e.slice(),
2638
2667
  [e, b]
2639
- ), w = E(
2640
- () => c ? Wn(y, [1, 2]) : [],
2668
+ ), I = E(
2669
+ () => c ? Hn(y, [1, 2]) : [],
2641
2670
  [c, y]
2642
- ), L = Number.isFinite(y.center);
2671
+ ), A = Number.isFinite(y.center);
2643
2672
  return /* @__PURE__ */ _(Nt, { children: [
2644
- /* @__PURE__ */ I(Pn, { accessor: t, data: e, xAxisId: r, yAxisId: s, name: o, color: a }),
2645
- L && /* @__PURE__ */ _(Nt, { children: [
2646
- w.map((F) => /* @__PURE__ */ I(
2673
+ /* @__PURE__ */ S(Dn, { accessor: t, data: e, xAxisId: r, yAxisId: o, name: s, color: a }),
2674
+ A && /* @__PURE__ */ _(Nt, { children: [
2675
+ I.map((F) => /* @__PURE__ */ S(
2647
2676
  nt,
2648
2677
  {
2649
2678
  value: F.upper,
2650
- axisId: s,
2679
+ axisId: o,
2651
2680
  role: "zone",
2652
2681
  inExtent: !1
2653
2682
  },
2654
2683
  `zone-${F.k}-upper`
2655
2684
  )),
2656
- w.map((F) => /* @__PURE__ */ I(
2685
+ I.map((F) => /* @__PURE__ */ S(
2657
2686
  nt,
2658
2687
  {
2659
2688
  value: F.lower,
2660
- axisId: s,
2689
+ axisId: o,
2661
2690
  role: "zone",
2662
2691
  inExtent: !1
2663
2692
  },
2664
2693
  `zone-${F.k}-lower`
2665
2694
  )),
2666
- /* @__PURE__ */ I(nt, { value: y.center, axisId: s, role: "control" }),
2667
- /* @__PURE__ */ I(nt, { value: y.upper, axisId: s, role: "control", label: u }),
2668
- /* @__PURE__ */ I(nt, { value: y.lower, axisId: s, role: "control", label: h })
2695
+ /* @__PURE__ */ S(nt, { value: y.center, axisId: o, role: "control" }),
2696
+ /* @__PURE__ */ S(nt, { value: y.upper, axisId: o, role: "control", label: u }),
2697
+ /* @__PURE__ */ S(nt, { value: y.lower, axisId: o, role: "control", label: h })
2669
2698
  ] }),
2670
- /* @__PURE__ */ I(
2671
- En,
2699
+ /* @__PURE__ */ S(
2700
+ $n,
2672
2701
  {
2673
2702
  accessor: k,
2674
- data: N,
2703
+ data: w,
2675
2704
  xAxisId: r,
2676
- yAxisId: s,
2705
+ yAxisId: o,
2677
2706
  name: p,
2678
2707
  tone: "alarm",
2679
2708
  radius: 4
@@ -2681,14 +2710,14 @@ function oi(n) {
2681
2710
  )
2682
2711
  ] });
2683
2712
  }
2684
- function ai(n) {
2713
+ function ci(n) {
2685
2714
  const {
2686
2715
  id: t = "x",
2687
2716
  position: e = "bottom",
2688
2717
  accessor: i,
2689
2718
  label: r,
2690
- tickCount: s,
2691
- tickFormat: o,
2719
+ tickCount: o,
2720
+ tickFormat: s,
2692
2721
  domain: a = "nice",
2693
2722
  grid: l,
2694
2723
  ticks: c,
@@ -2700,25 +2729,25 @@ function ai(n) {
2700
2729
  position: e,
2701
2730
  accessor: i,
2702
2731
  label: r,
2703
- tickCount: s,
2704
- tickFormat: o,
2732
+ tickCount: o,
2733
+ tickFormat: s,
2705
2734
  domain: a,
2706
2735
  grid: l,
2707
2736
  ticks: c,
2708
2737
  calendar: u
2709
2738
  }),
2710
- [t, e, i, r, s, o, a, l, c, u]
2739
+ [t, e, i, r, o, s, a, l, c, u]
2711
2740
  );
2712
- return he("XAxis", h), null;
2741
+ return fe("XAxis", h), null;
2713
2742
  }
2714
- function li(n) {
2743
+ function ui(n) {
2715
2744
  const {
2716
2745
  id: t = "y",
2717
2746
  position: e = "left",
2718
2747
  accessor: i,
2719
2748
  label: r,
2720
- tickCount: s,
2721
- tickFormat: o,
2749
+ tickCount: o,
2750
+ tickFormat: s,
2722
2751
  domain: a = "nice",
2723
2752
  grid: l,
2724
2753
  ticks: c
@@ -2729,62 +2758,62 @@ function li(n) {
2729
2758
  position: e,
2730
2759
  accessor: i,
2731
2760
  label: r,
2732
- tickCount: s,
2733
- tickFormat: o,
2761
+ tickCount: o,
2762
+ tickFormat: s,
2734
2763
  domain: a,
2735
2764
  grid: l,
2736
2765
  ticks: c
2737
2766
  }),
2738
- [t, e, i, r, s, o, a, l, c]
2767
+ [t, e, i, r, o, s, a, l, c]
2739
2768
  );
2740
- return he("YAxis", u), null;
2769
+ return fe("YAxis", u), null;
2741
2770
  }
2742
- function zn({
2771
+ function qn({
2743
2772
  scene: n,
2744
2773
  placement: t
2745
2774
  }) {
2746
- Sn("Legend", { placement: t });
2775
+ Ln("Legend", { placement: t });
2747
2776
  const e = Et(
2748
2777
  n.subscribeLayout,
2749
2778
  n.getLayoutSnapshot,
2750
2779
  n.getLayoutServerSnapshot
2751
2780
  );
2752
- return e.series.length === 0 ? null : /* @__PURE__ */ I("div", { className: `uc-legend uc-legend-${t}`, children: e.series.map((i) => /* @__PURE__ */ _(
2781
+ return e.series.length === 0 ? null : /* @__PURE__ */ S("div", { className: `uc-legend uc-legend-${t}`, children: e.series.map((i) => /* @__PURE__ */ _(
2753
2782
  "span",
2754
2783
  {
2755
2784
  className: "uc-legend-item",
2756
2785
  onPointerEnter: () => n.setHighlight(i.seriesId),
2757
2786
  onPointerLeave: () => n.setHighlight(null),
2758
2787
  children: [
2759
- /* @__PURE__ */ I("span", { className: "uc-legend-chip", style: { background: i.color } }),
2788
+ /* @__PURE__ */ S("span", { className: "uc-legend-chip", style: { background: i.color } }),
2760
2789
  i.name
2761
2790
  ]
2762
2791
  },
2763
2792
  i.id
2764
2793
  )) });
2765
2794
  }
2766
- function ci({ placement: n = "top" }) {
2767
- const t = Q("Legend");
2768
- return t === null ? null : /* @__PURE__ */ I(zn, { scene: t, placement: n });
2795
+ function hi({ placement: n = "top" }) {
2796
+ const t = tt("Legend");
2797
+ return t === null ? null : /* @__PURE__ */ S(qn, { scene: t, placement: n });
2769
2798
  }
2770
- function ui(n) {
2799
+ function di(n) {
2771
2800
  const { mode: t = "x", render: e } = n, i = E(
2772
2801
  () => ({ mode: t, render: e }),
2773
2802
  [t, e]
2774
2803
  );
2775
- return Mn("Tooltip", i), null;
2804
+ return Tn("Tooltip", i), null;
2776
2805
  }
2777
- const Gn = {
2806
+ const Kn = {
2778
2807
  cutoff: 0.8,
2779
2808
  collectRank: Number.POSITIVE_INFINITY
2780
2809
  };
2781
- function hi(n, t = {}) {
2782
- const e = { ...Gn, ...t };
2783
- ct(
2810
+ function fi(n, t = {}) {
2811
+ const e = { ...Kn, ...t };
2812
+ ut(
2784
2813
  !Number.isFinite(e.collectRank) || e.remainderName !== void 0,
2785
2814
  "pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
2786
2815
  );
2787
- const i = n.map((d, m) => ({ item: d, inputIndex: m })).sort((d, m) => m.item.value - d.item.value || d.inputIndex - m.inputIndex).map(({ item: d }) => d), r = Math.max(0, Math.min(i.length, Math.floor(e.collectRank))), s = i.slice(0, r), o = i.slice(r), a = o.length === 0 ? s : [...s, { name: e.remainderName ?? "", value: o.reduce((d, m) => d + m.value, 0) }], l = a.reduce((d, m) => d + m.value, 0), c = [];
2816
+ const i = n.map((d, m) => ({ item: d, inputIndex: m })).sort((d, m) => m.item.value - d.item.value || d.inputIndex - m.inputIndex).map(({ item: d }) => d), r = Math.max(0, Math.min(i.length, Math.floor(e.collectRank))), o = i.slice(0, r), s = i.slice(r), a = s.length === 0 ? o : [...o, { name: e.remainderName ?? "", value: s.reduce((d, m) => d + m.value, 0) }], l = a.reduce((d, m) => d + m.value, 0), c = [];
2788
2817
  let u = 0;
2789
2818
  for (let d = 0; d < a.length; d++) {
2790
2819
  const m = a[d];
@@ -2794,60 +2823,60 @@ function hi(n, t = {}) {
2794
2823
  index: d,
2795
2824
  share: l === 0 ? 0 : m.value / l,
2796
2825
  cumulative: l === 0 ? 0 : u / l,
2797
- remainder: o.length > 0 && d === a.length - 1
2826
+ remainder: s.length > 0 && d === a.length - 1
2798
2827
  });
2799
2828
  }
2800
2829
  const h = Math.abs(e.cutoff) * 1e-12, p = c.findIndex((d) => d.cumulative >= e.cutoff - h);
2801
2830
  return { entries: c, total: l, cutoffIndex: p };
2802
2831
  }
2803
2832
  export {
2804
- Qn as Area,
2805
- ti as Bar,
2806
- Jn as Chart,
2807
- oi as ControlChart,
2808
- U as DAY,
2809
- Dn as DEFAULT_GRADIENT,
2810
- J as HOUR,
2811
- ci as Legend,
2812
- ri as LimitBand,
2833
+ ei as Area,
2834
+ ni as Bar,
2835
+ ti as Chart,
2836
+ li as ControlChart,
2837
+ X as DAY,
2838
+ Cn as DEFAULT_GRADIENT,
2839
+ Q as HOUR,
2840
+ hi as Legend,
2841
+ si as LimitBand,
2813
2842
  nt as LimitLine,
2814
- Pn as Line,
2843
+ Dn as Line,
2815
2844
  _t as LinearScale,
2816
- K as MINUTE,
2817
- ni as Matrix,
2818
- q as SECOND,
2819
- En as Scatter,
2820
- ii as Span,
2821
- ei as StateBand,
2822
- ui as Tooltip,
2823
- ai as XAxis,
2824
- li as YAxis,
2825
- on as assess,
2826
- We as breaks,
2827
- z as calendarFrom,
2828
- Cn as controlLimits,
2845
+ U as MINUTE,
2846
+ ri as Matrix,
2847
+ K as SECOND,
2848
+ $n as Scatter,
2849
+ oi as Span,
2850
+ ii as StateBand,
2851
+ di as Tooltip,
2852
+ ci as XAxis,
2853
+ ui as YAxis,
2854
+ ln as assess,
2855
+ He as breaks,
2856
+ G as calendarFrom,
2857
+ Wn as controlLimits,
2829
2858
  $t as defaultRules,
2830
2859
  Rt as invalidateTheme,
2831
- Zn as mapSeries,
2832
- Pe as operatingCalendar,
2833
- Re as operatingTicks,
2834
- He as operatingTimeTicks,
2835
- hi as pareto,
2836
- Gn as paretoDefaults,
2837
- Ce as removedIntervals,
2838
- Xn as resolveColours,
2839
- Hn as ruleOutlier,
2840
- Rn as ruleRun,
2841
- Vn as ruleTrend,
2842
- _n as ruleTwoOfThree,
2843
- si as sigmaFromLimit,
2844
- Se as subscribeTheme,
2845
- Oe as timeStep,
2860
+ Jn as mapSeries,
2861
+ De as operatingCalendar,
2862
+ _e as operatingTicks,
2863
+ Ve as operatingTimeTicks,
2864
+ fi as pareto,
2865
+ Kn as paretoDefaults,
2866
+ We as removedIntervals,
2867
+ jn as resolveColours,
2868
+ Vn as ruleOutlier,
2869
+ _n as ruleRun,
2870
+ Bn as ruleTrend,
2871
+ Yn as ruleTwoOfThree,
2872
+ ai as sigmaFromLimit,
2873
+ Le as subscribeTheme,
2874
+ Re as timeStep,
2846
2875
  pt as toOperatingTime,
2847
- De as toOperatingTimeClamped,
2876
+ Ce as toOperatingTimeClamped,
2848
2877
  dt as toWallClock,
2849
- jn as verdictWeight,
2850
- Yn as violatedIndices,
2851
- Bn as violations,
2852
- Wn as zones
2878
+ Qn as verdictWeight,
2879
+ Gn as violatedIndices,
2880
+ zn as violations,
2881
+ Hn as zones
2853
2882
  };