@umriss-ui/charts 0.40.4 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/charts.js CHANGED
@@ -3,17 +3,20 @@ import "./charts.css";
3
3
  import { useContext as Di, useRef as B, useEffect as D, createContext as Fi, useMemo as P, useState as wt, useId as qt, useSyncExternalStore as ee, useLayoutEffect as Pt, useCallback as Oi, Fragment as Pi } from "react";
4
4
  import { jsxs as L, Fragment as ge, jsx as v } from "react/jsx-runtime";
5
5
  function Ci() {
6
- const e = import.meta;
7
- return typeof e.env?.DEV == "boolean" ? e.env.DEV : typeof process < "u" && process?.env ? process.env.NODE_ENV !== "production" : !1;
6
+ try {
7
+ return process.env.NODE_ENV !== "production";
8
+ } catch {
9
+ return !1;
10
+ }
8
11
  }
9
12
  const re = Ci();
10
13
  function ce(e, t) {
11
14
  if (re && !e)
12
15
  throw new Error(`@umriss-ui/charts: ${t}`);
13
16
  }
14
- const wn = /* @__PURE__ */ new Set();
17
+ const kn = /* @__PURE__ */ new Set();
15
18
  function W(e, t) {
16
- !re || wn.has(e) || (wn.add(e), console.warn(`@umriss-ui/charts: ${t}`));
19
+ !re || kn.has(e) || (kn.add(e), console.warn(`@umriss-ui/charts: ${t}`));
17
20
  }
18
21
  const H = {
19
22
  colorAxis: "rgba(23, 23, 23, 0.17)",
@@ -27,15 +30,15 @@ const H = {
27
30
  fontMono: "ui-monospace, monospace",
28
31
  series: ["#2563eb", "#db2777", "#059669", "#d97706", "#7c3aed", "#0891b2"],
29
32
  forced: !1
30
- }, ro = "(forced-colors: active)";
33
+ }, so = "(forced-colors: active)";
31
34
  function Wi() {
32
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(ro).matches;
35
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(so).matches;
33
36
  }
34
- const kn = /* @__PURE__ */ new WeakMap();
37
+ const Nn = /* @__PURE__ */ new WeakMap();
35
38
  let Ct = 0;
36
39
  const Wt = /* @__PURE__ */ new Set();
37
40
  let Lt = null;
