@burdenoff/microfe-billing 2026.510.114

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 (636) hide show
  1. package/README.md +12 -0
  2. package/dist/billing/BillingAdminRoutes.d.ts +6 -0
  3. package/dist/billing/BillingAdminRoutes.d.ts.map +1 -0
  4. package/dist/billing/BillingAdminRoutes.js +359 -0
  5. package/dist/billing/BillingAdminRoutes.js.map +1 -0
  6. package/dist/billing/BillingRoot.d.ts +37 -0
  7. package/dist/billing/BillingRoot.d.ts.map +1 -0
  8. package/dist/billing/BillingRoot.js +190 -0
  9. package/dist/billing/BillingRoot.js.map +1 -0
  10. package/dist/billing/BillingUserRoutes.d.ts +7 -0
  11. package/dist/billing/BillingUserRoutes.d.ts.map +1 -0
  12. package/dist/billing/BillingUserRoutes.js +479 -0
  13. package/dist/billing/BillingUserRoutes.js.map +1 -0
  14. package/dist/billing/constants/permissions.d.ts +18 -0
  15. package/dist/billing/constants/permissions.d.ts.map +1 -0
  16. package/dist/billing/hooks/useBillingAccountSelection.d.ts +36 -0
  17. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +1 -0
  18. package/dist/billing/hooks/useBillingAccountSelection.js +81 -0
  19. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -0
  20. package/dist/billing/hooks/useBillingEventEmitter.d.ts +8 -0
  21. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +1 -0
  22. package/dist/billing/hooks/useBillingEventEmitter.js +15 -0
  23. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -0
  24. package/dist/billing/hooks/useBillingNavigate.d.ts +30 -0
  25. package/dist/billing/hooks/useBillingNavigate.d.ts.map +1 -0
  26. package/dist/billing/hooks/useBillingNavigate.js +23 -0
  27. package/dist/billing/hooks/useBillingNavigate.js.map +1 -0
  28. package/dist/billing/hooks/useBillingPermissions.d.ts +94 -0
  29. package/dist/billing/hooks/useBillingPermissions.d.ts.map +1 -0
  30. package/dist/billing/hooks/useBillingPermissions.js +78 -0
  31. package/dist/billing/hooks/useBillingPermissions.js.map +1 -0
  32. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +14 -0
  33. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +1 -0
  34. package/dist/billing/hooks/useDefaultBillingCurrency.js +23 -0
  35. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -0
  36. package/dist/billing/index.d.ts +31 -0
  37. package/dist/billing/index.d.ts.map +1 -0
  38. package/dist/billing/lib/native-purchases.d.ts +51 -0
  39. package/dist/billing/lib/native-purchases.d.ts.map +1 -0
  40. package/dist/billing/lib/native-purchases.js +44 -0
  41. package/dist/billing/lib/native-purchases.js.map +1 -0
  42. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +4 -0
  43. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +1 -0
  44. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +179 -0
  45. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -0
  46. package/dist/billing/modules/addons/components/index.d.ts +5 -0
  47. package/dist/billing/modules/addons/components/index.d.ts.map +1 -0
  48. package/dist/billing/modules/addons/hooks/index.d.ts +6 -0
  49. package/dist/billing/modules/addons/hooks/index.d.ts.map +1 -0
  50. package/dist/billing/modules/addons/hooks/index.js +1 -0
  51. package/dist/billing/modules/addons/hooks/useAddons.d.ts +55 -0
  52. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +1 -0
  53. package/dist/billing/modules/addons/hooks/useAddons.js +77 -0
  54. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -0
  55. package/dist/billing/modules/addons/index.d.ts +7 -0
  56. package/dist/billing/modules/addons/index.d.ts.map +1 -0
  57. package/dist/billing/modules/addons/index.js +10 -0
  58. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +4 -0
  59. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +1 -0
  60. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +266 -0
  61. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -0
  62. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +4 -0
  63. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +1 -0
  64. package/dist/billing/modules/addons/pages/AddonCreatePage.js +369 -0
  65. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -0
  66. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +4 -0
  67. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +1 -0
  68. package/dist/billing/modules/addons/pages/AddonDetailPage.js +280 -0
  69. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -0
  70. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +4 -0
  71. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +1 -0
  72. package/dist/billing/modules/addons/pages/AddonEditPage.js +396 -0
  73. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -0
  74. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +4 -0
  75. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +1 -0
  76. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +582 -0
  77. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -0
  78. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +4 -0
  79. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +1 -0
  80. package/dist/billing/modules/addons/pages/AddonsListPage.js +744 -0
  81. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -0
  82. package/dist/billing/modules/addons/pages/index.d.ts +11 -0
  83. package/dist/billing/modules/addons/pages/index.d.ts.map +1 -0
  84. package/dist/billing/modules/addons/pages/index.js +6 -0
  85. package/dist/billing/modules/addons/store/addonCartStore.d.ts +38 -0
  86. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +1 -0
  87. package/dist/billing/modules/addons/store/addonCartStore.js +74 -0
  88. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -0
  89. package/dist/billing/modules/affiliate/api.d.ts +101 -0
  90. package/dist/billing/modules/affiliate/api.d.ts.map +1 -0
  91. package/dist/billing/modules/affiliate/api.js +38 -0
  92. package/dist/billing/modules/affiliate/api.js.map +1 -0
  93. package/dist/billing/modules/affiliate/index.d.ts +2 -0
  94. package/dist/billing/modules/affiliate/index.d.ts.map +1 -0
  95. package/dist/billing/modules/affiliate/index.js +2 -0
  96. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +4 -0
  97. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +1 -0
  98. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +464 -0
  99. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -0
  100. package/dist/billing/modules/analytics/index.d.ts +5 -0
  101. package/dist/billing/modules/analytics/index.d.ts.map +1 -0
  102. package/dist/billing/modules/analytics/index.js +3 -0
  103. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +4 -0
  104. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +1 -0
  105. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +469 -0
  106. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -0
  107. package/dist/billing/modules/analytics/pages/index.d.ts +5 -0
  108. package/dist/billing/modules/analytics/pages/index.d.ts.map +1 -0
  109. package/dist/billing/modules/analytics/pages/index.js +1 -0
  110. package/dist/billing/modules/billing/hooks/index.d.ts +10 -0
  111. package/dist/billing/modules/billing/hooks/index.d.ts.map +1 -0
  112. package/dist/billing/modules/billing/hooks/index.js +4 -0
  113. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +67 -0
  114. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -0
  115. package/dist/billing/modules/billing/hooks/useInvoices.js +87 -0
  116. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -0
  117. package/dist/billing/modules/billing/hooks/usePayments.d.ts +62 -0
  118. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +1 -0
  119. package/dist/billing/modules/billing/hooks/usePayments.js +3 -0
  120. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +191 -0
  121. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +1 -0
  122. package/dist/billing/modules/billing/hooks/useRefunds.js +162 -0
  123. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -0
  124. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +41 -0
  125. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +1 -0
  126. package/dist/billing/modules/billing/hooks/useTransactions.js +55 -0
  127. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -0
  128. package/dist/billing/modules/billing/index.d.ts +7 -0
  129. package/dist/billing/modules/billing/index.d.ts.map +1 -0
  130. package/dist/billing/modules/billing/index.js +11 -0
  131. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +4 -0
  132. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +1 -0
  133. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +631 -0
  134. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -0
  135. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +4 -0
  136. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -0
  137. package/dist/billing/modules/billing/pages/InvoicesListPage.js +382 -0
  138. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -0
  139. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +4 -0
  140. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +1 -0
  141. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +147 -0
  142. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -0
  143. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +4 -0
  144. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +1 -0
  145. package/dist/billing/modules/billing/pages/RefundsPage.js +1074 -0
  146. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -0
  147. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +4 -0
  148. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +1 -0
  149. package/dist/billing/modules/billing/pages/TransactionsPage.js +587 -0
  150. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -0
  151. package/dist/billing/modules/billing/pages/index.d.ts +10 -0
  152. package/dist/billing/modules/billing/pages/index.d.ts.map +1 -0
  153. package/dist/billing/modules/billing/pages/index.js +5 -0
  154. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +14 -0
  155. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +1 -0
  156. package/dist/billing/modules/checkout/components/AutoPayToggle.js +3 -0
  157. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +14 -0
  158. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +1 -0
  159. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +151 -0
  160. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -0
  161. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +14 -0
  162. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +1 -0
  163. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.js +4 -0
  164. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +14 -0
  165. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +1 -0
  166. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +130 -0
  167. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -0
  168. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +16 -0
  169. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +1 -0
  170. package/dist/billing/modules/checkout/components/CreditsPaymentOption.js +5 -0
  171. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +19 -0
  172. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +1 -0
  173. package/dist/billing/modules/checkout/components/CurrencySelector.js +5 -0
  174. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +14 -0
  175. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +1 -0
  176. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +273 -0
  177. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -0
  178. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +22 -0
  179. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +1 -0
  180. package/dist/billing/modules/checkout/components/OrderSummary.js +293 -0
  181. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -0
  182. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +19 -0
  183. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +1 -0
  184. package/dist/billing/modules/checkout/components/PaymentProviderSelector.js +3 -0
  185. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +19 -0
  186. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +1 -0
  187. package/dist/billing/modules/checkout/components/PromoCodeInput.js +102 -0
  188. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -0
  189. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +25 -0
  190. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +1 -0
  191. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +169 -0
  192. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -0
  193. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +13 -0
  194. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +1 -0
  195. package/dist/billing/modules/checkout/components/SavedCardSelector.js +4 -0
  196. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +13 -0
  197. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +1 -0
  198. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +78 -0
  199. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -0
  200. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +16 -0
  201. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +1 -0
  202. package/dist/billing/modules/checkout/components/StripePaymentForm.js +253 -0
  203. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -0
  204. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +26 -0
  205. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +1 -0
  206. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +84 -0
  207. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -0
  208. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +23 -0
  209. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +1 -0
  210. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +229 -0
  211. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -0
  212. package/dist/billing/modules/checkout/components/index.d.ts +20 -0
  213. package/dist/billing/modules/checkout/components/index.d.ts.map +1 -0
  214. package/dist/billing/modules/checkout/components/index.js +16 -0
  215. package/dist/billing/modules/checkout/graphql/index.d.ts +6 -0
  216. package/dist/billing/modules/checkout/graphql/index.d.ts.map +1 -0
  217. package/dist/billing/modules/checkout/hooks/index.d.ts +9 -0
  218. package/dist/billing/modules/checkout/hooks/index.d.ts.map +1 -0
  219. package/dist/billing/modules/checkout/hooks/index.js +4 -0
  220. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +69 -0
  221. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +1 -0
  222. package/dist/billing/modules/checkout/hooks/useCheckout.js +377 -0
  223. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -0
  224. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +26 -0
  225. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +1 -0
  226. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +88 -0
  227. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -0
  228. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +19 -0
  229. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +1 -0
  230. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +16 -0
  231. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -0
  232. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +59 -0
  233. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +1 -0
  234. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +107 -0
  235. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -0
  236. package/dist/billing/modules/checkout/index.d.ts +24 -0
  237. package/dist/billing/modules/checkout/index.d.ts.map +1 -0
  238. package/dist/billing/modules/checkout/index.js +19 -0
  239. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +4 -0
  240. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -0
  241. package/dist/billing/modules/checkout/pages/CheckoutPage.js +1248 -0
  242. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -0
  243. package/dist/billing/modules/checkout/pages/index.d.ts +5 -0
  244. package/dist/billing/modules/checkout/pages/index.d.ts.map +1 -0
  245. package/dist/billing/modules/checkout/pages/index.js +1 -0
  246. package/dist/billing/modules/checkout/types/index.d.ts +270 -0
  247. package/dist/billing/modules/checkout/types/index.d.ts.map +1 -0
  248. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +20 -0
  249. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +1 -0
  250. package/dist/billing/modules/checkout/utils/storeOrder.js +27 -0
  251. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -0
  252. package/dist/billing/modules/coupons/index.d.ts +5 -0
  253. package/dist/billing/modules/coupons/index.d.ts.map +1 -0
  254. package/dist/billing/modules/coupons/index.js +6 -0
  255. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +4 -0
  256. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +1 -0
  257. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +489 -0
  258. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -0
  259. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +4 -0
  260. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +1 -0
  261. package/dist/billing/modules/coupons/pages/CouponsListPage.js +544 -0
  262. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -0
  263. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +4 -0
  264. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +1 -0
  265. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +421 -0
  266. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -0
  267. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +4 -0
  268. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +1 -0
  269. package/dist/billing/modules/coupons/pages/EditCouponPage.js +379 -0
  270. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -0
  271. package/dist/billing/modules/coupons/pages/index.d.ts +8 -0
  272. package/dist/billing/modules/coupons/pages/index.d.ts.map +1 -0
  273. package/dist/billing/modules/coupons/pages/index.js +4 -0
  274. package/dist/billing/modules/credits/hooks/index.d.ts +5 -0
  275. package/dist/billing/modules/credits/hooks/index.d.ts.map +1 -0
  276. package/dist/billing/modules/credits/hooks/index.js +1 -0
  277. package/dist/billing/modules/credits/hooks/useCredits.d.ts +75 -0
  278. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +1 -0
  279. package/dist/billing/modules/credits/hooks/useCredits.js +78 -0
  280. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -0
  281. package/dist/billing/modules/credits/index.d.ts +6 -0
  282. package/dist/billing/modules/credits/index.d.ts.map +1 -0
  283. package/dist/billing/modules/credits/index.js +8 -0
  284. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +4 -0
  285. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +1 -0
  286. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +140 -0
  287. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -0
  288. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +4 -0
  289. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +1 -0
  290. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +331 -0
  291. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -0
  292. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +4 -0
  293. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -0
  294. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +770 -0
  295. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -0
  296. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +4 -0
  297. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +1 -0
  298. package/dist/billing/modules/credits/pages/CreditsPage.js +324 -0
  299. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -0
  300. package/dist/billing/modules/credits/pages/index.d.ts +8 -0
  301. package/dist/billing/modules/credits/pages/index.d.ts.map +1 -0
  302. package/dist/billing/modules/credits/pages/index.js +4 -0
  303. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +14 -0
  304. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +1 -0
  305. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +185 -0
  306. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -0
  307. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +111 -0
  308. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +1 -0
  309. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +388 -0
  310. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -0
  311. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +16 -0
  312. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +1 -0
  313. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +146 -0
  314. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -0
  315. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +13 -0
  316. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +1 -0
  317. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1044 -0
  318. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -0
  319. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +15 -0
  320. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +1 -0
  321. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +216 -0
  322. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -0
  323. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +27 -0
  324. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +1 -0
  325. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +193 -0
  326. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -0
  327. package/dist/billing/modules/dashboard/components/index.d.ts +10 -0
  328. package/dist/billing/modules/dashboard/components/index.d.ts.map +1 -0
  329. package/dist/billing/modules/dashboard/components/index.js +6 -0
  330. package/dist/billing/modules/dashboard/hooks/index.d.ts +6 -0
  331. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +1 -0
  332. package/dist/billing/modules/dashboard/hooks/index.js +2 -0
  333. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +17 -0
  334. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +1 -0
  335. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +42 -0
  336. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -0
  337. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +145 -0
  338. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +1 -0
  339. package/dist/billing/modules/dashboard/hooks/useDashboard.js +118 -0
  340. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -0
  341. package/dist/billing/modules/dashboard/index.d.ts +8 -0
  342. package/dist/billing/modules/dashboard/index.d.ts.map +1 -0
  343. package/dist/billing/modules/dashboard/index.js +12 -0
  344. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +4 -0
  345. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +1 -0
  346. package/dist/billing/modules/dashboard/pages/OverviewPage.js +478 -0
  347. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -0
  348. package/dist/billing/modules/dashboard/pages/index.d.ts +5 -0
  349. package/dist/billing/modules/dashboard/pages/index.d.ts.map +1 -0
  350. package/dist/billing/modules/dashboard/pages/index.js +1 -0
  351. package/dist/billing/modules/discounts/index.d.ts +6 -0
  352. package/dist/billing/modules/discounts/index.d.ts.map +1 -0
  353. package/dist/billing/modules/discounts/index.js +3 -0
  354. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +4 -0
  355. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +1 -0
  356. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +1009 -0
  357. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -0
  358. package/dist/billing/modules/discounts/pages/index.d.ts +6 -0
  359. package/dist/billing/modules/discounts/pages/index.d.ts.map +1 -0
  360. package/dist/billing/modules/discounts/pages/index.js +1 -0
  361. package/dist/billing/modules/earnings/api.d.ts +131 -0
  362. package/dist/billing/modules/earnings/api.d.ts.map +1 -0
  363. package/dist/billing/modules/earnings/api.js +122 -0
  364. package/dist/billing/modules/earnings/api.js.map +1 -0
  365. package/dist/billing/modules/earnings/index.d.ts +4 -0
  366. package/dist/billing/modules/earnings/index.d.ts.map +1 -0
  367. package/dist/billing/modules/earnings/index.js +4 -0
  368. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +4 -0
  369. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +1 -0
  370. package/dist/billing/modules/earnings/pages/EarningsPage.js +435 -0
  371. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -0
  372. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +4 -0
  373. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -0
  374. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +273 -0
  375. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -0
  376. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +4 -0
  377. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +1 -0
  378. package/dist/billing/modules/earnings/pages/PayoutsPage.js +480 -0
  379. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -0
  380. package/dist/billing/modules/plans/hooks/index.d.ts +7 -0
  381. package/dist/billing/modules/plans/hooks/index.d.ts.map +1 -0
  382. package/dist/billing/modules/plans/hooks/index.js +2 -0
  383. package/dist/billing/modules/plans/hooks/usePlans.d.ts +46 -0
  384. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +1 -0
  385. package/dist/billing/modules/plans/hooks/usePlans.js +77 -0
  386. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -0
  387. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +27 -0
  388. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +1 -0
  389. package/dist/billing/modules/plans/hooks/useQuotas.js +21 -0
  390. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -0
  391. package/dist/billing/modules/plans/index.d.ts +7 -0
  392. package/dist/billing/modules/plans/index.d.ts.map +1 -0
  393. package/dist/billing/modules/plans/index.js +11 -0
  394. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +4 -0
  395. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +1 -0
  396. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +264 -0
  397. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -0
  398. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +4 -0
  399. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +1 -0
  400. package/dist/billing/modules/plans/pages/PlanCreatePage.js +368 -0
  401. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -0
  402. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +4 -0
  403. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +1 -0
  404. package/dist/billing/modules/plans/pages/PlanDetailPage.js +356 -0
  405. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -0
  406. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +4 -0
  407. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +1 -0
  408. package/dist/billing/modules/plans/pages/PlanEditPage.js +395 -0
  409. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -0
  410. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +4 -0
  411. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +1 -0
  412. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +314 -0
  413. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -0
  414. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +4 -0
  415. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +1 -0
  416. package/dist/billing/modules/plans/pages/PlansListPage.js +438 -0
  417. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -0
  418. package/dist/billing/modules/plans/pages/index.d.ts +11 -0
  419. package/dist/billing/modules/plans/pages/index.d.ts.map +1 -0
  420. package/dist/billing/modules/plans/pages/index.js +6 -0
  421. package/dist/billing/modules/quota/hooks/index.d.ts +6 -0
  422. package/dist/billing/modules/quota/hooks/index.d.ts.map +1 -0
  423. package/dist/billing/modules/quota/hooks/index.js +2 -0
  424. package/dist/billing/modules/quota/hooks/useQuota.d.ts +102 -0
  425. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +1 -0
  426. package/dist/billing/modules/quota/hooks/useQuota.js +63 -0
  427. package/dist/billing/modules/quota/hooks/useQuota.js.map +1 -0
  428. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +39 -0
  429. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +1 -0
  430. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +67 -0
  431. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -0
  432. package/dist/billing/modules/quota/index.d.ts +6 -0
  433. package/dist/billing/modules/quota/index.d.ts.map +1 -0
  434. package/dist/billing/modules/quota/index.js +10 -0
  435. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +4 -0
  436. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +1 -0
  437. package/dist/billing/modules/quota/pages/QuotaPage.js +337 -0
  438. package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -0
  439. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +4 -0
  440. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -0
  441. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +273 -0
  442. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -0
  443. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +4 -0
  444. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +1 -0
  445. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +272 -0
  446. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -0
  447. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +4 -0
  448. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -0
  449. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +316 -0
  450. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -0
  451. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +4 -0
  452. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +1 -0
  453. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +401 -0
  454. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -0
  455. package/dist/billing/modules/quota/pages/index.d.ts +9 -0
  456. package/dist/billing/modules/quota/pages/index.d.ts.map +1 -0
  457. package/dist/billing/modules/quota/pages/index.js +5 -0
  458. package/dist/billing/modules/settings/index.d.ts +5 -0
  459. package/dist/billing/modules/settings/index.d.ts.map +1 -0
  460. package/dist/billing/modules/settings/index.js +4 -0
  461. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +4 -0
  462. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +1 -0
  463. package/dist/billing/modules/settings/pages/SettingsPage.js +632 -0
  464. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -0
  465. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +4 -0
  466. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +1 -0
  467. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +270 -0
  468. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -0
  469. package/dist/billing/modules/settings/pages/index.d.ts +6 -0
  470. package/dist/billing/modules/settings/pages/index.d.ts.map +1 -0
  471. package/dist/billing/modules/settings/pages/index.js +2 -0
  472. package/dist/billing/modules/store/graphql/index.d.ts +6 -0
  473. package/dist/billing/modules/store/graphql/index.d.ts.map +1 -0
  474. package/dist/billing/modules/store/graphql/index.js +1 -0
  475. package/dist/billing/modules/store/index.d.ts +6 -0
  476. package/dist/billing/modules/store/index.d.ts.map +1 -0
  477. package/dist/billing/modules/store/index.js +3 -0
  478. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +11 -0
  479. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +1 -0
  480. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +18 -0
  481. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -0
  482. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +12 -0
  483. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +1 -0
  484. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +167 -0
  485. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -0
  486. package/dist/billing/modules/subscriptions/hooks/index.d.ts +6 -0
  487. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +1 -0
  488. package/dist/billing/modules/subscriptions/hooks/index.js +1 -0
  489. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +92 -0
  490. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -0
  491. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +136 -0
  492. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -0
  493. package/dist/billing/modules/subscriptions/index.d.ts +7 -0
  494. package/dist/billing/modules/subscriptions/index.d.ts.map +1 -0
  495. package/dist/billing/modules/subscriptions/index.js +7 -0
  496. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +4 -0
  497. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +1 -0
  498. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +551 -0
  499. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -0
  500. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +4 -0
  501. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -0
  502. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +529 -0
  503. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -0
  504. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +4 -0
  505. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +1 -0
  506. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +430 -0
  507. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -0
  508. package/dist/billing/modules/subscriptions/pages/index.d.ts +8 -0
  509. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +1 -0
  510. package/dist/billing/modules/subscriptions/pages/index.js +3 -0
  511. package/dist/billing/modules/usage/hooks/index.d.ts +6 -0
  512. package/dist/billing/modules/usage/hooks/index.d.ts.map +1 -0
  513. package/dist/billing/modules/usage/hooks/index.js +1 -0
  514. package/dist/billing/modules/usage/hooks/useUsage.d.ts +203 -0
  515. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +1 -0
  516. package/dist/billing/modules/usage/hooks/useUsage.js +271 -0
  517. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -0
  518. package/dist/billing/modules/usage/index.d.ts +6 -0
  519. package/dist/billing/modules/usage/index.d.ts.map +1 -0
  520. package/dist/billing/modules/usage/index.js +5 -0
  521. package/dist/billing/modules/usage/pages/UsagePage.d.ts +4 -0
  522. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -0
  523. package/dist/billing/modules/usage/pages/UsagePage.js +817 -0
  524. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -0
  525. package/dist/billing/modules/usage/pages/index.d.ts +5 -0
  526. package/dist/billing/modules/usage/pages/index.d.ts.map +1 -0
  527. package/dist/billing/modules/usage/pages/index.js +1 -0
  528. package/dist/billing/providers/BillingProvider.d.ts +16 -0
  529. package/dist/billing/providers/BillingProvider.d.ts.map +1 -0
  530. package/dist/billing/providers/BillingProvider.js +40 -0
  531. package/dist/billing/providers/BillingProvider.js.map +1 -0
  532. package/dist/billing/shared/components/AccessDenied.d.ts +8 -0
  533. package/dist/billing/shared/components/AccessDenied.d.ts.map +1 -0
  534. package/dist/billing/shared/components/AccessDenied.js +44 -0
  535. package/dist/billing/shared/components/AccessDenied.js.map +1 -0
  536. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +11 -0
  537. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +1 -0
  538. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +230 -0
  539. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -0
  540. package/dist/billing/shared/components/EmptyState.d.ts +11 -0
  541. package/dist/billing/shared/components/EmptyState.d.ts.map +1 -0
  542. package/dist/billing/shared/components/EmptyState.js +27 -0
  543. package/dist/billing/shared/components/EmptyState.js.map +1 -0
  544. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +11 -0
  545. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +1 -0
  546. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  547. package/dist/billing/shared/components/PageHeader.d.ts +11 -0
  548. package/dist/billing/shared/components/PageHeader.d.ts.map +1 -0
  549. package/dist/billing/shared/components/PageHeader.js +25 -0
  550. package/dist/billing/shared/components/PageHeader.js.map +1 -0
  551. package/dist/billing/shared/components/ServerError.d.ts +11 -0
  552. package/dist/billing/shared/components/ServerError.d.ts.map +1 -0
  553. package/dist/billing/shared/components/ServerError.js +75 -0
  554. package/dist/billing/shared/components/ServerError.js.map +1 -0
  555. package/dist/billing/shared/components/StatCard.d.ts +15 -0
  556. package/dist/billing/shared/components/StatCard.d.ts.map +1 -0
  557. package/dist/billing/shared/components/StatCard.js +37 -0
  558. package/dist/billing/shared/components/StatCard.js.map +1 -0
  559. package/dist/billing/shared/components/index.d.ts +11 -0
  560. package/dist/billing/shared/components/index.d.ts.map +1 -0
  561. package/dist/billing/shared/components/index.js +7 -0
  562. package/dist/billing/shared/index.d.ts +8 -0
  563. package/dist/billing/shared/index.d.ts.map +1 -0
  564. package/dist/billing/shared/types/graphql.d.ts +926 -0
  565. package/dist/billing/shared/types/graphql.d.ts.map +1 -0
  566. package/dist/billing/shared/types/graphql.js +30 -0
  567. package/dist/billing/shared/types/graphql.js.map +1 -0
  568. package/dist/billing/shared/types/index.d.ts +96 -0
  569. package/dist/billing/shared/types/index.d.ts.map +1 -0
  570. package/dist/billing/shared/utils/directActivityGraphql.d.ts +13 -0
  571. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +1 -0
  572. package/dist/billing/shared/utils/directActivityGraphql.js +2 -0
  573. package/dist/billing/shared/utils/directBillingGraphql.d.ts +13 -0
  574. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +1 -0
  575. package/dist/billing/shared/utils/directBillingGraphql.js +22 -0
  576. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -0
  577. package/dist/billing/shared/utils/error.d.ts +30 -0
  578. package/dist/billing/shared/utils/error.d.ts.map +1 -0
  579. package/dist/billing/shared/utils/error.js +16 -0
  580. package/dist/billing/shared/utils/error.js.map +1 -0
  581. package/dist/billing/shared/utils/format.d.ts +28 -0
  582. package/dist/billing/shared/utils/format.d.ts.map +1 -0
  583. package/dist/billing/shared/utils/format.js +65 -0
  584. package/dist/billing/shared/utils/format.js.map +1 -0
  585. package/dist/billing/shared/utils/gatewayGraphql.d.ts +15 -0
  586. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +1 -0
  587. package/dist/billing/shared/utils/gatewayGraphql.js +27 -0
  588. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -0
  589. package/dist/billing/shared/utils/index.d.ts +13 -0
  590. package/dist/billing/shared/utils/index.d.ts.map +1 -0
  591. package/dist/billing/shared/utils/index.js +8 -0
  592. package/dist/billing/shared/utils/navigation.d.ts +2 -0
  593. package/dist/billing/shared/utils/navigation.d.ts.map +1 -0
  594. package/dist/billing/shared/utils/navigation.js +8 -0
  595. package/dist/billing/shared/utils/navigation.js.map +1 -0
  596. package/dist/billing/shared/utils/paymentTheme.d.ts +18 -0
  597. package/dist/billing/shared/utils/paymentTheme.d.ts.map +1 -0
  598. package/dist/billing/shared/utils/paymentTheme.js +32 -0
  599. package/dist/billing/shared/utils/paymentTheme.js.map +1 -0
  600. package/dist/billing/shared/utils/status.d.ts +28 -0
  601. package/dist/billing/shared/utils/status.d.ts.map +1 -0
  602. package/dist/billing/shared/utils/status.js +57 -0
  603. package/dist/billing/shared/utils/status.js.map +1 -0
  604. package/dist/billing/shared/utils/tokens.d.ts +156 -0
  605. package/dist/billing/shared/utils/tokens.d.ts.map +1 -0
  606. package/dist/billing/shared/utils/tokens.js +128 -0
  607. package/dist/billing/shared/utils/tokens.js.map +1 -0
  608. package/dist/billing/types/index.d.ts +268 -0
  609. package/dist/billing/types/index.d.ts.map +1 -0
  610. package/dist/billing/utils/index.d.ts +128 -0
  611. package/dist/billing/utils/index.d.ts.map +1 -0
  612. package/dist/dev/main.d.ts +2 -0
  613. package/dist/dev/main.d.ts.map +1 -0
  614. package/dist/generated/global-operations.d.ts +9544 -0
  615. package/dist/generated/global-operations.d.ts.map +1 -0
  616. package/dist/generated/global-operations.js +3542 -0
  617. package/dist/generated/global-operations.js.map +1 -0
  618. package/dist/generated/global-types.d.ts +22208 -0
  619. package/dist/generated/global-types.d.ts.map +1 -0
  620. package/dist/generated/global-types.js +12 -0
  621. package/dist/generated/global-types.js.map +1 -0
  622. package/dist/generated/wspace-operations.d.ts +61 -0
  623. package/dist/generated/wspace-operations.d.ts.map +1 -0
  624. package/dist/generated/wspace-operations.js +35 -0
  625. package/dist/generated/wspace-operations.js.map +1 -0
  626. package/dist/generated/wspace-types.d.ts +48578 -0
  627. package/dist/generated/wspace-types.d.ts.map +1 -0
  628. package/dist/index.d.ts +8 -0
  629. package/dist/index.d.ts.map +1 -0
  630. package/dist/index.js +2 -0
  631. package/dist/node_modules/@capacitor/core/dist/index.js +270 -0
  632. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -0
  633. package/dist/utils/nativeBridge.d.ts +3 -0
  634. package/dist/utils/nativeBridge.d.ts.map +1 -0
  635. package/dist/utils/nativeBridge.js +2 -0
  636. package/package.json +112 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreditWithdrawalPage.js","names":[],"sources":["../../../../../src/billing/modules/credits/pages/CreditWithdrawalPage.tsx"],"sourcesContent":["/**\n * Credits Module - Credit Withdrawal Page\n * Allows users to withdraw withdrawable credits (purchased + earned) to a payout account.\n */\n\nimport { useState, useEffect, type FC } from 'react';\nimport {\n CreditWithdrawalHistoryDocument,\n GetCreditBalanceByTypeDocument,\n RequestCreditWithdrawalDocument,\n} from '../../../../generated/global-operations';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { useDefaultBillingAccount } from '../../subscriptions/hooks';\nimport { directBillingGraphqlRequest } from '../../../shared/utils';\nimport {\n fetchPayoutAccounts,\n addPayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../../earnings/api';\nimport { formatDate, formatRelativeTime } from '../../../shared/utils/format';\nimport { statusTokens } from '../../../shared/utils/tokens';\nimport type { CreditBalanceByType } from '../../../shared/types';\n\n// ============================================================================\n// API helpers (credit-specific)\n// ============================================================================\n\ninterface GatewayContext {\n apiGatewayUrl?: string;\n authToken?: string;\n orgId?: string;\n}\n\nasync function fetchCreditBalanceByType(\n billingAccountId: string,\n ctx: GatewayContext\n): Promise<CreditBalanceByType> {\n const data = await directBillingGraphqlRequest<\n { getCreditBalanceByType: CreditBalanceByType },\n { billingAccountId: string }\n >({\n ...ctx,\n query: GetCreditBalanceByTypeDocument,\n variables: { billingAccountId },\n });\n return data.getCreditBalanceByType;\n}\n\nasync function requestCreditWithdrawal(\n input: {\n billingAccountId: string;\n creditAmount: number;\n payoutAccountId: string;\n currency?: string;\n notes?: string;\n },\n ctx: GatewayContext\n): Promise<{ id: string; status: string; requestedAmount: number; currency: string }> {\n const data = await directBillingGraphqlRequest<\n {\n requestCreditWithdrawal: {\n id: string;\n status: string;\n requestedAmount: number;\n currency: string;\n };\n },\n { input: typeof input }\n >({\n ...ctx,\n query: RequestCreditWithdrawalDocument,\n variables: { input },\n });\n return data.requestCreditWithdrawal;\n}\n\nasync function fetchCreditWithdrawalHistory(\n billingAccountId: string,\n ctx: GatewayContext\n): Promise<PayoutRequest[]> {\n const data = await directBillingGraphqlRequest<\n { myPayoutRequests: { items: PayoutRequest[] } },\n { billingAccountId: string }\n >({\n ...ctx,\n query: CreditWithdrawalHistoryDocument,\n variables: { billingAccountId },\n });\n return data.myPayoutRequests.items;\n}\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\ninterface BalanceCardProps {\n label: string;\n value: number;\n description?: string;\n highlight?: boolean;\n}\n\nconst BalanceCard: FC<BalanceCardProps> = ({ label, value, description, highlight }) => (\n <div\n className={`border border-border rounded-lg p-5 ${\n highlight ? 'bg-gradient-to-br from-primary/5 to-primary/10' : 'bg-card'\n }`}\n >\n <p className=\"text-sm text-muted-foreground\">{label}</p>\n <p className={`text-2xl font-bold mt-1 ${highlight ? 'text-primary' : 'text-foreground'}`}>\n {value.toLocaleString()} <span className=\"text-base font-normal\">credits</span>\n </p>\n {description && <p className=\"text-xs text-muted-foreground mt-1\">{description}</p>}\n </div>\n);\n\nfunction getWithdrawalStatusColor(status: string): string {\n switch (status.toUpperCase()) {\n case 'PAID':\n return statusTokens.success.text;\n case 'APPROVED':\n case 'PROCESSING':\n return statusTokens.info.text;\n case 'REQUESTED':\n return statusTokens.warning.text;\n case 'REJECTED':\n case 'FAILED':\n case 'CANCELED':\n return statusTokens.error.text;\n default:\n return 'text-muted-foreground';\n }\n}\n\nfunction getWithdrawalStatusBg(status: string): string {\n switch (status.toUpperCase()) {\n case 'PAID':\n return `${statusTokens.success.bg} ${statusTokens.success.text}`;\n case 'APPROVED':\n case 'PROCESSING':\n return `${statusTokens.info.bg} ${statusTokens.info.text}`;\n case 'REQUESTED':\n return `${statusTokens.warning.bg} ${statusTokens.warning.text}`;\n case 'REJECTED':\n case 'FAILED':\n case 'CANCELED':\n return `${statusTokens.error.bg} ${statusTokens.error.text}`;\n default:\n return 'bg-muted text-muted-foreground';\n }\n}\n\n// ============================================================================\n// Main Page\n// ============================================================================\n\nexport const CreditWithdrawalPage: FC = () => {\n const permissions = useBillingPermissions();\n const { billingAccount, isLoading: isLoadingAccount } = useDefaultBillingAccount();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { emit } = useBillingEventEmitter();\n\n // Balance state\n const [balance, setBalance] = useState<CreditBalanceByType | null>(null);\n const [isLoadingBalance, setIsLoadingBalance] = useState(false);\n const [balanceError, setBalanceError] = useState<string | null>(null);\n\n // Payout accounts state\n const [payoutAccounts, setPayoutAccounts] = useState<PayoutAccount[]>([]);\n const [isLoadingAccounts, setIsLoadingAccounts] = useState(false);\n\n // Withdrawal history state\n const [history, setHistory] = useState<PayoutRequest[]>([]);\n const [isLoadingHistory, setIsLoadingHistory] = useState(false);\n\n // Withdrawal form state\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [creditAmount, setCreditAmount] = useState<string>('');\n const [notes, setNotes] = useState<string>('');\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [submitError, setSubmitError] = useState<string | null>(null);\n const [submitSuccess, setSubmitSuccess] = useState(false);\n\n // New payout account form state\n const [showAddAccount, setShowAddAccount] = useState(false);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT' as 'BANK_ACCOUNT' | 'UPI' | 'WALLET',\n accountNumber: '',\n ifscCode: '',\n routingNumber: '',\n upiId: '',\n country: 'IN',\n currency: 'USD',\n });\n const [isAddingAccount, setIsAddingAccount] = useState(false);\n const [addAccountError, setAddAccountError] = useState<string | null>(null);\n\n const billingAccountId = billingAccount?.id;\n\n const getCtx = (): GatewayContext => ({\n apiGatewayUrl,\n authToken,\n orgId,\n });\n\n const loadBalance = async () => {\n if (!billingAccountId) return;\n setIsLoadingBalance(true);\n setBalanceError(null);\n try {\n const b = await fetchCreditBalanceByType(billingAccountId, getCtx());\n setBalance(b);\n } catch (e) {\n setBalanceError(e instanceof Error ? e.message : 'Failed to load balance');\n } finally {\n setIsLoadingBalance(false);\n }\n };\n\n const loadAccounts = async () => {\n if (!billingAccountId) return;\n setIsLoadingAccounts(true);\n try {\n const accounts = await fetchPayoutAccounts(billingAccountId, getCtx());\n setPayoutAccounts(accounts);\n const defaultAcc = accounts.find((a) => a.isDefault) ?? accounts[0];\n if (defaultAcc) setSelectedAccountId(defaultAcc.id);\n } catch {\n // silently fail - user will see empty state\n } finally {\n setIsLoadingAccounts(false);\n }\n };\n\n const loadHistory = async () => {\n if (!billingAccountId) return;\n setIsLoadingHistory(true);\n try {\n const items = await fetchCreditWithdrawalHistory(billingAccountId, getCtx());\n setHistory(items);\n } catch {\n // silently fail\n } finally {\n setIsLoadingHistory(false);\n }\n };\n\n useEffect(() => {\n if (billingAccountId) {\n void loadBalance();\n void loadAccounts();\n void loadHistory();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [billingAccountId]);\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setAddAccountError(null);\n setIsAddingAccount(true);\n try {\n const details: Record<string, string> = {};\n if (accountForm.type === 'BANK_ACCOUNT') {\n if (accountForm.country === 'IN') {\n details.accountNumber = accountForm.accountNumber;\n details.ifscCode = accountForm.ifscCode;\n } else {\n details.accountNumber = accountForm.accountNumber;\n details.routingNumber = accountForm.routingNumber;\n }\n } else if (accountForm.type === 'UPI') {\n details.upiId = accountForm.upiId;\n }\n\n await addPayoutAccount(\n {\n billingAccountId,\n label: accountForm.label,\n type: accountForm.type,\n country: accountForm.country,\n currency: accountForm.currency,\n accountDetails: details,\n },\n getCtx()\n );\n emit('billing.payout_account.added', {\n route: '/billing/credits/withdraw',\n entityId: billingAccountId,\n source: 'credit-withdrawal',\n });\n await loadAccounts();\n setShowAddAccount(false);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n accountNumber: '',\n ifscCode: '',\n routingNumber: '',\n upiId: '',\n country: 'IN',\n currency: 'USD',\n });\n } catch (e) {\n setAddAccountError(e instanceof Error ? e.message : 'Failed to add account');\n } finally {\n setIsAddingAccount(false);\n }\n };\n\n const handleWithdraw = async () => {\n if (!billingAccountId || !selectedAccountId) return;\n const amount = parseFloat(creditAmount);\n if (!amount || amount <= 0) return;\n\n setSubmitError(null);\n setIsSubmitting(true);\n try {\n const withdrawal = await requestCreditWithdrawal(\n {\n billingAccountId,\n creditAmount: amount,\n payoutAccountId: selectedAccountId,\n notes: notes || undefined,\n },\n getCtx()\n );\n emit('billing.credits.withdrawal_requested', {\n route: '/billing/credits/withdraw',\n entityId: withdrawal.id,\n source: 'credit-withdrawal',\n amount,\n });\n setSubmitSuccess(true);\n setCreditAmount('');\n setNotes('');\n await loadBalance();\n await loadHistory();\n } catch (e) {\n setSubmitError(e instanceof Error ? e.message : 'Withdrawal request failed');\n } finally {\n setIsSubmitting(false);\n }\n };\n\n // Permission check\n if (!permissions.canWithdrawCredits) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center\">\n <svg\n className=\"w-6 h-6 text-muted-foreground\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-foreground\">Access Denied</h2>\n <p className=\"text-sm text-muted-foreground\">\n You don&apos;t have permission to withdraw credits.\n </p>\n </div>\n </div>\n );\n }\n\n if (isLoadingAccount && !billingAccount) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-64 bg-muted animate-pulse rounded\" />\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4\">\n {[1, 2, 3, 4].map((i) => (\n <div key={i} className=\"border border-border rounded-lg p-5\">\n <div className=\"h-4 w-24 bg-muted animate-pulse rounded mb-2\" />\n <div className=\"h-8 w-32 bg-muted animate-pulse rounded\" />\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n const withdrawable = balance?.withdrawable ?? 0;\n const amount = parseFloat(creditAmount) || 0;\n const amountValid = amount > 0 && amount <= withdrawable;\n const activeAccounts = payoutAccounts.filter((a) => a.status !== 'ARCHIVED');\n\n return (\n <div className=\"space-y-6 p-6\">\n {/* Header */}\n <div>\n <h1 className=\"text-2xl font-bold text-foreground\">Withdraw Credits</h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n Convert your withdrawable credits (purchased &amp; earned) to a payout\n </p>\n </div>\n\n {/* Balance breakdown */}\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-4\">\n {isLoadingBalance ? (\n [1, 2, 3, 4].map((i) => (\n <div key={i} className=\"border border-border rounded-lg p-5\">\n <div className=\"h-4 w-20 bg-muted animate-pulse rounded mb-2\" />\n <div className=\"h-8 w-28 bg-muted animate-pulse rounded\" />\n </div>\n ))\n ) : balanceError ? (\n <div className=\"col-span-4 text-sm text-destructive\">{balanceError}</div>\n ) : (\n <>\n <BalanceCard\n label=\"Purchased\"\n value={balance?.purchased ?? 0}\n description=\"From credit purchases\"\n />\n <BalanceCard\n label=\"Earned\"\n value={balance?.earned ?? 0}\n description=\"From sales & referrals\"\n />\n <BalanceCard\n label=\"Granted\"\n value={balance?.granted ?? 0}\n description=\"Coupons & admin grants — non-withdrawable\"\n />\n <BalanceCard\n label=\"Withdrawable\"\n value={withdrawable}\n description=\"Purchased + earned\"\n highlight\n />\n </>\n )}\n </div>\n\n {/* Success banner */}\n {submitSuccess && (\n <div className=\"flex items-center gap-3 p-4 rounded-lg bg-status-success-bg-subtle border border-status-success-border text-status-success-text\">\n <svg className=\"w-5 h-5 shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n <div>\n <p className=\"font-medium\">Withdrawal request submitted</p>\n <p className=\"text-sm opacity-80\">Our team will review and process your request.</p>\n </div>\n <button\n onClick={() => setSubmitSuccess(false)}\n className=\"ml-auto text-current opacity-60 hover:opacity-100\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n </div>\n )}\n\n {/* Main two-column layout */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Left: Payout account management */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">Payout Account</h2>\n <button\n onClick={() => setShowAddAccount((v) => !v)}\n className=\"text-sm text-primary hover:underline\"\n >\n {showAddAccount ? 'Cancel' : '+ Add new'}\n </button>\n </div>\n\n {/* Add account form */}\n {showAddAccount && (\n <div className=\"border border-border rounded-lg p-4 space-y-3 bg-muted/30\">\n <h3 className=\"text-sm font-medium text-foreground\">New Payout Account</h3>\n\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">Label</label>\n <input\n type=\"text\"\n value={accountForm.label}\n onChange={(e) => setAccountForm((f) => ({ ...f, label: e.target.value }))}\n placeholder=\"e.g. My Bank Account\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">Type</label>\n <select\n value={accountForm.type}\n onChange={(e) =>\n setAccountForm((f) => ({\n ...f,\n type: e.target.value as typeof accountForm.type,\n }))\n }\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n >\n <option value=\"BANK_ACCOUNT\">Bank Account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n </div>\n\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">Country</label>\n <select\n value={accountForm.country}\n onChange={(e) => setAccountForm((f) => ({ ...f, country: e.target.value }))}\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n >\n <option value=\"IN\">India</option>\n <option value=\"US\">United States</option>\n <option value=\"GB\">United Kingdom</option>\n <option value=\"SG\">Singapore</option>\n <option value=\"AU\">Australia</option>\n <option value=\"CA\">Canada</option>\n <option value=\"DE\">Germany</option>\n </select>\n </div>\n </div>\n\n {accountForm.type === 'BANK_ACCOUNT' && (\n <>\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">\n Account Number\n </label>\n <input\n type=\"text\"\n value={accountForm.accountNumber}\n onChange={(e) =>\n setAccountForm((f) => ({ ...f, accountNumber: e.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n {accountForm.country === 'IN' ? (\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">IFSC Code</label>\n <input\n type=\"text\"\n value={accountForm.ifscCode}\n onChange={(e) =>\n setAccountForm((f) => ({ ...f, ifscCode: e.target.value.toUpperCase() }))\n }\n placeholder=\"e.g. SBIN0001234\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n ) : (\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">\n Routing Number\n </label>\n <input\n type=\"text\"\n value={accountForm.routingNumber}\n onChange={(e) =>\n setAccountForm((f) => ({ ...f, routingNumber: e.target.value }))\n }\n placeholder=\"Routing / sort code\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n )}\n </>\n )}\n\n {accountForm.type === 'UPI' && (\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">UPI ID</label>\n <input\n type=\"text\"\n value={accountForm.upiId}\n onChange={(e) => setAccountForm((f) => ({ ...f, upiId: e.target.value }))}\n placeholder=\"yourname@upi\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n )}\n\n {addAccountError && <p className=\"text-xs text-destructive\">{addAccountError}</p>}\n\n <button\n onClick={() => void handleAddAccount()}\n disabled={isAddingAccount || !accountForm.label}\n className=\"w-full py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {isAddingAccount ? 'Saving…' : 'Save Account'}\n </button>\n </div>\n )}\n\n {/* Existing accounts */}\n {isLoadingAccounts ? (\n <div className=\"space-y-2\">\n {[1, 2].map((i) => (\n <div\n key={i}\n className=\"h-16 border border-border rounded-lg bg-muted animate-pulse\"\n />\n ))}\n </div>\n ) : activeAccounts.length === 0 && !showAddAccount ? (\n <div className=\"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg\">\n <svg\n className=\"w-8 h-8 text-muted-foreground mb-2\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1.5}\n d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\"\n />\n </svg>\n <p className=\"text-sm text-muted-foreground\">No payout accounts yet</p>\n <button\n onClick={() => setShowAddAccount(true)}\n className=\"mt-2 text-sm text-primary hover:underline\"\n >\n Add a bank account or UPI\n </button>\n </div>\n ) : (\n <div className=\"space-y-2\">\n {activeAccounts.map((account) => (\n <button\n key={account.id}\n onClick={() => setSelectedAccountId(account.id)}\n className={`w-full text-left p-4 border rounded-lg transition-colors ${\n selectedAccountId === account.id\n ? 'border-primary bg-primary/5'\n : 'border-border bg-card hover:border-primary/40'\n }`}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">{account.label}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {account.type.replaceAll('_', ' ')}\n {account.displayName ? ` · ${account.displayName}` : ''}\n {account.accountLast4 ? ` ···${account.accountLast4}` : ''}\n {account.country ? ` · ${account.country}` : ''}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n {account.isDefault && (\n <span className=\"text-xs px-2 py-0.5 rounded bg-primary/10 text-primary font-medium\">\n Default\n </span>\n )}\n <span\n className={`text-xs px-2 py-0.5 rounded font-medium ${\n account.status === 'ACTIVE'\n ? `${statusTokens.success.bg} ${statusTokens.success.text}`\n : account.status === 'PENDING_VERIFICATION'\n ? `${statusTokens.warning.bg} ${statusTokens.warning.text}`\n : `${statusTokens.error.bg} ${statusTokens.error.text}`\n }`}\n >\n {account.status.replaceAll('_', ' ').toLowerCase()}\n </span>\n {selectedAccountId === account.id && (\n <svg\n className=\"w-4 h-4 text-primary shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M5 13l4 4L19 7\"\n />\n </svg>\n )}\n </div>\n </div>\n </button>\n ))}\n </div>\n )}\n </div>\n\n {/* Right: Withdrawal request form */}\n <div className=\"space-y-4\">\n <h2 className=\"text-base font-semibold text-foreground\">Request Withdrawal</h2>\n\n <div className=\"border border-border rounded-lg p-5 bg-card space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n Credits to Withdraw\n </label>\n <input\n type=\"number\"\n min={1}\n max={withdrawable}\n step={1}\n value={creditAmount}\n onChange={(e) => setCreditAmount(e.target.value)}\n placeholder=\"Enter credit amount\"\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n <p className=\"text-xs text-muted-foreground mt-1\">\n Max withdrawable:{' '}\n <span className=\"font-medium\">{withdrawable.toLocaleString()} credits</span>\n </p>\n {amount > 0 && amount > withdrawable && (\n <p className=\"text-xs text-destructive mt-1\">\n Amount exceeds your withdrawable balance\n </p>\n )}\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n Notes <span className=\"text-muted-foreground font-normal\">(optional)</span>\n </label>\n <textarea\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n placeholder=\"Any notes for this withdrawal request\"\n rows={2}\n className=\"w-full px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 resize-none\"\n />\n </div>\n\n {submitError && (\n <div className=\"p-3 rounded-md bg-destructive/10 border border-destructive/20\">\n <p className=\"text-sm text-destructive\">{submitError}</p>\n </div>\n )}\n\n <div className=\"pt-1 border-t border-border\">\n <p className=\"text-xs text-muted-foreground mb-3\">\n Credits will be converted to USD at the current credit rate. Withdrawals are\n reviewed before processing and may take 3–5 business days.\n </p>\n <button\n onClick={() => void handleWithdraw()}\n disabled={\n isSubmitting || !amountValid || !selectedAccountId || activeAccounts.length === 0\n }\n className=\"w-full py-2.5 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {isSubmitting ? 'Submitting…' : 'Request Withdrawal'}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {/* Withdrawal history */}\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">Withdrawal History</h2>\n <button\n onClick={() => void loadHistory()}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n aria-label=\"Refresh withdrawal history\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\"\n />\n </svg>\n </button>\n </div>\n\n {isLoadingHistory ? (\n <div className=\"space-y-2\">\n {[1, 2, 3].map((i) => (\n <div\n key={i}\n className=\"h-16 border border-border rounded-lg bg-muted animate-pulse\"\n />\n ))}\n </div>\n ) : history.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-10 border border-dashed border-border rounded-lg\">\n <svg\n className=\"w-8 h-8 text-muted-foreground mb-2\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1.5}\n d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"\n />\n </svg>\n <p className=\"text-sm text-muted-foreground\">No withdrawal requests yet</p>\n </div>\n ) : (\n <div className=\"border border-border rounded-lg overflow-hidden\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-4 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wide\">\n Amount\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wide\">\n Status\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wide hidden sm:table-cell\">\n Payout Account\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wide hidden md:table-cell\">\n Requested\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wide hidden md:table-cell\">\n Completed\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {history.map((req) => (\n <tr key={req.id} className=\"hover:bg-muted/30 transition-colors\">\n <td className=\"px-4 py-3 font-medium text-foreground\">\n {req.requestedAmount.toLocaleString()} {req.currency}\n </td>\n <td className=\"px-4 py-3\">\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${getWithdrawalStatusBg(req.status)}`}\n >\n {req.status.charAt(0) + req.status.slice(1).toLowerCase()}\n </span>\n {req.failureReason && (\n <p\n className=\"text-xs text-destructive mt-0.5 max-w-[180px] truncate\"\n title={req.failureReason}\n >\n {req.failureReason}\n </p>\n )}\n </td>\n <td className=\"px-4 py-3 text-muted-foreground hidden sm:table-cell\">\n {req.payoutAccount ? (\n <span>\n {req.payoutAccount.label}\n {req.payoutAccount.accountLast4\n ? ` ···${req.payoutAccount.accountLast4}`\n : ''}\n </span>\n ) : (\n '—'\n )}\n </td>\n <td className=\"px-4 py-3 text-muted-foreground hidden md:table-cell\">\n <span title={formatDate(req.createdAt, 'long')}>\n {formatRelativeTime(req.createdAt)}\n </span>\n </td>\n <td className=\"px-4 py-3 text-muted-foreground hidden md:table-cell\">\n {req.paidAt ? (\n <span className={getWithdrawalStatusColor('PAID')}>\n {formatDate(req.paidAt, 'short')}\n </span>\n ) : (\n '—'\n )}\n </td>\n </tr>\n ))}\n </t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: FC;
4
+ //# sourceMappingURL=CreditsPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreditsPage.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/credits/pages/CreditsPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAoB1C,eAAO,MAAM,WAAW,EAAE,EAmQzB,CAAC"}
@@ -0,0 +1,324 @@
1
+ import { statusTokens as e } from "../../../shared/utils/tokens.js";
2
+ import { formatCreditTransactionType as t, formatDate as n, formatRelativeTime as r } from "../../../shared/utils/format.js";
3
+ import { getCreditTransactionStatusColor as i, getStatusBadgeClasses as a } from "../../../shared/utils/status.js";
4
+ import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
5
+ import { useBillingNavigate as s } from "../../../hooks/useBillingNavigate.js";
6
+ import { useCreditTransactions as c } from "../hooks/useCredits.js";
7
+ import { useDefaultBillingAccount as l } from "../../subscriptions/hooks/useSubscriptions.js";
8
+ import "../../subscriptions/hooks/index.js";
9
+ import { useState as u } from "react";
10
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
+ import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
+ //#region src/billing/modules/credits/pages/CreditsPage.tsx
13
+ var m = () => {
14
+ let { t: e } = p(), n = (t, n) => {
15
+ let r = e(t);
16
+ return r === t ? n : r;
17
+ }, r = s(), i = o(), { billingAccount: a, isLoading: m } = l(), [g, _] = u(30), [v, y] = u("all"), [b, x] = u(1), { transactions: S, pagination: C, isLoading: w, error: T, refetch: E } = c({
18
+ billingAccountId: a?.id || "",
19
+ days: g,
20
+ page: b,
21
+ pageSize: 20
22
+ });
23
+ if (!i.canViewCredits) return /* @__PURE__ */ d("div", {
24
+ className: "flex items-center justify-center h-full min-h-[400px]",
25
+ children: /* @__PURE__ */ f("div", {
26
+ className: "text-center space-y-2",
27
+ children: [
28
+ /* @__PURE__ */ d("div", {
29
+ className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
30
+ children: /* @__PURE__ */ d("svg", {
31
+ className: "w-6 h-6 text-muted-foreground",
32
+ fill: "none",
33
+ viewBox: "0 0 24 24",
34
+ stroke: "currentColor",
35
+ children: /* @__PURE__ */ d("path", {
36
+ strokeLinecap: "round",
37
+ strokeLinejoin: "round",
38
+ strokeWidth: 2,
39
+ d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
40
+ })
41
+ })
42
+ }),
43
+ /* @__PURE__ */ d("h2", {
44
+ className: "text-lg font-semibold text-foreground",
45
+ children: "Access Denied"
46
+ }),
47
+ /* @__PURE__ */ d("p", {
48
+ className: "text-sm text-muted-foreground max-w-sm",
49
+ children: "You don't have permission to view credits."
50
+ })
51
+ ]
52
+ })
53
+ });
54
+ let D = m || w, O = S.filter((e) => v === "all" ? !0 : e.type === v);
55
+ if (D && !a) return /* @__PURE__ */ f("div", {
56
+ className: "space-y-6 p-6",
57
+ children: [/* @__PURE__ */ d("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ d("div", {
58
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
59
+ children: /* @__PURE__ */ f("div", {
60
+ className: "border border-border rounded-lg p-6",
61
+ children: [/* @__PURE__ */ d("div", { className: "h-6 w-24 bg-muted animate-pulse rounded mb-2" }), /* @__PURE__ */ d("div", { className: "h-10 w-32 bg-muted animate-pulse rounded" })]
62
+ })
63
+ })]
64
+ });
65
+ if (T) return /* @__PURE__ */ d("div", {
66
+ className: "flex items-center justify-center h-full min-h-[400px]",
67
+ children: /* @__PURE__ */ f("div", {
68
+ className: "text-center space-y-4",
69
+ children: [
70
+ /* @__PURE__ */ d("div", {
71
+ className: "w-12 h-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
72
+ children: /* @__PURE__ */ d("svg", {
73
+ className: "w-6 h-6 text-destructive",
74
+ fill: "none",
75
+ viewBox: "0 0 24 24",
76
+ stroke: "currentColor",
77
+ children: /* @__PURE__ */ d("path", {
78
+ strokeLinecap: "round",
79
+ strokeLinejoin: "round",
80
+ strokeWidth: 2,
81
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
82
+ })
83
+ })
84
+ }),
85
+ /* @__PURE__ */ d("h2", {
86
+ className: "text-lg font-semibold text-foreground",
87
+ children: "Failed to load credits"
88
+ }),
89
+ /* @__PURE__ */ d("p", {
90
+ className: "text-sm text-muted-foreground",
91
+ children: T.message
92
+ }),
93
+ /* @__PURE__ */ d("button", {
94
+ onClick: () => E(),
95
+ className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
96
+ children: "Try Again"
97
+ })
98
+ ]
99
+ })
100
+ });
101
+ let k = a?.creditAmount || 0;
102
+ return /* @__PURE__ */ f("div", {
103
+ className: "space-y-6 p-6",
104
+ children: [
105
+ /* @__PURE__ */ f("div", {
106
+ className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
107
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h1", {
108
+ className: "text-2xl font-bold text-foreground",
109
+ children: n("billing.credits.title", "Credits")
110
+ }), /* @__PURE__ */ d("p", {
111
+ className: "text-sm text-muted-foreground mt-1",
112
+ children: "Manage your credit balance and view transaction history"
113
+ })] }), /* @__PURE__ */ f("div", {
114
+ className: "flex items-center gap-2",
115
+ children: [/* @__PURE__ */ f("button", {
116
+ onClick: () => r("/credits/withdraw"),
117
+ className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
118
+ children: [/* @__PURE__ */ d("svg", {
119
+ className: "w-4 h-4",
120
+ fill: "none",
121
+ viewBox: "0 0 24 24",
122
+ stroke: "currentColor",
123
+ children: /* @__PURE__ */ d("path", {
124
+ strokeLinecap: "round",
125
+ strokeLinejoin: "round",
126
+ strokeWidth: 2,
127
+ d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"
128
+ })
129
+ }), "Withdraw"]
130
+ }), /* @__PURE__ */ f("button", {
131
+ onClick: () => r("/checkout/credits"),
132
+ className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
133
+ children: [/* @__PURE__ */ d("svg", {
134
+ className: "w-4 h-4",
135
+ fill: "none",
136
+ viewBox: "0 0 24 24",
137
+ stroke: "currentColor",
138
+ children: /* @__PURE__ */ d("path", {
139
+ strokeLinecap: "round",
140
+ strokeLinejoin: "round",
141
+ strokeWidth: 2,
142
+ d: "M12 4v16m8-8H4"
143
+ })
144
+ }), "Purchase Credits"]
145
+ })]
146
+ })]
147
+ }),
148
+ /* @__PURE__ */ f("div", {
149
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
150
+ children: [/* @__PURE__ */ f("div", {
151
+ className: "border border-border rounded-lg bg-gradient-to-br from-primary/5 to-primary/10 p-6",
152
+ children: [
153
+ /* @__PURE__ */ d("p", {
154
+ className: "text-sm text-muted-foreground",
155
+ children: "Available Balance"
156
+ }),
157
+ /* @__PURE__ */ f("p", {
158
+ className: "text-3xl font-bold text-foreground mt-2",
159
+ children: [k.toLocaleString(), " Credits"]
160
+ }),
161
+ /* @__PURE__ */ d("p", {
162
+ className: "text-sm text-muted-foreground mt-2",
163
+ children: a?.name
164
+ })
165
+ ]
166
+ }), /* @__PURE__ */ f("div", {
167
+ className: "border border-border rounded-lg bg-card p-6",
168
+ children: [
169
+ /* @__PURE__ */ f("p", {
170
+ className: "text-sm text-muted-foreground",
171
+ children: [
172
+ "Transactions (",
173
+ g,
174
+ "d)"
175
+ ]
176
+ }),
177
+ /* @__PURE__ */ d("p", {
178
+ className: "text-2xl font-bold text-foreground mt-2",
179
+ children: C.totalCount
180
+ }),
181
+ /* @__PURE__ */ d("p", {
182
+ className: "text-sm text-muted-foreground mt-2",
183
+ children: "Total transactions"
184
+ })
185
+ ]
186
+ })]
187
+ }),
188
+ /* @__PURE__ */ f("div", {
189
+ className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
190
+ children: [/* @__PURE__ */ d("div", {
191
+ className: "inline-flex rounded-lg border border-border p-1 bg-muted/50",
192
+ children: [
193
+ 7,
194
+ 30,
195
+ 90
196
+ ].map((e) => /* @__PURE__ */ f("button", {
197
+ onClick: () => _(e),
198
+ className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${g === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
199
+ children: [e, "d"]
200
+ }, e))
201
+ }), /* @__PURE__ */ d("div", {
202
+ className: "inline-flex rounded-lg border border-border p-1 bg-muted/50",
203
+ children: [
204
+ "all",
205
+ "purchase",
206
+ "usage",
207
+ "adjustment",
208
+ "granted"
209
+ ].map((e) => /* @__PURE__ */ d("button", {
210
+ onClick: () => y(e),
211
+ className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors capitalize ${v === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
212
+ children: e === "all" ? "All" : t(e)
213
+ }, e))
214
+ })]
215
+ }),
216
+ O.length === 0 ? /* @__PURE__ */ f("div", {
217
+ className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
218
+ children: [
219
+ /* @__PURE__ */ d("div", {
220
+ className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4",
221
+ children: /* @__PURE__ */ d("svg", {
222
+ className: "w-6 h-6 text-muted-foreground",
223
+ fill: "none",
224
+ viewBox: "0 0 24 24",
225
+ stroke: "currentColor",
226
+ children: /* @__PURE__ */ d("path", {
227
+ strokeLinecap: "round",
228
+ strokeLinejoin: "round",
229
+ strokeWidth: 2,
230
+ d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
231
+ })
232
+ })
233
+ }),
234
+ /* @__PURE__ */ d("h3", {
235
+ className: "text-lg font-medium text-foreground",
236
+ children: "No transactions found"
237
+ }),
238
+ /* @__PURE__ */ d("p", {
239
+ className: "text-sm text-muted-foreground mt-1",
240
+ children: v === "all" ? "No credit transactions in this period." : "No transactions match your filter."
241
+ })
242
+ ]
243
+ }) : /* @__PURE__ */ f("div", {
244
+ className: "space-y-3",
245
+ children: [O.map((e) => /* @__PURE__ */ d(h, { transaction: e }, e.id)), C.hasMore && /* @__PURE__ */ d("div", {
246
+ className: "flex justify-center pt-4",
247
+ children: /* @__PURE__ */ d("button", {
248
+ onClick: () => x((e) => e + 1),
249
+ className: "px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
250
+ children: "Load More"
251
+ })
252
+ })]
253
+ })
254
+ ]
255
+ });
256
+ }, h = ({ transaction: o }) => {
257
+ let s = i(o.status), c = o.type === "purchase" || o.type === "adjustment" || o.type === "granted";
258
+ return /* @__PURE__ */ f("div", {
259
+ className: "flex items-center gap-4 p-4 border border-border rounded-lg bg-card hover:shadow-sm transition-shadow",
260
+ children: [
261
+ /* @__PURE__ */ d("div", {
262
+ className: `w-10 h-10 rounded-full flex items-center justify-center ${c ? e.success.bg : e.warning.bg}`,
263
+ children: c ? /* @__PURE__ */ d("svg", {
264
+ className: `w-5 h-5 ${e.success.icon}`,
265
+ fill: "none",
266
+ viewBox: "0 0 24 24",
267
+ stroke: "currentColor",
268
+ children: /* @__PURE__ */ d("path", {
269
+ strokeLinecap: "round",
270
+ strokeLinejoin: "round",
271
+ strokeWidth: 2,
272
+ d: "M12 4v16m8-8H4"
273
+ })
274
+ }) : /* @__PURE__ */ d("svg", {
275
+ className: `w-5 h-5 ${e.warning.icon}`,
276
+ fill: "none",
277
+ viewBox: "0 0 24 24",
278
+ stroke: "currentColor",
279
+ children: /* @__PURE__ */ d("path", {
280
+ strokeLinecap: "round",
281
+ strokeLinejoin: "round",
282
+ strokeWidth: 2,
283
+ d: "M20 12H4"
284
+ })
285
+ })
286
+ }),
287
+ /* @__PURE__ */ f("div", {
288
+ className: "flex-1 min-w-0",
289
+ children: [/* @__PURE__ */ f("div", {
290
+ className: "flex items-center gap-2",
291
+ children: [/* @__PURE__ */ d("p", {
292
+ className: "font-medium text-foreground capitalize",
293
+ children: t(o.type)
294
+ }), /* @__PURE__ */ d("span", {
295
+ className: `px-2 py-0.5 text-xs font-medium rounded ${a(s)}`,
296
+ children: o.status
297
+ })]
298
+ }), /* @__PURE__ */ f("p", {
299
+ className: "text-sm text-muted-foreground mt-0.5",
300
+ children: [
301
+ r(o.createdAt),
302
+ " • ",
303
+ n(o.createdAt, "short")
304
+ ]
305
+ })]
306
+ }),
307
+ /* @__PURE__ */ d("div", {
308
+ className: "text-right",
309
+ children: /* @__PURE__ */ f("p", {
310
+ className: `font-semibold ${c ? e.success.text : "text-foreground"}`,
311
+ children: [
312
+ c ? "+" : "-",
313
+ o.amount.toLocaleString(),
314
+ " credits"
315
+ ]
316
+ })
317
+ })
318
+ ]
319
+ });
320
+ };
321
+ //#endregion
322
+ export { m as CreditsPage };
323
+
324
+ //# sourceMappingURL=CreditsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreditsPage.js","names":[],"sources":["../../../../../src/billing/modules/credits/pages/CreditsPage.tsx"],"sourcesContent":["/**\n * Credits Module - Credits Page\n * Displays credit balance and transaction history\n */\n\nimport { useState, type FC } from 'react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useCreditTransactions } from '../hooks/useCredits';\nimport { useDefaultBillingAccount } from '../../subscriptions/hooks';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport {\n formatDate,\n formatRelativeTime,\n formatCreditTransactionType,\n} from '../../../shared/utils/format';\nimport {\n getCreditTransactionStatusColor,\n getStatusBadgeClasses,\n} from '../../../shared/utils/status';\nimport { statusTokens } from '../../../shared/utils/tokens';\nimport type { CreditTransaction, CreditTransactionType } from '../../../shared/types';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ntype FilterType = 'all' | CreditTransactionType;\n\nexport const CreditsPage: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const { billingAccount, isLoading: isLoadingAccount } = useDefaultBillingAccount();\n\n const [days, setDays] = useState(30);\n const [filterType, setFilterType] = useState<FilterType>('all');\n const [page, setPage] = useState(1);\n\n const {\n transactions,\n pagination,\n isLoading: isLoadingTransactions,\n error,\n refetch,\n } = useCreditTransactions({\n billingAccountId: billingAccount?.id || '',\n days,\n page,\n pageSize: 20,\n });\n\n // Permission check\n if (!permissions.canViewCredits) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center\">\n <svg\n className=\"w-6 h-6 text-muted-foreground\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-foreground\">Access Denied</h2>\n <p className=\"text-sm text-muted-foreground max-w-sm\">\n You don&apos;t have permission to view credits.\n </p>\n </div>\n </div>\n );\n }\n\n const isLoading = isLoadingAccount || isLoadingTransactions;\n\n // Filter transactions\n const filteredTransactions = transactions.filter((tx) => {\n if (filterType === 'all') return true;\n return tx.type === filterType;\n });\n\n // Loading state\n if (isLoading && !billingAccount) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-48 bg-muted animate-pulse rounded\" />\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"border border-border rounded-lg p-6\">\n <div className=\"h-6 w-24 bg-muted animate-pulse rounded mb-2\" />\n <div className=\"h-10 w-32 bg-muted animate-pulse rounded\" />\n </div>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4\">\n <div className=\"w-12 h-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center\">\n <svg\n className=\"w-6 h-6 text-destructive\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-foreground\">Failed to load credits</h2>\n <p className=\"text-sm text-muted-foreground\">{error.message}</p>\n <button\n onClick={() => refetch()}\n className=\"px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors\"\n >\n Try Again\n </button>\n </div>\n </div>\n );\n }\n\n const creditBalance = billingAccount?.creditAmount || 0;\n\n return (\n <div className=\"space-y-6 p-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-foreground\">\n {tr('billing.credits.title', 'Credits')}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n Manage your credit balance and view transaction history\n </p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => navigateTo('/credits/withdraw')}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\"\n />\n </svg>\n Withdraw\n </button>\n <button\n onClick={() => navigateTo('/checkout/credits')}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n Purchase Credits\n </button>\n </div>\n </div>\n\n {/* Balance Card */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n <div className=\"border border-border rounded-lg bg-gradient-to-br from-primary/5 to-primary/10 p-6\">\n <p className=\"text-sm text-muted-foreground\">Available Balance</p>\n <p className=\"text-3xl font-bold text-foreground mt-2\">\n {creditBalance.toLocaleString()} Credits\n </p>\n <p className=\"text-sm text-muted-foreground mt-2\">{billingAccount?.name}</p>\n </div>\n\n <div className=\"border border-border rounded-lg bg-card p-6\">\n <p className=\"text-sm text-muted-foreground\">Transactions ({days}d)</p>\n <p className=\"text-2xl font-bold text-foreground mt-2\">{pagination.totalCount}</p>\n <p className=\"text-sm text-muted-foreground mt-2\">Total transactions</p>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-4 pb-4 border-b border-border\">\n {/* Time Range */}\n <div className=\"inline-flex rounded-lg border border-border p-1 bg-muted/50\">\n {[7, 30, 90].map((d) => (\n <button\n key={d}\n onClick={() => setDays(d)}\n className={`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${\n days === d\n ? 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n }`}\n >\n {d}d\n </button>\n ))}\n </div>\n\n {/* Transaction Type Filter */}\n <div className=\"inline-flex rounded-lg border border-border p-1 bg-muted/50\">\n {(['all', 'purchase', 'usage', 'adjustment', 'granted'] as FilterType[]).map((type) => (\n <button\n key={type}\n onClick={() => setFilterType(type)}\n className={`px-3 py-1.5 text-sm font-medium rounded-md transition-colors capitalize ${\n filterType === type\n ? 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n }`}\n >\n {type === 'all' ? 'All' : formatCreditTransactionType(type as CreditTransactionType)}\n </button>\n ))}\n </div>\n </div>\n\n {/* Transactions List */}\n {filteredTransactions.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg\">\n <div className=\"w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4\">\n <svg\n className=\"w-6 h-6 text-muted-foreground\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <h3 className=\"text-lg font-medium text-foreground\">No transactions found</h3>\n <p className=\"text-sm text-muted-foreground mt-1\">\n {filterType !== 'all'\n ? 'No transactions match your filter.'\n : 'No credit transactions in this period.'}\n </p>\n </div>\n ) : (\n <div className=\"space-y-3\">\n {filteredTransactions.map((tx) => (\n <TransactionRow key={tx.id} transaction={tx} />\n ))}\n\n {/* Pagination */}\n {pagination.hasMore && (\n <div className=\"flex justify-center pt-4\">\n <button\n onClick={() => setPage((p) => p + 1)}\n className=\"px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors\"\n >\n Load More\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// Transaction Row Component\n// ============================================================================\n\ninterface TransactionRowProps {\n transaction: CreditTransaction;\n}\n\nconst TransactionRow: FC<TransactionRowProps> = ({ transaction }) => {\n const statusColor = getCreditTransactionStatusColor(transaction.status);\n const isCredit =\n transaction.type === 'purchase' ||\n transaction.type === 'adjustment' ||\n transaction.type === 'granted';\n\n return (\n <div className=\"flex items-center gap-4 p-4 border border-border rounded-lg bg-card hover:shadow-sm transition-shadow\">\n {/* Icon */}\n <div\n className={`w-10 h-10 rounded-full flex items-center justify-center ${\n isCredit ? statusTokens.success.bg : statusTokens.warning.bg\n }`}\n >\n {isCredit ? (\n <svg\n className={`w-5 h-5 ${statusTokens.success.icon}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n ) : (\n <svg\n className={`w-5 h-5 ${statusTokens.warning.icon}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M20 12H4\" />\n </svg>\n )}\n </div>\n\n {/* Info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <p className=\"font-medium text-foreground capitalize\">\n {formatCreditTransactionType(transaction.type)}\n </p>\n <span\n className={`px-2 py-0.5 text-xs font-medium rounded ${getStatusBadgeClasses(statusColor)}`}\n >\n {transaction.status}\n </span>\n </div>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {formatRelativeTime(transaction.createdAt)} • {formatDate(transaction.createdAt, 'short')}\n </p>\n </div>\n\n {/* Amount */}\n <div className=\"text-right\">\n <p className={`font-semibold ${isCredit ? statusTokens.success.text : 'text-foreground'}`}>\n {isCredit ? '+' : '-'}\n {transaction.amount.toLocaleString()} credits\n </p>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAa,UAAwB;CACnC,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;IAEnC,IAAa,GAAoB,EACjC,IAAc,GAAuB,EACrC,EAAE,mBAAgB,WAAW,MAAqB,GAA0B,EAE5E,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAY,KAAiB,EAAqB,MAAM,EACzD,CAAC,GAAM,KAAW,EAAS,EAAE,EAE7B,EACJ,iBACA,eACA,WAAW,GACX,UACA,eACE,EAAsB;EACxB,kBAAkB,GAAgB,MAAM;EACxC;EACA;EACA,UAAU;EACX,CAAC;AAGF,KAAI,CAAC,EAAY,eACf,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD;MACE,WAAU;MACV,MAAK;MACL,SAAQ;MACR,QAAO;gBAEP,kBAAC,QAAD;OACE,eAAc;OACd,gBAAe;OACf,aAAa;OACb,GAAE;OACF,CAAA;MACE,CAAA;KACF,CAAA;IACN,kBAAC,MAAD;KAAI,WAAU;eAAwC;KAAkB,CAAA;IACxE,kBAAC,KAAD;KAAG,WAAU;eAAyC;KAElD,CAAA;IACA;;EACF,CAAA;CAIV,IAAM,IAAY,KAAoB,GAGhC,IAAuB,EAAa,QAAQ,MAC5C,MAAe,QAAc,KAC1B,EAAG,SAAS,EACnB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P,kBAAC,QAAD;MAAM,eAAc;MAAQ,gBAAe;MAAQ,aAAa;MAAG,GAAE;MAAa,CAAA;KAC9E,CAAA;IAEJ,CAAA;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBACV,EAA4B,EAAY,KAAK;MAC5C,CAAA,EACJ,kBAAC,QAAD;MACE,WAAW,2CAA2C,EAAsB,EAAY;gBAEvF,EAAY;MACR,CAAA,CACH;QACN,kBAAC,KAAD;KAAG,WAAU;eAAb;MACG,EAAmB,EAAY,UAAU;MAAC;MAAI,EAAW,EAAY,WAAW,QAAQ;MACvF;OACA;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,KAAD;KAAG,WAAW,iBAAiB,IAAW,EAAa,QAAQ,OAAO;eAAtE;MACG,IAAW,MAAM;MACjB,EAAY,OAAO,gBAAgB;MAAC;MACnC;;IACA,CAAA;GACF"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Credits Module - Pages
3
+ */
4
+ export { CreditsPage } from './CreditsPage';
5
+ export { CreditTransactionsPage } from './CreditTransactionsPage';
6
+ export { AdminCreditsPage } from './AdminCreditsPage';
7
+ export { CreditWithdrawalPage } from './CreditWithdrawalPage';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/credits/pages/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import "./CreditsPage.js";
2
+ import "./CreditTransactionsPage.js";
3
+ import "./AdminCreditsPage.js";
4
+ import "./CreditWithdrawalPage.js";
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import { BillingSubscription } from '../../../shared/types';
3
+
4
+ interface ActiveSubscriptionCardProps {
5
+ subscription: BillingSubscription | null;
6
+ onViewDetails?: () => void;
7
+ onUpgrade?: () => void;
8
+ onManage?: () => void;
9
+ onPurchasePlan?: () => void;
10
+ className?: string;
11
+ }
12
+ export declare const ActiveSubscriptionCard: FC<ActiveSubscriptionCardProps>;
13
+ export {};
14
+ //# sourceMappingURL=ActiveSubscriptionCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActiveSubscriptionCard.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/dashboard/components/ActiveSubscriptionCard.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AAYzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjE,UAAU,2BAA2B;IACnC,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CA6OlE,CAAC"}