@overdoser/react-toolkit 0.0.12 → 0.0.13
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/components/inputs/Select/Select.d.ts +6 -0
- package/index.js +1180 -1179
- package/llms.txt +1 -0
- package/manifest.json +1 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { forwardRef as $e, createElement as an, useState as Le, useCallback as
|
|
2
|
-
import { jsxs as
|
|
1
|
+
import { forwardRef as $e, createElement as an, useState as Le, useCallback as pe, useMemo as ke, useEffect as Ne, useLayoutEffect as jt, useRef as oe, useId as Ye, isValidElement as dn, cloneElement as Xt, createContext as _t, useContext as ft, useImperativeHandle as un } from "react";
|
|
2
|
+
import { jsxs as j, jsx as s, Fragment as je } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as pt } from "react-dom";
|
|
4
4
|
import { FormProvider as hn, useFormContext as mn, useController as fn } from "react-hook-form";
|
|
5
5
|
function Ut(e) {
|
|
@@ -15,7 +15,7 @@ function m() {
|
|
|
15
15
|
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Ut(e)) && (r && (r += " "), r += t);
|
|
16
16
|
return r;
|
|
17
17
|
}
|
|
18
|
-
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU",
|
|
18
|
+
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU", Rn = "crk-shimmer-8iQSU", Sn = "crk-loadingShimmer-BVvFw", Tn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", In = "crk-dotBounce-FwdcC", Dn = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Be = {
|
|
19
19
|
root: pn,
|
|
20
20
|
loading: gn,
|
|
21
21
|
primary: yn,
|
|
@@ -28,8 +28,8 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
28
28
|
fullWidth: $n,
|
|
29
29
|
iconOnly: Nn,
|
|
30
30
|
content: Ln,
|
|
31
|
-
shimmer:
|
|
32
|
-
loadingShimmer:
|
|
31
|
+
shimmer: Rn,
|
|
32
|
+
loadingShimmer: Sn,
|
|
33
33
|
shimmerSweep: Tn,
|
|
34
34
|
dots: Cn,
|
|
35
35
|
loadingDots: An,
|
|
@@ -55,7 +55,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
55
55
|
style: h,
|
|
56
56
|
children: u,
|
|
57
57
|
...d
|
|
58
|
-
}, f) => /* @__PURE__ */
|
|
58
|
+
}, f) => /* @__PURE__ */ j(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
ref: f,
|
|
@@ -77,7 +77,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
77
77
|
children: [
|
|
78
78
|
/* @__PURE__ */ s("div", { className: m(Be.shimmer, l?.shimmer) }),
|
|
79
79
|
/* @__PURE__ */ s("span", { className: m(Be.content, l?.content), children: u }),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ j("span", { className: m(Be.dots, l?.dots), "aria-hidden": "true", children: [
|
|
81
81
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
82
82
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
83
83
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) })
|
|
@@ -101,7 +101,7 @@ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn
|
|
|
101
101
|
style: r,
|
|
102
102
|
children: o,
|
|
103
103
|
...c
|
|
104
|
-
}, i) => /* @__PURE__ */
|
|
104
|
+
}, i) => /* @__PURE__ */ j(
|
|
105
105
|
"a",
|
|
106
106
|
{
|
|
107
107
|
ref: i,
|
|
@@ -222,15 +222,15 @@ const xr = $e(
|
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
224
|
xr.displayName = "ListItem";
|
|
225
|
-
const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4",
|
|
225
|
+
const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4", Rr = "crk-sortArrowActive-yhWrO", Sr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Ir = "crk-striped-6Qckq", Dr = "crk-hoverable-ljU9B", Er = "crk-compact-2-UWr", Pr = "crk-paginator-UlYIY", Wr = "crk-paginatorInfo-BVca4", Hr = "crk-paginatorText-sqWS0", Or = "crk-pageSizeSelect-yhqJQ", Fr = "crk-paginatorNav-MDSui", zr = "crk-pageButton-1PX-g", jr = "crk-pageButtonActive--D7Q7", Xr = "crk-pageEllipsis-en59J", ve = {
|
|
226
226
|
wrapper: kr,
|
|
227
227
|
root: Mr,
|
|
228
228
|
headerCell: wr,
|
|
229
229
|
headerCellSortable: $r,
|
|
230
230
|
sortIndicator: Nr,
|
|
231
231
|
sortArrow: Lr,
|
|
232
|
-
sortArrowActive:
|
|
233
|
-
sortIndex:
|
|
232
|
+
sortArrowActive: Rr,
|
|
233
|
+
sortIndex: Sr,
|
|
234
234
|
row: Tr,
|
|
235
235
|
cell: Cr,
|
|
236
236
|
emptyRow: Ar,
|
|
@@ -251,12 +251,12 @@ function _r(e, t) {
|
|
|
251
251
|
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
252
252
|
}
|
|
253
253
|
function Ur(e, t = []) {
|
|
254
|
-
const [n, r] = Le(t), o =
|
|
254
|
+
const [n, r] = Le(t), o = pe((a) => {
|
|
255
255
|
r((h) => {
|
|
256
256
|
const u = h.find((d) => d.key === a);
|
|
257
257
|
return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
258
258
|
});
|
|
259
|
-
}, []), c =
|
|
259
|
+
}, []), c = pe((a) => {
|
|
260
260
|
r((h) => {
|
|
261
261
|
const u = h.findIndex((f) => f.key === a);
|
|
262
262
|
if (u === -1)
|
|
@@ -265,9 +265,9 @@ function Ur(e, t = []) {
|
|
|
265
265
|
const f = [...h];
|
|
266
266
|
return f[u] = { key: a, direction: "desc" }, f;
|
|
267
267
|
}
|
|
268
|
-
return h.filter((f,
|
|
268
|
+
return h.filter((f, p) => p !== u);
|
|
269
269
|
});
|
|
270
|
-
}, []), i =
|
|
270
|
+
}, []), i = pe(() => {
|
|
271
271
|
r([]);
|
|
272
272
|
}, []);
|
|
273
273
|
return { sortedData: ke(() => n.length === 0 ? e : [...e].sort((a, h) => {
|
|
@@ -280,7 +280,7 @@ function Ur(e, t = []) {
|
|
|
280
280
|
}), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: c, resetSort: i };
|
|
281
281
|
}
|
|
282
282
|
function Yr({ direction: e, sortIndex: t }) {
|
|
283
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ j("span", { className: ve.sortIndicator, "aria-hidden": "true", children: [
|
|
284
284
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "asc" && ve.sortArrowActive), children: "▲" }),
|
|
285
285
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "desc" && ve.sortArrowActive), children: "▼" }),
|
|
286
286
|
t !== void 0 && t >= 0 && /* @__PURE__ */ s("span", { className: ve.sortIndex, children: t + 1 })
|
|
@@ -306,8 +306,8 @@ function Vr({
|
|
|
306
306
|
}
|
|
307
307
|
return u;
|
|
308
308
|
}, [e, i]);
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ j("nav", { className: m(ve.paginator, c?.paginator), "aria-label": "Table pagination", children: [
|
|
310
|
+
/* @__PURE__ */ j("div", { className: ve.paginatorInfo, children: [
|
|
311
311
|
/* @__PURE__ */ s("span", { className: ve.paginatorText, children: n > 0 ? `${l}–${a} of ${n}` : "No results" }),
|
|
312
312
|
r.length > 1 && /* @__PURE__ */ s(
|
|
313
313
|
"select",
|
|
@@ -316,14 +316,14 @@ function Vr({
|
|
|
316
316
|
value: t,
|
|
317
317
|
onChange: (u) => o(1, Number(u.target.value)),
|
|
318
318
|
"aria-label": "Rows per page",
|
|
319
|
-
children: r.map((u) => /* @__PURE__ */
|
|
319
|
+
children: r.map((u) => /* @__PURE__ */ j("option", { value: u, children: [
|
|
320
320
|
u,
|
|
321
321
|
" / page"
|
|
322
322
|
] }, u))
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ j("div", { className: ve.paginatorNav, children: [
|
|
327
327
|
/* @__PURE__ */ s(
|
|
328
328
|
"button",
|
|
329
329
|
{
|
|
@@ -377,51 +377,51 @@ function qr({
|
|
|
377
377
|
rowKey: u,
|
|
378
378
|
rowClassName: d,
|
|
379
379
|
rowStyle: f,
|
|
380
|
-
emptyMessage:
|
|
380
|
+
emptyMessage: p = "No data",
|
|
381
381
|
pagination: L,
|
|
382
|
-
classes:
|
|
382
|
+
classes: b
|
|
383
383
|
}) {
|
|
384
|
-
const
|
|
385
|
-
sortedData:
|
|
386
|
-
sortConfig:
|
|
387
|
-
requestSort:
|
|
388
|
-
requestMultiSort:
|
|
389
|
-
} = Ur(e, n),
|
|
390
|
-
if (!L ||
|
|
391
|
-
const
|
|
392
|
-
return C.slice(
|
|
393
|
-
}, [C, L,
|
|
394
|
-
(
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
398
|
-
const
|
|
384
|
+
const R = r !== void 0, {
|
|
385
|
+
sortedData: w,
|
|
386
|
+
sortConfig: J,
|
|
387
|
+
requestSort: W,
|
|
388
|
+
requestMultiSort: E
|
|
389
|
+
} = Ur(e, n), Z = R ? n ?? [] : J, C = R ? e : w, $ = ke(() => {
|
|
390
|
+
if (!L || R) return C;
|
|
391
|
+
const S = (L.page - 1) * L.pageSize;
|
|
392
|
+
return C.slice(S, S + L.pageSize);
|
|
393
|
+
}, [C, L, R]), ie = L?.totalRows ?? C.length, ne = pe(
|
|
394
|
+
(S, re) => {
|
|
395
|
+
const F = o && (re.ctrlKey || re.metaKey);
|
|
396
|
+
if (R)
|
|
397
|
+
if (F) {
|
|
398
|
+
const X = Z.findIndex((z) => z.key === S);
|
|
399
399
|
let A;
|
|
400
|
-
|
|
401
|
-
(
|
|
402
|
-
) : A =
|
|
400
|
+
X === -1 ? A = [...Z, { key: S, direction: "asc" }] : Z[X].direction === "asc" ? A = Z.map(
|
|
401
|
+
(z, ce) => ce === X ? { key: S, direction: "desc" } : z
|
|
402
|
+
) : A = Z.filter((z, ce) => ce !== X), r(A);
|
|
403
403
|
} else {
|
|
404
|
-
const
|
|
405
|
-
|
|
404
|
+
const X = Z.find((A) => A.key === S);
|
|
405
|
+
X ? X.direction === "asc" ? r([{ key: S, direction: "desc" }]) : r([]) : r([{ key: S, direction: "asc" }]);
|
|
406
406
|
}
|
|
407
407
|
else
|
|
408
|
-
|
|
408
|
+
F ? E(S) : W(S);
|
|
409
409
|
},
|
|
410
410
|
[
|
|
411
|
-
|
|
411
|
+
R,
|
|
412
412
|
o,
|
|
413
|
-
|
|
413
|
+
Z,
|
|
414
414
|
r,
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
W,
|
|
416
|
+
E
|
|
417
417
|
]
|
|
418
|
-
),
|
|
419
|
-
if (
|
|
420
|
-
const
|
|
421
|
-
return
|
|
418
|
+
), V = (S) => Z.find((F) => F.key === S)?.direction, ae = (S) => {
|
|
419
|
+
if (Z.length <= 1) return;
|
|
420
|
+
const re = Z.findIndex((F) => F.key === S);
|
|
421
|
+
return re >= 0 ? re : void 0;
|
|
422
422
|
};
|
|
423
|
-
return /* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ j("div", { className: m(ve.wrapper, b?.wrapper), children: [
|
|
424
|
+
/* @__PURE__ */ j(
|
|
425
425
|
"table",
|
|
426
426
|
{
|
|
427
427
|
className: m(
|
|
@@ -429,56 +429,56 @@ function qr({
|
|
|
429
429
|
c && ve.striped,
|
|
430
430
|
i && ve.hoverable,
|
|
431
431
|
l && ve.compact,
|
|
432
|
-
|
|
432
|
+
b?.root,
|
|
433
433
|
a
|
|
434
434
|
),
|
|
435
435
|
style: h,
|
|
436
436
|
children: [
|
|
437
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((
|
|
437
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((S) => /* @__PURE__ */ j(
|
|
438
438
|
"th",
|
|
439
439
|
{
|
|
440
440
|
className: m(
|
|
441
441
|
ve.headerCell,
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
S.sortable && ve.headerCellSortable,
|
|
443
|
+
b?.headerCell
|
|
444
444
|
),
|
|
445
445
|
style: {
|
|
446
|
-
width:
|
|
447
|
-
textAlign:
|
|
446
|
+
width: S.width,
|
|
447
|
+
textAlign: S.align
|
|
448
448
|
},
|
|
449
|
-
onClick:
|
|
450
|
-
"aria-sort":
|
|
449
|
+
onClick: S.sortable ? (re) => ne(S.key, re) : void 0,
|
|
450
|
+
"aria-sort": S.sortable ? V(S.key) === "asc" ? "ascending" : V(S.key) === "desc" ? "descending" : "none" : void 0,
|
|
451
451
|
children: [
|
|
452
|
-
|
|
453
|
-
|
|
452
|
+
S.header,
|
|
453
|
+
S.sortable && /* @__PURE__ */ s(
|
|
454
454
|
Yr,
|
|
455
455
|
{
|
|
456
|
-
direction:
|
|
457
|
-
sortIndex: ae(
|
|
456
|
+
direction: V(S.key),
|
|
457
|
+
sortIndex: ae(S.key)
|
|
458
458
|
}
|
|
459
459
|
)
|
|
460
460
|
]
|
|
461
461
|
},
|
|
462
|
-
|
|
462
|
+
S.key
|
|
463
463
|
)) }) }),
|
|
464
|
-
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell,
|
|
465
|
-
const
|
|
464
|
+
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell, b?.emptyCell), colSpan: t.length, children: p }) }) : $.map((S, re) => {
|
|
465
|
+
const F = u ? String(S[u]) : re, X = typeof d == "function" ? d(S, re) : d, A = typeof f == "function" ? f(S, re) : f;
|
|
466
466
|
return /* @__PURE__ */ s(
|
|
467
467
|
"tr",
|
|
468
468
|
{
|
|
469
|
-
className: m(ve.row,
|
|
469
|
+
className: m(ve.row, b?.row, X),
|
|
470
470
|
style: A,
|
|
471
|
-
children: t.map((
|
|
471
|
+
children: t.map((z) => /* @__PURE__ */ s(
|
|
472
472
|
"td",
|
|
473
473
|
{
|
|
474
|
-
className: m(ve.cell,
|
|
475
|
-
style: { textAlign:
|
|
476
|
-
children:
|
|
474
|
+
className: m(ve.cell, b?.cell),
|
|
475
|
+
style: { textAlign: z.align },
|
|
476
|
+
children: z.render ? z.render(S[z.key], S, re) : S[z.key]
|
|
477
477
|
},
|
|
478
|
-
|
|
478
|
+
z.key
|
|
479
479
|
))
|
|
480
480
|
},
|
|
481
|
-
|
|
481
|
+
F
|
|
482
482
|
);
|
|
483
483
|
}) })
|
|
484
484
|
]
|
|
@@ -488,8 +488,8 @@ function qr({
|
|
|
488
488
|
Vr,
|
|
489
489
|
{
|
|
490
490
|
...L,
|
|
491
|
-
totalRows:
|
|
492
|
-
paginatorClasses: { paginator:
|
|
491
|
+
totalRows: ie,
|
|
492
|
+
paginatorClasses: { paginator: b?.paginator, pageButton: b?.pageButton }
|
|
493
493
|
}
|
|
494
494
|
)
|
|
495
495
|
] });
|
|
@@ -511,8 +511,8 @@ const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trig
|
|
|
511
511
|
itemDisabled: so,
|
|
512
512
|
itemSelected: ao
|
|
513
513
|
};
|
|
514
|
-
function
|
|
515
|
-
const n =
|
|
514
|
+
function St(e, t = !0) {
|
|
515
|
+
const n = pe(
|
|
516
516
|
(r) => {
|
|
517
517
|
const o = e[r.key];
|
|
518
518
|
o && o(r);
|
|
@@ -557,41 +557,41 @@ const Vt = $e(
|
|
|
557
557
|
value: u,
|
|
558
558
|
onChange: d,
|
|
559
559
|
error: f = !1,
|
|
560
|
-
fullWidth:
|
|
560
|
+
fullWidth: p = !0,
|
|
561
561
|
portal: L = !0,
|
|
562
|
-
classes:
|
|
563
|
-
},
|
|
564
|
-
const [
|
|
562
|
+
classes: b
|
|
563
|
+
}, R) => {
|
|
564
|
+
const [w, J] = Le(!1), W = oe(null), E = oe(null), Z = oe(null), C = Ye();
|
|
565
565
|
Ne(() => {
|
|
566
|
-
|
|
567
|
-
}, [
|
|
568
|
-
const $ =
|
|
569
|
-
|
|
570
|
-
}, [l]),
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
return
|
|
566
|
+
w && E.current && E.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
567
|
+
}, [w]);
|
|
568
|
+
const $ = pe(() => {
|
|
569
|
+
J(!1), l?.(), Z.current?.focus();
|
|
570
|
+
}, [l]), ie = pe(() => {
|
|
571
|
+
J((A) => {
|
|
572
|
+
const z = !A;
|
|
573
|
+
return z ? i?.() : l?.(), z;
|
|
574
574
|
});
|
|
575
|
-
}, [i, l]),
|
|
575
|
+
}, [i, l]), ne = pe(
|
|
576
576
|
(A) => {
|
|
577
577
|
d?.(A), $();
|
|
578
578
|
},
|
|
579
579
|
[d, $]
|
|
580
580
|
);
|
|
581
581
|
Ne(() => {
|
|
582
|
-
if (!
|
|
583
|
-
const A = (
|
|
584
|
-
const
|
|
585
|
-
|
|
582
|
+
if (!w) return;
|
|
583
|
+
const A = (z) => {
|
|
584
|
+
const ce = z.target;
|
|
585
|
+
W.current?.contains(ce) || E.current?.contains(ce) || $();
|
|
586
586
|
};
|
|
587
587
|
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
588
|
-
}, [
|
|
588
|
+
}, [w, $]), St(
|
|
589
589
|
{
|
|
590
590
|
Escape: () => $()
|
|
591
591
|
},
|
|
592
|
-
|
|
592
|
+
w
|
|
593
593
|
);
|
|
594
|
-
const
|
|
594
|
+
const V = Tt(Z, w && L), ae = a?.find((A) => A.value === u)?.label, S = a ? ae || h : e, re = a && !ae, F = a ? a.map((A) => /* @__PURE__ */ s(
|
|
595
595
|
"button",
|
|
596
596
|
{
|
|
597
597
|
type: "button",
|
|
@@ -600,70 +600,70 @@ const Vt = $e(
|
|
|
600
600
|
Me.item,
|
|
601
601
|
A.disabled && Me.itemDisabled,
|
|
602
602
|
A.value === u && Me.itemSelected,
|
|
603
|
-
|
|
603
|
+
b?.item
|
|
604
604
|
),
|
|
605
605
|
disabled: A.disabled,
|
|
606
|
-
onClick: () =>
|
|
606
|
+
onClick: () => ne(A.value),
|
|
607
607
|
children: A.label
|
|
608
608
|
},
|
|
609
609
|
A.value
|
|
610
|
-
)) : t,
|
|
610
|
+
)) : t, X = (A) => /* @__PURE__ */ s(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
|
-
ref:
|
|
613
|
+
ref: E,
|
|
614
614
|
id: C,
|
|
615
615
|
className: m(
|
|
616
616
|
Me.menu,
|
|
617
|
-
|
|
617
|
+
w && Me.menuOpen,
|
|
618
618
|
n === "left" ? Me.alignLeft : Me.alignRight,
|
|
619
|
-
!L &&
|
|
620
|
-
|
|
619
|
+
!L && p && Me.fullWidth,
|
|
620
|
+
b?.menu
|
|
621
621
|
),
|
|
622
622
|
style: A,
|
|
623
623
|
role: "menu",
|
|
624
|
-
children:
|
|
624
|
+
children: F
|
|
625
625
|
}
|
|
626
626
|
);
|
|
627
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ j(
|
|
628
628
|
"div",
|
|
629
629
|
{
|
|
630
|
-
ref:
|
|
631
|
-
className: m(Me.root,
|
|
630
|
+
ref: R,
|
|
631
|
+
className: m(Me.root, p && Me.fullWidth, b?.root, r),
|
|
632
632
|
style: o,
|
|
633
633
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ j("div", { ref: W, style: p ? { width: "100%" } : void 0, children: [
|
|
635
|
+
/* @__PURE__ */ j(
|
|
636
636
|
"button",
|
|
637
637
|
{
|
|
638
|
-
ref:
|
|
638
|
+
ref: Z,
|
|
639
639
|
id: c,
|
|
640
640
|
type: "button",
|
|
641
641
|
className: m(
|
|
642
642
|
Me.trigger,
|
|
643
|
-
|
|
643
|
+
w && Me.triggerOpen,
|
|
644
644
|
f && Me.triggerError,
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
p && Me.fullWidth,
|
|
646
|
+
b?.trigger
|
|
647
647
|
),
|
|
648
|
-
onClick:
|
|
649
|
-
"aria-expanded":
|
|
648
|
+
onClick: ie,
|
|
649
|
+
"aria-expanded": w,
|
|
650
650
|
"aria-haspopup": "menu",
|
|
651
|
-
"aria-controls":
|
|
651
|
+
"aria-controls": w ? C : void 0,
|
|
652
652
|
children: [
|
|
653
|
-
/* @__PURE__ */ s("span", { className: m(Me.triggerLabel,
|
|
654
|
-
/* @__PURE__ */ s("span", { className: m(Me.chevron,
|
|
653
|
+
/* @__PURE__ */ s("span", { className: m(Me.triggerLabel, re && Me.placeholder, b?.triggerLabel), children: S }),
|
|
654
|
+
/* @__PURE__ */ s("span", { className: m(Me.chevron, b?.chevron), "aria-hidden": "true" })
|
|
655
655
|
]
|
|
656
656
|
}
|
|
657
657
|
),
|
|
658
|
-
!L &&
|
|
658
|
+
!L && X()
|
|
659
659
|
] }),
|
|
660
|
-
L &&
|
|
661
|
-
|
|
660
|
+
L && w && typeof document < "u" && pt(
|
|
661
|
+
X({
|
|
662
662
|
position: "fixed",
|
|
663
|
-
top:
|
|
664
|
-
left: n === "right" ? void 0 :
|
|
665
|
-
right: n === "right" ? window.innerWidth - (
|
|
666
|
-
minWidth:
|
|
663
|
+
top: V.top + 4,
|
|
664
|
+
left: n === "right" ? void 0 : V.left,
|
|
665
|
+
right: n === "right" ? window.innerWidth - (V.left + V.width) : void 0,
|
|
666
|
+
minWidth: V.width,
|
|
667
667
|
zIndex: "var(--crk-z-floating)"
|
|
668
668
|
}),
|
|
669
669
|
document.body
|
|
@@ -737,53 +737,53 @@ const qt = $e(
|
|
|
737
737
|
className: l,
|
|
738
738
|
style: a
|
|
739
739
|
}, h) => {
|
|
740
|
-
const [u, d] = Le(!1), f =
|
|
740
|
+
const [u, d] = Le(!1), f = oe(null), p = oe(null), L = oe(null), b = Ye(), R = o !== void 0, w = R ? o : u, J = pe(
|
|
741
741
|
(C) => {
|
|
742
|
-
|
|
742
|
+
R || d(C), c?.(C);
|
|
743
743
|
},
|
|
744
|
-
[
|
|
745
|
-
),
|
|
746
|
-
|
|
747
|
-
}, [
|
|
748
|
-
|
|
749
|
-
}, [
|
|
750
|
-
xo(f,
|
|
744
|
+
[R, c]
|
|
745
|
+
), W = pe(() => {
|
|
746
|
+
J(!1), L.current?.focus();
|
|
747
|
+
}, [J]), E = pe(() => {
|
|
748
|
+
J(!w);
|
|
749
|
+
}, [w, J]);
|
|
750
|
+
xo(f, W, w), St(
|
|
751
751
|
{
|
|
752
|
-
Escape: () =>
|
|
752
|
+
Escape: () => W()
|
|
753
753
|
},
|
|
754
|
-
|
|
754
|
+
w
|
|
755
755
|
), Ne(() => {
|
|
756
|
-
if (
|
|
757
|
-
const C =
|
|
756
|
+
if (w && p.current) {
|
|
757
|
+
const C = p.current.querySelector(
|
|
758
758
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
759
759
|
);
|
|
760
|
-
C ? C.focus() :
|
|
760
|
+
C ? C.focus() : p.current.focus();
|
|
761
761
|
}
|
|
762
|
-
}, [
|
|
763
|
-
let
|
|
762
|
+
}, [w]);
|
|
763
|
+
let Z;
|
|
764
764
|
if (t && dn(e)) {
|
|
765
765
|
const C = e, $ = C.ref;
|
|
766
|
-
|
|
766
|
+
Z = Xt(C, {
|
|
767
767
|
ref: ko(L, $),
|
|
768
|
-
onClick: (
|
|
769
|
-
C.props.onClick?.(
|
|
768
|
+
onClick: (ie) => {
|
|
769
|
+
C.props.onClick?.(ie), E();
|
|
770
770
|
},
|
|
771
771
|
className: m(C.props.className, i?.trigger),
|
|
772
|
-
"aria-expanded":
|
|
772
|
+
"aria-expanded": w,
|
|
773
773
|
"aria-haspopup": "dialog",
|
|
774
|
-
"aria-controls":
|
|
774
|
+
"aria-controls": w ? b : void 0
|
|
775
775
|
});
|
|
776
776
|
} else
|
|
777
|
-
|
|
777
|
+
Z = /* @__PURE__ */ s(
|
|
778
778
|
"button",
|
|
779
779
|
{
|
|
780
780
|
ref: L,
|
|
781
781
|
type: "button",
|
|
782
782
|
className: m(at.trigger, i?.trigger),
|
|
783
|
-
onClick:
|
|
784
|
-
"aria-expanded":
|
|
783
|
+
onClick: E,
|
|
784
|
+
"aria-expanded": w,
|
|
785
785
|
"aria-haspopup": "dialog",
|
|
786
|
-
"aria-controls":
|
|
786
|
+
"aria-controls": w ? b : void 0,
|
|
787
787
|
children: e
|
|
788
788
|
}
|
|
789
789
|
);
|
|
@@ -793,13 +793,13 @@ const qt = $e(
|
|
|
793
793
|
ref: h,
|
|
794
794
|
className: m(at.root, i?.root, l),
|
|
795
795
|
style: a,
|
|
796
|
-
children: /* @__PURE__ */
|
|
797
|
-
|
|
798
|
-
|
|
796
|
+
children: /* @__PURE__ */ j("div", { ref: f, children: [
|
|
797
|
+
Z,
|
|
798
|
+
w && /* @__PURE__ */ s(
|
|
799
799
|
"div",
|
|
800
800
|
{
|
|
801
|
-
ref:
|
|
802
|
-
id:
|
|
801
|
+
ref: p,
|
|
802
|
+
id: b,
|
|
803
803
|
role: "dialog",
|
|
804
804
|
tabIndex: -1,
|
|
805
805
|
className: m(at.popover, at[r], i?.popover),
|
|
@@ -821,7 +821,7 @@ const It = [
|
|
|
821
821
|
'[tabindex]:not([tabindex="-1"])'
|
|
822
822
|
].join(", ");
|
|
823
823
|
function Mo(e, t) {
|
|
824
|
-
const n =
|
|
824
|
+
const n = oe(null), r = pe(
|
|
825
825
|
(o) => {
|
|
826
826
|
if (o.key !== "Tab" || !e.current)
|
|
827
827
|
return;
|
|
@@ -847,13 +847,13 @@ function Mo(e, t) {
|
|
|
847
847
|
};
|
|
848
848
|
}, [t, e, r]);
|
|
849
849
|
}
|
|
850
|
-
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm",
|
|
850
|
+
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm", Ro = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Co = "crk-fullscreen-b4jQ-", Ao = "crk-header-NS30G", Bo = "crk-headerWithClose-4davm", Io = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Eo = "crk-footer-Oyz-R", ze = {
|
|
851
851
|
backdrop: wo,
|
|
852
852
|
backdropIn: $o,
|
|
853
853
|
modal: No,
|
|
854
854
|
modalIn: Lo,
|
|
855
|
-
sm:
|
|
856
|
-
md:
|
|
855
|
+
sm: Ro,
|
|
856
|
+
md: So,
|
|
857
857
|
lg: To,
|
|
858
858
|
fullscreen: Co,
|
|
859
859
|
header: Ao,
|
|
@@ -863,7 +863,7 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
863
863
|
footer: Eo
|
|
864
864
|
}, gt = _t({ classes: {}, titleId: "" }), Gt = ({ children: e, className: t, style: n, onClose: r }) => {
|
|
865
865
|
const { classes: o, titleId: c } = ft(gt);
|
|
866
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ j(
|
|
867
867
|
"div",
|
|
868
868
|
{
|
|
869
869
|
id: c,
|
|
@@ -910,9 +910,9 @@ const yt = $e(
|
|
|
910
910
|
"aria-label": h,
|
|
911
911
|
"aria-labelledby": u
|
|
912
912
|
}, d) => {
|
|
913
|
-
const f =
|
|
914
|
-
Mo(
|
|
915
|
-
const
|
|
913
|
+
const f = oe(null), p = d ?? f, L = Ye(), b = u ?? `${L}-title`;
|
|
914
|
+
Mo(p, e);
|
|
915
|
+
const R = ke(
|
|
916
916
|
() => ({
|
|
917
917
|
Escape: () => {
|
|
918
918
|
r && t();
|
|
@@ -920,34 +920,34 @@ const yt = $e(
|
|
|
920
920
|
}),
|
|
921
921
|
[r, t]
|
|
922
922
|
);
|
|
923
|
-
|
|
923
|
+
St(R, e), Ne(() => {
|
|
924
924
|
if (!e) return;
|
|
925
|
-
const
|
|
925
|
+
const J = document.body.style.overflow;
|
|
926
926
|
return document.body.style.overflow = "hidden", () => {
|
|
927
|
-
document.body.style.overflow =
|
|
927
|
+
document.body.style.overflow = J;
|
|
928
928
|
};
|
|
929
929
|
}, [e]);
|
|
930
|
-
const
|
|
931
|
-
n &&
|
|
930
|
+
const w = (J) => {
|
|
931
|
+
n && J.target === J.currentTarget && t();
|
|
932
932
|
};
|
|
933
933
|
return e ? pt(
|
|
934
934
|
/* @__PURE__ */ s(
|
|
935
935
|
"div",
|
|
936
936
|
{
|
|
937
937
|
className: m(ze.backdrop, c?.backdrop),
|
|
938
|
-
onClick:
|
|
938
|
+
onClick: w,
|
|
939
939
|
role: "presentation",
|
|
940
940
|
children: /* @__PURE__ */ s(
|
|
941
941
|
"div",
|
|
942
942
|
{
|
|
943
|
-
ref:
|
|
943
|
+
ref: p,
|
|
944
944
|
className: m(ze.modal, ze[o], c?.modal, i),
|
|
945
945
|
style: l,
|
|
946
946
|
role: "dialog",
|
|
947
947
|
"aria-modal": "true",
|
|
948
948
|
"aria-label": h,
|
|
949
|
-
"aria-labelledby": h ? void 0 :
|
|
950
|
-
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId:
|
|
949
|
+
"aria-labelledby": h ? void 0 : b,
|
|
950
|
+
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId: b }, children: a })
|
|
951
951
|
}
|
|
952
952
|
)
|
|
953
953
|
}
|
|
@@ -981,7 +981,7 @@ function Pl({
|
|
|
981
981
|
children: c
|
|
982
982
|
}) {
|
|
983
983
|
const i = n && n.length > 0;
|
|
984
|
-
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */ j(
|
|
985
985
|
"form",
|
|
986
986
|
{
|
|
987
987
|
onSubmit: e.handleSubmit(t),
|
|
@@ -1012,27 +1012,27 @@ function Wl({
|
|
|
1012
1012
|
style: l,
|
|
1013
1013
|
children: a
|
|
1014
1014
|
}) {
|
|
1015
|
-
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type,
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
(
|
|
1019
|
-
if (
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1015
|
+
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, p = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L = Yo.has(p), { ref: b, ...R } = u, w = oe(b);
|
|
1016
|
+
w.current = b;
|
|
1017
|
+
const J = pe(
|
|
1018
|
+
(W) => {
|
|
1019
|
+
if (W) {
|
|
1020
|
+
const E = W.matches("input, select, textarea, button, [tabindex]") ? W : W.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
1021
|
+
w.current(E ?? W);
|
|
1022
1022
|
} else
|
|
1023
|
-
|
|
1023
|
+
w.current(null);
|
|
1024
1024
|
},
|
|
1025
1025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1026
1026
|
[]
|
|
1027
1027
|
);
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
t && /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ j("div", { className: m(We.field, c?.field, i), style: l, children: [
|
|
1029
|
+
t && /* @__PURE__ */ j("label", { className: m(We.label, d.error && We.labelError, c?.label), htmlFor: e, children: [
|
|
1030
1030
|
t,
|
|
1031
1031
|
r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
|
|
1032
1032
|
] }),
|
|
1033
1033
|
Xt(a, {
|
|
1034
|
-
...
|
|
1035
|
-
ref:
|
|
1034
|
+
...R,
|
|
1035
|
+
ref: J,
|
|
1036
1036
|
id: e,
|
|
1037
1037
|
error: !!d.error,
|
|
1038
1038
|
"aria-invalid": d.error ? !0 : void 0,
|
|
@@ -1041,11 +1041,11 @@ function Wl({
|
|
|
1041
1041
|
// Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
|
|
1042
1042
|
// handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
|
|
1043
1043
|
...L && {
|
|
1044
|
-
onValueChange:
|
|
1045
|
-
onValuesChange:
|
|
1044
|
+
onValueChange: R.onChange,
|
|
1045
|
+
onValuesChange: R.onChange
|
|
1046
1046
|
},
|
|
1047
1047
|
// Bridge for Checkbox (expects checked, not value)
|
|
1048
|
-
checked: typeof
|
|
1048
|
+
checked: typeof R.value == "boolean" ? R.value : void 0
|
|
1049
1049
|
}),
|
|
1050
1050
|
d.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: m(We.error, c?.error), role: "alert", children: d.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: m(We.helperText, c?.helperText), children: n }) : null
|
|
1051
1051
|
] });
|
|
@@ -1092,7 +1092,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1092
1092
|
...l
|
|
1093
1093
|
}
|
|
1094
1094
|
);
|
|
1095
|
-
return n || r ? /* @__PURE__ */
|
|
1095
|
+
return n || r ? /* @__PURE__ */ j(
|
|
1096
1096
|
"div",
|
|
1097
1097
|
{
|
|
1098
1098
|
className: m(Pe.wrapper, Pe[e], t && Pe.error, o?.wrapper, c),
|
|
@@ -1107,7 +1107,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1107
1107
|
}
|
|
1108
1108
|
);
|
|
1109
1109
|
ri.displayName = "Input";
|
|
1110
|
-
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV", Mi = "crk-menuItems-VrZnE", wi = "crk-item-fU3XI", $i = "crk-itemHighlighted-MvR41", Ni = "crk-itemDisabled-KTUO8", Li = "crk-itemSelected-42-BG",
|
|
1110
|
+
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV", Mi = "crk-menuItems-VrZnE", wi = "crk-item-fU3XI", $i = "crk-itemHighlighted-MvR41", Ni = "crk-itemDisabled-KTUO8", Li = "crk-itemSelected-42-BG", Ri = "crk-noResults-uicSW", Si = "crk-multiTrigger-Pd3wJ", Ti = "crk-multiTriggerDisabled-9ajge", Ci = "crk-chip-TuYUB", Ai = "crk-chipLabel-H4JWu", Bi = "crk-chipRemove-Lfk0R", Ii = "crk-multiSearch-OrVeS", Di = "crk-arrowMulti-Nh9Hr", Ei = "crk-itemCheck-DPB5A", P = {
|
|
1111
1111
|
wrapper: oi,
|
|
1112
1112
|
sm: ii,
|
|
1113
1113
|
md: ci,
|
|
@@ -1131,8 +1131,8 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1131
1131
|
itemHighlighted: $i,
|
|
1132
1132
|
itemDisabled: Ni,
|
|
1133
1133
|
itemSelected: Li,
|
|
1134
|
-
noResults:
|
|
1135
|
-
multiTrigger:
|
|
1134
|
+
noResults: Ri,
|
|
1135
|
+
multiTrigger: Si,
|
|
1136
1136
|
multiTriggerDisabled: Ti,
|
|
1137
1137
|
chip: Ci,
|
|
1138
1138
|
chipLabel: Ai,
|
|
@@ -1154,20 +1154,20 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1154
1154
|
searchPlaceholder: h,
|
|
1155
1155
|
onValueChange: u,
|
|
1156
1156
|
...d
|
|
1157
|
-
}, f) => /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1157
|
+
}, f) => /* @__PURE__ */ j("div", { className: m(P.wrapper, P[e], t && P.error, o?.wrapper, c), style: i, children: [
|
|
1158
|
+
/* @__PURE__ */ j(
|
|
1159
1159
|
"select",
|
|
1160
1160
|
{
|
|
1161
1161
|
ref: f,
|
|
1162
|
-
className: m(
|
|
1162
|
+
className: m(P.root, P[e], t && P.error, o?.root),
|
|
1163
1163
|
...d,
|
|
1164
1164
|
children: [
|
|
1165
1165
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
1166
|
-
n ? n.map((
|
|
1166
|
+
n ? n.map((p) => /* @__PURE__ */ s("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value)) : l
|
|
1167
1167
|
]
|
|
1168
1168
|
}
|
|
1169
1169
|
),
|
|
1170
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1170
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, o?.arrow) })
|
|
1171
1171
|
] })
|
|
1172
1172
|
);
|
|
1173
1173
|
Qt.displayName = "NativeSelect";
|
|
@@ -1186,84 +1186,84 @@ const Jt = $e(
|
|
|
1186
1186
|
searchPlaceholder: u = "Search...",
|
|
1187
1187
|
onChange: d,
|
|
1188
1188
|
onValueChange: f,
|
|
1189
|
-
portal:
|
|
1189
|
+
portal: p = !0
|
|
1190
1190
|
}, L) => {
|
|
1191
|
-
const [
|
|
1191
|
+
const [b, R] = Le(!1), [w, J] = Le(""), [W, E] = Le(0), Z = oe(null), C = oe(null), $ = oe(null), ie = oe(null), ne = oe(null), V = Ye(), ae = Tt($, b && p), S = oe(null), re = L ?? S, F = oe(!1);
|
|
1192
1192
|
Ne(() => {
|
|
1193
|
-
|
|
1194
|
-
}, [
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
}, []), A =
|
|
1198
|
-
a || (
|
|
1199
|
-
}, [a]),
|
|
1200
|
-
(
|
|
1201
|
-
if (f?.(
|
|
1193
|
+
F.current && !b && $.current?.focus(), F.current = b;
|
|
1194
|
+
}, [b]);
|
|
1195
|
+
const X = pe(() => {
|
|
1196
|
+
R(!1), J(""), E(0);
|
|
1197
|
+
}, []), A = pe(() => {
|
|
1198
|
+
a || (R(!0), J(""), E(0), setTimeout(() => C.current?.focus(), 0));
|
|
1199
|
+
}, [a]), z = pe(
|
|
1200
|
+
(N) => {
|
|
1201
|
+
if (f?.(N), re.current) {
|
|
1202
1202
|
Object.getOwnPropertyDescriptor(
|
|
1203
1203
|
HTMLSelectElement.prototype,
|
|
1204
1204
|
"value"
|
|
1205
|
-
)?.set?.call(
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1205
|
+
)?.set?.call(re.current, N);
|
|
1206
|
+
const v = new Event("change", { bubbles: !0 });
|
|
1207
|
+
re.current.dispatchEvent(v), d?.(v);
|
|
1208
1208
|
}
|
|
1209
|
-
|
|
1209
|
+
X();
|
|
1210
1210
|
},
|
|
1211
|
-
[f, d,
|
|
1212
|
-
),
|
|
1213
|
-
if (!
|
|
1214
|
-
const
|
|
1215
|
-
return n.filter((
|
|
1216
|
-
}, [n,
|
|
1211
|
+
[f, d, re, X]
|
|
1212
|
+
), ce = ke(() => {
|
|
1213
|
+
if (!w) return n;
|
|
1214
|
+
const N = w.toLowerCase();
|
|
1215
|
+
return n.filter((y) => y.label.toLowerCase().includes(N));
|
|
1216
|
+
}, [n, w]);
|
|
1217
1217
|
Ne(() => {
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
}, [
|
|
1221
|
-
if (!
|
|
1222
|
-
const
|
|
1223
|
-
if (!
|
|
1224
|
-
|
|
1225
|
-
}, [
|
|
1226
|
-
const
|
|
1227
|
-
(
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
if (
|
|
1231
|
-
|
|
1232
|
-
const B =
|
|
1233
|
-
return B <
|
|
1218
|
+
const N = ce.findIndex((y) => !y.disabled);
|
|
1219
|
+
E(N >= 0 ? N : 0);
|
|
1220
|
+
}, [ce]), Ne(() => {
|
|
1221
|
+
if (!b) return;
|
|
1222
|
+
const N = ne.current;
|
|
1223
|
+
if (!N) return;
|
|
1224
|
+
N.querySelectorAll('[role="option"]')[W]?.scrollIntoView?.({ block: "nearest" });
|
|
1225
|
+
}, [W, b]);
|
|
1226
|
+
const me = pe(
|
|
1227
|
+
(N) => {
|
|
1228
|
+
const y = ce.map((v, B) => v.disabled ? -1 : B).filter((v) => v >= 0);
|
|
1229
|
+
if (y.length !== 0)
|
|
1230
|
+
if (N.key === "ArrowDown")
|
|
1231
|
+
N.preventDefault(), E((v) => {
|
|
1232
|
+
const B = y.indexOf(v);
|
|
1233
|
+
return B < y.length - 1 ? y[B + 1] : y[0];
|
|
1234
1234
|
});
|
|
1235
|
-
else if (
|
|
1236
|
-
|
|
1237
|
-
const B =
|
|
1238
|
-
return B > 0 ?
|
|
1235
|
+
else if (N.key === "ArrowUp")
|
|
1236
|
+
N.preventDefault(), E((v) => {
|
|
1237
|
+
const B = y.indexOf(v);
|
|
1238
|
+
return B > 0 ? y[B - 1] : y[y.length - 1];
|
|
1239
1239
|
});
|
|
1240
|
-
else if (
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
} else
|
|
1240
|
+
else if (N.key === "Enter") {
|
|
1241
|
+
N.preventDefault();
|
|
1242
|
+
const v = ce[W];
|
|
1243
|
+
v && !v.disabled && z(v.value);
|
|
1244
|
+
} else N.key === "Escape" && (N.preventDefault(), X());
|
|
1245
1245
|
},
|
|
1246
|
-
[
|
|
1246
|
+
[ce, W, z, X]
|
|
1247
1247
|
);
|
|
1248
1248
|
Ne(() => {
|
|
1249
|
-
if (!
|
|
1250
|
-
const
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1249
|
+
if (!b) return;
|
|
1250
|
+
const N = (y) => {
|
|
1251
|
+
const v = y.target;
|
|
1252
|
+
Z.current?.contains(v) || ie.current?.contains(v) || X();
|
|
1253
1253
|
};
|
|
1254
|
-
return document.addEventListener("mousedown",
|
|
1255
|
-
}, [
|
|
1256
|
-
const K = n.find((
|
|
1257
|
-
return /* @__PURE__ */
|
|
1254
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
1255
|
+
}, [b, X]);
|
|
1256
|
+
const K = n.find((N) => N.value === l)?.label, H = ce.filter((N) => !N.disabled);
|
|
1257
|
+
return /* @__PURE__ */ j(
|
|
1258
1258
|
"div",
|
|
1259
1259
|
{
|
|
1260
|
-
ref:
|
|
1260
|
+
ref: Z,
|
|
1261
1261
|
className: m(
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
t &&
|
|
1266
|
-
a &&
|
|
1262
|
+
P.wrapper,
|
|
1263
|
+
P.searchableWrapper,
|
|
1264
|
+
P[e],
|
|
1265
|
+
t && P.error,
|
|
1266
|
+
a && P.disabled,
|
|
1267
1267
|
o?.wrapper,
|
|
1268
1268
|
c
|
|
1269
1269
|
),
|
|
@@ -1272,108 +1272,108 @@ const Jt = $e(
|
|
|
1272
1272
|
/* @__PURE__ */ s(
|
|
1273
1273
|
"select",
|
|
1274
1274
|
{
|
|
1275
|
-
ref:
|
|
1276
|
-
className:
|
|
1275
|
+
ref: re,
|
|
1276
|
+
className: P.hiddenSelect,
|
|
1277
1277
|
value: l ?? "",
|
|
1278
1278
|
disabled: a,
|
|
1279
1279
|
tabIndex: -1,
|
|
1280
1280
|
"aria-hidden": "true",
|
|
1281
1281
|
onChange: () => {
|
|
1282
1282
|
},
|
|
1283
|
-
children: n.map((
|
|
1283
|
+
children: n.map((N) => /* @__PURE__ */ s("option", { value: N.value, children: N.label }, N.value))
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ j(
|
|
1287
1287
|
"button",
|
|
1288
1288
|
{
|
|
1289
1289
|
ref: $,
|
|
1290
1290
|
id: h,
|
|
1291
1291
|
type: "button",
|
|
1292
1292
|
className: m(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
t &&
|
|
1298
|
-
|
|
1293
|
+
P.root,
|
|
1294
|
+
P.searchableTrigger,
|
|
1295
|
+
P[e],
|
|
1296
|
+
b && P.triggerOpen,
|
|
1297
|
+
t && P.error,
|
|
1298
|
+
b && P.visuallyHidden,
|
|
1299
1299
|
o?.root
|
|
1300
1300
|
),
|
|
1301
1301
|
onClick: A,
|
|
1302
1302
|
disabled: a,
|
|
1303
|
-
"aria-expanded":
|
|
1303
|
+
"aria-expanded": b,
|
|
1304
1304
|
"aria-haspopup": "listbox",
|
|
1305
|
-
"aria-controls":
|
|
1305
|
+
"aria-controls": b ? V : void 0,
|
|
1306
1306
|
children: [
|
|
1307
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1308
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1307
|
+
/* @__PURE__ */ s("span", { className: m(P.triggerLabel, !K && P.placeholder), children: K || r }),
|
|
1308
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowInline, o?.arrow) })
|
|
1309
1309
|
]
|
|
1310
1310
|
}
|
|
1311
1311
|
),
|
|
1312
|
-
|
|
1312
|
+
b && /* @__PURE__ */ s(
|
|
1313
1313
|
"input",
|
|
1314
1314
|
{
|
|
1315
1315
|
ref: C,
|
|
1316
1316
|
type: "text",
|
|
1317
1317
|
role: "combobox",
|
|
1318
1318
|
className: m(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
t &&
|
|
1319
|
+
P.root,
|
|
1320
|
+
P.searchableTrigger,
|
|
1321
|
+
P[e],
|
|
1322
|
+
P.triggerOpen,
|
|
1323
|
+
t && P.error,
|
|
1324
1324
|
o?.root,
|
|
1325
1325
|
o?.search
|
|
1326
1326
|
),
|
|
1327
1327
|
placeholder: K || r,
|
|
1328
|
-
value:
|
|
1329
|
-
onChange: (
|
|
1330
|
-
onKeyDown:
|
|
1328
|
+
value: w,
|
|
1329
|
+
onChange: (N) => J(N.target.value),
|
|
1330
|
+
onKeyDown: me,
|
|
1331
1331
|
"aria-expanded": !0,
|
|
1332
1332
|
"aria-haspopup": "listbox",
|
|
1333
|
-
"aria-controls":
|
|
1334
|
-
"aria-activedescendant":
|
|
1333
|
+
"aria-controls": V,
|
|
1334
|
+
"aria-activedescendant": H.length > 0 ? `select-option-${ce[W]?.value}` : void 0
|
|
1335
1335
|
}
|
|
1336
1336
|
),
|
|
1337
|
-
|
|
1338
|
-
const
|
|
1337
|
+
b && (() => {
|
|
1338
|
+
const N = p ? {
|
|
1339
1339
|
position: "fixed",
|
|
1340
1340
|
top: ae.top + 4,
|
|
1341
1341
|
left: ae.left,
|
|
1342
1342
|
right: "auto",
|
|
1343
1343
|
width: ae.width,
|
|
1344
1344
|
zIndex: "var(--crk-z-floating)"
|
|
1345
|
-
} : void 0,
|
|
1345
|
+
} : void 0, y = /* @__PURE__ */ s(
|
|
1346
1346
|
"div",
|
|
1347
1347
|
{
|
|
1348
|
-
id:
|
|
1349
|
-
ref:
|
|
1350
|
-
className: m(
|
|
1351
|
-
style:
|
|
1348
|
+
id: V,
|
|
1349
|
+
ref: ie,
|
|
1350
|
+
className: m(P.menu, o?.menu),
|
|
1351
|
+
style: N,
|
|
1352
1352
|
role: "listbox",
|
|
1353
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
1353
|
+
children: /* @__PURE__ */ s("div", { className: P.menuItems, ref: ne, children: ce.length === 0 ? /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }) : ce.map((v, B) => /* @__PURE__ */ s(
|
|
1354
1354
|
"button",
|
|
1355
1355
|
{
|
|
1356
|
-
id: `select-option-${
|
|
1356
|
+
id: `select-option-${v.value}`,
|
|
1357
1357
|
type: "button",
|
|
1358
1358
|
role: "option",
|
|
1359
|
-
"aria-selected":
|
|
1359
|
+
"aria-selected": v.value === l,
|
|
1360
1360
|
className: m(
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
B ===
|
|
1361
|
+
P.item,
|
|
1362
|
+
v.disabled && P.itemDisabled,
|
|
1363
|
+
v.value === l && P.itemSelected,
|
|
1364
|
+
B === W && P.itemHighlighted,
|
|
1365
1365
|
o?.item
|
|
1366
1366
|
),
|
|
1367
|
-
disabled:
|
|
1368
|
-
onClick: () =>
|
|
1369
|
-
onMouseEnter: () =>
|
|
1370
|
-
children:
|
|
1367
|
+
disabled: v.disabled,
|
|
1368
|
+
onClick: () => z(v.value),
|
|
1369
|
+
onMouseEnter: () => E(B),
|
|
1370
|
+
children: v.content ?? v.label
|
|
1371
1371
|
},
|
|
1372
|
-
|
|
1372
|
+
v.value
|
|
1373
1373
|
)) })
|
|
1374
1374
|
}
|
|
1375
1375
|
);
|
|
1376
|
-
return
|
|
1376
|
+
return p && typeof document < "u" ? pt(y, document.body) : y;
|
|
1377
1377
|
})()
|
|
1378
1378
|
]
|
|
1379
1379
|
}
|
|
@@ -1396,96 +1396,97 @@ const en = $e(
|
|
|
1396
1396
|
searchPlaceholder: u,
|
|
1397
1397
|
onValuesChange: d,
|
|
1398
1398
|
clearSearchOnSelect: f = !0,
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1399
|
+
closeOnSelect: p = !0,
|
|
1400
|
+
allowCreate: L = !1,
|
|
1401
|
+
onCreate: b,
|
|
1402
|
+
createLabel: R,
|
|
1403
|
+
portal: w = !0
|
|
1404
|
+
}, J) => {
|
|
1405
|
+
const W = Array.isArray(l) ? l : l ? [l] : [], [E, Z] = Le(!1), [C, $] = Le(""), [ie, ne] = Le(0), V = oe(null), ae = oe(null), S = oe(null), re = oe(null), F = oe(null), X = Ye(), A = Tt(F, E && w), z = oe(null), ce = J ?? z, me = pe(() => {
|
|
1406
|
+
Z(!1), $(""), ne(0);
|
|
1407
|
+
}, []), K = pe(() => {
|
|
1408
|
+
a || (Z(!0), $(""), ne(0), setTimeout(() => ae.current?.focus(), 0));
|
|
1409
|
+
}, [a]), H = pe(
|
|
1410
|
+
(k) => {
|
|
1411
|
+
const G = W.includes(k) ? W.filter((O) => O !== k) : [...W, k];
|
|
1412
|
+
d?.(G), p ? me() : f && $("");
|
|
1412
1413
|
},
|
|
1413
|
-
[
|
|
1414
|
-
),
|
|
1415
|
-
(
|
|
1416
|
-
|
|
1414
|
+
[W, d, p, me, f]
|
|
1415
|
+
), N = pe(
|
|
1416
|
+
(k, G) => {
|
|
1417
|
+
G.stopPropagation(), d?.(W.filter((O) => O !== k));
|
|
1417
1418
|
},
|
|
1418
|
-
[
|
|
1419
|
-
),
|
|
1420
|
-
if (!
|
|
1421
|
-
const
|
|
1422
|
-
return n.filter((
|
|
1423
|
-
}, [n,
|
|
1424
|
-
(
|
|
1425
|
-
) && !
|
|
1426
|
-
|
|
1427
|
-
}, [
|
|
1419
|
+
[W, d]
|
|
1420
|
+
), y = ke(() => {
|
|
1421
|
+
if (!C) return n;
|
|
1422
|
+
const k = C.toLowerCase();
|
|
1423
|
+
return n.filter((G) => G.label.toLowerCase().includes(k));
|
|
1424
|
+
}, [n, C]), v = C.trim(), B = L && v.length > 0 && !n.some(
|
|
1425
|
+
(k) => k.label.toLowerCase() === v.toLowerCase() || k.value === v
|
|
1426
|
+
) && !W.includes(v), _ = pe(() => {
|
|
1427
|
+
v && (W.includes(v) || (b?.(v), d?.([...W, v]), p ? me() : f && $("")));
|
|
1428
|
+
}, [v, W, b, d, p, me, f]);
|
|
1428
1429
|
Ne(() => {
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
}, [
|
|
1432
|
-
if (!
|
|
1433
|
-
const
|
|
1434
|
-
if (!
|
|
1435
|
-
|
|
1436
|
-
}, [
|
|
1437
|
-
const
|
|
1438
|
-
(
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1430
|
+
const k = y.findIndex((G) => !G.disabled);
|
|
1431
|
+
ne(k >= 0 ? k : 0);
|
|
1432
|
+
}, [y]), Ne(() => {
|
|
1433
|
+
if (!E) return;
|
|
1434
|
+
const k = re.current;
|
|
1435
|
+
if (!k) return;
|
|
1436
|
+
k.querySelectorAll('[role="option"]')[ie]?.scrollIntoView?.({ block: "nearest" });
|
|
1437
|
+
}, [ie, E]);
|
|
1438
|
+
const q = y.length, U = pe(
|
|
1439
|
+
(k) => {
|
|
1440
|
+
const G = y.map((O, le) => O.disabled ? -1 : le).filter((O) => O >= 0);
|
|
1441
|
+
if (B && G.push(q), k.key === "Backspace" && C === "" && W.length > 0) {
|
|
1442
|
+
k.preventDefault(), d?.(W.slice(0, -1));
|
|
1442
1443
|
return;
|
|
1443
1444
|
}
|
|
1444
|
-
if (
|
|
1445
|
-
if (
|
|
1446
|
-
if (
|
|
1447
|
-
|
|
1445
|
+
if (G.length !== 0)
|
|
1446
|
+
if (k.key === "ArrowDown") {
|
|
1447
|
+
if (k.preventDefault(), !E) {
|
|
1448
|
+
K();
|
|
1448
1449
|
return;
|
|
1449
1450
|
}
|
|
1450
|
-
|
|
1451
|
-
const
|
|
1452
|
-
return
|
|
1451
|
+
ne((O) => {
|
|
1452
|
+
const le = G.indexOf(O);
|
|
1453
|
+
return le < G.length - 1 ? G[le + 1] : G[0];
|
|
1453
1454
|
});
|
|
1454
|
-
} else if (
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
return
|
|
1455
|
+
} else if (k.key === "ArrowUp")
|
|
1456
|
+
k.preventDefault(), ne((O) => {
|
|
1457
|
+
const le = G.indexOf(O);
|
|
1458
|
+
return le > 0 ? G[le - 1] : G[G.length - 1];
|
|
1458
1459
|
});
|
|
1459
|
-
else if (
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1460
|
+
else if (k.key === "Enter") {
|
|
1461
|
+
if (k.preventDefault(), B && ie === q) {
|
|
1462
|
+
_();
|
|
1462
1463
|
return;
|
|
1463
1464
|
}
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
} else
|
|
1465
|
+
const O = y[ie];
|
|
1466
|
+
O && !O.disabled ? H(O.value) : B && _();
|
|
1467
|
+
} else k.key === "Escape" && (k.preventDefault(), me());
|
|
1467
1468
|
},
|
|
1468
|
-
[
|
|
1469
|
+
[y, ie, H, me, C, W, d, E, K, B, _, q]
|
|
1469
1470
|
);
|
|
1470
1471
|
Ne(() => {
|
|
1471
|
-
if (!
|
|
1472
|
-
const
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1472
|
+
if (!E) return;
|
|
1473
|
+
const k = (G) => {
|
|
1474
|
+
const O = G.target;
|
|
1475
|
+
V.current?.contains(O) || S.current?.contains(O) || me();
|
|
1475
1476
|
};
|
|
1476
|
-
return document.addEventListener("mousedown",
|
|
1477
|
-
}, [
|
|
1478
|
-
const
|
|
1479
|
-
return /* @__PURE__ */
|
|
1477
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
1478
|
+
}, [E, me]);
|
|
1479
|
+
const ee = W.map((k) => n.find((O) => O.value === k) ?? { value: k, label: k });
|
|
1480
|
+
return /* @__PURE__ */ j(
|
|
1480
1481
|
"div",
|
|
1481
1482
|
{
|
|
1482
|
-
ref:
|
|
1483
|
+
ref: V,
|
|
1483
1484
|
className: m(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
t &&
|
|
1488
|
-
a &&
|
|
1485
|
+
P.wrapper,
|
|
1486
|
+
P.searchableWrapper,
|
|
1487
|
+
P[e],
|
|
1488
|
+
t && P.error,
|
|
1489
|
+
a && P.disabled,
|
|
1489
1490
|
o?.wrapper,
|
|
1490
1491
|
c
|
|
1491
1492
|
),
|
|
@@ -1494,135 +1495,135 @@ const en = $e(
|
|
|
1494
1495
|
/* @__PURE__ */ s(
|
|
1495
1496
|
"select",
|
|
1496
1497
|
{
|
|
1497
|
-
ref:
|
|
1498
|
-
className:
|
|
1498
|
+
ref: ce,
|
|
1499
|
+
className: P.hiddenSelect,
|
|
1499
1500
|
multiple: !0,
|
|
1500
|
-
value:
|
|
1501
|
+
value: W,
|
|
1501
1502
|
disabled: a,
|
|
1502
1503
|
tabIndex: -1,
|
|
1503
1504
|
"aria-hidden": "true",
|
|
1504
1505
|
onChange: () => {
|
|
1505
1506
|
},
|
|
1506
|
-
children: n.map((
|
|
1507
|
+
children: n.map((k) => /* @__PURE__ */ s("option", { value: k.value, children: k.label }, k.value))
|
|
1507
1508
|
}
|
|
1508
1509
|
),
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ j(
|
|
1510
1511
|
"div",
|
|
1511
1512
|
{
|
|
1512
|
-
ref:
|
|
1513
|
+
ref: F,
|
|
1513
1514
|
className: m(
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
t &&
|
|
1518
|
-
a &&
|
|
1515
|
+
P.multiTrigger,
|
|
1516
|
+
P[e],
|
|
1517
|
+
E && P.triggerOpen,
|
|
1518
|
+
t && P.error,
|
|
1519
|
+
a && P.multiTriggerDisabled,
|
|
1519
1520
|
o?.root
|
|
1520
1521
|
),
|
|
1521
1522
|
onClick: () => {
|
|
1522
|
-
|
|
1523
|
+
E ? ae.current?.focus() : K();
|
|
1523
1524
|
},
|
|
1524
1525
|
role: "combobox",
|
|
1525
|
-
"aria-expanded":
|
|
1526
|
+
"aria-expanded": E,
|
|
1526
1527
|
"aria-haspopup": "listbox",
|
|
1527
|
-
"aria-controls":
|
|
1528
|
+
"aria-controls": E ? X : void 0,
|
|
1528
1529
|
children: [
|
|
1529
|
-
|
|
1530
|
-
/* @__PURE__ */ s("span", { className:
|
|
1530
|
+
ee.map((k) => /* @__PURE__ */ j("span", { className: m(P.chip, o?.chip), children: [
|
|
1531
|
+
/* @__PURE__ */ s("span", { className: P.chipLabel, children: k.content ?? k.label }),
|
|
1531
1532
|
/* @__PURE__ */ s(
|
|
1532
1533
|
"button",
|
|
1533
1534
|
{
|
|
1534
1535
|
type: "button",
|
|
1535
|
-
className: m(
|
|
1536
|
-
onClick: (
|
|
1537
|
-
"aria-label": `Remove ${
|
|
1536
|
+
className: m(P.chipRemove, o?.chipRemove),
|
|
1537
|
+
onClick: (G) => N(k.value, G),
|
|
1538
|
+
"aria-label": `Remove ${k.label}`,
|
|
1538
1539
|
tabIndex: -1,
|
|
1539
1540
|
children: "×"
|
|
1540
1541
|
}
|
|
1541
1542
|
)
|
|
1542
|
-
] },
|
|
1543
|
+
] }, k.value)),
|
|
1543
1544
|
/* @__PURE__ */ s(
|
|
1544
1545
|
"input",
|
|
1545
1546
|
{
|
|
1546
|
-
ref:
|
|
1547
|
+
ref: ae,
|
|
1547
1548
|
id: h,
|
|
1548
1549
|
type: "text",
|
|
1549
|
-
className:
|
|
1550
|
-
placeholder:
|
|
1551
|
-
value:
|
|
1552
|
-
onChange: (
|
|
1553
|
-
|
|
1550
|
+
className: P.multiSearch,
|
|
1551
|
+
placeholder: W.length === 0 ? r : "",
|
|
1552
|
+
value: C,
|
|
1553
|
+
onChange: (k) => {
|
|
1554
|
+
$(k.target.value), E || K();
|
|
1554
1555
|
},
|
|
1555
|
-
onKeyDown:
|
|
1556
|
+
onKeyDown: U,
|
|
1556
1557
|
disabled: a,
|
|
1557
1558
|
"aria-label": "Search options"
|
|
1558
1559
|
}
|
|
1559
1560
|
),
|
|
1560
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1561
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowMulti, o?.arrow) })
|
|
1561
1562
|
]
|
|
1562
1563
|
}
|
|
1563
1564
|
),
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1565
|
+
E && (() => {
|
|
1566
|
+
const k = w ? {
|
|
1566
1567
|
position: "fixed",
|
|
1567
|
-
top:
|
|
1568
|
-
left:
|
|
1568
|
+
top: A.top + 4,
|
|
1569
|
+
left: A.left,
|
|
1569
1570
|
right: "auto",
|
|
1570
|
-
width:
|
|
1571
|
+
width: A.width,
|
|
1571
1572
|
zIndex: "var(--crk-z-floating)"
|
|
1572
|
-
} : void 0,
|
|
1573
|
+
} : void 0, G = /* @__PURE__ */ s(
|
|
1573
1574
|
"div",
|
|
1574
1575
|
{
|
|
1575
|
-
id:
|
|
1576
|
-
ref:
|
|
1577
|
-
className: m(
|
|
1578
|
-
style:
|
|
1576
|
+
id: X,
|
|
1577
|
+
ref: S,
|
|
1578
|
+
className: m(P.menu, o?.menu),
|
|
1579
|
+
style: k,
|
|
1579
1580
|
role: "listbox",
|
|
1580
1581
|
"aria-multiselectable": "true",
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1585
|
-
return /* @__PURE__ */
|
|
1582
|
+
children: /* @__PURE__ */ j("div", { className: P.menuItems, ref: re, children: [
|
|
1583
|
+
y.length === 0 && !B && /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }),
|
|
1584
|
+
y.map((O, le) => {
|
|
1585
|
+
const ge = W.includes(O.value);
|
|
1586
|
+
return /* @__PURE__ */ j(
|
|
1586
1587
|
"button",
|
|
1587
1588
|
{
|
|
1588
|
-
id: `select-option-${
|
|
1589
|
+
id: `select-option-${O.value}`,
|
|
1589
1590
|
type: "button",
|
|
1590
1591
|
role: "option",
|
|
1591
|
-
"aria-selected":
|
|
1592
|
+
"aria-selected": ge,
|
|
1592
1593
|
className: m(
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1594
|
+
P.item,
|
|
1595
|
+
O.disabled && P.itemDisabled,
|
|
1596
|
+
ge && P.itemSelected,
|
|
1597
|
+
le === ie && P.itemHighlighted,
|
|
1597
1598
|
o?.item
|
|
1598
1599
|
),
|
|
1599
|
-
disabled:
|
|
1600
|
-
onClick: () =>
|
|
1601
|
-
onMouseEnter: () =>
|
|
1600
|
+
disabled: O.disabled,
|
|
1601
|
+
onClick: () => H(O.value),
|
|
1602
|
+
onMouseEnter: () => ne(le),
|
|
1602
1603
|
children: [
|
|
1603
|
-
|
|
1604
|
-
|
|
1604
|
+
ge && /* @__PURE__ */ s("span", { className: P.itemCheck, "aria-hidden": "true" }),
|
|
1605
|
+
O.content ?? O.label
|
|
1605
1606
|
]
|
|
1606
1607
|
},
|
|
1607
|
-
|
|
1608
|
+
O.value
|
|
1608
1609
|
);
|
|
1609
1610
|
}),
|
|
1610
|
-
|
|
1611
|
+
B && /* @__PURE__ */ s(
|
|
1611
1612
|
"button",
|
|
1612
1613
|
{
|
|
1613
1614
|
type: "button",
|
|
1614
1615
|
role: "option",
|
|
1615
1616
|
"aria-selected": !1,
|
|
1616
1617
|
className: m(
|
|
1617
|
-
|
|
1618
|
-
|
|
1618
|
+
P.item,
|
|
1619
|
+
ie === q && P.itemHighlighted,
|
|
1619
1620
|
o?.item
|
|
1620
1621
|
),
|
|
1621
|
-
onClick:
|
|
1622
|
-
onMouseEnter: () =>
|
|
1623
|
-
children:
|
|
1622
|
+
onClick: _,
|
|
1623
|
+
onMouseEnter: () => ne(q),
|
|
1624
|
+
children: R ? R(v) : /* @__PURE__ */ j(je, { children: [
|
|
1624
1625
|
"Create “",
|
|
1625
|
-
/* @__PURE__ */ s("strong", { children:
|
|
1626
|
+
/* @__PURE__ */ s("strong", { children: v }),
|
|
1626
1627
|
"”"
|
|
1627
1628
|
] })
|
|
1628
1629
|
},
|
|
@@ -1631,7 +1632,7 @@ const en = $e(
|
|
|
1631
1632
|
] })
|
|
1632
1633
|
}
|
|
1633
1634
|
);
|
|
1634
|
-
return
|
|
1635
|
+
return w && typeof document < "u" ? pt(G, document.body) : G;
|
|
1635
1636
|
})()
|
|
1636
1637
|
]
|
|
1637
1638
|
}
|
|
@@ -1657,10 +1658,10 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1657
1658
|
style: o,
|
|
1658
1659
|
...c
|
|
1659
1660
|
}, i) => {
|
|
1660
|
-
const l =
|
|
1661
|
+
const l = oe(null);
|
|
1661
1662
|
return Ne(() => {
|
|
1662
1663
|
l.current && (l.current.indeterminate = t);
|
|
1663
|
-
}, [t]), /* @__PURE__ */
|
|
1664
|
+
}, [t]), /* @__PURE__ */ j(
|
|
1664
1665
|
"label",
|
|
1665
1666
|
{
|
|
1666
1667
|
className: m(dt.root, t && dt.indeterminate, n?.root, r),
|
|
@@ -1727,10 +1728,10 @@ const Vi = $e(
|
|
|
1727
1728
|
name: l,
|
|
1728
1729
|
...a
|
|
1729
1730
|
}, h) => {
|
|
1730
|
-
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i,
|
|
1731
|
+
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i, p = (L) => {
|
|
1731
1732
|
u?.onChange?.(t), c?.(L);
|
|
1732
1733
|
};
|
|
1733
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ j("label", { className: m(ht.root, n?.root, r), style: o, children: [
|
|
1734
1735
|
/* @__PURE__ */ s(
|
|
1735
1736
|
"input",
|
|
1736
1737
|
{
|
|
@@ -1740,7 +1741,7 @@ const Vi = $e(
|
|
|
1740
1741
|
name: d,
|
|
1741
1742
|
value: t,
|
|
1742
1743
|
checked: f,
|
|
1743
|
-
onChange:
|
|
1744
|
+
onChange: p,
|
|
1744
1745
|
...a
|
|
1745
1746
|
}
|
|
1746
1747
|
),
|
|
@@ -1776,24 +1777,24 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1776
1777
|
onChange: i,
|
|
1777
1778
|
...l
|
|
1778
1779
|
}, a) => {
|
|
1779
|
-
const h =
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1780
|
+
const h = oe(null), u = pe(() => {
|
|
1781
|
+
const p = h.current;
|
|
1782
|
+
p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
|
|
1782
1783
|
}, []), d = l.value ?? "";
|
|
1783
1784
|
Ne(() => {
|
|
1784
1785
|
r && u();
|
|
1785
1786
|
}, [r, u, d]);
|
|
1786
|
-
const f =
|
|
1787
|
-
(
|
|
1788
|
-
r && u(), i?.(
|
|
1787
|
+
const f = pe(
|
|
1788
|
+
(p) => {
|
|
1789
|
+
r && u(), i?.(p);
|
|
1789
1790
|
},
|
|
1790
1791
|
[r, u, i]
|
|
1791
1792
|
);
|
|
1792
1793
|
return /* @__PURE__ */ s(
|
|
1793
1794
|
"textarea",
|
|
1794
1795
|
{
|
|
1795
|
-
ref: (
|
|
1796
|
-
h.current =
|
|
1796
|
+
ref: (p) => {
|
|
1797
|
+
h.current = p, typeof a == "function" ? a(p) : a && (a.current = p);
|
|
1797
1798
|
},
|
|
1798
1799
|
className: m(
|
|
1799
1800
|
Ke.root,
|
|
@@ -1812,7 +1813,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1812
1813
|
);
|
|
1813
1814
|
ic.displayName = "Textarea";
|
|
1814
1815
|
function cc(e, t = { width: 600, height: 300 }) {
|
|
1815
|
-
const [n, r] = Le(t), o =
|
|
1816
|
+
const [n, r] = Le(t), o = oe(t);
|
|
1816
1817
|
return Ne(() => {
|
|
1817
1818
|
const c = e.current;
|
|
1818
1819
|
if (!c || typeof ResizeObserver > "u") return;
|
|
@@ -1830,7 +1831,7 @@ function cc(e, t = { width: 600, height: 300 }) {
|
|
|
1830
1831
|
return a.observe(c), () => a.disconnect();
|
|
1831
1832
|
}, [e]), n;
|
|
1832
1833
|
}
|
|
1833
|
-
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI", Mc = "crk-legendItem-rcdvO", wc = "crk-legendSwatch-eJBsF", $c = "crk-legendIcon-6gzcO", Nc = "crk-legendLabel-C-eu3", Lc = "crk-tooltip-m55-N",
|
|
1834
|
+
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI", Mc = "crk-legendItem-rcdvO", wc = "crk-legendSwatch-eJBsF", $c = "crk-legendIcon-6gzcO", Nc = "crk-legendLabel-C-eu3", Lc = "crk-tooltip-m55-N", Rc = "crk-tooltipTitle-0EfoX", Sc = "crk-tooltipRows-MC0wM", Tc = "crk-tooltipRow-ZQomr", Cc = "crk-tooltipLabel-s4OKX", Ac = "crk-tooltipValue-iwj1s", Bc = "crk-empty-aa4vk", Ic = "crk-sparkline-3-eRc", Dc = "crk-tradingHeader-Pb9wS", M = {
|
|
1834
1835
|
root: lc,
|
|
1835
1836
|
canvas: sc,
|
|
1836
1837
|
svg: ac,
|
|
@@ -1851,8 +1852,8 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1851
1852
|
legendIcon: $c,
|
|
1852
1853
|
legendLabel: Nc,
|
|
1853
1854
|
tooltip: Lc,
|
|
1854
|
-
tooltipTitle:
|
|
1855
|
-
tooltipRows:
|
|
1855
|
+
tooltipTitle: Rc,
|
|
1856
|
+
tooltipRows: Sc,
|
|
1856
1857
|
tooltipRow: Tc,
|
|
1857
1858
|
tooltipLabel: Cc,
|
|
1858
1859
|
tooltipValue: Ac,
|
|
@@ -1861,21 +1862,21 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1861
1862
|
tradingHeader: Dc
|
|
1862
1863
|
}, Ve = $e(
|
|
1863
1864
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: c, overlay: i, children: l }, a) => {
|
|
1864
|
-
const h =
|
|
1865
|
+
const h = oe(null);
|
|
1865
1866
|
un(a, () => h.current);
|
|
1866
1867
|
const { width: u } = cc(h), d = Math.max(0, u), f = t ?? Math.round(d / e);
|
|
1867
|
-
return /* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ j(
|
|
1868
1869
|
"div",
|
|
1869
1870
|
{
|
|
1870
1871
|
ref: h,
|
|
1871
|
-
className: m(
|
|
1872
|
+
className: m(M.root, o?.root, n),
|
|
1872
1873
|
style: r,
|
|
1873
1874
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ j("div", { className: M.canvas, style: { height: f || void 0 }, children: [
|
|
1875
1876
|
d > 0 && f > 0 && /* @__PURE__ */ s(
|
|
1876
1877
|
"svg",
|
|
1877
1878
|
{
|
|
1878
|
-
className: m(
|
|
1879
|
+
className: m(M.svg, o?.svg),
|
|
1879
1880
|
width: d,
|
|
1880
1881
|
height: f,
|
|
1881
1882
|
viewBox: `0 0 ${d} ${f}`,
|
|
@@ -1894,13 +1895,13 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1894
1895
|
Ve.displayName = "ChartContainer";
|
|
1895
1896
|
function vt({ config: e, order: t, classes: n }) {
|
|
1896
1897
|
const r = t ?? Object.keys(e);
|
|
1897
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
1898
|
+
return /* @__PURE__ */ s("div", { className: m(M.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
1898
1899
|
const c = e[o];
|
|
1899
|
-
return c ? /* @__PURE__ */
|
|
1900
|
+
return c ? /* @__PURE__ */ j("div", { className: m(M.legendItem, n?.legendItem), role: "listitem", children: [
|
|
1900
1901
|
c.icon ? /* @__PURE__ */ s(
|
|
1901
1902
|
"span",
|
|
1902
1903
|
{
|
|
1903
|
-
className:
|
|
1904
|
+
className: M.legendIcon,
|
|
1904
1905
|
style: { color: c.color },
|
|
1905
1906
|
"aria-hidden": "true",
|
|
1906
1907
|
children: c.icon
|
|
@@ -1908,12 +1909,12 @@ function vt({ config: e, order: t, classes: n }) {
|
|
|
1908
1909
|
) : /* @__PURE__ */ s(
|
|
1909
1910
|
"span",
|
|
1910
1911
|
{
|
|
1911
|
-
className:
|
|
1912
|
+
className: M.legendSwatch,
|
|
1912
1913
|
style: { background: c.color },
|
|
1913
1914
|
"aria-hidden": "true"
|
|
1914
1915
|
}
|
|
1915
1916
|
),
|
|
1916
|
-
/* @__PURE__ */ s("span", { className:
|
|
1917
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: c.label })
|
|
1917
1918
|
] }, o) : null;
|
|
1918
1919
|
}) });
|
|
1919
1920
|
}
|
|
@@ -1930,23 +1931,23 @@ function et({
|
|
|
1930
1931
|
classes: h
|
|
1931
1932
|
}) {
|
|
1932
1933
|
if (!e) return null;
|
|
1933
|
-
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12,
|
|
1934
|
+
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12, p = Math.max(8, n - 16);
|
|
1934
1935
|
return /* @__PURE__ */ s(
|
|
1935
1936
|
"div",
|
|
1936
1937
|
{
|
|
1937
|
-
className: m(
|
|
1938
|
-
style: { left: f, top:
|
|
1938
|
+
className: m(M.tooltip, h?.tooltip),
|
|
1939
|
+
style: { left: f, top: p, width: u },
|
|
1939
1940
|
role: "tooltip",
|
|
1940
|
-
children: c ? c(e) : /* @__PURE__ */
|
|
1941
|
-
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className:
|
|
1942
|
-
/* @__PURE__ */ s("div", { className:
|
|
1943
|
-
const
|
|
1944
|
-
if (
|
|
1945
|
-
const
|
|
1946
|
-
return /* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */ s("span", { className:
|
|
1948
|
-
/* @__PURE__ */ s("span", { className:
|
|
1949
|
-
/* @__PURE__ */ s("span", { className:
|
|
1941
|
+
children: c ? c(e) : /* @__PURE__ */ j(je, { children: [
|
|
1942
|
+
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: M.tooltipTitle, children: String(e[l]) }),
|
|
1943
|
+
/* @__PURE__ */ s("div", { className: M.tooltipRows, children: Object.entries(o).map(([L, b]) => {
|
|
1944
|
+
const R = e[L];
|
|
1945
|
+
if (R == null) return null;
|
|
1946
|
+
const w = typeof R == "number" ? i(R) : String(R), J = a?.(L) ?? b.color;
|
|
1947
|
+
return /* @__PURE__ */ j("div", { className: M.tooltipRow, children: [
|
|
1948
|
+
/* @__PURE__ */ s("span", { className: M.legendSwatch, style: { background: J }, "aria-hidden": "true" }),
|
|
1949
|
+
/* @__PURE__ */ s("span", { className: M.tooltipLabel, children: b.label }),
|
|
1950
|
+
/* @__PURE__ */ s("span", { className: M.tooltipValue, children: w })
|
|
1950
1951
|
] }, L);
|
|
1951
1952
|
}) })
|
|
1952
1953
|
] })
|
|
@@ -1954,11 +1955,11 @@ function et({
|
|
|
1954
1955
|
);
|
|
1955
1956
|
}
|
|
1956
1957
|
function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: c }) {
|
|
1957
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
1958
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */ j("g", { children: [
|
|
1958
1959
|
o && /* @__PURE__ */ s(
|
|
1959
1960
|
"line",
|
|
1960
1961
|
{
|
|
1961
|
-
className: m(
|
|
1962
|
+
className: m(M.gridLine, c?.grid),
|
|
1962
1963
|
x1: t,
|
|
1963
1964
|
x2: t + n,
|
|
1964
1965
|
y1: l,
|
|
@@ -1968,7 +1969,7 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1968
1969
|
/* @__PURE__ */ s(
|
|
1969
1970
|
"text",
|
|
1970
1971
|
{
|
|
1971
|
-
className: m(
|
|
1972
|
+
className: m(M.axisLabel, c?.axisLabel),
|
|
1972
1973
|
x: t - 8,
|
|
1973
1974
|
y: l,
|
|
1974
1975
|
textAnchor: "end",
|
|
@@ -1979,10 +1980,10 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1979
1980
|
] }, `y-${i}`)) });
|
|
1980
1981
|
}
|
|
1981
1982
|
function rn({ ticks: e, y: t, format: n, classes: r }) {
|
|
1982
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
1983
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, r?.axis), children: e.map(({ label: o, x: c }) => /* @__PURE__ */ s(
|
|
1983
1984
|
"text",
|
|
1984
1985
|
{
|
|
1985
|
-
className: m(
|
|
1986
|
+
className: m(M.axisLabel, r?.axisLabel),
|
|
1986
1987
|
x: c,
|
|
1987
1988
|
y: t + 16,
|
|
1988
1989
|
textAnchor: "middle",
|
|
@@ -2062,93 +2063,93 @@ function Ol({
|
|
|
2062
2063
|
valuePosition: u = "top",
|
|
2063
2064
|
renderLabel: d,
|
|
2064
2065
|
activeIndex: f,
|
|
2065
|
-
onPointClick:
|
|
2066
|
+
onPointClick: p,
|
|
2066
2067
|
showGrid: L = !0,
|
|
2067
|
-
showLegend:
|
|
2068
|
-
showTooltip:
|
|
2069
|
-
yTickCount:
|
|
2070
|
-
yFormat:
|
|
2071
|
-
xFormat:
|
|
2072
|
-
valueFormat:
|
|
2073
|
-
renderTooltip:
|
|
2068
|
+
showLegend: b = !0,
|
|
2069
|
+
showTooltip: R = !0,
|
|
2070
|
+
yTickCount: w = 5,
|
|
2071
|
+
yFormat: J,
|
|
2072
|
+
xFormat: W,
|
|
2073
|
+
valueFormat: E,
|
|
2074
|
+
renderTooltip: Z,
|
|
2074
2075
|
margin: C,
|
|
2075
2076
|
emptyMessage: $ = "No data",
|
|
2076
|
-
className:
|
|
2077
|
-
style:
|
|
2078
|
-
classes:
|
|
2077
|
+
className: ie,
|
|
2078
|
+
style: ne,
|
|
2079
|
+
classes: V
|
|
2079
2080
|
}) {
|
|
2080
|
-
const ae = { ...Ec, ...C },
|
|
2081
|
+
const ae = { ...Ec, ...C }, S = ke(() => Object.keys(n), [n]), [re, F] = Le(null), X = oe(null), A = f ?? re, z = (me, K) => {
|
|
2081
2082
|
if (l) {
|
|
2082
|
-
const
|
|
2083
|
-
if (typeof
|
|
2083
|
+
const H = e[K]?.[l];
|
|
2084
|
+
if (typeof H == "string") return H;
|
|
2084
2085
|
}
|
|
2085
|
-
return n[
|
|
2086
|
+
return n[me]?.color ?? "var(--crk-chart-1)";
|
|
2086
2087
|
};
|
|
2087
2088
|
if (e.length === 0)
|
|
2088
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2089
|
-
const
|
|
2089
|
+
return /* @__PURE__ */ s("div", { ref: X, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2090
|
+
const ce = R && A !== null ? /* @__PURE__ */ s(
|
|
2090
2091
|
et,
|
|
2091
2092
|
{
|
|
2092
2093
|
row: e[A],
|
|
2093
|
-
x: Hc(e, t, ae, A,
|
|
2094
|
+
x: Hc(e, t, ae, A, X),
|
|
2094
2095
|
y: 16,
|
|
2095
|
-
containerWidth:
|
|
2096
|
+
containerWidth: X.current?.getBoundingClientRect().width ?? 0,
|
|
2096
2097
|
config: n,
|
|
2097
|
-
render:
|
|
2098
|
-
valueFormat:
|
|
2098
|
+
render: Z ? () => Z(e[A]) : void 0,
|
|
2099
|
+
valueFormat: E,
|
|
2099
2100
|
titleKey: t,
|
|
2100
|
-
resolveColor: l ? (
|
|
2101
|
-
classes:
|
|
2101
|
+
resolveColor: l ? (me) => z(me, A) : void 0,
|
|
2102
|
+
classes: V
|
|
2102
2103
|
}
|
|
2103
2104
|
) : null;
|
|
2104
2105
|
return /* @__PURE__ */ s(
|
|
2105
2106
|
Ve,
|
|
2106
2107
|
{
|
|
2107
|
-
ref:
|
|
2108
|
+
ref: X,
|
|
2108
2109
|
aspectRatio: r,
|
|
2109
2110
|
height: o,
|
|
2110
|
-
className:
|
|
2111
|
-
style:
|
|
2112
|
-
classes:
|
|
2113
|
-
legend:
|
|
2114
|
-
overlay:
|
|
2115
|
-
children: ({ width:
|
|
2116
|
-
const
|
|
2117
|
-
for (const
|
|
2111
|
+
className: ie,
|
|
2112
|
+
style: ne,
|
|
2113
|
+
classes: V,
|
|
2114
|
+
legend: b ? /* @__PURE__ */ s(vt, { config: n, classes: V }) : void 0,
|
|
2115
|
+
overlay: ce,
|
|
2116
|
+
children: ({ width: me, height: K }) => {
|
|
2117
|
+
const H = ae.left, N = me - ae.right, y = ae.top, v = K - ae.bottom, B = Math.max(0, N - H), _ = Math.max(0, v - y), q = e.map((g) => String(g[t])), U = Xe(q, [H, N], 0), ee = [];
|
|
2118
|
+
for (const g of S)
|
|
2118
2119
|
for (const x of e) {
|
|
2119
|
-
const
|
|
2120
|
-
typeof
|
|
2120
|
+
const te = x[g];
|
|
2121
|
+
typeof te == "number" && ee.push(te);
|
|
2121
2122
|
}
|
|
2122
|
-
const [
|
|
2123
|
-
return /* @__PURE__ */
|
|
2123
|
+
const [k, G] = bt(ee), O = Math.min(0, k), le = qe(O, G, w), ge = Je([le[0], le[le.length - 1]], [v, y]), be = le.map((g) => ({ value: g, y: ge(g) })), Re = Wc(q).map((g) => ({ label: g, x: U(g) }));
|
|
2124
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2124
2125
|
/* @__PURE__ */ s(
|
|
2125
2126
|
nn,
|
|
2126
2127
|
{
|
|
2127
2128
|
ticks: be,
|
|
2128
|
-
x:
|
|
2129
|
+
x: H,
|
|
2129
2130
|
plotWidth: B,
|
|
2130
|
-
format:
|
|
2131
|
+
format: J,
|
|
2131
2132
|
showGrid: L,
|
|
2132
|
-
classes:
|
|
2133
|
+
classes: V
|
|
2133
2134
|
}
|
|
2134
2135
|
),
|
|
2135
|
-
/* @__PURE__ */ s(rn, { ticks:
|
|
2136
|
-
|
|
2137
|
-
const x = n[
|
|
2138
|
-
const I =
|
|
2139
|
-
return { x:
|
|
2136
|
+
/* @__PURE__ */ s(rn, { ticks: Re, y: v, format: W, classes: V }),
|
|
2137
|
+
S.map((g) => {
|
|
2138
|
+
const x = n[g], te = e.map((D, Y) => {
|
|
2139
|
+
const I = D[g], fe = typeof I == "number" ? I : 0;
|
|
2140
|
+
return { x: U(q[Y]), y: ge(fe), value: fe, row: D };
|
|
2140
2141
|
});
|
|
2141
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, V?.series), children: [
|
|
2142
2143
|
/* @__PURE__ */ s(
|
|
2143
2144
|
"path",
|
|
2144
2145
|
{
|
|
2145
|
-
className: m(
|
|
2146
|
-
d: Pc(
|
|
2146
|
+
className: m(M.linePath),
|
|
2147
|
+
d: Pc(te, c),
|
|
2147
2148
|
stroke: x.color
|
|
2148
2149
|
}
|
|
2149
2150
|
),
|
|
2150
|
-
i &&
|
|
2151
|
-
const I =
|
|
2151
|
+
i && te.map((D, Y) => {
|
|
2152
|
+
const I = z(g, Y), fe = A === Y, Q = f !== void 0 && !fe, T = p ? () => p({ row: D.row, value: D.value, seriesKey: g, index: Y }) : void 0;
|
|
2152
2153
|
return a ? /* @__PURE__ */ s(
|
|
2153
2154
|
"g",
|
|
2154
2155
|
{
|
|
@@ -2156,85 +2157,85 @@ function Ol({
|
|
|
2156
2157
|
style: T ? { cursor: "pointer" } : void 0,
|
|
2157
2158
|
opacity: Q ? 0.45 : 1,
|
|
2158
2159
|
children: a({
|
|
2159
|
-
row:
|
|
2160
|
-
value:
|
|
2161
|
-
seriesKey:
|
|
2162
|
-
index:
|
|
2163
|
-
x:
|
|
2164
|
-
y:
|
|
2160
|
+
row: D.row,
|
|
2161
|
+
value: D.value,
|
|
2162
|
+
seriesKey: g,
|
|
2163
|
+
index: Y,
|
|
2164
|
+
x: D.x,
|
|
2165
|
+
y: D.y,
|
|
2165
2166
|
color: I,
|
|
2166
|
-
active:
|
|
2167
|
+
active: fe
|
|
2167
2168
|
})
|
|
2168
2169
|
},
|
|
2169
|
-
`${
|
|
2170
|
+
`${g}-${Y}`
|
|
2170
2171
|
) : /* @__PURE__ */ s(
|
|
2171
2172
|
"circle",
|
|
2172
2173
|
{
|
|
2173
|
-
className: m(
|
|
2174
|
-
cx:
|
|
2175
|
-
cy:
|
|
2176
|
-
r:
|
|
2174
|
+
className: m(M.point, V?.point),
|
|
2175
|
+
cx: D.x,
|
|
2176
|
+
cy: D.y,
|
|
2177
|
+
r: fe ? 5 : 3.5,
|
|
2177
2178
|
fill: I,
|
|
2178
2179
|
onClick: T,
|
|
2179
2180
|
style: T ? { cursor: "pointer" } : void 0,
|
|
2180
2181
|
opacity: Q ? 0.45 : 1
|
|
2181
2182
|
},
|
|
2182
|
-
`${
|
|
2183
|
+
`${g}-${Y}`
|
|
2183
2184
|
);
|
|
2184
2185
|
}),
|
|
2185
|
-
(h || d) &&
|
|
2186
|
-
const I = d ? d({ row:
|
|
2186
|
+
(h || d) && te.map((D, Y) => {
|
|
2187
|
+
const I = d ? d({ row: D.row, value: D.value, seriesKey: g, index: Y }) : h ? E ? E(D.value) : String(D.value) : null;
|
|
2187
2188
|
if (I == null) return null;
|
|
2188
|
-
const
|
|
2189
|
+
const fe = 10, Q = u === "top" ? D.y - fe : D.y + fe + 4;
|
|
2189
2190
|
return /* @__PURE__ */ s(
|
|
2190
2191
|
"text",
|
|
2191
2192
|
{
|
|
2192
|
-
className: m(
|
|
2193
|
-
x:
|
|
2193
|
+
className: m(M.axisLabel),
|
|
2194
|
+
x: D.x,
|
|
2194
2195
|
y: Q,
|
|
2195
2196
|
textAnchor: "middle",
|
|
2196
2197
|
dominantBaseline: u === "top" ? "auto" : "middle",
|
|
2197
2198
|
children: I
|
|
2198
2199
|
},
|
|
2199
|
-
`label-${
|
|
2200
|
+
`label-${g}-${Y}`
|
|
2200
2201
|
);
|
|
2201
2202
|
})
|
|
2202
|
-
] },
|
|
2203
|
+
] }, g);
|
|
2203
2204
|
}),
|
|
2204
2205
|
A !== null && /* @__PURE__ */ s(
|
|
2205
2206
|
"line",
|
|
2206
2207
|
{
|
|
2207
|
-
className:
|
|
2208
|
-
x1:
|
|
2209
|
-
x2:
|
|
2210
|
-
y1:
|
|
2211
|
-
y2:
|
|
2208
|
+
className: M.cursorLine,
|
|
2209
|
+
x1: U(q[A]),
|
|
2210
|
+
x2: U(q[A]),
|
|
2211
|
+
y1: y,
|
|
2212
|
+
y2: v
|
|
2212
2213
|
}
|
|
2213
2214
|
),
|
|
2214
2215
|
/* @__PURE__ */ s(
|
|
2215
2216
|
"rect",
|
|
2216
2217
|
{
|
|
2217
|
-
className:
|
|
2218
|
-
x:
|
|
2219
|
-
y
|
|
2218
|
+
className: M.interactionLayer,
|
|
2219
|
+
x: H,
|
|
2220
|
+
y,
|
|
2220
2221
|
width: B,
|
|
2221
2222
|
height: _,
|
|
2222
|
-
onMouseMove: (
|
|
2223
|
-
const x =
|
|
2223
|
+
onMouseMove: (g) => {
|
|
2224
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + H, D = U.step(), Y = Math.max(
|
|
2224
2225
|
0,
|
|
2225
|
-
Math.min(e.length - 1, Math.round((
|
|
2226
|
+
Math.min(e.length - 1, Math.round((te - H - D / 2) / D))
|
|
2226
2227
|
);
|
|
2227
|
-
|
|
2228
|
+
F(Y);
|
|
2228
2229
|
},
|
|
2229
|
-
onMouseLeave: () =>
|
|
2230
|
-
onClick:
|
|
2231
|
-
const x =
|
|
2230
|
+
onMouseLeave: () => F(null),
|
|
2231
|
+
onClick: p ? (g) => {
|
|
2232
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + H, D = U.step(), Y = Math.max(
|
|
2232
2233
|
0,
|
|
2233
|
-
Math.min(e.length - 1, Math.round((
|
|
2234
|
-
), I =
|
|
2235
|
-
|
|
2234
|
+
Math.min(e.length - 1, Math.round((te - H - D / 2) / D))
|
|
2235
|
+
), I = S[0], fe = e[Y][I], Q = typeof fe == "number" ? fe : 0;
|
|
2236
|
+
p({ row: e[Y], value: Q, seriesKey: I, index: Y });
|
|
2236
2237
|
} : void 0,
|
|
2237
|
-
style:
|
|
2238
|
+
style: p ? { cursor: "pointer" } : void 0
|
|
2238
2239
|
}
|
|
2239
2240
|
)
|
|
2240
2241
|
] });
|
|
@@ -2249,7 +2250,7 @@ function Hc(e, t, n, r, o) {
|
|
|
2249
2250
|
return Xe(l, [n.left, i - n.right], 0)(l[r]);
|
|
2250
2251
|
}
|
|
2251
2252
|
const Oc = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
2252
|
-
function
|
|
2253
|
+
function Rt(e, t) {
|
|
2253
2254
|
if (e.length === 0) return "";
|
|
2254
2255
|
if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
|
|
2255
2256
|
if (t === "linear")
|
|
@@ -2269,12 +2270,12 @@ function St(e, t) {
|
|
|
2269
2270
|
}
|
|
2270
2271
|
function Dt(e, t, n) {
|
|
2271
2272
|
if (e.length === 0) return "";
|
|
2272
|
-
const r =
|
|
2273
|
+
const r = Rt(e, n);
|
|
2273
2274
|
if (typeof t == "number") {
|
|
2274
2275
|
const l = e[e.length - 1], a = e[0];
|
|
2275
2276
|
return `${r} L ${l.x} ${t} L ${a.x} ${t} Z`;
|
|
2276
2277
|
}
|
|
2277
|
-
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i =
|
|
2278
|
+
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i = Rt(o, n).replace(/^M /, "L ");
|
|
2278
2279
|
return `${r} ${i} Z`;
|
|
2279
2280
|
}
|
|
2280
2281
|
function Fc(e, t = 8) {
|
|
@@ -2296,160 +2297,160 @@ function Fl({
|
|
|
2296
2297
|
showXAxis: u = !0,
|
|
2297
2298
|
showYAxis: d = !0,
|
|
2298
2299
|
showLegend: f = !0,
|
|
2299
|
-
showTooltip:
|
|
2300
|
+
showTooltip: p = !0,
|
|
2300
2301
|
yTickCount: L = 5,
|
|
2301
|
-
yFormat:
|
|
2302
|
-
xFormat:
|
|
2303
|
-
valueFormat:
|
|
2304
|
-
renderTooltip:
|
|
2305
|
-
margin:
|
|
2306
|
-
emptyMessage:
|
|
2307
|
-
className:
|
|
2302
|
+
yFormat: b,
|
|
2303
|
+
xFormat: R,
|
|
2304
|
+
valueFormat: w,
|
|
2305
|
+
renderTooltip: J,
|
|
2306
|
+
margin: W,
|
|
2307
|
+
emptyMessage: E = "No data",
|
|
2308
|
+
className: Z,
|
|
2308
2309
|
style: C,
|
|
2309
2310
|
classes: $
|
|
2310
2311
|
}) {
|
|
2311
|
-
const
|
|
2312
|
+
const ie = ke(
|
|
2312
2313
|
() => ({
|
|
2313
2314
|
...Oc,
|
|
2314
2315
|
...d ? {} : { left: 16 },
|
|
2315
|
-
...
|
|
2316
|
+
...W
|
|
2316
2317
|
}),
|
|
2317
|
-
[
|
|
2318
|
-
),
|
|
2318
|
+
[W, d]
|
|
2319
|
+
), ne = ke(() => Object.keys(n), [n]), V = i && ne.length > 0, ae = V && l === "expand", [S, re] = Le(null), F = oe(null), X = Ye();
|
|
2319
2320
|
if (e.length === 0)
|
|
2320
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2321
|
+
return /* @__PURE__ */ s("div", { ref: F, className: m(M.root, $?.root, Z), style: C, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: E }) }) });
|
|
2321
2322
|
const A = ke(() => {
|
|
2322
|
-
const
|
|
2323
|
-
for (let
|
|
2324
|
-
let
|
|
2323
|
+
const H = ne.map(() => []), N = ne.map(() => []);
|
|
2324
|
+
for (let y = 0; y < e.length; y++) {
|
|
2325
|
+
let v = 0;
|
|
2325
2326
|
if (ae) {
|
|
2326
|
-
for (const _ of
|
|
2327
|
-
const
|
|
2328
|
-
typeof
|
|
2327
|
+
for (const _ of ne) {
|
|
2328
|
+
const q = e[y][_];
|
|
2329
|
+
typeof q == "number" && q > 0 && (v += q);
|
|
2329
2330
|
}
|
|
2330
|
-
|
|
2331
|
+
v === 0 && (v = 1);
|
|
2331
2332
|
}
|
|
2332
2333
|
let B = 0;
|
|
2333
|
-
for (let _ = 0; _ <
|
|
2334
|
-
const
|
|
2335
|
-
if (
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2334
|
+
for (let _ = 0; _ < ne.length; _++) {
|
|
2335
|
+
const q = ne[_], U = e[y][q], ee = typeof U == "number" ? U : 0;
|
|
2336
|
+
if (V) {
|
|
2337
|
+
const k = ae ? ee / v : ee;
|
|
2338
|
+
N[_][y] = B, B += k, H[_][y] = B;
|
|
2338
2339
|
} else
|
|
2339
|
-
|
|
2340
|
+
N[_][y] = 0, H[_][y] = ee;
|
|
2340
2341
|
}
|
|
2341
2342
|
}
|
|
2342
|
-
return { tops:
|
|
2343
|
-
}, [e,
|
|
2343
|
+
return { tops: H, bottoms: N };
|
|
2344
|
+
}, [e, ne, V, ae]), { tops: z, bottoms: ce } = A, [me, K] = ke(() => {
|
|
2344
2345
|
if (ae) return [0, 1];
|
|
2345
|
-
let
|
|
2346
|
-
for (const
|
|
2347
|
-
for (const
|
|
2348
|
-
|
|
2349
|
-
for (const
|
|
2350
|
-
for (const
|
|
2351
|
-
|
|
2352
|
-
return [Math.min(0,
|
|
2353
|
-
}, [
|
|
2346
|
+
let H = 0, N = 0;
|
|
2347
|
+
for (const y of z)
|
|
2348
|
+
for (const v of y)
|
|
2349
|
+
v < H && (H = v), v > N && (N = v);
|
|
2350
|
+
for (const y of ce)
|
|
2351
|
+
for (const v of y)
|
|
2352
|
+
v < H && (H = v);
|
|
2353
|
+
return [Math.min(0, H), N];
|
|
2354
|
+
}, [z, ce, ae]);
|
|
2354
2355
|
return /* @__PURE__ */ s(
|
|
2355
2356
|
Ve,
|
|
2356
2357
|
{
|
|
2357
|
-
ref:
|
|
2358
|
+
ref: F,
|
|
2358
2359
|
aspectRatio: r,
|
|
2359
2360
|
height: o,
|
|
2360
|
-
className:
|
|
2361
|
+
className: Z,
|
|
2361
2362
|
style: C,
|
|
2362
2363
|
classes: $,
|
|
2363
2364
|
legend: f ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
2364
|
-
overlay:
|
|
2365
|
+
overlay: p && S !== null ? /* @__PURE__ */ s(
|
|
2365
2366
|
et,
|
|
2366
2367
|
{
|
|
2367
|
-
row: e[
|
|
2368
|
-
x: zc(e, t,
|
|
2368
|
+
row: e[S],
|
|
2369
|
+
x: zc(e, t, ie, S, F),
|
|
2369
2370
|
y: 16,
|
|
2370
|
-
containerWidth:
|
|
2371
|
+
containerWidth: F.current?.getBoundingClientRect().width ?? 0,
|
|
2371
2372
|
config: n,
|
|
2372
|
-
render:
|
|
2373
|
-
valueFormat: ae ? (
|
|
2373
|
+
render: J ? () => J(e[S]) : void 0,
|
|
2374
|
+
valueFormat: ae ? (H) => `${Math.round(H * 100)}%` : w,
|
|
2374
2375
|
titleKey: t,
|
|
2375
2376
|
classes: $
|
|
2376
2377
|
}
|
|
2377
2378
|
) : null,
|
|
2378
|
-
children: ({ width:
|
|
2379
|
-
const
|
|
2380
|
-
return /* @__PURE__ */
|
|
2381
|
-
a && /* @__PURE__ */ s("defs", { children:
|
|
2379
|
+
children: ({ width: H, height: N }) => {
|
|
2380
|
+
const y = ie.left, v = H - ie.right, B = ie.top, _ = N - ie.bottom, q = Math.max(0, v - y), U = Math.max(0, _ - B), ee = e.map((g) => String(g[t])), k = Xe(ee, [y, v], 0), G = ae ? [0, 0.25, 0.5, 0.75, 1] : qe(me, K, L), O = Je([G[0], G[G.length - 1]], [_, B]), le = O(0), ge = G.map((g) => ({ value: g, y: O(g) })), Ce = Fc(ee).map((g) => ({ label: g, x: k(g) })), Re = ae ? (g) => `${Math.round(g * 100)}%` : b;
|
|
2381
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2382
|
+
a && /* @__PURE__ */ s("defs", { children: ne.map((g) => /* @__PURE__ */ j(
|
|
2382
2383
|
"linearGradient",
|
|
2383
2384
|
{
|
|
2384
|
-
id: `${
|
|
2385
|
+
id: `${X}-${g}`,
|
|
2385
2386
|
x1: "0",
|
|
2386
2387
|
y1: "0",
|
|
2387
2388
|
x2: "0",
|
|
2388
2389
|
y2: "1",
|
|
2389
2390
|
children: [
|
|
2390
|
-
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[
|
|
2391
|
-
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[
|
|
2391
|
+
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[g].color, stopOpacity: 0.6 }),
|
|
2392
|
+
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[g].color, stopOpacity: 0.05 })
|
|
2392
2393
|
]
|
|
2393
2394
|
},
|
|
2394
|
-
|
|
2395
|
+
g
|
|
2395
2396
|
)) }),
|
|
2396
2397
|
d ? /* @__PURE__ */ s(
|
|
2397
2398
|
nn,
|
|
2398
2399
|
{
|
|
2399
|
-
ticks:
|
|
2400
|
-
x:
|
|
2401
|
-
plotWidth:
|
|
2402
|
-
format:
|
|
2400
|
+
ticks: ge,
|
|
2401
|
+
x: y,
|
|
2402
|
+
plotWidth: q,
|
|
2403
|
+
format: Re,
|
|
2403
2404
|
showGrid: h,
|
|
2404
2405
|
classes: $
|
|
2405
2406
|
}
|
|
2406
|
-
) : h && /* @__PURE__ */ s("g", { className: m(
|
|
2407
|
+
) : h && /* @__PURE__ */ s("g", { className: m(M.axis, $?.axis), children: ge.map(({ value: g, y: x }) => /* @__PURE__ */ s(
|
|
2407
2408
|
"line",
|
|
2408
2409
|
{
|
|
2409
|
-
className: m(
|
|
2410
|
-
x1:
|
|
2411
|
-
x2:
|
|
2410
|
+
className: m(M.gridLine, $?.grid),
|
|
2411
|
+
x1: y,
|
|
2412
|
+
x2: v,
|
|
2412
2413
|
y1: x,
|
|
2413
2414
|
y2: x
|
|
2414
2415
|
},
|
|
2415
|
-
`grid-${
|
|
2416
|
+
`grid-${g}`
|
|
2416
2417
|
)) }),
|
|
2417
|
-
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format:
|
|
2418
|
-
|
|
2419
|
-
const
|
|
2420
|
-
x:
|
|
2421
|
-
y:
|
|
2422
|
-
})),
|
|
2423
|
-
return /* @__PURE__ */
|
|
2418
|
+
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format: R, classes: $ }),
|
|
2419
|
+
ne.map((g, x) => {
|
|
2420
|
+
const te = n[g], D = e.map((Q, T) => ({
|
|
2421
|
+
x: k(ee[T]),
|
|
2422
|
+
y: O(z[x][T])
|
|
2423
|
+
})), Y = a ? `url(#${X}-${g})` : te.color, I = a ? 1 : 0.18, fe = V ? Dt(D, ce[x].map((Q) => O(Q)), c) : Dt(D, le, c);
|
|
2424
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, $?.series), children: [
|
|
2424
2425
|
/* @__PURE__ */ s(
|
|
2425
2426
|
"path",
|
|
2426
2427
|
{
|
|
2427
|
-
className:
|
|
2428
|
-
d:
|
|
2429
|
-
fill:
|
|
2428
|
+
className: M.areaPath,
|
|
2429
|
+
d: fe,
|
|
2430
|
+
fill: Y,
|
|
2430
2431
|
fillOpacity: I
|
|
2431
2432
|
}
|
|
2432
2433
|
),
|
|
2433
|
-
/* @__PURE__ */ s("path", { className:
|
|
2434
|
-
!
|
|
2434
|
+
/* @__PURE__ */ s("path", { className: M.linePath, d: Rt(D, c), stroke: te.color }),
|
|
2435
|
+
!V && D.map((Q, T) => /* @__PURE__ */ s(
|
|
2435
2436
|
"circle",
|
|
2436
2437
|
{
|
|
2437
|
-
className: m(
|
|
2438
|
+
className: m(M.point, $?.point),
|
|
2438
2439
|
cx: Q.x,
|
|
2439
2440
|
cy: Q.y,
|
|
2440
|
-
r:
|
|
2441
|
-
fill:
|
|
2441
|
+
r: S === T ? 5 : 3,
|
|
2442
|
+
fill: te.color
|
|
2442
2443
|
},
|
|
2443
|
-
`${
|
|
2444
|
+
`${g}-${T}`
|
|
2444
2445
|
))
|
|
2445
|
-
] },
|
|
2446
|
+
] }, g);
|
|
2446
2447
|
}),
|
|
2447
|
-
|
|
2448
|
+
S !== null && /* @__PURE__ */ s(
|
|
2448
2449
|
"line",
|
|
2449
2450
|
{
|
|
2450
|
-
className:
|
|
2451
|
-
x1:
|
|
2452
|
-
x2:
|
|
2451
|
+
className: M.cursorLine,
|
|
2452
|
+
x1: k(ee[S]),
|
|
2453
|
+
x2: k(ee[S]),
|
|
2453
2454
|
y1: B,
|
|
2454
2455
|
y2: _
|
|
2455
2456
|
}
|
|
@@ -2457,16 +2458,16 @@ function Fl({
|
|
|
2457
2458
|
/* @__PURE__ */ s(
|
|
2458
2459
|
"rect",
|
|
2459
2460
|
{
|
|
2460
|
-
className:
|
|
2461
|
-
x:
|
|
2461
|
+
className: M.interactionLayer,
|
|
2462
|
+
x: y,
|
|
2462
2463
|
y: B,
|
|
2463
|
-
width:
|
|
2464
|
-
height:
|
|
2465
|
-
onMouseMove: (
|
|
2466
|
-
const x =
|
|
2467
|
-
|
|
2464
|
+
width: q,
|
|
2465
|
+
height: U,
|
|
2466
|
+
onMouseMove: (g) => {
|
|
2467
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + y, D = k.step(), Y = Math.max(0, Math.min(e.length - 1, Math.round((te - y - D / 2) / D)));
|
|
2468
|
+
re(Y);
|
|
2468
2469
|
},
|
|
2469
|
-
onMouseLeave: () =>
|
|
2470
|
+
onMouseLeave: () => re(null)
|
|
2470
2471
|
}
|
|
2471
2472
|
)
|
|
2472
2473
|
] });
|
|
@@ -2506,177 +2507,177 @@ function zl({
|
|
|
2506
2507
|
showGrid: u = !0,
|
|
2507
2508
|
showLegend: d = !0,
|
|
2508
2509
|
showTooltip: f = !0,
|
|
2509
|
-
showValues:
|
|
2510
|
+
showValues: p = !1,
|
|
2510
2511
|
valuePosition: L = "outside",
|
|
2511
|
-
renderLabel:
|
|
2512
|
-
colorBy:
|
|
2513
|
-
colors:
|
|
2514
|
-
negativeColor:
|
|
2515
|
-
activeIndex:
|
|
2516
|
-
onBarClick:
|
|
2517
|
-
yTickCount:
|
|
2512
|
+
renderLabel: b,
|
|
2513
|
+
colorBy: R = "series",
|
|
2514
|
+
colors: w = jc,
|
|
2515
|
+
negativeColor: J,
|
|
2516
|
+
activeIndex: W,
|
|
2517
|
+
onBarClick: E,
|
|
2518
|
+
yTickCount: Z = 5,
|
|
2518
2519
|
yFormat: C,
|
|
2519
2520
|
xFormat: $,
|
|
2520
|
-
valueFormat:
|
|
2521
|
-
renderTooltip:
|
|
2522
|
-
margin:
|
|
2521
|
+
valueFormat: ie,
|
|
2522
|
+
renderTooltip: ne,
|
|
2523
|
+
margin: V,
|
|
2523
2524
|
emptyMessage: ae = "No data",
|
|
2524
|
-
className:
|
|
2525
|
-
style:
|
|
2526
|
-
classes:
|
|
2525
|
+
className: S,
|
|
2526
|
+
style: re,
|
|
2527
|
+
classes: F
|
|
2527
2528
|
}) {
|
|
2528
|
-
const
|
|
2529
|
+
const X = r === "horizontal", A = { ...X ? _c : Xc, ...V }, z = ke(() => Object.keys(n), [n]), ce = o && z.length > 1, [me, K] = Le(null), H = oe(null);
|
|
2529
2530
|
if (e.length === 0)
|
|
2530
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2531
|
-
const
|
|
2532
|
-
if (
|
|
2533
|
-
let
|
|
2531
|
+
return /* @__PURE__ */ s("div", { ref: H, className: m(M.root, F?.root, S), style: re, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: ae }) }) });
|
|
2532
|
+
const N = e.map((k) => String(k[t])), y = W ?? me, v = ke(() => {
|
|
2533
|
+
if (ce) {
|
|
2534
|
+
let le = 0, ge = 0;
|
|
2534
2535
|
for (const be of e) {
|
|
2535
|
-
let Ce = 0,
|
|
2536
|
-
for (const
|
|
2537
|
-
const x = be[
|
|
2538
|
-
typeof x == "number" && (x >= 0 ? Ce += x :
|
|
2536
|
+
let Ce = 0, Re = 0;
|
|
2537
|
+
for (const g of z) {
|
|
2538
|
+
const x = be[g];
|
|
2539
|
+
typeof x == "number" && (x >= 0 ? Ce += x : Re += x);
|
|
2539
2540
|
}
|
|
2540
|
-
Ce >
|
|
2541
|
+
Ce > le && (le = Ce), Re < ge && (ge = Re);
|
|
2541
2542
|
}
|
|
2542
|
-
return [
|
|
2543
|
+
return [ge, le];
|
|
2543
2544
|
}
|
|
2544
|
-
const
|
|
2545
|
-
for (const
|
|
2546
|
-
for (const
|
|
2547
|
-
const be =
|
|
2548
|
-
typeof be == "number" &&
|
|
2545
|
+
const k = [];
|
|
2546
|
+
for (const le of e)
|
|
2547
|
+
for (const ge of z) {
|
|
2548
|
+
const be = le[ge];
|
|
2549
|
+
typeof be == "number" && k.push(be);
|
|
2549
2550
|
}
|
|
2550
|
-
const [
|
|
2551
|
-
return [Math.min(0,
|
|
2552
|
-
}, [e,
|
|
2551
|
+
const [G, O] = bt(k);
|
|
2552
|
+
return [Math.min(0, G), Math.max(0, O)];
|
|
2553
|
+
}, [e, z, ce]), B = qe(v[0], v[1], Z), _ = B[0], q = B[B.length - 1], U = (k, G) => R === "index" ? w[G % w.length] : n[k]?.color ?? w[0], ee = f && y !== null && e[y] ? /* @__PURE__ */ s(
|
|
2553
2554
|
et,
|
|
2554
2555
|
{
|
|
2555
|
-
row: e[
|
|
2556
|
-
x: Vc(e, t, A,
|
|
2557
|
-
y:
|
|
2558
|
-
containerWidth:
|
|
2556
|
+
row: e[y],
|
|
2557
|
+
x: Vc(e, t, A, y, H, X, l),
|
|
2558
|
+
y: X ? qc(e, t, A, y, H, l) : 16,
|
|
2559
|
+
containerWidth: H.current?.getBoundingClientRect().width ?? 0,
|
|
2559
2560
|
config: n,
|
|
2560
|
-
render:
|
|
2561
|
-
valueFormat:
|
|
2561
|
+
render: ne ? () => ne(e[y]) : void 0,
|
|
2562
|
+
valueFormat: ie,
|
|
2562
2563
|
titleKey: t,
|
|
2563
|
-
resolveColor: (
|
|
2564
|
-
const
|
|
2565
|
-
return typeof
|
|
2564
|
+
resolveColor: (k) => {
|
|
2565
|
+
const G = e[y][k], O = U(k, y);
|
|
2566
|
+
return typeof G != "number" ? O : J !== void 0 && G < 0 ? J : O;
|
|
2566
2567
|
},
|
|
2567
|
-
classes:
|
|
2568
|
+
classes: F
|
|
2568
2569
|
}
|
|
2569
2570
|
) : null;
|
|
2570
2571
|
return /* @__PURE__ */ s(
|
|
2571
2572
|
Ve,
|
|
2572
2573
|
{
|
|
2573
|
-
ref:
|
|
2574
|
+
ref: H,
|
|
2574
2575
|
aspectRatio: c,
|
|
2575
2576
|
height: i,
|
|
2576
|
-
className:
|
|
2577
|
-
style:
|
|
2578
|
-
classes:
|
|
2579
|
-
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes:
|
|
2580
|
-
overlay:
|
|
2581
|
-
children: ({ width:
|
|
2582
|
-
const
|
|
2583
|
-
value:
|
|
2584
|
-
pos:
|
|
2585
|
-
})),
|
|
2586
|
-
return /* @__PURE__ */
|
|
2587
|
-
u && /* @__PURE__ */ s("g", { className: m(
|
|
2588
|
-
({ value:
|
|
2577
|
+
className: S,
|
|
2578
|
+
style: re,
|
|
2579
|
+
classes: F,
|
|
2580
|
+
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
|
|
2581
|
+
overlay: ee,
|
|
2582
|
+
children: ({ width: k, height: G }) => {
|
|
2583
|
+
const O = A.left, le = k - A.right, ge = A.top, be = G - A.bottom, Ce = Math.max(0, le - O), Re = Math.max(0, be - ge), x = Xe(N, X ? [ge, be] : [O, le], l), te = x.bandWidth(), Y = Je([_, q], X ? [O, le] : [be, ge]), I = Y(0), fe = ce ? 1 : Math.max(1, z.length), Q = te / fe, T = Q * (1 - a), de = B.map((se) => ({
|
|
2584
|
+
value: se,
|
|
2585
|
+
pos: Y(se)
|
|
2586
|
+
})), ye = Uc(N);
|
|
2587
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2588
|
+
u && /* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: de.map(
|
|
2589
|
+
({ value: se, pos: he }) => X ? /* @__PURE__ */ s(
|
|
2589
2590
|
"line",
|
|
2590
2591
|
{
|
|
2591
|
-
className: m(
|
|
2592
|
-
x1:
|
|
2593
|
-
x2:
|
|
2594
|
-
y1:
|
|
2592
|
+
className: m(M.gridLine, F?.grid),
|
|
2593
|
+
x1: he,
|
|
2594
|
+
x2: he,
|
|
2595
|
+
y1: ge,
|
|
2595
2596
|
y2: be
|
|
2596
2597
|
},
|
|
2597
|
-
`g-${
|
|
2598
|
+
`g-${se}`
|
|
2598
2599
|
) : /* @__PURE__ */ s(
|
|
2599
2600
|
"line",
|
|
2600
2601
|
{
|
|
2601
|
-
className: m(
|
|
2602
|
-
x1:
|
|
2603
|
-
x2:
|
|
2604
|
-
y1:
|
|
2605
|
-
y2:
|
|
2602
|
+
className: m(M.gridLine, F?.grid),
|
|
2603
|
+
x1: O,
|
|
2604
|
+
x2: le,
|
|
2605
|
+
y1: he,
|
|
2606
|
+
y2: he
|
|
2606
2607
|
},
|
|
2607
|
-
`g-${
|
|
2608
|
+
`g-${se}`
|
|
2608
2609
|
)
|
|
2609
2610
|
) }),
|
|
2610
|
-
/* @__PURE__ */ s("g", { className: m(
|
|
2611
|
-
const Ae = C ? C(
|
|
2612
|
-
return
|
|
2611
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: de.map(({ value: se, pos: he }) => {
|
|
2612
|
+
const Ae = C ? C(se) : String(se);
|
|
2613
|
+
return X ? /* @__PURE__ */ s(
|
|
2613
2614
|
"text",
|
|
2614
2615
|
{
|
|
2615
|
-
className: m(
|
|
2616
|
-
x:
|
|
2616
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2617
|
+
x: he,
|
|
2617
2618
|
y: be + 16,
|
|
2618
2619
|
textAnchor: "middle",
|
|
2619
2620
|
children: Ae
|
|
2620
2621
|
},
|
|
2621
|
-
`vt-${
|
|
2622
|
+
`vt-${se}`
|
|
2622
2623
|
) : /* @__PURE__ */ s(
|
|
2623
2624
|
"text",
|
|
2624
2625
|
{
|
|
2625
|
-
className: m(
|
|
2626
|
-
x:
|
|
2627
|
-
y:
|
|
2626
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2627
|
+
x: O - 8,
|
|
2628
|
+
y: he,
|
|
2628
2629
|
textAnchor: "end",
|
|
2629
2630
|
dominantBaseline: "middle",
|
|
2630
2631
|
children: Ae
|
|
2631
2632
|
},
|
|
2632
|
-
`vt-${
|
|
2633
|
+
`vt-${se}`
|
|
2633
2634
|
);
|
|
2634
2635
|
}) }),
|
|
2635
|
-
/* @__PURE__ */ s("g", { className: m(
|
|
2636
|
-
const
|
|
2637
|
-
return
|
|
2636
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: ye.map((se) => {
|
|
2637
|
+
const he = x(se), Ae = $ ? $(se) : se;
|
|
2638
|
+
return X ? /* @__PURE__ */ s(
|
|
2638
2639
|
"text",
|
|
2639
2640
|
{
|
|
2640
|
-
className: m(
|
|
2641
|
-
x:
|
|
2642
|
-
y:
|
|
2641
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2642
|
+
x: O - 8,
|
|
2643
|
+
y: he,
|
|
2643
2644
|
textAnchor: "end",
|
|
2644
2645
|
dominantBaseline: "middle",
|
|
2645
2646
|
children: Ae
|
|
2646
2647
|
},
|
|
2647
|
-
`c-${
|
|
2648
|
+
`c-${se}`
|
|
2648
2649
|
) : /* @__PURE__ */ s(
|
|
2649
2650
|
"text",
|
|
2650
2651
|
{
|
|
2651
|
-
className: m(
|
|
2652
|
-
x:
|
|
2652
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2653
|
+
x: he,
|
|
2653
2654
|
y: be + 16,
|
|
2654
2655
|
textAnchor: "middle",
|
|
2655
2656
|
children: Ae
|
|
2656
2657
|
},
|
|
2657
|
-
`c-${
|
|
2658
|
+
`c-${se}`
|
|
2658
2659
|
);
|
|
2659
2660
|
}) }),
|
|
2660
|
-
e.map((
|
|
2661
|
-
const De = x(
|
|
2662
|
-
let xe = 0,
|
|
2663
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
2664
|
-
const Ge =
|
|
2661
|
+
e.map((se, he) => {
|
|
2662
|
+
const De = x(N[he]) - te / 2;
|
|
2663
|
+
let xe = 0, ue = 0;
|
|
2664
|
+
return /* @__PURE__ */ s("g", { className: m(M.series, F?.series), children: z.map((Ie, He) => {
|
|
2665
|
+
const Ge = se[Ie];
|
|
2665
2666
|
if (typeof Ge != "number") return null;
|
|
2666
|
-
const Ee = Ge, xt =
|
|
2667
|
+
const Ee = Ge, xt = U(Ie, he), kt = J !== void 0 && Ee < 0 ? J : xt, Oe = W !== void 0 ? W === he : me === he, tt = W !== void 0 && !Oe;
|
|
2667
2668
|
let nt, _e;
|
|
2668
|
-
|
|
2669
|
-
const rt =
|
|
2669
|
+
ce ? Ee >= 0 ? (nt = xe, _e = xe + Ee, xe = _e) : (nt = ue, _e = ue + Ee, ue = _e) : (nt = 0, _e = Ee);
|
|
2670
|
+
const rt = Y(nt), ot = Y(_e), Bt = ce ? (te - T) / 2 : He * Q + (Q - T) / 2;
|
|
2670
2671
|
let it = 0, ct = 0, lt = 0, st = 0;
|
|
2671
|
-
if (
|
|
2672
|
+
if (X) {
|
|
2672
2673
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2673
2674
|
it = Ze, lt = wt - Ze, ct = De + Bt, st = T;
|
|
2674
2675
|
} else {
|
|
2675
2676
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2676
2677
|
it = De + Bt, lt = T, ct = Ze, st = wt - Ze;
|
|
2677
2678
|
}
|
|
2678
|
-
const Mt =
|
|
2679
|
-
isHorizontal:
|
|
2679
|
+
const Mt = b ? b({ row: se, value: Ee, seriesKey: Ie, index: he }) : p ? ie ? ie(Ee) : String(Ee) : null, Fe = Yc({
|
|
2680
|
+
isHorizontal: X,
|
|
2680
2681
|
valuePosition: L,
|
|
2681
2682
|
x: it,
|
|
2682
2683
|
y: ct,
|
|
@@ -2684,14 +2685,14 @@ function zl({
|
|
|
2684
2685
|
rectH: st,
|
|
2685
2686
|
value: Ee
|
|
2686
2687
|
});
|
|
2687
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ j("g", { children: [
|
|
2688
2689
|
/* @__PURE__ */ s(
|
|
2689
2690
|
"rect",
|
|
2690
2691
|
{
|
|
2691
2692
|
className: m(
|
|
2692
|
-
|
|
2693
|
-
Oe &&
|
|
2694
|
-
|
|
2693
|
+
M.bar,
|
|
2694
|
+
Oe && M.activeBar,
|
|
2695
|
+
F?.point
|
|
2695
2696
|
),
|
|
2696
2697
|
x: it,
|
|
2697
2698
|
y: ct,
|
|
@@ -2701,16 +2702,16 @@ function zl({
|
|
|
2701
2702
|
ry: h,
|
|
2702
2703
|
fill: kt,
|
|
2703
2704
|
opacity: tt ? 0.35 : 1,
|
|
2704
|
-
onClick:
|
|
2705
|
-
style:
|
|
2705
|
+
onClick: E ? () => E({ row: se, value: Ee, seriesKey: Ie, index: he }) : void 0,
|
|
2706
|
+
style: E ? { cursor: "pointer" } : void 0
|
|
2706
2707
|
}
|
|
2707
2708
|
),
|
|
2708
2709
|
Mt != null && /* @__PURE__ */ s(
|
|
2709
2710
|
"text",
|
|
2710
2711
|
{
|
|
2711
2712
|
className: m(
|
|
2712
|
-
|
|
2713
|
-
(L === "inside" || L === "inside-start") &&
|
|
2713
|
+
M.axisLabel,
|
|
2714
|
+
(L === "inside" || L === "inside-start") && M.barLabelInside
|
|
2714
2715
|
),
|
|
2715
2716
|
x: Fe.x,
|
|
2716
2717
|
y: Fe.y,
|
|
@@ -2722,31 +2723,31 @@ function zl({
|
|
|
2722
2723
|
}
|
|
2723
2724
|
)
|
|
2724
2725
|
] }, Ie);
|
|
2725
|
-
}) }, `group-${
|
|
2726
|
+
}) }, `group-${he}`);
|
|
2726
2727
|
}),
|
|
2727
|
-
_ < 0 &&
|
|
2728
|
+
_ < 0 && q > 0 && /* @__PURE__ */ s(
|
|
2728
2729
|
"line",
|
|
2729
2730
|
{
|
|
2730
|
-
className: m(
|
|
2731
|
-
x1:
|
|
2732
|
-
x2:
|
|
2733
|
-
y1:
|
|
2734
|
-
y2:
|
|
2731
|
+
className: m(M.gridLine),
|
|
2732
|
+
x1: X ? I : O,
|
|
2733
|
+
x2: X ? I : le,
|
|
2734
|
+
y1: X ? ge : I,
|
|
2735
|
+
y2: X ? be : I,
|
|
2735
2736
|
opacity: 0.9
|
|
2736
2737
|
}
|
|
2737
2738
|
),
|
|
2738
2739
|
/* @__PURE__ */ s(
|
|
2739
2740
|
"rect",
|
|
2740
2741
|
{
|
|
2741
|
-
className:
|
|
2742
|
-
x:
|
|
2743
|
-
y:
|
|
2742
|
+
className: M.interactionLayer,
|
|
2743
|
+
x: O,
|
|
2744
|
+
y: ge,
|
|
2744
2745
|
width: Ce,
|
|
2745
|
-
height:
|
|
2746
|
-
onMouseMove: (
|
|
2747
|
-
const
|
|
2746
|
+
height: Re,
|
|
2747
|
+
onMouseMove: (se) => {
|
|
2748
|
+
const he = se.currentTarget.getBoundingClientRect(), Ae = se.clientX - he.left + O, De = se.clientY - he.top + ge, xe = x.step(), ue = X ? De - ge : Ae - O, Ie = Math.max(
|
|
2748
2749
|
0,
|
|
2749
|
-
Math.min(e.length - 1, Math.round((
|
|
2750
|
+
Math.min(e.length - 1, Math.round((ue - xe / 2) / xe))
|
|
2750
2751
|
);
|
|
2751
2752
|
K(Ie);
|
|
2752
2753
|
},
|
|
@@ -2852,12 +2853,12 @@ function Zc(e, t, n, r, o, c) {
|
|
|
2852
2853
|
].join(" ");
|
|
2853
2854
|
const i = (o - 90) * Math.PI / 180, l = (c - 90) * Math.PI / 180, a = c - o > 180 ? 1 : 0, h = e + n * Math.cos(i), u = t + n * Math.sin(i), d = e + n * Math.cos(l), f = t + n * Math.sin(l);
|
|
2854
2855
|
if (r > 0) {
|
|
2855
|
-
const
|
|
2856
|
+
const p = e + r * Math.cos(l), L = t + r * Math.sin(l), b = e + r * Math.cos(i), R = t + r * Math.sin(i);
|
|
2856
2857
|
return [
|
|
2857
2858
|
`M ${h} ${u}`,
|
|
2858
2859
|
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2859
|
-
`L ${
|
|
2860
|
-
`A ${r} ${r} 0 ${a} 0 ${
|
|
2860
|
+
`L ${p} ${L}`,
|
|
2861
|
+
`A ${r} ${r} 0 ${a} 0 ${b} ${R}`,
|
|
2861
2862
|
"Z"
|
|
2862
2863
|
].join(" ");
|
|
2863
2864
|
}
|
|
@@ -2886,121 +2887,121 @@ function jl({
|
|
|
2886
2887
|
strokeColor: u = "var(--crk-color-bg)",
|
|
2887
2888
|
padAngle: d = 0,
|
|
2888
2889
|
showLabels: f = !1,
|
|
2889
|
-
valuePosition:
|
|
2890
|
+
valuePosition: p = "outside",
|
|
2890
2891
|
showLabelLines: L = !0,
|
|
2891
|
-
renderLabel:
|
|
2892
|
-
centerLabel:
|
|
2893
|
-
activeIndex:
|
|
2894
|
-
onSliceClick:
|
|
2895
|
-
showLegend:
|
|
2896
|
-
showTooltip:
|
|
2897
|
-
valueFormat:
|
|
2892
|
+
renderLabel: b,
|
|
2893
|
+
centerLabel: R,
|
|
2894
|
+
activeIndex: w,
|
|
2895
|
+
onSliceClick: J,
|
|
2896
|
+
showLegend: W = !0,
|
|
2897
|
+
showTooltip: E = !0,
|
|
2898
|
+
valueFormat: Z,
|
|
2898
2899
|
renderTooltip: C,
|
|
2899
2900
|
emptyMessage: $ = "No data",
|
|
2900
|
-
className:
|
|
2901
|
-
style:
|
|
2902
|
-
classes:
|
|
2901
|
+
className: ie,
|
|
2902
|
+
style: ne,
|
|
2903
|
+
classes: V
|
|
2903
2904
|
}) {
|
|
2904
|
-
const [ae,
|
|
2905
|
+
const [ae, S] = Le(null), re = oe(null), F = w ?? ae, X = (K) => {
|
|
2905
2906
|
if (r) {
|
|
2906
|
-
const
|
|
2907
|
-
if (typeof
|
|
2907
|
+
const H = e[K]?.[r];
|
|
2908
|
+
if (typeof H == "string") return H;
|
|
2908
2909
|
}
|
|
2909
2910
|
return o[K % o.length];
|
|
2910
2911
|
}, A = ke(() => {
|
|
2911
2912
|
let K = 0;
|
|
2912
|
-
for (const
|
|
2913
|
-
const
|
|
2914
|
-
typeof
|
|
2913
|
+
for (const H of e) {
|
|
2914
|
+
const N = H[t];
|
|
2915
|
+
typeof N == "number" && N > 0 && (K += N);
|
|
2915
2916
|
}
|
|
2916
2917
|
return K;
|
|
2917
2918
|
}, [e, t]);
|
|
2918
2919
|
if (e.length === 0 || A === 0)
|
|
2919
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2920
|
-
const
|
|
2920
|
+
return /* @__PURE__ */ s("div", { ref: re, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2921
|
+
const z = ke(() => {
|
|
2921
2922
|
const K = [];
|
|
2922
|
-
let
|
|
2923
|
-
for (let
|
|
2924
|
-
const
|
|
2923
|
+
let H = 0;
|
|
2924
|
+
for (let N = 0; N < e.length; N++) {
|
|
2925
|
+
const y = e[N], v = y[t], B = typeof v == "number" && v > 0 ? v : 0;
|
|
2925
2926
|
if (B === 0) continue;
|
|
2926
|
-
const _ = B / A,
|
|
2927
|
-
K.push({ index:
|
|
2927
|
+
const _ = B / A, q = _ * 360;
|
|
2928
|
+
K.push({ index: N, row: y, value: B, start: H, end: H + q, fraction: _ }), H += q;
|
|
2928
2929
|
}
|
|
2929
2930
|
return K;
|
|
2930
|
-
}, [e, t, A]),
|
|
2931
|
+
}, [e, t, A]), ce = W ? /* @__PURE__ */ s("div", { className: m(M.legend, V?.legend), role: "list", children: z.map((K) => /* @__PURE__ */ j("div", { className: m(M.legendItem, V?.legendItem), role: "listitem", children: [
|
|
2931
2932
|
/* @__PURE__ */ s(
|
|
2932
2933
|
"span",
|
|
2933
2934
|
{
|
|
2934
|
-
className:
|
|
2935
|
-
style: { background:
|
|
2935
|
+
className: M.legendSwatch,
|
|
2936
|
+
style: { background: X(K.index) },
|
|
2936
2937
|
"aria-hidden": "true"
|
|
2937
2938
|
}
|
|
2938
2939
|
),
|
|
2939
|
-
/* @__PURE__ */ s("span", { className:
|
|
2940
|
-
] }, K.index)) }) : void 0,
|
|
2940
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: String(K.row[n]) })
|
|
2941
|
+
] }, K.index)) }) : void 0, me = ke(() => {
|
|
2941
2942
|
const K = {};
|
|
2942
|
-
for (const
|
|
2943
|
-
K[
|
|
2944
|
-
label: String(
|
|
2945
|
-
color:
|
|
2943
|
+
for (const H of z)
|
|
2944
|
+
K[H.index.toString()] = {
|
|
2945
|
+
label: String(H.row[n]),
|
|
2946
|
+
color: X(H.index)
|
|
2946
2947
|
};
|
|
2947
2948
|
return K;
|
|
2948
|
-
}, [
|
|
2949
|
+
}, [z]);
|
|
2949
2950
|
return /* @__PURE__ */ s(
|
|
2950
2951
|
Ve,
|
|
2951
2952
|
{
|
|
2952
|
-
ref:
|
|
2953
|
+
ref: re,
|
|
2953
2954
|
aspectRatio: c,
|
|
2954
2955
|
height: i,
|
|
2955
|
-
className:
|
|
2956
|
-
style:
|
|
2957
|
-
classes:
|
|
2958
|
-
legend:
|
|
2959
|
-
overlay:
|
|
2956
|
+
className: ie,
|
|
2957
|
+
style: ne,
|
|
2958
|
+
classes: V,
|
|
2959
|
+
legend: ce,
|
|
2960
|
+
overlay: E && F !== null && e[F] ? /* @__PURE__ */ s(
|
|
2960
2961
|
et,
|
|
2961
2962
|
{
|
|
2962
|
-
row: { [
|
|
2963
|
-
x:
|
|
2963
|
+
row: { [F.toString()]: e[F][t] },
|
|
2964
|
+
x: re.current ? re.current.getBoundingClientRect().width / 2 : 0,
|
|
2964
2965
|
y: 16,
|
|
2965
|
-
containerWidth:
|
|
2966
|
-
config: { [
|
|
2967
|
-
render: C ? () => C(e[
|
|
2968
|
-
valueFormat:
|
|
2966
|
+
containerWidth: re.current?.getBoundingClientRect().width ?? 0,
|
|
2967
|
+
config: { [F.toString()]: me[F.toString()] },
|
|
2968
|
+
render: C ? () => C(e[F]) : void 0,
|
|
2969
|
+
valueFormat: Z,
|
|
2969
2970
|
titleKey: void 0,
|
|
2970
|
-
classes:
|
|
2971
|
+
classes: V
|
|
2971
2972
|
}
|
|
2972
2973
|
) : null,
|
|
2973
|
-
children: ({ width: K, height:
|
|
2974
|
-
const
|
|
2975
|
-
return /* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */ s("g", { children:
|
|
2977
|
-
const
|
|
2974
|
+
children: ({ width: K, height: H }) => {
|
|
2975
|
+
const N = K / 2, y = H / 2, v = Math.min(K, H) / 2 - 4, B = Et(a, v), _ = Math.min(B - 1, Et(l, v)), q = Math.max(4, B * 0.06);
|
|
2976
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2977
|
+
/* @__PURE__ */ s("g", { children: z.map((U) => {
|
|
2978
|
+
const ee = d / 2, k = Math.min(U.end, U.start + ee), G = Math.max(U.start, U.end - ee), O = X(U.index), le = F === U.index, ge = w !== void 0 && !le, be = le && w !== void 0 ? B + q : B, Ce = Zc(N, y, be, _, k, G), Re = J ? () => J({ row: U.row, value: U.value, index: U.index }) : void 0;
|
|
2978
2979
|
return /* @__PURE__ */ s(
|
|
2979
2980
|
"path",
|
|
2980
2981
|
{
|
|
2981
2982
|
d: Ce,
|
|
2982
|
-
fill:
|
|
2983
|
+
fill: O,
|
|
2983
2984
|
stroke: h > 0 ? u : "none",
|
|
2984
2985
|
strokeWidth: h,
|
|
2985
|
-
opacity:
|
|
2986
|
-
onMouseEnter: () =>
|
|
2987
|
-
onMouseLeave: () =>
|
|
2988
|
-
onClick:
|
|
2989
|
-
style:
|
|
2986
|
+
opacity: ge ? 0.45 : 1,
|
|
2987
|
+
onMouseEnter: () => S(U.index),
|
|
2988
|
+
onMouseLeave: () => S(null),
|
|
2989
|
+
onClick: Re,
|
|
2990
|
+
style: Re ? { cursor: "pointer" } : void 0
|
|
2990
2991
|
},
|
|
2991
|
-
|
|
2992
|
+
U.index
|
|
2992
2993
|
);
|
|
2993
2994
|
}) }),
|
|
2994
|
-
(f ||
|
|
2995
|
-
const
|
|
2996
|
-
if (
|
|
2997
|
-
const
|
|
2995
|
+
(f || b) && z.map((U) => {
|
|
2996
|
+
const ee = b ? b({ row: U.row, value: U.value, fraction: U.fraction, index: U.index }) : f ? `${String(U.row[n])} ${Z ? Z(U.value) : Math.round(U.fraction * 100) + "%"}` : null;
|
|
2997
|
+
if (ee == null) return null;
|
|
2998
|
+
const k = p === "inside", G = Math.max(16, B * 0.12), O = k ? (B + _) / 2 : B + G, le = Pt(N, y, O, U.start, U.end), ge = k ? "middle" : le.x < N - 1 ? "end" : le.x > N + 1 ? "start" : "middle";
|
|
2998
2999
|
let be = null;
|
|
2999
|
-
if (!
|
|
3000
|
-
const Ce = Pt(
|
|
3001
|
-
be = { x1: Ce.x, y1: Ce.y, x2:
|
|
3000
|
+
if (!k && L) {
|
|
3001
|
+
const Ce = Pt(N, y, B, U.start, U.end), Re = 4, g = ge === "end" ? Re : ge === "start" ? -Re : 0;
|
|
3002
|
+
be = { x1: Ce.x, y1: Ce.y, x2: le.x + g, y2: le.y };
|
|
3002
3003
|
}
|
|
3003
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ j("g", { children: [
|
|
3004
3005
|
be && /* @__PURE__ */ s(
|
|
3005
3006
|
"line",
|
|
3006
3007
|
{
|
|
@@ -3008,7 +3009,7 @@ function jl({
|
|
|
3008
3009
|
y1: be.y1,
|
|
3009
3010
|
x2: be.x2,
|
|
3010
3011
|
y2: be.y2,
|
|
3011
|
-
stroke:
|
|
3012
|
+
stroke: X(U.index),
|
|
3012
3013
|
strokeWidth: 1,
|
|
3013
3014
|
opacity: 0.7
|
|
3014
3015
|
}
|
|
@@ -3016,24 +3017,24 @@ function jl({
|
|
|
3016
3017
|
/* @__PURE__ */ s(
|
|
3017
3018
|
"text",
|
|
3018
3019
|
{
|
|
3019
|
-
x:
|
|
3020
|
-
y:
|
|
3020
|
+
x: le.x,
|
|
3021
|
+
y: le.y,
|
|
3021
3022
|
className: m(
|
|
3022
|
-
|
|
3023
|
-
|
|
3023
|
+
M.axisLabel,
|
|
3024
|
+
k && M.barLabelInside
|
|
3024
3025
|
),
|
|
3025
|
-
textAnchor:
|
|
3026
|
+
textAnchor: ge,
|
|
3026
3027
|
dominantBaseline: "middle",
|
|
3027
|
-
children:
|
|
3028
|
+
children: ee
|
|
3028
3029
|
}
|
|
3029
3030
|
)
|
|
3030
|
-
] }, `label-${
|
|
3031
|
+
] }, `label-${U.index}`);
|
|
3031
3032
|
}),
|
|
3032
|
-
|
|
3033
|
+
R !== void 0 && /* @__PURE__ */ s(
|
|
3033
3034
|
"foreignObject",
|
|
3034
3035
|
{
|
|
3035
|
-
x:
|
|
3036
|
-
y:
|
|
3036
|
+
x: N - _,
|
|
3037
|
+
y: y - _,
|
|
3037
3038
|
width: Math.max(0, _ * 2),
|
|
3038
3039
|
height: Math.max(0, _ * 2),
|
|
3039
3040
|
style: { pointerEvents: "none" },
|
|
@@ -3051,7 +3052,7 @@ function jl({
|
|
|
3051
3052
|
color: "var(--crk-color-text)",
|
|
3052
3053
|
fontFamily: "var(--crk-font-family)"
|
|
3053
3054
|
},
|
|
3054
|
-
children:
|
|
3055
|
+
children: R
|
|
3055
3056
|
}
|
|
3056
3057
|
)
|
|
3057
3058
|
}
|
|
@@ -3085,185 +3086,185 @@ function Xl({
|
|
|
3085
3086
|
levels: u = 5,
|
|
3086
3087
|
showPoints: d = !0,
|
|
3087
3088
|
fillOpacity: f = 0.4,
|
|
3088
|
-
strokeWidth:
|
|
3089
|
+
strokeWidth: p = 2,
|
|
3089
3090
|
renderAxisLabel: L,
|
|
3090
|
-
axisFormat:
|
|
3091
|
-
valueFormat:
|
|
3092
|
-
renderTooltip:
|
|
3093
|
-
showLegend:
|
|
3094
|
-
showTooltip:
|
|
3095
|
-
emptyMessage:
|
|
3096
|
-
className:
|
|
3091
|
+
axisFormat: b,
|
|
3092
|
+
valueFormat: R,
|
|
3093
|
+
renderTooltip: w,
|
|
3094
|
+
showLegend: J = !0,
|
|
3095
|
+
showTooltip: W = !0,
|
|
3096
|
+
emptyMessage: E = "No data",
|
|
3097
|
+
className: Z,
|
|
3097
3098
|
style: C,
|
|
3098
3099
|
classes: $
|
|
3099
3100
|
}) {
|
|
3100
|
-
const [
|
|
3101
|
+
const [ie, ne] = Le(null), V = oe(null), ae = ke(() => Object.keys(n), [n]);
|
|
3101
3102
|
if (e.length === 0)
|
|
3102
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
3103
|
-
const
|
|
3104
|
-
() => e.map((A,
|
|
3103
|
+
return /* @__PURE__ */ s("div", { ref: V, className: m(M.root, $?.root, Z), style: C, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: E }) }) });
|
|
3104
|
+
const S = ke(
|
|
3105
|
+
() => e.map((A, z) => z / e.length * 360),
|
|
3105
3106
|
[e]
|
|
3106
|
-
),
|
|
3107
|
+
), re = ke(() => {
|
|
3107
3108
|
const A = [];
|
|
3108
|
-
for (const
|
|
3109
|
-
for (const
|
|
3110
|
-
const K =
|
|
3109
|
+
for (const ce of ae)
|
|
3110
|
+
for (const me of e) {
|
|
3111
|
+
const K = me[ce];
|
|
3111
3112
|
typeof K == "number" && A.push(K);
|
|
3112
3113
|
}
|
|
3113
|
-
const [,
|
|
3114
|
-
return Math.max(1,
|
|
3115
|
-
}, [e, ae]),
|
|
3114
|
+
const [, z] = bt(A);
|
|
3115
|
+
return Math.max(1, z);
|
|
3116
|
+
}, [e, ae]), F = ke(() => qe(0, re, u).filter((z) => z > 0), [re, u]), X = F[F.length - 1] ?? re;
|
|
3116
3117
|
return /* @__PURE__ */ s(
|
|
3117
3118
|
Ve,
|
|
3118
3119
|
{
|
|
3119
|
-
ref:
|
|
3120
|
+
ref: V,
|
|
3120
3121
|
aspectRatio: r,
|
|
3121
3122
|
height: o,
|
|
3122
|
-
className:
|
|
3123
|
+
className: Z,
|
|
3123
3124
|
style: C,
|
|
3124
3125
|
classes: $,
|
|
3125
|
-
legend:
|
|
3126
|
-
overlay:
|
|
3126
|
+
legend: J ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
3127
|
+
overlay: W && ie !== null ? /* @__PURE__ */ s(
|
|
3127
3128
|
et,
|
|
3128
3129
|
{
|
|
3129
|
-
row: e[
|
|
3130
|
-
x: (
|
|
3130
|
+
row: e[ie],
|
|
3131
|
+
x: (V.current?.getBoundingClientRect().width ?? 0) / 2,
|
|
3131
3132
|
y: 16,
|
|
3132
|
-
containerWidth:
|
|
3133
|
+
containerWidth: V.current?.getBoundingClientRect().width ?? 0,
|
|
3133
3134
|
config: n,
|
|
3134
|
-
render:
|
|
3135
|
-
valueFormat:
|
|
3135
|
+
render: w ? () => w(e[ie]) : void 0,
|
|
3136
|
+
valueFormat: R,
|
|
3136
3137
|
titleKey: t,
|
|
3137
3138
|
classes: $
|
|
3138
3139
|
}
|
|
3139
3140
|
) : null,
|
|
3140
|
-
children: ({ width: A, height:
|
|
3141
|
-
const
|
|
3142
|
-
return /* @__PURE__ */
|
|
3143
|
-
i &&
|
|
3144
|
-
const
|
|
3141
|
+
children: ({ width: A, height: z }) => {
|
|
3142
|
+
const ce = a ? 32 : 8, me = A / 2, K = z / 2, H = Math.max(0, Math.min(A, z) / 2 - ce), N = (y) => Math.max(0, y) / X * H;
|
|
3143
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
3144
|
+
i && F.map((y) => {
|
|
3145
|
+
const v = N(y);
|
|
3145
3146
|
return c === "circle" ? /* @__PURE__ */ s(
|
|
3146
3147
|
"circle",
|
|
3147
3148
|
{
|
|
3148
|
-
className: m(
|
|
3149
|
-
cx:
|
|
3149
|
+
className: m(M.gridLine, $?.grid),
|
|
3150
|
+
cx: me,
|
|
3150
3151
|
cy: K,
|
|
3151
|
-
r:
|
|
3152
|
+
r: v,
|
|
3152
3153
|
fill: "none"
|
|
3153
3154
|
},
|
|
3154
|
-
`ring-${
|
|
3155
|
+
`ring-${y}`
|
|
3155
3156
|
) : /* @__PURE__ */ s(
|
|
3156
3157
|
"polygon",
|
|
3157
3158
|
{
|
|
3158
|
-
className: m(
|
|
3159
|
-
points: Kc(
|
|
3159
|
+
className: m(M.gridLine, $?.grid),
|
|
3160
|
+
points: Kc(me, K, v, S),
|
|
3160
3161
|
fill: "none"
|
|
3161
3162
|
},
|
|
3162
|
-
`ring-${
|
|
3163
|
+
`ring-${y}`
|
|
3163
3164
|
);
|
|
3164
3165
|
}),
|
|
3165
|
-
l &&
|
|
3166
|
-
const B = mt(
|
|
3166
|
+
l && S.map((y, v) => {
|
|
3167
|
+
const B = mt(me, K, H, y);
|
|
3167
3168
|
return /* @__PURE__ */ s(
|
|
3168
3169
|
"line",
|
|
3169
3170
|
{
|
|
3170
|
-
className: m(
|
|
3171
|
-
x1:
|
|
3171
|
+
className: m(M.gridLine, $?.grid),
|
|
3172
|
+
x1: me,
|
|
3172
3173
|
y1: K,
|
|
3173
3174
|
x2: B.x,
|
|
3174
3175
|
y2: B.y
|
|
3175
3176
|
},
|
|
3176
|
-
`spoke-${
|
|
3177
|
+
`spoke-${v}`
|
|
3177
3178
|
);
|
|
3178
3179
|
}),
|
|
3179
|
-
h &&
|
|
3180
|
-
const
|
|
3180
|
+
h && F.map((y) => {
|
|
3181
|
+
const v = N(y);
|
|
3181
3182
|
return /* @__PURE__ */ s(
|
|
3182
3183
|
"text",
|
|
3183
3184
|
{
|
|
3184
|
-
className: m(
|
|
3185
|
-
x:
|
|
3186
|
-
y: K -
|
|
3185
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3186
|
+
x: me + 4,
|
|
3187
|
+
y: K - v,
|
|
3187
3188
|
textAnchor: "start",
|
|
3188
3189
|
dominantBaseline: "middle",
|
|
3189
|
-
children:
|
|
3190
|
+
children: R ? R(y) : y
|
|
3190
3191
|
},
|
|
3191
|
-
`raxis-${
|
|
3192
|
+
`raxis-${y}`
|
|
3192
3193
|
);
|
|
3193
3194
|
}),
|
|
3194
|
-
a && e.map((
|
|
3195
|
-
const B =
|
|
3195
|
+
a && e.map((y, v) => {
|
|
3196
|
+
const B = S[v], _ = mt(me, K, H + 14, B), q = _.x < me - 1 ? "end" : _.x > me + 1 ? "start" : "middle";
|
|
3196
3197
|
if (L)
|
|
3197
3198
|
return /* @__PURE__ */ s("g", { children: L({
|
|
3198
|
-
row:
|
|
3199
|
-
index:
|
|
3199
|
+
row: y,
|
|
3200
|
+
index: v,
|
|
3200
3201
|
angle: B,
|
|
3201
3202
|
x: _.x,
|
|
3202
3203
|
y: _.y,
|
|
3203
|
-
textAnchor:
|
|
3204
|
-
}) }, `label-${
|
|
3205
|
-
const
|
|
3204
|
+
textAnchor: q
|
|
3205
|
+
}) }, `label-${v}`);
|
|
3206
|
+
const U = String(y[t]), ee = b ? b(U) : U;
|
|
3206
3207
|
return /* @__PURE__ */ s(
|
|
3207
3208
|
"text",
|
|
3208
3209
|
{
|
|
3209
|
-
className: m(
|
|
3210
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3210
3211
|
x: _.x,
|
|
3211
3212
|
y: _.y,
|
|
3212
|
-
textAnchor:
|
|
3213
|
+
textAnchor: q,
|
|
3213
3214
|
dominantBaseline: "middle",
|
|
3214
|
-
children:
|
|
3215
|
+
children: ee
|
|
3215
3216
|
},
|
|
3216
|
-
`label-${
|
|
3217
|
+
`label-${v}`
|
|
3217
3218
|
);
|
|
3218
3219
|
}),
|
|
3219
|
-
ae.map((
|
|
3220
|
-
const
|
|
3221
|
-
const
|
|
3222
|
-
return mt(
|
|
3223
|
-
}), _ = B.map((
|
|
3224
|
-
return /* @__PURE__ */
|
|
3220
|
+
ae.map((y) => {
|
|
3221
|
+
const v = n[y], B = e.map((q, U) => {
|
|
3222
|
+
const ee = q[y], G = N(typeof ee == "number" ? ee : 0);
|
|
3223
|
+
return mt(me, K, G, S[U]);
|
|
3224
|
+
}), _ = B.map((q) => `${q.x},${q.y}`).join(" ");
|
|
3225
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, $?.series), children: [
|
|
3225
3226
|
/* @__PURE__ */ s(
|
|
3226
3227
|
"polygon",
|
|
3227
3228
|
{
|
|
3228
3229
|
points: _,
|
|
3229
|
-
fill:
|
|
3230
|
+
fill: v.color,
|
|
3230
3231
|
fillOpacity: f,
|
|
3231
|
-
stroke:
|
|
3232
|
-
strokeWidth:
|
|
3232
|
+
stroke: v.color,
|
|
3233
|
+
strokeWidth: p,
|
|
3233
3234
|
strokeLinejoin: "round",
|
|
3234
3235
|
strokeLinecap: "round"
|
|
3235
3236
|
}
|
|
3236
3237
|
),
|
|
3237
|
-
d && B.map((
|
|
3238
|
+
d && B.map((q, U) => /* @__PURE__ */ s(
|
|
3238
3239
|
"circle",
|
|
3239
3240
|
{
|
|
3240
|
-
className: m(
|
|
3241
|
-
cx:
|
|
3242
|
-
cy:
|
|
3243
|
-
r:
|
|
3244
|
-
fill:
|
|
3241
|
+
className: m(M.point, $?.point),
|
|
3242
|
+
cx: q.x,
|
|
3243
|
+
cy: q.y,
|
|
3244
|
+
r: ie === U ? 5 : 3.5,
|
|
3245
|
+
fill: v.color
|
|
3245
3246
|
},
|
|
3246
|
-
`${
|
|
3247
|
+
`${y}-${U}`
|
|
3247
3248
|
))
|
|
3248
|
-
] },
|
|
3249
|
+
] }, y);
|
|
3249
3250
|
}),
|
|
3250
3251
|
/* @__PURE__ */ s(
|
|
3251
3252
|
"rect",
|
|
3252
3253
|
{
|
|
3253
|
-
className:
|
|
3254
|
+
className: M.interactionLayer,
|
|
3254
3255
|
x: 0,
|
|
3255
3256
|
y: 0,
|
|
3256
3257
|
width: A,
|
|
3257
|
-
height:
|
|
3258
|
-
onMouseMove: (
|
|
3259
|
-
const
|
|
3258
|
+
height: z,
|
|
3259
|
+
onMouseMove: (y) => {
|
|
3260
|
+
const v = y.currentTarget.getBoundingClientRect(), B = y.clientX - v.left - me, _ = y.clientY - v.top - K;
|
|
3260
3261
|
if (B === 0 && _ === 0) return;
|
|
3261
|
-
let
|
|
3262
|
-
|
|
3263
|
-
const
|
|
3264
|
-
|
|
3262
|
+
let q = Math.atan2(_, B) * 180 / Math.PI + 90;
|
|
3263
|
+
q < 0 && (q += 360), q >= 360 && (q -= 360);
|
|
3264
|
+
const U = 360 / e.length, ee = Math.round(q / U) % e.length;
|
|
3265
|
+
ne(ee);
|
|
3265
3266
|
},
|
|
3266
|
-
onMouseLeave: () =>
|
|
3267
|
+
onMouseLeave: () => ne(null)
|
|
3267
3268
|
}
|
|
3268
3269
|
)
|
|
3269
3270
|
] });
|
|
@@ -3302,8 +3303,8 @@ function el(e, t, n = 2) {
|
|
|
3302
3303
|
const h = a / t;
|
|
3303
3304
|
let u = 0;
|
|
3304
3305
|
for (let f = l - t + 1; f <= l; f++) {
|
|
3305
|
-
const
|
|
3306
|
-
u +=
|
|
3306
|
+
const p = e[f].close - h;
|
|
3307
|
+
u += p * p;
|
|
3307
3308
|
}
|
|
3308
3309
|
u /= t;
|
|
3309
3310
|
const d = Math.sqrt(u);
|
|
@@ -3332,34 +3333,34 @@ function Wt(e, t) {
|
|
|
3332
3333
|
function _l(e) {
|
|
3333
3334
|
return e.map((t) => typeof t.volume == "number" ? t.volume : null);
|
|
3334
3335
|
}
|
|
3335
|
-
const
|
|
3336
|
+
const Se = 86400;
|
|
3336
3337
|
function on(e) {
|
|
3337
3338
|
switch (e) {
|
|
3338
3339
|
case "1D":
|
|
3339
|
-
return
|
|
3340
|
+
return Se;
|
|
3340
3341
|
case "5D":
|
|
3341
|
-
return 5 *
|
|
3342
|
+
return 5 * Se;
|
|
3342
3343
|
case "1M":
|
|
3343
|
-
return 30 *
|
|
3344
|
+
return 30 * Se;
|
|
3344
3345
|
case "3M":
|
|
3345
|
-
return 90 *
|
|
3346
|
+
return 90 * Se;
|
|
3346
3347
|
case "6M":
|
|
3347
|
-
return 180 *
|
|
3348
|
+
return 180 * Se;
|
|
3348
3349
|
case "1Y":
|
|
3349
|
-
return 365 *
|
|
3350
|
+
return 365 * Se;
|
|
3350
3351
|
case "5Y":
|
|
3351
|
-
return 5 * 365 *
|
|
3352
|
+
return 5 * 365 * Se;
|
|
3352
3353
|
}
|
|
3353
3354
|
const t = /^(\d+)\s*([dDwWmMyYhH])$/.exec(e);
|
|
3354
3355
|
if (t) {
|
|
3355
3356
|
const n = Number(t[1]), r = t[2].toLowerCase();
|
|
3356
3357
|
if (r === "h") return n * 3600;
|
|
3357
|
-
if (r === "d") return n *
|
|
3358
|
-
if (r === "w") return n * 7 *
|
|
3359
|
-
if (r === "m") return n * 30 *
|
|
3360
|
-
if (r === "y") return n * 365 *
|
|
3358
|
+
if (r === "d") return n * Se;
|
|
3359
|
+
if (r === "w") return n * 7 * Se;
|
|
3360
|
+
if (r === "m") return n * 30 * Se;
|
|
3361
|
+
if (r === "y") return n * 365 * Se;
|
|
3361
3362
|
}
|
|
3362
|
-
return 30 *
|
|
3363
|
+
return 30 * Se;
|
|
3363
3364
|
}
|
|
3364
3365
|
function Ul(e) {
|
|
3365
3366
|
switch (e) {
|
|
@@ -3379,7 +3380,7 @@ function Ul(e) {
|
|
|
3379
3380
|
return "W";
|
|
3380
3381
|
}
|
|
3381
3382
|
const t = on(e);
|
|
3382
|
-
return t >= 3 * 365 *
|
|
3383
|
+
return t >= 3 * 365 * Se ? "W" : t >= 180 * Se ? "D" : t >= 60 * Se ? "240" : t >= 14 * Se ? "60" : t >= 3 * Se ? "15" : "5";
|
|
3383
3384
|
}
|
|
3384
3385
|
function Yl(e) {
|
|
3385
3386
|
if (e === "W" || e === "M") return "5Y";
|
|
@@ -3402,56 +3403,56 @@ function Vl({
|
|
|
3402
3403
|
downColor: u = "var(--crk-color-danger)",
|
|
3403
3404
|
lineColor: d = "var(--crk-chart-1)",
|
|
3404
3405
|
timezone: f,
|
|
3405
|
-
defaultTimezone:
|
|
3406
|
+
defaultTimezone: p = "local",
|
|
3406
3407
|
onTimezoneChange: L,
|
|
3407
|
-
showConfigPanel:
|
|
3408
|
-
onCrosshair:
|
|
3409
|
-
onVisibleRangeChange:
|
|
3410
|
-
className:
|
|
3411
|
-
style:
|
|
3408
|
+
showConfigPanel: b = !0,
|
|
3409
|
+
onCrosshair: R,
|
|
3410
|
+
onVisibleRangeChange: w,
|
|
3411
|
+
className: J,
|
|
3412
|
+
style: W
|
|
3412
3413
|
}) {
|
|
3413
|
-
const
|
|
3414
|
-
}), A =
|
|
3415
|
-
A.current =
|
|
3416
|
-
const [
|
|
3417
|
-
(
|
|
3418
|
-
f === void 0 &&
|
|
3414
|
+
const E = oe(null), Z = oe(null), C = oe([]), $ = oe({ from: 0, to: 0 }), ie = oe(null), ne = oe(null), V = oe(!1), ae = oe(null), S = oe(null), re = oe(1), F = oe({ width: 0, height: 0 }), X = oe(() => {
|
|
3415
|
+
}), A = oe(R), z = oe(w);
|
|
3416
|
+
A.current = R, z.current = w;
|
|
3417
|
+
const [ce, me] = Le(null), [K, H] = Le(p), N = f ?? K, y = pe(
|
|
3418
|
+
(g) => {
|
|
3419
|
+
f === void 0 && H(g), L?.(g);
|
|
3419
3420
|
},
|
|
3420
3421
|
[f, L]
|
|
3421
|
-
),
|
|
3422
|
+
), v = ke(
|
|
3422
3423
|
() => ({ up: h, down: u, line: d }),
|
|
3423
3424
|
[h, u, d]
|
|
3424
|
-
), B = c, _ = B.some((
|
|
3425
|
-
const
|
|
3426
|
-
if (!
|
|
3427
|
-
const x =
|
|
3425
|
+
), B = c, _ = B.some((g) => g.type === "rsi"), q = B.some((g) => g.type === "volume"), U = pe(() => {
|
|
3426
|
+
const g = Z.current;
|
|
3427
|
+
if (!g) return;
|
|
3428
|
+
const x = g.getContext("2d");
|
|
3428
3429
|
if (!x) return;
|
|
3429
|
-
const { width:
|
|
3430
|
-
if (
|
|
3431
|
-
const
|
|
3432
|
-
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0,
|
|
3433
|
-
const I = pl(
|
|
3430
|
+
const { width: te, height: D } = F.current;
|
|
3431
|
+
if (te === 0 || D === 0) return;
|
|
3432
|
+
const Y = re.current;
|
|
3433
|
+
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, g.width, g.height), x.scale(Y, Y);
|
|
3434
|
+
const I = pl(E.current, v), fe = ln(E.current), Q = C.current;
|
|
3434
3435
|
if (Q.length === 0) {
|
|
3435
|
-
gl(x,
|
|
3436
|
+
gl(x, te, D, I), x.restore();
|
|
3436
3437
|
return;
|
|
3437
3438
|
}
|
|
3438
|
-
const T = Nt(
|
|
3439
|
-
$.current = { from:
|
|
3440
|
-
const
|
|
3441
|
-
const Ie =
|
|
3442
|
-
return T.plotLeft + (
|
|
3443
|
-
}, Ae = T.plotWidth / (
|
|
3439
|
+
const T = Nt(te, D, _, q), { from: de, to: ye } = hl($.current, Q.length);
|
|
3440
|
+
$.current = { from: de, to: ye };
|
|
3441
|
+
const se = Q.slice(Math.max(0, Math.floor(de)), Math.min(Q.length, Math.ceil(ye) + 1)), he = (ue) => {
|
|
3442
|
+
const Ie = ye - de + 1, He = T.plotWidth / Ie;
|
|
3443
|
+
return T.plotLeft + (ue - de + 0.5) * He;
|
|
3444
|
+
}, Ae = T.plotWidth / (ye - de + 1), De = B.map((ue) => ml(ue, Q)).filter((ue) => ue !== null).map((ue) => ({ ...ue, color: fe(ue.color) })), xe = cn(T.main, se, De, de, ye);
|
|
3444
3445
|
Lt(x, T.plotLeft, T.plotRight, xe, I), yl(x, T, xe, i, I), x.save(), x.beginPath(), x.rect(T.plotLeft, xe.paneTop, T.plotWidth, xe.paneHeight), x.clip();
|
|
3445
|
-
for (let
|
|
3446
|
-
const Ie = B[
|
|
3447
|
-
He && kl(x, He, Ie, Q,
|
|
3446
|
+
for (let ue = 0; ue < B.length; ue++) {
|
|
3447
|
+
const Ie = B[ue], He = De[ue];
|
|
3448
|
+
He && kl(x, He, Ie, Q, de, ye, he, xe);
|
|
3448
3449
|
}
|
|
3449
|
-
if (o === "candle" ? vl(x, Q,
|
|
3450
|
-
const
|
|
3451
|
-
Lt(x, T.plotLeft, T.plotRight,
|
|
3450
|
+
if (o === "candle" ? vl(x, Q, de, ye, he, Ae, xe, { up: I.up, down: I.down }) : o === "bar" ? bl(x, Q, de, ye, he, Ae, xe, { up: I.up, down: I.down }) : xl(x, Q, de, ye, he, xe, I.line, o === "area"), x.restore(), T.volume) {
|
|
3451
|
+
const ue = fl(T.volume, Q, de, ye);
|
|
3452
|
+
Lt(x, T.plotLeft, T.plotRight, ue, I, !0), Ft(x, T, T.volume, "Volume", I), x.save(), x.beginPath(), x.rect(T.plotLeft, ue.paneTop, T.plotWidth, ue.paneHeight), x.clip(), Ml(x, Q, de, ye, he, Ae, ue, { up: I.up, down: I.down }), x.restore();
|
|
3452
3453
|
}
|
|
3453
3454
|
if (T.rsi) {
|
|
3454
|
-
const
|
|
3455
|
+
const ue = B.find((tt) => tt.type === "rsi"), Ie = ue && ue.type === "rsi" ? ue.period ?? 14 : 14, He = ue && ue.type === "rsi" ? ue.overbought ?? 70 : 70, Ge = ue && ue.type === "rsi" ? ue.oversold ?? 30 : 30, Ee = (ue && ue.type === "rsi" ? ue.color : void 0) ?? "var(--crk-chart-5)", xt = fe(Ee), kt = tl(Q, Ie), Oe = {
|
|
3455
3456
|
paneTop: T.rsi.top,
|
|
3456
3457
|
paneBottom: T.rsi.bottom,
|
|
3457
3458
|
paneHeight: T.rsi.height,
|
|
@@ -3459,151 +3460,151 @@ function Vl({
|
|
|
3459
3460
|
priceMax: 100,
|
|
3460
3461
|
ticks: [Ge, 50, He]
|
|
3461
3462
|
};
|
|
3462
|
-
Lt(x, T.plotLeft, T.plotRight, Oe, I, !0), Ft(x, T, T.rsi, `RSI ${Ie}`, I), x.save(), x.beginPath(), x.rect(T.plotLeft, Oe.paneTop, T.plotWidth, Oe.paneHeight), x.clip(), Qe(x, kt,
|
|
3463
|
+
Lt(x, T.plotLeft, T.plotRight, Oe, I, !0), Ft(x, T, T.rsi, `RSI ${Ie}`, I), x.save(), x.beginPath(), x.rect(T.plotLeft, Oe.paneTop, T.plotWidth, Oe.paneHeight), x.clip(), Qe(x, kt, de, ye, he, Oe, xt), x.restore(), wl(x, T, Oe, He, Ge, I);
|
|
3463
3464
|
}
|
|
3464
|
-
$l(x, T, Q,
|
|
3465
|
-
}, [o, B, _,
|
|
3466
|
-
|
|
3467
|
-
const
|
|
3468
|
-
if (
|
|
3465
|
+
$l(x, T, Q, de, ye, n, I), ie.current && Nl(x, T, ie.current, Q, de, ye, he, i, xe, N, I), x.restore();
|
|
3466
|
+
}, [o, B, _, q, i, v, n, N]);
|
|
3467
|
+
X.current = U;
|
|
3468
|
+
const ee = pe(() => {
|
|
3469
|
+
if (S.current === null) {
|
|
3469
3470
|
if (typeof requestAnimationFrame > "u") {
|
|
3470
|
-
|
|
3471
|
+
X.current();
|
|
3471
3472
|
return;
|
|
3472
3473
|
}
|
|
3473
|
-
|
|
3474
|
-
|
|
3474
|
+
S.current = requestAnimationFrame(() => {
|
|
3475
|
+
S.current = null, X.current();
|
|
3475
3476
|
});
|
|
3476
3477
|
}
|
|
3477
3478
|
}, []);
|
|
3478
3479
|
jt(() => {
|
|
3479
|
-
const
|
|
3480
|
-
if (!
|
|
3480
|
+
const g = E.current;
|
|
3481
|
+
if (!g) return;
|
|
3481
3482
|
const x = () => {
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3484
|
-
const I =
|
|
3485
|
-
I && (I.width = Math.round(
|
|
3483
|
+
const D = g.getBoundingClientRect(), Y = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3484
|
+
re.current = Y, F.current = { width: D.width, height: D.height };
|
|
3485
|
+
const I = Z.current;
|
|
3486
|
+
I && (I.width = Math.round(D.width * Y), I.height = Math.round(D.height * Y), I.style.width = `${D.width}px`, I.style.height = `${D.height}px`), ee();
|
|
3486
3487
|
};
|
|
3487
3488
|
if (x(), typeof ResizeObserver > "u") return;
|
|
3488
|
-
const
|
|
3489
|
-
return
|
|
3490
|
-
}, [
|
|
3491
|
-
let
|
|
3492
|
-
const x = Math.floor(Date.now() / 1e3),
|
|
3493
|
-
C.current = [], $.current = { from: 0, to: 0 },
|
|
3494
|
-
if (
|
|
3495
|
-
const T = [...Q].sort((
|
|
3489
|
+
const te = new ResizeObserver(x);
|
|
3490
|
+
return te.observe(g), () => te.disconnect();
|
|
3491
|
+
}, [ee]), Ne(() => {
|
|
3492
|
+
let g = !1;
|
|
3493
|
+
const x = Math.floor(Date.now() / 1e3), te = zt(n), D = r !== void 0 ? on(r) : te * l, Y = r !== void 0 ? Math.max(10, Math.ceil(D / te)) : l, I = x - D;
|
|
3494
|
+
C.current = [], $.current = { from: 0, to: 0 }, ee(), e.getBars({ symbol: t, resolution: n, from: I, to: x, countBack: Y }).then((Q) => {
|
|
3495
|
+
if (g) return;
|
|
3496
|
+
const T = [...Q].sort((ye, se) => ye.time - se.time);
|
|
3496
3497
|
C.current = T;
|
|
3497
|
-
const
|
|
3498
|
+
const de = T.length - 1;
|
|
3498
3499
|
if (r !== void 0)
|
|
3499
|
-
$.current = { from: 0, to:
|
|
3500
|
+
$.current = { from: 0, to: de };
|
|
3500
3501
|
else {
|
|
3501
|
-
const
|
|
3502
|
+
const ye = Math.min(T.length, Math.min(200, l));
|
|
3502
3503
|
$.current = {
|
|
3503
|
-
from: Math.max(0,
|
|
3504
|
-
to:
|
|
3504
|
+
from: Math.max(0, de - ye + 1),
|
|
3505
|
+
to: de
|
|
3505
3506
|
};
|
|
3506
3507
|
}
|
|
3507
|
-
|
|
3508
|
+
z.current?.($.current, T), ee();
|
|
3508
3509
|
}).catch(() => {
|
|
3509
3510
|
});
|
|
3510
|
-
const
|
|
3511
|
+
const fe = e.subscribeBars({
|
|
3511
3512
|
symbol: t,
|
|
3512
3513
|
resolution: n,
|
|
3513
3514
|
onTick: (Q) => {
|
|
3514
|
-
if (
|
|
3515
|
-
const T = C.current,
|
|
3516
|
-
if (
|
|
3515
|
+
if (g) return;
|
|
3516
|
+
const T = C.current, de = T[T.length - 1];
|
|
3517
|
+
if (de && de.time === Q.time)
|
|
3517
3518
|
T[T.length - 1] = Q;
|
|
3518
|
-
else if (!
|
|
3519
|
+
else if (!de || Q.time > de.time) {
|
|
3519
3520
|
T.push(Q);
|
|
3520
|
-
const
|
|
3521
|
-
|
|
3521
|
+
const ye = $.current;
|
|
3522
|
+
ye.to >= T.length - 2 && ($.current = { from: ye.from + 1, to: ye.to + 1 });
|
|
3522
3523
|
}
|
|
3523
|
-
|
|
3524
|
+
ee();
|
|
3524
3525
|
}
|
|
3525
3526
|
});
|
|
3526
|
-
return ae.current =
|
|
3527
|
-
|
|
3527
|
+
return ae.current = fe, () => {
|
|
3528
|
+
g = !0, ae.current !== null && (e.unsubscribeBars(ae.current), ae.current = null);
|
|
3528
3529
|
};
|
|
3529
3530
|
}, [e, t, n, r, l]);
|
|
3530
|
-
const
|
|
3531
|
-
|
|
3532
|
-
}, []),
|
|
3533
|
-
|
|
3531
|
+
const k = pe((g) => {
|
|
3532
|
+
me(g), A.current?.(g);
|
|
3533
|
+
}, []), G = pe((g) => {
|
|
3534
|
+
g.currentTarget.setPointerCapture(g.pointerId);
|
|
3534
3535
|
const x = $.current;
|
|
3535
|
-
|
|
3536
|
-
}, []),
|
|
3537
|
-
(
|
|
3538
|
-
const x =
|
|
3539
|
-
if (
|
|
3540
|
-
const { startX:
|
|
3536
|
+
ne.current = { startX: g.clientX, from: x.from, to: x.to };
|
|
3537
|
+
}, []), O = pe(
|
|
3538
|
+
(g) => {
|
|
3539
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left, D = g.clientY - x.top;
|
|
3540
|
+
if (ie.current = { x: te, y: D }, ne.current) {
|
|
3541
|
+
const { startX: fe, from: Q, to: T } = ne.current, { width: de } = F.current, ye = Math.max(1, de - Ct), se = T - Q + 1, he = ye / se, Ae = -(g.clientX - fe) / he;
|
|
3541
3542
|
let De = Q + Ae, xe = T + Ae;
|
|
3542
|
-
const
|
|
3543
|
-
De < 0 && (
|
|
3543
|
+
const ue = C.current.length;
|
|
3544
|
+
De < 0 && (Re(), De = 0, xe = se - 1), xe > ue - 1 && (xe = ue - 1, De = xe - se + 1), $.current = { from: De, to: xe }, z.current?.($.current, C.current);
|
|
3544
3545
|
}
|
|
3545
|
-
const
|
|
3546
|
-
if (
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3546
|
+
const Y = Nt(x.width, x.height, _, q), I = $.current;
|
|
3547
|
+
if (te >= Y.plotLeft && te <= Y.plotRight) {
|
|
3548
|
+
const fe = I.to - I.from + 1, Q = Y.plotWidth / fe, T = Math.round(I.from + (te - Y.plotLeft) / Q - 0.5), de = C.current, ye = Math.max(0, Math.min(de.length - 1, T)), se = de[ye] ?? null, he = Ll(D, Y, de, I.from, I.to);
|
|
3549
|
+
k({ barIndex: ye, bar: se, priceAtCursor: he });
|
|
3549
3550
|
} else
|
|
3550
|
-
|
|
3551
|
-
|
|
3551
|
+
k(null);
|
|
3552
|
+
ee();
|
|
3552
3553
|
},
|
|
3553
|
-
[_,
|
|
3554
|
-
),
|
|
3555
|
-
|
|
3556
|
-
}, []),
|
|
3557
|
-
|
|
3558
|
-
}, [
|
|
3559
|
-
(
|
|
3560
|
-
|
|
3561
|
-
const x =
|
|
3554
|
+
[_, q, ee, k]
|
|
3555
|
+
), le = pe((g) => {
|
|
3556
|
+
g.currentTarget.releasePointerCapture(g.pointerId), ne.current = null;
|
|
3557
|
+
}, []), ge = pe(() => {
|
|
3558
|
+
ie.current = null, ne.current = null, k(null), ee();
|
|
3559
|
+
}, [ee, k]), be = pe(
|
|
3560
|
+
(g) => {
|
|
3561
|
+
g.preventDefault();
|
|
3562
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left, D = Nt(x.width, x.height, _, q), Y = $.current, I = C.current;
|
|
3562
3563
|
if (I.length === 0) return;
|
|
3563
|
-
const
|
|
3564
|
-
|
|
3565
|
-
Math.min(I.length,
|
|
3566
|
-
),
|
|
3567
|
-
let
|
|
3568
|
-
|
|
3564
|
+
const fe = Y.to - Y.from + 1, Q = g.deltaY > 0 ? 1 + Ot : 1 / (1 + Ot), T = Math.max(
|
|
3565
|
+
D.plotWidth / cl,
|
|
3566
|
+
Math.min(I.length, D.plotWidth / il, fe * Q)
|
|
3567
|
+
), de = Y.from + (te - D.plotLeft) / (D.plotWidth / fe), ye = (de - Y.from) / fe;
|
|
3568
|
+
let se = de - ye * T, he = se + T - 1;
|
|
3569
|
+
se < 0 && (se = 0, he = T - 1), he > I.length - 1 && (he = I.length - 1, se = he - T + 1), $.current = { from: se, to: he }, z.current?.($.current, I), ee();
|
|
3569
3570
|
},
|
|
3570
|
-
[_,
|
|
3571
|
-
), Ce =
|
|
3572
|
-
(
|
|
3573
|
-
const x = $.current,
|
|
3574
|
-
if (
|
|
3575
|
-
let
|
|
3576
|
-
if (
|
|
3577
|
-
else if (
|
|
3571
|
+
[_, q, ee]
|
|
3572
|
+
), Ce = pe(
|
|
3573
|
+
(g) => {
|
|
3574
|
+
const x = $.current, te = x.to - x.from + 1, D = C.current;
|
|
3575
|
+
if (D.length === 0) return;
|
|
3576
|
+
let Y = 0;
|
|
3577
|
+
if (g.key === "ArrowLeft") Y = -Math.max(1, Math.floor(te * 0.1));
|
|
3578
|
+
else if (g.key === "ArrowRight") Y = Math.max(1, Math.floor(te * 0.1));
|
|
3578
3579
|
else return;
|
|
3579
|
-
|
|
3580
|
-
let I = x.from +
|
|
3581
|
-
I < 0 && (I = 0,
|
|
3580
|
+
g.preventDefault();
|
|
3581
|
+
let I = x.from + Y, fe = x.to + Y;
|
|
3582
|
+
I < 0 && (I = 0, fe = te - 1), fe > D.length - 1 && (fe = D.length - 1, I = fe - te + 1), $.current = { from: I, to: fe }, z.current?.($.current, D), ee();
|
|
3582
3583
|
},
|
|
3583
|
-
[
|
|
3584
|
-
),
|
|
3585
|
-
if (
|
|
3586
|
-
const
|
|
3587
|
-
if (
|
|
3588
|
-
|
|
3589
|
-
const x = zt(n),
|
|
3590
|
-
e.getBars({ symbol: t, resolution: n, from:
|
|
3584
|
+
[ee]
|
|
3585
|
+
), Re = pe(() => {
|
|
3586
|
+
if (V.current) return;
|
|
3587
|
+
const g = C.current;
|
|
3588
|
+
if (g.length === 0) return;
|
|
3589
|
+
V.current = !0;
|
|
3590
|
+
const x = zt(n), te = g[0].time, D = te - x * l, Y = te - x;
|
|
3591
|
+
e.getBars({ symbol: t, resolution: n, from: D, to: Y, countBack: l }).then((I) => {
|
|
3591
3592
|
if (I.length === 0) {
|
|
3592
|
-
|
|
3593
|
+
V.current = !1;
|
|
3593
3594
|
return;
|
|
3594
3595
|
}
|
|
3595
|
-
const Q = [...I].sort((
|
|
3596
|
-
C.current = [...Q, ...
|
|
3596
|
+
const Q = [...I].sort((de, ye) => de.time - ye.time).filter((de) => de.time < te), T = $.current;
|
|
3597
|
+
C.current = [...Q, ...g], $.current = { from: T.from + Q.length, to: T.to + Q.length }, V.current = !1, ee();
|
|
3597
3598
|
}).catch(() => {
|
|
3598
|
-
|
|
3599
|
+
V.current = !1;
|
|
3599
3600
|
});
|
|
3600
|
-
}, [e, t, n, l,
|
|
3601
|
-
return /* @__PURE__ */
|
|
3601
|
+
}, [e, t, n, l, ee]);
|
|
3602
|
+
return /* @__PURE__ */ j(
|
|
3602
3603
|
"div",
|
|
3603
3604
|
{
|
|
3604
|
-
ref:
|
|
3605
|
-
className: m(
|
|
3606
|
-
style: { ...
|
|
3605
|
+
ref: E,
|
|
3606
|
+
className: m(M.root, J),
|
|
3607
|
+
style: { ...W, height: a, position: "relative" },
|
|
3607
3608
|
tabIndex: 0,
|
|
3608
3609
|
role: "figure",
|
|
3609
3610
|
"aria-label": `${t} ${n} chart`,
|
|
@@ -3612,20 +3613,20 @@ function Vl({
|
|
|
3612
3613
|
/* @__PURE__ */ s(
|
|
3613
3614
|
"canvas",
|
|
3614
3615
|
{
|
|
3615
|
-
ref:
|
|
3616
|
-
className:
|
|
3617
|
-
onPointerDown:
|
|
3618
|
-
onPointerMove:
|
|
3619
|
-
onPointerUp:
|
|
3620
|
-
onPointerLeave:
|
|
3616
|
+
ref: Z,
|
|
3617
|
+
className: M.svg,
|
|
3618
|
+
onPointerDown: G,
|
|
3619
|
+
onPointerMove: O,
|
|
3620
|
+
onPointerUp: le,
|
|
3621
|
+
onPointerLeave: ge,
|
|
3621
3622
|
onWheel: be,
|
|
3622
|
-
style: { cursor:
|
|
3623
|
+
style: { cursor: ne.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3623
3624
|
}
|
|
3624
3625
|
),
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ j(
|
|
3626
3627
|
"div",
|
|
3627
3628
|
{
|
|
3628
|
-
className:
|
|
3629
|
+
className: M.tradingHeader,
|
|
3629
3630
|
style: {
|
|
3630
3631
|
position: "absolute",
|
|
3631
3632
|
top: ol,
|
|
@@ -3638,22 +3639,22 @@ function Vl({
|
|
|
3638
3639
|
gap: 8
|
|
3639
3640
|
},
|
|
3640
3641
|
children: [
|
|
3641
|
-
/* @__PURE__ */
|
|
3642
|
+
/* @__PURE__ */ j("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
3642
3643
|
/* @__PURE__ */ s("strong", { children: t }),
|
|
3643
3644
|
/* @__PURE__ */ s("span", { style: { color: "var(--crk-color-text-muted)" }, children: n }),
|
|
3644
|
-
|
|
3645
|
+
ce?.bar && /* @__PURE__ */ j("span", { style: { color: "var(--crk-color-text-muted)", whiteSpace: "nowrap" }, children: [
|
|
3645
3646
|
"O ",
|
|
3646
|
-
|
|
3647
|
+
ce.bar.open.toFixed(i),
|
|
3647
3648
|
" · H ",
|
|
3648
|
-
|
|
3649
|
+
ce.bar.high.toFixed(i),
|
|
3649
3650
|
" · L",
|
|
3650
3651
|
" ",
|
|
3651
|
-
|
|
3652
|
+
ce.bar.low.toFixed(i),
|
|
3652
3653
|
" · C ",
|
|
3653
|
-
|
|
3654
|
+
ce.bar.close.toFixed(i)
|
|
3654
3655
|
] })
|
|
3655
3656
|
] }),
|
|
3656
|
-
|
|
3657
|
+
b && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
3657
3658
|
qt,
|
|
3658
3659
|
{
|
|
3659
3660
|
position: "bottom",
|
|
@@ -3671,8 +3672,8 @@ function Vl({
|
|
|
3671
3672
|
content: /* @__PURE__ */ s(
|
|
3672
3673
|
dl,
|
|
3673
3674
|
{
|
|
3674
|
-
timezone:
|
|
3675
|
-
onTimezoneChange:
|
|
3675
|
+
timezone: N,
|
|
3676
|
+
onTimezoneChange: y
|
|
3676
3677
|
}
|
|
3677
3678
|
)
|
|
3678
3679
|
}
|
|
@@ -3698,7 +3699,7 @@ function dl({
|
|
|
3698
3699
|
timezone: e,
|
|
3699
3700
|
onTimezoneChange: t
|
|
3700
3701
|
}) {
|
|
3701
|
-
return /* @__PURE__ */
|
|
3702
|
+
return /* @__PURE__ */ j("div", { style: { minWidth: 220, padding: 4 }, children: [
|
|
3702
3703
|
/* @__PURE__ */ s(
|
|
3703
3704
|
"div",
|
|
3704
3705
|
{
|
|
@@ -3710,7 +3711,7 @@ function dl({
|
|
|
3710
3711
|
children: "Settings"
|
|
3711
3712
|
}
|
|
3712
3713
|
),
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
+
/* @__PURE__ */ j("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
|
|
3714
3715
|
/* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
|
|
3715
3716
|
/* @__PURE__ */ s(
|
|
3716
3717
|
Vt,
|
|
@@ -3724,7 +3725,7 @@ function dl({
|
|
|
3724
3725
|
] });
|
|
3725
3726
|
}
|
|
3726
3727
|
function ul() {
|
|
3727
|
-
return /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ j(
|
|
3728
3729
|
"svg",
|
|
3729
3730
|
{
|
|
3730
3731
|
viewBox: "0 0 24 24",
|
|
@@ -3745,9 +3746,9 @@ function Nt(e, t, n, r) {
|
|
|
3745
3746
|
const c = Math.max(0, e - Ct), i = rl, l = Math.max(i, t - At), a = Math.max(0, c - 0), h = Math.max(0, l - i);
|
|
3746
3747
|
let u = h, d = i;
|
|
3747
3748
|
const f = { top: i, bottom: l, height: h };
|
|
3748
|
-
let
|
|
3749
|
-
const
|
|
3750
|
-
return u = h * (1 -
|
|
3749
|
+
let p = null, L = null;
|
|
3750
|
+
const b = n ? Ht.rsi : 0, R = r ? Ht.volume : 0;
|
|
3751
|
+
return u = h * (1 - b - R), f.top = d, f.height = u, f.bottom = f.top + u, d = f.bottom, n && (p = { top: d, height: h * b, bottom: d + h * b }, d = p.bottom), r && (L = { top: d, height: h * R, bottom: d + h * R }), { width: e, height: t, plotLeft: 0, plotRight: c, plotTop: i, plotBottom: l, plotWidth: a, plotHeight: h, main: f, rsi: p, volume: L };
|
|
3751
3752
|
}
|
|
3752
3753
|
function hl(e, t) {
|
|
3753
3754
|
if (t === 0) return { from: 0, to: 0 };
|
|
@@ -3782,11 +3783,11 @@ function cn(e, t, n, r, o) {
|
|
|
3782
3783
|
d.low < c && (c = d.low), d.high > i && (i = d.high);
|
|
3783
3784
|
for (const d of n) {
|
|
3784
3785
|
const f = d.kind === "line" ? [d.values] : [d.upper, d.lower];
|
|
3785
|
-
for (const
|
|
3786
|
-
const L = Math.max(0, Math.floor(r)),
|
|
3787
|
-
for (let
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3786
|
+
for (const p of f) {
|
|
3787
|
+
const L = Math.max(0, Math.floor(r)), b = Math.min(p.length - 1, Math.ceil(o));
|
|
3788
|
+
for (let R = L; R <= b; R++) {
|
|
3789
|
+
const w = p[R];
|
|
3790
|
+
w != null && (w < c && (c = w), w > i && (i = w));
|
|
3790
3791
|
}
|
|
3791
3792
|
}
|
|
3792
3793
|
}
|
|
@@ -3859,20 +3860,20 @@ function yl(e, t, n, r, o) {
|
|
|
3859
3860
|
function vl(e, t, n, r, o, c, i, l) {
|
|
3860
3861
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3861
3862
|
for (let d = a; d <= h; d++) {
|
|
3862
|
-
const f = t[d],
|
|
3863
|
-
e.strokeStyle =
|
|
3864
|
-
const
|
|
3865
|
-
e.moveTo(
|
|
3866
|
-
const
|
|
3867
|
-
e.fillRect(Math.round(
|
|
3863
|
+
const f = t[d], p = o(d), L = we(f.open, i), b = we(f.close, i), R = we(f.high, i), w = we(f.low, i), W = f.close >= f.open ? l.up : l.down;
|
|
3864
|
+
e.strokeStyle = W, e.fillStyle = W, e.beginPath();
|
|
3865
|
+
const E = Math.round(p) + 0.5;
|
|
3866
|
+
e.moveTo(E, R), e.lineTo(E, w), e.stroke();
|
|
3867
|
+
const Z = Math.min(L, b), C = Math.max(1, Math.abs(b - L));
|
|
3868
|
+
e.fillRect(Math.round(p - u / 2), Math.round(Z), Math.round(u), Math.round(C));
|
|
3868
3869
|
}
|
|
3869
3870
|
}
|
|
3870
3871
|
function bl(e, t, n, r, o, c, i, l) {
|
|
3871
3872
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(2, Math.min(c * 0.4, 8));
|
|
3872
3873
|
e.lineWidth = Math.max(1, Math.min(2, c * 0.18)), e.lineCap = "butt";
|
|
3873
3874
|
for (let d = a; d <= h; d++) {
|
|
3874
|
-
const f = t[d],
|
|
3875
|
-
e.strokeStyle =
|
|
3875
|
+
const f = t[d], p = Math.round(o(d)) + 0.5, L = we(f.high, i), b = we(f.low, i), R = we(f.open, i), w = we(f.close, i), J = f.close >= f.open;
|
|
3876
|
+
e.strokeStyle = J ? l.up : l.down, e.beginPath(), e.moveTo(p, L), e.lineTo(p, b), e.moveTo(p - u, R), e.lineTo(p, R), e.moveTo(p, w), e.lineTo(p + u, w), e.stroke();
|
|
3876
3877
|
}
|
|
3877
3878
|
}
|
|
3878
3879
|
function xl(e, t, n, r, o, c, i, l) {
|
|
@@ -3895,8 +3896,8 @@ function kl(e, t, n, r, o, c, i, l) {
|
|
|
3895
3896
|
for (let d = a; d <= h; d++) {
|
|
3896
3897
|
const f = t.upper[d];
|
|
3897
3898
|
if (f == null) continue;
|
|
3898
|
-
const
|
|
3899
|
-
u ? e.lineTo(
|
|
3899
|
+
const p = i(d), L = we(f, l);
|
|
3900
|
+
u ? e.lineTo(p, L) : (e.moveTo(p, L), u = !0);
|
|
3900
3901
|
}
|
|
3901
3902
|
for (let d = h; d >= a; d--) {
|
|
3902
3903
|
const f = t.lower[d];
|
|
@@ -3914,20 +3915,20 @@ function Qe(e, t, n, r, o, c, i) {
|
|
|
3914
3915
|
l = !1;
|
|
3915
3916
|
continue;
|
|
3916
3917
|
}
|
|
3917
|
-
const f = o(u),
|
|
3918
|
-
l ? e.lineTo(f,
|
|
3918
|
+
const f = o(u), p = we(d, c);
|
|
3919
|
+
l ? e.lineTo(f, p) : (e.moveTo(f, p), l = !0);
|
|
3919
3920
|
}
|
|
3920
3921
|
e.stroke();
|
|
3921
3922
|
}
|
|
3922
3923
|
function Ml(e, t, n, r, o, c, i, l) {
|
|
3923
3924
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3924
3925
|
for (let d = a; d <= h; d++) {
|
|
3925
|
-
const f = t[d],
|
|
3926
|
-
if (
|
|
3926
|
+
const f = t[d], p = f.volume ?? 0;
|
|
3927
|
+
if (p === 0) continue;
|
|
3927
3928
|
const L = f.close >= f.open;
|
|
3928
3929
|
e.fillStyle = L ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3929
|
-
const
|
|
3930
|
-
e.fillRect(Math.round(o(d) - u / 2), Math.round(
|
|
3930
|
+
const b = we(p, i), R = i.paneBottom - b;
|
|
3931
|
+
e.fillRect(Math.round(o(d) - u / 2), Math.round(b), Math.round(u), Math.round(R));
|
|
3931
3932
|
}
|
|
3932
3933
|
e.globalAlpha = 1;
|
|
3933
3934
|
}
|
|
@@ -3946,26 +3947,26 @@ function $l(e, t, n, r, o, c, i) {
|
|
|
3946
3947
|
const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
|
|
3947
3948
|
e.fillStyle = i.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
|
|
3948
3949
|
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)), f = t.plotBottom + At / 2;
|
|
3949
|
-
for (let
|
|
3950
|
-
const L = n[
|
|
3951
|
-
e.fillText(
|
|
3950
|
+
for (let p = u; p <= d; p += h) {
|
|
3951
|
+
const L = n[p], b = t.plotLeft + (p - r + 0.5) * a;
|
|
3952
|
+
e.fillText(Rl(L.time, c), b, f);
|
|
3952
3953
|
}
|
|
3953
3954
|
}
|
|
3954
3955
|
function Nl(e, t, n, r, o, c, i, l, a, h, u) {
|
|
3955
3956
|
if (n.x < t.plotLeft || n.x > t.plotRight) return;
|
|
3956
|
-
const d = c - o + 1, f = t.plotWidth / d,
|
|
3957
|
-
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(
|
|
3958
|
-
const
|
|
3959
|
-
e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Ct, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(
|
|
3957
|
+
const d = c - o + 1, f = t.plotWidth / d, p = o + (n.x - t.plotLeft) / f - 0.5, L = Math.round(p), b = Math.max(0, Math.min(r.length - 1, L)), R = i(b);
|
|
3958
|
+
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(R + 0.5, t.plotTop), e.lineTo(R + 0.5, t.plotBottom), e.moveTo(t.plotLeft, n.y + 0.5), e.lineTo(t.plotRight, n.y + 0.5), e.stroke(), e.setLineDash([]), n.y >= a.paneTop && n.y <= a.paneBottom) {
|
|
3959
|
+
const w = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3960
|
+
e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Ct, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(w.toFixed(l), t.plotRight + 6, n.y);
|
|
3960
3961
|
}
|
|
3961
|
-
if (r[
|
|
3962
|
-
const
|
|
3962
|
+
if (r[b]) {
|
|
3963
|
+
const w = sn(r[b].time, h);
|
|
3963
3964
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3964
|
-
const
|
|
3965
|
+
const E = e.measureText(w).width + 8 * 2, Z = At, C = Math.max(
|
|
3965
3966
|
t.plotLeft,
|
|
3966
|
-
Math.min(t.plotRight -
|
|
3967
|
+
Math.min(t.plotRight - E, R - E / 2)
|
|
3967
3968
|
), $ = t.plotBottom;
|
|
3968
|
-
e.fillStyle = u.text, e.fillRect(C, $,
|
|
3969
|
+
e.fillStyle = u.text, e.fillRect(C, $, E, Z), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(w, C + E / 2, $ + Z / 2);
|
|
3969
3970
|
}
|
|
3970
3971
|
e.restore();
|
|
3971
3972
|
}
|
|
@@ -3973,14 +3974,14 @@ function Ll(e, t, n, r, o, c, i) {
|
|
|
3973
3974
|
const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = cn(t.main, l, [], r, o);
|
|
3974
3975
|
return e < a.paneTop || e > a.paneBottom ? null : a.priceMax - (e - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3975
3976
|
}
|
|
3976
|
-
function
|
|
3977
|
+
function Rl(e, t) {
|
|
3977
3978
|
const n = new Date(e * 1e3);
|
|
3978
3979
|
return t === "D" || t === "W" || t === "M" ? `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())}` : `${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}`;
|
|
3979
3980
|
}
|
|
3980
3981
|
function sn(e, t) {
|
|
3981
3982
|
const n = new Date(e * 1e3);
|
|
3982
3983
|
if (t === "local")
|
|
3983
|
-
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${
|
|
3984
|
+
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${Sl(n)}`;
|
|
3984
3985
|
if (t === "utc")
|
|
3985
3986
|
return `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())} ${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}:${Te(n.getUTCSeconds())} UTC`;
|
|
3986
3987
|
try {
|
|
@@ -4001,7 +4002,7 @@ function sn(e, t) {
|
|
|
4001
4002
|
return sn(e, "utc");
|
|
4002
4003
|
}
|
|
4003
4004
|
}
|
|
4004
|
-
function
|
|
4005
|
+
function Sl(e) {
|
|
4005
4006
|
const t = -e.getTimezoneOffset(), n = t >= 0 ? "+" : "-", r = Math.abs(t);
|
|
4006
4007
|
return `${n}${Te(Math.floor(r / 60))}:${Te(r % 60)}`;
|
|
4007
4008
|
}
|
|
@@ -4049,16 +4050,16 @@ const Cl = $e(
|
|
|
4049
4050
|
className: h,
|
|
4050
4051
|
style: u
|
|
4051
4052
|
}, d) => {
|
|
4052
|
-
const { line: f, area:
|
|
4053
|
+
const { line: f, area: p, last: L } = ke(() => {
|
|
4053
4054
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
4054
|
-
const
|
|
4055
|
-
return { line: $, area:
|
|
4055
|
+
const b = o, R = Math.max(1, t - b * 2), w = Math.max(1, n - b * 2), [J, W] = bt(e), E = Je([0, Math.max(1, e.length - 1)], [b, b + R]), Z = Je([J, W], [b + w, b]), C = e.map((ne, V) => ({ x: E(V), y: Z(ne) })), $ = Tl(C, c), ie = i ? `${$} L ${C[C.length - 1].x} ${b + w} L ${C[0].x} ${b + w} Z` : "";
|
|
4056
|
+
return { line: $, area: ie, last: C[C.length - 1] };
|
|
4056
4057
|
}, [e, t, n, o, c, i]);
|
|
4057
|
-
return /* @__PURE__ */
|
|
4058
|
+
return /* @__PURE__ */ j(
|
|
4058
4059
|
"svg",
|
|
4059
4060
|
{
|
|
4060
4061
|
ref: d,
|
|
4061
|
-
className: m(
|
|
4062
|
+
className: m(M.sparkline, h),
|
|
4062
4063
|
style: u,
|
|
4063
4064
|
width: t,
|
|
4064
4065
|
height: n,
|
|
@@ -4066,7 +4067,7 @@ const Cl = $e(
|
|
|
4066
4067
|
role: "img",
|
|
4067
4068
|
"aria-label": a,
|
|
4068
4069
|
children: [
|
|
4069
|
-
i &&
|
|
4070
|
+
i && p && /* @__PURE__ */ s("path", { d: p, fill: r, opacity: 0.18 }),
|
|
4070
4071
|
f && /* @__PURE__ */ s(
|
|
4071
4072
|
"path",
|
|
4072
4073
|
{
|
|
@@ -4122,7 +4123,7 @@ export {
|
|
|
4122
4123
|
Ul as suggestResolutionForPeriod,
|
|
4123
4124
|
xo as useClickOutside,
|
|
4124
4125
|
Mo as useFocusTrap,
|
|
4125
|
-
|
|
4126
|
+
St as useKeyboard,
|
|
4126
4127
|
Ur as useTableSort,
|
|
4127
4128
|
_l as volumeSeries
|
|
4128
4129
|
};
|