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