@overdoser/react-toolkit 0.0.7 → 0.0.8
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/Popover/Popover.d.ts +16 -1
- package/index.js +1436 -1411
- package/llms.txt +12 -2
- package/manifest.json +2 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { forwardRef as $e, createElement as
|
|
2
|
-
import { jsxs as H, jsx as s, Fragment as
|
|
3
|
-
import { FormProvider as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
function
|
|
1
|
+
import { forwardRef as $e, createElement as ln, useState as Se, useCallback as he, useMemo as ke, useEffect as Be, useRef as ne, useId as ze, isValidElement as sn, cloneElement as jt, createContext as Xt, useContext as ft, useImperativeHandle as an, useLayoutEffect as dn } from "react";
|
|
2
|
+
import { jsxs as H, jsx as s, Fragment as Ve } from "react/jsx-runtime";
|
|
3
|
+
import { FormProvider as un, useFormContext as hn, useController as mn } from "react-hook-form";
|
|
4
|
+
import { createPortal as fn } from "react-dom";
|
|
5
|
+
function Ut(e) {
|
|
6
6
|
var t, n, r = "";
|
|
7
7
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
8
8
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
9
9
|
var o = e.length;
|
|
10
|
-
for (t = 0; t < o; t++) e[t] && (n =
|
|
10
|
+
for (t = 0; t < o; t++) e[t] && (n = Ut(e[t])) && (r && (r += " "), r += n);
|
|
11
11
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
12
12
|
return r;
|
|
13
13
|
}
|
|
14
14
|
function f() {
|
|
15
|
-
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t =
|
|
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
|
|
19
|
-
root:
|
|
20
|
-
loading:
|
|
21
|
-
primary:
|
|
22
|
-
secondary:
|
|
23
|
-
danger:
|
|
24
|
-
ghost:
|
|
25
|
-
sm:
|
|
26
|
-
md:
|
|
27
|
-
lg:
|
|
28
|
-
fullWidth:
|
|
29
|
-
iconOnly:
|
|
30
|
-
content:
|
|
31
|
-
shimmer:
|
|
32
|
-
loadingShimmer:
|
|
33
|
-
shimmerSweep:
|
|
34
|
-
dots:
|
|
35
|
-
loadingDots:
|
|
36
|
-
dot:
|
|
37
|
-
dotBounce:
|
|
38
|
-
loadingBorder:
|
|
39
|
-
borderSpin:
|
|
40
|
-
},
|
|
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", Sn = "crk-shimmer-8iQSU", Tn = "crk-loadingShimmer-BVvFw", Rn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", Dn = "crk-dotBounce-FwdcC", In = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Ae = {
|
|
19
|
+
root: pn,
|
|
20
|
+
loading: gn,
|
|
21
|
+
primary: yn,
|
|
22
|
+
secondary: vn,
|
|
23
|
+
danger: bn,
|
|
24
|
+
ghost: xn,
|
|
25
|
+
sm: kn,
|
|
26
|
+
md: Mn,
|
|
27
|
+
lg: wn,
|
|
28
|
+
fullWidth: $n,
|
|
29
|
+
iconOnly: Nn,
|
|
30
|
+
content: Ln,
|
|
31
|
+
shimmer: Sn,
|
|
32
|
+
loadingShimmer: Tn,
|
|
33
|
+
shimmerSweep: Rn,
|
|
34
|
+
dots: Cn,
|
|
35
|
+
loadingDots: An,
|
|
36
|
+
dot: Bn,
|
|
37
|
+
dotBounce: Dn,
|
|
38
|
+
loadingBorder: In,
|
|
39
|
+
borderSpin: En
|
|
40
|
+
}, Pn = {
|
|
41
41
|
dots: Ae.loadingDots,
|
|
42
42
|
shimmer: Ae.loadingShimmer,
|
|
43
43
|
border: Ae.loadingBorder
|
|
44
|
-
},
|
|
44
|
+
}, _t = $e(
|
|
45
45
|
({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
size: t = "md",
|
|
@@ -53,8 +53,8 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
|
|
|
53
53
|
classes: l,
|
|
54
54
|
className: a,
|
|
55
55
|
style: h,
|
|
56
|
-
children:
|
|
57
|
-
...
|
|
56
|
+
children: d,
|
|
57
|
+
...u
|
|
58
58
|
}, m) => /* @__PURE__ */ H(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
@@ -66,17 +66,17 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
|
|
|
66
66
|
o && Ae.fullWidth,
|
|
67
67
|
i && Ae.iconOnly,
|
|
68
68
|
n && Ae.loading,
|
|
69
|
-
n &&
|
|
69
|
+
n && Pn[r],
|
|
70
70
|
l?.root,
|
|
71
71
|
a
|
|
72
72
|
),
|
|
73
73
|
style: h,
|
|
74
74
|
disabled: c || n,
|
|
75
75
|
"aria-busy": n || void 0,
|
|
76
|
-
...
|
|
76
|
+
...u,
|
|
77
77
|
children: [
|
|
78
78
|
/* @__PURE__ */ s("div", { className: f(Ae.shimmer, l?.shimmer) }),
|
|
79
|
-
/* @__PURE__ */ s("span", { className: f(Ae.content, l?.content), children:
|
|
79
|
+
/* @__PURE__ */ s("span", { className: f(Ae.content, l?.content), children: d }),
|
|
80
80
|
/* @__PURE__ */ H("span", { className: f(Ae.dots, l?.dots), "aria-hidden": "true", children: [
|
|
81
81
|
/* @__PURE__ */ s("span", { className: f(Ae.dot, l?.dot) }),
|
|
82
82
|
/* @__PURE__ */ s("span", { className: f(Ae.dot, l?.dot) }),
|
|
@@ -86,14 +86,14 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
);
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
root:
|
|
89
|
+
_t.displayName = "Button";
|
|
90
|
+
const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn = "crk-srOnly-LGQgs", $t = {
|
|
91
|
+
root: Wn,
|
|
92
92
|
default: "crk-default-3TBlr",
|
|
93
|
-
muted:
|
|
94
|
-
danger:
|
|
95
|
-
srOnly:
|
|
96
|
-
},
|
|
93
|
+
muted: Hn,
|
|
94
|
+
danger: On,
|
|
95
|
+
srOnly: Fn
|
|
96
|
+
}, jn = $e(
|
|
97
97
|
({
|
|
98
98
|
variant: e = "default",
|
|
99
99
|
external: t = !1,
|
|
@@ -119,32 +119,32 @@ const Pn = "crk-root-2j4Vp", Wn = "crk-muted-vReNc", Hn = "crk-danger-ugf9r", On
|
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
root:
|
|
125
|
-
h1:
|
|
126
|
-
h2:
|
|
127
|
-
h3:
|
|
128
|
-
h4:
|
|
122
|
+
jn.displayName = "Link";
|
|
123
|
+
const Xn = "crk-root-U-oiq", Un = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", zn = "crk-h3-lrbrK", Vn = "crk-h4--jkC1", Yn = "crk-h5-GnQvD", qn = "crk-h6-MKlIN", Gn = "crk-p-FzRtm", Zn = "crk-span-NZvLx", Kn = "crk-label-Cwi6a", Qn = "crk-normal-7AeZz", Jn = "crk-medium-36OXr", er = "crk-semibold-oQixc", tr = "crk-bold-bk4b4", nr = "crk-muted-itOSW", rr = "crk-primary-rp36t", or = "crk-danger-SyOy-", cr = "crk-success-w8PpD", ir = "crk-align-left-3AGYw", lr = "crk-align-center-h-x--", sr = "crk-align-right-IXFhK", ar = "crk-truncate-eqr85", _e = {
|
|
124
|
+
root: Xn,
|
|
125
|
+
h1: Un,
|
|
126
|
+
h2: _n,
|
|
127
|
+
h3: zn,
|
|
128
|
+
h4: Vn,
|
|
129
129
|
h5: Yn,
|
|
130
|
-
h6:
|
|
131
|
-
p:
|
|
132
|
-
span:
|
|
133
|
-
label:
|
|
134
|
-
normal:
|
|
135
|
-
medium:
|
|
136
|
-
semibold:
|
|
137
|
-
bold:
|
|
130
|
+
h6: qn,
|
|
131
|
+
p: Gn,
|
|
132
|
+
span: Zn,
|
|
133
|
+
label: Kn,
|
|
134
|
+
normal: Qn,
|
|
135
|
+
medium: Jn,
|
|
136
|
+
semibold: er,
|
|
137
|
+
bold: tr,
|
|
138
138
|
default: "crk-default-79lKR",
|
|
139
|
-
muted:
|
|
140
|
-
primary:
|
|
141
|
-
danger:
|
|
142
|
-
success:
|
|
143
|
-
alignLeft:
|
|
144
|
-
alignCenter:
|
|
145
|
-
alignRight:
|
|
146
|
-
truncate:
|
|
147
|
-
},
|
|
139
|
+
muted: nr,
|
|
140
|
+
primary: rr,
|
|
141
|
+
danger: or,
|
|
142
|
+
success: cr,
|
|
143
|
+
alignLeft: ir,
|
|
144
|
+
alignCenter: lr,
|
|
145
|
+
alignRight: sr,
|
|
146
|
+
truncate: ar
|
|
147
|
+
}, dr = $e(
|
|
148
148
|
({
|
|
149
149
|
variant: e = "p",
|
|
150
150
|
weight: t,
|
|
@@ -155,7 +155,7 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", Un = "crk-h2-CV8Oo", _n = "crk
|
|
|
155
155
|
style: c,
|
|
156
156
|
children: l,
|
|
157
157
|
...a
|
|
158
|
-
}, h) =>
|
|
158
|
+
}, h) => ln(
|
|
159
159
|
e,
|
|
160
160
|
{
|
|
161
161
|
ref: h,
|
|
@@ -174,17 +174,17 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", Un = "crk-h2-CV8Oo", _n = "crk
|
|
|
174
174
|
l
|
|
175
175
|
)
|
|
176
176
|
);
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
root:
|
|
180
|
-
unordered:
|
|
181
|
-
item:
|
|
182
|
-
ordered:
|
|
183
|
-
none:
|
|
184
|
-
sm:
|
|
185
|
-
md:
|
|
186
|
-
lg:
|
|
187
|
-
},
|
|
177
|
+
dr.displayName = "Typography";
|
|
178
|
+
const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82", fr = "crk-ordered-8x4YC", pr = "crk-none-f03Kx", gr = "crk-sm-Rg4Mv", yr = "crk-md-X4Icb", vr = "crk-lg-JjNKZ", ut = {
|
|
179
|
+
root: ur,
|
|
180
|
+
unordered: hr,
|
|
181
|
+
item: mr,
|
|
182
|
+
ordered: fr,
|
|
183
|
+
none: pr,
|
|
184
|
+
sm: gr,
|
|
185
|
+
md: yr,
|
|
186
|
+
lg: vr
|
|
187
|
+
}, br = $e(
|
|
188
188
|
({
|
|
189
189
|
variant: e = "unordered",
|
|
190
190
|
spacing: t = "md",
|
|
@@ -208,8 +208,8 @@ const dr = "crk-root-PVrgx", ur = "crk-unordered-FhCWT", hr = "crk-item-TfW82",
|
|
|
208
208
|
}
|
|
209
209
|
)
|
|
210
210
|
);
|
|
211
|
-
|
|
212
|
-
const
|
|
211
|
+
br.displayName = "List";
|
|
212
|
+
const xr = $e(
|
|
213
213
|
({ className: e, style: t, children: n, ...r }, o) => /* @__PURE__ */ s(
|
|
214
214
|
"li",
|
|
215
215
|
{
|
|
@@ -221,65 +221,65 @@ const br = $e(
|
|
|
221
221
|
}
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
wrapper:
|
|
227
|
-
root:
|
|
228
|
-
headerCell:
|
|
229
|
-
headerCellSortable:
|
|
230
|
-
sortIndicator:
|
|
231
|
-
sortArrow:
|
|
232
|
-
sortArrowActive:
|
|
233
|
-
sortIndex:
|
|
234
|
-
row:
|
|
235
|
-
cell:
|
|
236
|
-
emptyRow:
|
|
237
|
-
emptyCell:
|
|
238
|
-
striped:
|
|
239
|
-
hoverable:
|
|
240
|
-
compact:
|
|
241
|
-
paginator:
|
|
242
|
-
paginatorInfo:
|
|
243
|
-
paginatorText:
|
|
244
|
-
pageSizeSelect:
|
|
245
|
-
paginatorNav:
|
|
246
|
-
pageButton:
|
|
247
|
-
pageButtonActive:
|
|
248
|
-
pageEllipsis:
|
|
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", Sr = "crk-sortArrowActive-yhWrO", Tr = "crk-sortIndex-HGoca", Rr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Dr = "crk-striped-6Qckq", Ir = "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", jr = "crk-pageButton-1PX-g", Xr = "crk-pageButtonActive--D7Q7", Ur = "crk-pageEllipsis-en59J", ye = {
|
|
226
|
+
wrapper: kr,
|
|
227
|
+
root: Mr,
|
|
228
|
+
headerCell: wr,
|
|
229
|
+
headerCellSortable: $r,
|
|
230
|
+
sortIndicator: Nr,
|
|
231
|
+
sortArrow: Lr,
|
|
232
|
+
sortArrowActive: Sr,
|
|
233
|
+
sortIndex: Tr,
|
|
234
|
+
row: Rr,
|
|
235
|
+
cell: Cr,
|
|
236
|
+
emptyRow: Ar,
|
|
237
|
+
emptyCell: Br,
|
|
238
|
+
striped: Dr,
|
|
239
|
+
hoverable: Ir,
|
|
240
|
+
compact: Er,
|
|
241
|
+
paginator: Pr,
|
|
242
|
+
paginatorInfo: Wr,
|
|
243
|
+
paginatorText: Hr,
|
|
244
|
+
pageSizeSelect: Or,
|
|
245
|
+
paginatorNav: Fr,
|
|
246
|
+
pageButton: jr,
|
|
247
|
+
pageButtonActive: Xr,
|
|
248
|
+
pageEllipsis: Ur
|
|
249
249
|
};
|
|
250
|
-
function
|
|
250
|
+
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
|
-
function
|
|
253
|
+
function zr(e, t = []) {
|
|
254
254
|
const [n, r] = Se(t), o = he((a) => {
|
|
255
255
|
r((h) => {
|
|
256
|
-
const
|
|
257
|
-
return
|
|
256
|
+
const d = h.find((u) => u.key === a);
|
|
257
|
+
return d ? d.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
258
258
|
});
|
|
259
259
|
}, []), i = he((a) => {
|
|
260
260
|
r((h) => {
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
261
|
+
const d = h.findIndex((m) => m.key === a);
|
|
262
|
+
if (d === -1)
|
|
263
263
|
return [...h, { key: a, direction: "asc" }];
|
|
264
|
-
if (h[
|
|
264
|
+
if (h[d].direction === "asc") {
|
|
265
265
|
const m = [...h];
|
|
266
|
-
return m[
|
|
266
|
+
return m[d] = { key: a, direction: "desc" }, m;
|
|
267
267
|
}
|
|
268
|
-
return h.filter((m, p) => p !==
|
|
268
|
+
return h.filter((m, p) => p !== d);
|
|
269
269
|
});
|
|
270
270
|
}, []), c = he(() => {
|
|
271
271
|
r([]);
|
|
272
272
|
}, []);
|
|
273
273
|
return { sortedData: ke(() => n.length === 0 ? e : [...e].sort((a, h) => {
|
|
274
|
-
for (const { key:
|
|
275
|
-
const m =
|
|
274
|
+
for (const { key: d, direction: u } of n) {
|
|
275
|
+
const m = _r(a[d], h[d]);
|
|
276
276
|
if (m !== 0)
|
|
277
|
-
return
|
|
277
|
+
return u === "asc" ? m : -m;
|
|
278
278
|
}
|
|
279
279
|
return 0;
|
|
280
280
|
}), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: i, resetSort: c };
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Vr({ direction: e, sortIndex: t }) {
|
|
283
283
|
return /* @__PURE__ */ H("span", { className: ye.sortIndicator, "aria-hidden": "true", children: [
|
|
284
284
|
/* @__PURE__ */ s("span", { className: f(ye.sortArrow, e === "asc" && ye.sortArrowActive), children: "▲" }),
|
|
285
285
|
/* @__PURE__ */ s("span", { className: f(ye.sortArrow, e === "desc" && ye.sortArrowActive), children: "▼" }),
|
|
@@ -295,16 +295,16 @@ function Yr({
|
|
|
295
295
|
paginatorClasses: i
|
|
296
296
|
}) {
|
|
297
297
|
const c = Math.max(1, Math.ceil(n / t)), l = (e - 1) * t + 1, a = Math.min(e * t, n), h = ke(() => {
|
|
298
|
-
const
|
|
298
|
+
const d = [];
|
|
299
299
|
if (c <= 7)
|
|
300
|
-
for (let
|
|
300
|
+
for (let u = 1; u <= c; u++) d.push(u);
|
|
301
301
|
else {
|
|
302
|
-
|
|
303
|
-
for (let
|
|
304
|
-
|
|
305
|
-
e < c - 2 &&
|
|
302
|
+
d.push(1), e > 3 && d.push("ellipsis");
|
|
303
|
+
for (let u = Math.max(2, e - 1); u <= Math.min(c - 1, e + 1); u++)
|
|
304
|
+
d.push(u);
|
|
305
|
+
e < c - 2 && d.push("ellipsis"), d.push(c);
|
|
306
306
|
}
|
|
307
|
-
return
|
|
307
|
+
return d;
|
|
308
308
|
}, [e, c]);
|
|
309
309
|
return /* @__PURE__ */ H("nav", { className: f(ye.paginator, i?.paginator), "aria-label": "Table pagination", children: [
|
|
310
310
|
/* @__PURE__ */ H("div", { className: ye.paginatorInfo, children: [
|
|
@@ -314,12 +314,12 @@ function Yr({
|
|
|
314
314
|
{
|
|
315
315
|
className: ye.pageSizeSelect,
|
|
316
316
|
value: t,
|
|
317
|
-
onChange: (
|
|
317
|
+
onChange: (d) => o(1, Number(d.target.value)),
|
|
318
318
|
"aria-label": "Rows per page",
|
|
319
|
-
children: r.map((
|
|
320
|
-
|
|
319
|
+
children: r.map((d) => /* @__PURE__ */ H("option", { value: d, children: [
|
|
320
|
+
d,
|
|
321
321
|
" / page"
|
|
322
|
-
] },
|
|
322
|
+
] }, d))
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }),
|
|
@@ -336,17 +336,17 @@ function Yr({
|
|
|
336
336
|
}
|
|
337
337
|
),
|
|
338
338
|
h.map(
|
|
339
|
-
(
|
|
339
|
+
(d, u) => d === "ellipsis" ? /* @__PURE__ */ s("span", { className: ye.pageEllipsis, children: "…" }, `ellipsis-${u}`) : /* @__PURE__ */ s(
|
|
340
340
|
"button",
|
|
341
341
|
{
|
|
342
342
|
type: "button",
|
|
343
|
-
className: f(ye.pageButton,
|
|
344
|
-
onClick: () => o(
|
|
345
|
-
"aria-label": `Page ${
|
|
346
|
-
"aria-current":
|
|
347
|
-
children:
|
|
343
|
+
className: f(ye.pageButton, d === e && ye.pageButtonActive, i?.pageButton),
|
|
344
|
+
onClick: () => o(d, t),
|
|
345
|
+
"aria-label": `Page ${d}`,
|
|
346
|
+
"aria-current": d === e ? "page" : void 0,
|
|
347
|
+
children: d
|
|
348
348
|
},
|
|
349
|
-
|
|
349
|
+
d
|
|
350
350
|
)
|
|
351
351
|
),
|
|
352
352
|
/* @__PURE__ */ s(
|
|
@@ -363,7 +363,7 @@ function Yr({
|
|
|
363
363
|
] })
|
|
364
364
|
] });
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function qr({
|
|
367
367
|
data: e,
|
|
368
368
|
columns: t,
|
|
369
369
|
sortConfig: n,
|
|
@@ -374,48 +374,48 @@ function Vr({
|
|
|
374
374
|
compact: l = !1,
|
|
375
375
|
className: a,
|
|
376
376
|
style: h,
|
|
377
|
-
rowKey:
|
|
378
|
-
emptyMessage:
|
|
377
|
+
rowKey: d,
|
|
378
|
+
emptyMessage: u = "No data",
|
|
379
379
|
pagination: m,
|
|
380
380
|
classes: p
|
|
381
381
|
}) {
|
|
382
382
|
const y = r !== void 0, {
|
|
383
|
-
sortedData:
|
|
384
|
-
sortConfig:
|
|
385
|
-
requestSort:
|
|
386
|
-
requestMultiSort:
|
|
387
|
-
} =
|
|
388
|
-
if (!m || y) return
|
|
389
|
-
const
|
|
390
|
-
return
|
|
391
|
-
}, [
|
|
392
|
-
(
|
|
393
|
-
const
|
|
383
|
+
sortedData: w,
|
|
384
|
+
sortConfig: N,
|
|
385
|
+
requestSort: S,
|
|
386
|
+
requestMultiSort: O
|
|
387
|
+
} = zr(e, n), P = y ? n ?? [] : N, U = y ? e : w, re = ke(() => {
|
|
388
|
+
if (!m || y) return U;
|
|
389
|
+
const M = (m.page - 1) * m.pageSize;
|
|
390
|
+
return U.slice(M, M + m.pageSize);
|
|
391
|
+
}, [U, m, y]), D = m?.totalRows ?? U.length, C = he(
|
|
392
|
+
(M, q) => {
|
|
393
|
+
const I = o && (q.ctrlKey || q.metaKey);
|
|
394
394
|
if (y)
|
|
395
|
-
if (
|
|
396
|
-
const Q =
|
|
397
|
-
let
|
|
398
|
-
Q === -1 ?
|
|
399
|
-
(
|
|
400
|
-
) :
|
|
395
|
+
if (I) {
|
|
396
|
+
const Q = P.findIndex((W) => W.key === M);
|
|
397
|
+
let F;
|
|
398
|
+
Q === -1 ? F = [...P, { key: M, direction: "asc" }] : P[Q].direction === "asc" ? F = P.map(
|
|
399
|
+
(W, te) => te === Q ? { key: M, direction: "desc" } : W
|
|
400
|
+
) : F = P.filter((W, te) => te !== Q), r(F);
|
|
401
401
|
} else {
|
|
402
|
-
const Q =
|
|
403
|
-
Q ? Q.direction === "asc" ? r([{ key:
|
|
402
|
+
const Q = P.find((F) => F.key === M);
|
|
403
|
+
Q ? Q.direction === "asc" ? r([{ key: M, direction: "desc" }]) : r([]) : r([{ key: M, direction: "asc" }]);
|
|
404
404
|
}
|
|
405
405
|
else
|
|
406
|
-
|
|
406
|
+
I ? O(M) : S(M);
|
|
407
407
|
},
|
|
408
408
|
[
|
|
409
409
|
y,
|
|
410
410
|
o,
|
|
411
|
-
|
|
411
|
+
P,
|
|
412
412
|
r,
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
S,
|
|
414
|
+
O
|
|
415
415
|
]
|
|
416
|
-
),
|
|
417
|
-
if (
|
|
418
|
-
const q =
|
|
416
|
+
), ee = (M) => P.find((I) => I.key === M)?.direction, se = (M) => {
|
|
417
|
+
if (P.length <= 1) return;
|
|
418
|
+
const q = P.findIndex((I) => I.key === M);
|
|
419
419
|
return q >= 0 ? q : void 0;
|
|
420
420
|
};
|
|
421
421
|
return /* @__PURE__ */ H("div", { className: f(ye.wrapper, p?.wrapper), children: [
|
|
@@ -432,44 +432,44 @@ function Vr({
|
|
|
432
432
|
),
|
|
433
433
|
style: h,
|
|
434
434
|
children: [
|
|
435
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((
|
|
435
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((M) => /* @__PURE__ */ H(
|
|
436
436
|
"th",
|
|
437
437
|
{
|
|
438
438
|
className: f(
|
|
439
439
|
ye.headerCell,
|
|
440
|
-
|
|
440
|
+
M.sortable && ye.headerCellSortable,
|
|
441
441
|
p?.headerCell
|
|
442
442
|
),
|
|
443
443
|
style: {
|
|
444
|
-
width:
|
|
445
|
-
textAlign:
|
|
444
|
+
width: M.width,
|
|
445
|
+
textAlign: M.align
|
|
446
446
|
},
|
|
447
|
-
onClick:
|
|
448
|
-
"aria-sort":
|
|
447
|
+
onClick: M.sortable ? (q) => C(M.key, q) : void 0,
|
|
448
|
+
"aria-sort": M.sortable ? ee(M.key) === "asc" ? "ascending" : ee(M.key) === "desc" ? "descending" : "none" : void 0,
|
|
449
449
|
children: [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
M.header,
|
|
451
|
+
M.sortable && /* @__PURE__ */ s(
|
|
452
|
+
Vr,
|
|
453
453
|
{
|
|
454
|
-
direction:
|
|
455
|
-
sortIndex:
|
|
454
|
+
direction: ee(M.key),
|
|
455
|
+
sortIndex: se(M.key)
|
|
456
456
|
}
|
|
457
457
|
)
|
|
458
458
|
]
|
|
459
459
|
},
|
|
460
|
-
|
|
460
|
+
M.key
|
|
461
461
|
)) }) }),
|
|
462
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
463
|
-
const
|
|
462
|
+
/* @__PURE__ */ s("tbody", { children: re.length === 0 ? /* @__PURE__ */ s("tr", { className: ye.emptyRow, children: /* @__PURE__ */ s("td", { className: f(ye.emptyCell, p?.emptyCell), colSpan: t.length, children: u }) }) : re.map((M, q) => {
|
|
463
|
+
const I = d ? String(M[d]) : q;
|
|
464
464
|
return /* @__PURE__ */ s("tr", { className: f(ye.row, p?.row), children: t.map((Q) => /* @__PURE__ */ s(
|
|
465
465
|
"td",
|
|
466
466
|
{
|
|
467
467
|
className: f(ye.cell, p?.cell),
|
|
468
468
|
style: { textAlign: Q.align },
|
|
469
|
-
children: Q.render ? Q.render(
|
|
469
|
+
children: Q.render ? Q.render(M[Q.key], M, q) : M[Q.key]
|
|
470
470
|
},
|
|
471
471
|
Q.key
|
|
472
|
-
)) },
|
|
472
|
+
)) }, I);
|
|
473
473
|
}) })
|
|
474
474
|
]
|
|
475
475
|
}
|
|
@@ -478,28 +478,28 @@ function Vr({
|
|
|
478
478
|
Yr,
|
|
479
479
|
{
|
|
480
480
|
...m,
|
|
481
|
-
totalRows:
|
|
481
|
+
totalRows: D,
|
|
482
482
|
paginatorClasses: { paginator: p?.paginator, pageButton: p?.pageButton }
|
|
483
483
|
}
|
|
484
484
|
)
|
|
485
485
|
] });
|
|
486
486
|
}
|
|
487
|
-
const
|
|
488
|
-
root:
|
|
489
|
-
fullWidth:
|
|
490
|
-
trigger:
|
|
491
|
-
triggerOpen:
|
|
492
|
-
triggerLabel:
|
|
493
|
-
triggerError:
|
|
494
|
-
placeholder:
|
|
495
|
-
chevron:
|
|
496
|
-
menu:
|
|
497
|
-
menuOpen:
|
|
498
|
-
alignLeft:
|
|
499
|
-
alignRight:
|
|
500
|
-
item:
|
|
501
|
-
itemDisabled:
|
|
502
|
-
itemSelected:
|
|
487
|
+
const Il = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", co = "crk-alignLeft-buCDJ", io = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo", Me = {
|
|
488
|
+
root: Gr,
|
|
489
|
+
fullWidth: Zr,
|
|
490
|
+
trigger: Kr,
|
|
491
|
+
triggerOpen: Qr,
|
|
492
|
+
triggerLabel: Jr,
|
|
493
|
+
triggerError: eo,
|
|
494
|
+
placeholder: to,
|
|
495
|
+
chevron: no,
|
|
496
|
+
menu: ro,
|
|
497
|
+
menuOpen: oo,
|
|
498
|
+
alignLeft: co,
|
|
499
|
+
alignRight: io,
|
|
500
|
+
item: lo,
|
|
501
|
+
itemDisabled: so,
|
|
502
|
+
itemSelected: ao
|
|
503
503
|
};
|
|
504
504
|
function pt(e, t, n = !0) {
|
|
505
505
|
Be(() => {
|
|
@@ -527,7 +527,7 @@ function Tt(e, t = !0) {
|
|
|
527
527
|
};
|
|
528
528
|
}, [t, n]);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const zt = $e(
|
|
531
531
|
({
|
|
532
532
|
trigger: e,
|
|
533
533
|
children: t,
|
|
@@ -539,62 +539,62 @@ const _t = $e(
|
|
|
539
539
|
onClose: l,
|
|
540
540
|
options: a,
|
|
541
541
|
placeholder: h = "Select...",
|
|
542
|
-
value:
|
|
543
|
-
onChange:
|
|
542
|
+
value: d,
|
|
543
|
+
onChange: u,
|
|
544
544
|
error: m = !1,
|
|
545
545
|
fullWidth: p = !0,
|
|
546
546
|
classes: y
|
|
547
|
-
},
|
|
548
|
-
const [
|
|
547
|
+
}, w) => {
|
|
548
|
+
const [N, S] = Se(!1), O = ne(null), P = ne(null), U = ne(null), re = ze();
|
|
549
549
|
Be(() => {
|
|
550
|
-
|
|
551
|
-
}, [
|
|
552
|
-
const
|
|
553
|
-
|
|
550
|
+
N && P.current && P.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
551
|
+
}, [N]);
|
|
552
|
+
const D = he(() => {
|
|
553
|
+
S(!1), l?.(), U.current?.focus();
|
|
554
554
|
}, [l]), C = he(() => {
|
|
555
|
-
|
|
556
|
-
const Q = !
|
|
555
|
+
S((I) => {
|
|
556
|
+
const Q = !I;
|
|
557
557
|
return Q ? c?.() : l?.(), Q;
|
|
558
558
|
});
|
|
559
|
-
}, [c, l]),
|
|
560
|
-
(
|
|
561
|
-
|
|
559
|
+
}, [c, l]), ee = he(
|
|
560
|
+
(I) => {
|
|
561
|
+
u?.(I), D();
|
|
562
562
|
},
|
|
563
|
-
[
|
|
563
|
+
[u, D]
|
|
564
564
|
);
|
|
565
|
-
pt(
|
|
565
|
+
pt(O, D, N), Tt(
|
|
566
566
|
{
|
|
567
|
-
Escape: () =>
|
|
567
|
+
Escape: () => D()
|
|
568
568
|
},
|
|
569
|
-
|
|
569
|
+
N
|
|
570
570
|
);
|
|
571
|
-
const
|
|
571
|
+
const se = a?.find((I) => I.value === d)?.label, M = a ? se || h : e, q = a && !se;
|
|
572
572
|
return /* @__PURE__ */ s(
|
|
573
573
|
"div",
|
|
574
574
|
{
|
|
575
|
-
ref:
|
|
575
|
+
ref: w,
|
|
576
576
|
className: f(Me.root, p && Me.fullWidth, y?.root, r),
|
|
577
577
|
style: o,
|
|
578
|
-
children: /* @__PURE__ */ H("div", { ref:
|
|
578
|
+
children: /* @__PURE__ */ H("div", { ref: O, style: p ? { width: "100%" } : void 0, children: [
|
|
579
579
|
/* @__PURE__ */ H(
|
|
580
580
|
"button",
|
|
581
581
|
{
|
|
582
|
-
ref:
|
|
582
|
+
ref: U,
|
|
583
583
|
id: i,
|
|
584
584
|
type: "button",
|
|
585
585
|
className: f(
|
|
586
586
|
Me.trigger,
|
|
587
|
-
|
|
587
|
+
N && Me.triggerOpen,
|
|
588
588
|
m && Me.triggerError,
|
|
589
589
|
p && Me.fullWidth,
|
|
590
590
|
y?.trigger
|
|
591
591
|
),
|
|
592
592
|
onClick: C,
|
|
593
|
-
"aria-expanded":
|
|
593
|
+
"aria-expanded": N,
|
|
594
594
|
"aria-haspopup": "menu",
|
|
595
|
-
"aria-controls":
|
|
595
|
+
"aria-controls": N ? re : void 0,
|
|
596
596
|
children: [
|
|
597
|
-
/* @__PURE__ */ s("span", { className: f(Me.triggerLabel, q && Me.placeholder, y?.triggerLabel), children:
|
|
597
|
+
/* @__PURE__ */ s("span", { className: f(Me.triggerLabel, q && Me.placeholder, y?.triggerLabel), children: M }),
|
|
598
598
|
/* @__PURE__ */ s("span", { className: f(Me.chevron, y?.chevron), "aria-hidden": "true" })
|
|
599
599
|
]
|
|
600
600
|
}
|
|
@@ -602,32 +602,32 @@ const _t = $e(
|
|
|
602
602
|
/* @__PURE__ */ s(
|
|
603
603
|
"div",
|
|
604
604
|
{
|
|
605
|
-
ref:
|
|
606
|
-
id:
|
|
605
|
+
ref: P,
|
|
606
|
+
id: re,
|
|
607
607
|
className: f(
|
|
608
608
|
Me.menu,
|
|
609
|
-
|
|
609
|
+
N && Me.menuOpen,
|
|
610
610
|
n === "left" ? Me.alignLeft : Me.alignRight,
|
|
611
611
|
p && Me.fullWidth,
|
|
612
612
|
y?.menu
|
|
613
613
|
),
|
|
614
614
|
role: "menu",
|
|
615
|
-
children: a ? a.map((
|
|
615
|
+
children: a ? a.map((I) => /* @__PURE__ */ s(
|
|
616
616
|
"button",
|
|
617
617
|
{
|
|
618
618
|
type: "button",
|
|
619
619
|
role: "menuitem",
|
|
620
620
|
className: f(
|
|
621
621
|
Me.item,
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
I.disabled && Me.itemDisabled,
|
|
623
|
+
I.value === d && Me.itemSelected,
|
|
624
624
|
y?.item
|
|
625
625
|
),
|
|
626
|
-
disabled:
|
|
627
|
-
onClick: () =>
|
|
628
|
-
children:
|
|
626
|
+
disabled: I.disabled,
|
|
627
|
+
onClick: () => ee(I.value),
|
|
628
|
+
children: I.label
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
I.value
|
|
631
631
|
)) : t
|
|
632
632
|
}
|
|
633
633
|
)
|
|
@@ -636,8 +636,8 @@ const _t = $e(
|
|
|
636
636
|
);
|
|
637
637
|
}
|
|
638
638
|
);
|
|
639
|
-
|
|
640
|
-
const
|
|
639
|
+
zt.displayName = "Dropdown";
|
|
640
|
+
const uo = $e(
|
|
641
641
|
({
|
|
642
642
|
disabled: e = !1,
|
|
643
643
|
className: t,
|
|
@@ -660,78 +660,102 @@ const ao = $e(
|
|
|
660
660
|
}
|
|
661
661
|
)
|
|
662
662
|
);
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
root:
|
|
666
|
-
trigger:
|
|
667
|
-
popover:
|
|
668
|
-
popoverFade:
|
|
669
|
-
bottom:
|
|
670
|
-
top:
|
|
671
|
-
left:
|
|
672
|
-
right:
|
|
673
|
-
}
|
|
663
|
+
uo.displayName = "DropdownItem";
|
|
664
|
+
const ho = "crk-root-8H-L9", mo = "crk-trigger-Zn1nQ", fo = "crk-popover-rvS3X", po = "crk-popoverFade-hj41M", go = "crk-bottom-lawQw", yo = "crk-top-rqvC6", vo = "crk-left-J6exv", bo = "crk-right-3y20l", at = {
|
|
665
|
+
root: ho,
|
|
666
|
+
trigger: mo,
|
|
667
|
+
popover: fo,
|
|
668
|
+
popoverFade: po,
|
|
669
|
+
bottom: go,
|
|
670
|
+
top: yo,
|
|
671
|
+
left: vo,
|
|
672
|
+
right: bo
|
|
673
|
+
};
|
|
674
|
+
function xo(...e) {
|
|
675
|
+
return (t) => {
|
|
676
|
+
for (const n of e)
|
|
677
|
+
n && (typeof n == "function" ? n(t) : n.current = t);
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
const Vt = $e(
|
|
674
681
|
({
|
|
675
682
|
trigger: e,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
683
|
+
asChild: t = !1,
|
|
684
|
+
content: n,
|
|
685
|
+
position: r = "bottom",
|
|
686
|
+
open: o,
|
|
687
|
+
onOpenChange: i,
|
|
688
|
+
classes: c,
|
|
689
|
+
className: l,
|
|
690
|
+
style: a
|
|
691
|
+
}, h) => {
|
|
692
|
+
const [d, u] = Se(!1), m = ne(null), p = ne(null), y = ne(null), w = ze(), N = o !== void 0, S = N ? o : d, O = he(
|
|
693
|
+
(D) => {
|
|
694
|
+
N || u(D), i?.(D);
|
|
687
695
|
},
|
|
688
|
-
[
|
|
689
|
-
),
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
|
|
693
|
-
}, [
|
|
694
|
-
|
|
696
|
+
[N, i]
|
|
697
|
+
), P = he(() => {
|
|
698
|
+
O(!1), y.current?.focus();
|
|
699
|
+
}, [O]), U = he(() => {
|
|
700
|
+
O(!S);
|
|
701
|
+
}, [S, O]);
|
|
702
|
+
pt(m, P, S), Tt(
|
|
695
703
|
{
|
|
696
|
-
Escape: () =>
|
|
704
|
+
Escape: () => P()
|
|
697
705
|
},
|
|
698
|
-
|
|
706
|
+
S
|
|
699
707
|
), Be(() => {
|
|
700
|
-
if (
|
|
701
|
-
const
|
|
708
|
+
if (S && p.current) {
|
|
709
|
+
const D = p.current.querySelector(
|
|
702
710
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
703
711
|
);
|
|
704
|
-
|
|
712
|
+
D ? D.focus() : p.current.focus();
|
|
705
713
|
}
|
|
706
|
-
}, [
|
|
714
|
+
}, [S]);
|
|
715
|
+
let re;
|
|
716
|
+
if (t && sn(e)) {
|
|
717
|
+
const D = e, C = D.ref;
|
|
718
|
+
re = jt(D, {
|
|
719
|
+
ref: xo(y, C),
|
|
720
|
+
onClick: (ee) => {
|
|
721
|
+
D.props.onClick?.(ee), U();
|
|
722
|
+
},
|
|
723
|
+
className: f(D.props.className, c?.trigger),
|
|
724
|
+
"aria-expanded": S,
|
|
725
|
+
"aria-haspopup": "dialog",
|
|
726
|
+
"aria-controls": S ? w : void 0
|
|
727
|
+
});
|
|
728
|
+
} else
|
|
729
|
+
re = /* @__PURE__ */ s(
|
|
730
|
+
"button",
|
|
731
|
+
{
|
|
732
|
+
ref: y,
|
|
733
|
+
type: "button",
|
|
734
|
+
className: f(at.trigger, c?.trigger),
|
|
735
|
+
onClick: U,
|
|
736
|
+
"aria-expanded": S,
|
|
737
|
+
"aria-haspopup": "dialog",
|
|
738
|
+
"aria-controls": S ? w : void 0,
|
|
739
|
+
children: e
|
|
740
|
+
}
|
|
741
|
+
);
|
|
742
|
+
return /* @__PURE__ */ s(
|
|
707
743
|
"div",
|
|
708
744
|
{
|
|
709
|
-
ref:
|
|
710
|
-
className: f(at.root,
|
|
711
|
-
style:
|
|
712
|
-
children: /* @__PURE__ */ H("div", { ref:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
{
|
|
716
|
-
ref: p,
|
|
717
|
-
type: "button",
|
|
718
|
-
className: f(at.trigger, i?.trigger),
|
|
719
|
-
onClick: E,
|
|
720
|
-
"aria-expanded": k,
|
|
721
|
-
"aria-haspopup": "dialog",
|
|
722
|
-
"aria-controls": k ? y : void 0,
|
|
723
|
-
children: e
|
|
724
|
-
}
|
|
725
|
-
),
|
|
726
|
-
k && /* @__PURE__ */ s(
|
|
745
|
+
ref: h,
|
|
746
|
+
className: f(at.root, c?.root, l),
|
|
747
|
+
style: a,
|
|
748
|
+
children: /* @__PURE__ */ H("div", { ref: m, children: [
|
|
749
|
+
re,
|
|
750
|
+
S && /* @__PURE__ */ s(
|
|
727
751
|
"div",
|
|
728
752
|
{
|
|
729
|
-
ref:
|
|
730
|
-
id:
|
|
753
|
+
ref: p,
|
|
754
|
+
id: w,
|
|
731
755
|
role: "dialog",
|
|
732
756
|
tabIndex: -1,
|
|
733
|
-
className: f(at.popover, at[
|
|
734
|
-
children:
|
|
757
|
+
className: f(at.popover, at[r], c?.popover),
|
|
758
|
+
children: n
|
|
735
759
|
}
|
|
736
760
|
)
|
|
737
761
|
] })
|
|
@@ -739,7 +763,7 @@ const uo = "crk-root-8H-L9", ho = "crk-trigger-Zn1nQ", mo = "crk-popover-rvS3X",
|
|
|
739
763
|
);
|
|
740
764
|
}
|
|
741
765
|
);
|
|
742
|
-
|
|
766
|
+
Vt.displayName = "Popover";
|
|
743
767
|
const Bt = [
|
|
744
768
|
'input:not([disabled]):not([type="hidden"])',
|
|
745
769
|
"button:not([disabled])",
|
|
@@ -748,8 +772,8 @@ const Bt = [
|
|
|
748
772
|
"a[href]",
|
|
749
773
|
'[tabindex]:not([tabindex="-1"])'
|
|
750
774
|
].join(", ");
|
|
751
|
-
function
|
|
752
|
-
const n =
|
|
775
|
+
function ko(e, t) {
|
|
776
|
+
const n = ne(null), r = he(
|
|
753
777
|
(o) => {
|
|
754
778
|
if (o.key !== "Tab" || !e.current)
|
|
755
779
|
return;
|
|
@@ -775,21 +799,21 @@ function bo(e, t) {
|
|
|
775
799
|
};
|
|
776
800
|
}, [t, e, r]);
|
|
777
801
|
}
|
|
778
|
-
const
|
|
779
|
-
backdrop:
|
|
780
|
-
backdropIn:
|
|
781
|
-
modal:
|
|
782
|
-
modalIn:
|
|
783
|
-
sm:
|
|
784
|
-
md:
|
|
785
|
-
lg:
|
|
786
|
-
fullscreen:
|
|
787
|
-
header:
|
|
788
|
-
headerWithClose:
|
|
789
|
-
closeButton:
|
|
790
|
-
body:
|
|
791
|
-
footer:
|
|
792
|
-
}, gt =
|
|
802
|
+
const Mo = "crk-backdrop-jYpTA", wo = "crk-backdropIn-x5Z-A", $o = "crk-modal-yNG-7", No = "crk-modalIn-xFUwm", Lo = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Ro = "crk-fullscreen-b4jQ-", Co = "crk-header-NS30G", Ao = "crk-headerWithClose-4davm", Bo = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Io = "crk-footer-Oyz-R", je = {
|
|
803
|
+
backdrop: Mo,
|
|
804
|
+
backdropIn: wo,
|
|
805
|
+
modal: $o,
|
|
806
|
+
modalIn: No,
|
|
807
|
+
sm: Lo,
|
|
808
|
+
md: So,
|
|
809
|
+
lg: To,
|
|
810
|
+
fullscreen: Ro,
|
|
811
|
+
header: Co,
|
|
812
|
+
headerWithClose: Ao,
|
|
813
|
+
closeButton: Bo,
|
|
814
|
+
body: Do,
|
|
815
|
+
footer: Io
|
|
816
|
+
}, gt = Xt({ classes: {}, titleId: "" }), Yt = ({ children: e, className: t, style: n, onClose: r }) => {
|
|
793
817
|
const { classes: o, titleId: i } = ft(gt);
|
|
794
818
|
return /* @__PURE__ */ H(
|
|
795
819
|
"div",
|
|
@@ -814,16 +838,16 @@ const xo = "crk-backdrop-jYpTA", ko = "crk-backdropIn-x5Z-A", Mo = "crk-modal-yN
|
|
|
814
838
|
);
|
|
815
839
|
};
|
|
816
840
|
Yt.displayName = "Modal.Header";
|
|
817
|
-
const
|
|
841
|
+
const qt = ({ children: e, className: t, style: n }) => {
|
|
818
842
|
const { classes: r } = ft(gt);
|
|
819
843
|
return /* @__PURE__ */ s("div", { className: f(je.body, r.body, t), style: n, children: e });
|
|
820
844
|
};
|
|
821
|
-
|
|
822
|
-
const
|
|
845
|
+
qt.displayName = "Modal.Body";
|
|
846
|
+
const Gt = ({ children: e, className: t, style: n }) => {
|
|
823
847
|
const { classes: r } = ft(gt);
|
|
824
848
|
return /* @__PURE__ */ s("div", { className: f(je.footer, r.footer, t), style: n, children: e });
|
|
825
849
|
};
|
|
826
|
-
|
|
850
|
+
Gt.displayName = "Modal.Footer";
|
|
827
851
|
const yt = $e(
|
|
828
852
|
({
|
|
829
853
|
open: e,
|
|
@@ -836,11 +860,11 @@ const yt = $e(
|
|
|
836
860
|
style: l,
|
|
837
861
|
children: a,
|
|
838
862
|
"aria-label": h,
|
|
839
|
-
"aria-labelledby":
|
|
840
|
-
},
|
|
841
|
-
const m =
|
|
842
|
-
|
|
843
|
-
const
|
|
863
|
+
"aria-labelledby": d
|
|
864
|
+
}, u) => {
|
|
865
|
+
const m = ne(null), p = u ?? m, y = ze(), w = d ?? `${y}-title`;
|
|
866
|
+
ko(p, e);
|
|
867
|
+
const N = ke(
|
|
844
868
|
() => ({
|
|
845
869
|
Escape: () => {
|
|
846
870
|
r && t();
|
|
@@ -848,22 +872,22 @@ const yt = $e(
|
|
|
848
872
|
}),
|
|
849
873
|
[r, t]
|
|
850
874
|
);
|
|
851
|
-
Tt(
|
|
875
|
+
Tt(N, e), Be(() => {
|
|
852
876
|
if (!e) return;
|
|
853
|
-
const
|
|
877
|
+
const O = document.body.style.overflow;
|
|
854
878
|
return document.body.style.overflow = "hidden", () => {
|
|
855
|
-
document.body.style.overflow =
|
|
879
|
+
document.body.style.overflow = O;
|
|
856
880
|
};
|
|
857
881
|
}, [e]);
|
|
858
|
-
const
|
|
859
|
-
n &&
|
|
882
|
+
const S = (O) => {
|
|
883
|
+
n && O.target === O.currentTarget && t();
|
|
860
884
|
};
|
|
861
|
-
return e ?
|
|
885
|
+
return e ? fn(
|
|
862
886
|
/* @__PURE__ */ s(
|
|
863
887
|
"div",
|
|
864
888
|
{
|
|
865
889
|
className: f(je.backdrop, i?.backdrop),
|
|
866
|
-
onClick:
|
|
890
|
+
onClick: S,
|
|
867
891
|
role: "presentation",
|
|
868
892
|
children: /* @__PURE__ */ s(
|
|
869
893
|
"div",
|
|
@@ -874,8 +898,8 @@ const yt = $e(
|
|
|
874
898
|
role: "dialog",
|
|
875
899
|
"aria-modal": "true",
|
|
876
900
|
"aria-label": h,
|
|
877
|
-
"aria-labelledby": h ? void 0 :
|
|
878
|
-
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: i ?? {}, titleId:
|
|
901
|
+
"aria-labelledby": h ? void 0 : w,
|
|
902
|
+
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: i ?? {}, titleId: w }, children: a })
|
|
879
903
|
}
|
|
880
904
|
)
|
|
881
905
|
}
|
|
@@ -886,21 +910,21 @@ const yt = $e(
|
|
|
886
910
|
);
|
|
887
911
|
yt.displayName = "Modal";
|
|
888
912
|
yt.Header = Yt;
|
|
889
|
-
yt.Body =
|
|
890
|
-
yt.Footer =
|
|
891
|
-
const
|
|
892
|
-
root:
|
|
893
|
-
formErrors:
|
|
894
|
-
formError:
|
|
895
|
-
field:
|
|
896
|
-
label:
|
|
897
|
-
labelError:
|
|
898
|
-
required:
|
|
899
|
-
error:
|
|
900
|
-
helperText:
|
|
901
|
-
row:
|
|
913
|
+
yt.Body = qt;
|
|
914
|
+
yt.Footer = Gt;
|
|
915
|
+
const Eo = "crk-root-jHIIP", Po = "crk-formErrors-eh-OP", Wo = "crk-formError-XEuWv", Ho = "crk-field-OUlYz", Oo = "crk-label-udkR7", Fo = "crk-labelError-LOgKi", jo = "crk-required-IYiA2", Xo = "crk-error-yFZXm", Uo = "crk-helperText-Dm-rb", _o = "crk-row-nNbx-", We = {
|
|
916
|
+
root: Eo,
|
|
917
|
+
formErrors: Po,
|
|
918
|
+
formError: Wo,
|
|
919
|
+
field: Ho,
|
|
920
|
+
label: Oo,
|
|
921
|
+
labelError: Fo,
|
|
922
|
+
required: jo,
|
|
923
|
+
error: Xo,
|
|
924
|
+
helperText: Uo,
|
|
925
|
+
row: _o
|
|
902
926
|
};
|
|
903
|
-
function
|
|
927
|
+
function El({
|
|
904
928
|
form: e,
|
|
905
929
|
onSubmit: t,
|
|
906
930
|
errors: n,
|
|
@@ -909,7 +933,7 @@ function Bl({
|
|
|
909
933
|
children: i
|
|
910
934
|
}) {
|
|
911
935
|
const c = n && n.length > 0;
|
|
912
|
-
return /* @__PURE__ */ s(
|
|
936
|
+
return /* @__PURE__ */ s(un, { ...e, children: /* @__PURE__ */ H(
|
|
913
937
|
"form",
|
|
914
938
|
{
|
|
915
939
|
onSubmit: e.handleSubmit(t),
|
|
@@ -922,14 +946,14 @@ function Bl({
|
|
|
922
946
|
}
|
|
923
947
|
) });
|
|
924
948
|
}
|
|
925
|
-
const
|
|
949
|
+
const zo = /* @__PURE__ */ new Set([
|
|
926
950
|
"Select",
|
|
927
951
|
"NativeSelect",
|
|
928
952
|
"SearchableSelect",
|
|
929
953
|
"MultiSelect",
|
|
930
954
|
"Dropdown"
|
|
931
955
|
]);
|
|
932
|
-
function
|
|
956
|
+
function Pl({
|
|
933
957
|
name: e,
|
|
934
958
|
label: t,
|
|
935
959
|
helperText: n,
|
|
@@ -940,59 +964,59 @@ function Dl({
|
|
|
940
964
|
style: l,
|
|
941
965
|
children: a
|
|
942
966
|
}) {
|
|
943
|
-
const { control: h } =
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
(
|
|
947
|
-
if (
|
|
948
|
-
const
|
|
949
|
-
|
|
967
|
+
const { control: h } = hn(), { field: d, fieldState: u } = mn({ name: e, control: h, rules: o }), m = a.type, p = typeof m == "string" ? "" : m?.displayName ?? m?.name ?? "", y = zo.has(p), { ref: w, ...N } = d, S = ne(w);
|
|
968
|
+
S.current = w;
|
|
969
|
+
const O = he(
|
|
970
|
+
(P) => {
|
|
971
|
+
if (P) {
|
|
972
|
+
const U = P.matches("input, select, textarea, button, [tabindex]") ? P : P.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
973
|
+
S.current(U ?? P);
|
|
950
974
|
} else
|
|
951
|
-
|
|
975
|
+
S.current(null);
|
|
952
976
|
},
|
|
953
977
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
954
978
|
[]
|
|
955
979
|
);
|
|
956
980
|
return /* @__PURE__ */ H("div", { className: f(We.field, i?.field, c), style: l, children: [
|
|
957
|
-
t && /* @__PURE__ */ H("label", { className: f(We.label,
|
|
981
|
+
t && /* @__PURE__ */ H("label", { className: f(We.label, u.error && We.labelError, i?.label), htmlFor: e, children: [
|
|
958
982
|
t,
|
|
959
983
|
r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
|
|
960
984
|
] }),
|
|
961
|
-
|
|
962
|
-
...
|
|
963
|
-
ref:
|
|
985
|
+
jt(a, {
|
|
986
|
+
...N,
|
|
987
|
+
ref: O,
|
|
964
988
|
id: e,
|
|
965
|
-
error: !!
|
|
966
|
-
"aria-invalid":
|
|
967
|
-
"aria-describedby":
|
|
989
|
+
error: !!u.error,
|
|
990
|
+
"aria-invalid": u.error ? !0 : void 0,
|
|
991
|
+
"aria-describedby": u.error?.message ? `${e}-error` : n ? `${e}-helper` : void 0,
|
|
968
992
|
// Bridge for custom components that use onValueChange/onValuesChange (Select, Dropdown).
|
|
969
993
|
// Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
|
|
970
994
|
// handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
|
|
971
995
|
...y && {
|
|
972
|
-
onValueChange:
|
|
973
|
-
onValuesChange:
|
|
996
|
+
onValueChange: N.onChange,
|
|
997
|
+
onValuesChange: N.onChange
|
|
974
998
|
},
|
|
975
999
|
// Bridge for Checkbox (expects checked, not value)
|
|
976
|
-
checked: typeof
|
|
1000
|
+
checked: typeof N.value == "boolean" ? N.value : void 0
|
|
977
1001
|
}),
|
|
978
|
-
|
|
1002
|
+
u.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: f(We.error, i?.error), role: "alert", children: u.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: f(We.helperText, i?.helperText), children: n }) : null
|
|
979
1003
|
] });
|
|
980
1004
|
}
|
|
981
|
-
function
|
|
1005
|
+
function Wl({ children: e, className: t, style: n }) {
|
|
982
1006
|
return /* @__PURE__ */ s("div", { className: f(We.row, t), style: n, children: e });
|
|
983
1007
|
}
|
|
984
|
-
const
|
|
985
|
-
root:
|
|
986
|
-
wrapper:
|
|
987
|
-
sm:
|
|
988
|
-
md:
|
|
989
|
-
lg:
|
|
990
|
-
error:
|
|
991
|
-
prefix:
|
|
992
|
-
suffix:
|
|
993
|
-
hasPrefix:
|
|
994
|
-
hasSuffix:
|
|
995
|
-
},
|
|
1008
|
+
const Vo = "crk-root-rSgdy", Yo = "crk-wrapper-GHy8V", qo = "crk-sm-DptM5", Go = "crk-md-F4B0G", Zo = "crk-lg-pBxwX", Ko = "crk-error-fucxe", Qo = "crk-prefix-w53Md", Jo = "crk-suffix-fcNgR", ec = "crk-hasPrefix--bqPD", tc = "crk-hasSuffix-zO0nX", Pe = {
|
|
1009
|
+
root: Vo,
|
|
1010
|
+
wrapper: Yo,
|
|
1011
|
+
sm: qo,
|
|
1012
|
+
md: Go,
|
|
1013
|
+
lg: Zo,
|
|
1014
|
+
error: Ko,
|
|
1015
|
+
prefix: Qo,
|
|
1016
|
+
suffix: Jo,
|
|
1017
|
+
hasPrefix: ec,
|
|
1018
|
+
hasSuffix: tc
|
|
1019
|
+
}, nc = $e(
|
|
996
1020
|
({
|
|
997
1021
|
inputSize: e = "md",
|
|
998
1022
|
error: t = !1,
|
|
@@ -1034,41 +1058,41 @@ const _o = "crk-root-rSgdy", zo = "crk-wrapper-GHy8V", Yo = "crk-sm-DptM5", Vo =
|
|
|
1034
1058
|
) : h;
|
|
1035
1059
|
}
|
|
1036
1060
|
);
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
wrapper:
|
|
1040
|
-
sm:
|
|
1041
|
-
md:
|
|
1042
|
-
lg:
|
|
1043
|
-
root:
|
|
1044
|
-
error:
|
|
1045
|
-
arrow:
|
|
1046
|
-
searchableWrapper:
|
|
1047
|
-
hiddenSelect:
|
|
1048
|
-
searchableTrigger:
|
|
1049
|
-
triggerOpen:
|
|
1050
|
-
triggerLabel:
|
|
1051
|
-
placeholder:
|
|
1052
|
-
arrowInline:
|
|
1053
|
-
disabled:
|
|
1054
|
-
visuallyHidden:
|
|
1055
|
-
menu:
|
|
1056
|
-
menuEnter:
|
|
1057
|
-
menuItems:
|
|
1058
|
-
item:
|
|
1059
|
-
itemHighlighted:
|
|
1060
|
-
itemDisabled:
|
|
1061
|
-
itemSelected:
|
|
1062
|
-
noResults:
|
|
1063
|
-
multiTrigger:
|
|
1064
|
-
multiTriggerDisabled:
|
|
1065
|
-
chip:
|
|
1066
|
-
chipLabel:
|
|
1067
|
-
chipRemove:
|
|
1068
|
-
multiSearch:
|
|
1069
|
-
arrowMulti:
|
|
1070
|
-
itemCheck:
|
|
1071
|
-
},
|
|
1061
|
+
nc.displayName = "Input";
|
|
1062
|
+
const rc = "crk-wrapper-SP2JE", oc = "crk-sm-DqshL", cc = "crk-md-j4AKI", ic = "crk-lg-24Xd3", lc = "crk-root-Uu9Ah", sc = "crk-error-9oRU6", ac = "crk-arrow-WU8ZW", dc = "crk-searchableWrapper-7AL4l", uc = "crk-hiddenSelect-s3DEx", hc = "crk-searchableTrigger-m-GWV", mc = "crk-triggerOpen-Lo8-j", fc = "crk-triggerLabel-5rETZ", pc = "crk-placeholder-teBBh", gc = "crk-arrowInline-m-roG", yc = "crk-disabled-pcSeq", vc = "crk-visuallyHidden-2tTD5", bc = "crk-menu--i-je", xc = "crk-menuEnter-vJjLV", kc = "crk-menuItems-VrZnE", Mc = "crk-item-fU3XI", wc = "crk-itemHighlighted-MvR41", $c = "crk-itemDisabled-KTUO8", Nc = "crk-itemSelected-42-BG", Lc = "crk-noResults-uicSW", Sc = "crk-multiTrigger-Pd3wJ", Tc = "crk-multiTriggerDisabled-9ajge", Rc = "crk-chip-TuYUB", Cc = "crk-chipLabel-H4JWu", Ac = "crk-chipRemove-Lfk0R", Bc = "crk-multiSearch-OrVeS", Dc = "crk-arrowMulti-Nh9Hr", Ic = "crk-itemCheck-DPB5A", E = {
|
|
1063
|
+
wrapper: rc,
|
|
1064
|
+
sm: oc,
|
|
1065
|
+
md: cc,
|
|
1066
|
+
lg: ic,
|
|
1067
|
+
root: lc,
|
|
1068
|
+
error: sc,
|
|
1069
|
+
arrow: ac,
|
|
1070
|
+
searchableWrapper: dc,
|
|
1071
|
+
hiddenSelect: uc,
|
|
1072
|
+
searchableTrigger: hc,
|
|
1073
|
+
triggerOpen: mc,
|
|
1074
|
+
triggerLabel: fc,
|
|
1075
|
+
placeholder: pc,
|
|
1076
|
+
arrowInline: gc,
|
|
1077
|
+
disabled: yc,
|
|
1078
|
+
visuallyHidden: vc,
|
|
1079
|
+
menu: bc,
|
|
1080
|
+
menuEnter: xc,
|
|
1081
|
+
menuItems: kc,
|
|
1082
|
+
item: Mc,
|
|
1083
|
+
itemHighlighted: wc,
|
|
1084
|
+
itemDisabled: $c,
|
|
1085
|
+
itemSelected: Nc,
|
|
1086
|
+
noResults: Lc,
|
|
1087
|
+
multiTrigger: Sc,
|
|
1088
|
+
multiTriggerDisabled: Tc,
|
|
1089
|
+
chip: Rc,
|
|
1090
|
+
chipLabel: Cc,
|
|
1091
|
+
chipRemove: Ac,
|
|
1092
|
+
multiSearch: Bc,
|
|
1093
|
+
arrowMulti: Dc,
|
|
1094
|
+
itemCheck: Ic
|
|
1095
|
+
}, Zt = $e(
|
|
1072
1096
|
({
|
|
1073
1097
|
inputSize: e = "md",
|
|
1074
1098
|
error: t = !1,
|
|
@@ -1080,26 +1104,26 @@ const tc = "crk-wrapper-SP2JE", nc = "crk-sm-DqshL", rc = "crk-md-j4AKI", oc = "
|
|
|
1080
1104
|
children: l,
|
|
1081
1105
|
searchable: a,
|
|
1082
1106
|
searchPlaceholder: h,
|
|
1083
|
-
onValueChange:
|
|
1084
|
-
...
|
|
1085
|
-
}, m) => /* @__PURE__ */ H("div", { className: f(
|
|
1107
|
+
onValueChange: d,
|
|
1108
|
+
...u
|
|
1109
|
+
}, m) => /* @__PURE__ */ H("div", { className: f(E.wrapper, E[e], t && E.error, o?.wrapper, i), style: c, children: [
|
|
1086
1110
|
/* @__PURE__ */ H(
|
|
1087
1111
|
"select",
|
|
1088
1112
|
{
|
|
1089
1113
|
ref: m,
|
|
1090
|
-
className: f(
|
|
1091
|
-
...
|
|
1114
|
+
className: f(E.root, E[e], t && E.error, o?.root),
|
|
1115
|
+
...u,
|
|
1092
1116
|
children: [
|
|
1093
1117
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
1094
1118
|
n ? n.map((p) => /* @__PURE__ */ s("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value)) : l
|
|
1095
1119
|
]
|
|
1096
1120
|
}
|
|
1097
1121
|
),
|
|
1098
|
-
/* @__PURE__ */ s("span", { className: f(
|
|
1122
|
+
/* @__PURE__ */ s("span", { className: f(E.arrow, o?.arrow) })
|
|
1099
1123
|
] })
|
|
1100
1124
|
);
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1125
|
+
Zt.displayName = "NativeSelect";
|
|
1126
|
+
const Kt = $e(
|
|
1103
1127
|
({
|
|
1104
1128
|
inputSize: e = "md",
|
|
1105
1129
|
error: t = !1,
|
|
@@ -1111,79 +1135,79 @@ const Zt = $e(
|
|
|
1111
1135
|
value: l,
|
|
1112
1136
|
disabled: a,
|
|
1113
1137
|
id: h,
|
|
1114
|
-
searchPlaceholder:
|
|
1115
|
-
onChange:
|
|
1138
|
+
searchPlaceholder: d = "Search...",
|
|
1139
|
+
onChange: u,
|
|
1116
1140
|
onValueChange: m
|
|
1117
1141
|
}, p) => {
|
|
1118
|
-
const [y,
|
|
1142
|
+
const [y, w] = Se(!1), [N, S] = Se(""), [O, P] = Se(0), U = ne(null), re = ne(null), D = ne(null), C = ne(null), ee = ze(), se = ne(null), M = p ?? se, q = ne(!1);
|
|
1119
1143
|
Be(() => {
|
|
1120
|
-
q.current && !y &&
|
|
1144
|
+
q.current && !y && D.current?.focus(), q.current = y;
|
|
1121
1145
|
}, [y]);
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1146
|
+
const I = he(() => {
|
|
1147
|
+
w(!1), S(""), P(0);
|
|
1124
1148
|
}, []), Q = he(() => {
|
|
1125
|
-
a || (
|
|
1126
|
-
}, [a]),
|
|
1149
|
+
a || (w(!0), S(""), P(0), setTimeout(() => re.current?.focus(), 0));
|
|
1150
|
+
}, [a]), F = he(
|
|
1127
1151
|
(v) => {
|
|
1128
|
-
if (m?.(v),
|
|
1152
|
+
if (m?.(v), M.current) {
|
|
1129
1153
|
Object.getOwnPropertyDescriptor(
|
|
1130
1154
|
HTMLSelectElement.prototype,
|
|
1131
1155
|
"value"
|
|
1132
|
-
)?.set?.call(
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1156
|
+
)?.set?.call(M.current, v);
|
|
1157
|
+
const $ = new Event("change", { bubbles: !0 });
|
|
1158
|
+
M.current.dispatchEvent($), u?.($);
|
|
1135
1159
|
}
|
|
1136
|
-
|
|
1160
|
+
I();
|
|
1137
1161
|
},
|
|
1138
|
-
[m,
|
|
1139
|
-
),
|
|
1140
|
-
if (!
|
|
1141
|
-
const v =
|
|
1142
|
-
return n.filter((
|
|
1143
|
-
}, [n,
|
|
1162
|
+
[m, u, M, I]
|
|
1163
|
+
), W = ke(() => {
|
|
1164
|
+
if (!N) return n;
|
|
1165
|
+
const v = N.toLowerCase();
|
|
1166
|
+
return n.filter((k) => k.label.toLowerCase().includes(v));
|
|
1167
|
+
}, [n, N]);
|
|
1144
1168
|
Be(() => {
|
|
1145
|
-
const v =
|
|
1146
|
-
|
|
1147
|
-
}, [
|
|
1169
|
+
const v = W.findIndex((k) => !k.disabled);
|
|
1170
|
+
P(v >= 0 ? v : 0);
|
|
1171
|
+
}, [W]), Be(() => {
|
|
1148
1172
|
if (!y) return;
|
|
1149
1173
|
const v = C.current;
|
|
1150
1174
|
if (!v) return;
|
|
1151
|
-
v.querySelectorAll('[role="option"]')[
|
|
1152
|
-
}, [
|
|
1153
|
-
const
|
|
1175
|
+
v.querySelectorAll('[role="option"]')[O]?.scrollIntoView?.({ block: "nearest" });
|
|
1176
|
+
}, [O, y]);
|
|
1177
|
+
const te = he(
|
|
1154
1178
|
(v) => {
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1179
|
+
const k = W.map(($, z) => $.disabled ? -1 : z).filter(($) => $ >= 0);
|
|
1180
|
+
if (k.length !== 0)
|
|
1157
1181
|
if (v.key === "ArrowDown")
|
|
1158
|
-
v.preventDefault(),
|
|
1159
|
-
const z =
|
|
1160
|
-
return z <
|
|
1182
|
+
v.preventDefault(), P(($) => {
|
|
1183
|
+
const z = k.indexOf($);
|
|
1184
|
+
return z < k.length - 1 ? k[z + 1] : k[0];
|
|
1161
1185
|
});
|
|
1162
1186
|
else if (v.key === "ArrowUp")
|
|
1163
|
-
v.preventDefault(),
|
|
1164
|
-
const z =
|
|
1165
|
-
return z > 0 ?
|
|
1187
|
+
v.preventDefault(), P(($) => {
|
|
1188
|
+
const z = k.indexOf($);
|
|
1189
|
+
return z > 0 ? k[z - 1] : k[k.length - 1];
|
|
1166
1190
|
});
|
|
1167
1191
|
else if (v.key === "Enter") {
|
|
1168
1192
|
v.preventDefault();
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
} else v.key === "Escape" && (v.preventDefault(),
|
|
1193
|
+
const $ = W[O];
|
|
1194
|
+
$ && !$.disabled && F($.value);
|
|
1195
|
+
} else v.key === "Escape" && (v.preventDefault(), I());
|
|
1172
1196
|
},
|
|
1173
|
-
[
|
|
1197
|
+
[W, O, F, I]
|
|
1174
1198
|
);
|
|
1175
|
-
pt(
|
|
1176
|
-
const
|
|
1199
|
+
pt(U, I, y);
|
|
1200
|
+
const oe = n.find((v) => v.value === l)?.label, L = W.filter((v) => !v.disabled);
|
|
1177
1201
|
return /* @__PURE__ */ H(
|
|
1178
1202
|
"div",
|
|
1179
1203
|
{
|
|
1180
|
-
ref:
|
|
1204
|
+
ref: U,
|
|
1181
1205
|
className: f(
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
t &&
|
|
1186
|
-
a &&
|
|
1206
|
+
E.wrapper,
|
|
1207
|
+
E.searchableWrapper,
|
|
1208
|
+
E[e],
|
|
1209
|
+
t && E.error,
|
|
1210
|
+
a && E.disabled,
|
|
1187
1211
|
o?.wrapper,
|
|
1188
1212
|
i
|
|
1189
1213
|
),
|
|
@@ -1192,8 +1216,8 @@ const Zt = $e(
|
|
|
1192
1216
|
/* @__PURE__ */ s(
|
|
1193
1217
|
"select",
|
|
1194
1218
|
{
|
|
1195
|
-
ref:
|
|
1196
|
-
className:
|
|
1219
|
+
ref: M,
|
|
1220
|
+
className: E.hiddenSelect,
|
|
1197
1221
|
value: l ?? "",
|
|
1198
1222
|
disabled: a,
|
|
1199
1223
|
tabIndex: -1,
|
|
@@ -1206,55 +1230,55 @@ const Zt = $e(
|
|
|
1206
1230
|
/* @__PURE__ */ H(
|
|
1207
1231
|
"button",
|
|
1208
1232
|
{
|
|
1209
|
-
ref:
|
|
1233
|
+
ref: D,
|
|
1210
1234
|
id: h,
|
|
1211
1235
|
type: "button",
|
|
1212
1236
|
className: f(
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
y &&
|
|
1217
|
-
t &&
|
|
1218
|
-
y &&
|
|
1237
|
+
E.root,
|
|
1238
|
+
E.searchableTrigger,
|
|
1239
|
+
E[e],
|
|
1240
|
+
y && E.triggerOpen,
|
|
1241
|
+
t && E.error,
|
|
1242
|
+
y && E.visuallyHidden,
|
|
1219
1243
|
o?.root
|
|
1220
1244
|
),
|
|
1221
1245
|
onClick: Q,
|
|
1222
1246
|
disabled: a,
|
|
1223
1247
|
"aria-expanded": y,
|
|
1224
1248
|
"aria-haspopup": "listbox",
|
|
1225
|
-
"aria-controls": y ?
|
|
1249
|
+
"aria-controls": y ? ee : void 0,
|
|
1226
1250
|
children: [
|
|
1227
|
-
/* @__PURE__ */ s("span", { className: f(
|
|
1228
|
-
/* @__PURE__ */ s("span", { className: f(
|
|
1251
|
+
/* @__PURE__ */ s("span", { className: f(E.triggerLabel, !oe && E.placeholder), children: oe || r }),
|
|
1252
|
+
/* @__PURE__ */ s("span", { className: f(E.arrow, E.arrowInline, o?.arrow) })
|
|
1229
1253
|
]
|
|
1230
1254
|
}
|
|
1231
1255
|
),
|
|
1232
1256
|
y && /* @__PURE__ */ s(
|
|
1233
1257
|
"input",
|
|
1234
1258
|
{
|
|
1235
|
-
ref:
|
|
1259
|
+
ref: re,
|
|
1236
1260
|
type: "text",
|
|
1237
1261
|
role: "combobox",
|
|
1238
1262
|
className: f(
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
t &&
|
|
1263
|
+
E.root,
|
|
1264
|
+
E.searchableTrigger,
|
|
1265
|
+
E[e],
|
|
1266
|
+
E.triggerOpen,
|
|
1267
|
+
t && E.error,
|
|
1244
1268
|
o?.root,
|
|
1245
1269
|
o?.search
|
|
1246
1270
|
),
|
|
1247
|
-
placeholder:
|
|
1248
|
-
value:
|
|
1249
|
-
onChange: (v) =>
|
|
1250
|
-
onKeyDown:
|
|
1271
|
+
placeholder: oe || r,
|
|
1272
|
+
value: N,
|
|
1273
|
+
onChange: (v) => S(v.target.value),
|
|
1274
|
+
onKeyDown: te,
|
|
1251
1275
|
"aria-expanded": !0,
|
|
1252
1276
|
"aria-haspopup": "listbox",
|
|
1253
|
-
"aria-controls":
|
|
1254
|
-
"aria-activedescendant": L.length > 0 ? `select-option-${
|
|
1277
|
+
"aria-controls": ee,
|
|
1278
|
+
"aria-activedescendant": L.length > 0 ? `select-option-${W[O]?.value}` : void 0
|
|
1255
1279
|
}
|
|
1256
1280
|
),
|
|
1257
|
-
y && /* @__PURE__ */ s("div", { id:
|
|
1281
|
+
y && /* @__PURE__ */ s("div", { id: ee, className: f(E.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ s("div", { className: E.menuItems, ref: C, children: W.length === 0 ? /* @__PURE__ */ s("div", { className: E.noResults, children: "No results" }) : W.map((v, k) => /* @__PURE__ */ s(
|
|
1258
1282
|
"button",
|
|
1259
1283
|
{
|
|
1260
1284
|
id: `select-option-${v.value}`,
|
|
@@ -1262,15 +1286,15 @@ const Zt = $e(
|
|
|
1262
1286
|
role: "option",
|
|
1263
1287
|
"aria-selected": v.value === l,
|
|
1264
1288
|
className: f(
|
|
1265
|
-
|
|
1266
|
-
v.disabled &&
|
|
1267
|
-
v.value === l &&
|
|
1268
|
-
|
|
1289
|
+
E.item,
|
|
1290
|
+
v.disabled && E.itemDisabled,
|
|
1291
|
+
v.value === l && E.itemSelected,
|
|
1292
|
+
k === O && E.itemHighlighted,
|
|
1269
1293
|
o?.item
|
|
1270
1294
|
),
|
|
1271
1295
|
disabled: v.disabled,
|
|
1272
|
-
onClick: () =>
|
|
1273
|
-
onMouseEnter: () =>
|
|
1296
|
+
onClick: () => F(v.value),
|
|
1297
|
+
onMouseEnter: () => P(k),
|
|
1274
1298
|
children: v.content ?? v.label
|
|
1275
1299
|
},
|
|
1276
1300
|
v.value
|
|
@@ -1280,8 +1304,8 @@ const Zt = $e(
|
|
|
1280
1304
|
);
|
|
1281
1305
|
}
|
|
1282
1306
|
);
|
|
1283
|
-
|
|
1284
|
-
const
|
|
1307
|
+
Kt.displayName = "SearchableSelect";
|
|
1308
|
+
const Qt = $e(
|
|
1285
1309
|
({
|
|
1286
1310
|
inputSize: e = "md",
|
|
1287
1311
|
error: t = !1,
|
|
@@ -1293,81 +1317,81 @@ const Kt = $e(
|
|
|
1293
1317
|
value: l,
|
|
1294
1318
|
disabled: a,
|
|
1295
1319
|
id: h,
|
|
1296
|
-
searchPlaceholder:
|
|
1297
|
-
onValuesChange:
|
|
1320
|
+
searchPlaceholder: d,
|
|
1321
|
+
onValuesChange: u,
|
|
1298
1322
|
clearSearchOnSelect: m = !0
|
|
1299
1323
|
}, p) => {
|
|
1300
|
-
const y = Array.isArray(l) ? l : l ? [l] : [], [
|
|
1301
|
-
|
|
1302
|
-
}, []),
|
|
1303
|
-
a || (
|
|
1324
|
+
const y = Array.isArray(l) ? l : l ? [l] : [], [w, N] = Se(!1), [S, O] = Se(""), [P, U] = Se(0), re = ne(null), D = ne(null), C = ne(null), ee = ze(), se = ne(null), M = p ?? se, q = he(() => {
|
|
1325
|
+
N(!1), O(""), U(0);
|
|
1326
|
+
}, []), I = he(() => {
|
|
1327
|
+
a || (N(!0), O(""), U(0), setTimeout(() => D.current?.focus(), 0));
|
|
1304
1328
|
}, [a]), Q = he(
|
|
1305
1329
|
(L) => {
|
|
1306
|
-
const v = y.includes(L) ? y.filter((
|
|
1307
|
-
|
|
1330
|
+
const v = y.includes(L) ? y.filter((k) => k !== L) : [...y, L];
|
|
1331
|
+
u?.(v), m && O("");
|
|
1308
1332
|
},
|
|
1309
|
-
[y,
|
|
1310
|
-
),
|
|
1333
|
+
[y, u, m]
|
|
1334
|
+
), F = he(
|
|
1311
1335
|
(L, v) => {
|
|
1312
|
-
v.stopPropagation(),
|
|
1336
|
+
v.stopPropagation(), u?.(y.filter((k) => k !== L));
|
|
1313
1337
|
},
|
|
1314
|
-
[y,
|
|
1315
|
-
),
|
|
1316
|
-
if (!
|
|
1317
|
-
const L =
|
|
1338
|
+
[y, u]
|
|
1339
|
+
), W = ke(() => {
|
|
1340
|
+
if (!S) return n;
|
|
1341
|
+
const L = S.toLowerCase();
|
|
1318
1342
|
return n.filter((v) => v.label.toLowerCase().includes(L));
|
|
1319
|
-
}, [n,
|
|
1343
|
+
}, [n, S]);
|
|
1320
1344
|
Be(() => {
|
|
1321
|
-
const L =
|
|
1322
|
-
|
|
1323
|
-
}, [
|
|
1324
|
-
if (
|
|
1345
|
+
const L = W.findIndex((v) => !v.disabled);
|
|
1346
|
+
U(L >= 0 ? L : 0);
|
|
1347
|
+
}, [W]), Be(() => {
|
|
1348
|
+
if (!w) return;
|
|
1325
1349
|
const L = C.current;
|
|
1326
1350
|
if (!L) return;
|
|
1327
|
-
L.querySelectorAll('[role="option"]')[
|
|
1328
|
-
}, [
|
|
1329
|
-
const
|
|
1351
|
+
L.querySelectorAll('[role="option"]')[P]?.scrollIntoView?.({ block: "nearest" });
|
|
1352
|
+
}, [P, w]);
|
|
1353
|
+
const te = he(
|
|
1330
1354
|
(L) => {
|
|
1331
|
-
const v =
|
|
1332
|
-
if (L.key === "Backspace" &&
|
|
1333
|
-
L.preventDefault(),
|
|
1355
|
+
const v = W.map((k, $) => k.disabled ? -1 : $).filter((k) => k >= 0);
|
|
1356
|
+
if (L.key === "Backspace" && S === "" && y.length > 0) {
|
|
1357
|
+
L.preventDefault(), u?.(y.slice(0, -1));
|
|
1334
1358
|
return;
|
|
1335
1359
|
}
|
|
1336
1360
|
if (v.length !== 0)
|
|
1337
1361
|
if (L.key === "ArrowDown") {
|
|
1338
|
-
if (L.preventDefault(),
|
|
1339
|
-
|
|
1362
|
+
if (L.preventDefault(), !w) {
|
|
1363
|
+
I();
|
|
1340
1364
|
return;
|
|
1341
1365
|
}
|
|
1342
|
-
|
|
1343
|
-
const
|
|
1344
|
-
return
|
|
1366
|
+
U((k) => {
|
|
1367
|
+
const $ = v.indexOf(k);
|
|
1368
|
+
return $ < v.length - 1 ? v[$ + 1] : v[0];
|
|
1345
1369
|
});
|
|
1346
1370
|
} else if (L.key === "ArrowUp")
|
|
1347
|
-
L.preventDefault(),
|
|
1348
|
-
const
|
|
1349
|
-
return
|
|
1371
|
+
L.preventDefault(), U((k) => {
|
|
1372
|
+
const $ = v.indexOf(k);
|
|
1373
|
+
return $ > 0 ? v[$ - 1] : v[v.length - 1];
|
|
1350
1374
|
});
|
|
1351
1375
|
else if (L.key === "Enter") {
|
|
1352
1376
|
L.preventDefault();
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1377
|
+
const k = W[P];
|
|
1378
|
+
k && !k.disabled && Q(k.value);
|
|
1355
1379
|
} else L.key === "Escape" && (L.preventDefault(), q());
|
|
1356
1380
|
},
|
|
1357
|
-
[
|
|
1381
|
+
[W, P, Q, q, S, y, u, w, I]
|
|
1358
1382
|
);
|
|
1359
|
-
pt(
|
|
1360
|
-
const
|
|
1383
|
+
pt(re, q, w);
|
|
1384
|
+
const oe = y.map((L) => n.find((v) => v.value === L)).filter((L) => !!L);
|
|
1361
1385
|
return /* @__PURE__ */ H(
|
|
1362
1386
|
"div",
|
|
1363
1387
|
{
|
|
1364
|
-
ref:
|
|
1388
|
+
ref: re,
|
|
1365
1389
|
className: f(
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
t &&
|
|
1370
|
-
a &&
|
|
1390
|
+
E.wrapper,
|
|
1391
|
+
E.searchableWrapper,
|
|
1392
|
+
E[e],
|
|
1393
|
+
t && E.error,
|
|
1394
|
+
a && E.disabled,
|
|
1371
1395
|
o?.wrapper,
|
|
1372
1396
|
i
|
|
1373
1397
|
),
|
|
@@ -1376,8 +1400,8 @@ const Kt = $e(
|
|
|
1376
1400
|
/* @__PURE__ */ s(
|
|
1377
1401
|
"select",
|
|
1378
1402
|
{
|
|
1379
|
-
ref:
|
|
1380
|
-
className:
|
|
1403
|
+
ref: M,
|
|
1404
|
+
className: E.hiddenSelect,
|
|
1381
1405
|
multiple: !0,
|
|
1382
1406
|
value: y,
|
|
1383
1407
|
disabled: a,
|
|
@@ -1392,29 +1416,29 @@ const Kt = $e(
|
|
|
1392
1416
|
"div",
|
|
1393
1417
|
{
|
|
1394
1418
|
className: f(
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
t &&
|
|
1399
|
-
a &&
|
|
1419
|
+
E.multiTrigger,
|
|
1420
|
+
E[e],
|
|
1421
|
+
w && E.triggerOpen,
|
|
1422
|
+
t && E.error,
|
|
1423
|
+
a && E.multiTriggerDisabled,
|
|
1400
1424
|
o?.root
|
|
1401
1425
|
),
|
|
1402
1426
|
onClick: () => {
|
|
1403
|
-
|
|
1427
|
+
w ? D.current?.focus() : I();
|
|
1404
1428
|
},
|
|
1405
1429
|
role: "combobox",
|
|
1406
|
-
"aria-expanded":
|
|
1430
|
+
"aria-expanded": w,
|
|
1407
1431
|
"aria-haspopup": "listbox",
|
|
1408
|
-
"aria-controls":
|
|
1432
|
+
"aria-controls": w ? ee : void 0,
|
|
1409
1433
|
children: [
|
|
1410
|
-
|
|
1411
|
-
/* @__PURE__ */ s("span", { className:
|
|
1434
|
+
oe.map((L) => /* @__PURE__ */ H("span", { className: f(E.chip, o?.chip), children: [
|
|
1435
|
+
/* @__PURE__ */ s("span", { className: E.chipLabel, children: L.content ?? L.label }),
|
|
1412
1436
|
/* @__PURE__ */ s(
|
|
1413
1437
|
"button",
|
|
1414
1438
|
{
|
|
1415
1439
|
type: "button",
|
|
1416
|
-
className: f(
|
|
1417
|
-
onClick: (v) =>
|
|
1440
|
+
className: f(E.chipRemove, o?.chipRemove),
|
|
1441
|
+
onClick: (v) => F(L.value, v),
|
|
1418
1442
|
"aria-label": `Remove ${L.label}`,
|
|
1419
1443
|
tabIndex: -1,
|
|
1420
1444
|
children: "×"
|
|
@@ -1424,45 +1448,45 @@ const Kt = $e(
|
|
|
1424
1448
|
/* @__PURE__ */ s(
|
|
1425
1449
|
"input",
|
|
1426
1450
|
{
|
|
1427
|
-
ref:
|
|
1451
|
+
ref: D,
|
|
1428
1452
|
id: h,
|
|
1429
1453
|
type: "text",
|
|
1430
|
-
className:
|
|
1454
|
+
className: E.multiSearch,
|
|
1431
1455
|
placeholder: y.length === 0 ? r : "",
|
|
1432
|
-
value:
|
|
1456
|
+
value: S,
|
|
1433
1457
|
onChange: (L) => {
|
|
1434
|
-
|
|
1458
|
+
O(L.target.value), w || I();
|
|
1435
1459
|
},
|
|
1436
|
-
onKeyDown:
|
|
1460
|
+
onKeyDown: te,
|
|
1437
1461
|
disabled: a,
|
|
1438
1462
|
"aria-label": "Search options"
|
|
1439
1463
|
}
|
|
1440
1464
|
),
|
|
1441
|
-
/* @__PURE__ */ s("span", { className: f(
|
|
1465
|
+
/* @__PURE__ */ s("span", { className: f(E.arrow, E.arrowMulti, o?.arrow) })
|
|
1442
1466
|
]
|
|
1443
1467
|
}
|
|
1444
1468
|
),
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1469
|
+
w && /* @__PURE__ */ s("div", { id: ee, className: f(E.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ s("div", { className: E.menuItems, ref: C, children: W.length === 0 ? /* @__PURE__ */ s("div", { className: E.noResults, children: "No results" }) : W.map((L, v) => {
|
|
1470
|
+
const k = y.includes(L.value);
|
|
1447
1471
|
return /* @__PURE__ */ H(
|
|
1448
1472
|
"button",
|
|
1449
1473
|
{
|
|
1450
1474
|
id: `select-option-${L.value}`,
|
|
1451
1475
|
type: "button",
|
|
1452
1476
|
role: "option",
|
|
1453
|
-
"aria-selected":
|
|
1477
|
+
"aria-selected": k,
|
|
1454
1478
|
className: f(
|
|
1455
|
-
|
|
1456
|
-
L.disabled &&
|
|
1457
|
-
|
|
1458
|
-
v ===
|
|
1479
|
+
E.item,
|
|
1480
|
+
L.disabled && E.itemDisabled,
|
|
1481
|
+
k && E.itemSelected,
|
|
1482
|
+
v === P && E.itemHighlighted,
|
|
1459
1483
|
o?.item
|
|
1460
1484
|
),
|
|
1461
1485
|
disabled: L.disabled,
|
|
1462
1486
|
onClick: () => Q(L.value),
|
|
1463
|
-
onMouseEnter: () =>
|
|
1487
|
+
onMouseEnter: () => U(v),
|
|
1464
1488
|
children: [
|
|
1465
|
-
|
|
1489
|
+
k && /* @__PURE__ */ s("span", { className: E.itemCheck, "aria-hidden": "true" }),
|
|
1466
1490
|
L.content ?? L.label
|
|
1467
1491
|
]
|
|
1468
1492
|
},
|
|
@@ -1474,17 +1498,17 @@ const Kt = $e(
|
|
|
1474
1498
|
);
|
|
1475
1499
|
}
|
|
1476
1500
|
);
|
|
1477
|
-
|
|
1478
|
-
const
|
|
1479
|
-
(e, t) => e.multiple ? /* @__PURE__ */ s(
|
|
1501
|
+
Qt.displayName = "MultiSelect";
|
|
1502
|
+
const Ec = $e(
|
|
1503
|
+
(e, t) => e.multiple ? /* @__PURE__ */ s(Qt, { ref: t, ...e }) : e.searchable ? /* @__PURE__ */ s(Kt, { ref: t, ...e }) : /* @__PURE__ */ s(Zt, { ref: t, ...e })
|
|
1480
1504
|
);
|
|
1481
|
-
|
|
1482
|
-
const
|
|
1483
|
-
root:
|
|
1484
|
-
input:
|
|
1485
|
-
label:
|
|
1486
|
-
indeterminate:
|
|
1487
|
-
},
|
|
1505
|
+
Ec.displayName = "Select";
|
|
1506
|
+
const Pc = "crk-root-61cKD", Wc = "crk-input-bAjPU", Hc = "crk-label-W9IeS", Oc = "crk-indeterminate-mLarv", dt = {
|
|
1507
|
+
root: Pc,
|
|
1508
|
+
input: Wc,
|
|
1509
|
+
label: Hc,
|
|
1510
|
+
indeterminate: Oc
|
|
1511
|
+
}, Fc = $e(
|
|
1488
1512
|
({
|
|
1489
1513
|
label: e,
|
|
1490
1514
|
indeterminate: t = !1,
|
|
@@ -1493,7 +1517,7 @@ const Ic = "crk-root-61cKD", Ec = "crk-input-bAjPU", Pc = "crk-label-W9IeS", Wc
|
|
|
1493
1517
|
style: o,
|
|
1494
1518
|
...i
|
|
1495
1519
|
}, c) => {
|
|
1496
|
-
const l =
|
|
1520
|
+
const l = ne(null);
|
|
1497
1521
|
return Be(() => {
|
|
1498
1522
|
l.current && (l.current.indeterminate = t);
|
|
1499
1523
|
}, [t]), /* @__PURE__ */ H(
|
|
@@ -1519,13 +1543,13 @@ const Ic = "crk-root-61cKD", Ec = "crk-input-bAjPU", Pc = "crk-label-W9IeS", Wc
|
|
|
1519
1543
|
);
|
|
1520
1544
|
}
|
|
1521
1545
|
);
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1524
|
-
group:
|
|
1525
|
-
root:
|
|
1526
|
-
input:
|
|
1527
|
-
label:
|
|
1528
|
-
},
|
|
1546
|
+
Fc.displayName = "Checkbox";
|
|
1547
|
+
const jc = "crk-group-NNwCD", Xc = "crk-root-7fGik", Uc = "crk-input-43PQW", _c = "crk-label-aW30x", ht = {
|
|
1548
|
+
group: jc,
|
|
1549
|
+
root: Xc,
|
|
1550
|
+
input: Uc,
|
|
1551
|
+
label: _c
|
|
1552
|
+
}, Jt = Xt(null), zc = ({
|
|
1529
1553
|
name: e,
|
|
1530
1554
|
value: t,
|
|
1531
1555
|
onChange: n,
|
|
@@ -1536,7 +1560,7 @@ const Oc = "crk-group-NNwCD", Fc = "crk-root-7fGik", jc = "crk-input-43PQW", Xc
|
|
|
1536
1560
|
"aria-label": l,
|
|
1537
1561
|
"aria-labelledby": a,
|
|
1538
1562
|
required: h
|
|
1539
|
-
}) => /* @__PURE__ */ s(
|
|
1563
|
+
}) => /* @__PURE__ */ s(Jt.Provider, { value: { name: e, value: t, onChange: n }, children: /* @__PURE__ */ s(
|
|
1540
1564
|
"div",
|
|
1541
1565
|
{
|
|
1542
1566
|
id: c,
|
|
@@ -1550,8 +1574,8 @@ const Oc = "crk-group-NNwCD", Fc = "crk-root-7fGik", jc = "crk-input-43PQW", Xc
|
|
|
1550
1574
|
children: i
|
|
1551
1575
|
}
|
|
1552
1576
|
) });
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1577
|
+
zc.displayName = "RadioGroup";
|
|
1578
|
+
const Vc = $e(
|
|
1555
1579
|
({
|
|
1556
1580
|
label: e,
|
|
1557
1581
|
value: t,
|
|
@@ -1563,8 +1587,8 @@ const _c = $e(
|
|
|
1563
1587
|
name: l,
|
|
1564
1588
|
...a
|
|
1565
1589
|
}, h) => {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1590
|
+
const d = ft(Jt), u = d?.name ?? l, m = d ? d.value === t : c, p = (y) => {
|
|
1591
|
+
d?.onChange?.(t), i?.(y);
|
|
1568
1592
|
};
|
|
1569
1593
|
return /* @__PURE__ */ H("label", { className: f(ht.root, n?.root, r), style: o, children: [
|
|
1570
1594
|
/* @__PURE__ */ s(
|
|
@@ -1573,7 +1597,7 @@ const _c = $e(
|
|
|
1573
1597
|
ref: h,
|
|
1574
1598
|
type: "radio",
|
|
1575
1599
|
className: f(ht.input, n?.input),
|
|
1576
|
-
name:
|
|
1600
|
+
name: u,
|
|
1577
1601
|
value: t,
|
|
1578
1602
|
checked: m,
|
|
1579
1603
|
onChange: p,
|
|
@@ -1584,24 +1608,24 @@ const _c = $e(
|
|
|
1584
1608
|
] });
|
|
1585
1609
|
}
|
|
1586
1610
|
);
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1589
|
-
root:
|
|
1590
|
-
sm:
|
|
1591
|
-
md:
|
|
1592
|
-
lg:
|
|
1593
|
-
error:
|
|
1594
|
-
resizeNone:
|
|
1595
|
-
resizeVertical:
|
|
1596
|
-
resizeHorizontal:
|
|
1597
|
-
resizeBoth:
|
|
1598
|
-
autoExpand:
|
|
1599
|
-
},
|
|
1611
|
+
Vc.displayName = "Radio";
|
|
1612
|
+
const Yc = "crk-root-IGgdn", qc = "crk-sm-N-5I2", Gc = "crk-md-bbyFl", Zc = "crk-lg-Pd-Iq", Kc = "crk-error-fyu3i", Qc = "crk-resizeNone-SmNT4", Jc = "crk-resizeVertical-oi8vP", ei = "crk-resizeHorizontal-riMLL", ti = "crk-resizeBoth-NYSh4", ni = "crk-autoExpand-JWone", Ke = {
|
|
1613
|
+
root: Yc,
|
|
1614
|
+
sm: qc,
|
|
1615
|
+
md: Gc,
|
|
1616
|
+
lg: Zc,
|
|
1617
|
+
error: Kc,
|
|
1618
|
+
resizeNone: Qc,
|
|
1619
|
+
resizeVertical: Jc,
|
|
1620
|
+
resizeHorizontal: ei,
|
|
1621
|
+
resizeBoth: ti,
|
|
1622
|
+
autoExpand: ni
|
|
1623
|
+
}, ri = {
|
|
1600
1624
|
none: "resizeNone",
|
|
1601
1625
|
vertical: "resizeVertical",
|
|
1602
1626
|
horizontal: "resizeHorizontal",
|
|
1603
1627
|
both: "resizeBoth"
|
|
1604
|
-
},
|
|
1628
|
+
}, oi = $e(
|
|
1605
1629
|
({
|
|
1606
1630
|
inputSize: e = "md",
|
|
1607
1631
|
error: t = !1,
|
|
@@ -1612,18 +1636,18 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
|
|
|
1612
1636
|
onChange: c,
|
|
1613
1637
|
...l
|
|
1614
1638
|
}, a) => {
|
|
1615
|
-
const h =
|
|
1639
|
+
const h = ne(null), d = he(() => {
|
|
1616
1640
|
const p = h.current;
|
|
1617
1641
|
p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
|
|
1618
|
-
}, []),
|
|
1642
|
+
}, []), u = l.value ?? "";
|
|
1619
1643
|
Be(() => {
|
|
1620
|
-
r &&
|
|
1621
|
-
}, [r,
|
|
1644
|
+
r && d();
|
|
1645
|
+
}, [r, d, u]);
|
|
1622
1646
|
const m = he(
|
|
1623
1647
|
(p) => {
|
|
1624
|
-
r &&
|
|
1648
|
+
r && d(), c?.(p);
|
|
1625
1649
|
},
|
|
1626
|
-
[r,
|
|
1650
|
+
[r, d, c]
|
|
1627
1651
|
);
|
|
1628
1652
|
return /* @__PURE__ */ s(
|
|
1629
1653
|
"textarea",
|
|
@@ -1635,7 +1659,7 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
|
|
|
1635
1659
|
Ke.root,
|
|
1636
1660
|
Ke[e],
|
|
1637
1661
|
t && Ke.error,
|
|
1638
|
-
r ? Ke.autoExpand : Ke[
|
|
1662
|
+
r ? Ke.autoExpand : Ke[ri[n]],
|
|
1639
1663
|
o
|
|
1640
1664
|
),
|
|
1641
1665
|
style: i,
|
|
@@ -1646,60 +1670,60 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
|
|
|
1646
1670
|
);
|
|
1647
1671
|
}
|
|
1648
1672
|
);
|
|
1649
|
-
|
|
1650
|
-
function
|
|
1651
|
-
const [n, r] = Se(t), o =
|
|
1673
|
+
oi.displayName = "Textarea";
|
|
1674
|
+
function ci(e, t = { width: 600, height: 300 }) {
|
|
1675
|
+
const [n, r] = Se(t), o = ne(t);
|
|
1652
1676
|
return Be(() => {
|
|
1653
1677
|
const i = e.current;
|
|
1654
1678
|
if (!i || typeof ResizeObserver > "u") return;
|
|
1655
|
-
const c = (h,
|
|
1656
|
-
const
|
|
1657
|
-
o.current.width ===
|
|
1679
|
+
const c = (h, d) => {
|
|
1680
|
+
const u = Math.max(0, Math.round(h)), m = Math.max(0, Math.round(d));
|
|
1681
|
+
o.current.width === u && o.current.height === m || (o.current = { width: u, height: m }, r({ width: u, height: m }));
|
|
1658
1682
|
}, l = i.getBoundingClientRect();
|
|
1659
1683
|
(l.width > 0 || l.height > 0) && c(l.width, l.height);
|
|
1660
1684
|
const a = new ResizeObserver((h) => {
|
|
1661
|
-
const
|
|
1662
|
-
if (!
|
|
1663
|
-
const
|
|
1664
|
-
c(
|
|
1685
|
+
const d = h[0];
|
|
1686
|
+
if (!d) return;
|
|
1687
|
+
const u = d.contentRect;
|
|
1688
|
+
c(u.width, u.height);
|
|
1665
1689
|
});
|
|
1666
1690
|
return a.observe(i), () => a.disconnect();
|
|
1667
1691
|
}, [e]), n;
|
|
1668
1692
|
}
|
|
1669
|
-
const
|
|
1670
|
-
root:
|
|
1671
|
-
canvas:
|
|
1672
|
-
svg:
|
|
1673
|
-
gridLine:
|
|
1674
|
-
axis:
|
|
1675
|
-
axisLabel:
|
|
1676
|
-
cursorLine:
|
|
1677
|
-
linePath:
|
|
1678
|
-
areaPath:
|
|
1679
|
-
point:
|
|
1680
|
-
bar:
|
|
1681
|
-
barLabelInside:
|
|
1682
|
-
activeBar:
|
|
1683
|
-
interactionLayer:
|
|
1684
|
-
legend:
|
|
1685
|
-
legendItem:
|
|
1686
|
-
legendSwatch:
|
|
1687
|
-
legendIcon:
|
|
1688
|
-
legendLabel:
|
|
1689
|
-
tooltip:
|
|
1690
|
-
tooltipTitle:
|
|
1691
|
-
tooltipRows:
|
|
1692
|
-
tooltipRow:
|
|
1693
|
-
tooltipLabel:
|
|
1694
|
-
tooltipValue:
|
|
1695
|
-
empty:
|
|
1696
|
-
sparkline:
|
|
1697
|
-
tradingHeader:
|
|
1698
|
-
},
|
|
1693
|
+
const ii = "crk-root-uMSq0", li = "crk-canvas-zhFr0", si = "crk-svg-waPLB", ai = "crk-gridLine-K2Gx9", di = "crk-axis-Zum8-", ui = "crk-axisLabel-Ilv3u", hi = "crk-cursorLine-iNHim", mi = "crk-linePath-E4eYA", fi = "crk-areaPath-ZwMc6", pi = "crk-point-DTAoa", gi = "crk-bar-9sYbq", yi = "crk-barLabelInside-dlQh5", vi = "crk-activeBar-FJhPJ", bi = "crk-interactionLayer-dHNAG", xi = "crk-legend-JL6YI", ki = "crk-legendItem-rcdvO", Mi = "crk-legendSwatch-eJBsF", wi = "crk-legendIcon-6gzcO", $i = "crk-legendLabel-C-eu3", Ni = "crk-tooltip-m55-N", Li = "crk-tooltipTitle-0EfoX", Si = "crk-tooltipRows-MC0wM", Ti = "crk-tooltipRow-ZQomr", Ri = "crk-tooltipLabel-s4OKX", Ci = "crk-tooltipValue-iwj1s", Ai = "crk-empty-aa4vk", Bi = "crk-sparkline-3-eRc", Di = "crk-tradingHeader-Pb9wS", x = {
|
|
1694
|
+
root: ii,
|
|
1695
|
+
canvas: li,
|
|
1696
|
+
svg: si,
|
|
1697
|
+
gridLine: ai,
|
|
1698
|
+
axis: di,
|
|
1699
|
+
axisLabel: ui,
|
|
1700
|
+
cursorLine: hi,
|
|
1701
|
+
linePath: mi,
|
|
1702
|
+
areaPath: fi,
|
|
1703
|
+
point: pi,
|
|
1704
|
+
bar: gi,
|
|
1705
|
+
barLabelInside: yi,
|
|
1706
|
+
activeBar: vi,
|
|
1707
|
+
interactionLayer: bi,
|
|
1708
|
+
legend: xi,
|
|
1709
|
+
legendItem: ki,
|
|
1710
|
+
legendSwatch: Mi,
|
|
1711
|
+
legendIcon: wi,
|
|
1712
|
+
legendLabel: $i,
|
|
1713
|
+
tooltip: Ni,
|
|
1714
|
+
tooltipTitle: Li,
|
|
1715
|
+
tooltipRows: Si,
|
|
1716
|
+
tooltipRow: Ti,
|
|
1717
|
+
tooltipLabel: Ri,
|
|
1718
|
+
tooltipValue: Ci,
|
|
1719
|
+
empty: Ai,
|
|
1720
|
+
sparkline: Bi,
|
|
1721
|
+
tradingHeader: Di
|
|
1722
|
+
}, Ye = $e(
|
|
1699
1723
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: i, overlay: c, children: l }, a) => {
|
|
1700
|
-
const h =
|
|
1701
|
-
|
|
1702
|
-
const { width:
|
|
1724
|
+
const h = ne(null);
|
|
1725
|
+
an(a, () => h.current);
|
|
1726
|
+
const { width: d } = ci(h), u = Math.max(0, d), m = t ?? Math.round(u / e);
|
|
1703
1727
|
return /* @__PURE__ */ H(
|
|
1704
1728
|
"div",
|
|
1705
1729
|
{
|
|
@@ -1708,15 +1732,15 @@ const oi = "crk-root-uMSq0", ci = "crk-canvas-zhFr0", ii = "crk-svg-waPLB", li =
|
|
|
1708
1732
|
style: r,
|
|
1709
1733
|
children: [
|
|
1710
1734
|
/* @__PURE__ */ H("div", { className: x.canvas, style: { height: m || void 0 }, children: [
|
|
1711
|
-
|
|
1735
|
+
u > 0 && m > 0 && /* @__PURE__ */ s(
|
|
1712
1736
|
"svg",
|
|
1713
1737
|
{
|
|
1714
1738
|
className: f(x.svg, o?.svg),
|
|
1715
|
-
width:
|
|
1739
|
+
width: u,
|
|
1716
1740
|
height: m,
|
|
1717
|
-
viewBox: `0 0 ${
|
|
1741
|
+
viewBox: `0 0 ${u} ${m}`,
|
|
1718
1742
|
role: "img",
|
|
1719
|
-
children: l({ width:
|
|
1743
|
+
children: l({ width: u, height: m })
|
|
1720
1744
|
}
|
|
1721
1745
|
),
|
|
1722
1746
|
c
|
|
@@ -1727,7 +1751,7 @@ const oi = "crk-root-uMSq0", ci = "crk-canvas-zhFr0", ii = "crk-svg-waPLB", li =
|
|
|
1727
1751
|
);
|
|
1728
1752
|
}
|
|
1729
1753
|
);
|
|
1730
|
-
|
|
1754
|
+
Ye.displayName = "ChartContainer";
|
|
1731
1755
|
function vt({ config: e, order: t, classes: n }) {
|
|
1732
1756
|
const r = t ?? Object.keys(e);
|
|
1733
1757
|
return /* @__PURE__ */ s("div", { className: f(x.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
@@ -1766,30 +1790,30 @@ function et({
|
|
|
1766
1790
|
classes: h
|
|
1767
1791
|
}) {
|
|
1768
1792
|
if (!e) return null;
|
|
1769
|
-
const
|
|
1793
|
+
const d = 180, m = t + d + 16 > r ? t - d - 12 : t + 12, p = Math.max(8, n - 16);
|
|
1770
1794
|
return /* @__PURE__ */ s(
|
|
1771
1795
|
"div",
|
|
1772
1796
|
{
|
|
1773
1797
|
className: f(x.tooltip, h?.tooltip),
|
|
1774
|
-
style: { left: m, top: p, width:
|
|
1798
|
+
style: { left: m, top: p, width: d },
|
|
1775
1799
|
role: "tooltip",
|
|
1776
|
-
children: i ? i(e) : /* @__PURE__ */ H(
|
|
1800
|
+
children: i ? i(e) : /* @__PURE__ */ H(Ve, { children: [
|
|
1777
1801
|
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: x.tooltipTitle, children: String(e[l]) }),
|
|
1778
|
-
/* @__PURE__ */ s("div", { className: x.tooltipRows, children: Object.entries(o).map(([y,
|
|
1779
|
-
const
|
|
1780
|
-
if (
|
|
1781
|
-
const
|
|
1802
|
+
/* @__PURE__ */ s("div", { className: x.tooltipRows, children: Object.entries(o).map(([y, w]) => {
|
|
1803
|
+
const N = e[y];
|
|
1804
|
+
if (N == null) return null;
|
|
1805
|
+
const S = typeof N == "number" ? c(N) : String(N), O = a?.(y) ?? w.color;
|
|
1782
1806
|
return /* @__PURE__ */ H("div", { className: x.tooltipRow, children: [
|
|
1783
|
-
/* @__PURE__ */ s("span", { className: x.legendSwatch, style: { background:
|
|
1784
|
-
/* @__PURE__ */ s("span", { className: x.tooltipLabel, children:
|
|
1785
|
-
/* @__PURE__ */ s("span", { className: x.tooltipValue, children:
|
|
1807
|
+
/* @__PURE__ */ s("span", { className: x.legendSwatch, style: { background: O }, "aria-hidden": "true" }),
|
|
1808
|
+
/* @__PURE__ */ s("span", { className: x.tooltipLabel, children: w.label }),
|
|
1809
|
+
/* @__PURE__ */ s("span", { className: x.tooltipValue, children: S })
|
|
1786
1810
|
] }, y);
|
|
1787
1811
|
}) })
|
|
1788
1812
|
] })
|
|
1789
1813
|
}
|
|
1790
1814
|
);
|
|
1791
1815
|
}
|
|
1792
|
-
function
|
|
1816
|
+
function en({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: i }) {
|
|
1793
1817
|
return /* @__PURE__ */ s("g", { className: f(x.axis, i?.axis), children: e.map(({ value: c, y: l }) => /* @__PURE__ */ H("g", { children: [
|
|
1794
1818
|
o && /* @__PURE__ */ s(
|
|
1795
1819
|
"line",
|
|
@@ -1814,7 +1838,7 @@ function Jt({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1814
1838
|
)
|
|
1815
1839
|
] }, `y-${c}`)) });
|
|
1816
1840
|
}
|
|
1817
|
-
function
|
|
1841
|
+
function tn({ ticks: e, y: t, format: n, classes: r }) {
|
|
1818
1842
|
return /* @__PURE__ */ s("g", { className: f(x.axis, r?.axis), children: e.map(({ label: o, x: i }) => /* @__PURE__ */ s(
|
|
1819
1843
|
"text",
|
|
1820
1844
|
{
|
|
@@ -1842,10 +1866,10 @@ function Je(e, t) {
|
|
|
1842
1866
|
}
|
|
1843
1867
|
function Xe(e, t, n = 0.2) {
|
|
1844
1868
|
const [r, o] = t, c = (o - r) / Math.max(1, e.length), l = c * (1 - n), a = /* @__PURE__ */ new Map();
|
|
1845
|
-
for (let
|
|
1846
|
-
const h = (
|
|
1847
|
-
const
|
|
1848
|
-
return
|
|
1869
|
+
for (let d = 0; d < e.length; d++) a.set(e[d], d);
|
|
1870
|
+
const h = (d) => {
|
|
1871
|
+
const u = a.get(d);
|
|
1872
|
+
return u === void 0 ? r : r + u * c + c / 2;
|
|
1849
1873
|
};
|
|
1850
1874
|
return h.bandWidth = () => l, h.step = () => c, h;
|
|
1851
1875
|
}
|
|
@@ -1855,13 +1879,13 @@ function qe(e, t, n = 5) {
|
|
|
1855
1879
|
const o = (t - e) / Math.max(1, n), i = Math.pow(10, Math.floor(Math.log10(o))), c = o / i;
|
|
1856
1880
|
let l;
|
|
1857
1881
|
c < 1.5 ? l = i : c < 3 ? l = 2 * i : c < 7 ? l = 5 * i : l = 10 * i;
|
|
1858
|
-
const a = Math.floor(e / l) * l, h = Math.ceil(t / l) * l,
|
|
1859
|
-
for (let
|
|
1860
|
-
|
|
1861
|
-
return
|
|
1882
|
+
const a = Math.floor(e / l) * l, h = Math.ceil(t / l) * l, d = [];
|
|
1883
|
+
for (let u = a; u <= h + l / 2; u += l)
|
|
1884
|
+
d.push(Number(u.toFixed(10)));
|
|
1885
|
+
return d;
|
|
1862
1886
|
}
|
|
1863
|
-
const
|
|
1864
|
-
function
|
|
1887
|
+
const Ii = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
1888
|
+
function Ei(e, t) {
|
|
1865
1889
|
if (e.length === 0) return "";
|
|
1866
1890
|
if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
|
|
1867
1891
|
if (t === "linear")
|
|
@@ -1874,17 +1898,17 @@ function Di(e, t) {
|
|
|
1874
1898
|
}
|
|
1875
1899
|
let n = `M ${e[0].x} ${e[0].y}`;
|
|
1876
1900
|
for (let r = 0; r < e.length - 1; r++) {
|
|
1877
|
-
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6,
|
|
1878
|
-
n += ` C ${a} ${h}, ${
|
|
1901
|
+
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
|
|
1902
|
+
n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
|
|
1879
1903
|
}
|
|
1880
1904
|
return n;
|
|
1881
1905
|
}
|
|
1882
|
-
function
|
|
1906
|
+
function Pi(e, t = 8) {
|
|
1883
1907
|
if (e.length <= t) return e;
|
|
1884
1908
|
const n = Math.ceil(e.length / t);
|
|
1885
1909
|
return e.filter((r, o) => o % n === 0);
|
|
1886
1910
|
}
|
|
1887
|
-
function
|
|
1911
|
+
function Hl({
|
|
1888
1912
|
data: e,
|
|
1889
1913
|
xKey: t,
|
|
1890
1914
|
config: n,
|
|
@@ -1895,180 +1919,180 @@ function El({
|
|
|
1895
1919
|
dotColorKey: l,
|
|
1896
1920
|
renderDot: a,
|
|
1897
1921
|
showValues: h = !1,
|
|
1898
|
-
valuePosition:
|
|
1899
|
-
renderLabel:
|
|
1922
|
+
valuePosition: d = "top",
|
|
1923
|
+
renderLabel: u,
|
|
1900
1924
|
activeIndex: m,
|
|
1901
1925
|
onPointClick: p,
|
|
1902
1926
|
showGrid: y = !0,
|
|
1903
|
-
showLegend:
|
|
1904
|
-
showTooltip:
|
|
1905
|
-
yTickCount:
|
|
1906
|
-
yFormat:
|
|
1907
|
-
xFormat:
|
|
1908
|
-
valueFormat:
|
|
1909
|
-
renderTooltip:
|
|
1910
|
-
margin:
|
|
1927
|
+
showLegend: w = !0,
|
|
1928
|
+
showTooltip: N = !0,
|
|
1929
|
+
yTickCount: S = 5,
|
|
1930
|
+
yFormat: O,
|
|
1931
|
+
xFormat: P,
|
|
1932
|
+
valueFormat: U,
|
|
1933
|
+
renderTooltip: re,
|
|
1934
|
+
margin: D,
|
|
1911
1935
|
emptyMessage: C = "No data",
|
|
1912
|
-
className:
|
|
1913
|
-
style:
|
|
1914
|
-
classes:
|
|
1936
|
+
className: ee,
|
|
1937
|
+
style: se,
|
|
1938
|
+
classes: M
|
|
1915
1939
|
}) {
|
|
1916
|
-
const q = { ...
|
|
1940
|
+
const q = { ...Ii, ...D }, I = ke(() => Object.keys(n), [n]), [Q, F] = Se(null), W = ne(null), te = m ?? Q, oe = (v, k) => {
|
|
1917
1941
|
if (l) {
|
|
1918
|
-
const
|
|
1919
|
-
if (typeof
|
|
1942
|
+
const $ = e[k]?.[l];
|
|
1943
|
+
if (typeof $ == "string") return $;
|
|
1920
1944
|
}
|
|
1921
1945
|
return n[v]?.color ?? "var(--crk-chart-1)";
|
|
1922
1946
|
};
|
|
1923
1947
|
if (e.length === 0)
|
|
1924
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
1925
|
-
const L =
|
|
1948
|
+
return /* @__PURE__ */ s("div", { ref: W, className: f(x.root, M?.root, ee), style: se, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
|
|
1949
|
+
const L = N && te !== null ? /* @__PURE__ */ s(
|
|
1926
1950
|
et,
|
|
1927
1951
|
{
|
|
1928
|
-
row: e[
|
|
1929
|
-
x:
|
|
1952
|
+
row: e[te],
|
|
1953
|
+
x: Wi(e, t, q, te, W),
|
|
1930
1954
|
y: 16,
|
|
1931
|
-
containerWidth:
|
|
1955
|
+
containerWidth: W.current?.getBoundingClientRect().width ?? 0,
|
|
1932
1956
|
config: n,
|
|
1933
|
-
render:
|
|
1934
|
-
valueFormat:
|
|
1957
|
+
render: re ? () => re(e[te]) : void 0,
|
|
1958
|
+
valueFormat: U,
|
|
1935
1959
|
titleKey: t,
|
|
1936
|
-
resolveColor: l ? (v) =>
|
|
1937
|
-
classes:
|
|
1960
|
+
resolveColor: l ? (v) => oe(v, te) : void 0,
|
|
1961
|
+
classes: M
|
|
1938
1962
|
}
|
|
1939
1963
|
) : null;
|
|
1940
1964
|
return /* @__PURE__ */ s(
|
|
1941
|
-
|
|
1965
|
+
Ye,
|
|
1942
1966
|
{
|
|
1943
|
-
ref:
|
|
1967
|
+
ref: W,
|
|
1944
1968
|
aspectRatio: r,
|
|
1945
1969
|
height: o,
|
|
1946
|
-
className:
|
|
1947
|
-
style:
|
|
1948
|
-
classes:
|
|
1949
|
-
legend:
|
|
1970
|
+
className: ee,
|
|
1971
|
+
style: se,
|
|
1972
|
+
classes: M,
|
|
1973
|
+
legend: w ? /* @__PURE__ */ s(vt, { config: n, classes: M }) : void 0,
|
|
1950
1974
|
overlay: L,
|
|
1951
|
-
children: ({ width: v, height:
|
|
1952
|
-
const
|
|
1953
|
-
for (const g of
|
|
1975
|
+
children: ({ width: v, height: k }) => {
|
|
1976
|
+
const $ = q.left, z = v - q.right, T = q.top, j = k - q.bottom, V = Math.max(0, z - $), G = Math.max(0, j - T), Z = e.map((g) => String(g[t])), _ = Xe(Z, [$, z], 0), J = [];
|
|
1977
|
+
for (const g of I)
|
|
1954
1978
|
for (const b of e) {
|
|
1955
1979
|
const K = b[g];
|
|
1956
1980
|
typeof K == "number" && J.push(K);
|
|
1957
1981
|
}
|
|
1958
|
-
const [ue, be] = bt(J), pe = Math.min(0, ue), fe = qe(pe, be,
|
|
1959
|
-
return /* @__PURE__ */ H(
|
|
1982
|
+
const [ue, be] = bt(J), pe = Math.min(0, ue), fe = qe(pe, be, S), ge = Je([fe[0], fe[fe.length - 1]], [j, T]), ve = fe.map((g) => ({ value: g, y: ge(g) })), Ne = Pi(Z).map((g) => ({ label: g, x: _(g) }));
|
|
1983
|
+
return /* @__PURE__ */ H(Ve, { children: [
|
|
1960
1984
|
/* @__PURE__ */ s(
|
|
1961
|
-
|
|
1985
|
+
en,
|
|
1962
1986
|
{
|
|
1963
1987
|
ticks: ve,
|
|
1964
|
-
x:
|
|
1965
|
-
plotWidth:
|
|
1966
|
-
format:
|
|
1988
|
+
x: $,
|
|
1989
|
+
plotWidth: V,
|
|
1990
|
+
format: O,
|
|
1967
1991
|
showGrid: y,
|
|
1968
|
-
classes:
|
|
1992
|
+
classes: M
|
|
1969
1993
|
}
|
|
1970
1994
|
),
|
|
1971
|
-
/* @__PURE__ */ s(
|
|
1972
|
-
|
|
1973
|
-
const b = n[g], K = e.map((B,
|
|
1995
|
+
/* @__PURE__ */ s(tn, { ticks: Ne, y: j, format: P, classes: M }),
|
|
1996
|
+
I.map((g) => {
|
|
1997
|
+
const b = n[g], K = e.map((B, X) => {
|
|
1974
1998
|
const A = B[g], de = typeof A == "number" ? A : 0;
|
|
1975
|
-
return { x:
|
|
1999
|
+
return { x: _(Z[X]), y: ge(de), value: de, row: B };
|
|
1976
2000
|
});
|
|
1977
|
-
return /* @__PURE__ */ H("g", { className: f(x.series,
|
|
2001
|
+
return /* @__PURE__ */ H("g", { className: f(x.series, M?.series), children: [
|
|
1978
2002
|
/* @__PURE__ */ s(
|
|
1979
2003
|
"path",
|
|
1980
2004
|
{
|
|
1981
2005
|
className: f(x.linePath),
|
|
1982
|
-
d:
|
|
2006
|
+
d: Ei(K, i),
|
|
1983
2007
|
stroke: b.color
|
|
1984
2008
|
}
|
|
1985
2009
|
),
|
|
1986
|
-
c && K.map((B,
|
|
1987
|
-
const A =
|
|
2010
|
+
c && K.map((B, X) => {
|
|
2011
|
+
const A = oe(g, X), de = te === X, Y = m !== void 0 && !de, R = p ? () => p({ row: B.row, value: B.value, seriesKey: g, index: X }) : void 0;
|
|
1988
2012
|
return a ? /* @__PURE__ */ s(
|
|
1989
2013
|
"g",
|
|
1990
2014
|
{
|
|
1991
|
-
onClick:
|
|
1992
|
-
style:
|
|
1993
|
-
opacity:
|
|
2015
|
+
onClick: R,
|
|
2016
|
+
style: R ? { cursor: "pointer" } : void 0,
|
|
2017
|
+
opacity: Y ? 0.45 : 1,
|
|
1994
2018
|
children: a({
|
|
1995
2019
|
row: B.row,
|
|
1996
2020
|
value: B.value,
|
|
1997
2021
|
seriesKey: g,
|
|
1998
|
-
index:
|
|
2022
|
+
index: X,
|
|
1999
2023
|
x: B.x,
|
|
2000
2024
|
y: B.y,
|
|
2001
2025
|
color: A,
|
|
2002
2026
|
active: de
|
|
2003
2027
|
})
|
|
2004
2028
|
},
|
|
2005
|
-
`${g}-${
|
|
2029
|
+
`${g}-${X}`
|
|
2006
2030
|
) : /* @__PURE__ */ s(
|
|
2007
2031
|
"circle",
|
|
2008
2032
|
{
|
|
2009
|
-
className: f(x.point,
|
|
2033
|
+
className: f(x.point, M?.point),
|
|
2010
2034
|
cx: B.x,
|
|
2011
2035
|
cy: B.y,
|
|
2012
2036
|
r: de ? 5 : 3.5,
|
|
2013
2037
|
fill: A,
|
|
2014
|
-
onClick:
|
|
2015
|
-
style:
|
|
2016
|
-
opacity:
|
|
2038
|
+
onClick: R,
|
|
2039
|
+
style: R ? { cursor: "pointer" } : void 0,
|
|
2040
|
+
opacity: Y ? 0.45 : 1
|
|
2017
2041
|
},
|
|
2018
|
-
`${g}-${
|
|
2042
|
+
`${g}-${X}`
|
|
2019
2043
|
);
|
|
2020
2044
|
}),
|
|
2021
|
-
(h ||
|
|
2022
|
-
const A =
|
|
2045
|
+
(h || u) && K.map((B, X) => {
|
|
2046
|
+
const A = u ? u({ row: B.row, value: B.value, seriesKey: g, index: X }) : h ? U ? U(B.value) : String(B.value) : null;
|
|
2023
2047
|
if (A == null) return null;
|
|
2024
|
-
const de = 10,
|
|
2048
|
+
const de = 10, Y = d === "top" ? B.y - de : B.y + de + 4;
|
|
2025
2049
|
return /* @__PURE__ */ s(
|
|
2026
2050
|
"text",
|
|
2027
2051
|
{
|
|
2028
2052
|
className: f(x.axisLabel),
|
|
2029
2053
|
x: B.x,
|
|
2030
|
-
y:
|
|
2054
|
+
y: Y,
|
|
2031
2055
|
textAnchor: "middle",
|
|
2032
|
-
dominantBaseline:
|
|
2056
|
+
dominantBaseline: d === "top" ? "auto" : "middle",
|
|
2033
2057
|
children: A
|
|
2034
2058
|
},
|
|
2035
|
-
`label-${g}-${
|
|
2059
|
+
`label-${g}-${X}`
|
|
2036
2060
|
);
|
|
2037
2061
|
})
|
|
2038
2062
|
] }, g);
|
|
2039
2063
|
}),
|
|
2040
|
-
|
|
2064
|
+
te !== null && /* @__PURE__ */ s(
|
|
2041
2065
|
"line",
|
|
2042
2066
|
{
|
|
2043
2067
|
className: x.cursorLine,
|
|
2044
|
-
x1:
|
|
2045
|
-
x2:
|
|
2046
|
-
y1:
|
|
2047
|
-
y2:
|
|
2068
|
+
x1: _(Z[te]),
|
|
2069
|
+
x2: _(Z[te]),
|
|
2070
|
+
y1: T,
|
|
2071
|
+
y2: j
|
|
2048
2072
|
}
|
|
2049
2073
|
),
|
|
2050
2074
|
/* @__PURE__ */ s(
|
|
2051
2075
|
"rect",
|
|
2052
2076
|
{
|
|
2053
2077
|
className: x.interactionLayer,
|
|
2054
|
-
x:
|
|
2055
|
-
y:
|
|
2056
|
-
width:
|
|
2078
|
+
x: $,
|
|
2079
|
+
y: T,
|
|
2080
|
+
width: V,
|
|
2057
2081
|
height: G,
|
|
2058
2082
|
onMouseMove: (g) => {
|
|
2059
|
-
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left +
|
|
2083
|
+
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + $, B = _.step(), X = Math.max(
|
|
2060
2084
|
0,
|
|
2061
|
-
Math.min(e.length - 1, Math.round((K -
|
|
2085
|
+
Math.min(e.length - 1, Math.round((K - $ - B / 2) / B))
|
|
2062
2086
|
);
|
|
2063
|
-
|
|
2087
|
+
F(X);
|
|
2064
2088
|
},
|
|
2065
|
-
onMouseLeave: () =>
|
|
2089
|
+
onMouseLeave: () => F(null),
|
|
2066
2090
|
onClick: p ? (g) => {
|
|
2067
|
-
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left +
|
|
2091
|
+
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + $, B = _.step(), X = Math.max(
|
|
2068
2092
|
0,
|
|
2069
|
-
Math.min(e.length - 1, Math.round((K -
|
|
2070
|
-
), A =
|
|
2071
|
-
p({ row: e[
|
|
2093
|
+
Math.min(e.length - 1, Math.round((K - $ - B / 2) / B))
|
|
2094
|
+
), A = I[0], de = e[X][A], Y = typeof de == "number" ? de : 0;
|
|
2095
|
+
p({ row: e[X], value: Y, seriesKey: A, index: X });
|
|
2072
2096
|
} : void 0,
|
|
2073
2097
|
style: p ? { cursor: "pointer" } : void 0
|
|
2074
2098
|
}
|
|
@@ -2078,13 +2102,13 @@ function El({
|
|
|
2078
2102
|
}
|
|
2079
2103
|
);
|
|
2080
2104
|
}
|
|
2081
|
-
function
|
|
2105
|
+
function Wi(e, t, n, r, o) {
|
|
2082
2106
|
const i = o.current;
|
|
2083
2107
|
if (!i) return 0;
|
|
2084
2108
|
const c = i.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2085
2109
|
return Xe(l, [n.left, c - n.right], 0)(l[r]);
|
|
2086
2110
|
}
|
|
2087
|
-
const
|
|
2111
|
+
const Hi = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
2088
2112
|
function St(e, t) {
|
|
2089
2113
|
if (e.length === 0) return "";
|
|
2090
2114
|
if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
|
|
@@ -2098,8 +2122,8 @@ function St(e, t) {
|
|
|
2098
2122
|
}
|
|
2099
2123
|
let n = `M ${e[0].x} ${e[0].y}`;
|
|
2100
2124
|
for (let r = 0; r < e.length - 1; r++) {
|
|
2101
|
-
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6,
|
|
2102
|
-
n += ` C ${a} ${h}, ${
|
|
2125
|
+
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
|
|
2126
|
+
n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
|
|
2103
2127
|
}
|
|
2104
2128
|
return n;
|
|
2105
2129
|
}
|
|
@@ -2113,12 +2137,12 @@ function Dt(e, t, n) {
|
|
|
2113
2137
|
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), c = St(o, n).replace(/^M /, "L ");
|
|
2114
2138
|
return `${r} ${c} Z`;
|
|
2115
2139
|
}
|
|
2116
|
-
function
|
|
2140
|
+
function Oi(e, t = 8) {
|
|
2117
2141
|
if (e.length <= t) return e;
|
|
2118
2142
|
const n = Math.ceil(e.length / t);
|
|
2119
2143
|
return e.filter((r, o) => o % n === 0);
|
|
2120
2144
|
}
|
|
2121
|
-
function
|
|
2145
|
+
function Ol({
|
|
2122
2146
|
data: e,
|
|
2123
2147
|
xKey: t,
|
|
2124
2148
|
config: n,
|
|
@@ -2129,95 +2153,95 @@ function Pl({
|
|
|
2129
2153
|
stackOffset: l = "none",
|
|
2130
2154
|
fillGradient: a = !1,
|
|
2131
2155
|
showGrid: h = !0,
|
|
2132
|
-
showXAxis:
|
|
2133
|
-
showYAxis:
|
|
2156
|
+
showXAxis: d = !0,
|
|
2157
|
+
showYAxis: u = !0,
|
|
2134
2158
|
showLegend: m = !0,
|
|
2135
2159
|
showTooltip: p = !0,
|
|
2136
2160
|
yTickCount: y = 5,
|
|
2137
|
-
yFormat:
|
|
2138
|
-
xFormat:
|
|
2139
|
-
valueFormat:
|
|
2140
|
-
renderTooltip:
|
|
2141
|
-
margin:
|
|
2142
|
-
emptyMessage:
|
|
2143
|
-
className:
|
|
2144
|
-
style:
|
|
2161
|
+
yFormat: w,
|
|
2162
|
+
xFormat: N,
|
|
2163
|
+
valueFormat: S,
|
|
2164
|
+
renderTooltip: O,
|
|
2165
|
+
margin: P,
|
|
2166
|
+
emptyMessage: U = "No data",
|
|
2167
|
+
className: re,
|
|
2168
|
+
style: D,
|
|
2145
2169
|
classes: C
|
|
2146
2170
|
}) {
|
|
2147
|
-
const
|
|
2171
|
+
const ee = ke(
|
|
2148
2172
|
() => ({
|
|
2149
|
-
...
|
|
2150
|
-
...
|
|
2151
|
-
...
|
|
2173
|
+
...Hi,
|
|
2174
|
+
...u ? {} : { left: 16 },
|
|
2175
|
+
...P
|
|
2152
2176
|
}),
|
|
2153
|
-
[
|
|
2154
|
-
),
|
|
2177
|
+
[P, u]
|
|
2178
|
+
), se = ke(() => Object.keys(n), [n]), M = c && se.length > 0, q = M && l === "expand", [I, Q] = Se(null), F = ne(null), W = ze();
|
|
2155
2179
|
if (e.length === 0)
|
|
2156
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2157
|
-
const
|
|
2158
|
-
const
|
|
2159
|
-
for (let
|
|
2160
|
-
let
|
|
2180
|
+
return /* @__PURE__ */ s("div", { ref: F, className: f(x.root, C?.root, re), style: D, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: U }) }) });
|
|
2181
|
+
const te = ke(() => {
|
|
2182
|
+
const $ = se.map(() => []), z = se.map(() => []);
|
|
2183
|
+
for (let T = 0; T < e.length; T++) {
|
|
2184
|
+
let j = 0;
|
|
2161
2185
|
if (q) {
|
|
2162
|
-
for (const G of
|
|
2163
|
-
const Z = e[
|
|
2164
|
-
typeof Z == "number" && Z > 0 && (
|
|
2186
|
+
for (const G of se) {
|
|
2187
|
+
const Z = e[T][G];
|
|
2188
|
+
typeof Z == "number" && Z > 0 && (j += Z);
|
|
2165
2189
|
}
|
|
2166
|
-
|
|
2190
|
+
j === 0 && (j = 1);
|
|
2167
2191
|
}
|
|
2168
|
-
let
|
|
2169
|
-
for (let G = 0; G <
|
|
2170
|
-
const Z =
|
|
2171
|
-
if (
|
|
2172
|
-
const ue = q ? J /
|
|
2173
|
-
z[G][
|
|
2192
|
+
let V = 0;
|
|
2193
|
+
for (let G = 0; G < se.length; G++) {
|
|
2194
|
+
const Z = se[G], _ = e[T][Z], J = typeof _ == "number" ? _ : 0;
|
|
2195
|
+
if (M) {
|
|
2196
|
+
const ue = q ? J / j : J;
|
|
2197
|
+
z[G][T] = V, V += ue, $[G][T] = V;
|
|
2174
2198
|
} else
|
|
2175
|
-
z[G][
|
|
2199
|
+
z[G][T] = 0, $[G][T] = J;
|
|
2176
2200
|
}
|
|
2177
2201
|
}
|
|
2178
|
-
return { tops:
|
|
2179
|
-
}, [e,
|
|
2202
|
+
return { tops: $, bottoms: z };
|
|
2203
|
+
}, [e, se, M, q]), { tops: oe, bottoms: L } = te, [v, k] = ke(() => {
|
|
2180
2204
|
if (q) return [0, 1];
|
|
2181
|
-
let
|
|
2182
|
-
for (const
|
|
2183
|
-
for (const
|
|
2184
|
-
|
|
2185
|
-
for (const
|
|
2186
|
-
for (const
|
|
2187
|
-
|
|
2188
|
-
return [Math.min(0,
|
|
2189
|
-
}, [
|
|
2205
|
+
let $ = 0, z = 0;
|
|
2206
|
+
for (const T of oe)
|
|
2207
|
+
for (const j of T)
|
|
2208
|
+
j < $ && ($ = j), j > z && (z = j);
|
|
2209
|
+
for (const T of L)
|
|
2210
|
+
for (const j of T)
|
|
2211
|
+
j < $ && ($ = j);
|
|
2212
|
+
return [Math.min(0, $), z];
|
|
2213
|
+
}, [oe, L, q]);
|
|
2190
2214
|
return /* @__PURE__ */ s(
|
|
2191
|
-
|
|
2215
|
+
Ye,
|
|
2192
2216
|
{
|
|
2193
|
-
ref:
|
|
2217
|
+
ref: F,
|
|
2194
2218
|
aspectRatio: r,
|
|
2195
2219
|
height: o,
|
|
2196
|
-
className:
|
|
2197
|
-
style:
|
|
2220
|
+
className: re,
|
|
2221
|
+
style: D,
|
|
2198
2222
|
classes: C,
|
|
2199
2223
|
legend: m ? /* @__PURE__ */ s(vt, { config: n, classes: C }) : void 0,
|
|
2200
|
-
overlay: p &&
|
|
2224
|
+
overlay: p && I !== null ? /* @__PURE__ */ s(
|
|
2201
2225
|
et,
|
|
2202
2226
|
{
|
|
2203
|
-
row: e[
|
|
2204
|
-
x:
|
|
2227
|
+
row: e[I],
|
|
2228
|
+
x: Fi(e, t, ee, I, F),
|
|
2205
2229
|
y: 16,
|
|
2206
|
-
containerWidth:
|
|
2230
|
+
containerWidth: F.current?.getBoundingClientRect().width ?? 0,
|
|
2207
2231
|
config: n,
|
|
2208
|
-
render:
|
|
2209
|
-
valueFormat: q ? (
|
|
2232
|
+
render: O ? () => O(e[I]) : void 0,
|
|
2233
|
+
valueFormat: q ? ($) => `${Math.round($ * 100)}%` : S,
|
|
2210
2234
|
titleKey: t,
|
|
2211
2235
|
classes: C
|
|
2212
2236
|
}
|
|
2213
2237
|
) : null,
|
|
2214
|
-
children: ({ width:
|
|
2215
|
-
const
|
|
2216
|
-
return /* @__PURE__ */ H(
|
|
2217
|
-
a && /* @__PURE__ */ s("defs", { children:
|
|
2238
|
+
children: ({ width: $, height: z }) => {
|
|
2239
|
+
const T = ee.left, j = $ - ee.right, V = ee.top, G = z - ee.bottom, Z = Math.max(0, j - T), _ = Math.max(0, G - V), J = e.map((g) => String(g[t])), ue = Xe(J, [T, j], 0), be = q ? [0, 0.25, 0.5, 0.75, 1] : qe(v, k, y), pe = Je([be[0], be[be.length - 1]], [G, V]), fe = pe(0), ge = be.map((g) => ({ value: g, y: pe(g) })), Re = Oi(J).map((g) => ({ label: g, x: ue(g) })), Ne = q ? (g) => `${Math.round(g * 100)}%` : w;
|
|
2240
|
+
return /* @__PURE__ */ H(Ve, { children: [
|
|
2241
|
+
a && /* @__PURE__ */ s("defs", { children: se.map((g) => /* @__PURE__ */ H(
|
|
2218
2242
|
"linearGradient",
|
|
2219
2243
|
{
|
|
2220
|
-
id: `${
|
|
2244
|
+
id: `${W}-${g}`,
|
|
2221
2245
|
x1: "0",
|
|
2222
2246
|
y1: "0",
|
|
2223
2247
|
x2: "0",
|
|
@@ -2229,11 +2253,11 @@ function Pl({
|
|
|
2229
2253
|
},
|
|
2230
2254
|
g
|
|
2231
2255
|
)) }),
|
|
2232
|
-
|
|
2233
|
-
|
|
2256
|
+
u ? /* @__PURE__ */ s(
|
|
2257
|
+
en,
|
|
2234
2258
|
{
|
|
2235
2259
|
ticks: ge,
|
|
2236
|
-
x:
|
|
2260
|
+
x: T,
|
|
2237
2261
|
plotWidth: Z,
|
|
2238
2262
|
format: Ne,
|
|
2239
2263
|
showGrid: h,
|
|
@@ -2243,50 +2267,50 @@ function Pl({
|
|
|
2243
2267
|
"line",
|
|
2244
2268
|
{
|
|
2245
2269
|
className: f(x.gridLine, C?.grid),
|
|
2246
|
-
x1:
|
|
2247
|
-
x2:
|
|
2270
|
+
x1: T,
|
|
2271
|
+
x2: j,
|
|
2248
2272
|
y1: b,
|
|
2249
2273
|
y2: b
|
|
2250
2274
|
},
|
|
2251
2275
|
`grid-${g}`
|
|
2252
2276
|
)) }),
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
const K = n[g], B = e.map((
|
|
2256
|
-
x: ue(J[
|
|
2257
|
-
y: pe(
|
|
2258
|
-
})),
|
|
2277
|
+
d && /* @__PURE__ */ s(tn, { ticks: Re, y: G, format: N, classes: C }),
|
|
2278
|
+
se.map((g, b) => {
|
|
2279
|
+
const K = n[g], B = e.map((Y, R) => ({
|
|
2280
|
+
x: ue(J[R]),
|
|
2281
|
+
y: pe(oe[b][R])
|
|
2282
|
+
})), X = a ? `url(#${W}-${g})` : K.color, A = a ? 1 : 0.18, de = M ? Dt(B, L[b].map((Y) => pe(Y)), i) : Dt(B, fe, i);
|
|
2259
2283
|
return /* @__PURE__ */ H("g", { className: f(x.series, C?.series), children: [
|
|
2260
2284
|
/* @__PURE__ */ s(
|
|
2261
2285
|
"path",
|
|
2262
2286
|
{
|
|
2263
2287
|
className: x.areaPath,
|
|
2264
2288
|
d: de,
|
|
2265
|
-
fill:
|
|
2289
|
+
fill: X,
|
|
2266
2290
|
fillOpacity: A
|
|
2267
2291
|
}
|
|
2268
2292
|
),
|
|
2269
2293
|
/* @__PURE__ */ s("path", { className: x.linePath, d: St(B, i), stroke: K.color }),
|
|
2270
|
-
!
|
|
2294
|
+
!M && B.map((Y, R) => /* @__PURE__ */ s(
|
|
2271
2295
|
"circle",
|
|
2272
2296
|
{
|
|
2273
2297
|
className: f(x.point, C?.point),
|
|
2274
|
-
cx:
|
|
2275
|
-
cy:
|
|
2276
|
-
r:
|
|
2298
|
+
cx: Y.x,
|
|
2299
|
+
cy: Y.y,
|
|
2300
|
+
r: I === R ? 5 : 3,
|
|
2277
2301
|
fill: K.color
|
|
2278
2302
|
},
|
|
2279
|
-
`${g}-${
|
|
2303
|
+
`${g}-${R}`
|
|
2280
2304
|
))
|
|
2281
2305
|
] }, g);
|
|
2282
2306
|
}),
|
|
2283
|
-
|
|
2307
|
+
I !== null && /* @__PURE__ */ s(
|
|
2284
2308
|
"line",
|
|
2285
2309
|
{
|
|
2286
2310
|
className: x.cursorLine,
|
|
2287
|
-
x1: ue(J[
|
|
2288
|
-
x2: ue(J[
|
|
2289
|
-
y1:
|
|
2311
|
+
x1: ue(J[I]),
|
|
2312
|
+
x2: ue(J[I]),
|
|
2313
|
+
y1: V,
|
|
2290
2314
|
y2: G
|
|
2291
2315
|
}
|
|
2292
2316
|
),
|
|
@@ -2294,13 +2318,13 @@ function Pl({
|
|
|
2294
2318
|
"rect",
|
|
2295
2319
|
{
|
|
2296
2320
|
className: x.interactionLayer,
|
|
2297
|
-
x:
|
|
2298
|
-
y:
|
|
2321
|
+
x: T,
|
|
2322
|
+
y: V,
|
|
2299
2323
|
width: Z,
|
|
2300
|
-
height:
|
|
2324
|
+
height: _,
|
|
2301
2325
|
onMouseMove: (g) => {
|
|
2302
|
-
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left +
|
|
2303
|
-
Q(
|
|
2326
|
+
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + T, B = ue.step(), X = Math.max(0, Math.min(e.length - 1, Math.round((K - T - B / 2) / B)));
|
|
2327
|
+
Q(X);
|
|
2304
2328
|
},
|
|
2305
2329
|
onMouseLeave: () => Q(null)
|
|
2306
2330
|
}
|
|
@@ -2310,25 +2334,25 @@ function Pl({
|
|
|
2310
2334
|
}
|
|
2311
2335
|
);
|
|
2312
2336
|
}
|
|
2313
|
-
function
|
|
2337
|
+
function Fi(e, t, n, r, o) {
|
|
2314
2338
|
const i = o.current;
|
|
2315
2339
|
if (!i) return 0;
|
|
2316
2340
|
const c = i.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2317
2341
|
return Xe(l, [n.left, c - n.right], 0)(l[r]);
|
|
2318
2342
|
}
|
|
2319
|
-
const
|
|
2343
|
+
const ji = [
|
|
2320
2344
|
"var(--crk-chart-1)",
|
|
2321
2345
|
"var(--crk-chart-2)",
|
|
2322
2346
|
"var(--crk-chart-3)",
|
|
2323
2347
|
"var(--crk-chart-4)",
|
|
2324
2348
|
"var(--crk-chart-5)"
|
|
2325
|
-
],
|
|
2326
|
-
function
|
|
2349
|
+
], Xi = { top: 12, right: 16, bottom: 28, left: 48 }, Ui = { top: 12, right: 16, bottom: 28, left: 72 };
|
|
2350
|
+
function _i(e, t = 8) {
|
|
2327
2351
|
if (e.length <= t) return e;
|
|
2328
2352
|
const n = Math.ceil(e.length / t);
|
|
2329
2353
|
return e.filter((r, o) => o % n === 0);
|
|
2330
2354
|
}
|
|
2331
|
-
function
|
|
2355
|
+
function Fl({
|
|
2332
2356
|
data: e,
|
|
2333
2357
|
xKey: t,
|
|
2334
2358
|
config: n,
|
|
@@ -2339,37 +2363,37 @@ function Wl({
|
|
|
2339
2363
|
groupPadding: l = 0.2,
|
|
2340
2364
|
barPadding: a = 0.1,
|
|
2341
2365
|
barRadius: h = 4,
|
|
2342
|
-
showGrid:
|
|
2343
|
-
showLegend:
|
|
2366
|
+
showGrid: d = !0,
|
|
2367
|
+
showLegend: u = !0,
|
|
2344
2368
|
showTooltip: m = !0,
|
|
2345
2369
|
showValues: p = !1,
|
|
2346
2370
|
valuePosition: y = "outside",
|
|
2347
|
-
renderLabel:
|
|
2348
|
-
colorBy:
|
|
2349
|
-
colors:
|
|
2350
|
-
negativeColor:
|
|
2351
|
-
activeIndex:
|
|
2352
|
-
onBarClick:
|
|
2353
|
-
yTickCount:
|
|
2354
|
-
yFormat:
|
|
2371
|
+
renderLabel: w,
|
|
2372
|
+
colorBy: N = "series",
|
|
2373
|
+
colors: S = ji,
|
|
2374
|
+
negativeColor: O,
|
|
2375
|
+
activeIndex: P,
|
|
2376
|
+
onBarClick: U,
|
|
2377
|
+
yTickCount: re = 5,
|
|
2378
|
+
yFormat: D,
|
|
2355
2379
|
xFormat: C,
|
|
2356
|
-
valueFormat:
|
|
2357
|
-
renderTooltip:
|
|
2358
|
-
margin:
|
|
2380
|
+
valueFormat: ee,
|
|
2381
|
+
renderTooltip: se,
|
|
2382
|
+
margin: M,
|
|
2359
2383
|
emptyMessage: q = "No data",
|
|
2360
|
-
className:
|
|
2384
|
+
className: I,
|
|
2361
2385
|
style: Q,
|
|
2362
|
-
classes:
|
|
2386
|
+
classes: F
|
|
2363
2387
|
}) {
|
|
2364
|
-
const
|
|
2388
|
+
const W = r === "horizontal", te = { ...W ? Ui : Xi, ...M }, oe = ke(() => Object.keys(n), [n]), L = o && oe.length > 1, [v, k] = Se(null), $ = ne(null);
|
|
2365
2389
|
if (e.length === 0)
|
|
2366
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2367
|
-
const z = e.map((ue) => String(ue[t])),
|
|
2390
|
+
return /* @__PURE__ */ s("div", { ref: $, className: f(x.root, F?.root, I), style: Q, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: q }) }) });
|
|
2391
|
+
const z = e.map((ue) => String(ue[t])), T = P ?? v, j = ke(() => {
|
|
2368
2392
|
if (L) {
|
|
2369
2393
|
let fe = 0, ge = 0;
|
|
2370
2394
|
for (const ve of e) {
|
|
2371
2395
|
let Re = 0, Ne = 0;
|
|
2372
|
-
for (const g of
|
|
2396
|
+
for (const g of oe) {
|
|
2373
2397
|
const b = ve[g];
|
|
2374
2398
|
typeof b == "number" && (b >= 0 ? Re += b : Ne += b);
|
|
2375
2399
|
}
|
|
@@ -2379,140 +2403,140 @@ function Wl({
|
|
|
2379
2403
|
}
|
|
2380
2404
|
const ue = [];
|
|
2381
2405
|
for (const fe of e)
|
|
2382
|
-
for (const ge of
|
|
2406
|
+
for (const ge of oe) {
|
|
2383
2407
|
const ve = fe[ge];
|
|
2384
2408
|
typeof ve == "number" && ue.push(ve);
|
|
2385
2409
|
}
|
|
2386
2410
|
const [be, pe] = bt(ue);
|
|
2387
2411
|
return [Math.min(0, be), Math.max(0, pe)];
|
|
2388
|
-
}, [e,
|
|
2412
|
+
}, [e, oe, L]), V = qe(j[0], j[1], re), G = V[0], Z = V[V.length - 1], _ = (ue, be) => N === "index" ? S[be % S.length] : n[ue]?.color ?? S[0], J = m && T !== null && e[T] ? /* @__PURE__ */ s(
|
|
2389
2413
|
et,
|
|
2390
2414
|
{
|
|
2391
|
-
row: e[
|
|
2392
|
-
x:
|
|
2393
|
-
y:
|
|
2394
|
-
containerWidth:
|
|
2415
|
+
row: e[T],
|
|
2416
|
+
x: Vi(e, t, te, T, $, W, l),
|
|
2417
|
+
y: W ? Yi(e, t, te, T, $, l) : 16,
|
|
2418
|
+
containerWidth: $.current?.getBoundingClientRect().width ?? 0,
|
|
2395
2419
|
config: n,
|
|
2396
|
-
render:
|
|
2397
|
-
valueFormat:
|
|
2420
|
+
render: se ? () => se(e[T]) : void 0,
|
|
2421
|
+
valueFormat: ee,
|
|
2398
2422
|
titleKey: t,
|
|
2399
2423
|
resolveColor: (ue) => {
|
|
2400
|
-
const be = e[
|
|
2401
|
-
return typeof be != "number" ? pe :
|
|
2424
|
+
const be = e[T][ue], pe = _(ue, T);
|
|
2425
|
+
return typeof be != "number" ? pe : O !== void 0 && be < 0 ? O : pe;
|
|
2402
2426
|
},
|
|
2403
|
-
classes:
|
|
2427
|
+
classes: F
|
|
2404
2428
|
}
|
|
2405
2429
|
) : null;
|
|
2406
2430
|
return /* @__PURE__ */ s(
|
|
2407
|
-
|
|
2431
|
+
Ye,
|
|
2408
2432
|
{
|
|
2409
|
-
ref:
|
|
2433
|
+
ref: $,
|
|
2410
2434
|
aspectRatio: i,
|
|
2411
2435
|
height: c,
|
|
2412
|
-
className:
|
|
2436
|
+
className: I,
|
|
2413
2437
|
style: Q,
|
|
2414
|
-
classes:
|
|
2415
|
-
legend:
|
|
2438
|
+
classes: F,
|
|
2439
|
+
legend: u ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
|
|
2416
2440
|
overlay: J,
|
|
2417
2441
|
children: ({ width: ue, height: be }) => {
|
|
2418
|
-
const pe =
|
|
2419
|
-
value:
|
|
2420
|
-
pos:
|
|
2421
|
-
})), me =
|
|
2422
|
-
return /* @__PURE__ */ H(
|
|
2423
|
-
|
|
2424
|
-
({ value:
|
|
2442
|
+
const pe = te.left, fe = ue - te.right, ge = te.top, ve = be - te.bottom, Re = Math.max(0, fe - pe), Ne = Math.max(0, ve - ge), b = Xe(z, W ? [ge, ve] : [pe, fe], l), K = b.bandWidth(), X = Je([G, Z], W ? [pe, fe] : [ve, ge]), A = X(0), de = L ? 1 : Math.max(1, oe.length), Y = K / de, R = Y * (1 - a), ie = V.map((ce) => ({
|
|
2443
|
+
value: ce,
|
|
2444
|
+
pos: X(ce)
|
|
2445
|
+
})), me = _i(z);
|
|
2446
|
+
return /* @__PURE__ */ H(Ve, { children: [
|
|
2447
|
+
d && /* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: ie.map(
|
|
2448
|
+
({ value: ce, pos: ae }) => W ? /* @__PURE__ */ s(
|
|
2425
2449
|
"line",
|
|
2426
2450
|
{
|
|
2427
|
-
className: f(x.gridLine,
|
|
2428
|
-
x1:
|
|
2429
|
-
x2:
|
|
2451
|
+
className: f(x.gridLine, F?.grid),
|
|
2452
|
+
x1: ae,
|
|
2453
|
+
x2: ae,
|
|
2430
2454
|
y1: ge,
|
|
2431
2455
|
y2: ve
|
|
2432
2456
|
},
|
|
2433
|
-
`g-${
|
|
2457
|
+
`g-${ce}`
|
|
2434
2458
|
) : /* @__PURE__ */ s(
|
|
2435
2459
|
"line",
|
|
2436
2460
|
{
|
|
2437
|
-
className: f(x.gridLine,
|
|
2461
|
+
className: f(x.gridLine, F?.grid),
|
|
2438
2462
|
x1: pe,
|
|
2439
2463
|
x2: fe,
|
|
2440
|
-
y1:
|
|
2441
|
-
y2:
|
|
2464
|
+
y1: ae,
|
|
2465
|
+
y2: ae
|
|
2442
2466
|
},
|
|
2443
|
-
`g-${
|
|
2467
|
+
`g-${ce}`
|
|
2444
2468
|
)
|
|
2445
2469
|
) }),
|
|
2446
|
-
/* @__PURE__ */ s("g", { className: f(x.axis,
|
|
2447
|
-
const Ce =
|
|
2448
|
-
return
|
|
2470
|
+
/* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: ie.map(({ value: ce, pos: ae }) => {
|
|
2471
|
+
const Ce = D ? D(ce) : String(ce);
|
|
2472
|
+
return W ? /* @__PURE__ */ s(
|
|
2449
2473
|
"text",
|
|
2450
2474
|
{
|
|
2451
|
-
className: f(x.axisLabel,
|
|
2452
|
-
x:
|
|
2475
|
+
className: f(x.axisLabel, F?.axisLabel),
|
|
2476
|
+
x: ae,
|
|
2453
2477
|
y: ve + 16,
|
|
2454
2478
|
textAnchor: "middle",
|
|
2455
2479
|
children: Ce
|
|
2456
2480
|
},
|
|
2457
|
-
`vt-${
|
|
2481
|
+
`vt-${ce}`
|
|
2458
2482
|
) : /* @__PURE__ */ s(
|
|
2459
2483
|
"text",
|
|
2460
2484
|
{
|
|
2461
|
-
className: f(x.axisLabel,
|
|
2485
|
+
className: f(x.axisLabel, F?.axisLabel),
|
|
2462
2486
|
x: pe - 8,
|
|
2463
|
-
y:
|
|
2487
|
+
y: ae,
|
|
2464
2488
|
textAnchor: "end",
|
|
2465
2489
|
dominantBaseline: "middle",
|
|
2466
2490
|
children: Ce
|
|
2467
2491
|
},
|
|
2468
|
-
`vt-${
|
|
2492
|
+
`vt-${ce}`
|
|
2469
2493
|
);
|
|
2470
2494
|
}) }),
|
|
2471
|
-
/* @__PURE__ */ s("g", { className: f(x.axis,
|
|
2472
|
-
const
|
|
2473
|
-
return
|
|
2495
|
+
/* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: me.map((ce) => {
|
|
2496
|
+
const ae = b(ce), Ce = C ? C(ce) : ce;
|
|
2497
|
+
return W ? /* @__PURE__ */ s(
|
|
2474
2498
|
"text",
|
|
2475
2499
|
{
|
|
2476
|
-
className: f(x.axisLabel,
|
|
2500
|
+
className: f(x.axisLabel, F?.axisLabel),
|
|
2477
2501
|
x: pe - 8,
|
|
2478
|
-
y:
|
|
2502
|
+
y: ae,
|
|
2479
2503
|
textAnchor: "end",
|
|
2480
2504
|
dominantBaseline: "middle",
|
|
2481
2505
|
children: Ce
|
|
2482
2506
|
},
|
|
2483
|
-
`c-${
|
|
2507
|
+
`c-${ce}`
|
|
2484
2508
|
) : /* @__PURE__ */ s(
|
|
2485
2509
|
"text",
|
|
2486
2510
|
{
|
|
2487
|
-
className: f(x.axisLabel,
|
|
2488
|
-
x:
|
|
2511
|
+
className: f(x.axisLabel, F?.axisLabel),
|
|
2512
|
+
x: ae,
|
|
2489
2513
|
y: ve + 16,
|
|
2490
2514
|
textAnchor: "middle",
|
|
2491
2515
|
children: Ce
|
|
2492
2516
|
},
|
|
2493
|
-
`c-${
|
|
2517
|
+
`c-${ce}`
|
|
2494
2518
|
);
|
|
2495
2519
|
}) }),
|
|
2496
|
-
e.map((
|
|
2497
|
-
const Ie = b(z[
|
|
2498
|
-
let xe = 0,
|
|
2499
|
-
return /* @__PURE__ */ s("g", { className: f(x.series,
|
|
2500
|
-
const Ge =
|
|
2520
|
+
e.map((ce, ae) => {
|
|
2521
|
+
const Ie = b(z[ae]) - K / 2;
|
|
2522
|
+
let xe = 0, le = 0;
|
|
2523
|
+
return /* @__PURE__ */ s("g", { className: f(x.series, F?.series), children: oe.map((De, He) => {
|
|
2524
|
+
const Ge = ce[De];
|
|
2501
2525
|
if (typeof Ge != "number") return null;
|
|
2502
|
-
const Ee = Ge, xt =
|
|
2526
|
+
const Ee = Ge, xt = _(De, ae), kt = O !== void 0 && Ee < 0 ? O : xt, Oe = P !== void 0 ? P === ae : v === ae, tt = P !== void 0 && !Oe;
|
|
2503
2527
|
let nt, Ue;
|
|
2504
|
-
L ? Ee >= 0 ? (nt = xe, Ue = xe + Ee, xe = Ue) : (nt =
|
|
2505
|
-
const rt =
|
|
2528
|
+
L ? Ee >= 0 ? (nt = xe, Ue = xe + Ee, xe = Ue) : (nt = le, Ue = le + Ee, le = Ue) : (nt = 0, Ue = Ee);
|
|
2529
|
+
const rt = X(nt), ot = X(Ue), At = L ? (K - R) / 2 : He * Y + (Y - R) / 2;
|
|
2506
2530
|
let ct = 0, it = 0, lt = 0, st = 0;
|
|
2507
|
-
if (
|
|
2531
|
+
if (W) {
|
|
2508
2532
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2509
|
-
ct = Ze, lt = wt - Ze, it = Ie + At, st =
|
|
2533
|
+
ct = Ze, lt = wt - Ze, it = Ie + At, st = R;
|
|
2510
2534
|
} else {
|
|
2511
2535
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2512
|
-
ct = Ie + At, lt =
|
|
2536
|
+
ct = Ie + At, lt = R, it = Ze, st = wt - Ze;
|
|
2513
2537
|
}
|
|
2514
|
-
const Mt =
|
|
2515
|
-
isHorizontal:
|
|
2538
|
+
const Mt = w ? w({ row: ce, value: Ee, seriesKey: De, index: ae }) : p ? ee ? ee(Ee) : String(Ee) : null, Fe = zi({
|
|
2539
|
+
isHorizontal: W,
|
|
2516
2540
|
valuePosition: y,
|
|
2517
2541
|
x: ct,
|
|
2518
2542
|
y: it,
|
|
@@ -2527,7 +2551,7 @@ function Wl({
|
|
|
2527
2551
|
className: f(
|
|
2528
2552
|
x.bar,
|
|
2529
2553
|
Oe && x.activeBar,
|
|
2530
|
-
|
|
2554
|
+
F?.point
|
|
2531
2555
|
),
|
|
2532
2556
|
x: ct,
|
|
2533
2557
|
y: it,
|
|
@@ -2537,8 +2561,8 @@ function Wl({
|
|
|
2537
2561
|
ry: h,
|
|
2538
2562
|
fill: kt,
|
|
2539
2563
|
opacity: tt ? 0.35 : 1,
|
|
2540
|
-
onClick:
|
|
2541
|
-
style:
|
|
2564
|
+
onClick: U ? () => U({ row: ce, value: Ee, seriesKey: De, index: ae }) : void 0,
|
|
2565
|
+
style: U ? { cursor: "pointer" } : void 0
|
|
2542
2566
|
}
|
|
2543
2567
|
),
|
|
2544
2568
|
Mt != null && /* @__PURE__ */ s(
|
|
@@ -2558,16 +2582,16 @@ function Wl({
|
|
|
2558
2582
|
}
|
|
2559
2583
|
)
|
|
2560
2584
|
] }, De);
|
|
2561
|
-
}) }, `group-${
|
|
2585
|
+
}) }, `group-${ae}`);
|
|
2562
2586
|
}),
|
|
2563
2587
|
G < 0 && Z > 0 && /* @__PURE__ */ s(
|
|
2564
2588
|
"line",
|
|
2565
2589
|
{
|
|
2566
2590
|
className: f(x.gridLine),
|
|
2567
|
-
x1:
|
|
2568
|
-
x2:
|
|
2569
|
-
y1:
|
|
2570
|
-
y2:
|
|
2591
|
+
x1: W ? A : pe,
|
|
2592
|
+
x2: W ? A : fe,
|
|
2593
|
+
y1: W ? ge : A,
|
|
2594
|
+
y2: W ? ve : A,
|
|
2571
2595
|
opacity: 0.9
|
|
2572
2596
|
}
|
|
2573
2597
|
),
|
|
@@ -2579,14 +2603,14 @@ function Wl({
|
|
|
2579
2603
|
y: ge,
|
|
2580
2604
|
width: Re,
|
|
2581
2605
|
height: Ne,
|
|
2582
|
-
onMouseMove: (
|
|
2583
|
-
const
|
|
2606
|
+
onMouseMove: (ce) => {
|
|
2607
|
+
const ae = ce.currentTarget.getBoundingClientRect(), Ce = ce.clientX - ae.left + pe, Ie = ce.clientY - ae.top + ge, xe = b.step(), le = W ? Ie - ge : Ce - pe, De = Math.max(
|
|
2584
2608
|
0,
|
|
2585
|
-
Math.min(e.length - 1, Math.round((
|
|
2609
|
+
Math.min(e.length - 1, Math.round((le - xe / 2) / xe))
|
|
2586
2610
|
);
|
|
2587
|
-
|
|
2611
|
+
k(De);
|
|
2588
2612
|
},
|
|
2589
|
-
onMouseLeave: () =>
|
|
2613
|
+
onMouseLeave: () => k(null)
|
|
2590
2614
|
}
|
|
2591
2615
|
)
|
|
2592
2616
|
] });
|
|
@@ -2594,7 +2618,7 @@ function Wl({
|
|
|
2594
2618
|
}
|
|
2595
2619
|
);
|
|
2596
2620
|
}
|
|
2597
|
-
function
|
|
2621
|
+
function zi({
|
|
2598
2622
|
isHorizontal: e,
|
|
2599
2623
|
valuePosition: t,
|
|
2600
2624
|
x: n,
|
|
@@ -2646,19 +2670,19 @@ function Ui({
|
|
|
2646
2670
|
dominantBaseline: a ? "auto" : "middle"
|
|
2647
2671
|
};
|
|
2648
2672
|
}
|
|
2649
|
-
function
|
|
2673
|
+
function Vi(e, t, n, r, o, i, c) {
|
|
2650
2674
|
const l = o.current;
|
|
2651
2675
|
if (!l) return 0;
|
|
2652
|
-
const a = l.getBoundingClientRect(), h = e.map((
|
|
2676
|
+
const a = l.getBoundingClientRect(), h = e.map((u) => String(u[t]));
|
|
2653
2677
|
return i ? a.width / 2 : Xe(h, [n.left, a.width - n.right], c)(h[r]);
|
|
2654
2678
|
}
|
|
2655
|
-
function
|
|
2679
|
+
function Yi(e, t, n, r, o, i) {
|
|
2656
2680
|
const c = o.current;
|
|
2657
2681
|
if (!c) return 16;
|
|
2658
|
-
const l = c.getBoundingClientRect(), a = e.map((
|
|
2682
|
+
const l = c.getBoundingClientRect(), a = e.map((d) => String(d[t]));
|
|
2659
2683
|
return Xe(a, [n.top, l.height - n.bottom], i)(a[r]);
|
|
2660
2684
|
}
|
|
2661
|
-
const
|
|
2685
|
+
const qi = [
|
|
2662
2686
|
"var(--crk-chart-1)",
|
|
2663
2687
|
"var(--crk-chart-2)",
|
|
2664
2688
|
"var(--crk-chart-3)",
|
|
@@ -2670,7 +2694,7 @@ function It(e, t) {
|
|
|
2670
2694
|
const n = /^([\d.]+)%$/.exec(e);
|
|
2671
2695
|
return n ? parseFloat(n[1]) / 100 * t : parseFloat(e) || 0;
|
|
2672
2696
|
}
|
|
2673
|
-
function
|
|
2697
|
+
function Gi(e, t, n, r, o, i) {
|
|
2674
2698
|
if (Math.abs(i - o) >= 360 - 1e-6)
|
|
2675
2699
|
return r > 0 ? [
|
|
2676
2700
|
`M ${e + n} ${t}`,
|
|
@@ -2686,21 +2710,21 @@ function Vi(e, t, n, r, o, i) {
|
|
|
2686
2710
|
`A ${n} ${n} 0 1 1 ${e + n} ${t}`,
|
|
2687
2711
|
"Z"
|
|
2688
2712
|
].join(" ");
|
|
2689
|
-
const c = (o - 90) * Math.PI / 180, l = (i - 90) * Math.PI / 180, a = i - o > 180 ? 1 : 0, h = e + n * Math.cos(c),
|
|
2713
|
+
const c = (o - 90) * Math.PI / 180, l = (i - 90) * Math.PI / 180, a = i - o > 180 ? 1 : 0, h = e + n * Math.cos(c), d = t + n * Math.sin(c), u = e + n * Math.cos(l), m = t + n * Math.sin(l);
|
|
2690
2714
|
if (r > 0) {
|
|
2691
|
-
const p = e + r * Math.cos(l), y = t + r * Math.sin(l),
|
|
2715
|
+
const p = e + r * Math.cos(l), y = t + r * Math.sin(l), w = e + r * Math.cos(c), N = t + r * Math.sin(c);
|
|
2692
2716
|
return [
|
|
2693
|
-
`M ${h} ${
|
|
2694
|
-
`A ${n} ${n} 0 ${a} 1 ${
|
|
2717
|
+
`M ${h} ${d}`,
|
|
2718
|
+
`A ${n} ${n} 0 ${a} 1 ${u} ${m}`,
|
|
2695
2719
|
`L ${p} ${y}`,
|
|
2696
|
-
`A ${r} ${r} 0 ${a} 0 ${
|
|
2720
|
+
`A ${r} ${r} 0 ${a} 0 ${w} ${N}`,
|
|
2697
2721
|
"Z"
|
|
2698
2722
|
].join(" ");
|
|
2699
2723
|
}
|
|
2700
2724
|
return [
|
|
2701
2725
|
`M ${e} ${t}`,
|
|
2702
|
-
`L ${h} ${
|
|
2703
|
-
`A ${n} ${n} 0 ${a} 1 ${
|
|
2726
|
+
`L ${h} ${d}`,
|
|
2727
|
+
`A ${n} ${n} 0 ${a} 1 ${u} ${m}`,
|
|
2704
2728
|
"Z"
|
|
2705
2729
|
].join(" ");
|
|
2706
2730
|
}
|
|
@@ -2708,132 +2732,132 @@ function Et(e, t, n, r, o) {
|
|
|
2708
2732
|
const c = ((r + o) / 2 - 90) * Math.PI / 180;
|
|
2709
2733
|
return { x: e + n * Math.cos(c), y: t + n * Math.sin(c) };
|
|
2710
2734
|
}
|
|
2711
|
-
function
|
|
2735
|
+
function jl({
|
|
2712
2736
|
data: e,
|
|
2713
2737
|
valueKey: t,
|
|
2714
2738
|
nameKey: n,
|
|
2715
2739
|
colorKey: r,
|
|
2716
|
-
colors: o =
|
|
2740
|
+
colors: o = qi,
|
|
2717
2741
|
aspectRatio: i = 1,
|
|
2718
2742
|
height: c,
|
|
2719
2743
|
innerRadius: l = 0,
|
|
2720
2744
|
outerRadius: a = "90%",
|
|
2721
2745
|
strokeWidth: h = 2,
|
|
2722
|
-
strokeColor:
|
|
2723
|
-
padAngle:
|
|
2746
|
+
strokeColor: d = "var(--crk-color-bg)",
|
|
2747
|
+
padAngle: u = 0,
|
|
2724
2748
|
showLabels: m = !1,
|
|
2725
2749
|
valuePosition: p = "outside",
|
|
2726
2750
|
showLabelLines: y = !0,
|
|
2727
|
-
renderLabel:
|
|
2728
|
-
centerLabel:
|
|
2729
|
-
activeIndex:
|
|
2730
|
-
onSliceClick:
|
|
2731
|
-
showLegend:
|
|
2732
|
-
showTooltip:
|
|
2733
|
-
valueFormat:
|
|
2734
|
-
renderTooltip:
|
|
2751
|
+
renderLabel: w,
|
|
2752
|
+
centerLabel: N,
|
|
2753
|
+
activeIndex: S,
|
|
2754
|
+
onSliceClick: O,
|
|
2755
|
+
showLegend: P = !0,
|
|
2756
|
+
showTooltip: U = !0,
|
|
2757
|
+
valueFormat: re,
|
|
2758
|
+
renderTooltip: D,
|
|
2735
2759
|
emptyMessage: C = "No data",
|
|
2736
|
-
className:
|
|
2737
|
-
style:
|
|
2738
|
-
classes:
|
|
2760
|
+
className: ee,
|
|
2761
|
+
style: se,
|
|
2762
|
+
classes: M
|
|
2739
2763
|
}) {
|
|
2740
|
-
const [q,
|
|
2764
|
+
const [q, I] = Se(null), Q = ne(null), F = S ?? q, W = (k) => {
|
|
2741
2765
|
if (r) {
|
|
2742
|
-
const
|
|
2743
|
-
if (typeof
|
|
2766
|
+
const $ = e[k]?.[r];
|
|
2767
|
+
if (typeof $ == "string") return $;
|
|
2744
2768
|
}
|
|
2745
|
-
return o[
|
|
2746
|
-
},
|
|
2747
|
-
let
|
|
2748
|
-
for (const
|
|
2749
|
-
const z =
|
|
2750
|
-
typeof z == "number" && z > 0 && (
|
|
2769
|
+
return o[k % o.length];
|
|
2770
|
+
}, te = ke(() => {
|
|
2771
|
+
let k = 0;
|
|
2772
|
+
for (const $ of e) {
|
|
2773
|
+
const z = $[t];
|
|
2774
|
+
typeof z == "number" && z > 0 && (k += z);
|
|
2751
2775
|
}
|
|
2752
|
-
return
|
|
2776
|
+
return k;
|
|
2753
2777
|
}, [e, t]);
|
|
2754
|
-
if (e.length === 0 ||
|
|
2755
|
-
return /* @__PURE__ */ s("div", { ref: Q, className: f(x.root,
|
|
2756
|
-
const
|
|
2757
|
-
const
|
|
2758
|
-
let
|
|
2778
|
+
if (e.length === 0 || te === 0)
|
|
2779
|
+
return /* @__PURE__ */ s("div", { ref: Q, className: f(x.root, M?.root, ee), style: se, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
|
|
2780
|
+
const oe = ke(() => {
|
|
2781
|
+
const k = [];
|
|
2782
|
+
let $ = 0;
|
|
2759
2783
|
for (let z = 0; z < e.length; z++) {
|
|
2760
|
-
const
|
|
2761
|
-
if (
|
|
2762
|
-
const G =
|
|
2763
|
-
|
|
2784
|
+
const T = e[z], j = T[t], V = typeof j == "number" && j > 0 ? j : 0;
|
|
2785
|
+
if (V === 0) continue;
|
|
2786
|
+
const G = V / te, Z = G * 360;
|
|
2787
|
+
k.push({ index: z, row: T, value: V, start: $, end: $ + Z, fraction: G }), $ += Z;
|
|
2764
2788
|
}
|
|
2765
|
-
return
|
|
2766
|
-
}, [e, t,
|
|
2789
|
+
return k;
|
|
2790
|
+
}, [e, t, te]), L = P ? /* @__PURE__ */ s("div", { className: f(x.legend, M?.legend), role: "list", children: oe.map((k) => /* @__PURE__ */ H("div", { className: f(x.legendItem, M?.legendItem), role: "listitem", children: [
|
|
2767
2791
|
/* @__PURE__ */ s(
|
|
2768
2792
|
"span",
|
|
2769
2793
|
{
|
|
2770
2794
|
className: x.legendSwatch,
|
|
2771
|
-
style: { background:
|
|
2795
|
+
style: { background: W(k.index) },
|
|
2772
2796
|
"aria-hidden": "true"
|
|
2773
2797
|
}
|
|
2774
2798
|
),
|
|
2775
|
-
/* @__PURE__ */ s("span", { className: x.legendLabel, children: String(
|
|
2776
|
-
] },
|
|
2777
|
-
const
|
|
2778
|
-
for (const
|
|
2779
|
-
|
|
2780
|
-
label: String(
|
|
2781
|
-
color:
|
|
2799
|
+
/* @__PURE__ */ s("span", { className: x.legendLabel, children: String(k.row[n]) })
|
|
2800
|
+
] }, k.index)) }) : void 0, v = ke(() => {
|
|
2801
|
+
const k = {};
|
|
2802
|
+
for (const $ of oe)
|
|
2803
|
+
k[$.index.toString()] = {
|
|
2804
|
+
label: String($.row[n]),
|
|
2805
|
+
color: W($.index)
|
|
2782
2806
|
};
|
|
2783
|
-
return
|
|
2784
|
-
}, [
|
|
2807
|
+
return k;
|
|
2808
|
+
}, [oe]);
|
|
2785
2809
|
return /* @__PURE__ */ s(
|
|
2786
|
-
|
|
2810
|
+
Ye,
|
|
2787
2811
|
{
|
|
2788
2812
|
ref: Q,
|
|
2789
2813
|
aspectRatio: i,
|
|
2790
2814
|
height: c,
|
|
2791
|
-
className:
|
|
2792
|
-
style:
|
|
2793
|
-
classes:
|
|
2815
|
+
className: ee,
|
|
2816
|
+
style: se,
|
|
2817
|
+
classes: M,
|
|
2794
2818
|
legend: L,
|
|
2795
|
-
overlay:
|
|
2819
|
+
overlay: U && F !== null && e[F] ? /* @__PURE__ */ s(
|
|
2796
2820
|
et,
|
|
2797
2821
|
{
|
|
2798
|
-
row: { [
|
|
2822
|
+
row: { [F.toString()]: e[F][t] },
|
|
2799
2823
|
x: Q.current ? Q.current.getBoundingClientRect().width / 2 : 0,
|
|
2800
2824
|
y: 16,
|
|
2801
2825
|
containerWidth: Q.current?.getBoundingClientRect().width ?? 0,
|
|
2802
|
-
config: { [
|
|
2803
|
-
render:
|
|
2804
|
-
valueFormat:
|
|
2826
|
+
config: { [F.toString()]: v[F.toString()] },
|
|
2827
|
+
render: D ? () => D(e[F]) : void 0,
|
|
2828
|
+
valueFormat: re,
|
|
2805
2829
|
titleKey: void 0,
|
|
2806
|
-
classes:
|
|
2830
|
+
classes: M
|
|
2807
2831
|
}
|
|
2808
2832
|
) : null,
|
|
2809
|
-
children: ({ width:
|
|
2810
|
-
const z =
|
|
2811
|
-
return /* @__PURE__ */ H(
|
|
2812
|
-
/* @__PURE__ */ s("g", { children:
|
|
2813
|
-
const J =
|
|
2833
|
+
children: ({ width: k, height: $ }) => {
|
|
2834
|
+
const z = k / 2, T = $ / 2, j = Math.min(k, $) / 2 - 4, V = It(a, j), G = Math.min(V - 1, It(l, j)), Z = Math.max(4, V * 0.06);
|
|
2835
|
+
return /* @__PURE__ */ H(Ve, { children: [
|
|
2836
|
+
/* @__PURE__ */ s("g", { children: oe.map((_) => {
|
|
2837
|
+
const J = u / 2, ue = Math.min(_.end, _.start + J), be = Math.max(_.start, _.end - J), pe = W(_.index), fe = F === _.index, ge = S !== void 0 && !fe, ve = fe && S !== void 0 ? V + Z : V, Re = Gi(z, T, ve, G, ue, be), Ne = O ? () => O({ row: _.row, value: _.value, index: _.index }) : void 0;
|
|
2814
2838
|
return /* @__PURE__ */ s(
|
|
2815
2839
|
"path",
|
|
2816
2840
|
{
|
|
2817
2841
|
d: Re,
|
|
2818
2842
|
fill: pe,
|
|
2819
|
-
stroke: h > 0 ?
|
|
2843
|
+
stroke: h > 0 ? d : "none",
|
|
2820
2844
|
strokeWidth: h,
|
|
2821
2845
|
opacity: ge ? 0.45 : 1,
|
|
2822
|
-
onMouseEnter: () =>
|
|
2823
|
-
onMouseLeave: () =>
|
|
2846
|
+
onMouseEnter: () => I(_.index),
|
|
2847
|
+
onMouseLeave: () => I(null),
|
|
2824
2848
|
onClick: Ne,
|
|
2825
2849
|
style: Ne ? { cursor: "pointer" } : void 0
|
|
2826
2850
|
},
|
|
2827
|
-
|
|
2851
|
+
_.index
|
|
2828
2852
|
);
|
|
2829
2853
|
}) }),
|
|
2830
|
-
(m ||
|
|
2831
|
-
const J =
|
|
2854
|
+
(m || w) && oe.map((_) => {
|
|
2855
|
+
const J = w ? w({ row: _.row, value: _.value, fraction: _.fraction, index: _.index }) : m ? `${String(_.row[n])} ${re ? re(_.value) : Math.round(_.fraction * 100) + "%"}` : null;
|
|
2832
2856
|
if (J == null) return null;
|
|
2833
|
-
const ue = p === "inside", be = Math.max(16,
|
|
2857
|
+
const ue = p === "inside", be = Math.max(16, V * 0.12), pe = ue ? (V + G) / 2 : V + be, fe = Et(z, T, pe, _.start, _.end), ge = ue ? "middle" : fe.x < z - 1 ? "end" : fe.x > z + 1 ? "start" : "middle";
|
|
2834
2858
|
let ve = null;
|
|
2835
2859
|
if (!ue && y) {
|
|
2836
|
-
const Re = Et(z,
|
|
2860
|
+
const Re = Et(z, T, V, _.start, _.end), Ne = 4, g = ge === "end" ? Ne : ge === "start" ? -Ne : 0;
|
|
2837
2861
|
ve = { x1: Re.x, y1: Re.y, x2: fe.x + g, y2: fe.y };
|
|
2838
2862
|
}
|
|
2839
2863
|
return /* @__PURE__ */ H("g", { children: [
|
|
@@ -2844,7 +2868,7 @@ function Hl({
|
|
|
2844
2868
|
y1: ve.y1,
|
|
2845
2869
|
x2: ve.x2,
|
|
2846
2870
|
y2: ve.y2,
|
|
2847
|
-
stroke:
|
|
2871
|
+
stroke: W(_.index),
|
|
2848
2872
|
strokeWidth: 1,
|
|
2849
2873
|
opacity: 0.7
|
|
2850
2874
|
}
|
|
@@ -2863,13 +2887,13 @@ function Hl({
|
|
|
2863
2887
|
children: J
|
|
2864
2888
|
}
|
|
2865
2889
|
)
|
|
2866
|
-
] }, `label-${
|
|
2890
|
+
] }, `label-${_.index}`);
|
|
2867
2891
|
}),
|
|
2868
|
-
|
|
2892
|
+
N !== void 0 && /* @__PURE__ */ s(
|
|
2869
2893
|
"foreignObject",
|
|
2870
2894
|
{
|
|
2871
2895
|
x: z - G,
|
|
2872
|
-
y:
|
|
2896
|
+
y: T - G,
|
|
2873
2897
|
width: Math.max(0, G * 2),
|
|
2874
2898
|
height: Math.max(0, G * 2),
|
|
2875
2899
|
style: { pointerEvents: "none" },
|
|
@@ -2887,7 +2911,7 @@ function Hl({
|
|
|
2887
2911
|
color: "var(--crk-color-text)",
|
|
2888
2912
|
fontFamily: "var(--crk-font-family)"
|
|
2889
2913
|
},
|
|
2890
|
-
children:
|
|
2914
|
+
children: N
|
|
2891
2915
|
}
|
|
2892
2916
|
)
|
|
2893
2917
|
}
|
|
@@ -2901,13 +2925,13 @@ function mt(e, t, n, r) {
|
|
|
2901
2925
|
const o = (r - 90) * Math.PI / 180;
|
|
2902
2926
|
return { x: e + n * Math.cos(o), y: t + n * Math.sin(o) };
|
|
2903
2927
|
}
|
|
2904
|
-
function
|
|
2928
|
+
function Zi(e, t, n, r) {
|
|
2905
2929
|
return r.map((o) => {
|
|
2906
2930
|
const i = mt(e, t, n, o);
|
|
2907
2931
|
return `${i.x},${i.y}`;
|
|
2908
2932
|
}).join(" ");
|
|
2909
2933
|
}
|
|
2910
|
-
function
|
|
2934
|
+
function Xl({
|
|
2911
2935
|
data: e,
|
|
2912
2936
|
axisKey: t,
|
|
2913
2937
|
config: n,
|
|
@@ -2918,127 +2942,127 @@ function Ol({
|
|
|
2918
2942
|
showRadialLines: l = !0,
|
|
2919
2943
|
showAxisLabels: a = !0,
|
|
2920
2944
|
showRadiusAxis: h = !1,
|
|
2921
|
-
levels:
|
|
2922
|
-
showPoints:
|
|
2945
|
+
levels: d = 5,
|
|
2946
|
+
showPoints: u = !0,
|
|
2923
2947
|
fillOpacity: m = 0.4,
|
|
2924
2948
|
strokeWidth: p = 2,
|
|
2925
2949
|
renderAxisLabel: y,
|
|
2926
|
-
axisFormat:
|
|
2927
|
-
valueFormat:
|
|
2928
|
-
renderTooltip:
|
|
2929
|
-
showLegend:
|
|
2930
|
-
showTooltip:
|
|
2931
|
-
emptyMessage:
|
|
2932
|
-
className:
|
|
2933
|
-
style:
|
|
2950
|
+
axisFormat: w,
|
|
2951
|
+
valueFormat: N,
|
|
2952
|
+
renderTooltip: S,
|
|
2953
|
+
showLegend: O = !0,
|
|
2954
|
+
showTooltip: P = !0,
|
|
2955
|
+
emptyMessage: U = "No data",
|
|
2956
|
+
className: re,
|
|
2957
|
+
style: D,
|
|
2934
2958
|
classes: C
|
|
2935
2959
|
}) {
|
|
2936
|
-
const [
|
|
2960
|
+
const [ee, se] = Se(null), M = ne(null), q = ke(() => Object.keys(n), [n]);
|
|
2937
2961
|
if (e.length === 0)
|
|
2938
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2939
|
-
const
|
|
2940
|
-
() => e.map((
|
|
2962
|
+
return /* @__PURE__ */ s("div", { ref: M, className: f(x.root, C?.root, re), style: D, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: U }) }) });
|
|
2963
|
+
const I = ke(
|
|
2964
|
+
() => e.map((te, oe) => oe / e.length * 360),
|
|
2941
2965
|
[e]
|
|
2942
2966
|
), Q = ke(() => {
|
|
2943
|
-
const
|
|
2967
|
+
const te = [];
|
|
2944
2968
|
for (const L of q)
|
|
2945
2969
|
for (const v of e) {
|
|
2946
|
-
const
|
|
2947
|
-
typeof
|
|
2970
|
+
const k = v[L];
|
|
2971
|
+
typeof k == "number" && te.push(k);
|
|
2948
2972
|
}
|
|
2949
|
-
const [,
|
|
2950
|
-
return Math.max(1,
|
|
2951
|
-
}, [e, q]),
|
|
2973
|
+
const [, oe] = bt(te);
|
|
2974
|
+
return Math.max(1, oe);
|
|
2975
|
+
}, [e, q]), F = ke(() => qe(0, Q, d).filter((oe) => oe > 0), [Q, d]), W = F[F.length - 1] ?? Q;
|
|
2952
2976
|
return /* @__PURE__ */ s(
|
|
2953
|
-
|
|
2977
|
+
Ye,
|
|
2954
2978
|
{
|
|
2955
|
-
ref:
|
|
2979
|
+
ref: M,
|
|
2956
2980
|
aspectRatio: r,
|
|
2957
2981
|
height: o,
|
|
2958
|
-
className:
|
|
2959
|
-
style:
|
|
2982
|
+
className: re,
|
|
2983
|
+
style: D,
|
|
2960
2984
|
classes: C,
|
|
2961
|
-
legend:
|
|
2962
|
-
overlay:
|
|
2985
|
+
legend: O ? /* @__PURE__ */ s(vt, { config: n, classes: C }) : void 0,
|
|
2986
|
+
overlay: P && ee !== null ? /* @__PURE__ */ s(
|
|
2963
2987
|
et,
|
|
2964
2988
|
{
|
|
2965
|
-
row: e[
|
|
2966
|
-
x: (
|
|
2989
|
+
row: e[ee],
|
|
2990
|
+
x: (M.current?.getBoundingClientRect().width ?? 0) / 2,
|
|
2967
2991
|
y: 16,
|
|
2968
|
-
containerWidth:
|
|
2992
|
+
containerWidth: M.current?.getBoundingClientRect().width ?? 0,
|
|
2969
2993
|
config: n,
|
|
2970
|
-
render:
|
|
2971
|
-
valueFormat:
|
|
2994
|
+
render: S ? () => S(e[ee]) : void 0,
|
|
2995
|
+
valueFormat: N,
|
|
2972
2996
|
titleKey: t,
|
|
2973
2997
|
classes: C
|
|
2974
2998
|
}
|
|
2975
2999
|
) : null,
|
|
2976
|
-
children: ({ width:
|
|
2977
|
-
const L = a ? 32 : 8, v =
|
|
2978
|
-
return /* @__PURE__ */ H(
|
|
2979
|
-
c &&
|
|
2980
|
-
const
|
|
3000
|
+
children: ({ width: te, height: oe }) => {
|
|
3001
|
+
const L = a ? 32 : 8, v = te / 2, k = oe / 2, $ = Math.max(0, Math.min(te, oe) / 2 - L), z = (T) => Math.max(0, T) / W * $;
|
|
3002
|
+
return /* @__PURE__ */ H(Ve, { children: [
|
|
3003
|
+
c && F.map((T) => {
|
|
3004
|
+
const j = z(T);
|
|
2981
3005
|
return i === "circle" ? /* @__PURE__ */ s(
|
|
2982
3006
|
"circle",
|
|
2983
3007
|
{
|
|
2984
3008
|
className: f(x.gridLine, C?.grid),
|
|
2985
3009
|
cx: v,
|
|
2986
|
-
cy:
|
|
2987
|
-
r:
|
|
3010
|
+
cy: k,
|
|
3011
|
+
r: j,
|
|
2988
3012
|
fill: "none"
|
|
2989
3013
|
},
|
|
2990
|
-
`ring-${
|
|
3014
|
+
`ring-${T}`
|
|
2991
3015
|
) : /* @__PURE__ */ s(
|
|
2992
3016
|
"polygon",
|
|
2993
3017
|
{
|
|
2994
3018
|
className: f(x.gridLine, C?.grid),
|
|
2995
|
-
points:
|
|
3019
|
+
points: Zi(v, k, j, I),
|
|
2996
3020
|
fill: "none"
|
|
2997
3021
|
},
|
|
2998
|
-
`ring-${
|
|
3022
|
+
`ring-${T}`
|
|
2999
3023
|
);
|
|
3000
3024
|
}),
|
|
3001
|
-
l &&
|
|
3002
|
-
const
|
|
3025
|
+
l && I.map((T, j) => {
|
|
3026
|
+
const V = mt(v, k, $, T);
|
|
3003
3027
|
return /* @__PURE__ */ s(
|
|
3004
3028
|
"line",
|
|
3005
3029
|
{
|
|
3006
3030
|
className: f(x.gridLine, C?.grid),
|
|
3007
3031
|
x1: v,
|
|
3008
|
-
y1:
|
|
3009
|
-
x2:
|
|
3010
|
-
y2:
|
|
3032
|
+
y1: k,
|
|
3033
|
+
x2: V.x,
|
|
3034
|
+
y2: V.y
|
|
3011
3035
|
},
|
|
3012
|
-
`spoke-${
|
|
3036
|
+
`spoke-${j}`
|
|
3013
3037
|
);
|
|
3014
3038
|
}),
|
|
3015
|
-
h &&
|
|
3016
|
-
const
|
|
3039
|
+
h && F.map((T) => {
|
|
3040
|
+
const j = z(T);
|
|
3017
3041
|
return /* @__PURE__ */ s(
|
|
3018
3042
|
"text",
|
|
3019
3043
|
{
|
|
3020
3044
|
className: f(x.axisLabel, C?.axisLabel),
|
|
3021
3045
|
x: v + 4,
|
|
3022
|
-
y:
|
|
3046
|
+
y: k - j,
|
|
3023
3047
|
textAnchor: "start",
|
|
3024
3048
|
dominantBaseline: "middle",
|
|
3025
|
-
children:
|
|
3049
|
+
children: N ? N(T) : T
|
|
3026
3050
|
},
|
|
3027
|
-
`raxis-${
|
|
3051
|
+
`raxis-${T}`
|
|
3028
3052
|
);
|
|
3029
3053
|
}),
|
|
3030
|
-
a && e.map((
|
|
3031
|
-
const
|
|
3054
|
+
a && e.map((T, j) => {
|
|
3055
|
+
const V = I[j], G = mt(v, k, $ + 14, V), Z = G.x < v - 1 ? "end" : G.x > v + 1 ? "start" : "middle";
|
|
3032
3056
|
if (y)
|
|
3033
3057
|
return /* @__PURE__ */ s("g", { children: y({
|
|
3034
|
-
row:
|
|
3035
|
-
index:
|
|
3036
|
-
angle:
|
|
3058
|
+
row: T,
|
|
3059
|
+
index: j,
|
|
3060
|
+
angle: V,
|
|
3037
3061
|
x: G.x,
|
|
3038
3062
|
y: G.y,
|
|
3039
3063
|
textAnchor: Z
|
|
3040
|
-
}) }, `label-${
|
|
3041
|
-
const
|
|
3064
|
+
}) }, `label-${j}`);
|
|
3065
|
+
const _ = String(T[t]), J = w ? w(_) : _;
|
|
3042
3066
|
return /* @__PURE__ */ s(
|
|
3043
3067
|
"text",
|
|
3044
3068
|
{
|
|
@@ -3049,39 +3073,39 @@ function Ol({
|
|
|
3049
3073
|
dominantBaseline: "middle",
|
|
3050
3074
|
children: J
|
|
3051
3075
|
},
|
|
3052
|
-
`label-${
|
|
3076
|
+
`label-${j}`
|
|
3053
3077
|
);
|
|
3054
3078
|
}),
|
|
3055
|
-
q.map((
|
|
3056
|
-
const
|
|
3057
|
-
const J = Z[
|
|
3058
|
-
return mt(v,
|
|
3059
|
-
}), G =
|
|
3079
|
+
q.map((T) => {
|
|
3080
|
+
const j = n[T], V = e.map((Z, _) => {
|
|
3081
|
+
const J = Z[T], be = z(typeof J == "number" ? J : 0);
|
|
3082
|
+
return mt(v, k, be, I[_]);
|
|
3083
|
+
}), G = V.map((Z) => `${Z.x},${Z.y}`).join(" ");
|
|
3060
3084
|
return /* @__PURE__ */ H("g", { className: f(x.series, C?.series), children: [
|
|
3061
3085
|
/* @__PURE__ */ s(
|
|
3062
3086
|
"polygon",
|
|
3063
3087
|
{
|
|
3064
3088
|
points: G,
|
|
3065
|
-
fill:
|
|
3089
|
+
fill: j.color,
|
|
3066
3090
|
fillOpacity: m,
|
|
3067
|
-
stroke:
|
|
3091
|
+
stroke: j.color,
|
|
3068
3092
|
strokeWidth: p,
|
|
3069
3093
|
strokeLinejoin: "round",
|
|
3070
3094
|
strokeLinecap: "round"
|
|
3071
3095
|
}
|
|
3072
3096
|
),
|
|
3073
|
-
|
|
3097
|
+
u && V.map((Z, _) => /* @__PURE__ */ s(
|
|
3074
3098
|
"circle",
|
|
3075
3099
|
{
|
|
3076
3100
|
className: f(x.point, C?.point),
|
|
3077
3101
|
cx: Z.x,
|
|
3078
3102
|
cy: Z.y,
|
|
3079
|
-
r:
|
|
3080
|
-
fill:
|
|
3103
|
+
r: ee === _ ? 5 : 3.5,
|
|
3104
|
+
fill: j.color
|
|
3081
3105
|
},
|
|
3082
|
-
`${
|
|
3106
|
+
`${T}-${_}`
|
|
3083
3107
|
))
|
|
3084
|
-
] },
|
|
3108
|
+
] }, T);
|
|
3085
3109
|
}),
|
|
3086
3110
|
/* @__PURE__ */ s(
|
|
3087
3111
|
"rect",
|
|
@@ -3089,17 +3113,17 @@ function Ol({
|
|
|
3089
3113
|
className: x.interactionLayer,
|
|
3090
3114
|
x: 0,
|
|
3091
3115
|
y: 0,
|
|
3092
|
-
width:
|
|
3093
|
-
height:
|
|
3094
|
-
onMouseMove: (
|
|
3095
|
-
const
|
|
3096
|
-
if (
|
|
3097
|
-
let Z = Math.atan2(G,
|
|
3116
|
+
width: te,
|
|
3117
|
+
height: oe,
|
|
3118
|
+
onMouseMove: (T) => {
|
|
3119
|
+
const j = T.currentTarget.getBoundingClientRect(), V = T.clientX - j.left - v, G = T.clientY - j.top - k;
|
|
3120
|
+
if (V === 0 && G === 0) return;
|
|
3121
|
+
let Z = Math.atan2(G, V) * 180 / Math.PI + 90;
|
|
3098
3122
|
Z < 0 && (Z += 360), Z >= 360 && (Z -= 360);
|
|
3099
|
-
const
|
|
3100
|
-
|
|
3123
|
+
const _ = 360 / e.length, J = Math.round(Z / _) % e.length;
|
|
3124
|
+
se(J);
|
|
3101
3125
|
},
|
|
3102
|
-
onMouseLeave: () =>
|
|
3126
|
+
onMouseLeave: () => se(null)
|
|
3103
3127
|
}
|
|
3104
3128
|
)
|
|
3105
3129
|
] });
|
|
@@ -3107,7 +3131,7 @@ function Ol({
|
|
|
3107
3131
|
}
|
|
3108
3132
|
);
|
|
3109
3133
|
}
|
|
3110
|
-
function
|
|
3134
|
+
function Ki(e, t) {
|
|
3111
3135
|
const n = new Array(e.length).fill(null);
|
|
3112
3136
|
if (t <= 0 || e.length < t) return n;
|
|
3113
3137
|
let r = 0;
|
|
@@ -3117,7 +3141,7 @@ function Gi(e, t) {
|
|
|
3117
3141
|
r += e[o].close - e[o - t].close, n[o] = r / t;
|
|
3118
3142
|
return n;
|
|
3119
3143
|
}
|
|
3120
|
-
function
|
|
3144
|
+
function Qi(e, t) {
|
|
3121
3145
|
const n = new Array(e.length).fill(null);
|
|
3122
3146
|
if (t <= 0 || e.length < t) return n;
|
|
3123
3147
|
const r = 2 / (t + 1);
|
|
@@ -3129,25 +3153,25 @@ function Zi(e, t) {
|
|
|
3129
3153
|
i = e[c].close * r + i * (1 - r), n[c] = i;
|
|
3130
3154
|
return n;
|
|
3131
3155
|
}
|
|
3132
|
-
function
|
|
3156
|
+
function Ji(e, t, n = 2) {
|
|
3133
3157
|
const r = e.length, o = new Array(r).fill(null), i = new Array(r).fill(null), c = new Array(r).fill(null);
|
|
3134
3158
|
if (t <= 0 || r < t) return { middle: o, upper: i, lower: c };
|
|
3135
3159
|
for (let l = t - 1; l < r; l++) {
|
|
3136
3160
|
let a = 0;
|
|
3137
3161
|
for (let m = l - t + 1; m <= l; m++) a += e[m].close;
|
|
3138
3162
|
const h = a / t;
|
|
3139
|
-
let
|
|
3163
|
+
let d = 0;
|
|
3140
3164
|
for (let m = l - t + 1; m <= l; m++) {
|
|
3141
3165
|
const p = e[m].close - h;
|
|
3142
|
-
|
|
3166
|
+
d += p * p;
|
|
3143
3167
|
}
|
|
3144
|
-
|
|
3145
|
-
const
|
|
3146
|
-
o[l] = h, i[l] = h + n *
|
|
3168
|
+
d /= t;
|
|
3169
|
+
const u = Math.sqrt(d);
|
|
3170
|
+
o[l] = h, i[l] = h + n * u, c[l] = h - n * u;
|
|
3147
3171
|
}
|
|
3148
3172
|
return { middle: o, upper: i, lower: c };
|
|
3149
3173
|
}
|
|
3150
|
-
function
|
|
3174
|
+
function el(e, t = 14) {
|
|
3151
3175
|
const n = new Array(e.length).fill(null);
|
|
3152
3176
|
if (e.length <= t) return n;
|
|
3153
3177
|
let r = 0, o = 0;
|
|
@@ -3165,11 +3189,11 @@ function Qi(e, t = 14) {
|
|
|
3165
3189
|
function Pt(e, t) {
|
|
3166
3190
|
return t === 0 ? 100 : 100 - 100 / (1 + e / t);
|
|
3167
3191
|
}
|
|
3168
|
-
function
|
|
3192
|
+
function Ul(e) {
|
|
3169
3193
|
return e.map((t) => typeof t.volume == "number" ? t.volume : null);
|
|
3170
3194
|
}
|
|
3171
3195
|
const Le = 86400;
|
|
3172
|
-
function
|
|
3196
|
+
function nn(e) {
|
|
3173
3197
|
switch (e) {
|
|
3174
3198
|
case "1D":
|
|
3175
3199
|
return Le;
|
|
@@ -3197,7 +3221,7 @@ function tn(e) {
|
|
|
3197
3221
|
}
|
|
3198
3222
|
return 30 * Le;
|
|
3199
3223
|
}
|
|
3200
|
-
function
|
|
3224
|
+
function _l(e) {
|
|
3201
3225
|
switch (e) {
|
|
3202
3226
|
case "1D":
|
|
3203
3227
|
return "5";
|
|
@@ -3214,147 +3238,147 @@ function jl(e) {
|
|
|
3214
3238
|
case "5Y":
|
|
3215
3239
|
return "W";
|
|
3216
3240
|
}
|
|
3217
|
-
const t =
|
|
3241
|
+
const t = nn(e);
|
|
3218
3242
|
return t >= 3 * 365 * Le ? "W" : t >= 180 * Le ? "D" : t >= 60 * Le ? "240" : t >= 14 * Le ? "60" : t >= 3 * Le ? "15" : "5";
|
|
3219
3243
|
}
|
|
3220
|
-
function
|
|
3244
|
+
function zl(e) {
|
|
3221
3245
|
if (e === "W" || e === "M") return "5Y";
|
|
3222
3246
|
if (e === "D") return "1Y";
|
|
3223
3247
|
const t = Number(e);
|
|
3224
3248
|
return !Number.isFinite(t) || t >= 240 ? "3M" : t >= 60 ? "1M" : t >= 15 || t >= 5 ? "5D" : "1D";
|
|
3225
3249
|
}
|
|
3226
|
-
const
|
|
3227
|
-
function
|
|
3250
|
+
const tl = 420, Rt = 64, Ct = 28, nl = 40, rl = 4, Wt = { rsi: 0.18, volume: 0.14 }, ol = 1, cl = 40, Ht = 0.1, il = 500, ll = [];
|
|
3251
|
+
function Vl({
|
|
3228
3252
|
datafeed: e,
|
|
3229
3253
|
symbol: t,
|
|
3230
3254
|
resolution: n,
|
|
3231
3255
|
period: r,
|
|
3232
3256
|
seriesType: o = "candle",
|
|
3233
|
-
indicators: i =
|
|
3257
|
+
indicators: i = ll,
|
|
3234
3258
|
precision: c = 2,
|
|
3235
|
-
initialLookback: l =
|
|
3236
|
-
height: a =
|
|
3259
|
+
initialLookback: l = il,
|
|
3260
|
+
height: a = tl,
|
|
3237
3261
|
upColor: h = "var(--crk-color-success)",
|
|
3238
|
-
downColor:
|
|
3239
|
-
lineColor:
|
|
3262
|
+
downColor: d = "var(--crk-color-danger)",
|
|
3263
|
+
lineColor: u = "var(--crk-chart-1)",
|
|
3240
3264
|
timezone: m,
|
|
3241
3265
|
defaultTimezone: p = "local",
|
|
3242
3266
|
onTimezoneChange: y,
|
|
3243
|
-
showConfigPanel:
|
|
3244
|
-
onCrosshair:
|
|
3245
|
-
onVisibleRangeChange:
|
|
3246
|
-
className:
|
|
3247
|
-
style:
|
|
3267
|
+
showConfigPanel: w = !0,
|
|
3268
|
+
onCrosshair: N,
|
|
3269
|
+
onVisibleRangeChange: S,
|
|
3270
|
+
className: O,
|
|
3271
|
+
style: P
|
|
3248
3272
|
}) {
|
|
3249
|
-
const
|
|
3250
|
-
}),
|
|
3251
|
-
|
|
3252
|
-
const [L, v] = Se(null), [
|
|
3273
|
+
const U = ne(null), re = ne(null), D = ne([]), C = ne({ from: 0, to: 0 }), ee = ne(null), se = ne(null), M = ne(!1), q = ne(null), I = ne(null), Q = ne(1), F = ne({ width: 0, height: 0 }), W = ne(() => {
|
|
3274
|
+
}), te = ne(N), oe = ne(S);
|
|
3275
|
+
te.current = N, oe.current = S;
|
|
3276
|
+
const [L, v] = Se(null), [k, $] = Se(p), z = m ?? k, T = he(
|
|
3253
3277
|
(g) => {
|
|
3254
|
-
m === void 0 &&
|
|
3278
|
+
m === void 0 && $(g), y?.(g);
|
|
3255
3279
|
},
|
|
3256
3280
|
[m, y]
|
|
3257
|
-
),
|
|
3258
|
-
() => ({ up: h, down:
|
|
3259
|
-
[h,
|
|
3260
|
-
),
|
|
3261
|
-
const g =
|
|
3281
|
+
), j = ke(
|
|
3282
|
+
() => ({ up: h, down: d, line: u }),
|
|
3283
|
+
[h, d, u]
|
|
3284
|
+
), V = i, G = V.some((g) => g.type === "rsi"), Z = V.some((g) => g.type === "volume"), _ = he(() => {
|
|
3285
|
+
const g = re.current;
|
|
3262
3286
|
if (!g) return;
|
|
3263
3287
|
const b = g.getContext("2d");
|
|
3264
3288
|
if (!b) return;
|
|
3265
|
-
const { width: K, height: B } =
|
|
3289
|
+
const { width: K, height: B } = F.current;
|
|
3266
3290
|
if (K === 0 || B === 0) return;
|
|
3267
|
-
const
|
|
3268
|
-
b.save(), b.setTransform(1, 0, 0, 1, 0, 0), b.clearRect(0, 0, g.width, g.height), b.scale(
|
|
3269
|
-
const A =
|
|
3270
|
-
if (
|
|
3271
|
-
|
|
3291
|
+
const X = Q.current;
|
|
3292
|
+
b.save(), b.setTransform(1, 0, 0, 1, 0, 0), b.clearRect(0, 0, g.width, g.height), b.scale(X, X);
|
|
3293
|
+
const A = fl(U.current, j), de = on(U.current), Y = D.current;
|
|
3294
|
+
if (Y.length === 0) {
|
|
3295
|
+
pl(b, K, B, A), b.restore();
|
|
3272
3296
|
return;
|
|
3273
3297
|
}
|
|
3274
|
-
const
|
|
3275
|
-
C.current = { from:
|
|
3276
|
-
const
|
|
3277
|
-
const De = me -
|
|
3278
|
-
return
|
|
3279
|
-
}, Ce =
|
|
3280
|
-
Lt(b,
|
|
3281
|
-
for (let
|
|
3282
|
-
const De =
|
|
3283
|
-
He &&
|
|
3298
|
+
const R = Nt(K, B, G, Z), { from: ie, to: me } = ul(C.current, Y.length);
|
|
3299
|
+
C.current = { from: ie, to: me };
|
|
3300
|
+
const ce = Y.slice(Math.max(0, Math.floor(ie)), Math.min(Y.length, Math.ceil(me) + 1)), ae = (le) => {
|
|
3301
|
+
const De = me - ie + 1, He = R.plotWidth / De;
|
|
3302
|
+
return R.plotLeft + (le - ie + 0.5) * He;
|
|
3303
|
+
}, Ce = R.plotWidth / (me - ie + 1), Ie = V.map((le) => hl(le, Y)).filter((le) => le !== null).map((le) => ({ ...le, color: de(le.color) })), xe = rn(R.main, ce, Ie, ie, me);
|
|
3304
|
+
Lt(b, R.plotLeft, R.plotRight, xe, A), gl(b, R, xe, c, A), b.save(), b.beginPath(), b.rect(R.plotLeft, xe.paneTop, R.plotWidth, xe.paneHeight), b.clip();
|
|
3305
|
+
for (let le = 0; le < V.length; le++) {
|
|
3306
|
+
const De = V[le], He = Ie[le];
|
|
3307
|
+
He && xl(b, He, De, Y, ie, me, ae, xe);
|
|
3284
3308
|
}
|
|
3285
|
-
if (o === "candle" ?
|
|
3286
|
-
const
|
|
3287
|
-
Lt(b,
|
|
3309
|
+
if (o === "candle" ? yl(b, Y, ie, me, ae, Ce, xe, { up: A.up, down: A.down }) : o === "bar" ? vl(b, Y, ie, me, ae, Ce, xe, { up: A.up, down: A.down }) : bl(b, Y, ie, me, ae, xe, A.line, o === "area"), b.restore(), R.volume) {
|
|
3310
|
+
const le = ml(R.volume, Y, ie, me);
|
|
3311
|
+
Lt(b, R.plotLeft, R.plotRight, le, A, !0), Ot(b, R, R.volume, "Volume", A), b.save(), b.beginPath(), b.rect(R.plotLeft, le.paneTop, R.plotWidth, le.paneHeight), b.clip(), kl(b, Y, ie, me, ae, Ce, le, { up: A.up, down: A.down }), b.restore();
|
|
3288
3312
|
}
|
|
3289
|
-
if (
|
|
3290
|
-
const
|
|
3291
|
-
paneTop:
|
|
3292
|
-
paneBottom:
|
|
3293
|
-
paneHeight:
|
|
3313
|
+
if (R.rsi) {
|
|
3314
|
+
const le = V.find((tt) => tt.type === "rsi"), De = le && le.type === "rsi" ? le.period ?? 14 : 14, He = le && le.type === "rsi" ? le.overbought ?? 70 : 70, Ge = le && le.type === "rsi" ? le.oversold ?? 30 : 30, Ee = (le && le.type === "rsi" ? le.color : void 0) ?? "var(--crk-chart-5)", xt = de(Ee), kt = el(Y, De), Oe = {
|
|
3315
|
+
paneTop: R.rsi.top,
|
|
3316
|
+
paneBottom: R.rsi.bottom,
|
|
3317
|
+
paneHeight: R.rsi.height,
|
|
3294
3318
|
priceMin: 0,
|
|
3295
3319
|
priceMax: 100,
|
|
3296
3320
|
ticks: [Ge, 50, He]
|
|
3297
3321
|
};
|
|
3298
|
-
Lt(b,
|
|
3322
|
+
Lt(b, R.plotLeft, R.plotRight, Oe, A, !0), Ot(b, R, R.rsi, `RSI ${De}`, A), b.save(), b.beginPath(), b.rect(R.plotLeft, Oe.paneTop, R.plotWidth, Oe.paneHeight), b.clip(), Qe(b, kt, ie, me, ae, Oe, xt), b.restore(), Ml(b, R, Oe, He, Ge, A);
|
|
3299
3323
|
}
|
|
3300
|
-
|
|
3301
|
-
}, [o,
|
|
3302
|
-
|
|
3324
|
+
wl(b, R, Y, ie, me, n, A), ee.current && $l(b, R, ee.current, Y, ie, me, ae, c, xe, z, A), b.restore();
|
|
3325
|
+
}, [o, V, G, Z, c, j, n, z]);
|
|
3326
|
+
W.current = _;
|
|
3303
3327
|
const J = he(() => {
|
|
3304
|
-
if (
|
|
3328
|
+
if (I.current === null) {
|
|
3305
3329
|
if (typeof requestAnimationFrame > "u") {
|
|
3306
|
-
|
|
3330
|
+
W.current();
|
|
3307
3331
|
return;
|
|
3308
3332
|
}
|
|
3309
|
-
|
|
3310
|
-
|
|
3333
|
+
I.current = requestAnimationFrame(() => {
|
|
3334
|
+
I.current = null, W.current();
|
|
3311
3335
|
});
|
|
3312
3336
|
}
|
|
3313
3337
|
}, []);
|
|
3314
|
-
|
|
3315
|
-
const g =
|
|
3338
|
+
dn(() => {
|
|
3339
|
+
const g = U.current;
|
|
3316
3340
|
if (!g) return;
|
|
3317
3341
|
const b = () => {
|
|
3318
|
-
const B = g.getBoundingClientRect(),
|
|
3319
|
-
Q.current =
|
|
3320
|
-
const A =
|
|
3321
|
-
A && (A.width = Math.round(B.width *
|
|
3342
|
+
const B = g.getBoundingClientRect(), X = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3343
|
+
Q.current = X, F.current = { width: B.width, height: B.height };
|
|
3344
|
+
const A = re.current;
|
|
3345
|
+
A && (A.width = Math.round(B.width * X), A.height = Math.round(B.height * X), A.style.width = `${B.width}px`, A.style.height = `${B.height}px`), J();
|
|
3322
3346
|
};
|
|
3323
3347
|
if (b(), typeof ResizeObserver > "u") return;
|
|
3324
3348
|
const K = new ResizeObserver(b);
|
|
3325
3349
|
return K.observe(g), () => K.disconnect();
|
|
3326
3350
|
}, [J]), Be(() => {
|
|
3327
3351
|
let g = !1;
|
|
3328
|
-
const b = Math.floor(Date.now() / 1e3), K = Ft(n), B = r !== void 0 ?
|
|
3329
|
-
|
|
3352
|
+
const b = Math.floor(Date.now() / 1e3), K = Ft(n), B = r !== void 0 ? nn(r) : K * l, X = r !== void 0 ? Math.max(10, Math.ceil(B / K)) : l, A = b - B;
|
|
3353
|
+
D.current = [], C.current = { from: 0, to: 0 }, J(), e.getBars({ symbol: t, resolution: n, from: A, to: b, countBack: X }).then((Y) => {
|
|
3330
3354
|
if (g) return;
|
|
3331
|
-
const
|
|
3332
|
-
|
|
3333
|
-
const
|
|
3355
|
+
const R = [...Y].sort((me, ce) => me.time - ce.time);
|
|
3356
|
+
D.current = R;
|
|
3357
|
+
const ie = R.length - 1;
|
|
3334
3358
|
if (r !== void 0)
|
|
3335
|
-
C.current = { from: 0, to:
|
|
3359
|
+
C.current = { from: 0, to: ie };
|
|
3336
3360
|
else {
|
|
3337
|
-
const me = Math.min(
|
|
3361
|
+
const me = Math.min(R.length, Math.min(200, l));
|
|
3338
3362
|
C.current = {
|
|
3339
|
-
from: Math.max(0,
|
|
3340
|
-
to:
|
|
3363
|
+
from: Math.max(0, ie - me + 1),
|
|
3364
|
+
to: ie
|
|
3341
3365
|
};
|
|
3342
3366
|
}
|
|
3343
|
-
|
|
3367
|
+
oe.current?.(C.current, R), J();
|
|
3344
3368
|
}).catch(() => {
|
|
3345
3369
|
});
|
|
3346
3370
|
const de = e.subscribeBars({
|
|
3347
3371
|
symbol: t,
|
|
3348
3372
|
resolution: n,
|
|
3349
|
-
onTick: (
|
|
3373
|
+
onTick: (Y) => {
|
|
3350
3374
|
if (g) return;
|
|
3351
|
-
const
|
|
3352
|
-
if (
|
|
3353
|
-
|
|
3354
|
-
else if (!
|
|
3355
|
-
|
|
3375
|
+
const R = D.current, ie = R[R.length - 1];
|
|
3376
|
+
if (ie && ie.time === Y.time)
|
|
3377
|
+
R[R.length - 1] = Y;
|
|
3378
|
+
else if (!ie || Y.time > ie.time) {
|
|
3379
|
+
R.push(Y);
|
|
3356
3380
|
const me = C.current;
|
|
3357
|
-
me.to >=
|
|
3381
|
+
me.to >= R.length - 2 && (C.current = { from: me.from + 1, to: me.to + 1 });
|
|
3358
3382
|
}
|
|
3359
3383
|
J();
|
|
3360
3384
|
}
|
|
@@ -3364,82 +3388,82 @@ function Ul({
|
|
|
3364
3388
|
};
|
|
3365
3389
|
}, [e, t, n, r, l]);
|
|
3366
3390
|
const ue = he((g) => {
|
|
3367
|
-
v(g),
|
|
3391
|
+
v(g), te.current?.(g);
|
|
3368
3392
|
}, []), be = he((g) => {
|
|
3369
3393
|
g.currentTarget.setPointerCapture(g.pointerId);
|
|
3370
3394
|
const b = C.current;
|
|
3371
|
-
|
|
3395
|
+
se.current = { startX: g.clientX, from: b.from, to: b.to };
|
|
3372
3396
|
}, []), pe = he(
|
|
3373
3397
|
(g) => {
|
|
3374
3398
|
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = g.clientY - b.top;
|
|
3375
|
-
if (
|
|
3376
|
-
const { startX: de, from:
|
|
3377
|
-
let Ie =
|
|
3378
|
-
const
|
|
3379
|
-
Ie < 0 && (Ne(), Ie = 0, xe =
|
|
3399
|
+
if (ee.current = { x: K, y: B }, se.current) {
|
|
3400
|
+
const { startX: de, from: Y, to: R } = se.current, { width: ie } = F.current, me = Math.max(1, ie - Rt), ce = R - Y + 1, ae = me / ce, Ce = -(g.clientX - de) / ae;
|
|
3401
|
+
let Ie = Y + Ce, xe = R + Ce;
|
|
3402
|
+
const le = D.current.length;
|
|
3403
|
+
Ie < 0 && (Ne(), Ie = 0, xe = ce - 1), xe > le - 1 && (xe = le - 1, Ie = xe - ce + 1), C.current = { from: Ie, to: xe }, oe.current?.(C.current, D.current);
|
|
3380
3404
|
}
|
|
3381
|
-
const
|
|
3382
|
-
if (K >=
|
|
3383
|
-
const de = A.to - A.from + 1,
|
|
3384
|
-
ue({ barIndex: me, bar:
|
|
3405
|
+
const X = Nt(b.width, b.height, G, Z), A = C.current;
|
|
3406
|
+
if (K >= X.plotLeft && K <= X.plotRight) {
|
|
3407
|
+
const de = A.to - A.from + 1, Y = X.plotWidth / de, R = Math.round(A.from + (K - X.plotLeft) / Y - 0.5), ie = D.current, me = Math.max(0, Math.min(ie.length - 1, R)), ce = ie[me] ?? null, ae = Nl(B, X, ie, A.from, A.to);
|
|
3408
|
+
ue({ barIndex: me, bar: ce, priceAtCursor: ae });
|
|
3385
3409
|
} else
|
|
3386
3410
|
ue(null);
|
|
3387
3411
|
J();
|
|
3388
3412
|
},
|
|
3389
3413
|
[G, Z, J, ue]
|
|
3390
3414
|
), fe = he((g) => {
|
|
3391
|
-
g.currentTarget.releasePointerCapture(g.pointerId),
|
|
3415
|
+
g.currentTarget.releasePointerCapture(g.pointerId), se.current = null;
|
|
3392
3416
|
}, []), ge = he(() => {
|
|
3393
|
-
|
|
3417
|
+
ee.current = null, se.current = null, ue(null), J();
|
|
3394
3418
|
}, [J, ue]), ve = he(
|
|
3395
3419
|
(g) => {
|
|
3396
3420
|
g.preventDefault();
|
|
3397
|
-
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = Nt(b.width, b.height, G, Z),
|
|
3421
|
+
const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = Nt(b.width, b.height, G, Z), X = C.current, A = D.current;
|
|
3398
3422
|
if (A.length === 0) return;
|
|
3399
|
-
const de =
|
|
3400
|
-
B.plotWidth /
|
|
3401
|
-
Math.min(A.length, B.plotWidth /
|
|
3402
|
-
),
|
|
3403
|
-
let
|
|
3404
|
-
|
|
3423
|
+
const de = X.to - X.from + 1, Y = g.deltaY > 0 ? 1 + Ht : 1 / (1 + Ht), R = Math.max(
|
|
3424
|
+
B.plotWidth / cl,
|
|
3425
|
+
Math.min(A.length, B.plotWidth / ol, de * Y)
|
|
3426
|
+
), ie = X.from + (K - B.plotLeft) / (B.plotWidth / de), me = (ie - X.from) / de;
|
|
3427
|
+
let ce = ie - me * R, ae = ce + R - 1;
|
|
3428
|
+
ce < 0 && (ce = 0, ae = R - 1), ae > A.length - 1 && (ae = A.length - 1, ce = ae - R + 1), C.current = { from: ce, to: ae }, oe.current?.(C.current, A), J();
|
|
3405
3429
|
},
|
|
3406
3430
|
[G, Z, J]
|
|
3407
3431
|
), Re = he(
|
|
3408
3432
|
(g) => {
|
|
3409
|
-
const b = C.current, K = b.to - b.from + 1, B =
|
|
3433
|
+
const b = C.current, K = b.to - b.from + 1, B = D.current;
|
|
3410
3434
|
if (B.length === 0) return;
|
|
3411
|
-
let
|
|
3412
|
-
if (g.key === "ArrowLeft")
|
|
3413
|
-
else if (g.key === "ArrowRight")
|
|
3435
|
+
let X = 0;
|
|
3436
|
+
if (g.key === "ArrowLeft") X = -Math.max(1, Math.floor(K * 0.1));
|
|
3437
|
+
else if (g.key === "ArrowRight") X = Math.max(1, Math.floor(K * 0.1));
|
|
3414
3438
|
else return;
|
|
3415
3439
|
g.preventDefault();
|
|
3416
|
-
let A = b.from +
|
|
3417
|
-
A < 0 && (A = 0, de = K - 1), de > B.length - 1 && (de = B.length - 1, A = de - K + 1), C.current = { from: A, to: de },
|
|
3440
|
+
let A = b.from + X, de = b.to + X;
|
|
3441
|
+
A < 0 && (A = 0, de = K - 1), de > B.length - 1 && (de = B.length - 1, A = de - K + 1), C.current = { from: A, to: de }, oe.current?.(C.current, B), J();
|
|
3418
3442
|
},
|
|
3419
3443
|
[J]
|
|
3420
3444
|
), Ne = he(() => {
|
|
3421
|
-
if (
|
|
3422
|
-
const g =
|
|
3445
|
+
if (M.current) return;
|
|
3446
|
+
const g = D.current;
|
|
3423
3447
|
if (g.length === 0) return;
|
|
3424
|
-
|
|
3425
|
-
const b = Ft(n), K = g[0].time, B = K - b * l,
|
|
3426
|
-
e.getBars({ symbol: t, resolution: n, from: B, to:
|
|
3448
|
+
M.current = !0;
|
|
3449
|
+
const b = Ft(n), K = g[0].time, B = K - b * l, X = K - b;
|
|
3450
|
+
e.getBars({ symbol: t, resolution: n, from: B, to: X, countBack: l }).then((A) => {
|
|
3427
3451
|
if (A.length === 0) {
|
|
3428
|
-
|
|
3452
|
+
M.current = !1;
|
|
3429
3453
|
return;
|
|
3430
3454
|
}
|
|
3431
|
-
const
|
|
3432
|
-
|
|
3455
|
+
const Y = [...A].sort((ie, me) => ie.time - me.time).filter((ie) => ie.time < K), R = C.current;
|
|
3456
|
+
D.current = [...Y, ...g], C.current = { from: R.from + Y.length, to: R.to + Y.length }, M.current = !1, J();
|
|
3433
3457
|
}).catch(() => {
|
|
3434
|
-
|
|
3458
|
+
M.current = !1;
|
|
3435
3459
|
});
|
|
3436
3460
|
}, [e, t, n, l, J]);
|
|
3437
3461
|
return /* @__PURE__ */ H(
|
|
3438
3462
|
"div",
|
|
3439
3463
|
{
|
|
3440
|
-
ref:
|
|
3441
|
-
className: f(x.root,
|
|
3442
|
-
style: { ...
|
|
3464
|
+
ref: U,
|
|
3465
|
+
className: f(x.root, O),
|
|
3466
|
+
style: { ...P, height: a, position: "relative" },
|
|
3443
3467
|
tabIndex: 0,
|
|
3444
3468
|
role: "figure",
|
|
3445
3469
|
"aria-label": `${t} ${n} chart`,
|
|
@@ -3448,14 +3472,14 @@ function Ul({
|
|
|
3448
3472
|
/* @__PURE__ */ s(
|
|
3449
3473
|
"canvas",
|
|
3450
3474
|
{
|
|
3451
|
-
ref:
|
|
3475
|
+
ref: re,
|
|
3452
3476
|
className: x.svg,
|
|
3453
3477
|
onPointerDown: be,
|
|
3454
3478
|
onPointerMove: pe,
|
|
3455
3479
|
onPointerUp: fe,
|
|
3456
3480
|
onPointerLeave: ge,
|
|
3457
3481
|
onWheel: ve,
|
|
3458
|
-
style: { cursor:
|
|
3482
|
+
style: { cursor: se.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3459
3483
|
}
|
|
3460
3484
|
),
|
|
3461
3485
|
/* @__PURE__ */ H(
|
|
@@ -3464,7 +3488,7 @@ function Ul({
|
|
|
3464
3488
|
className: x.tradingHeader,
|
|
3465
3489
|
style: {
|
|
3466
3490
|
position: "absolute",
|
|
3467
|
-
top:
|
|
3491
|
+
top: rl,
|
|
3468
3492
|
left: 8,
|
|
3469
3493
|
right: 8,
|
|
3470
3494
|
pointerEvents: "none",
|
|
@@ -3489,25 +3513,26 @@ function Ul({
|
|
|
3489
3513
|
L.bar.close.toFixed(c)
|
|
3490
3514
|
] })
|
|
3491
3515
|
] }),
|
|
3492
|
-
|
|
3493
|
-
|
|
3516
|
+
w && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
3517
|
+
Vt,
|
|
3494
3518
|
{
|
|
3495
3519
|
position: "bottom",
|
|
3520
|
+
asChild: !0,
|
|
3496
3521
|
trigger: /* @__PURE__ */ s(
|
|
3497
|
-
|
|
3522
|
+
_t,
|
|
3498
3523
|
{
|
|
3499
3524
|
variant: "ghost",
|
|
3500
3525
|
size: "sm",
|
|
3501
3526
|
iconOnly: !0,
|
|
3502
3527
|
"aria-label": "Chart settings",
|
|
3503
|
-
children: /* @__PURE__ */ s(
|
|
3528
|
+
children: /* @__PURE__ */ s(dl, {})
|
|
3504
3529
|
}
|
|
3505
3530
|
),
|
|
3506
3531
|
content: /* @__PURE__ */ s(
|
|
3507
|
-
|
|
3532
|
+
al,
|
|
3508
3533
|
{
|
|
3509
3534
|
timezone: z,
|
|
3510
|
-
onTimezoneChange:
|
|
3535
|
+
onTimezoneChange: T
|
|
3511
3536
|
}
|
|
3512
3537
|
)
|
|
3513
3538
|
}
|
|
@@ -3519,7 +3544,7 @@ function Ul({
|
|
|
3519
3544
|
}
|
|
3520
3545
|
);
|
|
3521
3546
|
}
|
|
3522
|
-
const
|
|
3547
|
+
const sl = [
|
|
3523
3548
|
{ value: "local", label: "Local time" },
|
|
3524
3549
|
{ value: "utc", label: "UTC" },
|
|
3525
3550
|
{ value: "America/New_York", label: "America / New York" },
|
|
@@ -3529,7 +3554,7 @@ const cl = [
|
|
|
3529
3554
|
{ value: "Asia/Tokyo", label: "Asia / Tokyo" },
|
|
3530
3555
|
{ value: "Asia/Singapore", label: "Asia / Singapore" }
|
|
3531
3556
|
];
|
|
3532
|
-
function
|
|
3557
|
+
function al({
|
|
3533
3558
|
timezone: e,
|
|
3534
3559
|
onTimezoneChange: t
|
|
3535
3560
|
}) {
|
|
@@ -3548,9 +3573,9 @@ function il({
|
|
|
3548
3573
|
/* @__PURE__ */ H("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
|
|
3549
3574
|
/* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
|
|
3550
3575
|
/* @__PURE__ */ s(
|
|
3551
|
-
|
|
3576
|
+
zt,
|
|
3552
3577
|
{
|
|
3553
|
-
options:
|
|
3578
|
+
options: sl.map((n) => ({ value: n.value, label: n.label })),
|
|
3554
3579
|
value: e,
|
|
3555
3580
|
onChange: (n) => t(n)
|
|
3556
3581
|
}
|
|
@@ -3558,7 +3583,7 @@ function il({
|
|
|
3558
3583
|
] })
|
|
3559
3584
|
] });
|
|
3560
3585
|
}
|
|
3561
|
-
function
|
|
3586
|
+
function dl() {
|
|
3562
3587
|
return /* @__PURE__ */ H(
|
|
3563
3588
|
"svg",
|
|
3564
3589
|
{
|
|
@@ -3577,14 +3602,14 @@ function ll() {
|
|
|
3577
3602
|
);
|
|
3578
3603
|
}
|
|
3579
3604
|
function Nt(e, t, n, r) {
|
|
3580
|
-
const i = Math.max(0, e - Rt), c =
|
|
3581
|
-
let
|
|
3605
|
+
const i = Math.max(0, e - Rt), c = nl, l = Math.max(c, t - Ct), a = Math.max(0, i - 0), h = Math.max(0, l - c);
|
|
3606
|
+
let d = h, u = c;
|
|
3582
3607
|
const m = { top: c, bottom: l, height: h };
|
|
3583
3608
|
let p = null, y = null;
|
|
3584
|
-
const
|
|
3585
|
-
return
|
|
3609
|
+
const w = n ? Wt.rsi : 0, N = r ? Wt.volume : 0;
|
|
3610
|
+
return d = h * (1 - w - N), m.top = u, m.height = d, m.bottom = m.top + d, u = m.bottom, n && (p = { top: u, height: h * w, bottom: u + h * w }, u = p.bottom), r && (y = { top: u, height: h * N, bottom: u + h * N }), { width: e, height: t, plotLeft: 0, plotRight: i, plotTop: c, plotBottom: l, plotWidth: a, plotHeight: h, main: m, rsi: p, volume: y };
|
|
3586
3611
|
}
|
|
3587
|
-
function
|
|
3612
|
+
function ul(e, t) {
|
|
3588
3613
|
if (t === 0) return { from: 0, to: 0 };
|
|
3589
3614
|
let { from: n, to: r } = e;
|
|
3590
3615
|
if (r >= t) {
|
|
@@ -3593,13 +3618,13 @@ function sl(e, t) {
|
|
|
3593
3618
|
}
|
|
3594
3619
|
return n < 0 && (n = 0), r < n && (r = n), { from: n, to: r };
|
|
3595
3620
|
}
|
|
3596
|
-
function
|
|
3621
|
+
function hl(e, t) {
|
|
3597
3622
|
if (e.type === "sma")
|
|
3598
|
-
return { kind: "line", values:
|
|
3623
|
+
return { kind: "line", values: Ki(t, e.period), color: e.color ?? "var(--crk-chart-2)" };
|
|
3599
3624
|
if (e.type === "ema")
|
|
3600
|
-
return { kind: "line", values:
|
|
3625
|
+
return { kind: "line", values: Qi(t, e.period), color: e.color ?? "var(--crk-chart-3)" };
|
|
3601
3626
|
if (e.type === "bollinger") {
|
|
3602
|
-
const n =
|
|
3627
|
+
const n = Ji(t, e.period, e.stdDev ?? 2);
|
|
3603
3628
|
return {
|
|
3604
3629
|
kind: "bollinger",
|
|
3605
3630
|
middle: n.middle,
|
|
@@ -3611,30 +3636,30 @@ function al(e, t) {
|
|
|
3611
3636
|
}
|
|
3612
3637
|
return null;
|
|
3613
3638
|
}
|
|
3614
|
-
function
|
|
3639
|
+
function rn(e, t, n, r, o) {
|
|
3615
3640
|
let i = 1 / 0, c = -1 / 0;
|
|
3616
|
-
for (const
|
|
3617
|
-
|
|
3618
|
-
for (const
|
|
3619
|
-
const m =
|
|
3641
|
+
for (const u of t)
|
|
3642
|
+
u.low < i && (i = u.low), u.high > c && (c = u.high);
|
|
3643
|
+
for (const u of n) {
|
|
3644
|
+
const m = u.kind === "line" ? [u.values] : [u.upper, u.lower];
|
|
3620
3645
|
for (const p of m) {
|
|
3621
|
-
const y = Math.max(0, Math.floor(r)),
|
|
3622
|
-
for (let
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3646
|
+
const y = Math.max(0, Math.floor(r)), w = Math.min(p.length - 1, Math.ceil(o));
|
|
3647
|
+
for (let N = y; N <= w; N++) {
|
|
3648
|
+
const S = p[N];
|
|
3649
|
+
S != null && (S < i && (i = S), S > c && (c = S));
|
|
3625
3650
|
}
|
|
3626
3651
|
}
|
|
3627
3652
|
}
|
|
3628
3653
|
(!isFinite(i) || !isFinite(c)) && (i = 0, c = 1);
|
|
3629
|
-
const l = (c - i) * 0.08 || 1, a = qe(i - l, c + l, 5), h = Math.min(a[0], i),
|
|
3630
|
-
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: h, priceMax:
|
|
3654
|
+
const l = (c - i) * 0.08 || 1, a = qe(i - l, c + l, 5), h = Math.min(a[0], i), d = Math.max(a[a.length - 1], c);
|
|
3655
|
+
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: h, priceMax: d, ticks: a };
|
|
3631
3656
|
}
|
|
3632
|
-
function
|
|
3657
|
+
function ml(e, t, n, r) {
|
|
3633
3658
|
let o = 0;
|
|
3634
3659
|
const i = Math.max(0, Math.floor(n)), c = Math.min(t.length - 1, Math.ceil(r));
|
|
3635
3660
|
for (let h = i; h <= c; h++) {
|
|
3636
|
-
const
|
|
3637
|
-
|
|
3661
|
+
const d = t[h].volume ?? 0;
|
|
3662
|
+
d > o && (o = d);
|
|
3638
3663
|
}
|
|
3639
3664
|
const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
|
|
3640
3665
|
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
|
|
@@ -3643,7 +3668,7 @@ function we(e, t) {
|
|
|
3643
3668
|
const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
|
|
3644
3669
|
return t.paneBottom - n * t.paneHeight;
|
|
3645
3670
|
}
|
|
3646
|
-
function
|
|
3671
|
+
function on(e) {
|
|
3647
3672
|
if (!e || typeof getComputedStyle > "u") return (o) => o;
|
|
3648
3673
|
const t = getComputedStyle(e), n = /* @__PURE__ */ new Map(), r = (o) => {
|
|
3649
3674
|
if (!o || !o.includes("var(")) return o;
|
|
@@ -3660,8 +3685,8 @@ function rn(e) {
|
|
|
3660
3685
|
};
|
|
3661
3686
|
return r;
|
|
3662
3687
|
}
|
|
3663
|
-
function
|
|
3664
|
-
const n =
|
|
3688
|
+
function fl(e, t) {
|
|
3689
|
+
const n = on(e);
|
|
3665
3690
|
return {
|
|
3666
3691
|
up: n(t.up),
|
|
3667
3692
|
down: n(t.down),
|
|
@@ -3673,7 +3698,7 @@ function ul(e, t) {
|
|
|
3673
3698
|
bg: n("var(--crk-color-bg)") || "#ffffff"
|
|
3674
3699
|
};
|
|
3675
3700
|
}
|
|
3676
|
-
function
|
|
3701
|
+
function pl(e, t, n, r) {
|
|
3677
3702
|
e.fillStyle = r.textMuted, e.font = "13px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Loading…", t / 2, n / 2);
|
|
3678
3703
|
}
|
|
3679
3704
|
function Lt(e, t, n, r, o, i = !1) {
|
|
@@ -3684,58 +3709,58 @@ function Lt(e, t, n, r, o, i = !1) {
|
|
|
3684
3709
|
}
|
|
3685
3710
|
e.stroke();
|
|
3686
3711
|
}
|
|
3687
|
-
function
|
|
3712
|
+
function gl(e, t, n, r, o) {
|
|
3688
3713
|
e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
|
|
3689
3714
|
for (const i of n.ticks) {
|
|
3690
3715
|
const c = we(i, n);
|
|
3691
3716
|
e.fillText(i.toFixed(r), t.plotRight + 6, c);
|
|
3692
3717
|
}
|
|
3693
3718
|
}
|
|
3694
|
-
function
|
|
3695
|
-
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)),
|
|
3696
|
-
for (let
|
|
3697
|
-
const m = t[
|
|
3698
|
-
e.strokeStyle =
|
|
3699
|
-
const
|
|
3700
|
-
e.moveTo(
|
|
3701
|
-
const
|
|
3702
|
-
e.fillRect(Math.round(p -
|
|
3719
|
+
function yl(e, t, n, r, o, i, c, l) {
|
|
3720
|
+
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(1, i * 0.7);
|
|
3721
|
+
for (let u = a; u <= h; u++) {
|
|
3722
|
+
const m = t[u], p = o(u), y = we(m.open, c), w = we(m.close, c), N = we(m.high, c), S = we(m.low, c), P = m.close >= m.open ? l.up : l.down;
|
|
3723
|
+
e.strokeStyle = P, e.fillStyle = P, e.beginPath();
|
|
3724
|
+
const U = Math.round(p) + 0.5;
|
|
3725
|
+
e.moveTo(U, N), e.lineTo(U, S), e.stroke();
|
|
3726
|
+
const re = Math.min(y, w), D = Math.max(1, Math.abs(w - y));
|
|
3727
|
+
e.fillRect(Math.round(p - d / 2), Math.round(re), Math.round(d), Math.round(D));
|
|
3703
3728
|
}
|
|
3704
3729
|
}
|
|
3705
|
-
function
|
|
3706
|
-
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)),
|
|
3730
|
+
function vl(e, t, n, r, o, i, c, l) {
|
|
3731
|
+
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(2, Math.min(i * 0.4, 8));
|
|
3707
3732
|
e.lineWidth = Math.max(1, Math.min(2, i * 0.18)), e.lineCap = "butt";
|
|
3708
|
-
for (let
|
|
3709
|
-
const m = t[
|
|
3710
|
-
e.strokeStyle =
|
|
3733
|
+
for (let u = a; u <= h; u++) {
|
|
3734
|
+
const m = t[u], p = Math.round(o(u)) + 0.5, y = we(m.high, c), w = we(m.low, c), N = we(m.open, c), S = we(m.close, c), O = m.close >= m.open;
|
|
3735
|
+
e.strokeStyle = O ? l.up : l.down, e.beginPath(), e.moveTo(p, y), e.lineTo(p, w), e.moveTo(p - d, N), e.lineTo(p, N), e.moveTo(p, S), e.lineTo(p + d, S), e.stroke();
|
|
3711
3736
|
}
|
|
3712
3737
|
}
|
|
3713
|
-
function
|
|
3738
|
+
function bl(e, t, n, r, o, i, c, l) {
|
|
3714
3739
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3715
3740
|
if (!(h <= a)) {
|
|
3716
3741
|
e.strokeStyle = c, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), we(t[a].close, i));
|
|
3717
|
-
for (let
|
|
3718
|
-
e.lineTo(o(
|
|
3742
|
+
for (let d = a + 1; d <= h; d++)
|
|
3743
|
+
e.lineTo(o(d), we(t[d].close, i));
|
|
3719
3744
|
e.stroke(), l && (e.globalAlpha = 0.18, e.fillStyle = c, e.lineTo(o(h), i.paneBottom), e.lineTo(o(a), i.paneBottom), e.closePath(), e.fill(), e.globalAlpha = 1);
|
|
3720
3745
|
}
|
|
3721
3746
|
}
|
|
3722
|
-
function
|
|
3747
|
+
function xl(e, t, n, r, o, i, c, l) {
|
|
3723
3748
|
if (t.kind === "line") {
|
|
3724
3749
|
Qe(e, t.values, o, i, c, l, t.color);
|
|
3725
3750
|
return;
|
|
3726
3751
|
}
|
|
3727
3752
|
const a = Math.max(0, Math.floor(o)), h = Math.min(r.length - 1, Math.ceil(i));
|
|
3728
3753
|
e.globalAlpha = t.fillOpacity, e.fillStyle = t.color, e.beginPath();
|
|
3729
|
-
let
|
|
3730
|
-
for (let
|
|
3731
|
-
const m = t.upper[
|
|
3754
|
+
let d = !1;
|
|
3755
|
+
for (let u = a; u <= h; u++) {
|
|
3756
|
+
const m = t.upper[u];
|
|
3732
3757
|
if (m == null) continue;
|
|
3733
|
-
const p = c(
|
|
3734
|
-
|
|
3758
|
+
const p = c(u), y = we(m, l);
|
|
3759
|
+
d ? e.lineTo(p, y) : (e.moveTo(p, y), d = !0);
|
|
3735
3760
|
}
|
|
3736
|
-
for (let
|
|
3737
|
-
const m = t.lower[
|
|
3738
|
-
m != null && e.lineTo(c(
|
|
3761
|
+
for (let u = h; u >= a; u--) {
|
|
3762
|
+
const m = t.lower[u];
|
|
3763
|
+
m != null && e.lineTo(c(u), we(m, l));
|
|
3739
3764
|
}
|
|
3740
3765
|
e.closePath(), e.fill(), e.globalAlpha = 1, Qe(e, t.upper, o, i, c, l, t.color), Qe(e, t.lower, o, i, c, l, t.color), Qe(e, t.middle, o, i, c, l, t.color);
|
|
3741
3766
|
}
|
|
@@ -3743,30 +3768,30 @@ function Qe(e, t, n, r, o, i, c) {
|
|
|
3743
3768
|
e.strokeStyle = c, e.lineWidth = 1.25, e.beginPath();
|
|
3744
3769
|
let l = !1;
|
|
3745
3770
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3746
|
-
for (let
|
|
3747
|
-
const
|
|
3748
|
-
if (
|
|
3771
|
+
for (let d = a; d <= h; d++) {
|
|
3772
|
+
const u = t[d];
|
|
3773
|
+
if (u == null) {
|
|
3749
3774
|
l = !1;
|
|
3750
3775
|
continue;
|
|
3751
3776
|
}
|
|
3752
|
-
const m = o(
|
|
3777
|
+
const m = o(d), p = we(u, i);
|
|
3753
3778
|
l ? e.lineTo(m, p) : (e.moveTo(m, p), l = !0);
|
|
3754
3779
|
}
|
|
3755
3780
|
e.stroke();
|
|
3756
3781
|
}
|
|
3757
|
-
function
|
|
3758
|
-
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)),
|
|
3759
|
-
for (let
|
|
3760
|
-
const m = t[
|
|
3782
|
+
function kl(e, t, n, r, o, i, c, l) {
|
|
3783
|
+
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(1, i * 0.7);
|
|
3784
|
+
for (let u = a; u <= h; u++) {
|
|
3785
|
+
const m = t[u], p = m.volume ?? 0;
|
|
3761
3786
|
if (p === 0) continue;
|
|
3762
3787
|
const y = m.close >= m.open;
|
|
3763
3788
|
e.fillStyle = y ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3764
|
-
const
|
|
3765
|
-
e.fillRect(Math.round(o(
|
|
3789
|
+
const w = we(p, c), N = c.paneBottom - w;
|
|
3790
|
+
e.fillRect(Math.round(o(u) - d / 2), Math.round(w), Math.round(d), Math.round(N));
|
|
3766
3791
|
}
|
|
3767
3792
|
e.globalAlpha = 1;
|
|
3768
3793
|
}
|
|
3769
|
-
function
|
|
3794
|
+
function Ml(e, t, n, r, o, i) {
|
|
3770
3795
|
e.strokeStyle = i.grid, e.setLineDash([3, 3]), e.beginPath();
|
|
3771
3796
|
for (const c of [r, o]) {
|
|
3772
3797
|
const l = Math.round(we(c, n)) + 0.5;
|
|
@@ -3777,45 +3802,45 @@ function bl(e, t, n, r, o, i) {
|
|
|
3777
3802
|
function Ot(e, t, n, r, o) {
|
|
3778
3803
|
e.fillStyle = o.textMuted, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "top", e.fillText(r, t.plotLeft + 6, n.top + 4);
|
|
3779
3804
|
}
|
|
3780
|
-
function
|
|
3805
|
+
function wl(e, t, n, r, o, i, c) {
|
|
3781
3806
|
const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
|
|
3782
3807
|
e.fillStyle = c.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
|
|
3783
|
-
const
|
|
3784
|
-
for (let p =
|
|
3785
|
-
const y = n[p],
|
|
3786
|
-
e.fillText(
|
|
3808
|
+
const d = Math.max(0, Math.floor(r)), u = Math.min(n.length - 1, Math.ceil(o)), m = t.plotBottom + Ct / 2;
|
|
3809
|
+
for (let p = d; p <= u; p += h) {
|
|
3810
|
+
const y = n[p], w = t.plotLeft + (p - r + 0.5) * a;
|
|
3811
|
+
e.fillText(Ll(y.time, i), w, m);
|
|
3787
3812
|
}
|
|
3788
3813
|
}
|
|
3789
|
-
function
|
|
3814
|
+
function $l(e, t, n, r, o, i, c, l, a, h, d) {
|
|
3790
3815
|
if (n.x < t.plotLeft || n.x > t.plotRight) return;
|
|
3791
|
-
const
|
|
3792
|
-
if (e.save(), e.strokeStyle =
|
|
3793
|
-
const
|
|
3794
|
-
e.fillStyle =
|
|
3816
|
+
const u = i - o + 1, m = t.plotWidth / u, p = o + (n.x - t.plotLeft) / m - 0.5, y = Math.round(p), w = Math.max(0, Math.min(r.length - 1, y)), N = c(w);
|
|
3817
|
+
if (e.save(), e.strokeStyle = d.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(N + 0.5, t.plotTop), e.lineTo(N + 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) {
|
|
3818
|
+
const S = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3819
|
+
e.fillStyle = d.text, e.fillRect(t.plotRight, n.y - 9, Rt, 18), e.fillStyle = d.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(S.toFixed(l), t.plotRight + 6, n.y);
|
|
3795
3820
|
}
|
|
3796
|
-
if (r[
|
|
3797
|
-
const
|
|
3821
|
+
if (r[w]) {
|
|
3822
|
+
const S = cn(r[w].time, h);
|
|
3798
3823
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3799
|
-
const
|
|
3824
|
+
const U = e.measureText(S).width + 8 * 2, re = Ct, D = Math.max(
|
|
3800
3825
|
t.plotLeft,
|
|
3801
|
-
Math.min(t.plotRight -
|
|
3826
|
+
Math.min(t.plotRight - U, N - U / 2)
|
|
3802
3827
|
), C = t.plotBottom;
|
|
3803
|
-
e.fillStyle =
|
|
3828
|
+
e.fillStyle = d.text, e.fillRect(D, C, U, re), e.fillStyle = d.bg, e.textAlign = "center", e.fillText(S, D + U / 2, C + re / 2);
|
|
3804
3829
|
}
|
|
3805
3830
|
e.restore();
|
|
3806
3831
|
}
|
|
3807
|
-
function
|
|
3808
|
-
const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a =
|
|
3832
|
+
function Nl(e, t, n, r, o, i, c) {
|
|
3833
|
+
const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = rn(t.main, l, [], r, o);
|
|
3809
3834
|
return e < a.paneTop || e > a.paneBottom ? null : a.priceMax - (e - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3810
3835
|
}
|
|
3811
|
-
function
|
|
3836
|
+
function Ll(e, t) {
|
|
3812
3837
|
const n = new Date(e * 1e3);
|
|
3813
3838
|
return t === "D" || t === "W" || t === "M" ? `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())}` : `${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}`;
|
|
3814
3839
|
}
|
|
3815
|
-
function
|
|
3840
|
+
function cn(e, t) {
|
|
3816
3841
|
const n = new Date(e * 1e3);
|
|
3817
3842
|
if (t === "local")
|
|
3818
|
-
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${
|
|
3843
|
+
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${Sl(n)}`;
|
|
3819
3844
|
if (t === "utc")
|
|
3820
3845
|
return `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())} ${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}:${Te(n.getUTCSeconds())} UTC`;
|
|
3821
3846
|
try {
|
|
@@ -3833,10 +3858,10 @@ function on(e, t) {
|
|
|
3833
3858
|
}).formatToParts(n), i = (l) => o.find((a) => a.type === l)?.value ?? "", c = i("timeZoneName") || t;
|
|
3834
3859
|
return `${i("year")}-${i("month")}-${i("day")} ${i("hour")}:${i("minute")}:${i("second")} ${c}`;
|
|
3835
3860
|
} catch {
|
|
3836
|
-
return
|
|
3861
|
+
return cn(e, "utc");
|
|
3837
3862
|
}
|
|
3838
3863
|
}
|
|
3839
|
-
function
|
|
3864
|
+
function Sl(e) {
|
|
3840
3865
|
const t = -e.getTimezoneOffset(), n = t >= 0 ? "+" : "-", r = Math.abs(t);
|
|
3841
3866
|
return `${n}${Te(Math.floor(r / 60))}:${Te(r % 60)}`;
|
|
3842
3867
|
}
|
|
@@ -3859,18 +3884,18 @@ function Ft(e) {
|
|
|
3859
3884
|
}
|
|
3860
3885
|
return 60;
|
|
3861
3886
|
}
|
|
3862
|
-
function
|
|
3887
|
+
function Tl(e, t) {
|
|
3863
3888
|
if (e.length === 0) return "";
|
|
3864
3889
|
if (e.length === 1 || t === "linear")
|
|
3865
3890
|
return e.map((r, o) => `${o === 0 ? "M" : "L"} ${r.x} ${r.y}`).join(" ");
|
|
3866
3891
|
let n = `M ${e[0].x} ${e[0].y}`;
|
|
3867
3892
|
for (let r = 0; r < e.length - 1; r++) {
|
|
3868
|
-
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6,
|
|
3869
|
-
n += ` C ${a} ${h}, ${
|
|
3893
|
+
const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
|
|
3894
|
+
n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
|
|
3870
3895
|
}
|
|
3871
3896
|
return n;
|
|
3872
3897
|
}
|
|
3873
|
-
const
|
|
3898
|
+
const Rl = $e(
|
|
3874
3899
|
({
|
|
3875
3900
|
data: e,
|
|
3876
3901
|
width: t = 80,
|
|
@@ -3882,19 +3907,19 @@ const Ll = $e(
|
|
|
3882
3907
|
showLastPoint: l = !1,
|
|
3883
3908
|
"aria-label": a,
|
|
3884
3909
|
className: h,
|
|
3885
|
-
style:
|
|
3886
|
-
},
|
|
3910
|
+
style: d
|
|
3911
|
+
}, u) => {
|
|
3887
3912
|
const { line: m, area: p, last: y } = ke(() => {
|
|
3888
3913
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
3889
|
-
const
|
|
3890
|
-
return { line: C, area:
|
|
3914
|
+
const w = o, N = Math.max(1, t - w * 2), S = Math.max(1, n - w * 2), [O, P] = bt(e), U = Je([0, Math.max(1, e.length - 1)], [w, w + N]), re = Je([O, P], [w + S, w]), D = e.map((se, M) => ({ x: U(M), y: re(se) })), C = Tl(D, i), ee = c ? `${C} L ${D[D.length - 1].x} ${w + S} L ${D[0].x} ${w + S} Z` : "";
|
|
3915
|
+
return { line: C, area: ee, last: D[D.length - 1] };
|
|
3891
3916
|
}, [e, t, n, o, i, c]);
|
|
3892
3917
|
return /* @__PURE__ */ H(
|
|
3893
3918
|
"svg",
|
|
3894
3919
|
{
|
|
3895
|
-
ref:
|
|
3920
|
+
ref: u,
|
|
3896
3921
|
className: f(x.sparkline, h),
|
|
3897
|
-
style:
|
|
3922
|
+
style: d,
|
|
3898
3923
|
width: t,
|
|
3899
3924
|
height: n,
|
|
3900
3925
|
viewBox: `0 0 ${t} ${n}`,
|
|
@@ -3919,45 +3944,45 @@ const Ll = $e(
|
|
|
3919
3944
|
);
|
|
3920
3945
|
}
|
|
3921
3946
|
);
|
|
3922
|
-
|
|
3947
|
+
Rl.displayName = "Sparkline";
|
|
3923
3948
|
export {
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3949
|
+
Ol as AreaChart,
|
|
3950
|
+
Fl as BarChart,
|
|
3951
|
+
_t as Button,
|
|
3952
|
+
Fc as Checkbox,
|
|
3953
|
+
zt as Dropdown,
|
|
3954
|
+
uo as DropdownItem,
|
|
3955
|
+
El as Form,
|
|
3956
|
+
Pl as FormField,
|
|
3957
|
+
Wl as FormRow,
|
|
3958
|
+
nc as Input,
|
|
3959
|
+
Hl as LineChart,
|
|
3960
|
+
jn as Link,
|
|
3961
|
+
br as List,
|
|
3962
|
+
xr as ListItem,
|
|
3938
3963
|
yt as Modal,
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3964
|
+
jl as PieChart,
|
|
3965
|
+
Vt as Popover,
|
|
3966
|
+
Xl as RadarChart,
|
|
3967
|
+
Vc as Radio,
|
|
3968
|
+
zc as RadioGroup,
|
|
3969
|
+
Ec as Select,
|
|
3970
|
+
Rl as Sparkline,
|
|
3971
|
+
Il as Table,
|
|
3972
|
+
oi as Textarea,
|
|
3973
|
+
Vl as TradingChart,
|
|
3974
|
+
dr as Typography,
|
|
3975
|
+
Ji as bollinger,
|
|
3976
|
+
Qi as ema,
|
|
3977
|
+
cn as formatCrosshairTime,
|
|
3978
|
+
nn as periodToSeconds,
|
|
3979
|
+
el as rsi,
|
|
3980
|
+
Ki as sma,
|
|
3981
|
+
zl as suggestPeriodForResolution,
|
|
3982
|
+
_l as suggestResolutionForPeriod,
|
|
3958
3983
|
pt as useClickOutside,
|
|
3959
|
-
|
|
3984
|
+
ko as useFocusTrap,
|
|
3960
3985
|
Tt as useKeyboard,
|
|
3961
|
-
|
|
3962
|
-
|
|
3986
|
+
zr as useTableSort,
|
|
3987
|
+
Ul as volumeSeries
|
|
3963
3988
|
};
|