@lilt-ui/charts 0.2.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +45 -0
  3. package/dist/cards/area-chart-card.d.ts +10 -1
  4. package/dist/cards/cartesian-card.d.ts +35 -6
  5. package/dist/cards/chart-card.d.ts +12 -1
  6. package/dist/cards/line-chart-card.d.ts +10 -1
  7. package/dist/{cartesian-card-BDZs0v6E.js → cartesian-card-Cj1o38DC.js} +2771 -2987
  8. package/dist/chart.d.ts +1 -1
  9. package/dist/finance/cards/depth-chart-card.d.ts +2 -2
  10. package/dist/finance.js +220 -219
  11. package/dist/index.d.ts +5 -4
  12. package/dist/index.js +1792 -1628
  13. package/dist/interaction/axis-cursor.d.ts +12 -2
  14. package/dist/interaction/chart-sync.d.ts +11 -1
  15. package/dist/interaction/inspection-layer.d.ts +6 -0
  16. package/dist/interaction/pin-glyphs.d.ts +8 -0
  17. package/dist/interaction/pin-marker.d.ts +9 -1
  18. package/dist/interaction/use-category-state.d.ts +2 -0
  19. package/dist/interaction/use-touch-glide.d.ts +26 -0
  20. package/dist/model/cartesian-model.d.ts +3 -3
  21. package/dist/motion/use-glide.d.ts +7 -3
  22. package/dist/primitives/axis-segments.d.ts +23 -0
  23. package/dist/report-context-Cz0AYdV2.js +895 -0
  24. package/dist/styles.css +1 -1
  25. package/dist/types.d.ts +34 -3
  26. package/dist/watch/board/board-state.d.ts +74 -0
  27. package/dist/watch/board/board-toast.d.ts +19 -0
  28. package/dist/watch/board/chart-board.d.ts +97 -0
  29. package/dist/watch/board/report-context.d.ts +3 -0
  30. package/dist/watch/engine/describe.d.ts +9 -0
  31. package/dist/watch/engine/explain.d.ts +48 -0
  32. package/dist/watch/engine/normal.d.ts +114 -0
  33. package/dist/watch/engine/robust.d.ts +7 -0
  34. package/dist/watch/engine/rules.d.ts +22 -0
  35. package/dist/watch/engine/status.d.ts +39 -0
  36. package/dist/watch/index.d.ts +14 -0
  37. package/dist/watch/normal-layer.d.ts +18 -0
  38. package/dist/watch.d.ts +2 -0
  39. package/dist/watch.js +628 -0
  40. package/package.json +6 -1
package/dist/finance.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { A as e, B as t, C as n, D as r, E as i, I as a, J as o, N as s, O as c, R as l, S as u, T as d, V as f, Z as p, b as m, d as h, g, h as _, i as v, k as y, ot as b, p as x, r as S, t as C, u as w, v as T, w as E, z as D } from "./cartesian-card-BDZs0v6E.js";
2
+ import { A as e, D as t, J as n, M as r, _ as i, b as a, d as o, g as s, h as c, i as l, j as u, k as d, l as f, m as p, p as m, r as h, t as g, v as _, w as v, x as y, y as b, z as x } from "./cartesian-card-Cj1o38DC.js";
3
+ import { S, d as C, g as w, h as T, p as E, u as D } from "./report-context-Cz0AYdV2.js";
3
4
  import { useEffect as O, useMemo as k, useRef as A, useState as j } from "react";
4
5
  import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
5
6
  //#region src/finance/candle-geometry.ts
@@ -25,46 +26,46 @@ function z(e, t, n) {
25
26
  if (e.high < i || e.low > a) throw Error(`Lilt Candles on series "${t}" expects low ≤ open, close ≤ high at row ${r.sourceIndex + 1}.`);
26
27
  }
27
28
  }
28
- function B(e, t, n, r) {
29
- let i = Math.max(1, n.columnWidth), o = i / 2, s = L(e), c = L(n.y(t.high)), l = L(n.y(t.low));
30
- if (r === "ohlc") {
31
- let r = L(n.y(t.open)), i = L(n.y(t.close)), a = L(Math.max(2, o));
29
+ function B(e, n, r, i) {
30
+ let a = Math.max(1, r.columnWidth), o = a / 2, s = L(e), c = L(r.y(n.high)), l = L(r.y(n.low));
31
+ if (i === "ohlc") {
32
+ let t = L(r.y(n.open)), i = L(r.y(n.close)), a = L(Math.max(2, o));
32
33
  return {
33
34
  body: null,
34
35
  hollow: null,
35
- stroke: `M${s},${c}V${l}M${L(e - a)},${r}H${s}M${s},${i}H${L(e + a)}`
36
+ stroke: `M${s},${c}V${l}M${L(e - a)},${t}H${s}M${s},${i}H${L(e + a)}`
36
37
  };
37
38
  }
38
- let u = n.y(Math.max(t.open, t.close)), d = n.y(Math.min(t.open, t.close));
39
+ let u = r.y(Math.max(n.open, n.close)), d = r.y(Math.min(n.open, n.close));
39
40
  if (d - u < 1) {
40
41
  let e = (u + d) / 2;
41
42
  u = e - .5, d = e + .5;
42
43
  }
43
- let f = r === "hollow" && t.up && i >= 3, p = f ? .5 : 0, m = a(e - o + p, u + p, Math.max(1, i - p * 2), Math.max(1, d - u - p * 2), i >= 6 ? 1.5 : 0), h = (c < u ? `M${s},${c}V${L(u)}` : "") + (l > d ? `M${s},${L(d)}V${l}` : "");
44
+ let f = i === "hollow" && n.up && a >= 3, p = f ? .5 : 0, m = t(e - o + p, u + p, Math.max(1, a - p * 2), Math.max(1, d - u - p * 2), a >= 6 ? 1.5 : 0), h = (c < u ? `M${s},${c}V${L(u)}` : "") + (l > d ? `M${s},${L(d)}V${l}` : "");
44
45
  return {
45
46
  body: f ? null : m,
46
47
  hollow: f ? m : null,
47
48
  stroke: h
48
49
  };
49
50
  }
50
- function V(t, n, r, i, a, o) {
51
- let c = new e(), l = new e(), u = new e();
52
- for (let { row: e, cx: d } of s(t, i)) {
53
- let t = R(e, n, r);
54
- if (!t) continue;
55
- let s = o(e, t), f = B(d, t, i, a);
56
- f.body && c.add(s, f.body), f.hollow && l.add(s, f.hollow), f.stroke && u.add(s, f.stroke);
51
+ function V(e, t, n, r, i, a) {
52
+ let o = new y(), s = new y(), c = new y();
53
+ for (let { row: l, cx: u } of v(e, r)) {
54
+ let e = R(l, t, n);
55
+ if (!e) continue;
56
+ let d = a(l, e), f = B(u, e, r, i);
57
+ f.body && o.add(d, f.body), f.hollow && s.add(d, f.hollow), f.stroke && c.add(d, f.stroke);
57
58
  }
58
59
  return {
59
- bodies: c.entries(),
60
- hollow: l.entries(),
61
- strokes: u.entries()
60
+ bodies: o.entries(),
61
+ hollow: s.entries(),
62
+ strokes: c.entries()
62
63
  };
63
64
  }
64
65
  //#endregion
65
66
  //#region src/finance/candles.tsx
66
67
  function H(e, t, n) {
67
- return f(e, t, n.up ? F : I);
68
+ return r(e, t, n.up ? F : I);
68
69
  }
69
70
  function U({ paths: e, display: t }) {
70
71
  let n = t === "ohlc" ? 1.5 : 1;
@@ -90,41 +91,41 @@ function U({ paths: e, display: t }) {
90
91
  }, `hollow-${e}`))
91
92
  ] });
