@lilt-ui/charts 0.5.0 → 0.6.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.
package/dist/finance.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { C as e, F as t, I as n, L as r, N as i, R as a, S as o, U as s, Z as c, _ as l, b as u, d, dt as f, g as p, i as m, k as h, l as g, nt as _, q as v, r as y, t as b, v as x, w as S, x as C, y as w } from "./cartesian-card-7DAiMU3w.js";
3
- import { S as T, d as E, g as D, h as O, p as k, u as A } from "./report-context-Cz0AYdV2.js";
4
- import { useEffect as ee, useMemo as j, useRef as te, useState as M } from "react";
5
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
2
+ import { A as e, C as t, G as n, I as r, K as i, L as a, P as o, R as s, S as c, T as l, X as u, _ as d, a as f, b as p, et as m, f as h, i as g, it as _, n as v, pt as y, t as b, u as x, v as S, w as C, x as w, y as T, z as E } from "./skeleton-block-Uf1lywJi.js";
3
+ import { S as D, d as O, g as k, h as A, p as j, u as ee } from "./report-context-Cz0AYdV2.js";
4
+ import { useEffect as M, useMemo as N, useRef as P, useState as F } from "react";
5
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
6
6
  //#region src/finance/candle-geometry.ts
7
- var I = "var(--lilt-candle-up)", L = "var(--lilt-candle-down)";
8
- function R(e) {
7
+ var z = "var(--lilt-candle-up)", B = "var(--lilt-candle-down)";
8
+ function V(e) {
9
9
  return Math.round(e * 100) / 100;
10
10
  }
11
- function z(e, t, n) {
11
+ function H(e, t, n) {
12
12
  let r = e.fields[t], i = r?.[n.open], a = r?.[n.high], o = r?.[n.low], s = e.values[t];
13
13
  return i == null || a == null || o == null || s == null ? null : {
14
14
  open: i,
@@ -18,84 +18,84 @@ function z(e, t, n) {
18
18
  up: s >= i
19
19
  };
20
20
  }
21
- function B(e, t, n) {
21
+ function U(e, t, n) {
22
22
  for (let r of e) {
23
- let e = z(r, t, n);
23
+ let e = H(r, t, n);
24
24
  if (!e) continue;
25
25
  let i = Math.max(e.open, e.close), a = Math.min(e.open, e.close);
26
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}.`);
27
27
  }
28
28
  }
29
- function V(e, t, n, r, a = !1) {
30
- let o = Math.max(1, n.columnWidth), s = o / 2, l = R(e), u = R(n.y(t.high)), d = R(n.y(t.low));
29
+ function W(e, t, n, r, i = !1) {
30
+ let a = Math.max(1, n.columnWidth), s = a / 2, c = V(e), l = V(n.y(t.high)), u = V(n.y(t.low));
31
31
  if (r === "ohlc") {
32
- let r = R(n.y(t.open)), i = R(n.y(t.close)), a = R(Math.max(2, s));
32
+ let r = V(n.y(t.open)), i = V(n.y(t.close)), a = V(Math.max(2, s));
33
33
  return {
34
34
  body: null,
35
35
  hollow: null,
36
- stroke: `M${l},${u}V${d}M${R(e - a)},${r}H${l}M${l},${i}H${R(e + a)}`,
36
+ stroke: `M${c},${l}V${u}M${V(e - a)},${r}H${c}M${c},${i}H${V(e + a)}`,
37
37
  side: null,
38
38
  top: null
39
39
  };
40
40
  }
41
- let f = n.y(Math.max(t.open, t.close)), p = n.y(Math.min(t.open, t.close));
42
- if (p - f < 1) {
43
- let e = (f + p) / 2;
44
- f = e - .5, p = e + .5;
41
+ let d = n.y(Math.max(t.open, t.close)), f = n.y(Math.min(t.open, t.close));
42
+ if (f - d < 1) {
43
+ let e = (d + f) / 2;
44
+ d = e - .5, f = e + .5;
45
45
  }
46
- let m = r === "hollow" && t.up && o >= 3, h = m ? .5 : 0, g = a ? c(e, f, o, p - f) : null, _ = g ? e - g.frontWidth / 2 : e - s, v = i(_ + h, f + h, Math.max(1, (g ? g.frontWidth : o) - h * 2), Math.max(1, p - f - h * 2), !g && o >= 6 ? 1.5 : 0), y = (u < f ? `M${l},${u}V${R(f)}` : "") + (d > p ? `M${l},${R(p)}V${d}` : "");
46
+ let p = r === "hollow" && t.up && a >= 3, h = p ? .5 : 0, g = i ? m(e, d, a, f - d) : null, _ = g ? e - g.frontWidth / 2 : e - s, v = o(_ + h, d + h, Math.max(1, (g ? g.frontWidth : a) - h * 2), Math.max(1, f - d - h * 2), !g && a >= 6 ? 1.5 : 0), y = (l < d ? `M${c},${l}V${V(d)}` : "") + (u > f ? `M${c},${V(f)}V${u}` : "");
47
47
  return {
48
- body: m ? null : v,
49
- hollow: m ? v : null,
48
+ body: p ? null : v,
49
+ hollow: p ? v : null,
50
50
  stroke: y,
51
51
  side: g?.side ?? null,
52
52
  top: g?.top ?? null
53
53
  };
54
54
  }
55
- function H(e, t, n, r, i, a, o = !1) {
56
- let s = new S(), c = new S(), l = new S(), u = new S(), d = new S();
57
- for (let { row: f, cx: p } of h(e, r)) {
58
- let e = z(f, t, n);
55
+ function te(t, n, r, i, a, o, s = !1) {
56
+ let c = new l(), u = new l(), d = new l(), f = new l(), p = new l();
57
+ for (let { row: l, cx: m } of e(t, i)) {
58
+ let e = H(l, n, r);
59
59
  if (!e) continue;
60
- let m = a(f, e), h = V(p, e, r, i, o);
61
- h.side && u.add(m, h.side), h.top && d.add(m, h.top), h.body && s.add(m, h.body), h.hollow && c.add(m, h.hollow), h.stroke && l.add(m, h.stroke);
60
+ let t = o(l, e), h = W(m, e, i, a, s);
61
+ h.side && f.add(t, h.side), h.top && p.add(t, h.top), h.body && c.add(t, h.body), h.hollow && u.add(t, h.hollow), h.stroke && d.add(t, h.stroke);
62
62
  }
63
63
  return {
64
- bodies: s.entries(),
65
- hollow: c.entries(),
66
- strokes: l.entries(),
67
- sides: u.entries(),
68
- tops: d.entries()
64
+ bodies: c.entries(),
65
+ hollow: u.entries(),
66
+ strokes: d.entries(),
67
+ sides: f.entries(),
68
+ tops: p.entries()
69
69
  };
70
70
  }
71
71
  //#endregion
72
72
  //#region src/finance/candles.tsx
73
- function U(e, t, n) {
74
- return a(e, t, n.up ? I : L);
73
+ function G(e, t, n) {
74
+ return E(e, t, n.up ? z : B);
75
75
  }
76
- function W({ paths: e, display: t }) {
76
+ function ne({ paths: e, display: t }) {
77
77
  let n = t === "ohlc" ? 1.5 : 1;
78
- return /* @__PURE__ */ F(N, { children: [
79
- e.strokes.map(({ color: e, d: r }) => /* @__PURE__ */ P("path", {
78
+ return /* @__PURE__ */ R(I, { children: [
79
+ e.strokes.map(({ color: e, d: r }) => /* @__PURE__ */ L("path", {
80
80
  d: r,
81
81
  fill: "none",
82
82
  strokeWidth: n,
83
83
  strokeLinecap: t === "ohlc" ? "round" : "butt",
84
84
  style: { stroke: e }
85
85
  }, `stroke-${e}`)),
86
- e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ P("path", {
86
+ e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
87
87
  d: t,
88
- style: { fill: v(e).side }
88
+ style: { fill: u(e).side }
89
89
  }, `side-${e}`)),
90
- e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ P("path", {
90
+ e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
91
91
  d: t,
92
- style: { fill: v(e).top }
92
+ style: { fill: u(e).top }
93
93
  }, `top-${e}`)),
94
- e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ P("path", {
94
+ e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
95
95
  d: t,
96
96
  style: { fill: e }
97
97
  }, `body-${e}`)),
98
- e.hollow.map(({ color: e, d: t }) => /* @__PURE__ */ P("path", {
98
+ e.hollow.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
99
99
  d: t,
100
100
  strokeWidth: 1,
101
101
  style: {
@@ -105,61 +105,99 @@ function W({ paths: e, display: t }) {
105
105
  }, `hollow-${e}`))
106
106
  ] });
107
107
  }
108
- var G = r(function({ series: t, open: n, high: r, low: i, display: a = "candle", depth: o = !1, className: c }) {
109
- let l = e("Candles", t, [
108
+ var re = s(function({ series: e, open: t, high: n, low: r, display: a = "candle", depth: o = !1, className: s }) {
109
+ let c = C("Candles", e, [
110
+ t,
110
111
  n,
111
- r,
112
- i
113
- ], "column"), { snapshot: u, descriptor: d, scales: f } = l, p = j(() => {
114
- let e = {
115
- open: n,
116
- high: r,
117
- low: i
112
+ r
113
+ ], "column"), { snapshot: l, descriptor: u, scales: d } = c, f = N(() => {
114
+ let i = {
115
+ open: t,
116
+ high: n,
117
+ low: r
118
118
  };
119
- return B(u.data.rows, t, e), H(u.data.rows, t, e, f, a, (e, t) => U(d, e, t), o);
119
+ return U(l.data.rows, e, i), te(l.data.rows, e, i, d, a, (e, t) => G(u, e, t), o);
120
120
  }, [
121
- u,
121
+ l,
122
+ e,
122
123
  t,
123
124
  n,
124
125
  r,
125
- i,
126
- f,
127
- a,
128
126
  d,
127
+ a,
128
+ u,
129
129
  o
130
130
  ]);
131
- return /* @__PURE__ */ F("g", {
131
+ return /* @__PURE__ */ R("g", {
132
132
  "aria-hidden": "true",
133
- className: ["lilt-chart__candles", c].filter(Boolean).join(" "),
134
- "data-series": t,
133
+ className: ["lilt-chart__candles", s].filter(Boolean).join(" "),
134
+ "data-series": e,
135
135
  "data-display": a,
136
- clipPath: o ? `url(#${l.depthClip.id})` : l.clipPath,
137
- mask: l.mask,
136
+ clipPath: o ? `url(#${c.depthClip.id})` : c.clipPath,
137
+ mask: c.mask,
138
138
  style: {
139
- opacity: l.opacity,
140
- transition: l.reducedMotion ? void 0 : "opacity 160ms ease-out"
139
+ opacity: c.opacity,
140
+ transition: c.reducedMotion ? void 0 : "opacity 160ms ease-out"
141
141
  },
142
- children: [o ? /* @__PURE__ */ P(s, { clip: l.depthClip }) : null, /* @__PURE__ */ P(W, {
143
- paths: p,
142
+ children: [o ? /* @__PURE__ */ L(i, { clip: c.depthClip }) : null, /* @__PURE__ */ L(ne, {
143
+ paths: f,
144
144
  display: a
145
145
  })]
146
146
  });
147
147
  }, {
148
148
  layout: "column",
149
+ loading: (e) => ({
150
+ kind: e.display === "ohlc" ? "ohlc" : "candle",
151
+ depth: e.depth && e.display !== "ohlc",
152
+ render: ({ cx: t, low: n, high: r, scales: i, mask: a }) => {
153
+ let o = a ? "white" : "color-mix(in srgb, var(--lilt-skeleton) 64%, var(--lilt-surface))", s = W(t, {
154
+ low: n,
155
+ high: r,
156
+ open: n + (r - n) * .28,
157
+ close: r - (r - n) * .23,
158
+ up: !0
159
+ }, i, e.display ?? "candle", e.depth), c = u(o);
160
+ return /* @__PURE__ */ R(I, { children: [
161
+ s.stroke ? /* @__PURE__ */ L("path", {
162
+ d: s.stroke,
163
+ fill: "none",
164
+ stroke: o,
165
+ strokeWidth: 1.5
166
+ }) : null,
167
+ s.side ? /* @__PURE__ */ L("path", {
168
+ d: s.side,
169
+ fill: a ? o : c.side
170
+ }) : null,
171
+ s.top ? /* @__PURE__ */ L("path", {
172
+ d: s.top,
173
+ fill: a ? o : c.top
174
+ }) : null,
175
+ s.body ? /* @__PURE__ */ L("path", {
176
+ d: s.body,
177
+ fill: o
178
+ }) : null,
179
+ s.hollow ? /* @__PURE__ */ L("path", {
180
+ d: s.hollow,
181
+ fill: a ? "black" : "var(--lilt-surface)",
182
+ stroke: o
183
+ }) : null
184
+ ] });
185
+ }
186
+ }),
149
187
  series: (e) => e.series,
150
188
  fields: (e) => [
151
189
  e.open,
152
190
  e.high,
153
191
  e.low
154
192
  ],
155
- highlight: (e, { row: t, snapshot: n, descriptor: r }) => {
156
- let i = z(t, e.series, e);
157
- if (!i) return null;
158
- let a = e.display ?? "candle", s = o(n, e.series), c = V(s.x(t.x), i, s, a, e.depth), l = U(r, t, i);
159
- return /* @__PURE__ */ P("g", {
193
+ highlight: (e, { row: n, snapshot: r, descriptor: i }) => {
194
+ let a = H(n, e.series, e);
195
+ if (!a) return null;
196
+ let o = e.display ?? "candle", s = t(r, e.series), c = W(s.x(n.x), a, s, o, e.depth), l = G(i, n, a);
197
+ return /* @__PURE__ */ L("g", {
160
198
  className: "lilt-chart__candle-highlight",
161
- children: /* @__PURE__ */ P(W, {
162
- display: a,
199
+ children: /* @__PURE__ */ L(ne, {
200
+ display: o,
163
201
  paths: {
164
202
  bodies: c.body ? [{
165
203
  color: l,
@@ -188,29 +226,30 @@ var G = r(function({ series: t, open: n, high: r, low: i, display: a = "candle",
188
226
  });
189
227
  //#endregion
190
228
  //#region src/finance/cards/pane.tsx
191
- function K({ context: e, label: t, caption: r, readout: i, series: a, height: o, y: s, bars: c, xAxis: l = !1, children: u }) {
192
- let [d, m] = M(null), h = d ?? e.data.at(-1) ?? null;
193
- return /* @__PURE__ */ F("div", {
229
+ function K({ context: e, label: t, caption: n, readout: r, series: i, height: o, y: s, bars: c, xAxis: l = !1, children: u }) {
230
+ let [f, p] = F(null), m = f ?? e.data.at(-1) ?? null;
231
+ return /* @__PURE__ */ R("div", {
194
232
  className: "lilt-card__pane",
195
- children: [r ? /* @__PURE__ */ F("span", {
233
+ children: [n ? /* @__PURE__ */ R("span", {
196
234
  className: "lilt-card__pane-caption",
197
235
  "aria-hidden": "true",
198
- children: [/* @__PURE__ */ P("span", {
236
+ children: [/* @__PURE__ */ L("span", {
199
237
  className: "lilt-card__pane-name",
200
- children: r
201
- }), i && h && !e.loading ? i(h) : null]
202
- }) : null, /* @__PURE__ */ P(f, {
238
+ children: n
239
+ }), r && m && !e.loading ? r(m) : null]
240
+ }) : null, /* @__PURE__ */ L(y, {
203
241
  className: "lilt-card__chart",
204
242
  "aria-label": t,
205
243
  data: e.data,
206
244
  x: e.x,
207
245
  y: s,
208
- series: a,
246
+ series: i,
209
247
  controller: e.controller,
210
- onSelectionChange: i ? (e) => m(e?.row ?? null) : void 0,
248
+ onSelectionChange: r ? (e) => p(e?.row ?? null) : void 0,
211
249
  motion: e.motion,
212
250
  status: e.loading ? "loading" : "ready",
213
- children: /* @__PURE__ */ F(n, {
251
+ loadingStyle: e.loadingStyle,
252
+ children: /* @__PURE__ */ R(a, {
214
253
  height: o,
215
254
  margins: {
216
255
  ...e.margins,
@@ -223,7 +262,7 @@ function K({ context: e, label: t, caption: r, readout: i, series: a, height: o,
223
262
  slots: e.slots || !!c,
224
263
  bars: c,
225
264
  background: "none",
226
- children: [u, l ? /* @__PURE__ */ P(p, { labels: "fit" }) : null]
265
+ children: [u, l ? /* @__PURE__ */ L(d, { labels: "fit" }) : null]
227
266
  })
228
267
  })]
229
268
  });
@@ -238,57 +277,57 @@ function J(e, t, n) {
238
277
  let r = e.length ? q(e[0], t) : null, i = e.length ? q(e.at(-1), n) : null;
239
278
  return r && i !== null ? i / r - 1 : void 0;
240
279
  }
241
- function ne(e) {
280
+ function ie(e) {
242
281
  return (t) => {
243
282
  let n = t.series[0]?.fields;
244
283
  return !n?.length || n.some((e) => e.value === null) ? null : n.map((t) => `${t.label[0]} ${e(t.value)}`).join(" ");
245
284
  };
246
285
  }
247
- var re = {
286
+ var ae = {
248
287
  minimumFractionDigits: 2,
249
288
  maximumFractionDigits: 2
250
289
  };
251
- function ie({ open: e, high: n, low: r, close: i, volume: a, display: o = "candle", depth: s = !1, scale: c = "linear", label: l = "Price", live: d = !1, data: f, ranges: p, delta: m, valueFormat: h = re, locale: g = "en-US", volumeHeight: _ = 64, ...v }) {
252
- let x = j(() => y(g, h).full, [g, JSON.stringify(h)]), S = j(() => y(g).compact, [g]), C = j(() => p?.map((t) => ({
290
+ function oe({ open: e, high: t, low: n, close: i, volume: a, display: o = "candle", depth: s = !1, scale: c = "linear", label: l = "Price", live: u = !1, data: d, ranges: f, delta: m, valueFormat: h = ae, locale: _ = "en-US", volumeHeight: y = 64, ...b }) {
291
+ let x = N(() => g(_, h).full, [_, JSON.stringify(h)]), S = N(() => g(_).compact, [_]), C = N(() => f?.map((t) => ({
253
292
  ...t,
254
293
  delta: t.delta ?? J(t.data, e, i)
255
294
  })), [
256
- p,
295
+ f,
257
296
  e,
258
297
  i
259
- ]), T = (J(f ?? p?.[0]?.data ?? [], e, i) ?? 0) >= 0, E = (t) => (q(t, i) ?? 0) >= (q(t, e) ?? 0), D = o === "area", O = {
298
+ ]), T = (J(d ?? f?.[0]?.data ?? [], e, i) ?? 0) >= 0, E = (t) => (q(t, i) ?? 0) >= (q(t, e) ?? 0), D = o === "area", O = {
260
299
  open: {
261
300
  label: "Open",
262
301
  accessor: (t) => q(t, e)
263
302
  },
264
303
  high: {
265
304
  label: "High",
266
- accessor: (e) => q(e, n)
305
+ accessor: (e) => q(e, t)
267
306
  },
268
307
  low: {
269
308
  label: "Low",
270
- accessor: (e) => q(e, r)
309
+ accessor: (e) => q(e, n)
271
310
  }
272
311
  };
273
- return /* @__PURE__ */ P(b, {
274
- ...v,
312
+ return /* @__PURE__ */ L(v, {
313
+ ...b,
275
314
  depth: s,
276
- data: f,
315
+ data: d,
277
316
  ranges: C,
278
- delta: m ?? (f ? J(f, e, i) : void 0),
317
+ delta: m ?? (d ? J(d, e, i) : void 0),
279
318
  valueFormat: h,
280
- locale: g,
319
+ locale: _,
281
320
  aggregate: "last",
282
321
  tiles: !1,
283
- live: d,
322
+ live: u,
284
323
  series: [{
285
324
  key: i,
286
325
  label: l,
287
- color: D ? T ? I : L : void 0
326
+ color: D ? T ? z : B : void 0
288
327
  }],
289
328
  shape: {
290
329
  kind: "marks",
291
- id: `candles:${o}:${s}:${c}:${e}:${n}:${r}:${!!a}`,
330
+ id: `candles:${o}:${s}:${c}:${e}:${t}:${n}:${!!a}`,
292
331
  includeZero: !1,
293
332
  scale: c,
294
333
  slots: !0,
@@ -301,8 +340,8 @@ function ie({ open: e, high: n, low: r, close: i, volume: a, display: o = "candl
301
340
  fields: O,
302
341
  line: { showInspectionPoint: !1 }
303
342
  },
304
- describe: ne(x),
305
- draw: (e) => e.map((e) => D ? [/* @__PURE__ */ P(t, { series: e }, `area-${e}`), /* @__PURE__ */ P(u, { series: e }, `line-${e}`)] : /* @__PURE__ */ P(G, {
343
+ describe: ie(x),
344
+ draw: (e) => e.map((e) => D ? [/* @__PURE__ */ L(r, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, `line-${e}`)] : /* @__PURE__ */ L(re, {
306
345
  series: e,
307
346
  open: "open",
308
347
  high: "high",
@@ -311,11 +350,11 @@ function ie({ open: e, high: n, low: r, close: i, volume: a, display: o = "candl
311
350
  depth: s
312
351
  }, e))
313
352
  },
314
- panes: a ? (e) => /* @__PURE__ */ P(K, {
353
+ panes: a ? (e) => /* @__PURE__ */ L(K, {
315
354
  context: e,
316
- label: `${v.title} volume`,
355
+ label: `${b.title} volume`,
317
356
  caption: "Volume",
318
- height: _,
357
+ height: y,
319
358
  xAxis: !0,
320
359
  y: {
321
360
  includeZero: !0,
@@ -331,7 +370,7 @@ function ie({ open: e, high: n, low: r, close: i, volume: a, display: o = "candl
331
370
  colorAt: (e) => E(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
332
371
  bar: { radius: 1 }
333
372
  }],
334
- children: /* @__PURE__ */ P(w, { series: "volume" })
373
+ children: /* @__PURE__ */ L(p, { series: "volume" })
335
374
  }) : void 0
336
375
  });
337
376
  }
@@ -340,11 +379,11 @@ function ie({ open: e, high: n, low: r, close: i, volume: a, display: o = "candl
340
379
  function Y(e) {
341
380
  return typeof e == "number" && Number.isFinite(e);
342
381
  }
343
- function ae(e, t) {
382
+ function se(e, t) {
344
383
  if (!Number.isInteger(t) || t < 1) throw Error(`Lilt ${e} period must be a positive integer; received ${t}.`);
345
384
  }
346
- function oe(e, t) {
347
- ae("sma", t);
385
+ function ce(e, t) {
386
+ se("sma", t);
348
387
  let n = [], r = 0, i = 0;
349
388
  for (let a = 0; a < e.length; a += 1) {
350
389
  let o = e[a];
@@ -355,7 +394,7 @@ function oe(e, t) {
355
394
  return n;
356
395
  }
357
396
  function X(e, t) {
358
- ae("ema", t);
397
+ se("ema", t);
359
398
  let n = 2 / (t + 1), r = [], i = null, a = [];
360
399
  for (let o of e) {
361
400
  if (!Y(o)) {
@@ -370,8 +409,8 @@ function X(e, t) {
370
409
  }
371
410
  return r;
372
411
  }
373
- function se(e, t = 14) {
374
- ae("rsi", t);
412
+ function le(e, t = 14) {
413
+ se("rsi", t);
375
414
  let n = e.map(() => null), r = null, i = 0, a = 0, o = 0, s = 0, c = 0;
376
415
  return e.forEach((e, l) => {
377
416
  if (!Y(e)) return;
@@ -389,7 +428,7 @@ function se(e, t = 14) {
389
428
  n[l] = c === 0 ? s === 0 ? 50 : 100 : 100 - 100 / (1 + s / c);
390
429
  }), n;
391
430
  }
392
- function ce(e, t = 12, n = 26, r = 9) {
431
+ function ue(e, t = 12, n = 26, r = 9) {
393
432
  if (t >= n) throw Error("Lilt macd needs a fast period shorter than the slow period.");
394
433
  let i = X(e, t), a = X(e, n), o = e.map((e, t) => {
395
434
  let n = i[t], r = a[t];
@@ -404,8 +443,8 @@ function ce(e, t = 12, n = 26, r = 9) {
404
443
  })
405
444
  };
406
445
  }
407
- function le(e, t = 20, n = 2) {
408
- let r = oe(e, t), i = [], a = [];
446
+ function de(e, t = 20, n = 2) {
447
+ let r = ce(e, t), i = [], a = [];
409
448
  return r.forEach((r, o) => {
410
449
  if (r === null) {
411
450
  i.push(null), a.push(null);
@@ -421,19 +460,19 @@ function le(e, t = 20, n = 2) {
421
460
  lower: a
422
461
  };
423
462
  }
424
- function ue(e) {
463
+ function fe(e) {
425
464
  let t = -Infinity;
426
465
  return e.map((e) => Y(e) ? (t = Math.max(t, e), t > 0 ? e / t - 1 : 0) : null);
427
466
  }
428
- function de(e) {
467
+ function pe(e) {
429
468
  let t = e.find(Y);
430
469
  return e.map((e) => Y(e) && t !== void 0 && t !== 0 ? e / t - 1 : null);
431
470
  }
432
- function fe(e, t) {
471
+ function me(e, t) {
433
472
  for (let n of t) if (!Y(n.price) || !Y(n.size) || n.size < 0) throw Error(`Lilt order book ${e} need finite prices and non-negative sizes; received ${n.price} × ${n.size}.`);
434
473
  }
435
- function pe(e, t) {
436
- fe("bids", e), fe("asks", t);
474
+ function he(e, t) {
475
+ me("bids", e), me("asks", t);
437
476
  let n = (e) => {
438
477
  let t = /* @__PURE__ */ new Map();
439
478
  for (let n of e) t.set(n.price, (t.get(n.price) ?? 0) + n.size);
@@ -468,7 +507,7 @@ function pe(e, t) {
468
507
  }
469
508
  //#endregion
470
509
  //#region src/finance/cards/indicator-chart-card.tsx
471
- function me(e) {
510
+ function ge(e) {
472
511
  return e.map((e, t) => {
473
512
  let n = typeof e == "string" ? { kind: e } : e, r = "period" in n && n.period !== void 0 ? n.period : (n.kind, 20), i = "deviations" in n && n.deviations !== void 0 ? n.deviations : 2, a = n.kind === "bollinger" ? "BB" : n.kind.toUpperCase();
474
513
  return {
@@ -480,7 +519,7 @@ function me(e) {
480
519
  };
481
520
  });
482
521
  }
483
- function he(e) {
522
+ function _e(e) {
484
523
  return e.map((e, t) => {
485
524
  let n = typeof e == "string" ? { kind: e } : e;
486
525
  return {
@@ -498,39 +537,39 @@ function Z(e, t) {
498
537
  let n = e[t];
499
538
  return typeof n == "number" && Number.isFinite(n) ? n : null;
500
539
  }
501
- function ge(e, t, n, r) {
540
+ function ve(e, t, n, r) {
502
541
  let i = e.map((e) => Z(e, t)), a = e.map((e) => ({ ...e })), o = (e, t) => t.forEach((t, n) => a[n][e] = t);
503
542
  for (let e of n) if (e.kind === "bollinger") {
504
- let t = le(i, e.period, e.deviations);
543
+ let t = de(i, e.period, e.deviations);
505
544
  o(e.id, t.middle), o(`${e.id}Upper`, t.upper), o(`${e.id}Lower`, t.lower);
506
- } else o(e.id, (e.kind === "sma" ? oe : X)(i, e.period));
507
- for (let e of r) if (e.kind === "rsi" && o(e.id, se(i, e.period)), e.kind === "macd") {
508
- let t = ce(i, e.fast, e.slow, e.signal);
545
+ } else o(e.id, (e.kind === "sma" ? ce : X)(i, e.period));
546
+ for (let e of r) if (e.kind === "rsi" && o(e.id, le(i, e.period)), e.kind === "macd") {
547
+ let t = ue(i, e.fast, e.slow, e.signal);
509
548
  o(`${e.id}Macd`, t.macd), o(`${e.id}Signal`, t.signal), o(`${e.id}Histogram`, t.histogram);
510
549
  }
511
550
  return a;
512
551
  }
513
- var _e = {
552
+ var ye = {
514
553
  minimumFractionDigits: 2,
515
554
  maximumFractionDigits: 2
516
- }, ve = [
555
+ }, be = [
517
556
  "var(--lilt-series-4)",
518
557
  "var(--lilt-series-3)",
519
558
  "var(--lilt-series-5)"
520
559
  ];
521
- function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: s = ["rsi", "macd"], label: c = "Price", scale: l = "linear", live: f = !1, data: p, ranges: m, delta: h, valueFormat: _ = _e, locale: v = "en-US", paneHeight: x = 72, ...S }) {
560
+ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: s = ["rsi", "macd"], label: l = "Price", scale: u = "linear", live: d = !1, data: f, ranges: m, delta: _, valueFormat: y = ye, locale: b = "en-US", paneHeight: S = 72, ...C }) {
522
561
  let T = !!(t && n && r), E = a ?? (T ? "candle" : "line");
523
562
  if (E !== "line" && !T) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
524
- let D = JSON.stringify(o), O = JSON.stringify(s), k = j(() => me(o), [D]), A = j(() => he(s), [O]);
563
+ let D = JSON.stringify(o), O = JSON.stringify(s), k = N(() => ge(o), [D]), A = N(() => _e(s), [O]);
525
564
  if (A.some((e) => e.kind === "volume") && !i) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
526
- let ee = j(() => p ? ge(p, e, k, A) : void 0, [
527
- p,
565
+ let j = N(() => f ? ve(f, e, k, A) : void 0, [
566
+ f,
528
567
  e,
529
568
  k,
530
569
  A
531
- ]), te = j(() => m?.map((n) => ({
570
+ ]), ee = N(() => m?.map((n) => ({
532
571
  ...n,
533
- data: ge(n.data, e, k, A),
572
+ data: ve(n.data, e, k, A),
534
573
  delta: n.delta ?? (t ? J(n.data, t, e) : void 0)
535
574
  })), [
536
575
  m,
@@ -538,7 +577,7 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
538
577
  t,
539
578
  k,
540
579
  A
541
- ]), M = j(() => y(v, _).full, [v, JSON.stringify(_)]), R = j(() => y(v, { maximumFractionDigits: 2 }).full, [v]), z = j(() => y(v).compact, [v]), B = T ? {
580
+ ]), M = N(() => g(b, y).full, [b, JSON.stringify(y)]), P = N(() => g(b, { maximumFractionDigits: 2 }).full, [b]), F = N(() => g(b).compact, [b]), V = T ? {
542
581
  open: {
543
582
  label: "Open",
544
583
  accessor: (e) => Z(e, t)
@@ -551,46 +590,46 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
551
590
  label: "Low",
552
591
  accessor: (e) => Z(e, r)
553
592
  }
554
- } : void 0, V = new Map(k.map((e) => [e.id, e])), H = p?.length ? Z(p[0], e) : null, U = p?.length ? Z(p.at(-1), e) : null, W = H === null || U === null || U >= H, q = A.at(-1)?.id, re = (n, r) => {
555
- let a = n.id === q, o = (e) => (t) => Z(t, e), s = (e, t, n) => {
593
+ } : void 0, H = new Map(k.map((e) => [e.id, e])), U = f?.length ? Z(f[0], e) : null, W = f?.length ? Z(f.at(-1), e) : null, te = U === null || W === null || W >= U, G = A.at(-1)?.id, ne = (n, r) => {
594
+ let a = n.id === G, o = (e) => (t) => Z(t, e), s = (e, t, n) => {
556
595
  let r = Z(e, t);
557
- return /* @__PURE__ */ F("span", {
596
+ return /* @__PURE__ */ R("span", {
558
597
  className: "lilt-card__pane-value",
559
- children: [n ? `${n} ` : "", r === null ? "—" : R(r)]
598
+ children: [n ? `${n} ` : "", r === null ? "—" : P(r)]
560
599
  }, t);
561
600
  };
562
- if (n.kind === "volume") return /* @__PURE__ */ P(K, {
601
+ if (n.kind === "volume") return /* @__PURE__ */ L(K, {
563
602
  context: r,
564
- label: `${S.title} volume`,
603
+ label: `${C.title} volume`,
565
604
  caption: "Volume",
566
- readout: (e) => /* @__PURE__ */ P("span", {
605
+ readout: (e) => /* @__PURE__ */ L("span", {
567
606
  className: "lilt-card__pane-value",
568
- children: Z(e, i) === null ? "—" : z(Z(e, i))
607
+ children: Z(e, i) === null ? "—" : F(Z(e, i))
569
608
  }),
570
- height: x,
609
+ height: S,
571
610
  xAxis: a,
572
611
  y: {
573
612
  includeZero: !0,
574
613
  ticks: 2,
575
- format: z
614
+ format: F
576
615
  },
577
616
  bars: { series: ["volume"] },
578
617
  series: [{
579
618
  id: "volume",
580
619
  label: "Volume",
581
620
  accessor: o(i),
582
- formatValue: z,
621
+ formatValue: F,
583
622
  colorAt: (n) => (Z(n, e) ?? 0) >= (Z(n, t) ?? Z(n, e) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
584
623
  bar: { radius: 1 }
585
624
  }],
586
- children: /* @__PURE__ */ P(w, { series: "volume" })
625
+ children: /* @__PURE__ */ L(p, { series: "volume" })
587
626
  }, n.id);
588
- if (n.kind === "rsi") return /* @__PURE__ */ F(K, {
627
+ if (n.kind === "rsi") return /* @__PURE__ */ R(K, {
589
628
  context: r,
590
- label: `${S.title} RSI ${n.period}`,
629
+ label: `${C.title} RSI ${n.period}`,
591
630
  caption: `RSI ${n.period}`,
592
631
  readout: (e) => s(e, n.id),
593
- height: x,
632
+ height: S,
594
633
  xAxis: a,
595
634
  y: {
596
635
  domain: [0, 100],
@@ -602,51 +641,51 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
602
641
  label: `RSI ${n.period}`,
603
642
  accessor: o(n.id),
604
643
  color: "var(--lilt-series-1)",
605
- formatValue: R,
644
+ formatValue: P,
606
645
  line: {
607
646
  width: 1.5,
608
- depth: S.depth
647
+ depth: C.depth
609
648
  }
610
649
  }],
611
650
  children: [
612
- /* @__PURE__ */ P(d, {
651
+ /* @__PURE__ */ L(h, {
613
652
  axis: "y",
614
653
  from: 30,
615
654
  to: 70,
616
655
  color: "var(--lilt-series-1)"
617
656
  }),
618
- /* @__PURE__ */ P(g, {
657
+ /* @__PURE__ */ L(x, {
619
658
  value: 70,
620
659
  color: "var(--lilt-muted)"
621
660
  }),
622
- /* @__PURE__ */ P(g, {
661
+ /* @__PURE__ */ L(x, {
623
662
  value: 30,
624
663
  color: "var(--lilt-muted)"
625
664
  }),
626
- /* @__PURE__ */ P(u, { series: n.id })
665
+ /* @__PURE__ */ L(w, { series: n.id })
627
666
  ]
628
667
  }, n.id);
629
- let c = `${n.id}Macd`, l = `${n.id}Signal`, f = `${n.id}Histogram`;
630
- return /* @__PURE__ */ F(K, {
668
+ let c = `${n.id}Macd`, l = `${n.id}Signal`, u = `${n.id}Histogram`;
669
+ return /* @__PURE__ */ R(K, {
631
670
  context: r,
632
- label: `${S.title} MACD`,
671
+ label: `${C.title} MACD`,
633
672
  caption: `MACD ${n.fast} · ${n.slow} · ${n.signal}`,
634
673
  readout: (e) => [s(e, c), s(e, l, "Signal")],
635
- height: x,
674
+ height: S,
636
675
  xAxis: a,
637
676
  y: {
638
677
  includeZero: !0,
639
678
  ticks: 2,
640
- format: R
679
+ format: P
641
680
  },
642
- bars: { series: [f] },
681
+ bars: { series: [u] },
643
682
  series: [
644
683
  {
645
- id: f,
684
+ id: u,
646
685
  label: "Histogram",
647
- accessor: o(f),
648
- formatValue: R,
649
- colorAt: (e) => (Z(e, f) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
686
+ accessor: o(u),
687
+ formatValue: P,
688
+ colorAt: (e) => (Z(e, u) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
650
689
  bar: { radius: 1 }
651
690
  },
652
691
  {
@@ -654,10 +693,10 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
654
693
  label: "MACD",
655
694
  accessor: o(c),
656
695
  color: "var(--lilt-series-4)",
657
- formatValue: R,
696
+ formatValue: P,
658
697
  line: {
659
698
  width: 1.5,
660
- depth: S.depth
699
+ depth: C.depth
661
700
  }
662
701
  },
663
702
  {
@@ -665,7 +704,7 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
665
704
  label: "Signal",
666
705
  accessor: o(l),
667
706
  color: "var(--lilt-series-3)",
668
- formatValue: R,
707
+ formatValue: P,
669
708
  line: {
670
709
  width: 1.5,
671
710
  dasharray: "3 3"
@@ -673,48 +712,48 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
673
712
  }
674
713
  ],
675
714
  children: [
676
- /* @__PURE__ */ P(w, { series: f }),
677
- /* @__PURE__ */ P(u, { series: c }),
678
- /* @__PURE__ */ P(u, { series: l })
715
+ /* @__PURE__ */ L(p, { series: u }),
716
+ /* @__PURE__ */ L(w, { series: c }),
717
+ /* @__PURE__ */ L(w, { series: l })
679
718
  ]
680
719
  }, n.id);
681
720
  };
682
- return /* @__PURE__ */ P(b, {
683
- ...S,
684
- data: ee,
685
- ranges: te,
686
- delta: h ?? (p && t ? J(p, t, e) : void 0),
687
- valueFormat: _,
688
- locale: v,
721
+ return /* @__PURE__ */ L(v, {
722
+ ...C,
723
+ data: j,
724
+ ranges: ee,
725
+ delta: _ ?? (f && t ? J(f, t, e) : void 0),
726
+ valueFormat: y,
727
+ locale: b,
689
728
  aggregate: "last",
690
729
  headlineSeries: e,
691
730
  pillSeries: e,
692
731
  tiles: !1,
693
- live: f,
732
+ live: d,
694
733
  series: [{
695
734
  key: e,
696
- label: c,
697
- color: E === "line" ? W ? I : L : void 0
735
+ label: l,
736
+ color: E === "line" ? te ? z : B : void 0
698
737
  }, ...k.map((e, t) => ({
699
738
  key: e.id,
700
739
  label: e.label,
701
- color: ve[t % ve.length]
740
+ color: be[t % be.length]
702
741
  }))],
703
742
  shape: {
704
743
  kind: "marks",
705
- id: `indicator:${E}:${l}:${t}:${n}:${r}:${D}:${O}`,
744
+ id: `indicator:${E}:${u}:${t}:${n}:${r}:${D}:${O}`,
706
745
  includeZero: !1,
707
- scale: l,
746
+ scale: u,
708
747
  slots: !0,
709
748
  xAxis: A.length === 0,
710
749
  series: (e) => {
711
- let t = V.get(e);
750
+ let t = H.get(e);
712
751
  return t ? {
713
752
  curve: "monotone",
714
753
  line: {
715
754
  width: 1.5,
716
755
  showInspectionPoint: !1,
717
- depth: S.depth
756
+ depth: C.depth
718
757
  },
719
758
  ...t.kind === "bollinger" ? { fields: {
720
759
  upper: {
@@ -727,50 +766,51 @@ function ye({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
727
766
  }
728
767
  } } : {}
729
768
  } : E === "line" ? {
730
- fields: B,
769
+ fields: V,
731
770
  curve: "linear",
732
771
  line: {
733
772
  width: 2,
734
- depth: S.depth
773
+ depth: C.depth
735
774
  }
736
- } : { fields: B };
775
+ } : { fields: V };
737
776
  },
738
- describe: T ? ne(M) : void 0,
777
+ describe: T ? ie(M) : void 0,
739
778
  draw: (e) => e.map((e) => {
740
- let t = V.get(e);
741
- return t ? t.kind === "bollinger" ? [/* @__PURE__ */ P(C, {
779
+ let t = H.get(e);
780
+ return t ? t.kind === "bollinger" ? [/* @__PURE__ */ L(c, {
742
781
  series: e,
743
782
  lower: "lower",
744
783
  upper: "upper"
745
- }, `band-${e}`), /* @__PURE__ */ P(u, { series: e }, `line-${e}`)] : /* @__PURE__ */ P(u, { series: e }, e) : E === "line" ? /* @__PURE__ */ P(u, { series: e }, e) : /* @__PURE__ */ P(G, {
784
+ }, `band-${e}`), /* @__PURE__ */ L(w, { series: e }, `line-${e}`)] : /* @__PURE__ */ L(w, { series: e }, e) : E === "line" ? /* @__PURE__ */ L(w, { series: e }, e) : /* @__PURE__ */ L(re, {
746
785
  series: e,
747
786
  open: "open",
748
787
  high: "high",
749
788
  low: "low",
750
- display: E
789
+ display: E,
790
+ depth: C.depth
751
791
  }, e);
752
792
  })
753
793
  },
754
- panes: A.length ? (e) => /* @__PURE__ */ P(N, { children: A.map((t) => re(t, e)) }) : void 0
794
+ panes: A.length ? (e) => /* @__PURE__ */ L(I, { children: A.map((t) => ne(t, e)) }) : void 0
755
795
  });
756
796
  }
757
797
  //#endregion
758
798
  //#region src/finance/cards/depth-chart-card.tsx
759
- function be({ price: e, label: t }) {
799
+ function Se({ price: e, label: t }) {
760
800
  let { snapshot: n } = _();
761
801
  if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
762
802
  let r = n.xToPixel(e);
763
- return /* @__PURE__ */ F("g", {
803
+ return /* @__PURE__ */ R("g", {
764
804
  className: "lilt-card__depth-mid",
765
805
  "aria-hidden": "true",
766
- children: [/* @__PURE__ */ P("line", {
806
+ children: [/* @__PURE__ */ L("line", {
767
807
  x1: r,
768
808
  x2: r,
769
809
  y1: n.plot.top + 18,
770
810
  y2: n.plot.bottom,
771
811
  strokeDasharray: "2 4",
772
812
  vectorEffect: "non-scaling-stroke"
773
- }), /* @__PURE__ */ P("text", {
813
+ }), /* @__PURE__ */ L("text", {
774
814
  x: r,
775
815
  y: n.plot.top + 10,
776
816
  textAnchor: "middle",
@@ -778,100 +818,101 @@ function be({ price: e, label: t }) {
778
818
  })]
779
819
  });
780
820
  }
781
- var xe = {
821
+ var Ce = {
782
822
  style: "currency",
783
823
  currency: "USD",
784
824
  minimumFractionDigits: 2,
785
825
  maximumFractionDigits: 2
786
826
  };
787
- function Se({ title: e, bids: r, asks: i, valueFormat: a = xe, sizeFormat: o, locale: s = "en-US", height: c = 220, axis: d = "minimal", background: m = "dots", hoverStyle: h = "soft", surface: g, numberStyle: _, loading: v = !1, motion: b, className: S, style: C, depth: w = !1 }) {
788
- let T = j(() => pe(r, i), [r, i]), ee = JSON.stringify(a), te = JSON.stringify(o ?? null), N = j(() => y(s, a), [s, ee]), R = j(() => y(s, o), [s, te]), z = j(() => y(s, {
827
+ function we({ title: e, bids: t, asks: n, valueFormat: i = Ce, sizeFormat: o, locale: s = "en-US", height: c = 220, axis: l = "minimal", background: u = "dots", hoverStyle: f = "soft", surface: p, numberStyle: m, loading: h = !1, loadingStyle: _ = "shimmer", motion: v, className: b, style: x, depth: C = !1 }) {
828
+ let E = N(() => he(t, n), [t, n]), D = JSON.stringify(i), M = JSON.stringify(o ?? null), P = N(() => g(s, i), [s, D]), I = N(() => g(s, o), [s, M]), V = N(() => g(s, {
789
829
  style: "percent",
790
830
  maximumFractionDigits: 3
791
- }).full, [s]), [B, V] = M(null), H = j(() => [{
831
+ }).full, [s]), [H, U] = F(null), W = N(() => [{
792
832
  id: "bid",
793
833
  label: "Bids",
794
834
  accessor: (e) => e.bid,
795
- color: I,
835
+ color: z,
796
836
  curve: "step-before",
797
837
  area: { treatment: "fade" },
798
838
  line: {
799
839
  width: 1.5,
800
- depth: w
840
+ depth: C
801
841
  },
802
- formatValue: R.full
842
+ formatValue: I.full
803
843
  }, {
804
844
  id: "ask",
805
845
  label: "Asks",
806
846
  accessor: (e) => e.ask,
807
- color: L,
847
+ color: B,
808
848
  curve: "step-after",
809
849
  area: { treatment: "fade" },
810
850
  line: {
811
851
  width: 1.5,
812
- depth: w
852
+ depth: C
813
853
  },
814
- formatValue: R.full
815
- }], [R, w]), U = T.spread !== null && T.mid ? `${N.full(T.spread)} (${z(T.spread / T.mid)})` : "—", W = B ? B.bid ?? B.ask : null;
816
- return /* @__PURE__ */ F(A, {
854
+ formatValue: I.full
855
+ }], [I, C]), te = E.spread !== null && E.mid ? `${P.full(E.spread)} (${V(E.spread / E.mid)})` : "—", G = H ? H.bid ?? H.ask : null;
856
+ return /* @__PURE__ */ R(ee, {
817
857
  "aria-label": e,
818
- surface: g,
819
- numberStyle: _,
820
- motion: b,
821
- className: ["lilt-card--depth", S].filter(Boolean).join(" "),
822
- style: C,
858
+ surface: p,
859
+ numberStyle: m,
860
+ motion: v,
861
+ className: ["lilt-card--depth", b].filter(Boolean).join(" "),
862
+ style: x,
823
863
  children: [
824
- /* @__PURE__ */ F(k, { children: [/* @__PURE__ */ P(O, { children: e }), /* @__PURE__ */ P(D, {
825
- value: T.mid,
826
- format: N.full,
827
- loading: v,
828
- motion: b,
829
- children: v ? null : B && W !== null ? /* @__PURE__ */ F(E, { children: [
830
- R.full(W),
864
+ /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(A, { children: e }), /* @__PURE__ */ L(k, {
865
+ value: E.mid,
866
+ format: P.full,
867
+ loading: h,
868
+ motion: v,
869
+ children: h ? null : H && G !== null ? /* @__PURE__ */ R(O, { children: [
870
+ I.full(G),
831
871
  " ",
832
- B.side === "bid" ? "bid" : "ask",
872
+ H.side === "bid" ? "bid" : "ask",
833
873
  " depth at",
834
874
  " ",
835
- N.full(B.price)
836
- ] }) : /* @__PURE__ */ P(E, { children: "Mid price" })
875
+ P.full(H.price)
876
+ ] }) : /* @__PURE__ */ L(O, { children: "Mid price" })
837
877
  })] }),
838
- /* @__PURE__ */ F("dl", {
878
+ /* @__PURE__ */ R("dl", {
839
879
  className: "lilt-card__stats",
840
880
  children: [
841
- /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("dt", { children: "Spread" }), /* @__PURE__ */ P("dd", { children: v ? "—" : U })] }),
842
- /* @__PURE__ */ F("div", {
881
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("dt", { children: "Spread" }), /* @__PURE__ */ L("dd", { children: h ? "—" : te })] }),
882
+ /* @__PURE__ */ R("div", {
843
883
  "data-side": "bid",
844
- children: [/* @__PURE__ */ P("dt", { children: "Bid depth" }), /* @__PURE__ */ P("dd", { children: v ? "—" : R.compact(T.bidDepth) })]
884
+ children: [/* @__PURE__ */ L("dt", { children: "Bid depth" }), /* @__PURE__ */ L("dd", { children: h ? "—" : I.compact(E.bidDepth) })]
845
885
  }),
846
- /* @__PURE__ */ F("div", {
886
+ /* @__PURE__ */ R("div", {
847
887
  "data-side": "ask",
848
- children: [/* @__PURE__ */ P("dt", { children: "Ask depth" }), /* @__PURE__ */ P("dd", { children: v ? "—" : R.compact(T.askDepth) })]
888
+ children: [/* @__PURE__ */ L("dt", { children: "Ask depth" }), /* @__PURE__ */ L("dd", { children: h ? "—" : I.compact(E.askDepth) })]
849
889
  })
850
890
  ]
851
891
  }),
852
- /* @__PURE__ */ P(f, {
892
+ /* @__PURE__ */ L(y, {
853
893
  className: "lilt-card__chart",
854
894
  "aria-label": `${e} depth by price`,
855
- data: T.levels,
895
+ data: E.levels,
856
896
  x: {
857
897
  type: "number",
858
898
  accessor: (e) => e.price,
859
- format: N.full
899
+ format: P.full
860
900
  },
861
901
  y: {
862
902
  includeZero: !0,
863
903
  ticks: 3,
864
- format: R.compact
904
+ format: I.compact
865
905
  },
866
- series: H,
867
- onSelectionChange: (e) => V(e?.row ?? null),
868
- motion: b,
869
- status: v ? "loading" : "ready",
870
- children: /* @__PURE__ */ F(n, {
906
+ series: W,
907
+ onSelectionChange: (e) => U(e?.row ?? null),
908
+ motion: v,
909
+ status: h ? "loading" : "ready",
910
+ loadingStyle: _,
911
+ children: /* @__PURE__ */ R(a, {
871
912
  height: c,
872
- axis: d,
873
- background: m,
874
- pill: h,
913
+ axis: l,
914
+ background: u,
915
+ pill: f,
875
916
  margins: {
876
917
  top: 8,
877
918
  right: 4,
@@ -879,17 +920,17 @@ function Se({ title: e, bids: r, asks: i, valueFormat: a = xe, sizeFormat: o, lo
879
920
  left: 4
880
921
  },
881
922
  children: [
882
- /* @__PURE__ */ P(x, { pattern: "lines" }),
883
- /* @__PURE__ */ P(t, { series: "bid" }),
884
- /* @__PURE__ */ P(t, { series: "ask" }),
885
- /* @__PURE__ */ P(u, { series: "bid" }),
886
- /* @__PURE__ */ P(u, { series: "ask" }),
887
- T.mid === null ? null : /* @__PURE__ */ P(be, {
888
- price: T.mid,
889
- label: `Mid ${N.full(T.mid)}`
923
+ /* @__PURE__ */ L(T, { pattern: "lines" }),
924
+ /* @__PURE__ */ L(r, { series: "bid" }),
925
+ /* @__PURE__ */ L(r, { series: "ask" }),
926
+ /* @__PURE__ */ L(w, { series: "bid" }),
927
+ /* @__PURE__ */ L(w, { series: "ask" }),
928
+ E.mid === null ? null : /* @__PURE__ */ L(Se, {
929
+ price: E.mid,
930
+ label: `Mid ${P.full(E.mid)}`
890
931
  }),
891
- /* @__PURE__ */ P(p, { labels: "fit" }),
892
- /* @__PURE__ */ P(l, {})
932
+ /* @__PURE__ */ L(d, { labels: "fit" }),
933
+ /* @__PURE__ */ L(S, {})
893
934
  ]
894
935
  })
895
936
  })
@@ -903,201 +944,201 @@ function Q(e, t) {
903
944
  let n = e[t];
904
945
  return typeof n == "number" && Number.isFinite(n) ? n : null;
905
946
  }
906
- function Ce(e, t, n) {
947
+ function Te(e, t, n) {
907
948
  let r = e.at(-1), i = Q(r, t), a = Q(r, n);
908
949
  return i !== null && a ? i / a - 1 : void 0;
909
950
  }
910
- function we({ value: e, basis: n, label: r = "Value", drawdown: i = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...d }) {
911
- let f = o ?? s?.[0]?.data ?? [], p = j(() => s?.map((t) => ({
912
- ...t,
913
- delta: t.delta ?? Ce(t.data, e, n)
951
+ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
952
+ let d = o ?? s?.[0]?.data ?? [], f = N(() => s?.map((n) => ({
953
+ ...n,
954
+ delta: n.delta ?? Te(n.data, e, t)
914
955
  })), [
915
956
  s,
916
957
  e,
917
- n
918
- ]), m = j(() => y(l, {
958
+ t
959
+ ]), p = N(() => g(l, {
919
960
  style: "percent",
920
961
  minimumFractionDigits: 1,
921
962
  maximumFractionDigits: 1
922
- }).full, [l]), h = j(() => {
923
- let t = ue(f.map((t) => Q(t, e))).filter((e) => e !== null);
963
+ }).full, [l]), m = N(() => {
964
+ let t = fe(d.map((t) => Q(t, e))).filter((e) => e !== null);
924
965
  return t.length ? Math.min(...t) : null;
925
- }, [f, e]);
926
- return /* @__PURE__ */ P(b, {
927
- ...d,
966
+ }, [d, e]);
967
+ return /* @__PURE__ */ L(v, {
968
+ ...u,
928
969
  data: o,
929
- ranges: p,
930
- delta: c ?? (o ? Ce(o, e, n) : void 0),
970
+ ranges: f,
971
+ delta: c ?? (o ? Te(o, e, t) : void 0),
931
972
  locale: l,
932
973
  aggregate: "last",
933
974
  headlineSeries: e,
934
975
  pillSeries: e,
935
976
  tiles: !1,
936
- restCaption: n ? () => "over basis" : void 0,
977
+ restCaption: t ? () => "over basis" : void 0,
937
978
  series: [{
938
979
  key: e,
939
- label: r
940
- }, ...n ? [{
941
- key: n,
980
+ label: n
981
+ }, ...t ? [{
982
+ key: t,
942
983
  label: "Basis",
943
984
  dashed: !0
944
985
  }] : []],
945
986
  shape: {
946
987
  kind: "marks",
947
- id: `portfolio:${e}:${n}:${i}`,
988
+ id: `portfolio:${e}:${t}:${i}:${u.depth}`,
948
989
  includeZero: !1,
949
990
  xAxis: !i,
950
- series: (e) => e === n ? {
991
+ series: (e) => e === t ? {
951
992
  curve: "step-after",
952
993
  color: "var(--lilt-muted)"
953
994
  } : {
954
995
  area: { treatment: "fade" },
955
996
  curve: "monotone"
956
997
  },
957
- draw: (e) => e.map((e) => [/* @__PURE__ */ P(t, { series: e }, `area-${e}`), /* @__PURE__ */ P(u, { series: e }, e)])
998
+ draw: (e) => e.map((e) => [/* @__PURE__ */ L(r, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, e)])
958
999
  },
959
- panes: i ? (n) => {
960
- let r = ue(n.data.map((t) => Q(t, e))), i = new Map(n.data.map((e, t) => [e, r[t] ?? null]));
961
- return /* @__PURE__ */ F(K, {
962
- context: n,
963
- label: `${d.title} drawdown`,
1000
+ panes: i ? (t) => {
1001
+ let n = fe(t.data.map((t) => Q(t, e))), i = new Map(t.data.map((e, t) => [e, n[t] ?? null]));
1002
+ return /* @__PURE__ */ R(K, {
1003
+ context: t,
1004
+ label: `${u.title} drawdown`,
964
1005
  caption: "Drawdown",
965
- readout: (e) => /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
1006
+ readout: (e) => /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("span", {
966
1007
  className: "lilt-card__pane-value",
967
- children: i.get(e) == null ? "—" : m(i.get(e))
968
- }), h === null ? null : /* @__PURE__ */ F("span", {
1008
+ children: i.get(e) == null ? "—" : p(i.get(e))
1009
+ }), m === null ? null : /* @__PURE__ */ R("span", {
969
1010
  className: "lilt-card__pane-value",
970
- children: ["Max ", m(h)]
1011
+ children: ["Max ", p(m)]
971
1012
  })] }),
972
1013
  height: a,
973
1014
  xAxis: !0,
974
1015
  y: {
975
1016
  includeZero: !0,
976
1017
  ticks: 2,
977
- format: m
1018
+ format: p
978
1019
  },
979
1020
  series: [{
980
1021
  id: "drawdown",
981
1022
  label: "Drawdown",
982
1023
  accessor: (e) => i.get(e) ?? null,
983
1024
  color: "var(--lilt-candle-down)",
984
- formatValue: m,
1025
+ formatValue: p,
985
1026
  area: { treatment: "fade" },
986
1027
  line: { width: 1.5 },
987
1028
  curve: "monotone"
988
1029
  }],
989
- children: [/* @__PURE__ */ P(t, { series: "drawdown" }), /* @__PURE__ */ P(u, { series: "drawdown" })]
1030
+ children: [/* @__PURE__ */ L(r, { series: "drawdown" }), /* @__PURE__ */ L(w, { series: "drawdown" })]
990
1031
  });
991
1032
  } : void 0
992
1033
  });
993
1034
  }
994
1035
  //#endregion
995
1036
  //#region src/finance/cards/price-chart-card.tsx
996
- function Te(e, t) {
1037
+ function De(e, t) {
997
1038
  let n = e[t];
998
1039
  return typeof n == "number" && Number.isFinite(n) ? n : null;
999
1040
  }
1000
1041
  function $(e, t) {
1001
- let n = e.map((e) => Te(e, t)).filter((e) => e !== null);
1042
+ let n = e.map((e) => De(e, t)).filter((e) => e !== null);
1002
1043
  return n.length > 1 ? {
1003
1044
  first: n[0],
1004
1045
  last: n.at(-1)
1005
1046
  } : null;
1006
1047
  }
1007
- function Ee(e, t) {
1048
+ function Oe(e, t) {
1008
1049
  let n = e.map((e) => ({ ...e }));
1009
- for (let r of t) de(e.map((e) => Te(e, r))).forEach((e, t) => n[t][`__rebased${r}`] = e);
1050
+ for (let r of t) pe(e.map((e) => De(e, r))).forEach((e, t) => n[t][`__rebased${r}`] = e);
1010
1051
  return n;
1011
1052
  }
1012
- var De = {
1053
+ var ke = {
1013
1054
  style: "currency",
1014
1055
  currency: "USD",
1015
1056
  minimumFractionDigits: 2,
1016
1057
  maximumFractionDigits: 2
1017
1058
  };
1018
- function Oe({ price: e, symbol: n, name: r, icon: i, display: a = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: d = De, locale: f = "en-US", title: p, ...h }) {
1019
- let g = !!o?.length, _ = j(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), v = j(() => s ? g ? Ee(s, _) : s : void 0, [
1059
+ function Ae({ price: e, symbol: t, name: n, icon: i, display: a = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = ke, locale: d = "en-US", title: p, ...m }) {
1060
+ let h = !!o?.length, _ = N(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), y = N(() => s ? h ? Oe(s, _) : s : void 0, [
1020
1061
  s,
1021
- g,
1062
+ h,
1022
1063
  _
1023
- ]), x = j(() => c?.map((t) => {
1064
+ ]), b = N(() => c?.map((t) => {
1024
1065
  let n = $(t.data, e);
1025
1066
  return {
1026
1067
  ...t,
1027
- data: g ? Ee(t.data, _) : t.data,
1068
+ data: h ? Oe(t.data, _) : t.data,
1028
1069
  delta: t.delta ?? (n && n.first ? n.last / n.first - 1 : void 0)
1029
1070
  };
1030
1071
  }), [
1031
1072
  c,
1032
- g,
1073
+ h,
1033
1074
  _,
1034
1075
  e
1035
- ]), S = $(s ?? c?.[0]?.data ?? [], e), C = !S || S.last >= S.first, w = j(() => y(f, d).full, [f, JSON.stringify(d)]), T = j(() => y(f, {
1076
+ ]), x = $(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = N(() => g(d, u).full, [d, JSON.stringify(u)]), T = N(() => g(d, {
1036
1077
  style: "percent",
1037
1078
  minimumFractionDigits: 1,
1038
1079
  maximumFractionDigits: 1
1039
- }).full, [f]), E = (e) => g ? `__rebased${e}` : e, D = /* @__PURE__ */ F("span", {
1080
+ }).full, [d]), E = (e) => h ? `__rebased${e}` : e, D = /* @__PURE__ */ R("span", {
1040
1081
  className: "lilt-card__ticker",
1041
1082
  children: [
1042
- i ? /* @__PURE__ */ P("span", {
1083
+ i ? /* @__PURE__ */ L("span", {
1043
1084
  className: "lilt-card__ticker-icon",
1044
1085
  children: i
1045
1086
  }) : null,
1046
- /* @__PURE__ */ P("span", {
1087
+ /* @__PURE__ */ L("span", {
1047
1088
  className: "lilt-card__ticker-symbol",
1048
- children: n ?? p
1089
+ children: t ?? p
1049
1090
  }),
1050
- r ? /* @__PURE__ */ P("span", {
1091
+ n ? /* @__PURE__ */ L("span", {
1051
1092
  className: "lilt-card__ticker-name",
1052
- children: r
1093
+ children: n
1053
1094
  }) : null
1054
1095
  ]
1055
1096
  });
1056
- return /* @__PURE__ */ P(b, {
1057
- ...h,
1097
+ return /* @__PURE__ */ L(v, {
1098
+ ...m,
1058
1099
  title: p,
1059
1100
  heading: D,
1060
- data: v,
1061
- ranges: x,
1062
- delta: g ? void 0 : l ?? (s && S && S.first ? S.last / S.first - 1 : void 0),
1063
- valueFormat: g ? {
1101
+ data: y,
1102
+ ranges: b,
1103
+ delta: h ? void 0 : l ?? (s && x && x.first ? x.last / x.first - 1 : void 0),
1104
+ valueFormat: h ? {
1064
1105
  style: "percent",
1065
1106
  maximumFractionDigits: 1
1066
- } : d,
1067
- formatValue: g ? (e) => m(T)(e) : void 0,
1068
- locale: f,
1107
+ } : u,
1108
+ formatValue: h ? (e) => f(T)(e) : void 0,
1109
+ locale: d,
1069
1110
  aggregate: "last",
1070
1111
  headlineSeries: E(e),
1071
- pillSeries: g ? "nearest" : E(e),
1072
- tiles: g,
1073
- restCaption: g ? void 0 : (t) => {
1112
+ pillSeries: h ? "nearest" : E(e),
1113
+ tiles: h,
1114
+ restCaption: h ? void 0 : (t) => {
1074
1115
  let n = $(t, e);
1075
- return n ? m(w)(n.last - n.first) : null;
1116
+ return n ? f(C)(n.last - n.first) : null;
1076
1117
  },
1077
1118
  series: [{
1078
1119
  key: E(e),
1079
- label: n ?? p,
1080
- color: g ? void 0 : C ? I : L
1120
+ label: t ?? p,
1121
+ color: h ? void 0 : S ? z : B
1081
1122
  }, ...(o ?? []).map((e) => ({
1082
1123
  ...e,
1083
1124
  key: E(e.key)
1084
1125
  }))],
1085
1126
  shape: {
1086
1127
  kind: "marks",
1087
- id: `price:${a}:${_.join()}:${g}`,
1088
- includeZero: g,
1089
- series: () => a === "area" && !g ? {
1128
+ id: `price:${a}:${_.join()}:${h}`,
1129
+ includeZero: h,
1130
+ series: () => a === "area" && !h ? {
1090
1131
  area: { treatment: "fade" },
1091
1132
  curve: "monotone"
1092
1133
  } : { curve: "monotone" },
1093
- draw: (e) => e.map((e) => a === "area" && !g ? [/* @__PURE__ */ P(t, { series: e }, `area-${e}`), /* @__PURE__ */ P(u, { series: e }, e)] : /* @__PURE__ */ P(u, { series: e }, e))
1134
+ draw: (e) => e.map((e) => a === "area" && !h ? [/* @__PURE__ */ L(r, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, e)] : /* @__PURE__ */ L(w, { series: e }, e))
1094
1135
  },
1095
- bleed: h.bleed ?? !0
1136
+ bleed: m.bleed ?? !0
1096
1137
  });
1097
1138
  }
1098
1139
  //#endregion
1099
1140
  //#region src/finance/order-book.tsx
1100
- function ke(e, t, n) {
1141
+ function je(e, t, n) {
1101
1142
  let r = /* @__PURE__ */ new Map();
1102
1143
  for (let t of e) Number.isFinite(t.price) && Number.isFinite(t.size) && t.size > 0 && r.set(t.price, (r.get(t.price) ?? 0) + t.size);
1103
1144
  let i = [...r].map(([e, t]) => ({
@@ -1110,9 +1151,9 @@ function ke(e, t, n) {
1110
1151
  side: t
1111
1152
  }));
1112
1153
  }
1113
- function Ae(e, t) {
1114
- let n = te(null), [r, i] = M(/* @__PURE__ */ new Set());
1115
- return ee(() => {
1154
+ function Me(e, t) {
1155
+ let n = P(null), [r, i] = F(/* @__PURE__ */ new Set());
1156
+ return M(() => {
1116
1157
  let r = new Map(e.map((e) => [`${e.side}:${e.price}`, e.size])), a = n.current;
1117
1158
  if (n.current = r, !t || !a) return;
1118
1159
  let o = new Set([...r].filter(([e, t]) => a.get(e) !== t).map(([e]) => e));
@@ -1122,82 +1163,103 @@ function Ae(e, t) {
1122
1163
  return () => window.clearTimeout(s);
1123
1164
  }, [e, t]), r;
1124
1165
  }
1125
- function je({ title: e, bids: t, asks: n, levels: r = 8, depth: i = !1, valueFormat: a = {
1166
+ function Ne({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFormat: o = {
1126
1167
  minimumFractionDigits: 2,
1127
1168
  maximumFractionDigits: 2
1128
- }, sizeFormat: o, locale: s = "en-US", flash: c = !0, surface: l, motion: u, className: d, style: f }) {
1129
- let p = T(u ?? "auto"), m = JSON.stringify(a), h = JSON.stringify(o ?? null), g = j(() => y(s, a).full, [s, m]), _ = j(() => y(s, o).compact, [s, h]), v = j(() => y(s, {
1169
+ }, sizeFormat: s, locale: c = "en-US", flash: l = !0, surface: u, loading: d = !1, loadingStyle: f = "shimmer", motion: p, className: m, style: h }) {
1170
+ let _ = D(p ?? "auto"), v = n(d, f), y = JSON.stringify(o), x = JSON.stringify(s ?? null), S = N(() => g(c, o).full, [c, y]), C = N(() => g(c, s).compact, [c, x]), w = N(() => g(c, {
1130
1171
  style: "percent",
1131
1172
  maximumFractionDigits: 3
1132
- }).full, [s]), b = j(() => ke(t, "bid", r), [t, r]), x = j(() => ke(n, "ask", r), [n, r]), S = Ae(j(() => [...x, ...b], [x, b]), c && !p), C = Math.max(1, x.at(-1)?.total ?? 0, b.at(-1)?.total ?? 0), w = b[0]?.price, E = x[0]?.price, D = w !== void 0 && E !== void 0 ? {
1133
- value: E - w,
1134
- mid: (E + w) / 2
1135
- } : null, O = (e) => /* @__PURE__ */ F("tr", {
1173
+ }).full, [c]), T = N(() => je(t, "bid", i), [t, i]), E = N(() => je(r, "ask", i), [r, i]), O = Me(N(() => [...E, ...T], [E, T]), l && !_ && !d), k = Math.max(1, E.at(-1)?.total ?? 0, T.at(-1)?.total ?? 0), A = T[0]?.price, j = E[0]?.price, M = A !== void 0 && j !== void 0 ? {
1174
+ value: j - A,
1175
+ mid: (j + A) / 2
1176
+ } : null, P = (e) => /* @__PURE__ */ R("tr", {
1136
1177
  className: "lilt-order-book__level",
1137
1178
  "data-side": e.side,
1138
- "data-flash": S.has(`${e.side}:${e.price}`) || void 0,
1139
- style: { "--lilt-depth": `${e.total / C * 100}%` },
1179
+ "data-flash": O.has(`${e.side}:${e.price}`) || void 0,
1180
+ style: { "--lilt-depth": `${e.total / k * 100}%` },
1140
1181
  children: [
1141
- /* @__PURE__ */ F("th", {
1182
+ /* @__PURE__ */ R("th", {
1142
1183
  scope: "row",
1143
- children: [i ? /* @__PURE__ */ P("span", {
1184
+ children: [a ? /* @__PURE__ */ L("span", {
1144
1185
  className: "lilt-order-book__bar",
1145
1186
  "aria-hidden": "true"
1146
- }) : null, g(e.price)]
1187
+ }) : null, S(e.price)]
1147
1188
  }),
1148
- /* @__PURE__ */ P("td", { children: _(e.size) }),
1149
- /* @__PURE__ */ P("td", { children: _(e.total) })
1189
+ /* @__PURE__ */ L("td", { children: C(e.size) }),
1190
+ /* @__PURE__ */ L("td", { children: C(e.total) })
1191
+ ]
1192
+ }, `${e.side}:${e.price}`), F = (e) => Array.from({ length: Math.max(1, Math.min(50, i)) }, (t, n) => /* @__PURE__ */ R("tr", {
1193
+ className: "lilt-order-book__placeholder",
1194
+ "aria-hidden": "true",
1195
+ children: [
1196
+ /* @__PURE__ */ L("td", { children: /* @__PURE__ */ L(b, {
1197
+ width: `${86 - n * 4}%`,
1198
+ step: n
1199
+ }) }),
1200
+ /* @__PURE__ */ L("td", { children: /* @__PURE__ */ L(b, {
1201
+ width: "60%",
1202
+ step: n
1203
+ }) }),
1204
+ /* @__PURE__ */ L("td", { children: /* @__PURE__ */ L(b, {
1205
+ width: "72%",
1206
+ step: n
1207
+ }) })
1150
1208
  ]
1151
- }, `${e.side}:${e.price}`);
1152
- return /* @__PURE__ */ P(A, {
1209
+ }, `${e}-${n}`));
1210
+ return /* @__PURE__ */ L(ee, {
1153
1211
  "aria-label": e,
1154
- surface: l,
1155
- motion: u,
1156
- className: ["lilt-card--order-book", d].filter(Boolean).join(" "),
1157
- style: f,
1158
- children: /* @__PURE__ */ F("table", {
1159
- className: "lilt-order-book",
1160
- "data-depth": i || void 0,
1212
+ surface: u,
1213
+ motion: p,
1214
+ className: ["lilt-card--order-book", m].filter(Boolean).join(" "),
1215
+ style: h,
1216
+ children: /* @__PURE__ */ R("table", {
1217
+ ref: v,
1218
+ className: d ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
1219
+ "data-depth": a || void 0,
1220
+ "data-style": d ? f : void 0,
1221
+ "data-reduced-motion": _ || void 0,
1222
+ "aria-busy": d,
1161
1223
  children: [
1162
- /* @__PURE__ */ P("caption", { children: e }),
1163
- /* @__PURE__ */ P("thead", { children: /* @__PURE__ */ F("tr", { children: [
1164
- /* @__PURE__ */ P("th", {
1224
+ /* @__PURE__ */ L("caption", { children: e }),
1225
+ /* @__PURE__ */ L("thead", { children: /* @__PURE__ */ R("tr", { children: [
1226
+ /* @__PURE__ */ L("th", {
1165
1227
  scope: "col",
1166
1228
  children: "Price"
1167
1229
  }),
1168
- /* @__PURE__ */ P("th", {
1230
+ /* @__PURE__ */ L("th", {
1169
1231
  scope: "col",
1170
1232
  children: "Size"
1171
1233
  }),
1172
- /* @__PURE__ */ P("th", {
1234
+ /* @__PURE__ */ L("th", {
1173
1235
  scope: "col",
1174
1236
  children: "Total"
1175
1237
  })
1176
1238
  ] }) }),
1177
- /* @__PURE__ */ P("tbody", {
1239
+ /* @__PURE__ */ L("tbody", {
1178
1240
  "aria-label": "Asks",
1179
- children: [...x].reverse().map(O)
1241
+ children: d ? F("ask") : [...E].reverse().map(P)
1180
1242
  }),
1181
- /* @__PURE__ */ P("tbody", {
1243
+ /* @__PURE__ */ L("tbody", {
1182
1244
  "aria-label": "Spread",
1183
- children: /* @__PURE__ */ F("tr", {
1245
+ children: /* @__PURE__ */ R("tr", {
1184
1246
  className: "lilt-order-book__spread",
1185
- children: [/* @__PURE__ */ P("th", {
1247
+ children: [/* @__PURE__ */ L("th", {
1186
1248
  scope: "row",
1187
- children: D ? g(D.mid) : "—"
1188
- }), /* @__PURE__ */ P("td", {
1249
+ children: d ? "—" : M ? S(M.mid) : "—"
1250
+ }), /* @__PURE__ */ L("td", {
1189
1251
  colSpan: 2,
1190
- children: D ? `Spread ${g(D.value)} · ${v(D.value / D.mid)}` : "No spread"
1252
+ children: d ? "Loading order book" : M ? `Spread ${S(M.value)} · ${w(M.value / M.mid)}` : "No spread"
1191
1253
  })]
1192
1254
  })
1193
1255
  }),
1194
- /* @__PURE__ */ P("tbody", {
1256
+ /* @__PURE__ */ L("tbody", {
1195
1257
  "aria-label": "Bids",
1196
- children: b.map(O)
1258
+ children: d ? F("bid") : T.map(P)
1197
1259
  })
1198
1260
  ]
1199
1261
  })
1200
1262
  });
1201
1263
  }
1202
1264
  //#endregion
1203
- export { G as Candles, ie as CandlestickChartCard, Se as DepthChartCard, ye as IndicatorChartCard, je as OrderBook, we as PortfolioChartCard, Oe as PriceChartCard, le as bollinger, pe as depthLevels, ue as drawdown, X as ema, ce as macd, de as rebase, se as rsi, oe as sma };
1265
+ export { re as Candles, oe as CandlestickChartCard, we as DepthChartCard, xe as IndicatorChartCard, Ne as OrderBook, Ee as PortfolioChartCard, Ae as PriceChartCard, de as bollinger, he as depthLevels, fe as drawdown, X as ema, ue as macd, pe as rebase, le as rsi, ce as sma };