@mechane-ai/elements 0.24.0 → 0.25.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.
@@ -1,20 +1,20 @@
1
- import { u as e } from "../src-DHYcohZP.js";
2
- import { i as t, n, r, t as i } from "../categorical-values-CPRt9uzI.js";
3
- import { E as a } from "../src-DLReNPV9.js";
4
- import { t as o } from "../use-scroll-tab-index-Dxpdh4W7.js";
5
- import { s } from "../src-d7EAi61b.js";
6
- import { a as c, n as l, o as u, r as d, s as f, t as p } from "../chart-frame-CNr8M_b2.js";
7
- import { n as m, r as h, t as g } from "../chart-input-DDAjzy-O.js";
8
- import { t as _ } from "../plot-width--OgdohB5.js";
9
- import { g as v } from "../src-CQOgWIzP.js";
10
- import { r as y } from "../tokens.stylex-DTHHFbyl.js";
1
+ import { d as e, u as t } from "../src-DHYcohZP.js";
2
+ import { i as n, n as r, r as i, t as a } from "../categorical-values-CPRt9uzI.js";
3
+ import { E as o } from "../src-DLReNPV9.js";
4
+ import { t as s } from "../use-scroll-tab-index-Dxpdh4W7.js";
5
+ import { s as c } from "../src-d7EAi61b.js";
6
+ import { a as l, n as u, o as d, r as f, s as p, t as m } from "../chart-frame-CNr8M_b2.js";
7
+ import { n as h, r as g, t as _ } from "../chart-input-DDAjzy-O.js";
8
+ import { t as v } from "../plot-width--OgdohB5.js";
9
+ import { g as y } from "../src-CQOgWIzP.js";
10
+ import { r as ee } from "../tokens.stylex-DTHHFbyl.js";
11
11
  import * as b from "@stylexjs/stylex";
12
- import { useEffect as ee, useId as x, useMemo as te, useRef as S, useState as C } from "react";
12
+ import { useEffect as x, useId as S, useMemo as te, useRef as ne, useState as C } from "react";
13
13
  import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
14
14
  import { scaleBand as D, scaleLinear as O } from "@visx/scale";
15
- import { AreaClosed as ne, Bar as k, LinePath as A } from "@visx/shape";
15
+ import { AreaClosed as k, Bar as A, LinePath as re } from "@visx/shape";
16
16
  // packages/charts/src/chart-cursor.tsx
