@cedros/pay-react 1.0.4 → 1.1.0

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.
Files changed (389) hide show
  1. package/README.md +297 -39
  2. package/dist/CedrosContext-DUT3cLZg.mjs +2474 -0
  3. package/dist/CedrosContext-efFL4kQz.js +11 -0
  4. package/dist/admin/index.d.ts +9 -0
  5. package/dist/admin/index.d.ts.map +1 -0
  6. package/dist/admin/plugin.d.ts +9 -0
  7. package/dist/admin/plugin.d.ts.map +1 -0
  8. package/dist/admin/types.d.ts +115 -0
  9. package/dist/admin/types.d.ts.map +1 -0
  10. package/dist/components/CedrosPay.d.ts.map +1 -1
  11. package/dist/components/CreditsButton.d.ts +42 -0
  12. package/dist/components/CreditsButton.d.ts.map +1 -0
  13. package/dist/components/CreditsSubscribeButton.d.ts +55 -0
  14. package/dist/components/CreditsSubscribeButton.d.ts.map +1 -0
  15. package/dist/components/CryptoButton.d.ts.map +1 -1
  16. package/dist/components/CryptoSubscribeButton.d.ts +50 -0
  17. package/dist/components/CryptoSubscribeButton.d.ts.map +1 -0
  18. package/dist/components/PaymentModal.d.ts +8 -2
  19. package/dist/components/PaymentModal.d.ts.map +1 -1
  20. package/dist/components/PurchaseButton.d.ts +14 -3
  21. package/dist/components/PurchaseButton.d.ts.map +1 -1
  22. package/dist/components/SubscribeButton.d.ts +55 -0
  23. package/dist/components/SubscribeButton.d.ts.map +1 -0
  24. package/dist/components/SubscriptionManagementPanel.d.ts +67 -0
  25. package/dist/components/SubscriptionManagementPanel.d.ts.map +1 -0
  26. package/dist/components/admin/AISettingsSection.d.ts +3 -0
  27. package/dist/components/admin/AISettingsSection.d.ts.map +1 -0
  28. package/dist/components/admin/AdminAuthManager.d.ts +95 -0
  29. package/dist/components/admin/AdminAuthManager.d.ts.map +1 -0
  30. package/dist/components/admin/CedrosPayAdminDashboard.d.ts +40 -0
  31. package/dist/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -0
  32. package/dist/components/admin/ConfigEditor.d.ts +13 -0
  33. package/dist/components/admin/ConfigEditor.d.ts.map +1 -0
  34. package/dist/components/admin/CouponsSection.d.ts +3 -0
  35. package/dist/components/admin/CouponsSection.d.ts.map +1 -0
  36. package/dist/components/admin/Dropdown.d.ts +29 -0
  37. package/dist/components/admin/Dropdown.d.ts.map +1 -0
  38. package/dist/components/admin/FAQSection.d.ts +3 -0
  39. package/dist/components/admin/FAQSection.d.ts.map +1 -0
  40. package/dist/components/admin/MessagingSection.d.ts +10 -0
  41. package/dist/components/admin/MessagingSection.d.ts.map +1 -0
  42. package/dist/components/admin/OverviewSection.d.ts +3 -0
  43. package/dist/components/admin/OverviewSection.d.ts.map +1 -0
  44. package/dist/components/admin/PaymentSettingsSection.d.ts +3 -0
  45. package/dist/components/admin/PaymentSettingsSection.d.ts.map +1 -0
  46. package/dist/components/admin/ProductVariationsEditor.d.ts +14 -0
  47. package/dist/components/admin/ProductVariationsEditor.d.ts.map +1 -0
  48. package/dist/components/admin/ProductsSection.d.ts +3 -0
  49. package/dist/components/admin/ProductsSection.d.ts.map +1 -0
  50. package/dist/components/admin/RefundsSection.d.ts +3 -0
  51. package/dist/components/admin/RefundsSection.d.ts.map +1 -0
  52. package/dist/components/admin/SettingsSection.d.ts +10 -0
  53. package/dist/components/admin/SettingsSection.d.ts.map +1 -0
  54. package/dist/components/admin/SingleCategorySettings.d.ts +21 -0
  55. package/dist/components/admin/SingleCategorySettings.d.ts.map +1 -0
  56. package/dist/components/admin/StatsBar.d.ts +19 -0
  57. package/dist/components/admin/StatsBar.d.ts.map +1 -0
  58. package/dist/components/admin/StorefrontSection.d.ts +3 -0
  59. package/dist/components/admin/StorefrontSection.d.ts.map +1 -0
  60. package/dist/components/admin/SubscriptionsSection.d.ts +3 -0
  61. package/dist/components/admin/SubscriptionsSection.d.ts.map +1 -0
  62. package/dist/components/admin/TransactionsSection.d.ts +3 -0
  63. package/dist/components/admin/TransactionsSection.d.ts.map +1 -0
  64. package/dist/components/admin/VariantInventoryGrid.d.ts +19 -0
  65. package/dist/components/admin/VariantInventoryGrid.d.ts.map +1 -0
  66. package/dist/components/admin/VariationTypeEditor.d.ts +15 -0
  67. package/dist/components/admin/VariationTypeEditor.d.ts.map +1 -0
  68. package/dist/components/admin/configApi.d.ts +104 -0
  69. package/dist/components/admin/configApi.d.ts.map +1 -0
  70. package/dist/components/admin/icons.d.ts +50 -0
  71. package/dist/components/admin/icons.d.ts.map +1 -0
  72. package/dist/components/admin/index.d.ts +16 -0
  73. package/dist/components/admin/index.d.ts.map +1 -0
  74. package/dist/components/admin/sections-more.d.ts +12 -0
  75. package/dist/components/admin/sections-more.d.ts.map +1 -0
  76. package/dist/components/admin/sections.d.ts +12 -0
  77. package/dist/components/admin/sections.d.ts.map +1 -0
  78. package/dist/components/admin/types.d.ts +324 -0
  79. package/dist/components/admin/types.d.ts.map +1 -0
  80. package/dist/components/admin/useAdminAuth.d.ts +50 -0
  81. package/dist/components/admin/useAdminAuth.d.ts.map +1 -0
  82. package/dist/components/admin/useAutosave.d.ts +56 -0
  83. package/dist/components/admin/useAutosave.d.ts.map +1 -0
  84. package/dist/components/admin/useProductVariations.d.ts +56 -0
  85. package/dist/components/admin/useProductVariations.d.ts.map +1 -0
  86. package/dist/components/subscriptionPanelStyles.d.ts +12 -0
  87. package/dist/components/subscriptionPanelStyles.d.ts.map +1 -0
  88. package/dist/context/CedrosContext.d.ts +6 -0
  89. package/dist/context/CedrosContext.d.ts.map +1 -1
  90. package/dist/context/ThemeContext.d.ts +6 -0
  91. package/dist/context/ThemeContext.d.ts.map +1 -1
  92. package/dist/crypto-only.d.ts +1 -1
  93. package/dist/crypto-only.d.ts.map +1 -1
  94. package/dist/crypto-only.js +1 -1
  95. package/dist/crypto-only.mjs +16 -17
  96. package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts +2 -0
  97. package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +1 -0
  98. package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts +2 -0
  99. package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +1 -0
  100. package/dist/ecommerce/__tests__/cartReducer.test.d.ts +2 -0
  101. package/dist/ecommerce/__tests__/cartReducer.test.d.ts.map +1 -0
  102. package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts +2 -0
  103. package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts.map +1 -0
  104. package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts +2 -0
  105. package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +1 -0
  106. package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts +2 -0
  107. package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts.map +1 -0
  108. package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts +2 -0
  109. package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts.map +1 -0
  110. package/dist/ecommerce/__tests__/mockAdapter.test.d.ts +2 -0
  111. package/dist/ecommerce/__tests__/mockAdapter.test.d.ts.map +1 -0
  112. package/dist/ecommerce/adapters/CommerceAdapter.d.ts +235 -0
  113. package/dist/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -0
  114. package/dist/ecommerce/adapters/mock/mockAdapter.d.ts +3 -0
  115. package/dist/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -0
  116. package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts +6 -0
  117. package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -0
  118. package/dist/ecommerce/components/cart/CartLineItem.d.ts +12 -0
  119. package/dist/ecommerce/components/cart/CartLineItem.d.ts.map +1 -0
  120. package/dist/ecommerce/components/cart/CartPageContent.d.ts +6 -0
  121. package/dist/ecommerce/components/cart/CartPageContent.d.ts.map +1 -0
  122. package/dist/ecommerce/components/cart/CartPanel.d.ts +5 -0
  123. package/dist/ecommerce/components/cart/CartPanel.d.ts.map +1 -0
  124. package/dist/ecommerce/components/cart/CartSidebar.d.ts +11 -0
  125. package/dist/ecommerce/components/cart/CartSidebar.d.ts.map +1 -0
  126. package/dist/ecommerce/components/cart/CartSummary.d.ts +13 -0
  127. package/dist/ecommerce/components/cart/CartSummary.d.ts.map +1 -0
  128. package/dist/ecommerce/components/cart/PromoCodeInput.d.ts +6 -0
  129. package/dist/ecommerce/components/cart/PromoCodeInput.d.ts.map +1 -0
  130. package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts +9 -0
  131. package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts.map +1 -0
  132. package/dist/ecommerce/components/catalog/CategoryNav.d.ts +8 -0
  133. package/dist/ecommerce/components/catalog/CategoryNav.d.ts.map +1 -0
  134. package/dist/ecommerce/components/catalog/FilterPanel.d.ts +29 -0
  135. package/dist/ecommerce/components/catalog/FilterPanel.d.ts.map +1 -0
  136. package/dist/ecommerce/components/catalog/Price.d.ts +9 -0
  137. package/dist/ecommerce/components/catalog/Price.d.ts.map +1 -0
  138. package/dist/ecommerce/components/catalog/ProductCard.d.ts +14 -0
  139. package/dist/ecommerce/components/catalog/ProductCard.d.ts.map +1 -0
  140. package/dist/ecommerce/components/catalog/ProductGallery.d.ts +6 -0
  141. package/dist/ecommerce/components/catalog/ProductGallery.d.ts.map +1 -0
  142. package/dist/ecommerce/components/catalog/ProductGrid.d.ts +20 -0
  143. package/dist/ecommerce/components/catalog/ProductGrid.d.ts.map +1 -0
  144. package/dist/ecommerce/components/catalog/QuantitySelector.d.ts +8 -0
  145. package/dist/ecommerce/components/catalog/QuantitySelector.d.ts.map +1 -0
  146. package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts +10 -0
  147. package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts.map +1 -0
  148. package/dist/ecommerce/components/catalog/SearchInput.d.ts +7 -0
  149. package/dist/ecommerce/components/catalog/SearchInput.d.ts.map +1 -0
  150. package/dist/ecommerce/components/catalog/VariantSelector.d.ts +19 -0
  151. package/dist/ecommerce/components/catalog/VariantSelector.d.ts.map +1 -0
  152. package/dist/ecommerce/components/chat/ShopChatPanel.d.ts +4 -0
  153. package/dist/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -0
  154. package/dist/ecommerce/components/checkout/AddressForm.d.ts +9 -0
  155. package/dist/ecommerce/components/checkout/AddressForm.d.ts.map +1 -0
  156. package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts +24 -0
  157. package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +1 -0
  158. package/dist/ecommerce/components/checkout/CheckoutForm.d.ts +4 -0
  159. package/dist/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -0
  160. package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts +6 -0
  161. package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts.map +1 -0
  162. package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts +8 -0
  163. package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +1 -0
  164. package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts +29 -0
  165. package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +1 -0
  166. package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts +19 -0
  167. package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +1 -0
  168. package/dist/ecommerce/components/checkout/OrderReview.d.ts +4 -0
  169. package/dist/ecommerce/components/checkout/OrderReview.d.ts.map +1 -0
  170. package/dist/ecommerce/components/checkout/PaymentStep.d.ts +15 -0
  171. package/dist/ecommerce/components/checkout/PaymentStep.d.ts.map +1 -0
  172. package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts +9 -0
  173. package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +1 -0
  174. package/dist/ecommerce/components/faq/FAQItem.d.ts +29 -0
  175. package/dist/ecommerce/components/faq/FAQItem.d.ts.map +1 -0
  176. package/dist/ecommerce/components/faq/FAQItem.test.d.ts +7 -0
  177. package/dist/ecommerce/components/faq/FAQItem.test.d.ts.map +1 -0
  178. package/dist/ecommerce/components/faq/FAQList.d.ts +15 -0
  179. package/dist/ecommerce/components/faq/FAQList.d.ts.map +1 -0
  180. package/dist/ecommerce/components/faq/index.d.ts +3 -0
  181. package/dist/ecommerce/components/faq/index.d.ts.map +1 -0
  182. package/dist/ecommerce/components/general/EmptyState.d.ts +8 -0
  183. package/dist/ecommerce/components/general/EmptyState.d.ts.map +1 -0
  184. package/dist/ecommerce/components/general/ErrorBoundary.d.ts +16 -0
  185. package/dist/ecommerce/components/general/ErrorBoundary.d.ts.map +1 -0
  186. package/dist/ecommerce/components/general/ErrorState.d.ts +7 -0
  187. package/dist/ecommerce/components/general/ErrorState.d.ts.map +1 -0
  188. package/dist/ecommerce/components/general/toast.d.ts +19 -0
  189. package/dist/ecommerce/components/general/toast.d.ts.map +1 -0
  190. package/dist/ecommerce/components/orders/OrderCard.d.ts +7 -0
  191. package/dist/ecommerce/components/orders/OrderCard.d.ts.map +1 -0
  192. package/dist/ecommerce/components/orders/OrderDetails.d.ts +7 -0
  193. package/dist/ecommerce/components/orders/OrderDetails.d.ts.map +1 -0
  194. package/dist/ecommerce/components/orders/OrderList.d.ts +7 -0
  195. package/dist/ecommerce/components/orders/OrderList.d.ts.map +1 -0
  196. package/dist/ecommerce/components/ui/accordion.d.ts +7 -0
  197. package/dist/ecommerce/components/ui/accordion.d.ts.map +1 -0
  198. package/dist/ecommerce/components/ui/badge.d.ts +10 -0
  199. package/dist/ecommerce/components/ui/badge.d.ts.map +1 -0
  200. package/dist/ecommerce/components/ui/button.d.ts +12 -0
  201. package/dist/ecommerce/components/ui/button.d.ts.map +1 -0
  202. package/dist/ecommerce/components/ui/card.d.ts +8 -0
  203. package/dist/ecommerce/components/ui/card.d.ts.map +1 -0
  204. package/dist/ecommerce/components/ui/dialog.d.ts +13 -0
  205. package/dist/ecommerce/components/ui/dialog.d.ts.map +1 -0
  206. package/dist/ecommerce/components/ui/input.d.ts +5 -0
  207. package/dist/ecommerce/components/ui/input.d.ts.map +1 -0
  208. package/dist/ecommerce/components/ui/label.d.ts +3 -0
  209. package/dist/ecommerce/components/ui/label.d.ts.map +1 -0
  210. package/dist/ecommerce/components/ui/select.d.ts +9 -0
  211. package/dist/ecommerce/components/ui/select.d.ts.map +1 -0
  212. package/dist/ecommerce/components/ui/separator.d.ts +4 -0
  213. package/dist/ecommerce/components/ui/separator.d.ts.map +1 -0
  214. package/dist/ecommerce/components/ui/sheet.d.ts +21 -0
  215. package/dist/ecommerce/components/ui/sheet.d.ts.map +1 -0
  216. package/dist/ecommerce/components/ui/skeleton.d.ts +3 -0
  217. package/dist/ecommerce/components/ui/skeleton.d.ts.map +1 -0
  218. package/dist/ecommerce/components/ui/tabs.d.ts +7 -0
  219. package/dist/ecommerce/components/ui/tabs.d.ts.map +1 -0
  220. package/dist/ecommerce/components/ui/textarea.d.ts +5 -0
  221. package/dist/ecommerce/components/ui/textarea.d.ts.map +1 -0
  222. package/dist/ecommerce/config/context.d.ts +13 -0
  223. package/dist/ecommerce/config/context.d.ts.map +1 -0
  224. package/dist/ecommerce/config/types.d.ts +48 -0
  225. package/dist/ecommerce/config/types.d.ts.map +1 -0
  226. package/dist/ecommerce/hooks/checkoutReturn.d.ts +3 -0
  227. package/dist/ecommerce/hooks/checkoutReturn.d.ts.map +1 -0
  228. package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts +33 -0
  229. package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts.map +1 -0
  230. package/dist/ecommerce/hooks/useCartInventory.d.ts +42 -0
  231. package/dist/ecommerce/hooks/useCartInventory.d.ts.map +1 -0
  232. package/dist/ecommerce/hooks/useCatalogUrlState.d.ts +15 -0
  233. package/dist/ecommerce/hooks/useCatalogUrlState.d.ts.map +1 -0
  234. package/dist/ecommerce/hooks/useCategories.d.ts +7 -0
  235. package/dist/ecommerce/hooks/useCategories.d.ts.map +1 -0
  236. package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts +4 -0
  237. package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +1 -0
  238. package/dist/ecommerce/hooks/useHoldExpiry.d.ts +34 -0
  239. package/dist/ecommerce/hooks/useHoldExpiry.d.ts.map +1 -0
  240. package/dist/ecommerce/hooks/useInventoryVerification.d.ts +41 -0
  241. package/dist/ecommerce/hooks/useInventoryVerification.d.ts.map +1 -0
  242. package/dist/ecommerce/hooks/useOrders.d.ts +7 -0
  243. package/dist/ecommerce/hooks/useOrders.d.ts.map +1 -0
  244. package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts +6 -0
  245. package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +1 -0
  246. package/dist/ecommerce/hooks/useProduct.d.ts +7 -0
  247. package/dist/ecommerce/hooks/useProduct.d.ts.map +1 -0
  248. package/dist/ecommerce/hooks/useProducts.d.ts +8 -0
  249. package/dist/ecommerce/hooks/useProducts.d.ts.map +1 -0
  250. package/dist/ecommerce/hooks/useShippingMethods.d.ts +10 -0
  251. package/dist/ecommerce/hooks/useShippingMethods.d.ts.map +1 -0
  252. package/dist/ecommerce/hooks/useStorefrontSettings.d.ts +32 -0
  253. package/dist/ecommerce/hooks/useStorefrontSettings.d.ts.map +1 -0
  254. package/dist/ecommerce/hooks/useSubscriptionData.d.ts +8 -0
  255. package/dist/ecommerce/hooks/useSubscriptionData.d.ts.map +1 -0
  256. package/dist/ecommerce/index.d.ts +98 -0
  257. package/dist/ecommerce/index.d.ts.map +1 -0
  258. package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts +10 -0
  259. package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +1 -0
  260. package/dist/ecommerce/state/cart/CartProvider.d.ts +27 -0
  261. package/dist/ecommerce/state/cart/CartProvider.d.ts.map +1 -0
  262. package/dist/ecommerce/state/cart/cartReducer.d.ts +35 -0
  263. package/dist/ecommerce/state/cart/cartReducer.d.ts.map +1 -0
  264. package/dist/ecommerce/state/checkout/checkoutSchema.d.ts +21 -0
  265. package/dist/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -0
  266. package/dist/ecommerce/state/checkout/useCheckout.d.ts +34 -0
  267. package/dist/ecommerce/state/checkout/useCheckout.d.ts.map +1 -0
  268. package/dist/ecommerce/templates/CartTemplate.d.ts +5 -0
  269. package/dist/ecommerce/templates/CartTemplate.d.ts.map +1 -0
  270. package/dist/ecommerce/templates/CategoryTemplate.d.ts +11 -0
  271. package/dist/ecommerce/templates/CategoryTemplate.d.ts.map +1 -0
  272. package/dist/ecommerce/templates/CheckoutTemplate.d.ts +9 -0
  273. package/dist/ecommerce/templates/CheckoutTemplate.d.ts.map +1 -0
  274. package/dist/ecommerce/templates/ProductTemplate.d.ts +11 -0
  275. package/dist/ecommerce/templates/ProductTemplate.d.ts.map +1 -0
  276. package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts +6 -0
  277. package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +1 -0
  278. package/dist/ecommerce/templates/ReceiptTemplate.d.ts +19 -0
  279. package/dist/ecommerce/templates/ReceiptTemplate.d.ts.map +1 -0
  280. package/dist/ecommerce/templates/ShopTemplate.d.ts +15 -0
  281. package/dist/ecommerce/templates/ShopTemplate.d.ts.map +1 -0
  282. package/dist/ecommerce/templates/SubscriptionTemplate.d.ts +15 -0
  283. package/dist/ecommerce/templates/SubscriptionTemplate.d.ts.map +1 -0
  284. package/dist/ecommerce/testing/adapterContract.d.ts +11 -0
  285. package/dist/ecommerce/testing/adapterContract.d.ts.map +1 -0
  286. package/dist/ecommerce/types.d.ts +164 -0
  287. package/dist/ecommerce/types.d.ts.map +1 -0
  288. package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts +18 -0
  289. package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts.map +1 -0
  290. package/dist/ecommerce/utils/cartItemMetadata.d.ts +3 -0
  291. package/dist/ecommerce/utils/cartItemMetadata.d.ts.map +1 -0
  292. package/dist/ecommerce/utils/cn.d.ts +3 -0
  293. package/dist/ecommerce/utils/cn.d.ts.map +1 -0
  294. package/dist/ecommerce/utils/money.d.ts +6 -0
  295. package/dist/ecommerce/utils/money.d.ts.map +1 -0
  296. package/dist/ecommerce/utils/storage.d.ts +5 -0
  297. package/dist/ecommerce/utils/storage.d.ts.map +1 -0
  298. package/dist/en-BXheDBal.mjs +19 -0
  299. package/dist/en-Yikrt96u.js +1 -0
  300. package/dist/hooks/useCreditsPayment.d.ts +64 -0
  301. package/dist/hooks/useCreditsPayment.d.ts.map +1 -0
  302. package/dist/hooks/useCreditsSubscription.d.ts +42 -0
  303. package/dist/hooks/useCreditsSubscription.d.ts.map +1 -0
  304. package/dist/hooks/useCryptoSubscription.d.ts +42 -0
  305. package/dist/hooks/useCryptoSubscription.d.ts.map +1 -0
  306. package/dist/hooks/usePaymentMode.d.ts.map +1 -1
  307. package/dist/hooks/useStripeCheckout.d.ts +1 -0
  308. package/dist/hooks/useStripeCheckout.d.ts.map +1 -1
  309. package/dist/hooks/useSubscription.d.ts +42 -0
  310. package/dist/hooks/useSubscription.d.ts.map +1 -0
  311. package/dist/hooks/useSubscriptionManagement.d.ts +92 -0
  312. package/dist/hooks/useSubscriptionManagement.d.ts.map +1 -0
  313. package/dist/hooks/useX402Payment.d.ts +1 -0
  314. package/dist/hooks/useX402Payment.d.ts.map +1 -1
  315. package/dist/i18n/index.d.ts +7 -0
  316. package/dist/i18n/index.d.ts.map +1 -1
  317. package/dist/index-D2d_ukkR.mjs +26838 -0
  318. package/dist/index-DGkSHjb1.js +136 -0
  319. package/dist/index.d.ts +20 -2
  320. package/dist/index.d.ts.map +1 -1
  321. package/dist/index.js +1 -1
  322. package/dist/index.mjs +79 -625
  323. package/dist/magic-string.es-B81Zo59j.js +10 -0
  324. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  325. package/dist/managers/CreditsManager.d.ts +151 -0
  326. package/dist/managers/CreditsManager.d.ts.map +1 -0
  327. package/dist/managers/ManagerCache.d.ts +6 -0
  328. package/dist/managers/ManagerCache.d.ts.map +1 -1
  329. package/dist/managers/RouteDiscoveryManager.d.ts.map +1 -1
  330. package/dist/managers/StripeManager.d.ts.map +1 -1
  331. package/dist/managers/SubscriptionChangeManager.d.ts +42 -0
  332. package/dist/managers/SubscriptionChangeManager.d.ts.map +1 -0
  333. package/dist/managers/SubscriptionManager.d.ts +113 -0
  334. package/dist/managers/SubscriptionManager.d.ts.map +1 -0
  335. package/dist/managers/X402Manager.d.ts.map +1 -1
  336. package/dist/pay-react.css +1 -1
  337. package/dist/sections-6IcZ6JeN.js +1 -0
  338. package/dist/sections-a0Dz-MMz.mjs +10 -0
  339. package/dist/stripe-only.d.ts +1 -1
  340. package/dist/stripe-only.d.ts.map +1 -1
  341. package/dist/stripe-only.js +1 -1
  342. package/dist/stripe-only.mjs +12 -13
  343. package/dist/styles-C4-_hbgr.js +1 -0
  344. package/dist/styles-QcAsIVWl.mjs +1909 -0
  345. package/dist/telemetry.js +1 -1
  346. package/dist/telemetry.mjs +1 -1
  347. package/dist/testing/index.js +147 -1
  348. package/dist/testing/index.mjs +10555 -103
  349. package/dist/types/componentOptions.d.ts +14 -4
  350. package/dist/types/componentOptions.d.ts.map +1 -1
  351. package/dist/types/errors.d.ts +26 -4
  352. package/dist/types/errors.d.ts.map +1 -1
  353. package/dist/types/index.d.ts +116 -0
  354. package/dist/types/index.d.ts.map +1 -1
  355. package/dist/types/subscription.d.ts +300 -0
  356. package/dist/types/subscription.d.ts.map +1 -0
  357. package/dist/utils/cartHelpers.d.ts +3 -0
  358. package/dist/utils/cartHelpers.d.ts.map +1 -1
  359. package/dist/utils/cspHelper.d.ts +7 -1
  360. package/dist/utils/cspHelper.d.ts.map +1 -1
  361. package/dist/utils/csvHelpers.d.ts +62 -0
  362. package/dist/utils/csvHelpers.d.ts.map +1 -0
  363. package/dist/utils/csvHelpers.test.d.ts +2 -0
  364. package/dist/utils/csvHelpers.test.d.ts.map +1 -0
  365. package/dist/utils/dateHelpers.d.ts +24 -0
  366. package/dist/utils/dateHelpers.d.ts.map +1 -0
  367. package/dist/utils/eventEmitter.d.ts +1 -1
  368. package/dist/utils/eventEmitter.d.ts.map +1 -1
  369. package/dist/utils/fetchWithTimeout.d.ts +3 -3
  370. package/dist/utils/index.d.ts +2 -1
  371. package/dist/utils/index.d.ts.map +1 -1
  372. package/dist/utils/tokenMintValidator.d.ts +10 -6
  373. package/dist/utils/tokenMintValidator.d.ts.map +1 -1
  374. package/dist/utils/uuid.d.ts.map +1 -1
  375. package/dist/uuid-C5B8o31X.js +1 -0
  376. package/dist/uuid-_z3jSatJ.mjs +17 -0
  377. package/package.json +25 -9
  378. package/dist/CedrosContext-B3iCqN6e.js +0 -11
  379. package/dist/CedrosContext-vX9uqZKp.mjs +0 -1796
  380. package/dist/en-CSsJl3nf.mjs +0 -19
  381. package/dist/en-D-uY3ltT.js +0 -1
  382. package/dist/styles-61pRysGe.js +0 -1
  383. package/dist/styles-DI2LPVdQ.mjs +0 -1625
  384. package/dist/utils/uuid-shim.d.ts +0 -9
  385. package/dist/utils/uuid-shim.d.ts.map +0 -1
  386. package/dist/uuid-C0iMjdcc.js +0 -1
  387. package/dist/uuid-UlzrVY8Y.mjs +0 -17
  388. package/dist/walletDetection-JZR3UCOa.mjs +0 -27
  389. package/dist/walletDetection-bNmV5ItZ.js +0 -1
