@cedros/login-react 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthenticationSettings-D4ExU-2a.js → AuthenticationSettings-CheE3j7w.js} +1 -1
- package/dist/{AuthenticationSettings-D4ExU-2a.js.map → AuthenticationSettings-CheE3j7w.js.map} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs → AuthenticationSettings-Dl41GbJL.cjs} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs.map → AuthenticationSettings-Dl41GbJL.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-CSoFp-_2.js → AuthenticationSettings-DwSxgjbH.js} +1 -1
- package/dist/{AuthenticationSettings-CSoFp-_2.js.map → AuthenticationSettings-DwSxgjbH.js.map} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs → AuthenticationSettings-JxHsBst9.cjs} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs.map → AuthenticationSettings-JxHsBst9.cjs.map} +1 -1
- package/dist/AutosaveStatus-BMXjH1XN.cjs +1 -0
- package/dist/AutosaveStatus-BMXjH1XN.cjs.map +1 -0
- package/dist/{AutosaveStatus-DMjvXzP2.js → AutosaveStatus-DNuCl59W.js} +578 -284
- package/dist/AutosaveStatus-DNuCl59W.js.map +1 -0
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs → CreditSystemSettings-BVgl6uUg.cjs} +1 -1
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs.map → CreditSystemSettings-BVgl6uUg.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js → CreditSystemSettings-C-ksysSx.js} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js.map → CreditSystemSettings-C-ksysSx.js.map} +1 -1
- package/dist/{CreditSystemSettings-BjQdysRS.js → CreditSystemSettings-HSdF2_CY.js} +1 -1
- package/dist/{CreditSystemSettings-BjQdysRS.js.map → CreditSystemSettings-HSdF2_CY.js.map} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs → CreditSystemSettings-LvA8rb17.cjs} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs.map → CreditSystemSettings-LvA8rb17.cjs.map} +1 -1
- package/dist/{EmailRegisterForm-CMXsa-_r.js → EmailRegisterForm-p2X5QP58.js} +147 -147
- package/dist/EmailRegisterForm-p2X5QP58.js.map +1 -0
- package/dist/EmailRegisterForm-xFb6MaVA.cjs +1 -0
- package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +1 -0
- package/dist/{EmailSettings-CjngJwDS.js → EmailSettings-Cy1cuVUq.js} +1 -1
- package/dist/{EmailSettings-CjngJwDS.js.map → EmailSettings-Cy1cuVUq.js.map} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs → EmailSettings-DC_zT4nI.cjs} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs.map → EmailSettings-DC_zT4nI.cjs.map} +1 -1
- package/dist/{EmailSettings-CswtKXhb.cjs → EmailSettings-QBMzpbxv.cjs} +1 -1
- package/dist/{EmailSettings-CswtKXhb.cjs.map → EmailSettings-QBMzpbxv.cjs.map} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js → EmailSettings-hIhJzux0.js} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js.map → EmailSettings-hIhJzux0.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs → EmbeddedWalletSettings-4qC9KBwh.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs.map → EmbeddedWalletSettings-4qC9KBwh.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs → EmbeddedWalletSettings-C81QQMWz.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs.map → EmbeddedWalletSettings-C81QQMWz.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js → EmbeddedWalletSettings-CvvTnRvt.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js.map → EmbeddedWalletSettings-CvvTnRvt.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js → EmbeddedWalletSettings-Cwiug0vR.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js.map → EmbeddedWalletSettings-Cwiug0vR.js.map} +1 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs +1 -0
- package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +1 -0
- package/dist/{GoogleLoginButton-qf4A_A3G.js → GoogleLoginButton-C1WNu7W3.js} +41 -40
- package/dist/GoogleLoginButton-C1WNu7W3.js.map +1 -0
- package/dist/LoadingSpinner-6vml-zwr.js.map +1 -1
- package/dist/LoadingSpinner-d6sSxgQN.cjs.map +1 -1
- package/dist/{PermissionsSection-BeFhIgQy.js → PermissionsSection-BDDiEfho.js} +81 -77
- package/dist/{PermissionsSection-BeFhIgQy.js.map → PermissionsSection-BDDiEfho.js.map} +1 -1
- package/dist/PermissionsSection-CSB_Ikj9.cjs +1 -0
- package/dist/{PermissionsSection-B-6DJnN8.cjs.map → PermissionsSection-CSB_Ikj9.cjs.map} +1 -1
- package/dist/{ServerSettings-BygCxOTY.cjs → ServerSettings-BV0SipW1.cjs} +1 -1
- package/dist/{ServerSettings-BygCxOTY.cjs.map → ServerSettings-BV0SipW1.cjs.map} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs → ServerSettings-Bf7gFE8r.cjs} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs.map → ServerSettings-Bf7gFE8r.cjs.map} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js → ServerSettings-DPqHtsgV.js} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js.map → ServerSettings-DPqHtsgV.js.map} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js → ServerSettings-Sfr0CG6K.js} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js.map → ServerSettings-Sfr0CG6K.js.map} +1 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs +1 -0
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +1 -0
- package/dist/{SolanaLoginButton-B04dib6X.js → SolanaLoginButton-CyeX35eU.js} +41 -40
- package/dist/SolanaLoginButton-CyeX35eU.js.map +1 -0
- package/dist/{TeamSection-DbSYDRdI.js → TeamSection-BhsBEckR.js} +1 -1
- package/dist/{TeamSection-DbSYDRdI.js.map → TeamSection-BhsBEckR.js.map} +1 -1
- package/dist/{TeamSection-B1t1tU-_.cjs → TeamSection-DLxtRmta.cjs} +1 -1
- package/dist/{TeamSection-B1t1tU-_.cjs.map → TeamSection-DLxtRmta.cjs.map} +1 -1
- package/dist/{UsersSection-C7aRNkK2.cjs → UsersSection-BEKfbhQ4.cjs} +1 -1
- package/dist/{UsersSection-C7aRNkK2.cjs.map → UsersSection-BEKfbhQ4.cjs.map} +1 -1
- package/dist/{UsersSection--PAE1XRh.js → UsersSection-DbGkmxty.js} +1 -1
- package/dist/{UsersSection--PAE1XRh.js.map → UsersSection-DbGkmxty.js.map} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs → WebhookSettings-BPCKv5Or.cjs} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs.map → WebhookSettings-BPCKv5Or.cjs.map} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js → WebhookSettings-CMROMCFT.js} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js.map → WebhookSettings-CMROMCFT.js.map} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs → WebhookSettings-Cj-iELGa.cjs} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs.map → WebhookSettings-Cj-iELGa.cjs.map} +1 -1
- package/dist/{WebhookSettings-C-7Yxueu.js → WebhookSettings-D4mKAWAg.js} +1 -1
- package/dist/{WebhookSettings-C-7Yxueu.js.map → WebhookSettings-D4mKAWAg.js.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +6 -0
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +6 -0
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +411 -1
- package/dist/index.js +5175 -4054
- package/dist/index.js.map +1 -1
- package/dist/plugin-BHGg7ius.cjs +1 -0
- package/dist/plugin-BHGg7ius.cjs.map +1 -0
- package/dist/{plugin-BiftIhZe.js → plugin-CK2d7aP5.js} +3 -2
- package/dist/plugin-CK2d7aP5.js.map +1 -0
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +6 -0
- package/dist/solana-only.js +2 -2
- package/dist/useAuth-B1yS_YiD.cjs +1 -0
- package/dist/{useAuth-U5CYsHEU.cjs.map → useAuth-B1yS_YiD.cjs.map} +1 -1
- package/dist/{useAuth-C-Vw-ggy.js → useAuth-l-itM5am.js} +440 -433
- package/dist/{useAuth-C-Vw-ggy.js.map → useAuth-l-itM5am.js.map} +1 -1
- package/dist/useUsersStatsSummary-9HQDKBU5.js +1879 -0
- package/dist/useUsersStatsSummary-9HQDKBU5.js.map +1 -0
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs +1 -0
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs +0 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs.map +0 -1
- package/dist/AutosaveStatus-DMjvXzP2.js.map +0 -1
- package/dist/EmailRegisterForm-CMXsa-_r.js.map +0 -1
- package/dist/EmailRegisterForm-i7f4St2N.cjs +0 -1
- package/dist/EmailRegisterForm-i7f4St2N.cjs.map +0 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs +0 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs.map +0 -1
- package/dist/GoogleLoginButton-qf4A_A3G.js.map +0 -1
- package/dist/PermissionsSection-B-6DJnN8.cjs +0 -1
- package/dist/SolanaLoginButton-B04dib6X.js.map +0 -1
- package/dist/SolanaLoginButton-nSJHVFpZ.cjs +0 -1
- package/dist/SolanaLoginButton-nSJHVFpZ.cjs.map +0 -1
- package/dist/plugin-BiftIhZe.js.map +0 -1
- package/dist/plugin-BtQdI_Ay.cjs +0 -1
- package/dist/plugin-BtQdI_Ay.cjs.map +0 -1
- package/dist/useAuth-U5CYsHEU.cjs +0 -1
- package/dist/useUsersStatsSummary-5DJwzntC.js +0 -1246
- package/dist/useUsersStatsSummary-5DJwzntC.js.map +0 -1
- package/dist/useUsersStatsSummary-DgKaUIfs.cjs +0 -1
- package/dist/useUsersStatsSummary-DgKaUIfs.cjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as N, useCallback as m, useState as f, useRef as P, useEffect as I } from "react";
|
|
3
|
+
import { u as U } from "./useCedrosLogin-CFfID-0i.js";
|
|
4
|
+
import { u as O } from "./useSystemSettings-rgskaDqP.js";
|
|
5
5
|
function M(t) {
|
|
6
|
-
const
|
|
7
|
-
return { days:
|
|
6
|
+
const i = Math.floor(t / 86400), a = Math.floor(t % 86400 / 3600), n = Math.floor(t % 3600 / 60), r = t % 60;
|
|
7
|
+
return { days: i, hours: a, minutes: n, seconds: r };
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const { days:
|
|
11
|
-
return
|
|
9
|
+
function q(t) {
|
|
10
|
+
const { days: i, hours: a, minutes: n } = M(t), r = [];
|
|
11
|
+
return i > 0 && r.push(`${i}d`), a > 0 && r.push(`${a}h`), n > 0 && r.push(`${n}m`), r.length === 0 && r.push(`${t}s`), r.join(" ");
|
|
12
12
|
}
|
|
13
13
|
const W = {
|
|
14
14
|
// ============= Authentication Providers =============
|
|
@@ -188,6 +188,65 @@ const W = {
|
|
|
188
188
|
description: "Allow users to initiate withdrawals from their embedded wallet to external addresses. This is separate from the automated privacy withdrawal worker, which moves funds from the privacy pool to the treasury.",
|
|
189
189
|
inputType: "boolean"
|
|
190
190
|
},
|
|
191
|
+
feature_referrals_enabled: {
|
|
192
|
+
key: "feature_referrals_enabled",
|
|
193
|
+
label: "Referral System",
|
|
194
|
+
description: "Enable the referral system. Each user gets a unique referral code they can share. New users can register with a referral code to track who invited them.",
|
|
195
|
+
inputType: "boolean"
|
|
196
|
+
},
|
|
197
|
+
referral_reward_lamports: {
|
|
198
|
+
key: "referral_reward_lamports",
|
|
199
|
+
label: "Referral Reward Amount (lamports)",
|
|
200
|
+
description: "Amount of credits to reward the referrer (in smallest unit: lamports for SOL, micros for USD). Set to 0 to disable referral rewards. For example, 1000000000 = 1 SOL.",
|
|
201
|
+
inputType: "text"
|
|
202
|
+
},
|
|
203
|
+
referral_reward_max_per_referrer: {
|
|
204
|
+
key: "referral_reward_max_per_referrer",
|
|
205
|
+
label: "Max Reward Per Referrer",
|
|
206
|
+
description: "Maximum total reward amount a single referrer can earn (in smallest unit). Set to 0 for unlimited. Applies to direct payout mode only.",
|
|
207
|
+
inputType: "text"
|
|
208
|
+
},
|
|
209
|
+
referral_reward_type: {
|
|
210
|
+
key: "referral_reward_type",
|
|
211
|
+
label: "Referral Reward Type",
|
|
212
|
+
description: `How referral rewards are issued. "Credits" adds balance to the referrer's in-app credit account. "Direct payout" queues an on-chain transfer to the referrer's configured payout wallet address.`,
|
|
213
|
+
inputType: "select",
|
|
214
|
+
presets: [
|
|
215
|
+
{ label: "Credits", value: "credits" },
|
|
216
|
+
{ label: "Direct payout (on-chain)", value: "direct_payout" }
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
referral_reward_trigger: {
|
|
220
|
+
key: "referral_reward_trigger",
|
|
221
|
+
label: "Referral Reward Trigger",
|
|
222
|
+
description: 'When to issue the referral reward to the referrer. "On signup" rewards immediately when the referred user registers. "On first purchase" rewards only after the referred user makes their first spend. "On every purchase" rewards the referrer on each spend by the referred user.',
|
|
223
|
+
inputType: "select",
|
|
224
|
+
presets: [
|
|
225
|
+
{ label: "On signup", value: "on_signup" },
|
|
226
|
+
{ label: "On first purchase", value: "on_first_spend" },
|
|
227
|
+
{ label: "On every purchase", value: "on_every_spend" }
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
// ============= Payout Worker Settings =============
|
|
231
|
+
payout_auto_enabled: {
|
|
232
|
+
key: "payout_auto_enabled",
|
|
233
|
+
label: "Auto-Process Payouts",
|
|
234
|
+
description: "Enable the automated payout worker that periodically processes pending referral payouts on-chain. When disabled, payouts must be processed manually from the admin dashboard.",
|
|
235
|
+
inputType: "boolean"
|
|
236
|
+
},
|
|
237
|
+
payout_poll_interval_secs: {
|
|
238
|
+
key: "payout_poll_interval_secs",
|
|
239
|
+
label: "Payout Poll Interval",
|
|
240
|
+
description: "How often the payout worker checks for pending payouts (in seconds). Default: 3600 (1 hour). Lower values mean faster payouts but more frequent treasury key decryption.",
|
|
241
|
+
inputType: "duration",
|
|
242
|
+
unit: "seconds"
|
|
243
|
+
},
|
|
244
|
+
payout_batch_size: {
|
|
245
|
+
key: "payout_batch_size",
|
|
246
|
+
label: "Payout Batch Size",
|
|
247
|
+
description: "Maximum number of referrer groups to process per worker cycle. Default: 50. Each referrer group aggregates all pending payouts for that referrer into a single transfer.",
|
|
248
|
+
inputType: "text"
|
|
249
|
+
},
|
|
191
250
|
// ============= Security Settings =============
|
|
192
251
|
security_require_mfa: {
|
|
193
252
|
key: "security_require_mfa",
|
|
@@ -1034,6 +1093,221 @@ const W = {
|
|
|
1034
1093
|
description: "Custom CDN URL prefix for serving images (e.g., https://cdn.example.com). If empty, images are served directly from the bucket URL.",
|
|
1035
1094
|
inputType: "text",
|
|
1036
1095
|
placeholder: "https://cdn.example.com"
|
|
1096
|
+
},
|
|
1097
|
+
// ============= KYC / Identity Verification =============
|
|
1098
|
+
kyc_enabled: {
|
|
1099
|
+
key: "kyc_enabled",
|
|
1100
|
+
label: "Enable KYC Verification",
|
|
1101
|
+
description: "Enable identity verification for users via Stripe Identity.",
|
|
1102
|
+
inputType: "boolean"
|
|
1103
|
+
},
|
|
1104
|
+
kyc_provider: {
|
|
1105
|
+
key: "kyc_provider",
|
|
1106
|
+
label: "KYC Provider",
|
|
1107
|
+
description: "Identity verification provider.",
|
|
1108
|
+
inputType: "select",
|
|
1109
|
+
presets: [{ label: "Stripe Identity", value: "stripe" }]
|
|
1110
|
+
},
|
|
1111
|
+
kyc_api_secret_key: {
|
|
1112
|
+
key: "kyc_api_secret_key",
|
|
1113
|
+
label: "Stripe Secret Key",
|
|
1114
|
+
description: "Stripe API secret key for Identity API calls (sk_live_... or sk_test_...).",
|
|
1115
|
+
inputType: "secret",
|
|
1116
|
+
placeholder: "sk_..."
|
|
1117
|
+
},
|
|
1118
|
+
kyc_webhook_secret: {
|
|
1119
|
+
key: "kyc_webhook_secret",
|
|
1120
|
+
label: "Webhook Signing Secret",
|
|
1121
|
+
description: "Stripe webhook endpoint secret for verifying webhook signatures (whsec_...).",
|
|
1122
|
+
inputType: "secret",
|
|
1123
|
+
placeholder: "whsec_..."
|
|
1124
|
+
},
|
|
1125
|
+
kyc_enforcement_mode: {
|
|
1126
|
+
key: "kyc_enforcement_mode",
|
|
1127
|
+
label: "Enforcement Mode",
|
|
1128
|
+
description: 'When to require KYC verification. "None" disables enforcement. "Optional" lets users verify voluntarily.',
|
|
1129
|
+
inputType: "select",
|
|
1130
|
+
presets: [
|
|
1131
|
+
{ label: "None (disabled)", value: "none" },
|
|
1132
|
+
{ label: "Withdrawals only", value: "withdrawals" },
|
|
1133
|
+
{ label: "Deposits only", value: "deposits" },
|
|
1134
|
+
{ label: "All financial operations", value: "all" },
|
|
1135
|
+
{ label: "Optional (user choice)", value: "optional" }
|
|
1136
|
+
]
|
|
1137
|
+
},
|
|
1138
|
+
kyc_expiry_days: {
|
|
1139
|
+
key: "kyc_expiry_days",
|
|
1140
|
+
label: "Verification Expiry",
|
|
1141
|
+
description: "How long a verification remains valid. Set to 0 for no expiry.",
|
|
1142
|
+
inputType: "select",
|
|
1143
|
+
presets: [
|
|
1144
|
+
{ label: "Never expires", value: "0" },
|
|
1145
|
+
{ label: "90 days", value: "90" },
|
|
1146
|
+
{ label: "365 days", value: "365" }
|
|
1147
|
+
]
|
|
1148
|
+
},
|
|
1149
|
+
kyc_redirect_url: {
|
|
1150
|
+
key: "kyc_redirect_url",
|
|
1151
|
+
label: "Return URL",
|
|
1152
|
+
description: "URL where users are redirected after completing Stripe Identity verification.",
|
|
1153
|
+
inputType: "text",
|
|
1154
|
+
placeholder: "https://app.example.com/kyc/callback"
|
|
1155
|
+
},
|
|
1156
|
+
kyc_document_types: {
|
|
1157
|
+
key: "kyc_document_types",
|
|
1158
|
+
label: "Accepted Document Types",
|
|
1159
|
+
description: "Comma-separated list of accepted document types: driving_license, id_card, passport.",
|
|
1160
|
+
inputType: "text",
|
|
1161
|
+
placeholder: "driving_license,id_card,passport"
|
|
1162
|
+
},
|
|
1163
|
+
kyc_require_selfie: {
|
|
1164
|
+
key: "kyc_require_selfie",
|
|
1165
|
+
label: "Require Selfie",
|
|
1166
|
+
description: "Require a selfie photo that matches the document photo for identity verification.",
|
|
1167
|
+
inputType: "boolean"
|
|
1168
|
+
},
|
|
1169
|
+
kyc_cumulative_deposit_usd: {
|
|
1170
|
+
key: "kyc_cumulative_deposit_usd",
|
|
1171
|
+
label: "Cumulative Deposit Threshold (USD)",
|
|
1172
|
+
description: "Require KYC when a user's total deposits exceed this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
|
|
1173
|
+
inputType: "text",
|
|
1174
|
+
placeholder: "0",
|
|
1175
|
+
unit: "USD"
|
|
1176
|
+
},
|
|
1177
|
+
kyc_single_deposit_usd: {
|
|
1178
|
+
key: "kyc_single_deposit_usd",
|
|
1179
|
+
label: "Single Deposit Threshold (USD)",
|
|
1180
|
+
description: "Require KYC when any individual deposit exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
|
|
1181
|
+
inputType: "text",
|
|
1182
|
+
placeholder: "0",
|
|
1183
|
+
unit: "USD"
|
|
1184
|
+
},
|
|
1185
|
+
kyc_single_purchase_usd: {
|
|
1186
|
+
key: "kyc_single_purchase_usd",
|
|
1187
|
+
label: "Single Purchase Threshold (USD)",
|
|
1188
|
+
description: "Require KYC when any individual credit spend/purchase exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
|
|
1189
|
+
inputType: "text",
|
|
1190
|
+
placeholder: "0",
|
|
1191
|
+
unit: "USD"
|
|
1192
|
+
},
|
|
1193
|
+
// ============= Sanctions Screening =============
|
|
1194
|
+
sanctions_enabled: {
|
|
1195
|
+
key: "sanctions_enabled",
|
|
1196
|
+
label: "Enable Sanctions Screening",
|
|
1197
|
+
description: "Block transactions to or from wallet addresses that appear on the sanctions list fetched from the configured API URL.",
|
|
1198
|
+
inputType: "boolean"
|
|
1199
|
+
},
|
|
1200
|
+
sanctions_api_url: {
|
|
1201
|
+
key: "sanctions_api_url",
|
|
1202
|
+
label: "Sanctions API URL",
|
|
1203
|
+
description: "Base URL for the sanctions list API (e.g. <code>https://sunscreen.cedros.io</code>). The service calls <code>GET {url}/v1/lists</code>.",
|
|
1204
|
+
inputType: "text",
|
|
1205
|
+
placeholder: "https://sunscreen.cedros.io"
|
|
1206
|
+
},
|
|
1207
|
+
sanctions_refresh_interval_secs: {
|
|
1208
|
+
key: "sanctions_refresh_interval_secs",
|
|
1209
|
+
label: "Refresh Interval",
|
|
1210
|
+
description: "How often to re-fetch the sanctions list. Minimum 60 seconds.",
|
|
1211
|
+
inputType: "text",
|
|
1212
|
+
unit: "seconds",
|
|
1213
|
+
placeholder: "3600"
|
|
1214
|
+
},
|
|
1215
|
+
sanctions_geoip_header: {
|
|
1216
|
+
key: "sanctions_geoip_header",
|
|
1217
|
+
label: "GeoIP Country Header",
|
|
1218
|
+
description: "HTTP header containing the client's ISO country code. Common values: <code>CF-IPCountry</code> (Cloudflare), <code>X-Vercel-IP-Country</code> (Vercel). Leave empty to disable country screening.",
|
|
1219
|
+
inputType: "text",
|
|
1220
|
+
placeholder: "CF-IPCountry"
|
|
1221
|
+
},
|
|
1222
|
+
// ============= Accredited Investor Verification =============
|
|
1223
|
+
accreditation_enabled: {
|
|
1224
|
+
key: "accreditation_enabled",
|
|
1225
|
+
label: "Enable Accreditation Verification",
|
|
1226
|
+
description: "Enable accredited investor self-service verification.",
|
|
1227
|
+
inputType: "boolean"
|
|
1228
|
+
},
|
|
1229
|
+
accreditation_enforcement_mode: {
|
|
1230
|
+
key: "accreditation_enforcement_mode",
|
|
1231
|
+
label: "Enforcement Mode",
|
|
1232
|
+
description: "When to require accreditation.",
|
|
1233
|
+
inputType: "select",
|
|
1234
|
+
presets: [
|
|
1235
|
+
{ label: "None (disabled)", value: "none" },
|
|
1236
|
+
{ label: "Optional (user choice)", value: "optional" },
|
|
1237
|
+
{ label: "Required", value: "required" }
|
|
1238
|
+
]
|
|
1239
|
+
},
|
|
1240
|
+
accreditation_default_expiry_days_income: {
|
|
1241
|
+
key: "accreditation_default_expiry_days_income",
|
|
1242
|
+
label: "Income/Net Worth Expiry",
|
|
1243
|
+
description: "Default validity for income and net worth verifications.",
|
|
1244
|
+
inputType: "text",
|
|
1245
|
+
unit: "days",
|
|
1246
|
+
placeholder: "365"
|
|
1247
|
+
},
|
|
1248
|
+
accreditation_default_expiry_days_letter: {
|
|
1249
|
+
key: "accreditation_default_expiry_days_letter",
|
|
1250
|
+
label: "Letter Expiry",
|
|
1251
|
+
description: "Default validity for third-party verification letters.",
|
|
1252
|
+
inputType: "text",
|
|
1253
|
+
unit: "days",
|
|
1254
|
+
placeholder: "90"
|
|
1255
|
+
},
|
|
1256
|
+
accreditation_default_expiry_days_credential: {
|
|
1257
|
+
key: "accreditation_default_expiry_days_credential",
|
|
1258
|
+
label: "Credential Expiry",
|
|
1259
|
+
description: "Default validity for FINRA credential verifications.",
|
|
1260
|
+
inputType: "text",
|
|
1261
|
+
unit: "days",
|
|
1262
|
+
placeholder: "365"
|
|
1263
|
+
},
|
|
1264
|
+
accreditation_max_upload_size_mb: {
|
|
1265
|
+
key: "accreditation_max_upload_size_mb",
|
|
1266
|
+
label: "Max Upload Size",
|
|
1267
|
+
description: "Maximum file size per document upload.",
|
|
1268
|
+
inputType: "text",
|
|
1269
|
+
unit: "MB",
|
|
1270
|
+
placeholder: "10"
|
|
1271
|
+
},
|
|
1272
|
+
accreditation_income_threshold_individual: {
|
|
1273
|
+
key: "accreditation_income_threshold_individual",
|
|
1274
|
+
label: "Income Threshold (Individual)",
|
|
1275
|
+
description: "Annual income threshold for individual accreditation (USD).",
|
|
1276
|
+
inputType: "text",
|
|
1277
|
+
unit: "USD",
|
|
1278
|
+
placeholder: "200000"
|
|
1279
|
+
},
|
|
1280
|
+
accreditation_income_threshold_joint: {
|
|
1281
|
+
key: "accreditation_income_threshold_joint",
|
|
1282
|
+
label: "Income Threshold (Joint)",
|
|
1283
|
+
description: "Annual income threshold for joint accreditation (USD).",
|
|
1284
|
+
inputType: "text",
|
|
1285
|
+
unit: "USD",
|
|
1286
|
+
placeholder: "300000"
|
|
1287
|
+
},
|
|
1288
|
+
accreditation_net_worth_threshold: {
|
|
1289
|
+
key: "accreditation_net_worth_threshold",
|
|
1290
|
+
label: "Net Worth Threshold",
|
|
1291
|
+
description: "Net worth threshold excluding primary residence (USD).",
|
|
1292
|
+
inputType: "text",
|
|
1293
|
+
unit: "USD",
|
|
1294
|
+
placeholder: "1000000"
|
|
1295
|
+
},
|
|
1296
|
+
accreditation_investment_threshold_individual: {
|
|
1297
|
+
key: "accreditation_investment_threshold_individual",
|
|
1298
|
+
label: "Investment Threshold (Individual)",
|
|
1299
|
+
description: "Minimum investment commitment for individual simplified verification (USD).",
|
|
1300
|
+
inputType: "text",
|
|
1301
|
+
unit: "USD",
|
|
1302
|
+
placeholder: "200000"
|
|
1303
|
+
},
|
|
1304
|
+
accreditation_investment_threshold_entity: {
|
|
1305
|
+
key: "accreditation_investment_threshold_entity",
|
|
1306
|
+
label: "Investment Threshold (Entity)",
|
|
1307
|
+
description: "Minimum investment commitment for entity simplified verification (USD).",
|
|
1308
|
+
inputType: "text",
|
|
1309
|
+
unit: "USD",
|
|
1310
|
+
placeholder: "1000000"
|
|
1037
1311
|
}
|
|
1038
1312
|
}, ae = {
|
|
1039
1313
|
// Auth providers (sorted alphabetically by subcategory)
|
|
@@ -1117,6 +1391,11 @@ const W = {
|
|
|
1117
1391
|
description: "Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",
|
|
1118
1392
|
icon: ""
|
|
1119
1393
|
},
|
|
1394
|
+
referral: {
|
|
1395
|
+
label: "Referral & Payouts",
|
|
1396
|
+
description: "Configure referral rewards, payout triggers, and the automated payout worker.",
|
|
1397
|
+
icon: ""
|
|
1398
|
+
},
|
|
1120
1399
|
rate_limit: {
|
|
1121
1400
|
label: "Rate Limiting",
|
|
1122
1401
|
description: "Protect the system from abuse by limiting request rates. Balance security with user experience.",
|
|
@@ -1146,6 +1425,21 @@ const W = {
|
|
|
1146
1425
|
label: "Image Storage",
|
|
1147
1426
|
description: "Configure S3-compatible object storage for user avatars and images.",
|
|
1148
1427
|
icon: ""
|
|
1428
|
+
},
|
|
1429
|
+
kyc: {
|
|
1430
|
+
label: "KYC / Identity Verification",
|
|
1431
|
+
description: "Configure identity verification requirements using Stripe Identity.",
|
|
1432
|
+
icon: ""
|
|
1433
|
+
},
|
|
1434
|
+
sanctions: {
|
|
1435
|
+
label: "Sanctions Screening",
|
|
1436
|
+
description: "Block transactions involving wallet addresses on OFAC or custom sanctions lists.",
|
|
1437
|
+
icon: ""
|
|
1438
|
+
},
|
|
1439
|
+
accreditation: {
|
|
1440
|
+
label: "Accredited Investor Verification",
|
|
1441
|
+
description: "Configure accredited investor verification requirements and thresholds per SEC Regulation D.",
|
|
1442
|
+
icon: ""
|
|
1149
1443
|
}
|
|
1150
1444
|
}, R = [
|
|
1151
1445
|
"SOL",
|
|
@@ -1159,70 +1453,70 @@ const W = {
|
|
|
1159
1453
|
"BONK",
|
|
1160
1454
|
"ORE"
|
|
1161
1455
|
];
|
|
1162
|
-
function
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1165
|
-
const
|
|
1166
|
-
return
|
|
1456
|
+
function A(t) {
|
|
1457
|
+
const i = t.split(/(<a\s[^>]*>.*?<\/a>)/g);
|
|
1458
|
+
return i.length === 1 ? t : i.map((a, n) => {
|
|
1459
|
+
const r = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
|
|
1460
|
+
return r ? /* @__PURE__ */ e("a", { href: r[1], target: "_blank", rel: "noopener noreferrer", children: r[2] }, n) : a;
|
|
1167
1461
|
});
|
|
1168
1462
|
}
|
|
1169
|
-
function
|
|
1463
|
+
function ie({
|
|
1170
1464
|
settings: t,
|
|
1171
|
-
edits:
|
|
1465
|
+
edits: i,
|
|
1172
1466
|
onChange: a,
|
|
1173
|
-
externalWarnings:
|
|
1467
|
+
externalWarnings: n
|
|
1174
1468
|
}) {
|
|
1175
|
-
return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((
|
|
1176
|
-
|
|
1469
|
+
return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((r) => /* @__PURE__ */ e(
|
|
1470
|
+
j,
|
|
1177
1471
|
{
|
|
1178
|
-
setting:
|
|
1179
|
-
editValue:
|
|
1472
|
+
setting: r,
|
|
1473
|
+
editValue: i[r.key],
|
|
1180
1474
|
onChange: a,
|
|
1181
|
-
externalWarning:
|
|
1475
|
+
externalWarning: n?.[r.key]
|
|
1182
1476
|
},
|
|
1183
|
-
|
|
1477
|
+
r.key
|
|
1184
1478
|
)) });
|
|
1185
1479
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
if (!
|
|
1190
|
-
const c = parseInt(
|
|
1480
|
+
function j({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
|
|
1481
|
+
const r = W[t.key], s = i ?? t.value, p = i !== void 0 && i !== t.value, l = r?.inputType === "boolean", o = N(() => {
|
|
1482
|
+
if (n) return n;
|
|
1483
|
+
if (!r?.warningThreshold) return null;
|
|
1484
|
+
const c = parseInt(s, 10);
|
|
1191
1485
|
if (isNaN(c)) return null;
|
|
1192
|
-
const { above:
|
|
1193
|
-
return
|
|
1194
|
-
}, [
|
|
1195
|
-
return
|
|
1486
|
+
const { above: y, below: b, message: _ } = r.warningThreshold;
|
|
1487
|
+
return y !== void 0 && c > y || b !== void 0 && c < b ? _ : null;
|
|
1488
|
+
}, [s, r?.warningThreshold, n]);
|
|
1489
|
+
return r ? /* @__PURE__ */ e(
|
|
1196
1490
|
"div",
|
|
1197
1491
|
{
|
|
1198
|
-
className: `cedros-setting-row ${
|
|
1199
|
-
children:
|
|
1200
|
-
/* @__PURE__ */
|
|
1492
|
+
className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${l ? "cedros-setting-row-toggle" : ""}`,
|
|
1493
|
+
children: l ? /* @__PURE__ */ d(T, { children: [
|
|
1494
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
|
|
1201
1495
|
/* @__PURE__ */ e(
|
|
1202
|
-
|
|
1496
|
+
L,
|
|
1203
1497
|
{
|
|
1204
|
-
meta:
|
|
1205
|
-
value:
|
|
1498
|
+
meta: r,
|
|
1499
|
+
value: s,
|
|
1206
1500
|
onChange: (c) => a(t.key, c)
|
|
1207
1501
|
}
|
|
1208
1502
|
),
|
|
1209
1503
|
o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
|
|
1210
1504
|
] }),
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children:
|
|
1213
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children:
|
|
1505
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1506
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
|
|
1507
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children: A(r.description) })
|
|
1214
1508
|
] })
|
|
1215
|
-
] }) : /* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children:
|
|
1218
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children:
|
|
1509
|
+
] }) : /* @__PURE__ */ d(T, { children: [
|
|
1510
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1511
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
|
|
1512
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children: A(r.description) })
|
|
1219
1513
|
] }),
|
|
1220
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-control", children: [
|
|
1221
1515
|
/* @__PURE__ */ e(
|
|
1222
|
-
|
|
1516
|
+
L,
|
|
1223
1517
|
{
|
|
1224
|
-
meta:
|
|
1225
|
-
value:
|
|
1518
|
+
meta: r,
|
|
1519
|
+
value: s,
|
|
1226
1520
|
onChange: (c) => a(t.key, c)
|
|
1227
1521
|
}
|
|
1228
1522
|
),
|
|
@@ -1230,8 +1524,8 @@ function F({ setting: t, editValue: s, onChange: a, externalWarning: r }) {
|
|
|
1230
1524
|
] })
|
|
1231
1525
|
] })
|
|
1232
1526
|
}
|
|
1233
|
-
) : /* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1527
|
+
) : /* @__PURE__ */ d("div", { className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""}`, children: [
|
|
1528
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1235
1529
|
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: t.key }),
|
|
1236
1530
|
t.description && /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: t.description })
|
|
1237
1531
|
] }),
|
|
@@ -1239,22 +1533,22 @@ function F({ setting: t, editValue: s, onChange: a, externalWarning: r }) {
|
|
|
1239
1533
|
"input",
|
|
1240
1534
|
{
|
|
1241
1535
|
type: "text",
|
|
1242
|
-
value:
|
|
1536
|
+
value: s,
|
|
1243
1537
|
onChange: (c) => a(t.key, c.target.value),
|
|
1244
1538
|
className: "cedros-setting-input"
|
|
1245
1539
|
}
|
|
1246
1540
|
) })
|
|
1247
1541
|
] });
|
|
1248
1542
|
}
|
|
1249
|
-
function
|
|
1543
|
+
function L({ meta: t, value: i, onChange: a }) {
|
|
1250
1544
|
switch (t.inputType) {
|
|
1251
1545
|
case "duration":
|
|
1252
|
-
return /* @__PURE__ */ e(
|
|
1546
|
+
return /* @__PURE__ */ e(F, { value: i, onChange: a, presets: t.presets, min: t.min });
|
|
1253
1547
|
case "percentage":
|
|
1254
1548
|
return /* @__PURE__ */ e(
|
|
1255
1549
|
$,
|
|
1256
1550
|
{
|
|
1257
|
-
value:
|
|
1551
|
+
value: i,
|
|
1258
1552
|
onChange: a,
|
|
1259
1553
|
min: t.min ?? 1,
|
|
1260
1554
|
max: t.max ?? 100,
|
|
@@ -1264,9 +1558,9 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1264
1558
|
);
|
|
1265
1559
|
case "select":
|
|
1266
1560
|
return /* @__PURE__ */ e(
|
|
1267
|
-
|
|
1561
|
+
V,
|
|
1268
1562
|
{
|
|
1269
|
-
value:
|
|
1563
|
+
value: i,
|
|
1270
1564
|
onChange: a,
|
|
1271
1565
|
presets: t.presets ?? [],
|
|
1272
1566
|
unit: t.unit
|
|
@@ -1274,9 +1568,9 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1274
1568
|
);
|
|
1275
1569
|
case "number":
|
|
1276
1570
|
return /* @__PURE__ */ e(
|
|
1277
|
-
|
|
1571
|
+
B,
|
|
1278
1572
|
{
|
|
1279
|
-
value:
|
|
1573
|
+
value: i,
|
|
1280
1574
|
onChange: a,
|
|
1281
1575
|
min: t.min,
|
|
1282
1576
|
max: t.max,
|
|
@@ -1284,57 +1578,57 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1284
1578
|
}
|
|
1285
1579
|
);
|
|
1286
1580
|
case "tokenList":
|
|
1287
|
-
return /* @__PURE__ */ e(
|
|
1581
|
+
return /* @__PURE__ */ e(J, { value: i, onChange: a });
|
|
1288
1582
|
case "text":
|
|
1289
1583
|
return /* @__PURE__ */ e(
|
|
1290
1584
|
"input",
|
|
1291
1585
|
{
|
|
1292
1586
|
type: "text",
|
|
1293
|
-
value:
|
|
1294
|
-
onChange: (
|
|
1587
|
+
value: i,
|
|
1588
|
+
onChange: (n) => a(n.target.value),
|
|
1295
1589
|
className: "cedros-setting-input",
|
|
1296
1590
|
placeholder: t.label
|
|
1297
1591
|
}
|
|
1298
1592
|
);
|
|
1299
1593
|
case "boolean":
|
|
1300
|
-
return /* @__PURE__ */ e(
|
|
1594
|
+
return /* @__PURE__ */ e(H, { value: i, onChange: a });
|
|
1301
1595
|
case "secret":
|
|
1302
|
-
return /* @__PURE__ */ e(
|
|
1596
|
+
return /* @__PURE__ */ e(K, { value: i, onChange: a, multiline: t.multiline });
|
|
1303
1597
|
case "readonlySecret":
|
|
1304
|
-
return /* @__PURE__ */ e(
|
|
1598
|
+
return /* @__PURE__ */ e(G, { settingKey: t.key, value: i });
|
|
1305
1599
|
case "tokenSymbolList":
|
|
1306
|
-
return /* @__PURE__ */ e(z, { value:
|
|
1600
|
+
return /* @__PURE__ */ e(z, { value: i, onChange: a });
|
|
1307
1601
|
default:
|
|
1308
1602
|
return /* @__PURE__ */ e(
|
|
1309
1603
|
"input",
|
|
1310
1604
|
{
|
|
1311
1605
|
type: "text",
|
|
1312
|
-
value:
|
|
1313
|
-
onChange: (
|
|
1606
|
+
value: i,
|
|
1607
|
+
onChange: (n) => a(n.target.value),
|
|
1314
1608
|
className: "cedros-setting-input"
|
|
1315
1609
|
}
|
|
1316
1610
|
);
|
|
1317
1611
|
}
|
|
1318
1612
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const
|
|
1613
|
+
function F({ value: t, onChange: i, presets: a, min: n = 0 }) {
|
|
1614
|
+
const r = parseInt(t, 10) || 0, s = q(r), p = m(
|
|
1321
1615
|
(o) => {
|
|
1322
|
-
o.target.value &&
|
|
1616
|
+
o.target.value && i(o.target.value);
|
|
1323
1617
|
},
|
|
1324
|
-
[
|
|
1325
|
-
),
|
|
1618
|
+
[i]
|
|
1619
|
+
), l = m(
|
|
1326
1620
|
(o) => {
|
|
1327
|
-
const c = Math.max(
|
|
1328
|
-
|
|
1621
|
+
const c = Math.max(n, parseInt(o.target.value, 10) || 0);
|
|
1622
|
+
i(String(c));
|
|
1329
1623
|
},
|
|
1330
|
-
[
|
|
1624
|
+
[i, n]
|
|
1331
1625
|
);
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
a && a.length > 0 && /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ d("div", { className: "cedros-duration-input", children: [
|
|
1627
|
+
a && a.length > 0 && /* @__PURE__ */ d(
|
|
1334
1628
|
"select",
|
|
1335
1629
|
{
|
|
1336
1630
|
value: a.find((o) => o.value === t)?.value ?? "",
|
|
1337
|
-
onChange:
|
|
1631
|
+
onChange: p,
|
|
1338
1632
|
className: "cedros-setting-select",
|
|
1339
1633
|
children: [
|
|
1340
1634
|
/* @__PURE__ */ e("option", { value: "", children: "Custom..." }),
|
|
@@ -1342,64 +1636,64 @@ function q({ value: t, onChange: s, presets: a, min: r = 0 }) {
|
|
|
1342
1636
|
]
|
|
1343
1637
|
}
|
|
1344
1638
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ d("div", { className: "cedros-duration-custom", children: [
|
|
1346
1640
|
/* @__PURE__ */ e(
|
|
1347
1641
|
"input",
|
|
1348
1642
|
{
|
|
1349
1643
|
type: "number",
|
|
1350
|
-
value:
|
|
1351
|
-
onChange:
|
|
1352
|
-
min:
|
|
1644
|
+
value: r,
|
|
1645
|
+
onChange: l,
|
|
1646
|
+
min: n,
|
|
1353
1647
|
className: "cedros-setting-input cedros-setting-input-sm"
|
|
1354
1648
|
}
|
|
1355
1649
|
),
|
|
1356
1650
|
/* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: "seconds" }),
|
|
1357
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ d("span", { className: "cedros-duration-display", children: [
|
|
1358
1652
|
"= ",
|
|
1359
|
-
|
|
1653
|
+
s
|
|
1360
1654
|
] })
|
|
1361
1655
|
] })
|
|
1362
1656
|
] });
|
|
1363
1657
|
}
|
|
1364
1658
|
function $({
|
|
1365
1659
|
value: t,
|
|
1366
|
-
onChange:
|
|
1660
|
+
onChange: i,
|
|
1367
1661
|
min: a,
|
|
1368
|
-
max:
|
|
1369
|
-
step:
|
|
1370
|
-
presets:
|
|
1662
|
+
max: n,
|
|
1663
|
+
step: r,
|
|
1664
|
+
presets: s
|
|
1371
1665
|
}) {
|
|
1372
|
-
const
|
|
1666
|
+
const p = parseInt(t, 10) || a, l = m(
|
|
1373
1667
|
(c) => {
|
|
1374
|
-
|
|
1668
|
+
i(c.target.value);
|
|
1375
1669
|
},
|
|
1376
|
-
[
|
|
1670
|
+
[i]
|
|
1377
1671
|
), o = m(
|
|
1378
1672
|
(c) => {
|
|
1379
|
-
|
|
1673
|
+
i(c);
|
|
1380
1674
|
},
|
|
1381
|
-
[
|
|
1675
|
+
[i]
|
|
1382
1676
|
);
|
|
1383
|
-
return /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ d("div", { className: "cedros-percentage-input", children: [
|
|
1678
|
+
/* @__PURE__ */ d("div", { className: "cedros-percentage-slider-row", children: [
|
|
1385
1679
|
/* @__PURE__ */ e(
|
|
1386
1680
|
"input",
|
|
1387
1681
|
{
|
|
1388
1682
|
type: "range",
|
|
1389
|
-
value:
|
|
1390
|
-
onChange:
|
|
1683
|
+
value: p,
|
|
1684
|
+
onChange: l,
|
|
1391
1685
|
min: a,
|
|
1392
|
-
max:
|
|
1393
|
-
step:
|
|
1686
|
+
max: n,
|
|
1687
|
+
step: r,
|
|
1394
1688
|
className: "cedros-percentage-slider"
|
|
1395
1689
|
}
|
|
1396
1690
|
),
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
|
|
1691
|
+
/* @__PURE__ */ d("span", { className: "cedros-percentage-value", children: [
|
|
1692
|
+
p,
|
|
1399
1693
|
"%"
|
|
1400
1694
|
] })
|
|
1401
1695
|
] }),
|
|
1402
|
-
|
|
1696
|
+
s && s.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-preset-buttons", children: s.map((c) => /* @__PURE__ */ e(
|
|
1403
1697
|
"button",
|
|
1404
1698
|
{
|
|
1405
1699
|
type: "button",
|
|
@@ -1411,79 +1705,79 @@ function $({
|
|
|
1411
1705
|
)) })
|
|
1412
1706
|
] });
|
|
1413
1707
|
}
|
|
1414
|
-
function
|
|
1415
|
-
const
|
|
1416
|
-
(
|
|
1417
|
-
|
|
1708
|
+
function V({ value: t, onChange: i, presets: a, unit: n }) {
|
|
1709
|
+
const r = !a.some((l) => l.value === t), s = m(
|
|
1710
|
+
(l) => {
|
|
1711
|
+
l.target.value !== "__custom__" && i(l.target.value);
|
|
1418
1712
|
},
|
|
1419
|
-
[
|
|
1420
|
-
),
|
|
1421
|
-
(
|
|
1422
|
-
|
|
1713
|
+
[i]
|
|
1714
|
+
), p = m(
|
|
1715
|
+
(l) => {
|
|
1716
|
+
i(l.target.value);
|
|
1423
1717
|
},
|
|
1424
|
-
[
|
|
1718
|
+
[i]
|
|
1425
1719
|
);
|
|
1426
|
-
return /* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ d("div", { className: "cedros-select-input", children: [
|
|
1721
|
+
/* @__PURE__ */ d(
|
|
1428
1722
|
"select",
|
|
1429
1723
|
{
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1724
|
+
value: r ? "__custom__" : t,
|
|
1725
|
+
onChange: s,
|
|
1432
1726
|
className: "cedros-setting-select",
|
|
1433
1727
|
children: [
|
|
1434
|
-
a.map((
|
|
1728
|
+
a.map((l) => /* @__PURE__ */ e("option", { value: l.value, children: l.label }, l.value)),
|
|
1435
1729
|
/* @__PURE__ */ e("option", { value: "__custom__", children: "Custom..." })
|
|
1436
1730
|
]
|
|
1437
1731
|
}
|
|
1438
1732
|
),
|
|
1439
|
-
|
|
1733
|
+
r && /* @__PURE__ */ d("div", { className: "cedros-select-custom", children: [
|
|
1440
1734
|
/* @__PURE__ */ e(
|
|
1441
1735
|
"input",
|
|
1442
1736
|
{
|
|
1443
1737
|
type: "number",
|
|
1444
1738
|
value: t,
|
|
1445
|
-
onChange:
|
|
1739
|
+
onChange: p,
|
|
1446
1740
|
className: "cedros-setting-input cedros-setting-input-sm"
|
|
1447
1741
|
}
|
|
1448
1742
|
),
|
|
1449
|
-
|
|
1743
|
+
n && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: n })
|
|
1450
1744
|
] })
|
|
1451
1745
|
] });
|
|
1452
1746
|
}
|
|
1453
|
-
function
|
|
1454
|
-
const
|
|
1455
|
-
(
|
|
1456
|
-
|
|
1747
|
+
function B({ value: t, onChange: i, min: a, max: n, unit: r }) {
|
|
1748
|
+
const s = m(
|
|
1749
|
+
(p) => {
|
|
1750
|
+
i(p.target.value);
|
|
1457
1751
|
},
|
|
1458
|
-
[
|
|
1752
|
+
[i]
|
|
1459
1753
|
);
|
|
1460
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ d("div", { className: "cedros-number-input", children: [
|
|
1461
1755
|
/* @__PURE__ */ e(
|
|
1462
1756
|
"input",
|
|
1463
1757
|
{
|
|
1464
1758
|
type: "number",
|
|
1465
1759
|
value: t,
|
|
1466
|
-
onChange:
|
|
1760
|
+
onChange: s,
|
|
1467
1761
|
min: a,
|
|
1468
|
-
max:
|
|
1762
|
+
max: n,
|
|
1469
1763
|
className: "cedros-setting-input"
|
|
1470
1764
|
}
|
|
1471
1765
|
),
|
|
1472
|
-
|
|
1766
|
+
r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
|
|
1473
1767
|
] });
|
|
1474
1768
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const a = t === "true",
|
|
1477
|
-
|
|
1478
|
-
}, [a,
|
|
1479
|
-
return /* @__PURE__ */
|
|
1769
|
+
function H({ value: t, onChange: i }) {
|
|
1770
|
+
const a = t === "true", n = m(() => {
|
|
1771
|
+
i(a ? "false" : "true");
|
|
1772
|
+
}, [a, i]);
|
|
1773
|
+
return /* @__PURE__ */ d(
|
|
1480
1774
|
"button",
|
|
1481
1775
|
{
|
|
1482
1776
|
type: "button",
|
|
1483
1777
|
role: "switch",
|
|
1484
1778
|
"aria-checked": a,
|
|
1485
1779
|
className: `cedros-toggle ${a ? "cedros-toggle-on" : "cedros-toggle-off"}`,
|
|
1486
|
-
onClick:
|
|
1780
|
+
onClick: n,
|
|
1487
1781
|
children: [
|
|
1488
1782
|
/* @__PURE__ */ e("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ e("span", { className: "cedros-toggle-thumb" }) }),
|
|
1489
1783
|
/* @__PURE__ */ e("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
|
|
@@ -1491,26 +1785,26 @@ function V({ value: t, onChange: s }) {
|
|
|
1491
1785
|
}
|
|
1492
1786
|
);
|
|
1493
1787
|
}
|
|
1494
|
-
function
|
|
1495
|
-
const [
|
|
1496
|
-
|
|
1788
|
+
function K({ value: t, onChange: i, multiline: a }) {
|
|
1789
|
+
const [n, r] = f(!1), [s, p] = f(!1), l = t && t.length > 0, o = m(() => {
|
|
1790
|
+
r(!0), p(!0);
|
|
1497
1791
|
}, []), c = m(() => {
|
|
1498
|
-
|
|
1499
|
-
}, []),
|
|
1500
|
-
(
|
|
1501
|
-
|
|
1792
|
+
r(!1), p(!1);
|
|
1793
|
+
}, []), y = m(
|
|
1794
|
+
(b) => {
|
|
1795
|
+
i(b.target.value);
|
|
1502
1796
|
},
|
|
1503
|
-
[
|
|
1797
|
+
[i]
|
|
1504
1798
|
);
|
|
1505
|
-
return !
|
|
1799
|
+
return !n && l ? /* @__PURE__ */ d("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
|
|
1506
1800
|
/* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
|
|
1507
1801
|
/* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
|
|
1508
|
-
] }) : /* @__PURE__ */
|
|
1802
|
+
] }) : /* @__PURE__ */ d("div", { className: "cedros-secret-input", children: [
|
|
1509
1803
|
a ? /* @__PURE__ */ e(
|
|
1510
1804
|
"textarea",
|
|
1511
1805
|
{
|
|
1512
1806
|
value: t,
|
|
1513
|
-
onChange:
|
|
1807
|
+
onChange: y,
|
|
1514
1808
|
className: "cedros-setting-input cedros-setting-textarea",
|
|
1515
1809
|
placeholder: "Enter secret value...",
|
|
1516
1810
|
rows: 4
|
|
@@ -1518,71 +1812,71 @@ function G({ value: t, onChange: s, multiline: a }) {
|
|
|
1518
1812
|
) : /* @__PURE__ */ e(
|
|
1519
1813
|
"input",
|
|
1520
1814
|
{
|
|
1521
|
-
type:
|
|
1815
|
+
type: s ? "text" : "password",
|
|
1522
1816
|
value: t,
|
|
1523
|
-
onChange:
|
|
1817
|
+
onChange: y,
|
|
1524
1818
|
className: "cedros-setting-input",
|
|
1525
1819
|
placeholder: "Enter secret value..."
|
|
1526
1820
|
}
|
|
1527
1821
|
),
|
|
1528
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ d("div", { className: "cedros-secret-actions", children: [
|
|
1529
1823
|
!a && /* @__PURE__ */ e(
|
|
1530
1824
|
"button",
|
|
1531
1825
|
{
|
|
1532
1826
|
type: "button",
|
|
1533
1827
|
className: "cedros-secret-toggle-btn",
|
|
1534
|
-
onClick: () =>
|
|
1535
|
-
children:
|
|
1828
|
+
onClick: () => p(!s),
|
|
1829
|
+
children: s ? "Hide" : "Show"
|
|
1536
1830
|
}
|
|
1537
1831
|
),
|
|
1538
|
-
|
|
1832
|
+
n && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
|
|
1539
1833
|
] })
|
|
1540
1834
|
] });
|
|
1541
1835
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const [a,
|
|
1544
|
-
if (
|
|
1836
|
+
function G({ settingKey: t, value: i }) {
|
|
1837
|
+
const [a, n] = f(null), [r, s] = f(!1), [p, l] = f(!1), [o, c] = f(null), [y, b] = f(!1), { config: _, _internal: w } = U(), v = a ?? i, x = v && v.length > 0, C = x && !a, h = m(async () => {
|
|
1838
|
+
if (v)
|
|
1545
1839
|
try {
|
|
1546
|
-
await navigator.clipboard.writeText(
|
|
1840
|
+
await navigator.clipboard.writeText(v), s(!0), setTimeout(() => s(!1), 2e3);
|
|
1547
1841
|
} catch {
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1842
|
+
const u = document.createElement("textarea");
|
|
1843
|
+
u.value = v, document.body.appendChild(u), u.select(), document.execCommand("copy"), document.body.removeChild(u), s(!0), setTimeout(() => s(!1), 2e3);
|
|
1550
1844
|
}
|
|
1551
|
-
}, [
|
|
1552
|
-
|
|
1845
|
+
}, [v]), k = m(async () => {
|
|
1846
|
+
l(!0), c(null);
|
|
1553
1847
|
try {
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1848
|
+
const u = w?.getAccessToken?.(), g = { "Content-Type": "application/json" };
|
|
1849
|
+
u && (g.Authorization = `Bearer ${u}`);
|
|
1556
1850
|
const S = await fetch(
|
|
1557
1851
|
`${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
|
|
1558
|
-
{ method: "POST", headers:
|
|
1852
|
+
{ method: "POST", headers: g, credentials: "include" }
|
|
1559
1853
|
);
|
|
1560
1854
|
if (!S.ok) {
|
|
1561
|
-
const
|
|
1562
|
-
throw new Error(
|
|
1855
|
+
const D = await S.json().catch(() => null);
|
|
1856
|
+
throw new Error(D?.message || D?.error || `Regenerate failed (${S.status})`);
|
|
1563
1857
|
}
|
|
1564
1858
|
const E = await S.json();
|
|
1565
|
-
|
|
1566
|
-
} catch (
|
|
1567
|
-
c(
|
|
1859
|
+
n(E.value), b(!1);
|
|
1860
|
+
} catch (u) {
|
|
1861
|
+
c(u instanceof Error ? u.message : "Failed to regenerate");
|
|
1568
1862
|
} finally {
|
|
1569
|
-
|
|
1863
|
+
l(!1);
|
|
1570
1864
|
}
|
|
1571
|
-
}, [_.serverUrl,
|
|
1572
|
-
return /* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */ e("div", { className: "cedros-readonly-secret-value", children: C ? /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(20) }) :
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
|
|
1576
|
-
|
|
1865
|
+
}, [_.serverUrl, w, t]);
|
|
1866
|
+
return /* @__PURE__ */ d("div", { className: "cedros-readonly-secret", children: [
|
|
1867
|
+
/* @__PURE__ */ e("div", { className: "cedros-readonly-secret-value", children: C ? /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(20) }) : x ? /* @__PURE__ */ e("code", { className: "cedros-readonly-secret-code", children: v }) : /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-empty", children: "Not generated yet" }) }),
|
|
1868
|
+
/* @__PURE__ */ d("div", { className: "cedros-readonly-secret-actions", children: [
|
|
1869
|
+
x && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-action-btn", onClick: h, children: r ? "Copied!" : "Copy" }),
|
|
1870
|
+
y ? /* @__PURE__ */ d("span", { className: "cedros-readonly-secret-confirm", children: [
|
|
1577
1871
|
/* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
|
|
1578
1872
|
/* @__PURE__ */ e(
|
|
1579
1873
|
"button",
|
|
1580
1874
|
{
|
|
1581
1875
|
type: "button",
|
|
1582
1876
|
className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
|
|
1583
|
-
onClick:
|
|
1584
|
-
disabled:
|
|
1585
|
-
children:
|
|
1877
|
+
onClick: k,
|
|
1878
|
+
disabled: p,
|
|
1879
|
+
children: p ? "Regenerating..." : "Confirm"
|
|
1586
1880
|
}
|
|
1587
1881
|
),
|
|
1588
1882
|
/* @__PURE__ */ e(
|
|
@@ -1590,8 +1884,8 @@ function H({ settingKey: t, value: s }) {
|
|
|
1590
1884
|
{
|
|
1591
1885
|
type: "button",
|
|
1592
1886
|
className: "cedros-secret-action-btn",
|
|
1593
|
-
onClick: () =>
|
|
1594
|
-
disabled:
|
|
1887
|
+
onClick: () => b(!1),
|
|
1888
|
+
disabled: p,
|
|
1595
1889
|
children: "Cancel"
|
|
1596
1890
|
}
|
|
1597
1891
|
)
|
|
@@ -1600,8 +1894,8 @@ function H({ settingKey: t, value: s }) {
|
|
|
1600
1894
|
{
|
|
1601
1895
|
type: "button",
|
|
1602
1896
|
className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
|
|
1603
|
-
onClick: () =>
|
|
1604
|
-
disabled:
|
|
1897
|
+
onClick: () => b(!0),
|
|
1898
|
+
disabled: p,
|
|
1605
1899
|
children: "Regenerate"
|
|
1606
1900
|
}
|
|
1607
1901
|
)
|
|
@@ -1609,47 +1903,47 @@ function H({ settingKey: t, value: s }) {
|
|
|
1609
1903
|
o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
|
|
1610
1904
|
] });
|
|
1611
1905
|
}
|
|
1612
|
-
function
|
|
1613
|
-
const a =
|
|
1906
|
+
function J({ value: t, onChange: i }) {
|
|
1907
|
+
const a = N(() => {
|
|
1614
1908
|
try {
|
|
1615
1909
|
return JSON.parse(t || "[]");
|
|
1616
1910
|
} catch {
|
|
1617
1911
|
return [];
|
|
1618
1912
|
}
|
|
1619
|
-
}, [t]),
|
|
1620
|
-
(
|
|
1621
|
-
|
|
1913
|
+
}, [t]), n = m(
|
|
1914
|
+
(l) => {
|
|
1915
|
+
i(JSON.stringify(l));
|
|
1622
1916
|
},
|
|
1623
|
-
[
|
|
1624
|
-
),
|
|
1625
|
-
|
|
1626
|
-
}, [a,
|
|
1627
|
-
(
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1917
|
+
[i]
|
|
1918
|
+
), r = m(() => {
|
|
1919
|
+
n([...a, { symbol: "", mint: "", decimals: 6 }]);
|
|
1920
|
+
}, [a, n]), s = m(
|
|
1921
|
+
(l, o, c) => {
|
|
1922
|
+
const y = [...a];
|
|
1923
|
+
y[l] = { ...y[l], [o]: c }, n(y);
|
|
1630
1924
|
},
|
|
1631
|
-
[a,
|
|
1632
|
-
),
|
|
1633
|
-
(
|
|
1634
|
-
|
|
1925
|
+
[a, n]
|
|
1926
|
+
), p = m(
|
|
1927
|
+
(l) => {
|
|
1928
|
+
n(a.filter((o, c) => c !== l));
|
|
1635
1929
|
},
|
|
1636
|
-
[a,
|
|
1930
|
+
[a, n]
|
|
1637
1931
|
);
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1932
|
+
return /* @__PURE__ */ d("div", { className: "cedros-token-list-input", children: [
|
|
1933
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
|
|
1640
1934
|
/* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
|
|
1641
|
-
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((
|
|
1935
|
+
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((l) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: l }, l)) })
|
|
1642
1936
|
] }),
|
|
1643
1937
|
a.length === 0 && /* @__PURE__ */ e("p", { className: "cedros-token-list-empty", children: "No custom tokens added. Use the built-in tokens above or add your own." }),
|
|
1644
|
-
a.map((
|
|
1645
|
-
/* @__PURE__ */
|
|
1938
|
+
a.map((l, o) => /* @__PURE__ */ d("div", { className: "cedros-token-row", children: [
|
|
1939
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-row-fields", children: [
|
|
1646
1940
|
/* @__PURE__ */ e(
|
|
1647
1941
|
"input",
|
|
1648
1942
|
{
|
|
1649
1943
|
type: "text",
|
|
1650
1944
|
placeholder: "Symbol",
|
|
1651
|
-
value:
|
|
1652
|
-
onChange: (c) =>
|
|
1945
|
+
value: l.symbol,
|
|
1946
|
+
onChange: (c) => s(o, "symbol", c.target.value.toUpperCase()),
|
|
1653
1947
|
className: "cedros-setting-input cedros-token-input-symbol",
|
|
1654
1948
|
maxLength: 10
|
|
1655
1949
|
}
|
|
@@ -1659,8 +1953,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1659
1953
|
{
|
|
1660
1954
|
type: "text",
|
|
1661
1955
|
placeholder: "Mint address",
|
|
1662
|
-
value:
|
|
1663
|
-
onChange: (c) =>
|
|
1956
|
+
value: l.mint,
|
|
1957
|
+
onChange: (c) => s(o, "mint", c.target.value),
|
|
1664
1958
|
className: "cedros-setting-input cedros-token-input-mint"
|
|
1665
1959
|
}
|
|
1666
1960
|
),
|
|
@@ -1669,8 +1963,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1669
1963
|
{
|
|
1670
1964
|
type: "number",
|
|
1671
1965
|
placeholder: "Decimals",
|
|
1672
|
-
value:
|
|
1673
|
-
onChange: (c) =>
|
|
1966
|
+
value: l.decimals,
|
|
1967
|
+
onChange: (c) => s(o, "decimals", parseInt(c.target.value, 10) || 0),
|
|
1674
1968
|
className: "cedros-setting-input cedros-token-input-decimals",
|
|
1675
1969
|
min: 0,
|
|
1676
1970
|
max: 18
|
|
@@ -1681,8 +1975,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1681
1975
|
{
|
|
1682
1976
|
type: "text",
|
|
1683
1977
|
placeholder: "Logo URL (optional)",
|
|
1684
|
-
value:
|
|
1685
|
-
onChange: (c) =>
|
|
1978
|
+
value: l.logoUrl || "",
|
|
1979
|
+
onChange: (c) => s(o, "logoUrl", c.target.value || void 0),
|
|
1686
1980
|
className: "cedros-setting-input cedros-token-input-logo"
|
|
1687
1981
|
}
|
|
1688
1982
|
)
|
|
@@ -1692,48 +1986,48 @@ function K({ value: t, onChange: s }) {
|
|
|
1692
1986
|
{
|
|
1693
1987
|
type: "button",
|
|
1694
1988
|
className: "cedros-token-remove-btn",
|
|
1695
|
-
onClick: () =>
|
|
1989
|
+
onClick: () => p(o),
|
|
1696
1990
|
title: "Remove token",
|
|
1697
1991
|
children: "×"
|
|
1698
1992
|
}
|
|
1699
1993
|
)
|
|
1700
1994
|
] }, o)),
|
|
1701
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick:
|
|
1995
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: r, children: "+ Add Token" })
|
|
1702
1996
|
] });
|
|
1703
1997
|
}
|
|
1704
|
-
function z({ value: t, onChange:
|
|
1705
|
-
const a =
|
|
1706
|
-
(
|
|
1707
|
-
if (!
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1998
|
+
function z({ value: t, onChange: i }) {
|
|
1999
|
+
const a = N(() => t.split(",").map((s) => s.trim()).filter(Boolean), [t]), n = m(
|
|
2000
|
+
(s) => {
|
|
2001
|
+
if (!s || a.includes(s)) return;
|
|
2002
|
+
const p = [...a, s].join(", ");
|
|
2003
|
+
i(p);
|
|
1710
2004
|
},
|
|
1711
|
-
[a,
|
|
1712
|
-
),
|
|
1713
|
-
(
|
|
1714
|
-
const
|
|
1715
|
-
|
|
2005
|
+
[a, i]
|
|
2006
|
+
), r = m(
|
|
2007
|
+
(s) => {
|
|
2008
|
+
const p = a.filter((l) => l !== s).join(", ");
|
|
2009
|
+
i(p);
|
|
1716
2010
|
},
|
|
1717
|
-
[a,
|
|
2011
|
+
[a, i]
|
|
1718
2012
|
);
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
2013
|
+
return /* @__PURE__ */ d("div", { className: "cedros-token-symbol-list-input", children: [
|
|
2014
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
|
|
1721
2015
|
/* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
|
|
1722
|
-
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((
|
|
1723
|
-
const
|
|
1724
|
-
return /* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((s) => {
|
|
2017
|
+
const p = a.includes(s);
|
|
2018
|
+
return /* @__PURE__ */ d(
|
|
1725
2019
|
"button",
|
|
1726
2020
|
{
|
|
1727
2021
|
type: "button",
|
|
1728
|
-
className: `cedros-token-preset-chip ${
|
|
1729
|
-
onClick: () =>
|
|
1730
|
-
title:
|
|
2022
|
+
className: `cedros-token-preset-chip ${p ? "cedros-token-preset-chip-selected" : ""}`,
|
|
2023
|
+
onClick: () => p ? r(s) : n(s),
|
|
2024
|
+
title: p ? `Remove ${s}` : `Add ${s}`,
|
|
1731
2025
|
children: [
|
|
1732
|
-
|
|
1733
|
-
|
|
2026
|
+
s,
|
|
2027
|
+
p && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
|
|
1734
2028
|
]
|
|
1735
2029
|
},
|
|
1736
|
-
|
|
2030
|
+
s
|
|
1737
2031
|
);
|
|
1738
2032
|
}) })
|
|
1739
2033
|
] }),
|
|
@@ -1742,7 +2036,7 @@ function z({ value: t, onChange: s }) {
|
|
|
1742
2036
|
{
|
|
1743
2037
|
type: "text",
|
|
1744
2038
|
value: t,
|
|
1745
|
-
onChange: (
|
|
2039
|
+
onChange: (s) => i(s.target.value),
|
|
1746
2040
|
className: "cedros-setting-input",
|
|
1747
2041
|
placeholder: "USDC, SOL, BONK..."
|
|
1748
2042
|
}
|
|
@@ -1750,91 +2044,91 @@ function z({ value: t, onChange: s }) {
|
|
|
1750
2044
|
] });
|
|
1751
2045
|
}
|
|
1752
2046
|
const Y = 800, X = 2e3;
|
|
1753
|
-
function
|
|
1754
|
-
const { settings: t, isLoading:
|
|
1755
|
-
|
|
1756
|
-
|
|
2047
|
+
function re() {
|
|
2048
|
+
const { settings: t, isLoading: i, error: a, fetchSettings: n, updateSettings: r } = O(), [s, p] = f({}), [l, o] = f("idle"), [c, y] = f(null), b = P(null), _ = P(null), w = P({});
|
|
2049
|
+
I(() => () => {
|
|
2050
|
+
b.current && clearTimeout(b.current), _.current && clearTimeout(_.current);
|
|
1757
2051
|
}, []);
|
|
1758
|
-
const
|
|
1759
|
-
const
|
|
1760
|
-
if (Object.keys(
|
|
2052
|
+
const v = m(async () => {
|
|
2053
|
+
const h = { ...w.current };
|
|
2054
|
+
if (Object.keys(h).length === 0) {
|
|
1761
2055
|
o("idle");
|
|
1762
2056
|
return;
|
|
1763
2057
|
}
|
|
1764
|
-
o("saving"),
|
|
1765
|
-
const
|
|
1766
|
-
key:
|
|
1767
|
-
value:
|
|
2058
|
+
o("saving"), y(null);
|
|
2059
|
+
const k = Object.entries(h).map(([u, g]) => ({
|
|
2060
|
+
key: u,
|
|
2061
|
+
value: g
|
|
1768
2062
|
}));
|
|
1769
2063
|
try {
|
|
1770
|
-
await
|
|
1771
|
-
const
|
|
1772
|
-
for (const S of Object.keys(
|
|
1773
|
-
delete
|
|
1774
|
-
return
|
|
2064
|
+
await r(k), p((u) => {
|
|
2065
|
+
const g = { ...u };
|
|
2066
|
+
for (const S of Object.keys(h))
|
|
2067
|
+
delete g[S];
|
|
2068
|
+
return g;
|
|
1775
2069
|
});
|
|
1776
|
-
for (const
|
|
1777
|
-
delete
|
|
2070
|
+
for (const u of Object.keys(h))
|
|
2071
|
+
delete w.current[u];
|
|
1778
2072
|
o("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
|
|
1779
2073
|
o("idle");
|
|
1780
2074
|
}, X);
|
|
1781
|
-
} catch (
|
|
1782
|
-
o("error"),
|
|
2075
|
+
} catch (u) {
|
|
2076
|
+
o("error"), y(u instanceof Error ? u.message : "Failed to save");
|
|
1783
2077
|
}
|
|
1784
|
-
}, [
|
|
1785
|
-
(
|
|
1786
|
-
|
|
1787
|
-
|
|
2078
|
+
}, [r]), x = m(
|
|
2079
|
+
(h, k) => {
|
|
2080
|
+
p((u) => ({ ...u, [h]: k })), w.current[h] = k, y(null), o("pending"), b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
2081
|
+
v();
|
|
1788
2082
|
}, Y);
|
|
1789
2083
|
},
|
|
1790
|
-
[
|
|
2084
|
+
[v]
|
|
1791
2085
|
), C = m(
|
|
1792
|
-
(
|
|
1793
|
-
if (
|
|
1794
|
-
for (const
|
|
1795
|
-
const
|
|
1796
|
-
if (
|
|
2086
|
+
(h) => {
|
|
2087
|
+
if (s[h] !== void 0) return s[h];
|
|
2088
|
+
for (const k of Object.values(t)) {
|
|
2089
|
+
const u = k.find((g) => g.key === h);
|
|
2090
|
+
if (u) return u.value;
|
|
1797
2091
|
}
|
|
1798
2092
|
return "";
|
|
1799
2093
|
},
|
|
1800
|
-
[
|
|
2094
|
+
[s, t]
|
|
1801
2095
|
);
|
|
1802
2096
|
return {
|
|
1803
2097
|
settings: t,
|
|
1804
|
-
edits:
|
|
1805
|
-
isLoading:
|
|
1806
|
-
autosaveStatus:
|
|
2098
|
+
edits: s,
|
|
2099
|
+
isLoading: i,
|
|
2100
|
+
autosaveStatus: l,
|
|
1807
2101
|
autosaveError: c,
|
|
1808
2102
|
error: a,
|
|
1809
|
-
fetchSettings:
|
|
1810
|
-
handleChange:
|
|
2103
|
+
fetchSettings: n,
|
|
2104
|
+
handleChange: x,
|
|
1811
2105
|
getEffectiveValue: C
|
|
1812
2106
|
};
|
|
1813
2107
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return t === "idle" ? null : /* @__PURE__ */
|
|
1816
|
-
t === "pending" && /* @__PURE__ */
|
|
2108
|
+
function se({ status: t, error: i }) {
|
|
2109
|
+
return t === "idle" ? null : /* @__PURE__ */ d("div", { className: `cedros-autosave-status cedros-autosave-status--${t}`, children: [
|
|
2110
|
+
t === "pending" && /* @__PURE__ */ d(T, { children: [
|
|
1817
2111
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-dot" }),
|
|
1818
2112
|
/* @__PURE__ */ e("span", { children: "Unsaved changes" })
|
|
1819
2113
|
] }),
|
|
1820
|
-
t === "saving" && /* @__PURE__ */
|
|
2114
|
+
t === "saving" && /* @__PURE__ */ d(T, { children: [
|
|
1821
2115
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-spinner" }),
|
|
1822
2116
|
/* @__PURE__ */ e("span", { children: "Saving..." })
|
|
1823
2117
|
] }),
|
|
1824
|
-
t === "saved" && /* @__PURE__ */
|
|
2118
|
+
t === "saved" && /* @__PURE__ */ d(T, { children: [
|
|
1825
2119
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-check", children: "✓" }),
|
|
1826
2120
|
/* @__PURE__ */ e("span", { children: "Saved" })
|
|
1827
2121
|
] }),
|
|
1828
|
-
t === "error" && /* @__PURE__ */
|
|
2122
|
+
t === "error" && /* @__PURE__ */ d(T, { children: [
|
|
1829
2123
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-error-icon", children: "!" }),
|
|
1830
|
-
/* @__PURE__ */ e("span", { children:
|
|
2124
|
+
/* @__PURE__ */ e("span", { children: i || "Save failed" })
|
|
1831
2125
|
] })
|
|
1832
2126
|
] });
|
|
1833
2127
|
}
|
|
1834
2128
|
export {
|
|
1835
|
-
|
|
2129
|
+
se as A,
|
|
1836
2130
|
ae as C,
|
|
1837
|
-
|
|
2131
|
+
ie as S,
|
|
1838
2132
|
W as a,
|
|
1839
|
-
|
|
2133
|
+
re as u
|
|
1840
2134
|
};
|