92
93
  }
93
- var W = t(function({ series: e, open: t, high: n, low: r, display: i = "candle", className: a }) {
94
- let o = y("Candles", e, [
94
+ var W = u(function({ series: e, open: t, high: n, low: r, display: i = "candle", className: o }) {
95
+ let s = a("Candles", e, [
95
96
  t,
96
97
  n,
97
98
  r
98
- ], "column"), { snapshot: s, descriptor: c, scales: l } = o, u = k(() => {
99
+ ], "column"), { snapshot: c, descriptor: l, scales: u } = s, d = k(() => {
99
100
  let a = {
100
101
  open: t,
101
102
  high: n,
102
103
  low: r
103
104
  };
104
- return z(s.data.rows, e, a), V(s.data.rows, e, a, l, i, (e, t) => H(c, e, t));
105
+ return z(c.data.rows, e, a), V(c.data.rows, e, a, u, i, (e, t) => H(l, e, t));
105
106
  }, [
106
- s,
107
+ c,
107
108
  e,
108
109
  t,
109
110
  n,
110
111
  r,
111
- l,
112
+ u,
112
113
  i,
113
- c
114
+ l
114
115
  ]);
115
116
  return /* @__PURE__ */ N("g", {
116
117
  "aria-hidden": "true",
117
- className: ["lilt-chart__candles", a].filter(Boolean).join(" "),
118
+ className: ["lilt-chart__candles", o].filter(Boolean).join(" "),
118
119
  "data-series": e,
119
120
  "data-display": i,
120
- clipPath: o.clipPath,
121
- mask: o.mask,
121
+ clipPath: s.clipPath,
122
+ mask: s.mask,
122
123
  style: {
123
- opacity: o.opacity,
124
- transition: o.reducedMotion ? void 0 : "opacity 160ms ease-out"
124
+ opacity: s.opacity,
125
+ transition: s.reducedMotion ? void 0 : "opacity 160ms ease-out"
125
126
  },
126
127
  children: /* @__PURE__ */ N(U, {
127
- paths: u,
128
+ paths: d,
128
129
  display: i
129
130
  })
130
131
  });
@@ -139,22 +140,22 @@ var W = t(function({ series: e, open: t, high: n, low: r, display: i = "candle",
139
140
  highlight: (e, { row: t, snapshot: n, descriptor: r }) => {
140
141
  let i = R(t, e.series, e);
141
142
  if (!i) return null;
142
- let a = e.display ?? "candle", o = c(n, e.series), s = B(o.x(t.x), i, o, a), l = H(r, t, i);
143
+ let a = e.display ?? "candle", o = b(n, e.series), s = B(o.x(t.x), i, o, a), c = H(r, t, i);
143
144
  return /* @__PURE__ */ N("g", {
144
145
  className: "lilt-chart__candle-highlight",
145
146
  children: /* @__PURE__ */ N(U, {
146
147
  display: a,
147
148
  paths: {
148
149
  bodies: s.body ? [{
149
- color: l,
150
+ color: c,
150
151
  d: s.body
151
152
  }] : [],
152
153
  hollow: s.hollow ? [{
153
- color: l,
154
+ color: c,
154
155
  d: s.hollow
155
156
  }] : [],
156
157
  strokes: s.stroke ? [{
157
- color: l,
158
+ color: c,
158
159
  d: s.stroke
159
160
  }] : []
160
161
  }
@@ -164,42 +165,42 @@ var W = t(function({ series: e, open: t, high: n, low: r, display: i = "candle",
164
165
  });
165
166
  //#endregion
166
167
  //#region src/finance/cards/pane.tsx
167
- function G({ context: e, label: t, caption: n, readout: r, series: i, height: a, y: o, bars: s, xAxis: c = !1, children: l }) {
168
- let [d, f] = j(null), p = d ?? e.data.at(-1) ?? null;
168
+ function G({ context: t, label: r, caption: i, readout: a, series: o, height: s, y: c, bars: l, xAxis: u = !1, children: d }) {
169
+ let [f, p] = j(null), h = f ?? t.data.at(-1) ?? null;
169
170
  return /* @__PURE__ */ P("div", {
170
171
  className: "lilt-card__pane",
171
- children: [n ? /* @__PURE__ */ P("span", {
172
+ children: [i ? /* @__PURE__ */ P("span", {
172
173
  className: "lilt-card__pane-caption",
173
174
  "aria-hidden": "true",
174
175
  children: [/* @__PURE__ */ N("span", {
175
176
  className: "lilt-card__pane-name",
176
- children: n
177
- }), r && p && !e.loading ? r(p) : null]
178
- }) : null, /* @__PURE__ */ N(b, {
177
+ children: i
178
+ }), a && h && !t.loading ? a(h) : null]
179
+ }) : null, /* @__PURE__ */ N(n, {
179
180
  className: "lilt-card__chart",
180
- "aria-label": t,
181
- data: e.data,
182
- x: e.x,
183
- y: o,
184
- series: i,
185
- controller: e.controller,
186
- onSelectionChange: r ? (e) => f(e?.row ?? null) : void 0,
187
- motion: e.motion,
188
- status: e.loading ? "loading" : "ready",
189
- children: /* @__PURE__ */ P(D, {
190
- height: a,
181
+ "aria-label": r,
182
+ data: t.data,
183
+ x: t.x,
184
+ y: c,
185
+ series: o,
186
+ controller: t.controller,
187
+ onSelectionChange: a ? (e) => p(e?.row ?? null) : void 0,
188
+ motion: t.motion,
189
+ status: t.loading ? "loading" : "ready",
190
+ children: /* @__PURE__ */ P(e, {
191
+ height: s,
191
192
  margins: {
192
- ...e.margins,
193
+ ...t.margins,
193
194
  top: 6,
194
- bottom: c ? 28 : 4
195
+ bottom: u ? 28 : 4
195
196
  },
196
- axis: e.axis,
197
- pill: e.hoverStyle,
198
- axisInset: e.axisInset,
199
- slots: e.slots || !!s,
200
- bars: s,
197
+ axis: t.axis,
198
+ pill: t.hoverStyle,
199
+ axisInset: t.axisInset,
200
+ slots: t.slots || !!l,
201
+ bars: l,
201
202
  background: "none",
202
- children: [l, c ? /* @__PURE__ */ N(u, { labels: "fit" }) : null]
203
+ children: [d, u ? /* @__PURE__ */ N(m, { labels: "fit" }) : null]
203
204
  })
204
205
  })]
205
206
  });
@@ -224,8 +225,8 @@ var te = {
224
225
  minimumFractionDigits: 2,
225
226
  maximumFractionDigits: 2
226
227
  };
227
- function ne({ open: e, high: t, low: n, close: r, volume: a, display: o = "candle", scale: s = "linear", label: c = "Price", live: u = !1, data: f, ranges: p, delta: m, valueFormat: h = te, locale: g = "en-US", volumeHeight: _ = 64, ...v }) {
228
- let y = k(() => S(g, h).full, [g, JSON.stringify(h)]), b = k(() => S(g).compact, [g]), x = k(() => p?.map((t) => ({
228
+ function ne({ open: e, high: t, low: n, close: r, volume: a, display: o = "candle", scale: c = "linear", label: l = "Price", live: u = !1, data: f, ranges: p, delta: m, valueFormat: _ = te, locale: v = "en-US", volumeHeight: y = 64, ...b }) {
229
+ let x = k(() => h(v, _).full, [v, JSON.stringify(_)]), S = k(() => h(v).compact, [v]), C = k(() => p?.map((t) => ({
229
230
  ...t,
230
231
  delta: t.delta ?? q(t.data, e, r)
231
232
  })), [
@@ -246,26 +247,26 @@ function ne({ open: e, high: t, low: n, close: r, volume: a, display: o = "candl
246
247
  accessor: (e) => K(e, n)
247
248
  }
248
249
  };
249
- return /* @__PURE__ */ N(C, {
250
- ...v,
250
+ return /* @__PURE__ */ N(g, {
251
+ ...b,
251
252
  data: f,
252
- ranges: x,
253
+ ranges: C,
253
254
  delta: m ?? (f ? q(f, e, r) : void 0),
254
- valueFormat: h,
255
- locale: g,
255
+ valueFormat: _,
256
+ locale: v,
256
257
  aggregate: "last",
257
258
  tiles: !1,
258
259
  live: u,
259
260
  series: [{
260
261
  key: r,
261
- label: c,
262
+ label: l,
262
263
  color: E ? w ? F : I : void 0
263
264
  }],
264
265
  shape: {
265
266
  kind: "marks",
266
- id: `candles:${o}:${s}:${e}:${t}:${n}:${!!a}`,
267
+ id: `candles:${o}:${c}:${e}:${t}:${n}:${!!a}`,
267
268
  includeZero: !1,
268
- scale: s,
269
+ scale: c,
269
270
  slots: !0,
270
271
  xAxis: !a,
271
272
  series: () => E ? {
@@ -276,8 +277,8 @@ function ne({ open: e, high: t, low: n, close: r, volume: a, display: o = "candl
276
277
  fields: D,
277
278
  line: { showInspectionPoint: !1 }
278
279
  },
279
- describe: ee(y),
280
- draw: (e) => e.map((e) => E ? [/* @__PURE__ */ N(l, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, `line-${e}`)] : /* @__PURE__ */ N(W, {
280
+ describe: ee(x),
281
+ draw: (e) => e.map((e) => E ? [/* @__PURE__ */ N(d, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, `line-${e}`)] : /* @__PURE__ */ N(W, {
281
282
  series: e,
282
283
  open: "open",
283
284
  high: "high",
@@ -287,25 +288,25 @@ function ne({ open: e, high: t, low: n, close: r, volume: a, display: o = "candl
287
288
  },
288
289
  panes: a ? (e) => /* @__PURE__ */ N(G, {
289
290
  context: e,
290
- label: `${v.title} volume`,
291
+ label: `${b.title} volume`,
291
292
  caption: "Volume",
292
- height: _,
293
+ height: y,
293
294
  xAxis: !0,
294
295
  y: {
295
296
  includeZero: !0,
296
297
  ticks: 2,
297
- format: b
298
+ format: S
298
299
  },
299
300
  bars: { series: ["volume"] },
300
301
  series: [{
301
302
  id: "volume",
302
303
  label: "Volume",
303
304
  accessor: (e) => K(e, a),
304
- formatValue: b,
305
+ formatValue: S,
305
306
  colorAt: (e) => T(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
306
307
  bar: { radius: 1 }
307
308
  }],
308
- children: /* @__PURE__ */ N(d, { series: "volume" })
309
+ children: /* @__PURE__ */ N(s, { series: "volume" })
309
310
  }) : void 0
310
311
  });
311
312
  }
@@ -492,27 +493,27 @@ var pe = {
492
493
  "var(--lilt-series-3)",
493
494
  "var(--lilt-series-5)"
494
495
  ];
495
- function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlays: c = [], panes: l = ["rsi", "macd"], label: u = "Price", scale: f = "linear", live: p = !1, data: h, ranges: g, delta: _, valueFormat: v = pe, locale: y = "en-US", paneHeight: b = 72, ...x }) {
496
- let w = !!(t && n && a), E = s ?? (w ? "candle" : "line");
497
- if (E !== "line" && !w) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
498
- let D = JSON.stringify(c), O = JSON.stringify(l), A = k(() => ue(c), [D]), j = k(() => de(l), [O]);
499
- if (j.some((e) => e.kind === "volume") && !o) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
500
- let L = k(() => h ? fe(h, e, A, j) : void 0, [
501
- h,
496
+ function he({ close: e, open: t, high: n, low: r, volume: a, display: c, overlays: l = [], panes: u = ["rsi", "macd"], label: d = "Price", scale: p = "linear", live: m = !1, data: v, ranges: y, delta: b, valueFormat: x = pe, locale: S = "en-US", paneHeight: C = 72, ...w }) {
497
+ let T = !!(t && n && r), E = c ?? (T ? "candle" : "line");
498
+ if (E !== "line" && !T) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
499
+ let D = JSON.stringify(l), O = JSON.stringify(u), A = k(() => ue(l), [D]), j = k(() => de(u), [O]);
500
+ if (j.some((e) => e.kind === "volume") && !a) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
501
+ let L = k(() => v ? fe(v, e, A, j) : void 0, [
502
+ v,
502
503
  e,
503
504
  A,
504
505
  j
505
- ]), R = k(() => g?.map((n) => ({
506
+ ]), R = k(() => y?.map((n) => ({
506
507
  ...n,
507
508
  data: fe(n.data, e, A, j),
508
509
  delta: n.delta ?? (t ? q(n.data, t, e) : void 0)
509
510
  })), [
510
- g,
511
+ y,
511
512
  e,
512
513
  t,
513
514
  A,
514
515
  j
515
- ]), z = k(() => S(y, v).full, [y, JSON.stringify(v)]), B = k(() => S(y, { maximumFractionDigits: 2 }).full, [y]), V = k(() => S(y).compact, [y]), H = w ? {
516
+ ]), z = k(() => h(S, x).full, [S, JSON.stringify(x)]), B = k(() => h(S, { maximumFractionDigits: 2 }).full, [S]), V = k(() => h(S).compact, [S]), H = T ? {
516
517
  open: {
517
518
  label: "Open",
518
519
  accessor: (e) => Q(e, t)
@@ -523,10 +524,10 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
523
524
  },
524
525
  low: {
525
526
  label: "Low",
526
- accessor: (e) => Q(e, a)
527
+ accessor: (e) => Q(e, r)
527
528
  }
528
- } : void 0, U = new Map(A.map((e) => [e.id, e])), K = h?.length ? Q(h[0], e) : null, te = h?.length ? Q(h.at(-1), e) : null, ne = K === null || te === null || te >= K, J = j.at(-1)?.id, Y = (n, r) => {
529
- let a = n.id === J, s = (e) => (t) => Q(t, e), c = (e, t, n) => {
529
+ } : void 0, U = new Map(A.map((e) => [e.id, e])), K = v?.length ? Q(v[0], e) : null, te = v?.length ? Q(v.at(-1), e) : null, ne = K === null || te === null || te >= K, J = j.at(-1)?.id, Y = (n, r) => {
530
+ let c = n.id === J, l = (e) => (t) => Q(t, e), u = (e, t, n) => {
530
531
  let r = Q(e, t);
531
532
  return /* @__PURE__ */ P("span", {
532
533
  className: "lilt-card__pane-value",
@@ -535,14 +536,14 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
535
536
  };
536
537
  if (n.kind === "volume") return /* @__PURE__ */ N(G, {
537
538
  context: r,
538
- label: `${x.title} volume`,
539
+ label: `${w.title} volume`,
539
540
  caption: "Volume",
540
541
  readout: (e) => /* @__PURE__ */ N("span", {
541
542
  className: "lilt-card__pane-value",
542
- children: Q(e, o) === null ? "—" : V(Q(e, o))
543
+ children: Q(e, a) === null ? "—" : V(Q(e, a))
543
544
  }),
544
- height: b,
545
- xAxis: a,
545
+ height: C,
546
+ xAxis: c,
546
547
  y: {
547
548
  includeZero: !0,
548
549
  ticks: 2,
@@ -552,20 +553,20 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
552
553
  series: [{
553
554
  id: "volume",
554
555
  label: "Volume",
555
- accessor: s(o),
556
+ accessor: l(a),
556
557
  formatValue: V,
557
558
  colorAt: (n) => (Q(n, e) ?? 0) >= (Q(n, t) ?? Q(n, e) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
558
559
  bar: { radius: 1 }
559
560
  }],
560
- children: /* @__PURE__ */ N(d, { series: "volume" })
561
+ children: /* @__PURE__ */ N(s, { series: "volume" })
561
562
  }, n.id);
562
563
  if (n.kind === "rsi") return /* @__PURE__ */ P(G, {
563
564
  context: r,
564
- label: `${x.title} RSI ${n.period}`,
565
+ label: `${w.title} RSI ${n.period}`,
565
566
  caption: `RSI ${n.period}`,
566
- readout: (e) => c(e, n.id),
567
- height: b,
568
- xAxis: a,
567
+ readout: (e) => u(e, n.id),
568
+ height: C,
569
+ xAxis: c,
569
570
  y: {
570
571
  domain: [0, 100],
571
572
  ticks: 2,
@@ -574,64 +575,64 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
574
575
  series: [{
575
576
  id: n.id,
576
577
  label: `RSI ${n.period}`,
577
- accessor: s(n.id),
578
+ accessor: l(n.id),
578
579
  color: "var(--lilt-series-1)",
579
580
  formatValue: B,
580
581
  line: { width: 1.5 }
581
582
  }],
582
583
  children: [
583
- /* @__PURE__ */ N(m, {
584
+ /* @__PURE__ */ N(o, {
584
585
  axis: "y",
585
586
  from: 30,
586
587
  to: 70,
587
588
  color: "var(--lilt-series-1)"
588
589
  }),
589
- /* @__PURE__ */ N(T, {
590
+ /* @__PURE__ */ N(f, {
590
591
  value: 70,
591
592
  color: "var(--lilt-muted)"
592
593
  }),
593
- /* @__PURE__ */ N(T, {
594
+ /* @__PURE__ */ N(f, {
594
595
  value: 30,
595
596
  color: "var(--lilt-muted)"
596
597
  }),
597
598
  /* @__PURE__ */ N(i, { series: n.id })
598
599
  ]
599
600
  }, n.id);
600
- let l = `${n.id}Macd`, u = `${n.id}Signal`, f = `${n.id}Histogram`;
601
+ let d = `${n.id}Macd`, p = `${n.id}Signal`, m = `${n.id}Histogram`;
601
602
  return /* @__PURE__ */ P(G, {
602
603
  context: r,
603
- label: `${x.title} MACD`,
604
+ label: `${w.title} MACD`,
604
605
  caption: `MACD ${n.fast} · ${n.slow} · ${n.signal}`,
605
- readout: (e) => [c(e, l), c(e, u, "Signal")],
606
- height: b,
607
- xAxis: a,
606
+ readout: (e) => [u(e, d), u(e, p, "Signal")],
607
+ height: C,
608
+ xAxis: c,
608
609
  y: {
609
610
  includeZero: !0,
610
611
  ticks: 2,
611
612
  format: B
612
613
  },
613
- bars: { series: [f] },
614
+ bars: { series: [m] },
614
615
  series: [
615
616
  {
616
- id: f,
617
+ id: m,
617
618
  label: "Histogram",
618
- accessor: s(f),
619
+ accessor: l(m),
619
620
  formatValue: B,
620
- colorAt: (e) => (Q(e, f) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
621
+ colorAt: (e) => (Q(e, m) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
621
622
  bar: { radius: 1 }
622
623
  },
623
624
  {
624
- id: l,
625
+ id: d,
625
626
  label: "MACD",
626
- accessor: s(l),
627
+ accessor: l(d),
627
628
  color: "var(--lilt-series-4)",
628
629
  formatValue: B,
629
630
  line: { width: 1.5 }
630
631
  },
631
632
  {
632
- id: u,
633
+ id: p,
633
634
  label: "Signal",
634
- accessor: s(u),
635
+ accessor: l(p),
635
636
  color: "var(--lilt-series-3)",
636
637
  formatValue: B,
637
638
  line: {
@@ -641,27 +642,27 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
641
642
  }
642
643
  ],
643
644
  children: [
644
- /* @__PURE__ */ N(d, { series: f }),
645
- /* @__PURE__ */ N(i, { series: l }),
646
- /* @__PURE__ */ N(i, { series: u })
645
+ /* @__PURE__ */ N(s, { series: m }),
646
+ /* @__PURE__ */ N(i, { series: d }),
647
+ /* @__PURE__ */ N(i, { series: p })
647
648
  ]
648
649
  }, n.id);
649
650
  };
650
- return /* @__PURE__ */ N(C, {
651
- ...x,
651
+ return /* @__PURE__ */ N(g, {
652
+ ...w,
652
653
  data: L,
653
654
  ranges: R,
654
- delta: _ ?? (h && t ? q(h, t, e) : void 0),
655
- valueFormat: v,
656
- locale: y,
655
+ delta: b ?? (v && t ? q(v, t, e) : void 0),
656
+ valueFormat: x,
657
+ locale: S,
657
658
  aggregate: "last",
658
659
  headlineSeries: e,
659
660
  pillSeries: e,
660
661
  tiles: !1,
661
- live: p,
662
+ live: m,
662
663
  series: [{
663
664
  key: e,
664
- label: u,
665
+ label: d,
665
666
  color: E === "line" ? ne ? F : I : void 0
666
667
  }, ...A.map((e, t) => ({
667
668
  key: e.id,
@@ -670,9 +671,9 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
670
671
  }))],
671
672
  shape: {
672
673
  kind: "marks",
673
- id: `indicator:${E}:${f}:${t}:${n}:${a}:${D}:${O}`,
674
+ id: `indicator:${E}:${p}:${t}:${n}:${r}:${D}:${O}`,
674
675
  includeZero: !1,
675
- scale: f,
676
+ scale: p,
676
677
  slots: !0,
677
678
  xAxis: j.length === 0,
678
679
  series: (e) => {
@@ -699,10 +700,10 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
699
700
  line: { width: 2 }
700
701
  } : { fields: H };
701
702
  },
702
- describe: w ? ee(z) : void 0,
703
+ describe: T ? ee(z) : void 0,
703
704
  draw: (e) => e.map((e) => {
704
705
  let t = U.get(e);
705
- return t ? t.kind === "bollinger" ? [/* @__PURE__ */ N(r, {
706
+ return t ? t.kind === "bollinger" ? [/* @__PURE__ */ N(_, {
706
707
  series: e,
707
708
  lower: "lower",
708
709
  upper: "upper"
@@ -721,7 +722,7 @@ function he({ close: e, open: t, high: n, low: a, volume: o, display: s, overlay
721
722
  //#endregion
722
723
  //#region src/finance/cards/depth-chart-card.tsx
723
724
  function ge({ price: e, label: t }) {
724
- let { snapshot: n } = p();
725
+ let { snapshot: n } = x();
725
726
  if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
726
727
  let r = n.xToPixel(e);
727
728
  return /* @__PURE__ */ P("g", {
@@ -748,11 +749,11 @@ var _e = {
748
749
  minimumFractionDigits: 2,
749
750
  maximumFractionDigits: 2
750
751
  };
751
- function ve({ title: e, bids: t, asks: r, valueFormat: a = _e, sizeFormat: o, locale: s = "en-US", height: c = 220, axis: d = "minimal", background: f = "dots", hoverStyle: p = "soft", surface: m, numberStyle: v, loading: y = !1, motion: C, className: T, style: O }) {
752
- let A = k(() => le(t, r), [t, r]), M = JSON.stringify(a), L = JSON.stringify(o ?? null), R = k(() => S(s, a), [s, M]), z = k(() => S(s, o), [s, L]), B = k(() => S(s, {
752
+ function ve({ title: t, bids: r, asks: a, valueFormat: o = _e, sizeFormat: s, locale: l = "en-US", height: u = 220, axis: f = "minimal", background: g = "dots", hoverStyle: _ = "soft", surface: v, numberStyle: y, loading: b = !1, motion: x, className: S, style: O }) {
753
+ let A = k(() => le(r, a), [r, a]), M = JSON.stringify(o), L = JSON.stringify(s ?? null), R = k(() => h(l, o), [l, M]), z = k(() => h(l, s), [l, L]), B = k(() => h(l, {
753
754
  style: "percent",
754
755
  maximumFractionDigits: 3
755
- }).full, [s]), [V, H] = j(null), U = k(() => [{
756
+ }).full, [l]), [V, H] = j(null), U = k(() => [{
756
757
  id: "bid",
757
758
  label: "Bids",
758
759
  accessor: (e) => e.bid,
@@ -771,45 +772,45 @@ function ve({ title: e, bids: t, asks: r, valueFormat: a = _e, sizeFormat: o, lo
771
772
  line: { width: 1.5 },
772
773
  formatValue: z.full
773
774
  }], [z]), W = A.spread !== null && A.mid ? `${R.full(A.spread)} (${B(A.spread / A.mid)})` : "—", G = V ? V.bid ?? V.ask : null;
774
- return /* @__PURE__ */ P(w, {
775
- "aria-label": e,
776
- surface: m,
777
- numberStyle: v,
778
- motion: C,
779
- className: ["lilt-card--depth", T].filter(Boolean).join(" "),
775
+ return /* @__PURE__ */ P(D, {
776
+ "aria-label": t,
777
+ surface: v,
778
+ numberStyle: y,
779
+ motion: x,
780
+ className: ["lilt-card--depth", S].filter(Boolean).join(" "),
780
781
  style: O,
781
782
  children: [
782
- /* @__PURE__ */ P(x, { children: [/* @__PURE__ */ N(_, { children: e }), /* @__PURE__ */ N(g, {
783
+ /* @__PURE__ */ P(E, { children: [/* @__PURE__ */ N(T, { children: t }), /* @__PURE__ */ N(w, {
783
784
  value: A.mid,
784
785
  format: R.full,
785
- loading: y,
786
- motion: C,
787
- children: y ? null : V && G !== null ? /* @__PURE__ */ P(h, { children: [
786
+ loading: b,
787
+ motion: x,
788
+ children: b ? null : V && G !== null ? /* @__PURE__ */ P(C, { children: [
788
789
  z.full(G),
789
790
  " ",
790
791
  V.side === "bid" ? "bid" : "ask",
791
792
  " depth at",
792
793
  " ",
793
794
  R.full(V.price)
794
- ] }) : /* @__PURE__ */ N(h, { children: "Mid price" })
795
+ ] }) : /* @__PURE__ */ N(C, { children: "Mid price" })
795
796
  })] }),
796
797
  /* @__PURE__ */ P("dl", {
797
798
  className: "lilt-card__stats",
798
799
  children: [
799
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("dt", { children: "Spread" }), /* @__PURE__ */ N("dd", { children: y ? "—" : W })] }),
800
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("dt", { children: "Spread" }), /* @__PURE__ */ N("dd", { children: b ? "—" : W })] }),
800
801
  /* @__PURE__ */ P("div", {
801
802
  "data-side": "bid",
802
- children: [/* @__PURE__ */ N("dt", { children: "Bid depth" }), /* @__PURE__ */ N("dd", { children: y ? "—" : z.compact(A.bidDepth) })]
803
+ children: [/* @__PURE__ */ N("dt", { children: "Bid depth" }), /* @__PURE__ */ N("dd", { children: b ? "—" : z.compact(A.bidDepth) })]
803
804
  }),
804
805
  /* @__PURE__ */ P("div", {
805
806
  "data-side": "ask",
806
- children: [/* @__PURE__ */ N("dt", { children: "Ask depth" }), /* @__PURE__ */ N("dd", { children: y ? "—" : z.compact(A.askDepth) })]
807
+ children: [/* @__PURE__ */ N("dt", { children: "Ask depth" }), /* @__PURE__ */ N("dd", { children: b ? "—" : z.compact(A.askDepth) })]
807
808
  })
808
809
  ]
809
810
  }),
810
- /* @__PURE__ */ N(b, {
811
+ /* @__PURE__ */ N(n, {
811
812
  className: "lilt-card__chart",
812
- "aria-label": `${e} depth by price`,
813
+ "aria-label": `${t} depth by price`,
813
814
  data: A.levels,
814
815
  x: {
815
816
  type: "number",
@@ -823,13 +824,13 @@ function ve({ title: e, bids: t, asks: r, valueFormat: a = _e, sizeFormat: o, lo
823
824
  },
824
825
  series: U,
825
826
  onSelectionChange: (e) => H(e?.row ?? null),
826
- motion: C,
827
- status: y ? "loading" : "ready",
828
- children: /* @__PURE__ */ P(D, {
829
- height: c,
830
- axis: d,
831
- background: f,
832
- pill: p,
827
+ motion: x,
828
+ status: b ? "loading" : "ready",
829
+ children: /* @__PURE__ */ P(e, {
830
+ height: u,
831
+ axis: f,
832
+ background: g,
833
+ pill: _,
833
834
  margins: {
834
835
  top: 8,
835
836
  right: 4,
@@ -837,17 +838,17 @@ function ve({ title: e, bids: t, asks: r, valueFormat: a = _e, sizeFormat: o, lo
837
838
  left: 4
838
839
  },
839
840
  children: [
840
- /* @__PURE__ */ N(E, { pattern: "lines" }),
841
- /* @__PURE__ */ N(l, { series: "bid" }),
842
- /* @__PURE__ */ N(l, { series: "ask" }),
841
+ /* @__PURE__ */ N(c, { pattern: "lines" }),
842
+ /* @__PURE__ */ N(d, { series: "bid" }),
843
+ /* @__PURE__ */ N(d, { series: "ask" }),
843
844
  /* @__PURE__ */ N(i, { series: "bid" }),
844
845
  /* @__PURE__ */ N(i, { series: "ask" }),
845
846
  A.mid === null ? null : /* @__PURE__ */ N(ge, {
846
847
  price: A.mid,
847
848
  label: `Mid ${R.full(A.mid)}`
848
849
  }),
849
- /* @__PURE__ */ N(u, { labels: "fit" }),
850
- /* @__PURE__ */ N(n, {})
850
+ /* @__PURE__ */ N(m, { labels: "fit" }),
851
+ /* @__PURE__ */ N(p, {})
851
852
  ]
852
853
  })
853
854
  })
@@ -865,7 +866,7 @@ function ye(e, t, n) {
865
866
  let r = e.at(-1), i = $(r, t), a = $(r, n);
866
867
  return i !== null && a ? i / a - 1 : void 0;
867
868
  }
868
- function be({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: u = "en-US", ...d }) {
869
+ function be({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
869
870
  let f = o ?? s?.[0]?.data ?? [], p = k(() => s?.map((n) => ({
870
871
  ...n,
871
872
  delta: n.delta ?? ye(n.data, e, t)
@@ -873,20 +874,20 @@ function be({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdown
873
874
  s,
874
875
  e,
875
876
  t
876
- ]), m = k(() => S(u, {
877
+ ]), m = k(() => h(l, {
877
878
  style: "percent",
878
879
  minimumFractionDigits: 1,
879
880
  maximumFractionDigits: 1
880
- }).full, [u]), h = k(() => {
881
+ }).full, [l]), _ = k(() => {
881
882
  let t = oe(f.map((t) => $(t, e))).filter((e) => e !== null);
882
883
  return t.length ? Math.min(...t) : null;
883
884
  }, [f, e]);
884
- return /* @__PURE__ */ N(C, {
885
- ...d,
885
+ return /* @__PURE__ */ N(g, {
886
+ ...u,
886
887
  data: o,
887
888
  ranges: p,
888
889
  delta: c ?? (o ? ye(o, e, t) : void 0),
889
- locale: u,
890
+ locale: l,
890
891
  aggregate: "last",
891
892
  headlineSeries: e,
892
893
  pillSeries: e,
@@ -912,20 +913,20 @@ function be({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdown
912
913
  area: { treatment: "fade" },
913
914
  curve: "monotone"
914
915
  },
915
- draw: (e) => e.map((e) => [/* @__PURE__ */ N(l, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, e)])
916
+ draw: (e) => e.map((e) => [/* @__PURE__ */ N(d, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, e)])
916
917
  },
917
918
  panes: r ? (t) => {
918
919
  let n = oe(t.data.map((t) => $(t, e))), r = new Map(t.data.map((e, t) => [e, n[t] ?? null]));
919
920
  return /* @__PURE__ */ P(G, {
920
921
  context: t,
921
- label: `${d.title} drawdown`,
922
+ label: `${u.title} drawdown`,
922
923
  caption: "Drawdown",
923
924
  readout: (e) => /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
924
925
  className: "lilt-card__pane-value",
925
926
  children: r.get(e) == null ? "—" : m(r.get(e))
926
- }), h === null ? null : /* @__PURE__ */ P("span", {
927
+ }), _ === null ? null : /* @__PURE__ */ P("span", {
927
928
  className: "lilt-card__pane-value",
928
- children: ["Max ", m(h)]
929
+ children: ["Max ", m(_)]
929
930
  })] }),
930
931
  height: a,
931
932
  xAxis: !0,
@@ -944,7 +945,7 @@ function be({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdown
944
945
  line: { width: 1.5 },
945
946
  curve: "monotone"
946
947
  }],
947
- children: [/* @__PURE__ */ N(l, { series: "drawdown" }), /* @__PURE__ */ N(i, { series: "drawdown" })]
948
+ children: [/* @__PURE__ */ N(d, { series: "drawdown" }), /* @__PURE__ */ N(i, { series: "drawdown" })]
948
949
  });
949
950
  } : void 0
950
951
  });
@@ -973,28 +974,28 @@ var we = {
973
974
  minimumFractionDigits: 2,
974
975
  maximumFractionDigits: 2
975
976
  };
976
- function Te({ price: e, symbol: t, name: n, icon: r, display: a = "area", versus: o, data: s, ranges: c, delta: u, valueFormat: d = we, locale: f = "en-US", title: p, ...m }) {
977
- let h = !!o?.length, g = k(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = k(() => s ? h ? Ce(s, g) : s : void 0, [
977
+ function Te({ price: e, symbol: t, name: n, icon: r, display: a = "area", versus: o, data: s, ranges: c, delta: u, valueFormat: f = we, locale: p = "en-US", title: m, ..._ }) {
978
+ let v = !!o?.length, y = k(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), b = k(() => s ? v ? Ce(s, y) : s : void 0, [
978
979
  s,
979
- h,
980
- g
981
- ]), y = k(() => c?.map((t) => {
980
+ v,
981
+ y
982
+ ]), x = k(() => c?.map((t) => {
982
983
  let n = Se(t.data, e);
983
984
  return {
984
985
  ...t,
985
- data: h ? Ce(t.data, g) : t.data,
986
+ data: v ? Ce(t.data, y) : t.data,
986
987
  delta: t.delta ?? (n && n.first ? n.last / n.first - 1 : void 0)
987
988
  };
988
989
  }), [
989
990
  c,
990
- h,
991
- g,
991
+ v,
992
+ y,
992
993
  e
993
- ]), b = Se(s ?? c?.[0]?.data ?? [], e), x = !b || b.last >= b.first, w = k(() => S(f, d).full, [f, JSON.stringify(d)]), T = k(() => S(f, {
994
+ ]), S = Se(s ?? c?.[0]?.data ?? [], e), C = !S || S.last >= S.first, w = k(() => h(p, f).full, [p, JSON.stringify(f)]), T = k(() => h(p, {
994
995
  style: "percent",
995
996
  minimumFractionDigits: 1,
996
997
  maximumFractionDigits: 1
997
- }).full, [f]), E = (e) => h ? `__rebased${e}` : e, D = /* @__PURE__ */ P("span", {
998
+ }).full, [p]), E = (e) => v ? `__rebased${e}` : e, D = /* @__PURE__ */ P("span", {
998
999
  className: "lilt-card__ticker",
999
1000
  children: [
1000
1001
  r ? /* @__PURE__ */ N("span", {
@@ -1003,7 +1004,7 @@ function Te({ price: e, symbol: t, name: n, icon: r, display: a = "area", versus
1003
1004
  }) : null,
1004
1005
  /* @__PURE__ */ N("span", {
1005
1006
  className: "lilt-card__ticker-symbol",
1006
- children: t ?? p
1007
+ children: t ?? m
1007
1008
  }),
1008
1009
  n ? /* @__PURE__ */ N("span", {
1009
1010
  className: "lilt-card__ticker-name",
@@ -1011,46 +1012,46 @@ function Te({ price: e, symbol: t, name: n, icon: r, display: a = "area", versus
1011
1012
  }) : null
1012
1013
  ]
1013
1014
  });
1014
- return /* @__PURE__ */ N(C, {
1015
- ...m,
1016
- title: p,
1015
+ return /* @__PURE__ */ N(g, {
1016
+ ..._,
1017
+ title: m,
1017
1018
  heading: D,
1018
- data: _,
1019
- ranges: y,
1020
- delta: h ? void 0 : u ?? (s && b && b.first ? b.last / b.first - 1 : void 0),
1021
- valueFormat: h ? {
1019
+ data: b,
1020
+ ranges: x,
1021
+ delta: v ? void 0 : u ?? (s && S && S.first ? S.last / S.first - 1 : void 0),
1022
+ valueFormat: v ? {
1022
1023
  style: "percent",
1023
1024
  maximumFractionDigits: 1
1024
- } : d,
1025
- formatValue: h ? (e) => v(T)(e) : void 0,
1026
- locale: f,
1025
+ } : f,
1026
+ formatValue: v ? (e) => l(T)(e) : void 0,
1027
+ locale: p,
1027
1028
  aggregate: "last",
1028
1029
  headlineSeries: E(e),
1029
- pillSeries: h ? "nearest" : E(e),
1030
- tiles: h,
1031
- restCaption: h ? void 0 : (t) => {
1030
+ pillSeries: v ? "nearest" : E(e),
1031
+ tiles: v,
1032
+ restCaption: v ? void 0 : (t) => {
1032
1033
  let n = Se(t, e);
1033
- return n ? v(w)(n.last - n.first) : null;
1034
+ return n ? l(w)(n.last - n.first) : null;
1034
1035
  },
1035
1036
  series: [{
1036
1037
  key: E(e),
1037
- label: t ?? p,
1038
- color: h ? void 0 : x ? F : I
1038
+ label: t ?? m,
1039
+ color: v ? void 0 : C ? F : I
1039
1040
  }, ...(o ?? []).map((e) => ({
1040
1041
  ...e,
1041
1042
  key: E(e.key)
1042
1043
  }))],
1043
1044
  shape: {
1044
1045
  kind: "marks",
1045
- id: `price:${a}:${g.join()}:${h}`,
1046
- includeZero: h,
1047
- series: () => a === "area" && !h ? {
1046
+ id: `price:${a}:${y.join()}:${v}`,
1047
+ includeZero: v,
1048
+ series: () => a === "area" && !v ? {
1048
1049
  area: { treatment: "fade" },
1049
1050
  curve: "monotone"
1050
1051
  } : { curve: "monotone" },
1051
- draw: (e) => e.map((e) => a === "area" && !h ? [/* @__PURE__ */ N(l, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, e)] : /* @__PURE__ */ N(i, { series: e }, e))
1052
+ draw: (e) => e.map((e) => a === "area" && !v ? [/* @__PURE__ */ N(d, { series: e }, `area-${e}`), /* @__PURE__ */ N(i, { series: e }, e)] : /* @__PURE__ */ N(i, { series: e }, e))
1052
1053
  },
1053
- bleed: m.bleed ?? !0
1054
+ bleed: _.bleed ?? !0
1054
1055
  });
1055
1056
  }
1056
1057
  //#endregion
@@ -1083,13 +1084,13 @@ function De(e, t) {
1083
1084
  function Oe({ title: e, bids: t, asks: n, depth: r = 8, valueFormat: i = {
1084
1085
  minimumFractionDigits: 2,
1085
1086
  maximumFractionDigits: 2
1086
- }, sizeFormat: a, locale: s = "en-US", flash: c = !0, surface: l, motion: u, className: d, style: f }) {
1087
- let p = o(u ?? "auto"), m = JSON.stringify(i), h = JSON.stringify(a ?? null), g = k(() => S(s, i).full, [s, m]), _ = k(() => S(s, a).compact, [s, h]), v = k(() => S(s, {
1087
+ }, sizeFormat: a, locale: o = "en-US", flash: s = !0, surface: c, motion: l, className: u, style: d }) {
1088
+ let f = S(l ?? "auto"), p = JSON.stringify(i), m = JSON.stringify(a ?? null), g = k(() => h(o, i).full, [o, p]), _ = k(() => h(o, a).compact, [o, m]), v = k(() => h(o, {
1088
1089
  style: "percent",
1089
1090
  maximumFractionDigits: 3
1090
- }).full, [s]), y = k(() => Ee(t, "bid", r), [t, r]), b = k(() => Ee(n, "ask", r), [n, r]), x = De(k(() => [...b, ...y], [b, y]), c && !p), C = Math.max(1, b.at(-1)?.total ?? 0, y.at(-1)?.total ?? 0), T = y[0]?.price, E = b[0]?.price, D = T !== void 0 && E !== void 0 ? {
1091
- value: E - T,
1092
- mid: (E + T) / 2
1091
+ }).full, [o]), y = k(() => Ee(t, "bid", r), [t, r]), b = k(() => Ee(n, "ask", r), [n, r]), x = De(k(() => [...b, ...y], [b, y]), s && !f), C = Math.max(1, b.at(-1)?.total ?? 0, y.at(-1)?.total ?? 0), w = y[0]?.price, T = b[0]?.price, E = w !== void 0 && T !== void 0 ? {
1092
+ value: T - w,
1093
+ mid: (T + w) / 2
1093
1094
  } : null, O = (e) => /* @__PURE__ */ P("tr", {
1094
1095
  className: "lilt-order-book__level",
1095
1096
  "data-side": e.side,
@@ -1104,12 +1105,12 @@ function Oe({ title: e, bids: t, asks: n, depth: r = 8, valueFormat: i = {
1104
1105
  /* @__PURE__ */ N("td", { children: _(e.total) })
1105
1106
  ]
1106
1107
  }, `${e.side}:${e.price}`);
1107
- return /* @__PURE__ */ N(w, {
1108
+ return /* @__PURE__ */ N(D, {
1108
1109
  "aria-label": e,
1109
- surface: l,
1110
- motion: u,
1111
- className: ["lilt-card--order-book", d].filter(Boolean).join(" "),
1112
- style: f,
1110
+ surface: c,
1111
+ motion: l,
1112
+ className: ["lilt-card--order-book", u].filter(Boolean).join(" "),
1113
+ style: d,
1113
1114
  children: /* @__PURE__ */ P("table", {
1114
1115
  className: "lilt-order-book",
1115
1116
  children: [
@@ -1138,10 +1139,10 @@ function Oe({ title: e, bids: t, asks: n, depth: r = 8, valueFormat: i = {
1138
1139
  className: "lilt-order-book__spread",
1139
1140
  children: [/* @__PURE__ */ N("th", {
1140
1141
  scope: "row",
1141
- children: D ? g(D.mid) : "—"
1142
+ children: E ? g(E.mid) : "—"
1142
1143
  }), /* @__PURE__ */ N("td", {
1143
1144
  colSpan: 2,
1144
- children: D ? `Spread ${g(D.value)} · ${v(D.value / D.mid)}` : "No spread"
1145
+ children: E ? `Spread ${g(E.value)} · ${v(E.value / E.mid)}` : "No spread"
1145
1146
  })]
1146
1147
  })
1147
1148
  }),