@cedros/login-react 0.0.41 → 0.0.43
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-CSoFp-_2.js → AuthenticationSettings-CxAubcoz.js} +1 -1
- package/dist/{AuthenticationSettings-CSoFp-_2.js.map → AuthenticationSettings-CxAubcoz.js.map} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs → AuthenticationSettings-DPr882lj.cjs} +1 -1
- package/dist/{AuthenticationSettings-Cu5Z2mTC.cjs.map → AuthenticationSettings-DPr882lj.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs → AuthenticationSettings-Y40T1djV.cjs} +1 -1
- package/dist/{AuthenticationSettings-DABzZHuI.cjs.map → AuthenticationSettings-Y40T1djV.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-D4ExU-2a.js → AuthenticationSettings-aVBFKKZ-.js} +1 -1
- package/dist/{AuthenticationSettings-D4ExU-2a.js.map → AuthenticationSettings-aVBFKKZ-.js.map} +1 -1
- package/dist/AutosaveStatus-ByD01ENa.cjs +1 -0
- package/dist/AutosaveStatus-ByD01ENa.cjs.map +1 -0
- package/dist/{AutosaveStatus-DMjvXzP2.js → AutosaveStatus-DtF_58rC.js} +608 -279
- package/dist/AutosaveStatus-DtF_58rC.js.map +1 -0
- package/dist/{CreditSystemSettings-BjQdysRS.js → CreditSystemSettings-BQek2Ux2.js} +1 -1
- package/dist/{CreditSystemSettings-BjQdysRS.js.map → CreditSystemSettings-BQek2Ux2.js.map} +1 -1
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs → CreditSystemSettings-CbuCce29.cjs} +1 -1
- package/dist/{CreditSystemSettings-DfSfQVE8.cjs.map → CreditSystemSettings-CbuCce29.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs → CreditSystemSettings-DHG_jhz9.cjs} +1 -1
- package/dist/{CreditSystemSettings-BWuiRTtA.cjs.map → CreditSystemSettings-DHG_jhz9.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js → CreditSystemSettings-GDKgYc7I.js} +1 -1
- package/dist/{CreditSystemSettings-Du3ac0ID.js.map → CreditSystemSettings-GDKgYc7I.js.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-CswtKXhb.cjs → EmailSettings-Cg4Z7139.cjs} +1 -1
- package/dist/{EmailSettings-CswtKXhb.cjs.map → EmailSettings-Cg4Z7139.cjs.map} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs → EmailSettings-CjxBg0cE.cjs} +1 -1
- package/dist/{EmailSettings-BcHo0cqk.cjs.map → EmailSettings-CjxBg0cE.cjs.map} +1 -1
- package/dist/{EmailSettings-CjngJwDS.js → EmailSettings-Ct6nFslP.js} +1 -1
- package/dist/{EmailSettings-CjngJwDS.js.map → EmailSettings-Ct6nFslP.js.map} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js → EmailSettings-D2pCqTKC.js} +1 -1
- package/dist/{EmailSettings-ASDHfI0K.js.map → EmailSettings-D2pCqTKC.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js → EmbeddedWalletSettings-Bus7UyOX.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CUY_X7Vj.js.map → EmbeddedWalletSettings-Bus7UyOX.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs → EmbeddedWalletSettings-CfzvFYnn.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BXlboZ9-.cjs.map → EmbeddedWalletSettings-CfzvFYnn.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js → EmbeddedWalletSettings-PwFgtGmK.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CPLbqlxJ.js.map → EmbeddedWalletSettings-PwFgtGmK.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs → EmbeddedWalletSettings-t0_5poBu.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BkwIbTkL.cjs.map → EmbeddedWalletSettings-t0_5poBu.cjs.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-BjLFs_sb.cjs} +1 -1
- package/dist/{ServerSettings-BygCxOTY.cjs.map → ServerSettings-BjLFs_sb.cjs.map} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js → ServerSettings-COkhan4u.js} +1 -1
- package/dist/{ServerSettings-B9PNMse1.js.map → ServerSettings-COkhan4u.js.map} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js → ServerSettings-D7WJDTbZ.js} +1 -1
- package/dist/{ServerSettings-BLoWX7KG.js.map → ServerSettings-D7WJDTbZ.js.map} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs → ServerSettings-Dmw2rpFA.cjs} +1 -1
- package/dist/{ServerSettings-CgBdYspU.cjs.map → ServerSettings-Dmw2rpFA.cjs.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-C-7Yxueu.js → WebhookSettings-CpPvGmV7.js} +1 -1
- package/dist/{WebhookSettings-C-7Yxueu.js.map → WebhookSettings-CpPvGmV7.js.map} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js → WebhookSettings-DEHV2ptf.js} +1 -1
- package/dist/{WebhookSettings-C923ZSKa.js.map → WebhookSettings-DEHV2ptf.js.map} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs → WebhookSettings-DbyPJ8V2.cjs} +1 -1
- package/dist/{WebhookSettings-CbU3cfTJ.cjs.map → WebhookSettings-DbyPJ8V2.cjs.map} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs → WebhookSettings-Rq_nNJuw.cjs} +1 -1
- package/dist/{WebhookSettings-D19u9Uok.cjs.map → WebhookSettings-Rq_nNJuw.cjs.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 +500 -1
- package/dist/index.js +5656 -4205
- package/dist/index.js.map +1 -1
- package/dist/{plugin-BiftIhZe.js → plugin-Bwwe7_ZO.js} +3 -2
- package/dist/plugin-Bwwe7_ZO.js.map +1 -0
- package/dist/plugin-C4bijrSr.cjs +1 -0
- package/dist/plugin-C4bijrSr.cjs.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,251 @@ 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"
|
|
1311
|
+
},
|
|
1312
|
+
// ============= Token Gating =============
|
|
1313
|
+
token_gating_enabled: {
|
|
1314
|
+
key: "token_gating_enabled",
|
|
1315
|
+
label: "Enable Token Gating",
|
|
1316
|
+
description: "Require Solana wallet holdings for access.",
|
|
1317
|
+
inputType: "boolean"
|
|
1318
|
+
},
|
|
1319
|
+
token_gating_rpc_url: {
|
|
1320
|
+
key: "token_gating_rpc_url",
|
|
1321
|
+
label: "Solana RPC/DAS URL",
|
|
1322
|
+
description: "RPC endpoint that supports DAS API for NFT queries.",
|
|
1323
|
+
inputType: "secret",
|
|
1324
|
+
placeholder: "https://mainnet.helius-rpc.com/?api-key=..."
|
|
1325
|
+
},
|
|
1326
|
+
token_gating_rules: {
|
|
1327
|
+
key: "token_gating_rules",
|
|
1328
|
+
label: "Token Gate Rules",
|
|
1329
|
+
description: "JSON array of gate rules. Managed via admin API.",
|
|
1330
|
+
inputType: "text",
|
|
1331
|
+
multiline: !0,
|
|
1332
|
+
placeholder: "[]"
|
|
1333
|
+
},
|
|
1334
|
+
token_gating_cache_ttl_secs: {
|
|
1335
|
+
key: "token_gating_cache_ttl_secs",
|
|
1336
|
+
label: "Cache TTL",
|
|
1337
|
+
description: "How long to cache wallet holdings (seconds).",
|
|
1338
|
+
inputType: "text",
|
|
1339
|
+
unit: "seconds",
|
|
1340
|
+
placeholder: "60"
|
|
1037
1341
|
}
|
|
1038
1342
|
}, ae = {
|
|
1039
1343
|
// Auth providers (sorted alphabetically by subcategory)
|
|
@@ -1117,6 +1421,11 @@ const W = {
|
|
|
1117
1421
|
description: "Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",
|
|
1118
1422
|
icon: ""
|
|
1119
1423
|
},
|
|
1424
|
+
referral: {
|
|
1425
|
+
label: "Referral & Payouts",
|
|
1426
|
+
description: "Configure referral rewards, payout triggers, and the automated payout worker.",
|
|
1427
|
+
icon: ""
|
|
1428
|
+
},
|
|
1120
1429
|
rate_limit: {
|
|
1121
1430
|
label: "Rate Limiting",
|
|
1122
1431
|
description: "Protect the system from abuse by limiting request rates. Balance security with user experience.",
|
|
@@ -1146,8 +1455,28 @@ const W = {
|
|
|
1146
1455
|
label: "Image Storage",
|
|
1147
1456
|
description: "Configure S3-compatible object storage for user avatars and images.",
|
|
1148
1457
|
icon: ""
|
|
1458
|
+
},
|
|
1459
|
+
kyc: {
|
|
1460
|
+
label: "KYC / Identity Verification",
|
|
1461
|
+
description: "Configure identity verification requirements using Stripe Identity.",
|
|
1462
|
+
icon: ""
|
|
1463
|
+
},
|
|
1464
|
+
sanctions: {
|
|
1465
|
+
label: "Sanctions Screening",
|
|
1466
|
+
description: "Block transactions involving wallet addresses on OFAC or custom sanctions lists.",
|
|
1467
|
+
icon: ""
|
|
1468
|
+
},
|
|
1469
|
+
accreditation: {
|
|
1470
|
+
label: "Accredited Investor Verification",
|
|
1471
|
+
description: "Configure accredited investor verification requirements and thresholds per SEC Regulation D.",
|
|
1472
|
+
icon: ""
|
|
1473
|
+
},
|
|
1474
|
+
token_gating: {
|
|
1475
|
+
label: "Token Gating",
|
|
1476
|
+
description: "Configure Solana wallet holdings requirements for gated access.",
|
|
1477
|
+
icon: ""
|
|
1149
1478
|
}
|
|
1150
|
-
},
|
|
1479
|
+
}, L = [
|
|
1151
1480
|
"SOL",
|
|
1152
1481
|
"USDC",
|
|
1153
1482
|
"USDT",
|
|
@@ -1159,70 +1488,70 @@ const W = {
|
|
|
1159
1488
|
"BONK",
|
|
1160
1489
|
"ORE"
|
|
1161
1490
|
];
|
|
1162
|
-
function
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1165
|
-
const
|
|
1166
|
-
return
|
|
1491
|
+
function D(t) {
|
|
1492
|
+
const i = t.split(/(<a\s[^>]*>.*?<\/a>)/g);
|
|
1493
|
+
return i.length === 1 ? t : i.map((a, n) => {
|
|
1494
|
+
const r = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
|
|
1495
|
+
return r ? /* @__PURE__ */ e("a", { href: r[1], target: "_blank", rel: "noopener noreferrer", children: r[2] }, n) : a;
|
|
1167
1496
|
});
|
|
1168
1497
|
}
|
|
1169
|
-
function
|
|
1498
|
+
function ie({
|
|
1170
1499
|
settings: t,
|
|
1171
|
-
edits:
|
|
1500
|
+
edits: i,
|
|
1172
1501
|
onChange: a,
|
|
1173
|
-
externalWarnings:
|
|
1502
|
+
externalWarnings: n
|
|
1174
1503
|
}) {
|
|
1175
|
-
return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((
|
|
1176
|
-
|
|
1504
|
+
return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((r) => /* @__PURE__ */ e(
|
|
1505
|
+
j,
|
|
1177
1506
|
{
|
|
1178
|
-
setting:
|
|
1179
|
-
editValue:
|
|
1507
|
+
setting: r,
|
|
1508
|
+
editValue: i[r.key],
|
|
1180
1509
|
onChange: a,
|
|
1181
|
-
externalWarning:
|
|
1510
|
+
externalWarning: n?.[r.key]
|
|
1182
1511
|
},
|
|
1183
|
-
|
|
1512
|
+
r.key
|
|
1184
1513
|
)) });
|
|
1185
1514
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
if (!
|
|
1190
|
-
const c = parseInt(
|
|
1515
|
+
function j({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
|
|
1516
|
+
const r = W[t.key], s = i ?? t.value, p = i !== void 0 && i !== t.value, l = r?.inputType === "boolean", o = N(() => {
|
|
1517
|
+
if (n) return n;
|
|
1518
|
+
if (!r?.warningThreshold) return null;
|
|
1519
|
+
const c = parseInt(s, 10);
|
|
1191
1520
|
if (isNaN(c)) return null;
|
|
1192
|
-
const { above:
|
|
1193
|
-
return
|
|
1194
|
-
}, [
|
|
1195
|
-
return
|
|
1521
|
+
const { above: y, below: b, message: _ } = r.warningThreshold;
|
|
1522
|
+
return y !== void 0 && c > y || b !== void 0 && c < b ? _ : null;
|
|
1523
|
+
}, [s, r?.warningThreshold, n]);
|
|
1524
|
+
return r ? /* @__PURE__ */ e(
|
|
1196
1525
|
"div",
|
|
1197
1526
|
{
|
|
1198
|
-
className: `cedros-setting-row ${
|
|
1199
|
-
children:
|
|
1200
|
-
/* @__PURE__ */
|
|
1527
|
+
className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${l ? "cedros-setting-row-toggle" : ""}`,
|
|
1528
|
+
children: l ? /* @__PURE__ */ d(T, { children: [
|
|
1529
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
|
|
1201
1530
|
/* @__PURE__ */ e(
|
|
1202
|
-
|
|
1531
|
+
R,
|
|
1203
1532
|
{
|
|
1204
|
-
meta:
|
|
1205
|
-
value:
|
|
1533
|
+
meta: r,
|
|
1534
|
+
value: s,
|
|
1206
1535
|
onChange: (c) => a(t.key, c)
|
|
1207
1536
|
}
|
|
1208
1537
|
),
|
|
1209
1538
|
o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
|
|
1210
1539
|
] }),
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children:
|
|
1213
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children:
|
|
1540
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1541
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
|
|
1542
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children: D(r.description) })
|
|
1214
1543
|
] })
|
|
1215
|
-
] }) : /* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children:
|
|
1218
|
-
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children:
|
|
1544
|
+
] }) : /* @__PURE__ */ d(T, { children: [
|
|
1545
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1546
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
|
|
1547
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-description", children: D(r.description) })
|
|
1219
1548
|
] }),
|
|
1220
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-control", children: [
|
|
1221
1550
|
/* @__PURE__ */ e(
|
|
1222
|
-
|
|
1551
|
+
R,
|
|
1223
1552
|
{
|
|
1224
|
-
meta:
|
|
1225
|
-
value:
|
|
1553
|
+
meta: r,
|
|
1554
|
+
value: s,
|
|
1226
1555
|
onChange: (c) => a(t.key, c)
|
|
1227
1556
|
}
|
|
1228
1557
|
),
|
|
@@ -1230,8 +1559,8 @@ function F({ setting: t, editValue: s, onChange: a, externalWarning: r }) {
|
|
|
1230
1559
|
] })
|
|
1231
1560
|
] })
|
|
1232
1561
|
}
|
|
1233
|
-
) : /* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1562
|
+
) : /* @__PURE__ */ d("div", { className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""}`, children: [
|
|
1563
|
+
/* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
|
|
1235
1564
|
/* @__PURE__ */ e("span", { className: "cedros-setting-name", children: t.key }),
|
|
1236
1565
|
t.description && /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: t.description })
|
|
1237
1566
|
] }),
|
|
@@ -1239,22 +1568,22 @@ function F({ setting: t, editValue: s, onChange: a, externalWarning: r }) {
|
|
|
1239
1568
|
"input",
|
|
1240
1569
|
{
|
|
1241
1570
|
type: "text",
|
|
1242
|
-
value:
|
|
1571
|
+
value: s,
|
|
1243
1572
|
onChange: (c) => a(t.key, c.target.value),
|
|
1244
1573
|
className: "cedros-setting-input"
|
|
1245
1574
|
}
|
|
1246
1575
|
) })
|
|
1247
1576
|
] });
|
|
1248
1577
|
}
|
|
1249
|
-
function
|
|
1578
|
+
function R({ meta: t, value: i, onChange: a }) {
|
|
1250
1579
|
switch (t.inputType) {
|
|
1251
1580
|
case "duration":
|
|
1252
|
-
return /* @__PURE__ */ e(
|
|
1581
|
+
return /* @__PURE__ */ e(F, { value: i, onChange: a, presets: t.presets, min: t.min });
|
|
1253
1582
|
case "percentage":
|
|
1254
1583
|
return /* @__PURE__ */ e(
|
|
1255
1584
|
$,
|
|
1256
1585
|
{
|
|
1257
|
-
value:
|
|
1586
|
+
value: i,
|
|
1258
1587
|
onChange: a,
|
|
1259
1588
|
min: t.min ?? 1,
|
|
1260
1589
|
max: t.max ?? 100,
|
|
@@ -1264,9 +1593,9 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1264
1593
|
);
|
|
1265
1594
|
case "select":
|
|
1266
1595
|
return /* @__PURE__ */ e(
|
|
1267
|
-
|
|
1596
|
+
V,
|
|
1268
1597
|
{
|
|
1269
|
-
value:
|
|
1598
|
+
value: i,
|
|
1270
1599
|
onChange: a,
|
|
1271
1600
|
presets: t.presets ?? [],
|
|
1272
1601
|
unit: t.unit
|
|
@@ -1274,9 +1603,9 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1274
1603
|
);
|
|
1275
1604
|
case "number":
|
|
1276
1605
|
return /* @__PURE__ */ e(
|
|
1277
|
-
|
|
1606
|
+
B,
|
|
1278
1607
|
{
|
|
1279
|
-
value:
|
|
1608
|
+
value: i,
|
|
1280
1609
|
onChange: a,
|
|
1281
1610
|
min: t.min,
|
|
1282
1611
|
max: t.max,
|
|
@@ -1284,57 +1613,57 @@ function D({ meta: t, value: s, onChange: a }) {
|
|
|
1284
1613
|
}
|
|
1285
1614
|
);
|
|
1286
1615
|
case "tokenList":
|
|
1287
|
-
return /* @__PURE__ */ e(
|
|
1616
|
+
return /* @__PURE__ */ e(J, { value: i, onChange: a });
|
|
1288
1617
|
case "text":
|
|
1289
1618
|
return /* @__PURE__ */ e(
|
|
1290
1619
|
"input",
|
|
1291
1620
|
{
|
|
1292
1621
|
type: "text",
|
|
1293
|
-
value:
|
|
1294
|
-
onChange: (
|
|
1622
|
+
value: i,
|
|
1623
|
+
onChange: (n) => a(n.target.value),
|
|
1295
1624
|
className: "cedros-setting-input",
|
|
1296
1625
|
placeholder: t.label
|
|
1297
1626
|
}
|
|
1298
1627
|
);
|
|
1299
1628
|
case "boolean":
|
|
1300
|
-
return /* @__PURE__ */ e(
|
|
1629
|
+
return /* @__PURE__ */ e(H, { value: i, onChange: a });
|
|
1301
1630
|
case "secret":
|
|
1302
|
-
return /* @__PURE__ */ e(G, { value:
|
|
1631
|
+
return /* @__PURE__ */ e(G, { value: i, onChange: a, multiline: t.multiline });
|
|
1303
1632
|
case "readonlySecret":
|
|
1304
|
-
return /* @__PURE__ */ e(
|
|
1633
|
+
return /* @__PURE__ */ e(K, { settingKey: t.key, value: i });
|
|
1305
1634
|
case "tokenSymbolList":
|
|
1306
|
-
return /* @__PURE__ */ e(z, { value:
|
|
1635
|
+
return /* @__PURE__ */ e(z, { value: i, onChange: a });
|
|
1307
1636
|
default:
|
|
1308
1637
|
return /* @__PURE__ */ e(
|
|
1309
1638
|
"input",
|
|
1310
1639
|
{
|
|
1311
1640
|
type: "text",
|
|
1312
|
-
value:
|
|
1313
|
-
onChange: (
|
|
1641
|
+
value: i,
|
|
1642
|
+
onChange: (n) => a(n.target.value),
|
|
1314
1643
|
className: "cedros-setting-input"
|
|
1315
1644
|
}
|
|
1316
1645
|
);
|
|
1317
1646
|
}
|
|
1318
1647
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const
|
|
1648
|
+
function F({ value: t, onChange: i, presets: a, min: n = 0 }) {
|
|
1649
|
+
const r = parseInt(t, 10) || 0, s = q(r), p = m(
|
|
1321
1650
|
(o) => {
|
|
1322
|
-
o.target.value &&
|
|
1651
|
+
o.target.value && i(o.target.value);
|
|
1323
1652
|
},
|
|
1324
|
-
[
|
|
1325
|
-
),
|
|
1653
|
+
[i]
|
|
1654
|
+
), l = m(
|
|
1326
1655
|
(o) => {
|
|
1327
|
-
const c = Math.max(
|
|
1328
|
-
|
|
1656
|
+
const c = Math.max(n, parseInt(o.target.value, 10) || 0);
|
|
1657
|
+
i(String(c));
|
|
1329
1658
|
},
|
|
1330
|
-
[
|
|
1659
|
+
[i, n]
|
|
1331
1660
|
);
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
a && a.length > 0 && /* @__PURE__ */
|
|
1661
|
+
return /* @__PURE__ */ d("div", { className: "cedros-duration-input", children: [
|
|
1662
|
+
a && a.length > 0 && /* @__PURE__ */ d(
|
|
1334
1663
|
"select",
|
|
1335
1664
|
{
|
|
1336
1665
|
value: a.find((o) => o.value === t)?.value ?? "",
|
|
1337
|
-
onChange:
|
|
1666
|
+
onChange: p,
|
|
1338
1667
|
className: "cedros-setting-select",
|
|
1339
1668
|
children: [
|
|
1340
1669
|
/* @__PURE__ */ e("option", { value: "", children: "Custom..." }),
|
|
@@ -1342,64 +1671,64 @@ function q({ value: t, onChange: s, presets: a, min: r = 0 }) {
|
|
|
1342
1671
|
]
|
|
1343
1672
|
}
|
|
1344
1673
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ d("div", { className: "cedros-duration-custom", children: [
|
|
1346
1675
|
/* @__PURE__ */ e(
|
|
1347
1676
|
"input",
|
|
1348
1677
|
{
|
|
1349
1678
|
type: "number",
|
|
1350
|
-
value:
|
|
1351
|
-
onChange:
|
|
1352
|
-
min:
|
|
1679
|
+
value: r,
|
|
1680
|
+
onChange: l,
|
|
1681
|
+
min: n,
|
|
1353
1682
|
className: "cedros-setting-input cedros-setting-input-sm"
|
|
1354
1683
|
}
|
|
1355
1684
|
),
|
|
1356
1685
|
/* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: "seconds" }),
|
|
1357
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ d("span", { className: "cedros-duration-display", children: [
|
|
1358
1687
|
"= ",
|
|
1359
|
-
|
|
1688
|
+
s
|
|
1360
1689
|
] })
|
|
1361
1690
|
] })
|
|
1362
1691
|
] });
|
|
1363
1692
|
}
|
|
1364
1693
|
function $({
|
|
1365
1694
|
value: t,
|
|
1366
|
-
onChange:
|
|
1695
|
+
onChange: i,
|
|
1367
1696
|
min: a,
|
|
1368
|
-
max:
|
|
1369
|
-
step:
|
|
1370
|
-
presets:
|
|
1697
|
+
max: n,
|
|
1698
|
+
step: r,
|
|
1699
|
+
presets: s
|
|
1371
1700
|
}) {
|
|
1372
|
-
const
|
|
1701
|
+
const p = parseInt(t, 10) || a, l = m(
|
|
1373
1702
|
(c) => {
|
|
1374
|
-
|
|
1703
|
+
i(c.target.value);
|
|
1375
1704
|
},
|
|
1376
|
-
[
|
|
1705
|
+
[i]
|
|
1377
1706
|
), o = m(
|
|
1378
1707
|
(c) => {
|
|
1379
|
-
|
|
1708
|
+
i(c);
|
|
1380
1709
|
},
|
|
1381
|
-
[
|
|
1710
|
+
[i]
|
|
1382
1711
|
);
|
|
1383
|
-
return /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ d("div", { className: "cedros-percentage-input", children: [
|
|
1713
|
+
/* @__PURE__ */ d("div", { className: "cedros-percentage-slider-row", children: [
|
|
1385
1714
|
/* @__PURE__ */ e(
|
|
1386
1715
|
"input",
|
|
1387
1716
|
{
|
|
1388
1717
|
type: "range",
|
|
1389
|
-
value:
|
|
1390
|
-
onChange:
|
|
1718
|
+
value: p,
|
|
1719
|
+
onChange: l,
|
|
1391
1720
|
min: a,
|
|
1392
|
-
max:
|
|
1393
|
-
step:
|
|
1721
|
+
max: n,
|
|
1722
|
+
step: r,
|
|
1394
1723
|
className: "cedros-percentage-slider"
|
|
1395
1724
|
}
|
|
1396
1725
|
),
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
|
|
1726
|
+
/* @__PURE__ */ d("span", { className: "cedros-percentage-value", children: [
|
|
1727
|
+
p,
|
|
1399
1728
|
"%"
|
|
1400
1729
|
] })
|
|
1401
1730
|
] }),
|
|
1402
|
-
|
|
1731
|
+
s && s.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-preset-buttons", children: s.map((c) => /* @__PURE__ */ e(
|
|
1403
1732
|
"button",
|
|
1404
1733
|
{
|
|
1405
1734
|
type: "button",
|
|
@@ -1411,79 +1740,79 @@ function $({
|
|
|
1411
1740
|
)) })
|
|
1412
1741
|
] });
|
|
1413
1742
|
}
|
|
1414
|
-
function
|
|
1415
|
-
const
|
|
1416
|
-
(
|
|
1417
|
-
|
|
1743
|
+
function V({ value: t, onChange: i, presets: a, unit: n }) {
|
|
1744
|
+
const r = !a.some((l) => l.value === t), s = m(
|
|
1745
|
+
(l) => {
|
|
1746
|
+
l.target.value !== "__custom__" && i(l.target.value);
|
|
1418
1747
|
},
|
|
1419
|
-
[
|
|
1420
|
-
),
|
|
1421
|
-
(
|
|
1422
|
-
|
|
1748
|
+
[i]
|
|
1749
|
+
), p = m(
|
|
1750
|
+
(l) => {
|
|
1751
|
+
i(l.target.value);
|
|
1423
1752
|
},
|
|
1424
|
-
[
|
|
1753
|
+
[i]
|
|
1425
1754
|
);
|
|
1426
|
-
return /* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1755
|
+
return /* @__PURE__ */ d("div", { className: "cedros-select-input", children: [
|
|
1756
|
+
/* @__PURE__ */ d(
|
|
1428
1757
|
"select",
|
|
1429
1758
|
{
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1759
|
+
value: r ? "__custom__" : t,
|
|
1760
|
+
onChange: s,
|
|
1432
1761
|
className: "cedros-setting-select",
|
|
1433
1762
|
children: [
|
|
1434
|
-
a.map((
|
|
1763
|
+
a.map((l) => /* @__PURE__ */ e("option", { value: l.value, children: l.label }, l.value)),
|
|
1435
1764
|
/* @__PURE__ */ e("option", { value: "__custom__", children: "Custom..." })
|
|
1436
1765
|
]
|
|
1437
1766
|
}
|
|
1438
1767
|
),
|
|
1439
|
-
|
|
1768
|
+
r && /* @__PURE__ */ d("div", { className: "cedros-select-custom", children: [
|
|
1440
1769
|
/* @__PURE__ */ e(
|
|
1441
1770
|
"input",
|
|
1442
1771
|
{
|
|
1443
1772
|
type: "number",
|
|
1444
1773
|
value: t,
|
|
1445
|
-
onChange:
|
|
1774
|
+
onChange: p,
|
|
1446
1775
|
className: "cedros-setting-input cedros-setting-input-sm"
|
|
1447
1776
|
}
|
|
1448
1777
|
),
|
|
1449
|
-
|
|
1778
|
+
n && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: n })
|
|
1450
1779
|
] })
|
|
1451
1780
|
] });
|
|
1452
1781
|
}
|
|
1453
|
-
function
|
|
1454
|
-
const
|
|
1455
|
-
(
|
|
1456
|
-
|
|
1782
|
+
function B({ value: t, onChange: i, min: a, max: n, unit: r }) {
|
|
1783
|
+
const s = m(
|
|
1784
|
+
(p) => {
|
|
1785
|
+
i(p.target.value);
|
|
1457
1786
|
},
|
|
1458
|
-
[
|
|
1787
|
+
[i]
|
|
1459
1788
|
);
|
|
1460
|
-
return /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ d("div", { className: "cedros-number-input", children: [
|
|
1461
1790
|
/* @__PURE__ */ e(
|
|
1462
1791
|
"input",
|
|
1463
1792
|
{
|
|
1464
1793
|
type: "number",
|
|
1465
1794
|
value: t,
|
|
1466
|
-
onChange:
|
|
1795
|
+
onChange: s,
|
|
1467
1796
|
min: a,
|
|
1468
|
-
max:
|
|
1797
|
+
max: n,
|
|
1469
1798
|
className: "cedros-setting-input"
|
|
1470
1799
|
}
|
|
1471
1800
|
),
|
|
1472
|
-
|
|
1801
|
+
r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
|
|
1473
1802
|
] });
|
|
1474
1803
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const a = t === "true",
|
|
1477
|
-
|
|
1478
|
-
}, [a,
|
|
1479
|
-
return /* @__PURE__ */
|
|
1804
|
+
function H({ value: t, onChange: i }) {
|
|
1805
|
+
const a = t === "true", n = m(() => {
|
|
1806
|
+
i(a ? "false" : "true");
|
|
1807
|
+
}, [a, i]);
|
|
1808
|
+
return /* @__PURE__ */ d(
|
|
1480
1809
|
"button",
|
|
1481
1810
|
{
|
|
1482
1811
|
type: "button",
|
|
1483
1812
|
role: "switch",
|
|
1484
1813
|
"aria-checked": a,
|
|
1485
1814
|
className: `cedros-toggle ${a ? "cedros-toggle-on" : "cedros-toggle-off"}`,
|
|
1486
|
-
onClick:
|
|
1815
|
+
onClick: n,
|
|
1487
1816
|
children: [
|
|
1488
1817
|
/* @__PURE__ */ e("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ e("span", { className: "cedros-toggle-thumb" }) }),
|
|
1489
1818
|
/* @__PURE__ */ e("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
|
|
@@ -1491,26 +1820,26 @@ function V({ value: t, onChange: s }) {
|
|
|
1491
1820
|
}
|
|
1492
1821
|
);
|
|
1493
1822
|
}
|
|
1494
|
-
function G({ value: t, onChange:
|
|
1495
|
-
const [
|
|
1496
|
-
|
|
1823
|
+
function G({ value: t, onChange: i, multiline: a }) {
|
|
1824
|
+
const [n, r] = f(!1), [s, p] = f(!1), l = t && t.length > 0, o = m(() => {
|
|
1825
|
+
r(!0), p(!0);
|
|
1497
1826
|
}, []), c = m(() => {
|
|
1498
|
-
|
|
1499
|
-
}, []),
|
|
1500
|
-
(
|
|
1501
|
-
|
|
1827
|
+
r(!1), p(!1);
|
|
1828
|
+
}, []), y = m(
|
|
1829
|
+
(b) => {
|
|
1830
|
+
i(b.target.value);
|
|
1502
1831
|
},
|
|
1503
|
-
[
|
|
1832
|
+
[i]
|
|
1504
1833
|
);
|
|
1505
|
-
return !
|
|
1834
|
+
return !n && l ? /* @__PURE__ */ d("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
|
|
1506
1835
|
/* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
|
|
1507
1836
|
/* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
|
|
1508
|
-
] }) : /* @__PURE__ */
|
|
1837
|
+
] }) : /* @__PURE__ */ d("div", { className: "cedros-secret-input", children: [
|
|
1509
1838
|
a ? /* @__PURE__ */ e(
|
|
1510
1839
|
"textarea",
|
|
1511
1840
|
{
|
|
1512
1841
|
value: t,
|
|
1513
|
-
onChange:
|
|
1842
|
+
onChange: y,
|
|
1514
1843
|
className: "cedros-setting-input cedros-setting-textarea",
|
|
1515
1844
|
placeholder: "Enter secret value...",
|
|
1516
1845
|
rows: 4
|
|
@@ -1518,71 +1847,71 @@ function G({ value: t, onChange: s, multiline: a }) {
|
|
|
1518
1847
|
) : /* @__PURE__ */ e(
|
|
1519
1848
|
"input",
|
|
1520
1849
|
{
|
|
1521
|
-
type:
|
|
1850
|
+
type: s ? "text" : "password",
|
|
1522
1851
|
value: t,
|
|
1523
|
-
onChange:
|
|
1852
|
+
onChange: y,
|
|
1524
1853
|
className: "cedros-setting-input",
|
|
1525
1854
|
placeholder: "Enter secret value..."
|
|
1526
1855
|
}
|
|
1527
1856
|
),
|
|
1528
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ d("div", { className: "cedros-secret-actions", children: [
|
|
1529
1858
|
!a && /* @__PURE__ */ e(
|
|
1530
1859
|
"button",
|
|
1531
1860
|
{
|
|
1532
1861
|
type: "button",
|
|
1533
1862
|
className: "cedros-secret-toggle-btn",
|
|
1534
|
-
onClick: () =>
|
|
1535
|
-
children:
|
|
1863
|
+
onClick: () => p(!s),
|
|
1864
|
+
children: s ? "Hide" : "Show"
|
|
1536
1865
|
}
|
|
1537
1866
|
),
|
|
1538
|
-
|
|
1867
|
+
n && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
|
|
1539
1868
|
] })
|
|
1540
1869
|
] });
|
|
1541
1870
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const [a,
|
|
1871
|
+
function K({ settingKey: t, value: i }) {
|
|
1872
|
+
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(), g = a ?? i, x = g && g.length > 0, C = x && !a, h = m(async () => {
|
|
1544
1873
|
if (g)
|
|
1545
1874
|
try {
|
|
1546
|
-
await navigator.clipboard.writeText(g),
|
|
1875
|
+
await navigator.clipboard.writeText(g), s(!0), setTimeout(() => s(!1), 2e3);
|
|
1547
1876
|
} catch {
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1877
|
+
const u = document.createElement("textarea");
|
|
1878
|
+
u.value = g, document.body.appendChild(u), u.select(), document.execCommand("copy"), document.body.removeChild(u), s(!0), setTimeout(() => s(!1), 2e3);
|
|
1550
1879
|
}
|
|
1551
|
-
}, [g]),
|
|
1552
|
-
|
|
1880
|
+
}, [g]), k = m(async () => {
|
|
1881
|
+
l(!0), c(null);
|
|
1553
1882
|
try {
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1883
|
+
const u = w?.getAccessToken?.(), v = { "Content-Type": "application/json" };
|
|
1884
|
+
u && (v.Authorization = `Bearer ${u}`);
|
|
1556
1885
|
const S = await fetch(
|
|
1557
1886
|
`${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
|
|
1558
|
-
{ method: "POST", headers:
|
|
1887
|
+
{ method: "POST", headers: v, credentials: "include" }
|
|
1559
1888
|
);
|
|
1560
1889
|
if (!S.ok) {
|
|
1561
1890
|
const A = await S.json().catch(() => null);
|
|
1562
1891
|
throw new Error(A?.message || A?.error || `Regenerate failed (${S.status})`);
|
|
1563
1892
|
}
|
|
1564
1893
|
const E = await S.json();
|
|
1565
|
-
|
|
1566
|
-
} catch (
|
|
1567
|
-
c(
|
|
1894
|
+
n(E.value), b(!1);
|
|
1895
|
+
} catch (u) {
|
|
1896
|
+
c(u instanceof Error ? u.message : "Failed to regenerate");
|
|
1568
1897
|
} finally {
|
|
1569
|
-
|
|
1898
|
+
l(!1);
|
|
1570
1899
|
}
|
|
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
|
-
|
|
1900
|
+
}, [_.serverUrl, w, t]);
|
|
1901
|
+
return /* @__PURE__ */ d("div", { className: "cedros-readonly-secret", children: [
|
|
1902
|
+
/* @__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: g }) : /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-empty", children: "Not generated yet" }) }),
|
|
1903
|
+
/* @__PURE__ */ d("div", { className: "cedros-readonly-secret-actions", children: [
|
|
1904
|
+
x && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-action-btn", onClick: h, children: r ? "Copied!" : "Copy" }),
|
|
1905
|
+
y ? /* @__PURE__ */ d("span", { className: "cedros-readonly-secret-confirm", children: [
|
|
1577
1906
|
/* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
|
|
1578
1907
|
/* @__PURE__ */ e(
|
|
1579
1908
|
"button",
|
|
1580
1909
|
{
|
|
1581
1910
|
type: "button",
|
|
1582
1911
|
className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
|
|
1583
|
-
onClick:
|
|
1584
|
-
disabled:
|
|
1585
|
-
children:
|
|
1912
|
+
onClick: k,
|
|
1913
|
+
disabled: p,
|
|
1914
|
+
children: p ? "Regenerating..." : "Confirm"
|
|
1586
1915
|
}
|
|
1587
1916
|
),
|
|
1588
1917
|
/* @__PURE__ */ e(
|
|
@@ -1590,8 +1919,8 @@ function H({ settingKey: t, value: s }) {
|
|
|
1590
1919
|
{
|
|
1591
1920
|
type: "button",
|
|
1592
1921
|
className: "cedros-secret-action-btn",
|
|
1593
|
-
onClick: () =>
|
|
1594
|
-
disabled:
|
|
1922
|
+
onClick: () => b(!1),
|
|
1923
|
+
disabled: p,
|
|
1595
1924
|
children: "Cancel"
|
|
1596
1925
|
}
|
|
1597
1926
|
)
|
|
@@ -1600,8 +1929,8 @@ function H({ settingKey: t, value: s }) {
|
|
|
1600
1929
|
{
|
|
1601
1930
|
type: "button",
|
|
1602
1931
|
className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
|
|
1603
|
-
onClick: () =>
|
|
1604
|
-
disabled:
|
|
1932
|
+
onClick: () => b(!0),
|
|
1933
|
+
disabled: p,
|
|
1605
1934
|
children: "Regenerate"
|
|
1606
1935
|
}
|
|
1607
1936
|
)
|
|
@@ -1609,47 +1938,47 @@ function H({ settingKey: t, value: s }) {
|
|
|
1609
1938
|
o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
|
|
1610
1939
|
] });
|
|
1611
1940
|
}
|
|
1612
|
-
function
|
|
1613
|
-
const a =
|
|
1941
|
+
function J({ value: t, onChange: i }) {
|
|
1942
|
+
const a = N(() => {
|
|
1614
1943
|
try {
|
|
1615
1944
|
return JSON.parse(t || "[]");
|
|
1616
1945
|
} catch {
|
|
1617
1946
|
return [];
|
|
1618
1947
|
}
|
|
1619
|
-
}, [t]),
|
|
1620
|
-
(
|
|
1621
|
-
|
|
1948
|
+
}, [t]), n = m(
|
|
1949
|
+
(l) => {
|
|
1950
|
+
i(JSON.stringify(l));
|
|
1622
1951
|
},
|
|
1623
|
-
[
|
|
1624
|
-
),
|
|
1625
|
-
|
|
1626
|
-
}, [a,
|
|
1627
|
-
(
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1952
|
+
[i]
|
|
1953
|
+
), r = m(() => {
|
|
1954
|
+
n([...a, { symbol: "", mint: "", decimals: 6 }]);
|
|
1955
|
+
}, [a, n]), s = m(
|
|
1956
|
+
(l, o, c) => {
|
|
1957
|
+
const y = [...a];
|
|
1958
|
+
y[l] = { ...y[l], [o]: c }, n(y);
|
|
1630
1959
|
},
|
|
1631
|
-
[a,
|
|
1632
|
-
),
|
|
1633
|
-
(
|
|
1634
|
-
|
|
1960
|
+
[a, n]
|
|
1961
|
+
), p = m(
|
|
1962
|
+
(l) => {
|
|
1963
|
+
n(a.filter((o, c) => c !== l));
|
|
1635
1964
|
},
|
|
1636
|
-
[a,
|
|
1965
|
+
[a, n]
|
|
1637
1966
|
);
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1967
|
+
return /* @__PURE__ */ d("div", { className: "cedros-token-list-input", children: [
|
|
1968
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
|
|
1640
1969
|
/* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
|
|
1641
|
-
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children:
|
|
1970
|
+
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((l) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: l }, l)) })
|
|
1642
1971
|
] }),
|
|
1643
1972
|
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__ */
|
|
1973
|
+
a.map((l, o) => /* @__PURE__ */ d("div", { className: "cedros-token-row", children: [
|
|
1974
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-row-fields", children: [
|
|
1646
1975
|
/* @__PURE__ */ e(
|
|
1647
1976
|
"input",
|
|
1648
1977
|
{
|
|
1649
1978
|
type: "text",
|
|
1650
1979
|
placeholder: "Symbol",
|
|
1651
|
-
value:
|
|
1652
|
-
onChange: (c) =>
|
|
1980
|
+
value: l.symbol,
|
|
1981
|
+
onChange: (c) => s(o, "symbol", c.target.value.toUpperCase()),
|
|
1653
1982
|
className: "cedros-setting-input cedros-token-input-symbol",
|
|
1654
1983
|
maxLength: 10
|
|
1655
1984
|
}
|
|
@@ -1659,8 +1988,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1659
1988
|
{
|
|
1660
1989
|
type: "text",
|
|
1661
1990
|
placeholder: "Mint address",
|
|
1662
|
-
value:
|
|
1663
|
-
onChange: (c) =>
|
|
1991
|
+
value: l.mint,
|
|
1992
|
+
onChange: (c) => s(o, "mint", c.target.value),
|
|
1664
1993
|
className: "cedros-setting-input cedros-token-input-mint"
|
|
1665
1994
|
}
|
|
1666
1995
|
),
|
|
@@ -1669,8 +1998,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1669
1998
|
{
|
|
1670
1999
|
type: "number",
|
|
1671
2000
|
placeholder: "Decimals",
|
|
1672
|
-
value:
|
|
1673
|
-
onChange: (c) =>
|
|
2001
|
+
value: l.decimals,
|
|
2002
|
+
onChange: (c) => s(o, "decimals", parseInt(c.target.value, 10) || 0),
|
|
1674
2003
|
className: "cedros-setting-input cedros-token-input-decimals",
|
|
1675
2004
|
min: 0,
|
|
1676
2005
|
max: 18
|
|
@@ -1681,8 +2010,8 @@ function K({ value: t, onChange: s }) {
|
|
|
1681
2010
|
{
|
|
1682
2011
|
type: "text",
|
|
1683
2012
|
placeholder: "Logo URL (optional)",
|
|
1684
|
-
value:
|
|
1685
|
-
onChange: (c) =>
|
|
2013
|
+
value: l.logoUrl || "",
|
|
2014
|
+
onChange: (c) => s(o, "logoUrl", c.target.value || void 0),
|
|
1686
2015
|
className: "cedros-setting-input cedros-token-input-logo"
|
|
1687
2016
|
}
|
|
1688
2017
|
)
|
|
@@ -1692,48 +2021,48 @@ function K({ value: t, onChange: s }) {
|
|
|
1692
2021
|
{
|
|
1693
2022
|
type: "button",
|
|
1694
2023
|
className: "cedros-token-remove-btn",
|
|
1695
|
-
onClick: () =>
|
|
2024
|
+
onClick: () => p(o),
|
|
1696
2025
|
title: "Remove token",
|
|
1697
2026
|
children: "×"
|
|
1698
2027
|
}
|
|
1699
2028
|
)
|
|
1700
2029
|
] }, o)),
|
|
1701
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick:
|
|
2030
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: r, children: "+ Add Token" })
|
|
1702
2031
|
] });
|
|
1703
2032
|
}
|
|
1704
|
-
function z({ value: t, onChange:
|
|
1705
|
-
const a =
|
|
1706
|
-
(
|
|
1707
|
-
if (!
|
|
1708
|
-
const
|
|
1709
|
-
|
|
2033
|
+
function z({ value: t, onChange: i }) {
|
|
2034
|
+
const a = N(() => t.split(",").map((s) => s.trim()).filter(Boolean), [t]), n = m(
|
|
2035
|
+
(s) => {
|
|
2036
|
+
if (!s || a.includes(s)) return;
|
|
2037
|
+
const p = [...a, s].join(", ");
|
|
2038
|
+
i(p);
|
|
1710
2039
|
},
|
|
1711
|
-
[a,
|
|
1712
|
-
),
|
|
1713
|
-
(
|
|
1714
|
-
const
|
|
1715
|
-
|
|
2040
|
+
[a, i]
|
|
2041
|
+
), r = m(
|
|
2042
|
+
(s) => {
|
|
2043
|
+
const p = a.filter((l) => l !== s).join(", ");
|
|
2044
|
+
i(p);
|
|
1716
2045
|
},
|
|
1717
|
-
[a,
|
|
2046
|
+
[a, i]
|
|
1718
2047
|
);
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
2048
|
+
return /* @__PURE__ */ d("div", { className: "cedros-token-symbol-list-input", children: [
|
|
2049
|
+
/* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
|
|
1721
2050
|
/* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
|
|
1722
|
-
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children:
|
|
1723
|
-
const
|
|
1724
|
-
return /* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((s) => {
|
|
2052
|
+
const p = a.includes(s);
|
|
2053
|
+
return /* @__PURE__ */ d(
|
|
1725
2054
|
"button",
|
|
1726
2055
|
{
|
|
1727
2056
|
type: "button",
|
|
1728
|
-
className: `cedros-token-preset-chip ${
|
|
1729
|
-
onClick: () =>
|
|
1730
|
-
title:
|
|
2057
|
+
className: `cedros-token-preset-chip ${p ? "cedros-token-preset-chip-selected" : ""}`,
|
|
2058
|
+
onClick: () => p ? r(s) : n(s),
|
|
2059
|
+
title: p ? `Remove ${s}` : `Add ${s}`,
|
|
1731
2060
|
children: [
|
|
1732
|
-
|
|
1733
|
-
|
|
2061
|
+
s,
|
|
2062
|
+
p && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
|
|
1734
2063
|
]
|
|
1735
2064
|
},
|
|
1736
|
-
|
|
2065
|
+
s
|
|
1737
2066
|
);
|
|
1738
2067
|
}) })
|
|
1739
2068
|
] }),
|
|
@@ -1742,7 +2071,7 @@ function z({ value: t, onChange: s }) {
|
|
|
1742
2071
|
{
|
|
1743
2072
|
type: "text",
|
|
1744
2073
|
value: t,
|
|
1745
|
-
onChange: (
|
|
2074
|
+
onChange: (s) => i(s.target.value),
|
|
1746
2075
|
className: "cedros-setting-input",
|
|
1747
2076
|
placeholder: "USDC, SOL, BONK..."
|
|
1748
2077
|
}
|
|
@@ -1750,91 +2079,91 @@ function z({ value: t, onChange: s }) {
|
|
|
1750
2079
|
] });
|
|
1751
2080
|
}
|
|
1752
2081
|
const Y = 800, X = 2e3;
|
|
1753
|
-
function
|
|
1754
|
-
const { settings: t, isLoading:
|
|
1755
|
-
|
|
1756
|
-
|
|
2082
|
+
function re() {
|
|
2083
|
+
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({});
|
|
2084
|
+
I(() => () => {
|
|
2085
|
+
b.current && clearTimeout(b.current), _.current && clearTimeout(_.current);
|
|
1757
2086
|
}, []);
|
|
1758
2087
|
const g = m(async () => {
|
|
1759
|
-
const
|
|
1760
|
-
if (Object.keys(
|
|
2088
|
+
const h = { ...w.current };
|
|
2089
|
+
if (Object.keys(h).length === 0) {
|
|
1761
2090
|
o("idle");
|
|
1762
2091
|
return;
|
|
1763
2092
|
}
|
|
1764
|
-
o("saving"),
|
|
1765
|
-
const
|
|
1766
|
-
key:
|
|
1767
|
-
value:
|
|
2093
|
+
o("saving"), y(null);
|
|
2094
|
+
const k = Object.entries(h).map(([u, v]) => ({
|
|
2095
|
+
key: u,
|
|
2096
|
+
value: v
|
|
1768
2097
|
}));
|
|
1769
2098
|
try {
|
|
1770
|
-
await
|
|
1771
|
-
const
|
|
1772
|
-
for (const S of Object.keys(
|
|
1773
|
-
delete
|
|
1774
|
-
return
|
|
2099
|
+
await r(k), p((u) => {
|
|
2100
|
+
const v = { ...u };
|
|
2101
|
+
for (const S of Object.keys(h))
|
|
2102
|
+
delete v[S];
|
|
2103
|
+
return v;
|
|
1775
2104
|
});
|
|
1776
|
-
for (const
|
|
1777
|
-
delete
|
|
2105
|
+
for (const u of Object.keys(h))
|
|
2106
|
+
delete w.current[u];
|
|
1778
2107
|
o("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
|
|
1779
2108
|
o("idle");
|
|
1780
2109
|
}, X);
|
|
1781
|
-
} catch (
|
|
1782
|
-
o("error"),
|
|
2110
|
+
} catch (u) {
|
|
2111
|
+
o("error"), y(u instanceof Error ? u.message : "Failed to save");
|
|
1783
2112
|
}
|
|
1784
|
-
}, [
|
|
1785
|
-
(
|
|
1786
|
-
|
|
2113
|
+
}, [r]), x = m(
|
|
2114
|
+
(h, k) => {
|
|
2115
|
+
p((u) => ({ ...u, [h]: k })), w.current[h] = k, y(null), o("pending"), b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
1787
2116
|
g();
|
|
1788
2117
|
}, Y);
|
|
1789
2118
|
},
|
|
1790
2119
|
[g]
|
|
1791
2120
|
), C = m(
|
|
1792
|
-
(
|
|
1793
|
-
if (
|
|
1794
|
-
for (const
|
|
1795
|
-
const
|
|
1796
|
-
if (
|
|
2121
|
+
(h) => {
|
|
2122
|
+
if (s[h] !== void 0) return s[h];
|
|
2123
|
+
for (const k of Object.values(t)) {
|
|
2124
|
+
const u = k.find((v) => v.key === h);
|
|
2125
|
+
if (u) return u.value;
|
|
1797
2126
|
}
|
|
1798
2127
|
return "";
|
|
1799
2128
|
},
|
|
1800
|
-
[
|
|
2129
|
+
[s, t]
|
|
1801
2130
|
);
|
|
1802
2131
|
return {
|
|
1803
2132
|
settings: t,
|
|
1804
|
-
edits:
|
|
1805
|
-
isLoading:
|
|
1806
|
-
autosaveStatus:
|
|
2133
|
+
edits: s,
|
|
2134
|
+
isLoading: i,
|
|
2135
|
+
autosaveStatus: l,
|
|
1807
2136
|
autosaveError: c,
|
|
1808
2137
|
error: a,
|
|
1809
|
-
fetchSettings:
|
|
1810
|
-
handleChange:
|
|
2138
|
+
fetchSettings: n,
|
|
2139
|
+
handleChange: x,
|
|
1811
2140
|
getEffectiveValue: C
|
|
1812
2141
|
};
|
|
1813
2142
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return t === "idle" ? null : /* @__PURE__ */
|
|
1816
|
-
t === "pending" && /* @__PURE__ */
|
|
2143
|
+
function se({ status: t, error: i }) {
|
|
2144
|
+
return t === "idle" ? null : /* @__PURE__ */ d("div", { className: `cedros-autosave-status cedros-autosave-status--${t}`, children: [
|
|
2145
|
+
t === "pending" && /* @__PURE__ */ d(T, { children: [
|
|
1817
2146
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-dot" }),
|
|
1818
2147
|
/* @__PURE__ */ e("span", { children: "Unsaved changes" })
|
|
1819
2148
|
] }),
|
|
1820
|
-
t === "saving" && /* @__PURE__ */
|
|
2149
|
+
t === "saving" && /* @__PURE__ */ d(T, { children: [
|
|
1821
2150
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-spinner" }),
|
|
1822
2151
|
/* @__PURE__ */ e("span", { children: "Saving..." })
|
|
1823
2152
|
] }),
|
|
1824
|
-
t === "saved" && /* @__PURE__ */
|
|
2153
|
+
t === "saved" && /* @__PURE__ */ d(T, { children: [
|
|
1825
2154
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-check", children: "✓" }),
|
|
1826
2155
|
/* @__PURE__ */ e("span", { children: "Saved" })
|
|
1827
2156
|
] }),
|
|
1828
|
-
t === "error" && /* @__PURE__ */
|
|
2157
|
+
t === "error" && /* @__PURE__ */ d(T, { children: [
|
|
1829
2158
|
/* @__PURE__ */ e("span", { className: "cedros-autosave-error-icon", children: "!" }),
|
|
1830
|
-
/* @__PURE__ */ e("span", { children:
|
|
2159
|
+
/* @__PURE__ */ e("span", { children: i || "Save failed" })
|
|
1831
2160
|
] })
|
|
1832
2161
|
] });
|
|
1833
2162
|
}
|
|
1834
2163
|
export {
|
|
1835
|
-
|
|
2164
|
+
se as A,
|
|
1836
2165
|
ae as C,
|
|
1837
|
-
|
|
2166
|
+
ie as S,
|
|
1838
2167
|
W as a,
|
|
1839
|
-
|
|
2168
|
+
re as u
|
|
1840
2169
|
};
|