@mechane-ai/elements 0.48.0 → 0.49.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.
Files changed (99) hide show
  1. package/dist/ai.js +5 -5
  2. package/dist/{article-BXZr10QQ.js → article-yyNPg6VU.js} +10 -10
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +215 -1
  5. package/dist/{categorical-values-BpVq8cFj.js → categorical-values-DCznViFp.js} +1 -1
  6. package/dist/{cells-xVmnQ9oQ.js → cells-CNZE4us2.js} +2 -2
  7. package/dist/charts/cartesian.js +1 -1
  8. package/dist/charts/cells.js +1 -1
  9. package/dist/charts/comparison.js +1 -1
  10. package/dist/charts/distribution.js +1 -1
  11. package/dist/charts/figure.js +12 -12
  12. package/dist/charts/graph.js +1 -1
  13. package/dist/charts/hierarchy.js +1 -1
  14. package/dist/charts/image.js +1 -1
  15. package/dist/charts/matrix.js +1 -1
  16. package/dist/charts/plot.js +6 -6
  17. package/dist/charts/relationship.js +1 -1
  18. package/dist/charts/text.js +1 -1
  19. package/dist/charts/timeline.js +1 -1
  20. package/dist/charts/trend.js +1 -1
  21. package/dist/charts.js +2 -2
  22. package/dist/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
  23. package/dist/collections.js +1 -1
  24. package/dist/content/code.js +1 -1
  25. package/dist/content/diff.js +3 -3
  26. package/dist/content/link.js +1 -1
  27. package/dist/content/markdown.js +2 -2
  28. package/dist/content/tree.js +1 -1
  29. package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
  30. package/dist/content.js +1 -1
  31. package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
  32. package/dist/{dumbbell-plot-DQdTxDeO.js → dumbbell-plot-CMv9llfd.js} +7 -6
  33. package/dist/{embedding-map-CF-J-8JW.js → embedding-map-DC-lgzCq.js} +8 -8
  34. package/dist/feedback.js +1 -1
  35. package/dist/{figure-frame-BJ3REgTA.js → figure-frame-BjFzbl3m.js} +3 -3
  36. package/dist/forms/dates.js +1 -1
  37. package/dist/forms.js +3 -3
  38. package/dist/{image-grid-Dl2sjIMB.js → image-grid-DHqtj_zs.js} +4 -4
  39. package/dist/index.js +1 -1
  40. package/dist/kits/evaluation.js +5 -5
  41. package/dist/kits/interpretability.js +320 -302
  42. package/dist/kits/operations.js +6 -6
  43. package/dist/kits/research.js +558 -0
  44. package/dist/kits/training.js +6 -6
  45. package/dist/layout.js +205 -110
  46. package/dist/lesson.js +2 -2
  47. package/dist/mdx.js +6 -6
  48. package/dist/navigation.js +2 -2
  49. package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
  50. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
  51. package/dist/packages/charts/src/chart-theme.d.ts +1 -1
  52. package/dist/packages/charts/src/plot/plot-surface.d.ts +3 -1
  53. package/dist/packages/collections/src/index.d.ts +1 -1
  54. package/dist/packages/collections/src/metrics.d.ts +9 -1
  55. package/dist/packages/content/src/index.d.ts +2 -0
  56. package/dist/packages/content/src/text-match.d.ts +22 -0
  57. package/dist/packages/core/src/index.d.ts +1 -0
  58. package/dist/packages/core/src/surfaces.d.ts +12 -2
  59. package/dist/packages/forms/src/index.d.ts +2 -0
  60. package/dist/packages/forms/src/token-input.d.ts +24 -0
  61. package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
  62. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
  63. package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
  64. package/dist/packages/kits/src/research/index.d.ts +8 -0
  65. package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
  66. package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
  67. package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
  68. package/dist/packages/layout/src/figure-grid.d.ts +8 -0
  69. package/dist/packages/layout/src/index.d.ts +4 -1
  70. package/dist/packages/layout/src/sidebar.d.ts +7 -0
  71. package/dist/packages/layout/src/workbench.d.ts +4 -1
  72. package/dist/{param-CqKUTHaO.js → param-BE3VMSkH.js} +18 -18
  73. package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
  74. package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
  75. package/dist/{plot-layout-CZVSJ-le.js → plot-layout-Bqe4-0qZ.js} +2 -2
  76. package/dist/{plot-marks-uozcbOIX.js → plot-marks-FVsbFkUs.js} +3 -3
  77. package/dist/{plot-surface-CbVBvgqZ.js → plot-surface-DON6WUmk.js} +11 -11
  78. package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
  79. package/dist/{reference-lines-BDcttOp0.js → reference-lines-hjuD1rRZ.js} +2 -2
  80. package/dist/{scene-0z2gbaDE.js → scene-BP0Ue0R5.js} +8 -8
  81. package/dist/scene.js +1 -1
  82. package/dist/{slope-chart-BKVEAVCs.js → slope-chart-C8eeSgL4.js} +7 -7
  83. package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
  84. package/dist/{src-Dcfq8vE4.js → src-B2rgpWap.js} +48 -14
  85. package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
  86. package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
  87. package/dist/{src-BD6xlvDt.js → src-Dxs3Buo_.js} +203 -137
  88. package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
  89. package/dist/styles2.css +67 -3
  90. package/dist/{time-series-BgzGNOk0.js → time-series-BL933QyA.js} +783 -713
  91. package/dist/{token-heatmap-BrW1OsKD.js → token-heatmap-BB65awva.js} +4 -4
  92. package/dist/{token-predictions-yerq_Oet.js → token-predictions-Pa8eUGan.js} +6 -6
  93. package/dist/{transport-BJweqDPj.js → transport-DzyxVXbL.js} +30 -30
  94. package/dist/{tree-diagram-D09BRqE-.js → tree-diagram-DJhKBiia.js} +6 -6
  95. package/dist/{treemap-CW4WsJNL.js → treemap-CxxgABUg.js} +5 -5
  96. package/dist/{violin-plot-DrtPZ1-T.js → violin-plot-CoAEF_7Z.js} +6 -6
  97. package/dist/{waterfall-DYLSnGjm.js → waterfall-DdoEXEkT.js} +7 -7
  98. package/package.json +5 -1
  99. package/skills/use-elements/references/kits.md +7 -6
@@ -1,28 +1,29 @@
1
- import { k as e } from "./src-CpdJlDhO.js";
2
- import { g as t } from "./src-BD6xlvDt.js";
3
- import { d as n, u as r } from "./src-CExIrXPC.js";
1
+ import { k as e } from "./src-9EJskqB_.js";
2
+ import { x as t } from "./src-Dxs3Buo_.js";
3
+ import { d as n, u as r } from "./src-npqwq3Sa.js";
4
4
  import { n as i, t as a } from "./chart-tones-ei3BC2AL.js";
5
- import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-CZVSJ-le.js";
6
- import { i as y, n as b, r as x, t as S } from "./categorical-values-BpVq8cFj.js";
7
- import { a as C } from "./tone-scope-DKiSw-JR.js";
8
- import { n as w, r as te, t as T } from "./figure-format-B8kRZMlo.js";
5
+ import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-Bqe4-0qZ.js";
6
+ import { i as y, n as b, r as x, t as S } from "./categorical-values-DCznViFp.js";
7
+ import { i as C } from "./chart-link-AE_xuxiP.js";
8
+ import { a as te } from "./tone-scope-DKiSw-JR.js";
9
+ import { n as w, r as ne, t as T } from "./figure-format-B8kRZMlo.js";
9
10
  import { a as E, i as D, o as O, r as k, t as A } from "./scale-C2xgZyZN.js";
10
- import { t as ne } from "./chart-cursor-1mFd48Jc.js";
11
- import { c as re, i as ie, l as ae, n as j, o as M, r as oe, s as N, t as se } from "./figure-frame-BJ3REgTA.js";
12
- import { n as P, t as F } from "./plot-width-DcqtSgzb.js";
13
- import { t as ce } from "./plot-axes-DJkLW4wk.js";
14
- import { a as I, c as L, d as R, f as le, i as z, l as ue, n as B, o as de, r as V, s as fe, t as pe } from "./plot-marks-uozcbOIX.js";
15
- import { n as me, r as he, t as ge } from "./plot-surface-CbVBvgqZ.js";
16
- import { n as _e, t as ve } from "./reference-lines-BDcttOp0.js";
17
- import { n as ye, r as be, t as xe } from "./path-BglsXpnO.js";
18
- import { t as Se } from "./locate-Bcg3QcP4.js";
11
+ import { t as re } from "./chart-cursor-1mFd48Jc.js";
12
+ import { c as ie, i as ae, l as oe, n as j, o as se, r as ce, s as M, t as le } from "./figure-frame-BjFzbl3m.js";
13
+ import { n as N, t as P } from "./plot-width-D3hTycYX.js";
14
+ import { t as ue } from "./plot-axes-D5S9BnBa.js";
15
+ import { a as de, c as F, d as I, f as fe, i as L, l as pe, n as R, o as z, r as me, s as B, t as he } from "./plot-marks-FVsbFkUs.js";
16
+ import { n as ge, r as _e, t as ve } from "./plot-surface-DON6WUmk.js";
17
+ import { n as ye, t as be } from "./reference-lines-hjuD1rRZ.js";
18
+ import { n as xe, r as Se, t as Ce } from "./path-BglsXpnO.js";
19
+ import { t as V } from "./locate-Bcg3QcP4.js";
19
20
  import * as H from "@stylexjs/stylex";
20
- import { createParts as U } from "@ui-sdk/react/primitive";
21
- import { useEffect as Ce, useId as W, useRef as we, useState as G } from "react";
22
- import { bindDrag as K, createChange as q, createSpans as Te, definePrimitive as Ee, dispatch as De } from "@ui-sdk/core";
23
- import { Fragment as Oe, jsx as J, jsxs as Y } from "react/jsx-runtime";
21
+ import { createParts as we } from "@ui-sdk/react/primitive";
22
+ import { useEffect as Te, useId as U, useRef as W, useState as G } from "react";
23
+ import { bindDrag as K, createChange as Ee, createSpans as De, definePrimitive as Oe, dispatch as ke } from "@ui-sdk/core";
24
+ import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
24
25
  // packages/charts/src/cartesian/bar-data.ts
25
- function ke({ composition: e, series: t, categoryIds: n, domain: r }) {
26
+ function X({ composition: e, series: t, categoryIds: n, domain: r }) {
26
27
  if (e === void 0) return;
27
28
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
28
29
  let i = e.annotation;
@@ -39,26 +40,26 @@ function ke({ composition: e, series: t, categoryIds: n, domain: r }) {
39
40
  }
40
41
  }
41
42
  }
