@burdenoff/microfe-billing 2026.1108.1 → 2026.1109.1

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 (773) hide show
  1. package/dist/billing/BillingAdminRoutes.d.ts +1 -2
  2. package/dist/billing/BillingAdminRoutes.js +11 -12
  3. package/dist/billing/BillingAdminRoutes.js.map +1 -1
  4. package/dist/billing/BillingRoot.d.ts +0 -1
  5. package/dist/billing/BillingRoot.js +10 -9
  6. package/dist/billing/BillingRoot.js.map +1 -1
  7. package/dist/billing/BillingUserRoutes.d.ts +1 -2
  8. package/dist/billing/BillingUserRoutes.js +13 -14
  9. package/dist/billing/BillingUserRoutes.js.map +1 -1
  10. package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -1
  11. package/dist/billing/hooks/useBillingAccountSelection.js +7 -5
  12. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -1
  13. package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -1
  14. package/dist/billing/hooks/useBillingEventEmitter.js +1 -2
  15. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -1
  16. package/dist/billing/hooks/useBillingNavigate.d.ts +0 -1
  17. package/dist/billing/hooks/useBillingNavigate.js +1 -2
  18. package/dist/billing/hooks/useBillingNavigate.js.map +1 -1
  19. package/dist/billing/hooks/useBillingPermissions.d.ts +0 -1
  20. package/dist/billing/hooks/useBillingPermissions.js +2 -3
  21. package/dist/billing/hooks/useBillingPermissions.js.map +1 -1
  22. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -1
  23. package/dist/billing/hooks/useDefaultBillingCurrency.js +1 -2
  24. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -1
  25. package/dist/billing/hooks/useProducts.d.ts +0 -1
  26. package/dist/billing/hooks/useProducts.js +1 -2
  27. package/dist/billing/hooks/useProducts.js.map +1 -1
  28. package/dist/billing/index.d.ts +0 -1
  29. package/dist/billing/lib/native-purchases.d.ts +0 -1
  30. package/dist/billing/lib/native-purchases.js +1 -2
  31. package/dist/billing/lib/native-purchases.js.map +1 -1
  32. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -1
  33. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +4 -5
  34. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -1
  35. package/dist/billing/modules/addons/hooks/index.d.ts +0 -1
  36. package/dist/billing/modules/addons/hooks/index.js +3 -2
  37. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts +0 -1
  38. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js +1 -2
  39. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js.map +1 -1
  40. package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -1
  41. package/dist/billing/modules/addons/hooks/useAddons.js +1 -2
  42. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -1
  43. package/dist/billing/modules/addons/index.d.ts +0 -1
  44. package/dist/billing/modules/addons/index.js +10 -10
  45. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -1
  46. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +15 -16
  47. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  48. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -1
  49. package/dist/billing/modules/addons/pages/AddonCreatePage.js +11 -12
  50. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  51. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -1
  52. package/dist/billing/modules/addons/pages/AddonDetailPage.js +16 -17
  53. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  54. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -1
  55. package/dist/billing/modules/addons/pages/AddonEditPage.js +16 -17
  56. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  57. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -1
  58. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +111 -106
  59. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  60. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -1
  61. package/dist/billing/modules/addons/pages/AddonsListPage.js +105 -100
  62. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  63. package/dist/billing/modules/addons/pages/index.d.ts +0 -1
  64. package/dist/billing/modules/addons/pages/index.js +7 -6
  65. package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -1
  66. package/dist/billing/modules/addons/store/addonCartStore.js +2 -7
  67. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -1
  68. package/dist/billing/modules/affiliate/api.d.ts +0 -1
  69. package/dist/billing/modules/affiliate/api.js +1 -2
  70. package/dist/billing/modules/affiliate/api.js.map +1 -1
  71. package/dist/billing/modules/affiliate/index.d.ts +0 -1
  72. package/dist/billing/modules/affiliate/index.js +1 -2
  73. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -1
  74. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +29 -28
  75. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  76. package/dist/billing/modules/analytics/index.d.ts +0 -1
  77. package/dist/billing/modules/analytics/index.js +1 -2
  78. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -1
  79. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +8 -9
  80. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  81. package/dist/billing/modules/analytics/pages/index.d.ts +0 -1
  82. package/dist/billing/modules/analytics/pages/index.js +1 -1
  83. package/dist/billing/modules/billing/hooks/index.d.ts +0 -1
  84. package/dist/billing/modules/billing/hooks/index.js +5 -4
  85. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
  86. package/dist/billing/modules/billing/hooks/useInvoices.js +1 -2
  87. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  88. package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts +0 -1
  89. package/dist/billing/modules/billing/hooks/useOrderCallbacks.js +1 -2
  90. package/dist/billing/modules/billing/hooks/useOrderCallbacks.js.map +1 -1
  91. package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -1
  92. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -1
  93. package/dist/billing/modules/billing/hooks/useRefunds.js +1 -2
  94. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
  95. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -1
  96. package/dist/billing/modules/billing/hooks/useTransactions.js +30 -31
  97. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -1
  98. package/dist/billing/modules/billing/index.d.ts +0 -1
  99. package/dist/billing/modules/billing/index.js +15 -15
  100. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts +0 -1
  101. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +11 -12
  102. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  103. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -1
  104. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +53 -59
  105. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  106. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -1
  107. package/dist/billing/modules/billing/pages/InvoicesListPage.js +81 -87
  108. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  109. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts +0 -1
  110. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +11 -12
  111. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  112. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -1
  113. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +51 -54
  114. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  115. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts +0 -1
  116. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +33 -34
  117. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
  118. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -1
  119. package/dist/billing/modules/billing/pages/RefundsPage.js +92 -93
  120. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  121. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -1
  122. package/dist/billing/modules/billing/pages/TransactionsPage.js +38 -39
  123. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  124. package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts +0 -1
  125. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -30
  126. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  127. package/dist/billing/modules/billing/pages/index.d.ts +0 -1
  128. package/dist/billing/modules/billing/pages/index.js +10 -9
  129. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -1
  130. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -1
  131. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -2
  132. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
  133. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -1
  134. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts +0 -1
  135. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -2
  136. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  137. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -1
  138. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +1 -2
  139. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -1
  140. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -1
  141. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -1
  142. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -1
  143. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +1 -2
  144. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -1
  145. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -1
  146. package/dist/billing/modules/checkout/components/OrderSummary.js +35 -32
  147. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
  148. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -1
  149. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -1
  150. package/dist/billing/modules/checkout/components/PromoCodeInput.js +1 -2
  151. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -1
  152. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -1
  153. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +1 -2
  154. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
  155. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -1
  156. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -1
  157. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +1 -2
  158. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -1
  159. package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts +0 -1
  160. package/dist/billing/modules/checkout/components/StoreShippingSection.js +5 -3
  161. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  162. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -1
  163. package/dist/billing/modules/checkout/components/StripePaymentForm.js +35 -41
  164. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -1
  165. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -1
  166. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -2
  167. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
  168. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -1
  169. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +1 -2
  170. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -1
  171. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts +0 -1
  172. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js +5 -6
  173. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js.map +1 -1
  174. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts +0 -1
  175. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +7 -8
  176. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  177. package/dist/billing/modules/checkout/components/index.d.ts +0 -1
  178. package/dist/billing/modules/checkout/components/index.js +12 -11
  179. package/dist/billing/modules/checkout/hooks/index.d.ts +0 -1
  180. package/dist/billing/modules/checkout/hooks/index.js +5 -4
  181. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -1
  182. package/dist/billing/modules/checkout/hooks/useCheckout.js +182 -195
  183. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
  184. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -1
  185. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +33 -32
  186. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -1
  187. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -1
  188. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +1 -2
  189. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -1
  190. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -1
  191. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +1 -2
  192. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -1
  193. package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts +4 -8
  194. package/dist/billing/modules/checkout/hooks/useStoreShipping.js +1 -2
  195. package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
  196. package/dist/billing/modules/checkout/index.d.ts +0 -1
  197. package/dist/billing/modules/checkout/index.js +19 -19
  198. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -1
  199. package/dist/billing/modules/checkout/pages/CheckoutPage.js +730 -732
  200. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  201. package/dist/billing/modules/checkout/pages/index.d.ts +0 -1
  202. package/dist/billing/modules/checkout/pages/index.js +1 -1
  203. package/dist/billing/modules/checkout/types/index.d.ts +0 -1
  204. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -1
  205. package/dist/billing/modules/checkout/utils/storeOrder.js +0 -1
  206. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -1
  207. package/dist/billing/modules/coupons/index.d.ts +0 -1
  208. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -1
  209. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +5 -6
  210. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  211. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -1
  212. package/dist/billing/modules/coupons/pages/CouponsListPage.js +15 -13
  213. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  214. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -1
  215. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +12 -10
  216. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  217. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -1
  218. package/dist/billing/modules/coupons/pages/EditCouponPage.js +7 -11
  219. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  220. package/dist/billing/modules/coupons/pages/index.d.ts +0 -1
  221. package/dist/billing/modules/coupons/pages/index.js +5 -4
  222. package/dist/billing/modules/credits/hooks/index.d.ts +0 -1
  223. package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -1
  224. package/dist/billing/modules/credits/hooks/useCredits.js +20 -21
  225. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -1
  226. package/dist/billing/modules/credits/index.d.ts +0 -1
  227. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -1
  228. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +19 -24
  229. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  230. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -1
  231. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +26 -27
  232. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  233. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -1
  234. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +54 -52
  235. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  236. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -1
  237. package/dist/billing/modules/credits/pages/CreditsPage.js +37 -38
  238. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  239. package/dist/billing/modules/credits/pages/index.d.ts +0 -1
  240. package/dist/billing/modules/credits/pages/index.js +5 -4
  241. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -1
  242. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -3
  243. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
  244. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -1
  245. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +35 -43
  246. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
  247. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -1
  248. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +1 -2
  249. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
  250. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -1
  251. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1 -2
  252. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  253. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -1
  254. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +2 -5
  255. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
  256. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -1
  257. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -2
  258. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
  259. package/dist/billing/modules/dashboard/components/index.d.ts +0 -1
  260. package/dist/billing/modules/dashboard/components/index.js +7 -6
  261. package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -1
  262. package/dist/billing/modules/dashboard/hooks/index.js +3 -2
  263. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -1
  264. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +2 -3
  265. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -1
  266. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -1
  267. package/dist/billing/modules/dashboard/hooks/useDashboard.js +2 -3
  268. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -1
  269. package/dist/billing/modules/dashboard/index.d.ts +0 -1
  270. package/dist/billing/modules/dashboard/index.js +11 -10
  271. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -1
  272. package/dist/billing/modules/dashboard/pages/OverviewPage.js +266 -264
  273. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  274. package/dist/billing/modules/dashboard/pages/index.d.ts +0 -1
  275. package/dist/billing/modules/dashboard/pages/index.js +1 -1
  276. package/dist/billing/modules/discounts/index.d.ts +0 -1
  277. package/dist/billing/modules/discounts/index.js +1 -2
  278. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -1
  279. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +169 -176
  280. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  281. package/dist/billing/modules/discounts/pages/index.d.ts +0 -1
  282. package/dist/billing/modules/discounts/pages/index.js +1 -1
  283. package/dist/billing/modules/earnings/api.d.ts +0 -1
  284. package/dist/billing/modules/earnings/api.js +66 -67
  285. package/dist/billing/modules/earnings/api.js.map +1 -1
  286. package/dist/billing/modules/earnings/index.d.ts +0 -1
  287. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts +0 -1
  288. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +17 -17
  289. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
  290. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts +0 -1
  291. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +188 -189
  292. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  293. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -1
  294. package/dist/billing/modules/earnings/pages/EarningsPage.js +111 -111
  295. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  296. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -1
  297. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +29 -30
  298. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  299. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -1
  300. package/dist/billing/modules/earnings/pages/PayoutsPage.js +103 -104
  301. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  302. package/dist/billing/modules/earnings/payoutAccountStatus.d.ts +0 -1
  303. package/dist/billing/modules/earnings/payoutAccountStatus.js +1 -2
  304. package/dist/billing/modules/earnings/payoutAccountStatus.js.map +1 -1
  305. package/dist/billing/modules/plans/constants/enterprise.d.ts +0 -1
  306. package/dist/billing/modules/plans/constants/enterprise.js +1 -2
  307. package/dist/billing/modules/plans/constants/enterprise.js.map +1 -1
  308. package/dist/billing/modules/plans/constants/featuredQuotas.d.ts +0 -1
  309. package/dist/billing/modules/plans/constants/featuredQuotas.js +1 -2
  310. package/dist/billing/modules/plans/constants/featuredQuotas.js.map +1 -1
  311. package/dist/billing/modules/plans/hooks/index.d.ts +0 -1
  312. package/dist/billing/modules/plans/hooks/index.js +3 -2
  313. package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -1
  314. package/dist/billing/modules/plans/hooks/usePlans.js +1 -2
  315. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -1
  316. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -1
  317. package/dist/billing/modules/plans/hooks/useQuotas.js +1 -2
  318. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -1
  319. package/dist/billing/modules/plans/index.d.ts +0 -1
  320. package/dist/billing/modules/plans/index.js +11 -11
  321. package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts +0 -1
  322. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +12 -15
  323. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  324. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -1
  325. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +38 -39
  326. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  327. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -1
  328. package/dist/billing/modules/plans/pages/PlanCreatePage.js +10 -11
  329. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  330. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -1
  331. package/dist/billing/modules/plans/pages/PlanDetailPage.js +40 -41
  332. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  333. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -1
  334. package/dist/billing/modules/plans/pages/PlanEditPage.js +15 -16
  335. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  336. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -1
  337. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +18 -19
  338. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  339. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -1
  340. package/dist/billing/modules/plans/pages/PlansListPage.js +100 -101
  341. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  342. package/dist/billing/modules/plans/pages/index.d.ts +0 -1
  343. package/dist/billing/modules/plans/pages/index.js +8 -7
  344. package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts +0 -1
  345. package/dist/billing/modules/plans/utils/currencyPriceOverrides.js +1 -2
  346. package/dist/billing/modules/plans/utils/currencyPriceOverrides.js.map +1 -1
  347. package/dist/billing/modules/plans/utils/planSelector.d.ts +0 -1
  348. package/dist/billing/modules/plans/utils/planSelector.js +1 -2
  349. package/dist/billing/modules/plans/utils/planSelector.js.map +1 -1
  350. package/dist/billing/modules/promotions/index.d.ts +0 -1
  351. package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts +0 -1
  352. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +5 -6
  353. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  354. package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts +0 -1
  355. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +5 -6
  356. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  357. package/dist/billing/modules/promotions/pages/index.d.ts +0 -1
  358. package/dist/billing/modules/promotions/pages/index.js +3 -2
  359. package/dist/billing/modules/quota/hooks/index.d.ts +0 -1
  360. package/dist/billing/modules/quota/hooks/index.js +1 -1
  361. package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -1
  362. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -1
  363. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +1 -2
  364. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -1
  365. package/dist/billing/modules/quota/index.d.ts +0 -1
  366. package/dist/billing/modules/quota/index.js +8 -8
  367. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts +0 -1
  368. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +12 -15
  369. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js.map +1 -1
  370. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -1
  371. package/dist/billing/modules/quota/pages/QuotaPage.js +3 -3
  372. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -1
  373. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +13 -14
  374. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  375. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -1
  376. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +9 -10
  377. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  378. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -1
  379. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +12 -13
  380. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  381. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -1
  382. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +16 -17
  383. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  384. package/dist/billing/modules/quota/pages/index.d.ts +0 -1
  385. package/dist/billing/modules/quota/pages/index.js +6 -5
  386. package/dist/billing/modules/quota/utils/quotaSelector.d.ts +0 -1
  387. package/dist/billing/modules/quota/utils/quotaSelector.js +1 -2
  388. package/dist/billing/modules/quota/utils/quotaSelector.js.map +1 -1
  389. package/dist/billing/modules/settings/index.d.ts +0 -1
  390. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -1
  391. package/dist/billing/modules/settings/pages/SettingsPage.js +12 -13
  392. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  393. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -1
  394. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +32 -32
  395. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  396. package/dist/billing/modules/settings/pages/index.d.ts +0 -1
  397. package/dist/billing/modules/settings/pages/index.js +3 -2
  398. package/dist/billing/modules/store/graphql/index.d.ts +0 -1
  399. package/dist/billing/modules/store/index.d.ts +0 -1
  400. package/dist/billing/modules/store/index.js +1 -2
  401. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -1
  402. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +1 -2
  403. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -1
  404. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -1
  405. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +9 -11
  406. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
  407. package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -1
  408. package/dist/billing/modules/subscriptions/hooks/index.js +1 -1
  409. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -1
  410. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +1 -2
  411. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
  412. package/dist/billing/modules/subscriptions/index.d.ts +0 -1
  413. package/dist/billing/modules/subscriptions/index.js +6 -6
  414. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -1
  415. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +311 -312
  416. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  417. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -1
  418. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +61 -62
  419. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  420. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -1
  421. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +30 -31
  422. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  423. package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -1
  424. package/dist/billing/modules/subscriptions/pages/index.js +4 -3
  425. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts +0 -1
  426. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +17 -18
  427. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  428. package/dist/billing/modules/usage/hooks/index.d.ts +0 -1
  429. package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -1
  430. package/dist/billing/modules/usage/hooks/useUsage.js +72 -73
  431. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
  432. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts +0 -1
  433. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js +12 -13
  434. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js.map +1 -1
  435. package/dist/billing/modules/usage/index.d.ts +0 -1
  436. package/dist/billing/modules/usage/index.js +1 -2
  437. package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -1
  438. package/dist/billing/modules/usage/pages/UsagePage.js +229 -227
  439. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  440. package/dist/billing/modules/usage/pages/index.d.ts +0 -1
  441. package/dist/billing/modules/usage/pages/index.js +1 -1
  442. package/dist/billing/modules/usage/utils/aiSpend.d.ts +0 -1
  443. package/dist/billing/modules/usage/utils/aiSpend.js +2 -3
  444. package/dist/billing/modules/usage/utils/aiSpend.js.map +1 -1
  445. package/dist/billing/providers/BillingProvider.d.ts +0 -1
  446. package/dist/billing/providers/BillingProvider.js +3 -4
  447. package/dist/billing/providers/BillingProvider.js.map +1 -1
  448. package/dist/billing/shared/components/AccessDenied.d.ts +0 -1
  449. package/dist/billing/shared/components/AccessDenied.js +1 -2
  450. package/dist/billing/shared/components/AccessDenied.js.map +1 -1
  451. package/dist/billing/shared/components/ActorIdentity.d.ts +0 -1
  452. package/dist/billing/shared/components/ActorIdentity.js +2 -3
  453. package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
  454. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -1
  455. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +1 -2
  456. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
  457. package/dist/billing/shared/components/EmptyState.d.ts +0 -1
  458. package/dist/billing/shared/components/EmptyState.js +1 -2
  459. package/dist/billing/shared/components/EmptyState.js.map +1 -1
  460. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -1
  461. package/dist/billing/shared/components/PageHeader.d.ts +0 -1
  462. package/dist/billing/shared/components/PageHeader.js +1 -2
  463. package/dist/billing/shared/components/PageHeader.js.map +1 -1
  464. package/dist/billing/shared/components/PushPermissionNudge.d.ts +0 -1
  465. package/dist/billing/shared/components/PushPermissionNudge.js +2 -3
  466. package/dist/billing/shared/components/PushPermissionNudge.js.map +1 -1
  467. package/dist/billing/shared/components/ServerError.d.ts +0 -1
  468. package/dist/billing/shared/components/ServerError.js +1 -2
  469. package/dist/billing/shared/components/ServerError.js.map +1 -1
  470. package/dist/billing/shared/components/StatCard.d.ts +0 -1
  471. package/dist/billing/shared/components/StatCard.js +1 -2
  472. package/dist/billing/shared/components/StatCard.js.map +1 -1
  473. package/dist/billing/shared/components/index.d.ts +0 -1
  474. package/dist/billing/shared/components/index.js +8 -7
  475. package/dist/billing/shared/hooks/index.d.ts +0 -1
  476. package/dist/billing/shared/hooks/index.js +1 -1
  477. package/dist/billing/shared/hooks/useActorProfiles.d.ts +0 -1
  478. package/dist/billing/shared/hooks/useActorProfiles.js +4 -8
  479. package/dist/billing/shared/hooks/useActorProfiles.js.map +1 -1
  480. package/dist/billing/shared/hooks/useTr.d.ts +0 -1
  481. package/dist/billing/shared/hooks/useTr.js +1 -2
  482. package/dist/billing/shared/hooks/useTr.js.map +1 -1
  483. package/dist/billing/shared/index.d.ts +0 -1
  484. package/dist/billing/shared/types/graphql.d.ts +0 -1
  485. package/dist/billing/shared/types/graphql.js +1 -2
  486. package/dist/billing/shared/types/graphql.js.map +1 -1
  487. package/dist/billing/shared/types/index.d.ts +0 -1
  488. package/dist/billing/shared/ui/Card.d.ts +1 -2
  489. package/dist/billing/shared/ui/Card.js +1 -2
  490. package/dist/billing/shared/ui/Card.js.map +1 -1
  491. package/dist/billing/shared/ui/MetricCard.d.ts +1 -2
  492. package/dist/billing/shared/ui/MetricCard.js +1 -2
  493. package/dist/billing/shared/ui/MetricCard.js.map +1 -1
  494. package/dist/billing/shared/ui/ProgressBar.d.ts +1 -2
  495. package/dist/billing/shared/ui/ProgressBar.js +1 -2
  496. package/dist/billing/shared/ui/ProgressBar.js.map +1 -1
  497. package/dist/billing/shared/ui/SectionHeader.d.ts +1 -2
  498. package/dist/billing/shared/ui/StatusPill.d.ts +1 -2
  499. package/dist/billing/shared/ui/StatusPill.js +1 -2
  500. package/dist/billing/shared/ui/StatusPill.js.map +1 -1
  501. package/dist/billing/shared/ui/index.d.ts +0 -1
  502. package/dist/billing/shared/ui/index.js +5 -4
  503. package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -1
  504. package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
  505. package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -1
  506. package/dist/billing/shared/utils/directBillingGraphql.js +3 -3
  507. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
  508. package/dist/billing/shared/utils/error.d.ts +0 -1
  509. package/dist/billing/shared/utils/error.js +1 -2
  510. package/dist/billing/shared/utils/error.js.map +1 -1
  511. package/dist/billing/shared/utils/format.d.ts +0 -1
  512. package/dist/billing/shared/utils/format.js +1 -2
  513. package/dist/billing/shared/utils/format.js.map +1 -1
  514. package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -1
  515. package/dist/billing/shared/utils/gatewayGraphql.js +4 -4
  516. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
  517. package/dist/billing/shared/utils/index.d.ts +0 -1
  518. package/dist/billing/shared/utils/index.js +9 -8
  519. package/dist/billing/shared/utils/navigation.d.ts +0 -1
  520. package/dist/billing/shared/utils/navigation.js +1 -2
  521. package/dist/billing/shared/utils/navigation.js.map +1 -1
  522. package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
  523. package/dist/billing/shared/utils/paymentTheme.js +2 -3
  524. package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
  525. package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
  526. package/dist/billing/shared/utils/pinnedRequest.js +63 -0
  527. package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
  528. package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
  529. package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
  530. package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
  531. package/dist/billing/shared/utils/status.d.ts +0 -1
  532. package/dist/billing/shared/utils/status.js +24 -25
  533. package/dist/billing/shared/utils/status.js.map +1 -1
  534. package/dist/billing/shared/utils/tokens.d.ts +0 -1
  535. package/dist/billing/shared/utils/tokens.js +1 -2
  536. package/dist/billing/shared/utils/tokens.js.map +1 -1
  537. package/dist/billing/translations/en.d.ts +0 -1
  538. package/dist/billing/types/index.d.ts +0 -1
  539. package/dist/dev/main.d.ts +0 -1
  540. package/dist/generated/global-operations.d.ts +3252 -3206
  541. package/dist/generated/global-operations.js +445 -422
  542. package/dist/generated/global-operations.js.map +1 -1
  543. package/dist/generated/global-types.d.ts +2 -22
  544. package/dist/generated/global-types.js +1 -2
  545. package/dist/generated/global-types.js.map +1 -1
  546. package/dist/generated/wspace-operations.d.ts +76 -47
  547. package/dist/generated/wspace-operations.js +2 -3
  548. package/dist/generated/wspace-operations.js.map +1 -1
  549. package/dist/generated/wspace-types.d.ts +4 -24
  550. package/dist/index.d.ts +0 -1
  551. package/dist/index.js +1 -2
  552. package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
  553. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
  554. package/dist/node_modules/sonner/dist/index.js +75 -69
  555. package/dist/node_modules/sonner/dist/index.js.map +1 -1
  556. package/dist/utils/nativeBridge.d.ts +0 -1
  557. package/dist/utils/nativeBridge.js +1 -2
  558. package/package.json +66 -55
  559. package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
  560. package/dist/billing/BillingRoot.d.ts.map +0 -1
  561. package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
  562. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
  563. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
  564. package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
  565. package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
  566. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
  567. package/dist/billing/hooks/useProducts.d.ts.map +0 -1
  568. package/dist/billing/index.d.ts.map +0 -1
  569. package/dist/billing/lib/native-purchases.d.ts.map +0 -1
  570. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
  571. package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
  572. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
  573. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
  574. package/dist/billing/modules/addons/index.d.ts.map +0 -1
  575. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
  576. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
  577. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
  578. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
  579. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
  580. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
  581. package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
  582. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
  583. package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
  584. package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
  585. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
  586. package/dist/billing/modules/analytics/index.d.ts.map +0 -1
  587. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
  588. package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
  589. package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
  590. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
  591. package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
  592. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
  593. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
  594. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
  595. package/dist/billing/modules/billing/index.d.ts.map +0 -1
  596. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
  597. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
  598. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
  599. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
  600. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
  601. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
  602. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
  603. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
  604. package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
  605. package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
  606. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
  607. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
  608. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
  609. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
  610. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
  611. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
  612. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
  613. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
  614. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
  615. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
  616. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
  617. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
  618. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
  619. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
  620. package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
  621. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
  622. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
  623. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
  624. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
  625. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
  626. package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
  627. package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
  628. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
  629. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
  630. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
  631. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
  632. package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
  633. package/dist/billing/modules/checkout/index.d.ts.map +0 -1
  634. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
  635. package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
  636. package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
  637. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
  638. package/dist/billing/modules/coupons/index.d.ts.map +0 -1
  639. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
  640. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
  641. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
  642. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
  643. package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
  644. package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
  645. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
  646. package/dist/billing/modules/credits/index.d.ts.map +0 -1
  647. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
  648. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
  649. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
  650. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
  651. package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
  652. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
  653. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
  654. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
  655. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
  656. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
  657. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
  658. package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
  659. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
  660. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
  661. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
  662. package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
  663. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
  664. package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
  665. package/dist/billing/modules/discounts/index.d.ts.map +0 -1
  666. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
  667. package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
  668. package/dist/billing/modules/earnings/api.d.ts.map +0 -1
  669. package/dist/billing/modules/earnings/index.d.ts.map +0 -1
  670. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
  671. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
  672. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
  673. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
  674. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
  675. package/dist/billing/modules/earnings/payoutAccountStatus.d.ts.map +0 -1
  676. package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
  677. package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
  678. package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
  679. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
  680. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
  681. package/dist/billing/modules/plans/index.d.ts.map +0 -1
  682. package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
  683. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
  684. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
  685. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
  686. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
  687. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
  688. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
  689. package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
  690. package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
  691. package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
  692. package/dist/billing/modules/promotions/index.d.ts.map +0 -1
  693. package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
  694. package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
  695. package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
  696. package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
  697. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
  698. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
  699. package/dist/billing/modules/quota/index.d.ts.map +0 -1
  700. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
  701. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
  702. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
  703. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
  704. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
  705. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
  706. package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
  707. package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
  708. package/dist/billing/modules/settings/index.d.ts.map +0 -1
  709. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
  710. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
  711. package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
  712. package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
  713. package/dist/billing/modules/store/index.d.ts.map +0 -1
  714. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
  715. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
  716. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
  717. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
  718. package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
  719. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
  720. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
  721. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
  722. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
  723. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
  724. package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
  725. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
  726. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
  727. package/dist/billing/modules/usage/index.d.ts.map +0 -1
  728. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
  729. package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
  730. package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
  731. package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
  732. package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
  733. package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
  734. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
  735. package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
  736. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
  737. package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
  738. package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
  739. package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
  740. package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
  741. package/dist/billing/shared/components/index.d.ts.map +0 -1
  742. package/dist/billing/shared/hooks/index.d.ts.map +0 -1
  743. package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
  744. package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
  745. package/dist/billing/shared/index.d.ts.map +0 -1
  746. package/dist/billing/shared/types/graphql.d.ts.map +0 -1
  747. package/dist/billing/shared/types/index.d.ts.map +0 -1
  748. package/dist/billing/shared/ui/Card.d.ts.map +0 -1
  749. package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
  750. package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
  751. package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
  752. package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
  753. package/dist/billing/shared/ui/index.d.ts.map +0 -1
  754. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
  755. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
  756. package/dist/billing/shared/utils/error.d.ts.map +0 -1
  757. package/dist/billing/shared/utils/format.d.ts.map +0 -1
  758. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
  759. package/dist/billing/shared/utils/index.d.ts.map +0 -1
  760. package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
  761. package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
  762. package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
  763. package/dist/billing/shared/utils/status.d.ts.map +0 -1
  764. package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
  765. package/dist/billing/translations/en.d.ts.map +0 -1
  766. package/dist/billing/types/index.d.ts.map +0 -1
  767. package/dist/dev/main.d.ts.map +0 -1
  768. package/dist/generated/global-operations.d.ts.map +0 -1
  769. package/dist/generated/global-types.d.ts.map +0 -1
  770. package/dist/generated/wspace-operations.d.ts.map +0 -1
  771. package/dist/generated/wspace-types.d.ts.map +0 -1
  772. package/dist/index.d.ts.map +0 -1
  773. package/dist/utils/nativeBridge.d.ts.map +0 -1
