@cedros/pay-react 1.1.27 → 1.1.29
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-DELur7D2.js → AISettingsSection-B7qrycfY.js} +2 -2
- package/dist/{AISettingsSection-BlIv3CzS.mjs → AISettingsSection-DtAgMsDw.mjs} +6 -4
- package/dist/{AutosaveIndicator-Bed0-ekg.mjs → AutosaveIndicator-BEvABoKU.mjs} +1 -1
- package/dist/AutosaveIndicator-DiyeAg93.js +1 -0
- package/dist/CedrosContext-5Gjveoba.mjs +2555 -0
- package/dist/CedrosContext-CCakH2SZ.js +3 -0
- package/dist/CedrosPayAdminDashboard-CAwEvn66.js +1 -0
- package/dist/CedrosPayAdminDashboard-CBuvNAtB.mjs +250 -0
- package/dist/{ChatLogsSection-v4zwzCTC.mjs → ChatLogsSection-Ber5o8hF.mjs} +19 -17
- package/dist/ChatLogsSection-DLxMMi9I.js +1 -0
- package/dist/ComplianceSection-Buu0zTiL.js +1 -0
- package/dist/{ComplianceSection-CemgfDrL.mjs → ComplianceSection-ZCr0wsvw.mjs} +18 -15
- package/dist/{CryptoButton-BV9owVe2.mjs → CryptoButton-Cl2kZbOP.mjs} +26 -24
- package/dist/CryptoButton-DxFCYDlJ.js +1 -0
- package/dist/CustomersSection-BywmMLur.js +1 -0
- package/dist/{CustomersSection-D_j7OrfS.mjs → CustomersSection-D9UknSKC.mjs} +21 -19
- package/dist/{DisputesSection-BcAbXp3K.mjs → DisputesSection-C_eySK-W.mjs} +19 -17
- package/dist/DisputesSection-DwkHGv2a.js +1 -0
- package/dist/Dropdown-B90Zabxr.mjs +111 -0
- package/dist/Dropdown-CtY91emj.js +1 -0
- package/dist/ErrorBanner-CZXsHi3H.mjs +22 -0
- package/dist/ErrorBanner-Cx2dUhps.js +1 -0
- package/dist/{FAQSection-Dn38OhB_.mjs → FAQSection-Bv_Hdt8B.mjs} +8 -6
- package/dist/FAQSection-DlPLnIJD.js +1 -0
- package/dist/ImagesSection-B4Jzet79.js +1 -0
- package/dist/{ImagesSection-Ctw9Icym.mjs → ImagesSection-DpdXQ6qu.mjs} +6 -4
- package/dist/InventorySection-BgRdpn1l.js +1 -0
- package/dist/{InventorySection-DmhjUlRZ.mjs → InventorySection-DZMu9DMw.mjs} +25 -23
- package/dist/MessagingSection-CxV-pf-f.js +1 -0
- package/dist/{MessagingSection-B1FaGxkp.mjs → MessagingSection-D_cOBfFt.mjs} +5 -4
- package/dist/OrdersSection-BbAX79Ff.js +1 -0
- package/dist/{OrdersSection-Bj8bPdg8.mjs → OrdersSection-wfPavit9.mjs} +27 -24
- package/dist/PaymentSettingsSection-BdBDgaRg.js +1 -0
- package/dist/PaymentSettingsSection-DunzBo9n.mjs +648 -0
- package/dist/ReturnsSection-7k4LZ8yp.js +1 -0
- package/dist/{ReturnsSection-BC0L8r2e.mjs → ReturnsSection-B4FL7bUv.mjs} +11 -9
- package/dist/{SettingsSection-vdYFSNxB.js → SettingsSection-Cz2Yjdhr.js} +1 -1
- package/dist/{SettingsSection-KYdEizq_.mjs → SettingsSection-DoeNDbqd.mjs} +1 -1
- package/dist/{ShippingSection-BOgto6_9.mjs → ShippingSection-BlVsYC6B.mjs} +5 -3
- package/dist/ShippingSection-C-HI8rOb.js +1 -0
- package/dist/{SingleCategorySettings-suJ8z9d8.mjs → SingleCategorySettings-B406nnF-.mjs} +143 -140
- package/dist/SingleCategorySettings-BqC2UXt3.js +3 -0
- package/dist/StatsBar-D4v-I_Dj.mjs +25 -0
- package/dist/StatsBar-m6GSRNxs.js +1 -0
- package/dist/StorefrontSection-Axvh_KeS.js +1 -0
- package/dist/{StorefrontSection-BRvIGBEJ.mjs → StorefrontSection-BK_rhrAi.mjs} +121 -119
- package/dist/{SubscriptionsSection-D60qrX9a.mjs → SubscriptionsSection-D8V9RBv-.mjs} +11 -9
- package/dist/SubscriptionsSection-EeULMWIB.js +1 -0
- package/dist/{TaxSection-C7-pv-Rl.mjs → TaxSection-Cj6TXL6x.mjs} +23 -21
- package/dist/TaxSection-CzHPhaHl.js +1 -0
- package/dist/ThemeContext-CFXyYx7A.js +1 -0
- package/dist/ThemeContext-l0bqcOGW.mjs +126 -0
- package/dist/Token22Section-DqRKVG_G.js +1 -0
- package/dist/{Token22Section-CrHLQ0EB.mjs → Token22Section-DtYAcT54.mjs} +7 -6
- package/dist/{WalletManager-BIwH8Dw_.mjs → WalletManager-D-eoqUDy.mjs} +21 -19
- package/dist/WalletManager-DXChB9LA.js +1 -0
- package/dist/WebhooksSection-D--iPZuM.js +1 -0
- package/dist/{WebhooksSection-COPW4Ec0.mjs → WebhooksSection-DBAIxtBy.mjs} +40 -38
- package/dist/admin.d.ts +2 -0
- package/dist/admin.js +1 -0
- package/dist/admin.mjs +8 -0
- package/dist/configApi-BS5UJfzm.js +1 -0
- package/dist/{configApi-6XhAJGKX.mjs → configApi-BUXZOMWK.mjs} +57 -3
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +214 -202
- package/dist/dateHelpers-BKW_lGND.js +1 -0
- package/dist/dateHelpers-yvPkofYQ.mjs +6 -0
- package/dist/fetchWithTimeout-CG0EKbhf.js +1 -0
- package/dist/fetchWithTimeout-DmMOwL0Q.mjs +195 -0
- package/dist/index-9QF_UfSN.mjs +18668 -0
- package/dist/index-Cq9ya93W.js +84 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +74 -64
- package/dist/safeHref-DqJPLPl5.mjs +12 -0
- package/dist/safeHref-DyHIpVjY.js +1 -0
- package/dist/sectionIds-B_tFiNvF.js +1 -0
- package/dist/sectionIds-DBavltrL.mjs +359 -0
- package/dist/sections-BHph7CYj.mjs +9 -0
- package/dist/sections-C2zEJr5G.js +1 -0
- package/dist/sections-more-C1VNVwkp.js +1 -0
- package/dist/sections-more-CMFgfU4d.mjs +3082 -0
- package/dist/src/admin/index.d.ts +3 -3
- package/dist/src/admin/index.d.ts.map +1 -1
- package/dist/src/admin/plugin.d.ts.map +1 -1
- package/dist/src/admin/types.d.ts +2 -6
- package/dist/src/admin/types.d.ts.map +1 -1
- package/dist/src/admin.d.ts +9 -0
- package/dist/src/admin.d.ts.map +1 -0
- package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts +4 -0
- package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts.map +1 -0
- package/dist/src/components/admin/PaymentReadinessChecklist.d.ts +9 -0
- package/dist/src/components/admin/PaymentReadinessChecklist.d.ts.map +1 -0
- package/dist/src/components/admin/PaymentSettingsSection.d.ts.map +1 -1
- package/dist/src/components/admin/PaymentSetupGuide.d.ts +6 -0
- package/dist/src/components/admin/PaymentSetupGuide.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/src/components/admin/configApi.d.ts +1 -1
- package/dist/src/components/admin/configApi.d.ts.map +1 -1
- package/dist/src/components/admin/icons.d.ts +3 -50
- package/dist/src/components/admin/icons.d.ts.map +1 -1
- package/dist/src/components/admin/index.d.ts +1 -1
- package/dist/src/components/admin/index.d.ts.map +1 -1
- package/dist/src/components/admin/types.d.ts +43 -0
- package/dist/src/components/admin/types.d.ts.map +1 -1
- package/dist/src/context/CedrosContext.d.ts +2 -0
- package/dist/src/context/CedrosContext.d.ts.map +1 -1
- package/dist/src/ecommerce/__tests__/featureFlags.test.d.ts +2 -0
- package/dist/src/ecommerce/__tests__/featureFlags.test.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/components/general/ErrorBoundary.d.ts +1 -1
- package/dist/src/ecommerce/components/ui/button.d.ts +1 -1
- package/dist/src/ecommerce/components/ui/sheet.d.ts +1 -1
- package/dist/src/ecommerce/config/context.d.ts +2 -0
- package/dist/src/ecommerce/config/context.d.ts.map +1 -1
- package/dist/src/ecommerce/config/types.d.ts +2 -0
- package/dist/src/ecommerce/config/types.d.ts.map +1 -1
- package/dist/src/ecommerce/index.d.ts +2 -0
- package/dist/src/ecommerce/index.d.ts.map +1 -1
- package/dist/src/featureFlags.d.ts +41 -0
- package/dist/src/featureFlags.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/StripeManager.d.ts.map +1 -1
- package/dist/src/managers/SubscriptionManager.d.ts +1 -0
- package/dist/src/managers/SubscriptionManager.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +14 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/subscription.d.ts +47 -1
- package/dist/src/types/subscription.d.ts.map +1 -1
- package/dist/src/utils/validateConfig.d.ts.map +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +35 -33
- package/dist/styles--fxb3lCl.js +1 -0
- package/dist/{styles-D4SQkuV3.mjs → styles-DGagylUj.mjs} +53 -51
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/tokenMintValidator-DAjQld0r.mjs +98 -0
- package/dist/tokenMintValidator-DNBhoefh.js +4 -0
- package/dist/{walletPool-DE-t1wSW.mjs → walletPool-9MylB2QK.mjs} +1 -1
- package/dist/walletPool-BjTXX6Vn.js +1 -0
- package/package.json +6 -5
- package/dist/AutosaveIndicator-Dn_qA2hK.js +0 -1
- package/dist/CedrosContext-C2RjHLaQ.js +0 -6
- package/dist/CedrosContext-CY6zvjvJ.mjs +0 -2801
- package/dist/ChatLogsSection-BH5tLA4T.js +0 -1
- package/dist/ComplianceSection-DP2a9-S0.js +0 -1
- package/dist/CryptoButton-DpiCnyXE.js +0 -1
- package/dist/CustomersSection-CBwy_waO.js +0 -1
- package/dist/DisputesSection-BLjIk60n.js +0 -1
- package/dist/FAQSection-wNeH0i6Q.js +0 -1
- package/dist/ImagesSection-0ZzKlzMJ.js +0 -1
- package/dist/InventorySection-zV6lTmue.js +0 -1
- package/dist/MessagingSection-B_wdFR0j.js +0 -1
- package/dist/OrdersSection-Dw2FX-1d.js +0 -1
- package/dist/PaymentSettingsSection-BYF4D-GR.js +0 -1
- package/dist/PaymentSettingsSection-EnMxeWjv.mjs +0 -94
- package/dist/ReturnsSection-D_pJVxuG.js +0 -1
- package/dist/ShippingSection-1DRSTu49.js +0 -1
- package/dist/SingleCategorySettings-DwCnBdRf.js +0 -3
- package/dist/StorefrontSection-RumGkb3C.js +0 -1
- package/dist/SubscriptionsSection-C2aLLn7L.js +0 -1
- package/dist/TaxSection-Dt1DnM51.js +0 -1
- package/dist/Token22Section-DY3mUwTY.js +0 -1
- package/dist/WalletManager-B3UdQ5pQ.js +0 -1
- package/dist/WebhooksSection-CKeiJ7Py.js +0 -1
- package/dist/configApi-DkduMQg1.js +0 -1
- package/dist/index-C0g-JxJk.js +0 -84
- package/dist/index-DXnuQp5x.mjs +0 -22128
- package/dist/sections-C1NpK7hk.mjs +0 -9
- package/dist/sections-DVVSZBhW.js +0 -1
- package/dist/styles-BT4bhFey.js +0 -1
- package/dist/walletPool-IS7R3MR1.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./styles
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./styles--fxb3lCl.js"),r=require("./index-Cq9ya93W.js"),t=require("./CedrosContext-CCakH2SZ.js"),o=require("./fetchWithTimeout-CG0EKbhf.js"),a=require("./sectionIds-B_tFiNvF.js"),i=require("./ThemeContext-CFXyYx7A.js");exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.validateSecurity=e.validateSecurity;exports.ComplianceGatePage=r.ComplianceGatePage;exports.CreditsBalance=r.CreditsBalance;exports.ecommerce=r.index;exports.useComplianceCheck=r.useComplianceCheck;exports.useCreditsBalance=r.useCreditsBalance;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.ERROR_CATEGORIES=t.ERROR_CATEGORIES;exports.FEATURE_FLAG_NAMES=t.FEATURE_FLAG_NAMES;exports.FEATURE_FLAG_REGISTRY=t.FEATURE_FLAG_REGISTRY;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createRateLimiter=t.createRateLimiter;exports.getFeatureFlagDefinition=t.getFeatureFlagDefinition;exports.getFeatureFlagDefinitions=t.getFeatureFlagDefinitions;exports.isFeatureEnabled=t.isFeatureEnabled;exports.parseFeatureFlagBoolean=t.parseFeatureFlagBoolean;exports.resolveFeatureFlags=t.resolveFeatureFlags;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.validateConfig=t.validateConfig;exports.LogLevel=o.LogLevel;exports.Logger=o.Logger;exports.createLogger=o.createLogger;exports.getLogger=o.getLogger;exports.CEDROS_PAY_GROUPS=a.CEDROS_PAY_GROUPS;exports.CEDROS_PAY_SECTIONS=a.CEDROS_PAY_SECTIONS;exports.CEDROS_PAY_SECTION_IDS=a.CEDROS_PAY_SECTION_IDS;exports.CedrosPayAdminDashboard=a.CedrosPayAdminDashboard;exports.cedrosPayPlugin=a.cedrosPayPlugin;exports.useCedrosTheme=i.useCedrosTheme;
|
package/dist/index.mjs
CHANGED
|
@@ -1,77 +1,87 @@
|
|
|
1
|
-
import { C as s, a as t, b as r, c as o, d as i, P as
|
|
2
|
-
import { C as H, a as J,
|
|
3
|
-
import { C as
|
|
1
|
+
import { C as s, a as t, b as r, c as o, d as i, P as n, e as c, f as u, g as C, R as E, S, h as l, i as P, j as R, k as d, l as m, m as g, n as p, o as _, p as T, q as b, r as y, s as L, t as f, u as A, v as F, w as B, x as O, y as D, z as I, A as M, B as h, D as k, E as v, F as x, G, H as N, I as U, J as Y, K as W, L as z, M as j, N as K, O as V, Q as q } from "./styles-DGagylUj.mjs";
|
|
2
|
+
import { C as H, a as J, i as Q, u as X, b as Z } from "./index-9QF_UfSN.mjs";
|
|
3
|
+
import { C as aa, a as ea, b as sa, c as ta, E as ra, F as oa, d as ia, R as na, e as ca, f as ua, g as Ca, h as Ea, i as Sa, j as la, p as Pa, r as Ra, k as da, u as ma, v as ga } from "./CedrosContext-5Gjveoba.mjs";
|
|
4
|
+
import { L as _a, a as Ta, c as ba, g as ya } from "./fetchWithTimeout-DmMOwL0Q.mjs";
|
|
5
|
+
import { C as fa, a as Aa, b as Fa, c as Ba, d as Oa } from "./sectionIds-DBavltrL.mjs";
|
|
6
|
+
import { u as Ia } from "./ThemeContext-l0bqcOGW.mjs";
|
|
4
7
|
export {
|
|
5
8
|
s as CEDROS_EVENTS,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
fa as CEDROS_PAY_GROUPS,
|
|
10
|
+
Aa as CEDROS_PAY_SECTIONS,
|
|
11
|
+
Fa as CEDROS_PAY_SECTION_IDS,
|
|
12
|
+
aa as CIRCUIT_BREAKER_PRESETS,
|
|
10
13
|
t as CSP_PRESETS,
|
|
11
14
|
r as CedrosPay,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
Ba as CedrosPayAdminDashboard,
|
|
16
|
+
ea as CedrosProvider,
|
|
17
|
+
sa as CircuitBreakerOpenError,
|
|
18
|
+
ta as CircuitState,
|
|
19
|
+
H as ComplianceGatePage,
|
|
20
|
+
J as CreditsBalance,
|
|
18
21
|
o as CreditsButton,
|
|
19
22
|
i as CreditsSubscribeButton,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
l as
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
ra as ERROR_CATEGORIES,
|
|
24
|
+
oa as FEATURE_FLAG_NAMES,
|
|
25
|
+
ia as FEATURE_FLAG_REGISTRY,
|
|
26
|
+
_a as LogLevel,
|
|
27
|
+
Ta as Logger,
|
|
28
|
+
n as PaymentMethodBadge,
|
|
29
|
+
c as PaymentModal,
|
|
30
|
+
u as ProductPrice,
|
|
31
|
+
C as PurchaseButton,
|
|
32
|
+
na as RATE_LIMITER_PRESETS,
|
|
33
|
+
ca as RETRY_PRESETS,
|
|
34
|
+
E as RPC_PROVIDERS,
|
|
35
|
+
S as SECURITY_RECOMMENDATIONS,
|
|
36
|
+
l as StripeButton,
|
|
37
|
+
P as SubscribeButton,
|
|
38
|
+
R as SubscriptionManagementPanel,
|
|
39
|
+
d as calculateDiscountPercentage,
|
|
40
|
+
Oa as cedrosPayPlugin,
|
|
41
|
+
ua as createCircuitBreaker,
|
|
42
|
+
ba as createLogger,
|
|
43
|
+
Ca as createRateLimiter,
|
|
44
|
+
m as createTranslator,
|
|
40
45
|
g as detectLocale,
|
|
41
|
-
|
|
46
|
+
Q as ecommerce,
|
|
42
47
|
p as emitPaymentError,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
_ as emitPaymentProcessing,
|
|
49
|
+
T as emitPaymentStart,
|
|
50
|
+
b as emitPaymentSuccess,
|
|
51
|
+
y as emitWalletConnect,
|
|
47
52
|
L as emitWalletConnected,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
f as emitWalletError,
|
|
54
|
+
A as formatCSP,
|
|
55
|
+
F as formatCouponCodes,
|
|
56
|
+
B as generateCSP,
|
|
57
|
+
O as generateCSPDirectives,
|
|
58
|
+
D as getAvailableLocales,
|
|
59
|
+
Ea as getFeatureFlagDefinition,
|
|
60
|
+
Sa as getFeatureFlagDefinitions,
|
|
61
|
+
I as getLocalizedError,
|
|
62
|
+
ya as getLogger,
|
|
56
63
|
M as getUserErrorMessage,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
la as isFeatureEnabled,
|
|
65
|
+
h as isRetryableError,
|
|
66
|
+
k as loadLocale,
|
|
67
|
+
v as logSecurityReport,
|
|
60
68
|
x as parseCouponCodes,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
Pa as parseFeatureFlagBoolean,
|
|
70
|
+
Ra as resolveFeatureFlags,
|
|
71
|
+
da as retryWithBackoff,
|
|
72
|
+
G as stackCheckoutCoupons,
|
|
73
|
+
ma as useCedrosContext,
|
|
74
|
+
Ia as useCedrosTheme,
|
|
75
|
+
X as useComplianceCheck,
|
|
76
|
+
Z as useCreditsBalance,
|
|
77
|
+
N as useCreditsPayment,
|
|
68
78
|
U as useCreditsSubscription,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
Y as useLocalizedError,
|
|
80
|
+
W as usePaymentMode,
|
|
81
|
+
z as useStripeCheckout,
|
|
82
|
+
j as useSubscription,
|
|
83
|
+
K as useSubscriptionManagement,
|
|
84
|
+
V as useTranslation,
|
|
85
|
+
ga as validateConfig,
|
|
86
|
+
q as validateSecurity
|
|
77
87
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(t){if(t)try{const r=new URL(t,"https://placeholder.invalid");return r.protocol==="https:"||r.protocol==="http:"?t:void 0}catch{return}}exports.safeHref=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),x=require("react"),M=require("./index-WcOlBYZJ.js"),g=require("./fetchWithTimeout-CG0EKbhf.js"),C=x.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./CedrosPayAdminDashboard-CAwEvn66.js"))).CedrosPayAdminDashboard}));function A(r){return e.jsx(x.Suspense,{fallback:null,children:e.jsx(C,{...r})})}function m(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M20 7.5v9l-4 2.25M4 7.5v9l4 2.25"}),e.jsx("path",{d:"m20 7.5-8-4.5-8 4.5"}),e.jsx("path",{d:"m12 12 8-4.5M12 12v9.5M12 12 4 7.5"})]})}function k(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})})}function v(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),e.jsx("path",{d:"M13 5v2M13 17v2M13 11v2"})]})}function w(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.jsx("path",{d:"M3 3v5h5"}),e.jsx("path",{d:"M12 7v5l4 2"})]})}function y(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function S(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"}),e.jsx("path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"})]})}const d={products:()=>e.jsx(m,{}),transactions:()=>e.jsx(k,{}),coupons:()=>e.jsx(v,{}),refunds:()=>e.jsx(w,{}),settings:()=>e.jsx(y,{}),wallet:()=>e.jsx(S,{})},b={products:e.jsx(m,{}),transactions:e.jsx(k,{}),coupons:e.jsx(v,{}),refunds:e.jsx(w,{}),settings:e.jsx(y,{}),wallet:e.jsx(S,{}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})}),loading:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"cedros-admin__spinner",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),refresh:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]}),user:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"8",r:"5"}),e.jsx("path",{d:"M20 21a8 8 0 0 0-16 0"})]}),check:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),trash:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})}),plus:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 5v14M5 12h14"})}),chevronDown:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})}),chevronUp:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m18 15-6-6-6 6"})}),storefront:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z"}),e.jsx("path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9"}),e.jsx("path",{d:"M12 3v6"})]}),arrowUp:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]}),arrowDown:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7 7 7-7"}),e.jsx("path",{d:"M12 5v14"})]}),delete:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e.jsx("path",{d:"M10 11v6M14 11v6"})]}),close:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),edit:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),faq:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),e.jsx("path",{d:"M12 17h.01"})]}),chat:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m3 21 1.9-5.7a8.5 8.5 0 1 1 3.8 3.8z"})}),globe:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),e.jsx("path",{d:"M2 12h20"})]}),eye:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),eyeOff:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),e.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),e.jsx("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),e.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),creditCard:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}),e.jsx("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]}),mail:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),server:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}),e.jsx("rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}),e.jsx("line",{x1:"6",x2:"6.01",y1:"18",y2:"18"})]}),calendarRepeat:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),e.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),e.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"}),e.jsx("path",{d:"M11 14h1.5a1.5 1.5 0 0 1 0 3H11v2"}),e.jsx("path",{d:"M16 14v3a1 1 0 0 0 1 1h1"})]}),shield:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})}),brain:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),e.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),e.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),e.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),e.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),e.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),e.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),e.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),e.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]})};class L{serverUrl;walletSigner=null;jwtToken=null;isAdminUser=!1;constructor(o){this.serverUrl=o}getAuthMethod(){return this.walletSigner?.publicKey&&this.walletSigner.signMessage?"wallet":this.jwtToken&&this.isAdminUser?"cedros-login":"none"}isAuthenticated(){return this.getAuthMethod()!=="none"}setWalletSigner(o){this.walletSigner=o,g.getLogger().debug("[AdminAuthManager] Wallet signer updated:",!!o?.publicKey)}setCedrosLoginAuth(o,n){this.jwtToken=o,this.isAdminUser=n??!1,g.getLogger().debug("[AdminAuthManager] Cedros-login auth updated:",{hasToken:!!o,isAdmin:this.isAdminUser})}async createAuthHeaders(o){const n=this.getAuthMethod();if(n==="wallet")return this.createWalletAuthHeaders(o);if(n==="cedros-login")return this.createJwtAuthHeaders();throw new Error("No admin authentication configured. Connect a wallet or sign in as admin.")}async createWalletAuthHeaders(o){if(!this.walletSigner?.publicKey||!this.walletSigner.signMessage)throw new Error("Wallet not connected or does not support message signing");const n=await this.fetchNonce(o),c=new TextEncoder().encode(n.nonce),t=await this.walletSigner.signMessage(c),i=M.bs58.encode(this.walletSigner.publicKey.toBytes()),u=g.gBase64.fromUint8Array(t);return{"X-Signer":i,"X-Message":n.nonce,"X-Signature":u}}createJwtAuthHeaders(){if(!this.jwtToken)throw new Error("No JWT token available");return{Authorization:`Bearer ${this.jwtToken}`}}async fetchNonce(o){const n=`${this.serverUrl}/paywall/v1/nonce`,c=typeof o=="string"?{purpose:o}:{path:o.path,method:o.method.toUpperCase()};g.getLogger().debug("[AdminAuthManager] Fetching nonce:",c);const t=await g.fetchWithTimeout(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!t.ok){const i=await t.text();throw new Error(`Failed to fetch nonce: ${t.status} ${i}`)}return await t.json()}async fetchWithAuth(o,n={}){if(this.getAuthMethod()==="none")throw new Error("No admin authentication configured");const t=(n.method||"GET").toUpperCase(),i=await this.createAuthHeaders({path:o,method:t}),u={...t!=="GET"&&t!=="HEAD"?{"Content-Type":"application/json"}:{},...n.headers||{},...i},h=await g.fetchWithTimeout(`${this.serverUrl}${o}`,{...n,headers:u});if(!h.ok){let p=`Admin API error ${h.status}`;try{const l=await h.json();l&&typeof l.error=="string"?p=l.error:l&&typeof l.message=="string"&&(p=l.message)}catch{}throw new Error(p)}return await h.json()}}const s={adminProfile:"admin-profile",adminSectionAccess:"admin-section-access",cedrosLogin:"cedros-login",cedrosPay:"cedros-pay",org:"org",dashboardPermissions:"dashboard-permissions"};function T(r={}){return{...r}}function W(r){const o=T(r.services);return!(s.adminProfile in o)&&r.cedrosLogin?.user&&(o[s.adminProfile]={user:r.cedrosLogin.user}),!(s.adminSectionAccess in o)&&r.dashboardPermissions&&(o[s.adminSectionAccess]=r.dashboardPermissions),!(s.cedrosLogin in o)&&r.cedrosLogin&&(o[s.cedrosLogin]=r.cedrosLogin),!(s.cedrosPay in o)&&r.cedrosPay&&(o[s.cedrosPay]=r.cedrosPay),!(s.org in o)&&r.org&&(o[s.org]=r.org),!(s.dashboardPermissions in o)&&r.dashboardPermissions&&(o[s.dashboardPermissions]=r.dashboardPermissions),o}function f(r,o){return B(W(r),o)}function B(r,o){return r[o]}const a=r=>x.lazy(async()=>{const c=(await r()).default;return{default:({pluginContext:i})=>{const u=i.getAccessToken(),h=i.hasPermission("cedros-pay:admin")||i.hasPermission("admin"),p=x.useMemo(()=>{const j=new L(i.serverUrl);return j.setCedrosLoginAuth(u??null,h),j},[h,i.serverUrl,u]),l={serverUrl:i.serverUrl,authManager:p};return e.jsx(c,{...l})}}}),E={id:"cedros-pay",name:"Cedros Pay",version:"1.0.0",sections:[{id:"transactions",label:"Transactions",icon:d.transactions,group:"Store",order:0},{id:"products",label:"Products",icon:d.products,group:"Store",order:1},{id:"subscriptions",label:"Subscriptions",icon:d.products,group:"Store",order:2},{id:"coupons",label:"Coupons",icon:d.coupons,group:"Store",order:3},{id:"refunds",label:"Refunds",icon:d.refunds,group:"Store",order:4},{id:"compliance",label:"Compliance",icon:d.settings,group:"Store",order:5},{id:"storefront",label:"Storefront",icon:d.products,group:"Configuration",order:10},{id:"ai-settings",label:"Store AI",icon:d.settings,group:"Configuration",order:11},{id:"faqs",label:"Knowledge Base",icon:d.settings,group:"Configuration",order:12},{id:"payment-settings",label:"Payment Options",icon:d.wallet,group:"Configuration",order:13},{id:"messaging",label:"Store Messages",icon:d.settings,group:"Configuration",order:14},{id:"settings",label:"Store Server",icon:d.settings,group:"Configuration",order:15}],groups:[{id:"Store",label:"Store",order:1},{id:"Configuration",label:"Configuration",order:2,defaultCollapsed:!0}],components:{products:a(()=>Promise.resolve().then(()=>require("./sections-C2zEJr5G.js")).then(r=>({default:r.ProductsSection}))),subscriptions:a(()=>Promise.resolve().then(()=>require("./SubscriptionsSection-EeULMWIB.js")).then(r=>({default:r.SubscriptionsSection}))),transactions:a(()=>Promise.resolve().then(()=>require("./sections-C2zEJr5G.js")).then(r=>({default:r.TransactionsSection}))),coupons:a(()=>Promise.resolve().then(()=>require("./sections-C2zEJr5G.js")).then(r=>({default:r.CouponsSection}))),refunds:a(()=>Promise.resolve().then(()=>require("./sections-C2zEJr5G.js")).then(r=>({default:r.RefundsSection}))),compliance:a(()=>Promise.resolve().then(()=>require("./ComplianceSection-Buu0zTiL.js")).then(r=>({default:r.ComplianceSection}))),storefront:a(()=>Promise.resolve().then(()=>require("./StorefrontSection-Axvh_KeS.js")).then(r=>({default:r.StorefrontSection}))),"ai-settings":a(()=>Promise.resolve().then(()=>require("./AISettingsSection-B7qrycfY.js")).then(r=>({default:r.AISettingsSection}))),faqs:a(()=>Promise.resolve().then(()=>require("./FAQSection-DlPLnIJD.js")).then(r=>({default:r.FAQSection}))),"payment-settings":a(()=>Promise.resolve().then(()=>require("./PaymentSettingsSection-BdBDgaRg.js")).then(r=>({default:r.PaymentSettingsSection}))),messaging:a(()=>Promise.resolve().then(()=>require("./MessagingSection-CxV-pf-f.js")).then(r=>({default:r.MessagingSection}))),settings:a(()=>Promise.resolve().then(()=>require("./SettingsSection-Cz2Yjdhr.js")).then(r=>({default:r.SettingsSection})))},createPluginContext(r){const o=f(r,s.cedrosPay),n=f(r,s.cedrosLogin),c=f(r,s.org);return{serverUrl:o?.serverUrl||n?.serverUrl||"",userId:n?.user?.id,getAccessToken:()=>n?.getAccessToken?.()||o?.jwtToken||null,hasPermission:i=>this.checkPermission(i,r),orgId:c?.orgId,pluginData:{walletAddress:o?.walletAddress}}},checkPermission(r,o){const n=f(o,s.org);return n?.permissions?n.permissions.includes(r):!1},cssNamespace:"cedros-dashboard"},P=[{id:"transactions",qualifiedId:"cedros-pay:transactions",label:"Transactions",group:"Store",order:0,endpoints:["GET /admin/transactions"]},{id:"products",qualifiedId:"cedros-pay:products",label:"Products",group:"Store",order:1,endpoints:["GET /admin/products","POST /admin/products","PUT /admin/products/{id}","DELETE /admin/products/{id}"]},{id:"subscriptions",qualifiedId:"cedros-pay:subscriptions",label:"Subscriptions",group:"Store",order:2,endpoints:["GET /admin/subscriptions","POST /admin/subscriptions","PUT /admin/subscriptions/{id}"]},{id:"coupons",qualifiedId:"cedros-pay:coupons",label:"Coupons",group:"Store",order:3,endpoints:["GET /admin/coupons","POST /admin/coupons","PUT /admin/coupons/{id}","DELETE /admin/coupons/{id}"]},{id:"refunds",qualifiedId:"cedros-pay:refunds",label:"Refunds",group:"Store",order:4,endpoints:["GET /admin/refunds","POST /admin/refunds/{id}/approve","POST /admin/refunds/{id}/deny"]},{id:"storefront",qualifiedId:"cedros-pay:storefront",label:"Storefront",group:"Configuration",order:10,endpoints:["GET /admin/config/shop","PUT /admin/config/shop"]},{id:"ai-settings",qualifiedId:"cedros-pay:ai-settings",label:"Store AI",group:"Configuration",order:11,endpoints:["GET /admin/config/ai","PUT /admin/config/ai/api-key","PUT /admin/config/ai/assignment","PUT /admin/config/ai/prompt"]},{id:"faqs",qualifiedId:"cedros-pay:faqs",label:"Knowledge Base",group:"Configuration",order:12,endpoints:["GET /admin/faqs","POST /admin/faqs","PUT /admin/faqs/{id}","DELETE /admin/faqs/{id}"]},{id:"payment-settings",qualifiedId:"cedros-pay:payment-settings",label:"Payment Options",group:"Configuration",order:13,endpoints:["GET /admin/config/stripe","PUT /admin/config/stripe","GET /admin/config/x402","PUT /admin/config/x402","GET /admin/config/cedros_login","PUT /admin/config/cedros_login"]},{id:"messaging",qualifiedId:"cedros-pay:messaging",label:"Store Messages",group:"Configuration",order:14,endpoints:["GET /admin/config/messaging","PUT /admin/config/messaging"]},{id:"settings",qualifiedId:"cedros-pay:settings",label:"Store Server",group:"Configuration",order:15,endpoints:["GET /admin/config/server","PUT /admin/config/server"]}],q=P.map(r=>r.qualifiedId),I=[{id:"Store",label:"Store",order:1,defaultCollapsed:!1},{id:"Configuration",label:"Configuration",order:2,defaultCollapsed:!0}];exports.AdminAuthManager=L;exports.CEDROS_PAY_GROUPS=I;exports.CEDROS_PAY_SECTIONS=P;exports.CEDROS_PAY_SECTION_IDS=q;exports.CedrosPayAdminDashboard=A;exports.Icons=b;exports.cedrosPayPlugin=E;
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as w, Suspense as P, useMemo as A } from "react";
|
|
3
|
+
import { b as T } from "./index-BFt38o8Q.mjs";
|
|
4
|
+
import { g as m, b as x, f as v } from "./fetchWithTimeout-DmMOwL0Q.mjs";
|
|
5
|
+
const j = w(async () => ({ default: (await import("./CedrosPayAdminDashboard-CBuvNAtB.mjs")).CedrosPayAdminDashboard }));
|
|
6
|
+
function D(o) {
|
|
7
|
+
return /* @__PURE__ */ e(P, { fallback: null, children: /* @__PURE__ */ e(j, { ...o }) });
|
|
8
|
+
}
|
|
9
|
+
function y() {
|
|
10
|
+
return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
11
|
+
/* @__PURE__ */ e("path", { d: "M20 7.5v9l-4 2.25M4 7.5v9l4 2.25" }),
|
|
12
|
+
/* @__PURE__ */ e("path", { d: "m20 7.5-8-4.5-8 4.5" }),
|
|
13
|
+
/* @__PURE__ */ e("path", { d: "m12 12 8-4.5M12 12v9.5M12 12 4 7.5" })
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
function L() {
|
|
17
|
+
return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" }) });
|
|
18
|
+
}
|
|
19
|
+
function S() {
|
|
20
|
+
return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
21
|
+
/* @__PURE__ */ e("path", { d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }),
|
|
22
|
+
/* @__PURE__ */ e("path", { d: "M13 5v2M13 17v2M13 11v2" })
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
function M() {
|
|
26
|
+
return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
27
|
+
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
28
|
+
/* @__PURE__ */ e("path", { d: "M3 3v5h5" }),
|
|
29
|
+
/* @__PURE__ */ e("path", { d: "M12 7v5l4 2" })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function C() {
|
|
33
|
+
return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
34
|
+
/* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
35
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
function b() {
|
|
39
|
+
return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
40
|
+
/* @__PURE__ */ e("path", { d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }),
|
|
41
|
+
/* @__PURE__ */ e("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
const d = {
|
|
45
|
+
products: () => /* @__PURE__ */ e(y, {}),
|
|
46
|
+
transactions: () => /* @__PURE__ */ e(L, {}),
|
|
47
|
+
coupons: () => /* @__PURE__ */ e(S, {}),
|
|
48
|
+
refunds: () => /* @__PURE__ */ e(M, {}),
|
|
49
|
+
settings: () => /* @__PURE__ */ e(C, {}),
|
|
50
|
+
wallet: () => /* @__PURE__ */ e(b, {})
|
|
51
|
+
}, V = {
|
|
52
|
+
products: /* @__PURE__ */ e(y, {}),
|
|
53
|
+
transactions: /* @__PURE__ */ e(L, {}),
|
|
54
|
+
coupons: /* @__PURE__ */ e(S, {}),
|
|
55
|
+
refunds: /* @__PURE__ */ e(M, {}),
|
|
56
|
+
settings: /* @__PURE__ */ e(C, {}),
|
|
57
|
+
wallet: /* @__PURE__ */ e(b, {}),
|
|
58
|
+
chevronRight: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" }) }),
|
|
59
|
+
loading: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "cedros-admin__spinner", children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }),
|
|
60
|
+
refresh: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
61
|
+
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
62
|
+
/* @__PURE__ */ e("path", { d: "M21 3v5h-5" }),
|
|
63
|
+
/* @__PURE__ */ e("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
64
|
+
/* @__PURE__ */ e("path", { d: "M8 16H3v5" })
|
|
65
|
+
] }),
|
|
66
|
+
user: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
67
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "5" }),
|
|
68
|
+
/* @__PURE__ */ e("path", { d: "M20 21a8 8 0 0 0-16 0" })
|
|
69
|
+
] }),
|
|
70
|
+
check: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }),
|
|
71
|
+
trash: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }) }),
|
|
72
|
+
plus: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }) }),
|
|
73
|
+
chevronDown: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }) }),
|
|
74
|
+
chevronUp: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m18 15-6-6-6 6" }) }),
|
|
75
|
+
storefront: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
76
|
+
/* @__PURE__ */ e("path", { d: "M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z" }),
|
|
77
|
+
/* @__PURE__ */ e("path", { d: "m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9" }),
|
|
78
|
+
/* @__PURE__ */ e("path", { d: "M12 3v6" })
|
|
79
|
+
] }),
|
|
80
|
+
arrowUp: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
81
|
+
/* @__PURE__ */ e("path", { d: "m5 12 7-7 7 7" }),
|
|
82
|
+
/* @__PURE__ */ e("path", { d: "M12 19V5" })
|
|
83
|
+
] }),
|
|
84
|
+
arrowDown: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
85
|
+
/* @__PURE__ */ e("path", { d: "m5 12 7 7 7-7" }),
|
|
86
|
+
/* @__PURE__ */ e("path", { d: "M12 5v14" })
|
|
87
|
+
] }),
|
|
88
|
+
delete: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
89
|
+
/* @__PURE__ */ e("path", { d: "M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
|
|
90
|
+
/* @__PURE__ */ e("path", { d: "M10 11v6M14 11v6" })
|
|
91
|
+
] }),
|
|
92
|
+
close: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12" }) }),
|
|
93
|
+
edit: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
94
|
+
/* @__PURE__ */ e("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
95
|
+
/* @__PURE__ */ e("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
96
|
+
] }),
|
|
97
|
+
faq: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
98
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
99
|
+
/* @__PURE__ */ e("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
|
100
|
+
/* @__PURE__ */ e("path", { d: "M12 17h.01" })
|
|
101
|
+
] }),
|
|
102
|
+
chat: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m3 21 1.9-5.7a8.5 8.5 0 1 1 3.8 3.8z" }) }),
|
|
103
|
+
globe: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
104
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
105
|
+
/* @__PURE__ */ e("path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }),
|
|
106
|
+
/* @__PURE__ */ e("path", { d: "M2 12h20" })
|
|
107
|
+
] }),
|
|
108
|
+
eye: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
109
|
+
/* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
110
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
111
|
+
] }),
|
|
112
|
+
eyeOff: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
113
|
+
/* @__PURE__ */ e("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
114
|
+
/* @__PURE__ */ e("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
115
|
+
/* @__PURE__ */ e("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
116
|
+
/* @__PURE__ */ e("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
|
|
117
|
+
] }),
|
|
118
|
+
creditCard: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
119
|
+
/* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "5", rx: "2" }),
|
|
120
|
+
/* @__PURE__ */ e("line", { x1: "2", x2: "22", y1: "10", y2: "10" })
|
|
121
|
+
] }),
|
|
122
|
+
mail: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
123
|
+
/* @__PURE__ */ e("rect", { width: "20", height: "16", x: "2", y: "4", rx: "2" }),
|
|
124
|
+
/* @__PURE__ */ e("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })
|
|
125
|
+
] }),
|
|
126
|
+
server: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
127
|
+
/* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
|
|
128
|
+
/* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
|
|
129
|
+
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
|
|
130
|
+
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
|
|
131
|
+
] }),
|
|
132
|
+
calendarRepeat: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
133
|
+
/* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", ry: "2" }),
|
|
134
|
+
/* @__PURE__ */ e("line", { x1: "16", x2: "16", y1: "2", y2: "6" }),
|
|
135
|
+
/* @__PURE__ */ e("line", { x1: "8", x2: "8", y1: "2", y2: "6" }),
|
|
136
|
+
/* @__PURE__ */ e("line", { x1: "3", x2: "21", y1: "10", y2: "10" }),
|
|
137
|
+
/* @__PURE__ */ e("path", { d: "M11 14h1.5a1.5 1.5 0 0 1 0 3H11v2" }),
|
|
138
|
+
/* @__PURE__ */ e("path", { d: "M16 14v3a1 1 0 0 0 1 1h1" })
|
|
139
|
+
] }),
|
|
140
|
+
shield: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }) }),
|
|
141
|
+
brain: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
142
|
+
/* @__PURE__ */ e("path", { d: "M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z" }),
|
|
143
|
+
/* @__PURE__ */ e("path", { d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z" }),
|
|
144
|
+
/* @__PURE__ */ e("path", { d: "M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" }),
|
|
145
|
+
/* @__PURE__ */ e("path", { d: "M17.599 6.5a3 3 0 0 0 .399-1.375" }),
|
|
146
|
+
/* @__PURE__ */ e("path", { d: "M6.003 5.125A3 3 0 0 0 6.401 6.5" }),
|
|
147
|
+
/* @__PURE__ */ e("path", { d: "M3.477 10.896a4 4 0 0 1 .585-.396" }),
|
|
148
|
+
/* @__PURE__ */ e("path", { d: "M19.938 10.5a4 4 0 0 1 .585.396" }),
|
|
149
|
+
/* @__PURE__ */ e("path", { d: "M6 18a4 4 0 0 1-1.967-.516" }),
|
|
150
|
+
/* @__PURE__ */ e("path", { d: "M19.967 17.484A4 4 0 0 1 18 18" })
|
|
151
|
+
] })
|
|
152
|
+
};
|
|
153
|
+
class B {
|
|
154
|
+
serverUrl;
|
|
155
|
+
walletSigner = null;
|
|
156
|
+
jwtToken = null;
|
|
157
|
+
isAdminUser = !1;
|
|
158
|
+
constructor(r) {
|
|
159
|
+
this.serverUrl = r;
|
|
160
|
+
}
|
|
161
|
+
getAuthMethod() {
|
|
162
|
+
return this.walletSigner?.publicKey && this.walletSigner.signMessage ? "wallet" : this.jwtToken && this.isAdminUser ? "cedros-login" : "none";
|
|
163
|
+
}
|
|
164
|
+
isAuthenticated() {
|
|
165
|
+
return this.getAuthMethod() !== "none";
|
|
166
|
+
}
|
|
167
|
+
setWalletSigner(r) {
|
|
168
|
+
this.walletSigner = r, m().debug("[AdminAuthManager] Wallet signer updated:", !!r?.publicKey);
|
|
169
|
+
}
|
|
170
|
+
setCedrosLoginAuth(r, n) {
|
|
171
|
+
this.jwtToken = r, this.isAdminUser = n ?? !1, m().debug("[AdminAuthManager] Cedros-login auth updated:", { hasToken: !!r, isAdmin: this.isAdminUser });
|
|
172
|
+
}
|
|
173
|
+
async createAuthHeaders(r) {
|
|
174
|
+
const n = this.getAuthMethod();
|
|
175
|
+
if (n === "wallet")
|
|
176
|
+
return this.createWalletAuthHeaders(r);
|
|
177
|
+
if (n === "cedros-login")
|
|
178
|
+
return this.createJwtAuthHeaders();
|
|
179
|
+
throw new Error("No admin authentication configured. Connect a wallet or sign in as admin.");
|
|
180
|
+
}
|
|
181
|
+
async createWalletAuthHeaders(r) {
|
|
182
|
+
if (!this.walletSigner?.publicKey || !this.walletSigner.signMessage)
|
|
183
|
+
throw new Error("Wallet not connected or does not support message signing");
|
|
184
|
+
const n = await this.fetchNonce(r), l = new TextEncoder().encode(n.nonce), a = await this.walletSigner.signMessage(l), s = T.encode(this.walletSigner.publicKey.toBytes()), p = x.fromUint8Array(a);
|
|
185
|
+
return {
|
|
186
|
+
"X-Signer": s,
|
|
187
|
+
"X-Message": n.nonce,
|
|
188
|
+
"X-Signature": p
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
createJwtAuthHeaders() {
|
|
192
|
+
if (!this.jwtToken)
|
|
193
|
+
throw new Error("No JWT token available");
|
|
194
|
+
return {
|
|
195
|
+
Authorization: `Bearer ${this.jwtToken}`
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
async fetchNonce(r) {
|
|
199
|
+
const n = `${this.serverUrl}/paywall/v1/nonce`, l = typeof r == "string" ? { purpose: r } : { path: r.path, method: r.method.toUpperCase() };
|
|
200
|
+
m().debug("[AdminAuthManager] Fetching nonce:", l);
|
|
201
|
+
const a = await v(n, {
|
|
202
|
+
method: "POST",
|
|
203
|
+
headers: { "Content-Type": "application/json" },
|
|
204
|
+
body: JSON.stringify(l)
|
|
205
|
+
});
|
|
206
|
+
if (!a.ok) {
|
|
207
|
+
const s = await a.text();
|
|
208
|
+
throw new Error(`Failed to fetch nonce: ${a.status} ${s}`);
|
|
209
|
+
}
|
|
210
|
+
return await a.json();
|
|
211
|
+
}
|
|
212
|
+
async fetchWithAuth(r, n = {}) {
|
|
213
|
+
if (this.getAuthMethod() === "none")
|
|
214
|
+
throw new Error("No admin authentication configured");
|
|
215
|
+
const a = (n.method || "GET").toUpperCase(), s = await this.createAuthHeaders({ path: r, method: a }), p = {
|
|
216
|
+
// Only set Content-Type for methods that typically carry a body
|
|
217
|
+
...a !== "GET" && a !== "HEAD" ? { "Content-Type": "application/json" } : {},
|
|
218
|
+
...n.headers || {},
|
|
219
|
+
...s
|
|
220
|
+
}, u = await v(`${this.serverUrl}${r}`, {
|
|
221
|
+
...n,
|
|
222
|
+
headers: p
|
|
223
|
+
});
|
|
224
|
+
if (!u.ok) {
|
|
225
|
+
let g = `Admin API error ${u.status}`;
|
|
226
|
+
try {
|
|
227
|
+
const h = await u.json();
|
|
228
|
+
h && typeof h.error == "string" ? g = h.error : h && typeof h.message == "string" && (g = h.message);
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
throw new Error(g);
|
|
232
|
+
}
|
|
233
|
+
return await u.json();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const t = {
|
|
237
|
+
adminProfile: "admin-profile",
|
|
238
|
+
adminSectionAccess: "admin-section-access",
|
|
239
|
+
cedrosLogin: "cedros-login",
|
|
240
|
+
cedrosPay: "cedros-pay",
|
|
241
|
+
org: "org",
|
|
242
|
+
dashboardPermissions: "dashboard-permissions"
|
|
243
|
+
};
|
|
244
|
+
function W(o = {}) {
|
|
245
|
+
return { ...o };
|
|
246
|
+
}
|
|
247
|
+
function E(o) {
|
|
248
|
+
const r = W(o.services);
|
|
249
|
+
return !(t.adminProfile in r) && o.cedrosLogin?.user && (r[t.adminProfile] = {
|
|
250
|
+
user: o.cedrosLogin.user
|
|
251
|
+
}), !(t.adminSectionAccess in r) && o.dashboardPermissions && (r[t.adminSectionAccess] = o.dashboardPermissions), !(t.cedrosLogin in r) && o.cedrosLogin && (r[t.cedrosLogin] = o.cedrosLogin), !(t.cedrosPay in r) && o.cedrosPay && (r[t.cedrosPay] = o.cedrosPay), !(t.org in r) && o.org && (r[t.org] = o.org), !(t.dashboardPermissions in r) && o.dashboardPermissions && (r[t.dashboardPermissions] = o.dashboardPermissions), r;
|
|
252
|
+
}
|
|
253
|
+
function f(o, r) {
|
|
254
|
+
return U(E(o), r);
|
|
255
|
+
}
|
|
256
|
+
function U(o, r) {
|
|
257
|
+
return o[r];
|
|
258
|
+
}
|
|
259
|
+
const c = (o) => w(async () => {
|
|
260
|
+
const l = (await o()).default;
|
|
261
|
+
return { default: ({ pluginContext: s }) => {
|
|
262
|
+
const p = s.getAccessToken(), u = s.hasPermission("cedros-pay:admin") || s.hasPermission("admin"), g = A(() => {
|
|
263
|
+
const k = new B(s.serverUrl);
|
|
264
|
+
return k.setCedrosLoginAuth(p ?? null, u), k;
|
|
265
|
+
}, [u, s.serverUrl, p]), h = {
|
|
266
|
+
serverUrl: s.serverUrl,
|
|
267
|
+
authManager: g
|
|
268
|
+
};
|
|
269
|
+
return /* @__PURE__ */ e(l, { ...h });
|
|
270
|
+
} };
|
|
271
|
+
}), _ = {
|
|
272
|
+
id: "cedros-pay",
|
|
273
|
+
name: "Cedros Pay",
|
|
274
|
+
version: "1.0.0",
|
|
275
|
+
sections: [
|
|
276
|
+
// Store group (main cedros-pay sections)
|
|
277
|
+
{ id: "transactions", label: "Transactions", icon: d.transactions, group: "Store", order: 0 },
|
|
278
|
+
{ id: "products", label: "Products", icon: d.products, group: "Store", order: 1 },
|
|
279
|
+
{ id: "subscriptions", label: "Subscriptions", icon: d.products, group: "Store", order: 2 },
|
|
280
|
+
{ id: "coupons", label: "Coupons", icon: d.coupons, group: "Store", order: 3 },
|
|
281
|
+
{ id: "refunds", label: "Refunds", icon: d.refunds, group: "Store", order: 4 },
|
|
282
|
+
{ id: "compliance", label: "Compliance", icon: d.settings, group: "Store", order: 5 },
|
|
283
|
+
// Configuration group
|
|
284
|
+
{ id: "storefront", label: "Storefront", icon: d.products, group: "Configuration", order: 10 },
|
|
285
|
+
{ id: "ai-settings", label: "Store AI", icon: d.settings, group: "Configuration", order: 11 },
|
|
286
|
+
{ id: "faqs", label: "Knowledge Base", icon: d.settings, group: "Configuration", order: 12 },
|
|
287
|
+
{ id: "payment-settings", label: "Payment Options", icon: d.wallet, group: "Configuration", order: 13 },
|
|
288
|
+
{ id: "messaging", label: "Store Messages", icon: d.settings, group: "Configuration", order: 14 },
|
|
289
|
+
{ id: "settings", label: "Store Server", icon: d.settings, group: "Configuration", order: 15 }
|
|
290
|
+
],
|
|
291
|
+
groups: [
|
|
292
|
+
{ id: "Store", label: "Store", order: 1 },
|
|
293
|
+
{ id: "Configuration", label: "Configuration", order: 2, defaultCollapsed: !0 }
|
|
294
|
+
],
|
|
295
|
+
components: {
|
|
296
|
+
products: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.ProductsSection }))),
|
|
297
|
+
subscriptions: c(() => import("./SubscriptionsSection-D8V9RBv-.mjs").then((o) => ({ default: o.SubscriptionsSection }))),
|
|
298
|
+
transactions: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.TransactionsSection }))),
|
|
299
|
+
coupons: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.CouponsSection }))),
|
|
300
|
+
refunds: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.RefundsSection }))),
|
|
301
|
+
compliance: c(() => import("./ComplianceSection-ZCr0wsvw.mjs").then((o) => ({ default: o.ComplianceSection }))),
|
|
302
|
+
storefront: c(() => import("./StorefrontSection-BK_rhrAi.mjs").then((o) => ({ default: o.StorefrontSection }))),
|
|
303
|
+
"ai-settings": c(() => import("./AISettingsSection-DtAgMsDw.mjs").then((o) => ({ default: o.AISettingsSection }))),
|
|
304
|
+
faqs: c(() => import("./FAQSection-Bv_Hdt8B.mjs").then((o) => ({ default: o.FAQSection }))),
|
|
305
|
+
"payment-settings": c(() => import("./PaymentSettingsSection-DunzBo9n.mjs").then((o) => ({ default: o.PaymentSettingsSection }))),
|
|
306
|
+
messaging: c(() => import("./MessagingSection-D_cOBfFt.mjs").then((o) => ({ default: o.MessagingSection }))),
|
|
307
|
+
settings: c(() => import("./SettingsSection-DoeNDbqd.mjs").then((o) => ({ default: o.SettingsSection })))
|
|
308
|
+
},
|
|
309
|
+
createPluginContext(o) {
|
|
310
|
+
const r = f(
|
|
311
|
+
o,
|
|
312
|
+
t.cedrosPay
|
|
313
|
+
), n = f(
|
|
314
|
+
o,
|
|
315
|
+
t.cedrosLogin
|
|
316
|
+
), l = f(o, t.org);
|
|
317
|
+
return {
|
|
318
|
+
serverUrl: r?.serverUrl || n?.serverUrl || "",
|
|
319
|
+
userId: n?.user?.id,
|
|
320
|
+
getAccessToken: () => n?.getAccessToken?.() || r?.jwtToken || null,
|
|
321
|
+
hasPermission: (s) => this.checkPermission(s, o),
|
|
322
|
+
orgId: l?.orgId,
|
|
323
|
+
pluginData: {
|
|
324
|
+
walletAddress: r?.walletAddress
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
checkPermission(o, r) {
|
|
329
|
+
const n = f(r, t.org);
|
|
330
|
+
return n?.permissions ? n.permissions.includes(o) : !1;
|
|
331
|
+
},
|
|
332
|
+
cssNamespace: "cedros-dashboard"
|
|
333
|
+
}, I = [
|
|
334
|
+
// ── Store group ──
|
|
335
|
+
{ id: "transactions", qualifiedId: "cedros-pay:transactions", label: "Transactions", group: "Store", order: 0, endpoints: ["GET /admin/transactions"] },
|
|
336
|
+
{ id: "products", qualifiedId: "cedros-pay:products", label: "Products", group: "Store", order: 1, endpoints: ["GET /admin/products", "POST /admin/products", "PUT /admin/products/{id}", "DELETE /admin/products/{id}"] },
|
|
337
|
+
{ id: "subscriptions", qualifiedId: "cedros-pay:subscriptions", label: "Subscriptions", group: "Store", order: 2, endpoints: ["GET /admin/subscriptions", "POST /admin/subscriptions", "PUT /admin/subscriptions/{id}"] },
|
|
338
|
+
{ id: "coupons", qualifiedId: "cedros-pay:coupons", label: "Coupons", group: "Store", order: 3, endpoints: ["GET /admin/coupons", "POST /admin/coupons", "PUT /admin/coupons/{id}", "DELETE /admin/coupons/{id}"] },
|
|
339
|
+
{ id: "refunds", qualifiedId: "cedros-pay:refunds", label: "Refunds", group: "Store", order: 4, endpoints: ["GET /admin/refunds", "POST /admin/refunds/{id}/approve", "POST /admin/refunds/{id}/deny"] },
|
|
340
|
+
// ── Configuration group ──
|
|
341
|
+
{ id: "storefront", qualifiedId: "cedros-pay:storefront", label: "Storefront", group: "Configuration", order: 10, endpoints: ["GET /admin/config/shop", "PUT /admin/config/shop"] },
|
|
342
|
+
{ id: "ai-settings", qualifiedId: "cedros-pay:ai-settings", label: "Store AI", group: "Configuration", order: 11, endpoints: ["GET /admin/config/ai", "PUT /admin/config/ai/api-key", "PUT /admin/config/ai/assignment", "PUT /admin/config/ai/prompt"] },
|
|
343
|
+
{ id: "faqs", qualifiedId: "cedros-pay:faqs", label: "Knowledge Base", group: "Configuration", order: 12, endpoints: ["GET /admin/faqs", "POST /admin/faqs", "PUT /admin/faqs/{id}", "DELETE /admin/faqs/{id}"] },
|
|
344
|
+
{ id: "payment-settings", qualifiedId: "cedros-pay:payment-settings", label: "Payment Options", group: "Configuration", order: 13, endpoints: ["GET /admin/config/stripe", "PUT /admin/config/stripe", "GET /admin/config/x402", "PUT /admin/config/x402", "GET /admin/config/cedros_login", "PUT /admin/config/cedros_login"] },
|
|
345
|
+
{ id: "messaging", qualifiedId: "cedros-pay:messaging", label: "Store Messages", group: "Configuration", order: 14, endpoints: ["GET /admin/config/messaging", "PUT /admin/config/messaging"] },
|
|
346
|
+
{ id: "settings", qualifiedId: "cedros-pay:settings", label: "Store Server", group: "Configuration", order: 15, endpoints: ["GET /admin/config/server", "PUT /admin/config/server"] }
|
|
347
|
+
], R = I.map((o) => o.qualifiedId), N = [
|
|
348
|
+
{ id: "Store", label: "Store", order: 1, defaultCollapsed: !1 },
|
|
349
|
+
{ id: "Configuration", label: "Configuration", order: 2, defaultCollapsed: !0 }
|
|
350
|
+
];
|
|
351
|
+
export {
|
|
352
|
+
B as A,
|
|
353
|
+
N as C,
|
|
354
|
+
V as I,
|
|
355
|
+
I as a,
|
|
356
|
+
R as b,
|
|
357
|
+
D as c,
|
|
358
|
+
_ as d
|
|
359
|
+
};
|