@cedros/pay-react 1.1.25 → 1.1.26
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/{AISettingsSection-Dg1kazTI.mjs → AISettingsSection-BlIv3CzS.mjs} +2 -2
- package/dist/{AISettingsSection-BvSSiK2G.js → AISettingsSection-DELur7D2.js} +1 -1
- package/dist/{AutosaveIndicator-BHfkV59p.mjs → AutosaveIndicator-Bed0-ekg.mjs} +1 -1
- package/dist/{AutosaveIndicator-D2l7U8R1.js → AutosaveIndicator-Dn_qA2hK.js} +1 -1
- package/dist/ChatLogsSection-BH5tLA4T.js +1 -0
- package/dist/ChatLogsSection-v4zwzCTC.mjs +201 -0
- package/dist/{ComplianceSection-BSE2f3Wo.mjs → ComplianceSection-CemgfDrL.mjs} +282 -166
- package/dist/ComplianceSection-DP2a9-S0.js +1 -0
- package/dist/CustomersSection-CBwy_waO.js +1 -0
- package/dist/CustomersSection-D_j7OrfS.mjs +207 -0
- package/dist/DisputesSection-BLjIk60n.js +1 -0
- package/dist/DisputesSection-BcAbXp3K.mjs +230 -0
- package/dist/{FAQSection-uZG5V3pJ.mjs → FAQSection-Dn38OhB_.mjs} +1 -1
- package/dist/{FAQSection-6nGI0FK9.js → FAQSection-wNeH0i6Q.js} +1 -1
- package/dist/ImagesSection-0ZzKlzMJ.js +1 -0
- package/dist/ImagesSection-Ctw9Icym.mjs +216 -0
- package/dist/InventorySection-DmhjUlRZ.mjs +150 -0
- package/dist/InventorySection-zV6lTmue.js +1 -0
- package/dist/{MessagingSection-M0lj5yo4.mjs → MessagingSection-B1FaGxkp.mjs} +2 -2
- package/dist/{MessagingSection-DrXb578q.js → MessagingSection-B_wdFR0j.js} +1 -1
- package/dist/{OrdersSection-DteItv_O.mjs → OrdersSection-Bj8bPdg8.mjs} +1 -1
- package/dist/{OrdersSection-_-rIw6XW.js → OrdersSection-Dw2FX-1d.js} +1 -1
- package/dist/{PaymentSettingsSection-enTbUI95.js → PaymentSettingsSection-BYF4D-GR.js} +1 -1
- package/dist/{PaymentSettingsSection-CdtdLFTg.mjs → PaymentSettingsSection-EnMxeWjv.mjs} +1 -1
- package/dist/ReturnsSection-BC0L8r2e.mjs +267 -0
- package/dist/ReturnsSection-D_pJVxuG.js +1 -0
- package/dist/{SettingsSection-mcT4LEhO.mjs → SettingsSection-KYdEizq_.mjs} +1 -1
- package/dist/{SettingsSection-DUTEd6uV.js → SettingsSection-vdYFSNxB.js} +1 -1
- package/dist/ShippingSection-1DRSTu49.js +1 -0
- package/dist/ShippingSection-BOgto6_9.mjs +434 -0
- package/dist/{SingleCategorySettings-D2LVM5mn.js → SingleCategorySettings-DwCnBdRf.js} +1 -1
- package/dist/{SingleCategorySettings-BvHBVfSe.mjs → SingleCategorySettings-suJ8z9d8.mjs} +2 -2
- package/dist/{StorefrontSection-BqQ36JIS.mjs → StorefrontSection-BRvIGBEJ.mjs} +2 -2
- package/dist/{StorefrontSection-Du7hV2Gc.js → StorefrontSection-RumGkb3C.js} +1 -1
- package/dist/{SubscriptionsSection-C4BRN1dP.js → SubscriptionsSection-C2aLLn7L.js} +1 -1
- package/dist/{SubscriptionsSection-BYiCBwKZ.mjs → SubscriptionsSection-D60qrX9a.mjs} +1 -1
- package/dist/TaxSection-C7-pv-Rl.mjs +294 -0
- package/dist/TaxSection-Dt1DnM51.js +1 -0
- package/dist/{Token22Section-BHvOhz5d.mjs → Token22Section-CrHLQ0EB.mjs} +1 -1
- package/dist/{Token22Section-0c22NM5G.js → Token22Section-DY3mUwTY.js} +1 -1
- package/dist/WebhooksSection-CKeiJ7Py.js +1 -0
- package/dist/WebhooksSection-COPW4Ec0.mjs +223 -0
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +1 -1
- package/dist/index-C0g-JxJk.js +84 -0
- package/dist/{index-BkDimQDF.mjs → index-DXnuQp5x.mjs} +7068 -6768
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{sections-By4H1baL.mjs → sections-C1NpK7hk.mjs} +2 -2
- package/dist/{sections-5jO2aHAo.js → sections-DVVSZBhW.js} +1 -1
- package/dist/src/components/ComplianceGatePage.d.ts +3 -1
- package/dist/src/components/ComplianceGatePage.d.ts.map +1 -1
- package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts +1 -1
- package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -1
- package/dist/src/components/admin/ChatLogsSection.d.ts +3 -0
- package/dist/src/components/admin/ChatLogsSection.d.ts.map +1 -0
- package/dist/src/components/admin/ComplianceKycTab.d.ts +3 -0
- package/dist/src/components/admin/ComplianceKycTab.d.ts.map +1 -0
- package/dist/src/components/admin/ComplianceRequirementsEditor.d.ts +8 -0
- package/dist/src/components/admin/ComplianceRequirementsEditor.d.ts.map +1 -0
- package/dist/src/components/admin/ComplianceSection.d.ts.map +1 -1
- package/dist/src/components/admin/CustomersSection.d.ts +3 -0
- package/dist/src/components/admin/CustomersSection.d.ts.map +1 -0
- package/dist/src/components/admin/DisputesSection.d.ts +3 -0
- package/dist/src/components/admin/DisputesSection.d.ts.map +1 -0
- package/dist/src/components/admin/ImagesSection.d.ts +3 -0
- package/dist/src/components/admin/ImagesSection.d.ts.map +1 -0
- package/dist/src/components/admin/InventorySection.d.ts +3 -0
- package/dist/src/components/admin/InventorySection.d.ts.map +1 -0
- package/dist/src/components/admin/NftMetadataPreview.d.ts +20 -0
- package/dist/src/components/admin/NftMetadataPreview.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/src/components/admin/ReturnsSection.d.ts +3 -0
- package/dist/src/components/admin/ReturnsSection.d.ts.map +1 -0
- package/dist/src/components/admin/ShippingSection.d.ts +3 -0
- package/dist/src/components/admin/ShippingSection.d.ts.map +1 -0
- package/dist/src/components/admin/TaxSection.d.ts +3 -0
- package/dist/src/components/admin/TaxSection.d.ts.map +1 -0
- package/dist/src/components/admin/WebhooksSection.d.ts +3 -0
- package/dist/src/components/admin/WebhooksSection.d.ts.map +1 -0
- package/dist/src/components/admin/complianceTypes.d.ts +15 -1
- package/dist/src/components/admin/complianceTypes.d.ts.map +1 -1
- package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts +36 -0
- package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts +8 -5
- package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -1
- package/dist/src/ecommerce/index.d.ts +2 -2
- package/dist/src/ecommerce/index.d.ts.map +1 -1
- package/dist/src/hooks/useComplianceCheck.d.ts +1 -1
- package/dist/src/hooks/useComplianceCheck.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ComplianceSection-D6ETKG6b.js +0 -1
- package/dist/index-C7MWL6O8.js +0 -84
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
2
|
-
import { useState as i, useCallback as
|
|
3
|
-
import { I as k, E as me, j as
|
|
4
|
-
import { i as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useCallback as L, useEffect as U } from "react";
|
|
3
|
+
import { I as $, k as E, E as me, j as Z } from "./index-DXnuQp5x.mjs";
|
|
4
|
+
import { i as v } from "./CedrosContext-CY6zvjvJ.mjs";
|
|
5
|
+
const b = (s) => s.length > 12 ? `${s.slice(0, 6)}...${s.slice(-4)}` : s, he = (s) => {
|
|
6
6
|
switch (s) {
|
|
7
7
|
case "active":
|
|
8
8
|
return "success";
|
|
@@ -26,69 +26,81 @@ const m = (s) => s.length > 12 ? `${s.slice(0, 6)}...${s.slice(-4)}` : s, he = (
|
|
|
26
26
|
default:
|
|
27
27
|
return "muted";
|
|
28
28
|
}
|
|
29
|
-
}, ue =
|
|
29
|
+
}, ue = (s) => {
|
|
30
|
+
switch (s) {
|
|
31
|
+
case "verified":
|
|
32
|
+
return "success";
|
|
33
|
+
case "pending":
|
|
34
|
+
return "pending";
|
|
35
|
+
case "expired":
|
|
36
|
+
return "failed";
|
|
37
|
+
case "none":
|
|
38
|
+
default:
|
|
39
|
+
return "muted";
|
|
40
|
+
}
|
|
41
|
+
}, pe = "https://explorer.solana.com/tx/", fe = {
|
|
30
42
|
apiUrl: "",
|
|
31
43
|
refreshIntervalSecs: 3600,
|
|
32
44
|
enabled: !1
|
|
33
45
|
};
|
|
34
|
-
function ge({ serverUrl: s, apiKey:
|
|
35
|
-
const [c,
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
return
|
|
43
|
-
}, [s,
|
|
44
|
-
|
|
46
|
+
function ge({ serverUrl: s, apiKey: h, authManager: u }) {
|
|
47
|
+
const [c, l] = i(fe), [S, k] = i(!0), [p, g] = i(!1), [r, C] = i(!1), [A, _] = i(null), [T, y] = i(null), w = L(async (a, m) => {
|
|
48
|
+
if (u?.isAuthenticated())
|
|
49
|
+
return u.fetchWithAuth(a, m);
|
|
50
|
+
const N = { "Content-Type": "application/json" };
|
|
51
|
+
h && (N["X-API-Key"] = h);
|
|
52
|
+
const F = await fetch(`${s}${a}`, { ...m, headers: { ...N, ...m?.headers } });
|
|
53
|
+
if (!F.ok) throw new Error(`Request failed: ${F.status}`);
|
|
54
|
+
return F.json();
|
|
55
|
+
}, [s, h, u]);
|
|
56
|
+
U(() => {
|
|
45
57
|
(async () => {
|
|
46
58
|
try {
|
|
47
|
-
const a = await
|
|
48
|
-
|
|
59
|
+
const a = await w("/admin/compliance/sanctions-api");
|
|
60
|
+
l(a);
|
|
49
61
|
} catch (a) {
|
|
50
|
-
|
|
62
|
+
v().error("[ComplianceSanctionsApi] Failed to fetch settings:", a);
|
|
51
63
|
} finally {
|
|
52
|
-
|
|
64
|
+
k(!1);
|
|
53
65
|
}
|
|
54
66
|
})();
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
57
|
-
|
|
67
|
+
}, [w]);
|
|
68
|
+
const z = async () => {
|
|
69
|
+
g(!0), _(null), y(null);
|
|
58
70
|
try {
|
|
59
|
-
await
|
|
71
|
+
await w("/admin/compliance/sanctions-api", {
|
|
60
72
|
method: "PUT",
|
|
61
73
|
body: JSON.stringify(c)
|
|
62
74
|
}), y("Settings saved");
|
|
63
75
|
} catch (a) {
|
|
64
|
-
|
|
76
|
+
v().error("[ComplianceSanctionsApi] Save failed:", a), _("Failed to save settings");
|
|
65
77
|
} finally {
|
|
66
|
-
|
|
78
|
+
g(!1);
|
|
67
79
|
}
|
|
68
|
-
},
|
|
69
|
-
C(!0),
|
|
80
|
+
}, d = async () => {
|
|
81
|
+
C(!0), _(null), y(null);
|
|
70
82
|
try {
|
|
71
|
-
await
|
|
83
|
+
await w("/admin/compliance/sanctions-api/refresh", { method: "POST" }), y("Sanctions list refreshed");
|
|
72
84
|
} catch (a) {
|
|
73
|
-
|
|
85
|
+
v().error("[ComplianceSanctionsApi] Refresh failed:", a), _("Failed to refresh sanctions list");
|
|
74
86
|
} finally {
|
|
75
87
|
C(!1);
|
|
76
88
|
}
|
|
77
89
|
};
|
|
78
|
-
return
|
|
79
|
-
|
|
90
|
+
return S ? /* @__PURE__ */ n("div", { className: "cedros-admin__loading", children: [
|
|
91
|
+
$.loading,
|
|
80
92
|
" Loading sanctions API settings..."
|
|
81
93
|
] }) : /* @__PURE__ */ n("div", { style: { maxWidth: "500px", display: "flex", flexDirection: "column", gap: "1rem" }, children: [
|
|
82
94
|
/* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Dynamic Sanctions API" }) }),
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
A && /* @__PURE__ */ e("div", { className: "cedros-admin__badge cedros-admin__badge--failed", style: { padding: "0.5rem" }, children: A }),
|
|
96
|
+
T && /* @__PURE__ */ e("div", { className: "cedros-admin__badge cedros-admin__badge--success", style: { padding: "0.5rem" }, children: T }),
|
|
85
97
|
/* @__PURE__ */ n("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", fontSize: "0.9rem" }, children: [
|
|
86
98
|
/* @__PURE__ */ e(
|
|
87
99
|
"input",
|
|
88
100
|
{
|
|
89
101
|
type: "checkbox",
|
|
90
102
|
checked: c.enabled,
|
|
91
|
-
onChange: (a) =>
|
|
103
|
+
onChange: (a) => l((m) => ({ ...m, enabled: a.target.checked }))
|
|
92
104
|
}
|
|
93
105
|
),
|
|
94
106
|
"Enable dynamic sanctions list"
|
|
@@ -102,7 +114,7 @@ function ge({ serverUrl: s, apiKey: g, authManager: f }) {
|
|
|
102
114
|
className: "cedros-admin__input",
|
|
103
115
|
placeholder: "https://sunscreen.cedros.io",
|
|
104
116
|
value: c.apiUrl,
|
|
105
|
-
onChange: (a) =>
|
|
117
|
+
onChange: (a) => l((m) => ({ ...m, apiUrl: a.target.value }))
|
|
106
118
|
}
|
|
107
119
|
)
|
|
108
120
|
] }),
|
|
@@ -115,7 +127,7 @@ function ge({ serverUrl: s, apiKey: g, authManager: f }) {
|
|
|
115
127
|
className: "cedros-admin__input",
|
|
116
128
|
min: 60,
|
|
117
129
|
value: c.refreshIntervalSecs,
|
|
118
|
-
onChange: (a) =>
|
|
130
|
+
onChange: (a) => l((m) => ({ ...m, refreshIntervalSecs: Number(a.target.value) })),
|
|
119
131
|
style: { width: "160px" }
|
|
120
132
|
}
|
|
121
133
|
)
|
|
@@ -125,152 +137,255 @@ function ge({ serverUrl: s, apiKey: g, authManager: f }) {
|
|
|
125
137
|
"button",
|
|
126
138
|
{
|
|
127
139
|
className: "cedros-admin__button cedros-admin__button--primary",
|
|
128
|
-
onClick:
|
|
129
|
-
disabled:
|
|
130
|
-
children:
|
|
140
|
+
onClick: z,
|
|
141
|
+
disabled: p,
|
|
142
|
+
children: p ? "Saving..." : "Save Settings"
|
|
131
143
|
}
|
|
132
144
|
),
|
|
133
145
|
/* @__PURE__ */ e(
|
|
134
146
|
"button",
|
|
135
147
|
{
|
|
136
148
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
137
|
-
onClick:
|
|
138
|
-
disabled:
|
|
139
|
-
children:
|
|
149
|
+
onClick: d,
|
|
150
|
+
disabled: r || !c.enabled || !c.apiUrl,
|
|
151
|
+
children: r ? "Refreshing..." : "Force Refresh"
|
|
140
152
|
}
|
|
141
153
|
)
|
|
142
154
|
] })
|
|
143
155
|
] });
|
|
144
156
|
}
|
|
145
|
-
function
|
|
146
|
-
const [
|
|
157
|
+
function _e({ serverUrl: s, apiKey: h, authManager: u }) {
|
|
158
|
+
const [c, l] = i(""), [S, k] = i(!1), [p, g] = i(null), [r, C] = i(null), [A, _] = i(!1), T = L(async (d, a) => {
|
|
159
|
+
if (u?.isAuthenticated())
|
|
160
|
+
return u.fetchWithAuth(d, a);
|
|
161
|
+
const m = { "Content-Type": "application/json" };
|
|
162
|
+
h && (m["X-API-Key"] = h);
|
|
163
|
+
const N = await fetch(`${s}${d}`, { ...a, headers: { ...m, ...a?.headers } });
|
|
164
|
+
if (!N.ok) throw new Error(`Request failed: ${N.status}`);
|
|
165
|
+
return N.json();
|
|
166
|
+
}, [s, h, u]), y = async () => {
|
|
167
|
+
const d = c.trim();
|
|
168
|
+
if (d) {
|
|
169
|
+
k(!0), g(null), C(null), _(!0);
|
|
170
|
+
try {
|
|
171
|
+
const a = await T(
|
|
172
|
+
`/admin/compliance/user-status/${encodeURIComponent(d)}`
|
|
173
|
+
);
|
|
174
|
+
C(a);
|
|
175
|
+
} catch (a) {
|
|
176
|
+
v().error("[ComplianceKycTab] Lookup failed:", a), g("Failed to fetch user compliance status. Ensure cedros-login is configured.");
|
|
177
|
+
} finally {
|
|
178
|
+
k(!1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, w = (d) => {
|
|
182
|
+
d.key === "Enter" && y();
|
|
183
|
+
}, z = (d) => {
|
|
184
|
+
switch (d) {
|
|
185
|
+
case "verified":
|
|
186
|
+
return "Verified";
|
|
187
|
+
case "pending":
|
|
188
|
+
return "Pending";
|
|
189
|
+
case "expired":
|
|
190
|
+
return "Expired";
|
|
191
|
+
case "none":
|
|
192
|
+
default:
|
|
193
|
+
return "Not Started";
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
return /* @__PURE__ */ n("div", { children: [
|
|
197
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "KYC & Accredited Investor Status" }) }),
|
|
198
|
+
/* @__PURE__ */ e("p", { style: { fontSize: "0.85rem", color: "var(--cedros-admin-text-muted, #888)", marginBottom: "1rem" }, children: "Look up a user's KYC verification and accredited investor status from cedros-login." }),
|
|
199
|
+
/* @__PURE__ */ n("div", { style: { display: "flex", gap: "0.5rem", alignItems: "flex-end", marginBottom: "1.5rem", maxWidth: "500px" }, children: [
|
|
200
|
+
/* @__PURE__ */ n("label", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "0.25rem", fontSize: "0.85rem" }, children: [
|
|
201
|
+
"User ID",
|
|
202
|
+
/* @__PURE__ */ e(
|
|
203
|
+
"input",
|
|
204
|
+
{
|
|
205
|
+
type: "text",
|
|
206
|
+
className: "cedros-admin__input",
|
|
207
|
+
placeholder: "user_abc123",
|
|
208
|
+
value: c,
|
|
209
|
+
onChange: (d) => l(d.target.value),
|
|
210
|
+
onKeyDown: w
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ e(
|
|
215
|
+
"button",
|
|
216
|
+
{
|
|
217
|
+
className: "cedros-admin__button cedros-admin__button--primary",
|
|
218
|
+
onClick: y,
|
|
219
|
+
disabled: S || !c.trim(),
|
|
220
|
+
children: S ? "Looking up..." : "Look Up"
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] }),
|
|
224
|
+
p && /* @__PURE__ */ e("div", { className: "cedros-admin__badge cedros-admin__badge--failed", style: { padding: "0.5rem", marginBottom: "1rem" }, children: p }),
|
|
225
|
+
S && /* @__PURE__ */ n("div", { className: "cedros-admin__loading", children: [
|
|
226
|
+
$.loading,
|
|
227
|
+
" Fetching compliance status..."
|
|
228
|
+
] }),
|
|
229
|
+
r && !S && /* @__PURE__ */ n("div", { style: { maxWidth: "500px" }, children: [
|
|
230
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ e("table", { className: "cedros-admin__table", children: /* @__PURE__ */ n("tbody", { children: [
|
|
231
|
+
/* @__PURE__ */ n("tr", { children: [
|
|
232
|
+
/* @__PURE__ */ e("td", { style: { fontWeight: 600, width: "40%" }, children: "User ID" }),
|
|
233
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: r.userId }) })
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ n("tr", { children: [
|
|
236
|
+
/* @__PURE__ */ e("td", { style: { fontWeight: 600 }, children: "KYC Status" }),
|
|
237
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${ue(r.kycStatus)}`, children: z(r.kycStatus) }) })
|
|
238
|
+
] }),
|
|
239
|
+
/* @__PURE__ */ n("tr", { children: [
|
|
240
|
+
/* @__PURE__ */ e("td", { style: { fontWeight: 600 }, children: "Accredited Investor" }),
|
|
241
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${r.accreditedInvestor ? "success" : "muted"}`, children: r.accreditedInvestor ? "Yes" : "No" }) })
|
|
242
|
+
] }),
|
|
243
|
+
r.accreditedVerifiedAt && /* @__PURE__ */ n("tr", { children: [
|
|
244
|
+
/* @__PURE__ */ e("td", { style: { fontWeight: 600 }, children: "Accredited Since" }),
|
|
245
|
+
/* @__PURE__ */ e("td", { children: E(r.accreditedVerifiedAt) })
|
|
246
|
+
] })
|
|
247
|
+
] }) }) }),
|
|
248
|
+
/* @__PURE__ */ e("div", { style: {
|
|
249
|
+
marginTop: "0.75rem",
|
|
250
|
+
padding: "0.75rem",
|
|
251
|
+
borderRadius: "4px",
|
|
252
|
+
fontSize: "0.85rem",
|
|
253
|
+
background: r.kycStatus === "verified" ? "var(--cedros-admin-bg-success, #f0fdf4)" : "var(--cedros-admin-bg-muted, #f5f5f5)",
|
|
254
|
+
color: "var(--cedros-admin-text, #333)"
|
|
255
|
+
}, children: r.kycStatus === "verified" && r.accreditedInvestor ? "This user is fully verified and accredited. They can access all compliance-gated products." : r.kycStatus === "verified" ? "This user has KYC verification but is not an accredited investor." : r.kycStatus === "pending" ? "This user has submitted KYC documents. Verification is in progress." : r.kycStatus === "expired" ? "This user's KYC verification has expired. They will need to re-verify." : "This user has not started KYC verification." })
|
|
256
|
+
] }),
|
|
257
|
+
A && !r && !S && !p && /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No compliance record found for this user." })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
function we({ serverUrl: s, apiKey: h, pageSize: u = 50, authManager: c }) {
|
|
261
|
+
const [l, S] = i("holders"), [k, p] = i(null), [g, r] = i([]), [C, A] = i(!0), [_, T] = i(""), [y, w] = i([]), [z, d] = i(!0), [a, m] = i(null), [N, F] = i(!1), [H, te] = i(""), [Y, ne] = i(""), [K, J] = i({ enabled: !0, batchSize: 100 }), [ae, ie] = i(!0), [G, V] = i(!1), [f, I] = i(null), [P, W] = i(""), [D, X] = i(!1), x = L(async (t, o) => {
|
|
147
262
|
if (c?.isAuthenticated())
|
|
148
|
-
return c.fetchWithAuth(t,
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
return
|
|
154
|
-
}, [s,
|
|
263
|
+
return c.fetchWithAuth(t, o);
|
|
264
|
+
const R = { "Content-Type": "application/json" };
|
|
265
|
+
h && (R["X-API-Key"] = h);
|
|
266
|
+
const q = await fetch(`${s}${t}`, { ...o, headers: { ...R, ...o?.headers } });
|
|
267
|
+
if (!q.ok) throw new Error(`Request failed: ${q.status}`);
|
|
268
|
+
return q.json();
|
|
269
|
+
}, [s, h, c]), j = L(async () => {
|
|
155
270
|
try {
|
|
156
|
-
const t =
|
|
157
|
-
`/admin/compliance/holders?limit=${
|
|
271
|
+
const t = _ ? `&status=${_}` : "", o = await x(
|
|
272
|
+
`/admin/compliance/holders?limit=${u}&offset=0${t}`
|
|
158
273
|
);
|
|
159
|
-
|
|
274
|
+
r(o.holders || []);
|
|
160
275
|
} catch (t) {
|
|
161
|
-
|
|
276
|
+
v().error("[ComplianceSection] Failed to fetch holders:", t), r([]), p("Failed to load token holders");
|
|
162
277
|
} finally {
|
|
163
|
-
|
|
278
|
+
A(!1);
|
|
164
279
|
}
|
|
165
|
-
}, [
|
|
280
|
+
}, [x, u, _]), B = L(async () => {
|
|
166
281
|
try {
|
|
167
|
-
const t = await
|
|
168
|
-
`/admin/compliance/actions?limit=${
|
|
282
|
+
const t = await x(
|
|
283
|
+
`/admin/compliance/actions?limit=${u}&offset=0`
|
|
169
284
|
);
|
|
170
|
-
|
|
285
|
+
w(t.actions || []);
|
|
171
286
|
} catch (t) {
|
|
172
|
-
|
|
287
|
+
v().error("[ComplianceSection] Failed to fetch actions:", t), w([]), p("Failed to load compliance actions");
|
|
173
288
|
} finally {
|
|
174
|
-
|
|
289
|
+
d(!1);
|
|
175
290
|
}
|
|
176
|
-
}, [
|
|
291
|
+
}, [x, u]), M = L(async () => {
|
|
177
292
|
try {
|
|
178
|
-
const t = await
|
|
179
|
-
|
|
293
|
+
const t = await x("/admin/compliance/sweep-settings");
|
|
294
|
+
J(t);
|
|
180
295
|
} catch (t) {
|
|
181
|
-
|
|
296
|
+
v().error("[ComplianceSection] Failed to fetch sweep settings:", t);
|
|
182
297
|
} finally {
|
|
183
298
|
ie(!1);
|
|
184
299
|
}
|
|
185
|
-
}, [
|
|
186
|
-
|
|
300
|
+
}, [x]), se = async () => {
|
|
301
|
+
V(!0);
|
|
187
302
|
try {
|
|
188
|
-
await
|
|
303
|
+
await x("/admin/compliance/sweep-settings", {
|
|
189
304
|
method: "PUT",
|
|
190
|
-
body: JSON.stringify(
|
|
305
|
+
body: JSON.stringify(K)
|
|
191
306
|
});
|
|
192
307
|
} catch (t) {
|
|
193
|
-
|
|
308
|
+
v().error("[ComplianceSection] Failed to save sweep settings:", t), p("Failed to save sweep settings");
|
|
194
309
|
} finally {
|
|
195
|
-
|
|
310
|
+
V(!1);
|
|
196
311
|
}
|
|
197
312
|
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
-
|
|
204
|
-
}, [
|
|
313
|
+
U(() => {
|
|
314
|
+
j();
|
|
315
|
+
}, [j]), U(() => {
|
|
316
|
+
B();
|
|
317
|
+
}, [B]), U(() => {
|
|
318
|
+
M();
|
|
319
|
+
}, [M]);
|
|
205
320
|
const re = async () => {
|
|
206
|
-
if (!(!
|
|
207
|
-
|
|
321
|
+
if (!(!f || !P.trim())) {
|
|
322
|
+
X(!0);
|
|
208
323
|
try {
|
|
209
|
-
const t =
|
|
210
|
-
await
|
|
324
|
+
const t = f.action === "freeze" ? "/admin/compliance/freeze" : "/admin/compliance/thaw";
|
|
325
|
+
await x(t, {
|
|
211
326
|
method: "POST",
|
|
212
|
-
body: JSON.stringify({ holderId:
|
|
213
|
-
}),
|
|
327
|
+
body: JSON.stringify({ holderId: f.holder.id, reason: P })
|
|
328
|
+
}), I(null), W(""), await j(), await B();
|
|
214
329
|
} catch (t) {
|
|
215
|
-
|
|
330
|
+
v().error(`[ComplianceSection] ${f.action} failed:`, t), p(`Failed to ${f.action} holder`);
|
|
216
331
|
} finally {
|
|
217
|
-
|
|
332
|
+
X(!1);
|
|
218
333
|
}
|
|
219
334
|
}
|
|
220
|
-
},
|
|
221
|
-
|
|
335
|
+
}, ce = async () => {
|
|
336
|
+
F(!0);
|
|
222
337
|
try {
|
|
223
338
|
const t = new URLSearchParams();
|
|
224
|
-
|
|
225
|
-
const
|
|
339
|
+
H && t.set("from", new Date(H).toISOString()), Y && t.set("to", new Date(Y).toISOString());
|
|
340
|
+
const o = await x(
|
|
226
341
|
`/admin/compliance/report?${t.toString()}`
|
|
227
342
|
);
|
|
228
|
-
|
|
343
|
+
m(o.report);
|
|
229
344
|
} catch (t) {
|
|
230
|
-
|
|
345
|
+
v().error("[ComplianceSection] Failed to generate report:", t), p("Failed to generate compliance report");
|
|
231
346
|
} finally {
|
|
232
|
-
|
|
347
|
+
F(!1);
|
|
233
348
|
}
|
|
234
|
-
},
|
|
349
|
+
}, de = () => {
|
|
235
350
|
if (!a) return;
|
|
236
|
-
const t = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }),
|
|
237
|
-
|
|
238
|
-
}, oe =
|
|
351
|
+
const t = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), o = URL.createObjectURL(t), R = document.createElement("a");
|
|
352
|
+
R.href = o, R.download = `compliance-report-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`, R.click(), URL.revokeObjectURL(o);
|
|
353
|
+
}, oe = g.length, Q = g.filter((t) => t.status === "frozen").length, le = g.filter((t) => t.status === "active").length;
|
|
239
354
|
return /* @__PURE__ */ n("div", { className: "cedros-admin__page", children: [
|
|
240
|
-
/* @__PURE__ */ e(me, { message:
|
|
241
|
-
|
|
355
|
+
/* @__PURE__ */ e(me, { message: k, onRetry: () => {
|
|
356
|
+
j(), B();
|
|
242
357
|
} }),
|
|
243
358
|
/* @__PURE__ */ e(
|
|
244
|
-
|
|
359
|
+
Z,
|
|
245
360
|
{
|
|
246
361
|
stats: [
|
|
247
362
|
{ label: "Total Holders", value: oe },
|
|
248
|
-
{ label: "Active", value:
|
|
249
|
-
{ label: "Frozen", value:
|
|
363
|
+
{ label: "Active", value: le, variant: "success" },
|
|
364
|
+
{ label: "Frozen", value: Q, variant: Q > 0 ? "warning" : "muted" },
|
|
250
365
|
{ label: "Actions Logged", value: y.length }
|
|
251
366
|
],
|
|
252
|
-
isLoading: C ||
|
|
367
|
+
isLoading: C || z
|
|
253
368
|
}
|
|
254
369
|
),
|
|
255
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin__tabs", style: { display: "flex", gap: "0.5rem", marginBottom: "1rem" }, children: ["holders", "actions", "reports", "sweep-settings", "sanctions-api"].map((t) => /* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin__tabs", style: { display: "flex", gap: "0.5rem", marginBottom: "1rem" }, children: ["holders", "actions", "reports", "sweep-settings", "sanctions-api", "kyc"].map((t) => /* @__PURE__ */ e(
|
|
256
371
|
"button",
|
|
257
372
|
{
|
|
258
373
|
type: "button",
|
|
259
|
-
className: `cedros-admin__button ${
|
|
260
|
-
onClick: () =>
|
|
261
|
-
children: t === "holders" ? "Token Holders" : t === "actions" ? "Actions Log" : t === "reports" ? "Reports" : t === "sweep-settings" ? "Sweep Settings" : "Sanctions API"
|
|
374
|
+
className: `cedros-admin__button ${l === t ? "cedros-admin__button--primary" : "cedros-admin__button--ghost"}`,
|
|
375
|
+
onClick: () => S(t),
|
|
376
|
+
children: t === "holders" ? "Token Holders" : t === "actions" ? "Actions Log" : t === "reports" ? "Reports" : t === "sweep-settings" ? "Sweep Settings" : t === "sanctions-api" ? "Sanctions API" : "KYC & Accreditation"
|
|
262
377
|
},
|
|
263
378
|
t
|
|
264
379
|
)) }),
|
|
265
|
-
|
|
380
|
+
l === "holders" && /* @__PURE__ */ n(O, { children: [
|
|
266
381
|
/* @__PURE__ */ n("div", { className: "cedros-admin__section-header", style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
267
382
|
/* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Token Holders" }),
|
|
268
383
|
/* @__PURE__ */ n(
|
|
269
384
|
"select",
|
|
270
385
|
{
|
|
271
|
-
value:
|
|
386
|
+
value: _,
|
|
272
387
|
onChange: (t) => {
|
|
273
|
-
|
|
388
|
+
T(t.target.value), A(!0);
|
|
274
389
|
},
|
|
275
390
|
className: "cedros-admin__input",
|
|
276
391
|
style: { width: "auto", padding: "0.25rem 0.5rem", fontSize: "0.85rem" },
|
|
@@ -284,9 +399,9 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
284
399
|
)
|
|
285
400
|
] }),
|
|
286
401
|
C ? /* @__PURE__ */ n("div", { className: "cedros-admin__loading", children: [
|
|
287
|
-
|
|
402
|
+
$.loading,
|
|
288
403
|
" Loading holders..."
|
|
289
|
-
] }) :
|
|
404
|
+
] }) : g.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No token holders found." }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ n("table", { className: "cedros-admin__table", children: [
|
|
290
405
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
|
|
291
406
|
/* @__PURE__ */ e("th", { children: "Wallet" }),
|
|
292
407
|
/* @__PURE__ */ e("th", { children: "Collection" }),
|
|
@@ -296,19 +411,19 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
296
411
|
/* @__PURE__ */ e("th", { children: "Created" }),
|
|
297
412
|
/* @__PURE__ */ e("th", { children: "Actions" })
|
|
298
413
|
] }) }),
|
|
299
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
300
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children:
|
|
301
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.collectionId, children:
|
|
302
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.mintAddress, children:
|
|
414
|
+
/* @__PURE__ */ e("tbody", { children: g.map((t) => /* @__PURE__ */ n("tr", { children: [
|
|
415
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children: b(t.walletAddress) }) }),
|
|
416
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.collectionId, children: b(t.collectionId) }) }),
|
|
417
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.mintAddress, children: b(t.mintAddress) }) }),
|
|
303
418
|
/* @__PURE__ */ e("td", { children: t.amountMinted }),
|
|
304
419
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${he(t.status)}`, children: t.status }) }),
|
|
305
|
-
/* @__PURE__ */ e("td", { children:
|
|
420
|
+
/* @__PURE__ */ e("td", { children: E(t.createdAt) }),
|
|
306
421
|
/* @__PURE__ */ e("td", { children: t.status === "active" || t.status === "thawed" ? /* @__PURE__ */ e(
|
|
307
422
|
"button",
|
|
308
423
|
{
|
|
309
424
|
className: "cedros-admin__button cedros-admin__button--danger cedros-admin__button--sm",
|
|
310
425
|
onClick: () => {
|
|
311
|
-
|
|
426
|
+
I({ holder: t, action: "freeze" }), W("");
|
|
312
427
|
},
|
|
313
428
|
children: "Freeze"
|
|
314
429
|
}
|
|
@@ -317,7 +432,7 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
317
432
|
{
|
|
318
433
|
className: "cedros-admin__button cedros-admin__button--primary cedros-admin__button--sm",
|
|
319
434
|
onClick: () => {
|
|
320
|
-
|
|
435
|
+
I({ holder: t, action: "thaw" }), W("");
|
|
321
436
|
},
|
|
322
437
|
children: "Thaw"
|
|
323
438
|
}
|
|
@@ -325,10 +440,10 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
325
440
|
] }, t.id)) })
|
|
326
441
|
] }) })
|
|
327
442
|
] }),
|
|
328
|
-
|
|
443
|
+
l === "actions" && /* @__PURE__ */ n(O, { children: [
|
|
329
444
|
/* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Compliance Actions" }) }),
|
|
330
|
-
|
|
331
|
-
|
|
445
|
+
z ? /* @__PURE__ */ n("div", { className: "cedros-admin__loading", children: [
|
|
446
|
+
$.loading,
|
|
332
447
|
" Loading actions..."
|
|
333
448
|
] }) : y.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No compliance actions recorded." }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ n("table", { className: "cedros-admin__table", children: [
|
|
334
449
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
|
|
@@ -340,48 +455,48 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
340
455
|
/* @__PURE__ */ e("th", { children: "Tx Signature" })
|
|
341
456
|
] }) }),
|
|
342
457
|
/* @__PURE__ */ e("tbody", { children: y.map((t) => /* @__PURE__ */ n("tr", { children: [
|
|
343
|
-
/* @__PURE__ */ e("td", { children:
|
|
458
|
+
/* @__PURE__ */ e("td", { children: E(t.createdAt) }),
|
|
344
459
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${ee(t.actionType)}`, children: t.actionType }) }),
|
|
345
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children:
|
|
460
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children: b(t.walletAddress) }) }),
|
|
346
461
|
/* @__PURE__ */ e("td", { children: t.reason || "—" }),
|
|
347
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children:
|
|
462
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: b(t.actor) }) }),
|
|
348
463
|
/* @__PURE__ */ e("td", { children: t.txSignature ? /* @__PURE__ */ e(
|
|
349
464
|
"a",
|
|
350
465
|
{
|
|
351
|
-
href: `${
|
|
466
|
+
href: `${pe}${t.txSignature}`,
|
|
352
467
|
target: "_blank",
|
|
353
468
|
rel: "noopener noreferrer",
|
|
354
469
|
className: "cedros-admin__link",
|
|
355
|
-
children:
|
|
470
|
+
children: b(t.txSignature)
|
|
356
471
|
}
|
|
357
472
|
) : "—" })
|
|
358
473
|
] }, t.id)) })
|
|
359
474
|
] }) })
|
|
360
475
|
] }),
|
|
361
|
-
|
|
476
|
+
l === "reports" && /* @__PURE__ */ n(O, { children: [
|
|
362
477
|
/* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Compliance Report" }) }),
|
|
363
478
|
/* @__PURE__ */ n("div", { style: { display: "flex", gap: "0.75rem", alignItems: "flex-end", marginBottom: "1rem" }, children: [
|
|
364
479
|
/* @__PURE__ */ n("label", { style: { display: "flex", flexDirection: "column", gap: "0.25rem", fontSize: "0.85rem" }, children: [
|
|
365
480
|
"From",
|
|
366
|
-
/* @__PURE__ */ e("input", { type: "date", className: "cedros-admin__input", value:
|
|
481
|
+
/* @__PURE__ */ e("input", { type: "date", className: "cedros-admin__input", value: H, onChange: (t) => te(t.target.value) })
|
|
367
482
|
] }),
|
|
368
483
|
/* @__PURE__ */ n("label", { style: { display: "flex", flexDirection: "column", gap: "0.25rem", fontSize: "0.85rem" }, children: [
|
|
369
484
|
"To",
|
|
370
|
-
/* @__PURE__ */ e("input", { type: "date", className: "cedros-admin__input", value:
|
|
485
|
+
/* @__PURE__ */ e("input", { type: "date", className: "cedros-admin__input", value: Y, onChange: (t) => ne(t.target.value) })
|
|
371
486
|
] }),
|
|
372
487
|
/* @__PURE__ */ e(
|
|
373
488
|
"button",
|
|
374
489
|
{
|
|
375
490
|
className: "cedros-admin__button cedros-admin__button--primary",
|
|
376
|
-
onClick:
|
|
377
|
-
disabled:
|
|
378
|
-
children:
|
|
491
|
+
onClick: ce,
|
|
492
|
+
disabled: N,
|
|
493
|
+
children: N ? "Generating..." : "Generate Report"
|
|
379
494
|
}
|
|
380
495
|
)
|
|
381
496
|
] }),
|
|
382
497
|
a && /* @__PURE__ */ n("div", { children: [
|
|
383
498
|
/* @__PURE__ */ e(
|
|
384
|
-
|
|
499
|
+
Z,
|
|
385
500
|
{
|
|
386
501
|
stats: [
|
|
387
502
|
{ label: "Total Holders", value: a.totalHolders },
|
|
@@ -396,12 +511,12 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
396
511
|
/* @__PURE__ */ n("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", margin: "1rem 0 0.5rem" }, children: [
|
|
397
512
|
/* @__PURE__ */ n("span", { style: { fontSize: "0.85rem", color: "var(--cedros-admin-text-muted, #888)" }, children: [
|
|
398
513
|
"Generated ",
|
|
399
|
-
|
|
514
|
+
E(a.generatedAt),
|
|
400
515
|
" · ",
|
|
401
516
|
a.actionsInPeriod,
|
|
402
517
|
" actions in period"
|
|
403
518
|
] }),
|
|
404
|
-
/* @__PURE__ */ e("button", { className: "cedros-admin__button cedros-admin__button--ghost", onClick:
|
|
519
|
+
/* @__PURE__ */ e("button", { className: "cedros-admin__button cedros-admin__button--ghost", onClick: de, children: "Download JSON" })
|
|
405
520
|
] }),
|
|
406
521
|
a.actions.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ n("table", { className: "cedros-admin__table", children: [
|
|
407
522
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
|
|
@@ -412,19 +527,19 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
412
527
|
/* @__PURE__ */ e("th", { children: "Actor" })
|
|
413
528
|
] }) }),
|
|
414
529
|
/* @__PURE__ */ e("tbody", { children: a.actions.map((t) => /* @__PURE__ */ n("tr", { children: [
|
|
415
|
-
/* @__PURE__ */ e("td", { children:
|
|
530
|
+
/* @__PURE__ */ e("td", { children: E(t.createdAt) }),
|
|
416
531
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${ee(t.actionType)}`, children: t.actionType }) }),
|
|
417
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children:
|
|
532
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { title: t.walletAddress, children: b(t.walletAddress) }) }),
|
|
418
533
|
/* @__PURE__ */ e("td", { children: t.reason || "—" }),
|
|
419
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children:
|
|
534
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: b(t.actor) }) })
|
|
420
535
|
] }, t.id)) })
|
|
421
536
|
] }) })
|
|
422
537
|
] })
|
|
423
538
|
] }),
|
|
424
|
-
|
|
539
|
+
l === "sweep-settings" && /* @__PURE__ */ n(O, { children: [
|
|
425
540
|
/* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Sanctions Sweep Settings" }) }),
|
|
426
541
|
ae ? /* @__PURE__ */ n("div", { className: "cedros-admin__loading", children: [
|
|
427
|
-
|
|
542
|
+
$.loading,
|
|
428
543
|
" Loading settings..."
|
|
429
544
|
] }) : /* @__PURE__ */ n("div", { style: { maxWidth: "400px", display: "flex", flexDirection: "column", gap: "1rem" }, children: [
|
|
430
545
|
/* @__PURE__ */ n("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", fontSize: "0.9rem" }, children: [
|
|
@@ -432,8 +547,8 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
432
547
|
"input",
|
|
433
548
|
{
|
|
434
549
|
type: "checkbox",
|
|
435
|
-
checked:
|
|
436
|
-
onChange: (t) =>
|
|
550
|
+
checked: K.enabled,
|
|
551
|
+
onChange: (t) => J((o) => ({ ...o, enabled: t.target.checked }))
|
|
437
552
|
}
|
|
438
553
|
),
|
|
439
554
|
"Enable automated sanctions sweep"
|
|
@@ -447,8 +562,8 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
447
562
|
className: "cedros-admin__input",
|
|
448
563
|
min: 1,
|
|
449
564
|
max: 1e4,
|
|
450
|
-
value:
|
|
451
|
-
onChange: (t) =>
|
|
565
|
+
value: K.batchSize,
|
|
566
|
+
onChange: (t) => J((o) => ({ ...o, batchSize: Number(t.target.value) })),
|
|
452
567
|
style: { width: "160px" }
|
|
453
568
|
}
|
|
454
569
|
)
|
|
@@ -458,18 +573,19 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
458
573
|
{
|
|
459
574
|
className: "cedros-admin__button cedros-admin__button--primary",
|
|
460
575
|
onClick: se,
|
|
461
|
-
disabled:
|
|
576
|
+
disabled: G,
|
|
462
577
|
style: { alignSelf: "flex-start" },
|
|
463
|
-
children:
|
|
578
|
+
children: G ? "Saving..." : "Save Settings"
|
|
464
579
|
}
|
|
465
580
|
)
|
|
466
581
|
] })
|
|
467
582
|
] }),
|
|
468
|
-
|
|
469
|
-
l && /* @__PURE__ */ e(
|
|
583
|
+
l === "sanctions-api" && /* @__PURE__ */ e(ge, { serverUrl: s, apiKey: h, authManager: c }),
|
|
584
|
+
l === "kyc" && /* @__PURE__ */ e(_e, { serverUrl: s, apiKey: h, authManager: c }),
|
|
585
|
+
f && /* @__PURE__ */ e("div", { className: "cedros-admin__modal-overlay", onClick: () => !D && I(null), children: /* @__PURE__ */ n("div", { className: "cedros-admin__modal", onClick: (t) => t.stopPropagation(), children: [
|
|
470
586
|
/* @__PURE__ */ n("div", { className: "cedros-admin__modal-header", children: [
|
|
471
587
|
/* @__PURE__ */ n("h4", { className: "cedros-admin__modal-title", children: [
|
|
472
|
-
|
|
588
|
+
f.action === "freeze" ? "Freeze" : "Thaw",
|
|
473
589
|
" Token Account"
|
|
474
590
|
] }),
|
|
475
591
|
/* @__PURE__ */ e(
|
|
@@ -477,19 +593,19 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
477
593
|
{
|
|
478
594
|
type: "button",
|
|
479
595
|
className: "cedros-admin__modal-close",
|
|
480
|
-
onClick: () => !
|
|
481
|
-
children:
|
|
596
|
+
onClick: () => !D && I(null),
|
|
597
|
+
children: $.close
|
|
482
598
|
}
|
|
483
599
|
)
|
|
484
600
|
] }),
|
|
485
601
|
/* @__PURE__ */ n("div", { className: "cedros-admin__modal-body", children: [
|
|
486
602
|
/* @__PURE__ */ n("p", { style: { marginBottom: "0.5rem", fontSize: "0.9rem" }, children: [
|
|
487
603
|
"Wallet: ",
|
|
488
|
-
/* @__PURE__ */ e("code", { children:
|
|
604
|
+
/* @__PURE__ */ e("code", { children: b(f.holder.walletAddress) })
|
|
489
605
|
] }),
|
|
490
606
|
/* @__PURE__ */ n("p", { style: { marginBottom: "0.75rem", fontSize: "0.9rem" }, children: [
|
|
491
607
|
"Mint: ",
|
|
492
|
-
/* @__PURE__ */ e("code", { children:
|
|
608
|
+
/* @__PURE__ */ e("code", { children: b(f.holder.mintAddress) })
|
|
493
609
|
] }),
|
|
494
610
|
/* @__PURE__ */ n("label", { style: { display: "flex", flexDirection: "column", gap: "0.25rem", fontSize: "0.85rem" }, children: [
|
|
495
611
|
"Reason (required)",
|
|
@@ -498,9 +614,9 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
498
614
|
{
|
|
499
615
|
className: "cedros-admin__input",
|
|
500
616
|
rows: 3,
|
|
501
|
-
value:
|
|
502
|
-
onChange: (t) =>
|
|
503
|
-
placeholder: `Reason for ${
|
|
617
|
+
value: P,
|
|
618
|
+
onChange: (t) => W(t.target.value),
|
|
619
|
+
placeholder: `Reason for ${f.action}...`,
|
|
504
620
|
maxLength: 1024
|
|
505
621
|
}
|
|
506
622
|
)
|
|
@@ -511,18 +627,18 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
511
627
|
"button",
|
|
512
628
|
{
|
|
513
629
|
className: "cedros-admin__button cedros-admin__button--ghost",
|
|
514
|
-
onClick: () =>
|
|
515
|
-
disabled:
|
|
630
|
+
onClick: () => I(null),
|
|
631
|
+
disabled: D,
|
|
516
632
|
children: "Cancel"
|
|
517
633
|
}
|
|
518
634
|
),
|
|
519
635
|
/* @__PURE__ */ e(
|
|
520
636
|
"button",
|
|
521
637
|
{
|
|
522
|
-
className: `cedros-admin__button ${
|
|
638
|
+
className: `cedros-admin__button ${f.action === "freeze" ? "cedros-admin__button--danger" : "cedros-admin__button--primary"}`,
|
|
523
639
|
onClick: re,
|
|
524
|
-
disabled:
|
|
525
|
-
children:
|
|
640
|
+
disabled: D || !P.trim(),
|
|
641
|
+
children: D ? "Processing..." : f.action === "freeze" ? "Freeze Account" : "Thaw Account"
|
|
526
642
|
}
|
|
527
643
|
)
|
|
528
644
|
] })
|
|
@@ -530,5 +646,5 @@ function ve({ serverUrl: s, apiKey: g, pageSize: f = 50, authManager: c }) {
|
|
|
530
646
|
] });
|
|
531
647
|
}
|
|
532
648
|
export {
|
|
533
|
-
|
|
649
|
+
we as ComplianceSection
|
|
534
650
|
};
|