@@ -1,7 +1,8 @@
1
- import "./PlansListPage.js";
2
- import "./PlanDetailPage.js";
3
- import "./PlanEditPage.js";
4
- import "./PlanCreatePage.js";
5
- import "./PlansBrowsePage.js";
6
- import "./PlanBrowseDetailPage.js";
7
- import "./PlanAssignFreePage.js";
1
+ import { PlansListPage as e } from "./PlansListPage.js";
2
+ import { PlanDetailPage as t } from "./PlanDetailPage.js";
3
+ import { PlanEditPage as n } from "./PlanEditPage.js";
4
+ import { PlanCreatePage as r } from "./PlanCreatePage.js";
5
+ import { PlansBrowsePage as i } from "./PlansBrowsePage.js";
6
+ import { PlanBrowseDetailPage as a } from "./PlanBrowseDetailPage.js";
7
+ import { PlanAssignFreePage as o } from "./PlanAssignFreePage.js";
8
+ export { o as PlanAssignFreePage, a as PlanBrowseDetailPage, r as PlanCreatePage, t as PlanDetailPage, n as PlanEditPage, i as PlansBrowsePage, e as PlansListPage };
@@ -1,3 +1,2 @@
1
1
  import { CurrencyPriceOverrideInput } from '../../../shared/types';
