@mechane-ai/elements 0.52.0 → 0.53.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 (48) hide show
  1. package/dist/ai.js +169 -169
  2. package/dist/{article-BDVuehRt.js → article-qU2scA0w.js} +1 -1
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +1 -1
  5. package/dist/{categorical-values-BoS03HcI.js → categorical-values-DHl0r9od.js} +1 -1
  6. package/dist/charts/cartesian.js +1 -1
  7. package/dist/charts/comparison.js +1 -1
  8. package/dist/charts/distribution.js +1 -1
  9. package/dist/charts/figure.js +12 -12
  10. package/dist/charts/graph.js +1 -1
  11. package/dist/charts/hierarchy.js +1 -1
  12. package/dist/charts/image.js +1 -1
  13. package/dist/charts/matrix.js +1 -1
  14. package/dist/charts/plot.js +3 -3
  15. package/dist/charts/relationship.js +1 -1
  16. package/dist/charts/text.js +1 -1
  17. package/dist/charts/timeline.js +1 -1
  18. package/dist/charts/trend.js +1 -1
  19. package/dist/charts.js +2 -2
  20. package/dist/content/markdown.js +1 -278
  21. package/dist/{dumbbell-plot-Xxl6P7D1.js → dumbbell-plot-CKNqa-L2.js} +3 -3
  22. package/dist/{embedding-map-tU8hT_aC.js → embedding-map-DyCE2isi.js} +3 -3
  23. package/dist/{figure-frame-BKc9TvtX.js → figure-frame-DVZlUsa7.js} +1 -1
  24. package/dist/{image-grid-BZy2lkNb.js → image-grid-FByan2gk.js} +2 -2
  25. package/dist/kits/evaluation.js +3 -3
  26. package/dist/kits/interpretability.js +6 -6
  27. package/dist/kits/operations.js +3 -3
  28. package/dist/kits/research.js +2 -2
  29. package/dist/kits/training.js +2 -2
  30. package/dist/markdown-VpLw_P9T.js +313 -0
  31. package/dist/mdx.js +2 -2
  32. package/dist/packages/charts/src/trend/line-locate.d.ts +5 -3
  33. package/dist/packages/content/src/markdown/markdown.d.ts +8 -1
  34. package/dist/{plot-layout-D8j-ozGR.js → plot-layout-DjXbV9Lf.js} +4 -1
  35. package/dist/{plot-surface-5e3xeiub.js → plot-surface-BJuVNKMs.js} +1 -1
  36. package/dist/{reference-lines-1FttCg46.js → reference-lines-DLCFC7OO.js} +1 -1
  37. package/dist/{scene-8F-fQksU.js → scene-C4Q0pFav.js} +4 -4
  38. package/dist/scene.js +1 -1
  39. package/dist/{slope-chart-B35ZfaYn.js → slope-chart-DgpKO_1Y.js} +289 -288
  40. package/dist/{time-series-DoFMGmFV.js → time-series-BrM0g-aY.js} +5 -5
  41. package/dist/{token-heatmap-DLPQWwMv.js → token-heatmap-DKIPkRXQ.js} +2 -2
  42. package/dist/{token-predictions-D_Jwf8Aw.js → token-predictions-CKcNk4ks.js} +3 -3
  43. package/dist/{tree-diagram-DreDBCvt.js → tree-diagram-ZLk2jDUv.js} +3 -3
  44. package/dist/{treemap-MVX-wa4t.js → treemap-D6uNK6Tw.js} +4 -4
  45. package/dist/{violin-plot-Bi71NqXF.js → violin-plot-DeHiuWU_.js} +3 -3
  46. package/dist/{waterfall-8y8ANO3c.js → waterfall-CihTq6le.js} +3 -3
  47. package/package.json +1 -1
  48. package/dist/visible-motion-1GcUaEi4.js +0 -23
@@ -1,62 +1,62 @@
1
1
  import { t as e } from "./accessibility-P89UG9-r.js";
2
- import { A as t, E as n, M as r, S as i, a, j as o, l as s, n as c, o as l, s as u, t as d } from "./plot-layout-D8j-ozGR.js";
2
+ import { A as t, E as n, M as r, S as i, a, j as o, l as s, n as c, o as l, s as u, t as d } from "./plot-layout-DjXbV9Lf.js";
3
3
  import { i as f, r as p } from "./chart-link-AE_xuxiP.js";
4
4
  import { a as m } from "./tone-scope-DKiSw-JR.js";
5
5
  import { r as h, t as g } from "./figure-format-B8kRZMlo.js";
6
6
  import { a as _, o as v, r as y } from "./scale-C2xgZyZN.js";
7
7
  import { t as b } from "./chart-cursor-1mFd48Jc.js";
8
- import { c as x, i as ee, l as S, n as te, o as C, r as w, t as T } from "./figure-frame-BKc9TvtX.js";
8
+ import { c as x, i as ee, l as S, n as C, o as w, r as te, t as T } from "./figure-frame-DVZlUsa7.js";
9
9
  import { n as E } from "./plot-width-D3hTycYX.js";
10
10
  import { t as D } from "./plot-axes-D5S9BnBa.js";
11
11
  import { a as O, c as k, l as A, n as ne, o as re } from "./plot-marks-FVsbFkUs.js";
12
- import { n as ie, r as ae, t as oe } from "./plot-surface-5e3xeiub.js";
12
+ import { n as ie, r as ae, t as oe } from "./plot-surface-BJuVNKMs.js";
13
13
  import { t as j } from "./label-spacing-BncjePGb.js";
14
14
  import { n as se, t as ce } from "./label-place-Z0fryBZb.js";
15
- import { t as le } from "./reference-lines-1FttCg46.js";
15
+ import { t as le } from "./reference-lines-DLCFC7OO.js";
16
16
  import { n as ue, r as M, t as de } from "./path-BglsXpnO.js";
17
17
  import { t as fe } from "./locate-Bcg3QcP4.js";
18
18
  import { t as N } from "./heatmap-scale-Zte6Ya-g.js";
19
19
  import * as P from "@stylexjs/stylex";
20
- import { useId as pe, useState as F } from "react";
21
- import { Fragment as me, jsx as I, jsxs as L } from "react/jsx-runtime";
20
+ import { useId as pe, useState as me } from "react";
21
+ import { Fragment as he, jsx as F, jsxs as I } from "react/jsx-runtime";
22
22
  // packages/charts/src/trend/end-labels.tsx