38
- function We(e, t, n) {
41
+ function He(e, t, n) {
39
42
  const o = e.getPropertyValue(t).trim();
40
43
  return o === "" ? n : o;
41
44
  }
@@ -65,8 +68,8 @@ function Hi(e, t) {
65
68
  colorWarning: i,
66
69
  colorAlarm: i,
67
70
  colorOk: o,
68
- font: We(t, "--uc-font", H.font),
69
- fontMono: We(t, "--uc-font-mono", H.fontMono),
71
+ font: He(t, "--uc-font", H.font),
72
+ fontMono: He(t, "--uc-font-mono", H.fontMono),
70
73
  series: H.series.map(() => o),
71
74
  forced: !0
72
75
  };
@@ -78,7 +81,7 @@ function Ri(e) {
78
81
  const t = getComputedStyle(e);
79
82
  return Wi() ? Hi(e, t) : Xt(e, (n) => {
80
83
  const o = (r, s) => {
81
- const l = We(t, r, s);
84
+ const l = He(t, r, s);
82
85
  if (l === s) return s;
83
86
  const a = n(`var(${r})`);
84
87
  return a === `var(${r})` ? l : a;
@@ -93,29 +96,29 @@ function Ri(e) {
93
96
  colorWarning: o("--uc-color-warning", H.colorWarning),
94
97
  colorAlarm: o("--uc-color-alarm", H.colorAlarm),
95
98
  colorOk: o("--uc-color-ok", H.colorOk),
96
- font: We(t, "--uc-font", H.font),
97
- fontMono: We(t, "--uc-font-mono", H.fontMono),
99
+ font: He(t, "--uc-font", H.font),
100
+ fontMono: He(t, "--uc-font-mono", H.fontMono),
98
101
  series: i,
99
102
  forced: !1
100
103
  };
101
104
  });
102
105
  }
103
- function so() {
104
- Lt === null && (typeof MutationObserver > "u" || typeof document > "u" || (Lt = new MutationObserver(() => $t()), Lt.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && (window.matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change", () => $t()), window.matchMedia(ro).addEventListener?.("change", () => $t()))));
106
+ function lo() {
107
+ Lt === null && (typeof MutationObserver > "u" || typeof document > "u" || (Lt = new MutationObserver(() => $t()), Lt.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && (window.matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change", () => $t()), window.matchMedia(so).addEventListener?.("change", () => $t()))));
105
108
  }
106
109
  function Vi(e, t) {
107
- return so(), Xt(e, (n) => {
110
+ return lo(), Xt(e, (n) => {
108
111
  const o = {};
109
112
  for (const i of Object.keys(t)) o[i] = n(t[i]);
110
113
  return o;
111
114
  });
112
115
  }
113
116
  function zi(e) {
114
- so();
115
- const t = kn.get(e);
117
+ lo();
118
+ const t = Nn.get(e);
116
119
  if (t !== void 0 && t.generation === Ct) return t.theme;
117
120
  const n = Ri(e);
118
- return kn.set(e, { generation: Ct, theme: n }), n;
121
+ return Nn.set(e, { generation: Ct, theme: n }), n;
119
122
  }
120
123
  function $t() {
121
124
  Ct++;
@@ -190,7 +193,7 @@ function Ki(e, t, n) {
190
193
  function je(e, t) {
191
194
  return !Number.isFinite(e) || !Number.isFinite(t) ? [0, 1] : e === t ? [e - 1, t + 1] : [e, t];
192
195
  }
193
- function lo(e, t, n) {
196
+ function ao(e, t, n) {
194
197
  if (!Number.isFinite(e) || !Number.isFinite(t)) return [];
195
198
  if (e === t) return [lt(e)];
196
199
  const [o, i] = e < t ? [e, t] : [t, e], r = ue(i - o, n), s = Ne(r), l = r * 1e-9, a = Math.ceil((o - l) / r), c = Math.floor((i + l) / r);
@@ -220,7 +223,7 @@ function Ui(e, t, n, o) {
220
223
  }
221
224
  return null;
222
225
  }
223
- class ao {
226
+ class co {
224
227
  domain;
225
228
  range;
226
229
  /** Pre-computed line equation px = v·m + b - the draw loop uses it directly. */
@@ -238,20 +241,20 @@ class ao {
238
241
  return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
239
242
  }
240
243
  ticks(t) {
241
- return lo(this.domain[0], this.domain[1], t);
244
+ return ao(this.domain[0], this.domain[1], t);
242
245
  }
243
246
  }
244
- const Nn = /* @__PURE__ */ new Map();
245
- function co(e, t) {
247
+ const In = /* @__PURE__ */ new Map();
248
+ function uo(e, t) {
246
249
  const n = `${e}|${t}`;
247
- let o = Nn.get(n);
248
- return o === void 0 && (o = t === "value" ? new Intl.NumberFormat(e, { maximumFractionDigits: 3, useGrouping: !0 }) : new Intl.NumberFormat(e, { minimumFractionDigits: t, maximumFractionDigits: t, useGrouping: !0 }), Nn.set(n, o)), o;
250
+ let o = In.get(n);
251
+ return o === void 0 && (o = t === "value" ? new Intl.NumberFormat(e, { maximumFractionDigits: 3, useGrouping: !0 }) : new Intl.NumberFormat(e, { minimumFractionDigits: t, maximumFractionDigits: t, useGrouping: !0 }), In.set(n, o)), o;
249
252
  }
250
- function uo(e, t, n) {
251
- return co(n, Math.min(6, Ne(t))).format(e);
253
+ function fo(e, t, n) {
254
+ return uo(n, Math.min(6, Ne(t))).format(e);
252
255
  }
253
- function Ve(e, t) {
254
- return Number.isFinite(e) ? co(t, "value").format(e) : "–";
256
+ function Ie(e, t) {
257
+ return Number.isFinite(e) ? uo(t, "value").format(e) : "–";
255
258
  }
256
259
  const me = 1e3, X = 60 * me, pe = 60 * X, J = 24 * pe;
257
260
  function Gi(e) {
@@ -266,13 +269,13 @@ function Gi(e) {
266
269
  o.push(i), i += r.to - r.from;
267
270
  return { intervals: n, offsets: o, total: i };
268
271
  }
269
- const In = /* @__PURE__ */ new WeakMap();
272
+ const An = /* @__PURE__ */ new WeakMap();
270
273
  function xe(e) {
271
274
  if (!Array.isArray(e)) return e;
272
- const t = e, n = In.get(t);
275
+ const t = e, n = An.get(t);
273
276
  if (n !== void 0) return n;
274
277
  const o = Gi(t);
275
- return In.set(t, o), o;
278
+ return An.set(t, o), o;
276
279
  }
277
280
  function qi(e, t) {
278
281
  const n = e.intervals;
@@ -331,7 +334,7 @@ function Qi(e) {
331
334
  function Zi(e, t, n) {
332
335
  return Qi(e).map((o) => o.workingTime).filter((o) => o >= t && o <= n);
333
336
  }
334
- const An = [
337
+ const Tn = [
335
338
  me,
336
339
  2 * me,
337
340
  5 * me,
@@ -356,10 +359,10 @@ const An = [
356
359
  28 * J
357
360
  ];
358
361
  function Ya(e, t) {
359
- const n = An[0];
362
+ const n = Tn[0];
360
363
  if (!Number.isFinite(e) || e <= 0) return n;
361
364
  const o = e / Math.max(1, Math.floor(t));
362
- for (const i of An) if (i >= o) return i;
365
+ for (const i of Tn) if (i >= o) return i;
363
366
  return J * ue(o / J, 1);
364
367
  }
365
368
  function Ka(e) {
@@ -377,7 +380,7 @@ function Ua(e, t, n, o, i = 0) {
377
380
  }
378
381
  return s;
379
382
  }
380
- const Tn = 365 * J, Ji = [
383
+ const Mn = 365 * J, Ji = [
381
384
  ...[1, 2, 5, 10, 15, 30].map((e) => ({ unit: "minute", n: e, ms: e * X })),
382
385
  ...[1, 2, 3, 6, 12].map((e) => ({ unit: "hour", n: e, ms: e * pe })),
383
386
  ...[1, 2, 7, 14].map((e) => ({ unit: "day", n: e, ms: e * J })),
@@ -386,8 +389,8 @@ const Tn = 365 * J, Ji = [
386
389
  function er(e, t) {
387
390
  const n = e / Math.max(1, Math.floor(t));
388
391
  for (const i of Ji) if (i.ms >= n) return i;
389
- const o = Math.max(1, ue(n / Tn, 1));
390
- return { unit: "year", n: o, ms: o * Tn };
392
+ const o = Math.max(1, ue(n / Mn, 1));
393
+ return { unit: "year", n: o, ms: o * Mn };
391
394
  }
392
395
  const ut = { year: 0, month: 1, day: 2, hour: 3, minute: 4 };
393
396
  function Ht(e, t) {
@@ -405,7 +408,7 @@ function nt(e, t, n) {
405
408
  const o = e.slice();
406
409
  return o[ut[t.unit]] = o[ut[t.unit]] + n * t.n, new Date(o[0], o[1], o[2], o[3], o[4]).getTime();
407
410
  }
408
- function Mn(e, t, n) {
411
+ function Sn(e, t, n) {
409
412
  const o = [];
410
413
  if (!Number.isFinite(e) || !Number.isFinite(t)) return o;
411
414
  const i = Ht(e, n);
@@ -420,9 +423,9 @@ function tr(e, t, n) {
420
423
  const o = Ht(t, n), i = nt(o, n, 0);
421
424
  return [nt(Ht(e, n), n, 0), i < t ? nt(o, n, 1) : i];
422
425
  }
423
- const Sn = /* @__PURE__ */ new Map();
424
- function fo(e) {
425
- let t = Sn.get(e);
426
+ const Ln = /* @__PURE__ */ new Map();
427
+ function ho(e) {
428
+ let t = Ln.get(e);
426
429
  if (t === void 0) {
427
430
  const n = { hour: "2-digit", minute: "2-digit", hourCycle: "h23" };
428
431
  t = {
@@ -432,17 +435,17 @@ function fo(e) {
432
435
  dayMonthYear: new Intl.DateTimeFormat(e, { day: "numeric", month: "short", year: "numeric" }),
433
436
  monthYear: new Intl.DateTimeFormat(e, { month: "short", year: "numeric" }),
434
437
  yearOnly: new Intl.DateTimeFormat(e, { year: "numeric" })
435
- }, Sn.set(e, t);
438
+ }, Ln.set(e, t);
436
439
  }
437
440
  return t;
438
441
  }
439
442
  function Rt(e, t = !1, n = "en-GB") {
440
443
  if (!Number.isFinite(e)) return "";
441
- const o = fo(n);
444
+ const o = ho(n);
442
445
  return `${o.dayMonth.format(e)} ${(t ? o.clockSeconds : o.clock).format(e)}`;
443
446
  }
444
447
  function nr(e, t, n = "en-GB") {
445
- const o = fo(n);
448
+ const o = ho(n);
446
449
  return e.map((i, r) => {
447
450
  const s = r === 0 ? void 0 : new Date(e[r - 1]), l = new Date(i);
448
451
  switch (t.unit) {
@@ -458,20 +461,20 @@ function nr(e, t, n = "en-GB") {
458
461
  }
459
462
  });
460
463
  }
461
- const dt = 5, ft = 4, jt = 8, or = 4, ir = 8, Ie = "uc-tick-label", rr = "uc-axis-title", ho = {
464
+ const dt = 5, ft = 4, jt = 8, or = 4, ir = 8, Ae = "uc-tick-label", rr = "uc-axis-title", mo = {
462
465
  width: 0,
463
466
  height: 0,
464
467
  plot: { x: 0, y: 0, width: 0, height: 0 },
465
468
  axes: []
466
469
  };
467
- function mo(e, t, n) {
470
+ function po(e, t, n) {
468
471
  const o = Math.ceil(t), i = n.get(e);
469
472
  return i === void 0 || o > i || i - o >= ir ? (n.set(e, o), o) : i;
470
473
  }
471
474
  function kt(e) {
472
475
  return e.calendar !== void 0 && e.calendar.length > 0 ? e.calendar : void 0;
473
476
  }
474
- function po(e) {
477
+ function go(e) {
475
478
  return e[1] - e[0] >= X;
476
479
  }
477
480
  function ht(e, t) {
@@ -489,42 +492,42 @@ function mt(e, t) {
489
492
  if (r !== void 0 && r.length > 0)
490
493
  return je(Math.min(o, ...r), Math.max(i, ...r));
491
494
  if (e.time === !0) {
492
- if (!po([o, i])) return je(o, i);
495
+ if (!go([o, i])) return je(o, i);
493
496
  const s = ht([o, i], t);
494
497
  return tr(o, i, s.unit === "minute" ? s : { ...s, n: 1, ms: s.ms / s.n });
495
498
  }
496
499
  return Ki(o, i, t);
497
500
  }
498
- function go(e, t, n) {
501
+ function yo(e, t, n) {
499
502
  const o = kt(e);
500
503
  if (e.tickValues !== void 0)
501
504
  return (o !== void 0 ? e.tickValues.map((r) => ze(r, o)) : e.tickValues).filter((r) => r >= t[0] && r <= t[1]);
502
505
  if (o !== void 0) {
503
506
  const i = xe(o), r = (l) => ct(Math.min(Math.max(l, 0), i.total), i), s = [];
504
- for (const l of Mn(r(t[0]), r(t[1]), ht(t, n))) {
507
+ for (const l of Sn(r(t[0]), r(t[1]), ht(t, n))) {
505
508
  const a = ze(l, i);
506
509
  Number.isNaN(a) || a === s[s.length - 1] || a >= t[0] && a <= t[1] && s.push(a);
507
510
  }
508
511
  return s;
509
512
  }
510
- return e.time === !0 ? po(t) ? Mn(t[0], t[1], ht(t, n)) : [] : lo(t[0], t[1], n);
513
+ return e.time === !0 ? go(t) ? Sn(t[0], t[1], ht(t, n)) : [] : ao(t[0], t[1], n);
511
514
  }
512
- function yo(e, t, n, o) {
515
+ function xo(e, t, n, o) {
513
516
  const i = e.tickFormat, r = kt(e);
514
517
  if (r !== void 0)
515
518
  return i !== void 0 ? (l) => i(ct(l, r)) : (l, a) => Rt(ct(l, r), a, o);
516
519
  if (i !== void 0) return (l) => i(l);
517
520
  if (e.time === !0) return (l, a) => Rt(l, a, o);
518
521
  const s = ue(Math.abs(t[1] - t[0]), n);
519
- return (l) => uo(l, s, o);
522
+ return (l) => fo(l, s, o);
520
523
  }
521
- function xo(e, t, n, o, i, r) {
524
+ function bo(e, t, n, o, i, r) {
522
525
  const s = kt(e);
523
526
  if (e.tickFormat !== void 0 || e.time !== !0 && s === void 0) return o.map(i);
524
527
  const l = s === void 0 ? o : o.map((a) => ct(a, s));
525
528
  return nr(l, ht(t, n), r);
526
529
  }
527
- function bo(e, t, n) {
530
+ function vo(e, t, n) {
528
531
  return Math.min(Math.max(e, 0), Math.max(0, n - t));
529
532
  }
530
533
  function sr(e, t) {
@@ -560,12 +563,12 @@ function cr(e, t) {
560
563
  return i;
561
564
  }
562
565
  function ur(e) {
563
- const t = new Map(e.hysteresis), n = En(e, t, null);
566
+ const t = new Map(e.hysteresis), n = Dn(e, t, null);
564
567
  if (n.wrapped.size === 0) {
565
568
  for (const [o, i] of t) e.hysteresis.set(o, i);
566
569
  return n.layout;
567
570
  }
568
- return En(e, e.hysteresis, n.wrapped).layout;
571
+ return Dn(e, e.hysteresis, n.wrapped).layout;
569
572
  }
570
573
  function Ze(e, t) {
571
574
  let n = 0;
@@ -580,7 +583,7 @@ function dr(e, t) {
580
583
  const n = Math.ceil(t(e.label, rr).height);
581
584
  return { size: n, band: n + or };
582
585
  }
583
- function vo(e, t, n, o) {
586
+ function wo(e, t, n, o) {
584
587
  switch (e.position) {
585
588
  case "left":
586
589
  return { x: t.left - n - o, y: t.top, width: o, height: t.height };
@@ -595,22 +598,22 @@ function vo(e, t, n, o) {
595
598
  function fr(e, t, n, o, i) {
596
599
  const { width: r, axes: s, measure: l } = e, a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), d = s.filter((f) => f.position === "left"), m = s.filter((f) => f.position === "right"), h = s.find((f) => f.orientation === "y");
597
600
  for (const f of [...d, ...m].sort((u, g) => u === h ? -1 : g === h ? 1 : 0)) {
598
- const u = f.tickCount ?? Math.max(2, Math.round(n / 50)), g = h === void 0 ? void 0 : a.get(h.key), [p, y] = Array.isArray(f.domainMode) ? mt(f, u) : f.extent, x = f.alignTicks === !0 && f !== h && g !== void 0 ? Ui(p, y, g.domain, g.values) : null, b = x?.domain ?? mt(f, u), w = x?.ticks ?? go(f, b, u), A = x === null ? yo(f, b, u, t) : f.tickFormat ?? ((M) => uo(M, x.step, t)), k = xo(f, b, u, w, A, t), N = k.map((M) => l(M, Ie).width);
601
+ const u = f.tickCount ?? Math.max(2, Math.round(n / 50)), g = h === void 0 ? void 0 : a.get(h.key), [p, y] = Array.isArray(f.domainMode) ? mt(f, u) : f.extent, x = f.alignTicks === !0 && f !== h && g !== void 0 ? Ui(p, y, g.domain, g.values) : null, b = x?.domain ?? mt(f, u), w = x?.ticks ?? yo(f, b, u), A = x === null ? xo(f, b, u, t) : f.tickFormat ?? ((M) => fo(M, x.step, t)), k = bo(f, b, u, w, A, t), N = k.map((M) => l(M, Ae).width);
599
602
  let T = 0;
600
603
  for (const M of N) M > T && (T = M);
601
604
  let I = 0;
602
- for (const M of f.limitLabels ?? []) I = Math.max(I, l(M, Ie).width + 4);
605
+ for (const M of f.limitLabels ?? []) I = Math.max(I, l(M, Ae).width + 4);
603
606
  const S = o.get(f.key)?.band ?? 0, F = I > T && dt + ft + I + S > r * lr;
604
- F || (T = Math.max(T, I)), a.set(f.key, { axis: f, domain: b, values: w, labels: k, widths: N, format: A, limitsInside: F }), c.set(f.key, mo(f.key, dt + ft + T + S, i));
607
+ F || (T = Math.max(T, I)), a.set(f.key, { axis: f, domain: b, values: w, labels: k, widths: N, format: A, limitsInside: F }), c.set(f.key, po(f.key, dt + ft + T + S, i));
605
608
  }
606
609
  return { interim: a, widths: c };
607
610
  }
608
- function Ln(e, t, n, o, i, r) {
611
+ function $n(e, t, n, o, i, r) {
609
612
  let s = 0;
610
613
  e.forEach((l, a) => {
611
- const c = o.get(l.key) ?? 0, d = n.get(l.key), m = vo(l, t, s, c);
614
+ const c = o.get(l.key) ?? 0, d = n.get(l.key), m = wo(l, t, s, c);
612
615
  s += c + jt;
613
- const h = d?.domain ?? [0, 1], f = d?.format ?? ((p) => String(p)), u = new ao(h, [t.top + t.height, t.top]), g = (d?.values ?? []).map((p, y) => ({
616
+ const h = d?.domain ?? [0, 1], f = d?.format ?? ((p) => String(p)), u = new co(h, [t.top + t.height, t.top]), g = (d?.values ?? []).map((p, y) => ({
614
617
  value: p,
615
618
  label: d?.labels[y] ?? "",
616
619
  px: u.toPx(p),
@@ -638,8 +641,8 @@ function Ln(e, t, n, o, i, r) {
638
641
  });
639
642
  }
640
643
  function hr(e, t, n, o, i, r, s = !1) {
641
- const { width: l, locale: a, measure: c } = o, d = go(e, t, i), m = d.filter((p, y) => y % r === 0), h = yo(e, t, i, a), f = xo(e, t, i, m, h, a), u = s ? f.map((p) => sr(p, (y) => c(y, Ie).width)) : f, g = m.map((p, y) => {
642
- const x = u[y] ?? "", b = c(x, Ie).width, w = n.toPx(p), A = bo(w - b / 2, b, l);
644
+ const { width: l, locale: a, measure: c } = o, d = yo(e, t, i), m = d.filter((p, y) => y % r === 0), h = xo(e, t, i, a), f = bo(e, t, i, m, h, a), u = s ? f.map((p) => sr(p, (y) => c(y, Ae).width)) : f, g = m.map((p, y) => {
645
+ const x = u[y] ?? "", b = c(x, Ae).width, w = n.toPx(p), A = vo(w - b / 2, b, l);
643
646
  return { value: p, label: x, px: w, labelLeft: A, labelWidth: b };
644
647
  });
645
648
  return { format: h, ticks: g, total: d.length };
@@ -670,12 +673,12 @@ function mr(e, t, n, o, i, r) {
670
673
  for (const m of c ? [!1, !0] : [!1])
671
674
  if (a = s(l, d, m), Qe(a.ticks) || a.ticks.length <= 1) return { placed: a, wrapped: m };
672
675
  }
673
- function $n(e, t, n, o, i, r, s, l) {
676
+ function En(e, t, n, o, i, r, s, l) {
674
677
  let a = 0;
675
678
  e.forEach((c, d) => {
676
- const m = o.get(c.key) ?? 0, h = vo(c, t, a, m);
679
+ const m = o.get(c.key) ?? 0, h = wo(c, t, a, m);
677
680
  a += m + jt;
678
- const f = c.tickCount ?? Math.max(2, Math.round(t.width / 80)), u = mt(c, f), g = c.ownDomainMode, p = g === void 0 ? void 0 : mt({ ...c, domainMode: g }, f), y = new ao(u, [t.left, t.left + t.width]), x = mr(c, u, y, n, f, r);
681
+ const f = c.tickCount ?? Math.max(2, Math.round(t.width / 80)), u = mt(c, f), g = c.ownDomainMode, p = g === void 0 ? void 0 : mt({ ...c, domainMode: g }, f), y = new co(u, [t.left, t.left + t.width]), x = mr(c, u, y, n, f, r);
679
682
  x.wrapped && s.add(c.key);
680
683
  const { format: b, ticks: w } = x.placed;
681
684
  l.push({
@@ -699,11 +702,11 @@ function $n(e, t, n, o, i, r, s, l) {
699
702
  });
700
703
  });
701
704
  }
702
- function En(e, t, n) {
703
- const { width: o, height: i, padding: r, axes: s, measure: l } = e, a = e.locale ?? "en-GB", c = /* @__PURE__ */ new Set(), d = s.filter((M) => M.position === "left"), m = s.filter((M) => M.position === "right"), h = s.filter((M) => M.position === "top"), f = s.filter((M) => M.position === "bottom"), u = Math.ceil(l("0", Ie).height) || 14, g = new Map(s.map((M) => [M.key, dr(M, l)])), p = /* @__PURE__ */ new Map();
705
+ function Dn(e, t, n) {
706
+ const { width: o, height: i, padding: r, axes: s, measure: l } = e, a = e.locale ?? "en-GB", c = /* @__PURE__ */ new Set(), d = s.filter((M) => M.position === "left"), m = s.filter((M) => M.position === "right"), h = s.filter((M) => M.position === "top"), f = s.filter((M) => M.position === "bottom"), u = Math.ceil(l("0", Ae).height) || 14, g = new Map(s.map((M) => [M.key, dr(M, l)])), p = /* @__PURE__ */ new Map();
704
707
  for (const M of [...h, ...f]) {
705
708
  const Y = n?.has(M.key) === !0 ? 2 : 1, Q = g.get(M.key)?.band ?? 0;
706
- p.set(M.key, mo(M.key, dt + ft + Y * u + Q, t));
709
+ p.set(M.key, po(M.key, dt + ft + Y * u + Q, t));
707
710
  }
708
711
  const y = r.top + Ze(h, p), x = i - r.bottom - Ze(f, p), b = Math.max(0, x - y), w = fr(e, a, b, g, t), A = r.left + Ze(d, w.widths), k = o - r.right - Ze(m, w.widths), N = Math.max(0, k - A), T = { x: A, y, width: N, height: b }, I = {
709
712
  left: A,
@@ -713,27 +716,27 @@ function En(e, t, n) {
713
716
  width: N,
714
717
  height: b
715
718
  }, S = [];
716
- Ln(d, I, w.interim, w.widths, g, S), Ln(m, I, w.interim, w.widths, g, S);
719
+ $n(d, I, w.interim, w.widths, g, S), $n(m, I, w.interim, w.widths, g, S);
717
720
  const F = { width: o, locale: a, measure: l };
718
- return $n(h, I, F, p, g, n, c, S), $n(f, I, F, p, g, n, c, S), { layout: { width: o, height: i, plot: T, axes: S }, wrapped: c };
721
+ return En(h, I, F, p, g, n, c, S), En(f, I, F, p, g, n, c, S), { layout: { width: o, height: i, plot: T, axes: S }, wrapped: c };
719
722
  }
720
- const Dn = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]], pr = ["circle", "square", "triangle", "diamond", "triangleDown", "plus"], Vt = ["none", "rising", "falling", "horizontal", "vertical", "crossed"];
723
+ const Fn = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]], pr = ["circle", "square", "triangle", "diamond", "triangleDown", "plus"], Vt = ["none", "rising", "falling", "horizontal", "vertical", "crossed"];
721
724
  function gr(e) {
722
- const t = wo(e, Dn.length);
723
- return { dash: Dn[t], marker: pr[t], hatch: Vt[t] };
725
+ const t = ko(e, Fn.length);
726
+ return { dash: Fn[t], marker: pr[t], hatch: Vt[t] };
724
727
  }
725
728
  function Nt(e) {
726
- return Vt[wo(e, Vt.length)];
729
+ return Vt[ko(e, Vt.length)];
727
730
  }
728
731
  function yr(e) {
729
732
  const t = /* @__PURE__ */ new Map();
730
733
  for (const n of e) for (const { label: o } of n) t.has(o) || t.set(o, Nt(t.size));
731
734
  return t;
732
735
  }
733
- function wo(e, t) {
736
+ function ko(e, t) {
734
737
  return (e % t + t) % t;
735
738
  }
736
- function ko(e, t, n) {
739
+ function No(e, t, n) {
737
740
  const o = [];
738
741
  if (t === "none" || !(n > 0) || !(e.width > 0) || !(e.height > 0)) return o;
739
742
  const { x: i, y: r, width: s, height: l } = e, a = (c) => Math.ceil(c / n) * n;
@@ -773,7 +776,7 @@ function Qt(e, t, n, o, i) {
773
776
  }
774
777
  }
775
778
  }
776
- function Fn(e, t, n) {
779
+ function On(e, t, n) {
777
780
  if (t <= 0 || !(n >= e[0])) return -1;
778
781
  let o = 0, i = t - 1;
779
782
  if (e[i] <= n) return i;
@@ -783,7 +786,7 @@ function Fn(e, t, n) {
783
786
  }
784
787
  return o;
785
788
  }
786
- function No(e, t, n, o) {
789
+ function Io(e, t, n, o) {
787
790
  return n + 1 < t ? e[n + 1] : o;
788
791
  }
789
792
  function xr(e, t, n, o, i) {
@@ -823,9 +826,9 @@ function vr(e, t) {
823
826
  }
824
827
  }
825
828
  const wr = 6;
826
- function Le(e, t, n, o, i) {
829
+ function $e(e, t, n, o, i) {
827
830
  if (o === "none") return;
828
- const r = ko(n, o, wr), s = new Path2D();
831
+ const r = No(n, o, wr), s = new Path2D();
829
832
  for (let l = 0; l < r.length; l += 4)
830
833
  s.moveTo(r[l], r[l + 1]), s.lineTo(r[l + 2], r[l + 3]);
831
834
  e.save(), e.clip(t), e.strokeStyle = i, e.lineWidth = 1, e.setLineDash([]), e.stroke(s), e.restore();
@@ -834,7 +837,7 @@ const kr = 60;
834
837
  function Nr(e, t, n) {
835
838
  return (n === 0 || Number.isNaN(e[n - 1])) && (n === t - 1 || Number.isNaN(e[n + 1]));
836
839
  }
837
- function Io(e, t, n) {
840
+ function Ao(e, t, n) {
838
841
  return t >= e.x - 0.5 && t <= e.x + e.width + 0.5 && n >= e.y - 0.5 && n <= e.y + e.height + 0.5;
839
842
  }
840
843
  function Ir(e, t, n, o) {
@@ -855,7 +858,7 @@ function Ir(e, t, n, o) {
855
858
  const w = d[b];
856
859
  if (Number.isNaN(w) || !g && !Nr(d, i, b)) continue;
857
860
  const A = c[b] * r + s, k = w * l + a;
858
- Io(n, A, k) && Qt(x, y, A, k, p);
861
+ Ao(n, A, k) && Qt(x, y, A, k, p);
859
862
  }
860
863
  o.push({ path: x, color: t.color, alpha: t.alpha });
861
864
  }
@@ -887,7 +890,7 @@ function Ar(e, t, n, o) {
887
890
  f.lineTo(c[b] * r + s, m[b] * l + a);
888
891
  f.closePath();
889
892
  }
890
- e.globalAlpha = t.alpha * t.fillOpacity, e.fillStyle = t.color, e.fill(f), e.globalAlpha = t.alpha, Le(e, f, n, t.hatch ?? "none", t.color), t.edges === !0 && (e.setLineDash([]), e.strokeStyle = o, e.lineWidth = t.strokeWidth + 2, e.stroke(u)), e.strokeStyle = t.color, t.strokeWidth > 0 && (e.setLineDash(t.dash ?? []), e.lineWidth = t.strokeWidth, e.stroke(u)), e.setLineDash([]), e.lineWidth = Math.max(1, t.strokeWidth), e.stroke(g);
893
+ e.globalAlpha = t.alpha * t.fillOpacity, e.fillStyle = t.color, e.fill(f), e.globalAlpha = t.alpha, $e(e, f, n, t.hatch ?? "none", t.color), t.edges === !0 && (e.setLineDash([]), e.strokeStyle = o, e.lineWidth = t.strokeWidth + 2, e.stroke(u)), e.strokeStyle = t.color, t.strokeWidth > 0 && (e.setLineDash(t.dash ?? []), e.lineWidth = t.strokeWidth, e.stroke(u)), e.setLineDash([]), e.lineWidth = Math.max(1, t.strokeWidth), e.stroke(g);
891
894
  }
892
895
  function Tr(e, t, n, o) {
893
896
  const i = t.length, r = t.xScale.m, s = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, d = t.y, m = t.y0, h = t.baseline * l + a, f = t.offset * r, u = t.width * r, g = new Path2D(), p = t.edges === !0 && m !== null ? new Path2D() : null;
@@ -897,33 +900,33 @@ function Tr(e, t, n, o) {
897
900
  const b = c[y] * r + s + f, w = x * l + a, A = m === null ? h : m[y] * l + a;
898
901
  g.rect(b, w, u, A - w), p !== null && m?.[y] !== 0 && (p.moveTo(b, A), p.lineTo(b + u, A));
899
902
  }
900
- e.fillStyle = t.color, e.fill(g), Le(e, g, n, t.hatch ?? "none", o), p !== null && (e.strokeStyle = o, e.lineWidth = 1, e.setLineDash([]), e.stroke(p));
903
+ e.fillStyle = t.color, e.fill(g), $e(e, g, n, t.hatch ?? "none", o), p !== null && (e.strokeStyle = o, e.lineWidth = 1, e.setLineDash([]), e.stroke(p));
901
904
  }
902
- const Mr = 0.18, Sr = 2, On = 3, ae = 3.5, Lr = 1.5, $r = 0.2, Er = 3, Pn = 3;
905
+ const Mr = 0.18, Sr = 2, Pn = 3, ae = 3.5, Lr = 1.5, $r = 0.2, Er = 3, Cn = 3;
903
906
  function Dr(e, t, n) {
904
- const o = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile: d, upperQuartile: m, lowerWhisker: h, upperWhisker: f, outliers: u, outlierOffsets: g, mean: p, notchLower: y, notchUpper: x } = t.box, b = t.offset * i, w = t.width * i, A = w > 4 * Pn ? Pn / 2 : 0, k = (t.offset + t.width / 2) * i, N = new Path2D(), T = new Path2D(), I = new Path2D(), S = new Path2D(), F = new Path2D(), M = new Path2D();
907
+ const o = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile: d, upperQuartile: m, lowerWhisker: h, upperWhisker: f, outliers: u, outlierOffsets: g, mean: p, notchLower: y, notchUpper: x } = t.box, b = t.offset * i, w = t.width * i, A = w > 4 * Cn ? Cn / 2 : 0, k = (t.offset + t.width / 2) * i, N = new Path2D(), T = new Path2D(), I = new Path2D(), S = new Path2D(), F = new Path2D(), M = new Path2D();
905
908
  for (let E = 0; E < o; E++) {
906
909
  const V = c[E];
907
910
  if (Number.isNaN(V)) continue;
908
- const C = a[E] * i + r + b, K = Z(C + A), _ = Math.round(C + w - A) - 0.5, $e = _ - K, q = Z(a[E] * i + r + k), Ee = $e / 4, $ = $e * $r, U = Z(d[E] * s + l), oe = Z(m[E] * s + l), fe = Math.round(V * s + l), ve = y === null ? Number.NaN : y[E] * s + l, we = x === null ? Number.NaN : x[E] * s + l, De = !Number.isNaN(ve) && !Number.isNaN(we);
909
- !Number.isNaN(U) && !Number.isNaN(oe) && (De ? (N.moveTo(K, oe), N.lineTo(K, we), N.lineTo(K + $, fe), N.lineTo(K, ve), N.lineTo(K, U), N.lineTo(_, U), N.lineTo(_, ve), N.lineTo(_ - $, fe), N.lineTo(_, we), N.lineTo(_, oe), N.closePath()) : N.rect(K, oe, $e, U - oe));
910
- const Fe = De ? $ : 0;
911
- T.moveTo(K + Fe, fe), T.lineTo(_ - Fe, fe);
911
+ const C = a[E] * i + r + b, K = Z(C + A), _ = Math.round(C + w - A) - 0.5, Ee = _ - K, q = Z(a[E] * i + r + k), De = Ee / 4, $ = Ee * $r, U = Z(d[E] * s + l), oe = Z(m[E] * s + l), fe = Math.round(V * s + l), ve = y === null ? Number.NaN : y[E] * s + l, we = x === null ? Number.NaN : x[E] * s + l, Fe = !Number.isNaN(ve) && !Number.isNaN(we);
912
+ !Number.isNaN(U) && !Number.isNaN(oe) && (Fe ? (N.moveTo(K, oe), N.lineTo(K, we), N.lineTo(K + $, fe), N.lineTo(K, ve), N.lineTo(K, U), N.lineTo(_, U), N.lineTo(_, ve), N.lineTo(_ - $, fe), N.lineTo(_, we), N.lineTo(_, oe), N.closePath()) : N.rect(K, oe, Ee, U - oe));
913
+ const Oe = Fe ? $ : 0;
914
+ T.moveTo(K + Oe, fe), T.lineTo(_ - Oe, fe);
912
915
  const se = p === null ? Number.NaN : p[E] * s + l;
913
916
  Number.isNaN(se) || (F.moveTo(q - ae, se - ae), F.lineTo(q + ae, se + ae), F.moveTo(q - ae, se + ae), F.lineTo(q + ae, se - ae));
914
917
  const le = Z(h[E] * s + l), ke = Z(f[E] * s + l);
915
918
  for (const [ie, he] of [[oe, ke], [U, le]])
916
- Number.isNaN(ie) || Number.isNaN(he) || (I.moveTo(q, ie), I.lineTo(q, he), I.moveTo(q - Ee, he), I.lineTo(q + Ee, he));
919
+ Number.isNaN(ie) || Number.isNaN(he) || (I.moveTo(q, ie), I.lineTo(q, he), I.moveTo(q - De, he), I.lineTo(q + De, he));
917
920
  if (u !== null && g !== null) {
918
- const ie = d[E], he = m[E], xn = Er * (he - ie);
921
+ const ie = d[E], he = m[E], bn = Er * (he - ie);
919
922
  for (let Mt = g[E]; Mt < g[E + 1]; Mt++) {
920
- const St = u[Mt], bn = St > he + xn || St < ie - xn ? M : S, vn = St * s + l;
921
- bn.moveTo(q + On, vn), bn.arc(q, vn, On, 0, Math.PI * 2);
923
+ const St = u[Mt], vn = St > he + bn || St < ie - bn ? M : S, wn = St * s + l;
924
+ vn.moveTo(q + Pn, wn), vn.arc(q, wn, Pn, 0, Math.PI * 2);
922
925
  }
923
926
  }
924
927
  }
925
928
  const Y = e.globalAlpha, Q = e.lineCap;
926
- e.globalAlpha = Y * Mr, e.fillStyle = t.color, e.fill(N), e.globalAlpha = Y, Le(e, N, n, t.hatch ?? "none", t.color), e.strokeStyle = t.color, e.setLineDash([]), e.lineCap = "butt", e.lineWidth = 1, e.stroke(N), e.stroke(I), e.stroke(M), e.lineWidth = Lr, e.stroke(F), e.lineWidth = 1, e.fillStyle = t.color, e.fill(S), e.lineWidth = Sr, e.stroke(T), e.lineCap = Q;
929
+ e.globalAlpha = Y * Mr, e.fillStyle = t.color, e.fill(N), e.globalAlpha = Y, $e(e, N, n, t.hatch ?? "none", t.color), e.strokeStyle = t.color, e.setLineDash([]), e.lineCap = "butt", e.lineWidth = 1, e.stroke(N), e.stroke(I), e.stroke(M), e.lineWidth = Lr, e.stroke(F), e.lineWidth = 1, e.fillStyle = t.color, e.fill(S), e.lineWidth = Sr, e.stroke(T), e.lineCap = Q;
927
930
  }
928
931
  function Fr(e, t, n) {
929
932
  const o = e.length, i = e.xScale.m, r = e.xScale.b, s = e.yScale.m, l = e.yScale.b, a = e.x, c = e.y, d = e.radius, m = e.marker ?? "circle", h = new Path2D();
@@ -931,7 +934,7 @@ function Fr(e, t, n) {
931
934
  const u = c[f];
932
935
  if (Number.isNaN(u)) continue;
933
936
  const g = a[f] * i + r, p = u * s + l;
934
- Io(t, g, p) && Qt(h, m, g, p, d);
937
+ Ao(t, g, p) && Qt(h, m, g, p, d);
935
938
  }
936
939
  n.push({ path: h, color: e.color, alpha: e.alpha });
937
940
  }
@@ -946,12 +949,12 @@ function Or(e, t, n, o) {
946
949
  if (Number.isNaN(g)) continue;
947
950
  const p = g | 0, y = h[p];
948
951
  if (y === void 0) continue;
949
- const x = l[u], b = No(l, i, u, t.lastEnd);
952
+ const x = l[u], b = Io(l, i, u, t.lastEnd);
950
953
  b > x && (y.rect(x * r + s, c, (b - x) * r, d), f = !0);
951
954
  }
952
955
  if (f)
953
956
  for (let u = 0; u < m; u++)
954
- e.fillStyle = t.colors[u], e.fill(h[u]), Le(e, h[u], n, t.hatches?.[u] ?? "none", o);
957
+ e.fillStyle = t.colors[u], e.fill(h[u]), $e(e, h[u], n, t.hatches?.[u] ?? "none", o);
955
958
  }
956
959
  function Pr(e, t, n, o) {
957
960
  const i = t.length, r = t.xScale.m, s = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, d = t.y, m = t.buckets, h = t.colors.length;
@@ -969,9 +972,9 @@ function Pr(e, t, n, o) {
969
972
  w + u < n.y || w > n.y + n.height || x.rect(b, w, f, u);
970
973
  }
971
974
  for (let p = 0; p < h; p++)
972
- e.fillStyle = t.colors[p], e.fill(g[p]), Le(e, g[p], n, t.hatches?.[p] ?? "none", o);
975
+ e.fillStyle = t.colors[p], e.fill(g[p]), $e(e, g[p], n, t.hatches?.[p] ?? "none", o);
973
976
  }
974
- function Cn(e, t, n) {
977
+ function Wn(e, t, n) {
975
978
  for (const o of n) {
976
979
  if (o.band) {
977
980
  const i = Math.min(o.fromPx, o.toPx), r = Math.max(o.fromPx, o.toPx);
@@ -980,7 +983,7 @@ function Cn(e, t, n) {
980
983
  continue;
981
984
  }
982
985
  const s = new Path2D();
983
- o.orientation === "y" ? s.rect(t.x, i, t.width, r - i) : s.rect(i, t.y, r - i, t.height), e.fill(s), e.globalAlpha = 0.5, Le(e, s, t, "rising", o.color), e.restore();
986
+ o.orientation === "y" ? s.rect(t.x, i, t.width, r - i) : s.rect(i, t.y, r - i, t.height), e.fill(s), e.globalAlpha = 0.5, $e(e, s, t, "rising", o.color), e.restore();
984
987
  continue;
985
988
  }
986
989
  if (e.beginPath(), o.orientation === "y") {
@@ -998,7 +1001,7 @@ function Cr(e, t) {
998
1001
  if (e.clearRect(0, 0, n, o), i.width <= 0 || i.height <= 0) return;
999
1002
  vr(e, t), e.save(), e.beginPath(), e.rect(i.x, i.y, i.width, i.height), e.clip(), e.lineJoin = "round", e.lineCap = "round";
1000
1003
  const s = [];
1001
- e.globalAlpha = 1, Cn(e, i, t.limitBands);
1004
+ e.globalAlpha = 1, Wn(e, i, t.limitBands);
1002
1005
  for (const l of r)
1003
1006
  if (l.length !== 0)
1004
1007
  switch (e.globalAlpha = l.alpha, l.kind) {
@@ -1024,7 +1027,7 @@ function Cr(e, t) {
1024
1027
  Pr(e, l, i, t.theme.colorBg);
1025
1028
  break;
1026
1029
  }
1027
- e.globalAlpha = 1, Cn(e, i, t.limitLines), e.restore();
1030
+ e.globalAlpha = 1, Wn(e, i, t.limitLines), e.restore();
1028
1031
  for (const l of s)
1029
1032
  e.globalAlpha = l.alpha, e.fillStyle = l.color, e.fill(l.path);
1030
1033
  e.globalAlpha = 1;
@@ -1039,7 +1042,7 @@ function Wr(e, t) {
1039
1042
  for (const c of s?.marker ?? [])
1040
1043
  c.x < i.x || c.x > i.x + i.width || c.y < i.y || c.y > i.y + i.height || (e.beginPath(), e.arc(c.x, c.y, 5.5, 0, Math.PI * 2), e.fillStyle = r.colorBg, e.fill(), e.beginPath(), e.arc(c.x, c.y, 3.5, 0, Math.PI * 2), e.fillStyle = c.color, e.fill());
1041
1044
  }
1042
- const Ao = {
1045
+ const To = {
1043
1046
  locale: "en-GB",
1044
1047
  roleDescription: "chart",
1045
1048
  empty: "No data",
@@ -1180,11 +1183,11 @@ function Jt(e, t, n, o) {
1180
1183
  }
1181
1184
  return rt(l, o) ? l : t;
1182
1185
  }
1183
- function To(e, t, n) {
1186
+ function Mo(e, t, n) {
1184
1187
  const o = Math.min(Math.max(t, n[0]), n[1]), i = ot(e, o, !1), r = it(e, o, !1), s = [i, r].filter((l) => rt(l, n));
1185
1188
  return s.length === 0 ? null : s.reduce((l, a) => Math.abs(a - t) < Math.abs(l - t) ? a : l);
1186
1189
  }
1187
- function Mo(e, t, n) {
1190
+ function So(e, t, n) {
1188
1191
  let o = null;
1189
1192
  for (let i = 0; i < e.length; i++) {
1190
1193
  if (!Ye(e, i)) continue;
@@ -1222,7 +1225,7 @@ function zr(e, t) {
1222
1225
  if (e.x[n] === t.x && e.y[n] === t.y && Ye(e, n)) return !0;
1223
1226
  return !1;
1224
1227
  }
1225
- const Ae = (e) => JSON.stringify([
1228
+ const Te = (e) => JSON.stringify([
1226
1229
  Object.entries(e.domains ?? {}).sort(([t], [n]) => t < n ? -1 : t > n ? 1 : 0),
1227
1230
  [...e.hidden ?? []].sort()
1228
1231
  ]);
@@ -1236,7 +1239,7 @@ function _r(e, t, n = null) {
1236
1239
  function Br(e, t) {
1237
1240
  return t.every((o) => e.includes(o)) ? e.filter((o) => !t.includes(o)) : [.../* @__PURE__ */ new Set([...e, ...t])];
1238
1241
  }
1239
- function So(e, t) {
1242
+ function Lo(e, t) {
1240
1243
  return [...new Set(t.filter((n) => n !== void 0 && !e.includes(n)))];
1241
1244
  }
1242
1245
  function Yr(e, t, n) {
@@ -1257,7 +1260,7 @@ function qr(e, t) {
1257
1260
  const n = 1e-9 * Math.max(Math.abs(t[1] - t[0]), Number.MIN_VALUE);
1258
1261
  return Math.abs(e[0] - t[0]) <= n && Math.abs(e[1] - t[1]) <= n;
1259
1262
  }
1260
- function Lo(e, t) {
1263
+ function $o(e, t) {
1261
1264
  let n = Number.POSITIVE_INFINITY;
1262
1265
  for (let o = 1; o < t; o++) {
1263
1266
  const i = e[o] - e[o - 1];
@@ -1299,7 +1302,7 @@ function Qr(e) {
1299
1302
  }
1300
1303
  return n;
1301
1304
  }
1302
- function Oe(e) {
1305
+ function Pe(e) {
1303
1306
  return e == null || !Number.isFinite(e) ? Number.NaN : e;
1304
1307
  }
1305
1308
  function Zr(e, t, n, o, i) {
@@ -1322,17 +1325,17 @@ function Zr(e, t, n, o, i) {
1322
1325
  l[T] = Y;
1323
1326
  const Q = M || b !== null && b(F);
1324
1327
  Q || (Y < w && (w = Y), Y > A && (A = Y));
1325
- const E = Q ? Number.NaN : Oe(n(S, I));
1326
- if (a[T] = E, E < k && (k = E), E > N && (N = E), m !== null && (h[T] = Q ? Number.NaN : Oe(m(S, I))), f !== null) {
1327
- for (const V of Te) {
1328
- const C = Number.isNaN(E) ? Number.NaN : Oe(f[V](S, I));
1328
+ const E = Q ? Number.NaN : Pe(n(S, I));
1329
+ if (a[T] = E, E < k && (k = E), E > N && (N = E), m !== null && (h[T] = Q ? Number.NaN : Pe(m(S, I))), f !== null) {
1330
+ for (const V of Me) {
1331
+ const C = Number.isNaN(E) ? Number.NaN : Pe(f[V](S, I));
1329
1332
  u[V][T] = C, C < k && (k = C), C > N && (N = C);
1330
1333
  }
1331
1334
  for (const V of tn) {
1332
1335
  const C = f[V], K = u[V];
1333
1336
  if (C === void 0 || K === null) continue;
1334
- const _ = Number.isNaN(E) ? Number.NaN : Oe(C(S, I));
1335
- K[T] = _, Eo.includes(V) && (_ < k && (k = _), _ > N && (N = _));
1337
+ const _ = Number.isNaN(E) ? Number.NaN : Pe(C(S, I));
1338
+ K[T] = _, Do.includes(V) && (_ < k && (k = _), _ > N && (N = _));
1336
1339
  }
1337
1340
  if (g !== null) {
1338
1341
  const V = Number.isNaN(E) ? null : g(S, I);
@@ -1342,19 +1345,19 @@ function Zr(e, t, n, o, i) {
1342
1345
  }
1343
1346
  }
1344
1347
  if (c !== null) {
1345
- const V = Q ? Number.NaN : Oe(c(S, I));
1348
+ const V = Q ? Number.NaN : Pe(c(S, I));
1346
1349
  d[T] = V, V < k && (k = V), V > N && (N = V);
1347
1350
  }
1348
1351
  }
1349
1352
  return u !== null && g !== null && (u.outliers = Float64Array.from(y)), { series: { x: l, y: a, y0: d, w: h, box: u, length: s }, extent: { xMin: w, xMax: A, yMin: k, yMax: N } };
1350
1353
  }
1351
- const pt = (e) => typeof e == "number" && Number.isFinite(e), He = (e) => typeof e == "string" && e !== "";
1352
- function $o(e, t) {
1354
+ const pt = (e) => typeof e == "number" && Number.isFinite(e), Re = (e) => typeof e == "string" && e !== "";
1355
+ function Eo(e, t) {
1353
1356
  const n = [], o = /* @__PURE__ */ new Set();
1354
1357
  for (const i of e)
1355
1358
  for (let r = 0; r < i.length; r++) {
1356
1359
  const s = t(i[r], r);
1357
- if (He(s))
1360
+ if (Re(s))
1358
1361
  o.has(s) || (o.add(s), n.push(s));
1359
1362
  else if (n.length === 0 && (pt(s) || s instanceof Date))
1360
1363
  return null;
@@ -1366,7 +1369,7 @@ function en(e, t) {
1366
1369
  for (let o = 0; o < n.length; o++) {
1367
1370
  const i = t(n[o], o);
1368
1371
  if (pt(i)) return "number";
1369
- if (He(i)) return "string";
1372
+ if (Re(i)) return "string";
1370
1373
  if (i instanceof Date) return "date";
1371
1374
  }
1372
1375
  return null;
@@ -1383,7 +1386,7 @@ function es(e, t, n) {
1383
1386
  }
1384
1387
  return s && r.length === o ? { x: i, rows: null } : (s || r.sort((l, a) => i[l] - i[a] || l - a), { x: i, rows: Uint32Array.from(r) });
1385
1388
  }
1386
- const Te = ["upperWhisker", "upperQuartile", "lowerQuartile", "lowerWhisker"], tn = ["mean", "notchUpper", "notchLower", "count"], Eo = ["mean", "notchUpper", "notchLower"];
1389
+ const Me = ["upperWhisker", "upperQuartile", "lowerQuartile", "lowerWhisker"], tn = ["mean", "notchUpper", "notchLower", "count"], Do = ["mean", "notchUpper", "notchLower"];
1387
1390
  function ts(e) {
1388
1391
  const t = e.box;
1389
1392
  if (t === null) return -1;
@@ -1395,12 +1398,12 @@ function ts(e) {
1395
1398
  }
1396
1399
  return -1;
1397
1400
  }
1398
- function Do(e, t) {
1401
+ function Fo(e, t) {
1399
1402
  for (let n = 1; n < t; n++)
1400
1403
  if (e[n] < e[n - 1]) return n;
1401
1404
  return -1;
1402
1405
  }
1403
- function Fo(e, t, n) {
1406
+ function Oo(e, t, n) {
1404
1407
  const { x: o, y: i, y0: r, box: s, length: l } = e;
1405
1408
  let a = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY;
1406
1409
  for (let d = j(o, l, t); d < l && o[d] <= n; d++) {
@@ -1410,11 +1413,11 @@ function Fo(e, t, n) {
1410
1413
  h < a && (a = h), h > c && (c = h);
1411
1414
  }
1412
1415
  if (s !== null) {
1413
- for (const u of Te) {
1416
+ for (const u of Me) {
1414
1417
  const g = s[u][d];
1415
1418
  g < a && (a = g), g > c && (c = g);
1416
1419
  }
1417
- for (const u of Eo) {
1420
+ for (const u of Do) {
1418
1421
  const g = s[u];
1419
1422
  if (g === null) continue;
1420
1423
  const p = g[d];
@@ -1430,7 +1433,7 @@ function Fo(e, t, n) {
1430
1433
  }
1431
1434
  return [a, c];
1432
1435
  }
1433
- function Wn(e, t, n, o) {
1436
+ function Hn(e, t, n, o) {
1434
1437
  let i = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
1435
1438
  for (const s of n) {
1436
1439
  const l = s.extent;
@@ -1443,9 +1446,9 @@ function Wn(e, t, n, o) {
1443
1446
  Number.isFinite(s) && (s < i && (i = s), s > r && (r = s));
1444
1447
  return !Number.isFinite(i) || !Number.isFinite(r) ? [0, 1] : [i, r];
1445
1448
  }
1446
- const Hn = {
1449
+ const Rn = {
1447
1450
  version: 0,
1448
- layout: ho,
1451
+ layout: mo,
1449
1452
  legend: null,
1450
1453
  series: [],
1451
1454
  limits: [],
@@ -1454,7 +1457,7 @@ const Hn = {
1454
1457
  loading: !1,
1455
1458
  silhouette: null,
1456
1459
  dataTable: null
1457
- }, Rn = {
1460
+ }, Vn = {
1458
1461
  version: 0,
1459
1462
  hover: null,
1460
1463
  tooltip: null,
@@ -1462,13 +1465,13 @@ const Hn = {
1462
1465
  rows: [],
1463
1466
  totals: [],
1464
1467
  limits: []
1465
- }, Vn = /* @__PURE__ */ new Map(), Oo = /* @__PURE__ */ new WeakSet();
1468
+ }, zn = /* @__PURE__ */ new Map(), Po = /* @__PURE__ */ new WeakSet();
1466
1469
  function R(e) {
1467
1470
  if (typeof e != "string") return e;
1468
- let t = Vn.get(e);
1469
- return t === void 0 && (t = (n) => n[e], Vn.set(e, t), Oo.add(t)), t;
1471
+ let t = zn.get(e);
1472
+ return t === void 0 && (t = (n) => n[e], zn.set(e, t), Po.add(t)), t;
1470
1473
  }
1471
- const zn = (e) => typeof e == "function" && Oo.has(e);
1474
+ const _n = (e) => typeof e == "function" && Po.has(e);
1472
1475
  function ns(e, t) {
1473
1476
  const n = e.length - 1, o = (i) => t ? n - i : i;
1474
1477
  return {
@@ -1478,7 +1481,7 @@ function ns(e, t) {
1478
1481
  format: (i) => e[o(Math.min(Math.max(Math.round(i), 0), n))] ?? ""
1479
1482
  };
1480
1483
  }
1481
- const _n = 0.8, zt = (e) => e.kind === "state" ? e.lane : void 0;
1484
+ const Bn = 0.8, zt = (e) => e.kind === "state" ? e.lane : void 0;
1482
1485
  function os(e, t) {
1483
1486
  return t === void 0 ? e.format : (n) => e.names.length === 0 ? "" : t(e.format(n));
1484
1487
  }
@@ -1487,15 +1490,15 @@ function Ke(e) {
1487
1490
  }
1488
1491
  function te(e, t) {
1489
1492
  if (e === t) return !0;
1490
- if (typeof e != "function" || typeof t != "function" || zn(e) || zn(t)) return !1;
1493
+ if (typeof e != "function" || typeof t != "function" || _n(e) || _n(t)) return !1;
1491
1494
  const n = String(e);
1492
1495
  return n.includes("[native code]") ? !1 : n === String(t);
1493
1496
  }
1494
- function Po(e, t) {
1497
+ function Co(e, t) {
1495
1498
  return e.length === t.length && e.every((n, o) => n === t[o]);
1496
1499
  }
1497
- function Bn(e, t) {
1498
- return e === t ? !0 : e !== void 0 && t !== void 0 && Po(e, t);
1500
+ function Yn(e, t) {
1501
+ return e === t ? !0 : e !== void 0 && t !== void 0 && Co(e, t);
1499
1502
  }
1500
1503
  function is(e, t) {
1501
1504
  if (e === t) return !0;
@@ -1532,11 +1535,11 @@ function _t(e) {
1532
1535
  };
1533
1536
  }
1534
1537
  function ss(e, t) {
1535
- return e === void 0 || t === void 0 ? e === t : [...Te, ...tn, "outliers"].every((n) => te(e[n], t[n]));
1538
+ return e === void 0 || t === void 0 ? e === t : [...Me, ...tn, "outliers"].every((n) => te(e[n], t[n]));
1536
1539
  }
1537
- function Co(e, t) {
1540
+ function Wo(e, t) {
1538
1541
  const n = {};
1539
- for (const r of Te) n[r] = e[r][t];
1542
+ for (const r of Me) n[r] = e[r][t];
1540
1543
  for (const r of tn) {
1541
1544
  const s = e[r];
1542
1545
  s !== null && (n[r] = s[t]);
@@ -1612,7 +1615,7 @@ function cs(e, t) {
1612
1615
  function us(e, t) {
1613
1616
  return e === t ? !0 : Array.isArray(e) && Array.isArray(t) ? e[0] === t[0] && e[1] === t[1] : !1;
1614
1617
  }
1615
- function Wo(e, t, n, o, i, r) {
1618
+ function Ho(e, t, n, o, i, r) {
1616
1619
  const { x: s, y: l, y0: a, length: c } = e, d = Math.max(0, j(s, c, t) - 1), m = Math.min(c - 1, j(s, c, n));
1617
1620
  if (m < d) return { x: s.subarray(0, 0), y: l.subarray(0, 0), y0: null, length: 0 };
1618
1621
  if (m - d + 1 <= 2 * r)
@@ -1658,7 +1661,7 @@ function hs(e) {
1658
1661
  t !== null && e.activeBy === "keyboard" && (t.textContent = ms(e));
1659
1662
  }, ds));
1660
1663
  }
1661
- function Ho(e, t) {
1664
+ function Ro(e, t) {
1662
1665
  e.readoutTimer !== null && clearTimeout(e.readoutTimer), e.readoutTimer = null, e.readoutEl !== null && (e.readoutEl.textContent = t);
1663
1666
  }
1664
1667
  function ms(e) {
@@ -1672,7 +1675,7 @@ function ms(e) {
1672
1675
  const i = e.hoverTotals.map((s) => ({ name: s.name, value: s.value, x: "" })), r = e.hoverLimits.map((s) => ({ name: s.name, value: s.value, x: "" }));
1673
1676
  return e.wording.readout(e.hoverXLabel, [...n, ...i, ...r]);
1674
1677
  }
1675
- function Ro(e, t) {
1678
+ function Vo(e, t) {
1676
1679
  const n = [];
1677
1680
  for (const { config: o } of e.limitsInOrder()) {
1678
1681
  if (o.label === void 0 || o.label === "") continue;
@@ -1680,8 +1683,8 @@ function Ro(e, t) {
1680
1683
  if (t !== void 0 && (o.orientation !== "y" || i !== t)) continue;
1681
1684
  const r = e.findAxis(o.orientation, i);
1682
1685
  if (r === null) continue;
1683
- const s = (l) => r.format(e.limitAt(o, l));
1684
- n.push({ name: o.label, value: o.kind === "line" ? s(o.value) : `${s(o.from)} – ${s(o.to)}` });
1686
+ const s = o.orientation === "y" ? nn(e, i) ?? ((a) => Ie(a, e.wording.locale)) : r.format, l = (a) => s(e.limitAt(o, a));
1687
+ n.push({ name: o.label, value: o.kind === "line" ? l(o.value) : `${l(o.from)} – ${l(o.to)}` });
1685
1688
  }
1686
1689
  return n;
1687
1690
  }
@@ -1689,20 +1692,20 @@ function ps(e, t) {
1689
1692
  const n = [];
1690
1693
  return t.forEach((o, i) => {
1691
1694
  const r = G(o.entry.config), s = o.entry.stacked;
1692
- r === void 0 || s === null || t.some((l, a) => a > i && G(l.entry.config) === r) || n.push({ after: i, name: e.wording.stackTotal, value: Vo(e, o.entry, s.total[o.index]) });
1695
+ r === void 0 || s === null || t.some((l, a) => a > i && G(l.entry.config) === r) || n.push({ after: i, name: e.wording.stackTotal, value: zo(e, o.entry, s.total[o.index]) });
1693
1696
  }), n;
1694
1697
  }
1695
- function Vo(e, t, n) {
1696
- return t.stacked.normalize ? (t.config.format ?? ((o) => Ve(o, e.wording.locale)))(n) : ne(e, t, n);
1698
+ function zo(e, t, n) {
1699
+ return t.stacked.normalize ? (t.config.format ?? ((o) => Ie(o, e.wording.locale)))(n) : ne(e, t, n);
1697
1700
  }
1698
1701
  function gs(e, t, n, o) {
1699
1702
  for (const i of t) {
1700
1703
  const r = i.materialized, s = j(r.x, r.length, o), l = s < r.length && r.x[s] === o ? i.stacked.total[s] : void 0;
1701
- if (l !== void 0 && !Number.isNaN(l)) return Vo(e, n, l);
1704
+ if (l !== void 0 && !Number.isNaN(l)) return zo(e, n, l);
1702
1705
  }
1703
1706
  return "";
1704
1707
  }
1705
- function zo(e) {
1708
+ function _o(e) {
1706
1709
  e.summaryEl !== null && (e.summaryTimer !== null && clearTimeout(e.summaryTimer), e.summaryTimer = setTimeout(() => {
1707
1710
  e.summaryTimer = null, e.summaryEl !== null && (e.summaryEl.textContent = ys(e));
1708
1711
  }, fs));
@@ -1722,7 +1725,7 @@ function ys(e) {
1722
1725
  const d = e.nameFor(a, i.indexOf(a));
1723
1726
  o.push(t.seriesExtent(d, ne(e, a, c[0]), ne(e, a, c[1])));
1724
1727
  }
1725
- const l = Ro(e);
1728
+ const l = Vo(e);
1726
1729
  return l.length > 0 && o.push(t.limitList(l)), e.tooltip !== null && o.push(t.walkHelp), e.tooltip !== null && e.onSelect !== null && o.push(t.selectHelp), e.hasZoom() && o.push(t.zoomHelp), e.legend !== null && e.seriesNames().some((a) => a !== void 0) && o.push(t.legendHelp), o.join(" ");
1727
1730
  }
1728
1731
  function xs(e, t) {
@@ -1739,11 +1742,11 @@ function xs(e, t) {
1739
1742
  function ne(e, t, n) {
1740
1743
  const o = t.config;
1741
1744
  if (o.format !== void 0 && t.stacked?.normalize !== !0) return o.format(n);
1742
- if (o.kind === "matrix") return Ve(n, e.wording.locale);
1743
- const i = t.stacked?.normalize === !0 ? _o(e, o.yAxisId) : e.findAxisConfig("y", o.yAxisId)?.tickFormat;
1744
- return i === void 0 ? Ve(n, e.wording.locale) : i(n);
1745
+ if (o.kind === "matrix") return Ie(n, e.wording.locale);
1746
+ const i = t.stacked?.normalize === !0 ? nn(e, o.yAxisId) : e.findAxisConfig("y", o.yAxisId)?.tickFormat;
1747
+ return i === void 0 ? Ie(n, e.wording.locale) : i(n);
1745
1748
  }
1746
- function _o(e, t) {
1749
+ function nn(e, t) {
1747
1750
  const n = e.findAxisConfig("y", t)?.tickFormat;
1748
1751
  if (n !== void 0) return n;
1749
1752
  for (const o of e.series.values())
@@ -1754,7 +1757,7 @@ function vs(e, t, n, o = bs) {
1754
1757
  const i = e.map((c) => ks(c, t, n)), r = Et(i, !1).count;
1755
1758
  if (r <= o || !(n > t)) return { ...Et(i, !0), courses: i, readings: r, thinned: !1 };
1756
1759
  const s = Math.max(1, Math.floor(o / 6 / Math.max(1, e.length))), l = (s - 1) / (n - t), a = i.map(
1757
- (c, d) => e[d]?.changesOnly === !0 ? ws(c) : Wo(c, t, n, l, -t * l, s)
1760
+ (c, d) => e[d]?.changesOnly === !0 ? ws(c) : Ho(c, t, n, l, -t * l, s)
1758
1761
  );
1759
1762
  return { ...Et(a, !0), courses: a, readings: r, thinned: !0 };
1760
1763
  }
@@ -1855,7 +1858,7 @@ function Is(e, t, n) {
1855
1858
  };
1856
1859
  }
1857
1860
  function As(e, t, n, o) {
1858
- const i = t.materialized, r = o < 0 ? Number.NaN : n.y[o], s = j(i.x, i.length, n.x[o]), l = Number.isNaN(r) || i.box === null ? null : { ...Co(i.box, s), median: r };
1861
+ const i = t.materialized, r = o < 0 ? Number.NaN : n.y[o], s = j(i.x, i.length, n.x[o]), l = Number.isNaN(r) || i.box === null ? null : { ...Wo(i.box, s), median: r };
1859
1862
  return e.boxParts(t, l).map((a) => a.value);
1860
1863
  }
1861
1864
  function Ts(e, t, n, o) {
@@ -1899,7 +1902,7 @@ const Ss = {
1899
1902
  ArrowRight: "right",
1900
1903
  ArrowUp: "up",
1901
1904
  ArrowDown: "down"
1902
- }, Yn = 1.25;
1905
+ }, Kn = 1.25;
1903
1906
  function Ge(e) {
1904
1907
  return e.seriesInOrder().filter(
1905
1908
  (t) => !e.isHidden(t.config) && t.materialized !== null && t.materialized.length > 0
@@ -1928,22 +1931,22 @@ function Ds(e) {
1928
1931
  }
1929
1932
  function Fs(e, t) {
1930
1933
  if (t.altKey || t.ctrlKey || t.metaKey) return !1;
1931
- if (e.tooltip === null) return Kn(e, t);
1934
+ if (e.tooltip === null) return Un(e, t);
1932
1935
  if (t.key === "Enter" && !t.shiftKey) return Bo(e);
1933
1936
  if (t.key === "Escape")
1934
1937
  return e.hover === null ? !1 : (e.clearActive(), !0);
1935
- if (Kn(e, t)) return !0;
1938
+ if (Un(e, t)) return !0;
1936
1939
  const n = qe(e);
1937
1940
  if (n === null) return !1;
1938
1941
  if (n.config.kind === "matrix") return Ps(e, t.key, n);
1939
1942
  const o = t.shiftKey ? void 0 : Ss[t.key];
1940
1943
  return o !== void 0 ? (Ko(e, o), !0) : !t.shiftKey && (t.key === "ArrowDown" || t.key === "ArrowUp") ? (Uo(e, t.key === "ArrowDown" ? 1 : -1), !0) : !1;
1941
1944
  }
1942
- function Kn(e, t) {
1945
+ function Un(e, t) {
1943
1946
  if (!e.hasZoom()) return !1;
1944
1947
  const n = e.layout.plot, o = e.hover?.hit.xPx ?? n.x + n.width / 2;
1945
- if (t.key === "+" || t.key === "=") e.zoomAt(o, 1 / Yn);
1946
- else if (t.key === "-" || t.key === "_") e.zoomAt(o, Yn);
1948
+ if (t.key === "+" || t.key === "=") e.zoomAt(o, 1 / Kn);
1949
+ else if (t.key === "-" || t.key === "_") e.zoomAt(o, Kn);
1947
1950
  else if (t.key === "0") e.resetZoom();
1948
1951
  else if (t.shiftKey && (t.key === "ArrowLeft" || t.key === "ArrowRight"))
1949
1952
  e.panBy((t.key === "ArrowLeft" ? 1 : -1) * n.width / 10);
@@ -1966,7 +1969,7 @@ function Ko(e, t) {
1966
1969
  const o = n === null ? null : e.findAxis("x", n.config.xAxisId);
1967
1970
  if (n === null || o === null) return;
1968
1971
  const i = e.activeBy === null ? null : Yo(e), r = Jt(xt(e, n), i, t, o.scale.domain);
1969
- r !== null && on(e, n, r);
1972
+ r !== null && rn(e, n, r);
1970
1973
  }
1971
1974
  function Uo(e, t) {
1972
1975
  const n = Ge(e), o = qe(e);
@@ -1975,29 +1978,29 @@ function Uo(e, t) {
1975
1978
  e.emphasis = i.order, e.setHighlight([i.order]), e.keyHighlight = !0;
1976
1979
  const r = Yo(e), s = e.findAxis("x", i.config.xAxisId);
1977
1980
  if (s === null) return;
1978
- const l = r === null ? Jt(xt(e, i), null, "last", s.scale.domain) : To(xt(e, i), r, s.scale.domain);
1981
+ const l = r === null ? Jt(xt(e, i), null, "last", s.scale.domain) : Mo(xt(e, i), r, s.scale.domain);
1979
1982
  if (l !== null)
1980
1983
  if (e.keyCell = null, i.config.kind === "matrix") {
1981
- const a = nn(e, i, l);
1984
+ const a = on(e, i, l);
1982
1985
  a !== null && It(e, i, a);
1983
- } else on(e, i, l);
1986
+ } else rn(e, i, l);
1984
1987
  }
1985
1988
  function Ps(e, t, n) {
1986
1989
  const o = n.materialized, i = e.keyCell ?? Go(e, n);
1987
1990
  if (i === null) return !1;
1988
1991
  const r = Ls[t];
1989
1992
  let s;
1990
- if (r !== void 0) s = Mo(o, i, r);
1993
+ if (r !== void 0) s = So(o, i, r);
1991
1994
  else if (t === "Home" || t === "End") s = Vr(o, i, t === "Home" ? "start" : "end");
1992
1995
  else return !1;
1993
1996
  return s === i && (r === "up" || r === "down") && Ge(e).length > 1 ? (Uo(e, r === "down" ? 1 : -1), !0) : (It(e, n, s), !0);
1994
1997
  }
1995
1998
  function Go(e, t) {
1996
1999
  const n = t.materialized, o = e.findAxis("x", t.config.xAxisId), i = o === null ? null : Jt([n], null, "last", o.scale.domain);
1997
- return i === null ? null : nn(e, t, i);
2000
+ return i === null ? null : on(e, t, i);
1998
2001
  }
1999
- function nn(e, t, n) {
2000
- const o = { x: n, y: Number.NEGATIVE_INFINITY }, i = Mo(t.materialized, o, "up");
2002
+ function on(e, t, n) {
2003
+ const o = { x: n, y: Number.NEGATIVE_INFINITY }, i = So(t.materialized, o, "up");
2001
2004
  return i === o ? null : i;
2002
2005
  }
2003
2006
  function It(e, t, n, o = !0) {
@@ -2007,7 +2010,7 @@ function It(e, t, n, o = !0) {
2007
2010
  function qo(e, t, n) {
2008
2011
  return t === void 0 ? 0 : (t.offset + t.width / 2) * n.scale.m;
2009
2012
  }
2010
- function on(e, t, n, o = !0) {
2013
+ function rn(e, t, n, o = !0) {
2011
2014
  const i = e.findAxis("x", t.config.xAxisId), r = e.findAxis("y", t.config.yAxisId), s = t.materialized;
2012
2015
  if (i === null || r === null || s === null) return;
2013
2016
  let l;
@@ -2025,45 +2028,45 @@ function Xo(e, t, n, o, i = !0) {
2025
2028
  e.showAt(n, o) && (e.activeBy = "keyboard", e.keyX = t, i && hs(e));
2026
2029
  }
2027
2030
  function Cs(e) {
2028
- const t = qe(e), n = t === null ? null : e.findAxis("x", t.config.xAxisId), o = t === null || n === null || e.keyX === null ? null : To(xt(e, t), e.keyX, n.scale.domain);
2031
+ const t = qe(e), n = t === null ? null : e.findAxis("x", t.config.xAxisId), o = t === null || n === null || e.keyX === null ? null : Mo(xt(e, t), e.keyX, n.scale.domain);
2029
2032
  if (t === null || o === null) {
2030
2033
  e.clearActive();
2031
2034
  return;
2032
2035
  }
2033
- if (t.config.kind !== "matrix") on(e, t, o, !1);
2036
+ if (t.config.kind !== "matrix") rn(e, t, o, !1);
2034
2037
  else {
2035
- const i = e.keyCell, r = t.materialized, s = i !== null && zr(r, { x: o, y: i.y }) ? { x: o, y: i.y } : nn(e, t, o);
2038
+ const i = e.keyCell, r = t.materialized, s = i !== null && zr(r, { x: o, y: i.y }) ? { x: o, y: i.y } : on(e, t, o);
2036
2039
  s !== null && It(e, t, s, !1);
2037
2040
  }
2038
2041
  }
2039
2042
  function jo(e) {
2040
2043
  e.keyX = null, e.keyCell = null, e.keyHighlight && (e.keyHighlight = !1, e.setHighlight(null));
2041
2044
  }
2042
- const Un = /* @__PURE__ */ new WeakMap();
2045
+ const Gn = /* @__PURE__ */ new WeakMap();
2043
2046
  function Ws(e, t) {
2044
- Ae(t) !== Ae(Qo(e)) && (e.heldSpans = { ...t.domains }, sn(e, [...t.hidden ?? []]));
2047
+ Te(t) !== Te(Qo(e)) && (e.heldSpans = { ...t.domains }, ln(e, [...t.hidden ?? []]));
2045
2048
  }
2046
- function Gn(e, t) {
2047
- rn(e, Br(e.heldHidden, t));
2049
+ function qn(e, t) {
2050
+ sn(e, Br(e.heldHidden, t));
2048
2051
  }
2049
2052
  function Hs(e, t, n = e.heldHidden) {
2050
2053
  const o = Be(e);
2051
- rn(e, Yr(t, n, o) ? [] : So(t, o));
2054
+ sn(e, Yr(t, n, o) ? [] : Lo(t, o));
2052
2055
  }
2053
- function rn(e, t) {
2054
- Kr(t, Be(e)) && (t = [], Ho(e, e.wording.allShown)), sn(e, t);
2056
+ function sn(e, t) {
2057
+ Kr(t, Be(e)) && (t = [], Ro(e, e.wording.allShown)), ln(e, t);
2055
2058
  }
2056
2059
  function Be(e) {
2057
2060
  return [...e.series.values()].map(({ config: t }) => t.name);
2058
2061
  }
2059
- function sn(e, t) {
2062
+ function ln(e, t) {
2060
2063
  const n = new Map([...e.series.values()].map((o) => [o, z(e, o.config)]));
2061
2064
  e.heldHidden = t;
2062
2065
  for (const [o, i] of n)
2063
2066
  i !== z(e, o.config) && G(o.config) !== void 0 && (e.materialsDirty = !0);
2064
- ln(e);
2067
+ an(e);
2065
2068
  }
2066
- function ln(e) {
2069
+ function an(e) {
2067
2070
  e.actedOn = !0, Jo(e), e.markLayoutDirty();
2068
2071
  }
2069
2072
  function Qo(e) {
@@ -2076,7 +2079,7 @@ function Zo(e) {
2076
2079
  }
2077
2080
  function Jo(e) {
2078
2081
  const t = Zo(e);
2079
- if (Ae(t) !== Ae(e.reportedView)) {
2082
+ if (Te(t) !== Te(e.reportedView)) {
2080
2083
  e.reportedView = t;
2081
2084
  for (const n of e.viewListeners) n();
2082
2085
  }
@@ -2100,8 +2103,8 @@ function Vs(e, t) {
2100
2103
  let n = Number.POSITIVE_INFINITY;
2101
2104
  for (const { config: o, materialized: i } of e.series.values()) {
2102
2105
  if (o.xAxisId !== t || i === null) continue;
2103
- let r = Un.get(i);
2104
- r === void 0 && (r = Lo(i.x, i.length), Un.set(i, r)), r > 0 && (n = Math.min(n, r));
2106
+ let r = Gn.get(i);
2107
+ r === void 0 && (r = $o(i.x, i.length), Gn.set(i, r)), r > 0 && (n = Math.min(n, r));
2105
2108
  }
2106
2109
  return Number.isFinite(n) ? n : 0;
2107
2110
  }
@@ -2127,11 +2130,11 @@ function oi(e, t) {
2127
2130
  }
2128
2131
  n && (e.actedOn = !0, e.markLayoutDirty());
2129
2132
  }
2130
- function an(e, t, n) {
2133
+ function cn(e, t, n) {
2131
2134
  const o = e.layout.plot, i = o.width > 0 ? Math.min(1, Math.max(0, (t - o.x) / o.width)) : 0.5;
2132
2135
  oi(e, (r, s) => Ur(r, i, n, Rs(e, s)));
2133
2136
  }
2134
- function cn(e, t) {
2137
+ function un(e, t) {
2135
2138
  const n = e.layout.plot.width;
2136
2139
  n <= 0 || t === 0 || oi(e, ([o, i]) => {
2137
2140
  const r = -t / n * (i - o);
@@ -2141,37 +2144,37 @@ function cn(e, t) {
2141
2144
  function zs(e, t) {
2142
2145
  if (!Xe(e)) return;
2143
2146
  const n = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.layout.plot.width : 1, o = t.deltaX * n, i = t.deltaY * n;
2144
- t.ctrlKey || t.metaKey ? (t.preventDefault(), an(e, t.offsetX, Math.exp(i * (Math.abs(i) < 50 ? 0.01 : 15e-4)))) : (Math.abs(o) > Math.abs(i) || t.shiftKey) && (t.preventDefault(), cn(e, -(t.shiftKey && o === 0 ? i : o)));
2147
+ t.ctrlKey || t.metaKey ? (t.preventDefault(), cn(e, t.offsetX, Math.exp(i * (Math.abs(i) < 50 ? 0.01 : 15e-4)))) : (Math.abs(o) > Math.abs(i) || t.shiftKey) && (t.preventDefault(), un(e, -(t.shiftKey && o === 0 ? i : o)));
2145
2148
  }
2146
2149
  function _s(e, t) {
2147
- e.downAt = t.offsetX, e.travelled = !1, Xe(e) && (t.pointerType !== "touch" && t.button !== 0 || (e.pointers.set(t.pointerId, t.offsetX), e.container?.setPointerCapture?.(t.pointerId), e.pointers.size === 2 && (e.pinch = un(e))));
2150
+ e.downAt = t.offsetX, e.travelled = !1, Xe(e) && (t.pointerType !== "touch" && t.button !== 0 || (e.pointers.set(t.pointerId, t.offsetX), e.container?.setPointerCapture?.(t.pointerId), e.pointers.size === 2 && (e.pinch = dn(e))));
2148
2151
  }
2149
2152
  function Bs(e, t) {
2150
2153
  e.downAt !== null && Math.abs(t.offsetX - e.downAt) > 4 && t.buttons !== 0 && (e.travelled = !0);
2151
2154
  const n = e.pointers.get(t.pointerId);
2152
2155
  if (n === void 0) return;
2153
2156
  if (e.pointers.set(t.pointerId, t.offsetX), e.pointers.size === 1) {
2154
- cn(e, t.offsetX - n);
2157
+ un(e, t.offsetX - n);
2155
2158
  return;
2156
2159
  }
2157
- const o = un(e);
2160
+ const o = dn(e);
2158
2161
  if (e.pinch > 0 && o > 0) {
2159
2162
  const [i = 0, r = 0] = e.pointers.values();
2160
- an(e, (i + r) / 2, e.pinch / o);
2163
+ cn(e, (i + r) / 2, e.pinch / o);
2161
2164
  }
2162
2165
  e.pinch = o;
2163
2166
  }
2164
2167
  function Ys(e, t) {
2165
- e.pointers.delete(t.pointerId), e.pinch = un(e);
2168
+ e.pointers.delete(t.pointerId), e.pinch = dn(e);
2166
2169
  }
2167
- function un(e) {
2170
+ function dn(e) {
2168
2171
  const [t, n] = e.pointers.values();
2169
2172
  return t === void 0 || n === void 0 ? 0 : Math.abs(t - n);
2170
2173
  }
2171
2174
  function Ks(e) {
2172
2175
  if (!Xe(e)) return;
2173
2176
  const t = new Set(ei(e));
2174
- e.heldSpans = Object.fromEntries(Object.entries(e.heldSpans).filter(([n]) => !t.has(n))), ln(e);
2177
+ e.heldSpans = Object.fromEntries(Object.entries(e.heldSpans).filter(([n]) => !t.has(n))), an(e);
2175
2178
  }
2176
2179
  const Us = {
2177
2180
  ok: 0,
@@ -2182,7 +2185,7 @@ const Us = {
2182
2185
  function Ga(e) {
2183
2186
  return Us[e];
2184
2187
  }
2185
- const qn = { warning: 2, alarm: 3 };
2188
+ const Xn = { warning: 2, alarm: 3 };
2186
2189
  function Gs(e, t = {}) {
2187
2190
  if (e == null || !Number.isFinite(e))
2188
2191
  return { verdict: "unknown" };
@@ -2191,7 +2194,7 @@ function Gs(e, t = {}) {
2191
2194
  for (const l of t.limits ?? []) {
2192
2195
  if (!Number.isFinite(l.value)) continue;
2193
2196
  const a = l.side === "upper" ? e - l.value : l.value - e;
2194
- a > 0 && (i === void 0 || qn[l.severity] > qn[i.severity] || l.severity === i.severity && a > r) && (i = l, r = a);
2197
+ a > 0 && (i === void 0 || Xn[l.severity] > Xn[i.severity] || l.severity === i.severity && a > r) && (i = l, r = a);
2195
2198
  }
2196
2199
  if (i === void 0)
2197
2200
  return o === void 0 ? { verdict: "ok" } : { verdict: "ok", deviation: o };
@@ -2238,15 +2241,15 @@ function ii(e, t, n) {
2238
2241
  for (let a = 0; a < o; a++) i[a] = Qs(r[a], t, n, s, l);
2239
2242
  return i;
2240
2243
  }
2241
- function Me(e, t) {
2244
+ function Se(e, t) {
2242
2245
  const n = e.themeRoot;
2243
2246
  if (n === null) return t;
2244
2247
  if (e.theme?.forced === !0) return e.theme.colorText;
2245
2248
  let o = e.painted.get(t);
2246
2249
  return o === void 0 && (o = Vi(n, { color: t }).color, e.painted.set(t, o)), o;
2247
2250
  }
2248
- function Se(e, t) {
2249
- if (t.config.color !== void 0) return Me(e, t.config.color);
2251
+ function Le(e, t) {
2252
+ if (t.config.color !== void 0) return Se(e, t.config.color);
2250
2253
  if (!Ue(t.config)) return "";
2251
2254
  const n = t.config.tone;
2252
2255
  if (n !== void 0) {
@@ -2266,7 +2269,7 @@ function ri(e, t) {
2266
2269
  "a series without a name has changed its colour, because a series before it went away - with `name` it keeps it."
2267
2270
  ), t.lastSlot = n, n;
2268
2271
  }
2269
- function dn(e, t, n) {
2272
+ function fn(e, t, n) {
2270
2273
  return t.config.name !== void 0 ? t.config.name : (W(
2271
2274
  "series-without-name",
2272
2275
  `a series without a name is called "Series ${n + 1}" in the legend and the tooltip - the name belongs in \`name\`.`
@@ -2290,7 +2293,7 @@ function si(e) {
2290
2293
  names: l.name === void 0 ? [] : [l.name],
2291
2294
  color: a.color,
2292
2295
  seriesIds: [r.order],
2293
- mark: i === null ? null : { dash: null, marker: null, swatches: [{ color: Me(e, a.color), hatch: i.get(a.label) ?? "none" }], ground: o.colorBg }
2296
+ mark: i === null ? null : { dash: null, marker: null, swatches: [{ color: Se(e, a.color), hatch: i.get(a.label) ?? "none" }], ground: o.colorBg }
2294
2297
  };
2295
2298
  n.set(d, h), t.push(h);
2296
2299
  });
@@ -2298,10 +2301,10 @@ function si(e) {
2298
2301
  }
2299
2302
  t.push({
2300
2303
  id: String(r.order),
2301
- name: dn(e, r, s),
2304
+ name: fn(e, r, s),
2302
2305
  hidden: z(e, l),
2303
2306
  names: l.name === void 0 ? [] : [l.name],
2304
- color: l.kind === "matrix" ? Xs(At(l.coloring, o)) : Se(e, r),
2307
+ color: l.kind === "matrix" ? Xs(At(l.coloring, o)) : Le(e, r),
2305
2308
  seriesIds: [r.order],
2306
2309
  mark: li(e, r, o)
2307
2310
  });
@@ -2311,7 +2314,7 @@ function li(e, t, n) {
2311
2314
  if (!e.marked()) return null;
2312
2315
  const o = t.config;
2313
2316
  if (o.kind === "matrix")
2314
- return { dash: null, marker: null, swatches: At(o.coloring, n).map((s, l) => ({ color: Me(e, s), hatch: Nt(l) })), ground: n.colorBg };
2317
+ return { dash: null, marker: null, swatches: At(o.coloring, n).map((s, l) => ({ color: Se(e, s), hatch: Nt(l) })), ground: n.colorBg };
2315
2318
  const i = e.marksOf(t);
2316
2319
  if (i === null) return null;
2317
2320
  switch (o.kind) {
@@ -2321,17 +2324,17 @@ function li(e, t, n) {
2321
2324
  return {
2322
2325
  dash: o.dash ?? i.dash,
2323
2326
  marker: null,
2324
- swatches: [{ color: Se(e, t), hatch: i.hatch, opacity: o.fillOpacity }],
2327
+ swatches: [{ color: Le(e, t), hatch: i.hatch, opacity: o.fillOpacity }],
2325
2328
  ground: n.colorBg
2326
2329
  };
2327
2330
  case "scatter":
2328
2331
  return { dash: null, marker: i.marker, swatches: null, ground: n.colorBg };
2329
2332
  default:
2330
- return { dash: null, marker: null, swatches: [{ color: Se(e, t), hatch: i.hatch }], ground: n.colorBg };
2333
+ return { dash: null, marker: null, swatches: [{ color: Le(e, t), hatch: i.hatch }], ground: n.colorBg };
2331
2334
  }
2332
2335
  }
2333
2336
  function Zs(e, t, n) {
2334
- return t.color !== void 0 ? Me(e, t.color) : t.role === "control" ? n.colorAxis : t.role === "zone" ? n.colorGrid : t.severity === "alarm" ? n.colorAlarm : n.colorWarning;
2337
+ return t.color !== void 0 ? Se(e, t.color) : t.role === "control" ? n.colorAxis : t.role === "zone" ? n.colorGrid : t.severity === "alarm" ? n.colorAlarm : n.colorWarning;
2335
2338
  }
2336
2339
  function Js(e, t) {
2337
2340
  switch (t.role) {
@@ -2380,12 +2383,12 @@ function ai(e) {
2380
2383
  if (o.label === void 0 || o.label === "") continue;
2381
2384
  const i = e.findAxis(o.orientation, e.limitAxisId(o));
2382
2385
  if (i === null) continue;
2383
- const r = o.kind === "line" ? e.limitAt(o, o.value) : (e.limitAt(o, o.from) + e.limitAt(o, o.to)) / 2, s = e.measurer?.measure(o.label, Ie), l = s?.height ?? 0, a = i.scale.toPx(r), c = (s?.width ?? 0) + 4 + (o.color === void 0 ? 0 : qs);
2386
+ const r = o.kind === "line" ? e.limitAt(o, o.value) : (e.limitAt(o, o.from) + e.limitAt(o, o.to)) / 2, s = e.measurer?.measure(o.label, Ae), l = s?.height ?? 0, a = i.scale.toPx(r), c = (s?.width ?? 0) + 4 + (o.color === void 0 ? 0 : qs);
2384
2387
  t.push({
2385
2388
  id: n,
2386
2389
  axisKey: i.key,
2387
2390
  px: a,
2388
- labelLeft: bo(a, c, e.cssWidth),
2391
+ labelLeft: vo(a, c, e.cssWidth),
2389
2392
  width: c,
2390
2393
  height: l,
2391
2394
  inside: i.limitsInside,
@@ -2402,7 +2405,7 @@ function ai(e) {
2402
2405
  }
2403
2406
  return t;
2404
2407
  }
2405
- function Xn(e, t) {
2408
+ function jn(e, t) {
2406
2409
  if (t < 2) return 0;
2407
2410
  const n = e.slice(0, t).sort();
2408
2411
  let o = Number.POSITIVE_INFINITY;
@@ -2429,7 +2432,7 @@ function el(e, t, n, o, i, r, s) {
2429
2432
  function ci(e) {
2430
2433
  const t = [];
2431
2434
  let n;
2432
- const o = e.seriesInOrder().filter((l) => !z(e, l.config)), i = e.highlight, r = i !== null && o.some((l) => i.includes(l.order)) ? i : null, s = fn(e);
2435
+ const o = e.seriesInOrder().filter((l) => !z(e, l.config)), i = e.highlight, r = i !== null && o.some((l) => i.includes(l.order)) ? i : null, s = hn(e);
2433
2436
  return o.forEach((l) => {
2434
2437
  const a = l.materialized;
2435
2438
  if (a === null) return;
@@ -2441,9 +2444,9 @@ function ci(e) {
2441
2444
  length: a.length,
2442
2445
  xScale: c.scale,
2443
2446
  yScale: d.scale,
2444
- color: Se(e, l),
2447
+ color: Le(e, l),
2445
2448
  alpha: m ? 0.25 : 1
2446
- }, u = l.config, g = u.kind === "line" || u.kind === "area" ? Wo(a, c.scale.domain[0], c.scale.domain[1], c.scale.m, c.scale.b, e.layout.plot.width) : a;
2449
+ }, u = l.config, g = u.kind === "line" || u.kind === "area" ? Ho(a, c.scale.domain[0], c.scale.domain[1], c.scale.m, c.scale.b, e.layout.plot.width) : a;
2447
2450
  switch (f.x = g.x, f.y = g.y, f.length = g.length, u.kind) {
2448
2451
  case "line":
2449
2452
  t.push({
@@ -2473,7 +2476,7 @@ function ci(e) {
2473
2476
  case "bar": {
2474
2477
  const p = s.get(l.order);
2475
2478
  if (p === void 0) break;
2476
- const y = Qn(a, c, Math.abs(p.offset) + p.width);
2479
+ const y = Zn(a, c, Math.abs(p.offset) + p.width);
2477
2480
  t.push({
2478
2481
  ...f,
2479
2482
  x: y.x,
@@ -2506,14 +2509,14 @@ function ci(e) {
2506
2509
  t.push({ ...f, kind: "scatter", radius: u.radius, marker: h?.marker });
2507
2510
  break;
2508
2511
  case "state": {
2509
- const p = hn(e, u, d), y = Qn(a, c, 0);
2512
+ const p = mn(e, u, d), y = Zn(a, c, 0);
2510
2513
  t.push({
2511
2514
  ...f,
2512
2515
  x: y.x,
2513
2516
  y: y.y,
2514
2517
  length: y.length,
2515
2518
  kind: "state",
2516
- colors: u.states.map((x) => Me(e, x.color)),
2519
+ colors: u.states.map((x) => Se(e, x.color)),
2517
2520
  laneTop: p.top,
2518
2521
  laneBottom: p.bottom,
2519
2522
  lastEnd: ui(e, l, a, c),
@@ -2522,7 +2525,7 @@ function ci(e) {
2522
2525
  break;
2523
2526
  }
2524
2527
  case "matrix": {
2525
- const p = At(u.coloring, e.theme ?? H).map((y) => Me(e, y));
2528
+ const p = At(u.coloring, e.theme ?? H).map((y) => Se(e, y));
2526
2529
  t.push({
2527
2530
  ...f,
2528
2531
  kind: "matrix",
@@ -2543,12 +2546,12 @@ function ci(e) {
2543
2546
  }
2544
2547
  }), t;
2545
2548
  }
2546
- const jn = /* @__PURE__ */ new WeakMap();
2549
+ const Qn = /* @__PURE__ */ new WeakMap();
2547
2550
  function tl(e, t) {
2548
- let n = jn.get(e);
2549
- return n === void 0 && jn.set(e, n = Do(e, t) < 0), n;
2551
+ let n = Qn.get(e);
2552
+ return n === void 0 && Qn.set(e, n = Fo(e, t) < 0), n;
2550
2553
  }
2551
- function Qn(e, t, n) {
2554
+ function Zn(e, t, n) {
2552
2555
  if (!tl(e.x, e.length)) return { x: e.x, y: e.y, y0: e.y0, length: e.length };
2553
2556
  const [o, i] = Hr(e.x, e.length, t.scale.domain[0], t.scale.domain[1], n);
2554
2557
  return {
@@ -2558,7 +2561,7 @@ function Qn(e, t, n) {
2558
2561
  length: i - o
2559
2562
  };
2560
2563
  }
2561
- function fn(e) {
2564
+ function hn(e) {
2562
2565
  const t = e.seriesInOrder().filter((i) => !z(e, i.config)), n = Qr(
2563
2566
  t.map((i) => ({
2564
2567
  order: i.order,
@@ -2589,13 +2592,13 @@ function ui(e, t, n, o) {
2589
2592
  }
2590
2593
  return xr(n.x, n.length, i, t.step ?? 0, o.scale.domain[1]);
2591
2594
  }
2592
- function hn(e, t, n) {
2595
+ function mn(e, t, n) {
2593
2596
  const o = n.scale.domain;
2594
2597
  let i = t.laneFrom ?? o[0], r = t.laneTo ?? o[1];
2595
2598
  if (t.lane !== void 0) {
2596
2599
  const a = e.categoriesAt("y", n.id)?.place.get(t.lane);
2597
2600
  if (a === void 0) return { top: 0, bottom: 0 };
2598
- i = a - _n / 2, r = a + _n / 2;
2601
+ i = a - Bn / 2, r = a + Bn / 2;
2599
2602
  }
2600
2603
  const s = n.scale.toPx(i), l = n.scale.toPx(r);
2601
2604
  return { top: Math.min(s, l), bottom: Math.max(s, l) };
@@ -2626,7 +2629,7 @@ function ol(e) {
2626
2629
  syncPx: e.syncedPx()
2627
2630
  }), e.positionTooltip());
2628
2631
  }
2629
- const il = [...Te.slice(0, 2), "median", ...Te.slice(2)], Zn = 5;
2632
+ const il = [...Me.slice(0, 2), "median", ...Me.slice(2)], Jn = 5;
2630
2633
  function rl(e) {
2631
2634
  const t = e.entry.materialized;
2632
2635
  if (t === null) return !1;
@@ -2645,7 +2648,7 @@ function di(e, t, n) {
2645
2648
  }
2646
2649
  if (i?.count != null) {
2647
2650
  const l = n?.count;
2648
- s.push({ label: o.count, value: l === void 0 || !Number.isFinite(l) ? "" : Ve(l, e.wording.locale) });
2651
+ s.push({ label: o.count, value: l === void 0 || !Number.isFinite(l) ? "" : Ie(l, e.wording.locale) });
2649
2652
  }
2650
2653
  if (i?.outliers != null) {
2651
2654
  const l = n?.outliers ?? [];
@@ -2655,7 +2658,7 @@ function di(e, t, n) {
2655
2658
  }
2656
2659
  function ll(e, t, n) {
2657
2660
  const o = [...n].sort((i, r) => r - i);
2658
- return e.wording.outlierList(o.slice(0, Zn).map((i) => ne(e, t, i)), Math.max(0, o.length - Zn));
2661
+ return e.wording.outlierList(o.slice(0, Jn).map((i) => ne(e, t, i)), Math.max(0, o.length - Jn));
2659
2662
  }
2660
2663
  function al(e, t, n) {
2661
2664
  const o = t.entry.config, i = (s) => ({
@@ -2665,7 +2668,7 @@ function al(e, t, n) {
2665
2668
  if (o.kind === "state") return i(e.stateHatches().get(t.segment?.label ?? "") ?? "none");
2666
2669
  if (o.kind === "matrix") return i(Nt(t.entry.buckets?.[t.index] ?? 0));
2667
2670
  const r = li(e, t.entry, n);
2668
- return r === null ? null : { color: Se(e, t.entry), mark: r };
2671
+ return r === null ? null : { color: Le(e, t.entry), mark: r };
2669
2672
  }
2670
2673
  function cl(e) {
2671
2674
  const t = e.tooltipEl;
@@ -2681,7 +2684,7 @@ function cl(e) {
2681
2684
  let s = n.mouseY - i / 2;
2682
2685
  s = Math.min(Math.max(s, 0), Math.max(0, e.cssHeight - i)), t.style.transform = `translate3d(${Math.round(r)}px, ${Math.round(s)}px, 0)`, t.style.opacity = "1";
2683
2686
  }
2684
- const ul = 4, Jn = 12;
2687
+ const ul = 4, eo = 12;
2685
2688
  function dl(e, t, n) {
2686
2689
  const o = e.layout.plot;
2687
2690
  return t >= o.x && t <= o.x + o.width && n >= o.y && n <= o.y + o.height;
@@ -2710,7 +2713,7 @@ function hi(e, t, n) {
2710
2713
  const r = e.findAxis("x", o.primary.entry.config.xAxisId);
2711
2714
  if (r !== null && e.share({ axisId: r.id, value: r.scale.fromPx(o.state.hit.xPx) }), i !== e.hoverKey) {
2712
2715
  const s = o.primary.entry.config.xAxisId;
2713
- e.hoverKey = i, e.hoverXLabel = e.xLabel(s, o.primary.xValue, rl(o.primary)), e.hoverRows = o.chosen.map((l) => sl(e, l, s)), e.hoverOrders = o.chosen.map((l) => l.entry.order), e.hoverTotals = ps(e, o.chosen), e.hoverLimits = e.tooltip?.limits === !0 ? Ro(e, o.primary.entry.config.yAxisId) : [], e.pushHoverSnapshot();
2716
+ e.hoverKey = i, e.hoverXLabel = e.xLabel(s, o.primary.xValue, rl(o.primary)), e.hoverRows = o.chosen.map((l) => sl(e, l, s)), e.hoverOrders = o.chosen.map((l) => l.entry.order), e.hoverTotals = ps(e, o.chosen), e.hoverLimits = e.tooltip?.limits === !0 ? Vo(e, o.primary.entry.config.yAxisId) : [], e.pushHoverSnapshot();
2714
2717
  }
2715
2718
  return !0;
2716
2719
  }
@@ -2732,8 +2735,8 @@ function fl(e, t, n) {
2732
2735
  k !== null && i.push({
2733
2736
  entry: u,
2734
2737
  index: k.index,
2735
- color: k.color ?? Se(e, u),
2736
- name: dn(e, u, g),
2738
+ color: k.color ?? Le(e, u),
2739
+ name: fn(e, u, g),
2737
2740
  px: k.px,
2738
2741
  py: k.py,
2739
2742
  xValue: k.xValue,
@@ -2744,7 +2747,7 @@ function fl(e, t, n) {
2744
2747
  level: k.level,
2745
2748
  segment: k.segment,
2746
2749
  box: k.box,
2747
- markX: y.kind === "box" ? k.px + qo(e, (r ??= fn(e)).get(u.order), x) : void 0
2750
+ markX: y.kind === "box" ? k.px + qo(e, (r ??= hn(e)).get(u.order), x) : void 0
2748
2751
  });
2749
2752
  }), i.length === 0) return null;
2750
2753
  const s = i.filter((u) => !u.areal), l = s.length > 0 ? s : i;
@@ -2756,7 +2759,7 @@ function fl(e, t, n) {
2756
2759
  const y = (p.markX ?? p.px) - t, x = p.py - n, b = y * y + x * x;
2757
2760
  (b < u || b === u && p.covers) && (u = b, a = p);
2758
2761
  }
2759
- if (g.length === 0 && u > Jn * Jn) {
2762
+ if (g.length === 0 && u > eo * eo) {
2760
2763
  for (const p of i)
2761
2764
  if (p.areal) {
2762
2765
  a = p;
@@ -2806,13 +2809,13 @@ function fl(e, t, n) {
2806
2809
  function hl(e, t, n, o, i, r, s, l, a) {
2807
2810
  const c = t.config, d = n.length;
2808
2811
  if (c.kind === "state") {
2809
- const g = hn(e, c, i);
2812
+ const g = mn(e, c, i);
2810
2813
  if (r < g.top || r > g.bottom) return null;
2811
- const p = Fn(n.x, d, s);
2814
+ const p = On(n.x, d, s);
2812
2815
  if (p < 0) return null;
2813
2816
  const y = n.y[p];
2814
2817
  if (Number.isNaN(y)) return null;
2815
- const x = n.x[p], b = No(n.x, d, p, ui(e, t, n, o));
2818
+ const x = n.x[p], b = Io(n.x, d, p, ui(e, t, n, o));
2816
2819
  if (p === d - 1 && !(s < b)) return null;
2817
2820
  const w = c.states[y | 0];
2818
2821
  return {
@@ -2855,7 +2858,7 @@ function hl(e, t, n, o, i, r, s, l, a) {
2855
2858
  areal: !0
2856
2859
  };
2857
2860
  }
2858
- const m = c.kind === "scatter" && a === "nearest" ? Rr(n.x, n.y, d, s, l, o.scale, i.scale) : c.kind === "line" && c.step === !0 ? Fn(n.x, d, s) : Zt(n.x, d, s);
2861
+ const m = c.kind === "scatter" && a === "nearest" ? Rr(n.x, n.y, d, s, l, o.scale, i.scale) : c.kind === "line" && c.step === !0 ? On(n.x, d, s) : Zt(n.x, d, s);
2859
2862
  if (m < 0) return null;
2860
2863
  const h = n.y[m];
2861
2864
  if (Number.isNaN(h)) return null;
@@ -2869,7 +2872,7 @@ function hl(e, t, n, o, i, r, s, l, a) {
2869
2872
  marked: !0,
2870
2873
  areal: !1,
2871
2874
  covers: l >= Math.min(u, h) && l <= Math.max(u, h),
2872
- box: n.box === null ? void 0 : Co(n.box, m)
2875
+ box: n.box === null ? void 0 : Wo(n.box, m)
2873
2876
  };
2874
2877
  }
2875
2878
  function ml(e, t = !1) {
@@ -2916,7 +2919,7 @@ function gl(e) {
2916
2919
  const s = t.filter((c) => (i ? c.config.xAxisId : c.config.yAxisId) === o.id), l = o.categories ?? (i ? yl(e, o, s) : vl(e, s));
2917
2920
  i && xl(e, o, s, l === null);
2918
2921
  const a = e.categories.get(r);
2919
- if (!(l === null ? a === void 0 : a !== void 0 && Po(a.names, l))) {
2922
+ if (!(l === null ? a === void 0 : a !== void 0 && Co(a.names, l))) {
2920
2923
  l === null ? e.categories.delete(r) : e.categories.set(r, ns(l, !i));
2921
2924
  for (const c of s) Ke(c);
2922
2925
  }
@@ -2927,7 +2930,7 @@ function gl(e) {
2927
2930
  function yl(e, t, n) {
2928
2931
  const o = t.accessor;
2929
2932
  if (o === void 0 || Tt(e, t)) return null;
2930
- const i = $o(pi(e, n), o);
2933
+ const i = Eo(pi(e, n), o);
2931
2934
  return re && i !== null && i.every((r) => pl.test(r) && !Number.isNaN(Date.parse(r))) && W(
2932
2935
  `category-instants-${t.id}`,
2933
2936
  `The x axis "${t.id}" reads its rows' strings as categories, and every one is an ISO 8601 instant. If they are moments, say \`time\` on the axis: a string is an instant only there (ADR-0052).`
@@ -2965,7 +2968,7 @@ function vl(e, t) {
2965
2968
  const n = /* @__PURE__ */ new Set();
2966
2969
  for (const { config: o } of t)
2967
2970
  if (o.kind === "state" && o.lane !== void 0 && n.add(o.lane), o.kind === "matrix")
2968
- for (const i of $o([o.data ?? e.data], o.accessor) ?? []) n.add(i);
2971
+ for (const i of Eo([o.data ?? e.data], o.accessor) ?? []) n.add(i);
2969
2972
  return n.size === 0 ? null : [...n];
2970
2973
  }
2971
2974
  function yi(e) {
@@ -2982,7 +2985,7 @@ function yi(e) {
2982
2985
  const l = e.categoriesAt("x", s.id), a = l === void 0 ? null : es(r, s.accessor, l.place);
2983
2986
  o.rows = a?.rows ?? null;
2984
2987
  const c = e.categoriesAt("y", i.yAxisId), d = i.kind === "matrix" ? c : void 0, m = zt(i), h = m !== void 0 && c?.place.has(m) !== !0, f = h || c !== void 0 && i.kind !== "matrix" && i.kind !== "state", u = i.accessor;
2985
- re && (eo(e, i, r, s, s.accessor), i.kind === "matrix" && eo(e, i, r, { orientation: "y", id: i.yAxisId }, u), f && !h && W(
2988
+ re && (to(e, i, r, s, s.accessor), i.kind === "matrix" && to(e, i, r, { orientation: "y", id: i.yAxisId }, u), f && !h && W(
2986
2989
  `axis-kind-y-${i.yAxisId}-${i.name ?? "?"}`,
2987
2990
  `Series "${i.name ?? "?"}" brings numbers to the y axis "${i.yAxisId}", which reads categories. One axis has one kind: a number is no place there and is not drawn (ADR-0052).`
2988
2991
  ), h && W(
@@ -3007,7 +3010,7 @@ function yi(e) {
3007
3010
  }
3008
3011
  );
3009
3012
  if (o.materialized = g.series, o.own = G(i) === void 0 ? null : g.series.y, o.stacked = null, n += g.series.length, i.kind === "bar" || i.kind === "box") {
3010
- const p = l === void 0 ? Lo(g.series.x, g.series.length) : 1;
3013
+ const p = l === void 0 ? $o(g.series.x, g.series.length) : 1;
3011
3014
  o.step = p;
3012
3015
  const y = p / 2;
3013
3016
  o.extent = {
@@ -3016,7 +3019,7 @@ function yi(e) {
3016
3019
  xMax: g.extent.xMax + y
3017
3020
  };
3018
3021
  } else if (i.kind === "matrix") {
3019
- const p = l === void 0 ? Xn(g.series.x, g.series.length) : 1, y = d === void 0 ? Xn(g.series.y, g.series.length) : 1;
3022
+ const p = l === void 0 ? jn(g.series.x, g.series.length) : 1, y = d === void 0 ? jn(g.series.y, g.series.length) : 1;
3020
3023
  o.step = p, o.cellHeight = y, o.extent = {
3021
3024
  xMin: g.extent.xMin - p / 2,
3022
3025
  xMax: g.extent.xMax + p / 2,
@@ -3044,7 +3047,7 @@ function yi(e) {
3044
3047
  }
3045
3048
  }
3046
3049
  if (re && i.kind !== "matrix") {
3047
- const p = Do(g.series.x, g.series.length);
3050
+ const p = Fo(g.series.x, g.series.length);
3048
3051
  if (p >= 0) {
3049
3052
  const y = i.name ?? "?";
3050
3053
  W(
@@ -3072,7 +3075,7 @@ function wl(e) {
3072
3075
  n.forEach((s, l) => {
3073
3076
  const a = r[l], c = { ...s.materialized, y: a.top, y0: a.bottom };
3074
3077
  s.materialized = c, s.stacked = { value: a.value, total: a.total, normalize: i };
3075
- const [d, m] = Fo(c, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
3078
+ const [d, m] = Oo(c, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
3076
3079
  s.extent !== null && (s.extent = { ...s.extent, yMin: d, yMax: m });
3077
3080
  });
3078
3081
  }
@@ -3130,7 +3133,7 @@ function kl(e) {
3130
3133
  "More than one axis draws grid. Unaligned grids compete visually; `alignTicks` puts a further y axis' ticks on the first one's grid instead (R-4.15)."
3131
3134
  );
3132
3135
  }
3133
- function eo(e, t, n, o, i) {
3136
+ function to(e, t, n, o, i) {
3134
3137
  const r = t.name ?? "?", s = `${o.orientation} axis "${o.id}"`, l = `${o.orientation}-${o.id}-${r}`, a = (h, f) => W(
3135
3138
  `axis-kind-${l}`,
3136
3139
  `Series "${r}" brings ${h} to the ${s}, which reads ${f}. One axis has one kind: it is no place there and is not drawn (ADR-0052).`
@@ -3141,7 +3144,7 @@ function eo(e, t, n, o, i) {
3141
3144
  if (en([n], i) !== "number") return;
3142
3145
  const u = n.findIndex((g, p) => {
3143
3146
  const y = i(g, p);
3144
- return He(y) || y instanceof Date;
3147
+ return Re(y) || y instanceof Date;
3145
3148
  });
3146
3149
  u >= 0 && W(
3147
3150
  `instant-mixed-${l}`,
@@ -3152,7 +3155,7 @@ function eo(e, t, n, o, i) {
3152
3155
  for (let u = 0; u < n.length; u++) {
3153
3156
  const g = i(n[u], u);
3154
3157
  if (pt(g)) return;
3155
- if (He(g)) return a("a category", "numbers");
3158
+ if (Re(g)) return a("a category", "numbers");
3156
3159
  if (g instanceof Date) return a("a Date", "numbers");
3157
3160
  }
3158
3161
  return;
@@ -3160,7 +3163,7 @@ function eo(e, t, n, o, i) {
3160
3163
  const d = t.kind !== "matrix", m = /* @__PURE__ */ new Set();
3161
3164
  for (let h = 0; h < n.length; h++) {
3162
3165
  const f = i(n[h], h);
3163
- pt(f) ? a("a number", "categories") : f instanceof Date && a("a Date", "categories"), He(f) && (c.place.has(f) || W(
3166
+ pt(f) ? a("a number", "categories") : f instanceof Date && a("a Date", "categories"), Re(f) && (c.place.has(f) || W(
3164
3167
  `category-unlisted-${l}`,
3165
3168
  `Series "${r}" brings the category "${f}", which the ${s} does not list in \`categories\`. It has no place and is not drawn (ADR-0052).`
3166
3169
  ), d && m.has(f) && W(
@@ -3183,7 +3186,7 @@ function xi(e, t, n) {
3183
3186
  const o = e.categoriesAt(t, n);
3184
3187
  if (o !== void 0) {
3185
3188
  const l = o.names.length - 0.5;
3186
- return Wn(t, n, [{ xAxisId: n, yAxisId: n, extent: { xMin: -0.5, xMax: l, yMin: -0.5, yMax: l } }], to(e, t, n));
3189
+ return Hn(t, n, [{ xAxisId: n, yAxisId: n, extent: { xMin: -0.5, xMax: l, yMin: -0.5, yMax: l } }], no(e, t, n));
3187
3190
  }
3188
3191
  const i = t === "y" && e.findAxisConfig("y", n)?.domain === "visible", r = [...e.series.values()].map((s) => ({
3189
3192
  xAxisId: s.config.xAxisId,
@@ -3191,18 +3194,18 @@ function xi(e, t, n) {
3191
3194
  // A hidden series has no say: the axis fits what is shown.
3192
3195
  extent: z(e, s.config) ? null : i ? Il(e, s) : s.extent
3193
3196
  }));
3194
- return Wn(t, n, r, to(e, t, n));
3197
+ return Hn(t, n, r, no(e, t, n));
3195
3198
  }
3196
3199
  function Il(e, t) {
3197
3200
  const n = e.findAxisConfig("x", t.config.xAxisId), o = n === null ? void 0 : ti(e, n), i = t.config.kind;
3198
3201
  if (!Array.isArray(o) || t.materialized === null || i === "state" || i === "matrix")
3199
3202
  return t.extent;
3200
3203
  const [r, s] = o;
3201
- let [l, a] = Fo(t.materialized, r, s);
3204
+ let [l, a] = Oo(t.materialized, r, s);
3202
3205
  const c = yt(t.config);
3203
3206
  return typeof c == "number" && l <= a && (l = Math.min(l, c), a = Math.max(a, c)), { xMin: r, xMax: s, yMin: l, yMax: a };
3204
3207
  }
3205
- function to(e, t, n) {
3208
+ function no(e, t, n) {
3206
3209
  const o = [];
3207
3210
  for (const { config: i } of e.limits.values())
3208
3211
  i.inExtent && (i.orientation !== t || e.limitAxisId(i) !== n || (i.kind === "line" ? o.push(st(e, i, i.value)) : o.push(st(e, i, i.from), st(e, i, i.to))));
@@ -3251,7 +3254,7 @@ function Ml(e) {
3251
3254
  domainMode: ti(e, s),
3252
3255
  ...ye(e, s) && { ownDomainMode: s.domain },
3253
3256
  tickCount: l === void 0 ? s.tickCount : void 0,
3254
- tickFormat: l === void 0 ? s.orientation === "y" ? _o(e, s.id) : s.tickFormat : os(l, s.categoryLabel),
3257
+ tickFormat: l === void 0 ? s.orientation === "y" ? nn(e, s.id) : s.tickFormat : os(l, s.categoryLabel),
3255
3258
  tickValues: l?.ticks ?? s.ticks,
3256
3259
  time: l === void 0 && gi(e, s) ? !0 : void 0,
3257
3260
  calendar: l === void 0 ? s.calendar : void 0,
@@ -3292,13 +3295,13 @@ function Sl(e) {
3292
3295
  }
3293
3296
  return !1;
3294
3297
  }
3295
- function Re(e) {
3296
- if (zo(e), e.sayView) {
3298
+ function Ve(e) {
3299
+ if (_o(e), e.sayView) {
3297
3300
  e.sayView = !1;
3298
3301
  const n = ni(e)[0];
3299
3302
  if (n !== void 0) {
3300
3303
  const [o, i] = n.layout.scale.domain;
3301
- Ho(e, e.wording.visibleRange(e.xLabel(n.config.id, o), e.xLabel(n.config.id, i)));
3304
+ Ro(e, e.wording.visibleRange(e.xLabel(n.config.id, o), e.xLabel(n.config.id, i)));
3302
3305
  }
3303
3306
  }
3304
3307
  const t = !Sl(e);
@@ -3336,7 +3339,7 @@ function $l(e, t) {
3336
3339
  e.tooltipEl = t;
3337
3340
  }
3338
3341
  function El(e, t, n) {
3339
- e.readoutEl = t, e.summaryEl = n, zo(e);
3342
+ e.readoutEl = t, e.summaryEl = n, _o(e);
3340
3343
  }
3341
3344
  function Dl(e, t) {
3342
3345
  t !== e.wording && (e.wording = t, O(e));
@@ -3360,27 +3363,27 @@ function Pl(e) {
3360
3363
  a.width = s, a.height = l, a.style.width = `${e.cssWidth}px`, a.style.height = `${e.cssHeight}px`;
3361
3364
  o.setTransform(r, 0, 0, r, 0, 0), i.setTransform(r, 0, 0, r, 0, 0);
3362
3365
  }
3363
- function no(e) {
3364
- e.seriesDirty = !0, mn(e);
3366
+ function oo(e) {
3367
+ e.seriesDirty = !0, pn(e);
3365
3368
  }
3366
3369
  function Gt(e) {
3367
- e.overlayDirty = !0, mn(e);
3370
+ e.overlayDirty = !0, pn(e);
3368
3371
  }
3369
3372
  function O(e) {
3370
- e.layoutDirty = !0, e.seriesDirty = !0, e.overlayDirty = !0, mn(e);
3373
+ e.layoutDirty = !0, e.seriesDirty = !0, e.overlayDirty = !0, pn(e);
3371
3374
  }
3372
- function mn(e) {
3375
+ function pn(e) {
3373
3376
  e.frameHandle === null && e.container !== null && typeof requestAnimationFrame == "function" && (e.frameHandle = requestAnimationFrame(() => {
3374
3377
  e.frameHandle = null, Cl(e);
3375
3378
  }));
3376
3379
  }
3377
3380
  function Cl(e) {
3378
3381
  if (Pl(e), e.theme === null && e.themeRoot !== null && (e.theme = zi(e.themeRoot)), e.cssWidth <= 0 || e.cssHeight <= 0) {
3379
- e.layoutDirty && Re(e);
3382
+ e.layoutDirty && Ve(e);
3380
3383
  return;
3381
3384
  }
3382
3385
  if (e.materialsDirty && yi(e), e.layoutDirty) {
3383
- if (Ml(e), e.layoutDirty = !1, Re(e), e.activeBy === "keyboard")
3386
+ if (Ml(e), e.layoutDirty = !1, Ve(e), e.activeBy === "keyboard")
3384
3387
  e.hoverKey = "", Cs(e);
3385
3388
  else if (e.hover !== null) {
3386
3389
  const { mouseX: t, mouseY: n } = e.hover;
@@ -3392,29 +3395,29 @@ function Cl(e) {
3392
3395
  function Wl() {
3393
3396
  return { id: null, synced: null, sent: null };
3394
3397
  }
3395
- const Ce = /* @__PURE__ */ new Map();
3398
+ const We = /* @__PURE__ */ new Map();
3396
3399
  function Hl(e, t) {
3397
3400
  const n = e.sync;
3398
3401
  if (t !== n.id) {
3399
3402
  if (n.id !== null) {
3400
- pn(e, null);
3401
- const o = Ce.get(n.id);
3402
- o?.delete(e), o?.size === 0 && Ce.delete(n.id), n.synced = null, Gt(e);
3403
+ gn(e, null);
3404
+ const o = We.get(n.id);
3405
+ o?.delete(e), o?.size === 0 && We.delete(n.id), n.synced = null, Gt(e);
3403
3406
  }
3404
3407
  if (n.id = t, t !== null) {
3405
- const o = Ce.get(t) ?? /* @__PURE__ */ new Set();
3406
- o.add(e), Ce.set(t, o);
3408
+ const o = We.get(t) ?? /* @__PURE__ */ new Set();
3409
+ o.add(e), We.set(t, o);
3407
3410
  }
3408
3411
  }
3409
3412
  }
3410
3413
  function Rl(e, t) {
3411
- t !== e.loading && (e.loading = t, t && (vt(e), pn(e, null), e.pointers.clear(), e.pinch = 0), O(e));
3414
+ t !== e.loading && (e.loading = t, t && (vt(e), gn(e, null), e.pointers.clear(), e.pinch = 0), O(e));
3412
3415
  }
3413
- function pn(e, t) {
3416
+ function gn(e, t) {
3414
3417
  const n = e.sync;
3415
3418
  if (e.loading && (t = null), !(n.id === null || t?.value === n.sent?.value && t?.axisId === n.sent?.axisId)) {
3416
3419
  n.sent = t;
3417
- for (const o of Ce.get(n.id) ?? [])
3420
+ for (const o of We.get(n.id) ?? [])
3418
3421
  o !== e && (o.sync.synced = t, o.markOverlayDirty());
3419
3422
  }
3420
3423
  }
@@ -3424,7 +3427,7 @@ function Vl(e) {
3424
3427
  const n = Ut(e, "x", t.axisId) ?? e.layout.axes.find((o) => o.orientation === "x") ?? null;
3425
3428
  return n === null ? null : n.scale.toPx(t.value);
3426
3429
  }
3427
- let gn = 0;
3430
+ let yn = 0;
3428
3431
  function ki(e, t) {
3429
3432
  if (t === void 0) return e.nextSlot++;
3430
3433
  const n = e.slotsByName.get(t);
@@ -3438,7 +3441,7 @@ function Ni(e, t, n) {
3438
3441
  return !1;
3439
3442
  }
3440
3443
  function zl(e, t) {
3441
- const n = gn++;
3444
+ const n = yn++;
3442
3445
  return e.series.set(n, {
3443
3446
  order: n,
3444
3447
  config: t,
@@ -3467,15 +3470,15 @@ function _l(e, t, n) {
3467
3470
  o.config = n, !s && (zt(i) !== zt(n) && (e.materialsDirty = !0), o.buckets = null, z(e, i) !== z(e, n) && G(n) !== void 0 && (e.materialsDirty = !0), (!r || i.xAxisId !== n.xAxisId || i.yAxisId !== n.yAxisId) && (Ke(o), e.materialsDirty = !0), O(e));
3468
3471
  }
3469
3472
  function Bl(e, t) {
3470
- const n = gn++;
3473
+ const n = yn++;
3471
3474
  return e.axes.set(n, { order: n, config: t }), e.materialsDirty = !0, O(e), n;
3472
3475
  }
3473
3476
  function Yl(e, t, n) {
3474
3477
  const o = e.axes.get(t);
3475
3478
  if (o === void 0) return;
3476
- const i = o.config, r = te(i.accessor, n.accessor) && is(i.calendar, n.calendar), s = r && i.id === n.id && i.orientation === n.orientation && i.position === n.position && i.label === n.label && i.tickCount === n.tickCount && i.grid === n.grid && i.time === n.time && i.alignTicks === n.alignTicks && _e(i.ticks, n.ticks) && Bn(i.categories, n.categories) && te(i.categoryLabel, n.categoryLabel) && us(i.domain, n.domain) && ye(e, i) === ye(e, n) && te(i.tickFormat, n.tickFormat);
3479
+ const i = o.config, r = te(i.accessor, n.accessor) && is(i.calendar, n.calendar), s = r && i.id === n.id && i.orientation === n.orientation && i.position === n.position && i.label === n.label && i.tickCount === n.tickCount && i.grid === n.grid && i.time === n.time && i.alignTicks === n.alignTicks && _e(i.ticks, n.ticks) && Yn(i.categories, n.categories) && te(i.categoryLabel, n.categoryLabel) && us(i.domain, n.domain) && ye(e, i) === ye(e, n) && te(i.tickFormat, n.tickFormat);
3477
3480
  if (o.config = n, !s) {
3478
- if ((!Bn(i.categories, n.categories) || i.time !== n.time) && (e.materialsDirty = !0), !r || i.id !== n.id) {
3481
+ if ((!Yn(i.categories, n.categories) || i.time !== n.time) && (e.materialsDirty = !0), !r || i.id !== n.id) {
3479
3482
  for (const l of e.series.values()) Ke(l);
3480
3483
  e.materialsDirty = !0;
3481
3484
  }
@@ -3483,7 +3486,7 @@ function Yl(e, t, n) {
3483
3486
  }
3484
3487
  }
3485
3488
  function Kl(e, t) {
3486
- const n = gn++;
3489
+ const n = yn++;
3487
3490
  return e.limits.set(n, { order: n, config: t }), O(e), n;
3488
3491
  }
3489
3492
  function Ul(e, t, n) {
@@ -3544,7 +3547,7 @@ class Gl {
3544
3547
  /** @internal */
3545
3548
  summaryTimer = null;
3546
3549
  /** @internal */
3547
- wording = Ao;
3550
+ wording = To;
3548
3551
  /** @internal */
3549
3552
  measurer = null;
3550
3553
  /* ---------- Size and DPR ----------
@@ -3587,7 +3590,7 @@ class Gl {
3587
3590
  painted = /* @__PURE__ */ new Map();
3588
3591
  /* ---------- Layout and interaction ----------
3589
3592
  @internal */
3590
- layout = ho;
3593
+ layout = mo;
3591
3594
  /** @internal */
3592
3595
  hysteresis = /* @__PURE__ */ new Map();
3593
3596
  /** @internal */
@@ -3626,9 +3629,9 @@ class Gl {
3626
3629
  keyHighlight = !1;
3627
3630
  /* ---------- Snapshots for the HTML layer ----------
3628
3631
  @internal */
3629
- layoutSnapshot = Hn;
3632
+ layoutSnapshot = Rn;
3630
3633
  /** @internal */
3631
- hoverSnapshot = Rn;
3634
+ hoverSnapshot = Vn;
3632
3635
  /** @internal */
3633
3636
  layoutSubscribers = /* @__PURE__ */ new Set();
3634
3637
  /** @internal */
@@ -3710,13 +3713,13 @@ class Gl {
3710
3713
  the key in the legend and the panel. Opening it changes no pixel of the
3711
3714
  plot, so it only pushes the snapshot. */
3712
3715
  registerDataTable(t) {
3713
- this.dataTable = { id: t, open: !1 }, Re(this);
3716
+ this.dataTable = { id: t, open: !1 }, Ve(this);
3714
3717
  }
3715
3718
  unregisterDataTable() {
3716
- this.dataTable = null, Re(this);
3719
+ this.dataTable = null, Ve(this);
3717
3720
  }
3718
3721
  toggleDataTable() {
3719
- this.dataTable !== null && (this.dataTable = { ...this.dataTable, open: !this.dataTable.open }, Re(this));
3722
+ this.dataTable !== null && (this.dataTable = { ...this.dataTable, open: !this.dataTable.open }, Ve(this));
3720
3723
  }
3721
3724
  setEncoding(t) {
3722
3725
  t !== this.encoding && (this.encoding = t, O(this));
@@ -3818,7 +3821,7 @@ class Gl {
3818
3821
  }
3819
3822
  /* ================= Scheduling ================= */
3820
3823
  markSeriesDirty() {
3821
- no(this);
3824
+ oo(this);
3822
3825
  }
3823
3826
  markOverlayDirty() {
3824
3827
  Gt(this);
@@ -3856,7 +3859,7 @@ class Gl {
3856
3859
  /* ================= Series colours and legend entries ================= */
3857
3860
  /** @internal */
3858
3861
  nameFor(t, n) {
3859
- return dn(this, t, n);
3862
+ return fn(this, t, n);
3860
3863
  }
3861
3864
  legendItems() {
3862
3865
  return si(this);
@@ -3875,15 +3878,15 @@ class Gl {
3875
3878
  }
3876
3879
  /** @internal */
3877
3880
  placements() {
3878
- return fn(this);
3881
+ return hn(this);
3879
3882
  }
3880
3883
  /** @internal */
3881
3884
  lanePx(t, n) {
3882
- return hn(this, t, n);
3885
+ return mn(this, t, n);
3883
3886
  }
3884
3887
  /* ================= Interaction (4.4) ================= */
3885
3888
  setHighlight(t) {
3886
- this.highlight !== t && (this.highlight = t, no(this));
3889
+ this.highlight !== t && (this.highlight = t, oo(this));
3887
3890
  }
3888
3891
  pointerMove(t, n) {
3889
3892
  fi(this, t, n);
@@ -3952,7 +3955,7 @@ class Gl {
3952
3955
  }
3953
3956
  /* ---------- What is spoken ---------- */
3954
3957
  /** @internal */
3955
- percent = (t) => this.wording.percent(Ve(t, this.wording.locale));
3958
+ percent = (t) => this.wording.percent(Ie(t, this.wording.locale));
3956
3959
  /* ---------- The data table (charts-alternatives 01) ---------- */
3957
3960
  /** What the data table lists: one table per x axis for the series on it, one
3958
3961
  per matrix - a matrix has two positions per value, and shares no rows.
@@ -3979,7 +3982,7 @@ class Gl {
3979
3982
  }
3980
3983
  /** @internal */
3981
3984
  share(t) {
3982
- pn(this, t);
3985
+ gn(this, t);
3983
3986
  }
3984
3987
  /** @internal */
3985
3988
  syncedPx() {
@@ -4033,17 +4036,17 @@ class Gl {
4033
4036
  `domain` again. */
4034
4037
  setDomain = (t, n) => {
4035
4038
  const o = { ...this.heldSpans };
4036
- n === null ? delete o[t] : o[t] = [n[0], n[1]], this.heldSpans = o, ln(this);
4039
+ n === null ? delete o[t] : o[t] = [n[0], n[1]], this.heldSpans = o, an(this);
4037
4040
  };
4038
4041
  /** Hides the series `name`, or shows it where it is hidden. */
4039
- toggleSeries = (t) => Gn(this, [t]);
4042
+ toggleSeries = (t) => qn(this, [t]);
4040
4043
  /** Hides the series `names` together, or shows them where every one is
4041
4044
  hidden - a state's legend entry speaks for every band that shows it. */
4042
4045
  toggleNames(t) {
4043
- Gn(this, t);
4046
+ qn(this, t);
4044
4047
  }
4045
4048
  /** Hides every series but `name`. */
4046
- showOnly = (t) => rn(this, So([t], Be(this)));
4049
+ showOnly = (t) => sn(this, Lo([t], Be(this)));
4047
4050
  /** The legend's gesture: shows only the series `names` - or all, where they
4048
4051
  were the only ones visible. `from` is the hidden series it judges by: a
4049
4052
  double click by those before its first click. */
@@ -4051,7 +4054,7 @@ class Gl {
4051
4054
  Hs(this, t, n);
4052
4055
  }
4053
4056
  /** Shows every series again. */
4054
- showAllSeries = () => sn(this, []);
4057
+ showAllSeries = () => ln(this, []);
4055
4058
  /** The hidden series held now, by name - what a double click comes back
4056
4059
  to. */
4057
4060
  hiddenNames = () => this.heldHidden;
@@ -4080,11 +4083,11 @@ class Gl {
4080
4083
  }
4081
4084
  /** @internal */
4082
4085
  zoomAt(t, n) {
4083
- an(this, t, n);
4086
+ cn(this, t, n);
4084
4087
  }
4085
4088
  /** @internal */
4086
4089
  panBy(t) {
4087
- cn(this, t);
4090
+ un(this, t);
4088
4091
  }
4089
4092
  wheel(t) {
4090
4093
  zs(this, t);
@@ -4131,12 +4134,12 @@ class Gl {
4131
4134
  this.layoutSubscribers.delete(t);
4132
4135
  });
4133
4136
  getLayoutSnapshot = () => this.layoutSnapshot;
4134
- getLayoutServerSnapshot = () => Hn;
4137
+ getLayoutServerSnapshot = () => Rn;
4135
4138
  subscribeHover = (t) => (this.hoverSubscribers.add(t), () => {
4136
4139
  this.hoverSubscribers.delete(t);
4137
4140
  });
4138
4141
  getHoverSnapshot = () => this.hoverSnapshot;
4139
- getHoverServerSnapshot = () => Rn;
4142
+ getHoverServerSnapshot = () => Vn;
4140
4143
  }
4141
4144
  const Ii = /* @__PURE__ */ Fi(null);
4142
4145
  function de(e) {
@@ -4244,7 +4247,7 @@ function Zl(e) {
4244
4247
  );
4245
4248
  return be("Matrix", d), null;
4246
4249
  }
4247
- function Pe(e) {
4250
+ function Ce(e) {
4248
4251
  const {
4249
4252
  orientation: t = "y",
4250
4253
  axisId: n,
@@ -4405,7 +4408,7 @@ function Li(e, t) {
4405
4408
  }
4406
4409
  return n;
4407
4410
  }
4408
- const yn = {
4411
+ const xn = {
4409
4412
  outlier: !0,
4410
4413
  run: !0,
4411
4414
  trend: !0,
@@ -4422,13 +4425,13 @@ function oa(e, t) {
4422
4425
  }
4423
4426
  return n;
4424
4427
  }
4425
- function ia(e, t, n = yn.runLength) {
4428
+ function ia(e, t, n = xn.runLength) {
4426
4429
  return Li(
4427
4430
  e.map((o) => na(o, t.center)),
4428
4431
  n
4429
4432
  );
4430
4433
  }
4431
- function ra(e, t = yn.trendLength) {
4434
+ function ra(e, t = xn.trendLength) {
4432
4435
  const n = [];
4433
4436
  for (let i = 1; i < e.length; i++) {
4434
4437
  const r = e[i - 1], s = e[i];
@@ -4451,7 +4454,7 @@ function sa(e, t) {
4451
4454
  return [...i].sort((r, s) => r - s);
4452
4455
  }
4453
4456
  function la(e, t, n = {}) {
4454
- const o = { ...yn, ...n };
4457
+ const o = { ...xn, ...n };
4455
4458
  t.sigma > 0 || W(
4456
4459
  "control-sigma-zero",
4457
4460
  `control limits with sigma ${t.sigma} span no band - a constant reference window, or a given sigma not above 0. Rules 1 and 4 find nothing there; take a window with spread, or a positive given sigma.`
@@ -4527,7 +4530,7 @@ function Xa(e) {
4527
4530
  /* @__PURE__ */ v(Mi, { value: u, data: t, xAxisId: n, yAxisId: o, name: i, format: r, color: s, tone: l }),
4528
4531
  T && /* @__PURE__ */ L(ge, { children: [
4529
4532
  N.map((I) => /* @__PURE__ */ v(
4530
- Pe,
4533
+ Ce,
4531
4534
  {
4532
4535
  value: I.upper,
4533
4536
  axisId: o,
@@ -4537,7 +4540,7 @@ function Xa(e) {
4537
4540
  `zone-${I.k}-upper`
4538
4541
  )),
4539
4542
  N.map((I) => /* @__PURE__ */ v(
4540
- Pe,
4543
+ Ce,
4541
4544
  {
4542
4545
  value: I.lower,
4543
4546
  axisId: o,
@@ -4546,9 +4549,9 @@ function Xa(e) {
4546
4549
  },
4547
4550
  `zone-${I.k}-lower`
4548
4551
  )),
4549
- /* @__PURE__ */ v(Pe, { value: y.center, axisId: o, role: "control" }),
4550
- /* @__PURE__ */ v(Pe, { value: y.upper, axisId: o, role: "control", label: d }),
4551
- /* @__PURE__ */ v(Pe, { value: y.lower, axisId: o, role: "control", label: m })
4552
+ /* @__PURE__ */ v(Ce, { value: y.center, axisId: o, role: "control" }),
4553
+ /* @__PURE__ */ v(Ce, { value: y.upper, axisId: o, role: "control", label: d }),
4554
+ /* @__PURE__ */ v(Ce, { value: y.lower, axisId: o, role: "control", label: m })
4552
4555
  ] }),
4553
4556
  /* @__PURE__ */ v(
4554
4557
  Si,
@@ -4654,7 +4657,7 @@ function Ei({ color: e, mark: t }) {
4654
4657
  if (n !== void 0)
4655
4658
  return /* @__PURE__ */ L("svg", { className: "uc-legend-mark", width: 18, height: 10, viewBox: "0 0 18 10", "aria-hidden": "true", children: [
4656
4659
  /* @__PURE__ */ v("rect", { y: 3, width: 18, height: 7, fill: n.color, fillOpacity: n.opacity }),
4657
- /* @__PURE__ */ v("path", { d: oo({ x: 0, y: 3, width: 18, height: 7 }, n.hatch), stroke: n.color, strokeWidth: 1 }),
4660
+ /* @__PURE__ */ v("path", { d: io({ x: 0, y: 3, width: 18, height: 7 }, n.hatch), stroke: n.color, strokeWidth: 1 }),
4658
4661
  /* @__PURE__ */ v(
4659
4662
  "line",
4660
4663
  {
@@ -4675,7 +4678,7 @@ function Ei({ color: e, mark: t }) {
4675
4678
  // A nested svg clips its hatch to its own swatch.
4676
4679
  /* @__PURE__ */ L("svg", { x: s * o, y: 0, width: o, height: 10, children: [
4677
4680
  /* @__PURE__ */ v("rect", { width: o, height: 10, fill: r.color }),
4678
- /* @__PURE__ */ v("path", { d: oo({ x: 0, y: 0, width: o, height: 10 }, r.hatch), stroke: t.ground, strokeWidth: 1 })
4681
+ /* @__PURE__ */ v("path", { d: io({ x: 0, y: 0, width: o, height: 10 }, r.hatch), stroke: t.ground, strokeWidth: 1 })
4679
4682
  ] }, s)
4680
4683
  )) });
4681
4684
  }
@@ -4696,8 +4699,8 @@ function Ei({ color: e, mark: t }) {
4696
4699
  t.marker !== null && /* @__PURE__ */ v("path", { d: ma(t.marker, 9, 5, 3), fill: e })
4697
4700
  ] });
4698
4701
  }
4699
- function oo(e, t) {
4700
- const n = ko(e, t, ha);
4702
+ function io(e, t) {
4703
+ const n = No(e, t, ha);
4701
4704
  let o = "";
4702
4705
  for (let i = 0; i < n.length; i += 4) o += `M${n[i]} ${n[i + 1]}L${n[i + 2]} ${n[i + 3]}`;
4703
4706
  return o;
@@ -4946,7 +4949,7 @@ function Ma(e, t, n, o) {
4946
4949
  // Inside: against the plot's far edge, 4 px in.
4947
4950
  ...c.inside ? r === "left" ? { right: `${i.x + i.width - (n.x + n.width) + 4}px` } : { left: `${n.x - i.x + 4}px` } : {}
4948
4951
  },
4949
- children: io(c)
4952
+ children: ro(c)
4950
4953
  },
4951
4954
  `limit-${c.id}`
4952
4955
  ) : /* @__PURE__ */ v(
@@ -4960,7 +4963,7 @@ function Ma(e, t, n, o) {
4960
4963
  left: `${Math.round(c.labelLeft - i.x)}px`,
4961
4964
  [r === "top" ? "bottom" : "top"]: `${a}px`
4962
4965
  },
4963
- children: io(c)
4966
+ children: ro(c)
4964
4967
  },
4965
4968
  `limit-${c.id}`
4966
4969
  )
@@ -4971,7 +4974,7 @@ function Ma(e, t, n, o) {
4971
4974
  e.key
4972
4975
  );
4973
4976
  }
4974
- function io(e) {
4977
+ function ro(e) {
4975
4978
  return e.color === void 0 ? e.label : /* @__PURE__ */ L(ge, { children: [
4976
4979
  /* @__PURE__ */ v("span", { className: "uc-limit-mark", style: { color: e.color }, "aria-hidden": "true" }),
4977
4980
  e.label
@@ -5072,7 +5075,7 @@ function $a(e) {
5072
5075
  wording: f,
5073
5076
  encoding: u = "color",
5074
5077
  children: g
5075
- } = e, p = P(() => ({ ...Ao, ...f }), [f]), y = m ?? p.empty, x = B(null), b = B(null), w = B(null), A = B(null), k = B(null), N = B(null), T = qt(), I = typeof r == "number" ? void 0 : r, S = typeof r == "number" ? r : void 0, F = S ?? I?.top, M = S ?? I?.right, Y = S ?? I?.bottom, Q = S ?? I?.left, E = P(
5078
+ } = e, p = P(() => ({ ...To, ...f }), [f]), y = m ?? p.empty, x = B(null), b = B(null), w = B(null), A = B(null), k = B(null), N = B(null), T = qt(), I = typeof r == "number" ? void 0 : r, S = typeof r == "number" ? r : void 0, F = S ?? I?.top, M = S ?? I?.right, Y = S ?? I?.bottom, Q = S ?? I?.left, E = P(
5076
5079
  () => ({
5077
5080
  top: F ?? 8,
5078
5081
  right: M ?? 8,
@@ -5097,15 +5100,15 @@ function $a(e) {
5097
5100
  ie !== void 0 ? n.requestResize(ie.inlineSize, ie.blockSize) : n.requestResize(ke.contentRect.width, ke.contentRect.height);
5098
5101
  });
5099
5102
  we.observe(U);
5100
- const De = () => n.pointerLeave();
5101
- window.addEventListener("blur", De);
5102
- const Fe = (le) => {
5103
+ const Fe = () => n.pointerLeave();
5104
+ window.addEventListener("blur", Fe);
5105
+ const Oe = (le) => {
5103
5106
  U.contains(le.target) || n.pointerLeave();
5104
5107
  };
5105
- document.addEventListener("pointerdown", Fe);
5108
+ document.addEventListener("pointerdown", Oe);
5106
5109
  const se = (le) => n.wheel(le);
5107
5110
  return U.addEventListener("wheel", se, { passive: !1 }), () => {
5108
- U.removeEventListener("wheel", se), window.removeEventListener("blur", De), document.removeEventListener("pointerdown", Fe), we.disconnect(), n.unbind();
5111
+ U.removeEventListener("wheel", se), window.removeEventListener("blur", Fe), document.removeEventListener("pointerdown", Oe), we.disconnect(), n.unbind();
5109
5112
  };
5110
5113
  }, [n]), D(() => {
5111
5114
  n.setData(t);
@@ -5133,13 +5136,13 @@ function $a(e) {
5133
5136
  return $.loading && !$.empty;
5134
5137
  },
5135
5138
  () => !1
5136
- ), _ = Aa(n), $e = _?.leaving === !0, q = {
5139
+ ), _ = Aa(n), Ee = _?.leaving === !0, q = {
5137
5140
  width: o === "100%" ? "100%" : `${o}px`,
5138
5141
  // Without a number: 100% where the frame has a definite height, auto where
5139
5142
  // it has none, and the floor either way (ADR-0050).
5140
5143
  ...i === void 0 ? { height: "100%", minHeight: 300 } : { height: `${i}px` },
5141
5144
  ...a
5142
- }, Ee = ($) => {
5145
+ }, De = ($) => {
5143
5146
  n.drag($.nativeEvent), n.pointerMove($.nativeEvent.offsetX, $.nativeEvent.offsetY);
5144
5147
  };
5145
5148
  return /* @__PURE__ */ v(Ii, { value: n, children: /* @__PURE__ */ L(
@@ -5160,16 +5163,16 @@ function $a(e) {
5160
5163
  "aria-describedby": T,
5161
5164
  "aria-busy": h || void 0,
5162
5165
  "data-stale": K || void 0,
5163
- "data-arriving": $e || void 0,
5166
+ "data-arriving": Ee || void 0,
5164
5167
  tabIndex: C ? 0 : void 0,
5165
5168
  onKeyDown: ($) => {
5166
5169
  n.key($.nativeEvent) && $.preventDefault();
5167
5170
  },
5168
5171
  onFocus: ($) => n.focus(Fa($.currentTarget)),
5169
5172
  onBlur: () => n.blur(),
5170
- onPointerMove: Ee,
5173
+ onPointerMove: De,
5171
5174
  onPointerDown: ($) => {
5172
- n.pointerDown($.nativeEvent), Ee($);
5175
+ n.pointerDown($.nativeEvent), De($);
5173
5176
  },
5174
5177
  onPointerUp: ($) => n.pointerUp($.nativeEvent),
5175
5178
  onPointerCancel: ($) => n.pointerUp($.nativeEvent),
@@ -5474,7 +5477,7 @@ function tc(e, t = {}) {
5474
5477
  Matrix: Zl,
5475
5478
  BoxPlot: Ra,
5476
5479
  setView: (u) => {
5477
- m.applyView(u), r.current = Ae(m.getView());
5480
+ m.applyView(u), r.current = Te(m.getView());
5478
5481
  },
5479
5482
  setDomain: m.setDomain,
5480
5483
  toggleSeries: m.toggleSeries,
@@ -5482,7 +5485,7 @@ function tc(e, t = {}) {
5482
5485
  showAllSeries: m.showAllSeries
5483
5486
  };
5484
5487
  return { held: d, scene: m, parts: f };
5485
- }), { scene: l } = s, a = ee(l.subscribeView, l.getView, l.getView), c = Ae(a);
5488
+ }), { scene: l } = s, a = ee(l.subscribeView, l.getView, l.getView), c = Te(a);
5486
5489
  return D(() => {
5487
5490
  r.current !== c && (r.current = c, l.acted && o?.(a));
5488
5491
  }, [c]), s.held.rows = e, l.onSelect = i ?? null, D(() => {
@@ -5492,14 +5495,14 @@ function tc(e, t = {}) {
5492
5495
  export {
5493
5496
  Xa as ControlChart,
5494
5497
  J as DAY,
5495
- Ao as DEFAULT_CHARTS_WORDING,
5498
+ To as DEFAULT_CHARTS_WORDING,
5496
5499
  Ql as DEFAULT_GRADIENT,
5497
5500
  ja as DataTable,
5498
5501
  pe as HOUR,
5499
5502
  Qa as Legend,
5500
5503
  qa as LimitBand,
5501
- Pe as LimitLine,
5502
- ao as LinearScale,
5504
+ Ce as LimitLine,
5505
+ co as LinearScale,
5503
5506
  X as MINUTE,
5504
5507
  me as SECOND,
5505
5508
  Za as Tooltip,