2
2
  export declare function getChangedCurrencyPriceOverrides(initial: CurrencyPriceOverrideInput[], current: CurrencyPriceOverrideInput[]): CurrencyPriceOverrideInput[];
3
- //# sourceMappingURL=currencyPriceOverrides.d.ts.map
@@ -1,9 +1,8 @@
1
- //#region src/billing/modules/plans/utils/currencyPriceOverrides.ts
1
+ // src/billing/modules/plans/utils/currencyPriceOverrides.ts
2
2
  function e(e, t) {
3
3
  let n = new Map(e.map((e) => [e.currency, e.amount]));
4
4
  return t.filter((e) => n.get(e.currency) !== e.amount);
5
5
  }
6
- //#endregion
7
6
  export { e as getChangedCurrencyPriceOverrides };
8
7
 
9
8
  //# sourceMappingURL=currencyPriceOverrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"currencyPriceOverrides.js","names":[],"sources":["../../../../../src/billing/modules/plans/utils/currencyPriceOverrides.ts"],"sourcesContent":["import type { CurrencyPriceOverrideInput } from '../../../shared/types';\n\nexport function getChangedCurrencyPriceOverrides(\n initial: CurrencyPriceOverrideInput[],\n current: CurrencyPriceOverrideInput[]\n): CurrencyPriceOverrideInput[] {\n const initialByCurrency = new Map(\n initial.map((override) => [override.currency, override.amount])\n );\n\n return current.filter((override) => initialByCurrency.get(override.currency) !== override.amount);\n}\n"],"mappings":";AAEA,SAAgB,EACd,GACA,GAC8B;CAC9B,IAAM,IAAoB,IAAI,IAC5B,EAAQ,KAAK,MAAa,CAAC,EAAS,UAAU,EAAS,MAAM,CAAC,CAChE;CAEA,OAAO,EAAQ,QAAQ,MAAa,EAAkB,IAAI,EAAS,QAAQ,MAAM,EAAS,MAAM;AAClG"}
1
+ {"version":3,"file":"currencyPriceOverrides.js","names":["getChangedCurrencyPriceOverrides","initialByCurrency","initial","override","current"],"sources":["../../../../../src/billing/modules/plans/utils/currencyPriceOverrides.ts"],"sourcesContent":["import type { CurrencyPriceOverrideInput } from '../../../shared/types';\n\nexport function getChangedCurrencyPriceOverrides(\n initial: CurrencyPriceOverrideInput[],\n current: CurrencyPriceOverrideInput[]\n): CurrencyPriceOverrideInput[] {\n const initialByCurrency = new Map(\n initial.map((override) => [override.currency, override.amount])\n );\n\n return current.filter((override) => initialByCurrency.get(override.currency) !== override.amount);\n}\n"],"mappings":";AAEA,SAAgBA,EACd,GACA,GAC8B;CAC9B,IAAMC,IAAoB,IAAI,IAC5BC,EAAQ,KAAK,MAAa,CAACC,EAAS,UAAUA,EAAS,MAAM,CAAC,CAChE;CAEA,OAAOC,EAAQ,QAAQ,MAAaH,EAAkB,IAAIE,EAAS,QAAQ,MAAMA,EAAS,MAAM;AAClG"}
@@ -1,3 +1,2 @@
1
1
  import { Plan } from '../../../shared/types';
2
2
  export declare function filterPlans(plans: readonly Plan[], search: string): Plan[];
3
- //# sourceMappingURL=planSelector.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/billing/modules/plans/utils/planSelector.ts
1
+ // src/billing/modules/plans/utils/planSelector.ts
2
2
  var e = (e) => e?.toLowerCase() ?? "";
3
3
  function t(t, n) {
4
4
  let r = n.trim().toLowerCase();
@@ -10,7 +10,6 @@ function t(t, n) {
10
10
  t.duration
11
11
  ].some((t) => e(t).includes(r))) : [...t];
12
12
  }
13
- //#endregion
14
13
  export { t as filterPlans };
15
14
 
16
15
  //# sourceMappingURL=planSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"planSelector.js","names":[],"sources":["../../../../../src/billing/modules/plans/utils/planSelector.ts"],"sourcesContent":["import type { Plan } from '../../../shared/types';\n\nconst getSearchableValue = (value: string | null | undefined): string => value?.toLowerCase() ?? '';\n\nexport function filterPlans(plans: readonly Plan[], search: string): Plan[] {\n const normalizedSearch = search.trim().toLowerCase();\n\n if (!normalizedSearch) {\n return [...plans];\n }\n\n return plans.filter((plan) =>\n [plan.name, plan.id, plan.productID, plan.product?.name, plan.duration].some((value) =>\n getSearchableValue(value).includes(normalizedSearch)\n )\n );\n}\n"],"mappings":";AAEA,IAAM,KAAsB,MAA6C,GAAO,YAAY,KAAK;AAEjG,SAAgB,EAAY,GAAwB,GAAwB;CAC1E,IAAM,IAAmB,EAAO,KAAK,EAAE,YAAY;CAMnD,OAJK,IAIE,EAAM,QAAQ,MACnB;EAAC,EAAK;EAAM,EAAK;EAAI,EAAK;EAAW,EAAK,SAAS;EAAM,EAAK;CAAQ,EAAE,MAAM,MAC5E,EAAmB,CAAK,EAAE,SAAS,CAAgB,CACrD,CACF,IAPS,CAAC,GAAG,CAAK;AAQpB"}
1
+ {"version":3,"file":"planSelector.js","names":["getSearchableValue","value","filterPlans","normalizedSearch","search","plans","plan"],"sources":["../../../../../src/billing/modules/plans/utils/planSelector.ts"],"sourcesContent":["import type { Plan } from '../../../shared/types';\n\nconst getSearchableValue = (value: string | null | undefined): string => value?.toLowerCase() ?? '';\n\nexport function filterPlans(plans: readonly Plan[], search: string): Plan[] {\n const normalizedSearch = search.trim().toLowerCase();\n\n if (!normalizedSearch) {\n return [...plans];\n }\n\n return plans.filter((plan) =>\n [plan.name, plan.id, plan.productID, plan.product?.name, plan.duration].some((value) =>\n getSearchableValue(value).includes(normalizedSearch)\n )\n );\n}\n"],"mappings":";AAEA,IAAMA,KAAsB,MAA6CC,GAAO,YAAY,KAAK;AAEjG,SAAgBC,EAAY,GAAwB,GAAwB;CAC1E,IAAMC,IAAmBC,EAAO,KAAK,CAAC,CAAC,YAAY;CAMnD,OAJKD,IAIEE,EAAM,QAAQ,MACnB;EAACC,EAAK;EAAMA,EAAK;EAAIA,EAAK;EAAWA,EAAK,SAAS;EAAMA,EAAK;CAAQ,CAAC,CAAC,MAAM,MAC5EN,EAAmBC,CAAK,CAAC,CAAC,SAASE,CAAgB,CACrD,CACF,IAPS,CAAC,GAAGE,CAAK;AAQpB"}
@@ -1,2 +1 @@
1
1
  export * from './pages';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { FC } from 'react';
2
2
  export declare const CreatePromotionPage: FC;
3
- //# sourceMappingURL=CreatePromotionPage.d.ts.map
@@ -1,14 +1,14 @@
1
1
  import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
2
  import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
+ import { useBillingNavigate as n } from "../../../hooks/useBillingNavigate.js";
4
+ import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions.js";
3
5
  import "../../../shared/components/index.js";
4
- import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
5
- import { useCreatePromotionMutation as r } from "../../../../generated/global-operations.js";
6
- import { useBillingNavigate as i } from "../../../hooks/useBillingNavigate.js";
6
+ import { useCreatePromotionMutation as i } from "../../../../generated/global-operations.js";
7
7
  import { useState as a } from "react";
