@cedros/pay-react 1.1.17 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (710) hide show
  1. package/dist/{AISettingsSection--jn-BNmd.mjs → AISettingsSection-BH-RXvk1.mjs} +10 -10
  2. package/dist/{AISettingsSection-BrXUD4l_.js → AISettingsSection-f5K0nUoQ.js} +1 -1
  3. package/dist/{AutosaveIndicator-BQkm3cn8.js → AutosaveIndicator-CpTVtJIz.js} +1 -1
  4. package/dist/{AutosaveIndicator-B3T328jH.mjs → AutosaveIndicator-DTOaopUP.mjs} +1 -1
  5. package/dist/{CedrosContext-BnJ2Cf7R.mjs → CedrosContext-BE6P5PQ0.mjs} +241 -245
  6. package/dist/{CedrosContext-C26DlvLF.js → CedrosContext-D-lnoEkR.js} +3 -3
  7. package/dist/{CryptoButton-Dhxnk9d7.mjs → CryptoButton-CksMkZjL.mjs} +48 -48
  8. package/dist/CryptoButton-Dy-g3bR0.js +1 -0
  9. package/dist/{FAQSection-BB1wJRsR.mjs → FAQSection-BO7ZfQMN.mjs} +4 -4
  10. package/dist/{FAQSection-aoAz35MV.js → FAQSection-CVJ5w6cB.js} +1 -1
  11. package/dist/{MessagingSection-DId-WJdU.js → MessagingSection-CRFtSoE8.js} +1 -1
  12. package/dist/{MessagingSection-BG9O62ko.mjs → MessagingSection-CmFYFdaw.mjs} +5 -5
  13. package/dist/{PaymentSettingsSection-D92IO4xJ.js → PaymentSettingsSection-BKDiep-C.js} +1 -1
  14. package/dist/{PaymentSettingsSection-c13RAUxn.mjs → PaymentSettingsSection-VDcgpOkp.mjs} +1 -1
  15. package/dist/{SettingsSection-htem-WL3.mjs → SettingsSection-B0TpaIOG.mjs} +1 -1
  16. package/dist/{SettingsSection-DUxjXl2G.js → SettingsSection-DSlW47o4.js} +1 -1
  17. package/dist/SingleCategorySettings-BTXR7zex.js +3 -0
  18. package/dist/{SingleCategorySettings-BIEs6s6Z.mjs → SingleCategorySettings-Cwlehl0u.mjs} +66 -73
  19. package/dist/{StorefrontSection-CKTQt255.mjs → StorefrontSection-BAY9V1j6.mjs} +8 -8
  20. package/dist/{StorefrontSection-DcSoDx-k.js → StorefrontSection-DfN5yxkV.js} +1 -1
  21. package/dist/{SubscriptionsSection-C0hYf7Hr.js → SubscriptionsSection-BboudRYv.js} +1 -1
  22. package/dist/{SubscriptionsSection-CONwHhT4.mjs → SubscriptionsSection-D_RKCILr.mjs} +6 -6
  23. package/dist/{WalletManager-HXXyARQ7.mjs → WalletManager-D78miaJ2.mjs} +1 -1
  24. package/dist/{WalletManager-D6BYTwXn.js → WalletManager-QcfgQmap.js} +1 -1
  25. package/dist/crypto-only.d.ts +2 -23
  26. package/dist/crypto-only.js +1 -1
  27. package/dist/crypto-only.mjs +64 -63
  28. package/dist/{index-C1hbnxn0.mjs → index-75RhiLDq.mjs} +7192 -9782
  29. package/dist/index-B5ck27xb.js +84 -0
  30. package/dist/index.d.ts +2 -45
  31. package/dist/index.js +1 -1
  32. package/dist/index.mjs +64 -63
  33. package/dist/pay-react.css +1 -1
  34. package/dist/sections-BCdzdqlG.js +1 -0
  35. package/dist/sections-BIBMX6KS.mjs +8 -0
  36. package/dist/src/admin/index.d.ts.map +1 -0
  37. package/dist/src/admin/plugin.d.ts.map +1 -0
  38. package/dist/src/admin/types.d.ts.map +1 -0
  39. package/dist/src/components/CedrosPay.d.ts.map +1 -0
  40. package/dist/src/components/CreditsButton.d.ts.map +1 -0
  41. package/dist/src/components/CreditsSubscribeButton.d.ts.map +1 -0
  42. package/dist/src/components/CryptoButton.d.ts.map +1 -0
  43. package/dist/src/components/CryptoSubscribeButton.d.ts.map +1 -0
  44. package/dist/src/components/PaymentModal.d.ts.map +1 -0
  45. package/dist/src/components/ProductPrice.d.ts.map +1 -0
  46. package/dist/src/components/PurchaseButton.d.ts.map +1 -0
  47. package/dist/src/components/StripeButton.d.ts.map +1 -0
  48. package/dist/src/components/SubscribeButton.d.ts.map +1 -0
  49. package/dist/src/components/SubscriptionManagementPanel.d.ts.map +1 -0
  50. package/dist/src/components/admin/AISettingsSection.d.ts.map +1 -0
  51. package/dist/src/components/admin/AdminAuthManager.d.ts.map +1 -0
  52. package/dist/src/components/admin/AutosaveIndicator.d.ts.map +1 -0
  53. package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -0
  54. package/dist/src/components/admin/ConfigEditor.d.ts.map +1 -0
  55. package/dist/src/components/admin/CouponsSection.d.ts.map +1 -0
  56. package/dist/src/components/admin/Dropdown.d.ts.map +1 -0
  57. package/dist/src/components/admin/ErrorBanner.d.ts.map +1 -0
  58. package/dist/src/components/admin/FAQSection.d.ts.map +1 -0
  59. package/dist/src/components/admin/MessagingSection.d.ts.map +1 -0
  60. package/dist/src/components/admin/OverviewSection.d.ts.map +1 -0
  61. package/dist/src/components/admin/PaymentSettingsSection.d.ts.map +1 -0
  62. package/dist/src/components/admin/ProductVariationsEditor.d.ts.map +1 -0
  63. package/dist/src/components/admin/ProductsSection.d.ts.map +1 -0
  64. package/dist/src/components/admin/RefundsSection.d.ts.map +1 -0
  65. package/dist/src/components/admin/SecretArrayEditor.d.ts.map +1 -0
  66. package/dist/src/components/admin/SettingsSection.d.ts.map +1 -0
  67. package/dist/src/components/admin/SingleCategorySettings.d.ts.map +1 -0
  68. package/dist/src/components/admin/StatsBar.d.ts.map +1 -0
  69. package/dist/src/components/admin/StorefrontSection.d.ts.map +1 -0
  70. package/dist/src/components/admin/SubscriptionsSection.d.ts.map +1 -0
  71. package/dist/src/components/admin/Toggle.d.ts.map +1 -0
  72. package/dist/{components → src/components}/admin/TokenMintSelector.d.ts +1 -1
  73. package/dist/src/components/admin/TokenMintSelector.d.ts.map +1 -0
  74. package/dist/src/components/admin/TransactionsSection.d.ts.map +1 -0
  75. package/dist/src/components/admin/VariantInventoryGrid.d.ts.map +1 -0
  76. package/dist/src/components/admin/VariationTypeEditor.d.ts.map +1 -0
  77. package/dist/src/components/admin/configApi.d.ts.map +1 -0
  78. package/dist/src/components/admin/icons.d.ts.map +1 -0
  79. package/dist/{components → src/components}/admin/index.d.ts +1 -1
  80. package/dist/src/components/admin/index.d.ts.map +1 -0
  81. package/dist/src/components/admin/sections-more.d.ts.map +1 -0
  82. package/dist/src/components/admin/sections.d.ts.map +1 -0
  83. package/dist/src/components/admin/types.d.ts.map +1 -0
  84. package/dist/{components → src/components}/admin/useAdminAuth.d.ts +11 -23
  85. package/dist/src/components/admin/useAdminAuth.d.ts.map +1 -0
  86. package/dist/src/components/admin/useAutosave.d.ts.map +1 -0
  87. package/dist/src/components/admin/useProductVariations.d.ts.map +1 -0
  88. package/dist/src/components/subscriptionPanelStyles.d.ts.map +1 -0
  89. package/dist/src/context/CedrosContext.d.ts.map +1 -0
  90. package/dist/src/context/ThemeContext.d.ts.map +1 -0
  91. package/dist/src/context/index.d.ts.map +1 -0
  92. package/dist/src/crypto-only.d.ts +23 -0
  93. package/dist/src/crypto-only.d.ts.map +1 -0
  94. package/dist/src/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +1 -0
  95. package/dist/src/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +1 -0
  96. package/dist/src/ecommerce/__tests__/cartReducer.test.d.ts.map +1 -0
  97. package/dist/src/ecommerce/__tests__/cartServerMerge.test.d.ts.map +1 -0
  98. package/dist/src/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +1 -0
  99. package/dist/src/ecommerce/__tests__/checkoutReturn.test.d.ts.map +1 -0
  100. package/dist/src/ecommerce/__tests__/checkoutSchema.test.d.ts.map +1 -0
  101. package/dist/src/ecommerce/__tests__/inventoryHooks.test.d.ts.map +1 -0
  102. package/dist/src/ecommerce/__tests__/mockAdapter.test.d.ts.map +1 -0
  103. package/dist/src/ecommerce/__tests__/storage.test.d.ts.map +1 -0
  104. package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -0
  105. package/dist/src/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -0
  106. package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -0
  107. package/dist/src/ecommerce/adapters/paywall/paywallAdapter.test.d.ts.map +1 -0
  108. package/dist/src/ecommerce/components/cart/CartLineItem.d.ts.map +1 -0
  109. package/dist/src/ecommerce/components/cart/CartPageContent.d.ts.map +1 -0
  110. package/dist/src/ecommerce/components/cart/CartPanel.d.ts.map +1 -0
  111. package/dist/src/ecommerce/components/cart/CartSidebar.d.ts.map +1 -0
  112. package/dist/src/ecommerce/components/cart/CartSummary.d.ts.map +1 -0
  113. package/dist/src/ecommerce/components/cart/PromoCodeInput.d.ts.map +1 -0
  114. package/dist/src/ecommerce/components/catalog/Breadcrumbs.d.ts.map +1 -0
  115. package/dist/src/ecommerce/components/catalog/CategoryNav.d.ts.map +1 -0
  116. package/dist/src/ecommerce/components/catalog/FilterPanel.d.ts.map +1 -0
  117. package/dist/src/ecommerce/components/catalog/Price.d.ts.map +1 -0
  118. package/dist/src/ecommerce/components/catalog/ProductCard.d.ts.map +1 -0
  119. package/dist/src/ecommerce/components/catalog/ProductGallery.d.ts.map +1 -0
  120. package/dist/src/ecommerce/components/catalog/ProductGrid.d.ts.map +1 -0
  121. package/dist/src/ecommerce/components/catalog/QuantitySelector.d.ts.map +1 -0
  122. package/dist/src/ecommerce/components/catalog/QuickViewDialog.d.ts.map +1 -0
  123. package/dist/src/ecommerce/components/catalog/SearchInput.d.ts.map +1 -0
  124. package/dist/src/ecommerce/components/catalog/VariantSelector.d.ts.map +1 -0
  125. package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -0
  126. package/dist/src/ecommerce/components/checkout/AddressForm.d.ts.map +1 -0
  127. package/dist/src/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +1 -0
  128. package/dist/src/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -0
  129. package/dist/src/ecommerce/components/checkout/CheckoutLayout.d.ts.map +1 -0
  130. package/dist/src/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +1 -0
  131. package/dist/src/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +1 -0
  132. package/dist/src/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +1 -0
  133. package/dist/src/ecommerce/components/checkout/OrderReview.d.ts.map +1 -0
  134. package/dist/src/ecommerce/components/checkout/PaymentStep.d.ts.map +1 -0
  135. package/dist/src/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +1 -0
  136. package/dist/src/ecommerce/components/faq/FAQItem.d.ts.map +1 -0
  137. package/dist/src/ecommerce/components/faq/FAQItem.test.d.ts.map +1 -0
  138. package/dist/src/ecommerce/components/faq/FAQList.d.ts.map +1 -0
  139. package/dist/src/ecommerce/components/faq/index.d.ts.map +1 -0
  140. package/dist/src/ecommerce/components/general/EmptyState.d.ts.map +1 -0
  141. package/dist/src/ecommerce/components/general/ErrorBoundary.d.ts.map +1 -0
  142. package/dist/src/ecommerce/components/general/ErrorState.d.ts.map +1 -0
  143. package/dist/src/ecommerce/components/general/toast.d.ts.map +1 -0
  144. package/dist/src/ecommerce/components/orders/OrderCard.d.ts.map +1 -0
  145. package/dist/src/ecommerce/components/orders/OrderDetails.d.ts.map +1 -0
  146. package/dist/src/ecommerce/components/orders/OrderList.d.ts.map +1 -0
  147. package/dist/src/ecommerce/components/ui/accordion.d.ts.map +1 -0
  148. package/dist/src/ecommerce/components/ui/badge.d.ts.map +1 -0
  149. package/dist/src/ecommerce/components/ui/button.d.ts.map +1 -0
  150. package/dist/src/ecommerce/components/ui/card.d.ts.map +1 -0
  151. package/dist/src/ecommerce/components/ui/dialog.d.ts.map +1 -0
  152. package/dist/src/ecommerce/components/ui/input.d.ts.map +1 -0
  153. package/dist/src/ecommerce/components/ui/label.d.ts.map +1 -0
  154. package/dist/src/ecommerce/components/ui/select.d.ts.map +1 -0
  155. package/dist/src/ecommerce/components/ui/separator.d.ts.map +1 -0
  156. package/dist/src/ecommerce/components/ui/sheet.d.ts.map +1 -0
  157. package/dist/src/ecommerce/components/ui/skeleton.d.ts.map +1 -0
  158. package/dist/src/ecommerce/components/ui/tabs.d.ts.map +1 -0
  159. package/dist/src/ecommerce/components/ui/textarea.d.ts.map +1 -0
  160. package/dist/src/ecommerce/config/context.d.ts.map +1 -0
  161. package/dist/src/ecommerce/config/types.d.ts.map +1 -0
  162. package/dist/src/ecommerce/hooks/checkoutReturn.d.ts.map +1 -0
  163. package/dist/src/ecommerce/hooks/useAIRelatedProducts.d.ts.map +1 -0
  164. package/dist/src/ecommerce/hooks/useCartInventory.d.ts.map +1 -0
  165. package/dist/src/ecommerce/hooks/useCatalogUrlState.d.ts.map +1 -0
  166. package/dist/src/ecommerce/hooks/useCategories.d.ts.map +1 -0
  167. package/dist/src/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +1 -0
  168. package/dist/src/ecommerce/hooks/useHoldExpiry.d.ts.map +1 -0
  169. package/dist/src/ecommerce/hooks/useInventoryVerification.d.ts.map +1 -0
  170. package/dist/src/ecommerce/hooks/useOrders.d.ts.map +1 -0
  171. package/dist/src/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +1 -0
  172. package/dist/src/ecommerce/hooks/useProduct.d.ts.map +1 -0
  173. package/dist/src/ecommerce/hooks/useProducts.d.ts.map +1 -0
  174. package/dist/src/ecommerce/hooks/useShippingMethods.d.ts.map +1 -0
  175. package/dist/src/ecommerce/hooks/useStorefrontSettings.d.ts.map +1 -0
  176. package/dist/src/ecommerce/hooks/useSubscriptionData.d.ts.map +1 -0
  177. package/dist/src/ecommerce/index.d.ts.map +1 -0
  178. package/dist/src/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +1 -0
  179. package/dist/src/ecommerce/state/cart/CartProvider.d.ts.map +1 -0
  180. package/dist/src/ecommerce/state/cart/cartReducer.d.ts.map +1 -0
  181. package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -0
  182. package/dist/src/ecommerce/state/checkout/useCheckout.d.ts.map +1 -0
  183. package/dist/src/ecommerce/templates/CartTemplate.d.ts.map +1 -0
  184. package/dist/src/ecommerce/templates/CategoryTemplate.d.ts.map +1 -0
  185. package/dist/src/ecommerce/templates/CheckoutTemplate.d.ts.map +1 -0
  186. package/dist/src/ecommerce/templates/ProductTemplate.d.ts.map +1 -0
  187. package/dist/src/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +1 -0
  188. package/dist/src/ecommerce/templates/ReceiptTemplate.d.ts.map +1 -0
  189. package/dist/src/ecommerce/templates/ShopTemplate.d.ts.map +1 -0
  190. package/dist/src/ecommerce/templates/SubscriptionTemplate.d.ts.map +1 -0
  191. package/dist/src/ecommerce/testing/adapterContract.d.ts.map +1 -0
  192. package/dist/src/ecommerce/types.d.ts.map +1 -0
  193. package/dist/src/ecommerce/utils/cartCheckoutRequirements.d.ts.map +1 -0
  194. package/dist/src/ecommerce/utils/cartItemMetadata.d.ts.map +1 -0
  195. package/dist/src/ecommerce/utils/cn.d.ts.map +1 -0
  196. package/dist/src/ecommerce/utils/money.d.ts.map +1 -0
  197. package/dist/src/ecommerce/utils/storage.d.ts.map +1 -0
  198. package/dist/src/hooks/useCreditsPayment.d.ts.map +1 -0
  199. package/dist/src/hooks/useCreditsSubscription.d.ts.map +1 -0
  200. package/dist/src/hooks/useCryptoSubscription.d.ts.map +1 -0
  201. package/dist/src/hooks/usePaymentMode.d.ts.map +1 -0
  202. package/dist/src/hooks/useRefundVerification.d.ts.map +1 -0
  203. package/dist/src/hooks/useStripeCheckout.d.ts.map +1 -0
  204. package/dist/src/hooks/useSubscription.d.ts.map +1 -0
  205. package/dist/src/hooks/useSubscriptionManagement.d.ts.map +1 -0
  206. package/dist/src/hooks/useX402Payment.d.ts.map +1 -0
  207. package/dist/src/i18n/index.d.ts.map +1 -0
  208. package/dist/src/i18n/useTranslation.d.ts.map +1 -0
  209. package/dist/src/index.d.ts +45 -0
  210. package/dist/src/index.d.ts.map +1 -0
  211. package/dist/src/managers/CreditsManager.d.ts.map +1 -0
  212. package/dist/src/managers/ManagerCache.d.ts.map +1 -0
  213. package/dist/src/managers/RouteDiscoveryManager.d.ts +6 -0
  214. package/dist/src/managers/RouteDiscoveryManager.d.ts.map +1 -0
  215. package/dist/src/managers/StripeManager.d.ts.map +1 -0
  216. package/dist/src/managers/SubscriptionChangeManager.d.ts.map +1 -0
  217. package/dist/src/managers/SubscriptionManager.d.ts.map +1 -0
  218. package/dist/src/managers/WalletManager.d.ts.map +1 -0
  219. package/dist/src/managers/X402Manager.d.ts.map +1 -0
  220. package/dist/src/stripe-only.d.ts +49 -0
  221. package/dist/src/stripe-only.d.ts.map +1 -0
  222. package/dist/src/telemetry.d.ts +27 -0
  223. package/dist/src/telemetry.d.ts.map +1 -0
  224. package/dist/src/testing/__tests__/providers.test.d.ts.map +1 -0
  225. package/dist/src/testing/helpers.d.ts.map +1 -0
  226. package/dist/src/testing/index.d.ts +12 -0
  227. package/dist/src/testing/index.d.ts.map +1 -0
  228. package/dist/src/testing/mocks.d.ts.map +1 -0
  229. package/dist/src/testing/providers.d.ts.map +1 -0
  230. package/dist/src/types/componentOptions.d.ts.map +1 -0
  231. package/dist/src/types/errors.d.ts.map +1 -0
  232. package/dist/src/types/index.d.ts.map +1 -0
  233. package/dist/src/types/subscription.d.ts.map +1 -0
  234. package/dist/src/utils/__tests__/couponHelpers.test.d.ts.map +1 -0
  235. package/dist/src/utils/__tests__/cspHelper.test.d.ts.map +1 -0
  236. package/dist/src/utils/__tests__/fetchWithTimeout.test.d.ts.map +1 -0
  237. package/dist/src/utils/cartHelpers.d.ts.map +1 -0
  238. package/dist/src/utils/circuitBreaker.d.ts.map +1 -0
  239. package/dist/src/utils/couponHelpers.d.ts.map +1 -0
  240. package/dist/src/utils/cspHelper.d.ts.map +1 -0
  241. package/dist/src/utils/csvHelpers.d.ts.map +1 -0
  242. package/dist/src/utils/csvHelpers.test.d.ts.map +1 -0
  243. package/dist/src/utils/dateHelpers.d.ts.map +1 -0
  244. package/dist/src/utils/deprecation.d.ts.map +1 -0
  245. package/dist/src/utils/errorHandling.d.ts.map +1 -0
  246. package/dist/src/utils/errorMessages.d.ts.map +1 -0
  247. package/dist/src/utils/errorParser.d.ts.map +1 -0
  248. package/dist/src/utils/eventEmitter.d.ts.map +1 -0
  249. package/dist/src/utils/exponentialBackoff.d.ts.map +1 -0
  250. package/dist/src/utils/fetchWithTimeout.d.ts.map +1 -0
  251. package/dist/src/utils/index.d.ts.map +1 -0
  252. package/dist/src/utils/logger.d.ts.map +1 -0
  253. package/dist/src/utils/modalStyles.d.ts.map +1 -0
  254. package/dist/src/utils/rateLimiter.d.ts.map +1 -0
  255. package/dist/src/utils/requestDeduplication.d.ts.map +1 -0
  256. package/dist/src/utils/securityValidation.d.ts.map +1 -0
  257. package/dist/src/utils/solanaCheck.d.ts.map +1 -0
  258. package/dist/src/utils/telemetry.d.ts.map +1 -0
  259. package/dist/src/utils/tokenMintValidator.d.ts.map +1 -0
  260. package/dist/src/utils/uuid.d.ts.map +1 -0
  261. package/dist/src/utils/validateConfig.d.ts.map +1 -0
  262. package/dist/src/utils/walletDetection.d.ts.map +1 -0
  263. package/dist/src/utils/walletPool.d.ts.map +1 -0
  264. package/dist/stripe-only.d.ts +2 -14
  265. package/dist/stripe-only.js +1 -1
  266. package/dist/stripe-only.mjs +59 -62
  267. package/dist/styles--eKKnfdj.mjs +2578 -0
  268. package/dist/styles-BWrLnaUW.js +1 -0
  269. package/dist/telemetry.d.ts +2 -27
  270. package/dist/testing/index.d.ts +2 -12
  271. package/dist/testing/index.js +1 -1
  272. package/dist/testing/index.mjs +1 -1
  273. package/dist/{walletPool-DjA7J3a9.js → walletPool-BqNfOhB0.js} +1 -1
  274. package/dist/{walletPool-BV_z1lEA.mjs → walletPool-DShNjCQ6.mjs} +1 -1
  275. package/package.json +8 -3
  276. package/dist/CryptoButton-B4-oJ8lF.js +0 -1
  277. package/dist/SingleCategorySettings-CQ-osdzb.js +0 -3
  278. package/dist/admin/index.d.ts.map +0 -1
  279. package/dist/admin/plugin.d.ts.map +0 -1
  280. package/dist/admin/types.d.ts.map +0 -1
  281. package/dist/components/CedrosPay.d.ts.map +0 -1
  282. package/dist/components/CreditsButton.d.ts.map +0 -1
  283. package/dist/components/CreditsSubscribeButton.d.ts.map +0 -1
  284. package/dist/components/CryptoButton.d.ts.map +0 -1
  285. package/dist/components/CryptoSubscribeButton.d.ts.map +0 -1
  286. package/dist/components/PaymentModal.d.ts.map +0 -1
  287. package/dist/components/ProductPrice.d.ts.map +0 -1
  288. package/dist/components/PurchaseButton.d.ts.map +0 -1
  289. package/dist/components/StripeButton.d.ts.map +0 -1
  290. package/dist/components/SubscribeButton.d.ts.map +0 -1
  291. package/dist/components/SubscriptionManagementPanel.d.ts.map +0 -1
  292. package/dist/components/admin/AISettingsSection.d.ts.map +0 -1
  293. package/dist/components/admin/AdminAuthManager.d.ts.map +0 -1
  294. package/dist/components/admin/AutosaveIndicator.d.ts.map +0 -1
  295. package/dist/components/admin/CedrosPayAdminDashboard.d.ts.map +0 -1
  296. package/dist/components/admin/ConfigEditor.d.ts.map +0 -1
  297. package/dist/components/admin/CouponsSection.d.ts.map +0 -1
  298. package/dist/components/admin/Dropdown.d.ts.map +0 -1
  299. package/dist/components/admin/ErrorBanner.d.ts.map +0 -1
  300. package/dist/components/admin/FAQSection.d.ts.map +0 -1
  301. package/dist/components/admin/MessagingSection.d.ts.map +0 -1
  302. package/dist/components/admin/OverviewSection.d.ts.map +0 -1
  303. package/dist/components/admin/PaymentSettingsSection.d.ts.map +0 -1
  304. package/dist/components/admin/ProductVariationsEditor.d.ts.map +0 -1
  305. package/dist/components/admin/ProductsSection.d.ts.map +0 -1
  306. package/dist/components/admin/RefundsSection.d.ts.map +0 -1
  307. package/dist/components/admin/SecretArrayEditor.d.ts.map +0 -1
  308. package/dist/components/admin/SettingsSection.d.ts.map +0 -1
  309. package/dist/components/admin/SingleCategorySettings.d.ts.map +0 -1
  310. package/dist/components/admin/StatsBar.d.ts.map +0 -1
  311. package/dist/components/admin/StorefrontSection.d.ts.map +0 -1
  312. package/dist/components/admin/SubscriptionsSection.d.ts.map +0 -1
  313. package/dist/components/admin/Toggle.d.ts.map +0 -1
  314. package/dist/components/admin/TokenMintSelector.d.ts.map +0 -1
  315. package/dist/components/admin/TransactionsSection.d.ts.map +0 -1
  316. package/dist/components/admin/VariantInventoryGrid.d.ts.map +0 -1
  317. package/dist/components/admin/VariationTypeEditor.d.ts.map +0 -1
  318. package/dist/components/admin/configApi.d.ts.map +0 -1
  319. package/dist/components/admin/icons.d.ts.map +0 -1
  320. package/dist/components/admin/index.d.ts.map +0 -1
  321. package/dist/components/admin/sections-more.d.ts.map +0 -1
  322. package/dist/components/admin/sections.d.ts.map +0 -1
  323. package/dist/components/admin/types.d.ts.map +0 -1
  324. package/dist/components/admin/useAdminAuth.d.ts.map +0 -1
  325. package/dist/components/admin/useAutosave.d.ts.map +0 -1
  326. package/dist/components/admin/useProductVariations.d.ts.map +0 -1
  327. package/dist/components/subscriptionPanelStyles.d.ts.map +0 -1
  328. package/dist/context/CedrosContext.d.ts.map +0 -1
  329. package/dist/context/ThemeContext.d.ts.map +0 -1
  330. package/dist/context/index.d.ts.map +0 -1
  331. package/dist/crypto-only.d.ts.map +0 -1
  332. package/dist/ecommerce/__tests__/cartCheckoutRequirements.test.d.ts.map +0 -1
  333. package/dist/ecommerce/__tests__/cartProviderPersistence.test.d.ts.map +0 -1
  334. package/dist/ecommerce/__tests__/cartReducer.test.d.ts.map +0 -1
  335. package/dist/ecommerce/__tests__/cartServerMerge.test.d.ts.map +0 -1
  336. package/dist/ecommerce/__tests__/checkoutPaymentMethods.test.d.ts.map +0 -1
  337. package/dist/ecommerce/__tests__/checkoutReturn.test.d.ts.map +0 -1
  338. package/dist/ecommerce/__tests__/checkoutSchema.test.d.ts.map +0 -1
  339. package/dist/ecommerce/__tests__/inventoryHooks.test.d.ts.map +0 -1
  340. package/dist/ecommerce/__tests__/mockAdapter.test.d.ts.map +0 -1
  341. package/dist/ecommerce/__tests__/storage.test.d.ts.map +0 -1
  342. package/dist/ecommerce/adapters/CommerceAdapter.d.ts.map +0 -1
  343. package/dist/ecommerce/adapters/mock/mockAdapter.d.ts.map +0 -1
  344. package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +0 -1
  345. package/dist/ecommerce/adapters/paywall/paywallAdapter.test.d.ts.map +0 -1
  346. package/dist/ecommerce/components/cart/CartLineItem.d.ts.map +0 -1
  347. package/dist/ecommerce/components/cart/CartPageContent.d.ts.map +0 -1
  348. package/dist/ecommerce/components/cart/CartPanel.d.ts.map +0 -1
  349. package/dist/ecommerce/components/cart/CartSidebar.d.ts.map +0 -1
  350. package/dist/ecommerce/components/cart/CartSummary.d.ts.map +0 -1
  351. package/dist/ecommerce/components/cart/PromoCodeInput.d.ts.map +0 -1
  352. package/dist/ecommerce/components/catalog/Breadcrumbs.d.ts.map +0 -1
  353. package/dist/ecommerce/components/catalog/CategoryNav.d.ts.map +0 -1
  354. package/dist/ecommerce/components/catalog/FilterPanel.d.ts.map +0 -1
  355. package/dist/ecommerce/components/catalog/Price.d.ts.map +0 -1
  356. package/dist/ecommerce/components/catalog/ProductCard.d.ts.map +0 -1
  357. package/dist/ecommerce/components/catalog/ProductGallery.d.ts.map +0 -1
  358. package/dist/ecommerce/components/catalog/ProductGrid.d.ts.map +0 -1
  359. package/dist/ecommerce/components/catalog/QuantitySelector.d.ts.map +0 -1
  360. package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts.map +0 -1
  361. package/dist/ecommerce/components/catalog/SearchInput.d.ts.map +0 -1
  362. package/dist/ecommerce/components/catalog/VariantSelector.d.ts.map +0 -1
  363. package/dist/ecommerce/components/chat/ShopChatPanel.d.ts.map +0 -1
  364. package/dist/ecommerce/components/checkout/AddressForm.d.ts.map +0 -1
  365. package/dist/ecommerce/components/checkout/CheckoutCancelPage.d.ts.map +0 -1
  366. package/dist/ecommerce/components/checkout/CheckoutForm.d.ts.map +0 -1
  367. package/dist/ecommerce/components/checkout/CheckoutLayout.d.ts.map +0 -1
  368. package/dist/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +0 -1
  369. package/dist/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +0 -1
  370. package/dist/ecommerce/components/checkout/InventoryVerificationDialog.d.ts.map +0 -1
  371. package/dist/ecommerce/components/checkout/OrderReview.d.ts.map +0 -1
  372. package/dist/ecommerce/components/checkout/PaymentStep.d.ts.map +0 -1
  373. package/dist/ecommerce/components/checkout/ShippingMethodSelector.d.ts.map +0 -1
  374. package/dist/ecommerce/components/faq/FAQItem.d.ts.map +0 -1
  375. package/dist/ecommerce/components/faq/FAQItem.test.d.ts.map +0 -1
  376. package/dist/ecommerce/components/faq/FAQList.d.ts.map +0 -1
  377. package/dist/ecommerce/components/faq/index.d.ts.map +0 -1
  378. package/dist/ecommerce/components/general/EmptyState.d.ts.map +0 -1
  379. package/dist/ecommerce/components/general/ErrorBoundary.d.ts.map +0 -1
  380. package/dist/ecommerce/components/general/ErrorState.d.ts.map +0 -1
  381. package/dist/ecommerce/components/general/toast.d.ts.map +0 -1
  382. package/dist/ecommerce/components/orders/OrderCard.d.ts.map +0 -1
  383. package/dist/ecommerce/components/orders/OrderDetails.d.ts.map +0 -1
  384. package/dist/ecommerce/components/orders/OrderList.d.ts.map +0 -1
  385. package/dist/ecommerce/components/ui/accordion.d.ts.map +0 -1
  386. package/dist/ecommerce/components/ui/badge.d.ts.map +0 -1
  387. package/dist/ecommerce/components/ui/button.d.ts.map +0 -1
  388. package/dist/ecommerce/components/ui/card.d.ts.map +0 -1
  389. package/dist/ecommerce/components/ui/dialog.d.ts.map +0 -1
  390. package/dist/ecommerce/components/ui/input.d.ts.map +0 -1
  391. package/dist/ecommerce/components/ui/label.d.ts.map +0 -1
  392. package/dist/ecommerce/components/ui/select.d.ts.map +0 -1
  393. package/dist/ecommerce/components/ui/separator.d.ts.map +0 -1
  394. package/dist/ecommerce/components/ui/sheet.d.ts.map +0 -1
  395. package/dist/ecommerce/components/ui/skeleton.d.ts.map +0 -1
  396. package/dist/ecommerce/components/ui/tabs.d.ts.map +0 -1
  397. package/dist/ecommerce/components/ui/textarea.d.ts.map +0 -1
  398. package/dist/ecommerce/config/context.d.ts.map +0 -1
  399. package/dist/ecommerce/config/types.d.ts.map +0 -1
  400. package/dist/ecommerce/hooks/checkoutReturn.d.ts.map +0 -1
  401. package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts.map +0 -1
  402. package/dist/ecommerce/hooks/useCartInventory.d.ts.map +0 -1
  403. package/dist/ecommerce/hooks/useCatalogUrlState.d.ts.map +0 -1
  404. package/dist/ecommerce/hooks/useCategories.d.ts.map +0 -1
  405. package/dist/ecommerce/hooks/useCheckoutResultFromUrl.d.ts.map +0 -1
  406. package/dist/ecommerce/hooks/useHoldExpiry.d.ts.map +0 -1
  407. package/dist/ecommerce/hooks/useInventoryVerification.d.ts.map +0 -1
  408. package/dist/ecommerce/hooks/useOrders.d.ts.map +0 -1
  409. package/dist/ecommerce/hooks/usePaymentMethodsConfig.d.ts.map +0 -1
  410. package/dist/ecommerce/hooks/useProduct.d.ts.map +0 -1
  411. package/dist/ecommerce/hooks/useProducts.d.ts.map +0 -1
  412. package/dist/ecommerce/hooks/useShippingMethods.d.ts.map +0 -1
  413. package/dist/ecommerce/hooks/useStorefrontSettings.d.ts.map +0 -1
  414. package/dist/ecommerce/hooks/useSubscriptionData.d.ts.map +0 -1
  415. package/dist/ecommerce/index.d.ts.map +0 -1
  416. package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +0 -1
  417. package/dist/ecommerce/state/cart/CartProvider.d.ts.map +0 -1
  418. package/dist/ecommerce/state/cart/cartReducer.d.ts.map +0 -1
  419. package/dist/ecommerce/state/checkout/checkoutSchema.d.ts.map +0 -1
  420. package/dist/ecommerce/state/checkout/useCheckout.d.ts.map +0 -1
  421. package/dist/ecommerce/templates/CartTemplate.d.ts.map +0 -1
  422. package/dist/ecommerce/templates/CategoryTemplate.d.ts.map +0 -1
  423. package/dist/ecommerce/templates/CheckoutTemplate.d.ts.map +0 -1
  424. package/dist/ecommerce/templates/ProductTemplate.d.ts.map +0 -1
  425. package/dist/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +0 -1
  426. package/dist/ecommerce/templates/ReceiptTemplate.d.ts.map +0 -1
  427. package/dist/ecommerce/templates/ShopTemplate.d.ts.map +0 -1
  428. package/dist/ecommerce/templates/SubscriptionTemplate.d.ts.map +0 -1
  429. package/dist/ecommerce/testing/adapterContract.d.ts.map +0 -1
  430. package/dist/ecommerce/types.d.ts.map +0 -1
  431. package/dist/ecommerce/utils/cartCheckoutRequirements.d.ts.map +0 -1
  432. package/dist/ecommerce/utils/cartItemMetadata.d.ts.map +0 -1
  433. package/dist/ecommerce/utils/cn.d.ts.map +0 -1
  434. package/dist/ecommerce/utils/money.d.ts.map +0 -1
  435. package/dist/ecommerce/utils/storage.d.ts.map +0 -1
  436. package/dist/hooks/useCreditsPayment.d.ts.map +0 -1
  437. package/dist/hooks/useCreditsSubscription.d.ts.map +0 -1
  438. package/dist/hooks/useCryptoSubscription.d.ts.map +0 -1
  439. package/dist/hooks/usePaymentMode.d.ts.map +0 -1
  440. package/dist/hooks/useRefundVerification.d.ts.map +0 -1
  441. package/dist/hooks/useStripeCheckout.d.ts.map +0 -1
  442. package/dist/hooks/useSubscription.d.ts.map +0 -1
  443. package/dist/hooks/useSubscriptionManagement.d.ts.map +0 -1
  444. package/dist/hooks/useX402Payment.d.ts.map +0 -1
  445. package/dist/i18n/index.d.ts.map +0 -1
  446. package/dist/i18n/useTranslation.d.ts.map +0 -1
  447. package/dist/index-2N_CMVAv.js +0 -84
  448. package/dist/index.d.ts.map +0 -1
  449. package/dist/managers/CreditsManager.d.ts.map +0 -1
  450. package/dist/managers/ManagerCache.d.ts.map +0 -1
  451. package/dist/managers/RouteDiscoveryManager.d.ts +0 -75
  452. package/dist/managers/RouteDiscoveryManager.d.ts.map +0 -1
  453. package/dist/managers/StripeManager.d.ts.map +0 -1
  454. package/dist/managers/SubscriptionChangeManager.d.ts.map +0 -1
  455. package/dist/managers/SubscriptionManager.d.ts.map +0 -1
  456. package/dist/managers/WalletManager.d.ts.map +0 -1
  457. package/dist/managers/X402Manager.d.ts.map +0 -1
  458. package/dist/sections-D2GMJuKq.js +0 -1
  459. package/dist/sections-DICaHGhz.mjs +0 -10
  460. package/dist/stripe-only.d.ts.map +0 -1
  461. package/dist/telemetry.d.ts.map +0 -1
  462. package/dist/testing/__tests__/providers.test.d.ts.map +0 -1
  463. package/dist/testing/helpers.d.ts.map +0 -1
  464. package/dist/testing/index.d.ts.map +0 -1
  465. package/dist/testing/mocks.d.ts.map +0 -1
  466. package/dist/testing/providers.d.ts.map +0 -1
  467. package/dist/types/componentOptions.d.ts.map +0 -1
  468. package/dist/types/errors.d.ts.map +0 -1
  469. package/dist/types/index.d.ts.map +0 -1
  470. package/dist/types/subscription.d.ts.map +0 -1
  471. package/dist/utils/__tests__/couponHelpers.test.d.ts.map +0 -1
  472. package/dist/utils/__tests__/cspHelper.test.d.ts.map +0 -1
  473. package/dist/utils/__tests__/fetchWithTimeout.test.d.ts.map +0 -1
  474. package/dist/utils/cartHelpers.d.ts.map +0 -1
  475. package/dist/utils/circuitBreaker.d.ts.map +0 -1
  476. package/dist/utils/couponHelpers.d.ts.map +0 -1
  477. package/dist/utils/cspHelper.d.ts.map +0 -1
  478. package/dist/utils/csvHelpers.d.ts.map +0 -1
  479. package/dist/utils/csvHelpers.test.d.ts.map +0 -1
  480. package/dist/utils/dateHelpers.d.ts.map +0 -1
  481. package/dist/utils/deprecation.d.ts.map +0 -1
  482. package/dist/utils/errorHandling.d.ts.map +0 -1
  483. package/dist/utils/errorMessages.d.ts.map +0 -1
  484. package/dist/utils/errorParser.d.ts.map +0 -1
  485. package/dist/utils/eventEmitter.d.ts.map +0 -1
  486. package/dist/utils/exponentialBackoff.d.ts.map +0 -1
  487. package/dist/utils/fetchWithTimeout.d.ts.map +0 -1
  488. package/dist/utils/index.d.ts.map +0 -1
  489. package/dist/utils/logger.d.ts.map +0 -1
  490. package/dist/utils/modalStyles.d.ts.map +0 -1
  491. package/dist/utils/rateLimiter.d.ts.map +0 -1
  492. package/dist/utils/requestDeduplication.d.ts.map +0 -1
  493. package/dist/utils/securityValidation.d.ts.map +0 -1
  494. package/dist/utils/solanaCheck.d.ts.map +0 -1
  495. package/dist/utils/telemetry.d.ts.map +0 -1
  496. package/dist/utils/tokenMintValidator.d.ts.map +0 -1
  497. package/dist/utils/uuid.d.ts.map +0 -1
  498. package/dist/utils/validateConfig.d.ts.map +0 -1
  499. package/dist/utils/walletDetection.d.ts.map +0 -1
  500. package/dist/utils/walletPool.d.ts.map +0 -1
  501. /package/dist/{admin → src/admin}/index.d.ts +0 -0
  502. /package/dist/{admin → src/admin}/plugin.d.ts +0 -0
  503. /package/dist/{admin → src/admin}/types.d.ts +0 -0
  504. /package/dist/{components → src/components}/CedrosPay.d.ts +0 -0
  505. /package/dist/{components → src/components}/CreditsButton.d.ts +0 -0
  506. /package/dist/{components → src/components}/CreditsSubscribeButton.d.ts +0 -0
  507. /package/dist/{components → src/components}/CryptoButton.d.ts +0 -0
  508. /package/dist/{components → src/components}/CryptoSubscribeButton.d.ts +0 -0
  509. /package/dist/{components → src/components}/PaymentModal.d.ts +0 -0
  510. /package/dist/{components → src/components}/ProductPrice.d.ts +0 -0
  511. /package/dist/{components → src/components}/PurchaseButton.d.ts +0 -0
  512. /package/dist/{components → src/components}/StripeButton.d.ts +0 -0
  513. /package/dist/{components → src/components}/SubscribeButton.d.ts +0 -0
  514. /package/dist/{components → src/components}/SubscriptionManagementPanel.d.ts +0 -0
  515. /package/dist/{components → src/components}/admin/AISettingsSection.d.ts +0 -0
  516. /package/dist/{components → src/components}/admin/AdminAuthManager.d.ts +0 -0
  517. /package/dist/{components → src/components}/admin/AutosaveIndicator.d.ts +0 -0
  518. /package/dist/{components → src/components}/admin/CedrosPayAdminDashboard.d.ts +0 -0
  519. /package/dist/{components → src/components}/admin/ConfigEditor.d.ts +0 -0
  520. /package/dist/{components → src/components}/admin/CouponsSection.d.ts +0 -0
  521. /package/dist/{components → src/components}/admin/Dropdown.d.ts +0 -0
  522. /package/dist/{components → src/components}/admin/ErrorBanner.d.ts +0 -0
  523. /package/dist/{components → src/components}/admin/FAQSection.d.ts +0 -0
  524. /package/dist/{components → src/components}/admin/MessagingSection.d.ts +0 -0
  525. /package/dist/{components → src/components}/admin/OverviewSection.d.ts +0 -0
  526. /package/dist/{components → src/components}/admin/PaymentSettingsSection.d.ts +0 -0
  527. /package/dist/{components → src/components}/admin/ProductVariationsEditor.d.ts +0 -0
  528. /package/dist/{components → src/components}/admin/ProductsSection.d.ts +0 -0
  529. /package/dist/{components → src/components}/admin/RefundsSection.d.ts +0 -0
  530. /package/dist/{components → src/components}/admin/SecretArrayEditor.d.ts +0 -0
  531. /package/dist/{components → src/components}/admin/SettingsSection.d.ts +0 -0
  532. /package/dist/{components → src/components}/admin/SingleCategorySettings.d.ts +0 -0
  533. /package/dist/{components → src/components}/admin/StatsBar.d.ts +0 -0
  534. /package/dist/{components → src/components}/admin/StorefrontSection.d.ts +0 -0
  535. /package/dist/{components → src/components}/admin/SubscriptionsSection.d.ts +0 -0
  536. /package/dist/{components → src/components}/admin/Toggle.d.ts +0 -0
  537. /package/dist/{components → src/components}/admin/TransactionsSection.d.ts +0 -0
  538. /package/dist/{components → src/components}/admin/VariantInventoryGrid.d.ts +0 -0
  539. /package/dist/{components → src/components}/admin/VariationTypeEditor.d.ts +0 -0
  540. /package/dist/{components → src/components}/admin/configApi.d.ts +0 -0
  541. /package/dist/{components → src/components}/admin/icons.d.ts +0 -0
  542. /package/dist/{components → src/components}/admin/sections-more.d.ts +0 -0
  543. /package/dist/{components → src/components}/admin/sections.d.ts +0 -0
  544. /package/dist/{components → src/components}/admin/types.d.ts +0 -0
  545. /package/dist/{components → src/components}/admin/useAutosave.d.ts +0 -0
  546. /package/dist/{components → src/components}/admin/useProductVariations.d.ts +0 -0
  547. /package/dist/{components → src/components}/subscriptionPanelStyles.d.ts +0 -0
  548. /package/dist/{context → src/context}/CedrosContext.d.ts +0 -0
  549. /package/dist/{context → src/context}/ThemeContext.d.ts +0 -0
  550. /package/dist/{context → src/context}/index.d.ts +0 -0
  551. /package/dist/{ecommerce → src/ecommerce}/__tests__/cartCheckoutRequirements.test.d.ts +0 -0
  552. /package/dist/{ecommerce → src/ecommerce}/__tests__/cartProviderPersistence.test.d.ts +0 -0
  553. /package/dist/{ecommerce → src/ecommerce}/__tests__/cartReducer.test.d.ts +0 -0
  554. /package/dist/{ecommerce → src/ecommerce}/__tests__/cartServerMerge.test.d.ts +0 -0
  555. /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutPaymentMethods.test.d.ts +0 -0
  556. /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutReturn.test.d.ts +0 -0
  557. /package/dist/{ecommerce → src/ecommerce}/__tests__/checkoutSchema.test.d.ts +0 -0
  558. /package/dist/{ecommerce → src/ecommerce}/__tests__/inventoryHooks.test.d.ts +0 -0
  559. /package/dist/{ecommerce → src/ecommerce}/__tests__/mockAdapter.test.d.ts +0 -0
  560. /package/dist/{ecommerce → src/ecommerce}/__tests__/storage.test.d.ts +0 -0
  561. /package/dist/{ecommerce → src/ecommerce}/adapters/CommerceAdapter.d.ts +0 -0
  562. /package/dist/{ecommerce → src/ecommerce}/adapters/mock/mockAdapter.d.ts +0 -0
  563. /package/dist/{ecommerce → src/ecommerce}/adapters/paywall/paywallAdapter.d.ts +0 -0
  564. /package/dist/{ecommerce → src/ecommerce}/adapters/paywall/paywallAdapter.test.d.ts +0 -0
  565. /package/dist/{ecommerce → src/ecommerce}/components/cart/CartLineItem.d.ts +0 -0
  566. /package/dist/{ecommerce → src/ecommerce}/components/cart/CartPageContent.d.ts +0 -0
  567. /package/dist/{ecommerce → src/ecommerce}/components/cart/CartPanel.d.ts +0 -0
  568. /package/dist/{ecommerce → src/ecommerce}/components/cart/CartSidebar.d.ts +0 -0
  569. /package/dist/{ecommerce → src/ecommerce}/components/cart/CartSummary.d.ts +0 -0
  570. /package/dist/{ecommerce → src/ecommerce}/components/cart/PromoCodeInput.d.ts +0 -0
  571. /package/dist/{ecommerce → src/ecommerce}/components/catalog/Breadcrumbs.d.ts +0 -0
  572. /package/dist/{ecommerce → src/ecommerce}/components/catalog/CategoryNav.d.ts +0 -0
  573. /package/dist/{ecommerce → src/ecommerce}/components/catalog/FilterPanel.d.ts +0 -0
  574. /package/dist/{ecommerce → src/ecommerce}/components/catalog/Price.d.ts +0 -0
  575. /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductCard.d.ts +0 -0
  576. /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductGallery.d.ts +0 -0
  577. /package/dist/{ecommerce → src/ecommerce}/components/catalog/ProductGrid.d.ts +0 -0
  578. /package/dist/{ecommerce → src/ecommerce}/components/catalog/QuantitySelector.d.ts +0 -0
  579. /package/dist/{ecommerce → src/ecommerce}/components/catalog/QuickViewDialog.d.ts +0 -0
  580. /package/dist/{ecommerce → src/ecommerce}/components/catalog/SearchInput.d.ts +0 -0
  581. /package/dist/{ecommerce → src/ecommerce}/components/catalog/VariantSelector.d.ts +0 -0
  582. /package/dist/{ecommerce → src/ecommerce}/components/chat/ShopChatPanel.d.ts +0 -0
  583. /package/dist/{ecommerce → src/ecommerce}/components/checkout/AddressForm.d.ts +0 -0
  584. /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutCancelPage.d.ts +0 -0
  585. /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutForm.d.ts +0 -0
  586. /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutLayout.d.ts +0 -0
  587. /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutReceipt.d.ts +0 -0
  588. /package/dist/{ecommerce → src/ecommerce}/components/checkout/CheckoutSuccessPage.d.ts +0 -0
  589. /package/dist/{ecommerce → src/ecommerce}/components/checkout/InventoryVerificationDialog.d.ts +0 -0
  590. /package/dist/{ecommerce → src/ecommerce}/components/checkout/OrderReview.d.ts +0 -0
  591. /package/dist/{ecommerce → src/ecommerce}/components/checkout/PaymentStep.d.ts +0 -0
  592. /package/dist/{ecommerce → src/ecommerce}/components/checkout/ShippingMethodSelector.d.ts +0 -0
  593. /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQItem.d.ts +0 -0
  594. /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQItem.test.d.ts +0 -0
  595. /package/dist/{ecommerce → src/ecommerce}/components/faq/FAQList.d.ts +0 -0
  596. /package/dist/{ecommerce → src/ecommerce}/components/faq/index.d.ts +0 -0
  597. /package/dist/{ecommerce → src/ecommerce}/components/general/EmptyState.d.ts +0 -0
  598. /package/dist/{ecommerce → src/ecommerce}/components/general/ErrorBoundary.d.ts +0 -0
  599. /package/dist/{ecommerce → src/ecommerce}/components/general/ErrorState.d.ts +0 -0
  600. /package/dist/{ecommerce → src/ecommerce}/components/general/toast.d.ts +0 -0
  601. /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderCard.d.ts +0 -0
  602. /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderDetails.d.ts +0 -0
  603. /package/dist/{ecommerce → src/ecommerce}/components/orders/OrderList.d.ts +0 -0
  604. /package/dist/{ecommerce → src/ecommerce}/components/ui/accordion.d.ts +0 -0
  605. /package/dist/{ecommerce → src/ecommerce}/components/ui/badge.d.ts +0 -0
  606. /package/dist/{ecommerce → src/ecommerce}/components/ui/button.d.ts +0 -0
  607. /package/dist/{ecommerce → src/ecommerce}/components/ui/card.d.ts +0 -0
  608. /package/dist/{ecommerce → src/ecommerce}/components/ui/dialog.d.ts +0 -0
  609. /package/dist/{ecommerce → src/ecommerce}/components/ui/input.d.ts +0 -0
  610. /package/dist/{ecommerce → src/ecommerce}/components/ui/label.d.ts +0 -0
  611. /package/dist/{ecommerce → src/ecommerce}/components/ui/select.d.ts +0 -0
  612. /package/dist/{ecommerce → src/ecommerce}/components/ui/separator.d.ts +0 -0
  613. /package/dist/{ecommerce → src/ecommerce}/components/ui/sheet.d.ts +0 -0
  614. /package/dist/{ecommerce → src/ecommerce}/components/ui/skeleton.d.ts +0 -0
  615. /package/dist/{ecommerce → src/ecommerce}/components/ui/tabs.d.ts +0 -0
  616. /package/dist/{ecommerce → src/ecommerce}/components/ui/textarea.d.ts +0 -0
  617. /package/dist/{ecommerce → src/ecommerce}/config/context.d.ts +0 -0
  618. /package/dist/{ecommerce → src/ecommerce}/config/types.d.ts +0 -0
  619. /package/dist/{ecommerce → src/ecommerce}/hooks/checkoutReturn.d.ts +0 -0
  620. /package/dist/{ecommerce → src/ecommerce}/hooks/useAIRelatedProducts.d.ts +0 -0
  621. /package/dist/{ecommerce → src/ecommerce}/hooks/useCartInventory.d.ts +0 -0
  622. /package/dist/{ecommerce → src/ecommerce}/hooks/useCatalogUrlState.d.ts +0 -0
  623. /package/dist/{ecommerce → src/ecommerce}/hooks/useCategories.d.ts +0 -0
  624. /package/dist/{ecommerce → src/ecommerce}/hooks/useCheckoutResultFromUrl.d.ts +0 -0
  625. /package/dist/{ecommerce → src/ecommerce}/hooks/useHoldExpiry.d.ts +0 -0
  626. /package/dist/{ecommerce → src/ecommerce}/hooks/useInventoryVerification.d.ts +0 -0
  627. /package/dist/{ecommerce → src/ecommerce}/hooks/useOrders.d.ts +0 -0
  628. /package/dist/{ecommerce → src/ecommerce}/hooks/usePaymentMethodsConfig.d.ts +0 -0
  629. /package/dist/{ecommerce → src/ecommerce}/hooks/useProduct.d.ts +0 -0
  630. /package/dist/{ecommerce → src/ecommerce}/hooks/useProducts.d.ts +0 -0
  631. /package/dist/{ecommerce → src/ecommerce}/hooks/useShippingMethods.d.ts +0 -0
  632. /package/dist/{ecommerce → src/ecommerce}/hooks/useStorefrontSettings.d.ts +0 -0
  633. /package/dist/{ecommerce → src/ecommerce}/hooks/useSubscriptionData.d.ts +0 -0
  634. /package/dist/{ecommerce → src/ecommerce}/index.d.ts +0 -0
  635. /package/dist/{ecommerce → src/ecommerce}/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts +0 -0
  636. /package/dist/{ecommerce → src/ecommerce}/state/cart/CartProvider.d.ts +0 -0
  637. /package/dist/{ecommerce → src/ecommerce}/state/cart/cartReducer.d.ts +0 -0
  638. /package/dist/{ecommerce → src/ecommerce}/state/checkout/checkoutSchema.d.ts +0 -0
  639. /package/dist/{ecommerce → src/ecommerce}/state/checkout/useCheckout.d.ts +0 -0
  640. /package/dist/{ecommerce → src/ecommerce}/templates/CartTemplate.d.ts +0 -0
  641. /package/dist/{ecommerce → src/ecommerce}/templates/CategoryTemplate.d.ts +0 -0
  642. /package/dist/{ecommerce → src/ecommerce}/templates/CheckoutTemplate.d.ts +0 -0
  643. /package/dist/{ecommerce → src/ecommerce}/templates/ProductTemplate.d.ts +0 -0
  644. /package/dist/{ecommerce → src/ecommerce}/templates/PurchaseHistoryTemplate.d.ts +0 -0
  645. /package/dist/{ecommerce → src/ecommerce}/templates/ReceiptTemplate.d.ts +0 -0
  646. /package/dist/{ecommerce → src/ecommerce}/templates/ShopTemplate.d.ts +0 -0
  647. /package/dist/{ecommerce → src/ecommerce}/templates/SubscriptionTemplate.d.ts +0 -0
  648. /package/dist/{ecommerce → src/ecommerce}/testing/adapterContract.d.ts +0 -0
  649. /package/dist/{ecommerce → src/ecommerce}/types.d.ts +0 -0
  650. /package/dist/{ecommerce → src/ecommerce}/utils/cartCheckoutRequirements.d.ts +0 -0
  651. /package/dist/{ecommerce → src/ecommerce}/utils/cartItemMetadata.d.ts +0 -0
  652. /package/dist/{ecommerce → src/ecommerce}/utils/cn.d.ts +0 -0
  653. /package/dist/{ecommerce → src/ecommerce}/utils/money.d.ts +0 -0
  654. /package/dist/{ecommerce → src/ecommerce}/utils/storage.d.ts +0 -0
  655. /package/dist/{hooks → src/hooks}/useCreditsPayment.d.ts +0 -0
  656. /package/dist/{hooks → src/hooks}/useCreditsSubscription.d.ts +0 -0
  657. /package/dist/{hooks → src/hooks}/useCryptoSubscription.d.ts +0 -0
  658. /package/dist/{hooks → src/hooks}/usePaymentMode.d.ts +0 -0
  659. /package/dist/{hooks → src/hooks}/useRefundVerification.d.ts +0 -0
  660. /package/dist/{hooks → src/hooks}/useStripeCheckout.d.ts +0 -0
  661. /package/dist/{hooks → src/hooks}/useSubscription.d.ts +0 -0
  662. /package/dist/{hooks → src/hooks}/useSubscriptionManagement.d.ts +0 -0
  663. /package/dist/{hooks → src/hooks}/useX402Payment.d.ts +0 -0
  664. /package/dist/{i18n → src/i18n}/index.d.ts +0 -0
  665. /package/dist/{i18n → src/i18n}/useTranslation.d.ts +0 -0
  666. /package/dist/{managers → src/managers}/CreditsManager.d.ts +0 -0
  667. /package/dist/{managers → src/managers}/ManagerCache.d.ts +0 -0
  668. /package/dist/{managers → src/managers}/StripeManager.d.ts +0 -0
  669. /package/dist/{managers → src/managers}/SubscriptionChangeManager.d.ts +0 -0
  670. /package/dist/{managers → src/managers}/SubscriptionManager.d.ts +0 -0
  671. /package/dist/{managers → src/managers}/WalletManager.d.ts +0 -0
  672. /package/dist/{managers → src/managers}/X402Manager.d.ts +0 -0
  673. /package/dist/{testing → src/testing}/__tests__/providers.test.d.ts +0 -0
  674. /package/dist/{testing → src/testing}/helpers.d.ts +0 -0
  675. /package/dist/{testing → src/testing}/mocks.d.ts +0 -0
  676. /package/dist/{testing → src/testing}/providers.d.ts +0 -0
  677. /package/dist/{types → src/types}/componentOptions.d.ts +0 -0
  678. /package/dist/{types → src/types}/errors.d.ts +0 -0
  679. /package/dist/{types → src/types}/index.d.ts +0 -0
  680. /package/dist/{types → src/types}/subscription.d.ts +0 -0
  681. /package/dist/{utils → src/utils}/__tests__/couponHelpers.test.d.ts +0 -0
  682. /package/dist/{utils → src/utils}/__tests__/cspHelper.test.d.ts +0 -0
  683. /package/dist/{utils → src/utils}/__tests__/fetchWithTimeout.test.d.ts +0 -0
  684. /package/dist/{utils → src/utils}/cartHelpers.d.ts +0 -0
  685. /package/dist/{utils → src/utils}/circuitBreaker.d.ts +0 -0
  686. /package/dist/{utils → src/utils}/couponHelpers.d.ts +0 -0
  687. /package/dist/{utils → src/utils}/cspHelper.d.ts +0 -0
  688. /package/dist/{utils → src/utils}/csvHelpers.d.ts +0 -0
  689. /package/dist/{utils → src/utils}/csvHelpers.test.d.ts +0 -0
  690. /package/dist/{utils → src/utils}/dateHelpers.d.ts +0 -0
  691. /package/dist/{utils → src/utils}/deprecation.d.ts +0 -0
  692. /package/dist/{utils → src/utils}/errorHandling.d.ts +0 -0
  693. /package/dist/{utils → src/utils}/errorMessages.d.ts +0 -0
  694. /package/dist/{utils → src/utils}/errorParser.d.ts +0 -0
  695. /package/dist/{utils → src/utils}/eventEmitter.d.ts +0 -0
  696. /package/dist/{utils → src/utils}/exponentialBackoff.d.ts +0 -0
  697. /package/dist/{utils → src/utils}/fetchWithTimeout.d.ts +0 -0
  698. /package/dist/{utils → src/utils}/index.d.ts +0 -0
  699. /package/dist/{utils → src/utils}/logger.d.ts +0 -0
  700. /package/dist/{utils → src/utils}/modalStyles.d.ts +0 -0
  701. /package/dist/{utils → src/utils}/rateLimiter.d.ts +0 -0
  702. /package/dist/{utils → src/utils}/requestDeduplication.d.ts +0 -0
  703. /package/dist/{utils → src/utils}/securityValidation.d.ts +0 -0
  704. /package/dist/{utils → src/utils}/solanaCheck.d.ts +0 -0
  705. /package/dist/{utils → src/utils}/telemetry.d.ts +0 -0
  706. /package/dist/{utils → src/utils}/tokenMintValidator.d.ts +0 -0
  707. /package/dist/{utils → src/utils}/uuid.d.ts +0 -0
  708. /package/dist/{utils → src/utils}/validateConfig.d.ts +0 -0
  709. /package/dist/{utils → src/utils}/walletDetection.d.ts +0 -0
  710. /package/dist/{utils → src/utils}/walletPool.d.ts +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),g=require("./index-2N_CMVAv.js"),o=require("./Toggle-CsPSF8Dr.js"),O=require("./useAutosave-B2p6iwh8.js"),M=require("./AutosaveIndicator-BQkm3cn8.js"),b={enabled:!0,relatedProducts:{mode:"most_recent",maxItems:4,layout:{layout:"large",imageCrop:"center"}},catalog:{filters:{tags:!0,priceRange:!0,inStock:!0},sort:{featured:!0,priceAsc:!0,priceDesc:!0}},checkout:{promoCodes:!0},shopLayout:{layout:"large",imageCrop:"center"},categoryLayout:{layout:"large",imageCrop:"center"},sections:{showDescription:!0,showSpecs:!0,showShipping:!0,showRelatedProducts:!0},inventory:{preCheckoutVerification:!0,holdsEnabled:!1,holdDurationMinutes:15},shopPage:{title:"Shop",description:""}},$=[{value:"most_recent",label:"Most Recent",description:"Show the most recently added products (excluding current product)."},{value:"by_category",label:"By Category",description:"Show products from the same category as the current product."},{value:"manual",label:"Manual Selection",description:"Specify related products per-product using relatedProductIds in metadata."},{value:"ai",label:"AI Recommendations",description:"Let AI analyze products and suggest the best matches. Requires AI to be configured in AI Settings."}],S=[{value:"large",label:"Large",description:"Portrait cards (4:5) with full product info, description, and tags."},{value:"square",label:"Square",description:"Square cards (1:1) showing title and price only."},{value:"compact",label:"Compact",description:"Compact cards (3:4) with smaller text to fit more products."}],C=[{value:"center",label:"Center"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}],q=[{id:"shop-page",label:"Shop Page"},{id:"catalog",label:"Catalog"},{id:"layouts",label:"Layouts"},{id:"product-pages",label:"Product Pages"},{id:"checkout",label:"Checkout"}];function H({serverUrl:h,apiKey:d,authManager:c}){const[m,P]=l.useState("shop-page"),[a,i]=l.useState(b),[I,z]=l.useState(!0),[W,B]=l.useState(!0),[L,y]=l.useState(null),x=l.useCallback(async()=>{try{y(null);let t;const s="/admin/config/shop";if(c?.isAuthenticated())t=await c.fetchWithAuth(s);else{const r={"Content-Type":"application/json"};d&&(r["X-API-Key"]=d);const n=await fetch(`${h}${s}`,{headers:r});if(!n.ok)throw new Error(`Failed to fetch settings: ${n.status}`);t=await n.json()}i({...b,...t.config})}catch{i(b),y("Could not load saved settings. Showing defaults.")}finally{z(!1),setTimeout(()=>B(!1),100)}},[h,d,c]);l.useEffect(()=>{x()},[x]);const D=l.useCallback(async t=>{const s="/admin/config/shop",r=JSON.stringify({config:t});try{if(c?.isAuthenticated())await c.fetchWithAuth(s,{method:"PUT",body:r});else{const n={"Content-Type":"application/json"};d&&(n["X-API-Key"]=d);const p=await fetch(`${h}${s}`,{method:"PUT",headers:n,body:r});if(!p.ok)throw new Error(`Failed to save settings: ${p.status}`)}}catch{throw y("Failed to save storefront settings"),new Error("Save failed")}},[h,d,c]),{status:N,error:R}=O.useAutosave({data:a,onSave:D,debounceMs:1500,enabled:!W}),A=t=>{i(s=>({...s,relatedProducts:{...s.relatedProducts,mode:t}}))},E=t=>{i(s=>({...s,relatedProducts:{...s.relatedProducts,maxItems:t}}))},_=(t,s)=>{i(r=>({...r,relatedProducts:{...r.relatedProducts,layout:{...r.relatedProducts.layout,[t]:s}}}))},f=(t,s)=>{i(r=>({...r,catalog:{...r.catalog,filters:{...r.catalog.filters,[t]:s}}}))},v=(t,s)=>{const r=a.catalog.sort,n=Object.values(r).filter(Boolean).length;!s&&n<=1||i(p=>({...p,catalog:{...p.catalog,sort:{...p.catalog.sort,[t]:s}}}))},F=(t,s)=>{i(r=>({...r,checkout:{...r.checkout,[t]:s}}))},k=(t,s)=>{i(r=>({...r,shopLayout:{...r.shopLayout,[t]:s}}))},T=(t,s)=>{i(r=>({...r,categoryLayout:{...r.categoryLayout,[t]:s}}))},u=(t,s)=>{i(r=>({...r,sections:{...r.sections,[t]:s}}))},j=(t,s)=>{i(r=>({...r,inventory:{...r.inventory,[t]:s}}))},w=(t,s)=>{i(r=>({...r,shopPage:{...r.shopPage,[t]:s}}))};return I?e.jsx("div",{className:"cedros-admin__section",children:e.jsxs("div",{className:"cedros-admin__loading",children:[g.Icons.loading," Loading storefront settings..."]})}):e.jsxs("div",{className:"cedros-admin__storefront-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Storefront"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure catalog filters, product layouts, and checkout settings."})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},children:[e.jsx("span",{style:{fontSize:"0.875rem",color:a.enabled?"var(--cedros-admin-text, #171717)":"var(--cedros-admin-muted, #737373)"},children:a.enabled?"Enabled":"Disabled"}),e.jsx(o.Toggle,{checked:a.enabled,onChange:t=>i(s=>({...s,enabled:t}))})]})]}),!a.enabled&&e.jsx("div",{style:{padding:"0.75rem 1rem",marginBottom:"1rem",backgroundColor:"var(--cedros-admin-warning-bg, #fef3c7)",border:"1px solid var(--cedros-admin-warning-border, #f59e0b)",borderRadius:"0.375rem",fontSize:"0.875rem",color:"var(--cedros-admin-warning-text, #92400e)"},children:"The storefront is disabled. Enable it using the toggle above to activate your store."}),e.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",style:{opacity:a.enabled?1:.5,pointerEvents:a.enabled?"auto":"none"},children:[q.map(t=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${m===t.id?"cedros-admin__tab--active":""}`,onClick:()=>P(t.id),children:t.label},t.id)),e.jsx("div",{style:{flex:1}}),e.jsx(M.AutosaveIndicator,{status:N,error:R})]}),e.jsx(g.ErrorBanner,{message:L,onRetry:x}),m==="shop-page"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Shop Page Content"}),e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:14,opacity:.7},children:"Customize the title and description shown on your shop page."}),e.jsxs("div",{className:"cedros-admin__field",style:{marginBottom:"1.5rem"},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Page Title"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.shopPage.title,onChange:t=>w("title",t.target.value),placeholder:"Shop"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"The main heading displayed on your shop page."})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Page Description"}),e.jsx("textarea",{className:"cedros-admin__textarea",value:a.shopPage.description,onChange:t=>w("description",t.target.value),placeholder:"Browse our collection of products...",rows:3,style:{resize:"vertical"}}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"A short description or subtitle shown below the title. Leave empty to hide."})]})]}),m==="catalog"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Catalog Filters"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which filters appear in the shop and category page sidebars."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.tags,onChange:t=>f("tags",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Tags"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Filter products by tags (multi-select checkboxes)"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.priceRange,onChange:t=>f("priceRange",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price Range"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Filter by minimum and maximum price"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.inStock,onChange:t=>f("inStock",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"In Stock"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Show only products that are in stock"})]})]})]})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Sort Options"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which sort options appear in the shop and category pages. At least one must be enabled."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.featured,onChange:t=>v("featured",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Featured"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Default sort order (as returned by backend)"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.priceAsc,onChange:t=>v("priceAsc",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price: Low to High"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Sort products by price ascending"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.priceDesc,onChange:t=>v("priceDesc",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price: High to Low"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Sort products by price descending"})]})]})]})]})]}),m==="layouts"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Product Layouts"}),e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:14,opacity:.7},children:"Configure product card layouts for shop and category pages."}),e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Shop Page"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.shopLayout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"shopLayout",value:t.value,checked:s,onChange:()=>k("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.shopLayout.imageCrop,onChange:t=>k("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]}),e.jsxs("div",{style:{paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Category Pages"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.categoryLayout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"categoryLayout",value:t.value,checked:s,onChange:()=>T("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.categoryLayout.imageCrop,onChange:t=>T("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]})]}),m==="product-pages"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Related Products"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure how related products are displayed on product detail pages."}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",marginBottom:"1.5rem"},children:$.map(t=>{const s=a.relatedProducts.mode===t.value,r=t.badge==="Coming Soon";return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"1rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:8,cursor:r?"not-allowed":"pointer",opacity:r?.6:1,background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"relatedProductsMode",value:t.value,checked:s,onChange:()=>!r&&A(t.value),disabled:r,style:{marginTop:2}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{style:{fontWeight:600},children:t.label}),t.badge&&e.jsx("span",{style:{fontSize:11,padding:"2px 6px",borderRadius:4,background:"#6366f1",color:"#fff"},children:t.badge})]}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:13,opacity:.75},children:t.description})]})]},t.value)})}),a.relatedProducts.mode==="manual"&&e.jsxs("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #f5f5f5)",borderRadius:8,border:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("strong",{style:{fontSize:14},children:"How to set related products:"}),e.jsxs("p",{style:{margin:"0.5rem 0 0",fontSize:13,opacity:.8},children:["When editing a product, add a ",e.jsx("code",{style:{background:"rgba(0,0,0,0.1)",padding:"2px 4px",borderRadius:3},children:"relatedProductIds"})," field to its metadata containing a comma-separated list of product IDs."]}),e.jsxs("p",{style:{margin:"0.5rem 0 0",fontSize:13,opacity:.6},children:["Example: ",e.jsx("code",{style:{background:"rgba(0,0,0,0.1)",padding:"2px 4px",borderRadius:3},children:"prod_123,prod_456,prod_789"})]})]}),e.jsxs("div",{className:"cedros-admin__field",style:{maxWidth:200},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Max Related Products"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.relatedProducts.maxItems,onChange:t=>E(Math.max(1,Math.min(12,parseInt(t.target.value)||4))),min:1,max:12}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"How many related products to show (1-12)"})]}),e.jsxs("div",{style:{marginTop:"1.5rem"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Display Layout"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.relatedProducts.layout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"relatedLayout",value:t.value,checked:s,onChange:()=>_("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.relatedProducts.layout.imageCrop,onChange:t=>_("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Page Sections"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which sections appear on product detail pages."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showDescription,onChange:t=>u("showDescription",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Description"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Expandable description accordion"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showSpecs,onChange:t=>u("showSpecs",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Specifications"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Product attributes and details"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showShipping,onChange:t=>u("showShipping",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Shipping & Returns"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Shipping and return policy information"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showRelatedProducts,onChange:t=>u("showRelatedProducts",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Related Products"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Product recommendations section"})]})]})]})]})]}),m==="checkout"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Checkout Settings"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure checkout and cart page features."}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.checkout.promoCodes,onChange:t=>F("promoCodes",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Promo Codes"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Show promo/coupon code input on cart and checkout pages"})]})]})})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Inventory Settings"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure inventory verification and reservation behavior."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.inventory.preCheckoutVerification,onChange:t=>j("preCheckoutVerification",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Pre-Checkout Verification"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Verify inventory availability before processing payment"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.inventory.holdsEnabled,onChange:t=>j("holdsEnabled",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Inventory Holds"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Reserve inventory when items are added to cart"})]})]})]}),a.inventory.holdsEnabled&&e.jsxs("div",{className:"cedros-admin__field",style:{maxWidth:200,marginTop:"1rem"},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Hold Duration (minutes)"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.inventory.holdDurationMinutes,onChange:t=>j("holdDurationMinutes",Math.max(5,Math.min(60,parseInt(t.target.value)||15))),min:5,max:60}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"How long to reserve inventory in carts (5-60 minutes)"})]})]})]})]})}exports.StorefrontSection=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),g=require("./index-B5ck27xb.js"),o=require("./Toggle-CsPSF8Dr.js"),O=require("./useAutosave-B2p6iwh8.js"),M=require("./AutosaveIndicator-CpTVtJIz.js"),b={enabled:!0,relatedProducts:{mode:"most_recent",maxItems:4,layout:{layout:"large",imageCrop:"center"}},catalog:{filters:{tags:!0,priceRange:!0,inStock:!0},sort:{featured:!0,priceAsc:!0,priceDesc:!0}},checkout:{promoCodes:!0},shopLayout:{layout:"large",imageCrop:"center"},categoryLayout:{layout:"large",imageCrop:"center"},sections:{showDescription:!0,showSpecs:!0,showShipping:!0,showRelatedProducts:!0},inventory:{preCheckoutVerification:!0,holdsEnabled:!1,holdDurationMinutes:15},shopPage:{title:"Shop",description:""}},$=[{value:"most_recent",label:"Most Recent",description:"Show the most recently added products (excluding current product)."},{value:"by_category",label:"By Category",description:"Show products from the same category as the current product."},{value:"manual",label:"Manual Selection",description:"Specify related products per-product using relatedProductIds in metadata."},{value:"ai",label:"AI Recommendations",description:"Let AI analyze products and suggest the best matches. Requires AI to be configured in AI Settings."}],S=[{value:"large",label:"Large",description:"Portrait cards (4:5) with full product info, description, and tags."},{value:"square",label:"Square",description:"Square cards (1:1) showing title and price only."},{value:"compact",label:"Compact",description:"Compact cards (3:4) with smaller text to fit more products."}],C=[{value:"center",label:"Center"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}],q=[{id:"shop-page",label:"Shop Page"},{id:"catalog",label:"Catalog"},{id:"layouts",label:"Layouts"},{id:"product-pages",label:"Product Pages"},{id:"checkout",label:"Checkout"}];function H({serverUrl:h,apiKey:d,authManager:c}){const[m,P]=l.useState("shop-page"),[a,i]=l.useState(b),[I,z]=l.useState(!0),[W,B]=l.useState(!0),[L,y]=l.useState(null),x=l.useCallback(async()=>{try{y(null);let t;const s="/admin/config/shop";if(c?.isAuthenticated())t=await c.fetchWithAuth(s);else{const r={"Content-Type":"application/json"};d&&(r["X-API-Key"]=d);const n=await fetch(`${h}${s}`,{headers:r});if(!n.ok)throw new Error(`Failed to fetch settings: ${n.status}`);t=await n.json()}i({...b,...t.config})}catch{i(b),y("Could not load saved settings. Showing defaults.")}finally{z(!1),setTimeout(()=>B(!1),100)}},[h,d,c]);l.useEffect(()=>{x()},[x]);const D=l.useCallback(async t=>{const s="/admin/config/shop",r=JSON.stringify({config:t});try{if(c?.isAuthenticated())await c.fetchWithAuth(s,{method:"PUT",body:r});else{const n={"Content-Type":"application/json"};d&&(n["X-API-Key"]=d);const p=await fetch(`${h}${s}`,{method:"PUT",headers:n,body:r});if(!p.ok)throw new Error(`Failed to save settings: ${p.status}`)}}catch{throw y("Failed to save storefront settings"),new Error("Save failed")}},[h,d,c]),{status:N,error:R}=O.useAutosave({data:a,onSave:D,debounceMs:1500,enabled:!W}),A=t=>{i(s=>({...s,relatedProducts:{...s.relatedProducts,mode:t}}))},E=t=>{i(s=>({...s,relatedProducts:{...s.relatedProducts,maxItems:t}}))},_=(t,s)=>{i(r=>({...r,relatedProducts:{...r.relatedProducts,layout:{...r.relatedProducts.layout,[t]:s}}}))},f=(t,s)=>{i(r=>({...r,catalog:{...r.catalog,filters:{...r.catalog.filters,[t]:s}}}))},v=(t,s)=>{const r=a.catalog.sort,n=Object.values(r).filter(Boolean).length;!s&&n<=1||i(p=>({...p,catalog:{...p.catalog,sort:{...p.catalog.sort,[t]:s}}}))},F=(t,s)=>{i(r=>({...r,checkout:{...r.checkout,[t]:s}}))},k=(t,s)=>{i(r=>({...r,shopLayout:{...r.shopLayout,[t]:s}}))},T=(t,s)=>{i(r=>({...r,categoryLayout:{...r.categoryLayout,[t]:s}}))},u=(t,s)=>{i(r=>({...r,sections:{...r.sections,[t]:s}}))},j=(t,s)=>{i(r=>({...r,inventory:{...r.inventory,[t]:s}}))},w=(t,s)=>{i(r=>({...r,shopPage:{...r.shopPage,[t]:s}}))};return I?e.jsx("div",{className:"cedros-admin__section",children:e.jsxs("div",{className:"cedros-admin__loading",children:[g.Icons.loading," Loading storefront settings..."]})}):e.jsxs("div",{className:"cedros-admin__storefront-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Storefront"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure catalog filters, product layouts, and checkout settings."})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},children:[e.jsx("span",{style:{fontSize:"0.875rem",color:a.enabled?"var(--cedros-admin-text, #171717)":"var(--cedros-admin-muted, #737373)"},children:a.enabled?"Enabled":"Disabled"}),e.jsx(o.Toggle,{checked:a.enabled,onChange:t=>i(s=>({...s,enabled:t}))})]})]}),!a.enabled&&e.jsx("div",{style:{padding:"0.75rem 1rem",marginBottom:"1rem",backgroundColor:"var(--cedros-admin-warning-bg, #fef3c7)",border:"1px solid var(--cedros-admin-warning-border, #f59e0b)",borderRadius:"0.375rem",fontSize:"0.875rem",color:"var(--cedros-admin-warning-text, #92400e)"},children:"The storefront is disabled. Enable it using the toggle above to activate your store."}),e.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",style:{opacity:a.enabled?1:.5,pointerEvents:a.enabled?"auto":"none"},children:[q.map(t=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${m===t.id?"cedros-admin__tab--active":""}`,onClick:()=>P(t.id),children:t.label},t.id)),e.jsx("div",{style:{flex:1}}),e.jsx(M.AutosaveIndicator,{status:N,error:R})]}),e.jsx(g.ErrorBanner,{message:L,onRetry:x}),m==="shop-page"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Shop Page Content"}),e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:14,opacity:.7},children:"Customize the title and description shown on your shop page."}),e.jsxs("div",{className:"cedros-admin__field",style:{marginBottom:"1.5rem"},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Page Title"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.shopPage.title,onChange:t=>w("title",t.target.value),placeholder:"Shop"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"The main heading displayed on your shop page."})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Page Description"}),e.jsx("textarea",{className:"cedros-admin__textarea",value:a.shopPage.description,onChange:t=>w("description",t.target.value),placeholder:"Browse our collection of products...",rows:3,style:{resize:"vertical"}}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"A short description or subtitle shown below the title. Leave empty to hide."})]})]}),m==="catalog"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Catalog Filters"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which filters appear in the shop and category page sidebars."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.tags,onChange:t=>f("tags",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Tags"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Filter products by tags (multi-select checkboxes)"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.priceRange,onChange:t=>f("priceRange",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price Range"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Filter by minimum and maximum price"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.filters.inStock,onChange:t=>f("inStock",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"In Stock"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Show only products that are in stock"})]})]})]})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Sort Options"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which sort options appear in the shop and category pages. At least one must be enabled."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.featured,onChange:t=>v("featured",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Featured"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Default sort order (as returned by backend)"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.priceAsc,onChange:t=>v("priceAsc",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price: Low to High"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Sort products by price ascending"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.catalog.sort.priceDesc,onChange:t=>v("priceDesc",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Price: High to Low"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Sort products by price descending"})]})]})]})]})]}),m==="layouts"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Product Layouts"}),e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:14,opacity:.7},children:"Configure product card layouts for shop and category pages."}),e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Shop Page"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.shopLayout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"shopLayout",value:t.value,checked:s,onChange:()=>k("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.shopLayout.imageCrop,onChange:t=>k("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]}),e.jsxs("div",{style:{paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Category Pages"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.categoryLayout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"categoryLayout",value:t.value,checked:s,onChange:()=>T("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.categoryLayout.imageCrop,onChange:t=>T("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]})]}),m==="product-pages"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Related Products"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure how related products are displayed on product detail pages."}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",marginBottom:"1.5rem"},children:$.map(t=>{const s=a.relatedProducts.mode===t.value,r=t.badge==="Coming Soon";return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"1rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:8,cursor:r?"not-allowed":"pointer",opacity:r?.6:1,background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"relatedProductsMode",value:t.value,checked:s,onChange:()=>!r&&A(t.value),disabled:r,style:{marginTop:2}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{style:{fontWeight:600},children:t.label}),t.badge&&e.jsx("span",{style:{fontSize:11,padding:"2px 6px",borderRadius:4,background:"#6366f1",color:"#fff"},children:t.badge})]}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:13,opacity:.75},children:t.description})]})]},t.value)})}),a.relatedProducts.mode==="manual"&&e.jsxs("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #f5f5f5)",borderRadius:8,border:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("strong",{style:{fontSize:14},children:"How to set related products:"}),e.jsxs("p",{style:{margin:"0.5rem 0 0",fontSize:13,opacity:.8},children:["When editing a product, add a ",e.jsx("code",{style:{background:"rgba(0,0,0,0.1)",padding:"2px 4px",borderRadius:3},children:"relatedProductIds"})," field to its metadata containing a comma-separated list of product IDs."]}),e.jsxs("p",{style:{margin:"0.5rem 0 0",fontSize:13,opacity:.6},children:["Example: ",e.jsx("code",{style:{background:"rgba(0,0,0,0.1)",padding:"2px 4px",borderRadius:3},children:"prod_123,prod_456,prod_789"})]})]}),e.jsxs("div",{className:"cedros-admin__field",style:{maxWidth:200},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Max Related Products"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.relatedProducts.maxItems,onChange:t=>E(Math.max(1,Math.min(12,parseInt(t.target.value)||4))),min:1,max:12}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"How many related products to show (1-12)"})]}),e.jsxs("div",{style:{marginTop:"1.5rem"},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:"0.75rem"},children:"Display Layout"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:S.map(t=>{const s=a.relatedProducts.layout.layout===t.value;return e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.75rem",padding:"0.75rem",border:`2px solid ${s?"var(--cedros-admin-primary, #171717)":"var(--cedros-admin-border, #e5e5e5)"}`,borderRadius:6,cursor:"pointer",background:s?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0,transition:"border-color 0.15s, background 0.15s"},children:[e.jsx("input",{type:"radio",name:"relatedLayout",value:t.value,checked:s,onChange:()=>_("layout",t.value),style:{marginTop:2}}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:t.label}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:12,opacity:.6},children:t.description})]})]},t.value)})}),e.jsx(g.FormDropdown,{value:a.relatedProducts.layout.imageCrop,onChange:t=>_("imageCrop",t),options:C,label:"Image Crop",style:{maxWidth:180}})]})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Page Sections"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Choose which sections appear on product detail pages."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showDescription,onChange:t=>u("showDescription",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Description"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Expandable description accordion"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showSpecs,onChange:t=>u("showSpecs",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Specifications"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Product attributes and details"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showShipping,onChange:t=>u("showShipping",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Shipping & Returns"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Shipping and return policy information"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.sections.showRelatedProducts,onChange:t=>u("showRelatedProducts",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Related Products"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Product recommendations section"})]})]})]})]})]}),m==="checkout"&&e.jsxs("div",{className:"cedros-admin__section",style:{marginTop:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Checkout Settings"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure checkout and cart page features."}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.checkout.promoCodes,onChange:t=>F("promoCodes",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Promo Codes"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Show promo/coupon code input on cart and checkout pages"})]})]})})]}),e.jsxs("div",{style:{marginTop:"2rem",paddingTop:"1.5rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[e.jsx("h4",{style:{marginBottom:"0.5rem",fontWeight:600},children:"Inventory Settings"}),e.jsx("p",{style:{marginBottom:"1rem",fontSize:14,opacity:.7},children:"Configure inventory verification and reservation behavior."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.inventory.preCheckoutVerification,onChange:t=>j("preCheckoutVerification",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Pre-Checkout Verification"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Verify inventory availability before processing payment"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx(o.Toggle,{checked:a.inventory.holdsEnabled,onChange:t=>j("holdsEnabled",t)}),e.jsxs("div",{children:[e.jsx("span",{style:{fontWeight:500},children:"Inventory Holds"}),e.jsx("p",{style:{margin:"0.125rem 0 0",fontSize:13,opacity:.6},children:"Reserve inventory when items are added to cart"})]})]})]}),a.inventory.holdsEnabled&&e.jsxs("div",{className:"cedros-admin__field",style:{maxWidth:200,marginTop:"1rem"},children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Hold Duration (minutes)"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.inventory.holdDurationMinutes,onChange:t=>j("holdDurationMinutes",Math.max(5,Math.min(60,parseInt(t.target.value)||15))),min:5,max:60}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:12,opacity:.6},children:"How long to reserve inventory in carts (5-60 minutes)"})]})]})]})]})}exports.StorefrontSection=H;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),u=require("./index-2N_CMVAv.js"),i={enabled:!1,plans:[],pageTitle:"Choose Your Plan",pageSubtitle:"Select the plan that best fits your needs.",annualSavingsBadge:"2 months free",popularBadgeText:"Best Deal",footerNotice:""},X={title:"New Plan",description:"",priceMonthlyUsd:0,priceAnnualUsd:0,features:[],featureHighlight:"",buttonText:"Purchase",isPopular:!1,isActive:!0,sortOrder:0};function Y(){return`plan_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function G({serverUrl:v,apiKey:b,authManager:f}){const[r,h]=d.useState(i),[_,R]=d.useState(!0),[k,T]=d.useState(null),[p,A]=d.useState("plans"),[y,B]=d.useState("idle"),[z,j]=d.useState(null),[l,m]=d.useState({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),[x,P]=d.useState(l),[F,C]=d.useState(""),w=d.useCallback(async()=>{try{j(null);let e;const t="/admin/subscriptions/settings";if(f?.isAuthenticated())e=await f.fetchWithAuth(t);else{const n={"Content-Type":"application/json"};b&&(n["X-API-Key"]=b);const s=await fetch(`${v}${t}`,{headers:n});if(!s.ok)throw new Error(`Failed to fetch settings: ${s.status}`);e=await s.json()}h({...i,...e}),m({enabled:e.enabled??i.enabled,pageTitle:e.pageTitle??i.pageTitle,pageSubtitle:e.pageSubtitle??i.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge??i.annualSavingsBadge,popularBadgeText:e.popularBadgeText??i.popularBadgeText,footerNotice:e.footerNotice??i.footerNotice}),P({enabled:e.enabled??i.enabled,pageTitle:e.pageTitle??i.pageTitle,pageSubtitle:e.pageSubtitle??i.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge??i.annualSavingsBadge,popularBadgeText:e.popularBadgeText??i.popularBadgeText,footerNotice:e.footerNotice??i.footerNotice}),C(JSON.stringify(e.plans??[]))}catch{h(i),m({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),P({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),C(JSON.stringify([])),j("Failed to load subscription settings")}finally{R(!1)}},[v,b,f]);d.useEffect(()=>{w()},[w]);const I=d.useCallback(async e=>{try{j(null);const t="/admin/subscriptions/settings",n=JSON.stringify(e);if(f?.isAuthenticated())await f.fetchWithAuth(t,{method:"PUT",body:n});else{const s={"Content-Type":"application/json"};b&&(s["X-API-Key"]=b);const o=await fetch(`${v}${t}`,{method:"PUT",headers:s,body:n});if(!o.ok)throw new Error(`Failed to save settings: ${o.status}`)}return!0}catch{return j("Failed to save subscription settings"),!1}},[f,b,v]),E=d.useMemo(()=>x.enabled!==l.enabled||x.pageTitle!==l.pageTitle||x.pageSubtitle!==l.pageSubtitle||x.annualSavingsBadge!==l.annualSavingsBadge||x.popularBadgeText!==l.popularBadgeText||x.footerNotice!==l.footerNotice,[l,x]),D=d.useMemo(()=>JSON.stringify(r.plans),[r.plans]),U=d.useMemo(()=>F!==D,[D,F]),S=d.useCallback(async()=>{const e={...r,enabled:l.enabled,pageTitle:l.pageTitle,pageSubtitle:l.pageSubtitle,annualSavingsBadge:l.annualSavingsBadge,popularBadgeText:l.popularBadgeText,footerNotice:l.footerNotice};B("saving");const t=await I(e);h(e),t&&(P({enabled:e.enabled,pageTitle:e.pageTitle,pageSubtitle:e.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge,popularBadgeText:e.popularBadgeText,footerNotice:e.footerNotice}),C(JSON.stringify(e.plans))),B(t?"saved":"error"),setTimeout(()=>B("idle"),1500)},[l,I,r]);d.useEffect(()=>{if(p!=="page"||_||!E)return;const e=setTimeout(S,600);return()=>clearTimeout(e)},[p,E,_,S]),d.useEffect(()=>{if(p!=="plans"||_||!U)return;const e=setTimeout(S,800);return()=>clearTimeout(e)},[p,U,_,S]);const O=()=>{const e={...X,id:Y(),sortOrder:r.plans.length};h(t=>({...t,plans:[...t.plans,e]})),T(e.id)},c=(e,t)=>{h(n=>({...n,plans:n.plans.map(s=>s.id===e?{...s,...t}:s)}))},H=e=>{confirm("Delete this plan? This cannot be undone.")&&(h(t=>({...t,plans:t.plans.filter(n=>n.id!==e)})),k===e&&T(null))},$=(e,t)=>{const n=r.plans.findIndex(g=>g.id===e);if(n===-1||t==="up"&&n===0||t==="down"&&n===r.plans.length-1)return;const s=[...r.plans],o=t==="up"?n-1:n+1;[s[n],s[o]]=[s[o],s[n]],h(g=>({...g,plans:s}))},Q=e=>{c(e,{features:[...r.plans.find(t=>t.id===e)?.features||[],""]})},J=(e,t,n)=>{const s=r.plans.find(g=>g.id===e);if(!s)return;const o=[...s.features];o[t]=n,c(e,{features:o})},q=(e,t)=>{const n=r.plans.find(o=>o.id===e);if(!n)return;const s=n.features.filter((o,g)=>g!==t);c(e,{features:s})};if(_)return a.jsx("div",{className:"cedros-admin__page",children:a.jsxs("div",{className:"cedros-admin__loading",children:[u.Icons.loading," Loading subscription settings..."]})});const M=r.plans.filter(e=>e.isActive).length,L=r.plans.reduce((e,t)=>e+(t.activeSubscribers??0),0),N=l.enabled,W=r.plans.filter(e=>e.isActive).map(e=>({label:e.title,value:e.activeSubscribers??0,description:"subscribers"}));return a.jsxs("div",{className:"cedros-admin__page",children:[a.jsx(u.ErrorBanner,{message:z,onRetry:w}),a.jsx(u.StatsBar,{stats:[{label:"Status",value:N?"Enabled":"Disabled",variant:N?"success":"muted"},{label:"Active Plans",value:M,variant:M>0?"success":"muted"},{label:"Total Subscribers",value:L,variant:L>0?"success":"muted"},...W],isLoading:_}),a.jsxs("div",{className:"cedros-admin__section",children:[a.jsxs("div",{className:"cedros-admin__section-header",children:[a.jsx("h3",{className:"cedros-admin__section-title",children:"Subscription Settings"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[p==="plans"&&a.jsxs("button",{className:"cedros-admin__button cedros-admin__button--primary cedros-admin__button--action",onClick:O,disabled:!N,children:[u.Icons.plus,"Add Plan"]}),a.jsxs("span",{className:`cedros-admin__autosave-indicator cedros-admin__autosave-indicator--${y}`,children:[y==="saving"&&"Saving...",y==="saved"&&"Saved",y==="error"&&"Error"]})]})]}),a.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:[a.jsx("button",{type:"button",className:`cedros-admin__tab ${p==="plans"?"cedros-admin__tab--active":""}`,onClick:()=>A("plans"),children:"Plans"}),a.jsx("button",{type:"button",className:`cedros-admin__tab ${p==="page"?"cedros-admin__tab--active":""}`,onClick:()=>A("page"),children:"Page Settings"})]}),p==="page"&&a.jsxs("div",{children:[a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Subscriptions"}),a.jsxs("label",{className:"cedros-admin__toggle",children:[a.jsx("input",{type:"checkbox",className:"cedros-admin__toggle-input",checked:l.enabled,onChange:e=>m(t=>({...t,enabled:e.target.checked}))}),a.jsx("span",{className:"cedros-admin__toggle-track",children:a.jsx("span",{className:"cedros-admin__toggle-thumb"})}),a.jsx("span",{className:"cedros-admin__toggle-label",children:"Enable Subscriptions"})]})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Page Title"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.pageTitle||"",onChange:e=>m(t=>({...t,pageTitle:e.target.value})),placeholder:"Choose Your Plan"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Page Subtitle"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.pageSubtitle||"",onChange:e=>m(t=>({...t,pageSubtitle:e.target.value})),placeholder:"Select the plan that best fits your needs."})]})]}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Annual Savings Badge"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.annualSavingsBadge||"",onChange:e=>m(t=>({...t,annualSavingsBadge:e.target.value})),placeholder:"2 months free"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Popular Plan Badge"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.popularBadgeText||"",onChange:e=>m(t=>({...t,popularBadgeText:e.target.value})),placeholder:"Best Deal"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",style:{flex:1},children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Footer Notice (optional)"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.footerNotice||"",onChange:e=>m(t=>({...t,footerNotice:e.target.value})),placeholder:"For information regarding invoices, taxes..."})]})})]}),p==="plans"&&a.jsxs("div",{children:[!N&&a.jsx("div",{style:{padding:"1.5rem",textAlign:"center",opacity:.6},children:"Subscriptions are disabled. Enable them to configure plans."}),r.plans.length===0?a.jsx("div",{style:{padding:"2rem",textAlign:"center",opacity:.6,border:"1px dashed currentColor",borderRadius:8},children:'No plans configured. Click "Add Plan" to create your first subscription tier.'}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:r.plans.map((e,t)=>{const n=k===e.id;return a.jsxs("div",{style:{border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:8,overflow:"hidden",background:e.isPopular?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.75rem 1rem",cursor:"pointer"},onClick:()=>T(n?null:e.id),children:[a.jsx("span",{style:{opacity:.5},children:n?u.Icons.chevronDown:u.Icons.chevronRight}),a.jsxs("div",{style:{flex:1},children:[a.jsx("span",{style:{fontWeight:600},children:e.title||"Untitled Plan"}),e.isPopular&&a.jsx("span",{style:{marginLeft:"0.5rem",fontSize:11,padding:"2px 6px",borderRadius:4,background:"var(--cedros-admin-primary, #171717)",color:"#fff"},children:"Popular"}),!e.isActive&&a.jsx("span",{style:{marginLeft:"0.5rem",fontSize:11,padding:"2px 6px",borderRadius:4,background:"#9ca3af",color:"#fff"},children:"Inactive"})]}),a.jsxs("span",{style:{opacity:.6,fontSize:14},children:["$",e.priceMonthlyUsd,"/mo · $",e.priceAnnualUsd,"/yr"]}),a.jsxs("div",{style:{display:"flex",gap:"0.25rem"},onClick:s=>s.stopPropagation(),children:[a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>$(e.id,"up"),disabled:t===0,title:"Move up",style:{padding:"4px 8px"},children:u.Icons.chevronUp}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>$(e.id,"down"),disabled:t===r.plans.length-1,title:"Move down",style:{padding:"4px 8px"},children:u.Icons.chevronDown}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>H(e.id),title:"Delete plan",style:{padding:"4px 8px",color:"#dc2626"},children:u.Icons.trash})]})]}),n&&a.jsxs("div",{style:{padding:"1rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Plan Name"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.title,onChange:s=>c(e.id,{title:s.target.value}),placeholder:"e.g., Starter"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Button Text"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.buttonText||"",onChange:s=>c(e.id,{buttonText:s.target.value}),placeholder:"Purchase"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",style:{flex:1},children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Description"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.description,onChange:s=>c(e.id,{description:s.target.value}),placeholder:"For entry-level developers managing lightweight workloads"})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Monthly Price (USD)"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.priceMonthlyUsd||"",onChange:s=>c(e.id,{priceMonthlyUsd:parseFloat(s.target.value)||0}),placeholder:"10",min:"0",step:"0.01"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Annual Price (USD)"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.priceAnnualUsd||"",onChange:s=>c(e.id,{priceAnnualUsd:parseFloat(s.target.value)||0}),placeholder:"100",min:"0",step:"0.01"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Feature Highlight"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.featureHighlight||"",onChange:s=>c(e.id,{featureHighlight:s.target.value}),placeholder:"100 prompts every 5 hours"}),a.jsx("div",{style:{marginTop:4,fontSize:12,opacity:.75},children:"Bold text shown above feature list"})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.isPopular||!1,onChange:s=>c(e.id,{isPopular:s.target.checked})}),"Mark as Popular (featured styling)"]})}),a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.isActive,onChange:s=>c(e.id,{isActive:s.target.checked})}),"Active (available for purchase)"]})})]}),a.jsxs("div",{className:"cedros-admin__form-row",style:{marginTop:"0.5rem"},children:[a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.inventoryQuantity!=null,onChange:s=>c(e.id,{inventoryQuantity:s.target.checked?100:null})}),"Limit quantity available"]})}),e.inventoryQuantity!=null&&a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Total Available"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.inventoryQuantity??"",onChange:s=>c(e.id,{inventoryQuantity:parseInt(s.target.value)||0}),min:"0",style:{width:100}}),e.inventorySold!=null&&e.inventorySold>0&&a.jsxs("div",{style:{marginTop:4,fontSize:12,opacity:.75},children:[e.inventorySold," sold · ",Math.max(0,e.inventoryQuantity-e.inventorySold)," remaining"]})]})]}),a.jsxs("div",{style:{marginTop:"1rem"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[a.jsxs("label",{className:"cedros-admin__field-label",style:{margin:0},children:["Feature List (",e.features.length,")"]}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>Q(e.id),style:{fontSize:12,padding:"4px 8px"},children:"+ Add Feature"})]}),e.features.length===0?a.jsx("div",{style:{padding:"1rem",textAlign:"center",opacity:.5,fontSize:13,border:"1px dashed currentColor",borderRadius:6},children:'No features. Click "Add Feature" to add bullet points.'}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:e.features.map((s,o)=>a.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[a.jsxs("span",{style:{opacity:.4,fontSize:12},children:[o+1,"."]}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:s,onChange:g=>J(e.id,o,g.target.value),placeholder:"e.g., Powered by MiniMax M2.1",style:{flex:1}}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>q(e.id,o),style:{padding:"4px 8px",color:"#dc2626"},title:"Remove feature",children:u.Icons.trash})]},o))})]})]})]},e.id)})})]})]})]})}exports.SubscriptionsSection=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),u=require("./index-B5ck27xb.js"),i={enabled:!1,plans:[],pageTitle:"Choose Your Plan",pageSubtitle:"Select the plan that best fits your needs.",annualSavingsBadge:"2 months free",popularBadgeText:"Best Deal",footerNotice:""},X={title:"New Plan",description:"",priceMonthlyUsd:0,priceAnnualUsd:0,features:[],featureHighlight:"",buttonText:"Purchase",isPopular:!1,isActive:!0,sortOrder:0};function Y(){return`plan_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function G({serverUrl:v,apiKey:b,authManager:f}){const[r,h]=d.useState(i),[_,R]=d.useState(!0),[k,T]=d.useState(null),[p,A]=d.useState("plans"),[y,B]=d.useState("idle"),[z,j]=d.useState(null),[l,m]=d.useState({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),[x,P]=d.useState(l),[F,C]=d.useState(""),w=d.useCallback(async()=>{try{j(null);let e;const t="/admin/subscriptions/settings";if(f?.isAuthenticated())e=await f.fetchWithAuth(t);else{const n={"Content-Type":"application/json"};b&&(n["X-API-Key"]=b);const s=await fetch(`${v}${t}`,{headers:n});if(!s.ok)throw new Error(`Failed to fetch settings: ${s.status}`);e=await s.json()}h({...i,...e}),m({enabled:e.enabled??i.enabled,pageTitle:e.pageTitle??i.pageTitle,pageSubtitle:e.pageSubtitle??i.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge??i.annualSavingsBadge,popularBadgeText:e.popularBadgeText??i.popularBadgeText,footerNotice:e.footerNotice??i.footerNotice}),P({enabled:e.enabled??i.enabled,pageTitle:e.pageTitle??i.pageTitle,pageSubtitle:e.pageSubtitle??i.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge??i.annualSavingsBadge,popularBadgeText:e.popularBadgeText??i.popularBadgeText,footerNotice:e.footerNotice??i.footerNotice}),C(JSON.stringify(e.plans??[]))}catch{h(i),m({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),P({enabled:i.enabled,pageTitle:i.pageTitle,pageSubtitle:i.pageSubtitle,annualSavingsBadge:i.annualSavingsBadge,popularBadgeText:i.popularBadgeText,footerNotice:i.footerNotice}),C(JSON.stringify([])),j("Failed to load subscription settings")}finally{R(!1)}},[v,b,f]);d.useEffect(()=>{w()},[w]);const I=d.useCallback(async e=>{try{j(null);const t="/admin/subscriptions/settings",n=JSON.stringify(e);if(f?.isAuthenticated())await f.fetchWithAuth(t,{method:"PUT",body:n});else{const s={"Content-Type":"application/json"};b&&(s["X-API-Key"]=b);const o=await fetch(`${v}${t}`,{method:"PUT",headers:s,body:n});if(!o.ok)throw new Error(`Failed to save settings: ${o.status}`)}return!0}catch{return j("Failed to save subscription settings"),!1}},[f,b,v]),E=d.useMemo(()=>x.enabled!==l.enabled||x.pageTitle!==l.pageTitle||x.pageSubtitle!==l.pageSubtitle||x.annualSavingsBadge!==l.annualSavingsBadge||x.popularBadgeText!==l.popularBadgeText||x.footerNotice!==l.footerNotice,[l,x]),D=d.useMemo(()=>JSON.stringify(r.plans),[r.plans]),U=d.useMemo(()=>F!==D,[D,F]),S=d.useCallback(async()=>{const e={...r,enabled:l.enabled,pageTitle:l.pageTitle,pageSubtitle:l.pageSubtitle,annualSavingsBadge:l.annualSavingsBadge,popularBadgeText:l.popularBadgeText,footerNotice:l.footerNotice};B("saving");const t=await I(e);h(e),t&&(P({enabled:e.enabled,pageTitle:e.pageTitle,pageSubtitle:e.pageSubtitle,annualSavingsBadge:e.annualSavingsBadge,popularBadgeText:e.popularBadgeText,footerNotice:e.footerNotice}),C(JSON.stringify(e.plans))),B(t?"saved":"error"),setTimeout(()=>B("idle"),1500)},[l,I,r]);d.useEffect(()=>{if(p!=="page"||_||!E)return;const e=setTimeout(S,600);return()=>clearTimeout(e)},[p,E,_,S]),d.useEffect(()=>{if(p!=="plans"||_||!U)return;const e=setTimeout(S,800);return()=>clearTimeout(e)},[p,U,_,S]);const O=()=>{const e={...X,id:Y(),sortOrder:r.plans.length};h(t=>({...t,plans:[...t.plans,e]})),T(e.id)},c=(e,t)=>{h(n=>({...n,plans:n.plans.map(s=>s.id===e?{...s,...t}:s)}))},H=e=>{confirm("Delete this plan? This cannot be undone.")&&(h(t=>({...t,plans:t.plans.filter(n=>n.id!==e)})),k===e&&T(null))},$=(e,t)=>{const n=r.plans.findIndex(g=>g.id===e);if(n===-1||t==="up"&&n===0||t==="down"&&n===r.plans.length-1)return;const s=[...r.plans],o=t==="up"?n-1:n+1;[s[n],s[o]]=[s[o],s[n]],h(g=>({...g,plans:s}))},Q=e=>{c(e,{features:[...r.plans.find(t=>t.id===e)?.features||[],""]})},J=(e,t,n)=>{const s=r.plans.find(g=>g.id===e);if(!s)return;const o=[...s.features];o[t]=n,c(e,{features:o})},q=(e,t)=>{const n=r.plans.find(o=>o.id===e);if(!n)return;const s=n.features.filter((o,g)=>g!==t);c(e,{features:s})};if(_)return a.jsx("div",{className:"cedros-admin__page",children:a.jsxs("div",{className:"cedros-admin__loading",children:[u.Icons.loading," Loading subscription settings..."]})});const M=r.plans.filter(e=>e.isActive).length,L=r.plans.reduce((e,t)=>e+(t.activeSubscribers??0),0),N=l.enabled,W=r.plans.filter(e=>e.isActive).map(e=>({label:e.title,value:e.activeSubscribers??0,description:"subscribers"}));return a.jsxs("div",{className:"cedros-admin__page",children:[a.jsx(u.ErrorBanner,{message:z,onRetry:w}),a.jsx(u.StatsBar,{stats:[{label:"Status",value:N?"Enabled":"Disabled",variant:N?"success":"muted"},{label:"Active Plans",value:M,variant:M>0?"success":"muted"},{label:"Total Subscribers",value:L,variant:L>0?"success":"muted"},...W],isLoading:_}),a.jsxs("div",{className:"cedros-admin__section",children:[a.jsxs("div",{className:"cedros-admin__section-header",children:[a.jsx("h3",{className:"cedros-admin__section-title",children:"Subscription Settings"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[p==="plans"&&a.jsxs("button",{className:"cedros-admin__button cedros-admin__button--primary cedros-admin__button--action",onClick:O,disabled:!N,children:[u.Icons.plus,"Add Plan"]}),a.jsxs("span",{className:`cedros-admin__autosave-indicator cedros-admin__autosave-indicator--${y}`,children:[y==="saving"&&"Saving...",y==="saved"&&"Saved",y==="error"&&"Error"]})]})]}),a.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:[a.jsx("button",{type:"button",className:`cedros-admin__tab ${p==="plans"?"cedros-admin__tab--active":""}`,onClick:()=>A("plans"),children:"Plans"}),a.jsx("button",{type:"button",className:`cedros-admin__tab ${p==="page"?"cedros-admin__tab--active":""}`,onClick:()=>A("page"),children:"Page Settings"})]}),p==="page"&&a.jsxs("div",{children:[a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Subscriptions"}),a.jsxs("label",{className:"cedros-admin__toggle",children:[a.jsx("input",{type:"checkbox",className:"cedros-admin__toggle-input",checked:l.enabled,onChange:e=>m(t=>({...t,enabled:e.target.checked}))}),a.jsx("span",{className:"cedros-admin__toggle-track",children:a.jsx("span",{className:"cedros-admin__toggle-thumb"})}),a.jsx("span",{className:"cedros-admin__toggle-label",children:"Enable Subscriptions"})]})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Page Title"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.pageTitle||"",onChange:e=>m(t=>({...t,pageTitle:e.target.value})),placeholder:"Choose Your Plan"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Page Subtitle"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.pageSubtitle||"",onChange:e=>m(t=>({...t,pageSubtitle:e.target.value})),placeholder:"Select the plan that best fits your needs."})]})]}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Annual Savings Badge"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.annualSavingsBadge||"",onChange:e=>m(t=>({...t,annualSavingsBadge:e.target.value})),placeholder:"2 months free"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Popular Plan Badge"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.popularBadgeText||"",onChange:e=>m(t=>({...t,popularBadgeText:e.target.value})),placeholder:"Best Deal"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",style:{flex:1},children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Footer Notice (optional)"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:l.footerNotice||"",onChange:e=>m(t=>({...t,footerNotice:e.target.value})),placeholder:"For information regarding invoices, taxes..."})]})})]}),p==="plans"&&a.jsxs("div",{children:[!N&&a.jsx("div",{style:{padding:"1.5rem",textAlign:"center",opacity:.6},children:"Subscriptions are disabled. Enable them to configure plans."}),r.plans.length===0?a.jsx("div",{style:{padding:"2rem",textAlign:"center",opacity:.6,border:"1px dashed currentColor",borderRadius:8},children:'No plans configured. Click "Add Plan" to create your first subscription tier.'}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:r.plans.map((e,t)=>{const n=k===e.id;return a.jsxs("div",{style:{border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:8,overflow:"hidden",background:e.isPopular?"var(--cedros-admin-bg-accent, #f5f5f5)":void 0},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.75rem 1rem",cursor:"pointer"},onClick:()=>T(n?null:e.id),children:[a.jsx("span",{style:{opacity:.5},children:n?u.Icons.chevronDown:u.Icons.chevronRight}),a.jsxs("div",{style:{flex:1},children:[a.jsx("span",{style:{fontWeight:600},children:e.title||"Untitled Plan"}),e.isPopular&&a.jsx("span",{style:{marginLeft:"0.5rem",fontSize:11,padding:"2px 6px",borderRadius:4,background:"var(--cedros-admin-primary, #171717)",color:"#fff"},children:"Popular"}),!e.isActive&&a.jsx("span",{style:{marginLeft:"0.5rem",fontSize:11,padding:"2px 6px",borderRadius:4,background:"#9ca3af",color:"#fff"},children:"Inactive"})]}),a.jsxs("span",{style:{opacity:.6,fontSize:14},children:["$",e.priceMonthlyUsd,"/mo · $",e.priceAnnualUsd,"/yr"]}),a.jsxs("div",{style:{display:"flex",gap:"0.25rem"},onClick:s=>s.stopPropagation(),children:[a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>$(e.id,"up"),disabled:t===0,title:"Move up",style:{padding:"4px 8px"},children:u.Icons.chevronUp}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>$(e.id,"down"),disabled:t===r.plans.length-1,title:"Move down",style:{padding:"4px 8px"},children:u.Icons.chevronDown}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>H(e.id),title:"Delete plan",style:{padding:"4px 8px",color:"#dc2626"},children:u.Icons.trash})]})]}),n&&a.jsxs("div",{style:{padding:"1rem",borderTop:"1px solid var(--cedros-admin-border, #e5e5e5)"},children:[a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Plan Name"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.title,onChange:s=>c(e.id,{title:s.target.value}),placeholder:"e.g., Starter"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Button Text"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.buttonText||"",onChange:s=>c(e.id,{buttonText:s.target.value}),placeholder:"Purchase"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",style:{flex:1},children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Description"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.description,onChange:s=>c(e.id,{description:s.target.value}),placeholder:"For entry-level developers managing lightweight workloads"})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Monthly Price (USD)"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.priceMonthlyUsd||"",onChange:s=>c(e.id,{priceMonthlyUsd:parseFloat(s.target.value)||0}),placeholder:"10",min:"0",step:"0.01"})]}),a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Annual Price (USD)"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.priceAnnualUsd||"",onChange:s=>c(e.id,{priceAnnualUsd:parseFloat(s.target.value)||0}),placeholder:"100",min:"0",step:"0.01"})]})]}),a.jsx("div",{className:"cedros-admin__form-row",children:a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Feature Highlight"}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:e.featureHighlight||"",onChange:s=>c(e.id,{featureHighlight:s.target.value}),placeholder:"100 prompts every 5 hours"}),a.jsx("div",{style:{marginTop:4,fontSize:12,opacity:.75},children:"Bold text shown above feature list"})]})}),a.jsxs("div",{className:"cedros-admin__form-row",children:[a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.isPopular||!1,onChange:s=>c(e.id,{isPopular:s.target.checked})}),"Mark as Popular (featured styling)"]})}),a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.isActive,onChange:s=>c(e.id,{isActive:s.target.checked})}),"Active (available for purchase)"]})})]}),a.jsxs("div",{className:"cedros-admin__form-row",style:{marginTop:"0.5rem"},children:[a.jsx("div",{className:"cedros-admin__field",children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:e.inventoryQuantity!=null,onChange:s=>c(e.id,{inventoryQuantity:s.target.checked?100:null})}),"Limit quantity available"]})}),e.inventoryQuantity!=null&&a.jsxs("div",{className:"cedros-admin__field",children:[a.jsx("label",{className:"cedros-admin__field-label",children:"Total Available"}),a.jsx("input",{type:"number",className:"cedros-admin__input",value:e.inventoryQuantity??"",onChange:s=>c(e.id,{inventoryQuantity:parseInt(s.target.value)||0}),min:"0",style:{width:100}}),e.inventorySold!=null&&e.inventorySold>0&&a.jsxs("div",{style:{marginTop:4,fontSize:12,opacity:.75},children:[e.inventorySold," sold · ",Math.max(0,e.inventoryQuantity-e.inventorySold)," remaining"]})]})]}),a.jsxs("div",{style:{marginTop:"1rem"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[a.jsxs("label",{className:"cedros-admin__field-label",style:{margin:0},children:["Feature List (",e.features.length,")"]}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>Q(e.id),style:{fontSize:12,padding:"4px 8px"},children:"+ Add Feature"})]}),e.features.length===0?a.jsx("div",{style:{padding:"1rem",textAlign:"center",opacity:.5,fontSize:13,border:"1px dashed currentColor",borderRadius:6},children:'No features. Click "Add Feature" to add bullet points.'}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:e.features.map((s,o)=>a.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[a.jsxs("span",{style:{opacity:.4,fontSize:12},children:[o+1,"."]}),a.jsx("input",{type:"text",className:"cedros-admin__input",value:s,onChange:g=>J(e.id,o,g.target.value),placeholder:"e.g., Powered by MiniMax M2.1",style:{flex:1}}),a.jsx("button",{className:"cedros-admin__button cedros-admin__button--ghost",onClick:()=>q(e.id,o),style:{padding:"4px 8px",color:"#dc2626"},title:"Remove feature",children:u.Icons.trash})]},o))})]})]})]},e.id)})})]})]})]})}exports.SubscriptionsSection=G;
@@ -1,6 +1,6 @@
1
1
  import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
2
  import { useState as g, useCallback as F, useEffect as D, useMemo as E } from "react";
3
- import { $ as h, a0 as Z, a1 as K } from "./index-C1hbnxn0.mjs";
3
+ import { I as h, E as Z, b as K } from "./index-75RhiLDq.mjs";
4
4
  const l = {
5
5
  enabled: !1,
6
6
  plans: [],
@@ -25,14 +25,14 @@ function ae() {
25
25
  return `plan_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
26
26
  }
27
27
  function le({ serverUrl: N, apiKey: _, authManager: v }) {
28
- const [r, b] = g(l), [y, Q] = g(!0), [$, P] = g(null), [u, U] = g("plans"), [S, C] = g("idle"), [J, x] = g(null), [d, m] = g({
28
+ const [r, b] = g(l), [y, Q] = g(!0), [I, P] = g(null), [u, U] = g("plans"), [S, C] = g("idle"), [J, x] = g(null), [d, m] = g({
29
29
  enabled: l.enabled,
30
30
  pageTitle: l.pageTitle,
31
31
  pageSubtitle: l.pageSubtitle,
32
32
  annualSavingsBadge: l.annualSavingsBadge,
33
33
  popularBadgeText: l.popularBadgeText,
34
34
  footerNotice: l.footerNotice
35
- }), [f, w] = g(d), [I, k] = g(""), A = F(async () => {
35
+ }), [f, w] = g(d), [$, k] = g(""), A = F(async () => {
36
36
  try {
37
37
  x(null);
38
38
  let e;
@@ -100,7 +100,7 @@ function le({ serverUrl: N, apiKey: _, authManager: v }) {
100
100
  } catch {
101
101
  return x("Failed to save subscription settings"), !1;
102
102
  }
103
- }, [v, _, N]), M = E(() => f.enabled !== d.enabled || f.pageTitle !== d.pageTitle || f.pageSubtitle !== d.pageSubtitle || f.annualSavingsBadge !== d.annualSavingsBadge || f.popularBadgeText !== d.popularBadgeText || f.footerNotice !== d.footerNotice, [d, f]), z = E(() => JSON.stringify(r.plans), [r.plans]), R = E(() => I !== z, [z, I]), T = F(async () => {
103
+ }, [v, _, N]), M = E(() => f.enabled !== d.enabled || f.pageTitle !== d.pageTitle || f.pageSubtitle !== d.pageSubtitle || f.annualSavingsBadge !== d.annualSavingsBadge || f.popularBadgeText !== d.popularBadgeText || f.footerNotice !== d.footerNotice, [d, f]), z = E(() => JSON.stringify(r.plans), [r.plans]), R = E(() => $ !== z, [z, $]), T = F(async () => {
104
104
  const e = {
105
105
  ...r,
106
106
  enabled: d.enabled,
@@ -146,7 +146,7 @@ function le({ serverUrl: N, apiKey: _, authManager: v }) {
146
146
  confirm("Delete this plan? This cannot be undone.") && (b((n) => ({
147
147
  ...n,
148
148
  plans: n.plans.filter((s) => s.id !== e)
149
- })), $ === e && P(null));
149
+ })), I === e && P(null));
150
150
  }, H = (e, n) => {
151
151
  const s = r.plans.findIndex((p) => p.id === e);
152
152
  if (s === -1 || n === "up" && s === 0 || n === "down" && s === r.plans.length - 1) return;
@@ -324,7 +324,7 @@ function le({ serverUrl: N, apiKey: _, authManager: v }) {
324
324
  u === "plans" && /* @__PURE__ */ i("div", { children: [
325
325
  !B && /* @__PURE__ */ a("div", { style: { padding: "1.5rem", textAlign: "center", opacity: 0.6 }, children: "Subscriptions are disabled. Enable them to configure plans." }),
326
326
  r.plans.length === 0 ? /* @__PURE__ */ a("div", { style: { padding: "2rem", textAlign: "center", opacity: 0.6, border: "1px dashed currentColor", borderRadius: 8 }, children: 'No plans configured. Click "Add Plan" to create your first subscription tier.' }) : /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: r.plans.map((e, n) => {
327
- const s = $ === e.id;
327
+ const s = I === e.id;
328
328
  return /* @__PURE__ */ i(
329
329
  "div",
330
330
  {
@@ -1,6 +1,6 @@
1
1
  import { clusterApiUrl as C, Connection as b, Transaction as P, PublicKey as l, TransactionInstruction as R, LAMPORTS_PER_SOL as x } from "@solana/web3.js";
2
2
  import { getAssociatedTokenAddress as T, createTransferInstruction as A } from "@solana/spl-token";
3
- import { c as v, b as B, i as u, k as S, r as m, g, e as w, l as f, m as M } from "./CedrosContext-BnJ2Cf7R.mjs";
3
+ import { c as v, b as B, i as u, k as S, r as m, g, e as w, l as f, m as M } from "./CedrosContext-BE6P5PQ0.mjs";
4
4
  import { b as k } from "./index-BFt38o8Q.mjs";
5
5
  class z {
6
6
  connection;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@solana/web3.js"),w=require("@solana/spl-token"),t=require("./CedrosContext-C26DlvLF.js"),h=require("./index-WcOlBYZJ.js");class p{connection;cluster;endpoint;allowUnknownMint;rpcRateLimiter=t.createRateLimiter({maxRequests:50,windowMs:6e4});rpcCircuitBreaker=t.createCircuitBreaker({failureThreshold:5,timeout:1e4,name:"solana-rpc"});constructor(r="mainnet-beta",e,n=!1){this.cluster=r,this.endpoint=e,this.allowUnknownMint=n,this.connection=this.createConnection()}createConnection(){const r=this.endpoint??o.clusterApiUrl(this.cluster);return new o.Connection(r,"confirmed")}transformRpcError(r){const e=r instanceof Error?r.message:typeof r=="string"?r:String(r);return e.includes("403")||e.includes("Access forbidden")?new Error("Public Solana RPC access denied. Please configure a custom RPC endpoint (e.g., from Helius, QuickNode, or Alchemy) in your CedrosProvider config using the solanaEndpoint option."):e.includes("429")||e.includes("Too Many Requests")?new Error("Solana RPC rate limit exceeded. Please configure a custom RPC endpoint with higher limits in your CedrosProvider config using the solanaEndpoint option."):r instanceof Error?r:new Error(e)}async buildTransaction(r){const{requirement:e,payerPublicKey:n,blockhash:a}=r;if(!e||!e.payTo)throw new Error("Invalid requirement: missing payTo");t.getLogger().debug("[WalletManager] Building transaction for resource:",e.resource);const i=new o.Transaction,u=this.resolveAmountInMinorUnits(e),c=e.asset;if(!c)throw new Error("asset is required in x402 requirement");const l=t.validateX402Asset(c,e.resource,this.allowUnknownMint);if(!l.isValid&&l.error)throw new Error(l.error);l.warning&&t.getLogger().warn(l.warning);const y=new o.PublicKey(c),m=await w.getAssociatedTokenAddress(y,n);if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");let d;try{d=await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getAccountInfo(m),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-account-info"}))}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}if(!d)throw new Error("Payer is missing an associated token account for this mint");let f;try{f=e.extra?.recipientTokenAccount?new o.PublicKey(e.extra.recipientTokenAccount):new o.PublicKey(e.payTo)}catch(s){throw t.getLogger().warn("[WalletManager] Failed to resolve recipient address:",s),new Error("We are currently unable to process payment, please try again later")}if(i.add(w.createTransferInstruction(m,f,n,u)),e.extra?.memo){const s=new o.TransactionInstruction({keys:[],programId:new o.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),data:Buffer.from(e.extra.memo,"utf8")});i.add(s)}let g;if(a)g=a;else{if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{g=(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getLatestBlockhash(),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-blockhash"}))).blockhash}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}}return i.recentBlockhash=g,e.extra?.feePayer?i.feePayer=new o.PublicKey(e.extra.feePayer):i.feePayer=n,i}resolveAmountInMinorUnits(r){const e=r.maxAmountRequired;if(!/^\d+$/.test(e))throw new Error("Invalid maxAmountRequired in requirement: must be a non-negative integer string");const n=BigInt(e);if(n<=0n)throw new Error("Invalid maxAmountRequired in requirement");return n}buildPaymentPayload(r){const{requirement:e,signedTx:n,payerPublicKey:a}=r;return{x402Version:0,scheme:e.scheme,network:e.network,payload:{signature:n.signature,transaction:n.serialized,payer:a.toString(),memo:e.extra?.memo,recipientTokenAccount:e.extra?.recipientTokenAccount}}}async signTransaction(r){const{transaction:e,signTransaction:n}=r;t.getLogger().debug("[WalletManager] Requesting wallet to sign transaction");const a=await n(e),i=a.serialize(),u=a.signatures[0]?.signature;if(!u)throw new Error("Signed transaction missing signature");const c=h.bs58.encode(u);return t.getLogger().debug("[WalletManager] Transaction signed with signature:",c.substring(0,20)+"..."),{serialized:t.gBase64.fromUint8Array(i),signature:c}}deserializeTransaction(r){try{const e=t.gBase64.toUint8Array(r);return o.Transaction.from(e)}catch(e){throw new Error(`Failed to deserialize transaction: ${t.formatError(e,"Unknown error")}`)}}async partiallySignTransaction(r){const{transaction:e,signTransaction:n,blockhash:a}=r;a&&e.recentBlockhash!==a&&(e.recentBlockhash=a);const i=await n(e),u=i.signatures[0]?.signature;if(u){const l=h.bs58.encode(u);t.getLogger().debug("[WalletManager] Partially signed with signature:",l.substring(0,20)+"...")}const c=i.serialize({requireAllSignatures:!1,verifySignatures:!1});return t.gBase64.fromUint8Array(c)}async getBalance(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{return await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getBalance(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-balance"}))/o.LAMPORTS_PER_SOL}catch(e){throw e instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(e)}}async verifyTransaction(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded for transaction verification");try{return!!(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getSignatureStatus(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-verify-tx"}))).value?.confirmationStatus}catch(e){return e instanceof t.CircuitBreakerOpenError&&t.getLogger().warn("[WalletManager] Circuit breaker OPEN - cannot verify transaction"),!1}}}exports.WalletManager=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@solana/web3.js"),w=require("@solana/spl-token"),t=require("./CedrosContext-D-lnoEkR.js"),h=require("./index-WcOlBYZJ.js");class p{connection;cluster;endpoint;allowUnknownMint;rpcRateLimiter=t.createRateLimiter({maxRequests:50,windowMs:6e4});rpcCircuitBreaker=t.createCircuitBreaker({failureThreshold:5,timeout:1e4,name:"solana-rpc"});constructor(r="mainnet-beta",e,n=!1){this.cluster=r,this.endpoint=e,this.allowUnknownMint=n,this.connection=this.createConnection()}createConnection(){const r=this.endpoint??o.clusterApiUrl(this.cluster);return new o.Connection(r,"confirmed")}transformRpcError(r){const e=r instanceof Error?r.message:typeof r=="string"?r:String(r);return e.includes("403")||e.includes("Access forbidden")?new Error("Public Solana RPC access denied. Please configure a custom RPC endpoint (e.g., from Helius, QuickNode, or Alchemy) in your CedrosProvider config using the solanaEndpoint option."):e.includes("429")||e.includes("Too Many Requests")?new Error("Solana RPC rate limit exceeded. Please configure a custom RPC endpoint with higher limits in your CedrosProvider config using the solanaEndpoint option."):r instanceof Error?r:new Error(e)}async buildTransaction(r){const{requirement:e,payerPublicKey:n,blockhash:a}=r;if(!e||!e.payTo)throw new Error("Invalid requirement: missing payTo");t.getLogger().debug("[WalletManager] Building transaction for resource:",e.resource);const i=new o.Transaction,u=this.resolveAmountInMinorUnits(e),c=e.asset;if(!c)throw new Error("asset is required in x402 requirement");const l=t.validateX402Asset(c,e.resource,this.allowUnknownMint);if(!l.isValid&&l.error)throw new Error(l.error);l.warning&&t.getLogger().warn(l.warning);const y=new o.PublicKey(c),m=await w.getAssociatedTokenAddress(y,n);if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");let d;try{d=await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getAccountInfo(m),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-account-info"}))}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}if(!d)throw new Error("Payer is missing an associated token account for this mint");let f;try{f=e.extra?.recipientTokenAccount?new o.PublicKey(e.extra.recipientTokenAccount):new o.PublicKey(e.payTo)}catch(s){throw t.getLogger().warn("[WalletManager] Failed to resolve recipient address:",s),new Error("We are currently unable to process payment, please try again later")}if(i.add(w.createTransferInstruction(m,f,n,u)),e.extra?.memo){const s=new o.TransactionInstruction({keys:[],programId:new o.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),data:Buffer.from(e.extra.memo,"utf8")});i.add(s)}let g;if(a)g=a;else{if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{g=(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getLatestBlockhash(),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-blockhash"}))).blockhash}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}}return i.recentBlockhash=g,e.extra?.feePayer?i.feePayer=new o.PublicKey(e.extra.feePayer):i.feePayer=n,i}resolveAmountInMinorUnits(r){const e=r.maxAmountRequired;if(!/^\d+$/.test(e))throw new Error("Invalid maxAmountRequired in requirement: must be a non-negative integer string");const n=BigInt(e);if(n<=0n)throw new Error("Invalid maxAmountRequired in requirement");return n}buildPaymentPayload(r){const{requirement:e,signedTx:n,payerPublicKey:a}=r;return{x402Version:0,scheme:e.scheme,network:e.network,payload:{signature:n.signature,transaction:n.serialized,payer:a.toString(),memo:e.extra?.memo,recipientTokenAccount:e.extra?.recipientTokenAccount}}}async signTransaction(r){const{transaction:e,signTransaction:n}=r;t.getLogger().debug("[WalletManager] Requesting wallet to sign transaction");const a=await n(e),i=a.serialize(),u=a.signatures[0]?.signature;if(!u)throw new Error("Signed transaction missing signature");const c=h.bs58.encode(u);return t.getLogger().debug("[WalletManager] Transaction signed with signature:",c.substring(0,20)+"..."),{serialized:t.gBase64.fromUint8Array(i),signature:c}}deserializeTransaction(r){try{const e=t.gBase64.toUint8Array(r);return o.Transaction.from(e)}catch(e){throw new Error(`Failed to deserialize transaction: ${t.formatError(e,"Unknown error")}`)}}async partiallySignTransaction(r){const{transaction:e,signTransaction:n,blockhash:a}=r;a&&e.recentBlockhash!==a&&(e.recentBlockhash=a);const i=await n(e),u=i.signatures[0]?.signature;if(u){const l=h.bs58.encode(u);t.getLogger().debug("[WalletManager] Partially signed with signature:",l.substring(0,20)+"...")}const c=i.serialize({requireAllSignatures:!1,verifySignatures:!1});return t.gBase64.fromUint8Array(c)}async getBalance(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{return await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getBalance(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-balance"}))/o.LAMPORTS_PER_SOL}catch(e){throw e instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(e)}}async verifyTransaction(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded for transaction verification");try{return!!(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getSignatureStatus(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-verify-tx"}))).value?.confirmationStatus}catch(e){return e instanceof t.CircuitBreakerOpenError&&t.getLogger().warn("[WalletManager] Circuit breaker OPEN - cannot verify transaction"),!1}}}exports.WalletManager=p;
@@ -1,23 +1,2 @@
1
- /**
2
- * @cedros/pay-react/crypto-only
3
- *
4
- * Full entry point including Solana crypto payment components and hooks.
5
- * Use this when you need CryptoButton, useX402Payment, or other Solana features.
6
- *
7
- * Requires @solana/* peer dependencies to be installed.
8
- *
9
- * @example
10
- * ```typescript
11
- * import { CedrosProvider, CryptoButton, useX402Payment } from '@cedros/pay-react/crypto-only';
12
- * ```
13
- */
14
- export * from './index';
15
- export { CryptoButton } from './components/CryptoButton';
16
- export { CryptoSubscribeButton } from './components/CryptoSubscribeButton';
17
- export { useX402Payment } from './hooks/useX402Payment';
18
- export { useCryptoSubscription } from './hooks/useCryptoSubscription';
19
- export { useRefundVerification } from './hooks/useRefundVerification';
20
- export type { IWalletManager } from './managers/WalletManager';
21
- export { createWalletPool, WalletPool } from './utils/walletPool';
22
- export { validateTokenMint, KNOWN_STABLECOINS } from './utils/tokenMintValidator';
23
- //# sourceMappingURL=crypto-only.d.ts.map
1
+ export * from './src/crypto-only'
2
+ export {}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2N_CMVAv.js"),t=require("./CedrosContext-C26DlvLF.js"),ie=require("./CryptoButton-B4-oJ8lF.js"),C=require("react/jsx-runtime"),a=require("react"),Q=require("@solana/wallet-adapter-react"),se=require("@solana/wallet-adapter-base"),we=require("@solana/wallet-adapter-react-ui"),ce=require("./walletPool-DjA7J3a9.js");function le(){const{subscriptionManager:o,x402Manager:d,walletManager:f}=t.useCedrosContext(),{publicKey:u,signTransaction:T}=Q.useWallet(),[P,y]=a.useState({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),[k,R]=a.useState(null),x=a.useRef(!1),E=a.useCallback(()=>{if(!u){const c="Wallet not connected";return y(n=>({...n,status:"error",error:c})),{valid:!1,error:c}}if(!T){const c="Wallet does not support signing";return y(n=>({...n,status:"error",error:c})),{valid:!1,error:c}}return{valid:!0}},[u,T]),B=a.useCallback(async c=>{if(!u)return y(n=>({...n,status:"error",error:"Wallet not connected"})),null;y(n=>({...n,status:"checking",error:null}));try{const n=await o.checkSubscriptionStatus({resource:c,userId:u.toString()});return y(s=>({...s,status:n.active?"success":"idle",subscriptionStatus:n.status,expiresAt:n.expiresAt||n.currentPeriodEnd||null})),n}catch(n){const s=t.formatError(n,"Failed to check subscription status");return y(g=>({...g,status:"error",error:s})),null}},[u,o]),I=a.useCallback(async(c,n,s)=>{y(g=>({...g,status:"loading",error:null}));try{const g=await o.requestSubscriptionQuote(c,n,s);return R(g),y(i=>({...i,status:"idle"})),g}catch(g){const i=t.formatError(g,"Failed to get subscription quote");return y(l=>({...l,status:"error",error:i})),null}},[o]),S=a.useCallback(async(c,n,s)=>{if(x.current)return{success:!1,error:"Payment already in progress"};const g=E();if(!g.valid)return{success:!1,error:g.error};x.current=!0,y(i=>({...i,status:"loading",error:null}));try{const i=await o.requestSubscriptionQuote(c,n,s);R(i);const l=i.requirement;if(!d.validateRequirement(l))throw new Error("Invalid subscription quote received from server");const w=!!l.extra?.feePayer;let b;if(w){const{transaction:h,blockhash:_}=await d.buildGaslessTransaction({resourceId:c,userWallet:u.toString(),feePayer:l.extra.feePayer,couponCode:s?.couponCode}),M=f.deserializeTransaction(h),q=await f.partiallySignTransaction({transaction:M,signTransaction:T,blockhash:_});b=await d.submitGaslessTransaction({resource:c,partialTx:q,couponCode:s?.couponCode,resourceType:"regular",requirement:l})}else{const h=await f.buildTransaction({requirement:l,payerPublicKey:u}),_=await f.signTransaction({transaction:h,signTransaction:T}),M=f.buildPaymentPayload({requirement:l,signedTx:_,payerPublicKey:u});b=await d.submitPayment({resource:c,payload:M,couponCode:s?.couponCode,resourceType:"regular"})}if(b.success){const h=await o.checkSubscriptionStatus({resource:c,userId:u.toString()});y({status:"success",error:null,sessionId:b.transactionId||null,subscriptionStatus:h.status,expiresAt:h.expiresAt||h.currentPeriodEnd||null})}else y(h=>({...h,status:"error",error:b.error||"Subscription payment failed"}));return b}catch(i){const l=t.formatError(i,"Subscription payment failed");return y(w=>({...w,status:"error",error:l})),{success:!1,error:l}}finally{x.current=!1}},[E,o,d,f,u,T]),L=a.useCallback(()=>{y({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),R(null)},[]);return{...P,quote:k,checkStatus:B,requestQuote:I,processPayment:S,reset:L}}function Pe({resource:o,interval:d,intervalDays:f,couponCode:u,label:T,disabled:P=!1,onAttempt:y,onSuccess:k,onError:R,className:x="",testPageUrl:E,hideMessages:B=!1,autoCheckStatus:I=!0}){const{connected:S,connecting:L,connect:c,disconnect:n,select:s,wallets:g,wallet:i,publicKey:l}=Q.useWallet(),{status:w,error:b,subscriptionStatus:h,expiresAt:_,checkStatus:M,processPayment:q}=le(),p=t.useCedrosTheme(),{solanaError:W}=t.useCedrosContext(),{t:v,translations:F}=e.useTranslation(),ue=T||v("ui.subscribe_with_crypto"),U=a.useRef(k),G=a.useRef(R),V=a.useRef(q),Y=a.useRef(M);U.current=k,G.current=R,V.current=q,Y.current=M;const de=b&&typeof b!="string"?b?.code??null:null,ge=W&&typeof W!="string"?W?.code??null:null,X=r=>{if(!r||!F)return"";const m=F.errors[r];return m?m.action?`${m.message} ${m.action}`:m.message:""},H=b?typeof b=="string"?b:X(de):null,J=W?typeof W=="string"?W:X(ge):null,pe=a.useMemo(()=>g.map(r=>`${r.adapter.name}-${r.readyState}`).join(","),[g]),z=a.useMemo(()=>g.filter(({readyState:r})=>r===se.WalletReadyState.Installed||r===se.WalletReadyState.Loadable),[pe]);a.useEffect(()=>{I&&S&&l&&(t.getLogger().debug("[CryptoSubscribeButton] Auto-checking subscription status"),Y.current(o))},[I,S,l,o]),a.useEffect(()=>{w==="success"&&h==="active"&&(e.emitPaymentSuccess("crypto","subscription-active",o),U.current?.("subscription-active"))},[w,h,o]),a.useEffect(()=>{w==="error"&&b&&(e.emitPaymentError("crypto",b,o),G.current?.(b))},[w,b,o]);const Z=typeof window<"u"&&window.top!==window.self,[ee,A]=a.useState(!1),[te,K]=a.useState(!1),[re,j]=a.useState(!1),O=W;a.useEffect(()=>{let r=!1;return r||(async()=>{if(te&&i&&!S&&!L){t.getLogger().debug("[CryptoSubscribeButton] Wallet detected, attempting auto-connect:",i.adapter.name),K(!1),e.emitWalletConnect(i.adapter.name);try{await c(),r||t.getLogger().debug("[CryptoSubscribeButton] Auto-connect successful")}catch($){if(!r){t.getLogger().error("[CryptoSubscribeButton] Auto-connect failed:",$);const Se=$ instanceof Error?$.message:"Failed to connect wallet";e.emitWalletError(Se,i.adapter.name),j(!1)}}}})(),()=>{r=!0}},[i,te,S,L,c]),a.useEffect(()=>{S&&re&&l&&i&&(e.emitWalletConnected(i.adapter.name,l.toString()),t.getLogger().debug("[CryptoSubscribeButton] Processing pending subscription payment"),j(!1),A(!1),e.emitPaymentProcessing("crypto",o),V.current(o,d,{couponCode:u,intervalDays:f}))},[S,re,l,i,o,d,u,f]);const ne=a.useCallback(async()=>{if(t.getLogger().debug("[CryptoSubscribeButton] executeSubscriptionFlow called",{connected:S,wallet:i?.adapter.name,resource:o,interval:d}),e.emitPaymentStart("crypto",o),y&&y("crypto"),O){t.getLogger().error("[CryptoSubscribeButton] Solana dependencies missing:",O),e.emitPaymentError("crypto",O,o),R&&R(O);return}if(Z){const r=E||window.location.href;try{if(new URL(r,window.location.origin).origin!==window.location.origin)throw t.getLogger().error("[CryptoSubscribeButton] Blocked attempt to open external URL:",r),new Error("Cannot open external URLs from embedded context");window.open(r,"_blank","noopener,noreferrer")}catch(m){throw t.getLogger().error("[CryptoSubscribeButton] URL validation failed:",m),m}return}if(S)e.emitPaymentProcessing("crypto",o),await q(o,d,{couponCode:u,intervalDays:f});else{j(!0);try{if(i)t.getLogger().debug("[CryptoSubscribeButton] Wallet already selected, connecting:",i.adapter.name),e.emitWalletConnect(i.adapter.name),await c();else{if(t.getLogger().debug("[CryptoSubscribeButton] No wallet selected, showing selector"),z.length===0){j(!1);const r="No wallets available";throw e.emitWalletError(r),new Error(r)}A(!0)}}catch(r){j(!1);const m=r instanceof Error?r.message:"Failed to connect wallet";t.getLogger().error("[CryptoSubscribeButton] Connection error:",m),e.emitWalletError(m,i?.adapter.name)}}},[S,i,o,d,u,f,Z,E,z,c,q,O,y,R]),oe=a.useMemo(()=>`crypto-subscribe-${o}-${d}`,[o,d]),me=a.useMemo(()=>e.createDedupedClickHandler(oe,ne,{cooldownMs:200,deduplicationWindowMs:0}),[oe,ne]),ae=w==="loading"||w==="checking",N=h==="active"||h==="trialing",ye=P||ae||L||!!O||N;let D=ue;if(ae)D=v("ui.processing");else if(N&&_){const r=new Date(_).toLocaleDateString();D=`${v("ui.subscribed_until")} ${r}`}else N&&(D=v("ui.subscribed"));const fe=a.useCallback(async()=>{try{K(!1),S&&await n(),s(null),A(!0)}catch(r){t.getLogger().error("Failed to change wallet:",r)}},[S,n,s]),be=a.useCallback(r=>{t.getLogger().debug("[CryptoSubscribeButton] Wallet clicked:",r),A(!1),s(r),K(!0)},[s]),Ce=a.useCallback(async()=>{try{if(await n(),j(!1),typeof window<"u"&&window.localStorage)try{window.localStorage.removeItem("walletName")}catch(r){r instanceof Error&&r.name==="QuotaExceededError"?t.getLogger().warn("localStorage quota exceeded when removing wallet preference"):t.getLogger().error("Failed to clear wallet preference from localStorage:",r)}}catch(r){t.getLogger().error("Failed to disconnect wallet:",r)}},[n]);return C.jsxs("div",{className:p.unstyled?x:`${p.className} cedros-theme__crypto-button ${x||""}`,style:p.unstyled?{}:p.style,children:[C.jsx("button",{onClick:me,disabled:ye,className:p.unstyled?x:"cedros-theme__button cedros-theme__crypto",type:"button",children:D}),ee&&!B&&C.jsx("div",{className:"cedros-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:p.tokens.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem"},onClick:()=>A(!1),children:C.jsxs("div",{className:"cedros-modal-content",style:{backgroundColor:p.tokens.modalBackground,borderRadius:"12px",padding:"2rem",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",border:`1px solid ${p.tokens.modalBorder}`},onClick:r=>r.stopPropagation(),children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[C.jsx("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:600,color:p.tokens.surfaceText},children:v("wallet.select_wallet")}),C.jsx("button",{onClick:()=>A(!1),style:e.getModalCloseButtonStyles(p.tokens.surfaceText),"aria-label":"Close modal",type:"button",children:"×"})]}),C.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:z.map(r=>C.jsxs("button",{onClick:()=>be(r.adapter.name),style:{width:"100%",padding:"1rem",backgroundColor:p.tokens.surfaceBackground,border:`1px solid ${p.tokens.surfaceBorder}`,borderRadius:"0.5rem",cursor:"pointer",fontSize:"1rem",textAlign:"left",color:p.tokens.surfaceText,display:"flex",alignItems:"center",gap:"1rem",transition:"all 0.2s ease"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor=p.tokens.modalBackground,m.currentTarget.style.borderColor=p.tokens.surfaceText,m.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor=p.tokens.surfaceBackground,m.currentTarget.style.borderColor=p.tokens.surfaceBorder,m.currentTarget.style.transform="translateY(0)"},type:"button",children:[C.jsx(we.WalletIcon,{wallet:r,style:{width:"24px",height:"24px"}}),C.jsx("span",{style:{fontWeight:500},children:r.adapter.name})]},r.adapter.name))})]})}),S&&!B&&!ee&&C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem",fontSize:"0.75rem",color:p.tokens.surfaceText,opacity:.7},children:[C.jsx("button",{onClick:fe,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:v("wallet.change")}),C.jsx("button",{onClick:Ce,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:v("ui.disconnect")})]}),!B&&J&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__error",children:J}),!B&&H&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__error",children:H}),!B&&N&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__success",children:v("ui.subscription_active")})]})}function he(){const{x402Manager:o,walletManager:d}=t.useCedrosContext(),{publicKey:f,signTransaction:u}=Q.useWallet(),[T,P]=a.useState({status:"idle",error:null,transactionId:null}),[y,k]=a.useState(null),[R,x]=a.useState(null),E=a.useRef(!1),B=a.useCallback(async c=>{try{P(s=>({...s,status:"loading"}));const n=await o.requestQuote({resource:c});if(!o.validateRequirement(n))throw new Error("Invalid refund requirement received from server");return k(n),P(s=>({...s,status:"idle"})),n}catch(n){const s=t.formatError(n,"Failed to fetch refund requirement");throw P({status:"error",error:s,transactionId:null}),n}},[o]),I=a.useCallback(async(c,n)=>{if(E.current)throw new Error("Refund already in progress");if(!f||!u)throw new Error("Wallet not connected");E.current=!0;try{P({status:"loading",error:null,transactionId:null});const s=await o.requestQuote({resource:c,couponCode:n});if(!o.validateRequirement(s))throw new Error("Invalid refund requirement received");k(s);const g=await d.buildTransaction({requirement:s,payerPublicKey:f}),i=await d.signTransaction({transaction:g,signTransaction:u}),l=d.buildPaymentPayload({requirement:s,signedTx:i,payerPublicKey:f}),w=await o.submitPayment({resource:c,payload:l,couponCode:n,metadata:void 0,resourceType:"refund"});return w.settlement&&x(w.settlement),P({status:"success",error:null,transactionId:w.transactionId||i.signature}),w}catch(s){const g=t.formatError(s,"Refund payment failed");throw P({status:"error",error:g,transactionId:null}),s}finally{E.current=!1}},[f,u,o,d]),S=a.useCallback(async c=>{if(E.current)throw new Error("Refund already in progress");if(!f||!u)throw new Error("Wallet not connected");E.current=!0;try{P({status:"loading",error:null,transactionId:null});const n=await o.requestQuote({resource:c});if(!o.validateRequirement(n))throw new Error("Invalid refund requirement received");k(n);const{transaction:s}=await o.buildGaslessTransaction({resourceId:c,userWallet:f.toString(),feePayer:n.extra.feePayer}),g=d.deserializeTransaction(s),i=await d.partiallySignTransaction({transaction:g,signTransaction:u}),l=await o.submitGaslessTransaction({resource:c,partialTx:i,couponCode:void 0,metadata:void 0,resourceType:"refund",requirement:n});return l.settlement&&x(l.settlement),P({status:"success",error:null,transactionId:l.transactionId||"gasless-refund-tx"}),l}catch(n){const s=t.formatError(n,"Gasless refund payment failed");throw P({status:"error",error:s,transactionId:null}),n}finally{E.current=!1}},[f,u,o,d]),L=a.useCallback(()=>{P({status:"idle",error:null,transactionId:null}),k(null),x(null)},[]);return{state:T,requirement:y,settlement:R,fetchRefundQuote:B,processRefund:I,processGaslessRefund:S,reset:L}}exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CedrosPayAdminDashboard=e.CedrosPayAdminDashboard;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.cedrosPayPlugin=e.cedrosPayPlugin;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.ecommerce=e.index;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.validateSecurity=e.validateSecurity;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.ERROR_CATEGORIES=t.ERROR_CATEGORIES;exports.KNOWN_STABLECOINS=t.KNOWN_STABLECOINS;exports.LogLevel=t.LogLevel;exports.Logger=t.Logger;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createLogger=t.createLogger;exports.createRateLimiter=t.createRateLimiter;exports.getLogger=t.getLogger;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.useCedrosTheme=t.useCedrosTheme;exports.validateConfig=t.validateConfig;exports.validateTokenMint=t.validateTokenMint;exports.CryptoButton=ie.CryptoButton;exports.useX402Payment=ie.useX402Payment;exports.WalletPool=ce.WalletPool;exports.createWalletPool=ce.createWalletPool;exports.CryptoSubscribeButton=Pe;exports.useCryptoSubscription=le;exports.useRefundVerification=he;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./styles-BWrLnaUW.js"),t=require("./CedrosContext-D-lnoEkR.js"),Q=require("./index-B5ck27xb.js"),ce=require("./CryptoButton-Dy-g3bR0.js"),C=require("react/jsx-runtime"),a=require("react"),F=require("@solana/wallet-adapter-react"),ie=require("@solana/wallet-adapter-base"),Pe=require("@solana/wallet-adapter-react-ui"),le=require("./walletPool-BqNfOhB0.js");function ue(){const{subscriptionManager:o,x402Manager:d,walletManager:f}=t.useCedrosContext(),{publicKey:u,signTransaction:T}=F.useWallet(),[P,y]=a.useState({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),[k,R]=a.useState(null),x=a.useRef(!1),E=a.useCallback(()=>{if(!u){const c="Wallet not connected";return y(n=>({...n,status:"error",error:c})),{valid:!1,error:c}}if(!T){const c="Wallet does not support signing";return y(n=>({...n,status:"error",error:c})),{valid:!1,error:c}}return{valid:!0}},[u,T]),B=a.useCallback(async c=>{if(!u)return y(n=>({...n,status:"error",error:"Wallet not connected"})),null;y(n=>({...n,status:"checking",error:null}));try{const n=await o.checkSubscriptionStatus({resource:c,userId:u.toString()});return y(s=>({...s,status:n.active?"success":"idle",subscriptionStatus:n.status,expiresAt:n.expiresAt||n.currentPeriodEnd||null})),n}catch(n){const s=t.formatError(n,"Failed to check subscription status");return y(g=>({...g,status:"error",error:s})),null}},[u,o]),I=a.useCallback(async(c,n,s)=>{y(g=>({...g,status:"loading",error:null}));try{const g=await o.requestSubscriptionQuote(c,n,s);return R(g),y(i=>({...i,status:"idle"})),g}catch(g){const i=t.formatError(g,"Failed to get subscription quote");return y(l=>({...l,status:"error",error:i})),null}},[o]),S=a.useCallback(async(c,n,s)=>{if(x.current)return{success:!1,error:"Payment already in progress"};const g=E();if(!g.valid)return{success:!1,error:g.error};x.current=!0,y(i=>({...i,status:"loading",error:null}));try{const i=await o.requestSubscriptionQuote(c,n,s);R(i);const l=i.requirement;if(!d.validateRequirement(l))throw new Error("Invalid subscription quote received from server");const w=!!l.extra?.feePayer;let b;if(w){const{transaction:h,blockhash:_}=await d.buildGaslessTransaction({resourceId:c,userWallet:u.toString(),feePayer:l.extra.feePayer,couponCode:s?.couponCode}),M=f.deserializeTransaction(h),q=await f.partiallySignTransaction({transaction:M,signTransaction:T,blockhash:_});b=await d.submitGaslessTransaction({resource:c,partialTx:q,couponCode:s?.couponCode,resourceType:"regular",requirement:l})}else{const h=await f.buildTransaction({requirement:l,payerPublicKey:u}),_=await f.signTransaction({transaction:h,signTransaction:T}),M=f.buildPaymentPayload({requirement:l,signedTx:_,payerPublicKey:u});b=await d.submitPayment({resource:c,payload:M,couponCode:s?.couponCode,resourceType:"regular"})}if(b.success){const h=await o.checkSubscriptionStatus({resource:c,userId:u.toString()});y({status:"success",error:null,sessionId:b.transactionId||null,subscriptionStatus:h.status,expiresAt:h.expiresAt||h.currentPeriodEnd||null})}else y(h=>({...h,status:"error",error:b.error||"Subscription payment failed"}));return b}catch(i){const l=t.formatError(i,"Subscription payment failed");return y(w=>({...w,status:"error",error:l})),{success:!1,error:l}}finally{x.current=!1}},[E,o,d,f,u,T]),L=a.useCallback(()=>{y({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),R(null)},[]);return{...P,quote:k,checkStatus:B,requestQuote:I,processPayment:S,reset:L}}function he({resource:o,interval:d,intervalDays:f,couponCode:u,label:T,disabled:P=!1,onAttempt:y,onSuccess:k,onError:R,className:x="",testPageUrl:E,hideMessages:B=!1,autoCheckStatus:I=!0}){const{connected:S,connecting:L,connect:c,disconnect:n,select:s,wallets:g,wallet:i,publicKey:l}=F.useWallet(),{status:w,error:b,subscriptionStatus:h,expiresAt:_,checkStatus:M,processPayment:q}=ue(),p=t.useCedrosTheme(),{solanaError:W}=t.useCedrosContext(),{t:v,translations:U}=e.useTranslation(),de=T||v("ui.subscribe_with_crypto"),G=a.useRef(k),V=a.useRef(R),Y=a.useRef(q),X=a.useRef(M);G.current=k,V.current=R,Y.current=q,X.current=M;const ge=b&&typeof b!="string"?b?.code??null:null,pe=W&&typeof W!="string"?W?.code??null:null,H=r=>{if(!r||!U)return"";const m=U.errors[r];return m?m.action?`${m.message} ${m.action}`:m.message:""},J=b?typeof b=="string"?b:H(ge):null,Z=W?typeof W=="string"?W:H(pe):null,me=a.useMemo(()=>g.map(r=>`${r.adapter.name}-${r.readyState}`).join(","),[g]),z=a.useMemo(()=>g.filter(({readyState:r})=>r===ie.WalletReadyState.Installed||r===ie.WalletReadyState.Loadable),[me]);a.useEffect(()=>{I&&S&&l&&(t.getLogger().debug("[CryptoSubscribeButton] Auto-checking subscription status"),X.current(o))},[I,S,l,o]),a.useEffect(()=>{w==="success"&&h==="active"&&(e.emitPaymentSuccess("crypto","subscription-active",o),G.current?.("subscription-active"))},[w,h,o]),a.useEffect(()=>{w==="error"&&b&&(e.emitPaymentError("crypto",b,o),V.current?.(b))},[w,b,o]);const ee=typeof window<"u"&&window.top!==window.self,[te,A]=a.useState(!1),[re,K]=a.useState(!1),[ne,j]=a.useState(!1),O=W;a.useEffect(()=>{let r=!1;return r||(async()=>{if(re&&i&&!S&&!L){t.getLogger().debug("[CryptoSubscribeButton] Wallet detected, attempting auto-connect:",i.adapter.name),K(!1),e.emitWalletConnect(i.adapter.name);try{await c(),r||t.getLogger().debug("[CryptoSubscribeButton] Auto-connect successful")}catch($){if(!r){t.getLogger().error("[CryptoSubscribeButton] Auto-connect failed:",$);const we=$ instanceof Error?$.message:"Failed to connect wallet";e.emitWalletError(we,i.adapter.name),j(!1)}}}})(),()=>{r=!0}},[i,re,S,L,c]),a.useEffect(()=>{S&&ne&&l&&i&&(e.emitWalletConnected(i.adapter.name,l.toString()),t.getLogger().debug("[CryptoSubscribeButton] Processing pending subscription payment"),j(!1),A(!1),e.emitPaymentProcessing("crypto",o),Y.current(o,d,{couponCode:u,intervalDays:f}))},[S,ne,l,i,o,d,u,f]);const oe=a.useCallback(async()=>{if(t.getLogger().debug("[CryptoSubscribeButton] executeSubscriptionFlow called",{connected:S,wallet:i?.adapter.name,resource:o,interval:d}),e.emitPaymentStart("crypto",o),y&&y("crypto"),O){t.getLogger().error("[CryptoSubscribeButton] Solana dependencies missing:",O),e.emitPaymentError("crypto",O,o),R&&R(O);return}if(ee){const r=E||window.location.href;try{if(new URL(r,window.location.origin).origin!==window.location.origin)throw t.getLogger().error("[CryptoSubscribeButton] Blocked attempt to open external URL:",r),new Error("Cannot open external URLs from embedded context");window.open(r,"_blank","noopener,noreferrer")}catch(m){throw t.getLogger().error("[CryptoSubscribeButton] URL validation failed:",m),m}return}if(S)e.emitPaymentProcessing("crypto",o),await q(o,d,{couponCode:u,intervalDays:f});else{j(!0);try{if(i)t.getLogger().debug("[CryptoSubscribeButton] Wallet already selected, connecting:",i.adapter.name),e.emitWalletConnect(i.adapter.name),await c();else{if(t.getLogger().debug("[CryptoSubscribeButton] No wallet selected, showing selector"),z.length===0){j(!1);const r="No wallets available";throw e.emitWalletError(r),new Error(r)}A(!0)}}catch(r){j(!1);const m=r instanceof Error?r.message:"Failed to connect wallet";t.getLogger().error("[CryptoSubscribeButton] Connection error:",m),e.emitWalletError(m,i?.adapter.name)}}},[S,i,o,d,u,f,ee,E,z,c,q,O,y,R]),ae=a.useMemo(()=>`crypto-subscribe-${o}-${d}`,[o,d]),ye=a.useMemo(()=>e.createDedupedClickHandler(ae,oe,{cooldownMs:200,deduplicationWindowMs:0}),[ae,oe]),se=w==="loading"||w==="checking",N=h==="active"||h==="trialing",fe=P||se||L||!!O||N;let D=de;if(se)D=v("ui.processing");else if(N&&_){const r=new Date(_).toLocaleDateString();D=`${v("ui.subscribed_until")} ${r}`}else N&&(D=v("ui.subscribed"));const be=a.useCallback(async()=>{try{K(!1),S&&await n(),s(null),A(!0)}catch(r){t.getLogger().error("Failed to change wallet:",r)}},[S,n,s]),Ce=a.useCallback(r=>{t.getLogger().debug("[CryptoSubscribeButton] Wallet clicked:",r),A(!1),s(r),K(!0)},[s]),Se=a.useCallback(async()=>{try{if(await n(),j(!1),typeof window<"u"&&window.localStorage)try{window.localStorage.removeItem("walletName")}catch(r){r instanceof Error&&r.name==="QuotaExceededError"?t.getLogger().warn("localStorage quota exceeded when removing wallet preference"):t.getLogger().error("Failed to clear wallet preference from localStorage:",r)}}catch(r){t.getLogger().error("Failed to disconnect wallet:",r)}},[n]);return C.jsxs("div",{className:p.unstyled?x:`${p.className} cedros-theme__crypto-button ${x||""}`,style:p.unstyled?{}:p.style,children:[C.jsx("button",{onClick:ye,disabled:fe,className:p.unstyled?x:"cedros-theme__button cedros-theme__crypto",type:"button",children:D}),te&&!B&&C.jsx("div",{className:"cedros-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:p.tokens.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem"},onClick:()=>A(!1),children:C.jsxs("div",{className:"cedros-modal-content",style:{backgroundColor:p.tokens.modalBackground,borderRadius:"12px",padding:"2rem",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",border:`1px solid ${p.tokens.modalBorder}`},onClick:r=>r.stopPropagation(),children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[C.jsx("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:600,color:p.tokens.surfaceText},children:v("wallet.select_wallet")}),C.jsx("button",{onClick:()=>A(!1),style:e.getModalCloseButtonStyles(p.tokens.surfaceText),"aria-label":"Close modal",type:"button",children:"×"})]}),C.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:z.map(r=>C.jsxs("button",{onClick:()=>Ce(r.adapter.name),style:{width:"100%",padding:"1rem",backgroundColor:p.tokens.surfaceBackground,border:`1px solid ${p.tokens.surfaceBorder}`,borderRadius:"0.5rem",cursor:"pointer",fontSize:"1rem",textAlign:"left",color:p.tokens.surfaceText,display:"flex",alignItems:"center",gap:"1rem",transition:"all 0.2s ease"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor=p.tokens.modalBackground,m.currentTarget.style.borderColor=p.tokens.surfaceText,m.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor=p.tokens.surfaceBackground,m.currentTarget.style.borderColor=p.tokens.surfaceBorder,m.currentTarget.style.transform="translateY(0)"},type:"button",children:[C.jsx(Pe.WalletIcon,{wallet:r,style:{width:"24px",height:"24px"}}),C.jsx("span",{style:{fontWeight:500},children:r.adapter.name})]},r.adapter.name))})]})}),S&&!B&&!te&&C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem",fontSize:"0.75rem",color:p.tokens.surfaceText,opacity:.7},children:[C.jsx("button",{onClick:be,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:v("wallet.change")}),C.jsx("button",{onClick:Se,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:v("ui.disconnect")})]}),!B&&Z&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__error",children:Z}),!B&&J&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__error",children:J}),!B&&N&&C.jsx("div",{className:p.unstyled?"":"cedros-theme__success",children:v("ui.subscription_active")})]})}function Ee(){const{x402Manager:o,walletManager:d}=t.useCedrosContext(),{publicKey:f,signTransaction:u}=F.useWallet(),[T,P]=a.useState({status:"idle",error:null,transactionId:null}),[y,k]=a.useState(null),[R,x]=a.useState(null),E=a.useRef(!1),B=a.useCallback(async c=>{try{P(s=>({...s,status:"loading"}));const n=await o.requestQuote({resource:c});if(!o.validateRequirement(n))throw new Error("Invalid refund requirement received from server");return k(n),P(s=>({...s,status:"idle"})),n}catch(n){const s=t.formatError(n,"Failed to fetch refund requirement");throw P({status:"error",error:s,transactionId:null}),n}},[o]),I=a.useCallback(async(c,n)=>{if(E.current)throw new Error("Refund already in progress");if(!f||!u)throw new Error("Wallet not connected");E.current=!0;try{P({status:"loading",error:null,transactionId:null});const s=await o.requestQuote({resource:c,couponCode:n});if(!o.validateRequirement(s))throw new Error("Invalid refund requirement received");k(s);const g=await d.buildTransaction({requirement:s,payerPublicKey:f}),i=await d.signTransaction({transaction:g,signTransaction:u}),l=d.buildPaymentPayload({requirement:s,signedTx:i,payerPublicKey:f}),w=await o.submitPayment({resource:c,payload:l,couponCode:n,metadata:void 0,resourceType:"refund"});return w.settlement&&x(w.settlement),P({status:"success",error:null,transactionId:w.transactionId||i.signature}),w}catch(s){const g=t.formatError(s,"Refund payment failed");throw P({status:"error",error:g,transactionId:null}),s}finally{E.current=!1}},[f,u,o,d]),S=a.useCallback(async c=>{if(E.current)throw new Error("Refund already in progress");if(!f||!u)throw new Error("Wallet not connected");E.current=!0;try{P({status:"loading",error:null,transactionId:null});const n=await o.requestQuote({resource:c});if(!o.validateRequirement(n))throw new Error("Invalid refund requirement received");k(n);const{transaction:s}=await o.buildGaslessTransaction({resourceId:c,userWallet:f.toString(),feePayer:n.extra.feePayer}),g=d.deserializeTransaction(s),i=await d.partiallySignTransaction({transaction:g,signTransaction:u}),l=await o.submitGaslessTransaction({resource:c,partialTx:i,couponCode:void 0,metadata:void 0,resourceType:"refund",requirement:n});return l.settlement&&x(l.settlement),P({status:"success",error:null,transactionId:l.transactionId||"gasless-refund-tx"}),l}catch(n){const s=t.formatError(n,"Gasless refund payment failed");throw P({status:"error",error:s,transactionId:null}),n}finally{E.current=!1}},[f,u,o,d]),L=a.useCallback(()=>{P({status:"idle",error:null,transactionId:null}),k(null),x(null)},[]);return{state:T,requirement:y,settlement:R,fetchRefundQuote:B,processRefund:I,processGaslessRefund:S,reset:L}}exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.validateSecurity=e.validateSecurity;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.ERROR_CATEGORIES=t.ERROR_CATEGORIES;exports.KNOWN_STABLECOINS=t.KNOWN_STABLECOINS;exports.LogLevel=t.LogLevel;exports.Logger=t.Logger;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createLogger=t.createLogger;exports.createRateLimiter=t.createRateLimiter;exports.getLogger=t.getLogger;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.useCedrosTheme=t.useCedrosTheme;exports.validateConfig=t.validateConfig;exports.validateTokenMint=t.validateTokenMint;exports.CedrosPayAdminDashboard=Q.CedrosPayAdminDashboard;exports.cedrosPayPlugin=Q.cedrosPayPlugin;exports.ecommerce=Q.index;exports.CryptoButton=ce.CryptoButton;exports.useX402Payment=ce.useX402Payment;exports.WalletPool=le.WalletPool;exports.createWalletPool=le.createWalletPool;exports.CryptoSubscribeButton=he;exports.useCryptoSubscription=ue;exports.useRefundVerification=Ee;
@@ -1,14 +1,15 @@
1
- import { T as Te, E as ve, F as fe, A as Be, D as me, y as Ie, z as ye, B as Y, a5 as We, a6 as qe } from "./index-C1hbnxn0.mjs";
2
- import { x as Ue, w as Ve, C as Ye, a as He, b as Je, h as Xe, f as Ze, d as et, e as tt, P as rt, R as nt, K as at, S as st, g as ot, i as it, q as ct, c as lt, O as ut, L as dt, V as pt, v as ft, o as mt, r as yt, t as gt, N as bt, Q as wt, H as St, G as ht, M as Ct, J as xt, p as Pt, s as Et, j as Rt, m as kt, U as Tt, k as vt, u as Bt, l as It, n as Wt, I as qt } from "./index-C1hbnxn0.mjs";
3
- import { u as H, m as K, a as _e, i as y } from "./CedrosContext-BnJ2Cf7R.mjs";
4
- import { f as Mt, C as Lt, e as At, d as Nt, E as Dt, K as zt, L as Kt, h as Ot, R as Qt, g as $t, b as Ft, j as Gt, c as jt, r as Ut, v as Vt, n as Yt } from "./CedrosContext-BnJ2Cf7R.mjs";
5
- import { C as Jt, u as Xt } from "./CryptoButton-Dhxnk9d7.mjs";
1
+ import { O as Te, B as ve, D as fe, y as Be, A as me, w as Ie, x as ye, z as Y, V as We, W as qe } from "./styles--eKKnfdj.mjs";
2
+ import { v as Ue, t as Ve, C as Ye, a as He, f as Je, d as Xe, b as Ze, c as et, P as tt, R as rt, I as nt, S as at, e as st, g as ot, n as it, M as ct, J as lt, r as ut, m as dt, o as pt, q as ft, L as mt, N as yt, F as gt, E as bt, K as wt, H as St, p as ht, s as Ct, h as xt, k as Pt, Q as Et, i as Rt, u as kt, j as Tt, l as vt, G as Bt } from "./styles--eKKnfdj.mjs";
3
+ import { u as H, m as K, a as _e, i as y } from "./CedrosContext-BE6P5PQ0.mjs";
4
+ import { f as Wt, C as qt, e as _t, d as Mt, E as Lt, K as At, L as Nt, h as Dt, R as zt, g as Kt, b as Ot, j as Qt, c as $t, r as Ft, v as Gt, n as jt } from "./CedrosContext-BE6P5PQ0.mjs";
5
+ import { C as Vt, c as Yt, i as Ht } from "./index-75RhiLDq.mjs";
6
+ import { C as Xt, u as Zt } from "./CryptoButton-CksMkZjL.mjs";
6
7
  import { jsxs as O, jsx as x } from "react/jsx-runtime";
7
8
  import { useState as B, useRef as z, useCallback as h, useMemo as G, useEffect as Q } from "react";
8
9
  import { useWallet as J } from "@solana/wallet-adapter-react";
9
10
  import { WalletReadyState as ge } from "@solana/wallet-adapter-base";
10
11
  import { WalletIcon as Me } from "@solana/wallet-adapter-react-ui";
11
- import { WalletPool as er, createWalletPool as tr } from "./walletPool-BV_z1lEA.mjs";
12
+ import { WalletPool as tr, createWalletPool as rr } from "./walletPool-DShNjCQ6.mjs";
12
13
  function Le() {
13
14
  const { subscriptionManager: r, x402Manager: c, walletManager: f } = H(), { publicKey: i, signTransaction: R } = J(), [w, p] = B({
14
15
  status: "idle",
@@ -703,42 +704,42 @@ function Fe() {
703
704
  }
704
705
  export {
705
706
  Ue as CEDROS_EVENTS,
706
- Mt as CIRCUIT_BREAKER_PRESETS,
707
+ Wt as CIRCUIT_BREAKER_PRESETS,
707
708
  Ve as CSP_PRESETS,
708
709
  Ye as CedrosPay,
709
- He as CedrosPayAdminDashboard,
710
- Lt as CedrosProvider,
711
- At as CircuitBreakerOpenError,
712
- Nt as CircuitState,
713
- Je as CreditsButton,
714
- Xe as CreditsSubscribeButton,
715
- Jt as CryptoButton,
710
+ Vt as CedrosPayAdminDashboard,
711
+ qt as CedrosProvider,
712
+ _t as CircuitBreakerOpenError,
713
+ Mt as CircuitState,
714
+ He as CreditsButton,
715
+ Je as CreditsSubscribeButton,
716
+ Xt as CryptoButton,
716
717
  $e as CryptoSubscribeButton,
717
- Dt as ERROR_CATEGORIES,
718
- zt as KNOWN_STABLECOINS,
719
- Kt as LogLevel,
720
- Ot as Logger,
721
- Ze as PaymentMethodBadge,
722
- et as PaymentModal,
723
- tt as ProductPrice,
724
- rt as PurchaseButton,
725
- Qt as RATE_LIMITER_PRESETS,
726
- $t as RETRY_PRESETS,
727
- nt as RPC_PROVIDERS,
728
- at as SECURITY_RECOMMENDATIONS,
729
- st as StripeButton,
730
- ot as SubscribeButton,
731
- it as SubscriptionManagementPanel,
732
- er as WalletPool,
733
- ct as calculateDiscountPercentage,
734
- lt as cedrosPayPlugin,
735
- Ft as createCircuitBreaker,
736
- Gt as createLogger,
737
- jt as createRateLimiter,
738
- ut as createTranslator,
739
- tr as createWalletPool,
740
- dt as detectLocale,
741
- pt as ecommerce,
718
+ Lt as ERROR_CATEGORIES,
719
+ At as KNOWN_STABLECOINS,
720
+ Nt as LogLevel,
721
+ Dt as Logger,
722
+ Xe as PaymentMethodBadge,
723
+ Ze as PaymentModal,
724
+ et as ProductPrice,
725
+ tt as PurchaseButton,
726
+ zt as RATE_LIMITER_PRESETS,
727
+ Kt as RETRY_PRESETS,
728
+ rt as RPC_PROVIDERS,
729
+ nt as SECURITY_RECOMMENDATIONS,
730
+ at as StripeButton,
731
+ st as SubscribeButton,
732
+ ot as SubscriptionManagementPanel,
733
+ tr as WalletPool,
734
+ it as calculateDiscountPercentage,
735
+ Yt as cedrosPayPlugin,
736
+ Ot as createCircuitBreaker,
737
+ Qt as createLogger,
738
+ $t as createRateLimiter,
739
+ ct as createTranslator,
740
+ rr as createWalletPool,
741
+ lt as detectLocale,
742
+ Ht as ecommerce,
742
743
  fe as emitPaymentError,
743
744
  me as emitPaymentProcessing,
744
745
  Ie as emitPaymentStart,
@@ -746,34 +747,34 @@ export {
746
747
  ye as emitWalletConnect,
747
748
  Be as emitWalletConnected,
748
749
  Y as emitWalletError,
749
- ft as formatCSP,
750
- mt as formatCouponCodes,
751
- yt as generateCSP,
752
- gt as generateCSPDirectives,
753
- bt as getAvailableLocales,
754
- wt as getLocalizedError,
750
+ ut as formatCSP,
751
+ dt as formatCouponCodes,
752
+ pt as generateCSP,
753
+ ft as generateCSPDirectives,
754
+ mt as getAvailableLocales,
755
+ yt as getLocalizedError,
755
756
  y as getLogger,
756
- St as getUserErrorMessage,
757
- ht as isRetryableError,
758
- Ct as loadLocale,
759
- xt as logSecurityReport,
760
- Pt as parseCouponCodes,
761
- Ut as retryWithBackoff,
762
- Et as stackCheckoutCoupons,
757
+ gt as getUserErrorMessage,
758
+ bt as isRetryableError,
759
+ wt as loadLocale,
760
+ St as logSecurityReport,
761
+ ht as parseCouponCodes,
762
+ Ft as retryWithBackoff,
763
+ Ct as stackCheckoutCoupons,
763
764
  H as useCedrosContext,
764
765
  _e as useCedrosTheme,
765
- Rt as useCreditsPayment,
766
- kt as useCreditsSubscription,
766
+ xt as useCreditsPayment,
767
+ Pt as useCreditsSubscription,
767
768
  Le as useCryptoSubscription,
768
- Tt as useLocalizedError,
769
- vt as usePaymentMode,
769
+ Et as useLocalizedError,
770
+ Rt as usePaymentMode,
770
771
  Fe as useRefundVerification,
771
- Bt as useStripeCheckout,
772
- It as useSubscription,
773
- Wt as useSubscriptionManagement,
772
+ kt as useStripeCheckout,
773
+ Tt as useSubscription,
774
+ vt as useSubscriptionManagement,
774
775
  Te as useTranslation,
775
- Xt as useX402Payment,
776
- Vt as validateConfig,
777
- qt as validateSecurity,
778
- Yt as validateTokenMint
776
+ Zt as useX402Payment,
777
+ Gt as validateConfig,
778
+ Bt as validateSecurity,
779
+ jt as validateTokenMint
779
780
  };