@cedros/login-react 0.0.30 → 0.0.31
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/GoogleLoginButton-BwiL1o6U.cjs +1 -0
- package/dist/GoogleLoginButton-BwiL1o6U.cjs.map +1 -0
- package/dist/{GoogleLoginButton-DEbiQngr.js → GoogleLoginButton-CFlqxvU-.js} +94 -107
- package/dist/GoogleLoginButton-CFlqxvU-.js.map +1 -0
- package/dist/SolanaLoginButton-DHsiug1Y.js +195 -0
- package/dist/SolanaLoginButton-DHsiug1Y.js.map +1 -0
- package/dist/SolanaLoginButton-DNEcSSF_.cjs +1 -0
- package/dist/SolanaLoginButton-DNEcSSF_.cjs.map +1 -0
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.js +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +665 -670
- package/dist/index.js.map +1 -1
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +2 -2
- package/dist/solana-only.js +1 -1
- package/package.json +1 -1
- package/dist/GoogleLoginButton-CjBO3Rf1.cjs +0 -1
- package/dist/GoogleLoginButton-CjBO3Rf1.cjs.map +0 -1
- package/dist/GoogleLoginButton-DEbiQngr.js.map +0 -1
- package/dist/SolanaLoginButton-DAV3r4oB.cjs +0 -1
- package/dist/SolanaLoginButton-DAV3r4oB.cjs.map +0 -1
- package/dist/SolanaLoginButton-DFOoLqoj.js +0 -192
- package/dist/SolanaLoginButton-DFOoLqoj.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -3,17 +3,17 @@ import { C as cl, x as ll, s as dl } from "./useAuth-CVLv2oKA.js";
|
|
|
3
3
|
import { u as te, A as ae, h as W, a as ve } from "./useCedrosLogin-CFfID-0i.js";
|
|
4
4
|
import { b as hl, c as pl } from "./useCedrosLogin-CFfID-0i.js";
|
|
5
5
|
import { jsx as e, jsxs as i, Fragment as $ } from "react/jsx-runtime";
|
|
6
|
-
import { useState as k, useRef as J, useMemo as q, useEffect as _, useCallback as
|
|
7
|
-
import { L as
|
|
6
|
+
import { useState as k, useRef as J, useMemo as q, useEffect as _, useCallback as x, useId as $r, Fragment as so, Component as oo, createContext as no, useContext as Gr } from "react";
|
|
7
|
+
import { L as j } from "./LoadingSpinner-6vml-zwr.js";
|
|
8
8
|
import { a as Jr, s as ao } from "./sanitization-CQ-H1MSg.js";
|
|
9
9
|
import { b as Xr, E as io, a as co, P as he, O as Zr } from "./EmailRegisterForm-CCEuQA-w.js";
|
|
10
10
|
import { T as fl, u as gl, c as wl } from "./EmailRegisterForm-CCEuQA-w.js";
|
|
11
11
|
import { b as es, v as rt } from "./validation-B8kMV3BL.js";
|
|
12
12
|
import { E as X } from "./ErrorMessage-CcEK0pYO.js";
|
|
13
|
-
import { G as lo } from "./GoogleLoginButton-
|
|
14
|
-
import { u as bl } from "./GoogleLoginButton-
|
|
15
|
-
import { S as uo } from "./SolanaLoginButton-
|
|
16
|
-
import { r as vl, u as kl } from "./SolanaLoginButton-
|
|
13
|
+
import { G as lo } from "./GoogleLoginButton-CFlqxvU-.js";
|
|
14
|
+
import { u as bl } from "./GoogleLoginButton-CFlqxvU-.js";
|
|
15
|
+
import { S as uo } from "./SolanaLoginButton-DHsiug1Y.js";
|
|
16
|
+
import { r as vl, u as kl } from "./SolanaLoginButton-DHsiug1Y.js";
|
|
17
17
|
import { c as ho, d as po, u as mo, a as fo, M as go, I as wo, b as yo, P as bo } from "./PermissionsSection-DNzOL1xW.js";
|
|
18
18
|
import { u as Ao } from "./useSystemSettings-rgskaDqP.js";
|
|
19
19
|
import { C as vo, S as ts, a as ko, u as No, A as Co } from "./AutosaveStatus-f-jw25Ay.js";
|
|
@@ -2410,41 +2410,41 @@ function Tc({
|
|
|
2410
2410
|
);
|
|
2411
2411
|
_(() => {
|
|
2412
2412
|
if (!f) return;
|
|
2413
|
-
const
|
|
2413
|
+
const A = (L) => {
|
|
2414
2414
|
h.current && !h.current.contains(L.target) && (g(!1), p(-1));
|
|
2415
|
-
},
|
|
2415
|
+
}, S = (L) => {
|
|
2416
2416
|
L.key === "Escape" && (g(!1), p(-1), y.current?.focus());
|
|
2417
2417
|
};
|
|
2418
|
-
return document.addEventListener("mousedown",
|
|
2419
|
-
document.removeEventListener("mousedown",
|
|
2418
|
+
return document.addEventListener("mousedown", A), document.addEventListener("keydown", S), () => {
|
|
2419
|
+
document.removeEventListener("mousedown", A), document.removeEventListener("keydown", S);
|
|
2420
2420
|
};
|
|
2421
2421
|
}, [f]);
|
|
2422
|
-
const
|
|
2423
|
-
(
|
|
2422
|
+
const v = x(
|
|
2423
|
+
(A) => {
|
|
2424
2424
|
if (!(!f || b.length === 0))
|
|
2425
|
-
switch (
|
|
2425
|
+
switch (A.key) {
|
|
2426
2426
|
case "ArrowDown":
|
|
2427
|
-
|
|
2427
|
+
A.preventDefault(), p((S) => (S + 1) % b.length);
|
|
2428
2428
|
break;
|
|
2429
2429
|
case "ArrowUp":
|
|
2430
|
-
|
|
2430
|
+
A.preventDefault(), p((S) => (S - 1 + b.length) % b.length);
|
|
2431
2431
|
break;
|
|
2432
2432
|
case "Home":
|
|
2433
|
-
|
|
2433
|
+
A.preventDefault(), p(0);
|
|
2434
2434
|
break;
|
|
2435
2435
|
case "End":
|
|
2436
|
-
|
|
2436
|
+
A.preventDefault(), p(b.length - 1);
|
|
2437
2437
|
break;
|
|
2438
2438
|
case "Enter":
|
|
2439
2439
|
case " ":
|
|
2440
|
-
w >= 0 && (
|
|
2440
|
+
w >= 0 && (A.preventDefault(), b[w].onClick(), g(!1), p(-1));
|
|
2441
2441
|
break;
|
|
2442
2442
|
}
|
|
2443
2443
|
},
|
|
2444
2444
|
[f, w, b]
|
|
2445
|
-
), N =
|
|
2446
|
-
b.length !== 0 && (g((
|
|
2447
|
-
}, [b.length]),
|
|
2445
|
+
), N = x(() => {
|
|
2446
|
+
b.length !== 0 && (g((A) => !A), p(-1));
|
|
2447
|
+
}, [b.length]), E = {
|
|
2448
2448
|
sm: "cedros-button-sm",
|
|
2449
2449
|
md: "cedros-button-md",
|
|
2450
2450
|
lg: "cedros-button-lg"
|
|
@@ -2458,38 +2458,38 @@ function Tc({
|
|
|
2458
2458
|
"button",
|
|
2459
2459
|
{
|
|
2460
2460
|
type: "button",
|
|
2461
|
-
className: `cedros-button ${P[r]} ${
|
|
2461
|
+
className: `cedros-button ${P[r]} ${E[o]} ${t}`,
|
|
2462
2462
|
disabled: !0,
|
|
2463
|
-
children: /* @__PURE__ */ e(
|
|
2463
|
+
children: /* @__PURE__ */ e(j, { size: "sm" })
|
|
2464
2464
|
}
|
|
2465
2465
|
);
|
|
2466
2466
|
if (c && l) {
|
|
2467
|
-
const
|
|
2467
|
+
const A = l.name || l.email || "User", S = Jr(l.picture);
|
|
2468
2468
|
return (
|
|
2469
2469
|
// L-08: Added keyboard handler and ref for accessibility
|
|
2470
|
-
/* @__PURE__ */ i("div", { className: "cedros-user-menu", ref: h, onKeyDown:
|
|
2470
|
+
/* @__PURE__ */ i("div", { className: "cedros-user-menu", ref: h, onKeyDown: v, children: [
|
|
2471
2471
|
/* @__PURE__ */ i(
|
|
2472
2472
|
"button",
|
|
2473
2473
|
{
|
|
2474
2474
|
ref: y,
|
|
2475
2475
|
type: "button",
|
|
2476
|
-
className: `cedros-button cedros-user-button ${
|
|
2476
|
+
className: `cedros-button cedros-user-button ${E[o]} ${t}`,
|
|
2477
2477
|
"aria-haspopup": "menu",
|
|
2478
2478
|
"aria-expanded": f,
|
|
2479
|
-
"aria-label": `User menu for ${
|
|
2479
|
+
"aria-label": `User menu for ${A}`,
|
|
2480
2480
|
onClick: N,
|
|
2481
2481
|
children: [
|
|
2482
|
-
|
|
2482
|
+
S ? /* @__PURE__ */ e(
|
|
2483
2483
|
"img",
|
|
2484
2484
|
{
|
|
2485
|
-
src:
|
|
2486
|
-
alt:
|
|
2485
|
+
src: S,
|
|
2486
|
+
alt: A,
|
|
2487
2487
|
className: "cedros-user-avatar",
|
|
2488
2488
|
referrerPolicy: "no-referrer",
|
|
2489
2489
|
crossOrigin: "anonymous"
|
|
2490
2490
|
}
|
|
2491
|
-
) : /* @__PURE__ */ e("div", { className: "cedros-user-avatar-placeholder", children: (
|
|
2492
|
-
/* @__PURE__ */ e("span", { className: "cedros-user-name", children:
|
|
2491
|
+
) : /* @__PURE__ */ e("div", { className: "cedros-user-avatar-placeholder", children: (A[0] || "?").toUpperCase() }),
|
|
2492
|
+
/* @__PURE__ */ e("span", { className: "cedros-user-name", children: A })
|
|
2493
2493
|
]
|
|
2494
2494
|
}
|
|
2495
2495
|
),
|
|
@@ -2533,7 +2533,7 @@ function Tc({
|
|
|
2533
2533
|
"button",
|
|
2534
2534
|
{
|
|
2535
2535
|
type: "button",
|
|
2536
|
-
className: `cedros-button ${P[r]} ${
|
|
2536
|
+
className: `cedros-button ${P[r]} ${E[o]} ${t}`,
|
|
2537
2537
|
onClick: u,
|
|
2538
2538
|
children: a || "Sign in"
|
|
2539
2539
|
}
|
|
@@ -2550,7 +2550,7 @@ function Qt() {
|
|
|
2550
2550
|
), { checkLimit: d, getRemainingAttempts: u } = Xr({
|
|
2551
2551
|
maxAttempts: 3,
|
|
2552
2552
|
windowMs: 3e5
|
|
2553
|
-
}), m =
|
|
2553
|
+
}), m = x(
|
|
2554
2554
|
async (p) => {
|
|
2555
2555
|
if (!es(p)) {
|
|
2556
2556
|
const h = {
|
|
@@ -2579,7 +2579,7 @@ function Qt() {
|
|
|
2579
2579
|
}
|
|
2580
2580
|
},
|
|
2581
2581
|
[c, d]
|
|
2582
|
-
), f =
|
|
2582
|
+
), f = x(
|
|
2583
2583
|
async (p, h) => {
|
|
2584
2584
|
o(!0), l(null), s(!1);
|
|
2585
2585
|
try {
|
|
@@ -2592,7 +2592,7 @@ function Qt() {
|
|
|
2592
2592
|
}
|
|
2593
2593
|
},
|
|
2594
2594
|
[c]
|
|
2595
|
-
), g =
|
|
2595
|
+
), g = x(() => l(null), []), w = x(() => {
|
|
2596
2596
|
l(null), s(!1), o(!1);
|
|
2597
2597
|
}, []);
|
|
2598
2598
|
return {
|
|
@@ -2620,7 +2620,7 @@ function gn() {
|
|
|
2620
2620
|
), { checkLimit: u, getRemainingAttempts: m } = Xr({
|
|
2621
2621
|
maxAttempts: 3,
|
|
2622
2622
|
windowMs: 3e5
|
|
2623
|
-
}), f =
|
|
2623
|
+
}), f = x(
|
|
2624
2624
|
async (h) => {
|
|
2625
2625
|
if (!es(h)) {
|
|
2626
2626
|
const y = {
|
|
@@ -2649,7 +2649,7 @@ function gn() {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
},
|
|
2651
2651
|
[d, u]
|
|
2652
|
-
), g =
|
|
2652
|
+
), g = x(
|
|
2653
2653
|
async (h) => {
|
|
2654
2654
|
if (!h || h.trim().length === 0) {
|
|
2655
2655
|
const y = {
|
|
@@ -2675,7 +2675,7 @@ function gn() {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
},
|
|
2677
2677
|
[d, t.callbacks, r]
|
|
2678
|
-
), w =
|
|
2678
|
+
), w = x(() => c(null), []), p = x(() => {
|
|
2679
2679
|
c(null), n(!1), a(!1);
|
|
2680
2680
|
}, []);
|
|
2681
2681
|
return {
|
|
@@ -2789,7 +2789,7 @@ function yn({
|
|
|
2789
2789
|
className: "cedros-button cedros-button-md cedros-button-primary cedros-button-full",
|
|
2790
2790
|
disabled: u.isLoading || !s,
|
|
2791
2791
|
children: u.isLoading ? /* @__PURE__ */ i($, { children: [
|
|
2792
|
-
/* @__PURE__ */ e(
|
|
2792
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
2793
2793
|
"Sending..."
|
|
2794
2794
|
] }) : m.button
|
|
2795
2795
|
}
|
|
@@ -2884,7 +2884,7 @@ function An() {
|
|
|
2884
2884
|
h = !1;
|
|
2885
2885
|
};
|
|
2886
2886
|
}, [t.appleClientId]);
|
|
2887
|
-
const g =
|
|
2887
|
+
const g = x(async () => {
|
|
2888
2888
|
if (!t.appleClientId) {
|
|
2889
2889
|
const y = {
|
|
2890
2890
|
code: "VALIDATION_ERROR",
|
|
@@ -2905,11 +2905,11 @@ function An() {
|
|
|
2905
2905
|
const y = await window.AppleID.auth.signIn();
|
|
2906
2906
|
if (h = y.authorization?.id_token, !h)
|
|
2907
2907
|
throw new Error("No ID token received from Apple");
|
|
2908
|
-
const b = y.user?.name ? `${y.user.name.firstName || ""} ${y.user.name.lastName || ""}`.trim() : void 0,
|
|
2908
|
+
const b = y.user?.name ? `${y.user.name.firstName || ""} ${y.user.name.lastName || ""}`.trim() : void 0, v = await f.post("/apple", {
|
|
2909
2909
|
idToken: h,
|
|
2910
2910
|
name: b || void 0
|
|
2911
2911
|
});
|
|
2912
|
-
return m.current.callbacks?.onLoginSuccess?.(
|
|
2912
|
+
return m.current.callbacks?.onLoginSuccess?.(v.user, "apple"), r?.handleLoginSuccess(v.user, v.tokens), a(!1), v;
|
|
2913
2913
|
} catch (y) {
|
|
2914
2914
|
if (y.error === "popup_closed_by_user") {
|
|
2915
2915
|
const N = {
|
|
@@ -2918,10 +2918,10 @@ function An() {
|
|
|
2918
2918
|
};
|
|
2919
2919
|
throw c(N), a(!1), N;
|
|
2920
2920
|
}
|
|
2921
|
-
const
|
|
2922
|
-
throw
|
|
2921
|
+
const v = W(y, "Unable to sign in with Apple. Please try again.");
|
|
2922
|
+
throw v.code === "ACCOUNT_LINK_REQUIRED" && h && u(h), c(v), a(!1), v;
|
|
2923
2923
|
}
|
|
2924
|
-
}, [t.appleClientId, s, f, r]), w =
|
|
2924
|
+
}, [t.appleClientId, s, f, r]), w = x(() => c(null), []), p = x(() => u(null), []);
|
|
2925
2925
|
return {
|
|
2926
2926
|
signIn: g,
|
|
2927
2927
|
isLoading: o,
|
|
@@ -2974,7 +2974,7 @@ function vn({
|
|
|
2974
2974
|
disabled: n || !u || d,
|
|
2975
2975
|
"aria-label": "Sign in with Apple",
|
|
2976
2976
|
children: [
|
|
2977
|
-
d ? /* @__PURE__ */ e(
|
|
2977
|
+
d ? /* @__PURE__ */ e(j, { size: "sm" }) : /* @__PURE__ */ e(
|
|
2978
2978
|
"svg",
|
|
2979
2979
|
{
|
|
2980
2980
|
className: "cedros-button-icon",
|
|
@@ -3112,7 +3112,7 @@ function gs() {
|
|
|
3112
3112
|
getAccessToken: r?.getAccessToken
|
|
3113
3113
|
}),
|
|
3114
3114
|
[r?.getAccessToken, t.serverUrl, t.requestTimeout, t.retryAttempts]
|
|
3115
|
-
), c =
|
|
3115
|
+
), c = x(() => n(null), []), d = Nn(), u = x(
|
|
3116
3116
|
async (w) => {
|
|
3117
3117
|
if (!d) {
|
|
3118
3118
|
const p = {
|
|
@@ -3144,7 +3144,7 @@ function gs() {
|
|
|
3144
3144
|
}
|
|
3145
3145
|
},
|
|
3146
3146
|
[l, t.callbacks, r, d]
|
|
3147
|
-
), m =
|
|
3147
|
+
), m = x(
|
|
3148
3148
|
async (w) => {
|
|
3149
3149
|
if (!d) {
|
|
3150
3150
|
const p = {
|
|
@@ -3179,7 +3179,7 @@ function gs() {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
},
|
|
3181
3181
|
[l, d]
|
|
3182
|
-
), f =
|
|
3182
|
+
), f = x(
|
|
3183
3183
|
async (w) => {
|
|
3184
3184
|
if (!d) {
|
|
3185
3185
|
const p = {
|
|
@@ -3214,7 +3214,7 @@ function gs() {
|
|
|
3214
3214
|
}
|
|
3215
3215
|
},
|
|
3216
3216
|
[l, t.callbacks, r, d]
|
|
3217
|
-
), g =
|
|
3217
|
+
), g = x(async () => {
|
|
3218
3218
|
if (!d) {
|
|
3219
3219
|
const w = {
|
|
3220
3220
|
code: "VALIDATION_ERROR",
|
|
@@ -3238,27 +3238,27 @@ function gs() {
|
|
|
3238
3238
|
});
|
|
3239
3239
|
return t.callbacks?.onLoginSuccess?.(y.user, "webauthn"), r?.handleLoginSuccess(y.user, y.tokens), y;
|
|
3240
3240
|
} catch (w) {
|
|
3241
|
-
if (w instanceof Error && w.name === "InvalidStateError")
|
|
3241
|
+
if (w instanceof Error && (w.name === "InvalidStateError" || w.name === "NotAllowedError"))
|
|
3242
3242
|
try {
|
|
3243
|
-
const
|
|
3243
|
+
const b = await l.post(
|
|
3244
3244
|
"/webauthn/auth/options",
|
|
3245
3245
|
{}
|
|
3246
|
-
),
|
|
3247
|
-
publicKey:
|
|
3246
|
+
), v = or(b.options), N = await navigator.credentials.get({
|
|
3247
|
+
publicKey: v
|
|
3248
3248
|
});
|
|
3249
|
-
if (!
|
|
3249
|
+
if (!N)
|
|
3250
3250
|
throw new Error("Passkey authentication returned no credential");
|
|
3251
|
-
const
|
|
3252
|
-
challengeId:
|
|
3253
|
-
credential: Te(
|
|
3251
|
+
const E = await l.post("/webauthn/auth/verify", {
|
|
3252
|
+
challengeId: b.challengeId,
|
|
3253
|
+
credential: Te(N)
|
|
3254
3254
|
});
|
|
3255
|
-
return t.callbacks?.onLoginSuccess?.(
|
|
3256
|
-
} catch (
|
|
3257
|
-
const
|
|
3258
|
-
throw n(
|
|
3255
|
+
return t.callbacks?.onLoginSuccess?.(E.user, "webauthn"), r?.handleLoginSuccess(E.user, E.tokens), E;
|
|
3256
|
+
} catch (b) {
|
|
3257
|
+
const N = Be(b) ?? W(b, "Unable to sign in with passkey. Please try again.");
|
|
3258
|
+
throw n(N), N;
|
|
3259
3259
|
}
|
|
3260
|
-
const
|
|
3261
|
-
throw n(
|
|
3260
|
+
const y = Be(w) ?? W(w, "Passkey sign-up failed");
|
|
3261
|
+
throw n(y), y;
|
|
3262
3262
|
} finally {
|
|
3263
3263
|
a(!1);
|
|
3264
3264
|
}
|
|
@@ -3287,12 +3287,15 @@ function Cn({
|
|
|
3287
3287
|
type: "button",
|
|
3288
3288
|
className: `cedros-button cedros-button-social ${r}`,
|
|
3289
3289
|
onClick: async () => {
|
|
3290
|
-
|
|
3290
|
+
try {
|
|
3291
|
+
await s(), t?.();
|
|
3292
|
+
} catch {
|
|
3293
|
+
}
|
|
3291
3294
|
},
|
|
3292
3295
|
disabled: c,
|
|
3293
3296
|
"aria-disabled": c,
|
|
3294
3297
|
children: [
|
|
3295
|
-
/* @__PURE__ */ e("span", { className: "cedros-social-icon", "aria-hidden": "true", children: /* @__PURE__ */ e(En, {}) }),
|
|
3298
|
+
n ? /* @__PURE__ */ e(j, { size: "sm" }) : /* @__PURE__ */ e("span", { className: "cedros-social-icon", "aria-hidden": "true", children: /* @__PURE__ */ e(En, {}) }),
|
|
3296
3299
|
/* @__PURE__ */ e("span", { children: o ?? "Continue with Passkey" })
|
|
3297
3300
|
]
|
|
3298
3301
|
}
|
|
@@ -3344,15 +3347,7 @@ function nr(t) {
|
|
|
3344
3347
|
return typeof r.connect == "function" || typeof r.signMessage == "function" || typeof r.signTransaction == "function" || "isConnected" in r;
|
|
3345
3348
|
}
|
|
3346
3349
|
function xn() {
|
|
3347
|
-
|
|
3348
|
-
const t = window.__wallet_standard__;
|
|
3349
|
-
if (t && typeof t == "object" && "get" in t && typeof t.get == "function") {
|
|
3350
|
-
const r = t.get();
|
|
3351
|
-
return Array.isArray(r) && r.length > 0;
|
|
3352
|
-
}
|
|
3353
|
-
} catch {
|
|
3354
|
-
}
|
|
3355
|
-
return !1;
|
|
3350
|
+
return typeof navigator < "u" && /Android/i.test(navigator.userAgent);
|
|
3356
3351
|
}
|
|
3357
3352
|
function ar() {
|
|
3358
3353
|
if (typeof window > "u")
|
|
@@ -3374,30 +3369,30 @@ function Kt({ onSuccess: t, className: r = "", defaultTab: o = "login" }) {
|
|
|
3374
3369
|
window.removeEventListener("load", P), window.removeEventListener("focus", P);
|
|
3375
3370
|
};
|
|
3376
3371
|
}, []);
|
|
3377
|
-
const g = a.forms?.forgotPassword?.mode ?? (a.features?.instantLink ? "instantLink" : "reset"), w =
|
|
3372
|
+
const g = a.forms?.forgotPassword?.mode ?? (a.features?.instantLink ? "instantLink" : "reset"), w = x(
|
|
3378
3373
|
(P) => {
|
|
3379
|
-
const
|
|
3380
|
-
let
|
|
3374
|
+
const A = Re.indexOf(n);
|
|
3375
|
+
let S = A;
|
|
3381
3376
|
switch (P.key) {
|
|
3382
3377
|
case "ArrowLeft":
|
|
3383
3378
|
case "ArrowUp":
|
|
3384
|
-
|
|
3379
|
+
S = A === 0 ? Re.length - 1 : A - 1;
|
|
3385
3380
|
break;
|
|
3386
3381
|
case "ArrowRight":
|
|
3387
3382
|
case "ArrowDown":
|
|
3388
|
-
|
|
3383
|
+
S = A === Re.length - 1 ? 0 : A + 1;
|
|
3389
3384
|
break;
|
|
3390
3385
|
case "Home":
|
|
3391
|
-
|
|
3386
|
+
S = 0;
|
|
3392
3387
|
break;
|
|
3393
3388
|
case "End":
|
|
3394
|
-
|
|
3389
|
+
S = Re.length - 1;
|
|
3395
3390
|
break;
|
|
3396
3391
|
default:
|
|
3397
3392
|
return;
|
|
3398
3393
|
}
|
|
3399
3394
|
P.preventDefault();
|
|
3400
|
-
const L = Re[
|
|
3395
|
+
const L = Re[S];
|
|
3401
3396
|
l(L), document.getElementById(`cedros-tab-${L}`)?.focus();
|
|
3402
3397
|
},
|
|
3403
3398
|
[n]
|
|
@@ -3407,21 +3402,21 @@ function Kt({ onSuccess: t, className: r = "", defaultTab: o = "login" }) {
|
|
|
3407
3402
|
apple: !0,
|
|
3408
3403
|
solana: !0,
|
|
3409
3404
|
webauthn: !0
|
|
3410
|
-
}, h = p.email !== !1, y = p.google !== !1 && a.googleClientId, b = p.apple !== !1 && a.appleClientId && f,
|
|
3405
|
+
}, h = p.email !== !1, y = p.google !== !1 && a.googleClientId, b = p.apple !== !1 && a.appleClientId && f, v = p.solana !== !1 && u, N = p.webauthn !== !1, E = h && (y || b || v || N);
|
|
3411
3406
|
return c === "forgotPassword" ? /* @__PURE__ */ e("div", { className: `cedros-login-form ${r}`, children: /* @__PURE__ */ e(yn, { mode: g, onCancel: () => d("form") }) }) : /* @__PURE__ */ i("div", { className: `cedros-login-form ${r}`, children: [
|
|
3412
|
-
(N || y || b ||
|
|
3407
|
+
(N || y || b || v) && (() => {
|
|
3413
3408
|
const P = {
|
|
3414
3409
|
webauthn: N ? /* @__PURE__ */ e(Cn, { onSuccess: t }) : null,
|
|
3415
3410
|
google: y ? /* @__PURE__ */ e(lo, { onSuccess: t }) : null,
|
|
3416
3411
|
apple: b ? /* @__PURE__ */ e(vn, { onSuccess: t }) : null,
|
|
3417
|
-
solana:
|
|
3412
|
+
solana: v ? /* @__PURE__ */ e(uo, { onSuccess: t }) : null
|
|
3418
3413
|
};
|
|
3419
|
-
return /* @__PURE__ */ e("div", { className: "cedros-social-buttons", children: (s ?? ["webauthn", "google", "apple", "solana"]).map((
|
|
3420
|
-
const L = P[
|
|
3421
|
-
return L ? /* @__PURE__ */ e(so, { children: L },
|
|
3414
|
+
return /* @__PURE__ */ e("div", { className: "cedros-social-buttons", children: (s ?? ["webauthn", "google", "apple", "solana"]).map((S) => {
|
|
3415
|
+
const L = P[S];
|
|
3416
|
+
return L ? /* @__PURE__ */ e(so, { children: L }, S) : null;
|
|
3422
3417
|
}) });
|
|
3423
3418
|
})(),
|
|
3424
|
-
|
|
3419
|
+
E && /* @__PURE__ */ e("div", { className: "cedros-divider", children: /* @__PURE__ */ e("span", { children: "Or continue with" }) }),
|
|
3425
3420
|
h && /* @__PURE__ */ i($, { children: [
|
|
3426
3421
|
/* @__PURE__ */ i("div", { className: "cedros-tabs", role: "tablist", "aria-label": "Authentication method", children: [
|
|
3427
3422
|
/* @__PURE__ */ e(
|
|
@@ -3619,8 +3614,8 @@ function Rc({
|
|
|
3619
3614
|
onLoginClick: o,
|
|
3620
3615
|
className: a = ""
|
|
3621
3616
|
}) {
|
|
3622
|
-
const [s, n] = k(""), [l, c] = k(""), [d, u] = k(null), { resetPassword: m, isLoading: f, isSuccess: g, error: w, clearError: p } = Qt(), h = s === l, y = d?.isValid && h && s.length > 0, b = async (
|
|
3623
|
-
if (
|
|
3617
|
+
const [s, n] = k(""), [l, c] = k(""), [d, u] = k(null), { resetPassword: m, isLoading: f, isSuccess: g, error: w, clearError: p } = Qt(), h = s === l, y = d?.isValid && h && s.length > 0, b = async (v) => {
|
|
3618
|
+
if (v.preventDefault(), !!y)
|
|
3624
3619
|
try {
|
|
3625
3620
|
await m(t, s), r?.();
|
|
3626
3621
|
} catch {
|
|
@@ -3673,8 +3668,8 @@ function Rc({
|
|
|
3673
3668
|
{
|
|
3674
3669
|
label: "New password",
|
|
3675
3670
|
value: s,
|
|
3676
|
-
onChange: (
|
|
3677
|
-
n(
|
|
3671
|
+
onChange: (v) => {
|
|
3672
|
+
n(v.target.value), u(rt(v.target.value));
|
|
3678
3673
|
},
|
|
3679
3674
|
showStrengthMeter: !0,
|
|
3680
3675
|
onValidationChange: u,
|
|
@@ -3688,7 +3683,7 @@ function Rc({
|
|
|
3688
3683
|
{
|
|
3689
3684
|
label: "Confirm password",
|
|
3690
3685
|
value: l,
|
|
3691
|
-
onChange: (
|
|
3686
|
+
onChange: (v) => c(v.target.value),
|
|
3692
3687
|
disabled: f,
|
|
3693
3688
|
autoComplete: "new-password",
|
|
3694
3689
|
error: l && !h ? "Passwords do not match" : void 0
|
|
@@ -3702,7 +3697,7 @@ function Rc({
|
|
|
3702
3697
|
className: "cedros-button cedros-button-md cedros-button-primary cedros-button-full",
|
|
3703
3698
|
disabled: f || !y,
|
|
3704
3699
|
children: f ? /* @__PURE__ */ i($, { children: [
|
|
3705
|
-
/* @__PURE__ */ e(
|
|
3700
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
3706
3701
|
"Resetting..."
|
|
3707
3702
|
] }) : "Reset password"
|
|
3708
3703
|
}
|
|
@@ -3754,14 +3749,14 @@ function Ic({
|
|
|
3754
3749
|
if (c)
|
|
3755
3750
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
3756
3751
|
}, [c]);
|
|
3757
|
-
const m =
|
|
3752
|
+
const m = x(
|
|
3758
3753
|
(w) => {
|
|
3759
3754
|
a(w), d(!1);
|
|
3760
3755
|
},
|
|
3761
3756
|
[a]
|
|
3762
|
-
), f =
|
|
3757
|
+
), f = x(() => {
|
|
3763
3758
|
d(!1), s?.();
|
|
3764
|
-
}, [s]), g =
|
|
3759
|
+
}, [s]), g = x(() => {
|
|
3765
3760
|
d((w) => !w);
|
|
3766
3761
|
}, []);
|
|
3767
3762
|
return o ? /* @__PURE__ */ i(
|
|
@@ -3771,7 +3766,7 @@ function Ic({
|
|
|
3771
3766
|
"aria-busy": "true",
|
|
3772
3767
|
"aria-live": "polite",
|
|
3773
3768
|
children: [
|
|
3774
|
-
/* @__PURE__ */ e(
|
|
3769
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
3775
3770
|
/* @__PURE__ */ e("span", { children: "Loading..." })
|
|
3776
3771
|
]
|
|
3777
3772
|
}
|
|
@@ -3956,7 +3951,7 @@ function Dn({
|
|
|
3956
3951
|
onCreateClick: s
|
|
3957
3952
|
}) {
|
|
3958
3953
|
return o ? /* @__PURE__ */ i("div", { className: "cedros-org-switcher-loading", children: [
|
|
3959
|
-
/* @__PURE__ */ e(
|
|
3954
|
+
/* @__PURE__ */ e(j, {}),
|
|
3960
3955
|
/* @__PURE__ */ e("span", { children: "Loading organizations..." })
|
|
3961
3956
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
3962
3957
|
t.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-org-switcher-empty", children: /* @__PURE__ */ e("p", { children: "You don't belong to any organizations yet." }) }) : /* @__PURE__ */ e("ul", { className: "cedros-org-switcher-list", children: t.map((n) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
@@ -3989,11 +3984,11 @@ function Dn({
|
|
|
3989
3984
|
] });
|
|
3990
3985
|
}
|
|
3991
3986
|
function Un({ isLoading: t, onSubmit: r, onCancel: o }) {
|
|
3992
|
-
const [a, s] = k(""), [n, l] = k(""), [c, d] = k(null), u =
|
|
3987
|
+
const [a, s] = k(""), [n, l] = k(""), [c, d] = k(null), u = x((f) => {
|
|
3993
3988
|
s(f);
|
|
3994
3989
|
const g = f.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").substring(0, 50);
|
|
3995
3990
|
l(g);
|
|
3996
|
-
}, []), m =
|
|
3991
|
+
}, []), m = x(
|
|
3997
3992
|
async (f) => {
|
|
3998
3993
|
if (f.preventDefault(), d(null), !a.trim()) {
|
|
3999
3994
|
d("Organization name is required");
|
|
@@ -4068,7 +4063,7 @@ function Un({ isLoading: t, onSubmit: r, onCancel: o }) {
|
|
|
4068
4063
|
type: "submit",
|
|
4069
4064
|
className: "cedros-button cedros-button-primary",
|
|
4070
4065
|
disabled: t || !a.trim() || !n.trim(),
|
|
4071
|
-
children: t ? /* @__PURE__ */ e(
|
|
4066
|
+
children: t ? /* @__PURE__ */ e(j, { size: "sm" }) : "Create Organization"
|
|
4072
4067
|
}
|
|
4073
4068
|
)
|
|
4074
4069
|
] })
|
|
@@ -4121,23 +4116,23 @@ function Fn({
|
|
|
4121
4116
|
if (y.key === "Tab" && m.current) {
|
|
4122
4117
|
const b = m.current.querySelectorAll(
|
|
4123
4118
|
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
4124
|
-
),
|
|
4125
|
-
y.shiftKey ? document.activeElement ===
|
|
4119
|
+
), v = b[0], N = b[b.length - 1];
|
|
4120
|
+
y.shiftKey ? document.activeElement === v && (y.preventDefault(), N?.focus()) : document.activeElement === N && (y.preventDefault(), v?.focus());
|
|
4126
4121
|
}
|
|
4127
4122
|
};
|
|
4128
4123
|
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
4129
4124
|
}, [t]);
|
|
4130
|
-
const g =
|
|
4125
|
+
const g = x(
|
|
4131
4126
|
(h) => {
|
|
4132
4127
|
h.target === h.currentTarget && t();
|
|
4133
4128
|
},
|
|
4134
4129
|
[t]
|
|
4135
|
-
), w =
|
|
4130
|
+
), w = x(
|
|
4136
4131
|
(h) => {
|
|
4137
4132
|
n(h), t();
|
|
4138
4133
|
},
|
|
4139
4134
|
[n, t]
|
|
4140
|
-
), p =
|
|
4135
|
+
), p = x(
|
|
4141
4136
|
async (h) => {
|
|
4142
4137
|
await l?.(h), t();
|
|
4143
4138
|
},
|
|
@@ -4187,7 +4182,7 @@ function _n({
|
|
|
4187
4182
|
onRevokeAll: a,
|
|
4188
4183
|
className: s = ""
|
|
4189
4184
|
}) {
|
|
4190
|
-
const [n, l] = k(!1), [c, d] = k(!1), u = J(null), m = q(() => t.filter((g) => !g.isCurrent).length, [t]), f =
|
|
4185
|
+
const [n, l] = k(!1), [c, d] = k(!1), u = J(null), m = q(() => t.filter((g) => !g.isCurrent).length, [t]), f = x(async () => {
|
|
4191
4186
|
if (!a) return;
|
|
4192
4187
|
const g = t.filter((p) => !p.isCurrent).length;
|
|
4193
4188
|
if (!(g === 0 || !window.confirm(
|
|
@@ -4206,7 +4201,7 @@ function _n({
|
|
|
4206
4201
|
return _(() => () => {
|
|
4207
4202
|
u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
4208
4203
|
}, []), r && t.length === 0 ? /* @__PURE__ */ i("div", { className: `cedros-session-list cedros-session-list-loading ${s}`, children: [
|
|
4209
|
-
/* @__PURE__ */ e(
|
|
4204
|
+
/* @__PURE__ */ e(j, {}),
|
|
4210
4205
|
/* @__PURE__ */ e("span", { children: "Loading sessions..." })
|
|
4211
4206
|
] }) : o ? /* @__PURE__ */ e("div", { className: `cedros-session-list ${s}`, children: /* @__PURE__ */ e(X, { error: o }) }) : t.length === 0 ? /* @__PURE__ */ e("div", { className: `cedros-session-list cedros-session-list-empty ${s}`, children: /* @__PURE__ */ e("p", { children: "No active sessions found." }) }) : /* @__PURE__ */ i("div", { className: `cedros-session-list ${s}`, children: [
|
|
4212
4207
|
c && /* @__PURE__ */ i("div", { className: "cedros-session-success", role: "status", children: [
|
|
@@ -4222,7 +4217,7 @@ function _n({
|
|
|
4222
4217
|
onClick: f,
|
|
4223
4218
|
disabled: n,
|
|
4224
4219
|
children: n ? /* @__PURE__ */ i($, { children: [
|
|
4225
|
-
/* @__PURE__ */ e(
|
|
4220
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
4226
4221
|
/* @__PURE__ */ e("span", { children: "Signing out..." })
|
|
4227
4222
|
] }) : `Sign out of ${m} other device${m > 1 ? "s" : ""}`
|
|
4228
4223
|
}
|
|
@@ -4336,7 +4331,7 @@ function Hn({
|
|
|
4336
4331
|
onConfirm: r,
|
|
4337
4332
|
className: o = ""
|
|
4338
4333
|
}) {
|
|
4339
|
-
const [a, s] = k(!1), [n, l] = k(!1), c = J(null), d = pn(t), u =
|
|
4334
|
+
const [a, s] = k(!1), [n, l] = k(!1), c = J(null), d = pn(t), u = x(async () => {
|
|
4340
4335
|
try {
|
|
4341
4336
|
await navigator.clipboard.writeText(t.join(" ")), s(!0), c.current !== null && window.clearTimeout(c.current), c.current = window.setTimeout(() => s(!1), 2e3);
|
|
4342
4337
|
} catch {
|
|
@@ -4345,7 +4340,7 @@ function Hn({
|
|
|
4345
4340
|
_(() => () => {
|
|
4346
4341
|
c.current !== null && (window.clearTimeout(c.current), c.current = null);
|
|
4347
4342
|
}, []);
|
|
4348
|
-
const m =
|
|
4343
|
+
const m = x(() => {
|
|
4349
4344
|
n && r();
|
|
4350
4345
|
}, [n, r]);
|
|
4351
4346
|
return /* @__PURE__ */ i("div", { className: `cedros-recovery-phrase-display ${o}`, children: [
|
|
@@ -4436,24 +4431,24 @@ function Qn({
|
|
|
4436
4431
|
error: a,
|
|
4437
4432
|
className: s = ""
|
|
4438
4433
|
}) {
|
|
4439
|
-
const [n, l] = k(Array(le).fill("")), [c, d] = k(null), [u, m] = k([]), [f, g] = k(null), w = $r(), p = J(null), h =
|
|
4440
|
-
(
|
|
4434
|
+
const [n, l] = k(Array(le).fill("")), [c, d] = k(null), [u, m] = k([]), [f, g] = k(null), w = $r(), p = J(null), h = x(
|
|
4435
|
+
(A, S) => {
|
|
4441
4436
|
const L = [...n];
|
|
4442
|
-
if (L[
|
|
4443
|
-
const C = hn(
|
|
4437
|
+
if (L[A] = S.toLowerCase().trim(), l(L), S.length > 0) {
|
|
4438
|
+
const C = hn(S, 5);
|
|
4444
4439
|
m(C);
|
|
4445
4440
|
} else
|
|
4446
4441
|
m([]);
|
|
4447
4442
|
g(null);
|
|
4448
4443
|
},
|
|
4449
4444
|
[n]
|
|
4450
|
-
), y =
|
|
4451
|
-
d(
|
|
4452
|
-
}, []), b =
|
|
4453
|
-
(
|
|
4454
|
-
const
|
|
4455
|
-
|
|
4456
|
-
c ===
|
|
4445
|
+
), y = x((A) => {
|
|
4446
|
+
d(A), m([]);
|
|
4447
|
+
}, []), b = x(
|
|
4448
|
+
(A) => {
|
|
4449
|
+
const S = n[A];
|
|
4450
|
+
S && !qe(S) && g(`Word ${A + 1} is not in the wordlist`), p.current !== null && window.clearTimeout(p.current), p.current = window.setTimeout(() => {
|
|
4451
|
+
c === A && m([]);
|
|
4457
4452
|
}, 200);
|
|
4458
4453
|
},
|
|
4459
4454
|
[n, c]
|
|
@@ -4461,22 +4456,22 @@ function Qn({
|
|
|
4461
4456
|
_(() => () => {
|
|
4462
4457
|
p.current !== null && (window.clearTimeout(p.current), p.current = null);
|
|
4463
4458
|
}, []);
|
|
4464
|
-
const
|
|
4465
|
-
(
|
|
4459
|
+
const v = x(
|
|
4460
|
+
(A) => {
|
|
4466
4461
|
if (c !== null) {
|
|
4467
|
-
const
|
|
4468
|
-
|
|
4462
|
+
const S = [...n];
|
|
4463
|
+
S[c] = A, l(S), m([]), document.querySelector(
|
|
4469
4464
|
`[data-word-index="${c + 1}"]`
|
|
4470
4465
|
)?.focus();
|
|
4471
4466
|
}
|
|
4472
4467
|
},
|
|
4473
4468
|
[c, n]
|
|
4474
|
-
), N =
|
|
4475
|
-
const
|
|
4476
|
-
L.length === le && (
|
|
4477
|
-
}, []),
|
|
4478
|
-
(
|
|
4479
|
-
if (
|
|
4469
|
+
), N = x((A) => {
|
|
4470
|
+
const S = A.clipboardData.getData("text"), L = mn(S);
|
|
4471
|
+
L.length === le && (A.preventDefault(), l(L), g(null));
|
|
4472
|
+
}, []), E = x(
|
|
4473
|
+
(A) => {
|
|
4474
|
+
if (A.preventDefault(), n.filter((C) => !C).length > 0) {
|
|
4480
4475
|
g(`Please enter all ${le} words`);
|
|
4481
4476
|
return;
|
|
4482
4477
|
}
|
|
@@ -4497,46 +4492,46 @@ function Qn({
|
|
|
4497
4492
|
"form",
|
|
4498
4493
|
{
|
|
4499
4494
|
className: `cedros-recovery-phrase-input ${s}`,
|
|
4500
|
-
onSubmit:
|
|
4495
|
+
onSubmit: E,
|
|
4501
4496
|
onPaste: N,
|
|
4502
4497
|
children: [
|
|
4503
4498
|
/* @__PURE__ */ i("div", { className: "cedros-recovery-input-header", children: [
|
|
4504
4499
|
/* @__PURE__ */ e("h3", { className: "cedros-recovery-input-title", children: "Enter Recovery Phrase" }),
|
|
4505
4500
|
/* @__PURE__ */ e("p", { className: "cedros-recovery-input-description", children: "Enter your 12-word recovery phrase. You can paste the entire phrase at once." })
|
|
4506
4501
|
] }),
|
|
4507
|
-
/* @__PURE__ */ e("div", { className: "cedros-word-inputs", children: Array.from({ length: le }, (
|
|
4502
|
+
/* @__PURE__ */ e("div", { className: "cedros-word-inputs", children: Array.from({ length: le }, (A, S) => /* @__PURE__ */ i("div", { className: "cedros-word-input-wrapper", children: [
|
|
4508
4503
|
/* @__PURE__ */ i("label", { className: "cedros-word-label", children: [
|
|
4509
|
-
|
|
4504
|
+
S + 1,
|
|
4510
4505
|
"."
|
|
4511
4506
|
] }),
|
|
4512
4507
|
/* @__PURE__ */ e(
|
|
4513
4508
|
"input",
|
|
4514
4509
|
{
|
|
4515
4510
|
type: "text",
|
|
4516
|
-
className: `cedros-word-input ${n[
|
|
4517
|
-
value: n[
|
|
4518
|
-
onChange: (L) => h(
|
|
4519
|
-
onFocus: () => y(
|
|
4520
|
-
onBlur: () => b(
|
|
4521
|
-
"data-word-index":
|
|
4511
|
+
className: `cedros-word-input ${n[S] && !qe(n[S]) ? "cedros-word-invalid" : n[S] && qe(n[S]) ? "cedros-word-valid" : ""}`,
|
|
4512
|
+
value: n[S],
|
|
4513
|
+
onChange: (L) => h(S, L.target.value),
|
|
4514
|
+
onFocus: () => y(S),
|
|
4515
|
+
onBlur: () => b(S),
|
|
4516
|
+
"data-word-index": S,
|
|
4522
4517
|
autoComplete: "off",
|
|
4523
4518
|
autoCapitalize: "none",
|
|
4524
4519
|
spellCheck: !1,
|
|
4525
4520
|
disabled: o,
|
|
4526
|
-
"aria-label": `Word ${
|
|
4521
|
+
"aria-label": `Word ${S + 1}`
|
|
4527
4522
|
}
|
|
4528
4523
|
)
|
|
4529
|
-
] },
|
|
4530
|
-
c !== null && u.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-suggestions", role: "listbox", id: `${w}-suggestions`, children: u.map((
|
|
4524
|
+
] }, S)) }),
|
|
4525
|
+
c !== null && u.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-suggestions", role: "listbox", id: `${w}-suggestions`, children: u.map((A) => /* @__PURE__ */ e(
|
|
4531
4526
|
"button",
|
|
4532
4527
|
{
|
|
4533
4528
|
type: "button",
|
|
4534
4529
|
className: "cedros-suggestion",
|
|
4535
|
-
onClick: () => A
|
|
4530
|
+
onClick: () => v(A),
|
|
4536
4531
|
role: "option",
|
|
4537
|
-
children:
|
|
4532
|
+
children: A
|
|
4538
4533
|
},
|
|
4539
|
-
|
|
4534
|
+
A
|
|
4540
4535
|
)) }),
|
|
4541
4536
|
P && /* @__PURE__ */ e("p", { className: "cedros-input-error", role: "alert", children: P }),
|
|
4542
4537
|
/* @__PURE__ */ i("div", { className: "cedros-recovery-input-actions", children: [
|
|
@@ -4659,7 +4654,7 @@ function ws() {
|
|
|
4659
4654
|
baseUrl: t.config.serverUrl,
|
|
4660
4655
|
timeoutMs: t.config.requestTimeout,
|
|
4661
4656
|
retryAttempts: t.config.retryAttempts
|
|
4662
|
-
}) : null, [t]), d =
|
|
4657
|
+
}) : null, [t]), d = x(async () => {
|
|
4663
4658
|
if (c) {
|
|
4664
4659
|
s(!0), l(null);
|
|
4665
4660
|
try {
|
|
@@ -4697,28 +4692,28 @@ function ws() {
|
|
|
4697
4692
|
} : $n;
|
|
4698
4693
|
}
|
|
4699
4694
|
function Gn() {
|
|
4700
|
-
const { user: t } = te(), { enroll: r } = Pe(), { recoveryMode: o } = ws(), [a, s] = k({ step: "idle" }), [n, l] = k(!1), c = J([]), d =
|
|
4695
|
+
const { user: t } = te(), { enroll: r } = Pe(), { recoveryMode: o } = ws(), [a, s] = k({ step: "idle" }), [n, l] = k(!1), c = J([]), d = x(() => {
|
|
4701
4696
|
jr(...c.current), c.current = [];
|
|
4702
4697
|
}, []);
|
|
4703
4698
|
_(() => () => {
|
|
4704
4699
|
d();
|
|
4705
4700
|
}, [d]);
|
|
4706
|
-
const u =
|
|
4701
|
+
const u = x(
|
|
4707
4702
|
async (p, h, y, b) => {
|
|
4708
4703
|
s({ step: "generating_seed" });
|
|
4709
|
-
const
|
|
4710
|
-
c.current.push(
|
|
4711
|
-
const { shareA: N, shareB:
|
|
4712
|
-
c.current.push(N,
|
|
4713
|
-
const
|
|
4704
|
+
const v = eo();
|
|
4705
|
+
c.current.push(v), s({ step: "splitting_shares" });
|
|
4706
|
+
const { shareA: N, shareB: E, shareC: P } = ss(v);
|
|
4707
|
+
c.current.push(N, E, P), s({ step: "encrypting_shares" });
|
|
4708
|
+
const A = await zr(N, Vr(h)), S = os(v), L = ns(S);
|
|
4714
4709
|
s({ step: "uploading" });
|
|
4715
4710
|
const C = {
|
|
4716
4711
|
solanaPubkey: L,
|
|
4717
4712
|
shareAAuthMethod: p,
|
|
4718
|
-
shareACiphertext:
|
|
4719
|
-
shareANonce:
|
|
4713
|
+
shareACiphertext: A.ciphertext,
|
|
4714
|
+
shareANonce: A.nonce,
|
|
4720
4715
|
// Share B is now plaintext (SSS math protects it)
|
|
4721
|
-
shareB: we(
|
|
4716
|
+
shareB: we(E)
|
|
4722
4717
|
};
|
|
4723
4718
|
if (p === "password") {
|
|
4724
4719
|
if (!y) throw new Error("KDF salt required for password method");
|
|
@@ -4730,7 +4725,7 @@ function Gn() {
|
|
|
4730
4725
|
solanaPubkey: L
|
|
4731
4726
|
});
|
|
4732
4727
|
else {
|
|
4733
|
-
const B = o === "full_seed" ? dn(
|
|
4728
|
+
const B = o === "full_seed" ? dn(v) : cn(He(P));
|
|
4734
4729
|
s({
|
|
4735
4730
|
step: "showing_recovery",
|
|
4736
4731
|
recoveryPhrase: B,
|
|
@@ -4739,7 +4734,7 @@ function Gn() {
|
|
|
4739
4734
|
}
|
|
4740
4735
|
},
|
|
4741
4736
|
[r, o, d]
|
|
4742
|
-
), m =
|
|
4737
|
+
), m = x(
|
|
4743
4738
|
async (p) => {
|
|
4744
4739
|
if (!t) {
|
|
4745
4740
|
s({ step: "error", error: "User not authenticated" });
|
|
@@ -4759,7 +4754,7 @@ function Gn() {
|
|
|
4759
4754
|
}
|
|
4760
4755
|
},
|
|
4761
4756
|
[t, d, u]
|
|
4762
|
-
), f =
|
|
4757
|
+
), f = x(async () => {
|
|
4763
4758
|
if (!t) {
|
|
4764
4759
|
s({ step: "error", error: "User not authenticated" });
|
|
4765
4760
|
return;
|
|
@@ -4770,16 +4765,16 @@ function Gn() {
|
|
|
4770
4765
|
s({ step: "registering_passkey" });
|
|
4771
4766
|
let y;
|
|
4772
4767
|
try {
|
|
4773
|
-
const
|
|
4768
|
+
const v = new TextEncoder().encode(t.id), N = t.name ?? t.email ?? "User", E = t.email ?? t.id;
|
|
4774
4769
|
y = (await to(
|
|
4775
|
-
|
|
4776
|
-
|
|
4770
|
+
v,
|
|
4771
|
+
E,
|
|
4777
4772
|
N,
|
|
4778
4773
|
p
|
|
4779
4774
|
)).prfOutput;
|
|
4780
|
-
} catch (
|
|
4781
|
-
if (
|
|
4782
|
-
throw
|
|
4775
|
+
} catch (v) {
|
|
4776
|
+
if (v?.name !== "InvalidStateError")
|
|
4777
|
+
throw v;
|
|
4783
4778
|
y = (await zt(h)).prfOutput;
|
|
4784
4779
|
}
|
|
4785
4780
|
c.current.push(y);
|
|
@@ -4793,13 +4788,13 @@ function Gn() {
|
|
|
4793
4788
|
} finally {
|
|
4794
4789
|
l(!1);
|
|
4795
4790
|
}
|
|
4796
|
-
}, [t, d, u]), g =
|
|
4791
|
+
}, [t, d, u]), g = x(() => {
|
|
4797
4792
|
const p = a.solanaPubkey;
|
|
4798
4793
|
d(), s({
|
|
4799
4794
|
step: "complete",
|
|
4800
4795
|
solanaPubkey: p
|
|
4801
4796
|
});
|
|
4802
|
-
}, [a.solanaPubkey, d]), w =
|
|
4797
|
+
}, [a.solanaPubkey, d]), w = x(() => {
|
|
4803
4798
|
d(), s({ step: "idle" }), l(!1);
|
|
4804
4799
|
}, [d]);
|
|
4805
4800
|
return {
|
|
@@ -4824,11 +4819,11 @@ function Jn({
|
|
|
4824
4819
|
confirmRecoveryPhrase: d,
|
|
4825
4820
|
cancel: u,
|
|
4826
4821
|
isEnrolling: m
|
|
4827
|
-
} = Gn(), f = () => a || "password", [g, w] = k(f), [p, h] = k(""), [y, b] = k(""), [
|
|
4822
|
+
} = Gn(), f = () => a || "password", [g, w] = k(f), [p, h] = k(""), [y, b] = k(""), [v, N] = k(null);
|
|
4828
4823
|
_(() => {
|
|
4829
4824
|
w(f());
|
|
4830
4825
|
}, [s?.id, a]);
|
|
4831
|
-
const
|
|
4826
|
+
const E = x(
|
|
4832
4827
|
async (L) => {
|
|
4833
4828
|
if (L.preventDefault(), p !== y) {
|
|
4834
4829
|
N("Passwords do not match");
|
|
@@ -4843,11 +4838,11 @@ function Jn({
|
|
|
4843
4838
|
N(null), await l(p);
|
|
4844
4839
|
},
|
|
4845
4840
|
[p, y, l]
|
|
4846
|
-
), P =
|
|
4841
|
+
), P = x(async () => {
|
|
4847
4842
|
await c();
|
|
4848
|
-
}, [c]),
|
|
4843
|
+
}, [c]), A = x(() => {
|
|
4849
4844
|
d(), n.solanaPubkey && t?.(n.solanaPubkey);
|
|
4850
|
-
}, [d, n.solanaPubkey, t]),
|
|
4845
|
+
}, [d, n.solanaPubkey, t]), S = x(() => {
|
|
4851
4846
|
u(), r?.();
|
|
4852
4847
|
}, [u, r]);
|
|
4853
4848
|
return n.step === "generating_seed" || n.step === "splitting_shares" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${o}`, "aria-busy": "true", children: /* @__PURE__ */ i("div", { className: "cedros-enrollment-progress", role: "status", "aria-live": "polite", children: [
|
|
@@ -4889,7 +4884,7 @@ function Jn({
|
|
|
4889
4884
|
] }) }) }) : n.step === "uploading" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${o}`, "aria-busy": "true", children: /* @__PURE__ */ i("div", { className: "cedros-enrollment-progress", role: "status", "aria-live": "polite", children: [
|
|
4890
4885
|
/* @__PURE__ */ e("div", { className: "cedros-spinner", "aria-hidden": "true" }),
|
|
4891
4886
|
/* @__PURE__ */ e("p", { children: "Saving wallet..." })
|
|
4892
|
-
] }) }) : n.step === "showing_recovery" && n.recoveryPhrase ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${o}`, children: /* @__PURE__ */ e(Hn, { words: n.recoveryPhrase, onConfirm:
|
|
4887
|
+
] }) }) : n.step === "showing_recovery" && n.recoveryPhrase ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${o}`, children: /* @__PURE__ */ e(Hn, { words: n.recoveryPhrase, onConfirm: A }) }) : n.step === "complete" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-enrollment ${o}`, children: /* @__PURE__ */ i("div", { className: "cedros-enrollment-complete", children: [
|
|
4893
4888
|
/* @__PURE__ */ i(
|
|
4894
4889
|
"svg",
|
|
4895
4890
|
{
|
|
@@ -4953,7 +4948,7 @@ function Jn({
|
|
|
4953
4948
|
{
|
|
4954
4949
|
type: "button",
|
|
4955
4950
|
className: "cedros-button cedros-button-secondary",
|
|
4956
|
-
onClick:
|
|
4951
|
+
onClick: S,
|
|
4957
4952
|
children: "Cancel"
|
|
4958
4953
|
}
|
|
4959
4954
|
),
|
|
@@ -5006,7 +5001,7 @@ function Jn({
|
|
|
5006
5001
|
/* @__PURE__ */ e("span", { children: "Passkey" })
|
|
5007
5002
|
] })
|
|
5008
5003
|
] }),
|
|
5009
|
-
g === "password" && /* @__PURE__ */ i("form", { onSubmit:
|
|
5004
|
+
g === "password" && /* @__PURE__ */ i("form", { onSubmit: E, className: "cedros-enrollment-form", children: [
|
|
5010
5005
|
/* @__PURE__ */ e(
|
|
5011
5006
|
he,
|
|
5012
5007
|
{
|
|
@@ -5026,7 +5021,7 @@ function Jn({
|
|
|
5026
5021
|
label: "Confirm Password",
|
|
5027
5022
|
value: y,
|
|
5028
5023
|
onChange: (L) => b(L.target.value),
|
|
5029
|
-
error:
|
|
5024
|
+
error: v ?? void 0,
|
|
5030
5025
|
disabled: m,
|
|
5031
5026
|
required: !0,
|
|
5032
5027
|
minLength: 8,
|
|
@@ -5040,7 +5035,7 @@ function Jn({
|
|
|
5040
5035
|
{
|
|
5041
5036
|
type: "button",
|
|
5042
5037
|
className: "cedros-button cedros-button-secondary",
|
|
5043
|
-
onClick:
|
|
5038
|
+
onClick: S,
|
|
5044
5039
|
disabled: m,
|
|
5045
5040
|
children: "Cancel"
|
|
5046
5041
|
}
|
|
@@ -5094,7 +5089,7 @@ function Jn({
|
|
|
5094
5089
|
{
|
|
5095
5090
|
type: "button",
|
|
5096
5091
|
className: "cedros-button cedros-button-secondary",
|
|
5097
|
-
onClick:
|
|
5092
|
+
onClick: S,
|
|
5098
5093
|
disabled: m,
|
|
5099
5094
|
children: "Cancel"
|
|
5100
5095
|
}
|
|
@@ -5114,7 +5109,7 @@ function Jn({
|
|
|
5114
5109
|
] });
|
|
5115
5110
|
}
|
|
5116
5111
|
function Xn() {
|
|
5117
|
-
const { user: t } = te(), { signTransaction: r } = Pe(), [o, a] = k(!1), [s, n] = k(null), l =
|
|
5112
|
+
const { user: t } = te(), { signTransaction: r } = Pe(), [o, a] = k(!1), [s, n] = k(null), l = x(
|
|
5118
5113
|
async (d, u) => {
|
|
5119
5114
|
if (!t) {
|
|
5120
5115
|
const m = "User not authenticated";
|
|
@@ -5135,7 +5130,7 @@ function Xn() {
|
|
|
5135
5130
|
}
|
|
5136
5131
|
},
|
|
5137
5132
|
[t, r]
|
|
5138
|
-
), c =
|
|
5133
|
+
), c = x(() => n(null), []);
|
|
5139
5134
|
return {
|
|
5140
5135
|
signTransaction: l,
|
|
5141
5136
|
isSigning: o,
|
|
@@ -5144,7 +5139,7 @@ function Xn() {
|
|
|
5144
5139
|
};
|
|
5145
5140
|
}
|
|
5146
5141
|
function Zn() {
|
|
5147
|
-
const { getMaterial: t } = Pe(), [r, o] = k(!1), [a, s] = k(null), n =
|
|
5142
|
+
const { getMaterial: t } = Pe(), [r, o] = k(!1), [a, s] = k(null), n = x(async () => {
|
|
5148
5143
|
o(!0), s(null);
|
|
5149
5144
|
try {
|
|
5150
5145
|
const c = await t();
|
|
@@ -5169,7 +5164,7 @@ function Zn() {
|
|
|
5169
5164
|
} finally {
|
|
5170
5165
|
o(!1);
|
|
5171
5166
|
}
|
|
5172
|
-
}, [t]), l =
|
|
5167
|
+
}, [t]), l = x(() => s(null), []);
|
|
5173
5168
|
return {
|
|
5174
5169
|
getPasskeyCredential: n,
|
|
5175
5170
|
isAuthenticating: r,
|
|
@@ -5188,9 +5183,9 @@ function ea({
|
|
|
5188
5183
|
description: c,
|
|
5189
5184
|
className: d = ""
|
|
5190
5185
|
}) {
|
|
5191
|
-
const u =
|
|
5186
|
+
const u = x(() => {
|
|
5192
5187
|
r || a?.();
|
|
5193
|
-
}, [r, a]), m =
|
|
5188
|
+
}, [r, a]), m = x(() => {
|
|
5194
5189
|
s?.();
|
|
5195
5190
|
}, [s]), f = t === "register" ? "Set Up Passkey" : "Verify with Passkey", g = t === "register" ? "Create a passkey to securely encrypt your wallet on this device. You will use your fingerprint, face, or device PIN." : "Use your passkey to unlock your wallet. You will be prompted for biometric verification.";
|
|
5196
5191
|
return /* @__PURE__ */ i("div", { className: `cedros-passkey-prompt ${d}`, children: [
|
|
@@ -5309,7 +5304,7 @@ function oa({
|
|
|
5309
5304
|
_(() => {
|
|
5310
5305
|
a !== void 0 && w(a);
|
|
5311
5306
|
}, [a]);
|
|
5312
|
-
const
|
|
5307
|
+
const v = g === "password", N = g === "passkey", E = x(async () => {
|
|
5313
5308
|
if (f("credential"), b(null), !g)
|
|
5314
5309
|
try {
|
|
5315
5310
|
const T = await l();
|
|
@@ -5317,12 +5312,12 @@ function oa({
|
|
|
5317
5312
|
} catch (T) {
|
|
5318
5313
|
b(T instanceof Error ? T.message : "Failed to get wallet info"), f("error");
|
|
5319
5314
|
}
|
|
5320
|
-
}, [g, l]), P =
|
|
5315
|
+
}, [g, l]), P = x(
|
|
5321
5316
|
async (T) => {
|
|
5322
5317
|
T.preventDefault(), b(null), f("unlocking");
|
|
5323
5318
|
try {
|
|
5324
5319
|
let M;
|
|
5325
|
-
if (
|
|
5320
|
+
if (v)
|
|
5326
5321
|
M = { type: "password", password: p };
|
|
5327
5322
|
else
|
|
5328
5323
|
throw new Error("Invalid auth method");
|
|
@@ -5331,8 +5326,8 @@ function oa({
|
|
|
5331
5326
|
b(M instanceof Error ? M.message : "Failed to unlock wallet"), f("error");
|
|
5332
5327
|
}
|
|
5333
5328
|
},
|
|
5334
|
-
[
|
|
5335
|
-
),
|
|
5329
|
+
[v, p, n, t]
|
|
5330
|
+
), A = x(async () => {
|
|
5336
5331
|
b(null), f("unlocking");
|
|
5337
5332
|
try {
|
|
5338
5333
|
const T = await d();
|
|
@@ -5344,9 +5339,9 @@ function oa({
|
|
|
5344
5339
|
} catch (T) {
|
|
5345
5340
|
b(T instanceof Error ? T.message : "Failed to unlock wallet"), f("error");
|
|
5346
5341
|
}
|
|
5347
|
-
}, [d, n, t]),
|
|
5342
|
+
}, [d, n, t]), S = x(() => {
|
|
5348
5343
|
h(""), f("idle"), b(null), r?.();
|
|
5349
|
-
}, [r]), L =
|
|
5344
|
+
}, [r]), L = x(() => {
|
|
5350
5345
|
h(""), f("credential"), b(null);
|
|
5351
5346
|
}, []), C = c || u, B = () => {
|
|
5352
5347
|
switch (m) {
|
|
@@ -5360,13 +5355,13 @@ function oa({
|
|
|
5360
5355
|
{
|
|
5361
5356
|
type: "button",
|
|
5362
5357
|
className: "cedros-button cedros-button-primary",
|
|
5363
|
-
onClick:
|
|
5358
|
+
onClick: E,
|
|
5364
5359
|
children: "Unlock Wallet"
|
|
5365
5360
|
}
|
|
5366
5361
|
)
|
|
5367
5362
|
] });
|
|
5368
5363
|
case "credential":
|
|
5369
|
-
return
|
|
5364
|
+
return v ? /* @__PURE__ */ i("form", { className: "cedros-wallet-unlock-form", onSubmit: P, children: [
|
|
5370
5365
|
/* @__PURE__ */ e("h3", { className: "cedros-wallet-unlock-title", children: "Enter Password" }),
|
|
5371
5366
|
/* @__PURE__ */ e("p", { className: "cedros-wallet-unlock-description", children: "Enter your wallet password to unlock." }),
|
|
5372
5367
|
/* @__PURE__ */ e(
|
|
@@ -5395,7 +5390,7 @@ function oa({
|
|
|
5395
5390
|
{
|
|
5396
5391
|
type: "button",
|
|
5397
5392
|
className: "cedros-button cedros-button-secondary",
|
|
5398
|
-
onClick:
|
|
5393
|
+
onClick: S,
|
|
5399
5394
|
disabled: C,
|
|
5400
5395
|
children: "Cancel"
|
|
5401
5396
|
}
|
|
@@ -5410,18 +5405,18 @@ function oa({
|
|
|
5410
5405
|
mode: "authenticate",
|
|
5411
5406
|
isLoading: C,
|
|
5412
5407
|
error: y ?? void 0,
|
|
5413
|
-
onPrompt:
|
|
5414
|
-
onRetry:
|
|
5415
|
-
onCancel: o ?
|
|
5408
|
+
onPrompt: A,
|
|
5409
|
+
onRetry: A,
|
|
5410
|
+
onCancel: o ? S : void 0
|
|
5416
5411
|
}
|
|
5417
5412
|
)
|
|
5418
5413
|
] }) : /* @__PURE__ */ i("div", { className: "cedros-wallet-unlock-loading", children: [
|
|
5419
|
-
/* @__PURE__ */ e(
|
|
5414
|
+
/* @__PURE__ */ e(j, { size: "xl" }),
|
|
5420
5415
|
/* @__PURE__ */ e("p", { children: "Loading wallet info..." })
|
|
5421
5416
|
] });
|
|
5422
5417
|
case "unlocking":
|
|
5423
5418
|
return /* @__PURE__ */ i("div", { className: "cedros-wallet-unlock-progress", children: [
|
|
5424
|
-
/* @__PURE__ */ e("div", { className: "cedros-wallet-unlock-icon", children: /* @__PURE__ */ e(
|
|
5419
|
+
/* @__PURE__ */ e("div", { className: "cedros-wallet-unlock-icon", children: /* @__PURE__ */ e(j, { size: "xl" }) }),
|
|
5425
5420
|
/* @__PURE__ */ e("h3", { className: "cedros-wallet-unlock-title", children: "Unlocking Wallet" }),
|
|
5426
5421
|
/* @__PURE__ */ e("p", { className: "cedros-wallet-unlock-description", children: "Verifying your credentials..." })
|
|
5427
5422
|
] });
|
|
@@ -5451,7 +5446,7 @@ function oa({
|
|
|
5451
5446
|
{
|
|
5452
5447
|
type: "button",
|
|
5453
5448
|
className: "cedros-button cedros-button-secondary",
|
|
5454
|
-
onClick:
|
|
5449
|
+
onClick: S,
|
|
5455
5450
|
children: "Cancel"
|
|
5456
5451
|
}
|
|
5457
5452
|
)
|
|
@@ -5531,13 +5526,13 @@ function ia() {
|
|
|
5531
5526
|
] });
|
|
5532
5527
|
}
|
|
5533
5528
|
function ca() {
|
|
5534
|
-
const { recover: t, getShareBForRecovery: r } = Pe(), { recoveryMode: o } = ws(), [a, s] = k({ step: "idle" }), [n, l] = k(!1), c = J([]), d =
|
|
5529
|
+
const { recover: t, getShareBForRecovery: r } = Pe(), { recoveryMode: o } = ws(), [a, s] = k({ step: "idle" }), [n, l] = k(!1), c = J([]), d = x(() => {
|
|
5535
5530
|
jr(...c.current), c.current = [];
|
|
5536
5531
|
}, []);
|
|
5537
5532
|
_(() => () => {
|
|
5538
5533
|
d();
|
|
5539
5534
|
}, [d]);
|
|
5540
|
-
const u =
|
|
5535
|
+
const u = x(
|
|
5541
5536
|
async (f, g, w) => {
|
|
5542
5537
|
l(!0), d();
|
|
5543
5538
|
try {
|
|
@@ -5551,26 +5546,26 @@ function ca() {
|
|
|
5551
5546
|
c.current.push(T), p = Qo(He(T), He(L)), c.current.push(p);
|
|
5552
5547
|
} else
|
|
5553
5548
|
p = un(f), c.current.push(p);
|
|
5554
|
-
const h = os(p), y = ns(h), { shareA: b, shareB:
|
|
5555
|
-
c.current.push(b,
|
|
5556
|
-
let N,
|
|
5549
|
+
const h = os(p), y = ns(h), { shareA: b, shareB: v } = ss(p);
|
|
5550
|
+
c.current.push(b, v), s({ step: "encrypting" });
|
|
5551
|
+
let N, E, P;
|
|
5557
5552
|
if (g === "passkey") {
|
|
5558
5553
|
const L = Qr();
|
|
5559
5554
|
P = we(L);
|
|
5560
5555
|
const C = await zt(P);
|
|
5561
5556
|
c.current.push(C.prfOutput), N = await Kr(C.prfOutput, L), c.current.push(N);
|
|
5562
5557
|
} else
|
|
5563
|
-
|
|
5564
|
-
const
|
|
5558
|
+
E = Hr(), N = await as(w, E, Qe), c.current.push(N);
|
|
5559
|
+
const A = await zr(b, Vr(N));
|
|
5565
5560
|
s({ step: "uploading" });
|
|
5566
|
-
const
|
|
5561
|
+
const S = {
|
|
5567
5562
|
solanaPubkey: y,
|
|
5568
5563
|
shareAAuthMethod: g,
|
|
5569
|
-
shareACiphertext:
|
|
5570
|
-
shareANonce:
|
|
5571
|
-
shareB: we(
|
|
5564
|
+
shareACiphertext: A.ciphertext,
|
|
5565
|
+
shareANonce: A.nonce,
|
|
5566
|
+
shareB: we(v)
|
|
5572
5567
|
};
|
|
5573
|
-
g === "password" && (
|
|
5568
|
+
g === "password" && (S.shareAKdfSalt = we(E), S.shareAKdfParams = Qe), g === "passkey" && (S.prfSalt = P), await t(S), d(), s({ step: "complete" });
|
|
5574
5569
|
} catch (p) {
|
|
5575
5570
|
d(), s({
|
|
5576
5571
|
step: "error",
|
|
@@ -5581,7 +5576,7 @@ function ca() {
|
|
|
5581
5576
|
}
|
|
5582
5577
|
},
|
|
5583
5578
|
[t, r, o, d]
|
|
5584
|
-
), m =
|
|
5579
|
+
), m = x(() => {
|
|
5585
5580
|
d(), s({ step: "idle" }), l(!1);
|
|
5586
5581
|
}, [d]);
|
|
5587
5582
|
return {
|
|
@@ -5597,9 +5592,9 @@ function la({
|
|
|
5597
5592
|
className: o = "",
|
|
5598
5593
|
defaultAuthMethod: a = "password"
|
|
5599
5594
|
}) {
|
|
5600
|
-
const { state: s, startRecovery: n, cancel: l, isRecovering: c } = ca(), [d, u] = k([]), [m, f] = k(!1), [g, w] = k(a), [p, h] = k(""), [y, b] = k(""), [
|
|
5595
|
+
const { state: s, startRecovery: n, cancel: l, isRecovering: c } = ca(), [d, u] = k([]), [m, f] = k(!1), [g, w] = k(a), [p, h] = k(""), [y, b] = k(""), [v, N] = k(null), E = x((C) => {
|
|
5601
5596
|
u(C), f(!0);
|
|
5602
|
-
}, []), P =
|
|
5597
|
+
}, []), P = x(
|
|
5603
5598
|
async (C) => {
|
|
5604
5599
|
if (C.preventDefault(), N(null), g !== "passkey") {
|
|
5605
5600
|
if (p !== y) {
|
|
@@ -5614,11 +5609,11 @@ function la({
|
|
|
5614
5609
|
await n(d, g, p);
|
|
5615
5610
|
},
|
|
5616
5611
|
[d, g, p, y, n]
|
|
5617
|
-
),
|
|
5612
|
+
), A = x(() => {
|
|
5618
5613
|
l(), u([]), f(!1), h(""), b(""), r?.();
|
|
5619
|
-
}, [l, r]),
|
|
5614
|
+
}, [l, r]), S = x(() => {
|
|
5620
5615
|
f(!1), h(""), b("");
|
|
5621
|
-
}, []), L =
|
|
5616
|
+
}, []), L = x(() => {
|
|
5622
5617
|
t?.();
|
|
5623
5618
|
}, [t]);
|
|
5624
5619
|
return s.step === "validating" || s.step === "encrypting" || s.step === "uploading" ? /* @__PURE__ */ e("div", { className: `cedros-wallet-recovery ${o}`, children: /* @__PURE__ */ i("div", { className: "cedros-wallet-recovery-progress", children: [
|
|
@@ -5660,7 +5655,7 @@ function la({
|
|
|
5660
5655
|
{
|
|
5661
5656
|
type: "button",
|
|
5662
5657
|
className: "cedros-button cedros-button-primary",
|
|
5663
|
-
onClick:
|
|
5658
|
+
onClick: A,
|
|
5664
5659
|
children: "Start Over"
|
|
5665
5660
|
}
|
|
5666
5661
|
) })
|
|
@@ -5727,11 +5722,11 @@ function la({
|
|
|
5727
5722
|
value: y,
|
|
5728
5723
|
onChange: (C) => b(C.target.value),
|
|
5729
5724
|
disabled: c,
|
|
5730
|
-
"aria-invalid":
|
|
5725
|
+
"aria-invalid": v ? "true" : void 0,
|
|
5731
5726
|
placeholder: "Confirm your password"
|
|
5732
5727
|
}
|
|
5733
5728
|
),
|
|
5734
|
-
|
|
5729
|
+
v && /* @__PURE__ */ e("p", { className: "cedros-input-error", role: "alert", children: v })
|
|
5735
5730
|
] })
|
|
5736
5731
|
] }),
|
|
5737
5732
|
g === "passkey" && /* @__PURE__ */ i("div", { className: "cedros-passkey-info", children: [
|
|
@@ -5744,7 +5739,7 @@ function la({
|
|
|
5744
5739
|
{
|
|
5745
5740
|
type: "button",
|
|
5746
5741
|
className: "cedros-button cedros-button-secondary",
|
|
5747
|
-
onClick:
|
|
5742
|
+
onClick: S,
|
|
5748
5743
|
disabled: c,
|
|
5749
5744
|
children: "Back"
|
|
5750
5745
|
}
|
|
@@ -5767,8 +5762,8 @@ function la({
|
|
|
5767
5762
|
/* @__PURE__ */ e(
|
|
5768
5763
|
Qn,
|
|
5769
5764
|
{
|
|
5770
|
-
onSubmit:
|
|
5771
|
-
onCancel:
|
|
5765
|
+
onSubmit: E,
|
|
5766
|
+
onCancel: A,
|
|
5772
5767
|
isSubmitting: !1
|
|
5773
5768
|
}
|
|
5774
5769
|
)
|
|
@@ -5889,7 +5884,7 @@ function ma({
|
|
|
5889
5884
|
const l = ve(), [c, d] = k(!1), [u, m] = k(null), [f, g] = k(!1), w = J(null), p = l?.config.solana?.network ?? "mainnet-beta", h = q(() => {
|
|
5890
5885
|
const N = `https://explorer.solana.com/address/${t}`;
|
|
5891
5886
|
return p === "mainnet-beta" ? N : `${N}?cluster=${encodeURIComponent(p)}`;
|
|
5892
|
-
}, [t, p]), y = s && t.length > 18, b = q(() => !y || f ? t : `${t.slice(0, 8)}...${t.slice(-8)}`, [t, y, f]),
|
|
5887
|
+
}, [t, p]), y = s && t.length > 18, b = q(() => !y || f ? t : `${t.slice(0, 8)}...${t.slice(-8)}`, [t, y, f]), v = x(async () => {
|
|
5893
5888
|
try {
|
|
5894
5889
|
m(null), await navigator.clipboard.writeText(t), d(!0), w.current !== null && window.clearTimeout(w.current), w.current = window.setTimeout(() => {
|
|
5895
5890
|
d(!1), w.current = null;
|
|
@@ -5991,7 +5986,7 @@ function ma({
|
|
|
5991
5986
|
{
|
|
5992
5987
|
type: "button",
|
|
5993
5988
|
className: "cedros-button cedros-button-sm cedros-button-outline",
|
|
5994
|
-
onClick:
|
|
5989
|
+
onClick: v,
|
|
5995
5990
|
"aria-label": "Copy wallet address",
|
|
5996
5991
|
children: c ? "Copied" : "Copy"
|
|
5997
5992
|
}
|
|
@@ -6239,11 +6234,11 @@ function Fc({ className: t = "", showActions: r = !0 }) {
|
|
|
6239
6234
|
default:
|
|
6240
6235
|
return null;
|
|
6241
6236
|
}
|
|
6242
|
-
}, [a]), l =
|
|
6237
|
+
}, [a]), l = x(() => s("status"), []), c = x(async () => {
|
|
6243
6238
|
s("status"), await o.refresh();
|
|
6244
|
-
}, [o]), d =
|
|
6239
|
+
}, [o]), d = x(async () => {
|
|
6245
6240
|
s("status"), await o.refresh();
|
|
6246
|
-
}, [o]), u =
|
|
6241
|
+
}, [o]), u = x(async () => {
|
|
6247
6242
|
s("status"), await o.refresh();
|
|
6248
6243
|
}, [o]);
|
|
6249
6244
|
return /* @__PURE__ */ i("div", { className: `cedros-wallet-manager ${t}`, children: [
|
|
@@ -6342,34 +6337,34 @@ function _c({
|
|
|
6342
6337
|
return () => clearTimeout(P);
|
|
6343
6338
|
}
|
|
6344
6339
|
}, [w]);
|
|
6345
|
-
const h =
|
|
6346
|
-
m((
|
|
6347
|
-
}, []), y =
|
|
6348
|
-
const P = Object.entries(u).map(([
|
|
6349
|
-
key:
|
|
6350
|
-
value:
|
|
6340
|
+
const h = x((P, A) => {
|
|
6341
|
+
m((S) => ({ ...S, [P]: A })), g(null), p(!1);
|
|
6342
|
+
}, []), y = x(async () => {
|
|
6343
|
+
const P = Object.entries(u).map(([A, S]) => ({
|
|
6344
|
+
key: A,
|
|
6345
|
+
value: S
|
|
6351
6346
|
}));
|
|
6352
6347
|
if (P.length !== 0)
|
|
6353
6348
|
try {
|
|
6354
6349
|
await d(P), m({}), g(null), p(!0), o?.();
|
|
6355
|
-
} catch (
|
|
6356
|
-
g(
|
|
6350
|
+
} catch (A) {
|
|
6351
|
+
g(A instanceof Error ? A.message : "Failed to save settings");
|
|
6357
6352
|
}
|
|
6358
|
-
}, [u, d, o]), b =
|
|
6353
|
+
}, [u, d, o]), b = x(() => {
|
|
6359
6354
|
m({}), g(null), p(!1);
|
|
6360
|
-
}, []),
|
|
6355
|
+
}, []), v = Object.keys(u).length > 0, N = Object.keys(u).length;
|
|
6361
6356
|
if (s && Object.keys(a).length === 0)
|
|
6362
6357
|
return /* @__PURE__ */ i("div", { className: `cedros-system-settings cedros-system-settings-loading ${r}`, children: [
|
|
6363
|
-
/* @__PURE__ */ e(
|
|
6358
|
+
/* @__PURE__ */ e(j, {}),
|
|
6364
6359
|
/* @__PURE__ */ e("span", { children: "Loading settings..." })
|
|
6365
6360
|
] });
|
|
6366
6361
|
if (l)
|
|
6367
6362
|
return /* @__PURE__ */ e("div", { className: `cedros-system-settings ${r}`, children: /* @__PURE__ */ e(X, { error: l.message }) });
|
|
6368
|
-
const
|
|
6369
|
-
return
|
|
6363
|
+
const E = Object.keys(a).sort();
|
|
6364
|
+
return E.length === 0 ? /* @__PURE__ */ e("div", { className: `cedros-system-settings cedros-system-settings-empty ${r}`, children: /* @__PURE__ */ e("p", { children: "No system settings found." }) }) : /* @__PURE__ */ i("div", { className: `cedros-system-settings ${r}`, children: [
|
|
6370
6365
|
f && /* @__PURE__ */ e(X, { error: f }),
|
|
6371
6366
|
w && /* @__PURE__ */ e("div", { className: "cedros-settings-success", children: "Settings saved successfully." }),
|
|
6372
|
-
|
|
6367
|
+
E.map((P) => /* @__PURE__ */ e(
|
|
6373
6368
|
ba,
|
|
6374
6369
|
{
|
|
6375
6370
|
category: P,
|
|
@@ -6381,7 +6376,7 @@ function _c({
|
|
|
6381
6376
|
P
|
|
6382
6377
|
)),
|
|
6383
6378
|
/* @__PURE__ */ i("div", { className: "cedros-system-settings-actions", children: [
|
|
6384
|
-
|
|
6379
|
+
v && /* @__PURE__ */ i("span", { className: "cedros-settings-change-count", children: [
|
|
6385
6380
|
N,
|
|
6386
6381
|
" unsaved change",
|
|
6387
6382
|
N !== 1 ? "s" : ""
|
|
@@ -6392,7 +6387,7 @@ function _c({
|
|
|
6392
6387
|
type: "button",
|
|
6393
6388
|
className: "cedros-button cedros-button-secondary",
|
|
6394
6389
|
onClick: b,
|
|
6395
|
-
disabled: !
|
|
6390
|
+
disabled: !v || n,
|
|
6396
6391
|
children: "Reset"
|
|
6397
6392
|
}
|
|
6398
6393
|
),
|
|
@@ -6402,8 +6397,8 @@ function _c({
|
|
|
6402
6397
|
type: "button",
|
|
6403
6398
|
className: "cedros-button cedros-button-primary",
|
|
6404
6399
|
onClick: y,
|
|
6405
|
-
disabled: !
|
|
6406
|
-
children: n ? /* @__PURE__ */ e(
|
|
6400
|
+
disabled: !v || n,
|
|
6401
|
+
children: n ? /* @__PURE__ */ e(j, { size: "sm" }) : "Save Changes"
|
|
6407
6402
|
}
|
|
6408
6403
|
)
|
|
6409
6404
|
] })
|
|
@@ -6470,7 +6465,7 @@ function ys() {
|
|
|
6470
6465
|
[t.serverUrl, t.requestTimeout, t.retryAttempts]
|
|
6471
6466
|
), f = J(m);
|
|
6472
6467
|
f.current = m;
|
|
6473
|
-
const g =
|
|
6468
|
+
const g = x(async () => {
|
|
6474
6469
|
s(!0), d(null);
|
|
6475
6470
|
const p = ++u.current;
|
|
6476
6471
|
try {
|
|
@@ -6483,7 +6478,7 @@ function ys() {
|
|
|
6483
6478
|
} finally {
|
|
6484
6479
|
p === u.current && s(!1);
|
|
6485
6480
|
}
|
|
6486
|
-
}, []), w =
|
|
6481
|
+
}, []), w = x(
|
|
6487
6482
|
async (p) => {
|
|
6488
6483
|
l(!0), d(null);
|
|
6489
6484
|
try {
|
|
@@ -6523,12 +6518,12 @@ function Na({ onComplete: t, className: r = "" }) {
|
|
|
6523
6518
|
_(() => {
|
|
6524
6519
|
l();
|
|
6525
6520
|
}, [l]);
|
|
6526
|
-
const p =
|
|
6521
|
+
const p = x(
|
|
6527
6522
|
(y) => (b) => {
|
|
6528
|
-
u((
|
|
6523
|
+
u((v) => ({ ...v, [y]: b.target.value })), f((v) => ({ ...v, [y]: void 0 }));
|
|
6529
6524
|
},
|
|
6530
6525
|
[]
|
|
6531
|
-
), h =
|
|
6526
|
+
), h = x(
|
|
6532
6527
|
async (y) => {
|
|
6533
6528
|
y.preventDefault();
|
|
6534
6529
|
const b = ka(d);
|
|
@@ -6549,7 +6544,7 @@ function Na({ onComplete: t, className: r = "" }) {
|
|
|
6549
6544
|
[d, c, t]
|
|
6550
6545
|
);
|
|
6551
6546
|
return a ? /* @__PURE__ */ e("div", { className: `cedros-setup ${r}`, children: /* @__PURE__ */ i("div", { className: "cedros-setup__loading", children: [
|
|
6552
|
-
/* @__PURE__ */ e(
|
|
6547
|
+
/* @__PURE__ */ e(j, {}),
|
|
6553
6548
|
/* @__PURE__ */ e("span", { className: "cedros-setup__loading-text", children: "Checking setup status..." })
|
|
6554
6549
|
] }) }) : o && !o.needsSetup ? /* @__PURE__ */ e("div", { className: `cedros-setup ${r}`, children: /* @__PURE__ */ i("div", { className: "cedros-setup__complete", children: [
|
|
6555
6550
|
/* @__PURE__ */ e("div", { className: "cedros-setup__icon cedros-setup__icon--success", children: /* @__PURE__ */ i(
|
|
@@ -6708,7 +6703,7 @@ function Na({ onComplete: t, className: r = "" }) {
|
|
|
6708
6703
|
m.confirmPassword && /* @__PURE__ */ e("span", { className: "cedros-setup__error", children: m.confirmPassword })
|
|
6709
6704
|
] }),
|
|
6710
6705
|
/* @__PURE__ */ e("button", { type: "submit", className: "cedros-setup__button", disabled: s, children: s ? /* @__PURE__ */ i($, { children: [
|
|
6711
|
-
/* @__PURE__ */ e(
|
|
6706
|
+
/* @__PURE__ */ e(j, {}),
|
|
6712
6707
|
/* @__PURE__ */ e("span", { children: "Creating Account..." })
|
|
6713
6708
|
] }) : "Create Admin Account" })
|
|
6714
6709
|
] }),
|
|
@@ -6752,19 +6747,19 @@ function Ea({ className: t }) {
|
|
|
6752
6747
|
_(() => {
|
|
6753
6748
|
c();
|
|
6754
6749
|
}, [c]);
|
|
6755
|
-
const g = dr.find((
|
|
6756
|
-
const
|
|
6757
|
-
if (m !== "email") return
|
|
6750
|
+
const g = dr.find((E) => E.id === m), w = g?.category ?? "", h = (u("email_provider") || "custom") === "custom", y = u("email_smtp_host"), b = !h || y != null && y !== "", v = q(() => {
|
|
6751
|
+
const E = r[w] ?? [];
|
|
6752
|
+
if (m !== "email") return E;
|
|
6758
6753
|
const P = h ? Wo : Oo;
|
|
6759
|
-
return
|
|
6760
|
-
}, [r, w, m, h]), N = (
|
|
6761
|
-
if (d(
|
|
6762
|
-
const
|
|
6763
|
-
|
|
6754
|
+
return E.filter((A) => P.includes(A.key)).sort((A, S) => P.indexOf(A.key) - P.indexOf(S.key));
|
|
6755
|
+
}, [r, w, m, h]), N = (E, P) => {
|
|
6756
|
+
if (d(E, P), E === "email_provider" && P !== "custom") {
|
|
6757
|
+
const A = qo[P];
|
|
6758
|
+
A && (d("email_smtp_host", A), d("email_smtp_port", "587"), d("email_smtp_tls", "true"));
|
|
6764
6759
|
}
|
|
6765
6760
|
};
|
|
6766
6761
|
return a && Object.keys(r).length === 0 ? /* @__PURE__ */ i("div", { className: `cedros-system-settings cedros-system-settings-loading ${t ?? ""}`, children: [
|
|
6767
|
-
/* @__PURE__ */ e(
|
|
6762
|
+
/* @__PURE__ */ e(j, {}),
|
|
6768
6763
|
/* @__PURE__ */ e("span", { children: "Loading settings..." })
|
|
6769
6764
|
] }) : l ? /* @__PURE__ */ e("div", { className: `cedros-system-settings ${t ?? ""}`, children: /* @__PURE__ */ e(X, { error: l.message }) }) : /* @__PURE__ */ i("div", { className: `cedros-system-settings ${t ?? ""}`, children: [
|
|
6770
6765
|
/* @__PURE__ */ i("div", { className: "cedros-settings-page-header", children: [
|
|
@@ -6775,26 +6770,26 @@ function Ea({ className: t }) {
|
|
|
6775
6770
|
/* @__PURE__ */ e(Co, { status: s, error: n })
|
|
6776
6771
|
] }),
|
|
6777
6772
|
m === "email" && !b && /* @__PURE__ */ e("div", { className: "cedros-settings-warning-banner", children: "Email features (verification, password reset, instant link) are disabled until SMTP is configured. Select a provider or enter custom SMTP settings below." }),
|
|
6778
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-tabs cedros-admin-tabs--line", children: dr.map((
|
|
6773
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-tabs cedros-admin-tabs--line", children: dr.map((E) => /* @__PURE__ */ e(
|
|
6779
6774
|
"button",
|
|
6780
6775
|
{
|
|
6781
6776
|
type: "button",
|
|
6782
|
-
className: `cedros-admin-tab ${m ===
|
|
6783
|
-
onClick: () => f(
|
|
6784
|
-
"aria-selected": m ===
|
|
6777
|
+
className: `cedros-admin-tab ${m === E.id ? "cedros-admin-tab-active" : ""}`,
|
|
6778
|
+
onClick: () => f(E.id),
|
|
6779
|
+
"aria-selected": m === E.id,
|
|
6785
6780
|
role: "tab",
|
|
6786
|
-
children:
|
|
6781
|
+
children: E.label
|
|
6787
6782
|
},
|
|
6788
|
-
|
|
6783
|
+
E.id
|
|
6789
6784
|
)) }),
|
|
6790
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-tab-content", role: "tabpanel", children:
|
|
6785
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-tab-content", role: "tabpanel", children: v.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-system-settings-empty", children: /* @__PURE__ */ i("p", { children: [
|
|
6791
6786
|
"No settings found for ",
|
|
6792
6787
|
g?.label ?? "this section",
|
|
6793
6788
|
"."
|
|
6794
6789
|
] }) }) : /* @__PURE__ */ e(
|
|
6795
6790
|
ts,
|
|
6796
6791
|
{
|
|
6797
|
-
settings:
|
|
6792
|
+
settings: v,
|
|
6798
6793
|
edits: o,
|
|
6799
6794
|
onChange: m === "email" ? N : d
|
|
6800
6795
|
}
|
|
@@ -7025,18 +7020,18 @@ function Oc({
|
|
|
7025
7020
|
onLogoutClick: c,
|
|
7026
7021
|
className: d = ""
|
|
7027
7022
|
}) {
|
|
7028
|
-
const [u, m] = k(o), [f, g] = k(!0), { user: w, logout: p } = te(), { activeOrg: h, role: y, isLoading: b, fetchOrgs:
|
|
7023
|
+
const [u, m] = k(o), [f, g] = k(!0), { user: w, logout: p } = te(), { activeOrg: h, role: y, isLoading: b, fetchOrgs: v, hasPermission: N } = Eo(), { status: E, isLoading: P, checkStatus: A } = ys(), { features: S, isLoading: L } = ho(), { canAccess: C } = po(), B = x(
|
|
7029
7024
|
(U) => {
|
|
7030
7025
|
m(U), n?.(U);
|
|
7031
7026
|
},
|
|
7032
7027
|
[n]
|
|
7033
|
-
), T = Sa.filter((U) => !(!r.includes(U.id) || U.requiredFeature && !
|
|
7028
|
+
), T = Sa.filter((U) => !(!r.includes(U.id) || U.requiredFeature && !S[U.requiredFeature] || !C(U.id))), M = T.find((U) => U.id === u), R = !M && !L;
|
|
7034
7029
|
return _(() => {
|
|
7035
|
-
|
|
7036
|
-
}, [
|
|
7030
|
+
v(), A();
|
|
7031
|
+
}, [v, A]), _(() => {
|
|
7037
7032
|
R && T.length > 0 && m("users");
|
|
7038
|
-
}, [R, T.length]), !P &&
|
|
7039
|
-
/* @__PURE__ */ e(
|
|
7033
|
+
}, [R, T.length]), !P && E?.needsSetup ? /* @__PURE__ */ e("div", { className: `cedros-admin cedros-dashboard cedros-dashboard--setup ${d}`, children: /* @__PURE__ */ e(Na, { onComplete: () => A() }) }) : (b || P || L) && !h ? /* @__PURE__ */ i("div", { className: `cedros-admin cedros-dashboard cedros-dashboard--loading ${d}`, children: [
|
|
7034
|
+
/* @__PURE__ */ e(j, {}),
|
|
7040
7035
|
/* @__PURE__ */ e("span", { className: "cedros-dashboard__loading-text", children: "Loading..." })
|
|
7041
7036
|
] }) : u === "team" && !h ? /* @__PURE__ */ e("div", { className: `cedros-admin cedros-dashboard ${d}`, children: /* @__PURE__ */ e(X, { error: "No organization selected. Please select an organization first." }) }) : /* @__PURE__ */ i("div", { className: `cedros-admin cedros-dashboard ${d}`, children: [
|
|
7042
7037
|
/* @__PURE__ */ i("aside", { className: "cedros-dashboard__sidebar", children: [
|
|
@@ -7174,21 +7169,21 @@ function Pa({ orgId: t, currentUserId: r, hasPermission: o, role: a }) {
|
|
|
7174
7169
|
fetchInvites: h,
|
|
7175
7170
|
createInvite: y,
|
|
7176
7171
|
cancelInvite: b,
|
|
7177
|
-
resendInvite:
|
|
7172
|
+
resendInvite: v
|
|
7178
7173
|
} = fo(t);
|
|
7179
7174
|
_(() => {
|
|
7180
7175
|
u(), h();
|
|
7181
7176
|
}, [u, h]);
|
|
7182
|
-
const N = o("invite:create"),
|
|
7177
|
+
const N = o("invite:create"), E = o("invite:cancel"), P = g.length, A = l.reduce(
|
|
7183
7178
|
(B, T) => (B[T.role] = (B[T.role] ?? 0) + 1, B),
|
|
7184
7179
|
{}
|
|
7185
|
-
),
|
|
7180
|
+
), S = A.owner ?? 0, L = A.admin ?? 0, C = A.member ?? 0;
|
|
7186
7181
|
return /* @__PURE__ */ i("div", { className: "cedros-dashboard__team", children: [
|
|
7187
7182
|
/* @__PURE__ */ e(
|
|
7188
7183
|
rs,
|
|
7189
7184
|
{
|
|
7190
7185
|
stats: [
|
|
7191
|
-
{ label: "Owners", value:
|
|
7186
|
+
{ label: "Owners", value: S },
|
|
7192
7187
|
{ label: "Admins", value: L },
|
|
7193
7188
|
{ label: "Members", value: C },
|
|
7194
7189
|
{ label: "Pending Invites", value: P }
|
|
@@ -7265,9 +7260,9 @@ function Pa({ orgId: t, currentUserId: r, hasPermission: o, role: a }) {
|
|
|
7265
7260
|
invites: g,
|
|
7266
7261
|
isLoading: w,
|
|
7267
7262
|
error: p?.message,
|
|
7268
|
-
canManage:
|
|
7269
|
-
onCancel:
|
|
7270
|
-
onResend: N ?
|
|
7263
|
+
canManage: E || N,
|
|
7264
|
+
onCancel: E ? b : void 0,
|
|
7265
|
+
onResend: N ? v : void 0
|
|
7271
7266
|
}
|
|
7272
7267
|
) })
|
|
7273
7268
|
] }),
|
|
@@ -8164,9 +8159,9 @@ function Oa() {
|
|
|
8164
8159
|
if (!n.isValid(w))
|
|
8165
8160
|
throw new Error("Invalid QR Code version");
|
|
8166
8161
|
typeof h > "u" && (h = s.BYTE);
|
|
8167
|
-
const y = r.getSymbolTotalCodewords(w), b = o.getTotalCodewordsCount(w, p),
|
|
8168
|
-
if (h === s.MIXED) return
|
|
8169
|
-
const N =
|
|
8162
|
+
const y = r.getSymbolTotalCodewords(w), b = o.getTotalCodewordsCount(w, p), v = (y - b) * 8;
|
|
8163
|
+
if (h === s.MIXED) return v;
|
|
8164
|
+
const N = v - u(h, w);
|
|
8170
8165
|
switch (h) {
|
|
8171
8166
|
case s.NUMERIC:
|
|
8172
8167
|
return Math.floor(N / 10 * 3);
|
|
@@ -8429,33 +8424,33 @@ function Ka() {
|
|
|
8429
8424
|
function u(b) {
|
|
8430
8425
|
return unescape(encodeURIComponent(b)).length;
|
|
8431
8426
|
}
|
|
8432
|
-
function m(b,
|
|
8433
|
-
const
|
|
8427
|
+
function m(b, v, N) {
|
|
8428
|
+
const E = [];
|
|
8434
8429
|
let P;
|
|
8435
8430
|
for (; (P = b.exec(N)) !== null; )
|
|
8436
|
-
|
|
8431
|
+
E.push({
|
|
8437
8432
|
data: P[0],
|
|
8438
8433
|
index: P.index,
|
|
8439
|
-
mode:
|
|
8434
|
+
mode: v,
|
|
8440
8435
|
length: P[0].length
|
|
8441
8436
|
});
|
|
8442
|
-
return
|
|
8437
|
+
return E;
|
|
8443
8438
|
}
|
|
8444
8439
|
function f(b) {
|
|
8445
|
-
const
|
|
8446
|
-
let
|
|
8447
|
-
return c.isKanjiModeEnabled() ? (
|
|
8448
|
-
return
|
|
8449
|
-
}).map(function(
|
|
8440
|
+
const v = m(l.NUMERIC, r.NUMERIC, b), N = m(l.ALPHANUMERIC, r.ALPHANUMERIC, b);
|
|
8441
|
+
let E, P;
|
|
8442
|
+
return c.isKanjiModeEnabled() ? (E = m(l.BYTE, r.BYTE, b), P = m(l.KANJI, r.KANJI, b)) : (E = m(l.BYTE_KANJI, r.BYTE, b), P = []), v.concat(N, E, P).sort(function(S, L) {
|
|
8443
|
+
return S.index - L.index;
|
|
8444
|
+
}).map(function(S) {
|
|
8450
8445
|
return {
|
|
8451
|
-
data:
|
|
8452
|
-
mode:
|
|
8453
|
-
length:
|
|
8446
|
+
data: S.data,
|
|
8447
|
+
mode: S.mode,
|
|
8448
|
+
length: S.length
|
|
8454
8449
|
};
|
|
8455
8450
|
});
|
|
8456
8451
|
}
|
|
8457
|
-
function g(b,
|
|
8458
|
-
switch (
|
|
8452
|
+
function g(b, v) {
|
|
8453
|
+
switch (v) {
|
|
8459
8454
|
case r.NUMERIC:
|
|
8460
8455
|
return o.getBitsLength(b);
|
|
8461
8456
|
case r.ALPHANUMERIC:
|
|
@@ -8467,68 +8462,68 @@ function Ka() {
|
|
|
8467
8462
|
}
|
|
8468
8463
|
}
|
|
8469
8464
|
function w(b) {
|
|
8470
|
-
return b.reduce(function(
|
|
8471
|
-
const
|
|
8472
|
-
return
|
|
8465
|
+
return b.reduce(function(v, N) {
|
|
8466
|
+
const E = v.length - 1 >= 0 ? v[v.length - 1] : null;
|
|
8467
|
+
return E && E.mode === N.mode ? (v[v.length - 1].data += N.data, v) : (v.push(N), v);
|
|
8473
8468
|
}, []);
|
|
8474
8469
|
}
|
|
8475
8470
|
function p(b) {
|
|
8476
|
-
const
|
|
8471
|
+
const v = [];
|
|
8477
8472
|
for (let N = 0; N < b.length; N++) {
|
|
8478
|
-
const
|
|
8479
|
-
switch (
|
|
8473
|
+
const E = b[N];
|
|
8474
|
+
switch (E.mode) {
|
|
8480
8475
|
case r.NUMERIC:
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
{ data:
|
|
8484
|
-
{ data:
|
|
8476
|
+
v.push([
|
|
8477
|
+
E,
|
|
8478
|
+
{ data: E.data, mode: r.ALPHANUMERIC, length: E.length },
|
|
8479
|
+
{ data: E.data, mode: r.BYTE, length: E.length }
|
|
8485
8480
|
]);
|
|
8486
8481
|
break;
|
|
8487
8482
|
case r.ALPHANUMERIC:
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
{ data:
|
|
8483
|
+
v.push([
|
|
8484
|
+
E,
|
|
8485
|
+
{ data: E.data, mode: r.BYTE, length: E.length }
|
|
8491
8486
|
]);
|
|
8492
8487
|
break;
|
|
8493
8488
|
case r.KANJI:
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
{ data:
|
|
8489
|
+
v.push([
|
|
8490
|
+
E,
|
|
8491
|
+
{ data: E.data, mode: r.BYTE, length: u(E.data) }
|
|
8497
8492
|
]);
|
|
8498
8493
|
break;
|
|
8499
8494
|
case r.BYTE:
|
|
8500
|
-
|
|
8501
|
-
{ data:
|
|
8495
|
+
v.push([
|
|
8496
|
+
{ data: E.data, mode: r.BYTE, length: u(E.data) }
|
|
8502
8497
|
]);
|
|
8503
8498
|
}
|
|
8504
8499
|
}
|
|
8505
|
-
return
|
|
8500
|
+
return v;
|
|
8506
8501
|
}
|
|
8507
|
-
function h(b,
|
|
8508
|
-
const N = {},
|
|
8502
|
+
function h(b, v) {
|
|
8503
|
+
const N = {}, E = { start: {} };
|
|
8509
8504
|
let P = ["start"];
|
|
8510
|
-
for (let
|
|
8511
|
-
const
|
|
8512
|
-
for (let C = 0; C <
|
|
8513
|
-
const B =
|
|
8514
|
-
L.push(T), N[T] = { node: B, lastCount: 0 },
|
|
8505
|
+
for (let A = 0; A < b.length; A++) {
|
|
8506
|
+
const S = b[A], L = [];
|
|
8507
|
+
for (let C = 0; C < S.length; C++) {
|
|
8508
|
+
const B = S[C], T = "" + A + C;
|
|
8509
|
+
L.push(T), N[T] = { node: B, lastCount: 0 }, E[T] = {};
|
|
8515
8510
|
for (let M = 0; M < P.length; M++) {
|
|
8516
8511
|
const R = P[M];
|
|
8517
|
-
N[R] && N[R].node.mode === B.mode ? (
|
|
8512
|
+
N[R] && N[R].node.mode === B.mode ? (E[R][T] = g(N[R].lastCount + B.length, B.mode) - g(N[R].lastCount, B.mode), N[R].lastCount += B.length) : (N[R] && (N[R].lastCount = B.length), E[R][T] = g(B.length, B.mode) + 4 + r.getCharCountIndicator(B.mode, v));
|
|
8518
8513
|
}
|
|
8519
8514
|
}
|
|
8520
8515
|
P = L;
|
|
8521
8516
|
}
|
|
8522
|
-
for (let
|
|
8523
|
-
|
|
8524
|
-
return { map:
|
|
8517
|
+
for (let A = 0; A < P.length; A++)
|
|
8518
|
+
E[P[A]].end = 0;
|
|
8519
|
+
return { map: E, table: N };
|
|
8525
8520
|
}
|
|
8526
|
-
function y(b,
|
|
8521
|
+
function y(b, v) {
|
|
8527
8522
|
let N;
|
|
8528
|
-
const
|
|
8529
|
-
if (N = r.from(
|
|
8523
|
+
const E = r.getBestModeForData(b);
|
|
8524
|
+
if (N = r.from(v, E), N !== r.BYTE && N.bit < E.bit)
|
|
8530
8525
|
throw new Error('"' + b + '" cannot be encoded with mode ' + r.toString(N) + `.
|
|
8531
|
-
Suggested mode is: ` + r.toString(
|
|
8526
|
+
Suggested mode is: ` + r.toString(E));
|
|
8532
8527
|
switch (N === r.KANJI && !c.isKanjiModeEnabled() && (N = r.BYTE), N) {
|
|
8533
8528
|
case r.NUMERIC:
|
|
8534
8529
|
return new o(b);
|
|
@@ -8540,18 +8535,18 @@ function Ka() {
|
|
|
8540
8535
|
return new s(b);
|
|
8541
8536
|
}
|
|
8542
8537
|
}
|
|
8543
|
-
t.fromArray = function(
|
|
8544
|
-
return
|
|
8545
|
-
return typeof
|
|
8538
|
+
t.fromArray = function(v) {
|
|
8539
|
+
return v.reduce(function(N, E) {
|
|
8540
|
+
return typeof E == "string" ? N.push(y(E, null)) : E.data && N.push(y(E.data, E.mode)), N;
|
|
8546
8541
|
}, []);
|
|
8547
|
-
}, t.fromString = function(
|
|
8548
|
-
const
|
|
8549
|
-
for (let C = 1; C <
|
|
8550
|
-
L.push(
|
|
8542
|
+
}, t.fromString = function(v, N) {
|
|
8543
|
+
const E = f(v, c.isKanjiModeEnabled()), P = p(E), A = h(P, N), S = d.find_path(A.map, "start", "end"), L = [];
|
|
8544
|
+
for (let C = 1; C < S.length - 1; C++)
|
|
8545
|
+
L.push(A.table[S[C]].node);
|
|
8551
8546
|
return t.fromArray(w(L));
|
|
8552
|
-
}, t.rawSplit = function(
|
|
8547
|
+
}, t.rawSplit = function(v) {
|
|
8553
8548
|
return t.fromArray(
|
|
8554
|
-
f(
|
|
8549
|
+
f(v, c.isKanjiModeEnabled())
|
|
8555
8550
|
);
|
|
8556
8551
|
};
|
|
8557
8552
|
})(St)), St;
|
|
@@ -8561,54 +8556,54 @@ function Ya() {
|
|
|
8561
8556
|
if (Ir) return pt;
|
|
8562
8557
|
Ir = 1;
|
|
8563
8558
|
const t = ke(), r = Yt(), o = Ba(), a = Ra(), s = Ia(), n = Da(), l = Ua(), c = bs(), d = Wa(), u = Oa(), m = qa(), f = Ne(), g = Ka();
|
|
8564
|
-
function w(
|
|
8565
|
-
const L =
|
|
8559
|
+
function w(A, S) {
|
|
8560
|
+
const L = A.size, C = n.getPositions(S);
|
|
8566
8561
|
for (let B = 0; B < C.length; B++) {
|
|
8567
8562
|
const T = C[B][0], M = C[B][1];
|
|
8568
8563
|
for (let R = -1; R <= 7; R++)
|
|
8569
8564
|
if (!(T + R <= -1 || L <= T + R))
|
|
8570
8565
|
for (let I = -1; I <= 7; I++)
|
|
8571
|
-
M + I <= -1 || L <= M + I || (R >= 0 && R <= 6 && (I === 0 || I === 6) || I >= 0 && I <= 6 && (R === 0 || R === 6) || R >= 2 && R <= 4 && I >= 2 && I <= 4 ?
|
|
8566
|
+
M + I <= -1 || L <= M + I || (R >= 0 && R <= 6 && (I === 0 || I === 6) || I >= 0 && I <= 6 && (R === 0 || R === 6) || R >= 2 && R <= 4 && I >= 2 && I <= 4 ? A.set(T + R, M + I, !0, !0) : A.set(T + R, M + I, !1, !0));
|
|
8572
8567
|
}
|
|
8573
8568
|
}
|
|
8574
|
-
function p(
|
|
8575
|
-
const
|
|
8576
|
-
for (let L = 8; L <
|
|
8569
|
+
function p(A) {
|
|
8570
|
+
const S = A.size;
|
|
8571
|
+
for (let L = 8; L < S - 8; L++) {
|
|
8577
8572
|
const C = L % 2 === 0;
|
|
8578
|
-
|
|
8573
|
+
A.set(L, 6, C, !0), A.set(6, L, C, !0);
|
|
8579
8574
|
}
|
|
8580
8575
|
}
|
|
8581
|
-
function h(
|
|
8582
|
-
const L = s.getPositions(
|
|
8576
|
+
function h(A, S) {
|
|
8577
|
+
const L = s.getPositions(S);
|
|
8583
8578
|
for (let C = 0; C < L.length; C++) {
|
|
8584
8579
|
const B = L[C][0], T = L[C][1];
|
|
8585
8580
|
for (let M = -2; M <= 2; M++)
|
|
8586
8581
|
for (let R = -2; R <= 2; R++)
|
|
8587
|
-
M === -2 || M === 2 || R === -2 || R === 2 || M === 0 && R === 0 ?
|
|
8582
|
+
M === -2 || M === 2 || R === -2 || R === 2 || M === 0 && R === 0 ? A.set(B + M, T + R, !0, !0) : A.set(B + M, T + R, !1, !0);
|
|
8588
8583
|
}
|
|
8589
8584
|
}
|
|
8590
|
-
function y(
|
|
8591
|
-
const L =
|
|
8585
|
+
function y(A, S) {
|
|
8586
|
+
const L = A.size, C = u.getEncodedBits(S);
|
|
8592
8587
|
let B, T, M;
|
|
8593
8588
|
for (let R = 0; R < 18; R++)
|
|
8594
|
-
B = Math.floor(R / 3), T = R % 3 + L - 8 - 3, M = (C >> R & 1) === 1,
|
|
8589
|
+
B = Math.floor(R / 3), T = R % 3 + L - 8 - 3, M = (C >> R & 1) === 1, A.set(B, T, M, !0), A.set(T, B, M, !0);
|
|
8595
8590
|
}
|
|
8596
|
-
function b(
|
|
8597
|
-
const C =
|
|
8591
|
+
function b(A, S, L) {
|
|
8592
|
+
const C = A.size, B = m.getEncodedBits(S, L);
|
|
8598
8593
|
let T, M;
|
|
8599
8594
|
for (T = 0; T < 15; T++)
|
|
8600
|
-
M = (B >> T & 1) === 1, T < 6 ?
|
|
8601
|
-
|
|
8595
|
+
M = (B >> T & 1) === 1, T < 6 ? A.set(T, 8, M, !0) : T < 8 ? A.set(T + 1, 8, M, !0) : A.set(C - 15 + T, 8, M, !0), T < 8 ? A.set(8, C - T - 1, M, !0) : T < 9 ? A.set(8, 15 - T - 1 + 1, M, !0) : A.set(8, 15 - T - 1, M, !0);
|
|
8596
|
+
A.set(C - 8, 8, 1, !0);
|
|
8602
8597
|
}
|
|
8603
|
-
function A
|
|
8604
|
-
const L =
|
|
8598
|
+
function v(A, S) {
|
|
8599
|
+
const L = A.size;
|
|
8605
8600
|
let C = -1, B = L - 1, T = 7, M = 0;
|
|
8606
8601
|
for (let R = L - 1; R > 0; R -= 2)
|
|
8607
8602
|
for (R === 6 && R--; ; ) {
|
|
8608
8603
|
for (let I = 0; I < 2; I++)
|
|
8609
|
-
if (!
|
|
8604
|
+
if (!A.isReserved(B, R - I)) {
|
|
8610
8605
|
let U = !1;
|
|
8611
|
-
M <
|
|
8606
|
+
M < S.length && (U = (S[M] >>> T & 1) === 1), A.set(B, R - I, U), T--, T === -1 && (M++, T = 7);
|
|
8612
8607
|
}
|
|
8613
8608
|
if (B += C, B < 0 || L <= B) {
|
|
8614
8609
|
B -= C, C = -C;
|
|
@@ -8616,81 +8611,81 @@ function Ya() {
|
|
|
8616
8611
|
}
|
|
8617
8612
|
}
|
|
8618
8613
|
}
|
|
8619
|
-
function N(
|
|
8614
|
+
function N(A, S, L) {
|
|
8620
8615
|
const C = new o();
|
|
8621
8616
|
L.forEach(function(I) {
|
|
8622
|
-
C.put(I.mode.bit, 4), C.put(I.getLength(), f.getCharCountIndicator(I.mode,
|
|
8617
|
+
C.put(I.mode.bit, 4), C.put(I.getLength(), f.getCharCountIndicator(I.mode, A)), I.write(C);
|
|
8623
8618
|
});
|
|
8624
|
-
const B = t.getSymbolTotalCodewords(
|
|
8619
|
+
const B = t.getSymbolTotalCodewords(A), T = c.getTotalCodewordsCount(A, S), M = (B - T) * 8;
|
|
8625
8620
|
for (C.getLengthInBits() + 4 <= M && C.put(0, 4); C.getLengthInBits() % 8 !== 0; )
|
|
8626
8621
|
C.putBit(0);
|
|
8627
8622
|
const R = (M - C.getLengthInBits()) / 8;
|
|
8628
8623
|
for (let I = 0; I < R; I++)
|
|
8629
8624
|
C.put(I % 2 ? 17 : 236, 8);
|
|
8630
|
-
return
|
|
8625
|
+
return E(C, A, S);
|
|
8631
8626
|
}
|
|
8632
|
-
function
|
|
8633
|
-
const C = t.getSymbolTotalCodewords(
|
|
8627
|
+
function E(A, S, L) {
|
|
8628
|
+
const C = t.getSymbolTotalCodewords(S), B = c.getTotalCodewordsCount(S, L), T = C - B, M = c.getBlocksCount(S, L), R = C % M, I = M - R, U = Math.floor(C / M), ee = Math.floor(T / M), pe = ee + 1, re = U - ee, Q = new d(re);
|
|
8634
8629
|
let D = 0;
|
|
8635
8630
|
const F = new Array(M), K = new Array(M);
|
|
8636
8631
|
let se = 0;
|
|
8637
|
-
const ne = new Uint8Array(
|
|
8632
|
+
const ne = new Uint8Array(A.buffer);
|
|
8638
8633
|
for (let G = 0; G < M; G++) {
|
|
8639
8634
|
const de = G < I ? ee : pe;
|
|
8640
8635
|
F[G] = ne.slice(D, D + de), K[G] = Q.encode(F[G]), D += de, se = Math.max(se, de);
|
|
8641
8636
|
}
|
|
8642
8637
|
const ge = new Uint8Array(C);
|
|
8643
|
-
let me = 0, V,
|
|
8638
|
+
let me = 0, V, z;
|
|
8644
8639
|
for (V = 0; V < se; V++)
|
|
8645
|
-
for (
|
|
8646
|
-
V < F[
|
|
8640
|
+
for (z = 0; z < M; z++)
|
|
8641
|
+
V < F[z].length && (ge[me++] = F[z][V]);
|
|
8647
8642
|
for (V = 0; V < re; V++)
|
|
8648
|
-
for (
|
|
8649
|
-
ge[me++] = K[
|
|
8643
|
+
for (z = 0; z < M; z++)
|
|
8644
|
+
ge[me++] = K[z][V];
|
|
8650
8645
|
return ge;
|
|
8651
8646
|
}
|
|
8652
|
-
function P(
|
|
8647
|
+
function P(A, S, L, C) {
|
|
8653
8648
|
let B;
|
|
8654
|
-
if (Array.isArray(
|
|
8655
|
-
B = g.fromArray(
|
|
8656
|
-
else if (typeof
|
|
8657
|
-
let U =
|
|
8649
|
+
if (Array.isArray(A))
|
|
8650
|
+
B = g.fromArray(A);
|
|
8651
|
+
else if (typeof A == "string") {
|
|
8652
|
+
let U = S;
|
|
8658
8653
|
if (!U) {
|
|
8659
|
-
const ee = g.rawSplit(
|
|
8654
|
+
const ee = g.rawSplit(A);
|
|
8660
8655
|
U = u.getBestVersionForData(ee, L);
|
|
8661
8656
|
}
|
|
8662
|
-
B = g.fromString(
|
|
8657
|
+
B = g.fromString(A, U || 40);
|
|
8663
8658
|
} else
|
|
8664
8659
|
throw new Error("Invalid data");
|
|
8665
8660
|
const T = u.getBestVersionForData(B, L);
|
|
8666
8661
|
if (!T)
|
|
8667
8662
|
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
8668
|
-
if (!
|
|
8669
|
-
|
|
8670
|
-
else if (
|
|
8663
|
+
if (!S)
|
|
8664
|
+
S = T;
|
|
8665
|
+
else if (S < T)
|
|
8671
8666
|
throw new Error(
|
|
8672
8667
|
`
|
|
8673
8668
|
The chosen QR Code version cannot contain this amount of data.
|
|
8674
8669
|
Minimum version required to store current data is: ` + T + `.
|
|
8675
8670
|
`
|
|
8676
8671
|
);
|
|
8677
|
-
const M = N(
|
|
8678
|
-
return w(I,
|
|
8672
|
+
const M = N(S, L, B), R = t.getSymbolSize(S), I = new a(R);
|
|
8673
|
+
return w(I, S), p(I), h(I, S), b(I, L, 0), S >= 7 && y(I, S), v(I, M), isNaN(C) && (C = l.getBestMask(
|
|
8679
8674
|
I,
|
|
8680
8675
|
b.bind(null, I, L)
|
|
8681
8676
|
)), l.applyMask(C, I), b(I, L, C), {
|
|
8682
8677
|
modules: I,
|
|
8683
|
-
version:
|
|
8678
|
+
version: S,
|
|
8684
8679
|
errorCorrectionLevel: L,
|
|
8685
8680
|
maskPattern: C,
|
|
8686
8681
|
segments: B
|
|
8687
8682
|
};
|
|
8688
8683
|
}
|
|
8689
|
-
return pt.create = function(
|
|
8690
|
-
if (typeof
|
|
8684
|
+
return pt.create = function(S, L) {
|
|
8685
|
+
if (typeof S > "u" || S === "")
|
|
8691
8686
|
throw new Error("No input text");
|
|
8692
8687
|
let C = r.M, B, T;
|
|
8693
|
-
return typeof L < "u" && (C = r.from(L.errorCorrectionLevel, r.M), B = u.from(L.version), T = l.from(L.maskPattern), L.toSJISFunc && t.setToSJISFunction(L.toSJISFunc)), P(
|
|
8688
|
+
return typeof L < "u" && (C = r.from(L.errorCorrectionLevel, r.M), B = u.from(L.version), T = l.from(L.maskPattern), L.toSJISFunc && t.setToSJISFunction(L.toSJISFunc)), P(S, B, C, T);
|
|
8694
8689
|
}, pt;
|
|
8695
8690
|
}
|
|
8696
8691
|
var Bt = {}, Rt = {}, Dr;
|
|
@@ -8884,31 +8879,31 @@ function Ns() {
|
|
|
8884
8879
|
getAccessToken: r?.getAccessToken
|
|
8885
8880
|
}),
|
|
8886
8881
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, r]
|
|
8887
|
-
), w =
|
|
8882
|
+
), w = x(async () => {
|
|
8888
8883
|
u(!0), f(null);
|
|
8889
8884
|
try {
|
|
8890
|
-
const
|
|
8891
|
-
return a(
|
|
8892
|
-
} catch (
|
|
8893
|
-
const P = W(
|
|
8885
|
+
const E = await g.get("/mfa/status");
|
|
8886
|
+
return a(E), E;
|
|
8887
|
+
} catch (E) {
|
|
8888
|
+
const P = W(E, "Unable to load two-factor authentication status. Please try again.");
|
|
8894
8889
|
throw f(P), P;
|
|
8895
8890
|
} finally {
|
|
8896
8891
|
u(!1);
|
|
8897
8892
|
}
|
|
8898
|
-
}, [g]), p =
|
|
8893
|
+
}, [g]), p = x(async () => {
|
|
8899
8894
|
u(!0), f(null), n("loading");
|
|
8900
8895
|
try {
|
|
8901
|
-
const
|
|
8902
|
-
return c(
|
|
8903
|
-
} catch (
|
|
8904
|
-
const P = W(
|
|
8896
|
+
const E = await g.post("/mfa/setup", {});
|
|
8897
|
+
return c(E), n("setup"), E;
|
|
8898
|
+
} catch (E) {
|
|
8899
|
+
const P = W(E, "Unable to start two-factor setup. Please try again.");
|
|
8905
8900
|
throw f(P), n("error"), P;
|
|
8906
8901
|
} finally {
|
|
8907
8902
|
u(!1);
|
|
8908
8903
|
}
|
|
8909
|
-
}, [g]), h =
|
|
8910
|
-
async (
|
|
8911
|
-
if (!/^\d{6}$/.test(
|
|
8904
|
+
}, [g]), h = x(
|
|
8905
|
+
async (E) => {
|
|
8906
|
+
if (!/^\d{6}$/.test(E)) {
|
|
8912
8907
|
const P = {
|
|
8913
8908
|
code: "VALIDATION_ERROR",
|
|
8914
8909
|
message: "Please enter a 6-digit code"
|
|
@@ -8917,7 +8912,7 @@ function Ns() {
|
|
|
8917
8912
|
}
|
|
8918
8913
|
u(!0), f(null), n("verifying");
|
|
8919
8914
|
try {
|
|
8920
|
-
await g.post("/mfa/enable", { code:
|
|
8915
|
+
await g.post("/mfa/enable", { code: E }), n("success");
|
|
8921
8916
|
try {
|
|
8922
8917
|
const P = await g.get("/mfa/status");
|
|
8923
8918
|
a(P);
|
|
@@ -8925,16 +8920,16 @@ function Ns() {
|
|
|
8925
8920
|
a({ enabled: !0, recoveryCodesRemaining: 0 });
|
|
8926
8921
|
}
|
|
8927
8922
|
} catch (P) {
|
|
8928
|
-
const
|
|
8929
|
-
throw f(
|
|
8923
|
+
const A = W(P, "Incorrect verification code. Please check and try again.");
|
|
8924
|
+
throw f(A), n("error"), A;
|
|
8930
8925
|
} finally {
|
|
8931
8926
|
u(!1);
|
|
8932
8927
|
}
|
|
8933
8928
|
},
|
|
8934
8929
|
[g]
|
|
8935
|
-
), y =
|
|
8936
|
-
async (
|
|
8937
|
-
if (!
|
|
8930
|
+
), y = x(
|
|
8931
|
+
async (E) => {
|
|
8932
|
+
if (!E) {
|
|
8938
8933
|
const P = {
|
|
8939
8934
|
code: "VALIDATION_ERROR",
|
|
8940
8935
|
message: "Please enter your password"
|
|
@@ -8943,18 +8938,18 @@ function Ns() {
|
|
|
8943
8938
|
}
|
|
8944
8939
|
u(!0), f(null);
|
|
8945
8940
|
try {
|
|
8946
|
-
await g.post("/mfa/disable", { password:
|
|
8941
|
+
await g.post("/mfa/disable", { password: E }), a({ enabled: !1, recoveryCodesRemaining: 0 }), c(null), n("idle");
|
|
8947
8942
|
} catch (P) {
|
|
8948
|
-
const
|
|
8949
|
-
throw f(
|
|
8943
|
+
const A = W(P, "Unable to disable two-factor authentication. Please try again.");
|
|
8944
|
+
throw f(A), A;
|
|
8950
8945
|
} finally {
|
|
8951
8946
|
u(!1);
|
|
8952
8947
|
}
|
|
8953
8948
|
},
|
|
8954
8949
|
[g]
|
|
8955
|
-
), b =
|
|
8956
|
-
async (
|
|
8957
|
-
if (!/^\d{6}$/.test(
|
|
8950
|
+
), b = x(
|
|
8951
|
+
async (E) => {
|
|
8952
|
+
if (!/^\d{6}$/.test(E)) {
|
|
8958
8953
|
const P = {
|
|
8959
8954
|
code: "VALIDATION_ERROR",
|
|
8960
8955
|
message: "Please enter a 6-digit code"
|
|
@@ -8965,17 +8960,17 @@ function Ns() {
|
|
|
8965
8960
|
try {
|
|
8966
8961
|
return await g.post(
|
|
8967
8962
|
"/mfa/recovery-codes/regenerate",
|
|
8968
|
-
{ code:
|
|
8963
|
+
{ code: E }
|
|
8969
8964
|
);
|
|
8970
8965
|
} catch (P) {
|
|
8971
|
-
const
|
|
8972
|
-
throw f(
|
|
8966
|
+
const A = W(P, "Unable to regenerate recovery codes. Please try again.");
|
|
8967
|
+
throw f(A), A;
|
|
8973
8968
|
} finally {
|
|
8974
8969
|
u(!1);
|
|
8975
8970
|
}
|
|
8976
8971
|
},
|
|
8977
8972
|
[g]
|
|
8978
|
-
),
|
|
8973
|
+
), v = x(() => f(null), []), N = x(() => {
|
|
8979
8974
|
f(null), c(null), n("idle"), u(!1);
|
|
8980
8975
|
}, []);
|
|
8981
8976
|
return {
|
|
@@ -8989,19 +8984,19 @@ function Ns() {
|
|
|
8989
8984
|
enableTotp: h,
|
|
8990
8985
|
disableTotp: y,
|
|
8991
8986
|
regenerateBackupCodes: b,
|
|
8992
|
-
clearError:
|
|
8987
|
+
clearError: v,
|
|
8993
8988
|
reset: N
|
|
8994
8989
|
};
|
|
8995
8990
|
}
|
|
8996
8991
|
function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
8997
|
-
const { setupState: a, setupData: s, isLoading: n, error: l, beginSetup: c, enableTotp: d, clearError: u, reset: m } = Ns(), [f, g] = k("qr"), [w, p] = k(""), [h, y] = k(!1), [b,
|
|
8992
|
+
const { setupState: a, setupData: s, isLoading: n, error: l, beginSetup: c, enableTotp: d, clearError: u, reset: m } = Ns(), [f, g] = k("qr"), [w, p] = k(""), [h, y] = k(!1), [b, v] = k(!1), N = J(null);
|
|
8998
8993
|
_(() => {
|
|
8999
8994
|
a === "idle" && c().catch(() => {
|
|
9000
8995
|
});
|
|
9001
8996
|
}, [a, c]), _(() => {
|
|
9002
8997
|
a === "success" && t?.();
|
|
9003
8998
|
}, [a, t]);
|
|
9004
|
-
const
|
|
8999
|
+
const E = async () => {
|
|
9005
9000
|
s?.secret && (await navigator.clipboard.writeText(s.secret), y(!0), N.current !== null && window.clearTimeout(N.current), N.current = window.setTimeout(() => y(!1), 2e3));
|
|
9006
9001
|
}, P = async () => {
|
|
9007
9002
|
if (s?.recoveryCodes) {
|
|
@@ -9009,18 +9004,18 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9009
9004
|
`);
|
|
9010
9005
|
await navigator.clipboard.writeText(L);
|
|
9011
9006
|
}
|
|
9012
|
-
},
|
|
9007
|
+
}, A = async () => {
|
|
9013
9008
|
try {
|
|
9014
9009
|
await d(w);
|
|
9015
9010
|
} catch {
|
|
9016
9011
|
p("");
|
|
9017
9012
|
}
|
|
9018
|
-
},
|
|
9013
|
+
}, S = () => {
|
|
9019
9014
|
m(), r?.();
|
|
9020
9015
|
};
|
|
9021
9016
|
return _(() => () => {
|
|
9022
9017
|
N.current !== null && (window.clearTimeout(N.current), N.current = null);
|
|
9023
|
-
}, []), a === "loading" || a === "idle" && n ? /* @__PURE__ */ e("div", { className: `cedros-totp-setup ${o}`, children: /* @__PURE__ */ e("div", { className: "cedros-totp-loading", children: /* @__PURE__ */ e(
|
|
9018
|
+
}, []), a === "loading" || a === "idle" && n ? /* @__PURE__ */ e("div", { className: `cedros-totp-setup ${o}`, children: /* @__PURE__ */ e("div", { className: "cedros-totp-loading", children: /* @__PURE__ */ e(j, { size: "lg", label: "Setting up two-factor authentication" }) }) }) : a === "error" && !s ? /* @__PURE__ */ i("div", { className: `cedros-totp-setup ${o}`, children: [
|
|
9024
9019
|
/* @__PURE__ */ e(X, { error: l, onDismiss: u }),
|
|
9025
9020
|
/* @__PURE__ */ i("div", { className: "cedros-totp-actions", children: [
|
|
9026
9021
|
/* @__PURE__ */ e(
|
|
@@ -9028,7 +9023,7 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9028
9023
|
{
|
|
9029
9024
|
type: "button",
|
|
9030
9025
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
9031
|
-
onClick:
|
|
9026
|
+
onClick: S,
|
|
9032
9027
|
children: "Cancel"
|
|
9033
9028
|
}
|
|
9034
9029
|
),
|
|
@@ -9083,7 +9078,7 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9083
9078
|
{
|
|
9084
9079
|
type: "button",
|
|
9085
9080
|
className: "cedros-button cedros-button-ghost cedros-button-sm",
|
|
9086
|
-
onClick:
|
|
9081
|
+
onClick: E,
|
|
9087
9082
|
"aria-label": "Copy secret",
|
|
9088
9083
|
children: h ? "Copied!" : "Copy"
|
|
9089
9084
|
}
|
|
@@ -9096,7 +9091,7 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9096
9091
|
{
|
|
9097
9092
|
type: "button",
|
|
9098
9093
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
9099
|
-
onClick:
|
|
9094
|
+
onClick: S,
|
|
9100
9095
|
children: "Cancel"
|
|
9101
9096
|
}
|
|
9102
9097
|
),
|
|
@@ -9131,7 +9126,7 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9131
9126
|
type: "checkbox",
|
|
9132
9127
|
className: "cedros-checkbox",
|
|
9133
9128
|
checked: b,
|
|
9134
|
-
onChange: (L) =>
|
|
9129
|
+
onChange: (L) => v(L.target.checked)
|
|
9135
9130
|
}
|
|
9136
9131
|
),
|
|
9137
9132
|
/* @__PURE__ */ e("span", { className: "cedros-checkbox-text", children: "I have saved these recovery codes" })
|
|
@@ -9166,7 +9161,7 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9166
9161
|
{
|
|
9167
9162
|
value: w,
|
|
9168
9163
|
onChange: p,
|
|
9169
|
-
onComplete:
|
|
9164
|
+
onComplete: A,
|
|
9170
9165
|
disabled: n,
|
|
9171
9166
|
error: l?.message,
|
|
9172
9167
|
autoFocus: !0
|
|
@@ -9188,10 +9183,10 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9188
9183
|
{
|
|
9189
9184
|
type: "button",
|
|
9190
9185
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
9191
|
-
onClick:
|
|
9186
|
+
onClick: A,
|
|
9192
9187
|
disabled: n || w.length !== 6,
|
|
9193
9188
|
children: n ? /* @__PURE__ */ i($, { children: [
|
|
9194
|
-
/* @__PURE__ */ e(
|
|
9189
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
9195
9190
|
/* @__PURE__ */ e("span", { children: "Verifying..." })
|
|
9196
9191
|
] }) : "Enable 2FA"
|
|
9197
9192
|
}
|
|
@@ -9201,37 +9196,37 @@ function Cs({ onSuccess: t, onCancel: r, className: o = "" }) {
|
|
|
9201
9196
|
] }) : null;
|
|
9202
9197
|
}
|
|
9203
9198
|
function ti({ onStatusChange: t, className: r = "" }) {
|
|
9204
|
-
const { status: o, isLoading: a, error: s, getStatus: n, disableTotp: l, regenerateBackupCodes: c, clearError: d } = Ns(), [u, m] = k("status"), [f, g] = k(""), [w, p] = k(""), [h, y] = k(null), [b,
|
|
9199
|
+
const { status: o, isLoading: a, error: s, getStatus: n, disableTotp: l, regenerateBackupCodes: c, clearError: d } = Ns(), [u, m] = k("status"), [f, g] = k(""), [w, p] = k(""), [h, y] = k(null), [b, v] = k(!1), [N, E] = k(null);
|
|
9205
9200
|
_(() => {
|
|
9206
9201
|
n().catch(() => {
|
|
9207
9202
|
});
|
|
9208
9203
|
}, [n]);
|
|
9209
|
-
const P =
|
|
9204
|
+
const P = x(() => {
|
|
9210
9205
|
m("status"), t?.(!0);
|
|
9211
|
-
}, [t]),
|
|
9212
|
-
|
|
9206
|
+
}, [t]), A = async () => {
|
|
9207
|
+
v(!0), E(null);
|
|
9213
9208
|
try {
|
|
9214
9209
|
await l(f), m("status"), g(""), t?.(!1);
|
|
9215
9210
|
} catch (C) {
|
|
9216
|
-
|
|
9211
|
+
E(C instanceof Error ? C.message : "Failed to disable 2FA"), g("");
|
|
9217
9212
|
} finally {
|
|
9218
|
-
|
|
9213
|
+
v(!1);
|
|
9219
9214
|
}
|
|
9220
|
-
},
|
|
9221
|
-
|
|
9215
|
+
}, S = async () => {
|
|
9216
|
+
v(!0), E(null);
|
|
9222
9217
|
try {
|
|
9223
9218
|
const C = await c(w);
|
|
9224
9219
|
y(C.recoveryCodes), p("");
|
|
9225
9220
|
} catch (C) {
|
|
9226
|
-
|
|
9221
|
+
E(C instanceof Error ? C.message : "Failed to regenerate codes"), p("");
|
|
9227
9222
|
} finally {
|
|
9228
|
-
|
|
9223
|
+
v(!1);
|
|
9229
9224
|
}
|
|
9230
9225
|
}, L = async () => {
|
|
9231
9226
|
h && await navigator.clipboard.writeText(h.join(`
|
|
9232
9227
|
`));
|
|
9233
9228
|
};
|
|
9234
|
-
return a && !o ? /* @__PURE__ */ e("div", { className: `cedros-totp-settings ${r}`, children: /* @__PURE__ */ e("div", { className: "cedros-totp-loading", children: /* @__PURE__ */ e(
|
|
9229
|
+
return a && !o ? /* @__PURE__ */ e("div", { className: `cedros-totp-settings ${r}`, children: /* @__PURE__ */ e("div", { className: "cedros-totp-loading", children: /* @__PURE__ */ e(j, { size: "md", label: "Loading security settings" }) }) }) : s && !o ? /* @__PURE__ */ i("div", { className: `cedros-totp-settings ${r}`, children: [
|
|
9235
9230
|
/* @__PURE__ */ e(X, { error: s, onDismiss: d }),
|
|
9236
9231
|
/* @__PURE__ */ e(
|
|
9237
9232
|
"button",
|
|
@@ -9249,7 +9244,7 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9249
9244
|
X,
|
|
9250
9245
|
{
|
|
9251
9246
|
error: { code: "UNKNOWN_ERROR", message: N },
|
|
9252
|
-
onDismiss: () =>
|
|
9247
|
+
onDismiss: () => E(null)
|
|
9253
9248
|
}
|
|
9254
9249
|
) }),
|
|
9255
9250
|
/* @__PURE__ */ e("div", { className: "cedros-totp-verify-input", children: /* @__PURE__ */ e(
|
|
@@ -9270,7 +9265,7 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9270
9265
|
type: "button",
|
|
9271
9266
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
9272
9267
|
onClick: () => {
|
|
9273
|
-
m("status"), g(""),
|
|
9268
|
+
m("status"), g(""), E(null);
|
|
9274
9269
|
},
|
|
9275
9270
|
disabled: b,
|
|
9276
9271
|
children: "Cancel"
|
|
@@ -9281,10 +9276,10 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9281
9276
|
{
|
|
9282
9277
|
type: "button",
|
|
9283
9278
|
className: "cedros-button cedros-button-destructive cedros-button-md",
|
|
9284
|
-
onClick:
|
|
9279
|
+
onClick: A,
|
|
9285
9280
|
disabled: b || f.length === 0,
|
|
9286
9281
|
children: b ? /* @__PURE__ */ i($, { children: [
|
|
9287
|
-
/* @__PURE__ */ e(
|
|
9282
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
9288
9283
|
/* @__PURE__ */ e("span", { children: "Disabling..." })
|
|
9289
9284
|
] }) : "Disable 2FA"
|
|
9290
9285
|
}
|
|
@@ -9321,7 +9316,7 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9321
9316
|
X,
|
|
9322
9317
|
{
|
|
9323
9318
|
error: { code: "UNKNOWN_ERROR", message: N },
|
|
9324
|
-
onDismiss: () =>
|
|
9319
|
+
onDismiss: () => E(null)
|
|
9325
9320
|
}
|
|
9326
9321
|
) }),
|
|
9327
9322
|
/* @__PURE__ */ e("div", { className: "cedros-totp-verify-input", children: /* @__PURE__ */ e(
|
|
@@ -9329,7 +9324,7 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9329
9324
|
{
|
|
9330
9325
|
value: w,
|
|
9331
9326
|
onChange: p,
|
|
9332
|
-
onComplete:
|
|
9327
|
+
onComplete: S,
|
|
9333
9328
|
disabled: b,
|
|
9334
9329
|
autoFocus: !0
|
|
9335
9330
|
}
|
|
@@ -9341,7 +9336,7 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9341
9336
|
type: "button",
|
|
9342
9337
|
className: "cedros-button cedros-button-outline cedros-button-md",
|
|
9343
9338
|
onClick: () => {
|
|
9344
|
-
m("status"), p(""),
|
|
9339
|
+
m("status"), p(""), E(null);
|
|
9345
9340
|
},
|
|
9346
9341
|
disabled: b,
|
|
9347
9342
|
children: "Cancel"
|
|
@@ -9352,10 +9347,10 @@ function ti({ onStatusChange: t, className: r = "" }) {
|
|
|
9352
9347
|
{
|
|
9353
9348
|
type: "button",
|
|
9354
9349
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
9355
|
-
onClick:
|
|
9350
|
+
onClick: S,
|
|
9356
9351
|
disabled: b || w.length !== 6,
|
|
9357
9352
|
children: b ? /* @__PURE__ */ i($, { children: [
|
|
9358
|
-
/* @__PURE__ */ e(
|
|
9353
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
9359
9354
|
/* @__PURE__ */ e("span", { children: "Regenerating..." })
|
|
9360
9355
|
] }) : "Regenerate codes"
|
|
9361
9356
|
}
|
|
@@ -9450,9 +9445,9 @@ function st() {
|
|
|
9450
9445
|
o?.getAccessToken
|
|
9451
9446
|
),
|
|
9452
9447
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, o]
|
|
9453
|
-
), d =
|
|
9448
|
+
), d = x(() => {
|
|
9454
9449
|
l(null);
|
|
9455
|
-
}, []), u =
|
|
9450
|
+
}, []), u = x(
|
|
9456
9451
|
async (f) => {
|
|
9457
9452
|
if (r !== "authenticated")
|
|
9458
9453
|
throw new Error("Must be authenticated to update profile");
|
|
@@ -9467,7 +9462,7 @@ function st() {
|
|
|
9467
9462
|
}
|
|
9468
9463
|
},
|
|
9469
9464
|
[r, c]
|
|
9470
|
-
), m =
|
|
9465
|
+
), m = x(
|
|
9471
9466
|
async (f) => {
|
|
9472
9467
|
if (r !== "authenticated")
|
|
9473
9468
|
throw new Error("Must be authenticated to change password");
|
|
@@ -9496,8 +9491,8 @@ function qc({
|
|
|
9496
9491
|
onClose: r,
|
|
9497
9492
|
className: o = ""
|
|
9498
9493
|
}) {
|
|
9499
|
-
const { user: a } = et(), { isLoading: s, error: n, changePassword: l, clearError: c } = st(), [d, u] = k("main"), [m, f] = k(""), [g, w] = k(""), [p, h] = k(""), [y, b] = k(null), [
|
|
9500
|
-
if (
|
|
9494
|
+
const { user: a } = et(), { isLoading: s, error: n, changePassword: l, clearError: c } = st(), [d, u] = k("main"), [m, f] = k(""), [g, w] = k(""), [p, h] = k(""), [y, b] = k(null), [v, N] = k(null), E = rt(g), P = g === p, A = m.length > 0 && g.length > 0 && p.length > 0 && E.isValid && P, S = x(async () => {
|
|
9495
|
+
if (A) {
|
|
9501
9496
|
b(null), N(null);
|
|
9502
9497
|
try {
|
|
9503
9498
|
await l({
|
|
@@ -9510,7 +9505,7 @@ function qc({
|
|
|
9510
9505
|
b(B instanceof Error ? B.message : "Failed to change password");
|
|
9511
9506
|
}
|
|
9512
9507
|
}
|
|
9513
|
-
}, [
|
|
9508
|
+
}, [A, m, g, l, t]), L = x(() => {
|
|
9514
9509
|
u("main"), f(""), w(""), h(""), b(null), c();
|
|
9515
9510
|
}, [c]), C = () => a?.name ? a.name.split(" ").map((B) => B[0]).join("").toUpperCase().slice(0, 2) : a?.email ? a.email[0].toUpperCase() : "?";
|
|
9516
9511
|
return d === "change-password" ? /* @__PURE__ */ e("div", { className: `cedros-profile-settings ${o}`, children: /* @__PURE__ */ i("div", { className: "cedros-profile-panel", children: [
|
|
@@ -9525,9 +9520,9 @@ function qc({
|
|
|
9525
9520
|
}
|
|
9526
9521
|
}
|
|
9527
9522
|
) }),
|
|
9528
|
-
|
|
9523
|
+
v && /* @__PURE__ */ i("div", { className: "cedros-profile-success", children: [
|
|
9529
9524
|
/* @__PURE__ */ e("span", { className: "cedros-profile-success-icon", children: "✓" }),
|
|
9530
|
-
|
|
9525
|
+
v
|
|
9531
9526
|
] }),
|
|
9532
9527
|
/* @__PURE__ */ i("div", { className: "cedros-profile-form", children: [
|
|
9533
9528
|
/* @__PURE__ */ e("div", { className: "cedros-profile-field", children: /* @__PURE__ */ e(
|
|
@@ -9580,10 +9575,10 @@ function qc({
|
|
|
9580
9575
|
{
|
|
9581
9576
|
type: "button",
|
|
9582
9577
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
9583
|
-
onClick:
|
|
9584
|
-
disabled: s || !
|
|
9578
|
+
onClick: S,
|
|
9579
|
+
disabled: s || !A,
|
|
9585
9580
|
children: s ? /* @__PURE__ */ i($, { children: [
|
|
9586
|
-
/* @__PURE__ */ e(
|
|
9581
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
9587
9582
|
/* @__PURE__ */ e("span", { children: "Changing..." })
|
|
9588
9583
|
] }) : "Change password"
|
|
9589
9584
|
}
|
|
@@ -9673,9 +9668,9 @@ function Es() {
|
|
|
9673
9668
|
o?.getAccessToken
|
|
9674
9669
|
),
|
|
9675
9670
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, o]
|
|
9676
|
-
), m =
|
|
9671
|
+
), m = x(() => {
|
|
9677
9672
|
d(null);
|
|
9678
|
-
}, []), f =
|
|
9673
|
+
}, []), f = x(async () => {
|
|
9679
9674
|
if (r !== "authenticated") {
|
|
9680
9675
|
s([]);
|
|
9681
9676
|
return;
|
|
@@ -9693,7 +9688,7 @@ function Es() {
|
|
|
9693
9688
|
_(() => {
|
|
9694
9689
|
r === "authenticated" ? f() : s([]);
|
|
9695
9690
|
}, [r, f]);
|
|
9696
|
-
const g =
|
|
9691
|
+
const g = x(
|
|
9697
9692
|
async (w) => {
|
|
9698
9693
|
l(!0), d(null);
|
|
9699
9694
|
try {
|
|
@@ -9720,16 +9715,16 @@ function oi({
|
|
|
9720
9715
|
onCancel: r,
|
|
9721
9716
|
className: o = ""
|
|
9722
9717
|
}) {
|
|
9723
|
-
const { isLoading: a, error: s, changePassword: n, clearError: l } = st(), [c, d] = k(""), [u, m] = k(""), [f, g] = k(""), [w, p] = k(null), [h, y] = k(null), b = rt(u),
|
|
9718
|
+
const { isLoading: a, error: s, changePassword: n, clearError: l } = st(), [c, d] = k(""), [u, m] = k(""), [f, g] = k(""), [w, p] = k(null), [h, y] = k(null), b = rt(u), v = u === f, N = c.length > 0 && u.length > 0 && f.length > 0 && b.isValid && v, E = x(async () => {
|
|
9724
9719
|
if (N) {
|
|
9725
9720
|
p(null), y(null);
|
|
9726
9721
|
try {
|
|
9727
9722
|
await n({ currentPassword: c, newPassword: u }), d(""), m(""), g(""), y("Password changed successfully. Other sessions have been logged out."), t?.(), setTimeout(() => r(), 2e3);
|
|
9728
|
-
} catch (
|
|
9729
|
-
p(
|
|
9723
|
+
} catch (A) {
|
|
9724
|
+
p(A instanceof Error ? A.message : "Failed to change password");
|
|
9730
9725
|
}
|
|
9731
9726
|
}
|
|
9732
|
-
}, [N, c, u, n, t, r]), P =
|
|
9727
|
+
}, [N, c, u, n, t, r]), P = x(() => {
|
|
9733
9728
|
p(null), l(), r();
|
|
9734
9729
|
}, [l, r]);
|
|
9735
9730
|
return /* @__PURE__ */ e("div", { className: `cedros-profile-settings ${o}`, children: /* @__PURE__ */ i("div", { className: "cedros-profile-panel", children: [
|
|
@@ -9755,7 +9750,7 @@ function oi({
|
|
|
9755
9750
|
label: "Current password",
|
|
9756
9751
|
placeholder: "Enter your current password",
|
|
9757
9752
|
value: c,
|
|
9758
|
-
onChange: (
|
|
9753
|
+
onChange: (A) => d(A.target.value),
|
|
9759
9754
|
disabled: a,
|
|
9760
9755
|
autoFocus: !0
|
|
9761
9756
|
}
|
|
@@ -9766,7 +9761,7 @@ function oi({
|
|
|
9766
9761
|
label: "New password",
|
|
9767
9762
|
placeholder: "Enter new password",
|
|
9768
9763
|
value: u,
|
|
9769
|
-
onChange: (
|
|
9764
|
+
onChange: (A) => m(A.target.value),
|
|
9770
9765
|
disabled: a,
|
|
9771
9766
|
showStrengthMeter: !0
|
|
9772
9767
|
}
|
|
@@ -9777,9 +9772,9 @@ function oi({
|
|
|
9777
9772
|
label: "Confirm new password",
|
|
9778
9773
|
placeholder: "Confirm new password",
|
|
9779
9774
|
value: f,
|
|
9780
|
-
onChange: (
|
|
9775
|
+
onChange: (A) => g(A.target.value),
|
|
9781
9776
|
disabled: a,
|
|
9782
|
-
error: f.length > 0 && !
|
|
9777
|
+
error: f.length > 0 && !v ? "Passwords do not match" : void 0
|
|
9783
9778
|
}
|
|
9784
9779
|
) })
|
|
9785
9780
|
] }),
|
|
@@ -9799,10 +9794,10 @@ function oi({
|
|
|
9799
9794
|
{
|
|
9800
9795
|
type: "button",
|
|
9801
9796
|
className: "cedros-button cedros-button-primary cedros-button-md",
|
|
9802
|
-
onClick:
|
|
9797
|
+
onClick: E,
|
|
9803
9798
|
disabled: a || !N,
|
|
9804
9799
|
children: a ? /* @__PURE__ */ i($, { children: [
|
|
9805
|
-
/* @__PURE__ */ e(
|
|
9800
|
+
/* @__PURE__ */ e(j, { size: "sm" }),
|
|
9806
9801
|
/* @__PURE__ */ e("span", { children: "Changing..." })
|
|
9807
9802
|
] }) : "Change password"
|
|
9808
9803
|
}
|
|
@@ -9816,9 +9811,9 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9816
9811
|
isLoading: m,
|
|
9817
9812
|
isSuccess: f,
|
|
9818
9813
|
reset: g
|
|
9819
|
-
} = Qt(), w = d.some((C) => C.credentialType === "password"), [p, h] = k("view"), [y, b] = k(""), [
|
|
9814
|
+
} = Qt(), w = d.some((C) => C.credentialType === "password"), [p, h] = k("view"), [y, b] = k(""), [v, N] = k(null), E = () => o?.name ? o.name.split(" ").map((C) => C[0]).join("").toUpperCase().slice(0, 2) : o?.email ? o.email[0].toUpperCase() : "?", P = x(() => {
|
|
9820
9815
|
b(o?.name || ""), h("edit"), N(null);
|
|
9821
|
-
}, [o?.name]),
|
|
9816
|
+
}, [o?.name]), A = x(async () => {
|
|
9822
9817
|
const C = y.trim();
|
|
9823
9818
|
if (C) {
|
|
9824
9819
|
N(null);
|
|
@@ -9828,9 +9823,9 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9828
9823
|
N(B instanceof Error ? B.message : "Failed to update name");
|
|
9829
9824
|
}
|
|
9830
9825
|
}
|
|
9831
|
-
}, [y, l, a]),
|
|
9826
|
+
}, [y, l, a]), S = x(() => {
|
|
9832
9827
|
h("view"), b(""), N(null), c();
|
|
9833
|
-
}, [c]), L =
|
|
9828
|
+
}, [c]), L = x(async () => {
|
|
9834
9829
|
if (o?.email) {
|
|
9835
9830
|
N(null);
|
|
9836
9831
|
try {
|
|
@@ -9856,7 +9851,7 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9856
9851
|
alt: o.name || "Profile",
|
|
9857
9852
|
className: "cedros-profile-avatar"
|
|
9858
9853
|
}
|
|
9859
|
-
) : /* @__PURE__ */ e("div", { className: "cedros-profile-avatar cedros-profile-avatar-fallback", children:
|
|
9854
|
+
) : /* @__PURE__ */ e("div", { className: "cedros-profile-avatar cedros-profile-avatar-fallback", children: E() }) }),
|
|
9860
9855
|
/* @__PURE__ */ i("div", { className: "cedros-profile-info", children: [
|
|
9861
9856
|
p === "edit" ? /* @__PURE__ */ i("div", { className: "cedros-profile-name-edit", children: [
|
|
9862
9857
|
/* @__PURE__ */ e(
|
|
@@ -9869,7 +9864,7 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9869
9864
|
disabled: s,
|
|
9870
9865
|
autoFocus: !0,
|
|
9871
9866
|
onKeyDown: (C) => {
|
|
9872
|
-
C.key === "Enter" &&
|
|
9867
|
+
C.key === "Enter" && A(), C.key === "Escape" && S();
|
|
9873
9868
|
}
|
|
9874
9869
|
}
|
|
9875
9870
|
),
|
|
@@ -9879,9 +9874,9 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9879
9874
|
{
|
|
9880
9875
|
type: "button",
|
|
9881
9876
|
className: "cedros-button cedros-button-primary cedros-button-sm",
|
|
9882
|
-
onClick:
|
|
9877
|
+
onClick: A,
|
|
9883
9878
|
disabled: s || !y.trim(),
|
|
9884
|
-
children: s ? /* @__PURE__ */ e(
|
|
9879
|
+
children: s ? /* @__PURE__ */ e(j, { size: "sm" }) : "Save"
|
|
9885
9880
|
}
|
|
9886
9881
|
),
|
|
9887
9882
|
/* @__PURE__ */ e(
|
|
@@ -9889,7 +9884,7 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9889
9884
|
{
|
|
9890
9885
|
type: "button",
|
|
9891
9886
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
9892
|
-
onClick:
|
|
9887
|
+
onClick: S,
|
|
9893
9888
|
disabled: s,
|
|
9894
9889
|
children: "Cancel"
|
|
9895
9890
|
}
|
|
@@ -9912,10 +9907,10 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9912
9907
|
/* @__PURE__ */ e("p", { className: "cedros-profile-email", children: o?.email })
|
|
9913
9908
|
] })
|
|
9914
9909
|
] }),
|
|
9915
|
-
(
|
|
9910
|
+
(v || n) && /* @__PURE__ */ e("div", { className: "cedros-profile-error", children: /* @__PURE__ */ e(
|
|
9916
9911
|
X,
|
|
9917
9912
|
{
|
|
9918
|
-
error: { code: "UNKNOWN_ERROR", message:
|
|
9913
|
+
error: { code: "UNKNOWN_ERROR", message: v || n?.message || "" },
|
|
9919
9914
|
onDismiss: () => {
|
|
9920
9915
|
N(null), c();
|
|
9921
9916
|
}
|
|
@@ -9961,7 +9956,7 @@ function ni({ onPasswordChange: t, className: r = "" }) {
|
|
|
9961
9956
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
9962
9957
|
onClick: L,
|
|
9963
9958
|
disabled: m,
|
|
9964
|
-
children: m ? /* @__PURE__ */ e(
|
|
9959
|
+
children: m ? /* @__PURE__ */ e(j, { size: "sm" }) : "Add password"
|
|
9965
9960
|
}
|
|
9966
9961
|
)
|
|
9967
9962
|
] })
|
|
@@ -10009,7 +10004,7 @@ function ii({
|
|
|
10009
10004
|
onLinkSolana: a,
|
|
10010
10005
|
className: s = ""
|
|
10011
10006
|
}) {
|
|
10012
|
-
const { credentials: n, isLoading: l, error: c, unlinkCredential: d, clearError: u, fetchCredentials: m } = Es(), { registerPasskey: f, isSupported: g } = gs(), [w, p] = k(null), [h, y] = k(!1), b =
|
|
10007
|
+
const { credentials: n, isLoading: l, error: c, unlinkCredential: d, clearError: u, fetchCredentials: m } = Es(), { registerPasskey: f, isSupported: g } = gs(), [w, p] = k(null), [h, y] = k(!1), b = x(async () => {
|
|
10013
10008
|
if (o) {
|
|
10014
10009
|
o();
|
|
10015
10010
|
return;
|
|
@@ -10021,7 +10016,7 @@ function ii({
|
|
|
10021
10016
|
} finally {
|
|
10022
10017
|
y(!1);
|
|
10023
10018
|
}
|
|
10024
|
-
}, [o, f, m]),
|
|
10019
|
+
}, [o, f, m]), v = x(
|
|
10025
10020
|
async (C) => {
|
|
10026
10021
|
const B = C.label || Ss[C.credentialType];
|
|
10027
10022
|
if (window.confirm(
|
|
@@ -10037,9 +10032,9 @@ function ii({
|
|
|
10037
10032
|
}
|
|
10038
10033
|
},
|
|
10039
10034
|
[d]
|
|
10040
|
-
), N = new Set(n.map((C) => C.credentialType)),
|
|
10035
|
+
), N = new Set(n.map((C) => C.credentialType)), E = t && !N.has("oauth_google"), P = r && !N.has("oauth_apple"), A = (o || g) && !N.has("webauthn_passkey"), S = a && !N.has("solana"), L = E || P || A || S;
|
|
10041
10036
|
return l && n.length === 0 ? /* @__PURE__ */ i("div", { className: `cedros-linked-accounts ${s}`, children: [
|
|
10042
|
-
/* @__PURE__ */ e(
|
|
10037
|
+
/* @__PURE__ */ e(j, {}),
|
|
10043
10038
|
/* @__PURE__ */ e("span", { children: "Loading linked accounts..." })
|
|
10044
10039
|
] }) : /* @__PURE__ */ i("div", { className: `cedros-linked-accounts ${s}`, children: [
|
|
10045
10040
|
c && /* @__PURE__ */ e(
|
|
@@ -10055,14 +10050,14 @@ function ii({
|
|
|
10055
10050
|
{
|
|
10056
10051
|
credential: C,
|
|
10057
10052
|
isUnlinking: w === C.id,
|
|
10058
|
-
onUnlink:
|
|
10053
|
+
onUnlink: v
|
|
10059
10054
|
},
|
|
10060
10055
|
C.id
|
|
10061
10056
|
)) }),
|
|
10062
10057
|
L && /* @__PURE__ */ i("div", { className: "cedros-linked-add", children: [
|
|
10063
10058
|
/* @__PURE__ */ e("p", { className: "cedros-linked-add-label", children: "Link a new sign-in method" }),
|
|
10064
10059
|
/* @__PURE__ */ i("div", { className: "cedros-linked-add-buttons", children: [
|
|
10065
|
-
|
|
10060
|
+
E && /* @__PURE__ */ i(
|
|
10066
10061
|
"button",
|
|
10067
10062
|
{
|
|
10068
10063
|
type: "button",
|
|
@@ -10086,20 +10081,20 @@ function ii({
|
|
|
10086
10081
|
]
|
|
10087
10082
|
}
|
|
10088
10083
|
),
|
|
10089
|
-
|
|
10084
|
+
A && /* @__PURE__ */ e(
|
|
10090
10085
|
"button",
|
|
10091
10086
|
{
|
|
10092
10087
|
type: "button",
|
|
10093
10088
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
10094
10089
|
onClick: b,
|
|
10095
10090
|
disabled: h,
|
|
10096
|
-
children: h ? /* @__PURE__ */ e(
|
|
10091
|
+
children: h ? /* @__PURE__ */ e(j, { size: "sm" }) : /* @__PURE__ */ i($, { children: [
|
|
10097
10092
|
/* @__PURE__ */ e(qt, {}),
|
|
10098
10093
|
" Passkey"
|
|
10099
10094
|
] })
|
|
10100
10095
|
}
|
|
10101
10096
|
),
|
|
10102
|
-
|
|
10097
|
+
S && /* @__PURE__ */ i(
|
|
10103
10098
|
"button",
|
|
10104
10099
|
{
|
|
10105
10100
|
type: "button",
|
|
@@ -10143,7 +10138,7 @@ function ci({
|
|
|
10143
10138
|
onClick: () => o(t),
|
|
10144
10139
|
disabled: r,
|
|
10145
10140
|
title: t.isPrimary ? "Cannot remove primary sign-in method" : "Remove",
|
|
10146
|
-
children: r ? /* @__PURE__ */ e(
|
|
10141
|
+
children: r ? /* @__PURE__ */ e(j, { size: "sm" }) : "Remove"
|
|
10147
10142
|
}
|
|
10148
10143
|
) })
|
|
10149
10144
|
] });
|
|
@@ -10255,7 +10250,7 @@ function fi() {
|
|
|
10255
10250
|
o?.getAccessToken
|
|
10256
10251
|
),
|
|
10257
10252
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, o]
|
|
10258
|
-
), m =
|
|
10253
|
+
), m = x(async () => {
|
|
10259
10254
|
if (r !== "authenticated") {
|
|
10260
10255
|
s([]);
|
|
10261
10256
|
return;
|
|
@@ -10273,7 +10268,7 @@ function fi() {
|
|
|
10273
10268
|
_(() => {
|
|
10274
10269
|
r === "authenticated" ? m() : s([]);
|
|
10275
10270
|
}, [r, m]);
|
|
10276
|
-
const f =
|
|
10271
|
+
const f = x(async () => {
|
|
10277
10272
|
l(!0), d(null);
|
|
10278
10273
|
try {
|
|
10279
10274
|
const w = await u.revokeAllSessions();
|
|
@@ -10374,7 +10369,7 @@ function Vc({
|
|
|
10374
10369
|
onSkip: r,
|
|
10375
10370
|
className: o
|
|
10376
10371
|
}) {
|
|
10377
|
-
const { user: a } = et(), { isLoading: s, error: n, updateProfile: l, clearError: c } = st(), [d, u] = k(a?.name ?? ""), m =
|
|
10372
|
+
const { user: a } = et(), { isLoading: s, error: n, updateProfile: l, clearError: c } = st(), [d, u] = k(a?.name ?? ""), m = x(
|
|
10378
10373
|
async (g) => {
|
|
10379
10374
|
g.preventDefault(), c();
|
|
10380
10375
|
const w = d.trim();
|
|
@@ -10449,9 +10444,9 @@ function yi() {
|
|
|
10449
10444
|
timeoutMs: t.config.requestTimeout,
|
|
10450
10445
|
retryAttempts: t.config.retryAttempts,
|
|
10451
10446
|
getAccessToken: t._internal?.getAccessToken
|
|
10452
|
-
}) : null, [t]), l =
|
|
10447
|
+
}) : null, [t]), l = x(() => {
|
|
10453
10448
|
s(null);
|
|
10454
|
-
}, []), c =
|
|
10449
|
+
}, []), c = x(
|
|
10455
10450
|
async (p) => {
|
|
10456
10451
|
if (!n)
|
|
10457
10452
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10474,7 +10469,7 @@ function yi() {
|
|
|
10474
10469
|
}
|
|
10475
10470
|
},
|
|
10476
10471
|
[n]
|
|
10477
|
-
), d =
|
|
10472
|
+
), d = x(
|
|
10478
10473
|
async (p) => {
|
|
10479
10474
|
if (!n)
|
|
10480
10475
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10489,7 +10484,7 @@ function yi() {
|
|
|
10489
10484
|
}
|
|
10490
10485
|
},
|
|
10491
10486
|
[n]
|
|
10492
|
-
), u =
|
|
10487
|
+
), u = x(async () => {
|
|
10493
10488
|
if (!n)
|
|
10494
10489
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
10495
10490
|
o(!0), s(null);
|
|
@@ -10501,7 +10496,7 @@ function yi() {
|
|
|
10501
10496
|
} finally {
|
|
10502
10497
|
o(!1);
|
|
10503
10498
|
}
|
|
10504
|
-
}, [n]), m =
|
|
10499
|
+
}, [n]), m = x(
|
|
10505
10500
|
async (p) => {
|
|
10506
10501
|
if (!n)
|
|
10507
10502
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10519,7 +10514,7 @@ function yi() {
|
|
|
10519
10514
|
}
|
|
10520
10515
|
},
|
|
10521
10516
|
[n]
|
|
10522
|
-
), f =
|
|
10517
|
+
), f = x(
|
|
10523
10518
|
async (p) => {
|
|
10524
10519
|
if (!n)
|
|
10525
10520
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10539,7 +10534,7 @@ function yi() {
|
|
|
10539
10534
|
}
|
|
10540
10535
|
},
|
|
10541
10536
|
[n]
|
|
10542
|
-
), g =
|
|
10537
|
+
), g = x(
|
|
10543
10538
|
async (p) => {
|
|
10544
10539
|
if (!n)
|
|
10545
10540
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10554,7 +10549,7 @@ function yi() {
|
|
|
10554
10549
|
}
|
|
10555
10550
|
},
|
|
10556
10551
|
[n]
|
|
10557
|
-
), w =
|
|
10552
|
+
), w = x(
|
|
10558
10553
|
async (p) => {
|
|
10559
10554
|
if (!n)
|
|
10560
10555
|
throw new Error("useDeposit must be used within a CedrosLoginProvider");
|
|
@@ -10595,32 +10590,32 @@ function Ms({
|
|
|
10595
10590
|
}) {
|
|
10596
10591
|
const [d, u] = k(!1), [m, f] = k(""), g = J(null), w = J(null), p = q(() => {
|
|
10597
10592
|
if (!m.trim()) return t;
|
|
10598
|
-
const
|
|
10593
|
+
const v = m.toLowerCase();
|
|
10599
10594
|
return t.filter(
|
|
10600
|
-
(N) => N.symbol.toLowerCase().includes(
|
|
10595
|
+
(N) => N.symbol.toLowerCase().includes(v) || N.name.toLowerCase().includes(v) || N.mint.toLowerCase().includes(v)
|
|
10601
10596
|
);
|
|
10602
10597
|
}, [t, m]);
|
|
10603
10598
|
_(() => {
|
|
10604
|
-
const
|
|
10599
|
+
const v = (N) => {
|
|
10605
10600
|
g.current && !g.current.contains(N.target) && (u(!1), f(""));
|
|
10606
10601
|
};
|
|
10607
10602
|
if (d)
|
|
10608
|
-
return document.addEventListener("mousedown",
|
|
10603
|
+
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
10609
10604
|
}, [d]), _(() => {
|
|
10610
10605
|
d && c && w.current && w.current.focus();
|
|
10611
10606
|
}, [d, c]), _(() => {
|
|
10612
10607
|
a === void 0 || n || (u(!0), f(""));
|
|
10613
10608
|
}, [a, n]);
|
|
10614
|
-
const h =
|
|
10615
|
-
n || (u((
|
|
10616
|
-
}, [n, d]), y =
|
|
10617
|
-
(
|
|
10618
|
-
o(
|
|
10609
|
+
const h = x(() => {
|
|
10610
|
+
n || (u((v) => !v), d && f(""));
|
|
10611
|
+
}, [n, d]), y = x(
|
|
10612
|
+
(v) => {
|
|
10613
|
+
o(v), u(!1), f("");
|
|
10619
10614
|
},
|
|
10620
10615
|
[o]
|
|
10621
|
-
), b =
|
|
10622
|
-
(
|
|
10623
|
-
|
|
10616
|
+
), b = x(
|
|
10617
|
+
(v) => {
|
|
10618
|
+
v.key === "Escape" ? (u(!1), f("")) : v.key === "Enter" && p.length === 1 && y(p[0]);
|
|
10624
10619
|
},
|
|
10625
10620
|
[p, y]
|
|
10626
10621
|
);
|
|
@@ -10648,8 +10643,8 @@ function Ms({
|
|
|
10648
10643
|
src: r.logoUrl,
|
|
10649
10644
|
alt: r.symbol,
|
|
10650
10645
|
className: "cedros-token-icon",
|
|
10651
|
-
onError: (
|
|
10652
|
-
|
|
10646
|
+
onError: (v) => {
|
|
10647
|
+
v.target.style.display = "none";
|
|
10653
10648
|
}
|
|
10654
10649
|
}
|
|
10655
10650
|
),
|
|
@@ -10666,25 +10661,25 @@ function Ms({
|
|
|
10666
10661
|
ref: w,
|
|
10667
10662
|
type: "text",
|
|
10668
10663
|
value: m,
|
|
10669
|
-
onChange: (
|
|
10664
|
+
onChange: (v) => f(v.target.value),
|
|
10670
10665
|
placeholder: "Search tokens...",
|
|
10671
10666
|
className: "cedros-token-search-input"
|
|
10672
10667
|
}
|
|
10673
10668
|
) }),
|
|
10674
|
-
/* @__PURE__ */ e("div", { className: "cedros-token-list", children: p.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-token-empty", children: "No tokens found" }) : /* @__PURE__ */ e($, { children: p.map((
|
|
10669
|
+
/* @__PURE__ */ e("div", { className: "cedros-token-list", children: p.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-token-empty", children: "No tokens found" }) : /* @__PURE__ */ e($, { children: p.map((v) => /* @__PURE__ */ i(
|
|
10675
10670
|
"button",
|
|
10676
10671
|
{
|
|
10677
10672
|
type: "button",
|
|
10678
|
-
className: `cedros-token-option ${r?.mint ===
|
|
10679
|
-
onClick: () => y(
|
|
10673
|
+
className: `cedros-token-option ${r?.mint === v.mint ? "cedros-token-option-selected" : ""}`,
|
|
10674
|
+
onClick: () => y(v),
|
|
10680
10675
|
role: "option",
|
|
10681
|
-
"aria-selected": r?.mint ===
|
|
10676
|
+
"aria-selected": r?.mint === v.mint,
|
|
10682
10677
|
children: [
|
|
10683
|
-
|
|
10678
|
+
v.logoUrl && /* @__PURE__ */ e(
|
|
10684
10679
|
"img",
|
|
10685
10680
|
{
|
|
10686
|
-
src:
|
|
10687
|
-
alt:
|
|
10681
|
+
src: v.logoUrl,
|
|
10682
|
+
alt: v.symbol,
|
|
10688
10683
|
className: "cedros-token-icon",
|
|
10689
10684
|
onError: (N) => {
|
|
10690
10685
|
N.target.style.display = "none";
|
|
@@ -10692,13 +10687,13 @@ function Ms({
|
|
|
10692
10687
|
}
|
|
10693
10688
|
),
|
|
10694
10689
|
/* @__PURE__ */ i("span", { className: "cedros-token-info", children: [
|
|
10695
|
-
/* @__PURE__ */ e("span", { className: "cedros-token-symbol", children:
|
|
10696
|
-
/* @__PURE__ */ e("span", { className: "cedros-token-name", children:
|
|
10690
|
+
/* @__PURE__ */ e("span", { className: "cedros-token-symbol", children: v.symbol }),
|
|
10691
|
+
/* @__PURE__ */ e("span", { className: "cedros-token-name", children: v.name })
|
|
10697
10692
|
] }),
|
|
10698
|
-
r?.mint ===
|
|
10693
|
+
r?.mint === v.mint && /* @__PURE__ */ e("span", { className: "cedros-token-check", children: "✓" })
|
|
10699
10694
|
]
|
|
10700
10695
|
},
|
|
10701
|
-
|
|
10696
|
+
v.mint
|
|
10702
10697
|
)) }) })
|
|
10703
10698
|
] })
|
|
10704
10699
|
]
|
|
@@ -10853,8 +10848,8 @@ function Ds(t, r, o) {
|
|
|
10853
10848
|
if (a.length === 0)
|
|
10854
10849
|
return `Total: $${s.toFixed(2)}`;
|
|
10855
10850
|
const n = a.reduce((p, h) => p + h.solAmount, 0), l = a.reduce((p, h) => p + h.percent, 0), c = { fee: 7, sol: 8, rate: 7, usd: 8 }, d = (p) => {
|
|
10856
|
-
const h = p.label.padEnd(c.fee), y = p.solAmount.toFixed(4).padStart(6).padEnd(c.sol), b = (p.percent.toFixed(2) + "%").padStart(5).padEnd(c.rate),
|
|
10857
|
-
return `${h} │ ${y} │ ${b} │ ${
|
|
10851
|
+
const h = p.label.padEnd(c.fee), y = p.solAmount.toFixed(4).padStart(6).padEnd(c.sol), b = (p.percent.toFixed(2) + "%").padStart(5).padEnd(c.rate), v = ("$" + Math.max(p.usdAmount, 0.01).toFixed(2)).padEnd(c.usd);
|
|
10852
|
+
return `${h} │ ${y} │ ${b} │ ${v}`;
|
|
10858
10853
|
}, u = `${"Fee".padEnd(c.fee)} │ ${"SOL".padEnd(c.sol)} │ ${"+ Rate".padEnd(c.rate)} │ ${"= Total".padEnd(c.usd)}`, m = `${"─".repeat(c.fee)}─┼─${"─".repeat(c.sol)}─┼─${"─".repeat(c.rate)}─┼─${"─".repeat(c.usd)}`, f = ("$" + s.toFixed(2)).padEnd(c.usd), g = `${"TOTAL".padEnd(c.fee)} │ ${n.toFixed(4).padStart(6).padEnd(c.sol)} │ ${(l.toFixed(2) + "%").padStart(5).padEnd(c.rate)} │ ${f}`;
|
|
10859
10854
|
return [u, m, ...a.map(d), m, g].join(`
|
|
10860
10855
|
`);
|
|
@@ -10909,11 +10904,11 @@ function Hc({
|
|
|
10909
10904
|
demoMode: h = !1,
|
|
10910
10905
|
demoAutoConfirmMs: y,
|
|
10911
10906
|
tokenPriceUsd: b,
|
|
10912
|
-
showExplainer:
|
|
10907
|
+
showExplainer: v = !1,
|
|
10913
10908
|
siteName: N,
|
|
10914
|
-
explainerConfig:
|
|
10909
|
+
explainerConfig: E
|
|
10915
10910
|
}) {
|
|
10916
|
-
const { deposit: P, getStatus:
|
|
10911
|
+
const { deposit: P, getStatus: A, error: S, clearError: L } = yi(), C = tt(), B = qr(t.quickActionTokens), T = qr(t.customTokenSymbols), M = q(() => {
|
|
10917
10912
|
const O = t.customTokens ?? [];
|
|
10918
10913
|
if (O.length === 0) return a;
|
|
10919
10914
|
const H = new Set(a.map((Z) => Z.symbol)), Y = [...a];
|
|
@@ -10931,11 +10926,11 @@ function Hc({
|
|
|
10931
10926
|
if (T.length === 0) return M;
|
|
10932
10927
|
const O = M.filter((H) => T.includes(H.symbol));
|
|
10933
10928
|
return O.length > 0 ? O : M;
|
|
10934
|
-
}, [M, T]), I = t.privateDepositsEnabled, U = o ? o === "sign" && !I ? "receive" : o : I && C.hasExternalWallet ? "sign" : "receive", ee = B[0] ? M.find((O) => O.symbol === B[0]) : void 0, pe = r === "sol" ? Se : r === "single-token" ? ee ?? M.find((O) => O.symbol === "USDC") ?? M[0] ?? Se : s ?? ee ?? M.find((O) => O.symbol === "USDC") ?? M.find((O) => O.symbol !== "SOL") ?? M[0] ?? Se, re =
|
|
10929
|
+
}, [M, T]), I = t.privateDepositsEnabled, U = o ? o === "sign" && !I ? "receive" : o : I && C.hasExternalWallet ? "sign" : "receive", ee = B[0] ? M.find((O) => O.symbol === B[0]) : void 0, pe = r === "sol" ? Se : r === "single-token" ? ee ?? M.find((O) => O.symbol === "USDC") ?? M[0] ?? Se : s ?? ee ?? M.find((O) => O.symbol === "USDC") ?? M.find((O) => O.symbol !== "SOL") ?? M[0] ?? Se, re = x(() => v ? "explainer" : "unlock", [v]), [Q, D] = k(re), [F, K] = k(pe), [se, ne] = k(""), [ge, me] = k(null), [V, z] = k(null), [G, de] = k(null), [be, Zt] = k(null), [nt, Me] = k(!1), [zs, at] = k(!1), [De, er] = k(null);
|
|
10935
10930
|
_(() => {
|
|
10936
|
-
D(re()), K(pe), ne(""), me(null),
|
|
10931
|
+
D(re()), K(pe), ne(""), me(null), z(null), de(null), Zt(null), Me(!1), at(!1), er(null), L();
|
|
10937
10932
|
}, [r, U, pe, L, re]);
|
|
10938
|
-
const Vs = n ?? t.privateMinSol, Hs = l, Ue = parseFloat(se), tr = C.status === "enrolled_locked" || C.status === "enrolled_unlocked" || C.status === "unlocked", it = tr && C.isUnlocked, ct = tr && !C.isUnlocked, rr =
|
|
10933
|
+
const Vs = n ?? t.privateMinSol, Hs = l, Ue = parseFloat(se), tr = C.status === "enrolled_locked" || C.status === "enrolled_unlocked" || C.status === "unlocked", it = tr && C.isUnlocked, ct = tr && !C.isUnlocked, rr = x(() => {
|
|
10939
10934
|
let Y = U === "sign" ? [
|
|
10940
10935
|
{ key: "unlock", label: "Authorize" },
|
|
10941
10936
|
{ key: "confirm", label: "Send" },
|
|
@@ -10947,30 +10942,30 @@ function Hc({
|
|
|
10947
10942
|
{ key: "waiting", label: "Confirming" },
|
|
10948
10943
|
{ key: "success", label: "Complete" }
|
|
10949
10944
|
];
|
|
10950
|
-
return
|
|
10951
|
-
}, [U,
|
|
10945
|
+
return v && (Y = [{ key: "explainer", label: "Info" }, ...Y]), Y;
|
|
10946
|
+
}, [U, v])(), Qs = rr.findIndex((O) => O.key === Q), sr = x((O) => {
|
|
10952
10947
|
K(O);
|
|
10953
|
-
}, []), Ks =
|
|
10948
|
+
}, []), Ks = x(
|
|
10954
10949
|
async (O) => {
|
|
10955
10950
|
if (!f) {
|
|
10956
10951
|
D(U === "sign" ? "confirm" : "show-address");
|
|
10957
10952
|
return;
|
|
10958
10953
|
}
|
|
10959
|
-
at(!0),
|
|
10954
|
+
at(!0), z(null);
|
|
10960
10955
|
try {
|
|
10961
10956
|
const Y = await f(O, U === "sign" ? Ue : null, F);
|
|
10962
10957
|
de(Y.sessionId), Zt(Y.depositAddress), D(U === "sign" ? "confirm" : "show-address");
|
|
10963
10958
|
} catch (H) {
|
|
10964
10959
|
const Y = H instanceof Error ? H : new Error("Authorization failed");
|
|
10965
|
-
|
|
10960
|
+
z(Y.message);
|
|
10966
10961
|
} finally {
|
|
10967
10962
|
at(!1);
|
|
10968
10963
|
}
|
|
10969
10964
|
},
|
|
10970
10965
|
[f, U, Ue, F]
|
|
10971
|
-
), Ys =
|
|
10966
|
+
), Ys = x(
|
|
10972
10967
|
async (O, H) => {
|
|
10973
|
-
L(),
|
|
10968
|
+
L(), z(null), D("signing");
|
|
10974
10969
|
const Y = O ?? Ue, Z = H ?? F;
|
|
10975
10970
|
if (!h) {
|
|
10976
10971
|
if (ct && m) {
|
|
@@ -10978,7 +10973,7 @@ function Hc({
|
|
|
10978
10973
|
return;
|
|
10979
10974
|
}
|
|
10980
10975
|
if (!it) {
|
|
10981
|
-
|
|
10976
|
+
z("Wallet not ready"), D("error");
|
|
10982
10977
|
return;
|
|
10983
10978
|
}
|
|
10984
10979
|
}
|
|
@@ -11016,7 +11011,7 @@ function Hc({
|
|
|
11016
11011
|
me(Fe), D("success"), c?.(Fe);
|
|
11017
11012
|
} catch (ce) {
|
|
11018
11013
|
const ie = ce instanceof Error ? ce : new Error("Deposit failed");
|
|
11019
|
-
|
|
11014
|
+
z(ie.message), D("error"), d?.(ie);
|
|
11020
11015
|
}
|
|
11021
11016
|
},
|
|
11022
11017
|
[
|
|
@@ -11033,9 +11028,9 @@ function Hc({
|
|
|
11033
11028
|
d,
|
|
11034
11029
|
L
|
|
11035
11030
|
]
|
|
11036
|
-
), $s =
|
|
11031
|
+
), $s = x(() => {
|
|
11037
11032
|
D("waiting");
|
|
11038
|
-
}, []), lt =
|
|
11033
|
+
}, []), lt = x(async () => {
|
|
11039
11034
|
const O = be || C.solanaPubkey;
|
|
11040
11035
|
if (O)
|
|
11041
11036
|
try {
|
|
@@ -11052,7 +11047,7 @@ function Hc({
|
|
|
11052
11047
|
if (!(H || Y >= Z)) {
|
|
11053
11048
|
Y++;
|
|
11054
11049
|
try {
|
|
11055
|
-
const ie = await
|
|
11050
|
+
const ie = await A(G);
|
|
11056
11051
|
if (ie.status === "completed" || ie.status === "detected") {
|
|
11057
11052
|
const Fe = ie.amountLamports ? ie.amountLamports / Math.pow(10, F.decimals) : 0, _e = ie.amountLamports || 0, We = {
|
|
11058
11053
|
token: r === "sol" ? null : F,
|
|
@@ -11079,7 +11074,7 @@ function Hc({
|
|
|
11079
11074
|
Q,
|
|
11080
11075
|
G,
|
|
11081
11076
|
h,
|
|
11082
|
-
|
|
11077
|
+
A,
|
|
11083
11078
|
F,
|
|
11084
11079
|
r,
|
|
11085
11080
|
C.solanaPubkey,
|
|
@@ -11120,8 +11115,8 @@ function Hc({
|
|
|
11120
11115
|
G,
|
|
11121
11116
|
c
|
|
11122
11117
|
]);
|
|
11123
|
-
const Gs =
|
|
11124
|
-
D(re()), ne(""), me(null),
|
|
11118
|
+
const Gs = x(() => {
|
|
11119
|
+
D(re()), ne(""), me(null), z(null), L();
|
|
11125
11120
|
}, [re, L]);
|
|
11126
11121
|
return t.enabled ? /* @__PURE__ */ i("div", { className: `cedros-deposit-flow ${g}`, children: [
|
|
11127
11122
|
w && Q !== "error" && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-steps", children: rr.map((O, H) => {
|
|
@@ -11149,7 +11144,7 @@ function Hc({
|
|
|
11149
11144
|
Li,
|
|
11150
11145
|
{
|
|
11151
11146
|
siteName: N,
|
|
11152
|
-
config:
|
|
11147
|
+
config: E,
|
|
11153
11148
|
depositConfig: t,
|
|
11154
11149
|
currencyMode: r,
|
|
11155
11150
|
token: F,
|
|
@@ -11168,7 +11163,7 @@ function Hc({
|
|
|
11168
11163
|
isAuthorizing: zs,
|
|
11169
11164
|
error: V,
|
|
11170
11165
|
onAuthorize: Ks,
|
|
11171
|
-
onBack:
|
|
11166
|
+
onBack: v ? () => D("explainer") : void 0,
|
|
11172
11167
|
onCancel: u
|
|
11173
11168
|
}
|
|
11174
11169
|
),
|
|
@@ -11232,7 +11227,7 @@ function Hc({
|
|
|
11232
11227
|
Q === "error" && /* @__PURE__ */ e(
|
|
11233
11228
|
Ui,
|
|
11234
11229
|
{
|
|
11235
|
-
error: V ||
|
|
11230
|
+
error: V || S || "An error occurred",
|
|
11236
11231
|
onRetry: () => D("confirm"),
|
|
11237
11232
|
onCancel: u
|
|
11238
11233
|
}
|
|
@@ -11386,15 +11381,15 @@ function Ti({
|
|
|
11386
11381
|
onConfirm: y,
|
|
11387
11382
|
onBack: b
|
|
11388
11383
|
}) {
|
|
11389
|
-
const [
|
|
11390
|
-
const V = a.length === 0 ? r : r.filter((de) => a.includes(de.symbol)),
|
|
11391
|
-
return
|
|
11392
|
-
}, [r, a]), ee = ot(g,
|
|
11384
|
+
const [v, N] = k(g.privateMinUsd), [E, P] = k(!1), [A, S] = k(!1), [L, C] = k(0), [B, T] = k(null), R = $t(v, g) === "sol_micro", I = t.symbol === xe.symbol, U = q(() => {
|
|
11385
|
+
const V = a.length === 0 ? r : r.filter((de) => a.includes(de.symbol)), z = V.length > 0 ? V : r;
|
|
11386
|
+
return z.some((de) => de.symbol === xe.symbol) ? z : [...z, xe];
|
|
11387
|
+
}, [r, a]), ee = ot(g, v), pe = ee < 0.01 ? 0.01 : ee, re = I ? "Fees: calculated after deposit" : `Fees: $${pe.toFixed(2)} total`, Q = I ? "" : Ds(g, v, ee), D = _s(R ? Se : t, g), F = D ? v / D : t.symbol === "SOL" && g.solPriceUsd > 0 ? v / g.solPriceUsd : v, K = F ? Ws(F, R ? "SOL" : t.symbol) : null, ne = v - ee <= 0 && v > 0, ge = !I && v > 0 && !ne && F >= n && F <= l;
|
|
11393
11388
|
_(() => {
|
|
11394
11389
|
if (s === "multi-token")
|
|
11395
11390
|
if (R && t.symbol !== "SOL") {
|
|
11396
11391
|
T(t);
|
|
11397
|
-
const V = r.find((
|
|
11392
|
+
const V = r.find((z) => z.symbol === "SOL");
|
|
11398
11393
|
V && p(V);
|
|
11399
11394
|
} else !R && B && t.symbol === "SOL" && (p(B), T(null));
|
|
11400
11395
|
}, [R, t.symbol, s, r, p, B, t]);
|
|
@@ -11408,22 +11403,22 @@ function Ti({
|
|
|
11408
11403
|
/* @__PURE__ */ e("label", { className: "cedros-deposit-flow-label", children: "Token" }),
|
|
11409
11404
|
/* @__PURE__ */ i("div", { className: "cedros-deposit-flow-token-quick", children: [
|
|
11410
11405
|
o.map((V) => {
|
|
11411
|
-
const
|
|
11406
|
+
const z = r.find((de) => de.symbol === V), G = t.symbol === V;
|
|
11412
11407
|
return /* @__PURE__ */ i(
|
|
11413
11408
|
"button",
|
|
11414
11409
|
{
|
|
11415
11410
|
type: "button",
|
|
11416
11411
|
className: `cedros-deposit-flow-token-quick-btn ${G ? "is-active" : ""}`,
|
|
11417
11412
|
onClick: () => {
|
|
11418
|
-
|
|
11413
|
+
z && (P(!1), p(z));
|
|
11419
11414
|
},
|
|
11420
|
-
disabled: !
|
|
11415
|
+
disabled: !z,
|
|
11421
11416
|
children: [
|
|
11422
|
-
|
|
11417
|
+
z?.logoUrl && /* @__PURE__ */ e(
|
|
11423
11418
|
"img",
|
|
11424
11419
|
{
|
|
11425
11420
|
className: "cedros-deposit-flow-token-quick-icon",
|
|
11426
|
-
src:
|
|
11421
|
+
src: z.logoUrl,
|
|
11427
11422
|
alt: `${V} logo`
|
|
11428
11423
|
}
|
|
11429
11424
|
),
|
|
@@ -11437,7 +11432,7 @@ function Ti({
|
|
|
11437
11432
|
"button",
|
|
11438
11433
|
{
|
|
11439
11434
|
type: "button",
|
|
11440
|
-
className: `cedros-deposit-flow-token-quick-btn ${
|
|
11435
|
+
className: `cedros-deposit-flow-token-quick-btn ${E ? "is-active" : ""}`,
|
|
11441
11436
|
onClick: () => {
|
|
11442
11437
|
P(!0), C((V) => V + 1);
|
|
11443
11438
|
},
|
|
@@ -11445,7 +11440,7 @@ function Ti({
|
|
|
11445
11440
|
}
|
|
11446
11441
|
)
|
|
11447
11442
|
] }),
|
|
11448
|
-
|
|
11443
|
+
E && /* @__PURE__ */ e("div", { className: "cedros-deposit-flow-token-custom", children: /* @__PURE__ */ e(
|
|
11449
11444
|
Ms,
|
|
11450
11445
|
{
|
|
11451
11446
|
tokens: U,
|
|
@@ -11459,7 +11454,7 @@ function Ti({
|
|
|
11459
11454
|
Rs,
|
|
11460
11455
|
{
|
|
11461
11456
|
config: g,
|
|
11462
|
-
valueUsd:
|
|
11457
|
+
valueUsd: v,
|
|
11463
11458
|
onChange: N,
|
|
11464
11459
|
maxUsd: Is
|
|
11465
11460
|
}
|
|
@@ -11509,17 +11504,17 @@ function Ti({
|
|
|
11509
11504
|
"button",
|
|
11510
11505
|
{
|
|
11511
11506
|
type: "button",
|
|
11512
|
-
className: `cedros-deposit-flow-fee-info ${
|
|
11507
|
+
className: `cedros-deposit-flow-fee-info ${A ? "is-open" : ""}`,
|
|
11513
11508
|
"data-tooltip": Q,
|
|
11514
11509
|
"aria-label": `Fee breakdown: ${Q.replaceAll(`
|
|
11515
11510
|
`, ", ")}`,
|
|
11516
|
-
"aria-expanded":
|
|
11511
|
+
"aria-expanded": A,
|
|
11517
11512
|
onClick: (V) => {
|
|
11518
|
-
V.stopPropagation(),
|
|
11513
|
+
V.stopPropagation(), S((z) => !z);
|
|
11519
11514
|
},
|
|
11520
|
-
onBlur: () =>
|
|
11515
|
+
onBlur: () => S(!1),
|
|
11521
11516
|
onKeyDown: (V) => {
|
|
11522
|
-
V.key === "Escape" &&
|
|
11517
|
+
V.key === "Escape" && S(!1);
|
|
11523
11518
|
},
|
|
11524
11519
|
children: "i"
|
|
11525
11520
|
}
|
|
@@ -11600,7 +11595,7 @@ function Ri({
|
|
|
11600
11595
|
onSent: w,
|
|
11601
11596
|
onBack: p
|
|
11602
11597
|
}) {
|
|
11603
|
-
const [h, y] = k(u.privateMinUsd), [b,
|
|
11598
|
+
const [h, y] = k(u.privateMinUsd), [b, v] = k(!1), [N, E] = k(!1), [P, A] = k(0), [S, L] = k(null), B = $t(h, u) === "sol_micro", T = t.symbol === xe.symbol, M = q(() => {
|
|
11604
11599
|
const F = a.length === 0 ? r : r.filter((ne) => a.includes(ne.symbol)), K = F.length > 0 ? F : r;
|
|
11605
11600
|
return K.some((ne) => ne.symbol === xe.symbol) ? K : [...K, xe];
|
|
11606
11601
|
}, [r, a]), R = ot(u, h), I = R < 0.01 ? 0.01 : R, U = T ? "Fees: calculated after deposit" : `Fees: $${I.toFixed(2)} total`, ee = T ? "" : Ds(u, h, R), pe = T || h > 0, re = _s(B ? Se : t, u, s), Q = re ? h / re : null, D = Q ? Ws(Q, t.symbol) : null;
|
|
@@ -11610,8 +11605,8 @@ function Ri({
|
|
|
11610
11605
|
L(t);
|
|
11611
11606
|
const F = r.find((K) => K.symbol === "SOL");
|
|
11612
11607
|
F && f(F);
|
|
11613
|
-
} else !B &&
|
|
11614
|
-
}, [B, t.symbol, n, r, f,
|
|
11608
|
+
} else !B && S && t.symbol === "SOL" && (f(S), L(null));
|
|
11609
|
+
}, [B, t.symbol, n, r, f, S, t]), _(() => {
|
|
11615
11610
|
g(h);
|
|
11616
11611
|
}, [h, g]), l ? /* @__PURE__ */ i("div", { className: "cedros-deposit-flow-step", children: [
|
|
11617
11612
|
/* @__PURE__ */ e("h4", { className: "cedros-deposit-flow-step-title", children: "Send Deposit" }),
|
|
@@ -11627,7 +11622,7 @@ function Ri({
|
|
|
11627
11622
|
type: "button",
|
|
11628
11623
|
className: `cedros-deposit-flow-token-quick-btn ${se ? "is-active" : ""}`,
|
|
11629
11624
|
onClick: () => {
|
|
11630
|
-
K && (
|
|
11625
|
+
K && (v(!1), f(K));
|
|
11631
11626
|
},
|
|
11632
11627
|
disabled: !K,
|
|
11633
11628
|
children: [
|
|
@@ -11651,7 +11646,7 @@ function Ri({
|
|
|
11651
11646
|
type: "button",
|
|
11652
11647
|
className: `cedros-deposit-flow-token-quick-btn ${b ? "is-active" : ""}`,
|
|
11653
11648
|
onClick: () => {
|
|
11654
|
-
|
|
11649
|
+
v(!0), A((F) => F + 1);
|
|
11655
11650
|
},
|
|
11656
11651
|
children: "Custom"
|
|
11657
11652
|
}
|
|
@@ -11716,11 +11711,11 @@ function Ri({
|
|
|
11716
11711
|
`, ", ")}`,
|
|
11717
11712
|
"aria-expanded": N,
|
|
11718
11713
|
onClick: (F) => {
|
|
11719
|
-
F.stopPropagation(),
|
|
11714
|
+
F.stopPropagation(), E((K) => !K);
|
|
11720
11715
|
},
|
|
11721
|
-
onBlur: () =>
|
|
11716
|
+
onBlur: () => E(!1),
|
|
11722
11717
|
onKeyDown: (F) => {
|
|
11723
|
-
F.key === "Escape" &&
|
|
11718
|
+
F.key === "Escape" && E(!1);
|
|
11724
11719
|
},
|
|
11725
11720
|
children: "i"
|
|
11726
11721
|
}
|
|
@@ -12002,9 +11997,9 @@ function Os() {
|
|
|
12002
11997
|
timeoutMs: t.config.requestTimeout,
|
|
12003
11998
|
retryAttempts: t.config.retryAttempts,
|
|
12004
11999
|
getAccessToken: t._internal?.getAccessToken
|
|
12005
|
-
}) : null, [t]), l =
|
|
12000
|
+
}) : null, [t]), l = x(() => {
|
|
12006
12001
|
s(null);
|
|
12007
|
-
}, []), c =
|
|
12002
|
+
}, []), c = x(async () => {
|
|
12008
12003
|
if (!n)
|
|
12009
12004
|
throw new Error("useCredits must be used within a CedrosLoginProvider");
|
|
12010
12005
|
o(!0), s(null);
|
|
@@ -12016,7 +12011,7 @@ function Os() {
|
|
|
12016
12011
|
} finally {
|
|
12017
12012
|
o(!1);
|
|
12018
12013
|
}
|
|
12019
|
-
}, [n]), d =
|
|
12014
|
+
}, [n]), d = x(async () => {
|
|
12020
12015
|
if (!n)
|
|
12021
12016
|
throw new Error("useCredits must be used within a CedrosLoginProvider");
|
|
12022
12017
|
o(!0), s(null);
|
|
@@ -12028,7 +12023,7 @@ function Os() {
|
|
|
12028
12023
|
} finally {
|
|
12029
12024
|
o(!1);
|
|
12030
12025
|
}
|
|
12031
|
-
}, [n]), u =
|
|
12026
|
+
}, [n]), u = x(
|
|
12032
12027
|
async (m) => {
|
|
12033
12028
|
if (!n)
|
|
12034
12029
|
throw new Error("useCredits must be used within a CedrosLoginProvider");
|
|
@@ -12063,7 +12058,7 @@ function Qc({
|
|
|
12063
12058
|
className: a = "",
|
|
12064
12059
|
onLoad: s
|
|
12065
12060
|
}) {
|
|
12066
|
-
const { getBalance: n, getAllBalances: l, isLoading: c, error: d, clearError: u } = Os(), [m, f] = k([]), [g, w] = k(null), p =
|
|
12061
|
+
const { getBalance: n, getAllBalances: l, isLoading: c, error: d, clearError: u } = Os(), [m, f] = k([]), [g, w] = k(null), p = x(async () => {
|
|
12067
12062
|
try {
|
|
12068
12063
|
if (t) {
|
|
12069
12064
|
const h = await l();
|
|
@@ -12195,10 +12190,10 @@ function Kc({
|
|
|
12195
12190
|
onLoad: s,
|
|
12196
12191
|
onTransactionClick: n
|
|
12197
12192
|
}) {
|
|
12198
|
-
const { getHistory: l, isLoading: c, error: d, clearError: u } = Os(), [m, f] = k(t), [g, w] = k([]), [p, h] = k(0), [y, b] = k(0), [
|
|
12193
|
+
const { getHistory: l, isLoading: c, error: d, clearError: u } = Os(), [m, f] = k(t), [g, w] = k([]), [p, h] = k(0), [y, b] = k(0), [v, N] = k(null), E = Dt.find((M) => M.key === m) || Dt[0], P = q(() => E.txTypes === null ? g : g.filter((M) => {
|
|
12199
12194
|
const R = M.txType || "";
|
|
12200
|
-
return
|
|
12201
|
-
}), [g,
|
|
12195
|
+
return E.txTypes.some((I) => R.toLowerCase().includes(I.toLowerCase()));
|
|
12196
|
+
}), [g, E.txTypes]), A = x(async () => {
|
|
12202
12197
|
try {
|
|
12203
12198
|
const M = await l({ limit: r * 3, offset: y });
|
|
12204
12199
|
w(M.transactions), h(M.total), s?.(M), N(null);
|
|
@@ -12209,28 +12204,28 @@ function Kc({
|
|
|
12209
12204
|
_(() => {
|
|
12210
12205
|
b(0);
|
|
12211
12206
|
}, [m]), _(() => {
|
|
12212
|
-
|
|
12213
|
-
}, [
|
|
12207
|
+
A();
|
|
12208
|
+
}, [A]), _(() => {
|
|
12214
12209
|
if (o <= 0) return;
|
|
12215
|
-
const M = setInterval(
|
|
12210
|
+
const M = setInterval(A, o);
|
|
12216
12211
|
return () => clearInterval(M);
|
|
12217
|
-
}, [o,
|
|
12218
|
-
const
|
|
12212
|
+
}, [o, A]);
|
|
12213
|
+
const S = Math.ceil(p / r), L = Math.floor(y / r) + 1, C = (M) => {
|
|
12219
12214
|
const R = (M - 1) * r;
|
|
12220
12215
|
b(Math.max(0, Math.min(R, Math.max(0, p - 1))));
|
|
12221
12216
|
}, B = (M) => {
|
|
12222
12217
|
f(M);
|
|
12223
12218
|
};
|
|
12224
|
-
if (
|
|
12219
|
+
if (v || d)
|
|
12225
12220
|
return /* @__PURE__ */ i("div", { className: `cedros-tx-history cedros-tx-history-error ${a}`, children: [
|
|
12226
|
-
/* @__PURE__ */ e("p", { className: "cedros-tx-error", children:
|
|
12221
|
+
/* @__PURE__ */ e("p", { className: "cedros-tx-error", children: v || d }),
|
|
12227
12222
|
/* @__PURE__ */ e(
|
|
12228
12223
|
"button",
|
|
12229
12224
|
{
|
|
12230
12225
|
type: "button",
|
|
12231
12226
|
className: "cedros-tx-retry",
|
|
12232
12227
|
onClick: () => {
|
|
12233
|
-
u(), N(null),
|
|
12228
|
+
u(), N(null), A();
|
|
12234
12229
|
},
|
|
12235
12230
|
children: "Retry"
|
|
12236
12231
|
}
|
|
@@ -12253,7 +12248,7 @@ function Kc({
|
|
|
12253
12248
|
{
|
|
12254
12249
|
type: "button",
|
|
12255
12250
|
className: "cedros-tx-refresh",
|
|
12256
|
-
onClick:
|
|
12251
|
+
onClick: A,
|
|
12257
12252
|
disabled: c,
|
|
12258
12253
|
title: "Refresh",
|
|
12259
12254
|
children: c ? "..." : "↻"
|
|
@@ -12277,7 +12272,7 @@ function Kc({
|
|
|
12277
12272
|
);
|
|
12278
12273
|
}) }),
|
|
12279
12274
|
P.length === 0 ? /* @__PURE__ */ i("div", { className: "cedros-tx-empty", children: [
|
|
12280
|
-
/* @__PURE__ */ e("p", { className: "cedros-tx-empty-message", children: m === "all" ? "No transactions yet." : `No ${
|
|
12275
|
+
/* @__PURE__ */ e("p", { className: "cedros-tx-empty-message", children: m === "all" ? "No transactions yet." : `No ${E.label.toLowerCase()} found.` }),
|
|
12281
12276
|
m === "all" && /* @__PURE__ */ e("p", { className: "cedros-tx-empty-hint", children: "Make a deposit to get started." })
|
|
12282
12277
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
12283
12278
|
/* @__PURE__ */ e("div", { className: "cedros-tx-list", children: P.slice(0, r).map((M) => {
|
|
@@ -12321,7 +12316,7 @@ function Kc({
|
|
|
12321
12316
|
M.id
|
|
12322
12317
|
);
|
|
12323
12318
|
}) }),
|
|
12324
|
-
|
|
12319
|
+
S > 1 && /* @__PURE__ */ i("div", { className: "cedros-tx-pagination", children: [
|
|
12325
12320
|
/* @__PURE__ */ e(
|
|
12326
12321
|
"button",
|
|
12327
12322
|
{
|
|
@@ -12336,7 +12331,7 @@ function Kc({
|
|
|
12336
12331
|
"Page ",
|
|
12337
12332
|
L,
|
|
12338
12333
|
" of ",
|
|
12339
|
-
|
|
12334
|
+
S
|
|
12340
12335
|
] }),
|
|
12341
12336
|
/* @__PURE__ */ e(
|
|
12342
12337
|
"button",
|
|
@@ -12344,7 +12339,7 @@ function Kc({
|
|
|
12344
12339
|
type: "button",
|
|
12345
12340
|
className: "cedros-tx-page-btn",
|
|
12346
12341
|
onClick: () => C(L + 1),
|
|
12347
|
-
disabled: L >=
|
|
12342
|
+
disabled: L >= S,
|
|
12348
12343
|
children: "Next"
|
|
12349
12344
|
}
|
|
12350
12345
|
)
|
|
@@ -12358,9 +12353,9 @@ function qs() {
|
|
|
12358
12353
|
timeoutMs: t.config.requestTimeout,
|
|
12359
12354
|
retryAttempts: t.config.retryAttempts,
|
|
12360
12355
|
getAccessToken: t._internal?.getAccessToken
|
|
12361
|
-
}) : null, [t]), d =
|
|
12356
|
+
}) : null, [t]), d = x(() => {
|
|
12362
12357
|
s(null);
|
|
12363
|
-
}, []), u =
|
|
12358
|
+
}, []), u = x(async () => {
|
|
12364
12359
|
if (!c)
|
|
12365
12360
|
throw new Error("useWithdrawal must be used within a CedrosLoginProvider");
|
|
12366
12361
|
try {
|
|
@@ -12369,7 +12364,7 @@ function qs() {
|
|
|
12369
12364
|
const p = W(w, "Failed to fetch wallet balances");
|
|
12370
12365
|
throw s(p.message), p;
|
|
12371
12366
|
}
|
|
12372
|
-
}, [c]), m =
|
|
12367
|
+
}, [c]), m = x(
|
|
12373
12368
|
async (w, p) => {
|
|
12374
12369
|
if (!c)
|
|
12375
12370
|
throw new Error("useWithdrawal must be used within a CedrosLoginProvider");
|
|
@@ -12388,7 +12383,7 @@ function qs() {
|
|
|
12388
12383
|
}
|
|
12389
12384
|
},
|
|
12390
12385
|
[c]
|
|
12391
|
-
), f =
|
|
12386
|
+
), f = x(
|
|
12392
12387
|
async (w, p, h) => {
|
|
12393
12388
|
if (!c)
|
|
12394
12389
|
throw new Error("useWithdrawal must be used within a CedrosLoginProvider");
|
|
@@ -12408,7 +12403,7 @@ function qs() {
|
|
|
12408
12403
|
}
|
|
12409
12404
|
},
|
|
12410
12405
|
[c]
|
|
12411
|
-
), g =
|
|
12406
|
+
), g = x(
|
|
12412
12407
|
async (w = 10, p = 0) => {
|
|
12413
12408
|
if (!c)
|
|
12414
12409
|
throw new Error("useWithdrawal must be used within a CedrosLoginProvider");
|
|
@@ -12467,7 +12462,7 @@ function Yc({
|
|
|
12467
12462
|
onCancel: o,
|
|
12468
12463
|
className: a = ""
|
|
12469
12464
|
}) {
|
|
12470
|
-
const s = ve(), { withdrawSol: n, withdrawSpl: l, getBalances: c, isSubmitting: d, error: u, clearError: m } = qs(), [f, g] = k("loading"), [w, p] = k([]), [h, y] = k(null), [b,
|
|
12465
|
+
const s = ve(), { withdrawSol: n, withdrawSpl: l, getBalances: c, isSubmitting: d, error: u, clearError: m } = qs(), [f, g] = k("loading"), [w, p] = k([]), [h, y] = k(null), [b, v] = k(""), [N, E] = k(""), [P, A] = k(null), [S, L] = k(null), [C, B] = k(null), T = s?.config.solana?.network ?? "mainnet-beta", M = q(() => {
|
|
12471
12466
|
if (!P?.txSignature) return "";
|
|
12472
12467
|
const D = `https://explorer.solana.com/tx/${P.txSignature}`;
|
|
12473
12468
|
return T === "mainnet-beta" ? D : `${D}?cluster=${encodeURIComponent(T)}`;
|
|
@@ -12509,16 +12504,16 @@ function Yc({
|
|
|
12509
12504
|
D = !0;
|
|
12510
12505
|
};
|
|
12511
12506
|
}, [s, c]);
|
|
12512
|
-
const I =
|
|
12507
|
+
const I = x(
|
|
12513
12508
|
(D) => {
|
|
12514
|
-
y(D), g("form"), m(), L(null),
|
|
12509
|
+
y(D), g("form"), m(), L(null), E("");
|
|
12515
12510
|
},
|
|
12516
12511
|
[m]
|
|
12517
|
-
), U =
|
|
12512
|
+
), U = x(() => {
|
|
12518
12513
|
if (!h) return;
|
|
12519
12514
|
const D = Number(h.rawBalance) / Math.pow(10, h.decimals);
|
|
12520
|
-
h.mint === Ut ?
|
|
12521
|
-
}, [h]), ee =
|
|
12515
|
+
h.mint === Ut ? E(String(Math.max(0, D - 0.01))) : E(String(D));
|
|
12516
|
+
}, [h]), ee = x(() => {
|
|
12522
12517
|
if (L(null), !b.trim()) {
|
|
12523
12518
|
L("Destination address is required");
|
|
12524
12519
|
return;
|
|
@@ -12536,12 +12531,12 @@ function Yc({
|
|
|
12536
12531
|
return;
|
|
12537
12532
|
}
|
|
12538
12533
|
g("confirm");
|
|
12539
|
-
}, [b, N, R]), pe =
|
|
12534
|
+
}, [b, N, R]), pe = x(async () => {
|
|
12540
12535
|
if (h) {
|
|
12541
12536
|
g("processing"), m();
|
|
12542
12537
|
try {
|
|
12543
12538
|
let D;
|
|
12544
|
-
h.mint === Ut ? D = await n(b.trim(), Number(R)) : D = await l(b.trim(), h.mint, R),
|
|
12539
|
+
h.mint === Ut ? D = await n(b.trim(), Number(R)) : D = await l(b.trim(), h.mint, R), A(D), g("success"), t?.(D);
|
|
12545
12540
|
} catch (D) {
|
|
12546
12541
|
g("confirm"), r?.(D instanceof Error ? D : new Error(String(D)));
|
|
12547
12542
|
}
|
|
@@ -12555,14 +12550,14 @@ function Yc({
|
|
|
12555
12550
|
m,
|
|
12556
12551
|
t,
|
|
12557
12552
|
r
|
|
12558
|
-
]), re =
|
|
12559
|
-
m(), L(null), f === "form" ? (g("select"), y(null),
|
|
12560
|
-
}, [f, m]), Q =
|
|
12561
|
-
g("select"), y(null),
|
|
12553
|
+
]), re = x(() => {
|
|
12554
|
+
m(), L(null), f === "form" ? (g("select"), y(null), E(""), v("")) : f === "confirm" && g("form");
|
|
12555
|
+
}, [f, m]), Q = x(() => {
|
|
12556
|
+
g("select"), y(null), v(""), E(""), A(null), m(), L(null);
|
|
12562
12557
|
}, [m]);
|
|
12563
12558
|
return s ? /* @__PURE__ */ i("div", { className: `cedros-withdrawal ${a}`, children: [
|
|
12564
12559
|
f === "loading" && /* @__PURE__ */ i("div", { className: "cedros-withdrawal-processing", children: [
|
|
12565
|
-
/* @__PURE__ */ e(
|
|
12560
|
+
/* @__PURE__ */ e(j, {}),
|
|
12566
12561
|
/* @__PURE__ */ e("p", { className: "cedros-withdrawal-processing-text", children: "Loading wallet balances..." })
|
|
12567
12562
|
] }),
|
|
12568
12563
|
f === "select" && /* @__PURE__ */ i("div", { className: "cedros-withdrawal-select", children: [
|
|
@@ -12627,7 +12622,7 @@ function Yc({
|
|
|
12627
12622
|
className: "cedros-input",
|
|
12628
12623
|
placeholder: "Solana address (base58)",
|
|
12629
12624
|
value: b,
|
|
12630
|
-
onChange: (D) =>
|
|
12625
|
+
onChange: (D) => v(D.target.value),
|
|
12631
12626
|
autoComplete: "off",
|
|
12632
12627
|
spellCheck: !1
|
|
12633
12628
|
}
|
|
@@ -12648,7 +12643,7 @@ function Yc({
|
|
|
12648
12643
|
className: "cedros-input",
|
|
12649
12644
|
placeholder: "0.00",
|
|
12650
12645
|
value: N,
|
|
12651
|
-
onChange: (D) =>
|
|
12646
|
+
onChange: (D) => E(D.target.value),
|
|
12652
12647
|
min: "0",
|
|
12653
12648
|
step: "any"
|
|
12654
12649
|
}
|
|
@@ -12664,7 +12659,7 @@ function Yc({
|
|
|
12664
12659
|
)
|
|
12665
12660
|
] })
|
|
12666
12661
|
] }),
|
|
12667
|
-
(
|
|
12662
|
+
(S || u) && /* @__PURE__ */ e(X, { error: S || u || "" }),
|
|
12668
12663
|
/* @__PURE__ */ e(
|
|
12669
12664
|
"button",
|
|
12670
12665
|
{
|
|
@@ -12736,7 +12731,7 @@ function Yc({
|
|
|
12736
12731
|
] })
|
|
12737
12732
|
] }),
|
|
12738
12733
|
f === "processing" && /* @__PURE__ */ i("div", { className: "cedros-withdrawal-processing", children: [
|
|
12739
|
-
/* @__PURE__ */ e(
|
|
12734
|
+
/* @__PURE__ */ e(j, {}),
|
|
12740
12735
|
/* @__PURE__ */ i("p", { className: "cedros-withdrawal-processing-text", children: [
|
|
12741
12736
|
"Sending ",
|
|
12742
12737
|
h?.symbol,
|
|
@@ -12809,7 +12804,7 @@ function $c({
|
|
|
12809
12804
|
onTransactionClick: o,
|
|
12810
12805
|
explorerUrl: a = "https://solscan.io"
|
|
12811
12806
|
}) {
|
|
12812
|
-
const { getHistory: s, error: n, clearError: l } = qs(), [c, d] = k([]), [u, m] = k(0), [f, g] = k(0), [w, p] = k(!1), [h, y] = k(null), b =
|
|
12807
|
+
const { getHistory: s, error: n, clearError: l } = qs(), [c, d] = k([]), [u, m] = k(0), [f, g] = k(0), [w, p] = k(!1), [h, y] = k(null), b = x(async () => {
|
|
12813
12808
|
p(!0);
|
|
12814
12809
|
try {
|
|
12815
12810
|
const P = await s(t, f);
|
|
@@ -12823,9 +12818,9 @@ function $c({
|
|
|
12823
12818
|
_(() => {
|
|
12824
12819
|
b();
|
|
12825
12820
|
}, [b]);
|
|
12826
|
-
const
|
|
12827
|
-
const
|
|
12828
|
-
g(Math.max(0, Math.min(
|
|
12821
|
+
const v = Math.ceil(u / t), N = Math.floor(f / t) + 1, E = (P) => {
|
|
12822
|
+
const A = (P - 1) * t;
|
|
12823
|
+
g(Math.max(0, Math.min(A, Math.max(0, u - 1))));
|
|
12829
12824
|
};
|
|
12830
12825
|
return h || n ? /* @__PURE__ */ i("div", { className: `cedros-withdrawal-history cedros-withdrawal-history-error ${r}`, children: [
|
|
12831
12826
|
/* @__PURE__ */ e("p", { className: "cedros-withdrawal-error", children: h || n }),
|
|
@@ -12860,14 +12855,14 @@ function $c({
|
|
|
12860
12855
|
] }),
|
|
12861
12856
|
c.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-tx-empty", children: /* @__PURE__ */ e("p", { className: "cedros-tx-empty-message", children: "No withdrawal history yet." }) }) : /* @__PURE__ */ i($, { children: [
|
|
12862
12857
|
/* @__PURE__ */ e("div", { className: "cedros-tx-list", children: c.map((P) => {
|
|
12863
|
-
const
|
|
12858
|
+
const A = Zi(P.tokenType, P.tokenMint);
|
|
12864
12859
|
return /* @__PURE__ */ i(
|
|
12865
12860
|
"div",
|
|
12866
12861
|
{
|
|
12867
12862
|
className: "cedros-tx-item cedros-tx-item-negative",
|
|
12868
12863
|
onClick: () => o?.(P),
|
|
12869
|
-
onKeyDown: (
|
|
12870
|
-
(
|
|
12864
|
+
onKeyDown: (S) => {
|
|
12865
|
+
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), o?.(P));
|
|
12871
12866
|
},
|
|
12872
12867
|
role: o ? "button" : void 0,
|
|
12873
12868
|
tabIndex: o ? 0 : void 0,
|
|
@@ -12876,13 +12871,13 @@ function $c({
|
|
|
12876
12871
|
/* @__PURE__ */ i("div", { className: "cedros-tx-content", children: [
|
|
12877
12872
|
/* @__PURE__ */ i("div", { className: "cedros-tx-row-main", children: [
|
|
12878
12873
|
/* @__PURE__ */ i("span", { className: "cedros-tx-type", children: [
|
|
12879
|
-
|
|
12874
|
+
A,
|
|
12880
12875
|
" Withdrawal"
|
|
12881
12876
|
] }),
|
|
12882
12877
|
/* @__PURE__ */ i("span", { className: "cedros-tx-amount cedros-tx-amount-negative", children: [
|
|
12883
12878
|
P.amount,
|
|
12884
12879
|
" ",
|
|
12885
|
-
|
|
12880
|
+
A === "SOL" ? "lamports" : ""
|
|
12886
12881
|
] })
|
|
12887
12882
|
] }),
|
|
12888
12883
|
/* @__PURE__ */ i("div", { className: "cedros-tx-row-details", children: [
|
|
@@ -12895,7 +12890,7 @@ function $c({
|
|
|
12895
12890
|
href: `${a}/account/${P.destination}`,
|
|
12896
12891
|
target: "_blank",
|
|
12897
12892
|
rel: "noopener noreferrer",
|
|
12898
|
-
onClick: (
|
|
12893
|
+
onClick: (S) => S.stopPropagation(),
|
|
12899
12894
|
children: ec(P.destination)
|
|
12900
12895
|
}
|
|
12901
12896
|
),
|
|
@@ -12906,7 +12901,7 @@ function $c({
|
|
|
12906
12901
|
href: `${a}/tx/${P.txSignature}`,
|
|
12907
12902
|
target: "_blank",
|
|
12908
12903
|
rel: "noopener noreferrer",
|
|
12909
|
-
onClick: (
|
|
12904
|
+
onClick: (S) => S.stopPropagation(),
|
|
12910
12905
|
children: "tx"
|
|
12911
12906
|
}
|
|
12912
12907
|
)
|
|
@@ -12919,13 +12914,13 @@ function $c({
|
|
|
12919
12914
|
P.id
|
|
12920
12915
|
);
|
|
12921
12916
|
}) }),
|
|
12922
|
-
|
|
12917
|
+
v > 1 && /* @__PURE__ */ i("div", { className: "cedros-tx-pagination", children: [
|
|
12923
12918
|
/* @__PURE__ */ e(
|
|
12924
12919
|
"button",
|
|
12925
12920
|
{
|
|
12926
12921
|
type: "button",
|
|
12927
12922
|
className: "cedros-tx-page-btn",
|
|
12928
|
-
onClick: () =>
|
|
12923
|
+
onClick: () => E(N - 1),
|
|
12929
12924
|
disabled: N <= 1,
|
|
12930
12925
|
children: "Previous"
|
|
12931
12926
|
}
|
|
@@ -12934,15 +12929,15 @@ function $c({
|
|
|
12934
12929
|
"Page ",
|
|
12935
12930
|
N,
|
|
12936
12931
|
" of ",
|
|
12937
|
-
|
|
12932
|
+
v
|
|
12938
12933
|
] }),
|
|
12939
12934
|
/* @__PURE__ */ e(
|
|
12940
12935
|
"button",
|
|
12941
12936
|
{
|
|
12942
12937
|
type: "button",
|
|
12943
12938
|
className: "cedros-tx-page-btn",
|
|
12944
|
-
onClick: () =>
|
|
12945
|
-
disabled: N >=
|
|
12939
|
+
onClick: () => E(N + 1),
|
|
12940
|
+
disabled: N >= v,
|
|
12946
12941
|
children: "Next"
|
|
12947
12942
|
}
|
|
12948
12943
|
)
|
|
@@ -13014,7 +13009,7 @@ function Xc() {
|
|
|
13014
13009
|
r?.getAccessToken
|
|
13015
13010
|
),
|
|
13016
13011
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, r]
|
|
13017
|
-
), n =
|
|
13012
|
+
), n = x(
|
|
13018
13013
|
async (d) => {
|
|
13019
13014
|
a((u) => ({ ...u, isLoading: !0, error: null }));
|
|
13020
13015
|
try {
|
|
@@ -13036,10 +13031,10 @@ function Xc() {
|
|
|
13036
13031
|
}
|
|
13037
13032
|
},
|
|
13038
13033
|
[s]
|
|
13039
|
-
), l =
|
|
13034
|
+
), l = x(
|
|
13040
13035
|
async (d) => (await n(d)).allowed,
|
|
13041
13036
|
[n]
|
|
13042
|
-
), c =
|
|
13037
|
+
), c = x(() => {
|
|
13043
13038
|
a({
|
|
13044
13039
|
allowed: !1,
|
|
13045
13040
|
reason: void 0,
|
|
@@ -13055,7 +13050,7 @@ function Xc() {
|
|
|
13055
13050
|
};
|
|
13056
13051
|
}
|
|
13057
13052
|
function Zc() {
|
|
13058
|
-
const { listAllWallets: t, createDerivedWallet: r, deleteDerivedWallet: o } = Pe(), [a, s] = k([]), [n, l] = k(!1), [c, d] = k(null), u =
|
|
13053
|
+
const { listAllWallets: t, createDerivedWallet: r, deleteDerivedWallet: o } = Pe(), [a, s] = k([]), [n, l] = k(!1), [c, d] = k(null), u = x(async () => {
|
|
13059
13054
|
l(!0), d(null);
|
|
13060
13055
|
try {
|
|
13061
13056
|
const w = await t();
|
|
@@ -13066,7 +13061,7 @@ function Zc() {
|
|
|
13066
13061
|
} finally {
|
|
13067
13062
|
l(!1);
|
|
13068
13063
|
}
|
|
13069
|
-
}, [t]), m =
|
|
13064
|
+
}, [t]), m = x(
|
|
13070
13065
|
async (w) => {
|
|
13071
13066
|
l(!0), d(null);
|
|
13072
13067
|
try {
|
|
@@ -13080,7 +13075,7 @@ function Zc() {
|
|
|
13080
13075
|
}
|
|
13081
13076
|
},
|
|
13082
13077
|
[r, u]
|
|
13083
|
-
), f =
|
|
13078
|
+
), f = x(
|
|
13084
13079
|
async (w) => {
|
|
13085
13080
|
l(!0), d(null);
|
|
13086
13081
|
try {
|
|
@@ -13093,7 +13088,7 @@ function Zc() {
|
|
|
13093
13088
|
}
|
|
13094
13089
|
},
|
|
13095
13090
|
[o, u]
|
|
13096
|
-
), g =
|
|
13091
|
+
), g = x(() => d(null), []);
|
|
13097
13092
|
return {
|
|
13098
13093
|
wallets: a,
|
|
13099
13094
|
isLoading: n,
|
|
@@ -13110,7 +13105,7 @@ function el() {
|
|
|
13110
13105
|
timeoutMs: t.config.requestTimeout,
|
|
13111
13106
|
retryAttempts: t.config.retryAttempts,
|
|
13112
13107
|
getAccessToken: t._internal?.getAccessToken
|
|
13113
|
-
}) : null, [t]), d =
|
|
13108
|
+
}) : null, [t]), d = x(async () => {
|
|
13114
13109
|
if (!c)
|
|
13115
13110
|
throw new Error("usePendingRecovery must be used within a CedrosLoginProvider");
|
|
13116
13111
|
o(!0), s(null);
|
|
@@ -13123,7 +13118,7 @@ function el() {
|
|
|
13123
13118
|
} finally {
|
|
13124
13119
|
o(!1);
|
|
13125
13120
|
}
|
|
13126
|
-
}, [c]), u =
|
|
13121
|
+
}, [c]), u = x(async () => {
|
|
13127
13122
|
if (!c)
|
|
13128
13123
|
throw new Error("usePendingRecovery must be used within a CedrosLoginProvider");
|
|
13129
13124
|
o(!0), s(null);
|
|
@@ -13136,7 +13131,7 @@ function el() {
|
|
|
13136
13131
|
} finally {
|
|
13137
13132
|
o(!1);
|
|
13138
13133
|
}
|
|
13139
|
-
}, [c]), m =
|
|
13134
|
+
}, [c]), m = x(() => s(null), []);
|
|
13140
13135
|
return _(() => {
|
|
13141
13136
|
c && t?.authState === "authenticated" && d().catch(() => {
|
|
13142
13137
|
});
|
|
@@ -13160,7 +13155,7 @@ function tl(t = {}) {
|
|
|
13160
13155
|
clearError: u
|
|
13161
13156
|
} = Xn(), m = q(() => a && r ? "external" : s === "enrolled_locked" || s === "enrolled_unlocked" ? "sss" : "none", [a, r, s]), f = m !== "none", g = s === "enrolled_locked" || s === "enrolled_unlocked";
|
|
13162
13157
|
return {
|
|
13163
|
-
signTransaction:
|
|
13158
|
+
signTransaction: x(
|
|
13164
13159
|
async (p, h) => {
|
|
13165
13160
|
if (m === "external") {
|
|
13166
13161
|
if (!r)
|
|
@@ -13197,7 +13192,7 @@ function rl() {
|
|
|
13197
13192
|
getAccessToken: r?.getAccessToken
|
|
13198
13193
|
}),
|
|
13199
13194
|
[t.serverUrl, t.requestTimeout, r]
|
|
13200
|
-
), u =
|
|
13195
|
+
), u = x(async () => {
|
|
13201
13196
|
n(!0), c(null);
|
|
13202
13197
|
try {
|
|
13203
13198
|
await d.post("/welcome-completed", {});
|
|
@@ -13207,7 +13202,7 @@ function rl() {
|
|
|
13207
13202
|
} finally {
|
|
13208
13203
|
n(!1);
|
|
13209
13204
|
}
|
|
13210
|
-
}, [d]), m =
|
|
13205
|
+
}, [d]), m = x(() => {
|
|
13211
13206
|
a(null);
|
|
13212
13207
|
}, []);
|
|
13213
13208
|
return {
|
|
@@ -13340,7 +13335,7 @@ export {
|
|
|
13340
13335
|
wo as InviteForm,
|
|
13341
13336
|
yo as InviteList,
|
|
13342
13337
|
ii as LinkedAccounts,
|
|
13343
|
-
|
|
13338
|
+
j as LoadingSpinner,
|
|
13344
13339
|
Tc as LoginButton,
|
|
13345
13340
|
Kt as LoginForm,
|
|
13346
13341
|
Bc as LoginModal,
|