@cedros/pay-react 1.1.18 → 1.1.21
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/README.md +2 -0
- package/dist/{AISettingsSection-CD9IRyR1.mjs → AISettingsSection-8eDaxYp8.mjs} +10 -10
- package/dist/{AISettingsSection-C-thWh51.js → AISettingsSection-BXWZcMQT.js} +1 -1
- package/dist/{AutosaveIndicator-G2CRN8hH.mjs → AutosaveIndicator-3S7EvXip.mjs} +1 -1
- package/dist/{AutosaveIndicator-DxemlKnX.js → AutosaveIndicator-DW4IPbZ5.js} +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-Dg-I7Z-N.mjs} +4 -4
- package/dist/{FAQSection-_pm1ekTe.js → FAQSection-r6eKjfdO.js} +1 -1
- package/dist/MessagingSection-Cld5Q7ZM.js +1 -0
- package/dist/{MessagingSection-DO2yPTvs.mjs → MessagingSection-D39EuOLN.mjs} +143 -96
- package/dist/{PaymentSettingsSection-DpENgoca.js → PaymentSettingsSection-B-MRsh1K.js} +1 -1
- package/dist/{PaymentSettingsSection--Aqlne1F.mjs → PaymentSettingsSection-CEGHN6VI.mjs} +1 -1
- package/dist/{SettingsSection-CGKKGXWz.mjs → SettingsSection-CPFOuoZG.mjs} +1 -1
- package/dist/{SettingsSection-DNoODw7i.js → SettingsSection-ZrzfLBlS.js} +1 -1
- package/dist/{SingleCategorySettings-8DCtLcow.mjs → SingleCategorySettings-DhHGIGwB.mjs} +102 -105
- package/dist/SingleCategorySettings-DxjCafCk.js +3 -0
- package/dist/{StorefrontSection-BEOMtSAg.js → StorefrontSection-DGVcJu1T.js} +1 -1
- package/dist/{StorefrontSection-Mzr1H51w.mjs → StorefrontSection-f54ySA6i.mjs} +8 -8
- package/dist/{SubscriptionsSection-Dy1e15fe.mjs → SubscriptionsSection-F2IiU2jv.mjs} +6 -6
- package/dist/{SubscriptionsSection-4b29i-41.js → SubscriptionsSection-fzbL5DGC.js} +1 -1
- 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 +169 -165
- package/dist/index-7YUxR4u5.js +84 -0
- package/dist/{index-bbSf3B7-.mjs → index-bqhsxBTY.mjs} +8824 -11397
- package/dist/index.d.ts +2 -45
- package/dist/index.js +1 -1
- package/dist/index.mjs +65 -61
- package/dist/pay-react.css +1 -1
- package/dist/sections-CiAMjlPd.mjs +8 -0
- package/dist/sections-Dh0qFSUW.js +1 -0
- package/dist/{admin → src/admin}/index.d.ts +2 -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/sectionIds.d.ts +43 -0
- package/dist/src/admin/sectionIds.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/emailProviders.d.ts +18 -0
- package/dist/src/components/admin/emailProviders.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/MessagingSection-BHzf1Mhu.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}/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,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as K } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as ne, createContext as pe, useState as N, useRef as ge, useEffect as I, useMemo as ee } from "react";
|
|
3
3
|
import { g as S } from "./uuid-_z3jSatJ.mjs";
|
|
4
4
|
var we = "https://js.stripe.com/v3", qe = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
5
5
|
var je = function() {
|
|
@@ -26,11 +26,11 @@ var je = function() {
|
|
|
26
26
|
return function() {
|
|
27
27
|
e(new Error("Failed to load Stripe.js"));
|
|
28
28
|
};
|
|
29
|
-
},
|
|
29
|
+
}, We = function(e, r) {
|
|
30
30
|
return function() {
|
|
31
31
|
window.Stripe ? e(window.Stripe) : r(new Error("Stripe.js not available"));
|
|
32
32
|
};
|
|
33
|
-
},
|
|
33
|
+
}, Ke = function(e) {
|
|
34
34
|
return H !== null ? H : (H = new Promise(function(r, a) {
|
|
35
35
|
if (typeof window > "u" || typeof document > "u") {
|
|
36
36
|
r(null);
|
|
@@ -50,7 +50,7 @@ var je = function() {
|
|
|
50
50
|
n.removeEventListener("load", Q), n.removeEventListener("error", z), (i = n.parentNode) === null || i === void 0 || i.removeChild(n), n = ce(e);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
Q =
|
|
53
|
+
Q = We(r, a), z = Qe(a), n.addEventListener("load", Q), n.addEventListener("error", z);
|
|
54
54
|
} catch (o) {
|
|
55
55
|
a(o);
|
|
56
56
|
return;
|
|
@@ -64,7 +64,7 @@ var je = function() {
|
|
|
64
64
|
var n = e.apply(void 0, r);
|
|
65
65
|
return ze(n, a), n;
|
|
66
66
|
}, L, be = !1, ve = function() {
|
|
67
|
-
return L || (L =
|
|
67
|
+
return L || (L = Ke(null).catch(function(e) {
|
|
68
68
|
return L = null, Promise.reject(e);
|
|
69
69
|
}), L);
|
|
70
70
|
};
|
|
@@ -137,7 +137,7 @@ class Ee {
|
|
|
137
137
|
}
|
|
138
138
|
const Je = () => typeof process < "u" && process.env.NODE_ENV === "development" ? 0 : 2;
|
|
139
139
|
let V = null;
|
|
140
|
-
function
|
|
140
|
+
function l() {
|
|
141
141
|
return V || (V = new Ee({
|
|
142
142
|
level: Je(),
|
|
143
143
|
prefix: "[CedrosPay]"
|
|
@@ -149,7 +149,7 @@ function Ye(t) {
|
|
|
149
149
|
function Xe(t) {
|
|
150
150
|
return new Ee(t);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function k(t, e) {
|
|
153
153
|
return t instanceof Error ? t.message : typeof t == "string" ? t : e;
|
|
154
154
|
}
|
|
155
155
|
const Ze = {
|
|
@@ -167,7 +167,7 @@ async function g(t, e, r = !1) {
|
|
|
167
167
|
try {
|
|
168
168
|
const i = await t.json();
|
|
169
169
|
if (r && i.verificationError) {
|
|
170
|
-
|
|
170
|
+
l().debug(`Payment verification failed: ${i.verificationError.code}`);
|
|
171
171
|
const o = i.verificationError.code;
|
|
172
172
|
return Ze[o] || i.verificationError.message || e;
|
|
173
173
|
}
|
|
@@ -189,7 +189,7 @@ async function g(t, e, r = !1) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
const $e = 15e3;
|
|
192
|
-
async function
|
|
192
|
+
async function A(t, e = {}, r = $e) {
|
|
193
193
|
const a = new AbortController(), n = e.signal;
|
|
194
194
|
if (n?.aborted)
|
|
195
195
|
throw a.abort(), new DOMException("The operation was aborted", "AbortError");
|
|
@@ -221,7 +221,7 @@ function R(t) {
|
|
|
221
221
|
function s() {
|
|
222
222
|
return o(), a >= 1 ? (a -= 1, !0) : !1;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function c() {
|
|
225
225
|
return o(), Math.floor(a);
|
|
226
226
|
}
|
|
227
227
|
function d() {
|
|
@@ -235,7 +235,7 @@ function R(t) {
|
|
|
235
235
|
}
|
|
236
236
|
return {
|
|
237
237
|
tryConsume: s,
|
|
238
|
-
getAvailableTokens:
|
|
238
|
+
getAvailableTokens: c,
|
|
239
239
|
getTimeUntilRefill: d,
|
|
240
240
|
reset: m
|
|
241
241
|
};
|
|
@@ -251,40 +251,40 @@ const M = {
|
|
|
251
251
|
PERMISSIVE: { maxRequests: 100, windowMs: 6e4 }
|
|
252
252
|
};
|
|
253
253
|
var et = /* @__PURE__ */ ((t) => (t.CLOSED = "CLOSED", t.OPEN = "OPEN", t.HALF_OPEN = "HALF_OPEN", t))(et || {});
|
|
254
|
-
class
|
|
254
|
+
class p extends Error {
|
|
255
255
|
constructor(e) {
|
|
256
256
|
super(e), this.name = "CircuitBreakerOpenError";
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
function j(t) {
|
|
260
260
|
const { failureThreshold: e, timeout: r, failureWindow: a = r * 2, name: n = "circuit-breaker" } = t;
|
|
261
|
-
let i = "CLOSED", o = [], s = 0,
|
|
261
|
+
let i = "CLOSED", o = [], s = 0, c = 0, d = null, m = null, u = null, y = !1;
|
|
262
262
|
function f() {
|
|
263
263
|
const _ = Date.now() - a;
|
|
264
264
|
o = o.filter((P) => P > _);
|
|
265
265
|
}
|
|
266
266
|
function h() {
|
|
267
|
-
i === "OPEN" && u !== null && Date.now() >= u && (
|
|
267
|
+
i === "OPEN" && u !== null && Date.now() >= u && (l().debug(`[CircuitBreaker:${n}] Transitioning OPEN → HALF_OPEN (timeout expired)`), i = "HALF_OPEN", u = null);
|
|
268
268
|
}
|
|
269
269
|
function w() {
|
|
270
|
-
m = Date.now(), s++, i === "HALF_OPEN" ? (
|
|
270
|
+
m = Date.now(), s++, i === "HALF_OPEN" ? (l().debug(`[CircuitBreaker:${n}] Success in HALF_OPEN → CLOSED`), i = "CLOSED", o = []) : i === "CLOSED" && (o = []);
|
|
271
271
|
}
|
|
272
272
|
function C(_) {
|
|
273
273
|
const P = Date.now();
|
|
274
274
|
d = P, o.push(P), f();
|
|
275
275
|
const Y = o.length;
|
|
276
|
-
|
|
276
|
+
l().warn(`[CircuitBreaker:${n}] Failure recorded (${Y}/${e}):`, _.message), i === "HALF_OPEN" ? (l().warn(`[CircuitBreaker:${n}] Failed in HALF_OPEN → OPEN`), i = "OPEN", u = P + r) : i === "CLOSED" && Y >= e && (l().error(`[CircuitBreaker:${n}] Failure threshold reached (${Y}) → OPEN`), i = "OPEN", u = P + r);
|
|
277
277
|
}
|
|
278
278
|
async function x(_) {
|
|
279
279
|
if (h(), i === "OPEN") {
|
|
280
|
-
|
|
280
|
+
c++;
|
|
281
281
|
const P = u ? Math.ceil((u - Date.now()) / 1e3) : 0;
|
|
282
|
-
throw new
|
|
282
|
+
throw new p(
|
|
283
283
|
`Circuit breaker is OPEN. Service is unavailable. Retry in ${P}s.`
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
286
|
if (i === "HALF_OPEN" && y)
|
|
287
|
-
throw
|
|
287
|
+
throw c++, new p(
|
|
288
288
|
"Circuit breaker is HALF_OPEN. A probe request is already in progress."
|
|
289
289
|
);
|
|
290
290
|
i === "HALF_OPEN" && (y = !0);
|
|
@@ -300,31 +300,31 @@ function j(t) {
|
|
|
300
300
|
function B() {
|
|
301
301
|
return h(), i;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function T() {
|
|
304
304
|
return h(), f(), {
|
|
305
305
|
state: i,
|
|
306
306
|
failures: o.length,
|
|
307
307
|
successes: s,
|
|
308
|
-
rejections:
|
|
308
|
+
rejections: c,
|
|
309
309
|
lastFailureTime: d,
|
|
310
310
|
lastSuccessTime: m
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
313
|
function D() {
|
|
314
|
-
|
|
314
|
+
l().debug(`[CircuitBreaker:${n}] Manual reset → CLOSED`), i = "CLOSED", o = [], s = 0, c = 0, d = null, m = null, u = null;
|
|
315
315
|
}
|
|
316
316
|
function Le() {
|
|
317
|
-
|
|
317
|
+
l().warn(`[CircuitBreaker:${n}] Manual trip → OPEN`), i = "OPEN", u = Date.now() + r;
|
|
318
318
|
}
|
|
319
319
|
return {
|
|
320
320
|
execute: x,
|
|
321
321
|
getState: B,
|
|
322
|
-
getStats:
|
|
322
|
+
getStats: T,
|
|
323
323
|
reset: D,
|
|
324
324
|
trip: Le
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
const
|
|
327
|
+
const Qt = {
|
|
328
328
|
/** Strict: Opens quickly (3 failures), long timeout (60s) */
|
|
329
329
|
STRICT: { failureThreshold: 3, timeout: 6e4 },
|
|
330
330
|
/** Standard: Balanced settings (5 failures, 30s timeout) */
|
|
@@ -771,25 +771,25 @@ async function b(t, e = {}) {
|
|
|
771
771
|
maxDelayMs: i = 3e4,
|
|
772
772
|
jitter: o = !0,
|
|
773
773
|
shouldRetry: s = nt,
|
|
774
|
-
name:
|
|
774
|
+
name: c = "retry"
|
|
775
775
|
} = e;
|
|
776
776
|
let d = null, m = 0;
|
|
777
777
|
for (let u = 0; u <= r; u++)
|
|
778
778
|
try {
|
|
779
779
|
const y = await t();
|
|
780
|
-
return u > 0 &&
|
|
781
|
-
`[Retry:${
|
|
780
|
+
return u > 0 && l().debug(
|
|
781
|
+
`[Retry:${c}] Succeeded on attempt ${u + 1}/${r + 1} after ${m}ms`
|
|
782
782
|
), y;
|
|
783
783
|
} catch (y) {
|
|
784
784
|
d = y instanceof Error ? y : new Error(String(y));
|
|
785
785
|
const f = u === r, h = s(d, u);
|
|
786
786
|
if (f || !h)
|
|
787
|
-
throw
|
|
788
|
-
`[Retry:${
|
|
787
|
+
throw l().warn(
|
|
788
|
+
`[Retry:${c}] Failed on attempt ${u + 1}/${r + 1}. ${f ? "No more retries." : "Error not retryable."}`
|
|
789
789
|
), d;
|
|
790
790
|
const w = it(u, a, n, i, o);
|
|
791
|
-
m += w,
|
|
792
|
-
`[Retry:${
|
|
791
|
+
m += w, l().warn(
|
|
792
|
+
`[Retry:${c}] Attempt ${u + 1}/${r + 1} failed: ${d.message}. Retrying in ${w}ms...`
|
|
793
793
|
), await ot(w);
|
|
794
794
|
}
|
|
795
795
|
throw d || new Error("Retry failed with no error");
|
|
@@ -864,13 +864,13 @@ class st {
|
|
|
864
864
|
return await this.circuitBreaker.execute(async () => await b(
|
|
865
865
|
async () => {
|
|
866
866
|
const a = await this.routeDiscovery.buildUrl("/paywall/v1/stripe-session");
|
|
867
|
-
|
|
867
|
+
l().debug("[StripeManager] Creating session", {
|
|
868
868
|
resource: e.resource,
|
|
869
869
|
hasCouponCode: !!e.couponCode,
|
|
870
870
|
hasMetadata: !!(e.metadata && Object.keys(e.metadata).length),
|
|
871
871
|
metadataKeyCount: e.metadata ? Object.keys(e.metadata).length : 0
|
|
872
872
|
});
|
|
873
|
-
const n = await
|
|
873
|
+
const n = await A(a, {
|
|
874
874
|
method: "POST",
|
|
875
875
|
headers: {
|
|
876
876
|
"Content-Type": "application/json",
|
|
@@ -887,7 +887,7 @@ class st {
|
|
|
887
887
|
{ ...E.STANDARD, name: "stripe-create-session" }
|
|
888
888
|
));
|
|
889
889
|
} catch (a) {
|
|
890
|
-
throw a instanceof
|
|
890
|
+
throw a instanceof p ? (l().error("[StripeManager] Circuit breaker is OPEN - Stripe service unavailable"), new Error("Stripe payment service is temporarily unavailable. Please try again in a few moments.")) : a;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
/**
|
|
@@ -915,7 +915,7 @@ class st {
|
|
|
915
915
|
} catch (r) {
|
|
916
916
|
return {
|
|
917
917
|
success: !1,
|
|
918
|
-
error:
|
|
918
|
+
error: k(r, "Unknown error")
|
|
919
919
|
};
|
|
920
920
|
}
|
|
921
921
|
}
|
|
@@ -930,7 +930,7 @@ class st {
|
|
|
930
930
|
metadata: i,
|
|
931
931
|
customerEmail: o,
|
|
932
932
|
customerName: s,
|
|
933
|
-
customerPhone:
|
|
933
|
+
customerPhone: c,
|
|
934
934
|
shippingAddress: d,
|
|
935
935
|
billingAddress: m,
|
|
936
936
|
couponCode: u,
|
|
@@ -947,7 +947,7 @@ class st {
|
|
|
947
947
|
try {
|
|
948
948
|
const C = await this.circuitBreaker.execute(async () => await b(
|
|
949
949
|
async () => {
|
|
950
|
-
const x = await this.routeDiscovery.buildUrl("/paywall/v1/cart/checkout"),
|
|
950
|
+
const x = await this.routeDiscovery.buildUrl("/paywall/v1/cart/checkout"), T = await A(x, {
|
|
951
951
|
method: "POST",
|
|
952
952
|
headers: {
|
|
953
953
|
"Content-Type": "application/json",
|
|
@@ -960,7 +960,7 @@ class st {
|
|
|
960
960
|
metadata: i,
|
|
961
961
|
customerEmail: o,
|
|
962
962
|
customerName: s,
|
|
963
|
-
customerPhone:
|
|
963
|
+
customerPhone: c,
|
|
964
964
|
shippingAddress: d,
|
|
965
965
|
billingAddress: m,
|
|
966
966
|
coupon: u,
|
|
@@ -972,30 +972,30 @@ class st {
|
|
|
972
972
|
paymentMethodId: h
|
|
973
973
|
})
|
|
974
974
|
});
|
|
975
|
-
if (!
|
|
976
|
-
const D = await g(
|
|
975
|
+
if (!T.ok) {
|
|
976
|
+
const D = await g(T, "Failed to create cart checkout session");
|
|
977
977
|
throw new Error(D);
|
|
978
978
|
}
|
|
979
|
-
return await
|
|
979
|
+
return await T.json();
|
|
980
980
|
},
|
|
981
981
|
{ ...E.STANDARD, name: "stripe-cart-checkout" }
|
|
982
982
|
));
|
|
983
983
|
return await this.redirectToCheckout(C.sessionId);
|
|
984
984
|
} catch (C) {
|
|
985
|
-
return C instanceof
|
|
985
|
+
return C instanceof p ? {
|
|
986
986
|
success: !1,
|
|
987
987
|
error: "Stripe payment service is temporarily unavailable. Please try again in a few moments."
|
|
988
988
|
} : {
|
|
989
989
|
success: !1,
|
|
990
|
-
error:
|
|
990
|
+
error: k(C, "Cart checkout failed")
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDecoder == "function" ? new TextDecoder() : void 0, ue = typeof TextEncoder == "function" ? new TextEncoder() : void 0, lt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", q = Array.prototype.slice.call(lt),
|
|
995
|
+
const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDecoder == "function" ? new TextDecoder() : void 0, ue = typeof TextEncoder == "function" ? new TextEncoder() : void 0, lt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", q = Array.prototype.slice.call(lt), W = ((t) => {
|
|
996
996
|
let e = {};
|
|
997
997
|
return t.forEach((r, a) => e[r] = a), e;
|
|
998
|
-
})(q), ut = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, v = String.fromCharCode.bind(String), de = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), Se = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), xe = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""),
|
|
998
|
+
})(q), ut = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, v = String.fromCharCode.bind(String), de = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), Se = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), xe = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""), Te = (t) => {
|
|
999
999
|
let e, r, a, n, i = "";
|
|
1000
1000
|
const o = t.length % 3;
|
|
1001
1001
|
for (let s = 0; s < t.length; ) {
|
|
@@ -1004,7 +1004,7 @@ const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDe
|
|
|
1004
1004
|
e = r << 16 | a << 8 | n, i += q[e >> 18 & 63] + q[e >> 12 & 63] + q[e >> 6 & 63] + q[e & 63];
|
|
1005
1005
|
}
|
|
1006
1006
|
return o ? i.slice(0, o - 3) + "===".substring(o) : i;
|
|
1007
|
-
}, ie = typeof btoa == "function" ? (t) => btoa(t) : F ? (t) => Buffer.from(t, "binary").toString("base64") :
|
|
1007
|
+
}, ie = typeof btoa == "function" ? (t) => btoa(t) : F ? (t) => Buffer.from(t, "binary").toString("base64") : Te, te = F ? (t) => Buffer.from(t).toString("base64") : (t) => {
|
|
1008
1008
|
let r = [];
|
|
1009
1009
|
for (let a = 0, n = t.length; a < n; a += 4096)
|
|
1010
1010
|
r.push(v.apply(null, t.subarray(a, a + 4096)));
|
|
@@ -1017,7 +1017,7 @@ const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDe
|
|
|
1017
1017
|
var e = 65536 + (t.charCodeAt(0) - 55296) * 1024 + (t.charCodeAt(1) - 56320);
|
|
1018
1018
|
return v(240 | e >>> 18 & 7) + v(128 | e >>> 12 & 63) + v(128 | e >>> 6 & 63) + v(128 | e & 63);
|
|
1019
1019
|
}
|
|
1020
|
-
}, ft = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,
|
|
1020
|
+
}, ft = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, ke = (t) => t.replace(ft, dt), fe = F ? (t) => Buffer.from(t, "utf8").toString("base64") : ue ? (t) => te(ue.encode(t)) : (t) => ie(ke(t)), U = (t, e = !1) => e ? Se(fe(t)) : fe(t), he = (t) => U(t, !0), ht = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, mt = (t) => {
|
|
1021
1021
|
switch (t.length) {
|
|
1022
1022
|
case 4:
|
|
1023
1023
|
var e = (7 & t.charCodeAt(0)) << 18 | (63 & t.charCodeAt(1)) << 12 | (63 & t.charCodeAt(2)) << 6 | 63 & t.charCodeAt(3), r = e - 65536;
|
|
@@ -1033,9 +1033,9 @@ const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDe
|
|
|
1033
1033
|
t += "==".slice(2 - (t.length & 3));
|
|
1034
1034
|
let e, r, a, n = [];
|
|
1035
1035
|
for (let i = 0; i < t.length; )
|
|
1036
|
-
e =
|
|
1036
|
+
e = W[t.charAt(i++)] << 18 | W[t.charAt(i++)] << 12 | (r = W[t.charAt(i++)]) << 6 | (a = W[t.charAt(i++)]), r === 64 ? n.push(v(e >> 16 & 255)) : a === 64 ? n.push(v(e >> 16 & 255, e >> 8 & 255)) : n.push(v(e >> 16 & 255, e >> 8 & 255, e & 255));
|
|
1037
1037
|
return n.join("");
|
|
1038
|
-
}, oe = typeof atob == "function" ? (t) => atob(xe(t)) : F ? (t) => Buffer.from(t, "base64").toString("binary") : Me, De = F ? (t) => de(Buffer.from(t, "base64")) : (t) => de(oe(t).split("").map((e) => e.charCodeAt(0))), Oe = (t) => De(Be(t)), yt = F ? (t) => Buffer.from(t, "base64").toString("utf8") : le ? (t) => le.decode(De(t)) : (t) => Re(oe(t)), Be = (t) => xe(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), re = (t) => yt(Be(t)),
|
|
1038
|
+
}, oe = typeof atob == "function" ? (t) => atob(xe(t)) : F ? (t) => Buffer.from(t, "base64").toString("binary") : Me, De = F ? (t) => de(Buffer.from(t, "base64")) : (t) => de(oe(t).split("").map((e) => e.charCodeAt(0))), Oe = (t) => De(Be(t)), yt = F ? (t) => Buffer.from(t, "base64").toString("utf8") : le ? (t) => le.decode(De(t)) : (t) => Re(oe(t)), Be = (t) => xe(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), re = (t) => yt(Be(t)), At = (t) => {
|
|
1039
1039
|
if (typeof t != "string")
|
|
1040
1040
|
return !1;
|
|
1041
1041
|
const e = t.replace(/\s+/g, "").replace(/={0,2}$/, "");
|
|
@@ -1067,7 +1067,7 @@ const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDe
|
|
|
1067
1067
|
}), t("toBase64URL", function() {
|
|
1068
1068
|
return G(this, !0);
|
|
1069
1069
|
});
|
|
1070
|
-
},
|
|
1070
|
+
}, pt = () => {
|
|
1071
1071
|
Ie(), Ne();
|
|
1072
1072
|
}, me = {
|
|
1073
1073
|
version: Pe,
|
|
@@ -1075,21 +1075,21 @@ const Pe = "3.7.8", ct = Pe, F = typeof Buffer == "function", le = typeof TextDe
|
|
|
1075
1075
|
atob: oe,
|
|
1076
1076
|
atobPolyfill: Me,
|
|
1077
1077
|
btoa: ie,
|
|
1078
|
-
btoaPolyfill:
|
|
1078
|
+
btoaPolyfill: Te,
|
|
1079
1079
|
fromBase64: re,
|
|
1080
1080
|
toBase64: U,
|
|
1081
1081
|
encode: U,
|
|
1082
1082
|
encodeURI: he,
|
|
1083
1083
|
encodeURL: he,
|
|
1084
|
-
utob:
|
|
1084
|
+
utob: ke,
|
|
1085
1085
|
btou: Re,
|
|
1086
1086
|
decode: re,
|
|
1087
|
-
isValid:
|
|
1087
|
+
isValid: At,
|
|
1088
1088
|
fromUint8Array: G,
|
|
1089
1089
|
toUint8Array: Oe,
|
|
1090
1090
|
extendString: Ie,
|
|
1091
1091
|
extendUint8Array: Ne,
|
|
1092
|
-
extendBuiltins:
|
|
1092
|
+
extendBuiltins: pt
|
|
1093
1093
|
};
|
|
1094
1094
|
class gt {
|
|
1095
1095
|
routeDiscovery;
|
|
@@ -1117,11 +1117,11 @@ class gt {
|
|
|
1117
1117
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1118
1118
|
async () => {
|
|
1119
1119
|
const n = "/paywall/v1/quote";
|
|
1120
|
-
|
|
1120
|
+
l().debug(
|
|
1121
1121
|
"[X402Manager] Requesting quote",
|
|
1122
1122
|
a ? "with coupon" : "without coupon"
|
|
1123
1123
|
);
|
|
1124
|
-
const i = await this.routeDiscovery.buildUrl(n), o = await
|
|
1124
|
+
const i = await this.routeDiscovery.buildUrl(n), o = await A(i, {
|
|
1125
1125
|
method: "POST",
|
|
1126
1126
|
headers: {
|
|
1127
1127
|
"Content-Type": "application/json"
|
|
@@ -1135,22 +1135,22 @@ class gt {
|
|
|
1135
1135
|
throw new Error(`Expected 402 status, got ${o.status}`);
|
|
1136
1136
|
const s = await o.json();
|
|
1137
1137
|
if (s.crypto) {
|
|
1138
|
-
const
|
|
1139
|
-
if (!this.validateRequirement(
|
|
1138
|
+
const c = s.crypto;
|
|
1139
|
+
if (!this.validateRequirement(c))
|
|
1140
1140
|
throw new Error("Invalid x402 requirement received from server: missing required fields");
|
|
1141
|
-
return
|
|
1141
|
+
return c;
|
|
1142
1142
|
} else if (s.accepts && s.accepts.length > 0) {
|
|
1143
|
-
const
|
|
1144
|
-
if (!this.validateRequirement(
|
|
1143
|
+
const c = s.accepts[0];
|
|
1144
|
+
if (!this.validateRequirement(c))
|
|
1145
1145
|
throw new Error("Invalid x402 requirement received from server: missing required fields");
|
|
1146
|
-
return
|
|
1146
|
+
return c;
|
|
1147
1147
|
} else
|
|
1148
1148
|
throw new Error("Invalid x402 response: missing crypto or accepts field");
|
|
1149
1149
|
},
|
|
1150
1150
|
{ ...E.QUICK, name: "x402-quote" }
|
|
1151
1151
|
));
|
|
1152
1152
|
} catch (n) {
|
|
1153
|
-
throw n instanceof
|
|
1153
|
+
throw n instanceof p ? (l().error("[X402Manager] Circuit breaker is OPEN - x402 service unavailable"), new Error("Payment service is temporarily unavailable. Please try again in a few moments.")) : n;
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
/**
|
|
@@ -1164,7 +1164,7 @@ class gt {
|
|
|
1164
1164
|
try {
|
|
1165
1165
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1166
1166
|
async () => {
|
|
1167
|
-
const o = await this.routeDiscovery.buildUrl("/paywall/v1/cart/quote"),
|
|
1167
|
+
const o = await this.routeDiscovery.buildUrl("/paywall/v1/cart/quote"), c = await A(o, {
|
|
1168
1168
|
method: "POST",
|
|
1169
1169
|
headers: {
|
|
1170
1170
|
"Content-Type": "application/json",
|
|
@@ -1179,11 +1179,11 @@ class gt {
|
|
|
1179
1179
|
// Legacy Go server field (backwards compat)
|
|
1180
1180
|
})
|
|
1181
1181
|
});
|
|
1182
|
-
if (
|
|
1183
|
-
const m = await g(
|
|
1182
|
+
if (c.status !== 402 && !c.ok) {
|
|
1183
|
+
const m = await g(c, "Failed to get cart quote");
|
|
1184
1184
|
throw new Error(m);
|
|
1185
1185
|
}
|
|
1186
|
-
const d = await
|
|
1186
|
+
const d = await c.json();
|
|
1187
1187
|
if (!d.cartId || !d.quote)
|
|
1188
1188
|
throw new Error("Invalid cart quote response: missing cartId or quote");
|
|
1189
1189
|
if (d.quote.crypto && !this.validateRequirement(d.quote.crypto))
|
|
@@ -1193,7 +1193,7 @@ class gt {
|
|
|
1193
1193
|
{ ...E.QUICK, name: "x402-cart-quote" }
|
|
1194
1194
|
));
|
|
1195
1195
|
} catch (o) {
|
|
1196
|
-
throw o instanceof
|
|
1196
|
+
throw o instanceof p ? (l().error("[X402Manager] Circuit breaker is OPEN - cart quote service unavailable"), new Error("Payment service is temporarily unavailable. Please try again in a few moments.")) : o;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
/**
|
|
@@ -1212,9 +1212,9 @@ class gt {
|
|
|
1212
1212
|
return null;
|
|
1213
1213
|
try {
|
|
1214
1214
|
const a = me.decode(r), n = JSON.parse(a);
|
|
1215
|
-
return typeof n.success != "boolean" ? (
|
|
1215
|
+
return typeof n.success != "boolean" ? (l().error("Invalid settlement response: missing success field"), null) : n;
|
|
1216
1216
|
} catch (a) {
|
|
1217
|
-
return
|
|
1217
|
+
return l().error("Failed to parse settlement response:", a), null;
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
/**
|
|
@@ -1254,12 +1254,12 @@ class gt {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
}, m = this.buildPaymentHeader(d), u = "/paywall/v1/verify";
|
|
1257
|
-
|
|
1257
|
+
l().debug("[X402Manager] Submitting payment", {
|
|
1258
1258
|
resourceType: o,
|
|
1259
1259
|
hasCoupon: !!n,
|
|
1260
1260
|
hasMetadata: !!i
|
|
1261
1261
|
});
|
|
1262
|
-
const y = await this.routeDiscovery.buildUrl(u), f = await
|
|
1262
|
+
const y = await this.routeDiscovery.buildUrl(u), f = await A(y, {
|
|
1263
1263
|
method: "POST",
|
|
1264
1264
|
headers: {
|
|
1265
1265
|
"Content-Type": "application/json",
|
|
@@ -1285,13 +1285,13 @@ class gt {
|
|
|
1285
1285
|
},
|
|
1286
1286
|
{ maxRetries: 0, initialDelayMs: 0, backoffFactor: 1, maxDelayMs: 0, name: "x402-verify" }
|
|
1287
1287
|
));
|
|
1288
|
-
} catch (
|
|
1289
|
-
return
|
|
1288
|
+
} catch (c) {
|
|
1289
|
+
return c instanceof p ? {
|
|
1290
1290
|
success: !1,
|
|
1291
1291
|
error: "Payment verification service is temporarily unavailable. Please try again in a few moments."
|
|
1292
1292
|
} : {
|
|
1293
1293
|
success: !1,
|
|
1294
|
-
error:
|
|
1294
|
+
error: k(c, "Unknown error")
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
@@ -1308,7 +1308,7 @@ class gt {
|
|
|
1308
1308
|
async () => {
|
|
1309
1309
|
const o = await this.routeDiscovery.buildUrl(
|
|
1310
1310
|
"/paywall/v1/gasless-transaction"
|
|
1311
|
-
), s = await
|
|
1311
|
+
), s = await A(o, {
|
|
1312
1312
|
method: "POST",
|
|
1313
1313
|
headers: {
|
|
1314
1314
|
"Content-Type": "application/json"
|
|
@@ -1321,15 +1321,15 @@ class gt {
|
|
|
1321
1321
|
})
|
|
1322
1322
|
});
|
|
1323
1323
|
if (!s.ok) {
|
|
1324
|
-
const
|
|
1325
|
-
throw new Error(
|
|
1324
|
+
const c = await g(s, "Failed to build gasless transaction");
|
|
1325
|
+
throw new Error(c);
|
|
1326
1326
|
}
|
|
1327
1327
|
return await s.json();
|
|
1328
1328
|
},
|
|
1329
1329
|
{ ...E.QUICK, name: "x402-gasless-build" }
|
|
1330
1330
|
));
|
|
1331
1331
|
} catch (o) {
|
|
1332
|
-
throw o instanceof
|
|
1332
|
+
throw o instanceof p ? (l().error("[X402Manager] Circuit breaker is OPEN - gasless transaction service unavailable"), new Error("Gasless transaction service is temporarily unavailable. Please try again in a few moments.")) : o;
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
1335
|
/**
|
|
@@ -1351,7 +1351,7 @@ class gt {
|
|
|
1351
1351
|
success: !1,
|
|
1352
1352
|
error: "Rate limit exceeded for gasless transaction verification. Please try again later."
|
|
1353
1353
|
};
|
|
1354
|
-
const
|
|
1354
|
+
const c = S();
|
|
1355
1355
|
try {
|
|
1356
1356
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1357
1357
|
async () => {
|
|
@@ -1371,12 +1371,12 @@ class gt {
|
|
|
1371
1371
|
...n ? { couponCode: n } : {}
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
}, u = this.buildPaymentHeader(m), f = await this.routeDiscovery.buildUrl("/paywall/v1/verify"), h = await
|
|
1374
|
+
}, u = this.buildPaymentHeader(m), f = await this.routeDiscovery.buildUrl("/paywall/v1/verify"), h = await A(f, {
|
|
1375
1375
|
method: "POST",
|
|
1376
1376
|
headers: {
|
|
1377
1377
|
"Content-Type": "application/json",
|
|
1378
1378
|
"X-PAYMENT": u,
|
|
1379
|
-
"Idempotency-Key":
|
|
1379
|
+
"Idempotency-Key": c
|
|
1380
1380
|
}
|
|
1381
1381
|
});
|
|
1382
1382
|
if (h.ok) {
|
|
@@ -1398,12 +1398,12 @@ class gt {
|
|
|
1398
1398
|
{ maxRetries: 0, initialDelayMs: 0, backoffFactor: 1, maxDelayMs: 0, name: "x402-gasless-verify" }
|
|
1399
1399
|
));
|
|
1400
1400
|
} catch (d) {
|
|
1401
|
-
return d instanceof
|
|
1401
|
+
return d instanceof p ? {
|
|
1402
1402
|
success: !1,
|
|
1403
1403
|
error: "Gasless transaction verification service is temporarily unavailable. Please try again in a few moments."
|
|
1404
1404
|
} : {
|
|
1405
1405
|
success: !1,
|
|
1406
|
-
error:
|
|
1406
|
+
error: k(d, "Unknown error")
|
|
1407
1407
|
};
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
@@ -1421,7 +1421,7 @@ class gt {
|
|
|
1421
1421
|
try {
|
|
1422
1422
|
i = (await e.json()).signature || r;
|
|
1423
1423
|
} catch (o) {
|
|
1424
|
-
|
|
1424
|
+
l().warn("Failed to parse JSON response body:", o);
|
|
1425
1425
|
}
|
|
1426
1426
|
return { settlement: a, transactionId: i };
|
|
1427
1427
|
}
|
|
@@ -1468,7 +1468,7 @@ class wt {
|
|
|
1468
1468
|
() => b(r, { ...E.STANDARD, name: a })
|
|
1469
1469
|
);
|
|
1470
1470
|
} catch (i) {
|
|
1471
|
-
throw i instanceof
|
|
1471
|
+
throw i instanceof p ? (l().error(`[SubscriptionManager] Circuit breaker OPEN for ${n}`), new Error("Service temporarily unavailable. Please try again in a few moments.")) : i;
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
1474
|
/**
|
|
@@ -1482,12 +1482,12 @@ class wt {
|
|
|
1482
1482
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1483
1483
|
async () => {
|
|
1484
1484
|
const a = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/stripe-session");
|
|
1485
|
-
|
|
1485
|
+
l().debug("[SubscriptionManager] Creating subscription session:", {
|
|
1486
1486
|
resource: e.resource,
|
|
1487
1487
|
interval: e.interval,
|
|
1488
1488
|
trialDays: e.trialDays
|
|
1489
1489
|
});
|
|
1490
|
-
const n = await
|
|
1490
|
+
const n = await A(a, {
|
|
1491
1491
|
method: "POST",
|
|
1492
1492
|
headers: {
|
|
1493
1493
|
"Content-Type": "application/json",
|
|
@@ -1507,7 +1507,7 @@ class wt {
|
|
|
1507
1507
|
{ ...E.STANDARD, name: "subscription-create-session" }
|
|
1508
1508
|
));
|
|
1509
1509
|
} catch (a) {
|
|
1510
|
-
throw a instanceof
|
|
1510
|
+
throw a instanceof p ? (l().error("[SubscriptionManager] Circuit breaker is OPEN - service unavailable"), new Error(
|
|
1511
1511
|
"Subscription service is temporarily unavailable. Please try again in a few moments."
|
|
1512
1512
|
)) : a;
|
|
1513
1513
|
}
|
|
@@ -1537,7 +1537,7 @@ class wt {
|
|
|
1537
1537
|
} catch (r) {
|
|
1538
1538
|
return {
|
|
1539
1539
|
success: !1,
|
|
1540
|
-
error:
|
|
1540
|
+
error: k(r, "Subscription failed")
|
|
1541
1541
|
};
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
@@ -1556,8 +1556,8 @@ class wt {
|
|
|
1556
1556
|
}), a = await this.routeDiscovery.buildUrl(
|
|
1557
1557
|
`/paywall/v1/subscription/status?${r.toString()}`
|
|
1558
1558
|
);
|
|
1559
|
-
|
|
1560
|
-
const n = await
|
|
1559
|
+
l().debug("[SubscriptionManager] Checking subscription status:", e);
|
|
1560
|
+
const n = await A(a, {
|
|
1561
1561
|
method: "GET",
|
|
1562
1562
|
headers: {
|
|
1563
1563
|
"Content-Type": "application/json"
|
|
@@ -1575,7 +1575,7 @@ class wt {
|
|
|
1575
1575
|
{ ...E.STANDARD, name: "subscription-status-check" }
|
|
1576
1576
|
));
|
|
1577
1577
|
} catch (r) {
|
|
1578
|
-
throw r instanceof
|
|
1578
|
+
throw r instanceof p ? (l().error("[SubscriptionManager] Circuit breaker is OPEN for status check"), new Error(
|
|
1579
1579
|
"Subscription status service is temporarily unavailable. Please try again in a few moments."
|
|
1580
1580
|
)) : r;
|
|
1581
1581
|
}
|
|
@@ -1595,8 +1595,8 @@ class wt {
|
|
|
1595
1595
|
couponCode: a?.couponCode,
|
|
1596
1596
|
intervalDays: a?.intervalDays
|
|
1597
1597
|
};
|
|
1598
|
-
|
|
1599
|
-
const o = await
|
|
1598
|
+
l().debug("[SubscriptionManager] Requesting subscription quote:", i);
|
|
1599
|
+
const o = await A(n, {
|
|
1600
1600
|
method: "POST",
|
|
1601
1601
|
headers: {
|
|
1602
1602
|
"Content-Type": "application/json"
|
|
@@ -1615,7 +1615,7 @@ class wt {
|
|
|
1615
1615
|
{ ...E.STANDARD, name: "subscription-quote" }
|
|
1616
1616
|
));
|
|
1617
1617
|
} catch (n) {
|
|
1618
|
-
throw n instanceof
|
|
1618
|
+
throw n instanceof p ? (l().error("[SubscriptionManager] Circuit breaker is OPEN for quote"), new Error(
|
|
1619
1619
|
"Subscription quote service is temporarily unavailable. Please try again in a few moments."
|
|
1620
1620
|
)) : n;
|
|
1621
1621
|
}
|
|
@@ -1626,8 +1626,8 @@ class wt {
|
|
|
1626
1626
|
this.sessionRateLimiter,
|
|
1627
1627
|
async () => {
|
|
1628
1628
|
const r = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/x402/activate");
|
|
1629
|
-
|
|
1630
|
-
const a = await
|
|
1629
|
+
l().debug("[SubscriptionManager] Activating x402 subscription:", e);
|
|
1630
|
+
const a = await A(r, {
|
|
1631
1631
|
method: "POST",
|
|
1632
1632
|
headers: { "Content-Type": "application/json" },
|
|
1633
1633
|
body: JSON.stringify(e)
|
|
@@ -1661,7 +1661,7 @@ class bt {
|
|
|
1661
1661
|
() => b(r, { ...E.STANDARD, name: a })
|
|
1662
1662
|
);
|
|
1663
1663
|
} catch (i) {
|
|
1664
|
-
throw i instanceof
|
|
1664
|
+
throw i instanceof p ? (l().error(`[SubscriptionChangeManager] Circuit breaker OPEN for ${n}`), new Error("Service temporarily unavailable. Please try again in a few moments.")) : i;
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
/** Change subscription plan (upgrade or downgrade) */
|
|
@@ -1671,8 +1671,8 @@ class bt {
|
|
|
1671
1671
|
this.rateLimiter,
|
|
1672
1672
|
async () => {
|
|
1673
1673
|
const a = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/change");
|
|
1674
|
-
|
|
1675
|
-
const n = await
|
|
1674
|
+
l().debug("[SubscriptionChangeManager] Changing subscription:", e);
|
|
1675
|
+
const n = await A(a, {
|
|
1676
1676
|
method: "POST",
|
|
1677
1677
|
headers: { "Content-Type": "application/json", "Idempotency-Key": r },
|
|
1678
1678
|
body: JSON.stringify(e)
|
|
@@ -1691,8 +1691,8 @@ class bt {
|
|
|
1691
1691
|
this.queryRateLimiter,
|
|
1692
1692
|
async () => {
|
|
1693
1693
|
const r = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/change/preview");
|
|
1694
|
-
|
|
1695
|
-
const a = await
|
|
1694
|
+
l().debug("[SubscriptionChangeManager] Previewing subscription change:", e);
|
|
1695
|
+
const a = await A(r, {
|
|
1696
1696
|
method: "POST",
|
|
1697
1697
|
headers: { "Content-Type": "application/json" },
|
|
1698
1698
|
body: JSON.stringify(e)
|
|
@@ -1711,8 +1711,8 @@ class bt {
|
|
|
1711
1711
|
this.queryRateLimiter,
|
|
1712
1712
|
async () => {
|
|
1713
1713
|
const a = new URLSearchParams({ resource: e, userId: r }), n = await this.routeDiscovery.buildUrl(`/paywall/v1/subscription/details?${a}`);
|
|
1714
|
-
|
|
1715
|
-
const i = await
|
|
1714
|
+
l().debug("[SubscriptionChangeManager] Getting subscription details:", { resource: e, userId: r });
|
|
1715
|
+
const i = await A(n, {
|
|
1716
1716
|
method: "GET",
|
|
1717
1717
|
headers: { "Content-Type": "application/json" }
|
|
1718
1718
|
});
|
|
@@ -1730,8 +1730,8 @@ class bt {
|
|
|
1730
1730
|
this.rateLimiter,
|
|
1731
1731
|
async () => {
|
|
1732
1732
|
const r = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/cancel");
|
|
1733
|
-
|
|
1734
|
-
const a = await
|
|
1733
|
+
l().debug("[SubscriptionChangeManager] Canceling subscription:", e);
|
|
1734
|
+
const a = await A(r, {
|
|
1735
1735
|
method: "POST",
|
|
1736
1736
|
headers: { "Content-Type": "application/json" },
|
|
1737
1737
|
body: JSON.stringify(e)
|
|
@@ -1750,8 +1750,8 @@ class bt {
|
|
|
1750
1750
|
this.queryRateLimiter,
|
|
1751
1751
|
async () => {
|
|
1752
1752
|
const r = await this.routeDiscovery.buildUrl("/paywall/v1/subscription/portal");
|
|
1753
|
-
|
|
1754
|
-
const a = await
|
|
1753
|
+
l().debug("[SubscriptionChangeManager] Getting billing portal URL:", e);
|
|
1754
|
+
const a = await A(r, {
|
|
1755
1755
|
method: "POST",
|
|
1756
1756
|
headers: { "Content-Type": "application/json" },
|
|
1757
1757
|
body: JSON.stringify(e)
|
|
@@ -1783,8 +1783,8 @@ class vt {
|
|
|
1783
1783
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1784
1784
|
async () => {
|
|
1785
1785
|
const a = await this.routeDiscovery.buildUrl("/paywall/v1/quote");
|
|
1786
|
-
|
|
1787
|
-
const n = await
|
|
1786
|
+
l().debug("[CreditsManager] Requesting quote");
|
|
1787
|
+
const n = await A(a, {
|
|
1788
1788
|
method: "POST",
|
|
1789
1789
|
headers: { "Content-Type": "application/json" },
|
|
1790
1790
|
body: JSON.stringify({ resource: e, couponCode: r })
|
|
@@ -1800,7 +1800,7 @@ class vt {
|
|
|
1800
1800
|
{ ...E.STANDARD, name: "credits-quote" }
|
|
1801
1801
|
));
|
|
1802
1802
|
} catch (a) {
|
|
1803
|
-
throw a instanceof
|
|
1803
|
+
throw a instanceof p ? (l().error("[CreditsManager] Circuit breaker is OPEN - credits service unavailable"), new Error("Credits service is temporarily unavailable. Please try again in a few moments.")) : a;
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
1806
|
async requestCartQuote(e, r) {
|
|
@@ -1810,8 +1810,8 @@ class vt {
|
|
|
1810
1810
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1811
1811
|
async () => {
|
|
1812
1812
|
const a = await this.routeDiscovery.buildUrl("/paywall/v1/cart/quote");
|
|
1813
|
-
|
|
1814
|
-
const n = await
|
|
1813
|
+
l().debug("[CreditsManager] Requesting cart quote for items:", e.length);
|
|
1814
|
+
const n = await A(a, {
|
|
1815
1815
|
method: "POST",
|
|
1816
1816
|
headers: { "Content-Type": "application/json" },
|
|
1817
1817
|
body: JSON.stringify({ items: e, couponCode: r })
|
|
@@ -1829,7 +1829,7 @@ class vt {
|
|
|
1829
1829
|
{ ...E.STANDARD, name: "credits-cart-quote" }
|
|
1830
1830
|
));
|
|
1831
1831
|
} catch (a) {
|
|
1832
|
-
throw a instanceof
|
|
1832
|
+
throw a instanceof p ? new Error("Credits service is temporarily unavailable. Please try again in a few moments.") : a;
|
|
1833
1833
|
}
|
|
1834
1834
|
}
|
|
1835
1835
|
/**
|
|
@@ -1845,8 +1845,8 @@ class vt {
|
|
|
1845
1845
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1846
1846
|
async () => {
|
|
1847
1847
|
const o = await this.routeDiscovery.buildUrl("/paywall/v1/credits/hold");
|
|
1848
|
-
|
|
1849
|
-
const s = await
|
|
1848
|
+
l().debug("[CreditsManager] Creating hold");
|
|
1849
|
+
const s = await A(o, {
|
|
1850
1850
|
method: "POST",
|
|
1851
1851
|
headers: {
|
|
1852
1852
|
"Content-Type": "application/json",
|
|
@@ -1856,15 +1856,15 @@ class vt {
|
|
|
1856
1856
|
body: JSON.stringify({ resource: r, couponCode: a })
|
|
1857
1857
|
});
|
|
1858
1858
|
if (!s.ok) {
|
|
1859
|
-
const
|
|
1860
|
-
throw new Error(
|
|
1859
|
+
const c = await g(s, "Failed to create credits hold");
|
|
1860
|
+
throw new Error(c);
|
|
1861
1861
|
}
|
|
1862
1862
|
return await s.json();
|
|
1863
1863
|
},
|
|
1864
1864
|
{ ...E.STANDARD, name: "credits-create-hold" }
|
|
1865
1865
|
));
|
|
1866
1866
|
} catch (o) {
|
|
1867
|
-
throw o instanceof
|
|
1867
|
+
throw o instanceof p ? new Error("Credits service is temporarily unavailable. Please try again in a few moments.") : o;
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
1870
|
/**
|
|
@@ -1880,8 +1880,8 @@ class vt {
|
|
|
1880
1880
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1881
1881
|
async () => {
|
|
1882
1882
|
const i = await this.routeDiscovery.buildUrl(`/paywall/v1/cart/${encodeURIComponent(r)}/credits/hold`);
|
|
1883
|
-
|
|
1884
|
-
const o = await
|
|
1883
|
+
l().debug("[CreditsManager] Creating cart hold for cart:", r);
|
|
1884
|
+
const o = await A(i, {
|
|
1885
1885
|
method: "POST",
|
|
1886
1886
|
headers: {
|
|
1887
1887
|
"Content-Type": "application/json",
|
|
@@ -1899,7 +1899,7 @@ class vt {
|
|
|
1899
1899
|
{ ...E.STANDARD, name: "credits-create-cart-hold" }
|
|
1900
1900
|
));
|
|
1901
1901
|
} catch (i) {
|
|
1902
|
-
throw i instanceof
|
|
1902
|
+
throw i instanceof p ? new Error("Credits service is temporarily unavailable. Please try again in a few moments.") : i;
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
async authorizePayment(e) {
|
|
@@ -1914,9 +1914,9 @@ class vt {
|
|
|
1914
1914
|
try {
|
|
1915
1915
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1916
1916
|
async () => {
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1919
|
-
const d = await
|
|
1917
|
+
const c = await this.routeDiscovery.buildUrl("/paywall/v1/credits/authorize");
|
|
1918
|
+
l().debug("[CreditsManager] Authorizing payment");
|
|
1919
|
+
const d = await A(c, {
|
|
1920
1920
|
method: "POST",
|
|
1921
1921
|
headers: {
|
|
1922
1922
|
"Content-Type": "application/json",
|
|
@@ -1945,14 +1945,14 @@ class vt {
|
|
|
1945
1945
|
},
|
|
1946
1946
|
{ ...E.STANDARD, name: "credits-authorize" }
|
|
1947
1947
|
));
|
|
1948
|
-
} catch (
|
|
1949
|
-
return
|
|
1948
|
+
} catch (c) {
|
|
1949
|
+
return c instanceof p ? {
|
|
1950
1950
|
success: !1,
|
|
1951
1951
|
error: "Credits service is temporarily unavailable. Please try again in a few moments.",
|
|
1952
1952
|
errorCode: "service_unavailable"
|
|
1953
1953
|
} : {
|
|
1954
1954
|
success: !1,
|
|
1955
|
-
error:
|
|
1955
|
+
error: k(c, "Credits authorization failed"),
|
|
1956
1956
|
errorCode: "authorization_failed"
|
|
1957
1957
|
};
|
|
1958
1958
|
}
|
|
@@ -1970,8 +1970,8 @@ class vt {
|
|
|
1970
1970
|
return await this.circuitBreaker.execute(async () => await b(
|
|
1971
1971
|
async () => {
|
|
1972
1972
|
const s = await this.routeDiscovery.buildUrl(`/paywall/v1/cart/${encodeURIComponent(r)}/credits/authorize`);
|
|
1973
|
-
|
|
1974
|
-
const
|
|
1973
|
+
l().debug("[CreditsManager] Authorizing cart payment for cart:", r);
|
|
1974
|
+
const c = await A(s, {
|
|
1975
1975
|
method: "POST",
|
|
1976
1976
|
headers: {
|
|
1977
1977
|
"Content-Type": "application/json",
|
|
@@ -1983,11 +1983,11 @@ class vt {
|
|
|
1983
1983
|
...i && { metadata: i }
|
|
1984
1984
|
})
|
|
1985
1985
|
});
|
|
1986
|
-
if (!
|
|
1987
|
-
const m = await
|
|
1986
|
+
if (!c.ok) {
|
|
1987
|
+
const m = await c.json().catch((u) => (l().error("[CreditsManager] Failed to parse error response JSON:", u, {
|
|
1988
1988
|
cartId: r,
|
|
1989
|
-
status:
|
|
1990
|
-
statusText:
|
|
1989
|
+
status: c.status,
|
|
1990
|
+
statusText: c.statusText
|
|
1991
1991
|
}), {}));
|
|
1992
1992
|
return {
|
|
1993
1993
|
success: !1,
|
|
@@ -1997,19 +1997,19 @@ class vt {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
return {
|
|
1999
1999
|
success: !0,
|
|
2000
|
-
transactionId: (await
|
|
2000
|
+
transactionId: (await c.json()).transactionId
|
|
2001
2001
|
};
|
|
2002
2002
|
},
|
|
2003
2003
|
{ ...E.STANDARD, name: "credits-cart-authorize" }
|
|
2004
2004
|
));
|
|
2005
2005
|
} catch (s) {
|
|
2006
|
-
return s instanceof
|
|
2006
|
+
return s instanceof p ? {
|
|
2007
2007
|
success: !1,
|
|
2008
2008
|
error: "Credits service is temporarily unavailable. Please try again in a few moments.",
|
|
2009
2009
|
errorCode: "service_unavailable"
|
|
2010
2010
|
} : {
|
|
2011
2011
|
success: !1,
|
|
2012
|
-
error:
|
|
2012
|
+
error: k(s, "Cart credits authorization failed"),
|
|
2013
2013
|
errorCode: "authorization_failed"
|
|
2014
2014
|
};
|
|
2015
2015
|
}
|
|
@@ -2018,7 +2018,7 @@ class vt {
|
|
|
2018
2018
|
if (e)
|
|
2019
2019
|
try {
|
|
2020
2020
|
await this.circuitBreaker.execute(async () => {
|
|
2021
|
-
const a = await this.routeDiscovery.buildUrl(`/paywall/v1/credits/hold/${encodeURIComponent(e)}/release`), n = await
|
|
2021
|
+
const a = await this.routeDiscovery.buildUrl(`/paywall/v1/credits/hold/${encodeURIComponent(e)}/release`), n = await A(a, {
|
|
2022
2022
|
method: "POST",
|
|
2023
2023
|
headers: {
|
|
2024
2024
|
Authorization: `Bearer ${r}`,
|
|
@@ -2031,7 +2031,7 @@ class vt {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
});
|
|
2033
2033
|
} catch (a) {
|
|
2034
|
-
throw a instanceof
|
|
2034
|
+
throw a instanceof p ? new Error("Credits service is temporarily unavailable. Please try again in a few moments.") : a;
|
|
2035
2035
|
}
|
|
2036
2036
|
}
|
|
2037
2037
|
/**
|
|
@@ -2057,8 +2057,8 @@ class vt {
|
|
|
2057
2057
|
if (!s.success && i)
|
|
2058
2058
|
try {
|
|
2059
2059
|
await this.releaseHold(i, r);
|
|
2060
|
-
} catch (
|
|
2061
|
-
|
|
2060
|
+
} catch (c) {
|
|
2061
|
+
l().warn("[CreditsManager] Failed to release hold after auth failure:", c);
|
|
2062
2062
|
}
|
|
2063
2063
|
return {
|
|
2064
2064
|
success: s.success,
|
|
@@ -2070,17 +2070,19 @@ class vt {
|
|
|
2070
2070
|
try {
|
|
2071
2071
|
await this.releaseHold(i, r);
|
|
2072
2072
|
} catch (s) {
|
|
2073
|
-
|
|
2073
|
+
l().warn("[CreditsManager] Failed to release hold after payment failure:", s);
|
|
2074
2074
|
}
|
|
2075
2075
|
return {
|
|
2076
2076
|
success: !1,
|
|
2077
|
-
error:
|
|
2077
|
+
error: k(o, "Credits payment failed")
|
|
2078
2078
|
};
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
2081
|
}
|
|
2082
2082
|
class Ct {
|
|
2083
2083
|
serverUrl;
|
|
2084
|
+
getLogger;
|
|
2085
|
+
fetchWithTimeout;
|
|
2084
2086
|
routePrefix = null;
|
|
2085
2087
|
discoveryPromise = null;
|
|
2086
2088
|
failedDiscoveryAt = null;
|
|
@@ -2088,47 +2090,42 @@ class Ct {
|
|
|
2088
2090
|
baseDelayMs = 1e3;
|
|
2089
2091
|
discoveryTimeoutMs = 2e3;
|
|
2090
2092
|
failedDiscoveryTtlMs = 3e4;
|
|
2091
|
-
constructor(e) {
|
|
2092
|
-
this.serverUrl = e.replace(/\/+$/, "");
|
|
2093
|
+
constructor(e, r) {
|
|
2094
|
+
this.serverUrl = e.replace(/\/+$/, ""), this.getLogger = r.getLogger, this.fetchWithTimeout = r.fetchWithTimeout;
|
|
2093
2095
|
}
|
|
2094
|
-
/**
|
|
2095
|
-
* Discover route prefix from backend health endpoint
|
|
2096
|
-
*
|
|
2097
|
-
* DEDUPLICATION: Multiple concurrent calls share the same in-flight request
|
|
2098
|
-
* SECURITY FIX: Only cache on success, retry on failures with exponential backoff
|
|
2099
|
-
* This prevents permanent bricking of payments due to transient failures
|
|
2100
|
-
*/
|
|
2101
2096
|
async discoverPrefix() {
|
|
2102
2097
|
if (this.routePrefix !== null)
|
|
2103
2098
|
return this.routePrefix;
|
|
2104
2099
|
if (this.discoveryPromise)
|
|
2105
2100
|
return this.discoveryPromise;
|
|
2106
2101
|
if (this.failedDiscoveryAt !== null && Date.now() - this.failedDiscoveryAt < this.failedDiscoveryTtlMs)
|
|
2107
|
-
return
|
|
2102
|
+
return "";
|
|
2108
2103
|
const e = (async () => {
|
|
2109
2104
|
let r = 0;
|
|
2110
2105
|
for (; r < this.maxRetries; )
|
|
2111
2106
|
try {
|
|
2112
|
-
const a = await
|
|
2107
|
+
const a = await this.fetchWithTimeout(
|
|
2113
2108
|
`${this.serverUrl}/cedros-health`,
|
|
2114
2109
|
{},
|
|
2115
2110
|
this.discoveryTimeoutMs
|
|
2116
2111
|
);
|
|
2117
2112
|
if (!a.ok) {
|
|
2118
2113
|
if (a.status >= 400 && a.status < 500)
|
|
2119
|
-
return
|
|
2114
|
+
return this.getLogger().warn(
|
|
2115
|
+
`Route discovery received ${a.status} - not retrying client error`
|
|
2116
|
+
), this.failedDiscoveryAt = Date.now(), "";
|
|
2120
2117
|
throw new Error(`Health check returned ${a.status}`);
|
|
2121
2118
|
}
|
|
2122
|
-
const
|
|
2123
|
-
return this.routePrefix = i, this.failedDiscoveryAt = null,
|
|
2119
|
+
const n = await a.json(), i = String(n.routePrefix ?? "");
|
|
2120
|
+
return this.routePrefix = i, this.failedDiscoveryAt = null, this.getLogger().debug("Route discovery successful, prefix:", i || "(empty)"), i;
|
|
2124
2121
|
} catch (a) {
|
|
2125
2122
|
if (r++, r >= this.maxRetries)
|
|
2126
|
-
return
|
|
2123
|
+
return this.getLogger().warn(
|
|
2127
2124
|
`Route discovery failed after ${r} attempts, using empty prefix for this request:`,
|
|
2128
2125
|
a
|
|
2129
2126
|
), this.failedDiscoveryAt = Date.now(), "";
|
|
2130
2127
|
const n = this.baseDelayMs * Math.pow(2, r - 1);
|
|
2131
|
-
|
|
2128
|
+
this.getLogger().warn(
|
|
2132
2129
|
`Route discovery failed (attempt ${r}/${this.maxRetries}), retrying in ${n}ms:`,
|
|
2133
2130
|
a
|
|
2134
2131
|
), await new Promise((i) => setTimeout(i, n));
|
|
@@ -2142,23 +2139,22 @@ class Ct {
|
|
|
2142
2139
|
this.discoveryPromise === e && (this.discoveryPromise = null);
|
|
2143
2140
|
}
|
|
2144
2141
|
}
|
|
2145
|
-
/**
|
|
2146
|
-
* Build API URL with discovered prefix
|
|
2147
|
-
*/
|
|
2148
2142
|
async buildUrl(e) {
|
|
2149
2143
|
const r = await this.discoverPrefix(), a = e.startsWith("/") ? e : `/${e}`;
|
|
2150
2144
|
return `${this.serverUrl}${r}${a}`;
|
|
2151
2145
|
}
|
|
2152
|
-
/**
|
|
2153
|
-
* Reset cached prefix (useful for testing or reconnecting)
|
|
2154
|
-
*/
|
|
2155
2146
|
reset() {
|
|
2156
2147
|
this.routePrefix = null, this.discoveryPromise = null, this.failedDiscoveryAt = null;
|
|
2157
2148
|
}
|
|
2158
2149
|
}
|
|
2150
|
+
class Et extends Ct {
|
|
2151
|
+
constructor(e) {
|
|
2152
|
+
super(e, { getLogger: l, fetchWithTimeout: A });
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2159
2155
|
let X = null;
|
|
2160
|
-
async function
|
|
2161
|
-
return X || (X = (await import("./WalletManager-
|
|
2156
|
+
async function Pt() {
|
|
2157
|
+
return X || (X = (await import("./WalletManager-D78miaJ2.mjs")).WalletManager), X;
|
|
2162
2158
|
}
|
|
2163
2159
|
const J = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map();
|
|
2164
2160
|
function Ue(t, e, r, a, n) {
|
|
@@ -2170,7 +2166,7 @@ function Ue(t, e, r, a, n) {
|
|
|
2170
2166
|
dangerouslyAllowUnknownMint: n || !1
|
|
2171
2167
|
});
|
|
2172
2168
|
}
|
|
2173
|
-
async function
|
|
2169
|
+
async function St(t, e, r, a, n) {
|
|
2174
2170
|
const i = Ue(
|
|
2175
2171
|
t,
|
|
2176
2172
|
e,
|
|
@@ -2180,22 +2176,22 @@ async function Pt(t, e, r, a, n) {
|
|
|
2180
2176
|
);
|
|
2181
2177
|
let o = J.get(i);
|
|
2182
2178
|
if (o)
|
|
2183
|
-
return o.refCount++,
|
|
2179
|
+
return o.refCount++, l().debug(
|
|
2184
2180
|
`[ManagerCache] Reusing cached managers (refCount: ${o.refCount}):`,
|
|
2185
2181
|
{ stripePublicKey: t.slice(0, 10) + "...", serverUrl: e }
|
|
2186
2182
|
), o;
|
|
2187
2183
|
const s = Z.get(i);
|
|
2188
2184
|
if (s)
|
|
2189
|
-
return o = await s, o.refCount++,
|
|
2185
|
+
return o = await s, o.refCount++, l().debug(
|
|
2190
2186
|
`[ManagerCache] Reusing in-flight managers (refCount: ${o.refCount}):`,
|
|
2191
2187
|
{ stripePublicKey: t.slice(0, 10) + "...", serverUrl: e }
|
|
2192
2188
|
), o;
|
|
2193
|
-
|
|
2189
|
+
l().debug(
|
|
2194
2190
|
"[ManagerCache] Creating new manager instances:",
|
|
2195
2191
|
{ stripePublicKey: t.slice(0, 10) + "...", serverUrl: e }
|
|
2196
2192
|
);
|
|
2197
|
-
const
|
|
2198
|
-
const d = new
|
|
2193
|
+
const c = (async () => {
|
|
2194
|
+
const d = new Et(e), m = new st(t, d), u = new gt(d), y = await Pt(), f = new y(
|
|
2199
2195
|
r,
|
|
2200
2196
|
a,
|
|
2201
2197
|
n ?? !1
|
|
@@ -2211,9 +2207,9 @@ async function Pt(t, e, r, a, n) {
|
|
|
2211
2207
|
refCount: 1
|
|
2212
2208
|
};
|
|
2213
2209
|
})();
|
|
2214
|
-
Z.set(i,
|
|
2210
|
+
Z.set(i, c);
|
|
2215
2211
|
try {
|
|
2216
|
-
return o = await
|
|
2212
|
+
return o = await c, J.set(i, o), o;
|
|
2217
2213
|
} finally {
|
|
2218
2214
|
Z.delete(i);
|
|
2219
2215
|
}
|
|
@@ -2227,24 +2223,24 @@ function ye(t, e, r, a, n) {
|
|
|
2227
2223
|
n
|
|
2228
2224
|
), o = J.get(i);
|
|
2229
2225
|
if (!o) {
|
|
2230
|
-
|
|
2226
|
+
l().warn("[ManagerCache] Attempted to release non-existent managers:", { cacheKey: i });
|
|
2231
2227
|
return;
|
|
2232
2228
|
}
|
|
2233
|
-
o.refCount--,
|
|
2229
|
+
o.refCount--, l().debug(
|
|
2234
2230
|
`[ManagerCache] Released manager reference (refCount: ${o.refCount}):`,
|
|
2235
2231
|
{ stripePublicKey: t.slice(0, 10) + "...", serverUrl: e }
|
|
2236
|
-
), o.refCount <= 0 && (J.delete(i),
|
|
2232
|
+
), o.refCount <= 0 && (J.delete(i), l().debug("[ManagerCache] Removed managers from cache (refCount reached 0)"));
|
|
2237
2233
|
}
|
|
2238
|
-
const
|
|
2234
|
+
const xt = "data:image/webp;base64,UklGRnIIAABXRUJQVlA4WAoAAAAYAAAAOwAAOwAAQUxQSK4BAAABkHPbtrE9+z73/RTbqWw7Lf+BbbNKbTudbZe2qy+VbVv3PmeHj05G6ohg4LaRounNMtN1voB42ABA5R7TNlx5+O7du9e3Tiwb0b4EgFyAOCQM1Z16+DWFUZC7m3uVB2zKQGBhe+77RGHonJffCL1zQuHDxQ1hrEmTatDjHIXOC2MgzpNf1tVJkWgsGhyihI7JIE74aUYp2ITFAoz9QO+ZAs7zanvkEilKbIkMJS5ANwoJmrCodYVOmBqh5zIEJjZc9xods4A4rrPGxGitrJSU71yNyH4Myl7JTEl+5zzYSH9nlkrxHBzxWUzLVEnhh+YI/gq3+UphpvA8m/s7/wg9M4bjFNg/0vplrxQ+rQEDg/xihmT23jxYJZ8UPq8OA5z77Wt405FDR4poSMjiAJhPRxUIu8D+UVonOhfNPEVHPM9juFacwo+1V6kJQ3Y9Sa8ljhPuUvRk4UdNWU9ST3b9n0W3iG5DumdS9y7o3kHVu6/75ii/dbpvrO7brvtPUf2X6f5DVf/dmpxBmauociRVbqbKCXW5qCoHVuXempxf1dZQtXFUbat/yKZTtSUBVlA4INwFAABwGgCdASo8ADwAPm0qj0WkIqEZ+zYAQAbEtgBOmZoZF+E8zGoP3X8VbcdLvma8t+jH0E+YB+ofSA8wH7VdQv0AP75/iOsG9ADy3/Y5/b/91fgI/Y7MOesb0e/q+TUR1vt7VO6mwG0imO70GM5/0P7BX6qelv7EP209lz9oDRea09ZR+SjhX7sBu/ZS7tG917rPgI3Q7XsB7luy2hAg/95C2Z1L362OH1oFziDY/K5gWoSytSAtiKvA/jW1MehBzdLzJfszPPBvGa15IYwIVRTjO2Hz5ZS9HjLMehwAAP64SgjD3qeg6NRe/Ok+iFhrG3pgglCfbam3yBaDUH36sUiQx0PB1ZZyOHq0ky+f97h6tJMvo0p9LkfXecWOFJ8J5G7yRPuL4tzGLT09QulTJw42xp2hd+lMgIa51XoHx/iftn8B2D3k92H5jOQr+uIXFHHK5FpcTG+qGEF+np0LiQa+vdW7/+ZzOLVRf7jR5X3ANPt93Ng92DW7NflVr6kMr88O/v2ZNb0vtgao2Am/R3CDKiNq89f86CT6r2L2g1oTui7H3E1yhSPQpEOz01I3fhfiMMv4weqKuoedxn/xLg5uzHa6Gte4C/dQYkG3ZFSy4CXQtRjftBrjX/Oj+HpSUPDsv0wPW+ml5NbBKDCj2f3SD8TVMf2ZfHrOkR602RVk2UmKC+H0Y9iK6k98vsgPINtz0II8X7Mj2nJkTC6IMLuQ8dNTUq9VXOnhXrdhNZoaH94ePo6baBl3hTGFAnD3/b+gR/vtbqV7wktuX6fpnjeTBe/Drp6z3neeANj/aX4CsU9w67nwYOjZhueCjxaDKUnNjLPjI1e0BoTbcOzOQ0wHJHZJ+Pt608StBu4HiJ8NjH46fnvXL3yiMoSvkAuwCE1AakA+eU1u3unyjl1/MnZQmbp8fzfsfrFesehLPcIkYdCiZ+52QbmINNTjEsvjuBuZRubBE+Laihppsxoo4efGIo0xkw0etu1+yzvkqp88w3pBq0mRl13gnnc+2zl6SmhwgmNFbz+F8qAqmdfJL8iaNSGEWlPlpczDDe62GBZMlBhQmq/XCn/1b+VazHvJXkoIFDF+wktMg+rKfLyfTlXdK0cs+Kn8h+rjMakkf3WLo1TftMLn+O+x/Gat+BGstJrM1xvCSSnHQY+NV4B4gRqyZ55gRNnqN/0lWrATOcHUaGXpkTIM/yxFjxcePcSFo+t2aJ5lShtVukETzRxaIXgRkpROeWQHWpTHOaexmXOzF0b833qJSoXMk2zB/uMrgDzKd7d3ohUz8Ra08WYKlAuMQD08bF4+jUepEspqPLoYLQ73TfmL+1LwKxyTV3gEu6WnxBPWPLnYIGYN9U47ZNlB+NgHgYtKTyii6060RAG+wN32WUVFxCZw0HMHnHFgwxD34L/anlpS7mOrjKgyuGYhFC7iHqTQHuoAO1ekBHV+rndnbETKfa1F7LxNLYq+dmJyytmQrJUCGjelorI1m/TMQNiFVrY4FCI1Gl2W1JsZsw9zA+Bh3JmjkC0H5/0JV6JotNMatJIZ4v5PqwJe3r8xd+FNS3ynccdu+xtVdc27qwVdoomciZD5oXYey9KAFSAKO594sBKZNWUJTLXnt0BJbdF8FkQYvg3DQajYY2p+ixd5Ag7o92gw0pVVDDOP+WQxiEmKqgWJyTBsnsBk2Bxi2Unsv8S/4PmE8Hy/vy+Mij+aTAKZvg716IHfHX0/JMeFfmAnsZ39Q0qkfdPtq6+CxbGZ7wKDsK/8l/MVGuyd6faJFt5wyoOXuNrr3JC9EoBmjcOzkVw/6RNP49poZ1xzsX3q7B4HGfI/XSfRQq3HeZ2j12d0E3gCAube4oExaT1sx/v8F+f61QOsGdSaqM2im6qOGkSRkrRQ7L8hvS8vEYJeVkAbFvX5ov7e/egYYNToMHj651c5/rCVYtB9Ned6GvGN8R0x3t7+lsf8+ofhHRzpyvwxd6c5pREZVOKnXzplhJ61mki4JmAAAABFWElGugAAAEV4aWYAAElJKgAIAAAABgASAQMAAQAAAAEAAAAaAQUAAQAAAFYAAAAbAQUAAQAAAF4AAAAoAQMAAQAAAAIAAAATAgMAAQAAAAEAAABphwQAAQAAAGYAAAAAAAAASAAAAAEAAABIAAAAAQAAAAYAAJAHAAQAAAAwMjEwAZEHAAQAAAABAgMAAKAHAAQAAAAwMTAwAaADAAEAAAD//wAAAqAEAAEAAAA8AAAAA6AEAAEAAAA8AAAAAAAAAA==", Tt = "data:image/svg+xml,%3csvg%20width='868'%20height='868'%20viewBox='0%200%20868%20868'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='434'%20cy='434'%20r='434'%20fill='%231B262D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M234.563%20184H640.697C650.387%20184%20659.339%20189.164%20664.172%20197.542L782.495%20402.657C788.631%20413.294%20786.808%20426.72%20778.056%20435.346L452.368%20756.327C441.818%20766.724%20424.846%20766.724%20414.296%20756.327L89.0484%20435.78C80.0927%20426.954%2078.4157%20413.136%2085.0013%20402.433L211.48%20196.884C216.405%20188.879%20225.146%20184%20234.563%20184ZM588.257%20275.577V333.129H472.567V373.032C553.82%20377.296%20614.782%20394.81%20615.234%20415.802L615.231%20459.563C614.779%20480.556%20553.82%20498.069%20472.567%20502.333V600.259H395.746V502.333C314.492%20498.069%20253.531%20480.555%20253.078%20459.563L253.081%20415.802C253.533%20394.81%20314.492%20377.296%20395.746%20373.032V333.129H280.055V275.577H588.257ZM434.156%20472.268C520.868%20472.268%20593.345%20457.459%20611.082%20437.683C596.041%20420.912%20541.636%20407.713%20472.567%20404.089V445.867C460.187%20446.516%20447.336%20446.858%20434.156%20446.858C420.976%20446.858%20408.125%20446.516%20395.746%20445.867V404.089C326.676%20407.713%20272.271%20420.912%20257.23%20437.683C274.968%20457.459%20347.444%20472.268%20434.156%20472.268Z'%20fill='%23009393'/%3e%3c/svg%3e", kt = "data:image/webp;base64,UklGRqwEAABXRUJQVlA4WAoAAAAYAAAAOwAAOwAAQUxQSL8BAAABkGvbtmlLc5997yvbmW19gBnbDm2kjF5UmW3bthXZVZFdZ+81r+87Z1XlEaHIbSNlMstwos4XUBSTLAFQo/u01Zdf/yLDDze3zB/YwADJEoOoJAKg7oTdH4SF+XxiZlMgSESzwAJdVn2iUJzzOUMiLhQKf+/va2FtBLMBuu1zpHcsincUXhtoTKLsCTVX/KF3wrLhPLm/OWzZtjQWfZ7RhYyAC/lxMowpSzJYJAyFkZDQc21FBMUT7BqGjpHxf3m+XlEPUHE/f3vGgPzmw4awRUaTexkyJhwfNShctVgZXyJDXq4CUyjNy6Y4fVOBIkAPR2GcOE7Jm2NQ/RE9YzXht3a5VYvlOX0xF0fy+tp/ozBuQg6DzZYb6Bi7ed4rB5Mp/1Co4cNhLUo1StLxDIDqrynUoRswiF6nFnIxsDpnZ5WBW0GFZ1qZ8HfLDk5txHHsGDpSa6B0cXZEa+DsTr1M+P4qPdXwjynU4+1/a7oN3Sm6G+meSd27oHsHde++7puj+tYpv7G6b7vun6L7l6n+oZp/t7JmUNUqqhpJV5upakJVLaqqgVW1t6rmV401NGMc1djqH4rpIseSfyPFkgAAVlA4IAQCAABQDACdASo8ADwAPm0yk0akIyGhJgzogA2JaQAThroHvLxu+aPf5G2BYxv+B6XHzx6GPon/o+qz/tOAA/TM82gR0vnExWoiQRM36jlg2UIvwCSqySErzuguz9EP2x/7hsNazr91aIworWI7AAD+/TZ+6Ipl444OdT+2wU0Ov+T8oJuVP/vUbT/w1Jsv6Awnl6rvF/xetfOPt3gTQZZi0Y/AOx563J7CJkqTR/fc/n34zyeKzR80fhfv4ef+Hjhz/CX5aQo+58zg/FdE+7bLoophGfG0szI513EH+q+Gc73H1PFdJYf7CF8v5dhr3tMwEVX5Ji2ZxejK8xrf/E6nVXqlA4DrYNRP09InHc+fEqO/fH8xr+rMf4y1F9TOnwVffZblLoTP6lot0m/sh7sTiDQr0mIA8TiHoOffGDG6KzV+B3239udfhzD740gkRi/m53abX0Ku3vAgadgFFqL0vk8M/4aI+cI+0fbLW17mWGeMu21wSRRQiv5iNgGKR3vEGXAItcLDft1uUzWAfbe1X3zK/ymT7bA/76PB6UUknm+Y5MM4osurUXU/k7P38pN/3slnGfpFzjl4c3USY4mH9ZCJYUuC/kGEnq/yRPalPdODNFvW6s8MiQeQejYNRY0LsJ0WXkK8vXiDmihCivYAOPoSovesL7on+WAArDNM/BcQSQvCYABFWElGugAAAEV4aWYAAElJKgAIAAAABgASAQMAAQAAAAEAAAAaAQUAAQAAAFYAAAAbAQUAAQAAAF4AAAAoAQMAAQAAAAIAAAATAgMAAQAAAAEAAABphwQAAQAAAGYAAAAAAAAASAAAAAEAAABIAAAAAQAAAAYAAJAHAAQAAAAwMjEwAZEHAAQAAAABAgMAAKAHAAQAAAAwMTAwAaADAAEAAAD//wAAAqAEAAEAAAA8AAAAA6AEAAEAAAA8AAAAAAAAAA==", Rt = "data:image/webp;base64,UklGRtgCAABXRUJQVlA4WAoAAAAIAAAAOwAAOwAAVlA4IPgBAABQCwCdASo8ADwAPm0wk0ekIqGhKBQMqIANiWkADPF3uV2D8VcQGk1mg+P36i9SLnZvYAQxszEWYzEwX1RVkqG/4BGbJgMSHqhKDFsjWsGfPPrvfef11goNmCDDlBJHVVD+8gAA/vu4q03kl+E7FpjtZ2gc8pQ619Hjv9NywoRZ6az43C1wcrRr/lWzJlJhLWMHN0MkVl1ueAf6Hn8StVzeUfMBXOKkgfe2msx7QWR5PnHW/5c6/35yrtWnrURc2q6UYlGin+v8C2dQqexkW6rX2EEijTI9eEQ46PWH3/59fM2AlMvvR2abaRk5XX7V1triQncRxvMfz5YmYDN+PY/ikcZUNaiFucKoUq5riv0eKCezuFNHecE11ojwJqWRSTWpalkz5autXp6vFS+FT1tWUsB/fs1CCOZxaA1vR1grOEaiuKe1RYm7e05psWtqbXLVmm1bA8Ly9PFkVdCbc6hR3UuBBsFGnVeGOUeMn2onnfvYhBMcM9YPxGdQkwZLXOk1VuQSTk01Shf3fZrFyRlFauftFdPYhKXwqrr+meav1P+KLKBVosqmHnFFfgExsQ/rOf3TSd+mOqQfJA+cF+HojNU7nmM3uDkoCBi+//Gqp+gPNNW8M4LFrol8rxE+7WsjqMgfwv1f+Nr25RtG1Wa/KkniRCAAAABFWElGugAAAEV4aWYAAElJKgAIAAAABgASAQMAAQAAAAEAAAAaAQUAAQAAAFYAAAAbAQUAAQAAAF4AAAAoAQMAAQAAAAIAAAATAgMAAQAAAAEAAABphwQAAQAAAGYAAAAAAAAASAAAAAEAAABIAAAAAQAAAAYAAJAHAAQAAAAwMjEwAZEHAAQAAAABAgMAAKAHAAQAAAAwMTAwAaADAAEAAAD//wAAAqAEAAEAAAA8AAAAA6AEAAEAAAA8AAAAAAAAAA==", Mt = {
|
|
2239
2235
|
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: {
|
|
2240
2236
|
symbol: "USDC",
|
|
2241
2237
|
decimals: 6,
|
|
2242
|
-
icon:
|
|
2238
|
+
icon: xt
|
|
2243
2239
|
},
|
|
2244
2240
|
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: {
|
|
2245
2241
|
symbol: "USDT",
|
|
2246
2242
|
decimals: 6,
|
|
2247
|
-
icon:
|
|
2243
|
+
icon: Tt
|
|
2248
2244
|
},
|
|
2249
2245
|
"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo": {
|
|
2250
2246
|
symbol: "PYUSD",
|
|
@@ -2254,12 +2250,12 @@ const St = "data:image/webp;base64,UklGRnIIAABXRUJQVlA4WAoAAAAYAAAAOwAAOwAAQUxQS
|
|
|
2254
2250
|
CASHx9KJUStyftLFWGvEVf59SGeG9sh5FfcnZMVPCASH: {
|
|
2255
2251
|
symbol: "CASH",
|
|
2256
2252
|
decimals: 6,
|
|
2257
|
-
icon:
|
|
2253
|
+
icon: Rt
|
|
2258
2254
|
}
|
|
2259
2255
|
}, ae = Object.fromEntries(
|
|
2260
|
-
Object.entries(
|
|
2256
|
+
Object.entries(Mt).map(([t, e]) => [t, e.symbol])
|
|
2261
2257
|
);
|
|
2262
|
-
function
|
|
2258
|
+
function Dt(t) {
|
|
2263
2259
|
return t in ae;
|
|
2264
2260
|
}
|
|
2265
2261
|
function Fe(t, e = "token mint", r = !1) {
|
|
@@ -2269,7 +2265,7 @@ function Fe(t, e = "token mint", r = !1) {
|
|
|
2269
2265
|
isKnownStablecoin: !1
|
|
2270
2266
|
};
|
|
2271
2267
|
const a = t.trim();
|
|
2272
|
-
if (
|
|
2268
|
+
if (Dt(a))
|
|
2273
2269
|
return {
|
|
2274
2270
|
isValid: !0,
|
|
2275
2271
|
isKnownStablecoin: !0,
|
|
@@ -2324,18 +2320,18 @@ function Fe(t, e = "token mint", r = !1) {
|
|
|
2324
2320
|
`)
|
|
2325
2321
|
};
|
|
2326
2322
|
}
|
|
2327
|
-
function
|
|
2323
|
+
function Wt(t, e = "unknown", r = !1) {
|
|
2328
2324
|
return Fe(t, `X402Requirement (resource: ${e})`, r);
|
|
2329
2325
|
}
|
|
2330
|
-
const
|
|
2331
|
-
function
|
|
2326
|
+
const Ae = /* @__PURE__ */ new Set(["mainnet-beta", "devnet", "testnet"]);
|
|
2327
|
+
function Ot() {
|
|
2332
2328
|
if (typeof window < "u" && window.location)
|
|
2333
2329
|
return window.location.origin;
|
|
2334
2330
|
throw new Error(
|
|
2335
2331
|
"serverUrl is required in SSR/Node environments. In browser environments, it defaults to window.location.origin"
|
|
2336
2332
|
);
|
|
2337
2333
|
}
|
|
2338
|
-
function
|
|
2334
|
+
function Bt(t) {
|
|
2339
2335
|
const e = [];
|
|
2340
2336
|
if (t.showCard !== !1) {
|
|
2341
2337
|
const n = t.stripePublicKey;
|
|
@@ -2355,16 +2351,16 @@ function Ot(t) {
|
|
|
2355
2351
|
}), a = t.serverUrl);
|
|
2356
2352
|
else
|
|
2357
2353
|
try {
|
|
2358
|
-
a =
|
|
2354
|
+
a = Ot();
|
|
2359
2355
|
} catch (n) {
|
|
2360
2356
|
e.push({
|
|
2361
2357
|
field: "serverUrl",
|
|
2362
2358
|
message: n instanceof Error ? n.message : "failed to determine default"
|
|
2363
2359
|
}), a = "";
|
|
2364
2360
|
}
|
|
2365
|
-
if (
|
|
2361
|
+
if (Ae.has(t.solanaCluster) || e.push({
|
|
2366
2362
|
field: "solanaCluster",
|
|
2367
|
-
message: `must be one of ${Array.from(
|
|
2363
|
+
message: `must be one of ${Array.from(Ae).join(", ")}`
|
|
2368
2364
|
}), t.solanaEndpoint !== void 0 && (typeof t.solanaEndpoint != "string" ? e.push({
|
|
2369
2365
|
field: "solanaEndpoint",
|
|
2370
2366
|
message: "must be a string when provided"
|
|
@@ -2387,14 +2383,14 @@ ${n}`);
|
|
|
2387
2383
|
const n = t.dangerouslyAllowUnknownMint === !0, i = Fe(t.tokenMint, "CedrosConfig.tokenMint", n);
|
|
2388
2384
|
if (!i.isValid && i.error)
|
|
2389
2385
|
throw new Error(i.error);
|
|
2390
|
-
i.warning &&
|
|
2386
|
+
i.warning && l().warn(i.warning);
|
|
2391
2387
|
}
|
|
2392
2388
|
return {
|
|
2393
2389
|
...t,
|
|
2394
2390
|
serverUrl: a
|
|
2395
2391
|
};
|
|
2396
2392
|
}
|
|
2397
|
-
const
|
|
2393
|
+
const _t = Object.freeze({
|
|
2398
2394
|
surfaceBackground: "rgba(255, 255, 255, 0)",
|
|
2399
2395
|
surfaceText: "#111827",
|
|
2400
2396
|
surfaceBorder: "rgba(15, 23, 42, 0.08)",
|
|
@@ -2417,7 +2413,7 @@ const Bt = Object.freeze({
|
|
|
2417
2413
|
buttonPadding: "0.75rem 1.5rem",
|
|
2418
2414
|
buttonFontSize: "1rem",
|
|
2419
2415
|
buttonFontWeight: "600"
|
|
2420
|
-
}),
|
|
2416
|
+
}), It = Object.freeze({
|
|
2421
2417
|
surfaceBackground: "rgba(17, 24, 39, 0.6)",
|
|
2422
2418
|
surfaceText: "#f9fafb",
|
|
2423
2419
|
surfaceBorder: "rgba(148, 163, 184, 0.25)",
|
|
@@ -2440,7 +2436,7 @@ const Bt = Object.freeze({
|
|
|
2440
2436
|
buttonPadding: "0.75rem 1.5rem",
|
|
2441
2437
|
buttonFontSize: "1rem",
|
|
2442
2438
|
buttonFontWeight: "600"
|
|
2443
|
-
}),
|
|
2439
|
+
}), Nt = {
|
|
2444
2440
|
surfaceBackground: "--cedros-surface-bg",
|
|
2445
2441
|
surfaceText: "--cedros-surface-text",
|
|
2446
2442
|
surfaceBorder: "--cedros-surface-border",
|
|
@@ -2463,36 +2459,36 @@ const Bt = Object.freeze({
|
|
|
2463
2459
|
buttonPadding: "--cedros-button-padding",
|
|
2464
2460
|
buttonFontSize: "--cedros-button-font-size",
|
|
2465
2461
|
buttonFontWeight: "--cedros-button-font-weight"
|
|
2466
|
-
}, se =
|
|
2467
|
-
function
|
|
2462
|
+
}, se = pe(null);
|
|
2463
|
+
function Ut(t, e) {
|
|
2468
2464
|
return {
|
|
2469
|
-
...t === "dark" ?
|
|
2465
|
+
...t === "dark" ? It : _t,
|
|
2470
2466
|
...e
|
|
2471
2467
|
};
|
|
2472
2468
|
}
|
|
2473
|
-
function
|
|
2469
|
+
function Ft(t) {
|
|
2474
2470
|
const e = Object.entries(t).map(([r, a]) => [
|
|
2475
|
-
|
|
2471
|
+
Nt[r],
|
|
2476
2472
|
a
|
|
2477
2473
|
]);
|
|
2478
2474
|
return Object.fromEntries(e);
|
|
2479
2475
|
}
|
|
2480
|
-
function
|
|
2476
|
+
function Ht({
|
|
2481
2477
|
initialMode: t = "light",
|
|
2482
2478
|
overrides: e,
|
|
2483
2479
|
unstyled: r = !1,
|
|
2484
2480
|
children: a
|
|
2485
2481
|
}) {
|
|
2486
|
-
const [n, i] = N(t), [o, s] = N(e),
|
|
2482
|
+
const [n, i] = N(t), [o, s] = N(e), c = ge(e);
|
|
2487
2483
|
I(() => {
|
|
2488
|
-
if (e ===
|
|
2484
|
+
if (e === c.current)
|
|
2489
2485
|
return;
|
|
2490
|
-
(!e || !
|
|
2491
|
-
(u) => e[u] !==
|
|
2492
|
-
)) && (
|
|
2486
|
+
(!e || !c.current ? e !== c.current : Object.keys({ ...e, ...c.current }).some(
|
|
2487
|
+
(u) => e[u] !== c.current?.[u]
|
|
2488
|
+
)) && (c.current = e, s(e));
|
|
2493
2489
|
}, [e]);
|
|
2494
2490
|
const d = ee(() => {
|
|
2495
|
-
const m =
|
|
2491
|
+
const m = Ut(n, o), u = r ? {} : Ft(m), y = r ? "" : `cedros-theme-root cedros-theme cedros-theme--${n}`;
|
|
2496
2492
|
return {
|
|
2497
2493
|
mode: n,
|
|
2498
2494
|
setMode: i,
|
|
@@ -2502,7 +2498,7 @@ function Ft({
|
|
|
2502
2498
|
unstyled: r
|
|
2503
2499
|
};
|
|
2504
2500
|
}, [n, o, r]);
|
|
2505
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ K(se.Provider, { value: d, children: a });
|
|
2506
2502
|
}
|
|
2507
2503
|
function Kt() {
|
|
2508
2504
|
const t = ne(se);
|
|
@@ -2510,7 +2506,7 @@ function Kt() {
|
|
|
2510
2506
|
throw new Error("useCedrosTheme must be used within CedrosProvider");
|
|
2511
2507
|
return t;
|
|
2512
2508
|
}
|
|
2513
|
-
function
|
|
2509
|
+
function Vt() {
|
|
2514
2510
|
return ne(se);
|
|
2515
2511
|
}
|
|
2516
2512
|
const $ = {
|
|
@@ -2520,25 +2516,25 @@ const $ = {
|
|
|
2520
2516
|
isInitialized: () => !1,
|
|
2521
2517
|
getId: () => "stub"
|
|
2522
2518
|
};
|
|
2523
|
-
function
|
|
2519
|
+
function Lt() {
|
|
2524
2520
|
return typeof process < "u" && process.env.NODE_ENV === "development" ? 0 : 2;
|
|
2525
2521
|
}
|
|
2526
|
-
const He =
|
|
2527
|
-
function
|
|
2528
|
-
const r = ee(() =>
|
|
2522
|
+
const He = pe(null);
|
|
2523
|
+
function Gt({ config: t, children: e }) {
|
|
2524
|
+
const r = ee(() => Bt(t), [t]), [a, n] = N(null), [i, o] = N($), s = ge($);
|
|
2529
2525
|
I(() => {
|
|
2530
2526
|
let f = !1;
|
|
2531
|
-
return import("./walletPool-
|
|
2527
|
+
return import("./walletPool-DShNjCQ6.mjs").then(({ createWalletPool: h }) => {
|
|
2532
2528
|
if (f) return;
|
|
2533
2529
|
const w = h();
|
|
2534
2530
|
s.current = w, o(w);
|
|
2535
2531
|
}).catch((h) => {
|
|
2536
|
-
f || (
|
|
2532
|
+
f || (l().error("[CedrosProvider] Wallet pool initialization failed:", h), n("Failed to initialize Cedros provider"));
|
|
2537
2533
|
}), () => {
|
|
2538
2534
|
f = !0;
|
|
2539
2535
|
};
|
|
2540
2536
|
}, []);
|
|
2541
|
-
const [
|
|
2537
|
+
const [c, d] = N(null);
|
|
2542
2538
|
I(() => {
|
|
2543
2539
|
let f = !1;
|
|
2544
2540
|
return import("./solanaCheck-IlYsbXDd.mjs").then(
|
|
@@ -2546,12 +2542,12 @@ function Vt({ config: t, children: e }) {
|
|
|
2546
2542
|
).then((h) => {
|
|
2547
2543
|
f || (h.available ? d(void 0) : d(h.error || "Solana dependencies not available"));
|
|
2548
2544
|
}).catch((h) => {
|
|
2549
|
-
f || (
|
|
2545
|
+
f || (l().warn("[CedrosProvider] Solana availability check failed:", h), d("Unable to verify Solana availability"));
|
|
2550
2546
|
}), () => {
|
|
2551
2547
|
f = !0;
|
|
2552
2548
|
};
|
|
2553
2549
|
}, []), I(() => {
|
|
2554
|
-
const f = r.logLevel ??
|
|
2550
|
+
const f = r.logLevel ?? Lt(), h = Xe({
|
|
2555
2551
|
level: f,
|
|
2556
2552
|
prefix: "[CedrosPay]"
|
|
2557
2553
|
});
|
|
@@ -2559,23 +2555,23 @@ function Vt({ config: t, children: e }) {
|
|
|
2559
2555
|
}, [r.logLevel]), I(() => () => {
|
|
2560
2556
|
const f = s.current;
|
|
2561
2557
|
f && f !== $ && f.cleanup().catch((h) => {
|
|
2562
|
-
|
|
2558
|
+
l().warn("[CedrosProvider] Wallet pool cleanup failed:", h);
|
|
2563
2559
|
});
|
|
2564
2560
|
}, []);
|
|
2565
2561
|
const [m, u] = N(null);
|
|
2566
2562
|
I(() => {
|
|
2567
2563
|
let f = !1, h = !1;
|
|
2568
|
-
const w = r.stripePublicKey ?? "", C = r.serverUrl ?? "", x = r.solanaCluster, B = r.solanaEndpoint,
|
|
2569
|
-
return
|
|
2564
|
+
const w = r.stripePublicKey ?? "", C = r.serverUrl ?? "", x = r.solanaCluster, B = r.solanaEndpoint, T = r.dangerouslyAllowUnknownMint;
|
|
2565
|
+
return St(w, C, x, B, T).then((D) => {
|
|
2570
2566
|
if (f) {
|
|
2571
|
-
ye(w, C, x, B,
|
|
2567
|
+
ye(w, C, x, B, T);
|
|
2572
2568
|
return;
|
|
2573
2569
|
}
|
|
2574
2570
|
h = !0, u(D);
|
|
2575
2571
|
}).catch((D) => {
|
|
2576
|
-
f || (
|
|
2572
|
+
f || (l().error("[CedrosProvider] Manager initialization failed:", D), n("Failed to initialize Cedros provider"));
|
|
2577
2573
|
}), () => {
|
|
2578
|
-
f = !0, h && ye(w, C, x, B,
|
|
2574
|
+
f = !0, h && ye(w, C, x, B, T);
|
|
2579
2575
|
};
|
|
2580
2576
|
}, [
|
|
2581
2577
|
r.stripePublicKey,
|
|
@@ -2588,50 +2584,50 @@ function Vt({ config: t, children: e }) {
|
|
|
2588
2584
|
config: r,
|
|
2589
2585
|
...m,
|
|
2590
2586
|
walletPool: i,
|
|
2591
|
-
solanaError:
|
|
2592
|
-
} : null, [r, m, i,
|
|
2593
|
-
return a ? /* @__PURE__ */
|
|
2594
|
-
|
|
2587
|
+
solanaError: c
|
|
2588
|
+
} : null, [r, m, i, c]);
|
|
2589
|
+
return a ? /* @__PURE__ */ K("div", { role: "alert", children: a }) : /* @__PURE__ */ K(
|
|
2590
|
+
Ht,
|
|
2595
2591
|
{
|
|
2596
2592
|
initialMode: r.theme ?? "light",
|
|
2597
2593
|
overrides: r.themeOverrides,
|
|
2598
2594
|
unstyled: r.unstyled ?? !1,
|
|
2599
|
-
children: y ? /* @__PURE__ */
|
|
2595
|
+
children: y ? /* @__PURE__ */ K(He.Provider, { value: y, children: e }) : null
|
|
2600
2596
|
}
|
|
2601
2597
|
);
|
|
2602
2598
|
}
|
|
2603
|
-
function
|
|
2599
|
+
function Jt() {
|
|
2604
2600
|
const t = ne(He);
|
|
2605
2601
|
if (!t)
|
|
2606
2602
|
throw new Error("useCedrosContext must be used within CedrosProvider");
|
|
2607
2603
|
return t;
|
|
2608
2604
|
}
|
|
2609
2605
|
export {
|
|
2610
|
-
|
|
2606
|
+
Gt as C,
|
|
2611
2607
|
at as E,
|
|
2612
2608
|
ae as K,
|
|
2613
2609
|
Ge as L,
|
|
2614
2610
|
O as P,
|
|
2615
2611
|
M as R,
|
|
2616
|
-
|
|
2612
|
+
Mt as S,
|
|
2617
2613
|
Kt as a,
|
|
2618
2614
|
j as b,
|
|
2619
2615
|
R as c,
|
|
2620
2616
|
et as d,
|
|
2621
|
-
|
|
2622
|
-
|
|
2617
|
+
p as e,
|
|
2618
|
+
Qt as f,
|
|
2623
2619
|
E as g,
|
|
2624
2620
|
Ee as h,
|
|
2625
|
-
|
|
2621
|
+
l as i,
|
|
2626
2622
|
Xe as j,
|
|
2627
|
-
|
|
2623
|
+
Wt as k,
|
|
2628
2624
|
me as l,
|
|
2629
|
-
|
|
2625
|
+
k as m,
|
|
2630
2626
|
Fe as n,
|
|
2631
2627
|
rt as o,
|
|
2632
|
-
p,
|
|
2633
|
-
|
|
2628
|
+
A as p,
|
|
2629
|
+
Vt as q,
|
|
2634
2630
|
b as r,
|
|
2635
|
-
|
|
2636
|
-
|
|
2631
|
+
Jt as u,
|
|
2632
|
+
Bt as v
|
|
2637
2633
|
};
|