17
- function re({ x: e, top: t, bottom: n, width: r }) {
17
+ function ie({ x: e, top: t, bottom: n, width: r }) {
18
18
  return /* @__PURE__ */ E("g", {
19
19
  "aria-hidden": !0,
20
20
  className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
@@ -34,13 +34,13 @@ function re({ x: e, top: t, bottom: n, width: r }) {
34
34
  });
35
35
  }
36
36
  // packages/charts/src/chart-data.tsx
37
- function ie({ title: e, children: t }) {
38
- let n = o();
39
- return /* @__PURE__ */ E(s.Root, { children: [/* @__PURE__ */ T(s.Trigger, {
40
- render: /* @__PURE__ */ T(a, {}),
37
+ function ae({ title: e, children: t }) {
38
+ let n = s();
39
+ return /* @__PURE__ */ E(c.Root, { children: [/* @__PURE__ */ T(c.Trigger, {
40
+ render: /* @__PURE__ */ T(o, {}),
41
41
  children: "Chart data"
42
- }), /* @__PURE__ */ E(s.Portal, { children: [/* @__PURE__ */ T(s.Backdrop, {}), /* @__PURE__ */ E(s.Popup, { children: [
43
- /* @__PURE__ */ T(s.Title, { children: e }),
42
+ }), /* @__PURE__ */ E(c.Portal, { children: [/* @__PURE__ */ T(c.Backdrop, {}), /* @__PURE__ */ E(c.Popup, { children: [
43
+ /* @__PURE__ */ T(c.Title, { children: e }),
44
44
  /* @__PURE__ */ T("div", {
45
45
  ref: n.ref,
46
46
  role: "region",
@@ -49,21 +49,21 @@ function ie({ title: e, children: t }) {
49
49
  className: "xeuugli x1phlbz0 xysyzu8 x1we84gm",
50
50
  children: t
51
51
  }),
52
- /* @__PURE__ */ T(s.Close, {
53
- render: /* @__PURE__ */ T(a, {}),
52
+ /* @__PURE__ */ T(c.Close, {
53
+ render: /* @__PURE__ */ T(o, {}),
54
54
  children: "Close"
55
55
  })
56
56
  ] })] })] });
57
57
  }
58
58
  // packages/charts/src/chart-inspection.tsx
59
- var ae = {
59
+ var j = {
60
60
  kzqmXN: "x1xc55vz",
61
61
  kZKoxP: "xdk7pt",
62
62
  kmuXW: "x2lah0s",
63
63
  $$css: !0
64
- }, j = {
64
+ }, M = {
65
65
  swatch: (e) => [
66
- ae,
66
+ j,
67
67
  {
68
68
  kWkggS: e == null ? e : "xl8spv7",
69
69
  $$css: !0
@@ -100,7 +100,7 @@ var ae = {
100
100
  "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
101
101
  }]
102
102
  };
103
- function M({ title: e, detail: t }) {
103
+ function oe({ title: e, detail: t }) {
104
104
  return t === void 0 ? e : /* @__PURE__ */ E("span", {
105
105
  "aria-label": e,
106
106
  className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
@@ -113,8 +113,8 @@ function M({ title: e, detail: t }) {
113
113
  })]
114
114
  });
115
115
  }
116
- function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [] }) {
117
- let d = Math.min(260, s), p = o > s / 2 ? o - d - c : o + c, m = Math.max(0, Math.min(s - d, p)), h = t === void 0 ? [] : [
116
+ function se({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [] }) {
117
+ let d = Math.min(260, s), f = o > s / 2 ? o - d - c : o + c, m = Math.max(0, Math.min(s - d, f)), h = t === void 0 ? [] : [
118
118
  t,
119
119
  n,
120
120
  ...a.map((e) => `${e.label}: ${e.value}`),
@@ -131,7 +131,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
131
131
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
132
132
  children: i.map((e) => /* @__PURE__ */ E("li", {
133
133
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
134
- children: [/* @__PURE__ */ T("span", { ...b.props(j.swatch(f[e.tone])) }), /* @__PURE__ */ E("span", {
134
+ children: [/* @__PURE__ */ T("span", { ...b.props(M.swatch(p[e.tone])) }), /* @__PURE__ */ E("span", {
135
135
  className: "xeuugli",
136
136
  children: [e.label, /* @__PURE__ */ T("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
137
137
  })]
@@ -143,7 +143,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
143
143
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
144
144
  children: [/* @__PURE__ */ T("span", {
145
145
  "aria-hidden": !0,
146
- ...b.props(j.swatch(f[e.tone]))
146
+ ...b.props(M.swatch(p[e.tone]))
147
147
  }), /* @__PURE__ */ E("span", {
148
148
  className: "xeuugli",
149
149
  children: [e.label, /* @__PURE__ */ T("span", {
@@ -164,7 +164,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
164
164
  "aria-hidden": !0,
165
165
  className: "x1n2onr6 xqtp20y x1vjfegm",
166
166
  children: /* @__PURE__ */ E("div", {
167
- ...b.props(j.inspector, j.position(m, d)),
167
+ ...b.props(M.inspector, M.position(m, d)),
168
168
  children: [
169
169
  /* @__PURE__ */ E("div", {
170
170
  className: "x78zum5 x1qughib x1hnptsi xk4h15q",
@@ -176,7 +176,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
176
176
  className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
177
177
  children: [/* @__PURE__ */ E("dt", {
178
178
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
179
- children: [/* @__PURE__ */ T("span", { ...b.props(j.swatch(f[e.tone])) }), e.label]
179
+ children: [/* @__PURE__ */ T("span", { ...b.props(M.swatch(p[e.tone])) }), e.label]
180
180
  }), /* @__PURE__ */ T("dd", {
181
181
  className: "x1ghz6dp xuxw1ft",
182
182
  children: e.value
@@ -191,7 +191,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
191
191
  });
192
192
  }
193
193
  // packages/charts/src/cartesian/bar-data.ts
194
- function se({ composition: e, series: t, categoryIds: n, domain: r }) {
194
+ function ce({ composition: e, series: t, categoryIds: n, domain: r }) {
195
195
  if (e === void 0) return;
196
196
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
197
197
  let i = e.annotation;
@@ -216,8 +216,8 @@ var N = { mark: {
216
216
  kAMwcw: "x1faw7qm",
217
217
  $$css: !0
218
218
  } };
219
- function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: l }) {
220
- let d = n !== void 0, p = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
219
+ function le({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: l }) {
220
+ let u = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
221
221
  function m(e, t) {
222
222
  let n = s(t), r = s(t + e);
223
223
  return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
@@ -228,24 +228,24 @@ function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o,
228
228
  width: o,
229
229
  height: 1,
230
230
  vectorEffect: "non-scaling-stroke",
231
- fill: f.neutral,
232
- ...b.props(N.mark, c && u.selected),
231
+ fill: p.neutral,
232
+ ...b.props(N.mark, c && d.selected),
233
233
  style: {
234
234
  transform: m(e.total, 0),
235
- opacity: d ? .18 : +(e.kind === "total")
235
+ opacity: u ? .18 : +(e.kind === "total")
236
236
  }
237
- }), p.map((s, p) => {
238
- let h = s.values[i];
237
+ }), f.map((s, f) => {
238
+ let h = s.values[r];
239
239
  if (h == null) return null;
240
- let g = n?.id === s.id, _ = d ? 0 : t.slice(0, p).reduce((e, t) => e + (t.values[i] ?? 0), 0), v = d ? g : e.kind === "parts", y = !d && l !== void 0 && l !== s.id;
240
+ let g = n?.id === s.id, _ = u ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), v = u ? g : e.kind === "parts", y = !u && l !== void 0 && l !== s.id;
241
241
  return /* @__PURE__ */ T("rect", {
242
242
  x: a,
243
243
  y: 0,
244
244
  width: o,
245
245
  height: 1,
246
246
  vectorEffect: "non-scaling-stroke",
247
- fill: f[r(s.tone, p)],
248
- ...b.props(N.mark, c && u.selected),
247
+ fill: p[i(s.tone, f)],
248
+ ...b.props(N.mark, c && d.selected),
249
249
  style: {
250
250
  transform: m(h, _),
251
251
  opacity: v ? y ? .3 : 1 : 0
@@ -254,7 +254,7 @@ function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o,
254
254
  })] });
255
255
  }
256
256
  // packages/charts/src/cartesian/bar-chart.tsx
257
- var le = {
257
+ var P = {
258
258
  plot: {
259
259
  kqGvvJ: "x1we84gm",
260
260
  $$css: !0
@@ -263,38 +263,38 @@ var le = {
263
263
  kSiTet: "xuzhngd",
264
264
  $$css: !0
265
265
  }
266
- }, ue = /* @__PURE__ */ new Set(["Enter", " "]), P = 200;
267
- function de({ title: e, description: t, series: n, layoutSeries: i, children: a, inspectionId: o, label: s, detail: c, summary: l, rows: u = [], index: f = -1, formatValue: p = String, x: m = 0, width: h = 0, offset: g, source: _, data: v }) {
266
+ }, ue = /* @__PURE__ */ new Set(["Enter", " "]), de = 200;
267
+ function F({ title: e, description: t, series: n, layoutSeries: r, children: a, inspectionId: o, label: s, detail: c, summary: l, rows: u = [], index: d = -1, formatValue: p = String, x: m = 0, width: h = 0, offset: g, source: _, data: v }) {
268
268
  let y = n.map((e, t) => ({
269
269
  id: e.id,
270
270
  label: e.label,
271
- tone: r(e.tone, t)
272
- })), b = i?.map((e, t) => ({
271
+ tone: i(e.tone, t)
272
+ })), ee = r?.map((e, t) => ({
273
273
  id: e.id,
274
274
  label: e.label,
275
- tone: r(e.tone, t)
275
+ tone: i(e.tone, t)
276
276
  }));
277
- return /* @__PURE__ */ E(d, {
278
- title: /* @__PURE__ */ T(M, {
277
+ return /* @__PURE__ */ E(f, {
278
+ title: /* @__PURE__ */ T(oe, {
279
279
  title: e,
280
280
  detail: c
281
281
  }),
282
282
  description: t,
283
- actions: /* @__PURE__ */ T(ie, {
283
+ actions: /* @__PURE__ */ T(ae, {
284
284
  title: e,
285
285
  children: v
286
286
  }),
287
- children: [/* @__PURE__ */ T(oe, {
287
+ children: [/* @__PURE__ */ T(se, {
288
288
  id: o,
289
289
  label: s,
290
290
  summary: l,
291
291
  legend: y,
292
- layoutLegend: b,
292
+ layoutLegend: ee,
293
293
  rows: u.map((e, t) => ({
294
294
  id: e.id,
295
295
  label: e.label,
296
- tone: r(e.tone, t),
297
- value: e.values[f] === null || e.values[f] === void 0 ? "Unavailable" : p(e.values[f])
296
+ tone: i(e.tone, t),
297
+ value: e.values[d] === null || e.values[d] === void 0 ? "Unavailable" : p(e.values[d])
298
298
  })),
299
299
  x: m,
300
300
  width: h,
@@ -303,100 +303,100 @@ function de({ title: e, description: t, series: n, layoutSeries: i, children: a,
303
303
  }), a]
304
304
  });
305
305
  }
306
- function F({ title: t = "Loading chart", description: n, series: r = [], height: i = P }) {
307
- let a = I(i), o = x();
306
+ function I({ title: e = "Loading chart", description: n, series: r = [], height: i = de }) {
307
+ let a = fe(i), o = S();
308
308
  return a === void 0 ? /* @__PURE__ */ T("div", {
309
309
  "aria-hidden": !0,
310
310
  inert: !0,
311
- children: /* @__PURE__ */ T(de, {
312
- title: t,
311
+ children: /* @__PURE__ */ T(F, {
312
+ title: e,
313
313
  description: n,
314
314
  series: r,
315
315
  inspectionId: o,
316
316
  children: /* @__PURE__ */ T("div", {
317
- ...b.props(u.plot, le.plot),
318
- children: /* @__PURE__ */ T(e, { height: i })
317
+ ...b.props(d.plot, P.plot),
318
+ children: /* @__PURE__ */ T(t, { height: i })
319
319
  })
320
320
  })
321
- }) : /* @__PURE__ */ T(g, {
322
- title: t,
321
+ }) : /* @__PURE__ */ T(_, {
322
+ title: e,
323
323
  description: n,
324
324
  message: a
325
325
  });
326
326
  }
327
- function I(e) {
327
+ function fe(e) {
328
328
  if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
329
329
  }
330
- function fe({ categories: e, series: t, domain: r, mode: i }) {
331
- if (e.length > n.items || t.length > n.series) return `Choose a window with at most ${n.items} categories and ${n.series} series.`;
332
- if (!h(r) || r[0] > 0 || r[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
333
- if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
334
- for (let n of t) {
335
- if (n.values.length !== e.length) return "Every series requires one explicit value per category.";
336
- for (let e of n.values) {
337
- if (e !== null && (!Number.isFinite(e) || e < r[0] || e > r[1])) return "Bar values must be finite and within the supplied domain.";
330
+ function pe({ categories: e, series: t, domain: n, mode: i }) {
331
+ if (e.length > r.items || t.length > r.series) return `Choose a window with at most ${r.items} categories and ${r.series} series.`;
332
+ if (!g(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
333
+ if (!h(e) || !h(t)) return "Bar categories and series require unique identifiers.";
334
+ for (let r of t) {
335
+ if (r.values.length !== e.length) return "Every series requires one explicit value per category.";
336
+ for (let e of r.values) {
337
+ if (e !== null && (!Number.isFinite(e) || e < n[0] || e > n[1])) return "Bar values must be finite and within the supplied domain.";
338
338
  if (i === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
339
339
  }
340
340
  }
341
- if (i === "stacked" && e.some((e, n) => t.reduce((e, t) => e + (t.values[n] ?? 0), 0) > r[1])) return "Stacked bar totals must fit the supplied domain.";
341
+ if (i === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
342
342
  }
343
- var pe = {
343
+ var L = {
344
344
  "x-default-marker": "x-default-marker",
345
345
  $$css: !0
346
346
  };
347
- function L({ title: e, description: t, categories: n, series: a, domain: o, mode: s = "grouped", formatValue: c, formatTick: l = c, highlightedSeriesId: d, selection: p, height: m = P, composition: h }) {
348
- let v = h?.focusedSeries, y = x(), te = v === void 0 ? void 0 : fe({
347
+ function me({ title: e, description: t, categories: n, series: r, domain: o, mode: s = "grouped", formatValue: c, formatTick: l = c, highlightedSeriesId: u, selection: f, height: m = de, composition: h }) {
348
+ let g = h?.focusedSeries, y = S(), ee = g === void 0 ? void 0 : pe({
349
349
  categories: n,
350
- series: [v],
350
+ series: [g],
351
351
  domain: o,
352
352
  mode: "grouped"
353
- }), S = fe({
353
+ }), te = pe({
354
354
  categories: n,
355
- series: a,
355
+ series: r,
356
356
  domain: o,
357
357
  mode: s
358
- }) ?? te, w = se({
358
+ }) ?? ee, ne = ce({
359
359
  composition: h,
360
- series: a,
360
+ series: r,
361
361
  categoryIds: n.map((e) => e.id),
362
362
  domain: o
363
- }) ?? I(m), ne = S ?? w, A = h === void 0 ? void 0 : {
363
+ }) ?? fe(m), w = te ?? ne, k = h === void 0 ? void 0 : {
364
364
  id: y,
365
365
  label: h.contextLabel,
366
366
  tone: "neutral",
367
367
  values: h.buckets.map((e) => e.kind === "gap" ? null : e.total)
368
- }, ie = A === void 0 ? a : [
369
- A,
370
- ...a,
371
- ...v === void 0 || a.some((e) => e.id === v.id) ? [] : [v]
372
- ], ae = v !== void 0 && A !== void 0 ? [v, A] : a, { ref: j, width: M, element: oe } = _(), N = x(), [F, L] = C(), [R, z] = C();
373
- ee(() => {
368
+ }, re = k === void 0 ? r : [
369
+ k,
370
+ ...r,
371
+ ...g === void 0 || r.some((e) => e.id === g.id) ? [] : [g]
372
+ ], ae = g !== void 0 && k !== void 0 ? [g, k] : r, { ref: j, width: M, element: oe } = v(), se = S(), [N, I] = C(), [me, z] = C();
373
+ x(() => {
374
374
  function e(e) {
375
- e.target instanceof Node && oe?.contains(e.target) !== !0 && L(void 0);
375
+ e.target instanceof Node && oe?.contains(e.target) !== !0 && I(void 0);
376
376
  }
377
377
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
378
378
  }, [oe]);
379
- let B = n.findIndex((e) => e.id === F?.id), V = n[B], H = n[n.findIndex((e) => e.id === p?.selectedId)], U = n.find((e) => e.id === R) ?? H ?? n[0], W = n.findIndex((e) => e.id === U?.id), G = V, he = B, K = h?.buckets[he], q = v !== void 0 && A !== void 0 ? [v, A] : A === void 0 || K?.kind === "parts" ? a : [], J = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : c(K.total);
380
- if (ne !== void 0) return /* @__PURE__ */ T(g, {
379
+ let B = n.findIndex((e) => e.id === N?.id), V = n[B], H = n[n.findIndex((e) => e.id === f?.selectedId)], U = n.find((e) => e.id === me) ?? H ?? n[0], W = n.findIndex((e) => e.id === U?.id), G = V, K = B, q = h?.buckets[K], J = g !== void 0 && k !== void 0 ? [g, k] : k === void 0 || q?.kind === "parts" ? r : [], Y = q === void 0 ? void 0 : q.kind === "gap" ? "No reported value" : c(q.total);
380
+ if (w !== void 0) return /* @__PURE__ */ T(_, {
381
381
  title: e,
382
382
  description: t,
383
- message: ne
383
+ message: w
384
384
  });
385
- let Y = m - 28, X = O({
385
+ let X = m - 28, Z = O({
386
386
  domain: [...o],
387
- range: [Y, 12]
388
- }), Z = Math.max(44, ...X.ticks(3).map((e) => l(e).length * 7 + 12)), Q = Math.max(Z + 1, M - 16), $ = D({
387
+ range: [X, 12]
388
+ }), Q = Math.max(44, ...Z.ticks(3).map((e) => l(e).length * 7 + 12)), he = Math.max(Q + 1, M - 16), $ = D({
389
389
  domain: n.map((e) => e.id),
390
- range: [Z, Q],
390
+ range: [Q, he],
391
391
  padding: .3
392
392
  }), ge = D({
393
- domain: a.map((e) => e.id),
393
+ domain: r.map((e) => e.id),
394
394
  range: [0, $.bandwidth()],
395
395
  padding: .08
396
396
  }), _e = Math.min(120, Math.max(40, ...n.map((e) => (e.axisLabel ?? e.label).length * 7))), ve = Math.max(1, Math.ceil((_e + 16) / $.step())), ye = Math.max(1, Math.floor(($.step() * ve - 16) / 7));
397
397
  function be(e) {
398
- let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * M, i = Math.floor((r - Z) / $.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
399
- a !== void 0 && (e.type === "pointerdown" && z(a.id), L({
398
+ let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * M, i = Math.floor((r - Q) / $.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
399
+ a !== void 0 && (e.type === "pointerdown" && z(a.id), I({
400
400
  id: a.id,
401
401
  source: "pointer"
402
402
  }));
@@ -404,11 +404,11 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
404
404
  function xe(e) {
405
405
  if (e.altKey || e.ctrlKey || e.metaKey) return;
406
406
  if (e.key === "Escape") {
407
- e.preventDefault(), e.stopPropagation(), L(void 0);
407
+ e.preventDefault(), e.stopPropagation(), I(void 0);
408
408
  return;
409
409
  }
410
410
  if (ue.has(e.key)) {
411
- U !== void 0 && p !== void 0 && (e.preventDefault(), p.onSelect(U.id));
411
+ U !== void 0 && f !== void 0 && (e.preventDefault(), f.onSelect(U.id));
412
412
  return;
413
413
  }
414
414
  let t = {
@@ -417,46 +417,46 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
417
417
  Home: 0,
418
418
  End: n.length - 1
419
419
  }[e.key], r = t === void 0 ? void 0 : n[t];
420
- r !== void 0 && (e.preventDefault(), z(r.id), L({
420
+ r !== void 0 && (e.preventDefault(), z(r.id), I({
421
421
  id: r.id,
422
422
  source: "keyboard"
423
423
  }));
424
424
  }
425
- return /* @__PURE__ */ T(de, {
425
+ return /* @__PURE__ */ T(F, {
426
426
  title: e,
427
427
  description: t,
428
428
  series: ae,
429
- layoutSeries: a,
430
- inspectionId: N,
429
+ layoutSeries: r,
430
+ inspectionId: se,
431
431
  label: G?.label,
432
- detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, J].filter(Boolean).join(" · "),
433
- summary: J,
434
- rows: q,
435
- index: he,
432
+ detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, Y].filter(Boolean).join(" · "),
433
+ summary: Y,
434
+ rows: J,
435
+ index: K,
436
436
  formatValue: c,
437
- x: ($(G?.id ?? "") ?? Z) + $.bandwidth() / 2,
437
+ x: ($(G?.id ?? "") ?? Q) + $.bandwidth() / 2,
438
438
  width: M,
439
439
  offset: $.bandwidth() / 2 + 8,
440
- source: F?.source,
441
- data: /* @__PURE__ */ T(i, {
440
+ source: N?.source,
441
+ data: /* @__PURE__ */ T(a, {
442
442
  items: n.map((e, t) => ({
443
443
  id: e.id,
444
444
  label: e.label,
445
- valueLabel: me(ie, t, c),
445
+ valueLabel: R(re, t, c),
446
446
  tone: "neutral"
447
447
  })),
448
- selection: p
448
+ selection: f
449
449
  }),
450
450
  children: /* @__PURE__ */ T("div", {
451
451
  ref: j,
452
- ...b.props(u.plot, le.plot),
453
- children: n.length === 0 || a.length === 0 && h === void 0 ? /* @__PURE__ */ T("p", {
452
+ ...b.props(d.plot, P.plot),
453
+ children: n.length === 0 || r.length === 0 && h === void 0 ? /* @__PURE__ */ T("p", {
454
454
  className: "x153jb6y x1ghz6dp xy8obcc",
455
455
  children: "No categories"
456
456
  }) : /* @__PURE__ */ E("svg", {
457
457
  role: "img",
458
- "aria-label": `${e}. Use arrow keys to inspect categories.${p === void 0 ? "" : " Press Enter to select."}`,
459
- "aria-describedby": N,
458
+ "aria-label": `${e}. Use arrow keys to inspect categories.${f === void 0 ? "" : " Press Enter to select."}`,
459
+ "aria-describedby": se,
460
460
  tabIndex: 0,
461
461
  viewBox: `0 0 ${M} ${m}`,
462
462
  height: m,
@@ -464,7 +464,7 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
464
464
  onFocus: (e) => {
465
465
  if (e.currentTarget.matches(":focus-visible")) {
466
466
  let e = H ?? n[0];
467
- z(e?.id), L(e === void 0 ? void 0 : {
467
+ z(e?.id), I(e === void 0 ? void 0 : {
468
468
  id: e.id,
469
469
  source: "keyboard"
470
470
  });
@@ -475,77 +475,77 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
475
475
  },
476
476
  onPointerDown: be,
477
477
  onPointerLeave: (e) => {
478
- e.pointerType === "mouse" && F?.source === "pointer" && L(void 0);
478
+ e.pointerType === "mouse" && N?.source === "pointer" && I(void 0);
479
479
  },
480
- onBlur: () => L(void 0),
480
+ onBlur: () => I(void 0),
481
481
  onClick: () => {
482
- V !== void 0 && p?.onSelect(V.id);
482
+ V !== void 0 && f?.onSelect(V.id);
483
483
  },
484
- ...b.props(u.svg, u.inspectable, pe),
484
+ ...b.props(d.svg, d.inspectable, L),
485
485
  children: [
486
486
  V !== void 0 && /* @__PURE__ */ T("rect", {
487
- x: ($(V.id) ?? Z) - ($.step() - $.bandwidth()) / 2,
487
+ x: ($(V.id) ?? Q) - ($.step() - $.bandwidth()) / 2,
488
488
  y: 12,
489
489
  width: $.step(),
490
- height: Y - 12,
490
+ height: X - 12,
491
491
  className: "x2wnxhi"
492
492
  }),
493
- X.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
494
- x1: Z,
495
- x2: Q,
496
- y1: X(e),
497
- y2: X(e),
498
- ...b.props(u.grid)
493
+ Z.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
494
+ x1: Q,
495
+ x2: he,
496
+ y1: Z(e),
497
+ y2: Z(e),
498
+ ...b.props(d.grid)
499
499
  }), /* @__PURE__ */ T("text", {
500
- x: Z - 8,
501
- y: X(e),
500
+ x: Q - 8,
501
+ y: Z(e),
502
502
  textAnchor: "end",
503
503
  dominantBaseline: "middle",
504
- ...b.props(u.label),
504
+ ...b.props(d.label),
505
505
  children: l(e)
506
506
  })] }, e)),
507
507
  h?.annotation !== void 0 && n.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */ T("text", {
508
508
  x: $(h.annotation.categoryId),
509
- y: Math.max(12, X(h.annotation.value) - 8),
510
- ...b.props(u.label),
509
+ y: Math.max(12, Z(h.annotation.value) - 8),
510
+ ...b.props(d.label),
511
511
  children: h.annotation.label
512
512
  }),
513
513
  n.map((e, t) => {
514
- let n = e.axisLabel ?? e.label, i = h?.buckets[t];
515
- return /* @__PURE__ */ E("g", { children: [i === void 0 ? a.map((n, i) => {
514
+ let n = e.axisLabel ?? e.label, a = h?.buckets[t];
515
+ return /* @__PURE__ */ E("g", { children: [a === void 0 ? r.map((n, a) => {
516
516
  let o = n.values[t];
517
517
  if (o == null) return null;
518
- let c = s === "stacked" ? a.slice(0, i).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, l = X(c), m = X(c + o), h = p?.selectedId === e.id || V?.id === e.id;
519
- return /* @__PURE__ */ T(k, {
520
- x: ($(e.id) ?? Z) + (s === "stacked" ? 0 : ge(n.id) ?? 0),
518
+ let c = s === "stacked" ? r.slice(0, a).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, l = Z(c), m = Z(c + o), h = f?.selectedId === e.id || V?.id === e.id;
519
+ return /* @__PURE__ */ T(A, {
520
+ x: ($(e.id) ?? Q) + (s === "stacked" ? 0 : ge(n.id) ?? 0),
521
521
  y: Math.min(l, m),
522
522
  width: s === "stacked" ? $.bandwidth() : ge.bandwidth(),
523
523
  height: Math.max(+(o === 0), Math.abs(m - l)),
524
- fill: f[r(n.tone, i)],
525
- ...b.props(h && u.selected, d !== void 0 && d !== n.id && le.mutedMark)
524
+ fill: p[i(n.tone, a)],
525
+ ...b.props(h && d.selected, u !== void 0 && u !== n.id && P.mutedMark)
526
526
  }, n.id);
527
- }) : /* @__PURE__ */ T(ce, {
528
- bucket: i,
529
- series: a,
530
- focusedSeries: v,
527
+ }) : /* @__PURE__ */ T(le, {
528
+ bucket: a,
529
+ series: r,
530
+ focusedSeries: g,
531
531
  index: t,
532
- x: $(e.id) ?? Z,
532
+ x: $(e.id) ?? Q,
533
533
  width: $.bandwidth(),
534
- y: X,
535
- isHighlighted: p?.selectedId === e.id || V?.id === e.id,
536
- highlightedSeriesId: d
534
+ y: Z,
535
+ isHighlighted: f?.selectedId === e.id || V?.id === e.id,
536
+ highlightedSeriesId: u
537
537
  }), t % ve === 0 && /* @__PURE__ */ T("text", {
538
- x: ($(e.id) ?? Z) + $.bandwidth() / 2,
538
+ x: ($(e.id) ?? Q) + $.bandwidth() / 2,
539
539
  y: m - 4,
540
540
  textAnchor: "middle",
541
- ...b.props(u.label),
541
+ ...b.props(d.label),
542
542
  children: n.length > ye ? `${n.slice(0, ye - 1)}…` : n
543
543
  })] }, e.id);
544
544
  }),
545
- U !== void 0 && /* @__PURE__ */ T(re, {
546
- x: ($(U.id) ?? Z) + $.bandwidth() / 2,
545
+ U !== void 0 && /* @__PURE__ */ T(ie, {
546
+ x: ($(U.id) ?? Q) + $.bandwidth() / 2,
547
547
  top: 12,
548
- bottom: Y,
548
+ bottom: X,
549
549
  width: Math.max(8, $.bandwidth())
550
550
  })
551
551
  ]
@@ -553,19 +553,19 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
553
553
  })
554
554
  });
555
555
  }
556
- function me(e, t, n) {
556
+ function R(e, t, n) {
557
557
  return e.map((e) => {
558
558
  let r = e.values[t];
559
559
  return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
560
560
  }).join(" · ");
561
561
  }
562
562
  // packages/charts/src/cartesian/breakdown-bar.tsx
563
- var R = {
563
+ var z = {
564
564
  kzqmXN: "x5lhr3w",
565
565
  kZKoxP: "x5yr21d",
566
566
  $$css: !0
567
- }, z = { segment: (e, t) => [
568
- R,
567
+ }, B = { segment: (e, t) => [
568
+ z,
569
569
  {
570
570
  kWkggS: t == null ? t : "xl8spv7",
571
571
  $$css: !0
@@ -575,34 +575,34 @@ var R = {
575
575
  "--x-backgroundColor": t ?? void 0
576
576
  }
577
577
  ] };
578
- function B({ title: e, description: n, items: a, total: o, formatValue: s, selection: c }) {
579
- let l = t(a), u = a.reduce((e, t) => e + (t.value ?? 0), 0), p = 2 ** -52 * Math.max(u, o, 1) * a.length;
580
- return l === void 0 ? !Number.isFinite(o) || o < 0 || u - o > p ? /* @__PURE__ */ T(g, {
578
+ function V({ title: e, description: t, items: r, total: o, formatValue: s, selection: c }) {
579
+ let l = n(r), u = r.reduce((e, t) => e + (t.value ?? 0), 0), d = 2 ** -52 * Math.max(u, o, 1) * r.length;
580
+ return l === void 0 ? !Number.isFinite(o) || o < 0 || u - o > d ? /* @__PURE__ */ T(_, {
581
581
  title: e,
582
- description: n,
582
+ description: t,
583
583
  message: "The total must be finite and at least the sum of recorded values."
584
- }) : /* @__PURE__ */ T(d, {
584
+ }) : /* @__PURE__ */ T(f, {
585
585
  title: e,
586
- description: n,
587
- children: a.length === 0 ? /* @__PURE__ */ T("p", {
586
+ description: t,
587
+ children: r.length === 0 ? /* @__PURE__ */ T("p", {
588
588
  className: "x153jb6y x1ghz6dp xy8obcc",
589
589
  children: "No values"
590
590
  }) : /* @__PURE__ */ E(w, { children: [
591
591
  /* @__PURE__ */ T("div", {
592
592
  "aria-hidden": !0,
593
593
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
594
- children: a.map((e, t) => e.value === null ? null : /* @__PURE__ */ T("span", { ...b.props(z.segment(o === 0 ? 0 : e.value / o * 100, f[r(e.tone, t)])) }, e.id))
594
+ children: r.map((e, t) => e.value === null ? null : /* @__PURE__ */ T("span", { ...b.props(B.segment(o === 0 ? 0 : e.value / o * 100, p[i(e.tone, t)])) }, e.id))
595
595
  }),
596
- /* @__PURE__ */ T(i, {
597
- items: a.map((e, t) => ({
596
+ /* @__PURE__ */ T(a, {
597
+ items: r.map((e, t) => ({
598
598
  id: e.id,
599
599
  label: e.label,
600
600
  valueLabel: e.value === null ? "Unavailable" : s(e.value),
601
- tone: r(e.tone, t)
601
+ tone: i(e.tone, t)
602
602
  })),
603
603
  selection: c
604
604
  }),
605
- o - u > p && /* @__PURE__ */ E("p", {
605
+ o - u > d && /* @__PURE__ */ E("p", {
606
606
  className: "x153jb6y x1ghz6dp xy8obcc",
607
607
  children: [
608
608
  "Unassigned portion: ",
@@ -612,19 +612,19 @@ function B({ title: e, description: n, items: a, total: o, formatValue: s, selec
612
612
  ]
613
613
  })
614
614
  ] })
615
- }) : /* @__PURE__ */ T(g, {
615
+ }) : /* @__PURE__ */ T(_, {
616
616
  title: e,
617
- description: n,
617
+ description: t,
618
618
  message: l
619
619
  });
620
620
  }
621
621
  // packages/charts/src/cartesian/scatter-plot.tsx
622
- var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
622
+ var H = 260, U = 56, W = 20, G = 12, K = 1e3, q = {
623
623
  kzqmXN: "x1xc55vz",
624
624
  kZKoxP: "xdk7pt",
625
625
  kaIpWk: "x16rqkct",
626
626
  $$css: !0
627
- }, K = {
627
+ }, J = {
628
628
  brush: {
629
629
  kFalU9: "xx69xxh",
630
630
  kkrTdU: "xsid9ct",
@@ -662,7 +662,7 @@ var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
662
662
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
663
663
  }],
664
664
  dot: (e) => [
665
- he,
665
+ q,
666
666
  {
667
667
  kWkggS: e == null ? e : "xl8spv7",
668
668
  $$css: !0
@@ -677,24 +677,24 @@ var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
677
677
  $$css: !0
678
678
  }
679
679
  };
680
- function q(e) {
681
- let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: o, yLabel: s, formatX: u, formatY: m, selection: h, rangeSelection: v, emptyLabel: y } = e, { ref: ee, width: x } = _(), te = X(e);
682
- if (te !== null) return /* @__PURE__ */ T(g, {
680
+ function Y(e) {
681
+ let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: o, yLabel: s, formatX: c, formatY: d, selection: h, rangeSelection: g, emptyLabel: y } = e, { ref: ee, width: x } = v(), S = Q(e);
682
+ if (S !== null) return /* @__PURE__ */ T(_, {
683
683
  title: t,
684
684
  description: n,
685
- message: te
685
+ message: S
686
686
  });
687
- let S = O({
687
+ let te = O({
688
688
  domain: [...i],
689
- range: [H, Math.max(H, x - U)]
690
- }), C = O({
689
+ range: [U, Math.max(U, x - W)]
690
+ }), ne = O({
691
691
  domain: [...a],
692
- range: [216, W]
693
- }), w = r.find((e) => e.id === h?.selectedId);
694
- return /* @__PURE__ */ E(d, {
692
+ range: [216, G]
693
+ }), C = r.find((e) => e.id === h?.selectedId);
694
+ return /* @__PURE__ */ E(f, {
695
695
  title: t,
696
696
  description: n,
697
- footer: h !== void 0 && r.length > 0 ? /* @__PURE__ */ T(c, { children: w === void 0 ? "Select a point to inspect its label and coordinates." : `${w.label}, ${o}: ${u(w.x)}, ${s}: ${m(w.y)}` }) : void 0,
697
+ footer: h !== void 0 && r.length > 0 ? /* @__PURE__ */ T(l, { children: C === void 0 ? "Select a point to inspect its label and coordinates." : `${C.label}, ${o}: ${c(C.x)}, ${s}: ${d(C.y)}` }) : void 0,
698
698
  children: [
699
699
  r.length === 0 ? /* @__PURE__ */ T("p", {
700
700
  className: "x1ghz6dp x153jb6y",
@@ -702,63 +702,63 @@ function q(e) {
702
702
  }) : /* @__PURE__ */ E("div", {
703
703
  ref: ee,
704
704
  className: "x1n2onr6 xeuugli",
705
- children: [/* @__PURE__ */ T(J, {
705
+ children: [/* @__PURE__ */ T(X, {
706
706
  width: x,
707
- scaleX: S,
708
- scaleY: C,
707
+ scaleX: te,
708
+ scaleY: ne,
709
709
  ...e
710
710
  }, `${i[0]}:${i[1]}:${a[0]}:${a[1]}:${x}`), h !== void 0 && /* @__PURE__ */ T("div", {
711
711
  className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
712
712
  children: r.map((e) => /* @__PURE__ */ T("button", {
713
713
  type: "button",
714
714
  title: e.label,
715
- "aria-label": `${e.label}, ${o}: ${u(e.x)}, ${s}: ${m(e.y)}`,
715
+ "aria-label": `${e.label}, ${o}: ${c(e.x)}, ${s}: ${d(e.y)}`,
716
716
  "aria-pressed": h.selectedId === e.id,
717
717
  onClick: () => h.onSelect(e.id),
718
- ...b.props(K.target, K.location(S(e.x), C(e.y))),
718
+ ...b.props(J.target, J.location(te(e.x), ne(e.y))),
719
719
  children: /* @__PURE__ */ T("span", {
720
720
  "aria-hidden": !0,
721
- ...b.props(K.dot(f[e.tone]), h.selectedId === e.id && K.selected)
721
+ ...b.props(J.dot(p[e.tone]), h.selectedId === e.id && J.selected)
722
722
  })
723
723
  }, e.id))
724
724
  })]
725
725
  }),
726
- v !== void 0 && /* @__PURE__ */ T(Y, {
726
+ g !== void 0 && /* @__PURE__ */ T(Z, {
727
727
  ...e,
728
- rangeSelection: v
728
+ rangeSelection: g
729
729
  }),
730
- r.length > 0 && /* @__PURE__ */ T(p, { children: r.map((e) => /* @__PURE__ */ E(l, {
731
- label: `${e.label}, ${o}: ${u(e.x)}, ${s}: ${m(e.y)}`,
730
+ r.length > 0 && /* @__PURE__ */ T(m, { children: r.map((e) => /* @__PURE__ */ E(u, {
731
+ label: `${e.label}, ${o}: ${c(e.x)}, ${s}: ${d(e.y)}`,
732
732
  isSelected: h?.selectedId === e.id,
733
733
  onSelect: h === void 0 ? void 0 : () => h.onSelect(e.id),
734
734
  children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ E("span", {
735
735
  className: "xeuugli xss6m8b xj0a0fe x153jb6y",
736
736
  children: [
737
- u(e.x),
737
+ c(e.x),
738
738
  " · ",
739
- m(e.y)
739
+ d(e.y)
740
740
  ]
741
741
  })]
742
742
  }, e.id)) })
743
743
  ]
744
744
  });
745
745
  }
746
- function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: l }) {
747
- let d = x(), [p, m] = C(null), h = p === null ? l?.value : {
748
- x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
749
- y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
746
+ function X({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: l }) {
747
+ let u = S(), [f, m] = C(null), h = f === null ? l?.value : {
748
+ x: [Math.min(f.start.x, f.end.x), Math.max(f.start.x, f.end.x)],
749
+ y: [Math.min(f.start.y, f.end.y), Math.max(f.start.y, f.end.y)]
750
750
  };
751
751
  function g(r) {
752
752
  let i = r.currentTarget.getBoundingClientRect();
753
753
  return {
754
754
  x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
755
- y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * V)
755
+ y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * H)
756
756
  };
757
757
  }
758
758
  function _(t) {
759
759
  if (l === void 0 || t.button !== 0 || t.pointerType === "touch") return;
760
- let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * V;
761
- if (r < H || r > e - U || i < W || i > 216) return;
760
+ let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * H;
761
+ if (r < U || r > e - W || i < G || i > 216) return;
762
762
  let a = g(t);
763
763
  t.currentTarget.setPointerCapture(t.pointerId), m({
764
764
  start: a,
@@ -767,71 +767,71 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
767
767
  });
768
768
  }
769
769
  function v(e) {
770
- p !== null && p.pointerId === e.pointerId && m({
771
- ...p,
770
+ f !== null && f.pointerId === e.pointerId && m({
771
+ ...f,
772
772
  end: g(e)
773
773
  });
774
774
  }
775
775
  function y(e) {
776
- if (p === null || p.pointerId !== e.pointerId) return;
776
+ if (f === null || f.pointerId !== e.pointerId) return;
777
777
  let t = g(e), n = {
778
- x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
779
- y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
778
+ x: [Math.min(f.start.x, t.x), Math.max(f.start.x, t.x)],
779
+ y: [Math.min(f.start.y, t.y), Math.max(f.start.y, t.y)]
780
780
  };
781
781
  m(null), e.currentTarget.releasePointerCapture(e.pointerId), l?.onChange(n);
782
782
  }
783
783
  return /* @__PURE__ */ E("svg", {
784
784
  width: e,
785
- height: V,
786
- viewBox: `0 0 ${e} ${V}`,
785
+ height: H,
786
+ viewBox: `0 0 ${e} ${H}`,
787
787
  "aria-hidden": !0,
788
788
  onPointerDown: _,
789
789
  onPointerMove: v,
790
790
  onPointerUp: y,
791
791
  onPointerCancel: () => m(null),
792
792
  onLostPointerCapture: () => m(null),
793
- ...b.props(u.svg, l !== void 0 && K.brush),
793
+ ...b.props(d.svg, l !== void 0 && J.brush),
794
794
  children: [
795
795
  /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
796
- id: d,
796
+ id: u,
797
797
  children: /* @__PURE__ */ T("rect", {
798
- x: H,
799
- y: W,
800
- width: Math.max(0, e - H - U),
798
+ x: U,
799
+ y: G,
800
+ width: Math.max(0, e - U - W),
801
801
  height: 204
802
802
  })
803
803
  }) }),
804
804
  t.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
805
805
  x1: t(e),
806
806
  x2: t(e),
807
- y1: W,
807
+ y1: G,
808
808
  y2: 216,
809
- ...b.props(u.grid)
809
+ ...b.props(d.grid)
810
810
  }), /* @__PURE__ */ T("text", {
811
811
  x: t(e),
812
812
  y: 234,
813
813
  textAnchor: "middle",
814
- ...b.props(u.label),
814
+ ...b.props(d.label),
815
815
  children: o(e)
816
816
  })] }, e)),
817
817
  n.ticks(4).map((t) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
818
- x1: H,
819
- x2: e - U,
818
+ x1: U,
819
+ x2: e - W,
820
820
  y1: n(t),
821
821
  y2: n(t),
822
- ...b.props(u.grid)
822
+ ...b.props(d.grid)
823
823
  }), /* @__PURE__ */ T("text", {
824
824
  x: 48,
825
825
  y: n(t) + 4,
826
826
  textAnchor: "end",
827
- ...b.props(u.label),
827
+ ...b.props(d.label),
828
828
  children: s(t)
829
829
  })] }, t)),
830
830
  /* @__PURE__ */ T("text", {
831
- x: (H + e - U) / 2,
831
+ x: (U + e - W) / 2,
832
832
  y: 256,
833
833
  textAnchor: "middle",
834
- ...b.props(u.label),
834
+ ...b.props(d.label),
835
835
  children: i
836
836
  }),
837
837
  /* @__PURE__ */ T("text", {
@@ -839,11 +839,11 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
839
839
  y: 108,
840
840
  textAnchor: "middle",
841
841
  transform: "rotate(-90 12 108)",
842
- ...b.props(u.label),
842
+ ...b.props(d.label),
843
843
  children: a
844
844
  }),
845
845
  /* @__PURE__ */ E("g", {
846
- clipPath: `url(#${d})`,
846
+ clipPath: `url(#${u})`,
847
847
  children: [h != null && /* @__PURE__ */ T("rect", {
848
848
  x: t(h.x[0]),
849
849
  y: n(h.y[1]),
@@ -854,13 +854,13 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
854
854
  cx: t(e.x),
855
855
  cy: n(e.y),
856
856
  r: 4,
857
- fill: f[e.tone]
857
+ fill: p[e.tone]
858
858
  }, e.id))]
859
859
  })
860
860
  ]
861
861
  });
862
862
  }
863
- function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: o, formatY: s }) {
863
+ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: s }) {
864
864
  let c = e.value ?? {
865
865
  x: t,
866
866
  y: n
@@ -872,7 +872,7 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
872
872
  className: "x153jb6y xy8obcc x1jfksii",
873
873
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
874
874
  }),
875
- /* @__PURE__ */ E(v.Root, {
875
+ /* @__PURE__ */ E(y.Root, {
876
876
  value: c.x,
877
877
  min: t[0],
878
878
  max: t[1],
@@ -885,26 +885,26 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
885
885
  }),
886
886
  children: [/* @__PURE__ */ E("div", {
887
887
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
888
- children: [/* @__PURE__ */ T(v.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
889
- o(c.x[0]),
888
+ children: [/* @__PURE__ */ T(y.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
889
+ a(c.x[0]),
890
890
  " – ",
891
- o(c.x[1])
891
+ a(c.x[1])
892
892
  ] })]
893
- }), /* @__PURE__ */ T(v.Control, { children: /* @__PURE__ */ E(v.Track, { children: [
894
- /* @__PURE__ */ T(v.Indicator, {}),
895
- /* @__PURE__ */ T(v.Thumb, {
893
+ }), /* @__PURE__ */ T(y.Control, { children: /* @__PURE__ */ E(y.Track, { children: [
894
+ /* @__PURE__ */ T(y.Indicator, {}),
895
+ /* @__PURE__ */ T(y.Thumb, {
896
896
  index: 0,
897
897
  "aria-label": `${r} minimum`,
898
- getAriaValueText: (e, t) => o(t)
898
+ getAriaValueText: (e, t) => a(t)
899
899
  }),
900
- /* @__PURE__ */ T(v.Thumb, {
900
+ /* @__PURE__ */ T(y.Thumb, {
901
901
  index: 1,
902
902
  "aria-label": `${r} maximum`,
903
- getAriaValueText: (e, t) => o(t)
903
+ getAriaValueText: (e, t) => a(t)
904
904
  })
905
905
  ] }) })]
906
906
  }),
907
- /* @__PURE__ */ E(v.Root, {
907
+ /* @__PURE__ */ E(y.Root, {
908
908
  value: c.y,
909
909
  min: n[0],
910
910
  max: n[1],
@@ -917,26 +917,26 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
917
917
  }),
918
918
  children: [/* @__PURE__ */ E("div", {
919
919
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
920
- children: [/* @__PURE__ */ T(v.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
920
+ children: [/* @__PURE__ */ T(y.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
921
921
  s(c.y[0]),
922
922
  " – ",
923
923
  s(c.y[1])
924
924
  ] })]
925
- }), /* @__PURE__ */ T(v.Control, { children: /* @__PURE__ */ E(v.Track, { children: [
926
- /* @__PURE__ */ T(v.Indicator, {}),
927
- /* @__PURE__ */ T(v.Thumb, {
925
+ }), /* @__PURE__ */ T(y.Control, { children: /* @__PURE__ */ E(y.Track, { children: [
926
+ /* @__PURE__ */ T(y.Indicator, {}),
927
+ /* @__PURE__ */ T(y.Thumb, {
928
928
  index: 0,
929
929
  "aria-label": `${i} minimum`,
930
930
  getAriaValueText: (e, t) => s(t)
931
931
  }),
932
- /* @__PURE__ */ T(v.Thumb, {
932
+ /* @__PURE__ */ T(y.Thumb, {
933
933
  index: 1,
934
934
  "aria-label": `${i} maximum`,
935
935
  getAriaValueText: (e, t) => s(t)
936
936
  })
937
937
  ] }) })]
938
938
  }),
939
- /* @__PURE__ */ T(a, {
939
+ /* @__PURE__ */ T(o, {
940
940
  type: "button",
941
941
  disabled: e.value === null,
942
942
  onClick: () => e.onChange(null),
@@ -945,10 +945,10 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
945
945
  ]
946
946
  });
947
947
  }
948
- function X({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
949
- if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
950
- if (e.length > 1e3) return `This plot exceeds the ${G}-point render limit. Supply a smaller, labelled sample.`;
951
- if (!m(e)) return "Scatter points must have unique identifiers.";
948
+ function Q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
949
+ if (!g(t) || !g(n)) return "Scatter domains must contain finite, increasing endpoints.";
950
+ if (e.length > 1e3) return `This plot exceeds the ${K}-point render limit. Supply a smaller, labelled sample.`;
951
+ if (!h(e)) return "Scatter points must have unique identifiers.";
952
952
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
953
953
  if (e.some((e) => {
954
954
  let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
@@ -958,18 +958,18 @@ function X({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
958
958
  let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
959
959
  if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
960
960
  let o = r.value;
961
- return o === null ? null : !Z(o.x, t) || !Z(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
961
+ return o === null ? null : !he(o.x, t) || !he(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
962
962
  }
963
- function Z(e, t) {
963
+ function he(e, t) {
964
964
  return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
965
965
  }
966
966
  // packages/charts/src/cartesian/time-series-data.ts
967
- var Q = {
967
+ var $ = {
968
968
  series: 12,
969
969
  pointsPerSeries: 2e3,
970
970
  markers: 200,
971
971
  panels: 12
972
- }, $ = .01, ge = [
972
+ }, ge = .01, _e = [
973
973
  "series1",
974
974
  "series2",
975
975
  "series3",
@@ -977,13 +977,13 @@ var Q = {
977
977
  "series5",
978
978
  "series6"
979
979
  ];
980
- function _e({ series: e, isStacked: t, markers: n }) {
980
+ function ve({ series: e, isStacked: t, markers: n }) {
981
981
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
982
- if (e.length > Q.series || r.length > Q.pointsPerSeries || n.length > Q.markers) return `Choose a window with at most ${Q.series} series, ${Q.pointsPerSeries} observations per series, and ${Q.markers} markers.`;
983
- if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
982
+ if (e.length > $.series || r.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
983
+ if (!h(e) || !h(n)) return "Series and markers require unique identifiers.";
984
984
  for (let n of e) {
985
985
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
986
- let e = xe({
986
+ let e = Se({
987
987
  points: n.points,
988
988
  timestamps: r,
989
989
  isStacked: t
@@ -1001,7 +1001,7 @@ function _e({ series: e, isStacked: t, markers: n }) {
1001
1001
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
1002
1002
  if (t && r.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
1003
1003
  }
1004
- function ve({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1004
+ function ye({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1005
1005
  return JSON.stringify([
1006
1006
  n,
1007
1007
  r,
@@ -1021,15 +1021,15 @@ function ve({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1021
1021
  ])
1022
1022
  ]);
1023
1023
  }
1024
- function ye(e, t, n = !1) {
1024
+ function be(e, t, n = !1) {
1025
1025
  if (e !== t) return [e, t];
1026
- let r = Math.max(1, Math.abs(e) * $), i = n ? 0 : e - r, a = t + r;
1026
+ let r = Math.max(1, Math.abs(e) * ge), i = n ? 0 : e - r, a = t + r;
1027
1027
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
1028
1028
  }
1029
- function be(e, t) {
1029
+ function xe(e, t) {
1030
1030
  let n = e.filter((e) => e.tone === void 0);
1031
1031
  return e.map((r, i) => {
1032
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ge[a % ge.length] ?? "series1", s = r.points.map((n, r) => {
1032
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? _e[a % _e.length] ?? "series1", s = r.points.map((n, r) => {
1033
1033
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
1034
1034
  return {
1035
1035
  ...n,
@@ -1044,7 +1044,7 @@ function be(e, t) {
1044
1044
  };
1045
1045
  });
1046
1046
  }
1047
- function xe({ points: e, timestamps: t, isStacked: n }) {
1047
+ function Se({ points: e, timestamps: t, isStacked: n }) {
1048
1048
  for (let [r, i] of e.entries()) {
1049
1049
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1050
1050
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -1053,14 +1053,14 @@ function xe({ points: e, timestamps: t, isStacked: n }) {
1053
1053
  }
1054
1054
  }
1055
1055
  // packages/charts/src/cartesian/time-series-line.tsx
1056
- function Se({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
1057
- return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(A, {
1056
+ function Ce({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
1057
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(re, {
1058
1058
  data: [...e.points],
1059
1059
  defined: (e) => e.value !== null,
1060
1060
  x: (e) => t(e.timestamp),
1061
1061
  y: (e) => n((e.value ?? 0) + e.base),
1062
- stroke: f[e.tone],
1063
- ...b.props(u.mark)
1062
+ stroke: p[e.tone],
1063
+ ...b.props(d.mark)
1064
1064
  }), e.points.filter((t, n) => {
1065
1065
  if (t.value === null) return !1;
1066
1066
  let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
@@ -1069,12 +1069,12 @@ function Se({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }
1069
1069
  cx: t(r.timestamp),
1070
1070
  cy: n((r.value ?? 0) + r.base),
1071
1071
  r: i,
1072
- fill: f[e.tone]
1072
+ fill: p[e.tone]
1073
1073
  }, r.timestamp))] });
1074
1074
  }
1075
1075
  // packages/charts/src/cartesian/sparkline.tsx
1076
- function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1077
- let o = x(), s = x(), c = we({
1076
+ function we({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1077
+ let o = S(), s = S(), c = Te({
1078
1078
  title: e,
1079
1079
  summary: t,
1080
1080
  unit: n,
@@ -1089,12 +1089,12 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1089
1089
  children: c === void 0 ? "No data" : "Invalid trend"
1090
1090
  });
1091
1091
  let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
1092
- domain: [...ye(u, d)],
1092
+ domain: [...be(u, d)],
1093
1093
  range: [3, 125]
1094
1094
  }), p = O({
1095
1095
  domain: [...a],
1096
1096
  range: [29, 3]
1097
- }), m = be([i], !1)[0];
1097
+ }), m = xe([i], !1)[0];
1098
1098
  return /* @__PURE__ */ E("svg", {
1099
1099
  role: "img",
1100
1100
  "aria-labelledby": o,
@@ -1127,7 +1127,7 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1127
1127
  "."
1128
1128
  ]
1129
1129
  }),
1130
- m !== void 0 && /* @__PURE__ */ T(Se, {
1130
+ m !== void 0 && /* @__PURE__ */ T(Ce, {
1131
1131
  series: m,
1132
1132
  x: f,
1133
1133
  y: p,
@@ -1136,10 +1136,10 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1136
1136
  ]
1137
1137
  });
1138
1138
  }
1139
- function we({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1139
+ function Te({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1140
1140
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1141
- if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
1142
- let a = _e({
1141
+ if (!g(i)) return "The displayed value domain must have finite, increasing bounds.";
1142
+ let a = ve({
1143
1143
  series: [r],
1144
1144
  isStacked: !1,
1145
1145
  markers: []
@@ -1148,7 +1148,7 @@ function we({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1148
1148
  if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
1149
1149
  }
1150
1150
  // packages/charts/src/cartesian/time-series.tsx
1151
- var Te = {
1151
+ var Ee = {
1152
1152
  timeAxis: {
1153
1153
  k1xSpc: "x78zum5",
1154
1154
  kjj79g: "x1qughib",
@@ -1169,45 +1169,86 @@ var Te = {
1169
1169
  "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
1170
1170
  }]
1171
1171
  };
1172
- function Ee(e) {
1173
- return /* @__PURE__ */ T(Ae, {
1172
+ function De(e) {
1173
+ return /* @__PURE__ */ T(Me, {
1174
1174
  ...e,
1175
1175
  kind: "line",
1176
1176
  isStacked: !1
1177
1177
  });
1178
1178
  }
1179
- function De({ isStacked: e = !1, ...t }) {
1180
- return /* @__PURE__ */ T(Ae, {
1179
+ function Oe({ isStacked: e = !1, ...t }) {
1180
+ return /* @__PURE__ */ T(Me, {
1181
1181
  ...t,
1182
1182
  kind: "area",
1183
1183
  isStacked: e
1184
1184
  });
1185
1185
  }
1186
- function Oe({ charts: e, ...t }) {
1187
- let n = S(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
1186
+ function ke({ title: n, description: r, series: i, actions: a, height: o = 180 }) {
1187
+ let s = S(), c = xe(i.map((e) => ({
1188
+ ...e,
1189
+ points: []
1190
+ })), !1);
1191
+ return !Number.isFinite(o) || o < 48 ? /* @__PURE__ */ T(_, {
1192
+ title: n,
1193
+ description: r,
1194
+ message: "Chart height must be at least 48 pixels."
1195
+ }) : /* @__PURE__ */ T("div", {
1196
+ "aria-hidden": !0,
1197
+ inert: !0,
1198
+ className: "xeuugli",
1199
+ children: /* @__PURE__ */ T(f, {
1200
+ title: n,
1201
+ description: r,
1202
+ actions: /* @__PURE__ */ E(w, { children: [a, /* @__PURE__ */ T(ae, {
1203
+ title: n,
1204
+ children: null
1205
+ })] }),
1206
+ children: /* @__PURE__ */ E("div", {
1207
+ className: "xrvj5dj x1n8ia3y",
1208
+ children: [/* @__PURE__ */ T(se, {
1209
+ id: s,
1210
+ label: void 0,
1211
+ legend: c,
1212
+ rows: [],
1213
+ x: 0,
1214
+ width: 0,
1215
+ source: void 0
1216
+ }), /* @__PURE__ */ E("div", {
1217
+ ...b.props(d.plot),
1218
+ children: [/* @__PURE__ */ T(t, { height: o - 16 }), /* @__PURE__ */ E("div", {
1219
+ className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
1220
+ children: [/* @__PURE__ */ T(e, { width: "8ch" }), /* @__PURE__ */ T(e, { width: "8ch" })]
1221
+ })]
1222
+ })]
1223
+ })
1224
+ })
1225
+ });
1226
+ }
1227
+ function Ae({ charts: e, ...t }) {
1228
+ let n = ne(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
1188
1229
  e.id,
1189
1230
  e.title,
1190
- ve({
1231
+ ye({
1191
1232
  series: e.series,
1192
1233
  markers: e.markers ?? [],
1193
1234
  timestampUnit: t.timestampUnit,
1194
1235
  isStacked: !1
1195
1236
  })
1196
1237
  ])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
1197
- if (r !== void 0 && r.signature !== a && i(void 0), ee(() => {
1238
+ if (r !== void 0 && r.signature !== a && i(void 0), x(() => {
1198
1239
  function e(e) {
1199
1240
  e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
1200
1241
  }
1201
1242
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1202
- }, []), !s || !m(e)) return /* @__PURE__ */ T(g, {
1243
+ }, []), !s || !h(e)) return /* @__PURE__ */ T(_, {
1203
1244
  title: "Small multiples",
1204
1245
  message: "Charts need unique identifiers and aligned observation timestamps."
1205
1246
  });
1206
- if (e.length > Q.panels) return /* @__PURE__ */ T(g, {
1247
+ if (e.length > $.panels) return /* @__PURE__ */ T(_, {
1207
1248
  title: "Small multiples",
1208
- message: `Choose at most ${Q.panels} panels.`
1249
+ message: `Choose at most ${$.panels} panels.`
1209
1250
  });
1210
- if (e.length === 0) return /* @__PURE__ */ T(d, {
1251
+ if (e.length === 0) return /* @__PURE__ */ T(f, {
1211
1252
  title: "Small multiples",
1212
1253
  children: /* @__PURE__ */ T("p", {
1213
1254
  className: "x153jb6y",
@@ -1224,7 +1265,7 @@ function Oe({ charts: e, ...t }) {
1224
1265
  return /* @__PURE__ */ T("div", {
1225
1266
  ref: n,
1226
1267
  className: "xrvj5dj x1j825kq",
1227
- children: e.map((e) => /* @__PURE__ */ T(Ae, {
1268
+ children: e.map((e) => /* @__PURE__ */ T(Me, {
1228
1269
  ...t,
1229
1270
  title: e.title,
1230
1271
  description: e.description,
@@ -1239,39 +1280,39 @@ function Oe({ charts: e, ...t }) {
1239
1280
  }, e.id))
1240
1281
  });
1241
1282
  }
1242
- var ke = {
1283
+ var je = {
1243
1284
  "x-default-marker": "x-default-marker",
1244
1285
  $$css: !0
1245
1286
  };
1246
- function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: l, kind: p, isStacked: m, sharedInspection: h, axisWidth: v }) {
1247
- let D = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : _e({
1287
+ function Me({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: l, kind: u, isStacked: m, sharedInspection: h, axisWidth: g }) {
1288
+ let y = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : ve({
1248
1289
  series: n,
1249
1290
  isStacked: m,
1250
1291
  markers: s
1251
- }), k = te(() => D === void 0 ? be(n, m) : [], [
1292
+ }), D = te(() => y === void 0 ? xe(n, m) : [], [
1252
1293
  n,
1253
1294
  m,
1254
- D
1255
- ]), A = k[0]?.points ?? [], { ref: ae, width: j, element: se } = _(), N = S(null), [ce, le] = C(), ue = A.find((e) => e.timestamp === ce) ?? A[0], [P, de] = C(), F = ve({
1295
+ y
1296
+ ]), A = D[0]?.points ?? [], { ref: re, width: j, element: M } = v(), ce = ne(null), [N, le] = C(), P = A.find((e) => e.timestamp === N) ?? A[0], [ue, de] = C(), F = ye({
1256
1297
  series: n,
1257
1298
  markers: s,
1258
1299
  timestampUnit: r,
1259
1300
  isStacked: m
1260
- }), I = h === void 0 ? P?.signature === F ? P : void 0 : h.value, fe = x();
1261
- P !== void 0 && (P.signature !== F || D !== void 0) && de(void 0);
1301
+ }), I = h === void 0 ? ue?.signature === F ? ue : void 0 : h.value, fe = S();
1302
+ ue !== void 0 && (ue.signature !== F || y !== void 0) && de(void 0);
1262
1303
  let pe = h !== void 0;
1263
- if (ee(() => {
1304
+ if (x(() => {
1264
1305
  if (pe) return;
1265
1306
  function e(e) {
1266
- e.target instanceof Node && N.current?.contains(e.target) !== !0 && de(void 0);
1307
+ e.target instanceof Node && ce.current?.contains(e.target) !== !0 && de(void 0);
1267
1308
  }
1268
1309
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1269
- }, [pe]), D !== void 0) return /* @__PURE__ */ T(g, {
1310
+ }, [pe]), y !== void 0) return /* @__PURE__ */ T(_, {
1270
1311
  title: e,
1271
1312
  description: t,
1272
- message: D
1313
+ message: y
1273
1314
  });
1274
- if (A.length === 0) return /* @__PURE__ */ T(d, {
1315
+ if (A.length === 0) return /* @__PURE__ */ T(f, {
1275
1316
  title: e,
1276
1317
  description: t,
1277
1318
  actions: l,
@@ -1280,32 +1321,32 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1280
1321
  children: "No observations"
1281
1322
  })
1282
1323
  });
1283
- let L = c - 28, me = L + 12, R = A[0]?.timestamp ?? 0, z = A.at(-1)?.timestamp ?? R, B = k.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), V = p === "area" ? Math.min(0, ...B) : Math.min(...B), H = p === "area" ? Math.max(0, ...B) : Math.max(...B), U = B.length === 0 ? 0 : V, W = B.length === 0 ? 1 : H, G = O({
1284
- domain: [...ye(U, W, p === "area")],
1324
+ let L = c - 28, me = L + 12, R = A[0]?.timestamp ?? 0, z = A.at(-1)?.timestamp ?? R, B = D.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), V = u === "area" ? Math.min(0, ...B) : Math.min(...B), H = u === "area" ? Math.max(0, ...B) : Math.max(...B), U = B.length === 0 ? 0 : V, W = B.length === 0 ? 1 : H, G = O({
1325
+ domain: [...be(U, W, u === "area")],
1285
1326
  range: [L, 12]
1286
- }), he = G.ticks(3), K = v ?? Math.max(44, ...he.map((e) => o(e).length * 7 + 12)), q = Math.max(K + 1, j - 16), J = O({
1287
- domain: [...ye(R, z)],
1288
- range: [K, q]
1327
+ }), K = G.ticks(3), q = g ?? Math.max(44, ...K.map((e) => o(e).length * 7 + 12)), J = Math.max(q + 1, j - 16), Y = O({
1328
+ domain: [...be(R, z)],
1329
+ range: [q, J]
1289
1330
  });
1290
- function Y(e) {
1291
- let t = se?.getBoundingClientRect();
1331
+ function X(e) {
1332
+ let t = M?.getBoundingClientRect();
1292
1333
  if (t === void 0) return;
1293
- let n = J.invert(e - t.left), r = A.find((e, t) => {
1334
+ let n = Y.invert(e - t.left), r = A.find((e, t) => {
1294
1335
  let r = A[t + 1];
1295
1336
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
1296
1337
  });
1297
- r !== void 0 && X({
1338
+ r !== void 0 && Z({
1298
1339
  signature: F,
1299
1340
  timestamp: r.timestamp,
1300
1341
  source: "pointer"
1301
1342
  });
1302
1343
  }
1303
- function X(e) {
1344
+ function Z(e) {
1304
1345
  h === void 0 ? de(e) : h.onChange(e);
1305
1346
  }
1306
- function Z(e) {
1347
+ function Q(e) {
1307
1348
  if (e.altKey || e.ctrlKey || e.metaKey) return;
1308
- let t = A.findIndex((e) => e.timestamp === ue?.timestamp), n = {
1349
+ let t = A.findIndex((e) => e.timestamp === P?.timestamp), n = {
1309
1350
  ArrowRight: Math.min(A.length - 1, t + 1),
1310
1351
  ArrowLeft: Math.max(0, t - 1),
1311
1352
  Home: 0,
@@ -1313,7 +1354,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1313
1354
  };
1314
1355
  switch (e.key) {
1315
1356
  case "Escape":
1316
- e.preventDefault(), e.stopPropagation(), X(void 0);
1357
+ e.preventDefault(), e.stopPropagation(), Z(void 0);
1317
1358
  break;
1318
1359
  case "ArrowRight":
1319
1360
  case "ArrowLeft":
@@ -1321,7 +1362,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1321
1362
  case "End": {
1322
1363
  e.preventDefault();
1323
1364
  let t = A[n[e.key]];
1324
- t !== void 0 && (le(t.timestamp), X({
1365
+ t !== void 0 && (le(t.timestamp), Z({
1325
1366
  signature: F,
1326
1367
  timestamp: t.timestamp,
1327
1368
  source: "keyboard"
@@ -1331,10 +1372,10 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1331
1372
  }
1332
1373
  }
1333
1374
  return /* @__PURE__ */ T("div", {
1334
- ref: N,
1375
+ ref: ce,
1335
1376
  className: "xeuugli",
1336
- children: /* @__PURE__ */ T(d, {
1337
- title: /* @__PURE__ */ T(M, {
1377
+ children: /* @__PURE__ */ T(f, {
1378
+ title: /* @__PURE__ */ T(oe, {
1338
1379
  title: e,
1339
1380
  detail: I === void 0 ? void 0 : i(I.timestamp)
1340
1381
  }),
@@ -1342,7 +1383,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1342
1383
  actions: /* @__PURE__ */ E(w, { children: [
1343
1384
  l,
1344
1385
  " ",
1345
- /* @__PURE__ */ T(ie, {
1386
+ /* @__PURE__ */ T(ae, {
1346
1387
  title: e,
1347
1388
  children: /* @__PURE__ */ E("table", {
1348
1389
  className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
@@ -1356,7 +1397,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1356
1397
  r,
1357
1398
  ")"
1358
1399
  ]
1359
- }), k.map((e) => /* @__PURE__ */ T("th", {
1400
+ }), D.map((e) => /* @__PURE__ */ T("th", {
1360
1401
  scope: "col",
1361
1402
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1362
1403
  children: e.label
@@ -1365,7 +1406,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1365
1406
  scope: "row",
1366
1407
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1367
1408
  children: i(e.timestamp)
1368
- }), k.map((e) => /* @__PURE__ */ T("td", {
1409
+ }), D.map((e) => /* @__PURE__ */ T("td", {
1369
1410
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1370
1411
  children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1371
1412
  }, e.id))] }, e.timestamp)) })
@@ -1376,15 +1417,15 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1376
1417
  children: /* @__PURE__ */ E("div", {
1377
1418
  className: "xrvj5dj x1n8ia3y",
1378
1419
  children: [
1379
- /* @__PURE__ */ T(oe, {
1420
+ /* @__PURE__ */ T(se, {
1380
1421
  id: fe,
1381
1422
  label: I === void 0 ? void 0 : i(I.timestamp),
1382
- legend: k.map(({ id: e, label: t, tone: n }) => ({
1423
+ legend: D.map(({ id: e, label: t, tone: n }) => ({
1383
1424
  id: e,
1384
1425
  label: t,
1385
1426
  tone: n
1386
1427
  })),
1387
- rows: k.map((e) => {
1428
+ rows: D.map((e) => {
1388
1429
  let t = e.points.find((e) => e.timestamp === I?.timestamp);
1389
1430
  return {
1390
1431
  id: e.id,
@@ -1393,14 +1434,14 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1393
1434
  value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1394
1435
  };
1395
1436
  }),
1396
- x: J(I?.timestamp ?? R),
1437
+ x: Y(I?.timestamp ?? R),
1397
1438
  width: j,
1398
1439
  source: I?.source,
1399
1440
  notes: s.filter((e) => e.timestamp === I?.timestamp).map((e) => e.label)
1400
1441
  }),
1401
1442
  /* @__PURE__ */ E("div", {
1402
- ref: ae,
1403
- ...b.props(u.plot),
1443
+ ref: re,
1444
+ ...b.props(d.plot),
1404
1445
  children: [/* @__PURE__ */ E("svg", {
1405
1446
  role: "img",
1406
1447
  "aria-label": `${e}. Use arrow keys to inspect observations.`,
@@ -1408,11 +1449,11 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1408
1449
  tabIndex: 0,
1409
1450
  viewBox: `0 0 ${j} ${me}`,
1410
1451
  height: me,
1411
- onKeyDown: Z,
1452
+ onKeyDown: Q,
1412
1453
  onFocus: (e) => {
1413
1454
  if (e.currentTarget.matches(":focus-visible")) {
1414
1455
  let e = I?.timestamp ?? R;
1415
- le(e), X({
1456
+ le(e), Z({
1416
1457
  signature: F,
1417
1458
  timestamp: e,
1418
1459
  source: "keyboard"
@@ -1420,74 +1461,74 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1420
1461
  }
1421
1462
  },
1422
1463
  onPointerMove: (e) => {
1423
- e.pointerType === "mouse" && Y(e.clientX);
1464
+ e.pointerType === "mouse" && X(e.clientX);
1424
1465
  },
1425
- onPointerDown: (e) => Y(e.clientX),
1466
+ onPointerDown: (e) => X(e.clientX),
1426
1467
  onPointerLeave: (e) => {
1427
- e.pointerType === "mouse" && I?.source === "pointer" && X(void 0);
1468
+ e.pointerType === "mouse" && I?.source === "pointer" && Z(void 0);
1428
1469
  },
1429
- onBlur: () => X(void 0),
1430
- ...b.props(u.svg, u.inspectable, ke),
1470
+ onBlur: () => Z(void 0),
1471
+ ...b.props(d.svg, d.inspectable, je),
1431
1472
  children: [
1432
- he.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
1433
- x1: K,
1434
- x2: q,
1473
+ K.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
1474
+ x1: q,
1475
+ x2: J,
1435
1476
  y1: G(e),
1436
1477
  y2: G(e),
1437
- ...b.props(u.grid)
1478
+ ...b.props(d.grid)
1438
1479
  }), /* @__PURE__ */ T("text", {
1439
- x: K - 8,
1480
+ x: q - 8,
1440
1481
  y: G(e),
1441
1482
  textAnchor: "end",
1442
1483
  dominantBaseline: "middle",
1443
- ...b.props(u.label),
1484
+ ...b.props(d.label),
1444
1485
  children: o(e)
1445
1486
  })] }, e)),
1446
- k.map((e) => /* @__PURE__ */ E("g", { children: [p === "area" && /* @__PURE__ */ T(ne, {
1487
+ D.map((e) => /* @__PURE__ */ E("g", { children: [u === "area" && /* @__PURE__ */ T(k, {
1447
1488
  data: [...e.points],
1448
1489
  defined: (e) => e.value !== null,
1449
- x: (e) => J(e.timestamp),
1490
+ x: (e) => Y(e.timestamp),
1450
1491
  y0: (e) => G(e.base),
1451
1492
  y1: (e) => G((e.value ?? 0) + e.base),
1452
1493
  yScale: G,
1453
- fill: f[e.tone],
1494
+ fill: p[e.tone],
1454
1495
  fillOpacity: m ? .65 : .15
1455
- }), /* @__PURE__ */ T(Se, {
1496
+ }), /* @__PURE__ */ T(Ce, {
1456
1497
  series: e,
1457
- x: J,
1498
+ x: Y,
1458
1499
  y: G,
1459
1500
  inspectedTimestamp: I?.timestamp
1460
1501
  })] }, e.id)),
1461
1502
  s.map((e) => /* @__PURE__ */ E("g", { children: [e.kind === "time" ? /* @__PURE__ */ T("line", {
1462
- x1: J(e.timestamp),
1463
- x2: J(e.timestamp),
1503
+ x1: Y(e.timestamp),
1504
+ x2: Y(e.timestamp),
1464
1505
  y1: 12,
1465
1506
  y2: L,
1466
1507
  className: "xhq4mlf x1ntoi03 x13efnbd"
1467
1508
  }) : /* @__PURE__ */ T("circle", {
1468
- cx: J(e.timestamp),
1469
- cy: G(e.value + (k.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1509
+ cx: Y(e.timestamp),
1510
+ cy: G(e.value + (D.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1470
1511
  r: 4,
1471
- fill: y.surface,
1472
- ...b.props(u.selected)
1512
+ fill: ee.surface,
1513
+ ...b.props(d.selected)
1473
1514
  }), /* @__PURE__ */ T("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1474
1515
  I !== void 0 && /* @__PURE__ */ T("line", {
1475
- x1: J(I.timestamp),
1476
- x2: J(I.timestamp),
1516
+ x1: Y(I.timestamp),
1517
+ x2: Y(I.timestamp),
1477
1518
  y1: 12,
1478
1519
  y2: L,
1479
1520
  className: "xhq4mlf x1ntoi03 x13efnbd"
1480
1521
  }),
1481
- ue !== void 0 && /* @__PURE__ */ T(re, {
1482
- x: J(ue.timestamp),
1522
+ P !== void 0 && /* @__PURE__ */ T(ie, {
1523
+ x: Y(P.timestamp),
1483
1524
  top: 12,
1484
1525
  bottom: L,
1485
- width: Math.min(16, (q - K) / 2)
1526
+ width: Math.min(16, (J - q) / 2)
1486
1527
  })
1487
1528
  ]
1488
1529
  }), /* @__PURE__ */ E("div", {
1489
1530
  "aria-hidden": !0,
1490
- ...b.props(Te.timeAxis, Te.timeAxisInset(K, Math.max(0, j - q))),
1531
+ ...b.props(Ee.timeAxis, Ee.timeAxisInset(q, Math.max(0, j - J))),
1491
1532
  children: [/* @__PURE__ */ T("span", {
1492
1533
  className: "x1cqoux5 xeuugli xj0a0fe",
1493
1534
  children: i(R)
@@ -1511,4 +1552,4 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1511
1552
  })
1512
1553
  });
1513
1554
  }
1514
- export { De as AreaChart, L as BarChart, F as BarChartPlaceholder, B as BreakdownBar, Ee as LineChart, G as MAX_SCATTER_POINTS, q as ScatterPlot, Oe as SmallMultiples, Ce as Sparkline, Q as timeSeriesLimits };
1555
+ export { Oe as AreaChart, me as BarChart, I as BarChartPlaceholder, V as BreakdownBar, De as LineChart, K as MAX_SCATTER_POINTS, Y as ScatterPlot, Ae as SmallMultiples, we as Sparkline, ke as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };