@cedros/pay-react 1.1.18 → 1.1.20
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-CD9IRyR1.mjs → AISettingsSection-BH-RXvk1.mjs} +10 -10
- package/dist/{AISettingsSection-C-thWh51.js → AISettingsSection-f5K0nUoQ.js} +1 -1
- package/dist/{AutosaveIndicator-DxemlKnX.js → AutosaveIndicator-CpTVtJIz.js} +1 -1
- package/dist/{AutosaveIndicator-G2CRN8hH.mjs → AutosaveIndicator-DTOaopUP.mjs} +1 -1
- package/dist/{CedrosContext-BnJ2Cf7R.mjs → CedrosContext-BE6P5PQ0.mjs} +241 -245
- package/dist/{CedrosContext-C26DlvLF.js → CedrosContext-D-lnoEkR.js} +3 -3
- package/dist/{CryptoButton-BdOtL7w-.mjs → CryptoButton-CksMkZjL.mjs} +48 -48
- package/dist/CryptoButton-Dy-g3bR0.js +1 -0
- package/dist/{FAQSection-CyYK9OAN.mjs → FAQSection-BO7ZfQMN.mjs} +4 -4
- package/dist/{FAQSection-_pm1ekTe.js → FAQSection-CVJ5w6cB.js} +1 -1
- package/dist/{MessagingSection-BHzf1Mhu.js → MessagingSection-CRFtSoE8.js} +1 -1
- package/dist/{MessagingSection-DO2yPTvs.mjs → MessagingSection-CmFYFdaw.mjs} +5 -5
- package/dist/{PaymentSettingsSection-DpENgoca.js → PaymentSettingsSection-BKDiep-C.js} +1 -1
- package/dist/{PaymentSettingsSection--Aqlne1F.mjs → PaymentSettingsSection-VDcgpOkp.mjs} +1 -1
- package/dist/{SettingsSection-CGKKGXWz.mjs → SettingsSection-B0TpaIOG.mjs} +1 -1
- package/dist/{SettingsSection-DNoODw7i.js → SettingsSection-DSlW47o4.js} +1 -1
- package/dist/SingleCategorySettings-BTXR7zex.js +3 -0
- package/dist/{SingleCategorySettings-8DCtLcow.mjs → SingleCategorySettings-Cwlehl0u.mjs} +62 -69
- package/dist/{StorefrontSection-Mzr1H51w.mjs → StorefrontSection-BAY9V1j6.mjs} +8 -8
- package/dist/{StorefrontSection-BEOMtSAg.js → StorefrontSection-DfN5yxkV.js} +1 -1
- package/dist/{SubscriptionsSection-4b29i-41.js → SubscriptionsSection-BboudRYv.js} +1 -1
- package/dist/{SubscriptionsSection-Dy1e15fe.mjs → SubscriptionsSection-D_RKCILr.mjs} +6 -6
- package/dist/{WalletManager-HXXyARQ7.mjs → WalletManager-D78miaJ2.mjs} +1 -1
- package/dist/{WalletManager-D6BYTwXn.js → WalletManager-QcfgQmap.js} +1 -1
- package/dist/crypto-only.d.ts +2 -23
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +64 -63
- package/dist/{index-bbSf3B7-.mjs → index-75RhiLDq.mjs} +7192 -9782
- package/dist/index-B5ck27xb.js +84 -0
- package/dist/index.d.ts +2 -45
- package/dist/index.js +1 -1
- package/dist/index.mjs +64 -63
- package/dist/pay-react.css +1 -1
- package/dist/sections-BCdzdqlG.js +1 -0
- package/dist/sections-BIBMX6KS.mjs +8 -0
- package/dist/src/admin/index.d.ts.map +1 -0
- package/dist/src/admin/plugin.d.ts.map +1 -0
- package/dist/src/admin/types.d.ts.map +1 -0
- package/dist/src/components/CedrosPay.d.ts.map +1 -0
- package/dist/src/components/CreditsButton.d.ts.map +1 -0
- package/dist/src/components/CreditsSubscribeButton.d.ts.map +1 -0
- package/dist/src/components/CryptoButton.d.ts.map +1 -0
- package/dist/src/components/CryptoSubscribeButton.d.ts.map +1 -0
- package/dist/src/components/PaymentModal.d.ts.map +1 -0
- package/dist/src/components/ProductPrice.d.ts.map +1 -0
- package/dist/src/components/PurchaseButton.d.ts.map +1 -0
- package/dist/src/components/StripeButton.d.ts.map +1 -0
- package/dist/src/components/SubscribeButton.d.ts.map +1 -0
- package/dist/src/components/SubscriptionManagementPanel.d.ts.map +1 -0
- package/dist/src/components/admin/AISettingsSection.d.ts.map +1 -0
- package/dist/src/components/admin/AdminAuthManager.d.ts.map +1 -0
- package/dist/src/components/admin/AutosaveIndicator.d.ts.map +1 -0
- package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -0
- package/dist/src/components/admin/ConfigEditor.d.ts.map +1 -0
- package/dist/src/components/admin/CouponsSection.d.ts.map +1 -0
- package/dist/src/components/admin/Dropdown.d.ts.map +1 -0
- package/dist/src/components/admin/ErrorBanner.d.ts.map +1 -0
- package/dist/src/components/admin/FAQSection.d.ts.map +1 -0
- package/dist/src/components/admin/MessagingSection.d.ts.map +1 -0
- package/dist/src/components/admin/OverviewSection.d.ts.map +1 -0
- package/dist/src/components/admin/PaymentSettingsSection.d.ts.map +1 -0
- package/dist/src/components/admin/ProductVariationsEditor.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -0
- package/dist/src/components/admin/RefundsSection.d.ts.map +1 -0
- package/dist/src/components/admin/SecretArrayEditor.d.ts.map +1 -0
- package/dist/src/components/admin/SettingsSection.d.ts.map +1 -0
- package/dist/src/components/admin/SingleCategorySettings.d.ts.map +1 -0
- package/dist/src/components/admin/StatsBar.d.ts.map +1 -0
- package/dist/src/components/admin/StorefrontSection.d.ts.map +1 -0
- package/dist/src/components/admin/SubscriptionsSection.d.ts.map +1 -0
- package/dist/src/components/admin/Toggle.d.ts.map +1 -0
- package/dist/{components → src/components}/admin/TokenMintSelector.d.ts +1 -1
- package/dist/src/components/admin/TokenMintSelector.d.ts.map +1 -0
- package/dist/src/components/admin/TransactionsSection.d.ts.map +1 -0
- package/dist/src/components/admin/VariantInventoryGrid.d.ts.map +1 -0
- package/dist/src/components/admin/VariationTypeEditor.d.ts.map +1 -0
- package/dist/src/components/admin/configApi.d.ts.map +1 -0
- package/dist/src/components/admin/icons.d.ts.map +1 -0
- package/dist/{components → src/components}/admin/index.d.ts +1 -1
- package/dist/src/components/admin/index.d.ts.map +1 -0
- package/dist/src/components/admin/sections-more.d.ts.map +1 -0
- package/dist/src/components/admin/sections.d.ts.map +1 -0
- package/dist/src/components/admin/types.d.ts.map +1 -0
- package/dist/{components → src/components}/admin/useAdminAuth.d.ts +11 -23
- package/dist/src/components/admin/useAdminAuth.d.ts.map +1 -0
- package/dist/src/components/admin/useAutosave.d.ts.map +1 -0
- package/dist/src/components/admin/useProductVariations.d.ts.map +1 -0
- package/dist/src/components/subscriptionPanelStyles.d.ts.map +1 -0
- package/dist/src/context/CedrosContext.d.ts.map +1 -0
- package/dist/src/context/ThemeContext.d.ts.map +1 -0
- package/dist/src/context/index.d.ts.map +1 -0
- package/dist/src/crypto-only.d.ts +23 -0
- package/dist/src/crypto-only.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/cartReducer.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/cartServerMerge.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/checkoutReturn.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/checkoutSchema.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/inventoryHooks.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/mockAdapter.test.d.ts.map +1 -0
- package/dist/src/ecommerce/__tests__/storage.test.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.test.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/CartLineItem.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/CartPageContent.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/CartPanel.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/CartSidebar.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/CartSummary.d.ts.map +1 -0
- package/dist/src/ecommerce/components/cart/PromoCodeInput.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/Breadcrumbs.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/CategoryNav.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/FilterPanel.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/Price.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/ProductCard.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/ProductGallery.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/ProductGrid.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/QuantitySelector.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/QuickViewDialog.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/SearchInput.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/VariantSelector.d.ts.map +1 -0
- package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/AddressForm.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutLayout.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/OrderReview.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/PaymentStep.d.ts.map +1 -0
- package/dist/src/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +1 -0
- package/dist/src/ecommerce/components/faq/FAQItem.d.ts.map +1 -0
- package/dist/src/ecommerce/components/faq/FAQItem.test.d.ts.map +1 -0
- package/dist/src/ecommerce/components/faq/FAQList.d.ts.map +1 -0
- package/dist/src/ecommerce/components/faq/index.d.ts.map +1 -0
- package/dist/src/ecommerce/components/general/EmptyState.d.ts.map +1 -0
- package/dist/src/ecommerce/components/general/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/ecommerce/components/general/ErrorState.d.ts.map +1 -0
- package/dist/src/ecommerce/components/general/toast.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/OrderCard.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/OrderDetails.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/OrderList.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/accordion.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/badge.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/button.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/card.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/input.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/label.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/select.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/separator.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/sheet.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/skeleton.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/ecommerce/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/ecommerce/config/context.d.ts.map +1 -0
- package/dist/src/ecommerce/config/types.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/checkoutReturn.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useAIRelatedProducts.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useCartInventory.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useCatalogUrlState.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useCategories.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useHoldExpiry.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useInventoryVerification.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useOrders.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useProduct.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useProducts.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useShippingMethods.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useStorefrontSettings.d.ts.map +1 -0
- package/dist/src/ecommerce/hooks/useSubscriptionData.d.ts.map +1 -0
- package/dist/src/ecommerce/index.d.ts.map +1 -0
- package/dist/src/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +1 -0
- package/dist/src/ecommerce/state/cart/CartProvider.d.ts.map +1 -0
- package/dist/src/ecommerce/state/cart/cartReducer.d.ts.map +1 -0
- package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -0
- package/dist/src/ecommerce/state/checkout/useCheckout.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/CartTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/CategoryTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/CheckoutTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/ProductTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/ReceiptTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/ShopTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/templates/SubscriptionTemplate.d.ts.map +1 -0
- package/dist/src/ecommerce/testing/adapterContract.d.ts.map +1 -0
- package/dist/src/ecommerce/types.d.ts.map +1 -0
- package/dist/src/ecommerce/utils/cartCheckoutRequirements.d.ts.map +1 -0
- package/dist/src/ecommerce/utils/cartItemMetadata.d.ts.map +1 -0
- package/dist/src/ecommerce/utils/cn.d.ts.map +1 -0
- package/dist/src/ecommerce/utils/money.d.ts.map +1 -0
- package/dist/src/ecommerce/utils/storage.d.ts.map +1 -0
- package/dist/src/hooks/useCreditsPayment.d.ts.map +1 -0
- package/dist/src/hooks/useCreditsSubscription.d.ts.map +1 -0
- package/dist/src/hooks/useCryptoSubscription.d.ts.map +1 -0
- package/dist/src/hooks/usePaymentMode.d.ts.map +1 -0
- package/dist/src/hooks/useRefundVerification.d.ts.map +1 -0
- package/dist/src/hooks/useStripeCheckout.d.ts.map +1 -0
- package/dist/src/hooks/useSubscription.d.ts.map +1 -0
- package/dist/src/hooks/useSubscriptionManagement.d.ts.map +1 -0
- package/dist/src/hooks/useX402Payment.d.ts.map +1 -0
- package/dist/src/i18n/index.d.ts.map +1 -0
- package/dist/src/i18n/useTranslation.d.ts.map +1 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/managers/CreditsManager.d.ts.map +1 -0
- package/dist/src/managers/ManagerCache.d.ts.map +1 -0
- package/dist/src/managers/RouteDiscoveryManager.d.ts +6 -0
- package/dist/src/managers/RouteDiscoveryManager.d.ts.map +1 -0
- package/dist/src/managers/StripeManager.d.ts.map +1 -0
- package/dist/src/managers/SubscriptionChangeManager.d.ts.map +1 -0
- package/dist/src/managers/SubscriptionManager.d.ts.map +1 -0
- package/dist/src/managers/WalletManager.d.ts.map +1 -0
- package/dist/src/managers/X402Manager.d.ts.map +1 -0
- package/dist/src/stripe-only.d.ts +49 -0
- package/dist/src/stripe-only.d.ts.map +1 -0
- package/dist/src/telemetry.d.ts +27 -0
- package/dist/src/telemetry.d.ts.map +1 -0
- package/dist/src/testing/__tests__/providers.test.d.ts.map +1 -0
- package/dist/src/testing/helpers.d.ts.map +1 -0
- package/dist/src/testing/index.d.ts +12 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/mocks.d.ts.map +1 -0
- package/dist/src/testing/providers.d.ts.map +1 -0
- package/dist/src/types/componentOptions.d.ts.map +1 -0
- package/dist/src/types/errors.d.ts.map +1 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/subscription.d.ts.map +1 -0
- package/dist/src/utils/__tests__/couponHelpers.test.d.ts.map +1 -0
- package/dist/src/utils/__tests__/cspHelper.test.d.ts.map +1 -0
- package/dist/src/utils/__tests__/fetchWithTimeout.test.d.ts.map +1 -0
- package/dist/src/utils/cartHelpers.d.ts.map +1 -0
- package/dist/src/utils/circuitBreaker.d.ts.map +1 -0
- package/dist/src/utils/couponHelpers.d.ts.map +1 -0
- package/dist/src/utils/cspHelper.d.ts.map +1 -0
- package/dist/src/utils/csvHelpers.d.ts.map +1 -0
- package/dist/src/utils/csvHelpers.test.d.ts.map +1 -0
- package/dist/src/utils/dateHelpers.d.ts.map +1 -0
- package/dist/src/utils/deprecation.d.ts.map +1 -0
- package/dist/src/utils/errorHandling.d.ts.map +1 -0
- package/dist/src/utils/errorMessages.d.ts.map +1 -0
- package/dist/src/utils/errorParser.d.ts.map +1 -0
- package/dist/src/utils/eventEmitter.d.ts.map +1 -0
- package/dist/src/utils/exponentialBackoff.d.ts.map +1 -0
- package/dist/src/utils/fetchWithTimeout.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/modalStyles.d.ts.map +1 -0
- package/dist/src/utils/rateLimiter.d.ts.map +1 -0
- package/dist/src/utils/requestDeduplication.d.ts.map +1 -0
- package/dist/src/utils/securityValidation.d.ts.map +1 -0
- package/dist/src/utils/solanaCheck.d.ts.map +1 -0
- package/dist/src/utils/telemetry.d.ts.map +1 -0
- package/dist/src/utils/tokenMintValidator.d.ts.map +1 -0
- package/dist/src/utils/uuid.d.ts.map +1 -0
- package/dist/src/utils/validateConfig.d.ts.map +1 -0
- package/dist/src/utils/walletDetection.d.ts.map +1 -0
- package/dist/src/utils/walletPool.d.ts.map +1 -0
- package/dist/stripe-only.d.ts +2 -14
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +59 -62
- package/dist/styles--eKKnfdj.mjs +2578 -0
- package/dist/styles-BWrLnaUW.js +1 -0
- package/dist/telemetry.d.ts +2 -27
- package/dist/testing/index.d.ts +2 -12
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/{walletPool-DjA7J3a9.js → walletPool-BqNfOhB0.js} +1 -1
- package/dist/{walletPool-BV_z1lEA.mjs → walletPool-DShNjCQ6.mjs} +1 -1
- package/package.json +8 -3
- package/dist/CryptoButton-N8kRfNDO.js +0 -1
- package/dist/SingleCategorySettings-NLBYxM0O.js +0 -3
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/plugin.d.ts.map +0 -1
- package/dist/admin/types.d.ts.map +0 -1
- package/dist/components/CedrosPay.d.ts.map +0 -1
- package/dist/components/CreditsButton.d.ts.map +0 -1
- package/dist/components/CreditsSubscribeButton.d.ts.map +0 -1
- package/dist/components/CryptoButton.d.ts.map +0 -1
- package/dist/components/CryptoSubscribeButton.d.ts.map +0 -1
- package/dist/components/PaymentModal.d.ts.map +0 -1
- package/dist/components/ProductPrice.d.ts.map +0 -1
- package/dist/components/PurchaseButton.d.ts.map +0 -1
- package/dist/components/StripeButton.d.ts.map +0 -1
- package/dist/components/SubscribeButton.d.ts.map +0 -1
- package/dist/components/SubscriptionManagementPanel.d.ts.map +0 -1
- package/dist/components/admin/AISettingsSection.d.ts.map +0 -1
- package/dist/components/admin/AdminAuthManager.d.ts.map +0 -1
- package/dist/components/admin/AutosaveIndicator.d.ts.map +0 -1
- package/dist/components/admin/CedrosPayAdminDashboard.d.ts.map +0 -1
- package/dist/components/admin/ConfigEditor.d.ts.map +0 -1
- package/dist/components/admin/CouponsSection.d.ts.map +0 -1
- package/dist/components/admin/Dropdown.d.ts.map +0 -1
- package/dist/components/admin/ErrorBanner.d.ts.map +0 -1
- package/dist/components/admin/FAQSection.d.ts.map +0 -1
- package/dist/components/admin/MessagingSection.d.ts.map +0 -1
- package/dist/components/admin/OverviewSection.d.ts.map +0 -1
- package/dist/components/admin/PaymentSettingsSection.d.ts.map +0 -1
- package/dist/components/admin/ProductVariationsEditor.d.ts.map +0 -1
- package/dist/components/admin/ProductsSection.d.ts.map +0 -1
- package/dist/components/admin/RefundsSection.d.ts.map +0 -1
- package/dist/components/admin/SecretArrayEditor.d.ts.map +0 -1
- package/dist/components/admin/SettingsSection.d.ts.map +0 -1
- package/dist/components/admin/SingleCategorySettings.d.ts.map +0 -1
- package/dist/components/admin/StatsBar.d.ts.map +0 -1
- package/dist/components/admin/StorefrontSection.d.ts.map +0 -1
- package/dist/components/admin/SubscriptionsSection.d.ts.map +0 -1
- package/dist/components/admin/Toggle.d.ts.map +0 -1
- package/dist/components/admin/TokenMintSelector.d.ts.map +0 -1
- package/dist/components/admin/TransactionsSection.d.ts.map +0 -1
- package/dist/components/admin/VariantInventoryGrid.d.ts.map +0 -1
- package/dist/components/admin/VariationTypeEditor.d.ts.map +0 -1
- package/dist/components/admin/configApi.d.ts.map +0 -1
- package/dist/components/admin/icons.d.ts.map +0 -1
- package/dist/components/admin/index.d.ts.map +0 -1
- package/dist/components/admin/sections-more.d.ts.map +0 -1
- package/dist/components/admin/sections.d.ts.map +0 -1
- package/dist/components/admin/types.d.ts.map +0 -1
- package/dist/components/admin/useAdminAuth.d.ts.map +0 -1
- package/dist/components/admin/useAutosave.d.ts.map +0 -1
- package/dist/components/admin/useProductVariations.d.ts.map +0 -1
- package/dist/components/subscriptionPanelStyles.d.ts.map +0 -1
- package/dist/context/CedrosContext.d.ts.map +0 -1
- package/dist/context/ThemeContext.d.ts.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/crypto-only.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/cartReducer.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/inventoryHooks.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/mockAdapter.test.d.ts.map +0 -1
- package/dist/ecommerce/__tests__/storage.test.d.ts.map +0 -1
- package/dist/ecommerce/adapters/CommerceAdapter.d.ts.map +0 -1
- package/dist/ecommerce/adapters/mock/mockAdapter.d.ts.map +0 -1
- package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +0 -1
- package/dist/ecommerce/adapters/paywall/paywallAdapter.test.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/CartLineItem.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/CartPageContent.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/CartPanel.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/CartSidebar.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/CartSummary.d.ts.map +0 -1
- package/dist/ecommerce/components/cart/PromoCodeInput.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/CategoryNav.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/FilterPanel.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/Price.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/ProductCard.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/ProductGallery.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/ProductGrid.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/QuantitySelector.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/SearchInput.d.ts.map +0 -1
- package/dist/ecommerce/components/catalog/VariantSelector.d.ts.map +0 -1
- package/dist/ecommerce/components/chat/ShopChatPanel.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/AddressForm.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/CheckoutForm.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/OrderReview.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/PaymentStep.d.ts.map +0 -1
- package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +0 -1
- package/dist/ecommerce/components/faq/FAQItem.d.ts.map +0 -1
- package/dist/ecommerce/components/faq/FAQItem.test.d.ts.map +0 -1
- package/dist/ecommerce/components/faq/FAQList.d.ts.map +0 -1
- package/dist/ecommerce/components/faq/index.d.ts.map +0 -1
- package/dist/ecommerce/components/general/EmptyState.d.ts.map +0 -1
- package/dist/ecommerce/components/general/ErrorBoundary.d.ts.map +0 -1
- package/dist/ecommerce/components/general/ErrorState.d.ts.map +0 -1
- package/dist/ecommerce/components/general/toast.d.ts.map +0 -1
- package/dist/ecommerce/components/orders/OrderCard.d.ts.map +0 -1
- package/dist/ecommerce/components/orders/OrderDetails.d.ts.map +0 -1
- package/dist/ecommerce/components/orders/OrderList.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/accordion.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/badge.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/button.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/card.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/dialog.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/input.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/label.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/select.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/separator.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/sheet.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/skeleton.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/tabs.d.ts.map +0 -1
- package/dist/ecommerce/components/ui/textarea.d.ts.map +0 -1
- package/dist/ecommerce/config/context.d.ts.map +0 -1
- package/dist/ecommerce/config/types.d.ts.map +0 -1
- package/dist/ecommerce/hooks/checkoutReturn.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useCartInventory.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useCatalogUrlState.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useCategories.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useHoldExpiry.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useInventoryVerification.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useOrders.d.ts.map +0 -1
- package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useProduct.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useProducts.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useShippingMethods.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useStorefrontSettings.d.ts.map +0 -1
- package/dist/ecommerce/hooks/useSubscriptionData.d.ts.map +0 -1
- package/dist/ecommerce/index.d.ts.map +0 -1
- package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +0 -1
- package/dist/ecommerce/state/cart/CartProvider.d.ts.map +0 -1
- package/dist/ecommerce/state/cart/cartReducer.d.ts.map +0 -1
- package/dist/ecommerce/state/checkout/checkoutSchema.d.ts.map +0 -1
- package/dist/ecommerce/state/checkout/useCheckout.d.ts.map +0 -1
- package/dist/ecommerce/templates/CartTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/CategoryTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/CheckoutTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/ProductTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/ReceiptTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/ShopTemplate.d.ts.map +0 -1
- package/dist/ecommerce/templates/SubscriptionTemplate.d.ts.map +0 -1
- package/dist/ecommerce/testing/adapterContract.d.ts.map +0 -1
- package/dist/ecommerce/types.d.ts.map +0 -1
- package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts.map +0 -1
- package/dist/ecommerce/utils/cartItemMetadata.d.ts.map +0 -1
- package/dist/ecommerce/utils/cn.d.ts.map +0 -1
- package/dist/ecommerce/utils/money.d.ts.map +0 -1
- package/dist/ecommerce/utils/storage.d.ts.map +0 -1
- package/dist/hooks/useCreditsPayment.d.ts.map +0 -1
- package/dist/hooks/useCreditsSubscription.d.ts.map +0 -1
- package/dist/hooks/useCryptoSubscription.d.ts.map +0 -1
- package/dist/hooks/usePaymentMode.d.ts.map +0 -1
- package/dist/hooks/useRefundVerification.d.ts.map +0 -1
- package/dist/hooks/useStripeCheckout.d.ts.map +0 -1
- package/dist/hooks/useSubscription.d.ts.map +0 -1
- package/dist/hooks/useSubscriptionManagement.d.ts.map +0 -1
- package/dist/hooks/useX402Payment.d.ts.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/useTranslation.d.ts.map +0 -1
- package/dist/index-B-0trqeD.js +0 -84
- package/dist/index.d.ts.map +0 -1
- package/dist/managers/CreditsManager.d.ts.map +0 -1
- package/dist/managers/ManagerCache.d.ts.map +0 -1
- package/dist/managers/RouteDiscoveryManager.d.ts +0 -75
- package/dist/managers/RouteDiscoveryManager.d.ts.map +0 -1
- package/dist/managers/StripeManager.d.ts.map +0 -1
- package/dist/managers/SubscriptionChangeManager.d.ts.map +0 -1
- package/dist/managers/SubscriptionManager.d.ts.map +0 -1
- package/dist/managers/WalletManager.d.ts.map +0 -1
- package/dist/managers/X402Manager.d.ts.map +0 -1
- package/dist/sections-CKwGmrzV.js +0 -1
- package/dist/sections-DpEdFL1B.mjs +0 -10
- package/dist/stripe-only.d.ts.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/testing/__tests__/providers.test.d.ts.map +0 -1
- package/dist/testing/helpers.d.ts.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/mocks.d.ts.map +0 -1
- package/dist/testing/providers.d.ts.map +0 -1
- package/dist/types/componentOptions.d.ts.map +0 -1
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/subscription.d.ts.map +0 -1
- package/dist/utils/__tests__/couponHelpers.test.d.ts.map +0 -1
- package/dist/utils/__tests__/cspHelper.test.d.ts.map +0 -1
- package/dist/utils/__tests__/fetchWithTimeout.test.d.ts.map +0 -1
- package/dist/utils/cartHelpers.d.ts.map +0 -1
- package/dist/utils/circuitBreaker.d.ts.map +0 -1
- package/dist/utils/couponHelpers.d.ts.map +0 -1
- package/dist/utils/cspHelper.d.ts.map +0 -1
- package/dist/utils/csvHelpers.d.ts.map +0 -1
- package/dist/utils/csvHelpers.test.d.ts.map +0 -1
- package/dist/utils/dateHelpers.d.ts.map +0 -1
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/errorHandling.d.ts.map +0 -1
- package/dist/utils/errorMessages.d.ts.map +0 -1
- package/dist/utils/errorParser.d.ts.map +0 -1
- package/dist/utils/eventEmitter.d.ts.map +0 -1
- package/dist/utils/exponentialBackoff.d.ts.map +0 -1
- package/dist/utils/fetchWithTimeout.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/modalStyles.d.ts.map +0 -1
- package/dist/utils/rateLimiter.d.ts.map +0 -1
- package/dist/utils/requestDeduplication.d.ts.map +0 -1
- package/dist/utils/securityValidation.d.ts.map +0 -1
- package/dist/utils/solanaCheck.d.ts.map +0 -1
- package/dist/utils/telemetry.d.ts.map +0 -1
- package/dist/utils/tokenMintValidator.d.ts.map +0 -1
- package/dist/utils/uuid.d.ts.map +0 -1
- package/dist/utils/validateConfig.d.ts.map +0 -1
- package/dist/utils/walletDetection.d.ts.map +0 -1
- package/dist/utils/walletPool.d.ts.map +0 -1
- /package/dist/{admin → src/admin}/index.d.ts +0 -0
- /package/dist/{admin → src/admin}/plugin.d.ts +0 -0
- /package/dist/{admin → src/admin}/types.d.ts +0 -0
- /package/dist/{components → src/components}/CedrosPay.d.ts +0 -0
- /package/dist/{components → src/components}/CreditsButton.d.ts +0 -0
- /package/dist/{components → src/components}/CreditsSubscribeButton.d.ts +0 -0
- /package/dist/{components → src/components}/CryptoButton.d.ts +0 -0
- /package/dist/{components → src/components}/CryptoSubscribeButton.d.ts +0 -0
- /package/dist/{components → src/components}/PaymentModal.d.ts +0 -0
- /package/dist/{components → src/components}/ProductPrice.d.ts +0 -0
- /package/dist/{components → src/components}/PurchaseButton.d.ts +0 -0
- /package/dist/{components → src/components}/StripeButton.d.ts +0 -0
- /package/dist/{components → src/components}/SubscribeButton.d.ts +0 -0
- /package/dist/{components → src/components}/SubscriptionManagementPanel.d.ts +0 -0
- /package/dist/{components → src/components}/admin/AISettingsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/AdminAuthManager.d.ts +0 -0
- /package/dist/{components → src/components}/admin/AutosaveIndicator.d.ts +0 -0
- /package/dist/{components → src/components}/admin/CedrosPayAdminDashboard.d.ts +0 -0
- /package/dist/{components → src/components}/admin/ConfigEditor.d.ts +0 -0
- /package/dist/{components → src/components}/admin/CouponsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/Dropdown.d.ts +0 -0
- /package/dist/{components → src/components}/admin/ErrorBanner.d.ts +0 -0
- /package/dist/{components → src/components}/admin/FAQSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/MessagingSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/OverviewSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/PaymentSettingsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/ProductVariationsEditor.d.ts +0 -0
- /package/dist/{components → src/components}/admin/ProductsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/RefundsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/SecretArrayEditor.d.ts +0 -0
- /package/dist/{components → src/components}/admin/SettingsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/SingleCategorySettings.d.ts +0 -0
- /package/dist/{components → src/components}/admin/StatsBar.d.ts +0 -0
- /package/dist/{components → src/components}/admin/StorefrontSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/SubscriptionsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/Toggle.d.ts +0 -0
- /package/dist/{components → src/components}/admin/TransactionsSection.d.ts +0 -0
- /package/dist/{components → src/components}/admin/VariantInventoryGrid.d.ts +0 -0
- /package/dist/{components → src/components}/admin/VariationTypeEditor.d.ts +0 -0
- /package/dist/{components → src/components}/admin/configApi.d.ts +0 -0
- /package/dist/{components → src/components}/admin/icons.d.ts +0 -0
- /package/dist/{components → src/components}/admin/sections-more.d.ts +0 -0
- /package/dist/{components → src/components}/admin/sections.d.ts +0 -0
- /package/dist/{components → src/components}/admin/types.d.ts +0 -0
- /package/dist/{components → src/components}/admin/useAutosave.d.ts +0 -0
- /package/dist/{components → src/components}/admin/useProductVariations.d.ts +0 -0
- /package/dist/{components → src/components}/subscriptionPanelStyles.d.ts +0 -0
- /package/dist/{context → src/context}/CedrosContext.d.ts +0 -0
- /package/dist/{context → src/context}/ThemeContext.d.ts +0 -0
- /package/dist/{context → src/context}/index.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/cartCheckoutRequirements.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/cartProviderPersistence.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/cartReducer.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/cartServerMerge.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutPaymentMethods.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutReturn.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutSchema.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/inventoryHooks.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/mockAdapter.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/__tests__/storage.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/adapters/CommerceAdapter.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/adapters/mock/mockAdapter.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/adapters/paywall/paywallAdapter.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/adapters/paywall/paywallAdapter.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/CartLineItem.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/CartPageContent.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/CartPanel.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/CartSidebar.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/CartSummary.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/cart/PromoCodeInput.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/Breadcrumbs.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/CategoryNav.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/FilterPanel.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/Price.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductCard.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductGallery.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductGrid.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/QuantitySelector.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/QuickViewDialog.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/SearchInput.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/catalog/VariantSelector.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/chat/ShopChatPanel.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/AddressForm.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutCancelPage.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutForm.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutLayout.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutReceipt.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutSuccessPage.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/InventoryVerificationDialog.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/OrderReview.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/PaymentStep.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/checkout/ShippingMethodSelector.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQItem.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQItem.test.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQList.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/faq/index.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/general/EmptyState.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/general/ErrorBoundary.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/general/ErrorState.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/general/toast.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderCard.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderDetails.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderList.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/accordion.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/badge.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/button.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/card.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/dialog.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/input.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/label.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/select.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/separator.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/sheet.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/skeleton.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/tabs.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/components/ui/textarea.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/config/context.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/config/types.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/checkoutReturn.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useAIRelatedProducts.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useCartInventory.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useCatalogUrlState.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useCategories.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useCheckoutResultFromUrl.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useHoldExpiry.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useInventoryVerification.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useOrders.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/usePaymentMethodsConfig.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useProduct.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useProducts.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useShippingMethods.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useStorefrontSettings.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/hooks/useSubscriptionData.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/index.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/state/cart/CartProvider.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/state/cart/cartReducer.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/state/checkout/checkoutSchema.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/state/checkout/useCheckout.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/CartTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/CategoryTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/CheckoutTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/ProductTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/PurchaseHistoryTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/ReceiptTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/ShopTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/templates/SubscriptionTemplate.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/testing/adapterContract.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/types.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/utils/cartCheckoutRequirements.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/utils/cartItemMetadata.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/utils/cn.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/utils/money.d.ts +0 -0
- /package/dist/{ecommerce → src/ecommerce}/utils/storage.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCreditsPayment.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCreditsSubscription.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCryptoSubscription.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/usePaymentMode.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useRefundVerification.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useStripeCheckout.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useSubscription.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useSubscriptionManagement.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useX402Payment.d.ts +0 -0
- /package/dist/{i18n → src/i18n}/index.d.ts +0 -0
- /package/dist/{i18n → src/i18n}/useTranslation.d.ts +0 -0
- /package/dist/{managers → src/managers}/CreditsManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/ManagerCache.d.ts +0 -0
- /package/dist/{managers → src/managers}/StripeManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/SubscriptionChangeManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/SubscriptionManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/WalletManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/X402Manager.d.ts +0 -0
- /package/dist/{testing → src/testing}/__tests__/providers.test.d.ts +0 -0
- /package/dist/{testing → src/testing}/helpers.d.ts +0 -0
- /package/dist/{testing → src/testing}/mocks.d.ts +0 -0
- /package/dist/{testing → src/testing}/providers.d.ts +0 -0
- /package/dist/{types → src/types}/componentOptions.d.ts +0 -0
- /package/dist/{types → src/types}/errors.d.ts +0 -0
- /package/dist/{types → src/types}/index.d.ts +0 -0
- /package/dist/{types → src/types}/subscription.d.ts +0 -0
- /package/dist/{utils → src/utils}/__tests__/couponHelpers.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/__tests__/cspHelper.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/__tests__/fetchWithTimeout.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/cartHelpers.d.ts +0 -0
- /package/dist/{utils → src/utils}/circuitBreaker.d.ts +0 -0
- /package/dist/{utils → src/utils}/couponHelpers.d.ts +0 -0
- /package/dist/{utils → src/utils}/cspHelper.d.ts +0 -0
- /package/dist/{utils → src/utils}/csvHelpers.d.ts +0 -0
- /package/dist/{utils → src/utils}/csvHelpers.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/dateHelpers.d.ts +0 -0
- /package/dist/{utils → src/utils}/deprecation.d.ts +0 -0
- /package/dist/{utils → src/utils}/errorHandling.d.ts +0 -0
- /package/dist/{utils → src/utils}/errorMessages.d.ts +0 -0
- /package/dist/{utils → src/utils}/errorParser.d.ts +0 -0
- /package/dist/{utils → src/utils}/eventEmitter.d.ts +0 -0
- /package/dist/{utils → src/utils}/exponentialBackoff.d.ts +0 -0
- /package/dist/{utils → src/utils}/fetchWithTimeout.d.ts +0 -0
- /package/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/logger.d.ts +0 -0
- /package/dist/{utils → src/utils}/modalStyles.d.ts +0 -0
- /package/dist/{utils → src/utils}/rateLimiter.d.ts +0 -0
- /package/dist/{utils → src/utils}/requestDeduplication.d.ts +0 -0
- /package/dist/{utils → src/utils}/securityValidation.d.ts +0 -0
- /package/dist/{utils → src/utils}/solanaCheck.d.ts +0 -0
- /package/dist/{utils → src/utils}/telemetry.d.ts +0 -0
- /package/dist/{utils → src/utils}/tokenMintValidator.d.ts +0 -0
- /package/dist/{utils → src/utils}/uuid.d.ts +0 -0
- /package/dist/{utils → src/utils}/validateConfig.d.ts +0 -0
- /package/dist/{utils → src/utils}/walletDetection.d.ts +0 -0
- /package/dist/{utils → src/utils}/walletPool.d.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as O, jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L, useRef as R, useCallback as P, useMemo as Y, useEffect as H } from "react";
|
|
3
3
|
import { useWallet as be } from "@solana/wallet-adapter-react";
|
|
4
4
|
import { WalletReadyState as pe } from "@solana/wallet-adapter-base";
|
|
5
5
|
import { WalletIcon as Te } from "@solana/wallet-adapter-react-ui";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
6
|
+
import { T as Ie, i as Ee, O as We, U as V, B as Re, D as fe, y as _e, A as ge, w as qe, x as we, z as Z, V as ze, W as Me } from "./styles--eKKnfdj.mjs";
|
|
7
|
+
import { u as he, m as ee, i as n, a as De } from "./CedrosContext-BE6P5PQ0.mjs";
|
|
8
|
+
function $e() {
|
|
9
9
|
const { x402Manager: g, walletManager: s } = he(), { publicKey: _, signTransaction: q } = be(), [X, d] = L({
|
|
10
10
|
status: "idle",
|
|
11
11
|
error: null,
|
|
12
12
|
transactionId: null
|
|
13
|
-
}), [I, k] = L(null), [
|
|
13
|
+
}), [I, k] = L(null), [G, x] = L(null), C = R(_);
|
|
14
14
|
C.current = _;
|
|
15
15
|
const w = R(q);
|
|
16
16
|
w.current = q;
|
|
@@ -36,7 +36,7 @@ function Fe() {
|
|
|
36
36
|
throw new Error("Invalid requirement received from server");
|
|
37
37
|
return k(l), d((i) => ({ ...i, status: "idle" })), l;
|
|
38
38
|
} catch (l) {
|
|
39
|
-
const i =
|
|
39
|
+
const i = ee(l, "Failed to fetch requirement");
|
|
40
40
|
throw d({
|
|
41
41
|
status: "error",
|
|
42
42
|
error: i,
|
|
@@ -69,7 +69,7 @@ function Fe() {
|
|
|
69
69
|
blockhash: D
|
|
70
70
|
});
|
|
71
71
|
n().debug("[useX402Payment] Submitting partial transaction");
|
|
72
|
-
const
|
|
72
|
+
const $ = await g.submitGaslessTransaction({
|
|
73
73
|
resource: l,
|
|
74
74
|
partialTx: T,
|
|
75
75
|
couponCode: i,
|
|
@@ -77,7 +77,7 @@ function Fe() {
|
|
|
77
77
|
resourceType: r,
|
|
78
78
|
requirement: o
|
|
79
79
|
});
|
|
80
|
-
return
|
|
80
|
+
return $.success && $.settlement && x($.settlement), $;
|
|
81
81
|
} else {
|
|
82
82
|
const f = await s.buildTransaction({
|
|
83
83
|
requirement: o,
|
|
@@ -132,7 +132,7 @@ function Fe() {
|
|
|
132
132
|
transactionId: null
|
|
133
133
|
}), a;
|
|
134
134
|
} catch (r) {
|
|
135
|
-
const a =
|
|
135
|
+
const a = ee(r, "Payment failed");
|
|
136
136
|
return d({
|
|
137
137
|
status: "error",
|
|
138
138
|
error: a,
|
|
@@ -156,7 +156,7 @@ function Fe() {
|
|
|
156
156
|
transactionId: null
|
|
157
157
|
});
|
|
158
158
|
try {
|
|
159
|
-
const r =
|
|
159
|
+
const r = Ie(o), a = await g.requestCartQuote({
|
|
160
160
|
items: r,
|
|
161
161
|
metadata: l,
|
|
162
162
|
couponCode: i
|
|
@@ -175,7 +175,7 @@ function Fe() {
|
|
|
175
175
|
transactionId: null
|
|
176
176
|
}), f;
|
|
177
177
|
} catch (r) {
|
|
178
|
-
const a =
|
|
178
|
+
const a = ee(r, "Cart payment failed");
|
|
179
179
|
return d({
|
|
180
180
|
status: "error",
|
|
181
181
|
error: a,
|
|
@@ -196,14 +196,14 @@ function Fe() {
|
|
|
196
196
|
return {
|
|
197
197
|
...X,
|
|
198
198
|
requirement: I,
|
|
199
|
-
settlement:
|
|
199
|
+
settlement: G,
|
|
200
200
|
fetchQuote: z,
|
|
201
201
|
processPayment: p,
|
|
202
202
|
processCartPayment: M,
|
|
203
203
|
reset: W
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Fe({
|
|
207
207
|
resource: g,
|
|
208
208
|
items: s,
|
|
209
209
|
label: _,
|
|
@@ -212,16 +212,16 @@ function $e({
|
|
|
212
212
|
onSuccess: d,
|
|
213
213
|
onError: I,
|
|
214
214
|
className: k = "",
|
|
215
|
-
testPageUrl:
|
|
215
|
+
testPageUrl: G,
|
|
216
216
|
hideMessages: x = !1,
|
|
217
217
|
metadata: C,
|
|
218
218
|
couponCode: w
|
|
219
219
|
}) {
|
|
220
|
-
const { connected: u, connecting: K, connect: E, disconnect: v, select: z, wallets: B, wallet: p, publicKey: M } = be(), { status: W, error: o, transactionId: l, processPayment: i, processCartPayment: b } =
|
|
220
|
+
const { connected: u, connecting: K, connect: E, disconnect: v, select: z, wallets: B, wallet: p, publicKey: M } = be(), { status: W, error: o, transactionId: l, processPayment: i, processCartPayment: b } = $e(), r = De(), { solanaError: a } = he(), { isCartMode: y, effectiveResource: c } = Ee(g, s), { t: f, translations: D } = We(), A = _ || f("ui.pay_with_crypto"), T = o && typeof o != "string" ? o?.code ?? null : null, $ = a && typeof a != "string" ? a?.code ?? null : null, te = (e) => {
|
|
221
221
|
if (!e || !D) return "";
|
|
222
222
|
const t = D.errors[e];
|
|
223
223
|
return t ? t.action ? `${t.message} ${t.action}` : t.message : "";
|
|
224
|
-
}, re = o ? typeof o == "string" ? o : te(T) : null, ne = a ? typeof a == "string" ? a : te(
|
|
224
|
+
}, re = o ? typeof o == "string" ? o : te(T) : null, ne = a ? typeof a == "string" ? a : te($) : null, oe = R(d), ae = R(I), se = R(i), le = R(b);
|
|
225
225
|
oe.current = d, ae.current = I, se.current = i, le.current = b;
|
|
226
226
|
const Ce = Y(
|
|
227
227
|
() => B.map((e) => `${e.adapter.name}-${e.readyState}`).join(","),
|
|
@@ -236,28 +236,28 @@ function $e({
|
|
|
236
236
|
);
|
|
237
237
|
H(() => {
|
|
238
238
|
if (W === "success" && l) {
|
|
239
|
-
const e = y && s ?
|
|
240
|
-
|
|
239
|
+
const e = y && s ? V(s) : void 0;
|
|
240
|
+
Re("crypto", l, c, e), oe.current?.(l);
|
|
241
241
|
}
|
|
242
242
|
}, [W, l, y, s, c]), H(() => {
|
|
243
243
|
if (W === "error" && o) {
|
|
244
|
-
const e = y && s ?
|
|
244
|
+
const e = y && s ? V(s) : void 0;
|
|
245
245
|
fe("crypto", o, c, e), ae.current?.(o);
|
|
246
246
|
}
|
|
247
247
|
}, [W, o, y, s, c]);
|
|
248
|
-
const ce = typeof window < "u" && window.top !== window.self, [ie,
|
|
248
|
+
const ce = typeof window < "u" && window.top !== window.self, [ie, F] = L(!1), [ue, J] = L(!1), [N, S] = L(null), j = a;
|
|
249
249
|
H(() => {
|
|
250
250
|
let e = !1;
|
|
251
251
|
return e || (async () => {
|
|
252
252
|
if (ue && p && !u && !K) {
|
|
253
|
-
n().debug("[CryptoButton] Wallet detected, attempting auto-connect:", p.adapter.name),
|
|
253
|
+
n().debug("[CryptoButton] Wallet detected, attempting auto-connect:", p.adapter.name), J(!1), we(p.adapter.name);
|
|
254
254
|
try {
|
|
255
255
|
await E(), e || n().debug("[CryptoButton] Auto-connect successful");
|
|
256
256
|
} catch (m) {
|
|
257
257
|
if (!e) {
|
|
258
258
|
n().error("[CryptoButton] Auto-connect failed:", m);
|
|
259
259
|
const U = m instanceof Error ? m.message : "Failed to connect wallet";
|
|
260
|
-
|
|
260
|
+
Z(U, p.adapter.name), S(null);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -272,10 +272,10 @@ function $e({
|
|
|
272
272
|
hasPublicKey: !!M,
|
|
273
273
|
pendingPaymentType: N?.type
|
|
274
274
|
}), u && N && M && p && e) {
|
|
275
|
-
|
|
275
|
+
_e(p.adapter.name, M.toString()), n().debug("[CryptoButton] All conditions met! Processing pending payment:", N);
|
|
276
276
|
const t = N;
|
|
277
|
-
S(null),
|
|
278
|
-
const m = t.type === "cart" && t.items ?
|
|
277
|
+
S(null), F(!1);
|
|
278
|
+
const m = t.type === "cart" && t.items ? V(t.items) : void 0;
|
|
279
279
|
ge("crypto", t.resource, m), t.type === "cart" && t.items ? (n().debug("[CryptoButton] Auto-processing cart payment"), le.current(t.items, t.metadata, t.couponCode)) : t.type === "single" && t.resource && (n().debug("[CryptoButton] Auto-processing single payment"), se.current(t.resource, t.couponCode, t.metadata));
|
|
280
280
|
}
|
|
281
281
|
return () => {
|
|
@@ -291,13 +291,13 @@ function $e({
|
|
|
291
291
|
hasItems: !!s,
|
|
292
292
|
effectiveResource: c
|
|
293
293
|
});
|
|
294
|
-
const e = y && s ?
|
|
295
|
-
if (
|
|
294
|
+
const e = y && s ? V(s) : void 0;
|
|
295
|
+
if (qe("crypto", c, e), X && X("crypto"), j) {
|
|
296
296
|
n().error("[CryptoButton] Solana dependencies missing:", j), fe("crypto", j, c, e), I && I(j);
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
if (ce) {
|
|
300
|
-
const t =
|
|
300
|
+
const t = G || window.location.href;
|
|
301
301
|
try {
|
|
302
302
|
if (new URL(t, window.location.origin).origin !== window.location.origin)
|
|
303
303
|
throw n().error("[CryptoButton] Blocked attempt to open external URL:", t), new Error("Cannot open external URLs from embedded context");
|
|
@@ -325,18 +325,18 @@ function $e({
|
|
|
325
325
|
), Q.length === 0) {
|
|
326
326
|
S(null);
|
|
327
327
|
const m = "No wallets available";
|
|
328
|
-
throw
|
|
328
|
+
throw Z(m), new Error(m);
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
F(!0);
|
|
331
331
|
}
|
|
332
332
|
} catch (m) {
|
|
333
333
|
S(null);
|
|
334
334
|
const U = m instanceof Error ? m.message : "Failed to connect wallet";
|
|
335
|
-
n().error("[CryptoButton] Connection error:", U),
|
|
335
|
+
n().error("[CryptoButton] Connection error:", U), Z(U, p?.adapter.name);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
}, [u, p, w, y, s, c, ce,
|
|
339
|
-
() =>
|
|
338
|
+
}, [u, p, w, y, s, c, ce, G, Q, E, C, b, i, j, X, I]), ye = Y(() => y && s ? `crypto-cart-${s.map((e) => e.resource).join("-")}` : `crypto-${c || "unknown"}`, [y, s, c]), Pe = Y(
|
|
339
|
+
() => ze(ye, de, {
|
|
340
340
|
cooldownMs: 200,
|
|
341
341
|
deduplicationWindowMs: 0
|
|
342
342
|
// MUST be 0 for crypto - each payment needs fresh transaction
|
|
@@ -344,12 +344,12 @@ function $e({
|
|
|
344
344
|
[ye, de]
|
|
345
345
|
), me = W === "loading", xe = q || me || K || !!j, ve = me ? f("ui.processing") : A, Se = P(async () => {
|
|
346
346
|
try {
|
|
347
|
-
|
|
347
|
+
J(!1), u && await v(), z(null), F(!0);
|
|
348
348
|
} catch (e) {
|
|
349
349
|
n().error("Failed to change wallet:", e);
|
|
350
350
|
}
|
|
351
351
|
}, [u, v, z]), ke = P((e) => {
|
|
352
|
-
n().debug("[CryptoButton] Wallet clicked:", e),
|
|
352
|
+
n().debug("[CryptoButton] Wallet clicked:", e), F(!1), z(e), J(!0), n().debug("[CryptoButton] Wallet selected, useEffect will auto-connect");
|
|
353
353
|
}, [z]), Be = P(async () => {
|
|
354
354
|
try {
|
|
355
355
|
if (await v(), S(null), typeof window < "u" && window.localStorage)
|
|
@@ -362,7 +362,7 @@ function $e({
|
|
|
362
362
|
n().error("Failed to disconnect wallet:", e);
|
|
363
363
|
}
|
|
364
364
|
}, [v]);
|
|
365
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ O("div", { className: r.unstyled ? k : `${r.className} cedros-theme__crypto-button ${k || ""}`, style: r.unstyled ? {} : r.style, children: [
|
|
366
366
|
/* @__PURE__ */ h(
|
|
367
367
|
"button",
|
|
368
368
|
{
|
|
@@ -391,9 +391,9 @@ function $e({
|
|
|
391
391
|
padding: "1rem"
|
|
392
392
|
},
|
|
393
393
|
onClick: () => {
|
|
394
|
-
|
|
394
|
+
F(!1), S(null);
|
|
395
395
|
},
|
|
396
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ O(
|
|
397
397
|
"div",
|
|
398
398
|
{
|
|
399
399
|
className: "cedros-modal-content",
|
|
@@ -408,7 +408,7 @@ function $e({
|
|
|
408
408
|
},
|
|
409
409
|
onClick: (e) => e.stopPropagation(),
|
|
410
410
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ O(
|
|
412
412
|
"div",
|
|
413
413
|
{
|
|
414
414
|
style: {
|
|
@@ -434,9 +434,9 @@ function $e({
|
|
|
434
434
|
"button",
|
|
435
435
|
{
|
|
436
436
|
onClick: () => {
|
|
437
|
-
|
|
437
|
+
F(!1), S(null);
|
|
438
438
|
},
|
|
439
|
-
style:
|
|
439
|
+
style: Me(r.tokens.surfaceText),
|
|
440
440
|
"aria-label": "Close modal",
|
|
441
441
|
type: "button",
|
|
442
442
|
children: "×"
|
|
@@ -445,7 +445,7 @@ function $e({
|
|
|
445
445
|
]
|
|
446
446
|
}
|
|
447
447
|
),
|
|
448
|
-
/* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: Q.map((e) => /* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: Q.map((e) => /* @__PURE__ */ O(
|
|
449
449
|
"button",
|
|
450
450
|
{
|
|
451
451
|
onClick: () => ke(e.adapter.name),
|
|
@@ -483,7 +483,7 @@ function $e({
|
|
|
483
483
|
)
|
|
484
484
|
}
|
|
485
485
|
),
|
|
486
|
-
u && !x && !ie && /* @__PURE__ */
|
|
486
|
+
u && !x && !ie && /* @__PURE__ */ O("div", { style: {
|
|
487
487
|
display: "flex",
|
|
488
488
|
justifyContent: "space-between",
|
|
489
489
|
marginTop: "0.5rem",
|
|
@@ -531,12 +531,12 @@ function $e({
|
|
|
531
531
|
!x && l && /* @__PURE__ */ h("div", { className: r.unstyled ? "" : "cedros-theme__success", children: f("ui.payment_successful") })
|
|
532
532
|
] });
|
|
533
533
|
}
|
|
534
|
-
const
|
|
534
|
+
const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
535
535
|
__proto__: null,
|
|
536
|
-
CryptoButton:
|
|
536
|
+
CryptoButton: Fe
|
|
537
537
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
538
538
|
export {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
Fe as C,
|
|
540
|
+
Ge as a,
|
|
541
|
+
$e as u
|
|
542
542
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),a=require("react"),ce=require("@solana/wallet-adapter-react"),le=require("@solana/wallet-adapter-base"),be=require("@solana/wallet-adapter-react-ui"),i=require("./styles-BWrLnaUW.js"),t=require("./CedrosContext-D-lnoEkR.js");function ie(){const{x402Manager:C,walletManager:l}=t.useCedrosContext(),{publicKey:W,signTransaction:j}=ce.useWallet(),[N,y]=a.useState({status:"idle",error:null,transactionId:null}),[R,L]=a.useState(null),[K,k]=a.useState(null),P=a.useRef(W);P.current=W;const h=a.useRef(j);h.current=j;const g=a.useRef(0),X=6e4,I=()=>{const o=g.current;return o>0&&Date.now()-o<X},S=a.useCallback(()=>{if(!W){const o="Wallet not connected";return y({status:"error",error:o,transactionId:null}),{valid:!1,error:o}}if(!j){const o="Wallet does not support signing";return y({status:"error",error:o,transactionId:null}),{valid:!1,error:o}}return{valid:!0}},[W,j]),q=a.useCallback(async o=>{try{y(d=>({...d,status:"loading"}));const c=await C.requestQuote({resource:o});if(!C.validateRequirement(c))throw new Error("Invalid requirement received from server");return L(c),y(d=>({...d,status:"idle"})),c}catch(c){const d=t.formatError(c,"Failed to fetch requirement");throw y({status:"error",error:d,transactionId:null}),c}},[C]),B=a.useCallback(async(o,c,d,x,n="regular")=>{const s=P.current,m=h.current;if(!s||!m)throw new Error("Wallet disconnected during payment flow");if(!!o.extra?.feePayer){t.getLogger().debug("[useX402Payment] Gasless flow enabled"),t.getLogger().debug("[useX402Payment] Building gasless transaction");const{transaction:b,blockhash:M}=await C.buildGaslessTransaction({resourceId:c,userWallet:s.toString(),feePayer:o.extra.feePayer,couponCode:d});t.getLogger().debug("[useX402Payment] Deserializing backend transaction");const A=l.deserializeTransaction(b);if(P.current?.toString()!==s.toString())throw new Error("Wallet changed during payment flow");t.getLogger().debug("[useX402Payment] Requesting partial signature");const E=await l.partiallySignTransaction({transaction:A,signTransaction:m,blockhash:M});t.getLogger().debug("[useX402Payment] Submitting partial transaction");const z=await C.submitGaslessTransaction({resource:c,partialTx:E,couponCode:d,metadata:x,resourceType:n,requirement:o});return z.success&&z.settlement&&k(z.settlement),z}else{const b=await l.buildTransaction({requirement:o,payerPublicKey:s});if(P.current?.toString()!==s.toString())throw new Error("Wallet changed during payment flow");const M=await l.signTransaction({transaction:b,signTransaction:m}),A=l.buildPaymentPayload({requirement:o,signedTx:M,payerPublicKey:s}),E=await C.submitPayment({resource:c,payload:A,couponCode:d,metadata:x,resourceType:n});return E.success&&E.settlement&&k(E.settlement),E}},[C,l]),w=a.useCallback(async(o,c,d)=>{if(I())return{success:!1,error:"Payment already in progress"};const x=S();if(!x.valid)return{success:!1,error:x.error};g.current=Date.now(),y({status:"loading",error:null,transactionId:null});try{t.getLogger().debug("[useX402Payment] Fetching fresh quote");const n=await C.requestQuote({resource:o,couponCode:c});t.getLogger().debug("[useX402Payment] Received quote",{amount:n.maxAmountRequired}),L(n),t.getLogger().debug("[useX402Payment] Executing payment flow");const s=await B(n,o,c,d,"regular");return s.success?y({status:"success",error:null,transactionId:s.transactionId||"payment-success"}):y({status:"error",error:s.error||"Payment failed",transactionId:null}),s}catch(n){const s=t.formatError(n,"Payment failed");return y({status:"error",error:s,transactionId:null}),{success:!1,error:s}}finally{g.current=0}},[S,C,B]),_=a.useCallback(async(o,c,d)=>{if(I())return{success:!1,error:"Payment already in progress"};const x=S();if(!x.valid)return{success:!1,error:x.error};g.current=Date.now(),y({status:"loading",error:null,transactionId:null});try{const n=i.normalizeCartItems(o),s=await C.requestCartQuote({items:n,metadata:c,couponCode:d}),m=s.cartId,u=s.quote;if(!C.validateRequirement(u))throw new Error("Invalid cart quote received from server");L(u);const b=await B(u,m,d,c,"cart");return b.success?y({status:"success",error:null,transactionId:b.transactionId||"cart-payment-success"}):y({status:"error",error:b.error||"Cart payment failed",transactionId:null}),b}catch(n){const s=t.formatError(n,"Cart payment failed");return y({status:"error",error:s,transactionId:null}),{success:!1,error:s}}finally{g.current=0}},[S,C,B]),T=a.useCallback(()=>{y({status:"idle",error:null,transactionId:null}),L(null),k(null),g.current=0},[]);return{...N,requirement:R,settlement:K,fetchQuote:q,processPayment:w,processCartPayment:_,reset:T}}function ue({resource:C,items:l,label:W,disabled:j=!1,onAttempt:N,onSuccess:y,onError:R,className:L="",testPageUrl:K,hideMessages:k=!1,metadata:P,couponCode:h}){const{connected:g,connecting:X,connect:I,disconnect:S,select:q,wallets:B,wallet:w,publicKey:_}=ce.useWallet(),{status:T,error:o,transactionId:c,processPayment:d,processCartPayment:x}=ie(),n=t.useCedrosTheme(),{solanaError:s}=t.useCedrosContext(),{isCartMode:m,effectiveResource:u}=i.usePaymentMode(C,l),{t:b,translations:M}=i.useTranslation(),A=W||b("ui.pay_with_crypto"),E=o&&typeof o!="string"?o?.code??null:null,z=s&&typeof s!="string"?s?.code??null:null,U=e=>{if(!e||!M)return"";const r=M.errors[e];return r?r.action?`${r.message} ${r.action}`:r.message:""},Y=o?typeof o=="string"?o:U(E):null,H=s?typeof s=="string"?s:U(z):null,J=a.useRef(y),V=a.useRef(R),Z=a.useRef(d),ee=a.useRef(x);J.current=y,V.current=R,Z.current=d,ee.current=x;const de=a.useMemo(()=>B.map(e=>`${e.adapter.name}-${e.readyState}`).join(","),[B]),G=a.useMemo(()=>B.filter(({readyState:e})=>e===le.WalletReadyState.Installed||e===le.WalletReadyState.Loadable),[de]);a.useEffect(()=>{if(T==="success"&&c){const e=m&&l?i.getCartItemCount(l):void 0;i.emitPaymentSuccess("crypto",c,u,e),J.current?.(c)}},[T,c,m,l,u]),a.useEffect(()=>{if(T==="error"&&o){const e=m&&l?i.getCartItemCount(l):void 0;i.emitPaymentError("crypto",o,u,e),V.current?.(o)}},[T,o,m,l,u]);const te=typeof window<"u"&&window.top!==window.self,[re,$]=a.useState(!1),[ne,Q]=a.useState(!1),[D,v]=a.useState(null),F=s;a.useEffect(()=>{let e=!1;return e||(async()=>{if(ne&&w&&!g&&!X){t.getLogger().debug("[CryptoButton] Wallet detected, attempting auto-connect:",w.adapter.name),Q(!1),i.emitWalletConnect(w.adapter.name);try{await I(),e||t.getLogger().debug("[CryptoButton] Auto-connect successful")}catch(f){if(!e){t.getLogger().error("[CryptoButton] Auto-connect failed:",f);const O=f instanceof Error?f.message:"Failed to connect wallet";i.emitWalletError(O,w.adapter.name),v(null)}}}})(),()=>{e=!0}},[w,ne,g,X,I]),a.useEffect(()=>{let e=!0;if(t.getLogger().debug("[CryptoButton] Payment useEffect triggered",{connected:g,hasPendingPayment:!!D,hasPublicKey:!!_,pendingPaymentType:D?.type}),g&&D&&_&&w&&e){i.emitWalletConnected(w.adapter.name,_.toString()),t.getLogger().debug("[CryptoButton] All conditions met! Processing pending payment:",D);const r=D;v(null),$(!1);const f=r.type==="cart"&&r.items?i.getCartItemCount(r.items):void 0;i.emitPaymentProcessing("crypto",r.resource,f),r.type==="cart"&&r.items?(t.getLogger().debug("[CryptoButton] Auto-processing cart payment"),ee.current(r.items,r.metadata,r.couponCode)):r.type==="single"&&r.resource&&(t.getLogger().debug("[CryptoButton] Auto-processing single payment"),Z.current(r.resource,r.couponCode,r.metadata))}return()=>{e=!1}},[g,D,_,w]);const oe=a.useCallback(async()=>{t.getLogger().debug("[CryptoButton] executePaymentFlow called",{connected:g,wallet:w?.adapter.name,couponCode:h,isCartMode:m,hasItems:!!l,effectiveResource:u});const e=m&&l?i.getCartItemCount(l):void 0;if(i.emitPaymentStart("crypto",u,e),N&&N("crypto"),F){t.getLogger().error("[CryptoButton] Solana dependencies missing:",F),i.emitPaymentError("crypto",F,u,e),R&&R(F);return}if(te){const r=K||window.location.href;try{if(new URL(r,window.location.origin).origin!==window.location.origin)throw t.getLogger().error("[CryptoButton] Blocked attempt to open external URL:",r),new Error("Cannot open external URLs from embedded context");window.open(r,"_blank","noopener,noreferrer")}catch(f){throw t.getLogger().error("[CryptoButton] URL validation failed:",f),f}return}if(g)i.emitPaymentProcessing("crypto",u,e),m&&l?(t.getLogger().debug("[CryptoButton] Processing cart payment with coupon:",h),await x(l,P,h)):u&&(t.getLogger().debug("[CryptoButton] Processing single payment with coupon:",h),await d(u,h,P));else{let r=!1;if(m&&l?(t.getLogger().debug("[CryptoButton] Setting pending cart payment with coupon:",h),v({type:"cart",items:l,metadata:P,couponCode:h}),r=!0):u&&(t.getLogger().debug("[CryptoButton] Setting pending single payment with coupon:",h),v({type:"single",resource:u,metadata:P,couponCode:h}),r=!0),!r){t.getLogger().error("[CryptoButton] No valid payment to process");return}try{if(w)t.getLogger().debug("[CryptoButton] Wallet already selected, connecting:",w.adapter.name),i.emitWalletConnect(w.adapter.name),await I();else{if(t.getLogger().debug("[CryptoButton] No wallet selected, showing selector. Available wallets:",G.map(f=>f.adapter.name)),G.length===0){v(null);const f="No wallets available";throw i.emitWalletError(f),new Error(f)}$(!0)}}catch(f){v(null);const O=f instanceof Error?f.message:"Failed to connect wallet";t.getLogger().error("[CryptoButton] Connection error:",O),i.emitWalletError(O,w?.adapter.name)}}},[g,w,h,m,l,u,te,K,G,I,P,x,d,F,N,R]),ae=a.useMemo(()=>m&&l?`crypto-cart-${l.map(e=>e.resource).join("-")}`:`crypto-${u||"unknown"}`,[m,l,u]),ge=a.useMemo(()=>i.createDedupedClickHandler(ae,oe,{cooldownMs:200,deduplicationWindowMs:0}),[ae,oe]),se=T==="loading",ye=j||se||X||!!F,me=se?b("ui.processing"):A,fe=a.useCallback(async()=>{try{Q(!1),g&&await S(),q(null),$(!0)}catch(e){t.getLogger().error("Failed to change wallet:",e)}},[g,S,q]),pe=a.useCallback(e=>{t.getLogger().debug("[CryptoButton] Wallet clicked:",e),$(!1),q(e),Q(!0),t.getLogger().debug("[CryptoButton] Wallet selected, useEffect will auto-connect")},[q]),we=a.useCallback(async()=>{try{if(await S(),v(null),typeof window<"u"&&window.localStorage)try{window.localStorage.removeItem("walletName")}catch(e){e instanceof Error&&e.name==="QuotaExceededError"?t.getLogger().warn("localStorage quota exceeded when removing wallet preference"):t.getLogger().error("Failed to clear wallet preference from localStorage:",e)}}catch(e){t.getLogger().error("Failed to disconnect wallet:",e)}},[S]);return p.jsxs("div",{className:n.unstyled?L:`${n.className} cedros-theme__crypto-button ${L||""}`,style:n.unstyled?{}:n.style,children:[p.jsx("button",{onClick:ge,disabled:ye,className:n.unstyled?L:"cedros-theme__button cedros-theme__crypto",type:"button",children:me}),re&&!k&&p.jsx("div",{className:"cedros-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:n.tokens.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem"},onClick:()=>{$(!1),v(null)},children:p.jsxs("div",{className:"cedros-modal-content",style:{backgroundColor:n.tokens.modalBackground,borderRadius:"12px",padding:"2rem",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",border:`1px solid ${n.tokens.modalBorder}`},onClick:e=>e.stopPropagation(),children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[p.jsx("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:600,color:n.tokens.surfaceText},children:b("wallet.select_wallet")}),p.jsx("button",{onClick:()=>{$(!1),v(null)},style:i.getModalCloseButtonStyles(n.tokens.surfaceText),"aria-label":"Close modal",type:"button",children:"×"})]}),p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:G.map(e=>p.jsxs("button",{onClick:()=>pe(e.adapter.name),style:{width:"100%",padding:"1rem",backgroundColor:n.tokens.surfaceBackground,border:`1px solid ${n.tokens.surfaceBorder}`,borderRadius:"0.5rem",cursor:"pointer",fontSize:"1rem",textAlign:"left",color:n.tokens.surfaceText,display:"flex",alignItems:"center",gap:"1rem",transition:"all 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.backgroundColor=n.tokens.modalBackground,r.currentTarget.style.borderColor=n.tokens.surfaceText,r.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:r=>{r.currentTarget.style.backgroundColor=n.tokens.surfaceBackground,r.currentTarget.style.borderColor=n.tokens.surfaceBorder,r.currentTarget.style.transform="translateY(0)"},type:"button",children:[p.jsx(be.WalletIcon,{wallet:e,style:{width:"24px",height:"24px"}}),p.jsx("span",{style:{fontWeight:500},children:e.adapter.name})]},e.adapter.name))})]})}),g&&!k&&!re&&p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem",fontSize:"0.75rem",color:n.tokens.surfaceText,opacity:.7},children:[p.jsx("button",{onClick:fe,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:b("wallet.change")}),p.jsx("button",{onClick:we,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:b("ui.disconnect")})]}),!k&&H&&p.jsx("div",{className:n.unstyled?"":"cedros-theme__error",children:H}),!k&&Y&&p.jsx("div",{className:n.unstyled?"":"cedros-theme__error",children:Y}),!k&&c&&p.jsx("div",{className:n.unstyled?"":"cedros-theme__success",children:b("ui.payment_successful")})]})}const Ce=Object.freeze(Object.defineProperty({__proto__:null,CryptoButton:ue},Symbol.toStringTag,{value:"Module"}));exports.CryptoButton=ue;exports.CryptoButton$1=Ce;exports.useX402Payment=ie;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as r, useCallback as R, useEffect as V, useMemo as G } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { E as H, b as Y, I as l } from "./index-75RhiLDq.mjs";
|
|
4
4
|
function M({ serverUrl: u, apiKey: d, pageSize: A = 20, authManager: o }) {
|
|
5
|
-
const [_, F] = r([]), [
|
|
5
|
+
const [_, F] = r([]), [E, C] = r(!0), [S, N] = r(!1), [v, k] = r(null), [Q, I] = r(!1), [y, $] = r(""), [f, x] = r("all"), [q, w] = r(null), [T, b] = r(null), [n, m] = r({
|
|
6
6
|
question: "",
|
|
7
7
|
answer: "",
|
|
8
8
|
keywordsCsv: "",
|
|
@@ -161,7 +161,7 @@ function M({ serverUrl: u, apiKey: d, pageSize: A = 20, authManager: o }) {
|
|
|
161
161
|
type: "text",
|
|
162
162
|
placeholder: "Search FAQs...",
|
|
163
163
|
value: y,
|
|
164
|
-
onChange: (e) =>
|
|
164
|
+
onChange: (e) => $(e.target.value),
|
|
165
165
|
className: "cedros-admin__input",
|
|
166
166
|
style: { flex: 1, maxWidth: 300 }
|
|
167
167
|
}
|
|
@@ -283,7 +283,7 @@ function M({ serverUrl: u, apiKey: d, pageSize: A = 20, authManager: o }) {
|
|
|
283
283
|
)
|
|
284
284
|
] })
|
|
285
285
|
] }) }),
|
|
286
|
-
|
|
286
|
+
E ? /* @__PURE__ */ a("div", { className: "cedros-admin__loading", children: [
|
|
287
287
|
l.loading,
|
|
288
288
|
/* @__PURE__ */ t("span", { children: "Loading FAQs..." })
|
|
289
289
|
] }) : P.length === 0 ? /* @__PURE__ */ t("div", { className: "cedros-admin__empty", children: /* @__PURE__ */ t("p", { children: y || f !== "all" ? "No FAQs match your filters." : "No FAQs yet. Add one to get started." }) }) : /* @__PURE__ */ t("div", { className: "cedros-admin__faq-list", children: P.map((e) => /* @__PURE__ */ a(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),d=require("./index-B-0trqeD.js");function R({serverUrl:h,apiKey:o,pageSize:g=20,authManager:r}){const[u,N]=c.useState([]),[Q,w]=c.useState(!0),[S,f]=c.useState(!1),[p,A]=c.useState(null),[F,C]=c.useState(!1),[x,P]=c.useState(""),[v,O]=c.useState("all"),[q,b]=c.useState(null),[$,j]=c.useState(null),[n,l]=c.useState({question:"",answer:"",keywordsCsv:"",active:!0,useInChat:!0,displayOnPage:!0}),_=c.useCallback(async()=>{w(!0);try{j(null);let s;const t=`/admin/faqs?limit=${g}`;if(r?.isAuthenticated())s=await r.fetchWithAuth(t);else{const i={"Content-Type":"application/json"};o&&(i["X-API-Key"]=o);const a=await fetch(`${h}${t}`,{headers:i});if(!a.ok)throw new Error(`Failed to fetch FAQs: ${a.status}`);s=await a.json()}N(s.faqs||[])}catch{N([]),j("Failed to load FAQs")}finally{w(!1)}},[h,o,g,r]);c.useEffect(()=>{_()},[_]);const E=async s=>{if(s.preventDefault(),!(!n.question.trim()||!n.answer.trim())){C(!0);try{const t=n.keywordsCsv.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),i={question:n.question.trim(),answer:n.answer.trim(),keywords:t,active:n.active,useInChat:n.useInChat,displayOnPage:n.displayOnPage};if(p){const a=`/admin/faqs/${p.id}`;if(r?.isAuthenticated())await r.fetchWithAuth(a,{method:"PUT",body:JSON.stringify(i)});else{const m={"Content-Type":"application/json"};o&&(m["X-API-Key"]=o);const I=await fetch(`${h}${a}`,{method:"PUT",headers:m,body:JSON.stringify(i)});if(!I.ok)throw new Error(`Failed to update FAQ: ${I.status}`)}}else if(r?.isAuthenticated())await r.fetchWithAuth("/admin/faqs",{method:"POST",body:JSON.stringify(i)});else{const a={"Content-Type":"application/json"};o&&(a["X-API-Key"]=o);const m=await fetch(`${h}/admin/faqs`,{method:"POST",headers:a,body:JSON.stringify(i)});if(!m.ok)throw new Error(`Failed to create FAQ: ${m.status}`)}y(),_()}catch{j(p?"Failed to update FAQ":"Failed to create FAQ")}finally{C(!1)}}},T=async s=>{try{const t=`/admin/faqs/${s}`;if(r?.isAuthenticated())await r.fetchWithAuth(t,{method:"DELETE"});else{const i={"Content-Type":"application/json"};o&&(i["X-API-Key"]=o);const a=await fetch(`${h}${t}`,{method:"DELETE",headers:i});if(!a.ok)throw new Error(`Failed to delete FAQ: ${a.status}`)}_()}catch{j("Failed to delete FAQ")}b(null)},D=async s=>{try{const t=`/admin/faqs/${s.id}`,i={...s,active:!s.active};if(r?.isAuthenticated())await r.fetchWithAuth(t,{method:"PUT",body:JSON.stringify(i)});else{const a={"Content-Type":"application/json"};o&&(a["X-API-Key"]=o);const m=await fetch(`${h}${t}`,{method:"PUT",headers:a,body:JSON.stringify(i)});if(!m.ok)throw new Error(`Failed to update FAQ: ${m.status}`)}_()}catch{j("Failed to update FAQ status")}},y=()=>{l({question:"",answer:"",keywordsCsv:"",active:!0,useInChat:!0,displayOnPage:!0}),A(null),f(!1)},L=s=>{l({question:s.question,answer:s.answer,keywordsCsv:s.keywords.join(", "),active:s.active,useInChat:s.useInChat??!0,displayOnPage:s.displayOnPage??!0}),A(s),f(!0)},W=u.length,B=u.filter(s=>s.active).length,J=u.filter(s=>s.active&&s.useInChat).length,X=u.filter(s=>s.active&&s.displayOnPage).length,k=c.useMemo(()=>u.filter(s=>{if(v==="active"&&!s.active||v==="inactive"&&s.active)return!1;if(x){const t=x.toLowerCase();return s.question.toLowerCase().includes(t)||s.answer.toLowerCase().includes(t)||s.keywords.some(i=>i.includes(t))}return!0}),[u,v,x]);return e.jsxs("div",{className:"cedros-admin__faqs",children:[e.jsx(d.ErrorBanner,{message:$,onRetry:_}),e.jsx(d.StatsBar,{stats:[{label:"Total FAQs",value:W},{label:"Active",value:B,variant:"success"},{label:"In Chat",value:J},{label:"On Page",value:X}]}),e.jsxs("div",{className:"cedros-admin__section",children:[e.jsxs("div",{className:"cedros-admin__section-header",children:[e.jsxs("div",{className:"cedros-admin__section-header-left",children:[e.jsx("h3",{className:"cedros-admin__section-title",children:"Knowledge Base"}),e.jsx("p",{className:"cedros-admin__section-subtitle",children:"Manage FAQs for the AI chat assistant and public FAQ page."})]}),e.jsx("div",{className:"cedros-admin__section-header-right",children:e.jsxs("button",{className:"cedros-admin__button cedros-admin__button--primary",onClick:()=>{y(),f(!0)},children:[d.Icons.plus," Add FAQ"]})})]}),e.jsxs("div",{className:"cedros-admin__filters",style:{display:"flex",gap:"1rem",marginBottom:"1rem"},children:[e.jsx("input",{type:"text",placeholder:"Search FAQs...",value:x,onChange:s=>P(s.target.value),className:"cedros-admin__input",style:{flex:1,maxWidth:300}}),e.jsxs("select",{value:v,onChange:s=>O(s.target.value),className:"cedros-admin__select",children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"active",children:"Active Only"}),e.jsx("option",{value:"inactive",children:"Inactive Only"})]})]}),S&&e.jsx("div",{className:"cedros-admin__form-container",style:{marginBottom:"1.5rem"},children:e.jsxs("form",{onSubmit:E,className:"cedros-admin__form",children:[e.jsxs("div",{className:"cedros-admin__form-header",children:[e.jsx("h4",{children:p?"Edit FAQ":"Add New FAQ"}),e.jsx("button",{type:"button",className:"cedros-admin__button--icon",onClick:y,children:d.Icons.close})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Question *"}),e.jsx("input",{type:"text",value:n.question,onChange:s=>l(t=>({...t,question:s.target.value})),className:"cedros-admin__input",placeholder:"What is your return policy?",required:!0})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Answer *"}),e.jsx("textarea",{value:n.answer,onChange:s=>l(t=>({...t,answer:s.target.value})),className:"cedros-admin__textarea",placeholder:"We accept returns within 30 days...",rows:4,required:!0}),e.jsx("span",{className:"cedros-admin__hint",children:"Supports markdown formatting."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Keywords"}),e.jsx("input",{type:"text",value:n.keywordsCsv,onChange:s=>l(t=>({...t,keywordsCsv:s.target.value})),className:"cedros-admin__input",placeholder:"returns, refund, policy"}),e.jsx("span",{className:"cedros-admin__hint",children:"Comma-separated keywords to help AI find this FAQ."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.active,onChange:s=>l(t=>({...t,active:s.target.checked}))}),e.jsx("span",{children:"Active"})]}),e.jsx("span",{className:"cedros-admin__hint",children:"Inactive FAQs won't appear anywhere."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Visibility"}),e.jsxs("div",{className:"cedros-admin__checkbox-group",children:[e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.useInChat,onChange:s=>l(t=>({...t,useInChat:s.target.checked}))}),e.jsx("span",{children:"Use in AI Chat"})]}),e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.displayOnPage,onChange:s=>l(t=>({...t,displayOnPage:s.target.checked}))}),e.jsx("span",{children:"Display on FAQ Page"})]})]}),e.jsx("span",{className:"cedros-admin__hint",children:"Choose where this FAQ should appear."})]}),e.jsxs("div",{className:"cedros-admin__form-actions",children:[e.jsx("button",{type:"button",className:"cedros-admin__button",onClick:y,children:"Cancel"}),e.jsx("button",{type:"submit",className:"cedros-admin__button cedros-admin__button--primary",disabled:F||!n.question.trim()||!n.answer.trim(),children:F?d.Icons.loading:p?"Update FAQ":"Create FAQ"})]})]})}),Q?e.jsxs("div",{className:"cedros-admin__loading",children:[d.Icons.loading,e.jsx("span",{children:"Loading FAQs..."})]}):k.length===0?e.jsx("div",{className:"cedros-admin__empty",children:e.jsx("p",{children:x||v!=="all"?"No FAQs match your filters.":"No FAQs yet. Add one to get started."})}):e.jsx("div",{className:"cedros-admin__faq-list",children:k.map(s=>e.jsxs("div",{className:`cedros-admin__faq-item ${s.active?"":"cedros-admin__faq-item--inactive"}`,children:[e.jsxs("div",{className:"cedros-admin__faq-content",children:[e.jsxs("div",{className:"cedros-admin__faq-question",children:[e.jsx("span",{className:`cedros-admin__status-dot ${s.active?"cedros-admin__status-dot--active":"cedros-admin__status-dot--inactive"}`}),s.question]}),e.jsx("div",{className:"cedros-admin__faq-answer",children:s.answer}),e.jsxs("div",{className:"cedros-admin__faq-meta",children:[s.keywords.length>0&&e.jsx("div",{className:"cedros-admin__faq-keywords",children:s.keywords.map(t=>e.jsx("span",{className:"cedros-admin__tag",children:t},t))}),e.jsxs("div",{className:"cedros-admin__faq-visibility",children:[s.useInChat&&e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--chat",title:"Used in AI Chat",children:[d.Icons.chat," Chat"]}),s.displayOnPage&&e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--page",title:"Displayed on FAQ Page",children:[d.Icons.globe," Page"]})]})]})]}),e.jsxs("div",{className:"cedros-admin__faq-actions",children:[e.jsx("button",{className:"cedros-admin__button--icon",onClick:()=>D(s),title:s.active?"Deactivate":"Activate",children:s.active?d.Icons.eyeOff:d.Icons.eye}),e.jsx("button",{className:"cedros-admin__button--icon",onClick:()=>L(s),title:"Edit",children:d.Icons.edit}),e.jsx("button",{className:"cedros-admin__button--icon cedros-admin__btn--danger",onClick:()=>b(s.id),title:"Delete",children:d.Icons.trash})]}),q===s.id&&e.jsx("div",{className:"cedros-admin__confirm-overlay",children:e.jsxs("div",{className:"cedros-admin__confirm-dialog",children:[e.jsx("p",{children:"Delete this FAQ?"}),e.jsxs("div",{className:"cedros-admin__confirm-actions",children:[e.jsx("button",{className:"cedros-admin__button",onClick:()=>b(null),children:"Cancel"}),e.jsx("button",{className:"cedros-admin__button cedros-admin__button--danger",onClick:()=>T(s.id),children:"Delete"})]})]})})]},s.id))})]})]})}exports.FAQSection=R;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),d=require("./index-B5ck27xb.js");function R({serverUrl:h,apiKey:o,pageSize:g=20,authManager:r}){const[u,N]=c.useState([]),[Q,w]=c.useState(!0),[S,f]=c.useState(!1),[p,A]=c.useState(null),[F,C]=c.useState(!1),[x,P]=c.useState(""),[v,O]=c.useState("all"),[q,b]=c.useState(null),[$,j]=c.useState(null),[n,l]=c.useState({question:"",answer:"",keywordsCsv:"",active:!0,useInChat:!0,displayOnPage:!0}),_=c.useCallback(async()=>{w(!0);try{j(null);let s;const t=`/admin/faqs?limit=${g}`;if(r?.isAuthenticated())s=await r.fetchWithAuth(t);else{const i={"Content-Type":"application/json"};o&&(i["X-API-Key"]=o);const a=await fetch(`${h}${t}`,{headers:i});if(!a.ok)throw new Error(`Failed to fetch FAQs: ${a.status}`);s=await a.json()}N(s.faqs||[])}catch{N([]),j("Failed to load FAQs")}finally{w(!1)}},[h,o,g,r]);c.useEffect(()=>{_()},[_]);const E=async s=>{if(s.preventDefault(),!(!n.question.trim()||!n.answer.trim())){C(!0);try{const t=n.keywordsCsv.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),i={question:n.question.trim(),answer:n.answer.trim(),keywords:t,active:n.active,useInChat:n.useInChat,displayOnPage:n.displayOnPage};if(p){const a=`/admin/faqs/${p.id}`;if(r?.isAuthenticated())await r.fetchWithAuth(a,{method:"PUT",body:JSON.stringify(i)});else{const m={"Content-Type":"application/json"};o&&(m["X-API-Key"]=o);const I=await fetch(`${h}${a}`,{method:"PUT",headers:m,body:JSON.stringify(i)});if(!I.ok)throw new Error(`Failed to update FAQ: ${I.status}`)}}else if(r?.isAuthenticated())await r.fetchWithAuth("/admin/faqs",{method:"POST",body:JSON.stringify(i)});else{const a={"Content-Type":"application/json"};o&&(a["X-API-Key"]=o);const m=await fetch(`${h}/admin/faqs`,{method:"POST",headers:a,body:JSON.stringify(i)});if(!m.ok)throw new Error(`Failed to create FAQ: ${m.status}`)}y(),_()}catch{j(p?"Failed to update FAQ":"Failed to create FAQ")}finally{C(!1)}}},T=async s=>{try{const t=`/admin/faqs/${s}`;if(r?.isAuthenticated())await r.fetchWithAuth(t,{method:"DELETE"});else{const i={"Content-Type":"application/json"};o&&(i["X-API-Key"]=o);const a=await fetch(`${h}${t}`,{method:"DELETE",headers:i});if(!a.ok)throw new Error(`Failed to delete FAQ: ${a.status}`)}_()}catch{j("Failed to delete FAQ")}b(null)},D=async s=>{try{const t=`/admin/faqs/${s.id}`,i={...s,active:!s.active};if(r?.isAuthenticated())await r.fetchWithAuth(t,{method:"PUT",body:JSON.stringify(i)});else{const a={"Content-Type":"application/json"};o&&(a["X-API-Key"]=o);const m=await fetch(`${h}${t}`,{method:"PUT",headers:a,body:JSON.stringify(i)});if(!m.ok)throw new Error(`Failed to update FAQ: ${m.status}`)}_()}catch{j("Failed to update FAQ status")}},y=()=>{l({question:"",answer:"",keywordsCsv:"",active:!0,useInChat:!0,displayOnPage:!0}),A(null),f(!1)},L=s=>{l({question:s.question,answer:s.answer,keywordsCsv:s.keywords.join(", "),active:s.active,useInChat:s.useInChat??!0,displayOnPage:s.displayOnPage??!0}),A(s),f(!0)},W=u.length,B=u.filter(s=>s.active).length,J=u.filter(s=>s.active&&s.useInChat).length,X=u.filter(s=>s.active&&s.displayOnPage).length,k=c.useMemo(()=>u.filter(s=>{if(v==="active"&&!s.active||v==="inactive"&&s.active)return!1;if(x){const t=x.toLowerCase();return s.question.toLowerCase().includes(t)||s.answer.toLowerCase().includes(t)||s.keywords.some(i=>i.includes(t))}return!0}),[u,v,x]);return e.jsxs("div",{className:"cedros-admin__faqs",children:[e.jsx(d.ErrorBanner,{message:$,onRetry:_}),e.jsx(d.StatsBar,{stats:[{label:"Total FAQs",value:W},{label:"Active",value:B,variant:"success"},{label:"In Chat",value:J},{label:"On Page",value:X}]}),e.jsxs("div",{className:"cedros-admin__section",children:[e.jsxs("div",{className:"cedros-admin__section-header",children:[e.jsxs("div",{className:"cedros-admin__section-header-left",children:[e.jsx("h3",{className:"cedros-admin__section-title",children:"Knowledge Base"}),e.jsx("p",{className:"cedros-admin__section-subtitle",children:"Manage FAQs for the AI chat assistant and public FAQ page."})]}),e.jsx("div",{className:"cedros-admin__section-header-right",children:e.jsxs("button",{className:"cedros-admin__button cedros-admin__button--primary",onClick:()=>{y(),f(!0)},children:[d.Icons.plus," Add FAQ"]})})]}),e.jsxs("div",{className:"cedros-admin__filters",style:{display:"flex",gap:"1rem",marginBottom:"1rem"},children:[e.jsx("input",{type:"text",placeholder:"Search FAQs...",value:x,onChange:s=>P(s.target.value),className:"cedros-admin__input",style:{flex:1,maxWidth:300}}),e.jsxs("select",{value:v,onChange:s=>O(s.target.value),className:"cedros-admin__select",children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"active",children:"Active Only"}),e.jsx("option",{value:"inactive",children:"Inactive Only"})]})]}),S&&e.jsx("div",{className:"cedros-admin__form-container",style:{marginBottom:"1.5rem"},children:e.jsxs("form",{onSubmit:E,className:"cedros-admin__form",children:[e.jsxs("div",{className:"cedros-admin__form-header",children:[e.jsx("h4",{children:p?"Edit FAQ":"Add New FAQ"}),e.jsx("button",{type:"button",className:"cedros-admin__button--icon",onClick:y,children:d.Icons.close})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Question *"}),e.jsx("input",{type:"text",value:n.question,onChange:s=>l(t=>({...t,question:s.target.value})),className:"cedros-admin__input",placeholder:"What is your return policy?",required:!0})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Answer *"}),e.jsx("textarea",{value:n.answer,onChange:s=>l(t=>({...t,answer:s.target.value})),className:"cedros-admin__textarea",placeholder:"We accept returns within 30 days...",rows:4,required:!0}),e.jsx("span",{className:"cedros-admin__hint",children:"Supports markdown formatting."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Keywords"}),e.jsx("input",{type:"text",value:n.keywordsCsv,onChange:s=>l(t=>({...t,keywordsCsv:s.target.value})),className:"cedros-admin__input",placeholder:"returns, refund, policy"}),e.jsx("span",{className:"cedros-admin__hint",children:"Comma-separated keywords to help AI find this FAQ."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.active,onChange:s=>l(t=>({...t,active:s.target.checked}))}),e.jsx("span",{children:"Active"})]}),e.jsx("span",{className:"cedros-admin__hint",children:"Inactive FAQs won't appear anywhere."})]}),e.jsxs("div",{className:"cedros-admin__form-group",children:[e.jsx("label",{className:"cedros-admin__label",children:"Visibility"}),e.jsxs("div",{className:"cedros-admin__checkbox-group",children:[e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.useInChat,onChange:s=>l(t=>({...t,useInChat:s.target.checked}))}),e.jsx("span",{children:"Use in AI Chat"})]}),e.jsxs("label",{className:"cedros-admin__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:n.displayOnPage,onChange:s=>l(t=>({...t,displayOnPage:s.target.checked}))}),e.jsx("span",{children:"Display on FAQ Page"})]})]}),e.jsx("span",{className:"cedros-admin__hint",children:"Choose where this FAQ should appear."})]}),e.jsxs("div",{className:"cedros-admin__form-actions",children:[e.jsx("button",{type:"button",className:"cedros-admin__button",onClick:y,children:"Cancel"}),e.jsx("button",{type:"submit",className:"cedros-admin__button cedros-admin__button--primary",disabled:F||!n.question.trim()||!n.answer.trim(),children:F?d.Icons.loading:p?"Update FAQ":"Create FAQ"})]})]})}),Q?e.jsxs("div",{className:"cedros-admin__loading",children:[d.Icons.loading,e.jsx("span",{children:"Loading FAQs..."})]}):k.length===0?e.jsx("div",{className:"cedros-admin__empty",children:e.jsx("p",{children:x||v!=="all"?"No FAQs match your filters.":"No FAQs yet. Add one to get started."})}):e.jsx("div",{className:"cedros-admin__faq-list",children:k.map(s=>e.jsxs("div",{className:`cedros-admin__faq-item ${s.active?"":"cedros-admin__faq-item--inactive"}`,children:[e.jsxs("div",{className:"cedros-admin__faq-content",children:[e.jsxs("div",{className:"cedros-admin__faq-question",children:[e.jsx("span",{className:`cedros-admin__status-dot ${s.active?"cedros-admin__status-dot--active":"cedros-admin__status-dot--inactive"}`}),s.question]}),e.jsx("div",{className:"cedros-admin__faq-answer",children:s.answer}),e.jsxs("div",{className:"cedros-admin__faq-meta",children:[s.keywords.length>0&&e.jsx("div",{className:"cedros-admin__faq-keywords",children:s.keywords.map(t=>e.jsx("span",{className:"cedros-admin__tag",children:t},t))}),e.jsxs("div",{className:"cedros-admin__faq-visibility",children:[s.useInChat&&e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--chat",title:"Used in AI Chat",children:[d.Icons.chat," Chat"]}),s.displayOnPage&&e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--page",title:"Displayed on FAQ Page",children:[d.Icons.globe," Page"]})]})]})]}),e.jsxs("div",{className:"cedros-admin__faq-actions",children:[e.jsx("button",{className:"cedros-admin__button--icon",onClick:()=>D(s),title:s.active?"Deactivate":"Activate",children:s.active?d.Icons.eyeOff:d.Icons.eye}),e.jsx("button",{className:"cedros-admin__button--icon",onClick:()=>L(s),title:"Edit",children:d.Icons.edit}),e.jsx("button",{className:"cedros-admin__button--icon cedros-admin__btn--danger",onClick:()=>b(s.id),title:"Delete",children:d.Icons.trash})]}),q===s.id&&e.jsx("div",{className:"cedros-admin__confirm-overlay",children:e.jsxs("div",{className:"cedros-admin__confirm-dialog",children:[e.jsx("p",{children:"Delete this FAQ?"}),e.jsxs("div",{className:"cedros-admin__confirm-actions",children:[e.jsx("button",{className:"cedros-admin__button",onClick:()=>b(null),children:"Cancel"}),e.jsx("button",{className:"cedros-admin__button cedros-admin__button--danger",onClick:()=>T(s.id),children:"Delete"})]})]})})]},s.id))})]})]})}exports.FAQSection=R;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),v=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),v=require("./index-B5ck27xb.js"),j=require("./Toggle-CsPSF8Dr.js"),I=require("./useAutosave-B2p6iwh8.js"),P=require("./AutosaveIndicator-CpTVtJIz.js"),g={email_enabled:!1,smtp_host:"",smtp_port:587,smtp_username:"",smtp_password:"",from_email:"",from_name:"",webhook_enabled:!1,webhook_url:"",webhook_secret:"",webhook_timeout:30};function W({serverUrl:h,apiKey:d,authManager:r}){const[l,_]=o.useState("messages"),[a,p]=o.useState(g),[y,w]=o.useState(!0),[N,S]=o.useState(!0),[k,b]=o.useState(null),[m,C]=o.useState(new Set),u=o.useCallback(async()=>{try{b(null);let s;const n="/admin/config/messaging";if(r?.isAuthenticated())s=await r.fetchWithAuth(n);else{const t={"Content-Type":"application/json"};d&&(t["X-API-Key"]=d);const c=await fetch(`${h}${n}`,{headers:t});if(!c.ok)throw new Error(`Failed to fetch: ${c.status}`);s=await c.json()}p({...g,...s.config})}catch{p(g),b("Could not load saved settings. Showing defaults.")}finally{w(!1),setTimeout(()=>S(!1),100)}},[h,d,r]);o.useEffect(()=>{u()},[u]);const E=o.useCallback(async s=>{const n="/admin/config/messaging",t={...s};m.has("smtp_password")||delete t.smtp_password,m.has("webhook_secret")||delete t.webhook_secret;const c=JSON.stringify({config:t});try{if(r?.isAuthenticated())await r.fetchWithAuth(n,{method:"PUT",body:c});else{const f={"Content-Type":"application/json"};d&&(f["X-API-Key"]=d);const x=await fetch(`${h}${n}`,{method:"PUT",headers:f,body:c});if(!x.ok)throw new Error(`Failed to save: ${x.status}`)}}catch{throw b("Failed to save messaging settings"),new Error("Save failed")}},[h,d,r,m]),{status:T,error:A}=I.useAutosave({data:a,onSave:E,debounceMs:1500,enabled:!N}),i=(s,n)=>{(s==="smtp_password"||s==="webhook_secret")&&C(t=>new Set(t).add(s)),p(t=>({...t,[s]:n}))};return y?e.jsxs("div",{className:"cedros-admin__messaging-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Messages"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure email delivery and webhook notifications."})]}),e.jsxs("div",{className:"cedros-admin__loading",style:{marginTop:"1rem"},children:[v.Icons.loading," Loading message settings..."]})]}):e.jsxs("div",{className:"cedros-admin__messaging-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Messages"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure email delivery and webhook notifications."})]}),e.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:[e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="messages"?"cedros-admin__tab--active":""}`,onClick:()=>_("messages"),children:"Messages"}),e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="email"?"cedros-admin__tab--active":""}`,onClick:()=>_("email"),children:"Email"}),e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="webhooks"?"cedros-admin__tab--active":""}`,onClick:()=>_("webhooks"),children:"Webhooks"}),e.jsx("div",{style:{flex:1}}),e.jsx(P.AutosaveIndicator,{status:T,error:A})]}),e.jsx(v.ErrorBanner,{message:k,onRetry:u}),e.jsxs("div",{className:"cedros-admin__tab-content",style:{marginTop:"1rem"},children:[l==="messages"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Enable or disable notification types. Configure the delivery settings in the Email or Webhooks tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"1rem",padding:"1rem",border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:"0.5rem"},children:[e.jsx(j.Toggle,{checked:a.email_enabled,onChange:s=>i("email_enabled",s)}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:"Email Confirmation"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.8125rem",opacity:.6},children:"Send order confirmation emails to customers after successful purchase."}),e.jsx("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",opacity:.5},children:"Requires Email configuration"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"1rem",padding:"1rem",border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:"0.5rem"},children:[e.jsx(j.Toggle,{checked:a.webhook_enabled,onChange:s=>i("webhook_enabled",s)}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:"Admin Purchase Notification"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.8125rem",opacity:.6},children:"Send webhook notifications to your server when a purchase is completed."}),e.jsx("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",opacity:.5},children:"Requires Webhook configuration"})]})]})]})]}),l==="email"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Configure your email provider for sending customer notifications."}),!a.email_enabled&&e.jsx("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #fef3c7)",borderRadius:"0.5rem",border:"1px solid var(--cedros-admin-warning, #f59e0b)",fontSize:"0.875rem"},children:"Email notifications are disabled. Enable them in the Messages tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",opacity:a.email_enabled?1:.5},children:[e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Host"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.smtp_host,onChange:s=>i("smtp_host",s.target.value),placeholder:"smtp.example.com",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Port"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.smtp_port,onChange:s=>i("smtp_port",parseInt(s.target.value)||587),placeholder:"587",disabled:!a.email_enabled,style:{maxWidth:120}})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Username"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.smtp_username,onChange:s=>i("smtp_username",s.target.value),placeholder:"username or API key",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Password"}),e.jsx("input",{type:"password",className:"cedros-admin__input",value:m.has("smtp_password")?a.smtp_password:"",onChange:s=>i("smtp_password",s.target.value),placeholder:a.smtp_password?"••••••••":"Enter password",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"From Email"}),e.jsx("input",{type:"email",className:"cedros-admin__input",value:a.from_email,onChange:s=>i("from_email",s.target.value),placeholder:"orders@yourstore.com",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"From Name"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.from_name,onChange:s=>i("from_name",s.target.value),placeholder:"Your Store",disabled:!a.email_enabled})]})]})]}),l==="webhooks"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Configure webhook endpoint for receiving purchase notifications."}),!a.webhook_enabled&&e.jsx("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #fef3c7)",borderRadius:"0.5rem",border:"1px solid var(--cedros-admin-warning, #f59e0b)",fontSize:"0.875rem"},children:"Webhook notifications are disabled. Enable them in the Messages tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",opacity:a.webhook_enabled?1:.5},children:[e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Webhook URL"}),e.jsx("input",{type:"url",className:"cedros-admin__input",value:a.webhook_url,onChange:s=>i("webhook_url",s.target.value),placeholder:"https://api.yoursite.com/webhooks/orders",disabled:!a.webhook_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Webhook Secret"}),e.jsx("input",{type:"password",className:"cedros-admin__input",value:m.has("webhook_secret")?a.webhook_secret:"",onChange:s=>i("webhook_secret",s.target.value),placeholder:a.webhook_secret?"••••••••":"Enter secret for HMAC-SHA256",disabled:!a.webhook_enabled}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.75rem",opacity:.6},children:"Used for HMAC-SHA256 signature verification"})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Timeout (seconds)"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.webhook_timeout,onChange:s=>i("webhook_timeout",parseInt(s.target.value)||30),placeholder:"30",disabled:!a.webhook_enabled,style:{maxWidth:120}})]})]})]})]})]})}exports.MessagingSection=W;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useCallback as w, useEffect as W } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { I as z, E as M } from "./index-75RhiLDq.mjs";
|
|
4
4
|
import { T as N } from "./Toggle-DAxIdpY4.mjs";
|
|
5
|
-
import { u as
|
|
6
|
-
import { A as F } from "./AutosaveIndicator-
|
|
5
|
+
import { u as $ } from "./useAutosave-YwMqRzqy.mjs";
|
|
6
|
+
import { A as F } from "./AutosaveIndicator-DTOaopUP.mjs";
|
|
7
7
|
const g = {
|
|
8
8
|
email_enabled: !1,
|
|
9
9
|
smtp_host: "",
|
|
@@ -58,7 +58,7 @@ function U({ serverUrl: _, apiKey: n, authManager: r }) {
|
|
|
58
58
|
} catch {
|
|
59
59
|
throw f("Failed to save messaging settings"), new Error("Save failed");
|
|
60
60
|
}
|
|
61
|
-
}, [_, n, r, h]), { status: I, error: P } =
|
|
61
|
+
}, [_, n, r, h]), { status: I, error: P } = $({
|
|
62
62
|
data: s,
|
|
63
63
|
onSave: A,
|
|
64
64
|
debounceMs: 1500,
|
|
@@ -111,7 +111,7 @@ function U({ serverUrl: _, apiKey: n, authManager: r }) {
|
|
|
111
111
|
/* @__PURE__ */ e("div", { style: { flex: 1 } }),
|
|
112
112
|
/* @__PURE__ */ e(F, { status: I, error: P })
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */ e(
|
|
114
|
+
/* @__PURE__ */ e(M, { message: E, onRetry: u }),
|
|
115
115
|
/* @__PURE__ */ i("div", { className: "cedros-admin__tab-content", style: { marginTop: "1rem" }, children: [
|
|
116
116
|
l === "messages" && /* @__PURE__ */ i("div", { className: "cedros-admin__section", children: [
|
|
117
117
|
/* @__PURE__ */ e("p", { style: { marginBottom: "1.5rem", fontSize: "0.875rem", opacity: 0.7 }, children: "Enable or disable notification types. Configure the delivery settings in the Email or Webhooks tab." }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),p=require("./SingleCategorySettings-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),p=require("./SingleCategorySettings-BTXR7zex.js");function r({href:s,children:n}){return e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:n})}const a=[{id:"stripe",label:"Stripe",category:"stripe",description:e.jsxs(e.Fragment,{children:["Configure your Stripe integration for card payments. Get your API keys from the"," ",e.jsx(r,{href:"https://dashboard.stripe.com/apikeys",children:"Stripe Dashboard"}),"."]})},{id:"crypto",label:"Crypto",category:"x402",description:e.jsxs(e.Fragment,{children:["Configure Solana wallet and token settings for crypto payments. Get a fast RPC endpoint from"," ",e.jsx(r,{href:"https://www.helius.dev",children:"Helius"})," or"," ",e.jsx(r,{href:"https://www.quicknode.com/chains/sol",children:"QuickNode"}),". Set up a payment address using"," ",e.jsx(r,{href:"https://phantom.app",children:"Phantom"})," or"," ",e.jsx(r,{href:"https://solflare.com",children:"Solflare"})," wallet."]})},{id:"credits",label:"Credits",category:"cedros_login",description:e.jsxs(e.Fragment,{children:["Configure Cedros Login integration for credits payments. See the"," ",e.jsx(r,{href:"https://docs.cedros.dev/credits",children:"Credits API documentation"}),"."]})}];function h({serverUrl:s,apiKey:n,authManager:c}){const[o,d]=l.useState("stripe"),i=a.find(t=>t.id===o);return e.jsxs("div",{className:"cedros-admin__payment-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Payment Options"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure payment methods including Stripe, crypto, and credits."})]}),e.jsx("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:a.map(t=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${o===t.id?"cedros-admin__tab--active":""}`,onClick:()=>d(t.id),children:t.label},t.id))}),e.jsx("div",{style:{marginTop:"1rem"},children:e.jsx(p.SingleCategorySettings,{serverUrl:s,apiKey:n,authManager:c,category:i.category,title:`${i.label} Settings`,description:i.description,showEnabledToggle:!0},i.category)})]})}exports.PaymentSettingsSection=h;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e, Fragment as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as h } from "react";
|
|
3
|
-
import { S as m } from "./SingleCategorySettings-
|
|
3
|
+
import { S as m } from "./SingleCategorySettings-Cwlehl0u.mjs";
|
|
4
4
|
function r({ href: o, children: a }) {
|
|
5
5
|
return /* @__PURE__ */ e(
|
|
6
6
|
"a",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),g=require("./SingleCategorySettings-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),g=require("./SingleCategorySettings-BTXR7zex.js"),n=[{id:"logging",label:"Logging",category:"logging",description:"Configure log levels, format, and environment settings."},{id:"metrics",label:"Metrics",category:"metrics",description:"Configure metrics collection and API access for monitoring."},{id:"security",label:"Security",category:"security",description:"Configure CORS, rate limiting, and other security settings."}];function l({serverUrl:r,apiKey:c,authManager:o}){const[s,a]=d.useState("logging"),t=n.find(i=>i.id===s);return e.jsxs("div",{className:"cedros-admin__server-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Server"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure logging, metrics, and security settings."})]}),e.jsx("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:n.map(i=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${s===i.id?"cedros-admin__tab--active":""}`,onClick:()=>a(i.id),children:i.label},i.id))}),e.jsx("div",{style:{marginTop:"1rem"},children:e.jsx(g.SingleCategorySettings,{serverUrl:r,apiKey:c,authManager:o,category:t.category,title:`${t.label} Settings`,description:t.description},t.category)})]})}exports.SettingsSection=l;
|