@lilt-ui/charts 0.3.0 → 0.4.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.
@@ -2090,29 +2090,43 @@ function sn(e, t, n, r, i) {
2090
2090
  }
2091
2091
  //#endregion
2092
2092
  //#region src/motion/use-glide.ts
2093
- function cn(e, t) {
2094
- let n = ie(e), r = D(null), i = D(e), a = D(t);
2095
- a.current = t;
2096
- let o = S((e, t = !1) => {
2097
- if (t || e !== i.current || !r.current) {
2098
- if (i.current = e, r.current?.stop(), r.current = null, t || n.get() === e) {
2099
- n.jump(e);
2093
+ var cn = 1 / 60, ln = 1 / 240, un = .01;
2094
+ function dn(e, t) {
2095
+ let n = ie(e), r = D(e), i = D(0), a = D(null), o = D(0), s = D(t);
2096
+ s.current = t;
2097
+ let c = S(() => {
2098
+ a.current !== null && cancelAnimationFrame(a.current), a.current = null;
2099
+ }, []), l = S((e) => {
2100
+ let t = Math.min(Math.max(0, (e - o.current) / 1e3), cn);
2101
+ o.current = e;
2102
+ let { stiffness: c, damping: u, mass: d = 1 } = s.current, f = r.current, p = n.get(), m = i.current;
2103
+ for (let e = 0; e < t; e += ln) {
2104
+ let n = Math.min(ln, t - e);
2105
+ m += (-c * (p - f) - u * m) / d * n, p += m * n;
2106
+ }
2107
+ if (Math.abs(p - f) < un && Math.abs(m) < un) {
2108
+ i.current = 0, a.current = null, n.jump(f);
2109
+ return;
2110
+ }
2111
+ i.current = m, n.set(p), a.current = requestAnimationFrame(l);
2112
+ }, [n]), u = S((e, t = !1) => {
2113
+ if (t || e !== r.current || a.current === null) {
2114
+ if (r.current = e, t || n.get() === e || typeof requestAnimationFrame != "function") {
2115
+ c(), i.current = 0, n.jump(e);
2100
2116
  return;
2101
2117
  }
2102
- r.current = ne(n, e, {
2103
- type: "spring",
2104
- ...a.current,
2105
- restDelta: .01,
2106
- restSpeed: .01,
2107
- onComplete: () => n.jump(e)
2108
- });
2118
+ a.current === null && (o.current = performance.now(), a.current = requestAnimationFrame(l));
2109
2119
  }
2110
- }, [n]);
2111
- return C(() => () => r.current?.stop(), []), [n, o];
2120
+ }, [
2121
+ l,
2122
+ c,
2123
+ n
2124
+ ]);
2125
+ return C(() => c, [c]), [n, u];
2112
2126
  }
2113
2127
  //#endregion
2114
2128
  //#region src/interaction/tooltip-context.ts
2115
- function ln(e, t, n, r, i = null) {
2129
+ function fn(e, t, n, r, i = null) {
2116
2130
  return {
2117
2131
  activeSeriesId: i ?? void 0,
2118
2132
  row: t.datum,
@@ -2135,11 +2149,11 @@ function ln(e, t, n, r, i = null) {
2135
2149
  }
2136
2150
  //#endregion
2137
2151
  //#region src/primitives/bar-shape.tsx
2138
- var un = 4, dn = 6, fn = 2.5;
2139
- function pn(e, t) {
2152
+ var pn = 4, mn = 6, hn = 2.5;
2153
+ function gn(e, t) {
2140
2154
  let n = e.y, r = e.y + e.height, i = [], a = r <= t + .5, o = a ? t - r : n - t, s = a ? t - n : r - t;
2141
- for (let n = Math.max(0, Math.floor(o / dn)); n * dn < s; n += 1) {
2142
- let r = n * dn, c = r + un, l = Math.max(r, o), u = Math.min(c, s);
2155
+ for (let n = Math.max(0, Math.floor(o / mn)); n * mn < s; n += 1) {
2156
+ let r = n * mn, c = r + pn, l = Math.max(r, o), u = Math.min(c, s);
2143
2157
  u - l < .5 || i.push({
2144
2158
  x: e.x,
2145
2159
  width: e.width,
@@ -2149,7 +2163,7 @@ function pn(e, t) {
2149
2163
  }
2150
2164
  return i;
2151
2165
  }
2152
- function mn(e, t, n) {
2166
+ function _n(e, t, n) {
2153
2167
  let r = n ?? e.baseline, i = e.height * t, a = r + (e.y - r) * t;
2154
2168
  return {
2155
2169
  x: e.x,
@@ -2158,15 +2172,15 @@ function mn(e, t, n) {
2158
2172
  height: i
2159
2173
  };
2160
2174
  }
2161
- function hn({ bar: e, appearance: t = "solid", mark: n, fill: r, color: i, baseline: a, expanded: o = !1, id: s, fillOpacity: c = 1, stroke: l, strokeWidth: u, className: d = "lilt-chart__bar-mark", dataAttributes: f, opacity: p }) {
2175
+ function vn({ bar: e, appearance: t = "solid", mark: n, fill: r, color: i, baseline: a, expanded: o = !1, id: s, fillOpacity: c = 1, stroke: l, strokeWidth: u, className: d = "lilt-chart__bar-mark", dataAttributes: f, opacity: p }) {
2162
2176
  if (t === "segmented" || t === "needle") {
2163
- let i = mn(e, n.progress ?? 1, n.originY), s = t === "needle" && !o ? Math.min(fn, i.width) : i.width, l = i.x + (i.width - s) / 2, u = Math.min(1.5, s / 2);
2177
+ let i = _n(e, n.progress ?? 1, n.originY), s = t === "needle" && !o ? Math.min(hn, i.width) : i.width, l = i.x + (i.width - s) / 2, u = Math.min(1.5, s / 2);
2164
2178
  return /* @__PURE__ */ A("g", {
2165
2179
  className: d,
2166
2180
  "data-appearance": t,
2167
2181
  opacity: p,
2168
2182
  ...f,
2169
- children: pn({
2183
+ children: gn({
2170
2184
  ...i,
2171
2185
  x: l,
2172
2186
  width: s
@@ -2248,27 +2262,27 @@ function hn({ bar: e, appearance: t = "solid", mark: n, fill: r, color: i, basel
2248
2262
  }
2249
2263
  //#endregion
2250
2264
  //#region src/interaction/inspection-layer.tsx
2251
- var gn = {
2265
+ var yn = {
2252
2266
  stiffness: 360,
2253
2267
  damping: 38,
2254
2268
  mass: 1
2255
- }, _n = {
2269
+ }, bn = {
2256
2270
  stiffness: 220,
2257
2271
  damping: 30,
2258
2272
  mass: 1
2259
- }, vn = {
2273
+ }, xn = {
2260
2274
  stiffness: 120,
2261
2275
  damping: 22,
2262
2276
  mass: 1
2263
- }, yn = {
2277
+ }, J = {
2264
2278
  stiffness: 420,
2265
2279
  damping: 42,
2266
2280
  mass: 1
2267
- }, bn = 24;
2268
- function xn(e, t, n) {
2281
+ }, Sn = 24;
2282
+ function Cn(e, t, n) {
2269
2283
  return Math.min(n, Math.max(t, e));
2270
2284
  }
2271
- function J({ descriptor: e, color: t, geometry: n, cursorX: r, bottom: i, halo: a }) {
2285
+ function wn({ descriptor: e, color: t, geometry: n, cursorX: r, bottom: i, halo: a }) {
2272
2286
  let o = P(r, (e) => St(n, e)), s = P(o, (e) => e?.y ?? i), c = P(o, (e) => +!!e), l = t ?? e.color ?? "var(--lilt-series-1)", u = e.line?.pointRadius ?? 3.5;
2273
2287
  return /* @__PURE__ */ j(k, { children: [a && u > 0 ? /* @__PURE__ */ A(N.circle, {
2274
2288
  className: "lilt-chart__inspection-halo",
@@ -2295,7 +2309,7 @@ function J({ descriptor: e, color: t, geometry: n, cursorX: r, bottom: i, halo:
2295
2309
  }
2296
2310
  })] });
2297
2311
  }
2298
- function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintId: i, renderContent: a, inspectionSeries: o, stackedPill: s = "series", pinIcon: c, tooltipClassName: l, tooltipAriaLabel: u, width: d, height: f, reducedMotion: p, highlightMaskId: m, crossGradientId: h, compactPlot: g = !1, inlineOnly: _ = !1, hideAxisBadges: v = !1, peer: y = !1, onCompareFromHere: b, marks: x = [] }) {
2312
+ function Tn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintId: i, renderContent: a, inspectionSeries: o, stackedPill: s = "series", pinIcon: c, tooltipClassName: l, tooltipAriaLabel: u, width: d, height: f, reducedMotion: p, highlightMaskId: m, crossGradientId: h, compactPlot: g = !1, inlineOnly: _ = !1, hideAxisBadges: v = !1, peer: y = !1, onCompareFromHere: b, marks: x = [] }) {
2299
2313
  let S = E(() => n.filter((t) => e.stack?.series.includes(t.id)), [n, e.stack]), ee = S.length > 0, w = E(() => ee && (s === "total" || !o) ? S.at(-1) : n.find((e) => e.id === o) ?? (ee ? S.at(-1) : n[0]), [
2300
2314
  o,
2301
2315
  n,
@@ -2318,7 +2332,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2318
2332
  color: o
2319
2333
  });
2320
2334
  return s ? [/* @__PURE__ */ A("g", { children: s }, `${t.series}-${i}`)] : [];
2321
- }) : [], me = t ? e.xToPixel(t.x) : e.plot.left, [he, ge] = cn(me, gn), [_e, ve] = cn(me, _n), [ye, be] = cn(me, vn), [xe, Se] = cn(16, yn), Ce = D(16), we = D(!1), Te = D(null), [Ee, De] = O(a ? 236 : 188);
2335
+ }) : [], me = t ? e.xToPixel(t.x) : e.plot.left, [he, ge] = dn(me, yn), [_e, ve] = dn(me, bn), [ye, be] = dn(me, xn), [xe, Se] = dn(16, J), Ce = D(16), we = D(!1), Te = D(null), [Ee, De] = O(a ? 236 : 188);
2322
2336
  T(() => {
2323
2337
  let e = Te.current;
2324
2338
  if (!e) return;
@@ -2353,7 +2367,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2353
2367
  if (n) return n.negative ? n.y + n.height : n.y;
2354
2368
  }
2355
2369
  return (te ? St(te, n) : null)?.y ?? e.plot.bottom;
2356
- }), ke = P(he, (e) => te && St(te, e) ? 1 : 0), Ae = it(), je = Ae.axis.y !== "classic" && Ae.axis.y !== "segmented", Me = D(null), Ne = D(null), Pe = ie(48), Fe = P([he, Pe], ([t, n]) => xn(Number(t) - Number(n) / 2, e.plot.left + (Ae.inset > 0 ? 4 : -Ae.overhang), e.plot.right - (Ae.inset > 0 ? 4 : -Ae.overhang) - Number(n))), Ie = P([Fe, Pe], ([e, t]) => Number(e) + Number(t) / 2), Le = P(Oe, (t) => xn(t, e.plot.top, e.plot.bottom)), ze = P(Le, (t) => je ? t - bn - 3 : xn(t, e.plot.top + bn / 2, e.plot.bottom) - bn / 2), Be = Ae.pillPosition === "mark", Ve = k && t && w ? e.geometry?.bars[w.id]?.find((e) => e.valueX === t.x) : void 0, [He, Ue] = cn(0, gn), Ge = Ve && t ? Ve.x + Ve.width / 2 - e.xToPixel(t.x) : 0;
2370
+ }), ke = P(he, (e) => te && St(te, e) ? 1 : 0), Ae = it(), je = Ae.axis.y !== "classic" && Ae.axis.y !== "segmented", Me = D(null), Ne = D(null), Pe = ie(48), Fe = P([he, Pe], ([t, n]) => Cn(Number(t) - Number(n) / 2, e.plot.left + (Ae.inset > 0 ? 4 : -Ae.overhang), e.plot.right - (Ae.inset > 0 ? 4 : -Ae.overhang) - Number(n))), Ie = P([Fe, Pe], ([e, t]) => Number(e) + Number(t) / 2), Le = P(Oe, (t) => Cn(t, e.plot.top, e.plot.bottom)), ze = P(Le, (t) => je ? t - Sn - 3 : Cn(t, e.plot.top + Sn / 2, e.plot.bottom) - Sn / 2), Be = Ae.pillPosition === "mark", Ve = k && t && w ? e.geometry?.bars[w.id]?.find((e) => e.valueX === t.x) : void 0, [He, Ue] = dn(0, yn), Ge = Ve && t ? Ve.x + Ve.width / 2 - e.xToPixel(t.x) : 0;
2357
2371
  T(() => {
2358
2372
  Ue(Ge, !we.current || p);
2359
2373
  }, [
@@ -2365,11 +2379,11 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2365
2379
  he,
2366
2380
  He,
2367
2381
  Ke
2368
- ], ([t, n, r]) => xn(Number(t) + Number(n) - Number(r) / 2, e.plot.left + 4, e.plot.right - 4 - Number(r))), qe = Ve ? 8 : 14, B = !!Ve?.negative, V = ue.filter((e) => !e.bar.negative), Je = re && Ve && t ? pe.flatMap((n) => {
2382
+ ], ([t, n, r]) => Cn(Number(t) + Number(n) - Number(r) / 2, e.plot.left + 4, e.plot.right - 4 - Number(r))), qe = Ve ? 8 : 14, B = !!Ve?.negative, V = ue.filter((e) => !e.bar.negative), Je = re && Ve && t ? pe.flatMap((n) => {
2369
2383
  let r = e.geometry?.series[n.id], i = r ? St(r, e.xToPixel(t.x)) : null;
2370
2384
  return i ? [i.y - 6] : [];
2371
2385
  }) : [], H = re && Ve && V.length ? Math.min(...V.map((e) => e.bar.y), ...Je) : null, U = P(Oe, (e) => {
2372
- let t = H !== null && !B ? H : e, n = t - bn - qe;
2386
+ let t = H !== null && !B ? H : e, n = t - Sn - qe;
2373
2387
  return B || n < -4 ? t + qe : n;
2374
2388
  }), Ye = !g && !y && !v;
2375
2389
  ae(Ie, "change", (e) => Ae.x.set(e)), ae(he, "change", (e) => Ae.pointerX.set(e)), ae(Le, "change", (e) => Ae.y.set(e)), T(() => {
@@ -2390,7 +2404,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2390
2404
  p,
2391
2405
  Ye
2392
2406
  ]);
2393
- let Xe = P([ye, xe], ([e, t]) => xn(Number(e) + Number(t), 8, Math.max(8, d - Ee - 8))), Ze = t?.pinned ? Math.min(80, Math.max(8, f - 72)) : Math.max(-48, e.plot.top - 64), Qe = P(_e, (t) => xn(t - 58, e.plot.left, e.plot.right - 116)), $e = +!!t, et = t ? e.formatX(t.x) : "", nt = w ? r[w.id] ?? R(w, n.indexOf(w)) : "var(--lilt-series-1)";
2407
+ let Xe = P([ye, xe], ([e, t]) => Cn(Number(e) + Number(t), 8, Math.max(8, d - Ee - 8))), Ze = t?.pinned ? Math.min(80, Math.max(8, f - 72)) : Math.max(-48, e.plot.top - 64), Qe = P(_e, (t) => Cn(t - 58, e.plot.left, e.plot.right - 116)), $e = +!!t, et = t ? e.formatX(t.x) : "", nt = w ? r[w.id] ?? R(w, n.indexOf(w)) : "var(--lilt-series-1)";
2394
2408
  T(() => {
2395
2409
  let e = Me.current?.offsetWidth;
2396
2410
  e && Pe.set(e);
@@ -2510,7 +2524,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2510
2524
  clipPath: `url(#${m}-plot)`,
2511
2525
  children: ue.map(({ descriptor: t, bar: a }) => {
2512
2526
  let o = (F ? t.colorAt?.(F.datum) : void 0) ?? r[t.id] ?? R(t, n.indexOf(t)), s = Re(o, void 0, I?.[t.id] === "provisional" ? "hatch" : I?.[t.id] === "forecast" ? "dots" : t.bar?.treatment ?? "solid", i?.(t.id, I?.[t.id] === "provisional" || t.bar?.treatment === "hatch" ? "hatch" : "dots") ?? "");
2513
- return /* @__PURE__ */ A(hn, {
2527
+ return /* @__PURE__ */ A(vn, {
2514
2528
  id: `${m}-bar-${n.indexOf(t)}`,
2515
2529
  bar: a,
2516
2530
  appearance: t.bar?.appearance,
@@ -2584,7 +2598,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2584
2598
  }) : null,
2585
2599
  pe.map((t) => {
2586
2600
  let n = e.geometry?.series[t.id];
2587
- return n && t.line?.showInspectionPoint !== !1 ? /* @__PURE__ */ A(J, {
2601
+ return n && t.line?.showInspectionPoint !== !1 ? /* @__PURE__ */ A(wn, {
2588
2602
  descriptor: t,
2589
2603
  color: r[t.id],
2590
2604
  geometry: n,
@@ -2603,7 +2617,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2603
2617
  ref: Me,
2604
2618
  style: {
2605
2619
  left: Fe,
2606
- top: e.plot.bottom + 22 - bn / 2,
2620
+ top: e.plot.bottom + 22 - Sn / 2,
2607
2621
  "--lilt-pill-accent": nt
2608
2622
  },
2609
2623
  transition: { duration: p ? 0 : .12 },
@@ -2773,7 +2787,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2773
2787
  }) : null,
2774
2788
  F && t && a ? /* @__PURE__ */ A("div", {
2775
2789
  className: "lilt-chart__tooltip-custom",
2776
- children: a(ln(e, F, n, t.pinned))
2790
+ children: a(fn(e, F, n, t.pinned))
2777
2791
  }) : null,
2778
2792
  ee && F ? /* @__PURE__ */ j("div", {
2779
2793
  className: "lilt-chart__tooltip-total",
@@ -2797,7 +2811,7 @@ function Sn({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
2797
2811
  }
2798
2812
  //#endregion
2799
2813
  //#region src/interaction/comparison-layer.tsx
2800
- function Cn(e, t, n, r) {
2814
+ function En(e, t, n, r) {
2801
2815
  if (r === null) return null;
2802
2816
  let i = e.geometry, a = e.xToPixel(n), o = i?.series[t];
2803
2817
  for (let e of o?.isolated ?? []) if (Math.abs(e.x - a) < .5) return e.y;
@@ -2809,7 +2823,7 @@ function Cn(e, t, n, r) {
2809
2823
  let s = i?.bars[t]?.find((e) => e.valueX === n);
2810
2824
  return s ? s.negative ? s.y + s.height : s.y : e.stack?.series.includes(t) ? null : e.yToPixel(r);
2811
2825
  }
2812
- function wn({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointPointerDown: i, onEndpointPointerMove: a, onEndpointPointerUp: o, onEndpointCancel: s, onEndpointCommit: c, onEndpointKeyDown: l, preview: u = !1 }) {
2826
+ function Dn({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointPointerDown: i, onEndpointPointerMove: a, onEndpointPointerUp: o, onEndpointCancel: s, onEndpointCommit: c, onEndpointKeyDown: l, preview: u = !1 }) {
2813
2827
  let d = e.xToPixel(t.startX), f = e.xToPixel(t.endX), p = Math.min(d, f), m = Math.max(d, f), h = e.formatX(t.startX), g = e.formatX(t.endX), _ = r ? 0 : .14, v = w();
2814
2828
  return /* @__PURE__ */ j("div", {
2815
2829
  "aria-label": "Comparison endpoints",
@@ -2854,7 +2868,7 @@ function wn({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointP
2854
2868
  y1: e.plot.top,
2855
2869
  y2: e.plot.bottom
2856
2870
  }), n.map((t) => {
2857
- let n = i === 0 ? t.startValue : t.endValue, o = Cn(e, t.id, a, n);
2871
+ let n = i === 0 ? t.startValue : t.endValue, o = En(e, t.id, a, n);
2858
2872
  return o === null ? null : /* @__PURE__ */ A("circle", {
2859
2873
  "data-comparison-series": t.id,
2860
2874
  className: "lilt-chart__comparison-dot",
@@ -2905,27 +2919,33 @@ function wn({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointP
2905
2919
  }
2906
2920
  //#endregion
2907
2921
  //#region src/interaction/tooltip-view.tsx
2908
- var Tn = b(null);
2909
- function En({ value: e, children: t }) {
2910
- return /* @__PURE__ */ A(Tn.Provider, {
2922
+ var On = b(null);
2923
+ function kn({ value: e, children: t }) {
2924
+ return /* @__PURE__ */ A(On.Provider, {
2911
2925
  value: e,
2912
2926
  children: t
2913
2927
  });
2914
2928
  }
2915
- function Dn() {
2916
- let e = ee(Tn);
2929
+ function An() {
2930
+ let e = ee(On);
2917
2931
  if (!e) throw Error("Lilt Tooltip must be supplied through ChartPlot.tooltip.");
2918
2932
  return e;
2919
2933
  }
2920
2934
  //#endregion
2921
2935
  //#region src/interaction/pin-marker.tsx
2922
- function On({ left: e, top: t, reducedMotion: n, ghost: r = !1, from: i, local: a = !1, onRelease: o }) {
2936
+ function jn({ left: e, top: t, reducedMotion: n, ghost: r = !1, from: i, local: a = !1, onRelease: o }) {
2923
2937
  let s = n ? { opacity: 0 } : {
2924
2938
  opacity: 0,
2925
2939
  scale: .6,
2926
2940
  y: 4,
2927
2941
  filter: "blur(6px)"
2928
- }, c = r ? `Pinned from ${i ?? "a linked chart"}. Click to release.` : a ? "Release pin on this chart" : "Release pin. Alt-click a chart to pin just that one.";
2942
+ }, [c, l] = dn(e, yn);
2943
+ T(() => l(e, n), [
2944
+ l,
2945
+ e,
2946
+ n
2947
+ ]);
2948
+ let u = r ? `Pinned from ${i ?? "a linked chart"}. Click to release.` : a ? "Release pin on this chart" : "Release pin. Alt-click a chart to pin just that one.";
2929
2949
  return /* @__PURE__ */ A(N.button, {
2930
2950
  type: "button",
2931
2951
  className: "lilt-chart__pin",
@@ -2934,29 +2954,24 @@ function On({ left: e, top: t, reducedMotion: n, ghost: r = !1, from: i, local:
2934
2954
  "aria-label": r ? void 0 : "Release pinned point",
2935
2955
  "aria-hidden": r || void 0,
2936
2956
  tabIndex: r ? -1 : void 0,
2937
- title: c,
2938
- style: { top: t },
2939
- initial: {
2940
- ...s,
2941
- left: e
2957
+ title: u,
2958
+ style: {
2959
+ top: t,
2960
+ left: c
2942
2961
  },
2962
+ initial: s,
2943
2963
  animate: {
2944
2964
  opacity: 1,
2945
2965
  scale: 1,
2946
2966
  y: 0,
2947
- filter: "blur(0px)",
2948
- left: e
2967
+ filter: "blur(0px)"
2949
2968
  },
2950
2969
  exit: s,
2951
2970
  transition: n ? { duration: 0 } : {
2952
2971
  type: "spring",
2953
2972
  stiffness: 460,
2954
2973
  damping: 30,
2955
- mass: .7,
2956
- left: {
2957
- type: "spring",
2958
- ...gn
2959
- }
2974
+ mass: .7
2960
2975
  },
2961
2976
  onClick: o,
2962
2977
  children: /* @__PURE__ */ A(_, { release: !0 })
@@ -2964,7 +2979,7 @@ function On({ left: e, top: t, reducedMotion: n, ghost: r = !1, from: i, local:
2964
2979
  }
2965
2980
  //#endregion
2966
2981
  //#region src/engine/lookup.ts
2967
- function kn(e, t, n, r) {
2982
+ function Mn(e, t, n, r) {
2968
2983
  let i = 0, a = e.length;
2969
2984
  for (; i < a;) {
2970
2985
  let n = i + a >>> 1;
@@ -2986,13 +3001,13 @@ function kn(e, t, n, r) {
2986
3001
  }
2987
3002
  //#endregion
2988
3003
  //#region src/interaction/visibility.ts
2989
- function An(e, t) {
3004
+ function Nn(e, t) {
2990
3005
  return e.length === t.length && e.every((e) => t.includes(e));
2991
3006
  }
2992
- function jn(e, t, n) {
3007
+ function Pn(e, t, n) {
2993
3008
  if (!e || !n.includes(e.id)) return null;
2994
- let r = e.expected.filter((e) => n.includes(e)), i = e.previous.filter((e) => n.includes(e)), a = An(t, r);
2995
- return !a && !An(t, i) ? null : {
3009
+ let r = e.expected.filter((e) => n.includes(e)), i = e.previous.filter((e) => n.includes(e)), a = Nn(t, r);
3010
+ return !a && !Nn(t, i) ? null : {
2996
3011
  ...e,
2997
3012
  restore: e.restore.filter((e) => n.includes(e)),
2998
3013
  expected: r,
@@ -3001,9 +3016,9 @@ function jn(e, t, n) {
3001
3016
  }
3002
3017
  //#endregion
3003
3018
  //#region src/interaction/chart-sync.ts
3004
- var Mn = /* @__PURE__ */ new Map();
3005
- function Nn(e) {
3006
- let t = Mn.get(e);
3019
+ var Fn = /* @__PURE__ */ new Map();
3020
+ function Y(e) {
3021
+ let t = Fn.get(e);
3007
3022
  if (t) return t;
3008
3023
  let n = null, r = 0, i = /* @__PURE__ */ new Set();
3009
3024
  return t = {
@@ -3018,18 +3033,18 @@ function Nn(e) {
3018
3033
  subscribe(e) {
3019
3034
  return i.add(e), () => i.delete(e);
3020
3035
  }
3021
- }, Mn.set(e, t), t;
3036
+ }, Fn.set(e, t), t;
3022
3037
  }
3023
- var Pn = "sync", Fn = () => () => void 0, In = () => null;
3024
- function Y(e) {
3025
- let t = e ? Nn(e) : null, n = te(t?.subscribe ?? Fn, t?.get ?? In, t?.get ?? In);
3038
+ var In = "sync", Ln = () => () => void 0, Rn = () => null;
3039
+ function zn(e) {
3040
+ let t = e ? Y(e) : null, n = te(t?.subscribe ?? Ln, t?.get ?? Rn, t?.get ?? Rn);
3026
3041
  return n ? {
3027
3042
  value: n.kind === "time" ? new Date(n.key) : n.key,
3028
3043
  kind: n.kind,
3029
3044
  pinned: n.pinned
3030
3045
  } : null;
3031
3046
  }
3032
- function Ln(e, t, n, r) {
3047
+ function Bn(e, t, n, r) {
3033
3048
  if (e.kind !== t) return null;
3034
3049
  if (t === "category") {
3035
3050
  let t = n.indexOf(String(e.key));
@@ -3044,12 +3059,12 @@ function Ln(e, t, n, r) {
3044
3059
  let o = [...r].sort((e, t) => e - t), s = o.slice(1).map((e, t) => e - o[t]).filter((e) => e > 0).sort((e, t) => e - t), c = s.length ? s[Math.floor(s.length / 2)] : 0;
3045
3060
  return Math.abs(r[a] - i) <= c / 2 ? r[a] : null;
3046
3061
  }
3047
- function Rn(e, t, n, r, i, { label: a, release: o } = {}) {
3062
+ function Vn(e, t, n, r, i, { label: a, release: o } = {}) {
3048
3063
  let s = w(), c = D(o);
3049
3064
  c.current = o, C(() => {
3050
3065
  if (!e) return;
3051
- let o = Nn(e), l = n.map((e) => String(e[r] ?? "")), u = n.map(i.position), d = (e) => i.kind === "category" ? l[e] ?? null : e, f = o.releases(), p = !1, m = !1, h = () => {
3052
- t.getSnapshot().inspection?.ownerId === "sync" && (m = !0, t.clearInspection(Pn), m = !1);
3066
+ let o = Y(e), l = n.map((e) => String(e[r] ?? "")), u = n.map(i.position), d = (e) => i.kind === "category" ? l[e] ?? null : e, f = o.releases(), p = !1, m = !1, h = () => {
3067
+ t.getSnapshot().inspection?.ownerId === "sync" && (m = !0, t.clearInspection(In), m = !1);
3053
3068
  }, g = () => {
3054
3069
  let e = t.getSnapshot().inspection;
3055
3070
  if (o.releases() !== f && (f = o.releases(), e?.pinned && !e.local && e.ownerId !== "sync")) {
@@ -3058,7 +3073,7 @@ function Rn(e, t, n, r, i, { label: a, release: o } = {}) {
3058
3073
  }
3059
3074
  let n = o.get();
3060
3075
  if (n?.source === s || e?.pinned && e.ownerId !== "sync" && (e.local || !n?.pinned)) return;
3061
- let r = n ? Ln(n, i.kind, l, u) : null;
3076
+ let r = n ? Bn(n, i.kind, l, u) : null;
3062
3077
  if (!n || r === null) {
3063
3078
  h();
3064
3079
  return;
@@ -3066,7 +3081,7 @@ function Rn(e, t, n, r, i, { label: a, release: o } = {}) {
3066
3081
  t.inspect({
3067
3082
  x: r,
3068
3083
  pinned: n.pinned,
3069
- ownerId: Pn,
3084
+ ownerId: In,
3070
3085
  ...n.pinned && n.label ? { from: n.label } : {}
3071
3086
  });
3072
3087
  }, _ = t.subscribe(() => {
@@ -3104,29 +3119,29 @@ function Rn(e, t, n, r, i, { label: a, release: o } = {}) {
3104
3119
  }
3105
3120
  //#endregion
3106
3121
  //#region src/chart.tsx
3107
- var zn = 14, Bn = {}, Vn = [], Hn = {
3122
+ var Hn = 14, Un = {}, Wn = [], Gn = {
3108
3123
  inspection: null,
3109
3124
  comparison: null,
3110
3125
  focus: null
3111
- }, Un = () => () => void 0, Wn = () => Hn;
3112
- function Gn(e) {
3126
+ }, Kn = () => () => void 0, qn = () => Gn;
3127
+ function Jn(e) {
3113
3128
  return {
3114
3129
  ...Ft,
3115
3130
  ...e
3116
3131
  };
3117
3132
  }
3118
- function Kn(e, t) {
3133
+ function Yn(e, t) {
3119
3134
  let n = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
3120
3135
  for (let r of n) if ((e?.[r] ?? null) !== (t?.[r] ?? null)) return !1;
3121
3136
  return !0;
3122
3137
  }
3123
- function qn(e, t) {
3138
+ function Xn(e, t) {
3124
3139
  return !e || !t || e.rows.length !== t.rows.length || e.series.length !== t.series.length || e.series.some((e, n) => e.id !== t.series[n]?.id) ? !1 : e.rows.every((n, r) => {
3125
3140
  let i = t.rows[r];
3126
- return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] && Kn(n.fields[e.id], i.fields[e.id])));
3141
+ return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] && Yn(n.fields[e.id], i.fields[e.id])));
3127
3142
  });
3128
3143
  }
3129
- function Jn(e, t, n) {
3144
+ function Zn(e, t, n) {
3130
3145
  return n >= 1 ? t : {
3131
3146
  ...t,
3132
3147
  rows: t.rows.map((r, i) => {
@@ -3141,10 +3156,10 @@ function Jn(e, t, n) {
3141
3156
  })
3142
3157
  };
3143
3158
  }
3144
- function Yn(e) {
3159
+ function Qn(e) {
3145
3160
  return 1 - (1 - e) ** 4;
3146
3161
  }
3147
- function Xn(e, t, n = !1) {
3162
+ function $n(e, t, n = !1) {
3148
3163
  let [r, i] = O({
3149
3164
  width: 0,
3150
3165
  height: t
@@ -3171,7 +3186,7 @@ function Xn(e, t, n = !1) {
3171
3186
  e
3172
3187
  ]), r;
3173
3188
  }
3174
- function Zn(e, t, n, r) {
3189
+ function er(e, t, n, r) {
3175
3190
  return E(() => {
3176
3191
  try {
3177
3192
  let i = Me(e, t, n);
@@ -3192,7 +3207,7 @@ function Zn(e, t, n, r) {
3192
3207
  r
3193
3208
  ]);
3194
3209
  }
3195
- function Qn(e, t, n, r, i, a, o, s, c, l = It, u, d = {}, f = 0) {
3210
+ function tr(e, t, n, r, i, a, o, s, c, l = It, u, d = {}, f = 0) {
3196
3211
  if (!e || e.rows.length === 0 || !Ne(e)) return null;
3197
3212
  try {
3198
3213
  return qt(e, t, n, r, i, a.width, a.height, o, s, c, l, u, d, f);
@@ -3200,7 +3215,7 @@ function Qn(e, t, n, r, i, a, o, s, c, l = It, u, d = {}, f = 0) {
3200
3215
  return null;
3201
3216
  }
3202
3217
  }
3203
- function $n(e, t, n) {
3218
+ function nr(e, t, n) {
3204
3219
  return {
3205
3220
  snapshot: e,
3206
3221
  previousSnapshot: t,
@@ -3224,17 +3239,17 @@ function $n(e, t, n) {
3224
3239
  visibleSeries: n.visibleSeries
3225
3240
  };
3226
3241
  }
3227
- function er(e) {
3242
+ function rr(e) {
3228
3243
  return e.replace(/[^a-zA-Z0-9_-]/g, "-");
3229
3244
  }
3230
- function tr(e, t, n) {
3245
+ function ir(e, t, n) {
3231
3246
  let r = e.accessor(t);
3232
3247
  return r === null ? "No data" : e.formatValue?.(r) ?? n(r);
3233
3248
  }
3234
- function nr(e, t) {
3249
+ function ar(e, t) {
3235
3250
  return e.data.rows.findIndex((e) => e.sourceIndex === t);
3236
3251
  }
3237
- function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeight: o, margins: s, arrangement: c = It, marks: l = Vn, barLayout: u, compact: d = !1, tooltipNode: f, inspectionSeries: p, className: m, style: h, "aria-label": g, children: _, status: v = "ready", interactive: y = !0, error: b, renderRetry: x, motion: ee = "auto", animateIn: ne = !0, resetKey: re, onSelectionChange: ae, controller: P, linkedSelection: oe = "exact", selectedCategoryId: se, onSelectedCategoryIdChange: F, compare: I = !1, focus: ce = !1, live: le = !1, brush: ue = !1, visibleSeries: de, onVisibleSeriesChange: fe, toolkit: pe, model: L, controllerLinked: me = !1, axis: he = "minimal", pill: ge = "soft", pillSeries: _e = "nearest", pillValue: ve = "series", pillPosition: ye = "auto", axisInset: be = 0, runoff: xe = !1, labelOverhang: Se = 0 }) {
3252
+ function or({ data: e, x: n, y: r = Un, series: i, height: a = 340, compactHeight: o, margins: s, arrangement: c = It, marks: l = Wn, barLayout: u, compact: d = !1, tooltipNode: f, inspectionSeries: p, className: m, style: h, "aria-label": g, children: _, status: v = "ready", interactive: y = !0, error: b, renderRetry: x, motion: ee = "auto", animateIn: ne = !0, resetKey: re, onSelectionChange: ae, controller: P, linkedSelection: oe = "exact", selectedCategoryId: se, onSelectedCategoryIdChange: F, compare: I = !1, focus: ce = !1, live: le = !1, brush: ue = !1, visibleSeries: de, onVisibleSeriesChange: fe, toolkit: pe, model: L, controllerLinked: me = !1, axis: he = "minimal", pill: ge = "soft", pillSeries: _e = "nearest", pillValue: ve = "series", pillPosition: ye = "auto", axisInset: be = 0, runoff: xe = !1, labelOverhang: Se = 0 }) {
3238
3253
  let Ce = ge || "soft", we = JSON.stringify(he), Te = E(() => ot(he), [we]), Ee = ie(0), De = ie(0), Oe = ie(0), ke = ie(0), Ae = E(() => ({
3239
3254
  x: Ee,
3240
3255
  pointerX: De,
@@ -3257,7 +3272,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3257
3272
  Ce,
3258
3273
  De,
3259
3274
  xe
3260
- ]), je = D(null), Me = D(null), Fe = D(null), Re = E(() => Gn(s), [s]), Ve = E(() => ({
3275
+ ]), je = D(null), Me = D(null), Fe = D(null), Re = E(() => Jn(s), [s]), Ve = E(() => ({
3261
3276
  width: u?.width,
3262
3277
  gap: u?.gap,
3263
3278
  segmentGap: u?.segmentGap
@@ -3265,7 +3280,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3265
3280
  u?.width,
3266
3281
  u?.gap,
3267
3282
  u?.segmentGap
3268
- ]), He = a === "fill", Ue = a === "fill" ? 340 : a, We = Xn(je, Ue, He), Ge = We.width > 0 && We.width < 420, Ke = We.width > 0 && We.width < 240, z = E(() => ({
3283
+ ]), He = a === "fill", Ue = a === "fill" ? 340 : a, We = $n(je, Ue, He), Ge = We.width > 0 && We.width < 420, Ke = We.width > 0 && We.width < 240, z = E(() => ({
3269
3284
  width: We.width,
3270
3285
  height: He ? We.height : Ge && o ? o : Ue
3271
3286
  }), [
@@ -3289,7 +3304,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3289
3304
  ...Re,
3290
3305
  left: Ge ? Math.min(65, Re.left) : Re.left,
3291
3306
  right: Ge ? Math.min(44, Re.right) : Re.right
3292
- }), [Re, Ge]), V = t(ee), Je = Zn(e, i, n, c.stack), H = Je.value, U = H !== null && H.rows.length > 0 && Ne(H), Ze = er(w()), Qe = `${Ze}-reveal`, $e = `${Ze}-grid-fade`, et = S((e, t) => {
3307
+ }), [Re, Ge]), V = t(ee), Je = er(e, i, n, c.stack), H = Je.value, U = H !== null && H.rows.length > 0 && Ne(H), Ze = rr(w()), Qe = `${Ze}-reveal`, $e = `${Ze}-grid-fade`, et = S((e, t) => {
3293
3308
  let n = i.findIndex((t) => t.id === e);
3294
3309
  return Le(Ze, n, t);
3295
3310
  }, [Ze, i]), tt = `${Ze}-highlight-mask`, nt = `${Ze}-cross-fade`, it = D(Zt()), at = D(-Infinity), ct = v === "ready" && U, lt = D(void 0);
@@ -3306,7 +3321,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3306
3321
  }, 750);
3307
3322
  }, []), Pt = D(null), Ft = D(null), Lt = `${Ze}-owner`;
3308
3323
  C(() => () => P?.releaseOwner(Lt), [Lt, P]);
3309
- let G = te(P?.subscribe ?? Un, P?.getSnapshot ?? Wn, P?.getSnapshot ?? Wn), zt = E(() => I === !0 ? {} : I || {}, [I]), Bt = E(() => ce === !0 ? {} : ce || {}, [ce]), Vt = E(() => le === !0 ? {} : le || {}, [le]), K = !!I, Ht = !!(ce || ue), Ut = !!le, [Wt, Gt] = O(() => L?.getSnapshot().visibleSeries ?? i.map((e) => e.id)), Kt = D(i.map((e) => e.id));
3324
+ let G = te(P?.subscribe ?? Kn, P?.getSnapshot ?? qn, P?.getSnapshot ?? qn), zt = E(() => I === !0 ? {} : I || {}, [I]), Bt = E(() => ce === !0 ? {} : ce || {}, [ce]), Vt = E(() => le === !0 ? {} : le || {}, [le]), K = !!I, Ht = !!(ce || ue), Ut = !!le, [Wt, Gt] = O(() => L?.getSnapshot().visibleSeries ?? i.map((e) => e.id)), Kt = D(i.map((e) => e.id));
3310
3325
  C(() => {
3311
3326
  if (de) return;
3312
3327
  let e = i.map((e) => e.id), t = Kt.current;
@@ -3318,15 +3333,15 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3318
3333
  let qt = de ?? Wt, [Yt, en] = O(null);
3319
3334
  C(() => {
3320
3335
  en((e) => {
3321
- let t = jn(e, qt, i.map((e) => e.id));
3322
- return !e || !t ? t : An(e.restore, t.restore) && An(e.expected, t.expected) && An(e.previous, t.previous) ? e : t;
3336
+ let t = Pn(e, qt, i.map((e) => e.id));
3337
+ return !e || !t ? t : Nn(e.restore, t.restore) && Nn(e.expected, t.expected) && Nn(e.previous, t.previous) ? e : t;
3323
3338
  });
3324
3339
  }, [i, qt]);
3325
- let q = E(() => i.filter((e) => qt.includes(e.id)), [i, qt]), tn = an(i.map((e) => e.id), qt, !!c.stack, V), on = c.stack ? tn : void 0, [cn, un] = O(null), dn = D(null);
3326
- dn.current = cn;
3327
- let [fn, pn] = O(null), mn = (e) => !!(e && q.some((t) => t.id === e)), hn = _e !== "nearest" && _e !== "total" ? _e : null, gn = mn(fn) ? fn : mn(hn) ? hn : _e === "nearest" && mn(cn) ? cn : p, [_n, vn] = O(null), [yn, bn] = O(null), xn = D(!1), [J, Cn] = O(null), Tn = D(J);
3328
- Tn.current = J;
3329
- let [Dn, Mn] = O(null), Nn = D(null), [Fn, In] = O(null), Y = P ? G.comparison : Fn, [Ln, Rn] = O(null), Hn = P ? G.focus : Ln, [Kn, rr] = O(!0), [ir, ar] = O(null), [or, sr] = O(null), [cr, lr] = O(!1), ur = D(null), dr = D(null), fr = D(q.map((e) => e.id).join("|"));
3340
+ let q = E(() => i.filter((e) => qt.includes(e.id)), [i, qt]), tn = an(i.map((e) => e.id), qt, !!c.stack, V), on = c.stack ? tn : void 0, [cn, ln] = O(null), un = D(null);
3341
+ un.current = cn;
3342
+ let [dn, pn] = O(null), mn = (e) => !!(e && q.some((t) => t.id === e)), hn = _e !== "nearest" && _e !== "total" ? _e : null, gn = mn(dn) ? dn : mn(hn) ? hn : _e === "nearest" && mn(cn) ? cn : p, [_n, vn] = O(null), [yn, bn] = O(null), xn = D(!1), [J, Sn] = O(null), Cn = D(J);
3343
+ Cn.current = J;
3344
+ let [wn, En] = O(null), On = D(null), [An, Fn] = O(null), Y = P ? G.comparison : An, [Ln, Rn] = O(null), zn = P ? G.focus : Ln, [Bn, Vn] = O(!0), [Gn, Yn] = O(null), [or, sr] = O(null), [cr, lr] = O(!1), ur = D(null), dr = D(null), fr = D(q.map((e) => e.id).join("|"));
3330
3345
  pt.current = dt, _t.current = W, Ct.current = bt, Et.current = ae;
3331
3346
  let pr = S((e, t, n) => {
3332
3347
  let r = it.current.next(), i = d && t === "initial" && ne && !V ? 520 : Qt(t, V, ne), a = t === "matched-update" || t === "topology-update", o = performance.now(), s = a && $t(e.rows.length * e.series.length, o - at.current) ? 0 : i;
@@ -3378,7 +3393,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3378
3393
  pr(H, Ct.current ? "handoff" : "initial", null), xt(!1);
3379
3394
  return;
3380
3395
  }
3381
- if (qn(pt.current, H)) {
3396
+ if (Xn(pt.current, H)) {
3382
3397
  pt.current !== H && (pt.current = H, ft(H));
3383
3398
  return;
3384
3399
  }
@@ -3421,15 +3436,15 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3421
3436
  V,
3422
3437
  W
3423
3438
  ]);
3424
- let X = dt ?? (v === "ready" && U ? H : null), hr = Yn(ht), gr = E(() => W?.kind === "matched-update" && W.from ? Jn(W.from, W.to, hr) : X, [
3439
+ let X = dt ?? (v === "ready" && U ? H : null), hr = Qn(ht), gr = E(() => W?.kind === "matched-update" && W.from ? Zn(W.from, W.to, hr) : X, [
3425
3440
  X,
3426
3441
  W,
3427
3442
  hr
3428
- ]), _r = E(() => Hn ? [Math.min(Hn.startX, Hn.endX), Math.max(Hn.startX, Hn.endX)] : Ut ? ir : null, [
3429
- Hn,
3430
- ir,
3443
+ ]), _r = E(() => zn ? [Math.min(zn.startX, zn.endX), Math.max(zn.startX, zn.endX)] : Ut ? Gn : null, [
3444
+ zn,
3445
+ Gn,
3431
3446
  Ut
3432
- ]), vr = E(() => Qn(W?.from ?? null, q, n, r, B, z, W?.fromDomain, _r, i, c, on, Ve, be), [
3447
+ ]), vr = E(() => tr(W?.from ?? null, q, n, r, B, z, W?.fromDomain, _r, i, c, on, Ve, be), [
3433
3448
  q,
3434
3449
  B,
3435
3450
  i,
@@ -3443,7 +3458,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3443
3458
  on,
3444
3459
  Ve,
3445
3460
  be
3446
- ]), yr = E(() => Qn(X, q, n, r, B, z, void 0, _r, i, c, on, Ve, be), [
3461
+ ]), yr = E(() => tr(X, q, n, r, B, z, void 0, _r, i, c, on, Ve, be), [
3447
3462
  X,
3448
3463
  q,
3449
3464
  n,
@@ -3459,10 +3474,10 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3459
3474
  ]), br = sn(yr?.yDomain ? {
3460
3475
  x: yr.xDomain,
3461
3476
  y: yr.yDomain
3462
- } : null, Hn ? `${Hn.startX}:${Hn.endX}` : "full", X, `${z.width}:${z.height}`, V), Z = E(() => {
3477
+ } : null, zn ? `${zn.startX}:${zn.endX}` : "full", X, `${z.width}:${z.height}`, V), Z = E(() => {
3463
3478
  if (W?.kind !== "matched-update" && !br) return yr;
3464
3479
  let e = br?.y ?? (vr?.yDomain && yr?.yDomain ? [vr.yDomain[0] + (yr.yDomain[0] - vr.yDomain[0]) * hr, vr.yDomain[1] + (yr.yDomain[1] - vr.yDomain[1]) * hr] : void 0);
3465
- return Qn(gr, q, n, r, B, z, e, br?.x ?? _r, i, c, on, Ve, be);
3480
+ return tr(gr, q, n, r, B, z, e, br?.x ?? _r, i, c, on, Ve, be);
3466
3481
  }, [
3467
3482
  q,
3468
3483
  yr,
@@ -3481,7 +3496,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3481
3496
  on,
3482
3497
  Ve,
3483
3498
  be
3484
- ]), xr = E(() => _r === null ? yr : Qn(X, q, n, r, B, z, void 0, void 0, i, c, on, Ve, be), [
3499
+ ]), xr = E(() => _r === null ? yr : tr(X, q, n, r, B, z, void 0, void 0, i, c, on, Ve, be), [
3485
3500
  q,
3486
3501
  X,
3487
3502
  yr,
@@ -3516,7 +3531,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3516
3531
  } : null;
3517
3532
  }), Q = D(Cr);
3518
3533
  Q.current = Cr;
3519
- let Tr = D(!1), Er = D(!1), $ = S(() => {
3534
+ let Tr = D(!1), Er = D(!1), Dr = S(() => {
3520
3535
  if (Tr.current = !1, L && !Er.current && n.type !== "category") {
3521
3536
  Q.current?.pinned ? L.actions.release() : L.actions.clearInspection();
3522
3537
  return;
@@ -3533,7 +3548,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3533
3548
  F,
3534
3549
  se,
3535
3550
  n.type
3536
- ]), Dr = S((e = !1) => {
3551
+ ]), Or = S((e = !1) => {
3537
3552
  Q.current && (Q.current = null, wr(null), Et.current?.(null), e || P?.clearInspection(L ? void 0 : Lt));
3538
3553
  }, [
3539
3554
  Lt,
@@ -3541,9 +3556,9 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3541
3556
  L
3542
3557
  ]);
3543
3558
  C(() => {
3544
- y || Dr(!0);
3545
- }, [y, Dr]);
3546
- let Or = S((e, t, r = !1, i = !1) => {
3559
+ y || Or(!0);
3560
+ }, [y, Or]);
3561
+ let kr = S((e, t, r = !1, i = !1) => {
3547
3562
  let a = Z, o = a?.data.rows[e];
3548
3563
  if (!y || !a || !o) return;
3549
3564
  if (t && (Tr.current = i), L && !Er.current && n.type !== "category") {
@@ -3564,11 +3579,11 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3564
3579
  pinned: t,
3565
3580
  ownerId: Lt,
3566
3581
  ...s.local ? { local: !0 } : {}
3567
- }), Ut && e < a.data.rows.length - 1 && Kn && (rr(!1), ar(a.xDomain), Vt.onFollowingChange?.(!1)));
3582
+ }), Ut && e < a.data.rows.length - 1 && Bn && (Vn(!1), Yn(a.xDomain), Vt.onFollowingChange?.(!1)));
3568
3583
  }, [
3569
3584
  Lt,
3570
3585
  P,
3571
- Kn,
3586
+ Bn,
3572
3587
  y,
3573
3588
  Vt,
3574
3589
  Ut,
@@ -3581,34 +3596,34 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3581
3596
  C(() => {
3582
3597
  if (n.type !== "category" || se === void 0 || dt !== pt.current) return;
3583
3598
  if (se === null) {
3584
- Q.current?.pinned && (y ? $() : Dr());
3599
+ Q.current?.pinned && (y ? Dr() : Or());
3585
3600
  return;
3586
3601
  }
3587
3602
  if (!Z) {
3588
- Dr(), v === "ready" && dt !== null && F?.(null);
3603
+ Or(), v === "ready" && dt !== null && F?.(null);
3589
3604
  return;
3590
3605
  }
3591
3606
  let e = Z.data.rows.findIndex((e) => e.categoryId === se);
3592
- e < 0 ? (Dr(), F?.(null)) : y && Or(e, !0, !0);
3607
+ e < 0 ? (Or(), F?.(null)) : y && kr(e, !0, !0);
3593
3608
  }, [
3594
3609
  dt,
3595
- $,
3596
- y,
3597
3610
  Dr,
3598
- F,
3611
+ y,
3599
3612
  Or,
3613
+ F,
3614
+ kr,
3600
3615
  se,
3601
3616
  v,
3602
3617
  Z,
3603
3618
  n.type
3604
3619
  ]);
3605
- let kr = S((e, t = !1) => {
3620
+ let $ = S((e, t = !1) => {
3606
3621
  let n = Z, r = Me.current;
3607
3622
  if (!n || !r || !n.data.rows.length) return null;
3608
3623
  let i = Fe.current ?? r.getBoundingClientRect();
3609
3624
  if (Fe.current = i, !i.width || !i.height) return null;
3610
3625
  let a = (e.clientX - i.left) / i.width * z.width;
3611
- return !t && (a < n.plot.left - 8 || a > n.plot.right + 8) ? null : kn(n.data.rows, n.xDomain, a, n.xToPixel);
3626
+ return !t && (a < n.plot.left - 8 || a > n.plot.right + 8) ? null : Mn(n.data.rows, n.xDomain, a, n.xToPixel);
3612
3627
  }, [z.width, Z]), Ar = S((e) => {
3613
3628
  let t = Z?.data.rows[e];
3614
3629
  if (!Z || !t) return [];
@@ -3655,13 +3670,13 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3655
3670
  Fe.current = r;
3656
3671
  let i = (t - r.left) / r.width * z.width, a = (n - r.top) / r.height * z.height, o = Ar(e);
3657
3672
  if (!o.length) return;
3658
- let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <= zn).sort((e, t) => Math.abs(e.y - a) - Math.abs(t.y - a))[0] : void 0, u = s ? l ? [l] : o.filter((e) => !e.line) : o;
3673
+ let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <= Hn).sort((e, t) => Math.abs(e.y - a) - Math.abs(t.y - a))[0] : void 0, u = s ? l ? [l] : o.filter((e) => !e.line) : o;
3659
3674
  if (!u.length) return;
3660
3675
  let d = u.map((e) => ({
3661
3676
  id: e.id,
3662
3677
  distance: Math.abs(s && !l ? e.x - i : e.y - a)
3663
- })), f = d.reduce((e, t) => t.distance < e.distance ? t : e), p = l ? void 0 : d.find((e) => e.id === dn.current), m = s ? 2 : 8;
3664
- p && p.id !== f.id && p.distance - f.distance < m || f.id !== dn.current && un(f.id);
3678
+ })), f = d.reduce((e, t) => t.distance < e.distance ? t : e), p = l ? void 0 : d.find((e) => e.id === un.current), m = s ? 2 : 8;
3679
+ p && p.id !== f.id && p.distance - f.distance < m || f.id !== un.current && ln(f.id);
3665
3680
  }, [
3666
3681
  q.length,
3667
3682
  c,
@@ -3672,39 +3687,39 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3672
3687
  ]), Mr = S((e) => {
3673
3688
  if (!(K && Y && !At.current)) {
3674
3689
  if (Q.current?.pinned && e.pointerType !== "touch") {
3675
- Z && jr(nr(Z, Q.current.sourceIndex), e.clientX, e.clientY);
3690
+ Z && jr(ar(Z, Q.current.sourceIndex), e.clientX, e.clientY);
3676
3691
  return;
3677
3692
  }
3678
3693
  Ot.current = e, Dt.current === null && (Dt.current = window.requestAnimationFrame(() => {
3679
3694
  Dt.current = null;
3680
3695
  let e = Ot.current;
3681
- if (!e || Q.current?.pinned) return;
3682
- let t = kr(e);
3683
- t !== null && (Or(t, !1), jr(t, e.clientX, e.clientY));
3696
+ if (!e || Q.current?.pinned && e.pointerType !== "touch") return;
3697
+ let t = $(e);
3698
+ t !== null && (kr(t, !1), jr(t, e.clientX, e.clientY));
3684
3699
  }));
3685
3700
  }
3686
3701
  }, [
3687
3702
  K,
3688
3703
  Y,
3704
+ $,
3689
3705
  kr,
3690
- Or,
3691
3706
  Z,
3692
3707
  jr
3693
3708
  ]), Nr = D(!1);
3694
3709
  C(() => {
3695
3710
  let e = (e) => {
3696
3711
  let t = e.target, n = je.current?.closest("[data-lilt-chart]");
3697
- Nr.current = !!n?.contains(t), !t?.closest("button, a, input, [role=\"tab\"]") && Q.current?.pinned && je.current && !je.current.contains(e.target) && $();
3712
+ Nr.current = !!n?.contains(t), !t?.closest("button, a, input, [role=\"tab\"]") && P?.getSnapshot().inspection?.ownerId !== "sync" && (t?.closest(".lilt-chart__plot-host")?.querySelector(".lilt-chart__pin[data-ghost]") || Q.current?.pinned && je.current && !je.current.contains(e.target) && Dr());
3698
3713
  };
3699
3714
  return document.addEventListener("pointerdown", e, !0), () => {
3700
3715
  document.removeEventListener("pointerdown", e, !0), Dt.current !== null && window.cancelAnimationFrame(Dt.current), Ft.current !== null && window.cancelAnimationFrame(Ft.current), Mt.current !== null && window.clearTimeout(Mt.current);
3701
3716
  };
3702
- }, [$]), C(() => {
3717
+ }, [Dr, P]), C(() => {
3703
3718
  let e = Q.current;
3704
3719
  if (!e || !Z) return;
3705
3720
  let t = Z.data.rows.findIndex((t) => e.categoryId === void 0 ? t.x === e.x : t.categoryId === e.categoryId);
3706
3721
  if (t < 0) {
3707
- Dr();
3722
+ Or();
3708
3723
  return;
3709
3724
  }
3710
3725
  let n = Z.data.rows[t];
@@ -3718,7 +3733,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3718
3733
  };
3719
3734
  Q.current = r, wr(r), Et.current?.(r);
3720
3735
  }, [
3721
- Dr,
3736
+ Or,
3722
3737
  re,
3723
3738
  Z
3724
3739
  ]), C(() => {
@@ -3780,15 +3795,15 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3780
3795
  e ? L.actions.compare(e, zt.percentage) : L.actions.clearComparison();
3781
3796
  return;
3782
3797
  }
3783
- P ? P.setComparison(e) : In(e);
3798
+ P ? P.setComparison(e) : Fn(e);
3784
3799
  }, [
3785
3800
  P,
3786
3801
  L,
3787
3802
  zt.percentage
3788
3803
  ]), Lr = S(() => {
3789
- Nn.current = null, Mn(null), bn(null);
3804
+ On.current = null, En(null), bn(null);
3790
3805
  }, []), Rr = S((e, t) => {
3791
- Y && X && (Nn.current = {
3806
+ Y && X && (On.current = {
3792
3807
  handle: e,
3793
3808
  original: Y,
3794
3809
  draft: {
@@ -3796,12 +3811,12 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3796
3811
  endX: Y.endX
3797
3812
  },
3798
3813
  pointerId: t
3799
- }, Mn(e), bn({
3814
+ }, En(e), bn({
3800
3815
  startX: Y.startX,
3801
3816
  endX: Y.endX
3802
3817
  }));
3803
3818
  }, [Y, X]), zr = S((e, t) => {
3804
- let n = Nn.current, r = X?.rows;
3819
+ let n = On.current, r = X?.rows;
3805
3820
  if (!n || n.handle !== e || !r?.length) return;
3806
3821
  let i = e === "start" ? n.draft.endX : n.draft.startX, a = r.findIndex((e) => e.x === i);
3807
3822
  if (a < 0) return;
@@ -3813,14 +3828,14 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3813
3828
  [e === "start" ? "startX" : "endX"]: l
3814
3829
  }, bn(n.draft));
3815
3830
  }, [X]), Br = S(() => {
3816
- let e = Nn.current;
3817
- e && (Nn.current = null, Mn(null), bn(null), (e.draft.startX !== e.original.startX || e.draft.endX !== e.original.endX) && Ir({
3831
+ let e = On.current;
3832
+ e && (On.current = null, En(null), bn(null), (e.draft.startX !== e.original.startX || e.draft.endX !== e.original.endX) && Ir({
3818
3833
  ...e.draft,
3819
3834
  series: e.original.series
3820
3835
  }));
3821
3836
  }, [Ir]);
3822
3837
  C(() => {
3823
- let e = Nn.current;
3838
+ let e = On.current;
3824
3839
  e && X && (!X.rows.some((t) => t.x === e.original.startX) || !X.rows.some((t) => t.x === e.original.endX)) && Lr();
3825
3840
  }, [Lr, X]);
3826
3841
  let Vr = S((e) => {
@@ -3828,10 +3843,10 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3828
3843
  Ft.current = null;
3829
3844
  let e = At.current, t = Pt.current;
3830
3845
  if (!t) return;
3831
- let n = kr(t, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
3846
+ let n = $(t, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
3832
3847
  if (r !== void 0) {
3833
- if (Tn.current) {
3834
- Cn((e) => e && e.probeX !== r ? {
3848
+ if (Cn.current) {
3849
+ Sn((e) => e && e.probeX !== r ? {
3835
3850
  ...e,
3836
3851
  probeX: r
3837
3852
  } : e);
@@ -3843,14 +3858,14 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3843
3858
  });
3844
3859
  }
3845
3860
  }));
3846
- }, [kr, Z]), Hr = S((e, t, n = !1, r = Pr) => {
3861
+ }, [$, Z]), Hr = S((e, t, n = !1, r = Pr) => {
3847
3862
  Ir({
3848
3863
  startX: n ? e : Math.min(e, t),
3849
3864
  endX: n ? t : Math.max(e, t),
3850
3865
  series: r
3851
- }), vn(null), bn(null), Cn(null), $();
3866
+ }), vn(null), bn(null), Sn(null), Dr();
3852
3867
  }, [
3853
- $,
3868
+ Dr,
3854
3869
  Pr,
3855
3870
  Ir
3856
3871
  ]), Ur = S((e) => {
@@ -3866,18 +3881,18 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3866
3881
  let Gr = S((e) => {
3867
3882
  ur.current !== null && window.clearTimeout(ur.current), ur.current = null, sr(null), lr(!1), P ? P.setFocus(e) : Rn(e), Bt.onChange?.(e);
3868
3883
  }, [P, Bt]), Kr = S(() => {
3869
- Ir(null), Hn && Gr(null), vn(null), bn(null);
3884
+ Ir(null), zn && Gr(null), vn(null), bn(null);
3870
3885
  }, [
3871
- Hn,
3886
+ zn,
3872
3887
  Ir,
3873
3888
  Gr
3874
3889
  ]), qr = S(() => {
3875
- if (Nn.current) {
3890
+ if (On.current) {
3876
3891
  Lr();
3877
3892
  return;
3878
3893
  }
3879
- if (At.current && Nt(), At.current = null, Ft.current !== null && (window.cancelAnimationFrame(Ft.current), Ft.current = null), Tn.current) {
3880
- Cn(null);
3894
+ if (At.current && Nt(), At.current = null, Ft.current !== null && (window.cancelAnimationFrame(Ft.current), Ft.current = null), Cn.current) {
3895
+ Sn(null);
3881
3896
  return;
3882
3897
  }
3883
3898
  if (yn) {
@@ -3888,7 +3903,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3888
3903
  vn(null);
3889
3904
  return;
3890
3905
  }
3891
- if (Hn) {
3906
+ if (zn) {
3892
3907
  Gr(null);
3893
3908
  return;
3894
3909
  }
@@ -3896,15 +3911,15 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3896
3911
  Kr();
3897
3912
  return;
3898
3913
  }
3899
- $();
3914
+ Dr();
3900
3915
  }, [
3901
3916
  Lr,
3902
3917
  Kr,
3903
- $,
3918
+ Dr,
3904
3919
  yn,
3905
3920
  _n,
3906
3921
  Y,
3907
- Hn,
3922
+ zn,
3908
3923
  Gr,
3909
3924
  Nt
3910
3925
  ]);
@@ -3924,13 +3939,13 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3924
3939
  }, [qr]);
3925
3940
  let Jr = S(() => {
3926
3941
  Wr(() => {
3927
- ar(null), rr(!0), $(), Vt.onFollowingChange?.(!0);
3942
+ Yn(null), Vn(!0), Dr(), Vt.onFollowingChange?.(!0);
3928
3943
  });
3929
3944
  }, [
3930
- $,
3945
+ Dr,
3931
3946
  Vt,
3932
3947
  Wr
3933
- ]), Yr = X?.rows.at(-1)?.x, Xr = ir && X ? X.rows.filter((e) => e.x > ir[1]).length : 0, Zr = S((e) => {
3948
+ ]), Yr = X?.rows.at(-1)?.x, Xr = Gn && X ? X.rows.filter((e) => e.x > Gn[1]).length : 0, Zr = S((e) => {
3934
3949
  de || Gt(e), fe?.(e);
3935
3950
  }, [fe, de]), Qr = S((e) => {
3936
3951
  en(null), Zr(e);
@@ -3960,7 +3975,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3960
3975
  ...h,
3961
3976
  "--lilt-chart-height": `${z.height || a}px`
3962
3977
  }, ii = !!(H && H.rows.length > 0 && !Ne(H)), ai = vt === "empty" || v === "ready" && !!H && (H?.rows.length === 0 || ii), oi = Je.error ?? (v === "error" ? b ?? "Could not load chart data." : null), si = mr ? null : W?.kind ?? (cr ? "matched-update" : null), ci = mr ? 0 : W?.duration ?? (cr ? 420 : 0), li = ne && !V && (si === "initial" || si === "handoff"), ui = Xt(Z?.plot.left ?? 0, Z?.plot.width ?? z.width, li ? Jt(ht * ci, 0, ci) : 1), di = vr ?? or, fi = !!((si === "topology-update" || cr) && di && Z), pi = D(/* @__PURE__ */ new Map()), mi = (e, t, a, o, s) => {
3963
- let c = !(!Cr || Fr), l = q.some((e) => e.id === fn) ? fn : null, u = li && !V ? ht : 1, d = [
3978
+ let c = !(!Cr || Fr), l = q.some((e) => e.id === dn) ? dn : null, u = li && !V ? ht : 1, d = [
3964
3979
  e,
3965
3980
  t,
3966
3981
  o,
@@ -3985,7 +4000,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
3985
4000
  _
3986
4001
  ], f = pi.current.get(a);
3987
4002
  if (f && f.inputs.length === d.length && f.inputs.every((e, t) => Object.is(e, d[t]))) return f.element;
3988
- let p = $n(e, t, {
4003
+ let p = nr(e, t, {
3989
4004
  series: i,
3990
4005
  x: n,
3991
4006
  y: r,
@@ -4016,7 +4031,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4016
4031
  inputs: d,
4017
4032
  element: m
4018
4033
  }), m;
4019
- }, hi = E(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), gi = hi?.[0], _i = hi?.at(-1), vi = gi && Z ? nr(Z, gi.sourceIndex) : 0, yi = _i && Z ? nr(Z, _i.sourceIndex) : 0, bi = Cr && Z && Cr.x >= Z.xDomain[0] && Cr.x <= Z.xDomain[1] ? Cr : null, xi = bi && Z ? nr(Z, bi.sourceIndex) : yi, Si = q.find((e) => e.id === Pr), Ci = qt.length === 0, wi = bi?.row ?? _i?.datum ?? null, Ti = bi?.x ?? _i?.x, Ei = wi && Ti !== void 0 && Z ? `${Z.formatX(Ti)} · ${q.map((e) => `${e.label} ${tr(e, wi, Z.formatValue)}`).join(" · ")}` : Ci ? "No series selected" : "No observation available", Di = G.inspection?.ownerId === Pn, Oi = !(!G.inspection || G.inspection.ownerId === Lt || L && G.inspection.ownerId === "model"), ki = (J ? {
4034
+ }, hi = E(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), gi = hi?.[0], _i = hi?.at(-1), vi = gi && Z ? ar(Z, gi.sourceIndex) : 0, yi = _i && Z ? ar(Z, _i.sourceIndex) : 0, bi = Cr && Z && Cr.x >= Z.xDomain[0] && Cr.x <= Z.xDomain[1] ? Cr : null, xi = bi && Z ? ar(Z, bi.sourceIndex) : yi, Si = q.find((e) => e.id === Pr), Ci = qt.length === 0, wi = bi?.row ?? _i?.datum ?? null, Ti = bi?.x ?? _i?.x, Ei = wi && Ti !== void 0 && Z ? `${Z.formatX(Ti)} · ${q.map((e) => `${e.label} ${ir(e, wi, Z.formatValue)}`).join(" · ")}` : Ci ? "No series selected" : "No observation available", Di = G.inspection?.ownerId === In, Oi = !(!G.inspection || G.inspection.ownerId === Lt || L && G.inspection.ownerId === "model"), ki = (J ? {
4020
4035
  startX: J.baselineX,
4021
4036
  endX: J.probeX
4022
4037
  } : yn ?? (_n !== null && Cr ? {
@@ -4038,7 +4053,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4038
4053
  q,
4039
4054
  Ni,
4040
4055
  zt.percentage
4041
- ]), Fi = ji === void 0 ? "" : Z?.formatX(ji) ?? "", Ii = Mi === void 0 ? "" : Z?.formatX(Mi) ?? "", Li = ki ? "preview" : "complete", Ri = !!Hn, zi = E(() => ji === void 0 || Mi === void 0 || Pi.length === 0 ? null : {
4056
+ ]), Fi = ji === void 0 ? "" : Z?.formatX(ji) ?? "", Ii = Mi === void 0 ? "" : Z?.formatX(Mi) ?? "", Li = ki ? "preview" : "complete", Ri = !!zn, zi = E(() => ji === void 0 || Mi === void 0 || Pi.length === 0 ? null : {
4042
4057
  kind: "range",
4043
4058
  startRow: X?.rows.find((e) => e.x === ji)?.datum ?? null,
4044
4059
  endRow: X?.rows.find((e) => e.x === Mi)?.datum ?? null,
@@ -4088,23 +4103,23 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4088
4103
  ]), Hi = () => {
4089
4104
  if (!Q.current?.pinned || !K) return;
4090
4105
  let e = Q.current.x;
4091
- Cn({
4106
+ Sn({
4092
4107
  baselineX: e,
4093
4108
  probeX: e
4094
4109
  }), vn(null), bn(null);
4095
4110
  }, Ui = (e, t) => {
4096
4111
  t.button === 0 && Y && (t.preventDefault(), t.stopPropagation(), t.currentTarget.focus(), Rr(e, t.pointerId), t.currentTarget.setPointerCapture(t.pointerId));
4097
4112
  }, Wi = (e, t) => {
4098
- if (Nn.current?.pointerId !== t.pointerId) return;
4099
- let n = kr(t.nativeEvent, !0);
4113
+ if (On.current?.pointerId !== t.pointerId) return;
4114
+ let n = $(t.nativeEvent, !0);
4100
4115
  n !== null && zr(e, n);
4101
4116
  }, Gi = (e, t) => {
4102
- if (Nn.current?.pointerId !== t.pointerId) return;
4103
- let n = kr(t.nativeEvent, !0);
4117
+ if (On.current?.pointerId !== t.pointerId) return;
4118
+ let n = $(t.nativeEvent, !0);
4104
4119
  n !== null && zr(e, n), Br();
4105
4120
  }, Ki = (e, t) => {
4106
4121
  if (t.key === "Escape") {
4107
- if (!Nn.current) return;
4122
+ if (!On.current) return;
4108
4123
  t.preventDefault(), t.stopPropagation(), Lr();
4109
4124
  return;
4110
4125
  }
@@ -4114,7 +4129,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4114
4129
  }
4115
4130
  let n = X?.rows;
4116
4131
  if (!n || !Y) return;
4117
- let r = Nn.current?.draft ?? Y, i = n.findIndex((t) => t.x === r[e === "start" ? "startX" : "endX"]), a = n.findIndex((t) => t.x === r[e === "start" ? "endX" : "startX"]);
4132
+ let r = On.current?.draft ?? Y, i = n.findIndex((t) => t.x === r[e === "start" ? "startX" : "endX"]), a = n.findIndex((t) => t.x === r[e === "start" ? "endX" : "startX"]);
4118
4133
  if (i < 0 || a < 0) return;
4119
4134
  let o = Y.startX > Y.endX, s = o ? e === "start" ? a + 1 : 0 : e === "start" ? 0 : a + 1, c = o ? e === "start" ? n.length - 1 : a - 1 : e === "start" ? a - 1 : n.length - 1, l;
4120
4135
  switch (t.key) {
@@ -4140,7 +4155,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4140
4155
  break;
4141
4156
  default: return;
4142
4157
  }
4143
- t.preventDefault(), t.stopPropagation(), Nn.current || Rr(e), zr(e, l);
4158
+ t.preventDefault(), t.stopPropagation(), On.current || Rr(e), zr(e, l);
4144
4159
  }, qi = y && Z && !Ci && !(K && Y) ? /* @__PURE__ */ j("label", {
4145
4160
  className: "lilt-chart__keyboard-input",
4146
4161
  children: [
@@ -4155,24 +4170,24 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4155
4170
  min: vi,
4156
4171
  onChange: (e) => {
4157
4172
  let t = Number(e.currentTarget.value), n = Z.data.rows[t]?.x;
4158
- J && n !== void 0 ? Cn({
4173
+ J && n !== void 0 ? Sn({
4159
4174
  ...J,
4160
4175
  probeX: n
4161
- }) : Or(t, !0, !1, Tr.current);
4176
+ }) : kr(t, !0, !1, Tr.current);
4162
4177
  },
4163
- onFocus: () => Or(xi, Cr?.pinned ?? !1),
4178
+ onFocus: () => kr(xi, Cr?.pinned ?? !1),
4164
4179
  onKeyDown: (e) => {
4165
4180
  if (e.key === "Escape" && (e.preventDefault(), qr()), (e.key === "ArrowUp" || e.key === "ArrowDown") && _e === "nearest" && q.length > 1 && !J) {
4166
4181
  let t = Ar(Number(e.currentTarget.value));
4167
4182
  if (t.length > 1) {
4168
4183
  e.preventDefault();
4169
4184
  let n = t.findIndex((e) => e.id === gn), r = e.key === "ArrowUp" ? -1 : 1, i = Math.min(t.length - 1, Math.max(0, (n < 0 ? 0 : n) + r));
4170
- un(t[i].id);
4185
+ ln(t[i].id);
4171
4186
  return;
4172
4187
  }
4173
4188
  }
4174
4189
  if (e.key === "Enter" && !(K && Si)) {
4175
- e.preventDefault(), Or(Number(e.currentTarget.value), !0, !1, e.altKey);
4190
+ e.preventDefault(), kr(Number(e.currentTarget.value), !0, !1, e.altKey);
4176
4191
  return;
4177
4192
  }
4178
4193
  if (K && Si && e.key === "Enter") {
@@ -4191,8 +4206,8 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4191
4206
  }),
4192
4207
  /* @__PURE__ */ A("small", { children: J ? "Arrow keys choose the second point. Enter compares. Escape keeps the pin." : `Left and Right inspect.${_e === "nearest" && q.length > 1 ? " Up and Down switch series." : ""} ${K ? "Enter marks a range. " : ""}Escape clears.` })
4193
4208
  ]
4194
- }) : null, Ji = Ht && !ue && Hn && xr && Bt.overview !== !1 && Pr ? {
4195
- range: Hn,
4209
+ }) : null, Ji = Ht && !ue && zn && xr && Bt.overview !== !1 && Pr ? {
4210
+ range: zn,
4196
4211
  series: Pr,
4197
4212
  snapshot: xr
4198
4213
  } : null, Yi = (Vi?.phase === "complete" ? Z?.data.rows.find((e) => e.x === Vi.endX) : void 0) ?? (bi ? Z?.data.rows.find((e) => e.sourceIndex === bi.sourceIndex) : _i), Xi = E(() => (hi ?? []).map((e) => ({
@@ -4237,14 +4252,14 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4237
4252
  pinnedX: bi?.pinned ? bi.x : null,
4238
4253
  onInspect: (e, t) => {
4239
4254
  let n = Z?.data.rows.findIndex((t) => t.x === e) ?? -1;
4240
- n >= 0 && Or(n, t);
4255
+ n >= 0 && kr(n, t);
4241
4256
  },
4242
4257
  onClearInspect: () => {
4243
- Q.current?.pinned || $();
4258
+ Q.current?.pinned || Dr();
4244
4259
  },
4245
- onReleaseInspect: $,
4260
+ onReleaseInspect: Dr,
4246
4261
  onFocus: (e) => {
4247
- pn(e), e && !Q.current?.pinned && !Q.current && _i && Z && Or(nr(Z, _i.sourceIndex), !1), !e && !Q.current?.pinned && $();
4262
+ pn(e), e && !Q.current?.pinned && !Q.current && _i && Z && kr(ar(Z, _i.sourceIndex), !1), !e && !Q.current?.pinned && Dr();
4248
4263
  },
4249
4264
  onVisibleChange: Qr,
4250
4265
  isolatedId: Yt?.id ?? null,
@@ -4256,7 +4271,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4256
4271
  if (!L || !Z || !L.getAcceptedFrame()) return;
4257
4272
  let e = bi && Z ? Z.data.rows.find((e) => e.sourceIndex === bi.sourceIndex && e.x === bi.x) : void 0;
4258
4273
  Ye(L, {
4259
- inspection: e && Z ? ln(Z, e, q, bi.pinned, q.length > 1 ? gn ?? null : null) : null,
4274
+ inspection: e && Z ? fn(Z, e, q, bi.pinned, q.length > 1 ? gn ?? null : null) : null,
4260
4275
  comparison: Vi,
4261
4276
  visibleSeries: qt,
4262
4277
  legend: Zi.series
@@ -4266,7 +4281,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4266
4281
  if (t >= 0) {
4267
4282
  Er.current = !0;
4268
4283
  try {
4269
- Or(t, !1);
4284
+ kr(t, !1);
4270
4285
  } finally {
4271
4286
  Er.current = !1;
4272
4287
  }
@@ -4276,7 +4291,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4276
4291
  if (!Q.current?.pinned) {
4277
4292
  Er.current = !0;
4278
4293
  try {
4279
- $();
4294
+ Dr();
4280
4295
  } finally {
4281
4296
  Er.current = !1;
4282
4297
  }
@@ -4287,7 +4302,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4287
4302
  if (n >= 0) {
4288
4303
  Er.current = !0;
4289
4304
  try {
4290
- Or(n, !0, !1, !!t?.local);
4305
+ kr(n, !0, !1, !!t?.local);
4291
4306
  } finally {
4292
4307
  Er.current = !1;
4293
4308
  }
@@ -4296,7 +4311,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4296
4311
  release: () => {
4297
4312
  Er.current = !0;
4298
4313
  try {
4299
- $();
4314
+ Dr();
4300
4315
  } finally {
4301
4316
  Er.current = !1;
4302
4317
  }
@@ -4340,7 +4355,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4340
4355
  return;
4341
4356
  }
4342
4357
  let e = Q.current ? Z.data.rows.findIndex((e) => e.x === Q.current.x) : vi, t = Z.data.rows[Math.max(vi, e)];
4343
- t && (Or(Math.max(vi, e), !0), Cn({
4358
+ t && (kr(Math.max(vi, e), !0), Sn({
4344
4359
  baselineX: t.x,
4345
4360
  probeX: t.x
4346
4361
  }), requestAnimationFrame(() => je.current?.querySelector("input[type=\"range\"]")?.focus()));
@@ -4353,7 +4368,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4353
4368
  } : null,
4354
4369
  brush: ue && xr && xr.data.rows.length > 1 && q[0] ? {
4355
4370
  snapshot: xr,
4356
- range: Hn,
4371
+ range: zn,
4357
4372
  seriesId: q[0].id,
4358
4373
  reducedMotion: V,
4359
4374
  onFocus: Gr
@@ -4369,9 +4384,9 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4369
4384
  "data-lilt-axis-y": Te.y,
4370
4385
  "data-lilt-pill": Ce,
4371
4386
  className: ni,
4372
- "data-lilt-focused": Hn ? "true" : void 0,
4387
+ "data-lilt-focused": zn ? "true" : void 0,
4373
4388
  "data-lilt-inspecting": y && Cr ? "true" : "false",
4374
- "data-lilt-live": Ut ? Kn ? "following" : "paused" : void 0,
4389
+ "data-lilt-live": Ut ? Bn ? "following" : "paused" : void 0,
4375
4390
  "data-lilt-phase": vt,
4376
4391
  "data-lilt-bars": c.bars ? "true" : void 0,
4377
4392
  "data-lilt-stack": c.stack?.mode,
@@ -4388,10 +4403,10 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4388
4403
  height: z.height,
4389
4404
  tabIndex: y && d ? 0 : void 0,
4390
4405
  onFocus: () => {
4391
- d && !Q.current && Or(yi, !1);
4406
+ d && !Q.current && kr(yi, !1);
4392
4407
  },
4393
4408
  onBlur: () => {
4394
- d && $();
4409
+ d && Dr();
4395
4410
  },
4396
4411
  onKeyDown: (e) => {
4397
4412
  if (e.key === "Escape") {
@@ -4405,8 +4420,8 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4405
4420
  "End"
4406
4421
  ].includes(e.key)) return;
4407
4422
  e.preventDefault();
4408
- let t = Q.current && Z ? nr(Z, Q.current.sourceIndex) : yi, n = e.key === "Home" ? vi : e.key === "End" ? yi : Math.min(yi, Math.max(vi, t + (e.key === "ArrowRight" ? 1 : -1)));
4409
- Or(n, !1);
4423
+ let t = Q.current && Z ? ar(Z, Q.current.sourceIndex) : yi, n = e.key === "Home" ? vi : e.key === "End" ? yi : Math.min(yi, Math.max(vi, t + (e.key === "ArrowRight" ? 1 : -1)));
4424
+ kr(n, !1);
4410
4425
  },
4411
4426
  onClick: (e) => {
4412
4427
  if (!y) return;
@@ -4414,20 +4429,20 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4414
4429
  jt.current = !1;
4415
4430
  return;
4416
4431
  }
4417
- let t = kr(e.nativeEvent);
4432
+ let t = $(e.nativeEvent);
4418
4433
  if (t === null) return;
4419
4434
  let n = Z?.data.rows[t]?.x;
4420
4435
  if (J && n !== void 0) {
4421
4436
  n !== J.baselineX && Hr(J.baselineX, n, !0);
4422
4437
  return;
4423
4438
  }
4424
- if (K && Y && !Hn && Ht && n !== void 0 && n >= Math.min(Y.startX, Y.endX) && n <= Math.max(Y.startX, Y.endX)) {
4439
+ if (K && Y && !zn && Ht && n !== void 0 && n >= Math.min(Y.startX, Y.endX) && n <= Math.max(Y.startX, Y.endX)) {
4425
4440
  Gr(Y);
4426
4441
  return;
4427
4442
  }
4428
4443
  if (K && Y) return;
4429
4444
  let r = e.altKey || Tr.current;
4430
- Q.current?.pinned && Q.current.sourceIndex === Z?.data.rows[t]?.sourceIndex && (!e.altKey || Tr.current) ? $() : Or(t, !0, !1, r);
4445
+ Q.current?.pinned && Q.current.sourceIndex === Z?.data.rows[t]?.sourceIndex && (!e.altKey || Tr.current) ? Dr() : kr(t, !0, !1, r);
4431
4446
  },
4432
4447
  onPointerCancel: () => {
4433
4448
  kt.current = null, At.current = null, bn(null), Ot.current = null;
@@ -4436,7 +4451,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4436
4451
  onPointerDown: (e) => {
4437
4452
  if (!J) {
4438
4453
  if (K && Si && e.button === 0) {
4439
- let t = kr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
4454
+ let t = $(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
4440
4455
  if (t !== null && n !== void 0) {
4441
4456
  let r = e.target.closest("[data-series]")?.getAttribute("data-series"), i = q.some((e) => e.id === r) ? r : Si.id;
4442
4457
  At.current = {
@@ -4457,7 +4472,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4457
4472
  }
4458
4473
  },
4459
4474
  onPointerLeave: () => {
4460
- Q.current?.pinned || $();
4475
+ Q.current?.pinned || Dr();
4461
4476
  },
4462
4477
  onPointerMove: (e) => {
4463
4478
  if (J) {
@@ -4466,14 +4481,14 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4466
4481
  }
4467
4482
  if (At.current?.pointerId === e.pointerId) {
4468
4483
  let t = At.current;
4469
- !t.moved && Math.abs(e.clientX - t.clientX) > (e.pointerType === "touch" ? 8 : 4) && (t.moved = !0, $()), t.moved && Vr(e.nativeEvent);
4484
+ !t.moved && Math.abs(e.clientX - t.clientX) > (e.pointerType === "touch" ? 8 : 4) && (t.moved = !0, Dr()), t.moved && Vr(e.nativeEvent);
4470
4485
  return;
4471
4486
  }
4472
4487
  if (!(K && Y)) {
4473
4488
  if (e.pointerType === "touch") {
4474
4489
  let t = kt.current;
4475
4490
  if (!t) return;
4476
- Math.abs(e.clientX - t.x) > 8 && (t.moved = !0), t.moved && Mr(e.nativeEvent);
4491
+ !t.moved && Math.abs(e.clientX - t.x) > 8 && (t.moved = !0, e.currentTarget.setPointerCapture?.(e.pointerId)), t.moved && Mr(e.nativeEvent);
4477
4492
  return;
4478
4493
  }
4479
4494
  Mr(e.nativeEvent);
@@ -4482,7 +4497,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4482
4497
  onPointerUp: (e) => {
4483
4498
  if (J) {
4484
4499
  if (e.pointerType === "touch") {
4485
- let t = kr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
4500
+ let t = $(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
4486
4501
  n !== void 0 && n !== J.baselineX && Hr(J.baselineX, n, !0), Nt();
4487
4502
  }
4488
4503
  return;
@@ -4490,14 +4505,14 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4490
4505
  if (At.current?.pointerId === e.pointerId) {
4491
4506
  let t = At.current;
4492
4507
  if (At.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), t.moved) {
4493
- let n = kr(e.nativeEvent, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
4494
- r !== void 0 && r !== t.startX ? Hr(t.startX, r, !1, t.series) : Or(t.startIndex, !0), bn(null), Nt();
4508
+ let n = $(e.nativeEvent, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
4509
+ r !== void 0 && r !== t.startX ? Hr(t.startX, r, !1, t.series) : kr(t.startIndex, !0), bn(null), Nt();
4495
4510
  }
4496
4511
  return;
4497
4512
  }
4498
4513
  if (e.pointerType !== "touch") return;
4499
- let t = kr(e.nativeEvent);
4500
- t !== null && (Or(t, !0, !1, Tr.current), Nt()), kt.current = null;
4514
+ let t = $(e.nativeEvent);
4515
+ t !== null && (kr(t, !0, !1, Tr.current), Nt()), kt.current = null;
4501
4516
  },
4502
4517
  ref: Me,
4503
4518
  style: { touchAction: "pan-y pinch-zoom" },
@@ -4609,7 +4624,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4609
4624
  edge: xe && !c.bars ? 0 : 8
4610
4625
  })
4611
4626
  }) : null,
4612
- Z && Cr && !ki && !J && !Fr ? /* @__PURE__ */ A(Sn, {
4627
+ Z && Cr && !ki && !J && !Fr ? /* @__PURE__ */ A(Tn, {
4613
4628
  paintId: et,
4614
4629
  seriesColors: Object.fromEntries(i.map((e, t) => [e.id, R(e, t)])),
4615
4630
  crossGradientId: nt,
@@ -4629,19 +4644,19 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4629
4644
  hideAxisBadges: Ke || ge === !1,
4630
4645
  peer: Oi && !Di
4631
4646
  }) : null,
4632
- /* @__PURE__ */ A(M, { children: Z && bi?.pinned && !d && (!Oi || Di) && !J && !Fr ? /* @__PURE__ */ A(On, {
4647
+ /* @__PURE__ */ A(M, { children: Z && bi?.pinned && !d && (!Oi || Di) && !J && !Fr ? /* @__PURE__ */ A(jn, {
4633
4648
  left: Z.xToPixel(bi.x) - 12,
4634
4649
  top: Math.max(0, Z.plot.top - 24 - 4),
4635
4650
  reducedMotion: V,
4636
4651
  ghost: Di,
4637
4652
  from: Di ? G.inspection?.from : void 0,
4638
4653
  local: !Di && Tr.current,
4639
- onRelease: $
4654
+ onRelease: Dr
4640
4655
  }, "pin") : null }),
4641
- Z && Ai ? /* @__PURE__ */ A(wn, {
4656
+ Z && Ai ? /* @__PURE__ */ A(Dn, {
4642
4657
  comparison: Ai,
4643
4658
  rows: Pi,
4644
- preview: !(!ki || Dn),
4659
+ preview: !(!ki || wn),
4645
4660
  reducedMotion: V,
4646
4661
  snapshot: Z,
4647
4662
  onEndpointPointerDown: Ui,
@@ -4651,11 +4666,11 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4651
4666
  onEndpointCommit: Br,
4652
4667
  onEndpointKeyDown: Ki
4653
4668
  }) : null,
4654
- f ? /* @__PURE__ */ A(En, {
4669
+ f ? /* @__PURE__ */ A(kn, {
4655
4670
  value: {
4656
4671
  inspection: Z && bi && !Ai ? (() => {
4657
4672
  let e = Z.data.rows.find((e) => e.sourceIndex === bi.sourceIndex && e.x === bi.x);
4658
- return e ? ln(Z, e, q, bi.pinned, q.length > 1 ? gn ?? null : null) : null;
4673
+ return e ? fn(Z, e, q, bi.pinned, q.length > 1 ? gn ?? null : null) : null;
4659
4674
  })() : null,
4660
4675
  comparison: Vi,
4661
4676
  colors: Object.fromEntries(i.map((e, t) => [e.id, R(e, t)])),
@@ -4677,10 +4692,10 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4677
4692
  peer: Oi,
4678
4693
  pinned: !(!Cr?.pinned || J),
4679
4694
  reducedMotion: V,
4680
- onRelease: $,
4695
+ onRelease: Dr,
4681
4696
  onCompareFromHere: Cr?.pinned && K && !J ? Hi : void 0
4682
4697
  } : null,
4683
- onRelease: $,
4698
+ onRelease: Dr,
4684
4699
  onCompareFromHere: Cr?.pinned && K && !J ? Hi : void 0
4685
4700
  },
4686
4701
  children: f
@@ -4703,7 +4718,7 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4703
4718
  message: oi,
4704
4719
  retry: x
4705
4720
  }) : null,
4706
- Ut && !Kn ? /* @__PURE__ */ j("button", {
4721
+ Ut && !Bn ? /* @__PURE__ */ j("button", {
4707
4722
  className: "lilt-chart__live-control",
4708
4723
  onClick: Jr,
4709
4724
  type: "button",
@@ -4718,13 +4733,13 @@ function rr({ data: e, x: n, y: r = Bn, series: i, height: a = 340, compactHeigh
4718
4733
  }
4719
4734
  //#endregion
4720
4735
  //#region src/primitives/plot-background.tsx
4721
- var ir = {
4736
+ var sr = {
4722
4737
  dots: 12,
4723
4738
  grid: 16,
4724
4739
  lines: 20
4725
- }, ar = 110;
4726
- function or({ kind: e, spotlight: t = !0 }) {
4727
- let n = `lilt-bg-${w().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = G(), s = it(), { left: c, top: l, width: u, height: d } = r.plot, f = ir[e], p = i < 1 && !o ? Jt(i * a, 0, 320) : 1, m = (t) => /* @__PURE__ */ A("g", {
4740
+ }, cr = 110;
4741
+ function lr({ kind: e, spotlight: t = !0 }) {
4742
+ let n = `lilt-bg-${w().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = G(), s = it(), { left: c, top: l, width: u, height: d } = r.plot, f = sr[e], p = i < 1 && !o ? Jt(i * a, 0, 320) : 1, m = (t) => /* @__PURE__ */ A("g", {
4728
4743
  className: `lilt-chart__texture-${t}`,
4729
4744
  children: e === "dots" ? /* @__PURE__ */ A("circle", {
4730
4745
  cx: f / 2,
@@ -4798,8 +4813,8 @@ function or({ kind: e, spotlight: t = !0 }) {
4798
4813
  children: /* @__PURE__ */ A(N.ellipse, {
4799
4814
  cx: s.pointerX,
4800
4815
  cy: s.y,
4801
- rx: ar,
4802
- ry: ar,
4816
+ rx: cr,
4817
+ ry: cr,
4803
4818
  fill: `url(#${n}-spot-fade)`
4804
4819
  })
4805
4820
  })] }) : null
@@ -4828,7 +4843,7 @@ function or({ kind: e, spotlight: t = !0 }) {
4828
4843
  }
4829
4844
  //#endregion
4830
4845
  //#region src/interaction/comparison-tooltip.tsx
4831
- function sr({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width: a, height: o, className: s, ariaLabel: c }) {
4846
+ function ur({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width: a, height: o, className: s, ariaLabel: c }) {
4832
4847
  let l = D(null), [u, d] = O(null);
4833
4848
  T(() => {
4834
4849
  let e = l.current;
@@ -4866,7 +4881,7 @@ function sr({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width
4866
4881
  }
4867
4882
  //#endregion
4868
4883
  //#region src/interaction/adaptive-readout.tsx
4869
- function cr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned: a, onRelease: o, onCompareFromHere: s, renderContent: c, reducedMotion: l }) {
4884
+ function dr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned: a, onRelease: o, onCompareFromHere: s, renderContent: c, reducedMotion: l }) {
4870
4885
  let u = n ? e.data.rows.find((e) => e.x === n.x) : null, d = e.data.rows.at(-1), f = r === void 0 ? u ?? d : u, p = r ?? f?.x, m = p === void 0 ? "No observation" : e.formatX(p), h = r !== void 0 && f && f.x !== r, g = e.stack?.series ?? [], _ = g.length > 0, v = t.filter((e) => g.includes(e.id)).map((e) => f?.values[e.id] ?? null), y = _ && v.length > 0 && v.every((e) => e !== null) ? v.reduce((e, t) => e + (t ?? 0), 0) : null, b = l ? 0 : 150;
4871
4886
  return /* @__PURE__ */ j("div", {
4872
4887
  className: "lilt-chart__adaptive-readout",
@@ -4893,7 +4908,7 @@ function cr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned:
4893
4908
  }), c && n && u ? /* @__PURE__ */ A("div", {
4894
4909
  className: "lilt-chart__adaptive-custom",
4895
4910
  inert: !a,
4896
- children: c(ln(e, u, t, a))
4911
+ children: c(fn(e, u, t, a))
4897
4912
  }) : !f && r !== void 0 ? /* @__PURE__ */ A("span", {
4898
4913
  className: "lilt-chart__adaptive-missing",
4899
4914
  children: "No observation at this date"
@@ -4932,11 +4947,11 @@ function cr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned:
4932
4947
  }
4933
4948
  //#endregion
4934
4949
  //#region src/interaction/tooltip.tsx
4935
- function lr(e = {}) {
4936
- let t = Dn(), n = Te();
4950
+ function fr(e = {}) {
4951
+ let t = An(), n = Te();
4937
4952
  if (e.model && e.model !== n.model) throw Error("Lilt Tooltip model must be the model supplied to its Chart.");
4938
4953
  if (e.floating === !1) return null;
4939
- if (t.comparison) return e.renderComparison ? /* @__PURE__ */ A(sr, {
4954
+ if (t.comparison) return e.renderComparison ? /* @__PURE__ */ A(ur, {
4940
4955
  comparison: t.comparison,
4941
4956
  renderContent: e.renderComparison,
4942
4957
  startX: t.compareStartX,
@@ -4947,7 +4962,7 @@ function lr(e = {}) {
4947
4962
  className: e.className,
4948
4963
  ariaLabel: e["aria-label"]
4949
4964
  }) : null;
4950
- if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ A(cr, {
4965
+ if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ A(dr, {
4951
4966
  ...t.adaptive,
4952
4967
  renderContent: e.renderContent
4953
4968
  }) : null;
@@ -5054,11 +5069,11 @@ function lr(e = {}) {
5054
5069
  }
5055
5070
  //#endregion
5056
5071
  //#region src/marks/contract.ts
5057
- var ur = /* @__PURE__ */ new WeakMap();
5058
- function dr(e, t) {
5059
- return ur.set(e, t), e;
5072
+ var pr = /* @__PURE__ */ new WeakMap();
5073
+ function mr(e, t) {
5074
+ return pr.set(e, t), e;
5060
5075
  }
5061
- function fr(e) {
5076
+ function X(e) {
5062
5077
  let t = [], n = (e) => {
5063
5078
  v.forEach(e, (e) => {
5064
5079
  if (!x(e)) return;
@@ -5067,7 +5082,7 @@ function fr(e) {
5067
5082
  n(r.children);
5068
5083
  return;
5069
5084
  }
5070
- let i = typeof e.type == "function" ? ur.get(e.type) : void 0;
5085
+ let i = typeof e.type == "function" ? pr.get(e.type) : void 0;
5071
5086
  i && t.push({
5072
5087
  series: i.series(r),
5073
5088
  layout: i.layout,
@@ -5078,7 +5093,7 @@ function fr(e) {
5078
5093
  };
5079
5094
  return n(e), t;
5080
5095
  }
5081
- function pr(e, t, n, r) {
5096
+ function hr(e, t, n, r) {
5082
5097
  let i = t.findIndex((e) => e.id === n), a = t[i];
5083
5098
  if (!a) throw Error(`Lilt ${e} references unknown series "${n}".`);
5084
5099
  let o = r.filter((e) => !a.fields?.[e]);
@@ -5088,7 +5103,7 @@ function pr(e, t, n, r) {
5088
5103
  index: i
5089
5104
  };
5090
5105
  }
5091
- function mr(e, t, n) {
5106
+ function gr(e, t, n) {
5092
5107
  let r = e.fields[t], i = [];
5093
5108
  for (let e of n) {
5094
5109
  let t = r?.[e];
@@ -5097,27 +5112,27 @@ function mr(e, t, n) {
5097
5112
  }
5098
5113
  return i;
5099
5114
  }
5100
- function X(e, t, n) {
5115
+ function _r(e, t, n) {
5101
5116
  return e.colorAt?.(t.datum) ?? n;
5102
5117
  }
5103
5118
  //#endregion
5104
5119
  //#region src/chart-plot.tsx
5105
- function hr(e, t) {
5120
+ function vr(e, t) {
5106
5121
  if (!Number.isFinite(t) || t <= 0) throw Error(`Lilt ${e} must be a positive finite number; received ${t}.`);
5107
5122
  }
5108
- function gr({ model: e, children: t, height: n = 340, compactHeight: r, margins: i, bars: a, stack: o, compact: s = !1, tooltip: c, inspectionSeries: l, className: u, style: d, axis: f, pill: p, pillSeries: m, pillValue: h, pillPosition: g, background: _ = "none", spotlight: v = !0, axisInset: y, runoff: b, labelOverhang: S, slots: ee = !1 }) {
5109
- n !== "fill" && hr("ChartPlot height", n), r !== void 0 && hr("ChartPlot compactHeight", r);
5123
+ function yr({ model: e, children: t, height: n = 340, compactHeight: r, margins: i, bars: a, stack: o, compact: s = !1, tooltip: c, inspectionSeries: l, className: u, style: d, axis: f, pill: p, pillSeries: m, pillValue: h, pillPosition: g, background: _ = "none", spotlight: v = !0, axisInset: y, runoff: b, labelOverhang: S, slots: ee = !1 }) {
5124
+ n !== "fill" && vr("ChartPlot height", n), r !== void 0 && vr("ChartPlot compactHeight", r);
5110
5125
  let C = a === !0 ? {} : a;
5111
5126
  if (C) {
5112
- C.width !== void 0 && hr("ChartPlot bars.width", C.width);
5127
+ C.width !== void 0 && vr("ChartPlot bars.width", C.width);
5113
5128
  for (let [e, t] of [["gap", C.gap], ["segmentGap", C.segmentGap]]) if (t !== void 0 && (!Number.isFinite(t) || t < 0)) throw Error(`Lilt ChartPlot bars.${e} must be a non-negative finite number; received ${t}.`);
5114
5129
  }
5115
- let w = Te(), T = E(() => fr(t), [t]);
5130
+ let w = Te(), T = E(() => X(t), [t]);
5116
5131
  if (e && e !== w.model) throw Error("Lilt ChartPlot model must be the model supplied to its Chart.");
5117
- let D = vr(w.props.series.map((e) => e.id), C, o, T, ee);
5132
+ let D = Z(w.props.series.map((e) => e.id), C, o, T, ee);
5118
5133
  if (w.props.x.type === "category" && (w.linked || w.props.compare || w.props.focus || w.props.live || w.props.brush)) throw Error("Category plots support inspection and visibility; time-range comparison, focus, live, brush and linked controllers require numeric or time x.");
5119
- let O = c === !1 || c === void 0 ? null : x(c) ? c : /* @__PURE__ */ A(lr, { ...c });
5120
- return /* @__PURE__ */ j(rr, {
5134
+ let O = c === !1 || c === void 0 ? null : x(c) ? c : /* @__PURE__ */ A(fr, { ...c });
5135
+ return /* @__PURE__ */ j(or, {
5121
5136
  ...w.props,
5122
5137
  className: u,
5123
5138
  compactHeight: r,
@@ -5142,19 +5157,19 @@ function gr({ model: e, children: t, height: n = 340, compactHeight: r, margins:
5142
5157
  axisInset: y,
5143
5158
  runoff: b,
5144
5159
  labelOverhang: S,
5145
- children: [_ === "none" ? null : /* @__PURE__ */ A(or, {
5160
+ children: [_ === "none" ? null : /* @__PURE__ */ A(lr, {
5146
5161
  kind: _,
5147
5162
  spotlight: v
5148
5163
  }), t]
5149
5164
  });
5150
5165
  }
5151
- function _r(e, t, n) {
5166
+ function br(e, t, n) {
5152
5167
  if (new Set(t).size !== t.length || t.some((e) => !n.includes(e))) throw Error(`Lilt ChartPlot ${e} must list unique IDs from the chart series.`);
5153
5168
  }
5154
- function vr(e, t, n, r, i) {
5169
+ function Z(e, t, n, r, i) {
5155
5170
  let a = n === void 0 ? void 0 : n === !0 ? {} : typeof n == "string" ? { mode: n } : n;
5156
- if (a?.series && (_r("stack.series", a.series, e), !a.series.length)) throw Error("Lilt ChartPlot stack.series must not be empty.");
5157
- t?.series && _r("bars.series", t.series, e);
5171
+ if (a?.series && (br("stack.series", a.series, e), !a.series.length)) throw Error("Lilt ChartPlot stack.series must not be empty.");
5172
+ t?.series && br("bars.series", t.series, e);
5158
5173
  let o = a ? e.filter((e) => !a.series || a.series.includes(e)) : null;
5159
5174
  if (o && t?.series && (t.series.length !== o.length || t.series.some((e) => !o.includes(e)))) throw Error("Lilt ChartPlot stacked bars draw exactly the stacked series; other series draw as lines.");
5160
5175
  let s = t ? o ?? e.filter((e) => !t.series || t.series.includes(e)) : null, c = [...new Set(r.filter((e) => e.layout === "column").map((e) => e.series))];
@@ -5175,8 +5190,8 @@ function vr(e, t, n, r, i) {
5175
5190
  }
5176
5191
  //#endregion
5177
5192
  //#region src/primitives/runoff.tsx
5178
- var yr = .32;
5179
- function br(e, t) {
5193
+ var xr = .32;
5194
+ function Sr(e, t) {
5180
5195
  let { plot: n } = e, r = e.xToPixel(e.xDomain[0]), i = e.xToPixel(e.xDomain[1]), a = t.segments[0]?.points[0], o = t.segments.at(-1)?.points.at(-1), s = a && r - n.left > .5 && Math.abs(a.x - r) < .5, c = o && n.right - i > .5 && Math.abs(o.x - i) < .5;
5181
5196
  return !s && !c ? null : {
5182
5197
  left: s ? n.left : void 0,
@@ -5185,27 +5200,27 @@ function br(e, t) {
5185
5200
  dataEnd: i
5186
5201
  };
5187
5202
  }
5188
- function Z(e, t, n) {
5203
+ function Cr(e, t, n) {
5189
5204
  return e ? {
5190
5205
  left: t === 0 ? e.left : void 0,
5191
5206
  right: t === n - 1 ? e.right : void 0
5192
5207
  } : {};
5193
5208
  }
5194
- function xr(e, { left: t, right: n }) {
5209
+ function wr(e, { left: t, right: n }) {
5195
5210
  let r = e.points[0], i = e.points.at(-1), a = e.path;
5196
5211
  return t !== void 0 && (a = `M${t},${r.y} L${a.slice(1)}`), n !== void 0 && (a = `${a} L${n},${i.y}`), a;
5197
5212
  }
5198
- var Sr = /(-?[\d.e+-]+),(-?[\d.e+-]+)\s*Z\s*$/, Cr = /^\s*L(-?[\d.e+-]+),(-?[\d.e+-]+)/;
5199
- function wr(e, { left: t, right: n }) {
5213
+ var Q = /(-?[\d.e+-]+),(-?[\d.e+-]+)\s*Z\s*$/, Tr = /^\s*L(-?[\d.e+-]+),(-?[\d.e+-]+)/;
5214
+ function Er(e, { left: t, right: n }) {
5200
5215
  if (t === void 0 && n === void 0 || !e.areaPath.startsWith(e.path)) return e.areaPath;
5201
- let r = e.areaPath.slice(e.path.length), i = Cr.exec(r), a = Sr.exec(r);
5216
+ let r = e.areaPath.slice(e.path.length), i = Tr.exec(r), a = Q.exec(r);
5202
5217
  if (!i || !a) return e.areaPath;
5203
5218
  let o = e.points[0], s = e.points.at(-1), c = e.path;
5204
5219
  t !== void 0 && (c = `M${t},${o.y} L${c.slice(1)}`), n !== void 0 && (c = `${c} L${n},${s.y} L${n},${i[2]}`);
5205
5220
  let l = t === void 0 ? r : r.replace(/Z\s*$/, `L${t},${a[2]} Z`);
5206
5221
  return `${c} ${l.trim()}`;
5207
5222
  }
5208
- function Q(e, t, n) {
5223
+ function Dr(e, t, n) {
5209
5224
  let { plot: r } = t;
5210
5225
  return [
5211
5226
  e,
@@ -5215,7 +5230,7 @@ function Q(e, t, n) {
5215
5230
  n.dataEnd
5216
5231
  ].map((e) => typeof e == "number" ? Math.round(e * 10) : e).join("-");
5217
5232
  }
5218
- function Tr({ id: e, snapshot: t, edges: n }) {
5233
+ function Or({ id: e, snapshot: t, edges: n }) {
5219
5234
  let { plot: r } = t, i = Math.max(1, r.right - r.left), a = (e) => Math.min(1, Math.max(0, (e - r.left) / i));
5220
5235
  return /* @__PURE__ */ j("defs", { children: [/* @__PURE__ */ j("linearGradient", {
5221
5236
  id: `${e}-ramp`,
@@ -5228,7 +5243,7 @@ function Tr({ id: e, snapshot: t, edges: n }) {
5228
5243
  /* @__PURE__ */ A("stop", {
5229
5244
  offset: 0,
5230
5245
  stopColor: "white",
5231
- stopOpacity: n.left === void 0 ? 1 : yr
5246
+ stopOpacity: n.left === void 0 ? 1 : xr
5232
5247
  }),
5233
5248
  /* @__PURE__ */ A("stop", {
5234
5249
  offset: a(n.dataStart),
@@ -5241,7 +5256,7 @@ function Tr({ id: e, snapshot: t, edges: n }) {
5241
5256
  /* @__PURE__ */ A("stop", {
5242
5257
  offset: 1,
5243
5258
  stopColor: "white",
5244
- stopOpacity: n.right === void 0 ? 1 : yr
5259
+ stopOpacity: n.right === void 0 ? 1 : xr
5245
5260
  })
5246
5261
  ]
5247
5262
  }), /* @__PURE__ */ A("mask", {
@@ -5258,7 +5273,7 @@ function Tr({ id: e, snapshot: t, edges: n }) {
5258
5273
  }
5259
5274
  //#endregion
5260
5275
  //#region src/primitives/area.tsx
5261
- function Er({ series: e, className: t, model: n }) {
5276
+ function kr({ series: e, className: t, model: n }) {
5262
5277
  let r = Te(), { runoff: i } = it();
5263
5278
  if (n && n !== r.model) throw Error("Lilt Area model must be the model supplied to its Chart.");
5264
5279
  let { snapshot: a, series: o, reducedMotion: s, inspecting: c, paintId: l, focusedSeries: u, visibleSeries: d, revealProgress: f, transitionDuration: p, clipId: m } = G(), h = Jt(f < 1 ? f * p : Infinity, 40, p * .65), g = a.geometry?.series[e];
@@ -5268,7 +5283,7 @@ function Er({ series: e, className: t, model: n }) {
5268
5283
  className: t,
5269
5284
  "data-series": e
5270
5285
  });
5271
- let w = i && !a.stack?.signed ? br(a, g) : null, T = w ? Q(`${m}-runoff-area-${y}`, a, w) : "", E = w ? /* @__PURE__ */ A(Tr, {
5286
+ let w = i && !a.stack?.signed ? Sr(a, g) : null, T = w ? Dr(`${m}-runoff-area-${y}`, a, w) : "", E = w ? /* @__PURE__ */ A(Or, {
5272
5287
  id: T,
5273
5288
  snapshot: a,
5274
5289
  edges: w
@@ -5292,7 +5307,7 @@ function Er({ series: e, className: t, model: n }) {
5292
5307
  children: g.segments.map((t, n) => {
5293
5308
  let r = t.status === "provisional" ? "hatch" : t.status === "forecast" ? "dots" : ee, i = Re(x, S?.fill, r, l(e, r === "solid" ? "fade" : r));
5294
5309
  return /* @__PURE__ */ A("path", {
5295
- d: w ? wr(t, Z(w, n, g.segments.length)) : t.areaPath,
5310
+ d: w ? Er(t, Cr(w, n, g.segments.length)) : t.areaPath,
5296
5311
  "data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
5297
5312
  fill: i,
5298
5313
  mask: S?.fade ? `url(#${l(e, "fade")}-mask)` : void 0,
@@ -5309,12 +5324,12 @@ function Er({ series: e, className: t, model: n }) {
5309
5324
  function $(e) {
5310
5325
  return Math.round(e * 100) / 100;
5311
5326
  }
5312
- function Dr(e, t, n) {
5327
+ function Ar(e, t, n) {
5313
5328
  return e.fields[t]?.[n] ?? null;
5314
5329
  }
5315
- function Or(e, t, n, r) {
5330
+ function jr(e, t, n, r) {
5316
5331
  for (let i of t) {
5317
- let t = r.map((e) => typeof e == "string" ? Dr(i, n, e) : i.values[n] ?? null);
5332
+ let t = r.map((e) => typeof e == "string" ? Ar(i, n, e) : i.values[n] ?? null);
5318
5333
  if (!t.some((e) => e === null)) {
5319
5334
  for (let a = 1; a < t.length; a += 1) if (t[a] < t[a - 1]) {
5320
5335
  let t = r.map((e) => typeof e == "string" ? e : "value").join(" ≤ ");
@@ -5323,7 +5338,7 @@ function Or(e, t, n, r) {
5323
5338
  }
5324
5339
  }
5325
5340
  }
5326
- function kr(e, t, n, r, i) {
5341
+ function Mr(e, t, n, r, i) {
5327
5342
  let a = [], o = [], s = () => {
5328
5343
  if (o.length >= 2) {
5329
5344
  let e = o.map((e) => `${$(e.x)},${$(i.y(e.upper))}`), t = o.map((e) => `${$(e.x)},${$(i.y(e.lower))}`).reverse();
@@ -5332,7 +5347,7 @@ function kr(e, t, n, r, i) {
5332
5347
  o = [];
5333
5348
  };
5334
5349
  for (let a of e) {
5335
- let e = Dr(a, t, n), c = Dr(a, t, r);
5350
+ let e = Ar(a, t, n), c = Ar(a, t, r);
5336
5351
  a.x < i.xDomain[0] || a.x > i.xDomain[1] || e === null || c === null ? s() : o.push({
5337
5352
  x: i.x(a.x),
5338
5353
  lower: e,
@@ -5341,14 +5356,14 @@ function kr(e, t, n, r, i) {
5341
5356
  }
5342
5357
  return s(), a;
5343
5358
  }
5344
- function Ar(e, t, n, r, i) {
5359
+ function Nr(e, t, n, r, i) {
5345
5360
  let a = Math.max(0, Math.min(i, n / 2, r / 2));
5346
5361
  return a === 0 ? `M${$(e)},${$(t)}h${$(n)}v${$(r)}h${$(-n)}Z` : `M${$(e + a)},${$(t)}h${$(n - 2 * a)}a${a},${a} 0 0 1 ${a},${a}v${$(r - 2 * a)}a${a},${a} 0 0 1 ${-a},${a}h${$(-(n - 2 * a))}a${a},${a} 0 0 1 ${-a},${-a}v${$(-(r - 2 * a))}a${a},${a} 0 0 1 ${a},${-a}Z`;
5347
5362
  }
5348
- function jr(e, t, n) {
5363
+ function Pr(e, t, n) {
5349
5364
  return `M${$(e - n)},${$(t)}a${n},${n} 0 1 0 ${n * 2},0a${n},${n} 0 1 0 ${-n * 2},0Z`;
5350
5365
  }
5351
- var Mr = class {
5366
+ var Fr = class {
5352
5367
  batches = /* @__PURE__ */ new Map();
5353
5368
  add(e, t) {
5354
5369
  let n = this.batches.get(e);
@@ -5361,14 +5376,14 @@ var Mr = class {
5361
5376
  }));
5362
5377
  }
5363
5378
  };
5364
- function Nr(e) {
5379
+ function Ir(e) {
5365
5380
  let t = Math.max(1, e.columnWidth);
5366
5381
  return {
5367
5382
  width: t,
5368
5383
  half: t / 2
5369
5384
  };
5370
5385
  }
5371
- function Pr(e, t) {
5386
+ function Lr(e, t) {
5372
5387
  let n = [];
5373
5388
  for (let r of e) r.x < t.xDomain[0] || r.x > t.xDomain[1] || n.push({
5374
5389
  row: r,
@@ -5376,32 +5391,32 @@ function Pr(e, t) {
5376
5391
  });
5377
5392
  return n;
5378
5393
  }
5379
- function Fr(e, t, n, r) {
5380
- let { width: i, half: a } = Nr(r), o = r.y(Math.max(t, n)), s = r.y(Math.min(t, n)), c = Math.max(1, s - o);
5381
- return Ar(e - a, o - (c === 1 ? .5 : 0), i, c, Math.min(4, a));
5394
+ function Rr(e, t, n, r) {
5395
+ let { width: i, half: a } = Ir(r), o = r.y(Math.max(t, n)), s = r.y(Math.min(t, n)), c = Math.max(1, s - o);
5396
+ return Nr(e - a, o - (c === 1 ? .5 : 0), i, c, Math.min(4, a));
5382
5397
  }
5383
- function Ir(e) {
5384
- return Math.min(12, Nr(e).width * .5) / 2;
5398
+ function zr(e) {
5399
+ return Math.min(12, Ir(e).width * .5) / 2;
5385
5400
  }
5386
- function Lr(e, t, n, r) {
5401
+ function Br(e, t, n, r) {
5387
5402
  let i = $(e), a = $(n);
5388
5403
  return `M${i},${$(t)}V${a}` + (r >= 1.5 ? `M${$(e - r)},${a}H${$(e + r)}` : "");
5389
5404
  }
5390
- function Rr(e, t, n, r) {
5391
- let i = Ir(r), a = $(r.y(n)), o = $(r.y(t)), s = i >= 1.5 ? `M${$(e - i)},${a}H${$(e + i)}M${$(e - i)},${o}H${$(e + i)}` : "";
5405
+ function Vr(e, t, n, r) {
5406
+ let i = zr(r), a = $(r.y(n)), o = $(r.y(t)), s = i >= 1.5 ? `M${$(e - i)},${a}H${$(e + i)}M${$(e - i)},${o}H${$(e + i)}` : "";
5392
5407
  return `M${$(e)},${a}V${o}${s}`;
5393
5408
  }
5394
- function zr(e, t, n) {
5395
- let { width: r, half: i } = Nr(n), a = Ir(n), o = n.y(t.q3), s = n.y(t.q1), c = $(n.y(t.median));
5409
+ function Hr(e, t, n) {
5410
+ let { width: r, half: i } = Ir(n), a = zr(n), o = n.y(t.q3), s = n.y(t.q1), c = $(n.y(t.median));
5396
5411
  return {
5397
- box: Ar(e - i, o, r, Math.max(1, s - o), Math.min(3, i)),
5412
+ box: Nr(e - i, o, r, Math.max(1, s - o), Math.min(3, i)),
5398
5413
  median: `M${$(e - i)},${c}H${$(e + i)}`,
5399
- whiskers: Lr(e, o, n.y(t.max), a) + Lr(e, s, n.y(t.min), a)
5414
+ whiskers: Br(e, o, n.y(t.max), a) + Br(e, s, n.y(t.min), a)
5400
5415
  };
5401
5416
  }
5402
5417
  //#endregion
5403
5418
  //#region src/marks/use-range-mark.ts
5404
- function Br(e, t) {
5419
+ function Ur(e, t) {
5405
5420
  return {
5406
5421
  x: e.xToPixel,
5407
5422
  y: e.yToPixelFor(t),
@@ -5409,10 +5424,10 @@ function Br(e, t) {
5409
5424
  columnWidth: e.columnWidth
5410
5425
  };
5411
5426
  }
5412
- function Vr(e, t, n, r) {
5413
- let i = G(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } = pr(e, i.series, t, n);
5427
+ function Wr(e, t, n, r) {
5428
+ let i = G(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } = hr(e, i.series, t, n);
5414
5429
  if (a.bars?.includes(t) || a.stack?.series.includes(t)) throw Error(`Lilt ${e} draws its own series; do not also draw "${t}" as bars.`);
5415
- let p = E(() => Br(a, t), [a, t]), m = o.includes(t) ? s && s !== t ? "var(--lilt-focus-muted-opacity, 0.18)" : c ? r === "column" ? "var(--lilt-bar-inspection-muted-opacity, 0.26)" : .3 : 1 : 0;
5430
+ let p = E(() => Ur(a, t), [a, t]), m = o.includes(t) ? s && s !== t ? "var(--lilt-focus-muted-opacity, 0.18)" : c ? r === "column" ? "var(--lilt-bar-inspection-muted-opacity, 0.26)" : .3 : 1 : 0;
5416
5431
  return {
5417
5432
  descriptor: d,
5418
5433
  color: R(d, f),
@@ -5427,10 +5442,10 @@ function Vr(e, t, n, r) {
5427
5442
  }
5428
5443
  //#endregion
5429
5444
  //#region src/primitives/interval-band.tsx
5430
- var Hr = dr(function({ series: e, lower: t, upper: n, className: r }) {
5431
- let { paintId: i } = G(), a = Vr("IntervalBand", e, [t, n], "overlay"), o = a.snapshot.data.rows;
5432
- Or("IntervalBand", o, e, [t, n]);
5433
- let s = kr(o, e, t, n, a.scales), c = Re(a.color, void 0, "fade", i(e, "fade"));
5445
+ var Gr = mr(function({ series: e, lower: t, upper: n, className: r }) {
5446
+ let { paintId: i } = G(), a = Wr("IntervalBand", e, [t, n], "overlay"), o = a.snapshot.data.rows;
5447
+ jr("IntervalBand", o, e, [t, n]);
5448
+ let s = Mr(o, e, t, n, a.scales), c = Re(a.color, void 0, "fade", i(e, "fade"));
5434
5449
  return /* @__PURE__ */ A("g", {
5435
5450
  "aria-hidden": "true",
5436
5451
  className: ["lilt-chart__interval-band", r].filter(Boolean).join(" "),
@@ -5450,7 +5465,7 @@ var Hr = dr(function({ series: e, lower: t, upper: n, className: r }) {
5450
5465
  });
5451
5466
  //#endregion
5452
5467
  //#region src/primitives/line.tsx
5453
- function Ur(e, t, n) {
5468
+ function Kr(e, t, n) {
5454
5469
  let r = t + 9, i = n - 5;
5455
5470
  if (i - r < (e.length - 1) * 17) return /* @__PURE__ */ new Map();
5456
5471
  let a = [];
@@ -5461,7 +5476,7 @@ function Ur(e, t, n) {
5461
5476
  }
5462
5477
  return new Map(e.map((e, t) => [e.id, a[t]]));
5463
5478
  }
5464
- function Wr({ series: e, className: t, model: n }) {
5479
+ function qr({ series: e, className: t, model: n }) {
5465
5480
  let r = Te();
5466
5481
  if (n && n !== r.model) throw Error("Lilt Line model must be the model supplied to its Chart.");
5467
5482
  let { runoff: i } = it(), a = D(null), [o, s] = O(!1), { snapshot: c, width: l, series: u, reducedMotion: d, inspecting: f, focusedSeries: p, visibleSeries: m, revealProgress: h, transitionDuration: g, clipId: _ } = G(), v = Jt(h < 1 ? h * g : Infinity, 0, 180), y = u.find((t) => t.id === e);
@@ -5476,7 +5491,7 @@ function Wr({ series: e, className: t, model: n }) {
5476
5491
  color: R(e, u.indexOf(e)),
5477
5492
  index: t
5478
5493
  } : null;
5479
- }).filter((e) => e !== null).sort((e, t) => e.y - t.y), E = Ur(w, c.plot.top, c.plot.bottom), te = w.find((t) => t.id === e)?.text, M = l - c.plot.right - 11, ne = !!(S?.directLabel && te && E.has(e) && c.plot.width >= 460 && l - c.plot.right >= 96);
5494
+ }).filter((e) => e !== null).sort((e, t) => e.y - t.y), E = Kr(w, c.plot.top, c.plot.bottom), te = w.find((t) => t.id === e)?.text, M = l - c.plot.right - 11, ne = !!(S?.directLabel && te && E.has(e) && c.plot.width >= 460 && l - c.plot.right >= 96);
5480
5495
  T(() => {
5481
5496
  if (!ne || !te || !a.current) return;
5482
5497
  let e = a.current, t = !0, n = () => {
@@ -5500,7 +5515,7 @@ function Wr({ series: e, className: t, model: n }) {
5500
5515
  className: t,
5501
5516
  "data-series": e
5502
5517
  });
5503
- let ie = i ? br(c, b) : null, ae = ie ? Q(`${_}-runoff-line-${u.indexOf(y)}`, c, ie) : "", P = ie ? /* @__PURE__ */ A(Tr, {
5518
+ let ie = i ? Sr(c, b) : null, ae = ie ? Dr(`${_}-runoff-line-${u.indexOf(y)}`, c, ie) : "", P = ie ? /* @__PURE__ */ A(Or, {
5504
5519
  id: ae,
5505
5520
  snapshot: c,
5506
5521
  edges: ie
@@ -5534,7 +5549,7 @@ function Wr({ series: e, className: t, model: n }) {
5534
5549
  /* @__PURE__ */ A("g", {
5535
5550
  mask: ie ? `url(#${ae})` : void 0,
5536
5551
  children: b.segments.map((t, n) => /* @__PURE__ */ A("path", {
5537
- d: ie ? xr(t, Z(ie, n, b.segments.length)) : t.path,
5552
+ d: ie ? wr(t, Cr(ie, n, b.segments.length)) : t.path,
5538
5553
  "data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
5539
5554
  opacity: v,
5540
5555
  "data-lilt-path": e,
@@ -5587,7 +5602,7 @@ function Wr({ series: e, className: t, model: n }) {
5587
5602
  }
5588
5603
  //#endregion
5589
5604
  //#region src/primitives/bar.tsx
5590
- function Gr({ series: e, className: t, model: n }) {
5605
+ function Jr({ series: e, className: t, model: n }) {
5591
5606
  let r = Te();
5592
5607
  if (n && n !== r.model) throw Error("Lilt Bar model must be the model supplied to its Chart.");
5593
5608
  let { snapshot: i, series: a, visibleSeries: o, inspecting: s, focusedSeries: c, reducedMotion: l, revealProgress: u, transitionDuration: d, clipId: f, paintId: p } = G(), m = a.find((t) => t.id === e);
@@ -5625,7 +5640,7 @@ function Gr({ series: e, className: t, model: n }) {
5625
5640
  }, `track-${e.valueX}`) : null;
5626
5641
  }) : null, h?.map((t, n) => {
5627
5642
  let r = u < 1 ? u * d : Infinity, o = g ? 0 : Yt(n, h.length), s = y.get(t.valueX) ?? "observed", c = s === "provisional" ? "hatch" : s === "forecast" ? "dots" : m.bar?.treatment ?? "solid", l = x?.get(t.valueX) ?? b, S = Re(l, void 0, c, p(e, c === "hatch" ? "hatch" : "dots"));
5628
- return /* @__PURE__ */ A(hn, {
5643
+ return /* @__PURE__ */ A(vn, {
5629
5644
  id: `${f}-bar-${a.indexOf(m)}-${n}`,
5630
5645
  bar: t,
5631
5646
  appearance: m.bar?.appearance,
@@ -5657,13 +5672,13 @@ function Gr({ series: e, className: t, model: n }) {
5657
5672
  }
5658
5673
  //#endregion
5659
5674
  //#region src/primitives/grid.tsx
5660
- var Kr = [
5675
+ var Yr = [
5661
5676
  .22,
5662
5677
  1,
5663
5678
  .36,
5664
5679
  1
5665
5680
  ];
5666
- function qr({ className: e, pattern: t = "lines", color: n, opacity: r = 1, lineWidth: i, dotSpacing: a = 8, dotRadius: o = .6 } = {}) {
5681
+ function Xr({ className: e, pattern: t = "lines", color: n, opacity: r = 1, lineWidth: i, dotSpacing: a = 8, dotRadius: o = .6 } = {}) {
5667
5682
  if (!Number.isFinite(r) || r < 0 || r > 1 || i !== void 0 && (!Number.isFinite(i) || i < 0) || !Number.isFinite(a) || a <= 0 || !Number.isFinite(o) || o < 0 || o > a / 2) throw Error("Lilt Grid requires opacity in [0, 1], non-negative lineWidth, positive dotSpacing, and dotRadius within half the spacing.");
5668
5683
  let s = `lilt-grid-${w().replaceAll(":", "")}`, { snapshot: c, previousSnapshot: l, axis: u, transitionDuration: d, reducedMotion: f, gridGradientId: p, revealProgress: m } = G(), h = it().axis.y, g = m < 1, _ = Jt(g ? m * d : Infinity, 0, 240), v = f ? 0 : d / 1e3, y = new Map((l?.yTicks ?? []).map((e) => [e, l.yToPixel(e)]));
5669
5684
  if (t === "dots") return /* @__PURE__ */ j("g", {
@@ -5761,7 +5776,7 @@ function qr({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
5761
5776
  },
5762
5777
  transition: {
5763
5778
  duration: g ? 0 : v,
5764
- ease: Kr
5779
+ ease: Yr
5765
5780
  },
5766
5781
  vectorEffect: "non-scaling-stroke",
5767
5782
  x1: c.plot.left,
@@ -5772,16 +5787,16 @@ function qr({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
5772
5787
  }
5773
5788
  //#endregion
5774
5789
  //#region src/primitives/axis-segments.tsx
5775
- var Jr = 4, Yr = 5;
5776
- function Xr({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active: o }) {
5777
- let s = P([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) + Jr / 2, l = Math.max(0, Math.abs(t - e) - Jr);
5790
+ var Zr = 4, Qr = 5;
5791
+ function $r({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active: o }) {
5792
+ let s = P([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) + Zr / 2, l = Math.max(0, Math.abs(t - e) - Zr);
5778
5793
  return /* @__PURE__ */ A(N.rect, {
5779
5794
  className: "lilt-chart__axis-segment",
5780
- x: r ? n - Yr / 2 : c,
5781
- y: r ? c : n - Yr / 2,
5782
- width: r ? Yr : l,
5783
- height: r ? l : Yr,
5784
- rx: Yr / 2,
5795
+ x: r ? n - Qr / 2 : c,
5796
+ y: r ? c : n - Qr / 2,
5797
+ width: r ? Qr : l,
5798
+ height: r ? l : Qr,
5799
+ rx: Qr / 2,
5785
5800
  fill: i,
5786
5801
  style: {
5787
5802
  opacity: s,
@@ -5789,7 +5804,7 @@ function Xr({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active:
5789
5804
  }
5790
5805
  });
5791
5806
  }
5792
- function Zr({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a, opacity: o = 1 }) {
5807
+ function ei({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a, opacity: o = 1 }) {
5793
5808
  let s = `lilt-axis-scale-${w().replace(/:/g, "")}`, c = [...new Set(e.map((e) => Math.round(e * 2) / 2))].sort((e, t) => e - t);
5794
5809
  if (c.length < 2) return null;
5795
5810
  let l = n ? c.at(-1) : c[0], u = n ? c[0] : c.at(-1);
@@ -5813,7 +5828,7 @@ function Zr({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
5813
5828
  stopOpacity: e.opacity ?? 1
5814
5829
  }
5815
5830
  }, t))
5816
- }) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ A(Xr, {
5831
+ }) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ A($r, {
5817
5832
  from: c[o],
5818
5833
  to: e,
5819
5834
  cross: t,
@@ -5826,13 +5841,13 @@ function Zr({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
5826
5841
  }
5827
5842
  //#endregion
5828
5843
  //#region src/primitives/axes.tsx
5829
- var Qr = [
5844
+ var ti = [
5830
5845
  .22,
5831
5846
  1,
5832
5847
  .36,
5833
5848
  1
5834
- ], $r = 64, ei = 26, ti = 160, ni = 4, ri = 6;
5835
- function ii(e) {
5849
+ ], ni = 64, ri = 26, ii = 160, ai = 4, oi = 6;
5850
+ function si(e) {
5836
5851
  let { series: t, visibleSeries: n } = G();
5837
5852
  if (!e) return null;
5838
5853
  if (e !== !0) return e.map((e) => ({ color: e }));
@@ -5847,13 +5862,13 @@ function ii(e) {
5847
5862
  opacity: 1
5848
5863
  }];
5849
5864
  }
5850
- function ai(e, t, n) {
5865
+ function ci(e, t, n) {
5851
5866
  return t || n ? { duration: 0 } : {
5852
5867
  duration: Math.max(0, e) / 1e3,
5853
- ease: Qr
5868
+ ease: ti
5854
5869
  };
5855
5870
  }
5856
- function oi({ cursor: e, active: t, center: n, reach: r, children: i }) {
5871
+ function li({ cursor: e, active: t, center: n, reach: r, children: i }) {
5857
5872
  let a = P([e, t], ([e, t]) => at(Number(e) - n, r, Number(t))), o = P(a, (e) => e > .995 ? "none" : `blur(${((1 - e) * 1.2).toFixed(2)}px)`);
5858
5873
  return /* @__PURE__ */ A(N.g, {
5859
5874
  style: {
@@ -5863,15 +5878,15 @@ function oi({ cursor: e, active: t, center: n, reach: r, children: i }) {
5863
5878
  children: i
5864
5879
  });
5865
5880
  }
5866
- var si = {
5881
+ var ui = {
5867
5882
  ticks: 4,
5868
5883
  dots: 7
5869
5884
  };
5870
- function ci({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
5885
+ function di({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
5871
5886
  let o = P([i, a], ([e, n]) => {
5872
5887
  let i = Math.max(0, 1 - Math.abs(Number(e) - t) / r);
5873
5888
  return Number(n) * i * i * (3 - 2 * i);
5874
- }), s = P(o, (e) => .28 + e * .62), c = n + si[e], l = P(o, (e) => c + 4 + e * 5), u = P(o, (e) => 1.25 + e * 1.5);
5889
+ }), s = P(o, (e) => .28 + e * .62), c = n + ui[e], l = P(o, (e) => c + 4 + e * 5), u = P(o, (e) => 1.25 + e * 1.5);
5875
5890
  return e === "dots" ? /* @__PURE__ */ A(N.circle, {
5876
5891
  className: "lilt-chart__ruler-dot",
5877
5892
  cx: t,
@@ -5888,8 +5903,8 @@ function ci({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
5888
5903
  style: { opacity: s }
5889
5904
  });
5890
5905
  }
5891
- function li({ className: e, edgeInset: t, labels: n } = {}) {
5892
- let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = G(), u = it(), d = c === "initial" || c === "handoff", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g = ii(u.axis.xGradient), _ = m === "minimal" || m === "dots", v = m === "ruler" ? "ticks" : m === "dots" ? "dots" : null, y = (n ?? (_ ? "ends" : "fit")) === "ends" && p.length ? [.../* @__PURE__ */ new Set([p[0].x, p.at(-1).x])] : null, b = y ?? r.xTicks, x = y ? y.map((e) => ({ value: e })) : a.x, S = new Set(b), ee = Math.min(Math.max(0, t ?? 0), (r.plot.right - r.plot.left) / 4), C = Math.max(1, Math.ceil(p.length / ti)), w = p.filter((e, t) => t % C === 0), T = w.length > 1 ? (r.plot.right - r.plot.left) / (w.length - 1) : 40, E = d && !s ? Jt(l * o, 0, 320) : 1;
5906
+ function fi({ className: e, edgeInset: t, labels: n } = {}) {
5907
+ let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = G(), u = it(), d = c === "initial" || c === "handoff", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g = si(u.axis.xGradient), _ = m === "minimal" || m === "dots", v = m === "ruler" ? "ticks" : m === "dots" ? "dots" : null, y = (n ?? (_ ? "ends" : "fit")) === "ends" && p.length ? [.../* @__PURE__ */ new Set([p[0].x, p.at(-1).x])] : null, b = y ?? r.xTicks, x = y ? y.map((e) => ({ value: e })) : a.x, S = new Set(b), ee = Math.min(Math.max(0, t ?? 0), (r.plot.right - r.plot.left) / 4), C = Math.max(1, Math.ceil(p.length / ii)), w = p.filter((e, t) => t % C === 0), T = w.length > 1 ? (r.plot.right - r.plot.left) / (w.length - 1) : 40, E = d && !s ? Jt(l * o, 0, 320) : 1;
5893
5908
  return /* @__PURE__ */ j("g", {
5894
5909
  "aria-hidden": "true",
5895
5910
  className: [
@@ -5905,13 +5920,13 @@ function li({ className: e, edgeInset: t, labels: n } = {}) {
5905
5920
  y1: r.plot.bottom,
5906
5921
  y2: r.plot.bottom
5907
5922
  }),
5908
- h ? /* @__PURE__ */ A(Zr, {
5923
+ h ? /* @__PURE__ */ A(ei, {
5909
5924
  stops: [
5910
5925
  r.plot.left,
5911
5926
  ...b.map((e) => r.xToPixel(e)),
5912
5927
  r.plot.right
5913
5928
  ],
5914
- cross: r.plot.bottom + ri,
5929
+ cross: r.plot.bottom + oi,
5915
5930
  vertical: !1,
5916
5931
  gradient: g,
5917
5932
  cursor: u.pointerX,
@@ -5922,7 +5937,7 @@ function li({ className: e, edgeInset: t, labels: n } = {}) {
5922
5937
  className: "lilt-chart__ruler",
5923
5938
  "data-kind": v,
5924
5939
  opacity: E,
5925
- children: w.map((e) => /* @__PURE__ */ A(ci, {
5940
+ children: w.map((e) => /* @__PURE__ */ A(di, {
5926
5941
  kind: v,
5927
5942
  x: r.xToPixel(e.x),
5928
5943
  baseline: r.plot.bottom,
@@ -5932,12 +5947,12 @@ function li({ className: e, edgeInset: t, labels: n } = {}) {
5932
5947
  }, `ruler-${e.x}`))
5933
5948
  }) : null,
5934
5949
  x.map((e, t) => {
5935
- let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? Jt(l * o, 60 + Yt(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y = ni - u.overhang, C = _ && i - g < r.plot.left + y ? "start" : v && i + g > r.plot.right - y ? "end" : "middle", w = C === "start" ? ee : C === "end" ? -ee : 0, T = i + w + (C === "start" ? g : C === "end" ? -g : 0);
5936
- return /* @__PURE__ */ A(oi, {
5950
+ let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? Jt(l * o, 60 + Yt(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y = ai - u.overhang, C = _ && i - g < r.plot.left + y ? "start" : v && i + g > r.plot.right - y ? "end" : "middle", w = C === "start" ? ee : C === "end" ? -ee : 0, T = i + w + (C === "start" ? g : C === "end" ? -g : 0);
5951
+ return /* @__PURE__ */ A(li, {
5937
5952
  cursor: u.x,
5938
5953
  active: u.active,
5939
5954
  center: T,
5940
- reach: $r,
5955
+ reach: ni,
5941
5956
  children: /* @__PURE__ */ A(N.text, {
5942
5957
  animate: {
5943
5958
  opacity: n ? c : 0,
@@ -5952,7 +5967,7 @@ function li({ className: e, edgeInset: t, labels: n } = {}) {
5952
5967
  y: r.plot.bottom + 22 + 9
5953
5968
  },
5954
5969
  textAnchor: C,
5955
- transition: ai(o, s, d),
5970
+ transition: ci(o, s, d),
5956
5971
  children: h
5957
5972
  })
5958
5973
  }, `x-${e.value}`);
@@ -5960,8 +5975,8 @@ function li({ className: e, edgeInset: t, labels: n } = {}) {
5960
5975
  ]
5961
5976
  });
5962
5977
  }
5963
- function ui({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
5964
- let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = G(), u = it(), d = c === "initial" || c === "handoff", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g = ii(u.axis.yGradient), _ = m !== "classic" && !h, v = h ? 16 : 12, y = n === "secondary", b = r.secondary, x = y ? _ ? r.plot.right - u.inset : r.plot.right + v : _ ? r.plot.left + u.inset : r.plot.left - v, S = y === _ ? "end" : "start", ee = (e) => y && b ? b.format(e * b.factor) : r.formatY(e), C = _ ? -6 : 4, w = r.yTicks.length ? Math.min(...r.yTicks) : null;
5978
+ function pi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
5979
+ let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = G(), u = it(), d = c === "initial" || c === "handoff", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g = si(u.axis.yGradient), _ = m !== "classic" && !h, v = h ? 16 : 12, y = n === "secondary", b = r.secondary, x = y ? _ ? r.plot.right - u.inset : r.plot.right + v : _ ? r.plot.left + u.inset : r.plot.left - v, S = y === _ ? "end" : "start", ee = (e) => y && b ? b.format(e * b.factor) : r.formatY(e), C = _ ? -6 : 4, w = r.yTicks.length ? Math.min(...r.yTicks) : null;
5965
5980
  return y && !b ? null : /* @__PURE__ */ j("g", {
5966
5981
  "aria-hidden": "true",
5967
5982
  className: [
@@ -5971,13 +5986,13 @@ function ui({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
5971
5986
  ].filter(Boolean).join(" "),
5972
5987
  "data-inline": _ || void 0,
5973
5988
  "data-scale": y ? "secondary" : void 0,
5974
- children: [h && !y ? /* @__PURE__ */ A(Zr, {
5989
+ children: [h && !y ? /* @__PURE__ */ A(ei, {
5975
5990
  stops: [
5976
5991
  r.plot.top,
5977
5992
  ...r.yTicks.map((e) => r.yToPixel(e)),
5978
5993
  r.plot.bottom
5979
5994
  ],
5980
- cross: r.plot.left - ri,
5995
+ cross: r.plot.left - oi,
5981
5996
  vertical: !0,
5982
5997
  gradient: g,
5983
5998
  cursor: u.y,
@@ -5986,11 +6001,11 @@ function ui({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
5986
6001
  }) : null, t && m !== "minimal" && m !== "dots" && a.y.map((e, t) => {
5987
6002
  if (_ && e.value === w) return null;
5988
6003
  let n = p.has(e.value), i = n ? r.yToPixel(e.value) : f.get(e.value) ?? r.yToPixel(e.value), c = f.get(e.value) ?? i + 6, m = d && !s ? Jt(l * o, Yt(t, a.y.length, 80), 280) : 1;
5989
- return /* @__PURE__ */ A(oi, {
6004
+ return /* @__PURE__ */ A(li, {
5990
6005
  cursor: u.y,
5991
6006
  active: u.active,
5992
6007
  center: i,
5993
- reach: ei,
6008
+ reach: ri,
5994
6009
  children: /* @__PURE__ */ A(N.text, {
5995
6010
  animate: {
5996
6011
  opacity: n ? m : 0,
@@ -6005,7 +6020,7 @@ function ui({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6005
6020
  y: c + C + 6
6006
6021
  },
6007
6022
  textAnchor: S,
6008
- transition: ai(o, s, d),
6023
+ transition: ci(o, s, d),
6009
6024
  children: ee(e.value)
6010
6025
  })
6011
6026
  }, `y-${e.value}`);
@@ -6014,7 +6029,7 @@ function ui({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6014
6029
  }
6015
6030
  //#endregion
6016
6031
  //#region src/interaction/value-legend.tsx
6017
- function di({ items: e, variant: t = "cards", activeId: n, selectedId: r, onHoverIdChange: i, onSelectedIdChange: a, hiddenIds: o = [], onHiddenIdsChange: s, renderLabel: c, renderValue: l, renderSwatch: u, renderItem: d, "aria-label": f = "Values", className: p, style: m }) {
6032
+ function mi({ items: e, variant: t = "cards", activeId: n, selectedId: r, onHoverIdChange: i, onSelectedIdChange: a, hiddenIds: o = [], onHiddenIdsChange: s, renderLabel: c, renderValue: l, renderSwatch: u, renderItem: d, "aria-label": f = "Values", className: p, style: m }) {
6018
6033
  let h = !!s && e.length > 1, g = !!(i || a || h), _ = new Set(o), v = e.filter((e) => !_.has(e.id)).length, y = (e) => s?.(e), b = (e) => {
6019
6034
  _.has(e) ? y(o.filter((t) => t !== e)) : v > 1 && y([...o, e]);
6020
6035
  }, x = (t) => y(e.map((e) => e.id).filter((e) => e !== t));
@@ -6102,15 +6117,15 @@ function di({ items: e, variant: t = "cards", activeId: n, selectedId: r, onHove
6102
6117
  }
6103
6118
  //#endregion
6104
6119
  //#region src/primitives/annotations.tsx
6105
- function fi(e) {
6120
+ function hi(e) {
6106
6121
  return e instanceof Date ? e.getTime() : e;
6107
6122
  }
6108
- function pi({ items: e, onSelectionChange: t, className: n }) {
6123
+ function gi({ items: e, onSelectionChange: t, className: n }) {
6109
6124
  let { snapshot: r, reducedMotion: i } = G(), [a, o] = O(null), [s, c] = O(null);
6110
6125
  return /* @__PURE__ */ A("g", {
6111
6126
  className: ["lilt-chart__annotations", n].filter(Boolean).join(" "),
6112
6127
  children: e.map((e, n) => {
6113
- let l = fi(e.x);
6128
+ let l = hi(e.x);
6114
6129
  if (l < r.xDomain[0] || l > r.xDomain[1]) return null;
6115
6130
  let u = r.xToPixel(l), d = a === e.id || s === e.id;
6116
6131
  return /* @__PURE__ */ j("g", {
@@ -6196,10 +6211,10 @@ function pi({ items: e, onSelectionChange: t, className: n }) {
6196
6211
  })
6197
6212
  });
6198
6213
  }
6199
- function mi({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis: i = "x", className: a }) {
6214
+ function _i({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis: i = "x", className: a }) {
6200
6215
  let { snapshot: o } = G();
6201
6216
  if (i === "y") {
6202
- let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(fi(e), fi(t))), c = Math.min(i?.[1] ?? 0, Math.max(fi(e), fi(t)));
6217
+ let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(hi(e), hi(t))), c = Math.min(i?.[1] ?? 0, Math.max(hi(e), hi(t)));
6203
6218
  if (!i || s > c) return /* @__PURE__ */ A("g", {});
6204
6219
  let l = o.yToPixel(c), u = o.yToPixel(s);
6205
6220
  return /* @__PURE__ */ j("g", {
@@ -6221,7 +6236,7 @@ function mi({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
6221
6236
  }) : null]
6222
6237
  });
6223
6238
  }
6224
- let s = Math.min(fi(e), fi(t)), c = Math.max(fi(e), fi(t)), l = Math.max(o.xDomain[0], s), u = Math.min(o.xDomain[1], c);
6239
+ let s = Math.min(hi(e), hi(t)), c = Math.max(hi(e), hi(t)), l = Math.max(o.xDomain[0], s), u = Math.min(o.xDomain[1], c);
6225
6240
  if (l > u) return /* @__PURE__ */ A("g", {});
6226
6241
  let d = s === -Infinity ? o.plot.left : o.xToPixel(l), f = c === Infinity ? o.plot.right : o.xToPixel(u);
6227
6242
  return /* @__PURE__ */ j("g", {
@@ -6244,7 +6259,7 @@ function mi({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
6244
6259
  }
6245
6260
  //#endregion
6246
6261
  //#region src/primitives/reference-line.tsx
6247
- function hi({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }) {
6262
+ function vi({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }) {
6248
6263
  let { snapshot: i } = G(), a = i.yDomain;
6249
6264
  if (!a || !Number.isFinite(e) || e < a[0] || e > a[1]) return null;
6250
6265
  let o = i.yToPixel(e), { left: s, right: c, top: l } = i.plot, u = o - 6 < l + 10 ? o + 14 : o - 6;
@@ -6268,12 +6283,12 @@ function hi({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }
6268
6283
  }
6269
6284
  //#endregion
6270
6285
  //#region src/cards/keys.ts
6271
- var gi = new Intl.DateTimeFormat("en-US", {
6286
+ var yi = new Intl.DateTimeFormat("en-US", {
6272
6287
  month: "short",
6273
6288
  day: "numeric",
6274
6289
  timeZone: "UTC"
6275
- }), _i = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
6276
- function vi(e, t, n, r) {
6290
+ }), bi = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
6291
+ function xi(e, t, n, r) {
6277
6292
  let i = (e) => e[t], a = e.length > 0 ? i(e[0]) : void 0, o = n ?? (typeof a == "string" ? "category" : a instanceof Date ? "time" : "number");
6278
6293
  if (o === "category") {
6279
6294
  let t = /* @__PURE__ */ new Map();
@@ -6293,16 +6308,16 @@ function vi(e, t, n, r) {
6293
6308
  let t = i(e);
6294
6309
  return t instanceof Date ? t.getTime() : Number(t);
6295
6310
  },
6296
- format: (e) => r ? r(new Date(e)) : gi.format(e)
6311
+ format: (e) => r ? r(new Date(e)) : yi.format(e)
6297
6312
  } : {
6298
6313
  kind: o,
6299
6314
  position: (e) => Number(i(e)),
6300
- format: (e) => r ? r(e) : _i.format(e)
6315
+ format: (e) => r ? r(e) : bi.format(e)
6301
6316
  };
6302
6317
  }
6303
6318
  //#endregion
6304
6319
  //#region src/cards/format.ts
6305
- function yi(e, t) {
6320
+ function Si(e, t) {
6306
6321
  let n = [];
6307
6322
  for (let r of e) {
6308
6323
  let e = r[t];
@@ -6310,14 +6325,14 @@ function yi(e, t) {
6310
6325
  }
6311
6326
  return n;
6312
6327
  }
6313
- function bi(e, t) {
6328
+ function Ci(e, t) {
6314
6329
  if (!e.length) return null;
6315
6330
  if (t === "last") return e.at(-1);
6316
6331
  if (t === "max") return Math.max(...e);
6317
6332
  let n = e.reduce((e, t) => e + t, 0);
6318
6333
  return t === "mean" ? n / e.length : n;
6319
6334
  }
6320
- function xi(e, t) {
6335
+ function wi(e, t) {
6321
6336
  let n = new Intl.NumberFormat(e, {
6322
6337
  maximumFractionDigits: Math.max(1, t?.minimumFractionDigits ?? 0),
6323
6338
  minimumFractionDigits: 0,
@@ -6334,8 +6349,8 @@ function xi(e, t) {
6334
6349
  plain: g(i)
6335
6350
  };
6336
6351
  }
6337
- function Si({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisValue: r }) {
6338
- let i = JSON.stringify(e ?? null), a = E(() => xi(t, e), [t, i]), o = n ?? a.full, s = r ?? a.compact, c = D({
6352
+ function Ti({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisValue: r }) {
6353
+ let i = JSON.stringify(e ?? null), a = E(() => wi(t, e), [t, i]), o = n ?? a.full, s = r ?? a.compact, c = D({
6339
6354
  value: o,
6340
6355
  axis: s
6341
6356
  });
@@ -6352,12 +6367,12 @@ function Si({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisVal
6352
6367
  key: `${t}|${i}`
6353
6368
  };
6354
6369
  }
6355
- function Ci(e) {
6370
+ function Ei(e) {
6356
6371
  return (t) => `${t < 0 ? "−" : "+"}${e(Math.abs(t))}`;
6357
6372
  }
6358
6373
  //#endregion
6359
6374
  //#region src/engine/composition.ts
6360
- function wi(e) {
6375
+ function Di(e) {
6361
6376
  if (!e.length) return [];
6362
6377
  if (e.some((e) => typeof e != "number" || !Number.isFinite(e) || e < 0)) return e.map(() => null);
6363
6378
  let t = e, n = t.reduce((e, t) => Math.max(e, t), 0);
@@ -6367,8 +6382,8 @@ function wi(e) {
6367
6382
  }
6368
6383
  //#endregion
6369
6384
  //#region src/watch/normal-layer.tsx
6370
- var Ti = "normalLower", Ei = "normalUpper", Di = I().x((e) => e.x).y0((e) => e.lower).y1((e) => e.upper).curve(le);
6371
- function Oi({ series: e, flagged: t, part: n }) {
6385
+ var Oi = "normalLower", ki = "normalUpper", Ai = I().x((e) => e.x).y0((e) => e.lower).y1((e) => e.upper).curve(le);
6386
+ function ji({ series: e, flagged: t, part: n }) {
6372
6387
  let { snapshot: r, clipId: i, revealProgress: a, visibleSeries: o } = G(), s = r.yToPixelFor(e), [c, l] = r.xDomain, u = o.includes(e), d = r.data.rows;
6373
6388
  if (n === "band") {
6374
6389
  let t = [], n = [];
@@ -6388,7 +6403,7 @@ function Oi({ series: e, flagged: t, part: n }) {
6388
6403
  style: { opacity: +!!u },
6389
6404
  children: t.map((e, t) => /* @__PURE__ */ A("path", {
6390
6405
  className: "lilt-chart__normal-band",
6391
- d: Di(ki(e)) ?? ""
6406
+ d: Ai(Mi(e)) ?? ""
6392
6407
  }, t))
6393
6408
  });
6394
6409
  }
@@ -6446,7 +6461,7 @@ function Oi({ series: e, flagged: t, part: n }) {
6446
6461
  ]
6447
6462
  });
6448
6463
  }
6449
- function ki(e) {
6464
+ function Mi(e) {
6450
6465
  return e.map((t, n) => {
6451
6466
  let r = e.slice(Math.max(0, n - 1), n + 2);
6452
6467
  return {
@@ -6458,18 +6473,18 @@ function ki(e) {
6458
6473
  }
6459
6474
  //#endregion
6460
6475
  //#region src/cards/cartesian-card.tsx
6461
- function Ai(e) {
6476
+ function Ni(e) {
6462
6477
  return e === !0 ? "sum" : e ?? !1;
6463
6478
  }
6464
- var ji = [], Mi = (e) => e.acceptedRevision;
6465
- function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggregate: y = "sum", headlineSeries: b, delta: x, deltaTone: S, range: w, ranges: T, defaultRange: te, tiles: M = !0, height: ne = 240, valueFormat: N, locale: re = "en-US", formatValue: ie, formatAxisValue: ae, formatX: P, xType: oe, compare: se = !1, target: F, forecast: I, sync: ce, axis: le = "minimal", hover: ue = "pills", hoverStyle: de = "soft", background: fe = "dots", spotlight: pe = !0, surface: L = "elevated", badge: me, numberStyle: he, palette: ge, bleed: _e = e.kind !== "bar" && e.kind !== "marks", axisInset: ve, pillSeries: ye = "nearest", pillValue: be = "series", pillPosition: Se = "auto", tooltipIndicator: Ce = "square", loading: we = !1, motion: Te, className: Ee, style: De, panes: Oe, live: ke = !1, heading: Ae, restCaption: je, normal: Me, onNormalChange: Ne }) {
6466
- let [Pe, Fe] = O(te ?? T?.[0]?.id), Ie = T?.find((e) => e.id === Pe) ?? T?.[0], R = Ie?.data ?? r ?? ji, Le = Ie ? Ie.delta : x, Re = e.kind === "line" || e.kind === "marks" ? !1 : e.stack, ze = Re !== !1, Be = Re === "percent", Ve = Be ? "last" : y, He = _e && e.kind !== "bar" && e.kind !== "marks", Ue = E(() => {
6479
+ var Pi = [], Fi = (e) => e.acceptedRevision;
6480
+ function Ii({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggregate: y = "sum", headlineSeries: b, delta: x, deltaTone: S, range: w, ranges: T, defaultRange: te, tiles: M = !0, height: ne = 240, valueFormat: N, locale: re = "en-US", formatValue: ie, formatAxisValue: ae, formatX: P, xType: oe, compare: se = !1, target: F, forecast: I, sync: ce, axis: le = "minimal", hover: ue = "pills", hoverStyle: de = "soft", background: fe = "dots", spotlight: pe = !0, surface: L = "elevated", badge: me, numberStyle: he, palette: ge, bleed: _e = e.kind !== "bar" && e.kind !== "marks", axisInset: ve, pillSeries: ye = "nearest", pillValue: be = "series", pillPosition: Se = "auto", tooltipIndicator: Ce = "square", loading: we = !1, motion: Te, className: Ee, style: De, panes: Oe, live: ke = !1, heading: Ae, restCaption: je, normal: Me, onNormalChange: Ne }) {
6481
+ let [Pe, Fe] = O(te ?? T?.[0]?.id), Ie = T?.find((e) => e.id === Pe) ?? T?.[0], R = Ie?.data ?? r ?? Pi, Le = Ie ? Ie.delta : x, Re = e.kind === "line" || e.kind === "marks" ? !1 : e.stack, ze = Re !== !1, Be = Re === "percent", Ve = Be ? "last" : y, He = _e && e.kind !== "bar" && e.kind !== "marks", Ue = E(() => {
6467
6482
  let e = new Intl.NumberFormat(re, {
6468
6483
  style: "percent",
6469
6484
  maximumFractionDigits: 1
6470
6485
  });
6471
6486
  return (t) => e.format(t / 100);
6472
- }, [re]), We = Si({
6487
+ }, [re]), We = Ti({
6473
6488
  valueFormat: N,
6474
6489
  locale: re,
6475
6490
  formatValue: Be ? Ue : ie,
@@ -6477,16 +6492,16 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6477
6492
  }), Ge = We.value, Ke = We.key, z = JSON.stringify(e), qe = _.map((e) => `${e.key}|${e.label}|${e.color}|${e.dashed}|${e.as}|${e.scale}|${JSON.stringify(e.valueFormat ?? null)}`).join(), B = new Set(_.filter((e) => e.as === "line" || e.dashed).map((e) => e.key)), V = E(() => {
6478
6493
  if (!Be) return null;
6479
6494
  let e = _.filter((e) => !B.has(e.key));
6480
- return new Map(R.map((t) => [t, Object.fromEntries(wi(e.map((e) => t[e.key])).map((t, n) => [e[n].key, t]))]));
6495
+ return new Map(R.map((t) => [t, Object.fromEntries(Di(e.map((e) => t[e.key])).map((t, n) => [e[n].key, t]))]));
6481
6496
  }, [
6482
6497
  Be,
6483
6498
  R,
6484
6499
  qe
6485
- ]), Je = E(() => new Map(_.flatMap((e) => e.valueFormat ? [[e.key, xi(re, e.valueFormat)]] : [])), [qe, re]), H = (e) => Je.get(e)?.full ?? Ge, U = E(() => vi(R, g, oe, P), [
6500
+ ]), Je = E(() => new Map(_.flatMap((e) => e.valueFormat ? [[e.key, wi(re, e.valueFormat)]] : [])), [qe, re]), H = (e) => Je.get(e)?.full ?? Ge, U = E(() => xi(R, g, oe, P), [
6486
6501
  R,
6487
6502
  g,
6488
6503
  oe
6489
- ]), Ye = I?.from instanceof Date ? I.from.getTime() : I?.from, Xe = E(() => Ye === void 0 ? null : Li(R, g, U, Ye), [
6504
+ ]), Ye = I?.from instanceof Date ? I.from.getTime() : I?.from, Xe = E(() => Ye === void 0 ? null : Bi(R, g, U, Ye), [
6490
6505
  R,
6491
6506
  g,
6492
6507
  U,
@@ -6495,9 +6510,9 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6495
6510
  R,
6496
6511
  Xe,
6497
6512
  U
6498
- ]), Qe = I?.lower && I.upper && !ze && e.kind !== "bar" && e.kind !== "marks" ? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, tt = Me && !ze && (e.kind === "area" || e.kind === "line") ? Me.series ?? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, nt = Me ? Pi(Me) : "", rt = E(() => {
6513
+ ]), Qe = I?.lower && I.upper && !ze && e.kind !== "bar" && e.kind !== "marks" ? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, tt = Me && !ze && (e.kind === "area" || e.kind === "line") ? Me.series ?? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, nt = Me ? Li(Me) : "", rt = E(() => {
6499
6514
  if (!Me || tt === void 0) return null;
6500
- let { when: e, history: t = ji, ...n } = Me, r = t.length, i = r ? [...t, ...R] : R;
6515
+ let { when: e, history: t = Pi, ...n } = Me, r = t.length, i = r ? [...t, ...R] : R;
6501
6516
  return {
6502
6517
  combined: i,
6503
6518
  all: p({
@@ -6583,19 +6598,19 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6583
6598
  ...Qe === t.key && I?.lower && I.upper ? {
6584
6599
  lower: {
6585
6600
  label: `${I.label ?? "Forecast"} low`,
6586
- accessor: (e) => Ii(e, I.lower)
6601
+ accessor: (e) => zi(e, I.lower)
6587
6602
  },
6588
6603
  upper: {
6589
6604
  label: `${I.label ?? "Forecast"} high`,
6590
- accessor: (e) => Ii(e, I.upper)
6605
+ accessor: (e) => zi(e, I.upper)
6591
6606
  }
6592
6607
  } : {},
6593
6608
  ...tt === t.key && at ? {
6594
- [Ti]: {
6609
+ [Oi]: {
6595
6610
  label: "Normal low",
6596
6611
  accessor: (e) => at.get(e)?.lower ?? null
6597
6612
  },
6598
- [Ei]: {
6613
+ [ki]: {
6599
6614
  label: "Normal high",
6600
6615
  accessor: (e) => at.get(e)?.upper ?? null
6601
6616
  }
@@ -6690,13 +6705,13 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6690
6705
  series: vt,
6691
6706
  status: we ? "loading" : "ready"
6692
6707
  }), Mt = et(jt, (e) => e.inspection);
6693
- Rn(ce, jt.getController(), R, g, U, {
6708
+ Vn(ce, jt.getController(), R, g, U, {
6694
6709
  label: t,
6695
6710
  release: jt.actions.release
6696
- }), et(jt, Mi);
6711
+ }), et(jt, Fi);
6697
6712
  let Nt = new Set(jt.series.map((e) => e.id)), [Pt, Ft] = O(null), [It, Lt] = O([]), Rt = new Set(It), G = E(() => vt.map((e, t) => ({
6698
6713
  id: e.id,
6699
- total: V ? Ze.length && !B.has(e.id) ? V.get(Ze.at(-1))?.[e.id] ?? null : null : bi(yi(Ze, e.id), _[t]?.aggregate ?? Ve)
6714
+ total: V ? Ze.length && !B.has(e.id) ? V.get(Ze.at(-1))?.[e.id] ?? null : null : Ci(Si(Ze, e.id), _[t]?.aggregate ?? Ve)
6700
6715
  })), [
6701
6716
  vt,
6702
6717
  Ze,
@@ -6711,13 +6726,13 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6711
6726
  b,
6712
6727
  ze,
6713
6728
  It
6714
- ]), Vt = Be ? G.some((e) => zt.has(e.id) && e.total === null) || !Ze.length ? null : G.reduce((e, t) => e + (zt.has(t.id) ? t.total ?? 0 : 0), 0) : Ie?.headline ?? v ?? (zt.size === 0 ? null : Ve === "sum" ? G.reduce((e, t) => e + (zt.has(t.id) ? t.total ?? 0 : 0), 0) : bi(Bt, Ve) ?? 0), K = ue === "tooltip" ? null : Mt, Ht = K ? new Map(K.series.map((e) => [e.id, e.value])) : null, Ut = et(jt, (e) => e.comparison), Wt = se === "badge", Gt = !Wt && !Mt && Ut?.phase === "complete" ? Ut : null, Kt = Wt ? Ut : null, qt = Gt ? new Map(Gt.series.map((e) => [e.id, e.absoluteChange])) : null, Jt = (e) => e.series.filter((e) => zt.has(e.id)).reduce((e, t) => ({
6729
+ ]), Vt = Be ? G.some((e) => zt.has(e.id) && e.total === null) || !Ze.length ? null : G.reduce((e, t) => e + (zt.has(t.id) ? t.total ?? 0 : 0), 0) : Ie?.headline ?? v ?? (zt.size === 0 ? null : Ve === "sum" ? G.reduce((e, t) => e + (zt.has(t.id) ? t.total ?? 0 : 0), 0) : Ci(Bt, Ve) ?? 0), K = ue === "tooltip" ? null : Mt, Ht = K ? new Map(K.series.map((e) => [e.id, e.value])) : null, Ut = et(jt, (e) => e.comparison), Wt = se === "badge", Gt = !Wt && !Mt && Ut?.phase === "complete" ? Ut : null, Kt = Wt ? Ut : null, qt = Gt ? new Map(Gt.series.map((e) => [e.id, e.absoluteChange])) : null, Jt = (e) => e.series.filter((e) => zt.has(e.id)).reduce((e, t) => ({
6715
6730
  start: e.start + (t.startValue ?? 0),
6716
6731
  end: e.end + (t.endValue ?? 0)
6717
6732
  }), {
6718
6733
  start: 0,
6719
6734
  end: 0
6720
- }), Yt = Gt ? Jt(Gt) : void 0, Xt = Kt ? Jt(Kt) : void 0, Zt = Be ? (e) => `${new Intl.NumberFormat(re, { maximumFractionDigits: 1 }).format(e)} pp` : Ge, Qt = Ci(Zt), $t = Dt === null ? null : Bt.filter((e) => S === "inverse" ? e <= Dt : e >= Dt).length, en = je && R.length ? je(R) : null, q = K && e.kind === "marks" ? e.describe?.(K) ?? null : null, tn = K && it ? it[K.sourceIndex] ?? null : null, nn = tn?.severity ? ft(K?.sourceIndex) ?? ut(tn.flags) : null, rn = !!(Xe !== null && K?.series.some((e) => e.status === "forecast")), an = zt.size === 0 || Be && Gt?.series.some((e) => zt.has(e.id) && (e.startValue === null || e.endValue === null)) ? null : Ht ? Be && [...zt].some((e) => Ht.get(e) == null) ? null : [...Ht].reduce((e, [t, n]) => e + (zt.has(t) ? n ?? 0 : 0), 0) : Yt ? Yt.end - Yt.start : Vt, on = (e) => {
6735
+ }), Yt = Gt ? Jt(Gt) : void 0, Xt = Kt ? Jt(Kt) : void 0, Zt = Be ? (e) => `${new Intl.NumberFormat(re, { maximumFractionDigits: 1 }).format(e)} pp` : Ge, Qt = Ei(Zt), $t = Dt === null ? null : Bt.filter((e) => S === "inverse" ? e <= Dt : e >= Dt).length, en = je && R.length ? je(R) : null, q = K && e.kind === "marks" ? e.describe?.(K) ?? null : null, tn = K && it ? it[K.sourceIndex] ?? null : null, nn = tn?.severity ? ft(K?.sourceIndex) ?? ut(tn.flags) : null, rn = !!(Xe !== null && K?.series.some((e) => e.status === "forecast")), an = zt.size === 0 || Be && Gt?.series.some((e) => zt.has(e.id) && (e.startValue === null || e.endValue === null)) ? null : Ht ? Be && [...zt].some((e) => Ht.get(e) == null) ? null : [...Ht].reduce((e, [t, n]) => e + (zt.has(t) ? n ?? 0 : 0), 0) : Yt ? Yt.end - Yt.start : Vt, on = (e) => {
6721
6736
  Ft(e), jt.actions.focusSeries(e);
6722
6737
  }, sn = (e) => {
6723
6738
  Lt(e), on(null), jt.actions.setVisibleSeries(vt.map((e) => e.id).filter((t) => !e.includes(t)));
@@ -6726,56 +6741,56 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6726
6741
  right: ln && dn ? un : fn,
6727
6742
  bottom: e.kind === "marks" && e.xAxis === !1 ? 6 : 28,
6728
6743
  left: ln ? un : fn
6729
- }, mn = ve ?? (_e ? 20 : 0), hn = vt.filter((e) => !B.has(e.id)).map((e) => e.id), gn = vt.filter((e) => Nt.has(e.id)), _n = Ze.length ? U.position(Ze.at(-1)) : null, vn = R.length ? U.position(R.at(-1)) : null, yn = Xe === null || vn === null || Xe > vn ? null : _n === null ? Xe : e.kind === "bar" ? (_n + Ri(R, U, Xe)) / 2 : _n, bn = /* @__PURE__ */ j(k, { children: [
6730
- /* @__PURE__ */ A(qr, { pattern: "lines" }),
6731
- yn === null ? null : /* @__PURE__ */ A(mi, {
6744
+ }, mn = ve ?? (_e ? 20 : 0), hn = vt.filter((e) => !B.has(e.id)).map((e) => e.id), gn = vt.filter((e) => Nt.has(e.id)), _n = Ze.length ? U.position(Ze.at(-1)) : null, vn = R.length ? U.position(R.at(-1)) : null, yn = Xe === null || vn === null || Xe > vn ? null : _n === null ? Xe : e.kind === "bar" ? (_n + Vi(R, U, Xe)) / 2 : _n, bn = /* @__PURE__ */ j(k, { children: [
6745
+ /* @__PURE__ */ A(Xr, { pattern: "lines" }),
6746
+ yn === null ? null : /* @__PURE__ */ A(_i, {
6732
6747
  from: yn,
6733
6748
  to: Infinity,
6734
6749
  label: I?.label ?? "Forecast",
6735
6750
  color: "var(--lilt-muted)",
6736
6751
  className: "lilt-card__forecast"
6737
6752
  }),
6738
- Qe && Nt.has(Qe) ? /* @__PURE__ */ A(Hr, {
6753
+ Qe && Nt.has(Qe) ? /* @__PURE__ */ A(Gr, {
6739
6754
  series: Qe,
6740
6755
  lower: "lower",
6741
6756
  upper: "upper"
6742
6757
  }) : null,
6743
- tt && Nt.has(tt) ? /* @__PURE__ */ A(Oi, {
6758
+ tt && Nt.has(tt) ? /* @__PURE__ */ A(ji, {
6744
6759
  series: tt,
6745
6760
  flagged: ct,
6746
6761
  part: "band"
6747
6762
  }) : null,
6748
- e.kind === "area" ? gn.map((e) => B.has(e.id) ? null : /* @__PURE__ */ A(Er, {
6763
+ e.kind === "area" ? gn.map((e) => B.has(e.id) ? null : /* @__PURE__ */ A(kr, {
6749
6764
  model: jt,
6750
6765
  series: e.id
6751
6766
  }, `area-${e.id}`)) : null,
6752
- e.kind === "bar" ? hn.filter((e) => Nt.has(e)).map((e) => /* @__PURE__ */ A(Gr, {
6767
+ e.kind === "bar" ? hn.filter((e) => Nt.has(e)).map((e) => /* @__PURE__ */ A(Jr, {
6753
6768
  model: jt,
6754
6769
  series: e
6755
6770
  }, `bar-${e}`)) : null,
6756
6771
  e.kind === "marks" ? e.draw(hn.filter((e) => Nt.has(e))) : null,
6757
- gn.map((t) => (e.kind === "bar" || e.kind === "marks") && !B.has(t.id) ? null : /* @__PURE__ */ A(Wr, {
6772
+ gn.map((t) => (e.kind === "bar" || e.kind === "marks") && !B.has(t.id) ? null : /* @__PURE__ */ A(qr, {
6758
6773
  model: jt,
6759
6774
  series: t.id
6760
6775
  }, `line-${t.id}`)),
6761
- tt && Nt.has(tt) ? /* @__PURE__ */ A(Oi, {
6776
+ tt && Nt.has(tt) ? /* @__PURE__ */ A(ji, {
6762
6777
  series: tt,
6763
6778
  flagged: ct,
6764
6779
  part: "flags"
6765
6780
  }) : null,
6766
- Ot.map((e) => /* @__PURE__ */ A(hi, {
6781
+ Ot.map((e) => /* @__PURE__ */ A(vi, {
6767
6782
  value: e.value,
6768
6783
  label: `${e.label} ${We.axis(e.value)}`,
6769
6784
  className: "lilt-card__limit"
6770
6785
  }, e.id)),
6771
- Dt === null ? null : /* @__PURE__ */ A(hi, {
6786
+ Dt === null ? null : /* @__PURE__ */ A(vi, {
6772
6787
  value: Dt,
6773
6788
  label: `${Et.label} ${We.axis(Dt)}`,
6774
6789
  className: "lilt-card__target"
6775
6790
  }),
6776
- e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ A(li, { labels: e.kind === "bar" || e.kind === "marks" ? "fit" : void 0 }) : null,
6777
- /* @__PURE__ */ A(ui, {}),
6778
- dn ? /* @__PURE__ */ A(ui, { scale: "secondary" }) : null
6791
+ e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ A(fi, { labels: e.kind === "bar" || e.kind === "marks" ? "fit" : void 0 }) : null,
6792
+ /* @__PURE__ */ A(pi, {}),
6793
+ dn ? /* @__PURE__ */ A(pi, { scale: "secondary" }) : null
6779
6794
  ] }), xn = {
6780
6795
  model: jt,
6781
6796
  height: ne,
@@ -6794,7 +6809,7 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6794
6809
  indicator: Ce,
6795
6810
  adaptive: !1
6796
6811
  } : void 0
6797
- }, J = ze && hn.length ? { series: hn } : void 0, Sn = /* @__PURE__ */ A(gr, {
6812
+ }, J = ze && hn.length ? { series: hn } : void 0, Sn = /* @__PURE__ */ A(yr, {
6798
6813
  ...xn,
6799
6814
  bars: e.kind === "bar" ? ze ? {
6800
6815
  segmentGap: 2,
@@ -6883,7 +6898,7 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6883
6898
  Dt !== null && Dt !== 0 && an !== null ? /* @__PURE__ */ A(a, {
6884
6899
  value: an / Dt - 1,
6885
6900
  tone: S,
6886
- format: Fi
6901
+ format: Ri
6887
6902
  }) : null,
6888
6903
  /* @__PURE__ */ j(i, { children: [
6889
6904
  K.formattedX,
@@ -6954,7 +6969,7 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6954
6969
  formatValue: Ge,
6955
6970
  formatAxis: We.axis
6956
6971
  }) : null,
6957
- M ? /* @__PURE__ */ A(di, {
6972
+ M ? /* @__PURE__ */ A(mi, {
6958
6973
  className: "lilt-card__tiles",
6959
6974
  "aria-label": `${t} by series`,
6960
6975
  activeId: Pt ?? Mt?.activeSeriesId ?? null,
@@ -6969,22 +6984,22 @@ function Ni({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
6969
6984
  label: e.label,
6970
6985
  color: e.color,
6971
6986
  value: t,
6972
- formattedValue: t === null ? "—" : qt ? Ci(Be ? Zt : H(e.id))(t) : H(e.id)(t)
6987
+ formattedValue: t === null ? "—" : qt ? Ei(Be ? Zt : H(e.id))(t) : H(e.id)(t)
6973
6988
  };
6974
6989
  })
6975
6990
  }) : null
6976
6991
  ]
6977
6992
  });
6978
6993
  }
6979
- function Pi({ history: e, ...t }) {
6994
+ function Li({ history: e, ...t }) {
6980
6995
  return JSON.stringify(t, (e, t) => typeof t == "function" ? String(t) : t);
6981
6996
  }
6982
- var Fi = (e) => `${e >= 0 ? "+" : "−"}${Math.abs(e * 100).toFixed(1)}% vs target`;
6983
- function Ii(e, t) {
6997
+ var Ri = (e) => `${e >= 0 ? "+" : "−"}${Math.abs(e * 100).toFixed(1)}% vs target`;
6998
+ function zi(e, t) {
6984
6999
  let n = e[t];
6985
7000
  return typeof n == "number" && Number.isFinite(n) ? n : null;
6986
7001
  }
6987
- function Li(e, t, n, r) {
7002
+ function Bi(e, t, n, r) {
6988
7003
  if (n.kind === "category") {
6989
7004
  let n = e.findIndex((e) => String(e[t]) === String(r));
6990
7005
  return n < 0 ? null : n;
@@ -6992,7 +7007,7 @@ function Li(e, t, n, r) {
6992
7007
  let i = Number(r);
6993
7008
  return Number.isFinite(i) ? i : null;
6994
7009
  }
6995
- function Ri(e, t, n) {
7010
+ function Vi(e, t, n) {
6996
7011
  let r = Infinity;
6997
7012
  for (let i of e) {
6998
7013
  let e = t.position(i);
@@ -7001,4 +7016,4 @@ function Ri(e, t, n) {
7001
7016
  return Number.isFinite(r) ? r : n;
7002
7017
  }
7003
7018
  //#endregion
7004
- export { gr as A, yt as B, zr as C, Ar as D, Fr as E, Rn as F, $e as G, tt as H, Y as I, xe as J, Ze as K, rn as L, X as M, mr as N, Rr as O, lr as P, me as Q, Yt as R, Or as S, jr as T, et as U, St as V, Qe as W, Te as X, De as Y, Ee as Z, Wr as _, bi as a, Vr as b, vi as c, mi as d, di as f, Gr as g, qr as h, Ci as i, dr as j, Er as k, hi as l, ui as m, Ai as n, Si as o, li as p, Me as q, xi as r, yi as s, Ni as t, pi as u, Hr as v, Pr as w, Mr as x, Br as y, G as z };
7019
+ export { yr as A, yt as B, Hr as C, Nr as D, Rr as E, Vn as F, $e as G, tt as H, zn as I, xe as J, Ze as K, rn as L, _r as M, gr as N, Vr as O, fr as P, me as Q, Yt as R, jr as S, Pr as T, et as U, St as V, Qe as W, Te as X, De as Y, Ee as Z, qr as _, Ci as a, Wr as b, xi as c, _i as d, mi as f, Jr as g, Xr as h, Ei as i, mr as j, kr as k, vi as l, pi as m, Ni as n, Ti as o, fi as p, Me as q, wi as r, Si as s, Ii as t, gi as u, Gr as v, Lr as w, Fr as x, Ur as y, G as z };