@cedros/login-react 0.0.43 → 0.0.45

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.
Files changed (91) hide show
  1. package/README.md +216 -0
  2. package/dist/{AuthenticationSettings-Y40T1djV.cjs → AuthenticationSettings-BlYOmaEG.cjs} +1 -1
  3. package/dist/{AuthenticationSettings-Y40T1djV.cjs.map → AuthenticationSettings-BlYOmaEG.cjs.map} +1 -1
  4. package/dist/{AuthenticationSettings-CxAubcoz.js → AuthenticationSettings-BsuwWKbT.js} +1 -1
  5. package/dist/{AuthenticationSettings-CxAubcoz.js.map → AuthenticationSettings-BsuwWKbT.js.map} +1 -1
  6. package/dist/{AuthenticationSettings-aVBFKKZ-.js → AuthenticationSettings-DrHqtD7p.js} +1 -1
  7. package/dist/{AuthenticationSettings-aVBFKKZ-.js.map → AuthenticationSettings-DrHqtD7p.js.map} +1 -1
  8. package/dist/{AuthenticationSettings-DPr882lj.cjs → AuthenticationSettings-bNQiNQ9g.cjs} +1 -1
  9. package/dist/{AuthenticationSettings-DPr882lj.cjs.map → AuthenticationSettings-bNQiNQ9g.cjs.map} +1 -1
  10. package/dist/{AutosaveStatus-ByD01ENa.cjs → AutosaveStatus-CZSwtgrL.cjs} +1 -1
  11. package/dist/AutosaveStatus-CZSwtgrL.cjs.map +1 -0
  12. package/dist/{AutosaveStatus-DtF_58rC.js → AutosaveStatus-D-roPsRx.js} +280 -280
  13. package/dist/AutosaveStatus-D-roPsRx.js.map +1 -0
  14. package/dist/{CreditSystemSettings-DHG_jhz9.cjs → CreditSystemSettings-3R6crxvW.cjs} +1 -1
  15. package/dist/{CreditSystemSettings-DHG_jhz9.cjs.map → CreditSystemSettings-3R6crxvW.cjs.map} +1 -1
  16. package/dist/{CreditSystemSettings-BQek2Ux2.js → CreditSystemSettings-BTqZFn4K.js} +1 -1
  17. package/dist/{CreditSystemSettings-BQek2Ux2.js.map → CreditSystemSettings-BTqZFn4K.js.map} +1 -1
  18. package/dist/{CreditSystemSettings-CbuCce29.cjs → CreditSystemSettings-BskW_NKx.cjs} +1 -1
  19. package/dist/{CreditSystemSettings-CbuCce29.cjs.map → CreditSystemSettings-BskW_NKx.cjs.map} +1 -1
  20. package/dist/{CreditSystemSettings-GDKgYc7I.js → CreditSystemSettings-SL45GRH3.js} +1 -1
  21. package/dist/{CreditSystemSettings-GDKgYc7I.js.map → CreditSystemSettings-SL45GRH3.js.map} +1 -1
  22. package/dist/{EmailSettings-D2pCqTKC.js → EmailSettings-BUAQji4I.js} +1 -1
  23. package/dist/{EmailSettings-D2pCqTKC.js.map → EmailSettings-BUAQji4I.js.map} +1 -1
  24. package/dist/{EmailSettings-CjxBg0cE.cjs → EmailSettings-CEC1rhrm.cjs} +1 -1
  25. package/dist/{EmailSettings-CjxBg0cE.cjs.map → EmailSettings-CEC1rhrm.cjs.map} +1 -1
  26. package/dist/{EmailSettings-Cg4Z7139.cjs → EmailSettings-CihElRkc.cjs} +1 -1
  27. package/dist/{EmailSettings-Cg4Z7139.cjs.map → EmailSettings-CihElRkc.cjs.map} +1 -1
  28. package/dist/{EmailSettings-Ct6nFslP.js → EmailSettings-XETM8FdS.js} +1 -1
  29. package/dist/{EmailSettings-Ct6nFslP.js.map → EmailSettings-XETM8FdS.js.map} +1 -1
  30. package/dist/{EmbeddedWalletSettings-PwFgtGmK.js → EmbeddedWalletSettings-B-083zu6.js} +1 -1
  31. package/dist/{EmbeddedWalletSettings-PwFgtGmK.js.map → EmbeddedWalletSettings-B-083zu6.js.map} +1 -1
  32. package/dist/{EmbeddedWalletSettings-Bus7UyOX.js → EmbeddedWalletSettings-CCT9DwmL.js} +1 -1
  33. package/dist/{EmbeddedWalletSettings-Bus7UyOX.js.map → EmbeddedWalletSettings-CCT9DwmL.js.map} +1 -1
  34. package/dist/{EmbeddedWalletSettings-CfzvFYnn.cjs → EmbeddedWalletSettings-DXIjansC.cjs} +1 -1
  35. package/dist/{EmbeddedWalletSettings-CfzvFYnn.cjs.map → EmbeddedWalletSettings-DXIjansC.cjs.map} +1 -1
  36. package/dist/{EmbeddedWalletSettings-t0_5poBu.cjs → EmbeddedWalletSettings-MtwR81WH.cjs} +1 -1
  37. package/dist/{EmbeddedWalletSettings-t0_5poBu.cjs.map → EmbeddedWalletSettings-MtwR81WH.cjs.map} +1 -1
  38. package/dist/{PermissionsSection-CSB_Ikj9.cjs → PermissionsSection-4zcE9Zs9.cjs} +1 -1
  39. package/dist/PermissionsSection-4zcE9Zs9.cjs.map +1 -0
  40. package/dist/{PermissionsSection-BDDiEfho.js → PermissionsSection-mm9hfp-u.js} +94 -74
  41. package/dist/PermissionsSection-mm9hfp-u.js.map +1 -0
  42. package/dist/{ServerSettings-D7WJDTbZ.js → ServerSettings-24DA_BOI.js} +1 -1
  43. package/dist/{ServerSettings-D7WJDTbZ.js.map → ServerSettings-24DA_BOI.js.map} +1 -1
  44. package/dist/{ServerSettings-BjLFs_sb.cjs → ServerSettings-BNc4LEs4.cjs} +1 -1
  45. package/dist/{ServerSettings-BjLFs_sb.cjs.map → ServerSettings-BNc4LEs4.cjs.map} +1 -1
  46. package/dist/{ServerSettings-Dmw2rpFA.cjs → ServerSettings-BTEuzdrf.cjs} +1 -1
  47. package/dist/{ServerSettings-Dmw2rpFA.cjs.map → ServerSettings-BTEuzdrf.cjs.map} +1 -1
  48. package/dist/{ServerSettings-COkhan4u.js → ServerSettings-DBpbRihl.js} +1 -1
  49. package/dist/{ServerSettings-COkhan4u.js.map → ServerSettings-DBpbRihl.js.map} +1 -1
  50. package/dist/{TeamSection-BhsBEckR.js → TeamSection-C_eODdLU.js} +1 -1
  51. package/dist/{TeamSection-BhsBEckR.js.map → TeamSection-C_eODdLU.js.map} +1 -1
  52. package/dist/{TeamSection-DLxtRmta.cjs → TeamSection-Km7EwLWD.cjs} +1 -1
  53. package/dist/{TeamSection-DLxtRmta.cjs.map → TeamSection-Km7EwLWD.cjs.map} +1 -1
  54. package/dist/{UsersSection-BEKfbhQ4.cjs → UsersSection-C1Tt0ePx.cjs} +1 -1
  55. package/dist/{UsersSection-BEKfbhQ4.cjs.map → UsersSection-C1Tt0ePx.cjs.map} +1 -1
  56. package/dist/{UsersSection-DbGkmxty.js → UsersSection-Ct_E-MBF.js} +1 -1
  57. package/dist/{UsersSection-DbGkmxty.js.map → UsersSection-Ct_E-MBF.js.map} +1 -1
  58. package/dist/{WebhookSettings-DEHV2ptf.js → WebhookSettings-BhIwucKb.js} +1 -1
  59. package/dist/{WebhookSettings-DEHV2ptf.js.map → WebhookSettings-BhIwucKb.js.map} +1 -1
  60. package/dist/{WebhookSettings-Rq_nNJuw.cjs → WebhookSettings-C6X_JJcD.cjs} +1 -1
  61. package/dist/{WebhookSettings-Rq_nNJuw.cjs.map → WebhookSettings-C6X_JJcD.cjs.map} +1 -1
  62. package/dist/{WebhookSettings-CpPvGmV7.js → WebhookSettings-D9IsXZJN.js} +1 -1
  63. package/dist/{WebhookSettings-CpPvGmV7.js.map → WebhookSettings-D9IsXZJN.js.map} +1 -1
  64. package/dist/{WebhookSettings-DbyPJ8V2.cjs → WebhookSettings-H1x6IKOj.cjs} +1 -1
  65. package/dist/{WebhookSettings-DbyPJ8V2.cjs.map → WebhookSettings-H1x6IKOj.cjs.map} +1 -1
  66. package/dist/admin-only.cjs +1 -1
  67. package/dist/admin-only.js +1 -1
  68. package/dist/index.cjs +13 -13
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.d.ts +128 -22
  71. package/dist/index.js +7352 -6482
  72. package/dist/index.js.map +1 -1
  73. package/dist/{plugin-C4bijrSr.cjs → plugin-BwwJh2cY.cjs} +1 -1
  74. package/dist/{plugin-C4bijrSr.cjs.map → plugin-BwwJh2cY.cjs.map} +1 -1
  75. package/dist/{plugin-Bwwe7_ZO.js → plugin-CetHtdLq.js} +1 -1
  76. package/dist/{plugin-Bwwe7_ZO.js.map → plugin-CetHtdLq.js.map} +1 -1
  77. package/dist/useUsersStatsSummary-BGeh3RnI.js +2025 -0
  78. package/dist/useUsersStatsSummary-BGeh3RnI.js.map +1 -0
  79. package/dist/useUsersStatsSummary-DnsYtFGX.cjs +1 -0
  80. package/dist/useUsersStatsSummary-DnsYtFGX.cjs.map +1 -0
  81. package/package.json +1 -1
  82. package/dist/AutosaveStatus-ByD01ENa.cjs.map +0 -1
  83. package/dist/AutosaveStatus-DtF_58rC.js.map +0 -1
  84. package/dist/PermissionsSection-BDDiEfho.js.map +0 -1
  85. package/dist/PermissionsSection-CSB_Ikj9.cjs.map +0 -1
  86. package/dist/assets/argon2Worker-Bi5TuQvD.js +0 -1
  87. package/dist/assets/argon2Worker-Bi5TuQvD.js.map +0 -1
  88. package/dist/useUsersStatsSummary-9HQDKBU5.js +0 -1879
  89. package/dist/useUsersStatsSummary-9HQDKBU5.js.map +0 -1
  90. package/dist/useUsersStatsSummary-DiRC8sGs.cjs +0 -1
  91. package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as d, Fragment as T } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as e, Fragment as T } from "react/jsx-runtime";
