@cedros/pay-react 1.1.24 → 1.1.25
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-IXS1Wt_1.js → AISettingsSection-BvSSiK2G.js} +1 -1
- package/dist/{AISettingsSection-Dw0ZlxMf.mjs → AISettingsSection-Dg1kazTI.mjs} +2 -2
- package/dist/{AutosaveIndicator-BJsg_kFZ.mjs → AutosaveIndicator-BHfkV59p.mjs} +1 -1
- package/dist/{AutosaveIndicator-CY_YHM1D.js → AutosaveIndicator-D2l7U8R1.js} +1 -1
- package/dist/CedrosContext-C2RjHLaQ.js +6 -0
- package/dist/{CedrosContext-DQUbL8yP.mjs → CedrosContext-CY6zvjvJ.mjs} +768 -617
- package/dist/ComplianceSection-BSE2f3Wo.mjs +534 -0
- package/dist/ComplianceSection-D6ETKG6b.js +1 -0
- package/dist/{CryptoButton-D1BCZBk4.mjs → CryptoButton-BV9owVe2.mjs} +2 -2
- package/dist/{CryptoButton-C1AAOOfj.js → CryptoButton-DpiCnyXE.js} +1 -1
- package/dist/{FAQSection-BmgmzDN5.js → FAQSection-6nGI0FK9.js} +1 -1
- package/dist/{FAQSection-C78MnK4k.mjs → FAQSection-uZG5V3pJ.mjs} +1 -1
- package/dist/{MessagingSection-CWLZcg11.js → MessagingSection-DrXb578q.js} +1 -1
- package/dist/{MessagingSection-De3t8bSI.mjs → MessagingSection-M0lj5yo4.mjs} +2 -2
- package/dist/{OrdersSection-_xKVzjSZ.mjs → OrdersSection-DteItv_O.mjs} +6 -6
- package/dist/{OrdersSection-BKOxsZw0.js → OrdersSection-_-rIw6XW.js} +1 -1
- package/dist/{PaymentSettingsSection-KjU_dN_d.mjs → PaymentSettingsSection-CdtdLFTg.mjs} +1 -1
- package/dist/{PaymentSettingsSection-BTEn9Dxb.js → PaymentSettingsSection-enTbUI95.js} +1 -1
- package/dist/SettingsSection-DUTEd6uV.js +1 -0
- package/dist/{SettingsSection-8QHZB59k.mjs → SettingsSection-mcT4LEhO.mjs} +19 -13
- package/dist/{SingleCategorySettings--LK0TZW0.mjs → SingleCategorySettings-BvHBVfSe.mjs} +4 -4
- package/dist/{SingleCategorySettings-CRXTMTo5.js → SingleCategorySettings-D2LVM5mn.js} +1 -1
- package/dist/{StorefrontSection-CeCpr8hn.mjs → StorefrontSection-BqQ36JIS.mjs} +2 -2
- package/dist/{StorefrontSection-C9DzCmOf.js → StorefrontSection-Du7hV2Gc.js} +1 -1
- package/dist/{SubscriptionsSection-C2xk8ApF.mjs → SubscriptionsSection-BYiCBwKZ.mjs} +7 -7
- package/dist/{SubscriptionsSection-Dn5SY6S_.js → SubscriptionsSection-C4BRN1dP.js} +1 -1
- package/dist/Token22Section-0c22NM5G.js +1 -0
- package/dist/Token22Section-BHvOhz5d.mjs +2260 -0
- package/dist/{WalletManager-Bwk3rgr1.js → WalletManager-B3UdQ5pQ.js} +1 -1
- package/dist/{WalletManager-CXvQ0Zu9.mjs → WalletManager-BIwH8Dw_.mjs} +1 -1
- package/dist/{configApi-Ch0Rr7TD.mjs → configApi-6XhAJGKX.mjs} +31 -0
- package/dist/{configApi-CxEbCAgG.js → configApi-DkduMQg1.js} +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +85 -83
- package/dist/{index-BHF82XBB.mjs → index-BkDimQDF.mjs} +7987 -7322
- package/dist/index-C7MWL6O8.js +84 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +42 -40
- package/dist/{sections-8e5Y3ukY.js → sections-5jO2aHAo.js} +1 -1
- package/dist/{sections-C1rb9YRh.mjs → sections-By4H1baL.mjs} +2 -2
- package/dist/src/admin/plugin.d.ts.map +1 -1
- package/dist/src/components/ComplianceGatePage.d.ts +38 -0
- package/dist/src/components/ComplianceGatePage.d.ts.map +1 -0
- package/dist/src/components/SubscribeButton.d.ts +1 -5
- package/dist/src/components/SubscribeButton.d.ts.map +1 -1
- package/dist/src/components/admin/AdminAuthManager.d.ts +7 -3
- package/dist/src/components/admin/AdminAuthManager.d.ts.map +1 -1
- package/dist/src/components/admin/AssetClassesTab.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/ComplianceSanctionsApi.d.ts +3 -0
- package/dist/src/components/admin/ComplianceSanctionsApi.d.ts.map +1 -0
- package/dist/src/components/admin/ComplianceSection.d.ts +3 -0
- package/dist/src/components/admin/ComplianceSection.d.ts.map +1 -0
- package/dist/src/components/admin/GiftCardAnalytics.d.ts +3 -0
- package/dist/src/components/admin/GiftCardAnalytics.d.ts.map +1 -0
- package/dist/src/components/admin/GiftCardManager.d.ts +3 -0
- package/dist/src/components/admin/GiftCardManager.d.ts.map +1 -0
- package/dist/src/components/admin/LiquidityPoolTab.d.ts.map +1 -1
- package/dist/src/components/admin/PoolManagementView.d.ts +14 -0
- package/dist/src/components/admin/PoolManagementView.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/src/components/admin/RefundsSection.d.ts.map +1 -1
- package/dist/src/components/admin/SettingsSection.d.ts.map +1 -1
- package/dist/src/components/admin/Token22Section.d.ts.map +1 -1
- package/dist/src/components/admin/complianceTypes.d.ts +60 -0
- package/dist/src/components/admin/complianceTypes.d.ts.map +1 -0
- package/dist/src/components/admin/configApi.d.ts.map +1 -1
- package/dist/src/components/admin/icons.d.ts +1 -0
- package/dist/src/components/admin/icons.d.ts.map +1 -1
- package/dist/src/components/admin/useAdminAuth.d.ts +1 -1
- package/dist/src/components/admin/useAdminAuth.d.ts.map +1 -1
- package/dist/src/context/CedrosContext.d.ts.map +1 -1
- package/dist/src/ecommerce/components/catalog/TokenDisplay.d.ts +36 -0
- package/dist/src/ecommerce/components/catalog/TokenDisplay.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -1
- package/dist/src/ecommerce/components/checkout/SendAsGiftSection.d.ts +15 -0
- package/dist/src/ecommerce/components/checkout/SendAsGiftSection.d.ts.map +1 -0
- package/dist/src/ecommerce/components/gift-cards/GiftCardBalanceChecker.d.ts +19 -0
- package/dist/src/ecommerce/components/gift-cards/GiftCardBalanceChecker.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/MyRedemptionsPage.d.ts +13 -0
- package/dist/src/ecommerce/components/orders/MyRedemptionsPage.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/MyTokensPage.d.ts +15 -0
- package/dist/src/ecommerce/components/orders/MyTokensPage.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/OrderDetails.d.ts.map +1 -1
- package/dist/src/ecommerce/hooks/useCartInventory.d.ts.map +1 -1
- package/dist/src/ecommerce/index.d.ts +10 -0
- package/dist/src/ecommerce/index.d.ts.map +1 -1
- package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts +3 -0
- package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -1
- package/dist/src/ecommerce/state/checkout/useCheckout.d.ts.map +1 -1
- package/dist/src/ecommerce/types.d.ts +6 -0
- package/dist/src/ecommerce/types.d.ts.map +1 -1
- package/dist/src/ecommerce/utils/cartItemMetadata.d.ts.map +1 -1
- package/dist/src/hooks/useComplianceCheck.d.ts +30 -0
- package/dist/src/hooks/useComplianceCheck.d.ts.map +1 -0
- package/dist/src/hooks/useSubscriptionManagement.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/CreditsManager.d.ts.map +1 -1
- package/dist/src/managers/ManagerCache.d.ts +2 -2
- package/dist/src/managers/ManagerCache.d.ts.map +1 -1
- package/dist/src/managers/StripeManager.d.ts +7 -1
- package/dist/src/managers/StripeManager.d.ts.map +1 -1
- package/dist/src/managers/SubscriptionChangeManager.d.ts.map +1 -1
- package/dist/src/managers/SubscriptionManager.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +14 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/subscription.d.ts +21 -33
- package/dist/src/types/subscription.d.ts.map +1 -1
- package/dist/src/utils/exponentialBackoff.d.ts +22 -0
- package/dist/src/utils/exponentialBackoff.d.ts.map +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +2 -2
- package/dist/styles-BT4bhFey.js +1 -0
- package/dist/{styles-Ag-7ZvAB.mjs → styles-D4SQkuV3.mjs} +606 -609
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/{walletPool-C_0P4mTw.mjs → walletPool-DE-t1wSW.mjs} +1 -1
- package/dist/{walletPool-Ddv33tej.js → walletPool-IS7R3MR1.js} +1 -1
- package/package.json +1 -1
- package/dist/CedrosContext-7dwmEeUY.js +0 -6
- package/dist/SettingsSection-cKF0tLnS.js +0 -1
- package/dist/Token22Section-DUUl59dZ.js +0 -1
- package/dist/Token22Section-HygkDNtL.mjs +0 -1685
- package/dist/index-OaWkrl0G.js +0 -84
- package/dist/styles-21F1-oqx.js +0 -1
package/dist/crypto-only.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { O as
|
|
2
|
-
import { C as Ue, a as Ye, b as Ve, c as He, d as Je, P as Xe, e as Ze, f as et, g as tt, R as rt, S as nt, h as at, i as st, j as ot, k as it, l as ct, m as lt, u as ut, v as dt, w as pt, x as ft, y as mt, z as yt, A as gt, B as bt, D as St, E as wt, F as
|
|
3
|
-
import { C as _t, a as Wt, b as qt, c as Mt, d as Lt, e as At,
|
|
4
|
-
import { u as H, m as z, j as qe, i as y } from "./CedrosContext-
|
|
5
|
-
import { C as
|
|
6
|
-
import { C as
|
|
1
|
+
import { O as Te, q as ve, n as fe, s as Be, o as me, p as Ie, r as ye, t as V, V as _e, W as We } from "./styles-D4SQkuV3.mjs";
|
|
2
|
+
import { C as Ue, a as Ye, b as Ve, c as He, d as Je, P as Xe, e as Ze, f as et, g as tt, R as rt, S as nt, h as at, i as st, j as ot, k as it, l as ct, m as lt, u as ut, v as dt, w as pt, x as ft, y as mt, z as yt, A as gt, B as bt, D as St, E as wt, F as Ct, G as ht, H as xt, I as Pt, J as Et, K as Rt, L as kt, M as Tt, N as vt, Q as Bt } from "./styles-D4SQkuV3.mjs";
|
|
3
|
+
import { C as _t, a as Wt, b as qt, c as Mt, d as Lt, e as At, f as Dt, i as Ot, u as Nt, g as zt } from "./index-BkDimQDF.mjs";
|
|
4
|
+
import { u as H, m as z, j as qe, i as y } from "./CedrosContext-CY6zvjvJ.mjs";
|
|
5
|
+
import { C as Qt, a as $t, b as Ft, c as Gt, E as jt, K as Ut, L as Yt, d as Vt, R as Ht, e as Jt, f as Xt, g as Zt, h as er, r as tr, v as rr, n as nr } from "./CedrosContext-CY6zvjvJ.mjs";
|
|
6
|
+
import { C as sr, u as or } from "./CryptoButton-BV9owVe2.mjs";
|
|
7
7
|
import { jsxs as K, jsx as x } from "react/jsx-runtime";
|
|
8
|
-
import { useState as B, useRef as N, useCallback as
|
|
8
|
+
import { useState as B, useRef as N, useCallback as C, useMemo as G, useEffect as Q } from "react";
|
|
9
9
|
import { useWallet as J } from "@solana/wallet-adapter-react";
|
|
10
10
|
import { WalletReadyState as ge } from "@solana/wallet-adapter-base";
|
|
11
11
|
import { WalletIcon as Me } from "@solana/wallet-adapter-react-ui";
|
|
12
|
-
import { WalletPool as
|
|
12
|
+
import { WalletPool as cr, createWalletPool as lr } from "./walletPool-DE-t1wSW.mjs";
|
|
13
13
|
function Le() {
|
|
14
14
|
const { subscriptionManager: r, x402Manager: c, walletManager: f } = H(), { publicKey: i, signTransaction: R } = J(), [S, p] = B({
|
|
15
15
|
status: "idle",
|
|
@@ -17,7 +17,7 @@ function Le() {
|
|
|
17
17
|
sessionId: null,
|
|
18
18
|
subscriptionStatus: null,
|
|
19
19
|
expiresAt: null
|
|
20
|
-
}), [
|
|
20
|
+
}), [k, P] = B(null), E = N(!1), h = C(() => {
|
|
21
21
|
if (!i) {
|
|
22
22
|
const s = "Wallet not connected";
|
|
23
23
|
return p((t) => ({ ...t, status: "error", error: s })), { valid: !1, error: s };
|
|
@@ -27,7 +27,7 @@ function Le() {
|
|
|
27
27
|
return p((t) => ({ ...t, status: "error", error: s })), { valid: !1, error: s };
|
|
28
28
|
}
|
|
29
29
|
return { valid: !0 };
|
|
30
|
-
}, [i, R]),
|
|
30
|
+
}, [i, R]), T = C(
|
|
31
31
|
async (s) => {
|
|
32
32
|
if (!i)
|
|
33
33
|
return p((t) => ({
|
|
@@ -61,7 +61,7 @@ function Le() {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
[i, r]
|
|
64
|
-
), W =
|
|
64
|
+
), W = C(
|
|
65
65
|
async (s, t, n) => {
|
|
66
66
|
p((l) => ({
|
|
67
67
|
...l,
|
|
@@ -88,11 +88,11 @@ function Le() {
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
[r]
|
|
91
|
-
), g =
|
|
91
|
+
), g = C(
|
|
92
92
|
async (s, t, n) => {
|
|
93
93
|
if (E.current)
|
|
94
94
|
return { success: !1, error: "Payment already in progress" };
|
|
95
|
-
const l =
|
|
95
|
+
const l = h();
|
|
96
96
|
if (!l.valid)
|
|
97
97
|
return { success: !1, error: l.error };
|
|
98
98
|
E.current = !0, p((a) => ({
|
|
@@ -180,14 +180,14 @@ function Le() {
|
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
[
|
|
183
|
-
|
|
183
|
+
h,
|
|
184
184
|
r,
|
|
185
185
|
c,
|
|
186
186
|
f,
|
|
187
187
|
i,
|
|
188
188
|
R
|
|
189
189
|
]
|
|
190
|
-
), I =
|
|
190
|
+
), I = C(() => {
|
|
191
191
|
p({
|
|
192
192
|
status: "idle",
|
|
193
193
|
error: null,
|
|
@@ -198,8 +198,8 @@ function Le() {
|
|
|
198
198
|
}, []);
|
|
199
199
|
return {
|
|
200
200
|
...S,
|
|
201
|
-
quote:
|
|
202
|
-
checkStatus:
|
|
201
|
+
quote: k,
|
|
202
|
+
checkStatus: T,
|
|
203
203
|
requestQuote: W,
|
|
204
204
|
processPayment: g,
|
|
205
205
|
reset: I
|
|
@@ -213,11 +213,11 @@ function $e({
|
|
|
213
213
|
label: R,
|
|
214
214
|
disabled: S = !1,
|
|
215
215
|
onAttempt: p,
|
|
216
|
-
onSuccess:
|
|
216
|
+
onSuccess: k,
|
|
217
217
|
onError: P,
|
|
218
218
|
className: E = "",
|
|
219
|
-
testPageUrl:
|
|
220
|
-
hideMessages:
|
|
219
|
+
testPageUrl: h,
|
|
220
|
+
hideMessages: T = !1,
|
|
221
221
|
autoCheckStatus: W = !0
|
|
222
222
|
}) {
|
|
223
223
|
const {
|
|
@@ -236,13 +236,13 @@ function $e({
|
|
|
236
236
|
expiresAt: q,
|
|
237
237
|
checkStatus: M,
|
|
238
238
|
processPayment: L
|
|
239
|
-
} = Le(), u = qe(), { solanaError: _ } = H(), { t: v, translations: X } =
|
|
240
|
-
Z.current =
|
|
239
|
+
} = Le(), u = qe(), { solanaError: _ } = H(), { t: v, translations: X } = Te(), be = R || v("ui.subscribe_with_crypto"), Z = N(k), ee = N(P), te = N(L), re = N(M);
|
|
240
|
+
Z.current = k, ee.current = P, te.current = L, re.current = M;
|
|
241
241
|
const Se = m && typeof m != "string" ? m?.code ?? null : null, we = _ && typeof _ != "string" ? _?.code ?? null : null, ne = (e) => {
|
|
242
242
|
if (!e || !X) return "";
|
|
243
243
|
const d = X.errors[e];
|
|
244
244
|
return d ? d.action ? `${d.message} ${d.action}` : d.message : "";
|
|
245
|
-
}, ae = m ? typeof m == "string" ? m : ne(Se) : null, se = _ ? typeof _ == "string" ? _ : ne(we) : null,
|
|
245
|
+
}, ae = m ? typeof m == "string" ? m : ne(Se) : null, se = _ ? typeof _ == "string" ? _ : ne(we) : null, Ce = G(
|
|
246
246
|
() => l.map((e) => `${e.adapter.name}-${e.readyState}`).join(","),
|
|
247
247
|
[l]
|
|
248
248
|
), j = G(
|
|
@@ -250,7 +250,7 @@ function $e({
|
|
|
250
250
|
({ readyState: e }) => e === ge.Installed || e === ge.Loadable
|
|
251
251
|
),
|
|
252
252
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
|
-
[
|
|
253
|
+
[Ce]
|
|
254
254
|
);
|
|
255
255
|
Q(() => {
|
|
256
256
|
W && g && o && (y().debug("[CryptoSubscribeButton] Auto-checking subscription status"), re.current(r));
|
|
@@ -273,8 +273,8 @@ function $e({
|
|
|
273
273
|
} catch (Y) {
|
|
274
274
|
if (!e) {
|
|
275
275
|
y().error("[CryptoSubscribeButton] Auto-connect failed:", Y);
|
|
276
|
-
const
|
|
277
|
-
V(
|
|
276
|
+
const ke = Y instanceof Error ? Y.message : "Failed to connect wallet";
|
|
277
|
+
V(ke, a.adapter.name), D(!1);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -284,7 +284,7 @@ function $e({
|
|
|
284
284
|
}, [a, ce, g, I, s]), Q(() => {
|
|
285
285
|
g && le && o && a && (Be(a.adapter.name, o.toString()), y().debug("[CryptoSubscribeButton] Processing pending subscription payment"), D(!1), A(!1), me("crypto", r), te.current(r, c, { couponCode: i, intervalDays: f }));
|
|
286
286
|
}, [g, le, o, a, r, c, i, f]);
|
|
287
|
-
const ue =
|
|
287
|
+
const ue = C(async () => {
|
|
288
288
|
if (y().debug("[CryptoSubscribeButton] executeSubscriptionFlow called", {
|
|
289
289
|
connected: g,
|
|
290
290
|
wallet: a?.adapter.name,
|
|
@@ -295,7 +295,7 @@ function $e({
|
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
297
|
if (oe) {
|
|
298
|
-
const e =
|
|
298
|
+
const e = h || window.location.href;
|
|
299
299
|
try {
|
|
300
300
|
if (new URL(e, window.location.origin).origin !== window.location.origin)
|
|
301
301
|
throw y().error("[CryptoSubscribeButton] Blocked attempt to open external URL:", e), new Error("Cannot open external URLs from embedded context");
|
|
@@ -337,14 +337,14 @@ function $e({
|
|
|
337
337
|
i,
|
|
338
338
|
f,
|
|
339
339
|
oe,
|
|
340
|
-
|
|
340
|
+
h,
|
|
341
341
|
j,
|
|
342
342
|
s,
|
|
343
343
|
L,
|
|
344
344
|
O,
|
|
345
345
|
p,
|
|
346
346
|
P
|
|
347
|
-
]), de = G(() => `crypto-subscribe-${r}-${c}`, [r, c]),
|
|
347
|
+
]), de = G(() => `crypto-subscribe-${r}-${c}`, [r, c]), he = G(
|
|
348
348
|
() => _e(de, ue, {
|
|
349
349
|
cooldownMs: 200,
|
|
350
350
|
deduplicationWindowMs: 0
|
|
@@ -358,18 +358,18 @@ function $e({
|
|
|
358
358
|
const e = new Date(q).toLocaleDateString();
|
|
359
359
|
F = `${v("ui.subscribed_until")} ${e}`;
|
|
360
360
|
} else $ && (F = v("ui.subscribed"));
|
|
361
|
-
const Pe =
|
|
361
|
+
const Pe = C(async () => {
|
|
362
362
|
try {
|
|
363
363
|
U(!1), g && await t(), n(null), A(!0);
|
|
364
364
|
} catch (e) {
|
|
365
365
|
y().error("Failed to change wallet:", e);
|
|
366
366
|
}
|
|
367
|
-
}, [g, t, n]), Ee =
|
|
367
|
+
}, [g, t, n]), Ee = C(
|
|
368
368
|
(e) => {
|
|
369
369
|
y().debug("[CryptoSubscribeButton] Wallet clicked:", e), A(!1), n(e), U(!0);
|
|
370
370
|
},
|
|
371
371
|
[n]
|
|
372
|
-
), Re =
|
|
372
|
+
), Re = C(async () => {
|
|
373
373
|
try {
|
|
374
374
|
if (await t(), D(!1), typeof window < "u" && window.localStorage)
|
|
375
375
|
try {
|
|
@@ -390,14 +390,14 @@ function $e({
|
|
|
390
390
|
/* @__PURE__ */ x(
|
|
391
391
|
"button",
|
|
392
392
|
{
|
|
393
|
-
onClick:
|
|
393
|
+
onClick: he,
|
|
394
394
|
disabled: xe,
|
|
395
395
|
className: u.unstyled ? E : "cedros-theme__button cedros-theme__crypto",
|
|
396
396
|
type: "button",
|
|
397
397
|
children: F
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
|
-
ie && !
|
|
400
|
+
ie && !T && /* @__PURE__ */ x(
|
|
401
401
|
"div",
|
|
402
402
|
{
|
|
403
403
|
className: "cedros-modal-overlay",
|
|
@@ -503,7 +503,7 @@ function $e({
|
|
|
503
503
|
)
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
g && !
|
|
506
|
+
g && !T && !ie && /* @__PURE__ */ K(
|
|
507
507
|
"div",
|
|
508
508
|
{
|
|
509
509
|
style: {
|
|
@@ -552,9 +552,9 @@ function $e({
|
|
|
552
552
|
]
|
|
553
553
|
}
|
|
554
554
|
),
|
|
555
|
-
!
|
|
556
|
-
!
|
|
557
|
-
!
|
|
555
|
+
!T && se && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: se }),
|
|
556
|
+
!T && ae && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: ae }),
|
|
557
|
+
!T && $ && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__success", children: v("ui.subscription_active") })
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
560
|
);
|
|
@@ -564,14 +564,14 @@ function Fe() {
|
|
|
564
564
|
status: "idle",
|
|
565
565
|
error: null,
|
|
566
566
|
transactionId: null
|
|
567
|
-
}), [p,
|
|
567
|
+
}), [p, k] = B(null), [P, E] = B(null), h = N(!1), T = C(
|
|
568
568
|
async (s) => {
|
|
569
569
|
try {
|
|
570
570
|
S((n) => ({ ...n, status: "loading" }));
|
|
571
571
|
const t = await r.requestQuote({ resource: s });
|
|
572
572
|
if (!r.validateRequirement(t))
|
|
573
573
|
throw new Error("Invalid refund requirement received from server");
|
|
574
|
-
return
|
|
574
|
+
return k(t), S((n) => ({ ...n, status: "idle" })), t;
|
|
575
575
|
} catch (t) {
|
|
576
576
|
const n = z(t, "Failed to fetch refund requirement");
|
|
577
577
|
throw S({
|
|
@@ -582,13 +582,13 @@ function Fe() {
|
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
584
|
[r]
|
|
585
|
-
), W =
|
|
585
|
+
), W = C(
|
|
586
586
|
async (s, t) => {
|
|
587
|
-
if (
|
|
587
|
+
if (h.current)
|
|
588
588
|
throw new Error("Refund already in progress");
|
|
589
589
|
if (!f || !i)
|
|
590
590
|
throw new Error("Wallet not connected");
|
|
591
|
-
|
|
591
|
+
h.current = !0;
|
|
592
592
|
try {
|
|
593
593
|
S({
|
|
594
594
|
status: "loading",
|
|
@@ -598,7 +598,7 @@ function Fe() {
|
|
|
598
598
|
const n = await r.requestQuote({ resource: s, couponCode: t });
|
|
599
599
|
if (!r.validateRequirement(n))
|
|
600
600
|
throw new Error("Invalid refund requirement received");
|
|
601
|
-
|
|
601
|
+
k(n);
|
|
602
602
|
const l = await c.buildTransaction({
|
|
603
603
|
requirement: n,
|
|
604
604
|
payerPublicKey: f
|
|
@@ -630,17 +630,17 @@ function Fe() {
|
|
|
630
630
|
transactionId: null
|
|
631
631
|
}), n;
|
|
632
632
|
} finally {
|
|
633
|
-
|
|
633
|
+
h.current = !1;
|
|
634
634
|
}
|
|
635
635
|
},
|
|
636
636
|
[f, i, r, c]
|
|
637
|
-
), g =
|
|
637
|
+
), g = C(
|
|
638
638
|
async (s) => {
|
|
639
|
-
if (
|
|
639
|
+
if (h.current)
|
|
640
640
|
throw new Error("Refund already in progress");
|
|
641
641
|
if (!f || !i)
|
|
642
642
|
throw new Error("Wallet not connected");
|
|
643
|
-
|
|
643
|
+
h.current = !0;
|
|
644
644
|
try {
|
|
645
645
|
S({
|
|
646
646
|
status: "loading",
|
|
@@ -650,7 +650,7 @@ function Fe() {
|
|
|
650
650
|
const t = await r.requestQuote({ resource: s });
|
|
651
651
|
if (!r.validateRequirement(t))
|
|
652
652
|
throw new Error("Invalid refund requirement received");
|
|
653
|
-
|
|
653
|
+
k(t);
|
|
654
654
|
const { transaction: n } = await r.buildGaslessTransaction({
|
|
655
655
|
resourceId: s,
|
|
656
656
|
userWallet: f.toString(),
|
|
@@ -681,22 +681,22 @@ function Fe() {
|
|
|
681
681
|
transactionId: null
|
|
682
682
|
}), t;
|
|
683
683
|
} finally {
|
|
684
|
-
|
|
684
|
+
h.current = !1;
|
|
685
685
|
}
|
|
686
686
|
},
|
|
687
687
|
[f, i, r, c]
|
|
688
|
-
), I =
|
|
688
|
+
), I = C(() => {
|
|
689
689
|
S({
|
|
690
690
|
status: "idle",
|
|
691
691
|
error: null,
|
|
692
692
|
transactionId: null
|
|
693
|
-
}),
|
|
693
|
+
}), k(null), E(null);
|
|
694
694
|
}, []);
|
|
695
695
|
return {
|
|
696
696
|
state: R,
|
|
697
697
|
requirement: p,
|
|
698
698
|
settlement: P,
|
|
699
|
-
fetchRefundQuote:
|
|
699
|
+
fetchRefundQuote: T,
|
|
700
700
|
processRefund: W,
|
|
701
701
|
processGaslessRefund: g,
|
|
702
702
|
reset: I
|
|
@@ -707,43 +707,44 @@ export {
|
|
|
707
707
|
_t as CEDROS_PAY_GROUPS,
|
|
708
708
|
Wt as CEDROS_PAY_SECTIONS,
|
|
709
709
|
qt as CEDROS_PAY_SECTION_IDS,
|
|
710
|
-
|
|
710
|
+
Qt as CIRCUIT_BREAKER_PRESETS,
|
|
711
711
|
Ye as CSP_PRESETS,
|
|
712
712
|
Ve as CedrosPay,
|
|
713
713
|
Mt as CedrosPayAdminDashboard,
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
Lt as
|
|
714
|
+
$t as CedrosProvider,
|
|
715
|
+
Ft as CircuitBreakerOpenError,
|
|
716
|
+
Gt as CircuitState,
|
|
717
|
+
Lt as ComplianceGatePage,
|
|
718
|
+
At as CreditsBalance,
|
|
718
719
|
He as CreditsButton,
|
|
719
720
|
Je as CreditsSubscribeButton,
|
|
720
|
-
|
|
721
|
+
sr as CryptoButton,
|
|
721
722
|
$e as CryptoSubscribeButton,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
723
|
+
jt as ERROR_CATEGORIES,
|
|
724
|
+
Ut as KNOWN_STABLECOINS,
|
|
725
|
+
Yt as LogLevel,
|
|
726
|
+
Vt as Logger,
|
|
726
727
|
Xe as PaymentMethodBadge,
|
|
727
728
|
Ze as PaymentModal,
|
|
728
729
|
et as ProductPrice,
|
|
729
730
|
tt as PurchaseButton,
|
|
730
|
-
|
|
731
|
-
|
|
731
|
+
Ht as RATE_LIMITER_PRESETS,
|
|
732
|
+
Jt as RETRY_PRESETS,
|
|
732
733
|
rt as RPC_PROVIDERS,
|
|
733
734
|
nt as SECURITY_RECOMMENDATIONS,
|
|
734
735
|
at as StripeButton,
|
|
735
736
|
st as SubscribeButton,
|
|
736
737
|
ot as SubscriptionManagementPanel,
|
|
737
|
-
|
|
738
|
+
cr as WalletPool,
|
|
738
739
|
it as calculateDiscountPercentage,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
Dt as cedrosPayPlugin,
|
|
741
|
+
Xt as createCircuitBreaker,
|
|
742
|
+
Zt as createLogger,
|
|
743
|
+
er as createRateLimiter,
|
|
743
744
|
ct as createTranslator,
|
|
744
|
-
|
|
745
|
+
lr as createWalletPool,
|
|
745
746
|
lt as detectLocale,
|
|
746
|
-
|
|
747
|
+
Ot as ecommerce,
|
|
747
748
|
fe as emitPaymentError,
|
|
748
749
|
me as emitPaymentProcessing,
|
|
749
750
|
Ie as emitPaymentStart,
|
|
@@ -762,24 +763,25 @@ export {
|
|
|
762
763
|
bt as isRetryableError,
|
|
763
764
|
St as loadLocale,
|
|
764
765
|
wt as logSecurityReport,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
766
|
+
Ct as parseCouponCodes,
|
|
767
|
+
tr as retryWithBackoff,
|
|
768
|
+
ht as stackCheckoutCoupons,
|
|
768
769
|
H as useCedrosContext,
|
|
769
770
|
qe as useCedrosTheme,
|
|
770
|
-
|
|
771
|
+
Nt as useComplianceCheck,
|
|
772
|
+
zt as useCreditsBalance,
|
|
771
773
|
xt as useCreditsPayment,
|
|
772
774
|
Pt as useCreditsSubscription,
|
|
773
775
|
Le as useCryptoSubscription,
|
|
774
776
|
Et as useLocalizedError,
|
|
775
777
|
Rt as usePaymentMode,
|
|
776
778
|
Fe as useRefundVerification,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
+
kt as useStripeCheckout,
|
|
780
|
+
Tt as useSubscription,
|
|
779
781
|
vt as useSubscriptionManagement,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
782
|
+
Te as useTranslation,
|
|
783
|
+
or as useX402Payment,
|
|
784
|
+
rr as validateConfig,
|
|
783
785
|
Bt as validateSecurity,
|
|
784
|
-
|
|
786
|
+
nr as validateTokenMint
|
|
785
787
|
};
|