package/dist/index.mjs CHANGED
@@ -1,627 +1,81 @@
1
- import { jsxs as q, jsx as E, Fragment as te } from "react/jsx-runtime";
2
- import M, { useState as O, useCallback as k, useMemo as G } from "react";
3
- import { ConnectionProvider as se, WalletProvider as re, useWallet as oe } from "@solana/wallet-adapter-react";
4
- import { u as ne, c as V, o as ae, q as Y, e as ce, g as ie, h as le, i as ue, r as de, P as pe, S as me, m as fe } from "./styles-DI2LPVdQ.mjs";
5
- import { C as Be, E as Ke, b as Ge, a as Ve, d as Ye, A as ze, x as Qe, t as Fe, v as Xe, w as Je, f as Ze, z as et, B as tt, l as st, k as rt, y as ot, p as nt, j as at, s as ct, D as it, n as lt } from "./styles-DI2LPVdQ.mjs";
6
- import { a as z, u as Q, g as he, f as j } from "./CedrosContext-vX9uqZKp.mjs";
7
- import { k as dt, C as pt, j as mt, i as ft, L as ht, b as yt, R as St, l as gt, W as Ct, h as Pt, d as vt, c as Et, m as wt, r as Tt, v as Rt } from "./CedrosContext-vX9uqZKp.mjs";
8
- import { clusterApiUrl as ye } from "@solana/web3.js";
9
- function Se(t) {
10
- switch (t) {
11
- case "mainnet-beta":
12
- return "https://api.mainnet-beta.solana.com";
13
- case "devnet":
14
- return "https://api.devnet.solana.com";
15
- case "testnet":
16
- return "https://api.testnet.solana.com";
17
- default:
18
- return "https://api.mainnet-beta.solana.com";
19
- }
20
- }
21
- function ge(t) {
22
- try {
23
- const s = new URL(t);
24
- return `${s.protocol}//${s.host}`;
25
- } catch {
26
- return t;
27
- }
28
- }
29
- function Ce(t = {}) {
30
- const {
31
- solanaCluster: s = "mainnet-beta",
32
- solanaEndpoint: r,
33
- customRpcProviders: o = [],
34
- allowUnsafeScripts: n = !1,
35
- additionalScriptSrc: e = [],
36
- additionalConnectSrc: h = [],
37
- additionalFrameSrc: m = [],
38
- includeStripe: y = !0
39
- } = t, l = ["'self'"];
40
- n && l.push("'unsafe-inline'", "'unsafe-eval'"), y && l.push("https://js.stripe.com"), l.push(...e);
41
- const i = ["'self'"];
42
- y && i.push("https://api.stripe.com", "https://*.stripe.com");
43
- const b = Se(s);
44
- if (i.push(b), i.push("https://*.solana.com"), r) {
45
- const P = ge(r);
46
- i.includes(P) || i.push(P);
47
- }
48
- o.forEach((P) => {
49
- i.includes(P) || i.push(P);
50
- }), i.push(...h);
51
- const g = ["'self'"];
52
- return y && g.push("https://js.stripe.com", "https://checkout.stripe.com"), g.push(...m), {
53
- scriptSrc: l,
54
- connectSrc: i,
55
- frameSrc: g
56
- };
57
- }
58
- function Pe(t, s = "header") {
59
- const { scriptSrc: r, connectSrc: o, frameSrc: n } = t;
60
- switch (s) {
61
- case "header":
62
- case "meta":
63
- case "nextjs":
64
- case "nginx": {
65
- const e = [];
66
- return r.length > 0 && e.push(`script-src ${r.join(" ")}`), o.length > 0 && e.push(`connect-src ${o.join(" ")}`), n.length > 0 && e.push(`frame-src ${n.join(" ")}`), e.join("; ");
67
- }
68
- case "helmet": {
69
- const e = {};
70
- return r.length > 0 && (e.scriptSrc = r), o.length > 0 && (e.connectSrc = o), n.length > 0 && (e.frameSrc = n), e;
71
- }
72
- case "directives":
73
- return { scriptSrc: r, connectSrc: o, frameSrc: n };
74
- default:
75
- throw new Error(`Unknown CSP format: ${s}`);
76
- }
77
- }
78
- function xe(t = {}, s = "header") {
79
- const r = Ce(t);
80
- return Pe(r, s);
81
- }
82
- const Ue = {
83
- HELIUS: "https://*.helius-rpc.com",
84
- QUICKNODE: "https://*.quicknode.pro",
85
- ALCHEMY: "https://*.alchemy.com",
86
- ANKR: "https://rpc.ankr.com",
87
- TRITON: "https://*.rpcpool.com"
88
- }, qe = {
89
- /**
90
- * Mainnet production with custom RPC (recommended)
91
- */
92
- MAINNET_CUSTOM_RPC: (t) => ({
93
- solanaCluster: "mainnet-beta",
94
- solanaEndpoint: t,
95
- allowUnsafeScripts: !1
96
- }),
97
- /**
98
- * Mainnet with Next.js (requires unsafe-inline/eval)
99
- */
100
- MAINNET_NEXTJS: (t) => ({
101
- solanaCluster: "mainnet-beta",
102
- solanaEndpoint: t,
103
- allowUnsafeScripts: !0
104
- }),
105
- /**
106
- * Devnet for testing
107
- */
108
- DEVNET: () => ({
109
- solanaCluster: "devnet",
110
- allowUnsafeScripts: !0
111
- }),
112
- /**
113
- * Crypto-only payments (no Stripe)
114
- */
115
- CRYPTO_ONLY: (t) => ({
116
- solanaCluster: "mainnet-beta",
117
- solanaEndpoint: t,
118
- includeStripe: !1
119
- }),
120
- /**
121
- * Stripe-only payments (no Solana)
122
- */
123
- STRIPE_ONLY: () => ({
124
- solanaCluster: "mainnet-beta",
125
- includeStripe: !0,
126
- // Don't include Solana RPC endpoints
127
- customRpcProviders: []
128
- })
129
- }, ve = ({
130
- resource: t,
131
- items: s,
132
- label: r,
133
- cardLabel: o,
134
- cryptoLabel: n,
135
- showCard: e = !0,
136
- showCrypto: h = !0,
137
- onPaymentAttempt: m,
138
- onPaymentSuccess: y,
139
- onPaymentError: l,
140
- onStripeSuccess: i,
141
- onCryptoSuccess: b,
142
- onStripeError: g,
143
- onCryptoError: P,
144
- customerEmail: u,
145
- successUrl: c,
146
- cancelUrl: a,
147
- metadata: S,
148
- couponCode: v,
149
- autoDetectWallets: C = !0,
150
- testPageUrl: w,
151
- hideMessages: A = !1,
152
- renderModal: N
153
- }) => {
154
- const T = z(), [D, d] = O(!1), { status: F, processPayment: H, processCartCheckout: W } = ne(), { isCartMode: R, effectiveResource: I } = V(t, s), { t: L } = ae(), X = r || L("ui.purchase"), J = o || L("ui.card"), Z = n || L("ui.usdc_solana"), $ = k(async () => {
155
- if (C && e) {
156
- const { detectSolanaWallets: p } = await import("./walletDetection-JZR3UCOa.mjs");
157
- if (!p()) {
158
- const x = R ? void 0 : I, U = R && s ? Y(s) : void 0;
159
- ce("stripe", x, U), m && m("stripe"), ie("stripe", x, U);
160
- let f;
161
- R && s ? f = await W(
162
- s,
163
- c,
164
- a,
165
- S,
166
- u,
167
- v
168
- ) : I && (f = await H(
169
- I,
170
- c,
171
- a,
172
- S,
173
- u,
174
- v
175
- )), f && f.success && f.transactionId ? (le("stripe", f.transactionId, x, U), i ? i(f.transactionId) : y && y(f.transactionId)) : f && !f.success && f.error && (ue("stripe", f.error, x, U), g ? g(f.error) : l && l(f.error));
176
- return;
177
- }
178
- }
179
- d(!0);
180
- }, [C, e, R, s, I, W, H, c, a, S, u, v, y, l, i, g, m]), B = G(() => R && s ? `purchase-cart-${s.map((p) => p.resource).join("-")}` : `purchase-${I || "unknown"}`, [R, s, I]), ee = G(
181
- () => de(B, $),
182
- [B, $]
183
- ), _ = F === "loading", K = {
184
- isOpen: D,
185
- onClose: () => d(!1),
186
- resource: R ? void 0 : I,
187
- items: R ? s : void 0,
188
- cardLabel: J,
189
- cryptoLabel: Z,
190
- showCard: e,
191
- showCrypto: h,
192
- onPaymentAttempt: m,
193
- onPaymentSuccess: (p) => {
194
- d(!1), y?.(p);
195
- },
196
- onPaymentError: (p) => {
197
- d(!1), l?.(p);
198
- },
199
- onStripeSuccess: (p) => {
200
- d(!1), i?.(p);
201
- },
202
- onCryptoSuccess: (p) => {
203
- d(!1), b?.(p);
204
- },
205
- onStripeError: (p) => {
206
- d(!1), g?.(p);
207
- },
208
- onCryptoError: (p) => {
209
- d(!1), P?.(p);
210
- },
211
- customerEmail: u,
212
- successUrl: c,
213
- cancelUrl: a,
214
- metadata: S,
215
- couponCode: v,
216
- testPageUrl: w,
217
- hideMessages: A
218
- };
219
- return /* @__PURE__ */ q("div", { className: T.unstyled ? "" : T.className, style: T.unstyled ? {} : T.style, children: [
220
- /* @__PURE__ */ E(
221
- "button",
222
- {
223
- onClick: ee,
224
- disabled: _,
225
- className: T.unstyled ? "" : "cedros-theme__button cedros-theme__stripe",
226
- style: {
227
- width: "100%",
228
- cursor: _ ? "not-allowed" : "pointer",
229
- opacity: _ ? 0.6 : 1
230
- },
231
- type: "button",
232
- children: _ ? L("ui.processing") : X
233
- }
234
- ),
235
- N ? N(K) : /* @__PURE__ */ E(pe, { ...K })
236
- ] });
237
- };
238
- function Oe(t) {
239
- const { resource: s, items: r, checkout: o = {}, display: n = {}, callbacks: e = {}, advanced: h = {} } = t, { config: m, walletPool: y } = Q(), l = z(), { isCartMode: i } = V(s, r), b = M.useMemo(() => ({
240
- marginTop: "0.5rem",
241
- fontSize: "0.875rem",
242
- color: l.tokens.surfaceText,
243
- opacity: 0.7,
244
- textAlign: "center"
245
- }), [l.tokens.surfaceText]), g = M.useMemo(
246
- () => h.wallets && h.wallets.length > 0 ? h.wallets : y.getAdapters(),
247
- [h.wallets, y]
248
- ), P = M.useMemo(
249
- () => r ? Y(r) : 0,
250
- [r]
251
- ), u = M.useMemo(
252
- () => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "stripe" }) : void 0,
253
- [e.onPaymentSuccess]
254
- ), c = M.useMemo(
255
- () => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "crypto" }) : void 0,
256
- [e.onPaymentSuccess]
257
- ), a = M.useMemo(
258
- () => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "stripe" }) : void 0,
259
- [e.onPaymentError]
260
- ), S = M.useMemo(
261
- () => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "crypto" }) : void 0,
262
- [e.onPaymentError]
263
- ), v = m.solanaEndpoint ?? ye(m.solanaCluster);
264
- if (!s && (!r || r.length === 0))
265
- return he().error('CedrosPay: Must provide either "resource" or "items" prop'), /* @__PURE__ */ E("div", { className: n.className, style: { color: l.tokens.errorText }, children: "Configuration error: No resource or items provided" });
266
- const C = n.showCard ?? !0, w = n.showCrypto ?? !0, A = n.showPurchaseButton ?? !1, N = n.layout ?? "vertical", T = n.hideMessages ?? !1, D = h.autoDetectWallets ?? !0;
267
- return /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : l.className, style: l.unstyled ? {} : l.style, children: /* @__PURE__ */ E(se, { endpoint: v, children: /* @__PURE__ */ E(re, { wallets: g, autoConnect: !1, children: /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : `cedros-theme__pay ${n.className || ""}`, children: /* @__PURE__ */ q("div", { className: l.unstyled ? "" : `cedros-theme__pay-content cedros-theme__pay-content--${N}`, children: [
268
- A ? /* @__PURE__ */ E(
269
- ve,
270
- {
271
- resource: i ? void 0 : s || r?.[0]?.resource,
272
- items: i ? r : void 0,
273
- label: n.purchaseLabel,
274
- cardLabel: n.cardLabel,
275
- cryptoLabel: n.cryptoLabel,
276
- showCard: C,
277
- showCrypto: w,
278
- onPaymentAttempt: e.onPaymentAttempt,
279
- onPaymentSuccess: u,
280
- onPaymentError: a,
281
- onStripeSuccess: u,
282
- onCryptoSuccess: c,
283
- onStripeError: a,
284
- onCryptoError: S,
285
- customerEmail: o.customerEmail,
286
- successUrl: o.successUrl,
287
- cancelUrl: o.cancelUrl,
288
- metadata: o.metadata,
289
- couponCode: o.couponCode,
290
- autoDetectWallets: D,
291
- testPageUrl: h.testPageUrl,
292
- hideMessages: T,
293
- renderModal: n.renderModal
294
- }
295
- ) : /* @__PURE__ */ q(te, { children: [
296
- C && /* @__PURE__ */ E(
297
- me,
298
- {
299
- resource: i ? void 0 : s || r?.[0]?.resource,
300
- items: i ? r : void 0,
301
- customerEmail: o.customerEmail,
302
- successUrl: o.successUrl,
303
- cancelUrl: o.cancelUrl,
304
- metadata: o.metadata,
305
- couponCode: o.couponCode,
306
- label: n.cardLabel,
307
- onAttempt: e.onPaymentAttempt,
308
- onSuccess: u,
309
- onError: a
310
- }
311
- ),
312
- w && /* @__PURE__ */ E(
313
- fe,
314
- {
315
- resource: i ? void 0 : s || r?.[0]?.resource,
316
- items: i ? r : void 0,
317
- metadata: o.metadata,
318
- couponCode: o.couponCode,
319
- label: n.cryptoLabel,
320
- onAttempt: e.onPaymentAttempt,
321
- onSuccess: c,
322
- onError: S,
323
- testPageUrl: h.testPageUrl,
324
- hideMessages: T
325
- }
326
- )
327
- ] }),
328
- i && r && r.length > 1 && !T && /* @__PURE__ */ q("div", { style: b, children: [
329
- "Checking out ",
330
- P,
331
- " items"
332
- ] })
333
- ] }) }) }) }) });
334
- }
335
- function Ae() {
336
- const { x402Manager: t, walletManager: s } = Q(), { publicKey: r, signTransaction: o } = oe(), [n, e] = O({
337
- status: "idle",
338
- error: null,
339
- transactionId: null
340
- }), [h, m] = O(null), [y, l] = O(null), i = k(
341
- async (u) => {
342
- try {
343
- e((a) => ({ ...a, status: "loading" }));
344
- const c = await t.requestQuote({ resource: u });
345
- if (!t.validateRequirement(c))
346
- throw new Error("Invalid refund requirement received from server");
347
- return m(c), e((a) => ({ ...a, status: "idle" })), c;
348
- } catch (c) {
349
- const a = j(c, "Failed to fetch refund requirement");
350
- throw e({
351
- status: "error",
352
- error: a,
353
- transactionId: null
354
- }), c;
355
- }
356
- },
357
- [t]
358
- ), b = k(
359
- async (u, c) => {
360
- if (!r || !o)
361
- throw new Error("Wallet not connected");
362
- try {
363
- e({
364
- status: "loading",
365
- error: null,
366
- transactionId: null
367
- });
368
- const a = await t.requestQuote({ resource: u, couponCode: c });
369
- if (!t.validateRequirement(a))
370
- throw new Error("Invalid refund requirement received");
371
- m(a);
372
- const S = await s.buildTransaction({
373
- requirement: a,
374
- payerPublicKey: r
375
- }), v = await s.signTransaction({
376
- transaction: S,
377
- signTransaction: o
378
- }), C = s.buildPaymentPayload({
379
- requirement: a,
380
- signedTx: v,
381
- payerPublicKey: r
382
- }), w = await t.submitPayment({
383
- resource: u,
384
- payload: C,
385
- couponCode: c,
386
- metadata: void 0,
387
- // no metadata for refunds
388
- resourceType: "refund"
389
- });
390
- return w.settlement && l(w.settlement), e({
391
- status: "success",
392
- error: null,
393
- transactionId: w.transactionId || v.signature
394
- }), w;
395
- } catch (a) {
396
- const S = j(a, "Refund payment failed");
397
- throw e({
398
- status: "error",
399
- error: S,
400
- transactionId: null
401
- }), a;
402
- }
403
- },
404
- [r, o, t, s]
405
- ), g = k(
406
- async (u) => {
407
- if (!r || !o)
408
- throw new Error("Wallet not connected");
409
- try {
410
- e({
411
- status: "loading",
412
- error: null,
413
- transactionId: null
414
- });
415
- const c = await t.requestQuote({ resource: u });
416
- if (!t.validateRequirement(c))
417
- throw new Error("Invalid refund requirement received");
418
- m(c);
419
- const { transaction: a } = await t.buildGaslessTransaction({
420
- resourceId: u,
421
- userWallet: r.toString(),
422
- feePayer: c.extra.feePayer
423
- }), S = s.deserializeTransaction(a), v = await s.partiallySignTransaction({
424
- transaction: S,
425
- signTransaction: o
426
- }), C = await t.submitGaslessTransaction({
427
- resource: u,
428
- partialTx: v,
429
- couponCode: void 0,
430
- // no couponCode
431
- metadata: void 0,
432
- // no metadata
433
- resourceType: "refund",
434
- requirement: c
435
- });
436
- return C.settlement && l(C.settlement), e({
437
- status: "success",
438
- error: null,
439
- transactionId: C.transactionId || "gasless-refund-tx"
440
- }), C;
441
- } catch (c) {
442
- const a = j(c, "Gasless refund payment failed");
443
- throw e({
444
- status: "error",
445
- error: a,
446
- transactionId: null
447
- }), c;
448
- }
449
- },
450
- [r, o, t, s]
451
- ), P = k(() => {
452
- e({
453
- status: "idle",
454
- error: null,
455
- transactionId: null
456
- }), m(null), l(null);
457
- }, []);
458
- return {
459
- state: n,
460
- requirement: h,
461
- settlement: y,
462
- fetchRefundQuote: i,
463
- processRefund: b,
464
- processGaslessRefund: g,
465
- reset: P
466
- };
467
- }
468
- function Ee() {
469
- if (typeof window > "u")
470
- return {
471
- passed: !0,
472
- severity: "info",
473
- message: "HTTPS check skipped (SSR environment)"
474
- };
475
- const t = window.location.protocol === "https:", s = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
476
- return t || s ? {
477
- passed: !0,
478
- severity: "info",
479
- message: "HTTPS enforced"
480
- } : {
481
- passed: !1,
482
- severity: "error",
483
- message: "Page not served over HTTPS",
484
- recommendation: "Enable HTTPS for all payment pages. Stripe.js requires HTTPS in production."
485
- };
486
- }
487
- function we() {
488
- return typeof document > "u" ? {
489
- passed: !0,
490
- severity: "info",
491
- message: "CSP check skipped (SSR environment)"
492
- } : document.querySelector('meta[http-equiv="Content-Security-Policy"]') ? {
493
- passed: !0,
494
- severity: "info",
495
- message: "Content Security Policy detected"
496
- } : {
497
- passed: !1,
498
- severity: "warning",
499
- message: "No Content Security Policy detected",
500
- recommendation: "Configure CSP headers to protect against XSS and CDN compromise. Use generateCSP() helper from @cedros/pay-react."
501
- };
502
- }
503
- function Te() {
504
- return process.env.NODE_ENV === "development" || typeof window < "u" && window.location.hostname === "localhost" ? {
505
- passed: !0,
506
- severity: "info",
507
- message: "Running in development mode (some security checks relaxed)"
508
- } : {
509
- passed: !0,
510
- severity: "info",
511
- message: "Running in production mode"
512
- };
513
- }
514
- function Re() {
515
- return {
516
- passed: !0,
517
- severity: "info",
518
- message: "Stripe.js loaded via @stripe/stripe-js package (CSP recommended, not SRI)",
519
- recommendation: "Ensure CSP script-src includes https://js.stripe.com"
520
- };
521
- }
522
- function be() {
523
- return typeof window > "u" ? {
524
- passed: !0,
525
- severity: "info",
526
- message: "Mixed content check skipped (SSR environment)"
527
- } : window.location.protocol === "https:" ? {
528
- passed: !0,
529
- severity: "info",
530
- message: "Mixed content protection active (HTTPS page)"
531
- } : {
532
- passed: !0,
533
- severity: "info",
534
- message: "Mixed content check skipped (HTTP page)"
535
- };
536
- }
537
- function De() {
538
- const t = [
539
- Ee(),
540
- we(),
541
- Te(),
542
- Re(),
543
- be()
544
- ], s = t.some((e) => e.severity === "error" && !e.passed), r = t.some((e) => e.severity === "warning" && !e.passed);
545
- let o, n;
546
- return s ? (o = "vulnerable", n = "Security issues detected. Review errors and apply recommendations.") : r ? (o = "warnings", n = "Minor security warnings detected. Consider applying recommendations.") : (o = "secure", n = "All security checks passed."), {
547
- checks: t,
548
- overallStatus: o,
549
- summary: n
550
- };
551
- }
552
- function je(t) {
553
- process.env.NODE_ENV !== "production" && (console.group("🔒 Cedros Pay Security Report"), console.log(`Status: ${t.overallStatus.toUpperCase()}`), console.log(`Summary: ${t.summary}`), console.log(""), t.checks.forEach((s) => {
554
- const r = s.passed ? "✅" : s.severity === "error" ? "❌" : "⚠️";
555
- console.log(`${r} ${s.message}`), s.recommendation && console.log(` → ${s.recommendation}`);
556
- }), console.groupEnd());
557
- }
558
- const He = {
559
- CSP: "Use generateCSP() from @cedros/pay-react to generate Content Security Policy headers",
560
- HTTPS: "Always serve payment pages over HTTPS in production",
561
- PACKAGE_UPDATES: "Keep @stripe/stripe-js and @cedros/pay-react updated for security patches",
562
- AUDIT: "Run npm audit regularly to check for known vulnerabilities",
563
- MONITORING: "Monitor Stripe security advisories and apply updates promptly",
564
- NO_SRI: "Do NOT use SRI hashes for Stripe.js - use CSP instead"
565
- };
1
+ import { q as i, a as n, b as c, g as u, f as C, d as l, p as m, s as S, e as P, h as d, c as E, t as p, o as R, m as g, n as y, r as b, k as T, j as B, u as L, i as f, l as _, v as h } from "./index-D2d_ukkR.mjs";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import { n as v, C as M, m as I, l as A, L as D, b as O, R as W, o as x, W as z, k as N, d as U, c as V, p as j, g as G, r as Y, u as q, a as F, v as K } from "./CedrosContext-DUT3cLZg.mjs";
5
+ import "@solana/web3.js";
6
+ import "@solana/wallet-adapter-react";
7
+ import { C as w, r as H, l as J, E as Q, b as Z, P as $, a as aa, S as ea, d as sa, D as ta, z as ra, i as oa, g as ia, e as na, h as ca, t as ua, s as Ca, v as la, f as ma, B as Sa, F as Pa, k as da, j as Ea, A as pa, p as Ra, y as ga, x as ya, G as ba, c as Ta, u as Ba, n as La, m as fa } from "./styles-QcAsIVWl.mjs";
566
8
  export {
567
- Be as CEDROS_EVENTS,
568
- dt as CIRCUIT_BREAKER_PRESETS,
569
- qe as CSP_PRESETS,
570
- Oe as CedrosPay,
571
- pt as CedrosProvider,
572
- mt as CircuitBreakerOpenError,
573
- ft as CircuitState,
574
- fe as CryptoButton,
575
- Ke as ERROR_CATEGORIES,
576
- ht as LogLevel,
577
- yt as Logger,
578
- Ge as PaymentMethodBadge,
579
- pe as PaymentModal,
580
- Ve as ProductPrice,
581
- ve as PurchaseButton,
582
- St as RATE_LIMITER_PRESETS,
583
- gt as RETRY_PRESETS,
584
- Ue as RPC_PROVIDERS,
585
- He as SECURITY_RECOMMENDATIONS,
586
- me as StripeButton,
587
- Ct as WalletPool,
588
- Ye as calculateDiscountPercentage,
589
- Pt as createCircuitBreaker,
590
- vt as createLogger,
591
- Et as createRateLimiter,
592
- ze as createTranslator,
593
- wt as createWalletPool,
594
- Qe as detectLocale,
595
- ue as emitPaymentError,
596
- ie as emitPaymentProcessing,
597
- ce as emitPaymentStart,
598
- le as emitPaymentSuccess,
599
- Fe as emitWalletConnect,
600
- Xe as emitWalletConnected,
601
- Je as emitWalletError,
602
- Pe as formatCSP,
603
- Ze as formatCouponCodes,
604
- xe as generateCSP,
605
- Ce as generateCSPDirectives,
606
- et as getAvailableLocales,
607
- tt as getLocalizedError,
608
- he as getLogger,
609
- st as getUserErrorMessage,
610
- rt as isRetryableError,
611
- ot as loadLocale,
612
- je as logSecurityReport,
613
- nt as parseCouponCodes,
614
- at as parseStructuredErrorResponse,
615
- Tt as retryWithBackoff,
616
- ct as stackCheckoutCoupons,
617
- Q as useCedrosContext,
618
- z as useCedrosTheme,
619
- it as useLocalizedError,
620
- V as usePaymentMode,
621
- Ae as useRefundVerification,
622
- ne as useStripeCheckout,
623
- ae as useTranslation,
624
- lt as useX402Payment,
625
- Rt as validateConfig,
626
- De as validateSecurity
9
+ w as CEDROS_EVENTS,
10
+ v as CIRCUIT_BREAKER_PRESETS,
11
+ i as CSP_PRESETS,
12
+ n as CedrosPay,
13
+ c as CedrosPayAdminDashboard,
14
+ M as CedrosProvider,
15
+ I as CircuitBreakerOpenError,
16
+ A as CircuitState,
17
+ H as CreditsButton,
18
+ u as CreditsSubscribeButton,
19
+ J as CryptoButton,
20
+ C as CryptoSubscribeButton,
21
+ Q as ERROR_CATEGORIES,
22
+ D as LogLevel,
23
+ O as Logger,
24
+ Z as PaymentMethodBadge,
25
+ $ as PaymentModal,
26
+ aa as ProductPrice,
27
+ l as PurchaseButton,
28
+ W as RATE_LIMITER_PRESETS,
29
+ x as RETRY_PRESETS,
30
+ m as RPC_PROVIDERS,
31
+ S as SECURITY_RECOMMENDATIONS,
32
+ ea as StripeButton,
33
+ P as SubscribeButton,
34
+ d as SubscriptionManagementPanel,
35
+ z as WalletPool,
36
+ sa as calculateDiscountPercentage,
37
+ E as cedrosPayPlugin,
38
+ N as createCircuitBreaker,
39
+ U as createLogger,
40
+ V as createRateLimiter,
41
+ ta as createTranslator,
42
+ j as createWalletPool,
43
+ ra as detectLocale,
44
+ p as ecommerce,
45
+ oa as emitPaymentError,
46
+ ia as emitPaymentProcessing,
47
+ na as emitPaymentStart,
48
+ ca as emitPaymentSuccess,
49
+ ua as emitWalletConnect,
50
+ Ca as emitWalletConnected,
51
+ la as emitWalletError,
52
+ R as formatCSP,
53
+ ma as formatCouponCodes,
54
+ g as generateCSP,
55
+ y as generateCSPDirectives,
56
+ Sa as getAvailableLocales,
57
+ Pa as getLocalizedError,
58
+ G as getLogger,
59
+ da as getUserErrorMessage,
60
+ Ea as isRetryableError,
61
+ pa as loadLocale,
62
+ b as logSecurityReport,
63
+ Ra as parseCouponCodes,
64
+ Y as retryWithBackoff,
65
+ ga as stackCheckoutCoupons,
66
+ q as useCedrosContext,
67
+ F as useCedrosTheme,
68
+ ya as useCreditsPayment,
69
+ T as useCreditsSubscription,
70
+ B as useCryptoSubscription,
71
+ ba as useLocalizedError,
72
+ Ta as usePaymentMode,
73
+ L as useRefundVerification,
74
+ Ba as useStripeCheckout,
75
+ f as useSubscription,
76
+ _ as useSubscriptionManagement,
77
+ La as useTranslation,
78
+ fa as useX402Payment,
79
+ K as validateConfig,
80
+ h as validateSecurity
627
81
  };