2
2
  import { useMemo as N, useCallback as m, useState as f, useRef as P, useEffect as I } from "react";
3
3
  import { u as U } from "./useCedrosLogin-CFfID-0i.js";
4
4
  import { u as O } from "./useSystemSettings-rgskaDqP.js";
@@ -1421,11 +1421,6 @@ const W = {
1421
1421
  description: "Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",
1422
1422
  icon: ""
1423
1423
  },
1424
- referral: {
1425
- label: "Referral & Payouts",
1426
- description: "Configure referral rewards, payout triggers, and the automated payout worker.",
1427
- icon: ""
1428
- },
1429
1424
  rate_limit: {
1430
1425
  label: "Rate Limiting",
1431
1426
  description: "Protect the system from abuse by limiting request rates. Balance security with user experience.",
@@ -1475,6 +1470,11 @@ const W = {
1475
1470
  label: "Token Gating",
1476
1471
  description: "Configure Solana wallet holdings requirements for gated access.",
1477
1472
  icon: ""
1473
+ },
1474
+ referral: {
1475
+ label: "Referrals & Rewards",
1476
+ description: "Configure referral reward types, amounts, triggers, caps, and payout worker settings.",
1477
+ icon: ""
1478
1478
  }
1479
1479
  }, L = [
1480
1480
  "SOL",
@@ -1488,6 +1488,264 @@ const W = {
1488
1488
  "BONK",
1489
1489
  "ORE"
1490
1490
  ];
1491
+ function j({ value: t, onChange: i, multiline: a }) {
1492
+ const [n, r] = f(!1), [s, p] = f(!1), l = t && t.length > 0, o = m(() => {
1493
+ r(!0), p(!0);
1494
+ }, []), c = m(() => {
1495
+ r(!1), p(!1);
1496
+ }, []), y = m(
1497
+ (b) => {
1498
+ i(b.target.value);
1499
+ },
1500
+ [i]
1501
+ );
1502
+ return !n && l ? /* @__PURE__ */ d("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1503
+ /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
1504
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
1505
+ ] }) : /* @__PURE__ */ d("div", { className: "cedros-secret-input", children: [
1506
+ a ? /* @__PURE__ */ e(
1507
+ "textarea",
1508
+ {
1509
+ value: t,
1510
+ onChange: y,
1511
+ className: "cedros-setting-input cedros-setting-textarea",
1512
+ placeholder: "Enter secret value...",
1513
+ rows: 4
1514
+ }
1515
+ ) : /* @__PURE__ */ e(
1516
+ "input",
1517
+ {
1518
+ type: s ? "text" : "password",
1519
+ value: t,
1520
+ onChange: y,
1521
+ className: "cedros-setting-input",
1522
+ placeholder: "Enter secret value..."
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ d("div", { className: "cedros-secret-actions", children: [
1526
+ !a && /* @__PURE__ */ e(
1527
+ "button",
1528
+ {
1529
+ type: "button",
1530
+ className: "cedros-secret-toggle-btn",
1531
+ onClick: () => p(!s),
1532
+ children: s ? "Hide" : "Show"
1533
+ }
1534
+ ),
1535
+ n && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1536
+ ] })
1537
+ ] });
1538
+ }
1539
+ function F({ settingKey: t, value: i }) {
1540
+ 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 () => {
1541
+ if (g)
1542
+ try {
1543
+ await navigator.clipboard.writeText(g), s(!0), setTimeout(() => s(!1), 2e3);
1544
+ } catch {
1545
+ const u = document.createElement("textarea");
1546
+ u.value = g, document.body.appendChild(u), u.select(), document.execCommand("copy"), document.body.removeChild(u), s(!0), setTimeout(() => s(!1), 2e3);
1547
+ }
1548
+ }, [g]), k = m(async () => {
1549
+ l(!0), c(null);
1550
+ try {
1551
+ const u = w?.getAccessToken?.(), v = { "Content-Type": "application/json" };
1552
+ u && (v.Authorization = `Bearer ${u}`);
1553
+ const S = await fetch(
1554
+ `${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
1555
+ { method: "POST", headers: v, credentials: "include" }
1556
+ );
1557
+ if (!S.ok) {
1558
+ const A = await S.json().catch(() => null);
1559
+ throw new Error(A?.message || A?.error || `Regenerate failed (${S.status})`);
1560
+ }
1561
+ const E = await S.json();
1562
+ n(E.value), b(!1);
1563
+ } catch (u) {
1564
+ c(u instanceof Error ? u.message : "Failed to regenerate");
1565
+ } finally {
1566
+ l(!1);
1567
+ }
1568
+ }, [_.serverUrl, w, t]);
1569
+ return /* @__PURE__ */ d("div", { className: "cedros-readonly-secret", children: [
1570
+ /* @__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" }) }),
1571
+ /* @__PURE__ */ d("div", { className: "cedros-readonly-secret-actions", children: [
1572
+ x && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-action-btn", onClick: h, children: r ? "Copied!" : "Copy" }),
1573
+ y ? /* @__PURE__ */ d("span", { className: "cedros-readonly-secret-confirm", children: [
1574
+ /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
1575
+ /* @__PURE__ */ e(
1576
+ "button",
1577
+ {
1578
+ type: "button",
1579
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1580
+ onClick: k,
1581
+ disabled: p,
1582
+ children: p ? "Regenerating..." : "Confirm"
1583
+ }
1584
+ ),
1585
+ /* @__PURE__ */ e(
1586
+ "button",
1587
+ {
1588
+ type: "button",
1589
+ className: "cedros-secret-action-btn",
1590
+ onClick: () => b(!1),
1591
+ disabled: p,
1592
+ children: "Cancel"
1593
+ }
1594
+ )
1595
+ ] }) : /* @__PURE__ */ e(
1596
+ "button",
1597
+ {
1598
+ type: "button",
1599
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1600
+ onClick: () => b(!0),
1601
+ disabled: p,
1602
+ children: "Regenerate"
1603
+ }
1604
+ )
1605
+ ] }),
1606
+ o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
1607
+ ] });
1608
+ }
1609
+ function $({ value: t, onChange: i }) {
1610
+ const a = N(() => {
1611
+ try {
1612
+ return JSON.parse(t || "[]");
1613
+ } catch {
1614
+ return [];
1615
+ }
1616
+ }, [t]), n = m(
1617
+ (l) => {
1618
+ i(JSON.stringify(l));
1619
+ },
1620
+ [i]
1621
+ ), r = m(() => {
1622
+ n([...a, { symbol: "", mint: "", decimals: 6 }]);
1623
+ }, [a, n]), s = m(
1624
+ (l, o, c) => {
1625
+ const y = [...a];
1626
+ y[l] = { ...y[l], [o]: c }, n(y);
1627
+ },
1628
+ [a, n]
1629
+ ), p = m(
1630
+ (l) => {
1631
+ n(a.filter((o, c) => c !== l));
1632
+ },
1633
+ [a, n]
1634
+ );
1635
+ return /* @__PURE__ */ d("div", { className: "cedros-token-list-input", children: [
1636
+ /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
1637
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1638
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((l) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: l }, l)) })
1639
+ ] }),
1640
+ 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." }),
1641
+ a.map((l, o) => /* @__PURE__ */ d("div", { className: "cedros-token-row", children: [
1642
+ /* @__PURE__ */ d("div", { className: "cedros-token-row-fields", children: [
1643
+ /* @__PURE__ */ e(
1644
+ "input",
1645
+ {
1646
+ type: "text",
1647
+ placeholder: "Symbol",
1648
+ value: l.symbol,
1649
+ onChange: (c) => s(o, "symbol", c.target.value.toUpperCase()),
1650
+ className: "cedros-setting-input cedros-token-input-symbol",
1651
+ maxLength: 10
1652
+ }
1653
+ ),
1654
+ /* @__PURE__ */ e(
1655
+ "input",
1656
+ {
1657
+ type: "text",
1658
+ placeholder: "Mint address",
1659
+ value: l.mint,
1660
+ onChange: (c) => s(o, "mint", c.target.value),
1661
+ className: "cedros-setting-input cedros-token-input-mint"
1662
+ }
1663
+ ),
1664
+ /* @__PURE__ */ e(
1665
+ "input",
1666
+ {
1667
+ type: "number",
1668
+ placeholder: "Decimals",
1669
+ value: l.decimals,
1670
+ onChange: (c) => s(o, "decimals", parseInt(c.target.value, 10) || 0),
1671
+ className: "cedros-setting-input cedros-token-input-decimals",
1672
+ min: 0,
1673
+ max: 18
1674
+ }
1675
+ ),
1676
+ /* @__PURE__ */ e(
1677
+ "input",
1678
+ {
1679
+ type: "text",
1680
+ placeholder: "Logo URL (optional)",
1681
+ value: l.logoUrl || "",
1682
+ onChange: (c) => s(o, "logoUrl", c.target.value || void 0),
1683
+ className: "cedros-setting-input cedros-token-input-logo"
1684
+ }
1685
+ )
1686
+ ] }),
1687
+ /* @__PURE__ */ e(
1688
+ "button",
1689
+ {
1690
+ type: "button",
1691
+ className: "cedros-token-remove-btn",
1692
+ onClick: () => p(o),
1693
+ title: "Remove token",
1694
+ children: "×"
1695
+ }
1696
+ )
1697
+ ] }, o)),
1698
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: r, children: "+ Add Token" })
1699
+ ] });
1700
+ }
1701
+ function V({ value: t, onChange: i }) {
1702
+ const a = N(() => t.split(",").map((s) => s.trim()).filter(Boolean), [t]), n = m(
1703
+ (s) => {
1704
+ if (!s || a.includes(s)) return;
1705
+ const p = [...a, s].join(", ");
1706
+ i(p);
1707
+ },
1708
+ [a, i]
1709
+ ), r = m(
1710
+ (s) => {
1711
+ const p = a.filter((l) => l !== s).join(", ");
1712
+ i(p);
1713
+ },
1714
+ [a, i]
1715
+ );
1716
+ return /* @__PURE__ */ d("div", { className: "cedros-token-symbol-list-input", children: [
1717
+ /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
1718
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
1719
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((s) => {
1720
+ const p = a.includes(s);
1721
+ return /* @__PURE__ */ d(
1722
+ "button",
1723
+ {
1724
+ type: "button",
1725
+ className: `cedros-token-preset-chip ${p ? "cedros-token-preset-chip-selected" : ""}`,
1726
+ onClick: () => p ? r(s) : n(s),
1727
+ title: p ? `Remove ${s}` : `Add ${s}`,
1728
+ children: [
1729
+ s,
1730
+ p && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
1731
+ ]
1732
+ },
1733
+ s
1734
+ );
1735
+ }) })
1736
+ ] }),
1737
+ /* @__PURE__ */ e(
1738
+ "input",
1739
+ {
1740
+ type: "text",
1741
+ value: t,
1742
+ onChange: (s) => i(s.target.value),
1743
+ className: "cedros-setting-input",
1744
+ placeholder: "USDC, SOL, BONK..."
1745
+ }
1746
+ )
1747
+ ] });
1748
+ }
1491
1749
  function D(t) {
1492
1750
  const i = t.split(/(<a\s[^>]*>.*?<\/a>)/g);
1493
1751
  return i.length === 1 ? t : i.map((a, n) => {
@@ -1502,7 +1760,7 @@ function ie({
1502
1760
  externalWarnings: n
1503
1761
  }) {
1504
1762
  return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((r) => /* @__PURE__ */ e(
1505
- j,
1763
+ B,
1506
1764
  {
1507
1765
  setting: r,
1508
1766
  editValue: i[r.key],
@@ -1512,7 +1770,7 @@ function ie({
1512
1770
  r.key
1513
1771
  )) });
1514
1772
  }
1515
- function j({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
1773
+ function B({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
1516
1774
  const r = W[t.key], s = i ?? t.value, p = i !== void 0 && i !== t.value, l = r?.inputType === "boolean", o = N(() => {
1517
1775
  if (n) return n;
1518
1776
  if (!r?.warningThreshold) return null;
@@ -1578,10 +1836,10 @@ function j({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
1578
1836
  function R({ meta: t, value: i, onChange: a }) {
1579
1837
  switch (t.inputType) {
1580
1838
  case "duration":
1581
- return /* @__PURE__ */ e(F, { value: i, onChange: a, presets: t.presets, min: t.min });
1839
+ return /* @__PURE__ */ e(H, { value: i, onChange: a, presets: t.presets, min: t.min });
1582
1840
  case "percentage":
1583
1841
  return /* @__PURE__ */ e(
1584
- $,
1842
+ G,
1585
1843
  {
1586
1844
  value: i,
1587
1845
  onChange: a,
@@ -1593,7 +1851,7 @@ function R({ meta: t, value: i, onChange: a }) {
1593
1851
  );
1594
1852
  case "select":
1595
1853
  return /* @__PURE__ */ e(
1596
- V,
1854
+ K,
1597
1855
  {
1598
1856
  value: i,
1599
1857
  onChange: a,
@@ -1603,7 +1861,7 @@ function R({ meta: t, value: i, onChange: a }) {
1603
1861
  );
1604
1862
  case "number":
1605
1863
  return /* @__PURE__ */ e(
1606
- B,
1864
+ J,
1607
1865
  {
1608
1866
  value: i,
1609
1867
  onChange: a,
@@ -1613,7 +1871,7 @@ function R({ meta: t, value: i, onChange: a }) {
1613
1871
  }
1614
1872
  );
1615
1873
  case "tokenList":
1616
- return /* @__PURE__ */ e(J, { value: i, onChange: a });
1874
+ return /* @__PURE__ */ e($, { value: i, onChange: a });
1617
1875
  case "text":
1618
1876
  return /* @__PURE__ */ e(
1619
1877
  "input",
@@ -1626,13 +1884,13 @@ function R({ meta: t, value: i, onChange: a }) {
1626
1884
  }
1627
1885
  );
1628
1886
  case "boolean":
1629
- return /* @__PURE__ */ e(H, { value: i, onChange: a });
1887
+ return /* @__PURE__ */ e(z, { value: i, onChange: a });
1630
1888
  case "secret":
1631
- return /* @__PURE__ */ e(G, { value: i, onChange: a, multiline: t.multiline });
1889
+ return /* @__PURE__ */ e(j, { value: i, onChange: a, multiline: t.multiline });
1632
1890
  case "readonlySecret":
1633
- return /* @__PURE__ */ e(K, { settingKey: t.key, value: i });
1891
+ return /* @__PURE__ */ e(F, { settingKey: t.key, value: i });
1634
1892
  case "tokenSymbolList":
1635
- return /* @__PURE__ */ e(z, { value: i, onChange: a });
1893
+ return /* @__PURE__ */ e(V, { value: i, onChange: a });
1636
1894
  default:
1637
1895
  return /* @__PURE__ */ e(
1638
1896
  "input",
@@ -1645,7 +1903,7 @@ function R({ meta: t, value: i, onChange: a }) {
1645
1903
  );
1646
1904
  }
1647
1905
  }
1648
- function F({ value: t, onChange: i, presets: a, min: n = 0 }) {
1906
+ function H({ value: t, onChange: i, presets: a, min: n = 0 }) {
1649
1907
  const r = parseInt(t, 10) || 0, s = q(r), p = m(
1650
1908
  (o) => {
1651
1909
  o.target.value && i(o.target.value);
@@ -1690,7 +1948,7 @@ function F({ value: t, onChange: i, presets: a, min: n = 0 }) {
1690
1948
  ] })
1691
1949
  ] });
1692
1950
  }
1693
- function $({
1951
+ function G({
1694
1952
  value: t,
1695
1953
  onChange: i,
1696
1954
  min: a,
@@ -1740,7 +1998,7 @@ function $({
1740
1998
  )) })
1741
1999
  ] });
1742
2000
  }
1743
- function V({ value: t, onChange: i, presets: a, unit: n }) {
2001
+ function K({ value: t, onChange: i, presets: a, unit: n }) {
1744
2002
  const r = !a.some((l) => l.value === t), s = m(
1745
2003
  (l) => {
1746
2004
  l.target.value !== "__custom__" && i(l.target.value);
@@ -1779,7 +2037,7 @@ function V({ value: t, onChange: i, presets: a, unit: n }) {
1779
2037
  ] })
1780
2038
  ] });
1781
2039
  }
1782
- function B({ value: t, onChange: i, min: a, max: n, unit: r }) {
2040
+ function J({ value: t, onChange: i, min: a, max: n, unit: r }) {
1783
2041
  const s = m(
1784
2042
  (p) => {
1785
2043
  i(p.target.value);
@@ -1801,7 +2059,7 @@ function B({ value: t, onChange: i, min: a, max: n, unit: r }) {
1801
2059
  r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
1802
2060
  ] });
1803
2061
  }
1804
- function H({ value: t, onChange: i }) {
2062
+ function z({ value: t, onChange: i }) {
1805
2063
  const a = t === "true", n = m(() => {
1806
2064
  i(a ? "false" : "true");
1807
2065
  }, [a, i]);
@@ -1820,264 +2078,6 @@ function H({ value: t, onChange: i }) {
1820
2078
  }
1821
2079
  );
1822
2080
  }
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);
1826
- }, []), c = m(() => {
1827
- r(!1), p(!1);
1828
- }, []), y = m(
1829
- (b) => {
1830
- i(b.target.value);
1831
- },
1832
- [i]
1833
- );
1834
- return !n && l ? /* @__PURE__ */ d("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1835
- /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
1836
- /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
1837
- ] }) : /* @__PURE__ */ d("div", { className: "cedros-secret-input", children: [
1838
- a ? /* @__PURE__ */ e(
1839
- "textarea",
1840
- {
1841
- value: t,
1842
- onChange: y,
1843
- className: "cedros-setting-input cedros-setting-textarea",
1844
- placeholder: "Enter secret value...",
1845
- rows: 4
1846
- }
1847
- ) : /* @__PURE__ */ e(
1848
- "input",
1849
- {
1850
- type: s ? "text" : "password",
1851
- value: t,
1852
- onChange: y,
1853
- className: "cedros-setting-input",
1854
- placeholder: "Enter secret value..."
1855
- }
1856
- ),
1857
- /* @__PURE__ */ d("div", { className: "cedros-secret-actions", children: [
1858
- !a && /* @__PURE__ */ e(
1859
- "button",
1860
- {
1861
- type: "button",
1862
- className: "cedros-secret-toggle-btn",
1863
- onClick: () => p(!s),
1864
- children: s ? "Hide" : "Show"
1865
- }
1866
- ),
1867
- n && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1868
- ] })
1869
- ] });
1870
- }
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 () => {
1873
- if (g)
1874
- try {
1875
- await navigator.clipboard.writeText(g), s(!0), setTimeout(() => s(!1), 2e3);
1876
- } catch {
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);
1879
- }
1880
- }, [g]), k = m(async () => {
1881
- l(!0), c(null);
1882
- try {
1883
- const u = w?.getAccessToken?.(), v = { "Content-Type": "application/json" };
1884
- u && (v.Authorization = `Bearer ${u}`);
1885
- const S = await fetch(
1886
- `${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
1887
- { method: "POST", headers: v, credentials: "include" }
1888
- );
1889
- if (!S.ok) {
1890
- const A = await S.json().catch(() => null);
1891
- throw new Error(A?.message || A?.error || `Regenerate failed (${S.status})`);
1892
- }
1893
- const E = await S.json();
1894
- n(E.value), b(!1);
1895
- } catch (u) {
1896
- c(u instanceof Error ? u.message : "Failed to regenerate");
1897
- } finally {
1898
- l(!1);
1899
- }
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: [
1906
- /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
1907
- /* @__PURE__ */ e(
1908
- "button",
1909
- {
1910
- type: "button",
1911
- className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1912
- onClick: k,
1913
- disabled: p,
1914
- children: p ? "Regenerating..." : "Confirm"
1915
- }
1916
- ),
1917
- /* @__PURE__ */ e(
1918
- "button",
1919
- {
1920
- type: "button",
1921
- className: "cedros-secret-action-btn",
1922
- onClick: () => b(!1),
1923
- disabled: p,
1924
- children: "Cancel"
1925
- }
1926
- )
1927
- ] }) : /* @__PURE__ */ e(
1928
- "button",
1929
- {
1930
- type: "button",
1931
- className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1932
- onClick: () => b(!0),
1933
- disabled: p,
1934
- children: "Regenerate"
1935
- }
1936
- )
1937
- ] }),
1938
- o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
1939
- ] });
1940
- }
1941
- function J({ value: t, onChange: i }) {
1942
- const a = N(() => {
1943
- try {
1944
- return JSON.parse(t || "[]");
1945
- } catch {
1946
- return [];
1947
- }
1948
- }, [t]), n = m(
1949
- (l) => {
1950
- i(JSON.stringify(l));
1951
- },
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);
1959
- },
1960
- [a, n]
1961
- ), p = m(
1962
- (l) => {
1963
- n(a.filter((o, c) => c !== l));
1964
- },
1965
- [a, n]
1966
- );
1967
- return /* @__PURE__ */ d("div", { className: "cedros-token-list-input", children: [
1968
- /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
1969
- /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1970
- /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((l) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: l }, l)) })
1971
- ] }),
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." }),
1973
- a.map((l, o) => /* @__PURE__ */ d("div", { className: "cedros-token-row", children: [
1974
- /* @__PURE__ */ d("div", { className: "cedros-token-row-fields", children: [
1975
- /* @__PURE__ */ e(
1976
- "input",
1977
- {
1978
- type: "text",
1979
- placeholder: "Symbol",
1980
- value: l.symbol,
1981
- onChange: (c) => s(o, "symbol", c.target.value.toUpperCase()),
1982
- className: "cedros-setting-input cedros-token-input-symbol",
1983
- maxLength: 10
1984
- }
1985
- ),
1986
- /* @__PURE__ */ e(
1987
- "input",
1988
- {
1989
- type: "text",
1990
- placeholder: "Mint address",
1991
- value: l.mint,
1992
- onChange: (c) => s(o, "mint", c.target.value),
1993
- className: "cedros-setting-input cedros-token-input-mint"
1994
- }
1995
- ),
1996
- /* @__PURE__ */ e(
1997
- "input",
1998
- {
1999
- type: "number",
2000
- placeholder: "Decimals",
2001
- value: l.decimals,
2002
- onChange: (c) => s(o, "decimals", parseInt(c.target.value, 10) || 0),
2003
- className: "cedros-setting-input cedros-token-input-decimals",
2004
- min: 0,
2005
- max: 18
2006
- }
2007
- ),
2008
- /* @__PURE__ */ e(
2009
- "input",
2010
- {
2011
- type: "text",
2012
- placeholder: "Logo URL (optional)",
2013
- value: l.logoUrl || "",
2014
- onChange: (c) => s(o, "logoUrl", c.target.value || void 0),
2015
- className: "cedros-setting-input cedros-token-input-logo"
2016
- }
2017
- )
2018
- ] }),
2019
- /* @__PURE__ */ e(
2020
- "button",
2021
- {
2022
- type: "button",
2023
- className: "cedros-token-remove-btn",
2024
- onClick: () => p(o),
2025
- title: "Remove token",
2026
- children: "×"
2027
- }
2028
- )
2029
- ] }, o)),
2030
- /* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: r, children: "+ Add Token" })
2031
- ] });
2032
- }
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);
2039
- },
2040
- [a, i]
2041
- ), r = m(
2042
- (s) => {
2043
- const p = a.filter((l) => l !== s).join(", ");
2044
- i(p);
2045
- },
2046
- [a, i]
2047
- );
2048
- return /* @__PURE__ */ d("div", { className: "cedros-token-symbol-list-input", children: [
2049
- /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
2050
- /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
2051
- /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: L.map((s) => {
2052
- const p = a.includes(s);
2053
- return /* @__PURE__ */ d(
2054
- "button",
2055
- {
2056
- type: "button",
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}`,
2060
- children: [
2061
- s,
2062
- p && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
2063
- ]
2064
- },
2065
- s
2066
- );
2067
- }) })
2068
- ] }),
2069
- /* @__PURE__ */ e(
2070
- "input",
2071
- {
2072
- type: "text",
2073
- value: t,
2074
- onChange: (s) => i(s.target.value),
2075
- className: "cedros-setting-input",
2076
- placeholder: "USDC, SOL, BONK..."
2077
- }
2078
- )
2079
- ] });
2080
- }
2081
2081
  const Y = 800, X = 2e3;
2082
2082
  function re() {
2083
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({});