42
- var X = 6;
43
- function Z(e, t) {
43
+ var Z = 6;
44
+ function Q(e, t) {
44
45
  return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
45
46
  }
46
- function Q({ marker: e, categoryCount: t, domain: n }) {
47
+ function Ae({ marker: e, categoryCount: t, domain: n }) {
47
48
  let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
48
49
  if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
49
- if (r.some((e) => e.some((e) => !Z(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
50
+ if (r.some((e) => e.some((e) => !Q(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
50
51
  if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
51
52
  let r = e.upper[t] ?? null;
52
53
  if (n === null != (r === null) || n !== null && r !== null && n > r) return "A range marker needs both bounds, with the lower bound at most the upper bound, or neither.";
53
54
  }
54
55
  }
55
- function Ae({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
56
- if (e.length > X) return `Supply at most ${X} bar markers.`;
56
+ function je({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
57
+ if (e.length > Z) return `Supply at most ${Z} bar markers.`;
57
58
  let o = [...e, ...t];
58
59
  if (new Set(o.map((e) => e.id)).size !== o.length || r.some((e) => o.some((t) => t.id === e))) return "Bar series, markers, and annotations require distinct identifiers.";
59
60
  for (let t of e) {
60
61
  if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
61
- let e = Q({
62
+ let e = Ae({
62
63
  marker: t,
63
64
  categoryCount: i.length,
64
65
  domain: a
@@ -72,25 +73,25 @@ function Ae({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r
72
73
  if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
73
74
  if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
74
75
  }
75
- function je({ marker: e, index: t, valueText: n }) {
76
+ function Me({ marker: e, index: t, valueText: n }) {
76
77
  if (e.kind === "tick") return n(e.values[t] ?? null);
77
78
  let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
78
79
  return r === null || i === null ? n(null) : `${n(r)} – ${n(i)}`;
79
80
  }
80
- function Me(e, t) {
81
+ function Ne(e, t) {
81
82
  return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
82
83
  }
83
84
  // packages/charts/src/cartesian/value-labels.ts
84
- var Ne = 6.5, Pe = 14, Fe = 6, Ie = .5;
85
- function Le(e, t) {
86
- let n = (e.text.length + t.text.length) * Ne * Ie + Fe;
87
- return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < Pe;
85
+ var Pe = 6.5, Fe = 14, Ie = 6, Le = .5;
86
+ function Re(e, t) {
87
+ let n = (e.text.length + t.text.length) * Pe * Le + Ie;
88
+ return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < Fe;
88
89
  }
89
- function Re(e) {
90
- return e.filter((t, n) => e.slice(0, n).every((e) => !Le(t, e)));
90
+ function ze(e) {
91
+ return e.filter((t, n) => e.slice(0, n).every((e) => !Re(t, e)));
91
92
  }
92
- function ze({ x: e, text: t, left: n, right: r }) {
93
- let i = t.length * Ne * Ie;
93
+ function Be({ x: e, text: t, left: n, right: r }) {
94
+ let i = t.length * Pe * Le;
94
95
  return e - i < n ? {
95
96
  x: n,
96
97
  anchor: "start"
@@ -103,16 +104,16 @@ function ze({ x: e, text: t, left: n, right: r }) {
103
104
  };
104
105
  }
105
106
  // packages/charts/src/cartesian/bar-overlays.tsx
106
- var Be = 3, Ve = 14, He = .6, Ue = .5;
107
- function We({ marker: e, index: t, span: n, base: r, y: i }) {
108
- let a = n.x + n.width * Ue;
107
+ var Ve = 3, He = 14, Ue = .6, We = .5;
108
+ function Ge({ marker: e, index: t, span: n, base: r, y: i }) {
109
+ let a = n.x + n.width * We;
109
110
  if (e.kind === "tick") {
110
111
  let o = e.values[t] ?? null;
111
112
  if (o === null) return [];
112
113
  let s = {
113
114
  key: "tick",
114
- x1: n.x - Be,
115
- x2: n.x + n.width + Be,
115
+ x1: n.x - Ve,
116
+ x2: n.x + n.width + Ve,
116
117
  y1: i(o),
117
118
  y2: i(o)
118
119
  };
@@ -126,7 +127,7 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
126
127
  }
127
128
  let o = e.lower[t] ?? null, s = e.upper[t] ?? null;
128
129
  if (o === null || s === null) return [];
129
- let c = Math.min(Ve, n.width * He) * Ue;
130
+ let c = Math.min(He, n.width * Ue) * We;
130
131
  return [
131
132
  {
132
133
  key: "whisker",
@@ -151,9 +152,9 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
151
152
  }
152
153
  ];
153
154
  }
154
- function Ge({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a }) {
155
+ function Ke({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a }) {
155
156
  return /* @__PURE__ */ J("g", { children: e.map((e) => /* @__PURE__ */ J("g", { children: t.map((t, o) => {
156
- let s = We({
157
+ let s = Ge({
157
158
  marker: e,
158
159
  index: o,
159
160
  span: n(t, e.seriesId),
@@ -161,27 +162,27 @@ function Ge({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a
161
162
  y: i
162
163
  });
163
164
  return /* @__PURE__ */ J("g", {
164
- ...H.props(P.emphasis, a(t) && P.receded),
165
- children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(fe, {
165
+ ...H.props(N.emphasis, a(t) && N.receded),
166
+ children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(B, {
166
167
  ...n,
167
168
  tone: e.tone ?? "neutral"
168
169
  }, t))
169
170
  }, t);
170
171
  }) }, e.id)) });
171
172
  }
172
- function Ke({ annotations: e, left: t, right: n }) {
173
+ function qe({ annotations: e, left: t, right: n }) {
173
174
  return /* @__PURE__ */ J("g", {
174
175
  "aria-hidden": !0,
175
- children: Re(e).map((e) => {
176
- let r = ze({
176
+ children: ze(e).map((e) => {
177
+ let r = Be({
177
178
  x: e.x,
178
179
  text: e.text,
179
180
  left: t,
180
181
  right: n
181
182
  });
182
183
  return /* @__PURE__ */ J("g", {
183
- ...H.props(P.emphasis, e.isReceded && P.receded),
184
- children: /* @__PURE__ */ J(L, {
184
+ ...H.props(N.emphasis, e.isReceded && N.receded),
185
+ children: /* @__PURE__ */ J(F, {
185
186
  x: r.x,
186
187
  y: e.y,
187
188
  anchor: r.anchor,
@@ -192,7 +193,7 @@ function Ke({ annotations: e, left: t, right: n }) {
192
193
  });
193
194
  }
194
195
  // packages/charts/src/cartesian/composition-bars.tsx
195
- var qe = {
196
+ var Je = {
196
197
  mark: {
197
198
  k3nNDw: "x1hj3fc7",
198
199
  k1ekBW: "xwcsmn1",
@@ -208,17 +209,17 @@ var qe = {
208
209
  "--x-transform": e ?? void 0,
209
210
  "--x-opacity": t ?? void 0
210
211
  }]
211
- }, Je = .18, Ye = .3;
212
- function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a, y: o, isSelected: s, isInspected: c, highlighted: l, toneOf: u }) {
212
+ }, Ye = .18, Xe = .3;
213
+ function Ze({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a, y: o, isSelected: s, isInspected: c, highlighted: l, toneOf: u }) {
213
214
  let d = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
214
215
  function p(e, t) {
215
216
  let n = o(t), r = o(t + e);
216
217
  return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0 && t === 0), Math.abs(r - n))})`;
217
218
  }
218
- let m = d ? Je : +(e.kind === "total");
219
- return /* @__PURE__ */ Y(Oe, { children: [e.kind !== "gap" && /* @__PURE__ */ J("g", {
220
- ...H.props(qe.mark, qe.geometry(p(e.total, 0), m)),
221
- children: /* @__PURE__ */ J(V, {
219
+ let m = d ? Ye : +(e.kind === "total");
220
+ return /* @__PURE__ */ Y(q, { children: [e.kind !== "gap" && /* @__PURE__ */ J("g", {
221
+ ...H.props(Je.mark, Je.geometry(p(e.total, 0), m)),
222
+ children: /* @__PURE__ */ J(me, {
222
223
  x: i,
223
224
  y: 0,
224
225
  width: a,
@@ -230,10 +231,10 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
230
231
  }), f.map((o, f) => {
231
232
  let m = o.values[r];
232
233
  if (m == null) return null;
233
- let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ? Ye : 1 : 0;
234
+ let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ? Xe : 1 : 0;
234
235
  return /* @__PURE__ */ J("g", {
235
- ...H.props(qe.mark, qe.geometry(p(m, h), v)),
236
- children: /* @__PURE__ */ J(V, {
236
+ ...H.props(Je.mark, Je.geometry(p(m, h), v)),
237
+ children: /* @__PURE__ */ J(me, {
237
238
  x: i,
238
239
  y: 0,
239
240
  width: a,
@@ -246,16 +247,16 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
246
247
  })] });
247
248
  }
248
249
  // packages/charts/src/cartesian/bar-chart.tsx
249
- var Ze = { placeholder: {
250
+ var Qe = { placeholder: {
250
251
  kqGvvJ: "x1we84gm",
251
252
  $$css: !0
252
- } }, Qe = 18, $e = 8, et = 14, tt = .08, nt = 8, rt = 8, it = .5;
253
- function at({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i, label: a, summary: o, rows: s = [], x: c = 0, width: l = 0, offset: u, data: d, isLoading: f = !1, ...p }) {
253
+ } }, $e = 18, et = 8, tt = 14, nt = .08, rt = 8, it = 8, at = .5;
254
+ function ot({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i, label: a, summary: o, rows: s = [], x: c = 0, width: l = 0, offset: u, data: d, isLoading: f = !1, ...p }) {
254
255
  let m = f && e.length === 0 && p.report?.seriesValues === void 0;
255
256
  return /* @__PURE__ */ Y(j, {
256
257
  ...p,
257
258
  series: e,
258
- seriesLegend: m ? /* @__PURE__ */ J(N, {}) : /* @__PURE__ */ J(M, {
259
+ seriesLegend: m ? /* @__PURE__ */ J(M, {}) : /* @__PURE__ */ J(se, {
259
260
  id: i,
260
261
  label: a,
261
262
  summary: o,
@@ -268,11 +269,11 @@ function at({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i
268
269
  width: l,
269
270
  offset: u
270
271
  }),
271
- children: [d !== void 0 && /* @__PURE__ */ J(ae, { ...d }), r]
272
+ children: [d !== void 0 && /* @__PURE__ */ J(oe, { ...d }), r]
272
273
  });
273
274
  }
274
- function ot() {
275
- let e = C();
275
+ function st() {
276
+ let e = te();
276
277
  return (t) => t.map((t, n) => ({
277
278
  id: t.id,
278
279
  label: t.label,
@@ -283,12 +284,12 @@ function ot() {
283
284
  })
284
285
  }));
285
286
  }
286
- function st({ title: e = "Loading chart", series: t = [], height: n = "compact", ...i }) {
287
- let a = W(), o = ot()(t);
287
+ function ct({ title: e = "Loading chart", series: t = [], height: n = "compact", ...i }) {
288
+ let a = U(), o = st()(t);
288
289
  return /* @__PURE__ */ J("div", {
289
290
  "aria-hidden": !0,
290
291
  inert: !0,
291
- children: /* @__PURE__ */ J(at, {
292
+ children: /* @__PURE__ */ J(ot, {
292
293
  ...i,
293
294
  title: e,
294
295
  status: "loading",
@@ -296,16 +297,16 @@ function st({ title: e = "Loading chart", series: t = [], height: n = "compact",
296
297
  inspectionId: a,
297
298
  isLoading: !0,
298
299
  children: /* @__PURE__ */ J("div", {
299
- ...H.props(P.plot, Ze.placeholder),
300
+ ...H.props(N.plot, Qe.placeholder),
300
301
  children: /* @__PURE__ */ J(r, { height: f[n] })
301
302
  })
302
303
  })
303
304
  });
304
305
  }
305
- function ct(e, t) {
306
+ function lt(e, t) {
306
307
  return Array.from({ length: t }, (t, n) => e.reduce((e, t) => e + Math.max(0, t.values[n] ?? 0), 0));
307
308
  }
308
- function lt({ categories: e, series: t, domain: n, mode: r }) {
309
+ function ut({ categories: e, series: t, domain: n, mode: r }) {
309
310
  if (e.length > x.items || t.length > x.series) return `Choose a window with at most ${x.items} categories and ${x.series} series.`;
310
311
  if (O(n) !== void 0 || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
311
312
  if (!o(e) || !o(t)) return "Bar categories and series require unique identifiers.";
@@ -314,10 +315,10 @@ function lt({ categories: e, series: t, domain: n, mode: r }) {
314
315
  if (i.values.some((e) => e !== null && E(e, n))) return "Bar values must be finite and within the supplied domain.";
315
316
  if (r === "stacked" && i.values.some((e) => e === null || e < 0)) return "Stacked bars require present nonnegative values.";
316
317
  }
317
- if (r === "stacked" && ct(t, e.length).some((e) => e > n[1])) return "Stacked bar totals must fit the supplied domain.";
318
+ if (r === "stacked" && lt(t, e.length).some((e) => e > n[1])) return "Stacked bar totals must fit the supplied domain.";
318
319
  }
319
- function ut({ categories: e, series: t, mode: n, composition: r, referenceLines: i, markers: a }) {
320
- let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ? ct(t, e.length) : [], l = r?.focusedSeries?.values ?? [], u = r?.buckets.map((e) => e.kind === "gap" ? null : e.total) ?? [], d = a.flatMap((e) => e.kind === "tick" ? e.values : [...e.lower, ...e.upper]);
320
+ function dt({ categories: e, series: t, mode: n, composition: r, referenceLines: i, markers: a }) {
321
+ let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ? lt(t, e.length) : [], l = r?.focusedSeries?.values ?? [], u = r?.buckets.map((e) => e.kind === "gap" ? null : e.total) ?? [], d = a.flatMap((e) => e.kind === "tick" ? e.values : [...e.lower, ...e.upper]);
321
322
  return [
322
323
  ...s,
323
324
  ...c,
@@ -328,15 +329,15 @@ function ut({ categories: e, series: t, mode: n, composition: r, referenceLines:
328
329
  ...r?.annotation === void 0 ? [] : [r.annotation.value]
329
330
  ];
330
331
  }
331
- function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFormat: i, tickFormat: a, valueLabel: o, highlighted: s, selected: c, onSelectedChange: l, height: d = "compact", composition: f, referenceLines: h = [], markers: g = [], annotations: _ = [], emphasizedCategoryIds: v = [], ...y }) {
332
- let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title: w } = x, T = f?.focusedSeries, E = W(), D = W(), { ref: O, width: k, height: ie } = he(d), ae = C(), j = ot();
333
- if (x.status === "loading") return /* @__PURE__ */ J(st, {
332
+ function ft({ categories: e, series: t, domain: n, mode: r = "grouped", valueFormat: i, tickFormat: a, valueLabel: o, highlighted: s, selected: c, onSelectedChange: l, height: d = "compact", composition: f, referenceLines: h = [], markers: g = [], annotations: _ = [], emphasizedCategoryIds: v = [], ...y }) {
333
+ let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title: C } = x, w = f?.focusedSeries, T = U(), E = U(), { ref: D, width: O, height: k } = _e(d), ae = te(), oe = st();
334
+ if (x.status === "loading") return /* @__PURE__ */ J(ct, {
334
335
  ...x,
335
336
  series: t,
336
337
  height: d
337
338
  });
338
- let M = n ?? u({
339
- values: ut({
339
+ let j = n ?? u({
340
+ values: dt({
340
341
  categories: e,
341
342
  series: t,
342
343
  mode: r,
@@ -345,88 +346,88 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
345
346
  markers: g
346
347
  }),
347
348
  isZeroBased: !0
348
- }), N = T === void 0 ? void 0 : lt({
349
+ }), se = w === void 0 ? void 0 : ut({
349
350
  categories: e,
350
- series: [T],
351
- domain: M,
351
+ series: [w],
352
+ domain: j,
352
353
  mode: "grouped"
353
- }), F = lt({
354
+ }), M = ut({
354
355
  categories: e,
355
356
  series: t,
356
- domain: M,
357
+ domain: j,
357
358
  mode: r
358
- }) ?? N, I = e.map((e) => e.id), L = Ae({
359
+ }) ?? se, P = e.map((e) => e.id), de = je({
359
360
  markers: g,
360
361
  annotations: _,
361
362
  emphasizedCategoryIds: v,
362
- seriesIds: [...t, ...T === void 0 ? [] : [T]].map((e) => e.id),
363
- categoryIds: I,
364
- domain: M
365
- }) ?? _e({
363
+ seriesIds: [...t, ...w === void 0 ? [] : [w]].map((e) => e.id),
364
+ categoryIds: P,
365
+ domain: j
366
+ }) ?? ye({
366
367
  lines: h,
367
- domain: M
368
- }), R = F ?? ke({
368
+ domain: j
369
+ }), F = M ?? X({
369
370
  composition: f,
370
371
  series: t,
371
- categoryIds: I,
372
- domain: M
373
- }) ?? L;
374
- if (R !== void 0) return /* @__PURE__ */ J(oe, {
372
+ categoryIds: P,
373
+ domain: j
374
+ }) ?? de;
375
+ if (F !== void 0) return /* @__PURE__ */ J(ce, {
375
376
  ...x,
376
- message: R
377
+ message: F
377
378
  });
378
- function z(e) {
379
- return te({
379
+ function I(e) {
380
+ return ne({
380
381
  value: e,
381
382
  locale: S,
382
383
  format: i
383
384
  });
384
385
  }
385
- let ue = T !== void 0 && !t.some((e) => e.id === T.id), B = [...t, ...ue ? [T] : []], de = new Map(B.map((e, t) => [e.id, ae({
386
+ let L = w !== void 0 && !t.some((e) => e.id === w.id), pe = [...t, ...L ? [w] : []], R = new Map(pe.map((e, t) => [e.id, ae({
386
387
  id: e.id,
387
388
  tone: e.tone,
388
389
  index: t
389
390
  })]));
390
- function fe(e) {
391
- return de.get(e) ?? "neutral";
391
+ function z(e) {
392
+ return R.get(e) ?? "neutral";
392
393
  }
393
- let pe = f === void 0 ? void 0 : {
394
- id: E,
394
+ let B = f === void 0 ? void 0 : {
395
+ id: T,
395
396
  label: f.contextLabel,
396
397
  tone: "neutral",
397
398
  values: f.buckets.map((e) => e.kind === "gap" ? null : e.total)
398
- }, ye = pe === void 0 ? t : [pe, ...B], be = (T !== void 0 && pe !== void 0 ? [T, pe] : t).map((e) => ({
399
+ }, he = B === void 0 ? t : [B, ...pe], xe = (w !== void 0 && B !== void 0 ? [w, B] : t).map((e) => ({
399
400
  id: e.id,
400
401
  label: e.label,
401
- tone: e.id === E ? "neutral" : fe(e.id)
402
- })), xe = g.map((e) => ({
402
+ tone: e.id === T ? "neutral" : z(e.id)
403
+ })), Se = g.map((e) => ({
403
404
  id: e.id,
404
405
  label: e.label,
405
406
  tone: e.tone ?? "neutral",
406
407
  shape: e.kind
407
408
  }));
408
- function Se(n) {
409
- let r = e[n], i = f?.buckets[n], a = T !== void 0 && pe !== void 0 ? [T, pe] : pe === void 0 || i?.kind === "parts" ? t : [], o = i === void 0 ? void 0 : i.kind === "gap" ? "No reported value" : z(i.total), s = a.map((e) => ({
409
+ function Ce(n) {
410
+ let r = e[n], i = f?.buckets[n], a = w !== void 0 && B !== void 0 ? [w, B] : B === void 0 || i?.kind === "parts" ? t : [], o = i === void 0 ? void 0 : i.kind === "gap" ? "No reported value" : I(i.total), s = a.map((e) => ({
410
411
  id: e.id,
411
412
  label: e.label,
412
- tone: e.id === E ? "neutral" : fe(e.id),
413
- value: z(e.values[n] ?? null)
413
+ tone: e.id === T ? "neutral" : z(e.id),
414
+ value: I(e.values[n] ?? null)
414
415
  })), c = g.map((e) => ({
415
416
  id: e.id,
416
417
  label: e.label,
417
418
  tone: e.tone ?? "neutral",
418
419
  shape: e.kind,
419
- value: je({
420
+ value: Me({
420
421
  marker: e,
421
422
  index: n,
422
- valueText: z
423
+ valueText: I
423
424
  })
424
425
  })), l = h.map((e) => ({
425
426
  id: e.id,
426
427
  label: e.label,
427
428
  tone: e.tone ?? "neutral",
428
429
  shape: "dashed",
429
- value: z(e.value)
430
+ value: I(e.value)
430
431
  }));
431
432
  return {
432
433
  category: r,
@@ -440,9 +441,9 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
440
441
  notes: _.filter((e) => e.categoryId === r?.id).map((e) => e.label)
441
442
  };
442
443
  }
443
- let U = f?.annotation, Ce = _.length > 0 || U !== void 0, we = p({
444
- width: k,
445
- height: ie,
444
+ let V = f?.annotation, we = _.length > 0 || V !== void 0, Te = p({
445
+ width: O,
446
+ height: k,
446
447
  direction: "columns",
447
448
  categories: e.map((e) => ({
448
449
  id: e.id,
@@ -453,45 +454,45 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
453
454
  format: i,
454
455
  tickFormat: a
455
456
  },
456
- valueDomain: M,
457
+ valueDomain: j,
457
458
  locale: S,
458
- topInset: Ce ? Qe : 0,
459
+ topInset: we ? $e : 0,
459
460
  hasValueTitle: o !== void 0
460
- }), { box: G, band: K } = we, q = we.value.position, Te = A({
461
+ }), { box: W, band: G } = Te, K = Te.value.position, Ee = A({
461
462
  ids: t.map((e) => e.id),
462
- range: [0, K.bandwidth],
463
- padding: tt
464
- }), Ee = r === "stacked" || f !== void 0;
465
- function De(e) {
466
- return K.start(e) ?? G.left;
467
- }
463
+ range: [0, G.bandwidth],
464
+ padding: nt
465
+ }), De = r === "stacked" || f !== void 0;
468
466
  function Oe(e) {
469
- return De(e) + K.bandwidth * it;
467
+ return G.start(e) ?? W.left;
468
+ }
469
+ function ke(e) {
470
+ return Oe(e) + G.bandwidth * at;
470
471
  }
471
- function X(e, t) {
472
- let n = De(e);
473
- return Ee ? {
472
+ function q(e, t) {
473
+ let n = Oe(e);
474
+ return De ? {
474
475
  x: n,
475
- width: K.bandwidth
476
+ width: G.bandwidth
476
477
  } : {
477
- x: n + (Te.start(t) ?? 0),
478
- width: Te.bandwidth
478
+ x: n + (Ee.start(t) ?? 0),
479
+ width: Ee.bandwidth
479
480
  };
480
481
  }
481
482
  function Z(e, n) {
482
- if (!Ee) return t.find((e) => e.id === n)?.values[e] ?? null;
483
+ if (!De) return t.find((e) => e.id === n)?.values[e] ?? null;
483
484
  let r = t.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
484
485
  return r.length === 0 ? null : r.reduce((e, t) => e + t, 0);
485
486
  }
486
487
  function Q(e, n) {
487
- let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = Ee ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = f?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [Me(t, e)].filter((e) => e !== null));
488
+ let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = De ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = f?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [Ne(t, e)].filter((e) => e !== null));
488
489
  return Math.max(0, i, o, ...s);
489
490
  }
490
- function Ne(e) {
491
- return Math.max(et, q(e) - $e);
491
+ function Ae(e) {
492
+ return Math.max(tt, K(e) - et);
492
493
  }
493
494
  let Pe = {
494
- label: `${w} observations`,
495
+ label: `${C} observations`,
495
496
  columns: [{
496
497
  id: "category",
497
498
  label: "Category"
@@ -502,83 +503,83 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
502
503
  rows: [...e.map((e, t) => ({
503
504
  id: e.id,
504
505
  values: [e.label, [
505
- ...ye.map((e) => `${e.label}: ${z(e.values[t] ?? null)}`),
506
- ...g.map((e) => `${e.label}: ${je({
506
+ ...he.map((e) => `${e.label}: ${I(e.values[t] ?? null)}`),
507
+ ...g.map((e) => `${e.label}: ${Me({
507
508
  marker: e,
508
509
  index: t,
509
- valueText: z
510
+ valueText: I
510
511
  })}`),
511
512
  ..._.filter((t) => t.categoryId === e.id).map((e) => e.label)
512
513
  ].join(" · ")]
513
514
  })), ...h.map((e) => ({
514
515
  id: `reference:${e.id}`,
515
- values: [e.label, z(e.value)]
516
+ values: [e.label, I(e.value)]
516
517
  }))]
517
518
  };
518
519
  return /* @__PURE__ */ J(ee, {
519
520
  items: e,
520
- readout: (e) => re(Se(I.indexOf(e))),
521
- locate: (e) => K.idAt(e.x / e.width * G.width),
521
+ readout: (e) => ie(Ce(P.indexOf(e))),
522
+ locate: (e) => G.idAt(e.x / e.width * W.width),
522
523
  selected: c ?? null,
523
524
  onSelect: l,
524
525
  render: (n, { inspected: i, cursor: a }) => {
525
- let u = Se(I.indexOf(i ?? ""));
526
+ let u = Ce(P.indexOf(i ?? ""));
526
527
  function d(e) {
527
528
  let t = v.includes(e);
528
529
  return v.length > 0 && !t && i !== e;
529
530
  }
530
- let p = U === void 0 || !I.includes(U.categoryId) ? [] : [{
531
- id: `composition:${U.categoryId}`,
532
- text: U.label,
533
- x: Oe(U.categoryId),
534
- y: Ne(U.value),
535
- isReceded: d(U.categoryId)
531
+ let p = V === void 0 || !P.includes(V.categoryId) ? [] : [{
532
+ id: `composition:${V.categoryId}`,
533
+ text: V.label,
534
+ x: ke(V.categoryId),
535
+ y: Ae(V.value),
536
+ isReceded: d(V.categoryId)
536
537
  }], ee = _.map((e) => {
537
538
  let t = e.seriesId === void 0 ? {
538
- x: De(e.categoryId),
539
- width: K.bandwidth
540
- } : X(e.categoryId, e.seriesId);
539
+ x: Oe(e.categoryId),
540
+ width: G.bandwidth
541
+ } : q(e.categoryId, e.seriesId);
541
542
  return {
542
543
  id: e.id,
543
544
  text: e.label,
544
- x: t.x + t.width * it,
545
- y: Ne(Q(I.indexOf(e.categoryId), e.seriesId)),
545
+ x: t.x + t.width * at,
546
+ y: Ae(Q(P.indexOf(e.categoryId), e.seriesId)),
546
547
  isReceded: d(e.categoryId)
547
548
  };
548
549
  }), y = [...p, ...ee];
549
- return /* @__PURE__ */ J(at, {
550
+ return /* @__PURE__ */ J(ot, {
550
551
  ...x,
551
552
  figure: n,
552
- legend: [...be, ...xe],
553
- layoutLegend: [...j(t), ...xe],
553
+ legend: [...xe, ...Se],
554
+ layoutLegend: [...oe(t), ...Se],
554
555
  notes: u.notes,
555
- inspectionId: D,
556
+ inspectionId: E,
556
557
  label: u.label,
557
558
  titleDetail: u.category === void 0 ? void 0 : [u.category.axisLabel ?? u.category.label, u.summary].filter(Boolean).join(" · "),
558
559
  summary: u.summary,
559
560
  rows: u.rows,
560
- x: Oe(i ?? ""),
561
- width: k,
562
- offset: K.bandwidth * it + rt,
561
+ x: ke(i ?? ""),
562
+ width: O,
563
+ offset: G.bandwidth * at + it,
563
564
  data: Pe,
564
- children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(se, { children: b }) : /* @__PURE__ */ Y(me, {
565
- plotRef: O,
566
- box: G,
565
+ children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(le, { children: b }) : /* @__PURE__ */ Y(ge, {
566
+ plotRef: D,
567
+ box: W,
567
568
  label: m({
568
- title: w,
569
+ title: C,
569
570
  marks: "categories",
570
571
  isSelectable: l !== void 0
571
572
  }),
572
- readoutId: D,
573
+ readoutId: E,
573
574
  children: [
574
- /* @__PURE__ */ J(ce, {
575
- box: G,
576
- xTicks: we.bandTicks,
577
- yTicks: we.valueTicks,
575
+ /* @__PURE__ */ J(ue, {
576
+ box: W,
577
+ xTicks: Te.bandTicks,
578
+ yTicks: Te.valueTicks,
578
579
  yTitle: o
579
580
  }),
580
- /* @__PURE__ */ Y(ge, {
581
- box: G,
581
+ /* @__PURE__ */ Y(ve, {
582
+ box: W,
582
583
  children: [
583
584
  e.map((e, n) => {
584
585
  let a = f?.buckets[n], o = {
@@ -588,66 +589,66 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
588
589
  return a === void 0 ? t.map((i, a) => {
589
590
  let c = i.values[n];
590
591
  if (c == null || r === "stacked" && c === 0) return null;
591
- let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = q(l), f = q(l + c), p = s != null && s !== i.id, m = X(e.id, i.id);
592
- return /* @__PURE__ */ J(V, {
592
+ let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = K(l), f = K(l + c), p = s != null && s !== i.id, m = q(e.id, i.id);
593
+ return /* @__PURE__ */ J(me, {
593
594
  ...o,
594
595
  x: m.x,
595
596
  y: Math.min(u, f),
596
597
  width: m.width,
597
598
  height: Math.max(+(c === 0), Math.abs(f - u)),
598
- tone: fe(i.id),
599
+ tone: z(i.id),
599
600
  emphasis: p || d(e.id) ? "receded" : "normal",
600
601
  mark: t.length === 1 ? e.id : `${e.id}:${i.id}`
601
602
  }, `${e.id}:${i.id}`);
602
603
  }) : /* @__PURE__ */ J("g", {
603
- ...H.props(P.emphasis, d(e.id) && P.receded),
604
- children: /* @__PURE__ */ J(Xe, {
604
+ ...H.props(N.emphasis, d(e.id) && N.receded),
605
+ children: /* @__PURE__ */ J(Ze, {
605
606
  ...o,
606
607
  bucket: a,
607
608
  series: t,
608
- focusedSeries: T,
609
+ focusedSeries: w,
609
610
  index: n,
610
- x: De(e.id),
611
- width: K.bandwidth,
612
- y: q,
611
+ x: Oe(e.id),
612
+ width: G.bandwidth,
613
+ y: K,
613
614
  highlighted: s,
614
- toneOf: fe
615
+ toneOf: z
615
616
  })
616
617
  }, e.id);
617
618
  }),
618
- /* @__PURE__ */ J(le, {
619
- x1: G.left,
620
- x2: G.right,
621
- y1: q(0),
622
- y2: q(0)
619
+ /* @__PURE__ */ J(fe, {
620
+ x1: W.left,
621
+ x2: W.right,
622
+ y1: K(0),
623
+ y2: K(0)
623
624
  }),
624
- /* @__PURE__ */ J(Ge, {
625
+ /* @__PURE__ */ J(Ke, {
625
626
  markers: g,
626
- categoryIds: I,
627
- span: X,
627
+ categoryIds: P,
628
+ span: q,
628
629
  barTop: Z,
629
- y: q,
630
+ y: K,
630
631
  isReceded: d
631
632
  })
632
633
  ]
633
634
  }),
634
- /* @__PURE__ */ J(ve, {
635
+ /* @__PURE__ */ J(be, {
635
636
  lines: h,
636
- box: G,
637
- position: q,
638
- valueText: z,
639
- avoid: Re(y)
637
+ box: W,
638
+ position: K,
639
+ valueText: I,
640
+ avoid: ze(y)
640
641
  }),
641
- /* @__PURE__ */ J(Ke, {
642
+ /* @__PURE__ */ J(qe, {
642
643
  annotations: y,
643
- left: G.left,
644
- right: G.right
644
+ left: W.left,
645
+ right: W.right
645
646
  }),
646
- a !== null && /* @__PURE__ */ J(ne, {
647
- x: Oe(a),
648
- top: G.top,
649
- bottom: G.bottom,
650
- width: Math.max(nt, K.bandwidth)
647
+ a !== null && /* @__PURE__ */ J(re, {
648
+ x: ke(a),
649
+ top: W.top,
650
+ bottom: W.bottom,
651
+ width: Math.max(rt, G.bandwidth)
651
652
  })
652
653
  ]
653
654
  })
@@ -656,13 +657,13 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
656
657
  });
657
658
  }
658
659
  // packages/charts/src/cartesian/breakdown-bar.tsx
659
- var ft = {
660
+ var pt = {
660
661
  kzqmXN: "x5lhr3w",
661
662
  kGVxlE: "x1iotiob",
662
663
  kZKoxP: "x5yr21d",
663
664
  $$css: !0
664
- }, pt = { segment: (e, t, n) => [
665
- ft,
665
+ }, mt = { segment: (e, t, n) => [
666
+ pt,
666
667
  {
667
668
  kWkggS: t == null ? t : "xl8spv7",
668
669
  $$css: !0
@@ -672,24 +673,24 @@ var ft = {
672
673
  "--x-backgroundColor": t ?? void 0,
673
674
  "--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
674
675
  }
675
- ] }, mt = 100;
676
- function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange: o, ...s }) {
677
- let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f = C();
678
- if (l.status === "loading") return /* @__PURE__ */ J(ie, {
676
+ ] }, ht = 100;
677
+ function gt({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange: o, ...s }) {
678
+ let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f = te();
679
+ if (l.status === "loading") return /* @__PURE__ */ J(ae, {
679
680
  ...l,
680
681
  height: "compact"
681
682
  });
682
683
  let p = y(e), m = e.reduce((e, t) => e + (t.value ?? 0), 0), h = 2 ** -52 * Math.max(m, t, 1) * e.length;
683
- if (p !== void 0) return /* @__PURE__ */ J(oe, {
684
+ if (p !== void 0) return /* @__PURE__ */ J(ce, {
684
685
  ...l,
685
686
  message: p
686
687
  });
687
- if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(oe, {
688
+ if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(ce, {
688
689
  ...l,
689
690
  message: "The total must be finite and at least the sum of recorded values."
690
691
  });
691
692
  function g(e) {
692
- return te({
693
+ return ne({
693
694
  value: e,
694
695
  locale: u,
695
696
  format: n
@@ -713,13 +714,13 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
713
714
  render: (n, r) => /* @__PURE__ */ J(j, {
714
715
  ...l,
715
716
  figure: n,
716
- children: e.length === 0 ? /* @__PURE__ */ J(se, { children: c }) : /* @__PURE__ */ Y(Oe, { children: [
717
+ children: e.length === 0 ? /* @__PURE__ */ J(le, { children: c }) : /* @__PURE__ */ Y(q, { children: [
717
718
  /* @__PURE__ */ J("div", {
718
719
  "aria-hidden": !0,
719
720
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
720
721
  children: e.map((e, n) => {
721
722
  let r = _[n]?.tone ?? "neutral";
722
- return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(pt.segment(t === 0 ? 0 : e.value / t * mt, a[r], i[r])) }, e.id);
723
+ return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(mt.segment(t === 0 ? 0 : e.value / t * ht, a[r], i[r])) }, e.id);
723
724
  })
724
725
  }),
725
726
  /* @__PURE__ */ J(S, {
@@ -741,15 +742,15 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
741
742
  });
742
743
  }
743
744
  // packages/charts/src/cartesian/bridge-data.ts
744
- function gt(e) {
745
+ function _t(e) {
745
746
  return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
746
747
  }
747
- function _t(e) {
748
+ function vt(e) {
748
749
  let t = e.map((e) => e.kind === "total" ? 0 : e.value);
749
750
  return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
750
751
  }
751
- function vt({ step: e, before: t, after: n }) {
752
- let r = e.tone ?? gt(e);
752
+ function yt({ step: e, before: t, after: n }) {
753
+ let r = e.tone ?? _t(e);
753
754
  switch (e.kind) {
754
755
  case "start": return {
755
756
  step: e,
@@ -771,18 +772,18 @@ function vt({ step: e, before: t, after: n }) {
771
772
  };
772
773
  }
773
774
  }
774
- function yt(e) {
775
- return e.map((t, n) => vt({
775
+ function bt(e) {
776
+ return e.map((t, n) => yt({
776
777
  step: t,
777
- before: _t(e.slice(0, n)),
778
- after: _t(e.slice(0, n + 1))
778
+ before: vt(e.slice(0, n)),
779
+ after: vt(e.slice(0, n + 1))
779
780
  }));
780
781
  }
781
- function bt(e) {
782
+ function xt(e) {
782
783
  let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
783
784
  return n === r ? [n, n + 1] : [n, r];
784
785
  }
785
- function xt({ steps: e, domain: t }) {
786
+ function St({ steps: e, domain: t }) {
786
787
  if (e.length > x.items) return `Choose a bridge with at most ${x.items} steps.`;
787
788
  if (!o(e)) return "Bridge steps require unique identifiers.";
788
789
  if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
@@ -791,36 +792,36 @@ function xt({ steps: e, domain: t }) {
791
792
  let t = e.kind === "total" ? null : e.value;
792
793
  return t !== null && !Number.isFinite(t);
793
794
  })) return "Bridge values must be finite numbers or explicit missing changes.";
794
- let n = bt(yt(e));
795
+ let n = xt(bt(e));
795
796
  if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
796
797
  let r = t[0] <= n[0] && t[1] >= n[1];
797
798
  if (!D(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
798
799
  }
799
800
  // packages/charts/src/cartesian/bridge-chart.tsx
800
- var St = 12, Ct = 6, wt = 14, Tt = 12, Et = 8, Dt = 8, Ot = .5;
801
- function kt(e) {
801
+ var Ct = 12, wt = 6, Tt = 14, Et = 12, Dt = 8, Ot = 8, kt = .5;
802
+ function At(e) {
802
803
  return typeof e == "function" ? (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}` : {
803
804
  ...e,
804
805
  signDisplay: "exceptZero"
805
806
  };
806
807
  }
807
- function At({ level: e, valueText: t, changeText: n }) {
808
+ function jt({ level: e, valueText: t, changeText: n }) {
808
809
  return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
809
810
  }
810
- function jt({ level: e, valueText: t, changeText: n }) {
811
+ function Mt({ level: e, valueText: t, changeText: n }) {
811
812
  return e.step.kind === "change" ? e.step.value === null ? T : n(e.step.value) : e.to === null ? T : t(e.to);
812
813
  }
813
- function Mt({ level: e, valueText: t }) {
814
+ function Nt({ level: e, valueText: t }) {
814
815
  return e.from === null || e.to === null ? T : `${t(e.from)} → ${t(e.to)}`;
815
816
  }
816
- function Nt(e, t, n) {
817
+ function Pt(e, t, n) {
817
818
  if (e.from === null || e.to === null) {
818
- let r = Math.min(n - Tt, t(e.from ?? 0) - Tt * Ot);
819
+ let r = Math.min(n - Et, t(e.from ?? 0) - Et * kt);
819
820
  return {
820
821
  isKnown: !1,
821
822
  top: r,
822
- height: Tt,
823
- labelY: r - Ct
823
+ height: Et,
824
+ labelY: r - wt
824
825
  };
825
826
  }
826
827
  let r = Math.max(e.from, e.to), i = Math.min(e.from, e.to), a = t(r), o = r <= 0 && i < 0;
@@ -828,41 +829,41 @@ function Nt(e, t, n) {
828
829
  isKnown: !0,
829
830
  top: a,
830
831
  height: Math.max(1, t(i) - a),
831
- labelY: o ? t(i) + wt : a - Ct
832
+ labelY: o ? t(i) + Tt : a - wt
832
833
  };
833
834
  }
834
- function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r, valueLabel: i, domain: a, referenceLines: o = [], selected: s, onSelectedChange: c, height: l = "regular", ...d }) {
835
- let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v = he(l), y = W();
836
- if (h.status === "loading") return /* @__PURE__ */ J(ie, {
835
+ function Ft({ steps: e, valueFormat: t, changeFormat: n = At(t), tickFormat: r, valueLabel: i, domain: a, referenceLines: o = [], selected: s, onSelectedChange: c, height: l = "regular", ...d }) {
836
+ let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v = _e(l), y = U();
837
+ if (h.status === "loading") return /* @__PURE__ */ J(ae, {
837
838
  ...h,
838
839
  height: l
839
840
  });
840
- let b = yt(e), x = bt(b), S = a ?? u({ values: [...x, ...o.map((e) => e.value)] }), C = xt({
841
+ let b = bt(e), x = xt(b), S = a ?? u({ values: [...x, ...o.map((e) => e.value)] }), C = St({
841
842
  steps: e,
842
843
  domain: a
843
- }) ?? _e({
844
+ }) ?? ye({
844
845
  lines: o,
845
846
  domain: S
846
847
  });
847
- if (C !== void 0) return /* @__PURE__ */ J(oe, {
848
+ if (C !== void 0) return /* @__PURE__ */ J(ce, {
848
849
  ...h,
849
850
  message: C
850
851
  });
851
- function w(e) {
852
- return (t) => te({
852
+ function te(e) {
853
+ return (t) => ne({
853
854
  value: t,
854
855
  locale: g,
855
856
  format: e
856
857
  });
857
858
  }
858
- let T = w(t), E = w(n), D = o.map((e) => ({
859
+ let w = te(t), T = te(n), E = o.map((e) => ({
859
860
  id: e.id,
860
861
  label: e.label,
861
862
  tone: e.tone ?? "neutral",
862
863
  shape: "dashed",
863
- value: T(e.value)
864
+ value: w(e.value)
864
865
  }));
865
- function O(e) {
866
+ function D(e) {
866
867
  let t = b.find((t) => t.step.id === e);
867
868
  if (t === void 0) return {
868
869
  level: t,
@@ -874,23 +875,23 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
874
875
  id: "running",
875
876
  label: "Running total",
876
877
  tone: "neutral",
877
- value: Mt({
878
+ value: Nt({
878
879
  level: t,
879
- valueText: T
880
+ valueText: w
880
881
  })
881
882
  }] : [];
882
883
  return {
883
884
  level: t,
884
885
  label: t.step.label,
885
- summary: jt({
886
+ summary: Mt({
886
887
  level: t,
887
- valueText: T,
888
- changeText: E
888
+ valueText: w,
889
+ changeText: T
889
890
  }),
890
- rows: [...n, ...D]
891
+ rows: [...n, ...E]
891
892
  };
892
893
  }
893
- let k = p({
894
+ let O = p({
894
895
  width: v.width,
895
896
  height: v.height,
896
897
  direction: "columns",
@@ -905,43 +906,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
905
906
  },
906
907
  valueDomain: S,
907
908
  locale: g,
908
- topInset: St,
909
+ topInset: Ct,
909
910
  hasValueTitle: i !== void 0
910
- }), { box: A, band: N } = k, P = k.value.position, F = b.map((e) => ({
911
+ }), { box: k, band: A } = O, M = O.value.position, N = b.map((e) => ({
911
912
  id: e.step.id,
912
913
  label: e.step.label
913
914
  }));
914
- function I(e) {
915
- return N.start(e) ?? A.left;
915
+ function P(e) {
916
+ return A.start(e) ?? k.left;
916
917
  }
917
- function R(e) {
918
- return I(e) + N.bandwidth * Ot;
918
+ function de(e) {
919
+ return P(e) + A.bandwidth * kt;
919
920
  }
920
- let ue = Re([...b.filter((e) => e.step.kind !== "change"), ...b.filter((e) => e.step.kind === "change")].map((e) => ({
921
+ let I = ze([...b.filter((e) => e.step.kind !== "change"), ...b.filter((e) => e.step.kind === "change")].map((e) => ({
921
922
  id: e.step.id,
922
923
  isTotal: e.step.kind !== "change",
923
- text: At({
924
+ text: jt({
924
925
  level: e,
925
- valueText: T,
926
- changeText: E
926
+ valueText: w,
927
+ changeText: T
927
928
  }),
928
- x: R(e.step.id),
929
- y: Nt(e, P, A.bottom).labelY
929
+ x: de(e.step.id),
930
+ y: Pt(e, M, k.bottom).labelY
930
931
  })));
931
932
  return /* @__PURE__ */ J(ee, {
932
- items: F,
933
- readout: (e) => re(O(e)),
934
- locate: (e) => N.idAt(e.x / e.width * A.width),
933
+ items: N,
934
+ readout: (e) => ie(D(e)),
935
+ locate: (e) => A.idAt(e.x / e.width * k.width),
935
936
  selected: s ?? null,
936
937
  onSelect: c,
937
938
  render: (e, { inspected: t, cursor: n }) => {
938
- let r = O(t);
939
+ let r = D(t);
939
940
  return /* @__PURE__ */ Y(j, {
940
941
  ...h,
941
942
  figure: e,
942
943
  titleDetail: r.level === void 0 ? void 0 : `${r.label} · ${r.summary}`,
943
944
  children: [
944
- /* @__PURE__ */ J(ae, {
945
+ /* @__PURE__ */ J(oe, {
945
946
  label: `${_} steps`,
946
947
  columns: [
947
948
  {
@@ -961,43 +962,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
961
962
  id: e.step.id,
962
963
  values: [
963
964
  e.step.label,
964
- jt({
965
+ Mt({
965
966
  level: e,
966
- valueText: T,
967
- changeText: E
967
+ valueText: w,
968
+ changeText: T
968
969
  }),
969
- e.step.kind === "change" ? Mt({
970
+ e.step.kind === "change" ? Nt({
970
971
  level: e,
971
- valueText: T
972
- }) : jt({
972
+ valueText: w
973
+ }) : Mt({
973
974
  level: e,
974
- valueText: T,
975
- changeText: E
975
+ valueText: w,
976
+ changeText: T
976
977
  })
977
978
  ]
978
979
  })), ...o.map((e) => ({
979
980
  id: `reference:${e.id}`,
980
981
  values: [
981
982
  e.label,
982
- T(e.value),
983
+ w(e.value),
983
984
  ""
984
985
  ]
985
986
  }))]
986
987
  }),
987
- /* @__PURE__ */ J(M, {
988
+ /* @__PURE__ */ J(se, {
988
989
  id: y,
989
990
  label: r.label,
990
991
  summary: r.summary,
991
992
  legend: [],
992
993
  hasLegend: !1,
993
994
  rows: r.rows,
994
- x: R(t ?? ""),
995
+ x: de(t ?? ""),
995
996
  width: v.width,
996
- offset: N.bandwidth * Ot + Dt
997
+ offset: A.bandwidth * kt + Ot
997
998
  }),
998
- b.length === 0 ? /* @__PURE__ */ J(se, { children: f }) : /* @__PURE__ */ Y(me, {
999
+ b.length === 0 ? /* @__PURE__ */ J(le, { children: f }) : /* @__PURE__ */ Y(ge, {
999
1000
  plotRef: v.ref,
1000
- box: A,
1001
+ box: k,
1001
1002
  label: m({
1002
1003
  title: _,
1003
1004
  marks: "steps",
@@ -1005,30 +1006,30 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
1005
1006
  }),
1006
1007
  readoutId: y,
1007
1008
  children: [
1008
- /* @__PURE__ */ J(ce, {
1009
- box: A,
1010
- xTicks: k.bandTicks,
1011
- yTicks: k.valueTicks,
1009
+ /* @__PURE__ */ J(ue, {
1010
+ box: k,
1011
+ xTicks: O.bandTicks,
1012
+ yTicks: O.valueTicks,
1012
1013
  yTitle: i
1013
1014
  }),
1014
- /* @__PURE__ */ Y(ge, {
1015
- box: A,
1015
+ /* @__PURE__ */ Y(ve, {
1016
+ box: k,
1016
1017
  children: [
1017
1018
  b.map((e, t) => {
1018
1019
  let n = b[t + 1];
1019
- return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(z, {
1020
- x1: I(e.step.id) + N.bandwidth,
1021
- x2: I(n.step.id),
1022
- y1: P(e.to),
1023
- y2: P(e.to)
1020
+ return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(L, {
1021
+ x1: P(e.step.id) + A.bandwidth,
1022
+ x2: P(n.step.id),
1023
+ y1: M(e.to),
1024
+ y2: M(e.to)
1024
1025
  }, `connector:${e.step.id}`);
1025
1026
  }),
1026
1027
  b.map((e) => {
1027
- let n = Nt(e, P, A.bottom);
1028
- return /* @__PURE__ */ J(V, {
1029
- x: I(e.step.id),
1028
+ let n = Pt(e, M, k.bottom);
1029
+ return /* @__PURE__ */ J(me, {
1030
+ x: P(e.step.id),
1030
1031
  y: n.top,
1031
- width: N.bandwidth,
1032
+ width: A.bandwidth,
1032
1033
  height: n.height,
1033
1034
  tone: n.isKnown ? e.tone : "neutral",
1034
1035
  isHollow: !n.isKnown,
@@ -1036,25 +1037,25 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
1036
1037
  isInspected: t === e.step.id
1037
1038
  }, e.step.id);
1038
1039
  }),
1039
- /* @__PURE__ */ J(le, {
1040
- x1: A.left,
1041
- x2: A.right,
1042
- y1: P(0),
1043
- y2: P(0)
1040
+ /* @__PURE__ */ J(fe, {
1041
+ x1: k.left,
1042
+ x2: k.right,
1043
+ y1: M(0),
1044
+ y2: M(0)
1044
1045
  })
1045
1046
  ]
1046
1047
  }),
1047
- /* @__PURE__ */ J(ve, {
1048
+ /* @__PURE__ */ J(be, {
1048
1049
  lines: o,
1049
- box: A,
1050
- position: P,
1051
- valueText: T,
1052
- avoid: ue,
1050
+ box: k,
1051
+ position: M,
1052
+ valueText: w,
1053
+ avoid: I,
1053
1054
  marks: b.map((e) => {
1054
- let t = Nt(e, P, A.bottom);
1055
+ let t = Pt(e, M, k.bottom);
1055
1056
  return {
1056
- left: I(e.step.id),
1057
- right: I(e.step.id) + N.bandwidth,
1057
+ left: P(e.step.id),
1058
+ right: P(e.step.id) + A.bandwidth,
1058
1059
  top: t.top,
1059
1060
  bottom: t.top + t.height
1060
1061
  };
@@ -1062,7 +1063,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
1062
1063
  }),
1063
1064
  /* @__PURE__ */ J("g", {
1064
1065
  "aria-hidden": !0,
1065
- children: ue.map((e) => /* @__PURE__ */ J(L, {
1066
+ children: I.map((e) => /* @__PURE__ */ J(F, {
1066
1067
  x: e.x,
1067
1068
  y: e.y,
1068
1069
  anchor: "middle",
@@ -1070,11 +1071,11 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
1070
1071
  children: e.text
1071
1072
  }, e.id))
1072
1073
  }),
1073
- n !== null && /* @__PURE__ */ J(ne, {
1074
- x: R(n),
1075
- top: A.top,
1076
- bottom: A.bottom,
1077
- width: Math.max(Et, N.bandwidth)
1074
+ n !== null && /* @__PURE__ */ J(re, {
1075
+ x: de(n),
1076
+ top: k.top,
1077
+ bottom: k.bottom,
1078
+ width: Math.max(Dt, A.bandwidth)
1078
1079
  })
1079
1080
  ]
1080
1081
  })
@@ -1084,7 +1085,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
1084
1085
  });
1085
1086
  }
1086
1087
  // packages/charts/src/cartesian/scatter-plot.tsx
1087
- var Ft = { points: 1e3 }, It = {
1088
+ var It = { points: 1e3 }, Lt = {
1088
1089
  target: {
1089
1090
  kVAEAm: "x10l6tqk",
1090
1091
  k1xSpc: "xrvj5dj",
@@ -1123,212 +1124,250 @@ var Ft = { points: 1e3 }, It = {
1123
1124
  $$css: !0
1124
1125
  }
1125
1126
  };
1126
- function Lt(e, t) {
1127
+ function Rt(e, t) {
1127
1128
  return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
1128
1129
  }
1129
- function Rt(e, t) {
1130
+ function zt(e, t) {
1130
1131
  return Number.isFinite(e) && e > 0 && e <= t[1] - t[0];
1131
1132
  }
1132
- function zt({ points: e, x: t, y: n, xDomain: r, yDomain: i, range: a, onRangeChange: s, rangeStep: c }) {
1133
+ function Bt({ points: e, x: t, y: n, xDomain: r, yDomain: i, range: a, onRangeChange: s, rangeStep: c }) {
1133
1134
  let l = O(r, t.scale) ?? O(i, n.scale);
1134
1135
  if (l !== void 0) return l;
1135
- if (e.length > Ft.points) return `This plot exceeds the ${Ft.points}-point render limit. Supply a smaller, labelled sample.`;
1136
+ if (e.length > It.points) return `This plot exceeds the ${It.points}-point render limit. Supply a smaller, labelled sample.`;
1136
1137
  if (!o(e)) return "Scatter points must have unique identifiers.";
1137
1138
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
1138
1139
  if (e.some((e) => E(e.x, r) || E(e.y, i))) return "Scatter coordinates fall outside the declared domain. Widen the domain or supply a labelled window of points.";
1139
1140
  if (s !== void 0) {
1140
- if (c === void 0 || !Rt(c.x, r) || !Rt(c.y, i)) return "Range selection steps must be finite, positive, and no larger than their domain span.";
1141
- if (a != null && (!Lt(a.x, r) || !Lt(a.y, i))) return "The selected range must have finite, ordered bounds inside the declared domain.";
1141
+ if (c === void 0 || !zt(c.x, r) || !zt(c.y, i)) return "Range selection steps must be finite, positive, and no larger than their domain span.";
1142
+ if (a != null && (!Rt(a.x, r) || !Rt(a.y, i))) return "The selected range must have finite, ordered bounds inside the declared domain.";
1142
1143
  }
1143
1144
  }
1144
- function Bt(e, t) {
1145
+ function Vt(e, t) {
1145
1146
  return [Math.min(e, t), Math.max(e, t)];
1146
1147
  }
1147
- function Vt(e) {
1148
- let { points: t, x: n, y: r, range: i, onRangeChange: a, rangeStep: o, selected: d, onSelectedChange: f, height: p = "regular", ...h } = e, { emptyLabel: v = "No points were supplied.", ...y } = h, { locale: b, title: x } = y, S = W(), w = he(p), T = C(), [E, D] = G(null), O = we(null);
1149
- if (Ce(() => () => O.current?.(), []), y.status === "loading") return /* @__PURE__ */ J(ie, {
1150
- ...y,
1151
- height: p
1148
+ function Ht(e) {
1149
+ let { points: t, x: n, y: r, referenceDiagonal: i, referenceLines: a = [], frontier: o = [], labeledIds: d = [], range: f, onRangeChange: p, rangeStep: h, selected: v, onSelectedChange: y, height: b = "regular", ...x } = e, { emptyLabel: S = "No points were supplied.", ...w } = x, { locale: T, title: E } = w, D = U(), O = _e(b), k = te(), A = C(), [re, ie] = G(null), se = W(null);
1150
+ if (Te(() => () => se.current?.(), []), w.status === "loading") return /* @__PURE__ */ J(ae, {
1151
+ ...w,
1152
+ height: b
1152
1153
  });
1153
- let k = n.domain ?? u({
1154
+ let M = n.domain ?? u({
1154
1155
  values: t.map((e) => e.x),
1155
1156
  scale: n.scale
1156
- }), A = r.domain ?? u({
1157
+ }), P = r.domain ?? u({
1157
1158
  values: t.map((e) => e.y),
1158
1159
  scale: r.scale
1159
- }), ne = zt({
1160
+ }), I = Bt({
1160
1161
  points: t,
1161
1162
  x: n,
1162
1163
  y: r,
1163
- xDomain: k,
1164
- yDomain: A,
1165
- range: i,
1166
- onRangeChange: a,
1167
- rangeStep: o
1168
- }), re = i ?? null;
1169
- if (ne !== void 0) return /* @__PURE__ */ J(oe, {
1170
- ...y,
1171
- message: ne
1164
+ xDomain: M,
1165
+ yDomain: P,
1166
+ range: f,
1167
+ onRangeChange: p,
1168
+ rangeStep: h
1169
+ }) ?? (a.length > 0 ? ye({
1170
+ lines: a,
1171
+ domain: P
1172
+ }) : void 0), fe = f ?? null;
1173
+ if (I !== void 0) return /* @__PURE__ */ J(ce, {
1174
+ ...w,
1175
+ message: I
1172
1176
  });
1173
- let M = _({
1174
- width: w.width,
1175
- height: w.height,
1177
+ let L = _({
1178
+ width: O.width,
1179
+ height: O.height,
1176
1180
  x: n,
1177
1181
  y: r,
1178
- xDomain: k,
1179
- yDomain: A,
1180
- locale: b
1181
- }), { box: N } = M;
1182
- function F(e) {
1183
- return te({
1182
+ xDomain: M,
1183
+ yDomain: P,
1184
+ locale: T
1185
+ }), { box: R } = L;
1186
+ function z(e) {
1187
+ return ne({
1184
1188
  value: e,
1185
- locale: b,
1189
+ locale: T,
1186
1190
  format: n.format
1187
1191
  });
1188
1192
  }
1189
- function L(e) {
1190
- return te({
1193
+ function me(e) {
1194
+ return ne({
1191
1195
  value: e,
1192
- locale: b,
1196
+ locale: T,
1193
1197
  format: r.format
1194
1198
  });
1195
1199
  }
1196
- let R = t.map((e) => ({
1200
+ let B = t.map((e) => ({
1197
1201
  id: e.id,
1198
- label: `${e.label}, ${n.label}: ${F(e.x)}, ${r.label}: ${L(e.y)}`
1199
- })), le = t.map((e, t) => ({
1202
+ label: `${e.label}, ${n.label}: ${z(e.x)}, ${r.label}: ${me(e.y)}`
1203
+ })), he = t.map((e, t) => ({
1200
1204
  ...e,
1201
- tone: T({
1205
+ tone: k({
1202
1206
  id: e.id,
1203
1207
  tone: e.tone,
1204
1208
  index: t
1205
1209
  }),
1206
- left: M.x.position(e.x),
1207
- top: M.y.position(e.y)
1208
- })), z = new Map(le.map((e) => [e.id, {
1210
+ left: L.x.position(e.x),
1211
+ top: L.y.position(e.y)
1212
+ })), xe = new Map(he.map((e) => [e.id, {
1209
1213
  left: e.left,
1210
1214
  top: e.top,
1211
1215
  right: e.left,
1212
1216
  bottom: e.top
1213
- }])), ue = E === null ? i : {
1214
- x: Bt(E.start.x, E.end.x),
1215
- y: Bt(E.start.y, E.end.y)
1217
+ }])), Ce = re === null ? f : {
1218
+ x: Vt(re.start.x, re.end.x),
1219
+ y: Vt(re.start.y, re.end.y)
1216
1220
  };
1217
- function B(e, t, n) {
1218
- let r = e.getBoundingClientRect(), i = (t - r.left) / r.width * N.width, a = (n - r.top) / r.height * N.height;
1221
+ function V(e, t, n) {
1222
+ let r = e.getBoundingClientRect(), i = (t - r.left) / r.width * R.width, a = (n - r.top) / r.height * R.height;
1219
1223
  return {
1220
- x: M.x.valueAt(Math.min(N.right, Math.max(N.left, i))),
1221
- y: M.y.valueAt(Math.min(N.bottom, Math.max(N.top, a)))
1224
+ x: L.x.valueAt(Math.min(R.right, Math.max(R.left, i))),
1225
+ y: L.y.valueAt(Math.min(R.bottom, Math.max(R.top, a)))
1222
1226
  };
1223
1227
  }
1224
- function de(t) {
1225
- let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement, o = t.target instanceof Element && t.target.closest("[data-brush]") !== null, s = n && o;
1226
- if (a === void 0 || O.current !== null || !s || i === null) return;
1227
- let c = B(r, t.clientX, t.clientY);
1228
- D({
1229
- start: c,
1230
- end: c
1231
- }), O.current = K(i, t.nativeEvent, {
1228
+ function we(t) {
1229
+ let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement, a = t.target instanceof Element && t.target.closest("[data-brush]") !== null, o = n && a;
1230
+ if (p === void 0 || se.current !== null || !o || i === null) return;
1231
+ let s = V(r, t.clientX, t.clientY);
1232
+ ie({
1233
+ start: s,
1234
+ end: s
1235
+ }), se.current = K(i, t.nativeEvent, {
1232
1236
  cancelOnEscape: !0,
1233
- onMove: ({ x: e, y: t }) => D({
1234
- start: c,
1235
- end: B(r, e, t)
1237
+ onMove: ({ x: e, y: t }) => ie({
1238
+ start: s,
1239
+ end: V(r, e, t)
1236
1240
  }),
1237
1241
  onEnd: (t, n) => {
1238
- if (O.current = null, D(null), n) return;
1239
- let i = B(r, t.clientX, t.clientY), a = {
1240
- x: Bt(c.x, i.x),
1241
- y: Bt(c.y, i.y)
1242
+ if (se.current = null, ie(null), n) return;
1243
+ let i = V(r, t.clientX, t.clientY), a = {
1244
+ x: Vt(s.x, i.x),
1245
+ y: Vt(s.y, i.y)
1242
1246
  };
1243
- De({ options: () => e }, "onRangeChange", a, {
1247
+ ke({ options: () => e }, "onRangeChange", a, {
1244
1248
  reason: "drag",
1245
1249
  event: t
1246
1250
  });
1247
1251
  }
1248
1252
  });
1249
1253
  }
1254
+ let Ee = new Map(he.map((e) => [e.id, e])), De = o.map((e) => Ee.get(e)).filter((e) => e !== void 0), Oe = De.length >= 2 ? Se(De.map((e) => ({
1255
+ x: e.left,
1256
+ y: e.top
1257
+ }))) : "", q = new Set(d), X = i === !0 ? { label: "y = x" } : i === !1 || i === void 0 ? null : i, Z = Math.max(M[0], P[0]), Q = Math.min(M[1], P[1]), Ae = X !== null && Q > Z;
1250
1258
  return /* @__PURE__ */ J(ee, {
1251
- items: R,
1252
- place: (e) => z.get(e),
1253
- selected: d ?? null,
1254
- onSelect: f,
1255
- render: (e, { inspected: i, cursor: u }) => /* @__PURE__ */ Y(j, {
1256
- ...y,
1259
+ ...A,
1260
+ items: B,
1261
+ place: (e) => xe.get(e),
1262
+ selected: v ?? null,
1263
+ onSelect: y,
1264
+ render: (e, { inspected: i, cursor: o }) => /* @__PURE__ */ Y(j, {
1265
+ ...w,
1257
1266
  figure: e,
1258
1267
  footer: /* @__PURE__ */ J(c, {
1259
- id: S,
1260
- children: s(R, i)
1268
+ id: D,
1269
+ children: s(B, i)
1261
1270
  }),
1262
1271
  children: [
1263
- t.length === 0 ? /* @__PURE__ */ J(se, { children: v }) : /* @__PURE__ */ Y(me, {
1264
- plotRef: w.ref,
1265
- box: N,
1272
+ t.length === 0 ? /* @__PURE__ */ J(le, { children: S }) : /* @__PURE__ */ Y(ge, {
1273
+ plotRef: O.ref,
1274
+ box: R,
1266
1275
  label: m({
1267
- title: x,
1268
- isSelectable: f !== void 0
1276
+ title: E,
1277
+ isSelectable: y !== void 0
1269
1278
  }),
1270
- readoutId: S,
1271
- onPointerDown: de,
1272
- overlay: le.map((e, t) => /* @__PURE__ */ J(l, {
1279
+ readoutId: D,
1280
+ onPointerDown: we,
1281
+ overlay: he.map((e, t) => /* @__PURE__ */ J(l, {
1273
1282
  value: e.id,
1274
1283
  render: /* @__PURE__ */ J("button", {
1275
1284
  type: "button",
1276
1285
  tabIndex: -1,
1277
1286
  title: e.label,
1278
- "aria-label": R[t]?.label,
1279
- "aria-pressed": f === void 0 ? void 0 : d === e.id
1287
+ "aria-label": B[t]?.label,
1288
+ "aria-pressed": y === void 0 ? void 0 : v === e.id
1280
1289
  }),
1281
- ...H.props(It.target, It.location(e.left, e.top)),
1290
+ ...H.props(Lt.target, Lt.location(e.left, e.top)),
1282
1291
  children: /* @__PURE__ */ J("span", {
1283
1292
  "aria-hidden": !0,
1284
- ...H.props(It.ring, u === e.id && P.cursor)
1293
+ ...H.props(Lt.ring, o === e.id && N.cursor)
1285
1294
  })
1286
1295
  }, e.id)),
1287
1296
  children: [
1288
- /* @__PURE__ */ J(ce, {
1289
- box: N,
1290
- xTicks: M.xTicks,
1291
- yTicks: M.yTicks,
1297
+ /* @__PURE__ */ J(ue, {
1298
+ box: R,
1299
+ xTicks: L.xTicks,
1300
+ yTicks: L.yTicks,
1292
1301
  xTitle: g(n),
1293
1302
  yTitle: g(r),
1294
1303
  grid: "both"
1295
1304
  }),
1296
- a !== void 0 && /* @__PURE__ */ J("rect", {
1305
+ p !== void 0 && /* @__PURE__ */ J("rect", {
1297
1306
  "data-brush": "",
1298
- x: N.left,
1299
- y: N.top,
1300
- width: N.innerWidth,
1301
- height: N.innerHeight,
1307
+ x: R.left,
1308
+ y: R.top,
1309
+ width: R.innerWidth,
1310
+ height: R.innerHeight,
1302
1311
  className: "xsid9ct xy6m8k3"
1303
1312
  }),
1304
- /* @__PURE__ */ Y(ge, {
1305
- box: N,
1306
- children: [ue != null && /* @__PURE__ */ J(Ht, {
1307
- range: ue,
1308
- plot: M
1309
- }), le.map((e) => /* @__PURE__ */ J(I, {
1310
- mark: e.id,
1311
- x: e.left,
1312
- y: e.top,
1313
- tone: e.tone,
1314
- isInspected: i === e.id,
1315
- isSelected: d === e.id
1316
- }, e.id))]
1313
+ /* @__PURE__ */ Y(ve, {
1314
+ box: R,
1315
+ pad: 6,
1316
+ children: [
1317
+ Ae && /* @__PURE__ */ J(Ut, {
1318
+ spec: X,
1319
+ low: Z,
1320
+ high: Q,
1321
+ plot: L
1322
+ }),
1323
+ a.length > 0 && /* @__PURE__ */ J(be, {
1324
+ lines: a,
1325
+ box: R,
1326
+ position: L.y.position,
1327
+ valueText: me
1328
+ }),
1329
+ Oe !== "" && /* @__PURE__ */ J(pe, {
1330
+ d: Oe,
1331
+ tone: "series1",
1332
+ stroke: "dashed"
1333
+ }),
1334
+ Ce != null && /* @__PURE__ */ J(Wt, {
1335
+ range: Ce,
1336
+ plot: L
1337
+ }),
1338
+ he.map((e) => /* @__PURE__ */ J(de, {
1339
+ mark: e.id,
1340
+ x: e.left,
1341
+ y: e.top,
1342
+ tone: e.tone,
1343
+ isInspected: i === e.id,
1344
+ isSelected: v === e.id
1345
+ }, e.id)),
1346
+ he.filter((e) => q.has(e.id)).map((e) => {
1347
+ let t = e.left > R.right - 90, n = e.top < R.top + 18;
1348
+ return /* @__PURE__ */ J(F, {
1349
+ x: e.left + (t ? -8 : 8),
1350
+ y: e.top + (n ? 14 : -6),
1351
+ anchor: t ? "end" : "start",
1352
+ children: e.label
1353
+ }, `label-${e.id}`);
1354
+ })
1355
+ ]
1317
1356
  })
1318
1357
  ]
1319
1358
  }),
1320
- a !== void 0 && o !== void 0 && /* @__PURE__ */ J(Wt, {
1359
+ p !== void 0 && h !== void 0 && /* @__PURE__ */ J(Kt, {
1321
1360
  x: n,
1322
1361
  y: r,
1323
- xDomain: k,
1324
- yDomain: A,
1325
- range: re,
1326
- rangeStep: o,
1327
- locale: b,
1328
- onRangeChange: a
1362
+ xDomain: M,
1363
+ yDomain: P,
1364
+ range: fe,
1365
+ rangeStep: h,
1366
+ locale: T,
1367
+ onRangeChange: p
1329
1368
  }),
1330
- /* @__PURE__ */ J(ae, {
1331
- label: `${x} points`,
1369
+ /* @__PURE__ */ J(oe, {
1370
+ label: `${E} points`,
1332
1371
  columns: [
1333
1372
  {
1334
1373
  id: "point",
@@ -1347,8 +1386,8 @@ function Vt(e) {
1347
1386
  id: e.id,
1348
1387
  values: [
1349
1388
  e.label,
1350
- F(e.x),
1351
- L(e.y)
1389
+ z(e.x),
1390
+ me(e.y)
1352
1391
  ]
1353
1392
  }))
1354
1393
  })
@@ -1356,7 +1395,38 @@ function Vt(e) {
1356
1395
  })
1357
1396
  });
1358
1397
  }
1359
- function Ht({ range: e, plot: t }) {
1398
+ function Ut({ spec: e, low: t, high: n, plot: r }) {
1399
+ let { box: i } = r, a = r.x.position(n), o = r.y.position(n);
1400
+ return /* @__PURE__ */ Y("g", { children: [
1401
+ /* @__PURE__ */ J("line", {
1402
+ x1: r.x.position(t),
1403
+ y1: r.y.position(t),
1404
+ x2: a,
1405
+ y2: o,
1406
+ className: "xhq4mlf xnpr05h xlz5em3 x47corl x13efnbd"
1407
+ }),
1408
+ e.label !== void 0 && /* @__PURE__ */ J(F, {
1409
+ x: a - 6,
1410
+ y: o + 14,
1411
+ anchor: "end",
1412
+ children: e.label
1413
+ }),
1414
+ e.aboveLabel !== void 0 && /* @__PURE__ */ J("text", {
1415
+ x: i.left + 8,
1416
+ y: i.top + 14,
1417
+ className: "x1q7gtio x1hz01jw xy8obcc x47corl",
1418
+ children: e.aboveLabel
1419
+ }),
1420
+ e.belowLabel !== void 0 && /* @__PURE__ */ J("text", {
1421
+ x: i.right - 8,
1422
+ y: i.bottom - 8,
1423
+ textAnchor: "end",
1424
+ className: "x1q7gtio x1hz01jw xy8obcc x47corl",
1425
+ children: e.belowLabel
1426
+ })
1427
+ ] });
1428
+ }
1429
+ function Wt({ range: e, plot: t }) {
1360
1430
  let n = t.x.position(e.x[0]), r = t.y.position(e.y[1]);
1361
1431
  return /* @__PURE__ */ J("rect", {
1362
1432
  x: n,
@@ -1366,9 +1436,9 @@ function Ht({ range: e, plot: t }) {
1366
1436
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
1367
1437
  });
1368
1438
  }
1369
- function Ut({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
1439
+ function Gt({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
1370
1440
  function s(t) {
1371
- return te({
1441
+ return ne({
1372
1442
  value: t,
1373
1443
  locale: a,
1374
1444
  format: e.format
@@ -1402,7 +1472,7 @@ function Ut({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
1402
1472
  ] }) })]
1403
1473
  });
1404
1474
  }
1405
- function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale: s, onRangeChange: c }) {
1475
+ function Kt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale: s, onRangeChange: c }) {
1406
1476
  let l = a ?? {
1407
1477
  x: r,
1408
1478
  y: i
@@ -1414,7 +1484,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
1414
1484
  className: "x153jb6y xy8obcc x1jfksii",
1415
1485
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
1416
1486
  }),
1417
- /* @__PURE__ */ J(Ut, {
1487
+ /* @__PURE__ */ J(Gt, {
1418
1488
  axis: t,
1419
1489
  domain: r,
1420
1490
  value: l.x,
@@ -1425,7 +1495,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
1425
1495
  y: l.y
1426
1496
  }, t)
1427
1497
  }),
1428
- /* @__PURE__ */ J(Ut, {
1498
+ /* @__PURE__ */ J(Gt, {
1429
1499
  axis: n,
1430
1500
  domain: i,
1431
1501
  value: l.y,
@@ -1440,7 +1510,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
1440
1510
  type: "button",
1441
1511
  disabled: a === null,
1442
1512
  onClick: (e) => {
1443
- De({ options: () => ({ onRangeChange: c }) }, "onRangeChange", null, {
1513
+ ke({ options: () => ({ onRangeChange: c }) }, "onRangeChange", null, {
1444
1514
  reason: "clear-press",
1445
1515
  event: e.nativeEvent
1446
1516
  });
@@ -1456,14 +1526,14 @@ var $ = {
1456
1526
  pointsPerSeries: 2e3,
1457
1527
  markers: 200,
1458
1528
  panels: 12
1459
- }, Gt = .01;
1460
- function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
1529
+ }, qt = .01;
1530
+ function Jt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
1461
1531
  let i = e[0]?.points.map((e) => e.timestamp) ?? r;
1462
1532
  if (e.length > $.series || i.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
1463
1533
  if (!o(e) || !o(n)) return "Series and markers require unique identifiers.";
1464
1534
  for (let n of e) {
1465
1535
  if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
1466
- let e = Zt({
1536
+ let e = $t({
1467
1537
  points: n.points,
1468
1538
  timestamps: i,
1469
1539
  isStacked: t
@@ -1471,7 +1541,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
1471
1541
  if (e !== void 0) return e;
1472
1542
  }
1473
1543
  for (let t of n) {
1474
- let n = qt({
1544
+ let n = Yt({
1475
1545
  marker: t,
1476
1546
  series: e,
1477
1547
  timestamps: i
@@ -1482,7 +1552,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
1482
1552
  if (!Number.isFinite(s) || !Number.isFinite(c)) return "The elapsed-time and value ranges must be finite.";
1483
1553
  if (t && i.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
1484
1554
  }
1485
- function qt({ marker: e, series: t, timestamps: n }) {
1555
+ function Yt({ marker: e, series: t, timestamps: n }) {
1486
1556
  if (e.kind === "event") {
1487
1557
  let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
1488
1558
  return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
@@ -1490,7 +1560,7 @@ function qt({ marker: e, series: t, timestamps: n }) {
1490
1560
  if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
1491
1561
  if (e.kind !== "time") return t.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.value === e.value ? void 0 : "Point markers must reference the recorded series value.";
1492
1562
  }
1493
- function Jt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1563
+ function Xt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1494
1564
  return JSON.stringify([
1495
1565
  n,
1496
1566
  r,
@@ -1510,12 +1580,12 @@ function Jt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1510
1580
  ])
1511
1581
  ]);
1512
1582
  }
1513
- function Yt(e, t) {
1583
+ function Zt(e, t) {
1514
1584
  if (e !== t) return [e, t];
1515
- let n = Math.max(1, Math.abs(e) * Gt), r = e - n, i = t + n;
1585
+ let n = Math.max(1, Math.abs(e) * qt), r = e - n, i = t + n;
1516
1586
  return [Number.isFinite(r) ? r : e, Number.isFinite(i) ? i : t];
1517
1587
  }
1518
- function Xt({ series: e, isStacked: t, tones: n }) {
1588
+ function Qt({ series: e, isStacked: t, tones: n }) {
1519
1589
  let r = e.filter((e) => e.tone === void 0);
1520
1590
  return e.map((i, a) => {
1521
1591
  let o = r.findIndex((e) => e.id === i.id), s = n({
@@ -1537,7 +1607,7 @@ function Xt({ series: e, isStacked: t, tones: n }) {
1537
1607
  };
1538
1608
  });
1539
1609
  }
1540
- function Zt({ points: e, timestamps: t, isStacked: n }) {
1610
+ function $t({ points: e, timestamps: t, isStacked: n }) {
1541
1611
  for (let [r, i] of e.entries()) {
1542
1612
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1543
1613
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -1546,16 +1616,16 @@ function Zt({ points: e, timestamps: t, isStacked: n }) {
1546
1616
  }
1547
1617
  }
1548
1618
  // packages/charts/src/cartesian/time-series-line.tsx
1549
- function Qt({ series: e, x: t, y: n, pointRadius: r = 3 }) {
1619
+ function en({ series: e, x: t, y: n, pointRadius: r = 3 }) {
1550
1620
  let i = e.points.findLastIndex((e) => e.value !== null);
1551
- return /* @__PURE__ */ Y(Oe, { children: [/* @__PURE__ */ J("path", {
1552
- d: be(e.points.map((e) => ({
1621
+ return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("path", {
1622
+ d: Se(e.points.map((e) => ({
1553
1623
  x: t(e.timestamp),
1554
1624
  y: e.value === null ? null : n(e.value + e.base)
1555
1625
  }))),
1556
1626
  fill: "none",
1557
1627
  stroke: a[e.tone],
1558
- ...H.props(P.mark)
1628
+ ...H.props(N.mark)
1559
1629
  }), e.points.filter((t, n) => {
1560
1630
  if (t.value === null) return !1;
1561
1631
  let r = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
@@ -1568,18 +1638,18 @@ function Qt({ series: e, x: t, y: n, pointRadius: r = 3 }) {
1568
1638
  }, i.timestamp))] });
1569
1639
  }
1570
1640
  // packages/charts/src/cartesian/sparkline.tsx
1571
- var $t = {
1641
+ var tn = {
1572
1642
  minimum: "Lowest",
1573
1643
  maximum: "Highest",
1574
1644
  last: "Latest"
1575
- }, en = 2.5, tn = 3, nn = {
1645
+ }, nn = 2.5, rn = 3, an = {
1576
1646
  inline: {
1577
1647
  width: 128,
1578
1648
  height: 32
1579
1649
  },
1580
1650
  figure: { height: 48 }
1581
1651
  };
1582
- function rn({ points: e, marked: t }) {
1652
+ function on({ points: e, marked: t }) {
1583
1653
  let n = e.flatMap((e) => e.value === null ? [] : [{
1584
1654
  ...e,
1585
1655
  value: e.value
@@ -1596,8 +1666,8 @@ function rn({ points: e, marked: t }) {
1596
1666
  }];
1597
1667
  });
1598
1668
  }
1599
- function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: o, markedPoints: s = [], baseline: c, layout: l = "inline" }) {
1600
- let u = W(), f = F(), p = l === "figure", m = p ? f.width : nn.inline.width, h = p ? nn.figure.height : nn.inline.height, g = W(), _ = C(), v = on({
1669
+ function sn({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: o, markedPoints: s = [], baseline: c, layout: l = "inline" }) {
1670
+ let u = U(), f = P(), p = l === "figure", m = p ? f.width : an.inline.width, h = p ? an.figure.height : an.inline.height, g = U(), _ = te(), v = cn({
1601
1671
  title: e,
1602
1672
  summary: t,
1603
1673
  unit: n,
@@ -1614,19 +1684,19 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1614
1684
  children: v === void 0 ? "No data" : "Invalid trend"
1615
1685
  });
1616
1686
  let y = i.points[0]?.timestamp ?? 0, b = i.points.at(-1)?.timestamp ?? y, x = k({
1617
- domain: Yt(y, b),
1618
- range: [tn, m - tn]
1687
+ domain: Zt(y, b),
1688
+ range: [rn, m - rn]
1619
1689
  }).position, S = k({
1620
1690
  domain: o,
1621
- range: [h - tn, tn]
1622
- }).position, w = Xt({
1691
+ range: [h - rn, rn]
1692
+ }).position, C = Qt({
1623
1693
  series: [i],
1624
1694
  isStacked: !1,
1625
1695
  tones: _
1626
- })[0], te = a[w?.tone ?? "series1"], T = rn({
1696
+ })[0], w = a[C?.tone ?? "series1"], ne = on({
1627
1697
  points: i.points,
1628
1698
  marked: s
1629
- }), E = T.map(({ kind: e, point: t }) => `${$t[e]}: ${t.value} ${n}.`).join(" "), D = c === void 0 ? "" : `Reference: ${c} ${n}.`, O = /* @__PURE__ */ Y("svg", {
1699
+ }), T = ne.map(({ kind: e, point: t }) => `${tn[e]}: ${t.value} ${n}.`).join(" "), E = c === void 0 ? "" : `Reference: ${c} ${n}.`, D = /* @__PURE__ */ Y("svg", {
1630
1700
  role: "img",
1631
1701
  "aria-labelledby": u,
1632
1702
  "aria-describedby": g,
@@ -1659,34 +1729,34 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1659
1729
  " ",
1660
1730
  n,
1661
1731
  ". ",
1662
- E,
1732
+ T,
1663
1733
  " ",
1664
- D
1734
+ E
1665
1735
  ]
1666
1736
  }),
1667
1737
  c !== void 0 && /* @__PURE__ */ J("line", {
1668
- x1: tn,
1669
- x2: m - tn,
1738
+ x1: rn,
1739
+ x2: m - rn,
1670
1740
  y1: S(c),
1671
1741
  y2: S(c),
1672
1742
  className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
1673
1743
  }),
1674
- w !== void 0 && /* @__PURE__ */ J(Qt, {
1675
- series: w,
1744
+ C !== void 0 && /* @__PURE__ */ J(en, {
1745
+ series: C,
1676
1746
  x,
1677
1747
  y: S,
1678
1748
  pointRadius: 2
1679
1749
  }),
1680
- T.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ J("circle", {
1750
+ ne.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ J("circle", {
1681
1751
  cx: x(t.timestamp),
1682
1752
  cy: S(t.value),
1683
- r: en,
1684
- fill: te
1753
+ r: nn,
1754
+ fill: w
1685
1755
  }, e) : /* @__PURE__ */ J("circle", {
1686
1756
  cx: x(t.timestamp),
1687
1757
  cy: S(t.value),
1688
- r: en,
1689
- stroke: te,
1758
+ r: nn,
1759
+ stroke: w,
1690
1760
  className: "x1fytgo2 x1r6sdyr x13efnbd"
1691
1761
  }, e))
1692
1762
  ]
@@ -1697,14 +1767,14 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1697
1767
  children: /* @__PURE__ */ J("div", {
1698
1768
  ref: f.ref,
1699
1769
  className: "x1lliihq xeuugli",
1700
- children: O
1770
+ children: D
1701
1771
  })
1702
- }) : O;
1772
+ }) : D;
1703
1773
  }
1704
- function on({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
1774
+ function cn({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
1705
1775
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1706
1776
  if (!D(i)) return "The displayed value domain must have finite, increasing bounds.";
1707
- let s = Kt({
1777
+ let s = Jt({
1708
1778
  series: [r],
1709
1779
  isStacked: !1,
1710
1780
  markers: []
@@ -1715,11 +1785,11 @@ function on({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPo
1715
1785
  if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
1716
1786
  }
1717
1787
  // packages/charts/src/cartesian/time-series-bands.ts
1718
- var sn = {
1788
+ var ln = {
1719
1789
  bands: 4,
1720
1790
  crossings: 4
1721
1791
  };
1722
- function cn(e) {
1792
+ function un(e) {
1723
1793
  let t = [
1724
1794
  e.lower,
1725
1795
  e.center,
@@ -1727,18 +1797,18 @@ function cn(e) {
1727
1797
  ].filter((e) => e !== null);
1728
1798
  return t.some((e) => !Number.isFinite(e)) ? "Band values must be finite numbers or explicit missing values." : e.lower === null == (e.upper === null) ? t.every((e, n) => n === 0 || (t[n - 1] ?? e) <= e) ? void 0 : "Band values must satisfy lower ≤ center ≤ upper." : "A band observation needs both bounds or neither.";
1729
1799
  }
1730
- function ln({ bands: e, crossings: t, series: n, timestamps: r }) {
1731
- if (e.length > sn.bands || t.length > sn.crossings) return `Supply at most ${sn.bands} bands and ${sn.crossings} crossings.`;
1800
+ function dn({ bands: e, crossings: t, series: n, timestamps: r }) {
1801
+ if (e.length > ln.bands || t.length > ln.crossings) return `Supply at most ${ln.bands} bands and ${ln.crossings} crossings.`;
1732
1802
  if (!o([...n, ...e]) || !o(t)) return "Series, bands, and crossings require unique identifiers.";
1733
1803
  for (let t of e) {
1734
1804
  if (t.points.length !== r.length || t.points.some((e, t) => e.timestamp !== r[t])) return "Every band must supply the same observation timestamps as the series.";
1735
- let e = t.points.map(cn).find((e) => e !== void 0);
1805
+ let e = t.points.map(un).find((e) => e !== void 0);
1736
1806
  if (e !== void 0) return e;
1737
1807
  }
1738
1808
  let i = new Set([...n, ...e].map((e) => e.id));
1739
1809
  for (let e of t) if (!(i.has(e.seriesId) && e.label.trim() !== "") || !Number.isFinite(e.value)) return "Each crossing needs a label, a finite value, and a supplied series or band.";
1740
1810
  }
1741
- function un({ series: e, bands: t, tones: n }) {
1811
+ function fn({ series: e, bands: t, tones: n }) {
1742
1812
  let r = e.filter((e) => e.tone === void 0).length, i = t.filter((e) => e.tone === void 0);
1743
1813
  return t.map((e) => {
1744
1814
  let t = r + i.findIndex((t) => t.id === e.id);
@@ -1752,7 +1822,7 @@ function un({ series: e, bands: t, tones: n }) {
1752
1822
  };
1753
1823
  });
1754
1824
  }
1755
- function dn({ start: e, end: t, value: n, direction: r }) {
1825
+ function pn({ start: e, end: t, value: n, direction: r }) {
1756
1826
  let i = e > n && t <= n, a = e < n && t >= n;
1757
1827
  switch (r) {
1758
1828
  case "falling": return i;
@@ -1760,7 +1830,7 @@ function dn({ start: e, end: t, value: n, direction: r }) {
1760
1830
  case void 0: return i || a;
1761
1831
  }
1762
1832
  }
1763
- function fn({ points: e, crossing: t }) {
1833
+ function mn({ points: e, crossing: t }) {
1764
1834
  let n = e.flatMap((t, n) => {
1765
1835
  let r = e[n + 1];
1766
1836
  return t.value === null || r === void 0 || r.value === null ? [] : [{
@@ -1769,7 +1839,7 @@ function fn({ points: e, crossing: t }) {
1769
1839
  from: t.value,
1770
1840
  to: r.value
1771
1841
  }];
1772
- }).find(({ from: e, to: n }) => dn({
1842
+ }).find(({ from: e, to: n }) => pn({
1773
1843
  start: e,
1774
1844
  end: n,
1775
1845
  value: t.value,
@@ -1779,10 +1849,10 @@ function fn({ points: e, crossing: t }) {
1779
1849
  let r = (t.value - n.from) / (n.to - n.from);
1780
1850
  return n.start + r * (n.end - n.start);
1781
1851
  }
1782
- function pn({ crossings: e, series: t, bands: n }) {
1852
+ function hn({ crossings: e, series: t, bands: n }) {
1783
1853
  return e.map((e) => ({
1784
1854
  crossing: e,
1785
- timestamp: fn({
1855
+ timestamp: mn({
1786
1856
  points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
1787
1857
  timestamp: e.timestamp,
1788
1858
  value: e.center
@@ -1791,11 +1861,11 @@ function pn({ crossings: e, series: t, bands: n }) {
1791
1861
  })
1792
1862
  }));
1793
1863
  }
1794
- function mn(e, t) {
1864
+ function gn(e, t) {
1795
1865
  let n = Math.min(...e.map((e) => Math.abs(e - t)));
1796
1866
  return e.find((e) => Math.abs(e - t) === n);
1797
1867
  }
1798
- function hn(e) {
1868
+ function _n(e) {
1799
1869
  return e.flatMap((e) => e.points.flatMap((e) => [
1800
1870
  e.lower,
1801
1871
  e.center,
@@ -1803,23 +1873,23 @@ function hn(e) {
1803
1873
  ].filter((e) => e !== null)));
1804
1874
  }
1805
1875
  // packages/charts/src/chart-range.tsx
1806
- var gn = "axis", _n = "selected", vn = "drawn";
1807
- function yn({ value: e }) {
1876
+ var vn = "axis", yn = "selected", bn = "drawn";
1877
+ function xn({ value: e }) {
1808
1878
  return {
1809
1879
  value: e,
1810
1880
  spans: e === null ? [] : [{
1811
- id: _n,
1812
- track: gn,
1881
+ id: yn,
1882
+ track: vn,
1813
1883
  start: e[0],
1814
1884
  end: e[1]
1815
1885
  }]
1816
1886
  };
1817
1887
  }
1818
- function bn(e, t) {
1888
+ function Sn(e, t) {
1819
1889
  let { draft: n } = e;
1820
1890
  return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
1821
1891
  }
1822
- var xn = Ee({
1892
+ var Cn = Oe({
1823
1893
  name: "chart-range",
1824
1894
  options: {
1825
1895
  value: "value",
@@ -1831,12 +1901,12 @@ var xn = Ee({
1831
1901
  },
1832
1902
  controlled: ["value"],
1833
1903
  state: (e) => ({
1834
- ...yn(e),
1904
+ ...xn(e),
1835
1905
  draft: null
1836
1906
  }),
1837
- sync: yn,
1907
+ sync: xn,
1838
1908
  api: (e) => {
1839
- let t = q(e);
1909
+ let t = Ee(e);
1840
1910
  function n(n, { id: r, action: i, reason: a, event: o }) {
1841
1911
  let s = i === "delete" ? void 0 : n.find((e) => e.id === r), c = s === void 0 ? null : [s.start, s.end], l = t("value", c, o === void 0 ? { reason: a } : {
1842
1912
  reason: a,
@@ -1844,7 +1914,7 @@ var xn = Ee({
1844
1914
  });
1845
1915
  return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
1846
1916
  }
1847
- let r = Te(e, {
1917
+ let r = De(e, {
1848
1918
  key: "spans",
1849
1919
  draft: "draft",
1850
1920
  axis: "x",
@@ -1853,7 +1923,7 @@ var xn = Ee({
1853
1923
  step: () => e.options().step,
1854
1924
  create: (e) => ({
1855
1925
  ...e,
1856
- id: vn
1926
+ id: bn
1857
1927
  }),
1858
1928
  label: (t) => e.options().describe([t.start, t.end]),
1859
1929
  createAutoScroll: !1,
@@ -1862,13 +1932,13 @@ var xn = Ee({
1862
1932
  return {
1863
1933
  spans: r,
1864
1934
  shown(t) {
1865
- return bn(t, r.spans(t)).map((t) => ({
1935
+ return Sn(t, r.spans(t)).map((t) => ({
1866
1936
  id: t.id,
1867
1937
  label: e.options().describe([t.start, t.end])
1868
1938
  }));
1869
1939
  },
1870
1940
  draw(e) {
1871
- e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, gn);
1941
+ e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, vn);
1872
1942
  },
1873
1943
  setRange(n, r) {
1874
1944
  let { min: i, max: a, step: o } = e.options(), s = [Number(n), Number(r)].map((e) => i + Math.round((e - i) / o) * o), c = Math.max(i, Math.min(...s)), l = Math.min(a, Math.max(...s));
@@ -1886,7 +1956,7 @@ var xn = Ee({
1886
1956
  state: (e, { api: t }) => ({ spans: t.shown(e) }),
1887
1957
  on: { pointerdown: (e, { api: t }) => t.draw(e) }
1888
1958
  }),
1889
- track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, gn) }),
1959
+ track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, vn) }),
1890
1960
  span: e({
1891
1961
  role: "group",
1892
1962
  props: { value: "string" },
@@ -1908,17 +1978,17 @@ var xn = Ee({
1908
1978
  })
1909
1979
  }),
1910
1980
  agent: { actions: ["setRange", "clear"] }
1911
- }), Sn = U(xn, {
1981
+ }), wn = we(Cn, {
1912
1982
  root: "div",
1913
1983
  track: "div",
1914
1984
  span: "div"
1915
- }), Cn = Sn.Root, wn = Sn.Track, Tn = Sn.Span, En = {
1985
+ }), Tn = wn.Root, En = wn.Track, Dn = wn.Span, On = {
1916
1986
  kVAEAm: "x10l6tqk",
1917
1987
  k87sOh: "x13vifvy",
1918
1988
  kfzvcC: "x47corl",
1919
1989
  $$css: !0
1920
- }, Dn = { track: (e, t, n) => [
1921
- En,
1990
+ }, kn = { track: (e, t, n) => [
1991
+ On,
1922
1992
  {
1923
1993
  kbCHJM: e == null ? e : "xgq9j65",
1924
1994
  kzqmXN: t == null ? t : "x5lhr3w",
@@ -1931,16 +2001,16 @@ var xn = Ee({
1931
2001
  "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
1932
2002
  }
1933
2003
  ] };
1934
- function On({ left: e, width: t, height: n, label: r, children: i, ...a }) {
1935
- return /* @__PURE__ */ J(Cn, {
2004
+ function An({ left: e, width: t, height: n, label: r, children: i, ...a }) {
2005
+ return /* @__PURE__ */ J(Tn, {
1936
2006
  ...a,
1937
2007
  "aria-label": r,
1938
2008
  className: "x1n2onr6 xeuugli",
1939
2009
  render: (r, { spans: a }) => /* @__PURE__ */ Y("div", {
1940
2010
  ...r,
1941
- children: [i, /* @__PURE__ */ J(wn, {
1942
- ...H.props(Dn.track(e, t, n)),
1943
- children: a.map((e) => /* @__PURE__ */ Y(Tn, {
2011
+ children: [i, /* @__PURE__ */ J(En, {
2012
+ ...H.props(kn.track(e, t, n)),
2013
+ children: a.map((e) => /* @__PURE__ */ Y(Dn, {
1944
2014
  value: e.id,
1945
2015
  "aria-label": `Selected range, ${e.label}. Use arrow keys to move it, Shift and an arrow to move its end, and Delete to clear it.`,
1946
2016
  className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
@@ -1961,11 +2031,11 @@ function On({ left: e, width: t, height: n, label: r, children: i, ...a }) {
1961
2031
  });
1962
2032
  }
1963
2033
  // packages/charts/src/cartesian/time-series-overlays.tsx
1964
- var kn = 16, An = 6, jn = 6.5, Mn = 4;
1965
- function Nn({ instants: e, x: t, right: n, ends: r }) {
2034
+ var jn = 16, Mn = 6, Nn = 6.5, Pn = 4;
2035
+ function Fn({ instants: e, x: t, right: n, ends: r }) {
1966
2036
  let [i, ...a] = e;
1967
2037
  if (i === void 0) return [];
1968
- let o = t(i.timestamp), s = i.label.length * jn + An, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
2038
+ let o = t(i.timestamp), s = i.label.length * Nn + Mn, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
1969
2039
  ...r.slice(0, f),
1970
2040
  Math.max(u, r[f] ?? u),
1971
2041
  ...r.slice(f + 1)
@@ -1974,25 +2044,25 @@ function Nn({ instants: e, x: t, right: n, ends: r }) {
1974
2044
  ...i,
1975
2045
  lane: f,
1976
2046
  anchor: c
1977
- }, ...Nn({
2047
+ }, ...Fn({
1978
2048
  instants: a,
1979
2049
  x: t,
1980
2050
  right: n,
1981
2051
  ends: p
1982
2052
  })];
1983
2053
  }
1984
- function Pn({ instants: e, x: t, right: n }) {
1985
- return Nn({
2054
+ function In({ instants: e, x: t, right: n }) {
2055
+ return Fn({
1986
2056
  instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
1987
2057
  x: t,
1988
2058
  right: n,
1989
2059
  ends: []
1990
2060
  });
1991
2061
  }
1992
- function Fn(e) {
1993
- return Math.max(0, ...e.map((e) => e.lane + 1)) * kn;
2062
+ function Ln(e) {
2063
+ return Math.max(0, ...e.map((e) => e.lane + 1)) * jn;
1994
2064
  }
1995
- function In({ bands: e, x: t, y: n }) {
2065
+ function Rn({ bands: e, x: t, y: n }) {
1996
2066
  return /* @__PURE__ */ J("g", { children: e.map((e) => {
1997
2067
  function r(t) {
1998
2068
  return e.points.map((e) => {
@@ -2001,15 +2071,15 @@ function In({ bands: e, x: t, y: n }) {
2001
2071
  });
2002
2072
  }
2003
2073
  let i = r((e) => e.lower), a = r((e) => e.upper), o = r((e) => e.center), s = e.points.map((e) => t(e.timestamp));
2004
- return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(B, {
2005
- d: xe(s.map((e, t) => ({
2074
+ return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(R, {
2075
+ d: Ce(s.map((e, t) => ({
2006
2076
  x: e,
2007
2077
  y0: i[t] ?? null,
2008
2078
  y1: a[t] ?? null
2009
2079
  }))),
2010
2080
  tone: e.tone
2011
- }), /* @__PURE__ */ J(ue, {
2012
- d: be(s.map((e, t) => ({
2081
+ }), /* @__PURE__ */ J(pe, {
2082
+ d: Se(s.map((e, t) => ({
2013
2083
  x: e,
2014
2084
  y: o[t] ?? null
2015
2085
  }))),
@@ -2017,25 +2087,25 @@ function In({ bands: e, x: t, y: n }) {
2017
2087
  })] }, e.id);
2018
2088
  }) });
2019
2089
  }
2020
- function Ln({ placed: e, x: t, y: n, top: r, bottom: i }) {
2021
- let a = r - Fn(e);
2090
+ function zn({ placed: e, x: t, y: n, top: r, bottom: i }) {
2091
+ let a = r - Ln(e);
2022
2092
  return /* @__PURE__ */ J("g", {
2023
2093
  "aria-hidden": !0,
2024
2094
  children: e.map((e) => {
2025
- let r = t(e.timestamp), o = a + (e.lane + 1 / 2) * kn, s = e.anchor === "start" ? r + An : r - An;
2095
+ let r = t(e.timestamp), o = a + (e.lane + 1 / 2) * jn, s = e.anchor === "start" ? r + Mn : r - Mn;
2026
2096
  return /* @__PURE__ */ Y("g", { children: [
2027
- /* @__PURE__ */ J(de, {
2097
+ /* @__PURE__ */ J(z, {
2028
2098
  x: r,
2029
2099
  top: o,
2030
2100
  bottom: i
2031
2101
  }),
2032
- /* @__PURE__ */ J(L, {
2102
+ /* @__PURE__ */ J(F, {
2033
2103
  x: s,
2034
- y: o + Mn,
2104
+ y: o + Pn,
2035
2105
  anchor: e.anchor,
2036
2106
  children: e.label
2037
2107
  }),
2038
- e.value !== void 0 && /* @__PURE__ */ J(R, {
2108
+ e.value !== void 0 && /* @__PURE__ */ J(I, {
2039
2109
  x: r,
2040
2110
  y: n(e.value)
2041
2111
  })
@@ -2044,35 +2114,35 @@ function Ln({ placed: e, x: t, y: n, top: r, bottom: i }) {
2044
2114
  });
2045
2115
  }
2046
2116
  // packages/charts/src/cartesian/time-series.tsx
2047
- var Rn = {
2117
+ var Bn = {
2048
2118
  seconds: 1e3,
2049
2119
  milliseconds: 1
2050
- }, zn = 24, Bn = 12, Vn = 2.5, Hn = 4, Un = {
2120
+ }, Vn = 24, Hn = 12, Un = 2.5, Wn = 4, Gn = {
2051
2121
  line: "line",
2052
2122
  area: "swatch"
2053
2123
  };
2054
- function Wn(e, t) {
2055
- return e * Rn[t];
2124
+ function Kn(e, t) {
2125
+ return e * Bn[t];
2056
2126
  }
2057
- function Gn({ format: e, tickFormat: t, label: n = "" }) {
2127
+ function qn({ format: e, tickFormat: t, label: n = "" }) {
2058
2128
  return {
2059
2129
  label: n,
2060
2130
  format: e,
2061
2131
  tickFormat: t
2062
2132
  };
2063
2133
  }
2064
- function Kn({ series: e, isStacked: t, isZeroBased: n, bands: r, crossings: i }) {
2134
+ function Jn({ series: e, isStacked: t, isZeroBased: n, bands: r, crossings: i }) {
2065
2135
  let a = (e[0]?.points ?? []).map((t, n) => e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)), o = t ? a : e.flatMap((e) => e.points.map((e) => e.value));
2066
2136
  return u({
2067
2137
  values: [
2068
2138
  ...o,
2069
- ...hn(r),
2139
+ ..._n(r),
2070
2140
  ...i.map((e) => e.value)
2071
2141
  ],
2072
2142
  isZeroBased: n
2073
2143
  });
2074
2144
  }
2075
- function qn({ bands: e, crossings: t }) {
2145
+ function Yn({ bands: e, crossings: t }) {
2076
2146
  return JSON.stringify([e.map((e) => [
2077
2147
  e.id,
2078
2148
  e.label,
@@ -2092,7 +2162,7 @@ function qn({ bands: e, crossings: t }) {
2092
2162
  e.direction
2093
2163
  ])]);
2094
2164
  }
2095
- function Jn({ bands: e, timestamp: t, valueText: n }) {
2165
+ function Xn({ bands: e, timestamp: t, valueText: n }) {
2096
2166
  return e.flatMap((e) => {
2097
2167
  let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
2098
2168
  return [{
@@ -2110,28 +2180,28 @@ function Jn({ bands: e, timestamp: t, valueText: n }) {
2110
2180
  }];
2111
2181
  });
2112
2182
  }
2113
- function Yn({ found: e, timeText: t }) {
2183
+ function Zn({ found: e, timeText: t }) {
2114
2184
  return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
2115
2185
  }
2116
- function Xn(e) {
2117
- return /* @__PURE__ */ J(nr, {
2186
+ function Qn(e) {
2187
+ return /* @__PURE__ */ J(ir, {
2118
2188
  ...e,
2119
2189
  kind: "line",
2120
2190
  isStacked: !1
2121
2191
  });
2122
2192
  }
2123
- function Zn({ isStacked: e = !1, ...t }) {
2124
- return /* @__PURE__ */ J(nr, {
2193
+ function $n({ isStacked: e = !1, ...t }) {
2194
+ return /* @__PURE__ */ J(ir, {
2125
2195
  ...t,
2126
2196
  kind: "area",
2127
2197
  isStacked: e
2128
2198
  });
2129
2199
  }
2130
- function Qn(e) {
2131
- return /* @__PURE__ */ J($n, { ...e });
2200
+ function er(e) {
2201
+ return /* @__PURE__ */ J(tr, { ...e });
2132
2202
  }
2133
- function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
2134
- let o = W(), s = C(), c = Xt({
2203
+ function tr({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
2204
+ let o = U(), s = te(), c = Qt({
2135
2205
  series: e.map((e) => ({
2136
2206
  ...e,
2137
2207
  points: []
@@ -2147,7 +2217,7 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
2147
2217
  ...a,
2148
2218
  status: "loading",
2149
2219
  series: c,
2150
- seriesLegend: /* @__PURE__ */ J(M, {
2220
+ seriesLegend: /* @__PURE__ */ J(se, {
2151
2221
  id: o,
2152
2222
  label: void 0,
2153
2223
  legend: c,
@@ -2160,37 +2230,37 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
2160
2230
  className: "xrvj5dj x1n8ia3y",
2161
2231
  children: /* @__PURE__ */ Y("div", {
2162
2232
  className: "xeuugli",
2163
- children: [/* @__PURE__ */ J(r, { height: f[t] - zn }), /* @__PURE__ */ J("div", {
2233
+ children: [/* @__PURE__ */ J(r, { height: f[t] - Vn }), /* @__PURE__ */ J("div", {
2164
2234
  className: "x78zum5 x6s0dn4 x1qughib x8zbtdt xxk0z11",
2165
- children: i && /* @__PURE__ */ Y(Oe, { children: [/* @__PURE__ */ J(n, { width: "8ch" }), /* @__PURE__ */ J(n, { width: "8ch" })] })
2235
+ children: i && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(n, { width: "8ch" }), /* @__PURE__ */ J(n, { width: "8ch" })] })
2166
2236
  })]
2167
2237
  })
2168
2238
  })
2169
2239
  })
2170
2240
  });
2171
2241
  }
2172
- function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact", locale: i, status: a }) {
2173
- let s = we(null), [c, l] = G(), u = JSON.stringify(e.map((e) => [
2242
+ function nr({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact", locale: i, status: a }) {
2243
+ let s = W(null), [c, l] = G(), u = JSON.stringify(e.map((e) => [
2174
2244
  e.id,
2175
2245
  e.title,
2176
- Jt({
2246
+ Xt({
2177
2247
  series: e.series,
2178
2248
  markers: e.markers ?? [],
2179
2249
  timestampUnit: t,
2180
2250
  isStacked: !1
2181
2251
  })
2182
2252
  ])), d = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), p = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === d);
2183
- if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(tr, {
2253
+ if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(rr, {
2184
2254
  charts: e,
2185
2255
  height: r,
2186
2256
  locale: i
2187
2257
  });
2188
- if (!p || !o(e)) return /* @__PURE__ */ J(oe, {
2258
+ if (!p || !o(e)) return /* @__PURE__ */ J(ce, {
2189
2259
  title: "Small multiples",
2190
2260
  locale: i,
2191
2261
  message: "Charts need unique identifiers and aligned observation timestamps."
2192
2262
  });
2193
- if (e.length > $.panels) return /* @__PURE__ */ J(oe, {
2263
+ if (e.length > $.panels) return /* @__PURE__ */ J(ce, {
2194
2264
  title: "Small multiples",
2195
2265
  locale: i,
2196
2266
  message: `Choose at most ${$.panels} panels.`
@@ -2198,19 +2268,19 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
2198
2268
  if (e.length === 0) return /* @__PURE__ */ J(j, {
2199
2269
  title: "Small multiples",
2200
2270
  locale: i,
2201
- children: /* @__PURE__ */ J(se, { children: "No charts" })
2271
+ children: /* @__PURE__ */ J(le, { children: "No charts" })
2202
2272
  });
2203
2273
  let m = h({
2204
2274
  height: f[r],
2205
2275
  locale: i,
2206
2276
  hasValueTitle: e.some((e) => e.valueLabel !== void 0),
2207
2277
  axes: e.map((e) => ({
2208
- axis: Gn({
2278
+ axis: qn({
2209
2279
  format: e.valueFormat,
2210
2280
  tickFormat: e.tickFormat,
2211
2281
  label: e.valueLabel
2212
2282
  }),
2213
- domain: Kn({
2283
+ domain: Jn({
2214
2284
  series: e.series,
2215
2285
  isStacked: !1,
2216
2286
  isZeroBased: !1,
@@ -2230,7 +2300,7 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
2230
2300
  0: {},
2231
2301
  1: { className: "x1y332i5" }
2232
2302
  }[!!(g && f > 0) | 0],
2233
- children: /* @__PURE__ */ J(nr, {
2303
+ children: /* @__PURE__ */ J(ir, {
2234
2304
  ...d,
2235
2305
  locale: i,
2236
2306
  status: a,
@@ -2255,8 +2325,8 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
2255
2325
  }, o))
2256
2326
  });
2257
2327
  }
2258
- function tr({ charts: e, height: t, locale: n }) {
2259
- if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(oe, {
2328
+ function rr({ charts: e, height: t, locale: n }) {
2329
+ if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(ce, {
2260
2330
  title: "Small multiples",
2261
2331
  locale: n,
2262
2332
  message: `Choose at most ${$.panels} panels with unique identifiers.`
@@ -2274,7 +2344,7 @@ function tr({ charts: e, height: t, locale: n }) {
2274
2344
  0: {},
2275
2345
  1: { className: "x1y332i5" }
2276
2346
  }[!!(r && o > 0) | 0],
2277
- children: /* @__PURE__ */ J($n, {
2347
+ children: /* @__PURE__ */ J(tr, {
2278
2348
  ...a,
2279
2349
  locale: n,
2280
2350
  height: t,
@@ -2283,150 +2353,150 @@ function tr({ charts: e, height: t, locale: n }) {
2283
2353
  }, i))
2284
2354
  });
2285
2355
  }
2286
- function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFormat: a, valueLabel: o, markers: s = [], height: c = "compact", kind: l, isStacked: u, sharedInspection: d, gutter: f, showTimeAxis: p = !0, bands: h = [], crossings: g = [], range: _ = null, onRangeChange: y, rangeStep: b, emptyLabel: x = "No observations", ...S }) {
2287
- let { title: T, locale: E, report: D } = S, O = C(), k = he(c), A = W(), ie = h[0]?.points.map((e) => e.timestamp) ?? [], N = t[0]?.points.map((e) => e.timestamp) ?? ie, P = Kt({
2356
+ function ir({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFormat: a, valueLabel: o, markers: s = [], height: c = "compact", kind: l, isStacked: u, sharedInspection: d, gutter: f, showTimeAxis: p = !0, bands: h = [], crossings: g = [], range: _ = null, onRangeChange: y, rangeStep: b, emptyLabel: x = "No observations", ...S }) {
2357
+ let { title: C, locale: T, report: E } = S, D = te(), O = _e(c), k = U(), A = h[0]?.points.map((e) => e.timestamp) ?? [], ae = t[0]?.points.map((e) => e.timestamp) ?? A, M = Jt({
2288
2358
  series: t,
2289
2359
  isStacked: u,
2290
2360
  markers: s,
2291
- timeline: ie
2292
- }) ?? ln({
2361
+ timeline: A
2362
+ }) ?? dn({
2293
2363
  bands: h,
2294
2364
  crossings: g,
2295
2365
  series: t,
2296
- timestamps: N
2297
- }) ?? rr({
2366
+ timestamps: ae
2367
+ }) ?? ar({
2298
2368
  range: _,
2299
2369
  rangeStep: b,
2300
2370
  isSelectable: y !== void 0,
2301
- timeline: N
2302
- }), F = P === void 0 ? Xt({
2371
+ timeline: ae
2372
+ }), N = M === void 0 ? Qt({
2303
2373
  series: t,
2304
2374
  isStacked: u,
2305
- tones: O
2306
- }) : [], L = P === void 0 ? un({
2375
+ tones: D
2376
+ }) : [], P = M === void 0 ? fn({
2307
2377
  series: t,
2308
2378
  bands: h,
2309
- tones: O
2310
- }) : [], z = F[0]?.points ?? L[0]?.points ?? [];
2311
- function B(e) {
2379
+ tones: D
2380
+ }) : [], F = N[0]?.points ?? P[0]?.points ?? [];
2381
+ function L(e) {
2312
2382
  return w({
2313
- timestamp: Wn(e, n),
2314
- locale: E,
2383
+ timestamp: Kn(e, n),
2384
+ locale: T,
2315
2385
  format: r
2316
2386
  });
2317
2387
  }
2318
- function V(e) {
2319
- return te({
2388
+ function R(e) {
2389
+ return ne({
2320
2390
  value: e,
2321
- locale: E,
2391
+ locale: T,
2322
2392
  format: i
2323
2393
  });
2324
2394
  }
2325
- let fe = z.map(({ timestamp: e }) => ({
2395
+ let me = F.map(({ timestamp: e }) => ({
2326
2396
  id: String(e),
2327
- label: B(e)
2328
- })), _e = `${Jt({
2397
+ label: L(e)
2398
+ })), B = `${Xt({
2329
2399
  series: t,
2330
2400
  markers: s,
2331
2401
  timestampUnit: n,
2332
2402
  isStacked: u
2333
- })}${qn({
2403
+ })}${Yn({
2334
2404
  bands: h,
2335
2405
  crossings: g
2336
- })}`, ve = [...F.map(({ id: e, label: t, tone: n }) => ({
2406
+ })}`, ye = [...N.map(({ id: e, label: t, tone: n }) => ({
2337
2407
  id: e,
2338
2408
  label: t,
2339
2409
  tone: n,
2340
- shape: Un[l]
2341
- })), ...L.map(({ id: e, label: t, tone: n }) => ({
2410
+ shape: Gn[l]
2411
+ })), ...P.map(({ id: e, label: t, tone: n }) => ({
2342
2412
  id: e,
2343
2413
  label: t,
2344
2414
  tone: n,
2345
2415
  shape: "band"
2346
- }))], H = D?.seriesValues !== void 0;
2347
- if (S.status === "loading") return /* @__PURE__ */ J($n, {
2416
+ }))], be = E?.seriesValues !== void 0;
2417
+ if (S.status === "loading") return /* @__PURE__ */ J(tr, {
2348
2418
  ...S,
2349
2419
  series: t,
2350
2420
  height: c,
2351
2421
  showTimeAxis: p
2352
2422
  });
2353
- if (P !== void 0) return /* @__PURE__ */ J(oe, {
2423
+ if (M !== void 0) return /* @__PURE__ */ J(ce, {
2354
2424
  ...S,
2355
- message: P
2425
+ message: M
2356
2426
  });
2357
- if (z.length === 0) return /* @__PURE__ */ J(j, {
2427
+ if (F.length === 0) return /* @__PURE__ */ J(j, {
2358
2428
  ...S,
2359
- series: ve,
2360
- children: /* @__PURE__ */ J(se, { children: x })
2429
+ series: ye,
2430
+ children: /* @__PURE__ */ J(le, { children: x })
2361
2431
  });
2362
- let U = z.map((e) => e.timestamp), Ce = pn({
2432
+ let H = F.map((e) => e.timestamp), we = hn({
2363
2433
  crossings: g,
2364
2434
  series: t,
2365
2435
  bands: h
2366
- }), we = [...s.flatMap((e) => e.kind === "event" ? [e] : []), ...Ce.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
2436
+ }), Te = [...s.flatMap((e) => e.kind === "event" ? [e] : []), ...we.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
2367
2437
  id: e.id,
2368
2438
  timestamp: t,
2369
2439
  label: e.label,
2370
2440
  value: e.value
2371
2441
  }])];
2372
- function G(e) {
2442
+ function W(e) {
2373
2443
  return {
2374
- label: e === void 0 ? void 0 : B(e),
2375
- rows: [...F.map((t) => {
2444
+ label: e === void 0 ? void 0 : L(e),
2445
+ rows: [...N.map((t) => {
2376
2446
  let n = t.points.find((t) => t.timestamp === e);
2377
2447
  return {
2378
2448
  id: t.id,
2379
2449
  label: t.label,
2380
2450
  tone: t.tone,
2381
- value: V(n?.value ?? null)
2451
+ value: R(n?.value ?? null)
2382
2452
  };
2383
- }), ...Jn({
2384
- bands: L,
2453
+ }), ...Xn({
2454
+ bands: P,
2385
2455
  timestamp: e,
2386
- valueText: V
2456
+ valueText: R
2387
2457
  })],
2388
- notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...we.filter((t) => mn(U, t.timestamp) === e).map((e) => `${e.label} · ${B(e.timestamp)}`)]
2458
+ notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...Te.filter((t) => gn(H, t.timestamp) === e).map((e) => `${e.label} · ${L(e.timestamp)}`)]
2389
2459
  };
2390
2460
  }
2391
- let K = U[0] ?? 0, q = U.at(-1) ?? K, Te = {
2392
- width: k.width,
2393
- height: k.height,
2394
- value: Gn({
2461
+ let G = H[0] ?? 0, K = H.at(-1) ?? G, Ee = {
2462
+ width: O.width,
2463
+ height: O.height,
2464
+ value: qn({
2395
2465
  format: i,
2396
2466
  tickFormat: a,
2397
2467
  label: o
2398
2468
  }),
2399
- valueDomain: Kn({
2469
+ valueDomain: Jn({
2400
2470
  series: t,
2401
2471
  isStacked: u,
2402
2472
  isZeroBased: l === "area",
2403
2473
  bands: h,
2404
2474
  crossings: g
2405
2475
  }),
2406
- timeDomain: Yt(Wn(K, n), Wn(q, n)),
2476
+ timeDomain: Zt(Kn(G, n), Kn(K, n)),
2407
2477
  timeFormat: r,
2408
- locale: E,
2478
+ locale: T,
2409
2479
  gutter: f,
2410
2480
  hasValueTitle: o !== void 0
2411
- }, Ee = v(Te), Oe = Pn({
2412
- instants: we,
2413
- x: (e) => Ee.x.position(Wn(e, n)),
2414
- right: Ee.box.right
2415
- }), ke = v({
2416
- ...Te,
2417
- topInset: Fn(Oe)
2418
- }), { box: X } = ke;
2481
+ }, De = v(Ee), Oe = In({
2482
+ instants: Te,
2483
+ x: (e) => De.x.position(Kn(e, n)),
2484
+ right: De.box.right
2485
+ }), q = v({
2486
+ ...Ee,
2487
+ topInset: Ln(Oe)
2488
+ }), { box: X } = q;
2419
2489
  function Z(e) {
2420
- return ke.x.position(Wn(e, n));
2490
+ return q.x.position(Kn(e, n));
2421
2491
  }
2422
- let Q = ke.y.position;
2492
+ let Q = q.y.position;
2423
2493
  function Ae(e) {
2424
- return `${B(e[0])} to ${B(e[1])}`;
2494
+ return `${L(e[0])} to ${L(e[1])}`;
2425
2495
  }
2426
- let je = y !== void 0 && b !== void 0 && q !== K ? {
2496
+ let je = y !== void 0 && b !== void 0 && K !== G ? {
2427
2497
  onRangeChange: y,
2428
2498
  rangeStep: b
2429
- } : void 0, Me = U.map((e) => ({
2499
+ } : void 0, Me = H.map((e) => ({
2430
2500
  id: String(e),
2431
2501
  x: Z(e),
2432
2502
  y: 0
@@ -2434,44 +2504,44 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2434
2504
  return /* @__PURE__ */ J("div", {
2435
2505
  className: "xeuugli",
2436
2506
  children: /* @__PURE__ */ J(ee, {
2437
- items: fe,
2438
- readout: (e) => re(G(Number(e))),
2439
- locate: Se({
2507
+ items: me,
2508
+ readout: (e) => ie(W(Number(e))),
2509
+ locate: V({
2440
2510
  marks: Me,
2441
2511
  width: X.width,
2442
2512
  height: X.height,
2443
2513
  axis: "x"
2444
2514
  }),
2445
- revision: _e,
2515
+ revision: B,
2446
2516
  inspected: d?.id,
2447
2517
  onInspectedChange: d?.onChange,
2448
2518
  within: d?.within,
2449
2519
  render: (t, { inspected: r, cursor: i }) => {
2450
- let a = r === null ? void 0 : Number(r), c = G(d === void 0 || d.isSource ? a : void 0), f = /* @__PURE__ */ Y(me, {
2451
- plotRef: k.ref,
2520
+ let a = r === null ? void 0 : Number(r), c = W(d === void 0 || d.isSource ? a : void 0), f = /* @__PURE__ */ Y(ge, {
2521
+ plotRef: O.ref,
2452
2522
  box: X,
2453
2523
  label: m({
2454
- title: T,
2524
+ title: C,
2455
2525
  marks: "observations",
2456
2526
  isSelectable: !1
2457
2527
  }),
2458
- readoutId: A,
2528
+ readoutId: k,
2459
2529
  children: [
2460
- /* @__PURE__ */ J(ce, {
2530
+ /* @__PURE__ */ J(ue, {
2461
2531
  box: X,
2462
- xTicks: p ? ke.xTicks : [],
2463
- yTicks: ke.yTicks,
2532
+ xTicks: p ? q.xTicks : [],
2533
+ yTicks: q.yTicks,
2464
2534
  yTitle: o
2465
2535
  }),
2466
- /* @__PURE__ */ Y(ge, {
2536
+ /* @__PURE__ */ Y(ve, {
2467
2537
  box: X,
2468
2538
  children: [
2469
- /* @__PURE__ */ J(In, {
2470
- bands: L,
2539
+ /* @__PURE__ */ J(Rn, {
2540
+ bands: P,
2471
2541
  x: Z,
2472
2542
  y: Q
2473
2543
  }),
2474
- F.map((e) => {
2544
+ N.map((e) => {
2475
2545
  let t = e.points.map((e) => ({
2476
2546
  x: Z(e.timestamp),
2477
2547
  y: e.value === null ? null : Q(e.value + e.base)
@@ -2481,49 +2551,49 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2481
2551
  y1: e.value === null ? null : Q(e.value + e.base)
2482
2552
  }));
2483
2553
  return /* @__PURE__ */ Y("g", { children: [
2484
- l === "area" && /* @__PURE__ */ J(pe, {
2485
- d: xe(n),
2554
+ l === "area" && /* @__PURE__ */ J(he, {
2555
+ d: Ce(n),
2486
2556
  tone: e.tone,
2487
2557
  isPale: !u
2488
2558
  }),
2489
- /* @__PURE__ */ J(ue, {
2490
- d: be(t),
2559
+ /* @__PURE__ */ J(pe, {
2560
+ d: Se(t),
2491
2561
  tone: e.tone
2492
2562
  }),
2493
- ye(t).map((t) => /* @__PURE__ */ J(I, {
2563
+ xe(t).map((t) => /* @__PURE__ */ J(de, {
2494
2564
  x: t.x,
2495
2565
  y: t.y,
2496
2566
  tone: e.tone,
2497
- radius: Vn
2567
+ radius: Un
2498
2568
  }, t.x))
2499
2569
  ] }, e.id);
2500
2570
  }),
2501
- g.map((e) => /* @__PURE__ */ J(le, {
2571
+ g.map((e) => /* @__PURE__ */ J(fe, {
2502
2572
  x1: X.left,
2503
2573
  x2: X.right,
2504
2574
  y1: Q(e.value),
2505
2575
  y2: Q(e.value)
2506
2576
  }, e.id)),
2507
2577
  s.map((e) => {
2508
- if (e.kind === "time") return /* @__PURE__ */ J(de, {
2578
+ if (e.kind === "time") return /* @__PURE__ */ J(z, {
2509
2579
  x: Z(e.timestamp),
2510
2580
  top: X.top,
2511
2581
  bottom: X.bottom
2512
2582
  }, e.id);
2513
- let t = F.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base;
2514
- return e.kind === "point" ? /* @__PURE__ */ J(R, {
2583
+ let t = N.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base;
2584
+ return e.kind === "point" ? /* @__PURE__ */ J(I, {
2515
2585
  x: Z(e.timestamp),
2516
2586
  y: Q(e.value + (t ?? 0))
2517
2587
  }, e.id) : void 0;
2518
2588
  }),
2519
- a !== void 0 && /* @__PURE__ */ J(de, {
2589
+ a !== void 0 && /* @__PURE__ */ J(z, {
2520
2590
  x: Z(a),
2521
2591
  top: X.top,
2522
2592
  bottom: X.bottom
2523
2593
  }),
2524
- a !== void 0 && F.flatMap((e) => {
2594
+ a !== void 0 && N.flatMap((e) => {
2525
2595
  let t = e.points.find((e) => e.timestamp === a);
2526
- return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(I, {
2596
+ return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(de, {
2527
2597
  x: Z(t.timestamp),
2528
2598
  y: Q(t.value + t.base),
2529
2599
  tone: e.tone,
@@ -2532,48 +2602,48 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2532
2602
  })
2533
2603
  ]
2534
2604
  }),
2535
- /* @__PURE__ */ J(Ln, {
2605
+ /* @__PURE__ */ J(zn, {
2536
2606
  placed: Oe,
2537
2607
  x: Z,
2538
2608
  y: Q,
2539
2609
  top: X.top,
2540
2610
  bottom: X.bottom
2541
2611
  }),
2542
- i !== null && /* @__PURE__ */ J(ne, {
2612
+ i !== null && /* @__PURE__ */ J(re, {
2543
2613
  x: Z(Number(i)),
2544
2614
  top: X.top,
2545
2615
  bottom: X.bottom,
2546
- width: Bn
2616
+ width: Hn
2547
2617
  })
2548
2618
  ]
2549
2619
  });
2550
2620
  return /* @__PURE__ */ Y(j, {
2551
2621
  ...S,
2552
2622
  figure: t,
2553
- titleDetail: H ? void 0 : c.label,
2554
- series: ve,
2555
- seriesLegend: /* @__PURE__ */ J(M, {
2556
- id: A,
2623
+ titleDetail: be ? void 0 : c.label,
2624
+ series: ye,
2625
+ seriesLegend: /* @__PURE__ */ J(se, {
2626
+ id: k,
2557
2627
  label: c.label,
2558
- legend: ve,
2628
+ legend: ye,
2559
2629
  rows: c.rows,
2560
- x: Z(a ?? K),
2630
+ x: Z(a ?? G),
2561
2631
  width: X.width,
2562
2632
  notes: c.notes,
2563
- hasSeriesSummary: H
2633
+ hasSeriesSummary: be
2564
2634
  }),
2565
- children: [/* @__PURE__ */ J(ae, {
2566
- label: `${T} observations`,
2635
+ children: [/* @__PURE__ */ J(oe, {
2636
+ label: `${C} observations`,
2567
2637
  columns: [
2568
2638
  {
2569
2639
  id: "time",
2570
2640
  label: `Time (${n})`
2571
2641
  },
2572
- ...F.map((e) => ({
2642
+ ...N.map((e) => ({
2573
2643
  id: `series:${e.id}`,
2574
2644
  label: e.label
2575
2645
  })),
2576
- ...L.flatMap((e) => [{
2646
+ ...P.flatMap((e) => [{
2577
2647
  id: `band:${e.id}`,
2578
2648
  label: e.label
2579
2649
  }, {
@@ -2581,31 +2651,31 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2581
2651
  label: `${e.label}: ${e.rangeLabel}`
2582
2652
  }])
2583
2653
  ],
2584
- rows: z.map((e, t) => ({
2654
+ rows: F.map((e, t) => ({
2585
2655
  id: e.timestamp,
2586
2656
  values: [
2587
- B(e.timestamp),
2588
- ...F.map((e) => V(e.points[t]?.value ?? null)),
2589
- ...Jn({
2590
- bands: L,
2657
+ L(e.timestamp),
2658
+ ...N.map((e) => R(e.points[t]?.value ?? null)),
2659
+ ...Xn({
2660
+ bands: P,
2591
2661
  timestamp: e.timestamp,
2592
- valueText: V
2662
+ valueText: R
2593
2663
  }).map((e) => e.value)
2594
2664
  ]
2595
2665
  }))
2596
2666
  }), /* @__PURE__ */ Y("div", {
2597
2667
  className: "xrvj5dj x1n8ia3y",
2598
2668
  children: [
2599
- je === void 0 ? f : /* @__PURE__ */ J(On, {
2669
+ je === void 0 ? f : /* @__PURE__ */ J(An, {
2600
2670
  value: _,
2601
2671
  onValueChange: je.onRangeChange,
2602
- min: K,
2603
- max: q,
2672
+ min: G,
2673
+ max: K,
2604
2674
  step: je.rangeStep,
2605
2675
  describe: Ae,
2606
- label: `${T} time range`,
2607
- left: Z(K),
2608
- width: Z(q) - Z(K),
2676
+ label: `${C} time range`,
2677
+ left: Z(G),
2678
+ width: Z(K) - Z(G),
2609
2679
  height: X.bottom,
2610
2680
  children: f
2611
2681
  }),
@@ -2614,9 +2684,9 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2614
2684
  children: [/* @__PURE__ */ J("span", { children: _ === null ? "Drag on the plot with a mouse to select a range of time." : `Selected range: ${Ae(_)}` }), _ === null ? /* @__PURE__ */ J(e, {
2615
2685
  type: "button",
2616
2686
  onClick: (e) => {
2617
- De({ options: () => je }, "onRangeChange", ir({
2618
- first: K,
2619
- last: q,
2687
+ ke({ options: () => je }, "onRangeChange", or({
2688
+ first: G,
2689
+ last: K,
2620
2690
  step: je.rangeStep
2621
2691
  }), {
2622
2692
  reason: "trigger-press",
@@ -2627,7 +2697,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2627
2697
  }) : /* @__PURE__ */ J(e, {
2628
2698
  type: "button",
2629
2699
  onClick: (e) => {
2630
- De({ options: () => je }, "onRangeChange", null, {
2700
+ ke({ options: () => je }, "onRangeChange", null, {
2631
2701
  reason: "clear-press",
2632
2702
  event: e.nativeEvent
2633
2703
  });
@@ -2635,16 +2705,16 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2635
2705
  children: "Clear range"
2636
2706
  })]
2637
2707
  }),
2638
- s.length + Ce.length > 0 && /* @__PURE__ */ Y("ul", {
2708
+ s.length + we.length > 0 && /* @__PURE__ */ Y("ul", {
2639
2709
  className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
2640
2710
  children: [s.map((e) => /* @__PURE__ */ Y("li", { children: [
2641
- B(e.timestamp),
2711
+ L(e.timestamp),
2642
2712
  " · ",
2643
2713
  e.label,
2644
- e.kind === "point" && ` · ${V(e.value)}`
2645
- ] }, e.id)), Ce.map((e) => /* @__PURE__ */ J("li", { children: Yn({
2714
+ e.kind === "point" && ` · ${R(e.value)}`
2715
+ ] }, e.id)), we.map((e) => /* @__PURE__ */ J("li", { children: Zn({
2646
2716
  found: e,
2647
- timeText: B
2717
+ timeText: L
2648
2718
  }) }, e.crossing.id))]
2649
2719
  })
2650
2720
  ]
@@ -2654,7 +2724,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
2654
2724
  })
2655
2725
  });
2656
2726
  }
2657
- function rr({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
2727
+ function ar({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
2658
2728
  let i = r[0], a = r.at(-1);
2659
2729
  if (!n || i === void 0 || a === void 0) return;
2660
2730
  let o = a - i;
@@ -2663,8 +2733,8 @@ function rr({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
2663
2733
  if (e !== null && (!(e[0] >= i && e[1] <= a) || e[0] >= e[1])) return "The selected range must have ordered ends inside the observed time.";
2664
2734
  }
2665
2735
  }
2666
- function ir({ first: e, last: t, step: n }) {
2667
- let r = Math.max(1, Math.round((t - e) / Hn / n)) * n, i = Math.min(e + r, t - n);
2736
+ function or({ first: e, last: t, step: n }) {
2737
+ let r = Math.max(1, Math.round((t - e) / Wn / n)) * n, i = Math.min(e + r, t - n);
2668
2738
  return [i, Math.min(t, Math.max(i + n, t - r))];
2669
2739
  }
2670
- export { Qn as a, $ as c, Pt as d, ht as f, tr as i, Vt as l, st as m, Xn as n, sn as o, dt as p, er as r, an as s, Zn as t, Ft as u };
2740
+ export { er as a, $ as c, Ft as d, gt as f, rr as i, Ht as l, ct as m, Qn as n, ln as o, ft as p, nr as r, sn as s, $n as t, It as u };