23
- var R = 6.5, z = 8, B = 14, V = 4, H = .4, U = { cursor: {
23
+ var L = 6.5, R = 8, z = 14, B = 4, V = .4, H = { cursor: {
24
24
  kDwRjp: "xbh8q5q",
25
25
  kfzvcC: "x47corl",
26
26
  $$css: !0
27
27
  } };
28
- function W({ labels: e, width: t }) {
28
+ function U({ labels: e, width: t }) {
29
29
  let n = Math.max(0, ...e.map((e) => e.length));
30
- return Math.min(n * R + z, t * H);
30
+ return Math.min(n * L + R, t * V);
31
31
  }
32
- function he(e) {
33
- return Math.max(1, Math.floor((e - z) / R));
32
+ function W(e) {
33
+ return Math.max(1, Math.floor((e - R) / L));
34
34
  }
35
35
  function ge(e, t) {
36
36
  return e.length <= t ? e : `${e.slice(0, Math.max(1, t - 1))}…`;
37
37
  }
38
38
  function G(e) {
39
- return e * B;
39
+ return e * z;
40
40
  }
41
41
  function _e({ labels: e, x: t, anchor: n, top: r, bottom: i }) {
42
42
  let a = e.toSorted((e, t) => e.y - t.y), o = j({
43
43
  positions: a.map((e) => e.y),
44
- gap: B,
44
+ gap: z,
45
45
  start: r,
46
46
  end: i
47
- }), s = n === "end" ? -8 : z;
48
- return a.map((e, r) => /* @__PURE__ */ I(k, {
47
+ }), s = n === "end" ? -8 : R;
48
+ return a.map((e, r) => /* @__PURE__ */ F(k, {
49
49
  x: t + s,
50
- y: (o[r] ?? e.y) + V,
50
+ y: (o[r] ?? e.y) + B,
51
51
  anchor: n,
52
52
  tone: e.tone,
53
53
  children: e.text
54
54
  }, e.id));
55
55
  }
56
56
  function ve({ d: e }) {
57
- return /* @__PURE__ */ I("path", {
57
+ return /* @__PURE__ */ F("path", {
58
58
  d: e,
59
- ...P.props(U.cursor, E.shapeCursor)
59
+ ...P.props(H.cursor, E.shapeCursor)
60
60
  });
61
61
  }
62
62
  // packages/charts/src/trend/line-locate.ts
@@ -82,18 +82,19 @@ function ye(e, t) {
82
82
  });
83
83
  return Math.min(Infinity, ...n);
84
84
  }
85
- function q({ lines: e, width: t, height: n }) {
86
- return (r) => {
87
- let i = {
88
- x: r.x / r.width * t,
89
- y: r.y / r.height * n
90
- }, a = e.map((e) => ye(i, e.points));
91
- return e[a.indexOf(Math.min(...a))]?.id;
85
+ var q = 10;
86
+ function J({ lines: e, width: t, height: n, maxDistance: r = q }) {
87
+ return (i) => {
88
+ let a = {
89
+ x: i.x / i.width * t,
90
+ y: i.y / i.height * n
91
+ }, o = e.map((e) => ye(a, e.points)), s = Math.min(...o);
92
+ return s > r ? void 0 : e[o.indexOf(s)]?.id;
92
93
  };
93
94
  }
94
95
  // packages/charts/src/trend/column-figure.tsx
95
- var J = 3.5;
96
- function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTicks: u, yTitle: d, lines: p, items: m, legend: h, marks: g, selected: _, onSelectedChange: v }) {
96
+ var Y = 3.5;
97
+ function be({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTicks: u, yTitle: d, lines: p, items: m, legend: h, marks: g, selected: _, onSelectedChange: v }) {
97
98
  let y = pe(), b = f(), x = v !== void 0, ee = p.map((e) => ({
98
99
  id: e.id,
99
100
  points: c.map((t, n) => ({
@@ -101,19 +102,19 @@ function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTic
101
102
  y: e.ys[n] ?? null
102
103
  }))
103
104
  }));
104
- return /* @__PURE__ */ I(n, {
105
+ return /* @__PURE__ */ F(n, {
105
106
  ...b,
106
107
  items: m,
107
108
  selected: _,
108
109
  onSelect: v,
109
- locate: q({
110
+ locate: J({
110
111
  lines: ee,
111
112
  width: s.width,
112
113
  height: s.height
113
114
  }),
114
115
  render: (n, f) => {
115
- let _ = f.inspected ?? f.selected, v = ee.find((e) => e.id === f.cursor), b = p.toSorted((e, t) => Number(e.id === _) - Number(t.id === _)), C = c.length - 1;
116
- function w(e, t) {
116
+ let _ = f.inspected ?? f.selected, v = ee.find((e) => e.id === f.cursor), b = p.toSorted((e, t) => Number(e.id === _) - Number(t.id === _)), w = c.length - 1;
117
+ function te(e, t) {
117
118
  return p.flatMap((n) => {
118
119
  let r = n.ys[e];
119
120
  return r == null ? [] : [{
@@ -124,15 +125,15 @@ function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTic
124
125
  }];
125
126
  });
126
127
  }
127
- return /* @__PURE__ */ I(te, {
128
+ return /* @__PURE__ */ F(C, {
128
129
  ...e,
129
130
  figure: n,
130
131
  series: h,
131
- footer: p.length === 0 ? void 0 : /* @__PURE__ */ I(i, {
132
+ footer: p.length === 0 ? void 0 : /* @__PURE__ */ F(i, {
132
133
  id: y,
133
134
  children: t(m, f.inspected)
134
135
  }),
135
- children: p.length === 0 ? /* @__PURE__ */ I(T, { children: r }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
136
+ children: p.length === 0 ? /* @__PURE__ */ F(T, { children: r }) : /* @__PURE__ */ I(he, { children: [/* @__PURE__ */ I(ie, {
136
137
  plotRef: a,
137
138
  box: s,
138
139
  label: o({
@@ -142,51 +143,51 @@ function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTic
142
143
  }),
143
144
  readoutId: y,
144
145
  children: [
145
- /* @__PURE__ */ I(D, {
146
+ /* @__PURE__ */ F(D, {
146
147
  box: s,
147
148
  xTicks: l,
148
149
  yTicks: u,
149
150
  yTitle: d,
150
151
  grid: "both"
151
152
  }),
152
- /* @__PURE__ */ L(oe, {
153
+ /* @__PURE__ */ I(oe, {
153
154
  box: s,
154
155
  children: [b.map((e) => {
155
156
  let t = c.map((t, n) => ({
156
157
  x: t,
157
158
  y: e.ys[n] ?? null
158
159
  })), n = _ === null || _ === e.id ? "normal" : "receded";
159
- return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I(A, {
160
+ return /* @__PURE__ */ I("g", { children: [/* @__PURE__ */ F(A, {
160
161
  d: M(t),
161
162
  tone: e.tone,
162
163
  emphasis: n
163
- }), t.flatMap((t) => t.y === null ? [] : [/* @__PURE__ */ I(O, {
164
+ }), t.flatMap((t) => t.y === null ? [] : [/* @__PURE__ */ F(O, {
164
165
  x: t.x,
165
166
  y: t.y,
166
167
  tone: e.tone,
167
- radius: J,
168
+ radius: Y,
168
169
  emphasis: n,
169
170
  isInspected: f.inspected === e.id,
170
171
  isSelected: f.selected === e.id
171
172
  }, t.x)])] }, e.id);
172
- }), v !== void 0 && /* @__PURE__ */ I(ve, { d: M(v.points) })]
173
+ }), v !== void 0 && /* @__PURE__ */ F(ve, { d: M(v.points) })]
173
174
  }),
174
- /* @__PURE__ */ I(_e, {
175
- labels: w(0, (e) => e.startLabel),
175
+ /* @__PURE__ */ F(_e, {
176
+ labels: te(0, (e) => e.startLabel),
176
177
  x: c[0] ?? s.left,
177
178
  anchor: "end",
178
179
  top: s.top,
179
180
  bottom: s.bottom
180
181
  }),
181
- /* @__PURE__ */ I(_e, {
182
- labels: w(C, (e) => e.endLabel),
183
- x: c[C] ?? s.right,
182
+ /* @__PURE__ */ F(_e, {
183
+ labels: te(w, (e) => e.endLabel),
184
+ x: c[w] ?? s.right,
184
185
  anchor: "start",
185
186
  top: s.top,
186
187
  bottom: s.bottom
187
188
  })
188
189
  ]
189
- }), /* @__PURE__ */ I(S, {
190
+ }), /* @__PURE__ */ F(S, {
190
191
  label: `${e.title} values`,
191
192
  columns: [{
192
193
  id: "line",
@@ -202,11 +203,11 @@ function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTic
202
203
  });
203
204
  }
204
205
  // packages/charts/src/trend/column-positions.ts
205
- var be = .5, xe = 7, Se = 16;
206
- function X({ box: e, columnLabels: t, leftGutter: n, rightGutter: r }) {
207
- let i = t.length, a = Math.max(0, ...t.map((e) => e.length)), o = Math.min((i - 1) * (a * xe + Se), e.innerWidth * be), s = n + r, c = s > 0 ? Math.min(1, Math.max(0, e.innerWidth - o) / s) : 1, l = n * c, u = r * c, d = e.left + l, f = Math.max(0, e.right - u - d);
206
+ var xe = .5, Se = 7, X = 16;
207
+ function Ce({ box: e, columnLabels: t, leftGutter: n, rightGutter: r }) {
208
+ let i = t.length, a = Math.max(0, ...t.map((e) => e.length)), o = Math.min((i - 1) * (a * Se + X), e.innerWidth * xe), s = n + r, c = s > 0 ? Math.min(1, Math.max(0, e.innerWidth - o) / s) : 1, l = n * c, u = r * c, d = e.left + l, f = Math.max(0, e.right - u - d);
208
209
  return {
209
- xs: Array.from({ length: i }, (e, t) => d + (i > 1 ? f * t / (i - 1) : f * be)),
210
+ xs: Array.from({ length: i }, (e, t) => d + (i > 1 ? f * t / (i - 1) : f * xe)),
210
211
  leftGutter: l,
211
212
  rightGutter: u
212
213
  };
@@ -216,8 +217,8 @@ var Z = {
216
217
  items: 30,
217
218
  stages: 24,
218
219
  rank: 100
219
- }, Ce = 48, we = 18, Te = .5;
220
- function Ee({ stages: e, items: t }) {
220
+ }, we = 48, Te = 18, Ee = .5;
221
+ function De({ stages: e, items: t }) {
221
222
  if (!r(e) || !r(t)) return "Stages and items must have unique identifiers.";
222
223
  if (t.length > Z.items || e.length > Z.stages) return `This chart draws at most ${Z.items} items over ${Z.stages} stages.`;
223
224
  let n = t.find((t) => t.ranks.length !== e.length);
@@ -230,17 +231,17 @@ function Ee({ stages: e, items: t }) {
230
231
  });
231
232
  return a === void 0 ? void 0 : `Two items share a rank at stage ${a.id}. Supply one item per rank.`;
232
233
  }
233
- function De(e) {
234
+ function Oe(e) {
234
235
  let { stages: t, items: n, height: r = "regular", ...i } = e, { emptyLabel: a = "No ranks are available.", ...o } = i, { locale: c } = o, l = ae(r), d = m();
235
- if (o.status === "loading") return /* @__PURE__ */ I(ee, {
236
+ if (o.status === "loading") return /* @__PURE__ */ F(ee, {
236
237
  ...o,
237
238
  height: r
238
239
  });
239
- let f = Ee({
240
+ let f = De({
240
241
  stages: t,
241
242
  items: n
242
243
  });
243
- if (f !== void 0) return /* @__PURE__ */ I(w, {
244
+ if (f !== void 0) return /* @__PURE__ */ F(te, {
244
245
  ...o,
245
246
  message: f
246
247
  });
@@ -258,7 +259,7 @@ function De(e) {
258
259
  tone: e.tone,
259
260
  index: t
260
261
  })
261
- })), v = Math.max(1, ...n.flatMap((e) => e.ranks.flatMap((e) => e ?? []))), b = W({
262
+ })), v = Math.max(1, ...n.flatMap((e) => e.ranks.flatMap((e) => e ?? []))), b = U({
262
263
  labels: _.map((e) => e.label),
263
264
  width: l.width
264
265
  }), x = s({
@@ -268,16 +269,16 @@ function De(e) {
268
269
  hasYTitle: !0
269
270
  }), S = u({
270
271
  width: l.width,
271
- height: Math.max(l.height, G(Math.max(v, n.length)) + Ce),
272
+ height: Math.max(l.height, G(Math.max(v, n.length)) + we),
272
273
  margins: x
273
- }), te = y({
274
- domain: [Te, v + Te],
274
+ }), C = y({
275
+ domain: [Ee, v + Ee],
275
276
  range: [S.top, S.bottom]
276
- }), C = Math.max(1, Math.ceil(we / (S.innerHeight / v))), T = Array.from({ length: v }, (e, t) => t + 1).filter((e) => (e - 1) % C == 0).map((e) => ({
277
+ }), w = Math.max(1, Math.ceil(Te / (S.innerHeight / v))), T = Array.from({ length: v }, (e, t) => t + 1).filter((e) => (e - 1) % w == 0).map((e) => ({
277
278
  key: String(e),
278
- position: te.position(e),
279
+ position: C.position(e),
279
280
  label: String(e)
280
- })), E = X({
281
+ })), E = Ce({
281
282
  box: S,
282
283
  columnLabels: t.map((e) => e.label),
283
284
  leftGutter: b,
@@ -287,11 +288,11 @@ function De(e) {
287
288
  position: D[t] ?? S.left,
288
289
  label: e.label
289
290
  })), k = _.map((e) => {
290
- let t = ge(e.label, he(Math.min(E.leftGutter, E.rightGutter)));
291
+ let t = ge(e.label, W(Math.min(E.leftGutter, E.rightGutter)));
291
292
  return {
292
293
  id: e.id,
293
294
  tone: e.tone,
294
- ys: e.ranks.map((e) => e === null ? null : te.position(e)),
295
+ ys: e.ranks.map((e) => e === null ? null : C.position(e)),
295
296
  startLabel: t,
296
297
  endLabel: t
297
298
  };
@@ -299,7 +300,7 @@ function De(e) {
299
300
  id: e.id,
300
301
  label: `${e.label}: ${t.map((t, n) => `${t.label} ${p(e.ranks[n])}`).join(" · ")}`
301
302
  }));
302
- return /* @__PURE__ */ I(Y, {
303
+ return /* @__PURE__ */ F(be, {
303
304
  frame: o,
304
305
  emptyLabel: a,
305
306
  plotRef: l.ref,
@@ -325,8 +326,8 @@ var Q = {
325
326
  pointsPerSeries: 2e3,
326
327
  references: 8,
327
328
  markers: 8
328
- }, Oe = 6, ke = 12, Ae = 12, je = 2.5;
329
- function Me({ series: e, references: t, markers: n, xDomain: i, yDomain: a, x: o, y: s }) {
329
+ }, ke = 6, Ae = 12, je = 12, Me = 2.5;
330
+ function Ne({ series: e, references: t, markers: n, xDomain: i, yDomain: a, x: o, y: s }) {
330
331
  let c = v(i, o.scale) ?? v(a, s.scale);
331
332
  if (c !== void 0) return c;
332
333
  if (!r(e) || !r(t)) return "Series and reference lines must have unique identifiers.";
@@ -344,26 +345,26 @@ function Me({ series: e, references: t, markers: n, xDomain: i, yDomain: a, x: o
344
345
  if (t.some((e) => _(e.y, a))) return "A reference line lies outside the declared domain.";
345
346
  if (n.some((e) => _(e.x, i))) return "A marker lies outside the x domain.";
346
347
  }
347
- function Ne(e) {
348
- let { series: t, x: r, y: i, references: s = [], curve: u = "linear", labels: d = "legend", height: g = "regular", ..._ } = e, { highlighted: v, markers: y = [], ...x } = _, { emptyLabel: E = "No observations are available.", ...j } = x, { locale: N, title: P } = j, F = ae(g), R = pe(), z = m(), B = f(), V = p({
348
+ function Pe(e) {
349
+ let { series: t, x: r, y: i, references: s = [], curve: u = "linear", labels: d = "legend", height: g = "regular", ..._ } = e, { highlighted: v, markers: y = [], ...x } = _, { emptyLabel: E = "No observations are available.", ...j } = x, { locale: N, title: P } = j, me = ae(g), L = pe(), R = m(), z = f(), B = p({
349
350
  ids: t.map((e) => e.id),
350
351
  highlighted: v
351
352
  });
352
- if (j.status === "loading") return /* @__PURE__ */ I(ee, {
353
+ if (j.status === "loading") return /* @__PURE__ */ F(ee, {
353
354
  ...j,
354
355
  height: g
355
356
  });
356
- let H = t.flatMap((e) => e.points), U = H.flatMap((e) => [
357
+ let V = t.flatMap((e) => e.points), H = V.flatMap((e) => [
357
358
  e.y,
358
359
  e.lower ?? null,
359
360
  e.upper ?? null
360
361
  ]), G = r.domain ?? a({
361
- values: H.map((e) => e.x),
362
+ values: V.map((e) => e.x),
362
363
  scale: r.scale
363
364
  }), ve = i.domain ?? a({
364
- values: [...U, ...s.map((e) => e.y)],
365
+ values: [...H, ...s.map((e) => e.y)],
365
366
  scale: i.scale
366
- }), K = Me({
367
+ }), K = Ne({
367
368
  series: t,
368
369
  references: s,
369
370
  markers: y,
@@ -372,16 +373,16 @@ function Ne(e) {
372
373
  x: r,
373
374
  y: i
374
375
  });
375
- if (K !== void 0) return /* @__PURE__ */ I(w, {
376
+ if (K !== void 0) return /* @__PURE__ */ F(te, {
376
377
  ...j,
377
378
  message: K
378
379
  });
379
- let ye = d === "inline" ? W({
380
+ let ye = d === "inline" ? U({
380
381
  labels: t.map((e) => e.label),
381
- width: F.width
382
+ width: me.width
382
383
  }) : 0, q = l({
383
- width: F.width,
384
- height: F.height,
384
+ width: me.width,
385
+ height: me.height,
385
386
  x: r,
386
387
  y: i,
387
388
  xDomain: G,
@@ -390,12 +391,12 @@ function Ne(e) {
390
391
  rightGutter: ye
391
392
  }), { box: J } = q, Y = t.map((e, t) => ({
392
393
  ...e,
393
- tone: z({
394
+ tone: R({
394
395
  id: e.id,
395
396
  tone: e.tone,
396
397
  index: t
397
398
  })
398
- })), be = [...Y.filter((e) => e.id !== V), ...Y.filter((e) => e.id === V)], xe = [...new Set(H.map((e) => e.x))].toSorted((e, t) => e - t);
399
+ })), be = [...Y.filter((e) => e.id !== B), ...Y.filter((e) => e.id === B)], xe = [...new Set(V.map((e) => e.x))].toSorted((e, t) => e - t);
399
400
  function Se(e) {
400
401
  return h({
401
402
  value: e,
@@ -410,10 +411,10 @@ function Ne(e) {
410
411
  format: i.format
411
412
  });
412
413
  }
413
- function Z(e) {
414
- return e.isContext === !0 ? "context" : V === null || e.id === V ? "normal" : "receded";
415
- }
416
414
  function Ce(e) {
415
+ return e.isContext === !0 ? "context" : B === null || e.id === B ? "normal" : "receded";
416
+ }
417
+ function Z(e) {
417
418
  return Y.flatMap((t) => {
418
419
  let n = t.points.find((t) => t.x === e);
419
420
  if (n === void 0) return [];
@@ -427,7 +428,7 @@ function Ne(e) {
427
428
  });
428
429
  }
429
430
  let we = xe.map((e) => {
430
- let t = Ce(e).map((e) => `${e.label}: ${e.value}`);
431
+ let t = Z(e).map((e) => `${e.label}: ${e.value}`);
431
432
  return {
432
433
  id: String(e),
433
434
  label: [`${r.label} ${Se(e)}`, ...t].join(" · ")
@@ -444,28 +445,28 @@ function Ne(e) {
444
445
  })), De = Y.map((e) => e.points.flatMap((e) => e.y === null ? [] : [{
445
446
  x: q.x.position(e.x),
446
447
  y: q.y.position(e.y)
447
- }])), Q = y.map((e) => {
448
- let t = q.x.position(e.x), n = J.top + ke, r = J.bottom - Oe, i = [
448
+ }])), Oe = y.map((e) => {
449
+ let t = q.x.position(e.x), n = J.top + Ae, r = J.bottom - ke, i = [
449
450
  {
450
- x: t + Oe,
451
+ x: t + ke,
451
452
  y: n,
452
453
  anchor: "start",
453
454
  text: e.label
454
455
  },
455
456
  {
456
- x: t - Oe,
457
+ x: t - ke,
457
458
  y: n,
458
459
  anchor: "end",
459
460
  text: e.label
460
461
  },
461
462
  {
462
- x: t + Oe,
463
+ x: t + ke,
463
464
  y: r,
464
465
  anchor: "start",
465
466
  text: e.label
466
467
  },
467
468
  {
468
- x: t - Oe,
469
+ x: t - ke,
469
470
  y: r,
470
471
  anchor: "end",
471
472
  text: e.label
@@ -483,8 +484,8 @@ function Ne(e) {
483
484
  })
484
485
  };
485
486
  });
486
- return /* @__PURE__ */ I(n, {
487
- ...B,
487
+ return /* @__PURE__ */ F(n, {
488
+ ...z,
488
489
  items: we,
489
490
  locate: fe({
490
491
  marks: Ee,
@@ -494,40 +495,40 @@ function Ne(e) {
494
495
  }),
495
496
  render: (e, { inspected: t, cursor: n }) => {
496
497
  let a = xe.find((e) => String(e) === t), l = xe.find((e) => String(e) === n);
497
- return /* @__PURE__ */ I(te, {
498
+ return /* @__PURE__ */ F(C, {
498
499
  ...j,
499
500
  figure: e,
500
501
  series: Te,
501
- seriesLegend: H.length === 0 ? void 0 : /* @__PURE__ */ I(C, {
502
- id: R,
502
+ seriesLegend: V.length === 0 ? void 0 : /* @__PURE__ */ F(w, {
503
+ id: L,
503
504
  label: a === void 0 ? void 0 : `${r.label} ${Se(a)}`,
504
505
  legend: Te,
505
- rows: a === void 0 ? [] : Ce(a),
506
+ rows: a === void 0 ? [] : Z(a),
506
507
  x: a === void 0 ? 0 : q.x.position(a),
507
508
  width: J.width,
508
509
  hasLegend: d === "legend"
509
510
  }),
510
- children: H.length === 0 ? /* @__PURE__ */ I(T, { children: E }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
511
- plotRef: F.ref,
511
+ children: V.length === 0 ? /* @__PURE__ */ F(T, { children: E }) : /* @__PURE__ */ I(he, { children: [/* @__PURE__ */ I(ie, {
512
+ plotRef: me.ref,
512
513
  box: J,
513
514
  label: o({
514
515
  title: P,
515
516
  marks: `${r.label} values`,
516
517
  isSelectable: !1
517
518
  }),
518
- readoutId: R,
519
+ readoutId: L,
519
520
  children: [
520
- /* @__PURE__ */ I(D, {
521
+ /* @__PURE__ */ F(D, {
521
522
  box: J,
522
523
  xTicks: q.xTicks,
523
524
  yTicks: q.yTicks,
524
525
  xTitle: c(r),
525
526
  yTitle: c(i)
526
527
  }),
527
- /* @__PURE__ */ L(oe, {
528
+ /* @__PURE__ */ I(oe, {
528
529
  box: J,
529
530
  children: [be.map((e) => {
530
- let t = Z(e), n = e.points.map((e) => ({
531
+ let t = Ce(e), n = e.points.map((e) => ({
531
532
  x: q.x.position(e.x),
532
533
  y: e.y === null ? null : q.y.position(e.y)
533
534
  })), r = e.points.map((e) => ({
@@ -535,29 +536,29 @@ function Ne(e) {
535
536
  y0: typeof e.lower == "number" ? q.y.position(e.lower) : null,
536
537
  y1: typeof e.upper == "number" ? q.y.position(e.upper) : null
537
538
  }));
538
- return /* @__PURE__ */ L("g", { children: [
539
- /* @__PURE__ */ I(ne, {
539
+ return /* @__PURE__ */ I("g", { children: [
540
+ /* @__PURE__ */ F(ne, {
540
541
  d: de(r),
541
542
  tone: e.tone,
542
543
  emphasis: t
543
544
  }),
544
- /* @__PURE__ */ I(A, {
545
+ /* @__PURE__ */ F(A, {
545
546
  d: M(n, u),
546
547
  tone: e.tone,
547
548
  stroke: e.stroke,
548
549
  emphasis: t
549
550
  }),
550
- ue(n).map((n) => /* @__PURE__ */ I(O, {
551
+ ue(n).map((n) => /* @__PURE__ */ F(O, {
551
552
  x: n.x,
552
553
  y: n.y,
553
554
  tone: e.tone,
554
- radius: je,
555
+ radius: Me,
555
556
  emphasis: t
556
557
  }, n.x))
557
558
  ] }, e.id);
558
559
  }), a !== void 0 && be.flatMap((e) => {
559
560
  let t = e.points.find((e) => e.x === a);
560
- return t === void 0 || t.y === null ? [] : [/* @__PURE__ */ I(O, {
561
+ return t === void 0 || t.y === null ? [] : [/* @__PURE__ */ F(O, {
561
562
  x: q.x.position(t.x),
562
563
  y: q.y.position(t.y),
563
564
  tone: e.tone,
@@ -565,17 +566,17 @@ function Ne(e) {
565
566
  }, e.id)];
566
567
  })]
567
568
  }),
568
- Q.map((e) => /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I(re, {
569
+ Oe.map((e) => /* @__PURE__ */ I("g", { children: [/* @__PURE__ */ F(re, {
569
570
  x: e.x,
570
571
  top: J.top,
571
572
  bottom: J.bottom
572
- }), e.spot !== void 0 && /* @__PURE__ */ I(k, {
573
+ }), e.spot !== void 0 && /* @__PURE__ */ F(k, {
573
574
  x: e.spot.x,
574
575
  y: e.spot.y,
575
576
  anchor: e.spot.anchor,
576
577
  children: e.spot.text
577
578
  })] }, e.key)),
578
- /* @__PURE__ */ I(le, {
579
+ /* @__PURE__ */ F(le, {
579
580
  lines: s.map((e) => ({
580
581
  id: e.id,
581
582
  label: e.label,
@@ -586,12 +587,12 @@ function Ne(e) {
586
587
  valueText: X,
587
588
  obstacles: De
588
589
  }),
589
- d === "inline" && /* @__PURE__ */ I(_e, {
590
+ d === "inline" && /* @__PURE__ */ F(_e, {
590
591
  labels: be.flatMap((e) => {
591
592
  let t = e.points.findLast((e) => e.y !== null);
592
593
  return t === void 0 || t.y === null ? [] : [{
593
594
  id: e.id,
594
- text: ge(e.label, he(ye)),
595
+ text: ge(e.label, W(ye)),
595
596
  tone: e.isContext === !0 ? "neutral" : e.tone,
596
597
  y: q.y.position(t.y)
597
598
  }];
@@ -601,14 +602,14 @@ function Ne(e) {
601
602
  top: J.top,
602
603
  bottom: J.bottom
603
604
  }),
604
- l !== void 0 && /* @__PURE__ */ I(b, {
605
+ l !== void 0 && /* @__PURE__ */ F(b, {
605
606
  x: q.x.position(l),
606
607
  top: J.top,
607
608
  bottom: J.bottom,
608
- width: Ae
609
+ width: je
609
610
  })
610
611
  ]
611
- }), /* @__PURE__ */ I(S, {
612
+ }), /* @__PURE__ */ F(S, {
612
613
  label: `${P} observations`,
613
614
  columns: [{
614
615
  id: "observation",
@@ -624,14 +625,14 @@ function Ne(e) {
624
625
  });
625
626
  }
626
627
  // packages/charts/src/trend/horizon-chart.tsx
627
- var Pe = {
628
+ var Fe = {
628
629
  series: 40,
629
630
  pointsPerSeries: 1e3
630
- }, Fe = {
631
+ }, Ie = {
631
632
  compact: 16,
632
633
  regular: 24,
633
634
  tall: 36
634
- }, Ie = 2, Le = 8, Re = 4, ze = 12, Be = 96, Ve = 44, He = "\xA0", Ue = {
635
+ }, Le = 2, Re = 8, ze = 4, Be = 12, Ve = 96, He = 44, Ue = "\xA0", We = {
635
636
  k1xSpc: "x1rg5ohu",
636
637
  kzqmXN: "xsmyaan",
637
638
  kZKoxP: "xdk7pt",
@@ -639,9 +640,9 @@ var Pe = {
639
640
  ksu8eU: "x1y0btm7",
640
641
  kVAM5u: "x1ey3b81",
641
642
  $$css: !0
642
- }, We = {
643
+ }, Ge = {
643
644
  swatch: (e) => [
644
- Ue,
645
+ We,
645
646
  {
646
647
  kWkggS: e == null ? e : "xl8spv7",
647
648
  $$css: !0
@@ -653,21 +654,21 @@ var Pe = {
653
654
  $$css: !0
654
655
  }, { "--x-fill": e ?? void 0 }]
655
656
  };
656
- function Ge({ series: e, xDomain: t, x: n, value: i }) {
657
+ function Ke({ series: e, xDomain: t, x: n, value: i }) {
657
658
  let a = v(t, n.scale) ?? v(i.domain);
658
659
  if (a !== void 0) return a;
659
660
  if (i.scale !== void 0 && i.scale !== "linear") return "A horizon chart folds values on a linear axis.";
660
661
  if (i.domain[0] > 0 || i.domain[1] < 0) return "The value domain must contain zero, which is where the rows fold.";
661
662
  if (!r(e)) return "Series must have unique identifiers.";
662
- if (e.length > Pe.series) return `This chart draws at most ${Pe.series} series. Supply the ones to compare.`;
663
- let o = e.find((e) => e.points.length > Pe.pointsPerSeries);
664
- if (o !== void 0) return `Series ${o.id} exceeds ${Pe.pointsPerSeries} points. Supply a coarser sample.`;
663
+ if (e.length > Fe.series) return `This chart draws at most ${Fe.series} series. Supply the ones to compare.`;
664
+ let o = e.find((e) => e.points.length > Fe.pointsPerSeries);
665
+ if (o !== void 0) return `Series ${o.id} exceeds ${Fe.pointsPerSeries} points. Supply a coarser sample.`;
665
666
  let s = e.find((e) => e.points.some((t, n) => n > 0 && t.x <= (e.points[n - 1]?.x ?? 0)) || e.points.some((e) => _(e.x, t)));
666
667
  if (s !== void 0) return `Series ${s.id} needs strictly increasing x values inside the declared domain.`;
667
668
  let c = e.find((e) => e.points.some((e) => e.y !== null && _(e.y, i.domain)));
668
669
  return c === void 0 ? void 0 : `Series ${c.id} has a value that is not finite or lies outside the declared domain.`;
669
670
  }
670
- function Ke({ domain: e, bands: t }) {
671
+ function qe({ domain: e, bands: t }) {
671
672
  let n = Math.max(e[1], -e[0]) / t, r = {
672
673
  domain: [-n * t, n * t],
673
674
  palette: "diverging"
@@ -678,153 +679,153 @@ function Ke({ domain: e, bands: t }) {
678
679
  negative: i.map((e) => N(-e, r))
679
680
  };
680
681
  }
681
- function qe({ colors: e, format: t }) {
682
- return /* @__PURE__ */ L("p", {
682
+ function Je({ colors: e, format: t }) {
683
+ return /* @__PURE__ */ I("p", {
683
684
  "aria-label": "Band thresholds",
684
685
  className: "x78zum5 x1a02dak x6s0dn4 x8zbtdt x1gkm1c7 x1ghz6dp x153jb6y x1hz01jw xy8obcc xas2l8k xss6m8b",
685
686
  children: [
686
- /* @__PURE__ */ L("span", {
687
+ /* @__PURE__ */ I("span", {
687
688
  className: "x3nfvp2 x6s0dn4 xunmzkg",
688
- children: ["Above zero", e.positive.map((n, r) => /* @__PURE__ */ I("span", {
689
- ...P.props(We.swatch(n)),
689
+ children: ["Above zero", e.positive.map((n, r) => /* @__PURE__ */ F("span", {
690
+ ...P.props(Ge.swatch(n)),
690
691
  title: `${t(e.step * r)} to ${t(e.step * (r + 1))}`
691
692
  }, n))]
692
693
  }),
693
- /* @__PURE__ */ L("span", {
694
+ /* @__PURE__ */ I("span", {
694
695
  className: "x3nfvp2 x6s0dn4 xunmzkg",
695
- children: ["Below zero", e.negative.map((n, r) => /* @__PURE__ */ I("span", {
696
- ...P.props(We.swatch(n)),
696
+ children: ["Below zero", e.negative.map((n, r) => /* @__PURE__ */ F("span", {
697
+ ...P.props(Ge.swatch(n)),
697
698
  title: `${t(-e.step * r)} to ${t(-e.step * (r + 1))}`
698
699
  }, n))]
699
700
  }),
700
- /* @__PURE__ */ I("span", { children: `Each band adds ${t(e.step)}, up to ${t(e.step * e.positive.length)}` })
701
+ /* @__PURE__ */ F("span", { children: `Each band adds ${t(e.step)}, up to ${t(e.step * e.positive.length)}` })
701
702
  ]
702
703
  });
703
704
  }
704
- function Je(t) {
705
- let { series: r, x: i, value: l, bands: p, height: m = "regular", ...g } = t, { emptyLabel: _ = "No observations are available.", ...v } = g, { locale: C, title: O } = v, A = ae(m), ne = pe(), re = f();
706
- if (v.status === "loading") return /* @__PURE__ */ I(ee, {
705
+ function Ye(t) {
706
+ let { series: r, x: i, value: l, bands: p, height: m = "regular", ...g } = t, { emptyLabel: _ = "No observations are available.", ...v } = g, { locale: w, title: O } = v, A = ae(m), ne = pe(), re = f();
707
+ if (v.status === "loading") return /* @__PURE__ */ F(ee, {
707
708
  ...v,
708
709
  height: "compact"
709
710
  });
710
711
  let j = r.flatMap((e) => e.points), se = i.domain ?? a({
711
712
  values: j.map((e) => e.x),
712
713
  scale: i.scale
713
- }), ce = Ge({
714
+ }), ce = Ke({
714
715
  series: r,
715
716
  xDomain: se,
716
717
  x: i,
717
718
  value: l
718
719
  });
719
- if (ce !== void 0) return /* @__PURE__ */ I(w, {
720
+ if (ce !== void 0) return /* @__PURE__ */ F(te, {
720
721
  ...v,
721
722
  message: ce
722
723
  });
723
724
  function le(e) {
724
725
  return h({
725
726
  value: e,
726
- locale: C,
727
+ locale: w,
727
728
  format: i.format
728
729
  });
729
730
  }
730
731
  function ue(e) {
731
732
  return h({
732
733
  value: e,
733
- locale: C,
734
+ locale: w,
734
735
  format: l.format
735
736
  });
736
737
  }
737
- let M = Fe[m], N = M - Ie, F = s({
738
+ let M = Ie[m], N = M - Le, me = s({
738
739
  width: A.width,
739
740
  valueLabels: r.map((e) => e.label),
740
741
  hasXTitle: !0,
741
742
  hasYTitle: !1
742
- }), R = u({
743
+ }), L = u({
743
744
  width: A.width,
744
- height: F.top + r.length * M + Ve,
745
- margins: F
746
- }), z = y({
745
+ height: me.top + r.length * M + He,
746
+ margins: me
747
+ }), R = y({
747
748
  type: i.scale,
748
749
  domain: se,
749
- range: [R.left, R.right]
750
- }), B = Ke({
750
+ range: [L.left, L.right]
751
+ }), z = qe({
751
752
  domain: l.domain,
752
753
  bands: p
753
- }), V = he(R.left), H = d({
754
+ }), B = W(L.left), V = d({
754
755
  axis: i,
755
756
  domain: se,
756
- length: R.innerWidth,
757
- spacing: Be,
758
- locale: C,
757
+ length: L.innerWidth,
758
+ spacing: Ve,
759
+ locale: w,
759
760
  hasTitle: !0
760
- }), U = H.values.map((e, t) => ({
761
+ }), H = V.values.map((e, t) => ({
761
762
  key: String(e),
762
- position: z.position(e),
763
- label: H.labels[t] ?? ""
764
- })), W = [...new Set(j.map((e) => e.x))].toSorted((e, t) => e - t);
763
+ position: R.position(e),
764
+ label: V.labels[t] ?? ""
765
+ })), U = [...new Set(j.map((e) => e.x))].toSorted((e, t) => e - t);
765
766
  function G(e) {
766
767
  return r.map((t) => ({
767
768
  id: t.id,
768
769
  label: t.label,
769
770
  tone: "neutral",
770
- value: e === void 0 ? He : ue(t.points.find((t) => t.x === e)?.y ?? null)
771
+ value: e === void 0 ? Ue : ue(t.points.find((t) => t.x === e)?.y ?? null)
771
772
  }));
772
773
  }
773
- let _e = W.map((e) => ({
774
+ let _e = U.map((e) => ({
774
775
  id: String(e),
775
776
  label: [`${i.label} ${le(e)}`, ...G(e).map((e) => `${e.label}: ${e.value}`)].join(" · ")
776
- })), ve = W.map((e) => ({
777
+ })), ve = U.map((e) => ({
777
778
  id: String(e),
778
- x: z.position(e),
779
+ x: R.position(e),
779
780
  y: 0
780
781
  }));
781
- return /* @__PURE__ */ I(n, {
782
+ return /* @__PURE__ */ F(n, {
782
783
  ...re,
783
784
  items: _e,
784
785
  locate: fe({
785
786
  marks: ve,
786
- width: R.width,
787
- height: R.height,
787
+ width: L.width,
788
+ height: L.height,
788
789
  axis: "x"
789
790
  }),
790
791
  render: (t, { inspected: n, cursor: a }) => {
791
- let s = W.find((e) => String(e) === n), l = W.find((e) => String(e) === a), u = s === void 0 ? void 0 : `${i.label} ${le(s)}`, d = G(s);
792
- return /* @__PURE__ */ I(te, {
792
+ let s = U.find((e) => String(e) === n), l = U.find((e) => String(e) === a), u = s === void 0 ? void 0 : `${i.label} ${le(s)}`, d = G(s);
793
+ return /* @__PURE__ */ F(C, {
793
794
  ...v,
794
795
  figure: t,
795
- scaleLegend: r.length === 0 ? void 0 : /* @__PURE__ */ I(qe, {
796
- colors: B,
796
+ scaleLegend: r.length === 0 ? void 0 : /* @__PURE__ */ F(Je, {
797
+ colors: z,
797
798
  format: ue
798
799
  }),
799
- footer: r.length === 0 ? void 0 : /* @__PURE__ */ L("div", {
800
+ footer: r.length === 0 ? void 0 : /* @__PURE__ */ I("div", {
800
801
  className: "xrvj5dj x1hnptsi xeuugli",
801
- children: [/* @__PURE__ */ I("span", {
802
+ children: [/* @__PURE__ */ F("span", {
802
803
  id: ne,
803
804
  ...P.props(e.hidden),
804
805
  children: x({
805
806
  label: u,
806
807
  rows: d
807
808
  })
808
- }), /* @__PURE__ */ L("div", {
809
+ }), /* @__PURE__ */ I("div", {
809
810
  "aria-hidden": !0,
810
811
  className: "xrvj5dj xunmzkg xeuugli xbixft x1hz01jw xy8obcc xas2l8k xss6m8b",
811
- children: [/* @__PURE__ */ I("p", {
812
+ children: [/* @__PURE__ */ F("p", {
812
813
  ...{
813
814
  0: { className: "x1ghz6dp xk4h15q" },
814
815
  1: { className: "x1ghz6dp xk4h15q xlshs6z" }
815
816
  }[u === void 0 | 0],
816
- children: u ?? He
817
- }), /* @__PURE__ */ I("dl", {
817
+ children: u ?? Ue
818
+ }), /* @__PURE__ */ F("dl", {
818
819
  ...{
819
820
  0: { className: "xrvj5dj x10vl0y4 x8zbtdt xxs79tx x1ghz6dp" },
820
821
  1: { className: "xrvj5dj x10vl0y4 x8zbtdt xxs79tx x1ghz6dp xlshs6z" }
821
822
  }[u === void 0 | 0],
822
- children: d.map((e) => /* @__PURE__ */ L("div", {
823
+ children: d.map((e) => /* @__PURE__ */ I("div", {
823
824
  className: "x78zum5 x1qughib x1hnptsi xeuugli",
824
- children: [/* @__PURE__ */ I("dt", {
825
+ children: [/* @__PURE__ */ F("dt", {
825
826
  className: "x1ghz6dp xeuugli xb3r6kr xlyipyv xuxw1ft x153jb6y",
826
827
  children: e.label
827
- }), /* @__PURE__ */ I("dd", {
828
+ }), /* @__PURE__ */ F("dd", {
828
829
  className: "x1ghz6dp xuxw1ft",
829
830
  children: e.value
830
831
  })]
@@ -832,9 +833,9 @@ function Je(t) {
832
833
  })]
833
834
  })]
834
835
  }),
835
- children: r.length === 0 || j.length === 0 ? /* @__PURE__ */ I(T, { children: _ }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
836
+ children: r.length === 0 || j.length === 0 ? /* @__PURE__ */ F(T, { children: _ }) : /* @__PURE__ */ I(he, { children: [/* @__PURE__ */ I(ie, {
836
837
  plotRef: A.ref,
837
- box: R,
838
+ box: L,
838
839
  label: o({
839
840
  title: O,
840
841
  marks: `${i.label} positions`,
@@ -842,59 +843,59 @@ function Je(t) {
842
843
  }),
843
844
  readoutId: ne,
844
845
  children: [
845
- /* @__PURE__ */ I(D, {
846
- box: R,
847
- xTicks: U,
846
+ /* @__PURE__ */ F(D, {
847
+ box: L,
848
+ xTicks: H,
848
849
  yTicks: [],
849
850
  xTitle: c(i),
850
851
  grid: "x"
851
852
  }),
852
- /* @__PURE__ */ L(oe, {
853
- box: R,
853
+ /* @__PURE__ */ I(oe, {
854
+ box: L,
854
855
  children: [r.map((e, t) => {
855
- let n = R.top + t * M + N;
856
- return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I("line", {
857
- x1: R.left,
858
- x2: R.right,
856
+ let n = L.top + t * M + N;
857
+ return /* @__PURE__ */ I("g", { children: [/* @__PURE__ */ F("line", {
858
+ x1: L.left,
859
+ x2: L.right,
859
860
  y1: n,
860
861
  y2: n,
861
862
  ...P.props(E.grid)
862
- }), ["positive", "negative"].flatMap((t) => B[t].map((r, i) => {
863
+ }), ["positive", "negative"].flatMap((t) => z[t].map((r, i) => {
863
864
  let a = e.points.map((e) => {
864
- let r = e.y === null || t === "positive" != e.y >= 0 ? 0 : Math.abs(e.y), a = Math.max(0, Math.min(B.step, r - B.step * i)) / B.step;
865
+ let r = e.y === null || t === "positive" != e.y >= 0 ? 0 : Math.abs(e.y), a = Math.max(0, Math.min(z.step, r - z.step * i)) / z.step;
865
866
  return {
866
- x: z.position(e.x),
867
+ x: R.position(e.x),
867
868
  y0: e.y === null ? null : n,
868
869
  y1: e.y === null ? null : n - a * N
869
870
  };
870
871
  });
871
- return /* @__PURE__ */ I("path", {
872
+ return /* @__PURE__ */ F("path", {
872
873
  d: de(a),
873
- ...P.props(We.layer(r))
874
+ ...P.props(Ge.layer(r))
874
875
  }, `${t}${r}`);
875
876
  }))] }, e.id);
876
- }), s !== void 0 && /* @__PURE__ */ I("line", {
877
- x1: z.position(s),
878
- x2: z.position(s),
879
- y1: R.top,
880
- y2: R.bottom,
877
+ }), s !== void 0 && /* @__PURE__ */ F("line", {
878
+ x1: R.position(s),
879
+ x2: R.position(s),
880
+ y1: L.top,
881
+ y2: L.bottom,
881
882
  ...P.props(E.baseline)
882
883
  })]
883
884
  }),
884
- r.map((e, t) => /* @__PURE__ */ I(k, {
885
- x: R.left - Le,
886
- y: R.top + t * M + N / 2 + Re,
885
+ r.map((e, t) => /* @__PURE__ */ F(k, {
886
+ x: L.left - Re,
887
+ y: L.top + t * M + N / 2 + ze,
887
888
  anchor: "end",
888
- children: ge(e.label, V)
889
+ children: ge(e.label, B)
889
890
  }, e.id)),
890
- l !== void 0 && /* @__PURE__ */ I(b, {
891
- x: z.position(l),
892
- top: R.top,
893
- bottom: R.bottom,
894
- width: ze
891
+ l !== void 0 && /* @__PURE__ */ F(b, {
892
+ x: R.position(l),
893
+ top: L.top,
894
+ bottom: L.bottom,
895
+ width: Be
895
896
  })
896
897
  ]
897
- }), /* @__PURE__ */ I(S, {
898
+ }), /* @__PURE__ */ F(S, {
898
899
  label: `${O} observations`,
899
900
  columns: [{
900
901
  id: "observation",
@@ -910,15 +911,15 @@ function Je(t) {
910
911
  });
911
912
  }
912
913
  // packages/charts/src/trend/runs-chart.tsx
913
- var Ye = {
914
+ var Xe = {
914
915
  runs: 200,
915
916
  pointsPerRun: 500
916
- }, Xe = 4;
917
- function Ze({ runs: e, featured: t, summary: n, xDomain: i, yDomain: a, x: o, y: s }) {
917
+ }, Ze = 4;
918
+ function Qe({ runs: e, featured: t, summary: n, xDomain: i, yDomain: a, x: o, y: s }) {
918
919
  let c = v(i, o.scale) ?? v(a, s.scale);
919
920
  if (c !== void 0) return c;
920
921
  if (!r(e)) return "Runs must have unique identifiers.";
921
- if (e.length > Ye.runs) return `This chart draws at most ${Ye.runs} runs. Supply the runs to compare.`;
922
+ if (e.length > Xe.runs) return `This chart draws at most ${Xe.runs} runs. Supply the runs to compare.`;
922
923
  let l = t.find((t) => !e.some((e) => e.id === t));
923
924
  if (l !== void 0) return `Highlighted run ${l} is not among the runs.`;
924
925
  let u = [...e.map((e) => ({
@@ -927,8 +928,8 @@ function Ze({ runs: e, featured: t, summary: n, xDomain: i, yDomain: a, x: o, y:
927
928
  })), ...n === void 0 ? [] : [{
928
929
  id: "summary",
929
930
  points: n.points
930
- }]], d = u.find((e) => e.points.length > Ye.pointsPerRun);
931
- if (d !== void 0) return `Run ${d.id} exceeds ${Ye.pointsPerRun} points. Supply a window or a coarser sample.`;
931
+ }]], d = u.find((e) => e.points.length > Xe.pointsPerRun);
932
+ if (d !== void 0) return `Run ${d.id} exceeds ${Xe.pointsPerRun} points. Supply a window or a coarser sample.`;
932
933
  let f = u.find((e) => e.points.some((t, n) => n > 0 && t.x <= (e.points[n - 1]?.x ?? 0)) || e.points.some((e) => _(e.x, i)));
933
934
  if (f !== void 0) return `Run ${f.id} needs strictly increasing steps inside the declared domain.`;
934
935
  let p = e.find((e) => e.points.some((e) => e.y !== null && _(e.y, a)));
@@ -938,9 +939,9 @@ function Ze({ runs: e, featured: t, summary: n, xDomain: i, yDomain: a, x: o, y:
938
939
  e.upper
939
940
  ].every((e) => !_(e, a)) && e.lower <= e.center && e.center <= e.upper) ? void 0 : "The summary needs lower ≤ center ≤ upper inside the declared domain at every step." : `Run ${p.id} has a value that is not finite or lies outside the declared domain.`;
940
941
  }
941
- function Qe(e) {
942
- let { runs: r, x: s, y: u, featured: d, summary: p, height: g = "regular", selected: _, onSelectedChange: v, ...y } = e, { emptyLabel: b = "No runs are available.", ...x } = y, { locale: C, title: E } = x, k = ae(g), re = pe(), j = m(), se = f(), [ce, le] = F(void 0);
943
- if (x.status === "loading") return /* @__PURE__ */ I(ee, {
942
+ function $e(e) {
943
+ let { runs: r, x: s, y: u, featured: d, summary: p, height: g = "regular", selected: _, onSelectedChange: v, ...y } = e, { emptyLabel: b = "No runs are available.", ...x } = y, { locale: w, title: E } = x, k = ae(g), re = pe(), j = m(), se = f(), [ce, le] = me(void 0);
944
+ if (x.status === "loading") return /* @__PURE__ */ F(ee, {
944
945
  ...x,
945
946
  height: g
946
947
  });
@@ -951,65 +952,65 @@ function Qe(e) {
951
952
  ])], P = s.domain ?? a({
952
953
  values: fe,
953
954
  scale: s.scale
954
- }), R = u.domain ?? a({
955
+ }), L = u.domain ?? a({
955
956
  values: N,
956
957
  scale: u.scale
957
- }), z = Ze({
958
+ }), R = Qe({
958
959
  runs: r,
959
960
  featured: d,
960
961
  summary: p,
961
962
  xDomain: P,
962
- yDomain: R,
963
+ yDomain: L,
963
964
  x: s,
964
965
  y: u
965
966
  });
966
- if (z !== void 0) return /* @__PURE__ */ I(w, {
967
+ if (R !== void 0) return /* @__PURE__ */ F(te, {
967
968
  ...x,
968
- message: z
969
+ message: R
969
970
  });
970
- function B(e) {
971
+ function z(e) {
971
972
  return h({
972
973
  value: e,
973
- locale: C,
974
+ locale: w,
974
975
  format: s.format
975
976
  });
976
977
  }
977
- function V(e) {
978
+ function B(e) {
978
979
  return h({
979
980
  value: e,
980
- locale: C,
981
+ locale: w,
981
982
  format: u.format
982
983
  });
983
984
  }
984
- let H = W({
985
+ let V = U({
985
986
  width: k.width,
986
987
  labels: [...r.map((e) => e.label), ...p === void 0 ? [] : [p.label]]
987
- }), U = l({
988
+ }), H = l({
988
989
  width: k.width,
989
990
  height: k.height,
990
991
  x: s,
991
992
  y: u,
992
993
  xDomain: P,
993
- yDomain: R,
994
- locale: C,
995
- rightGutter: H
996
- }), { box: G } = U, K = r.map((e, t) => ({
994
+ yDomain: L,
995
+ locale: w,
996
+ rightGutter: V
997
+ }), { box: G } = H, K = r.map((e, t) => ({
997
998
  ...e,
998
999
  line: e.points.map((e) => ({
999
- x: U.x.position(e.x),
1000
- y: e.y === null ? null : U.y.position(e.y)
1000
+ x: H.x.position(e.x),
1001
+ y: e.y === null ? null : H.y.position(e.y)
1001
1002
  })),
1002
1003
  index: t
1003
1004
  })), ye = r.map((e) => {
1004
1005
  let t = e.points.findLast((e) => e.y !== null);
1005
1006
  return {
1006
1007
  id: e.id,
1007
- label: t === void 0 ? `${e.label}: no recorded values` : `${e.label}: last recorded ${s.label} ${B(t.x)}, ${V(t.y)}`
1008
+ label: t === void 0 ? `${e.label}: no recorded values` : `${e.label}: last recorded ${s.label} ${z(t.x)}, ${B(t.y)}`
1008
1009
  };
1009
1010
  });
1010
- function J(e) {
1011
+ function q(e) {
1011
1012
  let t = K.find((t) => t.id === e)?.points.find((e) => e.x === ce?.x);
1012
- return ce !== void 0 && ce.id === e && t !== void 0 ? ` · At ${s.label} ${B(t.x)}: ${V(t.y)}` : "";
1013
+ return ce !== void 0 && ce.id === e && t !== void 0 ? ` · At ${s.label} ${z(t.x)}: ${B(t.y)}` : "";
1013
1014
  }
1014
1015
  function Y(e) {
1015
1016
  let t = d.indexOf(e.id);
@@ -1019,7 +1020,7 @@ function Qe(e) {
1019
1020
  index: t === -1 ? e.index : t
1020
1021
  });
1021
1022
  }
1022
- let be = q({
1023
+ let be = J({
1023
1024
  lines: K.map((e) => ({
1024
1025
  id: e.id,
1025
1026
  points: e.line
@@ -1028,20 +1029,20 @@ function Qe(e) {
1028
1029
  height: G.height
1029
1030
  });
1030
1031
  function xe(e) {
1031
- let t = be(e), n = K.find((e) => e.id === t), r = e.x / e.width * G.width, i = n?.points.toSorted((e, t) => Math.abs(U.x.position(e.x) - r) - Math.abs(U.x.position(t.x) - r))[0], a = i !== void 0 && i.y !== null && Math.abs(U.x.position(i.x) - r) <= Xe, o = t === void 0 ? void 0 : {
1032
+ let t = be(e), n = K.find((e) => e.id === t), r = e.x / e.width * G.width, i = n?.points.toSorted((e, t) => Math.abs(H.x.position(e.x) - r) - Math.abs(H.x.position(t.x) - r))[0], a = i !== void 0 && i.y !== null && Math.abs(H.x.position(i.x) - r) <= Ze, o = t === void 0 ? void 0 : {
1032
1033
  id: t,
1033
1034
  x: a ? i.x : void 0
1034
1035
  };
1035
1036
  return le((e) => e?.id === o?.id && e?.x === o?.x ? e : o), t;
1036
1037
  }
1037
1038
  let Se = p?.tone ?? "series6", X = (p?.points ?? []).map((e) => ({
1038
- x: U.x.position(e.x),
1039
- y: U.y.position(e.center)
1040
- })), Z = (p?.points ?? []).map((e) => ({
1041
- x: U.x.position(e.x),
1042
- y0: U.y.position(e.lower),
1043
- y1: U.y.position(e.upper)
1044
- })), Ce = [...d.map((e, t) => {
1039
+ x: H.x.position(e.x),
1040
+ y: H.y.position(e.center)
1041
+ })), Ce = (p?.points ?? []).map((e) => ({
1042
+ x: H.x.position(e.x),
1043
+ y0: H.y.position(e.lower),
1044
+ y1: H.y.position(e.upper)
1045
+ })), Z = [...d.map((e, t) => {
1045
1046
  let n = r.find((t) => t.id === e);
1046
1047
  return {
1047
1048
  id: e,
@@ -1059,7 +1060,7 @@ function Qe(e) {
1059
1060
  tone: Se,
1060
1061
  shape: "band"
1061
1062
  }]];
1062
- return /* @__PURE__ */ I(n, {
1063
+ return /* @__PURE__ */ F(n, {
1063
1064
  ...se,
1064
1065
  items: ye,
1065
1066
  selected: _,
@@ -1074,25 +1075,25 @@ function Qe(e) {
1074
1075
  let t = e.line.findLast((e) => e.y !== null), n = Y(e);
1075
1076
  return t === void 0 || t.y === null ? [] : [{
1076
1077
  id: e.id,
1077
- text: ge(e.label, he(H)),
1078
+ text: ge(e.label, W(V)),
1078
1079
  tone: n,
1079
1080
  y: t.y
1080
1081
  }];
1081
1082
  }), ...p === void 0 || X.length === 0 ? [] : [{
1082
1083
  id: "summary",
1083
- text: ge(p.label, he(H)),
1084
+ text: ge(p.label, W(V)),
1084
1085
  tone: Se,
1085
1086
  y: X.at(-1)?.y ?? G.top
1086
1087
  }]];
1087
- return /* @__PURE__ */ I(te, {
1088
+ return /* @__PURE__ */ F(C, {
1088
1089
  ...x,
1089
1090
  figure: e,
1090
- series: Ce,
1091
- footer: r.length === 0 ? void 0 : /* @__PURE__ */ I(i, {
1091
+ series: Z,
1092
+ footer: r.length === 0 ? void 0 : /* @__PURE__ */ F(i, {
1092
1093
  id: re,
1093
- children: `${t(ye, n.inspected)}${J(n.inspected)}`
1094
+ children: `${t(ye, n.inspected)}${q(n.inspected)}`
1094
1095
  }),
1095
- children: r.length === 0 ? /* @__PURE__ */ I(T, { children: b }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
1096
+ children: r.length === 0 ? /* @__PURE__ */ F(T, { children: b }) : /* @__PURE__ */ I(he, { children: [/* @__PURE__ */ I(ie, {
1096
1097
  plotRef: k.ref,
1097
1098
  box: G,
1098
1099
  label: o({
@@ -1102,44 +1103,44 @@ function Qe(e) {
1102
1103
  }),
1103
1104
  readoutId: re,
1104
1105
  children: [
1105
- /* @__PURE__ */ I(D, {
1106
+ /* @__PURE__ */ F(D, {
1106
1107
  box: G,
1107
- xTicks: U.xTicks,
1108
- yTicks: U.yTicks,
1108
+ xTicks: H.xTicks,
1109
+ yTicks: H.yTicks,
1109
1110
  xTitle: c(s),
1110
1111
  yTitle: c(u)
1111
1112
  }),
1112
- /* @__PURE__ */ L(oe, {
1113
+ /* @__PURE__ */ I(oe, {
1113
1114
  box: G,
1114
1115
  children: [
1115
- K.filter((e) => !l(e.id)).map((e) => /* @__PURE__ */ I(A, {
1116
+ K.filter((e) => !l(e.id)).map((e) => /* @__PURE__ */ F(A, {
1116
1117
  d: M(e.line),
1117
1118
  tone: "neutral",
1118
1119
  emphasis: "context"
1119
1120
  }, e.id)),
1120
- p !== void 0 && /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I(ne, {
1121
- d: de(Z),
1121
+ p !== void 0 && /* @__PURE__ */ I("g", { children: [/* @__PURE__ */ F(ne, {
1122
+ d: de(Ce),
1122
1123
  tone: Se
1123
- }), /* @__PURE__ */ I(A, {
1124
+ }), /* @__PURE__ */ F(A, {
1124
1125
  d: M(X),
1125
1126
  tone: Se
1126
1127
  })] }),
1127
1128
  f.map((e) => {
1128
1129
  let t = Y(e);
1129
- return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I(A, {
1130
+ return /* @__PURE__ */ I("g", { children: [/* @__PURE__ */ F(A, {
1130
1131
  d: M(e.line),
1131
1132
  tone: t
1132
- }), ue(e.line).map((e) => /* @__PURE__ */ I(O, {
1133
+ }), ue(e.line).map((e) => /* @__PURE__ */ F(O, {
1133
1134
  x: e.x,
1134
1135
  y: e.y,
1135
1136
  tone: t,
1136
1137
  radius: 2.5
1137
1138
  }, e.x))] }, e.id);
1138
1139
  }),
1139
- m !== void 0 && /* @__PURE__ */ I(ve, { d: M(m.line) })
1140
+ m !== void 0 && /* @__PURE__ */ F(ve, { d: M(m.line) })
1140
1141
  ]
1141
1142
  }),
1142
- /* @__PURE__ */ I(_e, {
1143
+ /* @__PURE__ */ F(_e, {
1143
1144
  labels: h,
1144
1145
  x: G.right,
1145
1146
  anchor: "start",
@@ -1147,7 +1148,7 @@ function Qe(e) {
1147
1148
  bottom: G.bottom
1148
1149
  })
1149
1150
  ]
1150
- }), /* @__PURE__ */ I(S, {
1151
+ }), /* @__PURE__ */ F(S, {
1151
1152
  label: `${E} runs`,
1152
1153
  columns: [{
1153
1154
  id: "run",
@@ -1167,11 +1168,11 @@ var $ = {
1167
1168
  items: 40,
1168
1169
  conditionsMin: 2,
1169
1170
  conditionsMax: 6
1170
- }, $e = 48, et = {
1171
+ }, et = 48, tt = {
1171
1172
  label: "",
1172
1173
  format: {}
1173
1174
  };
1174
- function tt({ conditions: e, items: t, domain: n, value: i }) {
1175
+ function nt({ conditions: e, items: t, domain: n, value: i }) {
1175
1176
  let a = v(n, i.scale);
1176
1177
  if (a !== void 0) return a;
1177
1178
  if (e.length < $.conditionsMin || e.length > $.conditionsMax) return `This chart compares ${$.conditionsMin} to ${$.conditionsMax} conditions.`;
@@ -1182,22 +1183,22 @@ function tt({ conditions: e, items: t, domain: n, value: i }) {
1182
1183
  let s = t.find((e) => e.values.some((e) => e !== null && _(e, n)));
1183
1184
  return s === void 0 ? void 0 : `Item ${s.id} has a value that is not finite or lies outside the declared domain.`;
1184
1185
  }
1185
- function nt(e) {
1186
+ function rt(e) {
1186
1187
  let { conditions: t, items: n, value: r, height: i = "regular", selected: o, onSelectedChange: s, ...c } = e, { emptyLabel: u = "No measurements are available.", ...d } = c, { locale: f } = d, p = ae(i), g = m();
1187
- if (d.status === "loading") return /* @__PURE__ */ I(ee, {
1188
+ if (d.status === "loading") return /* @__PURE__ */ F(ee, {
1188
1189
  ...d,
1189
1190
  height: i
1190
1191
  });
1191
1192
  let _ = r.domain ?? a({
1192
1193
  values: n.flatMap((e) => e.values),
1193
1194
  scale: r.scale
1194
- }), v = tt({
1195
+ }), v = nt({
1195
1196
  conditions: t,
1196
1197
  items: n,
1197
1198
  domain: _,
1198
1199
  value: r
1199
1200
  });
1200
- if (v !== void 0) return /* @__PURE__ */ I(w, {
1201
+ if (v !== void 0) return /* @__PURE__ */ F(te, {
1201
1202
  ...d,
1202
1203
  message: v
1203
1204
  });
@@ -1218,25 +1219,25 @@ function nt(e) {
1218
1219
  })), x = b.map((e) => ({
1219
1220
  first: e.values[0] ?? null,
1220
1221
  last: e.values[t.length - 1] ?? null
1221
- })), S = W({
1222
+ })), S = U({
1222
1223
  labels: b.map((e, t) => `${e.label} ${y(x[t]?.first)}`),
1223
1224
  width: p.width
1224
- }), te = W({
1225
+ }), C = U({
1225
1226
  labels: b.map((e, t) => `${y(x[t]?.last)} ${e.label}`),
1226
1227
  width: p.width
1227
- }), C = l({
1228
+ }), w = l({
1228
1229
  width: p.width,
1229
- height: Math.max(p.height, G(n.length) + $e),
1230
- x: et,
1230
+ height: Math.max(p.height, G(n.length) + et),
1231
+ x: tt,
1231
1232
  y: r,
1232
1233
  xDomain: [0, 1],
1233
1234
  yDomain: _,
1234
1235
  locale: f
1235
- }), { box: T } = C, E = X({
1236
+ }), { box: T } = w, E = Ce({
1236
1237
  box: T,
1237
1238
  columnLabels: t.map((e) => e.label),
1238
1239
  leftGutter: S,
1239
- rightGutter: te
1240
+ rightGutter: C
1240
1241
  }), { xs: D } = E, O = t.map((e, t) => ({
1241
1242
  key: e.id,
1242
1243
  position: D[t] ?? T.left,
@@ -1246,22 +1247,22 @@ function nt(e) {
1246
1247
  return {
1247
1248
  id: e.id,
1248
1249
  tone: e.tone,
1249
- ys: e.values.map((e) => e === null ? null : C.y.position(e)),
1250
- startLabel: `${ge(e.label, he(E.leftGutter) - n.length - 1)} ${n}`,
1251
- endLabel: `${r} ${ge(e.label, he(E.rightGutter) - r.length - 1)}`
1250
+ ys: e.values.map((e) => e === null ? null : w.y.position(e)),
1251
+ startLabel: `${ge(e.label, W(E.leftGutter) - n.length - 1)} ${n}`,
1252
+ endLabel: `${r} ${ge(e.label, W(E.rightGutter) - r.length - 1)}`
1252
1253
  };
1253
1254
  }), A = b.map((e) => ({
1254
1255
  id: e.id,
1255
1256
  label: `${e.label}: ${t.map((t, n) => `${t.label} ${y(e.values[n])}`).join(" · ")}`
1256
1257
  }));
1257
- return /* @__PURE__ */ I(Y, {
1258
+ return /* @__PURE__ */ F(be, {
1258
1259
  frame: d,
1259
1260
  emptyLabel: u,
1260
1261
  plotRef: p.ref,
1261
1262
  box: T,
1262
1263
  xs: D,
1263
1264
  xTicks: O,
1264
- yTicks: C.yTicks,
1265
+ yTicks: w.yTicks,
1265
1266
  yTitle: r.label,
1266
1267
  lines: k,
1267
1268
  items: A,
@@ -1276,4 +1277,4 @@ function nt(e) {
1276
1277
  onSelectedChange: s
1277
1278
  });
1278
1279
  }
1279
- export { Je as a, Q as c, Ye as i, De as l, $ as n, Pe as o, Qe as r, Ne as s, nt as t, Z as u };
1280
+ export { Ye as a, Q as c, Xe as i, Oe as l, $ as n, Fe as o, $e as r, Pe as s, rt as t, Z as u };