8
8
  import { ArrowLeft as o, Gift as s, Info as c, Save as l } from "lucide-react";
9
9
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
10
10
  import { PagePurpose as f } from "@burdenoff/fe-libs/ui";
11
- //#region src/billing/modules/promotions/pages/CreatePromotionPage.tsx
11
+ // src/billing/modules/promotions/pages/CreatePromotionPage.tsx
12
12
  var p = [
13
13
  "vibecontrols",
14
14
  "workspaces",
@@ -16,7 +16,7 @@ var p = [
16
16
  "fluidgrids",
17
17
  "healthybowl"
18
18
  ], m = () => {
19
- let m = i(), h = n(), [g] = r({ refetchQueries: ["ListPromotions"] }), [_, v] = a(!1), [y, b] = a({}), x = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], [S, C] = a({
19
+ let m = n(), h = r(), [g] = i({ refetchQueries: ["ListPromotions"] }), [_, v] = a(!1), [y, b] = a({}), x = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], [S, C] = a({
20
20
  name: "",
21
21
  description: "",
22
22
  startsAt: x,
@@ -292,7 +292,6 @@ var p = [
292
292
  ]
293
293
  });
294
294
  };
295
- //#endregion
296
295
  export { m as CreatePromotionPage };
297
296
 
298
297
  //# sourceMappingURL=CreatePromotionPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreatePromotionPage.js","names":[],"sources":["../../../../../src/billing/modules/promotions/pages/CreatePromotionPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { ArrowLeft, Save, Gift, Info } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useCreatePromotionMutation } from '../../../../generated/global-operations';\n\nconst KNOWN_PRODUCTS = ['vibecontrols', 'workspaces', 'botlit', 'fluidgrids', 'healthybowl'];\n\ninterface FormData {\n name: string;\n description: string;\n startsAt: string;\n expiresAt: string;\n bonusMonths: number;\n maxRedemptions: string;\n applicableProductIds: string[];\n applicablePlanIds: string;\n}\n\nexport const CreatePromotionPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [createPromotion] = useCreatePromotionMutation({ refetchQueries: ['ListPromotions'] });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<Partial<Record<keyof FormData, string>>>({});\n\n const today = new Date().toISOString().split('T')[0];\n const [form, setForm] = useState<FormData>({\n name: '',\n description: '',\n startsAt: today,\n expiresAt: '',\n bonusMonths: 1,\n maxRedemptions: '',\n applicableProductIds: [],\n applicablePlanIds: '',\n });\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to create promotions.\" />;\n }\n\n const set = <K extends keyof FormData>(k: K, v: FormData[K]) =>\n setForm((prev) => ({ ...prev, [k]: v }));\n\n const toggleProduct = (pid: string) => {\n set(\n 'applicableProductIds',\n form.applicableProductIds.includes(pid)\n ? form.applicableProductIds.filter((p) => p !== pid)\n : [...form.applicableProductIds, pid]\n );\n };\n\n const validate = () => {\n const e: typeof errors = {};\n if (!form.name.trim()) e.name = 'Name is required';\n if (!form.startsAt) e.startsAt = 'Start date is required';\n if (!form.expiresAt) e.expiresAt = 'End date is required';\n if (form.expiresAt && form.expiresAt <= form.startsAt)\n e.expiresAt = 'End date must be after start date';\n if (form.bonusMonths < 1) e.bonusMonths = 'Must be at least 1';\n setErrors(e);\n return Object.keys(e).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validate()) return;\n setIsSubmitting(true);\n try {\n const planIds = form.applicablePlanIds.split(',').flatMap((s) => {\n const trimmed = s.trim();\n return trimmed ? [trimmed] : [];\n });\n\n await createPromotion({\n variables: {\n input: {\n name: form.name.trim(),\n description: form.description.trim() || undefined,\n startsAt: new Date(form.startsAt).toISOString(),\n expiresAt: new Date(form.expiresAt).toISOString(),\n bonusMonths: form.bonusMonths,\n maxRedemptions: form.maxRedemptions ? parseInt(form.maxRedemptions) : undefined,\n applicableProductIds: form.applicableProductIds,\n applicablePlanIds: planIds,\n },\n },\n });\n navigateTo('/promotions');\n } catch (err) {\n setErrors({ name: err instanceof Error ? err.message : 'Failed to create promotion' });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div className=\"max-w-2xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n aria-label=\"Back to promotions\"\n className=\"p-2 rounded-button hover:bg-bg-sunken text-text-muted hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"size-5\" />\n </button>\n <PageHeader\n title=\"Create Promotion\"\n description=\"Offer bonus free renewal months to subscribers who sign up within the promotion window\"\n icon={<Gift className=\"size-6\" />}\n />\n </div>\n\n <PagePurpose>\n Set up a time-bounded campaign that rewards new subscribers with bonus free renewal months.\n Define the bonus, the window during which it applies, an optional redemption cap and which\n products it covers — then activate it to start offering it.\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"space-y-5\">\n {/* Basic info */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Promotion Details</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Name *</label>\n <input\n type=\"text\"\n value={form.name}\n onChange={(e) => set('name', e.target.value)}\n placeholder=\"e.g. June Launch Offer\"\n className={`w-full px-3 py-2 rounded-input border ${errors.name ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.name && <p className=\"text-xs text-status-error-text mt-1\">{errors.name}</p>}\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Description</label>\n <textarea\n value={form.description}\n onChange={(e) => set('description', e.target.value)}\n placeholder=\"Subscribe in June and get 2 extra months free!\"\n rows={2}\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n\n {/* Bonus config */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Bonus Configuration</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Bonus Months *\n </label>\n <input\n type=\"number\"\n value={form.bonusMonths}\n min={1}\n max={12}\n onChange={(e) => set('bonusMonths', parseInt(e.target.value) || 1)}\n className={`w-32 px-3 py-2 rounded-input border ${errors.bonusMonths ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.bonusMonths && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.bonusMonths}</p>\n )}\n <div className=\"mt-2 flex items-start gap-2 p-3 bg-[var(--color-accent-soft)] rounded-lg text-sm text-text-muted\">\n <Info className=\"size-4 shrink-0 mt-0.5 text-text-link\" />\n <span>\n Users who subscribe during this window get{' '}\n <strong className=\"text-text-primary\">\n {form.bonusMonths} free renewal{form.bonusMonths !== 1 ? 's' : ''}\n </strong>{' '}\n after their first paid period — their quota resets each month as normal.\n </span>\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Max Redemptions\n </label>\n <input\n type=\"number\"\n value={form.maxRedemptions}\n min={1}\n onChange={(e) => set('maxRedemptions', e.target.value)}\n placeholder=\"Unlimited\"\n className=\"w-48 px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">Leave empty for no cap</p>\n </div>\n </div>\n\n {/* Date window */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Active Window</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Start Date *\n </label>\n <input\n type=\"date\"\n value={form.startsAt}\n onChange={(e) => set('startsAt', e.target.value)}\n className={`w-full px-3 py-2 rounded-input border ${errors.startsAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.startsAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.startsAt}</p>\n )}\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">End Date *</label>\n <input\n type=\"date\"\n value={form.expiresAt}\n onChange={(e) => set('expiresAt', e.target.value)}\n min={form.startsAt}\n className={`w-full px-3 py-2 rounded-input border ${errors.expiresAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.expiresAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.expiresAt}</p>\n )}\n </div>\n </div>\n <p className=\"text-xs text-text-muted\">\n Only purchases made between these dates will receive the bonus months\n </p>\n </div>\n\n {/* Scope */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Scope</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Applicable Products\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {KNOWN_PRODUCTS.map((pid) => (\n <button\n key={pid}\n type=\"button\"\n onClick={() => toggleProduct(pid)}\n className={`px-3 py-1.5 rounded-lg border text-sm transition-colors ${\n form.applicableProductIds.includes(pid)\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium'\n : 'border-border-subtle hover:border-action-primary-bg/50'\n }`}\n >\n {pid}\n </button>\n ))}\n </div>\n <p className=\"text-xs text-text-muted mt-1\">\n {form.applicableProductIds.length === 0\n ? 'No selection = applies to all products'\n : `Applies to: ${form.applicableProductIds.join(', ')}`}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Plan IDs (optional)\n </label>\n <input\n type=\"text\"\n value={form.applicablePlanIds}\n onChange={(e) => set('applicablePlanIds', e.target.value)}\n placeholder=\"plan-vibecontrols-pro-monthly, plan-vibecontrols-pro-yearly\"\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">\n Comma-separated. Leave empty to apply to all plans\n </p>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3 justify-end\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n className=\"px-5 py-2 rounded-button border border-border-subtle text-text-primary hover:bg-bg-sunken text-sm font-medium transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting}\n className=\"px-5 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 text-sm font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50\"\n >\n {isSubmitting ? (\n <div className=\"size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n Create Promotion\n </button>\n </div>\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAQA,IAAM,IAAiB;CAAC;CAAgB;CAAc;CAAU;CAAc;AAAa,GAa9E,UAAgC;CAC3C,IAAM,IAAa,EAAmB,GAChC,IAAc,EAAsB,GACpC,CAAC,KAAmB,EAA2B,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,GACrF,CAAC,GAAc,KAAmB,EAAS,EAAK,GAChD,CAAC,GAAQ,KAAa,EAAkD,CAAC,CAAC,GAE1E,qBAAQ,IAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,IAC5C,CAAC,GAAM,KAAW,EAAmB;EACzC,MAAM;EACN,aAAa;EACb,UAAU;EACV,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB,CAAC;EACvB,mBAAmB;CACrB,CAAC;CAED,IAAI,CAAC,EAAY,gBACf,OAAO,kBAAC,GAAD,EAAc,SAAQ,kDAAmD,CAAA;CAGlF,IAAM,KAAiC,GAAM,MAC3C,GAAS,OAAU;EAAE,GAAG;GAAO,IAAI;CAAE,EAAE,GAEnC,KAAiB,MAAgB;EACrC,EACE,wBACA,EAAK,qBAAqB,SAAS,CAAG,IAClC,EAAK,qBAAqB,QAAQ,MAAM,MAAM,CAAG,IACjD,CAAC,GAAG,EAAK,sBAAsB,CAAG,CACxC;CACF,GAEM,UAAiB;EACrB,IAAM,IAAmB,CAAC;EAQ1B,OAPK,EAAK,KAAK,KAAK,MAAG,EAAE,OAAO,qBAC3B,EAAK,aAAU,EAAE,WAAW,2BAC5B,EAAK,cAAW,EAAE,YAAY,yBAC/B,EAAK,aAAa,EAAK,aAAa,EAAK,aAC3C,EAAE,YAAY,sCACZ,EAAK,cAAc,MAAG,EAAE,cAAc,uBAC1C,EAAU,CAAC,GACJ,OAAO,KAAK,CAAC,EA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AAA;MACA;;KAGL,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,MAAD;QAAI,WAAU;kBAAkC;OAAS,CAAA;OAEzD,kBAAC,OAAD,EAAA,UAAA;QACE,kBAAC,SAAD;SAAO,WAAU;mBAAmD;QAE7D,CAAA;QACP,kBAAC,OAAD;SAAK,WAAU;mBACZ,EAAe,KAAK,MACnB,kBAAC,UAAD;UAEE,MAAK;UACL,eAAe,EAAc,CAAG;UAChC,WAAW,2DACT,EAAK,qBAAqB,SAAS,CAAG,IAClC,sFACA;oBAGL;SACK,GAVD,CAUC,CACT;QACE,CAAA;QACL,kBAAC,KAAD;SAAG,WAAU;mBACV,EAAK,qBAAqB,WAAW,IAClC,2CACA,eAAe,EAAK,qBAAqB,KAAK,IAAI;QACrD,CAAA;OACA,EAAA,CAAA;OAEL,kBAAC,OAAD,EAAA,UAAA;QACE,kBAAC,SAAD;SAAO,WAAU;mBAAmD;QAE7D,CAAA;QACP,kBAAC,SAAD;SACE,MAAK;SACL,OAAO,EAAK;SACZ,WAAW,MAAM,EAAI,qBAAqB,EAAE,OAAO,KAAK;SACxD,aAAY;SACZ,WAAU;QACX,CAAA;QACD,kBAAC,KAAD;SAAG,WAAU;mBAA+B;QAEzC,CAAA;OACA,EAAA,CAAA;MACF;;KAGL,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,EAAW,aAAa;OACvC,WAAU;iBACX;MAEO,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,UAAU;OACV,WAAU;iBAHZ,CAKG,IACC,kBAAC,OAAD,EAAK,WAAU,4FAA6F,CAAA,IAE5G,kBAAC,GAAD,EAAM,WAAU,SAAU,CAAA,GAC1B,kBAEI;QACL;;IACD;;EACH;;AAET"}
1
+ {"version":3,"file":"CreatePromotionPage.js","names":["KNOWN_PRODUCTS","CreatePromotionPage","navigateTo","useBillingNavigate","permissions","useBillingPermissions","createPromotion","useCreatePromotionMutation","isSubmitting","setIsSubmitting","useState","errors","setErrors","today","form","setForm","AccessDenied","set","prev","k","v","toggleProduct","pid","p","validate","ArrowLeft","PageHeader","Gift","PagePurpose","planIds","trimmed","s","err","Info","Save"],"sources":["../../../../../src/billing/modules/promotions/pages/CreatePromotionPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { ArrowLeft, Save, Gift, Info } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useCreatePromotionMutation } from '../../../../generated/global-operations';\n\nconst KNOWN_PRODUCTS = ['vibecontrols', 'workspaces', 'botlit', 'fluidgrids', 'healthybowl'];\n\ninterface FormData {\n name: string;\n description: string;\n startsAt: string;\n expiresAt: string;\n bonusMonths: number;\n maxRedemptions: string;\n applicableProductIds: string[];\n applicablePlanIds: string;\n}\n\nexport const CreatePromotionPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [createPromotion] = useCreatePromotionMutation({ refetchQueries: ['ListPromotions'] });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<Partial<Record<keyof FormData, string>>>({});\n\n const today = new Date().toISOString().split('T')[0];\n const [form, setForm] = useState<FormData>({\n name: '',\n description: '',\n startsAt: today,\n expiresAt: '',\n bonusMonths: 1,\n maxRedemptions: '',\n applicableProductIds: [],\n applicablePlanIds: '',\n });\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to create promotions.\" />;\n }\n\n const set = <K extends keyof FormData>(k: K, v: FormData[K]) =>\n setForm((prev) => ({ ...prev, [k]: v }));\n\n const toggleProduct = (pid: string) => {\n set(\n 'applicableProductIds',\n form.applicableProductIds.includes(pid)\n ? form.applicableProductIds.filter((p) => p !== pid)\n : [...form.applicableProductIds, pid]\n );\n };\n\n const validate = () => {\n const e: typeof errors = {};\n if (!form.name.trim()) e.name = 'Name is required';\n if (!form.startsAt) e.startsAt = 'Start date is required';\n if (!form.expiresAt) e.expiresAt = 'End date is required';\n if (form.expiresAt && form.expiresAt <= form.startsAt)\n e.expiresAt = 'End date must be after start date';\n if (form.bonusMonths < 1) e.bonusMonths = 'Must be at least 1';\n setErrors(e);\n return Object.keys(e).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validate()) return;\n setIsSubmitting(true);\n try {\n const planIds = form.applicablePlanIds.split(',').flatMap((s) => {\n const trimmed = s.trim();\n return trimmed ? [trimmed] : [];\n });\n\n await createPromotion({\n variables: {\n input: {\n name: form.name.trim(),\n description: form.description.trim() || undefined,\n startsAt: new Date(form.startsAt).toISOString(),\n expiresAt: new Date(form.expiresAt).toISOString(),\n bonusMonths: form.bonusMonths,\n maxRedemptions: form.maxRedemptions ? parseInt(form.maxRedemptions) : undefined,\n applicableProductIds: form.applicableProductIds,\n applicablePlanIds: planIds,\n },\n },\n });\n navigateTo('/promotions');\n } catch (err) {\n setErrors({ name: err instanceof Error ? err.message : 'Failed to create promotion' });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div className=\"max-w-2xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n aria-label=\"Back to promotions\"\n className=\"p-2 rounded-button hover:bg-bg-sunken text-text-muted hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"size-5\" />\n </button>\n <PageHeader\n title=\"Create Promotion\"\n description=\"Offer bonus free renewal months to subscribers who sign up within the promotion window\"\n icon={<Gift className=\"size-6\" />}\n />\n </div>\n\n <PagePurpose>\n Set up a time-bounded campaign that rewards new subscribers with bonus free renewal months.\n Define the bonus, the window during which it applies, an optional redemption cap and which\n products it covers — then activate it to start offering it.\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"space-y-5\">\n {/* Basic info */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Promotion Details</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Name *</label>\n <input\n type=\"text\"\n value={form.name}\n onChange={(e) => set('name', e.target.value)}\n placeholder=\"e.g. June Launch Offer\"\n className={`w-full px-3 py-2 rounded-input border ${errors.name ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.name && <p className=\"text-xs text-status-error-text mt-1\">{errors.name}</p>}\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">Description</label>\n <textarea\n value={form.description}\n onChange={(e) => set('description', e.target.value)}\n placeholder=\"Subscribe in June and get 2 extra months free!\"\n rows={2}\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n\n {/* Bonus config */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Bonus Configuration</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Bonus Months *\n </label>\n <input\n type=\"number\"\n value={form.bonusMonths}\n min={1}\n max={12}\n onChange={(e) => set('bonusMonths', parseInt(e.target.value) || 1)}\n className={`w-32 px-3 py-2 rounded-input border ${errors.bonusMonths ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.bonusMonths && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.bonusMonths}</p>\n )}\n <div className=\"mt-2 flex items-start gap-2 p-3 bg-[var(--color-accent-soft)] rounded-lg text-sm text-text-muted\">\n <Info className=\"size-4 shrink-0 mt-0.5 text-text-link\" />\n <span>\n Users who subscribe during this window get{' '}\n <strong className=\"text-text-primary\">\n {form.bonusMonths} free renewal{form.bonusMonths !== 1 ? 's' : ''}\n </strong>{' '}\n after their first paid period — their quota resets each month as normal.\n </span>\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Max Redemptions\n </label>\n <input\n type=\"number\"\n value={form.maxRedemptions}\n min={1}\n onChange={(e) => set('maxRedemptions', e.target.value)}\n placeholder=\"Unlimited\"\n className=\"w-48 px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">Leave empty for no cap</p>\n </div>\n </div>\n\n {/* Date window */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Active Window</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Start Date *\n </label>\n <input\n type=\"date\"\n value={form.startsAt}\n onChange={(e) => set('startsAt', e.target.value)}\n className={`w-full px-3 py-2 rounded-input border ${errors.startsAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.startsAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.startsAt}</p>\n )}\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">End Date *</label>\n <input\n type=\"date\"\n value={form.expiresAt}\n onChange={(e) => set('expiresAt', e.target.value)}\n min={form.startsAt}\n className={`w-full px-3 py-2 rounded-input border ${errors.expiresAt ? 'border-status-error-border' : 'border-border-subtle'} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`}\n />\n {errors.expiresAt && (\n <p className=\"text-xs text-status-error-text mt-1\">{errors.expiresAt}</p>\n )}\n </div>\n </div>\n <p className=\"text-xs text-text-muted\">\n Only purchases made between these dates will receive the bonus months\n </p>\n </div>\n\n {/* Scope */}\n <div className=\"bg-bg-surface border border-border-seam rounded-card p-5 space-y-4 shadow-[var(--shadow-elevation-1)]\">\n <h3 className=\"font-semibold text-text-primary\">Scope</h3>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Applicable Products\n </label>\n <div className=\"flex flex-wrap gap-2\">\n {KNOWN_PRODUCTS.map((pid) => (\n <button\n key={pid}\n type=\"button\"\n onClick={() => toggleProduct(pid)}\n className={`px-3 py-1.5 rounded-lg border text-sm transition-colors ${\n form.applicableProductIds.includes(pid)\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium'\n : 'border-border-subtle hover:border-action-primary-bg/50'\n }`}\n >\n {pid}\n </button>\n ))}\n </div>\n <p className=\"text-xs text-text-muted mt-1\">\n {form.applicableProductIds.length === 0\n ? 'No selection = applies to all products'\n : `Applies to: ${form.applicableProductIds.join(', ')}`}\n </p>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n Plan IDs (optional)\n </label>\n <input\n type=\"text\"\n value={form.applicablePlanIds}\n onChange={(e) => set('applicablePlanIds', e.target.value)}\n placeholder=\"plan-vibecontrols-pro-monthly, plan-vibecontrols-pro-yearly\"\n className=\"w-full px-3 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"text-xs text-text-muted mt-1\">\n Comma-separated. Leave empty to apply to all plans\n </p>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3 justify-end\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/promotions')}\n className=\"px-5 py-2 rounded-button border border-border-subtle text-text-primary hover:bg-bg-sunken text-sm font-medium transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting}\n className=\"px-5 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 text-sm font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50\"\n >\n {isSubmitting ? (\n <div className=\"size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n Create Promotion\n </button>\n </div>\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAQA,IAAMA,IAAiB;CAAC;CAAgB;CAAc;CAAU;CAAc;AAAa,GAa9EC,UAAgC;CAC3C,IAAMC,IAAaC,EAAmB,GAChCC,IAAcC,EAAsB,GACpC,CAACC,KAAmBC,EAA2B,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,GACrF,CAACC,GAAcC,KAAmBC,EAAS,EAAK,GAChD,CAACC,GAAQC,KAAaF,EAAkD,CAAC,CAAC,GAE1EG,qBAAQ,IAAI,KAAK,EAAA,CAAE,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAC5C,CAACC,GAAMC,KAAWL,EAAmB;EACzC,MAAM;EACN,aAAa;EACb,UAAUG;EACV,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB,CAAC;EACvB,mBAAmB;CACrB,CAAC;CAED,IAAI,CAACT,EAAY,gBACf,OAAO,kBAACY,GAAD,EAAc,SAAQ,kDAAmD,CAAA;CAGlF,IAAMC,KAAiC,GAAM,MAC3CF,GAAS,OAAU;EAAE,GAAGG;GAAOC,IAAIC;CAAE,EAAE,GAEnCC,KAAiB,MAAgB;EACrC,EACE,wBACAP,EAAK,qBAAqB,SAASQ,CAAG,IAClCR,EAAK,qBAAqB,QAAQ,MAAMS,MAAMD,CAAG,IACjD,CAAC,GAAGR,EAAK,sBAAsBQ,CAAG,CACxC;CACF,G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,EAAI,qBAAqB,EAAE,OAAO,KAAK;SACxD,aAAY;SACZ,WAAU;QACX,CAAA;QACD,kBAAC,KAAD;SAAG,WAAU;SAA+B,UAAA;QAEzC,CAAA;OACA,EAAA,CAAA;MACF;;KAGL,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,UAAD;OACE,MAAK;OACL,eAAef,EAAW,aAAa;OACvC,WAAU;OACX,UAAA;MAEO,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,UAAUM;OACV,WAAU;OAHZ,UAAA,CAKGA,IACC,kBAAC,OAAD,EAAK,WAAU,4FAA6F,CAAA,IAE5G,kBAAC0B,GAAD,EAAM,WAAU,SAAU,CAAA,GAC1B,kBAEI;MACL,CAAA,CAAA;;IACD;;EACH;;AAET"}
@@ -1,3 +1,2 @@
1
1
  import { FC } from 'react';
2
2
  export declare const PromotionsListPage: FC;
3
- //# sourceMappingURL=PromotionsListPage.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
2
  import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
+ import { useBillingNavigate as n } from "../../../hooks/useBillingNavigate.js";
4
+ import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions.js";
3
5
  import "../../../shared/components/index.js";
4
- import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
5
- import { useDeactivatePromotionMutation as r, useListPromotionsQuery as i, useUpdatePromotionMutation as a } from "../../../../generated/global-operations.js";
6
- import { useBillingNavigate as o } from "../../../hooks/useBillingNavigate.js";
6
+ import { useDeactivatePromotionMutation as i, useListPromotionsQuery as a, useUpdatePromotionMutation as o } from "../../../../generated/global-operations.js";
7
7
  import { useState as s } from "react";
8
8
  import { Calendar as c, Gift as l, Plus as u, Tag as d, ToggleLeft as f, ToggleRight as p, Users as m } from "lucide-react";
9
9
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
10
  import { IllustratedEmptyState as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
11
- //#region src/billing/modules/promotions/pages/PromotionsListPage.tsx
11
+ // src/billing/modules/promotions/pages/PromotionsListPage.tsx
12
12
  var y = () => {
13
- let y = o(), b = n(), [x, S] = s(!1), [C, w] = s(null), { data: T, loading: E, refetch: D } = i({ variables: { includeInactive: x } }), [O] = r(), [k] = a();
13
+ let y = n(), b = r(), [x, S] = s(!1), [C, w] = s(null), { data: T, loading: E, refetch: D } = a({ variables: { includeInactive: x } }), [O] = i(), [k] = o();
14
14
  if (!b.canManagePlans) return /* @__PURE__ */ h(e, { message: "You don't have permission to manage promotions." });
15
15
  let A = T?.listPromotions ?? [], j = async (e, t) => {
16
16
  w(e);
@@ -155,7 +155,6 @@ var y = () => {
155
155
  ]
156
156
  });
157
157
  };
158
- //#endregion
159
158
  export { y as PromotionsListPage };
160
159
 
161
160
  //# sourceMappingURL=PromotionsListPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromotionsListPage.js","names":[],"sources":["../../../../../src/billing/modules/promotions/pages/PromotionsListPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { Plus, Tag, Calendar, Users, ToggleLeft, ToggleRight, Gift } from 'lucide-react';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n useListPromotionsQuery,\n useDeactivatePromotionMutation,\n useUpdatePromotionMutation,\n} from '../../../../generated/global-operations';\n\nexport const PromotionsListPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [showInactive, setShowInactive] = useState(false);\n const [actionId, setActionId] = useState<string | null>(null);\n\n const { data, loading, refetch } = useListPromotionsQuery({\n variables: { includeInactive: showInactive },\n });\n\n const [deactivatePromotion] = useDeactivatePromotionMutation();\n const [updatePromotion] = useUpdatePromotionMutation();\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to manage promotions.\" />;\n }\n\n const promotions = data?.listPromotions ?? [];\n\n const handleToggle = async (id: string, currentlyActive: boolean) => {\n setActionId(id);\n try {\n if (currentlyActive) {\n await deactivatePromotion({ variables: { id } });\n } else {\n await updatePromotion({ variables: { id, input: { isActive: true } } });\n }\n await refetch();\n } finally {\n setActionId(null);\n }\n };\n\n const now = new Date();\n const statusLabel = (p: { isActive: boolean; startsAt: string; expiresAt: string }) => {\n if (!p.isActive) return { text: 'Inactive', cls: 'bg-bg-sunken text-text-muted' };\n if (new Date(p.expiresAt) < now)\n return { text: 'Expired', cls: 'bg-status-error-bg-subtle text-status-error-text' };\n if (new Date(p.startsAt) > now)\n return { text: 'Upcoming', cls: 'bg-[var(--color-accent-soft)] text-text-link' };\n return { text: 'Live', cls: 'bg-status-success-bg-subtle text-status-success-text' };\n };\n\n return (\n <div className=\"max-w-5xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center justify-between gap-4\">\n <PageHeader\n title=\"Promotions\"\n description=\"Time-bounded offers that grant bonus free renewal months to subscribers\"\n icon={<Gift className=\"size-6\" />}\n />\n <button\n onClick={() => navigateTo('/promotions/create')}\n className=\"flex items-center gap-2 px-4 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover text-sm font-medium shrink-0 transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <Plus className=\"size-4\" />\n New Promotion\n </button>\n </div>\n\n <PagePurpose>\n Promotions are limited-time offers that reward subscribers with bonus free renewal months —\n great for launches or win-back campaigns. Set the bonus, the active window and an optional\n redemption cap, then activate or deactivate them as your campaign runs.\n </PagePurpose>\n\n {/* Filter */}\n <div className=\"flex items-center gap-3\">\n <label className=\"flex items-center gap-2 text-sm text-text-muted cursor-pointer select-none\">\n <input\n type=\"checkbox\"\n checked={showInactive}\n onChange={(e) => setShowInactive(e.target.checked)}\n className=\"rounded border-border-subtle\"\n />\n Show inactive / expired\n </label>\n </div>\n\n {loading ? (\n <div className=\"text-center py-16 text-text-muted\">Loading promotions…</div>\n ) : promotions.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No promotions yet\"\n description=\"Create one to offer bonus months to early subscribers\"\n action={\n <button\n onClick={() => navigateTo('/promotions/create')}\n className=\"px-4 py-2 rounded-button bg-action-primary-bg text-action-primary-text text-sm font-medium transition-colors duration-200 hover:bg-action-primary-bgHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n Create Promotion\n </button>\n }\n />\n ) : (\n <div className=\"space-y-3\">\n {promotions.map((p: (typeof promotions)[number]) => {\n const { text, cls } = statusLabel(p);\n const busy = actionId === p.id;\n return (\n <div\n key={p.id}\n className=\"bg-bg-surface border border-border-seam rounded-card p-5 flex flex-col sm:flex-row sm:items-center gap-4 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)]\"\n >\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <span className=\"font-semibold text-text-primary truncate\">{p.name}</span>\n <span className={`text-xs font-medium px-2 py-0.5 rounded-full ${cls}`}>\n {text}\n </span>\n </div>\n {p.description && (\n <p className=\"text-sm text-text-muted mb-2 line-clamp-1\">{p.description}</p>\n )}\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-xs text-text-muted\">\n <span className=\"flex items-center gap-1\">\n <Gift className=\"size-3\" />\n <strong className=\"text-text-primary\">{p.bonusMonths}</strong> bonus month\n {p.bonusMonths !== 1 ? 's' : ''}\n </span>\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"size-3\" />\n {new Date(p.startsAt).toLocaleDateString()} –{' '}\n {new Date(p.expiresAt).toLocaleDateString()}\n </span>\n <span className=\"flex items-center gap-1\">\n <Users className=\"size-3\" />\n {p.currentRedemptions}\n {p.maxRedemptions ? ` / ${p.maxRedemptions}` : ''} redemptions\n </span>\n {p.applicableProductIds.length > 0 && (\n <span className=\"flex items-center gap-1\">\n <Tag className=\"size-3\" />\n {p.applicableProductIds.join(', ')}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n <button\n onClick={() => handleToggle(p.id, p.isActive)}\n disabled={busy}\n title={p.isActive ? 'Deactivate' : 'Reactivate'}\n className={`p-2 rounded-button transition-colors ${\n p.isActive\n ? 'text-status-success-text hover:bg-status-success-bg-subtle'\n : 'text-text-muted hover:bg-bg-sunken'\n } disabled:opacity-50`}\n >\n {p.isActive ? (\n <ToggleRight className=\"size-5\" />\n ) : (\n <ToggleLeft className=\"size-5\" />\n )}\n </button>\n </div>\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,UAA+B;CAC1C,IAAM,IAAa,EAAmB,GAChC,IAAc,EAAsB,GACpC,CAAC,GAAc,KAAmB,EAAS,EAAK,GAChD,CAAC,GAAU,KAAe,EAAwB,IAAI,GAEtD,EAAE,SAAM,YAAS,eAAY,EAAuB,EACxD,WAAW,EAAE,iBAAiB,EAAa,EAC7C,CAAC,GAEK,CAAC,KAAuB,EAA+B,GACvD,CAAC,KAAmB,EAA2B;CAErD,IAAI,CAAC,EAAY,gBACf,OAAO,kBAAC,GAAD,EAAc,SAAQ,kDAAmD,CAAA;CAGlF,IAAM,IAAa,GAAM,kBAAkB,CAAC,GAEtC,IAAe,OAAO,GAAY,MAA6B;EACnE,EAAY,CAAE;EACd,IAAI;GAMF,AALI,IACF,MAAM,EAAoB,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,IAE/C,MAAM,EAAgB,EAAE,WAAW;IAAE;IAAI,OAAO,EAAE,UAAU,GAAK;GAAE,EAAE,CAAC,GAExE,MAAM,EAAQ;EAChB,UAAU;GACR,EAAY,IAAI;EAClB;CACF,GAEM,oBAAM,IAAI,KAAK,GACf,KAA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L,CAAA,CACF;QAxDE,EAAE,EAwDJ;IAET,CAAC;GACE,CAAA;EAEJ;;AAET"}
1
+ {"version":3,"file":"PromotionsListPage.js","names":["PromotionsListPage","navigateTo","useBillingNavigate","permissions","useBillingPermissions","showInactive","setShowInactive","useState","actionId","setActionId","useListPromotionsQuery","deactivatePromotion","useDeactivatePromotionMutation","updatePromotion","useUpdatePromotionMutation","AccessDenied","promotions","data","handleToggle","id","currentlyActive","refetch","now","statusLabel","p","PageHeader","Gift","Plus","PagePurpose","loading","IllustratedEmptyState","busy","cls","text","Calendar","Users","Tag","ToggleRight","ToggleLeft"],"sources":["../../../../../src/billing/modules/promotions/pages/PromotionsListPage.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { Plus, Tag, Calendar, Users, ToggleLeft, ToggleRight, Gift } from 'lucide-react';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n useListPromotionsQuery,\n useDeactivatePromotionMutation,\n useUpdatePromotionMutation,\n} from '../../../../generated/global-operations';\n\nexport const PromotionsListPage: FC = () => {\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [showInactive, setShowInactive] = useState(false);\n const [actionId, setActionId] = useState<string | null>(null);\n\n const { data, loading, refetch } = useListPromotionsQuery({\n variables: { includeInactive: showInactive },\n });\n\n const [deactivatePromotion] = useDeactivatePromotionMutation();\n const [updatePromotion] = useUpdatePromotionMutation();\n\n if (!permissions.canManagePlans) {\n return <AccessDenied message=\"You don't have permission to manage promotions.\" />;\n }\n\n const promotions = data?.listPromotions ?? [];\n\n const handleToggle = async (id: string, currentlyActive: boolean) => {\n setActionId(id);\n try {\n if (currentlyActive) {\n await deactivatePromotion({ variables: { id } });\n } else {\n await updatePromotion({ variables: { id, input: { isActive: true } } });\n }\n await refetch();\n } finally {\n setActionId(null);\n }\n };\n\n const now = new Date();\n const statusLabel = (p: { isActive: boolean; startsAt: string; expiresAt: string }) => {\n if (!p.isActive) return { text: 'Inactive', cls: 'bg-bg-sunken text-text-muted' };\n if (new Date(p.expiresAt) < now)\n return { text: 'Expired', cls: 'bg-status-error-bg-subtle text-status-error-text' };\n if (new Date(p.startsAt) > now)\n return { text: 'Upcoming', cls: 'bg-[var(--color-accent-soft)] text-text-link' };\n return { text: 'Live', cls: 'bg-status-success-bg-subtle text-status-success-text' };\n };\n\n return (\n <div className=\"max-w-5xl mx-auto p-4 sm:p-6 space-y-6\">\n <div className=\"flex items-center justify-between gap-4\">\n <PageHeader\n title=\"Promotions\"\n description=\"Time-bounded offers that grant bonus free renewal months to subscribers\"\n icon={<Gift className=\"size-6\" />}\n />\n <button\n onClick={() => navigateTo('/promotions/create')}\n className=\"flex items-center gap-2 px-4 py-2 rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover text-sm font-medium shrink-0 transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <Plus className=\"size-4\" />\n New Promotion\n </button>\n </div>\n\n <PagePurpose>\n Promotions are limited-time offers that reward subscribers with bonus free renewal months —\n great for launches or win-back campaigns. Set the bonus, the active window and an optional\n redemption cap, then activate or deactivate them as your campaign runs.\n </PagePurpose>\n\n {/* Filter */}\n <div className=\"flex items-center gap-3\">\n <label className=\"flex items-center gap-2 text-sm text-text-muted cursor-pointer select-none\">\n <input\n type=\"checkbox\"\n checked={showInactive}\n onChange={(e) => setShowInactive(e.target.checked)}\n className=\"rounded border-border-subtle\"\n />\n Show inactive / expired\n </label>\n </div>\n\n {loading ? (\n <div className=\"text-center py-16 text-text-muted\">Loading promotions…</div>\n ) : promotions.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No promotions yet\"\n description=\"Create one to offer bonus months to early subscribers\"\n action={\n <button\n onClick={() => navigateTo('/promotions/create')}\n className=\"px-4 py-2 rounded-button bg-action-primary-bg text-action-primary-text text-sm font-medium transition-colors duration-200 hover:bg-action-primary-bgHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n Create Promotion\n </button>\n }\n />\n ) : (\n <div className=\"space-y-3\">\n {promotions.map((p: (typeof promotions)[number]) => {\n const { text, cls } = statusLabel(p);\n const busy = actionId === p.id;\n return (\n <div\n key={p.id}\n className=\"bg-bg-surface border border-border-seam rounded-card p-5 flex flex-col sm:flex-row sm:items-center gap-4 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)]\"\n >\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <span className=\"font-semibold text-text-primary truncate\">{p.name}</span>\n <span className={`text-xs font-medium px-2 py-0.5 rounded-full ${cls}`}>\n {text}\n </span>\n </div>\n {p.description && (\n <p className=\"text-sm text-text-muted mb-2 line-clamp-1\">{p.description}</p>\n )}\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-xs text-text-muted\">\n <span className=\"flex items-center gap-1\">\n <Gift className=\"size-3\" />\n <strong className=\"text-text-primary\">{p.bonusMonths}</strong> bonus month\n {p.bonusMonths !== 1 ? 's' : ''}\n </span>\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"size-3\" />\n {new Date(p.startsAt).toLocaleDateString()} –{' '}\n {new Date(p.expiresAt).toLocaleDateString()}\n </span>\n <span className=\"flex items-center gap-1\">\n <Users className=\"size-3\" />\n {p.currentRedemptions}\n {p.maxRedemptions ? ` / ${p.maxRedemptions}` : ''} redemptions\n </span>\n {p.applicableProductIds.length > 0 && (\n <span className=\"flex items-center gap-1\">\n <Tag className=\"size-3\" />\n {p.applicableProductIds.join(', ')}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n <button\n onClick={() => handleToggle(p.id, p.isActive)}\n disabled={busy}\n title={p.isActive ? 'Deactivate' : 'Reactivate'}\n className={`p-2 rounded-button transition-colors ${\n p.isActive\n ? 'text-status-success-text hover:bg-status-success-bg-subtle'\n : 'text-text-muted hover:bg-bg-sunken'\n } disabled:opacity-50`}\n >\n {p.isActive ? (\n <ToggleRight className=\"size-5\" />\n ) : (\n <ToggleLeft className=\"size-5\" />\n )}\n </button>\n </div>\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAYA,IAAaA,UAA+B;CAC1C,IAAMC,IAAaC,EAAmB,GAChCC,IAAcC,EAAsB,GACpC,CAACC,GAAcC,KAAmBC,EAAS,EAAK,GAChD,CAACC,GAAUC,KAAeF,EAAwB,IAAI,GAEtD,EAAE,SAAM,YAAS,eAAYG,EAAuB,EACxD,WAAW,EAAE,iBAAiBL,EAAa,EAC7C,CAAC,GAEK,CAACM,KAAuBC,EAA+B,GACvD,CAACC,KAAmBC,EAA2B;CAErD,IAAI,CAACX,EAAY,gBACf,OAAO,kBAACY,GAAD,EAAc,SAAQ,kDAAmD,CAAA;CAGlF,IAAMC,IAAaC,GAAM,kBAAkB,CAAC,GAEtCC,IAAe,OAAO,GAAY,MAA6B;EACnE,EAAYC,CAAE;EACd,IAAI;GAMF,AALIC,IACF,MAAMT,EAAoB,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,IAE/C,MAAME,EAAgB,EAAE,WAAW;IAAE;IAAI,OAAO,EAAE,UAAU,GAAK;GAAE,EAAE,CAAC,GAExE,MAAMQ,EAAQ;EAChB,UAAU;GACR,EAAY,IAAI;EAClB;CACF,GAEMC,oBAAM,IAAI,KAAK,GACfC,KAAe,MACdC,EAAE,WACH,IAAI,KAAKA,EAAE,SAAS,IAAIF,IACnB;EAAE,MAAM;EAAW,KAAK;CAAmD,IAChF,IAAI,KAAKE,EAAE,QAAQ,IAAIF,IAClB;EAAE,MAAM;EAAY,KAAK;CAA+C,IAC1E;EAAE,MAAM;EAAQ,KAAK;CAAuD,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AAA,CACF;KAxDE,GAAAd,EAAE,EAwDJ;IAET,CAAC;GACE,CAAA;EAEJ;;AAET"}
@@ -1,3 +1,2 @@
1
1
  export { PromotionsListPage } from './PromotionsListPage';
2
2
  export { CreatePromotionPage } from './CreatePromotionPage';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
- import "./PromotionsListPage.js";
2
- import "./CreatePromotionPage.js";
1
+ import { PromotionsListPage as e } from "./PromotionsListPage.js";
2
+ import { CreatePromotionPage as t } from "./CreatePromotionPage.js";
3
+ export { t as CreatePromotionPage, e as PromotionsListPage };
@@ -3,4 +3,3 @@
3
3
  */
4
4
  export { useQuotaTemplates, useQuotaTemplate, useQuotaTemplateMutations, } from './useQuotaTemplates';
5
5
  export { useQuotaAssignments, useQuotaAssignmentsWithAnalytics, useQuotaAnalytics, useBillingAccountQuotasSummary, useQuotaCheck, useQuotaMutations, } from './useQuota';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
+ export { useQuotaTemplate, useQuotaTemplateMutations, useQuotaTemplates } from "./useQuotaTemplates.js";
1
2
  import "./useQuota.js";
2
- import "./useQuotaTemplates.js";
@@ -129,4 +129,3 @@ export declare function useQuotaMutations(): {
129
129
  isFreeing: boolean;
130
130
  };
131
131
  export {};
132
- //# sourceMappingURL=useQuota.d.ts.map
@@ -35,4 +35,3 @@ export declare function useQuotaTemplate(quotaId: string | undefined): UseQuotaT
35
35
  */
36
36
  export declare function useQuotaTemplateMutations(): UseQuotaTemplateMutationsResult;
37
37
  export {};
38
- //# sourceMappingURL=useQuotaTemplates.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { GetAllQuotaTemplatesDocument as e, useCreateQuotaTemplateMutation as t, useGetAllQuotaTemplatesQuery as n, useUpdateQuotaTemplateMutation as r } from "../../../../generated/global-operations.js";
2
2
  import { useCallback as i } from "react";
3
3
  import { useApolloClient as a } from "@apollo/client/react";
4
- //#region src/billing/modules/quota/hooks/useQuotaTemplates.ts
4
+ // src/billing/modules/quota/hooks/useQuotaTemplates.ts
5
5
  function o(e = {}) {
6
6
  let { onlyActive: t = !1 } = e, { data: r, loading: a, error: o, refetch: s } = n({ fetchPolicy: "cache-and-network" }), c = r?.getAllQuotas || [];
7
7
  t && (c = c.filter((e) => e.isActive));
@@ -61,7 +61,6 @@ function c() {
61
61
  isToggling: d
62
62
  };
63
63
  }
64
- //#endregion
65
64
  export { s as useQuotaTemplate, c as useQuotaTemplateMutations, o as useQuotaTemplates };
66
65
 
67
66
  //# sourceMappingURL=useQuotaTemplates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQuotaTemplates.js","names":[],"sources":["../../../../../src/billing/modules/quota/hooks/useQuotaTemplates.ts"],"sourcesContent":["/**\n * Quota Module - useQuotaTemplates Hook\n * Provides access to quota template management (admin side)\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback } from 'react';\nimport {\n useGetAllQuotaTemplatesQuery,\n useCreateQuotaTemplateMutation,\n useUpdateQuotaTemplateMutation,\n GetAllQuotaTemplatesDocument,\n} from '../../../../generated/global-operations';\nimport type { Quota, CreateQuotaInput, UpdateQuotaInput } from '../../../shared/types';\n\ninterface UseQuotaTemplatesOptions {\n onlyActive?: boolean;\n}\n\ninterface UseQuotaTemplatesResult {\n quotas: Quota[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseQuotaTemplateResult {\n quota: Quota | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseQuotaTemplateMutationsResult {\n createQuota: (input: CreateQuotaInput) => Promise<boolean>;\n updateQuota: (input: UpdateQuotaInput) => Promise<boolean>;\n toggleQuota: (id: string, isActive: boolean) => Promise<boolean>;\n isCreating: boolean;\n isUpdating: boolean;\n isToggling: boolean;\n}\n\n/**\n * Hook for fetching all quota templates\n */\nexport function useQuotaTemplates(options: UseQuotaTemplatesOptions = {}): UseQuotaTemplatesResult {\n const { onlyActive = false } = options;\n\n const { data, loading, error, refetch } = useGetAllQuotaTemplatesQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n let quotas: Quota[] = data?.getAllQuotas || [];\n\n // Filter by active status if requested\n if (onlyActive) {\n quotas = quotas.filter((quota: Quota) => quota.isActive);\n }\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n quotas,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching a single quota template by ID\n */\nexport function useQuotaTemplate(quotaId: string | undefined): UseQuotaTemplateResult {\n const { data, loading, error, refetch } = useGetAllQuotaTemplatesQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n const quotas: Quota[] = data?.getAllQuotas || [];\n const quota = quotas.find((q) => q.id === quotaId) || null;\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n quota,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for quota template mutations (create, update, toggle)\n */\nexport function useQuotaTemplateMutations(): UseQuotaTemplateMutationsResult {\n const client = useApolloClient();\n\n const [createQuotaMutation, { loading: isCreating }] = useCreateQuotaTemplateMutation();\n const [updateQuotaMutation, { loading: isUpdating }] = useUpdateQuotaTemplateMutation();\n const [toggleQuotaMutation, { loading: isToggling }] = useUpdateQuotaTemplateMutation();\n\n const createQuota = useCallback(\n async (input: CreateQuotaInput): Promise<boolean> => {\n try {\n const { data } = await createQuotaMutation({\n variables: { input },\n });\n // Refetch quotas list after creation\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.createQuota ?? false;\n } catch (error) {\n console.error('Failed to create quota:', error);\n throw error;\n }\n },\n [createQuotaMutation, client]\n );\n\n const updateQuota = useCallback(\n async (input: UpdateQuotaInput): Promise<boolean> => {\n try {\n const { data } = await updateQuotaMutation({\n variables: { input },\n });\n // Refetch quotas list after update\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.updateQuota ?? false;\n } catch (error) {\n console.error('Failed to update quota:', error);\n throw error;\n }\n },\n [updateQuotaMutation, client]\n );\n\n const toggleQuota = useCallback(\n async (id: string, isActive: boolean): Promise<boolean> => {\n try {\n const { data } = await toggleQuotaMutation({\n variables: {\n input: { id, isActive },\n },\n });\n // Refetch quotas list after toggle\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.updateQuota ?? false;\n } catch (error) {\n console.error('Failed to toggle quota:', error);\n throw error;\n }\n },\n [toggleQuotaMutation, client]\n );\n\n return {\n createQuota,\n updateQuota,\n toggleQuota,\n isCreating,\n isUpdating,\n isToggling,\n };\n}\n"],"mappings":";;;;AA6CA,SAAgB,EAAkB,IAAoC,CAAC,GAA4B;CACjG,IAAM,EAAE,gBAAa,OAAU,GAEzB,EAAE,SAAM,YAAS,UAAO,eAAY,EAA6B,EACrE,aAAa,oBACf,CAAC,GAEG,IAAkB,GAAM,gBAAgB,CAAC;CAG7C,AAAI,MACF,IAAS,EAAO,QAAQ,MAAiB,EAAM,QAAQ;CAGzD,IAAM,IAAgB,EAAY,YAAY;EAC5C,MAAM,EAAQ;CAChB,GAAG,CAAC,CAAO,CAAC;CAEZ,OAAO;EACL;EACA,WAAW;EACJ;EACP,SAAS;CACX;AACF;AAKA,SAAgB,EAAiB,GAAqD;CACpF,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA6B,EACrE,aAAa,oBACf,CAAC;CASD,OAAO;EACL,QARsB,GAAM,gBAAgB,CAAC,GAC1B,MAAM,MAAM,EAAE,OAAO,CAAO,KAAK;EAQpD,WAAW;EACJ;EACP,SARoB,EAAY,YAAY;GAC5C,MAAM,EAAQ;EAChB,GAAG,CAAC,CAAO,CAMA;CACX;AACF;AAKA,SAAgB,IAA6D;CAC3E,IAAM,IAAS,EAAgB,GAEzB,CAAC,GAAqB,EAAE,SAAS,OAAgB,EAA+B,GAChF,CAAC,GAAqB,EAAE,SAAS,OAAgB,EAA+B,GAChF,CAAC,GAAqB,EAAE,SAAS,OAAgB,EAA+B;CAuDtF,OAAO;EACL,aAtDkB,EAClB,OAAO,MAA8C;GACnD,IAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW,EAAE,SAAM,EACrB,CAAC;IAGD,OADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,CAA4B,EAAE,CAAC,GAChE,GAAM,eAAe;GAC9B,SAAS,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2B,CAAK,GACxC;GACR;EACF,GACA,CAAC,GAAqB,CAAM,CAwC5B;EACA,aAtCkB,EAClB,OAAO,MAA8C;GACnD,IAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW,EAAE,SAAM,EACrB,CAAC;IAGD,OADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,CAA4B,EAAE,CAAC,GAChE,GAAM,eAAe;GAC9B,SAAS,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2B,CAAK,GACxC;GACR;EACF,GACA,CAAC,GAAqB,CAAM,CAwB5B;EACA,aAtBkB,EAClB,OAAO,GAAY,MAAwC;GACzD,IAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW,EACT,OAAO;KAAE;KAAI;IAAS,EACxB,EACF,CAAC;IAGD,OADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,CAA4B,EAAE,CAAC,GAChE,GAAM,eAAe;GAC9B,SAAS,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2B,CAAK,GACxC;GACR;EACF,GACA,CAAC,GAAqB,CAAM,CAM5B;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useQuotaTemplates.js","names":["useQuotaTemplates","options","useGetAllQuotaTemplatesQuery","quotas","data","onlyActive","quota","handleRefetch","useCallback","refetch","loading","useQuotaTemplate","q","quotaId","useQuotaTemplateMutations","client","useApolloClient","createQuotaMutation","isCreating","useCreateQuotaTemplateMutation","updateQuotaMutation","isUpdating","useUpdateQuotaTemplateMutation","toggleQuotaMutation","isToggling","GetAllQuotaTemplatesDocument","error"],"sources":["../../../../../src/billing/modules/quota/hooks/useQuotaTemplates.ts"],"sourcesContent":["/**\n * Quota Module - useQuotaTemplates Hook\n * Provides access to quota template management (admin side)\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback } from 'react';\nimport {\n useGetAllQuotaTemplatesQuery,\n useCreateQuotaTemplateMutation,\n useUpdateQuotaTemplateMutation,\n GetAllQuotaTemplatesDocument,\n} from '../../../../generated/global-operations';\nimport type { Quota, CreateQuotaInput, UpdateQuotaInput } from '../../../shared/types';\n\ninterface UseQuotaTemplatesOptions {\n onlyActive?: boolean;\n}\n\ninterface UseQuotaTemplatesResult {\n quotas: Quota[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseQuotaTemplateResult {\n quota: Quota | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseQuotaTemplateMutationsResult {\n createQuota: (input: CreateQuotaInput) => Promise<boolean>;\n updateQuota: (input: UpdateQuotaInput) => Promise<boolean>;\n toggleQuota: (id: string, isActive: boolean) => Promise<boolean>;\n isCreating: boolean;\n isUpdating: boolean;\n isToggling: boolean;\n}\n\n/**\n * Hook for fetching all quota templates\n */\nexport function useQuotaTemplates(options: UseQuotaTemplatesOptions = {}): UseQuotaTemplatesResult {\n const { onlyActive = false } = options;\n\n const { data, loading, error, refetch } = useGetAllQuotaTemplatesQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n let quotas: Quota[] = data?.getAllQuotas || [];\n\n // Filter by active status if requested\n if (onlyActive) {\n quotas = quotas.filter((quota: Quota) => quota.isActive);\n }\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n quotas,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching a single quota template by ID\n */\nexport function useQuotaTemplate(quotaId: string | undefined): UseQuotaTemplateResult {\n const { data, loading, error, refetch } = useGetAllQuotaTemplatesQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n const quotas: Quota[] = data?.getAllQuotas || [];\n const quota = quotas.find((q) => q.id === quotaId) || null;\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n quota,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for quota template mutations (create, update, toggle)\n */\nexport function useQuotaTemplateMutations(): UseQuotaTemplateMutationsResult {\n const client = useApolloClient();\n\n const [createQuotaMutation, { loading: isCreating }] = useCreateQuotaTemplateMutation();\n const [updateQuotaMutation, { loading: isUpdating }] = useUpdateQuotaTemplateMutation();\n const [toggleQuotaMutation, { loading: isToggling }] = useUpdateQuotaTemplateMutation();\n\n const createQuota = useCallback(\n async (input: CreateQuotaInput): Promise<boolean> => {\n try {\n const { data } = await createQuotaMutation({\n variables: { input },\n });\n // Refetch quotas list after creation\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.createQuota ?? false;\n } catch (error) {\n console.error('Failed to create quota:', error);\n throw error;\n }\n },\n [createQuotaMutation, client]\n );\n\n const updateQuota = useCallback(\n async (input: UpdateQuotaInput): Promise<boolean> => {\n try {\n const { data } = await updateQuotaMutation({\n variables: { input },\n });\n // Refetch quotas list after update\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.updateQuota ?? false;\n } catch (error) {\n console.error('Failed to update quota:', error);\n throw error;\n }\n },\n [updateQuotaMutation, client]\n );\n\n const toggleQuota = useCallback(\n async (id: string, isActive: boolean): Promise<boolean> => {\n try {\n const { data } = await toggleQuotaMutation({\n variables: {\n input: { id, isActive },\n },\n });\n // Refetch quotas list after toggle\n await client.refetchQueries({ include: [GetAllQuotaTemplatesDocument] });\n return data?.updateQuota ?? false;\n } catch (error) {\n console.error('Failed to toggle quota:', error);\n throw error;\n }\n },\n [toggleQuotaMutation, client]\n );\n\n return {\n createQuota,\n updateQuota,\n toggleQuota,\n isCreating,\n isUpdating,\n isToggling,\n };\n}\n"],"mappings":";;;;AA6CA,SAAgBA,EAAkB,IAAoC,CAAC,GAA4B;CACjG,IAAM,EAAE,gBAAa,OAAUC,GAEzB,EAAE,SAAM,YAAS,UAAO,eAAYC,EAA6B,EACrE,aAAa,oBACf,CAAC,GAEGC,IAAkBC,GAAM,gBAAgB,CAAC;CAG7C,AAAIC,MACF,IAASF,EAAO,QAAQ,MAAiBG,EAAM,QAAQ;CAGzD,IAAMC,IAAgBC,EAAY,YAAY;EAC5C,MAAMC,EAAQ;CAChB,GAAG,CAACA,CAAO,CAAC;CAEZ,OAAO;EACL;EACA,WAAWC;EACJ;EACP,SAASH;CACX;AACF;AAKA,SAAgBI,EAAiB,GAAqD;CACpF,IAAM,EAAE,SAAM,YAAS,UAAO,eAAYT,EAA6B,EACrE,aAAa,oBACf,CAAC;CASD,OAAO;EACL,QARsBE,GAAM,gBAAgB,CAAC,EAAA,CAC1B,MAAM,MAAMQ,EAAE,OAAOC,CAAO,KAAK;EAQpD,WAAWH;EACJ;EACP,SARoBF,EAAY,YAAY;GAC5C,MAAMC,EAAQ;EAChB,GAAG,CAACA,CAAO,CAMA;CACX;AACF;AAKA,SAAgBK,IAA6D;CAC3E,IAAMC,IAASC,EAAgB,GAEzB,CAACC,GAAqB,EAAE,SAASC,OAAgBC,EAA+B,GAChF,CAACC,GAAqB,EAAE,SAASC,OAAgBC,EAA+B,GAChF,CAACC,GAAqB,EAAE,SAASC,OAAgBF,EAA+B;CAuDtF,OAAO;EACL,aAtDkBd,EAClB,OAAO,MAA8C;GACnD,IAAI;IACF,IAAM,EAAE,YAAS,MAAMS,EAAoB,EACzC,WAAW,EAAE,SAAM,EACrB,CAAC;IAGD,OADA,MAAMF,EAAO,eAAe,EAAE,SAAS,CAACU,CAA4B,EAAE,CAAC,GAChErB,GAAM,eAAe;GAC9B,SAASsB,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2BA,CAAK,GACxCA;GACR;EACF,GACA,CAACT,GAAqBF,CAAM,CAwC5B;EACA,aAtCkBP,EAClB,OAAO,MAA8C;GACnD,IAAI;IACF,IAAM,EAAE,YAAS,MAAMY,EAAoB,EACzC,WAAW,EAAE,SAAM,EACrB,CAAC;IAGD,OADA,MAAML,EAAO,eAAe,EAAE,SAAS,CAACU,CAA4B,EAAE,CAAC,GAChErB,GAAM,eAAe;GAC9B,SAASsB,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2BA,CAAK,GACxCA;GACR;EACF,GACA,CAACN,GAAqBL,CAAM,CAwB5B;EACA,aAtBkBP,EAClB,OAAO,GAAY,MAAwC;GACzD,IAAI;IACF,IAAM,EAAE,YAAS,MAAMe,EAAoB,EACzC,WAAW,EACT,OAAO;KAAE;KAAI;IAAS,EACxB,EACF,CAAC;IAGD,OADA,MAAMR,EAAO,eAAe,EAAE,SAAS,CAACU,CAA4B,EAAE,CAAC,GAChErB,GAAM,eAAe;GAC9B,SAASsB,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2BA,CAAK,GACxCA;GACR;EACF,GACA,CAACH,GAAqBR,CAAM,CAM5B;EACA;EACA;EACA;CACF;AACF"}
@@ -3,4 +3,3 @@
3
3
  */
4
4
  export * from './pages';
5
5
  export * from './hooks';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
- import "./hooks/useQuotaTemplates.js";
2
- import "./hooks/index.js";
3
- import { QuotaTemplatesListPage as e } from "./pages/QuotaTemplatesListPage.js";
4
- import { QuotaTemplateDetailPage as t } from "./pages/QuotaTemplateDetailPage.js";
5
- import { QuotaTemplateCreatePage as n } from "./pages/QuotaTemplateCreatePage.js";
6
- import { QuotaTemplateEditPage as r } from "./pages/QuotaTemplateEditPage.js";
7
- import { QuotaAssignFreePage as i } from "./pages/QuotaAssignFreePage.js";
1
+ import { useQuotaTemplate as e, useQuotaTemplateMutations as t, useQuotaTemplates as n } from "./hooks/useQuotaTemplates.js";
8
2
  import "./pages/index.js";
9
- export { i as QuotaAssignFreePage, n as QuotaTemplateCreatePage, t as QuotaTemplateDetailPage, r as QuotaTemplateEditPage, e as QuotaTemplatesListPage };
3
+ import { QuotaTemplatesListPage as r } from "./pages/QuotaTemplatesListPage.js";
4
+ import { QuotaTemplateDetailPage as i } from "./pages/QuotaTemplateDetailPage.js";
5
+ import { QuotaTemplateCreatePage as a } from "./pages/QuotaTemplateCreatePage.js";
6
+ import { QuotaTemplateEditPage as o } from "./pages/QuotaTemplateEditPage.js";
7
+ import { QuotaAssignFreePage as s } from "./pages/QuotaAssignFreePage.js";
8
+ import "./hooks/index.js";
9
+ export { s as QuotaAssignFreePage, a as QuotaTemplateCreatePage, i as QuotaTemplateDetailPage, o as QuotaTemplateEditPage, r as QuotaTemplatesListPage, e as useQuotaTemplate, t as useQuotaTemplateMutations, n as useQuotaTemplates };
@@ -1,3 +1,2 @@
1
1
  import { FC } from 'react';
2
2
  export declare const QuotaAssignFreePage: FC;
3
- //# sourceMappingURL=QuotaAssignFreePage.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
2
  import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
+ import { useAssignQuotaFreeMutation as n } from "../../../../generated/global-operations.js";
4
+ import { useBillingNavigate as r } from "../../../hooks/useBillingNavigate.js";
5
+ import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
3
6
  import "../../../shared/components/index.js";
4
- import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
5
- import { useAssignQuotaFreeMutation as r } from "../../../../generated/global-operations.js";
6
- import { useBillingNavigate as i } from "../../../hooks/useBillingNavigate.js";
7
7
  import { useQuotas as a } from "../../plans/hooks/useQuotas.js";
8
8
  import "../../plans/hooks/index.js";
9
9
  import { filterQuotas as o, getQuotaScopeLabel as s } from "../utils/quotaSelector.js";
@@ -12,12 +12,12 @@ import { Check as u, ChevronsUpDown as d } from "lucide-react";
12
12
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
13
  import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
14
  import { Command as h, CommandEmpty as g, CommandInput as _, CommandItem as v, CommandList as y, PagePurpose as b, Popover as x, PopoverContent as S, PopoverTrigger as C } from "@burdenoff/fe-libs/ui";
15
- //#region src/billing/modules/quota/pages/QuotaAssignFreePage.tsx
15
+ // src/billing/modules/quota/pages/QuotaAssignFreePage.tsx
16
16
  var w = () => {
17
17
  let { t: w } = m(), T = (e, t) => {
18
18
  let n = w(e);
19
19
  return n === e ? t : n;
20
- }, E = i(), D = n(), [O, k] = l(""), [A, j] = l(""), [M, N] = l(""), [P, F] = l(!1), [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l(""), [W, G] = l(null), { quotas: K, isLoading: q } = a({ onlyActive: !0 }), [J, { loading: Y }] = r(), X = K.find((e) => e.id === M), Z = X?.scope === "WORKSPACE", Q = c(() => o(K, I), [K, I]), $ = c(() => X?.limits?.value, [X]), ee = (e) => {
20
+ }, E = r(), D = i(), [O, k] = l(""), [A, j] = l(""), [M, N] = l(""), [P, F] = l(!1), [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l(""), [W, G] = l(null), { quotas: K, isLoading: q } = a({ onlyActive: !0 }), [J, { loading: Y }] = n(), X = K.find((e) => e.id === M), Z = X?.scope === "WORKSPACE", Q = c(() => o(K, I), [K, I]), $ = c(() => X?.limits?.value, [X]), ee = (e) => {
21
21
  N(e), z(""), F(!1), L("");
22
22
  };
23
23
  return D.canManageQuotas ? /* @__PURE__ */ p("div", {
@@ -57,14 +57,11 @@ var w = () => {
57
57
  }),
58
58
  /* @__PURE__ */ p("form", {
59
59
  onSubmit: async (e) => {
60
- if (e.preventDefault(), G(null), !O.trim() || !A.trim() || !M) {
61
- G({
62
- success: !1,
63
- message: "All fields are required."
64
- });
65
- return;
66
- }
67
- try {
60
+ if (e.preventDefault(), G(null), !O.trim() || !A.trim() || !M) G({
61
+ success: !1,
62
+ message: "All fields are required."
63
+ });
64
+ else try {
68
65
  let { data: e } = await J({ variables: {
69
66
  secret: O.trim(),
70
67
  billingAccountId: A.trim(),
@@ -81,9 +78,10 @@ var w = () => {
81
78
  }), k(""), j(""), N(""), F(!1), L(""), z(""), V(""), U("");
82
79
  }
83
80
  } catch (e) {
81
+ let t = e instanceof Error ? e.message : "Failed to assign quota.";
84
82
  G({
85
83
  success: !1,
86
- message: e instanceof Error ? e.message : "Failed to assign quota."
84
+ message: t
87
85
  });
88
86
  }
89
87
  },
@@ -305,7 +303,6 @@ var w = () => {
305
303
  ]
306
304
  }) : /* @__PURE__ */ f(e, { message: T("billing.quotaAssignFree.noPermission", "You don't have permission to access this page.") });
307
305
  };
308
- //#endregion
309
306
  export { w as QuotaAssignFreePage };
310
307
 
311
308
  //# sourceMappingURL=QuotaAssignFreePage.js.map