@cedros/login-react 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthenticationSettings-BxpBLsUX.cjs → AuthenticationSettings-D8oXHkM6.cjs} +1 -1
- package/dist/{AuthenticationSettings-BxpBLsUX.cjs.map → AuthenticationSettings-D8oXHkM6.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-eTN4qtHV.js → AuthenticationSettings-DlVILxY4.js} +1 -1
- package/dist/{AuthenticationSettings-eTN4qtHV.js.map → AuthenticationSettings-DlVILxY4.js.map} +1 -1
- package/dist/{CreditSystemSettings-D7avf3PS.js → CreditSystemSettings-Bv6u9lTs.js} +1 -1
- package/dist/{CreditSystemSettings-D7avf3PS.js.map → CreditSystemSettings-Bv6u9lTs.js.map} +1 -1
- package/dist/{CreditSystemSettings-BuBKDfKL.cjs → CreditSystemSettings-D45pwDZM.cjs} +1 -1
- package/dist/{CreditSystemSettings-BuBKDfKL.cjs.map → CreditSystemSettings-D45pwDZM.cjs.map} +1 -1
- package/dist/{DepositsSection-Db4irTZb.js → DepositsSection-BH5K162Q.js} +1 -1
- package/dist/{DepositsSection-Db4irTZb.js.map → DepositsSection-BH5K162Q.js.map} +1 -1
- package/dist/{DepositsSection-DEh9Oy0V.cjs → DepositsSection-DpRn0koq.cjs} +1 -1
- package/dist/{DepositsSection-DEh9Oy0V.cjs.map → DepositsSection-DpRn0koq.cjs.map} +1 -1
- package/dist/{EmailSettings-CGocWYc0.cjs → EmailSettings-DdjoMO_c.cjs} +1 -1
- package/dist/{EmailSettings-CGocWYc0.cjs.map → EmailSettings-DdjoMO_c.cjs.map} +1 -1
- package/dist/{EmailSettings-sN1OCw50.js → EmailSettings-khmiWqhx.js} +1 -1
- package/dist/{EmailSettings-sN1OCw50.js.map → EmailSettings-khmiWqhx.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-qpRuCk4R.js → EmbeddedWalletSettings-Bff6raAT.js} +1 -1
- package/dist/{EmbeddedWalletSettings-qpRuCk4R.js.map → EmbeddedWalletSettings-Bff6raAT.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-NZfbc5K8.cjs → EmbeddedWalletSettings-C5qkJtAr.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-NZfbc5K8.cjs.map → EmbeddedWalletSettings-C5qkJtAr.cjs.map} +1 -1
- package/dist/{ServerSettings-Bkr_xuDx.cjs → ServerSettings-BpZhkxh6.cjs} +1 -1
- package/dist/{ServerSettings-Bkr_xuDx.cjs.map → ServerSettings-BpZhkxh6.cjs.map} +1 -1
- package/dist/{ServerSettings-CQn3-uuP.js → ServerSettings-UIVR0R4l.js} +1 -1
- package/dist/{ServerSettings-CQn3-uuP.js.map → ServerSettings-UIVR0R4l.js.map} +1 -1
- package/dist/TeamSection-BoGqQhD5.cjs +1 -0
- package/dist/TeamSection-BoGqQhD5.cjs.map +1 -0
- package/dist/{TeamSection-DNozLdU4.js → TeamSection-DnJudC38.js} +58 -62
- package/dist/TeamSection-DnJudC38.js.map +1 -0
- package/dist/{UsersSection-DDfHW_ao.cjs → UsersSection-Ce7xVKfp.cjs} +1 -1
- package/dist/{UsersSection-DDfHW_ao.cjs.map → UsersSection-Ce7xVKfp.cjs.map} +1 -1
- package/dist/{UsersSection-DlfHGrJK.js → UsersSection-mOOjcUEv.js} +1 -1
- package/dist/{UsersSection-DlfHGrJK.js.map → UsersSection-mOOjcUEv.js.map} +1 -1
- package/dist/{WebhookSettings-9dcnVNH_.cjs → WebhookSettings-Cx-BxzNQ.cjs} +1 -1
- package/dist/{WebhookSettings-9dcnVNH_.cjs.map → WebhookSettings-Cx-BxzNQ.cjs.map} +1 -1
- package/dist/{WebhookSettings-Cx30aHt_.js → WebhookSettings-D0i0JhQD.js} +1 -1
- package/dist/{WebhookSettings-Cx30aHt_.js.map → WebhookSettings-D0i0JhQD.js.map} +1 -1
- package/dist/{WithdrawalsSection-ouu6VoQA.js → WithdrawalsSection-Grebjjks.js} +1 -1
- package/dist/{WithdrawalsSection-ouu6VoQA.js.map → WithdrawalsSection-Grebjjks.js.map} +1 -1
- package/dist/{WithdrawalsSection-MFj2muP6.cjs → WithdrawalsSection-igRQJfjj.cjs} +1 -1
- package/dist/{WithdrawalsSection-MFj2muP6.cjs.map → WithdrawalsSection-igRQJfjj.cjs.map} +1 -1
- package/dist/{index-Djb8LQZ6.js → index-BI9Bj9DF.js} +1018 -1009
- package/dist/index-BI9Bj9DF.js.map +1 -0
- package/dist/{index-CCOKNxfU.cjs → index-CDRTfEJz.cjs} +12 -12
- package/dist/index-CDRTfEJz.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/TeamSection-DNozLdU4.js.map +0 -1
- package/dist/TeamSection-W9SC2Keh.cjs +0 -1
- package/dist/TeamSection-W9SC2Keh.cjs.map +0 -1
- package/dist/index-CCOKNxfU.cjs.map +0 -1
- package/dist/index-Djb8LQZ6.js.map +0 -1
|
@@ -2375,47 +2375,47 @@ function xc({
|
|
|
2375
2375
|
menuItems: n = [],
|
|
2376
2376
|
hideSignOut: o = !1
|
|
2377
2377
|
}) {
|
|
2378
|
-
const { user: c, isAuthenticated: l, isLoading: d, openLoginModal: u, logout: g } = mr(), [m, h] = N(!1), [y, f] = N(-1), p = z(null), v = z(null),
|
|
2378
|
+
const { user: c, isAuthenticated: l, isLoading: d, openLoginModal: u, logout: g } = mr(), [m, h] = N(!1), [y, f] = N(-1), p = z(null), v = z(null), A = O(
|
|
2379
2379
|
() => [...n, ...o ? [] : [{ label: "Sign out", onClick: g }]],
|
|
2380
2380
|
[n, o, g]
|
|
2381
2381
|
);
|
|
2382
2382
|
U(() => {
|
|
2383
2383
|
if (!m) return;
|
|
2384
|
-
const w = (
|
|
2385
|
-
p.current && !p.current.contains(
|
|
2386
|
-
},
|
|
2387
|
-
|
|
2384
|
+
const w = (x) => {
|
|
2385
|
+
p.current && !p.current.contains(x.target) && (h(!1), f(-1));
|
|
2386
|
+
}, P = (x) => {
|
|
2387
|
+
x.key === "Escape" && (h(!1), f(-1), v.current?.focus());
|
|
2388
2388
|
};
|
|
2389
|
-
return document.addEventListener("mousedown", w), document.addEventListener("keydown",
|
|
2390
|
-
document.removeEventListener("mousedown", w), document.removeEventListener("keydown",
|
|
2389
|
+
return document.addEventListener("mousedown", w), document.addEventListener("keydown", P), () => {
|
|
2390
|
+
document.removeEventListener("mousedown", w), document.removeEventListener("keydown", P);
|
|
2391
2391
|
};
|
|
2392
2392
|
}, [m]);
|
|
2393
2393
|
const b = C(
|
|
2394
2394
|
(w) => {
|
|
2395
|
-
if (!(!m ||
|
|
2395
|
+
if (!(!m || A.length === 0))
|
|
2396
2396
|
switch (w.key) {
|
|
2397
2397
|
case "ArrowDown":
|
|
2398
|
-
w.preventDefault(), f((
|
|
2398
|
+
w.preventDefault(), f((P) => (P + 1) % A.length);
|
|
2399
2399
|
break;
|
|
2400
2400
|
case "ArrowUp":
|
|
2401
|
-
w.preventDefault(), f((
|
|
2401
|
+
w.preventDefault(), f((P) => (P - 1 + A.length) % A.length);
|
|
2402
2402
|
break;
|
|
2403
2403
|
case "Home":
|
|
2404
2404
|
w.preventDefault(), f(0);
|
|
2405
2405
|
break;
|
|
2406
2406
|
case "End":
|
|
2407
|
-
w.preventDefault(), f(
|
|
2407
|
+
w.preventDefault(), f(A.length - 1);
|
|
2408
2408
|
break;
|
|
2409
2409
|
case "Enter":
|
|
2410
2410
|
case " ":
|
|
2411
|
-
y >= 0 && (w.preventDefault(),
|
|
2411
|
+
y >= 0 && (w.preventDefault(), A[y].onClick(), h(!1), f(-1));
|
|
2412
2412
|
break;
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
|
-
[m, y,
|
|
2415
|
+
[m, y, A]
|
|
2416
2416
|
), _ = C(() => {
|
|
2417
|
-
|
|
2418
|
-
}, [
|
|
2417
|
+
A.length !== 0 && (h((w) => !w), f(-1));
|
|
2418
|
+
}, [A.length]), k = {
|
|
2419
2419
|
sm: "cedros-button-sm",
|
|
2420
2420
|
md: "cedros-button-md",
|
|
2421
2421
|
lg: "cedros-button-lg"
|
|
@@ -2429,13 +2429,13 @@ function xc({
|
|
|
2429
2429
|
"button",
|
|
2430
2430
|
{
|
|
2431
2431
|
type: "button",
|
|
2432
|
-
className: `cedros-button ${E[s]} ${
|
|
2432
|
+
className: `cedros-button ${E[s]} ${k[r]} ${t}`,
|
|
2433
2433
|
disabled: !0,
|
|
2434
2434
|
children: /* @__PURE__ */ e(G, { size: "sm" })
|
|
2435
2435
|
}
|
|
2436
2436
|
);
|
|
2437
2437
|
if (l && c) {
|
|
2438
|
-
const w = c.name || c.email || "User",
|
|
2438
|
+
const w = c.name || c.email || "User", P = ss(c.picture);
|
|
2439
2439
|
return (
|
|
2440
2440
|
// L-08: Added keyboard handler and ref for accessibility
|
|
2441
2441
|
/* @__PURE__ */ i("div", { className: "cedros-user-menu", ref: p, onKeyDown: b, children: [
|
|
@@ -2444,16 +2444,16 @@ function xc({
|
|
|
2444
2444
|
{
|
|
2445
2445
|
ref: v,
|
|
2446
2446
|
type: "button",
|
|
2447
|
-
className: `cedros-button cedros-user-button ${
|
|
2447
|
+
className: `cedros-button cedros-user-button ${k[r]} ${t}`,
|
|
2448
2448
|
"aria-haspopup": "menu",
|
|
2449
2449
|
"aria-expanded": m,
|
|
2450
2450
|
"aria-label": `User menu for ${w}`,
|
|
2451
2451
|
onClick: _,
|
|
2452
2452
|
children: [
|
|
2453
|
-
|
|
2453
|
+
P ? /* @__PURE__ */ e(
|
|
2454
2454
|
"img",
|
|
2455
2455
|
{
|
|
2456
|
-
src:
|
|
2456
|
+
src: P,
|
|
2457
2457
|
alt: w,
|
|
2458
2458
|
className: "cedros-user-avatar",
|
|
2459
2459
|
referrerPolicy: "no-referrer",
|
|
@@ -2465,22 +2465,22 @@ function xc({
|
|
|
2465
2465
|
}
|
|
2466
2466
|
),
|
|
2467
2467
|
m && /* @__PURE__ */ i("div", { className: "cedros-dropdown cedros-dropdown-open", role: "menu", children: [
|
|
2468
|
-
n.map((
|
|
2468
|
+
n.map((x, M) => /* @__PURE__ */ i(
|
|
2469
2469
|
"button",
|
|
2470
2470
|
{
|
|
2471
2471
|
type: "button",
|
|
2472
|
-
className: `cedros-dropdown-item ${y ===
|
|
2472
|
+
className: `cedros-dropdown-item ${y === M ? "cedros-dropdown-item-focused" : ""}`,
|
|
2473
2473
|
role: "menuitem",
|
|
2474
|
-
tabIndex: y ===
|
|
2474
|
+
tabIndex: y === M ? 0 : -1,
|
|
2475
2475
|
onClick: () => {
|
|
2476
|
-
|
|
2476
|
+
x.onClick(), h(!1);
|
|
2477
2477
|
},
|
|
2478
2478
|
children: [
|
|
2479
|
-
|
|
2480
|
-
|
|
2479
|
+
x.icon && /* @__PURE__ */ e("span", { className: "cedros-dropdown-icon", children: x.icon }),
|
|
2480
|
+
x.label
|
|
2481
2481
|
]
|
|
2482
2482
|
},
|
|
2483
|
-
|
|
2483
|
+
M
|
|
2484
2484
|
)),
|
|
2485
2485
|
n.length > 0 && !o && /* @__PURE__ */ e("div", { className: "cedros-dropdown-divider", role: "separator" }),
|
|
2486
2486
|
!o && /* @__PURE__ */ e(
|
|
@@ -2504,7 +2504,7 @@ function xc({
|
|
|
2504
2504
|
"button",
|
|
2505
2505
|
{
|
|
2506
2506
|
type: "button",
|
|
2507
|
-
className: `cedros-button ${E[s]} ${
|
|
2507
|
+
className: `cedros-button ${E[s]} ${k[r]} ${t}`,
|
|
2508
2508
|
onClick: u,
|
|
2509
2509
|
children: a || "Sign in"
|
|
2510
2510
|
}
|
|
@@ -2556,8 +2556,8 @@ function Fr() {
|
|
|
2556
2556
|
try {
|
|
2557
2557
|
await l.post("/reset-password", { token: f, newPassword: p }), n(!0);
|
|
2558
2558
|
} catch (v) {
|
|
2559
|
-
const
|
|
2560
|
-
throw c(
|
|
2559
|
+
const A = B(v, "Failed to reset password");
|
|
2560
|
+
throw c(A), A;
|
|
2561
2561
|
} finally {
|
|
2562
2562
|
r(!1);
|
|
2563
2563
|
}
|
|
@@ -3107,16 +3107,16 @@ const ze = ["login", "register"];
|
|
|
3107
3107
|
function as({ onSuccess: t, className: s = "", defaultTab: r = "login" }) {
|
|
3108
3108
|
const { config: a } = ae(), [n, o] = N(r), [c, l] = N("form"), [d, u] = N(() => bs()), [g] = N(() => Br());
|
|
3109
3109
|
U(() => {
|
|
3110
|
-
const
|
|
3111
|
-
return
|
|
3112
|
-
window.removeEventListener("load",
|
|
3110
|
+
const k = () => u(bs());
|
|
3111
|
+
return k(), window.addEventListener("load", k), window.addEventListener("focus", k), () => {
|
|
3112
|
+
window.removeEventListener("load", k), window.removeEventListener("focus", k);
|
|
3113
3113
|
};
|
|
3114
3114
|
}, []);
|
|
3115
3115
|
const m = a.forms?.forgotPassword?.mode ?? "reset", h = C(
|
|
3116
|
-
(
|
|
3116
|
+
(k) => {
|
|
3117
3117
|
const E = ze.indexOf(n);
|
|
3118
3118
|
let w = E;
|
|
3119
|
-
switch (
|
|
3119
|
+
switch (k.key) {
|
|
3120
3120
|
case "ArrowLeft":
|
|
3121
3121
|
case "ArrowUp":
|
|
3122
3122
|
w = E === 0 ? ze.length - 1 : E - 1;
|
|
@@ -3134,9 +3134,9 @@ function as({ onSuccess: t, className: s = "", defaultTab: r = "login" }) {
|
|
|
3134
3134
|
default:
|
|
3135
3135
|
return;
|
|
3136
3136
|
}
|
|
3137
|
-
|
|
3138
|
-
const
|
|
3139
|
-
o(
|
|
3137
|
+
k.preventDefault();
|
|
3138
|
+
const P = ze[w];
|
|
3139
|
+
o(P), document.getElementById(`cedros-tab-${P}`)?.focus();
|
|
3140
3140
|
},
|
|
3141
3141
|
[n]
|
|
3142
3142
|
), y = a.features ?? {
|
|
@@ -3145,13 +3145,13 @@ function as({ onSuccess: t, className: s = "", defaultTab: r = "login" }) {
|
|
|
3145
3145
|
apple: !0,
|
|
3146
3146
|
solana: !0,
|
|
3147
3147
|
webauthn: !0
|
|
3148
|
-
}, f = y.email !== !1, p = y.google !== !1 && a.googleClientId, v = y.apple !== !1 && a.appleClientId && g,
|
|
3148
|
+
}, f = y.email !== !1, p = y.google !== !1 && a.googleClientId, v = y.apple !== !1 && a.appleClientId && g, A = y.solana !== !1 && d, b = y.webauthn !== !1, _ = f && (p || v || A || b);
|
|
3149
3149
|
return c === "forgotPassword" ? /* @__PURE__ */ e("div", { className: `cedros-login-form ${s}`, children: /* @__PURE__ */ e(ra, { onCancel: () => l("form") }) }) : /* @__PURE__ */ i("div", { className: `cedros-login-form ${s}`, children: [
|
|
3150
|
-
(b || p || v ||
|
|
3150
|
+
(b || p || v || A) && /* @__PURE__ */ i("div", { className: "cedros-social-buttons", children: [
|
|
3151
3151
|
b && /* @__PURE__ */ e(ha, { onSuccess: t }),
|
|
3152
3152
|
p && /* @__PURE__ */ e(Mn, { onSuccess: t }),
|
|
3153
3153
|
v && /* @__PURE__ */ e(oa, { onSuccess: t }),
|
|
3154
|
-
|
|
3154
|
+
A && /* @__PURE__ */ e(Dn, { onSuccess: t })
|
|
3155
3155
|
] }),
|
|
3156
3156
|
_ && /* @__PURE__ */ e("div", { className: "cedros-divider", children: /* @__PURE__ */ e("span", { children: "Or continue with" }) }),
|
|
3157
3157
|
f && /* @__PURE__ */ i(K, { children: [
|
|
@@ -3351,7 +3351,7 @@ function Dc({
|
|
|
3351
3351
|
onLoginClick: r,
|
|
3352
3352
|
className: a = ""
|
|
3353
3353
|
}) {
|
|
3354
|
-
const [n, o] = N(""), [c, l] = N(""), [d, u] = N(null), { resetPassword: g, isLoading: m, isSuccess: h, error: y, clearError: f } = Fr(), p = n === c, v = d?.isValid && p && n.length > 0,
|
|
3354
|
+
const [n, o] = N(""), [c, l] = N(""), [d, u] = N(null), { resetPassword: g, isLoading: m, isSuccess: h, error: y, clearError: f } = Fr(), p = n === c, v = d?.isValid && p && n.length > 0, A = async (b) => {
|
|
3355
3355
|
if (b.preventDefault(), !!v)
|
|
3356
3356
|
try {
|
|
3357
3357
|
await g(t, n), s?.();
|
|
@@ -3394,7 +3394,7 @@ function Dc({
|
|
|
3394
3394
|
children: "Go to login"
|
|
3395
3395
|
}
|
|
3396
3396
|
)
|
|
3397
|
-
] }) : /* @__PURE__ */ i("form", { className: `cedros-reset-password-form ${a}`, onSubmit:
|
|
3397
|
+
] }) : /* @__PURE__ */ i("form", { className: `cedros-reset-password-form ${a}`, onSubmit: A, children: [
|
|
3398
3398
|
/* @__PURE__ */ i("div", { className: "cedros-form-header", children: [
|
|
3399
3399
|
/* @__PURE__ */ e("h3", { className: "cedros-form-title", children: "Reset your password" }),
|
|
3400
3400
|
/* @__PURE__ */ e("p", { className: "cedros-form-subtitle", children: "Enter your new password below." })
|
|
@@ -3851,9 +3851,9 @@ function Na({
|
|
|
3851
3851
|
return;
|
|
3852
3852
|
}
|
|
3853
3853
|
if (v.key === "Tab" && g.current) {
|
|
3854
|
-
const
|
|
3854
|
+
const A = g.current.querySelectorAll(
|
|
3855
3855
|
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
3856
|
-
), b =
|
|
3856
|
+
), b = A[0], _ = A[A.length - 1];
|
|
3857
3857
|
v.shiftKey ? document.activeElement === b && (v.preventDefault(), _?.focus()) : document.activeElement === _ && (v.preventDefault(), b?.focus());
|
|
3858
3858
|
}
|
|
3859
3859
|
};
|
|
@@ -3928,17 +3928,17 @@ function Sa({
|
|
|
3928
3928
|
u === p ? h(m === "asc" ? "desc" : "asc") : (g(p), h("asc"));
|
|
3929
3929
|
}, f = O(() => {
|
|
3930
3930
|
const p = { owner: 0, admin: 1, member: 2 };
|
|
3931
|
-
return [...t].sort((v,
|
|
3931
|
+
return [...t].sort((v, A) => {
|
|
3932
3932
|
let b, _;
|
|
3933
3933
|
switch (u) {
|
|
3934
3934
|
case "name":
|
|
3935
|
-
b = (v.user.name || v.user.email || "").toLowerCase(), _ = (
|
|
3935
|
+
b = (v.user.name || v.user.email || "").toLowerCase(), _ = (A.user.name || A.user.email || "").toLowerCase();
|
|
3936
3936
|
break;
|
|
3937
3937
|
case "role":
|
|
3938
|
-
b = p[v.role] ?? 99, _ = p[
|
|
3938
|
+
b = p[v.role] ?? 99, _ = p[A.role] ?? 99;
|
|
3939
3939
|
break;
|
|
3940
3940
|
case "joinedAt":
|
|
3941
|
-
b = new Date(v.joinedAt).getTime(), _ = new Date(
|
|
3941
|
+
b = new Date(v.joinedAt).getTime(), _ = new Date(A.joinedAt).getTime();
|
|
3942
3942
|
break;
|
|
3943
3943
|
default:
|
|
3944
3944
|
return 0;
|
|
@@ -4111,8 +4111,8 @@ function La({
|
|
|
4111
4111
|
p.current = !1, f.current !== null && (window.clearTimeout(f.current), f.current = null);
|
|
4112
4112
|
}), []);
|
|
4113
4113
|
const v = C(
|
|
4114
|
-
async (
|
|
4115
|
-
|
|
4114
|
+
async (A) => {
|
|
4115
|
+
A.preventDefault(), m(null), y(!1);
|
|
4116
4116
|
const b = c.trim();
|
|
4117
4117
|
if (!b) {
|
|
4118
4118
|
m("Email is required");
|
|
@@ -4147,7 +4147,7 @@ function La({
|
|
|
4147
4147
|
type: "email",
|
|
4148
4148
|
className: "cedros-form-input",
|
|
4149
4149
|
value: c,
|
|
4150
|
-
onChange: (
|
|
4150
|
+
onChange: (A) => l(A.target.value),
|
|
4151
4151
|
placeholder: "colleague@example.com",
|
|
4152
4152
|
disabled: s,
|
|
4153
4153
|
autoComplete: "email"
|
|
@@ -4162,9 +4162,9 @@ function La({
|
|
|
4162
4162
|
id: "invite-role",
|
|
4163
4163
|
className: "cedros-form-select",
|
|
4164
4164
|
value: d,
|
|
4165
|
-
onChange: (
|
|
4165
|
+
onChange: (A) => u(A.target.value),
|
|
4166
4166
|
disabled: s,
|
|
4167
|
-
children: a.map((
|
|
4167
|
+
children: a.map((A) => /* @__PURE__ */ e("option", { value: A, children: A.charAt(0).toUpperCase() + A.slice(1) }, A))
|
|
4168
4168
|
}
|
|
4169
4169
|
)
|
|
4170
4170
|
] }),
|
|
@@ -4566,11 +4566,11 @@ function Wa({
|
|
|
4566
4566
|
className: n = ""
|
|
4567
4567
|
}) {
|
|
4568
4568
|
const [o, c] = N(Array(fe).fill("")), [l, d] = N(null), [u, g] = N([]), [m, h] = N(null), y = Ar(), f = z(null), p = C(
|
|
4569
|
-
(w,
|
|
4570
|
-
const
|
|
4571
|
-
if (
|
|
4572
|
-
const
|
|
4573
|
-
g(
|
|
4569
|
+
(w, P) => {
|
|
4570
|
+
const x = [...o];
|
|
4571
|
+
if (x[w] = P.toLowerCase().trim(), c(x), P.length > 0) {
|
|
4572
|
+
const M = ea(P, 5);
|
|
4573
|
+
g(M);
|
|
4574
4574
|
} else
|
|
4575
4575
|
g([]);
|
|
4576
4576
|
h(null);
|
|
@@ -4578,10 +4578,10 @@ function Wa({
|
|
|
4578
4578
|
[o]
|
|
4579
4579
|
), v = C((w) => {
|
|
4580
4580
|
d(w), g([]);
|
|
4581
|
-
}, []),
|
|
4581
|
+
}, []), A = C(
|
|
4582
4582
|
(w) => {
|
|
4583
|
-
const
|
|
4584
|
-
|
|
4583
|
+
const P = o[w];
|
|
4584
|
+
P && !et(P) && h(`Word ${w + 1} is not in the wordlist`), f.current !== null && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
|
|
4585
4585
|
l === w && g([]);
|
|
4586
4586
|
}, 200);
|
|
4587
4587
|
},
|
|
@@ -4593,25 +4593,25 @@ function Wa({
|
|
|
4593
4593
|
const b = C(
|
|
4594
4594
|
(w) => {
|
|
4595
4595
|
if (l !== null) {
|
|
4596
|
-
const
|
|
4597
|
-
|
|
4596
|
+
const P = [...o];
|
|
4597
|
+
P[l] = w, c(P), g([]), document.querySelector(
|
|
4598
4598
|
`[data-word-index="${l + 1}"]`
|
|
4599
4599
|
)?.focus();
|
|
4600
4600
|
}
|
|
4601
4601
|
},
|
|
4602
4602
|
[l, o]
|
|
4603
4603
|
), _ = C((w) => {
|
|
4604
|
-
const
|
|
4605
|
-
|
|
4606
|
-
}, []),
|
|
4604
|
+
const P = w.clipboardData.getData("text"), x = sa(P);
|
|
4605
|
+
x.length === fe && (w.preventDefault(), c(x), h(null));
|
|
4606
|
+
}, []), k = C(
|
|
4607
4607
|
(w) => {
|
|
4608
|
-
if (w.preventDefault(), o.filter((
|
|
4608
|
+
if (w.preventDefault(), o.filter((M) => !M).length > 0) {
|
|
4609
4609
|
h(`Please enter all ${fe} words`);
|
|
4610
4610
|
return;
|
|
4611
4611
|
}
|
|
4612
|
-
const
|
|
4613
|
-
if (
|
|
4614
|
-
h(`Invalid words: ${
|
|
4612
|
+
const x = o.map((M, D) => ({ word: M, index: D + 1 })).filter(({ word: M }) => !et(M));
|
|
4613
|
+
if (x.length > 0) {
|
|
4614
|
+
h(`Invalid words: ${x.map((M) => `#${M.index}`).join(", ")}`);
|
|
4615
4615
|
return;
|
|
4616
4616
|
}
|
|
4617
4617
|
if (!Ur(o)) {
|
|
@@ -4626,36 +4626,36 @@ function Wa({
|
|
|
4626
4626
|
"form",
|
|
4627
4627
|
{
|
|
4628
4628
|
className: `cedros-recovery-phrase-input ${n}`,
|
|
4629
|
-
onSubmit:
|
|
4629
|
+
onSubmit: k,
|
|
4630
4630
|
onPaste: _,
|
|
4631
4631
|
children: [
|
|
4632
4632
|
/* @__PURE__ */ i("div", { className: "cedros-recovery-input-header", children: [
|
|
4633
4633
|
/* @__PURE__ */ e("h3", { className: "cedros-recovery-input-title", children: "Enter Recovery Phrase" }),
|
|
4634
4634
|
/* @__PURE__ */ e("p", { className: "cedros-recovery-input-description", children: "Enter your 12-word recovery phrase. You can paste the entire phrase at once." })
|
|
4635
4635
|
] }),
|
|
4636
|
-
/* @__PURE__ */ e("div", { className: "cedros-word-inputs", children: Array.from({ length: fe }, (w,
|
|
4636
|
+
/* @__PURE__ */ e("div", { className: "cedros-word-inputs", children: Array.from({ length: fe }, (w, P) => /* @__PURE__ */ i("div", { className: "cedros-word-input-wrapper", children: [
|
|
4637
4637
|
/* @__PURE__ */ i("label", { className: "cedros-word-label", children: [
|
|
4638
|
-
|
|
4638
|
+
P + 1,
|
|
4639
4639
|
"."
|
|
4640
4640
|
] }),
|
|
4641
4641
|
/* @__PURE__ */ e(
|
|
4642
4642
|
"input",
|
|
4643
4643
|
{
|
|
4644
4644
|
type: "text",
|
|
4645
|
-
className: `cedros-word-input ${o[
|
|
4646
|
-
value: o[
|
|
4647
|
-
onChange: (
|
|
4648
|
-
onFocus: () => v(
|
|
4649
|
-
onBlur: () =>
|
|
4650
|
-
"data-word-index":
|
|
4645
|
+
className: `cedros-word-input ${o[P] && !et(o[P]) ? "cedros-word-invalid" : o[P] && et(o[P]) ? "cedros-word-valid" : ""}`,
|
|
4646
|
+
value: o[P],
|
|
4647
|
+
onChange: (x) => p(P, x.target.value),
|
|
4648
|
+
onFocus: () => v(P),
|
|
4649
|
+
onBlur: () => A(P),
|
|
4650
|
+
"data-word-index": P,
|
|
4651
4651
|
autoComplete: "off",
|
|
4652
4652
|
autoCapitalize: "none",
|
|
4653
4653
|
spellCheck: !1,
|
|
4654
4654
|
disabled: r,
|
|
4655
|
-
"aria-label": `Word ${
|
|
4655
|
+
"aria-label": `Word ${P + 1}`
|
|
4656
4656
|
}
|
|
4657
4657
|
)
|
|
4658
|
-
] },
|
|
4658
|
+
] }, P)) }),
|
|
4659
4659
|
l !== null && u.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-suggestions", role: "listbox", id: `${y}-suggestions`, children: u.map((w) => /* @__PURE__ */ e(
|
|
4660
4660
|
"button",
|
|
4661
4661
|
{
|
|
@@ -4833,37 +4833,37 @@ function Ha() {
|
|
|
4833
4833
|
d();
|
|
4834
4834
|
}, [d]);
|
|
4835
4835
|
const u = C(
|
|
4836
|
-
async (f, p, v,
|
|
4836
|
+
async (f, p, v, A) => {
|
|
4837
4837
|
n({ step: "generating_seed" });
|
|
4838
4838
|
const b = kn();
|
|
4839
4839
|
l.current.push(b), n({ step: "splitting_shares" });
|
|
4840
|
-
const { shareA: _, shareB:
|
|
4841
|
-
l.current.push(_,
|
|
4842
|
-
const w = await fr(_, gr(p)),
|
|
4840
|
+
const { shareA: _, shareB: k, shareC: E } = Cr(b);
|
|
4841
|
+
l.current.push(_, k, E), n({ step: "encrypting_shares" });
|
|
4842
|
+
const w = await fr(_, gr(p)), P = Er(b), x = Tr(P);
|
|
4843
4843
|
n({ step: "uploading" });
|
|
4844
|
-
const
|
|
4845
|
-
solanaPubkey:
|
|
4844
|
+
const M = {
|
|
4845
|
+
solanaPubkey: x,
|
|
4846
4846
|
shareAAuthMethod: f,
|
|
4847
4847
|
shareACiphertext: w.ciphertext,
|
|
4848
4848
|
shareANonce: w.nonce,
|
|
4849
4849
|
// Share B is now plaintext (SSS math protects it)
|
|
4850
|
-
shareB: ke(
|
|
4850
|
+
shareB: ke(k)
|
|
4851
4851
|
};
|
|
4852
4852
|
if (f === "password") {
|
|
4853
4853
|
if (!v) throw new Error("KDF salt required for password method");
|
|
4854
|
-
|
|
4854
|
+
M.shareAKdfSalt = ke(v), M.shareAKdfParams = it;
|
|
4855
4855
|
}
|
|
4856
|
-
if (f === "passkey" &&
|
|
4856
|
+
if (f === "passkey" && A && (M.prfSalt = A), await s(M), r === "none")
|
|
4857
4857
|
d(), n({
|
|
4858
4858
|
step: "complete",
|
|
4859
|
-
solanaPubkey:
|
|
4859
|
+
solanaPubkey: x
|
|
4860
4860
|
});
|
|
4861
4861
|
else {
|
|
4862
|
-
const
|
|
4862
|
+
const D = r === "full_seed" ? Xn(b) : Yn(ot(E));
|
|
4863
4863
|
n({
|
|
4864
4864
|
step: "showing_recovery",
|
|
4865
|
-
recoveryPhrase:
|
|
4866
|
-
solanaPubkey:
|
|
4865
|
+
recoveryPhrase: D,
|
|
4866
|
+
solanaPubkey: x
|
|
4867
4867
|
});
|
|
4868
4868
|
}
|
|
4869
4869
|
},
|
|
@@ -4899,10 +4899,10 @@ function Ha() {
|
|
|
4899
4899
|
n({ step: "registering_passkey" });
|
|
4900
4900
|
let v;
|
|
4901
4901
|
try {
|
|
4902
|
-
const b = new TextEncoder().encode(t.id), _ = t.name ?? t.email ?? "User",
|
|
4902
|
+
const b = new TextEncoder().encode(t.id), _ = t.name ?? t.email ?? "User", k = t.email ?? t.id;
|
|
4903
4903
|
v = (await Nn(
|
|
4904
4904
|
b,
|
|
4905
|
-
|
|
4905
|
+
k,
|
|
4906
4906
|
_,
|
|
4907
4907
|
f
|
|
4908
4908
|
)).prfOutput;
|
|
@@ -4912,8 +4912,8 @@ function Ha() {
|
|
|
4912
4912
|
v = (await es(p)).prfOutput;
|
|
4913
4913
|
}
|
|
4914
4914
|
l.current.push(v);
|
|
4915
|
-
const
|
|
4916
|
-
l.current.push(
|
|
4915
|
+
const A = await wr(v, f);
|
|
4916
|
+
l.current.push(A), await u("passkey", A, void 0, p);
|
|
4917
4917
|
} catch (f) {
|
|
4918
4918
|
n({
|
|
4919
4919
|
step: "error",
|
|
@@ -4953,13 +4953,13 @@ function Qa({
|
|
|
4953
4953
|
confirmRecoveryPhrase: d,
|
|
4954
4954
|
cancel: u,
|
|
4955
4955
|
isEnrolling: g
|
|
4956
|
-
} = Ha(), m = () => a || "password", [h, y] = N(m), [f, p] = N(""), [v,
|
|
4956
|
+
} = Ha(), m = () => a || "password", [h, y] = N(m), [f, p] = N(""), [v, A] = N(""), [b, _] = N(null);
|
|
4957
4957
|
U(() => {
|
|
4958
4958
|
y(m());
|
|
4959
4959
|
}, [n?.id, a]);
|
|
4960
|
-
const
|
|
4961
|
-
async (
|
|
4962
|
-
if (
|
|
4960
|
+
const k = C(
|
|
4961
|
+
async (x) => {
|
|
4962
|
+
if (x.preventDefault(), f !== v) {
|
|
4963
4963
|
_("Passwords do not match");
|
|
4964
4964
|
return;
|
|
4965
4965
|
}
|
|
@@ -4974,7 +4974,7 @@ function Qa({
|
|
|
4974
4974
|
await l();
|
|
4975
4975
|
}, [l]), w = C(() => {
|
|
4976
4976
|
d(), o.solanaPubkey && t?.(o.solanaPubkey);
|
|
4977
|
-
}, [d, o.solanaPubkey, t]),
|
|
4977
|
+
}, [d, o.solanaPubkey, t]), P = C(() => {
|
|
4978
4978
|
u(), s?.();
|
|
4979
4979
|
}, [u, s]);
|
|
4980
4980
|
return o.step === "generating_seed" || o.step === "splitting_shares" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${r}`, "aria-busy": "true", children: /* @__PURE__ */ i("div", { className: "cedros-enrollment-progress", role: "status", "aria-live": "polite", children: [
|
|
@@ -5080,7 +5080,7 @@ function Qa({
|
|
|
5080
5080
|
{
|
|
5081
5081
|
type: "button",
|
|
5082
5082
|
className: "cedros-button cedros-button-secondary",
|
|
5083
|
-
onClick:
|
|
5083
|
+
onClick: P,
|
|
5084
5084
|
children: "Cancel"
|
|
5085
5085
|
}
|
|
5086
5086
|
),
|
|
@@ -5133,13 +5133,13 @@ function Qa({
|
|
|
5133
5133
|
/* @__PURE__ */ e("span", { children: "Passkey" })
|
|
5134
5134
|
] })
|
|
5135
5135
|
] }),
|
|
5136
|
-
h === "password" && /* @__PURE__ */ i("form", { onSubmit:
|
|
5136
|
+
h === "password" && /* @__PURE__ */ i("form", { onSubmit: k, className: "cedros-enrollment-form", children: [
|
|
5137
5137
|
/* @__PURE__ */ e(
|
|
5138
5138
|
Ne,
|
|
5139
5139
|
{
|
|
5140
5140
|
label: "Password",
|
|
5141
5141
|
value: f,
|
|
5142
|
-
onChange: (
|
|
5142
|
+
onChange: (x) => p(x.target.value),
|
|
5143
5143
|
showStrengthMeter: !0,
|
|
5144
5144
|
disabled: g,
|
|
5145
5145
|
required: !0,
|
|
@@ -5152,7 +5152,7 @@ function Qa({
|
|
|
5152
5152
|
{
|
|
5153
5153
|
label: "Confirm Password",
|
|
5154
5154
|
value: v,
|
|
5155
|
-
onChange: (
|
|
5155
|
+
onChange: (x) => A(x.target.value),
|
|
5156
5156
|
error: b ?? void 0,
|
|
5157
5157
|
disabled: g,
|
|
5158
5158
|
required: !0,
|
|
@@ -5167,7 +5167,7 @@ function Qa({
|
|
|
5167
5167
|
{
|
|
5168
5168
|
type: "button",
|
|
5169
5169
|
className: "cedros-button cedros-button-secondary",
|
|
5170
|
-
onClick:
|
|
5170
|
+
onClick: P,
|
|
5171
5171
|
disabled: g,
|
|
5172
5172
|
children: "Cancel"
|
|
5173
5173
|
}
|
|
@@ -5221,7 +5221,7 @@ function Qa({
|
|
|
5221
5221
|
{
|
|
5222
5222
|
type: "button",
|
|
5223
5223
|
className: "cedros-button cedros-button-secondary",
|
|
5224
|
-
onClick:
|
|
5224
|
+
onClick: P,
|
|
5225
5225
|
disabled: g,
|
|
5226
5226
|
children: "Cancel"
|
|
5227
5227
|
}
|
|
@@ -5428,21 +5428,21 @@ function eo({
|
|
|
5428
5428
|
className: n = ""
|
|
5429
5429
|
}) {
|
|
5430
5430
|
ae();
|
|
5431
|
-
const { unlock: o, getMaterial: c, isLoading: l } = Qe(), { getPasskeyCredential: d, isAuthenticating: u } = Ga(), [g, m] = N("idle"), [h, y] = N(a ?? null), [f, p] = N(""), [v,
|
|
5431
|
+
const { unlock: o, getMaterial: c, isLoading: l } = Qe(), { getPasskeyCredential: d, isAuthenticating: u } = Ga(), [g, m] = N("idle"), [h, y] = N(a ?? null), [f, p] = N(""), [v, A] = N(null);
|
|
5432
5432
|
U(() => {
|
|
5433
5433
|
a !== void 0 && y(a);
|
|
5434
5434
|
}, [a]);
|
|
5435
|
-
const b = h === "password", _ = h === "passkey",
|
|
5436
|
-
if (m("credential"),
|
|
5435
|
+
const b = h === "password", _ = h === "passkey", k = C(async () => {
|
|
5436
|
+
if (m("credential"), A(null), !h)
|
|
5437
5437
|
try {
|
|
5438
|
-
const
|
|
5439
|
-
|
|
5440
|
-
} catch (
|
|
5441
|
-
|
|
5438
|
+
const L = await c();
|
|
5439
|
+
L ? y(L.shareAAuthMethod) : (A("No wallet enrolled"), m("error"));
|
|
5440
|
+
} catch (L) {
|
|
5441
|
+
A(L instanceof Error ? L.message : "Failed to get wallet info"), m("error");
|
|
5442
5442
|
}
|
|
5443
5443
|
}, [h, c]), E = C(
|
|
5444
|
-
async (
|
|
5445
|
-
|
|
5444
|
+
async (L) => {
|
|
5445
|
+
L.preventDefault(), A(null), m("unlocking");
|
|
5446
5446
|
try {
|
|
5447
5447
|
let S;
|
|
5448
5448
|
if (b)
|
|
@@ -5451,27 +5451,27 @@ function eo({
|
|
|
5451
5451
|
throw new Error("Invalid auth method");
|
|
5452
5452
|
await o(S), m("unlocked"), t?.();
|
|
5453
5453
|
} catch (S) {
|
|
5454
|
-
|
|
5454
|
+
A(S instanceof Error ? S.message : "Failed to unlock wallet"), m("error");
|
|
5455
5455
|
}
|
|
5456
5456
|
},
|
|
5457
5457
|
[b, f, o, t]
|
|
5458
5458
|
), w = C(async () => {
|
|
5459
|
-
|
|
5459
|
+
A(null), m("unlocking");
|
|
5460
5460
|
try {
|
|
5461
|
-
const
|
|
5462
|
-
if (!
|
|
5461
|
+
const L = await d();
|
|
5462
|
+
if (!L) {
|
|
5463
5463
|
m("credential");
|
|
5464
5464
|
return;
|
|
5465
5465
|
}
|
|
5466
|
-
await o(
|
|
5467
|
-
} catch (
|
|
5468
|
-
|
|
5466
|
+
await o(L), m("unlocked"), t?.();
|
|
5467
|
+
} catch (L) {
|
|
5468
|
+
A(L instanceof Error ? L.message : "Failed to unlock wallet"), m("error");
|
|
5469
5469
|
}
|
|
5470
|
-
}, [d, o, t]),
|
|
5471
|
-
p(""), m("idle"),
|
|
5472
|
-
}, [s]),
|
|
5473
|
-
p(""), m("credential"),
|
|
5474
|
-
}, []),
|
|
5470
|
+
}, [d, o, t]), P = C(() => {
|
|
5471
|
+
p(""), m("idle"), A(null), s?.();
|
|
5472
|
+
}, [s]), x = C(() => {
|
|
5473
|
+
p(""), m("credential"), A(null);
|
|
5474
|
+
}, []), M = l || u, D = () => {
|
|
5475
5475
|
switch (g) {
|
|
5476
5476
|
case "idle":
|
|
5477
5477
|
return /* @__PURE__ */ i("div", { className: "cedros-wallet-unlock-idle", children: [
|
|
@@ -5483,7 +5483,7 @@ function eo({
|
|
|
5483
5483
|
{
|
|
5484
5484
|
type: "button",
|
|
5485
5485
|
className: "cedros-button cedros-button-primary",
|
|
5486
|
-
onClick:
|
|
5486
|
+
onClick: k,
|
|
5487
5487
|
children: "Unlock Wallet"
|
|
5488
5488
|
}
|
|
5489
5489
|
)
|
|
@@ -5497,8 +5497,8 @@ function eo({
|
|
|
5497
5497
|
{
|
|
5498
5498
|
label: "Password",
|
|
5499
5499
|
value: f,
|
|
5500
|
-
onChange: (
|
|
5501
|
-
disabled:
|
|
5500
|
+
onChange: (L) => p(L.target.value),
|
|
5501
|
+
disabled: M,
|
|
5502
5502
|
autoComplete: "current-password",
|
|
5503
5503
|
error: v ?? void 0
|
|
5504
5504
|
}
|
|
@@ -5509,8 +5509,8 @@ function eo({
|
|
|
5509
5509
|
{
|
|
5510
5510
|
type: "submit",
|
|
5511
5511
|
className: "cedros-button cedros-button-primary",
|
|
5512
|
-
disabled:
|
|
5513
|
-
children:
|
|
5512
|
+
disabled: M || f.length === 0,
|
|
5513
|
+
children: M ? "Unlocking..." : "Unlock"
|
|
5514
5514
|
}
|
|
5515
5515
|
),
|
|
5516
5516
|
r && /* @__PURE__ */ e(
|
|
@@ -5518,8 +5518,8 @@ function eo({
|
|
|
5518
5518
|
{
|
|
5519
5519
|
type: "button",
|
|
5520
5520
|
className: "cedros-button cedros-button-secondary",
|
|
5521
|
-
onClick:
|
|
5522
|
-
disabled:
|
|
5521
|
+
onClick: P,
|
|
5522
|
+
disabled: M,
|
|
5523
5523
|
children: "Cancel"
|
|
5524
5524
|
}
|
|
5525
5525
|
)
|
|
@@ -5531,11 +5531,11 @@ function eo({
|
|
|
5531
5531
|
Ya,
|
|
5532
5532
|
{
|
|
5533
5533
|
mode: "authenticate",
|
|
5534
|
-
isLoading:
|
|
5534
|
+
isLoading: M,
|
|
5535
5535
|
error: v ?? void 0,
|
|
5536
5536
|
onPrompt: w,
|
|
5537
5537
|
onRetry: w,
|
|
5538
|
-
onCancel: r ?
|
|
5538
|
+
onCancel: r ? P : void 0
|
|
5539
5539
|
}
|
|
5540
5540
|
)
|
|
5541
5541
|
] }) : /* @__PURE__ */ i("div", { className: "cedros-wallet-unlock-loading", children: [
|
|
@@ -5565,7 +5565,7 @@ function eo({
|
|
|
5565
5565
|
{
|
|
5566
5566
|
type: "button",
|
|
5567
5567
|
className: "cedros-button cedros-button-primary",
|
|
5568
|
-
onClick:
|
|
5568
|
+
onClick: x,
|
|
5569
5569
|
children: "Try Again"
|
|
5570
5570
|
}
|
|
5571
5571
|
),
|
|
@@ -5574,7 +5574,7 @@ function eo({
|
|
|
5574
5574
|
{
|
|
5575
5575
|
type: "button",
|
|
5576
5576
|
className: "cedros-button cedros-button-secondary",
|
|
5577
|
-
onClick:
|
|
5577
|
+
onClick: P,
|
|
5578
5578
|
children: "Cancel"
|
|
5579
5579
|
}
|
|
5580
5580
|
)
|
|
@@ -5582,7 +5582,7 @@ function eo({
|
|
|
5582
5582
|
] });
|
|
5583
5583
|
}
|
|
5584
5584
|
};
|
|
5585
|
-
return /* @__PURE__ */ e("div", { className: `cedros-wallet-unlock ${n}`, children:
|
|
5585
|
+
return /* @__PURE__ */ e("div", { className: `cedros-wallet-unlock ${n}`, children: D() });
|
|
5586
5586
|
}
|
|
5587
5587
|
function to() {
|
|
5588
5588
|
return /* @__PURE__ */ i("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", "aria-hidden": "true", children: [
|
|
@@ -5668,32 +5668,32 @@ function no() {
|
|
|
5668
5668
|
throw new Error("Invalid recovery phrase. Please check your words.");
|
|
5669
5669
|
let f;
|
|
5670
5670
|
if (r === "share_c_only") {
|
|
5671
|
-
const
|
|
5672
|
-
l.current.push(
|
|
5673
|
-
const
|
|
5674
|
-
l.current.push(
|
|
5671
|
+
const x = Jn(m);
|
|
5672
|
+
l.current.push(x);
|
|
5673
|
+
const M = ke(x), D = await s({ shareC: M }), L = vr(D.shareB);
|
|
5674
|
+
l.current.push(L), f = Un(ot(L), ot(x)), l.current.push(f);
|
|
5675
5675
|
} else
|
|
5676
5676
|
f = Zn(m), l.current.push(f);
|
|
5677
|
-
const p = Er(f), v = Tr(p), { shareA:
|
|
5678
|
-
l.current.push(
|
|
5679
|
-
let _,
|
|
5677
|
+
const p = Er(f), v = Tr(p), { shareA: A, shareB: b } = Cr(f);
|
|
5678
|
+
l.current.push(A, b), n({ step: "encrypting" });
|
|
5679
|
+
let _, k, E;
|
|
5680
5680
|
if (h === "passkey") {
|
|
5681
|
-
const
|
|
5682
|
-
E = ke(
|
|
5683
|
-
const
|
|
5684
|
-
l.current.push(
|
|
5681
|
+
const x = br();
|
|
5682
|
+
E = ke(x);
|
|
5683
|
+
const M = await es(E);
|
|
5684
|
+
l.current.push(M.prfOutput), _ = await wr(M.prfOutput, x), l.current.push(_);
|
|
5685
5685
|
} else
|
|
5686
|
-
|
|
5687
|
-
const w = await fr(
|
|
5686
|
+
k = yr(), _ = await Pr(y, k, it), l.current.push(_);
|
|
5687
|
+
const w = await fr(A, gr(_));
|
|
5688
5688
|
n({ step: "uploading" });
|
|
5689
|
-
const
|
|
5689
|
+
const P = {
|
|
5690
5690
|
solanaPubkey: v,
|
|
5691
5691
|
shareAAuthMethod: h,
|
|
5692
5692
|
shareACiphertext: w.ciphertext,
|
|
5693
5693
|
shareANonce: w.nonce,
|
|
5694
5694
|
shareB: ke(b)
|
|
5695
5695
|
};
|
|
5696
|
-
h === "password" && (
|
|
5696
|
+
h === "password" && (P.shareAKdfSalt = ke(k), P.shareAKdfParams = it), h === "passkey" && (P.prfSalt = E), await t(P), d(), n({ step: "complete" });
|
|
5697
5697
|
} catch (f) {
|
|
5698
5698
|
d(), n({
|
|
5699
5699
|
step: "error",
|
|
@@ -5720,11 +5720,11 @@ function ao({
|
|
|
5720
5720
|
className: r = "",
|
|
5721
5721
|
defaultAuthMethod: a = "password"
|
|
5722
5722
|
}) {
|
|
5723
|
-
const { state: n, startRecovery: o, cancel: c, isRecovering: l } = no(), [d, u] = N([]), [g, m] = N(!1), [h, y] = N(a), [f, p] = N(""), [v,
|
|
5724
|
-
u(
|
|
5723
|
+
const { state: n, startRecovery: o, cancel: c, isRecovering: l } = no(), [d, u] = N([]), [g, m] = N(!1), [h, y] = N(a), [f, p] = N(""), [v, A] = N(""), [b, _] = N(null), k = C((M) => {
|
|
5724
|
+
u(M), m(!0);
|
|
5725
5725
|
}, []), E = C(
|
|
5726
|
-
async (
|
|
5727
|
-
if (
|
|
5726
|
+
async (M) => {
|
|
5727
|
+
if (M.preventDefault(), _(null), h !== "passkey") {
|
|
5728
5728
|
if (f !== v) {
|
|
5729
5729
|
_("Passwords do not match");
|
|
5730
5730
|
return;
|
|
@@ -5738,10 +5738,10 @@ function ao({
|
|
|
5738
5738
|
},
|
|
5739
5739
|
[d, h, f, v, o]
|
|
5740
5740
|
), w = C(() => {
|
|
5741
|
-
c(), u([]), m(!1), p(""),
|
|
5742
|
-
}, [c, s]),
|
|
5743
|
-
m(!1), p(""),
|
|
5744
|
-
}, []),
|
|
5741
|
+
c(), u([]), m(!1), p(""), A(""), s?.();
|
|
5742
|
+
}, [c, s]), P = C(() => {
|
|
5743
|
+
m(!1), p(""), A("");
|
|
5744
|
+
}, []), x = C(() => {
|
|
5745
5745
|
t?.();
|
|
5746
5746
|
}, [t]);
|
|
5747
5747
|
return n.step === "validating" || n.step === "encrypting" || n.step === "uploading" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-recovery ${r}`, children: /* @__PURE__ */ i("div", { className: "cedros-wallet-recovery-progress", children: [
|
|
@@ -5770,7 +5770,7 @@ function ao({
|
|
|
5770
5770
|
{
|
|
5771
5771
|
type: "button",
|
|
5772
5772
|
className: "cedros-button cedros-button-primary",
|
|
5773
|
-
onClick:
|
|
5773
|
+
onClick: x,
|
|
5774
5774
|
children: "Done"
|
|
5775
5775
|
}
|
|
5776
5776
|
) })
|
|
@@ -5832,7 +5832,7 @@ function ao({
|
|
|
5832
5832
|
type: "password",
|
|
5833
5833
|
className: "cedros-input",
|
|
5834
5834
|
value: f,
|
|
5835
|
-
onChange: (
|
|
5835
|
+
onChange: (M) => p(M.target.value),
|
|
5836
5836
|
disabled: l,
|
|
5837
5837
|
minLength: 8,
|
|
5838
5838
|
placeholder: "Enter a strong password"
|
|
@@ -5848,7 +5848,7 @@ function ao({
|
|
|
5848
5848
|
type: "password",
|
|
5849
5849
|
className: "cedros-input",
|
|
5850
5850
|
value: v,
|
|
5851
|
-
onChange: (
|
|
5851
|
+
onChange: (M) => A(M.target.value),
|
|
5852
5852
|
disabled: l,
|
|
5853
5853
|
"aria-invalid": b ? "true" : void 0,
|
|
5854
5854
|
placeholder: "Confirm your password"
|
|
@@ -5867,7 +5867,7 @@ function ao({
|
|
|
5867
5867
|
{
|
|
5868
5868
|
type: "button",
|
|
5869
5869
|
className: "cedros-button cedros-button-secondary",
|
|
5870
|
-
onClick:
|
|
5870
|
+
onClick: P,
|
|
5871
5871
|
disabled: l,
|
|
5872
5872
|
children: "Back"
|
|
5873
5873
|
}
|
|
@@ -5890,7 +5890,7 @@ function ao({
|
|
|
5890
5890
|
/* @__PURE__ */ e(
|
|
5891
5891
|
Wa,
|
|
5892
5892
|
{
|
|
5893
|
-
onSubmit:
|
|
5893
|
+
onSubmit: k,
|
|
5894
5894
|
onCancel: w,
|
|
5895
5895
|
isSubmitting: !1
|
|
5896
5896
|
}
|
|
@@ -6012,7 +6012,7 @@ function uo({
|
|
|
6012
6012
|
const c = Fe(), [l, d] = N(!1), [u, g] = N(null), [m, h] = N(!1), y = z(null), f = c?.config.solana?.network ?? "mainnet-beta", p = O(() => {
|
|
6013
6013
|
const _ = `https://explorer.solana.com/address/${t}`;
|
|
6014
6014
|
return f === "mainnet-beta" ? _ : `${_}?cluster=${encodeURIComponent(f)}`;
|
|
6015
|
-
}, [t, f]), v = n && t.length > 18,
|
|
6015
|
+
}, [t, f]), v = n && t.length > 18, A = O(() => !v || m ? t : `${t.slice(0, 8)}...${t.slice(-8)}`, [t, v, m]), b = C(async () => {
|
|
6016
6016
|
try {
|
|
6017
6017
|
g(null), await navigator.clipboard.writeText(t), d(!0), y.current !== null && window.clearTimeout(y.current), y.current = window.setTimeout(() => {
|
|
6018
6018
|
d(!1), y.current = null;
|
|
@@ -6121,7 +6121,7 @@ function uo({
|
|
|
6121
6121
|
)
|
|
6122
6122
|
] })
|
|
6123
6123
|
] }),
|
|
6124
|
-
/* @__PURE__ */ e("code", { className: "cedros-wallet-status-pubkey-value", title: t, children:
|
|
6124
|
+
/* @__PURE__ */ e("code", { className: "cedros-wallet-status-pubkey-value", title: t, children: A }),
|
|
6125
6125
|
u && /* @__PURE__ */ e("p", { className: "cedros-input-hint", role: "status", children: u })
|
|
6126
6126
|
] });
|
|
6127
6127
|
}
|
|
@@ -6498,24 +6498,24 @@ function gt() {
|
|
|
6498
6498
|
return;
|
|
6499
6499
|
}
|
|
6500
6500
|
c(!0), g(null);
|
|
6501
|
-
const
|
|
6501
|
+
const A = ++m.current;
|
|
6502
6502
|
try {
|
|
6503
6503
|
const b = await y.current.getSettings();
|
|
6504
|
-
if (
|
|
6504
|
+
if (A !== m.current) return;
|
|
6505
6505
|
n(b.settings);
|
|
6506
6506
|
} catch (b) {
|
|
6507
|
-
if (
|
|
6507
|
+
if (A !== m.current) return;
|
|
6508
6508
|
g(b instanceof Error ? b : new Error("Failed to fetch settings"));
|
|
6509
6509
|
} finally {
|
|
6510
|
-
|
|
6510
|
+
A === m.current && c(!1);
|
|
6511
6511
|
}
|
|
6512
6512
|
}, [s]), p = C(
|
|
6513
|
-
async (
|
|
6513
|
+
async (A) => {
|
|
6514
6514
|
if (s !== "authenticated")
|
|
6515
6515
|
throw new Error("Not authenticated");
|
|
6516
6516
|
d(!0), g(null);
|
|
6517
6517
|
try {
|
|
6518
|
-
await y.current.updateSettings(
|
|
6518
|
+
await y.current.updateSettings(A), await f();
|
|
6519
6519
|
} catch (b) {
|
|
6520
6520
|
const _ = b instanceof Error ? b : new Error("Failed to update settings");
|
|
6521
6521
|
throw g(_), _;
|
|
@@ -6525,9 +6525,9 @@ function gt() {
|
|
|
6525
6525
|
},
|
|
6526
6526
|
[s, f]
|
|
6527
6527
|
), v = C(
|
|
6528
|
-
(
|
|
6528
|
+
(A) => {
|
|
6529
6529
|
for (const b of Object.values(a)) {
|
|
6530
|
-
const _ = b.find((
|
|
6530
|
+
const _ = b.find((k) => k.key === A);
|
|
6531
6531
|
if (_) return _.value;
|
|
6532
6532
|
}
|
|
6533
6533
|
},
|
|
@@ -7170,11 +7170,11 @@ function Oc({
|
|
|
7170
7170
|
}
|
|
7171
7171
|
}, [y]);
|
|
7172
7172
|
const p = C((E, w) => {
|
|
7173
|
-
g((
|
|
7173
|
+
g((P) => ({ ...P, [E]: w })), h(null), f(!1);
|
|
7174
7174
|
}, []), v = C(async () => {
|
|
7175
|
-
const E = Object.entries(u).map(([w,
|
|
7175
|
+
const E = Object.entries(u).map(([w, P]) => ({
|
|
7176
7176
|
key: w,
|
|
7177
|
-
value:
|
|
7177
|
+
value: P
|
|
7178
7178
|
}));
|
|
7179
7179
|
if (E.length !== 0)
|
|
7180
7180
|
try {
|
|
@@ -7182,7 +7182,7 @@ function Oc({
|
|
|
7182
7182
|
} catch (w) {
|
|
7183
7183
|
h(w instanceof Error ? w.message : "Failed to save settings");
|
|
7184
7184
|
}
|
|
7185
|
-
}, [u, d, r]),
|
|
7185
|
+
}, [u, d, r]), A = C(() => {
|
|
7186
7186
|
g({}), h(null), f(!1);
|
|
7187
7187
|
}, []), b = Object.keys(u).length > 0, _ = Object.keys(u).length;
|
|
7188
7188
|
if (n && Object.keys(a).length === 0)
|
|
@@ -7192,11 +7192,11 @@ function Oc({
|
|
|
7192
7192
|
] });
|
|
7193
7193
|
if (c)
|
|
7194
7194
|
return /* @__PURE__ */ e("div", { className: `cedros-system-settings ${s}`, children: /* @__PURE__ */ e(re, { error: c.message }) });
|
|
7195
|
-
const
|
|
7196
|
-
return
|
|
7195
|
+
const k = Object.keys(a).sort();
|
|
7196
|
+
return k.length === 0 ? /* @__PURE__ */ e("div", { className: `cedros-system-settings cedros-system-settings-empty ${s}`, children: /* @__PURE__ */ e("p", { children: "No system settings found." }) }) : /* @__PURE__ */ i("div", { className: `cedros-system-settings ${s}`, children: [
|
|
7197
7197
|
m && /* @__PURE__ */ e(re, { error: m }),
|
|
7198
7198
|
y && /* @__PURE__ */ e("div", { className: "cedros-settings-success", children: "Settings saved successfully." }),
|
|
7199
|
-
|
|
7199
|
+
k.map((E) => /* @__PURE__ */ e(
|
|
7200
7200
|
Ao,
|
|
7201
7201
|
{
|
|
7202
7202
|
category: E,
|
|
@@ -7218,7 +7218,7 @@ function Oc({
|
|
|
7218
7218
|
{
|
|
7219
7219
|
type: "button",
|
|
7220
7220
|
className: "cedros-button cedros-button-secondary",
|
|
7221
|
-
onClick:
|
|
7221
|
+
onClick: A,
|
|
7222
7222
|
disabled: !b || o,
|
|
7223
7223
|
children: "Reset"
|
|
7224
7224
|
}
|
|
@@ -7840,16 +7840,16 @@ function Ro({ onComplete: t, className: s = "" }) {
|
|
|
7840
7840
|
c();
|
|
7841
7841
|
}, [c]);
|
|
7842
7842
|
const f = C(
|
|
7843
|
-
(v) => (
|
|
7844
|
-
u((b) => ({ ...b, [v]:
|
|
7843
|
+
(v) => (A) => {
|
|
7844
|
+
u((b) => ({ ...b, [v]: A.target.value })), m((b) => ({ ...b, [v]: void 0 }));
|
|
7845
7845
|
},
|
|
7846
7846
|
[]
|
|
7847
7847
|
), p = C(
|
|
7848
7848
|
async (v) => {
|
|
7849
7849
|
v.preventDefault();
|
|
7850
|
-
const
|
|
7851
|
-
if (Object.keys(
|
|
7852
|
-
m(
|
|
7850
|
+
const A = Do(d);
|
|
7851
|
+
if (Object.keys(A).length > 0) {
|
|
7852
|
+
m(A);
|
|
7853
7853
|
return;
|
|
7854
7854
|
}
|
|
7855
7855
|
try {
|
|
@@ -8052,24 +8052,24 @@ function Oe() {
|
|
|
8052
8052
|
m.current && clearTimeout(m.current), h.current && clearTimeout(h.current);
|
|
8053
8053
|
}, []);
|
|
8054
8054
|
const f = C(async () => {
|
|
8055
|
-
const
|
|
8056
|
-
if (Object.keys(
|
|
8055
|
+
const A = { ...y.current };
|
|
8056
|
+
if (Object.keys(A).length === 0) {
|
|
8057
8057
|
d("idle");
|
|
8058
8058
|
return;
|
|
8059
8059
|
}
|
|
8060
8060
|
d("saving"), g(null);
|
|
8061
|
-
const b = Object.entries(
|
|
8061
|
+
const b = Object.entries(A).map(([_, k]) => ({
|
|
8062
8062
|
key: _,
|
|
8063
|
-
value:
|
|
8063
|
+
value: k
|
|
8064
8064
|
}));
|
|
8065
8065
|
try {
|
|
8066
8066
|
await n(b), c((_) => {
|
|
8067
|
-
const
|
|
8068
|
-
for (const E of Object.keys(
|
|
8069
|
-
delete
|
|
8070
|
-
return
|
|
8067
|
+
const k = { ..._ };
|
|
8068
|
+
for (const E of Object.keys(A))
|
|
8069
|
+
delete k[E];
|
|
8070
|
+
return k;
|
|
8071
8071
|
});
|
|
8072
|
-
for (const _ of Object.keys(
|
|
8072
|
+
for (const _ of Object.keys(A))
|
|
8073
8073
|
delete y.current[_];
|
|
8074
8074
|
d("saved"), h.current && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
8075
8075
|
d("idle");
|
|
@@ -8078,17 +8078,17 @@ function Oe() {
|
|
|
8078
8078
|
d("error"), g(_ instanceof Error ? _.message : "Failed to save");
|
|
8079
8079
|
}
|
|
8080
8080
|
}, [n]), p = C(
|
|
8081
|
-
(
|
|
8082
|
-
c((_) => ({ ..._, [
|
|
8081
|
+
(A, b) => {
|
|
8082
|
+
c((_) => ({ ..._, [A]: b })), y.current[A] = b, g(null), d("pending"), m.current && clearTimeout(m.current), m.current = setTimeout(() => {
|
|
8083
8083
|
f();
|
|
8084
8084
|
}, Io);
|
|
8085
8085
|
},
|
|
8086
8086
|
[f]
|
|
8087
8087
|
), v = C(
|
|
8088
|
-
(
|
|
8089
|
-
if (o[
|
|
8088
|
+
(A) => {
|
|
8089
|
+
if (o[A] !== void 0) return o[A];
|
|
8090
8090
|
for (const b of Object.values(t)) {
|
|
8091
|
-
const _ = b.find((
|
|
8091
|
+
const _ = b.find((k) => k.key === A);
|
|
8092
8092
|
if (_) return _.value;
|
|
8093
8093
|
}
|
|
8094
8094
|
return "";
|
|
@@ -9586,20 +9586,20 @@ function Go() {
|
|
|
9586
9586
|
...b ? { Authorization: `Bearer ${b}` } : {}
|
|
9587
9587
|
};
|
|
9588
9588
|
}, []), y = C(
|
|
9589
|
-
async (b, _ = 50,
|
|
9589
|
+
async (b, _ = 50, k = 0) => {
|
|
9590
9590
|
u(!0), m(null);
|
|
9591
9591
|
try {
|
|
9592
9592
|
const E = new URLSearchParams();
|
|
9593
|
-
b && E.set("org_id", b), E.set("limit", String(_)), E.set("offset", String(
|
|
9593
|
+
b && E.set("org_id", b), E.set("limit", String(_)), E.set("offset", String(k));
|
|
9594
9594
|
const w = await fetch(`${r}/admin/sso-providers?${E}`, {
|
|
9595
9595
|
headers: h()
|
|
9596
9596
|
});
|
|
9597
9597
|
if (!w.ok) {
|
|
9598
|
-
const
|
|
9599
|
-
throw new Error(
|
|
9598
|
+
const x = await w.json().catch(() => ({}));
|
|
9599
|
+
throw new Error(x.error || `Failed to fetch SSO providers: ${w.status}`);
|
|
9600
9600
|
}
|
|
9601
|
-
const
|
|
9602
|
-
return o(
|
|
9601
|
+
const P = await w.json();
|
|
9602
|
+
return o(P.providers), l(P.total), P;
|
|
9603
9603
|
} catch (E) {
|
|
9604
9604
|
const w = E instanceof Error ? E : new Error(String(E));
|
|
9605
9605
|
throw m(w), w;
|
|
@@ -9621,11 +9621,11 @@ function Go() {
|
|
|
9621
9621
|
const E = await _.json().catch(() => ({}));
|
|
9622
9622
|
throw new Error(E.error || `Failed to create SSO provider: ${_.status}`);
|
|
9623
9623
|
}
|
|
9624
|
-
const
|
|
9625
|
-
return o((E) => [...E,
|
|
9624
|
+
const k = await _.json();
|
|
9625
|
+
return o((E) => [...E, k]), l((E) => E + 1), k;
|
|
9626
9626
|
} catch (_) {
|
|
9627
|
-
const
|
|
9628
|
-
throw m(
|
|
9627
|
+
const k = _ instanceof Error ? _ : new Error(String(_));
|
|
9628
|
+
throw m(k), k;
|
|
9629
9629
|
} finally {
|
|
9630
9630
|
u(!1);
|
|
9631
9631
|
}
|
|
@@ -9635,19 +9635,19 @@ function Go() {
|
|
|
9635
9635
|
async (b, _) => {
|
|
9636
9636
|
u(!0), m(null);
|
|
9637
9637
|
try {
|
|
9638
|
-
const
|
|
9638
|
+
const k = await fetch(`${r}/admin/sso-providers/${b}`, {
|
|
9639
9639
|
method: "PUT",
|
|
9640
9640
|
headers: h(),
|
|
9641
9641
|
body: JSON.stringify(_)
|
|
9642
9642
|
});
|
|
9643
|
-
if (!
|
|
9644
|
-
const w = await
|
|
9645
|
-
throw new Error(w.error || `Failed to update SSO provider: ${
|
|
9643
|
+
if (!k.ok) {
|
|
9644
|
+
const w = await k.json().catch(() => ({}));
|
|
9645
|
+
throw new Error(w.error || `Failed to update SSO provider: ${k.status}`);
|
|
9646
9646
|
}
|
|
9647
|
-
const E = await
|
|
9648
|
-
return o((w) => w.map((
|
|
9649
|
-
} catch (
|
|
9650
|
-
const E =
|
|
9647
|
+
const E = await k.json();
|
|
9648
|
+
return o((w) => w.map((P) => P.id === b ? E : P)), E;
|
|
9649
|
+
} catch (k) {
|
|
9650
|
+
const E = k instanceof Error ? k : new Error(String(k));
|
|
9651
9651
|
throw m(E), E;
|
|
9652
9652
|
} finally {
|
|
9653
9653
|
u(!1);
|
|
@@ -9663,19 +9663,19 @@ function Go() {
|
|
|
9663
9663
|
headers: h()
|
|
9664
9664
|
});
|
|
9665
9665
|
if (!_.ok) {
|
|
9666
|
-
const
|
|
9667
|
-
throw new Error(
|
|
9666
|
+
const k = await _.json().catch(() => ({}));
|
|
9667
|
+
throw new Error(k.error || `Failed to delete SSO provider: ${_.status}`);
|
|
9668
9668
|
}
|
|
9669
|
-
o((
|
|
9669
|
+
o((k) => k.filter((E) => E.id !== b)), l((k) => k - 1);
|
|
9670
9670
|
} catch (_) {
|
|
9671
|
-
const
|
|
9672
|
-
throw m(
|
|
9671
|
+
const k = _ instanceof Error ? _ : new Error(String(_));
|
|
9672
|
+
throw m(k), k;
|
|
9673
9673
|
} finally {
|
|
9674
9674
|
u(!1);
|
|
9675
9675
|
}
|
|
9676
9676
|
},
|
|
9677
9677
|
[r, h]
|
|
9678
|
-
),
|
|
9678
|
+
), A = C(
|
|
9679
9679
|
async (b, _) => p(b, { enabled: _ }),
|
|
9680
9680
|
[p]
|
|
9681
9681
|
);
|
|
@@ -9688,7 +9688,7 @@ function Go() {
|
|
|
9688
9688
|
createProvider: f,
|
|
9689
9689
|
updateProvider: p,
|
|
9690
9690
|
deleteProvider: v,
|
|
9691
|
-
toggleProvider:
|
|
9691
|
+
toggleProvider: A
|
|
9692
9692
|
};
|
|
9693
9693
|
}
|
|
9694
9694
|
class Vr {
|
|
@@ -9788,7 +9788,7 @@ function _s(t, s) {
|
|
|
9788
9788
|
}
|
|
9789
9789
|
}
|
|
9790
9790
|
function is() {
|
|
9791
|
-
const { config: t, user: s, authState: r, _internal: a } = ae(), n = typeof window < "u" && !!window.localStorage, [o, c] = N([]), [l, d] = N(null), [u, g] = N([]), [m, h] = N(null), [y, f] = N(
|
|
9791
|
+
const { config: t, user: s, authState: r, _internal: a } = ae(), n = typeof window < "u" && !!window.localStorage, [o, c] = N([]), [l, d] = N(null), [u, g] = N([]), [m, h] = N(null), [y, f] = N(r === "authenticated"), [p, v] = N(null), A = O(
|
|
9792
9792
|
() => new Vr(
|
|
9793
9793
|
t.serverUrl,
|
|
9794
9794
|
t.requestTimeout,
|
|
@@ -9796,84 +9796,93 @@ function is() {
|
|
|
9796
9796
|
a?.getAccessToken
|
|
9797
9797
|
),
|
|
9798
9798
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, a]
|
|
9799
|
-
), b = z(
|
|
9799
|
+
), b = z(A);
|
|
9800
9800
|
U(() => {
|
|
9801
|
-
b.current =
|
|
9802
|
-
}, [
|
|
9803
|
-
const _ = C(async (
|
|
9801
|
+
b.current = A;
|
|
9802
|
+
}, [A]);
|
|
9803
|
+
const _ = C(async (S) => {
|
|
9804
9804
|
try {
|
|
9805
|
-
const T = await b.current.getPermissions(
|
|
9805
|
+
const T = await b.current.getPermissions(S);
|
|
9806
9806
|
g(T.permissions), h(T.role);
|
|
9807
9807
|
} catch {
|
|
9808
9808
|
g([]), h(null);
|
|
9809
9809
|
}
|
|
9810
|
-
}, []),
|
|
9810
|
+
}, []), k = z(async () => {
|
|
9811
|
+
}), E = C(async () => {
|
|
9811
9812
|
if (r !== "authenticated" || !s) {
|
|
9812
9813
|
c([]), d(null), g([]), h(null);
|
|
9813
9814
|
return;
|
|
9814
9815
|
}
|
|
9815
9816
|
f(!0), v(null);
|
|
9816
9817
|
try {
|
|
9817
|
-
const
|
|
9818
|
-
c(
|
|
9818
|
+
const S = await b.current.listOrgs();
|
|
9819
|
+
c(S);
|
|
9819
9820
|
const T = n ? Yo(_t) : null;
|
|
9820
|
-
let
|
|
9821
|
-
!
|
|
9822
|
-
} catch (
|
|
9823
|
-
v(
|
|
9821
|
+
let R = S.find((I) => I.id === T);
|
|
9822
|
+
!R && S.length > 0 && (R = S.find((I) => I.isPersonal) || S[0]), R ? (d(R), n && _s(_t, R.id), await _(R.id)) : (d(null), g([]), h(null));
|
|
9823
|
+
} catch (S) {
|
|
9824
|
+
v(S);
|
|
9824
9825
|
} finally {
|
|
9825
9826
|
f(!1);
|
|
9826
9827
|
}
|
|
9827
|
-
}, [r, s, _, n])
|
|
9828
|
-
|
|
9829
|
-
|
|
9828
|
+
}, [r, s, _, n]);
|
|
9829
|
+
U(() => {
|
|
9830
|
+
k.current = E;
|
|
9831
|
+
}, [E]);
|
|
9832
|
+
const w = z(!1);
|
|
9833
|
+
U(() => {
|
|
9834
|
+
r === "authenticated" && !w.current ? (w.current = !0, k.current()) : r !== "authenticated" && (w.current = !1);
|
|
9835
|
+
}, [r]);
|
|
9836
|
+
const P = C(
|
|
9837
|
+
async (S) => {
|
|
9838
|
+
const T = o.find((R) => R.id === S);
|
|
9830
9839
|
if (!T) {
|
|
9831
9840
|
v({ code: "UNKNOWN_ERROR", message: "Organization not found" });
|
|
9832
9841
|
return;
|
|
9833
9842
|
}
|
|
9834
|
-
d(T), n && _s(_t,
|
|
9843
|
+
d(T), n && _s(_t, S), await _(S);
|
|
9835
9844
|
},
|
|
9836
9845
|
[o, _, n]
|
|
9837
|
-
),
|
|
9838
|
-
async (
|
|
9846
|
+
), x = C(
|
|
9847
|
+
async (S) => {
|
|
9839
9848
|
f(!0), v(null);
|
|
9840
9849
|
try {
|
|
9841
|
-
const T = await b.current.createOrg(
|
|
9842
|
-
return await
|
|
9850
|
+
const T = await b.current.createOrg(S);
|
|
9851
|
+
return await E(), T;
|
|
9843
9852
|
} catch (T) {
|
|
9844
9853
|
throw v(T), T;
|
|
9845
9854
|
} finally {
|
|
9846
9855
|
f(!1);
|
|
9847
9856
|
}
|
|
9848
9857
|
},
|
|
9849
|
-
[
|
|
9850
|
-
),
|
|
9851
|
-
async (
|
|
9858
|
+
[E]
|
|
9859
|
+
), M = C(
|
|
9860
|
+
async (S, T) => {
|
|
9852
9861
|
f(!0), v(null);
|
|
9853
9862
|
try {
|
|
9854
|
-
const
|
|
9855
|
-
return await
|
|
9856
|
-
} catch (
|
|
9857
|
-
throw v(
|
|
9863
|
+
const R = await b.current.updateOrg(S, T);
|
|
9864
|
+
return await E(), R;
|
|
9865
|
+
} catch (R) {
|
|
9866
|
+
throw v(R), R;
|
|
9858
9867
|
} finally {
|
|
9859
9868
|
f(!1);
|
|
9860
9869
|
}
|
|
9861
9870
|
},
|
|
9862
|
-
[
|
|
9863
|
-
),
|
|
9864
|
-
async (
|
|
9871
|
+
[E]
|
|
9872
|
+
), D = C(
|
|
9873
|
+
async (S) => {
|
|
9865
9874
|
f(!0), v(null);
|
|
9866
9875
|
try {
|
|
9867
|
-
await b.current.deleteOrg(
|
|
9876
|
+
await b.current.deleteOrg(S), await E();
|
|
9868
9877
|
} catch (T) {
|
|
9869
9878
|
throw v(T), T;
|
|
9870
9879
|
} finally {
|
|
9871
9880
|
f(!1);
|
|
9872
9881
|
}
|
|
9873
9882
|
},
|
|
9874
|
-
[
|
|
9875
|
-
),
|
|
9876
|
-
(
|
|
9883
|
+
[E]
|
|
9884
|
+
), L = C(
|
|
9885
|
+
(S) => u.includes(S),
|
|
9877
9886
|
[u]
|
|
9878
9887
|
);
|
|
9879
9888
|
return {
|
|
@@ -9883,12 +9892,12 @@ function is() {
|
|
|
9883
9892
|
role: m,
|
|
9884
9893
|
isLoading: y,
|
|
9885
9894
|
error: p,
|
|
9886
|
-
fetchOrgs:
|
|
9887
|
-
switchOrg:
|
|
9888
|
-
createOrg:
|
|
9889
|
-
updateOrg:
|
|
9890
|
-
deleteOrg:
|
|
9891
|
-
hasPermission:
|
|
9895
|
+
fetchOrgs: E,
|
|
9896
|
+
switchOrg: P,
|
|
9897
|
+
createOrg: x,
|
|
9898
|
+
updateOrg: M,
|
|
9899
|
+
deleteOrg: D,
|
|
9900
|
+
hasPermission: L
|
|
9892
9901
|
};
|
|
9893
9902
|
}
|
|
9894
9903
|
function Jo({ className: t }) {
|
|
@@ -9907,7 +9916,7 @@ function Jo({ className: t }) {
|
|
|
9907
9916
|
}, [n, u?.id]);
|
|
9908
9917
|
const v = () => {
|
|
9909
9918
|
y(null), p(null), m("add");
|
|
9910
|
-
},
|
|
9919
|
+
}, A = (w) => {
|
|
9911
9920
|
y(w), p(null), m("edit");
|
|
9912
9921
|
}, b = () => {
|
|
9913
9922
|
m("list"), y(null), p(null);
|
|
@@ -9917,7 +9926,7 @@ function Jo({ className: t }) {
|
|
|
9917
9926
|
await l(w.id);
|
|
9918
9927
|
} catch {
|
|
9919
9928
|
}
|
|
9920
|
-
},
|
|
9929
|
+
}, k = async (w) => {
|
|
9921
9930
|
try {
|
|
9922
9931
|
await d(w.id, !w.enabled);
|
|
9923
9932
|
} catch {
|
|
@@ -9926,8 +9935,8 @@ function Jo({ className: t }) {
|
|
|
9926
9935
|
p(null);
|
|
9927
9936
|
try {
|
|
9928
9937
|
g === "add" ? await o(w) : h && await c(h.id, w), m("list"), y(null);
|
|
9929
|
-
} catch (
|
|
9930
|
-
p(
|
|
9938
|
+
} catch (P) {
|
|
9939
|
+
p(P instanceof Error ? P.message : "Failed to save provider");
|
|
9931
9940
|
}
|
|
9932
9941
|
};
|
|
9933
9942
|
return r && s.length === 0 ? /* @__PURE__ */ i("div", { className: `cedros-system-settings cedros-system-settings-loading ${t ?? ""}`, children: [
|
|
@@ -9959,9 +9968,9 @@ function Jo({ className: t }) {
|
|
|
9959
9968
|
Xo,
|
|
9960
9969
|
{
|
|
9961
9970
|
provider: w,
|
|
9962
|
-
onEdit: () =>
|
|
9971
|
+
onEdit: () => A(w),
|
|
9963
9972
|
onDelete: () => _(w),
|
|
9964
|
-
onToggle: () =>
|
|
9973
|
+
onToggle: () => k(w)
|
|
9965
9974
|
},
|
|
9966
9975
|
w.id
|
|
9967
9976
|
)) })
|
|
@@ -10013,18 +10022,18 @@ function Xo({ provider: t, onEdit: s, onDelete: r, onToggle: a }) {
|
|
|
10013
10022
|
] });
|
|
10014
10023
|
}
|
|
10015
10024
|
function Zo({ provider: t, orgId: s, error: r, isLoading: a, onSave: n, onCancel: o }) {
|
|
10016
|
-
const c = !!t, [l, d] = N(t?.name ?? ""), [u, g] = N(t?.issuerUrl ?? ""), [m, h] = N(t?.clientId ?? ""), [y, f] = N(""), [p, v] = N(t?.emailDomain ?? ""), [
|
|
10025
|
+
const c = !!t, [l, d] = N(t?.name ?? ""), [u, g] = N(t?.issuerUrl ?? ""), [m, h] = N(t?.clientId ?? ""), [y, f] = N(""), [p, v] = N(t?.emailDomain ?? ""), [A, b] = N(t?.allowRegistration ?? !0), [_, k] = N(t?.enabled ?? !0), E = C(
|
|
10017
10026
|
(w) => {
|
|
10018
10027
|
if (w.preventDefault(), c) {
|
|
10019
|
-
const
|
|
10028
|
+
const P = {
|
|
10020
10029
|
name: l,
|
|
10021
10030
|
issuerUrl: u,
|
|
10022
10031
|
clientId: m,
|
|
10023
10032
|
emailDomain: p || null,
|
|
10024
|
-
allowRegistration:
|
|
10033
|
+
allowRegistration: A,
|
|
10025
10034
|
enabled: _
|
|
10026
10035
|
};
|
|
10027
|
-
y && (
|
|
10036
|
+
y && (P.clientSecret = y), n(P);
|
|
10028
10037
|
} else {
|
|
10029
10038
|
if (!s)
|
|
10030
10039
|
return;
|
|
@@ -10035,12 +10044,12 @@ function Zo({ provider: t, orgId: s, error: r, isLoading: a, onSave: n, onCancel
|
|
|
10035
10044
|
clientId: m,
|
|
10036
10045
|
clientSecret: y,
|
|
10037
10046
|
emailDomain: p || null,
|
|
10038
|
-
allowRegistration:
|
|
10047
|
+
allowRegistration: A,
|
|
10039
10048
|
enabled: _
|
|
10040
10049
|
});
|
|
10041
10050
|
}
|
|
10042
10051
|
},
|
|
10043
|
-
[c, s, l, u, m, y, p,
|
|
10052
|
+
[c, s, l, u, m, y, p, A, _, n]
|
|
10044
10053
|
);
|
|
10045
10054
|
return /* @__PURE__ */ i("form", { className: "cedros-sso-provider-form", onSubmit: E, children: [
|
|
10046
10055
|
/* @__PURE__ */ e("div", { className: "cedros-settings-page-header", children: /* @__PURE__ */ i("div", { className: "cedros-settings-page-header-content", children: [
|
|
@@ -10133,7 +10142,7 @@ function Zo({ provider: t, orgId: s, error: r, isLoading: a, onSave: n, onCancel
|
|
|
10133
10142
|
"input",
|
|
10134
10143
|
{
|
|
10135
10144
|
type: "checkbox",
|
|
10136
|
-
checked:
|
|
10145
|
+
checked: A,
|
|
10137
10146
|
onChange: (w) => b(w.target.checked)
|
|
10138
10147
|
}
|
|
10139
10148
|
),
|
|
@@ -10145,7 +10154,7 @@ function Zo({ provider: t, orgId: s, error: r, isLoading: a, onSave: n, onCancel
|
|
|
10145
10154
|
{
|
|
10146
10155
|
type: "checkbox",
|
|
10147
10156
|
checked: _,
|
|
10148
|
-
onChange: (w) =>
|
|
10157
|
+
onChange: (w) => k(w.target.checked)
|
|
10149
10158
|
}
|
|
10150
10159
|
),
|
|
10151
10160
|
/* @__PURE__ */ e("span", { children: "Enable this provider" })
|
|
@@ -10362,11 +10371,11 @@ function li({ className: t }) {
|
|
|
10362
10371
|
const b = s[y] ?? [];
|
|
10363
10372
|
if (g !== "email") return b;
|
|
10364
10373
|
const _ = p ? ii : oi;
|
|
10365
|
-
return b.filter((
|
|
10366
|
-
}, [s, y, g, p]),
|
|
10374
|
+
return b.filter((k) => _.includes(k.key)).sort((k, E) => _.indexOf(k.key) - _.indexOf(E.key));
|
|
10375
|
+
}, [s, y, g, p]), A = (b, _) => {
|
|
10367
10376
|
if (d(b, _), b === "email_provider" && _ !== "custom") {
|
|
10368
|
-
const
|
|
10369
|
-
|
|
10377
|
+
const k = ai[_];
|
|
10378
|
+
k && (d("email_smtp_host", k), d("email_smtp_port", "587"), d("email_smtp_tls", "true"));
|
|
10370
10379
|
}
|
|
10371
10380
|
};
|
|
10372
10381
|
return a && Object.keys(s).length === 0 ? /* @__PURE__ */ i("div", { className: `cedros-system-settings cedros-system-settings-loading ${t ?? ""}`, children: [
|
|
@@ -10401,7 +10410,7 @@ function li({ className: t }) {
|
|
|
10401
10410
|
{
|
|
10402
10411
|
settings: v,
|
|
10403
10412
|
edits: r,
|
|
10404
|
-
onChange: g === "email" ?
|
|
10413
|
+
onChange: g === "email" ? A : d
|
|
10405
10414
|
}
|
|
10406
10415
|
) })
|
|
10407
10416
|
] });
|
|
@@ -10509,31 +10518,31 @@ function ci({ className: t }) {
|
|
|
10509
10518
|
U(() => {
|
|
10510
10519
|
l();
|
|
10511
10520
|
}, [l]);
|
|
10512
|
-
const h = Es.find((
|
|
10521
|
+
const h = Es.find((k) => k.id === g), y = O(() => {
|
|
10513
10522
|
if (!h) return [];
|
|
10514
|
-
const
|
|
10523
|
+
const k = [];
|
|
10515
10524
|
for (const E of h.categories) {
|
|
10516
10525
|
const w = s[E] ?? [];
|
|
10517
|
-
|
|
10526
|
+
k.push(...w);
|
|
10518
10527
|
}
|
|
10519
|
-
return
|
|
10528
|
+
return k;
|
|
10520
10529
|
}, [s, h]), f = u("deposit_fee_policy") || "company_pays_all", p = O(() => {
|
|
10521
10530
|
if (!h) return [];
|
|
10522
|
-
let
|
|
10523
|
-
if (h.includeKeys && h.includeKeys.length > 0 ? (
|
|
10531
|
+
let k = y;
|
|
10532
|
+
if (h.includeKeys && h.includeKeys.length > 0 ? (k = k.filter((E) => h.includeKeys.includes(E.key)), k.sort(
|
|
10524
10533
|
(E, w) => h.includeKeys.indexOf(E.key) - h.includeKeys.indexOf(w.key)
|
|
10525
|
-
)) : h.excludeKeys && h.excludeKeys.length > 0 && (
|
|
10526
|
-
const E = ["privacy_fee_fixed_lamports", "privacy_fee_percent_bps", "private_deposit_min_lamports"], w = ["swap_fee_fixed_lamports", "swap_fee_percent_bps"],
|
|
10527
|
-
|
|
10534
|
+
)) : h.excludeKeys && h.excludeKeys.length > 0 && (k = k.filter((E) => !h.excludeKeys.includes(E.key))), h.id === "deposits" && (parseFloat(u("deposit_min_usd")) || 0) > 10 && (k = k.filter((w) => w.key !== "deposit_micro_enabled")), h.id === "fees") {
|
|
10535
|
+
const E = ["privacy_fee_fixed_lamports", "privacy_fee_percent_bps", "private_deposit_min_lamports"], w = ["swap_fee_fixed_lamports", "swap_fee_percent_bps"], P = ["company_fee_fixed_lamports", "company_fee_percent_bps"];
|
|
10536
|
+
k = k.filter((x) => x.key === "deposit_fee_policy" ? !0 : f === "company_pays_all" ? !1 : E.includes(x.key) ? f === "user_pays_privacy" || f === "user_pays_all" : w.includes(x.key) ? f === "user_pays_swap" || f === "user_pays_all" : P.includes(x.key) ? f === "user_pays_all" : !0);
|
|
10528
10537
|
}
|
|
10529
|
-
return
|
|
10538
|
+
return k;
|
|
10530
10539
|
}, [y, h, u, f]), v = C(
|
|
10531
|
-
(
|
|
10540
|
+
(k) => y.filter((E) => k.includes(E.key)).sort((E, w) => k.indexOf(E.key) - k.indexOf(w.key)),
|
|
10532
10541
|
[y]
|
|
10533
|
-
),
|
|
10542
|
+
), A = O(() => {
|
|
10534
10543
|
if (h?.id !== "deposits") return;
|
|
10535
|
-
const
|
|
10536
|
-
return (w === "false" || w === "0" || w === "") && E < 10 && (
|
|
10544
|
+
const k = {}, E = parseFloat(u("deposit_min_usd")) || 0, w = u("deposit_micro_enabled");
|
|
10545
|
+
return (w === "false" || w === "0" || w === "") && E < 10 && (k.deposit_min_usd = "SOL micro payments must be enabled for minimum deposits under $10."), Object.keys(k).length > 0 ? k : void 0;
|
|
10537
10546
|
}, [h?.id, u]), b = u("feature_credits") === "true", _ = () => {
|
|
10538
10547
|
d("feature_credits", b ? "false" : "true");
|
|
10539
10548
|
};
|
|
@@ -10564,17 +10573,17 @@ function ci({ className: t }) {
|
|
|
10564
10573
|
/* @__PURE__ */ e(qe, { status: n, error: o })
|
|
10565
10574
|
] })
|
|
10566
10575
|
] }),
|
|
10567
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-tabs cedros-admin-tabs--line", children: Es.map((
|
|
10576
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-tabs cedros-admin-tabs--line", children: Es.map((k) => /* @__PURE__ */ e(
|
|
10568
10577
|
"button",
|
|
10569
10578
|
{
|
|
10570
10579
|
type: "button",
|
|
10571
|
-
className: `cedros-admin-tab ${g ===
|
|
10572
|
-
onClick: () => m(
|
|
10573
|
-
"aria-selected": g ===
|
|
10580
|
+
className: `cedros-admin-tab ${g === k.id ? "cedros-admin-tab-active" : ""}`,
|
|
10581
|
+
onClick: () => m(k.id),
|
|
10582
|
+
"aria-selected": g === k.id,
|
|
10574
10583
|
role: "tab",
|
|
10575
|
-
children:
|
|
10584
|
+
children: k.label
|
|
10576
10585
|
},
|
|
10577
|
-
|
|
10586
|
+
k.id
|
|
10578
10587
|
)) }),
|
|
10579
10588
|
/* @__PURE__ */ e("div", { className: "cedros-admin-tab-content", role: "tabpanel", children: p.length === 0 && !h?.sections?.length ? /* @__PURE__ */ e("div", { className: "cedros-system-settings-empty", children: /* @__PURE__ */ i("p", { children: [
|
|
10580
10589
|
"No settings found for ",
|
|
@@ -10587,15 +10596,15 @@ function ci({ className: t }) {
|
|
|
10587
10596
|
settings: p,
|
|
10588
10597
|
edits: r,
|
|
10589
10598
|
onChange: d,
|
|
10590
|
-
externalWarnings:
|
|
10599
|
+
externalWarnings: A
|
|
10591
10600
|
}
|
|
10592
10601
|
),
|
|
10593
|
-
h?.sections?.map((
|
|
10594
|
-
const E = v(
|
|
10602
|
+
h?.sections?.map((k) => {
|
|
10603
|
+
const E = v(k.keys);
|
|
10595
10604
|
return E.length === 0 ? null : /* @__PURE__ */ i("div", { className: "cedros-settings-subsection", children: [
|
|
10596
10605
|
/* @__PURE__ */ i("div", { className: "cedros-settings-subsection-header", children: [
|
|
10597
|
-
/* @__PURE__ */ e("h4", { className: "cedros-settings-subsection-title", children:
|
|
10598
|
-
|
|
10606
|
+
/* @__PURE__ */ e("h4", { className: "cedros-settings-subsection-title", children: k.title }),
|
|
10607
|
+
k.description && /* @__PURE__ */ e("p", { className: "cedros-settings-subsection-description", children: k.description })
|
|
10599
10608
|
] }),
|
|
10600
10609
|
/* @__PURE__ */ e(
|
|
10601
10610
|
Te,
|
|
@@ -10605,7 +10614,7 @@ function ci({ className: t }) {
|
|
|
10605
10614
|
onChange: d
|
|
10606
10615
|
}
|
|
10607
10616
|
)
|
|
10608
|
-
] },
|
|
10617
|
+
] }, k.title);
|
|
10609
10618
|
})
|
|
10610
10619
|
] }) })
|
|
10611
10620
|
] });
|
|
@@ -10770,16 +10779,16 @@ function hi(t) {
|
|
|
10770
10779
|
return;
|
|
10771
10780
|
}
|
|
10772
10781
|
u(!0), m(null);
|
|
10773
|
-
const
|
|
10782
|
+
const k = ++y.current;
|
|
10774
10783
|
try {
|
|
10775
|
-
const { limit: E = 50, offset: w = 0 } = _ ?? {},
|
|
10776
|
-
if (
|
|
10777
|
-
o(
|
|
10784
|
+
const { limit: E = 50, offset: w = 0 } = _ ?? {}, P = await p.current.listMembers(t, E, w);
|
|
10785
|
+
if (k !== y.current) return;
|
|
10786
|
+
o(P.members), l(P.total);
|
|
10778
10787
|
} catch (E) {
|
|
10779
|
-
if (
|
|
10788
|
+
if (k !== y.current) return;
|
|
10780
10789
|
m(E);
|
|
10781
10790
|
} finally {
|
|
10782
|
-
|
|
10791
|
+
k === y.current && u(!1);
|
|
10783
10792
|
}
|
|
10784
10793
|
},
|
|
10785
10794
|
[t, r]
|
|
@@ -10791,13 +10800,13 @@ function hi(t) {
|
|
|
10791
10800
|
}
|
|
10792
10801
|
t !== h.current && (h.current = t, v());
|
|
10793
10802
|
}, [t, r, v]);
|
|
10794
|
-
const
|
|
10795
|
-
async (_,
|
|
10803
|
+
const A = C(
|
|
10804
|
+
async (_, k) => {
|
|
10796
10805
|
if (!t)
|
|
10797
10806
|
throw new Error("No organization selected");
|
|
10798
10807
|
u(!0), m(null);
|
|
10799
10808
|
try {
|
|
10800
|
-
await p.current.updateMemberRole(t, _, { role:
|
|
10809
|
+
await p.current.updateMemberRole(t, _, { role: k }), await v();
|
|
10801
10810
|
} catch (E) {
|
|
10802
10811
|
throw m(E), E;
|
|
10803
10812
|
} finally {
|
|
@@ -10812,8 +10821,8 @@ function hi(t) {
|
|
|
10812
10821
|
u(!0), m(null);
|
|
10813
10822
|
try {
|
|
10814
10823
|
await p.current.removeMember(t, _), await v();
|
|
10815
|
-
} catch (
|
|
10816
|
-
throw m(
|
|
10824
|
+
} catch (k) {
|
|
10825
|
+
throw m(k), k;
|
|
10817
10826
|
} finally {
|
|
10818
10827
|
u(!1);
|
|
10819
10828
|
}
|
|
@@ -10826,7 +10835,7 @@ function hi(t) {
|
|
|
10826
10835
|
isLoading: d,
|
|
10827
10836
|
error: g,
|
|
10828
10837
|
fetchMembers: v,
|
|
10829
|
-
updateMemberRole:
|
|
10838
|
+
updateMemberRole: A,
|
|
10830
10839
|
removeMember: b
|
|
10831
10840
|
};
|
|
10832
10841
|
}
|
|
@@ -10920,12 +10929,12 @@ function pi(t) {
|
|
|
10920
10929
|
u(!0), m(null);
|
|
10921
10930
|
const w = ++y.current;
|
|
10922
10931
|
try {
|
|
10923
|
-
const { limit:
|
|
10932
|
+
const { limit: P = 50, offset: x = 0 } = E ?? {}, M = await p.current.listInvites(t, P, x);
|
|
10924
10933
|
if (w !== y.current) return;
|
|
10925
|
-
o(
|
|
10926
|
-
} catch (
|
|
10934
|
+
o(M.invites), l(M.total);
|
|
10935
|
+
} catch (P) {
|
|
10927
10936
|
if (w !== y.current) return;
|
|
10928
|
-
m(
|
|
10937
|
+
m(P);
|
|
10929
10938
|
} finally {
|
|
10930
10939
|
w === y.current && u(!1);
|
|
10931
10940
|
}
|
|
@@ -10939,15 +10948,15 @@ function pi(t) {
|
|
|
10939
10948
|
}
|
|
10940
10949
|
t !== h.current && (h.current = t, v());
|
|
10941
10950
|
}, [t, r, v]);
|
|
10942
|
-
const
|
|
10951
|
+
const A = C(
|
|
10943
10952
|
async (E, w = "member") => {
|
|
10944
10953
|
if (!t)
|
|
10945
10954
|
throw new Error("No organization selected");
|
|
10946
10955
|
u(!0), m(null);
|
|
10947
10956
|
try {
|
|
10948
10957
|
await p.current.createInvite(t, { email: E, role: w }), await v();
|
|
10949
|
-
} catch (
|
|
10950
|
-
throw m(
|
|
10958
|
+
} catch (P) {
|
|
10959
|
+
throw m(P), P;
|
|
10951
10960
|
} finally {
|
|
10952
10961
|
u(!1);
|
|
10953
10962
|
}
|
|
@@ -10981,7 +10990,7 @@ function pi(t) {
|
|
|
10981
10990
|
}
|
|
10982
10991
|
},
|
|
10983
10992
|
[t]
|
|
10984
|
-
),
|
|
10993
|
+
), k = C(async (E) => {
|
|
10985
10994
|
u(!0), m(null);
|
|
10986
10995
|
try {
|
|
10987
10996
|
return await p.current.acceptInvite({ token: E });
|
|
@@ -10997,10 +11006,10 @@ function pi(t) {
|
|
|
10997
11006
|
isLoading: d,
|
|
10998
11007
|
error: g,
|
|
10999
11008
|
fetchInvites: v,
|
|
11000
|
-
createInvite:
|
|
11009
|
+
createInvite: A,
|
|
11001
11010
|
cancelInvite: b,
|
|
11002
11011
|
resendInvite: _,
|
|
11003
|
-
acceptInvite:
|
|
11012
|
+
acceptInvite: k
|
|
11004
11013
|
};
|
|
11005
11014
|
}
|
|
11006
11015
|
const fi = {
|
|
@@ -11189,41 +11198,41 @@ function ls() {
|
|
|
11189
11198
|
),
|
|
11190
11199
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, s]
|
|
11191
11200
|
), y = C(
|
|
11192
|
-
async (
|
|
11193
|
-
l(!0), u(null), m(
|
|
11201
|
+
async (L) => {
|
|
11202
|
+
l(!0), u(null), m(L || {});
|
|
11194
11203
|
try {
|
|
11195
|
-
const S = await h.listUsers(
|
|
11204
|
+
const S = await h.listUsers(L);
|
|
11196
11205
|
return a(S.users), o(S.total), S;
|
|
11197
11206
|
} catch (S) {
|
|
11198
|
-
const
|
|
11199
|
-
throw u(
|
|
11207
|
+
const T = S instanceof Error ? S : new Error("Failed to list users");
|
|
11208
|
+
throw u(T), T;
|
|
11200
11209
|
} finally {
|
|
11201
11210
|
l(!1);
|
|
11202
11211
|
}
|
|
11203
11212
|
},
|
|
11204
11213
|
[h]
|
|
11205
11214
|
), f = C(
|
|
11206
|
-
async (
|
|
11215
|
+
async (L) => {
|
|
11207
11216
|
l(!0), u(null);
|
|
11208
11217
|
try {
|
|
11209
|
-
return await h.getUser(
|
|
11218
|
+
return await h.getUser(L);
|
|
11210
11219
|
} catch (S) {
|
|
11211
|
-
const
|
|
11212
|
-
throw u(
|
|
11220
|
+
const T = S instanceof Error ? S : new Error("Failed to get user");
|
|
11221
|
+
throw u(T), T;
|
|
11213
11222
|
} finally {
|
|
11214
11223
|
l(!1);
|
|
11215
11224
|
}
|
|
11216
11225
|
},
|
|
11217
11226
|
[h]
|
|
11218
11227
|
), p = C(
|
|
11219
|
-
async (
|
|
11228
|
+
async (L, S) => {
|
|
11220
11229
|
l(!0), u(null);
|
|
11221
11230
|
try {
|
|
11222
|
-
await h.setSystemAdmin(
|
|
11223
|
-
(
|
|
11231
|
+
await h.setSystemAdmin(L, S), a(
|
|
11232
|
+
(T) => T.map((R) => R.id === L ? { ...R, isSystemAdmin: S } : R)
|
|
11224
11233
|
);
|
|
11225
|
-
} catch (
|
|
11226
|
-
const R =
|
|
11234
|
+
} catch (T) {
|
|
11235
|
+
const R = T instanceof Error ? T : new Error("Failed to update admin status");
|
|
11227
11236
|
throw u(R), R;
|
|
11228
11237
|
} finally {
|
|
11229
11238
|
l(!1);
|
|
@@ -11231,50 +11240,50 @@ function ls() {
|
|
|
11231
11240
|
},
|
|
11232
11241
|
[h]
|
|
11233
11242
|
), v = C(
|
|
11234
|
-
async (
|
|
11243
|
+
async (L, S) => {
|
|
11235
11244
|
l(!0), u(null);
|
|
11236
11245
|
try {
|
|
11237
|
-
const
|
|
11238
|
-
return a((R) => R.map((I) => I.id ===
|
|
11239
|
-
} catch (
|
|
11240
|
-
const R =
|
|
11246
|
+
const T = await h.updateUser(L, S);
|
|
11247
|
+
return a((R) => R.map((I) => I.id === L ? T : I)), T;
|
|
11248
|
+
} catch (T) {
|
|
11249
|
+
const R = T instanceof Error ? T : new Error("Failed to update user");
|
|
11241
11250
|
throw u(R), R;
|
|
11242
11251
|
} finally {
|
|
11243
11252
|
l(!1);
|
|
11244
11253
|
}
|
|
11245
11254
|
},
|
|
11246
11255
|
[h]
|
|
11247
|
-
),
|
|
11248
|
-
async (
|
|
11256
|
+
), A = C(
|
|
11257
|
+
async (L) => {
|
|
11249
11258
|
l(!0), u(null);
|
|
11250
11259
|
try {
|
|
11251
|
-
await h.deleteUser(
|
|
11260
|
+
await h.deleteUser(L), a((S) => S.filter((T) => T.id !== L)), o((S) => S - 1);
|
|
11252
11261
|
} catch (S) {
|
|
11253
|
-
const
|
|
11254
|
-
throw u(
|
|
11262
|
+
const T = S instanceof Error ? S : new Error("Failed to delete user");
|
|
11263
|
+
throw u(T), T;
|
|
11255
11264
|
} finally {
|
|
11256
11265
|
l(!1);
|
|
11257
11266
|
}
|
|
11258
11267
|
},
|
|
11259
11268
|
[h]
|
|
11260
11269
|
), b = C(
|
|
11261
|
-
async (
|
|
11270
|
+
async (L) => {
|
|
11262
11271
|
l(!0), u(null);
|
|
11263
11272
|
try {
|
|
11264
|
-
await h.forcePasswordReset(
|
|
11273
|
+
await h.forcePasswordReset(L);
|
|
11265
11274
|
} catch (S) {
|
|
11266
|
-
const
|
|
11267
|
-
throw u(
|
|
11275
|
+
const T = S instanceof Error ? S : new Error("Failed to send password reset");
|
|
11276
|
+
throw u(T), T;
|
|
11268
11277
|
} finally {
|
|
11269
11278
|
l(!1);
|
|
11270
11279
|
}
|
|
11271
11280
|
},
|
|
11272
11281
|
[h]
|
|
11273
11282
|
), _ = C(
|
|
11274
|
-
async (
|
|
11283
|
+
async (L, S, T) => {
|
|
11275
11284
|
l(!0), u(null);
|
|
11276
11285
|
try {
|
|
11277
|
-
await h.adjustCredits(
|
|
11286
|
+
await h.adjustCredits(L, { amount: S, reason: T });
|
|
11278
11287
|
} catch (R) {
|
|
11279
11288
|
const I = R instanceof Error ? R : new Error("Failed to adjust credits");
|
|
11280
11289
|
throw u(I), I;
|
|
@@ -11283,13 +11292,13 @@ function ls() {
|
|
|
11283
11292
|
}
|
|
11284
11293
|
},
|
|
11285
11294
|
[h]
|
|
11286
|
-
),
|
|
11287
|
-
async (
|
|
11295
|
+
), k = C(
|
|
11296
|
+
async (L, S) => {
|
|
11288
11297
|
l(!0), u(null);
|
|
11289
11298
|
try {
|
|
11290
|
-
return await h.getUserDeposits(
|
|
11291
|
-
} catch (
|
|
11292
|
-
const R =
|
|
11299
|
+
return await h.getUserDeposits(L, S);
|
|
11300
|
+
} catch (T) {
|
|
11301
|
+
const R = T instanceof Error ? T : new Error("Failed to get user deposits");
|
|
11293
11302
|
throw u(R), R;
|
|
11294
11303
|
} finally {
|
|
11295
11304
|
l(!1);
|
|
@@ -11297,12 +11306,12 @@ function ls() {
|
|
|
11297
11306
|
},
|
|
11298
11307
|
[h]
|
|
11299
11308
|
), E = C(
|
|
11300
|
-
async (
|
|
11309
|
+
async (L, S) => {
|
|
11301
11310
|
l(!0), u(null);
|
|
11302
11311
|
try {
|
|
11303
|
-
return await h.getUserCredits(
|
|
11304
|
-
} catch (
|
|
11305
|
-
const R =
|
|
11312
|
+
return await h.getUserCredits(L, S);
|
|
11313
|
+
} catch (T) {
|
|
11314
|
+
const R = T instanceof Error ? T : new Error("Failed to get user credits");
|
|
11306
11315
|
throw u(R), R;
|
|
11307
11316
|
} finally {
|
|
11308
11317
|
l(!1);
|
|
@@ -11310,44 +11319,44 @@ function ls() {
|
|
|
11310
11319
|
},
|
|
11311
11320
|
[h]
|
|
11312
11321
|
), w = C(
|
|
11313
|
-
async (
|
|
11322
|
+
async (L, S) => {
|
|
11314
11323
|
l(!0), u(null);
|
|
11315
11324
|
try {
|
|
11316
|
-
return await h.getUserWithdrawalHistory(
|
|
11317
|
-
} catch (
|
|
11318
|
-
const R =
|
|
11325
|
+
return await h.getUserWithdrawalHistory(L, S);
|
|
11326
|
+
} catch (T) {
|
|
11327
|
+
const R = T instanceof Error ? T : new Error("Failed to get user withdrawal history");
|
|
11319
11328
|
throw u(R), R;
|
|
11320
11329
|
} finally {
|
|
11321
11330
|
l(!1);
|
|
11322
11331
|
}
|
|
11323
11332
|
},
|
|
11324
11333
|
[h]
|
|
11325
|
-
),
|
|
11326
|
-
async (
|
|
11334
|
+
), P = C(
|
|
11335
|
+
async (L, S) => {
|
|
11327
11336
|
l(!0), u(null);
|
|
11328
11337
|
try {
|
|
11329
|
-
return await h.getUserChats(
|
|
11330
|
-
} catch (
|
|
11331
|
-
const R =
|
|
11338
|
+
return await h.getUserChats(L, S);
|
|
11339
|
+
} catch (T) {
|
|
11340
|
+
const R = T instanceof Error ? T : new Error("Failed to get user chat history");
|
|
11332
11341
|
throw u(R), R;
|
|
11333
11342
|
} finally {
|
|
11334
11343
|
l(!1);
|
|
11335
11344
|
}
|
|
11336
11345
|
},
|
|
11337
11346
|
[h]
|
|
11338
|
-
),
|
|
11347
|
+
), x = C(async () => {
|
|
11339
11348
|
l(!0), u(null);
|
|
11340
11349
|
try {
|
|
11341
11350
|
return await h.getStats();
|
|
11342
|
-
} catch (
|
|
11343
|
-
const S =
|
|
11351
|
+
} catch (L) {
|
|
11352
|
+
const S = L instanceof Error ? L : new Error("Failed to get user stats");
|
|
11344
11353
|
throw u(S), S;
|
|
11345
11354
|
} finally {
|
|
11346
11355
|
l(!1);
|
|
11347
11356
|
}
|
|
11348
|
-
}, [h]),
|
|
11357
|
+
}, [h]), M = C(async () => {
|
|
11349
11358
|
await y(g);
|
|
11350
|
-
}, [y, g]),
|
|
11359
|
+
}, [y, g]), D = C(() => {
|
|
11351
11360
|
u(null);
|
|
11352
11361
|
}, []);
|
|
11353
11362
|
return {
|
|
@@ -11359,16 +11368,16 @@ function ls() {
|
|
|
11359
11368
|
getUser: f,
|
|
11360
11369
|
setSystemAdmin: p,
|
|
11361
11370
|
updateUser: v,
|
|
11362
|
-
deleteUser:
|
|
11371
|
+
deleteUser: A,
|
|
11363
11372
|
forcePasswordReset: b,
|
|
11364
11373
|
adjustCredits: _,
|
|
11365
|
-
getUserDeposits:
|
|
11374
|
+
getUserDeposits: k,
|
|
11366
11375
|
getUserCredits: E,
|
|
11367
11376
|
getUserWithdrawalHistory: w,
|
|
11368
|
-
getUserChats:
|
|
11369
|
-
getStats:
|
|
11370
|
-
refresh:
|
|
11371
|
-
clearError:
|
|
11377
|
+
getUserChats: P,
|
|
11378
|
+
getStats: x,
|
|
11379
|
+
refresh: M,
|
|
11380
|
+
clearError: D
|
|
11372
11381
|
};
|
|
11373
11382
|
}
|
|
11374
11383
|
const yi = [
|
|
@@ -11481,23 +11490,23 @@ function Qr() {
|
|
|
11481
11490
|
d(!0), h(null);
|
|
11482
11491
|
const _ = ++y.current;
|
|
11483
11492
|
try {
|
|
11484
|
-
const
|
|
11493
|
+
const k = await p.current.get(
|
|
11485
11494
|
"/admin/dashboard-permissions"
|
|
11486
11495
|
);
|
|
11487
11496
|
if (_ !== y.current) return;
|
|
11488
|
-
c(
|
|
11489
|
-
} catch (
|
|
11497
|
+
c(k.permissions);
|
|
11498
|
+
} catch (k) {
|
|
11490
11499
|
if (_ !== y.current) return;
|
|
11491
|
-
if (
|
|
11500
|
+
if (k instanceof Error && k.message.includes("404"))
|
|
11492
11501
|
c(tt);
|
|
11493
11502
|
else {
|
|
11494
|
-
const E =
|
|
11503
|
+
const E = k instanceof Error ? k.message : "Failed to fetch permissions";
|
|
11495
11504
|
h({ code: "NETWORK_ERROR", message: E }), c(tt);
|
|
11496
11505
|
}
|
|
11497
11506
|
} finally {
|
|
11498
11507
|
_ === y.current && d(!1);
|
|
11499
11508
|
}
|
|
11500
|
-
}, [s, a]),
|
|
11509
|
+
}, [s, a]), A = C(
|
|
11501
11510
|
async (_) => {
|
|
11502
11511
|
if (s !== "authenticated" || !a)
|
|
11503
11512
|
throw new Error("Not authenticated");
|
|
@@ -11510,8 +11519,8 @@ function Qr() {
|
|
|
11510
11519
|
path: "/admin/dashboard-permissions",
|
|
11511
11520
|
body: _
|
|
11512
11521
|
}), c(_);
|
|
11513
|
-
} catch (
|
|
11514
|
-
const E =
|
|
11522
|
+
} catch (k) {
|
|
11523
|
+
const E = k instanceof Error ? k.message : "Failed to update permissions";
|
|
11515
11524
|
throw h({ code: "NETWORK_ERROR", message: E }), new Error(E);
|
|
11516
11525
|
} finally {
|
|
11517
11526
|
g(!1);
|
|
@@ -11527,7 +11536,7 @@ function Qr() {
|
|
|
11527
11536
|
}, [a?.id, v]), {
|
|
11528
11537
|
permissions: o,
|
|
11529
11538
|
canAccess: b,
|
|
11530
|
-
updatePermissions:
|
|
11539
|
+
updatePermissions: A,
|
|
11531
11540
|
isLoading: l,
|
|
11532
11541
|
isUpdating: u,
|
|
11533
11542
|
error: m,
|
|
@@ -11550,11 +11559,11 @@ function $e() {
|
|
|
11550
11559
|
try {
|
|
11551
11560
|
const v = new URLSearchParams();
|
|
11552
11561
|
p?.status && v.set("status", p.status), p?.limit !== void 0 && v.set("limit", String(p.limit)), p?.offset !== void 0 && v.set("offset", String(p.offset));
|
|
11553
|
-
const
|
|
11562
|
+
const A = v.toString(), b = A ? `/admin/deposits?${A}` : "/admin/deposits";
|
|
11554
11563
|
return await o.get(b);
|
|
11555
11564
|
} catch (v) {
|
|
11556
|
-
const
|
|
11557
|
-
throw n(
|
|
11565
|
+
const A = B(v, "Failed to list deposits");
|
|
11566
|
+
throw n(A.message), A;
|
|
11558
11567
|
} finally {
|
|
11559
11568
|
r(!1);
|
|
11560
11569
|
}
|
|
@@ -11580,11 +11589,11 @@ function $e() {
|
|
|
11580
11589
|
try {
|
|
11581
11590
|
const v = new URLSearchParams();
|
|
11582
11591
|
p?.limit !== void 0 && v.set("limit", String(p.limit)), p?.offset !== void 0 && v.set("offset", String(p.offset));
|
|
11583
|
-
const
|
|
11592
|
+
const A = v.toString(), b = A ? `/admin/deposits/in-privacy-period?${A}` : "/admin/deposits/in-privacy-period";
|
|
11584
11593
|
return await o.get(b);
|
|
11585
11594
|
} catch (v) {
|
|
11586
|
-
const
|
|
11587
|
-
throw n(
|
|
11595
|
+
const A = B(v, "Failed to list deposits in privacy period");
|
|
11596
|
+
throw n(A.message), A;
|
|
11588
11597
|
} finally {
|
|
11589
11598
|
r(!1);
|
|
11590
11599
|
}
|
|
@@ -11598,11 +11607,11 @@ function $e() {
|
|
|
11598
11607
|
try {
|
|
11599
11608
|
const v = new URLSearchParams();
|
|
11600
11609
|
p?.limit !== void 0 && v.set("limit", String(p.limit)), p?.offset !== void 0 && v.set("offset", String(p.offset));
|
|
11601
|
-
const
|
|
11610
|
+
const A = v.toString(), b = A ? `/admin/withdrawals/pending?${A}` : "/admin/withdrawals/pending";
|
|
11602
11611
|
return await o.get(b);
|
|
11603
11612
|
} catch (v) {
|
|
11604
|
-
const
|
|
11605
|
-
throw n(
|
|
11613
|
+
const A = B(v, "Failed to list pending withdrawals");
|
|
11614
|
+
throw n(A.message), A;
|
|
11606
11615
|
} finally {
|
|
11607
11616
|
r(!1);
|
|
11608
11617
|
}
|
|
@@ -11618,8 +11627,8 @@ function $e() {
|
|
|
11618
11627
|
`/admin/withdrawals/${p}/process`,
|
|
11619
11628
|
v ?? {}
|
|
11620
11629
|
);
|
|
11621
|
-
} catch (
|
|
11622
|
-
const b = B(
|
|
11630
|
+
} catch (A) {
|
|
11631
|
+
const b = B(A, "Failed to process withdrawal");
|
|
11623
11632
|
throw n(b.message), b;
|
|
11624
11633
|
} finally {
|
|
11625
11634
|
r(!1);
|
|
@@ -11892,50 +11901,50 @@ function Si({
|
|
|
11892
11901
|
onLoad: n,
|
|
11893
11902
|
onDepositClick: o
|
|
11894
11903
|
}) {
|
|
11895
|
-
const { listDeposits: c, isLoading: l, error: d, clearError: u } = $e(), [g, m] = N([]), [h, y] = N(0), [f, p] = N(0), [v,
|
|
11896
|
-
b ===
|
|
11897
|
-
},
|
|
11904
|
+
const { listDeposits: c, isLoading: l, error: d, clearError: u } = $e(), [g, m] = N([]), [h, y] = N(0), [f, p] = N(0), [v, A] = N(null), [b, _] = N("createdAt"), [k, E] = N("desc"), w = (T) => {
|
|
11905
|
+
b === T ? E(k === "asc" ? "desc" : "asc") : (_(T), E("desc"));
|
|
11906
|
+
}, P = O(() => [...g].sort((T, R) => {
|
|
11898
11907
|
let I, j;
|
|
11899
11908
|
switch (b) {
|
|
11900
11909
|
case "userId":
|
|
11901
|
-
I =
|
|
11910
|
+
I = T.userId.toLowerCase(), j = R.userId.toLowerCase();
|
|
11902
11911
|
break;
|
|
11903
11912
|
case "amountLamports":
|
|
11904
|
-
I =
|
|
11913
|
+
I = T.amountLamports ?? 0, j = R.amountLamports ?? 0;
|
|
11905
11914
|
break;
|
|
11906
11915
|
case "status":
|
|
11907
|
-
I =
|
|
11916
|
+
I = T.status, j = R.status;
|
|
11908
11917
|
break;
|
|
11909
11918
|
case "createdAt":
|
|
11910
|
-
I = new Date(
|
|
11919
|
+
I = new Date(T.createdAt).getTime(), j = new Date(R.createdAt).getTime();
|
|
11911
11920
|
break;
|
|
11912
11921
|
case "txSignature":
|
|
11913
|
-
I =
|
|
11922
|
+
I = T.txSignature || "", j = R.txSignature || "";
|
|
11914
11923
|
break;
|
|
11915
11924
|
default:
|
|
11916
11925
|
return 0;
|
|
11917
11926
|
}
|
|
11918
|
-
return I < j ?
|
|
11919
|
-
}), [g, b,
|
|
11927
|
+
return I < j ? k === "asc" ? -1 : 1 : I > j ? k === "asc" ? 1 : -1 : 0;
|
|
11928
|
+
}), [g, b, k]), x = C(async () => {
|
|
11920
11929
|
try {
|
|
11921
|
-
const
|
|
11922
|
-
m(
|
|
11923
|
-
} catch (
|
|
11924
|
-
const R =
|
|
11925
|
-
|
|
11930
|
+
const T = await c({ status: t, limit: s, offset: f });
|
|
11931
|
+
m(T.deposits), y(T.total), n?.(T), A(null);
|
|
11932
|
+
} catch (T) {
|
|
11933
|
+
const R = T && typeof T == "object" && "message" in T ? String(T.message) : "Failed to load deposits";
|
|
11934
|
+
A(R);
|
|
11926
11935
|
}
|
|
11927
11936
|
}, [t, s, f, c, n]);
|
|
11928
11937
|
U(() => {
|
|
11929
11938
|
p(0);
|
|
11930
11939
|
}, [t, s]), U(() => {
|
|
11931
|
-
|
|
11932
|
-
}, [
|
|
11940
|
+
x();
|
|
11941
|
+
}, [x]), U(() => {
|
|
11933
11942
|
if (r <= 0) return;
|
|
11934
|
-
const
|
|
11935
|
-
return () => clearInterval(
|
|
11936
|
-
}, [r,
|
|
11937
|
-
const
|
|
11938
|
-
const R = (
|
|
11943
|
+
const T = setInterval(x, r);
|
|
11944
|
+
return () => clearInterval(T);
|
|
11945
|
+
}, [r, x]);
|
|
11946
|
+
const M = Math.ceil(h / s), D = Math.floor(f / s) + 1, L = (T) => {
|
|
11947
|
+
const R = (T - 1) * s;
|
|
11939
11948
|
p(Math.max(0, Math.min(R, Math.max(0, h - 1))));
|
|
11940
11949
|
}, S = v || d;
|
|
11941
11950
|
return S ? /* @__PURE__ */ i("div", { className: `cedros-admin-deposit-list cedros-admin-deposit-list-error ${a}`, children: [
|
|
@@ -11946,7 +11955,7 @@ function Si({
|
|
|
11946
11955
|
type: "button",
|
|
11947
11956
|
className: "cedros-button cedros-button-outline",
|
|
11948
11957
|
onClick: () => {
|
|
11949
|
-
u(),
|
|
11958
|
+
u(), A(null), x();
|
|
11950
11959
|
},
|
|
11951
11960
|
children: "Retry"
|
|
11952
11961
|
}
|
|
@@ -11962,7 +11971,7 @@ function Si({
|
|
|
11962
11971
|
{
|
|
11963
11972
|
type: "button",
|
|
11964
11973
|
className: "cedros-button cedros-button-outline cedros-button-sm cedros-admin-icon-button",
|
|
11965
|
-
onClick:
|
|
11974
|
+
onClick: x,
|
|
11966
11975
|
disabled: l,
|
|
11967
11976
|
title: "Refresh deposits",
|
|
11968
11977
|
"aria-label": "Refresh deposits",
|
|
@@ -11983,7 +11992,7 @@ function Si({
|
|
|
11983
11992
|
children: [
|
|
11984
11993
|
"User",
|
|
11985
11994
|
" ",
|
|
11986
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "userId" ?
|
|
11995
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "userId" ? k === "asc" ? "↑" : "↓" : "↕" })
|
|
11987
11996
|
]
|
|
11988
11997
|
}
|
|
11989
11998
|
) }),
|
|
@@ -11997,7 +12006,7 @@ function Si({
|
|
|
11997
12006
|
children: [
|
|
11998
12007
|
"Amount",
|
|
11999
12008
|
" ",
|
|
12000
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "amountLamports" ?
|
|
12009
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "amountLamports" ? k === "asc" ? "↑" : "↓" : "↕" })
|
|
12001
12010
|
]
|
|
12002
12011
|
}
|
|
12003
12012
|
) }),
|
|
@@ -12011,7 +12020,7 @@ function Si({
|
|
|
12011
12020
|
children: [
|
|
12012
12021
|
"Status",
|
|
12013
12022
|
" ",
|
|
12014
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "status" ?
|
|
12023
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "status" ? k === "asc" ? "↑" : "↓" : "↕" })
|
|
12015
12024
|
]
|
|
12016
12025
|
}
|
|
12017
12026
|
) }),
|
|
@@ -12025,7 +12034,7 @@ function Si({
|
|
|
12025
12034
|
children: [
|
|
12026
12035
|
"Created",
|
|
12027
12036
|
" ",
|
|
12028
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "createdAt" ?
|
|
12037
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "createdAt" ? k === "asc" ? "↑" : "↓" : "↕" })
|
|
12029
12038
|
]
|
|
12030
12039
|
}
|
|
12031
12040
|
) }),
|
|
@@ -12039,48 +12048,48 @@ function Si({
|
|
|
12039
12048
|
children: [
|
|
12040
12049
|
"Tx",
|
|
12041
12050
|
" ",
|
|
12042
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "txSignature" ?
|
|
12051
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: b === "txSignature" ? k === "asc" ? "↑" : "↓" : "↕" })
|
|
12043
12052
|
]
|
|
12044
12053
|
}
|
|
12045
12054
|
) })
|
|
12046
12055
|
] }),
|
|
12047
|
-
|
|
12056
|
+
P.map((T) => /* @__PURE__ */ i(
|
|
12048
12057
|
"div",
|
|
12049
12058
|
{
|
|
12050
|
-
className: `cedros-admin-deposit-row ${ki(
|
|
12051
|
-
onClick: () => o?.(
|
|
12059
|
+
className: `cedros-admin-deposit-row ${ki(T.status)}`,
|
|
12060
|
+
onClick: () => o?.(T),
|
|
12052
12061
|
onKeyDown: (R) => {
|
|
12053
|
-
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), o?.(
|
|
12062
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), o?.(T));
|
|
12054
12063
|
},
|
|
12055
12064
|
role: o ? "button" : void 0,
|
|
12056
12065
|
tabIndex: o ? 0 : void 0,
|
|
12057
12066
|
children: [
|
|
12058
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", title:
|
|
12059
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: Ni(
|
|
12060
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: /* @__PURE__ */ e("span", { className: "cedros-admin-status-badge", children: Ai(
|
|
12061
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: _i(
|
|
12062
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", title:
|
|
12067
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", title: T.userId, children: Ls(T.userId) }),
|
|
12068
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: Ni(T.amountLamports) }),
|
|
12069
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: /* @__PURE__ */ e("span", { className: "cedros-admin-status-badge", children: Ai(T.status) }) }),
|
|
12070
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", children: _i(T.createdAt) }),
|
|
12071
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-deposit-td", title: T.txSignature || void 0, children: T.txSignature ? Ls(T.txSignature) : "—" })
|
|
12063
12072
|
]
|
|
12064
12073
|
},
|
|
12065
|
-
|
|
12074
|
+
T.id
|
|
12066
12075
|
))
|
|
12067
12076
|
] }),
|
|
12068
|
-
|
|
12077
|
+
M > 1 && /* @__PURE__ */ i("div", { className: "cedros-admin-pagination", children: [
|
|
12069
12078
|
/* @__PURE__ */ e(
|
|
12070
12079
|
"button",
|
|
12071
12080
|
{
|
|
12072
12081
|
type: "button",
|
|
12073
12082
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12074
|
-
onClick: () =>
|
|
12075
|
-
disabled:
|
|
12083
|
+
onClick: () => L(D - 1),
|
|
12084
|
+
disabled: D <= 1,
|
|
12076
12085
|
children: "Previous"
|
|
12077
12086
|
}
|
|
12078
12087
|
),
|
|
12079
12088
|
/* @__PURE__ */ i("span", { className: "cedros-admin-page-info", children: [
|
|
12080
12089
|
"Page ",
|
|
12081
|
-
x,
|
|
12082
|
-
" of ",
|
|
12083
12090
|
D,
|
|
12091
|
+
" of ",
|
|
12092
|
+
M,
|
|
12084
12093
|
" (",
|
|
12085
12094
|
h,
|
|
12086
12095
|
" total)"
|
|
@@ -12090,8 +12099,8 @@ function Si({
|
|
|
12090
12099
|
{
|
|
12091
12100
|
type: "button",
|
|
12092
12101
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12093
|
-
onClick: () =>
|
|
12094
|
-
disabled:
|
|
12102
|
+
onClick: () => L(D + 1),
|
|
12103
|
+
disabled: D >= M,
|
|
12095
12104
|
children: "Next"
|
|
12096
12105
|
}
|
|
12097
12106
|
)
|
|
@@ -12137,9 +12146,9 @@ function Ei({
|
|
|
12137
12146
|
isLoading: g,
|
|
12138
12147
|
error: m,
|
|
12139
12148
|
clearError: h
|
|
12140
|
-
} = $e(), [y, f] = N([]), [p, v] = N(0), [
|
|
12141
|
-
E === F ?
|
|
12142
|
-
},
|
|
12149
|
+
} = $e(), [y, f] = N([]), [p, v] = N(0), [A, b] = N(0), [_, k] = N(null), [E, w] = N("withdrawalAvailableAt"), [P, x] = N("asc"), M = (F) => {
|
|
12150
|
+
E === F ? x(P === "asc" ? "desc" : "asc") : (w(F), x(F === "withdrawalAvailableAt" ? "asc" : "desc"));
|
|
12151
|
+
}, D = O(() => [...y].sort((F, W) => {
|
|
12143
12152
|
let $, H;
|
|
12144
12153
|
switch (E) {
|
|
12145
12154
|
case "userId":
|
|
@@ -12154,16 +12163,16 @@ function Ei({
|
|
|
12154
12163
|
default:
|
|
12155
12164
|
return 0;
|
|
12156
12165
|
}
|
|
12157
|
-
return $ < H ?
|
|
12158
|
-
}), [y, E,
|
|
12166
|
+
return $ < H ? P === "asc" ? -1 : 1 : $ > H ? P === "asc" ? 1 : -1 : 0;
|
|
12167
|
+
}), [y, E, P]), [L, S] = N(null), [T, R] = N(!1), [I, j] = N(null), [ee, ne] = N(null), V = C(async () => {
|
|
12159
12168
|
try {
|
|
12160
|
-
const F = await l({ limit: t, offset:
|
|
12161
|
-
f(F.deposits), v(F.total), a?.(F),
|
|
12169
|
+
const F = await l({ limit: t, offset: A });
|
|
12170
|
+
f(F.deposits), v(F.total), a?.(F), k(null);
|
|
12162
12171
|
} catch (F) {
|
|
12163
12172
|
const W = F && typeof F == "object" && "message" in F ? String(F.message) : "Failed to load pending withdrawals";
|
|
12164
|
-
|
|
12173
|
+
k(W);
|
|
12165
12174
|
}
|
|
12166
|
-
}, [t,
|
|
12175
|
+
}, [t, A, l, a]);
|
|
12167
12176
|
U(() => {
|
|
12168
12177
|
b(0);
|
|
12169
12178
|
}, [t]), U(() => {
|
|
@@ -12177,7 +12186,7 @@ function Ei({
|
|
|
12177
12186
|
const F = setTimeout(() => j(null), 5e3);
|
|
12178
12187
|
return () => clearTimeout(F);
|
|
12179
12188
|
}, [I]);
|
|
12180
|
-
const Y = Math.ceil(p / t), q = Math.floor(
|
|
12189
|
+
const Y = Math.ceil(p / t), q = Math.floor(A / t) + 1, Z = (F) => {
|
|
12181
12190
|
const W = (F - 1) * t;
|
|
12182
12191
|
b(Math.max(0, Math.min(W, Math.max(0, p - 1))));
|
|
12183
12192
|
}, ce = async (F, W = !1) => {
|
|
@@ -12237,14 +12246,14 @@ function Ei({
|
|
|
12237
12246
|
type: "button",
|
|
12238
12247
|
className: "cedros-button cedros-button-outline",
|
|
12239
12248
|
onClick: () => {
|
|
12240
|
-
h(),
|
|
12249
|
+
h(), k(null), V();
|
|
12241
12250
|
},
|
|
12242
12251
|
children: "Retry"
|
|
12243
12252
|
}
|
|
12244
12253
|
)
|
|
12245
12254
|
]
|
|
12246
12255
|
}
|
|
12247
|
-
) : g && y.length === 0 && !
|
|
12256
|
+
) : g && y.length === 0 && !L && !T ? /* @__PURE__ */ i(
|
|
12248
12257
|
"div",
|
|
12249
12258
|
{
|
|
12250
12259
|
className: `cedros-admin-withdrawal-queue cedros-admin-withdrawal-queue-loading ${r}`,
|
|
@@ -12305,8 +12314,8 @@ function Ei({
|
|
|
12305
12314
|
type: "button",
|
|
12306
12315
|
className: "cedros-button cedros-button-danger",
|
|
12307
12316
|
onClick: () => ce(ee, !0),
|
|
12308
|
-
disabled:
|
|
12309
|
-
children:
|
|
12317
|
+
disabled: L === ee.id,
|
|
12318
|
+
children: L === ee.id ? "Processing..." : "Process Early"
|
|
12310
12319
|
}
|
|
12311
12320
|
)
|
|
12312
12321
|
] })
|
|
@@ -12337,10 +12346,10 @@ function Ei({
|
|
|
12337
12346
|
type: "button",
|
|
12338
12347
|
className: "cedros-button cedros-button-outline cedros-button-sm cedros-admin-icon-button",
|
|
12339
12348
|
onClick: V,
|
|
12340
|
-
disabled: g ||
|
|
12349
|
+
disabled: g || T,
|
|
12341
12350
|
title: "Refresh queue",
|
|
12342
12351
|
"aria-label": "Refresh queue",
|
|
12343
|
-
children: g && !
|
|
12352
|
+
children: g && !T ? "..." : "↻"
|
|
12344
12353
|
}
|
|
12345
12354
|
),
|
|
12346
12355
|
/* @__PURE__ */ e(
|
|
@@ -12349,9 +12358,9 @@ function Ei({
|
|
|
12349
12358
|
type: "button",
|
|
12350
12359
|
className: "cedros-button cedros-button-primary cedros-button-sm",
|
|
12351
12360
|
onClick: le,
|
|
12352
|
-
disabled: g ||
|
|
12361
|
+
disabled: g || T || y.length === 0,
|
|
12353
12362
|
title: "Process all ready withdrawals",
|
|
12354
|
-
children:
|
|
12363
|
+
children: T ? "Processing..." : "Process All"
|
|
12355
12364
|
}
|
|
12356
12365
|
)
|
|
12357
12366
|
] })
|
|
@@ -12364,12 +12373,12 @@ function Ei({
|
|
|
12364
12373
|
{
|
|
12365
12374
|
type: "button",
|
|
12366
12375
|
className: `cedros-admin-sort-button ${E === "userId" ? "cedros-admin-sort-active" : ""}`,
|
|
12367
|
-
onClick: () =>
|
|
12376
|
+
onClick: () => M("userId"),
|
|
12368
12377
|
"aria-label": "Sort by user",
|
|
12369
12378
|
children: [
|
|
12370
12379
|
"User",
|
|
12371
12380
|
" ",
|
|
12372
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "userId" ?
|
|
12381
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "userId" ? P === "asc" ? "↑" : "↓" : "↕" })
|
|
12373
12382
|
]
|
|
12374
12383
|
}
|
|
12375
12384
|
) }),
|
|
@@ -12378,12 +12387,12 @@ function Ei({
|
|
|
12378
12387
|
{
|
|
12379
12388
|
type: "button",
|
|
12380
12389
|
className: `cedros-admin-sort-button ${E === "amountLamports" ? "cedros-admin-sort-active" : ""}`,
|
|
12381
|
-
onClick: () =>
|
|
12390
|
+
onClick: () => M("amountLamports"),
|
|
12382
12391
|
"aria-label": "Sort by amount",
|
|
12383
12392
|
children: [
|
|
12384
12393
|
"Amount",
|
|
12385
12394
|
" ",
|
|
12386
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "amountLamports" ?
|
|
12395
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "amountLamports" ? P === "asc" ? "↑" : "↓" : "↕" })
|
|
12387
12396
|
]
|
|
12388
12397
|
}
|
|
12389
12398
|
) }),
|
|
@@ -12392,20 +12401,20 @@ function Ei({
|
|
|
12392
12401
|
{
|
|
12393
12402
|
type: "button",
|
|
12394
12403
|
className: `cedros-admin-sort-button ${E === "withdrawalAvailableAt" ? "cedros-admin-sort-active" : ""}`,
|
|
12395
|
-
onClick: () =>
|
|
12404
|
+
onClick: () => M("withdrawalAvailableAt"),
|
|
12396
12405
|
"aria-label": "Sort by ready since",
|
|
12397
12406
|
children: [
|
|
12398
12407
|
"Ready Since",
|
|
12399
12408
|
" ",
|
|
12400
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "withdrawalAvailableAt" ?
|
|
12409
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: E === "withdrawalAvailableAt" ? P === "asc" ? "↑" : "↓" : "↕" })
|
|
12401
12410
|
]
|
|
12402
12411
|
}
|
|
12403
12412
|
) }),
|
|
12404
12413
|
/* @__PURE__ */ e("div", { className: "cedros-admin-withdrawal-th", children: "Waiting" }),
|
|
12405
12414
|
/* @__PURE__ */ e("div", { className: "cedros-admin-withdrawal-th cedros-admin-withdrawal-th-action", children: "Action" })
|
|
12406
12415
|
] }),
|
|
12407
|
-
|
|
12408
|
-
const W = Rs(F.withdrawalAvailableAt), $ =
|
|
12416
|
+
D.map((F) => {
|
|
12417
|
+
const W = Rs(F.withdrawalAvailableAt), $ = L === F.id;
|
|
12409
12418
|
return /* @__PURE__ */ i(
|
|
12410
12419
|
"div",
|
|
12411
12420
|
{
|
|
@@ -12429,7 +12438,7 @@ function Ei({
|
|
|
12429
12438
|
onClick: (H) => {
|
|
12430
12439
|
H.stopPropagation(), ce(F);
|
|
12431
12440
|
},
|
|
12432
|
-
disabled: $ ||
|
|
12441
|
+
disabled: $ || T,
|
|
12433
12442
|
title: W ? "Early withdrawal (requires confirmation)" : "Process this withdrawal",
|
|
12434
12443
|
children: $ ? "..." : W ? "Early" : "Process"
|
|
12435
12444
|
}
|
|
@@ -12510,27 +12519,27 @@ function Mi({
|
|
|
12510
12519
|
onLoad: a,
|
|
12511
12520
|
onItemClick: n
|
|
12512
12521
|
}) {
|
|
12513
|
-
const { listInPrivacyPeriod: o, isLoading: c, error: l, clearError: d } = $e(), [u, g] = N([]), [m, h] = N(0), [y, f] = N(0), [p, v] = N(null),
|
|
12522
|
+
const { listInPrivacyPeriod: o, isLoading: c, error: l, clearError: d } = $e(), [u, g] = N([]), [m, h] = N(0), [y, f] = N(0), [p, v] = N(null), A = C(async () => {
|
|
12514
12523
|
try {
|
|
12515
12524
|
const w = await o({ limit: t, offset: y });
|
|
12516
12525
|
g(w.deposits), h(w.total), a?.(w), v(null);
|
|
12517
12526
|
} catch (w) {
|
|
12518
|
-
const
|
|
12519
|
-
v(
|
|
12527
|
+
const P = w && typeof w == "object" && "message" in w ? String(w.message) : "Failed to load deposits";
|
|
12528
|
+
v(P);
|
|
12520
12529
|
}
|
|
12521
12530
|
}, [t, y, o, a]);
|
|
12522
12531
|
U(() => {
|
|
12523
12532
|
f(0);
|
|
12524
12533
|
}, [t]), U(() => {
|
|
12525
|
-
|
|
12526
|
-
}, [
|
|
12534
|
+
A();
|
|
12535
|
+
}, [A]), U(() => {
|
|
12527
12536
|
if (s <= 0) return;
|
|
12528
|
-
const w = setInterval(
|
|
12537
|
+
const w = setInterval(A, s);
|
|
12529
12538
|
return () => clearInterval(w);
|
|
12530
|
-
}, [s,
|
|
12531
|
-
const b = Math.ceil(m / t), _ = Math.floor(y / t) + 1,
|
|
12532
|
-
const
|
|
12533
|
-
f(Math.max(0, Math.min(
|
|
12539
|
+
}, [s, A]);
|
|
12540
|
+
const b = Math.ceil(m / t), _ = Math.floor(y / t) + 1, k = (w) => {
|
|
12541
|
+
const P = (w - 1) * t;
|
|
12542
|
+
f(Math.max(0, Math.min(P, Math.max(0, m - 1))));
|
|
12534
12543
|
}, E = p || l;
|
|
12535
12544
|
return E ? /* @__PURE__ */ i(
|
|
12536
12545
|
"div",
|
|
@@ -12544,7 +12553,7 @@ function Mi({
|
|
|
12544
12553
|
type: "button",
|
|
12545
12554
|
className: "cedros-button cedros-button-outline",
|
|
12546
12555
|
onClick: () => {
|
|
12547
|
-
d(), v(null),
|
|
12556
|
+
d(), v(null), A();
|
|
12548
12557
|
},
|
|
12549
12558
|
children: "Retry"
|
|
12550
12559
|
}
|
|
@@ -12574,7 +12583,7 @@ function Mi({
|
|
|
12574
12583
|
{
|
|
12575
12584
|
type: "button",
|
|
12576
12585
|
className: "cedros-button cedros-button-outline cedros-button-sm cedros-admin-icon-button",
|
|
12577
|
-
onClick:
|
|
12586
|
+
onClick: A,
|
|
12578
12587
|
disabled: c,
|
|
12579
12588
|
title: "Refresh list",
|
|
12580
12589
|
"aria-label": "Refresh list",
|
|
@@ -12640,8 +12649,8 @@ function Mi({
|
|
|
12640
12649
|
{
|
|
12641
12650
|
className: "cedros-admin-privacy-row",
|
|
12642
12651
|
onClick: () => n?.(w),
|
|
12643
|
-
onKeyDown: (
|
|
12644
|
-
(
|
|
12652
|
+
onKeyDown: (P) => {
|
|
12653
|
+
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), n?.(w));
|
|
12645
12654
|
},
|
|
12646
12655
|
role: n ? "button" : void 0,
|
|
12647
12656
|
tabIndex: n ? 0 : void 0,
|
|
@@ -12661,7 +12670,7 @@ function Mi({
|
|
|
12661
12670
|
{
|
|
12662
12671
|
type: "button",
|
|
12663
12672
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12664
|
-
onClick: () =>
|
|
12673
|
+
onClick: () => k(_ - 1),
|
|
12665
12674
|
disabled: _ <= 1,
|
|
12666
12675
|
children: "Previous"
|
|
12667
12676
|
}
|
|
@@ -12680,7 +12689,7 @@ function Mi({
|
|
|
12680
12689
|
{
|
|
12681
12690
|
type: "button",
|
|
12682
12691
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12683
|
-
onClick: () =>
|
|
12692
|
+
onClick: () => k(_ + 1),
|
|
12684
12693
|
disabled: _ >= b,
|
|
12685
12694
|
children: "Next"
|
|
12686
12695
|
}
|
|
@@ -12714,62 +12723,62 @@ function Fi({
|
|
|
12714
12723
|
onLoad: a,
|
|
12715
12724
|
onItemClick: n
|
|
12716
12725
|
}) {
|
|
12717
|
-
const { listDeposits: o, isLoading: c, error: l, clearError: d } = $e(), [u, g] = N([]), [m, h] = N(0), [y, f] = N(0), [p, v] = N(null), [
|
|
12718
|
-
|
|
12719
|
-
}, w = O(() => [...u].sort((S,
|
|
12726
|
+
const { listDeposits: o, isLoading: c, error: l, clearError: d } = $e(), [u, g] = N([]), [m, h] = N(0), [y, f] = N(0), [p, v] = N(null), [A, b] = N("completedAt"), [_, k] = N("desc"), E = (S) => {
|
|
12727
|
+
A === S ? k(_ === "asc" ? "desc" : "asc") : (b(S), k("desc"));
|
|
12728
|
+
}, w = O(() => [...u].sort((S, T) => {
|
|
12720
12729
|
let R, I;
|
|
12721
|
-
switch (
|
|
12730
|
+
switch (A) {
|
|
12722
12731
|
case "userId":
|
|
12723
|
-
R = S.userId.toLowerCase(), I =
|
|
12732
|
+
R = S.userId.toLowerCase(), I = T.userId.toLowerCase();
|
|
12724
12733
|
break;
|
|
12725
12734
|
case "amountLamports":
|
|
12726
|
-
R = S.amountLamports ?? 0, I =
|
|
12735
|
+
R = S.amountLamports ?? 0, I = T.amountLamports ?? 0;
|
|
12727
12736
|
break;
|
|
12728
12737
|
case "completedAt":
|
|
12729
|
-
R = S.completedAt ? new Date(S.completedAt).getTime() : 0, I =
|
|
12738
|
+
R = S.completedAt ? new Date(S.completedAt).getTime() : 0, I = T.completedAt ? new Date(T.completedAt).getTime() : 0;
|
|
12730
12739
|
break;
|
|
12731
12740
|
case "withdrawalTxSignature":
|
|
12732
|
-
R = S.withdrawalTxSignature || "", I =
|
|
12741
|
+
R = S.withdrawalTxSignature || "", I = T.withdrawalTxSignature || "";
|
|
12733
12742
|
break;
|
|
12734
12743
|
default:
|
|
12735
12744
|
return 0;
|
|
12736
12745
|
}
|
|
12737
12746
|
return R < I ? _ === "asc" ? -1 : 1 : R > I ? _ === "asc" ? 1 : -1 : 0;
|
|
12738
|
-
}), [u,
|
|
12747
|
+
}), [u, A, _]), P = C(async () => {
|
|
12739
12748
|
try {
|
|
12740
12749
|
const S = await o({ status: "withdrawn", limit: t, offset: y });
|
|
12741
12750
|
g(S.deposits), h(S.total), a?.(S), v(null);
|
|
12742
12751
|
} catch (S) {
|
|
12743
|
-
const
|
|
12744
|
-
v(
|
|
12752
|
+
const T = S && typeof S == "object" && "message" in S ? String(S.message) : "Failed to load withdrawal history";
|
|
12753
|
+
v(T);
|
|
12745
12754
|
}
|
|
12746
12755
|
}, [t, y, o, a]);
|
|
12747
12756
|
U(() => {
|
|
12748
12757
|
f(0);
|
|
12749
12758
|
}, [t]), U(() => {
|
|
12750
|
-
|
|
12751
|
-
}, [
|
|
12759
|
+
P();
|
|
12760
|
+
}, [P]), U(() => {
|
|
12752
12761
|
if (s <= 0) return;
|
|
12753
|
-
const S = setInterval(
|
|
12762
|
+
const S = setInterval(P, s);
|
|
12754
12763
|
return () => clearInterval(S);
|
|
12755
|
-
}, [s,
|
|
12756
|
-
const
|
|
12757
|
-
const
|
|
12758
|
-
f(Math.max(0, Math.min(
|
|
12759
|
-
},
|
|
12760
|
-
return
|
|
12764
|
+
}, [s, P]);
|
|
12765
|
+
const x = Math.ceil(m / t), M = Math.floor(y / t) + 1, D = (S) => {
|
|
12766
|
+
const T = (S - 1) * t;
|
|
12767
|
+
f(Math.max(0, Math.min(T, Math.max(0, m - 1))));
|
|
12768
|
+
}, L = p || l;
|
|
12769
|
+
return L ? /* @__PURE__ */ i(
|
|
12761
12770
|
"div",
|
|
12762
12771
|
{
|
|
12763
12772
|
className: `cedros-admin-withdrawal-history cedros-admin-withdrawal-history-error ${r}`,
|
|
12764
12773
|
children: [
|
|
12765
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children:
|
|
12774
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children: L }),
|
|
12766
12775
|
/* @__PURE__ */ e(
|
|
12767
12776
|
"button",
|
|
12768
12777
|
{
|
|
12769
12778
|
type: "button",
|
|
12770
12779
|
className: "cedros-button cedros-button-outline",
|
|
12771
12780
|
onClick: () => {
|
|
12772
|
-
d(), v(null),
|
|
12781
|
+
d(), v(null), P();
|
|
12773
12782
|
},
|
|
12774
12783
|
children: "Retry"
|
|
12775
12784
|
}
|
|
@@ -12799,7 +12808,7 @@ function Fi({
|
|
|
12799
12808
|
{
|
|
12800
12809
|
type: "button",
|
|
12801
12810
|
className: "cedros-button cedros-button-outline cedros-button-sm cedros-admin-icon-button",
|
|
12802
|
-
onClick:
|
|
12811
|
+
onClick: P,
|
|
12803
12812
|
disabled: c,
|
|
12804
12813
|
title: "Refresh list",
|
|
12805
12814
|
"aria-label": "Refresh list",
|
|
@@ -12815,13 +12824,13 @@ function Fi({
|
|
|
12815
12824
|
"button",
|
|
12816
12825
|
{
|
|
12817
12826
|
type: "button",
|
|
12818
|
-
className: `cedros-admin-sort-button ${
|
|
12827
|
+
className: `cedros-admin-sort-button ${A === "userId" ? "cedros-admin-sort-active" : ""}`,
|
|
12819
12828
|
onClick: () => E("userId"),
|
|
12820
12829
|
"aria-label": "Sort by user",
|
|
12821
12830
|
children: [
|
|
12822
12831
|
"User",
|
|
12823
12832
|
" ",
|
|
12824
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children:
|
|
12833
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: A === "userId" ? _ === "asc" ? "↑" : "↓" : "↕" })
|
|
12825
12834
|
]
|
|
12826
12835
|
}
|
|
12827
12836
|
) }),
|
|
@@ -12829,13 +12838,13 @@ function Fi({
|
|
|
12829
12838
|
"button",
|
|
12830
12839
|
{
|
|
12831
12840
|
type: "button",
|
|
12832
|
-
className: `cedros-admin-sort-button ${
|
|
12841
|
+
className: `cedros-admin-sort-button ${A === "amountLamports" ? "cedros-admin-sort-active" : ""}`,
|
|
12833
12842
|
onClick: () => E("amountLamports"),
|
|
12834
12843
|
"aria-label": "Sort by amount",
|
|
12835
12844
|
children: [
|
|
12836
12845
|
"Amount",
|
|
12837
12846
|
" ",
|
|
12838
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children:
|
|
12847
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: A === "amountLamports" ? _ === "asc" ? "↑" : "↓" : "↕" })
|
|
12839
12848
|
]
|
|
12840
12849
|
}
|
|
12841
12850
|
) }),
|
|
@@ -12843,13 +12852,13 @@ function Fi({
|
|
|
12843
12852
|
"button",
|
|
12844
12853
|
{
|
|
12845
12854
|
type: "button",
|
|
12846
|
-
className: `cedros-admin-sort-button ${
|
|
12855
|
+
className: `cedros-admin-sort-button ${A === "completedAt" ? "cedros-admin-sort-active" : ""}`,
|
|
12847
12856
|
onClick: () => E("completedAt"),
|
|
12848
12857
|
"aria-label": "Sort by processed",
|
|
12849
12858
|
children: [
|
|
12850
12859
|
"Processed",
|
|
12851
12860
|
" ",
|
|
12852
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children:
|
|
12861
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: A === "completedAt" ? _ === "asc" ? "↑" : "↓" : "↕" })
|
|
12853
12862
|
]
|
|
12854
12863
|
}
|
|
12855
12864
|
) }),
|
|
@@ -12857,13 +12866,13 @@ function Fi({
|
|
|
12857
12866
|
"button",
|
|
12858
12867
|
{
|
|
12859
12868
|
type: "button",
|
|
12860
|
-
className: `cedros-admin-sort-button ${
|
|
12869
|
+
className: `cedros-admin-sort-button ${A === "withdrawalTxSignature" ? "cedros-admin-sort-active" : ""}`,
|
|
12861
12870
|
onClick: () => E("withdrawalTxSignature"),
|
|
12862
12871
|
"aria-label": "Sort by transaction",
|
|
12863
12872
|
children: [
|
|
12864
12873
|
"Transaction",
|
|
12865
12874
|
" ",
|
|
12866
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children:
|
|
12875
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-sort-icon", children: A === "withdrawalTxSignature" ? _ === "asc" ? "↑" : "↓" : "↕" })
|
|
12867
12876
|
]
|
|
12868
12877
|
}
|
|
12869
12878
|
) })
|
|
@@ -12873,8 +12882,8 @@ function Fi({
|
|
|
12873
12882
|
{
|
|
12874
12883
|
className: "cedros-admin-history-row",
|
|
12875
12884
|
onClick: () => n?.(S),
|
|
12876
|
-
onKeyDown: (
|
|
12877
|
-
(
|
|
12885
|
+
onKeyDown: (T) => {
|
|
12886
|
+
(T.key === "Enter" || T.key === " ") && (T.preventDefault(), n?.(S));
|
|
12878
12887
|
},
|
|
12879
12888
|
role: n ? "button" : void 0,
|
|
12880
12889
|
tabIndex: n ? 0 : void 0,
|
|
@@ -12889,7 +12898,7 @@ function Fi({
|
|
|
12889
12898
|
target: "_blank",
|
|
12890
12899
|
rel: "noopener noreferrer",
|
|
12891
12900
|
className: "cedros-admin-tx-link",
|
|
12892
|
-
onClick: (
|
|
12901
|
+
onClick: (T) => T.stopPropagation(),
|
|
12893
12902
|
title: S.withdrawalTxSignature,
|
|
12894
12903
|
children: Ii(S.withdrawalTxSignature)
|
|
12895
12904
|
}
|
|
@@ -12899,22 +12908,22 @@ function Fi({
|
|
|
12899
12908
|
S.id
|
|
12900
12909
|
))
|
|
12901
12910
|
] }),
|
|
12902
|
-
|
|
12911
|
+
x > 1 && /* @__PURE__ */ i("div", { className: "cedros-admin-pagination", children: [
|
|
12903
12912
|
/* @__PURE__ */ e(
|
|
12904
12913
|
"button",
|
|
12905
12914
|
{
|
|
12906
12915
|
type: "button",
|
|
12907
12916
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12908
|
-
onClick: () =>
|
|
12909
|
-
disabled:
|
|
12917
|
+
onClick: () => D(M - 1),
|
|
12918
|
+
disabled: M <= 1,
|
|
12910
12919
|
children: "Previous"
|
|
12911
12920
|
}
|
|
12912
12921
|
),
|
|
12913
12922
|
/* @__PURE__ */ i("span", { className: "cedros-admin-page-info", children: [
|
|
12914
12923
|
"Page ",
|
|
12915
|
-
D,
|
|
12916
|
-
" of ",
|
|
12917
12924
|
M,
|
|
12925
|
+
" of ",
|
|
12926
|
+
x,
|
|
12918
12927
|
" (",
|
|
12919
12928
|
m,
|
|
12920
12929
|
" total)"
|
|
@@ -12924,8 +12933,8 @@ function Fi({
|
|
|
12924
12933
|
{
|
|
12925
12934
|
type: "button",
|
|
12926
12935
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
12927
|
-
onClick: () =>
|
|
12928
|
-
disabled:
|
|
12936
|
+
onClick: () => D(M + 1),
|
|
12937
|
+
disabled: M >= x,
|
|
12929
12938
|
children: "Next"
|
|
12930
12939
|
}
|
|
12931
12940
|
)
|
|
@@ -12954,33 +12963,33 @@ function qi({
|
|
|
12954
12963
|
onLoad: n,
|
|
12955
12964
|
onUserClick: o
|
|
12956
12965
|
}) {
|
|
12957
|
-
const { users: c, total: l, isLoading: d, error: u, listUsers: g, clearError: m } = ls(), [h, y] = N(0), [f, p] = N(null), [v,
|
|
12958
|
-
v ===
|
|
12959
|
-
}, E = O(() => [...c].sort((
|
|
12960
|
-
let S,
|
|
12966
|
+
const { users: c, total: l, isLoading: d, error: u, listUsers: g, clearError: m } = ls(), [h, y] = N(0), [f, p] = N(null), [v, A] = N("createdAt"), [b, _] = N("desc"), k = (D) => {
|
|
12967
|
+
v === D ? _(b === "asc" ? "desc" : "asc") : (A(D), _("desc"));
|
|
12968
|
+
}, E = O(() => [...c].sort((D, L) => {
|
|
12969
|
+
let S, T;
|
|
12961
12970
|
switch (v) {
|
|
12962
12971
|
case "name":
|
|
12963
|
-
S = (
|
|
12972
|
+
S = (D.name || D.email || "").toLowerCase(), T = (L.name || L.email || "").toLowerCase();
|
|
12964
12973
|
break;
|
|
12965
12974
|
case "createdAt":
|
|
12966
|
-
S = new Date(
|
|
12975
|
+
S = new Date(D.createdAt).getTime(), T = new Date(L.createdAt).getTime();
|
|
12967
12976
|
break;
|
|
12968
12977
|
case "lastLoginAt":
|
|
12969
|
-
S =
|
|
12978
|
+
S = D.lastLoginAt ? new Date(D.lastLoginAt).getTime() : 0, T = L.lastLoginAt ? new Date(L.lastLoginAt).getTime() : 0;
|
|
12970
12979
|
break;
|
|
12971
12980
|
case "balanceLamports":
|
|
12972
|
-
S =
|
|
12981
|
+
S = D.balanceLamports ?? 0, T = L.balanceLamports ?? 0;
|
|
12973
12982
|
break;
|
|
12974
12983
|
default:
|
|
12975
12984
|
return 0;
|
|
12976
12985
|
}
|
|
12977
|
-
return S <
|
|
12986
|
+
return S < T ? b === "asc" ? -1 : 1 : S > T ? b === "asc" ? 1 : -1 : 0;
|
|
12978
12987
|
}), [c, v, b]), w = C(async () => {
|
|
12979
12988
|
try {
|
|
12980
|
-
const
|
|
12981
|
-
n?.(
|
|
12982
|
-
} catch (
|
|
12983
|
-
p(
|
|
12989
|
+
const D = await g({ limit: t, offset: h });
|
|
12990
|
+
n?.(D), p(null);
|
|
12991
|
+
} catch (D) {
|
|
12992
|
+
p(D instanceof Error ? D.message : "Failed to load users");
|
|
12984
12993
|
}
|
|
12985
12994
|
}, [t, h, g, n]);
|
|
12986
12995
|
U(() => {
|
|
@@ -12989,12 +12998,12 @@ function qi({
|
|
|
12989
12998
|
w();
|
|
12990
12999
|
}, [w]), U(() => {
|
|
12991
13000
|
if (s <= 0) return;
|
|
12992
|
-
const
|
|
12993
|
-
return () => clearInterval(
|
|
13001
|
+
const D = setInterval(w, s);
|
|
13002
|
+
return () => clearInterval(D);
|
|
12994
13003
|
}, [s, w]);
|
|
12995
|
-
const
|
|
12996
|
-
const
|
|
12997
|
-
y(Math.max(0, Math.min(
|
|
13004
|
+
const P = Math.ceil(l / t), x = Math.floor(h / t) + 1, M = (D) => {
|
|
13005
|
+
const L = (D - 1) * t;
|
|
13006
|
+
y(Math.max(0, Math.min(L, Math.max(0, l - 1))));
|
|
12998
13007
|
};
|
|
12999
13008
|
return f || u ? /* @__PURE__ */ i("div", { className: `cedros-admin-user-list cedros-admin-user-list-error ${a}`, children: [
|
|
13000
13009
|
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children: f || u?.message }),
|
|
@@ -13043,7 +13052,7 @@ function qi({
|
|
|
13043
13052
|
{
|
|
13044
13053
|
type: "button",
|
|
13045
13054
|
className: `cedros-admin-sort-button ${v === "name" ? "cedros-admin-sort-active" : ""}`,
|
|
13046
|
-
onClick: () =>
|
|
13055
|
+
onClick: () => k("name"),
|
|
13047
13056
|
"aria-label": "Sort by user",
|
|
13048
13057
|
children: [
|
|
13049
13058
|
"User",
|
|
@@ -13057,7 +13066,7 @@ function qi({
|
|
|
13057
13066
|
{
|
|
13058
13067
|
type: "button",
|
|
13059
13068
|
className: `cedros-admin-sort-button ${v === "createdAt" ? "cedros-admin-sort-active" : ""}`,
|
|
13060
|
-
onClick: () =>
|
|
13069
|
+
onClick: () => k("createdAt"),
|
|
13061
13070
|
"aria-label": "Sort by registered date",
|
|
13062
13071
|
children: [
|
|
13063
13072
|
"Registered",
|
|
@@ -13071,7 +13080,7 @@ function qi({
|
|
|
13071
13080
|
{
|
|
13072
13081
|
type: "button",
|
|
13073
13082
|
className: `cedros-admin-sort-button ${v === "lastLoginAt" ? "cedros-admin-sort-active" : ""}`,
|
|
13074
|
-
onClick: () =>
|
|
13083
|
+
onClick: () => k("lastLoginAt"),
|
|
13075
13084
|
"aria-label": "Sort by last login",
|
|
13076
13085
|
children: [
|
|
13077
13086
|
"Last Login",
|
|
@@ -13085,7 +13094,7 @@ function qi({
|
|
|
13085
13094
|
{
|
|
13086
13095
|
type: "button",
|
|
13087
13096
|
className: `cedros-admin-sort-button ${v === "balanceLamports" ? "cedros-admin-sort-active" : ""}`,
|
|
13088
|
-
onClick: () =>
|
|
13097
|
+
onClick: () => k("balanceLamports"),
|
|
13089
13098
|
"aria-label": "Sort by balance",
|
|
13090
13099
|
children: [
|
|
13091
13100
|
"Balance",
|
|
@@ -13095,62 +13104,62 @@ function qi({
|
|
|
13095
13104
|
}
|
|
13096
13105
|
) })
|
|
13097
13106
|
] }),
|
|
13098
|
-
E.map((
|
|
13099
|
-
const
|
|
13107
|
+
E.map((D) => {
|
|
13108
|
+
const L = D.id === r;
|
|
13100
13109
|
return /* @__PURE__ */ i(
|
|
13101
13110
|
"div",
|
|
13102
13111
|
{
|
|
13103
|
-
className: `cedros-admin-user-row ${
|
|
13104
|
-
onClick: () => o?.(
|
|
13112
|
+
className: `cedros-admin-user-row ${L ? "cedros-admin-user-row-current" : ""}`,
|
|
13113
|
+
onClick: () => o?.(D),
|
|
13105
13114
|
onKeyDown: (S) => {
|
|
13106
|
-
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), o?.(
|
|
13115
|
+
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), o?.(D));
|
|
13107
13116
|
},
|
|
13108
13117
|
role: o ? "button" : void 0,
|
|
13109
13118
|
tabIndex: o ? 0 : void 0,
|
|
13110
13119
|
children: [
|
|
13111
13120
|
/* @__PURE__ */ i("div", { className: "cedros-admin-user-td cedros-admin-user-info", children: [
|
|
13112
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-user-avatar", children:
|
|
13121
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-user-avatar", children: D.picture ? /* @__PURE__ */ e(
|
|
13113
13122
|
"img",
|
|
13114
13123
|
{
|
|
13115
|
-
src:
|
|
13116
|
-
alt:
|
|
13124
|
+
src: D.picture,
|
|
13125
|
+
alt: D.name || D.email || "User",
|
|
13117
13126
|
className: "cedros-admin-user-avatar-img",
|
|
13118
13127
|
referrerPolicy: "no-referrer"
|
|
13119
13128
|
}
|
|
13120
|
-
) : /* @__PURE__ */ e("span", { className: "cedros-admin-user-avatar-placeholder", children: (
|
|
13129
|
+
) : /* @__PURE__ */ e("span", { className: "cedros-admin-user-avatar-placeholder", children: (D.name?.[0] || D.email?.[0] || "?").toUpperCase() }) }),
|
|
13121
13130
|
/* @__PURE__ */ i("div", { className: "cedros-admin-user-details", children: [
|
|
13122
13131
|
/* @__PURE__ */ i("span", { className: "cedros-admin-user-name", children: [
|
|
13123
|
-
|
|
13124
|
-
|
|
13132
|
+
D.name || "Unknown",
|
|
13133
|
+
L && /* @__PURE__ */ e("span", { className: "cedros-admin-user-you", children: "(you)" })
|
|
13125
13134
|
] }),
|
|
13126
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-user-email", title:
|
|
13135
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-user-email", title: D.email, children: D.email || Bi(D.id) })
|
|
13127
13136
|
] })
|
|
13128
13137
|
] }),
|
|
13129
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children: Is(
|
|
13130
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children:
|
|
13131
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children: Oi(
|
|
13138
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children: Is(D.createdAt) }),
|
|
13139
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children: D.lastLoginAt ? Is(D.lastLoginAt) : "-" }),
|
|
13140
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-user-td", children: Oi(D.balanceLamports) })
|
|
13132
13141
|
]
|
|
13133
13142
|
},
|
|
13134
|
-
|
|
13143
|
+
D.id
|
|
13135
13144
|
);
|
|
13136
13145
|
})
|
|
13137
13146
|
] }),
|
|
13138
|
-
|
|
13147
|
+
P > 1 && /* @__PURE__ */ i("div", { className: "cedros-admin-pagination", children: [
|
|
13139
13148
|
/* @__PURE__ */ e(
|
|
13140
13149
|
"button",
|
|
13141
13150
|
{
|
|
13142
13151
|
type: "button",
|
|
13143
13152
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
13144
|
-
onClick: () =>
|
|
13145
|
-
disabled:
|
|
13153
|
+
onClick: () => M(x - 1),
|
|
13154
|
+
disabled: x <= 1,
|
|
13146
13155
|
children: "Previous"
|
|
13147
13156
|
}
|
|
13148
13157
|
),
|
|
13149
13158
|
/* @__PURE__ */ i("span", { className: "cedros-admin-page-info", children: [
|
|
13150
13159
|
"Page ",
|
|
13151
|
-
|
|
13160
|
+
x,
|
|
13152
13161
|
" of ",
|
|
13153
|
-
|
|
13162
|
+
P,
|
|
13154
13163
|
" (",
|
|
13155
13164
|
l,
|
|
13156
13165
|
" total)"
|
|
@@ -13160,8 +13169,8 @@ function qi({
|
|
|
13160
13169
|
{
|
|
13161
13170
|
type: "button",
|
|
13162
13171
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
13163
|
-
onClick: () =>
|
|
13164
|
-
disabled:
|
|
13172
|
+
onClick: () => M(x + 1),
|
|
13173
|
+
disabled: x >= P,
|
|
13165
13174
|
children: "Next"
|
|
13166
13175
|
}
|
|
13167
13176
|
)
|
|
@@ -13234,17 +13243,17 @@ function zi({
|
|
|
13234
13243
|
deleteUser: h,
|
|
13235
13244
|
forcePasswordReset: y,
|
|
13236
13245
|
clearError: f
|
|
13237
|
-
} = ls(), [p, v] = N(null), [
|
|
13246
|
+
} = ls(), [p, v] = N(null), [A, b] = N(null), [_, k] = N(null), [E, w] = N(null), [P, x] = N("deposits"), [M, D] = N(null), [L, S] = N(null), [T, R] = N(null), [I, j] = N(null), [ee, ne] = N(!1), [V, Y] = N(0), [q, Z] = N(0), [ce, le] = N(0), te = 10, F = C(async () => {
|
|
13238
13247
|
try {
|
|
13239
13248
|
const J = await d(t);
|
|
13240
|
-
v(J),
|
|
13249
|
+
v(J), D(null);
|
|
13241
13250
|
} catch (J) {
|
|
13242
|
-
|
|
13251
|
+
D(J instanceof Error ? J.message : "Failed to load user");
|
|
13243
13252
|
}
|
|
13244
13253
|
}, [t, d]), W = C(async () => {
|
|
13245
13254
|
try {
|
|
13246
13255
|
const Ae = await u(t, { limit: te, offset: V });
|
|
13247
|
-
|
|
13256
|
+
k(Ae), R(null);
|
|
13248
13257
|
} catch (J) {
|
|
13249
13258
|
R(J instanceof Error ? J.message : "Failed to load deposits");
|
|
13250
13259
|
}
|
|
@@ -13302,14 +13311,14 @@ function zi({
|
|
|
13302
13311
|
ne(!1);
|
|
13303
13312
|
}
|
|
13304
13313
|
}
|
|
13305
|
-
}, Ke = _ ? Math.ceil(_.total / te) : 0, We = Math.floor(V / te) + 1, Ce =
|
|
13314
|
+
}, Ke = _ ? Math.ceil(_.total / te) : 0, We = Math.floor(V / te) + 1, Ce = A ? Math.ceil(A.totalTransactions / te) : 0, bt = Math.floor(q / te) + 1, je = (J) => {
|
|
13306
13315
|
Y((J - 1) * te);
|
|
13307
13316
|
}, xe = (J) => {
|
|
13308
13317
|
Z((J - 1) * te);
|
|
13309
13318
|
}, Ge = E ? Math.ceil(E.total / te) : 0, wt = Math.floor(ce / te) + 1, vt = (J) => {
|
|
13310
13319
|
le((J - 1) * te);
|
|
13311
13320
|
};
|
|
13312
|
-
if (
|
|
13321
|
+
if (M)
|
|
13313
13322
|
return /* @__PURE__ */ i("div", { className: `cedros-admin-user-detail cedros-admin-user-detail-error ${c}`, children: [
|
|
13314
13323
|
/* @__PURE__ */ e(
|
|
13315
13324
|
"button",
|
|
@@ -13320,14 +13329,14 @@ function zi({
|
|
|
13320
13329
|
children: "Back"
|
|
13321
13330
|
}
|
|
13322
13331
|
),
|
|
13323
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children:
|
|
13332
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children: M }),
|
|
13324
13333
|
/* @__PURE__ */ e(
|
|
13325
13334
|
"button",
|
|
13326
13335
|
{
|
|
13327
13336
|
type: "button",
|
|
13328
13337
|
className: "cedros-button cedros-button-outline",
|
|
13329
13338
|
onClick: () => {
|
|
13330
|
-
f(),
|
|
13339
|
+
f(), D(null), F();
|
|
13331
13340
|
},
|
|
13332
13341
|
children: "Retry"
|
|
13333
13342
|
}
|
|
@@ -13445,8 +13454,8 @@ function zi({
|
|
|
13445
13454
|
] })
|
|
13446
13455
|
] })
|
|
13447
13456
|
] }),
|
|
13448
|
-
|
|
13449
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
13457
|
+
L ? /* @__PURE__ */ i("div", { className: "cedros-admin-stats-error", children: [
|
|
13458
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: L }),
|
|
13450
13459
|
/* @__PURE__ */ e(
|
|
13451
13460
|
"button",
|
|
13452
13461
|
{
|
|
@@ -13458,26 +13467,26 @@ function zi({
|
|
|
13458
13467
|
children: "Retry"
|
|
13459
13468
|
}
|
|
13460
13469
|
)
|
|
13461
|
-
] }) :
|
|
13470
|
+
] }) : A ? /* @__PURE__ */ i("div", { className: "cedros-admin-user-detail-stats", children: [
|
|
13462
13471
|
/* @__PURE__ */ i("div", { className: "cedros-admin-stat-card", children: [
|
|
13463
13472
|
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-label", children: "Credit Balance" }),
|
|
13464
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(
|
|
13473
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(A.stats.currentBalanceLamports) })
|
|
13465
13474
|
] }),
|
|
13466
13475
|
/* @__PURE__ */ i("div", { className: "cedros-admin-stat-card", children: [
|
|
13467
13476
|
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-label", children: "Total Credited" }),
|
|
13468
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(
|
|
13477
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(A.stats.totalDepositedLamports) })
|
|
13469
13478
|
] }),
|
|
13470
13479
|
/* @__PURE__ */ i("div", { className: "cedros-admin-stat-card", children: [
|
|
13471
13480
|
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-label", children: "Total Spent" }),
|
|
13472
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(
|
|
13481
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: nt(A.stats.totalSpentLamports) })
|
|
13473
13482
|
] }),
|
|
13474
13483
|
/* @__PURE__ */ i("div", { className: "cedros-admin-stat-card", children: [
|
|
13475
13484
|
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-label", children: "Deposits" }),
|
|
13476
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children:
|
|
13485
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: A.stats.depositCount })
|
|
13477
13486
|
] }),
|
|
13478
13487
|
/* @__PURE__ */ i("div", { className: "cedros-admin-stat-card", children: [
|
|
13479
13488
|
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-label", children: "Transactions" }),
|
|
13480
|
-
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children:
|
|
13489
|
+
/* @__PURE__ */ e("span", { className: "cedros-admin-stat-value", children: A.stats.spendCount })
|
|
13481
13490
|
] })
|
|
13482
13491
|
] }) : /* @__PURE__ */ i("div", { className: "cedros-admin-stats-loading", children: [
|
|
13483
13492
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
@@ -13488,8 +13497,8 @@ function zi({
|
|
|
13488
13497
|
"button",
|
|
13489
13498
|
{
|
|
13490
13499
|
type: "button",
|
|
13491
|
-
className: `cedros-admin-tab ${
|
|
13492
|
-
onClick: () =>
|
|
13500
|
+
className: `cedros-admin-tab ${P === "deposits" ? "cedros-admin-tab-active" : ""}`,
|
|
13501
|
+
onClick: () => x("deposits"),
|
|
13493
13502
|
children: [
|
|
13494
13503
|
"Deposits (",
|
|
13495
13504
|
_?.total ?? 0,
|
|
@@ -13501,11 +13510,11 @@ function zi({
|
|
|
13501
13510
|
"button",
|
|
13502
13511
|
{
|
|
13503
13512
|
type: "button",
|
|
13504
|
-
className: `cedros-admin-tab ${
|
|
13505
|
-
onClick: () =>
|
|
13513
|
+
className: `cedros-admin-tab ${P === "transactions" ? "cedros-admin-tab-active" : ""}`,
|
|
13514
|
+
onClick: () => x("transactions"),
|
|
13506
13515
|
children: [
|
|
13507
13516
|
"Credits (",
|
|
13508
|
-
|
|
13517
|
+
A?.totalTransactions ?? 0,
|
|
13509
13518
|
")"
|
|
13510
13519
|
]
|
|
13511
13520
|
}
|
|
@@ -13514,8 +13523,8 @@ function zi({
|
|
|
13514
13523
|
"button",
|
|
13515
13524
|
{
|
|
13516
13525
|
type: "button",
|
|
13517
|
-
className: `cedros-admin-tab ${
|
|
13518
|
-
onClick: () =>
|
|
13526
|
+
className: `cedros-admin-tab ${P === "chats" ? "cedros-admin-tab-active" : ""}`,
|
|
13527
|
+
onClick: () => x("chats"),
|
|
13519
13528
|
children: [
|
|
13520
13529
|
"Chats (",
|
|
13521
13530
|
E?.total ?? 0,
|
|
@@ -13525,7 +13534,7 @@ function zi({
|
|
|
13525
13534
|
)
|
|
13526
13535
|
] }),
|
|
13527
13536
|
/* @__PURE__ */ i("div", { className: "cedros-admin-user-detail-content", children: [
|
|
13528
|
-
|
|
13537
|
+
P === "deposits" && /* @__PURE__ */ e(
|
|
13529
13538
|
Vi,
|
|
13530
13539
|
{
|
|
13531
13540
|
deposits: _?.deposits ?? [],
|
|
@@ -13534,28 +13543,28 @@ function zi({
|
|
|
13534
13543
|
totalPages: Ke,
|
|
13535
13544
|
onPageChange: je,
|
|
13536
13545
|
isLoading: l,
|
|
13537
|
-
error:
|
|
13546
|
+
error: T,
|
|
13538
13547
|
onRetry: () => {
|
|
13539
13548
|
R(null), W();
|
|
13540
13549
|
}
|
|
13541
13550
|
}
|
|
13542
13551
|
),
|
|
13543
|
-
|
|
13552
|
+
P === "transactions" && /* @__PURE__ */ e(
|
|
13544
13553
|
Hi,
|
|
13545
13554
|
{
|
|
13546
|
-
transactions:
|
|
13547
|
-
total:
|
|
13555
|
+
transactions: A?.transactions ?? [],
|
|
13556
|
+
total: A?.totalTransactions ?? 0,
|
|
13548
13557
|
currentPage: bt,
|
|
13549
13558
|
totalPages: Ce,
|
|
13550
13559
|
onPageChange: xe,
|
|
13551
|
-
error:
|
|
13560
|
+
error: L,
|
|
13552
13561
|
onRetry: () => {
|
|
13553
13562
|
S(null), $();
|
|
13554
13563
|
},
|
|
13555
13564
|
isLoading: l
|
|
13556
13565
|
}
|
|
13557
13566
|
),
|
|
13558
|
-
|
|
13567
|
+
P === "chats" && o && /* @__PURE__ */ e(
|
|
13559
13568
|
Qi,
|
|
13560
13569
|
{
|
|
13561
13570
|
sessions: E?.sessions ?? [],
|
|
@@ -13823,14 +13832,14 @@ function Ki({ userRole: t }) {
|
|
|
13823
13832
|
}, []);
|
|
13824
13833
|
const y = C(
|
|
13825
13834
|
(f, p, v) => {
|
|
13826
|
-
const
|
|
13835
|
+
const A = {
|
|
13827
13836
|
...s,
|
|
13828
13837
|
[f]: {
|
|
13829
13838
|
...s[f],
|
|
13830
13839
|
[p]: v
|
|
13831
13840
|
}
|
|
13832
13841
|
};
|
|
13833
|
-
h(
|
|
13842
|
+
h(A);
|
|
13834
13843
|
},
|
|
13835
13844
|
[s, h]
|
|
13836
13845
|
);
|
|
@@ -14253,17 +14262,17 @@ function jc({
|
|
|
14253
14262
|
onLogoutClick: l,
|
|
14254
14263
|
className: d = ""
|
|
14255
14264
|
}) {
|
|
14256
|
-
const [u, g] = N(r), [m, h] = N(!0), { user: y, logout: f } = ae(), { activeOrg: p, role: v, isLoading:
|
|
14265
|
+
const [u, g] = N(r), [m, h] = N(!0), { user: y, logout: f } = ae(), { activeOrg: p, role: v, isLoading: A, fetchOrgs: b, hasPermission: _ } = is(), { status: k, isLoading: E, checkStatus: w } = jr(), { features: P, isLoading: x } = Hr(), { canAccess: M } = Qr(), D = C(
|
|
14257
14266
|
(I) => {
|
|
14258
14267
|
g(I), o?.(I);
|
|
14259
14268
|
},
|
|
14260
14269
|
[o]
|
|
14261
|
-
),
|
|
14270
|
+
), L = Gi.filter((I) => !(!s.includes(I.id) || I.requiredFeature && !P[I.requiredFeature] || !M(I.id))), S = L.find((I) => I.id === u), T = !S && !x;
|
|
14262
14271
|
return U(() => {
|
|
14263
14272
|
b(), w();
|
|
14264
14273
|
}, [b, w]), U(() => {
|
|
14265
|
-
|
|
14266
|
-
}, [
|
|
14274
|
+
T && L.length > 0 && g("users");
|
|
14275
|
+
}, [T, L.length]), !E && k?.needsSetup ? /* @__PURE__ */ e("div", { className: `cedros-admin cedros-dashboard cedros-dashboard--setup ${d}`, children: /* @__PURE__ */ e(Ro, { onComplete: () => w() }) }) : (A || E || x) && !p ? /* @__PURE__ */ i("div", { className: `cedros-admin cedros-dashboard cedros-dashboard--loading ${d}`, children: [
|
|
14267
14276
|
/* @__PURE__ */ e(G, {}),
|
|
14268
14277
|
/* @__PURE__ */ e("span", { className: "cedros-dashboard__loading-text", children: "Loading..." })
|
|
14269
14278
|
] }) : u === "team" && !p ? /* @__PURE__ */ e("div", { className: `cedros-admin cedros-dashboard ${d}`, children: /* @__PURE__ */ e(re, { error: "No organization selected. Please select an organization first." }) }) : /* @__PURE__ */ i("div", { className: `cedros-admin cedros-dashboard ${d}`, children: [
|
|
@@ -14275,12 +14284,12 @@ function jc({
|
|
|
14275
14284
|
/* @__PURE__ */ i("nav", { className: "cedros-dashboard__nav", children: [
|
|
14276
14285
|
/* @__PURE__ */ i("div", { className: "cedros-dashboard__nav-group", children: [
|
|
14277
14286
|
/* @__PURE__ */ e("span", { className: "cedros-dashboard__nav-label", children: "Menu" }),
|
|
14278
|
-
|
|
14287
|
+
L.filter((I) => !I.group).map((I) => /* @__PURE__ */ i(
|
|
14279
14288
|
"button",
|
|
14280
14289
|
{
|
|
14281
14290
|
type: "button",
|
|
14282
14291
|
className: `cedros-dashboard__nav-item ${u === I.id ? "cedros-dashboard__nav-item--active" : ""}`,
|
|
14283
|
-
onClick: () =>
|
|
14292
|
+
onClick: () => D(I.id),
|
|
14284
14293
|
"aria-current": u === I.id ? "page" : void 0,
|
|
14285
14294
|
children: [
|
|
14286
14295
|
/* @__PURE__ */ e("span", { className: "cedros-dashboard__nav-icon", children: I.icon }),
|
|
@@ -14290,7 +14299,7 @@ function jc({
|
|
|
14290
14299
|
I.id
|
|
14291
14300
|
))
|
|
14292
14301
|
] }),
|
|
14293
|
-
|
|
14302
|
+
L.some((I) => I.group === "Configuration") && /* @__PURE__ */ i("div", { className: "cedros-dashboard__nav-group", children: [
|
|
14294
14303
|
/* @__PURE__ */ i(
|
|
14295
14304
|
"button",
|
|
14296
14305
|
{
|
|
@@ -14304,12 +14313,12 @@ function jc({
|
|
|
14304
14313
|
]
|
|
14305
14314
|
}
|
|
14306
14315
|
),
|
|
14307
|
-
m &&
|
|
14316
|
+
m && L.filter((I) => I.group === "Configuration").map((I) => /* @__PURE__ */ i(
|
|
14308
14317
|
"button",
|
|
14309
14318
|
{
|
|
14310
14319
|
type: "button",
|
|
14311
14320
|
className: `cedros-dashboard__nav-item ${u === I.id ? "cedros-dashboard__nav-item--active" : ""}`,
|
|
14312
|
-
onClick: () =>
|
|
14321
|
+
onClick: () => D(I.id),
|
|
14313
14322
|
"aria-current": u === I.id ? "page" : void 0,
|
|
14314
14323
|
children: [
|
|
14315
14324
|
/* @__PURE__ */ e("span", { className: "cedros-dashboard__nav-icon", children: I.icon }),
|
|
@@ -14384,11 +14393,11 @@ function Yi({ pageSize: t, currentUserId: s }) {
|
|
|
14384
14393
|
U(() => {
|
|
14385
14394
|
v();
|
|
14386
14395
|
}, [v]);
|
|
14387
|
-
const
|
|
14396
|
+
const A = O(() => {
|
|
14388
14397
|
const b = [
|
|
14389
14398
|
{ label: "Total Users", value: n?.total ?? "—" }
|
|
14390
|
-
], _ = p("auth_email_enabled"),
|
|
14391
|
-
return _ && b.push({ label: "Email Users", value: n?.authMethodCounts.email ?? 0 }),
|
|
14399
|
+
], _ = p("auth_email_enabled"), k = p("auth_google_enabled"), E = p("auth_apple_enabled"), w = p("auth_solana_enabled"), P = p("auth_webauthn_enabled"), x = p("feature_sso");
|
|
14400
|
+
return _ && b.push({ label: "Email Users", value: n?.authMethodCounts.email ?? 0 }), k && b.push({ label: "Google Users", value: n?.authMethodCounts.google ?? 0 }), E && b.push({ label: "Apple Users", value: n?.authMethodCounts.apple ?? 0 }), w && b.push({ label: "Solana Users", value: n?.authMethodCounts.solana ?? 0 }), P && b.push({ label: "Passkey Users", value: n?.authMethodCounts.webauthn ?? 0 }), x && b.push({ label: "SSO Provider Users", value: n?.authMethodCounts.sso ?? 0 }), b;
|
|
14392
14401
|
}, [n, p]);
|
|
14393
14402
|
return r ? /* @__PURE__ */ e("div", { className: "cedros-dashboard__section", children: /* @__PURE__ */ e(
|
|
14394
14403
|
zi,
|
|
@@ -14398,7 +14407,7 @@ function Yi({ pageSize: t, currentUserId: s }) {
|
|
|
14398
14407
|
onBack: () => a(null)
|
|
14399
14408
|
}
|
|
14400
14409
|
) }) : /* @__PURE__ */ i("div", { className: "cedros-dashboard__section", children: [
|
|
14401
|
-
/* @__PURE__ */ e(He, { stats:
|
|
14410
|
+
/* @__PURE__ */ e(He, { stats: A, isLoading: c, onRefresh: v }),
|
|
14402
14411
|
d && /* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: d }),
|
|
14403
14412
|
/* @__PURE__ */ e(
|
|
14404
14413
|
qi,
|
|
@@ -14411,22 +14420,22 @@ function Yi({ pageSize: t, currentUserId: s }) {
|
|
|
14411
14420
|
] });
|
|
14412
14421
|
}
|
|
14413
14422
|
function Ji({ orgId: t, currentUserId: s, hasPermission: r, role: a }) {
|
|
14414
|
-
const [n, o] = N("members"), { members: c, isLoading: l, error: d, fetchMembers: u, updateMemberRole: g, removeMember: m } = hi(t), { invites: h, isLoading: y, error: f, fetchInvites: p, createInvite: v, cancelInvite:
|
|
14423
|
+
const [n, o] = N("members"), { members: c, isLoading: l, error: d, fetchMembers: u, updateMemberRole: g, removeMember: m } = hi(t), { invites: h, isLoading: y, error: f, fetchInvites: p, createInvite: v, cancelInvite: A, resendInvite: b } = pi(t);
|
|
14415
14424
|
U(() => {
|
|
14416
14425
|
u(), p();
|
|
14417
14426
|
}, [u, p]);
|
|
14418
|
-
const _ = r("invite:create"),
|
|
14419
|
-
(
|
|
14427
|
+
const _ = r("invite:create"), k = r("invite:cancel"), E = h.length, w = c.reduce(
|
|
14428
|
+
(D, L) => (D[L.role] = (D[L.role] ?? 0) + 1, D),
|
|
14420
14429
|
{}
|
|
14421
|
-
),
|
|
14430
|
+
), P = w.owner ?? 0, x = w.admin ?? 0, M = w.member ?? 0;
|
|
14422
14431
|
return /* @__PURE__ */ i("div", { className: "cedros-dashboard__team", children: [
|
|
14423
14432
|
/* @__PURE__ */ e(
|
|
14424
14433
|
He,
|
|
14425
14434
|
{
|
|
14426
14435
|
stats: [
|
|
14427
|
-
{ label: "Owners", value:
|
|
14428
|
-
{ label: "Admins", value:
|
|
14429
|
-
{ label: "Members", value:
|
|
14436
|
+
{ label: "Owners", value: P },
|
|
14437
|
+
{ label: "Admins", value: x },
|
|
14438
|
+
{ label: "Members", value: M },
|
|
14430
14439
|
{ label: "Pending Invites", value: E }
|
|
14431
14440
|
]
|
|
14432
14441
|
}
|
|
@@ -14494,8 +14503,8 @@ function Ji({ orgId: t, currentUserId: s, hasPermission: r, role: a }) {
|
|
|
14494
14503
|
invites: h,
|
|
14495
14504
|
isLoading: y,
|
|
14496
14505
|
error: f?.message,
|
|
14497
|
-
canManage:
|
|
14498
|
-
onCancel:
|
|
14506
|
+
canManage: k || _,
|
|
14507
|
+
onCancel: k ? A : void 0,
|
|
14499
14508
|
onResend: _ ? b : void 0
|
|
14500
14509
|
}
|
|
14501
14510
|
) })
|
|
@@ -14605,61 +14614,61 @@ function Vc({
|
|
|
14605
14614
|
className: m = ""
|
|
14606
14615
|
}) {
|
|
14607
14616
|
const [h] = N(() => {
|
|
14608
|
-
const
|
|
14609
|
-
return s.forEach((S) =>
|
|
14617
|
+
const L = new el();
|
|
14618
|
+
return s.forEach((S) => L.register(S)), L;
|
|
14610
14619
|
}), [y, f] = N(
|
|
14611
14620
|
() => h.getAll()
|
|
14612
14621
|
);
|
|
14613
14622
|
U(() => h.subscribe(f), [h]);
|
|
14614
14623
|
const p = O(() => y.flatMap(
|
|
14615
|
-
(
|
|
14624
|
+
(L) => L.sections.filter((S) => !(S.requiredPermission && !L.checkPermission(S.requiredPermission, r) || r.dashboardPermissions && !r.dashboardPermissions.canAccess(S.id))).map(
|
|
14616
14625
|
(S) => ({
|
|
14617
14626
|
...S,
|
|
14618
|
-
qualifiedId: `${
|
|
14619
|
-
pluginId:
|
|
14620
|
-
cssNamespace:
|
|
14627
|
+
qualifiedId: `${L.id}:${S.id}`,
|
|
14628
|
+
pluginId: L.id,
|
|
14629
|
+
cssNamespace: L.cssNamespace
|
|
14621
14630
|
})
|
|
14622
14631
|
)
|
|
14623
|
-
), [y, r]), [v,
|
|
14632
|
+
), [y, r]), [v, A] = N(
|
|
14624
14633
|
() => a ?? p[0]?.qualifiedId ?? null
|
|
14625
|
-
), [b, _] = N(/* @__PURE__ */ new Set()),
|
|
14634
|
+
), [b, _] = N(/* @__PURE__ */ new Set()), k = C((L) => {
|
|
14626
14635
|
_((S) => {
|
|
14627
|
-
const
|
|
14628
|
-
return
|
|
14636
|
+
const T = new Set(S);
|
|
14637
|
+
return T.has(L) ? T.delete(L) : T.add(L), T;
|
|
14629
14638
|
});
|
|
14630
14639
|
}, []);
|
|
14631
14640
|
U(() => {
|
|
14632
|
-
v && !p.find((
|
|
14641
|
+
v && !p.find((L) => L.qualifiedId === v) && A(p[0]?.qualifiedId ?? null);
|
|
14633
14642
|
}, [p, v]);
|
|
14634
14643
|
const E = C(
|
|
14635
|
-
(
|
|
14636
|
-
|
|
14644
|
+
(L) => {
|
|
14645
|
+
A(L), c?.(L);
|
|
14637
14646
|
},
|
|
14638
14647
|
[c]
|
|
14639
14648
|
), w = C(
|
|
14640
|
-
(
|
|
14641
|
-
const S = h.get(
|
|
14649
|
+
(L) => {
|
|
14650
|
+
const S = h.get(L);
|
|
14642
14651
|
return S ? S.createPluginContext(r) : null;
|
|
14643
14652
|
},
|
|
14644
14653
|
[h, r]
|
|
14645
|
-
),
|
|
14646
|
-
const
|
|
14654
|
+
), P = O(() => {
|
|
14655
|
+
const L = tl(y), S = /* @__PURE__ */ new Map();
|
|
14647
14656
|
return p.forEach((R) => {
|
|
14648
14657
|
const I = R.group ?? "Menu", j = S.get(I) ?? [];
|
|
14649
14658
|
S.set(I, [...j, R]);
|
|
14650
14659
|
}), Array.from(S.entries()).sort(([R], [I]) => {
|
|
14651
|
-
const j =
|
|
14660
|
+
const j = L.get(R) ?? 99, ee = L.get(I) ?? 99;
|
|
14652
14661
|
return j - ee;
|
|
14653
14662
|
});
|
|
14654
|
-
}, [p, y]),
|
|
14663
|
+
}, [p, y]), x = O(() => {
|
|
14655
14664
|
if (!v) return null;
|
|
14656
|
-
const [
|
|
14657
|
-
if (!
|
|
14658
|
-
const R =
|
|
14665
|
+
const [L, S] = v.split(":"), T = h.get(L);
|
|
14666
|
+
if (!T) return null;
|
|
14667
|
+
const R = T.components[S];
|
|
14659
14668
|
if (!R) return null;
|
|
14660
|
-
const I =
|
|
14661
|
-
return { Component: R, pluginContext: I, plugin:
|
|
14662
|
-
}, [v, h, r]),
|
|
14669
|
+
const I = T.createPluginContext(r);
|
|
14670
|
+
return { Component: R, pluginContext: I, plugin: T };
|
|
14671
|
+
}, [v, h, r]), M = O(
|
|
14663
14672
|
() => ({
|
|
14664
14673
|
registry: h,
|
|
14665
14674
|
hostContext: r,
|
|
@@ -14668,14 +14677,14 @@ function Vc({
|
|
|
14668
14677
|
getPluginContext: w
|
|
14669
14678
|
}),
|
|
14670
14679
|
[h, r, v, E, w]
|
|
14671
|
-
),
|
|
14672
|
-
const
|
|
14673
|
-
if (!
|
|
14674
|
-
const S =
|
|
14680
|
+
), D = O(() => {
|
|
14681
|
+
const L = r.cedrosLogin;
|
|
14682
|
+
if (!L) return null;
|
|
14683
|
+
const S = L.user ? { authMethods: [], emailVerified: !1, createdAt: "", updatedAt: "", ...L.user } : null;
|
|
14675
14684
|
return {
|
|
14676
|
-
config: { serverUrl:
|
|
14685
|
+
config: { serverUrl: L.serverUrl },
|
|
14677
14686
|
user: S,
|
|
14678
|
-
authState:
|
|
14687
|
+
authState: L.user ? "authenticated" : "unauthenticated",
|
|
14679
14688
|
error: null,
|
|
14680
14689
|
logout: async () => {
|
|
14681
14690
|
},
|
|
@@ -14689,30 +14698,30 @@ function Vc({
|
|
|
14689
14698
|
_internal: {
|
|
14690
14699
|
handleLoginSuccess: () => {
|
|
14691
14700
|
},
|
|
14692
|
-
getAccessToken:
|
|
14701
|
+
getAccessToken: L.getAccessToken
|
|
14693
14702
|
}
|
|
14694
14703
|
};
|
|
14695
14704
|
}, [r.cedrosLogin]);
|
|
14696
|
-
return /* @__PURE__ */ e(Gr.Provider, { value:
|
|
14705
|
+
return /* @__PURE__ */ e(Gr.Provider, { value: M, children: /* @__PURE__ */ e(Sn.Provider, { value: D, children: /* @__PURE__ */ i("div", { className: `cedros-admin cedros-admin-shell ${m || ""}`, children: [
|
|
14697
14706
|
/* @__PURE__ */ i("aside", { className: "cedros-admin-shell__sidebar", children: [
|
|
14698
14707
|
/* @__PURE__ */ e("div", { className: "cedros-admin-shell__sidebar-header", children: l ?? /* @__PURE__ */ e("div", { className: "cedros-admin-shell__logo", children: /* @__PURE__ */ e("span", { className: "cedros-admin-shell__logo-text", children: t }) }) }),
|
|
14699
|
-
/* @__PURE__ */ e("nav", { className: "cedros-admin-shell__nav", children:
|
|
14700
|
-
const
|
|
14708
|
+
/* @__PURE__ */ e("nav", { className: "cedros-admin-shell__nav", children: P.map(([L, S]) => {
|
|
14709
|
+
const T = L === "Configuration", R = b.has(L);
|
|
14701
14710
|
return /* @__PURE__ */ i("div", { className: "cedros-admin-shell__nav-group", children: [
|
|
14702
|
-
|
|
14711
|
+
T ? /* @__PURE__ */ i(
|
|
14703
14712
|
"button",
|
|
14704
14713
|
{
|
|
14705
14714
|
type: "button",
|
|
14706
14715
|
className: "cedros-admin-shell__nav-label cedros-admin-shell__nav-label--collapsible",
|
|
14707
|
-
onClick: () =>
|
|
14716
|
+
onClick: () => k(L),
|
|
14708
14717
|
"aria-expanded": !R,
|
|
14709
14718
|
children: [
|
|
14710
|
-
/* @__PURE__ */ e("span", { children:
|
|
14719
|
+
/* @__PURE__ */ e("span", { children: L }),
|
|
14711
14720
|
/* @__PURE__ */ e("span", { className: `cedros-admin-shell__nav-chevron ${R ? "" : "cedros-admin-shell__nav-chevron--expanded"}`, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" }) }) })
|
|
14712
14721
|
]
|
|
14713
14722
|
}
|
|
14714
|
-
) : /* @__PURE__ */ e("span", { className: "cedros-admin-shell__nav-label", children:
|
|
14715
|
-
(!
|
|
14723
|
+
) : /* @__PURE__ */ e("span", { className: "cedros-admin-shell__nav-label", children: L }),
|
|
14724
|
+
(!T || !R) && S.sort((I, j) => (I.order ?? 0) - (j.order ?? 0)).map((I) => /* @__PURE__ */ i(
|
|
14716
14725
|
"button",
|
|
14717
14726
|
{
|
|
14718
14727
|
type: "button",
|
|
@@ -14727,7 +14736,7 @@ function Vc({
|
|
|
14727
14736
|
},
|
|
14728
14737
|
I.qualifiedId
|
|
14729
14738
|
))
|
|
14730
|
-
] },
|
|
14739
|
+
] }, L);
|
|
14731
14740
|
}) }),
|
|
14732
14741
|
(r.cedrosLogin?.user || d) && /* @__PURE__ */ i("div", { className: "cedros-admin-shell__sidebar-footer", children: [
|
|
14733
14742
|
r.cedrosLogin?.user && /* @__PURE__ */ e(
|
|
@@ -14743,15 +14752,15 @@ function Vc({
|
|
|
14743
14752
|
d
|
|
14744
14753
|
] })
|
|
14745
14754
|
] }),
|
|
14746
|
-
/* @__PURE__ */ e("main", { className: "cedros-admin-shell__main", children:
|
|
14755
|
+
/* @__PURE__ */ e("main", { className: "cedros-admin-shell__main", children: x ? /* @__PURE__ */ e(En, { fallback: /* @__PURE__ */ e(sl, {}), children: /* @__PURE__ */ e(
|
|
14747
14756
|
"div",
|
|
14748
14757
|
{
|
|
14749
14758
|
className: "cedros-admin-shell__section",
|
|
14750
|
-
"data-plugin-namespace":
|
|
14759
|
+
"data-plugin-namespace": x.plugin.cssNamespace,
|
|
14751
14760
|
children: /* @__PURE__ */ e(
|
|
14752
|
-
|
|
14761
|
+
x.Component,
|
|
14753
14762
|
{
|
|
14754
|
-
pluginContext:
|
|
14763
|
+
pluginContext: x.pluginContext,
|
|
14755
14764
|
pageSize: n,
|
|
14756
14765
|
refreshInterval: o
|
|
14757
14766
|
}
|
|
@@ -14847,7 +14856,7 @@ const ue = {
|
|
|
14847
14856
|
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
|
|
14848
14857
|
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
|
|
14849
14858
|
] })
|
|
14850
|
-
}, rl = ve(() => import("./UsersSection-
|
|
14859
|
+
}, rl = ve(() => import("./UsersSection-mOOjcUEv.js")), nl = ve(() => import("./TeamSection-DnJudC38.js")), al = ve(() => import("./DepositsSection-BH5K162Q.js")), ol = ve(() => import("./WithdrawalsSection-Grebjjks.js")), il = ve(() => import("./AuthenticationSettings-DlVILxY4.js")), ll = ve(() => import("./EmbeddedWalletSettings-Bff6raAT.js")), cl = ve(() => import("./EmailSettings-khmiWqhx.js")), dl = ve(() => import("./WebhookSettings-D0i0JhQD.js")), ul = ve(() => import("./CreditSystemSettings-Bv6u9lTs.js")), hl = ve(() => import("./ServerSettings-UIVR0R4l.js")), ml = {
|
|
14851
14860
|
"login:users:read": ["admin", "owner"],
|
|
14852
14861
|
"login:users:write": ["admin", "owner"],
|
|
14853
14862
|
"login:members:read": ["member:read", "admin", "owner"],
|
|
@@ -15829,7 +15838,7 @@ function _l() {
|
|
|
15829
15838
|
if (!o.isValid(y))
|
|
15830
15839
|
throw new Error("Invalid QR Code version");
|
|
15831
15840
|
typeof p > "u" && (p = n.BYTE);
|
|
15832
|
-
const v = s.getSymbolTotalCodewords(y),
|
|
15841
|
+
const v = s.getSymbolTotalCodewords(y), A = r.getTotalCodewordsCount(y, f), b = (v - A) * 8;
|
|
15833
15842
|
if (p === n.MIXED) return b;
|
|
15834
15843
|
const _ = b - u(p, y);
|
|
15835
15844
|
switch (p) {
|
|
@@ -16034,8 +16043,8 @@ function Ll() {
|
|
|
16034
16043
|
h.hasOwnProperty(g) && (y = h[g], f = m + y, p = c[g], v = typeof c[g] > "u", (v || p > f) && (c[g] = f, l.push(g, f), o[g] = u));
|
|
16035
16044
|
}
|
|
16036
16045
|
if (typeof n < "u" && typeof c[n] > "u") {
|
|
16037
|
-
var
|
|
16038
|
-
throw new Error(
|
|
16046
|
+
var A = ["Could not find a path from ", a, " to ", n, "."].join("");
|
|
16047
|
+
throw new Error(A);
|
|
16039
16048
|
}
|
|
16040
16049
|
return o;
|
|
16041
16050
|
},
|
|
@@ -16091,129 +16100,129 @@ var ar;
|
|
|
16091
16100
|
function xl() {
|
|
16092
16101
|
return ar || (ar = 1, (function(t) {
|
|
16093
16102
|
const s = Le(), r = Cl(), a = El(), n = Tl(), o = Pl(), c = Xr(), l = Pe(), d = Ll();
|
|
16094
|
-
function u(
|
|
16095
|
-
return unescape(encodeURIComponent(
|
|
16103
|
+
function u(A) {
|
|
16104
|
+
return unescape(encodeURIComponent(A)).length;
|
|
16096
16105
|
}
|
|
16097
|
-
function g(
|
|
16098
|
-
const
|
|
16106
|
+
function g(A, b, _) {
|
|
16107
|
+
const k = [];
|
|
16099
16108
|
let E;
|
|
16100
|
-
for (; (E =
|
|
16101
|
-
|
|
16109
|
+
for (; (E = A.exec(_)) !== null; )
|
|
16110
|
+
k.push({
|
|
16102
16111
|
data: E[0],
|
|
16103
16112
|
index: E.index,
|
|
16104
16113
|
mode: b,
|
|
16105
16114
|
length: E[0].length
|
|
16106
16115
|
});
|
|
16107
|
-
return
|
|
16116
|
+
return k;
|
|
16108
16117
|
}
|
|
16109
|
-
function m(
|
|
16110
|
-
const b = g(c.NUMERIC, s.NUMERIC,
|
|
16111
|
-
let
|
|
16112
|
-
return l.isKanjiModeEnabled() ? (
|
|
16113
|
-
return
|
|
16114
|
-
}).map(function(
|
|
16118
|
+
function m(A) {
|
|
16119
|
+
const b = g(c.NUMERIC, s.NUMERIC, A), _ = g(c.ALPHANUMERIC, s.ALPHANUMERIC, A);
|
|
16120
|
+
let k, E;
|
|
16121
|
+
return l.isKanjiModeEnabled() ? (k = g(c.BYTE, s.BYTE, A), E = g(c.KANJI, s.KANJI, A)) : (k = g(c.BYTE_KANJI, s.BYTE, A), E = []), b.concat(_, k, E).sort(function(P, x) {
|
|
16122
|
+
return P.index - x.index;
|
|
16123
|
+
}).map(function(P) {
|
|
16115
16124
|
return {
|
|
16116
|
-
data:
|
|
16117
|
-
mode:
|
|
16118
|
-
length:
|
|
16125
|
+
data: P.data,
|
|
16126
|
+
mode: P.mode,
|
|
16127
|
+
length: P.length
|
|
16119
16128
|
};
|
|
16120
16129
|
});
|
|
16121
16130
|
}
|
|
16122
|
-
function h(
|
|
16131
|
+
function h(A, b) {
|
|
16123
16132
|
switch (b) {
|
|
16124
16133
|
case s.NUMERIC:
|
|
16125
|
-
return r.getBitsLength(
|
|
16134
|
+
return r.getBitsLength(A);
|
|
16126
16135
|
case s.ALPHANUMERIC:
|
|
16127
|
-
return a.getBitsLength(
|
|
16136
|
+
return a.getBitsLength(A);
|
|
16128
16137
|
case s.KANJI:
|
|
16129
|
-
return o.getBitsLength(
|
|
16138
|
+
return o.getBitsLength(A);
|
|
16130
16139
|
case s.BYTE:
|
|
16131
|
-
return n.getBitsLength(
|
|
16140
|
+
return n.getBitsLength(A);
|
|
16132
16141
|
}
|
|
16133
16142
|
}
|
|
16134
|
-
function y(
|
|
16135
|
-
return
|
|
16136
|
-
const
|
|
16137
|
-
return
|
|
16143
|
+
function y(A) {
|
|
16144
|
+
return A.reduce(function(b, _) {
|
|
16145
|
+
const k = b.length - 1 >= 0 ? b[b.length - 1] : null;
|
|
16146
|
+
return k && k.mode === _.mode ? (b[b.length - 1].data += _.data, b) : (b.push(_), b);
|
|
16138
16147
|
}, []);
|
|
16139
16148
|
}
|
|
16140
|
-
function f(
|
|
16149
|
+
function f(A) {
|
|
16141
16150
|
const b = [];
|
|
16142
|
-
for (let _ = 0; _ <
|
|
16143
|
-
const
|
|
16144
|
-
switch (
|
|
16151
|
+
for (let _ = 0; _ < A.length; _++) {
|
|
16152
|
+
const k = A[_];
|
|
16153
|
+
switch (k.mode) {
|
|
16145
16154
|
case s.NUMERIC:
|
|
16146
16155
|
b.push([
|
|
16147
|
-
|
|
16148
|
-
{ data:
|
|
16149
|
-
{ data:
|
|
16156
|
+
k,
|
|
16157
|
+
{ data: k.data, mode: s.ALPHANUMERIC, length: k.length },
|
|
16158
|
+
{ data: k.data, mode: s.BYTE, length: k.length }
|
|
16150
16159
|
]);
|
|
16151
16160
|
break;
|
|
16152
16161
|
case s.ALPHANUMERIC:
|
|
16153
16162
|
b.push([
|
|
16154
|
-
|
|
16155
|
-
{ data:
|
|
16163
|
+
k,
|
|
16164
|
+
{ data: k.data, mode: s.BYTE, length: k.length }
|
|
16156
16165
|
]);
|
|
16157
16166
|
break;
|
|
16158
16167
|
case s.KANJI:
|
|
16159
16168
|
b.push([
|
|
16160
|
-
|
|
16161
|
-
{ data:
|
|
16169
|
+
k,
|
|
16170
|
+
{ data: k.data, mode: s.BYTE, length: u(k.data) }
|
|
16162
16171
|
]);
|
|
16163
16172
|
break;
|
|
16164
16173
|
case s.BYTE:
|
|
16165
16174
|
b.push([
|
|
16166
|
-
{ data:
|
|
16175
|
+
{ data: k.data, mode: s.BYTE, length: u(k.data) }
|
|
16167
16176
|
]);
|
|
16168
16177
|
}
|
|
16169
16178
|
}
|
|
16170
16179
|
return b;
|
|
16171
16180
|
}
|
|
16172
|
-
function p(
|
|
16173
|
-
const _ = {},
|
|
16181
|
+
function p(A, b) {
|
|
16182
|
+
const _ = {}, k = { start: {} };
|
|
16174
16183
|
let E = ["start"];
|
|
16175
|
-
for (let w = 0; w <
|
|
16176
|
-
const
|
|
16177
|
-
for (let
|
|
16178
|
-
const
|
|
16179
|
-
|
|
16184
|
+
for (let w = 0; w < A.length; w++) {
|
|
16185
|
+
const P = A[w], x = [];
|
|
16186
|
+
for (let M = 0; M < P.length; M++) {
|
|
16187
|
+
const D = P[M], L = "" + w + M;
|
|
16188
|
+
x.push(L), _[L] = { node: D, lastCount: 0 }, k[L] = {};
|
|
16180
16189
|
for (let S = 0; S < E.length; S++) {
|
|
16181
|
-
const
|
|
16182
|
-
_[
|
|
16190
|
+
const T = E[S];
|
|
16191
|
+
_[T] && _[T].node.mode === D.mode ? (k[T][L] = h(_[T].lastCount + D.length, D.mode) - h(_[T].lastCount, D.mode), _[T].lastCount += D.length) : (_[T] && (_[T].lastCount = D.length), k[T][L] = h(D.length, D.mode) + 4 + s.getCharCountIndicator(D.mode, b));
|
|
16183
16192
|
}
|
|
16184
16193
|
}
|
|
16185
|
-
E =
|
|
16194
|
+
E = x;
|
|
16186
16195
|
}
|
|
16187
16196
|
for (let w = 0; w < E.length; w++)
|
|
16188
|
-
|
|
16189
|
-
return { map:
|
|
16197
|
+
k[E[w]].end = 0;
|
|
16198
|
+
return { map: k, table: _ };
|
|
16190
16199
|
}
|
|
16191
|
-
function v(
|
|
16200
|
+
function v(A, b) {
|
|
16192
16201
|
let _;
|
|
16193
|
-
const
|
|
16194
|
-
if (_ = s.from(b,
|
|
16195
|
-
throw new Error('"' +
|
|
16196
|
-
Suggested mode is: ` + s.toString(
|
|
16202
|
+
const k = s.getBestModeForData(A);
|
|
16203
|
+
if (_ = s.from(b, k), _ !== s.BYTE && _.bit < k.bit)
|
|
16204
|
+
throw new Error('"' + A + '" cannot be encoded with mode ' + s.toString(_) + `.
|
|
16205
|
+
Suggested mode is: ` + s.toString(k));
|
|
16197
16206
|
switch (_ === s.KANJI && !l.isKanjiModeEnabled() && (_ = s.BYTE), _) {
|
|
16198
16207
|
case s.NUMERIC:
|
|
16199
|
-
return new r(
|
|
16208
|
+
return new r(A);
|
|
16200
16209
|
case s.ALPHANUMERIC:
|
|
16201
|
-
return new a(
|
|
16210
|
+
return new a(A);
|
|
16202
16211
|
case s.KANJI:
|
|
16203
|
-
return new o(
|
|
16212
|
+
return new o(A);
|
|
16204
16213
|
case s.BYTE:
|
|
16205
|
-
return new n(
|
|
16214
|
+
return new n(A);
|
|
16206
16215
|
}
|
|
16207
16216
|
}
|
|
16208
16217
|
t.fromArray = function(b) {
|
|
16209
|
-
return b.reduce(function(_,
|
|
16210
|
-
return typeof
|
|
16218
|
+
return b.reduce(function(_, k) {
|
|
16219
|
+
return typeof k == "string" ? _.push(v(k, null)) : k.data && _.push(v(k.data, k.mode)), _;
|
|
16211
16220
|
}, []);
|
|
16212
16221
|
}, t.fromString = function(b, _) {
|
|
16213
|
-
const
|
|
16214
|
-
for (let
|
|
16215
|
-
|
|
16216
|
-
return t.fromArray(y(
|
|
16222
|
+
const k = m(b, l.isKanjiModeEnabled()), E = f(k), w = p(E, _), P = d.find_path(w.map, "start", "end"), x = [];
|
|
16223
|
+
for (let M = 1; M < P.length - 1; M++)
|
|
16224
|
+
x.push(w.table[P[M]].node);
|
|
16225
|
+
return t.fromArray(y(x));
|
|
16217
16226
|
}, t.rawSplit = function(b) {
|
|
16218
16227
|
return t.fromArray(
|
|
16219
16228
|
m(b, l.isKanjiModeEnabled())
|
|
@@ -16226,76 +16235,76 @@ function Ml() {
|
|
|
16226
16235
|
if (or) return Et;
|
|
16227
16236
|
or = 1;
|
|
16228
16237
|
const t = Pe(), s = us(), r = gl(), a = yl(), n = bl(), o = wl(), c = vl(), l = Yr(), d = Nl(), u = _l(), g = Sl(), m = Le(), h = xl();
|
|
16229
|
-
function y(w,
|
|
16230
|
-
const
|
|
16231
|
-
for (let
|
|
16232
|
-
const
|
|
16233
|
-
for (let
|
|
16234
|
-
if (!(
|
|
16238
|
+
function y(w, P) {
|
|
16239
|
+
const x = w.size, M = o.getPositions(P);
|
|
16240
|
+
for (let D = 0; D < M.length; D++) {
|
|
16241
|
+
const L = M[D][0], S = M[D][1];
|
|
16242
|
+
for (let T = -1; T <= 7; T++)
|
|
16243
|
+
if (!(L + T <= -1 || x <= L + T))
|
|
16235
16244
|
for (let R = -1; R <= 7; R++)
|
|
16236
|
-
S + R <= -1 ||
|
|
16245
|
+
S + R <= -1 || x <= S + R || (T >= 0 && T <= 6 && (R === 0 || R === 6) || R >= 0 && R <= 6 && (T === 0 || T === 6) || T >= 2 && T <= 4 && R >= 2 && R <= 4 ? w.set(L + T, S + R, !0, !0) : w.set(L + T, S + R, !1, !0));
|
|
16237
16246
|
}
|
|
16238
16247
|
}
|
|
16239
16248
|
function f(w) {
|
|
16240
|
-
const
|
|
16241
|
-
for (let
|
|
16242
|
-
const
|
|
16243
|
-
w.set(
|
|
16249
|
+
const P = w.size;
|
|
16250
|
+
for (let x = 8; x < P - 8; x++) {
|
|
16251
|
+
const M = x % 2 === 0;
|
|
16252
|
+
w.set(x, 6, M, !0), w.set(6, x, M, !0);
|
|
16244
16253
|
}
|
|
16245
16254
|
}
|
|
16246
|
-
function p(w,
|
|
16247
|
-
const
|
|
16248
|
-
for (let
|
|
16249
|
-
const
|
|
16255
|
+
function p(w, P) {
|
|
16256
|
+
const x = n.getPositions(P);
|
|
16257
|
+
for (let M = 0; M < x.length; M++) {
|
|
16258
|
+
const D = x[M][0], L = x[M][1];
|
|
16250
16259
|
for (let S = -2; S <= 2; S++)
|
|
16251
|
-
for (let
|
|
16252
|
-
S === -2 || S === 2 ||
|
|
16260
|
+
for (let T = -2; T <= 2; T++)
|
|
16261
|
+
S === -2 || S === 2 || T === -2 || T === 2 || S === 0 && T === 0 ? w.set(D + S, L + T, !0, !0) : w.set(D + S, L + T, !1, !0);
|
|
16253
16262
|
}
|
|
16254
16263
|
}
|
|
16255
|
-
function v(w,
|
|
16256
|
-
const
|
|
16257
|
-
let
|
|
16258
|
-
for (let
|
|
16259
|
-
|
|
16264
|
+
function v(w, P) {
|
|
16265
|
+
const x = w.size, M = u.getEncodedBits(P);
|
|
16266
|
+
let D, L, S;
|
|
16267
|
+
for (let T = 0; T < 18; T++)
|
|
16268
|
+
D = Math.floor(T / 3), L = T % 3 + x - 8 - 3, S = (M >> T & 1) === 1, w.set(D, L, S, !0), w.set(L, D, S, !0);
|
|
16260
16269
|
}
|
|
16261
|
-
function
|
|
16262
|
-
const
|
|
16263
|
-
let
|
|
16264
|
-
for (
|
|
16265
|
-
S = (
|
|
16266
|
-
w.set(
|
|
16270
|
+
function A(w, P, x) {
|
|
16271
|
+
const M = w.size, D = g.getEncodedBits(P, x);
|
|
16272
|
+
let L, S;
|
|
16273
|
+
for (L = 0; L < 15; L++)
|
|
16274
|
+
S = (D >> L & 1) === 1, L < 6 ? w.set(L, 8, S, !0) : L < 8 ? w.set(L + 1, 8, S, !0) : w.set(M - 15 + L, 8, S, !0), L < 8 ? w.set(8, M - L - 1, S, !0) : L < 9 ? w.set(8, 15 - L - 1 + 1, S, !0) : w.set(8, 15 - L - 1, S, !0);
|
|
16275
|
+
w.set(M - 8, 8, 1, !0);
|
|
16267
16276
|
}
|
|
16268
|
-
function b(w,
|
|
16269
|
-
const
|
|
16270
|
-
let
|
|
16271
|
-
for (let
|
|
16272
|
-
for (
|
|
16277
|
+
function b(w, P) {
|
|
16278
|
+
const x = w.size;
|
|
16279
|
+
let M = -1, D = x - 1, L = 7, S = 0;
|
|
16280
|
+
for (let T = x - 1; T > 0; T -= 2)
|
|
16281
|
+
for (T === 6 && T--; ; ) {
|
|
16273
16282
|
for (let R = 0; R < 2; R++)
|
|
16274
|
-
if (!w.isReserved(
|
|
16283
|
+
if (!w.isReserved(D, T - R)) {
|
|
16275
16284
|
let I = !1;
|
|
16276
|
-
S <
|
|
16285
|
+
S < P.length && (I = (P[S] >>> L & 1) === 1), w.set(D, T - R, I), L--, L === -1 && (S++, L = 7);
|
|
16277
16286
|
}
|
|
16278
|
-
if (
|
|
16279
|
-
|
|
16287
|
+
if (D += M, D < 0 || x <= D) {
|
|
16288
|
+
D -= M, M = -M;
|
|
16280
16289
|
break;
|
|
16281
16290
|
}
|
|
16282
16291
|
}
|
|
16283
16292
|
}
|
|
16284
|
-
function _(w,
|
|
16285
|
-
const
|
|
16286
|
-
|
|
16287
|
-
|
|
16293
|
+
function _(w, P, x) {
|
|
16294
|
+
const M = new r();
|
|
16295
|
+
x.forEach(function(R) {
|
|
16296
|
+
M.put(R.mode.bit, 4), M.put(R.getLength(), m.getCharCountIndicator(R.mode, w)), R.write(M);
|
|
16288
16297
|
});
|
|
16289
|
-
const
|
|
16290
|
-
for (
|
|
16291
|
-
|
|
16292
|
-
const
|
|
16293
|
-
for (let R = 0; R <
|
|
16294
|
-
|
|
16295
|
-
return
|
|
16298
|
+
const D = t.getSymbolTotalCodewords(w), L = l.getTotalCodewordsCount(w, P), S = (D - L) * 8;
|
|
16299
|
+
for (M.getLengthInBits() + 4 <= S && M.put(0, 4); M.getLengthInBits() % 8 !== 0; )
|
|
16300
|
+
M.putBit(0);
|
|
16301
|
+
const T = (S - M.getLengthInBits()) / 8;
|
|
16302
|
+
for (let R = 0; R < T; R++)
|
|
16303
|
+
M.put(R % 2 ? 17 : 236, 8);
|
|
16304
|
+
return k(M, w, P);
|
|
16296
16305
|
}
|
|
16297
|
-
function
|
|
16298
|
-
const
|
|
16306
|
+
function k(w, P, x) {
|
|
16307
|
+
const M = t.getSymbolTotalCodewords(P), D = l.getTotalCodewordsCount(P, x), L = M - D, S = l.getBlocksCount(P, x), T = M % S, R = S - T, I = Math.floor(M / S), j = Math.floor(L / S), ee = j + 1, ne = I - j, V = new d(ne);
|
|
16299
16308
|
let Y = 0;
|
|
16300
16309
|
const q = new Array(S), Z = new Array(S);
|
|
16301
16310
|
let ce = 0;
|
|
@@ -16304,7 +16313,7 @@ function Ml() {
|
|
|
16304
16313
|
const he = H < R ? j : ee;
|
|
16305
16314
|
q[H] = le.slice(Y, Y + he), Z[H] = V.encode(q[H]), Y += he, ce = Math.max(ce, he);
|
|
16306
16315
|
}
|
|
16307
|
-
const te = new Uint8Array(
|
|
16316
|
+
const te = new Uint8Array(M);
|
|
16308
16317
|
let F = 0, W, $;
|
|
16309
16318
|
for (W = 0; W < ce; W++)
|
|
16310
16319
|
for ($ = 0; $ < S; $++)
|
|
@@ -16314,48 +16323,48 @@ function Ml() {
|
|
|
16314
16323
|
te[F++] = Z[$][W];
|
|
16315
16324
|
return te;
|
|
16316
16325
|
}
|
|
16317
|
-
function E(w,
|
|
16318
|
-
let
|
|
16326
|
+
function E(w, P, x, M) {
|
|
16327
|
+
let D;
|
|
16319
16328
|
if (Array.isArray(w))
|
|
16320
|
-
|
|
16329
|
+
D = h.fromArray(w);
|
|
16321
16330
|
else if (typeof w == "string") {
|
|
16322
|
-
let I =
|
|
16331
|
+
let I = P;
|
|
16323
16332
|
if (!I) {
|
|
16324
16333
|
const j = h.rawSplit(w);
|
|
16325
|
-
I = u.getBestVersionForData(j,
|
|
16334
|
+
I = u.getBestVersionForData(j, x);
|
|
16326
16335
|
}
|
|
16327
|
-
|
|
16336
|
+
D = h.fromString(w, I || 40);
|
|
16328
16337
|
} else
|
|
16329
16338
|
throw new Error("Invalid data");
|
|
16330
|
-
const
|
|
16331
|
-
if (!T)
|
|
16332
|
-
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
16339
|
+
const L = u.getBestVersionForData(D, x);
|
|
16333
16340
|
if (!L)
|
|
16334
|
-
|
|
16335
|
-
|
|
16341
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
16342
|
+
if (!P)
|
|
16343
|
+
P = L;
|
|
16344
|
+
else if (P < L)
|
|
16336
16345
|
throw new Error(
|
|
16337
16346
|
`
|
|
16338
16347
|
The chosen QR Code version cannot contain this amount of data.
|
|
16339
|
-
Minimum version required to store current data is: ` +
|
|
16348
|
+
Minimum version required to store current data is: ` + L + `.
|
|
16340
16349
|
`
|
|
16341
16350
|
);
|
|
16342
|
-
const S = _(
|
|
16343
|
-
return y(R,
|
|
16351
|
+
const S = _(P, x, D), T = t.getSymbolSize(P), R = new a(T);
|
|
16352
|
+
return y(R, P), f(R), p(R, P), A(R, x, 0), P >= 7 && v(R, P), b(R, S), isNaN(M) && (M = c.getBestMask(
|
|
16344
16353
|
R,
|
|
16345
|
-
|
|
16346
|
-
)), c.applyMask(
|
|
16354
|
+
A.bind(null, R, x)
|
|
16355
|
+
)), c.applyMask(M, R), A(R, x, M), {
|
|
16347
16356
|
modules: R,
|
|
16348
|
-
version:
|
|
16349
|
-
errorCorrectionLevel:
|
|
16350
|
-
maskPattern:
|
|
16351
|
-
segments:
|
|
16357
|
+
version: P,
|
|
16358
|
+
errorCorrectionLevel: x,
|
|
16359
|
+
maskPattern: M,
|
|
16360
|
+
segments: D
|
|
16352
16361
|
};
|
|
16353
16362
|
}
|
|
16354
|
-
return Et.create = function(
|
|
16355
|
-
if (typeof
|
|
16363
|
+
return Et.create = function(P, x) {
|
|
16364
|
+
if (typeof P > "u" || P === "")
|
|
16356
16365
|
throw new Error("No input text");
|
|
16357
|
-
let
|
|
16358
|
-
return typeof
|
|
16366
|
+
let M = s.M, D, L;
|
|
16367
|
+
return typeof x < "u" && (M = s.from(x.errorCorrectionLevel, s.M), D = u.from(x.version), L = c.from(x.maskPattern), x.toSJISFunc && t.setToSJISFunction(x.toSJISFunc)), E(P, D, M, L);
|
|
16359
16368
|
}, Et;
|
|
16360
16369
|
}
|
|
16361
16370
|
var Ht = {}, Qt = {}, ir;
|
|
@@ -16404,8 +16413,8 @@ function Zr() {
|
|
|
16404
16413
|
for (let y = 0; y < u; y++) {
|
|
16405
16414
|
let f = (h * u + y) * 4, p = o.color.light;
|
|
16406
16415
|
if (h >= g && y >= g && h < u - g && y < u - g) {
|
|
16407
|
-
const v = Math.floor((h - g) / d),
|
|
16408
|
-
p = m[l[v * c +
|
|
16416
|
+
const v = Math.floor((h - g) / d), A = Math.floor((y - g) / d);
|
|
16417
|
+
p = m[l[v * c + A] ? 1 : 0];
|
|
16409
16418
|
}
|
|
16410
16419
|
a[f++] = p.r, a[f++] = p.g, a[f++] = p.b, a[f] = p.a;
|
|
16411
16420
|
}
|
|
@@ -16552,10 +16561,10 @@ function en() {
|
|
|
16552
16561
|
), y = C(async () => {
|
|
16553
16562
|
u(!0), m(null);
|
|
16554
16563
|
try {
|
|
16555
|
-
const
|
|
16556
|
-
return a(
|
|
16557
|
-
} catch (
|
|
16558
|
-
const E = B(
|
|
16564
|
+
const k = await h.get("/mfa/status");
|
|
16565
|
+
return a(k), k;
|
|
16566
|
+
} catch (k) {
|
|
16567
|
+
const E = B(k, "Failed to get TOTP status");
|
|
16559
16568
|
throw m(E), E;
|
|
16560
16569
|
} finally {
|
|
16561
16570
|
u(!1);
|
|
@@ -16563,17 +16572,17 @@ function en() {
|
|
|
16563
16572
|
}, [h]), f = C(async () => {
|
|
16564
16573
|
u(!0), m(null), o("loading");
|
|
16565
16574
|
try {
|
|
16566
|
-
const
|
|
16567
|
-
return l(
|
|
16568
|
-
} catch (
|
|
16569
|
-
const E = B(
|
|
16575
|
+
const k = await h.post("/mfa/setup", {});
|
|
16576
|
+
return l(k), o("setup"), k;
|
|
16577
|
+
} catch (k) {
|
|
16578
|
+
const E = B(k, "Failed to start TOTP setup");
|
|
16570
16579
|
throw m(E), o("error"), E;
|
|
16571
16580
|
} finally {
|
|
16572
16581
|
u(!1);
|
|
16573
16582
|
}
|
|
16574
16583
|
}, [h]), p = C(
|
|
16575
|
-
async (
|
|
16576
|
-
if (!/^\d{6}$/.test(
|
|
16584
|
+
async (k) => {
|
|
16585
|
+
if (!/^\d{6}$/.test(k)) {
|
|
16577
16586
|
const E = {
|
|
16578
16587
|
code: "VALIDATION_ERROR",
|
|
16579
16588
|
message: "Please enter a 6-digit code"
|
|
@@ -16582,7 +16591,7 @@ function en() {
|
|
|
16582
16591
|
}
|
|
16583
16592
|
u(!0), m(null), o("verifying");
|
|
16584
16593
|
try {
|
|
16585
|
-
await h.post("/mfa/enable", { code:
|
|
16594
|
+
await h.post("/mfa/enable", { code: k }), o("success"), a({ enabled: !0, recoveryCodesRemaining: c?.recoveryCodes.length ?? 0 });
|
|
16586
16595
|
} catch (E) {
|
|
16587
16596
|
const w = B(E, "Invalid verification code");
|
|
16588
16597
|
throw m(w), o("error"), w;
|
|
@@ -16592,8 +16601,8 @@ function en() {
|
|
|
16592
16601
|
},
|
|
16593
16602
|
[h, c]
|
|
16594
16603
|
), v = C(
|
|
16595
|
-
async (
|
|
16596
|
-
if (!
|
|
16604
|
+
async (k) => {
|
|
16605
|
+
if (!k) {
|
|
16597
16606
|
const E = {
|
|
16598
16607
|
code: "VALIDATION_ERROR",
|
|
16599
16608
|
message: "Please enter your password"
|
|
@@ -16602,7 +16611,7 @@ function en() {
|
|
|
16602
16611
|
}
|
|
16603
16612
|
u(!0), m(null);
|
|
16604
16613
|
try {
|
|
16605
|
-
await h.post("/mfa/disable", { password:
|
|
16614
|
+
await h.post("/mfa/disable", { password: k }), a({ enabled: !1, recoveryCodesRemaining: 0 }), l(null), o("idle");
|
|
16606
16615
|
} catch (E) {
|
|
16607
16616
|
const w = B(E, "Failed to disable TOTP");
|
|
16608
16617
|
throw m(w), w;
|
|
@@ -16611,9 +16620,9 @@ function en() {
|
|
|
16611
16620
|
}
|
|
16612
16621
|
},
|
|
16613
16622
|
[h]
|
|
16614
|
-
),
|
|
16615
|
-
async (
|
|
16616
|
-
if (!/^\d{6}$/.test(
|
|
16623
|
+
), A = C(
|
|
16624
|
+
async (k) => {
|
|
16625
|
+
if (!/^\d{6}$/.test(k)) {
|
|
16617
16626
|
const E = {
|
|
16618
16627
|
code: "VALIDATION_ERROR",
|
|
16619
16628
|
message: "Please enter a 6-digit code"
|
|
@@ -16624,7 +16633,7 @@ function en() {
|
|
|
16624
16633
|
try {
|
|
16625
16634
|
return await h.post(
|
|
16626
16635
|
"/mfa/recovery-codes/regenerate",
|
|
16627
|
-
{ code:
|
|
16636
|
+
{ code: k }
|
|
16628
16637
|
);
|
|
16629
16638
|
} catch (E) {
|
|
16630
16639
|
const w = B(E, "Failed to regenerate recovery codes");
|
|
@@ -16647,26 +16656,26 @@ function en() {
|
|
|
16647
16656
|
beginSetup: f,
|
|
16648
16657
|
enableTotp: p,
|
|
16649
16658
|
disableTotp: v,
|
|
16650
|
-
regenerateBackupCodes:
|
|
16659
|
+
regenerateBackupCodes: A,
|
|
16651
16660
|
clearError: b,
|
|
16652
16661
|
reset: _
|
|
16653
16662
|
};
|
|
16654
16663
|
}
|
|
16655
16664
|
function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
16656
|
-
const { setupState: a, setupData: n, isLoading: o, error: c, beginSetup: l, enableTotp: d, clearError: u, reset: g } = en(), [m, h] = N("qr"), [y, f] = N(""), [p, v] = N(!1), [
|
|
16665
|
+
const { setupState: a, setupData: n, isLoading: o, error: c, beginSetup: l, enableTotp: d, clearError: u, reset: g } = en(), [m, h] = N("qr"), [y, f] = N(""), [p, v] = N(!1), [A, b] = N(!1), _ = z(null);
|
|
16657
16666
|
U(() => {
|
|
16658
16667
|
a === "idle" && l().catch(() => {
|
|
16659
16668
|
});
|
|
16660
16669
|
}, [a, l]), U(() => {
|
|
16661
16670
|
a === "success" && t?.();
|
|
16662
16671
|
}, [a, t]);
|
|
16663
|
-
const
|
|
16672
|
+
const k = async () => {
|
|
16664
16673
|
n?.secret && (await navigator.clipboard.writeText(n.secret), v(!0), _.current !== null && window.clearTimeout(_.current), _.current = window.setTimeout(() => v(!1), 2e3));
|
|
16665
16674
|
}, E = async () => {
|
|
16666
16675
|
if (n?.recoveryCodes) {
|
|
16667
|
-
const
|
|
16676
|
+
const x = n.recoveryCodes.join(`
|
|
16668
16677
|
`);
|
|
16669
|
-
await navigator.clipboard.writeText(
|
|
16678
|
+
await navigator.clipboard.writeText(x);
|
|
16670
16679
|
}
|
|
16671
16680
|
}, w = async () => {
|
|
16672
16681
|
try {
|
|
@@ -16674,7 +16683,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16674
16683
|
} catch {
|
|
16675
16684
|
f("");
|
|
16676
16685
|
}
|
|
16677
|
-
},
|
|
16686
|
+
}, P = () => {
|
|
16678
16687
|
g(), s?.();
|
|
16679
16688
|
};
|
|
16680
16689
|
return U(() => () => {
|
|
@@ -16687,7 +16696,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16687
16696
|
{
|
|
16688
16697
|
type: "button",
|
|
16689
16698
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
16690
|
-
onClick:
|
|
16699
|
+
onClick: P,
|
|
16691
16700
|
children: "Cancel"
|
|
16692
16701
|
}
|
|
16693
16702
|
),
|
|
@@ -16742,7 +16751,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16742
16751
|
{
|
|
16743
16752
|
type: "button",
|
|
16744
16753
|
className: "cedros-button cedros-button-ghost cedros-button-sm",
|
|
16745
|
-
onClick:
|
|
16754
|
+
onClick: k,
|
|
16746
16755
|
"aria-label": "Copy secret",
|
|
16747
16756
|
children: p ? "Copied!" : "Copy"
|
|
16748
16757
|
}
|
|
@@ -16755,7 +16764,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16755
16764
|
{
|
|
16756
16765
|
type: "button",
|
|
16757
16766
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
16758
|
-
onClick:
|
|
16767
|
+
onClick: P,
|
|
16759
16768
|
children: "Cancel"
|
|
16760
16769
|
}
|
|
16761
16770
|
),
|
|
@@ -16773,7 +16782,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16773
16782
|
m === "backup" && /* @__PURE__ */ i("div", { className: "cedros-totp-step", children: [
|
|
16774
16783
|
/* @__PURE__ */ e("h3", { className: "cedros-totp-title", children: "Save recovery codes" }),
|
|
16775
16784
|
/* @__PURE__ */ e("p", { className: "cedros-totp-description", children: "Save these codes in a secure place. You can use them to access your account if you lose your authenticator device." }),
|
|
16776
|
-
/* @__PURE__ */ e("div", { className: "cedros-totp-backup-codes", children: n.recoveryCodes.map((
|
|
16785
|
+
/* @__PURE__ */ e("div", { className: "cedros-totp-backup-codes", children: n.recoveryCodes.map((x, M) => /* @__PURE__ */ e("code", { className: "cedros-totp-backup-code", children: x }, M)) }),
|
|
16777
16786
|
/* @__PURE__ */ e(
|
|
16778
16787
|
"button",
|
|
16779
16788
|
{
|
|
@@ -16789,8 +16798,8 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16789
16798
|
{
|
|
16790
16799
|
type: "checkbox",
|
|
16791
16800
|
className: "cedros-checkbox",
|
|
16792
|
-
checked:
|
|
16793
|
-
onChange: (
|
|
16801
|
+
checked: A,
|
|
16802
|
+
onChange: (x) => b(x.target.checked)
|
|
16794
16803
|
}
|
|
16795
16804
|
),
|
|
16796
16805
|
/* @__PURE__ */ e("span", { className: "cedros-checkbox-text", children: "I have saved these recovery codes" })
|
|
@@ -16811,7 +16820,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16811
16820
|
type: "button",
|
|
16812
16821
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
16813
16822
|
onClick: () => h("verify"),
|
|
16814
|
-
disabled: !
|
|
16823
|
+
disabled: !A,
|
|
16815
16824
|
children: "Continue"
|
|
16816
16825
|
}
|
|
16817
16826
|
)
|
|
@@ -16860,7 +16869,7 @@ function Ol({ onSuccess: t, onCancel: s, className: r = "" }) {
|
|
|
16860
16869
|
] }) : null;
|
|
16861
16870
|
}
|
|
16862
16871
|
function Qc({ onStatusChange: t, className: s = "" }) {
|
|
16863
|
-
const { status: r, isLoading: a, error: n, getStatus: o, disableTotp: c, regenerateBackupCodes: l, clearError: d } = en(), [u, g] = N("status"), [m, h] = N(""), [y, f] = N(""), [p, v] = N(null), [
|
|
16872
|
+
const { status: r, isLoading: a, error: n, getStatus: o, disableTotp: c, regenerateBackupCodes: l, clearError: d } = en(), [u, g] = N("status"), [m, h] = N(""), [y, f] = N(""), [p, v] = N(null), [A, b] = N(!1), [_, k] = N(null);
|
|
16864
16873
|
U(() => {
|
|
16865
16874
|
o().catch(() => {
|
|
16866
16875
|
});
|
|
@@ -16868,25 +16877,25 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16868
16877
|
const E = C(() => {
|
|
16869
16878
|
g("status"), t?.(!0);
|
|
16870
16879
|
}, [t]), w = async () => {
|
|
16871
|
-
b(!0),
|
|
16880
|
+
b(!0), k(null);
|
|
16872
16881
|
try {
|
|
16873
16882
|
await c(m), g("status"), h(""), t?.(!1);
|
|
16874
|
-
} catch (
|
|
16875
|
-
|
|
16883
|
+
} catch (M) {
|
|
16884
|
+
k(M instanceof Error ? M.message : "Failed to disable 2FA"), h("");
|
|
16876
16885
|
} finally {
|
|
16877
16886
|
b(!1);
|
|
16878
16887
|
}
|
|
16879
|
-
},
|
|
16880
|
-
b(!0),
|
|
16888
|
+
}, P = async () => {
|
|
16889
|
+
b(!0), k(null);
|
|
16881
16890
|
try {
|
|
16882
|
-
const
|
|
16883
|
-
v(
|
|
16884
|
-
} catch (
|
|
16885
|
-
|
|
16891
|
+
const M = await l(y);
|
|
16892
|
+
v(M.recoveryCodes), f("");
|
|
16893
|
+
} catch (M) {
|
|
16894
|
+
k(M instanceof Error ? M.message : "Failed to regenerate codes"), f("");
|
|
16886
16895
|
} finally {
|
|
16887
16896
|
b(!1);
|
|
16888
16897
|
}
|
|
16889
|
-
},
|
|
16898
|
+
}, x = async () => {
|
|
16890
16899
|
p && await navigator.clipboard.writeText(p.join(`
|
|
16891
16900
|
`));
|
|
16892
16901
|
};
|
|
@@ -16908,7 +16917,7 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16908
16917
|
re,
|
|
16909
16918
|
{
|
|
16910
16919
|
error: { code: "UNKNOWN_ERROR", message: _ },
|
|
16911
|
-
onDismiss: () =>
|
|
16920
|
+
onDismiss: () => k(null)
|
|
16912
16921
|
}
|
|
16913
16922
|
) }),
|
|
16914
16923
|
/* @__PURE__ */ e("div", { className: "cedros-totp-verify-input", children: /* @__PURE__ */ e(
|
|
@@ -16917,8 +16926,8 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16917
16926
|
label: "Password",
|
|
16918
16927
|
placeholder: "Enter your password",
|
|
16919
16928
|
value: m,
|
|
16920
|
-
onChange: (
|
|
16921
|
-
disabled:
|
|
16929
|
+
onChange: (M) => h(M.target.value),
|
|
16930
|
+
disabled: A,
|
|
16922
16931
|
autoFocus: !0
|
|
16923
16932
|
}
|
|
16924
16933
|
) }),
|
|
@@ -16929,9 +16938,9 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16929
16938
|
type: "button",
|
|
16930
16939
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
16931
16940
|
onClick: () => {
|
|
16932
|
-
g("status"), h(""),
|
|
16941
|
+
g("status"), h(""), k(null);
|
|
16933
16942
|
},
|
|
16934
|
-
disabled:
|
|
16943
|
+
disabled: A,
|
|
16935
16944
|
children: "Cancel"
|
|
16936
16945
|
}
|
|
16937
16946
|
),
|
|
@@ -16941,8 +16950,8 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16941
16950
|
type: "button",
|
|
16942
16951
|
className: "cedros-button cedros-button-destructive cedros-button-md",
|
|
16943
16952
|
onClick: w,
|
|
16944
|
-
disabled:
|
|
16945
|
-
children:
|
|
16953
|
+
disabled: A || m.length === 0,
|
|
16954
|
+
children: A ? /* @__PURE__ */ i(K, { children: [
|
|
16946
16955
|
/* @__PURE__ */ e(G, { size: "sm" }),
|
|
16947
16956
|
/* @__PURE__ */ e("span", { children: "Disabling..." })
|
|
16948
16957
|
] }) : "Disable 2FA"
|
|
@@ -16952,13 +16961,13 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16952
16961
|
] }) }) : u === "regenerate" ? p ? /* @__PURE__ */ e("div", { className: `cedros-totp-settings ${s}`, children: /* @__PURE__ */ i("div", { className: "cedros-totp-panel", children: [
|
|
16953
16962
|
/* @__PURE__ */ e("h3", { className: "cedros-totp-title", children: "New recovery codes" }),
|
|
16954
16963
|
/* @__PURE__ */ e("p", { className: "cedros-totp-description", children: "Save these codes in a secure place. Your old codes are no longer valid." }),
|
|
16955
|
-
/* @__PURE__ */ e("div", { className: "cedros-totp-backup-codes", children: p.map((
|
|
16964
|
+
/* @__PURE__ */ e("div", { className: "cedros-totp-backup-codes", children: p.map((M, D) => /* @__PURE__ */ e("code", { className: "cedros-totp-backup-code", children: M }, D)) }),
|
|
16956
16965
|
/* @__PURE__ */ e(
|
|
16957
16966
|
"button",
|
|
16958
16967
|
{
|
|
16959
16968
|
type: "button",
|
|
16960
16969
|
className: "cedros-button cedros-button-outline cedros-button-md cedros-button-full",
|
|
16961
|
-
onClick:
|
|
16970
|
+
onClick: x,
|
|
16962
16971
|
children: "Copy all codes"
|
|
16963
16972
|
}
|
|
16964
16973
|
),
|
|
@@ -16980,7 +16989,7 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16980
16989
|
re,
|
|
16981
16990
|
{
|
|
16982
16991
|
error: { code: "UNKNOWN_ERROR", message: _ },
|
|
16983
|
-
onDismiss: () =>
|
|
16992
|
+
onDismiss: () => k(null)
|
|
16984
16993
|
}
|
|
16985
16994
|
) }),
|
|
16986
16995
|
/* @__PURE__ */ e("div", { className: "cedros-totp-verify-input", children: /* @__PURE__ */ e(
|
|
@@ -16988,8 +16997,8 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
16988
16997
|
{
|
|
16989
16998
|
value: y,
|
|
16990
16999
|
onChange: f,
|
|
16991
|
-
onComplete:
|
|
16992
|
-
disabled:
|
|
17000
|
+
onComplete: P,
|
|
17001
|
+
disabled: A,
|
|
16993
17002
|
autoFocus: !0
|
|
16994
17003
|
}
|
|
16995
17004
|
) }),
|
|
@@ -17000,9 +17009,9 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
17000
17009
|
type: "button",
|
|
17001
17010
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
17002
17011
|
onClick: () => {
|
|
17003
|
-
g("status"), f(""),
|
|
17012
|
+
g("status"), f(""), k(null);
|
|
17004
17013
|
},
|
|
17005
|
-
disabled:
|
|
17014
|
+
disabled: A,
|
|
17006
17015
|
children: "Cancel"
|
|
17007
17016
|
}
|
|
17008
17017
|
),
|
|
@@ -17011,9 +17020,9 @@ function Qc({ onStatusChange: t, className: s = "" }) {
|
|
|
17011
17020
|
{
|
|
17012
17021
|
type: "button",
|
|
17013
17022
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
17014
|
-
onClick:
|
|
17015
|
-
disabled:
|
|
17016
|
-
children:
|
|
17023
|
+
onClick: P,
|
|
17024
|
+
disabled: A || y.length !== 6,
|
|
17025
|
+
children: A ? /* @__PURE__ */ i(K, { children: [
|
|
17017
17026
|
/* @__PURE__ */ e(G, { size: "sm" }),
|
|
17018
17027
|
/* @__PURE__ */ e("span", { children: "Regenerating..." })
|
|
17019
17028
|
] }) : "Regenerate codes"
|
|
@@ -17155,9 +17164,9 @@ function Kc({
|
|
|
17155
17164
|
onClose: s,
|
|
17156
17165
|
className: r = ""
|
|
17157
17166
|
}) {
|
|
17158
|
-
const { user: a } = mr(), { isLoading: n, error: o, changePassword: c, clearError: l } = $l(), [d, u] = N("main"), [g, m] = N(""), [h, y] = N(""), [f, p] = N(""), [v,
|
|
17167
|
+
const { user: a } = mr(), { isLoading: n, error: o, changePassword: c, clearError: l } = $l(), [d, u] = N("main"), [g, m] = N(""), [h, y] = N(""), [f, p] = N(""), [v, A] = N(null), [b, _] = N(null), k = Sr(h), E = h === f, w = g.length > 0 && h.length > 0 && f.length > 0 && k.isValid && E, P = C(async () => {
|
|
17159
17168
|
if (w) {
|
|
17160
|
-
|
|
17169
|
+
A(null), _(null);
|
|
17161
17170
|
try {
|
|
17162
17171
|
await c({
|
|
17163
17172
|
currentPassword: g,
|
|
@@ -17165,13 +17174,13 @@ function Kc({
|
|
|
17165
17174
|
}), m(""), y(""), p(""), _("Password changed successfully. Other sessions have been logged out."), t?.(), setTimeout(() => {
|
|
17166
17175
|
u("main"), _(null);
|
|
17167
17176
|
}, 2e3);
|
|
17168
|
-
} catch (
|
|
17169
|
-
|
|
17177
|
+
} catch (D) {
|
|
17178
|
+
A(D instanceof Error ? D.message : "Failed to change password");
|
|
17170
17179
|
}
|
|
17171
17180
|
}
|
|
17172
|
-
}, [w, g, h, c, t]),
|
|
17173
|
-
u("main"), m(""), y(""), p(""),
|
|
17174
|
-
}, [l]),
|
|
17181
|
+
}, [w, g, h, c, t]), x = C(() => {
|
|
17182
|
+
u("main"), m(""), y(""), p(""), A(null), l();
|
|
17183
|
+
}, [l]), M = () => a?.name ? a.name.split(" ").map((D) => D[0]).join("").toUpperCase().slice(0, 2) : a?.email ? a.email[0].toUpperCase() : "?";
|
|
17175
17184
|
return d === "change-password" ? /* @__PURE__ */ e("div", { className: `cedros-profile-settings ${r}`, children: /* @__PURE__ */ i("div", { className: "cedros-profile-panel", children: [
|
|
17176
17185
|
/* @__PURE__ */ e("h3", { className: "cedros-profile-title", children: "Change password" }),
|
|
17177
17186
|
/* @__PURE__ */ e("p", { className: "cedros-profile-description", children: "Enter your current password and choose a new one. This will log you out of other devices." }),
|
|
@@ -17180,7 +17189,7 @@ function Kc({
|
|
|
17180
17189
|
{
|
|
17181
17190
|
error: { code: "UNKNOWN_ERROR", message: v || o?.message || "" },
|
|
17182
17191
|
onDismiss: () => {
|
|
17183
|
-
|
|
17192
|
+
A(null), l();
|
|
17184
17193
|
}
|
|
17185
17194
|
}
|
|
17186
17195
|
) }),
|
|
@@ -17195,7 +17204,7 @@ function Kc({
|
|
|
17195
17204
|
label: "Current password",
|
|
17196
17205
|
placeholder: "Enter your current password",
|
|
17197
17206
|
value: g,
|
|
17198
|
-
onChange: (
|
|
17207
|
+
onChange: (D) => m(D.target.value),
|
|
17199
17208
|
disabled: n,
|
|
17200
17209
|
autoFocus: !0
|
|
17201
17210
|
}
|
|
@@ -17206,7 +17215,7 @@ function Kc({
|
|
|
17206
17215
|
label: "New password",
|
|
17207
17216
|
placeholder: "Enter new password",
|
|
17208
17217
|
value: h,
|
|
17209
|
-
onChange: (
|
|
17218
|
+
onChange: (D) => y(D.target.value),
|
|
17210
17219
|
disabled: n,
|
|
17211
17220
|
showStrengthMeter: !0
|
|
17212
17221
|
}
|
|
@@ -17217,7 +17226,7 @@ function Kc({
|
|
|
17217
17226
|
label: "Confirm new password",
|
|
17218
17227
|
placeholder: "Confirm new password",
|
|
17219
17228
|
value: f,
|
|
17220
|
-
onChange: (
|
|
17229
|
+
onChange: (D) => p(D.target.value),
|
|
17221
17230
|
disabled: n,
|
|
17222
17231
|
error: f.length > 0 && !E ? "Passwords do not match" : void 0
|
|
17223
17232
|
}
|
|
@@ -17229,7 +17238,7 @@ function Kc({
|
|
|
17229
17238
|
{
|
|
17230
17239
|
type: "button",
|
|
17231
17240
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
17232
|
-
onClick:
|
|
17241
|
+
onClick: x,
|
|
17233
17242
|
disabled: n,
|
|
17234
17243
|
children: "Cancel"
|
|
17235
17244
|
}
|
|
@@ -17239,7 +17248,7 @@ function Kc({
|
|
|
17239
17248
|
{
|
|
17240
17249
|
type: "button",
|
|
17241
17250
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
17242
|
-
onClick:
|
|
17251
|
+
onClick: P,
|
|
17243
17252
|
disabled: n || !w,
|
|
17244
17253
|
children: n ? /* @__PURE__ */ i(K, { children: [
|
|
17245
17254
|
/* @__PURE__ */ e(G, { size: "sm" }),
|
|
@@ -17257,7 +17266,7 @@ function Kc({
|
|
|
17257
17266
|
alt: a.name || "Profile",
|
|
17258
17267
|
className: "cedros-profile-avatar"
|
|
17259
17268
|
}
|
|
17260
|
-
) : /* @__PURE__ */ e("div", { className: "cedros-profile-avatar cedros-profile-avatar-fallback", children:
|
|
17269
|
+
) : /* @__PURE__ */ e("div", { className: "cedros-profile-avatar cedros-profile-avatar-fallback", children: M() }) }),
|
|
17261
17270
|
/* @__PURE__ */ i("div", { className: "cedros-profile-info", children: [
|
|
17262
17271
|
/* @__PURE__ */ e("h3", { className: "cedros-profile-name", children: a?.name || "User" }),
|
|
17263
17272
|
/* @__PURE__ */ e("p", { className: "cedros-profile-email", children: a?.email })
|
|
@@ -17356,8 +17365,8 @@ function Wl() {
|
|
|
17356
17365
|
try {
|
|
17357
17366
|
const p = new URLSearchParams();
|
|
17358
17367
|
f?.limit !== void 0 && p.set("limit", String(f.limit)), f?.offset !== void 0 && p.set("offset", String(f.offset));
|
|
17359
|
-
const v = p.toString(),
|
|
17360
|
-
return await o.get(
|
|
17368
|
+
const v = p.toString(), A = v ? `/deposits?${v}` : "/deposits";
|
|
17369
|
+
return await o.get(A);
|
|
17361
17370
|
} catch (p) {
|
|
17362
17371
|
const v = B(p, "Failed to list deposits");
|
|
17363
17372
|
throw n(v.message), v;
|
|
@@ -17465,7 +17474,7 @@ function tn({
|
|
|
17465
17474
|
r(b), u(!1), m("");
|
|
17466
17475
|
},
|
|
17467
17476
|
[r]
|
|
17468
|
-
),
|
|
17477
|
+
), A = C(
|
|
17469
17478
|
(b) => {
|
|
17470
17479
|
b.key === "Escape" ? (u(!1), m("")) : b.key === "Enter" && f.length === 1 && v(f[0]);
|
|
17471
17480
|
},
|
|
@@ -17476,7 +17485,7 @@ function tn({
|
|
|
17476
17485
|
{
|
|
17477
17486
|
ref: h,
|
|
17478
17487
|
className: `cedros-token-selector ${d ? "cedros-token-selector-open" : ""} ${o ? "cedros-token-selector-disabled" : ""} ${c}`,
|
|
17479
|
-
onKeyDown:
|
|
17488
|
+
onKeyDown: A,
|
|
17480
17489
|
children: [
|
|
17481
17490
|
/* @__PURE__ */ i(
|
|
17482
17491
|
"button",
|
|
@@ -17700,8 +17709,8 @@ function on(t, s, r) {
|
|
|
17700
17709
|
if (a.length === 0)
|
|
17701
17710
|
return `Total: $${n.toFixed(2)}`;
|
|
17702
17711
|
const o = a.reduce((f, p) => f + p.solAmount, 0), c = a.reduce((f, p) => f + p.percent, 0), l = { fee: 7, sol: 8, rate: 7, usd: 8 }, d = (f) => {
|
|
17703
|
-
const p = f.label.padEnd(l.fee), v = f.solAmount.toFixed(4).padStart(6).padEnd(l.sol),
|
|
17704
|
-
return `${p} │ ${v} │ ${
|
|
17712
|
+
const p = f.label.padEnd(l.fee), v = f.solAmount.toFixed(4).padStart(6).padEnd(l.sol), A = (f.percent.toFixed(2) + "%").padStart(5).padEnd(l.rate), b = ("$" + Math.max(f.usdAmount, 0.01).toFixed(2)).padEnd(l.usd);
|
|
17713
|
+
return `${p} │ ${v} │ ${A} │ ${b}`;
|
|
17705
17714
|
}, u = `${"Fee".padEnd(l.fee)} │ ${"SOL".padEnd(l.sol)} │ ${"+ Rate".padEnd(l.rate)} │ ${"= Total".padEnd(l.usd)}`, g = `${"─".repeat(l.fee)}─┼─${"─".repeat(l.sol)}─┼─${"─".repeat(l.rate)}─┼─${"─".repeat(l.usd)}`, m = ("$" + n.toFixed(2)).padEnd(l.usd), h = `${"TOTAL".padEnd(l.fee)} │ ${o.toFixed(4).padStart(6).padEnd(l.sol)} │ ${(c.toFixed(2) + "%").padStart(5).padEnd(l.rate)} │ ${m}`;
|
|
17706
17715
|
return [u, g, ...a.map(d), g, h].join(`
|
|
17707
17716
|
`);
|
|
@@ -17755,12 +17764,12 @@ function Gc({
|
|
|
17755
17764
|
pollInterval: f = 5e3,
|
|
17756
17765
|
demoMode: p = !1,
|
|
17757
17766
|
demoAutoConfirmMs: v,
|
|
17758
|
-
tokenPriceUsd:
|
|
17767
|
+
tokenPriceUsd: A,
|
|
17759
17768
|
showExplainer: b = !1,
|
|
17760
17769
|
siteName: _,
|
|
17761
|
-
explainerConfig:
|
|
17770
|
+
explainerConfig: k
|
|
17762
17771
|
}) {
|
|
17763
|
-
const { deposit: E, getStatus: w, error:
|
|
17772
|
+
const { deposit: E, getStatus: w, error: P, clearError: x } = Wl(), M = ft(), D = hr(t.quickActionTokens), L = hr(t.customTokenSymbols), S = O(() => {
|
|
17764
17773
|
const Q = t.customTokens ?? [];
|
|
17765
17774
|
if (Q.length === 0) return a;
|
|
17766
17775
|
const X = new Set(a.map((oe) => oe.symbol)), se = [...a];
|
|
@@ -17774,15 +17783,15 @@ function Gc({
|
|
|
17774
17783
|
logoUrl: oe.logoUrl
|
|
17775
17784
|
}), X.add(oe.symbol));
|
|
17776
17785
|
return se;
|
|
17777
|
-
}, [a, t.customTokens]),
|
|
17778
|
-
if (
|
|
17779
|
-
const Q = S.filter((X) =>
|
|
17786
|
+
}, [a, t.customTokens]), T = O(() => {
|
|
17787
|
+
if (L.length === 0) return S;
|
|
17788
|
+
const Q = S.filter((X) => L.includes(X.symbol));
|
|
17780
17789
|
return Q.length > 0 ? Q : S;
|
|
17781
|
-
}, [S,
|
|
17790
|
+
}, [S, L]), R = t.privateDepositsEnabled, I = r ? r === "sign" && !R ? "receive" : r : R && M.hasExternalWallet ? "sign" : "receive", j = D[0] ? S.find((Q) => Q.symbol === D[0]) : void 0, ee = s === "sol" ? Ie : s === "single-token" ? j ?? S.find((Q) => Q.symbol === "USDC") ?? S[0] ?? Ie : n ?? j ?? S.find((Q) => Q.symbol === "USDC") ?? S.find((Q) => Q.symbol !== "SOL") ?? S[0] ?? Ie, ne = C(() => b ? "explainer" : "unlock", [b]), [V, Y] = N(ne), [q, Z] = N(ee), [ce, le] = N(""), [te, F] = N(null), [W, $] = N(null), [H, he] = N(null), [ye, Ke] = N(null), [We, Ce] = N(!1), [bt, je] = N(!1), [xe, Ge] = N(null);
|
|
17782
17791
|
U(() => {
|
|
17783
|
-
Y(ne()), Z(ee), le(""), F(null), $(null), he(null), Ke(null), Ce(!1), je(!1), Ge(null),
|
|
17784
|
-
}, [s, I, ee,
|
|
17785
|
-
const wt = o ?? t.privateMinSol, vt = c, Ee = parseFloat(ce), J =
|
|
17792
|
+
Y(ne()), Z(ee), le(""), F(null), $(null), he(null), Ke(null), Ce(!1), je(!1), Ge(null), x();
|
|
17793
|
+
}, [s, I, ee, x, ne]);
|
|
17794
|
+
const wt = o ?? t.privateMinSol, vt = c, Ee = parseFloat(ce), J = M.status === "enrolled_locked" || M.status === "enrolled_unlocked" || M.status === "unlocked", Ae = J && M.isUnlocked, At = J && !M.isUnlocked, gs = C(() => {
|
|
17786
17795
|
let se = I === "sign" ? [
|
|
17787
17796
|
{ key: "unlock", label: "Authorize" },
|
|
17788
17797
|
{ key: "confirm", label: "Send" },
|
|
@@ -17817,7 +17826,7 @@ function Gc({
|
|
|
17817
17826
|
[m, I, Ee, q]
|
|
17818
17827
|
), gn = C(
|
|
17819
17828
|
async (Q, X) => {
|
|
17820
|
-
|
|
17829
|
+
x(), $(null), Y("signing");
|
|
17821
17830
|
const se = Q ?? Ee, oe = X ?? q;
|
|
17822
17831
|
if (!p) {
|
|
17823
17832
|
if (At && g) {
|
|
@@ -17878,12 +17887,12 @@ function Gc({
|
|
|
17878
17887
|
g,
|
|
17879
17888
|
l,
|
|
17880
17889
|
d,
|
|
17881
|
-
|
|
17890
|
+
x
|
|
17882
17891
|
]
|
|
17883
17892
|
), yn = C(() => {
|
|
17884
17893
|
Y("waiting");
|
|
17885
17894
|
}, []), kt = C(async () => {
|
|
17886
|
-
const Q = ye ||
|
|
17895
|
+
const Q = ye || M.solanaPubkey;
|
|
17887
17896
|
if (Q)
|
|
17888
17897
|
try {
|
|
17889
17898
|
await navigator.clipboard.writeText(Q), Ce(!0), setTimeout(() => Ce(!1), 2e3);
|
|
@@ -17891,7 +17900,7 @@ function Gc({
|
|
|
17891
17900
|
const X = document.createElement("textarea");
|
|
17892
17901
|
X.value = Q, document.body.appendChild(X), X.select(), document.execCommand("copy"), document.body.removeChild(X), Ce(!0), setTimeout(() => Ce(!1), 2e3);
|
|
17893
17902
|
}
|
|
17894
|
-
}, [ye,
|
|
17903
|
+
}, [ye, M.solanaPubkey]);
|
|
17895
17904
|
U(() => {
|
|
17896
17905
|
if (!(V === "confirm" || V === "show-address" || V === "waiting") || !H || p) return;
|
|
17897
17906
|
let X = !1, se = 0;
|
|
@@ -17909,7 +17918,7 @@ function Gc({
|
|
|
17909
17918
|
sessionId: H,
|
|
17910
17919
|
response: me,
|
|
17911
17920
|
method: "receive",
|
|
17912
|
-
depositAddress:
|
|
17921
|
+
depositAddress: M.solanaPubkey ?? void 0
|
|
17913
17922
|
};
|
|
17914
17923
|
F(Xe), Y("success"), l?.(Xe);
|
|
17915
17924
|
return;
|
|
@@ -17929,7 +17938,7 @@ function Gc({
|
|
|
17929
17938
|
w,
|
|
17930
17939
|
q,
|
|
17931
17940
|
s,
|
|
17932
|
-
|
|
17941
|
+
M.solanaPubkey,
|
|
17933
17942
|
l,
|
|
17934
17943
|
f
|
|
17935
17944
|
]), U(() => {
|
|
@@ -17968,8 +17977,8 @@ function Gc({
|
|
|
17968
17977
|
l
|
|
17969
17978
|
]);
|
|
17970
17979
|
const bn = C(() => {
|
|
17971
|
-
Y(ne()), le(""), F(null), $(null),
|
|
17972
|
-
}, [ne,
|
|
17980
|
+
Y(ne()), le(""), F(null), $(null), x();
|
|
17981
|
+
}, [ne, x]);
|
|
17973
17982
|
return t.enabled ? /* @__PURE__ */ i("div", { className: `cedros-deposit-flow ${h}`, children: [
|
|
17974
17983
|
y && V !== "error" && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-steps", children: gs.map((Q, X) => {
|
|
17975
17984
|
const se = pn >= X, oe = Q.key === V;
|
|
@@ -17996,11 +18005,11 @@ function Gc({
|
|
|
17996
18005
|
Zl,
|
|
17997
18006
|
{
|
|
17998
18007
|
siteName: _,
|
|
17999
|
-
config:
|
|
18008
|
+
config: k,
|
|
18000
18009
|
depositConfig: t,
|
|
18001
18010
|
currencyMode: s,
|
|
18002
18011
|
token: q,
|
|
18003
|
-
tokens:
|
|
18012
|
+
tokens: T,
|
|
18004
18013
|
onContinue: () => Y("unlock"),
|
|
18005
18014
|
onCancel: u
|
|
18006
18015
|
}
|
|
@@ -18009,7 +18018,7 @@ function Gc({
|
|
|
18009
18018
|
ec,
|
|
18010
18019
|
{
|
|
18011
18020
|
token: q,
|
|
18012
|
-
tokens:
|
|
18021
|
+
tokens: T,
|
|
18013
18022
|
currencyMode: s,
|
|
18014
18023
|
depositMethod: I,
|
|
18015
18024
|
isAuthorizing: bt,
|
|
@@ -18024,12 +18033,12 @@ function Gc({
|
|
|
18024
18033
|
{
|
|
18025
18034
|
token: q,
|
|
18026
18035
|
tokens: S,
|
|
18027
|
-
quickActionSymbols:
|
|
18028
|
-
customTokenSymbols:
|
|
18036
|
+
quickActionSymbols: D,
|
|
18037
|
+
customTokenSymbols: L,
|
|
18029
18038
|
currencyMode: s,
|
|
18030
18039
|
minAmount: wt,
|
|
18031
18040
|
maxAmount: vt,
|
|
18032
|
-
depositAddress: ye ||
|
|
18041
|
+
depositAddress: ye || M.solanaPubkey,
|
|
18033
18042
|
walletReady: Ae || p,
|
|
18034
18043
|
needsUnlock: At && !p,
|
|
18035
18044
|
copied: We,
|
|
@@ -18043,17 +18052,17 @@ function Gc({
|
|
|
18043
18052
|
onCancel: u
|
|
18044
18053
|
}
|
|
18045
18054
|
),
|
|
18046
|
-
V === "signing" && /* @__PURE__ */ e(sc, { depositAddress:
|
|
18055
|
+
V === "signing" && /* @__PURE__ */ e(sc, { depositAddress: M.solanaPubkey }),
|
|
18047
18056
|
V === "show-address" && /* @__PURE__ */ e(
|
|
18048
18057
|
rc,
|
|
18049
18058
|
{
|
|
18050
18059
|
token: q,
|
|
18051
18060
|
tokens: S,
|
|
18052
|
-
quickActionSymbols:
|
|
18053
|
-
customTokenSymbols:
|
|
18054
|
-
tokenPriceUsd:
|
|
18061
|
+
quickActionSymbols: D,
|
|
18062
|
+
customTokenSymbols: L,
|
|
18063
|
+
tokenPriceUsd: A,
|
|
18055
18064
|
currencyMode: s,
|
|
18056
|
-
depositAddress: ye ||
|
|
18065
|
+
depositAddress: ye || M.solanaPubkey,
|
|
18057
18066
|
copied: We,
|
|
18058
18067
|
isListening: !!H && !p,
|
|
18059
18068
|
config: t,
|
|
@@ -18069,7 +18078,7 @@ function Gc({
|
|
|
18069
18078
|
nc,
|
|
18070
18079
|
{
|
|
18071
18080
|
token: q,
|
|
18072
|
-
depositAddress: ye ||
|
|
18081
|
+
depositAddress: ye || M.solanaPubkey,
|
|
18073
18082
|
copied: We,
|
|
18074
18083
|
feeLine: xe ? `Fees: $${Math.max(yt(t, xe), 0.01).toFixed(2)} total` : "Fees: calculated after deposit",
|
|
18075
18084
|
onCopy: kt
|
|
@@ -18079,7 +18088,7 @@ function Gc({
|
|
|
18079
18088
|
V === "error" && /* @__PURE__ */ e(
|
|
18080
18089
|
oc,
|
|
18081
18090
|
{
|
|
18082
|
-
error: W ||
|
|
18091
|
+
error: W || P || "An error occurred",
|
|
18083
18092
|
onRetry: () => Y("confirm"),
|
|
18084
18093
|
onCancel: u
|
|
18085
18094
|
}
|
|
@@ -18231,27 +18240,27 @@ function tc({
|
|
|
18231
18240
|
onTokenSelect: f,
|
|
18232
18241
|
onUnlockRequired: p,
|
|
18233
18242
|
onConfirm: v,
|
|
18234
|
-
onBack:
|
|
18243
|
+
onBack: A
|
|
18235
18244
|
}) {
|
|
18236
|
-
const [b, _] = N(h.privateMinUsd), [
|
|
18245
|
+
const [b, _] = N(h.privateMinUsd), [k, E] = N(!1), [w, P] = N(!1), [x, M] = N(0), [D, L] = N(null), T = hs(b, h) === "sol_micro", R = t.symbol === Ue.symbol, I = O(() => {
|
|
18237
18246
|
const W = a.length === 0 ? s : s.filter((he) => a.includes(he.symbol)), $ = W.length > 0 ? W : s;
|
|
18238
18247
|
return $.some((he) => he.symbol === Ue.symbol) ? $ : [...$, Ue];
|
|
18239
|
-
}, [s, a]), j = yt(h, b), ee = j < 0.01 ? 0.01 : j, ne = R ? "Fees: calculated after deposit" : `Fees: $${ee.toFixed(2)} total`, V = R ? "" : on(h, b, j), Y = dn(
|
|
18248
|
+
}, [s, a]), j = yt(h, b), ee = j < 0.01 ? 0.01 : j, ne = R ? "Fees: calculated after deposit" : `Fees: $${ee.toFixed(2)} total`, V = R ? "" : on(h, b, j), Y = dn(T ? Ie : t, h), q = Y ? b / Y : t.symbol === "SOL" && h.solPriceUsd > 0 ? b / h.solPriceUsd : b, Z = q ? un(q, T ? "SOL" : t.symbol) : null, le = b - j <= 0 && b > 0, te = !R && b > 0 && !le && q >= o && q <= c;
|
|
18240
18249
|
U(() => {
|
|
18241
18250
|
if (n === "multi-token")
|
|
18242
|
-
if (
|
|
18243
|
-
|
|
18251
|
+
if (T && t.symbol !== "SOL") {
|
|
18252
|
+
L(t);
|
|
18244
18253
|
const W = s.find(($) => $.symbol === "SOL");
|
|
18245
18254
|
W && f(W);
|
|
18246
|
-
} else !
|
|
18247
|
-
}, [
|
|
18255
|
+
} else !T && D && t.symbol === "SOL" && (f(D), L(null));
|
|
18256
|
+
}, [T, t.symbol, n, s, f, D, t]);
|
|
18248
18257
|
const F = () => {
|
|
18249
18258
|
te && v(q, t);
|
|
18250
18259
|
};
|
|
18251
18260
|
return /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-step", children: [
|
|
18252
18261
|
/* @__PURE__ */ e("h4", { className: "cedros-deposit-flow-step-title", children: "Choose Amount" }),
|
|
18253
18262
|
/* @__PURE__ */ e("p", { className: "cedros-deposit-flow-step-desc", children: "Set how much you want to deposit. Higher tiers unlock privacy." }),
|
|
18254
|
-
n === "multi-token" && !
|
|
18263
|
+
n === "multi-token" && !T && /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-field", children: [
|
|
18255
18264
|
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: "Token" }),
|
|
18256
18265
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-token-quick", children: [
|
|
18257
18266
|
r.map((W) => {
|
|
@@ -18284,21 +18293,21 @@ function tc({
|
|
|
18284
18293
|
"button",
|
|
18285
18294
|
{
|
|
18286
18295
|
type: "button",
|
|
18287
|
-
className: `cedros-deposit-flow-token-quick-btn ${
|
|
18296
|
+
className: `cedros-deposit-flow-token-quick-btn ${k ? "is-active" : ""}`,
|
|
18288
18297
|
onClick: () => {
|
|
18289
|
-
E(!0),
|
|
18298
|
+
E(!0), M((W) => W + 1);
|
|
18290
18299
|
},
|
|
18291
18300
|
children: "Custom"
|
|
18292
18301
|
}
|
|
18293
18302
|
)
|
|
18294
18303
|
] }),
|
|
18295
|
-
|
|
18304
|
+
k && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-token-custom", children: /* @__PURE__ */ e(
|
|
18296
18305
|
tn,
|
|
18297
18306
|
{
|
|
18298
18307
|
tokens: I,
|
|
18299
18308
|
selectedToken: t,
|
|
18300
18309
|
onSelect: f,
|
|
18301
|
-
openSignal:
|
|
18310
|
+
openSignal: x
|
|
18302
18311
|
}
|
|
18303
18312
|
) })
|
|
18304
18313
|
] }),
|
|
@@ -18312,7 +18321,7 @@ function tc({
|
|
|
18312
18321
|
}
|
|
18313
18322
|
) }),
|
|
18314
18323
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-field", children: [
|
|
18315
|
-
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: R ? "Sign to send tokens to this address" : `Sign to send ${Z ?? "--"} ${
|
|
18324
|
+
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: R ? "Sign to send tokens to this address" : `Sign to send ${Z ?? "--"} ${T ? "SOL" : t.symbol} to this address` }),
|
|
18316
18325
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-address-box", children: [
|
|
18317
18326
|
/* @__PURE__ */ e("code", { className: "cedros-deposit-flow-address", children: l || "Loading..." }),
|
|
18318
18327
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-address-actions", children: [
|
|
@@ -18362,11 +18371,11 @@ function tc({
|
|
|
18362
18371
|
`, ", ")}`,
|
|
18363
18372
|
"aria-expanded": w,
|
|
18364
18373
|
onClick: (W) => {
|
|
18365
|
-
W.stopPropagation(),
|
|
18374
|
+
W.stopPropagation(), P(($) => !$);
|
|
18366
18375
|
},
|
|
18367
|
-
onBlur: () =>
|
|
18376
|
+
onBlur: () => P(!1),
|
|
18368
18377
|
onKeyDown: (W) => {
|
|
18369
|
-
W.key === "Escape" &&
|
|
18378
|
+
W.key === "Escape" && P(!1);
|
|
18370
18379
|
},
|
|
18371
18380
|
children: "i"
|
|
18372
18381
|
}
|
|
@@ -18397,7 +18406,7 @@ function tc({
|
|
|
18397
18406
|
{
|
|
18398
18407
|
type: "button",
|
|
18399
18408
|
className: "cedros-deposit-flow-button cedros-deposit-flow-button-secondary",
|
|
18400
|
-
onClick:
|
|
18409
|
+
onClick: A,
|
|
18401
18410
|
children: "Back"
|
|
18402
18411
|
}
|
|
18403
18412
|
),
|
|
@@ -18447,23 +18456,23 @@ function rc({
|
|
|
18447
18456
|
onSent: y,
|
|
18448
18457
|
onBack: f
|
|
18449
18458
|
}) {
|
|
18450
|
-
const [p, v] = N(u.privateMinUsd), [
|
|
18459
|
+
const [p, v] = N(u.privateMinUsd), [A, b] = N(!1), [_, k] = N(!1), [E, w] = N(0), [P, x] = N(null), D = hs(p, u) === "sol_micro", L = t.symbol === Ue.symbol, S = O(() => {
|
|
18451
18460
|
const q = a.length === 0 ? s : s.filter((le) => a.includes(le.symbol)), Z = q.length > 0 ? q : s;
|
|
18452
18461
|
return Z.some((le) => le.symbol === Ue.symbol) ? Z : [...Z, Ue];
|
|
18453
|
-
}, [s, a]),
|
|
18462
|
+
}, [s, a]), T = yt(u, p), R = T < 0.01 ? 0.01 : T, I = L ? "Fees: calculated after deposit" : `Fees: $${R.toFixed(2)} total`, j = L ? "" : on(u, p, T), ee = L || p > 0, ne = dn(D ? Ie : t, u, n), V = ne ? p / ne : null, Y = V ? un(V, t.symbol) : null;
|
|
18454
18463
|
return U(() => {
|
|
18455
18464
|
if (o === "multi-token")
|
|
18456
|
-
if (
|
|
18457
|
-
|
|
18465
|
+
if (D && t.symbol !== "SOL") {
|
|
18466
|
+
x(t);
|
|
18458
18467
|
const q = s.find((Z) => Z.symbol === "SOL");
|
|
18459
18468
|
q && m(q);
|
|
18460
|
-
} else !
|
|
18461
|
-
}, [
|
|
18469
|
+
} else !D && P && t.symbol === "SOL" && (m(P), x(null));
|
|
18470
|
+
}, [D, t.symbol, o, s, m, P, t]), U(() => {
|
|
18462
18471
|
h(p);
|
|
18463
18472
|
}, [p, h]), c ? /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-step", children: [
|
|
18464
18473
|
/* @__PURE__ */ e("h4", { className: "cedros-deposit-flow-step-title", children: "Send Deposit" }),
|
|
18465
18474
|
/* @__PURE__ */ e("p", { className: "cedros-deposit-flow-step-desc", children: "Send funds to your deposit address. We'll confirm automatically." }),
|
|
18466
|
-
o === "multi-token" && !
|
|
18475
|
+
o === "multi-token" && !D && /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-field", children: [
|
|
18467
18476
|
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: "Token" }),
|
|
18468
18477
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-token-quick", children: [
|
|
18469
18478
|
r.map((q) => {
|
|
@@ -18496,7 +18505,7 @@ function rc({
|
|
|
18496
18505
|
"button",
|
|
18497
18506
|
{
|
|
18498
18507
|
type: "button",
|
|
18499
|
-
className: `cedros-deposit-flow-token-quick-btn ${
|
|
18508
|
+
className: `cedros-deposit-flow-token-quick-btn ${A ? "is-active" : ""}`,
|
|
18500
18509
|
onClick: () => {
|
|
18501
18510
|
b(!0), w((q) => q + 1);
|
|
18502
18511
|
},
|
|
@@ -18504,7 +18513,7 @@ function rc({
|
|
|
18504
18513
|
}
|
|
18505
18514
|
)
|
|
18506
18515
|
] }),
|
|
18507
|
-
|
|
18516
|
+
A && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-token-custom", children: /* @__PURE__ */ e(
|
|
18508
18517
|
tn,
|
|
18509
18518
|
{
|
|
18510
18519
|
tokens: S,
|
|
@@ -18514,7 +18523,7 @@ function rc({
|
|
|
18514
18523
|
}
|
|
18515
18524
|
) })
|
|
18516
18525
|
] }),
|
|
18517
|
-
!
|
|
18526
|
+
!L && /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-field", children: [
|
|
18518
18527
|
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: "Deposit Amount" }),
|
|
18519
18528
|
/* @__PURE__ */ e(
|
|
18520
18529
|
nn,
|
|
@@ -18526,9 +18535,9 @@ function rc({
|
|
|
18526
18535
|
}
|
|
18527
18536
|
)
|
|
18528
18537
|
] }),
|
|
18529
|
-
|
|
18538
|
+
L && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-note", children: "Send any token you want. We'll detect the deposit, swap it, and credit your balance automatically." }),
|
|
18530
18539
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-field", children: [
|
|
18531
|
-
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children:
|
|
18540
|
+
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: L ? "Send any token to this address" : `Send ${Y ?? "--"} ${D ? "SOL" : t.symbol} to this address` }),
|
|
18532
18541
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-address-box", children: [
|
|
18533
18542
|
/* @__PURE__ */ e("code", { className: "cedros-deposit-flow-address", children: c }),
|
|
18534
18543
|
/* @__PURE__ */ e(
|
|
@@ -18553,7 +18562,7 @@ function rc({
|
|
|
18553
18562
|
/* @__PURE__ */ e("span", { className: "cedros-deposit-flow-info-dot" }),
|
|
18554
18563
|
/* @__PURE__ */ i("span", { children: [
|
|
18555
18564
|
I,
|
|
18556
|
-
!
|
|
18565
|
+
!L && /* @__PURE__ */ e(
|
|
18557
18566
|
"button",
|
|
18558
18567
|
{
|
|
18559
18568
|
type: "button",
|
|
@@ -18563,11 +18572,11 @@ function rc({
|
|
|
18563
18572
|
`, ", ")}`,
|
|
18564
18573
|
"aria-expanded": _,
|
|
18565
18574
|
onClick: (q) => {
|
|
18566
|
-
q.stopPropagation(),
|
|
18575
|
+
q.stopPropagation(), k((Z) => !Z);
|
|
18567
18576
|
},
|
|
18568
|
-
onBlur: () =>
|
|
18577
|
+
onBlur: () => k(!1),
|
|
18569
18578
|
onKeyDown: (q) => {
|
|
18570
|
-
q.key === "Escape" &&
|
|
18579
|
+
q.key === "Escape" && k(!1);
|
|
18571
18580
|
},
|
|
18572
18581
|
children: "i"
|
|
18573
18582
|
}
|
|
@@ -19042,10 +19051,10 @@ function Xc({
|
|
|
19042
19051
|
onLoad: n,
|
|
19043
19052
|
onTransactionClick: o
|
|
19044
19053
|
}) {
|
|
19045
|
-
const { getHistory: c, isLoading: l, error: d, clearError: u } = hn(), [g, m] = N(t), [h, y] = N([]), [f, p] = N(0), [v,
|
|
19046
|
-
const
|
|
19047
|
-
return
|
|
19048
|
-
}), [h,
|
|
19054
|
+
const { getHistory: c, isLoading: l, error: d, clearError: u } = hn(), [g, m] = N(t), [h, y] = N([]), [f, p] = N(0), [v, A] = N(0), [b, _] = N(null), k = Gt.find((S) => S.key === g) || Gt[0], E = O(() => k.txTypes === null ? h : h.filter((S) => {
|
|
19055
|
+
const T = S.txType || "";
|
|
19056
|
+
return k.txTypes.some((R) => T.toLowerCase().includes(R.toLowerCase()));
|
|
19057
|
+
}), [h, k.txTypes]), w = C(async () => {
|
|
19049
19058
|
try {
|
|
19050
19059
|
const S = await c({ limit: s * 3, offset: v });
|
|
19051
19060
|
y(S.transactions), p(S.total), n?.(S), _(null);
|
|
@@ -19054,7 +19063,7 @@ function Xc({
|
|
|
19054
19063
|
}
|
|
19055
19064
|
}, [s, v, c, n]);
|
|
19056
19065
|
U(() => {
|
|
19057
|
-
|
|
19066
|
+
A(0);
|
|
19058
19067
|
}, [g]), U(() => {
|
|
19059
19068
|
w();
|
|
19060
19069
|
}, [w]), U(() => {
|
|
@@ -19062,10 +19071,10 @@ function Xc({
|
|
|
19062
19071
|
const S = setInterval(w, r);
|
|
19063
19072
|
return () => clearInterval(S);
|
|
19064
19073
|
}, [r, w]);
|
|
19065
|
-
const
|
|
19066
|
-
const
|
|
19067
|
-
|
|
19068
|
-
},
|
|
19074
|
+
const P = Math.ceil(f / s), x = Math.floor(v / s) + 1, M = (S) => {
|
|
19075
|
+
const T = (S - 1) * s;
|
|
19076
|
+
A(Math.max(0, Math.min(T, Math.max(0, f - 1))));
|
|
19077
|
+
}, D = (S) => {
|
|
19069
19078
|
m(S);
|
|
19070
19079
|
};
|
|
19071
19080
|
if (b || d)
|
|
@@ -19088,8 +19097,8 @@ function Xc({
|
|
|
19088
19097
|
/* @__PURE__ */ e("span", { className: "cedros-tx-loading-indicator" }),
|
|
19089
19098
|
/* @__PURE__ */ e("span", { className: "cedros-tx-loading-text", children: "Loading transactions..." })
|
|
19090
19099
|
] });
|
|
19091
|
-
const
|
|
19092
|
-
const R =
|
|
19100
|
+
const L = (S) => S.txTypes === null ? h.length : h.filter((T) => {
|
|
19101
|
+
const R = T.txType || "";
|
|
19093
19102
|
return S.txTypes.some((I) => R.toLowerCase().includes(I.toLowerCase()));
|
|
19094
19103
|
}).length;
|
|
19095
19104
|
return /* @__PURE__ */ i("div", { className: `cedros-tx-history ${a}`, children: [
|
|
@@ -19108,31 +19117,31 @@ function Xc({
|
|
|
19108
19117
|
)
|
|
19109
19118
|
] }),
|
|
19110
19119
|
/* @__PURE__ */ e("div", { className: "cedros-tx-tabs", children: Gt.map((S) => {
|
|
19111
|
-
const
|
|
19120
|
+
const T = L(S), R = g === S.key;
|
|
19112
19121
|
return /* @__PURE__ */ i(
|
|
19113
19122
|
"button",
|
|
19114
19123
|
{
|
|
19115
19124
|
type: "button",
|
|
19116
19125
|
className: `cedros-tx-tab ${R ? "cedros-tx-tab-active" : ""}`,
|
|
19117
|
-
onClick: () =>
|
|
19126
|
+
onClick: () => D(S.key),
|
|
19118
19127
|
children: [
|
|
19119
19128
|
S.label,
|
|
19120
|
-
|
|
19129
|
+
T > 0 && /* @__PURE__ */ e("span", { className: "cedros-tx-tab-count", children: T })
|
|
19121
19130
|
]
|
|
19122
19131
|
},
|
|
19123
19132
|
S.key
|
|
19124
19133
|
);
|
|
19125
19134
|
}) }),
|
|
19126
19135
|
E.length === 0 ? /* @__PURE__ */ i("div", { className: "cedros-tx-empty", children: [
|
|
19127
|
-
/* @__PURE__ */ e("p", { className: "cedros-tx-empty-message", children: g === "all" ? "No transactions yet." : `No ${
|
|
19136
|
+
/* @__PURE__ */ e("p", { className: "cedros-tx-empty-message", children: g === "all" ? "No transactions yet." : `No ${k.label.toLowerCase()} found.` }),
|
|
19128
19137
|
g === "all" && /* @__PURE__ */ e("p", { className: "cedros-tx-empty-hint", children: "Make a deposit to get started." })
|
|
19129
19138
|
] }) : /* @__PURE__ */ i(K, { children: [
|
|
19130
19139
|
/* @__PURE__ */ e("div", { className: "cedros-tx-list", children: E.slice(0, s).map((S) => {
|
|
19131
|
-
const
|
|
19140
|
+
const T = S.amountLamports >= 0;
|
|
19132
19141
|
return /* @__PURE__ */ i(
|
|
19133
19142
|
"div",
|
|
19134
19143
|
{
|
|
19135
|
-
className: `cedros-tx-item ${
|
|
19144
|
+
className: `cedros-tx-item ${T ? "cedros-tx-item-positive" : "cedros-tx-item-negative"}`,
|
|
19136
19145
|
onClick: () => o?.(S),
|
|
19137
19146
|
onKeyDown: (R) => {
|
|
19138
19147
|
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), o?.(S));
|
|
@@ -19143,8 +19152,8 @@ function Xc({
|
|
|
19143
19152
|
/* @__PURE__ */ e(
|
|
19144
19153
|
"div",
|
|
19145
19154
|
{
|
|
19146
|
-
className: `cedros-tx-icon ${
|
|
19147
|
-
children: wc(S.txType,
|
|
19155
|
+
className: `cedros-tx-icon ${T ? "cedros-tx-icon-positive" : "cedros-tx-icon-negative"}`,
|
|
19156
|
+
children: wc(S.txType, T)
|
|
19148
19157
|
}
|
|
19149
19158
|
),
|
|
19150
19159
|
/* @__PURE__ */ i("div", { className: "cedros-tx-content", children: [
|
|
@@ -19153,7 +19162,7 @@ function Xc({
|
|
|
19153
19162
|
/* @__PURE__ */ e(
|
|
19154
19163
|
"span",
|
|
19155
19164
|
{
|
|
19156
|
-
className: `cedros-tx-amount ${
|
|
19165
|
+
className: `cedros-tx-amount ${T ? "cedros-tx-amount-positive" : "cedros-tx-amount-negative"}`,
|
|
19157
19166
|
children: gc(S.amountLamports, S.currency)
|
|
19158
19167
|
}
|
|
19159
19168
|
)
|
|
@@ -19168,30 +19177,30 @@ function Xc({
|
|
|
19168
19177
|
S.id
|
|
19169
19178
|
);
|
|
19170
19179
|
}) }),
|
|
19171
|
-
|
|
19180
|
+
P > 1 && /* @__PURE__ */ i("div", { className: "cedros-tx-pagination", children: [
|
|
19172
19181
|
/* @__PURE__ */ e(
|
|
19173
19182
|
"button",
|
|
19174
19183
|
{
|
|
19175
19184
|
type: "button",
|
|
19176
19185
|
className: "cedros-tx-page-btn",
|
|
19177
|
-
onClick: () =>
|
|
19178
|
-
disabled:
|
|
19186
|
+
onClick: () => M(x - 1),
|
|
19187
|
+
disabled: x <= 1,
|
|
19179
19188
|
children: "Previous"
|
|
19180
19189
|
}
|
|
19181
19190
|
),
|
|
19182
19191
|
/* @__PURE__ */ i("span", { className: "cedros-tx-page-info", children: [
|
|
19183
19192
|
"Page ",
|
|
19184
|
-
|
|
19193
|
+
x,
|
|
19185
19194
|
" of ",
|
|
19186
|
-
|
|
19195
|
+
P
|
|
19187
19196
|
] }),
|
|
19188
19197
|
/* @__PURE__ */ e(
|
|
19189
19198
|
"button",
|
|
19190
19199
|
{
|
|
19191
19200
|
type: "button",
|
|
19192
19201
|
className: "cedros-tx-page-btn",
|
|
19193
|
-
onClick: () =>
|
|
19194
|
-
disabled:
|
|
19202
|
+
onClick: () => M(x + 1),
|
|
19203
|
+
disabled: x >= P,
|
|
19195
19204
|
children: "Next"
|
|
19196
19205
|
}
|
|
19197
19206
|
)
|